@desplega.ai/agent-swarm 1.157.0 → 1.159.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (403) hide show
  1. package/dist/{acp-adapter-qhqrk4q0.js → acp-adapter-qhch0n2v.js} +1 -1
  2. package/dist/{actions-9rrg0zxm.js → actions-dtsh1mfb.js} +33 -29
  3. package/dist/{anthropic-messages-51pz26qe.js → anthropic-messages-f2h06k64.js} +8 -3
  4. package/dist/{app-enysy1zd.js → app-y1b9srva.js} +10 -9
  5. package/dist/{artifact-td4q4dch.js → artifact-3v5t9jtg.js} +1 -1
  6. package/dist/{assistant-zegamy48.js → assistant-31hwy5xj.js} +34 -30
  7. package/dist/{azure-openai-responses-8gksqtmz.js → azure-openai-responses-0k1mfax5.js} +12 -13
  8. package/dist/{boot-reembed-zfxb937k.js → boot-reembed-48d2qpkt.js} +11 -11
  9. package/dist/{boot-reembed-r6shx5qx.js → boot-reembed-w0bryhkr.js} +12 -12
  10. package/dist/{boot-scrub-logs-k5y0se6r.js → boot-scrub-logs-t65wbrn7.js} +9 -8
  11. package/dist/boot-seeds-h7c32hvm.js +27 -0
  12. package/dist/{claude-adapter-5yc7hxwv.js → claude-adapter-1t6611ne.js} +26 -21
  13. package/dist/{claude-managed-adapter-ea2aga6w.js → claude-managed-adapter-werp659j.js} +4 -2
  14. package/dist/{claude-managed-setup-60g8aazx.js → claude-managed-setup-y6rdgbc1.js} +11 -2
  15. package/dist/claude-sdk-session-zhkyk8yw.js +29319 -0
  16. package/dist/{cli-vj6h9kc2.js → cli-0m7wct0d.js} +59 -1
  17. package/dist/{cli-xf5b7y1f.js → cli-0n2e4x49.js} +13 -5
  18. package/dist/cli-0xqde53b.js +176 -0
  19. package/dist/{cli-nbp6m6gp.js → cli-10ym38qc.js} +53 -28
  20. package/dist/{cli-5b6b62tz.js → cli-13hw4z91.js} +1 -1
  21. package/dist/{cli-tpv97m71.js → cli-20035trh.js} +286 -84
  22. package/dist/{cli-k0g1sjzm.js → cli-31nkw3g3.js} +3 -3
  23. package/dist/cli-3gvrr8vj.js +1422 -0
  24. package/dist/{cli-sgyqyyxe.js → cli-48527fpw.js} +10 -8
  25. package/dist/{cli-24k806sc.js → cli-4aj25szq.js} +2 -2
  26. package/dist/{cli-s98skd5r.js → cli-4tvgz99m.js} +7 -7
  27. package/dist/cli-503ya656.js +455 -0
  28. package/dist/{cli-cw9zck8j.js → cli-5f2hq128.js} +8 -4
  29. package/dist/{cli-p37sg0a9.js → cli-68bmme5p.js} +11078 -27833
  30. package/dist/{cli-01vfmq8c.js → cli-79aq9cgb.js} +1318 -644
  31. package/dist/cli-7cxw8b60.js +14910 -0
  32. package/dist/cli-7kyk9jr3.js +22 -0
  33. package/dist/cli-7zttzetj.js +324 -0
  34. package/dist/{cli-y95wp3tg.js → cli-96qd5psa.js} +1 -1
  35. package/dist/{cli-ytxs7mn1.js → cli-9yg65c1j.js} +39 -0
  36. package/dist/{cli-3gmcwfyx.js → cli-ardpzhjm.js} +5 -5
  37. package/dist/{cli-y3nxwx0t.js → cli-b6thtzac.js} +20 -13
  38. package/dist/{cli-00w2c66p.js → cli-bgv70kym.js} +13 -2
  39. package/dist/{cli-r9ee9c4w.js → cli-bv0a38v9.js} +162 -42
  40. package/dist/cli-ca2w7zv7.js +115 -0
  41. package/dist/cli-cpvsaqsw.js +333 -0
  42. package/dist/cli-cygyqj3b.js +754 -0
  43. package/dist/{cli-5j7bm4tb.js → cli-dvjpkkjd.js} +6 -6
  44. package/dist/{cli-005pze6s.js → cli-e0ndxhtk.js} +4 -4
  45. package/dist/{cli-h0wdadsx.js → cli-e4xnc0qp.js} +21 -5
  46. package/dist/{cli-jytrw2na.js → cli-eg7cdg68.js} +8 -8
  47. package/dist/cli-ejpygnqz.js +3815 -0
  48. package/dist/{cli-c41wjx0r.js → cli-fjtp3463.js} +1917 -134
  49. package/dist/{cli-zt1227k1.js → cli-fkqhbg8g.js} +5 -3
  50. package/dist/{cli-awwphhcs.js → cli-g9df2m37.js} +765 -288
  51. package/dist/cli-gzyh0j0g.js +8455 -0
  52. package/dist/cli-hgqfttfc.js +183 -0
  53. package/dist/cli-hj65wsts.js +17755 -0
  54. package/dist/cli-j9z8mfx3.js +476 -0
  55. package/dist/{cli-aehm1rbq.js → cli-kc3dp84d.js} +1135 -61
  56. package/dist/{cli-h38x0qhg.js → cli-kdnehe0t.js} +4 -3
  57. package/dist/{cli-yscm6cv8.js → cli-m4excttz.js} +1993 -2216
  58. package/dist/{cli-74h6f2bp.js → cli-mg24hkt4.js} +2 -2
  59. package/dist/{cli-vx9p3qdt.js → cli-mzkqpxee.js} +1 -1
  60. package/dist/{cli-tjmghmm5.js → cli-phsaj4xq.js} +29 -4
  61. package/dist/{cli-pw9rj5t9.js → cli-pqetb83f.js} +1 -176
  62. package/dist/{cli-n6zq3kbd.js → cli-qjxy52w7.js} +1 -1
  63. package/dist/{cli-wb2zvbfg.js → cli-qv4jv8bx.js} +1 -1
  64. package/dist/cli-qvnnx4ct.js +1051 -0
  65. package/dist/cli-rb9m6rpe.js +4980 -0
  66. package/dist/{cli-tt9k8r35.js → cli-rfezr056.js} +476 -909
  67. package/dist/{cli-ggm92wcn.js → cli-rgjprct3.js} +1 -0
  68. package/dist/{cli-9n76jszt.js → cli-rrqmqr1s.js} +1 -1
  69. package/dist/cli-rykfmgwg.js +102 -0
  70. package/dist/cli-t1ze64h3.js +811 -0
  71. package/dist/{cli-eetrvv91.js → cli-t3p77qk1.js} +1 -1
  72. package/dist/{cli-scwq51gn.js → cli-vn0qv9cj.js} +25 -82
  73. package/dist/{cli-wsed24mk.js → cli-vwbbaecp.js} +2 -2
  74. package/dist/cli-wd9hz40d.js +69 -0
  75. package/dist/{cli-9p33cz9h.js → cli-wgjx0q33.js} +90 -32
  76. package/dist/cli-xgpf00sk.js +2149 -0
  77. package/dist/{cli-mcnhgnn1.js → cli-ykk5jaax.js} +184 -26
  78. package/dist/{cli-f3va018d.js → cli-z9x0sh1t.js} +26 -93
  79. package/dist/{cli-58rgvkt4.js → cli-zw65mab6.js} +5 -5
  80. package/dist/cli.js +56 -33
  81. package/dist/cloudflare-workers-ai-system-one-1sg586qv.js +46 -0
  82. package/dist/{codex-adapter-gns3s6c3.js → codex-adapter-jqfqqa21.js} +20 -13
  83. package/dist/{codex-hook-9hptmdhj.js → codex-hook-5eys3dya.js} +2 -2
  84. package/dist/{codex-session-runner-gqnxys5w.js → codex-session-runner-zd341dsm.js} +20 -13
  85. package/dist/{commands-hxy2y2sp.js → commands-vfsysz4s.js} +9 -8
  86. package/dist/{db-w8ghhsgf.js → db-s3znhvbn.js} +29 -10
  87. package/dist/{dispatcher-cp1rknjz.js → dispatcher-5xn0c7rf.js} +32 -28
  88. package/dist/{dsh-adapter-1dwg97zv.js → dsh-adapter-894mgfvs.js} +3 -3
  89. package/dist/{e2b-93x1k0j5.js → e2b-ez07znam.js} +4 -3
  90. package/dist/execute-71ysgv35.js +965 -0
  91. package/dist/{google-generative-ai-bxmv50nc.js → google-generative-ai-1nfcdphp.js} +5 -4
  92. package/dist/{google-vertex-809af514.js → google-vertex-1tqcd7b1.js} +5 -4
  93. package/dist/{handlers-egfhr351.js → handlers-5w4jwycr.js} +35 -31
  94. package/dist/{hook-x4kftwzt.js → hook-853bxrr6.js} +32 -21
  95. package/dist/{hook-fbxjqfjz.js → hook-z0hbxj85.js} +16 -13
  96. package/dist/{http-c7jfx990.js → http-akc3wy3m.js} +989 -275
  97. package/dist/{index-f6cryxwe.js → index-4a5njnm1.js} +2 -59
  98. package/dist/{index-jtvpgb8f.js → index-5sz16ksh.js} +208 -65
  99. package/dist/{index-dc2ek6bw.js → index-bjmjh9h4.js} +11 -11
  100. package/dist/{index-yy07ef2s.js → index-cd151qkq.js} +32 -28
  101. package/dist/{index-r6bty6tb.js → index-k661dzzr.js} +33 -29
  102. package/dist/{index-4k9hct21.js → index-ttpbhnjg.js} +32 -28
  103. package/dist/{keepalive-f7ekefyc.js → keepalive-8p9rpvz5.js} +11 -10
  104. package/dist/{lead-h053syts.js → lead-jp69z5h3.js} +49 -45
  105. package/dist/llama-cpp-classify-t2tccams.js +335 -0
  106. package/dist/{maintenance-a3w6zs54.js → maintenance-fwx4ev0k.js} +12 -12
  107. package/dist/{mistral-conversations-zx0kn554.js → mistral-conversations-bhvwqcnk.js} +14 -17
  108. package/dist/{oauth-refresh-sweep-vra1dhkd.js → oauth-refresh-sweep-cwcq1ctx.js} +10 -9
  109. package/dist/{onboard-mfgzeqxs.js → onboard-2b4q0t84.js} +282 -84
  110. package/dist/{openai-codex-responses-4vjqzvjp.js → openai-codex-responses-nekthgks.js} +21 -8
  111. package/dist/{openai-completions-9hjrqbw8.js → openai-completions-hxtzwj0s.js} +8 -11
  112. package/dist/{openai-responses-7b1pn0xt.js → openai-responses-w4r118w7.js} +22 -17
  113. package/dist/{opencode-adapter-z64xjzec.js → opencode-adapter-zz7xvjj6.js} +6 -4
  114. package/dist/{openrouter-images-9f9ek4rw.js → openrouter-images-b6sqqjgn.js} +4 -6
  115. package/dist/{otel-impl-2ez6xk57.js → otel-impl-g8rs4vwr.js} +416 -301
  116. package/dist/{pi-messages-txpjj39q.js → pi-messages-vxdt8v7j.js} +2 -1
  117. package/dist/{pi-mono-adapter-2b7mw16r.js → pi-mono-adapter-n0me28wt.js} +29 -17
  118. package/dist/pricing-refresh-0v77385v.js +39 -0
  119. package/dist/{rbac-roles-nm6924sy.js → rbac-roles-krjyazbj.js} +10 -9
  120. package/dist/{render-v2-f026j6c4.js → render-v2-3wjsp9aw.js} +10 -9
  121. package/dist/runtime-ktjysacx.js +24 -0
  122. package/dist/{setup-w606fr1q.js → setup-yeqryke6.js} +6 -5
  123. package/dist/typesafe-system-one-96960jxp.js +27 -0
  124. package/dist/{virtual-modules-8qheft18.js → virtual-modules-dzdeq1sf.js} +21 -13
  125. package/dist/{work-objects-ezmggdne.js → work-objects-3pakpkw0.js} +35 -31
  126. package/dist/{worker-1mbyv29k.js → worker-85testgj.js} +49 -45
  127. package/openapi.json +3288 -1442
  128. package/package.json +10 -8
  129. package/src/apps/catalog.generated.json +229 -0
  130. package/src/apps/page-validator.ts +71 -16
  131. package/src/apps/row-store.ts +66 -11
  132. package/src/apps/sync.ts +59 -17
  133. package/src/artifact-sdk/browser-sdk.ts +436 -2
  134. package/src/be/approval-sweeps.ts +109 -0
  135. package/src/be/boot-seeds.ts +40 -0
  136. package/src/be/chunking.ts +1 -1
  137. package/src/be/db/agents.ts +40 -0
  138. package/src/be/db/approvals.ts +78 -0
  139. package/src/be/db/tasks/human-free.ts +442 -0
  140. package/src/be/db/tasks/read.ts +252 -39
  141. package/src/be/db/tasks/write.ts +148 -20
  142. package/src/be/db-client.ts +107 -48
  143. package/src/be/db.ts +308 -241
  144. package/src/be/events.ts +33 -1
  145. package/src/be/harness-model-support.ts +182 -0
  146. package/src/be/human-free-drain.ts +67 -0
  147. package/src/be/memory/graph-expansion.ts +10 -3
  148. package/src/be/memory/providers/sqlite-store.ts +55 -13
  149. package/src/be/memory/raters/retrieval.ts +5 -2
  150. package/src/be/memory/reranker.ts +26 -2
  151. package/src/be/memory/types.ts +2 -0
  152. package/src/be/migrations/166_approval_request_auto_cancellation.sql +9 -0
  153. package/src/be/migrations/171_memory_retrieval_relevance.sql +8 -0
  154. package/src/be/migrations/175_workflow_runs_list_index.sql +11 -0
  155. package/src/be/migrations/177_events_event_agent_created_index.sql +11 -0
  156. package/src/be/migrations/182_task_human_free_flag.sql +63 -0
  157. package/src/be/migrations/183_human_free_reclassify_queue.sql +25 -0
  158. package/src/be/migrations/184_model_catalog.sql +120 -0
  159. package/src/be/model-catalog-store.ts +644 -0
  160. package/src/be/model-tier-keys.ts +31 -0
  161. package/src/be/model-tier-resolution.ts +489 -0
  162. package/src/be/model-validation.ts +112 -0
  163. package/src/be/models-catalog.ts +63 -7
  164. package/src/be/modelsdev-cache.json +1939 -0
  165. package/src/be/modelsdev-cache.ts +16 -1
  166. package/src/be/pricing-normalize.ts +2 -0
  167. package/src/be/pricing-refresh.ts +154 -12
  168. package/src/be/scripts/typecheck.ts +16 -0
  169. package/src/be/seed-pricing.ts +3 -1
  170. package/src/be/seed-scripts/catalog/task-failure-audit.ts +61 -9
  171. package/src/be/seed-skills/bundled-files.generated.json +1 -1
  172. package/src/be/steering.ts +53 -3
  173. package/src/be/swarm-config-guard.ts +9 -0
  174. package/src/be/task-citations.ts +29 -0
  175. package/src/cli.tsx +24 -1
  176. package/src/commands/claude-managed-setup.ts +3 -1
  177. package/src/commands/onboard/compose-generator.ts +8 -3
  178. package/src/commands/onboard/container-engine.ts +220 -0
  179. package/src/commands/onboard/manifest.ts +1 -0
  180. package/src/commands/onboard/steps/health-check.tsx +4 -1
  181. package/src/commands/onboard/steps/prereq-check.tsx +50 -54
  182. package/src/commands/onboard/steps/start.tsx +31 -16
  183. package/src/commands/onboard/types.ts +7 -2
  184. package/src/commands/onboard.tsx +39 -4
  185. package/src/commands/profile-sync.ts +79 -26
  186. package/src/commands/runner.ts +84 -3
  187. package/src/extensions/catalog.generated.json +17 -0
  188. package/src/extensions/contract-types.generated.ts +1 -1
  189. package/src/heartbeat/heartbeat.ts +323 -114
  190. package/src/heartbeat/templates.ts +2 -2
  191. package/src/hooks/hook.ts +21 -12
  192. package/src/http/agents.ts +84 -1
  193. package/src/http/approval-requests.ts +136 -64
  194. package/src/http/apps.ts +14 -3
  195. package/src/http/config.ts +15 -1
  196. package/src/http/events.ts +62 -2
  197. package/src/http/index.ts +14 -4
  198. package/src/http/memory.ts +21 -7
  199. package/src/http/models-catalog.ts +357 -8
  200. package/src/http/poll.ts +45 -2
  201. package/src/http/schedules.ts +37 -7
  202. package/src/http/session-data.ts +11 -9
  203. package/src/http/sessions.ts +25 -18
  204. package/src/http/stats.ts +25 -15
  205. package/src/http/status.ts +11 -1
  206. package/src/http/tasks.ts +66 -9
  207. package/src/http/usage-cache.ts +56 -15
  208. package/src/http/webhooks.ts +67 -46
  209. package/src/http/workflows.ts +50 -28
  210. package/src/linear/outbound.ts +37 -15
  211. package/src/otel-impl.ts +151 -1
  212. package/src/otel.ts +14 -3
  213. package/src/prompts/memories.ts +19 -2
  214. package/src/prompts/session-templates.ts +1 -0
  215. package/src/providers/claude-managed-models.ts +47 -153
  216. package/src/providers/codex-adapter.ts +4 -4
  217. package/src/providers/codex-models.ts +65 -198
  218. package/src/providers/reasoning-effort.ts +44 -140
  219. package/src/rbac/legacy-policy.ts +41 -0
  220. package/src/rbac/permissions.ts +14 -0
  221. package/src/scheduler/schedule-task.ts +3 -0
  222. package/src/scripts-runtime/sdk-allowlist.ts +5 -0
  223. package/src/scripts-runtime/swarm-sdk.ts +9 -0
  224. package/src/scripts-runtime/types/stdlib.d.ts +16 -0
  225. package/src/scripts-runtime/types/swarm-extension.d.ts +4 -0
  226. package/src/scripts-runtime/types/swarm-sdk.d.ts +16 -0
  227. package/src/server.ts +18 -7
  228. package/src/slack/app.ts +35 -4
  229. package/src/slack/connection-state.ts +17 -0
  230. package/src/slack/message-text.ts +56 -2
  231. package/src/slack/thread-buffer.ts +10 -2
  232. package/src/tasks/context-key.ts +1 -0
  233. package/src/tasks/worker-follow-up.ts +6 -2
  234. package/src/tests/agent-task-activity.test.ts +74 -0
  235. package/src/tests/agents-list-model-display.test.ts +9 -6
  236. package/src/tests/approval-auto-cancellation-migration.test.ts +104 -0
  237. package/src/tests/approval-requests.test.ts +395 -0
  238. package/src/tests/approval-sweeps-config.test.ts +47 -0
  239. package/src/tests/approval-sweeps.test.ts +508 -0
  240. package/src/tests/apps-kibo-blocks.test.ts +77 -0
  241. package/src/tests/apps-spike.test.ts +56 -1
  242. package/src/tests/apps-sync-engine.test.ts +20 -9
  243. package/src/tests/base-prompt.test.ts +3 -0
  244. package/src/tests/boot-seeds.test.ts +170 -0
  245. package/src/tests/cancel-approval-request-tool.test.ts +115 -0
  246. package/src/tests/claude-adapter.test.ts +10 -0
  247. package/src/tests/claude-managed-adapter.test.ts +17 -17
  248. package/src/tests/codex-adapter.test.ts +2 -1
  249. package/src/tests/codex-gpt6-release.test.ts +66 -5
  250. package/src/tests/config-key-filter.test.ts +80 -0
  251. package/src/tests/context-window.test.ts +8 -5
  252. package/src/tests/db-client-busy-retry.test.ts +96 -0
  253. package/src/tests/db-client.test.ts +60 -1
  254. package/src/tests/db-extraction-contract.test.ts +1 -0
  255. package/src/tests/db-task-read-contract.test.ts +15 -1
  256. package/src/tests/db-task-write-contract.test.ts +13 -1
  257. package/src/tests/docs-index-footprint.test.js +3 -3
  258. package/src/tests/events-http.test.ts +103 -0
  259. package/src/tests/explicit-model-validation.test.ts +332 -0
  260. package/src/tests/extensions-catalog.test.ts +22 -17
  261. package/src/tests/extensions-pre-task.test.ts +107 -0
  262. package/src/tests/fixtures/kibo-blocks-definition.json.txt +105 -0
  263. package/src/tests/follow-up-config-inheritance.test.ts +260 -0
  264. package/src/tests/harness-model-support.test.ts +374 -0
  265. package/src/tests/heartbeat-checklist-config.test.ts +71 -0
  266. package/src/tests/heartbeat-checklist.test.ts +4 -2
  267. package/src/tests/heartbeat-orphan-resume.test.ts +132 -0
  268. package/src/tests/heartbeat-reboot-live.test.ts +95 -0
  269. package/src/tests/heartbeat-stall-cas.test.ts +80 -0
  270. package/src/tests/heartbeat.test.ts +99 -3
  271. package/src/tests/hook-mcp-config.test.ts +29 -0
  272. package/src/tests/http-api-integration.test.ts +16 -2
  273. package/src/tests/human-free-flag.test.ts +279 -0
  274. package/src/tests/human-free-oracle.ts +57 -0
  275. package/src/tests/human-free-reclassify.test.ts +669 -0
  276. package/src/tests/kv-storage.test.ts +62 -0
  277. package/src/tests/linear-outbound-sync.test.ts +120 -5
  278. package/src/tests/list-endpoint-slimming.test.ts +91 -0
  279. package/src/tests/memory-graph-organic-route.test.ts +155 -0
  280. package/src/tests/memory-http-recall-gating.test.ts +14 -4
  281. package/src/tests/memory-hybrid.test.ts +161 -1
  282. package/src/tests/memory-prompt-recall-crowdout.test.ts +297 -0
  283. package/src/tests/memory.test.ts +22 -0
  284. package/src/tests/migration-046-budgets.test.ts +3 -3
  285. package/src/tests/model-catalog-migration.test.ts +134 -0
  286. package/src/tests/model-catalog-table.test.ts +249 -0
  287. package/src/tests/model-catalog-write-access.test.ts +387 -0
  288. package/src/tests/model-tier-resolution.test.ts +519 -0
  289. package/src/tests/models-catalog.test.ts +1 -1
  290. package/src/tests/multi-runtime-enabled-stats.test.ts +65 -1
  291. package/src/tests/onboard-container-engine.test.ts +240 -0
  292. package/src/tests/otel-event-loop-and-logs.test.ts +99 -0
  293. package/src/tests/package-publish.test.ts +137 -36
  294. package/src/tests/pricing-routes.test.ts +16 -2
  295. package/src/tests/profile-sync-warning.test.ts +8 -4
  296. package/src/tests/promote-draft-task-route.test.ts +19 -0
  297. package/src/tests/provider-registration.test.ts +296 -42
  298. package/src/tests/rbac-engine.test.ts +72 -2
  299. package/src/tests/reasoning-effort.test.ts +117 -0
  300. package/src/tests/refresh-modelsdev-carryforward.test.ts +5 -5
  301. package/src/tests/runtime-model-catalog.test.ts +86 -0
  302. package/src/tests/script-connections.test.ts +12 -0
  303. package/src/tests/sdk-allowlist.test.ts +39 -0
  304. package/src/tests/seed-scripts.test.ts +89 -0
  305. package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
  306. package/src/tests/session-costs.test.ts +14 -11
  307. package/src/tests/sessions-detail-batch.test.ts +250 -0
  308. package/src/tests/sessions.test.ts +118 -0
  309. package/src/tests/slack-config.test.ts +22 -0
  310. package/src/tests/slack-message-text.test.ts +101 -0
  311. package/src/tests/slack-thread-buffer-context.test.ts +93 -0
  312. package/src/tests/sonnet-5-5-registry.test.ts +44 -0
  313. package/src/tests/status.test.ts +36 -1
  314. package/src/tests/swarm-diff.test.ts +316 -10
  315. package/src/tests/task-cascade-fail.test.ts +148 -2
  316. package/src/tests/task-completion-idempotency.test.ts +2 -1
  317. package/src/tests/tasks-requested-by-filter.test.ts +3 -1
  318. package/src/tests/tool-annotations.test.ts +1 -1
  319. package/src/tests/ui-list-slim-projections.test.ts +158 -0
  320. package/src/tests/usage-cache.test.ts +166 -0
  321. package/src/tests/webhooks-task-blocked.test.ts +127 -0
  322. package/src/tests/workflow-approval-recovery.test.ts +203 -0
  323. package/src/tests/workflow-executors.test.ts +5 -2
  324. package/src/tests/workflow-hitl-routing.test.ts +22 -1
  325. package/src/tests/workflow-hitl-slack-card.test.ts +52 -0
  326. package/src/tests/workflow-http-v2.test.ts +99 -8
  327. package/src/tests/workflow-retry-validation.test.ts +56 -0
  328. package/src/tests/workflow-system-one-decision-review.test.ts +1021 -0
  329. package/src/tests/workflow-system-one-decision-save-warnings.test.ts +365 -0
  330. package/src/tests/workflow-system-one-decision.test.ts +2063 -0
  331. package/src/tests/workflow-tla-races.test.ts +389 -0
  332. package/src/tests/workflow-validation-port-routing.test.ts +113 -1
  333. package/src/tools/cancel-approval-request.ts +57 -0
  334. package/src/tools/memory-search.ts +1 -0
  335. package/src/tools/model-catalog/index.ts +137 -0
  336. package/src/tools/request-human-input.ts +4 -2
  337. package/src/tools/schedules/create-schedule.ts +16 -1
  338. package/src/tools/schedules/patch-schedule.ts +17 -0
  339. package/src/tools/schedules/update-schedule.ts +17 -0
  340. package/src/tools/send-task.ts +18 -0
  341. package/src/tools/task-action.ts +12 -0
  342. package/src/tools/templates.ts +19 -0
  343. package/src/tools/tool-config.ts +5 -2
  344. package/src/tools/workflows/create-workflow.ts +9 -2
  345. package/src/tools/workflows/list-workflow-runs.ts +1 -0
  346. package/src/tools/workflows/patch-workflow-node.ts +17 -7
  347. package/src/tools/workflows/patch-workflow.ts +9 -2
  348. package/src/tools/workflows/update-workflow.ts +9 -2
  349. package/src/types.ts +68 -1
  350. package/src/utils/context-window.ts +47 -52
  351. package/src/utils/harness-cli-version.ts +115 -0
  352. package/src/utils/harness-model-error.ts +33 -0
  353. package/src/utils/runtime-model-catalog.ts +137 -0
  354. package/src/workflows/approval-cancel.ts +152 -0
  355. package/src/workflows/approval-notifications.ts +84 -0
  356. package/src/workflows/approval-resolution.ts +39 -0
  357. package/src/workflows/checkpoint.ts +10 -5
  358. package/src/workflows/definition.ts +28 -0
  359. package/src/workflows/engine.ts +221 -22
  360. package/src/workflows/executors/agent-task.ts +9 -0
  361. package/src/workflows/executors/base.ts +53 -0
  362. package/src/workflows/executors/human-in-the-loop.ts +9 -9
  363. package/src/workflows/executors/index.ts +1 -0
  364. package/src/workflows/executors/registry.ts +2 -0
  365. package/src/workflows/executors/system-one-decision.ts +1232 -0
  366. package/src/workflows/executors/system-one-providers.ts +301 -0
  367. package/src/workflows/executors/workflow-llm.ts +13 -1
  368. package/src/workflows/readiness.ts +86 -0
  369. package/src/workflows/recovery.ts +100 -45
  370. package/src/workflows/resume.ts +71 -26
  371. package/src/workflows/retry-poller.ts +71 -21
  372. package/templates/extensions/README.md +1 -0
  373. package/templates/extensions/github-sender-allowlist/README.md +18 -0
  374. package/templates/extensions/github-sender-allowlist/hooks.ts +55 -0
  375. package/templates/extensions/github-sender-allowlist/manifest.json +8 -0
  376. package/templates/schedules/daily-blocker-digest/content.md +4 -5
  377. package/templates/skills/agent-browser/SKILL.md +6 -5
  378. package/templates/skills/agent-browser/content.md +6 -5
  379. package/templates/skills/apps/content.md +20 -1
  380. package/templates/skills/code-quality/content.md +26 -1
  381. package/templates/skills/heartbeat-runbook/config.json +1 -1
  382. package/templates/skills/heartbeat-runbook/content.md +2 -2
  383. package/templates/skills/pages/content.md +16 -4
  384. package/templates/skills/pages/files/examples/multiplayer-board.html +3 -12
  385. package/templates/skills/swarm-scripts/SKILL.md +1 -1
  386. package/templates/skills/swarm-scripts/content.md +1 -1
  387. package/templates/skills/workflow-iterate/content.md +81 -1
  388. package/templates/workflows/claude-code-changelog-watch/content.md +2 -0
  389. package/templates/workflows/pr-review-status-sweep/content.md +2 -0
  390. package/dist/claude-sdk-session-j4ywn3xf.js +0 -39108
  391. package/dist/cli-2daksqps.js +0 -378
  392. package/dist/cli-6jjzxv3b.js +0 -246
  393. package/dist/cli-avkd6mqv.js +0 -6052
  394. package/dist/cli-aw1jwp1r.js +0 -14075
  395. package/dist/cli-e781c6f9.js +0 -60
  396. package/dist/cli-v53rbqp3.js +0 -1101
  397. package/dist/cli-vapyk8sw.js +0 -20
  398. package/dist/pricing-refresh-6sw65tck.js +0 -27
  399. package/dist/rbac-roles-3gxmnb20.js +0 -37
  400. package/dist/seed-pricing-vqxa06qf.js +0 -26
  401. package/src/providers/modelsdev-reasoning.json +0 -5902
  402. package/dist/{codex-login-x3jk4etn.js → codex-login-he9vrn90.js} +3 -3
  403. package/dist/{index-f24115ge.js → index-2wsdsnmm.js} +3 -3
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_react_jsx_dev_runtime_development
3
- } from "./cli-zt1227k1.js";
3
+ } from "./cli-fkqhbg8g.js";
4
4
  import {
5
5
  __commonJS,
6
6
  __toESM
@@ -7,15 +7,21 @@ import {
7
7
  import {
8
8
  Anthropic
9
9
  } from "./cli-j490egb5.js";
10
+ import {
11
+ checkToolLoop
12
+ } from "./cli-hp1n6zq3.js";
10
13
  import {
11
14
  CONTEXT_FORMULA,
12
15
  clampContextPercent,
13
16
  computeContextUsedUnified,
14
17
  getContextWindowSize
15
- } from "./cli-e781c6f9.js";
18
+ } from "./cli-wd9hz40d.js";
16
19
  import {
17
- checkToolLoop
18
- } from "./cli-hp1n6zq3.js";
20
+ runtimeCatalogModel
21
+ } from "./cli-m4excttz.js";
22
+ import {
23
+ init_src
24
+ } from "./cli-7zttzetj.js";
19
25
  import {
20
26
  init_secret_scrubber,
21
27
  scrubSecrets
@@ -25,91 +31,28 @@ import {
25
31
  init_secret_scrubber();
26
32
 
27
33
  // src/providers/claude-managed-models.ts
28
- var CLAUDE_MANAGED_MODEL_PRICING = {
29
- "claude-fable-5-1": {
30
- inputPerMillion: 10,
31
- outputPerMillion: 50,
32
- cacheReadPerMillion: 0.25,
33
- cacheWritePerMillion: 12.5
34
- },
35
- "claude-mythos-5-1": {
36
- inputPerMillion: 10,
37
- outputPerMillion: 50,
38
- cacheReadPerMillion: 0.25,
39
- cacheWritePerMillion: 12.5
40
- },
41
- "claude-opus-5-5": {
42
- inputPerMillion: 4,
43
- outputPerMillion: 20,
44
- cacheReadPerMillion: 0.2,
45
- cacheWritePerMillion: 5
46
- },
47
- "claude-opus-5": {
48
- inputPerMillion: 5,
49
- outputPerMillion: 25,
50
- cacheReadPerMillion: 0.5,
51
- cacheWritePerMillion: 6.25
52
- },
53
- "claude-fable-5": {
54
- inputPerMillion: 10,
55
- outputPerMillion: 50,
56
- cacheReadPerMillion: 1,
57
- cacheWritePerMillion: 12.5
58
- },
59
- "claude-mythos-5": {
60
- inputPerMillion: 10,
61
- outputPerMillion: 50,
62
- cacheReadPerMillion: 1,
63
- cacheWritePerMillion: 12.5
64
- },
65
- "claude-sonnet-5": {
66
- inputPerMillion: 2,
67
- outputPerMillion: 10,
68
- cacheReadPerMillion: 0.2,
69
- cacheWritePerMillion: 2.5
70
- },
71
- "claude-sonnet-4-6": {
72
- inputPerMillion: 3,
73
- outputPerMillion: 15,
74
- cacheReadPerMillion: 0.3,
75
- cacheWritePerMillion: 3.75
76
- },
77
- "claude-opus-4-8": {
78
- inputPerMillion: 5,
79
- outputPerMillion: 25,
80
- cacheReadPerMillion: 0.5,
81
- cacheWritePerMillion: 6.25
82
- },
83
- "claude-opus-4-7": {
84
- inputPerMillion: 15,
85
- outputPerMillion: 75,
86
- cacheReadPerMillion: 1.5,
87
- cacheWritePerMillion: 18.75
88
- },
89
- "claude-opus-4-6": {
90
- inputPerMillion: 5,
91
- outputPerMillion: 25,
92
- cacheReadPerMillion: 0.5,
93
- cacheWritePerMillion: 6.25
94
- },
95
- "claude-haiku-4-5": {
96
- inputPerMillion: 1,
97
- outputPerMillion: 5,
98
- cacheReadPerMillion: 0.1,
99
- cacheWritePerMillion: 1.25
100
- }
101
- };
34
+ init_src();
35
+ function getClaudeManagedModelPricing(model) {
36
+ const cost = runtimeCatalogModel("anthropic", model)?.cost ?? runtimeCatalogModel("anthropic", model.replace(/-\d{8}$/, ""))?.cost;
37
+ if (typeof cost?.input !== "number" || typeof cost.output !== "number")
38
+ return;
39
+ return {
40
+ inputPerMillion: cost.input,
41
+ outputPerMillion: cost.output,
42
+ cacheReadPerMillion: typeof cost.cache_read === "number" ? cost.cache_read : cost.input * 0.1,
43
+ cacheWritePerMillion: typeof cost.cache_write === "number" ? cost.cache_write : cost.input * 1.25
44
+ };
45
+ }
102
46
  var warnedUnknownModels = new Set;
103
- function computeClaudeManagedCostUsd(model, inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens, pricedAtMs = Date.now()) {
104
- const configuredPricing = CLAUDE_MANAGED_MODEL_PRICING[model];
105
- if (!configuredPricing) {
47
+ function computeClaudeManagedCostUsd(model, inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens) {
48
+ const pricing = getClaudeManagedModelPricing(model);
49
+ if (!pricing) {
106
50
  if (!warnedUnknownModels.has(model)) {
107
51
  warnedUnknownModels.add(model);
108
- console.warn(`[claude-managed-models] Unknown model "${model}" — returning $0 cost. ` + `Add it to CLAUDE_MANAGED_MODEL_PRICING in src/providers/claude-managed-models.ts.`);
52
+ console.warn(`[claude-managed-models] Unpriced model "${model}" — returning $0 cost. ` + "Add it to the model catalog (refresh or overlay row).");
109
53
  }
110
54
  return 0;
111
55
  }
112
- const pricing = configuredPricing.scheduledChange && pricedAtMs >= Date.parse(configuredPricing.scheduledChange.effectiveAt) ? configuredPricing.scheduledChange.pricing : configuredPricing;
113
56
  const inputCost = inputTokens / 1e6 * pricing.inputPerMillion;
114
57
  const outputCost = outputTokens / 1e6 * pricing.outputPerMillion;
115
58
  const cacheReadCost = cacheReadTokens / 1e6 * pricing.cacheReadPerMillion;
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-v53rbqp3.js";
7
+ } from "./cli-kc3dp84d.js";
8
8
  import {
9
9
  getDbClient,
10
10
  init_db
11
- } from "./cli-awwphhcs.js";
11
+ } from "./cli-g9df2m37.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -0,0 +1,69 @@
1
+ import {
2
+ runtimeCatalogModel,
3
+ runtimeCatalogSection
4
+ } from "./cli-m4excttz.js";
5
+ import {
6
+ buildClaudeShortnameMap,
7
+ init_src
8
+ } from "./cli-7zttzetj.js";
9
+
10
+ // src/utils/context-window.ts
11
+ init_src();
12
+ var CONTEXT_FORMULA = "input-cache-output";
13
+ var DEFAULT_CONTEXT_WINDOW = 200000;
14
+ function stripAnthropicDateSuffix(model) {
15
+ return model.replace(/-(\d{8})$/, "");
16
+ }
17
+ var shortnameMap = null;
18
+ function resolveClaudeShortname(model) {
19
+ const section = runtimeCatalogSection("anthropic");
20
+ if (!shortnameMap || shortnameMap.section !== section) {
21
+ shortnameMap = { section, map: buildClaudeShortnameMap(section) };
22
+ }
23
+ return shortnameMap.map[model.trim().toLowerCase()];
24
+ }
25
+ function catalogContext(provider, model) {
26
+ const context = runtimeCatalogModel(provider, model)?.limit?.context;
27
+ return typeof context === "number" && context > 0 ? context : undefined;
28
+ }
29
+ function getContextWindowSize(model) {
30
+ if (!model)
31
+ return DEFAULT_CONTEXT_WINDOW;
32
+ const slash = model.indexOf("/");
33
+ if (slash > 0) {
34
+ const scoped = catalogContext(model.slice(0, slash), model.slice(slash + 1));
35
+ if (scoped)
36
+ return scoped;
37
+ }
38
+ for (const provider of ["anthropic", "openai"]) {
39
+ const exact = catalogContext(provider, model);
40
+ if (exact)
41
+ return exact;
42
+ }
43
+ const stripped = stripAnthropicDateSuffix(model);
44
+ if (stripped !== model) {
45
+ const dated = catalogContext("anthropic", stripped);
46
+ if (dated)
47
+ return dated;
48
+ }
49
+ const shortname = resolveClaudeShortname(model);
50
+ if (shortname) {
51
+ const resolved = catalogContext("anthropic", shortname);
52
+ if (resolved)
53
+ return resolved;
54
+ }
55
+ return DEFAULT_CONTEXT_WINDOW;
56
+ }
57
+ function computeContextUsedUnified(parts) {
58
+ return (parts.inputTokens ?? 0) + (parts.cacheReadTokens ?? 0) + (parts.cacheCreateTokens ?? 0) + (parts.outputTokens ?? 0);
59
+ }
60
+ function clampContextPercent(used, total) {
61
+ if (!total || total <= 0)
62
+ return null;
63
+ const raw = used / total * 100;
64
+ if (!Number.isFinite(raw))
65
+ return null;
66
+ return Math.min(100, Math.max(0, raw));
67
+ }
68
+
69
+ export { CONTEXT_FORMULA, getContextWindowSize, computeContextUsedUnified, clampContextPercent };
@@ -57,19 +57,19 @@ import {
57
57
  setSlackMessageTracking,
58
58
  slackContextKey,
59
59
  updateSlackMessageRecord
60
- } from "./cli-awwphhcs.js";
60
+ } from "./cli-g9df2m37.js";
61
61
  import {
62
62
  init_types,
63
63
  isTerminalTaskStatus
64
- } from "./cli-h0wdadsx.js";
65
- import {
66
- getAppUrl,
67
- init_constants
68
- } from "./cli-dv6cdjs2.js";
64
+ } from "./cli-e4xnc0qp.js";
69
65
  import {
70
66
  getSlackConfiguration,
71
67
  init_config
72
68
  } from "./cli-n7h1kqpf.js";
69
+ import {
70
+ getAppUrl,
71
+ init_constants
72
+ } from "./cli-dv6cdjs2.js";
73
73
  import {
74
74
  init_env_flag,
75
75
  isEnvFlagEnabled
@@ -52838,6 +52838,21 @@ async function getTaskCitations(taskId) {
52838
52838
  WHERE task_id = ? ORDER BY citation_index`, [taskId]);
52839
52839
  return rows.map((row) => ({ ...row, general: row.general === 1 }));
52840
52840
  }
52841
+ var TASK_ID_CHUNK = 500;
52842
+ async function getTaskCitationsForTasks(taskIds) {
52843
+ const ids = [...new Set(taskIds)];
52844
+ const byTask = new Map(ids.map((id) => [id, []]));
52845
+ for (let i = 0;i < ids.length; i += TASK_ID_CHUNK) {
52846
+ const chunk = ids.slice(i, i + TASK_ID_CHUNK);
52847
+ const rows = await getDbClient().query(`SELECT task_id AS taskId, citation_index AS "index", kind, ref, label, quote,
52848
+ resolved_url AS resolvedUrl, verified, general FROM task_citations
52849
+ WHERE task_id IN (${chunk.map(() => "?").join(",")}) ORDER BY task_id, citation_index`, chunk);
52850
+ for (const { taskId, ...row } of rows) {
52851
+ byTask.get(taskId)?.push({ ...row, general: row.general === 1 });
52852
+ }
52853
+ }
52854
+ return byTask;
52855
+ }
52841
52856
  async function hasTaskCitationCheckRefusal(taskId) {
52842
52857
  return Boolean(await getDbClient().get("SELECT id FROM agent_log WHERE taskId = ? AND eventType = 'task_citation_check_refused' LIMIT 1", [taskId]));
52843
52858
  }
@@ -52874,17 +52889,25 @@ var realRecordSessionCost;
52874
52889
  var realRecordDbRetentionSweep;
52875
52890
  var realRecordDbRetentionStatement;
52876
52891
  var realRecordSlackReactionInvalidName;
52877
- function isPollTracingEnabled() {
52878
- const v = (process.env.OTEL_TRACE_POLL ?? "").trim().toLowerCase();
52892
+ function envFlagEnabled(name) {
52893
+ const v = (process.env[name] ?? "").trim().toLowerCase();
52879
52894
  return v === "1" || v === "true" || v === "yes" || v === "on";
52880
52895
  }
52896
+ function isPollTracingEnabled() {
52897
+ return envFlagEnabled("OTEL_TRACE_POLL");
52898
+ }
52899
+ function isApiLogExportEnabled() {
52900
+ return envFlagEnabled("OTEL_EXPORT_API_LOGS");
52901
+ }
52881
52902
  async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
52882
52903
  if (!otelConfigured() || initialized)
52883
52904
  return;
52884
52905
  initialized = true;
52885
52906
  try {
52886
- const impl = await import("./otel-impl-2ez6xk57.js");
52887
- await impl.boot(serviceRole);
52907
+ const impl = await import("./otel-impl-g8rs4vwr.js");
52908
+ await impl.boot(serviceRole, {
52909
+ exportConsoleLogs: serviceRole === "api" && isApiLogExportEnabled()
52910
+ });
52888
52911
  realWithSpan = impl.withSpan;
52889
52912
  realStartSpan = impl.startSpan;
52890
52913
  realWithRemoteContext = impl.withRemoteContext;
@@ -52960,6 +52983,15 @@ init_db();
52960
52983
  init_config();
52961
52984
  var import_bolt = __toESM(require_dist7(), 1);
52962
52985
 
52986
+ // src/slack/connection-state.ts
52987
+ var state = "disconnected";
52988
+ function getSlackConnectionState() {
52989
+ return state;
52990
+ }
52991
+ function setSlackConnectionState(next) {
52992
+ state = next;
52993
+ }
52994
+
52963
52995
  // src/slack/socket-mode-guard.ts
52964
52996
  init_env_flag();
52965
52997
  var SLACK_DEV_SOCKET_MODE_OPT_IN = "SLACK_ALLOW_DEV_SOCKET_MODE";
@@ -54243,7 +54275,23 @@ function stopTaskWatcher() {
54243
54275
 
54244
54276
  // src/slack/app.ts
54245
54277
  var app = null;
54278
+ var receiver = null;
54246
54279
  var initialized2 = false;
54280
+ var SOCKET_EVENT_STATES = {
54281
+ connecting: "connecting",
54282
+ reconnecting: "connecting",
54283
+ connected: "connected",
54284
+ disconnecting: "disconnected",
54285
+ disconnected: "disconnected"
54286
+ };
54287
+ function trackConnectionState(owner) {
54288
+ for (const [event, state2] of Object.entries(SOCKET_EVENT_STATES)) {
54289
+ owner.client.on(event, () => {
54290
+ if (receiver === owner)
54291
+ setSlackConnectionState(state2);
54292
+ });
54293
+ }
54294
+ }
54247
54295
  function getSlackApp() {
54248
54296
  return app;
54249
54297
  }
@@ -54277,23 +54325,31 @@ async function initSlackApp() {
54277
54325
  return null;
54278
54326
  }
54279
54327
  const slackApiUrl = process.env.SLACK_API_URL;
54328
+ const clientOptions = slackApiUrl ? { slackApiUrl } : undefined;
54329
+ const logLevel = import_bolt.LogLevel.DEBUG;
54330
+ receiver = new import_bolt.SocketModeReceiver({
54331
+ appToken,
54332
+ logLevel,
54333
+ installerOptions: clientOptions ? { clientOptions } : {}
54334
+ });
54335
+ trackConnectionState(receiver);
54280
54336
  app = new import_bolt.App({
54281
54337
  token: botToken,
54282
- appToken,
54338
+ receiver,
54283
54339
  socketMode: true,
54284
- logLevel: import_bolt.LogLevel.DEBUG,
54285
- ...slackApiUrl ? { clientOptions: { slackApiUrl } } : {}
54340
+ logLevel,
54341
+ ...clientOptions ? { clientOptions } : {}
54286
54342
  });
54287
54343
  initialized2 = true;
54288
- const { registerMessageHandler } = await import("./handlers-egfhr351.js");
54289
- const { registerCommandHandler } = await import("./commands-hxy2y2sp.js");
54290
- const { registerActionHandlers } = await import("./actions-9rrg0zxm.js");
54291
- const { registerWorkObjectHandlers } = await import("./work-objects-ezmggdne.js");
54344
+ const { registerMessageHandler } = await import("./handlers-5w4jwycr.js");
54345
+ const { registerCommandHandler } = await import("./commands-vfsysz4s.js");
54346
+ const { registerActionHandlers } = await import("./actions-dtsh1mfb.js");
54347
+ const { registerWorkObjectHandlers } = await import("./work-objects-3pakpkw0.js");
54292
54348
  registerMessageHandler(app);
54293
54349
  registerCommandHandler(app);
54294
54350
  registerActionHandlers(app);
54295
54351
  registerWorkObjectHandlers(app);
54296
- const { createAssistant } = await import("./assistant-zegamy48.js");
54352
+ const { createAssistant } = await import("./assistant-31hwy5xj.js");
54297
54353
  app.assistant(createAssistant());
54298
54354
  return app;
54299
54355
  }
@@ -54302,7 +54358,7 @@ async function startSlackApp() {
54302
54358
  await initSlackApp();
54303
54359
  }
54304
54360
  if (app) {
54305
- const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-f026j6c4.js");
54361
+ const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-3wjsp9aw.js");
54306
54362
  if (isSlackRenderV2Enabled2())
54307
54363
  await ensureSlackRenderV2Activation();
54308
54364
  await app.start();
@@ -54320,6 +54376,8 @@ async function stopSlackApp() {
54320
54376
  app = null;
54321
54377
  console.log("[Slack] Bot disconnected");
54322
54378
  }
54379
+ receiver = null;
54380
+ setSlackConnectionState("disconnected");
54323
54381
  initialized2 = false;
54324
54382
  }
54325
54383
 
@@ -55140,9 +55198,9 @@ async function conclusionTimeoutLines(ask, closure) {
55140
55198
  }
55141
55199
  return lines;
55142
55200
  }
55143
- async function askConclusionContent(task, closure, state, slackReplySent) {
55144
- const body = state === "timedOut" && !isOutcomeStatus(task.status) ? "⏳ **Still in progress**" : await outcomeContent(task, slackReplySent);
55145
- if (closure.length === 0 && state !== "timedOut")
55201
+ async function askConclusionContent(task, closure, state2, slackReplySent) {
55202
+ const body = state2 === "timedOut" && !isOutcomeStatus(task.status) ? "⏳ **Still in progress**" : await outcomeContent(task, slackReplySent);
55203
+ if (closure.length === 0 && state2 !== "timedOut")
55146
55204
  return body;
55147
55205
  const resultsLines = await conclusionResultsLines(closure);
55148
55206
  const sections = [body];
@@ -55150,7 +55208,7 @@ async function askConclusionContent(task, closure, state, slackReplySent) {
55150
55208
  sections.push(`**Results**
55151
55209
  ${resultsLines.join(`
55152
55210
  `)}`);
55153
- if (state === "timedOut") {
55211
+ if (state2 === "timedOut") {
55154
55212
  sections.unshift("⚠️ **Concluded with unfinished work**");
55155
55213
  const unfinishedLines = await conclusionTimeoutLines(task, closure);
55156
55214
  if (unfinishedLines.length > 0)
@@ -55161,8 +55219,8 @@ ${resultsLines.join(`
55161
55219
 
55162
55220
  `);
55163
55221
  }
55164
- function conclusionReactionChoice(state, ask, closure) {
55165
- if (state === "timedOut")
55222
+ function conclusionReactionChoice(state2, ask, closure) {
55223
+ if (state2 === "timedOut")
55166
55224
  return { name: "warning" };
55167
55225
  const event = [ask, ...closure].some((member) => member.status === "failed") ? "failed" : "completed";
55168
55226
  return { name: reactionName(event), event };
@@ -55680,25 +55738,25 @@ async function processSlackRenderV2() {
55680
55738
  }
55681
55739
  if (childCardPending)
55682
55740
  continue;
55683
- const state = closureState(task, closure, new Date, settleSec, timeoutMin);
55684
- if (state === "open")
55741
+ const state2 = closureState(task, closure, new Date, settleSec, timeoutMin);
55742
+ if (state2 === "open")
55685
55743
  continue;
55686
55744
  if (!await checkOutcomeDeliveryGate(task, card))
55687
55745
  continue;
55688
55746
  try {
55689
55747
  const outcome = await streamOutcomeCard(task, tree, {
55690
- buildContent: (_t, slackReplySent) => askConclusionContent(task, closure, state, slackReplySent),
55691
- conclusionKind: state === "timedOut" ? "timeout" : "complete"
55748
+ buildContent: (_t, slackReplySent) => askConclusionContent(task, closure, state2, slackReplySent),
55749
+ conclusionKind: state2 === "timedOut" ? "timeout" : "complete"
55692
55750
  });
55693
55751
  if (outcome) {
55694
55752
  noteOutcomeDeliverySuccess(task.id);
55695
55753
  const app3 = getSlackApp();
55696
55754
  if (app3 && task.slackChannelId && task.slackTriggerMessageTs) {
55697
- const reaction = conclusionReactionChoice(state, task, closure);
55755
+ const reaction = conclusionReactionChoice(state2, task, closure);
55698
55756
  await finalizeSlackMessageReaction(app3.client, task.slackChannelId, task.slackTriggerMessageTs, reaction.name, reaction.event);
55699
55757
  await finalizeSlackSteerReactions([task], () => reaction);
55700
55758
  }
55701
- await recordSlackDelivery(task, outcome, state === "timedOut" ? "conclusion_timeout" : "conclusion");
55759
+ await recordSlackDelivery(task, outcome, state2 === "timedOut" ? "conclusion_timeout" : "conclusion");
55702
55760
  }
55703
55761
  outcomeCreated ||= !!outcome;
55704
55762
  } catch (error) {
@@ -55727,4 +55785,4 @@ function _resetSlackRenderV2ForTests() {
55727
55785
  }
55728
55786
  var _noteOutcomeDeliveryFailureForTests = noteOutcomeDeliveryFailure;
55729
55787
 
55730
- export { initialize, ensure, require_dist7 as require_dist, isPollTracingEnabled, initOtel, withSpan, startSpan, withSpanContext, withRemoteContext, injectTraceContext, recordSessionCost, recordDbRetentionSweep, recordDbRetentionStatement, slackTaskOutput, ackSlackMessage, getTaskLink, getTaskUrl, markdownToSlack, buildCaptionBlock, buildCancelledBlocks, buildBufferFlushBlocks, buildTreeBlocks, taskCitationIssues, stripInvalidTaskCitations, taskCitationSourceGroups, renderTaskCitations, taskCitationWarnings, MAX_TASK_CITATIONS, CitationInputSchema, TaskCitationSchema, upsertTaskCitations, getTaskCitations, hasTaskCitationCheckRefusal, getAgentDisplayName, getAgentEmoji, isSlackRenderV2Enabled, isSlackDelegationEnabled, callSlackWithRetry, formatV2Duration, renderThreadTree, ensureSlackThreadTree, withStatusLead, childOutcomeContent, streamOutcomeCard, slackErrorCode2 as slackErrorCode, isTerminalSlackError, describeSlackError, slackErrorSummary, refreshResolvedDeferralCards, processSlackRenderV2, _resetSlackRenderV2ForTests, _noteOutcomeDeliveryFailureForTests, registerTreeMessage, getSlackApp, initSlackApp, startSlackApp, stopSlackApp };
55788
+ export { initialize, ensure, require_dist7 as require_dist, getSlackConnectionState, isPollTracingEnabled, initOtel, withSpan, startSpan, withSpanContext, withRemoteContext, injectTraceContext, recordSessionCost, recordDbRetentionSweep, recordDbRetentionStatement, slackTaskOutput, ackSlackMessage, getTaskLink, getTaskUrl, markdownToSlack, buildCaptionBlock, buildCancelledBlocks, buildBufferFlushBlocks, buildTreeBlocks, taskCitationIssues, stripInvalidTaskCitations, taskCitationSourceGroups, renderTaskCitations, taskCitationWarnings, MAX_TASK_CITATIONS, CitationInputSchema, TaskCitationSchema, upsertTaskCitations, getTaskCitations, getTaskCitationsForTasks, hasTaskCitationCheckRefusal, getAgentDisplayName, getAgentEmoji, isSlackRenderV2Enabled, isSlackDelegationEnabled, callSlackWithRetry, formatV2Duration, renderThreadTree, ensureSlackThreadTree, withStatusLead, childOutcomeContent, streamOutcomeCard, slackErrorCode2 as slackErrorCode, isTerminalSlackError, describeSlackError, slackErrorSummary, refreshResolvedDeferralCards, processSlackRenderV2, _resetSlackRenderV2ForTests, _noteOutcomeDeliveryFailureForTests, registerTreeMessage, getSlackApp, initSlackApp, startSlackApp, stopSlackApp };