@agimon-ai/doompi-workflow 0.0.1-alpha.73 → 0.0.1-alpha.74

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 (352) hide show
  1. package/LICENSE +4 -2
  2. package/README.md +8 -5
  3. package/dist/_virtual/_rolldown/runtime.cjs +23 -1
  4. package/dist/api-contracts.cjs +7 -1
  5. package/dist/api-contracts.mjs +2 -1
  6. package/dist/extensions/pi.cjs +62 -1
  7. package/dist/extensions/pi.cjs.map +1 -1
  8. package/dist/extensions/pi.d.cts +3 -3
  9. package/dist/extensions/pi.d.cts.map +1 -1
  10. package/dist/extensions/pi.d.mts +3 -3
  11. package/dist/extensions/pi.d.mts.map +1 -1
  12. package/dist/extensions/pi.mjs +57 -1
  13. package/dist/extensions/pi.mjs.map +1 -1
  14. package/dist/extensions/server.cjs +95 -1
  15. package/dist/extensions/server.cjs.map +1 -1
  16. package/dist/extensions/server.d.cts +3 -3
  17. package/dist/extensions/server.d.cts.map +1 -1
  18. package/dist/extensions/server.d.mts +3 -3
  19. package/dist/extensions/server.d.mts.map +1 -1
  20. package/dist/extensions/server.mjs +90 -1
  21. package/dist/extensions/server.mjs.map +1 -1
  22. package/dist/extensions/web.mjs +3219 -0
  23. package/dist/extensions/web.mjs.map +1 -0
  24. package/dist/index.cjs +4 -1
  25. package/dist/index.mjs +2 -1
  26. package/dist/src/constants/workflow.cjs +31 -1
  27. package/dist/src/constants/workflow.cjs.map +1 -1
  28. package/dist/src/constants/workflow.mjs +20 -1
  29. package/dist/src/constants/workflow.mjs.map +1 -1
  30. package/dist/src/extensions/(backend)/_lib/index.server.cjs +12 -0
  31. package/dist/src/extensions/(backend)/_lib/index.server.cjs.map +1 -0
  32. package/dist/src/extensions/(backend)/_lib/index.server.mjs +12 -0
  33. package/dist/src/extensions/(backend)/_lib/index.server.mjs.map +1 -0
  34. package/dist/src/extensions/(backend)/api/workflow/route.server.cjs +7 -0
  35. package/dist/src/extensions/(backend)/api/workflow/route.server.cjs.map +1 -0
  36. package/dist/src/extensions/(backend)/api/workflow/route.server.mjs +8 -0
  37. package/dist/src/extensions/(backend)/api/workflow/route.server.mjs.map +1 -0
  38. package/dist/src/extensions/(backend)/channel/workflow-catalog.server.cjs +7 -0
  39. package/dist/src/extensions/(backend)/channel/workflow-catalog.server.cjs.map +1 -0
  40. package/dist/src/extensions/(backend)/channel/workflow-catalog.server.mjs +8 -0
  41. package/dist/src/extensions/(backend)/channel/workflow-catalog.server.mjs.map +1 -0
  42. package/dist/src/extensions/(backend)/channel/workflows.server.cjs +7 -0
  43. package/dist/src/extensions/(backend)/channel/workflows.server.cjs.map +1 -0
  44. package/dist/src/extensions/(backend)/channel/workflows.server.mjs +8 -0
  45. package/dist/src/extensions/(backend)/channel/workflows.server.mjs.map +1 -0
  46. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.cli.cjs +100 -0
  47. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.cli.cjs.map +1 -0
  48. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.cli.mjs +100 -0
  49. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.cli.mjs.map +1 -0
  50. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.server.cjs +11 -0
  51. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.server.cjs.map +1 -0
  52. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.server.mjs +11 -0
  53. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/index.server.mjs.map +1 -0
  54. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/workflowSkillsResource.cjs +12 -0
  55. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/workflowSkillsResource.cjs.map +1 -0
  56. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/workflowSkillsResource.mjs +12 -0
  57. package/dist/src/extensions/workspaces/sessions/(backend)/_lib/workflowSkillsResource.mjs.map +1 -0
  58. package/dist/src/extensions/workspaces/sessions/(backend)/api/workflow/route.server.cjs +6 -0
  59. package/dist/src/extensions/workspaces/sessions/(backend)/api/workflow/route.server.cjs.map +1 -0
  60. package/dist/src/extensions/workspaces/sessions/(backend)/api/workflow/route.server.mjs +7 -0
  61. package/dist/src/extensions/workspaces/sessions/(backend)/api/workflow/route.server.mjs.map +1 -0
  62. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.cli.cjs +6 -0
  63. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.cli.cjs.map +1 -0
  64. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.cli.mjs +7 -0
  65. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.cli.mjs.map +1 -0
  66. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.server.cjs +6 -0
  67. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.server.cjs.map +1 -0
  68. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.server.mjs +7 -0
  69. package/dist/src/extensions/workspaces/sessions/(backend)/command/workflow-launch.server.mjs.map +1 -0
  70. package/dist/src/extensions/workspaces/sessions/(backend)/hook/resources-discover.cli.cjs +6 -0
  71. package/dist/src/extensions/workspaces/sessions/(backend)/hook/resources-discover.cli.cjs.map +1 -0
  72. package/dist/src/extensions/workspaces/sessions/(backend)/hook/resources-discover.cli.mjs +7 -0
  73. package/dist/src/extensions/workspaces/sessions/(backend)/hook/resources-discover.cli.mjs.map +1 -0
  74. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-shutdown.server.cjs +6 -0
  75. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-shutdown.server.cjs.map +1 -0
  76. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-shutdown.server.mjs +7 -0
  77. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-shutdown.server.mjs.map +1 -0
  78. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs +6 -0
  79. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.cjs.map +1 -0
  80. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs +7 -0
  81. package/dist/src/extensions/workspaces/sessions/(backend)/hook/session-start.cli.mjs.map +1 -0
  82. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.server.cjs +6 -0
  83. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.server.cjs.map +1 -0
  84. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.server.mjs +7 -0
  85. package/dist/src/extensions/workspaces/sessions/(backend)/hook/tool-execution-end.server.mjs.map +1 -0
  86. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-author-workflow.server.cjs +6 -0
  87. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-author-workflow.server.cjs.map +1 -0
  88. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-author-workflow.server.mjs +7 -0
  89. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-author-workflow.server.mjs.map +1 -0
  90. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-workflow.server.cjs +6 -0
  91. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-workflow.server.cjs.map +1 -0
  92. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-workflow.server.mjs +7 -0
  93. package/dist/src/extensions/workspaces/sessions/(backend)/resource/doompi-use-workflow.server.mjs.map +1 -0
  94. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-recovery.server.cjs +6 -0
  95. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-recovery.server.cjs.map +1 -0
  96. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-recovery.server.mjs +7 -0
  97. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-recovery.server.mjs.map +1 -0
  98. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-skills.cli.cjs +7 -0
  99. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-skills.cli.cjs.map +1 -0
  100. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-skills.cli.mjs +8 -0
  101. package/dist/src/extensions/workspaces/sessions/(backend)/resource/workflow-skills.cli.mjs.map +1 -0
  102. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs +15 -0
  103. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.cjs.map +1 -0
  104. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs +16 -0
  105. package/dist/src/extensions/workspaces/sessions/(backend)/root.cli.mjs.map +1 -0
  106. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs +17 -0
  107. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.cjs.map +1 -0
  108. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs +18 -0
  109. package/dist/src/extensions/workspaces/sessions/(backend)/root.server.mjs.map +1 -0
  110. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-panel.cli.cjs +6 -0
  111. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-panel.cli.cjs.map +1 -0
  112. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-panel.cli.mjs +7 -0
  113. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-panel.cli.mjs.map +1 -0
  114. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-view-close.cli.cjs +6 -0
  115. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-view-close.cli.cjs.map +1 -0
  116. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-view-close.cli.mjs +7 -0
  117. package/dist/src/extensions/workspaces/sessions/(backend)/shortcut/workflow-view-close.cli.mjs.map +1 -0
  118. package/dist/src/extensions/workspaces/sessions/(backend)/tool/launch-workflow.server.cjs +6 -0
  119. package/dist/src/extensions/workspaces/sessions/(backend)/tool/launch-workflow.server.cjs.map +1 -0
  120. package/dist/src/extensions/workspaces/sessions/(backend)/tool/launch-workflow.server.mjs +7 -0
  121. package/dist/src/extensions/workspaces/sessions/(backend)/tool/launch-workflow.server.mjs.map +1 -0
  122. package/dist/src/extensions/workspaces/sessions/(backend)/tool/list-workflows.server.cjs +6 -0
  123. package/dist/src/extensions/workspaces/sessions/(backend)/tool/list-workflows.server.cjs.map +1 -0
  124. package/dist/src/extensions/workspaces/sessions/(backend)/tool/list-workflows.server.mjs +7 -0
  125. package/dist/src/extensions/workspaces/sessions/(backend)/tool/list-workflows.server.mjs.map +1 -0
  126. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow-run.server.cjs +6 -0
  127. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow-run.server.cjs.map +1 -0
  128. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow-run.server.mjs +7 -0
  129. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow-run.server.mjs.map +1 -0
  130. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow.cli.cjs +6 -0
  131. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow.cli.cjs.map +1 -0
  132. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow.cli.mjs +7 -0
  133. package/dist/src/extensions/workspaces/sessions/(backend)/tool/workflow.cli.mjs.map +1 -0
  134. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.cli.cjs +6 -0
  135. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.cli.cjs.map +1 -0
  136. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.cli.mjs +7 -0
  137. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.cli.mjs.map +1 -0
  138. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.server.cjs +6 -0
  139. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.server.cjs.map +1 -0
  140. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.server.mjs +7 -0
  141. package/dist/src/extensions/workspaces/sessions/(backend)/tool-restriction/workflow.server.mjs.map +1 -0
  142. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowFinishedRenderer.cjs +50 -0
  143. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowFinishedRenderer.cjs.map +1 -0
  144. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowFinishedRenderer.mjs +47 -0
  145. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowFinishedRenderer.mjs.map +1 -0
  146. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowStepRenderer.cjs +36 -0
  147. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowStepRenderer.cjs.map +1 -0
  148. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowStepRenderer.mjs +35 -0
  149. package/dist/src/extensions/workspaces/sessions/(frontend)/message/_lib/workflowStepRenderer.mjs.map +1 -0
  150. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-finished.cli.cjs +7 -0
  151. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-finished.cli.cjs.map +1 -0
  152. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-finished.cli.mjs +8 -0
  153. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-finished.cli.mjs.map +1 -0
  154. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-step.cli.cjs +7 -0
  155. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-step.cli.cjs.map +1 -0
  156. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-step.cli.mjs +8 -0
  157. package/dist/src/extensions/workspaces/sessions/(frontend)/message/workflow-step.cli.mjs.map +1 -0
  158. package/dist/src/schemas/apiContracts.cjs +329 -1
  159. package/dist/src/schemas/apiContracts.cjs.map +1 -1
  160. package/dist/src/schemas/apiContracts.mjs +326 -1
  161. package/dist/src/schemas/apiContracts.mjs.map +1 -1
  162. package/dist/src/schemas/workflowPi.cjs +76 -1
  163. package/dist/src/schemas/workflowPi.cjs.map +1 -1
  164. package/dist/src/schemas/workflowPi.mjs +73 -1
  165. package/dist/src/schemas/workflowPi.mjs.map +1 -1
  166. package/dist/src/services/backgroundWork/index.cjs +60 -1
  167. package/dist/src/services/backgroundWork/index.cjs.map +1 -1
  168. package/dist/src/services/backgroundWork/index.mjs +60 -1
  169. package/dist/src/services/backgroundWork/index.mjs.map +1 -1
  170. package/dist/src/services/piToolBridge/index.cjs +204 -10
  171. package/dist/src/services/piToolBridge/index.cjs.map +1 -1
  172. package/dist/src/services/piToolBridge/index.mjs +194 -10
  173. package/dist/src/services/piToolBridge/index.mjs.map +1 -1
  174. package/dist/src/services/serverRuntime/index.cjs +341 -0
  175. package/dist/src/services/serverRuntime/index.cjs.map +1 -0
  176. package/dist/src/services/serverRuntime/index.mjs +341 -0
  177. package/dist/src/services/serverRuntime/index.mjs.map +1 -0
  178. package/dist/src/services/webWorkflowCatalog/index.cjs +52 -1
  179. package/dist/src/services/webWorkflowCatalog/index.cjs.map +1 -1
  180. package/dist/src/services/webWorkflowCatalog/index.mjs +51 -1
  181. package/dist/src/services/webWorkflowCatalog/index.mjs.map +1 -1
  182. package/dist/src/services/workflowCatalogChannel/index.cjs +74 -0
  183. package/dist/src/services/workflowCatalogChannel/index.cjs.map +1 -0
  184. package/dist/src/services/workflowCatalogChannel/index.mjs +74 -0
  185. package/dist/src/services/workflowCatalogChannel/index.mjs.map +1 -0
  186. package/dist/src/services/workflowCatalogDeps/index.cjs +24 -1
  187. package/dist/src/services/workflowCatalogDeps/index.cjs.map +1 -1
  188. package/dist/src/services/workflowCatalogDeps/index.mjs +24 -1
  189. package/dist/src/services/workflowCatalogDeps/index.mjs.map +1 -1
  190. package/dist/src/services/workflowExecution/index.cjs +204 -1
  191. package/dist/src/services/workflowExecution/index.cjs.map +1 -1
  192. package/dist/src/services/workflowExecution/index.mjs +199 -1
  193. package/dist/src/services/workflowExecution/index.mjs.map +1 -1
  194. package/dist/src/services/workflowFence/index.cjs +169 -1
  195. package/dist/src/services/workflowFence/index.cjs.map +1 -1
  196. package/dist/src/services/workflowFence/index.mjs +165 -1
  197. package/dist/src/services/workflowFence/index.mjs.map +1 -1
  198. package/dist/src/services/workflowHubApi/index.cjs +415 -0
  199. package/dist/src/services/workflowHubApi/index.cjs.map +1 -0
  200. package/dist/src/services/workflowHubApi/index.mjs +411 -0
  201. package/dist/src/services/workflowHubApi/index.mjs.map +1 -0
  202. package/dist/src/services/workflowLaunchCommand/index.cjs +120 -1
  203. package/dist/src/services/workflowLaunchCommand/index.cjs.map +1 -1
  204. package/dist/src/services/workflowLaunchCommand/index.mjs +117 -1
  205. package/dist/src/services/workflowLaunchCommand/index.mjs.map +1 -1
  206. package/dist/src/services/workflowLauncher/index.cjs +180 -1
  207. package/dist/src/services/workflowLauncher/index.cjs.map +1 -1
  208. package/dist/src/services/workflowLauncher/index.mjs +176 -1
  209. package/dist/src/services/workflowLauncher/index.mjs.map +1 -1
  210. package/dist/src/services/workflowNarration/index.cjs +18 -1
  211. package/dist/src/services/workflowNarration/index.cjs.map +1 -1
  212. package/dist/src/services/workflowNarration/index.mjs +18 -1
  213. package/dist/src/services/workflowNarration/index.mjs.map +1 -1
  214. package/dist/src/services/workflowResource/index.cjs +26 -1
  215. package/dist/src/services/workflowResource/index.cjs.map +1 -1
  216. package/dist/src/services/workflowResource/index.mjs +23 -1
  217. package/dist/src/services/workflowResource/index.mjs.map +1 -1
  218. package/dist/src/services/workflowRuns/index.cjs +332 -2
  219. package/dist/src/services/workflowRuns/index.cjs.map +1 -1
  220. package/dist/src/services/workflowRuns/index.mjs +318 -2
  221. package/dist/src/services/workflowRuns/index.mjs.map +1 -1
  222. package/dist/src/services/workflowTerminal/index.cjs +68 -1
  223. package/dist/src/services/workflowTerminal/index.cjs.map +1 -1
  224. package/dist/src/services/workflowTerminal/index.mjs +68 -1
  225. package/dist/src/services/workflowTerminal/index.mjs.map +1 -1
  226. package/dist/src/services/workflowTools/index.cjs +221 -0
  227. package/dist/src/services/workflowTools/index.cjs.map +1 -0
  228. package/dist/src/services/workflowTools/index.mjs +221 -0
  229. package/dist/src/services/workflowTools/index.mjs.map +1 -0
  230. package/dist/src/services/workflowWatcher/index.cjs +77 -1
  231. package/dist/src/services/workflowWatcher/index.cjs.map +1 -1
  232. package/dist/src/services/workflowWatcher/index.mjs +73 -1
  233. package/dist/src/services/workflowWatcher/index.mjs.map +1 -1
  234. package/dist/src/services/workflowsHubChannel/index.cjs +58 -0
  235. package/dist/src/services/workflowsHubChannel/index.cjs.map +1 -0
  236. package/dist/src/services/workflowsHubChannel/index.mjs +58 -0
  237. package/dist/src/services/workflowsHubChannel/index.mjs.map +1 -0
  238. package/dist/src/tui/leader.cjs +83 -1
  239. package/dist/src/tui/leader.cjs.map +1 -1
  240. package/dist/src/tui/leader.mjs +82 -1
  241. package/dist/src/tui/leader.mjs.map +1 -1
  242. package/dist/src/tui/workflow/doomOverlay.cjs +158 -1
  243. package/dist/src/tui/workflow/doomOverlay.cjs.map +1 -1
  244. package/dist/src/tui/workflow/doomOverlay.mjs +156 -1
  245. package/dist/src/tui/workflow/doomOverlay.mjs.map +1 -1
  246. package/dist/src/tui/workflow/overlayText.cjs +82 -1
  247. package/dist/src/tui/workflow/overlayText.cjs.map +1 -1
  248. package/dist/src/tui/workflow/overlayText.mjs +77 -1
  249. package/dist/src/tui/workflow/overlayText.mjs.map +1 -1
  250. package/dist/src/tui/workflow/rendering.cjs +21 -1
  251. package/dist/src/tui/workflow/rendering.cjs.map +1 -1
  252. package/dist/src/tui/workflow/rendering.mjs +19 -1
  253. package/dist/src/tui/workflow/rendering.mjs.map +1 -1
  254. package/dist/src/tui/workflow/workflowCatalog.cjs +335 -1
  255. package/dist/src/tui/workflow/workflowCatalog.cjs.map +1 -1
  256. package/dist/src/tui/workflow/workflowCatalog.mjs +332 -1
  257. package/dist/src/tui/workflow/workflowCatalog.mjs.map +1 -1
  258. package/dist/src/tui/workflow/workflowFinishedMessage.cjs +49 -2
  259. package/dist/src/tui/workflow/workflowFinishedMessage.cjs.map +1 -1
  260. package/dist/src/tui/workflow/workflowFinishedMessage.mjs +46 -2
  261. package/dist/src/tui/workflow/workflowFinishedMessage.mjs.map +1 -1
  262. package/dist/src/tui/workflow/workflowInspector.cjs +275 -1
  263. package/dist/src/tui/workflow/workflowInspector.cjs.map +1 -1
  264. package/dist/src/tui/workflow/workflowInspector.mjs +275 -1
  265. package/dist/src/tui/workflow/workflowInspector.mjs.map +1 -1
  266. package/dist/src/tui/workflow/workflowOverlay.cjs +125 -1
  267. package/dist/src/tui/workflow/workflowOverlay.cjs.map +1 -1
  268. package/dist/src/tui/workflow/workflowOverlay.mjs +124 -1
  269. package/dist/src/tui/workflow/workflowOverlay.mjs.map +1 -1
  270. package/dist/src/tui/workflow/workflowPicker.cjs +137 -1
  271. package/dist/src/tui/workflow/workflowPicker.cjs.map +1 -1
  272. package/dist/src/tui/workflow/workflowPicker.mjs +135 -1
  273. package/dist/src/tui/workflow/workflowPicker.mjs.map +1 -1
  274. package/dist/src/tui/workflow/workflowProgressOverlay.cjs +196 -1
  275. package/dist/src/tui/workflow/workflowProgressOverlay.cjs.map +1 -1
  276. package/dist/src/tui/workflow/workflowProgressOverlay.mjs +191 -1
  277. package/dist/src/tui/workflow/workflowProgressOverlay.mjs.map +1 -1
  278. package/dist/src/tui/workflow/workflowPrompt.cjs +141 -1
  279. package/dist/src/tui/workflow/workflowPrompt.cjs.map +1 -1
  280. package/dist/src/tui/workflow/workflowPrompt.mjs +138 -1
  281. package/dist/src/tui/workflow/workflowPrompt.mjs.map +1 -1
  282. package/dist/src/tui/workflow/workflowRunPanel.cjs +94 -1
  283. package/dist/src/tui/workflow/workflowRunPanel.cjs.map +1 -1
  284. package/dist/src/tui/workflow/workflowRunPanel.mjs +93 -1
  285. package/dist/src/tui/workflow/workflowRunPanel.mjs.map +1 -1
  286. package/dist/src/tui/workflow/workflowStatusRow.cjs +19 -1
  287. package/dist/src/tui/workflow/workflowStatusRow.cjs.map +1 -1
  288. package/dist/src/tui/workflow/workflowStatusRow.mjs +19 -1
  289. package/dist/src/tui/workflow/workflowStatusRow.mjs.map +1 -1
  290. package/dist/src/tui/workflow/workflowStepMessage.cjs +31 -1
  291. package/dist/src/tui/workflow/workflowStepMessage.cjs.map +1 -1
  292. package/dist/src/tui/workflow/workflowStepMessage.mjs +30 -1
  293. package/dist/src/tui/workflow/workflowStepMessage.mjs.map +1 -1
  294. package/dist/src/tui/workflow/workflowToolRender.cjs +490 -6
  295. package/dist/src/tui/workflow/workflowToolRender.cjs.map +1 -1
  296. package/dist/src/tui/workflow/workflowToolRender.mjs +489 -6
  297. package/dist/src/tui/workflow/workflowToolRender.mjs.map +1 -1
  298. package/dist/src/tui/workflowRuntime.cjs +1932 -7
  299. package/dist/src/tui/workflowRuntime.cjs.map +1 -1
  300. package/dist/src/tui/workflowRuntime.mjs +1928 -7
  301. package/dist/src/tui/workflowRuntime.mjs.map +1 -1
  302. package/dist/src/types/apiRoutes.cjs +82 -0
  303. package/dist/src/types/apiRoutes.cjs.map +1 -0
  304. package/dist/src/types/apiRoutes.mjs +80 -0
  305. package/dist/src/types/apiRoutes.mjs.map +1 -0
  306. package/dist/src/types/webWorkflowTerminal.cjs +22 -1
  307. package/dist/src/types/webWorkflowTerminal.cjs.map +1 -1
  308. package/dist/src/types/webWorkflowTerminal.mjs +21 -1
  309. package/dist/src/types/webWorkflowTerminal.mjs.map +1 -1
  310. package/dist/src/types/webWorkflows.cjs +7 -1
  311. package/dist/src/types/webWorkflows.cjs.map +1 -1
  312. package/dist/src/types/webWorkflows.mjs +6 -1
  313. package/dist/src/types/webWorkflows.mjs.map +1 -1
  314. package/package.json +19 -18
  315. package/src/types/webWorkflowTerminal.ts +7 -6
  316. package/dist/src/controllers/serverRuntime.cjs +0 -2
  317. package/dist/src/controllers/serverRuntime.cjs.map +0 -1
  318. package/dist/src/controllers/serverRuntime.mjs +0 -2
  319. package/dist/src/controllers/serverRuntime.mjs.map +0 -1
  320. package/dist/src/controllers/workflowCatalogChannel.cjs +0 -2
  321. package/dist/src/controllers/workflowCatalogChannel.cjs.map +0 -1
  322. package/dist/src/controllers/workflowCatalogChannel.mjs +0 -2
  323. package/dist/src/controllers/workflowCatalogChannel.mjs.map +0 -1
  324. package/dist/src/controllers/workflowHubApi.cjs +0 -2
  325. package/dist/src/controllers/workflowHubApi.cjs.map +0 -1
  326. package/dist/src/controllers/workflowHubApi.mjs +0 -2
  327. package/dist/src/controllers/workflowHubApi.mjs.map +0 -1
  328. package/dist/src/controllers/workflowsHubChannel.cjs +0 -2
  329. package/dist/src/controllers/workflowsHubChannel.cjs.map +0 -1
  330. package/dist/src/controllers/workflowsHubChannel.mjs +0 -2
  331. package/dist/src/controllers/workflowsHubChannel.mjs.map +0 -1
  332. package/dist/src/tools/workflowTools.cjs +0 -5
  333. package/dist/src/tools/workflowTools.cjs.map +0 -1
  334. package/dist/src/tools/workflowTools.mjs +0 -5
  335. package/dist/src/tools/workflowTools.mjs.map +0 -1
  336. package/src/extensions/web.ts +0 -80
  337. package/src/web/api/terminalApi.ts +0 -208
  338. package/src/web/components/ArtifactsPane.tsx +0 -451
  339. package/src/web/components/LaunchWorkflowDialog.tsx +0 -259
  340. package/src/web/components/StepTerminalPanel.tsx +0 -243
  341. package/src/web/components/WorkflowCatalogDrawer.tsx +0 -229
  342. package/src/web/components/WorkflowToolMessage.tsx +0 -55
  343. package/src/web/components/WorkflowsActivitySection.tsx +0 -155
  344. package/src/web/components/WorkflowsPanel.tsx +0 -750
  345. package/src/web/lib/launchLine.ts +0 -66
  346. package/src/web/lib/runDuration.ts +0 -15
  347. package/src/web/lib/workflowActivity.ts +0 -102
  348. package/src/web/lib/workflowToolRender.ts +0 -585
  349. package/src/web/stores/catalogStore.ts +0 -123
  350. package/src/web/stores/workflowsStore.ts +0 -91
  351. package/src/web/tsconfig.json +0 -22
  352. /package/{src/web/LICENSE → LICENSE.web} +0 -0
