@hotmeshio/long-tail 0.30.0 → 0.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dashboard/dist/assets/{AdminDashboard-Bjf_7-S6.js → AdminDashboard-CZIeiLe0.js} +2 -2
  2. package/dashboard/dist/assets/{AdminDashboard-Bjf_7-S6.js.map → AdminDashboard-CZIeiLe0.js.map} +1 -1
  3. package/dashboard/dist/assets/{AgentConfigPage-CEGk5Gbv.js → AgentConfigPage-DO3ATfCU.js} +2 -2
  4. package/dashboard/dist/assets/{AgentConfigPage-CEGk5Gbv.js.map → AgentConfigPage-DO3ATfCU.js.map} +1 -1
  5. package/dashboard/dist/assets/{AgentDetailPage-C52Oi1_f.js → AgentDetailPage-BWAlHQfB.js} +2 -2
  6. package/dashboard/dist/assets/{AgentDetailPage-C52Oi1_f.js.map → AgentDetailPage-BWAlHQfB.js.map} +1 -1
  7. package/dashboard/dist/assets/{AgentsPage-CohqxaWS.js → AgentsPage-Cs4IKeec.js} +2 -2
  8. package/dashboard/dist/assets/{AgentsPage-CohqxaWS.js.map → AgentsPage-Cs4IKeec.js.map} +1 -1
  9. package/dashboard/dist/assets/{AvailableEscalationsPage-DXpRnOVd.js → AvailableEscalationsPage-CiRxaing.js} +2 -2
  10. package/dashboard/dist/assets/{AvailableEscalationsPage-DXpRnOVd.js.map → AvailableEscalationsPage-CiRxaing.js.map} +1 -1
  11. package/dashboard/dist/assets/{BotPicker-DPglulL6.js → BotPicker-DGLkc9PQ.js} +2 -2
  12. package/dashboard/dist/assets/{BotPicker-DPglulL6.js.map → BotPicker-DGLkc9PQ.js.map} +1 -1
  13. package/dashboard/dist/assets/{BulkAssignModal-DWNR3FJJ.js → BulkAssignModal-C4LV8s0y.js} +2 -2
  14. package/dashboard/dist/assets/{BulkAssignModal-DWNR3FJJ.js.map → BulkAssignModal-C4LV8s0y.js.map} +1 -1
  15. package/dashboard/dist/assets/{CapabilitiesPage-ChBBD0IX.js → CapabilitiesPage-BLMMV3-W.js} +2 -2
  16. package/dashboard/dist/assets/{CapabilitiesPage-ChBBD0IX.js.map → CapabilitiesPage-BLMMV3-W.js.map} +1 -1
  17. package/dashboard/dist/assets/{CollapsibleSection-QAXKTYc6.js → CollapsibleSection-BAizcNCt.js} +2 -2
  18. package/dashboard/dist/assets/{CollapsibleSection-QAXKTYc6.js.map → CollapsibleSection-BAizcNCt.js.map} +1 -1
  19. package/dashboard/dist/assets/{ConfirmDeleteModal-J9xc_gVZ.js → ConfirmDeleteModal-DlNWHVxi.js} +2 -2
  20. package/dashboard/dist/assets/{ConfirmDeleteModal-J9xc_gVZ.js.map → ConfirmDeleteModal-DlNWHVxi.js.map} +1 -1
  21. package/dashboard/dist/assets/{ConnectedAppsPage-BKhsc_jJ.js → ConnectedAppsPage-D94kx0v3.js} +2 -2
  22. package/dashboard/dist/assets/{ConnectedAppsPage-BKhsc_jJ.js.map → ConnectedAppsPage-D94kx0v3.js.map} +1 -1
  23. package/dashboard/dist/assets/{CountdownTimer-C4hP64lF.js → CountdownTimer-CSdAwgwZ.js} +2 -2
  24. package/dashboard/dist/assets/{CountdownTimer-C4hP64lF.js.map → CountdownTimer-CSdAwgwZ.js.map} +1 -1
  25. package/dashboard/dist/assets/{CredentialsPage-DUfgsEbI.js → CredentialsPage-pOyC1GfC.js} +2 -2
  26. package/dashboard/dist/assets/{CredentialsPage-DUfgsEbI.js.map → CredentialsPage-pOyC1GfC.js.map} +1 -1
  27. package/dashboard/dist/assets/{CronLabel-CBc3Tvau.js → CronLabel-BVlOOcyo.js} +2 -2
  28. package/dashboard/dist/assets/{CronLabel-CBc3Tvau.js.map → CronLabel-BVlOOcyo.js.map} +1 -1
  29. package/dashboard/dist/assets/{ElapsedCell-V27Y2Ksb.js → ElapsedCell-Bnjp3onG.js} +2 -2
  30. package/dashboard/dist/assets/{ElapsedCell-V27Y2Ksb.js.map → ElapsedCell-Bnjp3onG.js.map} +1 -1
  31. package/dashboard/dist/assets/{EntityTimelinePanel-BA4MWXkB.js → EntityTimelinePanel-D6Z7YXuY.js} +2 -2
  32. package/dashboard/dist/assets/{EntityTimelinePanel-BA4MWXkB.js.map → EntityTimelinePanel-D6Z7YXuY.js.map} +1 -1
  33. package/dashboard/dist/assets/{EscalationListSchemaPage-B20HUAlO.js → EscalationListSchemaPage-D2aa_arC.js} +2 -2
  34. package/dashboard/dist/assets/{EscalationListSchemaPage-B20HUAlO.js.map → EscalationListSchemaPage-D2aa_arC.js.map} +1 -1
  35. package/dashboard/dist/assets/{EscalationSchemaPage-Cen9HGYG.js → EscalationSchemaPage-DuOje0Ke.js} +2 -2
  36. package/dashboard/dist/assets/{EscalationSchemaPage-Cen9HGYG.js.map → EscalationSchemaPage-DuOje0Ke.js.map} +1 -1
  37. package/dashboard/dist/assets/{EscalationTimeline-DGNgcMm0.js → EscalationTimeline-DFkhU2Z2.js} +2 -2
  38. package/dashboard/dist/assets/{EscalationTimeline-DGNgcMm0.js.map → EscalationTimeline-DFkhU2Z2.js.map} +1 -1
  39. package/dashboard/dist/assets/{EscalationTitleSelect-BhsflGiC.js → EscalationTitleSelect-CgYnMM_O.js} +2 -2
  40. package/dashboard/dist/assets/{EscalationTitleSelect-BhsflGiC.js.map → EscalationTitleSelect-CgYnMM_O.js.map} +1 -1
  41. package/dashboard/dist/assets/{EscalationsOverview-C2nc-Pgv.js → EscalationsOverview-BTkFoklS.js} +2 -2
  42. package/dashboard/dist/assets/{EscalationsOverview-C2nc-Pgv.js.map → EscalationsOverview-BTkFoklS.js.map} +1 -1
  43. package/dashboard/dist/assets/{EventTable-BvNxHKy1.js → EventTable-MJmAbu6N.js} +2 -2
  44. package/dashboard/dist/assets/{EventTable-BvNxHKy1.js.map → EventTable-MJmAbu6N.js.map} +1 -1
  45. package/dashboard/dist/assets/{FilterBar-22FDO0R_.js → FilterBar-Blt7qcUc.js} +2 -2
  46. package/dashboard/dist/assets/{FilterBar-22FDO0R_.js.map → FilterBar-Blt7qcUc.js.map} +1 -1
  47. package/dashboard/dist/assets/{GraphInvokePage-BAyfJ-PY.js → GraphInvokePage-B4K3mT_c.js} +2 -2
  48. package/dashboard/dist/assets/{GraphInvokePage-BAyfJ-PY.js.map → GraphInvokePage-B4K3mT_c.js.map} +1 -1
  49. package/dashboard/dist/assets/{HomePage-CtjG2kGn.js → HomePage-BN5wXq6V.js} +2 -2
  50. package/dashboard/dist/assets/{HomePage-CtjG2kGn.js.map → HomePage-BN5wXq6V.js.map} +1 -1
  51. package/dashboard/dist/assets/{LinePage-DPe-vP3-.js → LinePage-CuHHHwBy.js} +2 -2
  52. package/dashboard/dist/assets/{LinePage-DPe-vP3-.js.map → LinePage-CuHHHwBy.js.map} +1 -1
  53. package/dashboard/dist/assets/{LinesPage-BCSfYkuL.js → LinesPage-D9TRHWyt.js} +2 -2
  54. package/dashboard/dist/assets/{LinesPage-BCSfYkuL.js.map → LinesPage-D9TRHWyt.js.map} +1 -1
  55. package/dashboard/dist/assets/{ListToolbar-6siR0Hao.js → ListToolbar-GGj6X36p.js} +2 -2
  56. package/dashboard/dist/assets/{ListToolbar-6siR0Hao.js.map → ListToolbar-GGj6X36p.js.map} +1 -1
  57. package/dashboard/dist/assets/{McpOverview-Cbu2CXlQ.js → McpOverview-Do31A1jL.js} +2 -2
  58. package/dashboard/dist/assets/{McpOverview-Cbu2CXlQ.js.map → McpOverview-Do31A1jL.js.map} +1 -1
  59. package/dashboard/dist/assets/{McpQueryDetailPage--1FsnGuM.js → McpQueryDetailPage-D6FSB1bS.js} +2 -2
  60. package/dashboard/dist/assets/{McpQueryDetailPage--1FsnGuM.js.map → McpQueryDetailPage-D6FSB1bS.js.map} +1 -1
  61. package/dashboard/dist/assets/{McpQueryPage-CPUUMIiY.js → McpQueryPage-CyT2d0Y_.js} +2 -2
  62. package/dashboard/dist/assets/{McpQueryPage-CPUUMIiY.js.map → McpQueryPage-CyT2d0Y_.js.map} +1 -1
  63. package/dashboard/dist/assets/{McpRunDetailPage-BDCv-c1o.js → McpRunDetailPage-C3mmTl4Y.js} +2 -2
  64. package/dashboard/dist/assets/{McpRunDetailPage-BDCv-c1o.js.map → McpRunDetailPage-C3mmTl4Y.js.map} +1 -1
  65. package/dashboard/dist/assets/{McpRunsPage-Df4yOclO.js → McpRunsPage-CTeFFUE2.js} +2 -2
  66. package/dashboard/dist/assets/{McpRunsPage-Df4yOclO.js.map → McpRunsPage-CTeFFUE2.js.map} +1 -1
  67. package/dashboard/dist/assets/{OperationsPage-BYUGFgPp.js → OperationsPage-BUtQP5dm.js} +2 -2
  68. package/dashboard/dist/assets/{OperationsPage-BYUGFgPp.js.map → OperationsPage-BUtQP5dm.js.map} +1 -1
  69. package/dashboard/dist/assets/{OperatorDashboard-Dd1EhTZe.js → OperatorDashboard-BwYOXyUV.js} +2 -2
  70. package/dashboard/dist/assets/{OperatorDashboard-Dd1EhTZe.js.map → OperatorDashboard-BwYOXyUV.js.map} +1 -1
  71. package/dashboard/dist/assets/{PersonaDetailPage-BCx3Ey2_.js → PersonaDetailPage-CkrKJLNv.js} +2 -2
  72. package/dashboard/dist/assets/{PersonaDetailPage-BCx3Ey2_.js.map → PersonaDetailPage-CkrKJLNv.js.map} +1 -1
  73. package/dashboard/dist/assets/{PersonasPage--Ez0YeHh.js → PersonasPage-BS8aBeOv.js} +2 -2
  74. package/dashboard/dist/assets/{PersonasPage--Ez0YeHh.js.map → PersonasPage-BS8aBeOv.js.map} +1 -1
  75. package/dashboard/dist/assets/{PortalPage-BmBmheBp.js → PortalPage-PEBk6VVu.js} +2 -2
  76. package/dashboard/dist/assets/{PortalPage-BmBmheBp.js.map → PortalPage-PEBk6VVu.js.map} +1 -1
  77. package/dashboard/dist/assets/{ProcessDetailPage-DBj4VEnP.js → ProcessDetailPage-CJ71bxDs.js} +2 -2
  78. package/dashboard/dist/assets/{ProcessDetailPage-DBj4VEnP.js.map → ProcessDetailPage-CJ71bxDs.js.map} +1 -1
  79. package/dashboard/dist/assets/{ProcessesListPage-CD5NRIBK.js → ProcessesListPage-ov_HLxz5.js} +2 -2
  80. package/dashboard/dist/assets/{ProcessesListPage-CD5NRIBK.js.map → ProcessesListPage-ov_HLxz5.js.map} +1 -1
  81. package/dashboard/dist/assets/{ResolverForm-Baxwv_IG.js → ResolverForm-BKiUY-lN.js} +2 -2
  82. package/dashboard/dist/assets/{ResolverForm-Baxwv_IG.js.map → ResolverForm-BKiUY-lN.js.map} +1 -1
  83. package/dashboard/dist/assets/{RoleDetailPage-6ukNyycs.js → RoleDetailPage-CmfWwjtG.js} +2 -2
  84. package/dashboard/dist/assets/{RoleDetailPage-6ukNyycs.js.map → RoleDetailPage-CmfWwjtG.js.map} +1 -1
  85. package/dashboard/dist/assets/{RolesPage-DRs2XeSd.js → RolesPage-DvO5DJWY.js} +2 -2
  86. package/dashboard/dist/assets/{RolesPage-DRs2XeSd.js.map → RolesPage-DvO5DJWY.js.map} +1 -1
  87. package/dashboard/dist/assets/{RosterWidget-BPBPSa1k.js → RosterWidget-Cs6OTbST.js} +2 -2
  88. package/dashboard/dist/assets/{RosterWidget-BPBPSa1k.js.map → RosterWidget-Cs6OTbST.js.map} +1 -1
  89. package/dashboard/dist/assets/{RunAsSelector-Br9FiMwP.js → RunAsSelector-VNjUn9Zp.js} +2 -2
  90. package/dashboard/dist/assets/{RunAsSelector-Br9FiMwP.js.map → RunAsSelector-VNjUn9Zp.js.map} +1 -1
  91. package/dashboard/dist/assets/{ScanCodesPage-BXENWoZb.js → ScanCodesPage-Dbaud0fc.js} +2 -2
  92. package/dashboard/dist/assets/{ScanCodesPage-BXENWoZb.js.map → ScanCodesPage-Dbaud0fc.js.map} +1 -1
  93. package/dashboard/dist/assets/{ScanSchemeDetailPage-CaM4rUBV.js → ScanSchemeDetailPage-BfDw_Eke.js} +2 -2
  94. package/dashboard/dist/assets/{ScanSchemeDetailPage-CaM4rUBV.js.map → ScanSchemeDetailPage-BfDw_Eke.js.map} +1 -1
  95. package/dashboard/dist/assets/{ScanStationPage-CmJKgWy_.js → ScanStationPage-DE-zJTiD.js} +2 -2
  96. package/dashboard/dist/assets/{ScanStationPage-CmJKgWy_.js.map → ScanStationPage-DE-zJTiD.js.map} +1 -1
  97. package/dashboard/dist/assets/{StickyPagination-DX5CPgrX.js → StickyPagination-CJ3jjlDX.js} +2 -2
  98. package/dashboard/dist/assets/{StickyPagination-DX5CPgrX.js.map → StickyPagination-CJ3jjlDX.js.map} +1 -1
  99. package/dashboard/dist/assets/{StreamMessageDetail-3mWw3_M5.js → StreamMessageDetail-yOdyJGHR.js} +2 -2
  100. package/dashboard/dist/assets/{StreamMessageDetail-3mWw3_M5.js.map → StreamMessageDetail-yOdyJGHR.js.map} +1 -1
  101. package/dashboard/dist/assets/{SwimlaneTimeline-C_pIcWBJ.js → SwimlaneTimeline-DeFWNFrL.js} +2 -2
  102. package/dashboard/dist/assets/{SwimlaneTimeline-C_pIcWBJ.js.map → SwimlaneTimeline-DeFWNFrL.js.map} +1 -1
  103. package/dashboard/dist/assets/{TaskDetailPage-DthMVBZO.js → TaskDetailPage-BPL_Zx-L.js} +2 -2
  104. package/dashboard/dist/assets/{TaskDetailPage-DthMVBZO.js.map → TaskDetailPage-BPL_Zx-L.js.map} +1 -1
  105. package/dashboard/dist/assets/{TasksListPage-MtawUpuU.js → TasksListPage-Bc3S63_O.js} +2 -2
  106. package/dashboard/dist/assets/{TasksListPage-MtawUpuU.js.map → TasksListPage-Bc3S63_O.js.map} +1 -1
  107. package/dashboard/dist/assets/{TimeAgo-DIziYk-v.js → TimeAgo-DAtnJQwU.js} +2 -2
  108. package/dashboard/dist/assets/{TimeAgo-DIziYk-v.js.map → TimeAgo-DAtnJQwU.js.map} +1 -1
  109. package/dashboard/dist/assets/{TimestampCell-Dn5M-Eey.js → TimestampCell-CG0erHqq.js} +2 -2
  110. package/dashboard/dist/assets/{TimestampCell-Dn5M-Eey.js.map → TimestampCell-CG0erHqq.js.map} +1 -1
  111. package/dashboard/dist/assets/{ToolTestPanel-DaBrgPML.js → ToolTestPanel-c71yqZv7.js} +2 -2
  112. package/dashboard/dist/assets/{ToolTestPanel-DaBrgPML.js.map → ToolTestPanel-c71yqZv7.js.map} +1 -1
  113. package/dashboard/dist/assets/{TopicDetailPage-zNE3EigP.js → TopicDetailPage-BlUP0bb1.js} +2 -2
  114. package/dashboard/dist/assets/{TopicDetailPage-zNE3EigP.js.map → TopicDetailPage-BlUP0bb1.js.map} +1 -1
  115. package/dashboard/dist/assets/{TopicsPage-Cj0ugdie.js → TopicsPage-lQ9HNzOq.js} +2 -2
  116. package/dashboard/dist/assets/{TopicsPage-Cj0ugdie.js.map → TopicsPage-lQ9HNzOq.js.map} +1 -1
  117. package/dashboard/dist/assets/{UserName-t3PbLYfd.js → UserName-Vf97ofcW.js} +2 -2
  118. package/dashboard/dist/assets/{UserName-t3PbLYfd.js.map → UserName-Vf97ofcW.js.map} +1 -1
  119. package/dashboard/dist/assets/{WorkflowExecutionPage-CZ2c5QLL.js → WorkflowExecutionPage-B195cnHb.js} +2 -2
  120. package/dashboard/dist/assets/{WorkflowExecutionPage-CZ2c5QLL.js.map → WorkflowExecutionPage-B195cnHb.js.map} +1 -1
  121. package/dashboard/dist/assets/{WorkflowsDashboard-DLb71Sa2.js → WorkflowsDashboard-gH-PGsKq.js} +2 -2
  122. package/dashboard/dist/assets/{WorkflowsDashboard-DLb71Sa2.js.map → WorkflowsDashboard-gH-PGsKq.js.map} +1 -1
  123. package/dashboard/dist/assets/{WorkflowsOverview-Wz6RzxHJ.js → WorkflowsOverview-D_wYDqw3.js} +2 -2
  124. package/dashboard/dist/assets/{WorkflowsOverview-Wz6RzxHJ.js.map → WorkflowsOverview-D_wYDqw3.js.map} +1 -1
  125. package/dashboard/dist/assets/{YamlWorkflowDetailPage-CcRAN_ey.js → YamlWorkflowDetailPage-Imob5F8H.js} +2 -2
  126. package/dashboard/dist/assets/{YamlWorkflowDetailPage-CcRAN_ey.js.map → YamlWorkflowDetailPage-Imob5F8H.js.map} +1 -1
  127. package/dashboard/dist/assets/{YamlWorkflowsPage-B4C9fiYU.js → YamlWorkflowsPage-DVEVSKKJ.js} +2 -2
  128. package/dashboard/dist/assets/{YamlWorkflowsPage-B4C9fiYU.js.map → YamlWorkflowsPage-DVEVSKKJ.js.map} +1 -1
  129. package/dashboard/dist/assets/{agents-BvRjwrof.js → agents-B-8z_DV8.js} +2 -2
  130. package/dashboard/dist/assets/{agents-BvRjwrof.js.map → agents-B-8z_DV8.js.map} +1 -1
  131. package/dashboard/dist/assets/{bots-qx7qPwFo.js → bots-Clm-wZeG.js} +2 -2
  132. package/dashboard/dist/assets/{bots-qx7qPwFo.js.map → bots-Clm-wZeG.js.map} +1 -1
  133. package/dashboard/dist/assets/{capabilities-DJrUEeew.js → capabilities-CBwgv5tr.js} +2 -2
  134. package/dashboard/dist/assets/{capabilities-DJrUEeew.js.map → capabilities-CBwgv5tr.js.map} +1 -1
  135. package/dashboard/dist/assets/{controlplane-D82a5cfq.js → controlplane-B96o1-zT.js} +2 -2
  136. package/dashboard/dist/assets/{controlplane-D82a5cfq.js.map → controlplane-B96o1-zT.js.map} +1 -1
  137. package/dashboard/dist/assets/{escalation-columns-Dmm8LY_f.js → escalation-columns-CFoFILF1.js} +2 -2
  138. package/dashboard/dist/assets/{escalation-columns-Dmm8LY_f.js.map → escalation-columns-CFoFILF1.js.map} +1 -1
  139. package/dashboard/dist/assets/{escalation-items-C3ko1DCb.js → escalation-items-BCUiPsfS.js} +2 -2
  140. package/dashboard/dist/assets/{escalation-items-C3ko1DCb.js.map → escalation-items-BCUiPsfS.js.map} +1 -1
  141. package/dashboard/dist/assets/{index-BCSeHOZH.js → index-BOuGMe78.js} +2 -2
  142. package/dashboard/dist/assets/{index-BCSeHOZH.js.map → index-BOuGMe78.js.map} +1 -1
  143. package/dashboard/dist/assets/{index-f4-pKYcm.js → index-BXKDpLk5.js} +2 -2
  144. package/dashboard/dist/assets/{index-f4-pKYcm.js.map → index-BXKDpLk5.js.map} +1 -1
  145. package/dashboard/dist/assets/{index-BAxEeqfF.js → index-B_z-OFwk.js} +2 -2
  146. package/dashboard/dist/assets/{index-BAxEeqfF.js.map → index-B_z-OFwk.js.map} +1 -1
  147. package/dashboard/dist/assets/{index-CNDnGdvT.js → index-C1WJs6IZ.js} +2 -2
  148. package/dashboard/dist/assets/{index-CNDnGdvT.js.map → index-C1WJs6IZ.js.map} +1 -1
  149. package/dashboard/dist/assets/{index-CSr5q355.js → index-CXNh7LuG.js} +10 -10
  150. package/dashboard/dist/assets/index-CXNh7LuG.js.map +1 -0
  151. package/dashboard/dist/assets/{index-CXnmU0TS.js → index-CnhNCVPc.js} +2 -2
  152. package/dashboard/dist/assets/{index-CXnmU0TS.js.map → index-CnhNCVPc.js.map} +1 -1
  153. package/dashboard/dist/assets/{index-DOkHnsLK.js → index-Czb9O4Ns.js} +2 -2
  154. package/dashboard/dist/assets/{index-DOkHnsLK.js.map → index-Czb9O4Ns.js.map} +1 -1
  155. package/dashboard/dist/assets/{index-U5gC9Xgq.js → index-DvgjLvvn.js} +2 -2
  156. package/dashboard/dist/assets/{index-U5gC9Xgq.js.map → index-DvgjLvvn.js.map} +1 -1
  157. package/dashboard/dist/assets/{index-C_-FoMo9.js → index-EZkdUZwM.js} +2 -2
  158. package/dashboard/dist/assets/{index-C_-FoMo9.js.map → index-EZkdUZwM.js.map} +1 -1
  159. package/dashboard/dist/assets/{index-BJrsQM-E.js → index-IedmSPp1.js} +2 -2
  160. package/dashboard/dist/assets/{index-BJrsQM-E.js.map → index-IedmSPp1.js.map} +1 -1
  161. package/dashboard/dist/assets/{index-BVxqddYr.js → index-MGquOb7J.js} +2 -2
  162. package/dashboard/dist/assets/{index-BVxqddYr.js.map → index-MGquOb7J.js.map} +1 -1
  163. package/dashboard/dist/assets/{index-D-vNL8Hm.js → index-P22vmuEu.js} +2 -2
  164. package/dashboard/dist/assets/{index-D-vNL8Hm.js.map → index-P22vmuEu.js.map} +1 -1
  165. package/dashboard/dist/assets/{index-C59ZyWOo.js → index-XS-6UjQd.js} +2 -2
  166. package/dashboard/dist/assets/{index-C59ZyWOo.js.map → index-XS-6UjQd.js.map} +1 -1
  167. package/dashboard/dist/assets/{knowledge-i7_nXSbf.js → knowledge-d92ncKgf.js} +2 -2
  168. package/dashboard/dist/assets/{knowledge-i7_nXSbf.js.map → knowledge-d92ncKgf.js.map} +1 -1
  169. package/dashboard/dist/assets/{machines-DfSNshLg.js → machines-BG9laURp.js} +2 -2
  170. package/dashboard/dist/assets/{machines-DfSNshLg.js.map → machines-BG9laURp.js.map} +1 -1
  171. package/dashboard/dist/assets/{mcp-dCLNwcC8.js → mcp-CsZdpCEf.js} +2 -2
  172. package/dashboard/dist/assets/{mcp-dCLNwcC8.js.map → mcp-CsZdpCEf.js.map} +1 -1
  173. package/dashboard/dist/assets/{mcp-query-wmbaGRYi.js → mcp-query-o2xqrZJv.js} +2 -2
  174. package/dashboard/dist/assets/{mcp-query-wmbaGRYi.js.map → mcp-query-o2xqrZJv.js.map} +1 -1
  175. package/dashboard/dist/assets/{personas-B_cJA5UG.js → personas-EYROtAxm.js} +2 -2
  176. package/dashboard/dist/assets/{personas-B_cJA5UG.js.map → personas-EYROtAxm.js.map} +1 -1
  177. package/dashboard/dist/assets/{pipelines-ClUmuwmY.js → pipelines-C17xZZsa.js} +2 -2
  178. package/dashboard/dist/assets/{pipelines-ClUmuwmY.js.map → pipelines-C17xZZsa.js.map} +1 -1
  179. package/dashboard/dist/assets/{tasks-BE97GrLr.js → tasks-CUppIhu6.js} +2 -2
  180. package/dashboard/dist/assets/{tasks-BE97GrLr.js.map → tasks-CUppIhu6.js.map} +1 -1
  181. package/dashboard/dist/assets/{topics-Dk0Y3kZP.js → topics-B-lCJzVc.js} +2 -2
  182. package/dashboard/dist/assets/{topics-Dk0Y3kZP.js.map → topics-B-lCJzVc.js.map} +1 -1
  183. package/dashboard/dist/assets/{useDebouncedValue-BLGuHd_v.js → useDebouncedValue-C5mMbYoU.js} +2 -2
  184. package/dashboard/dist/assets/{useDebouncedValue-BLGuHd_v.js.map → useDebouncedValue-C5mMbYoU.js.map} +1 -1
  185. package/dashboard/dist/assets/{useNamespace-Cj7t8eQd.js → useNamespace-Bu42ipvu.js} +2 -2
  186. package/dashboard/dist/assets/{useNamespace-Cj7t8eQd.js.map → useNamespace-Bu42ipvu.js.map} +1 -1
  187. package/dashboard/dist/assets/{useYamlActivityEvents-C7eurSkD.js → useYamlActivityEvents-C29uM9Qp.js} +2 -2
  188. package/dashboard/dist/assets/{useYamlActivityEvents-C7eurSkD.js.map → useYamlActivityEvents-C29uM9Qp.js.map} +1 -1
  189. package/dashboard/dist/assets/{validate-BypZfZ8R.js → validate-Bt5QGwSc.js} +2 -2
  190. package/dashboard/dist/assets/{validate-BypZfZ8R.js.map → validate-Bt5QGwSc.js.map} +1 -1
  191. package/dashboard/dist/assets/{yaml-workflows-CnMKmznF.js → yaml-workflows-DgrmL_Kt.js} +2 -2
  192. package/dashboard/dist/assets/{yaml-workflows-CnMKmznF.js.map → yaml-workflows-DgrmL_Kt.js.map} +1 -1
  193. package/dashboard/dist/index.html +1 -1
  194. package/docs/scan-codes.md +8 -5
  195. package/package.json +1 -1
  196. package/dashboard/dist/assets/index-CSr5q355.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{a as p,j as e}from"./vendor-query-DvWWuNIB.js";import{$ as C,aA as I,aB as M,ah as A,aC as R,aD as T}from"./index-CSr5q355.js";import{P as B}from"./PageHeader-DiGWAQlR.js";import"./FilterBar-22FDO0R_.js";import{W as F}from"./WorkflowPill-CKHip3hH.js";import{W as S,u as Q,l as q,e as $,L as z}from"./ResolverForm-Baxwv_IG.js";import{a as k}from"./validate-BypZfZ8R.js";import{N as O}from"./NamespacePill-CeSfHH-j.js";import{Q as U,ay as D,az as _,g as L,k as H,aA as V,aB as Y,ap as G}from"./vendor-icons-en0_uSRD.js";import{B as J}from"./BotPicker-DPglulL6.js";import{f as K}from"./vendor-react-_9U4mKFr.js";import"./RosterWidget-BPBPSa1k.js";import"./escalation-items-C3ko1DCb.js";import"./UserName-t3PbLYfd.js";import"./StatusBadge-DHVwxre2.js";import"./constants-CeBBTzf5.js";import"./bots-qx7qPwFo.js";function X(t){const[a,n]=p.useState(()=>{try{return window.matchMedia(t).matches}catch{return!1}});return p.useEffect(()=>{let i;try{i=window.matchMedia(t)}catch{return}n(i.matches);const r=l=>n(l.matches);return i.addEventListener("change",r),()=>i.removeEventListener("change",r)},[t]),a}const Z="No Queue";function W(t){return[...new Set(t.map(a=>a.task_queue).filter(Boolean))].sort()}function E(t,a,n){const i=a.toLowerCase().trim(),r=o=>{var x;return!i||o.workflow_type.toLowerCase().includes(i)||((x=o.description)==null?void 0:x.toLowerCase().includes(i))},m=(n?[n]:W(t)).map(o=>({queue:o,workflows:t.filter(x=>x.task_queue===o&&r(x))})).filter(o=>o.workflows.length>0);if(!n){const o=t.filter(x=>!x.task_queue&&r(x));o.length>0&&m.push({queue:"",workflows:o})}return m}function ee(t){var a,n;return((n=(a=E(t,"",null)[0])==null?void 0:a.workflows[0])==null?void 0:n.workflow_type)??null}function te({configs:t,selectedType:a,onSelect:n,tierMap:i,activeTypes:r,search:l,activeQueue:m,compact:o=!1}){const x=p.useMemo(()=>E(t,l,m),[t,l,m]);return x.length===0?e.jsx("p",{className:"text-sm text-text-tertiary py-8 text-center",children:"No workflows match your filter."}):e.jsx("div",{className:o?"space-y-6":"space-y-10",children:x.map(({queue:f,workflows:d})=>e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-2 py-2 mb-1 border-b border-surface-border ${o?"":"sticky top-[60px] z-10 bg-surface mb-2"}`,children:[f?e.jsx(U,{className:"w-3 h-3 text-accent shrink-0",strokeWidth:1.5}):e.jsx(D,{className:"w-3 h-3 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("h2",{className:"section-h2 truncate",title:f||void 0,children:f?k(f):Z}),e.jsx("span",{className:"text-xs text-text-quaternary",children:d.length})]}),e.jsx("div",{className:o?"":"divide-y divide-surface-border/30",children:d.map(c=>e.jsx(se,{config:c,isSelected:a===c.workflow_type,tier:i.get(c.workflow_type)??"durable",cronActive:(r==null?void 0:r.has(c.workflow_type))??!1,onSelect:n,compact:o},c.workflow_type))})]},f||"__none__"))})}function se({config:t,isSelected:a,tier:n,cronActive:i,onSelect:r,compact:l}){const m=n==="certified"?"certified":n==="registered"?"registered":"durable";return l?e.jsxs("button",{onClick:()=>r(t),"aria-current":a?"true":void 0,title:t.workflow_type,className:`group w-full text-left flex items-center gap-2.5 pl-3 pr-2 py-2 border-l-2 transition-colors ${a?"border-accent bg-accent/10 text-accent":"border-transparent text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(S,{icon:t.icon,tier:n,className:`w-5 h-5 shrink-0 ${a?"text-accent":"text-accent/65"}`}),e.jsx("span",{className:"text-sm truncate",children:k(t.workflow_type)}),i&&e.jsx("span",{title:"Cron schedule active",className:"ml-auto shrink-0",children:e.jsx(_,{className:"w-3 h-3 text-status-success/70"})})]}):e.jsxs("button",{onClick:()=>r(t),className:"group relative w-full text-left py-2 px-3 -mx-3 rounded-md hover:bg-surface-hover/30 transition-colors duration-150",children:[a&&e.jsx("span",{className:"absolute left-0 top-1 bottom-1 w-0.5 bg-accent rounded-full"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(F,{type:t.workflow_type,size:"md",variant:m}),t.description&&e.jsx("p",{className:"flex-1 min-w-0 truncate text-2xs text-text-tertiary group-hover:text-text-secondary transition-colors",children:t.description}),e.jsxs("span",{className:"ml-auto flex items-center gap-2 shrink-0",children:[t.execute_as&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-2xs bg-accent/10 text-accent rounded",children:[e.jsx(L,{className:"w-2.5 h-2.5"}),t.execute_as]}),i&&e.jsx("span",{title:"Cron schedule active",children:e.jsx(_,{className:"w-3 h-3 text-status-success/70 shrink-0"})}),e.jsx(O,{namespace:"durable"}),e.jsx("span",{title:"Configure & invoke",children:e.jsx(H,{className:`w-3 h-3 transition-opacity ${a?"text-accent opacity-100":"text-accent opacity-0 group-hover:opacity-100"}`,strokeWidth:1.5})})]})]})]})}function ae({config:t,overrideBot:a,onOverrideChange:n,showOverride:i}){const{user:r}=C(),l=a||t.execute_as;return e.jsxs("div",{className:"bg-surface-sunken rounded-lg px-4 py-3 space-y-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-2xs text-text-tertiary uppercase tracking-wider font-medium",children:"Running as"}),l&&!a&&e.jsx("span",{className:"text-2xs text-text-tertiary",children:"configured default"}),a&&e.jsx("span",{className:"text-2xs text-accent",children:"admin override"})]}),e.jsx("div",{className:"field flex items-center gap-1.5",children:l?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"w-3.5 h-3.5 text-accent/70 shrink-0"}),e.jsx("span",{className:"text-xs text-text-primary font-mono",children:l})]}):e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-3.5 h-3.5 text-text-tertiary shrink-0"}),e.jsx("span",{className:"text-xs text-text-primary",children:(r==null?void 0:r.displayName)||(r==null?void 0:r.username)||"you"})]})})]}),i&&n&&e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs text-text-tertiary uppercase tracking-wider font-medium mb-1 block",children:"Override identity"}),e.jsx(J,{selected:a??"",onChange:n,placeholder:t.execute_as?`Default: ${t.execute_as}`:"Invoking user (default)"})]})]})}function re({selected:t}){const{isSuperAdmin:a,hasRoleType:n}=C(),i=a||n("admin"),[r,l]=p.useState(""),[m,o]=p.useState(t.certified);p.useEffect(()=>{l(""),o(t.certified)},[t.workflow_type,t.certified]);const x=p.useMemo(()=>{var N;const u=(N=t.envelope_schema)==null?void 0:N.metadata;return u&&typeof u=="object"?u:{}},[t.envelope_schema]),f=Array.isArray(t.input_lookups)&&t.input_lookups.length>0,{data:d}=I(t.workflow_type,f),c=p.useMemo(()=>d?M(d.lookups):void 0,[d]),w=(d==null?void 0:d.lookups.filter(u=>u.missing))??[],j=Q(t,{certified:m,overrideBot:r}),y=e.jsxs(e.Fragment,{children:[t.description&&e.jsx(A,{content:t.description,className:"text-xs text-text-secondary leading-relaxed"}),e.jsx(ae,{config:t,overrideBot:r,onOverrideChange:l,showOverride:i}),t.certified&&e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:u=>o(u.target.checked),className:"rounded border-surface-border text-accent focus:ring-accent/30"}),e.jsx(Y,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-xs text-text-secondary",children:"Enable task tracking and escalation routing"})]})]});return e.jsxs("div",{className:"max-w-form","data-testid":"invoke-form",children:[e.jsxs("header",{className:"sticky top-0 z-10 bg-surface -mt-8 pt-8 flex items-baseline gap-3 min-w-0 pb-3 mb-5 border-b border-surface-border/60",children:[e.jsx(S,{icon:t.icon,tier:t.tier,className:"w-7 h-7 self-center shrink-0 text-accent"}),e.jsx("h2",{className:"heading-2 truncate",title:t.workflow_type,children:k(t.workflow_type)}),e.jsx("span",{className:"text-2xs font-mono text-text-quaternary shrink-0",children:t.workflow_type}),e.jsx("span",{className:"text-2xs uppercase tracking-widest text-text-tertiary shrink-0",children:t.tier}),t.task_queue&&e.jsx("span",{className:"text-2xs font-mono text-text-quaternary truncate",children:t.task_queue})]}),w.length>0&&e.jsxs("p",{className:"flex items-center gap-1.5 text-2xs text-status-warning mb-4","data-testid":"lookup-missing",children:[e.jsx(G,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),w.map(q).join(", ")," ",w.length===1?"is":"are"," not available; the fields that read ",w.length===1?"it":"them"," fall back to plain inputs."]}),t.input_schema?e.jsx($,{selected:t,schema:t.input_schema,metadata:x,lookup:c,submission:j,lead:y}):e.jsx(z,{selected:t,metadata:x,submission:j,lead:y})]})}const b="type",ne=!1;function oe(){const[t,a]=K(),{data:n,isLoading:i}=R(),{data:r}=T(),l=X("(max-width: 1279px)"),m=t.get(b)??"",[o,x]=p.useState(""),[f,d]=p.useState(null),c=n??[],w=p.useMemo(()=>{const s=new Map;for(const h of c)s.set(h.workflow_type,h.tier);return s},[c]),j=c.find(s=>s.workflow_type===m),y=new Set((r??[]).filter(s=>s.active).map(s=>s.workflow_type)),u=p.useCallback((s,h={})=>{a(P=>{const g=new URLSearchParams(P);return s?g.set(b,s):g.delete(b),g},{replace:h.replace??!1})},[a]);if(p.useEffect(()=>{if(t.get(b)||c.length===0)return;const s=ee(c);s&&u(s,{replace:!0})},[c,t,u]),i)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"})]});const N=W(c),v=j?e.jsx(re,{selected:j}):e.jsx("p",{className:"text-xs text-text-tertiary",children:"Choose a tool to begin."});return e.jsxs("div",{children:[e.jsx(B,{title:"Invoke Tool",docsHash:"#docs:dashboard.md:invoke-tool"}),c.length===0?e.jsxs("div",{className:"py-16 text-center",children:[e.jsx("p",{className:"text-sm text-text-primary mb-1",children:"No tools to invoke"}),e.jsx("p",{className:"text-xs text-text-tertiary",children:"Mark workflows as invocable in the registry, or start the server with examples enabled."})]}):l?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"block mb-6 max-w-2xl",children:[e.jsx("span",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Tool"}),e.jsxs("select",{value:m,onChange:s=>u(s.target.value||null),className:"select text-xs font-mono w-full",children:[e.jsx("option",{value:"",children:"Choose a tool…"}),N.map(s=>e.jsx("optgroup",{label:k(s),children:c.filter(h=>(h.task_queue||"")===s).map(h=>e.jsx("option",{value:h.workflow_type,children:k(h.workflow_type)},h.workflow_type))},s)),c.filter(s=>!s.task_queue).map(s=>e.jsx("option",{value:s.workflow_type,children:k(s.workflow_type)},s.workflow_type))]})]}),e.jsx("div",{className:"pt-8",children:v})]}):e.jsxs("div",{className:"flex gap-10 items-start",children:[e.jsxs("aside",{className:"w-1/4 min-w-[15rem] shrink-0 sticky top-0 self-start -mt-8 pt-8 max-h-[calc(100vh-5rem)] overflow-y-auto pr-1 space-y-4","data-testid":"invoke-list",children:[ne,e.jsx(te,{configs:c,selectedType:m,onSelect:s=>u(s.workflow_type),tierMap:w,activeTypes:y,search:o,activeQueue:f,compact:!0})]}),e.jsx("section",{className:"flex-1 min-w-0",children:v})]})]})}function ve(){return e.jsx(oe,{})}export{ve as DurableInvokePage,oe as StartWorkflowPage};
2
- //# sourceMappingURL=index-CXnmU0TS.js.map
1
+ import{a as p,j as e}from"./vendor-query-DvWWuNIB.js";import{$ as C,aA as I,aB as M,ah as A,aC as R,aD as T}from"./index-CXNh7LuG.js";import{P as B}from"./PageHeader-DiGWAQlR.js";import"./FilterBar-Blt7qcUc.js";import{W as F}from"./WorkflowPill-CKHip3hH.js";import{W as S,u as Q,l as q,e as $,L as z}from"./ResolverForm-BKiUY-lN.js";import{a as k}from"./validate-Bt5QGwSc.js";import{N as O}from"./NamespacePill-CeSfHH-j.js";import{Q as U,ay as D,az as _,g as L,k as H,aA as V,aB as Y,ap as G}from"./vendor-icons-en0_uSRD.js";import{B as J}from"./BotPicker-DGLkc9PQ.js";import{f as K}from"./vendor-react-_9U4mKFr.js";import"./RosterWidget-Cs6OTbST.js";import"./escalation-items-BCUiPsfS.js";import"./UserName-Vf97ofcW.js";import"./StatusBadge-DHVwxre2.js";import"./constants-CeBBTzf5.js";import"./bots-Clm-wZeG.js";function X(t){const[a,n]=p.useState(()=>{try{return window.matchMedia(t).matches}catch{return!1}});return p.useEffect(()=>{let i;try{i=window.matchMedia(t)}catch{return}n(i.matches);const r=l=>n(l.matches);return i.addEventListener("change",r),()=>i.removeEventListener("change",r)},[t]),a}const Z="No Queue";function W(t){return[...new Set(t.map(a=>a.task_queue).filter(Boolean))].sort()}function E(t,a,n){const i=a.toLowerCase().trim(),r=o=>{var x;return!i||o.workflow_type.toLowerCase().includes(i)||((x=o.description)==null?void 0:x.toLowerCase().includes(i))},m=(n?[n]:W(t)).map(o=>({queue:o,workflows:t.filter(x=>x.task_queue===o&&r(x))})).filter(o=>o.workflows.length>0);if(!n){const o=t.filter(x=>!x.task_queue&&r(x));o.length>0&&m.push({queue:"",workflows:o})}return m}function ee(t){var a,n;return((n=(a=E(t,"",null)[0])==null?void 0:a.workflows[0])==null?void 0:n.workflow_type)??null}function te({configs:t,selectedType:a,onSelect:n,tierMap:i,activeTypes:r,search:l,activeQueue:m,compact:o=!1}){const x=p.useMemo(()=>E(t,l,m),[t,l,m]);return x.length===0?e.jsx("p",{className:"text-sm text-text-tertiary py-8 text-center",children:"No workflows match your filter."}):e.jsx("div",{className:o?"space-y-6":"space-y-10",children:x.map(({queue:f,workflows:d})=>e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-2 py-2 mb-1 border-b border-surface-border ${o?"":"sticky top-[60px] z-10 bg-surface mb-2"}`,children:[f?e.jsx(U,{className:"w-3 h-3 text-accent shrink-0",strokeWidth:1.5}):e.jsx(D,{className:"w-3 h-3 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("h2",{className:"section-h2 truncate",title:f||void 0,children:f?k(f):Z}),e.jsx("span",{className:"text-xs text-text-quaternary",children:d.length})]}),e.jsx("div",{className:o?"":"divide-y divide-surface-border/30",children:d.map(c=>e.jsx(se,{config:c,isSelected:a===c.workflow_type,tier:i.get(c.workflow_type)??"durable",cronActive:(r==null?void 0:r.has(c.workflow_type))??!1,onSelect:n,compact:o},c.workflow_type))})]},f||"__none__"))})}function se({config:t,isSelected:a,tier:n,cronActive:i,onSelect:r,compact:l}){const m=n==="certified"?"certified":n==="registered"?"registered":"durable";return l?e.jsxs("button",{onClick:()=>r(t),"aria-current":a?"true":void 0,title:t.workflow_type,className:`group w-full text-left flex items-center gap-2.5 pl-3 pr-2 py-2 border-l-2 transition-colors ${a?"border-accent bg-accent/10 text-accent":"border-transparent text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(S,{icon:t.icon,tier:n,className:`w-5 h-5 shrink-0 ${a?"text-accent":"text-accent/65"}`}),e.jsx("span",{className:"text-sm truncate",children:k(t.workflow_type)}),i&&e.jsx("span",{title:"Cron schedule active",className:"ml-auto shrink-0",children:e.jsx(_,{className:"w-3 h-3 text-status-success/70"})})]}):e.jsxs("button",{onClick:()=>r(t),className:"group relative w-full text-left py-2 px-3 -mx-3 rounded-md hover:bg-surface-hover/30 transition-colors duration-150",children:[a&&e.jsx("span",{className:"absolute left-0 top-1 bottom-1 w-0.5 bg-accent rounded-full"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(F,{type:t.workflow_type,size:"md",variant:m}),t.description&&e.jsx("p",{className:"flex-1 min-w-0 truncate text-2xs text-text-tertiary group-hover:text-text-secondary transition-colors",children:t.description}),e.jsxs("span",{className:"ml-auto flex items-center gap-2 shrink-0",children:[t.execute_as&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-2xs bg-accent/10 text-accent rounded",children:[e.jsx(L,{className:"w-2.5 h-2.5"}),t.execute_as]}),i&&e.jsx("span",{title:"Cron schedule active",children:e.jsx(_,{className:"w-3 h-3 text-status-success/70 shrink-0"})}),e.jsx(O,{namespace:"durable"}),e.jsx("span",{title:"Configure & invoke",children:e.jsx(H,{className:`w-3 h-3 transition-opacity ${a?"text-accent opacity-100":"text-accent opacity-0 group-hover:opacity-100"}`,strokeWidth:1.5})})]})]})]})}function ae({config:t,overrideBot:a,onOverrideChange:n,showOverride:i}){const{user:r}=C(),l=a||t.execute_as;return e.jsxs("div",{className:"bg-surface-sunken rounded-lg px-4 py-3 space-y-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-2xs text-text-tertiary uppercase tracking-wider font-medium",children:"Running as"}),l&&!a&&e.jsx("span",{className:"text-2xs text-text-tertiary",children:"configured default"}),a&&e.jsx("span",{className:"text-2xs text-accent",children:"admin override"})]}),e.jsx("div",{className:"field flex items-center gap-1.5",children:l?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"w-3.5 h-3.5 text-accent/70 shrink-0"}),e.jsx("span",{className:"text-xs text-text-primary font-mono",children:l})]}):e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-3.5 h-3.5 text-text-tertiary shrink-0"}),e.jsx("span",{className:"text-xs text-text-primary",children:(r==null?void 0:r.displayName)||(r==null?void 0:r.username)||"you"})]})})]}),i&&n&&e.jsxs("div",{children:[e.jsx("label",{className:"text-2xs text-text-tertiary uppercase tracking-wider font-medium mb-1 block",children:"Override identity"}),e.jsx(J,{selected:a??"",onChange:n,placeholder:t.execute_as?`Default: ${t.execute_as}`:"Invoking user (default)"})]})]})}function re({selected:t}){const{isSuperAdmin:a,hasRoleType:n}=C(),i=a||n("admin"),[r,l]=p.useState(""),[m,o]=p.useState(t.certified);p.useEffect(()=>{l(""),o(t.certified)},[t.workflow_type,t.certified]);const x=p.useMemo(()=>{var N;const u=(N=t.envelope_schema)==null?void 0:N.metadata;return u&&typeof u=="object"?u:{}},[t.envelope_schema]),f=Array.isArray(t.input_lookups)&&t.input_lookups.length>0,{data:d}=I(t.workflow_type,f),c=p.useMemo(()=>d?M(d.lookups):void 0,[d]),w=(d==null?void 0:d.lookups.filter(u=>u.missing))??[],j=Q(t,{certified:m,overrideBot:r}),y=e.jsxs(e.Fragment,{children:[t.description&&e.jsx(A,{content:t.description,className:"text-xs text-text-secondary leading-relaxed"}),e.jsx(ae,{config:t,overrideBot:r,onOverrideChange:l,showOverride:i}),t.certified&&e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:u=>o(u.target.checked),className:"rounded border-surface-border text-accent focus:ring-accent/30"}),e.jsx(Y,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-xs text-text-secondary",children:"Enable task tracking and escalation routing"})]})]});return e.jsxs("div",{className:"max-w-form","data-testid":"invoke-form",children:[e.jsxs("header",{className:"sticky top-0 z-10 bg-surface -mt-8 pt-8 flex items-baseline gap-3 min-w-0 pb-3 mb-5 border-b border-surface-border/60",children:[e.jsx(S,{icon:t.icon,tier:t.tier,className:"w-7 h-7 self-center shrink-0 text-accent"}),e.jsx("h2",{className:"heading-2 truncate",title:t.workflow_type,children:k(t.workflow_type)}),e.jsx("span",{className:"text-2xs font-mono text-text-quaternary shrink-0",children:t.workflow_type}),e.jsx("span",{className:"text-2xs uppercase tracking-widest text-text-tertiary shrink-0",children:t.tier}),t.task_queue&&e.jsx("span",{className:"text-2xs font-mono text-text-quaternary truncate",children:t.task_queue})]}),w.length>0&&e.jsxs("p",{className:"flex items-center gap-1.5 text-2xs text-status-warning mb-4","data-testid":"lookup-missing",children:[e.jsx(G,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),w.map(q).join(", ")," ",w.length===1?"is":"are"," not available; the fields that read ",w.length===1?"it":"them"," fall back to plain inputs."]}),t.input_schema?e.jsx($,{selected:t,schema:t.input_schema,metadata:x,lookup:c,submission:j,lead:y}):e.jsx(z,{selected:t,metadata:x,submission:j,lead:y})]})}const b="type",ne=!1;function oe(){const[t,a]=K(),{data:n,isLoading:i}=R(),{data:r}=T(),l=X("(max-width: 1279px)"),m=t.get(b)??"",[o,x]=p.useState(""),[f,d]=p.useState(null),c=n??[],w=p.useMemo(()=>{const s=new Map;for(const h of c)s.set(h.workflow_type,h.tier);return s},[c]),j=c.find(s=>s.workflow_type===m),y=new Set((r??[]).filter(s=>s.active).map(s=>s.workflow_type)),u=p.useCallback((s,h={})=>{a(P=>{const g=new URLSearchParams(P);return s?g.set(b,s):g.delete(b),g},{replace:h.replace??!1})},[a]);if(p.useEffect(()=>{if(t.get(b)||c.length===0)return;const s=ee(c);s&&u(s,{replace:!0})},[c,t,u]),i)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"})]});const N=W(c),v=j?e.jsx(re,{selected:j}):e.jsx("p",{className:"text-xs text-text-tertiary",children:"Choose a tool to begin."});return e.jsxs("div",{children:[e.jsx(B,{title:"Invoke Tool",docsHash:"#docs:dashboard.md:invoke-tool"}),c.length===0?e.jsxs("div",{className:"py-16 text-center",children:[e.jsx("p",{className:"text-sm text-text-primary mb-1",children:"No tools to invoke"}),e.jsx("p",{className:"text-xs text-text-tertiary",children:"Mark workflows as invocable in the registry, or start the server with examples enabled."})]}):l?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:"block mb-6 max-w-2xl",children:[e.jsx("span",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Tool"}),e.jsxs("select",{value:m,onChange:s=>u(s.target.value||null),className:"select text-xs font-mono w-full",children:[e.jsx("option",{value:"",children:"Choose a tool…"}),N.map(s=>e.jsx("optgroup",{label:k(s),children:c.filter(h=>(h.task_queue||"")===s).map(h=>e.jsx("option",{value:h.workflow_type,children:k(h.workflow_type)},h.workflow_type))},s)),c.filter(s=>!s.task_queue).map(s=>e.jsx("option",{value:s.workflow_type,children:k(s.workflow_type)},s.workflow_type))]})]}),e.jsx("div",{className:"pt-8",children:v})]}):e.jsxs("div",{className:"flex gap-10 items-start",children:[e.jsxs("aside",{className:"w-1/4 min-w-[15rem] shrink-0 sticky top-0 self-start -mt-8 pt-8 max-h-[calc(100vh-5rem)] overflow-y-auto pr-1 space-y-4","data-testid":"invoke-list",children:[ne,e.jsx(te,{configs:c,selectedType:m,onSelect:s=>u(s.workflow_type),tierMap:w,activeTypes:y,search:o,activeQueue:f,compact:!0})]}),e.jsx("section",{className:"flex-1 min-w-0",children:v})]})]})}function ve(){return e.jsx(oe,{})}export{ve as DurableInvokePage,oe as StartWorkflowPage};
2
+ //# sourceMappingURL=index-CnhNCVPc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CXnmU0TS.js","sources":["../../src/hooks/useMediaQuery.ts","../../src/pages/workflows/start/WorkflowSelector.tsx","../../src/pages/workflows/start/IdentitySummary.tsx","../../src/pages/workflows/start/StartNowPanel.tsx","../../src/pages/workflows/start/StartWorkflowPage.tsx","../../src/pages/workflows/start/DurableInvokePage.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * Tracks a viewport media query. Unlike container measurement, the viewport\n * is stable while shell panels open and close, so layout decisions made on\n * it never feed back into themselves. Returns false in environments without\n * matchMedia (jsdom), which callers treat as \"wide\".\n */\nexport function useMediaQuery(query: string): boolean {\n const [matches, setMatches] = useState<boolean>(() => {\n try {\n return window.matchMedia(query).matches;\n } catch {\n return false;\n }\n });\n\n useEffect(() => {\n let mql: MediaQueryList;\n try {\n mql = window.matchMedia(query);\n } catch {\n return;\n }\n setMatches(mql.matches);\n const onChange = (e: MediaQueryListEvent) => setMatches(e.matches);\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, [query]);\n\n return matches;\n}\n","import { useMemo } from 'react';\nimport { Bot, Clock, Play, Server, Wrench } from 'lucide-react';\nimport { WorkflowPill } from '../../../components/common/display/WorkflowPill';\nimport { WorkflowIcon } from '../../../components/common/display/WorkflowIcon';\nimport { identifierToTitle } from '../../../lib/identifier-label';\nimport { NamespacePill } from '../../../components/common/display/NamespacePill';\nimport type { LTWorkflowConfig, WorkflowTier } from '../../../api/types';\n\nconst NO_QUEUE_LABEL = 'No Queue';\n\n/** The queue set a filter offers — shared with the grouping below. */\nexport function workflowQueues(configs: LTWorkflowConfig[]): string[] {\n return [...new Set(configs.map((c) => c.task_queue).filter(Boolean))].sort() as string[];\n}\n\n/** One section per task queue; unqueued workflows trail under their own heading when no queue filter is active. */\nexport function groupWorkflows(\n configs: LTWorkflowConfig[],\n search: string,\n activeQueue: string | null,\n): { queue: string; workflows: LTWorkflowConfig[] }[] {\n const q = search.toLowerCase().trim();\n const matches = (c: LTWorkflowConfig) =>\n !q || c.workflow_type.toLowerCase().includes(q) || c.description?.toLowerCase().includes(q);\n\n const targetQueues = activeQueue ? [activeQueue] : workflowQueues(configs);\n const sections = targetQueues\n .map((queue) => ({ queue, workflows: configs.filter((c) => c.task_queue === queue && matches(c)) }))\n .filter((g) => g.workflows.length > 0);\n\n if (!activeQueue) {\n const noQueue = configs.filter((c) => !c.task_queue && matches(c));\n if (noQueue.length > 0) sections.push({ queue: '', workflows: noQueue });\n }\n return sections;\n}\n\n/** The first row of the unfiltered list — what the page preselects. */\nexport function firstWorkflowType(configs: LTWorkflowConfig[]): string | null {\n return groupWorkflows(configs, '', null)[0]?.workflows[0]?.workflow_type ?? null;\n}\n\nexport function WorkflowSelector({\n configs,\n selectedType,\n onSelect,\n tierMap,\n activeTypes,\n search,\n activeQueue,\n compact = false,\n}: {\n configs: LTWorkflowConfig[];\n selectedType: string;\n onSelect: (config: LTWorkflowConfig) => void;\n tierMap: Map<string, WorkflowTier>;\n activeTypes?: Set<string>;\n search: string;\n activeQueue: string | null;\n /** The narrow list column beside the form: name and tier only, headings in flow. */\n compact?: boolean;\n}) {\n const grouped = useMemo(() => groupWorkflows(configs, search, activeQueue), [configs, search, activeQueue]);\n\n if (grouped.length === 0) {\n return <p className=\"text-sm text-text-tertiary py-8 text-center\">No workflows match your filter.</p>;\n }\n\n return (\n <div className={compact ? 'space-y-6' : 'space-y-10'}>\n {grouped.map(({ queue, workflows }) => (\n <div key={queue || '__none__'}>\n <div className={`flex items-center gap-2 py-2 mb-1 border-b border-surface-border ${compact ? '' : 'sticky top-[60px] z-10 bg-surface mb-2'}`}>\n {queue ? (\n <Server className=\"w-3 h-3 text-accent shrink-0\" strokeWidth={1.5} />\n ) : (\n <Wrench className=\"w-3 h-3 text-text-quaternary shrink-0\" strokeWidth={1.5} />\n )}\n <h2 className=\"section-h2 truncate\" title={queue || undefined}>{queue ? identifierToTitle(queue) : NO_QUEUE_LABEL}</h2>\n <span className=\"text-xs text-text-quaternary\">{workflows.length}</span>\n </div>\n <div className={compact ? '' : 'divide-y divide-surface-border/30'}>\n {workflows.map((config) => (\n <WorkflowRow\n key={config.workflow_type}\n config={config}\n isSelected={selectedType === config.workflow_type}\n tier={tierMap.get(config.workflow_type) ?? 'durable'}\n cronActive={activeTypes?.has(config.workflow_type) ?? false}\n onSelect={onSelect}\n compact={compact}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction WorkflowRow({\n config,\n isSelected,\n tier,\n cronActive,\n onSelect,\n compact,\n}: {\n config: LTWorkflowConfig;\n isSelected: boolean;\n tier: WorkflowTier;\n cronActive: boolean;\n onSelect: (config: LTWorkflowConfig) => void;\n compact: boolean;\n}) {\n const variant = tier === 'certified' ? 'certified' : tier === 'registered' ? 'registered' : 'durable';\n\n if (compact) {\n return (\n <button\n onClick={() => onSelect(config)}\n aria-current={isSelected ? 'true' : undefined}\n title={config.workflow_type}\n className={`group w-full text-left flex items-center gap-2.5 pl-3 pr-2 py-2 border-l-2 transition-colors ${\n isSelected ? 'border-accent bg-accent/10 text-accent' : 'border-transparent text-text-primary hover:bg-surface-hover'\n }`}\n >\n <WorkflowIcon icon={config.icon} tier={tier} className={`w-5 h-5 shrink-0 ${isSelected ? 'text-accent' : 'text-accent/65'}`} />\n <span className=\"text-sm truncate\">{identifierToTitle(config.workflow_type)}</span>\n {cronActive && (\n <span title=\"Cron schedule active\" className=\"ml-auto shrink-0\">\n <Clock className=\"w-3 h-3 text-status-success/70\" />\n </span>\n )}\n </button>\n );\n }\n\n return (\n <button\n onClick={() => onSelect(config)}\n className=\"group relative w-full text-left py-2 px-3 -mx-3 rounded-md hover:bg-surface-hover/30 transition-colors duration-150\"\n >\n {isSelected && (\n <span className=\"absolute left-0 top-1 bottom-1 w-0.5 bg-accent rounded-full\" />\n )}\n <div className=\"flex items-center gap-3\">\n <WorkflowPill type={config.workflow_type} size=\"md\" variant={variant} />\n {config.description && (\n <p className=\"flex-1 min-w-0 truncate text-2xs text-text-tertiary group-hover:text-text-secondary transition-colors\">\n {config.description}\n </p>\n )}\n <span className=\"ml-auto flex items-center gap-2 shrink-0\">\n {config.execute_as && (\n <span className=\"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-2xs bg-accent/10 text-accent rounded\">\n <Bot className=\"w-2.5 h-2.5\" />\n {config.execute_as}\n </span>\n )}\n {cronActive && (\n <span title=\"Cron schedule active\">\n <Clock className=\"w-3 h-3 text-status-success/70 shrink-0\" />\n </span>\n )}\n <NamespacePill namespace=\"durable\" />\n <span title=\"Configure & invoke\">\n <Play\n className={`w-3 h-3 transition-opacity ${\n isSelected ? 'text-accent opacity-100' : 'text-accent opacity-0 group-hover:opacity-100'\n }`}\n strokeWidth={1.5}\n />\n </span>\n </span>\n </div>\n </button>\n );\n}\n","import { Bot, UserCircle } from 'lucide-react';\nimport { BotPicker } from '../../../components/common/form/BotPicker';\nimport { useAuth } from '../../../hooks/useAuth';\nimport type { LTWorkflowConfig } from '../../../api/types';\n\nexport function IdentitySummary({\n config,\n overrideBot,\n onOverrideChange,\n showOverride,\n}: {\n config: LTWorkflowConfig;\n overrideBot?: string;\n onOverrideChange?: (botExternalId: string) => void;\n showOverride?: boolean;\n}) {\n const { user } = useAuth();\n const effectiveBot = overrideBot || config.execute_as;\n\n return (\n <div className=\"bg-surface-sunken rounded-lg px-4 py-3 space-y-3\">\n <div>\n <div className=\"flex items-center justify-between mb-1\">\n <span className=\"text-2xs text-text-tertiary uppercase tracking-wider font-medium\">Running as</span>\n {effectiveBot && !overrideBot && (\n <span className=\"text-2xs text-text-tertiary\">configured default</span>\n )}\n {overrideBot && (\n <span className=\"text-2xs text-accent\">admin override</span>\n )}\n </div>\n {/* Read-only identity, styled as a field so it reads consistently with\n the Override control below and pops off the sunken band. */}\n <div className=\"field flex items-center gap-1.5\">\n {effectiveBot ? (\n <>\n <Bot className=\"w-3.5 h-3.5 text-accent/70 shrink-0\" />\n <span className=\"text-xs text-text-primary font-mono\">{effectiveBot}</span>\n </>\n ) : (\n <>\n <UserCircle className=\"w-3.5 h-3.5 text-text-tertiary shrink-0\" />\n <span className=\"text-xs text-text-primary\">\n {user?.displayName || user?.username || 'you'}\n </span>\n </>\n )}\n </div>\n </div>\n {showOverride && onOverrideChange && (\n <div>\n <label className=\"text-2xs text-text-tertiary uppercase tracking-wider font-medium mb-1 block\">Override identity</label>\n <BotPicker\n selected={overrideBot ?? ''}\n onChange={onOverrideChange}\n placeholder={config.execute_as ? `Default: ${config.execute_as}` : 'Invoking user (default)'}\n />\n </div>\n )}\n </div>\n );\n}\n","import { useEffect, useMemo, useState } from 'react';\nimport { lookupLabel } from '../../../lib/lookup-label';\nimport { AlertTriangle, ShieldCheck } from 'lucide-react';\nimport { useAuth } from '../../../hooks/useAuth';\nimport { foldWorkflowLookups, useWorkflowLookups } from '../../../api/workflows';\nimport type { InvocableWorkflow } from '../../../api/types';\nimport { WorkflowIcon } from '../../../components/common/display/WorkflowIcon';\nimport { MarkdownRenderer } from '../../../components/common/display/MarkdownRenderer';\nimport { identifierToTitle } from '../../../lib/identifier-label';\nimport { IdentitySummary } from './IdentitySummary';\nimport { LegacyInvokeForm } from './LegacyInvokeForm';\nimport { RichInvokeForm } from './RichInvokeForm';\nimport { useInvokeSubmit } from './use-invoke-submit';\n\n/**\n * The form column. The workflow's name is the column's heading and stays\n * put; Start stays put at the bottom; description, identity, options, and\n* the fields scroll between them. A declared input_schema renders the\n * x-lt-* form, with pinned input_lookups resolved into its lookup domain;\n * otherwise the envelope template form.\n */\nexport function StartNowPanel({ selected }: { selected: InvocableWorkflow }) {\n const { isSuperAdmin, hasRoleType } = useAuth();\n const isAdmin = isSuperAdmin || hasRoleType('admin');\n const [overrideBot, setOverrideBot] = useState('');\n // Per-run interceptor opt-out, offered when the registration is certified.\n const [certified, setCertified] = useState(selected.certified);\n\n useEffect(() => {\n setOverrideBot('');\n setCertified(selected.certified);\n }, [selected.workflow_type, selected.certified]);\n\n const metadata = useMemo(() => {\n const md = selected.envelope_schema?.metadata;\n return md && typeof md === 'object' ? (md as Record<string, unknown>) : {};\n }, [selected.envelope_schema]);\n\n const hasLookups = Array.isArray(selected.input_lookups) && selected.input_lookups.length > 0;\n const { data: lookupData } = useWorkflowLookups(selected.workflow_type, hasLookups);\n const lookup = useMemo(() => (lookupData ? foldWorkflowLookups(lookupData.lookups) : undefined), [lookupData]);\n const missingLookups = lookupData?.lookups.filter((l) => l.missing) ?? [];\n\n const submission = useInvokeSubmit(selected, { certified, overrideBot });\n\n const lead = (\n <>\n {selected.description && (\n <MarkdownRenderer content={selected.description} className=\"text-xs text-text-secondary leading-relaxed\" />\n )}\n <IdentitySummary\n config={selected}\n overrideBot={overrideBot}\n onOverrideChange={setOverrideBot}\n showOverride={isAdmin}\n />\n {selected.certified && (\n <label className=\"flex items-center gap-2 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={certified}\n onChange={(e) => setCertified(e.target.checked)}\n className=\"rounded border-surface-border text-accent focus:ring-accent/30\"\n />\n <ShieldCheck className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-xs text-text-secondary\">Enable task tracking and escalation routing</span>\n </label>\n )}\n </>\n );\n\n return (\n <div className=\"max-w-form\" data-testid=\"invoke-form\">\n {/* Sticks to the top of the shell scroll; the pulled-up padding covers the page gutter above it. */}\n <header className=\"sticky top-0 z-10 bg-surface -mt-8 pt-8 flex items-baseline gap-3 min-w-0 pb-3 mb-5 border-b border-surface-border/60\">\n <WorkflowIcon icon={selected.icon} tier={selected.tier} className=\"w-7 h-7 self-center shrink-0 text-accent\" />\n <h2 className=\"heading-2 truncate\" title={selected.workflow_type}>\n {identifierToTitle(selected.workflow_type)}\n </h2>\n <span className=\"text-2xs font-mono text-text-quaternary shrink-0\">{selected.workflow_type}</span>\n <span className=\"text-2xs uppercase tracking-widest text-text-tertiary shrink-0\">{selected.tier}</span>\n {selected.task_queue && (\n <span className=\"text-2xs font-mono text-text-quaternary truncate\">{selected.task_queue}</span>\n )}\n </header>\n\n {missingLookups.length > 0 && (\n <p className=\"flex items-center gap-1.5 text-2xs text-status-warning mb-4\" data-testid=\"lookup-missing\">\n <AlertTriangle className=\"w-3 h-3 shrink-0\" strokeWidth={1.5} />\n {missingLookups.map(lookupLabel).join(', ')} {missingLookups.length === 1 ? 'is' : 'are'} not available; the fields that read {missingLookups.length === 1 ? 'it' : 'them'} fall back to plain inputs.\n </p>\n )}\n\n {selected.input_schema ? (\n <RichInvokeForm selected={selected} schema={selected.input_schema} metadata={metadata} lookup={lookup} submission={submission} lead={lead} />\n ) : (\n <LegacyInvokeForm selected={selected} metadata={metadata} submission={submission} lead={lead} />\n )}\n </div>\n );\n}\n","import { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport { useInvocableWorkflows, useCronStatus } from '../../../api/workflows';\nimport { PageHeader } from '../../../components/common/layout/PageHeader';\nimport { FilterSelect, FilterInput } from '../../../components/common/data/FilterBar';\nimport { useMediaQuery } from '../../../hooks/useMediaQuery';\nimport type { InvocableWorkflow, WorkflowTier } from '../../../api/types';\nimport { WorkflowSelector, workflowQueues, firstWorkflowType } from './WorkflowSelector';\nimport { identifierToTitle } from '../../../lib/identifier-label';\nimport { StartNowPanel } from './StartNowPanel';\n\nconst TYPE_PARAM = 'type';\n// A few dozen workflows read fine grouped by queue; the filters wait for scale to demand them.\nconst LIST_FILTERS_VISIBLE = false;\n\n/**\n * Invoke — the list of workflows the caller may run beside the form for the\n * one chosen. The list is grouped by queue and takes a quarter of the row;\n * the form takes the rest. Selection lives in `?type=`, and the first row\n * is preselected so the page opens on a form, never on an empty column.\n */\nexport function StartWorkflowPage() {\n const [searchParams, setSearchParams] = useSearchParams();\n const { data: invocable, isLoading } = useInvocableWorkflows();\n const { data: cronEntries } = useCronStatus();\n // Below xl the list and the form cannot share the row: the list folds\n // into a select and the form takes the full width.\n const compact = useMediaQuery('(max-width: 1279px)');\n\n const selectedType = searchParams.get(TYPE_PARAM) ?? '';\n const [search, setSearch] = useState('');\n const [activeQueue, setActiveQueue] = useState<string | null>(null);\n\n const workflows: InvocableWorkflow[] = invocable ?? [];\n const tierMap = useMemo(() => {\n const map = new Map<string, WorkflowTier>();\n for (const w of workflows) map.set(w.workflow_type, w.tier);\n return map;\n }, [workflows]);\n const selected = workflows.find((c) => c.workflow_type === selectedType);\n const activeTypes = new Set((cronEntries ?? []).filter((e) => e.active).map((e) => e.workflow_type));\n\n // A user's choice is a history entry; the opening preselect only rewrites the landing URL.\n const setType = useCallback(\n (value: string | null, opts: { replace?: boolean } = {}) => {\n setSearchParams(\n (prev) => {\n const next = new URLSearchParams(prev);\n if (value) next.set(TYPE_PARAM, value);\n else next.delete(TYPE_PARAM);\n return next;\n },\n { replace: opts.replace ?? false },\n );\n },\n [setSearchParams],\n );\n\n useEffect(() => {\n if (searchParams.get(TYPE_PARAM) || workflows.length === 0) return;\n const first = firstWorkflowType(workflows);\n if (first) setType(first, { replace: true });\n }, [workflows, searchParams, setType]);\n\n if (isLoading) {\n return (\n <div className=\"animate-pulse space-y-4\">\n <div className=\"h-8 bg-surface-sunken rounded w-48\" />\n <div className=\"h-40 bg-surface-sunken rounded\" />\n </div>\n );\n }\n\n const queues = workflowQueues(workflows);\n const form = selected\n ? <StartNowPanel selected={selected} />\n : <p className=\"text-xs text-text-tertiary\">Choose a tool to begin.</p>;\n\n return (\n <div>\n <PageHeader title=\"Invoke Tool\" docsHash=\"#docs:dashboard.md:invoke-tool\" />\n\n {workflows.length === 0 ? (\n <div className=\"py-16 text-center\">\n <p className=\"text-sm text-text-primary mb-1\">No tools to invoke</p>\n <p className=\"text-xs text-text-tertiary\">Mark workflows as invocable in the registry, or start the server with examples enabled.</p>\n </div>\n ) : compact ? (\n <>\n <label className=\"block mb-6 max-w-2xl\">\n <span className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1\">Tool</span>\n <select\n value={selectedType}\n onChange={(e) => setType(e.target.value || null)}\n className=\"select text-xs font-mono w-full\"\n >\n <option value=\"\">Choose a tool…</option>\n {queues.map((q) => (\n <optgroup key={q} label={identifierToTitle(q)}>\n {workflows\n .filter((c) => (c.task_queue || '') === q)\n .map((c) => (\n <option key={c.workflow_type} value={c.workflow_type}>{identifierToTitle(c.workflow_type)}</option>\n ))}\n </optgroup>\n ))}\n {workflows\n .filter((c) => !c.task_queue)\n .map((c) => (\n <option key={c.workflow_type} value={c.workflow_type}>{identifierToTitle(c.workflow_type)}</option>\n ))}\n </select>\n </label>\n {/* The form heading pulls itself up over the page gutter when stuck; give it that room here so it never covers the picker. */}\n <div className=\"pt-8\">{form}</div>\n </>\n ) : (\n <div className=\"flex gap-10 items-start\">\n {/* The page scrolls as a whole; the list column and the form's title and Start stick while the title of the page rides away. */}\n <aside className=\"w-1/4 min-w-[15rem] shrink-0 sticky top-0 self-start -mt-8 pt-8 max-h-[calc(100vh-5rem)] overflow-y-auto pr-1 space-y-4\" data-testid=\"invoke-list\">\n {LIST_FILTERS_VISIBLE && <div className=\"flex flex-col gap-3\">\n {queues.length > 1 && (\n <FilterSelect\n label=\"Queue\"\n value={activeQueue ?? ''}\n onChange={(v) => setActiveQueue(v || null)}\n options={queues.map((q) => ({ value: q, label: q }))}\n />\n )}\n <FilterInput\n label=\"Search\"\n value={search}\n onChange={setSearch}\n placeholder={`${workflows.length} workflows…`}\n />\n </div>}\n <WorkflowSelector\n configs={workflows}\n selectedType={selectedType}\n onSelect={(c) => setType(c.workflow_type)}\n tierMap={tierMap}\n activeTypes={activeTypes}\n search={search}\n activeQueue={activeQueue}\n compact\n />\n </aside>\n <section className=\"flex-1 min-w-0\">{form}</section>\n </div>\n )}\n </div>\n );\n}\n","import { StartWorkflowPage } from './StartWorkflowPage';\n\nexport function DurableInvokePage() {\n return <StartWorkflowPage />;\n}\n"],"names":["useMediaQuery","query","matches","setMatches","useState","useEffect","mql","onChange","e","NO_QUEUE_LABEL","workflowQueues","configs","c","groupWorkflows","search","activeQueue","q","_a","sections","queue","g","noQueue","firstWorkflowType","_b","WorkflowSelector","selectedType","onSelect","tierMap","activeTypes","compact","grouped","useMemo","jsx","workflows","jsxs","Server","Wrench","identifierToTitle","config","WorkflowRow","isSelected","tier","cronActive","variant","WorkflowIcon","Clock","WorkflowPill","Bot","NamespacePill","Play","IdentitySummary","overrideBot","onOverrideChange","showOverride","user","useAuth","effectiveBot","Fragment","UserCircle","BotPicker","StartNowPanel","selected","isSuperAdmin","hasRoleType","isAdmin","setOverrideBot","certified","setCertified","metadata","md","hasLookups","lookupData","useWorkflowLookups","lookup","foldWorkflowLookups","missingLookups","l","submission","useInvokeSubmit","lead","MarkdownRenderer","ShieldCheck","AlertTriangle","lookupLabel","RichInvokeForm","LegacyInvokeForm","TYPE_PARAM","LIST_FILTERS_VISIBLE","StartWorkflowPage","searchParams","setSearchParams","useSearchParams","invocable","isLoading","useInvocableWorkflows","cronEntries","useCronStatus","setSearch","setActiveQueue","map","w","setType","useCallback","value","opts","prev","next","first","queues","form","PageHeader","DurableInvokePage"],"mappings":"8yBAQO,SAASA,EAAcC,EAAwB,CACpD,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAkB,IAAM,CACpD,GAAI,CACF,OAAO,OAAO,WAAWH,CAAK,EAAE,OAClC,MAAQ,CACN,MAAO,EACT,CACF,CAAC,EAEDI,OAAAA,EAAAA,UAAU,IAAM,CACd,IAAIC,EACJ,GAAI,CACFA,EAAM,OAAO,WAAWL,CAAK,CAC/B,MAAQ,CACN,MACF,CACAE,EAAWG,EAAI,OAAO,EACtB,MAAMC,EAAYC,GAA2BL,EAAWK,EAAE,OAAO,EACjE,OAAAF,EAAI,iBAAiB,SAAUC,CAAQ,EAChC,IAAMD,EAAI,oBAAoB,SAAUC,CAAQ,CACzD,EAAG,CAACN,CAAK,CAAC,EAEHC,CACT,CCvBA,MAAMO,EAAiB,WAGhB,SAASC,EAAeC,EAAuC,CACpE,MAAO,CAAC,GAAG,IAAI,IAAIA,EAAQ,IAAKC,GAAMA,EAAE,UAAU,EAAE,OAAO,OAAO,CAAC,CAAC,EAAE,KAAA,CACxE,CAGO,SAASC,EACdF,EACAG,EACAC,EACoD,CACpD,MAAMC,EAAIF,EAAO,YAAA,EAAc,KAAA,EACzBZ,EAAWU,GAAA,OACf,OAACI,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gB,SAAAyB,EAAkBzB,EAAE,aAAa,CAAA,EAA3EA,EAAE,aAA2E,CAC3F,CAAA,CAAA,CAAA,CACL,EACF,EAEAoB,EAAAA,IAAC,MAAA,CAAI,UAAU,OAAQ,SAAA6E,CAAA,CAAK,CAAA,CAAA,CAC9B,EAEA3E,EAAAA,KAAC,MAAA,CAAI,UAAU,0BAEb,SAAA,CAAAA,EAAAA,KAAC,QAAA,CAAM,UAAU,0HAA0H,cAAY,cACpJ,SAAA,CAAAqD,GAgBDvD,EAAAA,IAACR,GAAA,CACC,QAASS,EACT,aAAAR,EACA,SAAWb,GAAMyF,EAAQzF,EAAE,aAAa,EACxC,QAAAe,EACA,YAAAC,EACA,OAAAd,EACA,YAAAC,EACA,QAAO,EAAA,CAAA,CACT,EACF,EACAiB,EAAAA,IAAC,UAAA,CAAQ,UAAU,iBAAkB,SAAA6E,CAAA,CAAK,CAAA,CAAA,CAC5C,CAAA,EAEJ,CAEJ,CCtJO,SAASE,IAAoB,CAClC,aAAQvB,GAAA,EAAkB,CAC5B"}
1
+ {"version":3,"file":"index-CnhNCVPc.js","sources":["../../src/hooks/useMediaQuery.ts","../../src/pages/workflows/start/WorkflowSelector.tsx","../../src/pages/workflows/start/IdentitySummary.tsx","../../src/pages/workflows/start/StartNowPanel.tsx","../../src/pages/workflows/start/StartWorkflowPage.tsx","../../src/pages/workflows/start/DurableInvokePage.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * Tracks a viewport media query. Unlike container measurement, the viewport\n * is stable while shell panels open and close, so layout decisions made on\n * it never feed back into themselves. Returns false in environments without\n * matchMedia (jsdom), which callers treat as \"wide\".\n */\nexport function useMediaQuery(query: string): boolean {\n const [matches, setMatches] = useState<boolean>(() => {\n try {\n return window.matchMedia(query).matches;\n } catch {\n return false;\n }\n });\n\n useEffect(() => {\n let mql: MediaQueryList;\n try {\n mql = window.matchMedia(query);\n } catch {\n return;\n }\n setMatches(mql.matches);\n const onChange = (e: MediaQueryListEvent) => setMatches(e.matches);\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, [query]);\n\n return matches;\n}\n","import { useMemo } from 'react';\nimport { Bot, Clock, Play, Server, Wrench } from 'lucide-react';\nimport { WorkflowPill } from '../../../components/common/display/WorkflowPill';\nimport { WorkflowIcon } from '../../../components/common/display/WorkflowIcon';\nimport { identifierToTitle } from '../../../lib/identifier-label';\nimport { NamespacePill } from '../../../components/common/display/NamespacePill';\nimport type { LTWorkflowConfig, WorkflowTier } from '../../../api/types';\n\nconst NO_QUEUE_LABEL = 'No Queue';\n\n/** The queue set a filter offers — shared with the grouping below. */\nexport function workflowQueues(configs: LTWorkflowConfig[]): string[] {\n return [...new Set(configs.map((c) => c.task_queue).filter(Boolean))].sort() as string[];\n}\n\n/** One section per task queue; unqueued workflows trail under their own heading when no queue filter is active. */\nexport function groupWorkflows(\n configs: LTWorkflowConfig[],\n search: string,\n activeQueue: string | null,\n): { queue: string; workflows: LTWorkflowConfig[] }[] {\n const q = search.toLowerCase().trim();\n const matches = (c: LTWorkflowConfig) =>\n !q || c.workflow_type.toLowerCase().includes(q) || c.description?.toLowerCase().includes(q);\n\n const targetQueues = activeQueue ? [activeQueue] : workflowQueues(configs);\n const sections = targetQueues\n .map((queue) => ({ queue, workflows: configs.filter((c) => c.task_queue === queue && matches(c)) }))\n .filter((g) => g.workflows.length > 0);\n\n if (!activeQueue) {\n const noQueue = configs.filter((c) => !c.task_queue && matches(c));\n if (noQueue.length > 0) sections.push({ queue: '', workflows: noQueue });\n }\n return sections;\n}\n\n/** The first row of the unfiltered list — what the page preselects. */\nexport function firstWorkflowType(configs: LTWorkflowConfig[]): string | null {\n return groupWorkflows(configs, '', null)[0]?.workflows[0]?.workflow_type ?? null;\n}\n\nexport function WorkflowSelector({\n configs,\n selectedType,\n onSelect,\n tierMap,\n activeTypes,\n search,\n activeQueue,\n compact = false,\n}: {\n configs: LTWorkflowConfig[];\n selectedType: string;\n onSelect: (config: LTWorkflowConfig) => void;\n tierMap: Map<string, WorkflowTier>;\n activeTypes?: Set<string>;\n search: string;\n activeQueue: string | null;\n /** The narrow list column beside the form: name and tier only, headings in flow. */\n compact?: boolean;\n}) {\n const grouped = useMemo(() => groupWorkflows(configs, search, activeQueue), [configs, search, activeQueue]);\n\n if (grouped.length === 0) {\n return <p className=\"text-sm text-text-tertiary py-8 text-center\">No workflows match your filter.</p>;\n }\n\n return (\n <div className={compact ? 'space-y-6' : 'space-y-10'}>\n {grouped.map(({ queue, workflows }) => (\n <div key={queue || '__none__'}>\n <div className={`flex items-center gap-2 py-2 mb-1 border-b border-surface-border ${compact ? '' : 'sticky top-[60px] z-10 bg-surface mb-2'}`}>\n {queue ? (\n <Server className=\"w-3 h-3 text-accent shrink-0\" strokeWidth={1.5} />\n ) : (\n <Wrench className=\"w-3 h-3 text-text-quaternary shrink-0\" strokeWidth={1.5} />\n )}\n <h2 className=\"section-h2 truncate\" title={queue || undefined}>{queue ? identifierToTitle(queue) : NO_QUEUE_LABEL}</h2>\n <span className=\"text-xs text-text-quaternary\">{workflows.length}</span>\n </div>\n <div className={compact ? '' : 'divide-y divide-surface-border/30'}>\n {workflows.map((config) => (\n <WorkflowRow\n key={config.workflow_type}\n config={config}\n isSelected={selectedType === config.workflow_type}\n tier={tierMap.get(config.workflow_type) ?? 'durable'}\n cronActive={activeTypes?.has(config.workflow_type) ?? false}\n onSelect={onSelect}\n compact={compact}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n );\n}\n\nfunction WorkflowRow({\n config,\n isSelected,\n tier,\n cronActive,\n onSelect,\n compact,\n}: {\n config: LTWorkflowConfig;\n isSelected: boolean;\n tier: WorkflowTier;\n cronActive: boolean;\n onSelect: (config: LTWorkflowConfig) => void;\n compact: boolean;\n}) {\n const variant = tier === 'certified' ? 'certified' : tier === 'registered' ? 'registered' : 'durable';\n\n if (compact) {\n return (\n <button\n onClick={() => onSelect(config)}\n aria-current={isSelected ? 'true' : undefined}\n title={config.workflow_type}\n className={`group w-full text-left flex items-center gap-2.5 pl-3 pr-2 py-2 border-l-2 transition-colors ${\n isSelected ? 'border-accent bg-accent/10 text-accent' : 'border-transparent text-text-primary hover:bg-surface-hover'\n }`}\n >\n <WorkflowIcon icon={config.icon} tier={tier} className={`w-5 h-5 shrink-0 ${isSelected ? 'text-accent' : 'text-accent/65'}`} />\n <span className=\"text-sm truncate\">{identifierToTitle(config.workflow_type)}</span>\n {cronActive && (\n <span title=\"Cron schedule active\" className=\"ml-auto shrink-0\">\n <Clock className=\"w-3 h-3 text-status-success/70\" />\n </span>\n )}\n </button>\n );\n }\n\n return (\n <button\n onClick={() => onSelect(config)}\n className=\"group relative w-full text-left py-2 px-3 -mx-3 rounded-md hover:bg-surface-hover/30 transition-colors duration-150\"\n >\n {isSelected && (\n <span className=\"absolute left-0 top-1 bottom-1 w-0.5 bg-accent rounded-full\" />\n )}\n <div className=\"flex items-center gap-3\">\n <WorkflowPill type={config.workflow_type} size=\"md\" variant={variant} />\n {config.description && (\n <p className=\"flex-1 min-w-0 truncate text-2xs text-text-tertiary group-hover:text-text-secondary transition-colors\">\n {config.description}\n </p>\n )}\n <span className=\"ml-auto flex items-center gap-2 shrink-0\">\n {config.execute_as && (\n <span className=\"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-2xs bg-accent/10 text-accent rounded\">\n <Bot className=\"w-2.5 h-2.5\" />\n {config.execute_as}\n </span>\n )}\n {cronActive && (\n <span title=\"Cron schedule active\">\n <Clock className=\"w-3 h-3 text-status-success/70 shrink-0\" />\n </span>\n )}\n <NamespacePill namespace=\"durable\" />\n <span title=\"Configure & invoke\">\n <Play\n className={`w-3 h-3 transition-opacity ${\n isSelected ? 'text-accent opacity-100' : 'text-accent opacity-0 group-hover:opacity-100'\n }`}\n strokeWidth={1.5}\n />\n </span>\n </span>\n </div>\n </button>\n );\n}\n","import { Bot, UserCircle } from 'lucide-react';\nimport { BotPicker } from '../../../components/common/form/BotPicker';\nimport { useAuth } from '../../../hooks/useAuth';\nimport type { LTWorkflowConfig } from '../../../api/types';\n\nexport function IdentitySummary({\n config,\n overrideBot,\n onOverrideChange,\n showOverride,\n}: {\n config: LTWorkflowConfig;\n overrideBot?: string;\n onOverrideChange?: (botExternalId: string) => void;\n showOverride?: boolean;\n}) {\n const { user } = useAuth();\n const effectiveBot = overrideBot || config.execute_as;\n\n return (\n <div className=\"bg-surface-sunken rounded-lg px-4 py-3 space-y-3\">\n <div>\n <div className=\"flex items-center justify-between mb-1\">\n <span className=\"text-2xs text-text-tertiary uppercase tracking-wider font-medium\">Running as</span>\n {effectiveBot && !overrideBot && (\n <span className=\"text-2xs text-text-tertiary\">configured default</span>\n )}\n {overrideBot && (\n <span className=\"text-2xs text-accent\">admin override</span>\n )}\n </div>\n {/* Read-only identity, styled as a field so it reads consistently with\n the Override control below and pops off the sunken band. */}\n <div className=\"field flex items-center gap-1.5\">\n {effectiveBot ? (\n <>\n <Bot className=\"w-3.5 h-3.5 text-accent/70 shrink-0\" />\n <span className=\"text-xs text-text-primary font-mono\">{effectiveBot}</span>\n </>\n ) : (\n <>\n <UserCircle className=\"w-3.5 h-3.5 text-text-tertiary shrink-0\" />\n <span className=\"text-xs text-text-primary\">\n {user?.displayName || user?.username || 'you'}\n </span>\n </>\n )}\n </div>\n </div>\n {showOverride && onOverrideChange && (\n <div>\n <label className=\"text-2xs text-text-tertiary uppercase tracking-wider font-medium mb-1 block\">Override identity</label>\n <BotPicker\n selected={overrideBot ?? ''}\n onChange={onOverrideChange}\n placeholder={config.execute_as ? `Default: ${config.execute_as}` : 'Invoking user (default)'}\n />\n </div>\n )}\n </div>\n );\n}\n","import { useEffect, useMemo, useState } from 'react';\nimport { lookupLabel } from '../../../lib/lookup-label';\nimport { AlertTriangle, ShieldCheck } from 'lucide-react';\nimport { useAuth } from '../../../hooks/useAuth';\nimport { foldWorkflowLookups, useWorkflowLookups } from '../../../api/workflows';\nimport type { InvocableWorkflow } from '../../../api/types';\nimport { WorkflowIcon } from '../../../components/common/display/WorkflowIcon';\nimport { MarkdownRenderer } from '../../../components/common/display/MarkdownRenderer';\nimport { identifierToTitle } from '../../../lib/identifier-label';\nimport { IdentitySummary } from './IdentitySummary';\nimport { LegacyInvokeForm } from './LegacyInvokeForm';\nimport { RichInvokeForm } from './RichInvokeForm';\nimport { useInvokeSubmit } from './use-invoke-submit';\n\n/**\n * The form column. The workflow's name is the column's heading and stays\n * put; Start stays put at the bottom; description, identity, options, and\n* the fields scroll between them. A declared input_schema renders the\n * x-lt-* form, with pinned input_lookups resolved into its lookup domain;\n * otherwise the envelope template form.\n */\nexport function StartNowPanel({ selected }: { selected: InvocableWorkflow }) {\n const { isSuperAdmin, hasRoleType } = useAuth();\n const isAdmin = isSuperAdmin || hasRoleType('admin');\n const [overrideBot, setOverrideBot] = useState('');\n // Per-run interceptor opt-out, offered when the registration is certified.\n const [certified, setCertified] = useState(selected.certified);\n\n useEffect(() => {\n setOverrideBot('');\n setCertified(selected.certified);\n }, [selected.workflow_type, selected.certified]);\n\n const metadata = useMemo(() => {\n const md = selected.envelope_schema?.metadata;\n return md && typeof md === 'object' ? (md as Record<string, unknown>) : {};\n }, [selected.envelope_schema]);\n\n const hasLookups = Array.isArray(selected.input_lookups) && selected.input_lookups.length > 0;\n const { data: lookupData } = useWorkflowLookups(selected.workflow_type, hasLookups);\n const lookup = useMemo(() => (lookupData ? foldWorkflowLookups(lookupData.lookups) : undefined), [lookupData]);\n const missingLookups = lookupData?.lookups.filter((l) => l.missing) ?? [];\n\n const submission = useInvokeSubmit(selected, { certified, overrideBot });\n\n const lead = (\n <>\n {selected.description && (\n <MarkdownRenderer content={selected.description} className=\"text-xs text-text-secondary leading-relaxed\" />\n )}\n <IdentitySummary\n config={selected}\n overrideBot={overrideBot}\n onOverrideChange={setOverrideBot}\n showOverride={isAdmin}\n />\n {selected.certified && (\n <label className=\"flex items-center gap-2 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={certified}\n onChange={(e) => setCertified(e.target.checked)}\n className=\"rounded border-surface-border text-accent focus:ring-accent/30\"\n />\n <ShieldCheck className=\"w-3.5 h-3.5 text-text-tertiary\" />\n <span className=\"text-xs text-text-secondary\">Enable task tracking and escalation routing</span>\n </label>\n )}\n </>\n );\n\n return (\n <div className=\"max-w-form\" data-testid=\"invoke-form\">\n {/* Sticks to the top of the shell scroll; the pulled-up padding covers the page gutter above it. */}\n <header className=\"sticky top-0 z-10 bg-surface -mt-8 pt-8 flex items-baseline gap-3 min-w-0 pb-3 mb-5 border-b border-surface-border/60\">\n <WorkflowIcon icon={selected.icon} tier={selected.tier} className=\"w-7 h-7 self-center shrink-0 text-accent\" />\n <h2 className=\"heading-2 truncate\" title={selected.workflow_type}>\n {identifierToTitle(selected.workflow_type)}\n </h2>\n <span className=\"text-2xs font-mono text-text-quaternary shrink-0\">{selected.workflow_type}</span>\n <span className=\"text-2xs uppercase tracking-widest text-text-tertiary shrink-0\">{selected.tier}</span>\n {selected.task_queue && (\n <span className=\"text-2xs font-mono text-text-quaternary truncate\">{selected.task_queue}</span>\n )}\n </header>\n\n {missingLookups.length > 0 && (\n <p className=\"flex items-center gap-1.5 text-2xs text-status-warning mb-4\" data-testid=\"lookup-missing\">\n <AlertTriangle className=\"w-3 h-3 shrink-0\" strokeWidth={1.5} />\n {missingLookups.map(lookupLabel).join(', ')} {missingLookups.length === 1 ? 'is' : 'are'} not available; the fields that read {missingLookups.length === 1 ? 'it' : 'them'} fall back to plain inputs.\n </p>\n )}\n\n {selected.input_schema ? (\n <RichInvokeForm selected={selected} schema={selected.input_schema} metadata={metadata} lookup={lookup} submission={submission} lead={lead} />\n ) : (\n <LegacyInvokeForm selected={selected} metadata={metadata} submission={submission} lead={lead} />\n )}\n </div>\n );\n}\n","import { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport { useInvocableWorkflows, useCronStatus } from '../../../api/workflows';\nimport { PageHeader } from '../../../components/common/layout/PageHeader';\nimport { FilterSelect, FilterInput } from '../../../components/common/data/FilterBar';\nimport { useMediaQuery } from '../../../hooks/useMediaQuery';\nimport type { InvocableWorkflow, WorkflowTier } from '../../../api/types';\nimport { WorkflowSelector, workflowQueues, firstWorkflowType } from './WorkflowSelector';\nimport { identifierToTitle } from '../../../lib/identifier-label';\nimport { StartNowPanel } from './StartNowPanel';\n\nconst TYPE_PARAM = 'type';\n// A few dozen workflows read fine grouped by queue; the filters wait for scale to demand them.\nconst LIST_FILTERS_VISIBLE = false;\n\n/**\n * Invoke — the list of workflows the caller may run beside the form for the\n * one chosen. The list is grouped by queue and takes a quarter of the row;\n * the form takes the rest. Selection lives in `?type=`, and the first row\n * is preselected so the page opens on a form, never on an empty column.\n */\nexport function StartWorkflowPage() {\n const [searchParams, setSearchParams] = useSearchParams();\n const { data: invocable, isLoading } = useInvocableWorkflows();\n const { data: cronEntries } = useCronStatus();\n // Below xl the list and the form cannot share the row: the list folds\n // into a select and the form takes the full width.\n const compact = useMediaQuery('(max-width: 1279px)');\n\n const selectedType = searchParams.get(TYPE_PARAM) ?? '';\n const [search, setSearch] = useState('');\n const [activeQueue, setActiveQueue] = useState<string | null>(null);\n\n const workflows: InvocableWorkflow[] = invocable ?? [];\n const tierMap = useMemo(() => {\n const map = new Map<string, WorkflowTier>();\n for (const w of workflows) map.set(w.workflow_type, w.tier);\n return map;\n }, [workflows]);\n const selected = workflows.find((c) => c.workflow_type === selectedType);\n const activeTypes = new Set((cronEntries ?? []).filter((e) => e.active).map((e) => e.workflow_type));\n\n // A user's choice is a history entry; the opening preselect only rewrites the landing URL.\n const setType = useCallback(\n (value: string | null, opts: { replace?: boolean } = {}) => {\n setSearchParams(\n (prev) => {\n const next = new URLSearchParams(prev);\n if (value) next.set(TYPE_PARAM, value);\n else next.delete(TYPE_PARAM);\n return next;\n },\n { replace: opts.replace ?? false },\n );\n },\n [setSearchParams],\n );\n\n useEffect(() => {\n if (searchParams.get(TYPE_PARAM) || workflows.length === 0) return;\n const first = firstWorkflowType(workflows);\n if (first) setType(first, { replace: true });\n }, [workflows, searchParams, setType]);\n\n if (isLoading) {\n return (\n <div className=\"animate-pulse space-y-4\">\n <div className=\"h-8 bg-surface-sunken rounded w-48\" />\n <div className=\"h-40 bg-surface-sunken rounded\" />\n </div>\n );\n }\n\n const queues = workflowQueues(workflows);\n const form = selected\n ? <StartNowPanel selected={selected} />\n : <p className=\"text-xs text-text-tertiary\">Choose a tool to begin.</p>;\n\n return (\n <div>\n <PageHeader title=\"Invoke Tool\" docsHash=\"#docs:dashboard.md:invoke-tool\" />\n\n {workflows.length === 0 ? (\n <div className=\"py-16 text-center\">\n <p className=\"text-sm text-text-primary mb-1\">No tools to invoke</p>\n <p className=\"text-xs text-text-tertiary\">Mark workflows as invocable in the registry, or start the server with examples enabled.</p>\n </div>\n ) : compact ? (\n <>\n <label className=\"block mb-6 max-w-2xl\">\n <span className=\"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1\">Tool</span>\n <select\n value={selectedType}\n onChange={(e) => setType(e.target.value || null)}\n className=\"select text-xs font-mono w-full\"\n >\n <option value=\"\">Choose a tool…</option>\n {queues.map((q) => (\n <optgroup key={q} label={identifierToTitle(q)}>\n {workflows\n .filter((c) => (c.task_queue || '') === q)\n .map((c) => (\n <option key={c.workflow_type} value={c.workflow_type}>{identifierToTitle(c.workflow_type)}</option>\n ))}\n </optgroup>\n ))}\n {workflows\n .filter((c) => !c.task_queue)\n .map((c) => (\n <option key={c.workflow_type} value={c.workflow_type}>{identifierToTitle(c.workflow_type)}</option>\n ))}\n </select>\n </label>\n {/* The form heading pulls itself up over the page gutter when stuck; give it that room here so it never covers the picker. */}\n <div className=\"pt-8\">{form}</div>\n </>\n ) : (\n <div className=\"flex gap-10 items-start\">\n {/* The page scrolls as a whole; the list column and the form's title and Start stick while the title of the page rides away. */}\n <aside className=\"w-1/4 min-w-[15rem] shrink-0 sticky top-0 self-start -mt-8 pt-8 max-h-[calc(100vh-5rem)] overflow-y-auto pr-1 space-y-4\" data-testid=\"invoke-list\">\n {LIST_FILTERS_VISIBLE && <div className=\"flex flex-col gap-3\">\n {queues.length > 1 && (\n <FilterSelect\n label=\"Queue\"\n value={activeQueue ?? ''}\n onChange={(v) => setActiveQueue(v || null)}\n options={queues.map((q) => ({ value: q, label: q }))}\n />\n )}\n <FilterInput\n label=\"Search\"\n value={search}\n onChange={setSearch}\n placeholder={`${workflows.length} workflows…`}\n />\n </div>}\n <WorkflowSelector\n configs={workflows}\n selectedType={selectedType}\n onSelect={(c) => setType(c.workflow_type)}\n tierMap={tierMap}\n activeTypes={activeTypes}\n search={search}\n activeQueue={activeQueue}\n compact\n />\n </aside>\n <section className=\"flex-1 min-w-0\">{form}</section>\n </div>\n )}\n </div>\n );\n}\n","import { StartWorkflowPage } from './StartWorkflowPage';\n\nexport function DurableInvokePage() {\n return <StartWorkflowPage />;\n}\n"],"names":["useMediaQuery","query","matches","setMatches","useState","useEffect","mql","onChange","e","NO_QUEUE_LABEL","workflowQueues","configs","c","groupWorkflows","search","activeQueue","q","_a","sections","queue","g","noQueue","firstWorkflowType","_b","WorkflowSelector","selectedType","onSelect","tierMap","activeTypes","compact","grouped","useMemo","jsx","workflows","jsxs","Server","Wrench","identifierToTitle","config","WorkflowRow","isSelected","tier","cronActive","variant","WorkflowIcon","Clock","WorkflowPill","Bot","NamespacePill","Play","IdentitySummary","overrideBot","onOverrideChange","showOverride","user","useAuth","effectiveBot","Fragment","UserCircle","BotPicker","StartNowPanel","selected","isSuperAdmin","hasRoleType","isAdmin","setOverrideBot","certified","setCertified","metadata","md","hasLookups","lookupData","useWorkflowLookups","lookup","foldWorkflowLookups","missingLookups","l","submission","useInvokeSubmit","lead","MarkdownRenderer","ShieldCheck","AlertTriangle","lookupLabel","RichInvokeForm","LegacyInvokeForm","TYPE_PARAM","LIST_FILTERS_VISIBLE","StartWorkflowPage","searchParams","setSearchParams","useSearchParams","invocable","isLoading","useInvocableWorkflows","cronEntries","useCronStatus","setSearch","setActiveQueue","map","w","setType","useCallback","value","opts","prev","next","first","queues","form","P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d,EACA,YAAAC,EACA,QAAO,EAAA,CAAA,CACT,EACF,EACAiB,EAAAA,IAAC,UAAA,CAAQ,UAAU,iBAAkB,SAAA6E,CAAA,CAAK,CAAA,CAAA,CAC5C,CAAA,EAEJ,CAEJ,CCtJO,SAASE,IAAoB,CAClC,aAAQvB,GAAA,EAAkB,CAC5B"}
@@ -1,2 +1,2 @@
1
- import{a as i,j as e}from"./vendor-query-DvWWuNIB.js";import{P as ye}from"./PageHeaderWithStats-DwnKQ06j.js";import{F as we,b as ke}from"./FilterBar-22FDO0R_.js";import{u as Ne}from"./useFilterParams-DBRw1Hcv.js";import{u as ve}from"./useNamespace-Cj7t8eQd.js";import{a as ee,u as Ce,b as $e,c as Se,d as _e}from"./controlplane-D82a5cfq.js";import{M as Te,C as W,k as Ee,J as Re}from"./index-CSr5q355.js";import{ab as K,bO as U,k as Me,bP as Z,G as J,e as te,I as Pe,a0 as Ae,az as Le,R as We,a5 as Qe,bQ as Fe,x as Oe,Z as Be,ao as ze}from"./vendor-icons-en0_uSRD.js";import{C as I}from"./CollapsibleSection-QAXKTYc6.js";import{T as Ie}from"./TaskQueuePill-sUA1nZe-.js";import{D as Je}from"./DataTable-FjFhx0SE.js";import{R as De,a as Y}from"./RowActions-Bdd7z4eB.js";import{f as Ue}from"./vendor-react-_9U4mKFr.js";import"./EmptyState-DgC_6njU.js";import"./useContainerWidth-DSLp1gEm.js";const Ve=[{label:"15m",value:"15m"},{label:"30m",value:"30m"},{label:"1h",value:"1h"},{label:"1d",value:"1d"},{label:"7d",value:"7d"}],se={pong:"text-status-success",ping:"text-accent",throttle:"text-status-warning",job:"text-purple-400",work:"text-text-secondary",activate:"text-status-error",cron:"text-text-tertiary",user:"text-text-secondary"},He={pong:"roll call",ping:"ping",throttle:"throttle",job:"job",work:"work",activate:"activate",cron:"cron",user:"user"},qe=250;function M(t){return!!t.worker_topic}function P(t){return typeof t.throttle=="number"&&t.throttle!==0}function V(t){return t===void 0||t===0?"Normal":t===-1?"Paused":t>=864e5?`${(t/864e5).toFixed(0)}d`:t>=36e5?`${(t/36e5).toFixed(1)}h`:t>=6e4?`${(t/6e4).toFixed(1)}m`:t>=1e3?`${(t/1e3).toFixed(1)}s`:`${t}ms`}function Ge(t){if(!t)return null;const s=t.match(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.(\d+)$/);if(s){const[,r,n,o,u,l,h,d]=s;return new Date(`${r}-${n}-${o}T${u}:${l}:${h}.${d}Z`)}const a=new Date(t);return isNaN(a.getTime())?null:a}function Ke(t){const s=Ge(t);if(!s)return"--";const a=Date.now()-s.getTime();if(a<0||isNaN(a))return"--";const r=Math.floor(a/1e3);if(r<60)return`${r}s`;const n=Math.floor(r/60);if(n<60)return`${n}m`;const o=Math.floor(n/60);return o<24?`${o}h ${n%60}m`:`${Math.floor(o/24)}d ${o%24}h`}function ne(t){return t.replace(/^hmsh:[^:]+:x:/,"")||"(engine)"}function F(t){const s=t.match(/^([^:]+)::(.+?)-[A-Za-z0-9_]{10,}$/);return s?s[2]:t.length>20?t.slice(0,20)+"...":t}function Ze(t){const s=t.match(/^([^:]+)::/);return(s==null?void 0:s[1])||""}const re=[{key:"pong",label:"Roll Call",description:"Node health check responses"},{key:"ping",label:"Ping",description:"Health check broadcasts"},{key:"throttle",label:"Throttle",description:"Throttle commands"},{key:"job",label:"Job",description:"Job lifecycle events"},{key:"work",label:"Work",description:"Worker dispatch events"},{key:"activate",label:"Activate",description:"Worker activation"},{key:"cron",label:"Cron",description:"Cron schedule triggers"},{key:"user",label:"User",description:"User-defined messages"}];function B(t){return`${t.engine_id}-${t.worker_topic||"engine"}`}function Ye(t){const s=new Map;for(const a of t){if(!a.worker_topic)continue;const r=a.worker_topic;s.has(r)||s.set(r,[]),s.get(r).push(a)}return s}function T(t){let s=0,a=0,r=0;for(const n of t)if(n.counts)for(const[o,u]of Object.entries(n.counts))s+=u,o==="200"?a+=u:o==="500"&&(r+=u);return{total:s,success:a,errors:r}}function Xe(t){let s=0;for(const a of t)typeof a.stream_depth=="number"&&(s+=a.stream_depth);return s}function et(t){if(t.length===0)return"healthy";if(t.every(r=>r.throttle===-1))return"paused";const{errors:a}=T(t);return a>0||t.some(P)?"degraded":"healthy"}function tt({activeAppId:t,allProfiles:s,profiles:a}){const r=ee(),[n,o]=i.useState(new Set),[u,l]=i.useState(!1),[h,d]=i.useState([]);i.useEffect(()=>{o(new Set)},[t]);const k=i.useCallback(m=>{o(C=>{const f=new Set(C),$=B(m);return f.has($)?f.delete($):f.add($),f})},[]),b=i.useCallback(()=>{n.size===a.length?o(new Set):o(new Set(a.map(B)))},[a,n.size]),j=i.useMemo(()=>{const m=a.filter(N=>n.has(B(N)));if(m.length===0)return[];if(m.length===s.length)return[{label:"Entire Mesh"}];const C=m.filter(N=>!M(N)),f=m.filter(M),$=[];for(const N of C)$.push({label:`Engine ${N.engine_id}`,guid:N.engine_id,scope:"engines"});const A=new Map;for(const N of f){const R=N.worker_topic;A.has(R)||A.set(R,[]),A.get(R).push(N)}for(const[N,R]of A){const O=s.filter(L=>L.worker_topic===N);if(R.length===O.length)$.push({label:N,topic:N});else for(const L of R)$.push({label:`${N} ${L.engine_id}`,guid:L.engine_id})}return $},[a,s,n]);return{selectedIds:n,setSelectedIds:o,toggleCheckbox:k,toggleAll:b,throttleModalOpen:u,throttleTargets:h,selectedThrottleTargets:j,throttleMutation:r,handleBulkThrottle:m=>{const C=h.length>0?h:j;for(const f of C)r.mutate({appId:t,throttle:m,...f.topic?{topic:f.topic}:{},...f.guid?{guid:f.guid}:{},...f.scope?{scope:f.scope}:{}});l(!1),d([])},handleRowClick:(m,C)=>{const f=M(m)?`${m.worker_topic} ${m.engine_id}`:`Engine ${m.engine_id}`;d([{label:f,guid:m.engine_id,scope:C||(M(m)?"workers":"engines")}]),l(!0)},handleBulkThrottleOpen:()=>{d(j),l(!0)},handleResumeThrottle:(m,C)=>{const f=C||(M(m)?"workers":"engines");r.mutate({appId:t,throttle:0,guid:m.engine_id,scope:f})},handleResumeQueue:m=>{r.mutate({appId:t,throttle:0,topic:m})},handleQueueThrottle:m=>{d([{label:m,topic:m}]),l(!0)},closeThrottleModal:()=>{l(!1),d([])}}}const st=[{label:"Resume",ms:0},{label:"0.5s",ms:500},{label:"1s",ms:1e3},{label:"5s",ms:5e3},{label:"30s",ms:3e4},{label:"Pause",ms:-1}];function nt({target:t}){const s=t.label==="Entire Mesh",a=t.label==="All Engines"||t.label.startsWith("Engine "),r=s?"bg-status-error/10 text-status-error":a?"bg-status-active/10 text-status-active":"bg-accent/[0.06] text-text-secondary",n=t.scope==="engines"?"engine only":t.scope==="workers"?"worker only":t.guid?"guid":t.topic?"topic":"mesh";return e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-2xs font-medium rounded-lg ${r}`,children:[t.label,e.jsx("span",{className:"text-2xs opacity-50",children:n})]})}function rt({open:t,onClose:s,targets:a,onApply:r,isPending:n}){const[o,u]=i.useState("");return e.jsx(Te,{open:t,onClose:s,title:"Adjust Throttle",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Targets"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map((l,h)=>e.jsx(nt,{target:l},l.guid||l.topic||h))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Presets"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:st.map(l=>e.jsx("button",{onClick:()=>r(l.ms),disabled:n,className:`px-3 py-1.5 text-xs rounded transition-colors ${l.ms===-1?"bg-status-error/10 text-status-error hover:bg-status-error/20":l.ms===0?"bg-status-success/10 text-status-success hover:bg-status-success/20":"bg-surface-sunken text-text-secondary hover:bg-surface-hover"} disabled:opacity-50`,children:l.label},l.label))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Custom delay (seconds)"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"number",step:"0.1",min:"0",value:o,onChange:l=>u(l.target.value),placeholder:"e.g. 2.5",className:"input text-xs py-1.5 px-3 w-28"}),e.jsx("button",{onClick:()=>{const l=parseFloat(o);isNaN(l)||l<0||r(Math.round(l*1e3))},disabled:n,className:"btn-primary text-xs py-1.5 px-4 disabled:opacity-50",children:"Apply"})]})]})]})})}function at(){const{data:t}=Ce(),s=ee(),[a,r]=i.useState(null),[n,o]=i.useState(!1),u=(t==null?void 0:t.apps)??[],l=i.useCallback(async(d,k="all")=>{if(u.length===0)return;o(!0);const b=await Promise.allSettled(u.map(v=>s.mutateAsync({appId:v.appId,throttle:d,...k!=="all"?{scope:k}:{}}))),j=b.filter(v=>v.status==="rejected").length;j>0&&console.error(`Emergency throttle: ${j}/${b.length} apps failed`),o(!1),r(null)},[u,s]),h=d=>d==="engines"?"engines":d==="workers"?"workers":"everything";return a?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-status-error",children:["Pause ",h(a.scope),"?"]}),e.jsx("button",{onClick:()=>l(a.ms,a.scope),disabled:n,className:"px-2.5 py-1 text-xs rounded-md bg-status-error text-text-inverse hover:bg-status-error/90 transition-colors disabled:opacity-50",children:n?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):"Confirm"}),e.jsx("button",{onClick:()=>r(null),disabled:n,className:"px-2.5 py-1 text-xs text-text-tertiary hover:text-text-primary transition-colors disabled:opacity-50",children:"Cancel"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>r({ms:-1,scope:"all"}),disabled:n,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md text-status-error/80 hover:text-status-error hover:bg-status-error/10 transition-colors disabled:opacity-50",title:"Pause all engines and workers",children:[e.jsx(U,{className:"w-3.5 h-3.5"}),"Pause All"]}),e.jsxs("button",{onClick:()=>l(0),disabled:n,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md text-status-success/80 hover:text-status-success hover:bg-status-success/10 transition-colors disabled:opacity-50",title:"Resume all engines and workers",children:[n?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Me,{className:"w-3.5 h-3.5"}),"Resume All"]})]})}function ot({byStream:t,onNodeFilter:s}){const[a,r]=i.useState(!1);if(i.useEffect(()=>{r(!1);const d=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(d)},[t]),t.length===0)return e.jsx("p",{className:"text-xs text-text-tertiary py-4 text-center",children:"No activity in this period"});const n=t.filter(d=>d.stream_type==="engine"),o=t.filter(d=>d.stream_type==="worker"),u=Math.max(...t.map(d=>d.count)),l=d=>{const k=u>0?d.count/u*100:0,b=d.stream_type==="engine",j=b?"(all engines)":ne(d.stream_name),v=b?"bg-status-active/70":"bg-accent/60",y=b?"text-status-active":"text-text-tertiary";return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-2xs font-mono ${y} w-36 truncate text-right shrink-0`,title:d.stream_name,children:j}),e.jsx("div",{className:"flex-1 h-4 bg-surface-sunken rounded overflow-hidden",children:e.jsx("div",{className:`h-full ${v} rounded transition-all duration-500 ease-out`,style:{width:a?`${k}%`:"0%"}})}),e.jsx("span",{className:"text-2xs font-mono tabular-nums text-text-secondary w-12 text-right shrink-0",children:d.count.toLocaleString()})]},`${d.stream_type}-${d.stream_name}`)},h="text-2xs uppercase tracking-widest font-semibold mb-1 cursor-pointer hover:underline";return e.jsxs("div",{className:"space-y-1.5",children:[n.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:`${h} text-status-active/70 hover:text-status-active`,onClick:()=>s==null?void 0:s("engines"),children:"Engine Stream"}),n.map(l),o.length>0&&e.jsx("div",{className:"h-2"})]}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:`${h} text-accent/70 hover:text-accent`,onClick:()=>s==null?void 0:s("workers"),children:"Worker Streams"}),o.map(l)]})]})}function lt({queue:t,workers:s,expanded:a,onToggle:r,onWorkerClick:n,onResumeThrottle:o,onQueueThrottle:u,onResumeQueue:l,byStream:h,activeDuration:d}){const k=i.useMemo(()=>{const c=h.find(g=>g.stream_type==="worker"&&ne(g.stream_name)===t);return(c==null?void 0:c.count)??0},[h,t]),b=i.useMemo(()=>et(s),[s]),j=i.useMemo(()=>Xe(s),[s]),{errors:v}=i.useMemo(()=>T(s),[s]),y=b==="paused"?"bg-status-error":b==="degraded"?"bg-status-warning":"bg-status-success",x=i.useMemo(()=>[...s].sort((c,g)=>T([g]).total-T([c]).total),[s]),w=i.useMemo(()=>[{key:"engine_id",label:"Router",render:c=>{var m;const g=c.engine_id.replace(/^[^:]+::/,"").replace(/-[A-Za-z0-9_]{10,}$/,"")||c.engine_id,E=((m=c.engine_id.match(/^([^:]+)::/))==null?void 0:m[1])||"";return e.jsxs("div",{className:"flex items-center gap-2",title:c.engine_id,children:[e.jsx("span",{className:"text-xs text-text-secondary truncate max-w-[180px]",children:g}),E&&e.jsx("span",{className:"text-2xs text-text-tertiary/50",children:E})]})}},{key:"processed",label:"Processed",render:c=>{const g=T([c]);return e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-tertiary",children:g.total>0?g.total.toLocaleString():"--"})},className:"w-24"},{key:"throttle",label:"Throttle",render:c=>{const g=c.throttle;return g===-1?e.jsx("span",{className:"text-xs text-status-error font-medium",children:"Paused"}):g&&g>0?e.jsx("span",{className:"text-xs text-status-warning font-medium",children:V(g)}):e.jsx("span",{className:"text-xs text-text-tertiary",children:"0"})},className:"w-24"},{key:"actions",label:"",render:c=>e.jsxs(De,{children:[P(c)&&e.jsx(Y,{icon:Z,title:"Resume (remove throttle)",onClick:()=>o(c),colorClass:"text-text-tertiary hover:text-status-success"}),e.jsx(Y,{icon:J,title:"Adjust throttle",onClick:()=>n(c)})]}),className:"w-16"}],[n,o]);return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>r(t),className:"group/row relative flex items-center gap-3 w-full py-2 hover:bg-surface-hover transition-colors text-left rounded",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${y}`,title:b}),e.jsx(te,{className:`w-3.5 h-3.5 text-text-tertiary/50 transition-transform duration-200 ${a?"rotate-90":""}`,strokeWidth:2}),e.jsx(Ie,{queue:t,size:"sm"}),e.jsx("span",{className:"flex-1"}),v>0&&e.jsxs("span",{className:"text-2xs text-status-error font-medium mr-2",children:[v," errors"]}),j>0&&e.jsxs("span",{className:"flex items-center gap-1 text-2xs text-status-warning w-20",children:[e.jsx(Pe,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"font-mono tabular-nums",children:j.toLocaleString()})]}),e.jsxs("span",{className:`flex items-center gap-1 text-xs w-24 ${s.some(P)?"text-status-warning":"text-text-tertiary"}`,children:[e.jsx(Ae,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"font-mono tabular-nums",children:s.length}),e.jsx("span",{children:"workers"})]}),e.jsx("span",{className:"flex items-center gap-1 text-xs font-mono text-text-tertiary w-28 justify-end mr-16",children:k>0?e.jsxs(e.Fragment,{children:[e.jsx(Le,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),k.toLocaleString()," in ",d]}):e.jsx("span",{className:"text-text-tertiary/40",children:"—"})}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 opacity-0 group-hover/row:opacity-100 transition-opacity flex items-center gap-2",children:[s.some(P)&&e.jsx(Z,{className:"w-4 h-4 text-text-tertiary hover:text-status-success",strokeWidth:1.5,onClick:c=>{c.stopPropagation(),l(t)}}),e.jsx(J,{className:"w-4 h-4 text-text-tertiary hover:text-accent",strokeWidth:1.5,onClick:c=>{c.stopPropagation(),u(t)}})]})]}),e.jsx(W,{open:a,children:e.jsx("div",{className:"ml-6",children:e.jsx(Je,{columns:w,data:x,keyFn:B,onRowClick:n,emptyMessage:"No workers",inline:!0})})})]})}let it=0;function ct(t){const s=t.data||{},a=s.topic?String(s.topic):"",r=s.guid?String(s.guid).slice(0,8):"";switch(t.type){case"pong":return a?`Worker ${r}... on "${a}" responded`:`Engine ${r}... responded`;case"ping":return"Roll call broadcast";case"throttle":{const n=s.throttle,o=a?`queue "${a}"`:r?`node ${r}...`:"all nodes";return`${V(n)} applied to ${o}`}case"job":return`Job ${r?r+"...":""} ${s.status||"updated"}`;case"work":return`Dispatched to "${a||"worker"}" ${r?"("+r+"...)":""}`;case"activate":return`Worker "${a||"unknown"}" activated`;case"cron":return`Cron triggered ${a?'"'+a+'"':""}`;default:return a||r||t.type}}function ut(t){const s=[];let a=0;for(;a<t.length;){const r=t[a];if(r.type==="pong"){let n=a+1;for(;n<t.length&&t[n].type==="pong";)n++;const o=t.slice(a,n);if(o.length>=3)s.push({kind:"group",type:"pong",count:o.length,firstTimestamp:o[o.length-1].timestamp,lastTimestamp:o[0].timestamp,events:o});else for(const u of o)s.push({kind:"single",event:u});a=n}else s.push({kind:"single",event:r}),a++}return s}function ae({event:t}){const[s,a]=i.useState(!1);return e.jsxs("div",{className:"border-b border-surface-border/50 last:border-b-0",children:[e.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-2 py-1.5 w-full text-left hover:bg-surface-hover/50 transition-colors",children:[e.jsx("span",{className:"text-2xs font-mono text-text-tertiary whitespace-nowrap tabular-nums shrink-0",children:new Date(t.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),e.jsx("span",{className:`text-2xs font-medium px-1 py-0.5 rounded ${se[t.type]||"text-text-tertiary"} bg-surface-sunken whitespace-nowrap shrink-0`,children:He[t.type]||t.type}),e.jsx("span",{className:"text-2xs text-text-secondary flex-1 min-w-0 truncate",children:ct(t)}),e.jsx("svg",{className:`w-2.5 h-2.5 text-text-tertiary shrink-0 transition-transform duration-150 ${s?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),e.jsx(W,{open:s,children:e.jsx("div",{className:"pb-2",children:e.jsx(Re,{data:t.data})})})]})}function dt({group:t}){const[s,a]=i.useState(!1),r=t.events.filter(o=>{var u;return!((u=o.data)!=null&&u.topic)}).length,n=t.count-r;return e.jsxs("div",{className:"border-b border-surface-border/50 last:border-b-0",children:[e.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-2 py-1.5 w-full text-left hover:bg-surface-hover/50 transition-colors",children:[e.jsx("span",{className:"text-2xs font-mono text-text-tertiary whitespace-nowrap tabular-nums shrink-0",children:new Date(t.lastTimestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),e.jsx("span",{className:`text-2xs font-medium px-1 py-0.5 rounded ${se.pong} bg-surface-sunken whitespace-nowrap shrink-0`,children:"roll call"}),e.jsxs("span",{className:"text-2xs text-text-secondary flex-1 min-w-0 truncate",children:[t.count," nodes responded",r>0&&n>0?` (${r} engine${r!==1?"s":""}, ${n} worker${n!==1?"s":""})`:r>0?` (${r} engine${r!==1?"s":""})`:` (${n} worker${n!==1?"s":""})`]}),e.jsx("svg",{className:`w-2.5 h-2.5 text-text-tertiary shrink-0 transition-transform duration-150 ${s?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),e.jsx(W,{open:s,children:e.jsx("div",{className:"ml-4",children:t.events.map(o=>e.jsx(ae,{event:o},o.id))})})]})}function xt({channels:t,onToggle:s,customFilter:a,onCustomFilterChange:r}){return e.jsxs("div",{className:"space-y-3 pb-3 border-b border-surface-border mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Channels"}),e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Unchecked channels are dropped before buffering"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-1",children:re.map(n=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-0.5",children:[e.jsx("input",{type:"checkbox",checked:t.has(n.key),onChange:()=>s(n.key),className:"w-3 h-3 rounded border-border accent-accent"}),e.jsx("span",{className:"text-2xs text-text-secondary",title:n.description,children:n.label})]},n.key))}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Text Filter"}),e.jsx("input",{type:"text",value:a,onChange:n=>r(n.target.value),placeholder:"pong",className:"input text-2xs font-mono py-1 px-2 w-full"}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-1",children:["Filter by event type, e.g. ",e.jsx("span",{className:"font-mono",children:"pong"}),", ",e.jsx("span",{className:"font-mono",children:"throttle"}),", or any text in the event data."]})]})]})}function mt({bridgeActive:t}){const[s,a]=i.useState(!1),[r,n]=i.useState(!1),[o,u]=i.useState([]),[l,h]=i.useState(()=>new Set(re.map(x=>x.key))),[d,k]=i.useState(""),b=i.useRef(l);i.useEffect(()=>{b.current=l},[l]);const j=i.useRef(d);i.useEffect(()=>{j.current=d},[d]);const v=x=>{h(w=>{const c=new Set(w);return c.has(x)?c.delete(x):c.add(x),c})};Ee("lt.events.mesh.>",i.useCallback(x=>{var g;const w=((g=x.type)==null?void 0:g.replace("mesh.",""))||"unknown";if(!b.current.has(w))return;const c=j.current;c&&!`${w} ${JSON.stringify(x.data||x)}`.toLowerCase().includes(c.toLowerCase())||u(E=>[{id:++it,type:w,timestamp:x.timestamp||new Date().toISOString(),data:x.data||x},...E].slice(0,qe))},[]));const y=()=>u([]);return e.jsxs("div",{className:"border-l border-surface-border pl-6 pt-4 min-h-[300px] sticky top-14 self-start max-h-[calc(100vh-8rem)] flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Event Stream"}),e.jsx(We,{className:`w-3 h-3 ${t?"text-status-success animate-pulse":"text-text-tertiary"}`}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:t?"Live":"..."}),e.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[e.jsx("button",{onClick:()=>{a(x=>!x),n(!1)},className:`p-1 rounded transition-colors ${s?"text-accent bg-accent/10":"text-text-tertiary hover:text-text-primary"}`,title:"Configure channels",children:e.jsx(Qe,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>{n(x=>!x),a(!1)},className:`p-1 rounded transition-colors ${r?"text-accent bg-accent/10":"text-text-tertiary hover:text-text-primary"}`,title:"View raw JSON",children:e.jsx(Fe,{className:"w-3.5 h-3.5"})}),o.length>0&&e.jsx("button",{onClick:y,className:"p-1 rounded text-text-tertiary hover:text-text-primary transition-colors",title:"Clear events",children:e.jsx(Oe,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(W,{open:s,children:e.jsx(xt,{channels:l,onToggle:v,customFilter:d,onCustomFilterChange:k})}),e.jsx(W,{open:r,children:e.jsx("div",{className:"pb-3 border-b border-surface-border mb-3",children:e.jsx("pre",{className:"text-2xs font-mono text-text-tertiary bg-surface-sunken rounded-lg p-3 max-h-[50vh] overflow-auto whitespace-pre-wrap",children:JSON.stringify(o.slice(0,50),null,2)})})}),o.length>0&&e.jsxs("p",{className:"text-2xs text-text-tertiary mb-2",children:[o.length," events"]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:o.length===0?e.jsx("p",{className:"text-xs text-text-tertiary py-6 text-center",children:t?"Waiting for events...":"Subscribing..."}):ut(o).map((x,w)=>x.kind==="group"?e.jsx(dt,{group:x},`grp-${w}`):e.jsx(ae,{event:x.event},x.event.id))})]})}function ht(t){const s=[],a=[],r=[];for(const n of t)P(n)?r.push(n):n.is_scout||T([n]).total>0?s.push(n):a.push(n);return s.sort((n,o)=>n.is_scout&&!o.is_scout?-1:!n.is_scout&&o.is_scout?1:T([o]).total-T([n]).total),a.sort((n,o)=>F(n.engine_id).localeCompare(F(o.engine_id))),r.sort((n,o)=>F(n.engine_id).localeCompare(F(o.engine_id))),{active:s,idle:a,paused:r}}function D({engine:t,isFirst:s,onThrottle:a}){const r=F(t.engine_id),n=Ze(t.engine_id),o=T([t]),u=t.stream_depth??0,l=P(t);return e.jsxs("div",{className:"group/row flex items-center gap-3 py-2 hover:bg-surface-hover/50 transition-colors rounded px-1",children:[l?e.jsx(U,{className:"w-3.5 h-3.5 text-status-warning shrink-0",strokeWidth:1.5}):e.jsx(Be,{className:`w-3.5 h-3.5 shrink-0 ${o.total>0||t.is_scout?"text-status-success":"text-text-tertiary/30"}`,strokeWidth:1.5}),e.jsx("span",{className:`${s?"text-base font-medium":"text-xs"} text-text-primary truncate max-w-[180px]`,title:t.engine_id,children:r}),n&&e.jsx("span",{className:"text-2xs text-text-tertiary/50",children:n}),t.is_scout&&e.jsx("span",{className:"text-2xs text-status-warning uppercase tracking-widest",children:"scout"}),e.jsx("span",{className:"flex-1"}),l&&e.jsx("span",{className:"text-2xs text-status-warning",children:t.throttle===-1?"Paused":V(t.throttle)}),o.total>0&&e.jsx("span",{className:"text-2xs font-mono tabular-nums text-text-tertiary w-16 text-right",children:o.total.toLocaleString()}),u>0&&e.jsxs("span",{className:`text-2xs font-mono tabular-nums w-14 text-right ${u>100?"text-status-warning":"text-text-tertiary/50"}`,children:[u.toLocaleString()," q"]}),e.jsx("span",{className:"text-2xs font-mono text-text-tertiary/40 w-12 text-right",children:Ke(t.inited)}),e.jsx("span",{className:"opacity-0 group-hover/row:opacity-100 transition-opacity",children:e.jsx("button",{onClick:h=>{h.stopPropagation(),a(t)},className:"text-text-tertiary hover:text-accent transition-colors",title:l?"Resume / adjust throttle":"Pause / throttle",children:e.jsx(J,{className:"w-3.5 h-3.5",strokeWidth:1.5})})})]})}function X({label:t,engines:s,onThrottle:a}){const[r,n]=i.useState(!1);return s.length===0?null:e.jsxs("div",{className:"mt-1",children:[e.jsxs("button",{onClick:()=>n(!r),className:"flex items-center gap-1.5 text-2xs text-text-tertiary hover:text-text-secondary transition-colors py-1",children:[e.jsx(te,{className:`w-3 h-3 transition-transform duration-200 ${r?"rotate-90":""}`,strokeWidth:2}),s.length," ",t]}),e.jsx(W,{open:r,children:e.jsx("div",{className:"ml-1",children:s.map(o=>e.jsx(D,{engine:o,onThrottle:a},o.engine_id))})})]})}function pt({engines:t,onThrottle:s,isLoading:a}){const{active:r,idle:n,paused:o}=i.useMemo(()=>ht(t),[t]);return a?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Discovering engines..."}):t.length===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:"No engines found."}):r.length===0&&n.length===0?e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 py-2",children:[e.jsx(U,{className:"w-4 h-4 text-status-error shrink-0",strokeWidth:1.5}),e.jsxs("span",{className:"text-base text-status-error font-medium",children:["All ",t.length," engines paused"]})]}),e.jsx("p",{className:"text-2xs text-text-tertiary ml-7",children:"Messages are accumulating. Resume at least one engine to restore processing."}),e.jsx("div",{className:"ml-1 mt-2",children:o.map(u=>e.jsx(D,{engine:u,onThrottle:s},u.engine_id))})]}):e.jsxs("div",{children:[r.map((u,l)=>e.jsx(D,{engine:u,isFirst:l===0,onThrottle:s},u.engine_id)),e.jsx(X,{label:"idle",engines:n,onThrottle:s}),e.jsx(X,{label:"paused",engines:o,onThrottle:s})]})}function gt({collapsed:t,toggleSection:s,activeDuration:a,streamStats:r,isLoading:n,queueMap:o,expandedQueues:u,toggleQueue:l,allQueuesExpanded:h,toggleAllQueues:d,handleRowClick:k,handleResumeThrottle:b,handleQueueThrottle:j,handleResumeQueue:v,engines:y,bridgeActive:x}){return e.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-[1fr_340px] gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-12 mt-10",children:[e.jsx(I,{title:`Message Volume (${a})`,sectionKey:"volume",isCollapsed:!!t.volume,onToggle:s,contentClassName:"mt-4 ml-7",children:e.jsx(ot,{byStream:(r==null?void 0:r.byStream)??[],onNodeFilter:()=>{},onQueueFilter:()=>{}})}),e.jsx(I,{title:`Engine Routers (${y.length})`,sectionKey:"engines",isCollapsed:!!t.engines,onToggle:s,contentClassName:"mt-4 ml-7",children:e.jsx(pt,{engines:y,onThrottle:k,isLoading:n})}),e.jsx(I,{title:"Worker Routers",sectionKey:"queues",isCollapsed:!!t.queues,onToggle:s,contentClassName:"mt-4 ml-7 flex flex-col gap-0",children:n?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Discovering mesh nodes..."}):o.size===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:'No worker routers found. Click "Roll Call" to discover.'}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-end mb-2",children:e.jsx("button",{onClick:d,className:"text-2xs text-accent hover:underline",children:h?"Collapse all":"Expand all"})}),[...o.entries()].sort(([w],[c])=>w.localeCompare(c)).map(([w,c])=>e.jsx(lt,{queue:w,workers:c,expanded:u.has(w),onToggle:l,onWorkerClick:k,onResumeThrottle:b,onQueueThrottle:j,onResumeQueue:v,byStream:(r==null?void 0:r.byStream)??[],activeDuration:a},w))]})})]}),e.jsx(mt,{bridgeActive:x})]})}function Mt(){const{namespace:t,available:s}=ve(),{filters:a,setFilter:r}=Ne({filters:{app_id:"",duration:"1h"}}),n=a.app_id||t,o=a.duration||"1h",u=$e(),l=6e4,{data:h,isLoading:d,error:k,refetch:b,isFetching:j}=Se(n,l),{data:v}=_e(n,o,void 0,l),y=i.useMemo(()=>[...(h==null?void 0:h.profiles)??[]].sort((S,_)=>{const z=S.worker_topic||S.stream||"",Q=_.worker_topic||_.stream||"";return!S.worker_topic&&_.worker_topic?-1:S.worker_topic&&!_.worker_topic?1:z.localeCompare(Q)}),[h==null?void 0:h.profiles]),x=i.useMemo(()=>y.filter(p=>!M(p)),[y]),w=i.useMemo(()=>y.filter(M),[y]),c=i.useMemo(()=>Ye(y),[y]),g=y.filter(P).length,E=i.useMemo(()=>{const p=new Set(s);return n&&p.add(n),[...p].sort().map(S=>({value:S,label:S}))},[s,n]),[m]=Ue(),C=m.get("queue"),[f,$]=i.useState(()=>C?new Set([C]):new Set),A=i.useCallback(p=>{$(S=>{const _=S.has(p),z=_?new Set:new Set([p]),Q=new URLSearchParams(window.location.search);_?Q.delete("queue"):Q.set("queue",p);const G=Q.toString();return window.history.pushState(null,"",`${window.location.pathname}${G?`?${G}`:""}`),z})},[]),N=c.size>0&&[...c.keys()].every(p=>f.has(p)),R=i.useCallback(()=>{$(N?new Set:new Set(c.keys()))},[N,c]),O="lt:controlplane:collapsed",[L,oe]=i.useState(()=>{try{const p=JSON.parse(localStorage.getItem(O)||"{}");return C&&(p.queues=!1),p}catch{return{}}}),le=i.useCallback(p=>{oe(S=>{const _={...S,[p]:!S[p]};return localStorage.setItem(O,JSON.stringify(_)),_})},[]),{throttleModalOpen:ie,throttleTargets:H,selectedThrottleTargets:ce,throttleMutation:ue,handleBulkThrottle:de,handleRowClick:xe,handleResumeThrottle:me,handleResumeQueue:he,handleQueueThrottle:pe,closeThrottleModal:ge}=tt({activeAppId:n,allProfiles:y,profiles:y}),fe=i.useMemo(()=>{const p=[{label:"Engines",value:x.length,dotClass:"bg-status-active"},{label:"Workers",value:w.length,dotClass:"bg-text-secondary"},{label:"Topics",value:c.size}];return g>0&&p.push({label:"Throttled",value:g,dotClass:"bg-status-warning"}),p},[x.length,w.length,c.size,g]),[q,be]=i.useState(!1),je=i.useCallback(()=>{u.mutate({appId:n},{onSuccess:()=>be(!0)})},[n,u]);return i.useEffect(()=>{!q&&n&&je()},[n]),e.jsxs("div",{children:[e.jsx(ye,{title:"Routers",docsHash:"#docs:dashboard.md:task-queues",stats:fe,actions:e.jsx(at,{})}),e.jsxs(we,{actions:e.jsx("div",{className:"flex items-center gap-1",children:Ve.map(p=>e.jsx("button",{onClick:()=>r("duration",p.value),className:`px-3 py-1 text-xs rounded-full transition-colors ${o===p.value?"bg-accent text-text-inverse":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:p.label},p.value))}),children:[e.jsx(ke,{label:"Application",value:a.app_id,onChange:p=>r("app_id",p),options:E}),e.jsxs("button",{onClick:()=>b(),disabled:j,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-tertiary hover:text-text-primary transition-colors disabled:opacity-50",children:[e.jsx(ze,{className:`w-3.5 h-3.5 ${j?"animate-spin":""}`}),"Roll Call"]})]}),k&&e.jsx("div",{className:"mb-6 px-4 py-3 rounded bg-status-error/10 border border-status-error/20",children:e.jsx("p",{className:"text-xs text-status-error font-medium",children:k.message==="Session expired"?"Session expired — please log in again.":`Failed to load mesh data: ${k.message}`})}),e.jsx(gt,{collapsed:L,toggleSection:le,activeDuration:o,streamStats:v,isLoading:d,queueMap:c,expandedQueues:f,toggleQueue:A,allQueuesExpanded:N,toggleAllQueues:R,handleRowClick:xe,handleResumeThrottle:me,handleQueueThrottle:pe,handleResumeQueue:he,engines:x,bridgeActive:q}),e.jsx(rt,{open:ie,onClose:ge,targets:H.length>0?H:ce,onApply:de,isPending:ue.isPending})]})}export{Mt as ControlPlanePage};
2
- //# sourceMappingURL=index-DOkHnsLK.js.map
1
+ import{a as i,j as e}from"./vendor-query-DvWWuNIB.js";import{P as ye}from"./PageHeaderWithStats-DwnKQ06j.js";import{F as we,b as ke}from"./FilterBar-Blt7qcUc.js";import{u as Ne}from"./useFilterParams-DBRw1Hcv.js";import{u as ve}from"./useNamespace-Bu42ipvu.js";import{a as ee,u as Ce,b as $e,c as Se,d as _e}from"./controlplane-B96o1-zT.js";import{M as Te,C as W,k as Ee,J as Re}from"./index-CXNh7LuG.js";import{ab as K,bO as U,k as Me,bP as Z,G as J,e as te,I as Pe,a0 as Ae,az as Le,R as We,a5 as Qe,bQ as Fe,x as Oe,Z as Be,ao as ze}from"./vendor-icons-en0_uSRD.js";import{C as I}from"./CollapsibleSection-BAizcNCt.js";import{T as Ie}from"./TaskQueuePill-sUA1nZe-.js";import{D as Je}from"./DataTable-FjFhx0SE.js";import{R as De,a as Y}from"./RowActions-Bdd7z4eB.js";import{f as Ue}from"./vendor-react-_9U4mKFr.js";import"./EmptyState-DgC_6njU.js";import"./useContainerWidth-DSLp1gEm.js";const Ve=[{label:"15m",value:"15m"},{label:"30m",value:"30m"},{label:"1h",value:"1h"},{label:"1d",value:"1d"},{label:"7d",value:"7d"}],se={pong:"text-status-success",ping:"text-accent",throttle:"text-status-warning",job:"text-purple-400",work:"text-text-secondary",activate:"text-status-error",cron:"text-text-tertiary",user:"text-text-secondary"},He={pong:"roll call",ping:"ping",throttle:"throttle",job:"job",work:"work",activate:"activate",cron:"cron",user:"user"},qe=250;function M(t){return!!t.worker_topic}function P(t){return typeof t.throttle=="number"&&t.throttle!==0}function V(t){return t===void 0||t===0?"Normal":t===-1?"Paused":t>=864e5?`${(t/864e5).toFixed(0)}d`:t>=36e5?`${(t/36e5).toFixed(1)}h`:t>=6e4?`${(t/6e4).toFixed(1)}m`:t>=1e3?`${(t/1e3).toFixed(1)}s`:`${t}ms`}function Ge(t){if(!t)return null;const s=t.match(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.(\d+)$/);if(s){const[,r,n,o,u,l,h,d]=s;return new Date(`${r}-${n}-${o}T${u}:${l}:${h}.${d}Z`)}const a=new Date(t);return isNaN(a.getTime())?null:a}function Ke(t){const s=Ge(t);if(!s)return"--";const a=Date.now()-s.getTime();if(a<0||isNaN(a))return"--";const r=Math.floor(a/1e3);if(r<60)return`${r}s`;const n=Math.floor(r/60);if(n<60)return`${n}m`;const o=Math.floor(n/60);return o<24?`${o}h ${n%60}m`:`${Math.floor(o/24)}d ${o%24}h`}function ne(t){return t.replace(/^hmsh:[^:]+:x:/,"")||"(engine)"}function F(t){const s=t.match(/^([^:]+)::(.+?)-[A-Za-z0-9_]{10,}$/);return s?s[2]:t.length>20?t.slice(0,20)+"...":t}function Ze(t){const s=t.match(/^([^:]+)::/);return(s==null?void 0:s[1])||""}const re=[{key:"pong",label:"Roll Call",description:"Node health check responses"},{key:"ping",label:"Ping",description:"Health check broadcasts"},{key:"throttle",label:"Throttle",description:"Throttle commands"},{key:"job",label:"Job",description:"Job lifecycle events"},{key:"work",label:"Work",description:"Worker dispatch events"},{key:"activate",label:"Activate",description:"Worker activation"},{key:"cron",label:"Cron",description:"Cron schedule triggers"},{key:"user",label:"User",description:"User-defined messages"}];function B(t){return`${t.engine_id}-${t.worker_topic||"engine"}`}function Ye(t){const s=new Map;for(const a of t){if(!a.worker_topic)continue;const r=a.worker_topic;s.has(r)||s.set(r,[]),s.get(r).push(a)}return s}function T(t){let s=0,a=0,r=0;for(const n of t)if(n.counts)for(const[o,u]of Object.entries(n.counts))s+=u,o==="200"?a+=u:o==="500"&&(r+=u);return{total:s,success:a,errors:r}}function Xe(t){let s=0;for(const a of t)typeof a.stream_depth=="number"&&(s+=a.stream_depth);return s}function et(t){if(t.length===0)return"healthy";if(t.every(r=>r.throttle===-1))return"paused";const{errors:a}=T(t);return a>0||t.some(P)?"degraded":"healthy"}function tt({activeAppId:t,allProfiles:s,profiles:a}){const r=ee(),[n,o]=i.useState(new Set),[u,l]=i.useState(!1),[h,d]=i.useState([]);i.useEffect(()=>{o(new Set)},[t]);const k=i.useCallback(m=>{o(C=>{const f=new Set(C),$=B(m);return f.has($)?f.delete($):f.add($),f})},[]),b=i.useCallback(()=>{n.size===a.length?o(new Set):o(new Set(a.map(B)))},[a,n.size]),j=i.useMemo(()=>{const m=a.filter(N=>n.has(B(N)));if(m.length===0)return[];if(m.length===s.length)return[{label:"Entire Mesh"}];const C=m.filter(N=>!M(N)),f=m.filter(M),$=[];for(const N of C)$.push({label:`Engine ${N.engine_id}`,guid:N.engine_id,scope:"engines"});const A=new Map;for(const N of f){const R=N.worker_topic;A.has(R)||A.set(R,[]),A.get(R).push(N)}for(const[N,R]of A){const O=s.filter(L=>L.worker_topic===N);if(R.length===O.length)$.push({label:N,topic:N});else for(const L of R)$.push({label:`${N} ${L.engine_id}`,guid:L.engine_id})}return $},[a,s,n]);return{selectedIds:n,setSelectedIds:o,toggleCheckbox:k,toggleAll:b,throttleModalOpen:u,throttleTargets:h,selectedThrottleTargets:j,throttleMutation:r,handleBulkThrottle:m=>{const C=h.length>0?h:j;for(const f of C)r.mutate({appId:t,throttle:m,...f.topic?{topic:f.topic}:{},...f.guid?{guid:f.guid}:{},...f.scope?{scope:f.scope}:{}});l(!1),d([])},handleRowClick:(m,C)=>{const f=M(m)?`${m.worker_topic} ${m.engine_id}`:`Engine ${m.engine_id}`;d([{label:f,guid:m.engine_id,scope:C||(M(m)?"workers":"engines")}]),l(!0)},handleBulkThrottleOpen:()=>{d(j),l(!0)},handleResumeThrottle:(m,C)=>{const f=C||(M(m)?"workers":"engines");r.mutate({appId:t,throttle:0,guid:m.engine_id,scope:f})},handleResumeQueue:m=>{r.mutate({appId:t,throttle:0,topic:m})},handleQueueThrottle:m=>{d([{label:m,topic:m}]),l(!0)},closeThrottleModal:()=>{l(!1),d([])}}}const st=[{label:"Resume",ms:0},{label:"0.5s",ms:500},{label:"1s",ms:1e3},{label:"5s",ms:5e3},{label:"30s",ms:3e4},{label:"Pause",ms:-1}];function nt({target:t}){const s=t.label==="Entire Mesh",a=t.label==="All Engines"||t.label.startsWith("Engine "),r=s?"bg-status-error/10 text-status-error":a?"bg-status-active/10 text-status-active":"bg-accent/[0.06] text-text-secondary",n=t.scope==="engines"?"engine only":t.scope==="workers"?"worker only":t.guid?"guid":t.topic?"topic":"mesh";return e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-2xs font-medium rounded-lg ${r}`,children:[t.label,e.jsx("span",{className:"text-2xs opacity-50",children:n})]})}function rt({open:t,onClose:s,targets:a,onApply:r,isPending:n}){const[o,u]=i.useState("");return e.jsx(Te,{open:t,onClose:s,title:"Adjust Throttle",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Targets"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map((l,h)=>e.jsx(nt,{target:l},l.guid||l.topic||h))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Presets"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:st.map(l=>e.jsx("button",{onClick:()=>r(l.ms),disabled:n,className:`px-3 py-1.5 text-xs rounded transition-colors ${l.ms===-1?"bg-status-error/10 text-status-error hover:bg-status-error/20":l.ms===0?"bg-status-success/10 text-status-success hover:bg-status-success/20":"bg-surface-sunken text-text-secondary hover:bg-surface-hover"} disabled:opacity-50`,children:l.label},l.label))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Custom delay (seconds)"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"number",step:"0.1",min:"0",value:o,onChange:l=>u(l.target.value),placeholder:"e.g. 2.5",className:"input text-xs py-1.5 px-3 w-28"}),e.jsx("button",{onClick:()=>{const l=parseFloat(o);isNaN(l)||l<0||r(Math.round(l*1e3))},disabled:n,className:"btn-primary text-xs py-1.5 px-4 disabled:opacity-50",children:"Apply"})]})]})]})})}function at(){const{data:t}=Ce(),s=ee(),[a,r]=i.useState(null),[n,o]=i.useState(!1),u=(t==null?void 0:t.apps)??[],l=i.useCallback(async(d,k="all")=>{if(u.length===0)return;o(!0);const b=await Promise.allSettled(u.map(v=>s.mutateAsync({appId:v.appId,throttle:d,...k!=="all"?{scope:k}:{}}))),j=b.filter(v=>v.status==="rejected").length;j>0&&console.error(`Emergency throttle: ${j}/${b.length} apps failed`),o(!1),r(null)},[u,s]),h=d=>d==="engines"?"engines":d==="workers"?"workers":"everything";return a?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-status-error",children:["Pause ",h(a.scope),"?"]}),e.jsx("button",{onClick:()=>l(a.ms,a.scope),disabled:n,className:"px-2.5 py-1 text-xs rounded-md bg-status-error text-text-inverse hover:bg-status-error/90 transition-colors disabled:opacity-50",children:n?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):"Confirm"}),e.jsx("button",{onClick:()=>r(null),disabled:n,className:"px-2.5 py-1 text-xs text-text-tertiary hover:text-text-primary transition-colors disabled:opacity-50",children:"Cancel"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>r({ms:-1,scope:"all"}),disabled:n,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md text-status-error/80 hover:text-status-error hover:bg-status-error/10 transition-colors disabled:opacity-50",title:"Pause all engines and workers",children:[e.jsx(U,{className:"w-3.5 h-3.5"}),"Pause All"]}),e.jsxs("button",{onClick:()=>l(0),disabled:n,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md text-status-success/80 hover:text-status-success hover:bg-status-success/10 transition-colors disabled:opacity-50",title:"Resume all engines and workers",children:[n?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Me,{className:"w-3.5 h-3.5"}),"Resume All"]})]})}function ot({byStream:t,onNodeFilter:s}){const[a,r]=i.useState(!1);if(i.useEffect(()=>{r(!1);const d=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(d)},[t]),t.length===0)return e.jsx("p",{className:"text-xs text-text-tertiary py-4 text-center",children:"No activity in this period"});const n=t.filter(d=>d.stream_type==="engine"),o=t.filter(d=>d.stream_type==="worker"),u=Math.max(...t.map(d=>d.count)),l=d=>{const k=u>0?d.count/u*100:0,b=d.stream_type==="engine",j=b?"(all engines)":ne(d.stream_name),v=b?"bg-status-active/70":"bg-accent/60",y=b?"text-status-active":"text-text-tertiary";return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-2xs font-mono ${y} w-36 truncate text-right shrink-0`,title:d.stream_name,children:j}),e.jsx("div",{className:"flex-1 h-4 bg-surface-sunken rounded overflow-hidden",children:e.jsx("div",{className:`h-full ${v} rounded transition-all duration-500 ease-out`,style:{width:a?`${k}%`:"0%"}})}),e.jsx("span",{className:"text-2xs font-mono tabular-nums text-text-secondary w-12 text-right shrink-0",children:d.count.toLocaleString()})]},`${d.stream_type}-${d.stream_name}`)},h="text-2xs uppercase tracking-widest font-semibold mb-1 cursor-pointer hover:underline";return e.jsxs("div",{className:"space-y-1.5",children:[n.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:`${h} text-status-active/70 hover:text-status-active`,onClick:()=>s==null?void 0:s("engines"),children:"Engine Stream"}),n.map(l),o.length>0&&e.jsx("div",{className:"h-2"})]}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:`${h} text-accent/70 hover:text-accent`,onClick:()=>s==null?void 0:s("workers"),children:"Worker Streams"}),o.map(l)]})]})}function lt({queue:t,workers:s,expanded:a,onToggle:r,onWorkerClick:n,onResumeThrottle:o,onQueueThrottle:u,onResumeQueue:l,byStream:h,activeDuration:d}){const k=i.useMemo(()=>{const c=h.find(g=>g.stream_type==="worker"&&ne(g.stream_name)===t);return(c==null?void 0:c.count)??0},[h,t]),b=i.useMemo(()=>et(s),[s]),j=i.useMemo(()=>Xe(s),[s]),{errors:v}=i.useMemo(()=>T(s),[s]),y=b==="paused"?"bg-status-error":b==="degraded"?"bg-status-warning":"bg-status-success",x=i.useMemo(()=>[...s].sort((c,g)=>T([g]).total-T([c]).total),[s]),w=i.useMemo(()=>[{key:"engine_id",label:"Router",render:c=>{var m;const g=c.engine_id.replace(/^[^:]+::/,"").replace(/-[A-Za-z0-9_]{10,}$/,"")||c.engine_id,E=((m=c.engine_id.match(/^([^:]+)::/))==null?void 0:m[1])||"";return e.jsxs("div",{className:"flex items-center gap-2",title:c.engine_id,children:[e.jsx("span",{className:"text-xs text-text-secondary truncate max-w-[180px]",children:g}),E&&e.jsx("span",{className:"text-2xs text-text-tertiary/50",children:E})]})}},{key:"processed",label:"Processed",render:c=>{const g=T([c]);return e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-tertiary",children:g.total>0?g.total.toLocaleString():"--"})},className:"w-24"},{key:"throttle",label:"Throttle",render:c=>{const g=c.throttle;return g===-1?e.jsx("span",{className:"text-xs text-status-error font-medium",children:"Paused"}):g&&g>0?e.jsx("span",{className:"text-xs text-status-warning font-medium",children:V(g)}):e.jsx("span",{className:"text-xs text-text-tertiary",children:"0"})},className:"w-24"},{key:"actions",label:"",render:c=>e.jsxs(De,{children:[P(c)&&e.jsx(Y,{icon:Z,title:"Resume (remove throttle)",onClick:()=>o(c),colorClass:"text-text-tertiary hover:text-status-success"}),e.jsx(Y,{icon:J,title:"Adjust throttle",onClick:()=>n(c)})]}),className:"w-16"}],[n,o]);return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>r(t),className:"group/row relative flex items-center gap-3 w-full py-2 hover:bg-surface-hover transition-colors text-left rounded",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${y}`,title:b}),e.jsx(te,{className:`w-3.5 h-3.5 text-text-tertiary/50 transition-transform duration-200 ${a?"rotate-90":""}`,strokeWidth:2}),e.jsx(Ie,{queue:t,size:"sm"}),e.jsx("span",{className:"flex-1"}),v>0&&e.jsxs("span",{className:"text-2xs text-status-error font-medium mr-2",children:[v," errors"]}),j>0&&e.jsxs("span",{className:"flex items-center gap-1 text-2xs text-status-warning w-20",children:[e.jsx(Pe,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"font-mono tabular-nums",children:j.toLocaleString()})]}),e.jsxs("span",{className:`flex items-center gap-1 text-xs w-24 ${s.some(P)?"text-status-warning":"text-text-tertiary"}`,children:[e.jsx(Ae,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"font-mono tabular-nums",children:s.length}),e.jsx("span",{children:"workers"})]}),e.jsx("span",{className:"flex items-center gap-1 text-xs font-mono text-text-tertiary w-28 justify-end mr-16",children:k>0?e.jsxs(e.Fragment,{children:[e.jsx(Le,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),k.toLocaleString()," in ",d]}):e.jsx("span",{className:"text-text-tertiary/40",children:"—"})}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 opacity-0 group-hover/row:opacity-100 transition-opacity flex items-center gap-2",children:[s.some(P)&&e.jsx(Z,{className:"w-4 h-4 text-text-tertiary hover:text-status-success",strokeWidth:1.5,onClick:c=>{c.stopPropagation(),l(t)}}),e.jsx(J,{className:"w-4 h-4 text-text-tertiary hover:text-accent",strokeWidth:1.5,onClick:c=>{c.stopPropagation(),u(t)}})]})]}),e.jsx(W,{open:a,children:e.jsx("div",{className:"ml-6",children:e.jsx(Je,{columns:w,data:x,keyFn:B,onRowClick:n,emptyMessage:"No workers",inline:!0})})})]})}let it=0;function ct(t){const s=t.data||{},a=s.topic?String(s.topic):"",r=s.guid?String(s.guid).slice(0,8):"";switch(t.type){case"pong":return a?`Worker ${r}... on "${a}" responded`:`Engine ${r}... responded`;case"ping":return"Roll call broadcast";case"throttle":{const n=s.throttle,o=a?`queue "${a}"`:r?`node ${r}...`:"all nodes";return`${V(n)} applied to ${o}`}case"job":return`Job ${r?r+"...":""} ${s.status||"updated"}`;case"work":return`Dispatched to "${a||"worker"}" ${r?"("+r+"...)":""}`;case"activate":return`Worker "${a||"unknown"}" activated`;case"cron":return`Cron triggered ${a?'"'+a+'"':""}`;default:return a||r||t.type}}function ut(t){const s=[];let a=0;for(;a<t.length;){const r=t[a];if(r.type==="pong"){let n=a+1;for(;n<t.length&&t[n].type==="pong";)n++;const o=t.slice(a,n);if(o.length>=3)s.push({kind:"group",type:"pong",count:o.length,firstTimestamp:o[o.length-1].timestamp,lastTimestamp:o[0].timestamp,events:o});else for(const u of o)s.push({kind:"single",event:u});a=n}else s.push({kind:"single",event:r}),a++}return s}function ae({event:t}){const[s,a]=i.useState(!1);return e.jsxs("div",{className:"border-b border-surface-border/50 last:border-b-0",children:[e.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-2 py-1.5 w-full text-left hover:bg-surface-hover/50 transition-colors",children:[e.jsx("span",{className:"text-2xs font-mono text-text-tertiary whitespace-nowrap tabular-nums shrink-0",children:new Date(t.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),e.jsx("span",{className:`text-2xs font-medium px-1 py-0.5 rounded ${se[t.type]||"text-text-tertiary"} bg-surface-sunken whitespace-nowrap shrink-0`,children:He[t.type]||t.type}),e.jsx("span",{className:"text-2xs text-text-secondary flex-1 min-w-0 truncate",children:ct(t)}),e.jsx("svg",{className:`w-2.5 h-2.5 text-text-tertiary shrink-0 transition-transform duration-150 ${s?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),e.jsx(W,{open:s,children:e.jsx("div",{className:"pb-2",children:e.jsx(Re,{data:t.data})})})]})}function dt({group:t}){const[s,a]=i.useState(!1),r=t.events.filter(o=>{var u;return!((u=o.data)!=null&&u.topic)}).length,n=t.count-r;return e.jsxs("div",{className:"border-b border-surface-border/50 last:border-b-0",children:[e.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-2 py-1.5 w-full text-left hover:bg-surface-hover/50 transition-colors",children:[e.jsx("span",{className:"text-2xs font-mono text-text-tertiary whitespace-nowrap tabular-nums shrink-0",children:new Date(t.lastTimestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),e.jsx("span",{className:`text-2xs font-medium px-1 py-0.5 rounded ${se.pong} bg-surface-sunken whitespace-nowrap shrink-0`,children:"roll call"}),e.jsxs("span",{className:"text-2xs text-text-secondary flex-1 min-w-0 truncate",children:[t.count," nodes responded",r>0&&n>0?` (${r} engine${r!==1?"s":""}, ${n} worker${n!==1?"s":""})`:r>0?` (${r} engine${r!==1?"s":""})`:` (${n} worker${n!==1?"s":""})`]}),e.jsx("svg",{className:`w-2.5 h-2.5 text-text-tertiary shrink-0 transition-transform duration-150 ${s?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),e.jsx(W,{open:s,children:e.jsx("div",{className:"ml-4",children:t.events.map(o=>e.jsx(ae,{event:o},o.id))})})]})}function xt({channels:t,onToggle:s,customFilter:a,onCustomFilterChange:r}){return e.jsxs("div",{className:"space-y-3 pb-3 border-b border-surface-border mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Channels"}),e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Unchecked channels are dropped before buffering"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-1",children:re.map(n=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-0.5",children:[e.jsx("input",{type:"checkbox",checked:t.has(n.key),onChange:()=>s(n.key),className:"w-3 h-3 rounded border-border accent-accent"}),e.jsx("span",{className:"text-2xs text-text-secondary",title:n.description,children:n.label})]},n.key))}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Text Filter"}),e.jsx("input",{type:"text",value:a,onChange:n=>r(n.target.value),placeholder:"pong",className:"input text-2xs font-mono py-1 px-2 w-full"}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-1",children:["Filter by event type, e.g. ",e.jsx("span",{className:"font-mono",children:"pong"}),", ",e.jsx("span",{className:"font-mono",children:"throttle"}),", or any text in the event data."]})]})]})}function mt({bridgeActive:t}){const[s,a]=i.useState(!1),[r,n]=i.useState(!1),[o,u]=i.useState([]),[l,h]=i.useState(()=>new Set(re.map(x=>x.key))),[d,k]=i.useState(""),b=i.useRef(l);i.useEffect(()=>{b.current=l},[l]);const j=i.useRef(d);i.useEffect(()=>{j.current=d},[d]);const v=x=>{h(w=>{const c=new Set(w);return c.has(x)?c.delete(x):c.add(x),c})};Ee("lt.events.mesh.>",i.useCallback(x=>{var g;const w=((g=x.type)==null?void 0:g.replace("mesh.",""))||"unknown";if(!b.current.has(w))return;const c=j.current;c&&!`${w} ${JSON.stringify(x.data||x)}`.toLowerCase().includes(c.toLowerCase())||u(E=>[{id:++it,type:w,timestamp:x.timestamp||new Date().toISOString(),data:x.data||x},...E].slice(0,qe))},[]));const y=()=>u([]);return e.jsxs("div",{className:"border-l border-surface-border pl-6 pt-4 min-h-[300px] sticky top-14 self-start max-h-[calc(100vh-8rem)] flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Event Stream"}),e.jsx(We,{className:`w-3 h-3 ${t?"text-status-success animate-pulse":"text-text-tertiary"}`}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:t?"Live":"..."}),e.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[e.jsx("button",{onClick:()=>{a(x=>!x),n(!1)},className:`p-1 rounded transition-colors ${s?"text-accent bg-accent/10":"text-text-tertiary hover:text-text-primary"}`,title:"Configure channels",children:e.jsx(Qe,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>{n(x=>!x),a(!1)},className:`p-1 rounded transition-colors ${r?"text-accent bg-accent/10":"text-text-tertiary hover:text-text-primary"}`,title:"View raw JSON",children:e.jsx(Fe,{className:"w-3.5 h-3.5"})}),o.length>0&&e.jsx("button",{onClick:y,className:"p-1 rounded text-text-tertiary hover:text-text-primary transition-colors",title:"Clear events",children:e.jsx(Oe,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(W,{open:s,children:e.jsx(xt,{channels:l,onToggle:v,customFilter:d,onCustomFilterChange:k})}),e.jsx(W,{open:r,children:e.jsx("div",{className:"pb-3 border-b border-surface-border mb-3",children:e.jsx("pre",{className:"text-2xs font-mono text-text-tertiary bg-surface-sunken rounded-lg p-3 max-h-[50vh] overflow-auto whitespace-pre-wrap",children:JSON.stringify(o.slice(0,50),null,2)})})}),o.length>0&&e.jsxs("p",{className:"text-2xs text-text-tertiary mb-2",children:[o.length," events"]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:o.length===0?e.jsx("p",{className:"text-xs text-text-tertiary py-6 text-center",children:t?"Waiting for events...":"Subscribing..."}):ut(o).map((x,w)=>x.kind==="group"?e.jsx(dt,{group:x},`grp-${w}`):e.jsx(ae,{event:x.event},x.event.id))})]})}function ht(t){const s=[],a=[],r=[];for(const n of t)P(n)?r.push(n):n.is_scout||T([n]).total>0?s.push(n):a.push(n);return s.sort((n,o)=>n.is_scout&&!o.is_scout?-1:!n.is_scout&&o.is_scout?1:T([o]).total-T([n]).total),a.sort((n,o)=>F(n.engine_id).localeCompare(F(o.engine_id))),r.sort((n,o)=>F(n.engine_id).localeCompare(F(o.engine_id))),{active:s,idle:a,paused:r}}function D({engine:t,isFirst:s,onThrottle:a}){const r=F(t.engine_id),n=Ze(t.engine_id),o=T([t]),u=t.stream_depth??0,l=P(t);return e.jsxs("div",{className:"group/row flex items-center gap-3 py-2 hover:bg-surface-hover/50 transition-colors rounded px-1",children:[l?e.jsx(U,{className:"w-3.5 h-3.5 text-status-warning shrink-0",strokeWidth:1.5}):e.jsx(Be,{className:`w-3.5 h-3.5 shrink-0 ${o.total>0||t.is_scout?"text-status-success":"text-text-tertiary/30"}`,strokeWidth:1.5}),e.jsx("span",{className:`${s?"text-base font-medium":"text-xs"} text-text-primary truncate max-w-[180px]`,title:t.engine_id,children:r}),n&&e.jsx("span",{className:"text-2xs text-text-tertiary/50",children:n}),t.is_scout&&e.jsx("span",{className:"text-2xs text-status-warning uppercase tracking-widest",children:"scout"}),e.jsx("span",{className:"flex-1"}),l&&e.jsx("span",{className:"text-2xs text-status-warning",children:t.throttle===-1?"Paused":V(t.throttle)}),o.total>0&&e.jsx("span",{className:"text-2xs font-mono tabular-nums text-text-tertiary w-16 text-right",children:o.total.toLocaleString()}),u>0&&e.jsxs("span",{className:`text-2xs font-mono tabular-nums w-14 text-right ${u>100?"text-status-warning":"text-text-tertiary/50"}`,children:[u.toLocaleString()," q"]}),e.jsx("span",{className:"text-2xs font-mono text-text-tertiary/40 w-12 text-right",children:Ke(t.inited)}),e.jsx("span",{className:"opacity-0 group-hover/row:opacity-100 transition-opacity",children:e.jsx("button",{onClick:h=>{h.stopPropagation(),a(t)},className:"text-text-tertiary hover:text-accent transition-colors",title:l?"Resume / adjust throttle":"Pause / throttle",children:e.jsx(J,{className:"w-3.5 h-3.5",strokeWidth:1.5})})})]})}function X({label:t,engines:s,onThrottle:a}){const[r,n]=i.useState(!1);return s.length===0?null:e.jsxs("div",{className:"mt-1",children:[e.jsxs("button",{onClick:()=>n(!r),className:"flex items-center gap-1.5 text-2xs text-text-tertiary hover:text-text-secondary transition-colors py-1",children:[e.jsx(te,{className:`w-3 h-3 transition-transform duration-200 ${r?"rotate-90":""}`,strokeWidth:2}),s.length," ",t]}),e.jsx(W,{open:r,children:e.jsx("div",{className:"ml-1",children:s.map(o=>e.jsx(D,{engine:o,onThrottle:a},o.engine_id))})})]})}function pt({engines:t,onThrottle:s,isLoading:a}){const{active:r,idle:n,paused:o}=i.useMemo(()=>ht(t),[t]);return a?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Discovering engines..."}):t.length===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:"No engines found."}):r.length===0&&n.length===0?e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 py-2",children:[e.jsx(U,{className:"w-4 h-4 text-status-error shrink-0",strokeWidth:1.5}),e.jsxs("span",{className:"text-base text-status-error font-medium",children:["All ",t.length," engines paused"]})]}),e.jsx("p",{className:"text-2xs text-text-tertiary ml-7",children:"Messages are accumulating. Resume at least one engine to restore processing."}),e.jsx("div",{className:"ml-1 mt-2",children:o.map(u=>e.jsx(D,{engine:u,onThrottle:s},u.engine_id))})]}):e.jsxs("div",{children:[r.map((u,l)=>e.jsx(D,{engine:u,isFirst:l===0,onThrottle:s},u.engine_id)),e.jsx(X,{label:"idle",engines:n,onThrottle:s}),e.jsx(X,{label:"paused",engines:o,onThrottle:s})]})}function gt({collapsed:t,toggleSection:s,activeDuration:a,streamStats:r,isLoading:n,queueMap:o,expandedQueues:u,toggleQueue:l,allQueuesExpanded:h,toggleAllQueues:d,handleRowClick:k,handleResumeThrottle:b,handleQueueThrottle:j,handleResumeQueue:v,engines:y,bridgeActive:x}){return e.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-[1fr_340px] gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-12 mt-10",children:[e.jsx(I,{title:`Message Volume (${a})`,sectionKey:"volume",isCollapsed:!!t.volume,onToggle:s,contentClassName:"mt-4 ml-7",children:e.jsx(ot,{byStream:(r==null?void 0:r.byStream)??[],onNodeFilter:()=>{},onQueueFilter:()=>{}})}),e.jsx(I,{title:`Engine Routers (${y.length})`,sectionKey:"engines",isCollapsed:!!t.engines,onToggle:s,contentClassName:"mt-4 ml-7",children:e.jsx(pt,{engines:y,onThrottle:k,isLoading:n})}),e.jsx(I,{title:"Worker Routers",sectionKey:"queues",isCollapsed:!!t.queues,onToggle:s,contentClassName:"mt-4 ml-7 flex flex-col gap-0",children:n?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Discovering mesh nodes..."}):o.size===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:'No worker routers found. Click "Roll Call" to discover.'}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-end mb-2",children:e.jsx("button",{onClick:d,className:"text-2xs text-accent hover:underline",children:h?"Collapse all":"Expand all"})}),[...o.entries()].sort(([w],[c])=>w.localeCompare(c)).map(([w,c])=>e.jsx(lt,{queue:w,workers:c,expanded:u.has(w),onToggle:l,onWorkerClick:k,onResumeThrottle:b,onQueueThrottle:j,onResumeQueue:v,byStream:(r==null?void 0:r.byStream)??[],activeDuration:a},w))]})})]}),e.jsx(mt,{bridgeActive:x})]})}function Mt(){const{namespace:t,available:s}=ve(),{filters:a,setFilter:r}=Ne({filters:{app_id:"",duration:"1h"}}),n=a.app_id||t,o=a.duration||"1h",u=$e(),l=6e4,{data:h,isLoading:d,error:k,refetch:b,isFetching:j}=Se(n,l),{data:v}=_e(n,o,void 0,l),y=i.useMemo(()=>[...(h==null?void 0:h.profiles)??[]].sort((S,_)=>{const z=S.worker_topic||S.stream||"",Q=_.worker_topic||_.stream||"";return!S.worker_topic&&_.worker_topic?-1:S.worker_topic&&!_.worker_topic?1:z.localeCompare(Q)}),[h==null?void 0:h.profiles]),x=i.useMemo(()=>y.filter(p=>!M(p)),[y]),w=i.useMemo(()=>y.filter(M),[y]),c=i.useMemo(()=>Ye(y),[y]),g=y.filter(P).length,E=i.useMemo(()=>{const p=new Set(s);return n&&p.add(n),[...p].sort().map(S=>({value:S,label:S}))},[s,n]),[m]=Ue(),C=m.get("queue"),[f,$]=i.useState(()=>C?new Set([C]):new Set),A=i.useCallback(p=>{$(S=>{const _=S.has(p),z=_?new Set:new Set([p]),Q=new URLSearchParams(window.location.search);_?Q.delete("queue"):Q.set("queue",p);const G=Q.toString();return window.history.pushState(null,"",`${window.location.pathname}${G?`?${G}`:""}`),z})},[]),N=c.size>0&&[...c.keys()].every(p=>f.has(p)),R=i.useCallback(()=>{$(N?new Set:new Set(c.keys()))},[N,c]),O="lt:controlplane:collapsed",[L,oe]=i.useState(()=>{try{const p=JSON.parse(localStorage.getItem(O)||"{}");return C&&(p.queues=!1),p}catch{return{}}}),le=i.useCallback(p=>{oe(S=>{const _={...S,[p]:!S[p]};return localStorage.setItem(O,JSON.stringify(_)),_})},[]),{throttleModalOpen:ie,throttleTargets:H,selectedThrottleTargets:ce,throttleMutation:ue,handleBulkThrottle:de,handleRowClick:xe,handleResumeThrottle:me,handleResumeQueue:he,handleQueueThrottle:pe,closeThrottleModal:ge}=tt({activeAppId:n,allProfiles:y,profiles:y}),fe=i.useMemo(()=>{const p=[{label:"Engines",value:x.length,dotClass:"bg-status-active"},{label:"Workers",value:w.length,dotClass:"bg-text-secondary"},{label:"Topics",value:c.size}];return g>0&&p.push({label:"Throttled",value:g,dotClass:"bg-status-warning"}),p},[x.length,w.length,c.size,g]),[q,be]=i.useState(!1),je=i.useCallback(()=>{u.mutate({appId:n},{onSuccess:()=>be(!0)})},[n,u]);return i.useEffect(()=>{!q&&n&&je()},[n]),e.jsxs("div",{children:[e.jsx(ye,{title:"Routers",docsHash:"#docs:dashboard.md:task-queues",stats:fe,actions:e.jsx(at,{})}),e.jsxs(we,{actions:e.jsx("div",{className:"flex items-center gap-1",children:Ve.map(p=>e.jsx("button",{onClick:()=>r("duration",p.value),className:`px-3 py-1 text-xs rounded-full transition-colors ${o===p.value?"bg-accent text-text-inverse":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:p.label},p.value))}),children:[e.jsx(ke,{label:"Application",value:a.app_id,onChange:p=>r("app_id",p),options:E}),e.jsxs("button",{onClick:()=>b(),disabled:j,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-tertiary hover:text-text-primary transition-colors disabled:opacity-50",children:[e.jsx(ze,{className:`w-3.5 h-3.5 ${j?"animate-spin":""}`}),"Roll Call"]})]}),k&&e.jsx("div",{className:"mb-6 px-4 py-3 rounded bg-status-error/10 border border-status-error/20",children:e.jsx("p",{className:"text-xs text-status-error font-medium",children:k.message==="Session expired"?"Session expired — please log in again.":`Failed to load mesh data: ${k.message}`})}),e.jsx(gt,{collapsed:L,toggleSection:le,activeDuration:o,streamStats:v,isLoading:d,queueMap:c,expandedQueues:f,toggleQueue:A,allQueuesExpanded:N,toggleAllQueues:R,handleRowClick:xe,handleResumeThrottle:me,handleQueueThrottle:pe,handleResumeQueue:he,engines:x,bridgeActive:q}),e.jsx(rt,{open:ie,onClose:ge,targets:H.length>0?H:ce,onApply:de,isPending:ue.isPending})]})}export{Mt as ControlPlanePage};
2
+ //# sourceMappingURL=index-Czb9O4Ns.js.map