@hotmeshio/long-tail 0.13.0 → 0.14.0
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/announcements.d.ts +22 -0
- package/build/api/announcements.js +96 -0
- package/build/api/auth-sso.d.ts +6 -3
- package/build/api/auth-sso.js +6 -3
- package/build/api/escalations/list.d.ts +8 -0
- package/build/api/escalations/list.js +14 -4
- package/build/api/index.d.ts +1 -0
- package/build/api/index.js +2 -1
- package/build/api/workflows/config.d.ts +1 -0
- package/build/api/workflows/config.js +1 -0
- package/build/api/workflows/discovery.js +1 -0
- package/build/lib/db/schemas/031_announcements.sql +30 -0
- package/build/lib/db/schemas/032_workflow_read_safe.sql +9 -0
- package/build/lib/events/publish.d.ts +15 -0
- package/build/lib/events/publish.js +22 -0
- package/build/modules/auth.js +9 -3
- package/build/routes/announcements.d.ts +2 -0
- package/build/routes/announcements.js +64 -0
- package/build/routes/auth-sso.js +6 -1
- package/build/routes/escalations/list.js +2 -0
- package/build/routes/index.js +2 -0
- package/build/services/announcement/index.d.ts +30 -0
- package/build/services/announcement/index.js +29 -0
- package/build/services/announcement/sql.d.ts +8 -0
- package/build/services/announcement/sql.js +24 -0
- package/build/services/config/cache.js +1 -0
- package/build/services/config/read.js +2 -0
- package/build/services/config/sql.d.ts +2 -2
- package/build/services/config/sql.js +6 -5
- package/build/services/config/write.js +5 -0
- package/build/services/scan-code/index.d.ts +1 -1
- package/build/services/scan-code/index.js +3 -1
- package/build/services/scan-code/sql.d.ts +7 -0
- package/build/services/scan-code/sql.js +55 -1
- package/build/services/scan-code/write.d.ts +8 -0
- package/build/services/scan-code/write.js +23 -1
- package/build/services/topics/system-topics.js +20 -0
- package/build/shared/form-validation/index.d.ts +1 -0
- package/build/shared/form-validation/index.js +1 -0
- package/build/shared/form-validation/validate-resolver-payload.d.ts +3 -0
- package/build/shared/form-validation/validate-resolver-payload.js +19 -0
- package/build/shared/form-validation/x-lt-labels.d.ts +17 -6
- package/build/shared/form-validation/x-lt-labels.js +12 -4
- package/build/shared/form-validation/x-lt-require-any.d.ts +22 -0
- package/build/shared/form-validation/x-lt-require-any.js +41 -0
- package/build/start/workers.js +50 -0
- package/build/system/mcp-servers/admin/announcements.d.ts +7 -0
- package/build/system/mcp-servers/admin/announcements.js +69 -0
- package/build/system/mcp-servers/admin/index.js +5 -3
- package/build/system/mcp-servers/admin/workflows.js +45 -0
- package/build/system/seed/tool-manifests-admin.d.ts +357 -0
- package/build/system/seed/tool-manifests-admin.js +3 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/auth.d.ts +21 -7
- package/build/types/config.d.ts +8 -0
- package/build/types/index.d.ts +1 -1
- package/build/types/startup.d.ts +57 -0
- package/dashboard/dist/assets/{AdminDashboard-D2unnS2b.js → AdminDashboard-DeZsR4pA.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-D2unnS2b.js.map → AdminDashboard-DeZsR4pA.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-CBkf403g.js → AgentConfigPage-Bi5ZAsjf.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-CBkf403g.js.map → AgentConfigPage-Bi5ZAsjf.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-CAIU3yzo.js → AgentDetailPage-CIbKor5E.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-CAIU3yzo.js.map → AgentDetailPage-CIbKor5E.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-qP9fWMyT.js → AgentsPage-CRFZ6KDu.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-qP9fWMyT.js.map → AgentsPage-CRFZ6KDu.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-DDsmXjpi.js +2 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-DDsmXjpi.js.map +1 -0
- package/dashboard/dist/assets/{BotPicker-BN-MKITV.js → BotPicker-dUpw1wW6.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-BN-MKITV.js.map → BotPicker-dUpw1wW6.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-CJfmWokN.js → CapabilitiesPage-Ca2jEln-.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-CJfmWokN.js.map → CapabilitiesPage-Ca2jEln-.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-BvMHlHyt.js → CollapsibleSection-BXlR5QmW.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-BvMHlHyt.js.map → CollapsibleSection-BXlR5QmW.js.map} +1 -1
- package/dashboard/dist/assets/CountdownTimer-rnoWmFqx.js +2 -0
- package/dashboard/dist/assets/CountdownTimer-rnoWmFqx.js.map +1 -0
- package/dashboard/dist/assets/{CredentialsPage-2TvvRwGJ.js → CredentialsPage-CGyCCzGh.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-2TvvRwGJ.js.map → CredentialsPage-CGyCCzGh.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-HxmsDSnV.js → CronLabel-CAu2hmQf.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-HxmsDSnV.js.map → CronLabel-CAu2hmQf.js.map} +1 -1
- package/dashboard/dist/assets/CustomDurationPicker-hlnadaFt.js +2 -0
- package/dashboard/dist/assets/CustomDurationPicker-hlnadaFt.js.map +1 -0
- package/dashboard/dist/assets/{ElapsedCell-BkRu9Xpd.js → ElapsedCell-B1eoCzEw.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-BkRu9Xpd.js.map → ElapsedCell-B1eoCzEw.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel--E6hLMCM.js → EntityTimelinePanel-CIOyjwjM.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel--E6hLMCM.js.map → EntityTimelinePanel-CIOyjwjM.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-CdFtqEEX.js → EscalationListSchemaPage-DQNQ7o_4.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-CdFtqEEX.js.map → EscalationListSchemaPage-DQNQ7o_4.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-BsjS2axz.js → EscalationSchemaPage-DFgDn4R3.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-BsjS2axz.js.map → EscalationSchemaPage-DFgDn4R3.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-FL-xteVc.js → EscalationsOverview-DfbKtXVZ.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-FL-xteVc.js.map → EscalationsOverview-DfbKtXVZ.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-BOcgZ78i.js → EventTable-CZPkvhao.js} +2 -2
- package/dashboard/dist/assets/{EventTable-BOcgZ78i.js.map → EventTable-CZPkvhao.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-DfCiCmm-.js → FilterBar-CYjKK9Cp.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-DfCiCmm-.js.map → FilterBar-CYjKK9Cp.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-DfVeiN-8.js → GraphInvokePage-DY9u42vt.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-DfVeiN-8.js.map → GraphInvokePage-DY9u42vt.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-C2IhF9WB.js → HomePage-p_CYlGnh.js} +2 -2
- package/dashboard/dist/assets/{HomePage-C2IhF9WB.js.map → HomePage-p_CYlGnh.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-DA0PTOl5.js → ListToolbar-Dz-1RXSH.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-DA0PTOl5.js.map → ListToolbar-Dz-1RXSH.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-DstPch5M.js → McpOverview-BUI9sVTk.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-DstPch5M.js.map → McpOverview-BUI9sVTk.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-Csv0PKE0.js → McpQueryDetailPage-CVN_UAB3.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-Csv0PKE0.js.map → McpQueryDetailPage-CVN_UAB3.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-DxmqCkly.js → McpQueryPage-DRTKSPDR.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-DxmqCkly.js.map → McpQueryPage-DRTKSPDR.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-CcJOlp_B.js → McpRunDetailPage-CTb1AxR3.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-CcJOlp_B.js.map → McpRunDetailPage-CTb1AxR3.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-BZCR043j.js → McpRunsPage-BWLwjVd0.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-BZCR043j.js.map → McpRunsPage-BWLwjVd0.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-DMsPXITh.js → OperationsPage-BSl_oUAJ.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-DMsPXITh.js.map → OperationsPage-BSl_oUAJ.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-DSloftQ5.js → OperatorDashboard-DGs9kPOZ.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-DSloftQ5.js.map → OperatorDashboard-DGs9kPOZ.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-jDVRCLbU.js → PersonaDetailPage-C33MgXUY.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-jDVRCLbU.js.map → PersonaDetailPage-C33MgXUY.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-DnDDwXoy.js → PersonasPage-BbLOHq5X.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-DnDDwXoy.js.map → PersonasPage-BbLOHq5X.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-CfAUU6q2.js → ProcessDetailPage-zwd0HCJl.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-CfAUU6q2.js.map → ProcessDetailPage-zwd0HCJl.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-CnAXzaVv.js → ProcessesListPage-DnfmK6jf.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-CnAXzaVv.js.map → ProcessesListPage-DnfmK6jf.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-Dg1p6Qz_.js → RoleDetailPage-axZtFPC_.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-Dg1p6Qz_.js.map → RoleDetailPage-axZtFPC_.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-DeRVQux8.js → RolesPage-DN6yqH7-.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-DeRVQux8.js.map → RolesPage-DN6yqH7-.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-BFNqQGuG.js → RunAsSelector-DrGsUhL8.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-BFNqQGuG.js.map → RunAsSelector-DrGsUhL8.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-D0GOdk5m.js → ScanCodesPage-BmQjEyWZ.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-D0GOdk5m.js.map → ScanCodesPage-BmQjEyWZ.js.map} +1 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-VODehqGs.js +2 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-VODehqGs.js.map +1 -0
- package/dashboard/dist/assets/{ScanStationPage-DH1ynTX9.js → ScanStationPage-Y-9Gs7t5.js} +2 -2
- package/dashboard/dist/assets/{ScanStationPage-DH1ynTX9.js.map → ScanStationPage-Y-9Gs7t5.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-B99hVu95.js → StickyPagination-9VkHiOsT.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-B99hVu95.js.map → StickyPagination-9VkHiOsT.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-DcDGISrv.js → StreamMessageDetail-C37J6Qyz.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-DcDGISrv.js.map → StreamMessageDetail-C37J6Qyz.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-BP3mSQAg.js → SwimlaneTimeline-NVGsBIX-.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-BP3mSQAg.js.map → SwimlaneTimeline-NVGsBIX-.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-_XWLJzt-.js → TaskDetailPage-5sbMHi5U.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-_XWLJzt-.js.map → TaskDetailPage-5sbMHi5U.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-iGriKiO2.js → TasksListPage-C9AN7IBb.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-iGriKiO2.js.map → TasksListPage-C9AN7IBb.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-BO33VeFl.js → TimeAgo-CsbQGlSd.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-BO33VeFl.js.map → TimeAgo-CsbQGlSd.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-KAjX7w35.js → TimestampCell-DlbIkV-G.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-KAjX7w35.js.map → TimestampCell-DlbIkV-G.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-BchG2yC6.js → ToolTestPanel-BKbLocvr.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-BchG2yC6.js.map → ToolTestPanel-BKbLocvr.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-BaK8H0o1.js → TopicDetailPage-fOnTfDso.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-BaK8H0o1.js.map → TopicDetailPage-fOnTfDso.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-DEyvm669.js → TopicsPage-BoVkp7DM.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-DEyvm669.js.map → TopicsPage-BoVkp7DM.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-BV6SKI9P.js → UserName-0gjVPU_U.js} +2 -2
- package/dashboard/dist/assets/{UserName-BV6SKI9P.js.map → UserName-0gjVPU_U.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-1sKoEFNC.js → WorkflowExecutionPage-B28OxTS_.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-1sKoEFNC.js.map → WorkflowExecutionPage-B28OxTS_.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-YTHDZZOD.js → WorkflowsDashboard-Bzvz6tTY.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-YTHDZZOD.js.map → WorkflowsDashboard-Bzvz6tTY.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-ucXPLTtm.js → WorkflowsOverview-BkcRU4Ej.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-ucXPLTtm.js.map → WorkflowsOverview-BkcRU4Ej.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-C_RTZKqZ.js → YamlWorkflowDetailPage-CmM78sYi.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-C_RTZKqZ.js.map → YamlWorkflowDetailPage-CmM78sYi.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-Usid3w2W.js → YamlWorkflowsPage-Dp6vG1au.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-Usid3w2W.js.map → YamlWorkflowsPage-Dp6vG1au.js.map} +1 -1
- package/dashboard/dist/assets/{agents-BTDsRK8e.js → agents-MeqzOPD6.js} +2 -2
- package/dashboard/dist/assets/{agents-BTDsRK8e.js.map → agents-MeqzOPD6.js.map} +1 -1
- package/dashboard/dist/assets/{bots-DxLrfdfr.js → bots-DTGXnvX_.js} +2 -2
- package/dashboard/dist/assets/{bots-DxLrfdfr.js.map → bots-DTGXnvX_.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-DbTmeW-S.js → capabilities-BjlARR7F.js} +2 -2
- package/dashboard/dist/assets/{capabilities-DbTmeW-S.js.map → capabilities-BjlARR7F.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-CEBntAL4.js → controlplane-DMYI0OaL.js} +2 -2
- package/dashboard/dist/assets/{controlplane-CEBntAL4.js.map → controlplane-DMYI0OaL.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-Carqdwoh.js → escalation-columns-BMO_H3cb.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-Carqdwoh.js.map → escalation-columns-BMO_H3cb.js.map} +1 -1
- package/dashboard/dist/assets/{index-De8iV1y2.js → index-3QEnMBNG.js} +2 -2
- package/dashboard/dist/assets/{index-De8iV1y2.js.map → index-3QEnMBNG.js.map} +1 -1
- package/dashboard/dist/assets/{index-Bqm4zu46.js → index-B3FzpDEG.js} +2 -2
- package/dashboard/dist/assets/{index-Bqm4zu46.js.map → index-B3FzpDEG.js.map} +1 -1
- package/dashboard/dist/assets/{index-cFHoANSG.css → index-B5jxf81r.css} +1 -1
- package/dashboard/dist/assets/{index-DBXm49S6.js → index-BU4oujVO.js} +30 -29
- package/dashboard/dist/assets/index-BU4oujVO.js.map +1 -0
- package/dashboard/dist/assets/{index-kes8V4Xw.js → index-CGCD5hTX.js} +2 -2
- package/dashboard/dist/assets/{index-kes8V4Xw.js.map → index-CGCD5hTX.js.map} +1 -1
- package/dashboard/dist/assets/{index-BhapT-Vl.js → index-Ch-OS1pk.js} +2 -2
- package/dashboard/dist/assets/{index-BhapT-Vl.js.map → index-Ch-OS1pk.js.map} +1 -1
- package/dashboard/dist/assets/{index-B9m7fA3M.js → index-CkkOh8y9.js} +2 -2
- package/dashboard/dist/assets/{index-B9m7fA3M.js.map → index-CkkOh8y9.js.map} +1 -1
- package/dashboard/dist/assets/{index-B2hz0pUh.js → index-D3iDAWK2.js} +2 -2
- package/dashboard/dist/assets/{index-B2hz0pUh.js.map → index-D3iDAWK2.js.map} +1 -1
- package/dashboard/dist/assets/{index-C0hSttF5.js → index-D6kXz3H8.js} +2 -2
- package/dashboard/dist/assets/{index-C0hSttF5.js.map → index-D6kXz3H8.js.map} +1 -1
- package/dashboard/dist/assets/{index-CVBBkW8V.js → index-Dsgqxdyh.js} +2 -2
- package/dashboard/dist/assets/{index-CVBBkW8V.js.map → index-Dsgqxdyh.js.map} +1 -1
- package/dashboard/dist/assets/{index-nwLh3CK2.js → index-DuhqzYwC.js} +2 -2
- package/dashboard/dist/assets/{index-nwLh3CK2.js.map → index-DuhqzYwC.js.map} +1 -1
- package/dashboard/dist/assets/{index-CDkg6iOE.js → index-DuyzcDuV.js} +2 -2
- package/dashboard/dist/assets/{index-CDkg6iOE.js.map → index-DuyzcDuV.js.map} +1 -1
- package/dashboard/dist/assets/index-LF1gEc6w.js +3 -0
- package/dashboard/dist/assets/index-LF1gEc6w.js.map +1 -0
- package/dashboard/dist/assets/{index-CgIBjZta.js → index-k5vcLICm.js} +2 -2
- package/dashboard/dist/assets/{index-CgIBjZta.js.map → index-k5vcLICm.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-oFYAanUp.js → knowledge-DAV1Jy7b.js} +2 -2
- package/dashboard/dist/assets/{knowledge-oFYAanUp.js.map → knowledge-DAV1Jy7b.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-C9Kw4Ow8.js → mcp-CivbxL1P.js} +2 -2
- package/dashboard/dist/assets/{mcp-C9Kw4Ow8.js.map → mcp-CivbxL1P.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-BwzpZ91Z.js → mcp-query-CGvWNrgo.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-BwzpZ91Z.js.map → mcp-query-CGvWNrgo.js.map} +1 -1
- package/dashboard/dist/assets/{personas-D5ehmtRb.js → personas-lI3aUr6t.js} +2 -2
- package/dashboard/dist/assets/{personas-D5ehmtRb.js.map → personas-lI3aUr6t.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-xgPKGEdD.js → pipelines-DjPfnTmx.js} +2 -2
- package/dashboard/dist/assets/{pipelines-xgPKGEdD.js.map → pipelines-DjPfnTmx.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-CLyrl-MU.js → tasks-Co_S55BO.js} +2 -2
- package/dashboard/dist/assets/{tasks-CLyrl-MU.js.map → tasks-Co_S55BO.js.map} +1 -1
- package/dashboard/dist/assets/{topics-B_gO7CQ0.js → topics-2IGhZXBi.js} +2 -2
- package/dashboard/dist/assets/{topics-B_gO7CQ0.js.map → topics-2IGhZXBi.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-BdWYm63U.js → useEventHooks-D0C5yke4.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-BdWYm63U.js.map → useEventHooks-D0C5yke4.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-C238M4Qn.js → useNamespace-LG52DTT-.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-C238M4Qn.js.map → useNamespace-LG52DTT-.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-B2ryEK4S.js → useYamlActivityEvents-1IZGVpWC.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-B2ryEK4S.js.map → useYamlActivityEvents-1IZGVpWC.js.map} +1 -1
- package/dashboard/dist/assets/{users-BFaTe6Mt.js → users-C-eHT1i6.js} +2 -2
- package/dashboard/dist/assets/{users-BFaTe6Mt.js.map → users-C-eHT1i6.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-DXz7tZxp.js → workflows-C16CeY4e.js} +2 -2
- package/dashboard/dist/assets/{workflows-DXz7tZxp.js.map → workflows-C16CeY4e.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-u3xuRAnS.js → yaml-workflows-BBenayT9.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-u3xuRAnS.js.map → yaml-workflows-BBenayT9.js.map} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/docs/auth.md +26 -1
- package/docs/code-owned-configuration.md +27 -0
- package/docs/dashboard.md +15 -0
- package/docs/hitl/x-lt-footer.md +16 -4
- package/docs/hitl/x-lt-validation.md +23 -0
- package/docs/mcp.md +2 -0
- package/docs/scan-codes.md +24 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-DvWaiafI.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-DvWaiafI.js.map +0 -1
- package/dashboard/dist/assets/CountdownTimer-By4rbMDN.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-By4rbMDN.js.map +0 -1
- package/dashboard/dist/assets/CustomDurationPicker-8Ao-1pKA.js +0 -2
- package/dashboard/dist/assets/CustomDurationPicker-8Ao-1pKA.js.map +0 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-vFqoe_P4.js +0 -2
- package/dashboard/dist/assets/ScanSchemeDetailPage-vFqoe_P4.js.map +0 -1
- package/dashboard/dist/assets/index-DBXm49S6.js.map +0 -1
- package/dashboard/dist/assets/index-DsgjFRvA.js +0 -3
- package/dashboard/dist/assets/index-DsgjFRvA.js.map +0 -1
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-BU4oujVO.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="./assets/vendor-query-RUZdMvN6.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="./assets/vendor-react-CdqEC2zv.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="./assets/vendor-icons-BPsNpK3Y.js">
|
|
15
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
15
|
+
<link rel="stylesheet" crossorigin href="./assets/index-B5jxf81r.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
package/docs/auth.md
CHANGED
|
@@ -231,9 +231,34 @@ Response 200:
|
|
|
231
231
|
}
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
+
### Host Session on the Exchange
|
|
235
|
+
|
|
236
|
+
The exchange is the session boundary between the host and Long Tail, and `resolve` receives the response handle there: `resolve(req, res)`. Hosts that own their session cookie set or refresh it inside `resolve` — headers only; Long Tail writes the response status and body after `resolve` returns.
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
auth: {
|
|
240
|
+
sso: {
|
|
241
|
+
keepaliveSeconds: 300,
|
|
242
|
+
resolve: (req, res) => {
|
|
243
|
+
const session = validateHostCookie(req);
|
|
244
|
+
if (!session) return null;
|
|
245
|
+
// Slide the host session on every exchange — login and each keepalive beat.
|
|
246
|
+
res?.setHeader('Set-Cookie', mintHostCookie(session));
|
|
247
|
+
return { externalId: session.userId, roles: session.roles };
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
With `keepaliveSeconds` set, the dashboard re-runs the exchange on a visibility- and idle-gated interval, so an active operator's host session slides exactly as it would under host-app navigation — hosts whose middleware slides on any request get this automatically, and cookie-minting hosts re-mint via `res`. Pair a sliding TTL with an absolute session max-age: a sliding-only session is otherwise extendable indefinitely.
|
|
254
|
+
|
|
255
|
+
A resolve that slides the session makes this endpoint a session-refresh surface — give it the same CSRF posture as your own refresh route. `SameSite=Lax` or `Strict` session cookies cover it (cross-site POSTs carry no cookie); a host running `SameSite=None` should verify `Origin` or `Sec-Fetch-Site` inside `resolve` before sliding.
|
|
256
|
+
|
|
257
|
+
`res` is present only on the explicit exchange (`POST /api/auth/sso`). The per-request fallback below calls `resolve(req)` without it, so ambient cookie-bearing API traffic — prefetches, background fetches — never slides the host session.
|
|
258
|
+
|
|
234
259
|
### requireAuth Fallback
|
|
235
260
|
|
|
236
|
-
When SSO is configured and a request arrives without a Bearer token, `requireAuth` calls `sso.resolve(req)` as a fallback. This allows direct API calls from the host backend (which forward cookies but not Bearer tokens) to authenticate without an explicit exchange. The dashboard always uses Bearer after the initial exchange.
|
|
261
|
+
When SSO is configured and a request arrives without a Bearer token, `requireAuth` calls `sso.resolve(req)` as a fallback. This allows direct API calls from the host backend (which forward cookies but not Bearer tokens) to authenticate without an explicit exchange. The dashboard always uses Bearer after the initial exchange. The fallback never passes `res` — session sliding belongs exclusively to the exchange.
|
|
237
262
|
|
|
238
263
|
### Role Mapping
|
|
239
264
|
|
|
@@ -63,6 +63,7 @@ The domain dictionary's override lives beside its path:
|
|
|
63
63
|
| MCP servers | `mcp.serverFactories[].config` | description, tags, category, compile hints, credential providers | tool manifest, connection status |
|
|
64
64
|
| Agents | `agents[]` | description, status, goals, rules, domain, schedules | capabilities, metadata, run history |
|
|
65
65
|
| Agent subscriptions | `agents[].subscriptions` | reaction fields on (agent, topic) | `enabled` — the admin kill-switch |
|
|
66
|
+
| Scan schemes | `scanSchemes[]` | whole scheme + its rules (one ownership unit; `enabled` is declarative here) | — |
|
|
66
67
|
| Domain dictionary | `mcp.domainDictionaryPath` | whole document (version bumps once per change) | — |
|
|
67
68
|
| Graph workflows | `graphWorkflows[]` | always compare-and-apply: description/schema sync, redeploy on YAML version bump | run history |
|
|
68
69
|
|
|
@@ -105,6 +106,32 @@ render keep working while new escalations pick up the new shape. Version
|
|
|
105
106
|
lineage only grows — an apply never rewinds or rewrites an existing version.
|
|
106
107
|
`list_schema` versions independently, exactly as it does from the dashboard.
|
|
107
108
|
|
|
109
|
+
## Scan schemes: scheme + rules as one unit
|
|
110
|
+
|
|
111
|
+
A scan scheme and its rules declare together — a rule cannot exist without its
|
|
112
|
+
scheme, so the pair is the ownership unit and one `reset` covers both:
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
scanSchemes: [
|
|
116
|
+
{
|
|
117
|
+
version: 12,
|
|
118
|
+
name: 'Serial locate',
|
|
119
|
+
target_facet: 'serialNumber',
|
|
120
|
+
encoding: 'fixed',
|
|
121
|
+
target_length: 8,
|
|
122
|
+
rules: [
|
|
123
|
+
{ category: '1', name: 'Locate', steps: [{ verb: 'show-detail' }] },
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The scheme applies before its rules so rule validation sees the scheme's kind.
|
|
130
|
+
Rules present in the database but absent from a code-owned scheme's
|
|
131
|
+
declaration are reported as `version/category` orphans. The pass runs whether
|
|
132
|
+
or not the dashboard scan affordances (`features.scanCodes`) are enabled —
|
|
133
|
+
declaring schemes states intent.
|
|
134
|
+
|
|
108
135
|
## The boot report
|
|
109
136
|
|
|
110
137
|
Each surface logs one line summarizing its pass:
|
package/docs/dashboard.md
CHANGED
|
@@ -445,6 +445,21 @@ Credentials flow through the system via the `_scope` identity context — workfl
|
|
|
445
445
|
|
|
446
446
|
## Global Features
|
|
447
447
|
|
|
448
|
+
### Announcements
|
|
449
|
+
|
|
450
|
+
A full-width notice line under the header carries published announcements —
|
|
451
|
+
maintenance windows, shift notes, anything the floor should read. Role
|
|
452
|
+
managers (superadmin, admin, engineer) publish through
|
|
453
|
+
`POST /api/announcements` or the `publish_announcement` admin tool; only the
|
|
454
|
+
markdown body is required, and title, layout, role targeting, and expiry
|
|
455
|
+
(default 24 hours) fill in. Connected dashboards show a new announcement live
|
|
456
|
+
over the `system.surfaces.dashboard` event; everyone else sees it on their
|
|
457
|
+
next load. The collapsed line shows the headline; expanding renders the
|
|
458
|
+
markdown body. Each user dismisses per-browser.
|
|
459
|
+
|
|
460
|
+
Role targeting scopes display, never access: the live event reaches every
|
|
461
|
+
authenticated subscriber, so announcement bodies must never carry secrets.
|
|
462
|
+
|
|
448
463
|
### Inbox
|
|
449
464
|
|
|
450
465
|
The Inbox icon in the header shows a badge count when the current user has pending escalations assigned to their roles. The count updates live via NATS — no polling needed.
|
package/docs/hitl/x-lt-footer.md
CHANGED
|
@@ -21,7 +21,7 @@ to render in their place:
|
|
|
21
21
|
| Target | Default | Control |
|
|
22
22
|
|--------|---------|---------|
|
|
23
23
|
| `claim` | Claim | The claim button (unclaimed). |
|
|
24
|
-
| `cancel` | Cancel / Cancel escalation | The cancel control, both states. |
|
|
24
|
+
| `cancel` | Cancel / Cancel escalation | The cancel control, both states. A string renames it; `false` removes it from both footer states. |
|
|
25
25
|
| `submit` | Submit / Acknowledge | The resolve button (claimed). |
|
|
26
26
|
| `release` | Release | The release tab. |
|
|
27
27
|
|
|
@@ -34,9 +34,21 @@ to render in their place:
|
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
Only the known targets are read; unknown keys and non-string values are
|
|
37
|
-
ignored
|
|
38
|
-
|
|
39
|
-
("Claiming…", "Send to
|
|
37
|
+
ignored — except `cancel: false`, the hide instruction. Any target the schema
|
|
38
|
+
omits keeps its default, so a schema overrides just the controls it cares
|
|
39
|
+
about. The pending, triage, and confirmation states ("Claiming…", "Send to
|
|
40
|
+
Triage", "Yes, Release") keep their own copy.
|
|
41
|
+
|
|
42
|
+
Roles whose process routes work onward rather than discarding it hide the
|
|
43
|
+
cancel control and rename the actions that remain — an escalate-only surface
|
|
44
|
+
declares `{ "cancel": false, "submit": "Send to Service" }` so the footer
|
|
45
|
+
offers exactly the verbs the process means.
|
|
46
|
+
|
|
47
|
+
The confirmation challenge speaks whatever the control says: one template
|
|
48
|
+
carries any vocabulary — the modal titles with the label, asks "Are you sure
|
|
49
|
+
you want to Send to Service? This removes the item from the work queue," and
|
|
50
|
+
confirms with "Yes, Send to Service". The default label follows the same
|
|
51
|
+
shape with "Cancel".
|
|
40
52
|
|
|
41
53
|
## `x-lt-submit-on-claim` — the one-gesture claim
|
|
42
54
|
|
|
@@ -120,6 +120,29 @@ On a blocked submit, each unchecked mandatory item highlights red inline, and th
|
|
|
120
120
|
|
|
121
121
|
---
|
|
122
122
|
|
|
123
|
+
## Require Any of a Set (`x-lt-require-any`)
|
|
124
|
+
|
|
125
|
+
A schema root can require a value in **at least one** field of a group — the either/or form where a Left quantity or a Right quantity satisfies, but blank-both fails:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"x-lt-require-any": [["left_quantity", "right_quantity"]],
|
|
130
|
+
"properties": {
|
|
131
|
+
"left_quantity": { "type": "number", "title": "Left Quantity" },
|
|
132
|
+
"right_quantity": { "type": "number", "title": "Right Quantity" }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The token is an array of groups; each group is an array of property names and enforces independently. A group passes when any member carries a value: `false` and `0` are answers; empty string, null, and undefined are not.
|
|
138
|
+
|
|
139
|
+
- Visibility composes: a member hidden by `x-lt-showIf` (or naming no schema property) can neither satisfy the group nor be demanded of the submitter, and a group whose members are all hidden is waived.
|
|
140
|
+
- An unsatisfied group yields one violation on the group's first visible field: `Enter a value for at least one of: Left Quantity, Right Quantity` (member titles, falling back to keys).
|
|
141
|
+
- Composes with `required`: a field listed in `required` must be filled regardless; the group check is the softer at-least-one layered on top.
|
|
142
|
+
- The same pass runs on both sides of the wire — the dashboard panel blocks the submit, and an enforced role's server gate rejects a violating payload with the canonical 422.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
123
146
|
## Pattern Guard
|
|
124
147
|
|
|
125
148
|
Apply a regular expression guard with `pattern`. If the input does not match, the field blocks submission. Provide `x-lt-pattern-error` for a human-readable error message; otherwise the generic "Invalid format" is shown.
|
package/docs/mcp.md
CHANGED
|
@@ -172,6 +172,8 @@ Put plainly: **scope is which tools, role is which records.** A read key answers
|
|
|
172
172
|
|
|
173
173
|
Creating an escalation shows both at work. `escalate_to_human` changes state, so the key needs `mcp:full`, and the account needs a role allowed to route to that queue. Reading the same queue back — `get_available_work`, `check_resolution` — needs only `mcp:read`. The rule holds for every tool: reading is cheap to grant, writing is deliberate.
|
|
174
174
|
|
|
175
|
+
**Read-safe workflow invocation.** A workflow registered with `read_safe: true` in its config (a side-effect-free lookup) is invocable by read-scoped callers through `invoke_workflow_read_safe` — the read-safe variant of `invoke_workflow`. Any workflow may be attempted; one without the flag fails with a clear error, so the flag on the config is the whole contract. Declare it on the worker profile (`readSafe: true`) or set it through the workflow-config admin surface; the flag is fail-closed and defaults off.
|
|
176
|
+
|
|
175
177
|
### 1. Create a service account
|
|
176
178
|
|
|
177
179
|
In the dashboard: **Admin → Bot Accounts → Create**, assign the role(s) the account should act under, then generate an API key and choose its scope — `mcp:read` for an investigator, `mcp:full` for an operator that also makes changes. The raw key is shown once. The same is available as admin tools: `create_bot_account`, then `create_bot_api_key`.
|
package/docs/scan-codes.md
CHANGED
|
@@ -360,6 +360,30 @@ The same CRUD rides `PUT/GET/DELETE /api/scan-codes/schemes/:version[/actions/:c
|
|
|
360
360
|
rules fail the write with the exact problem — an `escalate` step names its
|
|
361
361
|
`targetRole`, a `resolve` step carries its payload.
|
|
362
362
|
|
|
363
|
+
## Declaring schemes in code
|
|
364
|
+
|
|
365
|
+
Schemes and their rules declare on `LTStartConfig.scanSchemes` and follow the
|
|
366
|
+
[code-owned configuration](code-owned-configuration.md) contract: under
|
|
367
|
+
`configSource: 'code'` a changed scheme or rule in code is live after the next
|
|
368
|
+
boot on every environment; under `'db'` (the default) the declaration seeds
|
|
369
|
+
once and the admin surfaces own it afterward. Per-entry `reset` overrides the
|
|
370
|
+
dial in either direction, covering the scheme and its rules together.
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
scanSchemes: [
|
|
374
|
+
{
|
|
375
|
+
version: 12,
|
|
376
|
+
name: 'Serial locate',
|
|
377
|
+
target_facet: 'serialNumber',
|
|
378
|
+
encoding: 'fixed',
|
|
379
|
+
target_length: 8,
|
|
380
|
+
rules: [
|
|
381
|
+
{ category: '1', name: 'Locate', steps: [{ verb: 'show-detail' }] },
|
|
382
|
+
],
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
```
|
|
386
|
+
|
|
363
387
|
## The printer demo
|
|
364
388
|
|
|
365
389
|
The example seed (`examples/seed-scan-codes.ts`) configures scheme 10 over
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,a as f}from"./vendor-query-RUZdMvN6.js";import{u as Tt,l as Ot,m as Ke,n as Be,p as Et,w as Ft,o as _t,q as $t,r as Lt,s as Bt,t as Rt,v as zt,x as qt,y as Dt,i as It,z as Ut,A as Vt,B as Gt,E as Ht,G as Qt,H as Jt,I as Kt,K as Wt,L as Xt,M as Yt,O as Zt,Q as es,R as ts}from"./index-DBXm49S6.js";import{i as ss}from"./task-queues-7-sHKPsN.js";import{f as as}from"./useEventHooks-BdWYm63U.js";import{X as te,ag as ns,ah as rs,C as is,b as ls,ai as os,aj as cs,t as ds,s as us,ak as xs,B as ms,al as Re,am as hs,Q as ps,P as fs,g as gs,an as bs}from"./vendor-icons-BPsNpK3Y.js";import{u as pe,C as We,a as ys}from"./CustomDurationPicker-8Ao-1pKA.js";import{m as js,E as vs,a as Ns}from"./escalation-columns-Carqdwoh.js";import{i as Cs,E as ks}from"./CountdownTimer-By4rbMDN.js";import{u as ws}from"./useFilterParams-crmlBw_l.js";import{u as Xe}from"./useDebouncedValue-C4P2jQuh.js";import{b as Ss}from"./api-path-u2Jf9QXS.js";import{D as Ps}from"./DataTable-Bir0Xs1p.js";import{S as Ms}from"./StickyPagination-B99hVu95.js";import{P as As}from"./constants-BHkpVaqx.js";import{M as fe}from"./Modal-BU7No9NH.js";import{u as Ts}from"./users-BFaTe6Mt.js";import{R as Os,a as Es}from"./RowActions-eYrzgQSj.js";import{L as Fs}from"./ListToolbar-DA0PTOl5.js";import{L as ze,u as _s,f as $s,a as Ls}from"./vendor-react-CdqEC2zv.js";import"./EntityTimelinePanel--E6hLMCM.js";import"./FilterBar-DfCiCmm-.js";import"./PriorityBadge-BETdj4M-.js";import"./RolePill-EocCXZh0.js";import"./WorkflowPill-BcA7S3gI.js";import"./StatusBadge-DkgllZHv.js";import"./EmptyState-lpUFYfun.js";const Bs=["<","<=",">",">=","="],Rs=["priority","created_at","updated_at","status","role"],z="input text-xs py-1",qe="select text-xs py-1",Z="text-text-tertiary hover:text-text-primary transition-colors";function De(t){return t==="true"?!0:t==="false"?!1:t.trim()!==""&&!Number.isNaN(Number(t))?Number(t):t}const zs=t=>Object.entries(t??{}).map(([s,l])=>({key:s,value:String(l)})),qs=t=>(t??[]).map(s=>{const[l,i]=Object.entries(s)[0]??["",""];return{key:l,value:String(i)}});function R({title:t,hint:s,children:l}){return e.jsxs("div",{className:"border-t border-surface-border/50 py-3 first:border-t-0 first:pt-1",children:[e.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between",children:[e.jsx("span",{className:"text-2xs font-medium uppercase tracking-wide text-text-tertiary",children:t}),s&&e.jsx("span",{className:"text-2xs font-mono text-text-tertiary/70",children:s})]}),l]})}function ee({value:t,onChange:s,placeholder:l}){return e.jsx("input",{list:"lt-facet-keys",className:`${z} w-40`,placeholder:l,value:t,onChange:i=>s(i.target.value)})}function Ds({value:t,onChange:s,facetKeys:l=[],search:i="",onSearchChange:p}){const m=zs(t.facets),h=qs(t.block),d=t.range??[],x=t.exists??[],g=t.orderBy??[],C=r=>{const u={};for(const o of r)o.key&&(u[o.key]=De(o.value));s({...t,facets:Object.keys(u).length?u:void 0})},S=r=>{const u=r.filter(o=>o.key).map(o=>({[o.key]:De(o.value)}));s({...t,block:u.length?u:void 0})},P=r=>s({...t,range:r.length?r:void 0}),j=r=>s({...t,exists:r.length?r:void 0}),k=r=>s({...t,orderBy:r.length?r:void 0});return e.jsxs("div",{className:"text-xs",children:[e.jsx("datalist",{id:"lt-facet-keys",children:l.map(r=>e.jsx("option",{value:r},r))}),e.jsxs("datalist",{id:"lt-sort-fields",children:[Rs.map(r=>e.jsx("option",{value:r},r)),l.map(r=>e.jsx("option",{value:`metadata.${r}`},r))]}),p&&e.jsx(R,{title:"Match id",hint:"id · workflow · origin",children:e.jsx("input",{className:`${z} w-full`,placeholder:"Exact escalation, workflow, or origin id…",value:i,onChange:r=>p(r.target.value)})}),e.jsx(R,{title:"Has facet",hint:"metadata @>",children:[...m,{key:"",value:""}].map((r,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:r.key,placeholder:"key",onChange:o=>{const c=[...m];c[u]={...r,key:o},C(c)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${z} w-40`,placeholder:"value",value:r.value,onChange:o=>{const c=[...m];c[u]={...r,value:o.target.value},C(c)}}),u<m.length&&e.jsx("button",{className:Z,onClick:()=>C(m.filter((o,c)=>c!==u)),children:"×"})]},u))}),e.jsx(R,{title:"Range",hint:"numeric",children:[...d,{facet:"",op:"<=",value:0}].map((r,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:r.facet,placeholder:"numeric facet",onChange:o=>{const c=[...d];c[u]={...r,facet:o},P(c.filter(a=>a.facet))}}),e.jsx("select",{className:qe,value:r.op,onChange:o=>{const c=[...d];c[u]={...r,op:o.target.value},P(c.filter(a=>a.facet))},children:Bs.map(o=>e.jsx("option",{value:o,children:o},o))}),e.jsx("input",{type:"number",className:`${z} w-24`,value:r.value,onChange:o=>{const c=[...d];c[u]={...r,value:Number(o.target.value)},P(c.filter(a=>a.facet))}}),u<d.length&&e.jsx("button",{className:Z,onClick:()=>P(d.filter((o,c)=>c!==u)),children:"×"})]},u))}),e.jsx(R,{title:"Has key",hint:"metadata ? key",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[x.map(r=>e.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent/15 px-1.5 py-0.5 text-accent",children:[r,e.jsx("button",{className:"text-accent/70 hover:text-accent",onClick:()=>j(x.filter(u=>u!==r)),children:"×"})]},r)),e.jsx(ee,{value:"",placeholder:"+ key",onChange:r=>{r&&!x.includes(r)&&j([...x,r])}})]})}),e.jsx(R,{title:"Exclude",hint:"NOT @>",children:[...h,{key:"",value:""}].map((r,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:r.key,placeholder:"key",onChange:o=>{const c=[...h];c[u]={...r,key:o},S(c)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${z} w-40`,placeholder:"value",value:r.value,onChange:o=>{const c=[...h];c[u]={...r,value:o.target.value},S(c)}}),u<h.length&&e.jsx("button",{className:Z,onClick:()=>S(h.filter((o,c)=>c!==u)),children:"×"})]},u))}),e.jsx(R,{title:"Sort by",children:[...g,{field:"",direction:"asc"}].map((r,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx("input",{list:"lt-sort-fields",className:`${z} w-44`,placeholder:"column or metadata.key",value:r.field,onChange:o=>{const c=[...g];c[u]={...r,field:o.target.value},k(c.filter(a=>a.field))}}),e.jsxs("select",{className:qe,value:r.direction??"asc",onChange:o=>{const c=[...g];c[u]={...r,direction:o.target.value},k(c.filter(a=>a.field))},children:[e.jsx("option",{value:"asc",children:"asc"}),e.jsx("option",{value:"desc",children:"desc"})]}),e.jsxs("label",{className:"flex items-center gap-1 text-text-tertiary",children:[e.jsx("input",{type:"checkbox",checked:!!r.numeric,onChange:o=>{const c=[...g];c[u]={...r,numeric:o.target.checked},k(c.filter(a=>a.field))}}),"num"]}),u<g.length&&e.jsx("button",{className:Z,onClick:()=>k(g.filter((o,c)=>c!==u)),children:"×"})]},u))})]})}function Is({value:t,onChange:s,facetKeys:l,search:i,onSearchChange:p,activeFacetCount:m,onClear:h,onClose:d}){return e.jsxs("div",{className:"h-full overflow-y-auto",children:[e.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-4 py-3 bg-surface-raised border-b border-surface-border/50",children:[e.jsx("span",{className:"text-xs font-semibold text-text-primary",children:"Faceted query"}),e.jsxs("div",{className:"flex items-center gap-2",children:[m>0&&e.jsx("button",{onClick:h,className:"text-2xs text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),e.jsx("button",{onClick:d,className:"p-1 rounded hover:bg-surface-hover text-text-tertiary hover:text-text-primary transition-colors",title:"Close",children:e.jsx(te,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"px-4 py-2",children:[e.jsxs("p",{className:"mb-2 text-2xs leading-snug text-text-tertiary",children:["Precise metadata facets plus exact correlation-id lookup — they compose in one SQL query. Facet keys are the ones that actually exist in your visible escalations. Set status to ",e.jsx("span",{className:"font-medium",children:"All"})," to find an order across every status; the whole query is shareable via the URL."]}),e.jsx(Ds,{value:t,onChange:s,facetKeys:l,search:i,onSearchChange:p})]})]})}const Ie="created_at";function me(t){return t.replace(/^metadata\./,"")}function Us({orderBy:t,onChange:s}){const l=t==null?void 0:t[0],i=(l==null?void 0:l.field)??Ie,p=(l==null?void 0:l.direction)??"desc",m=i===Ie,h=d=>s([{...l??{},field:i,direction:d}]);return e.jsxs("div",{className:"flex items-center gap-1.5",children:[!m&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-accent/25 bg-accent/8 px-2 py-0.5 text-2xs font-medium text-accent/90",children:[e.jsx("span",{className:"text-text-quaternary",children:"sort"}),e.jsx("span",{className:"font-mono max-w-[120px] truncate",title:i,children:me(i)}),e.jsx("button",{onClick:()=>s(void 0),className:"ml-0.5 -mr-0.5 flex items-center text-text-quaternary hover:text-status-error transition-colors","aria-label":"Reset sort to created date",children:e.jsx(te,{className:"w-2.5 h-2.5"})})]}),e.jsxs("div",{className:"flex items-center rounded overflow-hidden border border-surface-border",role:"radiogroup","aria-label":"Sort direction",children:[e.jsx("button",{type:"button",role:"radio","aria-checked":p==="desc",onClick:()=>h("desc"),className:`px-1.5 py-1 transition-colors ${p==="desc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:m?"Newest first":`${me(i)} descending`,children:e.jsx(ns,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",role:"radio","aria-checked":p==="asc",onClick:()=>h("asc"),className:`px-1.5 py-1 border-l border-surface-border transition-colors ${p==="asc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:m?"Oldest first":`${me(i)} ascending`,children:e.jsx(rs,{className:"w-3.5 h-3.5"})})]})]})}const Vs=t=>t.isPriorityPending||t.isClaimPending||t.isAssignPending||t.isTriagePending||t.isCancelPending,he="inline-flex items-center h-7 px-2.5 text-2xs font-medium text-text-secondary bg-surface border border-surface-border rounded-[4px] hover:border-accent/50 hover:text-text-primary transition-colors disabled:opacity-50 disabled:hover:border-surface-border",Ue=`${he} appearance-none cursor-pointer`,Gs="inline-flex items-center h-7 px-2.5 text-2xs font-medium text-status-error bg-surface border border-status-error/30 rounded-[4px] hover:border-status-error hover:bg-status-error/5 transition-colors disabled:opacity-50";function Hs(t){var d;const s=Vs(t),l=pe(),{data:i}=Tt(),p=Ot(),m=p!==null?p:((d=i==null?void 0:i.ai)==null?void 0:d.enabled)===!0,h=t.selectedCount>0;return e.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${h?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0 pointer-events-none"}`,children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2 py-2.5 pl-3 pr-2 mt-4 mb-3 bg-surface-sunken/60 border-l-2 border-l-accent",children:[e.jsxs("span",{className:"text-2xs font-semibold uppercase tracking-wider text-accent tabular-nums",children:[t.selectedCount," selected"]}),e.jsx("div",{className:"mx-1 h-4 w-px bg-surface-border"}),e.jsxs("select",{onChange:x=>{x.target.value&&(t.onSetPriority(parseInt(x.target.value)),x.target.value="")},disabled:s,className:Ue,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Priority…"}),As.map(x=>e.jsx("option",{value:x.value,children:x.label},x.value))]}),e.jsxs("select",{onChange:x=>{x.target.value&&(t.onClaim(parseInt(x.target.value)),x.target.value="")},disabled:s,className:Ue,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Claim for…"}),l.map(x=>e.jsx("option",{value:x.value,children:x.label},x.value))]}),e.jsx("button",{onClick:t.onAssign,disabled:s,className:he,children:t.isAssignPending?"Assigning…":"Assign to…"}),m&&e.jsx("button",{onClick:t.onTriage,disabled:s,className:he,children:t.isTriagePending?"Triaging…":"Triage"}),e.jsx("button",{onClick:t.onCancel,disabled:s,className:Gs,children:t.isCancelPending?"Cancelling…":"Cancel"}),e.jsx("div",{className:"flex-1"}),s&&e.jsx("span",{className:"text-2xs text-text-tertiary animate-pulse",children:"Processing…"}),e.jsx("button",{onClick:t.onClearSelection,className:"px-1 text-2xs font-medium text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"})]})})})}function Qs({open:t,onClose:s,selectedCount:l,selectedRoles:i,onSubmit:p,isPending:m}){const{isSuperAdmin:h}=Ke(),d=pe(),[x,g]=f.useState("user"),[C,S]=f.useState(null),[P,j]=f.useState(""),[k,r]=f.useState("30"),[u,o]=f.useState(0),c=f.useCallback(y=>o(y),[]),a=!h&&i.length===1?i[0]:void 0,N=Xe(P,250),{data:w,isLoading:M}=Ts({role:a,status:"active",search:N.trim()||void 0,limit:200}),A=(w==null?void 0:w.users)??[],T=()=>{g("user"),S(null),j(""),r("30"),o(0),s()},O=y=>{S(y),g("duration")},q=()=>{g("user")},D=()=>{if(!C)return;const y=k==="custom"?u:parseInt(k);!y||y<=0||p(C.id,y)};return e.jsx(fe,{open:t,onClose:T,title:"Assign Escalations",children:e.jsxs("div",{className:"space-y-4",children:[x==="user"&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Select a user to assign"," ",e.jsx("span",{className:"font-medium text-text-primary",children:l})," ","escalation(s) to:"]}),e.jsx("input",{type:"text",value:P,onChange:y=>j(y.target.value),placeholder:"Search by name or email...",className:"input text-xs w-full",autoFocus:!0}),e.jsxs("div",{className:"max-h-60 overflow-y-auto border border-surface-border rounded-lg divide-y divide-surface-border",children:[M&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"Loading users..."}),!M&&A.length===0&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"No users found"}),A.map(y=>e.jsxs("button",{onClick:()=>O(y),className:"w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors",children:[e.jsx("p",{className:"text-xs font-medium text-text-primary",children:y.display_name||y.external_id}),y.email&&e.jsx("p",{className:"text-2xs text-text-tertiary",children:y.email})]},y.id))]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx("button",{onClick:T,className:"btn-secondary text-xs",children:"Cancel"})})]}),x==="duration"&&C&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Assign to"," ",e.jsx("span",{className:"font-medium text-text-primary",children:C.display_name||C.external_id})," ","for:"]}),e.jsxs("select",{value:k,onChange:y=>{r(y.target.value),o(0)},className:"select w-full text-sm",children:[d.map(y=>e.jsx("option",{value:y.value,children:y.label},y.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),k==="custom"&&e.jsx(We,{onChange:c,autoFocus:!0}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:q,className:"btn-secondary text-xs",children:"Back"}),e.jsx("button",{onClick:D,disabled:m,className:"btn-primary text-xs",children:m?"Assigning...":"Assign"})]})]})]})})}function Js({open:t,onClose:s,selectedCount:l,onSubmit:i,isPending:p}){const[m,h]=f.useState(""),d=()=>{i(m||void 0)};return e.jsx(fe,{open:t,onClose:s,title:"Submit for AI Triage",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Submit ",e.jsx("span",{className:"font-medium text-text-primary",children:l})," escalation(s) for AI triage? The triage orchestrator will take over resolution."]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium text-text-secondary block mb-1",children:["Triage hint ",e.jsx("span",{className:"text-text-tertiary",children:"(optional)"})]}),e.jsx("input",{type:"text",value:m,onChange:x=>h(x.target.value),placeholder:"e.g., image_orientation",className:"input text-xs font-mono w-full"}),e.jsx("p",{className:"text-2xs text-text-tertiary mt-1",children:"Guides the triage workflow on what remediation to apply"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:s,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:d,disabled:p,className:"btn-primary text-xs",children:p?"Submitting...":"Submit for Triage"})]})]})})}function V(t,s,l){return i=>{t.mutate(i,{onSuccess:()=>{s(),l==null||l()}})}}function Ks(t){const s=()=>[...t.selectedIds];return{handleSetPriority:d=>{V(t.setPriority,t.clearSelection)({ids:s(),priority:d})},handleBulkClaim:d=>{V(t.bulkClaim,t.clearSelection)({ids:s(),durationMinutes:d})},handleBulkTriage:d=>{V(t.bulkTriage,t.clearSelection,t.closeTriageModal)({ids:s(),hint:d})},handleBulkAssign:(d,x)=>{V(t.bulkAssign,t.clearSelection,t.closeAssignModal)({ids:s(),targetUserId:d,durationMinutes:x})},handleBulkCancel:()=>{V(t.bulkCancel,t.clearSelection,t.closeCancelModal)({ids:s()})}}}function Ws({claimTarget:t,onClose:s,claimDuration:l,onDurationChange:i,claimDurations:p,onCustomClaimChange:m,onClaim:h,isPending:d}){return e.jsx(fe,{open:!!t,onClose:s,title:"Claim Escalation",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Claim ",e.jsx("span",{className:"font-medium text-text-primary",children:t==null?void 0:t.type})," for:"]}),e.jsxs("select",{value:l,onChange:x=>{i(x.target.value)},className:"select w-full text-sm",children:[p.map(x=>e.jsx("option",{value:x.value,children:x.label},x.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),l==="custom"&&e.jsx(We,{onChange:m,autoFocus:!0}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:s,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:h,className:"btn-primary text-xs",disabled:d,children:d?"Claiming...":"Claim"})]})]})})}const Ye={pending:"--lt-status-queued-graphic",claimed:"--lt-status-claimed-graphic",resolved:"--lt-status-success-graphic",cancelled:"--lt-text-quaternary",expired:"--lt-text-tertiary"},Ze="--lt-text-quaternary";function Xs(t){return Ye[t]??Ze}const G=Object.fromEntries(Object.entries(Ye).map(([t,s])=>[t,`rgb(var(${s}))`])),Ve=40,Ys=64,Zs=24,Ge=3;function et(t){return t<6e4?`${Math.round(t/1e3)}s`:t<36e5?`${Math.round(t/6e4)}m`:t<864e5?`${(t/36e5).toFixed(1)}h`:`${(t/864e5).toFixed(1)}d`}function He(t){const s=Date.now()-t;return s<6e4?"just now":s<36e5?`${Math.round(s/6e4)}m ago`:s<864e5?`${Math.round(s/36e5)}h ago`:`${Math.round(s/864e5)}d ago`}function Qe(t){return t.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function ea(t,s){return t?[...s.filter(i=>i in t),...Object.keys(t).filter(i=>!s.includes(i))].map(i=>[i,t[i]]):[]}function ta({e:t}){const s=t.endMs-t.startMs;if(s<=0)return null;const l=G.pending,i=G.claimed,p=t.status==="cancelled"||t.status==="expired"?G.cancelled:G.resolved;let m=100,h=0,d=0;return t.claimedMs!==null?(m=Math.max(0,Math.min(100,(t.claimedMs-t.startMs)/s*100)),t.isOpen?h=100-m:(h=Math.max(0,Math.min(100-m,(t.endMs-t.claimedMs)/s*100)),d=Math.max(0,100-m-h))):t.isOpen||(d=100,m=0),e.jsxs("div",{className:"mt-2 h-0.5 rounded-full overflow-hidden flex bg-surface-sunken",children:[m>0&&e.jsx("div",{style:{width:`${m}%`,backgroundColor:l,opacity:.6}}),h>0&&e.jsx("div",{style:{width:`${h}%`,backgroundColor:i,opacity:.6}}),d>0&&e.jsx("div",{style:{width:`${d}%`,backgroundColor:p,opacity:.6}})]})}function sa({gapMs:t,heightPx:s}){return e.jsx("div",{className:"relative flex items-center justify-center",style:{height:s},children:t>=6e4&&e.jsx("span",{className:"text-2xs text-text-quaternary font-mono bg-surface px-2 relative z-10",children:et(t)})})}function Je({e:t,highlightKeys:s,onRowClick:l}){const[i,p]=f.useState(!1),m=G[t.displayStatus]??`rgb(var(${Ze}))`,h=ea(t.metadata,s),d=i?h:h.slice(0,Ge),x=h.length-Ge;return e.jsxs("div",{className:"cursor-pointer max-w-[460px] min-w-[260px] w-full bg-surface-raised rounded-lg shadow-sm border border-surface-border/60 px-3.5 pt-2.5 pb-2 hover:shadow-md hover:border-surface-border transition-all duration-150",style:{borderTopWidth:"3px",borderTopColor:m},onClick:()=>l==null?void 0:l(t),children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-1.5",children:[e.jsx("span",{className:"text-2xs font-bold uppercase tracking-widest text-text-quaternary shrink-0",children:Qe(t.role)}),e.jsxs("span",{className:"text-xs font-semibold text-text-primary truncate",title:t.type,children:[t.type,t.subtype&&t.subtype!==t.type&&t.subtype!==""&&e.jsxs("span",{className:"font-normal text-text-tertiary",children:[" · ",t.subtype]})]})]}),d.length>0&&e.jsxs("div",{className:"border-t border-surface-border/40 pt-1 space-y-px",children:[d.map(([g,C])=>{const S=String(C),P=s.includes(g);return e.jsxs("div",{className:"group/row flex items-center gap-1.5 -mx-1 px-1 py-[2px] rounded",children:[e.jsx("span",{className:`shrink-0 w-[60px] text-2xs font-mono uppercase tracking-wide truncate ${P?"text-accent":"text-text-quaternary"}`,title:g,children:g}),e.jsx("span",{className:`flex-1 min-w-0 text-2xs font-medium truncate ${P?"text-text-primary":"text-text-tertiary"}`,title:S,children:S}),e.jsxs("span",{className:"flex items-center gap-px shrink-0 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[e.jsx(ze,{to:Be(g,C,t.role),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Filter ${Qe(t.role)}: ${g} = ${S}`,onClick:j=>j.stopPropagation(),children:e.jsx(os,{className:"w-2.5 h-2.5"})}),e.jsx(ze,{to:Be(g,C),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Search all: ${g} = ${S}`,onClick:j=>j.stopPropagation(),children:e.jsx(cs,{className:"w-2.5 h-2.5"})})]})]},g)}),x>0&&e.jsx("button",{className:"flex items-center gap-0.5 text-2xs text-text-quaternary hover:text-accent transition-colors mt-0.5 -mx-1 px-1 py-px",onClick:g=>{g.stopPropagation(),p(C=>!C)},children:i?e.jsxs(e.Fragment,{children:[e.jsx(ds,{className:"w-2.5 h-2.5"})," less"]}):e.jsxs(e.Fragment,{children:[e.jsx(us,{className:"w-2.5 h-2.5"})," ",x," more"]})})]}),e.jsx(ta,{e:t})]})}function aa({escalations:t,highlightKeys:s=[],onRowClick:l,total:i,page:p,totalPages:m,onPageChange:h}){var o,c;const d=Date.now(),g=t.map(a=>{const N=new Date(a.created_at).getTime(),w=a.resolved_at?new Date(a.resolved_at).getTime():null,M=a.claimed_at?new Date(a.claimed_at).getTime():null,A=!w&&a.status!=="cancelled"&&a.status!=="expired",T=w??(A?d:N+3e4),O=a.status==="pending"&&Cs(a)?"claimed":a.status;return{...a,startMs:N,claimedMs:M,endMs:T,isOpen:A,displayStatus:O}});if(g.length===0)return e.jsx("p",{className:"mt-12 text-center text-sm text-text-tertiary",children:"No escalations matched."});const C=g.length,P=Math.max(Math.abs((((o=g[C-1])==null?void 0:o.startMs)??0)-(((c=g[0])==null?void 0:c.startMs)??0)),1)/Math.max(C-1,1),j=Ys/Math.max(P,1),r=new Set(g.map(a=>new Date(a.startMs).toDateString())).size>1;function u(a){const N=new Date(a),w=N.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return r?N.toLocaleDateString([],{month:"short",day:"numeric"})+" "+w:w}return e.jsxs("div",{className:"mt-4 pb-24",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-1/2 -translate-x-px inset-y-0 w-px bg-surface-border/80"}),g.map((a,N)=>{const w=g[N-1],M=w?Math.abs(a.startMs-w.startMs):null,A=M!==null?Math.max(Zs,Math.round(M*j)):0,T=N%2===0,O=Xs(a.displayStatus),q=`rgb(var(${O}))`,D=a.endMs-a.startMs,y=a.isOpen?He(a.startMs):`${He(a.startMs)} · ${et(D)}`;return e.jsxs("div",{children:[N>0&&e.jsx(sa,{gapMs:M,heightPx:A}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-1 flex justify-end items-center",children:T?e.jsxs("div",{className:"flex items-center",children:[e.jsx(Je,{e:a,highlightKeys:s,onRowClick:l}),e.jsx("div",{className:"flex-shrink-0 h-px bg-surface-border/70",style:{width:Ve}})]}):e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums pr-3",children:y})}),e.jsx("div",{className:"relative z-10 flex-shrink-0 w-3.5 h-3.5 rounded-full border-2 border-surface cursor-pointer transition-all duration-150 hover:scale-[1.5]",style:{backgroundColor:q,boxShadow:`0 0 0 3px rgb(var(${O}) / 0.16), 0 1px 3px rgb(var(${O}) / 0.19)`},onClick:()=>l==null?void 0:l(a)}),e.jsx("div",{className:"flex-1 flex justify-start items-center",children:T?e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums pl-3",children:y}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0 h-px bg-surface-border/70",style:{width:Ve}}),e.jsx(Je,{e:a,highlightKeys:s,onRowClick:l})]})})]}),e.jsx("div",{className:"flex justify-center relative z-10 mt-0.5",children:e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums bg-surface px-1.5",children:u(a.startMs)})})]},a.id)})]}),m>1&&e.jsxs("div",{className:"sticky bottom-0 z-20 bg-surface/95 backdrop-blur-sm border-t border-surface-border -mx-page-x px-page-x pt-2 pb-4 flex items-center justify-between mt-10",children:[e.jsxs("span",{className:"text-2xs text-text-tertiary",children:["Page ",e.jsx("span",{className:"font-medium text-text-secondary",children:p})," ","of ",e.jsx("span",{className:"font-medium text-text-secondary",children:m})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>h(p-1),disabled:p<=1,className:"p-1.5 rounded hover:bg-surface-hover disabled:opacity-30 text-text-tertiary hover:text-text-primary transition-colors disabled:cursor-not-allowed",children:e.jsx(is,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>h(p+1),disabled:p>=m,className:"p-1.5 rounded hover:bg-surface-hover disabled:opacity-30 text-text-tertiary hover:text-text-primary transition-colors disabled:cursor-not-allowed",children:e.jsx(ls,{className:"w-4 h-4"})})]})]})]})}function Oa(){var Te,Oe,Ee,Fe,_e,$e,Le;const t=_s(),{filters:s,setFilter:l,pagination:i}=ws({filters:{role:"",type:"",priority:"",status:"available",search:""}});as({role:s.role||null,verbs:["created","claimed"]});const p=Xe(s.search,300),m=pe(),[h,d]=f.useState(null),[x,g]=f.useState("30"),[C,S]=f.useState(0),P=f.useCallback(n=>S(n),[]),[j,k]=f.useState(new Set),[r,u]=f.useState(!1),[o,c]=$s(),a=f.useMemo(()=>Et(o),[o]),N=f.useCallback(n=>{c(b=>{const v=new URLSearchParams(b);return Ft(v,n),v.delete("page"),v})},[c]),{data:w}=_t(r),M=$t(a)+(s.search?1:0),A="facet-query",{setPanel:T,closePanel:O,open:q,ownerKey:D}=Lt();f.useEffect(()=>{if(!r){O(A);return}T(e.jsx(Is,{value:a,onChange:N,facetKeys:(w==null?void 0:w.keys)??[],search:s.search??"",onSearchChange:n=>l("search",n),activeFacetCount:M,onClear:()=>{N({}),l("search","")},onClose:()=>u(!1)}),{width:420,key:A})},[r,a,N,w,s.search,l,M,T,O]);const y=q&&D===A,se=f.useRef(!1);f.useEffect(()=>{if(y){se.current=!0;return}se.current&&(se.current=!1,u(!1))},[y]);const[tt,ae]=f.useState(!1),[st,ne]=f.useState(!1),[at,re]=f.useState(!1),nt=f.useCallback(n=>N({...a,orderBy:n}),[a,N]),H=Ls(),{data:Q}=Bt(),ge=Rt(),rt=f.useCallback(()=>{var v;const n=window.prompt("Pin label:");if(!(n!=null&&n.trim()))return;const b=((v=Q==null?void 0:Q.preferences)==null?void 0:v.pinnedViews)??[];ge.mutate({pinnedViews:[...b,{id:zt(),label:n.trim(),url:H.pathname+H.search,badge:!0}]})},[H.pathname,H.search,Q,ge]),{canBulk:it}=qt(),{kiosk:ie}=Dt(),be=a.facets?Object.keys(a.facets):[],le=o.get("view"),ye=f.useCallback(n=>{c(b=>{const v=new URLSearchParams(b);return n?v.set("view",n):v.delete("view"),v},{replace:!0})},[c]),_=le==="timeline",lt=f.useCallback(n=>{const{[n]:b,...v}=a.facets??{};N({...a,facets:Object.keys(v).length>0?v:void 0})},[a,N]),je=It(),ve=Ut(),Ne=Vt(),oe=Gt(),ce=Ht(),J=Qt(),{data:de}=Jt(),{data:$}=Kt(),{data:ue}=Wt(),{user:K,isSuperAdmin:ot,hasRoleType:ct}=Ke(),Ce=ot||ct("admin"),ke=f.useMemo(()=>new Set(((K==null?void 0:K.roles)??[]).map(n=>n.role)),[K]),dt=f.useMemo(()=>{const n=($==null?void 0:$.roles)??[];return(Ce?n:n.filter(v=>ke.has(v.role)&&!ss(v.role))).map(v=>({value:v.role,label:Xt(v)})).sort((v,At)=>v.label.localeCompare(At.label))},[$,Ce,ke]);f.useEffect(()=>{k(new Set)},[s.role,s.type,s.priority,s.status,p,i.page,i.pageSize]);const I=s.status||"",U=I==="available",xe=I==="claimed",we=xe?"pending":I==="resolved"?"resolved":I==="cancelled"?"cancelled":I==="expired"?"expired":void 0,Se=100,Pe={role:s.role||void 0,type:s.type||void 0,priority:s.priority?parseInt(s.priority):void 0,limit:_?Se:i.pageSize,offset:i.offset,sort_by:"created_at",order:"desc",search:p||void 0,...a},ut=Yt({...Pe,enabled:U}),xt=Zt({status:we,claimed:xe||void 0,...Pe,enabled:!U}),mt=U?ut:xt,{data:B,isLoading:ht,error:W,refetch:pt,isFetching:ft}=mt,gt=Ss(`/escalations${U?"/available":""}`,{status:we,claimed:xe||void 0,role:s.role||void 0,type:s.type||void 0,priority:s.priority||void 0,search:p||void 0,sort_by:"created_at",order:"desc",limit:i.pageSize,offset:i.offset,facets:a.facets&&Object.keys(a.facets).length?JSON.stringify(a.facets):void 0,block:(Te=a.block)!=null&&Te.length?JSON.stringify(a.block):void 0,range:(Oe=a.range)!=null&&Oe.length?JSON.stringify(a.range):void 0,exists:(Ee=a.exists)!=null&&Ee.length?JSON.stringify(a.exists):void 0,roles:(Fe=a.roles)!=null&&Fe.length?JSON.stringify(a.roles):void 0,orderBy:(_e=a.orderBy)!=null&&_e.length?JSON.stringify(a.orderBy):void 0,available:a.available!=null?String(a.available):void 0}),F=(B==null?void 0:B.escalations)??[],E=(B==null?void 0:B.total)??0,L=s.role||((($e=a.roles)==null?void 0:$e.length)===1?a.roles[0]:null),X=((Le=es(L??"",void 0,!!L).data)==null?void 0:Le.list_schema)??null,Me=!!L&&!!X&&!!X["x-lt-layout"]&&X["x-lt-layout"]!=="table",Y=Me&&!_&&(le?le==="rich":!0),Ae=f.useMemo(()=>{if(!a.jeopardy||!L)return null;const n=(($==null?void 0:$.roles)??[]).find(v=>v.role===L),b=(n==null?void 0:n.priority_threshold_minutes)??(n==null?void 0:n.sla_minutes)??null;return b!=null?ts(b*6e4):null},[a.jeopardy,L,$]),bt=f.useMemo(()=>{const n=new Set;for(const b of F)j.has(b.id)&&n.add(b.role);return[...n]},[F,j]),yt=f.useCallback(()=>k(new Set),[]),jt=()=>{if(!h)return;const n=x==="custom"?C:parseInt(x);!n||n<=0||je.mutate({id:h.id,durationMinutes:n},{onSuccess:()=>{d(null),t(`/escalations/detail/${h.id}`)}})},{handleSetPriority:vt,handleBulkClaim:Nt,handleBulkTriage:Ct,handleBulkAssign:kt,handleBulkCancel:wt}=Ks({selectedIds:j,clearSelection:yt,setPriority:ve,bulkClaim:Ne,bulkTriage:ce,bulkAssign:oe,bulkCancel:J,closeTriageModal:()=>ae(!1),closeAssignModal:()=>ne(!1),closeCancelModal:()=>re(!1)}),St=n=>{const b=new Set(j);b.has(n)?b.delete(n):b.add(n),k(b)},Pt=()=>{j.size===F.length?k(new Set):k(new Set(F.map(n=>n.id)))},Mt=[it?{key:"select",label:e.jsx("input",{type:"checkbox",checked:F.length>0&&j.size===F.length,onChange:Pt,className:"rounded"}),render:n=>e.jsx("input",{type:"checkbox",checked:j.has(n.id),onChange:b=>{b.stopPropagation(),St(n.id)},onClick:b=>b.stopPropagation(),className:"rounded"}),className:"w-10",priority:1}:{key:"spacer",label:"",render:()=>null,className:"w-10",priority:3},...js({highlightKeys:be}),{key:"actions",label:"",render:n=>e.jsx(Os,{children:e.jsx(Es,{icon:xs,title:"Claim escalation",onClick:()=>d(n),alwaysVisible:!0,colorClass:"text-accent/40 hover:text-accent",size:"sm"})}),className:"w-10 text-right"}];return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-10 min-w-0",children:[e.jsx(vs,{role:s.role,options:dt,onChange:n=>l("role",n),locked:ie}),!ie&&e.jsx("button",{onClick:()=>{window.location.hash="#docs:dashboard.md:all-escalations"},className:"text-text-quaternary hover:text-accent transition-colors mt-1 shrink-0",title:"Open docs for this page",children:e.jsx(ms,{className:"w-4 h-4",strokeWidth:1.5})})]}),e.jsx(Ns,{filters:s,setFilter:l,roles:(de==null?void 0:de.roles)??[],types:(ue==null?void 0:ue.types)??[],showStatus:!0,showSearch:!1,showRole:!ie,actions:e.jsxs(e.Fragment,{children:[_&&e.jsxs("span",{className:"text-2xs text-text-tertiary whitespace-nowrap",children:[E>100&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"font-medium text-text-secondary",children:[(i.page-1)*100+1,"–",Math.min(i.page*100,E)]})," of "]}),e.jsx("span",{className:"font-medium text-text-secondary",children:E})," ",E===1?"escalation":"escalations"]}),e.jsx(Us,{orderBy:a.orderBy,onChange:nt}),e.jsx("span",{className:"h-3.5 w-px bg-surface-border shrink-0"}),e.jsx(Fs,{onRefresh:()=>pt(),isFetching:ft,apiPath:gt}),Me&&!_&&e.jsx("button",{onClick:()=>ye(Y?"table":"rich"),className:"ml-2 inline-flex h-7 w-7 items-center justify-center rounded icon-link hover:bg-surface-hover",title:Y?"Table view":"Rich view",children:Y?e.jsx(Re,{className:"w-4 h-4"}):e.jsx(hs,{className:"w-4 h-4"})}),M>0&&e.jsx("button",{onClick:()=>ye(_?"table":"timeline"),className:"ml-2 inline-flex h-7 w-7 items-center justify-center rounded icon-link hover:bg-surface-hover",title:_?"Table view":"Timeline view",children:_?e.jsx(Re,{className:"w-4 h-4"}):e.jsx(ps,{className:"w-4 h-4"})}),e.jsx("button",{onClick:rt,className:"ml-2 inline-flex h-7 w-7 items-center justify-center rounded icon-link hover:bg-surface-hover",title:"Pin this view — save the current filters to your Pinned section","data-testid":"pin-current-view",children:e.jsx(fs,{className:"w-4 h-4"})}),e.jsxs("button",{onClick:()=>u(n=>!n),className:"relative ml-2 inline-flex h-7 w-7 items-center justify-center rounded icon-link hover:bg-surface-hover",title:"Faceted query",children:[e.jsx(gs,{className:"w-4 h-4"}),M>0&&e.jsx("span",{className:"absolute -right-1 -top-1 flex h-3.5 min-w-[14px] items-center justify-center rounded-full bg-accent px-0.5 text-2xs font-medium text-text-inverse",children:M})]})]})}),e.jsx(Hs,{selectedCount:j.size,onClearSelection:()=>k(new Set),onSetPriority:vt,onClaim:Nt,onAssign:()=>ne(!0),onTriage:()=>ae(!0),onCancel:()=>re(!0),isPriorityPending:ve.isPending,isClaimPending:Ne.isPending,isAssignPending:oe.isPending,isTriagePending:ce.isPending,isCancelPending:J.isPending}),(a.facets&&Object.keys(a.facets).length>0||a.jeopardy)&&e.jsxs("div",{className:"sticky top-14 z-30 bg-surface/98 backdrop-blur-sm border-b border-surface-border/30 -mx-page-x px-page-x py-2 flex items-center gap-1.5 flex-wrap",children:[a.jeopardy&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-status-error px-2.5 py-0.5 text-2xs font-semibold text-text-inverse",children:[e.jsx(bs,{className:"w-2.5 h-2.5",strokeWidth:2.5}),"in jeopardy",Ae&&e.jsxs("span",{className:"font-mono font-normal opacity-90",children:["> ",Ae]}),e.jsx("button",{onClick:()=>N({...a,jeopardy:void 0}),className:"ml-0.5 -mr-0.5 flex items-center text-text-inverse/70 hover:text-text-inverse transition-colors","aria-label":"Clear jeopardy filter",children:e.jsx(te,{className:"w-2.5 h-2.5"})})]}),Object.entries(a.facets??{}).map(([n,b])=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-accent/25 bg-accent/8 px-2.5 py-0.5 text-2xs font-medium text-accent/90",children:[e.jsx("span",{className:"font-mono text-text-tertiary",children:n}),e.jsx("span",{className:"text-text-quaternary",children:"="}),e.jsx("span",{className:"font-mono max-w-[160px] truncate",title:String(b),children:String(b)}),e.jsx("button",{onClick:()=>lt(n),className:"ml-0.5 -mr-0.5 flex items-center text-text-quaternary hover:text-status-error transition-colors","aria-label":`Remove ${n} filter`,children:e.jsx(te,{className:"w-2.5 h-2.5"})})]},n)),Object.keys(a.facets??{}).length>1&&e.jsx("button",{onClick:()=>N({...a,facets:void 0}),className:"text-2xs text-text-quaternary hover:text-text-secondary transition-colors px-1",children:"clear all"})]}),W&&e.jsx("div",{className:"mb-4 px-4 py-3 rounded-md bg-status-error/10 border border-status-error/20 text-xs text-status-error",children:W.message==="Session expired"?"Your session has expired. Please log in again.":`Failed to load escalations: ${W.message}`}),_?e.jsx(aa,{escalations:F,highlightKeys:be,onRowClick:n=>t(`/escalations/detail/${n.id}`,{state:{from:"/escalations/available"}}),total:E,page:i.page,totalPages:Math.ceil(E/Se),onPageChange:i.setPage}):Y?e.jsx(ks,{role:L,listSchema:X,activeEscalations:F,onRowClick:n=>t(`/escalations/detail/${n.id}`,{state:{from:"/escalations/available"}}),onOpenGroup:n=>t(n),onAddFacet:(n,b)=>N({...a,facets:{...a.facets??{},[n]:typeof b=="object"&&b!==null?JSON.stringify(b):b}}),total:E,page:i.page,totalPages:i.totalPages(E),pageSize:i.pageSize,onPageChange:i.setPage,onPageSizeChange:i.setPageSize}):e.jsxs(e.Fragment,{children:[e.jsx(Ps,{columns:Mt,data:F,layout:"fixed",keyFn:n=>n.id,onRowClick:n=>t(`/escalations/detail/${n.id}`,{state:{from:"/escalations/available"}}),isLoading:ht,emptyMessage:W?"Unable to load data":"No escalations"}),e.jsx(Ms,{page:i.page,totalPages:i.totalPages(E),onPageChange:i.setPage,total:E,pageSize:i.pageSize,onPageSizeChange:i.setPageSize})]}),e.jsx(Ws,{claimTarget:h,onClose:()=>d(null),claimDuration:x,onDurationChange:n=>{g(n),S(0)},claimDurations:m,customClaimMinutes:C,onCustomClaimChange:P,onClaim:jt,isPending:je.isPending}),e.jsx(Js,{open:tt,onClose:()=>ae(!1),selectedCount:j.size,onSubmit:Ct,isPending:ce.isPending}),e.jsx(Qs,{open:st,onClose:()=>ne(!1),selectedCount:j.size,selectedRoles:bt,onSubmit:kt,isPending:oe.isPending}),e.jsx(ys,{open:at,onClose:()=>re(!1),onConfirm:wt,selectedCount:j.size,isPending:J.isPending,error:J.error})]})}export{Oa as AvailableEscalationsPage};
|
|
2
|
-
//# sourceMappingURL=AvailableEscalationsPage-DvWaiafI.js.map
|