@hotmeshio/long-tail 0.10.0 → 0.10.2

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 (240) hide show
  1. package/build/api/me.d.ts +16 -0
  2. package/build/api/me.js +79 -0
  3. package/build/api/roles.d.ts +6 -0
  4. package/build/api/roles.js +10 -0
  5. package/build/lib/db/schemas/022_user_preferences.sql +18 -0
  6. package/build/routes/index.js +2 -0
  7. package/build/routes/me.d.ts +2 -0
  8. package/build/routes/me.js +57 -0
  9. package/build/sdk/index.d.ts +6 -0
  10. package/build/sdk/index.js +11 -0
  11. package/build/services/role/index.js +1 -0
  12. package/build/services/role/sql.d.ts +5 -2
  13. package/build/services/role/sql.js +7 -1
  14. package/build/services/role/types.d.ts +16 -0
  15. package/build/services/user/index.d.ts +1 -0
  16. package/build/services/user/index.js +5 -1
  17. package/build/services/user/preferences.d.ts +15 -0
  18. package/build/services/user/preferences.js +38 -0
  19. package/build/system/mcp-servers/admin/schemas.d.ts +26 -0
  20. package/build/system/mcp-servers/admin/schemas.js +6 -0
  21. package/build/system/mcp-servers/admin/users.js +6 -3
  22. package/build/system/seed/tool-manifests-admin.d.ts +167 -0
  23. package/build/system/seed/tool-manifests-admin.js +1 -1
  24. package/build/tsconfig.tsbuildinfo +1 -1
  25. package/dashboard/dist/assets/{AdminDashboard-DQS74RL0.js → AdminDashboard-Dy031e9g.js} +2 -2
  26. package/dashboard/dist/assets/{AdminDashboard-DQS74RL0.js.map → AdminDashboard-Dy031e9g.js.map} +1 -1
  27. package/dashboard/dist/assets/{AgentConfigPage-CSMCrFR4.js → AgentConfigPage-CqmtYBbC.js} +6 -6
  28. package/dashboard/dist/assets/{AgentConfigPage-CSMCrFR4.js.map → AgentConfigPage-CqmtYBbC.js.map} +1 -1
  29. package/dashboard/dist/assets/{AgentDetailPage-CDiopQ7D.js → AgentDetailPage-oYLBrN74.js} +3 -3
  30. package/dashboard/dist/assets/{AgentDetailPage-CDiopQ7D.js.map → AgentDetailPage-oYLBrN74.js.map} +1 -1
  31. package/dashboard/dist/assets/{AgentsPage-CyUXe9n4.js → AgentsPage-CHczRx5N.js} +2 -2
  32. package/dashboard/dist/assets/{AgentsPage-CyUXe9n4.js.map → AgentsPage-CHczRx5N.js.map} +1 -1
  33. package/dashboard/dist/assets/AvailableEscalationsPage-DDVuivEE.js +2 -0
  34. package/dashboard/dist/assets/AvailableEscalationsPage-DDVuivEE.js.map +1 -0
  35. package/dashboard/dist/assets/BotPicker-2QEIpc-K.js +2 -0
  36. package/dashboard/dist/assets/{BotPicker-BuCGvEed.js.map → BotPicker-2QEIpc-K.js.map} +1 -1
  37. package/dashboard/dist/assets/{CapabilitiesPage-nTv4STcG.js → CapabilitiesPage-lQJGZ_-t.js} +2 -2
  38. package/dashboard/dist/assets/{CapabilitiesPage-nTv4STcG.js.map → CapabilitiesPage-lQJGZ_-t.js.map} +1 -1
  39. package/dashboard/dist/assets/{CollapsibleSection-CkOks9Cf.js → CollapsibleSection-CHWP0WI6.js} +2 -2
  40. package/dashboard/dist/assets/{CollapsibleSection-CkOks9Cf.js.map → CollapsibleSection-CHWP0WI6.js.map} +1 -1
  41. package/dashboard/dist/assets/CountdownTimer-TXsRlTU4.js +2 -0
  42. package/dashboard/dist/assets/CountdownTimer-TXsRlTU4.js.map +1 -0
  43. package/dashboard/dist/assets/{CredentialsPage-BwA7k9Cb.js → CredentialsPage-BKxS-1sA.js} +2 -2
  44. package/dashboard/dist/assets/{CredentialsPage-BwA7k9Cb.js.map → CredentialsPage-BKxS-1sA.js.map} +1 -1
  45. package/dashboard/dist/assets/{CronLabel-jC_i-Lh9.js → CronLabel-Bd2G0Rap.js} +2 -2
  46. package/dashboard/dist/assets/{CronLabel-jC_i-Lh9.js.map → CronLabel-Bd2G0Rap.js.map} +1 -1
  47. package/dashboard/dist/assets/{CustomDurationPicker-F6bR2Q5A.js → CustomDurationPicker-j4bBrDJ6.js} +2 -2
  48. package/dashboard/dist/assets/{CustomDurationPicker-F6bR2Q5A.js.map → CustomDurationPicker-j4bBrDJ6.js.map} +1 -1
  49. package/dashboard/dist/assets/{DropZone-zxH-9B8c.js → DropZone-DNDEgMpJ.js} +2 -2
  50. package/dashboard/dist/assets/{DropZone-zxH-9B8c.js.map → DropZone-DNDEgMpJ.js.map} +1 -1
  51. package/dashboard/dist/assets/{ElapsedCell-DZ3RTZFc.js → ElapsedCell-g7GO7f8L.js} +2 -2
  52. package/dashboard/dist/assets/{ElapsedCell-DZ3RTZFc.js.map → ElapsedCell-g7GO7f8L.js.map} +1 -1
  53. package/dashboard/dist/assets/{EscalationListSchemaPage-CaMydHIO.js → EscalationListSchemaPage-CIJ-OgVC.js} +3 -3
  54. package/dashboard/dist/assets/{EscalationListSchemaPage-CaMydHIO.js.map → EscalationListSchemaPage-CIJ-OgVC.js.map} +1 -1
  55. package/dashboard/dist/assets/{EscalationSchemaPage-BlMx2WE6.js → EscalationSchemaPage-C7dHgG8e.js} +3 -3
  56. package/dashboard/dist/assets/{EscalationSchemaPage-BlMx2WE6.js.map → EscalationSchemaPage-C7dHgG8e.js.map} +1 -1
  57. package/dashboard/dist/assets/{EscalationsOverview-DcMkbiSo.js → EscalationsOverview-D8NrATg2.js} +2 -2
  58. package/dashboard/dist/assets/{EscalationsOverview-DcMkbiSo.js.map → EscalationsOverview-D8NrATg2.js.map} +1 -1
  59. package/dashboard/dist/assets/{EventTable-CuZ2Q_wH.js → EventTable-DBV1P2ME.js} +2 -2
  60. package/dashboard/dist/assets/{EventTable-CuZ2Q_wH.js.map → EventTable-DBV1P2ME.js.map} +1 -1
  61. package/dashboard/dist/assets/{GraphInvokePage-CXElQqcV.js → GraphInvokePage-DbHvggQ_.js} +2 -2
  62. package/dashboard/dist/assets/{GraphInvokePage-CXElQqcV.js.map → GraphInvokePage-DbHvggQ_.js.map} +1 -1
  63. package/dashboard/dist/assets/{HomePage-DcWfjZA-.js → HomePage-BpexnDO_.js} +2 -2
  64. package/dashboard/dist/assets/{HomePage-DcWfjZA-.js.map → HomePage-BpexnDO_.js.map} +1 -1
  65. package/dashboard/dist/assets/ListToolbar-KC6LGtKP.js +2 -0
  66. package/dashboard/dist/assets/{ListToolbar-Dmd1UiM-.js.map → ListToolbar-KC6LGtKP.js.map} +1 -1
  67. package/dashboard/dist/assets/{McpOverview-Cul2LFEw.js → McpOverview-BDZC9Hvl.js} +2 -2
  68. package/dashboard/dist/assets/{McpOverview-Cul2LFEw.js.map → McpOverview-BDZC9Hvl.js.map} +1 -1
  69. package/dashboard/dist/assets/{McpQueryDetailPage-BVlQ0WBa.js → McpQueryDetailPage-CXhgX1pS.js} +2 -2
  70. package/dashboard/dist/assets/{McpQueryDetailPage-BVlQ0WBa.js.map → McpQueryDetailPage-CXhgX1pS.js.map} +1 -1
  71. package/dashboard/dist/assets/{McpQueryPage-B7PmO_V-.js → McpQueryPage-CsKNXUhb.js} +2 -2
  72. package/dashboard/dist/assets/{McpQueryPage-B7PmO_V-.js.map → McpQueryPage-CsKNXUhb.js.map} +1 -1
  73. package/dashboard/dist/assets/{McpRunDetailPage-B1RhxxlU.js → McpRunDetailPage-BM3mUSlH.js} +2 -2
  74. package/dashboard/dist/assets/{McpRunDetailPage-B1RhxxlU.js.map → McpRunDetailPage-BM3mUSlH.js.map} +1 -1
  75. package/dashboard/dist/assets/{McpRunsPage-DlSrpxiv.js → McpRunsPage-f5hDbpLo.js} +2 -2
  76. package/dashboard/dist/assets/{McpRunsPage-DlSrpxiv.js.map → McpRunsPage-f5hDbpLo.js.map} +1 -1
  77. package/dashboard/dist/assets/{NamespacePill-BQNMfY0m.js → NamespacePill-C4u6Go1W.js} +2 -2
  78. package/dashboard/dist/assets/{NamespacePill-BQNMfY0m.js.map → NamespacePill-C4u6Go1W.js.map} +1 -1
  79. package/dashboard/dist/assets/OperationsPage-D37cZ8Qh.js +2 -0
  80. package/dashboard/dist/assets/{OperationsPage-vm_ByX41.js.map → OperationsPage-D37cZ8Qh.js.map} +1 -1
  81. package/dashboard/dist/assets/OperatorDashboard-_axS17fp.js +2 -0
  82. package/dashboard/dist/assets/{OperatorDashboard-zviIxH-0.js.map → OperatorDashboard-_axS17fp.js.map} +1 -1
  83. package/dashboard/dist/assets/{PageHeader-BIY1YvKR.js → PageHeader-Bxa1XFz0.js} +2 -2
  84. package/dashboard/dist/assets/{PageHeader-BIY1YvKR.js.map → PageHeader-Bxa1XFz0.js.map} +1 -1
  85. package/dashboard/dist/assets/{PageHeaderWithStats-TUyglVW0.js → PageHeaderWithStats-D_sO0MqJ.js} +2 -2
  86. package/dashboard/dist/assets/{PageHeaderWithStats-TUyglVW0.js.map → PageHeaderWithStats-D_sO0MqJ.js.map} +1 -1
  87. package/dashboard/dist/assets/{ProcessDetailPage-txiMHbMI.js → ProcessDetailPage-D8pAWUXx.js} +2 -2
  88. package/dashboard/dist/assets/{ProcessDetailPage-txiMHbMI.js.map → ProcessDetailPage-D8pAWUXx.js.map} +1 -1
  89. package/dashboard/dist/assets/{ProcessesListPage-CRttlU3L.js → ProcessesListPage-CoQEi_Su.js} +2 -2
  90. package/dashboard/dist/assets/{ProcessesListPage-CRttlU3L.js.map → ProcessesListPage-CoQEi_Su.js.map} +1 -1
  91. package/dashboard/dist/assets/RoleDetailPage-ufbypNNR.js +8 -0
  92. package/dashboard/dist/assets/RoleDetailPage-ufbypNNR.js.map +1 -0
  93. package/dashboard/dist/assets/{RolePill-4LO_CuO3.js → RolePill-DLwmVMam.js} +2 -2
  94. package/dashboard/dist/assets/{RolePill-4LO_CuO3.js.map → RolePill-DLwmVMam.js.map} +1 -1
  95. package/dashboard/dist/assets/RolesPage-CxpXm4Sw.js +2 -0
  96. package/dashboard/dist/assets/{RolesPage-DzrSv6m-.js.map → RolesPage-CxpXm4Sw.js.map} +1 -1
  97. package/dashboard/dist/assets/RunAsSelector-BebF8Lib.js +2 -0
  98. package/dashboard/dist/assets/{RunAsSelector-CiLjlmIE.js.map → RunAsSelector-BebF8Lib.js.map} +1 -1
  99. package/dashboard/dist/assets/{SlidePanel-DK4sWXmp.js → SlidePanel-BDVDuwIf.js} +2 -2
  100. package/dashboard/dist/assets/{SlidePanel-DK4sWXmp.js.map → SlidePanel-BDVDuwIf.js.map} +1 -1
  101. package/dashboard/dist/assets/{StickyPagination-Di6b2GDE.js → StickyPagination-Cd83AHd_.js} +2 -2
  102. package/dashboard/dist/assets/{StickyPagination-Di6b2GDE.js.map → StickyPagination-Cd83AHd_.js.map} +1 -1
  103. package/dashboard/dist/assets/{StreamMessageDetail-BbkU45X_.js → StreamMessageDetail-BIXbrZM0.js} +2 -2
  104. package/dashboard/dist/assets/{StreamMessageDetail-BbkU45X_.js.map → StreamMessageDetail-BIXbrZM0.js.map} +1 -1
  105. package/dashboard/dist/assets/{SwimlaneTimeline-BzsvdstG.js → SwimlaneTimeline-CC5qZjYo.js} +2 -2
  106. package/dashboard/dist/assets/{SwimlaneTimeline-BzsvdstG.js.map → SwimlaneTimeline-CC5qZjYo.js.map} +1 -1
  107. package/dashboard/dist/assets/{TagInput-CK-JhBG2.js → TagInput-C2gi47M8.js} +2 -2
  108. package/dashboard/dist/assets/{TagInput-CK-JhBG2.js.map → TagInput-C2gi47M8.js.map} +1 -1
  109. package/dashboard/dist/assets/{TaskDetailPage-Biikk9o_.js → TaskDetailPage-DnjhW7qv.js} +2 -2
  110. package/dashboard/dist/assets/{TaskDetailPage-Biikk9o_.js.map → TaskDetailPage-DnjhW7qv.js.map} +1 -1
  111. package/dashboard/dist/assets/{TaskQueuePill-C_Vo2Clc.js → TaskQueuePill-BPP0Almh.js} +2 -2
  112. package/dashboard/dist/assets/{TaskQueuePill-C_Vo2Clc.js.map → TaskQueuePill-BPP0Almh.js.map} +1 -1
  113. package/dashboard/dist/assets/{TasksListPage-t9WAft9-.js → TasksListPage-DySfZFgs.js} +2 -2
  114. package/dashboard/dist/assets/{TasksListPage-t9WAft9-.js.map → TasksListPage-DySfZFgs.js.map} +1 -1
  115. package/dashboard/dist/assets/{TimeAgo-I7X6jdne.js → TimeAgo-BKOl-7Tt.js} +2 -2
  116. package/dashboard/dist/assets/{TimeAgo-I7X6jdne.js.map → TimeAgo-BKOl-7Tt.js.map} +1 -1
  117. package/dashboard/dist/assets/{TimestampCell-Cex9nr0t.js → TimestampCell-DGOsba-A.js} +2 -2
  118. package/dashboard/dist/assets/{TimestampCell-Cex9nr0t.js.map → TimestampCell-DGOsba-A.js.map} +1 -1
  119. package/dashboard/dist/assets/ToolPill-D74TkYB-.js +2 -0
  120. package/dashboard/dist/assets/{ToolPill-BCi101Jh.js.map → ToolPill-D74TkYB-.js.map} +1 -1
  121. package/dashboard/dist/assets/{ToolTestPanel--MGaDY-1.js → ToolTestPanel-Bez6OyRL.js} +2 -2
  122. package/dashboard/dist/assets/{ToolTestPanel--MGaDY-1.js.map → ToolTestPanel-Bez6OyRL.js.map} +1 -1
  123. package/dashboard/dist/assets/{TopicDetailPage-B8pHHweA.js → TopicDetailPage-BHccgkU_.js} +2 -2
  124. package/dashboard/dist/assets/{TopicDetailPage-B8pHHweA.js.map → TopicDetailPage-BHccgkU_.js.map} +1 -1
  125. package/dashboard/dist/assets/{TopicsPage-tiOEQz2m.js → TopicsPage-5yW63ELl.js} +2 -2
  126. package/dashboard/dist/assets/{TopicsPage-tiOEQz2m.js.map → TopicsPage-5yW63ELl.js.map} +1 -1
  127. package/dashboard/dist/assets/{UserName-Cdhyuv5K.js → UserName-DcXhOSVm.js} +2 -2
  128. package/dashboard/dist/assets/{UserName-Cdhyuv5K.js.map → UserName-DcXhOSVm.js.map} +1 -1
  129. package/dashboard/dist/assets/{WorkflowExecutionPage-DD1BKj5k.js → WorkflowExecutionPage-CDDLled5.js} +2 -2
  130. package/dashboard/dist/assets/{WorkflowExecutionPage-DD1BKj5k.js.map → WorkflowExecutionPage-CDDLled5.js.map} +1 -1
  131. package/dashboard/dist/assets/WorkflowPill-Fjc2q9U9.js +2 -0
  132. package/dashboard/dist/assets/{WorkflowPill-DHxrAkp3.js.map → WorkflowPill-Fjc2q9U9.js.map} +1 -1
  133. package/dashboard/dist/assets/{WorkflowsDashboard-BeWjDHYW.js → WorkflowsDashboard-C0Bbrd5M.js} +2 -2
  134. package/dashboard/dist/assets/{WorkflowsDashboard-BeWjDHYW.js.map → WorkflowsDashboard-C0Bbrd5M.js.map} +1 -1
  135. package/dashboard/dist/assets/{WorkflowsOverview-CkI-Pmj7.js → WorkflowsOverview-D8MkSMex.js} +2 -2
  136. package/dashboard/dist/assets/{WorkflowsOverview-CkI-Pmj7.js.map → WorkflowsOverview-D8MkSMex.js.map} +1 -1
  137. package/dashboard/dist/assets/{YamlWorkflowDetailPage-BQnO8-PQ.js → YamlWorkflowDetailPage-BcbrYhDI.js} +11 -11
  138. package/dashboard/dist/assets/{YamlWorkflowDetailPage-BQnO8-PQ.js.map → YamlWorkflowDetailPage-BcbrYhDI.js.map} +1 -1
  139. package/dashboard/dist/assets/{YamlWorkflowsPage-DjmNTQ5r.js → YamlWorkflowsPage-9Ki54d-9.js} +2 -2
  140. package/dashboard/dist/assets/{YamlWorkflowsPage-DjmNTQ5r.js.map → YamlWorkflowsPage-9Ki54d-9.js.map} +1 -1
  141. package/dashboard/dist/assets/{agents-2DaoprdB.js → agents-CopQ3t5o.js} +2 -2
  142. package/dashboard/dist/assets/{agents-2DaoprdB.js.map → agents-CopQ3t5o.js.map} +1 -1
  143. package/dashboard/dist/assets/{bots-BdwLwMUg.js → bots-CAYJYL9E.js} +2 -2
  144. package/dashboard/dist/assets/{bots-BdwLwMUg.js.map → bots-CAYJYL9E.js.map} +1 -1
  145. package/dashboard/dist/assets/{capabilities-BsuFeK9J.js → capabilities-5JRieYUy.js} +2 -2
  146. package/dashboard/dist/assets/{capabilities-BsuFeK9J.js.map → capabilities-5JRieYUy.js.map} +1 -1
  147. package/dashboard/dist/assets/{controlplane-CxKOrcFO.js → controlplane-B4rT6tIw.js} +2 -2
  148. package/dashboard/dist/assets/{controlplane-CxKOrcFO.js.map → controlplane-B4rT6tIw.js.map} +1 -1
  149. package/dashboard/dist/assets/{escalation-columns-y5SQ2Ulh.js → escalation-columns-BbS5X61l.js} +2 -2
  150. package/dashboard/dist/assets/{escalation-columns-y5SQ2Ulh.js.map → escalation-columns-BbS5X61l.js.map} +1 -1
  151. package/dashboard/dist/assets/{index-BVZINC_p.js → index-B68A3v-S.js} +2 -2
  152. package/dashboard/dist/assets/{index-BVZINC_p.js.map → index-B68A3v-S.js.map} +1 -1
  153. package/dashboard/dist/assets/{index-CRBXgMsh.js → index-BAi89Xpm.js} +2 -2
  154. package/dashboard/dist/assets/{index-CRBXgMsh.js.map → index-BAi89Xpm.js.map} +1 -1
  155. package/dashboard/dist/assets/index-BJ0jjFsI.js +5 -0
  156. package/dashboard/dist/assets/index-BJ0jjFsI.js.map +1 -0
  157. package/dashboard/dist/assets/index-BOJMUk4F.js +2 -0
  158. package/dashboard/dist/assets/{index-BYEkfaUq.js.map → index-BOJMUk4F.js.map} +1 -1
  159. package/dashboard/dist/assets/{index-DyS2DHqy.js → index-BrgYykPV.js} +2 -2
  160. package/dashboard/dist/assets/{index-DyS2DHqy.js.map → index-BrgYykPV.js.map} +1 -1
  161. package/dashboard/dist/assets/{index-DJ5nhcGB.js → index-BxgtIqvl.js} +2 -2
  162. package/dashboard/dist/assets/{index-DJ5nhcGB.js.map → index-BxgtIqvl.js.map} +1 -1
  163. package/dashboard/dist/assets/index-C0cHXaX-.css +1 -0
  164. package/dashboard/dist/assets/{index-DVLBkcoD.js → index-CDHDoHYz.js} +2 -2
  165. package/dashboard/dist/assets/{index-DVLBkcoD.js.map → index-CDHDoHYz.js.map} +1 -1
  166. package/dashboard/dist/assets/index-CUZJHXew.js +2 -0
  167. package/dashboard/dist/assets/{index-H6Vp-gPG.js.map → index-CUZJHXew.js.map} +1 -1
  168. package/dashboard/dist/assets/index-D5n_e59T.js +2 -0
  169. package/dashboard/dist/assets/{index-BC1NxetR.js.map → index-D5n_e59T.js.map} +1 -1
  170. package/dashboard/dist/assets/index-DIgiIoou.js +63 -0
  171. package/dashboard/dist/assets/index-DIgiIoou.js.map +1 -0
  172. package/dashboard/dist/assets/{index-Cfq3UKd8.js → index-Dd1RxGNw.js} +2 -2
  173. package/dashboard/dist/assets/{index-Cfq3UKd8.js.map → index-Dd1RxGNw.js.map} +1 -1
  174. package/dashboard/dist/assets/index-iOb3sGsC.js +5 -0
  175. package/dashboard/dist/assets/{index-DjI2AUbn.js.map → index-iOb3sGsC.js.map} +1 -1
  176. package/dashboard/dist/assets/{index-BXbt5NHG.js → index-mcAkQblr.js} +2 -2
  177. package/dashboard/dist/assets/{index-BXbt5NHG.js.map → index-mcAkQblr.js.map} +1 -1
  178. package/dashboard/dist/assets/{knowledge-CLnYcq0Y.js → knowledge-B9bmoXOe.js} +2 -2
  179. package/dashboard/dist/assets/{knowledge-CLnYcq0Y.js.map → knowledge-B9bmoXOe.js.map} +1 -1
  180. package/dashboard/dist/assets/{mcp-C1-iXkg7.js → mcp-DYMFBOFz.js} +2 -2
  181. package/dashboard/dist/assets/{mcp-C1-iXkg7.js.map → mcp-DYMFBOFz.js.map} +1 -1
  182. package/dashboard/dist/assets/{mcp-query-DcyDxuGY.js → mcp-query-wloSpyPM.js} +2 -2
  183. package/dashboard/dist/assets/{mcp-query-DcyDxuGY.js.map → mcp-query-wloSpyPM.js.map} +1 -1
  184. package/dashboard/dist/assets/{pipelines-BvG5D6bV.js → pipelines-DBXX6TEi.js} +2 -2
  185. package/dashboard/dist/assets/{pipelines-BvG5D6bV.js.map → pipelines-DBXX6TEi.js.map} +1 -1
  186. package/dashboard/dist/assets/{tasks-qwh8q5q7.js → tasks-CD3-C7tP.js} +2 -2
  187. package/dashboard/dist/assets/{tasks-qwh8q5q7.js.map → tasks-CD3-C7tP.js.map} +1 -1
  188. package/dashboard/dist/assets/{topics-MLKKA-Ql.js → topics-D8pKi6zA.js} +2 -2
  189. package/dashboard/dist/assets/{topics-MLKKA-Ql.js.map → topics-D8pKi6zA.js.map} +1 -1
  190. package/dashboard/dist/assets/{useEventHooks-B8uNFB-l.js → useEventHooks-DV9pLDOW.js} +2 -2
  191. package/dashboard/dist/assets/{useEventHooks-B8uNFB-l.js.map → useEventHooks-DV9pLDOW.js.map} +1 -1
  192. package/dashboard/dist/assets/{useNamespace-DjZmztJM.js → useNamespace-DykYhZY9.js} +2 -2
  193. package/dashboard/dist/assets/{useNamespace-DjZmztJM.js.map → useNamespace-DykYhZY9.js.map} +1 -1
  194. package/dashboard/dist/assets/{useYamlActivityEvents-DIvK20uI.js → useYamlActivityEvents-By044UAv.js} +2 -2
  195. package/dashboard/dist/assets/{useYamlActivityEvents-DIvK20uI.js.map → useYamlActivityEvents-By044UAv.js.map} +1 -1
  196. package/dashboard/dist/assets/{users-CVjajeDg.js → users-mI9goDjj.js} +2 -2
  197. package/dashboard/dist/assets/{users-CVjajeDg.js.map → users-mI9goDjj.js.map} +1 -1
  198. package/dashboard/dist/assets/{vendor-icons-Qk9qLjF_.js → vendor-icons-ihWGa7_d.js} +147 -132
  199. package/dashboard/dist/assets/vendor-icons-ihWGa7_d.js.map +1 -0
  200. package/dashboard/dist/assets/{workflows-BziTcJNq.js → workflows-DCUilz68.js} +2 -2
  201. package/dashboard/dist/assets/{workflows-BziTcJNq.js.map → workflows-DCUilz68.js.map} +1 -1
  202. package/dashboard/dist/assets/{yaml-workflows-Dr-ZcE_0.js → yaml-workflows-DWNMP1PT.js} +2 -2
  203. package/dashboard/dist/assets/{yaml-workflows-Dr-ZcE_0.js.map → yaml-workflows-DWNMP1PT.js.map} +1 -1
  204. package/dashboard/dist/index.html +3 -3
  205. package/docs/api/http/escalations.md +1 -0
  206. package/docs/api/http/roles.md +2 -0
  207. package/docs/api/http/users.md +39 -0
  208. package/docs/api/sdk/roles.md +5 -0
  209. package/docs/api/sdk/users.md +39 -0
  210. package/docs/hitl/pinned-views.md +45 -0
  211. package/docs/hitl/x-lt-list-schema.md +30 -2
  212. package/docs/hitl/x-lt-show-if.md +11 -0
  213. package/docs/hitl/x-lt-validation.md +27 -0
  214. package/docs/hitl/x-lt-widget.md +33 -1
  215. package/docs/hitl-guide.md +7 -3
  216. package/package.json +1 -1
  217. package/dashboard/dist/assets/AvailableEscalationsPage-AiuiLcz-.js +0 -2
  218. package/dashboard/dist/assets/AvailableEscalationsPage-AiuiLcz-.js.map +0 -1
  219. package/dashboard/dist/assets/BotPicker-BuCGvEed.js +0 -2
  220. package/dashboard/dist/assets/CountdownTimer-DdKL8Ryt.js +0 -2
  221. package/dashboard/dist/assets/CountdownTimer-DdKL8Ryt.js.map +0 -1
  222. package/dashboard/dist/assets/ListToolbar-Dmd1UiM-.js +0 -2
  223. package/dashboard/dist/assets/OperationsPage-vm_ByX41.js +0 -2
  224. package/dashboard/dist/assets/OperatorDashboard-zviIxH-0.js +0 -2
  225. package/dashboard/dist/assets/RoleDetailPage-DBIl_mhK.js +0 -8
  226. package/dashboard/dist/assets/RoleDetailPage-DBIl_mhK.js.map +0 -1
  227. package/dashboard/dist/assets/RolesPage-DzrSv6m-.js +0 -2
  228. package/dashboard/dist/assets/RunAsSelector-CiLjlmIE.js +0 -2
  229. package/dashboard/dist/assets/ToolPill-BCi101Jh.js +0 -2
  230. package/dashboard/dist/assets/WorkflowPill-DHxrAkp3.js +0 -2
  231. package/dashboard/dist/assets/index-BC1NxetR.js +0 -2
  232. package/dashboard/dist/assets/index-BYEkfaUq.js +0 -2
  233. package/dashboard/dist/assets/index-B_68lp-B.js +0 -5
  234. package/dashboard/dist/assets/index-B_68lp-B.js.map +0 -1
  235. package/dashboard/dist/assets/index-BeivyVtT.css +0 -1
  236. package/dashboard/dist/assets/index-DjI2AUbn.js +0 -5
  237. package/dashboard/dist/assets/index-H6Vp-gPG.js +0 -2
  238. package/dashboard/dist/assets/index-YPLTjeli.js +0 -63
  239. package/dashboard/dist/assets/index-YPLTjeli.js.map +0 -1
  240. package/dashboard/dist/assets/vendor-icons-Qk9qLjF_.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{b as be,j as e,a as p}from"./vendor-query-B2UbickB.js";import{m as ce,k as le,c as ye,N as ve,af as Ne,a5 as de,x as xe,o as we,ag as ke,B as _e,b as B,a7 as Ce,ah as Se}from"./index-YPLTjeli.js";import{b as Ee}from"./workflows-BziTcJNq.js";import{u as Pe}from"./pipelines-BvG5D6bV.js";import{u as Re}from"./controlplane-CxKOrcFO.js";import{e as qe,b as We,i as $e}from"./useEventHooks-B8uNFB-l.js";import{R as ee}from"./RolePill-4LO_CuO3.js";import{W as q}from"./WorkflowPill-DHxrAkp3.js";import{L as W}from"./ListToolbar-Dmd1UiM-.js";import{j as Te,b as Ie}from"./OperationsPage-vm_ByX41.js";import{aZ as Ae,av as j,ag as Qe,z as Be,C as te,W as se,I as $,L as ae,B as Me}from"./vendor-icons-Qk9qLjF_.js";import{c as T,f as Fe}from"./vendor-react-CXumBFUA.js";import"./PageHeader-BIY1YvKR.js";function Le(){const{user:s}=ce(),o=s==null?void 0:s.userId,a=be(),{data:n}=le({assigned_to:o,status:"pending",limit:1});return ye(`${ve}.system.escalation.>`,()=>{o&&a.invalidateQueries({queryKey:["escalations"]})}),(n==null?void 0:n.total)??0}function Q({n:s,label:o,tone:a}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:`text-2xl font-light tabular-nums leading-none ${a==="muted"?"text-text-tertiary":"text-text-primary"}`,children:s}),e.jsx("div",{className:"text-[9px] uppercase tracking-wider text-text-quaternary mt-1 truncate",children:o})]})}function De({role:s,title:o,metric:a,priorityFacet:n,periodLabel:c}){const l=T(),i=(a==null?void 0:a.pending)??0,x=(a==null?void 0:a.claimed)??0,f=(a==null?void 0:a.resolved)??0,u=(a==null?void 0:a.priority_count)??0;return e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>l(`/escalations/available?role=${encodeURIComponent(s)}`),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l(`/escalations/available?role=${encodeURIComponent(s)}`))},className:"group h-full border-l-2 border-accent/30 bg-surface-sunken/40 rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-surface-sunken/70 focus:outline-none focus-visible:ring-1 focus-visible:ring-accent/40",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary truncate",children:o||s}),e.jsx(j,{className:"w-3 h-3 shrink-0 text-text-quaternary opacity-0 group-hover:opacity-100 transition-opacity",strokeWidth:1.5})]}),e.jsxs("div",{className:"flex items-baseline gap-5",children:[e.jsx(Q,{n:i,label:"pending"}),e.jsx(Q,{n:x,label:"claimed"}),e.jsx(Q,{n:f,label:`resolved · ${c}`,tone:"muted"})]}),e.jsx("div",{className:"mt-3 h-6 flex items-center",children:u>0?e.jsxs("button",{type:"button",onClick:m=>{m.stopPropagation(),l(Te({role:s,priority_facet:n}))},className:"inline-flex items-center gap-1.5 pl-1.5 pr-2.5 py-1 rounded-full text-[11px] font-semibold tabular-nums bg-status-error text-white transition-transform hover:scale-[1.05]",title:"Past the priority threshold — a hard limit; open oldest first",children:[e.jsx(Qe,{className:"w-3 h-3",strokeWidth:2.5}),u," in jeopardy"]}):e.jsx("span",{className:"text-[10px] text-text-quaternary",children:"on pace"})})]})}function ne({count:s}){const o=T();return e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o("/escalations/queue"),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),o("/escalations/queue"))},className:"group h-full border-l-2 border-status-warning/70 bg-status-warning/[0.06] rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-status-warning/[0.1] focus:outline-none focus-visible:ring-1 focus-visible:ring-status-warning/40",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-status-warning",children:[e.jsx(Ae,{className:"w-3 h-3",strokeWidth:2}),"Claimed"]}),e.jsx(j,{className:"w-3 h-3 shrink-0 text-text-quaternary opacity-0 group-hover:opacity-100 transition-opacity",strokeWidth:1.5})]}),e.jsx("div",{className:"text-2xl font-light tabular-nums leading-none text-text-primary",children:s}),e.jsx("div",{className:"text-[9px] uppercase tracking-wider text-text-quaternary mt-1",children:"assigned to you"}),e.jsx("div",{className:"mt-3 h-6 flex items-center",children:e.jsx("span",{className:"text-[11px] font-medium text-status-warning",children:s>0?"Finish these first →":"Nothing claimed"})})]})}const He=["15m","1h","24h","7d"];function ze({maxRows:s}){const[o,a]=p.useState("24h"),n=Ne(),c=Le(),l=de(o),i=xe(),x=p.useMemo(()=>{var r;return new Map((((r=l.data)==null?void 0:r.stations)??[]).map(d=>[d.role,d]))},[l.data]),f=p.useMemo(()=>{var r;return new Map((((r=i.data)==null?void 0:r.roles)??[]).map(d=>[d.role,d]))},[i.data]),u=p.useMemo(()=>[...n].sort((r,d)=>{var R,g;const h=((R=x.get(r))==null?void 0:R.priority_count)??0,P=((g=x.get(d))==null?void 0:g.priority_count)??0;return P!==h?P-h:r.localeCompare(d)}),[n,x]),E=s*4-1,y=u.slice(0,E),v=u.length-y.length;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4 pb-2 border-b border-surface-border",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-sm font-medium text-text-primary",children:[e.jsx(Be,{className:"w-4 h-4 text-accent",strokeWidth:1.5}),"Task Queues"]}),e.jsx("div",{className:"flex items-center gap-0.5",children:He.map(r=>e.jsx("button",{onClick:()=>a(r),className:`px-2.5 py-1 text-[10px] font-mono rounded transition-colors ${o===r?"bg-accent/10 text-accent font-semibold":"text-text-quaternary hover:text-text-secondary"}`,children:r},r))})]}),n.length===0?e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(ne,{count:c}),e.jsx("div",{className:"lg:col-span-3 flex items-center px-4 py-3.5 text-sm text-text-tertiary",children:"You are not a member of a role. Task queues appear here once you join one."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 auto-rows-fr",children:[e.jsx(ne,{count:c}),y.map(r=>{var d,h;return e.jsx(De,{role:r,title:((d=f.get(r))==null?void 0:d.title)??null,metric:x.get(r),priorityFacet:((h=f.get(r))==null?void 0:h.priority_facet)??null,periodLabel:o},r)})]}),v>0&&e.jsxs("p",{className:"mt-3 text-[11px] text-text-quaternary",children:["+",v," more ",v===1?"lane":"lanes"," in the Task Queues sidebar."]})]})]})}const Oe={completed:"bg-status-success",active:"bg-status-active",running:"bg-status-active",pending:"bg-status-pending",error:"bg-status-error",failed:"bg-status-error"};function oe(s){return Oe[s]??"bg-text-tertiary"}function _({icon:s,color:o,docsHash:a,count:n,children:c,actions:l}){return e.jsxs("div",{className:"flex items-center justify-between mb-4 pb-2 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(s,{className:`w-4.5 h-4.5 ${o||"text-accent/60"}`,strokeWidth:1.5}),e.jsx("h2",{className:"section-h2",children:c}),n!==void 0&&n>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-accent/10 text-accent text-[10px] font-semibold tabular-nums",children:Se(n)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx("button",{onClick:()=>{window.location.hash=a},className:"text-text-quaternary hover:text-accent transition-colors",title:"Docs",children:e.jsx(Me,{className:"w-2.5 h-2.5",strokeWidth:1.5})}),l]})]})}function C({icon:s,text:o}){return e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[e.jsx(s,{className:"w-6 h-6 text-text-quaternary/50 mb-2",strokeWidth:1}),e.jsx("p",{className:"text-xs text-text-quaternary",children:o})]})}function Ue(s,o=37){if(!s||s.length<=o)return s;const a=Math.floor((o-3)/2);return`${s.slice(0,a)}...${s.slice(-a)}`}function re({dot:s,pill:o,id:a,date:n,onClick:c}){return e.jsxs("button",{onClick:c,className:"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full dot-ring shrink-0 ${s}`}),e.jsx("span",{className:"text-[12px] text-text-primary font-mono truncate max-w-[60%]",children:Ue(a)}),e.jsx("span",{className:"text-[10px] text-text-quaternary shrink-0 ml-auto whitespace-nowrap",children:e.jsx(B,{date:n})})]}),e.jsx("div",{className:"pl-3.5 flex items-center gap-1 overflow-hidden",children:o})]})}function S({to:s,icon:o,title:a}){const n=T();return e.jsx("button",{onClick:()=>n(s),className:"text-text-quaternary hover:text-accent transition-colors",title:a,children:e.jsx(o,{className:"w-2.5 h-2.5",strokeWidth:1.5})})}function ie({appIds:s,selected:o,onSelect:a}){const[n,c]=p.useState(!1),l=p.useRef(null);return p.useEffect(()=>{if(!n)return;const i=x=>{l.current&&!l.current.contains(x.target)&&c(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),s.length<=1?null:e.jsxs("div",{className:"relative mb-3 -mt-2",ref:l,children:[e.jsxs("button",{onClick:()=>c(i=>!i),className:"flex items-center gap-1 px-2 py-0.5 text-[10px] rounded bg-accent/10 text-accent hover:bg-accent/20 transition-colors",children:[o,e.jsx("svg",{className:`w-2.5 h-2.5 transition-transform ${n?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),n&&e.jsx("div",{className:"absolute top-full left-0 mt-1 bg-surface-raised border border-surface-border rounded-md shadow-lg z-30 py-1 min-w-[120px]",children:s.map(i=>e.jsx("button",{onClick:()=>{a(i),c(!1)},className:`w-full text-left px-3 py-1.5 text-[11px] transition-colors ${o===i?"text-accent bg-accent/5":"text-text-secondary hover:bg-surface-hover"}`,children:i},i))})]})}function rt(){var z,O,U,K,G,J,X,V;const s=T(),{user:o}=ce(),{isBuilder:a}=we(),n=ke(),[c,l]=Fe(),{data:i}=Re({enabled:a}),x=p.useMemo(()=>((i==null?void 0:i.apps)??[]).map(t=>t.appId).sort(),[i]),f=x[0]??"",u=c.get("pipelinenamespace")||f,m=c.get("durablenamespace")||f,E=p.useCallback((t,I)=>{l(A=>{const k=new URLSearchParams(A);return k.set(t,I),k},{replace:!1})},[l]);qe(),We(),$e();const y=!n.showTaskQueueCards,v=n.canSeePaceBoard&&n.canSeeWorkflows?"lg:grid-cols-3":n.canSeeWorkflows?"lg:grid-cols-2":"",r=xe({enabled:n.canSeePaceBoard}),d=de("1h",{enabled:n.canSeePaceBoard}),h=Ee({limit:5,sort_by:"updated_at",order:"desc",namespace:m},{enabled:n.canSeeWorkflows}),P=x,R=x,g=Pe({limit:5,app_id:u,sort_by:"updated_at",order:"desc"},{enabled:n.canSeeWorkflows}),N=_e({limit:5,sort_by:"created_at",order:"desc",enabled:y}),w=le({assigned_to:o==null?void 0:o.userId,status:"pending",limit:5,sort_by:"created_at",order:"desc",enabled:y});p.useEffect(()=>{const t=setTimeout(()=>{w.refetch(),N.refetch()},2e3);return()=>clearTimeout(t)},[]);const M=p.useMemo(()=>{var k,Y,Z;const I=((Y=Ie(((k=r.data)==null?void 0:k.roles)??[])[0])==null?void 0:Y.stations)??[],A=((Z=d.data)==null?void 0:Z.stations)??[];return I.map(({role:b})=>({role:b.role,title:b.title,parent_role:b.parent_role,target_per_hour:b.target_per_hour??null,upstream_roles:b.upstream_roles??[],metric:A.find(je=>je.role===b.role)}))},[r.data,d.data]),F=((z=h.data)==null?void 0:z.jobs)??[],pe=(O=h.data)==null?void 0:O.total,L=((U=g.data)==null?void 0:U.jobs)??[],ue=(K=g.data)==null?void 0:K.total,D=((G=N.data)==null?void 0:G.escalations)??[],me=(J=N.data)==null?void 0:J.total,H=((X=w.data)==null?void 0:X.escalations)??[],he=(V=w.data)==null?void 0:V.total,fe=e.jsxs("div",{children:[e.jsx(_,{icon:te,color:"text-accent",count:pe,docsHash:"#docs:dashboard.md:procedural-executions",actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{onRefresh:()=>h.refetch(),isFetching:h.isFetching,apiPath:`/workflow-states/jobs?namespace=${m}&limit=5`}),e.jsx(S,{to:"/workflows/executions",icon:j,title:"All procedural executions"})]}),children:"Procedural"}),e.jsx(ie,{appIds:P,selected:m,onSelect:t=>E("durablenamespace",t)}),F.length===0?e.jsx(C,{icon:te,text:"No recent procedural runs"}):e.jsx("div",{className:"space-y-1",children:F.map(t=>e.jsx(re,{dot:oe(t.status),pill:e.jsx(q,{type:t.entity||t.type||"workflow",size:"xs"}),id:t.workflow_id,date:t.updated_at??t.created_at,onClick:()=>s(`/workflows/executions/${t.workflow_id}`)},t.workflow_id))})]}),ge=e.jsxs("div",{children:[e.jsx(_,{icon:se,color:"text-accent",count:ue,docsHash:"#docs:dashboard.md:graph-executions",actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{onRefresh:()=>g.refetch(),isFetching:g.isFetching,apiPath:`/pipelines?app_id=${u}&limit=5`}),e.jsx(S,{to:"/mcp/executions",icon:j,title:"All graph executions"})]}),children:"Graph"}),e.jsx(ie,{appIds:R,selected:u,onSelect:t=>E("pipelinenamespace",t)}),L.length===0?e.jsx(C,{icon:se,text:"No recent graph runs"}):e.jsx("div",{className:"space-y-1",children:L.map(t=>e.jsx(re,{dot:oe(t.status),pill:e.jsx(q,{type:t.entity||t.workflow_name||"pipeline",variant:"pipeline",size:"xs"}),id:t.workflow_id,date:t.updated_at??t.created_at,onClick:()=>s(`/mcp/executions/${t.workflow_id}?namespace=${u}`)},t.workflow_id))})]});return n.showTaskQueueCards?e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-light text-text-primary mb-10",children:"Recent Activity"}),e.jsx(ze,{maxRows:2})]}):e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-light text-text-primary mb-10",children:"Recent Activity"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-x-14 min-h-[35vh]",children:[e.jsxs("div",{children:[e.jsx(_,{icon:$,color:"text-accent",count:me,docsHash:"#docs:dashboard.md:all-escalations",actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{onRefresh:()=>N.refetch(),isFetching:N.isFetching,apiPath:"/escalations?status=pending&limit=5&sort_by=created_at&order=desc"}),e.jsx(S,{to:"/escalations/available",icon:j,title:"All escalations"})]}),children:"All Escalations"}),D.length===0?e.jsx(C,{icon:$,text:"No pending escalations"}):e.jsx("div",{className:"space-y-1",children:D.map(t=>e.jsxs("button",{onClick:()=>s(`/escalations/detail/${t.id}`),className:"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsxs("span",{className:"text-[9px] text-text-quaternary font-medium shrink-0",children:["P",t.priority??2]}),e.jsx("span",{className:"text-[12px] text-text-primary truncate flex-1 max-w-[65%]",children:t.description||t.subtype||t.type}),e.jsx("span",{className:"text-[10px] text-text-quaternary shrink-0 ml-auto",children:e.jsx(B,{date:t.updated_at??t.created_at})})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5",children:[e.jsx(q,{type:t.type||"unknown",size:"xs"}),e.jsx("span",{className:"flex-1"}),e.jsx(ee,{role:t.role})]})]},t.id))})]}),e.jsxs("div",{children:[e.jsx(_,{icon:$,color:"text-accent",count:he,docsHash:"#docs:dashboard.md:escalations-overview",actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{onRefresh:()=>w.refetch(),isFetching:w.isFetching,apiPath:`/escalations?assigned_to=${(o==null?void 0:o.userId)??""}&status=pending&limit=5&sort_by=created_at&order=desc`}),e.jsx(S,{to:"/escalations/queue",icon:j,title:"My escalation queue"})]}),children:"My Escalations"}),H.length===0?e.jsx(C,{icon:$,text:"No assigned escalations"}):e.jsx("div",{className:"space-y-1",children:H.map(t=>e.jsxs("button",{onClick:()=>s(`/escalations/detail/${t.id}`),className:"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsxs("span",{className:"text-[9px] text-text-quaternary font-medium shrink-0",children:["P",t.priority??2]}),e.jsx("span",{className:"text-[12px] text-text-primary truncate flex-1 max-w-[65%]",children:t.description||t.subtype||t.type}),e.jsx("span",{className:"text-[10px] text-text-quaternary shrink-0 ml-auto",children:e.jsx(B,{date:t.updated_at??t.created_at})})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5",children:[e.jsx(q,{type:t.type||"unknown",size:"xs"}),e.jsx("span",{className:"flex-1"}),e.jsx(ee,{role:t.role})]})]},t.id))})]})]}),(n.canSeePaceBoard||n.canSeeWorkflows)&&e.jsxs("div",{className:`grid grid-cols-1 ${v} gap-x-14 mt-14`,children:[n.canSeePaceBoard&&e.jsxs("div",{children:[e.jsx(_,{icon:ae,color:"text-accent",docsHash:"#docs:dashboard.md:pace-board",actions:e.jsx(S,{to:"/operations",icon:j,title:"Open the Pace Board"}),children:"Pace Board"}),M.length===0?e.jsx(C,{icon:ae,text:"No stations yet — mark roles visible in Operations"}):e.jsx("div",{className:`${a?"h-64":"h-80"} cursor-pointer`,onClick:()=>s("/operations"),children:e.jsx(Ce,{stations:M,selectedRole:null,onSelect:()=>s("/operations"),onUpstreamSelect:()=>s("/operations"),periodHours:1})})]}),n.canSeeWorkflows&&fe,n.canSeeWorkflows&&ge]})]})}export{rt as HomePage};
