@hotmeshio/long-tail 0.17.2 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/escalations/index.d.ts +1 -0
- package/build/api/escalations/index.js +5 -1
- package/build/api/escalations/resolve-batch.d.ts +58 -0
- package/build/api/escalations/resolve-batch.js +247 -0
- package/build/api/escalations/resolve.d.ts +11 -0
- package/build/api/escalations/resolve.js +2 -0
- package/build/api/settings.js +2 -0
- package/build/index.js +6 -0
- package/build/lib/events/publish.d.ts +1 -1
- package/build/modules/search.d.ts +21 -0
- package/build/modules/search.js +55 -0
- package/build/routes/escalations/metadata.js +19 -0
- package/build/routes/escalations/resolve.js +41 -0
- package/build/sdk/index.d.ts +21 -0
- package/build/sdk/index.js +3 -0
- package/build/services/escalation/batch.d.ts +38 -0
- package/build/services/escalation/batch.js +85 -0
- package/build/services/escalation/crud.d.ts +7 -0
- package/build/services/escalation/crud.js +1 -0
- package/build/services/escalation/index.d.ts +1 -0
- package/build/services/escalation/index.js +1 -0
- package/build/services/orchestrator/condition.d.ts +28 -0
- package/build/services/orchestrator/condition.js +28 -0
- package/build/services/role/types.d.ts +18 -0
- package/build/services/role/types.js +6 -0
- package/build/start/adapters.js +2 -0
- package/build/system/mcp-servers/human-queue-schemas.d.ts +13 -0
- package/build/system/mcp-servers/human-queue-schemas.js +6 -1
- package/build/system/mcp-servers/human-queue.d.ts +3 -1
- package/build/system/mcp-servers/human-queue.js +38 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/escalation.d.ts +24 -0
- package/build/types/escalation.js +18 -1
- package/build/types/events.d.ts +1 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/index.js +2 -1
- package/build/types/startup.d.ts +12 -1
- package/dashboard/dist/assets/{AdminDashboard-B_AVB7tk.js → AdminDashboard-DDY8bceq.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-B_AVB7tk.js.map → AdminDashboard-DDY8bceq.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-JoZko3JB.js → AgentConfigPage-D47sHnup.js} +6 -6
- package/dashboard/dist/assets/{AgentConfigPage-JoZko3JB.js.map → AgentConfigPage-D47sHnup.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-DfpR2Fgg.js → AgentDetailPage-DwrfByA2.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-DfpR2Fgg.js.map → AgentDetailPage-DwrfByA2.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-F2ixDk1Q.js → AgentsPage-CLSjlyXy.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-F2ixDk1Q.js.map → AgentsPage-CLSjlyXy.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-D2ukvuQh.js +2 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-D2ukvuQh.js.map +1 -0
- package/dashboard/dist/assets/{BotPicker-B8Yal8Mm.js → BotPicker-CbL7gQFq.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-B8Yal8Mm.js.map → BotPicker-CbL7gQFq.js.map} +1 -1
- package/dashboard/dist/assets/BulkAssignModal-CMSgvHIs.js +2 -0
- package/dashboard/dist/assets/{BulkAssignModal-ySfoaF7f.js.map → BulkAssignModal-CMSgvHIs.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-Q9Pe0y_p.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-BSJ2oFj6.js.map → CapabilitiesPage-Q9Pe0y_p.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-CcV88IUy.js → CollapsibleSection-BZOtaWPR.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-CcV88IUy.js.map → CollapsibleSection-BZOtaWPR.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-CQsJUzEa.js → ConfirmDeleteModal-6CidwpPx.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-CQsJUzEa.js.map → ConfirmDeleteModal-6CidwpPx.js.map} +1 -1
- package/dashboard/dist/assets/CountdownTimer-B5lM7PfE.js +2 -0
- package/dashboard/dist/assets/{CountdownTimer-C-E9MXMk.js.map → CountdownTimer-B5lM7PfE.js.map} +1 -1
- package/dashboard/dist/assets/CredentialsPage-dxjrUEyO.js +2 -0
- package/dashboard/dist/assets/{CredentialsPage-DrydlZ65.js.map → CredentialsPage-dxjrUEyO.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-BxQmJXos.js → CronLabel-D8oo8eaA.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-BxQmJXos.js.map → CronLabel-D8oo8eaA.js.map} +1 -1
- package/dashboard/dist/assets/{DropZone-Pv-v5RAs.js → DropZone-CWCh5ItZ.js} +2 -2
- package/dashboard/dist/assets/{DropZone-Pv-v5RAs.js.map → DropZone-CWCh5ItZ.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-lszUXiyP.js → ElapsedCell-FHHQ69G3.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-lszUXiyP.js.map → ElapsedCell-FHHQ69G3.js.map} +1 -1
- package/dashboard/dist/assets/EntityTimelinePanel-B5NuHnPF.js +2 -0
- package/dashboard/dist/assets/{EntityTimelinePanel-CwzIV87U.js.map → EntityTimelinePanel-B5NuHnPF.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-D16uUVcG.js → EscalationListSchemaPage-D5L5lDNb.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-D16uUVcG.js.map → EscalationListSchemaPage-D5L5lDNb.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-BLM3dUEw.js → EscalationSchemaPage-bYbfEpSB.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-BLM3dUEw.js.map → EscalationSchemaPage-bYbfEpSB.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-BlFjoKlR.js → EscalationsOverview-DjtIjL1b.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-BlFjoKlR.js.map → EscalationsOverview-DjtIjL1b.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-rTkMR8Zf.js → EventTable-CihVTREC.js} +2 -2
- package/dashboard/dist/assets/{EventTable-rTkMR8Zf.js.map → EventTable-CihVTREC.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-BeVBUdfJ.js → FilterBar-Fin1IqHc.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-BeVBUdfJ.js.map → FilterBar-Fin1IqHc.js.map} +1 -1
- package/dashboard/dist/assets/GraphInvokePage-D77ILPd3.js +2 -0
- package/dashboard/dist/assets/{GraphInvokePage-BV60xkVy.js.map → GraphInvokePage-D77ILPd3.js.map} +1 -1
- package/dashboard/dist/assets/HomePage-8XsQFqKL.js +2 -0
- package/dashboard/dist/assets/{HomePage-BA0RYzFc.js.map → HomePage-8XsQFqKL.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-4IfsUXfV.js → ListToolbar-DyHaJBTk.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-4IfsUXfV.js.map → ListToolbar-DyHaJBTk.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-gDegMXvF.js → McpOverview-qz7Ivf0G.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-gDegMXvF.js.map → McpOverview-qz7Ivf0G.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-CnCffPks.js → McpQueryDetailPage-D6MB4CZM.js} +3 -3
- package/dashboard/dist/assets/{McpQueryDetailPage-CnCffPks.js.map → McpQueryDetailPage-D6MB4CZM.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryPage-BqqRF5cQ.js +2 -0
- package/dashboard/dist/assets/{McpQueryPage-CLEMtLOG.js.map → McpQueryPage-BqqRF5cQ.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-tr-lrWVv.js → McpRunDetailPage-DxLEhzhn.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-tr-lrWVv.js.map → McpRunDetailPage-DxLEhzhn.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-nE0d_1Px.js → McpRunsPage-BOsS4Hdf.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-nE0d_1Px.js.map → McpRunsPage-BOsS4Hdf.js.map} +1 -1
- package/dashboard/dist/assets/{NamespacePill-DONj6eUU.js → NamespacePill-CJikgGzE.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-DONj6eUU.js.map → NamespacePill-CJikgGzE.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-C8h1DN5Q.js → OperationsPage-Cj1mJLMC.js} +3 -3
- package/dashboard/dist/assets/{OperationsPage-C8h1DN5Q.js.map → OperationsPage-Cj1mJLMC.js.map} +1 -1
- package/dashboard/dist/assets/OperatorDashboard-C5rlijvh.js +2 -0
- package/dashboard/dist/assets/{OperatorDashboard-DCG8BFKE.js.map → OperatorDashboard-C5rlijvh.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-CFVw67M6.js → PageHeader-DZmymFBS.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-CFVw67M6.js.map → PageHeader-DZmymFBS.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-D9tQxILm.js → PageHeaderWithStats-DuAm6YK2.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-D9tQxILm.js.map → PageHeaderWithStats-DuAm6YK2.js.map} +1 -1
- package/dashboard/dist/assets/PersonaDetailPage-JBdVvT5g.js +2 -0
- package/dashboard/dist/assets/{PersonaDetailPage-BEVeJr1q.js.map → PersonaDetailPage-JBdVvT5g.js.map} +1 -1
- package/dashboard/dist/assets/PersonasPage-Xp_Gt6El.js +2 -0
- package/dashboard/dist/assets/{PersonasPage-B5fj2AK6.js.map → PersonasPage-Xp_Gt6El.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-CWGby6KD.js → ProcessDetailPage-CHnzOzQn.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-CWGby6KD.js.map → ProcessDetailPage-CHnzOzQn.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-nFdLMlfb.js → ProcessesListPage-DuXTS5-v.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-nFdLMlfb.js.map → ProcessesListPage-DuXTS5-v.js.map} +1 -1
- package/dashboard/dist/assets/RoleDetailPage-C9GGHNf4.js +8 -0
- package/dashboard/dist/assets/RoleDetailPage-C9GGHNf4.js.map +1 -0
- package/dashboard/dist/assets/{RolePill-Di_5hfvw.js → RolePill-C9LSs1aK.js} +2 -2
- package/dashboard/dist/assets/{RolePill-Di_5hfvw.js.map → RolePill-C9LSs1aK.js.map} +1 -1
- package/dashboard/dist/assets/RolesPage-h77-JOLd.js +2 -0
- package/dashboard/dist/assets/{RolesPage-DwprdPCA.js.map → RolesPage-h77-JOLd.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-DGw9EKSR.js → RunAsSelector-DoLFJ0mZ.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-DGw9EKSR.js.map → RunAsSelector-DoLFJ0mZ.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-RPi4qZ_l.js → ScanCodesPage-b5NZM_-f.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-RPi4qZ_l.js.map → ScanCodesPage-b5NZM_-f.js.map} +1 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-t7X6ekaW.js +2 -0
- package/dashboard/dist/assets/{ScanSchemeDetailPage-BKc4lUjc.js.map → ScanSchemeDetailPage-t7X6ekaW.js.map} +1 -1
- package/dashboard/dist/assets/ScanStationPage-r02hkTAG.js +2 -0
- package/dashboard/dist/assets/{ScanStationPage-DUfxcntB.js.map → ScanStationPage-r02hkTAG.js.map} +1 -1
- package/dashboard/dist/assets/{ScopeBadge-CqIIeWjK.js → ScopeBadge-CjyC7iyO.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-CqIIeWjK.js.map → ScopeBadge-CjyC7iyO.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-DXOk5z5X.js → StickyPagination-BGHQbp0_.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-DXOk5z5X.js.map → StickyPagination-BGHQbp0_.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-BB1h2zZN.js → StreamMessageDetail-C-wfdbLJ.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-BB1h2zZN.js.map → StreamMessageDetail-C-wfdbLJ.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-CapKokLg.js → SwimlaneTimeline-Dnoz-me3.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-CapKokLg.js.map → SwimlaneTimeline-Dnoz-me3.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-BLwxTNsI.js → TagInput-D-vLSMQC.js} +2 -2
- package/dashboard/dist/assets/{TagInput-BLwxTNsI.js.map → TagInput-D-vLSMQC.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-Dfzdp97x.js → TaskDetailPage-c9IiAhVJ.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-Dfzdp97x.js.map → TaskDetailPage-c9IiAhVJ.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-DVgcqd-h.js → TaskQueuePill-sFRMrQ5D.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-DVgcqd-h.js.map → TaskQueuePill-sFRMrQ5D.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-DxlS7PTD.js → TasksListPage-Dor8LSc5.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-DxlS7PTD.js.map → TasksListPage-Dor8LSc5.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-Bv5viQ1m.js → TimeAgo-Dd8vmRnM.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-Bv5viQ1m.js.map → TimeAgo-Dd8vmRnM.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-DXNBf_eb.js → TimestampCell-qJfC6-iT.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-DXNBf_eb.js.map → TimestampCell-qJfC6-iT.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-C6hkOqPx.js → ToolPill-OQ3mC11d.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-C6hkOqPx.js.map → ToolPill-OQ3mC11d.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-f32mir7Q.js → ToolTestPanel-CEGY5jss.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-f32mir7Q.js.map → ToolTestPanel-CEGY5jss.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-D-N8Vsd4.js → TopicDetailPage-SI80ZTVv.js} +3 -3
- package/dashboard/dist/assets/{TopicDetailPage-D-N8Vsd4.js.map → TopicDetailPage-SI80ZTVv.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-hqlu32wg.js → TopicsPage-DiVB8tNr.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-hqlu32wg.js.map → TopicsPage-DiVB8tNr.js.map} +1 -1
- package/dashboard/dist/assets/UserName-Dmm456xT.js +2 -0
- package/dashboard/dist/assets/{UserName-BhA_ItNN.js.map → UserName-Dmm456xT.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-BAgMKnhe.js → WorkflowExecutionPage-e-Q57yiJ.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-BAgMKnhe.js.map → WorkflowExecutionPage-e-Q57yiJ.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-CN-952iI.js → WorkflowPill-Dh3hIW1l.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill-CN-952iI.js.map → WorkflowPill-Dh3hIW1l.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-B2wYT_hj.js → WorkflowsDashboard-DLKzN80h.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-B2wYT_hj.js.map → WorkflowsDashboard-DLKzN80h.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview--jC5F9lz.js → WorkflowsOverview-J-ITQiO5.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview--jC5F9lz.js.map → WorkflowsOverview-J-ITQiO5.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-BdB5eX8s.js → YamlWorkflowDetailPage-B_-ahhf1.js} +11 -11
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-BdB5eX8s.js.map → YamlWorkflowDetailPage-B_-ahhf1.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-BUQQU9II.js → YamlWorkflowsPage-DQNeERXU.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-BUQQU9II.js.map → YamlWorkflowsPage-DQNeERXU.js.map} +1 -1
- package/dashboard/dist/assets/{agents-BF_S1J_z.js → agents-BsJ-MizQ.js} +2 -2
- package/dashboard/dist/assets/{agents-BF_S1J_z.js.map → agents-BsJ-MizQ.js.map} +1 -1
- package/dashboard/dist/assets/{bots-CGlEoWAu.js → bots-q1UYqaIh.js} +2 -2
- package/dashboard/dist/assets/{bots-CGlEoWAu.js.map → bots-q1UYqaIh.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-Pq8pG0kX.js → capabilities-BvjPXUcJ.js} +2 -2
- package/dashboard/dist/assets/{capabilities-Pq8pG0kX.js.map → capabilities-BvjPXUcJ.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-dY6a4iYT.js → controlplane-BwlNpoJ_.js} +2 -2
- package/dashboard/dist/assets/{controlplane-dY6a4iYT.js.map → controlplane-BwlNpoJ_.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-Bo3PfIZj.js +2 -0
- package/dashboard/dist/assets/{escalation-columns-CBUTda5U.js.map → escalation-columns-Bo3PfIZj.js.map} +1 -1
- package/dashboard/dist/assets/index-8Gmtvd8e.js +2 -0
- package/dashboard/dist/assets/{index-BHfISWyn.js.map → index-8Gmtvd8e.js.map} +1 -1
- package/dashboard/dist/assets/{index-CivQGQpu.js → index-B8JfGtQB.js} +3 -3
- package/dashboard/dist/assets/{index-CivQGQpu.js.map → index-B8JfGtQB.js.map} +1 -1
- package/dashboard/dist/assets/index-Bb9ZZUyB.js +5 -0
- package/dashboard/dist/assets/{index-BTksPQZe.js.map → index-Bb9ZZUyB.js.map} +1 -1
- package/dashboard/dist/assets/{index-BrFGgfjR.js → index-BhzsR_gZ.js} +2 -2
- package/dashboard/dist/assets/{index-BrFGgfjR.js.map → index-BhzsR_gZ.js.map} +1 -1
- package/dashboard/dist/assets/{index-DrlZc3C0.js → index-BvGIyZUt.js} +2 -2
- package/dashboard/dist/assets/{index-DrlZc3C0.js.map → index-BvGIyZUt.js.map} +1 -1
- package/dashboard/dist/assets/{index-Bn-6MP9-.js → index-CldVY0UQ.js} +2 -2
- package/dashboard/dist/assets/{index-Bn-6MP9-.js.map → index-CldVY0UQ.js.map} +1 -1
- package/dashboard/dist/assets/index-D88VWEVp.js +67 -0
- package/dashboard/dist/assets/index-D88VWEVp.js.map +1 -0
- package/dashboard/dist/assets/{index-ByYeo8P7.js → index-DBvkaa-B.js} +4 -4
- package/dashboard/dist/assets/{index-ByYeo8P7.js.map → index-DBvkaa-B.js.map} +1 -1
- package/dashboard/dist/assets/{index-D0bjzVum.js → index-DDHoDZRg.js} +2 -2
- package/dashboard/dist/assets/{index-D0bjzVum.js.map → index-DDHoDZRg.js.map} +1 -1
- package/dashboard/dist/assets/index-DsKqDMs4.js +2 -0
- package/dashboard/dist/assets/{index-BWtW5puE.js.map → index-DsKqDMs4.js.map} +1 -1
- package/dashboard/dist/assets/index-Hbbox1A4.js +2 -0
- package/dashboard/dist/assets/{index-U7HShN30.js.map → index-Hbbox1A4.js.map} +1 -1
- package/dashboard/dist/assets/index-O9uuK2yO.js +2 -0
- package/dashboard/dist/assets/{index-CwQn-nhR.js.map → index-O9uuK2yO.js.map} +1 -1
- package/dashboard/dist/assets/index-cvmt1plS.js +2 -0
- package/dashboard/dist/assets/{index-D1KCPoRr.js.map → index-cvmt1plS.js.map} +1 -1
- package/dashboard/dist/assets/index-qU_dXqP4.css +1 -0
- package/dashboard/dist/assets/{knowledge-8_TilyaY.js → knowledge-DM0tNphj.js} +2 -2
- package/dashboard/dist/assets/{knowledge-8_TilyaY.js.map → knowledge-DM0tNphj.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-hY3O2HJa.js → mcp-CQ_TD2P9.js} +2 -2
- package/dashboard/dist/assets/{mcp-hY3O2HJa.js.map → mcp-CQ_TD2P9.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-CA8NEf2e.js → mcp-query-BP7KSGhc.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-CA8NEf2e.js.map → mcp-query-BP7KSGhc.js.map} +1 -1
- package/dashboard/dist/assets/metadata-display--TzK0REC.js +2 -0
- package/dashboard/dist/assets/metadata-display--TzK0REC.js.map +1 -0
- package/dashboard/dist/assets/{personas-DrWgQ94s.js → personas-DclHdHKK.js} +2 -2
- package/dashboard/dist/assets/{personas-DrWgQ94s.js.map → personas-DclHdHKK.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-DdgSlafC.js → pipelines-LwuKJfj-.js} +2 -2
- package/dashboard/dist/assets/{pipelines-DdgSlafC.js.map → pipelines-LwuKJfj-.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-UyjER1TA.js → tasks-CDs-Li2v.js} +2 -2
- package/dashboard/dist/assets/{tasks-UyjER1TA.js.map → tasks-CDs-Li2v.js.map} +1 -1
- package/dashboard/dist/assets/{topics-CIc5SpT_.js → topics-BeOSelBX.js} +2 -2
- package/dashboard/dist/assets/{topics-CIc5SpT_.js.map → topics-BeOSelBX.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-CmUqBRK4.js → useDebouncedValue-DhhAKjDC.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-CmUqBRK4.js.map → useDebouncedValue-DhhAKjDC.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-BOZOwXTE.js → useNamespace-C-E2gNEK.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-BOZOwXTE.js.map → useNamespace-C-E2gNEK.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-BsTpIsba.js → useYamlActivityEvents-CmLzX3YU.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-BsTpIsba.js.map → useYamlActivityEvents-CmLzX3YU.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-h-jlRSb9.js → vendor-icons-R9b9gQ04.js} +2 -2
- package/dashboard/dist/assets/{vendor-icons-h-jlRSb9.js.map → vendor-icons-R9b9gQ04.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-BkFI3IwE.js → workflows-CYv1CTU0.js} +2 -2
- package/dashboard/dist/assets/{workflows-BkFI3IwE.js.map → workflows-CYv1CTU0.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-CeeqNi9k.js → yaml-workflows-BgAsc6-I.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-CeeqNi9k.js.map → yaml-workflows-BgAsc6-I.js.map} +1 -1
- package/dashboard/dist/index.html +3 -3
- package/docs/api/sdk/escalations.md +87 -0
- package/docs/dashboard.md +23 -1
- package/docs/faceted-routing.md +34 -0
- package/docs/hitl/escalation.md +29 -0
- package/docs/hitl/resolution.md +33 -0
- package/docs/sdk.md +1 -1
- package/package.json +2 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-D-W4OP55.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-D-W4OP55.js.map +0 -1
- package/dashboard/dist/assets/BulkAssignModal-ySfoaF7f.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-BSJ2oFj6.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-C-E9MXMk.js +0 -2
- package/dashboard/dist/assets/CredentialsPage-DrydlZ65.js +0 -2
- package/dashboard/dist/assets/EntityTimelinePanel-CwzIV87U.js +0 -2
- package/dashboard/dist/assets/GraphInvokePage-BV60xkVy.js +0 -2
- package/dashboard/dist/assets/HomePage-BA0RYzFc.js +0 -2
- package/dashboard/dist/assets/McpQueryPage-CLEMtLOG.js +0 -2
- package/dashboard/dist/assets/Modal-BU7No9NH.js +0 -2
- package/dashboard/dist/assets/Modal-BU7No9NH.js.map +0 -1
- package/dashboard/dist/assets/OperatorDashboard-DCG8BFKE.js +0 -2
- package/dashboard/dist/assets/PersonaDetailPage-BEVeJr1q.js +0 -2
- package/dashboard/dist/assets/PersonasPage-B5fj2AK6.js +0 -2
- package/dashboard/dist/assets/RoleDetailPage-OmOdRm1F.js +0 -8
- package/dashboard/dist/assets/RoleDetailPage-OmOdRm1F.js.map +0 -1
- package/dashboard/dist/assets/RolesPage-DwprdPCA.js +0 -2
- package/dashboard/dist/assets/ScanSchemeDetailPage-BKc4lUjc.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-DUfxcntB.js +0 -2
- package/dashboard/dist/assets/UserName-BhA_ItNN.js +0 -2
- package/dashboard/dist/assets/escalation-columns-CBUTda5U.js +0 -2
- package/dashboard/dist/assets/index-BHfISWyn.js +0 -2
- package/dashboard/dist/assets/index-BTksPQZe.js +0 -5
- package/dashboard/dist/assets/index-BWtW5puE.js +0 -2
- package/dashboard/dist/assets/index-CwQn-nhR.js +0 -2
- package/dashboard/dist/assets/index-D1KCPoRr.js +0 -2
- package/dashboard/dist/assets/index-D9rtK9QF.js +0 -67
- package/dashboard/dist/assets/index-D9rtK9QF.js.map +0 -1
- package/dashboard/dist/assets/index-U7HShN30.js +0 -2
- package/dashboard/dist/assets/index-fUqvRHOe.css +0 -1
- package/dashboard/dist/assets/metadata-display-DHjqWkLG.js +0 -2
- package/dashboard/dist/assets/metadata-display-DHjqWkLG.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as n,b as t,c as u}from"./vendor-query-RUZdMvN6.js";import{l as s}from"./index-
|
|
2
|
-
//# sourceMappingURL=workflows-
|
|
1
|
+
import{u as n,b as t,c as u}from"./vendor-query-RUZdMvN6.js";import{l as s}from"./index-D88VWEVp.js";function f(){return n({queryKey:["activeWorkers"],queryFn:async()=>(await s("/workflows/workers")).workers})}function w(){return n({queryKey:["discoveredWorkflows"],queryFn:async()=>(await s("/workflows/discovered")).workflows})}function l(){return n({queryKey:["workflowConfigs"],queryFn:async()=>(await s("/workflows/config")).workflows})}function d(){return n({queryKey:["cronStatus"],queryFn:async()=>(await s("/workflows/cron/status")).schedules})}function k(e){return n({queryKey:["workflowExecution",e],queryFn:()=>s(`/workflow-states/${e}/execution`),enabled:!!e})}function m(e,o){const r=new URLSearchParams;return e.limit&&r.set("limit",String(e.limit)),e.offset!==void 0&&r.set("offset",String(e.offset)),e.entity&&r.set("entity",e.entity),e.search&&r.set("search",e.search),e.status&&r.set("status",e.status),e.sort_by&&r.set("sort_by",e.sort_by),e.order&&r.set("order",e.order),e.registered&&r.set("registered",e.registered),e.namespace&&r.set("namespace",e.namespace),n({queryKey:["jobs",e],queryFn:()=>s(`/workflow-states/jobs?${r}`),enabled:(o==null?void 0:o.enabled)??!0})}function q(){const e=t();return u({mutationFn:o=>s(`/workflows/${o}/terminate`,{method:"POST"}),onSuccess:(o,r)=>{e.invalidateQueries({queryKey:["workflowExecution",r],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function g(){const e=t();return u({mutationFn:({workflow_type:o,...r})=>s(`/workflows/${encodeURIComponent(o)}/config`,{method:"PUT",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function h(){const e=t();return u({mutationFn:o=>s(`/workflows/${encodeURIComponent(o)}/config`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function b(){const e=t();return u({mutationFn:({workflowType:o,data:r,metadata:i,execute_as:a})=>s(`/workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:r,metadata:i,...a?{execute_as:a}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}export{k as a,m as b,b as c,w as d,d as e,q as f,f as g,h,g as i,l as u};
|
|
2
|
+
//# sourceMappingURL=workflows-CYv1CTU0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows-
|
|
1
|
+
{"version":3,"file":"workflows-CYv1CTU0.js","sources":["../../src/api/workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { ActiveWorker, CronScheduleEntry, DiscoveredWorkflow, LTJob, LTWorkflowConfig, WorkflowExecution } from './types';\n\nexport function useActiveWorkers() {\n return useQuery<ActiveWorker[]>({\n queryKey: ['activeWorkers'],\n queryFn: async () => {\n const res = await apiFetch<{ workers: ActiveWorker[] }>('/workflows/workers');\n return res.workers;\n },\n });\n}\n\nexport function useDiscoveredWorkflows() {\n return useQuery<DiscoveredWorkflow[]>({\n queryKey: ['discoveredWorkflows'],\n queryFn: async () => {\n const res = await apiFetch<{ workflows: DiscoveredWorkflow[] }>('/workflows/discovered');\n return res.workflows;\n },\n });\n}\n\nexport function useWorkflowConfigs() {\n return useQuery<LTWorkflowConfig[]>({\n queryKey: ['workflowConfigs'],\n queryFn: async () => {\n const res = await apiFetch<{ workflows: LTWorkflowConfig[] }>('/workflows/config');\n return res.workflows;\n },\n });\n}\n\nexport function useCronStatus() {\n return useQuery<CronScheduleEntry[]>({\n queryKey: ['cronStatus'],\n queryFn: async () => {\n const res = await apiFetch<{ schedules: CronScheduleEntry[] }>('/workflows/cron/status');\n return res.schedules;\n },\n });\n}\n\nexport function useWorkflowExecution(workflowId: string) {\n return useQuery<WorkflowExecution>({\n queryKey: ['workflowExecution', workflowId],\n queryFn: () =>\n apiFetch(`/workflow-states/${workflowId}/execution`),\n enabled: !!workflowId,\n });\n}\n\nexport function useWorkflowState(workflowId: string) {\n return useQuery<{ workflow_id: string; state: Record<string, unknown> }>({\n queryKey: ['workflowState', workflowId],\n queryFn: () => apiFetch(`/workflow-states/${workflowId}/state`),\n enabled: !!workflowId,\n });\n}\n\nexport function useJobs(filters: {\n limit?: number;\n offset?: number;\n entity?: string;\n search?: string;\n status?: string;\n sort_by?: string;\n order?: string;\n registered?: string;\n namespace?: string;\n}, options?: { enabled?: boolean }) {\n const params = new URLSearchParams();\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n if (filters.entity) params.set('entity', filters.entity);\n if (filters.search) params.set('search', filters.search);\n if (filters.status) params.set('status', filters.status);\n if (filters.sort_by) params.set('sort_by', filters.sort_by);\n if (filters.order) params.set('order', filters.order);\n if (filters.registered) params.set('registered', filters.registered);\n if (filters.namespace) params.set('namespace', filters.namespace);\n\n return useQuery<{ jobs: LTJob[]; total: number }>({\n queryKey: ['jobs', filters],\n queryFn: () => apiFetch(`/workflow-states/jobs?${params}`),\n enabled: options?.enabled ?? true,\n });\n}\n\nexport function useTerminateWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (workflowId: string) =>\n apiFetch(`/workflows/${workflowId}/terminate`, { method: 'POST' }),\n onSuccess: (_data, workflowId) => {\n queryClient.invalidateQueries({ queryKey: ['workflowExecution', workflowId], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['jobs'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpsertWorkflowConfig() {\n const queryClient = useQueryClient();\n return useMutation<\n LTWorkflowConfig,\n Error,\n {\n workflow_type: string;\n description?: string | null;\n\n invocable?: boolean;\n certified?: boolean;\n task_queue?: string | null;\n default_role?: string;\n roles?: string[];\n invocation_roles?: string[];\n consumes?: string[];\n envelope_schema?: Record<string, unknown> | null;\n resolver_schema?: Record<string, unknown> | null;\n cron_schedule?: string | null;\n execute_as?: string | null;\n }\n >({\n mutationFn: ({ workflow_type, ...body }) =>\n apiFetch(`/workflows/${encodeURIComponent(workflow_type)}/config`, {\n method: 'PUT',\n body: JSON.stringify(body),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['workflowConfigs'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteWorkflowConfig() {\n const queryClient = useQueryClient();\n return useMutation<{ deleted: boolean; workflow_type: string }, Error, string>({\n mutationFn: (workflowType) =>\n apiFetch(`/workflows/${encodeURIComponent(workflowType)}/config`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['workflowConfigs'], refetchType: 'all' });\n },\n });\n}\n\nexport function useSetCronSchedule() {\n const queryClient = useQueryClient();\n return useMutation<\n LTWorkflowConfig,\n Error,\n { config: LTWorkflowConfig; cron_schedule: string | null; envelope_schema?: Record<string, unknown> | null }\n >({\n mutationFn: ({ config, cron_schedule, envelope_schema }) =>\n apiFetch(`/workflows/${encodeURIComponent(config.workflow_type)}/config`, {\n method: 'PUT',\n body: JSON.stringify({\n ...config,\n cron_schedule,\n ...(envelope_schema !== undefined ? { envelope_schema } : {}),\n }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['workflowConfigs'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['cronStatus'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeWorkflow() {\n const queryClient = useQueryClient();\n return useMutation<\n { workflowId: string; message: string },\n Error,\n { workflowType: string; data: Record<string, unknown>; metadata?: Record<string, unknown>; execute_as?: string }\n >({\n mutationFn: ({ workflowType, data, metadata, execute_as }) =>\n apiFetch(`/workflows/${workflowType}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, metadata, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['tasks'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['jobs'], refetchType: 'all' });\n },\n });\n}\n"],"names":["useActiveWorkers","useQuery","apiFetch","useDiscoveredWorkflows","useWorkflowConfigs","useCronStatus","useWorkflowExecution","workflowId","useJobs","filters","options","params","useTerminateWorkflow","queryClient","useQueryClient","useMutation","_data","useUpsertWorkflowConfig","workflow_type","body","useDeleteWorkflowConfig","workflowType","useInvokeWorkflow","data","metadata","execute_as"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as l,b as a,c as s}from"./vendor-query-RUZdMvN6.js";import{l as r}from"./index-
|
|
2
|
-
//# sourceMappingURL=yaml-workflows-
|
|
1
|
+
import{u as l,b as a,c as s}from"./vendor-query-RUZdMvN6.js";import{l as r}from"./index-D88VWEVp.js";function f(e={}){const o=new URLSearchParams;return e.status&&o.set("status",e.status),e.graph_topic&&o.set("graph_topic",e.graph_topic),e.app_id&&o.set("app_id",e.app_id),e.search&&o.set("search",e.search),e.set_id&&o.set("set_id",e.set_id),e.limit&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows?${o}`)})}function m(){return l({queryKey:["yamlWorkflowAppIds"],queryFn:()=>r("/yaml-workflows/app-ids")})}function c(e){return l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows/${e}`),enabled:!!e})}function w(){const e=a();return s({mutationFn:o=>r("/yaml-workflows",{method:"POST",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function k(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/deploy`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function p(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/activate`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function d(){const e=a();return s({mutationFn:({id:o,data:t,sync:n,execute_as:u})=>r(`/yaml-workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,sync:n,...u?{execute_as:u}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function h(){const e=a();return s({mutationFn:({id:o,task_queue:t,compilation_feedback:n})=>r(`/yaml-workflows/${o}/regenerate`,{method:"POST",body:JSON.stringify({task_queue:t,compilation_feedback:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function q(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/archive`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function W(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/restore`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"}),e.invalidateQueries({queryKey:["yamlWorkflow"],refetchType:"all"})}})}function S(){const e=a();return s({mutationFn:({id:o,...t})=>r(`/yaml-workflows/${o}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function v(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function T(e){return l({queryKey:["yamlWorkflows",e,"versions"],queryFn:()=>r(`/yaml-workflows/${e}/versions`),enabled:!!e})}function F(e,o){return l({queryKey:["yamlWorkflows",e,"versions",o],queryFn:()=>r(`/yaml-workflows/${e}/versions/${o}`),enabled:!!e&&o!==null})}export{m as a,S as b,c,T as d,k as e,p as f,q as g,W as h,v as i,h as j,F as k,d as l,w as m,f as u};
|
|
2
|
+
//# sourceMappingURL=yaml-workflows-BgAsc6-I.js.map
|
package/dashboard/dist/assets/{yaml-workflows-CeeqNi9k.js.map → yaml-workflows-BgAsc6-I.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-workflows-CeeqNi9k.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"yaml-workflows-BgAsc6-I.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-D88VWEVp.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="./assets/vendor-query-RUZdMvN6.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="./assets/vendor-react-CdqEC2zv.js">
|
|
14
|
-
<link rel="modulepreload" crossorigin href="./assets/vendor-icons-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
14
|
+
<link rel="modulepreload" crossorigin href="./assets/vendor-icons-R9b9gQ04.js">
|
|
15
|
+
<link rel="stylesheet" crossorigin href="./assets/index-qU_dXqP4.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
|
@@ -894,6 +894,93 @@ const result = await lt.escalations.resolveBySignalKey({
|
|
|
894
894
|
|
|
895
895
|
**Returns:** `LTApiResult<{ signaled: true; escalationId; workflowId }>`.
|
|
896
896
|
|
|
897
|
+
## resolveBatchItem
|
|
898
|
+
|
|
899
|
+
Submit ONE declared item of a batch escalation (a `conditional` wait created with `batch: [...]` — see [conditional](#conditional-workflow-helper)). One atomic statement: the payload lands in the row's `envelope.batch_items` only while the item key is still pending, the `batch_pending`/`batch_count` facets recompute, and the LAST item resolves the row and wakes the waiting workflow with the full collection.
|
|
900
|
+
|
|
901
|
+
```typescript
|
|
902
|
+
const first = await lt.escalations.resolveBatchItem({
|
|
903
|
+
id: 'esc_123',
|
|
904
|
+
itemKey: 'weld',
|
|
905
|
+
resolverPayload: { ok: true, notes: 'weld complete' },
|
|
906
|
+
});
|
|
907
|
+
// first.data → { outcome: 'accepted', remaining: 2, escalationId }
|
|
908
|
+
|
|
909
|
+
const last = await lt.escalations.resolveBatchItem({
|
|
910
|
+
id: 'esc_123',
|
|
911
|
+
itemKey: 'paint',
|
|
912
|
+
resolverPayload: { ok: true },
|
|
913
|
+
});
|
|
914
|
+
// last.data → { outcome: 'completed', remaining: 0, signaled: true, workflowId }
|
|
915
|
+
```
|
|
916
|
+
|
|
917
|
+
**Parameters:**
|
|
918
|
+
|
|
919
|
+
| Field | Type | Required | Description |
|
|
920
|
+
|-------|------|----------|-------------|
|
|
921
|
+
| `id` | `string` | Yes | Escalation UUID |
|
|
922
|
+
| `itemKey` | `string` | Yes | The declared batch key this submission fills |
|
|
923
|
+
| `resolverPayload` | `Record<string, any>` | Yes | The item's payload — validated against the same versioned role form as a single-item resolve |
|
|
924
|
+
| `metadata` | `Record<string, any>` | No | Outcome patch merged into the row's GIN-indexed metadata in the same fill |
|
|
925
|
+
| `assertClaim` | `boolean` | No | Require the caller's own live claim, asserted inside the guarded statement. Fills are claim-agnostic without it — a batch collects contributions from multiple principals |
|
|
926
|
+
|
|
927
|
+
**Returns:** `LTApiResult<{ outcome: 'accepted', remaining, escalationId }>` on an interim fill, `LTApiResult<{ outcome: 'completed', remaining: 0, signaled, escalationId, workflowId }>` on the completing fill. 409 `duplicate-item` for an already-filled key (safe under webhook retries), 400 for an undeclared key or a non-batch row, 404 if not found, 422 on schema violations.
|
|
928
|
+
|
|
929
|
+
**Auth:** Required
|
|
930
|
+
|
|
931
|
+
## resolveBatchItemBySignalKey
|
|
932
|
+
|
|
933
|
+
Submit one batch item selecting the escalation by its `signal_key` — the deterministic home signal id the waiting workflow parked on. For callers that already own that identity (a child workflow calling home, a webhook): no UUID lookup, no facet duplication. Claim-agnostic and write-scope gated with 404 non-disclosure, mirroring `resolveBySignalKey`.
|
|
934
|
+
|
|
935
|
+
```typescript
|
|
936
|
+
const result = await lt.escalations.resolveBatchItemBySignalKey({
|
|
937
|
+
signalKey: `fanout-home-${parentWorkflowId}`,
|
|
938
|
+
itemKey: 'u1-L',
|
|
939
|
+
resolverPayload: { ok: true },
|
|
940
|
+
});
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
**Parameters:**
|
|
944
|
+
|
|
945
|
+
| Field | Type | Required | Description |
|
|
946
|
+
|-------|------|----------|-------------|
|
|
947
|
+
| `signalKey` | `string` | Yes | The accumulator's `signal_key` (the id passed to `conditional`) |
|
|
948
|
+
| `itemKey` | `string` | Yes | The declared batch key this submission fills |
|
|
949
|
+
| `resolverPayload` | `Record<string, any>` | Yes | The item's payload |
|
|
950
|
+
| `metadata` | `Record<string, any>` | No | Outcome patch merged in the same fill |
|
|
951
|
+
|
|
952
|
+
**Returns:** same outcome vocabulary as `resolveBatchItem`.
|
|
953
|
+
|
|
954
|
+
**Auth:** Required
|
|
955
|
+
|
|
956
|
+
## resolveBatchItemByMetadata
|
|
957
|
+
|
|
958
|
+
Submit one batch item selecting the escalation by metadata facet — the faceted sibling of `resolveBatchItem`, mirroring `resolveByMetadata`'s selector (highest-priority pending match, RBAC folded into the SQL filter). Roles with `enforce_schema` validate the item against the selected row's own pinned schema before the fill.
|
|
959
|
+
|
|
960
|
+
```typescript
|
|
961
|
+
const result = await lt.escalations.resolveBatchItemByMetadata({
|
|
962
|
+
key: 'orderId',
|
|
963
|
+
value: 'order-123',
|
|
964
|
+
itemKey: 'cut',
|
|
965
|
+
resolverPayload: { ok: true },
|
|
966
|
+
});
|
|
967
|
+
```
|
|
968
|
+
|
|
969
|
+
**Parameters:**
|
|
970
|
+
|
|
971
|
+
| Field | Type | Required | Description |
|
|
972
|
+
|-------|------|----------|-------------|
|
|
973
|
+
| `key` | `string` | Yes | Metadata field name |
|
|
974
|
+
| `value` | `string` | Yes | Metadata field value |
|
|
975
|
+
| `itemKey` | `string` | Yes | The declared batch key this submission fills |
|
|
976
|
+
| `resolverPayload` | `Record<string, any>` | Yes | The item's payload |
|
|
977
|
+
| `metadata` | `Record<string, any>` | No | Outcome patch merged in the same fill |
|
|
978
|
+
| `restrictRoles` | `string[]` | No | Intersect the caller's write scope with these roles inside the SQL filter |
|
|
979
|
+
|
|
980
|
+
**Returns:** same outcome vocabulary as `resolveBatchItem`; 404 when no scoped pending row matches; 409 when the selected row went terminal to a concurrent resolution.
|
|
981
|
+
|
|
982
|
+
**Auth:** Required
|
|
983
|
+
|
|
897
984
|
## searchByFacets
|
|
898
985
|
|
|
899
986
|
Item-level faceted search over a single pond `role`, scoped to the caller's role. The faceted-routing read primitive.
|
package/docs/dashboard.md
CHANGED
|
@@ -257,7 +257,7 @@ Accessible at `/admin/roles/:role`. One page per role — a quiet header carryin
|
|
|
257
257
|
|
|
258
258
|
**Members** — who holds the role: admins manage it; members work its queue according to their read/write work-surface scope (read = which items appear; write = which they can claim and resolve). A `member` grant carries a scope chosen from five named profiles: full worker (`all`/`all`, default), see-all-act-own (`all`/`self`), own-items-only (`self`/`self`), read-only auditor (`all`/`none`), and read-only own (`self`/`none`). The picker enforces **write ⊆ read**. `admin` and `superadmin` grants always work the whole queue.
|
|
259
259
|
|
|
260
|
-
**Pins** — the pinned-view seeds this role hands its members (`default_pins`): label, dashboard-relative URL, optional badge. Members see them in their Pinned nav section from first login (marked role-provided) and may promote, hide, or reorder them via preferences.
|
|
260
|
+
**Pins** — two live-save groups. **Link Variables** leads: the facet names members bind per device (`properties.link_variables` — name, optional label, optional default). A pin below may reference a variable as a facet value, `facets={"facility":"{lt:facility}"}`; each member device opens it scoped to its own binding (set from the user menu → Link variables), falling back to the declared default or, unbound, applying no filter. A caption under each templated pin previews the binding on the viewing device (`facility = 'soleful'` / `facility = <empty>`). **Default Pins** follows — the pinned-view seeds this role hands its members (`default_pins`): label, dashboard-relative URL, optional badge. Members see them in their Pinned nav section from first login (marked role-provided) and may promote, hide, or reorder them via preferences; promoting a templated pin copies the template, so it keeps following the device's bindings. See [Faceted Routing — Link variables](faceted-routing.md#link-variables).
|
|
261
261
|
|
|
262
262
|
**API:** `PATCH /api/roles/:role` updates identity, Pace Board dials, placement, schemas, and pins.
|
|
263
263
|
|
|
@@ -480,6 +480,28 @@ markdown body. Each user dismisses per-browser.
|
|
|
480
480
|
Role targeting scopes display, never access: the live event reaches every
|
|
481
481
|
authenticated subscriber, so announcement bodies must never carry secrets.
|
|
482
482
|
|
|
483
|
+
### Global search
|
|
484
|
+
|
|
485
|
+
An opt-in header search bar for one-gesture lookups across every escalation
|
|
486
|
+
of any status. Configure it in the `start()` config —
|
|
487
|
+
`search: { enabled: true, facets: ['orderId', 'po'] }` — or by env
|
|
488
|
+
(`LT_SEARCH_BAR=true`, `LT_SEARCH_FACETS=orderId,po`; env wins). The picklist
|
|
489
|
+
always offers `escalationId` and `workflowId` (long-tail-owned lookups) ahead
|
|
490
|
+
of the configured metadata facets, and remembers the last-used facet per
|
|
491
|
+
device.
|
|
492
|
+
|
|
493
|
+
- A metadata facet lands on the escalation list filtered by that facet across
|
|
494
|
+
all statuses, newest first (the same deep link as clicking a facet value).
|
|
495
|
+
- `escalationId` opens the escalation detail directly; an unknown id shows an
|
|
496
|
+
inline notice without navigating.
|
|
497
|
+
- `workflowId` opens the workflow's single escalation, lists several to pick
|
|
498
|
+
from, or links straight to the workflow execution when none exist.
|
|
499
|
+
|
|
500
|
+
Kiosk sessions see the bar too — a station can dump a PO or order id and jump
|
|
501
|
+
straight to it; RBAC read scope bounds what any search can return. See
|
|
502
|
+
[Faceted Routing](faceted-routing.md) — a search is a one-gesture facet deep
|
|
503
|
+
link.
|
|
504
|
+
|
|
483
505
|
### Inbox
|
|
484
506
|
|
|
485
507
|
The Inbox icon in the header shows a badge count when the current user has pending escalations assigned to their roles. The count updates live via NATS — no polling needed.
|
package/docs/faceted-routing.md
CHANGED
|
@@ -91,6 +91,40 @@ const groups = await searchGroups(query, { sizeFacet: 'orderSize', limit: 10 });
|
|
|
91
91
|
const inFlight = await countByFacets({ role: 'print-farm-diabetic', available: false });
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
## Link variables
|
|
95
|
+
|
|
96
|
+
A role may declare **link variables** — facet names its members bind per
|
|
97
|
+
device — in `properties.link_variables`:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{ "link_variables": [ { "name": "facility", "label": "Facility", "default": "main" } ] }
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
A pinned URL references a variable as the ENTIRE value of a facet inside the
|
|
104
|
+
`facets` param:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
/escalations/available?role=gluer&facets={"facility":"{lt:facility}"}&status=available
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The dashboard substitutes at render time, so every link in the DOM is already
|
|
111
|
+
concrete. Resolution order per variable: the device's bound value → the
|
|
112
|
+
declared `default` → **drop the facet** (unbound means no filter, never an
|
|
113
|
+
empty-string match). Members bind values from the user menu ("Link
|
|
114
|
+
variables"); bindings live in device localStorage (`lt:station:link-vars:{userId}`),
|
|
115
|
+
so a shared workstation keeps its scope across reloads and account switches.
|
|
116
|
+
A shared URL still carrying a raw `{lt:name}` placeholder is resolved against
|
|
117
|
+
the opening device the moment the list page mounts (address bar rewritten in
|
|
118
|
+
place).
|
|
119
|
+
|
|
120
|
+
Values are strings — jsonb containment is type-sensitive, so numeric facets
|
|
121
|
+
are not templatable. Link variables are a view convenience: RBAC read scope
|
|
122
|
+
still governs what any query can return.
|
|
123
|
+
|
|
124
|
+
The dashboard's [global search bar](dashboard.md#global-search) is the
|
|
125
|
+
one-gesture sibling of this surface: a configured facet name plus a value
|
|
126
|
+
lands on the same all-status faceted list a deep link produces.
|
|
127
|
+
|
|
94
128
|
## Atomic claims
|
|
95
129
|
|
|
96
130
|
Two claim primitives, both `FOR UPDATE SKIP LOCKED` so many consumers run without
|
package/docs/hitl/escalation.md
CHANGED
|
@@ -76,6 +76,35 @@ if (decision && decision.$resolution) {
|
|
|
76
76
|
|
|
77
77
|
`$resolution` carries `escalationId`, `resolvedBy` (user id), and `resolvedByEmail` when known. It rides the signal only — the stored `resolver_payload` audit column receives the form payload untouched. The same resolve also merges `resolved_by` into the row's GIN-indexed `metadata`, so "who resolved it" is `@>`-queryable without a follow-up read. The `$`-prefixed key namespace is reserved for control data; consumer form fields never collide with it.
|
|
78
78
|
|
|
79
|
+
### Batch accumulation — one escalation, N contributions
|
|
80
|
+
|
|
81
|
+
Declare `batch` item keys and the escalation becomes an accumulator: it resolves only when every declared item has been submitted, and the wait resumes with the full collection. Interim submissions are cheap atomic row fills — the workflow never wakes per item, and the collation happens at the escalation boundary.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
const parts = await conditional<Record<'cut' | 'weld' | 'paint', StationResultV1>>(signalId, {
|
|
85
|
+
role: 'assembly',
|
|
86
|
+
description: 'Each station submits its result',
|
|
87
|
+
metadata: { orderId },
|
|
88
|
+
batch: ['cut', 'weld', 'paint'],
|
|
89
|
+
timeout: '24h', // one SLA covers the whole collection
|
|
90
|
+
});
|
|
91
|
+
if (parts === false) { /* expired — partially filled items remain on the row for audit */ }
|
|
92
|
+
if (parts === null) { /* cancelled */ }
|
|
93
|
+
parts.weld; // typed item payload
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The declaration folds into the row at creation, inside the same Leg1 commit:
|
|
97
|
+
|
|
98
|
+
- `metadata.batch_pending` — item keys still awaiting submission (`@>`-queryable: `{"batch_pending":["weld"]}` finds rows still missing `weld`)
|
|
99
|
+
- `metadata.batch_count` — the remaining count, recomputed from `batch_pending` on every fill
|
|
100
|
+
- `metadata.batch_keys` — the immutable declared list (progress = `batch_keys` minus `batch_pending`)
|
|
101
|
+
- `envelope.batch_items` — the accumulated `Record<itemKey, payload>` map (payloads are plumbing, so they live on the unindexed envelope; payload keys are caller-owned)
|
|
102
|
+
- `envelope.batch_filled_at` — `Record<itemKey, iso8601>`, stamped by the database clock inside each fill statement — the collection timeline as row truth
|
|
103
|
+
|
|
104
|
+
Items are submitted via `POST /api/escalations/:id/resolve-batch-item`, `POST /api/escalations/resolve-batch-item-by-signal-key` (the deterministic home signal id — no UUID lookup, no facet duplication), or `POST /api/escalations/resolve-batch-item-by-metadata` (see [Resolution — Batch items](resolution.md)). Each item validates against the same versioned role form a single-item resolver gets, `schemaVersion` pins included. Each fill is one guarded statement: the payload lands only while its key is still pending (duplicates return `duplicate-item` untouched), and the LAST fill resolves the row, stores the assembled collection as `resolver_payload`, and wakes this wait — atomically. The completing submission's `$resolution` rides the delivered collection.
|
|
105
|
+
|
|
106
|
+
`timeout` and cancellation keep their standard semantics (`false` / `null`); a plain resolve on a batch row remains an admin override that resolves the whole row with the payload given.
|
|
107
|
+
|
|
79
108
|
### Row completeness guarantee
|
|
80
109
|
|
|
81
110
|
Every field of the config — including all `metadata` facets — commits inside the Leg1 checkpoint. A claim-by-metadata router or a version-pinned facet reads a complete row from its first visible moment; there is no window where a row is visible but its metadata is still en route.
|
package/docs/hitl/resolution.md
CHANGED
|
@@ -76,6 +76,39 @@ await lt.escalations.resolveBySignalKey({
|
|
|
76
76
|
});
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
+
### Batch items
|
|
80
|
+
|
|
81
|
+
A batch escalation (a `conditional` wait declared with `batch: [...]` — see [Creating Escalations](escalation.md)) collects one submission per declared item key. Submit each item by id or by metadata facet:
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
const first = await lt.escalations.resolveBatchItem({
|
|
85
|
+
id: escalationId,
|
|
86
|
+
itemKey: 'weld',
|
|
87
|
+
resolverPayload: { ok: true, notes: 'weld complete' },
|
|
88
|
+
});
|
|
89
|
+
// → { outcome: 'accepted', remaining: 2, escalationId }
|
|
90
|
+
|
|
91
|
+
const second = await lt.escalations.resolveBatchItemBySignalKey({
|
|
92
|
+
signalKey: homeSignalId, // the deterministic id the parent parked on
|
|
93
|
+
itemKey: 'weld',
|
|
94
|
+
resolverPayload: { ok: true },
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const last = await lt.escalations.resolveBatchItemByMetadata({
|
|
98
|
+
key: 'orderId',
|
|
99
|
+
value: orderId,
|
|
100
|
+
itemKey: 'paint',
|
|
101
|
+
resolverPayload: { ok: true },
|
|
102
|
+
});
|
|
103
|
+
// → { outcome: 'completed', remaining: 0, signaled: true, workflowId }
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Interim items return `accepted` with the remaining count and publish `escalation.updated` (progress rides `metadata.batch_pending`/`batch_count`); the LAST item returns `completed` — the row resolved with the assembled collection as `resolver_payload` and the workflow woke with it, in the same statement. Duplicate submissions return 409 (`duplicate-item`, safe under webhook retries); undeclared keys return 400.
|
|
107
|
+
|
|
108
|
+
Each item validates against the same versioned role form a single-item resolve uses, canonical 422 included. Batch fills are claim-agnostic — a batch collects contributions from multiple principals, the same rationale as the signal-key path — while `assertClaim: true` (by-id form) opts into the caller's own live-claim assertion inside the guarded statement.
|
|
109
|
+
|
|
110
|
+
Item keys are non-empty strings up to 128 characters; prefer URL-friendly names (`u1-L`). Payload keys inside each item are caller-owned — the platform reserves no names inside `batch_items` values. Every fill stamps `envelope.batch_filled_at[itemKey]` with the database clock in the same statement, so the row carries the collection timeline as row truth. After an SLA expiry (`conditional` returns `false`) the terminal row retains the partial `batch_items` and their timestamps — read them back with `GET /api/escalations/:id` or `getEscalationBySignalKey` from an activity.
|
|
111
|
+
|
|
79
112
|
### Resolving a set atomically
|
|
80
113
|
|
|
81
114
|
When one decision settles a set of waits — each with its own payload — use `resolveAllOrNone`:
|
package/docs/sdk.md
CHANGED
|
@@ -63,7 +63,7 @@ The client mirrors the REST route structure:
|
|
|
63
63
|
| Namespace | REST equivalent | Key operations |
|
|
64
64
|
|-----------|----------------|----------------|
|
|
65
65
|
| `lt.tasks` | `/api/tasks` | `list`, `get`, `listProcesses`, `getProcess`, `getProcessStats` |
|
|
66
|
-
| `lt.escalations` | `/api/escalations` | `list`, `listAvailable`, `get`, `claim`, `release`, `resolve`, `escalate`, `bulkClaim`, `bulkAssign`, `findByMetadata`, `claimByMetadata`, `resolveByMetadata`, `aggregateByFacets`, `timelineByFacet` — see the [Escalations SDK reference](api/sdk/escalations.md) |
|
|
66
|
+
| `lt.escalations` | `/api/escalations` | `list`, `listAvailable`, `get`, `claim`, `release`, `resolve`, `escalate`, `bulkClaim`, `bulkAssign`, `findByMetadata`, `claimByMetadata`, `resolveByMetadata`, `resolveBatchItem`, `resolveBatchItemBySignalKey`, `resolveBatchItemByMetadata`, `aggregateByFacets`, `timelineByFacet` — see the [Escalations SDK reference](api/sdk/escalations.md) |
|
|
67
67
|
| `lt.workflows` | `/api/workflows` | `invoke`, `getStatus`, `getResult`, `terminate`, `listWorkers`, `listDiscovered`, `listConfigs`, `getConfig`, `upsertConfig` |
|
|
68
68
|
| `lt.yamlWorkflows` | `/api/yaml-workflows` | `list`, `get`, `create`, `deploy`, `activate`, `invoke`, `archive` |
|
|
69
69
|
| `lt.users` | `/api/users` | `list`, `get`, `create`, `update`, `delete`, `getRoles`, `addRole`, `removeRole` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/long-tail",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "Long Tail Workflows — Durable AI workflows with human-in-the-loop escalation. Powered by PostgreSQL.",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@anthropic-ai/sdk": "^0.92.0",
|
|
74
74
|
"@aws-sdk/client-s3": "^3.1017.0",
|
|
75
75
|
"@aws-sdk/s3-request-presigner": "^3.1045.0",
|
|
76
|
-
"@hotmeshio/hotmesh": "^0.
|
|
76
|
+
"@hotmeshio/hotmesh": "^0.28.1",
|
|
77
77
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
78
78
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.215.0",
|
|
79
79
|
"@opentelemetry/resources": "^2.5.1",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,a as b}from"./vendor-query-RUZdMvN6.js";import{b as $t,t as Ft,v as _e,w as Rt,x as Lt,y as _t,z as Bt,A as zt,B as Ut,E as qt,G as Dt,H as It,I as Vt,K as Gt,p as Ht,L as Qt,M as Kt,O as Wt,Q as Xt,R as Yt,T as Zt,U as Jt,V as es,W as ts,X as ss,Y as as,Z as ns,_ as rs,$ as is,a0 as ls,a1 as os}from"./index-D9rtK9QF.js";import{i as cs}from"./task-queues-7-sHKPsN.js";import{X as se,ag as ds,ah as us,C as xs,c as ms,ai as hs,aj as ps,t as fs,s as gs,ak as bs,B as ys,al as vs,am as js,Q as Ns,h as Cs,an as ks,P as ws,ao as Ss}from"./vendor-icons-h-jlRSb9.js";import{u as Ke,C as Ps,r as Ms,B as Ts,a as As}from"./BulkAssignModal-ySfoaF7f.js";import{m as Es,E as Os,a as $s}from"./escalation-columns-CBUTda5U.js";import{i as We,s as Fs,E as Rs}from"./CountdownTimer-C-E9MXMk.js";import{u as Ls}from"./useFilterParams-crmlBw_l.js";import{u as _s}from"./useDebouncedValue-CmUqBRK4.js";import{D as Bs}from"./DataTable-DFPMeqyQ.js";import{S as zs}from"./StickyPagination-DXOk5z5X.js";import{P as Us}from"./constants-BHkpVaqx.js";import{M as Xe}from"./Modal-BU7No9NH.js";import{R as qs,a as Ds}from"./RowActions-eYrzgQSj.js";import{L as Be,u as Is,f as Vs,a as Gs}from"./vendor-react-CdqEC2zv.js";import"./EntityTimelinePanel-CwzIV87U.js";import"./FilterBar-BeVBUdfJ.js";import"./PriorityBadge-BETdj4M-.js";import"./RolePill-Di_5hfvw.js";import"./WorkflowPill-CN-952iI.js";import"./StatusBadge-BDeUwPtb.js";import"./EmptyState-lpUFYfun.js";const Hs=["<","<=",">",">=","="],Qs=["priority","created_at","updated_at","status","role"],B="input text-xs py-1",ze="select text-xs py-1",J="text-text-tertiary hover:text-text-primary transition-colors";function Ue(t){return t==="true"?!0:t==="false"?!1:t.trim()!==""&&!Number.isNaN(Number(t))?Number(t):t}const Ks=t=>Object.entries(t??{}).map(([s,i])=>({key:s,value:String(i)})),Ws=t=>(t??[]).map(s=>{const[i,r]=Object.entries(s)[0]??["",""];return{key:i,value:String(r)}});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:r=>s(r.target.value)})}function Xs({value:t,onChange:s,facetKeys:i=[],search:r="",onSearchChange:g}){const x=Ks(t.facets),m=Ws(t.block),p=t.range??[],o=t.exists??[],y=t.orderBy??[],N=n=>{const u={};for(const d of n)d.key&&(u[d.key]=Ue(d.value));s({...t,facets:Object.keys(u).length?u:void 0})},S=n=>{const u=n.filter(d=>d.key).map(d=>({[d.key]:Ue(d.value)}));s({...t,block:u.length?u:void 0})},M=n=>s({...t,range:n.length?n:void 0}),j=n=>s({...t,exists:n.length?n:void 0}),P=n=>s({...t,orderBy:n.length?n:void 0});return e.jsxs("div",{className:"text-xs",children:[e.jsx("datalist",{id:"lt-facet-keys",children:i.map(n=>e.jsx("option",{value:n},n))}),e.jsxs("datalist",{id:"lt-sort-fields",children:[Qs.map(n=>e.jsx("option",{value:n},n)),i.map(n=>e.jsx("option",{value:`metadata.${n}`},n))]}),g&&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:r,onChange:n=>g(n.target.value)})}),e.jsx(L,{title:"Has facet",hint:"metadata @>",children:[...x,{key:"",value:""}].map((n,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:n.key,placeholder:"key",onChange:d=>{const l=[...x];l[u]={...n,key:d},N(l)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${B} w-40`,placeholder:"value",value:n.value,onChange:d=>{const l=[...x];l[u]={...n,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:[...p,{facet:"",op:"<=",value:0}].map((n,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:n.facet,placeholder:"numeric facet",onChange:d=>{const l=[...p];l[u]={...n,facet:d},M(l.filter(c=>c.facet))}}),e.jsx("select",{className:ze,value:n.op,onChange:d=>{const l=[...p];l[u]={...n,op:d.target.value},M(l.filter(c=>c.facet))},children:Hs.map(d=>e.jsx("option",{value:d,children:d},d))}),e.jsx("input",{type:"number",className:`${B} w-24`,value:n.value,onChange:d=>{const l=[...p];l[u]={...n,value:Number(d.target.value)},M(l.filter(c=>c.facet))}}),u<p.length&&e.jsx("button",{className:J,onClick:()=>M(p.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(n=>e.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent/15 px-1.5 py-0.5 text-accent",children:[n,e.jsx("button",{className:"text-accent/70 hover:text-accent",onClick:()=>j(o.filter(u=>u!==n)),children:"×"})]},n)),e.jsx(ee,{value:"",placeholder:"+ key",onChange:n=>{n&&!o.includes(n)&&j([...o,n])}})]})}),e.jsx(L,{title:"Exclude",hint:"NOT @>",children:[...m,{key:"",value:""}].map((n,u)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(ee,{value:n.key,placeholder:"key",onChange:d=>{const l=[...m];l[u]={...n,key:d},S(l)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${B} w-40`,placeholder:"value",value:n.value,onChange:d=>{const l=[...m];l[u]={...n,value:d.target.value},S(l)}}),u<m.length&&e.jsx("button",{className:J,onClick:()=>S(m.filter((d,l)=>l!==u)),children:"×"})]},u))}),e.jsx(L,{title:"Sort by",children:[...y,{field:"",direction:"asc"}].map((n,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:n.field,onChange:d=>{const l=[...y];l[u]={...n,field:d.target.value},P(l.filter(c=>c.field))}}),e.jsxs("select",{className:ze,value:n.direction??"asc",onChange:d=>{const l=[...y];l[u]={...n,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:!!n.numeric,onChange:d=>{const l=[...y];l[u]={...n,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 Ys({value:t,onChange:s,facetKeys:i,search:r,onSearchChange:g,activeFacetCount:x,onClear:m,onClose:p}){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:m,className:"text-2xs text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),e.jsx("button",{onClick:p,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(Xs,{value:t,onChange:s,facetKeys:i,search:r,onSearchChange:g})]})]})}const qe="created_at";function he(t){return t.replace(/^metadata\./,"")}function Zs({orderBy:t,onChange:s}){const i=t==null?void 0:t[0],r=(i==null?void 0:i.field)??qe,g=(i==null?void 0:i.direction)??"desc",x=r===qe,m=p=>s([{...i??{},field:r,direction:p}]);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:r,children:he(r)}),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":g==="desc",onClick:()=>m("desc"),className:`px-1.5 py-1 transition-colors ${g==="desc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:x?"Newest first":`${he(r)} descending`,children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",role:"radio","aria-checked":g==="asc",onClick:()=>m("asc"),className:`px-1.5 py-1 border-l border-surface-border transition-colors ${g==="asc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:x?"Oldest first":`${he(r)} ascending`,children:e.jsx(us,{className:"w-3.5 h-3.5"})})]})]})}const Js=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`,ea="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 ta(t){var p;const s=Js(t),i=Ke(),{data:r}=$t(),g=Ft(),x=g!==null?g:((p=r==null?void 0:r.ai)==null?void 0:p.enabled)===!0,m=t.selectedCount>0;return e.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${m?"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…"}),Us.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:ea,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 sa({open:t,onClose:s,selectedCount:i,onSubmit:r,isPending:g}){const[x,m]=b.useState(""),p=()=>{r(x||void 0)};return e.jsx(Xe,{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=>m(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:p,disabled:g,className:"btn-primary text-xs",children:g?"Submitting...":"Submit for Triage"})]})]})})}function _(t,s,i){return r=>{t.mutate(r,{onSuccess:()=>{s(),i==null||i()}})}}function aa(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 na({claimTarget:t,onClose:s,claimDuration:i,onDurationChange:r,claimDurations:g,onCustomClaimChange:x,onClaim:m,isPending:p}){return e.jsx(Xe,{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=>{r(o.target.value)},className:"select w-full text-sm",children:[g.map(o=>e.jsx("option",{value:o.value,children:o.label},o.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),i==="custom"&&e.jsx(Ps,{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:m,className:"btn-primary text-xs",disabled:p,children:p?"Claiming...":"Claim"})]})]})})}const Ye={pending:"--lt-status-queued-graphic",claimed:"--lt-status-claimed-graphic",resolved:"--lt-status-success-graphic",cancelled:"--lt-text-quaternary",expired:"--lt-text-tertiary"},Ze="--lt-text-quaternary";function ra(t){return Ye[t]??Ze}const V=Object.fromEntries(Object.entries(Ye).map(([t,s])=>[t,`rgb(var(${s}))`])),Ie=40,ia=64,la=24,Ve=3;function Je(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 oa(t,s){return t?[...s.filter(r=>r in t),...Object.keys(t).filter(r=>!s.includes(r))].map(r=>[r,t[r]]):[]}function ca({e:t}){const s=t.endMs-t.startMs;if(s<=0)return null;const i=V.pending,r=V.claimed,g=t.status==="cancelled"||t.status==="expired"?V.cancelled:V.resolved;let x=100,m=0,p=0;return t.claimedMs!==null?(x=Math.max(0,Math.min(100,(t.claimedMs-t.startMs)/s*100)),t.isOpen?m=100-x:(m=Math.max(0,Math.min(100-x,(t.endMs-t.claimedMs)/s*100)),p=Math.max(0,100-x-m))):t.isOpen||(p=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}}),m>0&&e.jsx("div",{style:{width:`${m}%`,backgroundColor:r,opacity:.6}}),p>0&&e.jsx("div",{style:{width:`${p}%`,backgroundColor:g,opacity:.6}})]})}function da({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:Je(t)})})}function Qe({e:t,highlightKeys:s,onRowClick:i}){const[r,g]=b.useState(!1),x=V[t.displayStatus]??`rgb(var(${Ze}))`,m=oa(t.metadata,s),p=r?m:m.slice(0,Ve),o=m.length-Ve;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]})]})]}),p.length>0&&e.jsxs("div",{className:"border-t border-surface-border/40 pt-1 space-y-px",children:[p.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(hs,{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(ps,{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(),g(N=>!N)},children:r?e.jsxs(e.Fragment,{children:[e.jsx(fs,{className:"w-2.5 h-2.5"})," less"]}):e.jsxs(e.Fragment,{children:[e.jsx(gs,{className:"w-2.5 h-2.5"})," ",o," more"]})})]}),e.jsx(ca,{e:t})]})}function ua({escalations:t,highlightKeys:s=[],onRowClick:i,total:r,page:g,totalPages:x,onPageChange:m}){var d,l;const p=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,f=c.claimed_at?new Date(c.claimed_at).getTime():null,C=!w&&c.status!=="cancelled"&&c.status!=="expired",$=w??(C?p:k+3e4),E=c.status==="pending"&&We(c)?"claimed":c.status;return{...c,startMs:k,claimedMs:f,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=ia/Math.max(M,1),n=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 n?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],f=w?Math.abs(c.startMs-w.startMs):null,C=f!==null?Math.max(la,Math.round(f*j)):0,$=k%2===0,E=ra(c.displayStatus),z=`rgb(var(${E}))`,G=c.endMs-c.startMs,U=c.isOpen?Ge(c.startMs):`${Ge(c.startMs)} · ${Je(G)}`;return e.jsxs("div",{children:[k>0&&e.jsx(da,{gapMs:f,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:Ie}})]}):e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums pr-3",children:U})}),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:z,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:U}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0 h-px bg-surface-border/70",style:{width:Ie}}),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:g})," ","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:()=>m(g-1),disabled:g<=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(xs,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>m(g+1),disabled:g>=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(ms,{className:"w-4 h-4"})})]})]})]})}function Fa(){var Fe,Re,Le;const t=Is(),{filters:s,setFilter:i,pagination:r}=Ls({filters:{role:"",type:"",priority:"",status:"available",search:""}});Rt({role:s.role||null,verbs:["created","claimed"]});const g=_s(s.search),x=Ke(),[m,p]=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),n=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 h=new ResizeObserver(()=>{var Z;(Z=n.current)==null||Z.style.setProperty("--lt-sticky-top",`${a.offsetHeight-1}px`)});h.observe(a),u.current=h},[]),[l,c]=b.useState(!1),[k,w]=Vs(),f=b.useMemo(()=>Lt(k),[k]),C=b.useCallback(a=>{w(h=>{const v=new URLSearchParams(h);return _t(v,a),v.delete("page"),v})},[w]),{data:$}=Bt(l),E=zt(f)+(s.search?1:0),z="facet-query",{setPanel:G,closePanel:U,open:et,ownerKey:tt}=Ut();b.useEffect(()=>{if(!l){U(z);return}G(e.jsx(Ys,{value:f,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:z})},[l,f,C,$,s.search,i,E,G,U]);const pe=et&&tt===z,ae=b.useRef(!1);b.useEffect(()=>{if(pe){ae.current=!0;return}ae.current&&(ae.current=!1,c(!1))},[pe]);const[st,ne]=b.useState(!1),[at,re]=b.useState(!1),[nt,ie]=b.useState(!1),rt=b.useCallback(a=>C({...f,orderBy:a}),[f,C]),H=Gs(),{data:Q}=qt(),fe=Dt(),it=b.useCallback(()=>{var v;const a=window.prompt("Pin label:");if(!(a!=null&&a.trim()))return;const h=((v=Q==null?void 0:Q.preferences)==null?void 0:v.pinnedViews)??[];fe.mutate({pinnedViews:[...h,{id:It(),label:a.trim(),url:H.pathname+H.search,badge:!0}]})},[H.pathname,H.search,Q,fe]),{canBulk:lt}=Vt(),{kiosk:le}=Gt(),ge=f.facets?Object.keys(f.facets):[],oe=k.get("view"),ot=b.useCallback(a=>{w(h=>{const v=new URLSearchParams(h);return a?v.set("view",a):v.delete("view"),v},{replace:!0})},[w]),q=oe==="timeline",ct=b.useCallback(a=>{const{[a]:h,...v}=f.facets??{};C({...f,facets:Object.keys(v).length>0?v:void 0})},[f,C]),be=Ht(),ye=Qt(),ve=Kt(),ce=Wt(),je=Xt(),de=Yt(),K=Zt(),{data:ue}=Jt(),{data:F}=es(),{data:xe}=ts(),{user:W,isSuperAdmin:dt,hasRoleType:ut}=ss(),Ne=dt||ut("admin"),Ce=b.useMemo(()=>new Set(((W==null?void 0:W.roles)??[]).map(a=>a.role)),[W]),xt=b.useMemo(()=>{const a=(F==null?void 0:F.roles)??[];return(Ne?a:a.filter(v=>Ce.has(v.role)&&!cs(v.role))).map(v=>({value:v.role,label:as(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,g,r.page,r.pageSize]);const D=s.status||"",X=D==="available",ke=D==="claimed",mt=ke?"pending":D==="resolved"?"resolved":D==="cancelled"?"cancelled":D==="expired"?"expired":void 0,T=s.role||(((Fe=f.roles)==null?void 0:Fe.length)===1?f.roles[0]:null),we=ns(T??"",void 0,!!T),ht=rs(T??"",void 0,!!T),me=T?Ms((Re=ht.data)==null?void 0:Re.form_schema).cancel:void 0,I=((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:r.pageSize,offset:r.offset,sort_by:"created_at",order:"desc",search:g||void 0,...f,include:Fs(I)?"envelope":void 0},pt=is({...Me,enabled:X&&Se}),ft=ls({status:mt,claimed:ke||void 0,...Me,enabled:!X&&Se}),gt=X?pt:ft,{data:R,isLoading:bt,error:Y,refetch:yt,isFetching:Te}=gt,A=(R==null?void 0:R.escalations)??[],O=(R==null?void 0:R.total)??0,Ae=!!T&&!!I&&!!I["x-lt-layout"]&&I["x-lt-layout"]!=="table",Ee=Ae&&!q&&(oe?oe==="rich":!0),Oe=q?"timeline":Ee?"rich":"table",$e=b.useMemo(()=>{if(!f.jeopardy||!T)return null;const a=((F==null?void 0:F.roles)??[]).find(v=>v.role===T),h=(a==null?void 0:a.priority_threshold_minutes)??(a==null?void 0:a.sla_minutes)??null;return h!=null?os(h*6e4):null},[f.jeopardy,T,F]),vt=b.useMemo(()=>{const a=new Set;for(const h of A)j.has(h.id)&&a.add(h.role);return[...a]},[A,j]),jt=b.useMemo(()=>A.filter(a=>j.has(a.id)&&We(a)).length,[A,j]),Nt=b.useCallback(()=>P(new Set),[]),Ct=()=>{if(!m)return;const a=o==="custom"?N:parseInt(o);!a||a<=0||be.mutate({id:m.id,durationMinutes:a},{onSuccess:()=>{p(null),t(`/escalations/detail/${m.id}`)}})},{handleSetPriority:kt,handleBulkClaim:wt,handleBulkTriage:St,handleBulkAssign:Pt,handleBulkUnassign:Mt,handleBulkCancel:Tt}=aa({selectedIds:j,clearSelection:Nt,setPriority:ye,bulkClaim:ve,bulkTriage:de,bulkAssign:ce,bulkUnassign:je,bulkCancel:K,closeTriageModal:()=>ne(!1),closeAssignModal:()=>re(!1),closeCancelModal:()=>ie(!1)}),At=a=>{const h=new Set(j);h.has(a)?h.delete(a):h.add(a),P(h)},Et=()=>{j.size===A.length?P(new Set):P(new Set(A.map(a=>a.id)))},Ot=[lt?{key:"select",label:e.jsx("input",{type:"checkbox",checked:A.length>0&&j.size===A.length,onChange:Et,className:"rounded"}),render:a=>e.jsx("input",{type:"checkbox",checked:j.has(a.id),onChange:h=>{h.stopPropagation(),At(a.id)},onClick:h=>h.stopPropagation(),className:"rounded"}),className:"w-10",priority:1}:{key:"spacer",label:"",render:()=>null,className:"w-10",priority:3},...Es({highlightKeys:ge}),{key:"actions",label:"",render:a=>e.jsx(qs,{children:e.jsx(Ds,{icon:bs,title:"Claim escalation",onClick:()=>p(a),alwaysVisible:!0,colorClass:"text-accent/40 hover:text-accent",size:"sm"})}),className:"w-10 text-right"}];return e.jsxs("div",{ref:n,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-10 min-w-0",children:[e.jsx(Os,{role:s.role,options:xt,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(ys,{className:"w-4 h-4",strokeWidth:1.5})})]}),e.jsxs("div",{ref:d,className:"sticky top-0 z-20 bg-surface",children:[e.jsx($s,{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:[(r.page-1)*100+1,"–",Math.min(r.page*100,O)]})," of "]}),e.jsx("span",{className:"font-medium text-text-secondary",children:O})," ",O===1?"escalation":"escalations"]}),e.jsx(Zs,{orderBy:f.orderBy,onChange:rt}),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:vs},{key:"rich",title:"Rich view",Icon:js},{key:"timeline",title:"Timeline view",Icon:Ns}].filter(a=>a.key!=="rich"||Ae).map(({key:a,title:h,Icon:v})=>e.jsx("button",{role:"radio","aria-checked":Oe===a,onClick:()=>ot(a),className:`px-1.5 py-1 transition-colors ${Oe===a?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:h,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(Cs,{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:()=>yt(),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(ks,{className:`w-4 h-4 ${Te?"animate-spin":""}`})}),e.jsx("button",{onClick:it,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(ws,{className:"w-4 h-4"})})]})]})}),e.jsx(ta,{selectedCount:j.size,onClearSelection:()=>P(new Set),onSetPriority:kt,onClaim:wt,onAssign:()=>re(!0),onUnassign:Mt,onTriage:()=>ne(!0),onCancel:()=>ie(!0),isPriorityPending:ye.isPending,isClaimPending:ve.isPending,isAssignPending:ce.isPending,isUnassignPending:je.isPending,isTriagePending:de.isPending,isCancelPending:K.isPending,cancelLabel:me}),(f.facets&&Object.keys(f.facets).length>0||f.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:[f.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(Ss,{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({...f,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(f.facets??{}).map(([a,h])=>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(h),children:String(h)}),e.jsx("button",{onClick:()=>ct(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(f.facets??{}).length>1&&e.jsx("button",{onClick:()=>C({...f,facets:void 0}),className:"text-2xs text-text-quaternary hover:text-text-secondary transition-colors px-1",children:"clear all"})]})]}),Y&&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:Y.message==="Session expired"?"Your session has expired. Please log in again.":`Failed to load escalations: ${Y.message}`}),q?e.jsx(ua,{escalations:A,highlightKeys:ge,onRowClick:a=>t(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),total:O,page:r.page,totalPages:Math.ceil(O/Pe),onPageChange:r.setPage}):Ee?e.jsx(Rs,{role:T,listSchema:I,activeEscalations:A,onRowClick:a=>t(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),onOpenGroup:a=>t(a),onAddFacet:(a,h)=>C({...f,facets:{...f.facets??{},[a]:typeof h=="object"&&h!==null?JSON.stringify(h):h}}),total:O,page:r.page,totalPages:r.totalPages(O),pageSize:r.pageSize,onPageChange:r.setPage,onPageSizeChange:r.setPageSize}):e.jsxs(e.Fragment,{children:[e.jsx(Bs,{columns:Ot,data:A,layout:"fixed",keyFn:a=>a.id,onRowClick:a=>t(`/escalations/detail/${a.id}`,{state:{from:"/escalations/available"}}),isLoading:bt,emptyMessage:Y?"Unable to load data":"No escalations"}),e.jsx(zs,{page:r.page,totalPages:r.totalPages(O),onPageChange:r.setPage,total:O,pageSize:r.pageSize,onPageSizeChange:r.setPageSize})]}),e.jsx(na,{claimTarget:m,onClose:()=>p(null),claimDuration:o,onDurationChange:a=>{y(a),S(0)},claimDurations:x,customClaimMinutes:N,onCustomClaimChange:M,onClaim:Ct,isPending:be.isPending}),e.jsx(sa,{open:st,onClose:()=>ne(!1),selectedCount:j.size,onSubmit:St,isPending:de.isPending}),e.jsx(Ts,{open:at,onClose:()=>re(!1),selectedCount:j.size,selectedRoles:vt,claimedCount:jt,onSubmit:Pt,isPending:ce.isPending}),e.jsx(As,{open:nt,onClose:()=>ie(!1),onConfirm:Tt,selectedCount:j.size,isPending:K.isPending,error:K.error,actionLabel:typeof me=="string"?me:void 0})]})}export{Fa as AvailableEscalationsPage};
|
|
2
|
-
//# sourceMappingURL=AvailableEscalationsPage-D-W4OP55.js.map
|