@hotmeshio/long-tail 0.4.4 → 0.4.5

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 (295) hide show
  1. package/build/api/agent-subscriptions.js +14 -0
  2. package/build/lib/events/index.js +3 -0
  3. package/build/lib/events/nats.js +2 -0
  4. package/build/services/agent/index.js +14 -0
  5. package/build/services/agent/trigger-registry.d.ts +2 -0
  6. package/build/services/agent/trigger-registry.js +37 -8
  7. package/build/start/workers.js +3 -0
  8. package/build/types/events.d.ts +1 -1
  9. package/dashboard/dist/assets/AdminDashboard-ntLz5Pro.js +2 -0
  10. package/dashboard/dist/assets/{AdminDashboard-DISq0Tz8.js.map → AdminDashboard-ntLz5Pro.js.map} +1 -1
  11. package/dashboard/dist/assets/AgentConfigPage-D27vWOI6.js +16 -0
  12. package/dashboard/dist/assets/{AgentConfigPage-DqaJpB3K.js.map → AgentConfigPage-D27vWOI6.js.map} +1 -1
  13. package/dashboard/dist/assets/AgentDetailPage-Cm2KFR4O.js +4 -0
  14. package/dashboard/dist/assets/{AgentDetailPage-BPzPk2GC.js.map → AgentDetailPage-Cm2KFR4O.js.map} +1 -1
  15. package/dashboard/dist/assets/AgentsPage-_ptA-0YO.js +2 -0
  16. package/dashboard/dist/assets/{AgentsPage-CLcxJWjC.js.map → AgentsPage-_ptA-0YO.js.map} +1 -1
  17. package/dashboard/dist/assets/AvailableEscalationsPage-bdPqEzbx.js +2 -0
  18. package/dashboard/dist/assets/{AvailableEscalationsPage-hOcjAAIj.js.map → AvailableEscalationsPage-bdPqEzbx.js.map} +1 -1
  19. package/dashboard/dist/assets/BotPicker-CYfFMpkY.js +2 -0
  20. package/dashboard/dist/assets/{BotPicker-DuAZgHbJ.js.map → BotPicker-CYfFMpkY.js.map} +1 -1
  21. package/dashboard/dist/assets/CapabilitiesPage-M7-ZTFNV.js +2 -0
  22. package/dashboard/dist/assets/{CapabilitiesPage-PRel6TXd.js.map → CapabilitiesPage-M7-ZTFNV.js.map} +1 -1
  23. package/dashboard/dist/assets/CollapsibleSection-DU5KAtQ-.js +2 -0
  24. package/dashboard/dist/assets/{CollapsibleSection-DnoUFQVf.js.map → CollapsibleSection-DU5KAtQ-.js.map} +1 -1
  25. package/dashboard/dist/assets/ConfirmDeleteModal-_hW5Vc05.js +2 -0
  26. package/dashboard/dist/assets/{ConfirmDeleteModal-dOxidrSR.js.map → ConfirmDeleteModal-_hW5Vc05.js.map} +1 -1
  27. package/dashboard/dist/assets/CopyableId-DiWqv41D.js +2 -0
  28. package/dashboard/dist/assets/{CopyableId-D0SQ39nR.js.map → CopyableId-DiWqv41D.js.map} +1 -1
  29. package/dashboard/dist/assets/CredentialsPage-CmbwypSF.js +2 -0
  30. package/dashboard/dist/assets/{CredentialsPage-CqedUU7b.js.map → CredentialsPage-CmbwypSF.js.map} +1 -1
  31. package/dashboard/dist/assets/CronLabel-nycfAefc.js +2 -0
  32. package/dashboard/dist/assets/{CronLabel-CPEjE-mH.js.map → CronLabel-nycfAefc.js.map} +1 -1
  33. package/dashboard/dist/assets/CustomDurationPicker-gNZRBaHg.js +2 -0
  34. package/dashboard/dist/assets/{CustomDurationPicker-BIQWzbv0.js.map → CustomDurationPicker-gNZRBaHg.js.map} +1 -1
  35. package/dashboard/dist/assets/DataTable-DGerT2ZM.js +2 -0
  36. package/dashboard/dist/assets/{DataTable-D9yuBv0w.js.map → DataTable-DGerT2ZM.js.map} +1 -1
  37. package/dashboard/dist/assets/DropZone-vNcqMd05.js +2 -0
  38. package/dashboard/dist/assets/{DropZone-e5EOL5gC.js.map → DropZone-vNcqMd05.js.map} +1 -1
  39. package/dashboard/dist/assets/ElapsedCell-CdvQbtve.js +2 -0
  40. package/dashboard/dist/assets/{ElapsedCell-CzVjr74Y.js.map → ElapsedCell-CdvQbtve.js.map} +1 -1
  41. package/dashboard/dist/assets/EmptyState-DMldv8c5.js +2 -0
  42. package/dashboard/dist/assets/{EmptyState-BcsfPq9T.js.map → EmptyState-DMldv8c5.js.map} +1 -1
  43. package/dashboard/dist/assets/EscalationsOverview-BNENCL_2.js +2 -0
  44. package/dashboard/dist/assets/{EscalationsOverview-Bcrb44xJ.js.map → EscalationsOverview-BNENCL_2.js.map} +1 -1
  45. package/dashboard/dist/assets/EventTable-BqDAyXyc.js +2 -0
  46. package/dashboard/dist/assets/{EventTable-CGfJU7e1.js.map → EventTable-BqDAyXyc.js.map} +1 -1
  47. package/dashboard/dist/assets/EventTopicPill-CnHFBglc.js +2 -0
  48. package/dashboard/dist/assets/{EventTopicPill-xJJnxvlP.js.map → EventTopicPill-CnHFBglc.js.map} +1 -1
  49. package/dashboard/dist/assets/FilterBar-TYiTtUgv.js +2 -0
  50. package/dashboard/dist/assets/{FilterBar-Ck4K4rzu.js.map → FilterBar-TYiTtUgv.js.map} +1 -1
  51. package/dashboard/dist/assets/HomePage-fterfLKH.js +2 -0
  52. package/dashboard/dist/assets/{HomePage-BIzUcGW9.js.map → HomePage-fterfLKH.js.map} +1 -1
  53. package/dashboard/dist/assets/ListToolbar-BO5Igi6v.js +2 -0
  54. package/dashboard/dist/assets/{ListToolbar-DNAGFe14.js.map → ListToolbar-BO5Igi6v.js.map} +1 -1
  55. package/dashboard/dist/assets/McpOverview-BQokGg0z.js +2 -0
  56. package/dashboard/dist/assets/{McpOverview-BpYk21es.js.map → McpOverview-BQokGg0z.js.map} +1 -1
  57. package/dashboard/dist/assets/McpQueryDetailPage-0WOp2n_j.js +5 -0
  58. package/dashboard/dist/assets/{McpQueryDetailPage-DlrZiSuL.js.map → McpQueryDetailPage-0WOp2n_j.js.map} +1 -1
  59. package/dashboard/dist/assets/McpQueryPage-DUey_h9J.js +2 -0
  60. package/dashboard/dist/assets/{McpQueryPage-COfPssO7.js.map → McpQueryPage-DUey_h9J.js.map} +1 -1
  61. package/dashboard/dist/assets/McpRunDetailPage-Cv4qyr91.js +2 -0
  62. package/dashboard/dist/assets/{McpRunDetailPage-Cra0nQSw.js.map → McpRunDetailPage-Cv4qyr91.js.map} +1 -1
  63. package/dashboard/dist/assets/McpRunsPage-B3R6KZ61.js +2 -0
  64. package/dashboard/dist/assets/{McpRunsPage-BlgcGN3k.js.map → McpRunsPage-B3R6KZ61.js.map} +1 -1
  65. package/dashboard/dist/assets/Modal-Qe8lW7gQ.js +2 -0
  66. package/dashboard/dist/assets/{Modal-DEODGeqx.js.map → Modal-Qe8lW7gQ.js.map} +1 -1
  67. package/dashboard/dist/assets/OperatorDashboard-dldvzjcg.js +2 -0
  68. package/dashboard/dist/assets/{OperatorDashboard-BbO6cWzb.js.map → OperatorDashboard-dldvzjcg.js.map} +1 -1
  69. package/dashboard/dist/assets/PageHeader-DF4BeEm4.js +2 -0
  70. package/dashboard/dist/assets/{PageHeader-B_gV_jKk.js.map → PageHeader-DF4BeEm4.js.map} +1 -1
  71. package/dashboard/dist/assets/PageHeaderWithStats-BQZw6BgA.js +2 -0
  72. package/dashboard/dist/assets/{PageHeaderWithStats-D0I0nrnx.js.map → PageHeaderWithStats-BQZw6BgA.js.map} +1 -1
  73. package/dashboard/dist/assets/PriorityBadge-DMyB3WLZ.js +2 -0
  74. package/dashboard/dist/assets/{PriorityBadge-DfQY9St9.js.map → PriorityBadge-DMyB3WLZ.js.map} +1 -1
  75. package/dashboard/dist/assets/ProcessDetailPage-Beo-QVL-.js +2 -0
  76. package/dashboard/dist/assets/{ProcessDetailPage-s_iV8ICg.js.map → ProcessDetailPage-Beo-QVL-.js.map} +1 -1
  77. package/dashboard/dist/assets/ProcessesListPage-C_ars8gp.js +2 -0
  78. package/dashboard/dist/assets/{ProcessesListPage-MnLMnxAa.js.map → ProcessesListPage-C_ars8gp.js.map} +1 -1
  79. package/dashboard/dist/assets/RolePill-DrBZ7JJj.js +2 -0
  80. package/dashboard/dist/assets/{RolePill-BOBytzrP.js.map → RolePill-DrBZ7JJj.js.map} +1 -1
  81. package/dashboard/dist/assets/RolesPage-DgSXFFGL.js +2 -0
  82. package/dashboard/dist/assets/{RolesPage-BH7KASM7.js.map → RolesPage-DgSXFFGL.js.map} +1 -1
  83. package/dashboard/dist/assets/RowActions-QcakGbVA.js +2 -0
  84. package/dashboard/dist/assets/{RowActions-Dg-Fsm5O.js.map → RowActions-QcakGbVA.js.map} +1 -1
  85. package/dashboard/dist/assets/RunAsSelector-CYMeZwrM.js +2 -0
  86. package/dashboard/dist/assets/{RunAsSelector-_QbJKhlo.js.map → RunAsSelector-CYMeZwrM.js.map} +1 -1
  87. package/dashboard/dist/assets/ServerName-D5NKD06M.js +2 -0
  88. package/dashboard/dist/assets/{ServerName-uqa4eBqm.js.map → ServerName-D5NKD06M.js.map} +1 -1
  89. package/dashboard/dist/assets/StatCard-PZQmmCHK.js +2 -0
  90. package/dashboard/dist/assets/{StatCard-DlgF0CJC.js.map → StatCard-PZQmmCHK.js.map} +1 -1
  91. package/dashboard/dist/assets/StatusBadge-ME2R6a7K.js +2 -0
  92. package/dashboard/dist/assets/{StatusBadge-XQlNFwmH.js.map → StatusBadge-ME2R6a7K.js.map} +1 -1
  93. package/dashboard/dist/assets/StepIndicator-CDDVahOz.js +2 -0
  94. package/dashboard/dist/assets/{StepIndicator-CuUIGxKk.js.map → StepIndicator-CDDVahOz.js.map} +1 -1
  95. package/dashboard/dist/assets/StickyPagination-Ddy93Q5I.js +2 -0
  96. package/dashboard/dist/assets/{StickyPagination-F9FZsRy9.js.map → StickyPagination-Ddy93Q5I.js.map} +1 -1
  97. package/dashboard/dist/assets/SwimlaneTimeline-CYYA8nd9.js +2 -0
  98. package/dashboard/dist/assets/{SwimlaneTimeline-og79Llvs.js.map → SwimlaneTimeline-CYYA8nd9.js.map} +1 -1
  99. package/dashboard/dist/assets/TagInput-B45Dm3IW.js +2 -0
  100. package/dashboard/dist/assets/{TagInput-D3f11sbM.js.map → TagInput-B45Dm3IW.js.map} +1 -1
  101. package/dashboard/dist/assets/TaskDetailPage-CoZFkJ6d.js +2 -0
  102. package/dashboard/dist/assets/TaskDetailPage-CoZFkJ6d.js.map +1 -0
  103. package/dashboard/dist/assets/TaskQueuePill-BJRUjVDv.js +2 -0
  104. package/dashboard/dist/assets/{TaskQueuePill-Bc45J7X1.js.map → TaskQueuePill-BJRUjVDv.js.map} +1 -1
  105. package/dashboard/dist/assets/TasksListPage-Czu08px3.js +2 -0
  106. package/dashboard/dist/assets/{TasksListPage-BYj3OqUi.js.map → TasksListPage-Czu08px3.js.map} +1 -1
  107. package/dashboard/dist/assets/TimeAgo-CJ56IUy6.js +2 -0
  108. package/dashboard/dist/assets/{TimeAgo-W7TdJpV-.js.map → TimeAgo-CJ56IUy6.js.map} +1 -1
  109. package/dashboard/dist/assets/TimestampCell-QtcYZ9Jx.js +2 -0
  110. package/dashboard/dist/assets/{TimestampCell-Bi2nc9Q_.js.map → TimestampCell-QtcYZ9Jx.js.map} +1 -1
  111. package/dashboard/dist/assets/ToolPill-DpDv3FwI.js +2 -0
  112. package/dashboard/dist/assets/{ToolPill-CuoXcmhv.js.map → ToolPill-DpDv3FwI.js.map} +1 -1
  113. package/dashboard/dist/assets/ToolTestPanel-BzFOwzd_.js +2 -0
  114. package/dashboard/dist/assets/{ToolTestPanel-Dl3C53zb.js.map → ToolTestPanel-BzFOwzd_.js.map} +1 -1
  115. package/dashboard/dist/assets/TopicDetailPage-DwShZbh9.js +9 -0
  116. package/dashboard/dist/assets/{TopicDetailPage-CjaZn4WP.js.map → TopicDetailPage-DwShZbh9.js.map} +1 -1
  117. package/dashboard/dist/assets/TopicsPage-DKXlpZl_.js +2 -0
  118. package/dashboard/dist/assets/{TopicsPage-BfsJEC1p.js.map → TopicsPage-DKXlpZl_.js.map} +1 -1
  119. package/dashboard/dist/assets/UserName-zlR1so37.js +2 -0
  120. package/dashboard/dist/assets/{UserName-b4baWHM_.js.map → UserName-zlR1so37.js.map} +1 -1
  121. package/dashboard/dist/assets/WorkflowExecutionPage-BMNIxeJB.js +2 -0
  122. package/dashboard/dist/assets/{WorkflowExecutionPage-BGmJnXnk.js.map → WorkflowExecutionPage-BMNIxeJB.js.map} +1 -1
  123. package/dashboard/dist/assets/WorkflowPill-B5B3yGlh.js +2 -0
  124. package/dashboard/dist/assets/{WorkflowPill-Bg2-0Hkg.js.map → WorkflowPill-B5B3yGlh.js.map} +1 -1
  125. package/dashboard/dist/assets/WorkflowsDashboard-BlAPZbQZ.js +2 -0
  126. package/dashboard/dist/assets/{WorkflowsDashboard-BzH7jMRu.js.map → WorkflowsDashboard-BlAPZbQZ.js.map} +1 -1
  127. package/dashboard/dist/assets/WorkflowsOverview-NnPi6rwS.js +2 -0
  128. package/dashboard/dist/assets/{WorkflowsOverview-BcUgBvjD.js.map → WorkflowsOverview-NnPi6rwS.js.map} +1 -1
  129. package/dashboard/dist/assets/YamlWorkflowsPage-C4mZum6x.js +2 -0
  130. package/dashboard/dist/assets/{YamlWorkflowsPage-OhpCQJ0l.js.map → YamlWorkflowsPage-C4mZum6x.js.map} +1 -1
  131. package/dashboard/dist/assets/{agents-Ce3HmPz4.js → agents-B5wvILeV.js} +2 -2
  132. package/dashboard/dist/assets/{agents-Ce3HmPz4.js.map → agents-B5wvILeV.js.map} +1 -1
  133. package/dashboard/dist/assets/{bots-B0BomNnf.js → bots-BPlouRDm.js} +2 -2
  134. package/dashboard/dist/assets/{bots-B0BomNnf.js.map → bots-BPlouRDm.js.map} +1 -1
  135. package/dashboard/dist/assets/capabilities-DkvRG09b.js +2 -0
  136. package/dashboard/dist/assets/{capabilities-t-w5N9K9.js.map → capabilities-DkvRG09b.js.map} +1 -1
  137. package/dashboard/dist/assets/{controlplane-BrtAZnJM.js → controlplane-0m_rA-UW.js} +2 -2
  138. package/dashboard/dist/assets/{controlplane-BrtAZnJM.js.map → controlplane-0m_rA-UW.js.map} +1 -1
  139. package/dashboard/dist/assets/escalation-CfIAIUg2.js +2 -0
  140. package/dashboard/dist/assets/{escalation-DilnDxw2.js.map → escalation-CfIAIUg2.js.map} +1 -1
  141. package/dashboard/dist/assets/escalation-columns-CLIdxlbe.js +2 -0
  142. package/dashboard/dist/assets/{escalation-columns-C0slywOY.js.map → escalation-columns-CLIdxlbe.js.map} +1 -1
  143. package/dashboard/dist/assets/helpers-prGqC38M.js +2 -0
  144. package/dashboard/dist/assets/{helpers-BMvPqQr8.js.map → helpers-prGqC38M.js.map} +1 -1
  145. package/dashboard/dist/assets/index-4T7Z_gQ4.js +281 -0
  146. package/dashboard/dist/assets/index-4T7Z_gQ4.js.map +1 -0
  147. package/dashboard/dist/assets/index-BR3SwTNI.js +2 -0
  148. package/dashboard/dist/assets/{index-pIMl0mYp.js.map → index-BR3SwTNI.js.map} +1 -1
  149. package/dashboard/dist/assets/index-BWKIigEk.js +2 -0
  150. package/dashboard/dist/assets/{index-qNuxC8kX.js.map → index-BWKIigEk.js.map} +1 -1
  151. package/dashboard/dist/assets/index-BgVuyWhi.js +15 -0
  152. package/dashboard/dist/assets/{index-D_wqdvG_.js.map → index-BgVuyWhi.js.map} +1 -1
  153. package/dashboard/dist/assets/index-C0sDEKdo.js +2 -0
  154. package/dashboard/dist/assets/{index-30-pN97P.js.map → index-C0sDEKdo.js.map} +1 -1
  155. package/dashboard/dist/assets/index-C2MJzu6J.js +2 -0
  156. package/dashboard/dist/assets/{index-f-0Duls3.js.map → index-C2MJzu6J.js.map} +1 -1
  157. package/dashboard/dist/assets/index-CFoddJDr.js +6 -0
  158. package/dashboard/dist/assets/{index-Ck2QdJXT.js.map → index-CFoddJDr.js.map} +1 -1
  159. package/dashboard/dist/assets/index-CrMxD5Ib.js +6 -0
  160. package/dashboard/dist/assets/{index-DPW_i3fH.js.map → index-CrMxD5Ib.js.map} +1 -1
  161. package/dashboard/dist/assets/index-CuY5hPYB.js +2 -0
  162. package/dashboard/dist/assets/{index-DnsVYMMg.js.map → index-CuY5hPYB.js.map} +1 -1
  163. package/dashboard/dist/assets/index-CwkJBn87.js +2 -0
  164. package/dashboard/dist/assets/{index-Bl9wzQ8Q.js.map → index-CwkJBn87.js.map} +1 -1
  165. package/dashboard/dist/assets/index-DeL84Cag.js +2 -0
  166. package/dashboard/dist/assets/{index-DNmlrCAp.js.map → index-DeL84Cag.js.map} +1 -1
  167. package/dashboard/dist/assets/index-DqeLbz6j.js +2 -0
  168. package/dashboard/dist/assets/{index-BxOuF0hm.js.map → index-DqeLbz6j.js.map} +1 -1
  169. package/dashboard/dist/assets/index-P9huxx3-.js +2 -0
  170. package/dashboard/dist/assets/{index-H5TlloTk.js.map → index-P9huxx3-.js.map} +1 -1
  171. package/dashboard/dist/assets/{knowledge-D01NdF5h.js → knowledge-CUZxyRCO.js} +2 -2
  172. package/dashboard/dist/assets/{knowledge-D01NdF5h.js.map → knowledge-CUZxyRCO.js.map} +1 -1
  173. package/dashboard/dist/assets/{mcp-CjXjDZI0.js → mcp-B5VQPoF3.js} +2 -2
  174. package/dashboard/dist/assets/{mcp-CjXjDZI0.js.map → mcp-B5VQPoF3.js.map} +1 -1
  175. package/dashboard/dist/assets/{mcp-query-LlKQcWLJ.js → mcp-query-Ba5Zj3yg.js} +2 -2
  176. package/dashboard/dist/assets/{mcp-query-LlKQcWLJ.js.map → mcp-query-Ba5Zj3yg.js.map} +1 -1
  177. package/dashboard/dist/assets/{mcp-runs-C0C54hU6.js → mcp-runs-CAiEr5Fc.js} +2 -2
  178. package/dashboard/dist/assets/{mcp-runs-C0C54hU6.js.map → mcp-runs-CAiEr5Fc.js.map} +1 -1
  179. package/dashboard/dist/assets/namespaces-sVr5scma.js +2 -0
  180. package/dashboard/dist/assets/{namespaces-6qWDXXJV.js.map → namespaces-sVr5scma.js.map} +1 -1
  181. package/dashboard/dist/assets/{roles-Dtj0uabn.js → roles-E_bA4e0f.js} +2 -2
  182. package/dashboard/dist/assets/{roles-Dtj0uabn.js.map → roles-E_bA4e0f.js.map} +1 -1
  183. package/dashboard/dist/assets/{tasks-BevFBjZq.js → tasks-CL6Gv8jB.js} +2 -2
  184. package/dashboard/dist/assets/{tasks-BevFBjZq.js.map → tasks-CL6Gv8jB.js.map} +1 -1
  185. package/dashboard/dist/assets/{topics-BMG5tx2g.js → topics-DbtPHERP.js} +2 -2
  186. package/dashboard/dist/assets/{topics-BMG5tx2g.js.map → topics-DbtPHERP.js.map} +1 -1
  187. package/dashboard/dist/assets/{useCollapsedSections-BU5HULGs.js → useCollapsedSections-CGNA5oKV.js} +2 -2
  188. package/dashboard/dist/assets/{useCollapsedSections-BU5HULGs.js.map → useCollapsedSections-CGNA5oKV.js.map} +1 -1
  189. package/dashboard/dist/assets/{useEventHooks-CPyvFlVR.js → useEventHooks-C6c618cj.js} +2 -2
  190. package/dashboard/dist/assets/{useEventHooks-CPyvFlVR.js.map → useEventHooks-C6c618cj.js.map} +1 -1
  191. package/dashboard/dist/assets/{useExpandedRows-CkcEntB-.js → useExpandedRows-Cg9iq6Vy.js} +2 -2
  192. package/dashboard/dist/assets/{useExpandedRows-CkcEntB-.js.map → useExpandedRows-Cg9iq6Vy.js.map} +1 -1
  193. package/dashboard/dist/assets/{useFilterParams-DZCAaBC7.js → useFilterParams-CGRYFw_A.js} +2 -2
  194. package/dashboard/dist/assets/{useFilterParams-DZCAaBC7.js.map → useFilterParams-CGRYFw_A.js.map} +1 -1
  195. package/dashboard/dist/assets/{useYamlActivityEvents-Bll8NPNQ.js → useYamlActivityEvents-eK7kIUdh.js} +2 -2
  196. package/dashboard/dist/assets/{useYamlActivityEvents-Bll8NPNQ.js.map → useYamlActivityEvents-eK7kIUdh.js.map} +1 -1
  197. package/dashboard/dist/assets/{users-XZ349b0r.js → users-CCHSIAxt.js} +2 -2
  198. package/dashboard/dist/assets/{users-XZ349b0r.js.map → users-CCHSIAxt.js.map} +1 -1
  199. package/dashboard/dist/assets/{vendor-icons-B_Yla7iD.js → vendor-icons-D8-ZINAH.js} +2 -2
  200. package/dashboard/dist/assets/{vendor-icons-B_Yla7iD.js.map → vendor-icons-D8-ZINAH.js.map} +1 -1
  201. package/dashboard/dist/assets/vendor-query-DLp59M9_.js +35 -0
  202. package/dashboard/dist/assets/vendor-query-DLp59M9_.js.map +1 -0
  203. package/dashboard/dist/assets/vendor-react-Co3Y8ikm.js +26 -0
  204. package/dashboard/dist/assets/vendor-react-Co3Y8ikm.js.map +1 -0
  205. package/dashboard/dist/assets/{workflows-Do-Eiv8f.js → workflows-BNbocg_9.js} +2 -2
  206. package/dashboard/dist/assets/{workflows-Do-Eiv8f.js.map → workflows-BNbocg_9.js.map} +1 -1
  207. package/dashboard/dist/assets/{yaml-workflows-DolGRQ5f.js → yaml-workflows-Cu1FUwrc.js} +2 -2
  208. package/dashboard/dist/assets/{yaml-workflows-DolGRQ5f.js.map → yaml-workflows-Cu1FUwrc.js.map} +1 -1
  209. package/dashboard/dist/index.html +4 -4
  210. package/package.json +1 -1
  211. package/dashboard/dist/assets/AdminDashboard-DISq0Tz8.js +0 -2
  212. package/dashboard/dist/assets/AgentConfigPage-DqaJpB3K.js +0 -16
  213. package/dashboard/dist/assets/AgentDetailPage-BPzPk2GC.js +0 -4
  214. package/dashboard/dist/assets/AgentsPage-CLcxJWjC.js +0 -2
  215. package/dashboard/dist/assets/AvailableEscalationsPage-hOcjAAIj.js +0 -2
  216. package/dashboard/dist/assets/BotPicker-DuAZgHbJ.js +0 -2
  217. package/dashboard/dist/assets/CapabilitiesPage-PRel6TXd.js +0 -2
  218. package/dashboard/dist/assets/CollapsibleSection-DnoUFQVf.js +0 -2
  219. package/dashboard/dist/assets/ConfirmDeleteModal-dOxidrSR.js +0 -2
  220. package/dashboard/dist/assets/CopyableId-D0SQ39nR.js +0 -2
  221. package/dashboard/dist/assets/CredentialsPage-CqedUU7b.js +0 -2
  222. package/dashboard/dist/assets/CronLabel-CPEjE-mH.js +0 -2
  223. package/dashboard/dist/assets/CustomDurationPicker-BIQWzbv0.js +0 -2
  224. package/dashboard/dist/assets/DataTable-D9yuBv0w.js +0 -2
  225. package/dashboard/dist/assets/DropZone-e5EOL5gC.js +0 -2
  226. package/dashboard/dist/assets/ElapsedCell-CzVjr74Y.js +0 -2
  227. package/dashboard/dist/assets/EmptyState-BcsfPq9T.js +0 -2
  228. package/dashboard/dist/assets/EscalationsOverview-Bcrb44xJ.js +0 -2
  229. package/dashboard/dist/assets/EventTable-CGfJU7e1.js +0 -2
  230. package/dashboard/dist/assets/EventTopicPill-xJJnxvlP.js +0 -2
  231. package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js +0 -2
  232. package/dashboard/dist/assets/HomePage-BIzUcGW9.js +0 -2
  233. package/dashboard/dist/assets/ListToolbar-DNAGFe14.js +0 -2
  234. package/dashboard/dist/assets/McpOverview-BpYk21es.js +0 -2
  235. package/dashboard/dist/assets/McpQueryDetailPage-DlrZiSuL.js +0 -5
  236. package/dashboard/dist/assets/McpQueryPage-COfPssO7.js +0 -2
  237. package/dashboard/dist/assets/McpRunDetailPage-Cra0nQSw.js +0 -2
  238. package/dashboard/dist/assets/McpRunsPage-BlgcGN3k.js +0 -2
  239. package/dashboard/dist/assets/Modal-DEODGeqx.js +0 -2
  240. package/dashboard/dist/assets/OperatorDashboard-BbO6cWzb.js +0 -2
  241. package/dashboard/dist/assets/PageHeader-B_gV_jKk.js +0 -2
  242. package/dashboard/dist/assets/PageHeaderWithStats-D0I0nrnx.js +0 -2
  243. package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js +0 -2
  244. package/dashboard/dist/assets/ProcessDetailPage-s_iV8ICg.js +0 -2
  245. package/dashboard/dist/assets/ProcessesListPage-MnLMnxAa.js +0 -2
  246. package/dashboard/dist/assets/RolePill-BOBytzrP.js +0 -2
  247. package/dashboard/dist/assets/RolesPage-BH7KASM7.js +0 -2
  248. package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js +0 -2
  249. package/dashboard/dist/assets/RunAsSelector-_QbJKhlo.js +0 -2
  250. package/dashboard/dist/assets/ServerName-uqa4eBqm.js +0 -2
  251. package/dashboard/dist/assets/StatCard-DlgF0CJC.js +0 -2
  252. package/dashboard/dist/assets/StatusBadge-XQlNFwmH.js +0 -2
  253. package/dashboard/dist/assets/StepIndicator-CuUIGxKk.js +0 -2
  254. package/dashboard/dist/assets/StickyPagination-F9FZsRy9.js +0 -2
  255. package/dashboard/dist/assets/SwimlaneTimeline-og79Llvs.js +0 -2
  256. package/dashboard/dist/assets/TagInput-D3f11sbM.js +0 -2
  257. package/dashboard/dist/assets/TaskDetailPage-DPV4ySd9.js +0 -2
  258. package/dashboard/dist/assets/TaskDetailPage-DPV4ySd9.js.map +0 -1
  259. package/dashboard/dist/assets/TaskQueuePill-Bc45J7X1.js +0 -2
  260. package/dashboard/dist/assets/TasksListPage-BYj3OqUi.js +0 -2
  261. package/dashboard/dist/assets/TimeAgo-W7TdJpV-.js +0 -2
  262. package/dashboard/dist/assets/TimestampCell-Bi2nc9Q_.js +0 -2
  263. package/dashboard/dist/assets/ToolPill-CuoXcmhv.js +0 -2
  264. package/dashboard/dist/assets/ToolTestPanel-Dl3C53zb.js +0 -2
  265. package/dashboard/dist/assets/TopicDetailPage-CjaZn4WP.js +0 -9
  266. package/dashboard/dist/assets/TopicsPage-BfsJEC1p.js +0 -2
  267. package/dashboard/dist/assets/UserName-b4baWHM_.js +0 -2
  268. package/dashboard/dist/assets/WorkflowExecutionPage-BGmJnXnk.js +0 -2
  269. package/dashboard/dist/assets/WorkflowPill-Bg2-0Hkg.js +0 -2
  270. package/dashboard/dist/assets/WorkflowsDashboard-BzH7jMRu.js +0 -2
  271. package/dashboard/dist/assets/WorkflowsOverview-BcUgBvjD.js +0 -2
  272. package/dashboard/dist/assets/YamlWorkflowsPage-OhpCQJ0l.js +0 -2
  273. package/dashboard/dist/assets/capabilities-t-w5N9K9.js +0 -2
  274. package/dashboard/dist/assets/escalation-DilnDxw2.js +0 -2
  275. package/dashboard/dist/assets/escalation-columns-C0slywOY.js +0 -2
  276. package/dashboard/dist/assets/helpers-BMvPqQr8.js +0 -2
  277. package/dashboard/dist/assets/index-30-pN97P.js +0 -2
  278. package/dashboard/dist/assets/index-Bl9wzQ8Q.js +0 -2
  279. package/dashboard/dist/assets/index-BxOuF0hm.js +0 -2
  280. package/dashboard/dist/assets/index-Ck2QdJXT.js +0 -6
  281. package/dashboard/dist/assets/index-DNmlrCAp.js +0 -2
  282. package/dashboard/dist/assets/index-DPW_i3fH.js +0 -6
  283. package/dashboard/dist/assets/index-DZX-E_3q.js +0 -63
  284. package/dashboard/dist/assets/index-DZX-E_3q.js.map +0 -1
  285. package/dashboard/dist/assets/index-D_wqdvG_.js +0 -15
  286. package/dashboard/dist/assets/index-DnsVYMMg.js +0 -2
  287. package/dashboard/dist/assets/index-H5TlloTk.js +0 -2
  288. package/dashboard/dist/assets/index-f-0Duls3.js +0 -2
  289. package/dashboard/dist/assets/index-pIMl0mYp.js +0 -2
  290. package/dashboard/dist/assets/index-qNuxC8kX.js +0 -2
  291. package/dashboard/dist/assets/namespaces-6qWDXXJV.js +0 -2
  292. package/dashboard/dist/assets/vendor-query-B2UbickB.js +0 -18
  293. package/dashboard/dist/assets/vendor-query-B2UbickB.js.map +0 -1
  294. package/dashboard/dist/assets/vendor-react-CX88sFS5.js +0 -22
  295. package/dashboard/dist/assets/vendor-react-CX88sFS5.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{u as n,b as s,c as u}from"./vendor-query-B2UbickB.js";import{b as r}from"./index-DZX-E_3q.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-Do-Eiv8f.js.map
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 +1 @@
1
- {"version":3,"file":"workflows-Do-Eiv8f.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-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,2 +1,2 @@
1
- import{u as l,b as a,c as n}from"./vendor-query-B2UbickB.js";import{b as r}from"./index-DZX-E_3q.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-DolGRQ5f.js.map
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 +1 @@
1
- {"version":3,"file":"yaml-workflows-DolGRQ5f.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-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":"qGAmBO,SAASA,EAAiBC,EAA+B,GAAI,CAClE,MAAMC,EAAS,IAAI,gBACnB,OAAID,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,aAAaC,EAAO,IAAI,cAAeD,EAAQ,WAAW,EAClEA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,OAAOC,EAAO,IAAI,QAAS,OAAOD,EAAQ,KAAK,CAAC,EACxDA,EAAQ,SAAW,QAAWC,EAAO,IAAI,SAAU,OAAOD,EAAQ,MAAM,CAAC,EAEtEE,EAAmC,CACxC,SAAU,CAAC,gBAAiBF,CAAO,EACnC,QAAS,IAAMG,EAAS,mBAAmBF,CAAM,EAAE,CAAA,CACpD,CACH,CAEO,SAASG,GAAwB,CACtC,OAAOF,EAAgC,CACrC,SAAU,CAAC,oBAAoB,EAC/B,QAAS,IAAMC,EAAS,yBAAyB,CAAA,CAClD,CACH,CAcO,SAASE,EAAgBC,EAAY,CAC1C,OAAOJ,EAA+B,CACpC,SAAU,CAAC,gBAAiBI,CAAE,EAC9B,QAAS,IAAMH,EAAS,mBAAmBG,CAAE,EAAE,EAC/C,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAEO,SAASC,GAAwB,CACtC,MAAMC,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaC,GAWXR,EAA+B,kBAAmB,CAChD,OAAQ,OACR,KAAM,KAAK,UAAUQ,CAAK,CAAA,CAC3B,EACH,UAAW,IAAM,CACfH,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASI,GAAwB,CACtC,MAAMJ,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,UAAW,CAC7D,OAAQ,MAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASK,GAA0B,CACxC,MAAML,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,YAAa,CAC/D,OAAQ,MAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASM,GAAwB,CACtC,MAAMN,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAY,CAAC,CAAE,GAAAJ,EAAI,KAAAS,EAAM,KAAAC,EAAM,WAAAC,KAC7Bd,EAAgD,mBAAmBG,CAAE,UAAW,CAC9E,OAAQ,OACR,KAAM,KAAK,UAAU,CAAE,KAAAS,EAAM,KAAAC,EAAM,GAAIC,EAAa,CAAE,WAAAA,CAAA,EAAe,GAAK,CAAA,CAC3E,EACH,UAAW,IAAM,CACfT,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASU,GAA4B,CAC1C,MAAMV,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAY,CAAC,CAAE,GAAAJ,EAAI,WAAAa,EAAY,qBAAAC,KAC7BjB,EAA+B,mBAAmBG,CAAE,cAAe,CACjE,OAAQ,OACR,KAAM,KAAK,UAAU,CAAE,WAAAa,EAAY,qBAAAC,EAAsB,CAAA,CAC1D,EACH,UAAW,IAAM,CACfZ,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASa,GAAyB,CACvC,MAAMb,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,WAAY,CAC9D,OAAQ,MAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASc,GAAyB,CACvC,MAAMd,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,WAAY,CAC9D,OAAQ,MAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,EACjFA,EAAY,kBAAkB,CAAE,SAAU,CAAC,cAAc,EAAG,YAAa,MAAO,CAClF,CAAA,CACD,CACH,CAEO,SAASe,GAAwB,CACtC,MAAMf,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAY,CAAC,CAAE,GAAAJ,EAAI,GAAGkB,KACpBrB,EAA+B,mBAAmBG,CAAE,GAAI,CACtD,OAAQ,MACR,KAAM,KAAK,UAAUkB,CAAO,CAAA,CAC7B,EACH,UAAW,IAAM,CACfhB,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASiB,GAAwB,CACtC,MAAMjB,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,GAAI,CACtD,OAAQ,QAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAIO,SAASkB,GAAiB,CAC/B,MAAMlB,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAY,CAAC,CAAE,GAAAJ,EAAI,cAAAqB,EAAe,cAAAC,EAAe,WAAAX,KAM/Cd,EAA+B,mBAAmBG,CAAE,QAAS,CAC3D,OAAQ,MACR,KAAM,KAAK,UAAU,CAAE,cAAAqB,EAAe,cAAAC,EAAe,WAAAX,EAAY,CAAA,CAClE,EACH,UAAW,IAAM,CACfT,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAEO,SAASqB,GAAmB,CACjC,MAAMrB,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,QAAS,CAC3D,OAAQ,QAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAIO,SAASsB,EAAwBxB,EAAY,CAClD,OAAOJ,EAA+D,CACpE,SAAU,CAAC,gBAAiBI,EAAI,UAAU,EAC1C,QAAS,IAAMH,EAAS,mBAAmBG,CAAE,WAAW,EACxD,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAEO,SAASyB,EAAuBzB,EAAY0B,EAAwB,CACzE,OAAO9B,EAAgC,CACrC,SAAU,CAAC,gBAAiBI,EAAI,WAAY0B,CAAO,EACnD,QAAS,IAAM7B,EAAS,mBAAmBG,CAAE,aAAa0B,CAAO,EAAE,EACnE,QAAS,CAAC,CAAC1B,GAAM0B,IAAY,IAAA,CAC9B,CACH"}
@@ -8,10 +8,10 @@
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-DZX-E_3q.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-B_Yla7iD.js">
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
15
  <link rel="stylesheet" crossorigin href="/assets/index-BPxglOYm.css">
16
16
  </head>
17
17
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/long-tail",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
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{j as o}from"./vendor-query-B2UbickB.js";import{c as n}from"./tasks-BevFBjZq.js";import{r as m}from"./index-DZX-E_3q.js";import{f as c}from"./useEventHooks-CPyvFlVR.js";import{u}from"./mcp-CjXjDZI0.js";import{P as d}from"./PageHeaderWithStats-D0I0nrnx.js";import"./vendor-react-CX88sFS5.js";import"./vendor-icons-B_Yla7iD.js";function j(){var a;c();const{data:s}=n({limit:1}),{data:e}=m({status:"pending",limit:1}),{data:t}=u(),r=((a=t==null?void 0:t.servers)==null?void 0:a.filter(i=>i.status==="connected").length)??0,l=t?`${r}/${t.total}`:"—";return o.jsx("div",{children:o.jsx(d,{title:"Admin",stats:[{label:"Tasks",value:(s==null?void 0:s.total)??"—"},{label:"Pending Escalations",value:(e==null?void 0:e.total)??"—",dotClass:"bg-status-pending"},{label:"MCP Servers",value:l},{label:"System",value:"Healthy",dotClass:"bg-status-success"}]})})}export{j as AdminDashboard};
2
- //# sourceMappingURL=AdminDashboard-DISq0Tz8.js.map
@@ -1,16 +0,0 @@
1
- import{j as e,a as f}from"./vendor-query-B2UbickB.js";import{a as re,d as le,b as oe}from"./agents-Ce3HmPz4.js";import{C as ce,u as de,a as pe,b as xe,c as ue}from"./CronLabel-CPEjE-mH.js";import{d as me,u as he}from"./index-DZX-E_3q.js";import{P as fe}from"./PageHeader-B_gV_jKk.js";import{B as I,d as B,b as ve,R as U,Y as L,n as X,a4 as G,a as Z,aF as ee,K as be}from"./vendor-icons-B_Yla7iD.js";import{e as je}from"./knowledge-D01NdF5h.js";import{R as te}from"./RunAsSelector-_QbJKhlo.js";import{u as ge}from"./workflows-Do-Eiv8f.js";import{u as ye}from"./yaml-workflows-DolGRQ5f.js";import{u as se}from"./capabilities-t-w5N9K9.js";import{u as we}from"./topics-BMG5tx2g.js";import{E as Ne}from"./EventTopicPill-xJJnxvlP.js";import{W as V}from"./WorkflowPill-Bg2-0Hkg.js";import{e as _e,c as ke,f as Ce}from"./vendor-react-CX88sFS5.js";import"./BotPicker-DuAZgHbJ.js";import"./bots-B0BomNnf.js";const Q={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Se={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},qe={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,p,u;const l=(p=(o=s.behaviors)==null?void 0:o.schedules)!=null&&p.length?s.behaviors.schedules.map(n=>({cron:n.cron||"",reaction_type:n.reaction_type||"durable",workflow_type:n.workflow_type||"",pipeline_id:n.pipeline_id||"",server_id:n.server_id||"",tool_name:n.tool_name||"",envelope:n.envelope?JSON.stringify(n.envelope,null,2):"{}",execute_as:n.execute_as||""})):(u=s.behaviors)!=null&&u.cron?[{cron:s.behaviors.cron,reaction_type:"durable",workflow_type:s.workflow_type??"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""}]:[];return{name:s.id,description:s.description??"",goals:s.goals??"",rules:s.rules??"",user_id:s.user_id??"",knowledge_domain:s.knowledge_domain??"",subscriptions:a.map(n=>({id:n.id,topic:n.topic,filter:n.filter?JSON.stringify(n.filter,null,2):"",reaction_type:n.reaction_type,workflow_type:n.workflow_type??"",pipeline_id:n.pipeline_id??"",mcp_prompt:n.mcp_prompt??"",server_id:n.server_id??"",tool_name:n.tool_name??"",input_mapping:JSON.stringify(n.input_mapping??{},null,2),execute_as:n.execute_as??"",enabled:n.enabled})),schedules:l}}function Pe(s){var l;const a={};return s.schedules.length>0&&(a.schedules=s.schedules.map(o=>({cron:o.cron,reaction_type:o.reaction_type||"durable",workflow_type:o.reaction_type==="pipeline"?void 0:o.workflow_type,pipeline_id:o.reaction_type==="pipeline"?o.pipeline_id:void 0,envelope:Y(o.envelope)??{},execute_as:o.execute_as||void 0})),a.cron=s.schedules[0].cron),{id:s.name,description:s.description||void 0,goals:s.goals||void 0,rules:s.rules||void 0,user_id:s.user_id||void 0,knowledge_domain:s.knowledge_domain||void 0,behaviors:a,workflow_type:((l=s.schedules[0])==null?void 0:l.workflow_type)||void 0,pipeline_id:void 0}}function Ie(s){return s.subscriptions.map(a=>({id:a.id,topic:a.topic,filter:a.filter?Y(a.filter):void 0,reaction_type:a.reaction_type,workflow_type:a.workflow_type||void 0,pipeline_id:a.pipeline_id||void 0,mcp_prompt:a.mcp_prompt||void 0,server_id:a.server_id||void 0,tool_name:a.tool_name||void 0,input_mapping:Y(a.input_mapping)??{},execute_as:a.execute_as||void 0,enabled:a.enabled}))}function Y(s){if(s.trim())try{return JSON.parse(s)}catch{return}}const S="section-header mt-[3em] first:mt-0",W="label",_="hint",R="input",M="input-json w-full";function Ee({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:identity"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Identity",children:e.jsx(I,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:W,children:"Name *"}),e.jsx("input",{type:"text",value:s.name,onChange:l=>a("name",l.target.value),placeholder:"health-monitor",className:R}),e.jsx("p",{className:_,children:"Lowercase, kebab-case. This appears everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:W,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:l=>a("description",l.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:R}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function We({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:motivation"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Motivation",children:e.jsx(I,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:W,children:"Goals"}),e.jsx("textarea",{value:s.goals,onChange:l=>a("goals",l.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${R} resize-none`}),e.jsx("p",{className:_,children:"Primary motivation. What the automation is trying to achieve."})]}),e.jsxs("div",{children:[e.jsx("label",{className:W,children:"Rules"}),e.jsx("textarea",{value:s.rules,onChange:l=>a("rules",l.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${R} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function $e({form:s,set:a}){const{data:l}=je(),o=(l==null?void 0:l.domains)??[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Assign a knowledge domain — the automation's memory. It stores context here over time."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:knowledge"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Knowledge",children:e.jsx(I,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:W,children:"Knowledge Domain"}),e.jsx("input",{type:"text",value:s.knowledge_domain,onChange:p=>a("knowledge_domain",p.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:R,list:"domain-suggestions"}),e.jsx("datalist",{id:"domain-suggestions",children:o.map(p=>e.jsx("option",{value:p.domain},p.domain))}),e.jsx("p",{className:_,children:"Choose an existing domain to share memory, or type a new name to create one."})]}),o.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:W,children:"Existing Domains"}),e.jsx("div",{className:"space-y-0.5 mt-2",children:o.map(p=>e.jsxs("button",{type:"button",onClick:()=>a("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.jsx(B,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary flex-1",children:p.domain}),e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:[p.count," entries"]}),e.jsx("span",{className:"text-[9px] text-text-quaternary",children:e.jsx(me,{date:p.latest})})]},p.domain))})]})]})}function Ae({serverId:s,toolName:a,onChange:l}){const{data:o}=se(),p=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[u,n]=f.useState(!1),[v,d]=f.useState(""),c=f.useRef(null),h=f.useRef(null);f.useEffect(()=>{if(!u)return;function t(i){h.current&&!h.current.contains(i.target)&&n(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[u]);const r=a?`${a}`:"",x=u?v:r,w=f.useMemo(()=>{const t=(u?v:"").toLowerCase();return t?p.filter(i=>i.name.toLowerCase().includes(t)||i.serverName.toLowerCase().includes(t)||(i.description??"").toLowerCase().includes(t)):p},[p,v,u]),m=a?p.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsx("input",{ref:c,type:"text",value:x,onFocus:()=>{n(!0),d(r)},onChange:t=>{const i=t.target.value;d(i),i||l("",""),u||n(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!u&&(m==null?void 0:m.description)&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-1 italic",children:m.description}),u&&w.length>0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:w.map(t=>e.jsxs("button",{type:"button",onClick:()=>{l(t.serverId,t.name),d(t.name),n(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===t.serverId&&a===t.name?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-[11px] font-mono text-text-primary shrink-0",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(ve,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),u&&w.length===0&&v&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center",children:e.jsxs("p",{className:"text-[11px] text-text-quaternary",children:['No capabilities match "',v,'"']})})]})}const Oe={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Te=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:l,onWorkflowTypeChange:o,pipelineId:p,onPipelineIdChange:u,serverId:n,toolName:v,onCapabilityChange:d,mcpPrompt:c,onMcpPromptChange:h,availableTypes:r=[...Te]}){const{data:x}=ge(),w=(x??[]).filter(i=>i.invocable).map(i=>i.workflow_type),{data:m}=ye({status:"active"}),t=((m==null?void 0:m.workflows)??[]).map(i=>({id:i.id,name:i.graph_topic||i.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:r.map(i=>{const b=s===i;return e.jsx("button",{type:"button",onClick:()=>a(i),className:`px-3 py-1.5 text-[11px] font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Oe[i]},i)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:l,onChange:i=>o(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),w.map(i=>e.jsx("option",{value:i,children:i},i))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:p,onChange:i=>u(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(Ae,{serverId:n,toolName:v,onChange:d})]}),s==="mcp_query"&&h&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:c??"",onChange:i=>h(i.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Le={task:"bg-blue-400/15 text-blue-400",workflow:"bg-accent/15 text-accent",escalation:"bg-amber-400/15 text-amber-400",activity:"bg-cyan-400/15 text-cyan-400",knowledge:"bg-violet-400/15 text-violet-400",file:"bg-orange-400/15 text-orange-400",agent:"bg-emerald-400/15 text-emerald-400",app:"bg-rose-400/15 text-rose-400",milestone:"bg-violet-400/15 text-violet-400"};function Me({form:s,set:a}){const{data:l}=we({limit:200}),{data:o}=se(),p=(l==null?void 0:l.topics)??[],u=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[n,v]=f.useState(0),d=(t,i,b)=>{const j=[...s.subscriptions];j[t]={...j[t],[i]:b},a("subscriptions",j)},c=()=>{a("subscriptions",[...s.subscriptions,{...Se}]),v(s.subscriptions.length)},h=t=>{a("subscriptions",s.subscriptions.filter((i,b)=>b!==t)),n>=s.subscriptions.length-1&&v(Math.max(0,s.subscriptions.length-2))},r=s.subscriptions,x=r[n],w=t=>t.topic?t.reaction_type==="durable"?!!t.workflow_type:t.reaction_type==="pipeline"?!!t.pipeline_id:t.reaction_type==="mcp_query"?!!t.mcp_prompt:t.reaction_type==="capability"?!!t.server_id&&!!t.tool_name:!1:!1,m=x?p.find(t=>t.topic===x.topic):void 0;return r.length===0?e.jsxs("div",{className:"max-w-xl",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(I,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(U,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"}),e.jsx("p",{className:"text-[11px] text-text-quaternary max-w-sm mb-6",children:"Each subscription listens for a topic pattern and runs a workflow when it matches."}),e.jsxs("button",{onClick:c,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(L,{className:"w-3.5 h-3.5"})," Add first subscription"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(I,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-52 shrink-0 space-y-0.5",children:[r.map((t,i)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${n===i?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>v(i),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${w(t)?"bg-emerald-400":"bg-zinc-500"}`}),e.jsx("span",{className:"text-[11px] font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-[9px] text-text-quaternary ml-3",children:["→ ",t.workflow_type||t.tool_name||t.reaction_type]})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove subscription "${t.topic||"new"}"?
2
-
3
- This takes effect when you save.`)&&h(i)},className:"opacity-0 group-hover/sub:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsx(X,{className:"w-3 h-3"})})]},i)),e.jsxs("button",{onClick:c,className:"w-full flex items-center gap-1.5 px-3 py-2 text-[11px] text-accent hover:text-accent-hover transition-colors",children:[e.jsx(L,{className:"w-3 h-3"})," Add"]})]}),x&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"When this event fires"}),e.jsx(Je,{value:x.topic,onChange:t=>d(n,"topic",t),topics:p}),(m==null?void 0:m.payload_schema)&&e.jsxs("div",{className:"mt-3 p-3 rounded-md bg-surface-sunken border border-surface-border",children:[e.jsx("p",{className:"text-[10px] text-text-quaternary mb-1 uppercase tracking-wider font-medium",children:"Payload Schema"}),e.jsx("pre",{className:"text-[11px] font-mono text-text-secondary whitespace-pre-wrap overflow-x-auto max-h-40",children:JSON.stringify(m.payload_schema.properties??m.payload_schema,null,2)}),m.description&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-2 italic",children:m.description})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:x.reaction_type,onReactionTypeChange:t=>d(n,"reaction_type",t),workflowType:x.workflow_type,onWorkflowTypeChange:t=>d(n,"workflow_type",t),pipelineId:x.pipeline_id,onPipelineIdChange:t=>d(n,"pipeline_id",t),serverId:x.server_id,toolName:x.tool_name,onCapabilityChange:(t,i)=>{var P;const b=[...s.subscriptions],j={...b[n],server_id:t,tool_name:i},k=u.find(y=>y.serverId===t&&y.name===i),E=(P=k==null?void 0:k.inputSchema)==null?void 0:P.properties;if(E&&i){const y={};for(const $ of Object.keys(E))$.startsWith("_")||(y[$]=`{event.data.${$}}`);j.input_mapping=JSON.stringify(y,null,2)}b[n]=j,a("subscriptions",b)},mcpPrompt:x.mcp_prompt,onMcpPromptChange:t=>d(n,"mcp_prompt",t)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:x.execute_as,onChange:t=>d(n,"execute_as",t)}),e.jsx("p",{className:_,children:"Identity used when invoking the workflow."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"But only if"}),e.jsx("input",{type:"text",value:x.filter,onChange:t=>d(n,"filter",t.target.value),placeholder:"No filter (all matching events)",className:`${R} font-mono text-xs`}),e.jsxs("p",{className:_,children:["JSON filter against event.data, e.g. ",'{"status": 422}']})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),x.reaction_type==="capability"&&x.tool_name?e.jsx(Fe,{tool:u.find(t=>t.serverId===x.server_id&&t.name===x.tool_name),value:x.input_mapping,onChange:t=>d(n,"input_mapping",t),eventSchema:m==null?void 0:m.payload_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:x.input_mapping,onChange:t=>d(n,"input_mapping",t.target.value),rows:10,className:M,placeholder:`{
4
- "data": {
5
- "orderId": "{event.data.orderId}",
6
- "error": "{event.data.error}"
7
- }
8
- }`}),e.jsxs("p",{className:_,children:["Maps event fields to workflow input. ","{event.data.fieldName}"," resolves at runtime."]})]})]})]})]})]})}function Fe({tool:s,value:a,onChange:l,eventSchema:o}){var w,m;const[p,u]=f.useState(!1),n=((w=s==null?void 0:s.inputSchema)==null?void 0:w.properties)??{},v=((m=s==null?void 0:s.inputSchema)==null?void 0:m.required)??[],d=Object.entries(n).filter(([t])=>!t.startsWith("_")),c=f.useMemo(()=>[...d].sort(([t],[i])=>{const b=v.indexOf(t),j=v.indexOf(i);return b!==-1&&j!==-1?b-j:b!==-1?-1:j!==-1?1:t.localeCompare(i)}),[d,v]),h=f.useMemo(()=>{const t=[{value:"{event.type}",label:"event type"},{value:"{event.source}",label:"event source"},{value:"{event.timestamp}",label:"ISO timestamp"},{value:"{event.workflowId}",label:"workflow ID"},{value:"{event.workflowName}",label:"workflow name"}],i=o==null?void 0:o.properties;if(i)for(const[b,j]of Object.entries(i))t.push({value:`{event.data.${b}}`,label:j.description||b});return t},[o]),r=f.useMemo(()=>{try{return JSON.parse(a)}catch{return{}}},[a]),x=(t,i)=>{const b={...r,[t]:i};l(JSON.stringify(b,null,2))};return c.length===0||p?e.jsxs("div",{children:[c.length>0&&e.jsx("div",{className:"flex justify-end mb-1",children:e.jsx("button",{type:"button",onClick:()=>u(!1),className:"text-[10px] text-accent hover:text-accent-hover transition-colors",children:"Form view"})}),e.jsx("textarea",{value:a,onChange:t=>l(t.target.value),rows:8,className:M,placeholder:`{
9
- "domain": "{event.data.name}",
10
- "key": "{event.data.path}"
11
- }`}),e.jsxs("p",{className:_,children:["Maps event fields to capability inputs. ","{event.data.fieldName}"," resolves at runtime."]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-[11px] text-text-tertiary",children:"Map each input to an event field or enter a static value."}),e.jsx("button",{type:"button",onClick:()=>u(!0),className:"text-[10px] text-text-tertiary hover:text-accent transition-colors",children:"Raw JSON"})]}),e.jsx("div",{className:"space-y-4",children:c.map(([t,i])=>{const b=v.includes(t),j=i.description,k=i.type,E=typeof r[t]=="string"?r[t]:typeof r[t]=="object"?JSON.stringify(r[t]):r[t]!=null?String(r[t]):"";return e.jsxs("div",{className:"bg-surface-sunken/30 rounded-md px-4 py-3",children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[e.jsxs("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[t.replace(/[_-]/g," "),b&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]}),k&&e.jsx("span",{className:"text-[9px] text-text-quaternary",children:k})]}),j&&e.jsx("p",{className:"text-[10px] text-text-quaternary mb-2",children:j}),e.jsx(De,{value:E,onChange:P=>x(t,P),suggestions:h,fieldType:k,placeholder:`{event.data.${t}}`})]},t)})})]})}function De({value:s,onChange:a,suggestions:l,fieldType:o,placeholder:p}){const[u,n]=f.useState(!1),[v,d]=f.useState(""),c=f.useRef(null);f.useEffect(()=>{if(!u)return;function r(x){c.current&&!c.current.contains(x.target)&&n(!1)}return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[u]);const h=l.filter(r=>r.value.toLowerCase().includes(v.toLowerCase())||r.label.toLowerCase().includes(v.toLowerCase()));return o==="object"?e.jsx("textarea",{value:s,onChange:r=>{try{a(JSON.parse(r.target.value))}catch{a(r.target.value)}},rows:3,className:`${M} text-xs`,placeholder:'{ "source": "{event.source}" }'}):e.jsxs("div",{ref:c,className:"relative",children:[e.jsx("input",{type:"text",value:s,onFocus:()=>{n(!0),d("")},onChange:r=>{a(r.target.value),d(r.target.value),u||n(!0)},className:"input font-mono text-xs w-full",placeholder:p}),u&&h.length>0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 max-h-48 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:h.map(r=>e.jsxs("button",{type:"button",onClick:()=>{a(r.value),n(!1)},className:`w-full text-left px-3 py-1.5 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===r.value?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-[11px] font-mono text-accent shrink-0",children:r.value}),e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:r.label})]},r.value))})]})}function Je({value:s,onChange:a,topics:l}){const[o,p]=f.useState(!1),[u,n]=f.useState(""),v=f.useRef(null),d=f.useRef(null);f.useEffect(()=>{function r(x){d.current&&!d.current.contains(x.target)&&p(!1)}return o&&document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[o]);const c=o?u:s,h=l.filter(r=>r.topic.toLowerCase().includes((o?u:"").toLowerCase())||(r.description??"").toLowerCase().includes((o?u:"").toLowerCase()));return e.jsxs("div",{ref:d,className:"relative",children:[e.jsx("input",{ref:v,type:"text",value:c,onFocus:()=>{p(!0),n(s)},onChange:r=>{const x=r.target.value;n(x),a(x),o||p(!0)},placeholder:"workflow.failed or app.>",className:`${R} font-mono`}),o&&h.length>0&&e.jsx("div",{className:"absolute z-50 left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:h.map(r=>{const x=Le[r.category]??"bg-zinc-400/15 text-zinc-400";return e.jsxs("button",{type:"button",onClick:()=>{a(r.topic),n(r.topic),p(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===r.topic?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-[11px] font-mono text-text-primary shrink-0",children:r.topic}),e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-medium shrink-0 ${x}`,children:r.category}),r.description&&e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:r.description})]},r.topic)})})]})}const ze=["*/5 * * * *","*/15 * * * *","0 * * * *","0 */4 * * *","0 7 * * *","0 9 * * 1-5"];function z(s){return{"* * * * *":"Every minute","*/5 * * * *":"Every 5 min","*/15 * * * *":"Every 15 min","0 * * * *":"Hourly","0 */4 * * *":"Every 4 hours","0 7 * * *":"Daily 7 AM UTC","0 9 * * 1-5":"Weekdays 9 AM UTC","0 0 * * 1":"Weekly Monday"}[s]||s}function Ye({form:s,set:a}){const[l,o]=f.useState(0),p=(c,h,r)=>{const x=[...s.schedules];x[c]={...x[c],[h]:r},a("schedules",x)},u=()=>{a("schedules",[...s.schedules,{...qe}]),o(s.schedules.length)},n=c=>{a("schedules",s.schedules.filter((h,r)=>r!==c)),l>=s.schedules.length-1&&o(Math.max(0,s.schedules.length-2))},v=s.schedules,d=v[l];return v.length===0?e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 mb-8 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Optional. Each schedule runs a workflow on a cron timer."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:schedule"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Schedule",children:e.jsx(I,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(G,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No schedules"}),e.jsx("p",{className:"text-[11px] text-text-quaternary max-w-sm mb-6",children:"Add a schedule to run a workflow on a recurring cron timer."}),e.jsxs("button",{onClick:u,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(L,{className:"w-3.5 h-3.5"})," Add schedule"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 mb-6 flex items-start justify-between",children:[e.jsx("p",{className:"text-[12px] text-text-secondary italic leading-relaxed",children:"Each schedule runs a workflow on a timer. An automation can have multiple schedules targeting different workflows."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:schedule"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Schedule",children:e.jsx(I,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-48 shrink-0 space-y-0.5",children:[v.map((c,h)=>e.jsxs("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.jsxs("button",{onClick:()=>o(h),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsx("span",{className:"text-[11px] font-mono block",children:c.cron||"new schedule"}),e.jsxs("span",{className:"text-[9px] text-text-quaternary",children:[(c.reaction_type==="pipeline"?c.pipeline_id:c.workflow_type)||"no target"," · ",z(c.cron)]})]}),e.jsx("button",{onClick:r=>{r.stopPropagation(),confirm(`Remove schedule "${c.cron||"new"}"?
12
-
13
- This takes effect when you save.`)&&n(h)},className:"opacity-0 group-hover/sched:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsx(X,{className:"w-3 h-3"})})]},h)),e.jsxs("button",{onClick:u,className:"w-full flex items-center gap-1.5 px-3 py-2 text-[11px] text-accent hover:text-accent-hover transition-colors",children:[e.jsx(L,{className:"w-3 h-3"})," Add"]})]}),d&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run every"}),e.jsx("input",{type:"text",value:d.cron,onChange:c=>p(l,"cron",c.target.value),placeholder:"0 * * * *",className:`${R} font-mono`}),d.cron&&e.jsx("p",{className:"text-[11px] text-accent/80 mt-1",children:z(d.cron)}),e.jsx("div",{className:"flex gap-3 mt-2 overflow-x-auto",children:ze.map(c=>e.jsx("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:z(c)},c))})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{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"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:d.execute_as,onChange:c=>p(l,"execute_as",c)}),e.jsx("p",{className:_,children:"Identity used when invoking."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),e.jsx("textarea",{value:d.envelope,onChange:c=>p(l,"envelope",c.target.value),rows:10,className:M,placeholder:`{
14
- "data": { "source": "cron" }
15
- }`}),e.jsx("p",{className:_,children:"Static payload passed to the workflow on each invocation."})]})]})]})]})}function O({icon:s,color:a,title:l,children:o}){return e.jsxs("div",{className:"mb-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 pb-1.5 border-b border-surface-border/40",children:[e.jsx(s,{className:`w-3.5 h-3.5 ${a}`,strokeWidth:1.5}),e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-widest text-accent/80",children:l})]}),e.jsx("div",{className:"pl-5.5",children:o})]})}function T({label:s,children:a}){return e.jsxs("div",{className:"flex gap-3 py-0.5",children:[e.jsx("span",{className:"text-[10px] text-text-quaternary w-20 shrink-0",children:s}),e.jsx("span",{className:"text-xs text-text-primary",children:a})]})}function Be({form:s}){return e.jsxs("div",{children:[e.jsxs(O,{icon:Z,color:"text-accent",title:"Identity",children:[e.jsx(T,{label:"Name",children:s.name||"—"}),s.description&&e.jsx(T,{label:"Description",children:s.description})]}),(s.goals||s.rules)&&e.jsxs(O,{icon:ee,color:"text-rose-400",title:"Motivation",children:[s.goals&&e.jsx(T,{label:"Goals",children:s.goals}),s.rules&&e.jsx(T,{label:"Rules",children:s.rules})]}),e.jsx(O,{icon:B,color:"text-emerald-400",title:"Knowledge",children:e.jsx(T,{label:"Domain",children:s.knowledge_domain||"None"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-10",children:[e.jsx(O,{icon:U,color:"text-cyan-400",title:`Subscriptions (${s.subscriptions.length})`,children:s.subscriptions.length===0?e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.subscriptions.map((a,l)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(Ne,{topic:a.topic||"unset"})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),a.workflow_type?e.jsx(V,{type:a.workflow_type}):e.jsx("span",{className:"text-[11px] text-text-quaternary",children:a.reaction_type})]})]},l))})}),e.jsx(O,{icon:G,color:"text-amber-400",title:`Schedules (${s.schedules.length})`,children:s.schedules.length===0?e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.schedules.map((a,l)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ce,{cron:a.cron})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),a.workflow_type?e.jsx(V,{type:a.workflow_type}):e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"no workflow"})]})]},l))})})]}),e.jsx("div",{className:"border-l-2 border-emerald-400/30 pl-3 py-2 mt-6",children:e.jsx("p",{className:"text-[11px] text-text-tertiary leading-relaxed",children:"After saving, subscriptions and schedules activate immediately. You can pause the automation anytime."})})]})}const Ue=[{id:1,label:"Identity",icon:Z},{id:2,label:"Motivation",icon:ee},{id:3,label:"Knowledge",icon:B},{id:4,label:"Subscriptions",icon:U},{id:5,label:"Schedules",icon:G},{id:6,label:"Review",icon:be}];function dt(){var H;const{id:s}=_e(),a=!s,l=ke(),{data:o}=he(),u=!!((H=o==null?void 0:o.ai)!=null&&H.enabled)?"Agent":"Automation",{data:n,isLoading:v}=re(a?null:s),{data:d}=de(a?null:s),c=le(),h=oe(),r=pe(),x=xe(),w=ue(),[m,t]=f.useState(Q),[i,b]=f.useState(!1),[j,k]=f.useState(""),[E,P]=Ce(),y=parseInt(E.get("step")||"1",10),$=f.useCallback(g=>{P(N=>{const q=new URLSearchParams(N);return q.set("step",String(g)),q},{replace:!0})},[P]);f.useEffect(()=>{if(!i){if(a){t(Q),b(!0);return}n&&d&&(t(Re(n,d.subscriptions??[])),b(!0))}},[n,d,a,i]);const A=(g,N)=>t(q=>({...q,[g]:N})),ne=async()=>{k("");try{const g=Pe(m);let N=s;a?N=(await c.mutateAsync(g)).id:await h.mutateAsync({id:s,...g});const q=Ie(m),ie=(d==null?void 0:d.subscriptions)??[],F=new Set(ie.map(C=>C.id));for(const C of q)if(C.id&&F.has(C.id)){const{id:D,...J}=C;await x.mutateAsync({agentId:N,subId:D,...J}),F.delete(D)}else{const{id:D,...J}=C;await r.mutateAsync({agentId:N,...J})}for(const C of F)await w.mutateAsync({agentId:N,subId:C});l(`/agents/${N}`)}catch(g){k(g.message)}};if(!a&&v)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-60 bg-surface-sunken rounded"})]});const K=c.isPending||h.isPending;return e.jsxs("div",{children:[e.jsx(fe,{title:a?`New ${u}`:`${u}: ${(n==null?void 0:n.id)??""}`,docsHash:"#docs:agents.md"}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:Ue.map(g=>{const N=g.icon,q=y===g.id;return e.jsxs("button",{onClick:()=>$(g.id),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${q?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(N,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:g.label})]},g.id)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:ne,disabled:!m.name.trim()||K,className:"w-full btn-primary text-xs disabled:opacity-50",children:K?"Saving...":a?`Create ${u}`:"Save"}),e.jsx("button",{onClick:()=>l(a?"/agents":`/agents/${s}`),className:"w-full btn-ghost text-xs",children:"Cancel"})]}),j&&e.jsx("p",{className:"text-xs text-status-error mt-3",children:j})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2",children:[y===1&&e.jsx(Ee,{form:m,set:A}),y===2&&e.jsx(We,{form:m,set:A}),y===3&&e.jsx($e,{form:m,set:A}),y===4&&e.jsx(Me,{form:m,set:A}),y===5&&e.jsx(Ye,{form:m,set:A}),y===6&&e.jsx(Be,{form:m})]})]})]})}export{dt as AgentConfigPage};
16
- //# sourceMappingURL=AgentConfigPage-DqaJpB3K.js.map
@@ -1,4 +0,0 @@
1
- import{j as e,a as y}from"./vendor-query-B2UbickB.js";import{a as D,b as L,c as R}from"./agents-Ce3HmPz4.js";import{u as W,c as z,N as F}from"./index-DZX-E_3q.js";import{u as I,C as S}from"./CronLabel-CPEjE-mH.js";import{i as K}from"./useEventHooks-CPyvFlVR.js";import{E as _}from"./EventTopicPill-xJJnxvlP.js";import{W as N}from"./WorkflowPill-Bg2-0Hkg.js";import{a as M,B as U,J as G,P as H,aE as J,n as O,aF as X,R as $,a4 as Y,d as Q,aG as V}from"./vendor-icons-B_Yla7iD.js";import{e as Z,c as ee}from"./vendor-react-CX88sFS5.js";function te(a){return new Date(a).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function u({icon:a,color:r,children:c,actions:h}){return e.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(a,{className:`w-4 h-4 ${r}`,strokeWidth:1.5}),e.jsx("h2",{className:"text-xs font-semibold uppercase tracking-widest text-accent/80",children:c})]}),h]})}function j({text:a}){return e.jsx("p",{className:"text-[11px] text-text-quaternary py-2",children:a})}let se=0;function ae(a){const[r,c]=y.useState([]),[h,d]=y.useState(!1),t=y.useCallback(n=>{var m,g,p;if((m=n.type)!=null&&m.startsWith("mesh.")||a&&n.workflowName!==a)return;const x=n.activityName||((g=n.data)==null?void 0:g.domain)||((p=n.workflowId)==null?void 0:p.slice(0,16))||"";c(f=>[{id:++se,type:n.type,timestamp:n.timestamp,label:x},...f].slice(0,10)),d(!0),setTimeout(()=>d(!1),2e3)},[a]);return z(`${F}.>`,t),{events:r,pulse:h}}function pe(){var b,w,k,C,E;const{id:a}=Z(),r=ee(),{data:c}=W(),d=!!((b=c==null?void 0:c.ai)!=null&&b.enabled)?"Agent":"Automation",{data:t,isLoading:n}=D(a??null),{data:x}=I(a??null),m=L(),g=R(),{events:p,pulse:f}=ae((t==null?void 0:t.workflow_type)??void 0);if(K(),n)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-40 bg-surface-sunken rounded"})]});if(!t)return e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx(M,{className:"w-12 h-12 text-text-quaternary mb-4",strokeWidth:1}),e.jsxs("h2",{className:"text-lg font-medium text-text-primary mb-2",children:[d," not found"]}),e.jsxs("button",{onClick:()=>r("/agents"),className:"text-sm text-accent hover:text-accent-hover transition-colors",children:["Back to ",d.toLowerCase(),"s"]})]});const A=t.status==="active"?"bg-emerald-400":t.status==="paused"?"bg-amber-400":t.status==="error"?"bg-red-400":"bg-zinc-500",i=(x==null?void 0:x.subscriptions)??[],P=t.status==="active"?"Active":t.status==="paused"?"Paused":t.status==="error"?"Error":"Inactive",l=(w=t.behaviors)==null?void 0:w.schedules,v=(k=t.behaviors)==null?void 0:k.cron,o=(l==null?void 0:l.length)||(v?1:0),q=()=>{const s=[`Pause "${t.id}"?`,"","This will:",i.length>0?`• Stop ${i.length} event subscription${i.length!==1?"s":""}`:null,o>0?`• Stop ${o} schedule${o!==1?"s":""}`:null,"","Knowledge and workflow history are preserved. You can reactivate anytime."].filter(Boolean).join(`
2
- `);confirm(s)&&m.mutate({id:t.id,status:"paused"})},T=()=>{const s=[`Delete "${t.id}"?`,"","This permanently removes:","• The agent configuration",i.length>0?`• ${i.length} event subscription${i.length!==1?"s":""}`:null,o>0?`• ${o} schedule${o!==1?"s":""}`:null,"","Knowledge entries and workflow history are preserved."].filter(Boolean).join(`
3
- `);confirm(s)&&g.mutate(t.id,{onSuccess:()=>r("/agents")})};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("h1",{className:"text-3xl font-light text-text-primary",children:[d,": ",t.id]}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md"},className:"text-text-quaternary hover:text-accent transition-colors mt-1",title:"Docs",children:e.jsx(U,{className:"w-4 h-4",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mr-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${A}`}),e.jsx("span",{className:"text-xs text-text-secondary capitalize",children:P})]}),e.jsxs("button",{onClick:()=>r(`/agents/${t.id}/edit`),className:"flex items-center gap-1.5 px-4 py-1.5 text-xs rounded-md bg-accent text-text-inverse hover:bg-accent-hover transition-colors",children:[e.jsx(G,{className:"w-3 h-3"})," Edit"]}),t.status!=="active"&&e.jsxs("button",{onClick:()=>m.mutate({id:t.id,status:"active"}),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md text-emerald-400 hover:bg-emerald-600/10 transition-colors",children:[e.jsx(H,{className:"w-3 h-3"})," Activate"]}),t.status==="active"&&e.jsxs("button",{onClick:q,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md text-text-tertiary hover:text-text-primary hover:bg-surface-hover transition-colors",children:[e.jsx(J,{className:"w-3 h-3"})," Pause"]}),e.jsxs("button",{onClick:T,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md text-red-400/60 hover:text-red-400 hover:bg-red-600/10 transition-colors",children:[e.jsx(O,{className:"w-3 h-3"})," Delete"]})]})]}),t.description&&e.jsx("div",{className:"border-l-2 border-accent/30 pl-4 py-1 mb-10",children:e.jsx("p",{className:"text-[13px] text-text-secondary italic leading-relaxed",children:t.description})}),(t.goals||t.rules)&&e.jsxs("div",{className:"mb-10",children:[e.jsx(u,{icon:X,color:"text-rose-400",children:"Motivation"}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-14 bg-surface-sunken/20 rounded-lg px-5 py-4",children:[t.goals&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] text-text-quaternary uppercase tracking-widest mb-1.5",children:"Goals"}),e.jsx("p",{className:"text-[13px] text-text-primary leading-relaxed",children:t.goals})]}),t.rules&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] text-text-quaternary uppercase tracking-widest mb-1.5",children:"Rules"}),e.jsx("p",{className:"text-[13px] text-text-primary leading-relaxed",children:t.rules})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-x-14 gap-y-10",children:[e.jsxs("div",{children:[e.jsxs(u,{icon:$,color:"text-cyan-400",children:["Subscriptions (",i.length,")"]}),i.length===0?e.jsx(j,{text:"No event subscriptions"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:i.map(s=>e.jsxs("div",{className:"flex items-center py-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(_,{topic:s.topic})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),e.jsx(N,{type:s.reaction_type==="capability"?s.tool_name:s.workflow_type||s.reaction_type,variant:s.reaction_type==="pipeline"?"pipeline":s.reaction_type==="capability"?"capability":"durable"})]})]},s.id))})]}),e.jsxs("div",{children:[e.jsxs(u,{icon:Y,color:"text-amber-400",children:["Schedules (",o,")"]}),l!=null&&l.length?e.jsx("div",{className:"divide-y divide-surface-border/30",children:l.map((s,B)=>e.jsxs("div",{className:"flex items-center py-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(S,{cron:s.cron})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),e.jsx(N,{type:s.workflow_type||"workflow"})]})]},B))}):v?e.jsxs("div",{className:"flex items-center py-1",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(S,{cron:v})}),t.workflow_type&&e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),e.jsx(N,{type:t.workflow_type})]})]}):e.jsx(j,{text:"No schedules configured"})]}),e.jsxs("div",{className:"space-y-10",children:[e.jsxs("div",{children:[e.jsx(u,{icon:Q,color:"text-emerald-400",children:"Knowledge"}),t.knowledge_domain?e.jsxs("button",{onClick:()=>r(`/knowledge?domain=${t.knowledge_domain}`),className:"group text-left flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-mono text-text-primary group-hover:text-accent transition-colors",children:t.knowledge_domain}),e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:[((E=(C=t.stats)==null?void 0:C.knowledge_count)==null?void 0:E.toLocaleString())??0," entries"]}),e.jsx(V,{className:"w-3 h-3 text-accent opacity-0 group-hover:opacity-100 transition-opacity"})]}):e.jsx(j,{text:"No knowledge domain"})]}),e.jsxs("div",{children:[e.jsx(u,{icon:$,color:"text-cyan-400",actions:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full transition-colors duration-500 ${f?"bg-emerald-400":"bg-zinc-600"}`}),e.jsx("span",{className:"text-[10px] text-text-quaternary",children:"live"})]}),children:"Activity"}),p.length===0?e.jsx(j,{text:"Events appear here as the agent runs"}):e.jsx("div",{className:"space-y-1.5",children:p.map(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[e.jsx("span",{className:"text-[11px] text-text-primary font-mono truncate flex-1",children:s.label||"—"}),e.jsx("span",{className:"text-[10px] text-text-quaternary shrink-0 ml-2",children:te(s.timestamp)})]}),e.jsx(_,{topic:s.type})]},s.id))})]})]})]})]})}export{pe as AgentDetailPage};
4
- //# sourceMappingURL=AgentDetailPage-BPzPk2GC.js.map
@@ -1,2 +0,0 @@
1
- import{j as e}from"./vendor-query-B2UbickB.js";import{u as h}from"./agents-Ce3HmPz4.js";import{u as f,d as b}from"./index-DZX-E_3q.js";import{i as j}from"./useEventHooks-CPyvFlVR.js";import{u as v}from"./useFilterParams-DZCAaBC7.js";import{D as N}from"./DataTable-D9yuBv0w.js";import{S as y}from"./StickyPagination-F9FZsRy9.js";import{F as P,b as S}from"./FilterBar-Ck4K4rzu.js";import{P as k}from"./PageHeader-B_gV_jKk.js";import{L as _}from"./ListToolbar-DNAGFe14.js";import{Y as w}from"./vendor-icons-B_Yla7iD.js";import{c as A}from"./vendor-react-CX88sFS5.js";import"./EmptyState-BcsfPq9T.js";const $=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"paused",label:"Paused"},{value:"error",label:"Error"}],z=[{key:"name",label:"Agent",render:t=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${t.status==="active"?"bg-emerald-400":t.status==="paused"?"bg-amber-400":t.status==="error"?"bg-red-400":"bg-zinc-500"}`}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-text-primary block",children:t.id}),t.description&&e.jsx("p",{className:"text-[10px] text-text-tertiary truncate",children:t.description})]})]})},{key:"knowledge_domain",label:"Knowledge",render:t=>t.knowledge_domain?e.jsx("span",{className:"text-[10px] font-mono text-text-secondary whitespace-nowrap",children:t.knowledge_domain}):e.jsx("span",{className:"text-text-quaternary",children:"—"}),className:"w-28"},{key:"schedules",label:"Schedules",render:t=>{var i,r;const s=(i=t.behaviors)==null?void 0:i.schedules,a=s!=null&&s.length?s.map(o=>o.cron):(r=t.behaviors)!=null&&r.cron?[t.behaviors.cron]:[];return a.length?e.jsxs("span",{className:"text-[10px] font-mono text-text-secondary whitespace-nowrap",children:[a[0],a.length>1?` +${a.length-1}`:""]}):e.jsx("span",{className:"text-text-quaternary",children:"—"})},className:"w-28"},{key:"subscriptions",label:"Subscriptions",render:t=>{var r;const s=t.subscription_count??0,a=t.sub_topics??[];if(!s)return e.jsx("span",{className:"text-text-quaternary",children:"—"});const i=((r=a[0])==null?void 0:r.replace(/^lt\.events\./,""))??"";return e.jsxs("span",{className:"text-[10px] font-mono text-text-secondary whitespace-nowrap",children:[i,s>1?` +${s-1}`:""]})},className:"w-36"},{key:"last_run_at",label:"Last Run",render:t=>t.last_run_at?e.jsx("span",{className:"whitespace-nowrap",children:e.jsx(b,{date:t.last_run_at})}):e.jsx("span",{className:"text-text-quaternary",children:"—"}),className:"w-32"}];function M(){var u;const t=A(),{data:s}=f(),a=!!((u=s==null?void 0:s.ai)!=null&&u.enabled),i=a?"Agent":"Automation",r=a?"Agents":"Automations";j();const{filters:o,setFilter:p,pagination:n}=v({filters:{status:""}}),{data:l,isLoading:d,refetch:x,isFetching:g}=h({status:o.status||void 0,limit:n.pageSize,offset:n.offset}),m=(l==null?void 0:l.total)??0;return e.jsxs("div",{children:[e.jsx(k,{title:r,docsHash:"#docs:agents.md",actions:e.jsxs("button",{onClick:()=>t("/agents/new"),className:"flex items-center gap-2 px-4 py-2 text-sm rounded-md bg-accent text-text-inverse hover:bg-accent-hover transition-colors",children:[e.jsx(w,{className:"w-4 h-4"})," Create ",i]})}),e.jsx(P,{actions:e.jsx(_,{onRefresh:()=>x(),isFetching:g,apiPath:`/agents?limit=${n.pageSize}&offset=${n.offset}${o.status?`&status=${o.status}`:""}`}),children:e.jsx(S,{label:"Status",value:o.status,onChange:c=>p("status",c),options:$})}),e.jsx(N,{columns:z,data:(l==null?void 0:l.agents)??[],keyFn:c=>c.id,onRowClick:c=>t(`/agents/${c.id}`),isLoading:d,emptyMessage:"No agents found"}),e.jsx(y,{page:n.page,totalPages:n.totalPages(m),onPageChange:n.setPage,total:m,pageSize:n.pageSize,onPageSizeChange:n.setPageSize})]})}export{M as AgentsPage};
2
- //# sourceMappingURL=AgentsPage-CLcxJWjC.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,a as r}from"./vendor-query-B2UbickB.js";import{j as V,g as xe,k as ge,l as he,m as pe,n as fe,o as ye,p as be,q as je,r as ve}from"./index-DZX-E_3q.js";import{f as Ce}from"./useEventHooks-CPyvFlVR.js";import{u as Se}from"./roles-Dtj0uabn.js";import{u as ke}from"./useFilterParams-DZCAaBC7.js";import{D as Ne}from"./DataTable-D9yuBv0w.js";import{S as Pe}from"./StickyPagination-F9FZsRy9.js";import{P as Ae}from"./PageHeader-B_gV_jKk.js";import{P as we}from"./constants-BHkpVaqx.js";import{u as U,C as G}from"./CustomDurationPicker-BIQWzbv0.js";import{M as D}from"./Modal-DEODGeqx.js";import{u as Ee}from"./users-XZ349b0r.js";import{E as Be,a as Te}from"./escalation-columns-C0slywOY.js";import{R as Me,a as Fe}from"./RowActions-Dg-Fsm5O.js";import{L as Ie}from"./ListToolbar-DNAGFe14.js";import{a1 as _e}from"./vendor-icons-B_Yla7iD.js";import{c as $e}from"./vendor-react-CX88sFS5.js";import"./EmptyState-BcsfPq9T.js";import"./FilterBar-Ck4K4rzu.js";import"./PriorityBadge-DfQY9St9.js";import"./RolePill-BOBytzrP.js";import"./WorkflowPill-Bg2-0Hkg.js";import"./TimestampCell-Bi2nc9Q_.js";import"./escalation-DilnDxw2.js";const ze=s=>s.isPriorityPending||s.isClaimPending||s.isAssignPending||s.isEscalatePending||s.isTriagePending;function Le(s){const i=ze(s),c=U();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-4 py-3 bg-accent/5 border border-accent/20 rounded-lg mb-4",children:[e.jsxs("span",{className:"text-xs font-medium text-accent",children:[s.selectedCount," selected"]}),e.jsx("div",{className:"w-px h-5 bg-surface-border"}),e.jsxs("select",{onChange:t=>{t.target.value&&(s.onSetPriority(parseInt(t.target.value)),t.target.value="")},disabled:i,className:"select text-xs py-1.5",defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Priority..."}),we.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))]}),e.jsxs("select",{onChange:t=>{t.target.value&&(s.onClaim(parseInt(t.target.value)),t.target.value="")},disabled:i,className:"select text-xs py-1.5",defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Claim for..."}),c.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))]}),e.jsx("button",{onClick:s.onAssign,disabled:i,className:"btn-secondary text-xs py-1.5",children:s.isAssignPending?"Assigning...":"Assign to..."}),s.availableRoles.length>0&&e.jsxs("select",{onChange:t=>{t.target.value&&(s.onEscalate(t.target.value),t.target.value="")},disabled:i,className:"select text-xs py-1.5",defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Escalate to..."}),s.availableRoles.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsx("button",{onClick:s.onTriage,disabled:i,className:"btn-secondary text-xs py-1.5",children:s.isTriagePending?"Triaging...":"Triage"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:s.onClearSelection,className:"text-xs text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),i&&e.jsx("span",{className:"text-xs text-text-tertiary animate-pulse",children:"Processing..."})]})}function Re({open:s,onClose:i,selectedCount:c,selectedRoles:t,onSubmit:h,isPending:l}){const{isSuperAdmin:m}=V(),o=U(),[d,y]=r.useState("user"),[p,k]=r.useState(null),[N,E]=r.useState(""),[S,_]=r.useState("30"),[u,g]=r.useState(0),R=r.useCallback(n=>g(n),[]),B=!m&&t.length===1?t[0]:void 0,{data:b,isLoading:P}=Ee({role:B,status:"active",limit:200}),T=r.useMemo(()=>{const n=(b==null?void 0:b.users)??[];if(!N.trim())return n;const f=N.toLowerCase();return n.filter(A=>{var j,v;return((j=A.display_name)==null?void 0:j.toLowerCase().includes(f))||((v=A.email)==null?void 0:v.toLowerCase().includes(f))})},[b==null?void 0:b.users,N]),M=()=>{y("user"),k(null),E(""),_("30"),g(0),i()},$=n=>{k(n),y("duration")},F=()=>{y("user")},z=()=>{if(!p)return;const n=S==="custom"?u:parseInt(S);!n||n<=0||h(p.id,n)};return e.jsx(D,{open:s,onClose:M,title:"Assign Escalations",children:e.jsxs("div",{className:"space-y-4",children:[d==="user"&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Select a user to assign"," ",e.jsx("span",{className:"font-medium text-text-primary",children:c})," ","escalation(s) to:"]}),e.jsx("input",{type:"text",value:N,onChange:n=>E(n.target.value),placeholder:"Search by name or email...",className:"input text-xs w-full",autoFocus:!0}),e.jsxs("div",{className:"max-h-60 overflow-y-auto border border-surface-border rounded-lg divide-y divide-surface-border",children:[P&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"Loading users..."}),!P&&T.length===0&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"No users found"}),T.map(n=>e.jsxs("button",{onClick:()=>$(n),className:"w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors",children:[e.jsx("p",{className:"text-xs font-medium text-text-primary",children:n.display_name||n.external_id}),n.email&&e.jsx("p",{className:"text-[10px] text-text-tertiary",children:n.email})]},n.id))]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx("button",{onClick:M,className:"btn-secondary text-xs",children:"Cancel"})})]}),d==="duration"&&p&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Assign to"," ",e.jsx("span",{className:"font-medium text-text-primary",children:p.display_name||p.external_id})," ","for:"]}),e.jsxs("select",{value:S,onChange:n=>{_(n.target.value),g(0)},className:"select w-full text-sm",children:[o.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),S==="custom"&&e.jsx(G,{onChange:R,autoFocus:!0}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:F,className:"btn-secondary text-xs",children:"Back"}),e.jsx("button",{onClick:z,disabled:l,className:"btn-primary text-xs",children:l?"Assigning...":"Assign"})]})]})]})})}function Oe({open:s,onClose:i,selectedCount:c,onSubmit:t,isPending:h}){const[l,m]=r.useState(""),o=()=>{t(l||void 0)};return e.jsx(D,{open:s,onClose:i,title:"Submit for AI Triage",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Submit ",e.jsx("span",{className:"font-medium text-text-primary",children:c})," escalation(s) for AI triage? The triage orchestrator will take over resolution."]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium text-text-secondary block mb-1",children:["Triage hint ",e.jsx("span",{className:"text-text-tertiary",children:"(optional)"})]}),e.jsx("input",{type:"text",value:l,onChange:d=>m(d.target.value),placeholder:"e.g., image_orientation",className:"input text-xs font-mono w-full"}),e.jsx("p",{className:"text-[10px] text-text-tertiary mt-1",children:"Guides the triage workflow on what remediation to apply"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:i,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:o,disabled:h,className:"btn-primary text-xs",children:h?"Submitting...":"Submit for Triage"})]})]})})}function I(s,i,c){return t=>{s.mutate(t,{onSuccess:()=>{i(),c==null||c()}})}}function Ue(s){const i=()=>[...s.selectedIds];return{handleSetPriority:o=>{I(s.setPriority,s.clearSelection)({ids:i(),priority:o})},handleBulkClaim:o=>{I(s.bulkClaim,s.clearSelection)({ids:i(),durationMinutes:o})},handleBulkEscalate:o=>{I(s.bulkEscalate,s.clearSelection)({ids:i(),targetRole:o})},handleBulkTriage:o=>{I(s.bulkTriage,s.clearSelection,s.closeTriageModal)({ids:i(),hint:o})},handleBulkAssign:(o,d)=>{I(s.bulkAssign,s.clearSelection,s.closeAssignModal)({ids:i(),targetUserId:o,durationMinutes:d})}}}function De({claimTarget:s,onClose:i,claimDuration:c,onDurationChange:t,claimDurations:h,onCustomClaimChange:l,onClaim:m,isPending:o}){return e.jsx(D,{open:!!s,onClose:i,title:"Claim Escalation",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Claim ",e.jsx("span",{className:"font-medium text-text-primary",children:s==null?void 0:s.type})," for:"]}),e.jsxs("select",{value:c,onChange:d=>{t(d.target.value)},className:"select w-full text-sm",children:[h.map(d=>e.jsx("option",{value:d.value,children:d.label},d.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),c==="custom"&&e.jsx(G,{onChange:l,autoFocus:!0}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:i,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:m,className:"btn-primary text-xs",disabled:o,children:o?"Claiming...":"Claim"})]})]})})}function xt(){Ce();const s=$e(),{user:i,isSuperAdmin:c}=V(),{filters:t,setFilter:h,pagination:l,sort:m,setSort:o}=ke({filters:{role:"",type:"",priority:"",status:"available"}}),d=U(),[y,p]=r.useState(null),[k,N]=r.useState("30"),[E,S]=r.useState(0),_=r.useCallback(a=>S(a),[]),[u,g]=r.useState(new Set),[R,B]=r.useState(!1),[b,P]=r.useState(!1),T=xe(),M=ge(),$=he(),F=pe(),z=fe(),n=ye(),{data:f}=Se(),{data:A}=be();r.useEffect(()=>{g(new Set)},[t.role,t.type,t.priority,t.status,l.page,l.pageSize]);const j=t.status||"",v=j==="available",O=j==="claimed"?"pending":j==="resolved"?"resolved":void 0,H={role:t.role||void 0,type:t.type||void 0,priority:t.priority?parseInt(t.priority):void 0,limit:l.pageSize,offset:l.offset,sort_by:m.sort_by||void 0,order:m.sort_by?m.order:void 0},Y=je({...H,enabled:v}),J=ve({status:O,...H,enabled:!v}),K=v?Y:J,{data:w,isLoading:W,error:L,refetch:X,isFetching:Z}=K,ee=new Date,q=(w==null?void 0:w.escalations)??[],C=j==="claimed"?q.filter(a=>a.assigned_to&&a.assigned_until&&new Date(a.assigned_until)>ee):q,Q=j==="claimed"?C.length:(w==null?void 0:w.total)??0,te=c||(i==null?void 0:i.roles.some(a=>a.type==="admin")),se=r.useMemo(()=>{const a=new Set;for(const x of C)u.has(x.id)&&a.add(x.role);return[...a]},[C,u]),ae=r.useCallback(()=>g(new Set),[]),ne=()=>{if(!y)return;const a=k==="custom"?E:parseInt(k);!a||a<=0||T.mutate({id:y.id,durationMinutes:a},{onSuccess:()=>{p(null),s(`/escalations/detail/${y.id}`)}})},{handleSetPriority:ie,handleBulkClaim:le,handleBulkEscalate:oe,handleBulkTriage:re,handleBulkAssign:ce}=Ue({selectedIds:u,clearSelection:ae,setPriority:M,bulkClaim:$,bulkEscalate:z,bulkTriage:n,bulkAssign:F,closeTriageModal:()=>B(!1),closeAssignModal:()=>P(!1)}),de=a=>{const x=new Set(u);x.has(a)?x.delete(a):x.add(a),g(x)},ue=()=>{u.size===C.length?g(new Set):g(new Set(C.map(a=>a.id)))},me=[te?{key:"select",label:e.jsx("input",{type:"checkbox",checked:C.length>0&&u.size===C.length,onChange:ue,className:"rounded"}),render:a=>e.jsx("input",{type:"checkbox",checked:u.has(a.id),onChange:x=>{x.stopPropagation(),de(a.id)},onClick:x=>x.stopPropagation(),className:"rounded"}),className:"w-10"}:{key:"spacer",label:"",render:()=>null,className:"w-10"},...Be,{key:"actions",label:"",render:a=>e.jsx(Me,{children:e.jsx(Fe,{icon:_e,title:"Claim escalation",onClick:()=>p(a)})}),className:"w-16 text-right"}];return e.jsxs("div",{children:[e.jsx(Ae,{title:"All Escalations",docsHash:"#docs:dashboard.md:all-escalations"}),e.jsx(Te,{filters:t,setFilter:h,roles:(f==null?void 0:f.roles)??[],types:(A==null?void 0:A.types)??[],showStatus:!0,actions:e.jsx(Ie,{onRefresh:()=>X(),isFetching:Z,apiPath:`/escalations${v?"/available":""}?limit=${l.pageSize}&offset=${l.offset}${O?`&status=${O}`:""}${t.role?`&role=${t.role}`:""}${t.type?`&type=${t.type}`:""}${t.priority?`&priority=${t.priority}`:""}`})}),u.size>0&&e.jsx(Le,{selectedCount:u.size,onClearSelection:()=>g(new Set),onSetPriority:ie,onClaim:le,onAssign:()=>P(!0),onEscalate:oe,onTriage:()=>B(!0),isPriorityPending:M.isPending,isClaimPending:$.isPending,isAssignPending:F.isPending,isEscalatePending:z.isPending,isTriagePending:n.isPending,availableRoles:(f==null?void 0:f.roles)??[]}),L&&e.jsx("div",{className:"mb-4 px-4 py-3 rounded-md bg-status-error/10 border border-status-error/20 text-xs text-status-error",children:L.message==="Session expired"?"Your session has expired. Please log in again.":`Failed to load escalations: ${L.message}`}),e.jsx(Ne,{columns:me,data:C,keyFn:a=>a.id,onRowClick:a=>s(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),isLoading:W,emptyMessage:L?"Unable to load data":"No available escalations",sort:m,onSort:o}),e.jsx(Pe,{page:l.page,totalPages:l.totalPages(Q),onPageChange:l.setPage,total:Q,pageSize:l.pageSize,onPageSizeChange:l.setPageSize}),e.jsx(De,{claimTarget:y,onClose:()=>p(null),claimDuration:k,onDurationChange:a=>{N(a),S(0)},claimDurations:d,customClaimMinutes:E,onCustomClaimChange:_,onClaim:ne,isPending:T.isPending}),e.jsx(Oe,{open:R,onClose:()=>B(!1),selectedCount:u.size,onSubmit:re,isPending:n.isPending}),e.jsx(Re,{open:b,onClose:()=>P(!1),selectedCount:u.size,selectedRoles:se,onSubmit:ce,isPending:F.isPending})]})}export{xt as AvailableEscalationsPage};
2
- //# sourceMappingURL=AvailableEscalationsPage-hOcjAAIj.js.map
@@ -1,2 +0,0 @@
1
- import{a as m,j as e}from"./vendor-query-B2UbickB.js";import{h as j}from"./bots-B0BomNnf.js";import{a as d,X as y,a9 as u,i as N,K as p}from"./vendor-icons-B_Yla7iD.js";function k({selected:s,onChange:n,placeholder:f}){const{data:c}=j({limit:100}),l=((c==null?void 0:c.bots)??[]).filter(t=>t.status==="active"),[o,r]=m.useState(!1),i=m.useRef(null);m.useEffect(()=>{const t=a=>{i.current&&!i.current.contains(a.target)&&r(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]);const x=l.find(t=>t.external_id===s),h=f??"Invoking user (default)";return e.jsxs("div",{ref:i,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>r(!o),className:"flex items-center gap-1.5 w-full px-1 py-1.5 bg-transparent border-b border-surface-border/60 text-left cursor-pointer hover:border-accent/50 transition-colors focus:outline-none focus:border-accent/50",children:[s&&x?e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-accent/[0.08] text-text-secondary text-[11px]",children:[e.jsx(d,{className:"w-2.5 h-2.5 shrink-0 text-accent/75"}),x.display_name||x.external_id,e.jsx("span",{role:"button",onClick:t=>{t.stopPropagation(),n("")},className:"ml-0.5 hover:text-status-error transition-colors",children:e.jsx(y,{className:"w-2.5 h-2.5"})})]}):e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-text-tertiary",children:[e.jsx(u,{className:"w-3 h-3 shrink-0"}),h]}),e.jsx(N,{className:`w-3.5 h-3.5 ml-auto shrink-0 text-text-tertiary transition-transform ${o?"rotate-180":""}`})]}),o&&e.jsxs("div",{className:"absolute z-20 mt-1 w-full bg-surface-raised border border-surface-border rounded-md shadow-lg max-h-48 overflow-y-auto",children:[e.jsxs("button",{type:"button",onClick:()=>{n(""),r(!1)},className:`flex items-center gap-2 w-full px-3 py-1.5 text-left text-xs transition-colors ${s?"text-text-primary hover:bg-surface-sunken":"bg-accent/[0.06] text-accent"}`,children:[e.jsx(u,{className:"w-3 h-3 shrink-0 text-text-tertiary"}),e.jsx("span",{className:"flex-1",children:"Invoking user"}),!s&&e.jsx(p,{className:"w-3 h-3 shrink-0"})]}),l.length===0?e.jsx("p",{className:"px-3 py-2 text-xs text-text-tertiary",children:"No bot accounts"}):l.map(t=>{const a=s===t.external_id;return e.jsxs("button",{type:"button",onClick:()=>{n(t.external_id),r(!1)},className:`flex items-center gap-2 w-full px-3 py-1.5 text-left text-xs transition-colors ${a?"bg-accent/[0.06] text-accent":"text-text-primary hover:bg-surface-sunken"}`,children:[e.jsx(d,{className:"w-3 h-3 shrink-0 text-accent/60"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{children:t.display_name||t.external_id}),t.display_name&&t.display_name!==t.external_id&&e.jsx("span",{className:"ml-1 text-text-tertiary font-mono",children:t.external_id})]}),a&&e.jsx(p,{className:"w-3 h-3 shrink-0"})]},t.id)})]})]})}export{k as B};
2
- //# sourceMappingURL=BotPicker-DuAZgHbJ.js.map
@@ -1,2 +0,0 @@
1
- import{a as p,j as e}from"./vendor-query-B2UbickB.js";import{u as N}from"./capabilities-t-w5N9K9.js";import{T as y}from"./ToolTestPanel-Dl3C53zb.js";import{T as g}from"./ToolPill-CuoXcmhv.js";import{S as b}from"./ServerName-uqa4eBqm.js";import{P as w}from"./PageHeader-B_gV_jKk.js";import{aH as v,B as k,f as C,aI as S,aJ as T,D as I,as as q,ad as A,u as P,aK as $,P as E}from"./vendor-icons-B_Yla7iD.js";import"./index-DZX-E_3q.js";import"./vendor-react-CX88sFS5.js";import"./mcp-CjXjDZI0.js";import"./RunAsSelector-_QbJKhlo.js";import"./BotPicker-DuAZgHbJ.js";import"./bots-B0BomNnf.js";const u={Communication:{icon:P,color:"text-blue-400"},Analysis:{icon:A,color:"text-violet-400"},Media:{icon:q,color:"text-pink-400"},Data:{icon:I,color:"text-emerald-400"},Automation:{icon:T,color:"text-amber-400"},Development:{icon:S,color:"text-cyan-400"},System:{icon:C,color:"text-red-400"},Reference:{icon:k,color:"text-text-tertiary"},Other:{icon:v,color:"text-text-tertiary"}};function _(){const{data:r,isLoading:l}=N(),[i,m]=p.useState(""),[a,x]=p.useState(null),[c,h]=p.useState(null),d=(r==null?void 0:r.categories)??[],j=(r==null?void 0:r.totalTools)??0,f=p.useMemo(()=>{let s=d;if(a&&(s=s.filter(n=>n.name===a)),!i.trim())return s;const o=i.toLowerCase();return s.map(n=>({...n,tools:n.tools.filter(t=>t.name.toLowerCase().includes(o)||t.description.toLowerCase().includes(o)||t.serverName.toLowerCase().includes(o))})).filter(n=>n.tools.length>0)},[d,i,a]);return e.jsxs("div",{children:[e.jsx(w,{title:"Capabilities"}),!l&&d.length>0&&e.jsxs("div",{className:"flex items-center gap-5 mb-10",children:[e.jsxs("button",{onClick:()=>x(null),className:`flex flex-col items-center gap-1 transition-colors ${a===null?"text-accent":"text-text-quaternary hover:text-text-secondary"}`,children:[e.jsx(v,{className:"w-5 h-5",strokeWidth:1.5}),e.jsx("span",{className:"text-[9px] font-medium",children:"All"})]}),d.map(s=>{const o=u[s.name]??u.Other,n=o.icon,t=a===s.name;return e.jsxs("button",{onClick:()=>x(t?null:s.name),className:`flex flex-col items-center gap-1 transition-colors ${t?o.color:"text-text-quaternary hover:text-text-secondary"}`,children:[e.jsx(n,{className:"w-5 h-5",strokeWidth:1.5}),e.jsx("span",{className:"text-[9px] font-medium",children:s.name})]},s.name)}),e.jsx("span",{className:"flex-1"}),e.jsxs("div",{className:"relative",children:[e.jsx($,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-quaternary"}),e.jsx("input",{type:"text",value:i,onChange:s=>m(s.target.value),placeholder:`Search ${j} capabilities...`,className:"pl-9 pr-3 py-1.5 text-sm bg-surface-sunken border border-surface-border rounded-md text-text-primary placeholder:text-text-quaternary focus:outline-none focus:ring-1 focus:ring-accent/50 w-56"})]})]}),e.jsxs("div",{className:"flex gap-0",children:[e.jsx("div",{className:`${c?"flex-1 min-w-0":"w-full"} transition-all`,children:l?e.jsx("div",{className:"animate-pulse space-y-6",children:[1,2,3].map(s=>e.jsxs("div",{children:[e.jsx("div",{className:"h-5 bg-surface-sunken rounded w-32 mb-4"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),e.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"})]})]},s))}):f.length===0?e.jsx("p",{className:"text-sm text-text-tertiary mt-8",children:i||a?"No capabilities match your filter.":"No capabilities registered yet."}):e.jsx("div",{className:"space-y-10",children:f.map(s=>{const o=u[s.name]??u.Other,n=o.icon;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4 pb-2 border-b border-surface-border",children:[e.jsx(n,{className:`w-4.5 h-4.5 ${o.color}`,strokeWidth:1.5}),e.jsx("h2",{className:"text-sm font-semibold uppercase tracking-widest text-accent/80",children:s.name}),e.jsx("span",{className:"text-xs text-text-quaternary",children:s.tools.length})]}),e.jsx("div",{className:"space-y-0.5",children:s.tools.map(t=>e.jsx(L,{tool:t,onTry:()=>h({serverId:t.serverId,serverName:t.serverName,tool:{name:t.name,description:t.description,inputSchema:t.inputSchema}})},`${t.serverId}-${t.name}`))})]},s.name)})})}),c&&e.jsx("div",{className:"w-[380px] shrink-0 sticky top-0 max-h-screen overflow-y-auto",children:e.jsx(y,{serverId:c.serverId,serverName:c.serverName,tool:c.tool,onClose:()=>h(null)})})]})]})}function L({tool:r,onTry:l}){var m;const i=Object.keys(((m=r.inputSchema)==null?void 0:m.properties)??{});return e.jsxs("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&l()},className:"group w-full py-2 px-2 rounded-md hover:bg-surface-hover transition-colors text-left flex gap-4 items-start cursor-pointer",children:[e.jsx("div",{className:"w-56 shrink-0",children:e.jsx(g,{name:r.name,size:"md"})}),e.jsx("div",{className:"w-44 shrink-0 pt-0.5",children:i.length>0&&e.jsx("p",{className:"text-[9px] font-mono text-text-quaternary/70 leading-relaxed",children:i.map((a,x)=>x<i.length-1?e.jsxs("span",{children:[e.jsxs("span",{className:"whitespace-nowrap",children:[a," ·"]})," "]},a):e.jsx("span",{children:a},a))})}),e.jsx("p",{className:"text-[11px] text-text-tertiary leading-relaxed flex-1 pt-0.5",children:r.description}),e.jsxs("div",{className:"shrink-0 flex items-center gap-1.5 pt-0.5",children:[e.jsx(b,{name:r.serverName,serverId:r.serverId}),e.jsx(E,{className:"w-2.5 h-2.5 text-accent opacity-0 group-hover:opacity-100 transition-opacity"})]})]})}export{_ as CapabilitiesPage};
2
- //# sourceMappingURL=CapabilitiesPage-PRel6TXd.js.map
@@ -1,2 +0,0 @@
1
- import{j as t}from"./vendor-query-B2UbickB.js";import{C as a}from"./index-DZX-E_3q.js";function c({title:r,sectionKey:s,isCollapsed:e,onToggle:o,contentClassName:n,children:i}){return t.jsxs("div",{children:[t.jsxs("button",{onClick:()=>o(s),className:"flex items-center gap-3 w-full group/section",children:[t.jsx("svg",{className:`w-4 h-4 shrink-0 text-text-tertiary/40 group-hover/section:text-text-tertiary transition-all duration-200 ${e?"":"rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),t.jsx("span",{className:`text-xs font-semibold uppercase tracking-widest transition-colors duration-200 ${e?"text-text-tertiary":"text-text-secondary"}`,children:r}),t.jsx("span",{className:"flex-1 border-b border-surface-border"})]}),t.jsx(a,{open:!e,children:t.jsx("div",{className:n??"mt-4 ml-7",children:i})})]})}export{c as C};
2
- //# sourceMappingURL=CollapsibleSection-DnoUFQVf.js.map
@@ -1,2 +0,0 @@
1
- import{j as e}from"./vendor-query-B2UbickB.js";import{M as l}from"./Modal-DEODGeqx.js";function d({open:r,onClose:t,onConfirm:x,title:c,description:i,isPending:s,error:a}){return e.jsx(l,{open:r,onClose:t,title:c,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-secondary",children:i}),a&&e.jsx("p",{className:"text-xs text-status-error",children:a.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:t,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:x,className:"bg-status-error text-white px-3 py-1.5 rounded-md text-xs hover:opacity-90 transition-opacity",disabled:s,children:s?"Deleting...":"Delete"})]})]})})}export{d as C};
2
- //# sourceMappingURL=ConfirmDeleteModal-dOxidrSR.js.map
@@ -1,2 +0,0 @@
1
- import{a as x,j as t}from"./vendor-query-B2UbickB.js";import{c as d}from"./vendor-react-CX88sFS5.js";const u=20;function h(e,o=u){if(e.length<=o)return e;const r=Math.floor((o-1)/2);return`${e.slice(0,r)}…${e.slice(-r)}`}function j({label:e,value:o,href:r,external:c}){const[s,i]=x.useState(!1),l=d();if(!o)return null;const a=n=>{n.stopPropagation(),navigator.clipboard.writeText(o),i(!0),setTimeout(()=>i(!1),1500)},p=n=>{n.stopPropagation(),r&&(c?window.open(r,"_blank","noopener,noreferrer"):l(r))};return t.jsxs("div",{className:"text-left group relative",children:[t.jsx("span",{className:"text-[11px] font-medium text-text-secondary uppercase tracking-wide",children:e}),t.jsxs("span",{className:"flex items-center gap-1 mt-0.5",children:[t.jsx("button",{onClick:a,title:o,className:"text-[12px] font-mono text-text-primary group-hover:text-accent transition-colors",children:h(o)}),t.jsx("button",{onClick:a,title:"Copy",className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 p-0.5",children:t.jsx("svg",{className:`w-3 h-3 transition-colors ${s?"text-status-success":"text-text-tertiary hover:text-text-primary"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s?t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}):t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3"})})}),r&&t.jsx("button",{onClick:p,title:`View ${e}`,className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 p-0.5",children:t.jsx("svg",{className:"w-3 h-3 text-text-tertiary hover:text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101M10.172 13.828a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})})]})]})}export{j as C};
2
- //# sourceMappingURL=CopyableId-D0SQ39nR.js.map
@@ -1,2 +0,0 @@
1
- import{a as i,j as e}from"./vendor-query-B2UbickB.js";import{A as y,B as N,O as p,E as f}from"./index-DZX-E_3q.js";import{P as C}from"./PageHeader-B_gV_jKk.js";import{T as k}from"./TimeAgo-W7TdJpV-.js";import{C as A}from"./ConfirmDeleteModal-dOxidrSR.js";import{Y as w,i as P,ah as O,n as T}from"./vendor-icons-B_Yla7iD.js";import"./vendor-react-CX88sFS5.js";import"./Modal-DEODGeqx.js";const o={anthropic:{name:"Anthropic",helpText:'Run "claude setup-token" for an OAuth token, or use an API key from console.anthropic.com.',placeholder:"sk-ant-oat01-... or sk-ant-api03-..."},openai:{name:"OpenAI",helpText:"Create an API key at platform.openai.com/api-keys.",placeholder:"sk-..."},google:{name:"Google",helpText:"Connect your Google account for Gmail, Calendar, and Drive access.",placeholder:"",oauth:!0}};function U(){var d,x;const{data:r,isLoading:m}=y(),n=N(),[a,l]=i.useState(null),[h,u]=i.useState(!1),[s,j]=i.useState("anthropic"),c=(r==null?void 0:r.connections)??[],b=()=>{a&&n.mutate({provider:a.provider,label:a.label},{onSuccess:()=>l(null)})},v=t=>`/api/auth/oauth/connect/${t}?token=${encodeURIComponent(f()||"")}&returnTo=/credentials`;return e.jsxs("div",{children:[e.jsx(C,{title:"Credentials",docsHash:"#docs:dashboard.md:credentials",actions:e.jsxs("button",{onClick:()=>u(t=>!t),className:"btn-primary text-xs inline-flex items-center gap-1.5",children:[e.jsx(w,{className:"w-3.5 h-3.5"}),"Add Credential"]})}),e.jsx("p",{className:"text-sm text-text-secondary mb-6",children:"Manage credentials used by tools when invoked on your behalf. Each credential is encrypted at rest and resolved automatically during tool execution."}),h&&e.jsxs("div",{className:"mb-6 p-4 bg-surface-raised border border-surface-border rounded-md space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("label",{className:"text-xs text-text-secondary font-medium",children:"Provider"}),e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:s,onChange:t=>j(t.target.value),className:"input text-xs pr-7 appearance-none",children:Object.entries(o).map(([t,g])=>e.jsx("option",{value:t,children:g.name},t))}),e.jsx(P,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-text-tertiary pointer-events-none"})]})]}),e.jsx("p",{className:"text-xs text-text-tertiary",children:(d=o[s])==null?void 0:d.helpText}),e.jsxs("a",{href:v(s),className:"btn-primary text-xs inline-flex items-center gap-1.5",children:[e.jsx(p,{provider:s,className:"w-3.5 h-3.5"}),"Connect ",(x=o[s])==null?void 0:x.name]})]}),m?e.jsx("div",{className:"animate-pulse space-y-3",children:[1,2].map(t=>e.jsx("div",{className:"h-16 bg-surface-sunken rounded"},t))}):c.length===0?e.jsxs("div",{className:"text-center py-16 text-text-tertiary",children:[e.jsx(O,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No credentials registered."}),e.jsx("p",{className:"text-xs mt-1",children:"Add a credential to enable tool authentication."})]}):e.jsx("div",{className:"space-y-2",children:c.map(t=>e.jsxs("div",{className:"group/row flex items-center gap-4 px-4 py-3 bg-surface-raised border border-surface-border rounded-md",children:[e.jsx(p,{provider:t.provider,className:"w-6 h-6 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-text-primary font-medium capitalize",children:t.provider}),t.label!=="default"&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-surface-sunken rounded text-text-tertiary",children:t.label}),t.credential_type&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-accent-faint rounded text-accent",children:t.credential_type})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[t.email&&e.jsx("span",{className:"text-xs text-text-tertiary",children:t.email}),t.expires_at&&e.jsxs("span",{className:"text-xs text-text-tertiary",children:["Expires ",e.jsx(k,{date:t.expires_at})]})]})]}),e.jsx("button",{onClick:()=>l({provider:t.provider,label:t.label}),className:"opacity-0 group-hover/row:opacity-100 transition-opacity text-text-tertiary hover:text-status-error",title:"Revoke credential",children:e.jsx(T,{className:"w-4 h-4"})})]},`${t.provider}-${t.label}`))}),e.jsx(A,{open:!!a,onClose:()=>l(null),onConfirm:b,title:"Revoke Credential",description:e.jsxs(e.Fragment,{children:["Revoke the"," ",e.jsx("span",{className:"font-medium text-text-primary capitalize",children:a==null?void 0:a.provider}),(a==null?void 0:a.label)!=="default"&&e.jsxs(e.Fragment,{children:[" (",a==null?void 0:a.label,")"]})," ","credential? Tools will no longer be able to use this credential."]}),isPending:n.isPending,error:n.error})]})}export{U as CredentialsPage};
2
- //# sourceMappingURL=CredentialsPage-CqedUU7b.js.map
@@ -1,2 +0,0 @@
1
- import{u as o,b as i,c as r,j as u}from"./vendor-query-B2UbickB.js";import{b as n}from"./index-DZX-E_3q.js";import{a4 as c}from"./vendor-icons-B_Yla7iD.js";function l(e){return o({queryKey:["agent-subscriptions",e],queryFn:()=>n(`/agents/${e}/subscriptions`),enabled:!!e})}function m(){const e=i();return r({mutationFn:({agentId:s,...t})=>n(`/agents/${s}/subscriptions`,{method:"POST",body:JSON.stringify(t)}),onSuccess:(s,t)=>{e.invalidateQueries({queryKey:["agent-subscriptions",t.agentId]}),e.invalidateQueries({queryKey:["agents"]})}})}function d(){const e=i();return r({mutationFn:({agentId:s,subId:t,...a})=>n(`/agents/${s}/subscriptions/${t}`,{method:"PUT",body:JSON.stringify(a)}),onSuccess:(s,t)=>{e.invalidateQueries({queryKey:["agent-subscriptions",t.agentId]})}})}function g(){const e=i();return r({mutationFn:({agentId:s,subId:t})=>n(`/agents/${s}/subscriptions/${t}`,{method:"DELETE"}),onSuccess:(s,t)=>{e.invalidateQueries({queryKey:["agent-subscriptions",t.agentId]}),e.invalidateQueries({queryKey:["agents"]})}})}function f({cron:e}){return u.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono text-text-secondary",children:[u.jsx(c,{className:"w-2.5 h-2.5 shrink-0 text-text-quaternary",strokeWidth:1.5}),e]})}export{f as C,m as a,d as b,g as c,l as u};
2
- //# sourceMappingURL=CronLabel-CPEjE-mH.js.map
@@ -1,2 +0,0 @@
1
- import{a as u,j as i}from"./vendor-query-B2UbickB.js";import{u as x}from"./index-DZX-E_3q.js";import{D as d,f as v}from"./constants-BHkpVaqx.js";function j(){const{data:e}=x();return u.useMemo(()=>{var n;return(((n=e==null?void 0:e.escalation)==null?void 0:n.claimDurations)??d).map(a=>({value:String(a),label:v(a)}))},[e])}const f=[{value:1,label:"minutes"},{value:60,label:"hours"}];function C({onChange:e,compact:r,autoFocus:n,"data-testid":a="custom-duration-input"}){const[l,m]=u.useState(""),[s,c]=u.useState(1);u.useEffect(()=>{const t=parseInt(l);e(t>0?t*s:0)},[l,s,e]);const o=r?"text-xs":"text-sm",p=r?"w-16":"w-20";return i.jsxs("div",{className:"flex items-center gap-2","data-testid":a,children:[i.jsx("input",{type:"number",min:1,max:s===60?24:1440,value:l,onChange:t=>m(t.target.value),placeholder:s===60?"hrs":"min",className:`input ${o} ${p} text-center`,autoFocus:n,"data-testid":`${a}-quantity`}),i.jsx("select",{value:s,onChange:t=>c(parseInt(t.target.value)),className:`select ${o} py-1`,"data-testid":`${a}-unit`,children:f.map(t=>i.jsx("option",{value:t.value,children:t.label},t.value))})]})}export{C,j as u};
2
- //# sourceMappingURL=CustomDurationPicker-BIQWzbv0.js.map
@@ -1,2 +0,0 @@
1
- import{j as e}from"./vendor-query-B2UbickB.js";import{E as b}from"./EmptyState-BcsfPq9T.js";function j({active:s,direction:a}){return e.jsx("svg",{className:`w-3 h-3 shrink-0 transition-all duration-150 ${s?"text-accent opacity-100":"opacity-0 group-hover/sorthead:opacity-40 text-text-tertiary"} ${s&&a==="asc"?"rotate-180":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}function N({columns:s,data:a,keyFn:l,onRowClick:o,activeRowKey:d,rowClassName:x,isLoading:h,emptyMessage:p="No records found",sort:n,onSort:u,inline:m}){return h?e.jsx("div",{className:"animate-pulse space-y-0",children:Array.from({length:5}).map((r,t)=>e.jsx("div",{className:"h-14 border-b last:border-b-0 px-6 flex items-center",children:e.jsx("div",{className:"h-3 bg-surface-sunken rounded w-full"})},t))}):a.length?e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsx("tr",{className:"border-b",children:s.map(r=>{const t=r.sortable&&u,i=(n==null?void 0:n.sort_by)===r.key;return e.jsx("th",{onClick:t?()=>u(r.key):void 0,className:`${m?"":"sticky top-[2.75rem] z-10 "}bg-surface px-6 py-3 text-left text-[10px] font-semibold uppercase tracking-widest text-text-tertiary whitespace-nowrap ${r.className??""} ${t?"cursor-pointer select-none group/sorthead hover:text-text-secondary transition-colors":""}`,children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.label,t&&e.jsx(j,{active:i,direction:i?n.order:"desc"})]})},r.key)})})}),e.jsx("tbody",{children:a.map((r,t)=>{const i=d!=null&&l(r)===d;return e.jsx("tr",{onClick:o?()=>o(r):void 0,className:`group/row border-b last:border-b-0 transition-colors duration-100 ${o?"cursor-pointer row-hover":""} ${i?"bg-accent/5 border-l-2 border-l-accent":""} ${x?x(r):""}`,children:s.map(c=>e.jsx("td",{className:`px-6 py-2.5 text-sm ${c.className??""}`,children:c.render(r,t)},c.key))},l(r))})})]}):p?e.jsx(b,{title:p}):null}export{N as D};
2
- //# sourceMappingURL=DataTable-D9yuBv0w.js.map
@@ -1,2 +0,0 @@
1
- import{a as n,j as l}from"./vendor-query-B2UbickB.js";import{aA as D}from"./vendor-icons-B_Yla7iD.js";function v(r,c){const p=c.split(",").map(e=>e.trim());for(const e of p)if(e.startsWith(".")&&r.name.toLowerCase().endsWith(e.toLowerCase())||e===r.type||e.endsWith("/*")&&r.type.startsWith(e.slice(0,-1)))return!0;return!1}function j({onDrop:r,children:c,label:p="Drop files here",accept:e,disabled:i}){const[u,f]=n.useState(!1),s=n.useRef(0),d=n.useCallback(t=>{t.preventDefault(),t.stopPropagation(),s.current++,i||f(!0)},[i]),g=n.useCallback(t=>{t.preventDefault(),t.stopPropagation(),s.current--,s.current<=0&&(s.current=0,f(!1))},[]),x=n.useCallback(t=>{t.preventDefault(),t.stopPropagation()},[]),h=n.useCallback(t=>{if(t.preventDefault(),t.stopPropagation(),s.current=0,f(!1),i)return;const o=Array.from(t.dataTransfer.files);if(console.debug("[DropZone] dropped files:",o.map(a=>({name:a.name,type:a.type,size:a.size}))),e){const a=o.filter(m=>v(m,e));console.debug("[DropZone] after accept filter:",a.length,"of",o.length),a.length?r(a):console.warn("[DropZone] no files matched accept pattern:",e)}else o.length&&r(o)},[r,e,i]);return l.jsxs("div",{className:"relative",onDragEnter:d,onDragLeave:g,onDragOver:x,onDrop:h,children:[c,u&&l.jsx("div",{className:"fixed inset-0 z-50 flex flex-col items-center justify-center transition-opacity pointer-events-none",style:{background:"rgba(var(--color-surface-rgb, 255 255 255) / 0.85)"},children:l.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 py-5 rounded-xl border border-dashed border-text-quaternary/40",children:[l.jsx(D,{className:"w-8 h-8 text-text-tertiary"}),l.jsx("p",{className:"text-xs text-text-secondary",children:p})]})})]})}export{j as D};
2
- //# sourceMappingURL=DropZone-e5EOL5gC.js.map
@@ -1,2 +0,0 @@
1
- import{a as s,j as n}from"./vendor-query-B2UbickB.js";import{z as p,x as f}from"./index-DZX-E_3q.js";function D({startDate:r,endDate:o,isLive:e}){const[l,c]=s.useState(Date.now);s.useEffect(()=>{if(!e)return;const u=setInterval(()=>c(Date.now()),1e3);return()=>clearInterval(u)},[e]);const x=new Date(r).getTime(),i=o?new Date(o).getTime():l,t=Math.max(0,i-x),a=p(t),m=s.useMemo(()=>[{label:"ms",value:String(t)},{label:"sec",value:`${(t/1e3).toFixed(3)}s`},{label:"text",value:a}],[t,a]);return n.jsx(f,{options:m,children:n.jsx("span",{className:`text-xs ${e?"text-status-active":"text-text-tertiary"}`,children:a})})}export{D as E};
2
- //# sourceMappingURL=ElapsedCell-CzVjr74Y.js.map
@@ -1,2 +0,0 @@
1
- import{j as e}from"./vendor-query-B2UbickB.js";function x({title:a="No data",description:t,icon:s}){return e.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[s&&e.jsx("div",{className:"w-12 h-12 rounded-full bg-accent/[0.06] flex items-center justify-center mb-4",children:e.jsx(s,{className:"w-5 h-5 text-accent/50"})}),e.jsx("p",{className:"text-sm text-text-secondary",children:a}),t&&e.jsx("p",{className:"text-xs text-text-tertiary mt-1",children:t})]})}export{x as E};
2
- //# sourceMappingURL=EmptyState-BcsfPq9T.js.map
@@ -1,2 +0,0 @@
1
- import{a as m,j as e}from"./vendor-query-B2UbickB.js";import{i as u}from"./index-DZX-E_3q.js";import{e as p}from"./useEventHooks-CPyvFlVR.js";import{P as b}from"./PageHeader-B_gV_jKk.js";import{S as n}from"./StatCard-DlgF0CJC.js";import{c as j}from"./vendor-react-CX88sFS5.js";import"./vendor-icons-B_Yla7iD.js";const v=[{label:"1h",value:"1h"},{label:"24h",value:"24h"},{label:"7d",value:"7d"},{label:"30d",value:"30d"}];function c({value:i,colorClass:r,onClick:o}){return i===0?e.jsx("span",{className:"text-text-tertiary",children:"0"}):e.jsx("button",{onClick:o,className:`${r} hover:underline tabular-nums font-medium`,children:i})}function $(){var d,x;p();const i=j(),[r,o]=m.useState("24h"),{data:s}=u(r),l=t=>{const h=new URLSearchParams(t).toString();i(`/escalations/available${h?`?${h}`:""}`)},a="pb-2 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary";return e.jsxs("div",{children:[e.jsx(b,{title:"Escalations",docsHash:"#docs:dashboard.md:escalations-overview"}),e.jsx("div",{className:"flex items-center gap-1 mb-6",children:v.map(t=>e.jsx("button",{onClick:()=>o(t.value),className:`px-3 py-1 text-xs rounded-full transition-colors ${r===t.value?"bg-accent text-text-inverse":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:t.label},t.value))}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[e.jsx(n,{label:"Open",value:(s==null?void 0:s.pending)??"—",colorClass:"text-status-pending",onClick:()=>l()}),e.jsx(n,{label:"Claimed",value:(s==null?void 0:s.claimed)??"—",colorClass:"text-status-active",onClick:()=>l()}),e.jsx(n,{label:"Created",value:(s==null?void 0:s.created)??"—",onClick:()=>l()}),e.jsx(n,{label:"Resolved",value:(s==null?void 0:s.resolved)??"—",colorClass:"text-status-success",onClick:()=>l()})]}),(((d=s==null?void 0:s.by_role)==null?void 0:d.length)??0)>0&&e.jsx("div",{className:"mb-8",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-surface-border",children:[e.jsx("th",{className:a,children:"Role"}),e.jsx("th",{className:`${a} text-right w-24`,children:"Pending"}),e.jsx("th",{className:`${a} text-right w-24`,children:"Claimed"})]})}),e.jsx("tbody",{children:s.by_role.map(t=>e.jsxs("tr",{className:"border-b border-surface-border last:border-b-0",children:[e.jsx("td",{className:"py-3 text-sm font-mono text-text-primary",children:e.jsx("button",{onClick:()=>l({role:t.role}),className:"hover:text-accent hover:underline",children:t.role})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(c,{value:t.pending,colorClass:"text-status-pending",onClick:()=>l({role:t.role})})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(c,{value:t.claimed,colorClass:"text-status-active",onClick:()=>l({role:t.role})})})]},t.role))})]})}),(((x=s==null?void 0:s.by_type)==null?void 0:x.length)??0)>0&&e.jsx("div",{children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-surface-border",children:[e.jsx("th",{className:a,children:"Type"}),e.jsx("th",{className:`${a} text-right w-24`,children:"Pending"}),e.jsx("th",{className:`${a} text-right w-24`,children:"Claimed"}),e.jsx("th",{className:`${a} text-right w-24`,children:"Resolved"})]})}),e.jsx("tbody",{children:s.by_type.map(t=>e.jsxs("tr",{className:"border-b border-surface-border last:border-b-0",children:[e.jsx("td",{className:"py-3 text-sm font-mono text-text-primary",children:e.jsx("button",{onClick:()=>l({type:t.type}),className:"hover:text-accent hover:underline",children:t.type})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(c,{value:t.pending,colorClass:"text-status-pending",onClick:()=>l({type:t.type})})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(c,{value:t.claimed,colorClass:"text-status-active",onClick:()=>l({type:t.type})})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(c,{value:t.resolved,colorClass:"text-status-success",onClick:()=>l({type:t.type})})})]},t.type))})]})}),s&&s.by_role.length===0&&s.by_type.length===0&&e.jsx("div",{className:"py-16 text-center",children:e.jsxs("p",{className:"text-sm text-text-tertiary",children:["No escalation activity in the last ",r]})})]})}export{$ as EscalationsOverview};
2
- //# sourceMappingURL=EscalationsOverview-Bcrb44xJ.js.map
@@ -1,2 +0,0 @@
1
- import{a as o,j as t}from"./vendor-query-B2UbickB.js";import{F as C,b as f}from"./FilterBar-Ck4K4rzu.js";import{f as $,C as T}from"./index-DZX-E_3q.js";import{E as F}from"./SwimlaneTimeline-og79Llvs.js";const D=new Set(["activity_task_scheduled","timer_started","child_workflow_execution_started","signal_wait_started"]),P=new Set(["activity_task_completed","activity_task_failed","timer_fired","child_workflow_execution_completed","child_workflow_execution_failed","workflow_execution_signaled"]);function O(l){const a=new Set;for(const i of l)P.has(i.event_type)&&i.attributes.timeline_key&&a.add(i.attributes.timeline_key);return a}function Y({events:l,childTasks:a}){const[i,_]=o.useState(""),[c,h]=o.useState(""),[x,y]=o.useState("asc"),[u,d]=o.useState(new Set),g=[...new Set(l.map(e=>e.category))].sort(),b=[...new Set(l.map(e=>e.event_type))].sort(),w=O(l),v=e=>{if(e.duration_ms!==null||!D.has(e.event_type))return!1;const s=e.attributes.timeline_key;return!(s&&w.has(s))};let n=l;i&&(n=n.filter(e=>e.category===i)),c&&(n=n.filter(e=>e.event_type===c)),n=[...n].sort((e,s)=>x==="asc"?e.event_id-s.event_id:s.event_id-e.event_id);const j=e=>{switch(e){case"activity":return"bg-blue-500";case"signal":return"bg-emerald-500";case"timer":return"bg-status-warning";case"child_workflow":return"bg-violet-500";default:return"bg-text-tertiary"}},k=e=>{const s=e.event_type;if(e.attributes.activity_type)return`${s} — ${e.attributes.activity_type}`;if(e.attributes.signal_name)return`${s} — ${e.attributes.signal_name}`;if(e.attributes.child_workflow_id){const r=e.attributes.child_workflow_id,S=r.length>24?`${r.slice(0,24)}...`:r;return`${s} — ${S}`}return s},N=e=>{if(!(a!=null&&a.length))return;const s=e.attributes.activity_type;if(s)return a.find(r=>r.workflow_type===s)},p=e=>{d(s=>{const r=new Set(s);return r.has(e)?r.delete(e):r.add(e),r})},m=n.length>0&&n.every(e=>u.has(e.event_id)),E=()=>{d(m?new Set:new Set(n.map(e=>e.event_id)))};return t.jsxs("div",{children:[t.jsxs("div",{className:"px-6 py-4 border-b border-surface-border flex items-center justify-between flex-wrap gap-3",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:["Events (",n.length,")"]}),n.length>0&&t.jsx("button",{onClick:E,className:"text-[10px] text-accent hover:underline",children:m?"Collapse all":"Expand all"})]}),t.jsxs(C,{children:[t.jsx(f,{label:"Category",value:i,onChange:_,options:g.map(e=>({value:e,label:e}))}),t.jsx(f,{label:"Type",value:c,onChange:h,options:b.map(e=>({value:e,label:e}))}),t.jsx("button",{onClick:()=>y(e=>e==="asc"?"desc":"asc"),className:"btn-ghost text-xs",children:x==="asc"?"Oldest first":"Newest first"})]})]}),t.jsx("div",{children:n.length===0?t.jsx("div",{className:"px-6 py-8 text-center",children:t.jsx("p",{className:"text-sm text-text-tertiary",children:"No events match the current filters"})}):n.map(e=>{const s=u.has(e.event_id),r=v(e);return t.jsxs("div",{className:"border-b border-surface-border last:border-b-0",children:[t.jsxs("div",{className:"px-6 py-3 flex items-center gap-4 cursor-pointer hover:bg-surface-hover transition-colors duration-200",onClick:()=>p(e.event_id),children:[t.jsx("span",{className:`text-[10px] text-text-tertiary transition-transform duration-300 ${s?"rotate-90":""}`,children:"▶"}),t.jsx("span",{className:"text-xs font-mono text-text-tertiary w-8 shrink-0",children:e.event_id}),t.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${j(e.category)}`}),t.jsx("span",{className:"text-sm text-text-primary flex-1 truncate",children:k(e)}),t.jsx("span",{className:"text-xs font-mono text-text-tertiary shrink-0",children:r?t.jsxs("span",{className:"inline-flex items-center gap-1 text-status-warning",children:[t.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-status-warning animate-pulse"}),"Pending"]}):e.duration_ms!==null?$(e.duration_ms):"--"}),t.jsx("time",{className:"text-[10px] font-mono text-text-tertiary shrink-0",children:new Date(e.event_time).toLocaleTimeString()})]}),t.jsx(T,{open:s&&!!e.attributes,children:t.jsx("div",{className:"px-6 pb-4 pl-16",children:t.jsx(F,{event:e,childTask:N(e),pending:r,onClose:()=>p(e.event_id)})})})]},e.event_id)})})]})}export{Y as E};
2
- //# sourceMappingURL=EventTable-CGfJU7e1.js.map
@@ -1,2 +0,0 @@
1
- import{j as e}from"./vendor-query-B2UbickB.js";import{R as a}from"./vendor-icons-B_Yla7iD.js";const i={task:"text-blue-400",workflow:"text-accent",escalation:"text-amber-400",activity:"text-cyan-400",knowledge:"text-violet-400",agent:"text-emerald-400",app:"text-rose-400",milestone:"text-violet-400"};function c({topic:t}){const o=t.split(".")[0],s=i[o]??"text-text-quaternary",n=t.split(".").slice(-2).join(".");return e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono text-text-secondary",children:[e.jsx(a,{className:`w-2.5 h-2.5 shrink-0 ${s}`,strokeWidth:1.5}),n]})}export{c as E};
2
- //# sourceMappingURL=EventTopicPill-xJJnxvlP.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,a as c}from"./vendor-query-B2UbickB.js";function u({children:a,actions:s}){return e.jsx("div",{className:"sticky top-0 z-20 bg-surface -mx-10 px-10 py-1.5 pb-4 border-b border-surface-border/50",children:e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a,s&&e.jsx("div",{className:"ml-auto flex items-center gap-2",children:s})]})})}function m({label:a,value:s,onChange:n,options:i,required:x,placeholder:r}){return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("label",{className:"text-[10px] text-text-tertiary",children:a}),e.jsxs("select",{value:s,onChange:t=>n(t.target.value),className:"select text-[11px] py-1 px-2",children:[!x&&e.jsx("option",{value:"",children:r||"All"}),i.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))]})]})}function d({label:a,value:s,onChange:n,placeholder:i}){const[x,r]=c.useState(s),t=c.useRef(void 0);c.useEffect(()=>{r(s)},[s]);const o=l=>{r(l),clearTimeout(t.current),t.current=setTimeout(()=>n(l),300)};return c.useEffect(()=>()=>clearTimeout(t.current),[]),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("label",{className:"text-[10px] text-text-tertiary whitespace-nowrap",children:a}),e.jsx("input",{type:"text",value:x,onChange:l=>o(l.target.value),placeholder:i,className:"input text-[11px] py-1 px-2 w-48 font-mono"})]})}export{u as F,d as a,m as b};
2
- //# sourceMappingURL=FilterBar-Ck4K4rzu.js.map