2
- //# sourceMappingURL=HomePage-DcWfjZA-.js.map
1
+ import{b as be,j as e,a as p}from"./vendor-query-B2UbickB.js";import{o as ce,k as le,c as ye,N as ve,am as Ne,ac as de,I as xe,x as we,an as ke,P as _e,b as B,ae as Ce,ao as Se}from"./index-DIgiIoou.js";import{b as Pe}from"./workflows-DCUilz68.js";import{u as Ee}from"./pipelines-DBXX6TEi.js";import{u as Re}from"./controlplane-B4rT6tIw.js";import{e as qe,b as We,i as $e}from"./useEventHooks-DV9pLDOW.js";import{R as ee}from"./RolePill-DLwmVMam.js";import{W as q}from"./WorkflowPill-Fjc2q9U9.js";import{L as W}from"./ListToolbar-KC6LGtKP.js";import{j as Te,b as Ie}from"./OperationsPage-D37cZ8Qh.js";import{b0 as Ae,ar as j,ai as Qe,H as Be,C as te,W as se,I as $,L as ae,B as Me}from"./vendor-icons-ihWGa7_d.js";import{c as T,f as Fe}from"./vendor-react-CXumBFUA.js";import"./PageHeader-Bxa1XFz0.js";function Le(){const{user:s}=ce(),o=s==null?void 0:s.userId,a=be(),{data:n}=le({assigned_to:o,status:"pending",limit:1});return ye(`${ve}.system.escalation.>`,()=>{o&&a.invalidateQueries({queryKey:["escalations"]})}),(n==null?void 0:n.total)??0}function Q({n:s,label:o,tone:a}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:`text-2xl font-light tabular-nums leading-none ${a==="muted"?"text-text-tertiary":"text-text-primary"}`,children:s}),e.jsx("div",{className:"text-[9px] uppercase tracking-wider text-text-quaternary mt-1 truncate",children:o})]})}function De({role:s,title:o,metric:a,priorityFacet:n,periodLabel:c}){const l=T(),i=(a==null?void 0:a.pending)??0,x=(a==null?void 0:a.claimed)??0,f=(a==null?void 0:a.resolved)??0,u=(a==null?void 0:a.priority_count)??0;return e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>l(`/escalations/available?role=${encodeURIComponent(s)}`),onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l(`/escalations/available?role=${encodeURIComponent(s)}`))},className:"group h-full border-l-2 border-accent/30 bg-surface-sunken/40 rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-surface-sunken/70 focus:outline-none focus-visible:ring-1 focus-visible:ring-accent/40",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary truncate",children:o||s}),e.jsx(j,{className:"w-3 h-3 shrink-0 text-text-quaternary opacity-0 group-hover:opacity-100 transition-opacity",strokeWidth:1.5})]}),e.jsxs("div",{className:"flex items-baseline gap-5",children:[e.jsx(Q,{n:i,label:"pending"}),e.jsx(Q,{n:x,label:"claimed"}),e.jsx(Q,{n:f,label:`resolved · ${c}`,tone:"muted"})]}),e.jsx("div",{className:"mt-3 h-6 flex items-center",children:u>0?e.jsxs("button",{type:"button",onClick:m=>{m.stopPropagation(),l(Te({role:s,priority_facet:n}))},className:"inline-flex items-center gap-1.5 pl-1.5 pr-2.5 py-1 rounded-full text-[11px] font-semibold tabular-nums bg-status-error text-white transition-transform hover:scale-[1.05]",title:"Past the priority threshold — a hard limit; open oldest first",children:[e.jsx(Qe,{className:"w-3 h-3",strokeWidth:2.5}),u," in jeopardy"]}):e.jsx("span",{className:"text-[10px] text-text-quaternary",children:"on pace"})})]})}function ne({count:s}){const o=T();return e.jsxs("div",{role:"button",tabIndex:0,onClick:()=>o("/escalations/queue"),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),o("/escalations/queue"))},className:"group h-full border-l-2 border-status-warning/70 bg-status-warning/[0.06] rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-status-warning/[0.1] focus:outline-none focus-visible:ring-1 focus-visible:ring-status-warning/40",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-status-warning",children:[e.jsx(Ae,{className:"w-3 h-3",strokeWidth:2}),"Claimed"]}),e.jsx(j,{className:"w-3 h-3 shrink-0 text-text-quaternary opacity-0 group-hover:opacity-100 transition-opacity",strokeWidth:1.5})]}),e.jsx("div",{className:"text-2xl font-light tabular-nums leading-none text-text-primary",children:s}),e.jsx("div",{className:"text-[9px] uppercase tracking-wider text-text-quaternary mt-1",children:"assigned to you"}),e.jsx("div",{className:"mt-3 h-6 flex items-center",children:e.jsx("span",{className:"text-[11px] font-medium text-status-warning",children:s>0?"Finish these first →":"Nothing claimed"})})]})}const He=["15m","1h","24h","7d"];function Oe({maxRows:s}){const[o,a]=p.useState("24h"),n=Ne(),c=Le(),l=de(o),i=xe(),x=p.useMemo(()=>{var r;return new Map((((r=l.data)==null?void 0:r.stations)??[]).map(d=>[d.role,d]))},[l.data]),f=p.useMemo(()=>{var r;return new Map((((r=i.data)==null?void 0:r.roles)??[]).map(d=>[d.role,d]))},[i.data]),u=p.useMemo(()=>[...n].sort((r,d)=>{var R,g;const h=((R=x.get(r))==null?void 0:R.priority_count)??0,E=((g=x.get(d))==null?void 0:g.priority_count)??0;return E!==h?E-h:r.localeCompare(d)}),[n,x]),P=s*4-1,y=u.slice(0,P),v=u.length-y.length;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4 pb-2 border-b border-surface-border",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-sm font-medium text-text-primary",children:[e.jsx(Be,{className:"w-4 h-4 text-accent",strokeWidth:1.5}),"Task Queues"]}),e.jsx("div",{className:"flex items-center gap-0.5",children:He.map(r=>e.jsx("button",{onClick:()=>a(r),className:`px-2.5 py-1 text-[10px] font-mono rounded transition-colors ${o===r?"bg-accent/10 text-accent font-semibold":"text-text-quaternary hover:text-text-secondary"}`,children:r},r))})]}),n.length===0?e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(ne,{count:c}),e.jsx("div",{className:"lg:col-span-3 flex items-center px-4 py-3.5 text-sm text-text-tertiary",children:"You are not a member of a role. Task queues appear here once you join one."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 auto-rows-fr",children:[e.jsx(ne,{count:c}),y.map(r=>{var d,h;return e.jsx(De,{role:r,title:((d=f.get(r))==null?void 0:d.title)??null,metric:x.get(r),priorityFacet:((h=f.get(r))==null?void 0:h.priority_facet)??null,periodLabel:o},r)})]}),v>0&&e.jsxs("p",{className:"mt-3 text-[11px] text-text-quaternary",children:["+",v," more ",v===1?"lane":"lanes"," in the Task Queues sidebar."]})]})]})}const Ue={completed:"bg-status-success",active:"bg-status-active",running:"bg-status-active",pending:"bg-status-pending",error:"bg-status-error",failed:"bg-status-error"};function oe(s){return Ue[s]??"bg-text-tertiary"}function _({icon:s,color:o,docsHash:a,count:n,children:c,actions:l}){return e.jsxs("div",{className:"flex items-center justify-between mb-4 pb-2 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(s,{className:`w-4.5 h-4.5 ${o||"text-accent/60"}`,strokeWidth:1.5}),e.jsx("h2",{className:"section-h2",children:c}),n!==void 0&&n>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-accent/10 text-accent text-[10px] font-semibold tabular-nums",children:Se(n)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx("button",{onClick:()=>{window.location.hash=a},className:"text-text-quaternary hover:text-accent transition-colors",title:"Docs",children:e.jsx(Me,{className:"w-2.5 h-2.5",strokeWidth:1.5})}),l]})]})}function C({icon:s,text:o}){return e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[e.jsx(s,{className:"w-6 h-6 text-text-quaternary/50 mb-2",strokeWidth:1}),e.jsx("p",{className:"text-xs text-text-quaternary",children:o})]})}function ze(s,o=37){if(!s||s.length<=o)return s;const a=Math.floor((o-3)/2);return`${s.slice(0,a)}...${s.slice(-a)}`}function re({dot:s,pill:o,id:a,date:n,onClick:c}){return e.jsxs("button",{onClick:c,className:"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full dot-ring shrink-0 ${s}`}),e.jsx("span",{className:"text-[12px] text-text-primary font-mono truncate max-w-[60%]",children:ze(a)}),e.jsx("span",{className:"text-[10px] text-text-quaternary shrink-0 ml-auto whitespace-nowrap",children:e.jsx(B,{date:n})})]}),e.jsx("div",{className:"pl-3.5 flex items-center gap-1 overflow-hidden",children:o})]})}function S({to:s,icon:o,title:a}){const n=T();return e.jsx("button",{onClick:()=>n(s),className:"text-text-quaternary hover:text-accent transition-colors",title:a,children:e.jsx(o,{className:"w-2.5 h-2.5",strokeWidth:1.5})})}function ie({appIds:s,selected:o,onSelect:a}){const[n,c]=p.useState(!1),l=p.useRef(null);return p.useEffect(()=>{if(!n)return;const i=x=>{l.current&&!l.current.contains(x.target)&&c(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),s.length<=1?null:e.jsxs("div",{className:"relative mb-3 -mt-2",ref:l,children:[e.jsxs("button",{onClick:()=>c(i=>!i),className:"flex items-center gap-1 px-2 py-0.5 text-[10px] rounded bg-accent/10 text-accent hover:bg-accent/20 transition-colors",children:[o,e.jsx("svg",{className:`w-2.5 h-2.5 transition-transform ${n?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),n&&e.jsx("div",{className:"absolute top-full left-0 mt-1 bg-surface-raised border border-surface-border rounded-md shadow-lg z-30 py-1 min-w-[120px]",children:s.map(i=>e.jsx("button",{onClick:()=>{a(i),c(!1)},className:`w-full text-left px-3 py-1.5 text-[11px] transition-colors ${o===i?"text-accent bg-accent/5":"text-text-secondary hover:bg-surface-hover"}`,children:i},i))})]})}function rt(){var O,U,z,K,G,J,X,V;const s=T(),{user:o}=ce(),{isBuilder:a}=we(),n=ke(),[c,l]=Fe(),{data:i}=Re({enabled:a}),x=p.useMemo(()=>((i==null?void 0:i.apps)??[]).map(t=>t.appId).sort(),[i]),f=x[0]??"",u=c.get("pipelinenamespace")||f,m=c.get("durablenamespace")||f,P=p.useCallback((t,I)=>{l(A=>{const k=new URLSearchParams(A);return k.set(t,I),k},{replace:!1})},[l]);qe(),We(),$e();const y=!n.showTaskQueueCards,v=n.canSeePaceBoard&&n.canSeeWorkflows?"lg:grid-cols-3":n.canSeeWorkflows?"lg:grid-cols-2":"",r=xe({enabled:n.canSeePaceBoard}),d=de("1h",{enabled:n.canSeePaceBoard}),h=Pe({limit:5,sort_by:"updated_at",order:"desc",namespace:m},{enabled:n.canSeeWorkflows}),E=x,R=x,g=Ee({limit:5,app_id:u,sort_by:"updated_at",order:"desc"},{enabled:n.canSeeWorkflows}),N=_e({limit:5,sort_by:"created_at",order:"desc",enabled:y}),w=le({assigned_to:o==null?void 0:o.userId,status:"pending",limit:5,sort_by:"created_at",order:"desc",enabled:y});p.useEffect(()=>{const t=setTimeout(()=>{w.refetch(),N.refetch()},2e3);return()=>clearTimeout(t)},[]);const M=p.useMemo(()=>{var k,Y,Z;const I=((Y=Ie(((k=r.data)==null?void 0:k.roles)??[])[0])==null?void 0:Y.stations)??[],A=((Z=d.data)==null?void 0:Z.stations)??[];return I.map(({role:b})=>({role:b.role,title:b.title,parent_role:b.parent_role,target_per_hour:b.target_per_hour??null,upstream_roles:b.upstream_roles??[],metric:A.find(je=>je.role===b.role)}))},[r.data,d.data]),F=((O=h.data)==null?void 0:O.jobs)??[],pe=(U=h.data)==null?void 0:U.total,L=((z=g.data)==null?void 0:z.jobs)??[],ue=(K=g.data)==null?void 0:K.total,D=((G=N.data)==null?void 0:G.escalations)??[],me=(J=N.data)==null?void 0:J.total,H=((X=w.data)==null?void 0:X.escalations)??[],he=(V=w.data)==null?void 0:V.total,fe=e.jsxs("div",{children:[e.jsx(_,{icon:te,color:"text-accent",count:pe,docsHash:"#docs:dashboard.md:procedural-executions",actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{onRefresh:()=>h.refetch(),isFetching:h.isFetching,apiPath:`/workflow-states/jobs?namespace=${m}&limit=5`}),e.jsx(S,{to:"/workflows/executions",icon:j,title:"All procedural executions"})]}),children:"Procedural"}),e.jsx(ie,{appIds:E,selected:m,onSelect:t=>P("durablenamespace",t)}),F.length===0?e.jsx(C,{icon:te,text:"No recent procedural runs"}):e.jsx("div",{className:"space-y-1",children:F.map(t=>e.jsx(re,{dot:oe(t.status),pill:e.jsx(q,{type:t.entity||t.type||"workflow",size:"xs"}),id:t.workflow_id,date:t.updated_at??t.created_at,onClick:()=>s(`/workflows/executions/${t.workflow_id}`)},t.workflow_id))})]}),ge=e.jsxs("div",{children:[e.jsx(_,{icon:se,color:"text-accent",count:ue,docsHash:"#docs:dashboard.md:graph-executions",actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{onRefresh:()=>g.refetch(),isFetching:g.isFetching,apiPath:`/pipelines?app_id=${u}&limit=5`}),e.jsx(S,{to:"/mcp/executions",icon:j,title:"All graph executions"})]}),children:"Graph"}),e.jsx(ie,{appIds:R,selected:u,onSelect:t=>P("pipelinenamespace",t)}),L.length===0?e.jsx(C,{icon:se,text:"No recent graph runs"}):e.jsx("div",{className:"space-y-1",children:L.map(t=>e.jsx(re,{dot:oe(t.status),pill:e.jsx(q,{type:t.entity||t.workflow_name||"pipeline",variant:"pipeline",size:"xs"}),id:t.workflow_id,date:t.updated_at??t.created_at,onClick:()=>s(`/mcp/executions/${t.workflow_id}?namespace=${u}`)},t.workflow_id))})]});return n.showTaskQueueCards?e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-light text-text-primary mb-10",children:"Recent Activity"}),e.jsx(Oe,{maxRows:2})]}):e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-light text-text-primary mb-10",children:"Recent Activity"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-x-14 min-h-[35vh]",children:[e.jsxs("div",{children:[e.jsx(_,{icon:$,color:"text-accent",count:me,docsHash:"#docs:dashboard.md:all-escalations",actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{onRefresh:()=>N.refetch(),isFetching:N.isFetching,apiPath:"/escalations?status=pending&limit=5&sort_by=created_at&order=desc"}),e.jsx(S,{to:"/escalations/available",icon:j,title:"All escalations"})]}),children:"All Escalations"}),D.length===0?e.jsx(C,{icon:$,text:"No pending escalations"}):e.jsx("div",{className:"space-y-1",children:D.map(t=>e.jsxs("button",{onClick:()=>s(`/escalations/detail/${t.id}`),className:"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsxs("span",{className:"text-[9px] text-text-quaternary font-medium shrink-0",children:["P",t.priority??2]}),e.jsx("span",{className:"text-[12px] text-text-primary truncate flex-1 max-w-[65%]",children:t.description||t.subtype||t.type}),e.jsx("span",{className:"text-[10px] text-text-quaternary shrink-0 ml-auto",children:e.jsx(B,{date:t.updated_at??t.created_at})})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5",children:[e.jsx(q,{type:t.type||"unknown",size:"xs"}),e.jsx("span",{className:"flex-1"}),e.jsx(ee,{role:t.role})]})]},t.id))})]}),e.jsxs("div",{children:[e.jsx(_,{icon:$,color:"text-accent",count:he,docsHash:"#docs:dashboard.md:escalations-overview",actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{onRefresh:()=>w.refetch(),isFetching:w.isFetching,apiPath:`/escalations?assigned_to=${(o==null?void 0:o.userId)??""}&status=pending&limit=5&sort_by=created_at&order=desc`}),e.jsx(S,{to:"/escalations/queue",icon:j,title:"My escalation queue"})]}),children:"My Escalations"}),H.length===0?e.jsx(C,{icon:$,text:"No assigned escalations"}):e.jsx("div",{className:"space-y-1",children:H.map(t=>e.jsxs("button",{onClick:()=>s(`/escalations/detail/${t.id}`),className:"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsxs("span",{className:"text-[9px] text-text-quaternary font-medium shrink-0",children:["P",t.priority??2]}),e.jsx("span",{className:"text-[12px] text-text-primary truncate flex-1 max-w-[65%]",children:t.description||t.subtype||t.type}),e.jsx("span",{className:"text-[10px] text-text-quaternary shrink-0 ml-auto",children:e.jsx(B,{date:t.updated_at??t.created_at})})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5",children:[e.jsx(q,{type:t.type||"unknown",size:"xs"}),e.jsx("span",{className:"flex-1"}),e.jsx(ee,{role:t.role})]})]},t.id))})]})]}),(n.canSeePaceBoard||n.canSeeWorkflows)&&e.jsxs("div",{className:`grid grid-cols-1 ${v} gap-x-14 mt-14`,children:[n.canSeePaceBoard&&e.jsxs("div",{children:[e.jsx(_,{icon:ae,color:"text-accent",docsHash:"#docs:dashboard.md:pace-board",actions:e.jsx(S,{to:"/operations",icon:j,title:"Open the Pace Board"}),children:"Pace Board"}),M.length===0?e.jsx(C,{icon:ae,text:"No stations yet — mark roles visible in Operations"}):e.jsx("div",{className:`${a?"h-64":"h-80"} cursor-pointer`,onClick:()=>s("/operations"),children:e.jsx(Ce,{stations:M,selectedRole:null,onSelect:()=>s("/operations"),onUpstreamSelect:()=>s("/operations"),periodHours:1})})]}),n.canSeeWorkflows&&fe,n.canSeeWorkflows&&ge]})]})}export{rt as HomePage};
2
+ //# sourceMappingURL=HomePage-BpexnDO_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HomePage-DcWfjZA-.js","sources":["../../src/hooks/useMyEscalationCount.ts","../../src/pages/home/TaskQueueCard.tsx","../../src/pages/home/TaskQueueCards.tsx","../../src/pages/home/HomePage.tsx"],"sourcesContent":["import { useQueryClient } from '@tanstack/react-query';\nimport { useAuth } from './useAuth';\nimport { useEscalations } from '../api/escalations';\nimport { useEventSubscription } from './useEventContext';\nimport { NATS_SUBJECT_PREFIX } from '../lib/nats/config';\n\n/**\n * Returns the number of active (non-expired) escalations assigned to the current user.\n * The API filters expired claims server-side (assigned_until > NOW()) when\n * assigned_to is provided, so the total from the query is accurate.\n */\nexport function useMyEscalationCount(): number {\n const { user } = useAuth();\n const userId = user?.userId;\n const qc = useQueryClient();\n\n const { data } = useEscalations({\n assigned_to: userId,\n status: 'pending',\n limit: 1,\n });\n\n useEventSubscription(`${NATS_SUBJECT_PREFIX}.system.escalation.>`, () => {\n if (userId) {\n qc.invalidateQueries({ queryKey: ['escalations'] });\n }\n });\n\n return data?.total ?? 0;\n}\n","import { useNavigate } from 'react-router-dom';\nimport { ExternalLink, TriangleAlert, Hand } from 'lucide-react';\nimport type { StationMetric } from '../../api/escalations';\nimport { jeopardyQueueLink } from '../operations/priority-link';\n\nfunction Stat({ n, label, tone }: { n: number; label: string; tone?: 'muted' }) {\n return (\n <div className=\"min-w-0\">\n <div className={`text-2xl font-light tabular-nums leading-none ${tone === 'muted' ? 'text-text-tertiary' : 'text-text-primary'}`}>\n {n}\n </div>\n <div className=\"text-[9px] uppercase tracking-wider text-text-quaternary mt-1 truncate\">{label}</div>\n </div>\n );\n}\n\n/**\n * One lane's shape at a glance: pending / claimed / resolved over the selected\n * window, plus the jeopardy signal when items sit past the role's priority\n * threshold. The card opens the role's queue; the jeopardy pill opens it\n * sorted oldest-first so the at-risk items sit on top.\n */\nexport function TaskQueueCard({\n role,\n title,\n metric,\n priorityFacet,\n periodLabel,\n}: {\n role: string;\n title: string | null;\n metric: StationMetric | undefined;\n priorityFacet: string | null;\n periodLabel: string;\n}) {\n const navigate = useNavigate();\n const pending = metric?.pending ?? 0;\n const claimed = metric?.claimed ?? 0;\n const resolved = metric?.resolved ?? 0;\n const jeopardy = metric?.priority_count ?? 0;\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => navigate(`/escalations/available?role=${encodeURIComponent(role)}`)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n navigate(`/escalations/available?role=${encodeURIComponent(role)}`);\n }\n }}\n className=\"group h-full border-l-2 border-accent/30 bg-surface-sunken/40 rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-surface-sunken/70 focus:outline-none focus-visible:ring-1 focus-visible:ring-accent/40\"\n >\n <div className=\"flex items-center justify-between gap-2 mb-3\">\n <span className=\"text-[11px] font-semibold uppercase tracking-wider text-text-secondary truncate\">\n {title || role}\n </span>\n <ExternalLink className=\"w-3 h-3 shrink-0 text-text-quaternary opacity-0 group-hover:opacity-100 transition-opacity\" strokeWidth={1.5} />\n </div>\n\n <div className=\"flex items-baseline gap-5\">\n <Stat n={pending} label=\"pending\" />\n <Stat n={claimed} label=\"claimed\" />\n <Stat n={resolved} label={`resolved · ${periodLabel}`} tone=\"muted\" />\n </div>\n\n <div className=\"mt-3 h-6 flex items-center\">\n {jeopardy > 0 ? (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n navigate(jeopardyQueueLink({ role, priority_facet: priorityFacet }));\n }}\n className=\"inline-flex items-center gap-1.5 pl-1.5 pr-2.5 py-1 rounded-full text-[11px] font-semibold tabular-nums bg-status-error text-white transition-transform hover:scale-[1.05]\"\n title=\"Past the priority threshold — a hard limit; open oldest first\"\n >\n <TriangleAlert className=\"w-3 h-3\" strokeWidth={2.5} />\n {jeopardy} in jeopardy\n </button>\n ) : (\n <span className=\"text-[10px] text-text-quaternary\">on pace</span>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * The runner's own work, across every lane. First and highlighted — what to\n * finish before pulling anything new. Opens their personal queue.\n */\nexport function ClaimedCard({ count }: { count: number }) {\n const navigate = useNavigate();\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => navigate('/escalations/queue')}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n navigate('/escalations/queue');\n }\n }}\n className=\"group h-full border-l-2 border-status-warning/70 bg-status-warning/[0.06] rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-status-warning/[0.1] focus:outline-none focus-visible:ring-1 focus-visible:ring-status-warning/40\"\n >\n <div className=\"flex items-center justify-between gap-2 mb-3\">\n <span className=\"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-status-warning\">\n <Hand className=\"w-3 h-3\" strokeWidth={2} />\n Claimed\n </span>\n <ExternalLink className=\"w-3 h-3 shrink-0 text-text-quaternary opacity-0 group-hover:opacity-100 transition-opacity\" strokeWidth={1.5} />\n </div>\n\n <div className=\"text-2xl font-light tabular-nums leading-none text-text-primary\">{count}</div>\n <div className=\"text-[9px] uppercase tracking-wider text-text-quaternary mt-1\">assigned to you</div>\n\n <div className=\"mt-3 h-6 flex items-center\">\n <span className=\"text-[11px] font-medium text-status-warning\">\n {count > 0 ? 'Finish these first →' : 'Nothing claimed'}\n </span>\n </div>\n </div>\n );\n}\n","import { useState, useMemo } from 'react';\nimport { Layers } from 'lucide-react';\nimport { useStationMetrics } from '../../api/escalations';\nimport { useRoleDetails } from '../../api/roles';\nimport { useTaskQueueRoles } from '../../hooks/useTaskQueueRoles';\nimport { useMyEscalationCount } from '../../hooks/useMyEscalationCount';\nimport { TaskQueueCard, ClaimedCard } from './TaskQueueCard';\n\nconst PERIODS = ['15m', '1h', '24h', '7d'] as const;\ntype Period = (typeof PERIODS)[number];\n\n/**\n * The scoped runner's home: their own claimed work first, then one card per\n * lane they belong to — pending / claimed / resolved and a jeopardy signal over\n * a chosen window. A poor-man's Pace Board: no cross-role trend, just \"what is\n * in my lanes and what needs attention.\" Engineers get a single compact row\n * (workflows sit below); operators get the fuller two-row surface.\n */\nexport function TaskQueueCards({ maxRows }: { maxRows: 1 | 2 }) {\n const [period, setPeriod] = useState<Period>('24h');\n const roles = useTaskQueueRoles();\n const claimedCount = useMyEscalationCount();\n const metricsQ = useStationMetrics(period);\n const rolesQ = useRoleDetails();\n\n const metricByRole = useMemo(\n () => new Map((metricsQ.data?.stations ?? []).map((m) => [m.role, m])),\n [metricsQ.data],\n );\n const detailByRole = useMemo(\n () => new Map((rolesQ.data?.roles ?? []).map((r) => [r.role, r])),\n [rolesQ.data],\n );\n\n // Lanes lead with the most at-risk: sort by jeopardy count (a hard limit the\n // plant manager pulls to the front of the line), then alphabetically for a\n // stable order among ties. Card #1 is always Claimed, ahead of these.\n const sortedRoles = useMemo(() => {\n return [...roles].sort((a, b) => {\n const ja = metricByRole.get(a)?.priority_count ?? 0;\n const jb = metricByRole.get(b)?.priority_count ?? 0;\n if (jb !== ja) return jb - ja;\n return a.localeCompare(b);\n });\n }, [roles, metricByRole]);\n\n // The rest of the grid is lanes. Cap to the persona's row budget and surface\n // any overflow rather than hiding it.\n const slots = maxRows * 4;\n const laneBudget = slots - 1;\n const shownRoles = sortedRoles.slice(0, laneBudget);\n const overflow = sortedRoles.length - shownRoles.length;\n\n return (\n <div>\n <div className=\"flex items-center justify-between mb-4 pb-2 border-b border-surface-border\">\n <h2 className=\"flex items-center gap-2 text-sm font-medium text-text-primary\">\n <Layers className=\"w-4 h-4 text-accent\" strokeWidth={1.5} />\n Task Queues\n </h2>\n <div className=\"flex items-center gap-0.5\">\n {PERIODS.map((p) => (\n <button\n key={p}\n onClick={() => setPeriod(p)}\n className={`px-2.5 py-1 text-[10px] font-mono rounded transition-colors ${\n period === p\n ? 'bg-accent/10 text-accent font-semibold'\n : 'text-text-quaternary hover:text-text-secondary'\n }`}\n >\n {p}\n </button>\n ))}\n </div>\n </div>\n\n {roles.length === 0 ? (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n <ClaimedCard count={claimedCount} />\n <div className=\"lg:col-span-3 flex items-center px-4 py-3.5 text-sm text-text-tertiary\">\n You are not a member of a role. Task queues appear here once you join one.\n </div>\n </div>\n ) : (\n <>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 auto-rows-fr\">\n <ClaimedCard count={claimedCount} />\n {shownRoles.map((role) => (\n <TaskQueueCard\n key={role}\n role={role}\n title={detailByRole.get(role)?.title ?? null}\n metric={metricByRole.get(role)}\n priorityFacet={detailByRole.get(role)?.priority_facet ?? null}\n periodLabel={period}\n />\n ))}\n </div>\n {overflow > 0 && (\n <p className=\"mt-3 text-[11px] text-text-quaternary\">\n +{overflow} more {overflow === 1 ? 'lane' : 'lanes'} in the Task Queues sidebar.\n </p>\n )}\n </>\n )}\n </div>\n );\n}\n","import { useState, useRef, useCallback, useEffect, useMemo } from 'react';\nimport { useNavigate, useSearchParams } from 'react-router-dom';\nimport {\n Inbox, Code2, Workflow, LayoutDashboard, ExternalLink, BookOpen,\n} from 'lucide-react';\nimport { formatCountCompact } from '../../lib/format';\nimport { useAvailableEscalations, useEscalations, useStationMetrics } from '../../api/escalations';\nimport { useRoleDetails } from '../../api/roles';\nimport { useJobs } from '../../api/workflows';\nimport { useMcpRuns } from '../../api/pipelines';\nimport { useControlPlaneApps } from '../../api/controlplane';\nimport { useAuth } from '../../hooks/useAuth';\nimport { useAccess } from '../../hooks/useAccess';\nimport { usePersona } from '../../hooks/usePersona';\nimport { useEscalationStatsEvents, useWorkflowListEvents, useStationMetricsEvents } from '../../hooks/useEventHooks';\nimport { DateValue } from '../../components/common/display/DateValue';\nimport { RolePill } from '../../components/common/display/RolePill';\nimport { WorkflowPill } from '../../components/common/display/WorkflowPill';\nimport { ListToolbar } from '../../components/common/data/ListToolbar';\nimport { PaceChart, type ChartStation } from '../operations/PaceChart';\nimport { buildFragments } from '../operations/OperationsPage';\nimport { TaskQueueCards } from './TaskQueueCards';\n\nconst STATUS_DOT: Record<string, string> = {\n completed: 'bg-status-success',\n active: 'bg-status-active',\n running: 'bg-status-active',\n pending: 'bg-status-pending',\n error: 'bg-status-error',\n failed: 'bg-status-error',\n};\nfunction statusDotClass(status: string): string {\n return STATUS_DOT[status] ?? 'bg-text-tertiary';\n}\n\n// ── Section header ──────────────────────────────────────────────────────────\n\nfunction SectionHeader({ icon: Icon, color, docsHash, count, children, actions }: { icon: React.ElementType; color?: string; docsHash?: string; count?: number; children: React.ReactNode; actions?: React.ReactNode }) {\n return (\n <div className=\"flex items-center justify-between mb-4 pb-2 border-b border-surface-border\">\n <div className=\"flex items-center gap-2\">\n <Icon className={`w-4.5 h-4.5 ${color || 'text-accent/60'}`} strokeWidth={1.5} />\n <h2 className=\"section-h2\">{children}</h2>\n {count !== undefined && count > 0 && (\n <span className=\"px-1.5 py-0.5 rounded-full bg-accent/10 text-accent text-[10px] font-semibold tabular-nums\">\n {formatCountCompact(count)}\n </span>\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {docsHash && (\n <button onClick={() => { window.location.hash = docsHash; }} className=\"text-text-quaternary hover:text-accent transition-colors\" title=\"Docs\">\n <BookOpen className=\"w-2.5 h-2.5\" strokeWidth={1.5} />\n </button>\n )}\n {actions}\n </div>\n </div>\n );\n}\n\nfunction EmptyPanel({ icon: Icon, text }: { icon: React.ElementType; text: string }) {\n return (\n <div className=\"flex flex-col items-center justify-center py-10 text-center\">\n <Icon className=\"w-6 h-6 text-text-quaternary/50 mb-2\" strokeWidth={1} />\n <p className=\"text-xs text-text-quaternary\">{text}</p>\n </div>\n );\n}\n\n/** Middle-ellipsis: keep first N and last N chars with ... in between */\nfunction midEllipsis(s: string, maxLen = 37): string {\n if (!s || s.length <= maxLen) return s;\n const keep = Math.floor((maxLen - 3) / 2);\n return `${s.slice(0, keep)}...${s.slice(-keep)}`;\n}\n\n/** Consistent row for all execution lists in row 1 */\nfunction ExecutionRow({ dot, pill, id, date, onClick }: {\n dot: string;\n pill: React.ReactNode;\n id: string;\n date: string;\n onClick: () => void;\n}) {\n return (\n <button onClick={onClick} className=\"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors\">\n <div className=\"flex items-center gap-2 mb-0.5\">\n <span className={`w-1.5 h-1.5 rounded-full dot-ring shrink-0 ${dot}`} />\n <span className=\"text-[12px] text-text-primary font-mono truncate max-w-[60%]\">{midEllipsis(id)}</span>\n <span className=\"text-[10px] text-text-quaternary shrink-0 ml-auto whitespace-nowrap\"><DateValue date={date} /></span>\n </div>\n <div className=\"pl-3.5 flex items-center gap-1 overflow-hidden\">{pill}</div>\n </button>\n );\n}\n\nfunction NavIcon({ to, icon: Icon, title }: { to: string; icon: React.ElementType; title: string }) {\n const navigate = useNavigate();\n return (\n <button\n onClick={() => navigate(to)}\n className=\"text-text-quaternary hover:text-accent transition-colors\"\n title={title}\n >\n <Icon className=\"w-2.5 h-2.5\" strokeWidth={1.5} />\n </button>\n );\n}\n\n// ── Namespace Picker ────────────────────────────────────────────────────────\n\nfunction AppPicker({ appIds, selected, onSelect }: {\n appIds: string[];\n selected: string;\n onSelect: (id: string) => void;\n}) {\n const [open, setOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const handler = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', handler);\n return () => document.removeEventListener('mousedown', handler);\n }, [open]);\n\n if (appIds.length <= 1) return null;\n\n return (\n <div className=\"relative mb-3 -mt-2\" ref={ref}>\n <button\n onClick={() => setOpen((v) => !v)}\n className=\"flex items-center gap-1 px-2 py-0.5 text-[10px] rounded bg-accent/10 text-accent hover:bg-accent/20 transition-colors\"\n >\n {selected}\n <svg className={`w-2.5 h-2.5 transition-transform ${open ? 'rotate-180' : ''}`} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n </button>\n {open && (\n <div className=\"absolute top-full left-0 mt-1 bg-surface-raised border border-surface-border rounded-md shadow-lg z-30 py-1 min-w-[120px]\">\n {appIds.map((id) => (\n <button\n key={id}\n onClick={() => { onSelect(id); setOpen(false); }}\n className={`w-full text-left px-3 py-1.5 text-[11px] transition-colors ${\n selected === id ? 'text-accent bg-accent/5' : 'text-text-secondary hover:bg-surface-hover'\n }`}\n >\n {id}\n </button>\n ))}\n </div>\n )}\n </div>\n );\n}\n\n// ── Page ─────────────────────────────────────────────────────────────────────\n\nexport function HomePage() {\n const navigate = useNavigate();\n const { user } = useAuth();\n const { isBuilder } = useAccess();\n const persona = usePersona();\n const [searchParams, setSearchParams] = useSearchParams();\n const { data: cpData } = useControlPlaneApps({ enabled: isBuilder });\n const allAppIds = useMemo(() => (cpData?.apps ?? []).map((a: any) => a.appId).sort(), [cpData]);\n const firstAppId = allAppIds[0] ?? '';\n const pipelineNs = searchParams.get('pipelinenamespace') || firstAppId;\n const durableNs = searchParams.get('durablenamespace') || firstAppId;\n const setNs = useCallback((key: string, ns: string) => {\n setSearchParams((prev) => {\n const next = new URLSearchParams(prev);\n next.set(key, ns);\n return next;\n }, { replace: false });\n }, [setSearchParams]);\n useEscalationStatsEvents();\n useWorkflowListEvents();\n useStationMetricsEvents();\n\n // The home page renders one of two layouts (see the return below): the\n // operator's task-queue cards, or the builder home shared by admin, engineer,\n // and superadmin. Gate each data source to the tiers that render it, so no one\n // fires a request they can't access (403 on control-plane apps → empty\n // namespace → 400 on jobs):\n // - All/My escalation firehose → the builder home (everyone except operator)\n // - Pace Board → admin, superadmin only\n // - Procedural/Graph workflows → builders (engineer, superadmin)\n // - Task-queue cards fetch their own scoped metrics inside TaskQueueCards.\n const builderHome = !persona.showTaskQueueCards;\n // Row 2 width adapts to what the tier can see: pace + both workflow columns\n // (superadmin), workflows only (engineer), or pace only, full-width (admin).\n const row2GridClass = persona.canSeePaceBoard && persona.canSeeWorkflows ? 'lg:grid-cols-3'\n : persona.canSeeWorkflows ? 'lg:grid-cols-2' : '';\n const rolesQ = useRoleDetails({ enabled: persona.canSeePaceBoard });\n const stationQ = useStationMetrics('1h', { enabled: persona.canSeePaceBoard });\n const jobsQ = useJobs({ limit: 5, sort_by: 'updated_at', order: 'desc', namespace: durableNs }, { enabled: persona.canSeeWorkflows });\n const durableAppIds = allAppIds;\n const pipelineAppIds = allAppIds;\n const mcpQ = useMcpRuns({ limit: 5, app_id: pipelineNs, sort_by: 'updated_at', order: 'desc' }, { enabled: persona.canSeeWorkflows });\n const allEscQ = useAvailableEscalations({ limit: 5, sort_by: 'created_at', order: 'desc', enabled: builderHome });\n const myEscQ = useEscalations({ assigned_to: user?.userId, status: 'pending', limit: 5, sort_by: 'created_at', order: 'desc', enabled: builderHome });\n\n // Delayed refetch — allows signal-routed escalation resolutions\n // (durable activity) time to commit before refreshing the list\n useEffect(() => {\n const timer = setTimeout(() => {\n myEscQ.refetch();\n allEscQ.refetch();\n }, 2000);\n return () => clearTimeout(timer);\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n // Pace Board mini — the primary sequence (longest line) at the 1h window.\n const paceStations = useMemo((): ChartStation[] => {\n const fragments = buildFragments(rolesQ.data?.roles ?? []);\n const primary = fragments[0]?.stations ?? [];\n const metrics = stationQ.data?.stations ?? [];\n return primary.map(({ role: r }) => ({\n role: r.role,\n title: r.title,\n parent_role: r.parent_role,\n target_per_hour: r.target_per_hour ?? null,\n upstream_roles: r.upstream_roles ?? [],\n metric: metrics.find((m) => m.role === r.role),\n }));\n }, [rolesQ.data, stationQ.data]);\n\n const jobs = jobsQ.data?.jobs ?? [];\n const jobsTotal = jobsQ.data?.total;\n const mcpRuns = (mcpQ.data as any)?.jobs ?? [];\n const mcpTotal = (mcpQ.data as any)?.total as number | undefined;\n const allEscalations = allEscQ.data?.escalations ?? [];\n const allEscTotal = allEscQ.data?.total;\n const myEscalations = myEscQ.data?.escalations ?? [];\n const myEscTotal = myEscQ.data?.total;\n\n // The two workflow execution columns, shared by the builder branches (the\n // engineer layout below and the superadmin Row 2). Defined once so the JSX\n // has a single source of truth.\n const proceduralColumn = (\n <div>\n <SectionHeader icon={Code2} color=\"text-accent\" count={jobsTotal} docsHash=\"#docs:dashboard.md:procedural-executions\" actions={\n <div className=\"flex items-center gap-2\">\n <ListToolbar onRefresh={() => jobsQ.refetch()} isFetching={jobsQ.isFetching} apiPath={`/workflow-states/jobs?namespace=${durableNs}&limit=5`} />\n <NavIcon to=\"/workflows/executions\" icon={ExternalLink} title=\"All procedural executions\" />\n </div>\n }>\n Procedural\n </SectionHeader>\n <AppPicker appIds={durableAppIds} selected={durableNs} onSelect={(ns) => setNs('durablenamespace', ns)} />\n {jobs.length === 0 ? (\n <EmptyPanel icon={Code2} text=\"No recent procedural runs\" />\n ) : (\n <div className=\"space-y-1\">\n {jobs.map((job: any) => (\n <ExecutionRow\n key={job.workflow_id}\n dot={statusDotClass(job.status)}\n pill={<WorkflowPill type={job.entity || job.type || 'workflow'} size=\"xs\" />}\n id={job.workflow_id}\n date={job.updated_at ?? job.created_at}\n onClick={() => navigate(`/workflows/executions/${job.workflow_id}`)}\n />\n ))}\n </div>\n )}\n </div>\n );\n\n const graphColumn = (\n <div>\n <SectionHeader icon={Workflow} color=\"text-accent\" count={mcpTotal} docsHash=\"#docs:dashboard.md:graph-executions\" actions={\n <div className=\"flex items-center gap-2\">\n <ListToolbar onRefresh={() => mcpQ.refetch()} isFetching={mcpQ.isFetching} apiPath={`/pipelines?app_id=${pipelineNs}&limit=5`} />\n <NavIcon to=\"/mcp/executions\" icon={ExternalLink} title=\"All graph executions\" />\n </div>\n }>\n Graph\n </SectionHeader>\n <AppPicker appIds={pipelineAppIds} selected={pipelineNs} onSelect={(ns) => setNs('pipelinenamespace', ns)} />\n {mcpRuns.length === 0 ? (\n <EmptyPanel icon={Workflow} text=\"No recent graph runs\" />\n ) : (\n <div className=\"space-y-1\">\n {mcpRuns.map((run: any) => (\n <ExecutionRow\n key={run.workflow_id}\n dot={statusDotClass(run.status)}\n pill={<WorkflowPill type={run.entity || run.workflow_name || 'pipeline'} variant=\"pipeline\" size=\"xs\" />}\n id={run.workflow_id}\n date={run.updated_at ?? run.created_at}\n onClick={() => navigate(`/mcp/executions/${run.workflow_id}?namespace=${pipelineNs}`)}\n />\n ))}\n </div>\n )}\n </div>\n );\n\n // ── Operator: their own lanes as Task Queue cards, nothing else. Scoped to\n // the roles they belong to; no firehose, no Pace Board, no workflows.\n if (persona.showTaskQueueCards) {\n return (\n <div>\n <h1 className=\"text-3xl font-light text-text-primary mb-10\">Recent Activity</h1>\n <TaskQueueCards maxRows={2} />\n </div>\n );\n }\n\n // ── Builder home (admin, engineer, superadmin): the All/My firehose, plus the\n // Pace Board (admin/superadmin) and the workflow columns (engineer/\n // superadmin). Engineers see everything here except the Pace Board.\n return (\n <div>\n <h1 className=\"text-3xl font-light text-text-primary mb-10\">Recent Activity</h1>\n\n {/* ── Row 1: All Escalations | My Escalations ──────────────────────── */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-x-14 min-h-[35vh]\">\n\n {/* Col 1: All Escalations */}\n <div>\n <SectionHeader icon={Inbox} color=\"text-accent\" count={allEscTotal} docsHash=\"#docs:dashboard.md:all-escalations\" actions={\n <div className=\"flex items-center gap-2\">\n <ListToolbar onRefresh={() => allEscQ.refetch()} isFetching={allEscQ.isFetching} apiPath=\"/escalations?status=pending&limit=5&sort_by=created_at&order=desc\" />\n <NavIcon to=\"/escalations/available\" icon={ExternalLink} title=\"All escalations\" />\n </div>\n }>\n All Escalations\n </SectionHeader>\n {allEscalations.length === 0 ? (\n <EmptyPanel icon={Inbox} text=\"No pending escalations\" />\n ) : (\n <div className=\"space-y-1\">\n {allEscalations.map((esc: any) => (\n <button\n key={esc.id}\n onClick={() => navigate(`/escalations/detail/${esc.id}`)}\n className=\"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors\"\n >\n <div className=\"flex items-center gap-2 mb-0.5\">\n <span className=\"text-[9px] text-text-quaternary font-medium shrink-0\">P{esc.priority ?? 2}</span>\n <span className=\"text-[12px] text-text-primary truncate flex-1 max-w-[65%]\">{esc.description || esc.subtype || esc.type}</span>\n <span className=\"text-[10px] text-text-quaternary shrink-0 ml-auto\"><DateValue date={esc.updated_at ?? esc.created_at} /></span>\n </div>\n <div className=\"flex items-center gap-2 pl-5\">\n <WorkflowPill type={esc.type || 'unknown'} size=\"xs\" />\n <span className=\"flex-1\" />\n <RolePill role={esc.role} />\n </div>\n </button>\n ))}\n </div>\n )}\n </div>\n\n {/* Col 2: My Escalations */}\n <div>\n <SectionHeader icon={Inbox} color=\"text-accent\" count={myEscTotal} docsHash=\"#docs:dashboard.md:escalations-overview\" actions={\n <div className=\"flex items-center gap-2\">\n <ListToolbar onRefresh={() => myEscQ.refetch()} isFetching={myEscQ.isFetching} apiPath={`/escalations?assigned_to=${user?.userId ?? ''}&status=pending&limit=5&sort_by=created_at&order=desc`} />\n <NavIcon to=\"/escalations/queue\" icon={ExternalLink} title=\"My escalation queue\" />\n </div>\n }>\n My Escalations\n </SectionHeader>\n {myEscalations.length === 0 ? (\n <EmptyPanel icon={Inbox} text=\"No assigned escalations\" />\n ) : (\n <div className=\"space-y-1\">\n {myEscalations.map((esc: any) => (\n <button\n key={esc.id}\n onClick={() => navigate(`/escalations/detail/${esc.id}`)}\n className=\"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors\"\n >\n <div className=\"flex items-center gap-2 mb-0.5\">\n <span className=\"text-[9px] text-text-quaternary font-medium shrink-0\">P{esc.priority ?? 2}</span>\n <span className=\"text-[12px] text-text-primary truncate flex-1 max-w-[65%]\">{esc.description || esc.subtype || esc.type}</span>\n <span className=\"text-[10px] text-text-quaternary shrink-0 ml-auto\"><DateValue date={esc.updated_at ?? esc.created_at} /></span>\n </div>\n <div className=\"flex items-center gap-2 pl-5\">\n <WorkflowPill type={esc.type || 'unknown'} size=\"xs\" />\n <span className=\"flex-1\" />\n <RolePill role={esc.role} />\n </div>\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n\n {/* ── Row 2: Pace Board (admin/superadmin) | Procedural | Graph (builders).\n Engineers get the workflow columns but no Pace Board; admins get the\n Pace Board full-width. */}\n {(persona.canSeePaceBoard || persona.canSeeWorkflows) && (\n <div className={`grid grid-cols-1 ${row2GridClass} gap-x-14 mt-14`}>\n\n {/* Pace Board — the story being told, at a glance */}\n {persona.canSeePaceBoard && (\n <div>\n <SectionHeader icon={LayoutDashboard} color=\"text-accent\" docsHash=\"#docs:dashboard.md:pace-board\" actions={\n <NavIcon to=\"/operations\" icon={ExternalLink} title=\"Open the Pace Board\" />\n }>\n Pace Board\n </SectionHeader>\n {paceStations.length === 0 ? (\n <EmptyPanel icon={LayoutDashboard} text=\"No stations yet — mark roles visible in Operations\" />\n ) : (\n <div className={`${isBuilder ? 'h-64' : 'h-80'} cursor-pointer`} onClick={() => navigate('/operations')}>\n <PaceChart\n stations={paceStations}\n selectedRole={null}\n onSelect={() => navigate('/operations')}\n onUpstreamSelect={() => navigate('/operations')}\n periodHours={1}\n />\n </div>\n )}\n </div>\n )}\n\n {/* Workflow executions — builders (engineer, superadmin) */}\n {persona.canSeeWorkflows && proceduralColumn}\n {persona.canSeeWorkflows && graphColumn}\n </div>\n )}\n </div>\n );\n}\n"],"names":["useMyEscalationCount","user","useAuth","userId","qc","useQueryClient","data","useEscalations","useEventSubscription","NATS_SUBJECT_PREFIX","Stat","n","label","tone","jsxs","jsx","TaskQueueCard","role","title","metric","priorityFacet","periodLabel","navigate","useNavigate","pending","claimed","resolved","jeopardy","e","ExternalLink","jeopardyQueueLink","TriangleAlert","ClaimedCard","count","Hand","PERIODS","TaskQueueCards","maxRows","period","setPeriod","useState","roles","useTaskQueueRoles","claimedCount","metricsQ","useStationMetrics","rolesQ","useRoleDetails","metricByRole","useMemo","_a","m","detailByRole","r","sortedRoles","a","b","ja","jb","_b","laneBudget","shownRoles","overflow","Layers","p","Fragment","STATUS_DOT","statusDotClass","status","SectionHeader","Icon","color","docsHash","children","actions","formatCountCompact","BookOpen","EmptyPanel","text","midEllipsis","maxLen","keep","ExecutionRow","dot","pill","id","date","onClick","DateValue","NavIcon","to","AppPicker","appIds","selected","onSelect","open","setOpen","ref","useRef","useEffect","handler","v","HomePage","isBuilder","useAccess","persona","usePersona","searchParams","setSearchParams","useSearchParams","cpData","useControlPlaneApps","allAppIds","firstAppId","pipelineNs","durableNs","setNs","useCallback","key","ns","prev","next","useEscalationStatsEvents","useWorkflowListEvents","useStationMetricsEvents","builderHome","row2GridClass","stationQ","jobsQ","useJobs","durableAppIds","pipelineAppIds","mcpQ","useMcpRuns","allEscQ","useAvailableEscalations","myEscQ","timer","paceStations","primary","buildFragments","metrics","_c","jobs","jobsTotal","mcpRuns","mcpTotal","_d","allEscalations","_e","allEscTotal","_f","myEscalations","_g","myEscTotal","_h","proceduralColumn","Code2","ListToolbar","job","WorkflowPill","graphColumn","Workflow","run","Inbox","esc","RolePill","LayoutDashboard","PaceChart"],"mappings":"kyBAWO,SAASA,IAA+B,CAC7C,KAAM,CAAE,KAAAC,CAAA,EAASC,GAAA,EACXC,EAASF,GAAA,YAAAA,EAAM,OACfG,EAAKC,GAAA,EAEL,CAAE,KAAAC,CAAA,EAASC,GAAe,CAC9B,YAAaJ,EACb,OAAQ,UACR,MAAO,CAAA,CACR,EAED,OAAAK,GAAqB,GAAGC,EAAmB,uBAAwB,IAAM,CACnEN,GACFC,EAAG,kBAAkB,CAAE,SAAU,CAAC,aAAa,EAAG,CAEtD,CAAC,GAEME,GAAA,YAAAA,EAAM,QAAS,CACxB,CCxBA,SAASI,EAAK,CAAE,EAAAC,EAAG,MAAAC,EAAO,KAAAC,GAAsD,CAC9E,OACEC,EAAAA,KAAC,MAAA,CAAI,UAAU,UACb,SAAA,CAAAC,EAAAA,IAAC,MAAA,CAAI,UAAW,iDAAiDF,IAAS,QAAU,qBAAuB,mBAAmB,GAC3H,SAAAF,CAAA,CACH,EACAI,EAAAA,IAAC,MAAA,CAAI,UAAU,yEAA0E,SAAAH,CAAA,CAAM,CAAA,EACjG,CAEJ,CAQO,SAASI,GAAc,CAC5B,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,CACF,EAMG,CACD,MAAMC,EAAWC,EAAA,EACXC,GAAUL,GAAA,YAAAA,EAAQ,UAAW,EAC7BM,GAAUN,GAAA,YAAAA,EAAQ,UAAW,EAC7BO,GAAWP,GAAA,YAAAA,EAAQ,WAAY,EAC/BQ,GAAWR,GAAA,YAAAA,EAAQ,iBAAkB,EAE3C,OACEL,EAAAA,KAAC,MAAA,CACC,KAAK,SACL,SAAU,EACV,QAAS,IAAMQ,EAAS,+BAA+B,mBAAmBL,CAAI,CAAC,EAAE,EACjF,UAAYW,GAAM,EACZA,EAAE,MAAQ,SAAWA,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SAAA,CAAAC,MAACiJ,GAAa,KAAMK,EAAI,MAAQ,UAAW,KAAK,KAAK,EACrDtJ,EAAAA,IAAC,OAAA,CAAK,UAAU,QAAA,CAAS,EACzBA,EAAAA,IAACuJ,GAAA,CAAS,KAAMD,EAAI,IAAA,CAAM,CAAA,CAAA,CAC5B,CAAA,CAAA,EAbKA,EAAI,EAAA,CAeZ,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,EACF,GAKE5D,EAAQ,iBAAmBA,EAAQ,yBAClC,MAAA,CAAI,UAAW,oBAAoBqB,CAAa,kBAG9C,SAAA,CAAArB,EAAQ,wBACN,MAAA,CACC,SAAA,CAAA1F,MAACsD,GAAc,KAAMkG,GAAiB,MAAM,cAAc,SAAS,gCAAgC,QACjGxJ,EAAAA,IAAC0E,EAAA,CAAQ,GAAG,cAAc,KAAM5D,EAAc,MAAM,sBAAsB,EAC1E,SAAA,aAEF,EACC6G,EAAa,SAAW,EACvB3H,EAAAA,IAAC8D,GAAW,KAAM0F,GAAiB,KAAK,oDAAA,CAAqD,EAE7FxJ,EAAAA,IAAC,OAAI,UAAW,GAAGwF,EAAY,OAAS,MAAM,kBAAmB,QAAS,IAAMjF,EAAS,aAAa,EACpG,SAAAP,EAAAA,IAACyJ,GAAA,CACC,SAAU9B,EACV,aAAc,KACd,SAAU,IAAMpH,EAAS,aAAa,EACtC,iBAAkB,IAAMA,EAAS,aAAa,EAC9C,YAAa,CAAA,CAAA,CACf,CACF,CAAA,EAEJ,EAIDmF,EAAQ,iBAAmBmD,GAC3BnD,EAAQ,iBAAmBwD,EAAA,CAAA,CAC9B,CAAA,EAEJ,CAEJ"}
1
+ {"version":3,"file":"HomePage-BpexnDO_.js","sources":["../../src/hooks/useMyEscalationCount.ts","../../src/pages/home/TaskQueueCard.tsx","../../src/pages/home/TaskQueueCards.tsx","../../src/pages/home/HomePage.tsx"],"sourcesContent":["import { useQueryClient } from '@tanstack/react-query';\nimport { useAuth } from './useAuth';\nimport { useEscalations } from '../api/escalations';\nimport { useEventSubscription } from './useEventContext';\nimport { NATS_SUBJECT_PREFIX } from '../lib/nats/config';\n\n/**\n * Returns the number of active (non-expired) escalations assigned to the current user.\n * The API filters expired claims server-side (assigned_until > NOW()) when\n * assigned_to is provided, so the total from the query is accurate.\n */\nexport function useMyEscalationCount(): number {\n const { user } = useAuth();\n const userId = user?.userId;\n const qc = useQueryClient();\n\n const { data } = useEscalations({\n assigned_to: userId,\n status: 'pending',\n limit: 1,\n });\n\n useEventSubscription(`${NATS_SUBJECT_PREFIX}.system.escalation.>`, () => {\n if (userId) {\n qc.invalidateQueries({ queryKey: ['escalations'] });\n }\n });\n\n return data?.total ?? 0;\n}\n","import { useNavigate } from 'react-router-dom';\nimport { ExternalLink, TriangleAlert, Hand } from 'lucide-react';\nimport type { StationMetric } from '../../api/escalations';\nimport { jeopardyQueueLink } from '../operations/priority-link';\n\nfunction Stat({ n, label, tone }: { n: number; label: string; tone?: 'muted' }) {\n return (\n <div className=\"min-w-0\">\n <div className={`text-2xl font-light tabular-nums leading-none ${tone === 'muted' ? 'text-text-tertiary' : 'text-text-primary'}`}>\n {n}\n </div>\n <div className=\"text-[9px] uppercase tracking-wider text-text-quaternary mt-1 truncate\">{label}</div>\n </div>\n );\n}\n\n/**\n * One lane's shape at a glance: pending / claimed / resolved over the selected\n * window, plus the jeopardy signal when items sit past the role's priority\n * threshold. The card opens the role's queue; the jeopardy pill opens it\n * sorted oldest-first so the at-risk items sit on top.\n */\nexport function TaskQueueCard({\n role,\n title,\n metric,\n priorityFacet,\n periodLabel,\n}: {\n role: string;\n title: string | null;\n metric: StationMetric | undefined;\n priorityFacet: string | null;\n periodLabel: string;\n}) {\n const navigate = useNavigate();\n const pending = metric?.pending ?? 0;\n const claimed = metric?.claimed ?? 0;\n const resolved = metric?.resolved ?? 0;\n const jeopardy = metric?.priority_count ?? 0;\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => navigate(`/escalations/available?role=${encodeURIComponent(role)}`)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n navigate(`/escalations/available?role=${encodeURIComponent(role)}`);\n }\n }}\n className=\"group h-full border-l-2 border-accent/30 bg-surface-sunken/40 rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-surface-sunken/70 focus:outline-none focus-visible:ring-1 focus-visible:ring-accent/40\"\n >\n <div className=\"flex items-center justify-between gap-2 mb-3\">\n <span className=\"text-[11px] font-semibold uppercase tracking-wider text-text-secondary truncate\">\n {title || role}\n </span>\n <ExternalLink className=\"w-3 h-3 shrink-0 text-text-quaternary opacity-0 group-hover:opacity-100 transition-opacity\" strokeWidth={1.5} />\n </div>\n\n <div className=\"flex items-baseline gap-5\">\n <Stat n={pending} label=\"pending\" />\n <Stat n={claimed} label=\"claimed\" />\n <Stat n={resolved} label={`resolved · ${periodLabel}`} tone=\"muted\" />\n </div>\n\n <div className=\"mt-3 h-6 flex items-center\">\n {jeopardy > 0 ? (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n navigate(jeopardyQueueLink({ role, priority_facet: priorityFacet }));\n }}\n className=\"inline-flex items-center gap-1.5 pl-1.5 pr-2.5 py-1 rounded-full text-[11px] font-semibold tabular-nums bg-status-error text-white transition-transform hover:scale-[1.05]\"\n title=\"Past the priority threshold — a hard limit; open oldest first\"\n >\n <TriangleAlert className=\"w-3 h-3\" strokeWidth={2.5} />\n {jeopardy} in jeopardy\n </button>\n ) : (\n <span className=\"text-[10px] text-text-quaternary\">on pace</span>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * The runner's own work, across every lane. First and highlighted — what to\n * finish before pulling anything new. Opens their personal queue.\n */\nexport function ClaimedCard({ count }: { count: number }) {\n const navigate = useNavigate();\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => navigate('/escalations/queue')}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n navigate('/escalations/queue');\n }\n }}\n className=\"group h-full border-l-2 border-status-warning/70 bg-status-warning/[0.06] rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-status-warning/[0.1] focus:outline-none focus-visible:ring-1 focus-visible:ring-status-warning/40\"\n >\n <div className=\"flex items-center justify-between gap-2 mb-3\">\n <span className=\"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-status-warning\">\n <Hand className=\"w-3 h-3\" strokeWidth={2} />\n Claimed\n </span>\n <ExternalLink className=\"w-3 h-3 shrink-0 text-text-quaternary opacity-0 group-hover:opacity-100 transition-opacity\" strokeWidth={1.5} />\n </div>\n\n <div className=\"text-2xl font-light tabular-nums leading-none text-text-primary\">{count}</div>\n <div className=\"text-[9px] uppercase tracking-wider text-text-quaternary mt-1\">assigned to you</div>\n\n <div className=\"mt-3 h-6 flex items-center\">\n <span className=\"text-[11px] font-medium text-status-warning\">\n {count > 0 ? 'Finish these first →' : 'Nothing claimed'}\n </span>\n </div>\n </div>\n );\n}\n","import { useState, useMemo } from 'react';\nimport { Layers } from 'lucide-react';\nimport { useStationMetrics } from '../../api/escalations';\nimport { useRoleDetails } from '../../api/roles';\nimport { useTaskQueueRoles } from '../../hooks/useTaskQueueRoles';\nimport { useMyEscalationCount } from '../../hooks/useMyEscalationCount';\nimport { TaskQueueCard, ClaimedCard } from './TaskQueueCard';\n\nconst PERIODS = ['15m', '1h', '24h', '7d'] as const;\ntype Period = (typeof PERIODS)[number];\n\n/**\n * The scoped runner's home: their own claimed work first, then one card per\n * lane they belong to — pending / claimed / resolved and a jeopardy signal over\n * a chosen window. A poor-man's Pace Board: no cross-role trend, just \"what is\n * in my lanes and what needs attention.\" Engineers get a single compact row\n * (workflows sit below); operators get the fuller two-row surface.\n */\nexport function TaskQueueCards({ maxRows }: { maxRows: 1 | 2 }) {\n const [period, setPeriod] = useState<Period>('24h');\n const roles = useTaskQueueRoles();\n const claimedCount = useMyEscalationCount();\n const metricsQ = useStationMetrics(period);\n const rolesQ = useRoleDetails();\n\n const metricByRole = useMemo(\n () => new Map((metricsQ.data?.stations ?? []).map((m) => [m.role, m])),\n [metricsQ.data],\n );\n const detailByRole = useMemo(\n () => new Map((rolesQ.data?.roles ?? []).map((r) => [r.role, r])),\n [rolesQ.data],\n );\n\n // Lanes lead with the most at-risk: sort by jeopardy count (a hard limit the\n // plant manager pulls to the front of the line), then alphabetically for a\n // stable order among ties. Card #1 is always Claimed, ahead of these.\n const sortedRoles = useMemo(() => {\n return [...roles].sort((a, b) => {\n const ja = metricByRole.get(a)?.priority_count ?? 0;\n const jb = metricByRole.get(b)?.priority_count ?? 0;\n if (jb !== ja) return jb - ja;\n return a.localeCompare(b);\n });\n }, [roles, metricByRole]);\n\n // The rest of the grid is lanes. Cap to the persona's row budget and surface\n // any overflow rather than hiding it.\n const slots = maxRows * 4;\n const laneBudget = slots - 1;\n const shownRoles = sortedRoles.slice(0, laneBudget);\n const overflow = sortedRoles.length - shownRoles.length;\n\n return (\n <div>\n <div className=\"flex items-center justify-between mb-4 pb-2 border-b border-surface-border\">\n <h2 className=\"flex items-center gap-2 text-sm font-medium text-text-primary\">\n <Layers className=\"w-4 h-4 text-accent\" strokeWidth={1.5} />\n Task Queues\n </h2>\n <div className=\"flex items-center gap-0.5\">\n {PERIODS.map((p) => (\n <button\n key={p}\n onClick={() => setPeriod(p)}\n className={`px-2.5 py-1 text-[10px] font-mono rounded transition-colors ${\n period === p\n ? 'bg-accent/10 text-accent font-semibold'\n : 'text-text-quaternary hover:text-text-secondary'\n }`}\n >\n {p}\n </button>\n ))}\n </div>\n </div>\n\n {roles.length === 0 ? (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n <ClaimedCard count={claimedCount} />\n <div className=\"lg:col-span-3 flex items-center px-4 py-3.5 text-sm text-text-tertiary\">\n You are not a member of a role. Task queues appear here once you join one.\n </div>\n </div>\n ) : (\n <>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 auto-rows-fr\">\n <ClaimedCard count={claimedCount} />\n {shownRoles.map((role) => (\n <TaskQueueCard\n key={role}\n role={role}\n title={detailByRole.get(role)?.title ?? null}\n metric={metricByRole.get(role)}\n priorityFacet={detailByRole.get(role)?.priority_facet ?? null}\n periodLabel={period}\n />\n ))}\n </div>\n {overflow > 0 && (\n <p className=\"mt-3 text-[11px] text-text-quaternary\">\n +{overflow} more {overflow === 1 ? 'lane' : 'lanes'} in the Task Queues sidebar.\n </p>\n )}\n </>\n )}\n </div>\n );\n}\n","import { useState, useRef, useCallback, useEffect, useMemo } from 'react';\nimport { useNavigate, useSearchParams } from 'react-router-dom';\nimport {\n Inbox, Code2, Workflow, LayoutDashboard, ExternalLink, BookOpen,\n} from 'lucide-react';\nimport { formatCountCompact } from '../../lib/format';\nimport { useAvailableEscalations, useEscalations, useStationMetrics } from '../../api/escalations';\nimport { useRoleDetails } from '../../api/roles';\nimport { useJobs } from '../../api/workflows';\nimport { useMcpRuns } from '../../api/pipelines';\nimport { useControlPlaneApps } from '../../api/controlplane';\nimport { useAuth } from '../../hooks/useAuth';\nimport { useAccess } from '../../hooks/useAccess';\nimport { usePersona } from '../../hooks/usePersona';\nimport { useEscalationStatsEvents, useWorkflowListEvents, useStationMetricsEvents } from '../../hooks/useEventHooks';\nimport { DateValue } from '../../components/common/display/DateValue';\nimport { RolePill } from '../../components/common/display/RolePill';\nimport { WorkflowPill } from '../../components/common/display/WorkflowPill';\nimport { ListToolbar } from '../../components/common/data/ListToolbar';\nimport { PaceChart, type ChartStation } from '../operations/PaceChart';\nimport { buildFragments } from '../operations/OperationsPage';\nimport { TaskQueueCards } from './TaskQueueCards';\n\nconst STATUS_DOT: Record<string, string> = {\n completed: 'bg-status-success',\n active: 'bg-status-active',\n running: 'bg-status-active',\n pending: 'bg-status-pending',\n error: 'bg-status-error',\n failed: 'bg-status-error',\n};\nfunction statusDotClass(status: string): string {\n return STATUS_DOT[status] ?? 'bg-text-tertiary';\n}\n\n// ── Section header ──────────────────────────────────────────────────────────\n\nfunction SectionHeader({ icon: Icon, color, docsHash, count, children, actions }: { icon: React.ElementType; color?: string; docsHash?: string; count?: number; children: React.ReactNode; actions?: React.ReactNode }) {\n return (\n <div className=\"flex items-center justify-between mb-4 pb-2 border-b border-surface-border\">\n <div className=\"flex items-center gap-2\">\n <Icon className={`w-4.5 h-4.5 ${color || 'text-accent/60'}`} strokeWidth={1.5} />\n <h2 className=\"section-h2\">{children}</h2>\n {count !== undefined && count > 0 && (\n <span className=\"px-1.5 py-0.5 rounded-full bg-accent/10 text-accent text-[10px] font-semibold tabular-nums\">\n {formatCountCompact(count)}\n </span>\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {docsHash && (\n <button onClick={() => { window.location.hash = docsHash; }} className=\"text-text-quaternary hover:text-accent transition-colors\" title=\"Docs\">\n <BookOpen className=\"w-2.5 h-2.5\" strokeWidth={1.5} />\n </button>\n )}\n {actions}\n </div>\n </div>\n );\n}\n\nfunction EmptyPanel({ icon: Icon, text }: { icon: React.ElementType; text: string }) {\n return (\n <div className=\"flex flex-col items-center justify-center py-10 text-center\">\n <Icon className=\"w-6 h-6 text-text-quaternary/50 mb-2\" strokeWidth={1} />\n <p className=\"text-xs text-text-quaternary\">{text}</p>\n </div>\n );\n}\n\n/** Middle-ellipsis: keep first N and last N chars with ... in between */\nfunction midEllipsis(s: string, maxLen = 37): string {\n if (!s || s.length <= maxLen) return s;\n const keep = Math.floor((maxLen - 3) / 2);\n return `${s.slice(0, keep)}...${s.slice(-keep)}`;\n}\n\n/** Consistent row for all execution lists in row 1 */\nfunction ExecutionRow({ dot, pill, id, date, onClick }: {\n dot: string;\n pill: React.ReactNode;\n id: string;\n date: string;\n onClick: () => void;\n}) {\n return (\n <button onClick={onClick} className=\"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors\">\n <div className=\"flex items-center gap-2 mb-0.5\">\n <span className={`w-1.5 h-1.5 rounded-full dot-ring shrink-0 ${dot}`} />\n <span className=\"text-[12px] text-text-primary font-mono truncate max-w-[60%]\">{midEllipsis(id)}</span>\n <span className=\"text-[10px] text-text-quaternary shrink-0 ml-auto whitespace-nowrap\"><DateValue date={date} /></span>\n </div>\n <div className=\"pl-3.5 flex items-center gap-1 overflow-hidden\">{pill}</div>\n </button>\n );\n}\n\nfunction NavIcon({ to, icon: Icon, title }: { to: string; icon: React.ElementType; title: string }) {\n const navigate = useNavigate();\n return (\n <button\n onClick={() => navigate(to)}\n className=\"text-text-quaternary hover:text-accent transition-colors\"\n title={title}\n >\n <Icon className=\"w-2.5 h-2.5\" strokeWidth={1.5} />\n </button>\n );\n}\n\n// ── Namespace Picker ────────────────────────────────────────────────────────\n\nfunction AppPicker({ appIds, selected, onSelect }: {\n appIds: string[];\n selected: string;\n onSelect: (id: string) => void;\n}) {\n const [open, setOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const handler = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', handler);\n return () => document.removeEventListener('mousedown', handler);\n }, [open]);\n\n if (appIds.length <= 1) return null;\n\n return (\n <div className=\"relative mb-3 -mt-2\" ref={ref}>\n <button\n onClick={() => setOpen((v) => !v)}\n className=\"flex items-center gap-1 px-2 py-0.5 text-[10px] rounded bg-accent/10 text-accent hover:bg-accent/20 transition-colors\"\n >\n {selected}\n <svg className={`w-2.5 h-2.5 transition-transform ${open ? 'rotate-180' : ''}`} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M19 9l-7 7-7-7\" />\n </svg>\n </button>\n {open && (\n <div className=\"absolute top-full left-0 mt-1 bg-surface-raised border border-surface-border rounded-md shadow-lg z-30 py-1 min-w-[120px]\">\n {appIds.map((id) => (\n <button\n key={id}\n onClick={() => { onSelect(id); setOpen(false); }}\n className={`w-full text-left px-3 py-1.5 text-[11px] transition-colors ${\n selected === id ? 'text-accent bg-accent/5' : 'text-text-secondary hover:bg-surface-hover'\n }`}\n >\n {id}\n </button>\n ))}\n </div>\n )}\n </div>\n );\n}\n\n// ── Page ─────────────────────────────────────────────────────────────────────\n\nexport function HomePage() {\n const navigate = useNavigate();\n const { user } = useAuth();\n const { isBuilder } = useAccess();\n const persona = usePersona();\n const [searchParams, setSearchParams] = useSearchParams();\n const { data: cpData } = useControlPlaneApps({ enabled: isBuilder });\n const allAppIds = useMemo(() => (cpData?.apps ?? []).map((a: any) => a.appId).sort(), [cpData]);\n const firstAppId = allAppIds[0] ?? '';\n const pipelineNs = searchParams.get('pipelinenamespace') || firstAppId;\n const durableNs = searchParams.get('durablenamespace') || firstAppId;\n const setNs = useCallback((key: string, ns: string) => {\n setSearchParams((prev) => {\n const next = new URLSearchParams(prev);\n next.set(key, ns);\n return next;\n }, { replace: false });\n }, [setSearchParams]);\n useEscalationStatsEvents();\n useWorkflowListEvents();\n useStationMetricsEvents();\n\n // The home page renders one of two layouts (see the return below): the\n // operator's task-queue cards, or the builder home shared by admin, engineer,\n // and superadmin. Gate each data source to the tiers that render it, so no one\n // fires a request they can't access (403 on control-plane apps → empty\n // namespace → 400 on jobs):\n // - All/My escalation firehose → the builder home (everyone except operator)\n // - Pace Board → admin, superadmin only\n // - Procedural/Graph workflows → builders (engineer, superadmin)\n // - Task-queue cards fetch their own scoped metrics inside TaskQueueCards.\n const builderHome = !persona.showTaskQueueCards;\n // Row 2 width adapts to what the tier can see: pace + both workflow columns\n // (superadmin), workflows only (engineer), or pace only, full-width (admin).\n const row2GridClass = persona.canSeePaceBoard && persona.canSeeWorkflows ? 'lg:grid-cols-3'\n : persona.canSeeWorkflows ? 'lg:grid-cols-2' : '';\n const rolesQ = useRoleDetails({ enabled: persona.canSeePaceBoard });\n const stationQ = useStationMetrics('1h', { enabled: persona.canSeePaceBoard });\n const jobsQ = useJobs({ limit: 5, sort_by: 'updated_at', order: 'desc', namespace: durableNs }, { enabled: persona.canSeeWorkflows });\n const durableAppIds = allAppIds;\n const pipelineAppIds = allAppIds;\n const mcpQ = useMcpRuns({ limit: 5, app_id: pipelineNs, sort_by: 'updated_at', order: 'desc' }, { enabled: persona.canSeeWorkflows });\n const allEscQ = useAvailableEscalations({ limit: 5, sort_by: 'created_at', order: 'desc', enabled: builderHome });\n const myEscQ = useEscalations({ assigned_to: user?.userId, status: 'pending', limit: 5, sort_by: 'created_at', order: 'desc', enabled: builderHome });\n\n // Delayed refetch — allows signal-routed escalation resolutions\n // (durable activity) time to commit before refreshing the list\n useEffect(() => {\n const timer = setTimeout(() => {\n myEscQ.refetch();\n allEscQ.refetch();\n }, 2000);\n return () => clearTimeout(timer);\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n // Pace Board mini — the primary sequence (longest line) at the 1h window.\n const paceStations = useMemo((): ChartStation[] => {\n const fragments = buildFragments(rolesQ.data?.roles ?? []);\n const primary = fragments[0]?.stations ?? [];\n const metrics = stationQ.data?.stations ?? [];\n return primary.map(({ role: r }) => ({\n role: r.role,\n title: r.title,\n parent_role: r.parent_role,\n target_per_hour: r.target_per_hour ?? null,\n upstream_roles: r.upstream_roles ?? [],\n metric: metrics.find((m) => m.role === r.role),\n }));\n }, [rolesQ.data, stationQ.data]);\n\n const jobs = jobsQ.data?.jobs ?? [];\n const jobsTotal = jobsQ.data?.total;\n const mcpRuns = (mcpQ.data as any)?.jobs ?? [];\n const mcpTotal = (mcpQ.data as any)?.total as number | undefined;\n const allEscalations = allEscQ.data?.escalations ?? [];\n const allEscTotal = allEscQ.data?.total;\n const myEscalations = myEscQ.data?.escalations ?? [];\n const myEscTotal = myEscQ.data?.total;\n\n // The two workflow execution columns, shared by the builder branches (the\n // engineer layout below and the superadmin Row 2). Defined once so the JSX\n // has a single source of truth.\n const proceduralColumn = (\n <div>\n <SectionHeader icon={Code2} color=\"text-accent\" count={jobsTotal} docsHash=\"#docs:dashboard.md:procedural-executions\" actions={\n <div className=\"flex items-center gap-2\">\n <ListToolbar onRefresh={() => jobsQ.refetch()} isFetching={jobsQ.isFetching} apiPath={`/workflow-states/jobs?namespace=${durableNs}&limit=5`} />\n <NavIcon to=\"/workflows/executions\" icon={ExternalLink} title=\"All procedural executions\" />\n </div>\n }>\n Procedural\n </SectionHeader>\n <AppPicker appIds={durableAppIds} selected={durableNs} onSelect={(ns) => setNs('durablenamespace', ns)} />\n {jobs.length === 0 ? (\n <EmptyPanel icon={Code2} text=\"No recent procedural runs\" />\n ) : (\n <div className=\"space-y-1\">\n {jobs.map((job: any) => (\n <ExecutionRow\n key={job.workflow_id}\n dot={statusDotClass(job.status)}\n pill={<WorkflowPill type={job.entity || job.type || 'workflow'} size=\"xs\" />}\n id={job.workflow_id}\n date={job.updated_at ?? job.created_at}\n onClick={() => navigate(`/workflows/executions/${job.workflow_id}`)}\n />\n ))}\n </div>\n )}\n </div>\n );\n\n const graphColumn = (\n <div>\n <SectionHeader icon={Workflow} color=\"text-accent\" count={mcpTotal} docsHash=\"#docs:dashboard.md:graph-executions\" actions={\n <div className=\"flex items-center gap-2\">\n <ListToolbar onRefresh={() => mcpQ.refetch()} isFetching={mcpQ.isFetching} apiPath={`/pipelines?app_id=${pipelineNs}&limit=5`} />\n <NavIcon to=\"/mcp/executions\" icon={ExternalLink} title=\"All graph executions\" />\n </div>\n }>\n Graph\n </SectionHeader>\n <AppPicker appIds={pipelineAppIds} selected={pipelineNs} onSelect={(ns) => setNs('pipelinenamespace', ns)} />\n {mcpRuns.length === 0 ? (\n <EmptyPanel icon={Workflow} text=\"No recent graph runs\" />\n ) : (\n <div className=\"space-y-1\">\n {mcpRuns.map((run: any) => (\n <ExecutionRow\n key={run.workflow_id}\n dot={statusDotClass(run.status)}\n pill={<WorkflowPill type={run.entity || run.workflow_name || 'pipeline'} variant=\"pipeline\" size=\"xs\" />}\n id={run.workflow_id}\n date={run.updated_at ?? run.created_at}\n onClick={() => navigate(`/mcp/executions/${run.workflow_id}?namespace=${pipelineNs}`)}\n />\n ))}\n </div>\n )}\n </div>\n );\n\n // ── Operator: their own lanes as Task Queue cards, nothing else. Scoped to\n // the roles they belong to; no firehose, no Pace Board, no workflows.\n if (persona.showTaskQueueCards) {\n return (\n <div>\n <h1 className=\"text-3xl font-light text-text-primary mb-10\">Recent Activity</h1>\n <TaskQueueCards maxRows={2} />\n </div>\n );\n }\n\n // ── Builder home (admin, engineer, superadmin): the All/My firehose, plus the\n // Pace Board (admin/superadmin) and the workflow columns (engineer/\n // superadmin). Engineers see everything here except the Pace Board.\n return (\n <div>\n <h1 className=\"text-3xl font-light text-text-primary mb-10\">Recent Activity</h1>\n\n {/* ── Row 1: All Escalations | My Escalations ──────────────────────── */}\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-x-14 min-h-[35vh]\">\n\n {/* Col 1: All Escalations */}\n <div>\n <SectionHeader icon={Inbox} color=\"text-accent\" count={allEscTotal} docsHash=\"#docs:dashboard.md:all-escalations\" actions={\n <div className=\"flex items-center gap-2\">\n <ListToolbar onRefresh={() => allEscQ.refetch()} isFetching={allEscQ.isFetching} apiPath=\"/escalations?status=pending&limit=5&sort_by=created_at&order=desc\" />\n <NavIcon to=\"/escalations/available\" icon={ExternalLink} title=\"All escalations\" />\n </div>\n }>\n All Escalations\n </SectionHeader>\n {allEscalations.length === 0 ? (\n <EmptyPanel icon={Inbox} text=\"No pending escalations\" />\n ) : (\n <div className=\"space-y-1\">\n {allEscalations.map((esc: any) => (\n <button\n key={esc.id}\n onClick={() => navigate(`/escalations/detail/${esc.id}`)}\n className=\"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors\"\n >\n <div className=\"flex items-center gap-2 mb-0.5\">\n <span className=\"text-[9px] text-text-quaternary font-medium shrink-0\">P{esc.priority ?? 2}</span>\n <span className=\"text-[12px] text-text-primary truncate flex-1 max-w-[65%]\">{esc.description || esc.subtype || esc.type}</span>\n <span className=\"text-[10px] text-text-quaternary shrink-0 ml-auto\"><DateValue date={esc.updated_at ?? esc.created_at} /></span>\n </div>\n <div className=\"flex items-center gap-2 pl-5\">\n <WorkflowPill type={esc.type || 'unknown'} size=\"xs\" />\n <span className=\"flex-1\" />\n <RolePill role={esc.role} />\n </div>\n </button>\n ))}\n </div>\n )}\n </div>\n\n {/* Col 2: My Escalations */}\n <div>\n <SectionHeader icon={Inbox} color=\"text-accent\" count={myEscTotal} docsHash=\"#docs:dashboard.md:escalations-overview\" actions={\n <div className=\"flex items-center gap-2\">\n <ListToolbar onRefresh={() => myEscQ.refetch()} isFetching={myEscQ.isFetching} apiPath={`/escalations?assigned_to=${user?.userId ?? ''}&status=pending&limit=5&sort_by=created_at&order=desc`} />\n <NavIcon to=\"/escalations/queue\" icon={ExternalLink} title=\"My escalation queue\" />\n </div>\n }>\n My Escalations\n </SectionHeader>\n {myEscalations.length === 0 ? (\n <EmptyPanel icon={Inbox} text=\"No assigned escalations\" />\n ) : (\n <div className=\"space-y-1\">\n {myEscalations.map((esc: any) => (\n <button\n key={esc.id}\n onClick={() => navigate(`/escalations/detail/${esc.id}`)}\n className=\"w-full text-left hover:bg-surface-hover/50 rounded-md px-1 py-1.5 transition-colors\"\n >\n <div className=\"flex items-center gap-2 mb-0.5\">\n <span className=\"text-[9px] text-text-quaternary font-medium shrink-0\">P{esc.priority ?? 2}</span>\n <span className=\"text-[12px] text-text-primary truncate flex-1 max-w-[65%]\">{esc.description || esc.subtype || esc.type}</span>\n <span className=\"text-[10px] text-text-quaternary shrink-0 ml-auto\"><DateValue date={esc.updated_at ?? esc.created_at} /></span>\n </div>\n <div className=\"flex items-center gap-2 pl-5\">\n <WorkflowPill type={esc.type || 'unknown'} size=\"xs\" />\n <span className=\"flex-1\" />\n <RolePill role={esc.role} />\n </div>\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n\n {/* ── Row 2: Pace Board (admin/superadmin) | Procedural | Graph (builders).\n Engineers get the workflow columns but no Pace Board; admins get the\n Pace Board full-width. */}\n {(persona.canSeePaceBoard || persona.canSeeWorkflows) && (\n <div className={`grid grid-cols-1 ${row2GridClass} gap-x-14 mt-14`}>\n\n {/* Pace Board — the story being told, at a glance */}\n {persona.canSeePaceBoard && (\n <div>\n <SectionHeader icon={LayoutDashboard} color=\"text-accent\" docsHash=\"#docs:dashboard.md:pace-board\" actions={\n <NavIcon to=\"/operations\" icon={ExternalLink} title=\"Open the Pace Board\" />\n }>\n Pace Board\n </SectionHeader>\n {paceStations.length === 0 ? (\n <EmptyPanel icon={LayoutDashboard} text=\"No stations yet — mark roles visible in Operations\" />\n ) : (\n <div className={`${isBuilder ? 'h-64' : 'h-80'} cursor-pointer`} onClick={() => navigate('/operations')}>\n <PaceChart\n stations={paceStations}\n selectedRole={null}\n onSelect={() => navigate('/operations')}\n onUpstreamSelect={() => navigate('/operations')}\n periodHours={1}\n />\n </div>\n )}\n </div>\n )}\n\n {/* Workflow executions — builders (engineer, superadmin) */}\n {persona.canSeeWorkflows && proceduralColumn}\n {persona.canSeeWorkflows && graphColumn}\n </div>\n )}\n </div>\n );\n}\n"],"names":["useMyEscalationCount","user","useAuth","userId","qc","useQueryClient","data","useEscalations","useEventSubscription","NATS_SUBJECT_PREFIX","Stat","n","label","tone","jsxs","jsx","TaskQueueCard","role","title","metric","priorityFacet","periodLabel","navigate","useNavigate","pending","claimed","resolved","jeopardy","e","ExternalLink","jeopardyQueueLink","TriangleAlert","ClaimedCard","count","Hand","PERIODS","TaskQueueCards","maxRows","period","setPeriod","useState","roles","useTaskQueueRoles","claimedCount","metricsQ","useStationMetrics","rolesQ","useRoleDetails","metricByRole","useMemo","_a","m","detailByRole","r","sortedRoles","a","b","ja","jb","_b","laneBudget","shownRoles","overflow","Layers","p","Fragment","STATUS_DOT","statusDotClass","status","SectionHeader","Icon","color","docsHash","children","actions","formatCountCompact","BookOpen","EmptyPanel","text","midEllipsis","maxLen","keep","ExecutionRow","dot","pill","id","date","onClick","DateValue","NavIcon","to","AppPicker","appIds","selected","onSelect","open","setOpen","ref","useRef","useEffect","handler","v","HomePage","isBuilder","useAccess","persona","usePersona","searchParams","setSearchParams","useSearchParams","cpData","useControlPlaneApps","allAppIds","firstAppId","pipelineNs","durableNs","setNs","useCallback","key","ns","prev","next","useEscalationStatsEvents","useWorkflowListEvents","useStationMetricsEvents","builderHome","row2GridClass","stationQ","jobsQ","useJobs","durableAppIds","pipelineAppIds","mcpQ","useMcpRuns","allEscQ","useAvailableEscalations","myEscQ","timer","paceStations","primary","buildFragments","metrics","_c","jobs","jobsTotal","mcpRuns","mcpTotal","_d","allEscalations","_e","allEscTotal","_f","myEscalations","_g","myEscTotal","_h","proceduralColumn","Code2","ListToolbar","job","WorkflowPill","graphColumn","Workflow","run","Inbox","esc","RolePill","LayoutDashboard","PaceChart"],"mappings":"kyBAWO,SAASA,IAA+B,CAC7C,KAAM,CAAE,KAAAC,CAAA,EAASC,GAAA,EACXC,EAASF,GAAA,YAAAA,EAAM,OACfG,EAAKC,GAAA,EAEL,CAAE,KAAAC,CAAA,EAASC,GAAe,CAC9B,YAAaJ,EACb,OAAQ,UACR,MAAO,CAAA,CACR,EAED,OAAAK,GAAqB,GAAGC,EAAmB,uBAAwB,IAAM,CACnEN,GACFC,EAAG,kBAAkB,CAAE,SAAU,CAAC,aAAa,EAAG,CAEtD,CAAC,GAEME,GAAA,YAAAA,EAAM,QAAS,CACxB,CCxBA,SAASI,EAAK,CAAE,EAAAC,EAAG,MAAAC,EAAO,KAAAC,GAAsD,CAC9E,OACEC,EAAAA,KAAC,MAAA,CAAI,UAAU,UACb,SAAA,CAAAC,EAAAA,IAAC,MAAA,CAAI,UAAW,iDAAiDF,IAAS,QAAU,qBAAuB,mBAAmB,GAC3H,SAAAF,CAAA,CACH,EACAI,EAAAA,IAAC,MAAA,CAAI,UAAU,yEAA0E,SAAAH,CAAA,CAAM,CAAA,EACjG,CAEJ,CAQO,SAASI,GAAc,CAC5B,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,CACF,EAMG,CACD,MAAMC,EAAWC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AAA,CACf,CACF,CAAA,EAEJ,EAIDmF,EAAQ,iBAAmBmD,GAC3BnD,EAAQ,iBAAmBwD,EAAA,CAAA,CAC9B,CAAA,EAEJ,CAEJ"}
@@ -0,0 +1,2 @@
1
+ import{a as C,j as s}from"./vendor-query-B2UbickB.js";import{aa as u,ab as j}from"./index-DIgiIoou.js";import{a1 as d,aK as N,aL as f,aM as h}from"./vendor-icons-ihWGa7_d.js";function w({onRefresh:m,isFetching:r=!1,apiPath:e}){const[c,l]=C.useState(null),i=(t,a)=>{navigator.clipboard.writeText(t).then(()=>{l(a),setTimeout(()=>l(null),2e3)})},x=()=>{if(!e)return;const t=`${window.location.origin}${u}/api${e}`;i(t,"url")},p=()=>{if(!e)return;const t=`${window.location.origin}${u}/api${e}`,a=j(),$=a?`curl -H "Authorization: Bearer ${a}" "${t}"`:`curl "${t}"`;i($,"curl")},n="p-1 text-text-quaternary hover:text-accent transition-colors rounded",o="w-2.5 h-2.5";return s.jsxs("div",{className:"flex items-center gap-0.5",children:[e&&s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:x,className:n,title:"Copy API URL",children:c==="url"?s.jsx(d,{className:`${o} text-status-success`}):s.jsx(N,{className:o})}),s.jsx("button",{onClick:p,className:n,title:"Copy curl (includes auth token)",children:c==="curl"?s.jsx(d,{className:`${o} text-status-success`}):s.jsx(f,{className:o})})]}),s.jsx("button",{onClick:m,disabled:r,className:`${n} disabled:opacity-50`,title:"Refresh",children:s.jsx(h,{className:`${o} ${r?"animate-spin":""}`})})]})}export{w as L};
2
+ //# sourceMappingURL=ListToolbar-KC6LGtKP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListToolbar-Dmd1UiM-.js","sources":["../../src/components/common/data/ListToolbar.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { RefreshCw, Link2, Terminal, Check } from 'lucide-react';\nimport { getToken } from '../../../api/client';\nimport { LT_BASE } from '../../../lib/base-path';\n\ninterface ListToolbarProps {\n onRefresh: () => void;\n isFetching?: boolean;\n /** API path (e.g. \"/workflow-states/jobs?limit=50\") for URL/curl copy. */\n apiPath?: string;\n}\n\ntype CopiedState = 'url' | 'curl' | null;\n\n/**\n * Toolbar for list pages: refresh, copy API URL, copy curl command.\n * Designed to sit in FilterBar `actions` slot.\n */\nexport function ListToolbar({ onRefresh, isFetching = false, apiPath }: ListToolbarProps) {\n const [copied, setCopied] = useState<CopiedState>(null);\n\n const copyToClipboard = (text: string, type: CopiedState) => {\n navigator.clipboard.writeText(text).then(() => {\n setCopied(type);\n setTimeout(() => setCopied(null), 2000);\n });\n };\n\n const handleCopyUrl = () => {\n if (!apiPath) return;\n const url = `${window.location.origin}${LT_BASE}/api${apiPath}`;\n copyToClipboard(url, 'url');\n };\n\n const handleCopyCurl = () => {\n if (!apiPath) return;\n const url = `${window.location.origin}${LT_BASE}/api${apiPath}`;\n const token = getToken();\n const cmd = token\n ? `curl -H \"Authorization: Bearer ${token}\" \"${url}\"`\n : `curl \"${url}\"`;\n copyToClipboard(cmd, 'curl');\n };\n\n const BTN = 'p-1 text-text-quaternary hover:text-accent transition-colors rounded';\n const ICON = 'w-2.5 h-2.5';\n\n return (\n <div className=\"flex items-center gap-0.5\">\n {apiPath && (\n <>\n <button onClick={handleCopyUrl} className={BTN} title=\"Copy API URL\">\n {copied === 'url' ? <Check className={`${ICON} text-status-success`} /> : <Link2 className={ICON} />}\n </button>\n <button onClick={handleCopyCurl} className={BTN} title=\"Copy curl (includes auth token)\">\n {copied === 'curl' ? <Check className={`${ICON} text-status-success`} /> : <Terminal className={ICON} />}\n </button>\n </>\n )}\n <button onClick={onRefresh} disabled={isFetching} className={`${BTN} disabled:opacity-50`} title=\"Refresh\">\n <RefreshCw className={`${ICON} ${isFetching ? 'animate-spin' : ''}`} />\n </button>\n </div>\n );\n}\n"],"names":["ListToolbar","onRefresh","isFetching","apiPath","copied","setCopied","useState","copyToClipboard","text","type","handleCopyUrl","url","LT_BASE","handleCopyCurl","token","getToken","cmd","BTN","ICON","js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AAA,CACxG,CAAA,EACF,EAEFG,EAAAA,IAAC,UAAO,QAASpB,EAAW,SAAUC,EAAY,UAAW,GAAGe,CAAG,uBAAwB,MAAM,UAC/F,SAAAI,MAACI,EAAA,CAAU,UAAW,GAAGP,CAAI,IAAIhB,EAAa,eAAiB,EAAE,EAAA,CAAI,CAAA,CACvE,CAAA,EACF,CAEJ"}
1
+ {"version":3,"file":"ListToolbar-KC6LGtKP.js","sources":["../../src/components/common/data/ListToolbar.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { RefreshCw, Link2, Terminal, Check } from 'lucide-react';\nimport { getToken } from '../../../api/client';\nimport { LT_BASE } from '../../../lib/base-path';\n\ninterface ListToolbarProps {\n onRefresh: () => void;\n isFetching?: boolean;\n /** API path (e.g. \"/workflow-states/jobs?limit=50\") for URL/curl copy. */\n apiPath?: string;\n}\n\ntype CopiedState = 'url' | 'curl' | null;\n\n/**\n * Toolbar for list pages: refresh, copy API URL, copy curl command.\n * Designed to sit in FilterBar `actions` slot.\n */\nexport function ListToolbar({ onRefresh, isFetching = false, apiPath }: ListToolbarProps) {\n const [copied, setCopied] = useState<CopiedState>(null);\n\n const copyToClipboard = (text: string, type: CopiedState) => {\n navigator.clipboard.writeText(text).then(() => {\n setCopied(type);\n setTimeout(() => setCopied(null), 2000);\n });\n };\n\n const handleCopyUrl = () => {\n if (!apiPath) return;\n const url = `${window.location.origin}${LT_BASE}/api${apiPath}`;\n copyToClipboard(url, 'url');\n };\n\n const handleCopyCurl = () => {\n if (!apiPath) return;\n const url = `${window.location.origin}${LT_BASE}/api${apiPath}`;\n const token = getToken();\n const cmd = token\n ? `curl -H \"Authorization: Bearer ${token}\" \"${url}\"`\n : `curl \"${url}\"`;\n copyToClipboard(cmd, 'curl');\n };\n\n const BTN = 'p-1 text-text-quaternary hover:text-accent transition-colors rounded';\n const ICON = 'w-2.5 h-2.5';\n\n return (\n <div className=\"flex items-center gap-0.5\">\n {apiPath && (\n <>\n <button onClick={handleCopyUrl} className={BTN} title=\"Copy API URL\">\n {copied === 'url' ? <Check className={`${ICON} text-status-success`} /> : <Link2 className={ICON} />}\n </button>\n <button onClick={handleCopyCurl} className={BTN} title=\"Copy curl (includes auth token)\">\n {copied === 'curl' ? <Check className={`${ICON} text-status-success`} /> : <Terminal className={ICON} />}\n </button>\n </>\n )}\n <button onClick={onRefresh} disabled={isFetching} className={`${BTN} disabled:opacity-50`} title=\"Refresh\">\n <RefreshCw className={`${ICON} ${isFetching ? 'animate-spin' : ''}`} />\n </button>\n </div>\n );\n}\n"],"names":["ListToolbar","onRefresh","isFetching","apiPath","copied","setCopied","useState","copyToClipboard","text","type","handleCopyUrl","url","LT_BASE","handleCopyCurl","token","getToken","cmd","BTN","ICON","jsxs","Fragment","jsx","Check","Link2","Terminal","RefreshCw"],"mappings":"+KAkBO,SAASA,EAAY,CAAE,UAAAC,EAAW,WAAAC,EAAa,GAAO,QAAAC,GAA6B,CACxF,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAsB,IAAI,EAEhDC,EAAkB,CAACC,EAAcC,IAAsB,CAC3D,UAAU,UAAU,UAAUD,CAAI,EAAE,KAAK,IAAM,CAC7CH,EAAUI,CAAI,EACd,WAAW,IAAMJ,EAAU,IAAI,EAAG,GAAI,CACxC,CAAC,CACH,EAEMK,EAAgB,IAAM,CAC1B,GAAI,CAACP,EAAS,OACd,MAAMQ,EAAM,GAAG,OAAO,SAAS,MAAM,GAAGC,CAAO,OAAOT,CAAO,GAC7DI,EAAgBI,EAAK,KAAK,CAC5B,EAEME,EAAiB,IAAM,CAC3B,GAAI,CAACV,EAAS,OACd,MAAMQ,EAAM,GAAG,OAAO,SAAS,MAAM,GAAGC,CAAO,OAAOT,CAAO,GACvDW,EAAQC,EAAA,EACRC,EAAMF,EACR,kCAAkCA,CAAK,MAAMH,CAAG,IAChD,SAASA,CAAG,IAChBJ,EAAgBS,EAAK,MAAM,CAC7B,EAEMC,EAAM,uEACNC,EAAO,cAEb,OACEC,EAAAA,KAAC,MAAA,CAAI,UAAU,4BACZ,SAAA,CAAAhB,GACCgB,EAAAA,KAAAC,WAAA,CACE,SAAA,CAAAC,EAAAA,IAAC,SAAA,CAAO,QAASX,EAAe,UAAWO,EAAK,MAAM,eACnD,aAAW,MAAQI,EAAAA,IAACC,GAAM,UAAW,GAAGJ,CAAI,sBAAA,CAAwB,QAAMK,EAAA,CAAM,UAAWL,EAAM,CAAA,CACpG,EACAG,EAAAA,IAAC,UAAO,QAASR,EAAgB,UAAWI,EAAK,MAAM,kCACpD,SAAAb,IAAW,aAAUkB,EAAA,CAAM,UAAW,GAAGJ,CAAI,sBAAA,CAAwB,EAAKG,EAAAA,IAACG,EAAA,CAAS,UAAWN,CAAA,CAAM,CAAA,CACxG,CAAA,EACF,EAEFG,EAAAA,IAAC,UAAO,QAASpB,EAAW,SAAUC,EAAY,UAAW,GAAGe,CAAG,uBAAwB,MAAM,UAC/F,SAAAI,MAACI,EAAA,CAAU,UAAW,GAAGP,CAAI,IAAIhB,EAAa,eAAiB,EAAE,EAAA,CAAI,CAAA,CACvE,CAAA,EACF,CAEJ"}
@@ -1,2 +1,2 @@
1
- import{a as i,j as e}from"./vendor-query-B2UbickB.js";import{u as A}from"./mcp-C1-iXkg7.js";import{u as F}from"./pipelines-BvG5D6bV.js";import{u as I}from"./yaml-workflows-Dr-ZcE_0.js";import{u as W}from"./controlplane-CxKOrcFO.js";import{P as z}from"./PageHeader-BIY1YvKR.js";import{S as b}from"./StatCard-DrdlUeQz.js";import{w as E,W as O}from"./vendor-icons-Qk9qLjF_.js";import{c as U}from"./vendor-react-CXumBFUA.js";import"./index-YPLTjeli.js";const T=[{label:"1h",ms:36e5},{label:"24h",ms:864e5},{label:"7d",ms:6048e5},{label:"30d",ms:2592e6}];function q(r){return r<1e3?`${Math.round(r)}ms`:r<6e4?`${(r/1e3).toFixed(1)}s`:r<36e5?`${(r/6e4).toFixed(1)}m`:`${(r/36e5).toFixed(1)}h`}function j({value:r,colorClass:c,onClick:v}){return r===0?e.jsx("span",{className:"text-text-tertiary",children:"0"}):e.jsx("button",{onClick:v,className:`${c} hover:underline tabular-nums font-medium`,children:r})}function ee(){const r=U(),[c,v]=i.useState("24h"),[D,P]=i.useState(""),{data:d}=W(),k=i.useMemo(()=>((d==null?void 0:d.apps)??[]).map(t=>t.appId).sort(),[d==null?void 0:d.apps]),u=D||k[0]||"",{data:m}=F({limit:500,app_id:u}),{data:N,isLoading:L}=A(),{data:y,isLoading:_}=I({limit:200}),w=k,p=(N==null?void 0:N.servers)??[],h=(y==null?void 0:y.workflows)??[],M=i.useMemo(()=>p.reduce((t,l)=>t+(Array.isArray(l.tool_manifest)?l.tool_manifest.length:0),0),[p]),S=i.useMemo(()=>new Set(h.map(l=>l.app_id)).size,[h]),$=i.useMemo(()=>{const t=T.find(l=>l.label===c);return Date.now()-t.ms},[c]),o=i.useMemo(()=>((m==null?void 0:m.jobs)??[]).filter(t=>new Date(t.created_at).getTime()>=$),[m==null?void 0:m.jobs,$]),C=i.useMemo(()=>{const t=new Map;for(const s of o){const a=t.get(s.entity)??{total:0,running:0,completed:0,failed:0,durations:[]};if(a.total++,s.status==="running"&&a.running++,s.status==="completed"){a.completed++;const g=new Date(s.updated_at).getTime()-new Date(s.created_at).getTime();g>0&&a.durations.push(g)}s.status==="failed"&&a.failed++,t.set(s.entity,a)}const l=[];for(const[s,a]of t)l.push({pipeline:s,...a,avgDuration:a.durations.length>0?a.durations.reduce((g,R)=>g+R,0)/a.durations.length:null});return l.sort((s,a)=>a.total-s.total)},[o]),f=i.useMemo(()=>({total:o.length,running:o.filter(t=>t.status==="running").length,completed:o.filter(t=>t.status==="completed").length,failed:o.filter(t=>t.status==="failed").length}),[o]),n=(t,l)=>{const s=new URLSearchParams;u&&s.set("namespace",u),t&&s.set("entity",t),l&&s.set("status",l);const a=s.toString();r(`/mcp/executions${a?`?${a}`:""}`)},x="pb-2 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary";return e.jsxs("div",{children:[e.jsx(z,{title:"Discovered"}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx("div",{className:"flex items-center gap-1",children:T.map(t=>e.jsx("button",{onClick:()=>v(t.label),className:`px-3 py-1 text-xs rounded-full transition-colors ${c===t.label?"bg-accent text-text-inverse":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:t.label},t.label))}),w.length>1&&e.jsx("select",{value:u,onChange:t=>P(t.target.value),className:"select text-xs py-1 px-2",children:w.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[e.jsx(b,{label:"Total Runs",value:f.total,onClick:()=>n()}),e.jsx(b,{label:"Running",value:f.running,colorClass:"text-status-active",onClick:()=>n(void 0,"running")}),e.jsx(b,{label:"Completed",value:f.completed,colorClass:"text-status-success",onClick:()=>n(void 0,"completed")}),e.jsx(b,{label:"Failed",value:f.failed,colorClass:"text-status-error",onClick:()=>n(void 0,"failed")})]}),C.length>0&&e.jsxs("table",{className:"w-full text-left mb-10",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-surface-border",children:[e.jsx("th",{className:x,children:"Tool"}),e.jsx("th",{className:`${x} text-right w-20`,children:"Total"}),e.jsx("th",{className:`${x} text-right w-20`,children:"Running"}),e.jsx("th",{className:`${x} text-right w-24`,children:"Completed"}),e.jsx("th",{className:`${x} text-right w-20`,children:"Failed"}),e.jsx("th",{className:`${x} text-right w-28`,children:"Avg Duration"})]})}),e.jsx("tbody",{children:C.map(t=>e.jsxs("tr",{className:"border-b border-surface-border last:border-b-0",children:[e.jsx("td",{className:"py-3 text-sm font-mono text-text-primary",children:e.jsx("button",{onClick:()=>n(t.pipeline),className:"hover:text-accent hover:underline",children:t.pipeline})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(j,{value:t.total,colorClass:"text-text-secondary",onClick:()=>n(t.pipeline)})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(j,{value:t.running,colorClass:"text-status-active",onClick:()=>n(t.pipeline,"running")})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(j,{value:t.completed,colorClass:"text-status-success",onClick:()=>n(t.pipeline,"completed")})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(j,{value:t.failed,colorClass:"text-status-error",onClick:()=>n(t.pipeline,"failed")})}),e.jsx("td",{className:"py-3 text-sm font-mono text-text-secondary text-right",children:t.avgDuration!==null?q(t.avgDuration):"—"})]},t.pipeline))})]}),C.length===0&&e.jsx("div",{className:"py-12 text-center mb-8",children:e.jsxs("p",{className:"text-sm text-text-tertiary",children:["No MCP tool activity in the last ",c]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("button",{onClick:()=>r("/mcp/servers"),className:"bg-surface-raised border border-surface-border rounded-md p-5 text-left hover:border-accent/40 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(E,{size:16,className:"text-accent shrink-0"}),e.jsx("span",{className:"text-sm font-medium text-text-primary",children:"Tool Servers"})]}),e.jsxs("p",{className:"text-2xl font-light tabular-nums text-text-primary mb-1",children:[L?"—":p.length,e.jsxs("span",{className:"text-sm text-text-tertiary font-normal ml-2",children:["server",p.length!==1?"s":""," · ",M," tool",M!==1?"s":""]})]}),e.jsx("p",{className:"text-[11px] text-text-tertiary leading-relaxed mt-2",children:"Built-in and external MCP servers. Each server exposes tools that workflows and agents can call."})]}),e.jsxs("button",{onClick:()=>r("/mcp/workflows"),className:"bg-surface-raised border border-surface-border rounded-md p-5 text-left hover:border-accent/40 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(O,{size:16,className:"text-purple-400 shrink-0"}),e.jsx("span",{className:"text-sm font-medium text-text-primary",children:"Pipeline Registry"})]}),e.jsxs("p",{className:"text-2xl font-light tabular-nums text-text-primary mb-1",children:[_?"—":h.length,e.jsxs("span",{className:"text-sm text-text-tertiary font-normal ml-2",children:["workflow",h.length!==1?"s":""," · ",S," server",S!==1?"s":""]})]}),e.jsx("p",{className:"text-[11px] text-text-tertiary leading-relaxed mt-2",children:"Compiled from discovery runs. Deterministic tool-to-tool pipelines — no LLM, no token costs."})]})]})]})}export{ee as McpOverview};
2
- //# sourceMappingURL=McpOverview-Cul2LFEw.js.map
1
+ import{a as i,j as e}from"./vendor-query-B2UbickB.js";import{u as A}from"./mcp-DYMFBOFz.js";import{u as F}from"./pipelines-DBXX6TEi.js";import{u as I}from"./yaml-workflows-DWNMP1PT.js";import{u as W}from"./controlplane-B4rT6tIw.js";import{P as z}from"./PageHeader-Bxa1XFz0.js";import{S as b}from"./StatCard-DrdlUeQz.js";import{y as E,W as O}from"./vendor-icons-ihWGa7_d.js";import{c as U}from"./vendor-react-CXumBFUA.js";import"./index-DIgiIoou.js";const T=[{label:"1h",ms:36e5},{label:"24h",ms:864e5},{label:"7d",ms:6048e5},{label:"30d",ms:2592e6}];function q(r){return r<1e3?`${Math.round(r)}ms`:r<6e4?`${(r/1e3).toFixed(1)}s`:r<36e5?`${(r/6e4).toFixed(1)}m`:`${(r/36e5).toFixed(1)}h`}function j({value:r,colorClass:c,onClick:v}){return r===0?e.jsx("span",{className:"text-text-tertiary",children:"0"}):e.jsx("button",{onClick:v,className:`${c} hover:underline tabular-nums font-medium`,children:r})}function ee(){const r=U(),[c,v]=i.useState("24h"),[D,P]=i.useState(""),{data:d}=W(),k=i.useMemo(()=>((d==null?void 0:d.apps)??[]).map(t=>t.appId).sort(),[d==null?void 0:d.apps]),u=D||k[0]||"",{data:m}=F({limit:500,app_id:u}),{data:N,isLoading:L}=A(),{data:y,isLoading:_}=I({limit:200}),w=k,p=(N==null?void 0:N.servers)??[],h=(y==null?void 0:y.workflows)??[],M=i.useMemo(()=>p.reduce((t,l)=>t+(Array.isArray(l.tool_manifest)?l.tool_manifest.length:0),0),[p]),S=i.useMemo(()=>new Set(h.map(l=>l.app_id)).size,[h]),$=i.useMemo(()=>{const t=T.find(l=>l.label===c);return Date.now()-t.ms},[c]),o=i.useMemo(()=>((m==null?void 0:m.jobs)??[]).filter(t=>new Date(t.created_at).getTime()>=$),[m==null?void 0:m.jobs,$]),C=i.useMemo(()=>{const t=new Map;for(const s of o){const a=t.get(s.entity)??{total:0,running:0,completed:0,failed:0,durations:[]};if(a.total++,s.status==="running"&&a.running++,s.status==="completed"){a.completed++;const g=new Date(s.updated_at).getTime()-new Date(s.created_at).getTime();g>0&&a.durations.push(g)}s.status==="failed"&&a.failed++,t.set(s.entity,a)}const l=[];for(const[s,a]of t)l.push({pipeline:s,...a,avgDuration:a.durations.length>0?a.durations.reduce((g,R)=>g+R,0)/a.durations.length:null});return l.sort((s,a)=>a.total-s.total)},[o]),f=i.useMemo(()=>({total:o.length,running:o.filter(t=>t.status==="running").length,completed:o.filter(t=>t.status==="completed").length,failed:o.filter(t=>t.status==="failed").length}),[o]),n=(t,l)=>{const s=new URLSearchParams;u&&s.set("namespace",u),t&&s.set("entity",t),l&&s.set("status",l);const a=s.toString();r(`/mcp/executions${a?`?${a}`:""}`)},x="pb-2 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary";return e.jsxs("div",{children:[e.jsx(z,{title:"Discovered"}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx("div",{className:"flex items-center gap-1",children:T.map(t=>e.jsx("button",{onClick:()=>v(t.label),className:`px-3 py-1 text-xs rounded-full transition-colors ${c===t.label?"bg-accent text-text-inverse":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:t.label},t.label))}),w.length>1&&e.jsx("select",{value:u,onChange:t=>P(t.target.value),className:"select text-xs py-1 px-2",children:w.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[e.jsx(b,{label:"Total Runs",value:f.total,onClick:()=>n()}),e.jsx(b,{label:"Running",value:f.running,colorClass:"text-status-active",onClick:()=>n(void 0,"running")}),e.jsx(b,{label:"Completed",value:f.completed,colorClass:"text-status-success",onClick:()=>n(void 0,"completed")}),e.jsx(b,{label:"Failed",value:f.failed,colorClass:"text-status-error",onClick:()=>n(void 0,"failed")})]}),C.length>0&&e.jsxs("table",{className:"w-full text-left mb-10",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-surface-border",children:[e.jsx("th",{className:x,children:"Tool"}),e.jsx("th",{className:`${x} text-right w-20`,children:"Total"}),e.jsx("th",{className:`${x} text-right w-20`,children:"Running"}),e.jsx("th",{className:`${x} text-right w-24`,children:"Completed"}),e.jsx("th",{className:`${x} text-right w-20`,children:"Failed"}),e.jsx("th",{className:`${x} text-right w-28`,children:"Avg Duration"})]})}),e.jsx("tbody",{children:C.map(t=>e.jsxs("tr",{className:"border-b border-surface-border last:border-b-0",children:[e.jsx("td",{className:"py-3 text-sm font-mono text-text-primary",children:e.jsx("button",{onClick:()=>n(t.pipeline),className:"hover:text-accent hover:underline",children:t.pipeline})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(j,{value:t.total,colorClass:"text-text-secondary",onClick:()=>n(t.pipeline)})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(j,{value:t.running,colorClass:"text-status-active",onClick:()=>n(t.pipeline,"running")})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(j,{value:t.completed,colorClass:"text-status-success",onClick:()=>n(t.pipeline,"completed")})}),e.jsx("td",{className:"py-3 text-sm text-right",children:e.jsx(j,{value:t.failed,colorClass:"text-status-error",onClick:()=>n(t.pipeline,"failed")})}),e.jsx("td",{className:"py-3 text-sm font-mono text-text-secondary text-right",children:t.avgDuration!==null?q(t.avgDuration):"—"})]},t.pipeline))})]}),C.length===0&&e.jsx("div",{className:"py-12 text-center mb-8",children:e.jsxs("p",{className:"text-sm text-text-tertiary",children:["No MCP tool activity in the last ",c]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("button",{onClick:()=>r("/mcp/servers"),className:"bg-surface-raised border border-surface-border rounded-md p-5 text-left hover:border-accent/40 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(E,{size:16,className:"text-accent shrink-0"}),e.jsx("span",{className:"text-sm font-medium text-text-primary",children:"Tool Servers"})]}),e.jsxs("p",{className:"text-2xl font-light tabular-nums text-text-primary mb-1",children:[L?"—":p.length,e.jsxs("span",{className:"text-sm text-text-tertiary font-normal ml-2",children:["server",p.length!==1?"s":""," · ",M," tool",M!==1?"s":""]})]}),e.jsx("p",{className:"text-[11px] text-text-tertiary leading-relaxed mt-2",children:"Built-in and external MCP servers. Each server exposes tools that workflows and agents can call."})]}),e.jsxs("button",{onClick:()=>r("/mcp/workflows"),className:"bg-surface-raised border border-surface-border rounded-md p-5 text-left hover:border-accent/40 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx(O,{size:16,className:"text-purple-400 shrink-0"}),e.jsx("span",{className:"text-sm font-medium text-text-primary",children:"Pipeline Registry"})]}),e.jsxs("p",{className:"text-2xl font-light tabular-nums text-text-primary mb-1",children:[_?"—":h.length,e.jsxs("span",{className:"text-sm text-text-tertiary font-normal ml-2",children:["workflow",h.length!==1?"s":""," · ",S," server",S!==1?"s":""]})]}),e.jsx("p",{className:"text-[11px] text-text-tertiary leading-relaxed mt-2",children:"Compiled from discovery runs. Deterministic tool-to-tool pipelines — no LLM, no token costs."})]})]})]})}export{ee as McpOverview};
2
+ //# sourceMappingURL=McpOverview-BDZC9Hvl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"McpOverview-Cul2LFEw.js","sources":["../../src/pages/mcp/McpOverview.tsx"],"sourcesContent":["import { useState, useMemo } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { Server, Workflow } from 'lucide-react';\nimport { useMcpServers } from '../../api/mcp';\nimport { useMcpRuns } from '../../api/pipelines';\nimport { useYamlWorkflows } from '../../api/yaml-workflows';\nimport { useControlPlaneApps } from '../../api/controlplane';\nimport { PageHeader } from '../../components/common/layout/PageHeader';\nimport { StatCard } from '../../components/common/data/StatCard';\nimport type { McpToolManifest } from '../../api/types';\n\n// ── Duration filter ──────────────────────────────────────────────────────────\n\nconst DURATIONS = [\n { label: '1h', ms: 3_600_000 },\n { label: '24h', ms: 86_400_000 },\n { label: '7d', ms: 604_800_000 },\n { label: '30d', ms: 2_592_000_000 },\n] as const;\n\ntype DurationLabel = (typeof DURATIONS)[number]['label'];\n\n// ── Helpers ──────────────────────────────────────────────────────────────────\n\nfunction formatDuration(ms: number): string {\n if (ms < 1000) return `${Math.round(ms)}ms`;\n if (ms < 60_000) return `${(ms / 1000).toFixed(1)}s`;\n if (ms < 3_600_000) return `${(ms / 60_000).toFixed(1)}m`;\n return `${(ms / 3_600_000).toFixed(1)}h`;\n}\n\ninterface PipelineStats {\n pipeline: string;\n total: number;\n running: number;\n completed: number;\n failed: number;\n avgDuration: number | null;\n}\n\n// ── Reusable components ──────────────────────────────────────────────────────\n\nfunction StatCell({\n value,\n colorClass,\n onClick,\n}: {\n value: number;\n colorClass: string;\n onClick: () => void;\n}) {\n if (value === 0) {\n return <span className=\"text-text-tertiary\">0</span>;\n }\n return (\n <button\n onClick={onClick}\n className={`${colorClass} hover:underline tabular-nums font-medium`}\n >\n {value}\n </button>\n );\n}\n\n// ── Page ─────────────────────────────────────────────────────────────────────\n\nexport function McpOverview() {\n const navigate = useNavigate();\n const [duration, setDuration] = useState<DurationLabel>('24h');\n const [namespace, setNamespace] = useState('');\n\n const { data: appsData } = useControlPlaneApps();\n\n // Auto-select the first namespace when available\n const nsNames = useMemo(() => (appsData?.apps ?? []).map((a: any) => a.appId).sort(), [appsData?.apps]);\n const effectiveNamespace = namespace || nsNames[0] || '';\n\n const { data: allRuns } = useMcpRuns({ limit: 500, app_id: effectiveNamespace });\n const { data: serverData, isLoading: serversLoading } = useMcpServers();\n const { data: yamlData, isLoading: yamlLoading } = useYamlWorkflows({ limit: 200 });\n\n const namespaces = nsNames;\n\n // ── Server counts ────────────────────────────────────────────\n const servers = serverData?.servers ?? [];\n const yamlWorkflows = yamlData?.workflows ?? [];\n\n const serverToolCount = useMemo(\n () => servers.reduce((sum, s) => sum + (Array.isArray(s.tool_manifest) ? (s.tool_manifest as McpToolManifest[]).length : 0), 0),\n [servers],\n );\n\n const workflowServerCount = useMemo(() => {\n const appIds = new Set(yamlWorkflows.map((wf) => wf.app_id));\n return appIds.size;\n }, [yamlWorkflows]);\n\n // ── Run stats ──────────────────────────────────────────────────\n const cutoff = useMemo(() => {\n const d = DURATIONS.find((d) => d.label === duration)!;\n return Date.now() - d.ms;\n }, [duration]);\n\n const runs = useMemo(\n () => (allRuns?.jobs ?? []).filter((j) => new Date(j.created_at).getTime() >= cutoff),\n [allRuns?.jobs, cutoff],\n );\n\n const byPipeline = useMemo(() => {\n const map = new Map<string, { total: number; running: number; completed: number; failed: number; durations: number[] }>();\n for (const j of runs) {\n const entry = map.get(j.entity) ?? { total: 0, running: 0, completed: 0, failed: 0, durations: [] };\n entry.total++;\n if (j.status === 'running') entry.running++;\n if (j.status === 'completed') {\n entry.completed++;\n const dur = new Date(j.updated_at).getTime() - new Date(j.created_at).getTime();\n if (dur > 0) entry.durations.push(dur);\n }\n if (j.status === 'failed') entry.failed++;\n map.set(j.entity, entry);\n }\n\n const result: PipelineStats[] = [];\n for (const [pipeline, stats] of map) {\n result.push({\n pipeline,\n ...stats,\n avgDuration: stats.durations.length > 0\n ? stats.durations.reduce((a, b) => a + b, 0) / stats.durations.length\n : null,\n });\n }\n return result.sort((a, b) => b.total - a.total);\n }, [runs]);\n\n const totals = useMemo(() => ({\n total: runs.length,\n running: runs.filter((j) => j.status === 'running').length,\n completed: runs.filter((j) => j.status === 'completed').length,\n failed: runs.filter((j) => j.status === 'failed').length,\n }), [runs]);\n\n const goToRuns = (entity?: string, status?: string) => {\n const params = new URLSearchParams();\n if (effectiveNamespace) params.set('namespace', effectiveNamespace);\n if (entity) params.set('entity', entity);\n if (status) params.set('status', status);\n const qs = params.toString();\n navigate(`/mcp/executions${qs ? `?${qs}` : ''}`);\n };\n\n const thCls = 'pb-2 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary';\n\n return (\n <div>\n <PageHeader title=\"Discovered\" />\n\n {/* ── Duration tabs + namespace ────────────────────────── */}\n <div className=\"flex items-center gap-4 mb-6\">\n <div className=\"flex items-center gap-1\">\n {DURATIONS.map((d) => (\n <button\n key={d.label}\n onClick={() => setDuration(d.label)}\n className={`px-3 py-1 text-xs rounded-full transition-colors ${\n duration === d.label\n ? 'bg-accent text-text-inverse'\n : 'text-text-tertiary hover:text-text-primary hover:bg-surface-hover'\n }`}\n >\n {d.label}\n </button>\n ))}\n </div>\n {namespaces.length > 1 && (\n <select\n value={effectiveNamespace}\n onChange={(e) => setNamespace(e.target.value)}\n className=\"select text-xs py-1 px-2\"\n >\n {namespaces.map((ns) => (\n <option key={ns} value={ns}>{ns}</option>\n ))}\n </select>\n )}\n </div>\n\n {/* ── Summary cards ────────────────────────────────────── */}\n <div className=\"grid grid-cols-4 gap-4 mb-8\">\n <StatCard label=\"Total Runs\" value={totals.total} onClick={() => goToRuns()} />\n <StatCard label=\"Running\" value={totals.running} colorClass=\"text-status-active\" onClick={() => goToRuns(undefined, 'running')} />\n <StatCard label=\"Completed\" value={totals.completed} colorClass=\"text-status-success\" onClick={() => goToRuns(undefined, 'completed')} />\n <StatCard label=\"Failed\" value={totals.failed} colorClass=\"text-status-error\" onClick={() => goToRuns(undefined, 'failed')} />\n </div>\n\n {/* ── By-pipeline table ────────────────────────────────── */}\n {byPipeline.length > 0 && (\n <table className=\"w-full text-left mb-10\">\n <thead>\n <tr className=\"border-b border-surface-border\">\n <th className={thCls}>Tool</th>\n <th className={`${thCls} text-right w-20`}>Total</th>\n <th className={`${thCls} text-right w-20`}>Running</th>\n <th className={`${thCls} text-right w-24`}>Completed</th>\n <th className={`${thCls} text-right w-20`}>Failed</th>\n <th className={`${thCls} text-right w-28`}>Avg Duration</th>\n </tr>\n </thead>\n <tbody>\n {byPipeline.map((row) => (\n <tr key={row.pipeline} className=\"border-b border-surface-border last:border-b-0\">\n <td className=\"py-3 text-sm font-mono text-text-primary\">\n <button\n onClick={() => goToRuns(row.pipeline)}\n className=\"hover:text-accent hover:underline\"\n >\n {row.pipeline}\n </button>\n </td>\n <td className=\"py-3 text-sm text-right\">\n <StatCell value={row.total} colorClass=\"text-text-secondary\" onClick={() => goToRuns(row.pipeline)} />\n </td>\n <td className=\"py-3 text-sm text-right\">\n <StatCell value={row.running} colorClass=\"text-status-active\" onClick={() => goToRuns(row.pipeline, 'running')} />\n </td>\n <td className=\"py-3 text-sm text-right\">\n <StatCell value={row.completed} colorClass=\"text-status-success\" onClick={() => goToRuns(row.pipeline, 'completed')} />\n </td>\n <td className=\"py-3 text-sm text-right\">\n <StatCell value={row.failed} colorClass=\"text-status-error\" onClick={() => goToRuns(row.pipeline, 'failed')} />\n </td>\n <td className=\"py-3 text-sm font-mono text-text-secondary text-right\">\n {row.avgDuration !== null ? formatDuration(row.avgDuration) : '—'}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n\n {byPipeline.length === 0 && (\n <div className=\"py-12 text-center mb-8\">\n <p className=\"text-sm text-text-tertiary\">\n No MCP tool activity in the last {duration}\n </p>\n </div>\n )}\n\n {/* ── Server inventory (compact cards) ─────────────────── */}\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <button\n onClick={() => navigate('/mcp/servers')}\n className=\"bg-surface-raised border border-surface-border rounded-md p-5 text-left hover:border-accent/40 transition-colors\"\n >\n <div className=\"flex items-center gap-3 mb-3\">\n <Server size={16} className=\"text-accent shrink-0\" />\n <span className=\"text-sm font-medium text-text-primary\">Tool Servers</span>\n </div>\n <p className=\"text-2xl font-light tabular-nums text-text-primary mb-1\">\n {serversLoading ? '—' : servers.length}\n <span className=\"text-sm text-text-tertiary font-normal ml-2\">\n server{servers.length !== 1 ? 's' : ''} · {serverToolCount} tool{serverToolCount !== 1 ? 's' : ''}\n </span>\n </p>\n <p className=\"text-[11px] text-text-tertiary leading-relaxed mt-2\">\n Built-in and external MCP servers. Each server exposes tools that workflows and agents can call.\n </p>\n </button>\n\n <button\n onClick={() => navigate('/mcp/workflows')}\n className=\"bg-surface-raised border border-surface-border rounded-md p-5 text-left hover:border-accent/40 transition-colors\"\n >\n <div className=\"flex items-center gap-3 mb-3\">\n <Workflow size={16} className=\"text-purple-400 shrink-0\" />\n <span className=\"text-sm font-medium text-text-primary\">Pipeline Registry</span>\n </div>\n <p className=\"text-2xl font-light tabular-nums text-text-primary mb-1\">\n {yamlLoading ? '—' : yamlWorkflows.length}\n <span className=\"text-sm text-text-tertiary font-normal ml-2\">\n workflow{yamlWorkflows.length !== 1 ? 's' : ''} · {workflowServerCount} server{workflowServerCount !== 1 ? 's' : ''}\n </span>\n </p>\n <p className=\"text-[11px] text-text-tertiary leading-relaxed mt-2\">\n Compiled from discovery runs. Deterministic tool-to-tool pipelines — no LLM, no token costs.\n </p>\n </button>\n </div>\n </div>\n );\n}\n"],"names":["DURATIONS","formatDuration","ms","StatCell","value","colorClass","onClick","jsx","McpOverview","navigate","useNavigate","duration","setDuration","useState","namespace","setNamespace","appsData","useControlPlaneApps","nsNames","useMemo","a","effectiveNamespace","allRuns","useMcpRuns","serverData","serversLoading","useMcpServers","yamlData","yamlLoading","useYamlWorkflows","namespaces","servers","yamlWorkflows","serverToolCount","sum","s","workflowServerCount","wf","cutoff","d","runs","j","byPipeline","map","entry","dur","result","pipeline","stats","b","totals","goToRuns","entity","status","params","qs","thCls","PageHeader","jsxs","e","ns","StatCard","row","Server","Workflow"],"mappings":"icAaA,MAAMA,EAAY,CAChB,CAAE,MAAO,KAAM,GAAI,IAAA,EACnB,CAAE,MAAO,MAAO,GAAI,KAAA,EACpB,CAAE,MAAO,KAAM,GAAI,MAAA,EACnB,CAAE,MAAO,MAAO,GAAI,MAAA,CACtB,EAMA,SAASC,EAAeC,EAAoB,CAC1C,OAAIA,EAAK,IAAa,GAAG,KAAK,MAAMA,CA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../src/pages/mcp/McpOverview.tsx"],"sourcesContent":["import { useState, useMemo } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { Server, Workflow } from 'lucide-react';\nimport { useMcpServers } from '../../api/mcp';\nimport { useMcpRuns } from '../../api/pipelines';\nimport { useYamlWorkflows } from '../../api/yaml-workflows';\nimport { useControlPlaneApps } from '../../api/controlplane';\nimport { PageHeader } from '../../components/common/layout/PageHeader';\nimport { StatCard } from '../../components/common/data/StatCard';\nimport type { McpToolManifest } from '../../api/types';\n\n// ── Duration filter ──────────────────────────────────────────────────────────\n\nconst DURATIONS = [\n { label: '1h', ms: 3_600_000 },\n { label: '24h', ms: 86_400_000 },\n { label: '7d', ms: 604_800_000 },\n { label: '30d', ms: 2_592_000_000 },\n] as const;\n\ntype DurationLabel = (typeof DURATIONS)[number]['label'];\n\n// ── Helpers ──────────────────────────────────────────────────────────────────\n\nfunction formatDuration(ms: number): string {\n if (ms < 1000) return `${Math.round(ms)}ms`;\n if (ms < 60_000) return `${(ms / 1000).toFixed(1)}s`;\n if (ms < 3_600_000) return `${(ms / 60_000).toFixed(1)}m`;\n return `${(ms / 3_600_000).toFixed(1)}h`;\n}\n\ninterface PipelineStats {\n pipeline: string;\n total: number;\n running: number;\n completed: number;\n failed: number;\n avgDuration: number | null;\n}\n\n// ── Reusable components ──────────────────────────────────────────────────────\n\nfunction StatCell({\n value,\n colorClass,\n onClick,\n}: {\n value: number;\n colorClass: string;\n onClick: () => void;\n}) {\n if (value === 0) {\n return <span className=\"text-text-tertiary\">0</span>;\n }\n return (\n <button\n onClick={onClick}\n className={`${colorClass} hover:underline tabular-nums font-medium`}\n >\n {value}\n </button>\n );\n}\n\n// ── Page ─────────────────────────────────────────────────────────────────────\n\nexport function McpOverview() {\n const navigate = useNavigate();\n const [duration, setDuration] = useState<DurationLabel>('24h');\n const [namespace, setNamespace] = useState('');\n\n const { data: appsData } = useControlPlaneApps();\n\n // Auto-select the first namespace when available\n const nsNames = useMemo(() => (appsData?.apps ?? []).map((a: any) => a.appId).sort(), [appsData?.apps]);\n const effectiveNamespace = namespace || nsNames[0] || '';\n\n const { data: allRuns } = useMcpRuns({ limit: 500, app_id: effectiveNamespace });\n const { data: serverData, isLoading: serversLoading } = useMcpServers();\n const { data: yamlData, isLoading: yamlLoading } = useYamlWorkflows({ limit: 200 });\n\n const namespaces = nsNames;\n\n // ── Server counts ────────────────────────────────────────────\n const servers = serverData?.servers ?? [];\n const yamlWorkflows = yamlData?.workflows ?? [];\n\n const serverToolCount = useMemo(\n () => servers.reduce((sum, s) => sum + (Array.isArray(s.tool_manifest) ? (s.tool_manifest as McpToolManifest[]).length : 0), 0),\n [servers],\n );\n\n const workflowServerCount = useMemo(() => {\n const appIds = new Set(yamlWorkflows.map((wf) => wf.app_id));\n return appIds.size;\n }, [yamlWorkflows]);\n\n // ── Run stats ──────────────────────────────────────────────────\n const cutoff = useMemo(() => {\n const d = DURATIONS.find((d) => d.label === duration)!;\n return Date.now() - d.ms;\n }, [duration]);\n\n const runs = useMemo(\n () => (allRuns?.jobs ?? []).filter((j) => new Date(j.created_at).getTime() >= cutoff),\n [allRuns?.jobs, cutoff],\n );\n\n const byPipeline = useMemo(() => {\n const map = new Map<string, { total: number; running: number; completed: number; failed: number; durations: number[] }>();\n for (const j of runs) {\n const entry = map.get(j.entity) ?? { total: 0, running: 0, completed: 0, failed: 0, durations: [] };\n entry.total++;\n if (j.status === 'running') entry.running++;\n if (j.status === 'completed') {\n entry.completed++;\n const dur = new Date(j.updated_at).getTime() - new Date(j.created_at).getTime();\n if (dur > 0) entry.durations.push(dur);\n }\n if (j.status === 'failed') entry.failed++;\n map.set(j.entity, entry);\n }\n\n const result: PipelineStats[] = [];\n for (const [pipeline, stats] of map) {\n result.push({\n pipeline,\n ...stats,\n avgDuration: stats.durations.length > 0\n ? stats.durations.reduce((a, b) => a + b, 0) / stats.durations.length\n : null,\n });\n }\n return result.sort((a, b) => b.total - a.total);\n }, [runs]);\n\n const totals = useMemo(() => ({\n total: runs.length,\n running: runs.filter((j) => j.status === 'running').length,\n completed: runs.filter((j) => j.status === 'completed').length,\n failed: runs.filter((j) => j.status === 'failed').length,\n }), [runs]);\n\n const goToRuns = (entity?: string, status?: string) => {\n const params = new URLSearchParams();\n if (effectiveNamespace) params.set('namespace', effectiveNamespace);\n if (entity) params.set('entity', entity);\n if (status) params.set('status', status);\n const qs = params.toString();\n navigate(`/mcp/executions${qs ? `?${qs}` : ''}`);\n };\n\n const thCls = 'pb-2 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary';\n\n return (\n <div>\n <PageHeader title=\"Discovered\" />\n\n {/* ── Duration tabs + namespace ────────────────────────── */}\n <div className=\"flex items-center gap-4 mb-6\">\n <div className=\"flex items-center gap-1\">\n {DURATIONS.map((d) => (\n <button\n key={d.label}\n onClick={() => setDuration(d.label)}\n className={`px-3 py-1 text-xs rounded-full transition-colors ${\n duration === d.label\n ? 'bg-accent text-text-inverse'\n : 'text-text-tertiary hover:text-text-primary hover:bg-surface-hover'\n }`}\n >\n {d.label}\n </button>\n ))}\n </div>\n {namespaces.length > 1 && (\n <select\n value={effectiveNamespace}\n onChange={(e) => setNamespace(e.target.value)}\n className=\"select text-xs py-1 px-2\"\n >\n {namespaces.map((ns) => (\n <option key={ns} value={ns}>{ns}</option>\n ))}\n </select>\n )}\n </div>\n\n {/* ── Summary cards ────────────────────────────────────── */}\n <div className=\"grid grid-cols-4 gap-4 mb-8\">\n <StatCard label=\"Total Runs\" value={totals.total} onClick={() => goToRuns()} />\n <StatCard label=\"Running\" value={totals.running} colorClass=\"text-status-active\" onClick={() => goToRuns(undefined, 'running')} />\n <StatCard label=\"Completed\" value={totals.completed} colorClass=\"text-status-success\" onClick={() => goToRuns(undefined, 'completed')} />\n <StatCard label=\"Failed\" value={totals.failed} colorClass=\"text-status-error\" onClick={() => goToRuns(undefined, 'failed')} />\n </div>\n\n {/* ── By-pipeline table ────────────────────────────────── */}\n {byPipeline.length > 0 && (\n <table className=\"w-full text-left mb-10\">\n <thead>\n <tr className=\"border-b border-surface-border\">\n <th className={thCls}>Tool</th>\n <th className={`${thCls} text-right w-20`}>Total</th>\n <th className={`${thCls} text-right w-20`}>Running</th>\n <th className={`${thCls} text-right w-24`}>Completed</th>\n <th className={`${thCls} text-right w-20`}>Failed</th>\n <th className={`${thCls} text-right w-28`}>Avg Duration</th>\n </tr>\n </thead>\n <tbody>\n {byPipeline.map((row) => (\n <tr key={row.pipeline} className=\"border-b border-surface-border last:border-b-0\">\n <td className=\"py-3 text-sm font-mono text-text-primary\">\n <button\n onClick={() => goToRuns(row.pipeline)}\n className=\"hover:text-accent hover:underline\"\n >\n {row.pipeline}\n </button>\n </td>\n <td className=\"py-3 text-sm text-right\">\n <StatCell value={row.total} colorClass=\"text-text-secondary\" onClick={() => goToRuns(row.pipeline)} />\n </td>\n <td className=\"py-3 text-sm text-right\">\n <StatCell value={row.running} colorClass=\"text-status-active\" onClick={() => goToRuns(row.pipeline, 'running')} />\n </td>\n <td className=\"py-3 text-sm text-right\">\n <StatCell value={row.completed} colorClass=\"text-status-success\" onClick={() => goToRuns(row.pipeline, 'completed')} />\n </td>\n <td className=\"py-3 text-sm text-right\">\n <StatCell value={row.failed} colorClass=\"text-status-error\" onClick={() => goToRuns(row.pipeline, 'failed')} />\n </td>\n <td className=\"py-3 text-sm font-mono text-text-secondary text-right\">\n {row.avgDuration !== null ? formatDuration(row.avgDuration) : '—'}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n\n {byPipeline.length === 0 && (\n <div className=\"py-12 text-center mb-8\">\n <p className=\"text-sm text-text-tertiary\">\n No MCP tool activity in the last {duration}\n </p>\n </div>\n )}\n\n {/* ── Server inventory (compact cards) ─────────────────── */}\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <button\n onClick={() => navigate('/mcp/servers')}\n className=\"bg-surface-raised border border-surface-border rounded-md p-5 text-left hover:border-accent/40 transition-colors\"\n >\n <div className=\"flex items-center gap-3 mb-3\">\n <Server size={16} className=\"text-accent shrink-0\" />\n <span className=\"text-sm font-medium text-text-primary\">Tool Servers</span>\n </div>\n <p className=\"text-2xl font-light tabular-nums text-text-primary mb-1\">\n {serversLoading ? '—' : servers.length}\n <span className=\"text-sm text-text-tertiary font-normal ml-2\">\n server{servers.length !== 1 ? 's' : ''} · {serverToolCount} tool{serverToolCount !== 1 ? 's' : ''}\n </span>\n </p>\n <p className=\"text-[11px] text-text-tertiary leading-relaxed mt-2\">\n Built-in and external MCP servers. Each server exposes tools that workflows and agents can call.\n </p>\n </button>\n\n <button\n onClick={() => navigate('/mcp/workflows')}\n className=\"bg-surface-raised border border-surface-border rounded-md p-5 text-left hover:border-accent/40 transition-colors\"\n >\n <div className=\"flex items-center gap-3 mb-3\">\n <Workflow size={16} className=\"text-purple-400 shrink-0\" />\n <span className=\"text-sm font-medium text-text-primary\">Pipeline Registry</span>\n </div>\n <p className=\"text-2xl font-light tabular-nums text-text-primary mb-1\">\n {yamlLoading ? '—' : yamlWorkflows.length}\n <span className=\"text-sm text-text-tertiary font-normal ml-2\">\n workflow{yamlWorkflows.length !== 1 ? 's' : ''} · {workflowServerCount} server{workflowServerCount !== 1 ? 's' : ''}\n </span>\n </p>\n <p className=\"text-[11px] text-text-tertiary leading-relaxed mt-2\">\n Compiled from discovery runs. Deterministic tool-to-tool pipelines — no LLM, no token costs.\n </p>\n </button>\n </div>\n </div>\n );\n}\n"],"names":["DURATIONS","formatDuration","ms","StatCell","value","colorClass","onClick","jsx","McpOverview","navigate","useNavigate","duration","setDuration","useState","namespace","setNamespace","appsData","useControlPlaneApps","nsNames","useMemo","a","effectiveNamespace","allRuns","useMcpRuns","serverData","serversLoading","useMcpServers","yamlData","yamlLoading","useYamlWorkflows","namespaces","servers","yamlWorkflows","serverToolCount","sum","s","workflowServerCount","wf","cutoff","d","runs","j","byPipeline","map","entry","dur","result","pipeline","stats","b","totals","goToRuns","entity","status","params","qs","thCls","PageHeader","jsxs","e","ns","StatCard","row","Server","Workflow"],"mappings":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