@hotmeshio/long-tail 0.1.14 → 0.1.16

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 (360) hide show
  1. package/README.md +15 -0
  2. package/build/api/escalations/bulk.d.ts +78 -0
  3. package/build/api/escalations/bulk.js +279 -0
  4. package/build/api/escalations/claim.d.ts +30 -0
  5. package/build/api/escalations/claim.js +121 -0
  6. package/build/api/escalations/create.d.ts +29 -0
  7. package/build/api/escalations/create.js +101 -0
  8. package/build/api/escalations/helpers.d.ts +10 -0
  9. package/build/api/escalations/helpers.js +80 -0
  10. package/build/api/escalations/index.d.ts +6 -0
  11. package/build/api/escalations/index.js +26 -0
  12. package/build/api/escalations/list.d.ts +75 -0
  13. package/build/api/escalations/list.js +170 -0
  14. package/build/api/escalations/resolve.d.ts +18 -0
  15. package/build/api/escalations/resolve.js +243 -0
  16. package/build/api/escalations/single.d.ts +37 -0
  17. package/build/api/escalations/single.js +123 -0
  18. package/build/api/files.d.ts +3 -0
  19. package/build/api/files.js +18 -1
  20. package/build/api/knowledge.d.ts +36 -0
  21. package/build/api/knowledge.js +112 -0
  22. package/build/api/mcp/index.d.ts +2 -0
  23. package/build/api/mcp/index.js +16 -0
  24. package/build/api/{mcp.d.ts → mcp/servers.d.ts} +1 -33
  25. package/build/api/{mcp.js → mcp/servers.js} +4 -65
  26. package/build/api/mcp/tools.d.ts +33 -0
  27. package/build/api/mcp/tools.js +64 -0
  28. package/build/api/settings.js +6 -1
  29. package/build/api/workflows/config.d.ts +64 -0
  30. package/build/api/workflows/config.js +142 -0
  31. package/build/api/workflows/discovery.d.ts +29 -0
  32. package/build/api/workflows/discovery.js +153 -0
  33. package/build/api/workflows/index.d.ts +3 -0
  34. package/build/api/workflows/index.js +18 -0
  35. package/build/api/workflows/invocation.d.ts +67 -0
  36. package/build/api/workflows/invocation.js +188 -0
  37. package/build/api/yaml-workflows/cron.d.ts +39 -0
  38. package/build/api/yaml-workflows/cron.js +127 -0
  39. package/build/api/{yaml-workflows.d.ts → yaml-workflows/crud.d.ts} +22 -146
  40. package/build/api/{yaml-workflows.js → yaml-workflows/crud.js} +99 -380
  41. package/build/api/yaml-workflows/deploy.d.ts +71 -0
  42. package/build/api/yaml-workflows/deploy.js +223 -0
  43. package/build/api/yaml-workflows/helpers.d.ts +2 -0
  44. package/build/api/yaml-workflows/helpers.js +8 -0
  45. package/build/api/yaml-workflows/index.d.ts +4 -0
  46. package/build/api/yaml-workflows/index.js +27 -0
  47. package/build/api/yaml-workflows/versions.d.ts +43 -0
  48. package/build/api/yaml-workflows/versions.js +124 -0
  49. package/build/bin/ltc.d.ts +2 -0
  50. package/build/bin/ltc.js +220 -0
  51. package/build/examples/seed-data.d.ts +55 -0
  52. package/build/examples/seed-data.js +161 -0
  53. package/build/examples/seed.js +7 -164
  54. package/build/index.d.ts +1 -1
  55. package/build/lib/cli/auth.d.ts +23 -0
  56. package/build/lib/cli/auth.js +167 -0
  57. package/build/lib/cli/client.d.ts +6 -0
  58. package/build/lib/cli/client.js +31 -0
  59. package/build/lib/cli/commands/escalations.d.ts +19 -0
  60. package/build/lib/cli/commands/escalations.js +69 -0
  61. package/build/lib/cli/commands/knowledge.d.ts +18 -0
  62. package/build/lib/cli/commands/knowledge.js +87 -0
  63. package/build/lib/cli/commands/mcp.d.ts +8 -0
  64. package/build/lib/cli/commands/mcp.js +33 -0
  65. package/build/lib/cli/commands/pipelines.d.ts +16 -0
  66. package/build/lib/cli/commands/pipelines.js +67 -0
  67. package/build/lib/cli/commands/status.d.ts +1 -0
  68. package/build/lib/cli/commands/status.js +28 -0
  69. package/build/lib/cli/commands/users.d.ts +7 -0
  70. package/build/lib/cli/commands/users.js +25 -0
  71. package/build/lib/cli/commands/workflows.d.ts +16 -0
  72. package/build/lib/cli/commands/workflows.js +104 -0
  73. package/build/lib/cli/compile.d.ts +2 -0
  74. package/build/lib/cli/compile.js +165 -0
  75. package/build/lib/cli/format.d.ts +23 -0
  76. package/build/lib/cli/format.js +94 -0
  77. package/build/lib/cli/init.d.ts +1 -0
  78. package/build/lib/cli/init.js +61 -0
  79. package/build/lib/cli/output.d.ts +27 -0
  80. package/build/lib/cli/output.js +126 -0
  81. package/build/lib/cli/scanner.d.ts +10 -0
  82. package/build/lib/cli/scanner.js +164 -0
  83. package/build/lib/cli/types.d.ts +16 -0
  84. package/build/lib/cli/types.js +2 -0
  85. package/build/lib/db/schemas/schemas/001_schema.sql +485 -0
  86. package/build/lib/db/schemas/schemas/002_seed.sql +92 -0
  87. package/build/lib/events/socketio.d.ts +12 -0
  88. package/build/lib/events/socketio.js +24 -1
  89. package/build/lib/logger/index.d.ts +0 -9
  90. package/build/lib/logger/index.js +9 -4
  91. package/build/lib/storage/index.js +2 -2
  92. package/build/routes/file-browser.js +14 -0
  93. package/build/routes/index.js +4 -0
  94. package/build/routes/knowledge.d.ts +2 -0
  95. package/build/routes/knowledge.js +141 -0
  96. package/build/routes/nats-credentials.d.ts +2 -0
  97. package/build/routes/nats-credentials.js +22 -0
  98. package/build/routes/yaml-workflows/crud.js +9 -0
  99. package/build/sdk/index.d.ts +17 -0
  100. package/build/sdk/index.js +19 -0
  101. package/build/services/mcp/client/connection-dispatch.d.ts +18 -0
  102. package/build/services/mcp/client/connection-dispatch.js +78 -0
  103. package/build/services/mcp/client/connection-lifecycle.d.ts +48 -0
  104. package/build/services/mcp/client/connection-lifecycle.js +296 -0
  105. package/build/services/mcp/client/connection-test.d.ts +10 -0
  106. package/build/services/mcp/client/connection-test.js +49 -0
  107. package/build/services/mcp/client/connection.d.ts +3 -68
  108. package/build/services/mcp/client/connection.js +15 -393
  109. package/build/services/mcp/server-lifecycle.d.ts +27 -0
  110. package/build/services/mcp/server-lifecycle.js +49 -0
  111. package/build/services/mcp/server-tools.d.ts +13 -0
  112. package/build/services/mcp/server-tools.js +287 -0
  113. package/build/services/mcp/server.d.ts +2 -26
  114. package/build/services/mcp/server.js +7 -315
  115. package/build/services/yaml-workflow/builder-regenerate.d.ts +25 -0
  116. package/build/services/yaml-workflow/builder-regenerate.js +111 -0
  117. package/build/services/yaml-workflow/db-versions.d.ts +17 -0
  118. package/build/services/yaml-workflow/db-versions.js +76 -0
  119. package/build/services/yaml-workflow/db.d.ts +3 -13
  120. package/build/services/yaml-workflow/db.js +15 -71
  121. package/build/services/yaml-workflow/deployer-helpers.js +48 -17
  122. package/build/services/yaml-workflow/durable-compiler/index.d.ts +22 -0
  123. package/build/services/yaml-workflow/durable-compiler/index.js +168 -0
  124. package/build/services/yaml-workflow/durable-compiler/parser.d.ts +12 -0
  125. package/build/services/yaml-workflow/durable-compiler/parser.js +110 -0
  126. package/build/services/yaml-workflow/durable-compiler/prompts.d.ts +18 -0
  127. package/build/services/yaml-workflow/durable-compiler/prompts.js +570 -0
  128. package/build/services/yaml-workflow/durable-compiler/types.d.ts +51 -0
  129. package/build/services/yaml-workflow/durable-compiler/types.js +5 -0
  130. package/build/services/yaml-workflow/pipeline/build/dag-assembly.d.ts +17 -0
  131. package/build/services/yaml-workflow/pipeline/build/dag-assembly.js +192 -0
  132. package/build/services/yaml-workflow/pipeline/build/dag.d.ts +4 -13
  133. package/build/services/yaml-workflow/pipeline/build/dag.js +9 -185
  134. package/build/services/yaml-workflow/pipeline/prompt-templates.d.ts +10 -0
  135. package/build/services/yaml-workflow/pipeline/prompt-templates.js +270 -0
  136. package/build/services/yaml-workflow/pipeline/prompts.d.ts +3 -6
  137. package/build/services/yaml-workflow/pipeline/prompts.js +8 -263
  138. package/build/services/yaml-workflow/workers/register.js +4 -2
  139. package/build/start/adapters.js +4 -1
  140. package/build/start/socket-auth.d.ts +13 -0
  141. package/build/start/socket-auth.js +32 -0
  142. package/build/start/workers.js +6 -5
  143. package/build/system/activities/file-storage.d.ts +4 -0
  144. package/build/system/activities/file-storage.js +7 -1
  145. package/build/system/activities/knowledge.d.ts +23 -0
  146. package/build/system/activities/knowledge.js +50 -10
  147. package/build/system/activities/sql.d.ts +3 -0
  148. package/build/system/activities/sql.js +25 -1
  149. package/build/system/mcp-servers/file-storage.js +3 -1
  150. package/build/system/mcp-servers/human-queue-schemas.d.ts +91 -0
  151. package/build/system/mcp-servers/human-queue-schemas.js +42 -0
  152. package/build/system/mcp-servers/human-queue.d.ts +2 -6
  153. package/build/system/mcp-servers/human-queue.js +9 -51
  154. package/build/system/mcp-servers/knowledge.js +43 -9
  155. package/build/system/mcp-servers/workflow-compiler.js +54 -0
  156. package/build/system/workflows/mcp-triage/activities-proxy.d.ts +21 -0
  157. package/build/system/workflows/mcp-triage/activities-proxy.js +70 -0
  158. package/build/system/workflows/mcp-triage/index.js +17 -75
  159. package/build/system/workflows/mcp-workflow-planner/activities/persist.d.ts +1 -0
  160. package/build/system/workflows/mcp-workflow-planner/activities/persist.js +1 -0
  161. package/build/system/workflows/mcp-workflow-planner/index.js +2 -0
  162. package/build/tsconfig.tsbuildinfo +1 -1
  163. package/dashboard/dist/assets/{AdminDashboard-Cngijp4Q.js → AdminDashboard-Bprul9Eb.js} +2 -2
  164. package/dashboard/dist/assets/{AdminDashboard-Cngijp4Q.js.map → AdminDashboard-Bprul9Eb.js.map} +1 -1
  165. package/dashboard/dist/assets/AvailableEscalationsPage-H_z5mC10.js +2 -0
  166. package/dashboard/dist/assets/AvailableEscalationsPage-H_z5mC10.js.map +1 -0
  167. package/dashboard/dist/assets/{BotPicker-B8Uvw9Si.js → BotPicker-DcvILNUf.js} +2 -2
  168. package/dashboard/dist/assets/{BotPicker-B8Uvw9Si.js.map → BotPicker-DcvILNUf.js.map} +1 -1
  169. package/dashboard/dist/assets/{CollapsibleSection-DiFPuWOY.js → CollapsibleSection-BWPbzgEe.js} +2 -2
  170. package/dashboard/dist/assets/{CollapsibleSection-DiFPuWOY.js.map → CollapsibleSection-BWPbzgEe.js.map} +1 -1
  171. package/dashboard/dist/assets/{ConfirmDeleteModal-CpXG9uyu.js → ConfirmDeleteModal-Cy6KVLfC.js} +2 -2
  172. package/dashboard/dist/assets/{ConfirmDeleteModal-CpXG9uyu.js.map → ConfirmDeleteModal-Cy6KVLfC.js.map} +1 -1
  173. package/dashboard/dist/assets/{CopyableId-DKsTR9lK.js → CopyableId-CRED8hvk.js} +2 -2
  174. package/dashboard/dist/assets/{CopyableId-DKsTR9lK.js.map → CopyableId-CRED8hvk.js.map} +1 -1
  175. package/dashboard/dist/assets/{CredentialsPage-DlS7Kf40.js → CredentialsPage-BUdvxiE3.js} +2 -2
  176. package/dashboard/dist/assets/{CredentialsPage-DlS7Kf40.js.map → CredentialsPage-BUdvxiE3.js.map} +1 -1
  177. package/dashboard/dist/assets/{CustomDurationPicker-B-9eW3pm.js → CustomDurationPicker-eOk2EqQ5.js} +2 -2
  178. package/dashboard/dist/assets/{CustomDurationPicker-B-9eW3pm.js.map → CustomDurationPicker-eOk2EqQ5.js.map} +1 -1
  179. package/dashboard/dist/assets/{DataTable-DkOokbtL.js → DataTable-bd2PTBJd.js} +2 -2
  180. package/dashboard/dist/assets/{DataTable-DkOokbtL.js.map → DataTable-bd2PTBJd.js.map} +1 -1
  181. package/dashboard/dist/assets/{ElapsedCell-DVtHqM-5.js → ElapsedCell-BGo8vyus.js} +2 -2
  182. package/dashboard/dist/assets/{ElapsedCell-DVtHqM-5.js.map → ElapsedCell-BGo8vyus.js.map} +1 -1
  183. package/dashboard/dist/assets/{EmptyState-C7KIMIbE.js → EmptyState-BygtU-Rh.js} +2 -2
  184. package/dashboard/dist/assets/{EmptyState-C7KIMIbE.js.map → EmptyState-BygtU-Rh.js.map} +1 -1
  185. package/dashboard/dist/assets/{EscalationsOverview-BMKBlkPx.js → EscalationsOverview-DUEcN5MP.js} +2 -2
  186. package/dashboard/dist/assets/{EscalationsOverview-BMKBlkPx.js.map → EscalationsOverview-DUEcN5MP.js.map} +1 -1
  187. package/dashboard/dist/assets/{EventTable-BYZ5OVdQ.js → EventTable-CmFhswLW.js} +2 -2
  188. package/dashboard/dist/assets/{EventTable-BYZ5OVdQ.js.map → EventTable-CmFhswLW.js.map} +1 -1
  189. package/dashboard/dist/assets/{FilterBar-C5r3n6YO.js → FilterBar-BQNzsd3A.js} +2 -2
  190. package/dashboard/dist/assets/{FilterBar-C5r3n6YO.js.map → FilterBar-BQNzsd3A.js.map} +1 -1
  191. package/dashboard/dist/assets/{ListToolbar-BGUajIsW.js → ListToolbar-OWOn-HiC.js} +2 -2
  192. package/dashboard/dist/assets/{ListToolbar-BGUajIsW.js.map → ListToolbar-OWOn-HiC.js.map} +1 -1
  193. package/dashboard/dist/assets/{McpOverview-B_kJYHea.js → McpOverview-OkEzvClD.js} +2 -2
  194. package/dashboard/dist/assets/{McpOverview-B_kJYHea.js.map → McpOverview-OkEzvClD.js.map} +1 -1
  195. package/dashboard/dist/assets/McpQueryDetailPage-C6Ih5sC_.js +5 -0
  196. package/dashboard/dist/assets/McpQueryDetailPage-C6Ih5sC_.js.map +1 -0
  197. package/dashboard/dist/assets/{McpQueryPage-BgAq_bQg.js → McpQueryPage-BAuOf5TL.js} +2 -2
  198. package/dashboard/dist/assets/{McpQueryPage-BgAq_bQg.js.map → McpQueryPage-BAuOf5TL.js.map} +1 -1
  199. package/dashboard/dist/assets/{McpRunDetailPage-B8c0OszR.js → McpRunDetailPage-DMeiG4i_.js} +2 -2
  200. package/dashboard/dist/assets/{McpRunDetailPage-B8c0OszR.js.map → McpRunDetailPage-DMeiG4i_.js.map} +1 -1
  201. package/dashboard/dist/assets/{McpRunsPage-BY8C6k78.js → McpRunsPage-CG3cNJh8.js} +2 -2
  202. package/dashboard/dist/assets/{McpRunsPage-BY8C6k78.js.map → McpRunsPage-CG3cNJh8.js.map} +1 -1
  203. package/dashboard/dist/assets/{Modal-E1yRnCeW.js → Modal-Dir9Rlnx.js} +2 -2
  204. package/dashboard/dist/assets/{Modal-E1yRnCeW.js.map → Modal-Dir9Rlnx.js.map} +1 -1
  205. package/dashboard/dist/assets/{OperatorDashboard-C8MSTzey.js → OperatorDashboard-OqWC6Azy.js} +2 -2
  206. package/dashboard/dist/assets/{OperatorDashboard-C8MSTzey.js.map → OperatorDashboard-OqWC6Azy.js.map} +1 -1
  207. package/dashboard/dist/assets/{PageHeader-Cm5HBQF_.js → PageHeader-FJIemmrC.js} +2 -2
  208. package/dashboard/dist/assets/{PageHeader-Cm5HBQF_.js.map → PageHeader-FJIemmrC.js.map} +1 -1
  209. package/dashboard/dist/assets/{PageHeaderWithStats-CNmWJFSN.js → PageHeaderWithStats-Br5y9qNO.js} +2 -2
  210. package/dashboard/dist/assets/{PageHeaderWithStats-CNmWJFSN.js.map → PageHeaderWithStats-Br5y9qNO.js.map} +1 -1
  211. package/dashboard/dist/assets/{PriorityBadge-HSI4RVhs.js → PriorityBadge-C7D5d_HY.js} +2 -2
  212. package/dashboard/dist/assets/{PriorityBadge-HSI4RVhs.js.map → PriorityBadge-C7D5d_HY.js.map} +1 -1
  213. package/dashboard/dist/assets/{ProcessDetailPage-Dln8622H.js → ProcessDetailPage-DZIP6grw.js} +2 -2
  214. package/dashboard/dist/assets/{ProcessDetailPage-Dln8622H.js.map → ProcessDetailPage-DZIP6grw.js.map} +1 -1
  215. package/dashboard/dist/assets/{ProcessesListPage-bIsd9N_h.js → ProcessesListPage-BQoPYkeB.js} +2 -2
  216. package/dashboard/dist/assets/{ProcessesListPage-bIsd9N_h.js.map → ProcessesListPage-BQoPYkeB.js.map} +1 -1
  217. package/dashboard/dist/assets/{RolePill-BVUp2bF0.js → RolePill-D6nMxMvp.js} +2 -2
  218. package/dashboard/dist/assets/{RolePill-BVUp2bF0.js.map → RolePill-D6nMxMvp.js.map} +1 -1
  219. package/dashboard/dist/assets/RolesPage-CwLnJFhy.js +2 -0
  220. package/dashboard/dist/assets/{RolesPage-kH-Njt25.js.map → RolesPage-CwLnJFhy.js.map} +1 -1
  221. package/dashboard/dist/assets/{RowActions-DbUJPfaW.js → RowActions-JqgAB0p3.js} +2 -2
  222. package/dashboard/dist/assets/{RowActions-DbUJPfaW.js.map → RowActions-JqgAB0p3.js.map} +1 -1
  223. package/dashboard/dist/assets/RunAsSelector-KAlKtitB.js +2 -0
  224. package/dashboard/dist/assets/RunAsSelector-KAlKtitB.js.map +1 -0
  225. package/dashboard/dist/assets/{StatCard-Bs3JbyAz.js → StatCard-B-WLhOaH.js} +2 -2
  226. package/dashboard/dist/assets/{StatCard-Bs3JbyAz.js.map → StatCard-B-WLhOaH.js.map} +1 -1
  227. package/dashboard/dist/assets/{StatusBadge-CakDdsCw.js → StatusBadge-DVCf2ncM.js} +2 -2
  228. package/dashboard/dist/assets/{StatusBadge-CakDdsCw.js.map → StatusBadge-DVCf2ncM.js.map} +1 -1
  229. package/dashboard/dist/assets/{StepIndicator-Cd_SG_yA.js → StepIndicator-D9Xvdf18.js} +2 -2
  230. package/dashboard/dist/assets/{StepIndicator-Cd_SG_yA.js.map → StepIndicator-D9Xvdf18.js.map} +1 -1
  231. package/dashboard/dist/assets/{StickyPagination-Bz0C18nC.js → StickyPagination-CJHMzYJj.js} +2 -2
  232. package/dashboard/dist/assets/{StickyPagination-Bz0C18nC.js.map → StickyPagination-CJHMzYJj.js.map} +1 -1
  233. package/dashboard/dist/assets/SwimlaneTimeline-YiXPDyEL.js +2 -0
  234. package/dashboard/dist/assets/SwimlaneTimeline-YiXPDyEL.js.map +1 -0
  235. package/dashboard/dist/assets/{TagInput-ClFhXG-U.js → TagInput-DcPnUnSJ.js} +2 -2
  236. package/dashboard/dist/assets/{TagInput-ClFhXG-U.js.map → TagInput-DcPnUnSJ.js.map} +1 -1
  237. package/dashboard/dist/assets/{TaskDetailPage-SuMBdARt.js → TaskDetailPage-DftmYWD7.js} +2 -2
  238. package/dashboard/dist/assets/{TaskDetailPage-SuMBdARt.js.map → TaskDetailPage-DftmYWD7.js.map} +1 -1
  239. package/dashboard/dist/assets/{TaskQueuePill-lJR1JW_W.js → TaskQueuePill-BzduBqwy.js} +2 -2
  240. package/dashboard/dist/assets/{TaskQueuePill-lJR1JW_W.js.map → TaskQueuePill-BzduBqwy.js.map} +1 -1
  241. package/dashboard/dist/assets/{TasksListPage-Dkq1Vtbt.js → TasksListPage-DeewV4Gp.js} +2 -2
  242. package/dashboard/dist/assets/{TasksListPage-Dkq1Vtbt.js.map → TasksListPage-DeewV4Gp.js.map} +1 -1
  243. package/dashboard/dist/assets/{TimeAgo-DgfDZ1pl.js → TimeAgo-DJZq-e4R.js} +2 -2
  244. package/dashboard/dist/assets/{TimeAgo-DgfDZ1pl.js.map → TimeAgo-DJZq-e4R.js.map} +1 -1
  245. package/dashboard/dist/assets/{TimestampCell-MpHZ1hMD.js → TimestampCell-Dx5uwGfS.js} +2 -2
  246. package/dashboard/dist/assets/{TimestampCell-MpHZ1hMD.js.map → TimestampCell-Dx5uwGfS.js.map} +1 -1
  247. package/dashboard/dist/assets/{UserName-DqsosA4B.js → UserName-CnGk7MgL.js} +2 -2
  248. package/dashboard/dist/assets/{UserName-DqsosA4B.js.map → UserName-CnGk7MgL.js.map} +1 -1
  249. package/dashboard/dist/assets/{WorkflowExecutionPage-CVlg38C3.js → WorkflowExecutionPage-CPQ0fIwf.js} +2 -2
  250. package/dashboard/dist/assets/{WorkflowExecutionPage-CVlg38C3.js.map → WorkflowExecutionPage-CPQ0fIwf.js.map} +1 -1
  251. package/dashboard/dist/assets/{WorkflowPill-CRpZhjGR.js → WorkflowPill-BrD5d1AG.js} +2 -2
  252. package/dashboard/dist/assets/{WorkflowPill-CRpZhjGR.js.map → WorkflowPill-BrD5d1AG.js.map} +1 -1
  253. package/dashboard/dist/assets/{WorkflowsDashboard-Ugzbs8mV.js → WorkflowsDashboard-BzjhABZP.js} +2 -2
  254. package/dashboard/dist/assets/{WorkflowsDashboard-Ugzbs8mV.js.map → WorkflowsDashboard-BzjhABZP.js.map} +1 -1
  255. package/dashboard/dist/assets/{WorkflowsOverview-CIp_lTNl.js → WorkflowsOverview-lBp2E6rN.js} +2 -2
  256. package/dashboard/dist/assets/{WorkflowsOverview-CIp_lTNl.js.map → WorkflowsOverview-lBp2E6rN.js.map} +1 -1
  257. package/dashboard/dist/assets/YamlWorkflowsPage-C_MkAp2i.js +2 -0
  258. package/dashboard/dist/assets/YamlWorkflowsPage-C_MkAp2i.js.map +1 -0
  259. package/dashboard/dist/assets/{bots-DPfUpVqI.js → bots-fc_O_YIq.js} +2 -2
  260. package/dashboard/dist/assets/{bots-DPfUpVqI.js.map → bots-fc_O_YIq.js.map} +1 -1
  261. package/dashboard/dist/assets/{escalation-RrCDbMC3.js → escalation-BYhLYHBz.js} +2 -2
  262. package/dashboard/dist/assets/{escalation-RrCDbMC3.js.map → escalation-BYhLYHBz.js.map} +1 -1
  263. package/dashboard/dist/assets/{escalation-columns-CDGa9wsD.js → escalation-columns-DjJyuC1g.js} +2 -2
  264. package/dashboard/dist/assets/{escalation-columns-CDGa9wsD.js.map → escalation-columns-DjJyuC1g.js.map} +1 -1
  265. package/dashboard/dist/assets/{helpers-ZSKqdkdS.js → helpers-CQG3Rh2y.js} +2 -2
  266. package/dashboard/dist/assets/{helpers-ZSKqdkdS.js.map → helpers-CQG3Rh2y.js.map} +1 -1
  267. package/dashboard/dist/assets/{index-DX6zxr6t.js → index-2nBhR7Dg.js} +2 -2
  268. package/dashboard/dist/assets/{index-DX6zxr6t.js.map → index-2nBhR7Dg.js.map} +1 -1
  269. package/dashboard/dist/assets/index-4IUoh_hd.js +2 -0
  270. package/dashboard/dist/assets/{index-K40Qw1tk.js.map → index-4IUoh_hd.js.map} +1 -1
  271. package/dashboard/dist/assets/index-B2CqPzLK.js +2 -0
  272. package/dashboard/dist/assets/index-B2CqPzLK.js.map +1 -0
  273. package/dashboard/dist/assets/index-B78xalb4.js +2 -0
  274. package/dashboard/dist/assets/index-B78xalb4.js.map +1 -0
  275. package/dashboard/dist/assets/index-BI8r69O_.js +2 -0
  276. package/dashboard/dist/assets/{index-C90ZPzXk.js.map → index-BI8r69O_.js.map} +1 -1
  277. package/dashboard/dist/assets/index-C5TUqJu0.css +1 -0
  278. package/dashboard/dist/assets/{index-BmVCyB6C.js → index-CUqCBBZG.js} +2 -2
  279. package/dashboard/dist/assets/{index-BmVCyB6C.js.map → index-CUqCBBZG.js.map} +1 -1
  280. package/dashboard/dist/assets/index-D51PaQZY.js +2 -0
  281. package/dashboard/dist/assets/index-D51PaQZY.js.map +1 -0
  282. package/dashboard/dist/assets/{index-BbI2dzhJ.js → index-DNtXXy1o.js} +2 -2
  283. package/dashboard/dist/assets/{index-BbI2dzhJ.js.map → index-DNtXXy1o.js.map} +1 -1
  284. package/dashboard/dist/assets/{index-DNytWfSZ.js → index-DR4qQvlW.js} +2 -2
  285. package/dashboard/dist/assets/{index-DNytWfSZ.js.map → index-DR4qQvlW.js.map} +1 -1
  286. package/dashboard/dist/assets/index-Dh0PCbR-.js +15 -0
  287. package/dashboard/dist/assets/index-Dh0PCbR-.js.map +1 -0
  288. package/dashboard/dist/assets/index-KYpLvJKB.js +5 -0
  289. package/dashboard/dist/assets/index-KYpLvJKB.js.map +1 -0
  290. package/dashboard/dist/assets/{index-Cmgrk7PQ.js → index-sNrqYt0Q.js} +73 -73
  291. package/dashboard/dist/assets/index-sNrqYt0Q.js.map +1 -0
  292. package/dashboard/dist/assets/{mcp-CNE44TSp.js → mcp-D2XfRh8v.js} +2 -2
  293. package/dashboard/dist/assets/{mcp-CNE44TSp.js.map → mcp-D2XfRh8v.js.map} +1 -1
  294. package/dashboard/dist/assets/{mcp-query-RQX0uN-5.js → mcp-query-CIx_mIC7.js} +2 -2
  295. package/dashboard/dist/assets/{mcp-query-RQX0uN-5.js.map → mcp-query-CIx_mIC7.js.map} +1 -1
  296. package/dashboard/dist/assets/{mcp-runs-0w40bdz-.js → mcp-runs-C9_J4LIH.js} +2 -2
  297. package/dashboard/dist/assets/{mcp-runs-0w40bdz-.js.map → mcp-runs-C9_J4LIH.js.map} +1 -1
  298. package/dashboard/dist/assets/{namespaces-BbmdXuPp.js → namespaces-BwMljx6f.js} +2 -2
  299. package/dashboard/dist/assets/{namespaces-BbmdXuPp.js.map → namespaces-BwMljx6f.js.map} +1 -1
  300. package/dashboard/dist/assets/{roles-DoHYlhWH.js → roles-Bd_sTV6I.js} +2 -2
  301. package/dashboard/dist/assets/{roles-DoHYlhWH.js.map → roles-Bd_sTV6I.js.map} +1 -1
  302. package/dashboard/dist/assets/{settings-BAiJiCHS.js → settings-BCb8eFyA.js} +2 -2
  303. package/dashboard/dist/assets/{settings-BAiJiCHS.js.map → settings-BCb8eFyA.js.map} +1 -1
  304. package/dashboard/dist/assets/{tasks-CvroqHtm.js → tasks-Bq54qGGq.js} +2 -2
  305. package/dashboard/dist/assets/{tasks-CvroqHtm.js.map → tasks-Bq54qGGq.js.map} +1 -1
  306. package/dashboard/dist/assets/useEventHooks-BTbGf536.js +2 -0
  307. package/dashboard/dist/assets/{useEventHooks-BHMbzR_y.js.map → useEventHooks-BTbGf536.js.map} +1 -1
  308. package/dashboard/dist/assets/useYamlActivityEvents-CsYP09W5.js +2 -0
  309. package/dashboard/dist/assets/{useYamlActivityEvents-D56KV14X.js.map → useYamlActivityEvents-CsYP09W5.js.map} +1 -1
  310. package/dashboard/dist/assets/{users-CxIMy_xw.js → users-BTBhafGc.js} +2 -2
  311. package/dashboard/dist/assets/{users-CxIMy_xw.js.map → users-BTBhafGc.js.map} +1 -1
  312. package/dashboard/dist/assets/{vendor-icons-AFGxSeQS.js → vendor-icons-CWl44VA6.js} +77 -77
  313. package/dashboard/dist/assets/vendor-icons-CWl44VA6.js.map +1 -0
  314. package/dashboard/dist/assets/{workflows-yR9yais7.js → workflows-BkzA4ahe.js} +2 -2
  315. package/dashboard/dist/assets/{workflows-yR9yais7.js.map → workflows-BkzA4ahe.js.map} +1 -1
  316. package/dashboard/dist/assets/{yaml-workflows-QVF2MZ0l.js → yaml-workflows-Cs0EYp0F.js} +2 -2
  317. package/dashboard/dist/assets/{yaml-workflows-QVF2MZ0l.js.map → yaml-workflows-Cs0EYp0F.js.map} +1 -1
  318. package/dashboard/dist/index.html +3 -3
  319. package/docs/api/http/file-browser.md +101 -0
  320. package/docs/api/http/knowledge.md +203 -0
  321. package/docs/api/http/settings.md +6 -4
  322. package/docs/api/sdk/files.md +68 -0
  323. package/docs/api/sdk/knowledge.md +126 -0
  324. package/docs/api/sdk/settings.md +3 -2
  325. package/docs/cli.md +171 -0
  326. package/docs/compilation.md +16 -0
  327. package/docs/compiler.md +311 -0
  328. package/docs/events.md +19 -0
  329. package/docs/workflows.md +19 -0
  330. package/package.json +13 -2
  331. package/build/api/escalations.d.ts +0 -271
  332. package/build/api/escalations.js +0 -932
  333. package/build/api/workflows.d.ts +0 -158
  334. package/build/api/workflows.js +0 -414
  335. package/dashboard/dist/assets/AvailableEscalationsPage-CpBfGV1h.js +0 -2
  336. package/dashboard/dist/assets/AvailableEscalationsPage-CpBfGV1h.js.map +0 -1
  337. package/dashboard/dist/assets/McpQueryDetailPage-Czsmovqw.js +0 -5
  338. package/dashboard/dist/assets/McpQueryDetailPage-Czsmovqw.js.map +0 -1
  339. package/dashboard/dist/assets/RolesPage-kH-Njt25.js +0 -2
  340. package/dashboard/dist/assets/SwimlaneTimeline-Cfe-xQRX.js +0 -2
  341. package/dashboard/dist/assets/SwimlaneTimeline-Cfe-xQRX.js.map +0 -1
  342. package/dashboard/dist/assets/YamlWorkflowsPage-BICF0fRO.js +0 -2
  343. package/dashboard/dist/assets/YamlWorkflowsPage-BICF0fRO.js.map +0 -1
  344. package/dashboard/dist/assets/helpers-rMEcLwKs.js +0 -2
  345. package/dashboard/dist/assets/helpers-rMEcLwKs.js.map +0 -1
  346. package/dashboard/dist/assets/index-ABcJHHlN.js +0 -5
  347. package/dashboard/dist/assets/index-ABcJHHlN.js.map +0 -1
  348. package/dashboard/dist/assets/index-B91h_jZ0.js +0 -15
  349. package/dashboard/dist/assets/index-B91h_jZ0.js.map +0 -1
  350. package/dashboard/dist/assets/index-C1E5GTs9.js +0 -2
  351. package/dashboard/dist/assets/index-C1E5GTs9.js.map +0 -1
  352. package/dashboard/dist/assets/index-C90ZPzXk.js +0 -2
  353. package/dashboard/dist/assets/index-Cmgrk7PQ.js.map +0 -1
  354. package/dashboard/dist/assets/index-DeX-ezqf.css +0 -1
  355. package/dashboard/dist/assets/index-K40Qw1tk.js +0 -2
  356. package/dashboard/dist/assets/index-lCyNr5Xk.js +0 -2
  357. package/dashboard/dist/assets/index-lCyNr5Xk.js.map +0 -1
  358. package/dashboard/dist/assets/useEventHooks-BHMbzR_y.js +0 -2
  359. package/dashboard/dist/assets/useYamlActivityEvents-D56KV14X.js +0 -2
  360. package/dashboard/dist/assets/vendor-icons-AFGxSeQS.js.map +0 -1
