@hotmeshio/long-tail 0.19.0 → 0.20.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/workflows/config.d.ts +8 -1
- package/build/api/workflows/config.js +24 -1
- package/build/api/workflows/index.d.ts +4 -0
- package/build/api/workflows/index.js +9 -1
- package/build/api/workflows/input-lookups.d.ts +16 -0
- package/build/api/workflows/input-lookups.js +69 -0
- package/build/api/workflows/input-validation.d.ts +14 -0
- package/build/api/workflows/input-validation.js +41 -0
- package/build/api/workflows/invocable.d.ts +19 -0
- package/build/api/workflows/invocable.js +107 -0
- package/build/api/workflows/invocation.js +6 -0
- package/build/lib/db/schemas/034_workflow_input_schema.sql +13 -0
- package/build/lib/db/schemas/035_workflow_input_lookups.sql +9 -0
- package/build/routes/workflows/config.js +12 -0
- package/build/routes/workflows/discovery.js +14 -0
- package/build/services/config/cache.js +3 -0
- package/build/services/config/read.js +6 -0
- package/build/services/config/sql.d.ts +2 -2
- package/build/services/config/sql.js +8 -5
- package/build/services/config/write.js +20 -1
- package/build/services/interceptor/index.js +7 -0
- package/build/services/invocation-access.d.ts +18 -0
- package/build/services/invocation-access.js +32 -0
- package/build/services/knowledge/index.d.ts +1 -0
- package/build/services/knowledge/index.js +1 -0
- package/build/services/knowledge/lookup-refs.d.ts +7 -0
- package/build/services/knowledge/lookup-refs.js +26 -0
- package/build/services/mcp/db-server/schemas.d.ts +2 -2
- package/build/services/workflow-invocation.js +4 -9
- package/build/shared/form-validation/field-validator.d.ts +1 -0
- package/build/shared/form-validation/field-validator.js +94 -6
- package/build/shared/form-validation/index.d.ts +1 -0
- package/build/shared/form-validation/index.js +1 -0
- package/build/shared/form-validation/invoke-context.d.ts +8 -0
- package/build/shared/form-validation/invoke-context.js +12 -0
- package/build/shared/form-validation/validate-resolver-payload.d.ts +1 -1
- package/build/shared/form-validation/validate-resolver-payload.js +1 -0
- package/build/shared/form-validation/x-lt-help.d.ts +2 -2
- package/build/shared/form-validation/x-lt-help.js +2 -2
- package/build/shared/form-validation/x-lt-options.d.ts +3 -3
- package/build/shared/form-validation/x-lt-options.js +19 -5
- package/build/shared/form-validation/x-lt-show-if.d.ts +6 -0
- package/build/shared/form-validation/x-lt-show-if.js +13 -0
- package/build/start/workers.js +12 -0
- package/build/system/mcp-servers/admin/schemas.d.ts +64 -20
- package/build/system/mcp-servers/admin/schemas.js +19 -3
- package/build/system/mcp-servers/admin/workflow-config.js +54 -9
- package/build/system/mcp-servers/admin/workflows.js +18 -3
- package/build/system/mcp-servers/db-query/schemas.d.ts +2 -2
- package/build/system/seed/tool-manifests-admin.d.ts +517 -54
- package/build/system/seed/tool-manifests-admin.js +4 -3
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/config.d.ts +10 -0
- package/build/types/index.d.ts +2 -0
- package/build/types/index.js +4 -1
- package/build/types/startup.d.ts +16 -0
- package/build/types/validation.d.ts +4 -2
- package/build/types/workflow-icons.d.ts +86 -0
- package/build/types/workflow-icons.js +92 -0
- package/dashboard/dist/assets/{AdminDashboard-DPkWtPc1.js → AdminDashboard-DplvDBti.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-DPkWtPc1.js.map → AdminDashboard-DplvDBti.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-DRfnLiQS.js → AgentConfigPage-D8Bf6YxO.js} +3 -3
- package/dashboard/dist/assets/{AgentConfigPage-DRfnLiQS.js.map → AgentConfigPage-D8Bf6YxO.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-CufRZXnT.js → AgentDetailPage-BN8g0Y2G.js} +3 -3
- package/dashboard/dist/assets/{AgentDetailPage-CufRZXnT.js.map → AgentDetailPage-BN8g0Y2G.js.map} +1 -1
- package/dashboard/dist/assets/AgentsPage-7JJBHku8.js +2 -0
- package/dashboard/dist/assets/{AgentsPage-CoCWGhUd.js.map → AgentsPage-7JJBHku8.js.map} +1 -1
- package/dashboard/dist/assets/{AutoGrowTextarea-DgEQeRQw.js → AutoGrowTextarea-7X3T9La8.js} +2 -2
- package/dashboard/dist/assets/{AutoGrowTextarea-DgEQeRQw.js.map → AutoGrowTextarea-7X3T9La8.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-lz5qwSjg.js +2 -0
- package/dashboard/dist/assets/{AvailableEscalationsPage-BSqOctep.js.map → AvailableEscalationsPage-lz5qwSjg.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-DMojDLlV.js → BotPicker-CGCnIz8I.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-DMojDLlV.js.map → BotPicker-CGCnIz8I.js.map} +1 -1
- package/dashboard/dist/assets/BulkAssignModal-NJBcoj-f.js +2 -0
- package/dashboard/dist/assets/{BulkAssignModal-DYbM_6Or.js.map → BulkAssignModal-NJBcoj-f.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-CDQ5JHNP.js → CapabilitiesPage-F8dpNn9B.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-CDQ5JHNP.js.map → CapabilitiesPage-F8dpNn9B.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-D4VlCEbD.js → CollapsibleSection-BZW6VpCU.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-D4VlCEbD.js.map → CollapsibleSection-BZW6VpCU.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-DnNHjJtD.js → ConfirmDeleteModal-64adXLdq.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-DnNHjJtD.js.map → ConfirmDeleteModal-64adXLdq.js.map} +1 -1
- package/dashboard/dist/assets/{CopyableId-4Lqlc5cU.js → CopyableId-Bn02zYxt.js} +2 -2
- package/dashboard/dist/assets/{CopyableId-4Lqlc5cU.js.map → CopyableId-Bn02zYxt.js.map} +1 -1
- package/dashboard/dist/assets/CountdownTimer-BxDub9d2.js +2 -0
- package/dashboard/dist/assets/CountdownTimer-BxDub9d2.js.map +1 -0
- package/dashboard/dist/assets/{CredentialsPage-CSYZw-rL.js → CredentialsPage-CnLzopLL.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-CSYZw-rL.js.map → CredentialsPage-CnLzopLL.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-CpmqDrlJ.js → CronLabel-CAD5UYDT.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-CpmqDrlJ.js.map → CronLabel-CAD5UYDT.js.map} +1 -1
- package/dashboard/dist/assets/{DataTable-DFPMeqyQ.js → DataTable-7C7riavf.js} +2 -2
- package/dashboard/dist/assets/{DataTable-DFPMeqyQ.js.map → DataTable-7C7riavf.js.map} +1 -1
- package/dashboard/dist/assets/{DropZone-BbXlQnYB.js → DropZone-XlcY8hEH.js} +2 -2
- package/dashboard/dist/assets/{DropZone-BbXlQnYB.js.map → DropZone-XlcY8hEH.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-Cul22qBS.js → ElapsedCell-CwO4ufd0.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-Cul22qBS.js.map → ElapsedCell-CwO4ufd0.js.map} +1 -1
- package/dashboard/dist/assets/{EmptyState-lpUFYfun.js → EmptyState-DgC_6njU.js} +2 -2
- package/dashboard/dist/assets/{EmptyState-lpUFYfun.js.map → EmptyState-DgC_6njU.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-CtzpJ-j2.js → EntityTimelinePanel-CkF-oW-m.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-CtzpJ-j2.js.map → EntityTimelinePanel-CkF-oW-m.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-BZQ8Y_UH.js → EscalationListSchemaPage-h9JO_q5f.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-BZQ8Y_UH.js.map → EscalationListSchemaPage-h9JO_q5f.js.map} +1 -1
- package/dashboard/dist/assets/EscalationListView-AHW2xtlr.js +2 -0
- package/dashboard/dist/assets/EscalationListView-AHW2xtlr.js.map +1 -0
- package/dashboard/dist/assets/{EscalationSchemaPage-CydTtq_A.js → EscalationSchemaPage-mJFL5_Se.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-CydTtq_A.js.map → EscalationSchemaPage-mJFL5_Se.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DSYC0nI7.js → EscalationsOverview-DlXUFqWJ.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DSYC0nI7.js.map → EscalationsOverview-DlXUFqWJ.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-s48cTXIw.js → EventTable-Ike2xchn.js} +2 -2
- package/dashboard/dist/assets/{EventTable-s48cTXIw.js.map → EventTable-Ike2xchn.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-B61qKmFD.js → FilterBar-DMOR-O1c.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-B61qKmFD.js.map → FilterBar-DMOR-O1c.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-DxZv_KC2.js → GraphInvokePage-CKtvWowP.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-DxZv_KC2.js.map → GraphInvokePage-CKtvWowP.js.map} +1 -1
- package/dashboard/dist/assets/HomePage-BQ3Q791Q.js +2 -0
- package/dashboard/dist/assets/{HomePage-zK3VP_9g.js.map → HomePage-BQ3Q791Q.js.map} +1 -1
- package/dashboard/dist/assets/ListToolbar-DdJzj472.js +2 -0
- package/dashboard/dist/assets/{ListToolbar-DaxloPQc.js.map → ListToolbar-DdJzj472.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-Ciq8r6-p.js → McpOverview-BbtrduWn.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-Ciq8r6-p.js.map → McpOverview-BbtrduWn.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-DIC0FEEb.js → McpQueryDetailPage-C1L4T-Wt.js} +3 -3
- package/dashboard/dist/assets/{McpQueryDetailPage-DIC0FEEb.js.map → McpQueryDetailPage-C1L4T-Wt.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-BBy0NSNg.js → McpQueryPage-CfJy7HZ7.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-BBy0NSNg.js.map → McpQueryPage-CfJy7HZ7.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-BqKNmIyW.js → McpRunDetailPage-CA9yv7he.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-BqKNmIyW.js.map → McpRunDetailPage-CA9yv7he.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-D0RlOpzR.js → McpRunsPage-D7QXjW9z.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-D0RlOpzR.js.map → McpRunsPage-D7QXjW9z.js.map} +1 -1
- package/dashboard/dist/assets/{NamespacePill-Dbtm9R2T.js → NamespacePill-Bb3revqD.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-Dbtm9R2T.js.map → NamespacePill-Bb3revqD.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-BX0SFizr.js → OperationsPage-aLHHAP2X.js} +3 -3
- package/dashboard/dist/assets/{OperationsPage-BX0SFizr.js.map → OperationsPage-aLHHAP2X.js.map} +1 -1
- package/dashboard/dist/assets/OperatorDashboard-sXNDh1Ph.js +2 -0
- package/dashboard/dist/assets/{OperatorDashboard-vXG0TjAQ.js.map → OperatorDashboard-sXNDh1Ph.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-xB92ELs3.js → PageHeader-Di5Sz3an.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-xB92ELs3.js.map → PageHeader-Di5Sz3an.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-DVo_qqn1.js → PageHeaderWithStats-DutKJ-h2.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-DVo_qqn1.js.map → PageHeaderWithStats-DutKJ-h2.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-w5TXcn4Q.js → PersonaDetailPage-NeHD-Gra.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-w5TXcn4Q.js.map → PersonaDetailPage-NeHD-Gra.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-Dzcinl1L.js → PersonasPage-DavKXRWX.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-Dzcinl1L.js.map → PersonasPage-DavKXRWX.js.map} +1 -1
- package/dashboard/dist/assets/{PriorityBadge-BETdj4M-.js → PriorityBadge-r33mpDju.js} +2 -2
- package/dashboard/dist/assets/{PriorityBadge-BETdj4M-.js.map → PriorityBadge-r33mpDju.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-BVXieFX1.js → ProcessDetailPage-DkdKJGe6.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-BVXieFX1.js.map → ProcessDetailPage-DkdKJGe6.js.map} +1 -1
- package/dashboard/dist/assets/ProcessesListPage-CjwVKe32.js +2 -0
- package/dashboard/dist/assets/{ProcessesListPage-CKKNpk4z.js.map → ProcessesListPage-CjwVKe32.js.map} +1 -1
- package/dashboard/dist/assets/ResolverForm-Bk-wDkN-.js +3 -0
- package/dashboard/dist/assets/ResolverForm-Bk-wDkN-.js.map +1 -0
- package/dashboard/dist/assets/{RoleDetailPage-BytSo-YE.js → RoleDetailPage-WQt0y5l7.js} +3 -3
- package/dashboard/dist/assets/{RoleDetailPage-BytSo-YE.js.map → RoleDetailPage-WQt0y5l7.js.map} +1 -1
- package/dashboard/dist/assets/{RolePill-CYpL3a2d.js → RolePill-DhnVPK4q.js} +2 -2
- package/dashboard/dist/assets/{RolePill-CYpL3a2d.js.map → RolePill-DhnVPK4q.js.map} +1 -1
- package/dashboard/dist/assets/RolesPage-OM9KM8Pg.js +2 -0
- package/dashboard/dist/assets/{RolesPage-eayR9H4f.js.map → RolesPage-OM9KM8Pg.js.map} +1 -1
- package/dashboard/dist/assets/{RowActions-eYrzgQSj.js → RowActions-Bdd7z4eB.js} +2 -2
- package/dashboard/dist/assets/{RowActions-eYrzgQSj.js.map → RowActions-Bdd7z4eB.js.map} +1 -1
- package/dashboard/dist/assets/RunAsSelector-fFMt1bGe.js +2 -0
- package/dashboard/dist/assets/{RunAsSelector-D7RPwaAl.js.map → RunAsSelector-fFMt1bGe.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-C8-ZBXF5.js → ScanCodesPage-AujH-pPQ.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-C8-ZBXF5.js.map → ScanCodesPage-AujH-pPQ.js.map} +1 -1
- package/dashboard/dist/assets/{ScanSchemeDetailPage-tQhEgFKf.js → ScanSchemeDetailPage-eKQpmsC_.js} +2 -2
- package/dashboard/dist/assets/{ScanSchemeDetailPage-tQhEgFKf.js.map → ScanSchemeDetailPage-eKQpmsC_.js.map} +1 -1
- package/dashboard/dist/assets/ScanStationPage-C1_ppDoZ.js +2 -0
- package/dashboard/dist/assets/{ScanStationPage-CuhqsBKo.js.map → ScanStationPage-C1_ppDoZ.js.map} +1 -1
- package/dashboard/dist/assets/{ScopeBadge-BmNzZlSj.js → ScopeBadge-CXUg0FHo.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-BmNzZlSj.js.map → ScopeBadge-CXUg0FHo.js.map} +1 -1
- package/dashboard/dist/assets/{SegmentedTabs-DXNzY05q.js → SegmentedTabs-BpJh4Hwn.js} +2 -2
- package/dashboard/dist/assets/{SegmentedTabs-DXNzY05q.js.map → SegmentedTabs-BpJh4Hwn.js.map} +1 -1
- package/dashboard/dist/assets/{StatCard-BXQ8dD9Y.js → StatCard-nWY4sndl.js} +2 -2
- package/dashboard/dist/assets/{StatCard-BXQ8dD9Y.js.map → StatCard-nWY4sndl.js.map} +1 -1
- package/dashboard/dist/assets/{StatusBadge-BDeUwPtb.js → StatusBadge-DHVwxre2.js} +2 -2
- package/dashboard/dist/assets/{StatusBadge-BDeUwPtb.js.map → StatusBadge-DHVwxre2.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-BIVTAMnP.js → StickyPagination-B91Pk9xh.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-BIVTAMnP.js.map → StickyPagination-B91Pk9xh.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-CYSC2cO1.js → StreamMessageDetail-C7SPqaJt.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-CYSC2cO1.js.map → StreamMessageDetail-C7SPqaJt.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-BMZAs_2K.js → SwimlaneTimeline-BcHR8ylf.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-BMZAs_2K.js.map → SwimlaneTimeline-BcHR8ylf.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-D1uszNd2.js → TagInput-BZ8vb2oW.js} +2 -2
- package/dashboard/dist/assets/{TagInput-D1uszNd2.js.map → TagInput-BZ8vb2oW.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-CVUDUU5Q.js → TaskDetailPage-Bqj0I_I0.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-CVUDUU5Q.js.map → TaskDetailPage-Bqj0I_I0.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-C2H8oRfn.js → TaskQueuePill-Bxir8WRl.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-C2H8oRfn.js.map → TaskQueuePill-Bxir8WRl.js.map} +1 -1
- package/dashboard/dist/assets/TasksListPage-BB1f79lL.js +2 -0
- package/dashboard/dist/assets/{TasksListPage-DEQymbXC.js.map → TasksListPage-BB1f79lL.js.map} +1 -1
- package/dashboard/dist/assets/TimeAgo-BFnODmNe.js +2 -0
- package/dashboard/dist/assets/{TimeAgo-CCxP67Rb.js.map → TimeAgo-BFnODmNe.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-CE5ZUYhV.js → TimestampCell-BXgLOBsr.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-CE5ZUYhV.js.map → TimestampCell-BXgLOBsr.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-D-h8AoB8.js → ToolPill-FkgTXIhq.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-D-h8AoB8.js.map → ToolPill-FkgTXIhq.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-BHuQTyBY.js → ToolTestPanel-Bwe3J5lj.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-BHuQTyBY.js.map → ToolTestPanel-Bwe3J5lj.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-SFuiludx.js → TopicDetailPage-DAF07vZ9.js} +3 -3
- package/dashboard/dist/assets/{TopicDetailPage-SFuiludx.js.map → TopicDetailPage-DAF07vZ9.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-DO8pUmng.js → TopicsPage-C1gxBUap.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-DO8pUmng.js.map → TopicsPage-C1gxBUap.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-CsLnT75E.js → UserName-BzXJUE6q.js} +2 -2
- package/dashboard/dist/assets/{UserName-CsLnT75E.js.map → UserName-BzXJUE6q.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowExecutionPage-SkRU5cRX.js +2 -0
- package/dashboard/dist/assets/{WorkflowExecutionPage-BttnEvOd.js.map → WorkflowExecutionPage-SkRU5cRX.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-CZvBbkn4.js → WorkflowPill--AYMW7u_.js} +2 -2
- package/dashboard/dist/assets/WorkflowPill--AYMW7u_.js.map +1 -0
- package/dashboard/dist/assets/WorkflowsDashboard-CZAqRk1N.js +2 -0
- package/dashboard/dist/assets/{WorkflowsDashboard-BRboBhlK.js.map → WorkflowsDashboard-CZAqRk1N.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowsOverview-BoN44VTE.js +2 -0
- package/dashboard/dist/assets/{WorkflowsOverview-CDFTYeQo.js.map → WorkflowsOverview-BoN44VTE.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-CmnZFevp.js → YamlWorkflowDetailPage-CqjhtdJf.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-CmnZFevp.js.map → YamlWorkflowDetailPage-CqjhtdJf.js.map} +1 -1
- package/dashboard/dist/assets/YamlWorkflowsPage-CwnJkzyb.js +2 -0
- package/dashboard/dist/assets/{YamlWorkflowsPage-Qq1jfcrH.js.map → YamlWorkflowsPage-CwnJkzyb.js.map} +1 -1
- package/dashboard/dist/assets/{agents-C7vUIO7e.js → agents-gV0Ys-sY.js} +2 -2
- package/dashboard/dist/assets/{agents-C7vUIO7e.js.map → agents-gV0Ys-sY.js.map} +1 -1
- package/dashboard/dist/assets/{bots-BaOblnW4.js → bots-B97itB3I.js} +2 -2
- package/dashboard/dist/assets/{bots-BaOblnW4.js.map → bots-B97itB3I.js.map} +1 -1
- package/dashboard/dist/assets/capabilities-CR9xZgGd.js +2 -0
- package/dashboard/dist/assets/{capabilities-RZpmDWoy.js.map → capabilities-CR9xZgGd.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-BwGdcwXR.js → controlplane-YxvP1KCa.js} +2 -2
- package/dashboard/dist/assets/{controlplane-BwGdcwXR.js.map → controlplane-YxvP1KCa.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-uq-IV2aj.js +2 -0
- package/dashboard/dist/assets/{escalation-columns-B4DG_5v8.js.map → escalation-columns-uq-IV2aj.js.map} +1 -1
- package/dashboard/dist/assets/index-3ezfWLkE.js +6 -0
- package/dashboard/dist/assets/index-3ezfWLkE.js.map +1 -0
- package/dashboard/dist/assets/{index-xNFTmmsv.js → index-B9BBCqLI.js} +2 -2
- package/dashboard/dist/assets/{index-xNFTmmsv.js.map → index-B9BBCqLI.js.map} +1 -1
- package/dashboard/dist/assets/{index-iegzyfMv.js → index-BQpV-DTG.js} +2 -2
- package/dashboard/dist/assets/{index-iegzyfMv.js.map → index-BQpV-DTG.js.map} +1 -1
- package/dashboard/dist/assets/index-Bp9KBLT5.js +2 -0
- package/dashboard/dist/assets/{index-IWufkcH9.js.map → index-Bp9KBLT5.js.map} +1 -1
- package/dashboard/dist/assets/index-Bpvfr4OW.css +1 -0
- package/dashboard/dist/assets/{index-D9NtDRtp.js → index-CFbo9FU9.js} +2 -2
- package/dashboard/dist/assets/{index-D9NtDRtp.js.map → index-CFbo9FU9.js.map} +1 -1
- package/dashboard/dist/assets/{index-BQPUlmmz.js → index-CIpHj4di.js} +2 -2
- package/dashboard/dist/assets/{index-BQPUlmmz.js.map → index-CIpHj4di.js.map} +1 -1
- package/dashboard/dist/assets/index-CIwlVfvV.js +67 -0
- package/dashboard/dist/assets/index-CIwlVfvV.js.map +1 -0
- package/dashboard/dist/assets/{index-BICLHYJJ.js → index-CUZ6LYye.js} +2 -2
- package/dashboard/dist/assets/{index-BICLHYJJ.js.map → index-CUZ6LYye.js.map} +1 -1
- package/dashboard/dist/assets/index-Cfvkl2J0.js +13 -0
- package/dashboard/dist/assets/index-Cfvkl2J0.js.map +1 -0
- package/dashboard/dist/assets/{index-BuqpU6ow.js → index-DMeaiKgf.js} +2 -2
- package/dashboard/dist/assets/{index-BuqpU6ow.js.map → index-DMeaiKgf.js.map} +1 -1
- package/dashboard/dist/assets/{index-G3NmdMjt.js → index-DwOnWeu8.js} +2 -2
- package/dashboard/dist/assets/{index-G3NmdMjt.js.map → index-DwOnWeu8.js.map} +1 -1
- package/dashboard/dist/assets/index-SGyrXGp8.js +3 -0
- package/dashboard/dist/assets/index-SGyrXGp8.js.map +1 -0
- package/dashboard/dist/assets/{index-DU9-flEo.js → index-ipqwPavs.js} +2 -2
- package/dashboard/dist/assets/{index-DU9-flEo.js.map → index-ipqwPavs.js.map} +1 -1
- package/dashboard/dist/assets/invoke-context-DrVyUEfs.js +2 -0
- package/dashboard/dist/assets/invoke-context-DrVyUEfs.js.map +1 -0
- package/dashboard/dist/assets/{knowledge-CjwCbm3E.js → knowledge-XX6cW4Ob.js} +2 -2
- package/dashboard/dist/assets/{knowledge-CjwCbm3E.js.map → knowledge-XX6cW4Ob.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-C-DMktCT.js → mcp-CH13hNH2.js} +2 -2
- package/dashboard/dist/assets/{mcp-C-DMktCT.js.map → mcp-CH13hNH2.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-KBeBNHb4.js → mcp-query-Duydd3JA.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-KBeBNHb4.js.map → mcp-query-Duydd3JA.js.map} +1 -1
- package/dashboard/dist/assets/{personas-B32sSCxm.js → personas-mDk4lLQS.js} +2 -2
- package/dashboard/dist/assets/{personas-B32sSCxm.js.map → personas-mDk4lLQS.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-DNLwDumm.js → pipelines-B5GcgCeF.js} +2 -2
- package/dashboard/dist/assets/{pipelines-DNLwDumm.js.map → pipelines-B5GcgCeF.js.map} +1 -1
- package/dashboard/dist/assets/resolver-payload-m9AGKZ3a.js +2 -0
- package/dashboard/dist/assets/resolver-payload-m9AGKZ3a.js.map +1 -0
- package/dashboard/dist/assets/{tasks-DrWSrjmj.js → tasks-CItmNsRp.js} +2 -2
- package/dashboard/dist/assets/{tasks-DrWSrjmj.js.map → tasks-CItmNsRp.js.map} +1 -1
- package/dashboard/dist/assets/{topics-DgzGU-vR.js → topics-CJYG7BX5.js} +2 -2
- package/dashboard/dist/assets/{topics-DgzGU-vR.js.map → topics-CJYG7BX5.js.map} +1 -1
- package/dashboard/dist/assets/useDebouncedValue-BrwgXcp8.js +2 -0
- package/dashboard/dist/assets/{useDebouncedValue-DG5JOj1F.js.map → useDebouncedValue-BrwgXcp8.js.map} +1 -1
- package/dashboard/dist/assets/{useFilterParams-crmlBw_l.js → useFilterParams-DBRw1Hcv.js} +2 -2
- package/dashboard/dist/assets/{useFilterParams-crmlBw_l.js.map → useFilterParams-DBRw1Hcv.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-CdgF7Jxo.js → useNamespace-CHty0HAS.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-CdgF7Jxo.js.map → useNamespace-CHty0HAS.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-BEaOtgSZ.js → useYamlActivityEvents-CoTsia7t.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-BEaOtgSZ.js.map → useYamlActivityEvents-CoTsia7t.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-BCWsItQ7.js → vendor-icons-DeBdvyKJ.js} +364 -144
- package/dashboard/dist/assets/vendor-icons-DeBdvyKJ.js.map +1 -0
- package/dashboard/dist/assets/vendor-query-DvWWuNIB.js +18 -0
- package/dashboard/dist/assets/vendor-query-DvWWuNIB.js.map +1 -0
- package/dashboard/dist/assets/{vendor-react-CdqEC2zv.js → vendor-react-_9U4mKFr.js} +2 -2
- package/dashboard/dist/assets/{vendor-react-CdqEC2zv.js.map → vendor-react-_9U4mKFr.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-YASUDPo0.js → yaml-workflows-CiWwx5rM.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-YASUDPo0.js.map → yaml-workflows-CiWwx5rM.js.map} +1 -1
- package/dashboard/dist/index.html +5 -5
- package/docs/api/http/workflows.md +52 -1
- package/docs/api/mcp/admin.md +40 -4
- package/docs/code-owned-configuration.md +1 -1
- package/docs/dashboard.md +45 -19
- package/docs/design-principles.md +6 -5
- package/docs/events.md +3 -1
- package/docs/faceted-routing.md +1 -1
- package/docs/hitl/form.md +12 -7
- package/docs/hitl/iframe.md +35 -6
- package/docs/hitl/invoke-form.md +101 -0
- package/docs/hitl/lookups.md +21 -0
- package/docs/hitl/x-lt-show-if.md +11 -0
- package/docs/hitl/x-lt-validation.md +50 -3
- package/docs/hitl/x-lt-widget.md +21 -0
- package/docs/hitl-guide.md +9 -4
- package/docs/iam.md +1 -1
- package/docs/scan-codes.md +13 -4
- package/docs/workflows.md +1 -1
- package/package.json +1 -1
- package/dashboard/dist/assets/AgentsPage-CoCWGhUd.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-BSqOctep.js +0 -2
- package/dashboard/dist/assets/BulkAssignModal-DYbM_6Or.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-DPHMBmgz.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-DPHMBmgz.js.map +0 -1
- package/dashboard/dist/assets/HomePage-zK3VP_9g.js +0 -2
- package/dashboard/dist/assets/ListToolbar-DaxloPQc.js +0 -2
- package/dashboard/dist/assets/OperatorDashboard-vXG0TjAQ.js +0 -2
- package/dashboard/dist/assets/ProcessesListPage-CKKNpk4z.js +0 -2
- package/dashboard/dist/assets/RolesPage-eayR9H4f.js +0 -2
- package/dashboard/dist/assets/RunAsSelector-D7RPwaAl.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-CuhqsBKo.js +0 -2
- package/dashboard/dist/assets/TasksListPage-DEQymbXC.js +0 -2
- package/dashboard/dist/assets/TimeAgo-CCxP67Rb.js +0 -2
- package/dashboard/dist/assets/WorkflowExecutionPage-BttnEvOd.js +0 -2
- package/dashboard/dist/assets/WorkflowPill-CZvBbkn4.js.map +0 -1
- package/dashboard/dist/assets/WorkflowsDashboard-BRboBhlK.js +0 -2
- package/dashboard/dist/assets/WorkflowsOverview-CDFTYeQo.js +0 -2
- package/dashboard/dist/assets/YamlWorkflowsPage-Qq1jfcrH.js +0 -2
- package/dashboard/dist/assets/capabilities-RZpmDWoy.js +0 -2
- package/dashboard/dist/assets/escalation-columns-B4DG_5v8.js +0 -2
- package/dashboard/dist/assets/index-8LIpvj2e.js +0 -3
- package/dashboard/dist/assets/index-8LIpvj2e.js.map +0 -1
- package/dashboard/dist/assets/index-BaC3sbJH.js +0 -67
- package/dashboard/dist/assets/index-BaC3sbJH.js.map +0 -1
- package/dashboard/dist/assets/index-CD6jtND1.css +0 -1
- package/dashboard/dist/assets/index-CsIw-ZLk.js +0 -6
- package/dashboard/dist/assets/index-CsIw-ZLk.js.map +0 -1
- package/dashboard/dist/assets/index-CtJkvX9e.js +0 -5
- package/dashboard/dist/assets/index-CtJkvX9e.js.map +0 -1
- package/dashboard/dist/assets/index-IWufkcH9.js +0 -2
- package/dashboard/dist/assets/useDebouncedValue-DG5JOj1F.js +0 -2
- package/dashboard/dist/assets/vendor-icons-BCWsItQ7.js.map +0 -1
- package/dashboard/dist/assets/vendor-query-RUZdMvN6.js +0 -18
- package/dashboard/dist/assets/vendor-query-RUZdMvN6.js.map +0 -1
- package/dashboard/dist/assets/workflows-CX_oarls.js +0 -2
- package/dashboard/dist/assets/workflows-CX_oarls.js.map +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Invoke Forms
|
|
2
|
+
|
|
3
|
+
A workflow's invoke form can be the same rich, versioned form the escalation surfaces use. Declare `inputSchema` on the worker config and the Invoke Tool page renders it with the full [x-lt-* vocabulary](../hitl-guide.md#full-vocabulary-quick-reference): two-column layout, sections, column groups, conditional display, instruction blocks, dynamic options, and a help panel. The submitted `data` is the x-lt-bind mapped payload, and the invoke API validates it against the same schema with the same shared pass, so a payload the form accepts is accepted by the API, and a rejection lists the exact violations the form shows.
|
|
4
|
+
|
|
5
|
+
Without `inputSchema`, the page renders the envelope template form from `envelopeSchema` exactly as before. Nothing changes for existing deployments until a workflow opts in.
|
|
6
|
+
|
|
7
|
+
## Declaring the form
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
const fleetToolsConfig: LTWorkerConfig = {
|
|
11
|
+
description: '**Fleet tools** — one form, four tools for one machine.',
|
|
12
|
+
invocable: true,
|
|
13
|
+
invocationRoles: ['printer-fleet', 'print-servicer'],
|
|
14
|
+
envelopeSchema: { data: {}, metadata: { source: 'dashboard' } },
|
|
15
|
+
inputSchema: FLEET_TOOLS_INPUT_SCHEMA,
|
|
16
|
+
icon: WORKFLOW_ICONS.WRENCH,
|
|
17
|
+
};
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Workflow names read as titles on the page: `fleetTools` shows as **Fleet Tools**, and queue names the same way, with the identifiers kept as metadata beside them.
|
|
21
|
+
|
|
22
|
+
| Field | Role in the invoke |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `inputSchema` | The form. JSON Schema `properties` plus x-lt-* tokens. Rendered by the Invoke Tool page; enforced by the invoke API. |
|
|
25
|
+
| `envelopeSchema.metadata` | The `metadata` the Invoke Tool page stamps on every run from this form. `envelopeSchema.data` is ignored when `inputSchema` is present. |
|
|
26
|
+
| `inputLookups` | Versioned knowledge refs (`{ domain, key, version, as? }`) the form reads as `lookup.<as ?? key>`. See [Lookups](lookups.md#pinning-on-a-workflow-config). |
|
|
27
|
+
| `invocationRoles` | Who sees the workflow on the Invoke Tool page and who may start it. Empty means every authenticated user. |
|
|
28
|
+
| `description` | One line at the top of the form column, markdown allowed. Keep the reference material in `x-lt-help`, which appears in the side panel on demand. |
|
|
29
|
+
| `icon` | A curated icon from `WORKFLOW_ICONS` (`icon: WORKFLOW_ICONS.WRENCH`). Leads the workflow's row and heading in place of the tier glyph so operators tell tools apart at a glance. The registry offers the same set as a picker. |
|
|
30
|
+
|
|
31
|
+
The registry detail page edits the same schema under **Input Form** in its Invocation column, beside a live preview of the form, and the registration wizard offers the field for new entries. The reference is [`examples/workflows/fleet-tools/forms.ts`](../../examples/workflows/fleet-tools/forms.ts): a `serialNumber` and an `action` decision, then one section per action that appears only when that action is chosen, each carrying its own knobs and its own instruction block.
|
|
32
|
+
|
|
33
|
+
## Form values, payload, and domains
|
|
34
|
+
|
|
35
|
+
The form edits flat values keyed by property name. On submit, `x-lt-bind` maps them into the nested `data` the workflow receives:
|
|
36
|
+
|
|
37
|
+
```jsonc
|
|
38
|
+
// properties
|
|
39
|
+
"serialNumber": { "x-lt-bind": "printer.serialNumber" },
|
|
40
|
+
"action": { "x-lt-bind": "tool.action" },
|
|
41
|
+
"copies": { "x-lt-bind": "tool.details.copies", "x-lt-showIf": "input.action=reprint-label" }
|
|
42
|
+
|
|
43
|
+
// POST /api/workflows/fleetTools/invoke
|
|
44
|
+
{ "data": { "printer": { "serialNumber": "printer-07" }, "tool": { "action": "reprint-label", "details": { "copies": 2 } } },
|
|
45
|
+
"metadata": { "source": "dashboard" } }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Conditions and help tokens read the live form under the `input` domain: `x-lt-showIf: "input.action=retire"`, `{{input.serialNumber}}`. `resolver` names the same values, so a schema written for an escalation form works unchanged. An invoke form reads four domains: `input`, `resolver`, `metadata` (the run's metadata), and `lookup` (the editions pinned by `inputLookups`, keyed `<as ?? key>`).
|
|
49
|
+
|
|
50
|
+
The gate validates against the `metadata` the caller sends. The Invoke Tool page sends the declared `envelopeSchema.metadata` plus the per-run `certified` flag; an API or MCP caller that wants a condition such as `x-lt-showIf: "metadata.mode=strict"` to hold sends that metadata itself.
|
|
51
|
+
|
|
52
|
+
Hidden conditional fields still submit their defaults, as on every x-lt-* form. Treat empty as absent in the workflow.
|
|
53
|
+
|
|
54
|
+
## Conditional instructions
|
|
55
|
+
|
|
56
|
+
An instruction is a read-only markdown field. Give it the same `x-lt-showIf` as the knobs it explains and it arrives with them:
|
|
57
|
+
|
|
58
|
+
```jsonc
|
|
59
|
+
"powerCycleFirst": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"x-lt-widget": "markdown",
|
|
62
|
+
"readOnly": true,
|
|
63
|
+
"default": "**Power cycle first.** Most stalls clear on a restart.",
|
|
64
|
+
"x-lt-section": "Report the machine offline",
|
|
65
|
+
"x-lt-showIf": ["input.action=report-offline", "!input.powerCycled"]
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
An array of conditions requires every one, so the prompt belongs to its tool and still reacts to the checkbox.
|
|
70
|
+
|
|
71
|
+
`x-lt-help` on the schema root is the longer reference for the side panel: markdown, tables, and `{{input.*}}` tokens that re-interpolate as the operator types.
|
|
72
|
+
|
|
73
|
+
## The Invoke Tool page
|
|
74
|
+
|
|
75
|
+
The page is open to anyone the server lists an invokable workflow for. Builders reach **Invoke Tool** under Orchestrate; every other persona gets a **Tools** section in the nav that appears only when there is something to invoke. Each invokable workflow is a tool; the list sits on the left, grouped by task queue, with the first workflow preselected; the form takes the rest of the row. Below 1280px the list folds into a select and the form takes the full width.
|
|
76
|
+
|
|
77
|
+
The form's side panel carries two views: **Instructions**, the interpolated `x-lt-help`, and **Issues**, the current violations, each click focusing its field. A server rejection lands in the same Issues view.
|
|
78
|
+
|
|
79
|
+
Once a run starts, the page subscribes to `system.workflow.{workflowId}.completed` and `.failed` for that id. The outcome and the workflow's returned `data` render beside Submit, so a tool's answer comes back to the person who asked for it. Submit disarms after one click until the person chooses to submit again, and a warning offers to reconnect live events when they are off.
|
|
80
|
+
|
|
81
|
+
## The server contract
|
|
82
|
+
|
|
83
|
+
`POST /api/workflows/:type/invoke` validates `data` against `input_schema` after the role check and before anything starts. A rejection is the canonical 422 body used by every schema gate:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"error": "data failed input schema validation (2 violations)",
|
|
88
|
+
"code": "schema_validation",
|
|
89
|
+
"violations": [
|
|
90
|
+
{ "field": "serialNumber", "message": "Required" },
|
|
91
|
+
{ "field": "action", "message": "Required" }
|
|
92
|
+
],
|
|
93
|
+
"role": null,
|
|
94
|
+
"schemaVersion": null,
|
|
95
|
+
"workflowType": "fleetTools"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The MCP tools `invoke_workflow` and `invoke_workflow_read_safe` run the same gate and return the body as an error result; `get_workflow_config` returns the `input_schema`, the declared metadata, and the resolved lookup data a caller needs to compose a valid payload. The gate reads bound paths from the nested `data`, skips fields a `x-lt-showIf` hides, resolves `x-lt-options` over pinned lookups, and applies every validation keyword the form applies.
|
|
100
|
+
|
|
101
|
+
`GET /api/workflows/invocable` returns the caller's invokable workflows with their tier. The list and the gate share one predicate, so the page never offers a workflow the API would refuse.
|
package/docs/hitl/lookups.md
CHANGED
|
@@ -37,6 +37,27 @@ const decision = await conditional<CascadeResolverV1>(signalId, {
|
|
|
37
37
|
|
|
38
38
|
The refs fold into `envelope.lookups` as a pure transform — a pinned wait costs exactly what an unpinned one does. A malformed ref (missing field, non-integer version) throws before the row is written; over the HTTP create surface the same validation answers with a 400.
|
|
39
39
|
|
|
40
|
+
## Pinning on a Workflow Config
|
|
41
|
+
|
|
42
|
+
An invoke form pins editions the same way. Declare `inputLookups` beside `inputSchema` on the worker config and the form reads them under `lookup.<as ?? key>`:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const fleetToolsConfig: LTWorkerConfig = {
|
|
46
|
+
invocable: true,
|
|
47
|
+
inputSchema: FLEET_TOOLS_INPUT_SCHEMA,
|
|
48
|
+
inputLookups: [{ domain: 'fleet', key: 'serial-numbers', version: 1, as: 'serials' }],
|
|
49
|
+
};
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```jsonc
|
|
53
|
+
// inputSchema.properties
|
|
54
|
+
"serialNumber": { "type": "string", "title": "Serial", "x-lt-options": "lookup.serials.items" }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The Invoke Tool page fetches `GET /api/workflows/:type/input-lookups` once per workflow; the grant is the invoke predicate, so whoever may start the workflow reads exactly the pinned editions. The invoke API resolves the same refs into the gate, so a value outside the edition is refused with the canonical 422. The registry detail page edits the refs under **Lookups** in its Invocation column; the preview renders against the resolved editions.
|
|
58
|
+
|
|
59
|
+
The refs are checked twice on save. Shape first: a missing `domain` or `key`, a `version` that is not a positive integer, or an empty `as` answers `400` with the field named. Existence second: a ref whose edition does not exist answers `400` naming the editions that do (`Lookup ref fleet/serial-numbers v3 names no edition (editions: v1, v2)`), from `PUT /api/workflows/:type/config` and from the MCP `upsert_workflow_config` tool alike. On the worker boot path a malformed ref fails the boot; a ref whose edition is not yet written logs a warning, since seeds commonly run after registration. At run time the resolver reads each edition once and holds it in memory (editions are immutable), a missing edition answers `missing: true` for that ref without failing the batch, the Invoke Tool page shows which pinned editions are unavailable, and the fields that read them follow the `x-lt-options` rules: a plain path falls back to the typed input, an interpolated path stays a disabled select and fails closed.
|
|
60
|
+
|
|
40
61
|
## Versioning
|
|
41
62
|
|
|
42
63
|
Every knowledge entry carries a `current_version`, and every write that changes its data mints an immutable snapshot automatically — no publish step:
|
|
@@ -21,6 +21,16 @@ Compare the resolved value's string form against a literal:
|
|
|
21
21
|
|
|
22
22
|
The expected value is the raw remainder after the operator (trimmed; no quoting). Numbers and booleans compare via their string form (`metadata.count=3`, `metadata.live=true`). An absent value compares as the empty string — so `=X` is false and `!=X` is true when the path is missing. `resolver.` conditions react live as the user edits, exactly like the truthy form — this is what drives per-designation sub-surfaces on verdict forms (different fields for send-to-design vs send-to-printing).
|
|
23
23
|
|
|
24
|
+
### Several conditions
|
|
25
|
+
|
|
26
|
+
Pass an array to require every condition. The field shows only when all hold:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
"x-lt-showIf": ["input.action=report-offline", "!input.powerCycled"]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Each entry uses the same grammar as a single condition. A hidden field is skipped by validation exactly as with one condition.
|
|
33
|
+
|
|
24
34
|
### Domains
|
|
25
35
|
|
|
26
36
|
| Domain | Resolves against |
|
|
@@ -30,6 +40,7 @@ The expected value is the raw remainder after the operator (trimmed; no quoting)
|
|
|
30
40
|
| `envelope` | The workflow-sent input envelope |
|
|
31
41
|
| `escalation` | Top-level escalation row fields (`role`, `status`, `priority`, …) |
|
|
32
42
|
| `resolver` | The submitted resolver payload — **live**: reacts in real time as the user edits the form |
|
|
43
|
+
| `input` | The same live form values under the invoke form's name (see [invoke-form.md](invoke-form.md)) |
|
|
33
44
|
|
|
34
45
|
Conditions based on `metadata`, `payload`, `envelope`, and `escalation` are static (read from the stored row). Conditions based on `resolver` are dynamic — the field appears or disappears immediately as the user edits a sibling field, without a page reload.
|
|
35
46
|
|
|
@@ -6,7 +6,7 @@ The form runs a full validation pass before any submit is accepted. Every visibl
|
|
|
6
6
|
|
|
7
7
|
## Required
|
|
8
8
|
|
|
9
|
-
Fields listed in the schema's `required` array block submission when empty. A red asterisk marks required fields. Required validation is skipped for fields hidden by `x-lt-showIf` at submission time.
|
|
9
|
+
Fields listed in the schema's `required` array block submission when empty. A red asterisk marks required fields. Empty means `null`, `undefined`, blank text, an unchecked checkbox, an object with no truthy value, an empty multi-select, or an empty `json` list. A boolean with an option list is answered by either value, and a `json` map is answered by any key. Required validation is skipped for fields hidden by `x-lt-showIf` at submission time.
|
|
10
10
|
|
|
11
11
|
```json
|
|
12
12
|
{
|
|
@@ -93,9 +93,30 @@ When `envelope.min_score` is `60`, submitting a score of `45` blocks with "Minim
|
|
|
93
93
|
|
|
94
94
|
---
|
|
95
95
|
|
|
96
|
-
##
|
|
96
|
+
## Select Options (`x-lt-options`)
|
|
97
97
|
|
|
98
|
-
A
|
|
98
|
+
`x-lt-options` takes one of three forms. A `"domain.path"` string, or an array of path strings, resolves the list from the context (first path that resolves wins). An array with **no string entries** is the list itself, written inline: `{ value, label }` objects, numbers, or booleans. A literal string value is written as an object, `{ "value": "rn", "label": "Registered Nurse" }`, since a bare string is always read as a path. A static `enum` wins over both.
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"properties": {
|
|
103
|
+
"role": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"x-lt-options": [{ "value": "rn", "label": "Registered Nurse" }, { "value": "lpn", "label": "Practical Nurse" }]
|
|
106
|
+
},
|
|
107
|
+
"powerCycled": {
|
|
108
|
+
"type": "boolean",
|
|
109
|
+
"x-lt-options": [{ "value": true, "label": "Yes" }, { "value": false, "label": "No" }]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
A boolean with an option list renders as a select, not a checkbox: use it for decisions, and keep the checkbox for confirmations.
|
|
116
|
+
|
|
117
|
+
**Clearable selects.** A select opens on a disabled **Choose…** placeholder and, once a value is picked, offers no way back. With `"x-lt-nullable": true` the placeholder stays enabled and picking it submits `null`, for a choice that may lawfully stay unmade.
|
|
118
|
+
|
|
119
|
+
The list can also ride the escalation instead of the schema. The token names a `"domain.path"`; the array of strings or numbers at that path becomes the field's options, one static role form, per-row legal values:
|
|
99
120
|
|
|
100
121
|
```json
|
|
101
122
|
{
|
|
@@ -126,6 +147,32 @@ When the envelope carries `left_quantity_options: [0, 1, 2, 3]`, the field rende
|
|
|
126
147
|
|
|
127
148
|
---
|
|
128
149
|
|
|
150
|
+
## Lists and Maps
|
|
151
|
+
|
|
152
|
+
A `type: "array"` field with its own `x-lt-options` (path or literal) renders as a multi-select of chips; the submitted value is the array of picked values in list order. A list is validated only when it is edited this way or through the `json` widget; a list shown as read-only tags is left alone.
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"required": ["roles"],
|
|
157
|
+
"properties": {
|
|
158
|
+
"roles": { "type": "array", "x-lt-options": [{ "value": "gluer", "label": "Gluer" }, { "value": "qa", "label": "QA" }], "minItems": 1, "maxItems": 2 },
|
|
159
|
+
"weights": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"x-lt-widget": "json",
|
|
162
|
+
"propertyNames": { "enum": ["bag", "plate", "spool"] },
|
|
163
|
+
"additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
- A required multi-select or `json` list needs at least one item. An empty optional list passes its constraints.
|
|
170
|
+
- Every item must belong to the option list (`Must be one of: gluer, qa`); `minItems`/`maxItems` bound the length (`At least 1 item`, `At most 2 items`); a `json` list checks each item against `items`, including `items.enum` (`Item 2: Expected a number`).
|
|
171
|
+
- A map's keys must belong to `propertyNames.enum` (`Unknown key "tray". Allowed: bag, plate, spool`) and every value must satisfy an object-shaped `additionalProperties` (`"bag": Minimum value is 0`). A required map needs at least one key; a zero weight is an answer.
|
|
172
|
+
- The same rules run on the wire: an API or MCP caller sending the list or map under the bound key receives the same violations as the form shows.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
129
176
|
## Checklist Completion (`x-lt-require-all`)
|
|
130
177
|
|
|
131
178
|
A checklist-widget field can require every item to be checked before submission:
|
package/docs/hitl/x-lt-widget.md
CHANGED
|
@@ -6,6 +6,7 @@ For rich inputs beyond standard HTML types, set `x-lt-widget` on any field:
|
|
|
6
6
|
|--------|------------|
|
|
7
7
|
| `"file-upload"` | File picker with drag-and-drop. Stores a base64 data URL. Use `accept` to filter file types. |
|
|
8
8
|
| `"code-editor"` | Monospace textarea with tab-key support. Use `x-lt-language` for the syntax hint. |
|
|
9
|
+
| `"json"` | Validated JSON editor for a `list` or `object` field. Unparseable text blocks submit as **Invalid JSON**; a parsed value is validated as the declared type. |
|
|
9
10
|
| `"signature"` | HTML5 Canvas drawing pad. Outputs a PNG data URL. |
|
|
10
11
|
| `"rich-text"` | Tall textarea for formatted text input. |
|
|
11
12
|
| `"markdown"` | Markdown source rendered with headings, tables, lists, code blocks. Editable by default; set `readOnly: true` for a pure content block. |
|
|
@@ -61,6 +62,26 @@ The submitted value is a base64 data URL (`data:image/png;base64,...`). `accept`
|
|
|
61
62
|
|
|
62
63
|
---
|
|
63
64
|
|
|
65
|
+
## JSON
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"properties": {
|
|
70
|
+
"weights": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"x-lt-widget": "json",
|
|
73
|
+
"propertyNames": { "enum": ["bag", "plate", "spool"] },
|
|
74
|
+
"additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
75
|
+
"description": "Zero or omit a key to exclude it"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
A monospace editor holding the raw JSON of a `type: "array"` or `"object"` field. While the text does not parse, the field reads **Invalid JSON** and blocks submit; once it parses, the value is validated as the declared type: `items` (`type`, `enum`, bounds), `minItems`, `maxItems` for lists; `propertyNames.enum` and `additionalProperties` (`type`, `minimum`, `maximum`) for maps. Empty text submits `null`. Typing never reformats the text. See [Lists and Maps](x-lt-validation.md#lists-and-maps).
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
64
85
|
## Signature
|
|
65
86
|
|
|
66
87
|
```json
|
package/docs/hitl-guide.md
CHANGED
|
@@ -24,6 +24,7 @@ This works because the form is data: a JSON Schema stored on the role, versioned
|
|
|
24
24
|
| Rename the resolve footer, or claim-and-submit in one gesture | Footer tokens | [x-lt-footer.md](hitl/x-lt-footer.md) |
|
|
25
25
|
| Block the resolve until embedded work drains, then auto-close when it does | `x-lt-submit-guard` | [x-lt-embed.md](hitl/x-lt-embed.md) |
|
|
26
26
|
| A fully custom UI nothing above can express | Iframe viewport | [iframe.md](hitl/iframe.md) |
|
|
27
|
+
| The same rich form for starting a workflow from the Invoke Tool page | `inputSchema` on the worker config | [invoke-form.md](hitl/invoke-form.md) |
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
@@ -103,7 +104,8 @@ Ordered as a learning path — each file adds one capability to the same form:
|
|
|
103
104
|
|
|
104
105
|
| Keyword | Level | Purpose |
|
|
105
106
|
|---------|-------|---------|
|
|
106
|
-
| `
|
|
107
|
+
| `input.*` | domain | The live form values on the Invoke surface (alias of `resolver.*`) for `x-lt-showIf`, `x-lt-help`, and `x-lt-options` |
|
|
108
|
+
| `x-lt-widget` | field | Rich control: `file-upload`, `code-editor`, `json`, `signature`, `rich-text`, `markdown`, `checklist`, `attachment` (alias `image`) |
|
|
107
109
|
| `x-lt-source` | field | Data path for context-driven widgets: `"domain.path"` or an ordered array of paths (first to resolve wins); may embed `{{domain.path}}` interpolation segments |
|
|
108
110
|
| `x-lt-require-all` | field | Checklist completion guard — every item must be checked, except items declared `required: false` |
|
|
109
111
|
| `x-lt-default-checked` | field | Checklist first-load default — an unanswered field initializes to every item checked (affirm-then-exception); saved answers are never clobbered |
|
|
@@ -113,10 +115,13 @@ Ordered as a learning path — each file adds one capability to the same form:
|
|
|
113
115
|
| `accept` | field | File-type filter for `file-upload` (e.g. `".pdf,.png"`) |
|
|
114
116
|
| `x-lt-bind` | field | Path in the resolver payload (e.g. `"customer.email"`) |
|
|
115
117
|
| `x-lt-span` | field | Column span in a `two-column` layout (`2` = full width) |
|
|
116
|
-
| `x-lt-showIf` | field | Show field when a value is truthy at `domain.path`; prefix `!` to invert; `=VALUE` / `!=VALUE` compare the string form |
|
|
118
|
+
| `x-lt-showIf` | field | Show field when a value is truthy at `domain.path`; prefix `!` to invert; `=VALUE` / `!=VALUE` compare the string form; an array requires every condition |
|
|
117
119
|
| `x-lt-hide-if-empty` | field | `true` — suppress the field when its value is null, `""`, `false`, or `0` |
|
|
118
120
|
| `x-lt-section` | field | Section group label |
|
|
119
|
-
| `x-lt-options` | field |
|
|
121
|
+
| `x-lt-options` | field | Select options — an inline literal list (`{ value, label }` objects, numbers, booleans), or a `"domain.path"` (or an ordered array of paths, first to resolve wins) resolved from the context; static `enum` wins; `{{domain.path}}` segments make cascading selects; on a list field, the multi-select's options |
|
|
122
|
+
| `x-lt-nullable` | field | `true` — a select keeps **Choose…** enabled and picking it submits `null` |
|
|
123
|
+
| `items` / `minItems` / `maxItems` | field | Rules for a multi-select or `json` list: `items` validates each entry, the bounds cap the length |
|
|
124
|
+
| `propertyNames` / `additionalProperties` | field | Map rules for the `json` editor: an `enum` of allowed keys, and the schema every value must satisfy |
|
|
120
125
|
| `x-lt-minimum` | field | Dynamic lower bound — resolves a `"domain.path"` from the escalation context |
|
|
121
126
|
| `x-lt-maximum` | field | Dynamic upper bound — resolves a `"domain.path"` from the escalation context |
|
|
122
127
|
| `x-lt-min-length` | field | Dynamic minimum string length — resolves a `"domain.path"` |
|
|
@@ -128,7 +133,7 @@ Ordered as a learning path — each file adds one capability to the same form:
|
|
|
128
133
|
| `x-lt-card` | schema (list) | `facet-board`: per-entity card — `{ title, state?, fields? }`; fields accept `format: "age"` |
|
|
129
134
|
| `x-lt-help` | schema | Markdown guidance for the side panel's Help view |
|
|
130
135
|
| `x-lt-context` | schema | Plain-text fallback for the Help view when `x-lt-help` is absent |
|
|
131
|
-
| `x-lt-viewport` | schema | Replace the generated form with a custom iframe UI |
|
|
136
|
+
| `x-lt-viewport` | schema | Replace the generated form with a custom iframe UI; `src` is the editor, `onPending` / `onResolved` show the embed at the other stages |
|
|
132
137
|
| `x-lt-submit-guard` | schema | Block the resolve while an embedded escalation query returns rows; `autoResolveWhenEmpty` auto-closes the claimed parent once it drains. Enforced isomorphically for `enforce_schema` roles |
|
|
133
138
|
| `x-lt-submit-on-claim` | schema | Claiming also resolves the form's seeded defaults in one gesture |
|
|
134
139
|
| `x-lt-labels` | schema | Per-target labels for the footer controls (`claim`, `cancel`, `submit`, `release`) |
|
package/docs/iam.md
CHANGED
|
@@ -259,7 +259,7 @@ The dashboard surfaces IAM across four pages:
|
|
|
259
259
|
|
|
260
260
|
**Accounts** (`/admin/users`) — unified management for User Accounts and Service Accounts via tab toggle. Create service accounts, assign roles, generate API keys. The key generation flow displays the raw key once; it cannot be retrieved after dismissal.
|
|
261
261
|
|
|
262
|
-
**Invoke
|
|
262
|
+
**Invoke Tool** (`/workflows/start`) — all invocable workflows in a single list with visual tier distinction. Certified workflows show the green shield; durable workflows show the standard icon. Both support Start Now and Schedule (cron).
|
|
263
263
|
|
|
264
264
|
**Connections** (`/credentials`) — each user manages their OAuth provider connections. Status, credential type, and expiry are visible. Users connect or revoke providers here.
|
|
265
265
|
|
package/docs/scan-codes.md
CHANGED
|
@@ -244,7 +244,11 @@ resolve lands back on the list rather than walking browser history — see
|
|
|
244
244
|
|
|
245
245
|
On the work form, the badge belongs to the submission, not the editing. Once
|
|
246
246
|
an item is claimed, anyone at the bench edits the form freely: a grant is not
|
|
247
|
-
required to type.
|
|
247
|
+
required to type. This is the read-only station login's surface: plain member
|
|
248
|
+
grants, none able to write. A login that holds its own write authority, an
|
|
249
|
+
operator with write scope on the queue or an admin or superadmin, is a person
|
|
250
|
+
and keeps the standard surface: another person's claim shows as claimed by
|
|
251
|
+
them, with the management verbs its RBAC allows, and no badge is asked of it. The submit is the state-changing act, so that is where the
|
|
248
252
|
badge is asked for. The form warns up front who the submit will act as — "When
|
|
249
253
|
you submit, you'll scan your badge to confirm you're <claimant>" — and the
|
|
250
254
|
submit opens a badge prompt naming that claimant. The resolve fires the moment
|
|
@@ -341,9 +345,14 @@ Capture sources are pluggable (`dashboard/src/lib/scan-sources/`): the
|
|
|
341
345
|
keyboard wedge is one provider behind a `ScanSource` contract; an RFID or
|
|
342
346
|
camera provider plugs into the same dispatch pipeline.
|
|
343
347
|
|
|
344
|
-
The **
|
|
345
|
-
|
|
346
|
-
|
|
348
|
+
The **header bar** runs rules without hardware: its type chip lists every
|
|
349
|
+
enabled rule as a Run mode, the bar shows the rule's code head (`10:1:`) ahead
|
|
350
|
+
of the input, and Enter composes and executes `10:1:<target>` through the same
|
|
351
|
+
pipeline a scanner uses. See [Search and run](dashboard.md#search-and-run).
|
|
352
|
+
|
|
353
|
+
The **scan panel** (the bar's menu footer, or the user menu) carries a manual
|
|
354
|
+
entry field — type or paste a whole code to execute it — the last scan's
|
|
355
|
+
outcome, the live barcode preview, and the capture settings.
|
|
347
356
|
|
|
348
357
|
## Scanner setup
|
|
349
358
|
|
package/docs/workflows.md
CHANGED
|
@@ -26,7 +26,7 @@ A certified workflow is durable plus the full Long Tail control plane. It has an
|
|
|
26
26
|
- **Invocation controls** — `invocable: true` exposes the workflow for external invocation via the API and dashboard.
|
|
27
27
|
- **Execution identity** — roles, default assignees, and `execute_as` overrides are defined in the config.
|
|
28
28
|
|
|
29
|
-
In the dashboard, certified workflows display a ShieldCheck icon with a "Certified" label in accent blue. Durable workflows display a muted "Durable" badge. Both are invocable from the same **Invoke
|
|
29
|
+
In the dashboard, certified workflows display a ShieldCheck icon with a "Certified" label in accent blue. Durable workflows display a muted "Durable" badge. Both are invocable from the same **Invoke Tool** page; the distinction is how much operational infrastructure backs them.
|
|
30
30
|
|
|
31
31
|
To certify a workflow, create a config entry with the `certified` flag:
|
|
32
32
|
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./vendor-query-RUZdMvN6.js";import{u as f}from"./agents-C7vUIO7e.js";import{b,w as v,b5 as j,e as N}from"./index-BaC3sbJH.js";import{u as y}from"./useFilterParams-crmlBw_l.js";import{b as w}from"./api-path-u2Jf9QXS.js";import{D as P}from"./DataTable-DFPMeqyQ.js";import{S}from"./StickyPagination-BIVTAMnP.js";import{F as k,b as A}from"./FilterBar-B61qKmFD.js";import{P as _}from"./PageHeader-xB92ELs3.js";import{L as C}from"./ListToolbar-DaxloPQc.js";import{f as F}from"./vendor-icons-BCWsItQ7.js";import{u as z}from"./vendor-react-CdqEC2zv.js";import"./EmptyState-lpUFYfun.js";const L=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"paused",label:"Paused"},{value:"error",label:"Error"}],T=[{key:"name",label:"Agent",render:e=>t.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[t.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${e.status==="active"?"bg-status-success":e.status==="paused"?"bg-status-warning":e.status==="error"?"bg-status-error":"bg-surface-border"}`}),t.jsx("span",{className:"text-xs font-medium text-text-primary whitespace-nowrap",children:e.id}),e.description&&t.jsx("p",{className:"flex-1 min-w-0 truncate text-2xs text-text-tertiary",children:e.description})]})},{key:"knowledge_domain",label:"Knowledge",render:e=>e.knowledge_domain?t.jsx("span",{className:"text-2xs font-mono text-text-secondary whitespace-nowrap",children:e.knowledge_domain}):t.jsx("span",{className:"text-text-quaternary",children:"—"}),className:"w-28"},{key:"schedules",label:"Schedules",render:e=>{var r,i;const s=(r=e.behaviors)==null?void 0:r.schedules,a=s!=null&&s.length?s.map(c=>c.cron):(i=e.behaviors)!=null&&i.cron?[e.behaviors.cron]:[];return a.length?t.jsxs("span",{className:"text-2xs font-mono text-text-secondary whitespace-nowrap",children:[a[0],a.length>1?` +${a.length-1}`:""]}):t.jsx("span",{className:"text-text-quaternary",children:"—"})},className:"w-28"},{key:"subscriptions",label:"Subscriptions",render:e=>{var i;const s=e.subscription_count??0,a=e.sub_topics??[];if(!s)return t.jsx("span",{className:"text-text-quaternary",children:"—"});const r=((i=a[0])==null?void 0:i.replace(/^lt\.events\./,""))??"";return t.jsxs("span",{className:"text-2xs font-mono text-text-secondary whitespace-nowrap",children:[r,s>1?` +${s-1}`:""]})},className:"w-36"},{key:"last_run_at",label:"Last Run",render:e=>e.last_run_at?t.jsx("span",{className:"whitespace-nowrap",children:t.jsx(N,{date:e.last_run_at})}):t.jsx("span",{className:"text-text-quaternary",children:"—"}),className:"w-32"}];function G(){var p;const e=z(),{data:s}=b(),a=v(),r=a!==null?a:!!((p=s==null?void 0:s.ai)!=null&&p.enabled),i=r?"Agent":"Automation",c=r?"Agents":"Automations";j();const{filters:u,setFilter:d,pagination:n}=y({filters:{status:""}}),{data:o,isLoading:x,refetch:g,isFetching:h}=f({status:u.status||void 0,limit:n.pageSize,offset:n.offset}),m=(o==null?void 0:o.total)??0;return t.jsxs("div",{children:[t.jsx(_,{title:c,docsHash:"#docs:agents.md",actions:t.jsxs("button",{onClick:()=>e("/agents/new"),className:"flex items-center gap-2 px-4 py-2 text-sm rounded-md bg-accent text-text-inverse hover:bg-accent-hover transition-colors",children:[t.jsx(F,{className:"w-4 h-4"})," Create ",i]})}),t.jsx(k,{actions:t.jsx(C,{onRefresh:()=>g(),isFetching:h,apiPath:w("/agents",{limit:n.pageSize,offset:n.offset,status:u.status||void 0})}),children:t.jsx(A,{label:"Status",value:u.status,onChange:l=>d("status",l),options:L})}),t.jsx(P,{columns:T,data:(o==null?void 0:o.agents)??[],keyFn:l=>l.id,onRowClick:l=>e(`/agents/${l.id}`),isLoading:x,emptyMessage:`No ${c.toLowerCase()} found`}),t.jsx(S,{page:n.page,totalPages:n.totalPages(m),onPageChange:n.setPage,total:m,pageSize:n.pageSize,onPageSizeChange:n.setPageSize})]})}export{G as AgentsPage};
|
|
2
|
-
//# sourceMappingURL=AgentsPage-CoCWGhUd.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b,j as e}from"./vendor-query-RUZdMvN6.js";import{t as Rt,v as Lt,b as _t,w as Bt,M as We,x as _e,y as Ut,z as zt,A as qt,B as Dt,E as Vt,G as It,H as Gt,I as Ht,K as Qt,L as Wt,O as Kt,p as Yt,Q as Xt,R as Zt,T as Jt,U as es,V as ts,W as ss,X as as,Y as ns,Z as rs,_ as is,$ as ls,a0 as os,a1 as cs,a2 as ds,a3 as us,a4 as xs}from"./index-BaC3sbJH.js";import{a as Ke,u as Ye,L as Be,f as ms}from"./vendor-react-CdqEC2zv.js";import{i as hs}from"./task-queues-7-sHKPsN.js";import{X as se,ai as ps,aj as fs,C as gs,d as bs,ak as ys,b as vs,s as js,r as Ns,U as Cs,al as ks,w as ws,am as Ss,an as Ps,Y as Ms,h as Ts,ao as As,P as Es,ap as Os}from"./vendor-icons-BCWsItQ7.js";import{u as Xe,C as $s,r as Fs,B as Rs,a as Ls}from"./BulkAssignModal-DYbM_6Or.js";import{m as _s,E as Bs,a as Us}from"./escalation-columns-B4DG_5v8.js";import{i as Ze,s as zs,E as qs}from"./CountdownTimer-DPHMBmgz.js";import{u as Ds}from"./useFilterParams-crmlBw_l.js";import{u as Vs}from"./useDebouncedValue-DG5JOj1F.js";import{D as Is}from"./DataTable-DFPMeqyQ.js";import{S as Gs}from"./StickyPagination-BIVTAMnP.js";import{P as Hs}from"./constants-BHkpVaqx.js";import{R as Qs,a as Ws}from"./RowActions-eYrzgQSj.js";import{U as Ks}from"./UserName-CsLnT75E.js";import"./EntityTimelinePanel-CtzpJ-j2.js";import"./FilterBar-B61qKmFD.js";import"./PriorityBadge-BETdj4M-.js";import"./RolePill-CYpL3a2d.js";import"./WorkflowPill-CZvBbkn4.js";import"./StatusBadge-BDeUwPtb.js";import"./EmptyState-lpUFYfun.js";function Ys(){const{pathname:t,search:s}=Ke(),i=Ye(),{resolveUrl:n}=Rt();b.useEffect(()=>{const m=t+s;if(Lt(m).length===0)return;const x=n(m);x!==m&&i(x,{replace:!0})},[t,s,n,i])}const Xs=["<","<=",">",">=","="],Zs=["priority","created_at","updated_at","status","role"],B="input text-xs py-1",Ue="select text-xs py-1",J="text-text-tertiary hover:text-text-primary transition-colors";function ze(t){return t==="true"?!0:t==="false"?!1:t.trim()!==""&&!Number.isNaN(Number(t))?Number(t):t}const Js=t=>Object.entries(t??{}).map(([s,i])=>({key:s,value:String(i)})),ea=t=>(t??[]).map(s=>{const[i,n]=Object.entries(s)[0]??["",""];return{key:i,value:String(n)}});function L({title:t,hint:s,children:i}){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})]}),i]})}function ee({value:t,onChange:s,placeholder:i}){return e.jsx("input",{list:"lt-facet-keys",className:`${B} w-40`,placeholder:i,value:t,onChange:n=>s(n.target.value)})}function ta({value:t,onChange:s,facetKeys:i=[],search:n="",onSearchChange:m}){const x=Js(t.facets),h=ea(t.block),f=t.range??[],o=t.exists??[],y=t.orderBy??[],N=r=>{const u={};for(const d of r)d.key&&(u[d.key]=ze(d.value));s({...t,facets:Object.keys(u).length?u:void 0})},S=r=>{const u=r.filter(d=>d.key).map(d=>({[d.key]:ze(d.value)}));s({...t,block:u.length?u:void 0})},M=r=>s({...t,range:r.length?r:void 0}),j=r=>s({...t,exists:r.length?r:void 0}),P=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:i.map(r=>e.jsx("option",{value:r},r))}),e.jsxs("datalist",{id:"lt-sort-fields",children:[Zs.map(r=>e.jsx("option",{value:r},r)),i.map(r=>e.jsx("option",{value:`metadata.${r}`},r))]}),m&&e.jsx(L,{title:"Match id",hint:"id · workflow · origin",children:e.jsx("input",{className:`${B} w-full`,placeholder:"Exact escalation, workflow, or origin id…",value:n,onChange:r=>m(r.target.value)})}),e.jsx(L,{title:"Has facet",hint:"metadata @>",children:[...x,{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:d=>{const l=[...x];l[u]={...r,key:d},N(l)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${B} w-40`,placeholder:"value",value:r.value,onChange:d=>{const l=[...x];l[u]={...r,value:d.target.value},N(l)}}),u<x.length&&e.jsx("button",{className:J,onClick:()=>N(x.filter((d,l)=>l!==u)),children:"×"})]},u))}),e.jsx(L,{title:"Range",hint:"numeric",children:[...f,{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:d=>{const l=[...f];l[u]={...r,facet:d},M(l.filter(c=>c.facet))}}),e.jsx("select",{className:Ue,value:r.op,onChange:d=>{const l=[...f];l[u]={...r,op:d.target.value},M(l.filter(c=>c.facet))},children:Xs.map(d=>e.jsx("option",{value:d,children:d},d))}),e.jsx("input",{type:"number",className:`${B} w-24`,value:r.value,onChange:d=>{const l=[...f];l[u]={...r,value:Number(d.target.value)},M(l.filter(c=>c.facet))}}),u<f.length&&e.jsx("button",{className:J,onClick:()=>M(f.filter((d,l)=>l!==u)),children:"×"})]},u))}),e.jsx(L,{title:"Has key",hint:"metadata ? key",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.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(o.filter(u=>u!==r)),children:"×"})]},r)),e.jsx(ee,{value:"",placeholder:"+ key",onChange:r=>{r&&!o.includes(r)&&j([...o,r])}})]})}),e.jsx(L,{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:d=>{const l=[...h];l[u]={...r,key:d},S(l)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${B} w-40`,placeholder:"value",value:r.value,onChange:d=>{const l=[...h];l[u]={...r,value:d.target.value},S(l)}}),u<h.length&&e.jsx("button",{className:J,onClick:()=>S(h.filter((d,l)=>l!==u)),children:"×"})]},u))}),e.jsx(L,{title:"Sort by",children:[...y,{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:`${B} w-44`,placeholder:"column or metadata.key",value:r.field,onChange:d=>{const l=[...y];l[u]={...r,field:d.target.value},P(l.filter(c=>c.field))}}),e.jsxs("select",{className:Ue,value:r.direction??"asc",onChange:d=>{const l=[...y];l[u]={...r,direction:d.target.value},P(l.filter(c=>c.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:d=>{const l=[...y];l[u]={...r,numeric:d.target.checked},P(l.filter(c=>c.field))}}),"num"]}),u<y.length&&e.jsx("button",{className:J,onClick:()=>P(y.filter((d,l)=>l!==u)),children:"×"})]},u))})]})}function sa({value:t,onChange:s,facetKeys:i,search:n,onSearchChange:m,activeFacetCount:x,onClear:h,onClose:f}){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:[x>0&&e.jsx("button",{onClick:h,className:"text-2xs text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),e.jsx("button",{onClick:f,className:"p-1 rounded hover:bg-surface-hover text-text-tertiary hover:text-text-primary transition-colors",title:"Close",children:e.jsx(se,{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(ta,{value:t,onChange:s,facetKeys:i,search:n,onSearchChange:m})]})]})}const qe="created_at";function he(t){return t.replace(/^metadata\./,"")}function aa({orderBy:t,onChange:s}){const i=t==null?void 0:t[0],n=(i==null?void 0:i.field)??qe,m=(i==null?void 0:i.direction)??"desc",x=n===qe,h=f=>s([{...i??{},field:n,direction:f}]);return e.jsxs("div",{className:"flex items-center gap-1.5",children:[!x&&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:n,children:he(n)}),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(se,{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":m==="desc",onClick:()=>h("desc"),className:`px-1.5 py-1 transition-colors ${m==="desc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:x?"Newest first":`${he(n)} descending`,children:e.jsx(ps,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",role:"radio","aria-checked":m==="asc",onClick:()=>h("asc"),className:`px-1.5 py-1 border-l border-surface-border transition-colors ${m==="asc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:x?"Oldest first":`${he(n)} ascending`,children:e.jsx(fs,{className:"w-3.5 h-3.5"})})]})]})}const na=t=>t.isPriorityPending||t.isClaimPending||t.isAssignPending||t.isUnassignPending||t.isTriagePending||t.isCancelPending,te="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",De=`${te} appearance-none cursor-pointer`,ra="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 ia(t){var f;const s=na(t),i=Xe(),{data:n}=_t(),m=Bt(),x=m!==null?m:((f=n==null?void 0:n.ai)==null?void 0:f.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:o=>{o.target.value&&(t.onSetPriority(parseInt(o.target.value)),o.target.value="")},disabled:s,className:De,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Priority…"}),Hs.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))]}),e.jsxs("select",{onChange:o=>{o.target.value&&(t.onClaim(parseInt(o.target.value)),o.target.value="")},disabled:s,className:De,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Claim for…"}),i.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value))]}),e.jsx("button",{onClick:t.onAssign,disabled:s,className:te,children:t.isAssignPending?"Assigning…":"Assign to…"}),e.jsx("button",{onClick:t.onUnassign,disabled:s,className:te,children:t.isUnassignPending?"Unassigning…":"Unassign"}),x&&e.jsx("button",{onClick:t.onTriage,disabled:s,className:te,children:t.isTriagePending?"Triaging…":"Triage"}),t.cancelLabel!==!1&&e.jsx("button",{onClick:t.onCancel,disabled:s,className:ra,children:t.isCancelPending?t.cancelLabel?`${t.cancelLabel}…`:"Cancelling…":t.cancelLabel||"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 la({open:t,onClose:s,selectedCount:i,onSubmit:n,isPending:m}){const[x,h]=b.useState(""),f=()=>{n(x||void 0)};return e.jsx(We,{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:i})," 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:x,onChange:o=>h(o.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:f,disabled:m,className:"btn-primary text-xs",children:m?"Submitting...":"Submit for Triage"})]})]})})}function _(t,s,i){return n=>{t.mutate(n,{onSuccess:()=>{s(),i==null||i()}})}}function oa(t){const s=()=>[...t.selectedIds];return{handleSetPriority:o=>{_(t.setPriority,t.clearSelection)({ids:s(),priority:o})},handleBulkClaim:o=>{_(t.bulkClaim,t.clearSelection)({ids:s(),durationMinutes:o})},handleBulkTriage:o=>{_(t.bulkTriage,t.clearSelection,t.closeTriageModal)({ids:s(),hint:o})},handleBulkAssign:(o,y,N)=>{_(t.bulkAssign,t.clearSelection,t.closeAssignModal)({ids:s(),targetUserId:o,durationMinutes:y,reassign:N})},handleBulkUnassign:()=>{_(t.bulkUnassign,t.clearSelection)({ids:s()})},handleBulkCancel:()=>{_(t.bulkCancel,t.clearSelection,t.closeCancelModal)({ids:s()})}}}function ca({claimTarget:t,onClose:s,claimDuration:i,onDurationChange:n,claimDurations:m,onCustomClaimChange:x,onClaim:h,isPending:f}){return e.jsx(We,{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:i,onChange:o=>{n(o.target.value)},className:"select w-full text-sm",children:[m.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),i==="custom"&&e.jsx($s,{onChange:x,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:f,children:f?"Claiming...":"Claim"})]})]})})}const Je={pending:"--lt-status-queued-graphic",claimed:"--lt-status-claimed-graphic",resolved:"--lt-status-success-graphic",cancelled:"--lt-text-quaternary",expired:"--lt-text-tertiary"},et="--lt-text-quaternary";function da(t){return Je[t]??et}const I=Object.fromEntries(Object.entries(Je).map(([t,s])=>[t,`rgb(var(${s}))`])),Ve=40,ua=64,xa=24,Ie=3;function tt(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 Ge(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 He(t){return t.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function ma(t,s){return t?[...s.filter(n=>n in t),...Object.keys(t).filter(n=>!s.includes(n))].map(n=>[n,t[n]]):[]}function ha({e:t}){const s=t.endMs-t.startMs;if(s<=0)return null;const i=I.pending,n=I.claimed,m=t.status==="cancelled"||t.status==="expired"?I.cancelled:I.resolved;let x=100,h=0,f=0;return t.claimedMs!==null?(x=Math.max(0,Math.min(100,(t.claimedMs-t.startMs)/s*100)),t.isOpen?h=100-x:(h=Math.max(0,Math.min(100-x,(t.endMs-t.claimedMs)/s*100)),f=Math.max(0,100-x-h))):t.isOpen||(f=100,x=0),e.jsxs("div",{className:"mt-2 h-0.5 rounded-full overflow-hidden flex bg-surface-sunken",children:[x>0&&e.jsx("div",{style:{width:`${x}%`,backgroundColor:i,opacity:.6}}),h>0&&e.jsx("div",{style:{width:`${h}%`,backgroundColor:n,opacity:.6}}),f>0&&e.jsx("div",{style:{width:`${f}%`,backgroundColor:m,opacity:.6}})]})}function pa({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:tt(t)})})}function Qe({e:t,highlightKeys:s,onRowClick:i}){const[n,m]=b.useState(!1),x=I[t.displayStatus]??`rgb(var(${et}))`,h=ma(t.metadata,s),f=n?h:h.slice(0,Ie),o=h.length-Ie;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:x},onClick:()=>i==null?void 0:i(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:He(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]})]})]}),f.length>0&&e.jsxs("div",{className:"border-t border-surface-border/40 pt-1 space-y-px",children:[f.map(([y,N])=>{const S=String(N),M=s.includes(y);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 ${M?"text-accent":"text-text-quaternary"}`,title:y,children:y}),e.jsx("span",{className:`flex-1 min-w-0 text-2xs font-medium truncate ${M?"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(Be,{to:_e(y,N,t.role),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Filter ${He(t.role)}: ${y} = ${S}`,onClick:j=>j.stopPropagation(),children:e.jsx(ys,{className:"w-2.5 h-2.5"})}),e.jsx(Be,{to:_e(y,N),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Search all: ${y} = ${S}`,onClick:j=>j.stopPropagation(),children:e.jsx(vs,{className:"w-2.5 h-2.5"})})]})]},y)}),o>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:y=>{y.stopPropagation(),m(N=>!N)},children:n?e.jsxs(e.Fragment,{children:[e.jsx(js,{className:"w-2.5 h-2.5"})," less"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ns,{className:"w-2.5 h-2.5"})," ",o," more"]})})]}),e.jsx(ha,{e:t}),t.assigned_to&&e.jsxs("div",{className:"mt-1 flex items-center justify-end gap-1 text-2xs text-text-tertiary",children:[e.jsx(Cs,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),e.jsx(Ks,{userId:t.assigned_to,className:"truncate max-w-[70%]"})]})]})}function fa({escalations:t,highlightKeys:s=[],onRowClick:i,total:n,page:m,totalPages:x,onPageChange:h}){var d,l;const f=Date.now(),y=t.map(c=>{const k=new Date(c.created_at).getTime(),w=c.resolved_at?new Date(c.resolved_at).getTime():null,g=c.claimed_at?new Date(c.claimed_at).getTime():null,C=!w&&c.status!=="cancelled"&&c.status!=="expired",$=w??(C?f:k+3e4),E=c.status==="pending"&&Ze(c)?"claimed":c.status;return{...c,startMs:k,claimedMs:g,endMs:$,isOpen:C,displayStatus:E}});if(y.length===0)return e.jsx("p",{className:"mt-12 text-center text-sm text-text-tertiary",children:"No escalations matched."});const N=y.length,M=Math.max(Math.abs((((d=y[N-1])==null?void 0:d.startMs)??0)-(((l=y[0])==null?void 0:l.startMs)??0)),1)/Math.max(N-1,1),j=ua/Math.max(M,1),r=new Set(y.map(c=>new Date(c.startMs).toDateString())).size>1;function u(c){const k=new Date(c),w=k.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return r?k.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"}),y.map((c,k)=>{const w=y[k-1],g=w?Math.abs(c.startMs-w.startMs):null,C=g!==null?Math.max(xa,Math.round(g*j)):0,$=k%2===0,E=da(c.displayStatus),U=`rgb(var(${E}))`,G=c.endMs-c.startMs,z=c.isOpen?Ge(c.startMs):`${Ge(c.startMs)} · ${tt(G)}`;return e.jsxs("div",{children:[k>0&&e.jsx(pa,{gapMs:g,heightPx:C}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-1 flex justify-end items-center",children:$?e.jsxs("div",{className:"flex items-center",children:[e.jsx(Qe,{e:c,highlightKeys:s,onRowClick:i}),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:z})}),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:U,boxShadow:`0 0 0 3px rgb(var(${E}) / 0.16), 0 1px 3px rgb(var(${E}) / 0.19)`},onClick:()=>i==null?void 0:i(c)}),e.jsx("div",{className:"flex-1 flex justify-start items-center",children:$?e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums pl-3",children:z}):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(Qe,{e:c,highlightKeys:s,onRowClick:i})]})})]}),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(c.startMs)})})]},c.id)})]}),x>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:m})," ","of ",e.jsx("span",{className:"font-medium text-text-secondary",children:x})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>h(m-1),disabled:m<=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(gs,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>h(m+1),disabled:m>=x,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(bs,{className:"w-4 h-4"})})]})]})]})}function Ua(){var Fe,Re,Le;Ys();const t=Ye(),{filters:s,setFilter:i,pagination:n}=Ds({filters:{role:"",type:"",priority:"",status:"available",search:""}});Ut({role:s.role||null,verbs:["created","claimed"]});const m=Vs(s.search),x=Xe(),[h,f]=b.useState(null),[o,y]=b.useState("30"),[N,S]=b.useState(0),M=b.useCallback(a=>S(a),[]),[j,P]=b.useState(new Set),r=b.useRef(null),u=b.useRef(null),d=b.useCallback(a=>{var v;if((v=u.current)==null||v.disconnect(),u.current=null,!a||typeof ResizeObserver>"u")return;const p=new ResizeObserver(()=>{var Z;(Z=r.current)==null||Z.style.setProperty("--lt-sticky-top",`${a.offsetHeight-1}px`)});p.observe(a),u.current=p},[]),[l,c]=b.useState(!1),[k,w]=ms(),g=b.useMemo(()=>zt(k),[k]),C=b.useCallback(a=>{w(p=>{const v=new URLSearchParams(p);return qt(v,a),v.delete("page"),v})},[w]),{data:$}=Dt(l),E=Vt(g)+(s.search?1:0),U="facet-query",{setPanel:G,closePanel:z,open:st,ownerKey:at}=It();b.useEffect(()=>{if(!l){z(U);return}G(e.jsx(sa,{value:g,onChange:C,facetKeys:($==null?void 0:$.keys)??[],search:s.search??"",onSearchChange:a=>i("search",a),activeFacetCount:E,onClear:()=>{C({}),i("search","")},onClose:()=>c(!1)}),{width:420,key:U})},[l,g,C,$,s.search,i,E,G,z]);const pe=st&&at===U,ae=b.useRef(!1);b.useEffect(()=>{if(pe){ae.current=!0;return}ae.current&&(ae.current=!1,c(!1))},[pe]);const[nt,ne]=b.useState(!1),[rt,re]=b.useState(!1),[it,ie]=b.useState(!1),lt=b.useCallback(a=>C({...g,orderBy:a}),[g,C]),H=Ke(),{data:Q}=Gt(),fe=Ht(),ot=b.useCallback(()=>{var v;const a=window.prompt("Pin label:");if(!(a!=null&&a.trim()))return;const p=((v=Q==null?void 0:Q.preferences)==null?void 0:v.pinnedViews)??[];fe.mutate({pinnedViews:[...p,{id:Qt(),label:a.trim(),url:H.pathname+H.search,badge:!0}]})},[H.pathname,H.search,Q,fe]),{canBulk:ct}=Wt(),{kiosk:le}=Kt(),ge=g.facets?Object.keys(g.facets):[],oe=k.get("view"),dt=b.useCallback(a=>{w(p=>{const v=new URLSearchParams(p);return a?v.set("view",a):v.delete("view"),v},{replace:!0})},[w]),q=oe==="timeline",ut=b.useCallback(a=>{const{[a]:p,...v}=g.facets??{};C({...g,facets:Object.keys(v).length>0?v:void 0})},[g,C]),be=Yt(),ye=Xt(),ve=Zt(),ce=Jt(),je=es(),de=ts(),W=ss(),{data:ue}=as(),{data:F}=ns(),{data:xe}=rs(),{user:K,isSuperAdmin:xt,hasRoleType:mt}=is(),Ne=xt||mt("admin"),Ce=b.useMemo(()=>new Set(((K==null?void 0:K.roles)??[]).map(a=>a.role)),[K]),ht=b.useMemo(()=>{const a=(F==null?void 0:F.roles)??[];return(Ne?a:a.filter(v=>Ce.has(v.role)&&!hs(v.role))).map(v=>({value:v.role,label:ls(v)})).sort((v,Z)=>v.label.localeCompare(Z.label))},[F,Ne,Ce]);b.useEffect(()=>{P(new Set)},[s.role,s.type,s.priority,s.status,m,n.page,n.pageSize]);const D=s.status||"",Y=D==="available",ke=D==="claimed",pt=ke?"pending":D==="resolved"?"resolved":D==="cancelled"?"cancelled":D==="expired"?"expired":void 0,T=s.role||(((Fe=g.roles)==null?void 0:Fe.length)===1?g.roles[0]:null),we=os(T??"",void 0,!!T),ft=cs(T??"",void 0,!!T),me=T?Fs((Re=ft.data)==null?void 0:Re.form_schema).cancel:void 0,V=((Le=we.data)==null?void 0:Le.list_schema)??null,Se=!T||we.isFetched,Pe=100,Me={role:s.role||void 0,type:s.type||void 0,priority:s.priority?parseInt(s.priority):void 0,limit:q?Pe:n.pageSize,offset:n.offset,sort_by:"created_at",order:"desc",search:m||void 0,...g,include:zs(V)?"envelope":void 0},gt=ds({...Me,enabled:Y&&Se}),bt=us({status:pt,claimed:ke||void 0,...Me,enabled:!Y&&Se}),yt=Y?gt:bt,{data:R,isLoading:vt,error:X,refetch:jt,isFetching:Te}=yt,A=(R==null?void 0:R.escalations)??[],O=(R==null?void 0:R.total)??0,Ae=!!T&&!!V&&!!V["x-lt-layout"]&&V["x-lt-layout"]!=="table",Ee=Ae&&!q&&(oe?oe==="rich":!0),Oe=q?"timeline":Ee?"rich":"table",$e=b.useMemo(()=>{if(!g.jeopardy||!T)return null;const a=((F==null?void 0:F.roles)??[]).find(v=>v.role===T),p=(a==null?void 0:a.priority_threshold_minutes)??(a==null?void 0:a.sla_minutes)??null;return p!=null?xs(p*6e4):null},[g.jeopardy,T,F]),Nt=b.useMemo(()=>{const a=new Set;for(const p of A)j.has(p.id)&&a.add(p.role);return[...a]},[A,j]),Ct=b.useMemo(()=>A.filter(a=>j.has(a.id)&&Ze(a)).length,[A,j]),kt=b.useCallback(()=>P(new Set),[]),wt=()=>{if(!h)return;const a=o==="custom"?N:parseInt(o);!a||a<=0||be.mutate({id:h.id,durationMinutes:a},{onSuccess:()=>{f(null),t(`/escalations/detail/${h.id}`)}})},{handleSetPriority:St,handleBulkClaim:Pt,handleBulkTriage:Mt,handleBulkAssign:Tt,handleBulkUnassign:At,handleBulkCancel:Et}=oa({selectedIds:j,clearSelection:kt,setPriority:ye,bulkClaim:ve,bulkTriage:de,bulkAssign:ce,bulkUnassign:je,bulkCancel:W,closeTriageModal:()=>ne(!1),closeAssignModal:()=>re(!1),closeCancelModal:()=>ie(!1)}),Ot=a=>{const p=new Set(j);p.has(a)?p.delete(a):p.add(a),P(p)},$t=()=>{j.size===A.length?P(new Set):P(new Set(A.map(a=>a.id)))},Ft=[ct?{key:"select",label:e.jsx("input",{type:"checkbox",checked:A.length>0&&j.size===A.length,onChange:$t,className:"rounded"}),render:a=>e.jsx("input",{type:"checkbox",checked:j.has(a.id),onChange:p=>{p.stopPropagation(),Ot(a.id)},onClick:p=>p.stopPropagation(),className:"rounded"}),className:"w-10",priority:1}:{key:"spacer",label:"",render:()=>null,className:"w-10",priority:3},..._s({highlightKeys:ge}),{key:"actions",label:"",render:a=>e.jsx(Qs,{children:e.jsx(Ws,{icon:ks,title:"Claim escalation",onClick:()=>f(a),alwaysVisible:!0,colorClass:"text-accent/40 hover:text-accent",size:"sm"})}),className:"w-10 text-right"}];return e.jsxs("div",{ref:r,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-10 min-w-0",children:[e.jsx(Bs,{role:s.role,options:ht,onChange:a=>i("role",a),locked:le}),!le&&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(ws,{className:"w-4 h-4",strokeWidth:1.5})})]}),e.jsxs("div",{ref:d,className:"sticky top-0 z-20 bg-surface",children:[e.jsx(Us,{filters:s,setFilter:i,roles:(ue==null?void 0:ue.roles)??[],types:(xe==null?void 0:xe.types)??[],showStatus:!0,showSearch:!1,showRole:!le,actions:e.jsxs(e.Fragment,{children:[q&&e.jsxs("span",{className:"text-2xs text-text-tertiary whitespace-nowrap",children:[O>100&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"font-medium text-text-secondary",children:[(n.page-1)*100+1,"–",Math.min(n.page*100,O)]})," of "]}),e.jsx("span",{className:"font-medium text-text-secondary",children:O})," ",O===1?"escalation":"escalations"]}),e.jsx(aa,{orderBy:g.orderBy,onChange:lt}),e.jsx("div",{role:"radiogroup","aria-label":"List view",className:"flex items-center rounded overflow-hidden border border-surface-border",children:[{key:"table",title:"Table view",Icon:Ss},{key:"rich",title:"Rich view",Icon:Ps},{key:"timeline",title:"Timeline view",Icon:Ms}].filter(a=>a.key!=="rich"||Ae).map(({key:a,title:p,Icon:v})=>e.jsx("button",{role:"radio","aria-checked":Oe===a,onClick:()=>dt(a),className:`px-1.5 py-1 transition-colors ${Oe===a?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:p,children:e.jsx(v,{className:"w-3.5 h-3.5"})},a))}),e.jsxs("button",{onClick:()=>c(a=>!a),"aria-pressed":l,className:`relative rounded border border-surface-border px-1.5 py-1 transition-colors ${l?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:"Faceted query",children:[e.jsx(Ts,{className:"w-3.5 h-3.5"}),E>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:E})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>jt(),disabled:Te,className:"inline-flex h-7 w-7 items-center justify-center rounded icon-link hover:bg-surface-hover disabled:opacity-50",title:"Refresh",children:e.jsx(As,{className:`w-4 h-4 ${Te?"animate-spin":""}`})}),e.jsx("button",{onClick:ot,className:"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(Es,{className:"w-4 h-4"})})]})]})}),e.jsx(ia,{selectedCount:j.size,onClearSelection:()=>P(new Set),onSetPriority:St,onClaim:Pt,onAssign:()=>re(!0),onUnassign:At,onTriage:()=>ne(!0),onCancel:()=>ie(!0),isPriorityPending:ye.isPending,isClaimPending:ve.isPending,isAssignPending:ce.isPending,isUnassignPending:je.isPending,isTriagePending:de.isPending,isCancelPending:W.isPending,cancelLabel:me}),(g.facets&&Object.keys(g.facets).length>0||g.jeopardy)&&e.jsxs("div",{className:"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:[g.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(Os,{className:"w-2.5 h-2.5",strokeWidth:2.5}),"in jeopardy",$e&&e.jsxs("span",{className:"font-mono font-normal opacity-90",children:["> ",$e]}),e.jsx("button",{onClick:()=>C({...g,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(se,{className:"w-2.5 h-2.5"})})]}),Object.entries(g.facets??{}).map(([a,p])=>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:a}),e.jsx("span",{className:"text-text-quaternary",children:"="}),e.jsx("span",{className:"font-mono max-w-[160px] truncate",title:String(p),children:String(p)}),e.jsx("button",{onClick:()=>ut(a),className:"ml-0.5 -mr-0.5 flex items-center text-text-quaternary hover:text-status-error transition-colors","aria-label":`Remove ${a} filter`,children:e.jsx(se,{className:"w-2.5 h-2.5"})})]},a)),Object.keys(g.facets??{}).length>1&&e.jsx("button",{onClick:()=>C({...g,facets:void 0}),className:"text-2xs text-text-quaternary hover:text-text-secondary transition-colors px-1",children:"clear all"})]})]}),X&&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:X.message==="Session expired"?"Your session has expired. Please log in again.":`Failed to load escalations: ${X.message}`}),q?e.jsx(fa,{escalations:A,highlightKeys:ge,onRowClick:a=>t(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),total:O,page:n.page,totalPages:Math.ceil(O/Pe),onPageChange:n.setPage}):Ee?e.jsx(qs,{role:T,listSchema:V,activeEscalations:A,onRowClick:a=>t(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),onOpenGroup:a=>t(a),onAddFacet:(a,p)=>C({...g,facets:{...g.facets??{},[a]:typeof p=="object"&&p!==null?JSON.stringify(p):p}}),total:O,page:n.page,totalPages:n.totalPages(O),pageSize:n.pageSize,onPageChange:n.setPage,onPageSizeChange:n.setPageSize}):e.jsxs(e.Fragment,{children:[e.jsx(Is,{columns:Ft,data:A,layout:"fixed",keyFn:a=>a.id,onRowClick:a=>t(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),isLoading:vt,emptyMessage:X?"Unable to load data":"No escalations"}),e.jsx(Gs,{page:n.page,totalPages:n.totalPages(O),onPageChange:n.setPage,total:O,pageSize:n.pageSize,onPageSizeChange:n.setPageSize})]}),e.jsx(ca,{claimTarget:h,onClose:()=>f(null),claimDuration:o,onDurationChange:a=>{y(a),S(0)},claimDurations:x,customClaimMinutes:N,onCustomClaimChange:M,onClaim:wt,isPending:be.isPending}),e.jsx(la,{open:nt,onClose:()=>ne(!1),selectedCount:j.size,onSubmit:Mt,isPending:de.isPending}),e.jsx(Rs,{open:rt,onClose:()=>re(!1),selectedCount:j.size,selectedRoles:Nt,claimedCount:Ct,onSubmit:Tt,isPending:ce.isPending}),e.jsx(Ls,{open:it,onClose:()=>ie(!1),onConfirm:Et,selectedCount:j.size,isPending:W.isPending,error:W.error,actionLabel:typeof me=="string"?me:void 0})]})}export{Ua as AvailableEscalationsPage};
|
|
2
|
-
//# sourceMappingURL=AvailableEscalationsPage-BSqOctep.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,a as u}from"./vendor-query-RUZdMvN6.js";import{M as L,b as U,_ as B,al as I}from"./index-BaC3sbJH.js";import{D as q,f as O}from"./constants-BHkpVaqx.js";import{u as R}from"./useDebouncedValue-DG5JOj1F.js";function J({open:a,onClose:i,onConfirm:r,selectedCount:s,isPending:l,error:c,actionLabel:d}){const x=!!s&&s>1,o=d||"Cancel",m=x?`${o} ${s} Items`:o==="Cancel"?"Cancel Item":o,n=x?`Are you sure you want to ${o}? This removes ${s} items from the work queue.`:`Are you sure you want to ${o}? This removes the item from the work queue.`;return e.jsx(L,{open:a,onClose:i,title:m,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-secondary",children:n}),e.jsx("p",{className:"text-xs text-text-tertiary",children:"This action cannot be undone."}),c&&e.jsx("p",{className:"text-xs text-status-error",children:c.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:i,disabled:l,className:"btn-secondary text-xs",children:"Keep"}),e.jsx("button",{onClick:r,disabled:l,className:"bg-status-error text-text-inverse px-3 py-1.5 rounded-md text-xs hover:opacity-90 transition-opacity disabled:opacity-50",children:l?"Working...":`Yes, ${o}`})]})]})})}const W="x-lt-labels",z=["claim","cancel","submit","escalate","release"];function Z(a){const i=a==null?void 0:a[W];if(!i||typeof i!="object"||Array.isArray(i))return{};const r=i,s={};r.cancel===!1&&(s.cancel=!1);for(const l of z){const c=r[l];typeof c=="string"&&c.trim().length>0&&(s[l]=c.trim())}return s}function G(){const{data:a}=U();return u.useMemo(()=>{var r;return(((r=a==null?void 0:a.escalation)==null?void 0:r.claimDurations)??q).map(s=>({value:String(s),label:O(s)}))},[a])}const K=[{value:1,label:"minutes"},{value:60,label:"hours"}];function Q({onChange:a,compact:i,autoFocus:r,"data-testid":s="custom-duration-input"}){const[l,c]=u.useState(""),[d,x]=u.useState(1);u.useEffect(()=>{const n=parseInt(l);a(n>0?n*d:0)},[l,d,a]);const o=i?"text-xs":"text-sm",m=i?"w-16":"w-20";return e.jsxs("div",{className:"flex items-center gap-2","data-testid":s,children:[e.jsx("input",{type:"number",min:1,max:d===60?24:1440,value:l,onChange:n=>c(n.target.value),placeholder:d===60?"hrs":"min",className:`input ${o} ${m} text-center`,autoFocus:r,"data-testid":`${s}-quantity`}),e.jsx("select",{value:d,onChange:n=>x(parseInt(n.target.value)),className:`select ${o} py-1`,"data-testid":`${s}-unit`,children:K.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))})]})}function P({open:a,onClose:i,selectedCount:r,selectedRoles:s,onSubmit:l,isPending:c,claimedCount:d=0,result:x=null}){const{isSuperAdmin:o}=B(),m=G(),[n,f]=u.useState("user"),[p,b]=u.useState(null),[g,v]=u.useState(""),[h,N]=u.useState("30"),[_,j]=u.useState(0),[k,S]=u.useState(!1),$=u.useCallback(t=>j(t),[]),T=!o&&s.length===1?s[0]:void 0,D=R(g,250),{data:y,isLoading:C}=I({role:T,status:"active",search:D.trim()||void 0,limit:200},{enabled:a}),A=(y==null?void 0:y.users)??[],w=()=>{f("user"),b(null),v(""),N("30"),j(0),S(!1),i()},E=t=>{b(t),f("duration")},M=()=>{f("user")},F=()=>{if(!p)return;const t=h==="custom"?_:parseInt(h);!t||t<=0||l(p.id,t,k)};return e.jsx(L,{open:a,onClose:w,title:"Assign Escalations",children:e.jsxs("div",{className:"space-y-4",children:[n==="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:r})," ","escalation(s) to:"]}),e.jsx("input",{type:"text",value:g,onChange:t=>v(t.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:[C&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"Loading users..."}),!C&&A.length===0&&e.jsx("p",{className:"text-xs text-text-tertiary p-3",children:"No users found"}),A.map(t=>e.jsxs("button",{onClick:()=>E(t),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:t.display_name||t.external_id}),t.email&&e.jsx("p",{className:"text-2xs text-text-tertiary",children:t.email})]},t.id))]}),e.jsx("div",{className:"flex justify-end pt-2",children:e.jsx("button",{onClick:w,className:"btn-secondary text-xs",children:"Cancel"})})]}),n==="duration"&&p&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Assign to"," ",e.jsx("span",{className:"font-medium text-text-primary",children:p.display_name||p.external_id})," ","for:"]}),e.jsxs("select",{value:h,onChange:t=>{N(t.target.value),j(0)},className:"select w-full text-sm",children:[m.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),h==="custom"&&e.jsx(Q,{onChange:$,autoFocus:!0}),d>0&&e.jsxs("label",{className:"flex items-start gap-2 text-xs text-text-secondary",children:[e.jsx("input",{type:"checkbox",checked:k,onChange:t=>S(t.target.checked),className:"mt-0.5"}),e.jsxs("span",{children:["Also reassign ",e.jsx("span",{className:"font-medium text-text-primary",children:d})," ","item(s) with a live claim — the current holder loses the item. Unchecked, those are skipped."]})]}),x&&x.skipped>0&&e.jsxs("p",{className:"text-xs text-status-warning","data-testid":"assign-skip-note",children:["Assigned ",x.assigned," · skipped ",x.skipped," with live claims."]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:M,className:"btn-secondary text-xs",children:"Back"}),e.jsx("button",{onClick:F,disabled:c,className:"btn-primary text-xs",children:c?"Assigning...":"Assign"})]})]})]})})}export{P as B,Q as C,J as a,Z as r,G as u};
|
|
2
|
-
//# sourceMappingURL=BulkAssignModal-DYbM_6Or.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as j,j as s}from"./vendor-query-RUZdMvN6.js";import{D as Q}from"./DataTable-DFPMeqyQ.js";import{M as X,am as $,ab as O,a3 as tt,e as W,a7 as et,p as st,an as nt,ao as rt,ap as at}from"./index-BaC3sbJH.js";import{a as it}from"./StatusBadge-BDeUwPtb.js";import{U as ot}from"./UserName-CsLnT75E.js";import{S as F}from"./StickyPagination-BIVTAMnP.js";import{aa as lt,b as ct}from"./vendor-icons-BCWsItQ7.js";import{u as I,a as dt}from"./vendor-react-CdqEC2zv.js";const ut=new Set(["__proto__","constructor","prototype"]);function G(t){const e=[];for(const n of t.split(".")){const r=n.match(/^([^[\]]*)((?:\[\d+\])*)$/);if(!r)throw new Error(`invalid x-lt-bind path segment: "${n}"`);const[,a,o]=r;if(a){if(ut.has(a))throw new Error(`x-lt-bind path may not target "${a}"`);e.push({key:a})}for(const i of o.match(/\d+/g)??[])e.push({index:Number(i)})}if(e.length===0)throw new Error(`empty x-lt-bind path: "${t}"`);return e}function xt(t,e,n){const r=G(e);let a=t;for(let i=0;i<r.length-1;i++){const c=r[i],l=r[i+1],d="key"in c?c.key:c.index,h="index"in l;(a[d]==null||typeof a[d]!="object")&&(a[d]=h?[]:{}),a=a[d]}const o=r[r.length-1];a["key"in o?o.key:o.index]=n}function L(t,e){let n=t;for(const r of G(e)){if(n==null||typeof n!="object")return;n=n["key"in r?r.key:r.index]}return n}function J(t,e){const n=e==null?void 0:e["x-lt-bind"];return typeof n=="string"&&n.length>0?n:t}function Ft(t,e){const n=e==null?void 0:e.properties;if(!n)return{...t};const r={};for(const[a,o]of Object.entries(n))a in t&&xt(r,J(a,o),t[a]);return r}function Kt(t,e){const n=e==null?void 0:e.properties;if(!n)return t?{...t}:{};const r={};for(const[a,o]of Object.entries(n)){const i=L(t,J(a,o));i!==void 0&&(r[a]=i)}return r}const mt=["escalation","metadata","envelope","payload","resolver","lookup"],ft=/\{\{\s*([^{}]+?)\s*\}\}/g,A="—";function K(t){if(t==null)return A;if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return JSON.stringify(t)}catch{return A}}function v(t,e){return t.replace(ft,(n,r)=>{const a=r.indexOf("."),o=a===-1?r:r.slice(0,a);if(!mt.includes(o))return A;const i=e[o];if(a===-1)return K(i);try{return K(L(i,r.slice(a+1)))}catch{return A}})}function bt(t){const e=t==null?void 0:t["x-lt-help"];if(typeof e=="string"&&e.trim().length>0)return e;const n=t==null?void 0:t["x-lt-context"];return typeof n=="string"&&n.trim().length>0?n:null}function Ut(t,e){const n=bt(t);return n?v(n,e):null}function qt({isTerminal:t,status:e,claimed:n,claimedByMe:r}){return t?e==="cancelled"?"This escalation was cancelled. The record is shown for reference.":"This escalation has been resolved. The submitted form is shown for reference.":r?"You have claimed this escalation. Fill out the form and submit to resolve it.":n?"Another user has claimed this escalation. It unlocks if their claim expires or is released.":"Claim this escalation to enable the form."}function pt(t){if(!t)return!1;try{const e=JSON.stringify(t);return e.includes("envelope.")||e.includes("payload.")}catch{return!1}}function R(t){return!!(t.assigned_to&&t.assigned_until&&new Date(t.assigned_until)>new Date)}function Pt(t){return!t.workflow_type}const U=[{text:"text-rose-400",bg:"bg-rose-400/[0.08]"},{text:"text-pink-400",bg:"bg-pink-400/[0.08]"},{text:"text-fuchsia-400",bg:"bg-fuchsia-400/[0.08]"},{text:"text-purple-400",bg:"bg-purple-400/[0.08]"},{text:"text-violet-400",bg:"bg-violet-400/[0.08]"},{text:"text-indigo-400",bg:"bg-indigo-400/[0.08]"},{text:"text-blue-400",bg:"bg-blue-400/[0.08]"},{text:"text-sky-400",bg:"bg-sky-400/[0.08]"},{text:"text-cyan-400",bg:"bg-cyan-400/[0.08]"},{text:"text-teal-400",bg:"bg-teal-400/[0.08]"},{text:"text-emerald-400",bg:"bg-emerald-400/[0.08]"},{text:"text-green-400",bg:"bg-green-400/[0.08]"},{text:"text-lime-400",bg:"bg-lime-400/[0.08]"},{text:"text-yellow-400",bg:"bg-yellow-400/[0.08]"},{text:"text-amber-400",bg:"bg-amber-400/[0.08]"},{text:"text-orange-400",bg:"bg-orange-400/[0.08]"},{text:"text-red-400",bg:"bg-red-400/[0.08]"},{text:"text-stone-400",bg:"bg-stone-400/[0.08]"},{text:"text-rose-300",bg:"bg-rose-300/[0.08]"},{text:"text-violet-300",bg:"bg-violet-300/[0.08]"},{text:"text-sky-300",bg:"bg-sky-300/[0.08]"},{text:"text-teal-300",bg:"bg-teal-300/[0.08]"},{text:"text-amber-300",bg:"bg-amber-300/[0.08]"},{text:"text-pink-300",bg:"bg-pink-300/[0.08]"}];function ht(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return Math.abs(e)}function gt(t){return U[ht(t)%U.length]}function Y({open:t,onClose:e,role:n,pairs:r,onNavigate:a,onAddFacet:o}){const[i,c]=j.useState(new Set),[l,d]=j.useState(t);t!==l&&(d(t),t&&c(new Set(r.length===1?[r[0].key]:[])));const h=f=>{c(u=>{const p=new Set(u);return p.has(f)?p.delete(f):p.add(f),p})},m=r.filter(f=>i.has(f.key)),x=Object.fromEntries(m.map(f=>[f.key,f.value])),b=m.length===0,y=f=>{e(),a(f)};return s.jsx(X,{open:t,onClose:e,title:"Refine",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-2xs text-text-tertiary",children:"Pick the facts to match — several combine into one narrower query."}),s.jsx("div",{className:"divide-y divide-surface-border/40 -mx-1",children:r.map(f=>{const u=i.has(f.key);return s.jsxs("button",{type:"button",onClick:()=>h(f.key),"aria-pressed":u,className:"w-full flex items-center gap-3 px-1 py-2.5 text-left group min-w-0","data-testid":"refine-pair",children:[s.jsx("span",{className:`w-4 h-4 rounded-[3px] border flex items-center justify-center shrink-0 transition-colors ${u?"bg-accent border-accent":"border-surface-border group-hover:border-accent/50"}`,"aria-hidden":!0,children:u&&s.jsx(lt,{className:"w-3 h-3 text-text-inverse",strokeWidth:3})}),s.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary w-28 shrink-0 truncate",title:f.key,children:f.label}),s.jsx("span",{className:"text-xs text-text-primary truncate flex-1 min-w-0",title:String(f.value),children:String(f.value)})]},f.key)})}),s.jsxs("div",{className:"flex items-center justify-end gap-3 pt-2 flex-wrap",children:[o&&s.jsx("button",{onClick:()=>{m.forEach(f=>o(f.key,f.value)),e()},disabled:b,className:"text-xs text-text-secondary hover:text-accent transition-colors disabled:opacity-40 disabled:cursor-not-allowed mr-auto","data-testid":"refine-add-filters",children:"Add to filters"}),s.jsx("button",{onClick:()=>y($(x)),disabled:b,className:"btn-secondary text-xs disabled:opacity-40 disabled:cursor-not-allowed","data-testid":"refine-search-all",children:"Search everywhere"}),s.jsxs("button",{onClick:()=>y($(x,n)),disabled:b,className:"btn-primary text-xs disabled:opacity-40 disabled:cursor-not-allowed","data-testid":"refine-filter-role",children:["Filter ",n]})]})]})})}function V(t){return t.status==="pending"?R(t)?"bg-status-claimed-graphic":"bg-status-active":it[t.status]??"bg-status-active"}function yt(t){const[,e]=j.useState(0);j.useEffect(()=>{if(!t)return;const n=window.setInterval(()=>e(r=>r+1),6e4);return()=>window.clearInterval(n)},[t])}function vt(t){var e;return[...t["x-lt-columns"]??[],...((e=t["x-lt-card"])==null?void 0:e.fields)??[]].some(n=>n.format==="age")}function _(t){const e=n=>{if(!n)return null;try{const r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}};return{escalation:t,metadata:t.metadata??null,envelope:e(t.envelope),payload:e(t.escalation_payload),resolver:e(t.resolver_payload)}}const jt=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/,D="—";function C({raw:t,format:e}){if(!t||t===D)return s.jsx("span",{className:"text-text-quaternary",children:D});if(e==="user")return s.jsx(ot,{userId:t,className:"block truncate"});if(e==="age"){const n=new Date(t);if(!Number.isNaN(n.getTime()))return s.jsx("span",{title:n.toLocaleString(),className:"tabular-nums whitespace-nowrap",children:et(t)})}return jt.test(t)?s.jsx(W,{date:t,format:"datetime",className:"text-text-primary"}):s.jsx(s.Fragment,{children:t})}const Nt=30;function wt(t){return t.status==="pending"&&!R(t)}function H({row:t,def:e,onView:n,prominent:r,forceView:a}){const o=(e==null?void 0:e.action)??"claim",i=a?"view":o,c=o===i&&(e!=null&&e.label)?e.label:i==="claim"?"Claim":"View",l=st(),d=I(),h=dt(),[m,x]=j.useState(""),b=i==="claim"&&!wt(t),y=u=>{if(u.stopPropagation(),i==="view"){n==null||n();return}if(e!=null&&e.submitOnClaim){d(`/escalations/detail/${t.id}`,{state:{autoStart:!0,durationMinutes:e==null?void 0:e.durationMinutes,from:h.pathname}});return}x(""),l.mutate({id:t.id,durationMinutes:(e==null?void 0:e.durationMinutes)??Nt},{onSuccess:()=>n==null?void 0:n(),onError:p=>x(p.message)})},f=r?"btn-primary text-xs shrink-0 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-accent":"px-2 py-0.5 rounded text-2xs font-medium text-accent/70 border border-accent/30 enabled:hover:text-accent enabled:hover:border-accent/60 enabled:hover:bg-accent/5 transition-colors disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap";return s.jsxs("span",{className:"inline-flex flex-col items-end gap-0.5",children:[s.jsx("button",{type:"button",onClick:y,disabled:l.isPending||b,title:b?t.status==="pending"?"claimed":t.status:void 0,className:f,"data-testid":"row-action-button",children:l.isPending?"Claiming…":c}),m&&s.jsx("span",{className:"text-2xs text-status-error","data-testid":"row-action-error",children:m})]})}function kt({esc:t,card:e,rowAction:n,onOpen:r,forceView:a}){const o=_(t),i=e.title?v(e.title,o):t.type;return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-start justify-between gap-6",children:[s.jsxs("button",{onClick:r,className:"text-left group min-w-0",children:[s.jsx("h3",{className:"heading-2 group-hover:text-accent transition-colors leading-tight",children:i}),e.subtitle&&s.jsx("p",{className:"text-xs text-text-tertiary mt-1.5",children:v(e.subtitle,o)})]}),s.jsx(H,{row:t,def:n,onView:r,prominent:!0,forceView:a})]}),e.fields&&e.fields.length>0&&s.jsx("dl",{className:"flex flex-wrap gap-x-10 gap-y-4 mt-6",children:e.fields.map((c,l)=>s.jsxs("div",{children:[s.jsx("dt",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:c.label}),s.jsx("dd",{className:"text-xs text-text-primary mt-1",children:s.jsx(C,{raw:v(c.value,o)})})]},l))}),e.body&&s.jsx("div",{className:"mt-7 pt-6 border-t border-surface-border/50",children:s.jsx(O,{content:v(e.body,o)})})]})}function Tt({role:t,def:e,onRowClick:n}){var d,h;const[r,a]=j.useState(!1),o=tt({role:t,status:e.status??"resolved",sort_by:"resolved_at",order:"desc",limit:e.limit??25,enabled:r,include:pt(e)?"envelope":void 0}),i=((d=o.data)==null?void 0:d.escalations)??[],c=((h=o.data)==null?void 0:h.total)??0,l=e.row??{};return r?o.isLoading?s.jsx("p",{className:"text-xs text-text-tertiary italic",children:"Loading history…"}):i.length===0?s.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No past revisions."}):s.jsxs("div",{children:[s.jsx("div",{className:"divide-y divide-surface-border/40",children:i.map(m=>{const x=_(m);return s.jsxs("button",{onClick:()=>n==null?void 0:n(m),className:"w-full text-left py-2.5 group flex items-center gap-3",children:[s.jsx("span",{className:`w-2.5 h-2.5 shrink-0 rounded-full dot-ring ${V(m)}`,title:m.status}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block text-xs text-text-primary group-hover:text-accent transition-colors truncate",children:l.title?v(l.title,x):m.type}),l.subtitle&&s.jsx("span",{className:"block text-2xs text-text-tertiary truncate",children:v(l.subtitle,x)})]}),l.meta?s.jsx("span",{className:"text-2xs text-text-tertiary shrink-0",children:v(l.meta,x)}):m.resolved_at&&s.jsx(W,{date:m.resolved_at,format:"relative",className:"text-2xs text-text-tertiary shrink-0 whitespace-nowrap"})]},m.id)})}),c>i.length&&s.jsxs("p",{className:"text-2xs text-text-quaternary mt-3",children:["Showing ",i.length," of ",c,"."]})]}):s.jsx("button",{onClick:()=>a(!0),className:"text-xs text-accent hover:underline","data-testid":"load-history",children:"Load full history →"})}function q(t,e){var a,o;const n=[],r=new Set;for(const i of e){const c=(a=i.value.match(B))==null?void 0:a[1];if(!c||r.has(c))continue;const l=(o=t.metadata)==null?void 0:o[c];l==null||l===""||(r.add(c),n.push({key:c,label:i.label,value:l}))}return n}function z({onOpen:t,className:e=""}){return s.jsx("button",{type:"button",onClick:n=>{n.stopPropagation(),t()},className:`p-1.5 rounded text-text-quaternary/70 hover:text-accent hover:bg-surface-hover transition-colors ${e}`,title:"Refine — filter or search by this row's values","aria-label":"Refine — filter or search by this row's values","data-testid":"row-refine",children:s.jsx(ct,{className:"w-3.5 h-3.5",strokeWidth:1.5})})}function St({schema:t,rows:e,role:n,onRowClick:r,onAddFacet:a,forceView:o}){const i=I(),c=t["x-lt-columns"]??[],l=t["x-lt-row-action"],[d,h]=j.useState(null),m=[{key:"_status",label:"",priority:1,className:"w-10",render:x=>s.jsx("span",{className:`w-2.5 h-2.5 inline-block rounded-full dot-ring ${V(x)}`,title:x.status})},...c.map((x,b)=>({key:`col-${b}`,label:x.label,priority:x.priority??(b===0?1:2),width:x.width??(b===0&&!c.some(y=>y.width)?"40%":void 0),render:y=>{const f=_(y),u=v(x.value,f);return s.jsx("span",{className:"block truncate",title:u&&u!==D?u:void 0,children:s.jsx(C,{raw:u,format:x.format})})}})),{key:"_refine",label:"",priority:1,className:"w-9",render:x=>q(x,c).length>0?s.jsx(z,{onOpen:()=>h(x)}):null},{key:"_action",label:"",priority:1,className:"w-44 text-right whitespace-nowrap",render:x=>s.jsx(H,{row:x,def:l,onView:()=>r==null?void 0:r(x),forceView:o})}];return s.jsxs(s.Fragment,{children:[s.jsx(Q,{columns:m,data:e,layout:"fixed",keyFn:x=>x.id,onRowClick:r,emptyMessage:"No pending items."}),s.jsx(Y,{open:!!d,onClose:()=>h(null),role:n,pairs:d?q(d,c):[],onNavigate:i,onAddFacet:a})]})}function P({children:t}){return s.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-3",children:t})}function _t(t,e){var o;const n=e.indexOf("."),r=e.startsWith("metadata.")?e.slice(9):null,a=new Map;for(const i of t){const c=_(i);let l;try{l=n===-1?c[e]:L(c[e.slice(0,n)],e.slice(n+1))}catch{l=void 0}if(l==null||l==="")continue;const d=String(l),h=r?((o=i.metadata)==null?void 0:o[r])??l:l,m=a.get(d);m?(m.count+=1,new Date(i.created_at)>new Date(m.latest.created_at)&&(m.latest=i)):a.set(d,{key:d,rawValue:h,latest:i,count:1})}return[...a.values()].sort((i,c)=>i.key.localeCompare(c.key))}const B=/^\{\{\s*metadata\.([a-zA-Z0-9_]+)\s*\}\}$/;function Et({schema:t,rows:e,role:n,onOpenDetail:r,onOpenGroup:a,onAddFacet:o,forceView:i}){const c=I(),l=t["x-lt-group-by"],d=t["x-lt-card"]??{},h=t["x-lt-row-action"],[m,x]=j.useState(null);if(!l)return s.jsx("p",{className:"text-xs text-text-tertiary italic",children:"facet-board needs an x-lt-group-by path."});const b=l.startsWith("metadata.")?l.slice(9):null,y=_t(e,l);if(y.length===0)return s.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No entities in scope."});const f=u=>{var N,T;const p=[];b&&p.push({key:b,label:b,value:u.rawValue});const k=new Set(p.map(S=>S.key));for(const S of d.fields??[]){const w=(N=S.value.match(B))==null?void 0:N[1];if(!w||k.has(w))continue;const g=(T=u.latest.metadata)==null?void 0:T[w];g==null||g===""||(k.add(w),p.push({key:w,label:S.label,value:g}))}return p};return s.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(15rem,1fr))] gap-4","data-testid":"facet-board",children:[y.map(u=>{const p=_(u.latest),k=d.title?v(d.title,p):u.key,N=d.state?v(d.state,p):u.latest.subtype||u.latest.status,T=gt(N),S=f(u).length>0,w=g=>{if(g.shiftKey&&b&&o){o(b,u.rawValue);return}r==null||r(u.latest)};return s.jsxs("div",{role:"button",tabIndex:0,onClick:w,onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),w(g))},title:b?"Open the latest item · ⇧ click to filter the board":"Open the latest item",className:"group/card border-l-2 border-accent/30 bg-surface-sunken/40 rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-surface-sunken/70 focus:outline-none focus-visible:ring-1 focus-visible:ring-accent/40","data-testid":"facet-board-card",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2.5",children:[s.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-text-secondary truncate",children:k}),s.jsxs("span",{className:"flex items-center gap-1 shrink-0",children:[s.jsx("span",{className:"px-1.5 py-0.5 rounded text-2xs font-mono font-medium",style:{color:T.text,backgroundColor:T.bg},title:N,children:N}),S&&s.jsx(z,{onOpen:()=>x(u),className:"-my-1 -mr-1"})]})]}),d.fields&&d.fields.length>0&&s.jsx("dl",{className:"space-y-1",children:d.fields.map((g,Z)=>{const E=v(g.value,p);return s.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[s.jsx("dt",{className:"text-2xs uppercase tracking-wider text-text-quaternary shrink-0",children:g.label}),s.jsx("dd",{className:"min-w-0 truncate text-2xs text-text-primary",title:E&&E!==D?E:void 0,children:s.jsx(C,{raw:E,format:g.format})})]},Z)})}),s.jsx("div",{className:"mt-3 flex justify-end",children:s.jsx(H,{row:u.latest,def:h,onView:()=>r==null?void 0:r(u.latest),forceView:i})})]},u.key)}),s.jsx(Y,{open:!!m,onClose:()=>x(null),role:n,pairs:m?f(m):[],onNavigate:a??c,onAddFacet:o})]})}function Wt({role:t,listSchema:e,activeEscalations:n,onRowClick:r,onOpenGroup:a,onAddFacet:o,forceViewAction:i,total:c,page:l,totalPages:d,pageSize:h,onPageChange:m,onPageSizeChange:x}){const b=e["x-lt-layout"],y=e["x-lt-active"]??{},f=e["x-lt-row-action"],u=n[0],p=e["x-lt-help"];yt(vt(e));const k=s.jsxs("div",{className:"border border-surface-border/60 bg-surface-sunken rounded-[0.25em] p-4",children:[s.jsx(P,{children:"Active"}),u?s.jsx(kt,{esc:u,card:y,rowAction:f,onOpen:()=>r==null?void 0:r(u),forceView:i}):s.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No active item right now."})]}),N=p&&u?s.jsx("div",{className:"mb-8",children:s.jsx(O,{content:v(p,_(u))})}):p?s.jsx("div",{className:"mb-8",children:s.jsx(O,{content:p})}):null;if(b==="facet-table"){const T=c??n.length;return s.jsxs("div",{children:[s.jsx(St,{schema:e,rows:n,role:t,onRowClick:r,onAddFacet:o,forceView:i}),l!==void 0&&d!==void 0&&m&&s.jsx(F,{page:l,totalPages:d,onPageChange:m,total:T,pageSize:h??25,onPageSizeChange:x})]})}return b==="facet-board"?s.jsxs("div",{children:[N,s.jsx(Et,{schema:e,rows:n,role:t,onOpenDetail:r,onOpenGroup:a,onAddFacet:o,forceView:i}),l!==void 0&&d!==void 0&&m&&d>1&&s.jsx(F,{page:l,totalPages:d,onPageChange:m,total:c??n.length,pageSize:h??25,onPageSizeChange:x})]}):b==="active-history"?s.jsxs("div",{children:[N,s.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-[1.6fr_1fr] gap-8 @split:gap-12 items-start",children:[k,s.jsxs("div",{className:"@split:pt-4",children:[s.jsx(P,{children:"History"}),s.jsx(Tt,{role:t,def:e["x-lt-history"]??{},onRowClick:r})]})]})]}):s.jsxs("div",{children:[N,k]})}const M=[{maxMs:0,color:"text-status-error"},{maxMs:300*1e3,color:"text-status-error"},{maxMs:900*1e3,color:"text-status-warning"},{maxMs:1/0,color:"text-text-secondary"}];function Mt(t){if(t<=0)return M[0].color;for(const e of M)if(t<e.maxMs)return e.color;return M[M.length-1].color}function Gt({until:t}){const[e,n]=j.useState(()=>new Date(t).getTime()-Date.now());j.useEffect(()=>{const a=setInterval(()=>{n(new Date(t).getTime()-Date.now())},1e3);return()=>clearInterval(a)},[t]);const r=j.useMemo(()=>{const a=new Date(t);return[{label:"ms",value:String(Math.max(0,e))},{label:"until",value:a.toISOString()},{label:"local",value:nt(a,"MMM d, yyyy h:mm:ss a")}]},[t,e]);return s.jsx(rt,{options:r,children:s.jsx("span",{className:`text-xs font-mono ${Mt(e)}`,children:at(e)})})}export{Gt as C,Wt as E,mt as H,Pt as a,Ut as b,v as c,qt as d,Kt as e,L as g,R as i,Ft as m,_ as r,pt as s};
|
|
2
|
-
//# sourceMappingURL=CountdownTimer-DPHMBmgz.js.map
|