@agimon-ai/doompi-workflow 0.0.1-alpha.76 → 0.0.1-alpha.78

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 (332) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/dist/api-contracts.cjs +7 -0
  3. package/dist/api-contracts.d.cts +2 -0
  4. package/dist/api-contracts.d.mts +2 -0
  5. package/dist/api-contracts.mjs +2 -0
  6. package/dist/extensions/pi.cjs +63 -0
  7. package/dist/extensions/pi.cjs.map +1 -0
  8. package/dist/extensions/pi.d.cts +6 -0
  9. package/dist/extensions/pi.d.cts.map +1 -0
  10. package/dist/extensions/pi.d.mts +6 -0
  11. package/dist/extensions/pi.d.mts.map +1 -0
  12. package/dist/extensions/pi.mjs +58 -0
  13. package/dist/extensions/pi.mjs.map +1 -0
  14. package/dist/extensions/server.cjs +96 -0
  15. package/dist/extensions/server.cjs.map +1 -0
  16. package/dist/extensions/server.d.cts +5 -0
  17. package/dist/extensions/server.d.cts.map +1 -0
  18. package/dist/extensions/server.d.mts +5 -0
  19. package/dist/extensions/server.d.mts.map +1 -0
  20. package/dist/extensions/server.mjs +91 -0
  21. package/dist/extensions/server.mjs.map +1 -0
  22. package/dist/extensions/web.mjs +3219 -0
  23. package/dist/extensions/web.mjs.map +1 -0
  24. package/dist/index.cjs +4 -0
  25. package/dist/index.d.cts +2 -0
  26. package/dist/index.d.mts +2 -0
  27. package/dist/index.mjs +2 -0
  28. package/dist/src/constants/workflow.cjs +32 -0
  29. package/dist/src/constants/workflow.cjs.map +1 -0
  30. package/dist/src/constants/workflow.mjs +21 -0
  31. package/dist/src/constants/workflow.mjs.map +1 -0
  32. package/dist/src/extensions/(backend)/_lib/index.server.cjs +12 -0
  33. package/dist/src/extensions/(backend)/_lib/index.server.cjs.map +1 -0
  34. package/dist/src/extensions/(backend)/_lib/index.server.mjs +12 -0
  35. package/dist/src/extensions/(backend)/_lib/index.server.mjs.map +1 -0
  36. package/dist/src/extensions/(backend)/api/workflow/route.server.cjs +7 -0
  37. package/dist/src/extensions/(backend)/api/workflow/route.server.cjs.map +1 -0
  38. package/dist/src/extensions/(backend)/api/workflow/route.server.mjs +8 -0
  39. package/dist/src/extensions/(backend)/api/workflow/route.server.mjs.map +1 -0
  40. package/dist/src/extensions/(backend)/channel/workflow-catalog.server.cjs +7 -0
  41. package/dist/src/extensions/(backend)/channel/workflow-catalog.server.cjs.map +1 -0
  42. package/dist/src/extensions/(backend)/channel/workflow-catalog.server.mjs +8 -0
  43. package/dist/src/extensions/(backend)/channel/workflow-catalog.server.mjs.map +1 -0
  44. package/dist/src/extensions/(backend)/channel/workflows.server.cjs +7 -0
  45. package/dist/src/extensions/(backend)/channel/workflows.server.cjs.map +1 -0
  46. package/dist/src/extensions/(backend)/channel/workflows.server.mjs +8 -0
  47. package/dist/src/extensions/(backend)/channel/workflows.server.mjs.map +1 -0
  48. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.cli.cjs +100 -0
  49. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.cli.cjs.map +1 -0
  50. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.cli.mjs +100 -0
  51. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.cli.mjs.map +1 -0
  52. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.server.cjs +11 -0
  53. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.server.cjs.map +1 -0
  54. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.server.mjs +11 -0
  55. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.server.mjs.map +1 -0
  56. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/workflowSkillsResource.cjs +12 -0
  57. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/workflowSkillsResource.cjs.map +1 -0
  58. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/workflowSkillsResource.mjs +12 -0
  59. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/workflowSkillsResource.mjs.map +1 -0
  60. package/dist/src/extensions/workspaces/sessions/(backend)/api/workflow/route.server.cjs +6 -0
  61. package/dist/src/extensions/workspaces/sessions/(backend)/api/workflow/route.server.cjs.map +1 -0
  62. package/dist/src/extensions/workspaces/sessions/(backend)/api/workflow/route.server.mjs +7 -0
  63. package/dist/src/extensions/workspaces/sessions/(backend)/api/workflow/route.server.mjs.map +1 -0
  64. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.cli.cjs +6 -0
  65. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.cli.cjs.map +1 -0
  66. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.cli.mjs +7 -0
  67. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.cli.mjs.map +1 -0
  68. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.server.cjs +6 -0
  69. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.server.cjs.map +1 -0
  70. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.server.mjs +7 -0
  71. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.server.mjs.map +1 -0
  72. package/dist/src/extensions/workspaces/sessions/(backend)/hook/resources-discover.cli.cjs +6 -0
  73. package/dist/src/extensions/workspaces/sessions/(backend)/hook/resources-discover.cli.cjs.map +1 -0
  74. package/dist/src/extensions/workspaces/sessions/(backend)/hook/resources-discover.cli.mjs +7 -0
  75. package/dist/src/extensions/workspaces/sessions/(backend)/hook/resources-discover.cli.mjs.map +1 -0
  76. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-shutdown.server.cjs +6 -0
  77. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-shutdown.server.cjs.map +1 -0
  78. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-shutdown.server.mjs +7 -0
  79. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-shutdown.server.mjs.map +1 -0
  80. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs +6 -0
  81. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs.map +1 -0
  82. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs +7 -0
  83. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs.map +1 -0
  84. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.server.cjs +6 -0
  85. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.server.cjs.map +1 -0
  86. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.server.mjs +7 -0
  87. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.server.mjs.map +1 -0
  88. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-author-workflow.server.cjs +6 -0
  89. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-author-workflow.server.cjs.map +1 -0
  90. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-author-workflow.server.mjs +7 -0
  91. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-author-workflow.server.mjs.map +1 -0
  92. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-workflow.server.cjs +6 -0
  93. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-workflow.server.cjs.map +1 -0
  94. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-workflow.server.mjs +7 -0
  95. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-workflow.server.mjs.map +1 -0
  96. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-recovery.server.cjs +6 -0
  97. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-recovery.server.cjs.map +1 -0
  98. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-recovery.server.mjs +7 -0
  99. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-recovery.server.mjs.map +1 -0
  100. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-skills.cli.cjs +7 -0
  101. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-skills.cli.cjs.map +1 -0
  102. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-skills.cli.mjs +8 -0
  103. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-skills.cli.mjs.map +1 -0
  104. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs +15 -0
  105. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs.map +1 -0
  106. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs +16 -0
  107. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs.map +1 -0
  108. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs +17 -0
  109. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs.map +1 -0
  110. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs +18 -0
  111. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs.map +1 -0
  112. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-panel.cli.cjs +6 -0
  113. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-panel.cli.cjs.map +1 -0
  114. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-panel.cli.mjs +7 -0
  115. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-panel.cli.mjs.map +1 -0
  116. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-view-close.cli.cjs +6 -0
  117. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-view-close.cli.cjs.map +1 -0
  118. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-view-close.cli.mjs +7 -0
  119. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-view-close.cli.mjs.map +1 -0
  120. package/dist/src/extensions/workspaces/sessions/(backend)/tool/launch-workflow.server.cjs +6 -0
  121. package/dist/src/extensions/workspaces/sessions/(backend)/tool/launch-workflow.server.cjs.map +1 -0
  122. package/dist/src/extensions/workspaces/sessions/(backend)/tool/launch-workflow.server.mjs +7 -0
  123. package/dist/src/extensions/workspaces/sessions/(backend)/tool/launch-workflow.server.mjs.map +1 -0
  124. package/dist/src/extensions/workspaces/sessions/(backend)/tool/list-workflows.server.cjs +6 -0
  125. package/dist/src/extensions/workspaces/sessions/(backend)/tool/list-workflows.server.cjs.map +1 -0
  126. package/dist/src/extensions/workspaces/sessions/(backend)/tool/list-workflows.server.mjs +7 -0
  127. package/dist/src/extensions/workspaces/sessions/(backend)/tool/list-workflows.server.mjs.map +1 -0
  128. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow-run.server.cjs +6 -0
  129. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow-run.server.cjs.map +1 -0
  130. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow-run.server.mjs +7 -0
  131. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow-run.server.mjs.map +1 -0
  132. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow.cli.cjs +6 -0
  133. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow.cli.cjs.map +1 -0
  134. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow.cli.mjs +7 -0
  135. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow.cli.mjs.map +1 -0
  136. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.cli.cjs +6 -0
  137. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.cli.cjs.map +1 -0
  138. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.cli.mjs +7 -0
  139. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.cli.mjs.map +1 -0
  140. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.server.cjs +6 -0
  141. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.server.cjs.map +1 -0
  142. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.server.mjs +7 -0
  143. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.server.mjs.map +1 -0
  144. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowFinishedRenderer.cjs +50 -0
  145. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowFinishedRenderer.cjs.map +1 -0
  146. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowFinishedRenderer.mjs +47 -0
  147. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowFinishedRenderer.mjs.map +1 -0
  148. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowStepRenderer.cjs +36 -0
  149. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowStepRenderer.cjs.map +1 -0
  150. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowStepRenderer.mjs +35 -0
  151. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowStepRenderer.mjs.map +1 -0
  152. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-finished.cli.cjs +7 -0
  153. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-finished.cli.cjs.map +1 -0
  154. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-finished.cli.mjs +8 -0
  155. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-finished.cli.mjs.map +1 -0
  156. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-step.cli.cjs +7 -0
  157. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-step.cli.cjs.map +1 -0
  158. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-step.cli.mjs +8 -0
  159. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-step.cli.mjs.map +1 -0
  160. package/dist/src/schemas/apiContracts.cjs +330 -0
  161. package/dist/src/schemas/apiContracts.cjs.map +1 -0
  162. package/dist/src/schemas/apiContracts.d.cts +53 -0
  163. package/dist/src/schemas/apiContracts.d.cts.map +1 -0
  164. package/dist/src/schemas/apiContracts.d.mts +53 -0
  165. package/dist/src/schemas/apiContracts.d.mts.map +1 -0
  166. package/dist/src/schemas/apiContracts.mjs +327 -0
  167. package/dist/src/schemas/apiContracts.mjs.map +1 -0
  168. package/dist/src/schemas/workflowPi.cjs +77 -0
  169. package/dist/src/schemas/workflowPi.cjs.map +1 -0
  170. package/dist/src/schemas/workflowPi.d.cts +1 -0
  171. package/dist/src/schemas/workflowPi.d.mts +1 -0
  172. package/dist/src/schemas/workflowPi.mjs +74 -0
  173. package/dist/src/schemas/workflowPi.mjs.map +1 -0
  174. package/dist/src/services/backgroundWork/index.cjs +61 -0
  175. package/dist/src/services/backgroundWork/index.cjs.map +1 -0
  176. package/dist/src/services/backgroundWork/index.mjs +61 -0
  177. package/dist/src/services/backgroundWork/index.mjs.map +1 -0
  178. package/dist/src/services/piToolBridge/index.cjs +205 -0
  179. package/dist/src/services/piToolBridge/index.cjs.map +1 -0
  180. package/dist/src/services/piToolBridge/index.mjs +195 -0
  181. package/dist/src/services/piToolBridge/index.mjs.map +1 -0
  182. package/dist/src/services/serverRuntime/index.cjs +387 -0
  183. package/dist/src/services/serverRuntime/index.cjs.map +1 -0
  184. package/dist/src/services/serverRuntime/index.mjs +387 -0
  185. package/dist/src/services/serverRuntime/index.mjs.map +1 -0
  186. package/dist/src/services/webWorkflowCatalog/index.cjs +53 -0
  187. package/dist/src/services/webWorkflowCatalog/index.cjs.map +1 -0
  188. package/dist/src/services/webWorkflowCatalog/index.mjs +52 -0
  189. package/dist/src/services/webWorkflowCatalog/index.mjs.map +1 -0
  190. package/dist/src/services/workflowCatalogChannel/index.cjs +74 -0
  191. package/dist/src/services/workflowCatalogChannel/index.cjs.map +1 -0
  192. package/dist/src/services/workflowCatalogChannel/index.mjs +74 -0
  193. package/dist/src/services/workflowCatalogChannel/index.mjs.map +1 -0
  194. package/dist/src/services/workflowCatalogDeps/index.cjs +25 -0
  195. package/dist/src/services/workflowCatalogDeps/index.cjs.map +1 -0
  196. package/dist/src/services/workflowCatalogDeps/index.mjs +25 -0
  197. package/dist/src/services/workflowCatalogDeps/index.mjs.map +1 -0
  198. package/dist/src/services/workflowExecution/index.cjs +205 -0
  199. package/dist/src/services/workflowExecution/index.cjs.map +1 -0
  200. package/dist/src/services/workflowExecution/index.d.cts +6 -0
  201. package/dist/src/services/workflowExecution/index.d.mts +6 -0
  202. package/dist/src/services/workflowExecution/index.mjs +200 -0
  203. package/dist/src/services/workflowExecution/index.mjs.map +1 -0
  204. package/dist/src/services/workflowFence/index.cjs +170 -0
  205. package/dist/src/services/workflowFence/index.cjs.map +1 -0
  206. package/dist/src/services/workflowFence/index.mjs +166 -0
  207. package/dist/src/services/workflowFence/index.mjs.map +1 -0
  208. package/dist/src/services/workflowHubApi/index.cjs +415 -0
  209. package/dist/src/services/workflowHubApi/index.cjs.map +1 -0
  210. package/dist/src/services/workflowHubApi/index.mjs +411 -0
  211. package/dist/src/services/workflowHubApi/index.mjs.map +1 -0
  212. package/dist/src/services/workflowLaunchCommand/index.cjs +121 -0
  213. package/dist/src/services/workflowLaunchCommand/index.cjs.map +1 -0
  214. package/dist/src/services/workflowLaunchCommand/index.d.cts +52 -0
  215. package/dist/src/services/workflowLaunchCommand/index.d.cts.map +1 -0
  216. package/dist/src/services/workflowLaunchCommand/index.d.mts +52 -0
  217. package/dist/src/services/workflowLaunchCommand/index.d.mts.map +1 -0
  218. package/dist/src/services/workflowLaunchCommand/index.mjs +118 -0
  219. package/dist/src/services/workflowLaunchCommand/index.mjs.map +1 -0
  220. package/dist/src/services/workflowLauncher/index.cjs +181 -0
  221. package/dist/src/services/workflowLauncher/index.cjs.map +1 -0
  222. package/dist/src/services/workflowLauncher/index.mjs +177 -0
  223. package/dist/src/services/workflowLauncher/index.mjs.map +1 -0
  224. package/dist/src/services/workflowNarration/index.cjs +19 -0
  225. package/dist/src/services/workflowNarration/index.cjs.map +1 -0
  226. package/dist/src/services/workflowNarration/index.mjs +19 -0
  227. package/dist/src/services/workflowNarration/index.mjs.map +1 -0
  228. package/dist/src/services/workflowResource/index.cjs +27 -0
  229. package/dist/src/services/workflowResource/index.cjs.map +1 -0
  230. package/dist/src/services/workflowResource/index.mjs +24 -0
  231. package/dist/src/services/workflowResource/index.mjs.map +1 -0
  232. package/dist/src/services/workflowRuns/index.cjs +333 -0
  233. package/dist/src/services/workflowRuns/index.cjs.map +1 -0
  234. package/dist/src/services/workflowRuns/index.mjs +319 -0
  235. package/dist/src/services/workflowRuns/index.mjs.map +1 -0
  236. package/dist/src/services/workflowTerminal/index.cjs +69 -0
  237. package/dist/src/services/workflowTerminal/index.cjs.map +1 -0
  238. package/dist/src/services/workflowTerminal/index.mjs +69 -0
  239. package/dist/src/services/workflowTerminal/index.mjs.map +1 -0
  240. package/dist/src/services/workflowTools/index.cjs +221 -0
  241. package/dist/src/services/workflowTools/index.cjs.map +1 -0
  242. package/dist/src/services/workflowTools/index.mjs +221 -0
  243. package/dist/src/services/workflowTools/index.mjs.map +1 -0
  244. package/dist/src/services/workflowWatcher/index.cjs +78 -0
  245. package/dist/src/services/workflowWatcher/index.cjs.map +1 -0
  246. package/dist/src/services/workflowWatcher/index.mjs +74 -0
  247. package/dist/src/services/workflowWatcher/index.mjs.map +1 -0
  248. package/dist/src/services/workflowsHubChannel/index.cjs +58 -0
  249. package/dist/src/services/workflowsHubChannel/index.cjs.map +1 -0
  250. package/dist/src/services/workflowsHubChannel/index.mjs +58 -0
  251. package/dist/src/services/workflowsHubChannel/index.mjs.map +1 -0
  252. package/dist/src/tui/leader.cjs +84 -0
  253. package/dist/src/tui/leader.cjs.map +1 -0
  254. package/dist/src/tui/leader.mjs +83 -0
  255. package/dist/src/tui/leader.mjs.map +1 -0
  256. package/dist/src/tui/workflow/doomOverlay.cjs +159 -0
  257. package/dist/src/tui/workflow/doomOverlay.cjs.map +1 -0
  258. package/dist/src/tui/workflow/doomOverlay.mjs +157 -0
  259. package/dist/src/tui/workflow/doomOverlay.mjs.map +1 -0
  260. package/dist/src/tui/workflow/overlayText.cjs +83 -0
  261. package/dist/src/tui/workflow/overlayText.cjs.map +1 -0
  262. package/dist/src/tui/workflow/overlayText.mjs +78 -0
  263. package/dist/src/tui/workflow/overlayText.mjs.map +1 -0
  264. package/dist/src/tui/workflow/rendering.cjs +22 -0
  265. package/dist/src/tui/workflow/rendering.cjs.map +1 -0
  266. package/dist/src/tui/workflow/rendering.mjs +20 -0
  267. package/dist/src/tui/workflow/rendering.mjs.map +1 -0
  268. package/dist/src/tui/workflow/workflowCatalog.cjs +336 -0
  269. package/dist/src/tui/workflow/workflowCatalog.cjs.map +1 -0
  270. package/dist/src/tui/workflow/workflowCatalog.mjs +333 -0
  271. package/dist/src/tui/workflow/workflowCatalog.mjs.map +1 -0
  272. package/dist/src/tui/workflow/workflowFinishedMessage.cjs +50 -0
  273. package/dist/src/tui/workflow/workflowFinishedMessage.cjs.map +1 -0
  274. package/dist/src/tui/workflow/workflowFinishedMessage.mjs +47 -0
  275. package/dist/src/tui/workflow/workflowFinishedMessage.mjs.map +1 -0
  276. package/dist/src/tui/workflow/workflowInspector.cjs +276 -0
  277. package/dist/src/tui/workflow/workflowInspector.cjs.map +1 -0
  278. package/dist/src/tui/workflow/workflowInspector.mjs +276 -0
  279. package/dist/src/tui/workflow/workflowInspector.mjs.map +1 -0
  280. package/dist/src/tui/workflow/workflowOverlay.cjs +126 -0
  281. package/dist/src/tui/workflow/workflowOverlay.cjs.map +1 -0
  282. package/dist/src/tui/workflow/workflowOverlay.mjs +125 -0
  283. package/dist/src/tui/workflow/workflowOverlay.mjs.map +1 -0
  284. package/dist/src/tui/workflow/workflowPicker.cjs +138 -0
  285. package/dist/src/tui/workflow/workflowPicker.cjs.map +1 -0
  286. package/dist/src/tui/workflow/workflowPicker.mjs +136 -0
  287. package/dist/src/tui/workflow/workflowPicker.mjs.map +1 -0
  288. package/dist/src/tui/workflow/workflowProgressOverlay.cjs +197 -0
  289. package/dist/src/tui/workflow/workflowProgressOverlay.cjs.map +1 -0
  290. package/dist/src/tui/workflow/workflowProgressOverlay.mjs +192 -0
  291. package/dist/src/tui/workflow/workflowProgressOverlay.mjs.map +1 -0
  292. package/dist/src/tui/workflow/workflowPrompt.cjs +142 -0
  293. package/dist/src/tui/workflow/workflowPrompt.cjs.map +1 -0
  294. package/dist/src/tui/workflow/workflowPrompt.mjs +139 -0
  295. package/dist/src/tui/workflow/workflowPrompt.mjs.map +1 -0
  296. package/dist/src/tui/workflow/workflowRunPanel.cjs +95 -0
  297. package/dist/src/tui/workflow/workflowRunPanel.cjs.map +1 -0
  298. package/dist/src/tui/workflow/workflowRunPanel.mjs +94 -0
  299. package/dist/src/tui/workflow/workflowRunPanel.mjs.map +1 -0
  300. package/dist/src/tui/workflow/workflowStatusRow.cjs +20 -0
  301. package/dist/src/tui/workflow/workflowStatusRow.cjs.map +1 -0
  302. package/dist/src/tui/workflow/workflowStatusRow.mjs +20 -0
  303. package/dist/src/tui/workflow/workflowStatusRow.mjs.map +1 -0
  304. package/dist/src/tui/workflow/workflowStepMessage.cjs +32 -0
  305. package/dist/src/tui/workflow/workflowStepMessage.cjs.map +1 -0
  306. package/dist/src/tui/workflow/workflowStepMessage.mjs +31 -0
  307. package/dist/src/tui/workflow/workflowStepMessage.mjs.map +1 -0
  308. package/dist/src/tui/workflow/workflowToolRender.cjs +491 -0
  309. package/dist/src/tui/workflow/workflowToolRender.cjs.map +1 -0
  310. package/dist/src/tui/workflow/workflowToolRender.mjs +490 -0
  311. package/dist/src/tui/workflow/workflowToolRender.mjs.map +1 -0
  312. package/dist/src/tui/workflowRuntime.cjs +1934 -0
  313. package/dist/src/tui/workflowRuntime.cjs.map +1 -0
  314. package/dist/src/tui/workflowRuntime.d.cts +33 -0
  315. package/dist/src/tui/workflowRuntime.d.cts.map +1 -0
  316. package/dist/src/tui/workflowRuntime.d.mts +33 -0
  317. package/dist/src/tui/workflowRuntime.d.mts.map +1 -0
  318. package/dist/src/tui/workflowRuntime.mjs +1930 -0
  319. package/dist/src/tui/workflowRuntime.mjs.map +1 -0
  320. package/dist/src/types/apiRoutes.cjs +82 -0
  321. package/dist/src/types/apiRoutes.cjs.map +1 -0
  322. package/dist/src/types/apiRoutes.mjs +80 -0
  323. package/dist/src/types/apiRoutes.mjs.map +1 -0
  324. package/dist/src/types/webWorkflowTerminal.cjs +23 -0
  325. package/dist/src/types/webWorkflowTerminal.cjs.map +1 -0
  326. package/dist/src/types/webWorkflowTerminal.mjs +22 -0
  327. package/dist/src/types/webWorkflowTerminal.mjs.map +1 -0
  328. package/dist/src/types/webWorkflows.cjs +8 -0
  329. package/dist/src/types/webWorkflows.cjs.map +1 -0
  330. package/dist/src/types/webWorkflows.mjs +7 -0
  331. package/dist/src/types/webWorkflows.mjs.map +1 -0
  332. package/package.json +8 -8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.mjs","names":["isRecord","routes","isRecord","TAB_ID_PREFIX","ScreenLine","TICK_MS","legacy","legacy","legacy","legacy","legacy","legacy","legacy","legacy","legacy","legacy","activityGroupWorkflows","channelWorkflowCatalog","channelWorkflowRuns","actionLaunchWorkflow","fillWorkflows","leaderCatalog","leaderManage","leaderToggle","modeWorkflow","toolWorkflow"],"sources":["../../src/types/webWorkflows.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/catalogStore.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/runDuration.ts","../../src/types/apiRoutes.ts","../../generated/client.ts","../../src/types/webWorkflowTerminal.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/terminalApi.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/workflowActivity.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/workflowsStore.ts","../../src/extensions/workspaces/sessions/(frontend)/_components/ArtifactsPane.tsx","../../src/extensions/workspaces/sessions/(frontend)/_lib/launchLine.ts","../../src/extensions/workspaces/sessions/(frontend)/_components/LaunchWorkflowDialog.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/StepTerminalPanel.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/WorkflowCatalogDrawer.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/WorkflowsPanel.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/WorkflowsActivitySection.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/workflowToolRender.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/WorkflowToolMessage.tsx","../../src/extensions/workspaces/sessions/(frontend)/_lib/index.ts","../../src/extensions/workspaces/sessions/(frontend)/action/launch-workflow.web.ts","../../src/extensions/workspaces/sessions/(frontend)/activity-group/workflows.web.ts","../../src/extensions/workspaces/sessions/(frontend)/channel/workflow-catalog.web.ts","../../src/extensions/workspaces/sessions/(frontend)/channel/workflow-runs.web.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/Workflows.activity.workflows.web.tsx","../../src/extensions/workspaces/sessions/(frontend)/leader/catalog.web.ts","../../src/extensions/workspaces/sessions/(frontend)/leader/manage.web.ts","../../src/extensions/workspaces/sessions/(frontend)/leader/toggle.web.ts","../../src/extensions/workspaces/sessions/(frontend)/mode/workflow/mode.web.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/workflow.web.tsx","../../generated/web.ts"],"sourcesContent":["/**\n * Workflow run view types shared by this package's hub channel and its web\n * plugin. The shapes mirror what the embedded workflow-mcp engine records;\n * the cockpit renders them as 'workflow_runs' channel payloads.\n */\n\n/** workflow-mcp's own stage vocabulary; the registry bucket a run record sits in. */\nexport type WorkflowStage = 'running' | 'completed' | 'error';\n\n/** workflow-mcp's terminal outcome for a finished run. */\nexport type WorkflowOutcome = 'success' | 'skipped' | 'failed' | 'interrupted';\n\n/** Job and step states as workflow-mcp records them in the progress log. */\nexport type WorkflowProgressState =\n | 'running'\n | 'completed'\n | 'skipped'\n | 'failed'\n | 'pause_requested'\n | 'paused'\n | 'resumed';\n\nexport interface WorkflowStepView {\n name: string;\n status: WorkflowProgressState;\n /** Why the step is in its state, when the engine recorded one (e.g. a skip condition). */\n reason?: string;\n /** ISO 8601 of the step's first running event. */\n startedAt?: string;\n /** ISO 8601 of the step's terminal event. */\n endedAt?: string;\n}\n\n/** 'pre' and 'post' are the engine's pseudo-jobs for its pre:/post: blocks. */\nexport type WorkflowJobPhase = 'pre' | 'job' | 'post';\n\nexport interface WorkflowJobView {\n name: string;\n phase: WorkflowJobPhase;\n status: WorkflowProgressState;\n reason?: string;\n /** Position among the run's jobs, when the engine recorded one. */\n index?: number;\n total?: number;\n startedAt?: string;\n endedAt?: string;\n steps: WorkflowStepView[];\n}\n\n/** The job and step a run is on right now; drives the NOW breadcrumb. */\nexport interface WorkflowPosition {\n job: string;\n step?: string;\n index?: number;\n total?: number;\n}\n\n/**\n * One workflow run of a session, read from workflow-mcp's registry: the\n * run.json record plus the folded progress.ndjson job tree.\n */\nexport interface WorkflowRunView {\n /** Registry identity within its workspace; unique per workspace+stage. */\n runKey: string;\n workspace: string;\n displayName: string;\n workflowName?: string;\n workflowPath: string;\n stage: WorkflowStage;\n outcome?: WorkflowOutcome;\n /** Present while the engine is pausing or paused; absent for plain running. */\n executionState?: 'running' | 'pause_requested' | 'paused' | 'resume_requested';\n /** The prompt the run was launched with, when one was recorded. */\n prompt?: string;\n /** ISO 8601, from the run record. */\n startedAt: string;\n finishedAt?: string;\n /** Failure cause with ANSI escapes stripped, present when the run errored. */\n errorMessage?: string;\n /** The job the engine blamed for the failure, when it recorded one. */\n failedJob?: string;\n /** True when reconciliation decided the recorded pid is no longer alive. */\n stale?: boolean;\n staleReason?: string;\n worktreeBranch?: string;\n position?: WorkflowPosition;\n jobs: WorkflowJobView[];\n}\n\n/** What the workflow runs channel publishes for one session. */\nexport interface WorkflowRunsPayload {\n runs: WorkflowRunView[];\n}\n\nexport const WORKFLOW_RUNS_TYPE = 'workflow_runs';\n\n/**\n * One workflow the session's directory can launch, as the catalog drawer\n * lists it: the engine's own catalog entry plus the parsed detail the drawer\n * unfolds and the launch dialog turns into fields.\n */\nexport interface WorkflowCatalogEntryView {\n /** Absolute path, the row's stable identity. */\n path: string;\n relativePath: string;\n name: string;\n description: string;\n tags: string[];\n /** The trigger names the file declares, such as workflow_dispatch. */\n triggers: string[];\n inputs: WorkflowCatalogInputView[];\n jobs: WorkflowCatalogJobView[];\n artifacts: WorkflowCatalogArtifactView[];\n /** Absent when the workflow names no runner map, which means any runner will do. */\n runners?: string[];\n /** Set when the file could not be parsed; the row shows this instead of guessing. */\n error?: string;\n}\n\nexport interface WorkflowCatalogInputView {\n name: string;\n description?: string;\n required?: boolean;\n default?: string;\n type?: string;\n options?: string[];\n}\n\nexport interface WorkflowCatalogJobView {\n name: string;\n steps: string[];\n}\n\nexport interface WorkflowCatalogArtifactView {\n path: string;\n kind: 'file' | 'directory';\n description: string;\n producedBy: string[];\n}\n\n/** What the catalog channel publishes for one session. */\nexport interface WorkflowCatalogPayload {\n /** The directory the catalog was read from, which is the session's own. */\n cwd: string;\n workflows: WorkflowCatalogEntryView[];\n /** Present when the directory could not be read at all. */\n warning?: string;\n}\n\nexport const WORKFLOW_CATALOG_TYPE = 'workflow_catalog';\n","import { defineSessionStore, type ContextActionRunContext, type TransientTab } from '@agimon-ai/doompi-core/web';\n\nimport {\n WORKFLOW_CATALOG_TYPE,\n type WorkflowCatalogEntryView,\n type WorkflowCatalogPayload,\n} from '../../../../../types/webWorkflows';\n\n/** One session's catalog: what the hub last reported plus what the drawer is doing with it. */\nexport interface CatalogSession {\n cwd: string;\n workflows: WorkflowCatalogEntryView[];\n warning: string | undefined;\n /** True while the catalog drawer is shown in the workflows tab. */\n open: boolean;\n filter: string;\n /** Prompt carried from the surface that opened the catalog. */\n prompt: string;\n /** The highlighted row, by workflow path. */\n selected: string | undefined;\n /** The row whose parsed detail is unfolded. */\n inspected: string | undefined;\n /** The workflow the launch dialog is open for. */\n launch: string | undefined;\n}\n\nexport const catalog = defineSessionStore<CatalogSession>({\n cwd: '',\n workflows: [],\n warning: undefined,\n open: false,\n filter: '',\n prompt: '',\n selected: undefined,\n inspected: undefined,\n launch: undefined,\n});\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function openCatalog(sessionId: string, prompt = ''): void {\n catalog.update(sessionId, (current) => ({ ...current, open: true, prompt }));\n}\n\n/** Opens the Workflow picker with context supplied by another installed plugin. */\nexport function openWorkflowCatalogForContext(context: ContextActionRunContext, tab: () => TransientTab): void {\n if (context.sessionId === null) return;\n openCatalog(context.sessionId, context.item.content);\n context.openTransientTab(tab());\n}\n\nexport function closeCatalog(sessionId: string): void {\n catalog.update(sessionId, (current) => ({ ...current, open: false, prompt: '', launch: undefined }));\n}\n\nexport function setCatalogFilter(sessionId: string, filter: string): void {\n catalog.update(sessionId, (current) => ({ ...current, filter }));\n}\n\nexport function selectWorkflow(sessionId: string, path: string | undefined): void {\n catalog.update(sessionId, (current) => ({ ...current, selected: path }));\n}\n\nexport function toggleInspect(sessionId: string, path: string): void {\n catalog.update(sessionId, (current) => ({ ...current, inspected: current.inspected === path ? undefined : path }));\n}\n\nexport function openLaunch(sessionId: string, path: string): void {\n catalog.update(sessionId, (current) => ({ ...current, selected: path, launch: path }));\n}\n\nexport function closeLaunch(sessionId: string): void {\n catalog.update(sessionId, (current) => ({ ...current, launch: undefined }));\n}\n\n/** Rows whose name, path, tag or job matches the filter, case-insensitively. */\nexport function filterCatalog(\n workflows: readonly WorkflowCatalogEntryView[],\n filter: string,\n): WorkflowCatalogEntryView[] {\n const needle = filter.trim().toLowerCase();\n if (needle === '') return [...workflows];\n return workflows.filter((workflow) =>\n [\n workflow.name,\n workflow.relativePath,\n workflow.description,\n ...workflow.tags,\n ...workflow.jobs.map((job) => job.name),\n ]\n .join('\\n')\n .toLowerCase()\n .includes(needle),\n );\n}\n\n/** The plugin's catalog channel: 'workflow_catalog' payloads into the store. */\nexport const workflowCatalogChannel = catalog.channel<WorkflowCatalogPayload>({\n channel: WORKFLOW_CATALOG_TYPE,\n parse(input) {\n if (!isRecord(input) || typeof input.cwd !== 'string' || !Array.isArray(input.workflows)) return null;\n return {\n cwd: input.cwd,\n workflows: input.workflows.filter(isRecord) as unknown as WorkflowCatalogEntryView[],\n ...(typeof input.warning === 'string' ? { warning: input.warning } : {}),\n };\n },\n reduce(current, payload) {\n const paths = new Set(payload.workflows.map((workflow) => workflow.path));\n return {\n ...current,\n cwd: payload.cwd,\n workflows: payload.workflows,\n warning: payload.warning,\n // A row that is gone cannot stay selected, inspected, or half-launched.\n selected: current.selected !== undefined && paths.has(current.selected) ? current.selected : undefined,\n inspected: current.inspected !== undefined && paths.has(current.inspected) ? current.inspected : undefined,\n launch: current.launch !== undefined && paths.has(current.launch) ? current.launch : undefined,\n };\n },\n});\n","/**\n * Local copy of the host's formatRunDuration (src/web/lib/sessionSummary.ts):\n * this plugin keeps zero host-lib imports so its later move into the owning\n * package is a file relocation.\n */\nconst MINUTE_MS = 60 * 1000;\nconst HOUR_MS = 60 * MINUTE_MS;\n\nexport function formatRunDuration(elapsedMs: number): string {\n if (elapsedMs < MINUTE_MS) return '<1m';\n if (elapsedMs < HOUR_MS) return `${Math.floor(elapsedMs / MINUTE_MS)}m`;\n const hours = Math.floor(elapsedMs / HOUR_MS);\n const minutes = Math.floor((elapsedMs % HOUR_MS) / MINUTE_MS);\n return `${hours}h ${String(minutes).padStart(2, '0')}m`;\n}\n","import { apiResponse, defineApiRoutes } from '@agimon-ai/doompi-core/web';\n\nimport type {\n WorkflowArtifactContentResponse,\n WorkflowArtifactsResponse,\n WorkflowControlResponse,\n WorkflowDeleteResponse,\n} from './webWorkflowTerminal';\n\n/**\n * This package's routes, as data.\n *\n * No scope and no base path. The build reads both off\n * `src/extensions/(backend)/api/workflow/`, so the mount is stated once, by the\n * folder that creates it. The same API answers at all three scopes, because a\n * global contribution cascades into workspace and session; the folder under\n * `workspaces/sessions/` only re-mounts it for a session's own server.\n *\n * This is the one file the routes, the Hono app and the browser all read, so a\n * path cannot move on one side alone. The page used to build the hub's own\n * absolute URL and then rewrite its plugin prefix with String.replace to reach\n * a session, which is exactly the kind of copy that can move by one character\n * without anything noticing.\n *\n * `:workspace` and `:runKey` are Hono's own parameter syntax, because the app\n * registers `path` verbatim.\n */\n\n/** One run, which every route below addresses. */\nconst RUN = '/runs/:workspace/:runKey';\n\n/**\n * The artifact route's parameter, as Hono spells a multi-segment match.\n *\n * An artifact is named by its path inside the run directory, so `reports/a.md`\n * is one parameter across two segments. The client's `params` substitution\n * fills a single segment and percent-encodes the slash with it, so the page\n * substitutes this one itself; see the page's `_lib/terminalApi.ts`.\n */\nexport const ARTIFACT_NAME_PARAM = ':name{.+}';\n\n/** Query parameters the artifact route reads, spelled once for both halves. */\nexport const ARTIFACT_RAW_PARAM = 'raw';\nexport const ARTIFACT_DOWNLOAD_PARAM = 'download';\n\nexport default defineApiRoutes({\n /**\n * The terminal, as server-sent events.\n *\n * `stream: true` gets a URL and no call method: the consumer is the browser's\n * own `EventSource`, and a relayed call would buffer a stream that never ends.\n */\n screen: {\n method: 'GET',\n path: `${RUN}/screen/stream`,\n stream: true,\n },\n control: {\n method: 'POST',\n path: `${RUN}/control`,\n response: apiResponse<WorkflowControlResponse>(),\n },\n keys: {\n method: 'POST',\n path: `${RUN}/keys`,\n },\n resize: {\n method: 'POST',\n path: `${RUN}/resize`,\n response: apiResponse<{ resized: boolean }>(),\n },\n remove: {\n method: 'DELETE',\n path: RUN,\n response: apiResponse<WorkflowDeleteResponse>(),\n },\n artifacts: {\n method: 'GET',\n path: `${RUN}/artifacts`,\n response: apiResponse<WorkflowArtifactsResponse>(),\n },\n /** One artifact: its metadata and text, or its raw bytes under `raw=1`. */\n artifact: {\n method: 'GET',\n path: `${RUN}/artifacts/${ARTIFACT_NAME_PARAM}`,\n query: [ARTIFACT_RAW_PARAM, ARTIFACT_DOWNLOAD_PARAM],\n response: apiResponse<WorkflowArtifactContentResponse>(),\n },\n});\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { createApiClient, sessionApiAddress } from '@agimon-ai/doompi-core/web';\nimport { sealedTransport } from '@agimon-ai/doompi-web-security/browser';\n\nimport routes from '../src/types/apiRoutes';\n\n/** Scopes the tree mounts 'workflow' at. */\nexport const apiScopes = ['global', 'workspace', 'session'] as const;\n\nexport const api = createApiClient(routes, {\n scopes: apiScopes,\n basePath: 'workflow',\n transport: (input, init) => sealedTransport.fetch(input, init),\n sessionAddress: sessionApiAddress,\n});\n","/**\n * The wire contract between this package's hub API and its cockpit client:\n * one run's terminal, and the files its run directory holds.\n *\n * Both halves of the cockpit import these names, so the route strings and the\n * event names live here rather than being spelled twice.\n */\n\n/**\n * Segment this package's API is mounted under, below /api/plugins/.\n *\n * The same word names `src/extensions/(backend)/api/workflow/`, which is where\n * the build reads the mount for the browser's client, so the two cannot drift.\n * The routes themselves are declared in `apiRoutes.ts`.\n */\nexport const WORKFLOW_API_BASE_PATH = 'workflow';\n\n/** The SSE event name the screen stream writes. */\nexport const WORKFLOW_SCREEN_EVENT = 'screen';\n\n/** What a surface may do with one run's terminal, and why anything is missing. */\nexport interface WorkflowTerminalCapabilitiesView {\n readable: boolean;\n writable: boolean;\n resizable: boolean;\n reason?: string;\n}\n\n/** One frame of a run's terminal, as the stream pushes it. */\nexport interface WorkflowScreenEvent {\n /** The visible screen, newest line last, carrying the colour the run printed. */\n lines: string[];\n capabilities: WorkflowTerminalCapabilitiesView;\n /** True once the run has settled, after which the stream ends. */\n ended?: boolean;\n}\n\n/** Answer to taking or releasing the keyboard for one run. */\nexport interface WorkflowControlResponse {\n /** True when this caller now holds the keyboard. */\n held: boolean;\n /** The token later writes must carry; absent when control was refused or released. */\n token?: string;\n /** Why control was refused, worded for a reader. */\n reason?: string;\n}\n\n/** Answer after a settled run and its directory have been permanently removed. */\nexport interface WorkflowDeleteResponse {\n deleted: true;\n}\n\n/** How a declared run-directory entry compares with what is on disk. */\nexport type WorkflowArtifactState = 'written' | 'empty' | 'pending' | 'unreadable';\n\n/** One file or directory in a run's own folder. */\nexport interface WorkflowArtifactView {\n /** Path relative to the run directory, which is also the read route's parameter. */\n path: string;\n kind: 'file' | 'directory';\n /** What the workflow says this file is for; empty for a file it never declared. */\n description: string;\n /** The jobs the workflow says write it. */\n producedBy: string[];\n /** True when the workflow's run-directory block names this entry. */\n declared: boolean;\n state: WorkflowArtifactState;\n /** Bytes on disk, absent until the file exists. */\n size?: number;\n /** ISO 8601 of the last write, absent until the file exists. */\n modifiedAt?: string;\n}\n\nexport interface WorkflowArtifactsResponse {\n /** Absolute path of the run's own directory, which the reader may want to open. */\n runDir: string;\n /** What the workflow says the directory is for. */\n description: string;\n artifacts: WorkflowArtifactView[];\n}\n\n/** One artifact's metadata and optional text, as the viewer tab reads it. */\nexport interface WorkflowArtifactContentResponse {\n path: string;\n size: number;\n modifiedAt: string;\n /** Media type inferred from the file extension by the trusted hub. Absent on older hubs. */\n mimeType?: string;\n /** Present for text formats; binary files are streamed from the raw route instead. */\n text?: string;\n /** True when textual content was longer than the reader's byte budget. */\n truncated: boolean;\n}\n","import { sealedTransport } from '@agimon-ai/doompi-web-security/browser';\n\nimport { api } from '../../../../../../generated/client';\nimport { ARTIFACT_DOWNLOAD_PARAM, ARTIFACT_NAME_PARAM, ARTIFACT_RAW_PARAM } from '../../../../../types/apiRoutes';\nimport {\n WORKFLOW_SCREEN_EVENT,\n type WorkflowArtifactContentResponse,\n type WorkflowArtifactsResponse,\n type WorkflowControlResponse,\n type WorkflowDeleteResponse,\n type WorkflowScreenEvent,\n} from '../../../../../types/webWorkflowTerminal';\n\n/**\n * The page's half of this package's hub API: one run's terminal and the files\n * its run directory holds.\n *\n * These are adapters now, not a transport. The generated client owns the URL\n * and the sealed transport with it, so nothing here spells a mount. What stays\n * is this package's own vocabulary: which refusals the reader is shown, and the\n * shapes the terminal expects back.\n *\n * A run belongs to its multiplexer rather than to a session, so the same API\n * answers at the hub and inside a session's own server. Passing a session id\n * addresses that session's copy and passing none addresses the hub. The deleted\n * builder made that branch the other way round: it always built the hub's\n * absolute URL, then rewrote the plugin prefix into the session's with\n * String.replace, so a session's URL was a hub URL with its head swapped.\n */\n\nconst UNREACHABLE = 'The cockpit hub is unreachable.';\n\n/** One of the scopes this API mounts at; every route is the same on all of them. */\ntype WorkflowScope = typeof api.global;\n\n/** The hub, or one session's own copy of it; a null session id is the hub. */\nfunction scoped(sessionId?: string | null): WorkflowScope {\n return sessionId == null ? api.global : api.session(sessionId);\n}\n\n/** The run every route addresses, as the route table's two path parameters. */\nfunction runParams(workspace: string, runKey: string): { workspace: string; runKey: string } {\n return { workspace, runKey };\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * The message a reader is shown: the route's own words, or why there were none.\n *\n * `error` is optional because an answered call that simply carried the wrong\n * shape reaches here too, and that result has no error field at all.\n */\nfunction messageOf(result: { status: number; error?: string }, fallback: string): string {\n if (result.status === 0) return UNREACHABLE;\n return result.error === undefined || result.error === '' ? fallback : result.error;\n}\n\n/**\n * One artifact's URL, with its path filled in.\n *\n * An artifact is named by its path inside the run directory, which Hono matches\n * as the one multi-segment parameter `:name{.+}`. The client's own `params`\n * substitution fills a single segment and percent-encodes the separating slash\n * with it, which would move every nested artifact's URL, so that one segment is\n * substituted here instead: each segment encoded, the slashes between them\n * kept. Everything left of it still comes from the client.\n */\nfunction artifactUrl(\n scope: WorkflowScope,\n workspace: string,\n runKey: string,\n artifactPath: string,\n query?: Record<string, number>,\n): string {\n return scope.artifact\n .url({ params: runParams(workspace, runKey), ...(query === undefined ? {} : { query }) })\n .replace(ARTIFACT_NAME_PARAM, artifactPath.split('/').map(encodeURIComponent).join('/'));\n}\n\n/**\n * Follows one run's screen until the run settles or the caller stops.\n *\n * Returns the stop function. The stream is server-sent events, so a hub that\n * restarts reconnects on its own and the page keeps painting. The route is\n * declared `stream: true`, which is why the client hands out its address and no\n * call: an `EventSource` opens it directly, and a relayed call would buffer a\n * response that never ends.\n */\nexport function followScreen(\n workspace: string,\n runKey: string,\n onEvent: (event: WorkflowScreenEvent) => void,\n sessionId?: string | null,\n): () => void {\n const source = new EventSource(scoped(sessionId).screen.url({ params: runParams(workspace, runKey) }));\n const handler = (message: MessageEvent<string>): void => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(message.data);\n } catch {\n return; // A torn frame; the next one repaints the whole screen anyway.\n }\n if (!isRecord(parsed) || !Array.isArray(parsed.lines)) return;\n onEvent(parsed as unknown as WorkflowScreenEvent);\n };\n source.addEventListener(WORKFLOW_SCREEN_EVENT, handler as EventListener);\n return () => {\n source.removeEventListener(WORKFLOW_SCREEN_EVENT, handler as EventListener);\n source.close();\n };\n}\n\n/** Takes the keyboard for one run, renewing when this page already holds it. */\nexport async function takeControl(\n workspace: string,\n runKey: string,\n token?: string,\n sessionId?: string | null,\n): Promise<WorkflowControlResponse> {\n const result = await scoped(sessionId).control({ params: runParams(workspace, runKey), body: { token } });\n if (result.status === 0) return { held: false, reason: UNREACHABLE };\n // A refusal carries the same shape as a grant, so the body is read before the\n // status: a 409 says who holds the keyboard and why, which is the answer.\n if (isRecord(result.data) && typeof result.data.held === 'boolean') {\n return result.data as unknown as WorkflowControlResponse;\n }\n return { held: false, reason: messageOf(result, 'The run refused the keyboard.') };\n}\n\nexport async function releaseControl(\n workspace: string,\n runKey: string,\n token: string,\n sessionId?: string | null,\n): Promise<void> {\n await scoped(sessionId).control({ params: runParams(workspace, runKey), body: { token, release: true } });\n}\n\n/** Sends literal keystrokes; the reason comes back when the lease has moved on. */\nexport async function sendKeys(\n workspace: string,\n runKey: string,\n token: string,\n data: string,\n sessionId?: string | null,\n): Promise<{ error?: string }> {\n const result = await scoped(sessionId).keys({ params: runParams(workspace, runKey), body: { token, data } });\n if (result.ok) return {};\n return { error: messageOf(result, 'The run would not take those keys.') };\n}\n\n/** Matches the run's terminal to the viewport of whoever holds the keyboard. */\nexport async function resizeRun(\n workspace: string,\n runKey: string,\n token: string,\n columns: number,\n rows: number,\n sessionId?: string | null,\n): Promise<void> {\n await scoped(sessionId).resize({ params: runParams(workspace, runKey), body: { token, columns, rows } });\n}\n\nexport type DeleteWorkflowResult = { result: WorkflowDeleteResponse } | { error: string };\n\n/** Permanently removes one settled run and its run directory. */\nexport async function deleteWorkflowRun(\n workspace: string,\n runKey: string,\n sessionId?: string | null,\n): Promise<DeleteWorkflowResult> {\n const result = await scoped(sessionId).remove({ params: runParams(workspace, runKey) });\n if (!result.ok) return { error: messageOf(result, 'The workflow could not be deleted.') };\n if (result.data.deleted === true) return { result: { deleted: true } };\n return { error: 'The workflow hub returned an invalid deletion response.' };\n}\n\nexport type ArtifactsResult = { artifacts: WorkflowArtifactsResponse } | { error: string };\n\nexport async function fetchArtifacts(\n workspace: string,\n runKey: string,\n sessionId?: string | null,\n): Promise<ArtifactsResult> {\n const result = await scoped(sessionId).artifacts({ params: runParams(workspace, runKey) });\n if (!result.ok) return { error: messageOf(result, 'This run has no directory to read.') };\n return { artifacts: result.data };\n}\n\nexport type ArtifactResult = { artifact: WorkflowArtifactContentResponse } | { error: string };\n\n/** Trusted same-origin URL for browser-native media previews and downloads. */\nexport function artifactContentUrl(\n workspace: string,\n runKey: string,\n path: string,\n download = false,\n sessionId?: string | null,\n): string {\n return artifactUrl(scoped(sessionId), workspace, runKey, path, {\n [ARTIFACT_RAW_PARAM]: 1,\n ...(download ? { [ARTIFACT_DOWNLOAD_PARAM]: 1 } : {}),\n });\n}\n\n/**\n * One artifact's metadata and text.\n *\n * The only route here that addresses itself rather than being called: its path\n * parameter spans segments, so the URL comes from `artifactUrl` and the request\n * goes over the same sealed transport the client is built on.\n */\nexport async function fetchArtifact(\n workspace: string,\n runKey: string,\n path: string,\n sessionId?: string | null,\n): Promise<ArtifactResult> {\n try {\n const response = await sealedTransport.fetch(artifactUrl(scoped(sessionId), workspace, runKey, path));\n const body = (await response.json()) as unknown;\n if (!response.ok) {\n const error = isRecord(body) && typeof body.error === 'string' && body.error !== '' ? body.error : '';\n return { error: error === '' ? 'That file has not been written.' : error };\n }\n return { artifact: body as WorkflowArtifactContentResponse };\n } catch {\n return { error: UNREACHABLE };\n }\n}\n","import type { WorkflowRunView } from '../../../../../types/webWorkflows';\nimport { formatRunDuration } from './runDuration';\n\nexport type WorkflowActivityTone = 'running' | 'paused' | 'failed' | 'done' | 'skipped';\n\n/** One run as the activity dock lists it: identity, a tone, and a one-liner. */\nexport interface WorkflowActivityRow {\n /** Registry identity: workspace/runKey, unique across the session's runs. */\n identity: string;\n runKey: string;\n name: string;\n tone: WorkflowActivityTone;\n elapsed: string;\n /** Where the run is right now, or how it ended. */\n detail: string;\n}\n\nconst PAUSED_STATES: ReadonlySet<NonNullable<WorkflowRunView['executionState']>> = new Set([\n 'paused',\n 'pause_requested',\n]);\n\nexport function workflowRunIdentity(run: Pick<WorkflowRunView, 'workspace' | 'runKey'>): string {\n return `${run.workspace}/${run.runKey}`;\n}\n\nfunction toneOf(run: WorkflowRunView): WorkflowActivityTone {\n if (run.stage === 'running') {\n return run.executionState !== undefined && PAUSED_STATES.has(run.executionState) ? 'paused' : 'running';\n }\n if (run.stage === 'error') return 'failed';\n if (run.outcome !== undefined && run.outcome !== 'success') return run.outcome === 'failed' ? 'failed' : 'skipped';\n return 'done';\n}\n\nfunction detailOf(run: WorkflowRunView, tone: WorkflowActivityTone): string {\n if (tone === 'paused') return 'paused; resume it from the owning session';\n if (tone === 'failed')\n return run.errorMessage ?? (run.failedJob === undefined ? 'failed' : `job '${run.failedJob}' failed`);\n if (tone === 'running') {\n if (run.position === undefined) return 'starting';\n return run.position.step === undefined ? run.position.job : `${run.position.job} · ${run.position.step}`;\n }\n return run.outcome ?? 'done';\n}\n\nfunction elapsedOf(run: WorkflowRunView, now: number): string {\n const start = Date.parse(run.startedAt);\n if (!Number.isFinite(start)) return '';\n const end = run.finishedAt === undefined ? now : Date.parse(run.finishedAt);\n return formatRunDuration(Math.max(0, (Number.isFinite(end) ? end : now) - start));\n}\n\n/** The hub's presented order is kept: it already puts live runs first. */\nexport function workflowActivityRows(runs: readonly WorkflowRunView[], now: number): WorkflowActivityRow[] {\n return runs.map((run) => {\n const tone = toneOf(run);\n return {\n identity: workflowRunIdentity(run),\n runKey: run.runKey,\n name: run.displayName,\n tone,\n elapsed: elapsedOf(run, now),\n detail: detailOf(run, tone),\n };\n });\n}\n\n/** The three answers a reader wants from the dock: what is live, what broke, what is done. */\nexport type WorkflowActivityGroupName = 'running' | 'failed' | 'successful';\n\nexport interface WorkflowActivityGroup {\n name: WorkflowActivityGroupName;\n rows: WorkflowActivityRow[];\n /**\n * Whether the group is open when the dock first draws it.\n *\n * Failures open because they are the only ones that need an answer, and a\n * folded failure is one nobody sees. Everything else stays folded so a\n * session's whole history does not push the other groups off the dock.\n */\n openByDefault: boolean;\n}\n\nconst GROUP_OF: Readonly<Record<WorkflowActivityTone, WorkflowActivityGroupName>> = {\n running: 'running',\n paused: 'running',\n failed: 'failed',\n done: 'successful',\n skipped: 'successful',\n};\n\nconst GROUP_ORDER: readonly WorkflowActivityGroupName[] = ['running', 'failed', 'successful'];\n\n/** Rows split by outcome, in the order the dock shows them; empty groups are dropped. */\nexport function workflowActivityGroups(rows: readonly WorkflowActivityRow[]): WorkflowActivityGroup[] {\n return GROUP_ORDER.map((name) => ({\n name,\n rows: rows.filter((row) => GROUP_OF[row.tone] === name),\n openByDefault: name !== 'successful',\n })).filter((group) => group.rows.length > 0);\n}\n","import type { SessionFrameSender } from '@agimon-ai/doompi-core/web';\nimport { defineSessionStore } from '@agimon-ai/doompi-core/web';\n\nimport { WORKFLOW_RUNS_TYPE, type WorkflowRunView } from '../../../../../types/webWorkflows';\nimport { workflowRunIdentity } from './workflowActivity';\n\n/** One session's record: the hub's last report plus the run this page is looking at. */\nexport interface WorkflowsSession {\n /** The workflow runs the hub last reported; presented order preserved. */\n runs: WorkflowRunView[];\n /** The run (workspace/runKey) the workflows tab shows; the first run until someone picks. */\n focusedRun: string | undefined;\n /**\n * A launch that was sent and has not shown up yet.\n *\n * The line goes to the session, the run appears on the registry channel some\n * seconds later, and nothing connects the two but timing: the first run this\n * session did not already have is the one that was just asked for.\n */\n pendingLaunch: { workflowPath: string; knownRuns: string[] } | undefined;\n}\n\nexport const workflows = defineSessionStore<WorkflowsSession>({\n runs: [],\n focusedRun: undefined,\n pendingLaunch: undefined,\n});\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Points the workflows tab at one run; the activity dock uses this before opening the tab. */\nexport function focusRun(sessionId: string, identity: string | undefined): void {\n workflows.update(sessionId, (current) => ({ ...current, focusedRun: identity }));\n}\n\n/** Removes a deleted run immediately while the registry channel catches up. */\nexport function removeRun(sessionId: string, identity: string): void {\n workflows.update(sessionId, (current) => {\n const runs = current.runs.filter((run) => workflowRunIdentity(run) !== identity);\n return {\n ...current,\n runs,\n focusedRun:\n current.focusedRun === identity\n ? runs[0] === undefined\n ? undefined\n : workflowRunIdentity(runs[0])\n : current.focusedRun,\n };\n });\n}\n\n/**\n * Sends a launch line to the session and remembers what was already running.\n *\n * The cockpit's only channel to a session is a prompt frame, so a launch is\n * the verb the extension registers for exactly this; see web/launchLine.ts.\n */\nexport function requestLaunch(send: SessionFrameSender, sessionId: string, line: string, workflowPath: string): void {\n send(sessionId, { type: 'prompt', message: line });\n workflows.update(sessionId, (current) => ({\n ...current,\n pendingLaunch: { workflowPath, knownRuns: current.runs.map(workflowRunIdentity) },\n }));\n}\n\nexport interface WorkflowRunsPayload {\n runs: WorkflowRunView[];\n}\n\n/** The plugin's session data channel: 'workflow_runs' payloads into the store. */\nexport const workflowRunsChannel = workflows.channel<WorkflowRunsPayload>({\n channel: WORKFLOW_RUNS_TYPE,\n parse(input) {\n if (!isRecord(input) || !Array.isArray(input.runs)) return null;\n return { runs: input.runs.filter(isRecord) as unknown as WorkflowRunView[] };\n },\n reduce: (current, { runs }) => {\n const pending = current.pendingLaunch;\n if (pending === undefined) return { ...current, runs };\n const known = new Set(pending.knownRuns);\n const arrived = runs.find((run) => !known.has(workflowRunIdentity(run)));\n // Until one arrives the launch stays pending: a workflow can take a while\n // to reach the registry, and forgetting it would leave the board wherever\n // the reader last was.\n if (arrived === undefined) return { ...current, runs };\n return { ...current, runs, focusedRun: workflowRunIdentity(arrived), pendingLaunch: undefined };\n },\n});\n","import type { TransientTab, WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport { Badge, Button, EmptyState, Markdown } from '@agimon-ai/doompi-web-components';\nimport { useEffect, useState } from 'react';\n\nimport type { WorkflowRunView } from '../../../../../types/webWorkflows';\nimport type {\n WorkflowArtifactContentResponse,\n WorkflowArtifactsResponse,\n WorkflowArtifactView,\n} from '../../../../../types/webWorkflowTerminal';\nimport { artifactContentUrl, fetchArtifact, fetchArtifacts } from '../_lib/terminalApi';\n\nconst TAB_ID_PREFIX = 'workflows-artifact-';\nconst BYTES_PER_UNIT = 1024;\nconst UNITS = ['B', 'KB', 'MB'] as const;\n\nfunction formatSize(bytes: number | undefined): string {\n if (bytes === undefined) return '';\n let value = bytes;\n let unit = 0;\n while (value >= BYTES_PER_UNIT && unit < UNITS.length - 1) {\n value /= BYTES_PER_UNIT;\n unit += 1;\n }\n return `${unit === 0 ? value : value.toFixed(1)} ${UNITS[unit]}`;\n}\n\nfunction formatWhen(iso: string | undefined): string {\n if (iso === undefined) return '';\n const parsed = Date.parse(iso);\n if (!Number.isFinite(parsed)) return '';\n return new Date(parsed).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n}\n\nconst STATE_GLYPH: Readonly<Record<WorkflowArtifactView['state'], { glyph: string; className: string }>> = {\n written: { glyph: '✓', className: 'text-doom-green' },\n empty: { glyph: '○', className: 'text-doom-yellow' },\n pending: { glyph: '○', className: 'text-doom-faint' },\n unreadable: { glyph: '!', className: 'text-doom-red' },\n};\n\nfunction parseDelimited(text: string, delimiter: ',' | '\\t'): string[][] {\n const rows: string[][] = [];\n let row: string[] = [];\n let cell = '';\n let quoted = false;\n for (let index = 0; index <= text.length && rows.length < 500; index += 1) {\n const character = text[index] ?? '\\n';\n if (quoted) {\n if (character === '\"' && text[index + 1] === '\"') {\n cell += '\"';\n index += 1;\n } else if (character === '\"') {\n quoted = false;\n } else {\n cell += character;\n }\n } else if (character === '\"' && cell === '') {\n quoted = true;\n } else if (character === delimiter) {\n row.push(cell);\n cell = '';\n } else if (character === '\\n') {\n row.push(cell.replace(/\\r$/, ''));\n rows.push(row);\n row = [];\n cell = '';\n } else {\n cell += character;\n }\n }\n return rows;\n}\n\nfunction DelimitedPreview({ text, delimiter }: { text: string; delimiter: ',' | '\\t' }) {\n const rows = parseDelimited(text, delimiter);\n const [head = [], ...body] = rows;\n return (\n <div className=\"overflow-auto\">\n <table data-testid=\"artifact-table\" className=\"min-w-full border-collapse font-mono text-sm\">\n <thead className=\"sticky top-0 bg-doom-panel text-doom-hi\">\n <tr>\n {head.map((cell, index) => (\n <th key={index} className=\"border border-doom-border px-2 py-1.5 text-left font-bold\">\n {cell}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {body.map((cells, rowIndex) => (\n <tr key={rowIndex}>\n {cells.map((cell, cellIndex) => (\n <td key={cellIndex} className=\"border border-doom-border px-2 py-1 align-top text-doom-text\">\n {cell}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\n/** Keeps a newly built viewer compatible while an older hub process is restarting. */\nfunction previewMimeType(content: WorkflowArtifactContentResponse): string {\n if (content.mimeType !== undefined) return content.mimeType;\n const extension = content.path.split('.').pop()?.toLowerCase();\n if (extension === 'md' || extension === 'markdown') return 'text/markdown';\n if (extension === 'json') return 'application/json';\n if (extension === 'csv') return 'text/csv';\n if (extension === 'tsv') return 'text/tab-separated-values';\n if (extension === 'html' || extension === 'htm') return 'text/html';\n if (extension === 'pdf') return 'application/pdf';\n if (['bmp', 'gif', 'ico', 'jpeg', 'jpg', 'png', 'svg', 'webp'].includes(extension ?? '')) return 'image/unknown';\n if (['aac', 'm4a', 'mp3', 'oga', 'ogg', 'wav'].includes(extension ?? '')) return 'audio/unknown';\n if (['mov', 'mp4', 'ogv', 'webm'].includes(extension ?? '')) return 'video/unknown';\n return content.text === undefined ? 'application/octet-stream' : 'text/plain';\n}\n\nfunction ArtifactPreview({\n content,\n rawUrl,\n raw,\n}: {\n content: WorkflowArtifactContentResponse;\n rawUrl: string;\n raw: boolean;\n}) {\n const text = content.text ?? '';\n const mimeType = previewMimeType(content);\n if (content.size === 0) {\n return (\n <EmptyState\n data-testid=\"artifact-empty\"\n title=\"this artifact is empty\"\n description=\"The workflow created the file but did not write any content.\"\n />\n );\n }\n if (mimeType === 'text/markdown') {\n return raw ? (\n <pre\n data-testid=\"artifact-raw\"\n className=\"whitespace-pre-wrap break-words font-mono text-sm leading-snug text-doom-text\"\n >\n {text}\n </pre>\n ) : (\n <div data-testid=\"artifact-markdown\" className=\"max-w-5xl text-base text-doom-text\">\n <Markdown text={text} />\n </div>\n );\n }\n if (mimeType === 'application/json') {\n let formatted = text;\n try {\n formatted = JSON.stringify(JSON.parse(text) as unknown, null, 2);\n } catch {\n // An incomplete file remains useful as literal text while a workflow writes it.\n }\n return (\n <pre className=\"whitespace-pre-wrap break-words font-mono text-sm leading-snug text-doom-text\">{formatted}</pre>\n );\n }\n if (mimeType === 'text/csv' || mimeType === 'text/tab-separated-values') {\n return <DelimitedPreview text={text} delimiter={mimeType === 'text/csv' ? ',' : '\\t'} />;\n }\n if (mimeType === 'text/html') {\n return (\n <iframe\n data-testid=\"artifact-html\"\n title={content.path}\n sandbox=\"\"\n referrerPolicy=\"no-referrer\"\n srcDoc={text}\n className=\"min-h-[520px] w-full rounded bg-white\"\n />\n );\n }\n if (mimeType.startsWith('image/')) {\n return (\n <img\n data-testid=\"artifact-image\"\n src={rawUrl}\n alt={content.path}\n className=\"max-h-full max-w-full object-contain\"\n />\n );\n }\n if (mimeType === 'application/pdf') {\n return (\n <object\n data-testid=\"artifact-pdf\"\n data={rawUrl}\n type=\"application/pdf\"\n aria-label=\"PDF artifact\"\n className=\"min-h-[600px] w-full\"\n />\n );\n }\n if (mimeType.startsWith('audio/')) {\n return (\n <audio data-testid=\"artifact-audio\" src={rawUrl} controls preload=\"metadata\" className=\"w-full\">\n <track kind=\"captions\" />\n </audio>\n );\n }\n if (mimeType.startsWith('video/')) {\n return (\n <video data-testid=\"artifact-video\" src={rawUrl} controls preload=\"metadata\" className=\"max-h-full max-w-full\">\n <track kind=\"captions\" />\n </video>\n );\n }\n if (content.text !== undefined) {\n return <pre className=\"whitespace-pre-wrap break-words font-mono text-sm leading-snug text-doom-text\">{text}</pre>;\n }\n return (\n <EmptyState title=\"preview unavailable\" description=\"Download this artifact to open it with a local application.\" />\n );\n}\n\n/** One artifact, read-only, in its own tab. */\nexport function artifactTab(run: WorkflowRunView, path: string): TransientTab {\n return {\n id: `${TAB_ID_PREFIX}${run.workspace}-${run.runKey}-${path}`.replace(/[^\\w-]+/g, '-'),\n label: path.split('/').pop() ?? path,\n panel: (props: WebPluginSlotProps) => (\n <ArtifactViewerPanel {...props} workspace={run.workspace} runKey={run.runKey} path={path} />\n ),\n };\n}\n\n/**\n * One artifact's text.\n *\n * Read-only and reloadable: a run keeps writing while somebody is reading, and\n * the file on the next read is the one that matters.\n */\nexport function ArtifactViewerPanel({\n workspace,\n runKey,\n path,\n sessionId,\n}: WebPluginSlotProps & { workspace: string; runKey: string; path: string }) {\n const [content, setContent] = useState<WorkflowArtifactContentResponse>();\n const [error, setError] = useState<string>();\n const [reloads, setReloads] = useState(0);\n const [raw, setRaw] = useState(false);\n\n useEffect(() => {\n let live = true;\n void fetchArtifact(workspace, runKey, path, sessionId).then((result) => {\n if (!live) return;\n if ('error' in result) {\n setError(result.error);\n setContent(undefined);\n return;\n }\n setError(undefined);\n setContent(result.artifact);\n });\n return () => {\n live = false;\n };\n }, [workspace, runKey, path, reloads, sessionId]);\n\n const rawUrl = artifactContentUrl(workspace, runKey, path, false, sessionId);\n const downloadUrl = artifactContentUrl(workspace, runKey, path, true, sessionId);\n const mimeType = content === undefined ? undefined : previewMimeType(content);\n const isMarkdown = mimeType === 'text/markdown';\n\n return (\n <div data-testid=\"artifact-viewer\" className=\"flex min-h-0 flex-1 flex-col px-[26px] py-[18px]\">\n <div className=\"flex items-center gap-2.5 pb-3\">\n <span className=\"truncate text-sm font-bold text-doom-hi\">{path}</span>\n <Badge size=\"xs\">{mimeType ?? 'artifact'}</Badge>\n <span className=\"text-2xs text-doom-faint\">\n {content === undefined ? '' : `${formatSize(content.size)} · written ${formatWhen(content.modifiedAt)}`}\n </span>\n <span className=\"min-w-0 flex-1\" />\n {isMarkdown ? (\n <div className=\"flex items-center\">\n <Button\n variant={raw ? 'outline' : 'primary'}\n size=\"xs\"\n data-testid=\"artifact-rendered-toggle\"\n onClick={() => setRaw(false)}\n >\n rendered\n </Button>\n <Button\n variant={raw ? 'primary' : 'outline'}\n size=\"xs\"\n data-testid=\"artifact-raw-toggle\"\n onClick={() => setRaw(true)}\n >\n raw\n </Button>\n </div>\n ) : null}\n <Button asChild variant=\"ghost\" size=\"xs\">\n <a data-testid=\"artifact-download\" href={downloadUrl} download>\n download\n </a>\n </Button>\n <Button\n variant=\"ghost\"\n size=\"xs\"\n data-testid=\"artifact-reload\"\n onClick={() => setReloads((count) => count + 1)}\n >\n reload\n </Button>\n </div>\n <div className=\"min-h-0 flex-1 overflow-auto rounded-md border border-doom-border bg-doom-deep p-4\">\n {error !== undefined ? (\n <span data-testid=\"artifact-error\" className=\"text-xs text-doom-yellow\">\n {error}\n </span>\n ) : content === undefined ? (\n <span className=\"text-xs text-doom-faint\">loading preview</span>\n ) : (\n <ArtifactPreview content={content} rawUrl={rawUrl} raw={raw} />\n )}\n </div>\n {content?.truncated === true ? (\n <span className=\"pt-2 text-2xs text-doom-faint\">\n this preview shows the first {formatSize(content.text?.length)}; download the artifact for the complete file\n </span>\n ) : null}\n </div>\n );\n}\n\n/**\n * The run directory, as the run pane's second tab.\n *\n * The workflow's own declaration leads, in the order it was written and\n * including entries no job has produced yet, because the declaration is what\n * the run is for. What the folder holds besides that follows.\n */\nexport function ArtifactsPane({\n run,\n sessionId,\n onOpen,\n}: {\n run: WorkflowRunView;\n sessionId: string | null;\n onOpen: (path: string) => void;\n}) {\n const [listing, setListing] = useState<WorkflowArtifactsResponse>();\n const [error, setError] = useState<string>();\n\n useEffect(() => {\n let live = true;\n const read = (): void => {\n void fetchArtifacts(run.workspace, run.runKey, sessionId).then((result) => {\n if (!live) return;\n if ('error' in result) {\n setError(result.error);\n return;\n }\n setError(undefined);\n setListing(result.artifacts);\n });\n };\n read();\n // A running workflow writes while the pane is open; a settled one cannot,\n // so it is read once and left alone.\n if (run.stage !== 'running') return;\n const timer = setInterval(read, 5_000);\n return () => {\n live = false;\n clearInterval(timer);\n };\n }, [run.workspace, run.runKey, run.stage, sessionId]);\n\n const declared = listing?.artifacts.filter((entry) => entry.declared) ?? [];\n const found = listing?.artifacts.filter((entry) => !entry.declared) ?? [];\n\n const Row = ({ entry }: { entry: WorkflowArtifactView }) => {\n const glyph = STATE_GLYPH[entry.state];\n const openable = entry.kind === 'file' && entry.state !== 'pending';\n return (\n <button\n type=\"button\"\n data-testid={`artifact-row-${entry.path}`}\n data-artifact-state={entry.state}\n disabled={!openable}\n onClick={() => onOpen(entry.path)}\n className={`flex flex-col gap-0.5 px-3 py-1.5 text-left ${openable ? 'cursor-pointer hover:bg-doom-panel' : 'cursor-default'}`}\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className={`w-3 shrink-0 text-xs ${glyph.className}`}>{glyph.glyph}</span>\n <span className={`truncate text-sm ${entry.state === 'pending' ? 'text-doom-dim' : 'text-doom-hi'}`}>\n {entry.path}\n </span>\n {entry.producedBy.length === 0 ? null : (\n <Badge size=\"xs\" tone=\"violet\" className=\"shrink-0\">\n {entry.producedBy.join(', ')}\n </Badge>\n )}\n <span className=\"min-w-0 flex-1\" />\n <span className=\"shrink-0 text-2xs text-doom-faint\">\n {entry.state === 'pending'\n ? 'not written yet'\n : `${formatSize(entry.size)} · ${formatWhen(entry.modifiedAt)}`}\n </span>\n </span>\n {entry.description === '' ? null : (\n <span className=\"truncate pl-5 text-2xs text-doom-faint\">{entry.description}</span>\n )}\n </button>\n );\n };\n\n return (\n <div data-testid=\"artifacts-pane\" className=\"flex min-h-0 flex-1 flex-col\">\n {error !== undefined ? (\n <EmptyState className=\"py-4\" title=\"the run directory cannot be read\" description={error} />\n ) : null}\n {declared.length === 0 && found.length === 0 && error === undefined ? (\n <EmptyState className=\"py-4\" title=\"nothing in the run directory yet\" />\n ) : null}\n {declared.length === 0 ? null : (\n <>\n <span className=\"px-3 pb-1 pt-2 text-2xs font-bold tracking-wider text-doom-faint\">\n DECLARED · {listing?.description || 'run-directory'}\n </span>\n {declared.map((entry) => (\n <Row key={entry.path} entry={entry} />\n ))}\n </>\n )}\n {found.length === 0 ? null : (\n <>\n <span className=\"px-3 pb-1 pt-3 text-2xs font-bold tracking-wider text-doom-faint\">ALSO IN THE FOLDER</span>\n {found.map((entry) => (\n <Row key={entry.path} entry={entry} />\n ))}\n </>\n )}\n {listing === undefined ? null : (\n <span className=\"truncate px-3 py-2 text-2xs text-doom-faint\">{listing.runDir}</span>\n )}\n </div>\n );\n}\n","import type { WorkflowCatalogEntryView } from '../../../../../types/webWorkflows';\n\n/**\n * The `/workflow-launch` line the dialog sends.\n *\n * WHY THE BUILDER LIVES HERE AND THE PARSER DOES NOT:\n * Cockpit code is compiled into the host bundle and may import only this\n * package's own web and type modules, so it cannot share the session's parser.\n * The two are pinned together by a test that parses what this writes, which is\n * the only guarantee that matters: the line has to survive the trip.\n */\n\nexport const WORKFLOW_LAUNCH_VERB = '/workflow-launch';\n/** The reserved key; every other pair is one of the workflow's own inputs. */\nexport const RUNNER_KEY = 'runner';\n\nexport interface WorkflowLaunchRequest {\n workflow: string;\n runner?: string;\n inputs: Record<string, string>;\n prompt?: string;\n}\n\n/** Quotes a value that carries whitespace, which is how a value survives tokenizing. */\nfunction quote(value: string): string {\n return /\\s/.test(value) ? `\"${value}\"` : value;\n}\n\nexport function workflowLaunchLine(request: WorkflowLaunchRequest): string {\n const pairs = [\n ...(request.runner === undefined || request.runner === '' ? [] : [`${RUNNER_KEY}=${quote(request.runner)}`]),\n ...Object.entries(request.inputs)\n .filter(([, value]) => value !== '')\n .map(([key, value]) => `${key}=${quote(value)}`),\n ];\n const prompt = request.prompt?.trim();\n return [WORKFLOW_LAUNCH_VERB, quote(request.workflow), ...pairs, ...(prompt ? [prompt] : [])].join(' ');\n}\n\n/** The trigger that makes a prompt mandatory. */\nconst USER_PROMPT_TRIGGER = 'user_prompt';\n\n/** What the dialog will not let a reader send, worded the way the session would answer. */\nexport function launchProblems(workflow: WorkflowCatalogEntryView, request: WorkflowLaunchRequest): string[] {\n const problems: string[] = [];\n if (workflow.triggers.includes(USER_PROMPT_TRIGGER) && (request.prompt ?? '').trim() === '') {\n problems.push('This workflow is triggered by a prompt, so it needs one.');\n }\n const missing = workflow.inputs\n .filter((input) => input.required === true && (request.inputs[input.name] ?? '') === '')\n .map((input) => input.name);\n if (missing.length > 0) {\n problems.push(`Missing required input${missing.length > 1 ? 's' : ''}: ${missing.join(', ')}.`);\n }\n return problems;\n}\n\n/** The default a field starts with: what the workflow declared, or empty. */\nexport function initialInputs(workflow: WorkflowCatalogEntryView): Record<string, string> {\n return Object.fromEntries(workflow.inputs.map((input) => [input.name, input.default ?? '']));\n}\n\n/** The runner a launch starts on: the workflow's first declared one, when it declares any. */\nexport function initialRunner(workflow: WorkflowCatalogEntryView): string | undefined {\n return workflow.runners?.[0];\n}\n","import type { SessionFrameSender } from '@agimon-ai/doompi-core/web';\nimport {\n Badge,\n Button,\n Dialog,\n DialogBody,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Input,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Textarea,\n} from '@agimon-ai/doompi-web-components';\nimport { type KeyboardEvent as ReactKeyboardEvent, useState } from 'react';\n\nimport type { WorkflowCatalogEntryView, WorkflowCatalogInputView } from '../../../../../types/webWorkflows';\nimport {\n initialInputs,\n initialRunner,\n launchProblems,\n workflowLaunchLine,\n type WorkflowLaunchRequest,\n} from '../_lib/launchLine';\nimport { requestLaunch } from '../_lib/workflowsStore';\n\nconst PROMPT_ROWS = 3;\nconst BOOLEAN_TYPE = 'boolean';\nconst BOOLEAN_VALUES = ['true', 'false'] as const;\n\nfunction FieldLabel({ children }: { children: string }) {\n return <span className=\"text-2xs font-bold tracking-widest text-doom-faint\">{children}</span>;\n}\n\n/** One `workflow_dispatch` input: a picker when the workflow constrains it, a field otherwise. */\nfunction InputField({\n input,\n value,\n onChange,\n}: {\n input: WorkflowCatalogInputView;\n value: string;\n onChange: (next: string) => void;\n}) {\n const options = input.options ?? (input.type === BOOLEAN_TYPE ? [...BOOLEAN_VALUES] : undefined);\n const hint = [\n input.required === true ? 'required' : undefined,\n input.default === undefined ? undefined : `default: ${input.default}`,\n input.description,\n ]\n .filter((part): part is string => part !== undefined && part !== '')\n .join(' · ');\n return (\n <div\n className=\"flex flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-2.5\"\n data-testid={`launch-input-${input.name}`}\n >\n <span className=\"min-w-0 truncate text-xs font-bold text-doom-text sm:w-28 sm:shrink-0\">\n {input.name}\n {input.required === true ? <span className=\"text-doom-yellow\"> *</span> : null}\n </span>\n {options === undefined ? (\n <Input\n className=\"min-w-0 flex-1\"\n value={value}\n placeholder={input.default ?? ''}\n onChange={(event) => onChange(event.target.value)}\n />\n ) : (\n <Select value={value === '' ? undefined : value} onValueChange={onChange}>\n <SelectTrigger className=\"h-7 w-full min-w-0 text-xs sm:min-w-[160px]\">\n <SelectValue placeholder=\"choose…\" />\n </SelectTrigger>\n <SelectContent>\n {options.map((option) => (\n <SelectItem key={option} value={option}>\n {option}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n <span className=\"min-w-0 truncate text-2xs text-doom-faint sm:w-40 sm:shrink-0\">{hint}</span>\n </div>\n );\n}\n\n/**\n * Launches one workflow from the catalog: the prompt, every input the file\n * declares, the runner when it declares a runner map, then the exact line the\n * session will parse. Enter launches, since the composer sends the same way.\n */\nexport function LaunchWorkflowDialog({\n sessionId,\n workflow,\n cwd,\n initialPrompt,\n send,\n onClose,\n onLaunched,\n}: {\n sessionId: string;\n workflow: WorkflowCatalogEntryView;\n cwd: string;\n initialPrompt: string;\n send: SessionFrameSender;\n onClose: () => void;\n onLaunched: () => void;\n}) {\n const [prompt, setPrompt] = useState(initialPrompt);\n const [inputs, setInputs] = useState<Record<string, string>>(() => initialInputs(workflow));\n const [runner, setRunner] = useState<string | undefined>(() => initialRunner(workflow));\n const request: WorkflowLaunchRequest = {\n workflow: workflow.name === '' ? workflow.relativePath : workflow.name,\n ...(runner === undefined ? {} : { runner }),\n inputs,\n ...(prompt.trim() === '' ? {} : { prompt: prompt.trim() }),\n };\n const problems = launchProblems(workflow, request);\n const line = workflowLaunchLine(request);\n\n const launch = (): void => {\n if (problems.length > 0) return;\n requestLaunch(send, sessionId, line, workflow.path);\n onLaunched();\n };\n const onPromptKeyDown = (event: ReactKeyboardEvent<HTMLTextAreaElement>): void => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n launch();\n }\n };\n\n return (\n <Dialog\n open\n onOpenChange={(open) => {\n if (!open) onClose();\n }}\n >\n <DialogContent width=\"lg\" data-testid=\"launch-workflow-dialog\" aria-describedby={undefined}>\n <DialogHeader>\n <div className=\"flex min-w-0 flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2.5\">\n <span className=\"text-2xs text-doom-faint\">launch workflow</span>\n <DialogTitle data-testid=\"launch-workflow-name\" className=\"max-w-full break-words\">\n {workflow.name}\n </DialogTitle>\n <Badge size=\"xs\" className=\"max-w-full truncate\">\n {workflow.relativePath}\n </Badge>\n </div>\n </DialogHeader>\n <DialogBody>\n <p className=\"text-sm leading-relaxed text-doom-dim\">\n {workflow.description || 'This workflow declares no description.'}\n </p>\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>PROMPT</FieldLabel>\n <Textarea\n data-testid=\"launch-prompt\"\n autoFocus\n rows={PROMPT_ROWS}\n value={prompt}\n placeholder=\"what should this run do? it becomes WORKFLOW_CONTEXT for every job\"\n onChange={(event) => setPrompt(event.target.value)}\n onKeyDown={onPromptKeyDown}\n />\n <span className=\"text-2xs text-doom-faint\">enter launches · shift+enter for a new line</span>\n </div>\n {workflow.inputs.length === 0 ? null : (\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-center gap-2\">\n <FieldLabel>INPUTS</FieldLabel>\n <span className=\"text-2xs text-doom-faint\">workflow_dispatch · {workflow.inputs.length} declared</span>\n </div>\n {workflow.inputs.map((input) => (\n <InputField\n key={input.name}\n input={input}\n value={inputs[input.name] ?? ''}\n onChange={(next) => setInputs((current) => ({ ...current, [input.name]: next }))}\n />\n ))}\n </div>\n )}\n <div className=\"flex flex-wrap gap-5\">\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>RUNNER</FieldLabel>\n {workflow.runners === undefined || workflow.runners.length === 0 ? (\n <span className=\"flex h-7 items-center text-xs text-doom-dim\">whatever the workflow resolves</span>\n ) : (\n <Select value={runner} onValueChange={setRunner}>\n <SelectTrigger data-testid=\"launch-runner\" className=\"h-7 w-full min-w-0 text-xs sm:min-w-[160px]\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {workflow.runners.map((choice) => (\n <SelectItem key={choice} value={choice}>\n {choice}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n <span className=\"text-2xs text-doom-faint\">\n {workflow.runners === undefined ? 'no runner map declared' : 'the runners every step agrees on'}\n </span>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>JOBS</FieldLabel>\n <span className=\"flex h-7 items-center text-xs text-doom-dim\">\n {workflow.jobs.map((job) => job.name).join(' → ') || 'none declared'}\n </span>\n <span className=\"text-2xs text-doom-faint\">in the order the file declares them</span>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>CWD</FieldLabel>\n <span className=\"flex h-7 items-center text-xs text-doom-dim\">{cwd}</span>\n <span className=\"text-2xs text-doom-faint\">the session's directory</span>\n </div>\n </div>\n <div className=\"flex flex-col gap-1 rounded-md border border-doom-border bg-doom-deep px-3 py-2\">\n <FieldLabel>SENT TO THE SESSION</FieldLabel>\n <pre data-testid=\"launch-line\" className=\"whitespace-pre-wrap break-words text-xs text-doom-green\">\n {line}\n </pre>\n </div>\n {problems.length === 0 ? null : (\n <p data-testid=\"launch-problems\" className=\"text-xs text-doom-yellow\">\n {problems.join(' ')}\n </p>\n )}\n <DialogFooter className=\"flex-wrap sm:flex-nowrap\">\n <span className=\"w-full text-2xs text-doom-faint sm:w-auto\">\n the run appears on the board as soon as it starts\n </span>\n <span className=\"min-w-0 flex-1\" />\n <Button variant=\"outline\" size=\"xs\" data-testid=\"launch-cancel\" onClick={onClose}>\n cancel\n </Button>\n <Button\n variant=\"primary\"\n size=\"xs\"\n data-testid=\"launch-submit\"\n disabled={problems.length > 0}\n onClick={launch}\n >\n launch\n </Button>\n </DialogFooter>\n </DialogBody>\n </DialogContent>\n </Dialog>\n );\n}\n","import type { TransientTab, WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport { AnsiLine, Badge, Button, StatusBadge, StreamCursor } from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { type KeyboardEvent as ReactKeyboardEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { WorkflowRunView } from '../../../../../types/webWorkflows';\nimport type { WorkflowTerminalCapabilitiesView } from '../../../../../types/webWorkflowTerminal';\nimport { followScreen, releaseControl, sendKeys, takeControl } from '../_lib/terminalApi';\nimport { workflows } from '../_lib/workflowsStore';\n\n/** The tab id doubles as the URL segment, so it stays plain and unique across plugins. */\nconst TAB_ID_PREFIX = 'workflows-step-';\n/** Keys that mean something to a terminal but nothing to a text field. */\nconst CONTROL_KEYS: Readonly<Record<string, string>> = {\n Enter: '\\r',\n Backspace: '\\x7f',\n Tab: '\\t',\n Escape: '\\x1b',\n ArrowUp: '\\x1b[A',\n ArrowDown: '\\x1b[B',\n ArrowRight: '\\x1b[C',\n ArrowLeft: '\\x1b[D',\n};\nconst CTRL_C = '\\x03';\nconst CTRL_D = '\\x04';\nconst CTRL_A_CODE = 64;\n\nexport interface StepTabTarget {\n workspace: string;\n runKey: string;\n /** The job and step the reader clicked, which the header names. */\n job: string;\n step?: string;\n}\n\n/** The temporary tab for one step; the host keeps this panel while the tab is open. */\nexport function stepTerminalTab(run: WorkflowRunView, job: string, step?: string): TransientTab {\n const target: StepTabTarget = {\n workspace: run.workspace,\n runKey: run.runKey,\n job,\n ...(step === undefined ? {} : { step }),\n };\n const label = step ?? job;\n return {\n id: `${TAB_ID_PREFIX}${run.workspace}-${run.runKey}-${job}${step === undefined ? '' : `-${step}`}`.replace(\n /[^\\w-]+/g,\n '-',\n ),\n label: `${run.displayName} › ${label}`,\n panel: (props: WebPluginSlotProps) => <StepTerminalPanel {...props} target={target} />,\n };\n}\n\nfunction ScreenLine({ line }: { line: string }) {\n // A blank row still has to hold the grid open, so an empty line keeps its\n // height rather than collapsing the screen by one row.\n if (line.length === 0) return <span className=\"block h-[15px]\" />;\n return <AnsiLine line={line} className=\"block whitespace-pre\" />;\n}\n\n/**\n * One run's terminal, under a header naming the step the reader opened it from.\n *\n * A run has one terminal, shared by its steps in sequence, so this is the run's\n * screen and the header says which step is on it. Watching is free; typing\n * takes the keyboard first, because the pane belongs to whoever is answering\n * whatever the nested agent asked.\n */\nexport function StepTerminalPanel({ sessionId, target }: WebPluginSlotProps & { target: StepTabTarget }) {\n const runs = useStore(workflows.store, (state) => workflows.select(state, sessionId).runs);\n const run = runs.find((candidate) => candidate.workspace === target.workspace && candidate.runKey === target.runKey);\n const [lines, setLines] = useState<string[]>([]);\n const [capabilities, setCapabilities] = useState<WorkflowTerminalCapabilitiesView>();\n const [ended, setEnded] = useState(false);\n const [token, setToken] = useState<string>();\n const [notice, setNotice] = useState<string>();\n const screenRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // A new run's screen has not ended yet; the subscription below is the external system.\n // oxlint-disable-next-line react/set-state-in-effect\n setEnded(false);\n return followScreen(\n target.workspace,\n target.runKey,\n (event) => {\n setLines(event.lines);\n setCapabilities(event.capabilities);\n if (event.ended === true) setEnded(true);\n },\n sessionId,\n );\n }, [sessionId, target.workspace, target.runKey]);\n\n // The keyboard is a lease on the hub, so a tab that goes away must hand it\n // back rather than leaving the next reader locked out until it expires.\n useEffect(() => {\n if (token === undefined) return;\n return () => {\n void releaseControl(target.workspace, target.runKey, token, sessionId);\n };\n }, [sessionId, token, target.workspace, target.runKey]);\n\n useEffect(() => {\n screenRef.current?.scrollTo({ top: screenRef.current.scrollHeight });\n }, [lines]);\n\n const arm = useCallback(async () => {\n const result = await takeControl(target.workspace, target.runKey, undefined, sessionId);\n if (result.held && result.token !== undefined) {\n setToken(result.token);\n setNotice(undefined);\n return;\n }\n setNotice(result.reason ?? 'The keyboard is not available for this run.');\n }, [sessionId, target.workspace, target.runKey]);\n\n const disarm = useCallback(async () => {\n if (token !== undefined) await releaseControl(target.workspace, target.runKey, token, sessionId);\n setToken(undefined);\n }, [sessionId, token, target.workspace, target.runKey]);\n\n const type = async (data: string): Promise<void> => {\n if (token === undefined) return;\n const { error } = await sendKeys(target.workspace, target.runKey, token, data, sessionId);\n if (error !== undefined) {\n setNotice(error);\n setToken(undefined);\n }\n };\n\n const onKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>): void => {\n if (token === undefined) return;\n if (event.key === 'Escape' && !event.ctrlKey) {\n event.preventDefault();\n void disarm();\n return;\n }\n const control = CONTROL_KEYS[event.key];\n if (control !== undefined) {\n event.preventDefault();\n void type(control);\n return;\n }\n if (event.ctrlKey && event.key.length === 1) {\n event.preventDefault();\n const letter = event.key.toUpperCase().charCodeAt(0);\n void type(event.key === 'c' ? CTRL_C : event.key === 'd' ? CTRL_D : String.fromCharCode(letter - CTRL_A_CODE));\n return;\n }\n if (event.key.length === 1 && !event.metaKey && !event.altKey) {\n event.preventDefault();\n void type(event.key);\n }\n };\n\n const held = token !== undefined;\n const writable = capabilities?.writable === true;\n\n return (\n <div data-testid=\"step-terminal-panel\" className=\"flex min-h-0 flex-1 flex-col px-[26px] py-[18px]\">\n <div data-testid=\"step-terminal-head\" className=\"flex items-center gap-2.5 pb-3\">\n <span className=\"shrink-0 truncate text-sm font-bold text-doom-hi\">{run?.displayName ?? target.runKey}</span>\n <span className=\"text-xs text-doom-faint\">›</span>\n <span className=\"shrink-0 truncate text-sm font-bold text-doom-blue\">{target.job}</span>\n {target.step === undefined ? null : (\n <>\n <span className=\"text-xs text-doom-faint\">›</span>\n <span className=\"min-w-0 truncate text-sm text-doom-text\">{target.step}</span>\n </>\n )}\n {run === undefined ? null : (\n <StatusBadge\n tone={run.stage === 'running' ? 'running' : run.stage === 'error' ? 'error' : 'ok'}\n data-testid=\"step-terminal-stage\"\n >\n {run.stage}\n </StatusBadge>\n )}\n <span className=\"min-w-0 flex-1\" />\n <Badge\n size=\"xs\"\n tone={held ? 'blue' : 'neutral'}\n data-testid=\"step-terminal-control\"\n className={held ? 'border-doom-blue/60 bg-doom-tint-blue text-doom-hi' : ''}\n >\n {held ? 'keyboard yours' : 'watching'}\n </Badge>\n {writable ? (\n <Button\n variant={held ? 'outline' : 'primary'}\n size=\"xs\"\n data-testid=\"step-terminal-arm\"\n onClick={() => void (held ? disarm() : arm())}\n >\n {held ? 'release keyboard' : 'take control'}\n </Button>\n ) : null}\n </div>\n <div\n ref={screenRef}\n data-testid=\"step-terminal-screen\"\n tabIndex={0}\n onKeyDown={onKeyDown}\n className={`min-h-0 flex-1 overflow-y-auto rounded-md border bg-doom-deep px-4 py-3 font-mono text-sm leading-tight text-doom-text outline-none ${\n held ? 'border-doom-blue/60' : 'border-doom-border'\n }`}\n >\n {lines.length === 0 ? (\n <span className=\"text-xs text-doom-faint\">\n {capabilities?.readable === false\n ? (capabilities.reason ?? 'This run has no terminal to read.')\n : 'waiting for the run to paint…'}\n </span>\n ) : (\n lines.map((line, index) => <ScreenLine key={index} line={line} />)\n )}\n {held && !ended ? <StreamCursor className=\"mt-0.5 h-[12px] w-1.5\" /> : null}\n </div>\n <div className=\"flex items-center gap-3 pt-2.5\">\n <span data-testid=\"step-terminal-hint\" className=\"text-2xs text-doom-faint\">\n {held\n ? 'keys go to the run · ctrl-c and ctrl-d pass through · esc releases the keyboard'\n : capabilities?.writable === false\n ? (capabilities.reason ?? 'this run cannot be typed into')\n : 'read-only until you take control · the run keeps going either way'}\n </span>\n <span className=\"min-w-0 flex-1\" />\n {ended ? (\n <span data-testid=\"step-terminal-ended\" className=\"text-2xs text-doom-faint\">\n the run has settled; this is its last screen\n </span>\n ) : null}\n {notice === undefined ? null : (\n <span data-testid=\"step-terminal-notice\" className=\"text-2xs text-doom-yellow\">\n {notice}\n </span>\n )}\n </div>\n </div>\n );\n}\n","import { Badge, Button, CloseIcon, Input, Kbd } from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport type { KeyboardEvent as ReactKeyboardEvent } from 'react';\n\nimport type { WorkflowCatalogEntryView } from '../../../../../types/webWorkflows';\nimport { catalog, filterCatalog, selectWorkflow, setCatalogFilter, toggleInspect } from '../_lib/catalogStore';\n\nconst INPUT_TAG = 'INPUT';\n\n/** The unfolded row: what the file declares, read-only, as the TUI catalog's tabs show it. */\nfunction Detail({ workflow }: { workflow: WorkflowCatalogEntryView }) {\n const rows: Array<[string, string]> = [\n ['triggers', workflow.triggers.length > 0 ? workflow.triggers.join(', ') : 'none declared'],\n [\n 'inputs',\n workflow.inputs.length > 0\n ? workflow.inputs\n .map((input) => `${input.name}${input.required ? '*' : ''}${input.default ? ` = ${input.default}` : ''}`)\n .join(', ')\n : 'none declared',\n ],\n ['jobs', workflow.jobs.length > 0 ? workflow.jobs.map((job) => job.name).join(' → ') : 'none declared'],\n [\n 'artifacts',\n workflow.artifacts.length > 0 ? workflow.artifacts.map((entry) => entry.path).join(', ') : 'none declared',\n ],\n ['runners', workflow.runners === undefined ? 'any runner' : workflow.runners.join(', ') || 'none in common'],\n ['file', workflow.relativePath],\n ];\n return (\n <dl data-testid={`catalog-detail-${workflow.name}`} className=\"flex flex-col gap-1 pt-1 text-2xs\">\n {rows.map(([label, value]) => (\n <div key={label} className=\"flex gap-2\">\n <dt className=\"w-16 shrink-0 text-doom-faint\">{label}</dt>\n <dd className=\"min-w-0 break-words text-doom-dim\">{value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\nfunction WorkflowRow({\n workflow,\n selected,\n inspected,\n onSelect,\n onLaunch,\n onInspect,\n}: {\n workflow: WorkflowCatalogEntryView;\n selected: boolean;\n inspected: boolean;\n onSelect: () => void;\n onLaunch: () => void;\n onInspect: () => void;\n}) {\n const jobs = workflow.jobs.length;\n // A div rather than a button: the selected row carries buttons of its own.\n return (\n <div\n role=\"option\"\n aria-selected={selected}\n tabIndex={-1}\n data-testid={`catalog-workflow-${workflow.name}`}\n data-selected={selected}\n onClick={onSelect}\n onDoubleClick={onLaunch}\n className={`flex cursor-pointer flex-col gap-1 border-l-2 px-4 py-2 ${\n selected ? 'border-doom-blue bg-doom-panel' : 'border-transparent hover:bg-doom-panel/60'\n }`}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"truncate text-sm font-bold text-doom-hi\">{workflow.name}</span>\n {workflow.tags.map((tag) => (\n <Badge key={tag} size=\"xs\" className=\"shrink-0\">\n {tag}\n </Badge>\n ))}\n <span className=\"min-w-0 flex-1\" />\n <span className={`shrink-0 text-2xs ${workflow.error === undefined ? 'text-doom-cyan' : 'text-doom-red'}`}>\n {workflow.error === undefined ? `${jobs} job${jobs === 1 ? '' : 's'}` : 'unreadable'}\n </span>\n </div>\n <span className=\"truncate text-xs text-doom-dim\">{workflow.description || workflow.relativePath}</span>\n {workflow.error === undefined ? (\n <span className=\"truncate text-2xs text-doom-faint\">\n {workflow.inputs.length} input{workflow.inputs.length === 1 ? '' : 's'} ·{' '}\n {workflow.runners === undefined ? 'any runner' : workflow.runners.join(', ') || 'no runner in common'}\n {workflow.artifacts.length > 0 ? ` · ${workflow.artifacts.length} artifacts` : ''}\n </span>\n ) : (\n <span className=\"truncate text-2xs text-doom-red\">{workflow.error}</span>\n )}\n {selected ? (\n <div className=\"flex items-center gap-3 pt-0.5\">\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid={`catalog-launch-${workflow.name}`}\n className=\"px-0\"\n disabled={workflow.error !== undefined}\n onClick={(event) => {\n event.stopPropagation();\n onLaunch();\n }}\n >\n launch <Kbd>↵</Kbd>\n </Button>\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid={`catalog-inspect-${workflow.name}`}\n className=\"px-0 text-doom-dim\"\n onClick={(event) => {\n event.stopPropagation();\n onInspect();\n }}\n >\n inspect <Kbd>i</Kbd>\n </Button>\n </div>\n ) : null}\n {selected && inspected ? <Detail workflow={workflow} /> : null}\n </div>\n );\n}\n\n/**\n * The workflow catalog, in the workflows tab's drawer: every workflow the\n * session's directory declares, with a filter and the keys the TUI catalog\n * also answers to. Launching hands the chosen workflow to the dialog.\n */\nexport function WorkflowCatalogDrawer({\n sessionId,\n onClose,\n onLaunch,\n}: {\n sessionId: string;\n onClose: () => void;\n onLaunch: (workflow: WorkflowCatalogEntryView) => void;\n}) {\n const state = useStore(catalog.store, (current) => catalog.select(current, sessionId));\n const shown = filterCatalog(state.workflows, state.filter);\n const selected = shown.find((workflow) => workflow.path === state.selected) ?? shown[0];\n\n const move = (delta: number): void => {\n if (shown.length === 0) return;\n const index = selected === undefined ? -1 : shown.findIndex((workflow) => workflow.path === selected.path);\n const next = shown[(index + delta + shown.length) % shown.length];\n if (next) selectWorkflow(sessionId, next.path);\n };\n\n const onKeyDown = (event: ReactKeyboardEvent<HTMLElement>): void => {\n const typing = (event.target as HTMLElement).tagName === INPUT_TAG;\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n move(event.key === 'ArrowDown' ? 1 : -1);\n return;\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n onClose();\n return;\n }\n if (selected === undefined) return;\n if (event.key === 'Enter') {\n event.preventDefault();\n if (selected.error === undefined) onLaunch(selected);\n return;\n }\n if (typing) return;\n if (event.key === 'i') toggleInspect(sessionId, selected.path);\n };\n\n return (\n <aside\n data-testid=\"workflow-catalog-drawer\"\n tabIndex={0}\n onKeyDown={onKeyDown}\n className=\"flex w-[min(440px,calc(100vw-24px))] shrink-0 flex-col overflow-hidden border-l border-doom-border bg-doom-rail outline-none\"\n >\n <div className=\"flex h-11 shrink-0 items-center gap-2.5 border-b border-doom-border px-4\">\n <span className=\"text-base font-bold text-doom-hi\">workflow catalog</span>\n <Badge size=\"xs\" data-testid=\"catalog-count\">\n {state.workflows.length} workflow{state.workflows.length === 1 ? '' : 's'}\n </Badge>\n <span className=\"min-w-0 flex-1\" />\n <Kbd>SPC w l</Kbd>\n <Button variant=\"ghost\" size=\"icon\" data-testid=\"catalog-close\" title=\"close the catalog\" onClick={onClose}>\n <CloseIcon className=\"h-3 w-3\" />\n </Button>\n </div>\n <div className=\"px-4 pt-2.5 pb-1.5\">\n <Input\n data-testid=\"catalog-filter\"\n value={state.filter}\n placeholder=\"filter by name, tag, or job…\"\n autoFocus\n onChange={(event) => setCatalogFilter(sessionId, event.target.value)}\n />\n </div>\n <div role=\"listbox\" className=\"flex min-h-0 flex-1 flex-col overflow-y-auto pb-2\">\n {shown.length === 0 ? (\n <p data-testid=\"catalog-empty\" className=\"px-4 py-3 text-xs text-doom-faint\">\n {state.warning ??\n (state.workflows.length === 0\n ? 'no workflows found for this session; add one under automations/workflows'\n : 'nothing matches the filter')}\n </p>\n ) : null}\n {shown.map((workflow) => (\n <WorkflowRow\n key={workflow.path}\n workflow={workflow}\n selected={selected?.path === workflow.path}\n inspected={state.inspected === workflow.path}\n onSelect={() => selectWorkflow(sessionId, workflow.path)}\n onLaunch={() => onLaunch(workflow)}\n onInspect={() => toggleInspect(sessionId, workflow.path)}\n />\n ))}\n </div>\n <div className=\"flex h-8 shrink-0 items-center justify-between border-t border-doom-border-soft bg-doom-deep px-4\">\n <span className=\"text-2xs text-doom-faint\">↑↓ choose · enter launch · i inspect · esc close</span>\n <span className=\"text-2xs text-doom-faint\">{state.cwd}</span>\n </div>\n </aside>\n );\n}\n","import type { TransientTab, WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport {\n AnsiLine,\n Button,\n ChevronDownIcon,\n cn,\n Dialog,\n DialogBody,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Dot,\n type DotTone,\n EmptyState,\n Input,\n Kbd,\n OptionLabel,\n OptionRow,\n Popover,\n PopoverContent,\n PopoverFooter,\n PopoverHeader,\n PopoverTrigger,\n SearchIcon,\n StatusBadge,\n StreamCursor,\n} from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { type ReactNode, useEffect, useMemo, useRef, useState } from 'react';\n\nimport type {\n WorkflowJobView,\n WorkflowProgressState,\n WorkflowRunView,\n WorkflowStepView,\n} from '../../../../../types/webWorkflows';\nimport type { WorkflowTerminalCapabilitiesView } from '../../../../../types/webWorkflowTerminal';\nimport { catalog, closeCatalog, closeLaunch, openCatalog, openLaunch } from '../_lib/catalogStore';\nimport { formatRunDuration } from '../_lib/runDuration';\nimport { deleteWorkflowRun, followScreen } from '../_lib/terminalApi';\nimport { workflowRunIdentity } from '../_lib/workflowActivity';\nimport { focusRun, removeRun, workflows } from '../_lib/workflowsStore';\nimport { ArtifactsPane, artifactTab } from './ArtifactsPane';\nimport { LaunchWorkflowDialog } from './LaunchWorkflowDialog';\nimport { stepTerminalTab } from './StepTerminalPanel';\nimport { WorkflowCatalogDrawer } from './WorkflowCatalogDrawer';\n\n/** One workflows tab per session; the surface is singular, so the id needs nothing else. */\nexport const WORKFLOWS_TAB_ID = 'workflows-runs';\n\nconst TICK_MS = 10_000;\n\nconst STATE_ICON: Readonly<Record<WorkflowProgressState, { glyph: string; className: string }>> = {\n running: { glyph: '●', className: 'text-doom-blue' },\n resumed: { glyph: '●', className: 'text-doom-blue' },\n completed: { glyph: '✓', className: 'text-doom-green' },\n failed: { glyph: '✕', className: 'text-doom-red' },\n skipped: { glyph: '↷', className: 'text-doom-faint' },\n pause_requested: { glyph: '!', className: 'text-doom-yellow' },\n paused: { glyph: '!', className: 'text-doom-yellow' },\n};\n\nconst ACTIVE_STATES: ReadonlySet<WorkflowProgressState> = new Set(['running', 'resumed', 'pause_requested', 'paused']);\n\nfunction spanDuration(startedAt: string | undefined, endedAt: string | undefined, now: number): string | undefined {\n if (startedAt === undefined) return undefined;\n const start = Date.parse(startedAt);\n if (!Number.isFinite(start)) return undefined;\n const end = endedAt === undefined ? now : Date.parse(endedAt);\n if (!Number.isFinite(end)) return undefined;\n return formatRunDuration(Math.max(0, end - start));\n}\n\nfunction attentionFor(run: WorkflowRunView): { kind: 'error' | 'paused'; text: string } | undefined {\n if (run.stage === 'error') {\n const cause = run.errorMessage ?? 'the run ended in the error stage';\n return { kind: 'error', text: run.failedJob === undefined ? cause : `job '${run.failedJob}' failed: ${cause}` };\n }\n if (run.executionState === 'paused' || run.executionState === 'pause_requested') {\n return { kind: 'paused', text: 'the run is paused and will not move until it is resumed' };\n }\n return undefined;\n}\n\nfunction runDot(run: WorkflowRunView): DotTone {\n if (run.stage === 'error') return 'red';\n if (run.executionState === 'paused' || run.executionState === 'pause_requested') return 'yellow';\n if (run.stage === 'running') return 'blue';\n if (run.outcome === 'success') return 'green';\n return 'neutral';\n}\n\nfunction runState(run: WorkflowRunView): string {\n if (run.stage === 'error') return 'failed';\n if (run.executionState === 'paused' || run.executionState === 'pause_requested') return 'paused';\n if (run.stage === 'running') return 'running';\n return run.outcome ?? run.stage;\n}\n\nfunction runPriority(run: WorkflowRunView): number {\n if (attentionFor(run) !== undefined) return 0;\n if (run.stage === 'running') return 1;\n return 2;\n}\n\nfunction runSearchText(run: WorkflowRunView): string {\n return [\n run.displayName,\n run.workflowName,\n run.stage,\n run.outcome,\n run.executionState,\n run.position?.job,\n run.position?.step,\n ]\n .filter((part): part is string => typeof part === 'string')\n .join(' ')\n .toLowerCase();\n}\n\nfunction WorkflowPicker({\n runs,\n selected,\n onSelect,\n}: {\n runs: WorkflowRunView[];\n selected: WorkflowRunView;\n onSelect: (run: WorkflowRunView) => void;\n}) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const ordered = useMemo(() => [...runs].sort((left, right) => runPriority(left) - runPriority(right)), [runs]);\n const matching = ordered.filter((run) => runSearchText(run).includes(query.trim().toLowerCase()));\n const sections = [\n { label: 'needs you', runs: matching.filter((run) => attentionFor(run) !== undefined) },\n { label: 'active', runs: matching.filter((run) => attentionFor(run) === undefined && run.stage === 'running') },\n { label: 'recent', runs: matching.filter((run) => run.stage !== 'running' && attentionFor(run) === undefined) },\n ].filter((section) => section.runs.length > 0);\n\n return (\n <Popover\n open={open}\n onOpenChange={(next) => {\n setOpen(next);\n if (!next) setQuery('');\n }}\n >\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-testid=\"workflow-picker\"\n className=\"h-8 w-full max-w-[360px] justify-start border-doom-border bg-doom-deep px-2.5\"\n >\n <SearchIcon className=\"h-3 w-3 shrink-0 text-doom-faint\" />\n <span className=\"min-w-0 flex-1 truncate text-left font-bold text-doom-hi\">{selected.displayName}</span>\n <span className=\"shrink-0 text-2xs font-normal text-doom-faint\">{runs.length} workflows</span>\n <ChevronDownIcon className=\"h-3 w-3 shrink-0 text-doom-dim\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent side=\"bottom\" align=\"start\" data-testid=\"workflow-picker-popover\" className=\"w-[600px]\">\n <PopoverHeader>\n <span className=\"relative flex w-full items-center\">\n <SearchIcon className=\"pointer-events-none absolute left-2.5 h-3 w-3 text-doom-blue\" />\n <Input\n autoFocus\n size=\"sm\"\n data-testid=\"workflow-picker-search\"\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n placeholder={`Search ${String(runs.length)} workflows by name, job, or status`}\n className=\"w-full pl-8\"\n />\n </span>\n </PopoverHeader>\n <div className=\"grid max-h-[360px] grid-cols-1 gap-2 overflow-y-auto p-2 sm:grid-cols-2\">\n {sections.length === 0 ? (\n <span className=\"px-2 py-5 text-center text-xs text-doom-faint sm:col-span-2\">no matching workflows</span>\n ) : (\n sections.map((section) => (\n <div key={section.label} className=\"flex min-w-0 flex-col gap-0.5\">\n <span className=\"px-2 py-1 text-2xs font-bold uppercase tracking-wider text-doom-faint\">\n {section.label} · {section.runs.length}\n </span>\n {section.runs.map((run) => {\n const active = workflowRunIdentity(run) === workflowRunIdentity(selected);\n return (\n <button\n key={workflowRunIdentity(run)}\n type=\"button\"\n data-testid={`workflow-option-${run.runKey}`}\n data-run-stage={run.stage}\n data-active={active}\n onClick={() => {\n onSelect(run);\n setOpen(false);\n }}\n className={cn(\n 'flex min-w-0 flex-col gap-0.5 rounded px-2 py-1.5 text-left hover:bg-doom-deep',\n active && 'bg-doom-tint-blue ring-1 ring-inset ring-doom-blue/50',\n )}\n >\n <span className=\"flex min-w-0 items-center gap-2\">\n <Dot tone={runDot(run)} pulse={run.stage === 'running'} />\n <span className={cn('min-w-0 flex-1 truncate text-xs', active && 'font-bold text-doom-hi')}>\n {run.displayName}\n </span>\n <span className=\"shrink-0 text-2xs text-doom-faint\">{runState(run)}</span>\n </span>\n <span className=\"truncate pl-3.5 text-2xs text-doom-dim\">\n {[run.position?.job, run.position?.step].filter(Boolean).join(' · ') || 'settled'}\n </span>\n </button>\n );\n })}\n </div>\n ))\n )}\n </div>\n <PopoverFooter>\n <span>needs you and active stay first</span>\n <span>esc closes</span>\n </PopoverFooter>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction SelectedAttention({ run }: { run: WorkflowRunView }) {\n const attention = attentionFor(run);\n if (attention === undefined) return null;\n return (\n <div\n data-testid=\"workflow-needs-you\"\n className={cn(\n 'flex items-center gap-2 rounded border px-3 py-2',\n attention.kind === 'error'\n ? 'border-doom-edge-red bg-doom-tint-red/40'\n : 'border-doom-edge-yellow bg-doom-tint-yellow/40',\n )}\n >\n <StatusBadge size=\"xs\" tone={attention.kind === 'error' ? 'error' : 'running'}>\n {attention.kind === 'error' ? 'ERROR' : 'PAUSED'}\n </StatusBadge>\n <span data-testid={`needs-card-${run.runKey}`} className=\"min-w-0 flex-1 truncate text-xs text-doom-text\">\n {run.displayName}: {attention.text}\n </span>\n <span className=\"shrink-0 text-2xs text-doom-faint\">\n {attention.kind === 'error' ? 'recover from the owning session' : 'resume from the owning session'}\n </span>\n </div>\n );\n}\n\nfunction JobRow({\n job,\n now,\n selected,\n onSelect,\n}: {\n job: WorkflowJobView;\n now: number;\n selected: boolean;\n onSelect: () => void;\n}) {\n const icon = STATE_ICON[job.status];\n return (\n <OptionRow\n density=\"compact\"\n active={selected}\n data-testid={`job-row-${job.name}`}\n data-job-status={job.status}\n onClick={onSelect}\n className={cn('gap-2 rounded px-2 py-1.5', !selected && 'hover:bg-doom-deep')}\n >\n <span className={`w-3 shrink-0 text-xs ${icon.className}`}>{icon.glyph}</span>\n <OptionLabel density=\"compact\" className={cn('text-xs', selected ? 'text-doom-hi' : 'text-doom-text')}>\n {job.name}\n </OptionLabel>\n <span className=\"shrink-0 text-2xs text-doom-faint\">{spanDuration(job.startedAt, job.endedAt, now) ?? ''}</span>\n </OptionRow>\n );\n}\n\nfunction StepRow({\n step,\n now,\n selected,\n onSelect,\n}: {\n step: WorkflowStepView;\n now: number;\n selected: boolean;\n onSelect: () => void;\n}) {\n const icon = STATE_ICON[step.status];\n return (\n <button\n type=\"button\"\n data-testid={`step-row-${step.name}`}\n data-step-status={step.status}\n data-active={selected}\n onClick={onSelect}\n className={cn(\n 'flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left hover:bg-doom-deep',\n selected && 'bg-doom-tint-blue ring-1 ring-inset ring-doom-blue/40',\n )}\n >\n <span className=\"flex items-center gap-2\">\n <span className={`w-3 shrink-0 text-xs ${icon.className}`}>{icon.glyph}</span>\n <span\n className={cn(\n 'min-w-0 flex-1 truncate text-2xs',\n step.status === 'failed' ? 'text-doom-red' : 'text-doom-text',\n )}\n >\n {step.name}\n </span>\n <span className=\"shrink-0 text-2xs text-doom-faint\">\n {spanDuration(step.startedAt, step.endedAt, now) ?? ''}\n </span>\n </span>\n {step.reason === undefined ? null : (\n <span className={cn('truncate pl-5 text-2xs', step.status === 'failed' ? 'text-doom-red' : 'text-doom-faint')}>\n {step.reason}\n </span>\n )}\n </button>\n );\n}\n\nfunction ScreenLine({ line }: { line: string }) {\n // A blank row still has to hold the grid open, so an empty line keeps its\n // height rather than collapsing the screen by one row.\n if (line.length === 0) return <span className=\"block h-[15px]\" />;\n return <AnsiLine line={line} className=\"block whitespace-pre\" />;\n}\n\nfunction InlineStepOutput({\n run,\n job,\n step,\n sessionId,\n onOpenTerminal,\n}: {\n run: WorkflowRunView;\n job: WorkflowJobView;\n step: WorkflowStepView | undefined;\n sessionId: string | null;\n onOpenTerminal: () => void;\n}) {\n const [lines, setLines] = useState<string[]>([]);\n const [capabilities, setCapabilities] = useState<WorkflowTerminalCapabilitiesView>();\n const [ended, setEnded] = useState(false);\n const screenRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // Clearing the mirror of the previous run before subscribing to the new one; the\n // screen subscription below is the external system.\n // oxlint-disable-next-line react/set-state-in-effect\n setLines([]);\n setCapabilities(undefined);\n setEnded(false);\n return followScreen(\n run.workspace,\n run.runKey,\n (event) => {\n setLines(event.lines);\n setCapabilities(event.capabilities);\n if (event.ended === true) setEnded(true);\n },\n sessionId,\n );\n }, [run.workspace, run.runKey, sessionId]);\n\n useEffect(() => {\n screenRef.current?.scrollTo({ top: screenRef.current.scrollHeight });\n }, [lines]);\n\n return (\n <div data-testid=\"workflow-inline-output\" className=\"flex min-h-0 flex-1 flex-col bg-doom-deep\">\n <div className=\"flex h-9 shrink-0 items-center gap-2 border-b border-doom-border-soft px-3\">\n <Dot tone={ended ? 'neutral' : 'blue'} pulse={!ended && run.stage === 'running'} />\n <span className={cn('text-2xs font-bold', ended ? 'text-doom-faint' : 'text-doom-blue')}>\n {ended ? 'FINAL OUTPUT' : 'LIVE OUTPUT'}\n </span>\n <span className=\"min-w-0 truncate text-xs font-bold text-doom-hi\">{step?.name ?? job.name}</span>\n <span className=\"min-w-0 flex-1\" />\n <span className=\"text-2xs text-doom-faint\">{ended ? 'settled' : 'following · 500ms'}</span>\n <Button variant=\"outline\" size=\"xs\" data-testid=\"workflow-open-terminal\" onClick={onOpenTerminal}>\n open terminal\n </Button>\n </div>\n <div\n ref={screenRef}\n data-testid=\"workflow-inline-screen\"\n className=\"min-h-0 flex-1 overflow-y-auto px-4 py-3 font-mono text-sm leading-tight text-doom-text\"\n >\n {lines.length === 0 ? (\n <span className=\"text-xs text-doom-faint\">\n {capabilities?.readable === false\n ? (capabilities.reason ?? 'This run has no terminal to read.')\n : 'waiting for the run to paint…'}\n </span>\n ) : (\n lines.map((line, index) => <ScreenLine key={index} line={line} />)\n )}\n {!ended && run.stage === 'running' ? <StreamCursor className=\"mt-0.5 h-[12px] w-1.5\" /> : null}\n </div>\n <div className=\"flex h-7 shrink-0 items-center gap-2 border-t border-doom-border-soft px-3 text-2xs text-doom-faint\">\n <span>output follows automatically · select another step to inspect its current screen</span>\n <span className=\"min-w-0 flex-1\" />\n <span>last 48 lines</span>\n </div>\n </div>\n );\n}\n\nfunction DeleteWorkflowDialog({\n run,\n sessionId,\n onClose,\n onDeleted,\n}: {\n run: WorkflowRunView;\n sessionId: string;\n onClose: () => void;\n onDeleted: () => void;\n}) {\n const [deleting, setDeleting] = useState(false);\n const [error, setError] = useState<string>();\n\n const confirm = (): void => {\n setDeleting(true);\n setError(undefined);\n void deleteWorkflowRun(run.workspace, run.runKey, sessionId).then((result) => {\n if ('error' in result) {\n setDeleting(false);\n setError(result.error);\n return;\n }\n onDeleted();\n });\n };\n\n return (\n <Dialog\n open\n onOpenChange={(open) => {\n if (!open && !deleting) onClose();\n }}\n >\n <DialogContent width=\"md\" data-testid=\"delete-workflow-dialog\" aria-describedby={undefined}>\n <DialogHeader>\n <DialogTitle>Delete {run.displayName}?</DialogTitle>\n </DialogHeader>\n <DialogBody>\n <p className=\"text-sm leading-relaxed text-doom-dim\">\n This permanently removes the workflow run, including its logs and artifacts. This action cannot be undone.\n </p>\n {error === undefined ? null : (\n <p data-testid=\"delete-workflow-error\" className=\"text-xs text-doom-red\">\n {error}\n </p>\n )}\n <DialogFooter>\n <span className=\"min-w-0 flex-1\" />\n <Button\n variant=\"outline\"\n size=\"xs\"\n data-testid=\"delete-workflow-cancel\"\n disabled={deleting}\n onClick={onClose}\n >\n cancel\n </Button>\n <Button\n variant=\"danger\"\n size=\"xs\"\n data-testid=\"delete-workflow-confirm\"\n loading={deleting}\n loadingLabel=\"deleting workflow\"\n onClick={confirm}\n >\n delete permanently\n </Button>\n </DialogFooter>\n </DialogBody>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction DetailPane({ children }: { children: ReactNode }) {\n return (\n <div className=\"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-md border border-doom-border\">\n {children}\n </div>\n );\n}\n\n/** The canonical workflow surface: a scalable picker, compact step navigation, and one dominant detail pane. */\nexport function WorkflowsPanel({ sessionId, openTransientTab, sendSessionFrame }: WebPluginSlotProps) {\n const runs = useStore(workflows.store, (state) => workflows.select(state, sessionId).runs);\n const selectedRun = useStore(workflows.store, (state) => workflows.select(state, sessionId).focusedRun);\n const catalogState = useStore(catalog.store, (state) => catalog.select(state, sessionId));\n const [selectedJob, setSelectedJob] = useState<string | null>(null);\n const [selectedStep, setSelectedStep] = useState<string | null>(null);\n const [pane, setPane] = useState<'output' | 'artifacts'>('output');\n const [deletingRun, setDeletingRun] = useState<WorkflowRunView>();\n const [now, setNow] = useState(() => Date.now());\n\n useEffect(() => {\n const timer = setInterval(() => setNow(Date.now()), TICK_MS);\n return () => clearInterval(timer);\n }, []);\n\n const run = runs.find((candidate) => workflowRunIdentity(candidate) === selectedRun) ?? runs[0];\n const jobs = run?.jobs ?? [];\n const fallbackJob =\n run?.position?.job ?? jobs.find((candidate) => ACTIVE_STATES.has(candidate.status))?.name ?? jobs.at(-1)?.name;\n const job =\n jobs.find((candidate) => candidate.name === selectedJob) ??\n jobs.find((candidate) => candidate.name === fallbackJob);\n const fallbackStep =\n run?.position?.job === job?.name\n ? run?.position?.step\n : (job?.steps.find((candidate) => ACTIVE_STATES.has(candidate.status))?.name ?? job?.steps.at(-1)?.name);\n const step =\n job?.steps.find((candidate) => candidate.name === selectedStep) ??\n job?.steps.find((candidate) => candidate.name === fallbackStep);\n const launching = catalogState.workflows.find((workflow) => workflow.path === catalogState.launch);\n\n const selectRun = (candidate: WorkflowRunView): void => {\n if (sessionId !== null) focusRun(sessionId, workflowRunIdentity(candidate));\n setSelectedJob(null);\n setSelectedStep(null);\n setPane('output');\n };\n\n return (\n <div data-testid=\"workflows-panel\" className=\"flex min-h-0 flex-1\">\n <div className=\"flex min-w-0 flex-1 flex-col gap-3 overflow-hidden px-[18px] py-[14px]\">\n {run === undefined ? (\n <EmptyState\n data-testid=\"workflows-empty\"\n title=\"no workflow runs yet\"\n description=\"pick one from the catalog, or launch it from the session with SPC w l, and the run shows up here live.\"\n >\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-testid=\"workflows-open-catalog\"\n onClick={() => {\n if (sessionId !== null) openCatalog(sessionId);\n }}\n >\n launch workflow <Kbd>SPC w l</Kbd>\n </Button>\n </EmptyState>\n ) : (\n <>\n <div className=\"flex h-[46px] shrink-0 items-center gap-2 rounded-md border border-doom-border bg-doom-panel px-2.5\">\n <WorkflowPicker runs={runs} selected={run} onSelect={selectRun} />\n <StatusBadge tone={run.stage === 'error' ? 'error' : run.stage === 'running' ? 'info' : 'ok'}>\n {runState(run)}\n </StatusBadge>\n <span className=\"truncate text-2xs text-doom-dim\">\n {[run.position?.job, run.position?.step].filter(Boolean).join(' · ') ||\n run.workflowName ||\n run.displayName}\n </span>\n <span className=\"min-w-0 flex-1\" />\n <span data-testid=\"workflows-tally\" className=\"text-2xs text-doom-faint\">\n {runs.filter((candidate) => candidate.stage === 'running').length} running · {runs.length} total\n </span>\n {run.stage === 'running' ? null : (\n <Button\n variant=\"danger-outline\"\n size=\"xs\"\n data-testid=\"delete-workflow\"\n onClick={() => setDeletingRun(run)}\n >\n delete\n </Button>\n )}\n <Button\n variant=\"outline\"\n size=\"xs\"\n data-testid=\"workflows-open-catalog\"\n onClick={() => {\n if (sessionId !== null) openCatalog(sessionId);\n }}\n >\n launch\n </Button>\n </div>\n <SelectedAttention run={run} />\n <div className=\"flex min-h-0 flex-1 flex-col gap-3 sm:flex-row\">\n <div\n data-testid=\"jobs-pane\"\n className=\"flex max-h-44 w-full shrink-0 flex-col overflow-y-auto rounded-md border border-doom-border bg-doom-panel p-1.5 sm:max-h-none sm:w-[214px]\"\n >\n <div className=\"flex items-center px-2 pb-1 pt-1\">\n <span className=\"text-2xs font-bold tracking-wider text-doom-faint\">JOBS</span>\n <span className=\"min-w-0 flex-1\" />\n <span className=\"text-2xs text-doom-faint\">\n {jobs.filter((candidate) => candidate.status === 'completed').length}/{jobs.length}\n </span>\n </div>\n {jobs.length === 0 ? (\n <EmptyState className=\"py-4\" title=\"no progress recorded yet\" />\n ) : (\n jobs.map((candidate) => (\n <JobRow\n key={candidate.name}\n job={candidate}\n now={now}\n selected={job !== undefined && candidate.name === job.name}\n onSelect={() => {\n setSelectedJob(candidate.name);\n setSelectedStep(null);\n setPane('output');\n }}\n />\n ))\n )}\n {job === undefined ? null : (\n <>\n <div className=\"mx-1 my-1.5 border-t border-doom-border-soft\" />\n <div className=\"flex items-center px-2 pb-1\">\n <span\n data-testid=\"job-pane-name\"\n className=\"min-w-0 flex-1 truncate text-2xs font-bold text-doom-hi\"\n >\n {job.name}\n </span>\n <span className=\"text-2xs text-doom-faint\">\n {spanDuration(job.startedAt, job.endedAt, now) ?? ''}\n </span>\n </div>\n <div className=\"flex flex-col gap-0.5\">\n {job.steps.map((candidate) => (\n <StepRow\n key={candidate.name}\n step={candidate}\n now={now}\n selected={step !== undefined && candidate.name === step.name}\n onSelect={() => {\n setSelectedStep(candidate.name);\n setPane('output');\n }}\n />\n ))}\n </div>\n </>\n )}\n </div>\n <DetailPane>\n <div className=\"flex h-9 shrink-0 items-center gap-2 border-b border-doom-border-soft bg-doom-panel px-3\">\n <span className=\"min-w-0 truncate text-xs font-bold text-doom-hi\">\n {job?.name ?? run.displayName}\n </span>\n {job === undefined ? null : (\n <StatusBadge className={cn('bg-doom-deep', STATE_ICON[job.status].className)}>\n {job.status.replace('_', ' ')}\n </StatusBadge>\n )}\n <Button\n variant={pane === 'output' ? 'primary' : 'outline'}\n size=\"xs\"\n data-testid=\"pane-tab-output\"\n data-active={pane === 'output'}\n onClick={() => setPane('output')}\n >\n output\n </Button>\n <Button\n variant={pane === 'artifacts' ? 'primary' : 'outline'}\n size=\"xs\"\n data-testid=\"pane-tab-artifacts\"\n data-active={pane === 'artifacts'}\n onClick={() => setPane('artifacts')}\n >\n artifacts\n </Button>\n </div>\n {pane === 'artifacts' ? (\n <ArtifactsPane\n run={run}\n sessionId={sessionId}\n onOpen={(path) => openTransientTab(artifactTab(run, path))}\n />\n ) : job === undefined ? (\n <EmptyState className=\"py-6\" title=\"select a job to see its output\" />\n ) : (\n <InlineStepOutput\n run={run}\n job={job}\n step={step}\n sessionId={sessionId}\n onOpenTerminal={() => openTransientTab(stepTerminalTab(run, job.name, step?.name))}\n />\n )}\n </DetailPane>\n </div>\n </>\n )}\n </div>\n {sessionId !== null && catalogState.open ? (\n <WorkflowCatalogDrawer\n sessionId={sessionId}\n onClose={() => closeCatalog(sessionId)}\n onLaunch={(workflow) => openLaunch(sessionId, workflow.path)}\n />\n ) : null}\n {sessionId !== null && launching !== undefined ? (\n <LaunchWorkflowDialog\n sessionId={sessionId}\n workflow={launching}\n cwd={catalogState.cwd}\n initialPrompt={catalogState.prompt}\n send={sendSessionFrame}\n onClose={() => closeLaunch(sessionId)}\n onLaunched={() => {\n closeLaunch(sessionId);\n closeCatalog(sessionId);\n }}\n />\n ) : null}\n {sessionId !== null && deletingRun !== undefined ? (\n <DeleteWorkflowDialog\n run={deletingRun}\n sessionId={sessionId}\n onClose={() => setDeletingRun(undefined)}\n onDeleted={() => {\n removeRun(sessionId, workflowRunIdentity(deletingRun));\n setDeletingRun(undefined);\n }}\n />\n ) : null}\n </div>\n );\n}\n\n/** The temporary tab the workflow surface opens in; opening it again only focuses it. */\nexport function workflowsTab(): TransientTab {\n return { id: WORKFLOWS_TAB_ID, label: 'workflows', panel: WorkflowsPanel };\n}\n","import type { WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport { Button, ChevronDownIcon, ChevronRightIcon, Dot, type DotTone } from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { useEffect, useState } from 'react';\n\nimport { workflowsTab } from '../../_components/WorkflowsPanel';\nimport { openCatalog } from '../../_lib/catalogStore';\nimport {\n type WorkflowActivityGroupName,\n type WorkflowActivityRow,\n type WorkflowActivityTone,\n workflowActivityGroups,\n workflowActivityRows,\n} from '../../_lib/workflowActivity';\nimport { focusRun, workflows } from '../../_lib/workflowsStore';\n\nconst TICK_MS = 10_000;\n\nconst TONE_DOT: Readonly<Record<WorkflowActivityTone, DotTone>> = {\n running: 'yellow',\n paused: 'yellow',\n failed: 'red',\n done: 'green',\n skipped: 'muted',\n};\n\nconst TONE_DETAIL: Readonly<Record<WorkflowActivityTone, string>> = {\n running: 'text-doom-faint',\n paused: 'text-doom-yellow',\n failed: 'text-doom-red',\n done: 'text-doom-faint',\n skipped: 'text-doom-faint',\n};\n\nconst GROUP_LABEL: Readonly<Record<WorkflowActivityGroupName, string>> = {\n running: 'text-doom-yellow',\n failed: 'text-doom-red',\n successful: 'text-doom-green',\n};\n\n/**\n * The workflows group's body in the activity dock: every run this session\n * started, split into running, failed and successful.\n *\n * A session keeps its whole history, so the groups fold: failures open because\n * they are the only ones that need an answer, and the rest stay out of the way\n * until somebody asks. Idle offers the catalog instead of saying nothing.\n */\nexport function WorkflowsActivitySection({ sessionId, openTransientTab }: WebPluginSlotProps) {\n const runs = useStore(workflows.store, (state) => workflows.select(state, sessionId).runs);\n const [now, setNow] = useState(() => Date.now());\n const [folded, setFolded] = useState<Partial<Record<WorkflowActivityGroupName, boolean>>>({});\n\n useEffect(() => {\n const timer = setInterval(() => setNow(Date.now()), TICK_MS);\n return () => clearInterval(timer);\n }, []);\n\n const groups = workflowActivityGroups(workflowActivityRows(runs, now));\n if (groups.length === 0) {\n return (\n <div className=\"flex items-center gap-2 px-1\">\n <p data-testid=\"activity-summary-workflows\" className=\"text-xs text-doom-faint\">\n idle\n </p>\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid=\"activity-workflow-launch\"\n className=\"px-0\"\n onClick={() => {\n if (sessionId === null) return;\n openCatalog(sessionId);\n openTransientTab(workflowsTab());\n }}\n >\n launch a workflow\n </Button>\n </div>\n );\n }\n\n const RunRow = ({ row }: { row: WorkflowActivityRow }) => (\n <Button\n variant=\"ghost\"\n size=\"card\"\n data-testid={`activity-workflow-${row.runKey}`}\n data-run-tone={row.tone}\n title=\"open this run in the workflows tab\"\n onClick={() => {\n if (sessionId === null) return;\n focusRun(sessionId, row.identity);\n openTransientTab(workflowsTab());\n }}\n className=\"min-w-0 gap-0.5 rounded-md px-1 py-1 hover:bg-doom-panel\"\n >\n <span className=\"flex min-w-0 items-center gap-1.5\">\n <Dot tone={TONE_DOT[row.tone]} pulse={row.tone === 'running'} />\n <span\n className={`min-w-0 flex-1 truncate text-xs font-bold ${\n row.tone === 'running' || row.tone === 'paused' ? 'text-doom-hi' : 'text-doom-dim'\n }`}\n >\n {row.name}\n </span>\n <span className=\"shrink-0 text-2xs text-doom-faint\">{row.elapsed}</span>\n </span>\n <span className={`truncate pl-3 text-2xs ${TONE_DETAIL[row.tone]}`}>{row.detail}</span>\n </Button>\n );\n\n return (\n <div data-testid=\"activity-workflow-runs\" className=\"flex flex-col gap-0.5\">\n {groups.map((group) => {\n const open = folded[group.name] ?? group.openByDefault;\n return (\n <div key={group.name} className=\"flex flex-col gap-0.5\">\n <Button\n variant=\"ghost\"\n size=\"xs\"\n data-testid={`activity-workflow-group-${group.name}`}\n data-open={open}\n aria-expanded={open}\n onClick={() => setFolded((current) => ({ ...current, [group.name]: !open }))}\n className=\"justify-start gap-1.5 rounded-md px-1 py-0.5 hover:bg-doom-panel\"\n >\n {open ? (\n <ChevronDownIcon className=\"h-2.5 w-2.5 text-doom-faint\" />\n ) : (\n <ChevronRightIcon className=\"h-2.5 w-2.5 text-doom-faint\" />\n )}\n <span className={`text-xs font-bold ${GROUP_LABEL[group.name]}`}>{group.name}</span>\n <span className=\"text-2xs text-doom-faint\">{group.rows.length}</span>\n </Button>\n {open ? (\n <div className=\"flex flex-col gap-0.5 pl-2\">\n {group.rows.map((row) => (\n <RunRow key={row.identity} row={row} />\n ))}\n </div>\n ) : (\n <span className=\"truncate pl-5 text-2xs text-doom-faint\">\n {group.rows\n .slice(0, 2)\n .map((row) => row.name)\n .join(', ')}\n {group.rows.length > 2 ? `, and ${group.rows.length - 2} more` : ''}\n </span>\n )}\n </div>\n );\n })}\n </div>\n );\n}\n","import type { ToolResultView } from '@agimon-ai/doompi-core/web';\nimport type { MessageLine, MessageLineTone } from '@agimon-ai/doompi-web-components';\n\n/**\n * The cockpit half of src/tui/workflow/workflowToolRender.ts: the same\n * result shapes reduced to a list of toned lines, so the React cards stay a\n * thin mapping and the parsing is testable without a DOM. Kept in step with\n * the TUI by hand; the two share no code because web/ may not import src/tui.\n */\n\nexport type WorkflowToolName = 'launch_workflow' | 'list_workflows' | 'workflow_run';\n\n/** The toned lines the shared MessageLines draws; the vocabulary is the components package's. */\nexport type LineTone = MessageLineTone;\nexport type ToolLine = MessageLine;\n\nexport interface WorkflowCallSummary {\n action: string;\n target?: string;\n metadata: string[];\n}\n\nexport interface WorkflowRenderOptions {\n expanded: boolean;\n isError: boolean;\n isPartial: boolean;\n}\n\ntype JsonRecord = Record<string, unknown>;\n\ninterface WorkflowState {\n tone: LineTone;\n glyph: string;\n label: string;\n}\n\ninterface WorkflowCatalogItem {\n description: string;\n name: string;\n path: string;\n tags: string[];\n}\n\ninterface WorkflowCatalog {\n directory?: string;\n page: number;\n pageSize: number;\n tags: Array<{ count: number; tag: string }>;\n total: number;\n totalPages: number;\n workflows: WorkflowCatalogItem[];\n}\n\ninterface EvidenceSection {\n body: string[];\n name: string;\n}\n\nconst COLLAPSED_CATALOG_ROWS = 6;\nconst COLLAPSED_DETAIL_LINES = 8;\nconst PARTIAL_DETAIL_LINES = 4;\n\nexport const WORKFLOW_TOOL_NAMES: readonly WorkflowToolName[] = ['list_workflows', 'launch_workflow', 'workflow_run'];\n\nfunction asRecord(value: unknown): JsonRecord | undefined {\n if (!value || typeof value !== 'object' || Array.isArray(value)) return undefined;\n return value as JsonRecord;\n}\n\nfunction inlineText(value: string): string {\n let normalized = '';\n for (const character of value) {\n const code = character.codePointAt(0) ?? 0;\n normalized += code <= 31 || code === 127 ? ' ' : character;\n }\n return normalized.replace(/\\s+/gu, ' ').trim();\n}\n\nfunction readString(record: JsonRecord | undefined, key: string): string | undefined {\n const value = record?.[key];\n if (typeof value !== 'string') return undefined;\n return inlineText(value) || undefined;\n}\n\nfunction readNumber(record: JsonRecord | undefined, key: string): number | undefined {\n const value = record?.[key];\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n}\n\nfunction readBoolean(record: JsonRecord | undefined, key: string): boolean | undefined {\n const value = record?.[key];\n return typeof value === 'boolean' ? value : undefined;\n}\n\nfunction readStringArray(record: JsonRecord | undefined, key: string): string[] {\n const value = record?.[key];\n if (!Array.isArray(value)) return [];\n return value.filter((item): item is string => typeof item === 'string');\n}\n\nfunction parseJsonRecord(text: string | undefined): JsonRecord | undefined {\n if (!text) return undefined;\n try {\n return asRecord(JSON.parse(text));\n } catch {\n // Not every workflow result is JSON; the plain-text shapes fall through.\n return undefined;\n }\n}\n\nfunction textBlocks(result: ToolResultView | null): string[] {\n if (!result) return [];\n return result.content.flatMap((item) => {\n const record = asRecord(item);\n return record?.type === 'text' && typeof record.text === 'string' ? [record.text] : [];\n });\n}\n\nfunction detailLines(result: ToolResultView | null): string[] {\n return textBlocks(result)\n .flatMap((block) => block.split('\\n'))\n .map((entry) => entry.trimEnd())\n .filter((entry) => entry.length > 0);\n}\n\nfunction firstPayload(result: ToolResultView | null): JsonRecord | undefined {\n return parseJsonRecord(textBlocks(result)[0]);\n}\n\nfunction plural(count: number, singular: string, pluralForm = `${singular}s`): string {\n return count === 1 ? singular : pluralForm;\n}\n\nfunction line(text: string, tone: LineTone, extra: Omit<ToolLine, 'text' | 'tone'> = {}): ToolLine {\n return { text, tone, ...extra };\n}\n\nfunction labelValue(label: string, value: string): ToolLine {\n return line(`${label} ${value}`, 'text');\n}\n\nfunction hiddenLine(hidden: number): ToolLine {\n return line(`… ${hidden} more`, 'dim');\n}\n\nfunction targetScope(args: JsonRecord): string | undefined {\n const runKey = readString(args, 'runKey');\n if (!runKey) return undefined;\n const workspace = readString(args, 'workspace');\n return workspace ? `${workspace}/${runKey}` : runKey;\n}\n\nfunction toolAction(toolName: WorkflowToolName, args: JsonRecord): string {\n if (toolName === 'list_workflows') return 'list';\n if (toolName === 'launch_workflow') return 'launch';\n return readString(args, 'action') ?? 'run';\n}\n\nfunction toolTarget(toolName: WorkflowToolName, args: JsonRecord): string | undefined {\n if (toolName === 'list_workflows') return readString(args, 'directory');\n if (toolName === 'launch_workflow') return readString(args, 'workflowPath');\n return targetScope(args);\n}\n\nfunction statusTimestamp(value: string): string {\n return value.replace('T', ' ').replace(/\\.\\d{3}Z$/, 'Z');\n}\n\nfunction workflowNameFromPath(path: string | undefined): string {\n if (!path) return 'workflow';\n const filename = path.split('/').at(-1) ?? path;\n return filename.replace(/\\.workflow\\.ya?ml$/u, '') || filename;\n}\n\nfunction callMetadata(toolName: WorkflowToolName, args: JsonRecord): string[] {\n const values: string[] = [];\n\n if (toolName === 'list_workflows') {\n const page = readNumber(args, 'page');\n const pageSize = readNumber(args, 'pageSize');\n if (page !== undefined) values.push(`page ${page}`);\n if (pageSize !== undefined) values.push(`${pageSize}/page`);\n if (readString(args, 'filter')) values.push('filtered');\n const tags = readStringArray(args, 'tags');\n if (tags.length > 0) values.push(`${tags.length} ${plural(tags.length, 'tag')}`);\n } else if (toolName === 'launch_workflow') {\n const job = readString(args, 'job');\n const runner = readString(args, 'runner');\n const workspace = readString(args, 'workspace');\n const inputCount = Object.keys(asRecord(args.inputs) ?? {}).length;\n const environmentCount = Object.keys(asRecord(args.env) ?? {}).length;\n if (workspace) values.push(`workspace ${workspace}`);\n if (job) values.push(`job ${job}`);\n if (runner) values.push(`runner ${runner}`);\n if (readBoolean(args, 'dryRun')) values.push('dry run');\n if (readString(args, 'prompt')) values.push('with prompt');\n if (inputCount > 0) values.push(`${inputCount} ${plural(inputCount, 'input')}`);\n if (environmentCount > 0) values.push(`${environmentCount} env`);\n } else {\n if (readString(args, 'expectedRunId')) values.push('generation checked');\n if (readString(args, 'reason')) values.push('with reason');\n if (readBoolean(args, 'dryRun')) values.push('dry run');\n if (readString(args, 'job')) values.push('job override');\n if (readString(args, 'runner')) values.push('runner override');\n }\n\n return values;\n}\n\n/** The header beside the tool name: action, target, and the call's flags. */\nexport function workflowCallSummary(toolName: WorkflowToolName, args: JsonRecord): WorkflowCallSummary {\n const target = toolTarget(toolName, args);\n return {\n action: toolAction(toolName, args),\n ...(target === undefined ? {} : { target }),\n metadata: callMetadata(toolName, args),\n };\n}\n\nfunction parseCatalog(payload: JsonRecord | undefined): WorkflowCatalog | undefined {\n if (!Array.isArray(payload?.workflows)) return undefined;\n\n const workflows = payload.workflows.flatMap((value) => {\n const record = asRecord(value);\n const path = readString(record, 'path');\n if (!record || !path) return [];\n return [\n {\n description: readString(record, 'description') ?? '',\n name: readString(record, 'name') ?? '',\n path,\n tags: readStringArray(record, 'tags'),\n },\n ];\n });\n const tags = Array.isArray(payload.tags)\n ? payload.tags.flatMap((value) => {\n const record = asRecord(value);\n const tag = readString(record, 'tag');\n const count = readNumber(record, 'count');\n return tag && count !== undefined ? [{ count, tag }] : [];\n })\n : [];\n\n const directory = readString(payload, 'directory');\n return {\n ...(directory === undefined ? {} : { directory }),\n page: readNumber(payload, 'page') ?? 1,\n pageSize: readNumber(payload, 'pageSize') ?? workflows.length,\n tags,\n total: readNumber(payload, 'total') ?? workflows.length,\n totalPages: readNumber(payload, 'totalPages') ?? (workflows.length > 0 ? 1 : 0),\n workflows,\n };\n}\n\nfunction catalogItemLines(item: WorkflowCatalogItem, expanded: boolean): ToolLine[] {\n const name = item.name || workflowNameFromPath(item.path);\n const lines = [line(`› ${name} · ${item.path}`, 'text')];\n if (!expanded) return lines;\n if (item.description) lines.push(line(item.description, 'muted', { indent: true }));\n if (item.tags.length > 0) lines.push(line(`tags ${item.tags.join(', ')}`, 'dim', { indent: true }));\n return lines;\n}\n\nfunction catalogLines(result: ToolResultView | null, options: WorkflowRenderOptions): ToolLine[] | undefined {\n const catalog = parseCatalog(firstPayload(result));\n if (!catalog) return undefined;\n\n const pageLabel = `page ${catalog.page}/${catalog.totalPages}`;\n const glyph = catalog.total > 0 ? '✓' : '○';\n const summary = line(`${glyph} ${catalog.total} ${plural(catalog.total, 'workflow')} · ${pageLabel}`, 'hi', {\n bold: true,\n });\n const shown = options.expanded ? catalog.workflows : catalog.workflows.slice(0, COLLAPSED_CATALOG_ROWS);\n const lines = [summary, ...shown.flatMap((item) => catalogItemLines(item, options.expanded))];\n const hidden = catalog.workflows.length - shown.length;\n if (hidden > 0) lines.push(hiddenLine(hidden));\n\n if (options.expanded) {\n if (catalog.tags.length > 0) {\n const tags = catalog.tags.map(({ count, tag }) => `${tag} (${count})`).join(', ');\n lines.push(labelValue('available tags', tags));\n }\n if (catalog.directory) lines.push(labelValue('directory', catalog.directory));\n lines.push(labelValue('page size', String(catalog.pageSize)));\n }\n return lines;\n}\n\nfunction readWorkflowState(record: JsonRecord): WorkflowState {\n const stage = readString(record, 'effectiveStage') ?? readString(record, 'stage') ?? 'unknown';\n const outcome = readString(record, 'effectiveOutcome') ?? readString(record, 'outcome');\n const executionState = readString(record, 'executionState');\n\n if (outcome === 'interrupted') return { tone: 'warning', glyph: '!', label: 'interrupted' };\n if (stage === 'error' || outcome === 'failed') return { tone: 'error', glyph: '✗', label: 'failed' };\n if (stage === 'completed' && outcome === 'skipped') return { tone: 'muted', glyph: '○', label: 'skipped' };\n if (stage === 'completed') return { tone: 'success', glyph: '✓', label: 'completed' };\n if (executionState === 'paused') return { tone: 'warning', glyph: 'Ⅱ', label: 'paused' };\n if (executionState === 'pause_requested') return { tone: 'warning', glyph: '◐', label: 'pause requested' };\n if (executionState === 'resume_requested') return { tone: 'warning', glyph: '◐', label: 'resume requested' };\n if (stage === 'running') return { tone: 'accent', glyph: '◐', label: 'running' };\n return { tone: 'muted', glyph: '○', label: stage };\n}\n\nfunction recordScope(record: JsonRecord): string {\n const runKey = readString(record, 'runKey') ?? 'unknown run';\n const workspace = readString(record, 'workspace');\n return workspace ? `${workspace}/${runKey}` : runKey;\n}\n\nfunction currentActivity(record: JsonRecord): ToolLine | undefined {\n const cursor = asRecord(record.executionCursor);\n const job = readString(cursor, 'job') ?? readString(record, 'job');\n const step = readString(cursor, 'stepName');\n const phase = readString(cursor, 'phase');\n if (!job && !step && !phase) return undefined;\n const context = job ?? phase ?? 'workflow';\n return line(`[${context}] ${step ?? phase ?? 'running'}`, 'text', { indent: true });\n}\n\nfunction launcherLabel(record: JsonRecord): string | undefined {\n const launcher = asRecord(record.launcher);\n const type = readString(launcher, 'type');\n if (!type) return undefined;\n const identity = readString(launcher, 'sessionName') ?? readString(launcher, 'workspaceId');\n return identity ? `${type} ${identity}` : type;\n}\n\nfunction workflowRecordLines(record: JsonRecord, expanded: boolean): ToolLine[] | undefined {\n const runKey = readString(record, 'runKey');\n const stage = readString(record, 'stage');\n if (!runKey || !stage) return undefined;\n\n const state = readWorkflowState(record);\n const displayName = readString(record, 'displayName') ?? runKey;\n const lines = [\n line(`${state.glyph} ${displayName} · ${recordScope(record)} · ${state.label}`, state.tone, { bold: true }),\n ];\n const activity = currentActivity(record);\n if (activity) lines.push(activity);\n\n const failure = readString(record, 'errorMessage') ?? readString(record, 'failureReason');\n if (failure) lines.push(line(`error ${failure}`, 'error'));\n const staleReason = readString(record, 'staleReason');\n if (staleReason) lines.push(line(`stale ${staleReason}`, 'warning'));\n\n const startedAt = readString(record, 'startedAt');\n const exitCode = readNumber(record, 'exitCode');\n const conciseMetadata = [\n readString(record, 'runner') ? `runner ${readString(record, 'runner')}` : undefined,\n readBoolean(record, 'dryRun') ? 'dry run' : undefined,\n exitCode !== undefined ? `exit ${exitCode}` : undefined,\n startedAt ? `started ${statusTimestamp(startedAt)}` : undefined,\n ].filter((value): value is string => !!value);\n if (conciseMetadata.length > 0) lines.push(line(conciseMetadata.join(' · '), 'dim'));\n\n if (!expanded) return lines;\n\n const finishedAt = readString(record, 'finishedAt');\n const repairId = readString(record, 'activeRepairId');\n const detailedValues: Array<[string, string | undefined]> = [\n ['workflow', readString(record, 'workflowPath')],\n ['workflow id', readString(record, 'workflowId')],\n ['run id', readString(record, 'runId')],\n ['launcher', launcherLabel(record)],\n ['job', readString(record, 'job')],\n ['outcome', readString(record, 'effectiveOutcome') ?? readString(record, 'outcome')],\n ['finished', finishedAt ? statusTimestamp(finishedAt) : undefined],\n ['pid', readNumber(record, 'pid')?.toString()],\n ['repair', repairId ? `#${repairId}` : undefined],\n ['worktree', readString(record, 'worktreeBranch') ?? readString(record, 'worktreePath')],\n ];\n for (const [label, value] of detailedValues) {\n if (value) lines.push(labelValue(label, value));\n }\n return lines;\n}\n\nfunction statusLines(result: ToolResultView | null, options: WorkflowRenderOptions): ToolLine[] | undefined {\n const payload = firstPayload(result);\n if (!payload) return undefined;\n return workflowRecordLines(payload, options.expanded);\n}\n\nfunction nestedRequestedAt(payload: JsonRecord | undefined): string | undefined {\n return readString(asRecord(payload?.request), 'requestedAt') ?? readString(payload, 'requestedAt');\n}\n\nfunction controlLines(\n action: string,\n args: JsonRecord,\n result: ToolResultView | null,\n options: WorkflowRenderOptions,\n): ToolLine[] {\n const payload = firstPayload(result);\n const scope = targetScope(args) ?? readString(payload, 'runKey') ?? 'workflow';\n const payloadWorkspace = readString(payload, 'workspace');\n const resolvedScope = payloadWorkspace && !scope.includes('/') ? `${payloadWorkspace}/${scope}` : scope;\n const lines = [line(`◐ ${action} requested · ${resolvedScope}`, 'warning', { bold: true })];\n const requestedAt = nestedRequestedAt(payload);\n if (requestedAt) lines.push(labelValue('requested', statusTimestamp(requestedAt)));\n if (options.expanded) lines.push(line('verify the transition with workflow_run status', 'dim'));\n return lines;\n}\n\nfunction matchLine(text: string, pattern: RegExp): string | undefined {\n return text.match(pattern)?.[1]?.trim();\n}\n\nfunction launchSummary(text: string, args: JsonRecord): { name: string; scope: string; state: WorkflowState } {\n const startedName = matchLine(text, /^Started (.+) in workspace .+\\.$/mu);\n const workspace = matchLine(text, /^Started .+ in workspace (.+)\\.$/mu) ?? readString(args, 'workspace');\n const runKey = matchLine(text, /^Run key:\\s*(.+)$/mu);\n const path = readString(args, 'workflowPath');\n const name = startedName ?? workflowNameFromPath(path);\n const scope = runKey ? (workspace ? `${workspace}/${runKey}` : runKey) : (workspace ?? path ?? 'workflow');\n\n if (/Workflow completed successfully/iu.test(text)) {\n return { name, scope, state: { tone: 'success', glyph: '✓', label: 'completed' } };\n }\n if (/Workflow skipped/iu.test(text)) {\n return { name, scope, state: { tone: 'muted', glyph: '○', label: 'skipped' } };\n }\n if (/no run was registered/iu.test(text)) {\n return { name, scope, state: { tone: 'warning', glyph: '◐', label: 'starting · run key pending' } };\n }\n return { name, scope, state: { tone: 'accent', glyph: '◐', label: runKey ? 'started' : 'launch accepted' } };\n}\n\nfunction launchLines(args: JsonRecord, result: ToolResultView | null, options: WorkflowRenderOptions): ToolLine[] {\n const text = textBlocks(result).join('\\n');\n const summary = launchSummary(text, args);\n const lines = [\n line(`${summary.state.glyph} ${summary.name} · ${summary.scope} · ${summary.state.label}`, summary.state.tone, {\n bold: true,\n }),\n ];\n const metadata = [\n readString(args, 'job') ? `job ${readString(args, 'job')}` : undefined,\n readString(args, 'runner') ? `runner ${readString(args, 'runner')}` : undefined,\n readBoolean(args, 'dryRun') ? 'dry run' : undefined,\n ].filter((value): value is string => !!value);\n if (metadata.length > 0) lines.push(line(metadata.join(' · '), 'dim'));\n if (options.expanded) {\n const details = detailLines(result).filter((entry) => !entry.startsWith('Next steps for the agent:'));\n lines.push(...details.map((entry) => line(entry, 'text')));\n }\n return lines;\n}\n\nfunction splitEvidence(text: string): EvidenceSection[] {\n const sections: EvidenceSection[] = [];\n let current: EvidenceSection | undefined;\n for (const entry of text.split('\\n')) {\n const match = entry.match(/^--- (.+) ---$/u);\n if (match?.[1]) {\n current = { body: [], name: match[1] };\n sections.push(current);\n continue;\n }\n current?.body.push(entry);\n }\n return sections;\n}\n\nfunction recoveryEvidenceLines(\n args: JsonRecord,\n result: ToolResultView | null,\n options: WorkflowRenderOptions,\n): ToolLine[] {\n const sections = splitEvidence(textBlocks(result).join('\\n'));\n const runSection = sections.find((section) => section.name === 'run.json');\n const record = parseJsonRecord(runSection?.body.join('\\n'));\n const recordLines = record ? workflowRecordLines(record, options.expanded) : undefined;\n const evidenceSections = sections.filter((section) => section.name !== 'run.json');\n const scope = targetScope(args) ?? 'workflow';\n const lines = recordLines ?? [line(`✓ recovery evidence · ${scope}`, 'success', { bold: true })];\n const names = evidenceSections.map((section) => section.name);\n lines.push(\n names.length > 0 ? labelValue('evidence', names.join(', ')) : line('no durable evidence files recorded', 'muted'),\n );\n if (options.expanded) {\n for (const section of evidenceSections) {\n lines.push(line(section.name, 'hi', { bold: true }));\n lines.push(...section.body.filter((entry) => entry.length > 0).map((entry) => line(entry, 'text')));\n }\n }\n return lines;\n}\n\nfunction simpleActionLines(\n action: string,\n args: JsonRecord,\n result: ToolResultView | null,\n options: WorkflowRenderOptions,\n): ToolLine[] {\n const scope = targetScope(args) ?? 'workflow';\n const actionLabel: Record<string, string> = {\n follow: 'following output',\n open: 'launcher opened',\n recover: readBoolean(args, 'dryRun') ? 'recovery dry run finished' : 'recovery accepted',\n tail: 'launcher output checked',\n };\n const state: WorkflowState =\n action === 'recover'\n ? { tone: 'accent', glyph: '◐', label: actionLabel[action] ?? action }\n : { tone: 'success', glyph: '✓', label: actionLabel[action] ?? action };\n const lines = [line(`${state.glyph} ${state.label} · ${scope}`, state.tone, { bold: true })];\n const details = detailLines(result);\n if (action === 'tail') {\n const workflowLine = details.find((entry) => entry.startsWith('Workflow:'));\n const stageLine = details.find((entry) => entry.startsWith('Stage:'));\n if (workflowLine) lines.push(line(workflowLine, 'text'));\n if (stageLine) lines.push(line(stageLine, 'text'));\n }\n if (options.expanded) lines.push(...details.map((entry) => line(entry, 'text')));\n return lines;\n}\n\nfunction failureLines(\n toolName: WorkflowToolName,\n args: JsonRecord,\n result: ToolResultView | null,\n options: WorkflowRenderOptions,\n): ToolLine[] {\n const action = toolAction(toolName, args);\n const target = toolTarget(toolName, args);\n const details = detailLines(result);\n const shown = options.expanded ? details : details.slice(0, COLLAPSED_DETAIL_LINES);\n const lines = [\n line(`✗ ${action} failed${target ? ` · ${target}` : ''}`, 'error', { bold: true }),\n ...(shown.length > 0 ? shown.map((entry) => line(entry, 'text')) : [line('Unknown workflow error', 'error')]),\n ];\n const hidden = details.length - shown.length;\n if (hidden > 0) lines.push(hiddenLine(hidden));\n return lines;\n}\n\nfunction partialLines(toolName: WorkflowToolName, args: JsonRecord, result: ToolResultView | null): ToolLine[] {\n const details = detailLines(result);\n const shown = details.slice(-PARTIAL_DETAIL_LINES);\n const action = toolAction(toolName, args);\n const target = toolTarget(toolName, args);\n const hidden = details.length - shown.length;\n const lines = [line(`◐ ${action}${target ? ` · ${target}` : ''}`, 'accent', { bold: true })];\n if (hidden > 0) lines.push(line(`… ${hidden} earlier`, 'dim'));\n lines.push(...shown.map((entry) => line(entry, 'text')));\n return lines;\n}\n\nfunction fallbackLines(result: ToolResultView | null, options: WorkflowRenderOptions): ToolLine[] {\n const details = detailLines(result);\n if (details.length === 0) return [line('No workflow output.', 'muted')];\n const shown = options.expanded ? details : details.slice(0, COLLAPSED_DETAIL_LINES);\n const lines = shown.map((entry) => line(entry, 'text'));\n const hidden = details.length - shown.length;\n if (hidden > 0) lines.push(hiddenLine(hidden));\n return lines;\n}\n\n/** The body of a workflow tool card, chosen by tool, action, and result shape. */\nexport function workflowResultLines(\n toolName: WorkflowToolName,\n args: JsonRecord,\n result: ToolResultView | null,\n options: WorkflowRenderOptions,\n): ToolLine[] {\n if (options.isPartial) return partialLines(toolName, args, result);\n if (options.isError) return failureLines(toolName, args, result, options);\n\n if (toolName === 'list_workflows') return catalogLines(result, options) ?? fallbackLines(result, options);\n if (toolName === 'launch_workflow') return launchLines(args, result, options);\n\n const action = readString(args, 'action');\n if (action === 'status') return statusLines(result, options) ?? fallbackLines(result, options);\n if (action === 'pause' || action === 'resume' || action === 'stop')\n return controlLines(action, args, result, options);\n if (action === 'recovery-evidence') return recoveryEvidenceLines(args, result, options);\n if (action === 'follow' || action === 'open' || action === 'recover' || action === 'tail') {\n return simpleActionLines(action, args, result, options);\n }\n return fallbackLines(result, options);\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/doompi-core/web';\nimport {\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageLines,\n toolTone,\n} from '@agimon-ai/doompi-web-components';\n\nimport {\n type WorkflowToolName,\n WORKFLOW_TOOL_NAMES,\n workflowCallSummary,\n workflowResultLines,\n} from '../_lib/workflowToolRender';\n\nfunction workflowToolName(name: string): WorkflowToolName {\n return WORKFLOW_TOOL_NAMES.includes(name as WorkflowToolName) ? (name as WorkflowToolName) : 'workflow_run';\n}\n\n/**\n * The workflow tools' timeline item, the web analog of renderWorkflowToolCall\n * and renderWorkflowToolResult: `action · target · flags` in the header and\n * the shape-specific summary lines in the body.\n */\nexport function WorkflowToolMessage({ toolName, args, result, running, isError }: ToolMessageRenderProps) {\n const name = workflowToolName(toolName);\n const summary = workflowCallSummary(name, args);\n const collapsed = workflowResultLines(name, args, result, { expanded: false, isError, isPartial: running });\n const full = workflowResultLines(name, args, result, { expanded: true, isError, isPartial: running });\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable={full.length > collapsed.length}>\n {({ expanded }) => (\n <>\n <MessageItemHeader title={toolName}>\n <span data-testid={`tool-call-${toolName}`} className=\"flex min-w-0 flex-1 items-center gap-2\">\n <span className=\"font-bold text-doom-hi\">{summary.action}</span>\n {summary.target ? <span className=\"min-w-0 truncate text-doom-faint\">{summary.target}</span> : null}\n {summary.metadata.map((value) => (\n <span key={value} className=\"shrink-0 text-doom-dim\">\n · {value}\n </span>\n ))}\n </span>\n </MessageItemHeader>\n {(expanded ? full : collapsed).length > 0 ? (\n <MessageItemBody data-testid={`tool-result-${toolName}`}>\n <MessageLines lines={expanded ? full : collapsed} />\n </MessageItemBody>\n ) : null}\n </>\n )}\n </MessageItem>\n );\n}\n","import type { WebPluginDefinition } from '@agimon-ai/doompi-core/web';\n\nimport { workflowsTab } from '../_components/WorkflowsPanel';\nimport { WorkflowsActivitySection } from '../fill/_components/WorkflowsActivitySection';\nimport { WorkflowToolMessage } from '../tool/_components/WorkflowToolMessage';\nimport { openCatalog, openWorkflowCatalogForContext, workflowCatalogChannel } from './catalogStore';\nimport { workflowRunsChannel, workflows } from './workflowsStore';\nconst WORKFLOWS_GROUP = { key: 'w', label: 'workflows', detail: 'multi-step agent runs' };\nconst workflowActivitySource = {\n subscribe(listener: () => void) {\n const subscription = workflows.store.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n isActive(sessionId: string | null) {\n return workflows.select(workflows.store.state, sessionId).runs.some((run) => run.stage === 'running');\n },\n};\n\nexport default {\n // No declared tab: the runs surface is a panel the reader opens from the\n // dock's workflows group, and closes when they are done with it.\n channels: [workflowRunsChannel, workflowCatalogChannel],\n contextActions: [\n {\n id: 'launch-workflow',\n label: 'Launch Workflow',\n detail: 'Choose a workflow, review its inputs, then launch it.',\n kinds: ['work-item'],\n order: 20,\n run: (context) => openWorkflowCatalogForContext(context, workflowsTab),\n },\n ],\n minorModes: [{ name: 'workflow', keys: 'w e', widgetKey: 'workflow-mcp-progress', order: 50 }],\n activityGroups: [\n {\n name: 'workflows',\n keys: 'w r',\n widgetKeys: ['workflow-mcp-progress', 'workflow-mcp-follow'],\n activeSource: workflowActivitySource,\n transientTab: workflowsTab,\n order: 30,\n },\n ],\n // Same name as the group: the dock renders this inside it, in place of the\n // widget's bare presence signal.\n activitySections: [{ id: 'workflows', component: WorkflowsActivitySection }],\n // The workflow tools' timeline cards, the web half of src/tui/workflow/workflowToolRender.ts.\n toolRenderers: [{ tools: ['list_workflows', 'launch_workflow', 'workflow_run'], message: WorkflowToolMessage }],\n // The TUI's SPC w r, w l and w e; recovery (w c) is a TUI-only overlay, so\n // it has no cockpit key yet.\n leaderBindings: [\n {\n id: 'doom-workflow.manage',\n path: [WORKFLOWS_GROUP, { key: 'r', label: 'runs', detail: 'runs in this session' }],\n run: (context) => context.openTransientTab(workflowsTab()),\n },\n {\n id: 'doom-workflow.catalog',\n path: [WORKFLOWS_GROUP, { key: 'l', label: 'launch', detail: 'pick a workflow and launch it' }],\n run: (context) => {\n if (context.sessionId !== null) openCatalog(context.sessionId);\n context.openTransientTab(workflowsTab());\n },\n },\n {\n id: 'doom-workflow.toggle',\n path: [WORKFLOWS_GROUP, { key: 'e', label: 'toggle', detail: 'give the agent workflow tools or take them back' }],\n command: 'minor workflow',\n },\n ],\n} satisfies NonNullable<WebPluginDefinition['session']>;\n","import { defineContextAction } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../_lib';\n\nexport default defineContextAction(legacy.contextActions![0]!);\n","import { defineActivityGroup } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../_lib';\n\nexport default defineActivityGroup(legacy.activityGroups![0]!);\n","import { defineChannelFile } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../_lib';\n\nexport default defineChannelFile(legacy.channels![1]!);\n","import { defineChannelFile } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../_lib';\n\nexport default defineChannelFile(legacy.channels![0]!);\n","import { defineFill } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../_lib';\n\nexport default defineFill({ slot: 'activity.workflows', ...legacy.activitySections![0]! });\n","import { defineLeaderBinding } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../_lib';\n\nexport default defineLeaderBinding(legacy.leaderBindings![1]!);\n","import { defineLeaderBinding } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../_lib';\n\nexport default defineLeaderBinding(legacy.leaderBindings![0]!);\n","import { defineLeaderBinding } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../_lib';\n\nexport default defineLeaderBinding(legacy.leaderBindings![2]!);\n","import { defineMinorModeFile } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../../_lib';\n\nexport default defineMinorModeFile(legacy.minorModes![0]!);\n","import { defineToolRenderer } from '@agimon-ai/doompi-core/web';\n\nimport legacy from '../_lib';\n\nexport default defineToolRenderer(legacy.toolRenderers![0]!);\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineWebPlugin, type WebPluginContributions } from '@agimon-ai/doompi-core/web';\n\nimport actionLaunchWorkflow from '../src/extensions/workspaces/sessions/(frontend)/action/launch-workflow.web';\nimport activityGroupWorkflows from '../src/extensions/workspaces/sessions/(frontend)/activity-group/workflows.web';\nimport channelWorkflowCatalog from '../src/extensions/workspaces/sessions/(frontend)/channel/workflow-catalog.web';\nimport channelWorkflowRuns from '../src/extensions/workspaces/sessions/(frontend)/channel/workflow-runs.web';\nimport fillWorkflows from '../src/extensions/workspaces/sessions/(frontend)/fill/Workflows.activity.workflows.web';\nimport leaderCatalog from '../src/extensions/workspaces/sessions/(frontend)/leader/catalog.web';\nimport leaderManage from '../src/extensions/workspaces/sessions/(frontend)/leader/manage.web';\nimport leaderToggle from '../src/extensions/workspaces/sessions/(frontend)/leader/toggle.web';\nimport modeWorkflow from '../src/extensions/workspaces/sessions/(frontend)/mode/workflow/mode.web';\nimport toolWorkflow from '../src/extensions/workspaces/sessions/(frontend)/tool/workflow.web';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T => ({ ...identity, ...(value as object) }) as T;\n\nexport const webPlugin = defineWebPlugin({\n id: 'workflows',\n session: {\n get activityGroups(): WebPluginContributions['activityGroups'] { return [via({ name: 'workflows' }, activityGroupWorkflows)]; },\n get channels(): WebPluginContributions['channels'] { return [via({ channel: 'workflow_catalog' }, channelWorkflowCatalog), via({ channel: 'workflow_runs' }, channelWorkflowRuns)]; },\n get contextActions(): WebPluginContributions['contextActions'] { return [via({ id: 'launch-workflow' }, actionLaunchWorkflow)]; },\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'activity.workflows', id: 'workflows' }, fillWorkflows)]; },\n get leaderBindings(): WebPluginContributions['leaderBindings'] { return [via({ id: 'workflows.catalog' }, leaderCatalog), via({ id: 'workflows.manage' }, leaderManage), via({ id: 'workflows.toggle' }, leaderToggle)]; },\n get minorModes(): WebPluginContributions['minorModes'] { return [via({ name: 'workflow' }, modeWorkflow)]; },\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['workflow'] }, toolWorkflow)]; },\n },\n});\n"],"mappings":";;;;;;;AA8FA,MAAa,qBAAqB;AAuDlC,MAAa,wBAAwB;;;AC3HrC,MAAa,UAAU,mBAAmC;CACxD,KAAK;CACL,WAAW,CAAC;CACZ,SAAS,KAAA;CACT,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,UAAU,KAAA;CACV,WAAW,KAAA;CACX,QAAQ,KAAA;AACV,CAAC;AAED,SAASA,WAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAA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CAAC,UAAU,EAAE,GAAGC,oBAAY,CAAC;EAAG;CACtH;AACF,CAAC"}
package/dist/index.cjs ADDED
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_index = require("./src/services/workflowLaunchCommand/index.cjs");
3
+ exports.parseWorkflowLaunchCommand = require_index.parseWorkflowLaunchCommand;
4
+ exports.validateWorkflowLaunch = require_index.validateWorkflowLaunch;
@@ -0,0 +1,2 @@
1
+ import { parseWorkflowLaunchCommand, validateWorkflowLaunch } from "./src/services/workflowLaunchCommand/index.cjs";
2
+ export { parseWorkflowLaunchCommand, validateWorkflowLaunch };
@@ -0,0 +1,2 @@
1
+ import { parseWorkflowLaunchCommand, validateWorkflowLaunch } from "./src/services/workflowLaunchCommand/index.mjs";
2
+ export { parseWorkflowLaunchCommand, validateWorkflowLaunch };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { parseWorkflowLaunchCommand, validateWorkflowLaunch } from "./src/services/workflowLaunchCommand/index.mjs";
2
+ export { parseWorkflowLaunchCommand, validateWorkflowLaunch };