@hotmeshio/long-tail 0.18.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/settings.js +2 -0
- package/build/index.js +6 -0
- package/build/modules/search.d.ts +21 -0
- package/build/modules/search.js +55 -0
- package/build/services/role/types.d.ts +18 -0
- package/build/services/role/types.js +6 -0
- package/build/start/adapters.js +2 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/startup.d.ts +12 -1
- package/dashboard/dist/assets/{AdminDashboard-mULAQuHV.js → AdminDashboard-DDY8bceq.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-mULAQuHV.js.map → AdminDashboard-DDY8bceq.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-DHdzgXcr.js → AgentConfigPage-D47sHnup.js} +6 -6
- package/dashboard/dist/assets/{AgentConfigPage-DHdzgXcr.js.map → AgentConfigPage-D47sHnup.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-Du_33U2u.js → AgentDetailPage-DwrfByA2.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-Du_33U2u.js.map → AgentDetailPage-DwrfByA2.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-4KkQO2Hl.js → AgentsPage-CLSjlyXy.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-4KkQO2Hl.js.map → AgentsPage-CLSjlyXy.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-D2ukvuQh.js +2 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-D2ukvuQh.js.map +1 -0
- package/dashboard/dist/assets/{BotPicker-BaFiLa-H.js → BotPicker-CbL7gQFq.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-BaFiLa-H.js.map → BotPicker-CbL7gQFq.js.map} +1 -1
- package/dashboard/dist/assets/BulkAssignModal-CMSgvHIs.js +2 -0
- package/dashboard/dist/assets/{BulkAssignModal-DNmji4l-.js.map → BulkAssignModal-CMSgvHIs.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-Q9Pe0y_p.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-Cewd6Uku.js.map → CapabilitiesPage-Q9Pe0y_p.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-D1WIbyDa.js → CollapsibleSection-BZOtaWPR.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-D1WIbyDa.js.map → CollapsibleSection-BZOtaWPR.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-CQsJUzEa.js → ConfirmDeleteModal-6CidwpPx.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-CQsJUzEa.js.map → ConfirmDeleteModal-6CidwpPx.js.map} +1 -1
- package/dashboard/dist/assets/CountdownTimer-B5lM7PfE.js +2 -0
- package/dashboard/dist/assets/{CountdownTimer-BKMmFie6.js.map → CountdownTimer-B5lM7PfE.js.map} +1 -1
- package/dashboard/dist/assets/CredentialsPage-dxjrUEyO.js +2 -0
- package/dashboard/dist/assets/{CredentialsPage-CwtkQUG3.js.map → CredentialsPage-dxjrUEyO.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-CRC_uNuC.js → CronLabel-D8oo8eaA.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-CRC_uNuC.js.map → CronLabel-D8oo8eaA.js.map} +1 -1
- package/dashboard/dist/assets/{DropZone-Pv-v5RAs.js → DropZone-CWCh5ItZ.js} +2 -2
- package/dashboard/dist/assets/{DropZone-Pv-v5RAs.js.map → DropZone-CWCh5ItZ.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-CxAi0zN0.js → ElapsedCell-FHHQ69G3.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-CxAi0zN0.js.map → ElapsedCell-FHHQ69G3.js.map} +1 -1
- package/dashboard/dist/assets/EntityTimelinePanel-B5NuHnPF.js +2 -0
- package/dashboard/dist/assets/{EntityTimelinePanel-DzMuV7ZX.js.map → EntityTimelinePanel-B5NuHnPF.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage--yZfsE8s.js → EscalationListSchemaPage-D5L5lDNb.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage--yZfsE8s.js.map → EscalationListSchemaPage-D5L5lDNb.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-CmoVqaS7.js → EscalationSchemaPage-bYbfEpSB.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-CmoVqaS7.js.map → EscalationSchemaPage-bYbfEpSB.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DDQTW6Jo.js → EscalationsOverview-DjtIjL1b.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DDQTW6Jo.js.map → EscalationsOverview-DjtIjL1b.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-C5jN7XT7.js → EventTable-CihVTREC.js} +2 -2
- package/dashboard/dist/assets/{EventTable-C5jN7XT7.js.map → EventTable-CihVTREC.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-CcIgQH9h.js → FilterBar-Fin1IqHc.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-CcIgQH9h.js.map → FilterBar-Fin1IqHc.js.map} +1 -1
- package/dashboard/dist/assets/GraphInvokePage-D77ILPd3.js +2 -0
- package/dashboard/dist/assets/{GraphInvokePage-LACIxaiH.js.map → GraphInvokePage-D77ILPd3.js.map} +1 -1
- package/dashboard/dist/assets/HomePage-8XsQFqKL.js +2 -0
- package/dashboard/dist/assets/{HomePage-DP9Q-x4a.js.map → HomePage-8XsQFqKL.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-CLwSkmUH.js → ListToolbar-DyHaJBTk.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-CLwSkmUH.js.map → ListToolbar-DyHaJBTk.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-C2U1XfQw.js → McpOverview-qz7Ivf0G.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-C2U1XfQw.js.map → McpOverview-qz7Ivf0G.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-DYOK8A4D.js → McpQueryDetailPage-D6MB4CZM.js} +3 -3
- package/dashboard/dist/assets/{McpQueryDetailPage-DYOK8A4D.js.map → McpQueryDetailPage-D6MB4CZM.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryPage-BqqRF5cQ.js +2 -0
- package/dashboard/dist/assets/{McpQueryPage-Ck75ikSd.js.map → McpQueryPage-BqqRF5cQ.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-CA9gWQ4L.js → McpRunDetailPage-DxLEhzhn.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-CA9gWQ4L.js.map → McpRunDetailPage-DxLEhzhn.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-BhPshset.js → McpRunsPage-BOsS4Hdf.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-BhPshset.js.map → McpRunsPage-BOsS4Hdf.js.map} +1 -1
- package/dashboard/dist/assets/{NamespacePill-DONj6eUU.js → NamespacePill-CJikgGzE.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-DONj6eUU.js.map → NamespacePill-CJikgGzE.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-MlMzl0Bf.js → OperationsPage-Cj1mJLMC.js} +3 -3
- package/dashboard/dist/assets/{OperationsPage-MlMzl0Bf.js.map → OperationsPage-Cj1mJLMC.js.map} +1 -1
- package/dashboard/dist/assets/OperatorDashboard-C5rlijvh.js +2 -0
- package/dashboard/dist/assets/{OperatorDashboard-DZOfHRE7.js.map → OperatorDashboard-C5rlijvh.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-CFVw67M6.js → PageHeader-DZmymFBS.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-CFVw67M6.js.map → PageHeader-DZmymFBS.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-D9tQxILm.js → PageHeaderWithStats-DuAm6YK2.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-D9tQxILm.js.map → PageHeaderWithStats-DuAm6YK2.js.map} +1 -1
- package/dashboard/dist/assets/PersonaDetailPage-JBdVvT5g.js +2 -0
- package/dashboard/dist/assets/{PersonaDetailPage-eyHDupL0.js.map → PersonaDetailPage-JBdVvT5g.js.map} +1 -1
- package/dashboard/dist/assets/PersonasPage-Xp_Gt6El.js +2 -0
- package/dashboard/dist/assets/{PersonasPage-CCtRkWiP.js.map → PersonasPage-Xp_Gt6El.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-CKiAlpOc.js → ProcessDetailPage-CHnzOzQn.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-CKiAlpOc.js.map → ProcessDetailPage-CHnzOzQn.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-C4ueZJxU.js → ProcessesListPage-DuXTS5-v.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-C4ueZJxU.js.map → ProcessesListPage-DuXTS5-v.js.map} +1 -1
- package/dashboard/dist/assets/RoleDetailPage-C9GGHNf4.js +8 -0
- package/dashboard/dist/assets/RoleDetailPage-C9GGHNf4.js.map +1 -0
- package/dashboard/dist/assets/{RolePill-Di_5hfvw.js → RolePill-C9LSs1aK.js} +2 -2
- package/dashboard/dist/assets/{RolePill-Di_5hfvw.js.map → RolePill-C9LSs1aK.js.map} +1 -1
- package/dashboard/dist/assets/RolesPage-h77-JOLd.js +2 -0
- package/dashboard/dist/assets/{RolesPage-B3-9Ek0F.js.map → RolesPage-h77-JOLd.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-1k1J1_cv.js → RunAsSelector-DoLFJ0mZ.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-1k1J1_cv.js.map → RunAsSelector-DoLFJ0mZ.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-CeuVKnpu.js → ScanCodesPage-b5NZM_-f.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-CeuVKnpu.js.map → ScanCodesPage-b5NZM_-f.js.map} +1 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-t7X6ekaW.js +2 -0
- package/dashboard/dist/assets/{ScanSchemeDetailPage-BnivPUJY.js.map → ScanSchemeDetailPage-t7X6ekaW.js.map} +1 -1
- package/dashboard/dist/assets/ScanStationPage-r02hkTAG.js +2 -0
- package/dashboard/dist/assets/{ScanStationPage-DCSA7pcV.js.map → ScanStationPage-r02hkTAG.js.map} +1 -1
- package/dashboard/dist/assets/{ScopeBadge-CqIIeWjK.js → ScopeBadge-CjyC7iyO.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-CqIIeWjK.js.map → ScopeBadge-CjyC7iyO.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-BWuKz8uB.js → StickyPagination-BGHQbp0_.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-BWuKz8uB.js.map → StickyPagination-BGHQbp0_.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-Cq6AGhgJ.js → StreamMessageDetail-C-wfdbLJ.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-Cq6AGhgJ.js.map → StreamMessageDetail-C-wfdbLJ.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-DM88avgt.js → SwimlaneTimeline-Dnoz-me3.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-DM88avgt.js.map → SwimlaneTimeline-Dnoz-me3.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-BLwxTNsI.js → TagInput-D-vLSMQC.js} +2 -2
- package/dashboard/dist/assets/{TagInput-BLwxTNsI.js.map → TagInput-D-vLSMQC.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-Caqe3fG8.js → TaskDetailPage-c9IiAhVJ.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-Caqe3fG8.js.map → TaskDetailPage-c9IiAhVJ.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-DVgcqd-h.js → TaskQueuePill-sFRMrQ5D.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-DVgcqd-h.js.map → TaskQueuePill-sFRMrQ5D.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-DlQwpXOL.js → TasksListPage-Dor8LSc5.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-DlQwpXOL.js.map → TasksListPage-Dor8LSc5.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-BinTjiVC.js → TimeAgo-Dd8vmRnM.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-BinTjiVC.js.map → TimeAgo-Dd8vmRnM.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-DDcfSVeQ.js → TimestampCell-qJfC6-iT.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-DDcfSVeQ.js.map → TimestampCell-qJfC6-iT.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-C6hkOqPx.js → ToolPill-OQ3mC11d.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-C6hkOqPx.js.map → ToolPill-OQ3mC11d.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-CZvegH_w.js → ToolTestPanel-CEGY5jss.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-CZvegH_w.js.map → ToolTestPanel-CEGY5jss.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-CShiCwz8.js → TopicDetailPage-SI80ZTVv.js} +3 -3
- package/dashboard/dist/assets/{TopicDetailPage-CShiCwz8.js.map → TopicDetailPage-SI80ZTVv.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-CAYxRRbI.js → TopicsPage-DiVB8tNr.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-CAYxRRbI.js.map → TopicsPage-DiVB8tNr.js.map} +1 -1
- package/dashboard/dist/assets/UserName-Dmm456xT.js +2 -0
- package/dashboard/dist/assets/{UserName-BovQxdSY.js.map → UserName-Dmm456xT.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-DNdXEFcB.js → WorkflowExecutionPage-e-Q57yiJ.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-DNdXEFcB.js.map → WorkflowExecutionPage-e-Q57yiJ.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-CN-952iI.js → WorkflowPill-Dh3hIW1l.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill-CN-952iI.js.map → WorkflowPill-Dh3hIW1l.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-D7DPDeuQ.js → WorkflowsDashboard-DLKzN80h.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-D7DPDeuQ.js.map → WorkflowsDashboard-DLKzN80h.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-C7Z0SpDH.js → WorkflowsOverview-J-ITQiO5.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-C7Z0SpDH.js.map → WorkflowsOverview-J-ITQiO5.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-Bxklswko.js → YamlWorkflowDetailPage-B_-ahhf1.js} +11 -11
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-Bxklswko.js.map → YamlWorkflowDetailPage-B_-ahhf1.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-CkArsPbi.js → YamlWorkflowsPage-DQNeERXU.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-CkArsPbi.js.map → YamlWorkflowsPage-DQNeERXU.js.map} +1 -1
- package/dashboard/dist/assets/{agents-Ca0hOp2Y.js → agents-BsJ-MizQ.js} +2 -2
- package/dashboard/dist/assets/{agents-Ca0hOp2Y.js.map → agents-BsJ-MizQ.js.map} +1 -1
- package/dashboard/dist/assets/{bots-9GtbGtH9.js → bots-q1UYqaIh.js} +2 -2
- package/dashboard/dist/assets/{bots-9GtbGtH9.js.map → bots-q1UYqaIh.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-C0RpEvyY.js → capabilities-BvjPXUcJ.js} +2 -2
- package/dashboard/dist/assets/{capabilities-C0RpEvyY.js.map → capabilities-BvjPXUcJ.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-ClQiKGyQ.js → controlplane-BwlNpoJ_.js} +2 -2
- package/dashboard/dist/assets/{controlplane-ClQiKGyQ.js.map → controlplane-BwlNpoJ_.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-Bo3PfIZj.js +2 -0
- package/dashboard/dist/assets/{escalation-columns-CZ12_oQF.js.map → escalation-columns-Bo3PfIZj.js.map} +1 -1
- package/dashboard/dist/assets/index-8Gmtvd8e.js +2 -0
- package/dashboard/dist/assets/{index-BoQirCxt.js.map → index-8Gmtvd8e.js.map} +1 -1
- package/dashboard/dist/assets/{index-C1oOLjdF.js → index-B8JfGtQB.js} +3 -3
- package/dashboard/dist/assets/{index-C1oOLjdF.js.map → index-B8JfGtQB.js.map} +1 -1
- package/dashboard/dist/assets/index-Bb9ZZUyB.js +5 -0
- package/dashboard/dist/assets/{index-Ct_8Tpec.js.map → index-Bb9ZZUyB.js.map} +1 -1
- package/dashboard/dist/assets/{index-DlzW75L4.js → index-BhzsR_gZ.js} +2 -2
- package/dashboard/dist/assets/{index-DlzW75L4.js.map → index-BhzsR_gZ.js.map} +1 -1
- package/dashboard/dist/assets/{index-BLCFN3YR.js → index-BvGIyZUt.js} +2 -2
- package/dashboard/dist/assets/{index-BLCFN3YR.js.map → index-BvGIyZUt.js.map} +1 -1
- package/dashboard/dist/assets/{index-P1g8r09L.js → index-CldVY0UQ.js} +2 -2
- package/dashboard/dist/assets/{index-P1g8r09L.js.map → index-CldVY0UQ.js.map} +1 -1
- package/dashboard/dist/assets/index-D88VWEVp.js +67 -0
- package/dashboard/dist/assets/index-D88VWEVp.js.map +1 -0
- package/dashboard/dist/assets/{index-Ba3UsZzz.js → index-DBvkaa-B.js} +4 -4
- package/dashboard/dist/assets/{index-Ba3UsZzz.js.map → index-DBvkaa-B.js.map} +1 -1
- package/dashboard/dist/assets/{index-CeHOGQM4.js → index-DDHoDZRg.js} +2 -2
- package/dashboard/dist/assets/{index-CeHOGQM4.js.map → index-DDHoDZRg.js.map} +1 -1
- package/dashboard/dist/assets/index-DsKqDMs4.js +2 -0
- package/dashboard/dist/assets/{index-DEr9QjVv.js.map → index-DsKqDMs4.js.map} +1 -1
- package/dashboard/dist/assets/index-Hbbox1A4.js +2 -0
- package/dashboard/dist/assets/{index-B-Qpr29t.js.map → index-Hbbox1A4.js.map} +1 -1
- package/dashboard/dist/assets/index-O9uuK2yO.js +2 -0
- package/dashboard/dist/assets/{index-CG8oLNHo.js.map → index-O9uuK2yO.js.map} +1 -1
- package/dashboard/dist/assets/index-cvmt1plS.js +2 -0
- package/dashboard/dist/assets/{index-BLLK2mzy.js.map → index-cvmt1plS.js.map} +1 -1
- package/dashboard/dist/assets/index-qU_dXqP4.css +1 -0
- package/dashboard/dist/assets/{knowledge-DzueDGkw.js → knowledge-DM0tNphj.js} +2 -2
- package/dashboard/dist/assets/{knowledge-DzueDGkw.js.map → knowledge-DM0tNphj.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-CCOzN8dH.js → mcp-CQ_TD2P9.js} +2 -2
- package/dashboard/dist/assets/{mcp-CCOzN8dH.js.map → mcp-CQ_TD2P9.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-UeMDiM6I.js → mcp-query-BP7KSGhc.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-UeMDiM6I.js.map → mcp-query-BP7KSGhc.js.map} +1 -1
- package/dashboard/dist/assets/{personas-CKcrzaQX.js → personas-DclHdHKK.js} +2 -2
- package/dashboard/dist/assets/{personas-CKcrzaQX.js.map → personas-DclHdHKK.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-orE-1gpj.js → pipelines-LwuKJfj-.js} +2 -2
- package/dashboard/dist/assets/{pipelines-orE-1gpj.js.map → pipelines-LwuKJfj-.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-ZOmzxynB.js → tasks-CDs-Li2v.js} +2 -2
- package/dashboard/dist/assets/{tasks-ZOmzxynB.js.map → tasks-CDs-Li2v.js.map} +1 -1
- package/dashboard/dist/assets/{topics-CdYaOCi_.js → topics-BeOSelBX.js} +2 -2
- package/dashboard/dist/assets/{topics-CdYaOCi_.js.map → topics-BeOSelBX.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-D-uGnSj5.js → useDebouncedValue-DhhAKjDC.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-D-uGnSj5.js.map → useDebouncedValue-DhhAKjDC.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-DMrjlrJJ.js → useNamespace-C-E2gNEK.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-DMrjlrJJ.js.map → useNamespace-C-E2gNEK.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-ByyQgu8S.js → useYamlActivityEvents-CmLzX3YU.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-ByyQgu8S.js.map → useYamlActivityEvents-CmLzX3YU.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-h-jlRSb9.js → vendor-icons-R9b9gQ04.js} +2 -2
- package/dashboard/dist/assets/{vendor-icons-h-jlRSb9.js.map → vendor-icons-R9b9gQ04.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-CLn05FRV.js → workflows-CYv1CTU0.js} +2 -2
- package/dashboard/dist/assets/{workflows-CLn05FRV.js.map → workflows-CYv1CTU0.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-DFD_HO__.js → yaml-workflows-BgAsc6-I.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-DFD_HO__.js.map → yaml-workflows-BgAsc6-I.js.map} +1 -1
- package/dashboard/dist/index.html +3 -3
- package/docs/dashboard.md +23 -1
- package/docs/faceted-routing.md +34 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-CjcAIm-d.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-CjcAIm-d.js.map +0 -1
- package/dashboard/dist/assets/BulkAssignModal-DNmji4l-.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-Cewd6Uku.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-BKMmFie6.js +0 -2
- package/dashboard/dist/assets/CredentialsPage-CwtkQUG3.js +0 -2
- package/dashboard/dist/assets/EntityTimelinePanel-DzMuV7ZX.js +0 -2
- package/dashboard/dist/assets/GraphInvokePage-LACIxaiH.js +0 -2
- package/dashboard/dist/assets/HomePage-DP9Q-x4a.js +0 -2
- package/dashboard/dist/assets/McpQueryPage-Ck75ikSd.js +0 -2
- package/dashboard/dist/assets/Modal-BU7No9NH.js +0 -2
- package/dashboard/dist/assets/Modal-BU7No9NH.js.map +0 -1
- package/dashboard/dist/assets/OperatorDashboard-DZOfHRE7.js +0 -2
- package/dashboard/dist/assets/PersonaDetailPage-eyHDupL0.js +0 -2
- package/dashboard/dist/assets/PersonasPage-CCtRkWiP.js +0 -2
- package/dashboard/dist/assets/RoleDetailPage-BOccQCkx.js +0 -8
- package/dashboard/dist/assets/RoleDetailPage-BOccQCkx.js.map +0 -1
- package/dashboard/dist/assets/RolesPage-B3-9Ek0F.js +0 -2
- package/dashboard/dist/assets/ScanSchemeDetailPage-BnivPUJY.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-DCSA7pcV.js +0 -2
- package/dashboard/dist/assets/UserName-BovQxdSY.js +0 -2
- package/dashboard/dist/assets/escalation-columns-CZ12_oQF.js +0 -2
- package/dashboard/dist/assets/index-B-Qpr29t.js +0 -2
- package/dashboard/dist/assets/index-BLLK2mzy.js +0 -2
- package/dashboard/dist/assets/index-BoQirCxt.js +0 -2
- package/dashboard/dist/assets/index-CG8oLNHo.js +0 -2
- package/dashboard/dist/assets/index-CdavRyaX.js +0 -67
- package/dashboard/dist/assets/index-CdavRyaX.js.map +0 -1
- package/dashboard/dist/assets/index-Ct_8Tpec.js +0 -5
- package/dashboard/dist/assets/index-DEr9QjVv.js +0 -2
- package/dashboard/dist/assets/index-fUqvRHOe.css +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as d,j as e}from"./vendor-query-RUZdMvN6.js";import{ap as le,aq as re,U as G,e as V,ar as ie,as as ce,at as oe,au as de,I as q,av as xe,aj as me}from"./index-CdavRyaX.js";import{u as J}from"./useFilterParams-crmlBw_l.js";import{D as H}from"./DataTable-DFPMeqyQ.js";import{S as W}from"./StickyPagination-BWuKz8uB.js";import{F as Y,a as Q,b as X}from"./FilterBar-CcIgQH9h.js";import{C as I}from"./ConfirmDeleteModal-CQsJUzEa.js";import{R as Z,a as R}from"./RowActions-eYrzgQSj.js";import{P as ee}from"./PageHeader-CFVw67M6.js";import{R as A}from"./RolePill-Di_5hfvw.js";import{M as E}from"./Modal-BU7No9NH.js";import{u as ue,a as pe,b as he,c as je,d as fe,e as ve,f as ge,g as ye,h as be}from"./bots-9GtbGtH9.js";import{T as Ne}from"./TimeAgo-BinTjiVC.js";import{a8 as we,a9 as ke,aM as Se,T as F,f as Ce,a7 as te,az as Pe,D as se,U as _e,e as Re}from"./vendor-icons-h-jlRSb9.js";import{u as Ae,a as Ee,b as Ue,c as Be}from"./personas-CKcrzaQX.js";import{S as De}from"./ScopeBadge-CqIIeWjK.js";import{L as Te,f as Ke}from"./vendor-react-CdqEC2zv.js";import{S as Ie}from"./SegmentedTabs-DXNzY05q.js";import"./EmptyState-lpUFYfun.js";function Fe({open:a,onClose:r}){const t=le(),[n,i]=d.useState({external_id:"",email:"",display_name:"",password:""}),[m,f]=d.useState(a);a!==m&&(f(a),a&&i({external_id:"",email:"",display_name:"",password:""}));const h=()=>{n.external_id.trim()&&t.mutate({external_id:n.external_id.trim(),email:n.email.trim()||void 0,display_name:n.display_name.trim()||void 0,password:n.password||void 0},{onSuccess:r})},u=(s,j)=>i(p=>({...p,[s]:j}));return e.jsx(E,{open:a,onClose:r,title:"Create User",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"External ID (required)"}),e.jsx("input",{type:"text",value:n.external_id,onChange:s=>u("external_id",s.target.value),placeholder:"e.g., john.doe",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Display Name"}),e.jsx("input",{type:"text",value:n.display_name,onChange:s=>u("display_name",s.target.value),placeholder:"John Doe",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Email"}),e.jsx("input",{type:"text",value:n.email,onChange:s=>u("email",s.target.value),placeholder:"john@example.com",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Password"}),e.jsx("input",{type:"password",value:n.password,onChange:s=>u("password",s.target.value),placeholder:"Leave blank for no password",className:"input text-xs w-full"})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:r,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:h,disabled:!n.external_id.trim()||t.isPending,className:"btn-primary text-xs",children:t.isPending?"Creating...":"Create"})]})]})})}function Me({open:a,onClose:r,user:t}){const n=re(),[i,m]=d.useState({display_name:"",email:"",status:"active"}),[f,h]=d.useState(t);t!==f&&(h(t),t&&m({display_name:t.display_name??"",email:t.email??"",status:t.status}));const u=()=>{t&&n.mutate({id:t.id,display_name:i.display_name.trim()||void 0,email:i.email.trim()||void 0,status:i.status},{onSuccess:r})};return e.jsx(E,{open:a,onClose:r,title:`Edit — ${(t==null?void 0:t.display_name)||(t==null?void 0:t.external_id)||""}`,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Display Name"}),e.jsx("input",{type:"text",value:i.display_name,onChange:s=>m(j=>({...j,display_name:s.target.value})),className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Email"}),e.jsx("input",{type:"text",value:i.email,onChange:s=>m(j=>({...j,email:s.target.value})),className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Status"}),e.jsxs("select",{value:i.status,onChange:s=>m(j=>({...j,status:s.target.value})),className:"select text-xs w-full",children:[e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"inactive",children:"Inactive"}),e.jsx("option",{value:"suspended",children:"Suspended"})]})]}),n.error&&e.jsx("p",{className:"text-xs text-status-error",children:n.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:r,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:u,disabled:n.isPending,className:"btn-primary text-xs",children:n.isPending?"Saving...":"Save"})]})]})})}function $e({open:a,onClose:r}){const t=ue(),[n,i]=d.useState({name:"",display_name:"",description:""}),[m,f]=d.useState(a);a!==m&&(f(a),a&&i({name:"",display_name:"",description:""}));const h=()=>{n.name.trim()&&t.mutate({name:n.name.trim(),display_name:n.display_name.trim()||void 0,description:n.description.trim()||void 0},{onSuccess:r})},u=(s,j)=>i(p=>({...p,[s]:j}));return e.jsx(E,{open:a,onClose:r,title:"Create Service Account",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Name (required)"}),e.jsx("input",{type:"text",value:n.name,onChange:s=>u("name",s.target.value.replace(/\s+/g,"-").toLowerCase()),placeholder:"e.g., ci-bot",className:"input text-xs w-full font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Display Name"}),e.jsx("input",{type:"text",value:n.display_name,onChange:s=>u("display_name",s.target.value),placeholder:"CI Bot",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("input",{type:"text",value:n.description,onChange:s=>u("description",s.target.value),placeholder:"Runs scheduled workflows",className:"input text-xs w-full"})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:r,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:h,disabled:!n.name.trim()||t.isPending,className:"btn-primary text-xs",children:t.isPending?"Creating...":"Create"})]})]})})}function Oe({open:a,onClose:r,bot:t}){const n=pe(),[i,m]=d.useState({display_name:"",description:"",status:"active"}),[f,h]=d.useState(t);t!==f&&(h(t),t&&m({display_name:t.display_name??"",description:t.description??"",status:t.status}));const u=()=>{t&&n.mutate({id:t.id,display_name:i.display_name.trim()||void 0,description:i.description.trim()||void 0,status:i.status},{onSuccess:r})};return e.jsx(E,{open:a,onClose:r,title:`Edit — ${(t==null?void 0:t.display_name)||(t==null?void 0:t.external_id)||""}`,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Display Name"}),e.jsx("input",{type:"text",value:i.display_name,onChange:s=>m(j=>({...j,display_name:s.target.value})),className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("input",{type:"text",value:i.description,onChange:s=>m(j=>({...j,description:s.target.value})),className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Status"}),e.jsxs("select",{value:i.status,onChange:s=>m(j=>({...j,status:s.target.value})),className:"select text-xs w-full",children:[e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"inactive",children:"Inactive"}),e.jsx("option",{value:"suspended",children:"Suspended"})]})]}),n.error&&e.jsx("p",{className:"text-xs text-status-error",children:n.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:r,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:u,disabled:n.isPending,className:"btn-primary text-xs",children:n.isPending?"Saving...":"Save"})]})]})})}function ze({botId:a}){const{data:r}=he(a),t=je(),n=fe(),[i,m]=d.useState(""),[f,h]=d.useState("read"),[u,s]=d.useState(null),[j,p]=d.useState(!1),[v,x]=d.useState(null),y=(r==null?void 0:r.keys)??[],o={read:{label:"Read only",scopes:["mcp:read"],hint:"Discovery and monitoring — read-safe tools only"},full:{label:"Full access",scopes:["mcp:read","mcp:full"],hint:"All tools — can modify state"}},b=()=>{i.trim()&&t.mutate({botId:a,name:i.trim(),scopes:o[f].scopes},{onSuccess:g=>{s(g.rawKey),m("")}})},N=()=>{u&&(navigator.clipboard.writeText(u),p(!0),setTimeout(()=>p(!1),2e3))},k=()=>{v&&n.mutate({botId:a,keyId:v.id},{onSuccess:()=>x(null)})};return e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-3",children:"API Keys"}),u&&e.jsxs("div",{className:"mb-3 p-3 bg-status-success/10 border border-status-success/30 rounded-md",children:[e.jsx("p",{className:"text-2xs font-semibold text-status-success mb-1",children:"Key generated — copy now, it won't be shown again"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-2xs font-mono text-text-primary bg-surface-sunken px-2 py-1 rounded flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:u}),e.jsx("button",{onClick:N,className:"text-text-tertiary hover:text-text-primary shrink-0",title:"Copy to clipboard",children:j?e.jsx(we,{className:"w-3.5 h-3.5 text-status-success"}):e.jsx(ke,{className:"w-3.5 h-3.5"})})]})]}),y.length===0?e.jsx("p",{className:"text-xs text-text-tertiary mb-3",children:"No API keys."}):e.jsx("div",{className:"space-y-1.5 mb-3",children:y.map(g=>e.jsxs("div",{className:"group/key flex items-center justify-between px-2.5 py-1.5 bg-surface-sunken rounded text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(Se,{className:"w-3 h-3 text-text-tertiary"}),e.jsx("span",{className:"text-text-primary font-mono",children:g.name}),(g.scopes??[]).map(l=>e.jsx("span",{className:`px-1.5 py-0.5 rounded text-2xs font-mono ${l.includes("full")?"bg-status-warning/15 text-status-warning":"bg-accent/10 text-accent"}`,children:l},l)),g.last_used_at&&e.jsxs("span",{className:"text-2xs text-text-tertiary",children:["used ",e.jsx(Ne,{date:g.last_used_at})]})]}),e.jsx("button",{onClick:()=>x(g),className:"opacity-0 group-hover/key:opacity-100 transition-opacity text-text-tertiary hover:text-status-error",title:"Revoke key",children:e.jsx(F,{className:"w-3 h-3"})})]},g.id))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("input",{type:"text",value:i,onChange:g=>m(g.target.value),placeholder:"Key name...",className:"input text-xs font-mono"}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"flex rounded-md border border-surface-border overflow-hidden shrink-0",children:Object.entries(o).map(([g,l])=>e.jsx("button",{type:"button",onClick:()=>h(g),title:l.hint,className:`px-2.5 py-1 text-2xs font-medium transition-colors ${f===g?"bg-accent text-text-inverse":"bg-surface text-text-secondary hover:bg-surface-hover"}`,children:l.label},g))}),e.jsxs("button",{onClick:b,disabled:!i.trim()||t.isPending,className:"btn-primary text-xs inline-flex items-center gap-1 shrink-0",children:[e.jsx(Ce,{className:"w-3 h-3"}),t.isPending?"...":"Generate"]})]})]}),t.error&&e.jsx("p",{className:"text-2xs text-status-error mt-1",children:t.error.message}),e.jsx(I,{open:!!v,onClose:()=>x(null),onConfirm:k,title:"Revoke API Key",description:e.jsxs(e.Fragment,{children:["Revoke API key"," ",e.jsx("span",{className:"font-medium text-text-primary font-mono",children:v==null?void 0:v.name}),"? This bot will no longer be able to authenticate with this key."]}),isPending:n.isPending,error:n.error})]})}function Le({bot:a}){const{data:r}=G(),t=ve(),n=ge(),[i,m]=d.useState(""),[f,h]=d.useState("member"),u=(r==null?void 0:r.roles)??[],s=a.roles??[],j=d.useMemo(()=>{const x=new Set(s.map(y=>y.role));return u.filter(y=>!x.has(y))},[u,s]),p=()=>{i.trim()&&t.mutate({botId:a.id,role:i.trim(),type:f},{onSuccess:()=>{m(""),h("member")}})},v=x=>{n.mutate({botId:a.id,role:x})};return e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-3",children:"Roles"}),s.length===0?e.jsx("p",{className:"text-xs text-text-tertiary mb-3",children:"No roles assigned."}):e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:s.map(x=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary",children:[e.jsx(A,{role:x.role}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:x.type}),e.jsx("button",{onClick:()=>v(x.role),className:"text-text-tertiary hover:text-status-error transition-colors ml-0.5",title:`Remove ${x.role}`,children:"×"})]},x.role))}),j.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("select",{value:i,onChange:x=>m(x.target.value),className:"select text-xs font-mono w-full min-w-0","aria-label":"Role",children:[e.jsx("option",{value:"",children:"Select a role..."}),j.map(x=>e.jsx("option",{value:x,children:x},x))]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 items-end",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{className:"block text-2xs text-text-tertiary mb-1",children:"Type"}),e.jsxs("select",{value:f,onChange:x=>h(x.target.value),className:"select text-xs w-full min-w-0","aria-label":"Role type",children:[e.jsx("option",{value:"member",children:"member"}),e.jsx("option",{value:"admin",children:"admin"}),e.jsx("option",{value:"superadmin",children:"superadmin"})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:p,disabled:!i||t.isPending,className:"btn-primary text-xs",children:t.isPending?"...":"Add Role"})})]})]}),t.error&&e.jsx("p",{className:"text-2xs text-status-error mt-1",children:t.error.message})]})}function Ge({bot:a}){return a?e.jsxs("div",{className:"border-l border-surface-border pl-6 pt-4 min-h-[300px] space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-text-primary",children:a.display_name||a.external_id}),a.description&&e.jsx("p",{className:"text-xs text-text-tertiary mt-0.5",children:a.description})]}),e.jsx(ze,{botId:a.id}),e.jsx(Le,{bot:a})]}):e.jsx("div",{className:"border-l border-surface-border pl-6 pt-4 min-h-[300px]",children:e.jsx("p",{className:"text-xs text-text-tertiary",children:"Select a service account to manage its API keys and roles."})})}const Ve={active:"bg-status-success",inactive:"bg-text-tertiary",suspended:"bg-status-error"},qe=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"suspended",label:"Suspended"}];function Je({embedded:a=!1}){const{filters:r,setFilter:t,pagination:n}=J({filters:{status:"",search:""}}),i=ye(),[m,f]=d.useState(!1),[h,u]=d.useState(null),[s,j]=d.useState(null),[p,v]=d.useState(null),{data:x,isLoading:y}=be({status:r.status||void 0,search:r.search||void 0,limit:n.pageSize,offset:n.offset}),o=(x==null?void 0:x.total)??0,b=(x==null?void 0:x.bots)??[],N=d.useMemo(()=>s?b.find(l=>l.id===s.id)??s:null,[b,s]),k=[{key:"display_name",label:"Service Account",render:l=>e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${Ve[l.status]??"bg-status-pending"}`,title:l.status}),e.jsx("span",{className:"text-sm text-text-primary whitespace-nowrap",children:l.display_name||l.external_id})]})},{key:"description",label:"Description",render:l=>e.jsx("span",{className:"block max-w-[32rem] truncate text-xs text-text-tertiary",title:l.description??void 0,children:l.description??""})},{key:"roles",label:"Roles",render:l=>e.jsx("div",{className:"flex gap-1 flex-wrap",children:(l.roles??[]).map(S=>e.jsx(A,{role:S.role},S.role))})},{key:"created_at",label:"Created",render:l=>e.jsx(V,{date:l.created_at}),className:"w-36 whitespace-nowrap"},{key:"actions",label:"",render:l=>e.jsxs(Z,{children:[e.jsx(R,{icon:te,title:"Edit service account",onClick:()=>u(l)}),e.jsx(R,{icon:F,title:"Delete service account",onClick:()=>v(l),colorClass:"text-text-tertiary hover:text-status-error"})]}),className:"w-16 text-right"}],g=()=>{p&&i.mutate(p.id,{onSuccess:()=>{v(null),(s==null?void 0:s.id)===p.id&&j(null)}})};return e.jsxs("div",{children:[a?e.jsx("div",{className:"flex justify-end mb-4",children:e.jsx("button",{onClick:()=>f(!0),className:"btn-primary text-xs",children:"Add Service Account"})}):e.jsx(ee,{title:"Service Accounts",actions:e.jsx("button",{onClick:()=>f(!0),className:"btn-primary text-xs",children:"Add Service Account"})}),e.jsxs(Y,{children:[e.jsx(Q,{label:"Search",value:r.search,onChange:l=>t("search",l),placeholder:"name, id, description…"}),e.jsx(X,{label:"Status",value:r.status,onChange:l=>t("status",l),options:qe})]}),e.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-[1fr_360px] gap-6 items-start",children:[e.jsxs("div",{className:"overflow-x-clip",children:[e.jsx(H,{columns:k,data:b,keyFn:l=>l.id,isLoading:y,emptyMessage:"No service accounts yet",onRowClick:l=>j(l),activeRowKey:(N==null?void 0:N.id)??null}),e.jsx(W,{page:n.page,totalPages:n.totalPages(o),onPageChange:n.setPage,total:o,pageSize:n.pageSize,onPageSizeChange:n.setPageSize})]}),e.jsx("div",{className:"sticky top-4",children:e.jsx(Ge,{bot:N})})]}),e.jsx($e,{open:m,onClose:()=>f(!1)}),e.jsx(Oe,{open:!!h,onClose:()=>u(null),bot:h}),e.jsx(I,{open:!!p,onClose:()=>v(null),onConfirm:g,title:"Delete Service Account",description:e.jsxs(e.Fragment,{children:["Delete"," ",e.jsx("span",{className:"font-medium text-text-primary",children:(p==null?void 0:p.display_name)||(p==null?void 0:p.external_id)}),"? This will also revoke all API keys. This action cannot be undone."]}),isPending:i.isPending,error:i.error})]})}function He({value:a,systemKeys:r=[],pending:t=!1,error:n,onPatch:i}){const m=Object.entries(a??{}),f=new Set(r),[h,u]=d.useState(null),[s,j]=d.useState(""),[p,v]=d.useState(""),[x,y]=d.useState(null),[o,b]=d.useState(null),[N,k]=d.useState(""),[g,l]=d.useState(""),[S,C]=d.useState(null),P=c=>typeof c=="string"?c:JSON.stringify(c),$=c=>{const w=c.trim();try{return JSON.parse(w)}catch{return w}};function O(c){if(f.has(c)&&o!==c){b(c);return}b(null),u(c),j(c),v(P((a??{})[c])),y(null),C(null)}function ae(){if(h===null)return;const c=s.trim();if(!c){C("Property name is required");return}if(c!==h&&m.some(([B])=>B===c)){C(`"${c}" already exists`);return}const w={};c!==h&&(w.rename={[h]:c});const _=$(p);if((P(_)!==P((a??{})[h])||c!==h)&&P(_)!==P((a??{})[h])&&(w.set={[c]:_}),!w.set&&!w.rename){U();return}i(w),U()}function U(){u(null),j(""),v(""),C(null)}function z(){const c=N.trim();if(!c){C("Property name is required");return}if(m.some(([w])=>w===c)){C(`"${c}" already exists`);return}i({set:{[c]:$(g)}}),k(""),l(""),C(null)}return e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Properties"}),m.length===0&&e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No properties — add one below."}),m.map(([c,w])=>{const _=f.has(c),B=h===c,ne=x===c;return e.jsx("div",{className:"group text-xs",children:B?e.jsxs("div",{className:"space-y-1.5 border-l-2 border-l-accent pl-2",children:[e.jsx("input",{value:s,onChange:D=>j(D.target.value),"aria-label":"Property name",className:"input text-xs w-full min-w-0 font-mono"}),e.jsx("input",{value:p,onChange:D=>v(D.target.value),"aria-label":"Property value",placeholder:"value (string or JSON)",className:"input text-xs w-full min-w-0"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:ae,disabled:t,className:"text-2xs font-medium text-accent hover:text-accent-hover",children:t?"Saving...":"Save"}),e.jsx("button",{onClick:U,className:"text-2xs text-text-tertiary hover:text-text-secondary",children:"Cancel"}),e.jsx("button",{onClick:()=>{y(c),u(null)},className:"text-2xs text-status-error/50 hover:text-status-error ml-auto",children:"Remove"})]})]}):ne?e.jsxs("span",{className:"flex items-center gap-2 text-2xs",children:[e.jsxs("span",{className:"text-status-error",children:["Remove ",e.jsx("span",{className:"font-medium font-mono",children:c}),"?"]}),e.jsx("button",{onClick:()=>{i({remove:[c]}),y(null)},disabled:t,className:"font-medium text-status-error hover:text-status-error/80",children:t?"...":"Yes"}),e.jsx("button",{onClick:()=>y(null),className:"text-text-tertiary hover:text-text-secondary",children:"No"})]}):o===c?e.jsxs("span",{className:"flex items-center gap-2 text-2xs",children:[e.jsxs("span",{className:"text-text-secondary",children:[e.jsx("span",{className:"font-mono font-medium",children:c})," is a system property — the platform resolves identities with it. Edit?"]}),e.jsx("button",{onClick:()=>O(c),className:"font-medium text-accent hover:text-accent-hover",children:"Edit"}),e.jsx("button",{onClick:()=>b(null),className:"text-text-tertiary hover:text-text-secondary",children:"Cancel"})]}):e.jsxs("button",{onClick:()=>O(c),className:"flex items-center gap-2 w-full min-w-0 text-left rounded px-1 py-0.5 -mx-1 hover:bg-surface-hover transition-colors",title:`Edit ${c}`,children:[e.jsx("span",{className:"font-mono font-medium text-text-secondary shrink-0",children:c}),_&&e.jsx("span",{className:"shrink-0 text-accent/80",title:"system",children:e.jsx(Pe,{className:"w-3 h-3","aria-label":"system"})}),e.jsx("span",{className:"flex-1 min-w-0 truncate text-right text-text-primary tabular-nums",children:P(w)})]})},c)}),e.jsxs("div",{className:"pt-1.5 border-t border-surface-border space-y-1.5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx("input",{value:N,onChange:c=>k(c.target.value),placeholder:"property","aria-label":"New property name",className:"input text-xs w-full min-w-0 font-mono"}),e.jsx("input",{value:g,onChange:c=>l(c.target.value),onKeyDown:c=>{c.key==="Enter"&&z()},placeholder:"value","aria-label":"New property value",className:"input text-xs w-full min-w-0"})]}),N.trim()&&e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:z,disabled:t,className:"btn-primary text-xs",children:t?"...":"Add Property"})})]}),(S||n)&&e.jsx("p",{role:"alert",className:"text-2xs text-status-error",children:S||n})]})}const K=[{value:"all|all",label:"See all · act on all",read_scope:"all",write_scope:"all"},{value:"all|self",label:"See all · act on self",read_scope:"all",write_scope:"self"},{value:"self|self",label:"See self · act on self",read_scope:"self",write_scope:"self"},{value:"all|none",label:"See all · read-only",read_scope:"all",write_scope:"none"},{value:"self|none",label:"See self · read-only",read_scope:"self",write_scope:"none"}],T="all|all";function L(a){return K.find(r=>r.value===a)??K[0]}function M({children:a}){return e.jsx("div",{className:"border border-surface-border bg-surface-sunken rounded-[var(--lt-radius-section)] p-4",children:a})}function We({user:a}){const r=oe(),{data:t}=de();return e.jsx(M,{children:e.jsx(He,{value:a.metadata??{},systemKeys:(t==null?void 0:t.keys)??[],pending:r.isPending,error:r.error?r.error.message:null,onPatch:n=>r.mutate({id:a.id,ops:n})})})}function Ye({user:a}){const{data:r}=Ae(),{data:t}=Ee(a.id),n=Ue(),i=Be(),[m,f]=d.useState(""),h=(t==null?void 0:t.personas)??[],u=d.useMemo(()=>{const s=new Set(h.map(j=>j.key));return((r==null?void 0:r.personas)??[]).filter(j=>!s.has(j.key))},[r,h]);return h.length===0&&u.length===0?null:e.jsx(M,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Personas"}),h.length>0&&e.jsx("div",{className:"flex flex-col gap-2",children:h.map(s=>e.jsxs("span",{className:"flex items-center gap-2.5 w-full min-w-0 pl-2.5 pr-2 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary",children:[e.jsx(se,{className:"w-3 h-3 shrink-0 text-text-tertiary","aria-hidden":!0}),e.jsx(Te,{to:`/admin/personas/${encodeURIComponent(s.key)}`,className:"flex-1 min-w-0 truncate transition-colors hover:text-accent",title:s.key,children:s.title||s.key}),e.jsxs("span",{className:"shrink-0 text-2xs text-text-tertiary tabular-nums",children:[s.roles.length," role",s.roles.length===1?"":"s"]}),e.jsx("button",{onClick:()=>i.mutate({userId:a.id,key:s.key}),className:"shrink-0 text-text-tertiary hover:text-status-error transition-colors ml-1",title:`Unassign ${s.title||s.key}`,children:"×"})]},s.key))}),u.length>0&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("select",{value:m,onChange:s=>f(s.target.value),className:"select text-xs w-full min-w-0","aria-label":"Persona",children:[e.jsx("option",{value:"",children:"Assign a persona..."}),u.map(s=>e.jsx("option",{value:s.key,children:s.title||s.key},s.key))]}),e.jsx("button",{onClick:()=>{m&&n.mutate({userId:a.id,key:m},{onSuccess:()=>f("")})},disabled:!m||n.isPending,className:"btn-primary text-xs shrink-0",children:n.isPending?"...":"Assign"})]}),(n.error||i.error)&&e.jsx("p",{className:"text-2xs text-status-error",children:(n.error||i.error).message})]})})}function Qe({user:a}){const{data:r}=G(),t=ie(),n=ce(),[i,m]=d.useState(""),[f,h]=d.useState("member"),[u,s]=d.useState(T),j=(r==null?void 0:r.roles)??[],p=(a==null?void 0:a.roles)??[],v=d.useMemo(()=>{const o=new Set(p.map(b=>b.role));return j.filter(b=>!o.has(b))},[j,p]),x=()=>{if(!a||!i.trim())return;const o=L(f==="member"?u:T);t.mutate({userId:a.id,role:i.trim(),type:f,read_scope:o.read_scope,write_scope:o.write_scope},{onSuccess:()=>{m(""),h("member"),s(T)}})},y=o=>{a&&n.mutate({userId:a.id,role:o})};return e.jsxs("div",{className:"border-l border-surface-border pl-6 pt-4 pb-8 min-h-[300px]",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-4",children:"Role Membership"}),a?e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{children:e.jsx("p",{className:"text-sm text-text-primary",children:a.display_name||a.external_id})}),e.jsx(Ye,{user:a}),e.jsx(M,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Roles"}),p.length===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:"No roles assigned."}):e.jsx("div",{className:"flex flex-col gap-2",children:p.map(o=>e.jsxs("span",{className:"flex items-center gap-2.5 w-full min-w-0 pl-2.5 pr-2 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary",children:[e.jsx("span",{className:"flex-1 min-w-0 truncate",title:o.role,children:e.jsx(A,{role:o.role,tone:"inherit"})}),e.jsx("span",{className:"w-14 shrink-0 text-2xs uppercase tracking-wide text-text-tertiary",children:o.type}),o.type==="member"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"w-px h-3 bg-surface-border shrink-0","aria-hidden":!0}),e.jsx(De,{read:o.read_scope,write:o.write_scope,className:"shrink-0"})]}),o.granted_by_persona&&e.jsx("span",{className:"shrink-0",title:`Granted by persona ${o.granted_by_persona}`,children:e.jsx(se,{className:"w-3 h-3 text-text-tertiary","aria-hidden":!0})}),e.jsx("button",{onClick:()=>y(o.role),className:"shrink-0 text-text-tertiary hover:text-status-error transition-colors ml-1",title:`Remove ${o.role}`,children:"×"})]},o.role))}),v.length>0&&e.jsxs("div",{className:"pt-3 border-t border-surface-border space-y-2",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Add Role"}),e.jsxs("select",{value:i,onChange:o=>m(o.target.value),className:"select text-xs font-mono w-full min-w-0","aria-label":"Role",children:[e.jsx("option",{value:"",children:"Select a role..."}),v.map(o=>e.jsx("option",{value:o,children:o},o))]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{className:"block text-2xs text-text-tertiary mb-1",children:"Type"}),e.jsxs("select",{value:f,onChange:o=>h(o.target.value),className:"select text-xs w-full min-w-0","aria-label":"Role type",children:[e.jsx("option",{value:"member",children:"member"}),e.jsx("option",{value:"admin",children:"admin"}),e.jsx("option",{value:"superadmin",children:"superadmin"})]})]}),f==="member"&&e.jsxs("div",{className:"min-w-0",children:[e.jsx("label",{className:"block text-2xs text-text-tertiary mb-1",children:"Scope"}),e.jsx("select",{value:u,onChange:o=>s(o.target.value),className:"select text-xs w-full min-w-0","aria-label":"Work-surface scope",children:K.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))})]})]}),e.jsx("div",{className:"flex justify-end pt-1",children:e.jsx("button",{onClick:x,disabled:!i||t.isPending,className:"btn-primary text-xs",children:t.isPending?"...":"Add Role"})}),t.error&&e.jsx("p",{className:"text-2xs text-status-error",children:t.error.message})]})]})}),e.jsx(We,{user:a})]}):e.jsx("p",{className:"text-xs text-text-tertiary",children:"Select a user to manage their roles."})]})}function Xe({active:a,onChange:r}){return e.jsx(Ie,{"aria-label":"Account kind",active:a,onChange:r,tabs:[{key:"users",label:"User Accounts",icon:e.jsx(_e,{className:"w-3.5 h-3.5"})},{key:"service-accounts",label:"Service Accounts",icon:e.jsx(Re,{className:"w-3.5 h-3.5"})}]})}const Ze=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"suspended",label:"Suspended"}],et={active:"bg-status-success",inactive:"bg-text-tertiary",suspended:"bg-status-error"};function bt(){const{isBuilder:a}=q(),[r,t]=Ke(),n=r.get("tab"),i=a&&n==="service-accounts"?"service-accounts":"users",m=f=>{t(f==="users"?{}:{tab:f})};return e.jsxs("div",{children:[e.jsx(ee,{title:"Accounts",docsHash:"#docs:dashboard.md:accounts",actions:a?e.jsx(Xe,{active:i,onChange:m}):void 0}),i==="users"?e.jsx(tt,{}):e.jsx(Je,{embedded:!0})]})}function tt(){const{isBuilder:a}=q(),{filters:r,setFilter:t,pagination:n}=J({filters:{status:"",search:""}}),i=xe(),[m,f]=d.useState(!1),[h,u]=d.useState(null),[s,j]=d.useState(null),[p,v]=d.useState(null),{data:x,isLoading:y}=me({status:r.status||void 0,search:r.search||void 0,limit:n.pageSize,offset:n.offset}),o=(x==null?void 0:x.total)??0,b=(x==null?void 0:x.users)??[],N=d.useMemo(()=>s?b.find(l=>l.id===s.id)??s:null,[b,s]),k=[{key:"display_name",label:"User",render:l=>e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${et[l.status]??"bg-status-pending"}`,title:l.status}),e.jsx("span",{className:"text-xs text-text-primary whitespace-nowrap",children:l.display_name||l.external_id})]})},{key:"email",label:"Email",render:l=>l.email?e.jsx("span",{className:"text-xs text-text-secondary whitespace-nowrap",children:l.email}):e.jsx("span",{className:"text-xs text-text-quaternary",children:"—"})},{key:"roles",label:"Roles",render:l=>e.jsx("div",{className:"flex gap-2 flex-wrap",children:(l.roles??[]).map(S=>e.jsx(A,{role:S.role,size:"md"},S.role))})},{key:"created_at",label:"Created",render:l=>e.jsx(V,{date:l.created_at}),className:"w-36 whitespace-nowrap"},...a?[{key:"actions",label:"",render:l=>e.jsxs(Z,{children:[e.jsx(R,{icon:te,title:"Edit user",onClick:()=>u(l)}),e.jsx(R,{icon:F,title:"Delete user",onClick:()=>v(l),colorClass:"text-text-tertiary hover:text-status-error"})]}),className:"w-16 text-right"}]:[]],g=()=>{p&&i.mutate(p.id,{onSuccess:()=>v(null)})};return e.jsxs("div",{children:[a&&e.jsx("div",{className:"flex justify-end mb-4",children:e.jsx("button",{onClick:()=>f(!0),className:"btn-primary text-xs",children:"Add User"})}),e.jsxs(Y,{children:[e.jsx(Q,{label:"Search",value:r.search,onChange:l=>t("search",l),placeholder:"name, email, id…"}),e.jsx(X,{label:"Status",value:r.status,onChange:l=>t("status",l),options:Ze})]}),e.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-[1fr_460px] gap-6 items-start",children:[e.jsxs("div",{className:"overflow-x-clip",children:[e.jsx(H,{columns:k,data:b,keyFn:l=>l.id,isLoading:y,emptyMessage:"No users found",onRowClick:l=>j(l),activeRowKey:(N==null?void 0:N.id)??null}),e.jsx(W,{page:n.page,totalPages:n.totalPages(o),onPageChange:n.setPage,total:o,pageSize:n.pageSize,onPageSizeChange:n.setPageSize})]}),e.jsx("div",{className:"sticky top-4",children:e.jsx(Qe,{user:N})})]}),e.jsx(Fe,{open:m,onClose:()=>f(!1)}),e.jsx(Me,{open:!!h,onClose:()=>u(null),user:h}),e.jsx(I,{open:!!p,onClose:()=>v(null),onConfirm:g,title:"Delete User",description:e.jsxs(e.Fragment,{children:["Delete"," ",e.jsx("span",{className:"font-medium text-text-primary",children:(p==null?void 0:p.display_name)||(p==null?void 0:p.external_id)}),"? This action cannot be undone."]}),isPending:i.isPending,error:i.error})]})}export{bt as UsersPage};
|
|
2
|
-
//# sourceMappingURL=index-B-Qpr29t.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as i,j as e}from"./vendor-query-RUZdMvN6.js";import{P as ye}from"./PageHeaderWithStats-D9tQxILm.js";import{F as we,b as ke}from"./FilterBar-CcIgQH9h.js";import{u as Ne}from"./useFilterParams-crmlBw_l.js";import{u as ve}from"./useNamespace-DMrjlrJJ.js";import{a as ee,u as Ce,b as $e,c as Se,d as _e}from"./controlplane-ClQiKGyQ.js";import{M as Te}from"./Modal-BU7No9NH.js";import{a6 as K,a_ as U,i as Ee,a$ as Z,aO as J,c as te,I as Re,Q as Me,aq as Pe,R as Ae,a0 as Le,b0 as We,v as Qe,Z as Fe,an as Oe}from"./vendor-icons-h-jlRSb9.js";import{C as I}from"./CollapsibleSection-D1WIbyDa.js";import{T as Be}from"./TaskQueuePill-DVgcqd-h.js";import{D as ze}from"./DataTable-DFPMeqyQ.js";import{C as W,j as Ie,J as Je}from"./index-CdavRyaX.js";import{R as De,a as Y}from"./RowActions-eYrzgQSj.js";import{f as Ue}from"./vendor-react-CdqEC2zv.js";import"./EmptyState-lpUFYfun.js";const Ve=[{label:"15m",value:"15m"},{label:"30m",value:"30m"},{label:"1h",value:"1h"},{label:"1d",value:"1d"},{label:"7d",value:"7d"}],se={pong:"text-status-success",ping:"text-accent",throttle:"text-status-warning",job:"text-purple-400",work:"text-text-secondary",activate:"text-status-error",cron:"text-text-tertiary",user:"text-text-secondary"},qe={pong:"roll call",ping:"ping",throttle:"throttle",job:"job",work:"work",activate:"activate",cron:"cron",user:"user"},He=250;function M(t){return!!t.worker_topic}function P(t){return typeof t.throttle=="number"&&t.throttle!==0}function V(t){return t===void 0||t===0?"Normal":t===-1?"Paused":t>=864e5?`${(t/864e5).toFixed(0)}d`:t>=36e5?`${(t/36e5).toFixed(1)}h`:t>=6e4?`${(t/6e4).toFixed(1)}m`:t>=1e3?`${(t/1e3).toFixed(1)}s`:`${t}ms`}function Ge(t){if(!t)return null;const s=t.match(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.(\d+)$/);if(s){const[,r,n,o,u,l,h,d]=s;return new Date(`${r}-${n}-${o}T${u}:${l}:${h}.${d}Z`)}const a=new Date(t);return isNaN(a.getTime())?null:a}function Ke(t){const s=Ge(t);if(!s)return"--";const a=Date.now()-s.getTime();if(a<0||isNaN(a))return"--";const r=Math.floor(a/1e3);if(r<60)return`${r}s`;const n=Math.floor(r/60);if(n<60)return`${n}m`;const o=Math.floor(n/60);return o<24?`${o}h ${n%60}m`:`${Math.floor(o/24)}d ${o%24}h`}function ne(t){return t.replace(/^hmsh:[^:]+:x:/,"")||"(engine)"}function F(t){const s=t.match(/^([^:]+)::(.+?)-[A-Za-z0-9_]{10,}$/);return s?s[2]:t.length>20?t.slice(0,20)+"...":t}function Ze(t){const s=t.match(/^([^:]+)::/);return(s==null?void 0:s[1])||""}const re=[{key:"pong",label:"Roll Call",description:"Node health check responses"},{key:"ping",label:"Ping",description:"Health check broadcasts"},{key:"throttle",label:"Throttle",description:"Throttle commands"},{key:"job",label:"Job",description:"Job lifecycle events"},{key:"work",label:"Work",description:"Worker dispatch events"},{key:"activate",label:"Activate",description:"Worker activation"},{key:"cron",label:"Cron",description:"Cron schedule triggers"},{key:"user",label:"User",description:"User-defined messages"}];function B(t){return`${t.engine_id}-${t.worker_topic||"engine"}`}function Ye(t){const s=new Map;for(const a of t){if(!a.worker_topic)continue;const r=a.worker_topic;s.has(r)||s.set(r,[]),s.get(r).push(a)}return s}function T(t){let s=0,a=0,r=0;for(const n of t)if(n.counts)for(const[o,u]of Object.entries(n.counts))s+=u,o==="200"?a+=u:o==="500"&&(r+=u);return{total:s,success:a,errors:r}}function Xe(t){let s=0;for(const a of t)typeof a.stream_depth=="number"&&(s+=a.stream_depth);return s}function et(t){if(t.length===0)return"healthy";if(t.every(r=>r.throttle===-1))return"paused";const{errors:a}=T(t);return a>0||t.some(P)?"degraded":"healthy"}function tt({activeAppId:t,allProfiles:s,profiles:a}){const r=ee(),[n,o]=i.useState(new Set),[u,l]=i.useState(!1),[h,d]=i.useState([]);i.useEffect(()=>{o(new Set)},[t]);const k=i.useCallback(m=>{o(C=>{const f=new Set(C),$=B(m);return f.has($)?f.delete($):f.add($),f})},[]),b=i.useCallback(()=>{n.size===a.length?o(new Set):o(new Set(a.map(B)))},[a,n.size]),j=i.useMemo(()=>{const m=a.filter(N=>n.has(B(N)));if(m.length===0)return[];if(m.length===s.length)return[{label:"Entire Mesh"}];const C=m.filter(N=>!M(N)),f=m.filter(M),$=[];for(const N of C)$.push({label:`Engine ${N.engine_id}`,guid:N.engine_id,scope:"engines"});const A=new Map;for(const N of f){const R=N.worker_topic;A.has(R)||A.set(R,[]),A.get(R).push(N)}for(const[N,R]of A){const O=s.filter(L=>L.worker_topic===N);if(R.length===O.length)$.push({label:N,topic:N});else for(const L of R)$.push({label:`${N} ${L.engine_id}`,guid:L.engine_id})}return $},[a,s,n]);return{selectedIds:n,setSelectedIds:o,toggleCheckbox:k,toggleAll:b,throttleModalOpen:u,throttleTargets:h,selectedThrottleTargets:j,throttleMutation:r,handleBulkThrottle:m=>{const C=h.length>0?h:j;for(const f of C)r.mutate({appId:t,throttle:m,...f.topic?{topic:f.topic}:{},...f.guid?{guid:f.guid}:{},...f.scope?{scope:f.scope}:{}});l(!1),d([])},handleRowClick:(m,C)=>{const f=M(m)?`${m.worker_topic} ${m.engine_id}`:`Engine ${m.engine_id}`;d([{label:f,guid:m.engine_id,scope:C||(M(m)?"workers":"engines")}]),l(!0)},handleBulkThrottleOpen:()=>{d(j),l(!0)},handleResumeThrottle:(m,C)=>{const f=C||(M(m)?"workers":"engines");r.mutate({appId:t,throttle:0,guid:m.engine_id,scope:f})},handleResumeQueue:m=>{r.mutate({appId:t,throttle:0,topic:m})},handleQueueThrottle:m=>{d([{label:m,topic:m}]),l(!0)},closeThrottleModal:()=>{l(!1),d([])}}}const st=[{label:"Resume",ms:0},{label:"0.5s",ms:500},{label:"1s",ms:1e3},{label:"5s",ms:5e3},{label:"30s",ms:3e4},{label:"Pause",ms:-1}];function nt({target:t}){const s=t.label==="Entire Mesh",a=t.label==="All Engines"||t.label.startsWith("Engine "),r=s?"bg-status-error/10 text-status-error":a?"bg-status-active/10 text-status-active":"bg-accent/[0.06] text-text-secondary",n=t.scope==="engines"?"engine only":t.scope==="workers"?"worker only":t.guid?"guid":t.topic?"topic":"mesh";return e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-2xs font-medium rounded-lg ${r}`,children:[t.label,e.jsx("span",{className:"text-2xs opacity-50",children:n})]})}function rt({open:t,onClose:s,targets:a,onApply:r,isPending:n}){const[o,u]=i.useState("");return e.jsx(Te,{open:t,onClose:s,title:"Adjust Throttle",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Targets"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map((l,h)=>e.jsx(nt,{target:l},l.guid||l.topic||h))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Presets"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:st.map(l=>e.jsx("button",{onClick:()=>r(l.ms),disabled:n,className:`px-3 py-1.5 text-xs rounded transition-colors ${l.ms===-1?"bg-status-error/10 text-status-error hover:bg-status-error/20":l.ms===0?"bg-status-success/10 text-status-success hover:bg-status-success/20":"bg-surface-sunken text-text-secondary hover:bg-surface-hover"} disabled:opacity-50`,children:l.label},l.label))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Custom delay (seconds)"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"number",step:"0.1",min:"0",value:o,onChange:l=>u(l.target.value),placeholder:"e.g. 2.5",className:"input text-xs py-1.5 px-3 w-28"}),e.jsx("button",{onClick:()=>{const l=parseFloat(o);isNaN(l)||l<0||r(Math.round(l*1e3))},disabled:n,className:"btn-primary text-xs py-1.5 px-4 disabled:opacity-50",children:"Apply"})]})]})]})})}function at(){const{data:t}=Ce(),s=ee(),[a,r]=i.useState(null),[n,o]=i.useState(!1),u=(t==null?void 0:t.apps)??[],l=i.useCallback(async(d,k="all")=>{if(u.length===0)return;o(!0);const b=await Promise.allSettled(u.map(v=>s.mutateAsync({appId:v.appId,throttle:d,...k!=="all"?{scope:k}:{}}))),j=b.filter(v=>v.status==="rejected").length;j>0&&console.error(`Emergency throttle: ${j}/${b.length} apps failed`),o(!1),r(null)},[u,s]),h=d=>d==="engines"?"engines":d==="workers"?"workers":"everything";return a?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-status-error",children:["Pause ",h(a.scope),"?"]}),e.jsx("button",{onClick:()=>l(a.ms,a.scope),disabled:n,className:"px-2.5 py-1 text-xs rounded-md bg-status-error text-text-inverse hover:bg-status-error/90 transition-colors disabled:opacity-50",children:n?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):"Confirm"}),e.jsx("button",{onClick:()=>r(null),disabled:n,className:"px-2.5 py-1 text-xs text-text-tertiary hover:text-text-primary transition-colors disabled:opacity-50",children:"Cancel"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>r({ms:-1,scope:"all"}),disabled:n,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md text-status-error/80 hover:text-status-error hover:bg-status-error/10 transition-colors disabled:opacity-50",title:"Pause all engines and workers",children:[e.jsx(U,{className:"w-3.5 h-3.5"}),"Pause All"]}),e.jsxs("button",{onClick:()=>l(0),disabled:n,className:"flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-md text-status-success/80 hover:text-status-success hover:bg-status-success/10 transition-colors disabled:opacity-50",title:"Resume all engines and workers",children:[n?e.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Ee,{className:"w-3.5 h-3.5"}),"Resume All"]})]})}function ot({byStream:t,onNodeFilter:s}){const[a,r]=i.useState(!1);if(i.useEffect(()=>{r(!1);const d=requestAnimationFrame(()=>r(!0));return()=>cancelAnimationFrame(d)},[t]),t.length===0)return e.jsx("p",{className:"text-xs text-text-tertiary py-4 text-center",children:"No activity in this period"});const n=t.filter(d=>d.stream_type==="engine"),o=t.filter(d=>d.stream_type==="worker"),u=Math.max(...t.map(d=>d.count)),l=d=>{const k=u>0?d.count/u*100:0,b=d.stream_type==="engine",j=b?"(all engines)":ne(d.stream_name),v=b?"bg-status-active/70":"bg-accent/60",y=b?"text-status-active":"text-text-tertiary";return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-2xs font-mono ${y} w-36 truncate text-right shrink-0`,title:d.stream_name,children:j}),e.jsx("div",{className:"flex-1 h-4 bg-surface-sunken rounded overflow-hidden",children:e.jsx("div",{className:`h-full ${v} rounded transition-all duration-500 ease-out`,style:{width:a?`${k}%`:"0%"}})}),e.jsx("span",{className:"text-2xs font-mono tabular-nums text-text-secondary w-12 text-right shrink-0",children:d.count.toLocaleString()})]},`${d.stream_type}-${d.stream_name}`)},h="text-2xs uppercase tracking-widest font-semibold mb-1 cursor-pointer hover:underline";return e.jsxs("div",{className:"space-y-1.5",children:[n.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:`${h} text-status-active/70 hover:text-status-active`,onClick:()=>s==null?void 0:s("engines"),children:"Engine Stream"}),n.map(l),o.length>0&&e.jsx("div",{className:"h-2"})]}),o.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:`${h} text-accent/70 hover:text-accent`,onClick:()=>s==null?void 0:s("workers"),children:"Worker Streams"}),o.map(l)]})]})}function lt({queue:t,workers:s,expanded:a,onToggle:r,onWorkerClick:n,onResumeThrottle:o,onQueueThrottle:u,onResumeQueue:l,byStream:h,activeDuration:d}){const k=i.useMemo(()=>{const c=h.find(g=>g.stream_type==="worker"&&ne(g.stream_name)===t);return(c==null?void 0:c.count)??0},[h,t]),b=i.useMemo(()=>et(s),[s]),j=i.useMemo(()=>Xe(s),[s]),{errors:v}=i.useMemo(()=>T(s),[s]),y=b==="paused"?"bg-status-error":b==="degraded"?"bg-status-warning":"bg-status-success",x=i.useMemo(()=>[...s].sort((c,g)=>T([g]).total-T([c]).total),[s]),w=i.useMemo(()=>[{key:"engine_id",label:"Router",render:c=>{var m;const g=c.engine_id.replace(/^[^:]+::/,"").replace(/-[A-Za-z0-9_]{10,}$/,"")||c.engine_id,E=((m=c.engine_id.match(/^([^:]+)::/))==null?void 0:m[1])||"";return e.jsxs("div",{className:"flex items-center gap-2",title:c.engine_id,children:[e.jsx("span",{className:"text-xs text-text-secondary truncate max-w-[180px]",children:g}),E&&e.jsx("span",{className:"text-2xs text-text-tertiary/50",children:E})]})}},{key:"processed",label:"Processed",render:c=>{const g=T([c]);return e.jsx("span",{className:"text-xs font-mono tabular-nums text-text-tertiary",children:g.total>0?g.total.toLocaleString():"--"})},className:"w-24"},{key:"throttle",label:"Throttle",render:c=>{const g=c.throttle;return g===-1?e.jsx("span",{className:"text-xs text-status-error font-medium",children:"Paused"}):g&&g>0?e.jsx("span",{className:"text-xs text-status-warning font-medium",children:V(g)}):e.jsx("span",{className:"text-xs text-text-tertiary",children:"0"})},className:"w-24"},{key:"actions",label:"",render:c=>e.jsxs(De,{children:[P(c)&&e.jsx(Y,{icon:Z,title:"Resume (remove throttle)",onClick:()=>o(c),colorClass:"text-text-tertiary hover:text-status-success"}),e.jsx(Y,{icon:J,title:"Adjust throttle",onClick:()=>n(c)})]}),className:"w-16"}],[n,o]);return e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>r(t),className:"group/row relative flex items-center gap-3 w-full py-2 hover:bg-surface-hover transition-colors text-left rounded",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${y}`,title:b}),e.jsx(te,{className:`w-3.5 h-3.5 text-text-tertiary/50 transition-transform duration-200 ${a?"rotate-90":""}`,strokeWidth:2}),e.jsx(Be,{queue:t,size:"sm"}),e.jsx("span",{className:"flex-1"}),v>0&&e.jsxs("span",{className:"text-2xs text-status-error font-medium mr-2",children:[v," errors"]}),j>0&&e.jsxs("span",{className:"flex items-center gap-1 text-2xs text-status-warning w-20",children:[e.jsx(Re,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"font-mono tabular-nums",children:j.toLocaleString()})]}),e.jsxs("span",{className:`flex items-center gap-1 text-xs w-24 ${s.some(P)?"text-status-warning":"text-text-tertiary"}`,children:[e.jsx(Me,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"font-mono tabular-nums",children:s.length}),e.jsx("span",{children:"workers"})]}),e.jsx("span",{className:"flex items-center gap-1 text-xs font-mono text-text-tertiary w-28 justify-end mr-16",children:k>0?e.jsxs(e.Fragment,{children:[e.jsx(Pe,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),k.toLocaleString()," in ",d]}):e.jsx("span",{className:"text-text-tertiary/40",children:"—"})}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 opacity-0 group-hover/row:opacity-100 transition-opacity flex items-center gap-2",children:[s.some(P)&&e.jsx(Z,{className:"w-4 h-4 text-text-tertiary hover:text-status-success",strokeWidth:1.5,onClick:c=>{c.stopPropagation(),l(t)}}),e.jsx(J,{className:"w-4 h-4 text-text-tertiary hover:text-accent",strokeWidth:1.5,onClick:c=>{c.stopPropagation(),u(t)}})]})]}),e.jsx(W,{open:a,children:e.jsx("div",{className:"ml-6",children:e.jsx(ze,{columns:w,data:x,keyFn:B,onRowClick:n,emptyMessage:"No workers",inline:!0})})})]})}let it=0;function ct(t){const s=t.data||{},a=s.topic?String(s.topic):"",r=s.guid?String(s.guid).slice(0,8):"";switch(t.type){case"pong":return a?`Worker ${r}... on "${a}" responded`:`Engine ${r}... responded`;case"ping":return"Roll call broadcast";case"throttle":{const n=s.throttle,o=a?`queue "${a}"`:r?`node ${r}...`:"all nodes";return`${V(n)} applied to ${o}`}case"job":return`Job ${r?r+"...":""} ${s.status||"updated"}`;case"work":return`Dispatched to "${a||"worker"}" ${r?"("+r+"...)":""}`;case"activate":return`Worker "${a||"unknown"}" activated`;case"cron":return`Cron triggered ${a?'"'+a+'"':""}`;default:return a||r||t.type}}function ut(t){const s=[];let a=0;for(;a<t.length;){const r=t[a];if(r.type==="pong"){let n=a+1;for(;n<t.length&&t[n].type==="pong";)n++;const o=t.slice(a,n);if(o.length>=3)s.push({kind:"group",type:"pong",count:o.length,firstTimestamp:o[o.length-1].timestamp,lastTimestamp:o[0].timestamp,events:o});else for(const u of o)s.push({kind:"single",event:u});a=n}else s.push({kind:"single",event:r}),a++}return s}function ae({event:t}){const[s,a]=i.useState(!1);return e.jsxs("div",{className:"border-b border-surface-border/50 last:border-b-0",children:[e.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-2 py-1.5 w-full text-left hover:bg-surface-hover/50 transition-colors",children:[e.jsx("span",{className:"text-2xs font-mono text-text-tertiary whitespace-nowrap tabular-nums shrink-0",children:new Date(t.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),e.jsx("span",{className:`text-2xs font-medium px-1 py-0.5 rounded ${se[t.type]||"text-text-tertiary"} bg-surface-sunken whitespace-nowrap shrink-0`,children:qe[t.type]||t.type}),e.jsx("span",{className:"text-2xs text-text-secondary flex-1 min-w-0 truncate",children:ct(t)}),e.jsx("svg",{className:`w-2.5 h-2.5 text-text-tertiary shrink-0 transition-transform duration-150 ${s?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),e.jsx(W,{open:s,children:e.jsx("div",{className:"pb-2",children:e.jsx(Je,{data:t.data})})})]})}function dt({group:t}){const[s,a]=i.useState(!1),r=t.events.filter(o=>{var u;return!((u=o.data)!=null&&u.topic)}).length,n=t.count-r;return e.jsxs("div",{className:"border-b border-surface-border/50 last:border-b-0",children:[e.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-2 py-1.5 w-full text-left hover:bg-surface-hover/50 transition-colors",children:[e.jsx("span",{className:"text-2xs font-mono text-text-tertiary whitespace-nowrap tabular-nums shrink-0",children:new Date(t.lastTimestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),e.jsx("span",{className:`text-2xs font-medium px-1 py-0.5 rounded ${se.pong} bg-surface-sunken whitespace-nowrap shrink-0`,children:"roll call"}),e.jsxs("span",{className:"text-2xs text-text-secondary flex-1 min-w-0 truncate",children:[t.count," nodes responded",r>0&&n>0?` (${r} engine${r!==1?"s":""}, ${n} worker${n!==1?"s":""})`:r>0?` (${r} engine${r!==1?"s":""})`:` (${n} worker${n!==1?"s":""})`]}),e.jsx("svg",{className:`w-2.5 h-2.5 text-text-tertiary shrink-0 transition-transform duration-150 ${s?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),e.jsx(W,{open:s,children:e.jsx("div",{className:"ml-4",children:t.events.map(o=>e.jsx(ae,{event:o},o.id))})})]})}function xt({channels:t,onToggle:s,customFilter:a,onCustomFilterChange:r}){return e.jsxs("div",{className:"space-y-3 pb-3 border-b border-surface-border mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Channels"}),e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Unchecked channels are dropped before buffering"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-1",children:re.map(n=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-0.5",children:[e.jsx("input",{type:"checkbox",checked:t.has(n.key),onChange:()=>s(n.key),className:"w-3 h-3 rounded border-border accent-accent"}),e.jsx("span",{className:"text-2xs text-text-secondary",title:n.description,children:n.label})]},n.key))}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Text Filter"}),e.jsx("input",{type:"text",value:a,onChange:n=>r(n.target.value),placeholder:"pong",className:"input text-2xs font-mono py-1 px-2 w-full"}),e.jsxs("p",{className:"text-2xs text-text-tertiary mt-1",children:["Filter by event type, e.g. ",e.jsx("span",{className:"font-mono",children:"pong"}),", ",e.jsx("span",{className:"font-mono",children:"throttle"}),", or any text in the event data."]})]})]})}function mt({bridgeActive:t}){const[s,a]=i.useState(!1),[r,n]=i.useState(!1),[o,u]=i.useState([]),[l,h]=i.useState(()=>new Set(re.map(x=>x.key))),[d,k]=i.useState(""),b=i.useRef(l);i.useEffect(()=>{b.current=l},[l]);const j=i.useRef(d);i.useEffect(()=>{j.current=d},[d]);const v=x=>{h(w=>{const c=new Set(w);return c.has(x)?c.delete(x):c.add(x),c})};Ie("lt.events.mesh.>",i.useCallback(x=>{var g;const w=((g=x.type)==null?void 0:g.replace("mesh.",""))||"unknown";if(!b.current.has(w))return;const c=j.current;c&&!`${w} ${JSON.stringify(x.data||x)}`.toLowerCase().includes(c.toLowerCase())||u(E=>[{id:++it,type:w,timestamp:x.timestamp||new Date().toISOString(),data:x.data||x},...E].slice(0,He))},[]));const y=()=>u([]);return e.jsxs("div",{className:"border-l border-surface-border pl-6 pt-4 min-h-[300px] sticky top-14 self-start max-h-[calc(100vh-8rem)] flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Event Stream"}),e.jsx(Ae,{className:`w-3 h-3 ${t?"text-status-success animate-pulse":"text-text-tertiary"}`}),e.jsx("span",{className:"text-2xs text-text-tertiary",children:t?"Live":"..."}),e.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[e.jsx("button",{onClick:()=>{a(x=>!x),n(!1)},className:`p-1 rounded transition-colors ${s?"text-accent bg-accent/10":"text-text-tertiary hover:text-text-primary"}`,title:"Configure channels",children:e.jsx(Le,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:()=>{n(x=>!x),a(!1)},className:`p-1 rounded transition-colors ${r?"text-accent bg-accent/10":"text-text-tertiary hover:text-text-primary"}`,title:"View raw JSON",children:e.jsx(We,{className:"w-3.5 h-3.5"})}),o.length>0&&e.jsx("button",{onClick:y,className:"p-1 rounded text-text-tertiary hover:text-text-primary transition-colors",title:"Clear events",children:e.jsx(Qe,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(W,{open:s,children:e.jsx(xt,{channels:l,onToggle:v,customFilter:d,onCustomFilterChange:k})}),e.jsx(W,{open:r,children:e.jsx("div",{className:"pb-3 border-b border-surface-border mb-3",children:e.jsx("pre",{className:"text-2xs font-mono text-text-tertiary bg-surface-sunken rounded-lg p-3 max-h-[50vh] overflow-auto whitespace-pre-wrap",children:JSON.stringify(o.slice(0,50),null,2)})})}),o.length>0&&e.jsxs("p",{className:"text-2xs text-text-tertiary mb-2",children:[o.length," events"]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:o.length===0?e.jsx("p",{className:"text-xs text-text-tertiary py-6 text-center",children:t?"Waiting for events...":"Subscribing..."}):ut(o).map((x,w)=>x.kind==="group"?e.jsx(dt,{group:x},`grp-${w}`):e.jsx(ae,{event:x.event},x.event.id))})]})}function ht(t){const s=[],a=[],r=[];for(const n of t)P(n)?r.push(n):n.is_scout||T([n]).total>0?s.push(n):a.push(n);return s.sort((n,o)=>n.is_scout&&!o.is_scout?-1:!n.is_scout&&o.is_scout?1:T([o]).total-T([n]).total),a.sort((n,o)=>F(n.engine_id).localeCompare(F(o.engine_id))),r.sort((n,o)=>F(n.engine_id).localeCompare(F(o.engine_id))),{active:s,idle:a,paused:r}}function D({engine:t,isFirst:s,onThrottle:a}){const r=F(t.engine_id),n=Ze(t.engine_id),o=T([t]),u=t.stream_depth??0,l=P(t);return e.jsxs("div",{className:"group/row flex items-center gap-3 py-2 hover:bg-surface-hover/50 transition-colors rounded px-1",children:[l?e.jsx(U,{className:"w-3.5 h-3.5 text-status-warning shrink-0",strokeWidth:1.5}):e.jsx(Fe,{className:`w-3.5 h-3.5 shrink-0 ${o.total>0||t.is_scout?"text-status-success":"text-text-tertiary/30"}`,strokeWidth:1.5}),e.jsx("span",{className:`${s?"text-base font-medium":"text-xs"} text-text-primary truncate max-w-[180px]`,title:t.engine_id,children:r}),n&&e.jsx("span",{className:"text-2xs text-text-tertiary/50",children:n}),t.is_scout&&e.jsx("span",{className:"text-2xs text-status-warning uppercase tracking-widest",children:"scout"}),e.jsx("span",{className:"flex-1"}),l&&e.jsx("span",{className:"text-2xs text-status-warning",children:t.throttle===-1?"Paused":V(t.throttle)}),o.total>0&&e.jsx("span",{className:"text-2xs font-mono tabular-nums text-text-tertiary w-16 text-right",children:o.total.toLocaleString()}),u>0&&e.jsxs("span",{className:`text-2xs font-mono tabular-nums w-14 text-right ${u>100?"text-status-warning":"text-text-tertiary/50"}`,children:[u.toLocaleString()," q"]}),e.jsx("span",{className:"text-2xs font-mono text-text-tertiary/40 w-12 text-right",children:Ke(t.inited)}),e.jsx("span",{className:"opacity-0 group-hover/row:opacity-100 transition-opacity",children:e.jsx("button",{onClick:h=>{h.stopPropagation(),a(t)},className:"text-text-tertiary hover:text-accent transition-colors",title:l?"Resume / adjust throttle":"Pause / throttle",children:e.jsx(J,{className:"w-3.5 h-3.5",strokeWidth:1.5})})})]})}function X({label:t,engines:s,onThrottle:a}){const[r,n]=i.useState(!1);return s.length===0?null:e.jsxs("div",{className:"mt-1",children:[e.jsxs("button",{onClick:()=>n(!r),className:"flex items-center gap-1.5 text-2xs text-text-tertiary hover:text-text-secondary transition-colors py-1",children:[e.jsx(te,{className:`w-3 h-3 transition-transform duration-200 ${r?"rotate-90":""}`,strokeWidth:2}),s.length," ",t]}),e.jsx(W,{open:r,children:e.jsx("div",{className:"ml-1",children:s.map(o=>e.jsx(D,{engine:o,onThrottle:a},o.engine_id))})})]})}function pt({engines:t,onThrottle:s,isLoading:a}){const{active:r,idle:n,paused:o}=i.useMemo(()=>ht(t),[t]);return a?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Discovering engines..."}):t.length===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:"No engines found."}):r.length===0&&n.length===0?e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 py-2",children:[e.jsx(U,{className:"w-4 h-4 text-status-error shrink-0",strokeWidth:1.5}),e.jsxs("span",{className:"text-base text-status-error font-medium",children:["All ",t.length," engines paused"]})]}),e.jsx("p",{className:"text-2xs text-text-tertiary ml-7",children:"Messages are accumulating. Resume at least one engine to restore processing."}),e.jsx("div",{className:"ml-1 mt-2",children:o.map(u=>e.jsx(D,{engine:u,onThrottle:s},u.engine_id))})]}):e.jsxs("div",{children:[r.map((u,l)=>e.jsx(D,{engine:u,isFirst:l===0,onThrottle:s},u.engine_id)),e.jsx(X,{label:"idle",engines:n,onThrottle:s}),e.jsx(X,{label:"paused",engines:o,onThrottle:s})]})}function gt({collapsed:t,toggleSection:s,activeDuration:a,streamStats:r,isLoading:n,queueMap:o,expandedQueues:u,toggleQueue:l,allQueuesExpanded:h,toggleAllQueues:d,handleRowClick:k,handleResumeThrottle:b,handleQueueThrottle:j,handleResumeQueue:v,engines:y,bridgeActive:x}){return e.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-[1fr_340px] gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-12 mt-10",children:[e.jsx(I,{title:`Message Volume (${a})`,sectionKey:"volume",isCollapsed:!!t.volume,onToggle:s,contentClassName:"mt-4 ml-7",children:e.jsx(ot,{byStream:(r==null?void 0:r.byStream)??[],onNodeFilter:()=>{},onQueueFilter:()=>{}})}),e.jsx(I,{title:`Engine Routers (${y.length})`,sectionKey:"engines",isCollapsed:!!t.engines,onToggle:s,contentClassName:"mt-4 ml-7",children:e.jsx(pt,{engines:y,onThrottle:k,isLoading:n})}),e.jsx(I,{title:"Worker Routers",sectionKey:"queues",isCollapsed:!!t.queues,onToggle:s,contentClassName:"mt-4 ml-7 flex flex-col gap-0",children:n?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Discovering mesh nodes..."}):o.size===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:'No worker routers found. Click "Roll Call" to discover.'}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-end mb-2",children:e.jsx("button",{onClick:d,className:"text-2xs text-accent hover:underline",children:h?"Collapse all":"Expand all"})}),[...o.entries()].sort(([w],[c])=>w.localeCompare(c)).map(([w,c])=>e.jsx(lt,{queue:w,workers:c,expanded:u.has(w),onToggle:l,onWorkerClick:k,onResumeThrottle:b,onQueueThrottle:j,onResumeQueue:v,byStream:(r==null?void 0:r.byStream)??[],activeDuration:a},w))]})})]}),e.jsx(mt,{bridgeActive:x})]})}function Mt(){const{namespace:t,available:s}=ve(),{filters:a,setFilter:r}=Ne({filters:{app_id:"",duration:"1h"}}),n=a.app_id||t,o=a.duration||"1h",u=$e(),l=6e4,{data:h,isLoading:d,error:k,refetch:b,isFetching:j}=Se(n,l),{data:v}=_e(n,o,void 0,l),y=i.useMemo(()=>[...(h==null?void 0:h.profiles)??[]].sort((S,_)=>{const z=S.worker_topic||S.stream||"",Q=_.worker_topic||_.stream||"";return!S.worker_topic&&_.worker_topic?-1:S.worker_topic&&!_.worker_topic?1:z.localeCompare(Q)}),[h==null?void 0:h.profiles]),x=i.useMemo(()=>y.filter(p=>!M(p)),[y]),w=i.useMemo(()=>y.filter(M),[y]),c=i.useMemo(()=>Ye(y),[y]),g=y.filter(P).length,E=i.useMemo(()=>{const p=new Set(s);return n&&p.add(n),[...p].sort().map(S=>({value:S,label:S}))},[s,n]),[m]=Ue(),C=m.get("queue"),[f,$]=i.useState(()=>C?new Set([C]):new Set),A=i.useCallback(p=>{$(S=>{const _=S.has(p),z=_?new Set:new Set([p]),Q=new URLSearchParams(window.location.search);_?Q.delete("queue"):Q.set("queue",p);const G=Q.toString();return window.history.pushState(null,"",`${window.location.pathname}${G?`?${G}`:""}`),z})},[]),N=c.size>0&&[...c.keys()].every(p=>f.has(p)),R=i.useCallback(()=>{$(N?new Set:new Set(c.keys()))},[N,c]),O="lt:controlplane:collapsed",[L,oe]=i.useState(()=>{try{const p=JSON.parse(localStorage.getItem(O)||"{}");return C&&(p.queues=!1),p}catch{return{}}}),le=i.useCallback(p=>{oe(S=>{const _={...S,[p]:!S[p]};return localStorage.setItem(O,JSON.stringify(_)),_})},[]),{throttleModalOpen:ie,throttleTargets:q,selectedThrottleTargets:ce,throttleMutation:ue,handleBulkThrottle:de,handleRowClick:xe,handleResumeThrottle:me,handleResumeQueue:he,handleQueueThrottle:pe,closeThrottleModal:ge}=tt({activeAppId:n,allProfiles:y,profiles:y}),fe=i.useMemo(()=>{const p=[{label:"Engines",value:x.length,dotClass:"bg-status-active"},{label:"Workers",value:w.length,dotClass:"bg-text-secondary"},{label:"Topics",value:c.size}];return g>0&&p.push({label:"Throttled",value:g,dotClass:"bg-status-warning"}),p},[x.length,w.length,c.size,g]),[H,be]=i.useState(!1),je=i.useCallback(()=>{u.mutate({appId:n},{onSuccess:()=>be(!0)})},[n,u]);return i.useEffect(()=>{!H&&n&&je()},[n]),e.jsxs("div",{children:[e.jsx(ye,{title:"Routers",docsHash:"#docs:dashboard.md:task-queues",stats:fe,actions:e.jsx(at,{})}),e.jsxs(we,{actions:e.jsx("div",{className:"flex items-center gap-1",children:Ve.map(p=>e.jsx("button",{onClick:()=>r("duration",p.value),className:`px-3 py-1 text-xs rounded-full transition-colors ${o===p.value?"bg-accent text-text-inverse":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:p.label},p.value))}),children:[e.jsx(ke,{label:"Application",value:a.app_id,onChange:p=>r("app_id",p),options:E}),e.jsxs("button",{onClick:()=>b(),disabled:j,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-tertiary hover:text-text-primary transition-colors disabled:opacity-50",children:[e.jsx(Oe,{className:`w-3.5 h-3.5 ${j?"animate-spin":""}`}),"Roll Call"]})]}),k&&e.jsx("div",{className:"mb-6 px-4 py-3 rounded bg-status-error/10 border border-status-error/20",children:e.jsx("p",{className:"text-xs text-status-error font-medium",children:k.message==="Session expired"?"Session expired — please log in again.":`Failed to load mesh data: ${k.message}`})}),e.jsx(gt,{collapsed:L,toggleSection:le,activeDuration:o,streamStats:v,isLoading:d,queueMap:c,expandedQueues:f,toggleQueue:A,allQueuesExpanded:N,toggleAllQueues:R,handleRowClick:xe,handleResumeThrottle:me,handleQueueThrottle:pe,handleResumeQueue:he,engines:x,bridgeActive:H}),e.jsx(rt,{open:ie,onClose:ge,targets:q.length>0?q:ce,onApply:de,isPending:ue.isPending})]})}export{Mt as ControlPlanePage};
|
|
2
|
-
//# sourceMappingURL=index-BLLK2mzy.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as d,j as s}from"./vendor-query-RUZdMvN6.js";import{g as F,h as C,e as u}from"./index-CdavRyaX.js";import{u as M,a as T,b as $,S as O,c as A,d as D,e as R}from"./StreamMessageDetail-Cq6AGhgJ.js";import{u as z}from"./useFilterParams-crmlBw_l.js";import{u as E}from"./useNamespace-DMrjlrJJ.js";import{b as L}from"./api-path-u2Jf9QXS.js";import{D as I}from"./DataTable-DFPMeqyQ.js";import{S as U}from"./StickyPagination-BWuKz8uB.js";import{F as q,b as x,a as _}from"./FilterBar-CcIgQH9h.js";import{P as B}from"./PageHeader-CFVw67M6.js";import{L as V}from"./ListToolbar-CLwSkmUH.js";import{X as H,$ as J}from"./vendor-icons-h-jlRSb9.js";import"./vendor-react-CdqEC2zv.js";import"./controlplane-ClQiKGyQ.js";import"./EmptyState-lpUFYfun.js";function W(l,n){if(l.length<=n)return l;const a=Math.floor((n-1)/2);return`${l.slice(0,a)}…${l.slice(-a)}`}function ce(){const{namespace:l,available:n}=E("namespace"),{filters:a,setFilter:t,pagination:r,sort:c,setSort:h}=z({filters:{namespace:"",source:"worker",status:"",stream_name:"",msg_type:"",topic:"",workflow_name:"",jid:"",aid:""}}),[m,g]=d.useState(null),v=d.useMemo(()=>n.map(e=>({value:e,label:e})),[n]),{data:i,isLoading:b,refetch:j,isFetching:w}=M({namespace:a.namespace||l,source:a.source||"worker",limit:r.pageSize,offset:r.offset,sort_by:c.sort_by||"created_at",order:c.order||"desc",status:a.status||void 0,stream_name:a.stream_name||void 0,msg_type:a.msg_type||void 0,topic:a.topic||void 0,workflow_name:a.workflow_name||void 0,jid:a.jid||void 0,aid:a.aid||void 0}),p=(i==null?void 0:i.messages)??[],f=(i==null?void 0:i.total)??0,o=d.useMemo(()=>m?p.find(e=>e.id===m.id&&e.source===m.source)??m:null,[p,m]),S=!!o,[k,N]=d.useState(null);d.useEffect(()=>{o&&N(o)},[o]);const y=o??k,P=[{key:"stream_name",label:"Stream",sortable:!0,render:e=>s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("span",{className:`w-2.5 h-2.5 shrink-0 rounded-full dot-ring ${D[e.status]}`,title:A[e.status]}),s.jsx("span",{className:"font-mono text-xs text-text-secondary truncate",title:e.stream_name,children:e.stream_name})]})},{key:"source",label:"Source",render:e=>s.jsx("span",{className:R,children:e.source}),className:"w-24"},{key:"created_at",label:"Created",sortable:!0,render:e=>s.jsx(u,{date:e.created_at,format:"relative",className:"text-xs text-text-secondary whitespace-nowrap"}),className:"w-32"},{key:"reserved_at",label:"Reserved",render:e=>e.reserved_at?s.jsx(u,{date:e.reserved_at,format:"relative",className:"text-xs text-text-secondary whitespace-nowrap"}):s.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-32"},{key:"expired_at",label:"Processed",render:e=>e.expired_at?s.jsx(u,{date:e.expired_at,format:"relative",className:"text-xs text-text-secondary whitespace-nowrap"}):s.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-32"},{key:"priority",label:"Pri",sortable:!0,render:e=>s.jsx("span",{className:"text-xs text-text-secondary",children:e.priority}),className:"w-14 text-right"},{key:"retry_attempt",label:"Retries",render:e=>s.jsxs("span",{className:"text-xs text-text-secondary whitespace-nowrap",children:[e.retry_attempt,"/",e.max_retry_attempts]}),className:"w-20"}];return s.jsxs("div",{className:"flex items-stretch min-w-0 -mt-10 -mr-10 -mb-16",children:[s.jsxs("div",{className:"flex-1 min-w-0 pt-10 pr-10",children:[s.jsx(B,{title:"Messages",docsHash:"#docs:dashboard.md:messages"}),s.jsxs(q,{actions:s.jsx(V,{onRefresh:()=>j(),isFetching:w,apiPath:L("/controlplane/stream-messages",{namespace:a.namespace||l,source:a.source||"worker",limit:r.pageSize,offset:r.offset,sort_by:c.sort_by||"created_at",order:c.order||"desc",status:a.status||void 0,stream_name:a.stream_name||void 0,msg_type:a.msg_type||void 0,topic:a.topic||void 0,workflow_name:a.workflow_name||void 0,jid:a.jid||void 0,aid:a.aid||void 0})}),children:[s.jsx(x,{label:"Namespace",value:a.namespace,onChange:e=>t("namespace",e),options:v,required:!0}),s.jsx(x,{label:"Source",value:a.source,onChange:e=>t("source",e),options:T,required:!0}),s.jsx(x,{label:"Status",value:a.status,onChange:e=>t("status",e),options:$}),s.jsx(_,{label:"Stream",value:a.stream_name,onChange:e=>t("stream_name",e),placeholder:"Filter by stream name…"}),s.jsx(_,{label:"Job ID",value:a.jid,onChange:e=>t("jid",e),placeholder:"Filter by jid…"}),[{key:"topic",label:"Topic",value:a.topic},{key:"workflow_name",label:"Workflow",value:a.workflow_name},{key:"aid",label:"Activity",value:a.aid},{key:"msg_type",label:"Type",value:a.msg_type}].filter(e=>e.value).map(e=>s.jsxs("button",{onClick:()=>t(e.key,""),className:"inline-flex items-center gap-1 px-2 py-0.5 text-2xs font-mono rounded-full bg-accent/15 text-accent hover:bg-accent/25 transition-colors",title:`Clear ${e.label} filter: ${e.value}`,children:[e.label,": ",W(e.value,12),s.jsx(H,{className:"w-2.5 h-2.5"})]},e.key))]}),s.jsx(I,{columns:P,data:p,keyFn:e=>`${e.source}:${e.id}`,isLoading:b,emptyMessage:"No stream messages found",onRowClick:e=>g(e),activeRowKey:o?`${o.source}:${o.id}`:null,sort:c,onSort:h,layout:"fixed"}),s.jsx(U,{page:r.page,totalPages:r.totalPages(f),onPageChange:r.setPage,total:f,pageSize:r.pageSize,onPageSizeChange:r.setPageSize})]}),s.jsx(F,{open:S,width:416,className:"self-stretch",children:s.jsx("div",{className:"h-full pl-4",children:s.jsx(C,{views:[{id:"detail",icon:J,label:"Message Detail",content:y?s.jsx(O,{message:y,filters:{onFilterStatus:e=>t("status",e),onFilterStreamName:e=>t("stream_name",e),onFilterMsgType:e=>t("msg_type",e),onFilterTopic:e=>t("topic",e),onFilterWorkflow:e=>t("workflow_name",e),onFilterJid:e=>t("jid",e),onFilterAid:e=>t("aid",e)}}):null}],activeId:"detail",onViewChange:()=>{},onClose:()=>g(null),stickyClassName:"sticky top-0 z-10 h-[calc(100vh-5.25rem)] pt-9"})})})]})}export{ce as StreamMessagesPage};
|
|
2
|
-
//# sourceMappingURL=index-BoQirCxt.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as k,u as R,b as O,j as e,a as d}from"./vendor-query-RUZdMvN6.js";import{P as F}from"./PageHeader-CFVw67M6.js";import{l as b}from"./index-CdavRyaX.js";import{M}from"./Modal-BU7No9NH.js";import{R as g,C}from"./constants-BHkpVaqx.js";import{aX as E,aH as T,aE as W,J as j,T as I,aq as D}from"./vendor-icons-h-jlRSb9.js";import"./vendor-react-CdqEC2zv.js";function $(){return R({queryKey:["maintenance"],queryFn:()=>b("/config/maintenance")})}function q(){const t=O();return k({mutationFn:r=>b("/config/maintenance",{method:"PUT",body:JSON.stringify(r)}),onSuccess:()=>{t.invalidateQueries({queryKey:["maintenance"]})}})}function _(){return k({mutationFn:t=>b("/dba/prune",{method:"POST",body:JSON.stringify(t)})})}function v({checked:t,onToggle:r,label:a,hint:s,safety:i,value:l,onChange:c}){const n=i==="safe"?W:i==="moderate"?E:T,o=i==="safe"?"text-status-success":i==="moderate"?"text-status-warning":"text-status-error",p=i==="safe"?"Safe":i==="moderate"?"Careful":"Permanent";return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer w-80 shrink-0",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:x=>r(x.target.checked),className:"w-4 h-4 rounded border-border accent-accent shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-text-primary",children:a}),e.jsxs("span",{className:`flex items-center gap-0.5 text-2xs ${o}`,children:[e.jsx(n,{className:"w-3 h-3",strokeWidth:1.5}),p]})]}),e.jsx("p",{className:"text-2xs text-text-tertiary",children:s})]})]}),e.jsx("select",{value:l,onChange:x=>c(x.target.value),disabled:!t,className:`select text-xs w-36 transition-opacity ${t?"":"opacity-40 cursor-not-allowed"}`,children:g.map(x=>e.jsx("option",{value:x.value,children:x.label},x.value))})]})}function L(){return e.jsxs("div",{className:"flex items-start gap-2 mt-2 px-3 py-2 rounded bg-surface-sunken",children:[e.jsx(j,{className:"w-3.5 h-3.5 text-text-tertiary shrink-0 mt-0.5"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"Stripping preserves workflow results and timeline data needed for the execution detail view. Transient jobs are internal bookkeeping that accumulates over time."})]})}const f={pruneJobs:!0,expire:"30 days",engineStreams:!0,engineStreamsExpire:"1 day",workerStreams:!0,workerStreamsExpire:"90 days",stripAttributes:!1,pruneTransient:!1};function N(t){return t.pruneJobs||t.engineStreams||t.workerStreams||t.stripAttributes||t.pruneTransient}function P({fields:t,onChange:r}){const a=(s,i)=>r({...t,[s]:i});return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Stream Messages"}),e.jsx("p",{className:"text-2xs text-text-tertiary mb-4",children:"Processed routing messages. Already consumed — safe to remove after a short retention window."}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(v,{checked:t.engineStreams,onToggle:s=>a("engineStreams",s),label:"Engine messages",hint:"Internal orchestration signals",safety:"safe",value:t.engineStreamsExpire,onChange:s=>a("engineStreamsExpire",s)}),e.jsx(v,{checked:t.workerStreams,onToggle:s=>a("workerStreams",s),label:"Worker messages",hint:"Activity dispatch and response payloads",safety:"safe",value:t.workerStreamsExpire,onChange:s=>a("workerStreamsExpire",s)})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Completed Workflows"}),e.jsx("p",{className:"text-2xs text-text-tertiary mb-4",children:"Choose how to handle completed workflow records. Reducing strips step-level detail but keeps the workflow and its results. Deleting removes the record entirely."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"flex items-start gap-2.5 cursor-pointer",children:[e.jsx("input",{type:"radio",name:"workflow-cleanup",checked:!t.stripAttributes&&!t.pruneJobs,onChange:()=>r({...t,stripAttributes:!1,pruneJobs:!1}),className:"w-4 h-4 mt-0.5 accent-accent shrink-0"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-text-primary",children:"Keep as-is"}),e.jsx("p",{className:"text-2xs text-text-tertiary",children:"No changes to completed workflow records."})]})]}),e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsxs("label",{className:"flex items-start gap-2.5 cursor-pointer w-80 shrink-0",children:[e.jsx("input",{type:"radio",name:"workflow-cleanup",checked:t.stripAttributes&&!t.pruneJobs,onChange:()=>r({...t,stripAttributes:!0,pruneJobs:!1}),className:"w-4 h-4 mt-0.5 accent-accent shrink-0"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-text-primary",children:"Reduce completed workflows"}),e.jsxs("span",{className:"flex items-center gap-0.5 text-2xs text-status-warning",children:[e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5}),"Careful"]})]}),e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Strips step-level execution detail (activity inputs/outputs, internal state). Workflow results and timeline are preserved."})]})]}),e.jsx("select",{value:t.expire,onChange:s=>a("expire",s.target.value),disabled:!t.stripAttributes||t.pruneJobs,className:`select text-xs w-36 transition-opacity mt-0.5 ${!t.stripAttributes||t.pruneJobs?"opacity-40 cursor-not-allowed":""}`,children:g.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))})]}),e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsxs("label",{className:"flex items-start gap-2.5 cursor-pointer w-80 shrink-0",children:[e.jsx("input",{type:"radio",name:"workflow-cleanup",checked:t.pruneJobs,onChange:()=>r({...t,pruneJobs:!0,stripAttributes:!1}),className:"w-4 h-4 mt-0.5 accent-accent shrink-0"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-text-primary",children:"Delete completed workflows"}),e.jsxs("span",{className:"flex items-center gap-0.5 text-2xs text-status-error",children:[e.jsx(T,{className:"w-3 h-3",strokeWidth:1.5}),"Permanent"]})]}),e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Permanently removes workflow records. Results, timeline, and all execution data are deleted and cannot be recovered."})]})]}),e.jsx("select",{value:t.expire,onChange:s=>a("expire",s.target.value),disabled:!t.pruneJobs,className:`select text-xs w-36 transition-opacity mt-0.5 ${t.pruneJobs?"":"opacity-40 cursor-not-allowed"}`,children:g.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))})]})]}),e.jsx(L,{})]})]})}function m({label:t,value:r}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-light text-text-primary",children:r.toLocaleString()}),e.jsx("p",{className:"text-2xs text-text-tertiary",children:t})]})}function H(){const t=_(),[r,a]=d.useState(f),[s,i]=d.useState(null),[l,c]=d.useState(!1),n=()=>{i(null),t.mutate({expire:r.expire,jobs:r.pruneJobs,engineStreams:r.engineStreams,engineStreamsExpire:r.engineStreamsExpire,workerStreams:r.workerStreams,workerStreamsExpire:r.workerStreamsExpire,attributes:r.stripAttributes,pruneTransient:r.pruneTransient},{onSuccess:o=>{i(o),c(!1)}})};return e.jsxs("div",{className:"space-y-8",children:[e.jsx(P,{fields:r,onChange:a}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-surface-border",children:[e.jsx("p",{className:"text-2xs text-text-tertiary",children:N(r)?"This action permanently deletes data and cannot be undone.":"Select at least one operation to enable pruning."}),e.jsx("button",{onClick:()=>c(!0),disabled:!N(r)||t.isPending,className:"bg-status-error text-text-inverse px-4 py-1.5 rounded-md text-xs hover:opacity-90 transition-opacity disabled:opacity-40 shrink-0",children:t.isPending?"Pruning...":"Prune Now"})]}),s&&e.jsxs("div",{className:"bg-surface-sunken rounded-md px-4 py-3",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Results"}),e.jsxs("div",{className:"flex flex-wrap gap-6",children:[s.jobs!=null&&s.jobs>0&&e.jsx(m,{label:"Jobs deleted",value:s.jobs}),s.engineStreams!=null&&s.engineStreams>0&&e.jsx(m,{label:"Engine streams",value:s.engineStreams}),s.workerStreams!=null&&s.workerStreams>0&&e.jsx(m,{label:"Worker streams",value:s.workerStreams}),s.streams!=null&&s.engineStreams==null&&s.streams>0&&e.jsx(m,{label:"Streams",value:s.streams}),s.attributes!=null&&s.attributes>0&&e.jsx(m,{label:"Artifacts stripped",value:s.attributes}),s.transient!=null&&s.transient>0&&e.jsx(m,{label:"Transient deleted",value:s.transient}),s.marked!=null&&s.marked>0&&e.jsx(m,{label:"Marked pruned",value:s.marked}),Object.values(s).every(o=>!o||o===0)&&e.jsx("p",{className:"text-xs text-text-tertiary",children:"Nothing to prune within the selected retention windows."})]})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsx(M,{open:l,onClose:()=>c(!1),title:"Confirm Prune",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-secondary",children:"This will permanently delete data. This action cannot be undone."}),e.jsxs("ul",{className:"text-xs text-text-secondary space-y-1 list-disc list-inside",children:[r.pruneJobs&&e.jsxs("li",{children:["Delete jobs older than ",r.expire]}),r.engineStreams&&e.jsxs("li",{children:["Delete engine streams older than ",r.engineStreamsExpire]}),r.workerStreams&&e.jsxs("li",{children:["Delete worker streams older than ",r.workerStreamsExpire]}),r.stripAttributes&&e.jsx("li",{children:"Strip execution artifacts from completed jobs"}),r.pruneTransient&&e.jsx("li",{children:"Delete transient (entity-less) jobs"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:()=>c(!1),className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:n,className:"bg-status-error text-text-inverse px-3 py-1.5 rounded-md text-xs hover:opacity-90 transition-opacity",disabled:t.isPending,children:t.isPending?"Pruning...":"Confirm Prune"})]})]})})]})}function w(t){var c;if(!((c=t==null?void 0:t.rules)!=null&&c.length))return f;const r=t.rules,a=r.find(n=>n.target==="streams"&&n.action==="delete"),s=r.find(n=>n.target==="jobs"&&n.action==="delete"&&n.hasEntity===!1),i=r.find(n=>n.target==="jobs"&&n.action==="prune"&&n.hasEntity===!0),l=r.find(n=>n.target==="jobs"&&n.action==="delete"&&n.pruned===!0);return{pruneJobs:!!l,expire:(l==null?void 0:l.olderThan)??"180 days",engineStreams:!!a,engineStreamsExpire:(a==null?void 0:a.olderThan)??"1 day",workerStreams:!!a,workerStreamsExpire:(a==null?void 0:a.olderThan)??"90 days",stripAttributes:!!i,pruneTransient:!!s}}function U(t){const r=[];return t.engineStreams&&r.push({target:"streams",action:"delete",olderThan:t.engineStreamsExpire}),t.workerStreams&&t.workerStreamsExpire!==t.engineStreamsExpire&&r.push({target:"streams",action:"delete",olderThan:t.workerStreamsExpire}),t.pruneTransient&&r.push({target:"jobs",action:"delete",olderThan:t.expire,hasEntity:!1}),t.stripAttributes&&r.push({target:"jobs",action:"prune",olderThan:t.expire,hasEntity:!0}),t.pruneJobs&&r.push({target:"jobs",action:"delete",olderThan:t.expire,pruned:!0}),r}function S(t){var r;return((r=C.find(a=>a.value===t))==null?void 0:r.label)??""}function K(){const{data:t,isLoading:r}=$(),a=q(),[s,i]=d.useState(""),[l,c]=d.useState(f),[n,o]=d.useState(""),p=d.useCallback(()=>{t!=null&&t.config&&(i(t.config.schedule),c(w(t.config)),o(JSON.stringify({schedule:t.config.schedule,fields:w(t.config)})))},[t]);d.useEffect(()=>{p()},[p]);const x=JSON.stringify({schedule:s,fields:l}),y=n!==""&&x!==n,h=(t==null?void 0:t.active)??!1,J=()=>{const u=U(l);a.mutate({schedule:s,rules:u},{onSuccess:()=>{o(JSON.stringify({schedule:s,fields:l}))}})},A=()=>{p()};return r?e.jsx("div",{className:"animate-pulse h-40 bg-surface-sunken rounded"}):e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-[1fr_auto] gap-10",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-4",children:"Schedule"}),e.jsxs("div",{className:"flex items-end gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs text-text-tertiary mb-1",children:"Cron Expression"}),e.jsx("input",{type:"text",value:s,onChange:u=>i(u.target.value),placeholder:"0 2 * * *",className:"input text-xs font-mono w-48"})]}),e.jsx("div",{children:e.jsxs("div",{className:"flex items-center gap-1.5 h-8",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring ${h?"bg-status-success":"bg-text-tertiary"}`}),e.jsx("span",{className:`text-xs ${h?"text-status-success":"text-text-tertiary"}`,children:h?"Active":"Inactive"})]})}),S(s)&&e.jsx("p",{className:"text-xs text-text-tertiary h-8 flex items-center",children:S(s)})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:C.map(u=>e.jsx("button",{type:"button",onClick:()=>i(u.value),className:`px-2.5 py-1 text-2xs rounded-full transition-colors ${s===u.value?"bg-accent/10 text-accent font-medium":"bg-surface-sunken text-text-tertiary hover:text-text-secondary"}`,children:u.label},u.value))})]}),e.jsxs("div",{className:"lg:w-72",children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-4",children:"How It Works"}),e.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 rounded bg-surface-sunken",children:[e.jsx(j,{className:"w-3.5 h-3.5 text-text-tertiary shrink-0 mt-0.5"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"Rules execute sequentially on each cron cycle. Engine streams can be pruned aggressively since they only contain internal routing data. Worker streams should be retained longer to preserve execution playback and input enrichment."})]})]})]}),e.jsx(P,{fields:l,onChange:c}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[y&&e.jsx("button",{onClick:A,className:"text-2xs text-text-tertiary hover:text-text-primary transition-colors",children:"Revert changes"}),a.error&&e.jsx("p",{className:"text-xs text-status-error",children:a.error.message})]}),e.jsx("button",{onClick:J,disabled:!y||!s.trim()||a.isPending,className:"btn-primary text-xs disabled:opacity-40 shrink-0",children:a.isPending?"Saving...":"Save Schedule"})]})]})}function Q({mode:t,onChange:r}){const a=(s,i,l)=>e.jsxs("button",{onClick:()=>r(s),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md transition-colors ${t===s?"bg-accent/10 text-accent font-medium":"text-text-tertiary hover:text-text-secondary hover:bg-surface-hover"}`,children:[i,l]});return e.jsxs("div",{className:"flex gap-1 p-0.5 bg-surface-sunken rounded-lg w-fit",children:[a("prune",e.jsx(I,{className:"w-3.5 h-3.5"}),"Prune Now"),a("schedule",e.jsx(D,{className:"w-3.5 h-3.5"}),"Schedule")]})}function ee(){const[t,r]=d.useState("schedule");return e.jsxs("div",{children:[e.jsx(F,{title:"DB Maintenance",docsHash:"#docs:dashboard.md:db-maintenance",actions:e.jsx(Q,{mode:t,onChange:r})}),e.jsxs("div",{className:"flex items-start gap-2 px-4 py-3 mb-8 rounded-md bg-accent/5 border border-accent/10",children:[e.jsx(j,{className:"w-4 h-4 text-accent shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-text-secondary leading-relaxed",children:"Workflow data grows as jobs complete. Operations are ordered safest-first: stream messages are always safe to prune, workflow reduction preserves results, and deletion is permanent."})]}),t==="prune"?e.jsx(H,{}):e.jsx(K,{})]})}export{ee as MaintenancePage};
|
|
2
|
-
//# sourceMappingURL=index-CG8oLNHo.js.map
|