@@ -0,0 +1,82 @@
1
+ let _agimon_ai_doompi_core_web = require("@agimon-ai/doompi-core/web");
2
+ //#region src/types/apiRoutes.ts
3
+ /**
4
+ * This package's routes, as data.
5
+ *
6
+ * No scope and no base path. The build reads both off
7
+ * `src/extensions/(backend)/api/workflow/`, so the mount is stated once, by the
8
+ * folder that creates it. The same API answers at all three scopes, because a
9
+ * global contribution cascades into workspace and session; the folder under
10
+ * `workspaces/sessions/` only re-mounts it for a session's own server.
11
+ *
12
+ * This is the one file the routes, the Hono app and the browser all read, so a
13
+ * path cannot move on one side alone. The page used to build the hub's own
14
+ * absolute URL and then rewrite its plugin prefix with String.replace to reach
15
+ * a session, which is exactly the kind of copy that can move by one character
16
+ * without anything noticing.
17
+ *
18
+ * `:workspace` and `:runKey` are Hono's own parameter syntax, because the app
19
+ * registers `path` verbatim.
20
+ */
21
+ /** One run, which every route below addresses. */
22
+ const RUN = "/runs/:workspace/:runKey";
23
+ /**
24
+ * The artifact route's parameter, as Hono spells a multi-segment match.
25
+ *
26
+ * An artifact is named by its path inside the run directory, so `reports/a.md`
27
+ * is one parameter across two segments. The client's `params` substitution
28
+ * fills a single segment and percent-encodes the slash with it, so the page
29
+ * substitutes this one itself; see the page's `_lib/terminalApi.ts`.
30
+ */
31
+ const ARTIFACT_NAME_PARAM = ":name{.+}";
32
+ const ARTIFACT_DOWNLOAD_PARAM = "download";
33
+ var apiRoutes_default = (0, _agimon_ai_doompi_core_web.defineApiRoutes)({
34
+ /**
35
+ * The terminal, as server-sent events.
36
+ *
37
+ * `stream: true` gets a URL and no call method: the consumer is the browser's
38
+ * own `EventSource`, and a relayed call would buffer a stream that never ends.
39
+ */
40
+ screen: {
41
+ method: "GET",
42
+ path: `${RUN}/screen/stream`,
43
+ stream: true
44
+ },
45
+ control: {
46
+ method: "POST",
47
+ path: `${RUN}/control`,
48
+ response: (0, _agimon_ai_doompi_core_web.apiResponse)()
49
+ },
50
+ keys: {
51
+ method: "POST",
52
+ path: `${RUN}/keys`
53
+ },
54
+ resize: {
55
+ method: "POST",
56
+ path: `${RUN}/resize`,
57
+ response: (0, _agimon_ai_doompi_core_web.apiResponse)()
58
+ },
59
+ remove: {
60
+ method: "DELETE",
61
+ path: RUN,
62
+ response: (0, _agimon_ai_doompi_core_web.apiResponse)()
63
+ },
64
+ artifacts: {
65
+ method: "GET",
66
+ path: `${RUN}/artifacts`,
67
+ response: (0, _agimon_ai_doompi_core_web.apiResponse)()
68
+ },
69
+ /** One artifact: its metadata and text, or its raw bytes under `raw=1`. */
70
+ artifact: {
71
+ method: "GET",
72
+ path: `${RUN}/artifacts/${ARTIFACT_NAME_PARAM}`,
73
+ query: ["raw", ARTIFACT_DOWNLOAD_PARAM],
74
+ response: (0, _agimon_ai_doompi_core_web.apiResponse)()
75
+ }
76
+ });
77
+ //#endregion
78
+ exports.ARTIFACT_DOWNLOAD_PARAM = ARTIFACT_DOWNLOAD_PARAM;
79
+ exports.ARTIFACT_NAME_PARAM = ARTIFACT_NAME_PARAM;
80
+ exports.default = apiRoutes_default;
81
+
82
+ //# sourceMappingURL=apiRoutes.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiRoutes.cjs","names":["defineApiRoutes","apiResponse"],"sources":["../../../src/types/apiRoutes.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,MAAM;;;;;;;;;AAUZ,MAAa,sBAAsB;AAInC,MAAa,0BAA0B;AAEvC,IAAA,qBAAA,GAAeA,2BAAAA,gBAAAA,CAAgB;;;;;;;CAO7B,QAAQ;EACN,QAAQ;EACR,MAAM,GAAG,IAAI;EACb,QAAQ;CACV;CACA,SAAS;EACP,QAAQ;EACR,MAAM,GAAG,IAAI;EACb,WAAA,GAAUC,2BAAAA,YAAAA,CAAqC;CACjD;CACA,MAAM;EACJ,QAAQ;EACR,MAAM,GAAG,IAAI;CACf;CACA,QAAQ;EACN,QAAQ;EACR,MAAM,GAAG,IAAI;EACb,WAAA,GAAUA,2BAAAA,YAAAA,CAAkC;CAC9C;CACA,QAAQ;EACN,QAAQ;EACR,MAAM;EACN,WAAA,GAAUA,2BAAAA,YAAAA,CAAoC;CAChD;CACA,WAAW;EACT,QAAQ;EACR,MAAM,GAAG,IAAI;EACb,WAAA,GAAUA,2BAAAA,YAAAA,CAAuC;CACnD;;CAEA,UAAU;EACR,QAAQ;EACR,MAAM,GAAG,IAAI,aAAa;EAC1B,OAAO,CAAA,OAAqB,uBAAuB;EACnD,WAAA,GAAUA,2BAAAA,YAAAA,CAA6C;CACzD;AACF,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { apiResponse, defineApiRoutes } from "@agimon-ai/doompi-core/web";
2
+ //#region src/types/apiRoutes.ts
3
+ /**
4
+ * This package's routes, as data.
5
+ *
6
+ * No scope and no base path. The build reads both off
7
+ * `src/extensions/(backend)/api/workflow/`, so the mount is stated once, by the
8
+ * folder that creates it. The same API answers at all three scopes, because a
9
+ * global contribution cascades into workspace and session; the folder under
10
+ * `workspaces/sessions/` only re-mounts it for a session's own server.
11
+ *
12
+ * This is the one file the routes, the Hono app and the browser all read, so a
13
+ * path cannot move on one side alone. The page used to build the hub's own
14
+ * absolute URL and then rewrite its plugin prefix with String.replace to reach
15
+ * a session, which is exactly the kind of copy that can move by one character
16
+ * without anything noticing.
17
+ *
18
+ * `:workspace` and `:runKey` are Hono's own parameter syntax, because the app
19
+ * registers `path` verbatim.
20
+ */
21
+ /** One run, which every route below addresses. */
22
+ const RUN = "/runs/:workspace/:runKey";
23
+ /**
24
+ * The artifact route's parameter, as Hono spells a multi-segment match.
25
+ *
26
+ * An artifact is named by its path inside the run directory, so `reports/a.md`
27
+ * is one parameter across two segments. The client's `params` substitution
28
+ * fills a single segment and percent-encodes the slash with it, so the page
29
+ * substitutes this one itself; see the page's `_lib/terminalApi.ts`.
30
+ */
31
+ const ARTIFACT_NAME_PARAM = ":name{.+}";
32
+ const ARTIFACT_DOWNLOAD_PARAM = "download";
33
+ var apiRoutes_default = defineApiRoutes({
34
+ /**
35
+ * The terminal, as server-sent events.
36
+ *
37
+ * `stream: true` gets a URL and no call method: the consumer is the browser's
38
+ * own `EventSource`, and a relayed call would buffer a stream that never ends.
39
+ */
40
+ screen: {
41
+ method: "GET",
42
+ path: `${RUN}/screen/stream`,
43
+ stream: true
44
+ },
45
+ control: {
46
+ method: "POST",
47
+ path: `${RUN}/control`,
48
+ response: apiResponse()
49
+ },
50
+ keys: {
51
+ method: "POST",
52
+ path: `${RUN}/keys`
53
+ },
54
+ resize: {
55
+ method: "POST",
56
+ path: `${RUN}/resize`,
57
+ response: apiResponse()
58
+ },
59
+ remove: {
60
+ method: "DELETE",
61
+ path: RUN,
62
+ response: apiResponse()
63
+ },
64
+ artifacts: {
65
+ method: "GET",
66
+ path: `${RUN}/artifacts`,
67
+ response: apiResponse()
68
+ },
69
+ /** One artifact: its metadata and text, or its raw bytes under `raw=1`. */
70
+ artifact: {
71
+ method: "GET",
72
+ path: `${RUN}/artifacts/${ARTIFACT_NAME_PARAM}`,
73
+ query: ["raw", ARTIFACT_DOWNLOAD_PARAM],
74
+ response: apiResponse()
75
+ }
76
+ });
77
+ //#endregion
78
+ export { ARTIFACT_DOWNLOAD_PARAM, ARTIFACT_NAME_PARAM, apiRoutes_default as default };
79
+
80
+ //# sourceMappingURL=apiRoutes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiRoutes.mjs","names":[],"sources":["../../../src/types/apiRoutes.ts"],"sourcesContent":["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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,MAAM;;;;;;;;;AAUZ,MAAa,sBAAsB;AAInC,MAAa,0BAA0B;AAEvC,IAAA,oBAAe,gBAAgB;;;;;;;CAO7B,QAAQ;EACN,QAAQ;EACR,MAAM,GAAG,IAAI;EACb,QAAQ;CACV;CACA,SAAS;EACP,QAAQ;EACR,MAAM,GAAG,IAAI;EACb,UAAU,YAAqC;CACjD;CACA,MAAM;EACJ,QAAQ;EACR,MAAM,GAAG,IAAI;CACf;CACA,QAAQ;EACN,QAAQ;EACR,MAAM,GAAG,IAAI;EACb,UAAU,YAAkC;CAC9C;CACA,QAAQ;EACN,QAAQ;EACR,MAAM;EACN,UAAU,YAAoC;CAChD;CACA,WAAW;EACT,QAAQ;EACR,MAAM,GAAG,IAAI;EACb,UAAU,YAAuC;CACnD;;CAEA,UAAU;EACR,QAAQ;EACR,MAAM,GAAG,IAAI,aAAa;EAC1B,OAAO,CAAA,OAAqB,uBAAuB;EACnD,UAAU,YAA6C;CACzD;AACF,CAAC"}
@@ -1,2 +1,23 @@
1
- exports.WORKFLOW_API_BASE_PATH=`workflow`,exports.WORKFLOW_SCREEN_EVENT=`screen`;
1
+ //#region src/types/webWorkflowTerminal.ts
2
+ /**
3
+ * The wire contract between this package's hub API and its cockpit client:
4
+ * one run's terminal, and the files its run directory holds.
5
+ *
6
+ * Both halves of the cockpit import these names, so the route strings and the
7
+ * event names live here rather than being spelled twice.
8
+ */
9
+ /**
10
+ * Segment this package's API is mounted under, below /api/plugins/.
11
+ *
12
+ * The same word names `src/extensions/(backend)/api/workflow/`, which is where
13
+ * the build reads the mount for the browser's client, so the two cannot drift.
14
+ * The routes themselves are declared in `apiRoutes.ts`.
15
+ */
16
+ const WORKFLOW_API_BASE_PATH = "workflow";
17
+ /** The SSE event name the screen stream writes. */
18
+ const WORKFLOW_SCREEN_EVENT = "screen";
19
+ //#endregion
20
+ exports.WORKFLOW_API_BASE_PATH = WORKFLOW_API_BASE_PATH;
21
+ exports.WORKFLOW_SCREEN_EVENT = WORKFLOW_SCREEN_EVENT;
22
+
2
23
  //# sourceMappingURL=webWorkflowTerminal.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"webWorkflowTerminal.cjs","names":[],"sources":["../../../src/types/webWorkflowTerminal.ts"],"sourcesContent":["/**\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/** Segment this package's API is mounted under, below /api/plugins/. */\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/** Where a run's routes live, below the mount every hub-scoped package API shares. */\nexport function workflowRunPath(workspace: string, runKey: string): string {\n return `/api/plugins/${WORKFLOW_API_BASE_PATH}/runs/${encodeURIComponent(workspace)}/${encodeURIComponent(runKey)}`;\n}\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"],"mappings":""}