@@ -41,33 +41,31 @@ exports.getYamlWorkflow = getYamlWorkflow;
41
41
  exports.updateYamlWorkflow = updateYamlWorkflow;
42
42
  exports.regenerateYamlWorkflow = regenerateYamlWorkflow;
43
43
  exports.deleteYamlWorkflow = deleteYamlWorkflow;
44
- exports.deployYamlWorkflow = deployYamlWorkflow;
45
- exports.activateYamlWorkflow = activateYamlWorkflow;
46
- exports.invokeYamlWorkflow = invokeYamlWorkflow;
47
- exports.archiveYamlWorkflow = archiveYamlWorkflow;
48
- exports.restoreYamlWorkflow = restoreYamlWorkflow;
49
- exports.getVersionHistory = getVersionHistory;
50
- exports.getVersionSnapshot = getVersionSnapshot;
51
- exports.getYamlContent = getYamlContent;
52
- exports.setCronSchedule = setCronSchedule;
53
- exports.clearCronSchedule = clearCronSchedule;
54
- exports.getCronStatus = getCronStatus;
55
- const yamlDb = __importStar(require("../services/yaml-workflow/db"));
56
- const yamlGenerator = __importStar(require("../services/yaml-workflow/generator"));
57
- const yamlDeployer = __importStar(require("../services/yaml-workflow/deployer"));
58
- const yamlWorkers = __importStar(require("../services/yaml-workflow/workers"));
59
- const invoke_1 = require("../services/yaml-workflow/invoke");
60
- const task_1 = require("../services/task");
61
- const cron_1 = require("../services/cron");
62
- const utils_1 = require("../modules/utils");
63
- /** Return true if a Postgres error indicates an invalid/missing ID */
64
- function isNotFoundError(err) {
65
- const msg = err?.message ?? '';
66
- return msg.includes('invalid input syntax for type uuid') || msg.includes('not found');
44
+ exports.createYamlWorkflowFromDurable = createYamlWorkflowFromDurable;
45
+ const yamlDb = __importStar(require("../../services/yaml-workflow/db"));
46
+ const yamlGenerator = __importStar(require("../../services/yaml-workflow/generator"));
47
+ const durable_compiler_1 = require("../../services/yaml-workflow/durable-compiler");
48
+ const builder_regenerate_1 = require("../../services/yaml-workflow/builder-regenerate");
49
+ const task_1 = require("../../services/task");
50
+ const utils_1 = require("../../modules/utils");
51
+ const helpers_1 = require("./helpers");
52
+ /**
53
+ * Strip the qualified `{slug}__` prefix from mcp_tool_name entries.
54
+ * The builder LLM sometimes echoes the qualified name (e.g.
55
+ * "long_tail_playwright_cli__capture_page") instead of the short
56
+ * tool name ("capture_page"). MCP servers register tools by short
57
+ * name, so the qualified form fails at runtime.
58
+ */
59
+ function normalizeManifestToolNames(manifest) {
60
+ if (!manifest)
61
+ return manifest;
62
+ for (const entry of manifest) {
63
+ if (entry.mcp_tool_name?.includes('__')) {
64
+ entry.mcp_tool_name = entry.mcp_tool_name.slice(entry.mcp_tool_name.indexOf('__') + 2);
65
+ }
66
+ }
67
+ return manifest;
67
68
  }
68
- // ---------------------------------------------------------------------------
69
- // CRUD
70
- // ---------------------------------------------------------------------------
71
69
  /**
72
70
  * List YAML workflows with optional filtering and pagination.
73
71
  *
@@ -98,7 +96,7 @@ async function listYamlWorkflows(input) {
98
96
  return { status: 200, data: result };
99
97
  }
100
98
  catch (err) {
101
- if (isNotFoundError(err)) {
99
+ if ((0, helpers_1.isNotFoundError)(err)) {
102
100
  return { status: 404, error: 'YAML workflow not found' };
103
101
  }
104
102
  return { status: 500, error: err.message };
@@ -176,7 +174,7 @@ async function createYamlWorkflow(input) {
176
174
  graph_topic: result.graphTopic,
177
175
  input_schema: result.inputSchema,
178
176
  output_schema: result.outputSchema,
179
- activity_manifest: result.activityManifest,
177
+ activity_manifest: normalizeManifestToolNames(result.activityManifest),
180
178
  tags: mergedTags,
181
179
  source_workflow_id: workflow_id,
182
180
  source_workflow_type: workflow_name,
@@ -261,7 +259,7 @@ async function createYamlWorkflowDirect(input) {
261
259
  graph_topic: graphTopic,
262
260
  input_schema: input_schema || {},
263
261
  output_schema: {},
264
- activity_manifest: activity_manifest || [],
262
+ activity_manifest: normalizeManifestToolNames(activity_manifest) || [],
265
263
  tags: tags || [],
266
264
  original_prompt: description,
267
265
  category: 'builder',
@@ -301,7 +299,7 @@ async function getYamlWorkflow(input) {
301
299
  return { status: 200, data: wf };
302
300
  }
303
301
  catch (err) {
304
- if (isNotFoundError(err)) {
302
+ if ((0, helpers_1.isNotFoundError)(err)) {
305
303
  return { status: 404, error: 'YAML workflow not found' };
306
304
  }
307
305
  return { status: 500, error: err.message };
@@ -319,6 +317,9 @@ async function getYamlWorkflow(input) {
319
317
  async function updateYamlWorkflow(input) {
320
318
  try {
321
319
  const { id, ...fields } = input;
320
+ if (fields.activity_manifest) {
321
+ normalizeManifestToolNames(fields.activity_manifest);
322
+ }
322
323
  const wf = await yamlDb.updateYamlWorkflow(id, fields);
323
324
  if (!wf) {
324
325
  return { status: 404, error: 'YAML workflow not found' };
@@ -326,7 +327,7 @@ async function updateYamlWorkflow(input) {
326
327
  return { status: 200, data: wf };
327
328
  }
328
329
  catch (err) {
329
- if (isNotFoundError(err)) {
330
+ if ((0, helpers_1.isNotFoundError)(err)) {
330
331
  return { status: 404, error: 'YAML workflow not found' };
331
332
  }
332
333
  return { status: 500, error: err.message };
@@ -354,10 +355,32 @@ async function regenerateYamlWorkflow(input) {
354
355
  if (wf.status === 'archived') {
355
356
  return { status: 400, error: 'Archived workflows cannot be regenerated' };
356
357
  }
358
+ // Plan Build workflows: recompile from original prompt via builder LLM
359
+ if (!wf.source_workflow_id && wf.source_workflow_type === 'mcpWorkflowPlanner') {
360
+ if (!wf.original_prompt) {
361
+ return { status: 400, error: 'Cannot recompile: original prompt not stored. Re-run the plan to rebuild this workflow.' };
362
+ }
363
+ const feedback = input.compilation_feedback;
364
+ const result = await (0, builder_regenerate_1.rebuildFromPrompt)({
365
+ prompt: wf.original_prompt,
366
+ feedback: feedback || undefined,
367
+ priorYaml: feedback ? wf.yaml_content : undefined,
368
+ name: wf.name,
369
+ appId: wf.app_id,
370
+ });
371
+ const updated = await yamlDb.updateYamlWorkflow(wf.id, {
372
+ yaml_content: result.yaml,
373
+ input_schema: result.inputSchema,
374
+ output_schema: result.outputSchema,
375
+ activity_manifest: normalizeManifestToolNames(result.activityManifest),
376
+ tags: result.tags,
377
+ });
378
+ return { status: 200, data: updated };
379
+ }
357
380
  if (!wf.source_workflow_id || !wf.source_workflow_type) {
358
381
  return { status: 400, error: 'Missing source workflow reference — cannot regenerate' };
359
382
  }
360
- // Look up task queue from the source task record, or use input override
383
+ // Execution-trace workflows: recompile from source execution
361
384
  let taskQueue = input.task_queue;
362
385
  if (!taskQueue) {
363
386
  const sourceTask = await (0, task_1.getTaskByWorkflowId)(wf.source_workflow_id);
@@ -380,14 +403,14 @@ async function regenerateYamlWorkflow(input) {
380
403
  yaml_content: result.yaml,
381
404
  input_schema: result.inputSchema,
382
405
  output_schema: result.outputSchema,
383
- activity_manifest: result.activityManifest,
406
+ activity_manifest: normalizeManifestToolNames(result.activityManifest),
384
407
  tags: result.tags,
385
408
  metadata: { input_field_meta: result.inputFieldMeta },
386
409
  });
387
410
  return { status: 200, data: updated };
388
411
  }
389
412
  catch (err) {
390
- if (isNotFoundError(err)) {
413
+ if ((0, helpers_1.isNotFoundError)(err)) {
391
414
  return { status: 404, error: 'YAML workflow not found' };
392
415
  }
393
416
  return { status: 500, error: err.message };
@@ -415,364 +438,60 @@ async function deleteYamlWorkflow(input) {
415
438
  return { status: 200, data: { deleted: true } };
416
439
  }
417
440
  catch (err) {
418
- if (isNotFoundError(err)) {
419
- return { status: 404, error: 'YAML workflow not found' };
420
- }
421
- return { status: 500, error: err.message };
422
- }
423
- }
424
- // ---------------------------------------------------------------------------
425
- // Deployment
426
- // ---------------------------------------------------------------------------
427
- /**
428
- * Deploy a YAML workflow and all sibling workflows sharing its app_id namespace.
429
- *
430
- * Merges and deploys the full app_id YAML, registers HotMesh workers for every
431
- * non-archived sibling, transitions draft/deployed siblings to active, and marks
432
- * the app_id content as deployed. Uses the app_version declared in the workflow record.
433
- *
434
- * @param input.id — UUID of the workflow to deploy
435
- * @returns `{ status: 200, data: YamlWorkflow }` the refreshed workflow record after deployment
436
- */
437
- async function deployYamlWorkflow(input) {
438
- try {
439
- const wf = await yamlDb.getYamlWorkflow(input.id);
440
- if (!wf) {
441
- return { status: 404, error: 'YAML workflow not found' };
442
- }
443
- // Compute the next app-level version for the namespace.
444
- // Each deploy increments regardless of individual tool versions —
445
- // adding a second tool (v1 of itself) to an app already at v1 produces app v2.
446
- const deployVersion = await yamlDb.getNextAppVersion(wf.app_id);
447
- // Deploy + activate merged YAML for the full app_id
448
- const siblings = await yamlDb.listYamlWorkflowsByAppId(wf.app_id);
449
- await yamlDeployer.deployAppId(wf.app_id, deployVersion);
450
- // Register workers and mark all non-archived siblings as active
451
- for (const sibling of siblings) {
452
- await yamlDb.updateYamlWorkflowVersion(sibling.id, deployVersion);
453
- await yamlWorkers.registerWorkersForWorkflow(sibling);
454
- if (sibling.status === 'draft' || sibling.status === 'deployed') {
455
- await yamlDb.updateYamlWorkflowStatus(sibling.id, 'active');
456
- }
457
- }
458
- // Mark content as deployed for the entire app_id
459
- await yamlDb.markAppIdContentDeployed(wf.app_id);
460
- const updated = await yamlDb.getYamlWorkflow(input.id);
461
- return { status: 200, data: updated };
462
- }
463
- catch (err) {
464
- if (isNotFoundError(err)) {
465
- return { status: 404, error: 'YAML workflow not found' };
466
- }
467
- return {
468
- status: 500,
469
- error: err.message,
470
- };
471
- }
472
- }
473
- /**
474
- * Activate a previously deployed YAML workflow and its app_id siblings.
475
- *
476
- * Calls the deployer to activate the app_id at its current version, then registers
477
- * HotMesh workers for all sibling workflows. Siblings in "deployed" status are
478
- * transitioned to "active". The workflow must already be in deployed or active status.
479
- *
480
- * @param input.id — UUID of the workflow to activate
481
- * @returns `{ status: 200, data: YamlWorkflow }` the refreshed workflow record after activation
482
- */
483
- async function activateYamlWorkflow(input) {
484
- try {
485
- const wf = await yamlDb.getYamlWorkflow(input.id);
486
- if (!wf) {
487
- return { status: 404, error: 'YAML workflow not found' };
488
- }
489
- if (wf.status !== 'deployed' && wf.status !== 'active') {
490
- return { status: 400, error: 'Workflow must be deployed before activation' };
491
- }
492
- await yamlDeployer.activateYamlWorkflow(wf.app_id, wf.app_version);
493
- // Register workers for ALL workflows sharing this app_id
494
- const siblings = await yamlDb.listYamlWorkflowsByAppId(wf.app_id);
495
- for (const sibling of siblings) {
496
- await yamlWorkers.registerWorkersForWorkflow(sibling);
497
- if (sibling.status === 'deployed') {
498
- await yamlDb.updateYamlWorkflowStatus(sibling.id, 'active');
499
- }
500
- }
501
- const updated = await yamlDb.getYamlWorkflow(input.id);
502
- return { status: 200, data: updated };
503
- }
504
- catch (err) {
505
- if (isNotFoundError(err)) {
441
+ if ((0, helpers_1.isNotFoundError)(err)) {
506
442
  return { status: 404, error: 'YAML workflow not found' };
507
443
  }
508
444
  return { status: 500, error: err.message };
509
445
  }
510
446
  }
511
447
  /**
512
- * Invoke an active YAML workflow, executing its DAG pipeline.
448
+ * Compile a durable TypeScript workflow into a YAML DAG.
513
449
  *
514
- * The workflow must be in "active" status. Delegates to the invoke service which
515
- * starts the HotMesh execution. Supports both synchronous (wait for result) and
516
- * asynchronous (fire-and-forget) invocation modes.
450
+ * Accepts inline source code or a file path. The LLM translates the procedural
451
+ * orchestration into an equivalent HotMesh YAML DAG that runs without replay.
517
452
  *
518
- * @param input.idUUID of the workflow to invoke
519
- * @param input.datainput payload passed to the workflow's entry point
520
- * @param input.syncwhen true, block until the workflow completes and return its output
521
- * @param input.timeoutmax milliseconds to wait when sync is true
522
- * @param input.execute_asoverride identity for the execution context
523
- * @param authauthenticated user context; userId is forwarded to the invoke service
524
- * @returns `{ status: 200, data: ... }` workflow execution result (sync) or job metadata (async)
453
+ * @param input.sourceTypeScript source code or file path
454
+ * @param input.is_file_pathwhether source is a file path (default: false)
455
+ * @param input.workflow_namename of the exported workflow function
456
+ * @param input.namename for the generated YAML workflow
457
+ * @param input.descriptionoptional description
458
+ * @param input.app_idtarget namespace (defaults to "longtail")
459
+ * @param input.subscribes graph topic override
460
+ * @param input.tags — additional tags
461
+ * @returns `{ status: 201, data: YamlWorkflow }` the newly created draft record
525
462
  */
526
- async function invokeYamlWorkflow(input, auth) {
463
+ async function createYamlWorkflowFromDurable(input) {
527
464
  try {
528
- const wf = await yamlDb.getYamlWorkflow(input.id);
529
- if (!wf) {
530
- return { status: 404, error: 'YAML workflow not found' };
531
- }
532
- if (wf.status !== 'active') {
533
- return { status: 400, error: 'Workflow must be active to invoke' };
465
+ const { source, workflow_name, name, description, app_id, subscribes, tags: userTags } = input;
466
+ if (!source || !workflow_name || !name) {
467
+ return { status: 400, error: 'source, workflow_name, and name are required' };
534
468
  }
535
- const result = await (0, invoke_1.invokeYamlWorkflow)(wf, {
536
- data: input.data,
537
- sync: input.sync,
538
- timeout: input.timeout,
539
- execute_as: input.execute_as,
540
- userId: auth?.userId,
469
+ const result = await (0, durable_compiler_1.compileDurableToYaml)({
470
+ source,
471
+ isFilePath: !!input.is_file_path,
472
+ workflowName: workflow_name,
473
+ name,
474
+ description,
475
+ appId: app_id,
476
+ subscribes,
541
477
  });
542
- return { status: 200, data: result };
543
- }
544
- catch (err) {
545
- if (isNotFoundError(err)) {
546
- return { status: 404, error: 'YAML workflow not found' };
547
- }
548
- return { status: 500, error: err.message };
549
- }
550
- }
551
- /**
552
- * Archive a YAML workflow, removing it from active service.
553
- *
554
- * If the workflow is currently active, its HotMesh engine is stopped before
555
- * transitioning the status to "archived". Archived workflows cannot be invoked
556
- * or regenerated but can still be viewed or deleted.
557
- *
558
- * @param input.id UUID of the workflow to archive
559
- * @returns `{ status: 200, data: YamlWorkflow }` the updated record with status "archived"
560
- */
561
- async function archiveYamlWorkflow(input) {
562
- try {
563
- const wf = await yamlDb.getYamlWorkflow(input.id);
564
- if (!wf) {
565
- return { status: 404, error: 'YAML workflow not found' };
566
- }
567
- if (wf.status === 'active') {
568
- await yamlDeployer.stopEngine(wf.app_id);
569
- }
570
- const updated = await yamlDb.updateYamlWorkflowStatus(wf.id, 'archived');
571
- return { status: 200, data: updated };
572
- }
573
- catch (err) {
574
- if (isNotFoundError(err)) {
575
- return { status: 404, error: 'YAML workflow not found' };
576
- }
577
- return { status: 500, error: err.message };
578
- }
579
- }
580
- /**
581
- * Restore an archived YAML workflow back to draft status.
582
- *
583
- * Transitions the workflow from "archived" to "draft" so it can be
584
- * redeployed. The workflow must be in "archived" status.
585
- */
586
- async function restoreYamlWorkflow(input) {
587
- try {
588
- const wf = await yamlDb.getYamlWorkflow(input.id);
589
- if (!wf) {
590
- return { status: 404, error: 'YAML workflow not found' };
591
- }
592
- if (wf.status !== 'archived') {
593
- return { status: 400, error: 'Only archived workflows can be restored' };
594
- }
595
- const updated = await yamlDb.updateYamlWorkflowStatus(wf.id, 'draft');
596
- return { status: 200, data: updated };
597
- }
598
- catch (err) {
599
- if (isNotFoundError(err)) {
600
- return { status: 404, error: 'YAML workflow not found' };
601
- }
602
- return { status: 500, error: err.message };
603
- }
604
- }
605
- // ---------------------------------------------------------------------------
606
- // Versions
607
- // ---------------------------------------------------------------------------
608
- /**
609
- * Retrieve the version history for a YAML workflow.
610
- *
611
- * Returns a paginated list of version snapshots ordered by version number.
612
- *
613
- * @param input.id — UUID of the workflow
614
- * @param input.limit — max versions to return (defaults to 20)
615
- * @param input.offset — pagination offset (defaults to 0)
616
- * @returns `{ status: 200, data: VersionSnapshot[] }` paginated version history
617
- */
618
- async function getVersionHistory(input) {
619
- try {
620
- const limit = input.limit ?? 20;
621
- const offset = input.offset ?? 0;
622
- const result = await yamlDb.getVersionHistory(input.id, limit, offset);
623
- return { status: 200, data: result };
624
- }
625
- catch (err) {
626
- if (isNotFoundError(err)) {
627
- return { status: 404, error: 'YAML workflow not found' };
628
- }
629
- return { status: 500, error: err.message };
630
- }
631
- }
632
- /**
633
- * Retrieve a specific version snapshot of a YAML workflow.
634
- *
635
- * Validates that the version number is a positive integer before querying.
636
- *
637
- * @param input.id — UUID of the workflow
638
- * @param input.version — 1-based version number to retrieve
639
- * @returns `{ status: 200, data: VersionSnapshot }` the snapshot at the requested version, or 404
640
- */
641
- async function getVersionSnapshot(input) {
642
- try {
643
- const version = input.version;
644
- if (isNaN(version) || version < 1) {
645
- return { status: 400, error: 'Invalid version number' };
646
- }
647
- const snapshot = await yamlDb.getVersionSnapshot(input.id, version);
648
- if (!snapshot) {
649
- return { status: 404, error: `Version ${version} not found` };
650
- }
651
- return { status: 200, data: snapshot };
652
- }
653
- catch (err) {
654
- if (isNotFoundError(err)) {
655
- return { status: 404, error: 'YAML workflow not found' };
656
- }
657
- return { status: 500, error: err.message };
658
- }
659
- }
660
- /**
661
- * Retrieve the raw YAML content for a workflow, optionally at a specific version.
662
- *
663
- * When a version is provided, fetches from the version snapshot table. Otherwise
664
- * returns the current yaml_content from the live workflow record.
665
- *
666
- * @param input.id — UUID of the workflow
667
- * @param input.version — optional version number; when omitted, returns the current content
668
- * @returns `{ status: 200, data: string }` the raw YAML string
669
- */
670
- async function getYamlContent(input) {
671
- try {
672
- if (input.version) {
673
- const snapshot = await yamlDb.getVersionSnapshot(input.id, input.version);
674
- if (!snapshot) {
675
- return { status: 404, error: `Version ${input.version} not found` };
676
- }
677
- return { status: 200, data: snapshot.yaml_content };
678
- }
679
- const wf = await yamlDb.getYamlWorkflow(input.id);
680
- if (!wf) {
681
- return { status: 404, error: 'YAML workflow not found' };
682
- }
683
- return { status: 200, data: wf.yaml_content };
684
- }
685
- catch (err) {
686
- if (isNotFoundError(err)) {
687
- return { status: 404, error: 'YAML workflow not found' };
688
- }
689
- return { status: 500, error: err.message };
690
- }
691
- }
692
- // ---------------------------------------------------------------------------
693
- // Cron
694
- // ---------------------------------------------------------------------------
695
- /**
696
- * Set or update the cron schedule for a YAML workflow.
697
- *
698
- * Persists the schedule in the DB and restarts the in-process cron timer via the
699
- * cron registry so the change takes effect immediately.
700
- *
701
- * @param input.id — UUID of the workflow to schedule
702
- * @param input.cron_schedule — cron expression (e.g. "0 * * * *")
703
- * @param input.cron_envelope — optional payload passed to each scheduled invocation
704
- * @param input.execute_as — optional identity override for scheduled executions
705
- * @returns `{ status: 200, data: YamlWorkflow }` the updated workflow record with cron fields set
706
- */
707
- async function setCronSchedule(input) {
708
- try {
709
- const wf = await yamlDb.getYamlWorkflow(input.id);
710
- if (!wf) {
711
- return { status: 404, error: 'YAML workflow not found' };
712
- }
713
- if (!input.cron_schedule || typeof input.cron_schedule !== 'string') {
714
- return { status: 400, error: 'cron_schedule is required' };
715
- }
716
- const updated = await yamlDb.updateCronSchedule(wf.id, input.cron_schedule.trim(), input.cron_envelope ?? null, input.execute_as ?? null);
717
- if (updated) {
718
- await cron_1.cronRegistry.restartYamlCron(updated);
719
- }
720
- return { status: 200, data: updated };
721
- }
722
- catch (err) {
723
- if (isNotFoundError(err)) {
724
- return { status: 404, error: 'YAML workflow not found' };
725
- }
726
- return { status: 500, error: err.message };
727
- }
728
- }
729
- /**
730
- * Remove the cron schedule from a YAML workflow.
731
- *
732
- * Stops the in-process cron timer first, then clears the schedule fields in the DB.
733
- *
734
- * @param input.id — UUID of the workflow to unschedule
735
- * @returns `{ status: 200, data: YamlWorkflow }` the updated workflow record with cron fields cleared
736
- */
737
- async function clearCronSchedule(input) {
738
- try {
739
- const wf = await yamlDb.getYamlWorkflow(input.id);
740
- if (!wf) {
741
- return { status: 404, error: 'YAML workflow not found' };
742
- }
743
- await cron_1.cronRegistry.stopYamlCron(wf.id);
744
- const updated = await yamlDb.clearCronSchedule(wf.id);
745
- return { status: 200, data: updated };
746
- }
747
- catch (err) {
748
- if (isNotFoundError(err)) {
749
- return { status: 404, error: 'YAML workflow not found' };
750
- }
751
- return { status: 500, error: err.message };
752
- }
753
- }
754
- /**
755
- * List all YAML workflows that have a cron schedule, with their live timer status.
756
- *
757
- * Fetches all cron-scheduled workflows from the DB and cross-references with the
758
- * in-process cron registry to determine which timers are actually running.
759
- *
760
- * @returns `{ status: 200, data: { schedules: Array<{ id, name, graph_topic, app_id, cron_schedule, execute_as, active }> } }`
761
- */
762
- async function getCronStatus() {
763
- try {
764
- const workflows = await yamlDb.getCronScheduledWorkflows();
765
- const activeTypes = cron_1.cronRegistry.activeWorkflowTypes;
766
- const schedules = workflows.map((wf) => ({
767
- id: wf.id,
768
- name: wf.name,
769
- graph_topic: wf.graph_topic,
770
- app_id: wf.app_id,
771
- cron_schedule: wf.cron_schedule,
772
- execute_as: wf.execute_as,
773
- active: activeTypes.includes(`yaml:${wf.id}`),
774
- }));
775
- return { status: 200, data: { schedules } };
478
+ const mergedTags = [...new Set([...(result.tags || []), ...(Array.isArray(userTags) ? userTags : [])])];
479
+ const record = await yamlDb.createYamlWorkflow({
480
+ name,
481
+ description,
482
+ app_id: result.appId,
483
+ yaml_content: result.yaml,
484
+ graph_topic: result.graphTopic,
485
+ input_schema: result.inputSchema,
486
+ output_schema: result.outputSchema,
487
+ activity_manifest: normalizeManifestToolNames(result.activityManifest),
488
+ tags: mergedTags,
489
+ source_workflow_type: 'durable',
490
+ original_prompt: description,
491
+ category: result.category,
492
+ metadata: { durable_source: source.slice(0, 5000) },
493
+ });
494
+ return { status: 201, data: record };
776
495
  }
777
496
  catch (err) {
778
497
  return { status: 500, error: err.message };
@@ -0,0 +1,71 @@
1
+ import type { LTApiResult, LTApiAuth } from '../../types/sdk';
2
+ /**
3
+ * Deploy a YAML workflow and all sibling workflows sharing its app_id namespace.
4
+ *
5
+ * Merges and deploys the full app_id YAML, registers HotMesh workers for every
6
+ * non-archived sibling, transitions draft/deployed siblings to active, and marks
7
+ * the app_id content as deployed. Uses the app_version declared in the workflow record.
8
+ *
9
+ * @param input.id — UUID of the workflow to deploy
10
+ * @returns `{ status: 200, data: YamlWorkflow }` the refreshed workflow record after deployment
11
+ */
12
+ export declare function deployYamlWorkflow(input: {
13
+ id: string;
14
+ }): Promise<LTApiResult>;
15
+ /**
16
+ * Activate a previously deployed YAML workflow and its app_id siblings.
17
+ *
18
+ * Calls the deployer to activate the app_id at its current version, then registers
19
+ * HotMesh workers for all sibling workflows. Siblings in "deployed" status are
20
+ * transitioned to "active". The workflow must already be in deployed or active status.
21
+ *
22
+ * @param input.id — UUID of the workflow to activate
23
+ * @returns `{ status: 200, data: YamlWorkflow }` the refreshed workflow record after activation
24
+ */
25
+ export declare function activateYamlWorkflow(input: {
26
+ id: string;
27
+ }): Promise<LTApiResult>;
28
+ /**
29
+ * Invoke an active YAML workflow, executing its DAG pipeline.
30
+ *
31
+ * The workflow must be in "active" status. Delegates to the invoke service which
32
+ * starts the HotMesh execution. Supports both synchronous (wait for result) and
33
+ * asynchronous (fire-and-forget) invocation modes.
34
+ *
35
+ * @param input.id — UUID of the workflow to invoke
36
+ * @param input.data — input payload passed to the workflow's entry point
37
+ * @param input.sync — when true, block until the workflow completes and return its output
38
+ * @param input.timeout — max milliseconds to wait when sync is true
39
+ * @param input.execute_as — override identity for the execution context
40
+ * @param auth — authenticated user context; userId is forwarded to the invoke service
41
+ * @returns `{ status: 200, data: ... }` workflow execution result (sync) or job metadata (async)
42
+ */
43
+ export declare function invokeYamlWorkflow(input: {
44
+ id: string;
45
+ data?: any;
46
+ sync?: boolean;
47
+ timeout?: number;
48
+ execute_as?: string;
49
+ }, auth?: LTApiAuth): Promise<LTApiResult>;
50
+ /**
51
+ * Archive a YAML workflow, removing it from active service.
52
+ *
53
+ * If the workflow is currently active, its HotMesh engine is stopped before
54
+ * transitioning the status to "archived". Archived workflows cannot be invoked
55
+ * or regenerated but can still be viewed or deleted.
56
+ *
57
+ * @param input.id — UUID of the workflow to archive
58
+ * @returns `{ status: 200, data: YamlWorkflow }` the updated record with status "archived"
59
+ */
60
+ export declare function archiveYamlWorkflow(input: {
61
+ id: string;
62
+ }): Promise<LTApiResult>;
63
+ /**
64
+ * Restore an archived YAML workflow back to draft status.
65
+ *
66
+ * Transitions the workflow from "archived" to "draft" so it can be
67
+ * redeployed. The workflow must be in "archived" status.
68
+ */
69
+ export declare function restoreYamlWorkflow(input: {
70
+ id: string;
71
+ }): Promise<LTApiResult>;