@hotmeshio/long-tail 0.7.5 → 0.8.1

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 (364) hide show
  1. package/build/api/workflows/config.d.ts +7 -1
  2. package/build/api/workflows/config.js +7 -1
  3. package/build/api/workflows/discovery.js +1 -4
  4. package/build/lib/db/schemas/020_workflow_certified.sql +34 -0
  5. package/build/modules/ltconfig.d.ts +3 -2
  6. package/build/modules/ltconfig.js +4 -4
  7. package/build/routes/workflows/config.js +1 -0
  8. package/build/services/config/cache.js +1 -0
  9. package/build/services/config/read.js +2 -0
  10. package/build/services/config/sql.d.ts +2 -2
  11. package/build/services/config/sql.js +6 -5
  12. package/build/services/config/write.js +13 -0
  13. package/build/services/escalation/bulk.d.ts +3 -1
  14. package/build/services/escalation/bulk.js +3 -1
  15. package/build/services/escalation/crud.d.ts +4 -3
  16. package/build/services/escalation/crud.js +4 -3
  17. package/build/start/workers.js +1 -0
  18. package/build/system/mcp-servers/admin/schemas.d.ts +3 -0
  19. package/build/system/mcp-servers/admin/schemas.js +3 -1
  20. package/build/system/mcp-servers/admin/workflow-config.js +1 -0
  21. package/build/types/config.d.ts +16 -0
  22. package/build/types/startup.d.ts +11 -1
  23. package/dashboard/dist/assets/AdminDashboard-Ck5-jV9T.js +2 -0
  24. package/dashboard/dist/assets/{AdminDashboard-Bgomc_jH.js.map → AdminDashboard-Ck5-jV9T.js.map} +1 -1
  25. package/dashboard/dist/assets/AgentConfigPage-DFiXRBWs.js +16 -0
  26. package/dashboard/dist/assets/AgentConfigPage-DFiXRBWs.js.map +1 -0
  27. package/dashboard/dist/assets/AgentDetailPage-BBgM_pMe.js +4 -0
  28. package/dashboard/dist/assets/AgentDetailPage-BBgM_pMe.js.map +1 -0
  29. package/dashboard/dist/assets/AgentsPage-DxwFuedf.js +2 -0
  30. package/dashboard/dist/assets/AgentsPage-DxwFuedf.js.map +1 -0
  31. package/dashboard/dist/assets/AvailableEscalationsPage-DNQbeIcn.js +2 -0
  32. package/dashboard/dist/assets/{AvailableEscalationsPage-C9DAtNGp.js.map → AvailableEscalationsPage-DNQbeIcn.js.map} +1 -1
  33. package/dashboard/dist/assets/BotPicker-mqwKVOE3.js +2 -0
  34. package/dashboard/dist/assets/{BotPicker-MnI3OyE7.js.map → BotPicker-mqwKVOE3.js.map} +1 -1
  35. package/dashboard/dist/assets/CapabilitiesPage-Biffm0kW.js +2 -0
  36. package/dashboard/dist/assets/CapabilitiesPage-Biffm0kW.js.map +1 -0
  37. package/dashboard/dist/assets/CollapsibleSection-Bn6Ks79X.js +2 -0
  38. package/dashboard/dist/assets/{CollapsibleSection-Ne-Q3QFM.js.map → CollapsibleSection-Bn6Ks79X.js.map} +1 -1
  39. package/dashboard/dist/assets/ConfirmDeleteModal-no0-c_1G.js +2 -0
  40. package/dashboard/dist/assets/{ConfirmDeleteModal-D9_1b4MW.js.map → ConfirmDeleteModal-no0-c_1G.js.map} +1 -1
  41. package/dashboard/dist/assets/CopyableId-DS6IDMIX.js +2 -0
  42. package/dashboard/dist/assets/{CopyableId-blg-gZvT.js.map → CopyableId-DS6IDMIX.js.map} +1 -1
  43. package/dashboard/dist/assets/CredentialsPage-C3NyncEB.js +2 -0
  44. package/dashboard/dist/assets/CredentialsPage-C3NyncEB.js.map +1 -0
  45. package/dashboard/dist/assets/CronLabel-DQWBx57H.js +2 -0
  46. package/dashboard/dist/assets/CronLabel-DQWBx57H.js.map +1 -0
  47. package/dashboard/dist/assets/CustomDurationPicker-DV42oZ1G.js +2 -0
  48. package/dashboard/dist/assets/{CustomDurationPicker-Cp1fgzPX.js.map → CustomDurationPicker-DV42oZ1G.js.map} +1 -1
  49. package/dashboard/dist/assets/DataTable-Bf4dgxll.js +2 -0
  50. package/dashboard/dist/assets/{DataTable-ZWgVQg7F.js.map → DataTable-Bf4dgxll.js.map} +1 -1
  51. package/dashboard/dist/assets/DropZone-CTSXBb3c.js +2 -0
  52. package/dashboard/dist/assets/{DropZone-CZDmNBn-.js.map → DropZone-CTSXBb3c.js.map} +1 -1
  53. package/dashboard/dist/assets/ElapsedCell-roy4G5SQ.js +2 -0
  54. package/dashboard/dist/assets/{ElapsedCell-Gr5UlUbn.js.map → ElapsedCell-roy4G5SQ.js.map} +1 -1
  55. package/dashboard/dist/assets/EmptyState-CLVm9KmA.js +2 -0
  56. package/dashboard/dist/assets/{EmptyState-BcsfPq9T.js.map → EmptyState-CLVm9KmA.js.map} +1 -1
  57. package/dashboard/dist/assets/EscalationSchemaPage-DulCCxea.js +9 -0
  58. package/dashboard/dist/assets/EscalationSchemaPage-DulCCxea.js.map +1 -0
  59. package/dashboard/dist/assets/EscalationsOverview-DDwxn_mT.js +2 -0
  60. package/dashboard/dist/assets/{EscalationsOverview-BIZVnSBF.js.map → EscalationsOverview-DDwxn_mT.js.map} +1 -1
  61. package/dashboard/dist/assets/EventTable-BaLNvCew.js +2 -0
  62. package/dashboard/dist/assets/EventTable-BaLNvCew.js.map +1 -0
  63. package/dashboard/dist/assets/FilterBar-DEAbNQqp.js +2 -0
  64. package/dashboard/dist/assets/FilterBar-DEAbNQqp.js.map +1 -0
  65. package/dashboard/dist/assets/GraphInvokePage-BmM8r0R3.js +2 -0
  66. package/dashboard/dist/assets/GraphInvokePage-BmM8r0R3.js.map +1 -0
  67. package/dashboard/dist/assets/HomePage-Ds3PzWWr.js +2 -0
  68. package/dashboard/dist/assets/HomePage-Ds3PzWWr.js.map +1 -0
  69. package/dashboard/dist/assets/ListToolbar-Dviaskni.js +2 -0
  70. package/dashboard/dist/assets/{ListToolbar-CdmIvEIF.js.map → ListToolbar-Dviaskni.js.map} +1 -1
  71. package/dashboard/dist/assets/McpOverview-BBm66wbF.js +2 -0
  72. package/dashboard/dist/assets/{McpOverview-C-Ypezuv.js.map → McpOverview-BBm66wbF.js.map} +1 -1
  73. package/dashboard/dist/assets/McpQueryDetailPage-B6GJOMcz.js +5 -0
  74. package/dashboard/dist/assets/McpQueryDetailPage-B6GJOMcz.js.map +1 -0
  75. package/dashboard/dist/assets/McpQueryPage-C-8nIdBL.js +2 -0
  76. package/dashboard/dist/assets/McpQueryPage-C-8nIdBL.js.map +1 -0
  77. package/dashboard/dist/assets/McpRunDetailPage-CSq_0qqi.js +2 -0
  78. package/dashboard/dist/assets/{McpRunDetailPage-B1sCxKLD.js.map → McpRunDetailPage-CSq_0qqi.js.map} +1 -1
  79. package/dashboard/dist/assets/McpRunsPage-BdK8ahX7.js +2 -0
  80. package/dashboard/dist/assets/McpRunsPage-BdK8ahX7.js.map +1 -0
  81. package/dashboard/dist/assets/Modal-C6HI6btY.js +2 -0
  82. package/dashboard/dist/assets/{Modal-CSrxpXeM.js.map → Modal-C6HI6btY.js.map} +1 -1
  83. package/dashboard/dist/assets/NamespacePill-eGsbJBFa.js +2 -0
  84. package/dashboard/dist/assets/{NamespacePill-DlqBTvFR.js.map → NamespacePill-eGsbJBFa.js.map} +1 -1
  85. package/dashboard/dist/assets/OperationsPage-DODPFmf2.js +2 -0
  86. package/dashboard/dist/assets/OperationsPage-DODPFmf2.js.map +1 -0
  87. package/dashboard/dist/assets/OperatorDashboard-BbmgsOmQ.js +2 -0
  88. package/dashboard/dist/assets/{OperatorDashboard-YP6kP-f_.js.map → OperatorDashboard-BbmgsOmQ.js.map} +1 -1
  89. package/dashboard/dist/assets/PageHeader-DcgGV0Y2.js +2 -0
  90. package/dashboard/dist/assets/{PageHeader-CFta2VaS.js.map → PageHeader-DcgGV0Y2.js.map} +1 -1
  91. package/dashboard/dist/assets/PageHeaderWithStats-Cf8TYFRh.js +2 -0
  92. package/dashboard/dist/assets/PageHeaderWithStats-Cf8TYFRh.js.map +1 -0
  93. package/dashboard/dist/assets/PriorityBadge-a7u8C9uY.js +2 -0
  94. package/dashboard/dist/assets/{PriorityBadge-B4ykBH7f.js.map → PriorityBadge-a7u8C9uY.js.map} +1 -1
  95. package/dashboard/dist/assets/ProcessDetailPage-D80w44rV.js +2 -0
  96. package/dashboard/dist/assets/ProcessDetailPage-D80w44rV.js.map +1 -0
  97. package/dashboard/dist/assets/ProcessesListPage-BjW5xUkv.js +2 -0
  98. package/dashboard/dist/assets/{ProcessesListPage-BNhFwTLl.js.map → ProcessesListPage-BjW5xUkv.js.map} +1 -1
  99. package/dashboard/dist/assets/RoleDetailPage-oahg0cdT.js +11 -0
  100. package/dashboard/dist/assets/RoleDetailPage-oahg0cdT.js.map +1 -0
  101. package/dashboard/dist/assets/RolePill-BAeaQUXX.js +2 -0
  102. package/dashboard/dist/assets/RolePill-BAeaQUXX.js.map +1 -0
  103. package/dashboard/dist/assets/RolesPage-BI1Xtqq_.js +2 -0
  104. package/dashboard/dist/assets/RolesPage-BI1Xtqq_.js.map +1 -0
  105. package/dashboard/dist/assets/RowActions--m4F6GW8.js +2 -0
  106. package/dashboard/dist/assets/{RowActions-BA9L9djf.js.map → RowActions--m4F6GW8.js.map} +1 -1
  107. package/dashboard/dist/assets/RunAsSelector-DiGzSfiG.js +2 -0
  108. package/dashboard/dist/assets/{RunAsSelector-CokM3Ifp.js.map → RunAsSelector-DiGzSfiG.js.map} +1 -1
  109. package/dashboard/dist/assets/StatCard-DCPGFzCv.js +2 -0
  110. package/dashboard/dist/assets/StatCard-DCPGFzCv.js.map +1 -0
  111. package/dashboard/dist/assets/StatusBadge-mk-dJwPT.js +2 -0
  112. package/dashboard/dist/assets/{StatusBadge-D9MeQHrh.js.map → StatusBadge-mk-dJwPT.js.map} +1 -1
  113. package/dashboard/dist/assets/StickyPagination-Clm9H840.js +2 -0
  114. package/dashboard/dist/assets/{StickyPagination-_H2j2CAH.js.map → StickyPagination-Clm9H840.js.map} +1 -1
  115. package/dashboard/dist/assets/StreamMessageDetail-Bikvs1Cz.js +2 -0
  116. package/dashboard/dist/assets/StreamMessageDetail-Bikvs1Cz.js.map +1 -0
  117. package/dashboard/dist/assets/SwimlaneTimeline-C9X3IVqI.js +2 -0
  118. package/dashboard/dist/assets/SwimlaneTimeline-C9X3IVqI.js.map +1 -0
  119. package/dashboard/dist/assets/TagInput-DmJLnghg.js +2 -0
  120. package/dashboard/dist/assets/{TagInput-CQg-TrV9.js.map → TagInput-DmJLnghg.js.map} +1 -1
  121. package/dashboard/dist/assets/TaskDetailPage-C0tbiUi7.js +2 -0
  122. package/dashboard/dist/assets/TaskDetailPage-C0tbiUi7.js.map +1 -0
  123. package/dashboard/dist/assets/TaskQueuePill--1OX6egx.js +2 -0
  124. package/dashboard/dist/assets/{TaskQueuePill-DyvtL8X4.js.map → TaskQueuePill--1OX6egx.js.map} +1 -1
  125. package/dashboard/dist/assets/TasksListPage-DcYV-GMA.js +2 -0
  126. package/dashboard/dist/assets/{TasksListPage-B71FxvrY.js.map → TasksListPage-DcYV-GMA.js.map} +1 -1
  127. package/dashboard/dist/assets/TimeAgo-pYn3T9IZ.js +2 -0
  128. package/dashboard/dist/assets/{TimeAgo-JgT0U_sd.js.map → TimeAgo-pYn3T9IZ.js.map} +1 -1
  129. package/dashboard/dist/assets/TimestampCell-BPMCscic.js +2 -0
  130. package/dashboard/dist/assets/{TimestampCell-gEreK8Nn.js.map → TimestampCell-BPMCscic.js.map} +1 -1
  131. package/dashboard/dist/assets/ToolPill-BnF9lCUX.js +2 -0
  132. package/dashboard/dist/assets/{ToolPill-miuRcj1Q.js.map → ToolPill-BnF9lCUX.js.map} +1 -1
  133. package/dashboard/dist/assets/ToolTestPanel-Bw4z_Tya.js +2 -0
  134. package/dashboard/dist/assets/{ToolTestPanel-ChfHw9Aq.js.map → ToolTestPanel-Bw4z_Tya.js.map} +1 -1
  135. package/dashboard/dist/assets/TopicDetailPage-CtFztOnn.js +9 -0
  136. package/dashboard/dist/assets/TopicDetailPage-CtFztOnn.js.map +1 -0
  137. package/dashboard/dist/assets/TopicsPage-BXdc6pAU.js +2 -0
  138. package/dashboard/dist/assets/TopicsPage-BXdc6pAU.js.map +1 -0
  139. package/dashboard/dist/assets/UserName-R96NG6xB.js +2 -0
  140. package/dashboard/dist/assets/{UserName-uncbaKYf.js.map → UserName-R96NG6xB.js.map} +1 -1
  141. package/dashboard/dist/assets/WorkflowExecutionPage-DmRJabMQ.js +2 -0
  142. package/dashboard/dist/assets/{WorkflowExecutionPage-DwzLKTkt.js.map → WorkflowExecutionPage-DmRJabMQ.js.map} +1 -1
  143. package/dashboard/dist/assets/WorkflowPill-Cc2MlYbB.js +2 -0
  144. package/dashboard/dist/assets/WorkflowPill-Cc2MlYbB.js.map +1 -0
  145. package/dashboard/dist/assets/WorkflowsDashboard-uLU5ZToY.js +2 -0
  146. package/dashboard/dist/assets/WorkflowsDashboard-uLU5ZToY.js.map +1 -0
  147. package/dashboard/dist/assets/WorkflowsOverview-BhgE0RS8.js +2 -0
  148. package/dashboard/dist/assets/{WorkflowsOverview-ihhW8DiS.js.map → WorkflowsOverview-BhgE0RS8.js.map} +1 -1
  149. package/dashboard/dist/assets/YamlWorkflowDetailPage-CvIgB5y7.js +33 -0
  150. package/dashboard/dist/assets/{YamlWorkflowDetailPage-C61-8y-E.js.map → YamlWorkflowDetailPage-CvIgB5y7.js.map} +1 -1
  151. package/dashboard/dist/assets/YamlWorkflowsPage-DWnsgl2v.js +2 -0
  152. package/dashboard/dist/assets/{YamlWorkflowsPage-CMpgsLEo.js.map → YamlWorkflowsPage-DWnsgl2v.js.map} +1 -1
  153. package/dashboard/dist/assets/{agents-27sErp5R.js → agents-BpYMwrsB.js} +2 -2
  154. package/dashboard/dist/assets/{agents-27sErp5R.js.map → agents-BpYMwrsB.js.map} +1 -1
  155. package/dashboard/dist/assets/{bots-CPHuAvjW.js → bots-DI6Wqp5X.js} +2 -2
  156. package/dashboard/dist/assets/{bots-CPHuAvjW.js.map → bots-DI6Wqp5X.js.map} +1 -1
  157. package/dashboard/dist/assets/capabilities-BKZZb8eM.js +2 -0
  158. package/dashboard/dist/assets/{capabilities-BBTPqF-V.js.map → capabilities-BKZZb8eM.js.map} +1 -1
  159. package/dashboard/dist/assets/{controlplane-C9j2mwX8.js → controlplane-Djshb7fm.js} +2 -2
  160. package/dashboard/dist/assets/{controlplane-C9j2mwX8.js.map → controlplane-Djshb7fm.js.map} +1 -1
  161. package/dashboard/dist/assets/escalation-D8mrXtjS.js +2 -0
  162. package/dashboard/dist/assets/{escalation-CyJ_wz-f.js.map → escalation-D8mrXtjS.js.map} +1 -1
  163. package/dashboard/dist/assets/escalation-columns-CyLzgPkz.js +2 -0
  164. package/dashboard/dist/assets/escalation-columns-CyLzgPkz.js.map +1 -0
  165. package/dashboard/dist/assets/index-B5MAG4Uv.js +2 -0
  166. package/dashboard/dist/assets/{index-CCHGKErT.js.map → index-B5MAG4Uv.js.map} +1 -1
  167. package/dashboard/dist/assets/index-BfxiRwk2.js +6 -0
  168. package/dashboard/dist/assets/index-BfxiRwk2.js.map +1 -0
  169. package/dashboard/dist/assets/index-C71I-f5G.js +2 -0
  170. package/dashboard/dist/assets/{index-D9pi0fs6.js.map → index-C71I-f5G.js.map} +1 -1
  171. package/dashboard/dist/assets/index-CC4g-6QE.css +1 -0
  172. package/dashboard/dist/assets/index-CJb3dXku.js +2 -0
  173. package/dashboard/dist/assets/index-CJb3dXku.js.map +1 -0
  174. package/dashboard/dist/assets/index-CQtv2rj6.js +2 -0
  175. package/dashboard/dist/assets/index-CQtv2rj6.js.map +1 -0
  176. package/dashboard/dist/assets/index-CphzO7b8.js +2 -0
  177. package/dashboard/dist/assets/{index-CNprOGuS.js.map → index-CphzO7b8.js.map} +1 -1
  178. package/dashboard/dist/assets/index-CwAmiy_j.js +2 -0
  179. package/dashboard/dist/assets/index-CwAmiy_j.js.map +1 -0
  180. package/dashboard/dist/assets/index-DgCS2Frb.js +281 -0
  181. package/dashboard/dist/assets/index-DgCS2Frb.js.map +1 -0
  182. package/dashboard/dist/assets/index-DkbnD-Te.js +2 -0
  183. package/dashboard/dist/assets/{index-Dzqt3g-K.js.map → index-DkbnD-Te.js.map} +1 -1
  184. package/dashboard/dist/assets/index-Y6yj36QR.js +9 -0
  185. package/dashboard/dist/assets/index-Y6yj36QR.js.map +1 -0
  186. package/dashboard/dist/assets/index-eshNd6NY.js +6 -0
  187. package/dashboard/dist/assets/{index-BiLZJ43R.js.map → index-eshNd6NY.js.map} +1 -1
  188. package/dashboard/dist/assets/index-xn9fmkHC.js +2 -0
  189. package/dashboard/dist/assets/index-xn9fmkHC.js.map +1 -0
  190. package/dashboard/dist/assets/index-yxnQew1X.js +2 -0
  191. package/dashboard/dist/assets/index-yxnQew1X.js.map +1 -0
  192. package/dashboard/dist/assets/{knowledge-BErJA3Je.js → knowledge-C_1r0faY.js} +2 -2
  193. package/dashboard/dist/assets/{knowledge-BErJA3Je.js.map → knowledge-C_1r0faY.js.map} +1 -1
  194. package/dashboard/dist/assets/{mcp-Cx9L42EN.js → mcp-BtG54ZAx.js} +2 -2
  195. package/dashboard/dist/assets/{mcp-Cx9L42EN.js.map → mcp-BtG54ZAx.js.map} +1 -1
  196. package/dashboard/dist/assets/{mcp-query-Cf6kcBoW.js → mcp-query-CSdQWxmv.js} +2 -2
  197. package/dashboard/dist/assets/{mcp-query-Cf6kcBoW.js.map → mcp-query-CSdQWxmv.js.map} +1 -1
  198. package/dashboard/dist/assets/{pipelines-CFctrv71.js → pipelines-DVkwxN64.js} +2 -2
  199. package/dashboard/dist/assets/{pipelines-CFctrv71.js.map → pipelines-DVkwxN64.js.map} +1 -1
  200. package/dashboard/dist/assets/{roles-CCXZtqDr.js → roles-CpRcUIMm.js} +2 -2
  201. package/dashboard/dist/assets/{roles-CCXZtqDr.js.map → roles-CpRcUIMm.js.map} +1 -1
  202. package/dashboard/dist/assets/{tasks-BPNj8ZWL.js → tasks-DNdvW5H6.js} +2 -2
  203. package/dashboard/dist/assets/{tasks-BPNj8ZWL.js.map → tasks-DNdvW5H6.js.map} +1 -1
  204. package/dashboard/dist/assets/{topics-CR4UBuSV.js → topics-DNC77Chw.js} +2 -2
  205. package/dashboard/dist/assets/{topics-CR4UBuSV.js.map → topics-DNC77Chw.js.map} +1 -1
  206. package/dashboard/dist/assets/{useCollapsedSections-BU5HULGs.js → useCollapsedSections-CGNA5oKV.js} +2 -2
  207. package/dashboard/dist/assets/{useCollapsedSections-BU5HULGs.js.map → useCollapsedSections-CGNA5oKV.js.map} +1 -1
  208. package/dashboard/dist/assets/{useDebouncedValue-BA5S7V54.js → useDebouncedValue-DmL3uNt_.js} +2 -2
  209. package/dashboard/dist/assets/{useDebouncedValue-BA5S7V54.js.map → useDebouncedValue-DmL3uNt_.js.map} +1 -1
  210. package/dashboard/dist/assets/{useEventHooks-BgdnN8Rj.js → useEventHooks-CUUeBSH1.js} +2 -2
  211. package/dashboard/dist/assets/{useEventHooks-BgdnN8Rj.js.map → useEventHooks-CUUeBSH1.js.map} +1 -1
  212. package/dashboard/dist/assets/{useFilterParams-x-Dg0Vgz.js → useFilterParams-Ch-a71bE.js} +2 -2
  213. package/dashboard/dist/assets/{useFilterParams-x-Dg0Vgz.js.map → useFilterParams-Ch-a71bE.js.map} +1 -1
  214. package/dashboard/dist/assets/{useNamespace-BDsKfT0f.js → useNamespace-D-AjLnPK.js} +2 -2
  215. package/dashboard/dist/assets/{useNamespace-BDsKfT0f.js.map → useNamespace-D-AjLnPK.js.map} +1 -1
  216. package/dashboard/dist/assets/{useYamlActivityEvents-CWZwHIlR.js → useYamlActivityEvents-DRdetOb_.js} +2 -2
  217. package/dashboard/dist/assets/{useYamlActivityEvents-CWZwHIlR.js.map → useYamlActivityEvents-DRdetOb_.js.map} +1 -1
  218. package/dashboard/dist/assets/{users-BqmKVXR1.js → users-BUgdEsec.js} +2 -2
  219. package/dashboard/dist/assets/{users-BqmKVXR1.js.map → users-BUgdEsec.js.map} +1 -1
  220. package/dashboard/dist/assets/{vendor-icons-BaQqUm-e.js → vendor-icons-CNyYGNsk.js} +3 -3
  221. package/dashboard/dist/assets/{vendor-icons-BaQqUm-e.js.map → vendor-icons-CNyYGNsk.js.map} +1 -1
  222. package/dashboard/dist/assets/vendor-query-DLp59M9_.js +35 -0
  223. package/dashboard/dist/assets/vendor-query-DLp59M9_.js.map +1 -0
  224. package/dashboard/dist/assets/vendor-react-zA2lQFDs.js +26 -0
  225. package/dashboard/dist/assets/vendor-react-zA2lQFDs.js.map +1 -0
  226. package/dashboard/dist/assets/{workflows-Dps45zjk.js → workflows-BfyR5VJt.js} +2 -2
  227. package/dashboard/dist/assets/workflows-BfyR5VJt.js.map +1 -0
  228. package/dashboard/dist/assets/{yaml-workflows-DhlTkbvY.js → yaml-workflows-Bz7yEnhl.js} +2 -2
  229. package/dashboard/dist/assets/{yaml-workflows-DhlTkbvY.js.map → yaml-workflows-Bz7yEnhl.js.map} +1 -1
  230. package/dashboard/dist/index.html +5 -5
  231. package/docs/api/http/escalations.md +3 -3
  232. package/docs/api/http/workflows.md +2 -1
  233. package/docs/api/mcp/admin.md +13 -7
  234. package/docs/api/sdk/escalations.md +3 -1
  235. package/docs/api/sdk/workflows.md +3 -2
  236. package/docs/architecture.md +2 -2
  237. package/docs/dashboard.md +6 -5
  238. package/docs/iam.md +3 -3
  239. package/docs/workflows.md +7 -5
  240. package/package.json +2 -2
  241. package/dashboard/dist/assets/AdminDashboard-Bgomc_jH.js +0 -2
  242. package/dashboard/dist/assets/AgentConfigPage-C6gDgz21.js +0 -16
  243. package/dashboard/dist/assets/AgentConfigPage-C6gDgz21.js.map +0 -1
  244. package/dashboard/dist/assets/AgentDetailPage-0rrH5FmV.js +0 -4
  245. package/dashboard/dist/assets/AgentDetailPage-0rrH5FmV.js.map +0 -1
  246. package/dashboard/dist/assets/AgentsPage-DkIU2zed.js +0 -2
  247. package/dashboard/dist/assets/AgentsPage-DkIU2zed.js.map +0 -1
  248. package/dashboard/dist/assets/AvailableEscalationsPage-C9DAtNGp.js +0 -2
  249. package/dashboard/dist/assets/BotPicker-MnI3OyE7.js +0 -2
  250. package/dashboard/dist/assets/CapabilitiesPage-Cv_AD_5i.js +0 -2
  251. package/dashboard/dist/assets/CapabilitiesPage-Cv_AD_5i.js.map +0 -1
  252. package/dashboard/dist/assets/CollapsibleSection-Ne-Q3QFM.js +0 -2
  253. package/dashboard/dist/assets/ConfirmDeleteModal-D9_1b4MW.js +0 -2
  254. package/dashboard/dist/assets/CopyableId-blg-gZvT.js +0 -2
  255. package/dashboard/dist/assets/CredentialsPage-B3Mfwl22.js +0 -2
  256. package/dashboard/dist/assets/CredentialsPage-B3Mfwl22.js.map +0 -1
  257. package/dashboard/dist/assets/CronLabel-CtjUBRPo.js +0 -2
  258. package/dashboard/dist/assets/CronLabel-CtjUBRPo.js.map +0 -1
  259. package/dashboard/dist/assets/CustomDurationPicker-Cp1fgzPX.js +0 -2
  260. package/dashboard/dist/assets/DataTable-ZWgVQg7F.js +0 -2
  261. package/dashboard/dist/assets/DropZone-CZDmNBn-.js +0 -2
  262. package/dashboard/dist/assets/ElapsedCell-Gr5UlUbn.js +0 -2
  263. package/dashboard/dist/assets/EmptyState-BcsfPq9T.js +0 -2
  264. package/dashboard/dist/assets/EscalationSchemaPage-C5tuV6SJ.js +0 -9
  265. package/dashboard/dist/assets/EscalationSchemaPage-C5tuV6SJ.js.map +0 -1
  266. package/dashboard/dist/assets/EscalationsOverview-BIZVnSBF.js +0 -2
  267. package/dashboard/dist/assets/EventTable-90aUfsNr.js +0 -2
  268. package/dashboard/dist/assets/EventTable-90aUfsNr.js.map +0 -1
  269. package/dashboard/dist/assets/FilterBar-BQ2JGg8U.js +0 -2
  270. package/dashboard/dist/assets/FilterBar-BQ2JGg8U.js.map +0 -1
  271. package/dashboard/dist/assets/GraphInvokePage-Io5ZucT8.js +0 -2
  272. package/dashboard/dist/assets/GraphInvokePage-Io5ZucT8.js.map +0 -1
  273. package/dashboard/dist/assets/HomePage-Cu0vUzTF.js +0 -2
  274. package/dashboard/dist/assets/HomePage-Cu0vUzTF.js.map +0 -1
  275. package/dashboard/dist/assets/ListToolbar-CdmIvEIF.js +0 -2
  276. package/dashboard/dist/assets/McpOverview-C-Ypezuv.js +0 -2
  277. package/dashboard/dist/assets/McpQueryDetailPage-DdontKcj.js +0 -5
  278. package/dashboard/dist/assets/McpQueryDetailPage-DdontKcj.js.map +0 -1
  279. package/dashboard/dist/assets/McpQueryPage-D-1TaOGG.js +0 -2
  280. package/dashboard/dist/assets/McpQueryPage-D-1TaOGG.js.map +0 -1
  281. package/dashboard/dist/assets/McpRunDetailPage-B1sCxKLD.js +0 -2
  282. package/dashboard/dist/assets/McpRunsPage-eWJ7cDa3.js +0 -2
  283. package/dashboard/dist/assets/McpRunsPage-eWJ7cDa3.js.map +0 -1
  284. package/dashboard/dist/assets/Modal-CSrxpXeM.js +0 -2
  285. package/dashboard/dist/assets/NamespacePill-DlqBTvFR.js +0 -2
  286. package/dashboard/dist/assets/OperationsPage-C5phWL0O.js +0 -2
  287. package/dashboard/dist/assets/OperationsPage-C5phWL0O.js.map +0 -1
  288. package/dashboard/dist/assets/OperatorDashboard-YP6kP-f_.js +0 -2
  289. package/dashboard/dist/assets/PageHeader-CFta2VaS.js +0 -2
  290. package/dashboard/dist/assets/PageHeaderWithStats-CcVAji-7.js +0 -2
  291. package/dashboard/dist/assets/PageHeaderWithStats-CcVAji-7.js.map +0 -1
  292. package/dashboard/dist/assets/PriorityBadge-B4ykBH7f.js +0 -2
  293. package/dashboard/dist/assets/ProcessDetailPage-C_BXQvBs.js +0 -2
  294. package/dashboard/dist/assets/ProcessDetailPage-C_BXQvBs.js.map +0 -1
  295. package/dashboard/dist/assets/ProcessesListPage-BNhFwTLl.js +0 -2
  296. package/dashboard/dist/assets/RoleDetailPage-8GLNjj9I.js +0 -11
  297. package/dashboard/dist/assets/RoleDetailPage-8GLNjj9I.js.map +0 -1
  298. package/dashboard/dist/assets/RolePill-CXEyPMqb.js +0 -2
  299. package/dashboard/dist/assets/RolePill-CXEyPMqb.js.map +0 -1
  300. package/dashboard/dist/assets/RolesPage-B59tE2lZ.js +0 -2
  301. package/dashboard/dist/assets/RolesPage-B59tE2lZ.js.map +0 -1
  302. package/dashboard/dist/assets/RowActions-BA9L9djf.js +0 -2
  303. package/dashboard/dist/assets/RunAsSelector-CokM3Ifp.js +0 -2
  304. package/dashboard/dist/assets/StatCard-DlgF0CJC.js +0 -2
  305. package/dashboard/dist/assets/StatCard-DlgF0CJC.js.map +0 -1
  306. package/dashboard/dist/assets/StatusBadge-D9MeQHrh.js +0 -2
  307. package/dashboard/dist/assets/StickyPagination-_H2j2CAH.js +0 -2
  308. package/dashboard/dist/assets/StreamMessageDetail-sSfHDYIa.js +0 -2
  309. package/dashboard/dist/assets/StreamMessageDetail-sSfHDYIa.js.map +0 -1
  310. package/dashboard/dist/assets/SwimlaneTimeline-LZWtfBK3.js +0 -2
  311. package/dashboard/dist/assets/SwimlaneTimeline-LZWtfBK3.js.map +0 -1
  312. package/dashboard/dist/assets/TagInput-CQg-TrV9.js +0 -2
  313. package/dashboard/dist/assets/TaskDetailPage-CHBV2V6R.js +0 -2
  314. package/dashboard/dist/assets/TaskDetailPage-CHBV2V6R.js.map +0 -1
  315. package/dashboard/dist/assets/TaskQueuePill-DyvtL8X4.js +0 -2
  316. package/dashboard/dist/assets/TasksListPage-B71FxvrY.js +0 -2
  317. package/dashboard/dist/assets/TimeAgo-JgT0U_sd.js +0 -2
  318. package/dashboard/dist/assets/TimestampCell-gEreK8Nn.js +0 -2
  319. package/dashboard/dist/assets/ToolPill-miuRcj1Q.js +0 -2
  320. package/dashboard/dist/assets/ToolTestPanel-ChfHw9Aq.js +0 -2
  321. package/dashboard/dist/assets/TopicDetailPage-DigI0HGt.js +0 -9
  322. package/dashboard/dist/assets/TopicDetailPage-DigI0HGt.js.map +0 -1
  323. package/dashboard/dist/assets/TopicsPage-BHjlFpPN.js +0 -2
  324. package/dashboard/dist/assets/TopicsPage-BHjlFpPN.js.map +0 -1
  325. package/dashboard/dist/assets/UserName-uncbaKYf.js +0 -2
  326. package/dashboard/dist/assets/WorkflowExecutionPage-DwzLKTkt.js +0 -2
  327. package/dashboard/dist/assets/WorkflowPill-BegV-iRF.js +0 -2
  328. package/dashboard/dist/assets/WorkflowPill-BegV-iRF.js.map +0 -1
  329. package/dashboard/dist/assets/WorkflowsDashboard-rpnGhGnl.js +0 -2
  330. package/dashboard/dist/assets/WorkflowsDashboard-rpnGhGnl.js.map +0 -1
  331. package/dashboard/dist/assets/WorkflowsOverview-ihhW8DiS.js +0 -2
  332. package/dashboard/dist/assets/YamlWorkflowDetailPage-C61-8y-E.js +0 -33
  333. package/dashboard/dist/assets/YamlWorkflowsPage-CMpgsLEo.js +0 -2
  334. package/dashboard/dist/assets/capabilities-BBTPqF-V.js +0 -2
  335. package/dashboard/dist/assets/escalation-CyJ_wz-f.js +0 -2
  336. package/dashboard/dist/assets/escalation-columns-DU4Jyxxo.js +0 -2
  337. package/dashboard/dist/assets/escalation-columns-DU4Jyxxo.js.map +0 -1
  338. package/dashboard/dist/assets/index-BBQggGcf.js +0 -2
  339. package/dashboard/dist/assets/index-BBQggGcf.js.map +0 -1
  340. package/dashboard/dist/assets/index-BHS-ubrT.js +0 -6
  341. package/dashboard/dist/assets/index-BHS-ubrT.js.map +0 -1
  342. package/dashboard/dist/assets/index-BVHXREYZ.js +0 -2
  343. package/dashboard/dist/assets/index-BVHXREYZ.js.map +0 -1
  344. package/dashboard/dist/assets/index-BiLZJ43R.js +0 -6
  345. package/dashboard/dist/assets/index-BoZydcaW.js +0 -63
  346. package/dashboard/dist/assets/index-BoZydcaW.js.map +0 -1
  347. package/dashboard/dist/assets/index-CCHGKErT.js +0 -2
  348. package/dashboard/dist/assets/index-CNprOGuS.js +0 -2
  349. package/dashboard/dist/assets/index-CZ6-l8_0.css +0 -1
  350. package/dashboard/dist/assets/index-CgeFUhUr.js +0 -2
  351. package/dashboard/dist/assets/index-CgeFUhUr.js.map +0 -1
  352. package/dashboard/dist/assets/index-ChniBGqD.js +0 -9
  353. package/dashboard/dist/assets/index-ChniBGqD.js.map +0 -1
  354. package/dashboard/dist/assets/index-CjXzZ19T.js +0 -2
  355. package/dashboard/dist/assets/index-CjXzZ19T.js.map +0 -1
  356. package/dashboard/dist/assets/index-D9pi0fs6.js +0 -2
  357. package/dashboard/dist/assets/index-DoivEaUZ.js +0 -2
  358. package/dashboard/dist/assets/index-DoivEaUZ.js.map +0 -1
  359. package/dashboard/dist/assets/index-Dzqt3g-K.js +0 -2
  360. package/dashboard/dist/assets/vendor-query-B2UbickB.js +0 -18
  361. package/dashboard/dist/assets/vendor-query-B2UbickB.js.map +0 -1
  362. package/dashboard/dist/assets/vendor-react-CXumBFUA.js +0 -22
  363. package/dashboard/dist/assets/vendor-react-CXumBFUA.js.map +0 -1
  364. package/dashboard/dist/assets/workflows-Dps45zjk.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{u as n,b as t,c as u}from"./vendor-query-B2UbickB.js";import{d as s}from"./index-BoZydcaW.js";function f(){return n({queryKey:["activeWorkers"],queryFn:async()=>(await s("/workflows/workers")).workers})}function w(){return n({queryKey:["discoveredWorkflows"],queryFn:async()=>(await s("/workflows/discovered")).workflows})}function l(){return n({queryKey:["workflowConfigs"],queryFn:async()=>(await s("/workflows/config")).workflows})}function d(){return n({queryKey:["cronStatus"],queryFn:async()=>(await s("/workflows/cron/status")).schedules})}function k(e){return n({queryKey:["workflowExecution",e],queryFn:()=>s(`/workflow-states/${e}/execution`),enabled:!!e})}function m(e,o){const r=new URLSearchParams;return e.limit&&r.set("limit",String(e.limit)),e.offset!==void 0&&r.set("offset",String(e.offset)),e.entity&&r.set("entity",e.entity),e.search&&r.set("search",e.search),e.status&&r.set("status",e.status),e.sort_by&&r.set("sort_by",e.sort_by),e.order&&r.set("order",e.order),e.registered&&r.set("registered",e.registered),e.namespace&&r.set("namespace",e.namespace),n({queryKey:["jobs",e],queryFn:()=>s(`/workflow-states/jobs?${r}`),enabled:(o==null?void 0:o.enabled)??!0})}function q(){const e=t();return u({mutationFn:o=>s(`/workflows/${o}/terminate`,{method:"POST"}),onSuccess:(o,r)=>{e.invalidateQueries({queryKey:["workflowExecution",r],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function g(){const e=t();return u({mutationFn:({workflow_type:o,...r})=>s(`/workflows/${encodeURIComponent(o)}/config`,{method:"PUT",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function h(){const e=t();return u({mutationFn:o=>s(`/workflows/${encodeURIComponent(o)}/config`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function b(){const e=t();return u({mutationFn:({workflowType:o,data:r,metadata:i,execute_as:a})=>s(`/workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:r,metadata:i,...a?{execute_as:a}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}export{k as a,m as b,b as c,w as d,d as e,q as f,f as g,h,g as i,l as u};
2
- //# sourceMappingURL=workflows-Dps45zjk.js.map
1
+ import{u as n,b as t,c as u}from"./vendor-query-DLp59M9_.js";import{d as s}from"./index-DgCS2Frb.js";function f(){return n({queryKey:["activeWorkers"],queryFn:async()=>(await s("/workflows/workers")).workers})}function w(){return n({queryKey:["discoveredWorkflows"],queryFn:async()=>(await s("/workflows/discovered")).workflows})}function l(){return n({queryKey:["workflowConfigs"],queryFn:async()=>(await s("/workflows/config")).workflows})}function d(){return n({queryKey:["cronStatus"],queryFn:async()=>(await s("/workflows/cron/status")).schedules})}function k(e){return n({queryKey:["workflowExecution",e],queryFn:()=>s(`/workflow-states/${e}/execution`),enabled:!!e})}function m(e,o){const r=new URLSearchParams;return e.limit&&r.set("limit",String(e.limit)),e.offset!==void 0&&r.set("offset",String(e.offset)),e.entity&&r.set("entity",e.entity),e.search&&r.set("search",e.search),e.status&&r.set("status",e.status),e.sort_by&&r.set("sort_by",e.sort_by),e.order&&r.set("order",e.order),e.registered&&r.set("registered",e.registered),e.namespace&&r.set("namespace",e.namespace),n({queryKey:["jobs",e],queryFn:()=>s(`/workflow-states/jobs?${r}`),enabled:(o==null?void 0:o.enabled)??!0})}function q(){const e=t();return u({mutationFn:o=>s(`/workflows/${o}/terminate`,{method:"POST"}),onSuccess:(o,r)=>{e.invalidateQueries({queryKey:["workflowExecution",r],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function g(){const e=t();return u({mutationFn:({workflow_type:o,...r})=>s(`/workflows/${encodeURIComponent(o)}/config`,{method:"PUT",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function h(){const e=t();return u({mutationFn:o=>s(`/workflows/${encodeURIComponent(o)}/config`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function b(){const e=t();return u({mutationFn:({workflowType:o,data:r,metadata:i,execute_as:a})=>s(`/workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:r,metadata:i,...a?{execute_as:a}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}export{k as a,m as b,b as c,w as d,d as e,q as f,f as g,h,g as i,l as u};
2
+ //# sourceMappingURL=workflows-BfyR5VJt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows-BfyR5VJt.js","sources":["../../src/api/workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { ActiveWorker, CronScheduleEntry, DiscoveredWorkflow, LTJob, LTWorkflowConfig, WorkflowExecution } from './types';\n\nexport function useActiveWorkers() {\n return useQuery<ActiveWorker[]>({\n queryKey: ['activeWorkers'],\n queryFn: async () => {\n const res = await apiFetch<{ workers: ActiveWorker[] }>('/workflows/workers');\n return res.workers;\n },\n });\n}\n\nexport function useDiscoveredWorkflows() {\n return useQuery<DiscoveredWorkflow[]>({\n queryKey: ['discoveredWorkflows'],\n queryFn: async () => {\n const res = await apiFetch<{ workflows: DiscoveredWorkflow[] }>('/workflows/discovered');\n return res.workflows;\n },\n });\n}\n\nexport function useWorkflowConfigs() {\n return useQuery<LTWorkflowConfig[]>({\n queryKey: ['workflowConfigs'],\n queryFn: async () => {\n const res = await apiFetch<{ workflows: LTWorkflowConfig[] }>('/workflows/config');\n return res.workflows;\n },\n });\n}\n\nexport function useCronStatus() {\n return useQuery<CronScheduleEntry[]>({\n queryKey: ['cronStatus'],\n queryFn: async () => {\n const res = await apiFetch<{ schedules: CronScheduleEntry[] }>('/workflows/cron/status');\n return res.schedules;\n },\n });\n}\n\nexport function useWorkflowExecution(workflowId: string) {\n return useQuery<WorkflowExecution>({\n queryKey: ['workflowExecution', workflowId],\n queryFn: () =>\n apiFetch(`/workflow-states/${workflowId}/execution`),\n enabled: !!workflowId,\n });\n}\n\nexport function useWorkflowState(workflowId: string) {\n return useQuery<{ workflow_id: string; state: Record<string, unknown> }>({\n queryKey: ['workflowState', workflowId],\n queryFn: () => apiFetch(`/workflow-states/${workflowId}/state`),\n enabled: !!workflowId,\n });\n}\n\nexport function useJobs(filters: {\n limit?: number;\n offset?: number;\n entity?: string;\n search?: string;\n status?: string;\n sort_by?: string;\n order?: string;\n registered?: string;\n namespace?: string;\n}, options?: { enabled?: boolean }) {\n const params = new URLSearchParams();\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n if (filters.entity) params.set('entity', filters.entity);\n if (filters.search) params.set('search', filters.search);\n if (filters.status) params.set('status', filters.status);\n if (filters.sort_by) params.set('sort_by', filters.sort_by);\n if (filters.order) params.set('order', filters.order);\n if (filters.registered) params.set('registered', filters.registered);\n if (filters.namespace) params.set('namespace', filters.namespace);\n\n return useQuery<{ jobs: LTJob[]; total: number }>({\n queryKey: ['jobs', filters],\n queryFn: () => apiFetch(`/workflow-states/jobs?${params}`),\n enabled: options?.enabled ?? true,\n });\n}\n\nexport function useTerminateWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (workflowId: string) =>\n apiFetch(`/workflows/${workflowId}/terminate`, { method: 'POST' }),\n onSuccess: (_data, workflowId) => {\n queryClient.invalidateQueries({ queryKey: ['workflowExecution', workflowId], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['jobs'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpsertWorkflowConfig() {\n const queryClient = useQueryClient();\n return useMutation<\n LTWorkflowConfig,\n Error,\n {\n workflow_type: string;\n description?: string | null;\n\n invocable?: boolean;\n certified?: boolean;\n task_queue?: string | null;\n default_role?: string;\n roles?: string[];\n invocation_roles?: string[];\n consumes?: string[];\n envelope_schema?: Record<string, unknown> | null;\n resolver_schema?: Record<string, unknown> | null;\n cron_schedule?: string | null;\n execute_as?: string | null;\n }\n >({\n mutationFn: ({ workflow_type, ...body }) =>\n apiFetch(`/workflows/${encodeURIComponent(workflow_type)}/config`, {\n method: 'PUT',\n body: JSON.stringify(body),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['workflowConfigs'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteWorkflowConfig() {\n const queryClient = useQueryClient();\n return useMutation<{ deleted: boolean; workflow_type: string }, Error, string>({\n mutationFn: (workflowType) =>\n apiFetch(`/workflows/${encodeURIComponent(workflowType)}/config`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['workflowConfigs'], refetchType: 'all' });\n },\n });\n}\n\nexport function useSetCronSchedule() {\n const queryClient = useQueryClient();\n return useMutation<\n LTWorkflowConfig,\n Error,\n { config: LTWorkflowConfig; cron_schedule: string | null; envelope_schema?: Record<string, unknown> | null }\n >({\n mutationFn: ({ config, cron_schedule, envelope_schema }) =>\n apiFetch(`/workflows/${encodeURIComponent(config.workflow_type)}/config`, {\n method: 'PUT',\n body: JSON.stringify({\n ...config,\n cron_schedule,\n ...(envelope_schema !== undefined ? { envelope_schema } : {}),\n }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['workflowConfigs'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['cronStatus'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeWorkflow() {\n const queryClient = useQueryClient();\n return useMutation<\n { workflowId: string; message: string },\n Error,\n { workflowType: string; data: Record<string, unknown>; metadata?: Record<string, unknown>; execute_as?: string }\n >({\n mutationFn: ({ workflowType, data, metadata, execute_as }) =>\n apiFetch(`/workflows/${workflowType}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, metadata, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['tasks'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['jobs'], refetchType: 'all' });\n },\n });\n}\n"],"names":["useActiveWorkers","useQuery","apiFetch","useDiscoveredWorkflows","useWorkflowConfigs","useCronStatus","useWorkflowExecution","workflowId","useJobs","filters","options","params","useTerminateWorkflow","queryClient","useQueryClient","useMutation","_data","useUpsertWorkflowConfig","workflow_type","body","useDeleteWorkflowConfig","workflowType","useInvokeWorkflow","data","metadata","execute_as"],"mappings":"qGAIO,SAASA,GAAmB,CACjC,OAAOC,EAAyB,CAC9B,SAAU,CAAC,eAAe,EAC1B,QAAS,UACK,MAAMC,EAAsC,oBAAoB,GACjE,OACb,CACD,CACH,CAEO,SAASC,GAAyB,CACvC,OAAOF,EAA+B,CACpC,SAAU,CAAC,qBAAqB,EAChC,QAAS,UACK,MAAMC,EAA8C,uBAAuB,GAC5E,SACb,CACD,CACH,CAEO,SAASE,GAAqB,CACnC,OAAOH,EAA6B,CAClC,SAAU,CAAC,iBAAiB,EAC5B,QAAS,UACK,MAAMC,EAA4C,mBAAmB,GACtE,SACb,CACD,CACH,CAEO,SAASG,GAAgB,CAC9B,OAAOJ,EAA8B,CACnC,SAAU,CAAC,YAAY,EACvB,QAAS,UACK,MAAMC,EAA6C,wBAAwB,GAC5E,SACb,CACD,CACH,CAEO,SAASI,EAAqBC,EAAoB,CACvD,OAAON,EAA4B,CACjC,SAAU,CAAC,oBAAqBM,CAAU,EAC1C,QAAS,IACPL,EAAS,oBAAoBK,CAAU,YAAY,EACrD,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAUO,SAASC,EAAQC,EAUrBC,EAAiC,CAClC,MAAMC,EAAS,IAAI,gBACnB,OAAIF,EAAQ,OAAOE,EAAO,IAAI,QAAS,OAAOF,EAAQ,KAAK,CAAC,EACxDA,EAAQ,SAAW,QAAWE,EAAO,IAAI,SAAU,OAAOF,EAAQ,MAAM,CAAC,EACzEA,EAAQ,QAAQE,EAAO,IAAI,SAAUF,EAAQ,MAAM,EACnDA,EAAQ,QAAQE,EAAO,IAAI,SAAUF,EAAQ,MAAM,EACnDA,EAAQ,QAAQE,EAAO,IAAI,SAAUF,EAAQ,MAAM,EACnDA,EAAQ,SAASE,EAAO,IAAI,UAAWF,EAAQ,OAAO,EACtDA,EAAQ,OAAOE,EAAO,IAAI,QAASF,EAAQ,KAAK,EAChDA,EAAQ,YAAYE,EAAO,IAAI,aAAcF,EAAQ,UAAU,EAC/DA,EAAQ,WAAWE,EAAO,IAAI,YAAaF,EAAQ,SAAS,EAEzDR,EAA2C,CAChD,SAAU,CAAC,OAAQQ,CAAO,EAC1B,QAAS,IAAMP,EAAS,yBAAyBS,CAAM,EAAE,EACzD,SAASD,GAAA,YAAAA,EAAS,UAAW,EAAA,CAC9B,CACH,CAEO,SAASE,GAAuB,CACrC,MAAMC,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaR,GACXL,EAAS,cAAcK,CAAU,aAAc,CAAE,OAAQ,OAAQ,EACnE,UAAW,CAACS,EAAOT,IAAe,CAChCM,EAAY,kBAAkB,CAAE,SAAU,CAAC,oBAAqBN,CAAU,EAAG,YAAa,MAAO,EACjGM,EAAY,kBAAkB,CAAE,SAAU,CAAC,MAAM,EAAG,YAAa,MAAO,CAC1E,CAAA,CACD,CACH,CAEO,SAASI,GAA0B,CACxC,MAAMJ,EAAcC,EAAA,EACpB,OAAOC,EAmBL,CACA,WAAY,CAAC,CAAE,cAAAG,EAAe,GAAGC,CAAA,IAC/BjB,EAAS,cAAc,mBAAmBgB,CAAa,CAAC,UAAW,CACjE,OAAQ,MACR,KAAM,KAAK,UAAUC,CAAI,CAAA,CAC1B,EACH,UAAW,IAAM,CACfN,EAAY,kBAAkB,CAAE,SAAU,CAAC,iBAAiB,EAAG,YAAa,MAAO,CACrF,CAAA,CACD,CACH,CAEO,SAASO,GAA0B,CACxC,MAAMP,EAAcC,EAAA,EACpB,OAAOC,EAAwE,CAC7E,WAAaM,GACXnB,EAAS,cAAc,mBAAmBmB,CAAY,CAAC,UAAW,CAChE,OAAQ,QAAA,CACT,EACH,UAAW,IAAM,CACfR,EAAY,kBAAkB,CAAE,SAAU,CAAC,iBAAiB,EAAG,YAAa,MAAO,CACrF,CAAA,CACD,CACH,CAyBO,SAASS,GAAoB,CAClC,MAAMT,EAAcC,EAAA,EACpB,OAAOC,EAIL,CACA,WAAY,CAAC,CAAE,aAAAM,EAAc,KAAAE,EAAM,SAAAC,EAAU,WAAAC,KAC3CvB,EAAS,cAAcmB,CAAY,UAAW,CAC5C,OAAQ,OACR,KAAM,KAAK,UAAU,CAAE,KAAAE,EAAM,SAAAC,EAAU,GAAIC,EAAa,CAAE,WAAAA,CAAA,EAAe,GAAK,CAAA,CAC/E,EACH,UAAW,IAAM,CACfZ,EAAY,kBAAkB,CAAE,SAAU,CAAC,OAAO,EAAG,YAAa,MAAO,EACzEA,EAAY,kBAAkB,CAAE,SAAU,CAAC,MAAM,EAAG,YAAa,MAAO,CAC1E,CAAA,CACD,CACH"}
@@ -1,2 +1,2 @@
1
- import{u as l,b as a,c as s}from"./vendor-query-B2UbickB.js";import{d as r}from"./index-BoZydcaW.js";function f(e={}){const o=new URLSearchParams;return e.status&&o.set("status",e.status),e.graph_topic&&o.set("graph_topic",e.graph_topic),e.app_id&&o.set("app_id",e.app_id),e.search&&o.set("search",e.search),e.set_id&&o.set("set_id",e.set_id),e.limit&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows?${o}`)})}function m(){return l({queryKey:["yamlWorkflowAppIds"],queryFn:()=>r("/yaml-workflows/app-ids")})}function c(e){return l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows/${e}`),enabled:!!e})}function w(){const e=a();return s({mutationFn:o=>r("/yaml-workflows",{method:"POST",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function k(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/deploy`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function p(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/activate`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function d(){const e=a();return s({mutationFn:({id:o,data:t,sync:n,execute_as:u})=>r(`/yaml-workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,sync:n,...u?{execute_as:u}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function h(){const e=a();return s({mutationFn:({id:o,task_queue:t,compilation_feedback:n})=>r(`/yaml-workflows/${o}/regenerate`,{method:"POST",body:JSON.stringify({task_queue:t,compilation_feedback:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function q(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/archive`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function W(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/restore`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"}),e.invalidateQueries({queryKey:["yamlWorkflow"],refetchType:"all"})}})}function S(){const e=a();return s({mutationFn:({id:o,...t})=>r(`/yaml-workflows/${o}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function v(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function T(e){return l({queryKey:["yamlWorkflows",e,"versions"],queryFn:()=>r(`/yaml-workflows/${e}/versions`),enabled:!!e})}function F(e,o){return l({queryKey:["yamlWorkflows",e,"versions",o],queryFn:()=>r(`/yaml-workflows/${e}/versions/${o}`),enabled:!!e&&o!==null})}export{m as a,S as b,c,T as d,k as e,p as f,q as g,W as h,v as i,h as j,F as k,d as l,w as m,f as u};
2
- //# sourceMappingURL=yaml-workflows-DhlTkbvY.js.map
1
+ import{u as l,b as a,c as s}from"./vendor-query-DLp59M9_.js";import{d as r}from"./index-DgCS2Frb.js";function f(e={}){const o=new URLSearchParams;return e.status&&o.set("status",e.status),e.graph_topic&&o.set("graph_topic",e.graph_topic),e.app_id&&o.set("app_id",e.app_id),e.search&&o.set("search",e.search),e.set_id&&o.set("set_id",e.set_id),e.limit&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows?${o}`)})}function m(){return l({queryKey:["yamlWorkflowAppIds"],queryFn:()=>r("/yaml-workflows/app-ids")})}function c(e){return l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows/${e}`),enabled:!!e})}function w(){const e=a();return s({mutationFn:o=>r("/yaml-workflows",{method:"POST",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function k(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/deploy`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function p(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/activate`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function d(){const e=a();return s({mutationFn:({id:o,data:t,sync:n,execute_as:u})=>r(`/yaml-workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,sync:n,...u?{execute_as:u}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function h(){const e=a();return s({mutationFn:({id:o,task_queue:t,compilation_feedback:n})=>r(`/yaml-workflows/${o}/regenerate`,{method:"POST",body:JSON.stringify({task_queue:t,compilation_feedback:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function q(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/archive`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function W(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/restore`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"}),e.invalidateQueries({queryKey:["yamlWorkflow"],refetchType:"all"})}})}function S(){const e=a();return s({mutationFn:({id:o,...t})=>r(`/yaml-workflows/${o}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function v(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function T(e){return l({queryKey:["yamlWorkflows",e,"versions"],queryFn:()=>r(`/yaml-workflows/${e}/versions`),enabled:!!e})}function F(e,o){return l({queryKey:["yamlWorkflows",e,"versions",o],queryFn:()=>r(`/yaml-workflows/${e}/versions/${o}`),enabled:!!e&&o!==null})}export{m as a,S as b,c,T as d,k as e,p as f,q as g,W as h,v as i,h as j,F as k,d as l,w as m,f as u};
2
+ //# sourceMappingURL=yaml-workflows-Bz7yEnhl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"yaml-workflows-DhlTkbvY.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
1
+ {"version":3,"file":"yaml-workflows-Bz7yEnhl.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
@@ -8,11 +8,11 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
11
- <script type="module" crossorigin src="./assets/index-BoZydcaW.js"></script>
12
- <link rel="modulepreload" crossorigin href="./assets/vendor-query-B2UbickB.js">
13
- <link rel="modulepreload" crossorigin href="./assets/vendor-react-CXumBFUA.js">
14
- <link rel="modulepreload" crossorigin href="./assets/vendor-icons-BaQqUm-e.js">
15
- <link rel="stylesheet" crossorigin href="./assets/index-CZ6-l8_0.css">
11
+ <script type="module" crossorigin src="./assets/index-DgCS2Frb.js"></script>
12
+ <link rel="modulepreload" crossorigin href="./assets/vendor-query-DLp59M9_.js">
13
+ <link rel="modulepreload" crossorigin href="./assets/vendor-react-zA2lQFDs.js">
14
+ <link rel="modulepreload" crossorigin href="./assets/vendor-icons-CNyYGNsk.js">
15
+ <link rel="stylesheet" crossorigin href="./assets/index-CC4g-6QE.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
@@ -667,7 +667,7 @@ Reassign multiple escalations to a different role. Requires admin or superadmin
667
667
  POST /api/escalations/bulk-triage
668
668
  ```
669
669
 
670
- Resolve multiple escalations and start AI triage workflows (mcpTriage) for each. Requires admin or superadmin permission for the escalation roles.
670
+ Resolve multiple escalations and start AI triage workflows (mcpTriage) for each. Rows backing a live `condition()` waiter (`signal_key` set) stay `pending` and are excluded from `triaged` — settle those individually via `POST /:id/resolve`, which carries the workflow's wake. Requires admin or superadmin permission for the escalation roles.
671
671
 
672
672
  **Request body:**
673
673
 
@@ -1044,7 +1044,7 @@ Single atomic query finds the pending escalation by metadata, auto-claims if unc
1044
1044
  POST /api/escalations/resolve-by-ids
1045
1045
  ```
1046
1046
 
1047
- Resolve many escalations in one guarded statement — the set-based sibling of `POST /:id/resolve`. Used for bookkeeping rows that are woken collectively (it does not deliver a per-row signal). RBAC: a scoped caller may only resolve rows whose role they hold (global principals are unrestricted).
1047
+ Resolve many escalations in one guarded statement — the set-based sibling of `POST /:id/resolve`. Used for bookkeeping rows that are woken collectively (it does not deliver a per-row signal). The store enforces this: rows backing a live `condition()` waiter (`signal_key` set) stay `pending` and are excluded from the response — settle those via `POST /:id/resolve`, which carries the wake. RBAC: a scoped caller may only resolve rows whose role they hold (global principals are unrestricted).
1048
1048
 
1049
1049
  | Field | Type | Required | Description |
1050
1050
  |-------|------|----------|-------------|
@@ -1052,7 +1052,7 @@ Resolve many escalations in one guarded statement — the set-based sibling of `
1052
1052
  | `resolverPayload` | `object` | yes | Payload applied to every row |
1053
1053
  | `metadata` | `object` | no | Outcome patch merged into each row's GIN-indexed metadata |
1054
1054
 
1055
- **Response 200:** `{ "resolved": <count>, "escalationIds": [...] }` — only the rows that were still `pending` are resolved and returned.
1055
+ **Response 200:** `{ "resolved": <count>, "escalationIds": [...] }` — only still-`pending` rows without a `signal_key` are resolved and returned.
1056
1056
 
1057
1057
  ## Faceted search
1058
1058
 
@@ -130,10 +130,11 @@ PUT /api/workflows/:type/config
130
130
  | Field | Type | Default | Description |
131
131
  |-------|------|---------|-------------|
132
132
  | `invocable` | `boolean` | `false` | Allow this workflow to be started via `POST /api/workflows/:type/invoke` |
133
+ | `certified` | `boolean` | derived | Explicit HITL certification (interceptor treatment). Omitted → derived from roles/consumes presence. |
133
134
  | `task_queue` | `string \| null` | `null` | Task queue name (required for invocable workflows) |
134
135
  | `default_role` | `string` | `"reviewer"` | Role assigned to escalations when the workflow doesn't specify one |
135
136
  | `description` | `string \| null` | `null` | Human-readable description |
136
- | `roles` | `string[]` | `[]` | Roles allowed to claim escalations for this workflow |
137
+ | `roles` | `string[]` | `[]` | Interceptor default for who can claim interceptor-raised escalations. Escalations raised in workflow code choose their own role, whose versioned schema takes precedence. |
137
138
  | `invocation_roles` | `string[]` | `[]` | Roles allowed to invoke via API. Empty = any authenticated user. |
138
139
  | `consumes` | `string[]` | `[]` | Workflow types whose completed data this workflow receives via `envelope.lt.providers` |
139
140
  | `execute_as` | `string \| null` | `null` | Service account `external_id` to run as (overrides invoker identity) |
@@ -15,7 +15,7 @@ Each tool below is marked **Read-safe**. A service-account key scoped `mcp:read`
15
15
 
16
16
  ## Compile Hints
17
17
 
18
- Admin tools modify system configuration. certify_workflow and decertify_workflow change interceptor behavior.
18
+ Admin tools modify system configuration. upsert_workflow_config's `certified` flag and delete_workflow_config change interceptor behavior.
19
19
 
20
20
  ## Tasks
21
21
 
@@ -231,7 +231,10 @@ Release all escalation claims that exceeded their lock duration.
231
231
 
232
232
  ### bulk_triage
233
233
 
234
- Resolve escalations for triage and start mcpTriage workflows.
234
+ Resolve escalations for triage and start mcpTriage workflows. Rows backing a
235
+ live `condition()` waiter (`signal_key` set) stay `pending` and are excluded
236
+ from the result — settle those with the targeted resolve, which carries the
237
+ workflow's wake.
235
238
 
236
239
  | | |
237
240
  |---|---|
@@ -400,11 +403,12 @@ Create or replace a workflow configuration (certify). Activates the interceptor
400
403
  |-------|------|----------|-------------|
401
404
  | workflow_type | string | Yes | Workflow type identifier |
402
405
  | invocable | boolean | No | Whether the workflow can be invoked externally |
406
+ | certified | boolean | No | Explicit HITL certification (interceptor treatment). Omitted → derived from roles/consumes presence. |
403
407
  | task_queue | string | No | HotMesh task queue |
404
408
  | default_role | string | No | Default escalation role |
405
409
  | description | string | No | Workflow description |
406
410
  | execute_as | string | No | Execution identity |
407
- | roles | string[] | No | Allowed roles |
411
+ | roles | string[] | No | Interceptor default for who resolves interceptor-raised escalations |
408
412
  | invocation_roles | string[] | No | Roles allowed to invoke |
409
413
  | consumes | string[] | No | Event topics consumed |
410
414
  | tool_tags | string[] | No | Tool tags for routing |
@@ -412,7 +416,7 @@ Create or replace a workflow configuration (certify). Activates the interceptor
412
416
 
413
417
  ### delete_workflow_config
414
418
 
415
- De-certify a workflow by removing its config entry.
419
+ Unregister a workflow by deleting its config entry. To demote certified → registered while keeping the registration, use `upsert_workflow_config` with `certified: false`.
416
420
 
417
421
  | | |
418
422
  |---|---|
@@ -1160,10 +1164,12 @@ happened and where to look, not how to "fix" a job.
1160
1164
  **Read this first — what is and isn't a problem.** A workflow suspended at a
1161
1165
  `condition()` / `waitFor()` / `sleepFor()` can sit idle for days legitimately,
1162
1166
  and HotMesh only bumps `updated_at` when a job's status changes. A frozen
1163
- `updated_at` is therefore the *normal* signature of a wait, **not** a fault. The
1167
+ `updated_at` is therefore the *normal* signature of a wait, **not** a fault. A
1168
+ reservation whose holder died self-heals: the message redelivers once the
1169
+ reclaim window lapses (~90s worst case) and the activity re-executes. The
1164
1170
  genuinely broken signals are: a dead-lettered message (retries exhausted), a
1165
- reservation leak (claimed but never ACK'd past the reclaim window), and a
1166
- suspended waiter with **no** escalation row.
1171
+ reservation still held past several reclaim windows, and a suspended waiter
1172
+ with **no** escalation row.
1167
1173
 
1168
1174
  **Recommended flow:** start fleet-wide with `find_orphaned_signals` (the
1169
1175
  genuinely-broken case) or `find_stalled_jobs` (candidates worth a look), then run
@@ -635,6 +635,8 @@ Trigger AI triage for multiple escalations.
635
635
 
636
636
  Resolves each escalation and starts a triage workflow that uses MCP tools to analyze and potentially auto-resolve the issue.
637
637
 
638
+ Rows backing a live `condition()` waiter (`signal_key` set) stay `pending` and are excluded from `triaged` — their resolution must carry the workflow's wake, which only the targeted `resolve` delivers. Settle those individually with `resolve` or `cancel`.
639
+
638
640
  ```typescript
639
641
  const result = await lt.escalations.bulkTriage({
640
642
  ids: ['esc_1', 'esc_2'],
@@ -803,7 +805,7 @@ const result = await lt.escalations.resolveByMetadata({
803
805
 
804
806
  ## resolveByIds
805
807
 
806
- Resolve a set of escalations by id in one guarded statement (the set-based sibling of `resolve`). For bookkeeping rows woken collectively — it does not deliver a per-row signal. RBAC: a scoped caller may only resolve rows whose role they hold.
808
+ Resolve a set of escalations by id in one guarded statement (the set-based sibling of `resolve`). For bookkeeping rows woken collectively — it does not deliver a per-row signal, and the store enforces that: rows backing a live `condition()` waiter (`signal_key` set) stay `pending` and are excluded from the result. Settle waiter rows individually with `resolve`, which carries the wake. RBAC: a scoped caller may only resolve rows whose role they hold.
807
809
 
808
810
  ```typescript
809
811
  const result = await lt.escalations.resolveByIds({
@@ -152,7 +152,7 @@ const result = await lt.workflows.listDiscovered({ include_system: false });
152
152
  |-------|------|----------|-------------|
153
153
  | `include_system` | `boolean` | No | Include system workflows (default: false) |
154
154
 
155
- **Returns:** `LTApiResult<{ workflows: [{ workflow_type, task_queue, registered, active, invocable, system, description, roles, invocation_roles, execute_as }] }>`
155
+ **Returns:** `LTApiResult<{ workflows: [{ workflow_type, task_queue, tier, registered, active, invocable, system, description, roles, invocation_roles, execute_as }] }>` — `tier` is `certified`, `registered`, or `durable`.
156
156
 
157
157
  **Auth:** Not required
158
158
 
@@ -232,11 +232,12 @@ const result = await lt.workflows.upsertConfig({
232
232
  |-------|------|----------|-------------|
233
233
  | `type` | `string` | Yes | Workflow type name |
234
234
  | `invocable` | `boolean` | No | Whether the workflow can be started via the API |
235
+ | `certified` | `boolean` | No | Explicit HITL certification (interceptor treatment). Omitted → derived from roles/consumes presence. |
235
236
  | `task_queue` | `string \| null` | No | HotMesh task queue |
236
237
  | `default_role` | `string` | No | Default escalation role |
237
238
  | `description` | `string \| null` | No | Human-readable description |
238
239
  | `execute_as` | `string \| null` | No | Service account for proxy invocation |
239
- | `roles` | `string[]` | No | Roles that can resolve escalations |
240
+ | `roles` | `string[]` | No | Interceptor default for who resolves interceptor-raised escalations |
240
241
  | `invocation_roles` | `string[]` | No | Roles that can invoke this workflow |
241
242
  | `consumes` | `string[]` | No | Workflow types whose data this workflow consumes |
242
243
  | `tool_tags` | `string[]` | No | MCP tool tags for discovery |
@@ -112,7 +112,7 @@ A durable workflow has no entry in `lt_config_workflows`. It runs, but without i
112
112
 
113
113
  ### Certified
114
114
 
115
- A certified workflow is durable plus the full Long Tail control plane. It has an entry in `lt_config_workflows`, which activates:
115
+ A certified workflow is durable plus the full Long Tail control plane. It has an entry in `lt_config_workflows` with `certified: true`, which activates:
116
116
 
117
117
  - **Interceptor wrapping** — every execution is tracked as a task in `lt_tasks` with full audit trail.
118
118
  - **Escalation chains** — returning `{ type: 'escalation' }` creates a reviewable record, routes to the correct role, and triggers re-runs on resolution.
@@ -120,7 +120,7 @@ A certified workflow is durable plus the full Long Tail control plane. It has an
120
120
  - **Invocation controls** — `invocable: true` exposes the workflow for external invocation via the API and dashboard.
121
121
  - **Execution identity** — roles, default assignees, and `execute_as` overrides are defined in the config.
122
122
 
123
- In the dashboard, certified workflows display a **ShieldCheck** icon with a "Certified" label in accent blue. Promote a durable workflow to certified by creating a config entry; de-certify by removing it. The workflow code does not change.
123
+ In the dashboard, certified workflows display a **ShieldCheck** icon with a "Certified" label in accent blue. A registration without certification ("Registered" tier) keeps invocation controls and schema-driven forms while skipping the interceptor. Certification is the `certified` flag on the registration: promote by checking Certify (or `certified: true` in the config), demote by unchecking it — escalation roles and dependencies stay on the row. Unregistering deletes the entry entirely. The workflow code does not change.
124
124
 
125
125
  ### Pipeline
126
126
 
package/docs/dashboard.md CHANGED
@@ -64,15 +64,15 @@ The top navigation bar contains:
64
64
 
65
65
  ### Workflow Registry
66
66
 
67
- Shows every workflow the system has discovered across all registered workers. Each workflow displays one of three tiers:
67
+ Shows every workflow the system has discovered across all registered workers. Each workflow displays one of three tiers — direct states of the registration:
68
68
 
69
- - **Certified** (ShieldCheck icon) — has an `lt_config_workflows` entry with roles or consumes. Full interceptor tracking, escalation chains, and invocation controls.
70
- - **Configured** (Settings icon) — has a config entry but no roles. Invocation controls and schema-driven forms, but no automatic escalation routing.
71
- - **Durable** (Wrench icon) — registered as a HotMesh worker but not configured. Checkpointed execution and retries, but no interceptor wrapping.
69
+ - **Certified** (ShieldCheck icon) — has an `lt_config_workflows` entry with `certified: true`. Full interceptor tracking, escalation defaults, and invocation controls.
70
+ - **Registered** (Settings icon) — has a registration with `certified: false`. Invocation controls and schema-driven forms, without interceptor wrapping.
71
+ - **Durable** (Wrench icon) — runs as a HotMesh worker with no registration. Checkpointed execution and retries only.
72
72
 
73
73
  **Columns:** Workflow (pill + description), Queue (bordered pill), Tier (icon + label), Access (escalation roles with shield icon, invocation roles with user-check icon).
74
74
 
75
- **Row actions** (on hover): Play (invoke), Wrench (configure durable), ShieldPlus (certify configured), ShieldOff (de-certify).
75
+ **Row actions** (on hover): Play (invoke), Wrench (register durable), ShieldPlus (certify registered), ShieldOff (unregister — deletes the registration). To demote certified → registered, open the workflow and uncheck **Certify for HITL Escalation**; escalation roles, dependencies, and schemas stay on the registration.
76
76
 
77
77
  **Inline config via `start()`:** Developers can declare workflow profiles directly in the `start()` config by adding a `config` block to any worker entry. This auto-seeds the workflow into `lt_config_workflows` at startup — no manual API calls or dashboard wizard needed. Roles referenced in the config are auto-created.
78
78
 
@@ -84,6 +84,7 @@ workers: [
84
84
  config: {
85
85
  description: 'My workflow description',
86
86
  invocable: true,
87
+ certified: true,
87
88
  roles: ['reviewer', 'admin'],
88
89
  envelopeSchema: { data: { field1: '', field2: 0 } },
89
90
  resolverSchema: { approved: true, notes: '' },
package/docs/iam.md CHANGED
@@ -51,11 +51,11 @@ Long Tail has three workflow types (see the [Workflows Guide](workflows.md#three
51
51
 
52
52
  **Durable workflows** are the baseline. Every workflow registered with HotMesh is durable: checkpointed to Postgres, restartable after crashes, with full IAM context. If an activity throws, the workflow fails.
53
53
 
54
- **Certified workflows** add the interceptor. The interceptor wraps every execution so that failures escalate to a human reviewer instead of throwing. A certified workflow has an entry in `lt_config_workflows` that defines its escalation chain, invocation roles, and optional `execute_as` service account. It gets never-fail guarantees — when an LLM call returns garbage or an API is down, the workflow pauses and creates a human task rather than dying.
54
+ **Certified workflows** add the interceptor. The interceptor wraps every execution so that failures escalate to a human reviewer instead of throwing. A certified workflow has an entry in `lt_config_workflows` with `certified: true` that defines its escalation defaults, invocation roles, and optional `execute_as` service account. It gets never-fail guarantees — when an LLM call returns garbage or an API is down, the workflow pauses and creates a human task rather than dying.
55
55
 
56
56
  **Pipeline workflows** are compiled deterministic workflows that execute tool calls without an LLM. They inherit the IAM context of the invoking workflow — the principal, credentials, and trace lineage all propagate through the YAML DAG execution.
57
57
 
58
- Any durable workflow can be promoted to certified through the Workflow Registry in the dashboard. Registration adds the interceptor config; de-registration removes it. The workflow code does not change.
58
+ Any durable workflow can be promoted through the Workflow Registry in the dashboard: registering creates the config entry (invocation + schemas), and the Certify checkbox turns on the interceptor. Unchecking Certify demotes to registered and keeps the config; unregistering deletes it. The workflow code does not change.
59
59
 
60
60
  ## Service Accounts
61
61
 
@@ -196,7 +196,7 @@ When an activity calls `getCredential('anthropic')` and no credential exists in
196
196
 
197
197
  The dashboard surfaces IAM across four pages:
198
198
 
199
- **Workflow Registry** (`/workflows/registry`) — lists all discovered workflows. Certified workflows display a ShieldCheck badge in accent blue; pipeline workflows display a Wand2 icon in purple; durable workflows show the standard Workflow icon. Use ShieldPlus to certify a durable workflow or ShieldOff to de-certify.
199
+ **Workflow Registry** (`/workflows/registry`) — lists all discovered workflows. Certified workflows display a ShieldCheck badge in accent blue; pipeline workflows display a Wand2 icon in purple; durable workflows show the standard Workflow icon. Use ShieldPlus to certify a registered workflow, the Certify checkbox on the detail page to promote or demote, and ShieldOff to unregister.
200
200
 
201
201
  **Accounts** (`/admin/users`) — unified management for User Accounts and Service Accounts via tab toggle. Create service accounts, assign roles, generate API keys. The key generation flow displays the raw key once; it cannot be retrieved after dismissal.
202
202
 
package/docs/workflows.md CHANGED
@@ -18,7 +18,7 @@ A durable workflow is a plain async function. No config entry, no interceptor in
18
18
 
19
19
  ### Certified
20
20
 
21
- A certified workflow is durable plus the full Long Tail control plane. It has an entry in the `lt_config_workflows` table, which activates:
21
+ A certified workflow is durable plus the full Long Tail control plane. It has an entry in the `lt_config_workflows` table with `certified: true`, which activates:
22
22
 
23
23
  - **Interceptor wrapping** — every execution is tracked as a task in `lt_tasks` with full audit trail.
24
24
  - **Escalation chains** — returning `{ type: 'escalation' }` creates a reviewable record, routes to the correct role, and triggers re-runs on resolution.
@@ -28,14 +28,16 @@ A certified workflow is durable plus the full Long Tail control plane. It has an
28
28
 
29
29
  In the dashboard, certified workflows display a ShieldCheck icon with a "Certified" label in accent blue. Durable workflows display a muted "Durable" badge. Both are invocable from the same **Invoke Workflow** page; the distinction is how much operational infrastructure backs them.
30
30
 
31
- To certify a workflow, create a config entry:
31
+ To certify a workflow, create a config entry with the `certified` flag:
32
32
 
33
33
  ```
34
34
  PUT /api/workflows/myWorkflow/config
35
- { "default_role": "reviewer", "roles": ["reviewer"], "invocable": true }
35
+ { "certified": true, "default_role": "reviewer", "roles": ["reviewer"], "invocable": true }
36
36
  ```
37
37
 
38
- To de-certify, delete the config. The workflow remains durable it just loses interceptor tracking.
38
+ A registration with `certified: false` is the "Registered" tier — invocation controls and schema-driven forms, without interceptor tracking. To de-certify, save the config with `certified: false` (roles and consumes stay on the row for re-certification). To unregister entirely, delete the config; the workflow remains durable.
39
+
40
+ The `roles` list is the interceptor default for who can claim and resolve interceptor-raised escalations. Escalations raised in workflow code choose their own role at the escalation boundary, and that role's versioned escalation schema takes precedence over anything on the workflow config.
39
41
 
40
42
  ### Pipeline
41
43
 
@@ -163,7 +165,7 @@ When an activity completes, its result is checkpointed in PostgreSQL. If the pro
163
165
 
164
166
  - Activities that already completed are **not re-executed** — their cached results are replayed
165
167
  - The workflow resumes from the **last checkpoint**, not the beginning
166
- - External services (OpenAI, databases) are not called twice
168
+ - An activity that was **mid-flight** at the crash is redelivered once its stream reservation lapses (`HMSH_RESERVATION_TIMEOUT_S`, ~90s worst case) and **re-executes** — delivery is at-least-once, so activity side effects (HTTP calls, bookings, emails) should be idempotent
167
169
 
168
170
  This is what `proxyActivities()` provides. The raw function becomes a durable checkpoint:
169
171
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/long-tail",
3
- "version": "0.7.5",
3
+ "version": "0.8.1",
4
4
  "description": "Long Tail Workflows — Durable AI workflows with human-in-the-loop escalation. Powered by PostgreSQL.",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -71,7 +71,7 @@
71
71
  "@anthropic-ai/sdk": "^0.92.0",
72
72
  "@aws-sdk/client-s3": "^3.1017.0",
73
73
  "@aws-sdk/s3-request-presigner": "^3.1045.0",
74
- "@hotmeshio/hotmesh": "^0.25.5",
74
+ "@hotmeshio/hotmesh": "^0.25.6",
75
75
  "@modelcontextprotocol/sdk": "^1.27.1",
76
76
  "@opentelemetry/exporter-trace-otlp-proto": "^0.215.0",
77
77
  "@opentelemetry/resources": "^2.5.1",
@@ -1,2 +0,0 @@
1
- import{j as o}from"./vendor-query-B2UbickB.js";import{c as n}from"./tasks-BPNj8ZWL.js";import{t as m}from"./index-BoZydcaW.js";import{f as c}from"./useEventHooks-BgdnN8Rj.js";import{u}from"./mcp-Cx9L42EN.js";import{P as d}from"./PageHeaderWithStats-CcVAji-7.js";import"./vendor-react-CXumBFUA.js";import"./vendor-icons-BaQqUm-e.js";function j(){var a;c();const{data:s}=n({limit:1}),{data:e}=m({status:"pending",limit:1}),{data:t}=u(),r=((a=t==null?void 0:t.servers)==null?void 0:a.filter(i=>i.status==="connected").length)??0,l=t?`${r}/${t.total}`:"—";return o.jsx("div",{children:o.jsx(d,{title:"Admin",stats:[{label:"Tasks",value:(s==null?void 0:s.total)??"—"},{label:"Pending Escalations",value:(e==null?void 0:e.total)??"—",dotClass:"bg-status-pending"},{label:"MCP Servers",value:l},{label:"System",value:"Healthy",dotClass:"bg-status-success"}]})})}export{j as AdminDashboard};
2
- //# sourceMappingURL=AdminDashboard-Bgomc_jH.js.map
@@ -1,16 +0,0 @@
1
- import{j as e,a as v}from"./vendor-query-B2UbickB.js";import{a as re,d as le,b as oe}from"./agents-27sErp5R.js";import{E as ce,C as de,u as pe,a as xe,b as ue,c as me}from"./CronLabel-CtjUBRPo.js";import{b as he,u as fe}from"./index-BoZydcaW.js";import{P as ve}from"./PageHeader-CFta2VaS.js";import{B as A,e as U,t as be,R as Y,l as M,p as Z,a6 as G,b as V,aO as ee,V as ye}from"./vendor-icons-BaQqUm-e.js";import{e as ge}from"./knowledge-BErJA3Je.js";import{R as te}from"./RunAsSelector-CokM3Ifp.js";import{u as je}from"./workflows-Dps45zjk.js";import{u as we}from"./yaml-workflows-DhlTkbvY.js";import{u as se}from"./capabilities-BBTPqF-V.js";import{u as Ne}from"./topics-CR4UBuSV.js";import{W as Q}from"./WorkflowPill-BegV-iRF.js";import{e as _e,c as ke,f as Ce}from"./vendor-react-CXumBFUA.js";import"./BotPicker-MnI3OyE7.js";import"./bots-CPHuAvjW.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Se={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},qe={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Oe(s,a){var o,x,u;const r=(x=(o=s.behaviors)==null?void 0:o.schedules)!=null&&x.length?s.behaviors.schedules.map(n=>({cron:n.cron||"",reaction_type:n.reaction_type||"durable",workflow_type:n.workflow_type||"",pipeline_id:n.pipeline_id||"",server_id:n.server_id||"",tool_name:n.tool_name||"",envelope:n.envelope?JSON.stringify(n.envelope,null,2):"{}",execute_as:n.execute_as||""})):(u=s.behaviors)!=null&&u.cron?[{cron:s.behaviors.cron,reaction_type:"durable",workflow_type:s.workflow_type??"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""}]:[];return{name:s.id,description:s.description??"",goals:s.goals??"",rules:s.rules??"",user_id:s.user_id??"",knowledge_domain:s.knowledge_domain??"",subscriptions:a.map(n=>({id:n.id,topic:n.topic,filter:n.filter?JSON.stringify(n.filter,null,2):"",reaction_type:n.reaction_type,workflow_type:n.workflow_type??"",pipeline_id:n.pipeline_id??"",mcp_prompt:n.mcp_prompt??"",server_id:n.server_id??"",tool_name:n.tool_name??"",input_mapping:JSON.stringify(n.input_mapping??{},null,2),execute_as:n.execute_as??"",enabled:n.enabled})),schedules:r}}function Re(s){var r;const a={};return s.schedules.length>0&&(a.schedules=s.schedules.map(o=>({cron:o.cron,reaction_type:o.reaction_type||"durable",workflow_type:o.reaction_type==="pipeline"?void 0:o.workflow_type,pipeline_id:o.reaction_type==="pipeline"?o.pipeline_id:void 0,envelope:B(o.envelope)??{},execute_as:o.execute_as||void 0})),a.cron=s.schedules[0].cron),{id:s.name,description:s.description||void 0,goals:s.goals||void 0,rules:s.rules||void 0,user_id:s.user_id||void 0,knowledge_domain:s.knowledge_domain||void 0,behaviors:a,workflow_type:((r=s.schedules[0])==null?void 0:r.workflow_type)||void 0,pipeline_id:void 0}}function Ae(s){return s.subscriptions.map(a=>({id:a.id,topic:a.topic,filter:a.filter?B(a.filter):void 0,reaction_type:a.reaction_type,workflow_type:a.workflow_type||void 0,pipeline_id:a.pipeline_id||void 0,mcp_prompt:a.mcp_prompt||void 0,server_id:a.server_id||void 0,tool_name:a.tool_name||void 0,input_mapping:B(a.input_mapping)??{},execute_as:a.execute_as||void 0,enabled:a.enabled}))}function B(s){if(s.trim())try{return JSON.parse(s)}catch{return}}function Ee(s,a,r,o){let x;try{x=JSON.parse(s)}catch{x={}}const u=o.includes(a),n=r===""||r===void 0||r===null||Array.isArray(r)&&r.length===0||r==="[]";if(!u&&n){const{[a]:p,...c}=x;return JSON.stringify(c,null,2)}let h=r;if(typeof r=="string")try{const p=JSON.parse(r);Array.isArray(p)&&(h=p)}catch{}return JSON.stringify({...x,[a]:h},null,2)}const S="section-header mt-[3em] first:mt-0",$="label",_="hint",O="input",L="input-json w-full";function $e({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:identity"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Identity",children:e.jsx(A,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:$,children:"Name *"}),e.jsx("input",{type:"text",value:s.name,onChange:r=>a("name",r.target.value),placeholder:"health-monitor",className:O}),e.jsx("p",{className:_,children:"Lowercase, kebab-case. This appears everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:$,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:r=>a("description",r.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:O}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function Pe({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:motivation"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Motivation",children:e.jsx(A,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:$,children:"Goals"}),e.jsx("textarea",{value:s.goals,onChange:r=>a("goals",r.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${O} resize-none`}),e.jsx("p",{className:_,children:"Primary motivation. What the automation is trying to achieve."})]}),e.jsxs("div",{children:[e.jsx("label",{className:$,children:"Rules"}),e.jsx("textarea",{value:s.rules,onChange:r=>a("rules",r.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${O} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Ie({form:s,set:a}){const{data:r}=ge(),o=(r==null?void 0:r.domains)??[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Assign a knowledge domain — the automation's memory. It stores context here over time."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:knowledge"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Knowledge",children:e.jsx(A,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:$,children:"Knowledge Domain"}),e.jsx("input",{type:"text",value:s.knowledge_domain,onChange:x=>a("knowledge_domain",x.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:O,list:"domain-suggestions"}),e.jsx("datalist",{id:"domain-suggestions",children:o.map(x=>e.jsx("option",{value:x.domain},x.domain))}),e.jsx("p",{className:_,children:"Choose an existing domain to share memory, or type a new name to create one."})]}),o.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:$,children:"Existing Domains"}),e.jsx("div",{className:"space-y-0.5 mt-2",children:o.map(x=>e.jsxs("button",{type:"button",onClick:()=>a("knowledge_domain",x.domain),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${s.knowledge_domain===x.domain?"border-l-2 border-l-accent bg-accent/5":"hover:bg-surface-hover border-l-2 border-l-transparent"}`,children:[e.jsx(U,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary flex-1",children:x.domain}),e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:[x.count," entries"]}),e.jsx("span",{className:"text-[9px] text-text-quaternary",children:e.jsx(he,{date:x.latest})})]},x.domain))})]})]})}function We({serverId:s,toolName:a,onChange:r}){const{data:o}=se(),x=v.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[u,n]=v.useState(!1),[h,p]=v.useState(""),c=v.useRef(null),f=v.useRef(null);v.useEffect(()=>{if(!u)return;function t(i){f.current&&!f.current.contains(i.target)&&n(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[u]);const l=a?`${a}`:"",d=u?h:l,y=v.useMemo(()=>{const t=(u?h:"").toLowerCase();return t?x.filter(i=>i.name.toLowerCase().includes(t)||i.serverName.toLowerCase().includes(t)||(i.description??"").toLowerCase().includes(t)):x},[x,h,u]),m=a?x.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:f,className:"relative",children:[e.jsx("input",{ref:c,type:"text",value:d,onFocus:()=>{n(!0),p(l)},onChange:t=>{const i=t.target.value;p(i),i||r("",""),u||n(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!u&&(m==null?void 0:m.description)&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-1 italic",children:m.description}),u&&y.length>0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:y.map(t=>e.jsxs("button",{type:"button",onClick:()=>{r(t.serverId,t.name),p(t.name),n(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===t.serverId&&a===t.name?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-[11px] font-mono text-text-primary shrink-0",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(be,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),u&&y.length===0&&h&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center",children:e.jsxs("p",{className:"text-[11px] text-text-quaternary",children:['No capabilities match "',h,'"']})})]})}const Te={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Me=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:r,onWorkflowTypeChange:o,pipelineId:x,onPipelineIdChange:u,serverId:n,toolName:h,onCapabilityChange:p,mcpPrompt:c,onMcpPromptChange:f,availableTypes:l=[...Me]}){const{data:d}=je(),y=(d??[]).filter(i=>i.invocable).map(i=>i.workflow_type),{data:m}=we({status:"active"}),t=((m==null?void 0:m.workflows)??[]).map(i=>({id:i.id,name:i.graph_topic||i.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:l.map(i=>{const b=s===i;return e.jsx("button",{type:"button",onClick:()=>a(i),className:`px-3 py-1.5 text-[11px] font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Te[i]},i)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:r,onChange:i=>o(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),y.map(i=>e.jsx("option",{value:i,children:i},i))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:x,onChange:i=>u(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(We,{serverId:n,toolName:h,onChange:p})]}),s==="mcp_query"&&f&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:c??"",onChange:i=>f(i.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Le={task:"bg-blue-400/15 text-blue-400",workflow:"bg-accent/15 text-accent",escalation:"bg-amber-400/15 text-amber-400",activity:"bg-cyan-400/15 text-cyan-400",knowledge:"bg-violet-400/15 text-violet-400",file:"bg-orange-400/15 text-orange-400",agent:"bg-emerald-400/15 text-emerald-400",app:"bg-rose-400/15 text-rose-400",milestone:"bg-violet-400/15 text-violet-400"};function Je({form:s,set:a}){const{data:r}=Ne({limit:200}),{data:o}=se(),x=(r==null?void 0:r.topics)??[],u=v.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[n,h]=v.useState(0),p=(t,i,b)=>{const g=[...s.subscriptions];g[t]={...g[t],[i]:b},a("subscriptions",g)},c=()=>{a("subscriptions",[...s.subscriptions,{...Se}]),h(s.subscriptions.length)},f=t=>{a("subscriptions",s.subscriptions.filter((i,b)=>b!==t)),n>=s.subscriptions.length-1&&h(Math.max(0,s.subscriptions.length-2))},l=s.subscriptions,d=l[n],y=t=>t.topic?t.reaction_type==="durable"?!!t.workflow_type:t.reaction_type==="pipeline"?!!t.pipeline_id:t.reaction_type==="mcp_query"?!!t.mcp_prompt:t.reaction_type==="capability"?!!t.server_id&&!!t.tool_name:!1:!1,m=d?x.find(t=>t.topic===d.topic):void 0;return l.length===0?e.jsxs("div",{className:"max-w-xl",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(A,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Y,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"}),e.jsx("p",{className:"text-[11px] text-text-quaternary max-w-sm mb-6",children:"Each subscription listens for a topic pattern and runs a workflow when it matches."}),e.jsxs("button",{onClick:c,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Add first subscription"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(A,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-52 shrink-0 space-y-0.5",children:[l.map((t,i)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${n===i?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>h(i),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${y(t)?"bg-emerald-400":"bg-zinc-500"}`}),e.jsx("span",{className:"text-[11px] font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-[9px] text-text-quaternary ml-3",children:["→ ",t.workflow_type||t.tool_name||t.reaction_type]})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove subscription "${t.topic||"new"}"?
2
-
3
- This takes effect when you save.`)&&f(i)},className:"opacity-0 group-hover/sub:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},i)),e.jsxs("button",{onClick:c,className:"w-full flex items-center gap-1.5 px-3 py-2 text-[11px] text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3 h-3"})," Add"]})]}),d&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"When this event fires"}),e.jsx(ze,{value:d.topic,onChange:t=>p(n,"topic",t),topics:x}),(m==null?void 0:m.payload_schema)&&e.jsxs("div",{className:"mt-3 p-3 rounded-md bg-surface-sunken border border-surface-border",children:[e.jsx("p",{className:"text-[10px] text-text-quaternary mb-1 uppercase tracking-wider font-medium",children:"Payload Schema"}),e.jsx("pre",{className:"text-[11px] font-mono text-text-secondary whitespace-pre-wrap overflow-x-auto max-h-40",children:JSON.stringify(m.payload_schema.properties??m.payload_schema,null,2)}),m.description&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-2 italic",children:m.description})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:d.reaction_type,onReactionTypeChange:t=>p(n,"reaction_type",t),workflowType:d.workflow_type,onWorkflowTypeChange:t=>p(n,"workflow_type",t),pipelineId:d.pipeline_id,onPipelineIdChange:t=>p(n,"pipeline_id",t),serverId:d.server_id,toolName:d.tool_name,onCapabilityChange:(t,i)=>{var R;const b=[...s.subscriptions],g={...b[n],server_id:t,tool_name:i},k=u.find(w=>w.serverId===t&&w.name===i),E=(R=k==null?void 0:k.inputSchema)==null?void 0:R.properties;if(E&&i){const w={};for(const P of Object.keys(E))P.startsWith("_")||(w[P]=`{event.data.${P}}`);g.input_mapping=JSON.stringify(w,null,2)}b[n]=g,a("subscriptions",b)},mcpPrompt:d.mcp_prompt,onMcpPromptChange:t=>p(n,"mcp_prompt",t)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:d.execute_as,onChange:t=>p(n,"execute_as",t)}),e.jsx("p",{className:_,children:"Identity used when invoking the workflow."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"But only if"}),e.jsx("input",{type:"text",value:d.filter,onChange:t=>p(n,"filter",t.target.value),placeholder:'{"extension": "png"}',className:`${O} font-mono text-xs`}),e.jsx("p",{className:_,children:"JSON filter against event.data. Click an operator to insert:"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:[{label:"equals",value:'{"key": "val"}'},{label:"not equal",value:'{"key": {"$ne": "val"}}'},{label:"in list",value:'{"key": {"$in": ["a", "b"]}}'},{label:"exists",value:'{"key": {"$exists": true}}'}].map(t=>e.jsx("button",{type:"button",onClick:()=>p(n,"filter",t.value),className:"px-2 py-0.5 text-[10px] font-mono rounded bg-accent/8 text-accent hover:bg-accent/15 transition-colors",children:t.label},t.label))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),d.reaction_type==="capability"&&d.tool_name?e.jsx(Fe,{tool:u.find(t=>t.serverId===d.server_id&&t.name===d.tool_name),value:d.input_mapping,onChange:t=>p(n,"input_mapping",t),eventSchema:m==null?void 0:m.payload_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:d.input_mapping,onChange:t=>p(n,"input_mapping",t.target.value),rows:10,className:L,placeholder:`{
4
- "data": {
5
- "orderId": "{event.data.orderId}",
6
- "error": "{event.data.error}"
7
- }
8
- }`}),e.jsxs("p",{className:_,children:["Maps event fields to workflow input. ","{event.data.fieldName}"," resolves at runtime."]})]})]})]})]})]})}function Fe({tool:s,value:a,onChange:r,eventSchema:o}){var y,m;const[x,u]=v.useState(!1),n=((y=s==null?void 0:s.inputSchema)==null?void 0:y.properties)??{},h=((m=s==null?void 0:s.inputSchema)==null?void 0:m.required)??[],p=Object.entries(n).filter(([t])=>!t.startsWith("_")),c=v.useMemo(()=>[...p].sort(([t],[i])=>{const b=h.indexOf(t),g=h.indexOf(i);return b!==-1&&g!==-1?b-g:b!==-1?-1:g!==-1?1:t.localeCompare(i)}),[p,h]),f=v.useMemo(()=>{const t=[{value:"{event.type}",label:"event type"},{value:"{event.source}",label:"event source"},{value:"{event.timestamp}",label:"ISO timestamp"},{value:"{event.workflowId}",label:"workflow ID"},{value:"{event.workflowName}",label:"workflow name"}],i=o==null?void 0:o.properties;if(i)for(const[b,g]of Object.entries(i))t.push({value:`{event.data.${b}}`,label:g.description||b});return t},[o]),l=v.useMemo(()=>{try{return JSON.parse(a)}catch{return{}}},[a]),d=(t,i)=>{r(Ee(a,t,i,h))};return c.length===0||x?e.jsxs("div",{children:[c.length>0&&e.jsx("div",{className:"flex justify-end mb-1",children:e.jsx("button",{type:"button",onClick:()=>u(!1),className:"text-[10px] text-accent hover:text-accent-hover transition-colors",children:"Form view"})}),e.jsx("textarea",{value:a,onChange:t=>r(t.target.value),rows:8,className:L,placeholder:`{
9
- "domain": "{event.data.name}",
10
- "key": "{event.data.path}"
11
- }`}),e.jsxs("p",{className:_,children:["Maps event fields to capability inputs. ","{event.data.fieldName}"," resolves at runtime."]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"Map each input to an event field or enter a static value."}),e.jsx("button",{type:"button",onClick:()=>u(!0),className:"text-[10px] text-text-tertiary hover:text-accent transition-colors",children:"Raw JSON"})]}),e.jsx("div",{className:"space-y-4",children:c.map(([t,i])=>{const b=h.includes(t),g=i.description,k=i.type,E=typeof l[t]=="string"?l[t]:typeof l[t]=="object"?JSON.stringify(l[t]):l[t]!=null?String(l[t]):"";return e.jsxs("div",{className:"bg-surface-sunken/30 rounded-md px-4 py-3",children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[e.jsxs("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[t.replace(/[_-]/g," "),b&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]}),k&&e.jsx("span",{className:"text-[9px] text-text-quaternary",children:k})]}),g&&e.jsx("p",{className:"text-[10px] text-text-quaternary mb-2",children:g}),e.jsx(De,{value:E,onChange:R=>d(t,R),suggestions:f,fieldType:k,placeholder:`{event.data.${t}}`})]},t)})})]})}function De({value:s,onChange:a,suggestions:r,fieldType:o,placeholder:x}){const[u,n]=v.useState(!1),[h,p]=v.useState(""),c=v.useRef(null);v.useEffect(()=>{if(!u)return;function l(d){c.current&&!c.current.contains(d.target)&&n(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[u]);const f=r.filter(l=>l.value.toLowerCase().includes(h.toLowerCase())||l.label.toLowerCase().includes(h.toLowerCase()));if(o==="object")return e.jsx("textarea",{value:s,onChange:l=>{try{a(JSON.parse(l.target.value))}catch{a(l.target.value)}},rows:3,className:`${L} text-xs`,placeholder:'{ "source": "{event.source}" }'});if(o==="array"){const l=(()=>{try{const d=JSON.parse(s);if(Array.isArray(d))return d.map(String)}catch{}return s?s.split(",").map(d=>d.trim()).filter(Boolean):[]})();return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2 min-h-[28px]",children:l.map((d,y)=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-[11px] font-mono bg-accent/10 text-accent rounded-full",children:[d,e.jsx("button",{type:"button",onClick:()=>{const m=l.filter((t,i)=>i!==y);a(JSON.stringify(m))},className:"text-accent/50 hover:text-accent ml-0.5",children:"×"})]},y))}),e.jsx("input",{type:"text",className:"input font-mono text-xs w-full",placeholder:"Type a value and press Enter",onKeyDown:d=>{if(d.key==="Enter"||d.key===","){d.preventDefault();const y=d.target.value.trim();y&&(a(JSON.stringify([...l,y])),d.target.value="")}}})]})}return e.jsxs("div",{ref:c,className:"relative",children:[e.jsx("input",{type:"text",value:s,onFocus:()=>{n(!0),p("")},onChange:l=>{a(l.target.value),p(l.target.value),u||n(!0)},className:"input font-mono text-xs w-full",placeholder:x}),u&&f.length>0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 max-h-48 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:f.map(l=>e.jsxs("button",{type:"button",onClick:()=>{a(l.value),n(!1)},className:`w-full text-left px-3 py-1.5 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===l.value?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-[11px] font-mono text-accent shrink-0",children:l.value}),e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:l.label})]},l.value))})]})}function ze({value:s,onChange:a,topics:r}){const[o,x]=v.useState(!1),[u,n]=v.useState(""),h=v.useRef(null),p=v.useRef(null);v.useEffect(()=>{function l(d){p.current&&!p.current.contains(d.target)&&x(!1)}return o&&document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[o]);const c=o?u:s,f=r.filter(l=>l.topic.toLowerCase().includes((o?u:"").toLowerCase())||(l.description??"").toLowerCase().includes((o?u:"").toLowerCase()));return e.jsxs("div",{ref:p,className:"relative",children:[e.jsx("input",{ref:h,type:"text",value:c,onFocus:()=>{x(!0),n(s)},onChange:l=>{const d=l.target.value;n(d),a(d),o||x(!0)},placeholder:"workflow.failed or app.>",className:`${O} font-mono`}),o&&f.length>0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:f.map(l=>{const d=Le[l.category]??"bg-zinc-400/15 text-zinc-400";return e.jsxs("button",{type:"button",onClick:()=>{a(l.topic),n(l.topic),x(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===l.topic?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-[11px] font-mono text-text-primary shrink-0",children:l.topic}),e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-medium shrink-0 ${d}`,children:l.category}),l.description&&e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:l.description})]},l.topic)})})]})}const Be=["*/5 * * * *","*/15 * * * *","0 * * * *","0 */4 * * *","0 7 * * *","0 9 * * 1-5"];function z(s){return{"* * * * *":"Every minute","*/5 * * * *":"Every 5 min","*/15 * * * *":"Every 15 min","0 * * * *":"Hourly","0 */4 * * *":"Every 4 hours","0 7 * * *":"Daily 7 AM UTC","0 9 * * 1-5":"Weekdays 9 AM UTC","0 0 * * 1":"Weekly Monday"}[s]||s}function Ue({form:s,set:a}){const[r,o]=v.useState(0),x=(c,f,l)=>{const d=[...s.schedules];d[c]={...d[c],[f]:l},a("schedules",d)},u=()=>{a("schedules",[...s.schedules,{...qe}]),o(s.schedules.length)},n=c=>{a("schedules",s.schedules.filter((f,l)=>l!==c)),r>=s.schedules.length-1&&o(Math.max(0,s.schedules.length-2))},h=s.schedules,p=h[r];return h.length===0?e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 mb-8 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. Each schedule runs a workflow on a cron timer."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:schedule"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Schedule",children:e.jsx(A,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(G,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No schedules"}),e.jsx("p",{className:"text-[11px] text-text-quaternary max-w-sm mb-6",children:"Add a schedule to run a workflow on a recurring cron timer."}),e.jsxs("button",{onClick:u,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Add schedule"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 mb-6 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Each schedule runs a workflow on a timer. An automation can have multiple schedules targeting different workflows."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:schedule"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Schedule",children:e.jsx(A,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-48 shrink-0 space-y-0.5",children:[h.map((c,f)=>e.jsxs("div",{className:`group/sched flex items-center rounded-md transition-colors ${r===f?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>o(f),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsx("span",{className:"text-[11px] font-mono block",children:c.cron||"new schedule"}),e.jsxs("span",{className:"text-[9px] text-text-quaternary",children:[(c.reaction_type==="pipeline"?c.pipeline_id:c.workflow_type)||"no target"," · ",z(c.cron)]})]}),e.jsx("button",{onClick:l=>{l.stopPropagation(),confirm(`Remove schedule "${c.cron||"new"}"?
12
-
13
- This takes effect when you save.`)&&n(f)},className:"opacity-0 group-hover/sched:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},f)),e.jsxs("button",{onClick:u,className:"w-full flex items-center gap-1.5 px-3 py-2 text-[11px] text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3 h-3"})," Add"]})]}),p&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run every"}),e.jsx("input",{type:"text",value:p.cron,onChange:c=>x(r,"cron",c.target.value),placeholder:"0 * * * *",className:`${O} font-mono`}),p.cron&&e.jsx("p",{className:"text-[11px] text-accent/80 mt-1",children:z(p.cron)}),e.jsx("div",{className:"flex gap-3 mt-2 overflow-x-auto",children:Be.map(c=>e.jsx("button",{type:"button",onClick:()=>x(r,"cron",c),className:`text-[10px] font-mono whitespace-nowrap transition-colors ${p.cron===c?"text-accent font-medium":"text-accent/50 hover:text-accent"}`,children:z(c)},c))})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:p.reaction_type,onReactionTypeChange:c=>x(r,"reaction_type",c),workflowType:p.workflow_type,onWorkflowTypeChange:c=>x(r,"workflow_type",c),pipelineId:p.pipeline_id,onPipelineIdChange:c=>x(r,"pipeline_id",c),serverId:p.server_id,toolName:p.tool_name,onCapabilityChange:(c,f)=>{x(r,"server_id",c),x(r,"tool_name",f)},availableTypes:["durable","pipeline","capability"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:p.execute_as,onChange:c=>x(r,"execute_as",c)}),e.jsx("p",{className:_,children:"Identity used when invoking."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),e.jsx("textarea",{value:p.envelope,onChange:c=>x(r,"envelope",c.target.value),rows:10,className:L,placeholder:`{
14
- "data": { "source": "cron" }
15
- }`}),e.jsx("p",{className:_,children:"Static payload passed to the workflow on each invocation."})]})]})]})]})}function W({icon:s,color:a,title:r,children:o}){return e.jsxs("div",{className:"mb-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 pb-1.5 border-b border-surface-border/40",children:[e.jsx(s,{className:`w-3.5 h-3.5 ${a}`,strokeWidth:1.5}),e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-widest text-accent/80",children:r})]}),e.jsx("div",{className:"pl-5.5",children:o})]})}function T({label:s,children:a}){return e.jsxs("div",{className:"flex gap-3 py-0.5",children:[e.jsx("span",{className:"text-[10px] text-text-quaternary w-20 shrink-0",children:s}),e.jsx("span",{className:"text-xs text-text-primary",children:a})]})}function Ye({form:s}){return e.jsxs("div",{children:[e.jsxs(W,{icon:V,color:"text-accent",title:"Identity",children:[e.jsx(T,{label:"Name",children:s.name||"—"}),s.description&&e.jsx(T,{label:"Description",children:s.description})]}),(s.goals||s.rules)&&e.jsxs(W,{icon:ee,color:"text-rose-400",title:"Motivation",children:[s.goals&&e.jsx(T,{label:"Goals",children:s.goals}),s.rules&&e.jsx(T,{label:"Rules",children:s.rules})]}),e.jsx(W,{icon:U,color:"text-emerald-400",title:"Knowledge",children:e.jsx(T,{label:"Domain",children:s.knowledge_domain||"None"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-10",children:[e.jsx(W,{icon:Y,color:"text-cyan-400",title:`Subscriptions (${s.subscriptions.length})`,children:s.subscriptions.length===0?e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.subscriptions.map((a,r)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ce,{topic:a.topic||"unset"})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-[11px] text-text-quaternary",children:a.reaction_type})]})]},r))})}),e.jsx(W,{icon:G,color:"text-amber-400",title:`Schedules (${s.schedules.length})`,children:s.schedules.length===0?e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.schedules.map((a,r)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(de,{cron:a.cron})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"no workflow"})]})]},r))})})]}),e.jsx("div",{className:"border-l-2 border-emerald-400/30 pl-3 py-2 mt-6",children:e.jsx("p",{className:"text-[11px] text-text-tertiary leading-relaxed",children:"After saving, subscriptions and schedules activate immediately. You can pause the automation anytime."})})]})}const Ge=[{id:1,label:"Identity",icon:V},{id:2,label:"Motivation",icon:ee},{id:3,label:"Knowledge",icon:U},{id:4,label:"Subscriptions",icon:Y},{id:5,label:"Schedules",icon:G},{id:6,label:"Review",icon:ye}];function dt(){var H;const{id:s}=_e(),a=!s,r=ke(),{data:o}=fe(),u=!!((H=o==null?void 0:o.ai)!=null&&H.enabled)?"Agent":"Automation",{data:n,isLoading:h}=re(a?null:s),{data:p}=pe(a?null:s),c=le(),f=oe(),l=xe(),d=ue(),y=me(),[m,t]=v.useState(X),[i,b]=v.useState(!1),[g,k]=v.useState(""),[E,R]=Ce(),w=parseInt(E.get("step")||"1",10),P=v.useCallback(j=>{R(N=>{const q=new URLSearchParams(N);return q.set("step",String(j)),q},{replace:!0})},[R]);v.useEffect(()=>{if(!i){if(a){t(X),b(!0);return}n&&p&&(t(Oe(n,p.subscriptions??[])),b(!0))}},[n,p,a,i]);const I=(j,N)=>t(q=>({...q,[j]:N})),ne=async()=>{k("");try{const j=Re(m);let N=s;a?N=(await c.mutateAsync(j)).id:await f.mutateAsync({id:s,...j});const q=Ae(m),ie=(p==null?void 0:p.subscriptions)??[],J=new Set(ie.map(C=>C.id));for(const C of q)if(C.id&&J.has(C.id)){const{id:F,...D}=C;await d.mutateAsync({agentId:N,subId:F,...D}),J.delete(F)}else{const{id:F,...D}=C;await l.mutateAsync({agentId:N,...D})}for(const C of J)await y.mutateAsync({agentId:N,subId:C});r(`/agents/${N}`)}catch(j){k(j.message)}};if(!a&&h)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-60 bg-surface-sunken rounded"})]});const K=c.isPending||f.isPending;return e.jsxs("div",{children:[e.jsx(ve,{title:a?`New ${u}`:`${u}: ${(n==null?void 0:n.id)??""}`,docsHash:"#docs:agents.md"}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:Ge.map(j=>{const N=j.icon,q=w===j.id;return e.jsxs("button",{onClick:()=>P(j.id),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${q?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(N,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:j.label})]},j.id)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:ne,disabled:!m.name.trim()||K,className:"w-full btn-primary text-xs disabled:opacity-50",children:K?"Saving...":a?`Create ${u}`:"Save"}),e.jsx("button",{onClick:()=>r(a?"/agents":`/agents/${s}`),className:"w-full btn-ghost text-xs",children:"Cancel"})]}),g&&e.jsx("p",{className:"text-xs text-status-error mt-3",children:g})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2",children:[w===1&&e.jsx($e,{form:m,set:I}),w===2&&e.jsx(Pe,{form:m,set:I}),w===3&&e.jsx(Ie,{form:m,set:I}),w===4&&e.jsx(Je,{form:m,set:I}),w===5&&e.jsx(Ue,{form:m,set:I}),w===6&&e.jsx(Ye,{form:m})]})]})]})}export{dt as AgentConfigPage};
16
- //# sourceMappingURL=AgentConfigPage-C6gDgz21.js.map