1
+ {"version":3,"file":"webWorkflowTerminal.cjs","names":[],"sources":["../../../src/types/webWorkflowTerminal.ts"],"sourcesContent":["/**\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"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAa,yBAAyB;;AAGtC,MAAa,wBAAwB"}
@@ -1,2 +1,22 @@
1
- const e=`workflow`,t=`screen`;export{e as WORKFLOW_API_BASE_PATH,t as WORKFLOW_SCREEN_EVENT};
1
+ //#region src/types/webWorkflowTerminal.ts
2
+ /**
3
+ * The wire contract between this package's hub API and its cockpit client:
4
+ * one run's terminal, and the files its run directory holds.
5
+ *
6
+ * Both halves of the cockpit import these names, so the route strings and the
7
+ * event names live here rather than being spelled twice.
8
+ */
9
+ /**
10
+ * Segment this package's API is mounted under, below /api/plugins/.
11
+ *
12
+ * The same word names `src/extensions/(backend)/api/workflow/`, which is where
13
+ * the build reads the mount for the browser's client, so the two cannot drift.
14
+ * The routes themselves are declared in `apiRoutes.ts`.
15
+ */
16
+ const WORKFLOW_API_BASE_PATH = "workflow";
17
+ /** The SSE event name the screen stream writes. */
18
+ const WORKFLOW_SCREEN_EVENT = "screen";
19
+ //#endregion
20
+ export { WORKFLOW_API_BASE_PATH, WORKFLOW_SCREEN_EVENT };
21
+
2
22
  //# sourceMappingURL=webWorkflowTerminal.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"webWorkflowTerminal.mjs","names":[],"sources":["../../../src/types/webWorkflowTerminal.ts"],"sourcesContent":["/**\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/** Segment this package's API is mounted under, below /api/plugins/. */\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/** Where a run's routes live, below the mount every hub-scoped package API shares. */\nexport function workflowRunPath(workspace: string, runKey: string): string {\n return `/api/plugins/${WORKFLOW_API_BASE_PATH}/runs/${encodeURIComponent(workspace)}/${encodeURIComponent(runKey)}`;\n}\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"],"mappings":"AASA,MAAa,EAAyB,WAGzB,EAAwB"}
1
+ {"version":3,"file":"webWorkflowTerminal.mjs","names":[],"sources":["../../../src/types/webWorkflowTerminal.ts"],"sourcesContent":["/**\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"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAa,yBAAyB;;AAGtC,MAAa,wBAAwB"}
@@ -1,2 +1,8 @@
1
- exports.WORKFLOW_CATALOG_TYPE=`workflow_catalog`,exports.WORKFLOW_RUNS_TYPE=`workflow_runs`;
1
+ //#region src/types/webWorkflows.ts
2
+ const WORKFLOW_RUNS_TYPE = "workflow_runs";
3
+ const WORKFLOW_CATALOG_TYPE = "workflow_catalog";
4
+ //#endregion
5
+ exports.WORKFLOW_CATALOG_TYPE = WORKFLOW_CATALOG_TYPE;
6
+ exports.WORKFLOW_RUNS_TYPE = WORKFLOW_RUNS_TYPE;
7
+
2
8
  //# sourceMappingURL=webWorkflows.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"webWorkflows.cjs","names":[],"sources":["../../../src/types/webWorkflows.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"],"mappings":""}
1
+ {"version":3,"file":"webWorkflows.cjs","names":[],"sources":["../../../src/types/webWorkflows.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"],"mappings":";AA8FA,MAAa,qBAAqB;AAuDlC,MAAa,wBAAwB"}
@@ -1,2 +1,7 @@
1
- const e=`workflow_runs`,t=`workflow_catalog`;export{t as WORKFLOW_CATALOG_TYPE,e as WORKFLOW_RUNS_TYPE};
1
+ //#region src/types/webWorkflows.ts
2
+ const WORKFLOW_RUNS_TYPE = "workflow_runs";
3
+ const WORKFLOW_CATALOG_TYPE = "workflow_catalog";
4
+ //#endregion
5
+ export { WORKFLOW_CATALOG_TYPE, WORKFLOW_RUNS_TYPE };
6
+
2
7
  //# sourceMappingURL=webWorkflows.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"webWorkflows.mjs","names":[],"sources":["../../../src/types/webWorkflows.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"],"mappings":"AA8FA,MAAa,EAAqB,gBAuDrB,EAAwB"}
1
+ {"version":3,"file":"webWorkflows.mjs","names":[],"sources":["../../../src/types/webWorkflows.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"],"mappings":";AA8FA,MAAa,qBAAqB;AAuDlC,MAAa,wBAAwB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/doompi-workflow",
3
- "version": "0.0.1-alpha.73",
3
+ "version": "0.0.1-alpha.74",
4
4
  "description": "GitHub Actions-style workflow graphs, artifacts, recovery, and asynchronous runs for DoomPi.",
5
5
  "keywords": [
6
6
  "ai",
@@ -31,11 +31,8 @@
31
31
  "README.md",
32
32
  "src/prompts",
33
33
  "skills/workflow-recovery/SKILL.md",
34
- "src/web",
35
- "src/extensions/web.ts",
36
34
  "src/types/webWorkflows.ts",
37
- "src/types/webWorkflowTerminal.ts",
38
- "!src/web/**/*.stories.tsx"
35
+ "src/types/webWorkflowTerminal.ts"
39
36
  ],
40
37
  "type": "module",
41
38
  "main": "./dist/index.cjs",
@@ -57,19 +54,22 @@
57
54
  "import": "./dist/extensions/server.mjs",
58
55
  "require": "./dist/extensions/server.cjs"
59
56
  },
60
- "./package.json": "./package.json",
61
- "./skills/workflow-recovery/SKILL.md": "./skills/workflow-recovery/SKILL.md"
57
+ "./extensions/web": {
58
+ "import": "./dist/extensions/web.mjs"
59
+ },
60
+ "./skills/workflow-recovery/SKILL.md": "./skills/workflow-recovery/SKILL.md",
61
+ "./package.json": "./package.json"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
66
  "dependencies": {
67
- "@agimon-ai/doompi-core": "0.0.1-alpha.72",
68
- "@agimon-ai/doompi-minor-mode": "0.0.1-alpha.72",
69
- "@agimon-ai/doompi-telemetry": "0.0.1-alpha.69",
70
- "@agimon-ai/doompi-ui": "0.0.1-alpha.72",
71
- "@agimon-ai/doompi-web-components": "0.0.1-alpha.30",
72
- "@agimon-ai/doompi-web-security": "0.0.1-alpha.32",
67
+ "@agimon-ai/doompi-core": "0.0.1-alpha.73",
68
+ "@agimon-ai/doompi-minor-mode": "0.0.1-alpha.73",
69
+ "@agimon-ai/doompi-telemetry": "0.0.1-alpha.70",
70
+ "@agimon-ai/doompi-ui": "0.0.1-alpha.73",
71
+ "@agimon-ai/doompi-web-components": "0.0.1-alpha.31",
72
+ "@agimon-ai/doompi-web-security": "0.0.1-alpha.33",
73
73
  "@agimon-ai/workflow-mcp": "0.23.26",
74
74
  "@deepseek-ai/cordis": "4.0.2",
75
75
  "@modelcontextprotocol/sdk": "1.30.0",
@@ -78,6 +78,7 @@
78
78
  "zod": "4.6.2"
79
79
  },
80
80
  "devDependencies": {
81
+ "@agimon-ai/doompi-build": "0.0.1-alpha.2",
81
82
  "@earendil-works/pi-coding-agent": "0.85.1",
82
83
  "@earendil-works/pi-tui": "0.85.1",
83
84
  "@tanstack/react-store": "0.11.1",
@@ -108,7 +109,7 @@
108
109
  "node": ">=22.19.0"
109
110
  },
110
111
  "doompiServer": {
111
- "entry": "./src/extensions/server.ts",
112
+ "entry": "./generated/server.ts",
112
113
  "dist": "./dist/extensions/server.mjs",
113
114
  "scopes": [
114
115
  "global",
@@ -123,10 +124,10 @@
123
124
  "doompiWeb": {
124
125
  "pluginId": "workflows",
125
126
  "channels": [
126
- "workflow_runs",
127
- "workflow_catalog"
127
+ "workflow_catalog",
128
+ "workflow_runs"
128
129
  ],
129
- "client": "./src/extensions/web.ts",
130
+ "client": "./dist/extensions/web.mjs",
130
131
  "scopes": [
131
132
  "session"
132
133
  ]
@@ -139,7 +140,7 @@
139
140
  "scripts": {
140
141
  "build": "tsdown",
141
142
  "test": "vitest --run",
142
- "typecheck": "tsc --noEmit && tsc --noEmit -p src/web/tsconfig.json",
143
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.web.json",
143
144
  "lint": "oxlint . && oxfmt . --check",
144
145
  "fixcode": "oxlint . --fix && oxfmt ."
145
146
  }
@@ -6,17 +6,18 @@
6
6
  * event names live here rather than being spelled twice.
7
7
  */
8
8
 
9
- /** Segment this package's API is mounted under, below /api/plugins/. */
9
+ /**
10
+ * Segment this package's API is mounted under, below /api/plugins/.
11
+ *
12
+ * The same word names `src/extensions/(backend)/api/workflow/`, which is where
13
+ * the build reads the mount for the browser's client, so the two cannot drift.
14
+ * The routes themselves are declared in `apiRoutes.ts`.
15
+ */
10
16
  export const WORKFLOW_API_BASE_PATH = 'workflow';
11
17
 
12
18
  /** The SSE event name the screen stream writes. */
13
19
  export const WORKFLOW_SCREEN_EVENT = 'screen';
14
20
 
15
- /** Where a run's routes live, below the mount every hub-scoped package API shares. */
16
- export function workflowRunPath(workspace: string, runKey: string): string {
17
- return `/api/plugins/${WORKFLOW_API_BASE_PATH}/runs/${encodeURIComponent(workspace)}/${encodeURIComponent(runKey)}`;
18
- }
19
-
20
21
  /** What a surface may do with one run's terminal, and why anything is missing. */
21
22
  export interface WorkflowTerminalCapabilitiesView {
22
23
  readable: boolean;
@@ -1,2 +0,0 @@
1
- const e=require("../services/workflowLaunchCommand/index.cjs"),t=require("../services/workflowResource/index.cjs"),n=require("../services/webWorkflowCatalog/index.cjs"),r=require("../services/workflowCatalogDeps/index.cjs"),i=require("../services/workflowRuns/index.cjs"),a=require("../services/workflowWatcher/index.cjs"),o=require("../types/webWorkflows.cjs");let s=require("@agimon-ai/workflow-mcp"),c=require("zod"),l=require("@agimon-ai/doompi-minor-mode");const u=`@agimon-ai/doompi-workflow`,d=`workflow`,f=`list_workflows`,p=`launch_workflow`,m=`workflow_run`;function h(e){let t=[];if(typeof e==`object`&&e&&`content`in e&&Array.isArray(e.content))for(let n of e.content){if(typeof n!=`object`||!n||!(`type`in n))continue;let e=n;e.type===`text`&&typeof e.text==`string`?t.push({type:`text`,text:e.text}):e.type===`image`&&typeof e.data==`string`&&typeof e.mimeType==`string`&&t.push({type:`image`,data:e.data,mimeType:e.mimeType})}return t.length===0&&t.push({type:`text`,text:JSON.stringify(e,null,2)}),{content:t,details:e}}function g(g,_){if(_.context.directEvents===void 0)throw Error(`Workflow headless facet requires the session direct event bus.`);let v=_.context.directEvents,y=n.createWorkflowCatalogReader(r.defaultCatalogDeps()),b=async e=>{let t=i.presentWorkflowRuns(a.readWorkflowRuns({environment:e.environment}).filter(t=>i.runBelongsToSession(t,e.sessionId)).map(e=>e.view),Date.now());v.publish(o.WORKFLOW_RUNS_TYPE,e.sessionId,{runs:t});try{v.publish(o.WORKFLOW_CATALOG_TYPE,e.sessionId,{cwd:e.cwd,workflows:n.presentWorkflowCatalog(await y.read(e.cwd))})}catch(t){let n=t instanceof Error?t.message:String(t);v.publish(o.WORKFLOW_CATALOG_TYPE,e.sessionId,{cwd:e.cwd,workflows:[],warning:n})}},x=(0,s.createEmbeddedWorkflowFeature)(),S,C,w=()=>(g.context.selection.state?.[`minor-mode`]??[]).includes(d),T=()=>{let e=w();return{activation:e?`active`:`inactive`,condition:`ready`,...e?{detail:`workflow tools available`}:{},actions:[{id:`activate`,enabled:!e,...e?{disabledReason:`Workflow mode is active.`}:{}},{id:`deactivate`,enabled:e,...e?{}:{disabledReason:`Workflow mode is inactive.`}}]}},E=async e=>{let t=(g.context.selection.state?.[`minor-mode`]??[]).filter(e=>e!==d);await g.changeSelection({axis:`state`,key:`minor-mode`,values:e?[...t,d]:t}),C?.publish()};return C=(0,l.defineMinorMode)({descriptor:{source:u,id:d,label:`Workflow`,description:`Workflow discovery, launch, inspection, control, and recovery tools.`,order:20,actions:[{id:`activate`,label:`Activate`,description:`Enable workflow tools for this session.`,contexts:[`headless`],parameters:[]},{id:`deactivate`,label:`Deactivate`,description:`Disable workflow tools without stopping active runs.`,contexts:[`headless`],parameters:[]}]},state:T,async handleAction(e,t,n,r){if(r.signal.throwIfAborted(),t===`activate`)return await E(!0),{message:`Workflow mode activated.`};if(t===`deactivate`)return await E(!1),{message:`Workflow mode deactivated.`};throw Error(`Unknown workflow mode action: ${t}`)}}).createOwner(void 0),{services:[(0,l.serverMinorModes)([C])],toolRestrictions:[{when:{state:{"minor-mode":d}},allowedTools:[f,p,m]}],hooks:[{event:`tool_execution_end`,handle:async(e,t)=>{await b(t)}},{when:{state:{"minor-mode":d},attribution:{kind:`minor`,mode:d}},event:`session_shutdown`,handle:()=>{S?.dispose(),S=void 0}}],resources:[{when:{state:{"minor-mode":d},attribution:{kind:`minor`,mode:d}},name:`doompi-author-workflow`,kind:`skill`,read:()=>t.readWorkflowSkill(`doompi-author-workflow`)},{when:{state:{"minor-mode":d},attribution:{kind:`minor`,mode:d}},name:`doompi-use-workflow`,kind:`skill`,read:()=>t.readWorkflowSkill(`doompi-use-workflow`)},{when:{state:{"minor-mode":d},attribution:{kind:`minor`,mode:d}},name:`workflow-recovery`,kind:`skill`,read:()=>t.readWorkflowSkill(`workflow-recovery`)}],activities:[{when:{state:{"minor-mode":d},attribution:{kind:`minor`,mode:d}},name:u,async start(e){return S=x.createRunControl({}),await S.start(),await b(e),()=>{S?.dispose(),S=void 0}}}],tools:[{when:{state:{"minor-mode":d},attribution:{kind:`minor`,mode:d}},name:f,label:`List Workflows`,description:`List workflow definitions available in this repository.`,parameters:c.z.toJSONSchema(x.listWorkflowsTool.getInputSchema()),executionMode:`serial`,async execute(e,t,n){return n?.throwIfAborted(),h(await x.listWorkflowsTool.execute(t))}},{when:{state:{"minor-mode":d},attribution:{kind:`minor`,mode:d}},name:p,label:`Launch Workflow`,description:`Start a workflow run and return its recorded launch result.`,parameters:c.z.toJSONSchema(x.runTool.getInputSchema()),executionMode:`serial`,async execute(e,t,n){return n?.throwIfAborted(),h(await x.runTool.execute(t))}},{when:{state:{"minor-mode":d},attribution:{kind:`minor`,mode:d}},name:m,label:`Workflow Run`,description:`Inspect the status of a workflow run or request cooperative control.`,parameters:{type:`object`,properties:{action:{type:`string`,enum:[`status`,`pause`,`resume`,`stop`]},runKey:{type:`string`,minLength:1},workspace:{type:`string`},reason:{type:`string`},expectedRunId:{type:`string`}},required:[`action`,`runKey`],additionalProperties:!1},executionMode:`serial`,async execute(e,t,n){n?.throwIfAborted();let r=t,o=a.readWorkflowRuns({environment:g.context.environment}).filter(e=>i.runBelongsToSession(e,g.context.sessionId)&&e.view.runKey===r.runKey&&(r.workspace===void 0||e.view.workspace===r.workspace));if(o.length!==1)return{...h({error:o.length===0?`Workflow run was not found in this session.`:`Specify the workspace for this run key.`}),isError:!0};let s=o[0].view;return r.action===`status`?h(s):S?typeof r.expectedRunId!=`string`||r.expectedRunId.length===0?h({error:`expectedRunId is required for workflow control.`}):h(r.action===`pause`?await S.pause(r.runKey,r.expectedRunId,r.workspace,r.reason):r.action===`resume`?await S.resume(r.runKey,r.expectedRunId,r.workspace):await S.stop(r.runKey,r.expectedRunId,r.workspace,r.reason)):h({error:`Workflow activity is not active.`})}}],commands:[{when:{state:{"minor-mode":d},attribution:{kind:`minor`,mode:d}},name:`workflow-launch`,description:`Launch a workflow from a slash command.`,async execute(t,n){let r=e.parseWorkflowLaunchCommand(t);if(`error`in r){await n.client.notify({body:r.error,level:`error`});return}let i=h(await x.runTool.execute({workflowPath:r.workflow,...r.runner===void 0?{}:{runner:r.runner},...Object.keys(r.inputs).length===0?{}:{inputs:r.inputs},...r.prompt===void 0?{}:{prompt:r.prompt}})).content.find(e=>e.type===`text`);await n.client.notify({body:i?.type===`text`?i.text:`Workflow launch requested.`,level:`info`})}}],onDispose(){S?.dispose(),S=void 0}}}exports.createWorkflowServerRuntime=g;
2
- //# sourceMappingURL=serverRuntime.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serverRuntime.cjs","names":["createWorkflowCatalogReader","defaultCatalogDeps","presentWorkflowRuns","readWorkflowRuns","runBelongsToSession","WORKFLOW_RUNS_TYPE","WORKFLOW_CATALOG_TYPE","presentWorkflowCatalog","createEmbeddedWorkflowFeature","defineMinorMode","serverMinorModes","skill","z","parseWorkflowLaunchCommand"],"sources":["../../../src/controllers/serverRuntime.ts"],"sourcesContent":["import {\n type DoomHeadlessExecutionContext,\n type DoomHeadlessContent,\n type DoomHeadlessToolResult,\n} from '@agimon-ai/doompi-core/headless';\nimport { serverMinorModes } from '@agimon-ai/doompi-minor-mode';\nimport { defineMinorMode, type MinorModeOwner, type MinorModeState } from '@agimon-ai/doompi-minor-mode';\nimport { createEmbeddedWorkflowFeature } from '@agimon-ai/workflow-mcp';\nimport { z } from 'zod';\n\nimport { createWorkflowCatalogReader, presentWorkflowCatalog } from '../services/webWorkflowCatalog';\nimport { defaultCatalogDeps } from '../services/workflowCatalogDeps';\nimport { parseWorkflowLaunchCommand } from '../services/workflowLaunchCommand';\nimport { readWorkflowSkill as skill } from '../services/workflowResource';\nimport { presentWorkflowRuns, runBelongsToSession } from '../services/workflowRuns';\nimport { readWorkflowRuns } from '../services/workflowWatcher';\nimport { WORKFLOW_CATALOG_TYPE, WORKFLOW_RUNS_TYPE } from '../types/webWorkflows';\n\nconst SOURCE = '@agimon-ai/doompi-workflow';\nconst WORKFLOW_MODE_ID = 'workflow';\nconst LIST_TOOL = 'list_workflows';\nconst LAUNCH_TOOL = 'launch_workflow';\nconst RUN_TOOL = 'workflow_run';\n\nfunction callResult(value: unknown): DoomHeadlessToolResult {\n const content: DoomHeadlessContent[] = [];\n if (typeof value === 'object' && value !== null && 'content' in value && Array.isArray(value.content)) {\n for (const item of value.content) {\n if (typeof item !== 'object' || item === null || !('type' in item)) continue;\n const record = item as Record<string, unknown>;\n if (record.type === 'text' && typeof record.text === 'string') content.push({ type: 'text', text: record.text });\n else if (record.type === 'image' && typeof record.data === 'string' && typeof record.mimeType === 'string') {\n content.push({ type: 'image', data: record.data, mimeType: record.mimeType });\n }\n }\n }\n if (content.length === 0) content.push({ type: 'text', text: JSON.stringify(value, null, 2) });\n return { content, details: value };\n}\n\nimport { type DoomHeadlessHostService } from '@agimon-ai/doompi-core/headless';\nimport { type DoomServerHostService, type DoomServerSessionPlugin } from '@agimon-ai/doompi-core/server-facet';\nexport function createWorkflowServerRuntime(\n host: DoomHeadlessHostService,\n serverHost: DoomServerHostService,\n): DoomServerSessionPlugin {\n if (serverHost.context.directEvents === undefined)\n throw new Error('Workflow headless facet requires the session direct event bus.');\n const directEvents = serverHost.context.directEvents;\n const catalogReader = createWorkflowCatalogReader(defaultCatalogDeps());\n const publishLifecycle = async (executionContext: typeof host.context): Promise<void> => {\n const runs = presentWorkflowRuns(\n readWorkflowRuns({ environment: executionContext.environment })\n .filter((run) => runBelongsToSession(run, executionContext.sessionId))\n .map((run) => run.view),\n Date.now(),\n );\n directEvents.publish(WORKFLOW_RUNS_TYPE, executionContext.sessionId, { runs });\n try {\n directEvents.publish(WORKFLOW_CATALOG_TYPE, executionContext.sessionId, {\n cwd: executionContext.cwd,\n workflows: presentWorkflowCatalog(await catalogReader.read(executionContext.cwd)),\n });\n } catch (error) {\n const warning = error instanceof Error ? error.message : String(error);\n directEvents.publish(WORKFLOW_CATALOG_TYPE, executionContext.sessionId, {\n cwd: executionContext.cwd,\n workflows: [],\n warning,\n });\n }\n };\n const feature = createEmbeddedWorkflowFeature();\n let control: ReturnType<typeof feature.createRunControl> | undefined;\n let modeOwner: MinorModeOwner | undefined;\n const modeSelected = (): boolean => (host.context.selection.state?.['minor-mode'] ?? []).includes(WORKFLOW_MODE_ID);\n const modeState = (): MinorModeState => {\n const active = modeSelected();\n return {\n activation: active ? 'active' : 'inactive',\n condition: 'ready',\n ...(active ? { detail: 'workflow tools available' } : {}),\n actions: [\n { id: 'activate', enabled: !active, ...(!active ? {} : { disabledReason: 'Workflow mode is active.' }) },\n { id: 'deactivate', enabled: active, ...(active ? {} : { disabledReason: 'Workflow mode is inactive.' }) },\n ],\n };\n };\n const selectMode = async (enabled: boolean): Promise<void> => {\n const modes = (host.context.selection.state?.['minor-mode'] ?? []).filter((mode) => mode !== WORKFLOW_MODE_ID);\n await host.changeSelection({\n axis: 'state',\n key: 'minor-mode',\n values: enabled ? [...modes, WORKFLOW_MODE_ID] : modes,\n });\n modeOwner?.publish();\n };\n modeOwner = defineMinorMode({\n descriptor: {\n source: SOURCE,\n id: WORKFLOW_MODE_ID,\n label: 'Workflow',\n description: 'Workflow discovery, launch, inspection, control, and recovery tools.',\n order: 20,\n actions: [\n {\n id: 'activate',\n label: 'Activate',\n description: 'Enable workflow tools for this session.',\n contexts: ['headless'],\n parameters: [],\n },\n {\n id: 'deactivate',\n label: 'Deactivate',\n description: 'Disable workflow tools without stopping active runs.',\n contexts: ['headless'],\n parameters: [],\n },\n ],\n },\n state: modeState,\n async handleAction(_runtime, actionId, _argumentsValue, execution) {\n execution.signal.throwIfAborted();\n if (actionId === 'activate') {\n await selectMode(true);\n return { message: 'Workflow mode activated.' };\n }\n if (actionId === 'deactivate') {\n await selectMode(false);\n return { message: 'Workflow mode deactivated.' };\n }\n throw new Error(`Unknown workflow mode action: ${actionId}`);\n },\n }).createOwner(undefined);\n return {\n services: [serverMinorModes([modeOwner])],\n toolRestrictions: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID } },\n allowedTools: [LIST_TOOL, LAUNCH_TOOL, RUN_TOOL],\n },\n ],\n hooks: [\n {\n event: 'tool_execution_end',\n handle: async (_event, executionContext) => {\n await publishLifecycle(executionContext);\n },\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n event: 'session_shutdown',\n handle: () => {\n control?.dispose();\n control = undefined;\n },\n },\n ],\n resources: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: 'doompi-author-workflow',\n kind: 'skill',\n read: () => skill('doompi-author-workflow'),\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: 'doompi-use-workflow',\n kind: 'skill',\n read: () => skill('doompi-use-workflow'),\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: 'workflow-recovery',\n kind: 'skill',\n read: () => skill('workflow-recovery'),\n },\n ],\n activities: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: SOURCE,\n async start(executionContext) {\n control = feature.createRunControl({});\n await control.start();\n await publishLifecycle(executionContext);\n return () => {\n control?.dispose();\n control = undefined;\n };\n },\n },\n ],\n tools: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: LIST_TOOL,\n label: 'List Workflows',\n description: 'List workflow definitions available in this repository.',\n parameters: z.toJSONSchema(feature.listWorkflowsTool.getInputSchema()),\n executionMode: 'serial',\n async execute(_toolCallId, parameters, signal) {\n signal?.throwIfAborted();\n return callResult(\n await feature.listWorkflowsTool.execute(\n parameters as Parameters<typeof feature.listWorkflowsTool.execute>[0],\n ),\n );\n },\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: LAUNCH_TOOL,\n label: 'Launch Workflow',\n description: 'Start a workflow run and return its recorded launch result.',\n parameters: z.toJSONSchema(feature.runTool.getInputSchema()),\n executionMode: 'serial',\n async execute(_toolCallId, parameters, signal) {\n signal?.throwIfAborted();\n return callResult(await feature.runTool.execute(parameters as Parameters<typeof feature.runTool.execute>[0]));\n },\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: RUN_TOOL,\n label: 'Workflow Run',\n description: 'Inspect the status of a workflow run or request cooperative control.',\n parameters: {\n type: 'object',\n properties: {\n action: { type: 'string', enum: ['status', 'pause', 'resume', 'stop'] },\n runKey: { type: 'string', minLength: 1 },\n workspace: { type: 'string' },\n reason: { type: 'string' },\n expectedRunId: { type: 'string' },\n },\n required: ['action', 'runKey'],\n additionalProperties: false,\n },\n executionMode: 'serial',\n async execute(_toolCallId, parameters, signal) {\n signal?.throwIfAborted();\n const input = parameters as unknown as {\n action: 'status' | 'pause' | 'resume' | 'stop';\n runKey: string;\n workspace?: string;\n reason?: string;\n expectedRunId?: string;\n };\n const runs = readWorkflowRuns({ environment: host.context.environment }).filter(\n (run) =>\n runBelongsToSession(run, host.context.sessionId) &&\n run.view.runKey === input.runKey &&\n (input.workspace === undefined || run.view.workspace === input.workspace),\n );\n if (runs.length !== 1)\n return {\n ...callResult({\n error:\n runs.length === 0\n ? 'Workflow run was not found in this session.'\n : 'Specify the workspace for this run key.',\n }),\n isError: true,\n };\n const run = runs[0]!.view;\n if (input.action === 'status') return callResult(run);\n if (!control) return callResult({ error: 'Workflow activity is not active.' });\n if (typeof input.expectedRunId !== 'string' || input.expectedRunId.length === 0) {\n return callResult({ error: 'expectedRunId is required for workflow control.' });\n }\n const request =\n input.action === 'pause'\n ? await control.pause(input.runKey, input.expectedRunId, input.workspace, input.reason)\n : input.action === 'resume'\n ? await control.resume(input.runKey, input.expectedRunId, input.workspace)\n : await control.stop(input.runKey, input.expectedRunId, input.workspace, input.reason);\n return callResult(request);\n },\n },\n ],\n commands: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: 'workflow-launch',\n description: 'Launch a workflow from a slash command.',\n async execute(args: string, execution: DoomHeadlessExecutionContext) {\n const parsed = parseWorkflowLaunchCommand(args);\n if ('error' in parsed) {\n await execution.client.notify({ body: parsed.error, level: 'error' });\n return;\n }\n const result = await feature.runTool.execute({\n workflowPath: parsed.workflow,\n ...(parsed.runner === undefined ? {} : { runner: parsed.runner }),\n ...(Object.keys(parsed.inputs).length === 0 ? {} : { inputs: parsed.inputs }),\n ...(parsed.prompt === undefined ? {} : { prompt: parsed.prompt }),\n });\n const rendered = callResult(result).content.find((entry) => entry.type === 'text');\n await execution.client.notify({\n body: rendered?.type === 'text' ? rendered.text : 'Workflow launch requested.',\n level: 'info',\n });\n },\n },\n ],\n onDispose() {\n control?.dispose();\n control = undefined;\n },\n };\n}\n"],"mappings":"8cAkBA,MAAM,EAAS,6BACT,EAAmB,WACnB,EAAY,iBACZ,EAAc,kBACd,EAAW,eAEjB,SAAS,EAAW,EAAwC,CAC1D,IAAM,EAAiC,CAAC,EACxC,GAAI,OAAO,GAAU,UAAY,GAAkB,YAAa,GAAS,MAAM,QAAQ,EAAM,OAAO,EAClG,IAAK,IAAM,KAAQ,EAAM,QAAS,CAChC,GAAI,OAAO,GAAS,WAAY,GAAiB,EAAE,SAAU,GAAO,SACpE,IAAM,EAAS,EACX,EAAO,OAAS,QAAU,OAAO,EAAO,MAAS,SAAU,EAAQ,KAAK,CAAE,KAAM,OAAQ,KAAM,EAAO,IAAK,CAAC,EACtG,EAAO,OAAS,SAAW,OAAO,EAAO,MAAS,UAAY,OAAO,EAAO,UAAa,UAChG,EAAQ,KAAK,CAAE,KAAM,QAAS,KAAM,EAAO,KAAM,SAAU,EAAO,QAAS,CAAC,CAEhF,CAGF,OADI,EAAQ,SAAW,GAAG,EAAQ,KAAK,CAAE,KAAM,OAAQ,KAAM,KAAK,UAAU,EAAO,KAAM,CAAC,CAAE,CAAC,EACtF,CAAE,UAAS,QAAS,CAAM,CACnC,CAIA,SAAgB,EACd,EACA,EACyB,CACzB,GAAI,EAAW,QAAQ,eAAiB,IAAA,GACtC,MAAU,MAAM,gEAAgE,EAClF,IAAM,EAAe,EAAW,QAAQ,aAClC,EAAgBA,EAAAA,4BAA4BC,EAAAA,mBAAmB,CAAC,EAChE,EAAmB,KAAO,IAAyD,CACvF,IAAM,EAAOC,EAAAA,oBACXC,EAAAA,iBAAiB,CAAE,YAAa,EAAiB,WAAY,CAAC,CAAC,CAC5D,OAAQ,GAAQC,EAAAA,oBAAoB,EAAK,EAAiB,SAAS,CAAC,CAAC,CACrE,IAAK,GAAQ,E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M,cAAe,EAAM,SAAS,EACvE,MAAM,EAAQ,KAAK,EAAM,OAAQ,EAAM,cAAe,EAAM,UAAW,EAAM,MAAM,CAClE,EAVJ,EAAW,CAAE,MAAO,kCAAmC,CAAC,CAW/E,CACF,CACF,EACA,SAAU,CACR,CACE,KAAM,CAAE,MAAO,CAAE,aAAc,CAAiB,EAAG,YAAa,CAAE,KAAM,QAAS,KAAM,CAAiB,CAAE,EAC1G,KAAM,kBACN,YAAa,0CACb,MAAM,QAAQ,EAAc,EAAyC,CACnE,IAAM,EAASS,EAAAA,2BAA2B,CAAI,EAC9C,GAAI,UAAW,EAAQ,CACrB,MAAM,EAAU,OAAO,OAAO,CAAE,KAAM,EAAO,MAAO,MAAO,OAAQ,CAAC,EACpE,MACF,CAOA,IAAM,EAAW,EAAW,MANP,EAAQ,QAAQ,QAAQ,CAC3C,aAAc,EAAO,SACrB,GAAI,EAAO,SAAW,IAAA,GAAY,CAAC,EAAI,CAAE,OAAQ,EAAO,MAAO,EAC/D,GAAI,OAAO,KAAK,EAAO,MAAM,CAAC,CAAC,SAAW,EAAI,CAAC,EAAI,CAAE,OAAQ,EAAO,MAAO,EAC3E,GAAI,EAAO,SAAW,IAAA,GAAY,CAAC,EAAI,CAAE,OAAQ,EAAO,MAAO,CACjE,CAAC,CACiC,CAAC,CAAC,QAAQ,KAAM,GAAU,EAAM,OAAS,MAAM,EACjF,MAAM,EAAU,OAAO,OAAO,CAC5B,KAAM,GAAU,OAAS,OAAS,EAAS,KAAO,6BAClD,MAAO,MACT,CAAC,CACH,CACF,CACF,EACA,WAAY,CACV,GAAS,QAAQ,EACjB,EAAU,IAAA,EACZ,CACF,CACF"}
@@ -1,2 +0,0 @@
1
- import{parseWorkflowLaunchCommand as e}from"../services/workflowLaunchCommand/index.mjs";import{readWorkflowSkill as t}from"../services/workflowResource/index.mjs";import{createWorkflowCatalogReader as n,presentWorkflowCatalog as r}from"../services/webWorkflowCatalog/index.mjs";import{defaultCatalogDeps as i}from"../services/workflowCatalogDeps/index.mjs";import{presentWorkflowRuns as a,runBelongsToSession as o}from"../services/workflowRuns/index.mjs";import{readWorkflowRuns as s}from"../services/workflowWatcher/index.mjs";import{WORKFLOW_CATALOG_TYPE as c,WORKFLOW_RUNS_TYPE as l}from"../types/webWorkflows.mjs";import{createEmbeddedWorkflowFeature as u}from"@agimon-ai/workflow-mcp";import{z as d}from"zod";import{defineMinorMode as f,serverMinorModes as p}from"@agimon-ai/doompi-minor-mode";const m=`@agimon-ai/doompi-workflow`,h=`workflow`,g=`list_workflows`,_=`launch_workflow`,v=`workflow_run`;function y(e){let t=[];if(typeof e==`object`&&e&&`content`in e&&Array.isArray(e.content))for(let n of e.content){if(typeof n!=`object`||!n||!(`type`in n))continue;let e=n;e.type===`text`&&typeof e.text==`string`?t.push({type:`text`,text:e.text}):e.type===`image`&&typeof e.data==`string`&&typeof e.mimeType==`string`&&t.push({type:`image`,data:e.data,mimeType:e.mimeType})}return t.length===0&&t.push({type:`text`,text:JSON.stringify(e,null,2)}),{content:t,details:e}}function b(b,x){if(x.context.directEvents===void 0)throw Error(`Workflow headless facet requires the session direct event bus.`);let S=x.context.directEvents,C=n(i()),w=async e=>{let t=a(s({environment:e.environment}).filter(t=>o(t,e.sessionId)).map(e=>e.view),Date.now());S.publish(l,e.sessionId,{runs:t});try{S.publish(c,e.sessionId,{cwd:e.cwd,workflows:r(await C.read(e.cwd))})}catch(t){let n=t instanceof Error?t.message:String(t);S.publish(c,e.sessionId,{cwd:e.cwd,workflows:[],warning:n})}},T=u(),E,D,O=()=>(b.context.selection.state?.[`minor-mode`]??[]).includes(h),k=()=>{let e=O();return{activation:e?`active`:`inactive`,condition:`ready`,...e?{detail:`workflow tools available`}:{},actions:[{id:`activate`,enabled:!e,...e?{disabledReason:`Workflow mode is active.`}:{}},{id:`deactivate`,enabled:e,...e?{}:{disabledReason:`Workflow mode is inactive.`}}]}},A=async e=>{let t=(b.context.selection.state?.[`minor-mode`]??[]).filter(e=>e!==h);await b.changeSelection({axis:`state`,key:`minor-mode`,values:e?[...t,h]:t}),D?.publish()};return D=f({descriptor:{source:m,id:h,label:`Workflow`,description:`Workflow discovery, launch, inspection, control, and recovery tools.`,order:20,actions:[{id:`activate`,label:`Activate`,description:`Enable workflow tools for this session.`,contexts:[`headless`],parameters:[]},{id:`deactivate`,label:`Deactivate`,description:`Disable workflow tools without stopping active runs.`,contexts:[`headless`],parameters:[]}]},state:k,async handleAction(e,t,n,r){if(r.signal.throwIfAborted(),t===`activate`)return await A(!0),{message:`Workflow mode activated.`};if(t===`deactivate`)return await A(!1),{message:`Workflow mode deactivated.`};throw Error(`Unknown workflow mode action: ${t}`)}}).createOwner(void 0),{services:[p([D])],toolRestrictions:[{when:{state:{"minor-mode":h}},allowedTools:[g,_,v]}],hooks:[{event:`tool_execution_end`,handle:async(e,t)=>{await w(t)}},{when:{state:{"minor-mode":h},attribution:{kind:`minor`,mode:h}},event:`session_shutdown`,handle:()=>{E?.dispose(),E=void 0}}],resources:[{when:{state:{"minor-mode":h},attribution:{kind:`minor`,mode:h}},name:`doompi-author-workflow`,kind:`skill`,read:()=>t(`doompi-author-workflow`)},{when:{state:{"minor-mode":h},attribution:{kind:`minor`,mode:h}},name:`doompi-use-workflow`,kind:`skill`,read:()=>t(`doompi-use-workflow`)},{when:{state:{"minor-mode":h},attribution:{kind:`minor`,mode:h}},name:`workflow-recovery`,kind:`skill`,read:()=>t(`workflow-recovery`)}],activities:[{when:{state:{"minor-mode":h},attribution:{kind:`minor`,mode:h}},name:m,async start(e){return E=T.createRunControl({}),await E.start(),await w(e),()=>{E?.dispose(),E=void 0}}}],tools:[{when:{state:{"minor-mode":h},attribution:{kind:`minor`,mode:h}},name:g,label:`List Workflows`,description:`List workflow definitions available in this repository.`,parameters:d.toJSONSchema(T.listWorkflowsTool.getInputSchema()),executionMode:`serial`,async execute(e,t,n){return n?.throwIfAborted(),y(await T.listWorkflowsTool.execute(t))}},{when:{state:{"minor-mode":h},attribution:{kind:`minor`,mode:h}},name:_,label:`Launch Workflow`,description:`Start a workflow run and return its recorded launch result.`,parameters:d.toJSONSchema(T.runTool.getInputSchema()),executionMode:`serial`,async execute(e,t,n){return n?.throwIfAborted(),y(await T.runTool.execute(t))}},{when:{state:{"minor-mode":h},attribution:{kind:`minor`,mode:h}},name:v,label:`Workflow Run`,description:`Inspect the status of a workflow run or request cooperative control.`,parameters:{type:`object`,properties:{action:{type:`string`,enum:[`status`,`pause`,`resume`,`stop`]},runKey:{type:`string`,minLength:1},workspace:{type:`string`},reason:{type:`string`},expectedRunId:{type:`string`}},required:[`action`,`runKey`],additionalProperties:!1},executionMode:`serial`,async execute(e,t,n){n?.throwIfAborted();let r=t,i=s({environment:b.context.environment}).filter(e=>o(e,b.context.sessionId)&&e.view.runKey===r.runKey&&(r.workspace===void 0||e.view.workspace===r.workspace));if(i.length!==1)return{...y({error:i.length===0?`Workflow run was not found in this session.`:`Specify the workspace for this run key.`}),isError:!0};let a=i[0].view;return r.action===`status`?y(a):E?typeof r.expectedRunId!=`string`||r.expectedRunId.length===0?y({error:`expectedRunId is required for workflow control.`}):y(r.action===`pause`?await E.pause(r.runKey,r.expectedRunId,r.workspace,r.reason):r.action===`resume`?await E.resume(r.runKey,r.expectedRunId,r.workspace):await E.stop(r.runKey,r.expectedRunId,r.workspace,r.reason)):y({error:`Workflow activity is not active.`})}}],commands:[{when:{state:{"minor-mode":h},attribution:{kind:`minor`,mode:h}},name:`workflow-launch`,description:`Launch a workflow from a slash command.`,async execute(t,n){let r=e(t);if(`error`in r){await n.client.notify({body:r.error,level:`error`});return}let i=y(await T.runTool.execute({workflowPath:r.workflow,...r.runner===void 0?{}:{runner:r.runner},...Object.keys(r.inputs).length===0?{}:{inputs:r.inputs},...r.prompt===void 0?{}:{prompt:r.prompt}})).content.find(e=>e.type===`text`);await n.client.notify({body:i?.type===`text`?i.text:`Workflow launch requested.`,level:`info`})}}],onDispose(){E?.dispose(),E=void 0}}}export{b as createWorkflowServerRuntime};
2
- //# sourceMappingURL=serverRuntime.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serverRuntime.mjs","names":["skill"],"sources":["../../../src/controllers/serverRuntime.ts"],"sourcesContent":["import {\n type DoomHeadlessExecutionContext,\n type DoomHeadlessContent,\n type DoomHeadlessToolResult,\n} from '@agimon-ai/doompi-core/headless';\nimport { serverMinorModes } from '@agimon-ai/doompi-minor-mode';\nimport { defineMinorMode, type MinorModeOwner, type MinorModeState } from '@agimon-ai/doompi-minor-mode';\nimport { createEmbeddedWorkflowFeature } from '@agimon-ai/workflow-mcp';\nimport { z } from 'zod';\n\nimport { createWorkflowCatalogReader, presentWorkflowCatalog } from '../services/webWorkflowCatalog';\nimport { defaultCatalogDeps } from '../services/workflowCatalogDeps';\nimport { parseWorkflowLaunchCommand } from '../services/workflowLaunchCommand';\nimport { readWorkflowSkill as skill } from '../services/workflowResource';\nimport { presentWorkflowRuns, runBelongsToSession } from '../services/workflowRuns';\nimport { readWorkflowRuns } from '../services/workflowWatcher';\nimport { WORKFLOW_CATALOG_TYPE, WORKFLOW_RUNS_TYPE } from '../types/webWorkflows';\n\nconst SOURCE = '@agimon-ai/doompi-workflow';\nconst WORKFLOW_MODE_ID = 'workflow';\nconst LIST_TOOL = 'list_workflows';\nconst LAUNCH_TOOL = 'launch_workflow';\nconst RUN_TOOL = 'workflow_run';\n\nfunction callResult(value: unknown): DoomHeadlessToolResult {\n const content: DoomHeadlessContent[] = [];\n if (typeof value === 'object' && value !== null && 'content' in value && Array.isArray(value.content)) {\n for (const item of value.content) {\n if (typeof item !== 'object' || item === null || !('type' in item)) continue;\n const record = item as Record<string, unknown>;\n if (record.type === 'text' && typeof record.text === 'string') content.push({ type: 'text', text: record.text });\n else if (record.type === 'image' && typeof record.data === 'string' && typeof record.mimeType === 'string') {\n content.push({ type: 'image', data: record.data, mimeType: record.mimeType });\n }\n }\n }\n if (content.length === 0) content.push({ type: 'text', text: JSON.stringify(value, null, 2) });\n return { content, details: value };\n}\n\nimport { type DoomHeadlessHostService } from '@agimon-ai/doompi-core/headless';\nimport { type DoomServerHostService, type DoomServerSessionPlugin } from '@agimon-ai/doompi-core/server-facet';\nexport function createWorkflowServerRuntime(\n host: DoomHeadlessHostService,\n serverHost: DoomServerHostService,\n): DoomServerSessionPlugin {\n if (serverHost.context.directEvents === undefined)\n throw new Error('Workflow headless facet requires the session direct event bus.');\n const directEvents = serverHost.context.directEvents;\n const catalogReader = createWorkflowCatalogReader(defaultCatalogDeps());\n const publishLifecycle = async (executionContext: typeof host.context): Promise<void> => {\n const runs = presentWorkflowRuns(\n readWorkflowRuns({ environment: executionContext.environment })\n .filter((run) => runBelongsToSession(run, executionContext.sessionId))\n .map((run) => run.view),\n Date.now(),\n );\n directEvents.publish(WORKFLOW_RUNS_TYPE, executionContext.sessionId, { runs });\n try {\n directEvents.publish(WORKFLOW_CATALOG_TYPE, executionContext.sessionId, {\n cwd: executionContext.cwd,\n workflows: presentWorkflowCatalog(await catalogReader.read(executionContext.cwd)),\n });\n } catch (error) {\n const warning = error instanceof Error ? error.message : String(error);\n directEvents.publish(WORKFLOW_CATALOG_TYPE, executionContext.sessionId, {\n cwd: executionContext.cwd,\n workflows: [],\n warning,\n });\n }\n };\n const feature = createEmbeddedWorkflowFeature();\n let control: ReturnType<typeof feature.createRunControl> | undefined;\n let modeOwner: MinorModeOwner | undefined;\n const modeSelected = (): boolean => (host.context.selection.state?.['minor-mode'] ?? []).includes(WORKFLOW_MODE_ID);\n const modeState = (): MinorModeState => {\n const active = modeSelected();\n return {\n activation: active ? 'active' : 'inactive',\n condition: 'ready',\n ...(active ? { detail: 'workflow tools available' } : {}),\n actions: [\n { id: 'activate', enabled: !active, ...(!active ? {} : { disabledReason: 'Workflow mode is active.' }) },\n { id: 'deactivate', enabled: active, ...(active ? {} : { disabledReason: 'Workflow mode is inactive.' }) },\n ],\n };\n };\n const selectMode = async (enabled: boolean): Promise<void> => {\n const modes = (host.context.selection.state?.['minor-mode'] ?? []).filter((mode) => mode !== WORKFLOW_MODE_ID);\n await host.changeSelection({\n axis: 'state',\n key: 'minor-mode',\n values: enabled ? [...modes, WORKFLOW_MODE_ID] : modes,\n });\n modeOwner?.publish();\n };\n modeOwner = defineMinorMode({\n descriptor: {\n source: SOURCE,\n id: WORKFLOW_MODE_ID,\n label: 'Workflow',\n description: 'Workflow discovery, launch, inspection, control, and recovery tools.',\n order: 20,\n actions: [\n {\n id: 'activate',\n label: 'Activate',\n description: 'Enable workflow tools for this session.',\n contexts: ['headless'],\n parameters: [],\n },\n {\n id: 'deactivate',\n label: 'Deactivate',\n description: 'Disable workflow tools without stopping active runs.',\n contexts: ['headless'],\n parameters: [],\n },\n ],\n },\n state: modeState,\n async handleAction(_runtime, actionId, _argumentsValue, execution) {\n execution.signal.throwIfAborted();\n if (actionId === 'activate') {\n await selectMode(true);\n return { message: 'Workflow mode activated.' };\n }\n if (actionId === 'deactivate') {\n await selectMode(false);\n return { message: 'Workflow mode deactivated.' };\n }\n throw new Error(`Unknown workflow mode action: ${actionId}`);\n },\n }).createOwner(undefined);\n return {\n services: [serverMinorModes([modeOwner])],\n toolRestrictions: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID } },\n allowedTools: [LIST_TOOL, LAUNCH_TOOL, RUN_TOOL],\n },\n ],\n hooks: [\n {\n event: 'tool_execution_end',\n handle: async (_event, executionContext) => {\n await publishLifecycle(executionContext);\n },\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n event: 'session_shutdown',\n handle: () => {\n control?.dispose();\n control = undefined;\n },\n },\n ],\n resources: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: 'doompi-author-workflow',\n kind: 'skill',\n read: () => skill('doompi-author-workflow'),\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: 'doompi-use-workflow',\n kind: 'skill',\n read: () => skill('doompi-use-workflow'),\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: 'workflow-recovery',\n kind: 'skill',\n read: () => skill('workflow-recovery'),\n },\n ],\n activities: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: SOURCE,\n async start(executionContext) {\n control = feature.createRunControl({});\n await control.start();\n await publishLifecycle(executionContext);\n return () => {\n control?.dispose();\n control = undefined;\n };\n },\n },\n ],\n tools: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: LIST_TOOL,\n label: 'List Workflows',\n description: 'List workflow definitions available in this repository.',\n parameters: z.toJSONSchema(feature.listWorkflowsTool.getInputSchema()),\n executionMode: 'serial',\n async execute(_toolCallId, parameters, signal) {\n signal?.throwIfAborted();\n return callResult(\n await feature.listWorkflowsTool.execute(\n parameters as Parameters<typeof feature.listWorkflowsTool.execute>[0],\n ),\n );\n },\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: LAUNCH_TOOL,\n label: 'Launch Workflow',\n description: 'Start a workflow run and return its recorded launch result.',\n parameters: z.toJSONSchema(feature.runTool.getInputSchema()),\n executionMode: 'serial',\n async execute(_toolCallId, parameters, signal) {\n signal?.throwIfAborted();\n return callResult(await feature.runTool.execute(parameters as Parameters<typeof feature.runTool.execute>[0]));\n },\n },\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: RUN_TOOL,\n label: 'Workflow Run',\n description: 'Inspect the status of a workflow run or request cooperative control.',\n parameters: {\n type: 'object',\n properties: {\n action: { type: 'string', enum: ['status', 'pause', 'resume', 'stop'] },\n runKey: { type: 'string', minLength: 1 },\n workspace: { type: 'string' },\n reason: { type: 'string' },\n expectedRunId: { type: 'string' },\n },\n required: ['action', 'runKey'],\n additionalProperties: false,\n },\n executionMode: 'serial',\n async execute(_toolCallId, parameters, signal) {\n signal?.throwIfAborted();\n const input = parameters as unknown as {\n action: 'status' | 'pause' | 'resume' | 'stop';\n runKey: string;\n workspace?: string;\n reason?: string;\n expectedRunId?: string;\n };\n const runs = readWorkflowRuns({ environment: host.context.environment }).filter(\n (run) =>\n runBelongsToSession(run, host.context.sessionId) &&\n run.view.runKey === input.runKey &&\n (input.workspace === undefined || run.view.workspace === input.workspace),\n );\n if (runs.length !== 1)\n return {\n ...callResult({\n error:\n runs.length === 0\n ? 'Workflow run was not found in this session.'\n : 'Specify the workspace for this run key.',\n }),\n isError: true,\n };\n const run = runs[0]!.view;\n if (input.action === 'status') return callResult(run);\n if (!control) return callResult({ error: 'Workflow activity is not active.' });\n if (typeof input.expectedRunId !== 'string' || input.expectedRunId.length === 0) {\n return callResult({ error: 'expectedRunId is required for workflow control.' });\n }\n const request =\n input.action === 'pause'\n ? await control.pause(input.runKey, input.expectedRunId, input.workspace, input.reason)\n : input.action === 'resume'\n ? await control.resume(input.runKey, input.expectedRunId, input.workspace)\n : await control.stop(input.runKey, input.expectedRunId, input.workspace, input.reason);\n return callResult(request);\n },\n },\n ],\n commands: [\n {\n when: { state: { 'minor-mode': WORKFLOW_MODE_ID }, attribution: { kind: 'minor', mode: WORKFLOW_MODE_ID } },\n name: 'workflow-launch',\n description: 'Launch a workflow from a slash command.',\n async execute(args: string, execution: DoomHeadlessExecutionContext) {\n const parsed = parseWorkflowLaunchCommand(args);\n if ('error' in parsed) {\n await execution.client.notify({ body: parsed.error, level: 'error' });\n return;\n }\n const result = await feature.runTool.execute({\n workflowPath: parsed.workflow,\n ...(parsed.runner === undefined ? {} : { runner: parsed.runner }),\n ...(Object.keys(parsed.inputs).length === 0 ? {} : { inputs: parsed.inputs }),\n ...(parsed.prompt === undefined ? {} : { prompt: parsed.prompt }),\n });\n const rendered = callResult(result).content.find((entry) => entry.type === 'text');\n await execution.client.notify({\n body: rendered?.type === 'text' ? rendered.text : 'Workflow launch requested.',\n level: 'info',\n });\n },\n },\n ],\n onDispose() {\n control?.dispose();\n control = undefined;\n },\n };\n}\n"],"mappings":"gyBAkBA,MAAM,EAAS,6BACT,EAAmB,WACnB,EAAY,iBACZ,EAAc,kBACd,EAAW,eAEjB,SAAS,EAAW,EAAwC,CAC1D,IAAM,EAAiC,CAAC,EACxC,GAAI,OAAO,GAAU,UAAY,GAAkB,YAAa,GAAS,MAAM,QAAQ,EAAM,OAAO,EAClG,IAAK,IAAM,KAAQ,EAAM,QAAS,CAChC,GAAI,OAAO,GAAS,WAAY,GAAiB,EAAE,SAAU,GAAO,SACpE,IAAM,EAAS,EACX,EAAO,OAAS,QAAU,OAAO,EAAO,MAAS,SAAU,EAAQ,KAAK,CAAE,KAAM,OAAQ,KAAM,EAAO,IAAK,CAAC,EACtG,EAAO,OAAS,SAAW,OAAO,EAAO,MAAS,UAAY,OAAO,EAAO,UAAa,UAChG,EAAQ,KAAK,CAAE,KAAM,QAAS,KAAM,EAAO,KAAM,SAAU,EAAO,QAAS,CAAC,CAEhF,CAGF,OADI,EAAQ,SAAW,GAAG,EAAQ,KAAK,CAAE,KAAM,OAAQ,KAAM,KAAK,UAAU,EAAO,KAAM,CAAC,CAAE,CAAC,EACtF,CAAE,UAAS,QAAS,CAAM,CACnC,CAIA,SAAgB,EACd,EACA,EACyB,CACzB,GAAI,EAAW,QAAQ,eAAiB,IAAA,GACtC,MAAU,MAAM,gEAAgE,EAClF,IAAM,EAAe,EAAW,QAAQ,aAClC,EAAgB,EAA4B,EAAmB,CAAC,EAChE,EAAmB,KAAO,IAAyD,CACvF,IAAM,EAAO,EACX,EAAiB,CAAE,YAAa,EAAiB,WAAY,CAAC,CAAC,CAC5D,OAAQ,GAAQ,EAAoB,EAAK,EAAiB,SAAS,CAAC,CAAC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