@hotmeshio/long-tail 0.4.5 → 0.4.7

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 (314) hide show
  1. package/build/api/files.js +8 -0
  2. package/build/api/topics.d.ts +5 -0
  3. package/build/api/topics.js +20 -0
  4. package/build/api/users.d.ts +2 -0
  5. package/build/api/users.js +1 -0
  6. package/build/index.js +8 -0
  7. package/build/routes/topics.js +12 -0
  8. package/build/services/agent/trigger-registry.d.ts +9 -0
  9. package/build/services/agent/trigger-registry.js +25 -2
  10. package/build/services/user/crud.js +4 -0
  11. package/build/services/user/index.d.ts +1 -0
  12. package/build/services/user/index.js +3 -1
  13. package/build/services/user/seed-admin.d.ts +13 -0
  14. package/build/services/user/seed-admin.js +42 -0
  15. package/build/services/user/types.d.ts +1 -0
  16. package/build/start/index.js +2 -2
  17. package/build/start/workers.d.ts +3 -1
  18. package/build/start/workers.js +10 -0
  19. package/build/tsconfig.tsbuildinfo +1 -1
  20. package/build/types/startup.d.ts +41 -0
  21. package/dashboard/dist/assets/AdminDashboard-qZYNzvw8.js +2 -0
  22. package/dashboard/dist/assets/{AdminDashboard-ntLz5Pro.js.map → AdminDashboard-qZYNzvw8.js.map} +1 -1
  23. package/dashboard/dist/assets/AgentConfigPage-_SMbioNp.js +16 -0
  24. package/dashboard/dist/assets/AgentConfigPage-_SMbioNp.js.map +1 -0
  25. package/dashboard/dist/assets/AgentDetailPage-Cf_SRtbT.js +4 -0
  26. package/dashboard/dist/assets/{AgentDetailPage-Cm2KFR4O.js.map → AgentDetailPage-Cf_SRtbT.js.map} +1 -1
  27. package/dashboard/dist/assets/AgentsPage-q53C1Xk_.js +2 -0
  28. package/dashboard/dist/assets/{AgentsPage-_ptA-0YO.js.map → AgentsPage-q53C1Xk_.js.map} +1 -1
  29. package/dashboard/dist/assets/AvailableEscalationsPage-DHWciaKb.js +2 -0
  30. package/dashboard/dist/assets/{AvailableEscalationsPage-bdPqEzbx.js.map → AvailableEscalationsPage-DHWciaKb.js.map} +1 -1
  31. package/dashboard/dist/assets/BotPicker-638n5Jaz.js +2 -0
  32. package/dashboard/dist/assets/{BotPicker-CYfFMpkY.js.map → BotPicker-638n5Jaz.js.map} +1 -1
  33. package/dashboard/dist/assets/CapabilitiesPage-PmgEhPl8.js +2 -0
  34. package/dashboard/dist/assets/{CapabilitiesPage-M7-ZTFNV.js.map → CapabilitiesPage-PmgEhPl8.js.map} +1 -1
  35. package/dashboard/dist/assets/CollapsibleSection-BEZoI6NU.js +2 -0
  36. package/dashboard/dist/assets/{CollapsibleSection-DU5KAtQ-.js.map → CollapsibleSection-BEZoI6NU.js.map} +1 -1
  37. package/dashboard/dist/assets/ConfirmDeleteModal-dOxidrSR.js +2 -0
  38. package/dashboard/dist/assets/{ConfirmDeleteModal-_hW5Vc05.js.map → ConfirmDeleteModal-dOxidrSR.js.map} +1 -1
  39. package/dashboard/dist/assets/CopyableId-D0SQ39nR.js +2 -0
  40. package/dashboard/dist/assets/{CopyableId-DiWqv41D.js.map → CopyableId-D0SQ39nR.js.map} +1 -1
  41. package/dashboard/dist/assets/CredentialsPage-Dl15oW3U.js +2 -0
  42. package/dashboard/dist/assets/{CredentialsPage-CmbwypSF.js.map → CredentialsPage-Dl15oW3U.js.map} +1 -1
  43. package/dashboard/dist/assets/CronLabel-Dg8U0s5a.js +2 -0
  44. package/dashboard/dist/assets/{CronLabel-nycfAefc.js.map → CronLabel-Dg8U0s5a.js.map} +1 -1
  45. package/dashboard/dist/assets/CustomDurationPicker-BCbVMr-4.js +2 -0
  46. package/dashboard/dist/assets/{CustomDurationPicker-gNZRBaHg.js.map → CustomDurationPicker-BCbVMr-4.js.map} +1 -1
  47. package/dashboard/dist/assets/DataTable-D9yuBv0w.js +2 -0
  48. package/dashboard/dist/assets/{DataTable-DGerT2ZM.js.map → DataTable-D9yuBv0w.js.map} +1 -1
  49. package/dashboard/dist/assets/DropZone-lw2wmqty.js +2 -0
  50. package/dashboard/dist/assets/{DropZone-vNcqMd05.js.map → DropZone-lw2wmqty.js.map} +1 -1
  51. package/dashboard/dist/assets/ElapsedCell-fuG5wRDw.js +2 -0
  52. package/dashboard/dist/assets/{ElapsedCell-CdvQbtve.js.map → ElapsedCell-fuG5wRDw.js.map} +1 -1
  53. package/dashboard/dist/assets/EmptyState-BcsfPq9T.js +2 -0
  54. package/dashboard/dist/assets/{EmptyState-DMldv8c5.js.map → EmptyState-BcsfPq9T.js.map} +1 -1
  55. package/dashboard/dist/assets/EscalationsOverview-nYOZczYx.js +2 -0
  56. package/dashboard/dist/assets/{EscalationsOverview-BNENCL_2.js.map → EscalationsOverview-nYOZczYx.js.map} +1 -1
  57. package/dashboard/dist/assets/EventTable-Cm0Ql46x.js +2 -0
  58. package/dashboard/dist/assets/{EventTable-BqDAyXyc.js.map → EventTable-Cm0Ql46x.js.map} +1 -1
  59. package/dashboard/dist/assets/EventTopicPill-RaASGdZz.js +2 -0
  60. package/dashboard/dist/assets/{EventTopicPill-CnHFBglc.js.map → EventTopicPill-RaASGdZz.js.map} +1 -1
  61. package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js +2 -0
  62. package/dashboard/dist/assets/{FilterBar-TYiTtUgv.js.map → FilterBar-Ck4K4rzu.js.map} +1 -1
  63. package/dashboard/dist/assets/HomePage-Cx6pvCFX.js +2 -0
  64. package/dashboard/dist/assets/{HomePage-fterfLKH.js.map → HomePage-Cx6pvCFX.js.map} +1 -1
  65. package/dashboard/dist/assets/ListToolbar-YHesiWwN.js +2 -0
  66. package/dashboard/dist/assets/{ListToolbar-BO5Igi6v.js.map → ListToolbar-YHesiWwN.js.map} +1 -1
  67. package/dashboard/dist/assets/McpOverview-BWsaxVKL.js +2 -0
  68. package/dashboard/dist/assets/{McpOverview-BQokGg0z.js.map → McpOverview-BWsaxVKL.js.map} +1 -1
  69. package/dashboard/dist/assets/McpQueryDetailPage-CQk3YpR-.js +5 -0
  70. package/dashboard/dist/assets/McpQueryDetailPage-CQk3YpR-.js.map +1 -0
  71. package/dashboard/dist/assets/McpQueryPage-Uf5DKujM.js +2 -0
  72. package/dashboard/dist/assets/{McpQueryPage-DUey_h9J.js.map → McpQueryPage-Uf5DKujM.js.map} +1 -1
  73. package/dashboard/dist/assets/McpRunDetailPage-D9GU27cS.js +2 -0
  74. package/dashboard/dist/assets/{McpRunDetailPage-Cv4qyr91.js.map → McpRunDetailPage-D9GU27cS.js.map} +1 -1
  75. package/dashboard/dist/assets/McpRunsPage-5dVAu25-.js +2 -0
  76. package/dashboard/dist/assets/{McpRunsPage-B3R6KZ61.js.map → McpRunsPage-5dVAu25-.js.map} +1 -1
  77. package/dashboard/dist/assets/Modal-DEODGeqx.js +2 -0
  78. package/dashboard/dist/assets/{Modal-Qe8lW7gQ.js.map → Modal-DEODGeqx.js.map} +1 -1
  79. package/dashboard/dist/assets/OperatorDashboard-DNJtUDxl.js +2 -0
  80. package/dashboard/dist/assets/{OperatorDashboard-dldvzjcg.js.map → OperatorDashboard-DNJtUDxl.js.map} +1 -1
  81. package/dashboard/dist/assets/PageHeader-B4w-LDUF.js +2 -0
  82. package/dashboard/dist/assets/{PageHeader-DF4BeEm4.js.map → PageHeader-B4w-LDUF.js.map} +1 -1
  83. package/dashboard/dist/assets/PageHeaderWithStats-DQmNXYcG.js +2 -0
  84. package/dashboard/dist/assets/{PageHeaderWithStats-BQZw6BgA.js.map → PageHeaderWithStats-DQmNXYcG.js.map} +1 -1
  85. package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js +2 -0
  86. package/dashboard/dist/assets/{PriorityBadge-DMyB3WLZ.js.map → PriorityBadge-DfQY9St9.js.map} +1 -1
  87. package/dashboard/dist/assets/ProcessDetailPage-BPsvlG0E.js +2 -0
  88. package/dashboard/dist/assets/{ProcessDetailPage-Beo-QVL-.js.map → ProcessDetailPage-BPsvlG0E.js.map} +1 -1
  89. package/dashboard/dist/assets/ProcessesListPage-CnuCtHSP.js +2 -0
  90. package/dashboard/dist/assets/{ProcessesListPage-C_ars8gp.js.map → ProcessesListPage-CnuCtHSP.js.map} +1 -1
  91. package/dashboard/dist/assets/RolePill-Dk-YUxCm.js +2 -0
  92. package/dashboard/dist/assets/{RolePill-DrBZ7JJj.js.map → RolePill-Dk-YUxCm.js.map} +1 -1
  93. package/dashboard/dist/assets/RolesPage-BGJMx2S2.js +2 -0
  94. package/dashboard/dist/assets/{RolesPage-DgSXFFGL.js.map → RolesPage-BGJMx2S2.js.map} +1 -1
  95. package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js +2 -0
  96. package/dashboard/dist/assets/{RowActions-QcakGbVA.js.map → RowActions-Dg-Fsm5O.js.map} +1 -1
  97. package/dashboard/dist/assets/RunAsSelector-CcNnj5AF.js +2 -0
  98. package/dashboard/dist/assets/{RunAsSelector-CYMeZwrM.js.map → RunAsSelector-CcNnj5AF.js.map} +1 -1
  99. package/dashboard/dist/assets/ServerName-BXSm_14r.js +2 -0
  100. package/dashboard/dist/assets/{ServerName-D5NKD06M.js.map → ServerName-BXSm_14r.js.map} +1 -1
  101. package/dashboard/dist/assets/StatCard-DlgF0CJC.js +2 -0
  102. package/dashboard/dist/assets/{StatCard-PZQmmCHK.js.map → StatCard-DlgF0CJC.js.map} +1 -1
  103. package/dashboard/dist/assets/StatusBadge-XQlNFwmH.js +2 -0
  104. package/dashboard/dist/assets/{StatusBadge-ME2R6a7K.js.map → StatusBadge-XQlNFwmH.js.map} +1 -1
  105. package/dashboard/dist/assets/StepIndicator-CuUIGxKk.js +2 -0
  106. package/dashboard/dist/assets/{StepIndicator-CDDVahOz.js.map → StepIndicator-CuUIGxKk.js.map} +1 -1
  107. package/dashboard/dist/assets/StickyPagination-BWhFSr2d.js +2 -0
  108. package/dashboard/dist/assets/{StickyPagination-Ddy93Q5I.js.map → StickyPagination-BWhFSr2d.js.map} +1 -1
  109. package/dashboard/dist/assets/SwimlaneTimeline-fWiYlTQw.js +2 -0
  110. package/dashboard/dist/assets/{SwimlaneTimeline-CYYA8nd9.js.map → SwimlaneTimeline-fWiYlTQw.js.map} +1 -1
  111. package/dashboard/dist/assets/TagInput-CYh3PFNq.js +2 -0
  112. package/dashboard/dist/assets/{TagInput-B45Dm3IW.js.map → TagInput-CYh3PFNq.js.map} +1 -1
  113. package/dashboard/dist/assets/TaskDetailPage-Byz19B5I.js +2 -0
  114. package/dashboard/dist/assets/TaskDetailPage-Byz19B5I.js.map +1 -0
  115. package/dashboard/dist/assets/TaskQueuePill-BSFLiBcf.js +2 -0
  116. package/dashboard/dist/assets/{TaskQueuePill-BJRUjVDv.js.map → TaskQueuePill-BSFLiBcf.js.map} +1 -1
  117. package/dashboard/dist/assets/TasksListPage-pe1Opw6s.js +2 -0
  118. package/dashboard/dist/assets/{TasksListPage-Czu08px3.js.map → TasksListPage-pe1Opw6s.js.map} +1 -1
  119. package/dashboard/dist/assets/TimeAgo-8aYUlXT9.js +2 -0
  120. package/dashboard/dist/assets/{TimeAgo-CJ56IUy6.js.map → TimeAgo-8aYUlXT9.js.map} +1 -1
  121. package/dashboard/dist/assets/TimestampCell-_1fW34op.js +2 -0
  122. package/dashboard/dist/assets/{TimestampCell-QtcYZ9Jx.js.map → TimestampCell-_1fW34op.js.map} +1 -1
  123. package/dashboard/dist/assets/ToolPill-CcKNnnrK.js +2 -0
  124. package/dashboard/dist/assets/{ToolPill-DpDv3FwI.js.map → ToolPill-CcKNnnrK.js.map} +1 -1
  125. package/dashboard/dist/assets/ToolTestPanel-BD7ZkPeM.js +2 -0
  126. package/dashboard/dist/assets/{ToolTestPanel-BzFOwzd_.js.map → ToolTestPanel-BD7ZkPeM.js.map} +1 -1
  127. package/dashboard/dist/assets/TopicDetailPage-DL6QarSi.js +9 -0
  128. package/dashboard/dist/assets/TopicDetailPage-DL6QarSi.js.map +1 -0
  129. package/dashboard/dist/assets/TopicsPage-JYAk0csl.js +2 -0
  130. package/dashboard/dist/assets/{TopicsPage-DKXlpZl_.js.map → TopicsPage-JYAk0csl.js.map} +1 -1
  131. package/dashboard/dist/assets/UserName-Dcn8reNm.js +2 -0
  132. package/dashboard/dist/assets/{UserName-zlR1so37.js.map → UserName-Dcn8reNm.js.map} +1 -1
  133. package/dashboard/dist/assets/WorkflowExecutionPage-DPie2xiD.js +2 -0
  134. package/dashboard/dist/assets/{WorkflowExecutionPage-BMNIxeJB.js.map → WorkflowExecutionPage-DPie2xiD.js.map} +1 -1
  135. package/dashboard/dist/assets/WorkflowPill-BkfIn8N3.js +2 -0
  136. package/dashboard/dist/assets/{WorkflowPill-B5B3yGlh.js.map → WorkflowPill-BkfIn8N3.js.map} +1 -1
  137. package/dashboard/dist/assets/WorkflowsDashboard-BRKurUye.js +2 -0
  138. package/dashboard/dist/assets/{WorkflowsDashboard-BlAPZbQZ.js.map → WorkflowsDashboard-BRKurUye.js.map} +1 -1
  139. package/dashboard/dist/assets/WorkflowsOverview-C9Wob38P.js +2 -0
  140. package/dashboard/dist/assets/{WorkflowsOverview-NnPi6rwS.js.map → WorkflowsOverview-C9Wob38P.js.map} +1 -1
  141. package/dashboard/dist/assets/YamlWorkflowsPage-BoKSRpKN.js +2 -0
  142. package/dashboard/dist/assets/{YamlWorkflowsPage-C4mZum6x.js.map → YamlWorkflowsPage-BoKSRpKN.js.map} +1 -1
  143. package/dashboard/dist/assets/{agents-B5wvILeV.js → agents-CpLOugsY.js} +2 -2
  144. package/dashboard/dist/assets/{agents-B5wvILeV.js.map → agents-CpLOugsY.js.map} +1 -1
  145. package/dashboard/dist/assets/{bots-BPlouRDm.js → bots-DRrquJqC.js} +2 -2
  146. package/dashboard/dist/assets/{bots-BPlouRDm.js.map → bots-DRrquJqC.js.map} +1 -1
  147. package/dashboard/dist/assets/capabilities-xbHvOXKc.js +2 -0
  148. package/dashboard/dist/assets/{capabilities-DkvRG09b.js.map → capabilities-xbHvOXKc.js.map} +1 -1
  149. package/dashboard/dist/assets/{controlplane-0m_rA-UW.js → controlplane-FilVp8jI.js} +2 -2
  150. package/dashboard/dist/assets/{controlplane-0m_rA-UW.js.map → controlplane-FilVp8jI.js.map} +1 -1
  151. package/dashboard/dist/assets/escalation-SGea3mBy.js +2 -0
  152. package/dashboard/dist/assets/{escalation-CfIAIUg2.js.map → escalation-SGea3mBy.js.map} +1 -1
  153. package/dashboard/dist/assets/escalation-columns-C6sLGnSX.js +2 -0
  154. package/dashboard/dist/assets/{escalation-columns-CLIdxlbe.js.map → escalation-columns-C6sLGnSX.js.map} +1 -1
  155. package/dashboard/dist/assets/helpers-wHzG3Maf.js +2 -0
  156. package/dashboard/dist/assets/{helpers-prGqC38M.js.map → helpers-wHzG3Maf.js.map} +1 -1
  157. package/dashboard/dist/assets/index-90jmsIHz.js +6 -0
  158. package/dashboard/dist/assets/{index-CFoddJDr.js.map → index-90jmsIHz.js.map} +1 -1
  159. package/dashboard/dist/assets/index-B7Vxutyl.js +63 -0
  160. package/dashboard/dist/assets/index-B7Vxutyl.js.map +1 -0
  161. package/dashboard/dist/assets/index-BS3KIrQL.js +2 -0
  162. package/dashboard/dist/assets/{index-P9huxx3-.js.map → index-BS3KIrQL.js.map} +1 -1
  163. package/dashboard/dist/assets/index-Bu2EEWNN.js +2 -0
  164. package/dashboard/dist/assets/{index-C0sDEKdo.js.map → index-Bu2EEWNN.js.map} +1 -1
  165. package/dashboard/dist/assets/index-C7k3xfpt.js +2 -0
  166. package/dashboard/dist/assets/{index-CuY5hPYB.js.map → index-C7k3xfpt.js.map} +1 -1
  167. package/dashboard/dist/assets/index-C8xDd-Ys.js +2 -0
  168. package/dashboard/dist/assets/{index-DqeLbz6j.js.map → index-C8xDd-Ys.js.map} +1 -1
  169. package/dashboard/dist/assets/index-CkYNpw4d.js +2 -0
  170. package/dashboard/dist/assets/{index-BR3SwTNI.js.map → index-CkYNpw4d.js.map} +1 -1
  171. package/dashboard/dist/assets/index-DVxBi47d.js +2 -0
  172. package/dashboard/dist/assets/{index-C2MJzu6J.js.map → index-DVxBi47d.js.map} +1 -1
  173. package/dashboard/dist/assets/{index-BPxglOYm.css → index-DZI2L4ag.css} +1 -1
  174. package/dashboard/dist/assets/index-Dr8WJAGM.js +6 -0
  175. package/dashboard/dist/assets/index-Dr8WJAGM.js.map +1 -0
  176. package/dashboard/dist/assets/index-DzgixtgL.js +2 -0
  177. package/dashboard/dist/assets/{index-DeL84Cag.js.map → index-DzgixtgL.js.map} +1 -1
  178. package/dashboard/dist/assets/index-E1i1ADY1.js +15 -0
  179. package/dashboard/dist/assets/{index-BgVuyWhi.js.map → index-E1i1ADY1.js.map} +1 -1
  180. package/dashboard/dist/assets/index-H2tN256i.js +2 -0
  181. package/dashboard/dist/assets/{index-CwkJBn87.js.map → index-H2tN256i.js.map} +1 -1
  182. package/dashboard/dist/assets/index-WwUcAoas.js +2 -0
  183. package/dashboard/dist/assets/{index-BWKIigEk.js.map → index-WwUcAoas.js.map} +1 -1
  184. package/dashboard/dist/assets/{knowledge-CUZxyRCO.js → knowledge-CQWNz28-.js} +2 -2
  185. package/dashboard/dist/assets/{knowledge-CUZxyRCO.js.map → knowledge-CQWNz28-.js.map} +1 -1
  186. package/dashboard/dist/assets/{mcp-B5VQPoF3.js → mcp-J_cDlKuA.js} +2 -2
  187. package/dashboard/dist/assets/{mcp-B5VQPoF3.js.map → mcp-J_cDlKuA.js.map} +1 -1
  188. package/dashboard/dist/assets/{mcp-query-Ba5Zj3yg.js → mcp-query-C1zyeRvo.js} +2 -2
  189. package/dashboard/dist/assets/{mcp-query-Ba5Zj3yg.js.map → mcp-query-C1zyeRvo.js.map} +1 -1
  190. package/dashboard/dist/assets/{mcp-runs-CAiEr5Fc.js → mcp-runs-BR4fvXXw.js} +2 -2
  191. package/dashboard/dist/assets/{mcp-runs-CAiEr5Fc.js.map → mcp-runs-BR4fvXXw.js.map} +1 -1
  192. package/dashboard/dist/assets/namespaces-XOr9_XCV.js +2 -0
  193. package/dashboard/dist/assets/{namespaces-sVr5scma.js.map → namespaces-XOr9_XCV.js.map} +1 -1
  194. package/dashboard/dist/assets/{roles-E_bA4e0f.js → roles-yuxJgQBf.js} +2 -2
  195. package/dashboard/dist/assets/{roles-E_bA4e0f.js.map → roles-yuxJgQBf.js.map} +1 -1
  196. package/dashboard/dist/assets/{tasks-CL6Gv8jB.js → tasks-CI3qsHdP.js} +2 -2
  197. package/dashboard/dist/assets/{tasks-CL6Gv8jB.js.map → tasks-CI3qsHdP.js.map} +1 -1
  198. package/dashboard/dist/assets/topics-lm2GYKuv.js +2 -0
  199. package/dashboard/dist/assets/{topics-DbtPHERP.js.map → topics-lm2GYKuv.js.map} +1 -1
  200. package/dashboard/dist/assets/{useCollapsedSections-CGNA5oKV.js → useCollapsedSections-BU5HULGs.js} +2 -2
  201. package/dashboard/dist/assets/{useCollapsedSections-CGNA5oKV.js.map → useCollapsedSections-BU5HULGs.js.map} +1 -1
  202. package/dashboard/dist/assets/{useEventHooks-C6c618cj.js → useEventHooks-DpvfSw9p.js} +2 -2
  203. package/dashboard/dist/assets/{useEventHooks-C6c618cj.js.map → useEventHooks-DpvfSw9p.js.map} +1 -1
  204. package/dashboard/dist/assets/{useExpandedRows-Cg9iq6Vy.js → useExpandedRows-CkcEntB-.js} +2 -2
  205. package/dashboard/dist/assets/{useExpandedRows-Cg9iq6Vy.js.map → useExpandedRows-CkcEntB-.js.map} +1 -1
  206. package/dashboard/dist/assets/{useFilterParams-CGRYFw_A.js → useFilterParams-DZCAaBC7.js} +2 -2
  207. package/dashboard/dist/assets/{useFilterParams-CGRYFw_A.js.map → useFilterParams-DZCAaBC7.js.map} +1 -1
  208. package/dashboard/dist/assets/{useYamlActivityEvents-eK7kIUdh.js → useYamlActivityEvents-D-zuU9Ts.js} +2 -2
  209. package/dashboard/dist/assets/{useYamlActivityEvents-eK7kIUdh.js.map → useYamlActivityEvents-D-zuU9Ts.js.map} +1 -1
  210. package/dashboard/dist/assets/{users-CCHSIAxt.js → users-DRkulG9o.js} +2 -2
  211. package/dashboard/dist/assets/{users-CCHSIAxt.js.map → users-DRkulG9o.js.map} +1 -1
  212. package/dashboard/dist/assets/{vendor-icons-D8-ZINAH.js → vendor-icons-5gSix3t2.js} +107 -102
  213. package/dashboard/dist/assets/vendor-icons-5gSix3t2.js.map +1 -0
  214. package/dashboard/dist/assets/vendor-query-B2UbickB.js +18 -0
  215. package/dashboard/dist/assets/vendor-query-B2UbickB.js.map +1 -0
  216. package/dashboard/dist/assets/vendor-react-CX88sFS5.js +22 -0
  217. package/dashboard/dist/assets/vendor-react-CX88sFS5.js.map +1 -0
  218. package/dashboard/dist/assets/{workflows-BNbocg_9.js → workflows-dhvM792w.js} +2 -2
  219. package/dashboard/dist/assets/{workflows-BNbocg_9.js.map → workflows-dhvM792w.js.map} +1 -1
  220. package/dashboard/dist/assets/{yaml-workflows-Cu1FUwrc.js → yaml-workflows-DqbGpE2x.js} +2 -2
  221. package/dashboard/dist/assets/{yaml-workflows-Cu1FUwrc.js.map → yaml-workflows-DqbGpE2x.js.map} +1 -1
  222. package/dashboard/dist/index.html +5 -5
  223. package/package.json +1 -1
  224. package/dashboard/dist/assets/AdminDashboard-ntLz5Pro.js +0 -2
  225. package/dashboard/dist/assets/AgentConfigPage-D27vWOI6.js +0 -16
  226. package/dashboard/dist/assets/AgentConfigPage-D27vWOI6.js.map +0 -1
  227. package/dashboard/dist/assets/AgentDetailPage-Cm2KFR4O.js +0 -4
  228. package/dashboard/dist/assets/AgentsPage-_ptA-0YO.js +0 -2
  229. package/dashboard/dist/assets/AvailableEscalationsPage-bdPqEzbx.js +0 -2
  230. package/dashboard/dist/assets/BotPicker-CYfFMpkY.js +0 -2
  231. package/dashboard/dist/assets/CapabilitiesPage-M7-ZTFNV.js +0 -2
  232. package/dashboard/dist/assets/CollapsibleSection-DU5KAtQ-.js +0 -2
  233. package/dashboard/dist/assets/ConfirmDeleteModal-_hW5Vc05.js +0 -2
  234. package/dashboard/dist/assets/CopyableId-DiWqv41D.js +0 -2
  235. package/dashboard/dist/assets/CredentialsPage-CmbwypSF.js +0 -2
  236. package/dashboard/dist/assets/CronLabel-nycfAefc.js +0 -2
  237. package/dashboard/dist/assets/CustomDurationPicker-gNZRBaHg.js +0 -2
  238. package/dashboard/dist/assets/DataTable-DGerT2ZM.js +0 -2
  239. package/dashboard/dist/assets/DropZone-vNcqMd05.js +0 -2
  240. package/dashboard/dist/assets/ElapsedCell-CdvQbtve.js +0 -2
  241. package/dashboard/dist/assets/EmptyState-DMldv8c5.js +0 -2
  242. package/dashboard/dist/assets/EscalationsOverview-BNENCL_2.js +0 -2
  243. package/dashboard/dist/assets/EventTable-BqDAyXyc.js +0 -2
  244. package/dashboard/dist/assets/EventTopicPill-CnHFBglc.js +0 -2
  245. package/dashboard/dist/assets/FilterBar-TYiTtUgv.js +0 -2
  246. package/dashboard/dist/assets/HomePage-fterfLKH.js +0 -2
  247. package/dashboard/dist/assets/ListToolbar-BO5Igi6v.js +0 -2
  248. package/dashboard/dist/assets/McpOverview-BQokGg0z.js +0 -2
  249. package/dashboard/dist/assets/McpQueryDetailPage-0WOp2n_j.js +0 -5
  250. package/dashboard/dist/assets/McpQueryDetailPage-0WOp2n_j.js.map +0 -1
  251. package/dashboard/dist/assets/McpQueryPage-DUey_h9J.js +0 -2
  252. package/dashboard/dist/assets/McpRunDetailPage-Cv4qyr91.js +0 -2
  253. package/dashboard/dist/assets/McpRunsPage-B3R6KZ61.js +0 -2
  254. package/dashboard/dist/assets/Modal-Qe8lW7gQ.js +0 -2
  255. package/dashboard/dist/assets/OperatorDashboard-dldvzjcg.js +0 -2
  256. package/dashboard/dist/assets/PageHeader-DF4BeEm4.js +0 -2
  257. package/dashboard/dist/assets/PageHeaderWithStats-BQZw6BgA.js +0 -2
  258. package/dashboard/dist/assets/PriorityBadge-DMyB3WLZ.js +0 -2
  259. package/dashboard/dist/assets/ProcessDetailPage-Beo-QVL-.js +0 -2
  260. package/dashboard/dist/assets/ProcessesListPage-C_ars8gp.js +0 -2
  261. package/dashboard/dist/assets/RolePill-DrBZ7JJj.js +0 -2
  262. package/dashboard/dist/assets/RolesPage-DgSXFFGL.js +0 -2
  263. package/dashboard/dist/assets/RowActions-QcakGbVA.js +0 -2
  264. package/dashboard/dist/assets/RunAsSelector-CYMeZwrM.js +0 -2
  265. package/dashboard/dist/assets/ServerName-D5NKD06M.js +0 -2
  266. package/dashboard/dist/assets/StatCard-PZQmmCHK.js +0 -2
  267. package/dashboard/dist/assets/StatusBadge-ME2R6a7K.js +0 -2
  268. package/dashboard/dist/assets/StepIndicator-CDDVahOz.js +0 -2
  269. package/dashboard/dist/assets/StickyPagination-Ddy93Q5I.js +0 -2
  270. package/dashboard/dist/assets/SwimlaneTimeline-CYYA8nd9.js +0 -2
  271. package/dashboard/dist/assets/TagInput-B45Dm3IW.js +0 -2
  272. package/dashboard/dist/assets/TaskDetailPage-CoZFkJ6d.js +0 -2
  273. package/dashboard/dist/assets/TaskDetailPage-CoZFkJ6d.js.map +0 -1
  274. package/dashboard/dist/assets/TaskQueuePill-BJRUjVDv.js +0 -2
  275. package/dashboard/dist/assets/TasksListPage-Czu08px3.js +0 -2
  276. package/dashboard/dist/assets/TimeAgo-CJ56IUy6.js +0 -2
  277. package/dashboard/dist/assets/TimestampCell-QtcYZ9Jx.js +0 -2
  278. package/dashboard/dist/assets/ToolPill-DpDv3FwI.js +0 -2
  279. package/dashboard/dist/assets/ToolTestPanel-BzFOwzd_.js +0 -2
  280. package/dashboard/dist/assets/TopicDetailPage-DwShZbh9.js +0 -9
  281. package/dashboard/dist/assets/TopicDetailPage-DwShZbh9.js.map +0 -1
  282. package/dashboard/dist/assets/TopicsPage-DKXlpZl_.js +0 -2
  283. package/dashboard/dist/assets/UserName-zlR1so37.js +0 -2
  284. package/dashboard/dist/assets/WorkflowExecutionPage-BMNIxeJB.js +0 -2
  285. package/dashboard/dist/assets/WorkflowPill-B5B3yGlh.js +0 -2
  286. package/dashboard/dist/assets/WorkflowsDashboard-BlAPZbQZ.js +0 -2
  287. package/dashboard/dist/assets/WorkflowsOverview-NnPi6rwS.js +0 -2
  288. package/dashboard/dist/assets/YamlWorkflowsPage-C4mZum6x.js +0 -2
  289. package/dashboard/dist/assets/capabilities-DkvRG09b.js +0 -2
  290. package/dashboard/dist/assets/escalation-CfIAIUg2.js +0 -2
  291. package/dashboard/dist/assets/escalation-columns-CLIdxlbe.js +0 -2
  292. package/dashboard/dist/assets/helpers-prGqC38M.js +0 -2
  293. package/dashboard/dist/assets/index-4T7Z_gQ4.js +0 -281
  294. package/dashboard/dist/assets/index-4T7Z_gQ4.js.map +0 -1
  295. package/dashboard/dist/assets/index-BR3SwTNI.js +0 -2
  296. package/dashboard/dist/assets/index-BWKIigEk.js +0 -2
  297. package/dashboard/dist/assets/index-BgVuyWhi.js +0 -15
  298. package/dashboard/dist/assets/index-C0sDEKdo.js +0 -2
  299. package/dashboard/dist/assets/index-C2MJzu6J.js +0 -2
  300. package/dashboard/dist/assets/index-CFoddJDr.js +0 -6
  301. package/dashboard/dist/assets/index-CrMxD5Ib.js +0 -6
  302. package/dashboard/dist/assets/index-CrMxD5Ib.js.map +0 -1
  303. package/dashboard/dist/assets/index-CuY5hPYB.js +0 -2
  304. package/dashboard/dist/assets/index-CwkJBn87.js +0 -2
  305. package/dashboard/dist/assets/index-DeL84Cag.js +0 -2
  306. package/dashboard/dist/assets/index-DqeLbz6j.js +0 -2
  307. package/dashboard/dist/assets/index-P9huxx3-.js +0 -2
  308. package/dashboard/dist/assets/namespaces-sVr5scma.js +0 -2
  309. package/dashboard/dist/assets/topics-DbtPHERP.js +0 -2
  310. package/dashboard/dist/assets/vendor-icons-D8-ZINAH.js.map +0 -1
  311. package/dashboard/dist/assets/vendor-query-DLp59M9_.js +0 -35
  312. package/dashboard/dist/assets/vendor-query-DLp59M9_.js.map +0 -1
  313. package/dashboard/dist/assets/vendor-react-Co3Y8ikm.js +0 -26
  314. package/dashboard/dist/assets/vendor-react-Co3Y8ikm.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{u as n,b as s,c as u}from"./vendor-query-DLp59M9_.js";import{b as r}from"./index-4T7Z_gQ4.js";function f(){return n({queryKey:["activeWorkers"],queryFn:async()=>(await r("/workflows/workers")).workers})}function w(){return n({queryKey:["discoveredWorkflows"],queryFn:async()=>(await r("/workflows/discovered")).workflows})}function l(){return n({queryKey:["workflowConfigs"],queryFn:async()=>(await r("/workflows/config")).workflows})}function d(){return n({queryKey:["cronStatus"],queryFn:async()=>(await r("/workflows/cron/status")).schedules})}function k(e){return n({queryKey:["workflowExecution",e],queryFn:()=>r(`/workflow-states/${e}/execution`),enabled:!!e})}function m(e){const o=new URLSearchParams;return e.limit&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),e.entity&&o.set("entity",e.entity),e.search&&o.set("search",e.search),e.status&&o.set("status",e.status),e.sort_by&&o.set("sort_by",e.sort_by),e.order&&o.set("order",e.order),e.registered&&o.set("registered",e.registered),e.namespace&&o.set("namespace",e.namespace),n({queryKey:["jobs",e],queryFn:()=>r(`/workflow-states/jobs?${o}`)})}function q(){const e=s();return u({mutationFn:o=>r(`/workflows/${o}/terminate`,{method:"POST"}),onSuccess:(o,t)=>{e.invalidateQueries({queryKey:["workflowExecution",t],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function h(){const e=s();return u({mutationFn:({workflow_type:o,...t})=>r(`/workflows/${encodeURIComponent(o)}/config`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function p(){const e=s();return u({mutationFn:o=>r(`/workflows/${encodeURIComponent(o)}/config`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function g(){const e=s();return u({mutationFn:({config:o,cron_schedule:t,envelope_schema:i})=>r(`/workflows/${encodeURIComponent(o.workflow_type)}/config`,{method:"PUT",body:JSON.stringify({...o,cron_schedule:t,...i!==void 0?{envelope_schema:i}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"}),e.invalidateQueries({queryKey:["cronStatus"],refetchType:"all"})}})}function C(){const e=s();return u({mutationFn:({workflowType:o,data:t,metadata:i,execute_as:a})=>r(`/workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,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,C as c,g as d,w as e,d as f,q as g,f as h,p as i,h as j,l as u};
2
- //# sourceMappingURL=workflows-BNbocg_9.js.map
1
+ import{u as n,b as s,c as u}from"./vendor-query-B2UbickB.js";import{b as r}from"./index-B7Vxutyl.js";function f(){return n({queryKey:["activeWorkers"],queryFn:async()=>(await r("/workflows/workers")).workers})}function w(){return n({queryKey:["discoveredWorkflows"],queryFn:async()=>(await r("/workflows/discovered")).workflows})}function l(){return n({queryKey:["workflowConfigs"],queryFn:async()=>(await r("/workflows/config")).workflows})}function d(){return n({queryKey:["cronStatus"],queryFn:async()=>(await r("/workflows/cron/status")).schedules})}function k(e){return n({queryKey:["workflowExecution",e],queryFn:()=>r(`/workflow-states/${e}/execution`),enabled:!!e})}function m(e){const o=new URLSearchParams;return e.limit&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),e.entity&&o.set("entity",e.entity),e.search&&o.set("search",e.search),e.status&&o.set("status",e.status),e.sort_by&&o.set("sort_by",e.sort_by),e.order&&o.set("order",e.order),e.registered&&o.set("registered",e.registered),e.namespace&&o.set("namespace",e.namespace),n({queryKey:["jobs",e],queryFn:()=>r(`/workflow-states/jobs?${o}`)})}function q(){const e=s();return u({mutationFn:o=>r(`/workflows/${o}/terminate`,{method:"POST"}),onSuccess:(o,t)=>{e.invalidateQueries({queryKey:["workflowExecution",t],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function h(){const e=s();return u({mutationFn:({workflow_type:o,...t})=>r(`/workflows/${encodeURIComponent(o)}/config`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function p(){const e=s();return u({mutationFn:o=>r(`/workflows/${encodeURIComponent(o)}/config`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function g(){const e=s();return u({mutationFn:({config:o,cron_schedule:t,envelope_schema:i})=>r(`/workflows/${encodeURIComponent(o.workflow_type)}/config`,{method:"PUT",body:JSON.stringify({...o,cron_schedule:t,...i!==void 0?{envelope_schema:i}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"}),e.invalidateQueries({queryKey:["cronStatus"],refetchType:"all"})}})}function C(){const e=s();return u({mutationFn:({workflowType:o,data:t,metadata:i,execute_as:a})=>r(`/workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,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,C as c,g as d,w as e,d as f,q as g,f as h,p as i,h as j,l as u};
2
+ //# sourceMappingURL=workflows-dhvM792w.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflows-BNbocg_9.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}) {\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 });\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 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","params","useTerminateWorkflow","queryClient","useQueryClient","useMutation","_data","useUpsertWorkflowConfig","workflow_type","body","useDeleteWorkflowConfig","workflowType","useSetCronSchedule","config","cron_schedule","envelope_schema","useInvokeWorkflow","data","metadata","execute_as"],"mappings":"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"}
1
+ {"version":3,"file":"workflows-dhvM792w.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}) {\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 });\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 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","params","useTerminateWorkflow","queryClient","useQueryClient","useMutation","_data","useUpsertWorkflowConfig","workflow_type","body","useDeleteWorkflowConfig","workflowType","useSetCronSchedule","config","cron_schedule","envelope_schema","useInvokeWorkflow","data","metadata","execute_as"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{u as l,b as a,c as n}from"./vendor-query-DLp59M9_.js";import{b as r}from"./index-4T7Z_gQ4.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 n({mutationFn:o=>r("/yaml-workflows",{method:"POST",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function k(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}/deploy`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function d(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}/activate`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function p(){const e=a();return n({mutationFn:({id:o,data:t,sync:s,execute_as:u})=>r(`/yaml-workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,sync:s,...u?{execute_as:u}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function h(){const e=a();return n({mutationFn:({id:o,task_queue:t,compilation_feedback:s})=>r(`/yaml-workflows/${o}/regenerate`,{method:"POST",body:JSON.stringify({task_queue:t,compilation_feedback:s})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function q(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}/archive`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function W(){const e=a();return n({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 n({mutationFn:({id:o,...t})=>r(`/yaml-workflows/${o}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function T(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function v(){const e=a();return n({mutationFn:({id:o,cron_schedule:t,cron_envelope:s,execute_as:u})=>r(`/yaml-workflows/${o}/cron`,{method:"PUT",body:JSON.stringify({cron_schedule:t,cron_envelope:s,execute_as:u})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function F(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}/cron`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function K(e){return l({queryKey:["yamlWorkflows",e,"versions"],queryFn:()=>r(`/yaml-workflows/${e}/versions`),enabled:!!e})}function C(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,K as d,k as e,d as f,q as g,W as h,T as i,h as j,C as k,p as l,w as m,v as n,F as o,f as u};
2
- //# sourceMappingURL=yaml-workflows-Cu1FUwrc.js.map
1
+ import{u as l,b as a,c as n}from"./vendor-query-B2UbickB.js";import{b as r}from"./index-B7Vxutyl.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 n({mutationFn:o=>r("/yaml-workflows",{method:"POST",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function k(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}/deploy`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function d(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}/activate`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function p(){const e=a();return n({mutationFn:({id:o,data:t,sync:s,execute_as:u})=>r(`/yaml-workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,sync:s,...u?{execute_as:u}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function h(){const e=a();return n({mutationFn:({id:o,task_queue:t,compilation_feedback:s})=>r(`/yaml-workflows/${o}/regenerate`,{method:"POST",body:JSON.stringify({task_queue:t,compilation_feedback:s})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function q(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}/archive`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function W(){const e=a();return n({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 n({mutationFn:({id:o,...t})=>r(`/yaml-workflows/${o}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function T(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function v(){const e=a();return n({mutationFn:({id:o,cron_schedule:t,cron_envelope:s,execute_as:u})=>r(`/yaml-workflows/${o}/cron`,{method:"PUT",body:JSON.stringify({cron_schedule:t,cron_envelope:s,execute_as:u})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function F(){const e=a();return n({mutationFn:o=>r(`/yaml-workflows/${o}/cron`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function K(e){return l({queryKey:["yamlWorkflows",e,"versions"],queryFn:()=>r(`/yaml-workflows/${e}/versions`),enabled:!!e})}function C(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,K as d,k as e,d as f,q as g,W as h,T as i,h as j,C as k,p as l,w as m,v as n,F as o,f as u};
2
+ //# sourceMappingURL=yaml-workflows-DqbGpE2x.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"yaml-workflows-Cu1FUwrc.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","useSetYamlCron","cron_schedule","cron_envelope","useClearYamlCron","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
1
+ {"version":3,"file":"yaml-workflows-DqbGpE2x.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","useSetYamlCron","cron_schedule","cron_envelope","useClearYamlCron","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-4T7Z_gQ4.js"></script>
12
- <link rel="modulepreload" crossorigin href="/assets/vendor-query-DLp59M9_.js">
13
- <link rel="modulepreload" crossorigin href="/assets/vendor-react-Co3Y8ikm.js">
14
- <link rel="modulepreload" crossorigin href="/assets/vendor-icons-D8-ZINAH.js">
15
- <link rel="stylesheet" crossorigin href="/assets/index-BPxglOYm.css">
11
+ <script type="module" crossorigin src="/assets/index-B7Vxutyl.js"></script>
12
+ <link rel="modulepreload" crossorigin href="/assets/vendor-query-B2UbickB.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-CX88sFS5.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/vendor-icons-5gSix3t2.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/index-DZI2L4ag.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/long-tail",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
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",
@@ -1,2 +0,0 @@
1
- import{s as n,j as o}from"./index-4T7Z_gQ4.js";import{c as m}from"./tasks-CL6Gv8jB.js";import{f as d}from"./useEventHooks-C6c618cj.js";import{u}from"./mcp-B5VQPoF3.js";import{P as c}from"./PageHeaderWithStats-BQZw6BgA.js";import"./vendor-query-DLp59M9_.js";import"./vendor-react-Co3Y8ikm.js";import"./vendor-icons-D8-ZINAH.js";function N(){var e;d();const{data:a}=m({limit:1}),{data:t}=n({status:"pending",limit:1}),{data:s}=u(),i=((e=s==null?void 0:s.servers)==null?void 0:e.filter(l=>l.status==="connected").length)??0,r=s?`${i}/${s.total}`:"—";return o.jsxDEV("div",{children:o.jsxDEV(c,{title:"Admin",stats:[{label:"Tasks",value:(a==null?void 0:a.total)??"—"},{label:"Pending Escalations",value:(t==null?void 0:t.total)??"—",dotClass:"bg-status-pending"},{label:"MCP Servers",value:r},{label:"System",value:"Healthy",dotClass:"bg-status-success"}]},void 0,!1,{fileName:"/app/dashboard/src/pages/admin/AdminDashboard.tsx",lineNumber:19,columnNumber:7},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/admin/AdminDashboard.tsx",lineNumber:18,columnNumber:5},this)}export{N as AdminDashboard};
2
- //# sourceMappingURL=AdminDashboard-ntLz5Pro.js.map
@@ -1,16 +0,0 @@
1
- import{j as e,d as ne,u as le}from"./index-4T7Z_gQ4.js";import{a as N}from"./vendor-query-DLp59M9_.js";import{a as oe,d as ce,b as de}from"./agents-B5wvILeV.js";import{C as pe,u as me,a as ue,b as be,c as he}from"./CronLabel-nycfAefc.js";import{P as Ne}from"./PageHeader-DF4BeEm4.js";import{B as R,d as z,b as xe,R as Y,Y as $,n as X,a4 as B,a as Z,aF as ee,K as ge}from"./vendor-icons-D8-ZINAH.js";import{e as fe}from"./knowledge-CUZxyRCO.js";import{R as ae}from"./RunAsSelector-CYMeZwrM.js";import{u as ve}from"./workflows-BNbocg_9.js";import{u as Se}from"./yaml-workflows-Cu1FUwrc.js";import{u as se}from"./capabilities-DkvRG09b.js";import{u as we}from"./topics-DbtPHERP.js";import{E as ye}from"./EventTopicPill-CnHFBglc.js";import{W as H}from"./WorkflowPill-B5B3yGlh.js";import{e as Ee,c as je,f as De}from"./vendor-react-Co3Y8ikm.js";import"./BotPicker-CYfFMpkY.js";import"./bots-BPlouRDm.js";const Q={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Ve={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},_e={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function ke(s,t){var o,p,u;const l=(p=(o=s.behaviors)==null?void 0:o.schedules)!=null&&p.length?s.behaviors.schedules.map(i=>({cron:i.cron||"",reaction_type:i.reaction_type||"durable",workflow_type:i.workflow_type||"",pipeline_id:i.pipeline_id||"",server_id:i.server_id||"",tool_name:i.tool_name||"",envelope:i.envelope?JSON.stringify(i.envelope,null,2):"{}",execute_as:i.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:t.map(i=>({id:i.id,topic:i.topic,filter:i.filter?JSON.stringify(i.filter,null,2):"",reaction_type:i.reaction_type,workflow_type:i.workflow_type??"",pipeline_id:i.pipeline_id??"",mcp_prompt:i.mcp_prompt??"",server_id:i.server_id??"",tool_name:i.tool_name??"",input_mapping:JSON.stringify(i.input_mapping??{},null,2),execute_as:i.execute_as??"",enabled:i.enabled})),schedules:l}}function Ce(s){var l;const t={};return s.schedules.length>0&&(t.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:J(o.envelope)??{},execute_as:o.execute_as||void 0})),t.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:t,workflow_type:((l=s.schedules[0])==null?void 0:l.workflow_type)||void 0,pipeline_id:void 0}}function Re(s){return s.subscriptions.map(t=>({id:t.id,topic:t.topic,filter:t.filter?J(t.filter):void 0,reaction_type:t.reaction_type,workflow_type:t.workflow_type||void 0,pipeline_id:t.pipeline_id||void 0,mcp_prompt:t.mcp_prompt||void 0,server_id:t.server_id||void 0,tool_name:t.tool_name||void 0,input_mapping:J(t.input_mapping)??{},execute_as:t.execute_as||void 0,enabled:t.enabled}))}function J(s){if(s.trim())try{return JSON.parse(s)}catch{return}}const V="section-header mt-[3em] first:mt-0",A="label",E="hint",k="input",O="input-json w-full";function Pe({form:s,set:t}){return e.jsxDEV("div",{className:"space-y-8",children:[e.jsxDEV("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsxDEV("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."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:14,columnNumber:9},this),e.jsxDEV("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.jsxDEV(R,{className:"w-3 h-3",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:17,columnNumber:194},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:17,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:13,columnNumber:7},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:A,children:"Name *"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:21,columnNumber:9},this),e.jsxDEV("input",{type:"text",value:s.name,onChange:l=>t("name",l.target.value),placeholder:"health-monitor",className:k},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:22,columnNumber:9},this),e.jsxDEV("p",{className:E,children:"Lowercase, kebab-case. This appears everywhere."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:23,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:20,columnNumber:7},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:A,children:"Description"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:27,columnNumber:9},this),e.jsxDEV("input",{type:"text",value:s.description,onChange:l=>t("description",l.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:k},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:28,columnNumber:9},this),e.jsxDEV("p",{className:E,children:"One sentence that explains what this automation does."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:29,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:26,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/IdentityStep.tsx",lineNumber:12,columnNumber:5},this)}function Ae({form:s,set:t}){return e.jsxDEV("div",{className:"space-y-8",children:[e.jsxDEV("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsxDEV("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:14,columnNumber:9},this),e.jsxDEV("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.jsxDEV(R,{className:"w-3 h-3",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:17,columnNumber:198},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:17,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:13,columnNumber:7},this),e.jsxDEV("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:A,children:"Goals"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:22,columnNumber:11},this),e.jsxDEV("textarea",{value:s.goals,onChange:l=>t("goals",l.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${k} resize-none`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:23,columnNumber:11},this),e.jsxDEV("p",{className:E,children:"Primary motivation. What the automation is trying to achieve."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:24,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:21,columnNumber:9},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:A,children:"Rules"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:27,columnNumber:11},this),e.jsxDEV("textarea",{value:s.rules,onChange:l=>t("rules",l.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${k} resize-none`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:28,columnNumber:11},this),e.jsxDEV("p",{className:E,children:"Guardrails. What it must never do, even when goals suggest it should."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:29,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:26,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:20,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/MotivationStep.tsx",lineNumber:12,columnNumber:5},this)}function Ie({form:s,set:t}){const{data:l}=fe(),o=(l==null?void 0:l.domains)??[];return e.jsxDEV("div",{className:"space-y-6",children:[e.jsxDEV("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsxDEV("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."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:19,columnNumber:9},this),e.jsxDEV("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.jsxDEV(R,{className:"w-3 h-3",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:22,columnNumber:196},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:22,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:18,columnNumber:7},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:A,children:"Knowledge Domain"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:26,columnNumber:9},this),e.jsxDEV("input",{type:"text",value:s.knowledge_domain,onChange:p=>t("knowledge_domain",p.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:k,list:"domain-suggestions"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:27,columnNumber:9},this),e.jsxDEV("datalist",{id:"domain-suggestions",children:o.map(p=>e.jsxDEV("option",{value:p.domain},p.domain,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:36,columnNumber:31},this))},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:35,columnNumber:9},this),e.jsxDEV("p",{className:E,children:"Choose an existing domain to share memory, or type a new name to create one."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:38,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:25,columnNumber:7},this),o.length>0&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:A,children:"Existing Domains"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:43,columnNumber:11},this),e.jsxDEV("div",{className:"space-y-0.5 mt-2",children:o.map(p=>e.jsxDEV("button",{type:"button",onClick:()=>t("knowledge_domain",p.domain),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${s.knowledge_domain===p.domain?"border-l-2 border-l-accent bg-accent/5":"hover:bg-surface-hover border-l-2 border-l-transparent"}`,children:[e.jsxDEV(z,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:54,columnNumber:17},this),e.jsxDEV("span",{className:"text-sm text-text-primary flex-1",children:p.domain},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:55,columnNumber:17},this),e.jsxDEV("span",{className:"text-[10px] text-text-quaternary",children:[p.count," entries"]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:56,columnNumber:17},this),e.jsxDEV("span",{className:"text-[9px] text-text-quaternary",children:e.jsxDEV(ne,{date:p.latest},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:57,columnNumber:67},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:57,columnNumber:17},this)]},p.domain,!0,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:46,columnNumber:15},this))},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:44,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:42,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/KnowledgeStep.tsx",lineNumber:17,columnNumber:5},this)}function Me({serverId:s,toolName:t,onChange:l}){const{data:o}=se(),p=N.useMemo(()=>{var a;return((a=o==null?void 0:o.categories)==null?void 0:a.flatMap(r=>r.tools))??[]},[o]),[u,i]=N.useState(!1),[x,d]=N.useState(""),c=N.useRef(null),h=N.useRef(null);N.useEffect(()=>{if(!u)return;function a(r){h.current&&!h.current.contains(r.target)&&i(!1)}return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[u]);const n=t?`${t}`:"",m=u?x:n,w=N.useMemo(()=>{const a=(u?x:"").toLowerCase();return a?p.filter(r=>r.name.toLowerCase().includes(a)||r.serverName.toLowerCase().includes(a)||(r.description??"").toLowerCase().includes(a)):p},[p,x,u]),b=t?p.find(a=>a.serverId===s&&a.name===t):void 0;return e.jsxDEV("div",{ref:h,className:"relative",children:[e.jsxDEV("input",{ref:c,type:"text",value:m,onFocus:()=>{i(!0),d(n)},onChange:a=>{const r=a.target.value;d(r),r||l("",""),u||i(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:59,columnNumber:7},this),!u&&(b==null?void 0:b.description)&&e.jsxDEV("p",{className:"text-[10px] text-text-tertiary mt-1 italic",children:b.description},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:76,columnNumber:9},this),u&&w.length>0&&e.jsxDEV("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:w.map(a=>e.jsxDEV("button",{type:"button",onClick:()=>{l(a.serverId,a.name),d(a.name),i(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===a.serverId&&t===a.name?"bg-accent/5":""}`,children:[e.jsxDEV("span",{className:"text-[11px] font-mono text-text-primary shrink-0",children:a.name},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:94,columnNumber:15},this),e.jsxDEV("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.jsxDEV(xe,{className:"w-2 h-2",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:96,columnNumber:17},this),a.serverName]},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:95,columnNumber:15},this),a.description&&e.jsxDEV("span",{className:"text-[10px] text-text-quaternary truncate",children:a.description},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:100,columnNumber:17},this)]},`${a.serverId}:${a.name}`,!0,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:82,columnNumber:13},this))},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:80,columnNumber:9},this),u&&w.length===0&&x&&e.jsxDEV("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.jsxDEV("p",{className:"text-[11px] text-text-quaternary",children:['No capabilities match "',x,'"']},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:109,columnNumber:11},this)},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:108,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/CapabilityCombobox.tsx",lineNumber:58,columnNumber:5},this)}const qe={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},We=["durable","pipeline","capability","mcp_query"];function te({reactionType:s,onReactionTypeChange:t,workflowType:l,onWorkflowTypeChange:o,pipelineId:p,onPipelineIdChange:u,serverId:i,toolName:x,onCapabilityChange:d,mcpPrompt:c,onMcpPromptChange:h,availableTypes:n=[...We]}){const{data:m}=ve(),w=(m??[]).filter(r=>r.invocable).map(r=>r.workflow_type),{data:b}=Se({status:"active"}),a=((b==null?void 0:b.workflows)??[]).map(r=>({id:r.id,name:r.graph_topic||r.id}));return e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{className:"flex gap-1",children:n.map(r=>{const g=s===r;return e.jsxDEV("button",{type:"button",onClick:()=>t(r),className:`px-3 py-1.5 text-[11px] font-medium rounded-md transition-colors ${g?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:qe[r]},r,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:55,columnNumber:13},this)})},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:51,columnNumber:7},this),s==="durable"&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"label",children:"Workflow *"},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:74,columnNumber:11},this),e.jsxDEV("select",{value:l,onChange:r=>o(r.target.value),className:"input",children:[e.jsxDEV("option",{value:"",children:"Select workflow..."},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:76,columnNumber:13},this),w.map(r=>e.jsxDEV("option",{value:r,children:r},r,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:77,columnNumber:45},this))]},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:75,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:73,columnNumber:9},this),s==="pipeline"&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"label",children:"Pipeline *"},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:84,columnNumber:11},this),e.jsxDEV("select",{value:p,onChange:r=>u(r.target.value),className:"input",children:[e.jsxDEV("option",{value:"",children:"Select pipeline..."},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:86,columnNumber:13},this),a.map(r=>e.jsxDEV("option",{value:r.id,children:r.name},r.id,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:87,columnNumber:35},this))]},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:85,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:83,columnNumber:9},this),s==="capability"&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"label",children:"Capability *"},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:94,columnNumber:11},this),e.jsxDEV(Me,{serverId:i,toolName:x,onChange:d},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:95,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:93,columnNumber:9},this),s==="mcp_query"&&h&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"label",children:"Prompt *"},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:105,columnNumber:11},this),e.jsxDEV("textarea",{value:c??"",onChange:r=>h(r.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"},void 0,!1,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:106,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:104,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/components/common/form/ReactionSelector.tsx",lineNumber:49,columnNumber:5},this)}const $e={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 Oe({form:s,set:t}){const{data:l}=we({limit:200}),{data:o}=se(),p=(l==null?void 0:l.topics)??[],u=N.useMemo(()=>{var a;return((a=o==null?void 0:o.categories)==null?void 0:a.flatMap(r=>r.tools))??[]},[o]),[i,x]=N.useState(0),d=(a,r,g)=>{const f=[...s.subscriptions];f[a]={...f[a],[r]:g},t("subscriptions",f)},c=()=>{t("subscriptions",[...s.subscriptions,{...Ve}]),x(s.subscriptions.length)},h=a=>{t("subscriptions",s.subscriptions.filter((r,g)=>g!==a)),i>=s.subscriptions.length-1&&x(Math.max(0,s.subscriptions.length-2))},n=s.subscriptions,m=n[i],w=a=>a.topic?a.reaction_type==="durable"?!!a.workflow_type:a.reaction_type==="pipeline"?!!a.pipeline_id:a.reaction_type==="mcp_query"?!!a.mcp_prompt:a.reaction_type==="capability"?!!a.server_id&&!!a.tool_name:!1:!1,b=m?p.find(a=>a.topic===m.topic):void 0;return n.length===0?e.jsxDEV("div",{className:"max-w-xl",children:[e.jsxDEV("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsxDEV("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."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:68,columnNumber:11},this),e.jsxDEV("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.jsxDEV(R,{className:"w-3 h-3",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:71,columnNumber:206},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:71,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:67,columnNumber:9},this),e.jsxDEV("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsxDEV(Y,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:74,columnNumber:11},this),e.jsxDEV("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:75,columnNumber:11},this),e.jsxDEV("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."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:76,columnNumber:11},this),e.jsxDEV("button",{onClick:c,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsxDEV($,{className:"w-3.5 h-3.5"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:80,columnNumber:13},this)," Add first subscription"]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:79,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:73,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:66,columnNumber:7},this):e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsxDEV("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."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:90,columnNumber:9},this),e.jsxDEV("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.jsxDEV(R,{className:"w-3 h-3",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:93,columnNumber:204},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:93,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:89,columnNumber:7},this),e.jsxDEV("div",{className:"flex gap-8",children:[e.jsxDEV("div",{className:"w-52 shrink-0 space-y-0.5",children:[n.map((a,r)=>e.jsxDEV("div",{className:`group/sub flex items-center rounded-md transition-colors ${i===r?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxDEV("button",{onClick:()=>x(r),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxDEV("div",{className:"flex items-center gap-1.5",children:[e.jsxDEV("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${w(a)?"bg-emerald-400":"bg-zinc-500"}`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:105,columnNumber:19},this),e.jsxDEV("span",{className:"text-[11px] font-mono truncate",children:a.topic||"new subscription"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:106,columnNumber:19},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:104,columnNumber:17},this),e.jsxDEV("span",{className:"text-[9px] text-text-quaternary ml-3",children:["→ ",a.workflow_type||a.tool_name||a.reaction_type]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:108,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:103,columnNumber:15},this),e.jsxDEV("button",{onClick:g=>{g.stopPropagation(),confirm(`Remove subscription "${a.topic||"new"}"?
2
-
3
- This takes effect when you save.`)&&h(r)},className:"opacity-0 group-hover/sub:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsxDEV(X,{className:"w-3 h-3"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:111,columnNumber:17},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:110,columnNumber:15},this)]},r,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:100,columnNumber:13},this)),e.jsxDEV("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.jsxDEV($,{className:"w-3 h-3"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:116,columnNumber:13},this)," Add"]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:115,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:98,columnNumber:9},this),m&&e.jsxDEV("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:V,children:"When this event fires"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:126,columnNumber:15},this),e.jsxDEV(Ke,{value:m.topic,onChange:a=>d(i,"topic",a),topics:p},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:127,columnNumber:15},this),(b==null?void 0:b.payload_schema)&&e.jsxDEV("div",{className:"mt-3 p-3 rounded-md bg-surface-sunken border border-surface-border",children:[e.jsxDEV("p",{className:"text-[10px] text-text-quaternary mb-1 uppercase tracking-wider font-medium",children:"Payload Schema"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:136,columnNumber:19},this),e.jsxDEV("pre",{className:"text-[11px] font-mono text-text-secondary whitespace-pre-wrap overflow-x-auto max-h-40",children:JSON.stringify(b.payload_schema.properties??b.payload_schema,null,2)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:137,columnNumber:19},this),b.description&&e.jsxDEV("p",{className:"text-[10px] text-text-tertiary mt-2 italic",children:b.description},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:141,columnNumber:21},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:135,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:125,columnNumber:13},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:V,children:"Run this reaction"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:149,columnNumber:15},this),e.jsxDEV(te,{reactionType:m.reaction_type,onReactionTypeChange:a=>d(i,"reaction_type",a),workflowType:m.workflow_type,onWorkflowTypeChange:a=>d(i,"workflow_type",a),pipelineId:m.pipeline_id,onPipelineIdChange:a=>d(i,"pipeline_id",a),serverId:m.server_id,toolName:m.tool_name,onCapabilityChange:(a,r)=>{var C;const g=[...s.subscriptions],f={...g[i],server_id:a,tool_name:r},j=u.find(S=>S.serverId===a&&S.name===r),P=(C=j==null?void 0:j.inputSchema)==null?void 0:C.properties;if(P&&r){const S={};for(const I of Object.keys(P))I.startsWith("_")||(S[I]=`{event.data.${I}}`);f.input_mapping=JSON.stringify(S,null,2)}g[i]=f,t("subscriptions",g)},mcpPrompt:m.mcp_prompt,onMcpPromptChange:a=>d(i,"mcp_prompt",a)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:150,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:148,columnNumber:13},this),e.jsxDEV("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:V,children:"As identity"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:185,columnNumber:17},this),e.jsxDEV(ae,{selected:m.execute_as,onChange:a=>d(i,"execute_as",a)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:186,columnNumber:17},this),e.jsxDEV("p",{className:E,children:"Identity used when invoking the workflow."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:187,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:184,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:V,children:"But only if"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:190,columnNumber:17},this),e.jsxDEV("input",{type:"text",value:m.filter,onChange:a=>d(i,"filter",a.target.value),placeholder:"No filter (all matching events)",className:`${k} font-mono text-xs`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:191,columnNumber:17},this),e.jsxDEV("p",{className:E,children:["JSON filter against event.data, e.g. ",'{"status": 422}']},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:192,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:189,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:183,columnNumber:13},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:V,children:"With this data"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:198,columnNumber:15},this),m.reaction_type==="capability"&&m.tool_name?e.jsxDEV(Te,{tool:u.find(a=>a.serverId===m.server_id&&a.name===m.tool_name),value:m.input_mapping,onChange:a=>d(i,"input_mapping",a),eventSchema:b==null?void 0:b.payload_schema},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:200,columnNumber:17},this):e.jsxDEV(e.Fragment,{children:[e.jsxDEV("textarea",{value:m.input_mapping,onChange:a=>d(i,"input_mapping",a.target.value),rows:10,className:O,placeholder:`{
4
- "data": {
5
- "orderId": "{event.data.orderId}",
6
- "error": "{event.data.error}"
7
- }
8
- }`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:208,columnNumber:19},this),e.jsxDEV("p",{className:E,children:["Maps event fields to workflow input. ","{event.data.fieldName}"," resolves at runtime."]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:209,columnNumber:19},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:207,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:197,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:122,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:96,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:88,columnNumber:5},this)}function Te({tool:s,value:t,onChange:l,eventSchema:o}){var w,b;const[p,u]=N.useState(!1),i=((w=s==null?void 0:s.inputSchema)==null?void 0:w.properties)??{},x=((b=s==null?void 0:s.inputSchema)==null?void 0:b.required)??[],d=Object.entries(i).filter(([a])=>!a.startsWith("_")),c=N.useMemo(()=>[...d].sort(([a],[r])=>{const g=x.indexOf(a),f=x.indexOf(r);return g!==-1&&f!==-1?g-f:g!==-1?-1:f!==-1?1:a.localeCompare(r)}),[d,x]),h=N.useMemo(()=>{const a=[{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"}],r=o==null?void 0:o.properties;if(r)for(const[g,f]of Object.entries(r))a.push({value:`{event.data.${g}}`,label:f.description||g});return a},[o]),n=N.useMemo(()=>{try{return JSON.parse(t)}catch{return{}}},[t]),m=(a,r)=>{const g={...n,[a]:r};l(JSON.stringify(g,null,2))};return c.length===0||p?e.jsxDEV("div",{children:[c.length>0&&e.jsxDEV("div",{className:"flex justify-end mb-1",children:e.jsxDEV("button",{type:"button",onClick:()=>u(!1),className:"text-[10px] text-accent hover:text-accent-hover transition-colors",children:"Form view"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:281,columnNumber:13},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:280,columnNumber:11},this),e.jsxDEV("textarea",{value:t,onChange:a=>l(a.target.value),rows:8,className:O,placeholder:`{
9
- "domain": "{event.data.name}",
10
- "key": "{event.data.path}"
11
- }`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:284,columnNumber:9},this),e.jsxDEV("p",{className:E,children:["Maps event fields to capability inputs. ","{event.data.fieldName}"," resolves at runtime."]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:285,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:278,columnNumber:7},this):e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"flex items-center justify-between mb-3",children:[e.jsxDEV("p",{className:"text-[11px] text-text-tertiary",children:"Map each input to an event field or enter a static value."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:293,columnNumber:9},this),e.jsxDEV("button",{type:"button",onClick:()=>u(!0),className:"text-[10px] text-text-tertiary hover:text-accent transition-colors",children:"Raw JSON"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:296,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:292,columnNumber:7},this),e.jsxDEV("div",{className:"space-y-4",children:c.map(([a,r])=>{const g=x.includes(a),f=r.description,j=r.type,P=typeof n[a]=="string"?n[a]:typeof n[a]=="object"?JSON.stringify(n[a]):n[a]!=null?String(n[a]):"";return e.jsxDEV("div",{className:"bg-surface-sunken/30 rounded-md px-4 py-3",children:[e.jsxDEV("div",{className:"flex items-baseline gap-2 mb-0.5",children:[e.jsxDEV("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[a.replace(/[_-]/g," "),g&&e.jsxDEV("span",{className:"text-status-error ml-0.5",children:"*"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:313,columnNumber:29},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:311,columnNumber:17},this),j&&e.jsxDEV("span",{className:"text-[9px] text-text-quaternary",children:j},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:315,columnNumber:31},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:310,columnNumber:15},this),f&&e.jsxDEV("p",{className:"text-[10px] text-text-quaternary mb-2",children:f},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:317,columnNumber:24},this),e.jsxDEV(Le,{value:P,onChange:C=>m(a,C),suggestions:h,fieldType:j,placeholder:`{event.data.${a}}`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:318,columnNumber:15},this)]},a,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:309,columnNumber:13},this)})},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:299,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:291,columnNumber:5},this)}function Le({value:s,onChange:t,suggestions:l,fieldType:o,placeholder:p}){const[u,i]=N.useState(!1),[x,d]=N.useState(""),c=N.useRef(null);N.useEffect(()=>{if(!u)return;function n(m){c.current&&!c.current.contains(m.target)&&i(!1)}return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[u]);const h=l.filter(n=>n.value.toLowerCase().includes(x.toLowerCase())||n.label.toLowerCase().includes(x.toLowerCase()));return o==="object"?e.jsxDEV("textarea",{value:s,onChange:n=>{try{t(JSON.parse(n.target.value))}catch{t(n.target.value)}},rows:3,className:`${O} text-xs`,placeholder:'{ "source": "{event.source}" }'},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:361,columnNumber:7},this):e.jsxDEV("div",{ref:c,className:"relative",children:[e.jsxDEV("input",{type:"text",value:s,onFocus:()=>{i(!0),d("")},onChange:n=>{t(n.target.value),d(n.target.value),u||i(!0)},className:"input font-mono text-xs w-full",placeholder:p},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:376,columnNumber:7},this),u&&h.length>0&&e.jsxDEV("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:h.map(n=>e.jsxDEV("button",{type:"button",onClick:()=>{t(n.value),i(!1)},className:`w-full text-left px-3 py-1.5 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===n.value?"bg-accent/5":""}`,children:[e.jsxDEV("span",{className:"text-[11px] font-mono text-accent shrink-0",children:n.value},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:393,columnNumber:15},this),e.jsxDEV("span",{className:"text-[10px] text-text-quaternary truncate",children:n.label},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:394,columnNumber:15},this)]},n.value,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:387,columnNumber:13},this))},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:385,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:375,columnNumber:5},this)}function Ke({value:s,onChange:t,topics:l}){const[o,p]=N.useState(!1),[u,i]=N.useState(""),x=N.useRef(null),d=N.useRef(null);N.useEffect(()=>{function n(m){d.current&&!d.current.contains(m.target)&&p(!1)}return o&&document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[o]);const c=o?u:s,h=l.filter(n=>n.topic.toLowerCase().includes((o?u:"").toLowerCase())||(n.description??"").toLowerCase().includes((o?u:"").toLowerCase()));return e.jsxDEV("div",{ref:d,className:"relative",children:[e.jsxDEV("input",{ref:x,type:"text",value:c,onFocus:()=>{p(!0),i(s)},onChange:n=>{const m=n.target.value;i(m),t(m),o||p(!0)},placeholder:"workflow.failed or app.>",className:`${k} font-mono`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:434,columnNumber:7},this),o&&h.length>0&&e.jsxDEV("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:h.map(n=>{const m=$e[n.category]??"bg-zinc-400/15 text-zinc-400";return e.jsxDEV("button",{type:"button",onClick:()=>{t(n.topic),i(n.topic),p(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===n.topic?"bg-accent/5":""}`,children:[e.jsxDEV("span",{className:"text-[11px] font-mono text-text-primary shrink-0",children:n.topic},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:466,columnNumber:17},this),e.jsxDEV("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-medium shrink-0 ${m}`,children:n.category},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:467,columnNumber:17},this),n.description&&e.jsxDEV("span",{className:"text-[10px] text-text-quaternary truncate",children:n.description},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:469,columnNumber:19},this)]},n.topic,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:454,columnNumber:15},this)})},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:450,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/SubscriptionsStep.tsx",lineNumber:433,columnNumber:5},this)}const Fe=["*/5 * * * *","*/15 * * * *","0 * * * *","0 */4 * * *","0 7 * * *","0 9 * * 1-5"];function F(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 Je({form:s,set:t}){const[l,o]=N.useState(0),p=(c,h,n)=>{const m=[...s.schedules];m[c]={...m[c],[h]:n},t("schedules",m)},u=()=>{t("schedules",[...s.schedules,{..._e}]),o(s.schedules.length)},i=c=>{t("schedules",s.schedules.filter((h,n)=>n!==c)),l>=s.schedules.length-1&&o(Math.max(0,s.schedules.length-2))},x=s.schedules,d=x[l];return x.length===0?e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"border-l-2 border-accent/30 pl-3 py-1 mb-8 flex items-start justify-between",children:[e.jsxDEV("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. Each schedule runs a workflow on a cron timer."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:62,columnNumber:11},this),e.jsxDEV("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.jsxDEV(R,{className:"w-3 h-3",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:65,columnNumber:196},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:65,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:61,columnNumber:9},this),e.jsxDEV("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsxDEV(B,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:68,columnNumber:11},this),e.jsxDEV("p",{className:"text-sm text-text-tertiary mb-2",children:"No schedules"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:69,columnNumber:11},this),e.jsxDEV("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."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:70,columnNumber:11},this),e.jsxDEV("button",{onClick:u,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsxDEV($,{className:"w-3.5 h-3.5"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:74,columnNumber:13},this)," Add schedule"]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:73,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:67,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:60,columnNumber:7},this):e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"border-l-2 border-accent/30 pl-3 py-1 mb-6 flex items-start justify-between",children:[e.jsxDEV("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."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:84,columnNumber:9},this),e.jsxDEV("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.jsxDEV(R,{className:"w-3 h-3",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:87,columnNumber:194},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:87,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:83,columnNumber:7},this),e.jsxDEV("div",{className:"flex gap-8",children:[e.jsxDEV("div",{className:"w-48 shrink-0 space-y-0.5",children:[x.map((c,h)=>e.jsxDEV("div",{className:`group/sched flex items-center rounded-md transition-colors ${l===h?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxDEV("button",{onClick:()=>o(h),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxDEV("span",{className:"text-[11px] font-mono block",children:c.cron||"new schedule"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:98,columnNumber:17},this),e.jsxDEV("span",{className:"text-[9px] text-text-quaternary",children:[(c.reaction_type==="pipeline"?c.pipeline_id:c.workflow_type)||"no target"," · ",F(c.cron)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:99,columnNumber:17},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:97,columnNumber:15},this),e.jsxDEV("button",{onClick:n=>{n.stopPropagation(),confirm(`Remove schedule "${c.cron||"new"}"?
12
-
13
- This takes effect when you save.`)&&i(h)},className:"opacity-0 group-hover/sched:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsxDEV(X,{className:"w-3 h-3"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:102,columnNumber:17},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:101,columnNumber:15},this)]},h,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:94,columnNumber:13},this)),e.jsxDEV("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.jsxDEV($,{className:"w-3 h-3"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:107,columnNumber:13},this)," Add"]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:106,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:92,columnNumber:9},this),d&&e.jsxDEV("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:V,children:"Run every"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:117,columnNumber:15},this),e.jsxDEV("input",{type:"text",value:d.cron,onChange:c=>p(l,"cron",c.target.value),placeholder:"0 * * * *",className:`${k} font-mono`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:118,columnNumber:15},this),d.cron&&e.jsxDEV("p",{className:"text-[11px] text-accent/80 mt-1",children:F(d.cron)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:119,columnNumber:30},this),e.jsxDEV("div",{className:"flex gap-3 mt-2 overflow-x-auto",children:Fe.map(c=>e.jsxDEV("button",{type:"button",onClick:()=>p(l,"cron",c),className:`text-[10px] font-mono whitespace-nowrap transition-colors ${d.cron===c?"text-accent font-medium":"text-accent/50 hover:text-accent"}`,children:F(c)},c,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:122,columnNumber:19},this))},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:120,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:116,columnNumber:13},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:V,children:"Run this reaction"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:131,columnNumber:15},this),e.jsxDEV(te,{reactionType:d.reaction_type,onReactionTypeChange:c=>p(l,"reaction_type",c),workflowType:d.workflow_type,onWorkflowTypeChange:c=>p(l,"workflow_type",c),pipelineId:d.pipeline_id,onPipelineIdChange:c=>p(l,"pipeline_id",c),serverId:d.server_id,toolName:d.tool_name,onCapabilityChange:(c,h)=>{p(l,"server_id",c),p(l,"tool_name",h)},availableTypes:["durable","pipeline","capability"]},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:132,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:130,columnNumber:13},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:V,children:"As identity"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:149,columnNumber:15},this),e.jsxDEV(ae,{selected:d.execute_as,onChange:c=>p(l,"execute_as",c)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:150,columnNumber:15},this),e.jsxDEV("p",{className:E,children:"Identity used when invoking."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:151,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:148,columnNumber:13},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:V,children:"With this data"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:156,columnNumber:15},this),e.jsxDEV("textarea",{value:d.envelope,onChange:c=>p(l,"envelope",c.target.value),rows:10,className:O,placeholder:`{
14
- "data": { "source": "cron" }
15
- }`},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:157,columnNumber:15},this),e.jsxDEV("p",{className:E,children:"Static payload passed to the workflow on each invocation."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:158,columnNumber:15},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:155,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:113,columnNumber:11},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:90,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ScheduleStep.tsx",lineNumber:82,columnNumber:5},this)}function q({icon:s,color:t,title:l,children:o}){return e.jsxDEV("div",{className:"mb-10",children:[e.jsxDEV("div",{className:"flex items-center gap-2 mb-2 pb-1.5 border-b border-surface-border/40",children:[e.jsxDEV(s,{className:`w-3.5 h-3.5 ${t}`,strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:15,columnNumber:9},this),e.jsxDEV("h3",{className:"text-xs font-semibold uppercase tracking-widest text-accent/80",children:l},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:16,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:14,columnNumber:7},this),e.jsxDEV("div",{className:"pl-5.5",children:o},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:18,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:13,columnNumber:5},this)}function W({label:s,children:t}){return e.jsxDEV("div",{className:"flex gap-3 py-0.5",children:[e.jsxDEV("span",{className:"text-[10px] text-text-quaternary w-20 shrink-0",children:s},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:26,columnNumber:7},this),e.jsxDEV("span",{className:"text-xs text-text-primary",children:t},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:27,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:25,columnNumber:5},this)}function ze({form:s}){return e.jsxDEV("div",{children:[e.jsxDEV(q,{icon:Z,color:"text-accent",title:"Identity",children:[e.jsxDEV(W,{label:"Name",children:s.name||"—"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:36,columnNumber:9},this),s.description&&e.jsxDEV(W,{label:"Description",children:s.description},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:37,columnNumber:30},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:35,columnNumber:7},this),(s.goals||s.rules)&&e.jsxDEV(q,{icon:ee,color:"text-rose-400",title:"Motivation",children:[s.goals&&e.jsxDEV(W,{label:"Goals",children:s.goals},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:42,columnNumber:26},this),s.rules&&e.jsxDEV(W,{label:"Rules",children:s.rules},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:43,columnNumber:26},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:41,columnNumber:9},this),e.jsxDEV(q,{icon:z,color:"text-emerald-400",title:"Knowledge",children:e.jsxDEV(W,{label:"Domain",children:s.knowledge_domain||"None"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:48,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:47,columnNumber:7},this),e.jsxDEV("div",{className:"grid grid-cols-2 gap-x-10",children:[e.jsxDEV(q,{icon:Y,color:"text-cyan-400",title:`Subscriptions (${s.subscriptions.length})`,children:s.subscriptions.length===0?e.jsxDEV("span",{className:"text-[11px] text-text-quaternary",children:"None configured"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:55,columnNumber:13},this):e.jsxDEV("div",{className:"divide-y divide-surface-border/30",children:s.subscriptions.map((t,l)=>e.jsxDEV("div",{className:"flex items-center py-1.5",children:[e.jsxDEV("div",{className:"flex-1 min-w-0",children:e.jsxDEV(ye,{topic:t.topic||"unset"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:60,columnNumber:51},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:60,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsxDEV("span",{className:"text-text-quaternary text-[10px]",children:"→"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:61,columnNumber:71},this),t.workflow_type?e.jsxDEV(H,{type:t.workflow_type},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:61,columnNumber:151},this):e.jsxDEV("span",{className:"text-[11px] text-text-quaternary",children:t.reaction_type},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:61,columnNumber:195},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:61,columnNumber:19},this)]},l,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:59,columnNumber:17},this))},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:57,columnNumber:13},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:53,columnNumber:9},this),e.jsxDEV(q,{icon:B,color:"text-amber-400",title:`Schedules (${s.schedules.length})`,children:s.schedules.length===0?e.jsxDEV("span",{className:"text-[11px] text-text-quaternary",children:"None configured"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:70,columnNumber:13},this):e.jsxDEV("div",{className:"divide-y divide-surface-border/30",children:s.schedules.map((t,l)=>e.jsxDEV("div",{className:"flex items-center py-1.5",children:[e.jsxDEV("div",{className:"flex-1 min-w-0",children:e.jsxDEV(pe,{cron:t.cron},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:75,columnNumber:51},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:75,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsxDEV("span",{className:"text-text-quaternary text-[10px]",children:"→"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:76,columnNumber:71},this),t.workflow_type?e.jsxDEV(H,{type:t.workflow_type},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:76,columnNumber:149},this):e.jsxDEV("span",{className:"text-[11px] text-text-quaternary",children:"no workflow"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:76,columnNumber:191},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:76,columnNumber:19},this)]},l,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:74,columnNumber:17},this))},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:72,columnNumber:13},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:68,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:52,columnNumber:7},this),e.jsxDEV("div",{className:"border-l-2 border-emerald-400/30 pl-3 py-2 mt-6",children:e.jsxDEV("p",{className:"text-[11px] text-text-tertiary leading-relaxed",children:"After saving, subscriptions and schedules activate immediately. You can pause the automation anytime."},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:85,columnNumber:9},this)},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:84,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/ReviewStep.tsx",lineNumber:34,columnNumber:5},this)}const Ye=[{id:1,label:"Identity",icon:Z},{id:2,label:"Motivation",icon:ee},{id:3,label:"Knowledge",icon:z},{id:4,label:"Subscriptions",icon:Y},{id:5,label:"Schedules",icon:B},{id:6,label:"Review",icon:ge}];function da(){var G;const{id:s}=Ee(),t=!s,l=je(),{data:o}=le(),u=!!((G=o==null?void 0:o.ai)!=null&&G.enabled)?"Agent":"Automation",{data:i,isLoading:x}=oe(t?null:s),{data:d}=me(t?null:s),c=ce(),h=de(),n=ue(),m=be(),w=he(),[b,a]=N.useState(Q),[r,g]=N.useState(!1),[f,j]=N.useState(""),[P,C]=De(),S=parseInt(P.get("step")||"1",10),I=N.useCallback(v=>{C(y=>{const _=new URLSearchParams(y);return _.set("step",String(v)),_},{replace:!0})},[C]);N.useEffect(()=>{if(!r){if(t){a(Q),g(!0);return}i&&d&&(a(ke(i,d.subscriptions??[])),g(!0))}},[i,d,t,r]);const M=(v,y)=>a(_=>({..._,[v]:y})),ie=async()=>{j("");try{const v=Ce(b);let y=s;t?y=(await c.mutateAsync(v)).id:await h.mutateAsync({id:s,...v});const _=Re(b),re=(d==null?void 0:d.subscriptions)??[],T=new Set(re.map(D=>D.id));for(const D of _)if(D.id&&T.has(D.id)){const{id:L,...K}=D;await m.mutateAsync({agentId:y,subId:L,...K}),T.delete(L)}else{const{id:L,...K}=D;await n.mutateAsync({agentId:y,...K})}for(const D of T)await w.mutateAsync({agentId:y,subId:D});l(`/agents/${y}`)}catch(v){j(v.message)}};if(!t&&x)return e.jsxDEV("div",{className:"animate-pulse space-y-4",children:[e.jsxDEV("div",{className:"h-8 bg-surface-sunken rounded w-48"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:114,columnNumber:53},this),e.jsxDEV("div",{className:"h-60 bg-surface-sunken rounded"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:114,columnNumber:107},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:114,columnNumber:12},this);const U=c.isPending||h.isPending;return e.jsxDEV("div",{children:[e.jsxDEV(Ne,{title:t?`New ${u}`:`${u}: ${(i==null?void 0:i.id)??""}`,docsHash:"#docs:agents.md"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:121,columnNumber:7},this),e.jsxDEV("div",{className:"flex gap-10",children:[e.jsxDEV("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsxDEV("div",{className:"space-y-0.5",children:Ye.map(v=>{const y=v.icon,_=S===v.id;return e.jsxDEV("button",{onClick:()=>I(v.id),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${_?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxDEV(y,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:143,columnNumber:19},this),e.jsxDEV("span",{className:"text-xs font-medium",children:v.label},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:144,columnNumber:19},this)]},v.id,!0,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:134,columnNumber:17},this)})},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:129,columnNumber:11},this),e.jsxDEV("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsxDEV("button",{onClick:ie,disabled:!b.name.trim()||U,className:"w-full btn-primary text-xs disabled:opacity-50",children:U?"Saving...":t?`Create ${u}`:"Save"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:152,columnNumber:13},this),e.jsxDEV("button",{onClick:()=>l(t?"/agents":`/agents/${s}`),className:"w-full btn-ghost text-xs",children:"Cancel"},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:159,columnNumber:13},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:151,columnNumber:11},this),f&&e.jsxDEV("p",{className:"text-xs text-status-error mt-3",children:f},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:167,columnNumber:25},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:128,columnNumber:9},this),e.jsxDEV("div",{className:"flex-1 min-w-0 pt-2",children:[S===1&&e.jsxDEV(Pe,{form:b,set:M},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:172,columnNumber:29},this),S===2&&e.jsxDEV(Ae,{form:b,set:M},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:173,columnNumber:29},this),S===3&&e.jsxDEV(Ie,{form:b,set:M},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:174,columnNumber:29},this),S===4&&e.jsxDEV(Oe,{form:b,set:M},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:175,columnNumber:29},this),S===5&&e.jsxDEV(Je,{form:b,set:M},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:176,columnNumber:29},this),S===6&&e.jsxDEV(ze,{form:b},void 0,!1,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:177,columnNumber:29},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:171,columnNumber:9},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:126,columnNumber:7},this)]},void 0,!0,{fileName:"/app/dashboard/src/pages/agents/detail/AgentConfigPage.tsx",lineNumber:120,columnNumber:5},this)}export{da as AgentConfigPage};
16
- //# sourceMappingURL=AgentConfigPage-D27vWOI6.js.map