@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
|
@@ -5,6 +5,7 @@ export { getEscalationLookups } from './lookups';
|
|
|
5
5
|
export { claimEscalation, releaseEscalation } from './claim';
|
|
6
6
|
export { releaseExpiredClaims, updatePriority, bulkClaim, bulkAssign, bulkUnassign, bulkEscalate, bulkTriage } from './bulk';
|
|
7
7
|
export { resolveEscalation, resolveBySignalKey, resolveByIds, resolveAllOrNone } from './resolve';
|
|
8
|
+
export { resolveBatchItem, resolveBatchItemBySignalKey, resolveBatchItemByMetadata } from './resolve-batch';
|
|
8
9
|
export { findByMetadata, claimByMetadata, resolveByMetadata } from './metadata';
|
|
9
10
|
export { cancelSingleEscalation, bulkCancel } from './cancel';
|
|
10
11
|
export { searchByFacets, claimGroups, claimByFacets } from './facets';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.timelineByFacet = exports.aggregateByFacets = exports.claimByFacets = exports.claimGroups = exports.searchByFacets = exports.bulkCancel = exports.cancelSingleEscalation = exports.resolveByMetadata = exports.claimByMetadata = exports.findByMetadata = exports.resolveAllOrNone = exports.resolveByIds = exports.resolveBySignalKey = exports.resolveEscalation = exports.bulkTriage = exports.bulkEscalate = exports.bulkUnassign = exports.bulkAssign = exports.bulkClaim = exports.updatePriority = exports.releaseExpiredClaims = exports.releaseEscalation = exports.claimEscalation = exports.getEscalationLookups = exports.escalateToRole = exports.getEscalationsByWorkflowId = exports.getEscalation = exports.getStationMetrics = exports.getEscalationStats = exports.listFacetKeys = exports.listDistinctTypes = exports.listAvailableEscalations = exports.listEscalations = exports.createEscalation = void 0;
|
|
3
|
+
exports.timelineByFacet = exports.aggregateByFacets = exports.claimByFacets = exports.claimGroups = exports.searchByFacets = exports.bulkCancel = exports.cancelSingleEscalation = exports.resolveByMetadata = exports.claimByMetadata = exports.findByMetadata = exports.resolveBatchItemByMetadata = exports.resolveBatchItemBySignalKey = exports.resolveBatchItem = exports.resolveAllOrNone = exports.resolveByIds = exports.resolveBySignalKey = exports.resolveEscalation = exports.bulkTriage = exports.bulkEscalate = exports.bulkUnassign = exports.bulkAssign = exports.bulkClaim = exports.updatePriority = exports.releaseExpiredClaims = exports.releaseEscalation = exports.claimEscalation = exports.getEscalationLookups = exports.escalateToRole = exports.getEscalationsByWorkflowId = exports.getEscalation = exports.getStationMetrics = exports.getEscalationStats = exports.listFacetKeys = exports.listDistinctTypes = exports.listAvailableEscalations = exports.listEscalations = exports.createEscalation = void 0;
|
|
4
4
|
var create_1 = require("./create");
|
|
5
5
|
Object.defineProperty(exports, "createEscalation", { enumerable: true, get: function () { return create_1.createEscalation; } });
|
|
6
6
|
var list_1 = require("./list");
|
|
@@ -32,6 +32,10 @@ Object.defineProperty(exports, "resolveEscalation", { enumerable: true, get: fun
|
|
|
32
32
|
Object.defineProperty(exports, "resolveBySignalKey", { enumerable: true, get: function () { return resolve_1.resolveBySignalKey; } });
|
|
33
33
|
Object.defineProperty(exports, "resolveByIds", { enumerable: true, get: function () { return resolve_1.resolveByIds; } });
|
|
34
34
|
Object.defineProperty(exports, "resolveAllOrNone", { enumerable: true, get: function () { return resolve_1.resolveAllOrNone; } });
|
|
35
|
+
var resolve_batch_1 = require("./resolve-batch");
|
|
36
|
+
Object.defineProperty(exports, "resolveBatchItem", { enumerable: true, get: function () { return resolve_batch_1.resolveBatchItem; } });
|
|
37
|
+
Object.defineProperty(exports, "resolveBatchItemBySignalKey", { enumerable: true, get: function () { return resolve_batch_1.resolveBatchItemBySignalKey; } });
|
|
38
|
+
Object.defineProperty(exports, "resolveBatchItemByMetadata", { enumerable: true, get: function () { return resolve_batch_1.resolveBatchItemByMetadata; } });
|
|
35
39
|
var metadata_1 = require("./metadata");
|
|
36
40
|
Object.defineProperty(exports, "findByMetadata", { enumerable: true, get: function () { return metadata_1.findByMetadata; } });
|
|
37
41
|
Object.defineProperty(exports, "claimByMetadata", { enumerable: true, get: function () { return metadata_1.claimByMetadata; } });
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { LTApiAuth, LTApiResult } from '../../types/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Submit ONE declared item of a batch escalation (a `conditional` wait created
|
|
4
|
+
* with `batch: [...]`). Interim submissions are cheap atomic fills — the row
|
|
5
|
+
* stays pending and `remaining` reports progress. The LAST item completes the
|
|
6
|
+
* escalation: the row resolves and the waiting workflow wakes with the full
|
|
7
|
+
* collection, in the same statement.
|
|
8
|
+
*
|
|
9
|
+
* Each item validates against the SAME versioned form schema a single-item
|
|
10
|
+
* resolver gets (metadata.form_schema → pinned lt_role_schemas → live role
|
|
11
|
+
* schema), including the submit guard.
|
|
12
|
+
*
|
|
13
|
+
* Claim semantics: claim-agnostic by default — a batch accumulates
|
|
14
|
+
* contributions from multiple principals, so the single-owner claim lock is
|
|
15
|
+
* not asserted (same rationale as resolve-by-signal-key). Pass
|
|
16
|
+
* `assertClaim: true` to require the caller's own live claim, asserted
|
|
17
|
+
* atomically inside the SDK's guarded statement.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveBatchItem(input: {
|
|
20
|
+
id: string;
|
|
21
|
+
itemKey: string;
|
|
22
|
+
resolverPayload: Record<string, any>;
|
|
23
|
+
metadata?: Record<string, any>;
|
|
24
|
+
assertClaim?: boolean;
|
|
25
|
+
}, auth: LTApiAuth): Promise<LTApiResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Submit one batch item selecting the escalation by its `signal_key` — the
|
|
28
|
+
* deterministic home signal id the waiting workflow parked on. For callers
|
|
29
|
+
* that already own that identity (a child workflow calling home, a webhook),
|
|
30
|
+
* so no UUID lookup and no facet duplication. Mirrors resolve-by-signal-key:
|
|
31
|
+
* claim-agnostic, write-scope gated with 404 non-disclosure.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveBatchItemBySignalKey(input: {
|
|
34
|
+
signalKey: string;
|
|
35
|
+
itemKey: string;
|
|
36
|
+
resolverPayload: Record<string, any>;
|
|
37
|
+
metadata?: Record<string, any>;
|
|
38
|
+
}, auth: LTApiAuth): Promise<LTApiResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Submit one batch item selecting the escalation by metadata facet — the
|
|
41
|
+
* faceted sibling of {@link resolveBatchItem}, mirroring resolve-by-metadata.
|
|
42
|
+
* RBAC folds into the SDK's atomic facet selection as a flat role filter
|
|
43
|
+
* (write_all roles; self-scope members act on their items by id).
|
|
44
|
+
*
|
|
45
|
+
* Schema enforcement is two-phase when enforcing roles exist: the item's
|
|
46
|
+
* schema is a function of the SELECTED row's role and version pin, so the row
|
|
47
|
+
* is picked first (scoped, priority-ordered), validated, then filled by
|
|
48
|
+
* asserted id — the SDK statement re-checks pending/batch state atomically,
|
|
49
|
+
* and a row that went terminal between phases surfaces as a 409.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveBatchItemByMetadata(input: {
|
|
52
|
+
key: string;
|
|
53
|
+
value: string;
|
|
54
|
+
itemKey: string;
|
|
55
|
+
resolverPayload: Record<string, any>;
|
|
56
|
+
metadata?: Record<string, any>;
|
|
57
|
+
restrictRoles?: string[];
|
|
58
|
+
}, auth: LTApiAuth): Promise<LTApiResult>;
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.resolveBatchItem = resolveBatchItem;
|
|
37
|
+
exports.resolveBatchItemBySignalKey = resolveBatchItemBySignalKey;
|
|
38
|
+
exports.resolveBatchItemByMetadata = resolveBatchItemByMetadata;
|
|
39
|
+
const escalationService = __importStar(require("../../services/escalation"));
|
|
40
|
+
const resolver_validation_1 = require("../../services/escalation/resolver-validation");
|
|
41
|
+
const enforcement_cache_1 = require("../../services/role/enforcement-cache");
|
|
42
|
+
const escalation_1 = require("../../types/escalation");
|
|
43
|
+
const helpers_1 = require("./helpers");
|
|
44
|
+
const resolve_1 = require("./resolve");
|
|
45
|
+
const metadata_1 = require("./metadata");
|
|
46
|
+
/**
|
|
47
|
+
* Submit ONE declared item of a batch escalation (a `conditional` wait created
|
|
48
|
+
* with `batch: [...]`). Interim submissions are cheap atomic fills — the row
|
|
49
|
+
* stays pending and `remaining` reports progress. The LAST item completes the
|
|
50
|
+
* escalation: the row resolves and the waiting workflow wakes with the full
|
|
51
|
+
* collection, in the same statement.
|
|
52
|
+
*
|
|
53
|
+
* Each item validates against the SAME versioned form schema a single-item
|
|
54
|
+
* resolver gets (metadata.form_schema → pinned lt_role_schemas → live role
|
|
55
|
+
* schema), including the submit guard.
|
|
56
|
+
*
|
|
57
|
+
* Claim semantics: claim-agnostic by default — a batch accumulates
|
|
58
|
+
* contributions from multiple principals, so the single-owner claim lock is
|
|
59
|
+
* not asserted (same rationale as resolve-by-signal-key). Pass
|
|
60
|
+
* `assertClaim: true` to require the caller's own live claim, asserted
|
|
61
|
+
* atomically inside the SDK's guarded statement.
|
|
62
|
+
*/
|
|
63
|
+
async function resolveBatchItem(input, auth) {
|
|
64
|
+
try {
|
|
65
|
+
const { id, itemKey, resolverPayload, metadata } = input;
|
|
66
|
+
if (!itemKey)
|
|
67
|
+
return { status: 400, error: 'itemKey is required' };
|
|
68
|
+
if (!resolverPayload)
|
|
69
|
+
return { status: 400, error: 'resolverPayload is required' };
|
|
70
|
+
const escalation = await escalationService.getEscalation(id);
|
|
71
|
+
if (!escalation)
|
|
72
|
+
return { status: 404, error: 'Escalation not found' };
|
|
73
|
+
if (escalation.status === 'cancelled')
|
|
74
|
+
return { status: 409, error: 'Escalation is cancelled' };
|
|
75
|
+
if (escalation.status !== 'pending')
|
|
76
|
+
return { status: 409, error: 'Escalation not available for resolution' };
|
|
77
|
+
// Advisory shape gate — cheap, readable rejection. The SDK's guarded
|
|
78
|
+
// statement re-checks and is the atomic arbiter (outcome 'not-batch').
|
|
79
|
+
const pending = escalation.metadata?.[escalation_1.ESCALATION_BATCH_KEYS.PENDING];
|
|
80
|
+
if (!Array.isArray(pending)) {
|
|
81
|
+
return { status: 400, error: 'Escalation is not a batch' };
|
|
82
|
+
}
|
|
83
|
+
// Hybrid RBAC, identical to single-resolve: non-disclosure 404 for rows the
|
|
84
|
+
// caller cannot see; informative 403 for rows they see but cannot act on.
|
|
85
|
+
if (await (0, helpers_1.assertReadAccess)(auth.userId, escalation)) {
|
|
86
|
+
return { status: 404, error: 'Escalation not found' };
|
|
87
|
+
}
|
|
88
|
+
const denied = await (0, helpers_1.assertWriteAccess)(auth.userId, escalation);
|
|
89
|
+
if (denied)
|
|
90
|
+
return denied;
|
|
91
|
+
// Per-item schema enforcement — the exact validation path single-resolve
|
|
92
|
+
// runs, against the row's pinned schema version.
|
|
93
|
+
const violation = await (0, resolver_validation_1.checkResolverPayload)(escalation, resolverPayload, undefined, auth.userId);
|
|
94
|
+
if (violation)
|
|
95
|
+
return (0, resolve_1.validationFailure)(violation);
|
|
96
|
+
const redacted = await (0, resolve_1.redactPasswords)(resolverPayload, escalation.metadata?.form_schema);
|
|
97
|
+
// resolved_by merges on every fill; the completing fill's stamp is the
|
|
98
|
+
// resolution provenance, matching single-resolve. $resolution rides the
|
|
99
|
+
// completing item's signal only.
|
|
100
|
+
const result = await escalationService.resolveBatchItem(escalation.id, itemKey, redacted, { ...metadata, resolved_by: auth.userId }, input.assertClaim ? auth.userId : undefined, await (0, resolve_1.resolverIdentity)(auth));
|
|
101
|
+
return batchOutcomeResult(result, itemKey, escalation.workflow_id);
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
return { status: 500, error: err.message };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Submit one batch item selecting the escalation by its `signal_key` — the
|
|
109
|
+
* deterministic home signal id the waiting workflow parked on. For callers
|
|
110
|
+
* that already own that identity (a child workflow calling home, a webhook),
|
|
111
|
+
* so no UUID lookup and no facet duplication. Mirrors resolve-by-signal-key:
|
|
112
|
+
* claim-agnostic, write-scope gated with 404 non-disclosure.
|
|
113
|
+
*/
|
|
114
|
+
async function resolveBatchItemBySignalKey(input, auth) {
|
|
115
|
+
try {
|
|
116
|
+
const { signalKey, itemKey, resolverPayload, metadata } = input;
|
|
117
|
+
if (!signalKey)
|
|
118
|
+
return { status: 400, error: 'signalKey is required' };
|
|
119
|
+
if (!itemKey)
|
|
120
|
+
return { status: 400, error: 'itemKey is required' };
|
|
121
|
+
if (!resolverPayload)
|
|
122
|
+
return { status: 400, error: 'resolverPayload is required' };
|
|
123
|
+
const escalation = await escalationService.getEscalationBySignalKey(signalKey);
|
|
124
|
+
if (!escalation)
|
|
125
|
+
return { status: 404, error: 'Escalation not found' };
|
|
126
|
+
if (escalation.status !== 'pending')
|
|
127
|
+
return { status: 409, error: 'Escalation not available for resolution' };
|
|
128
|
+
const pending = escalation.metadata?.[escalation_1.ESCALATION_BATCH_KEYS.PENDING];
|
|
129
|
+
if (!Array.isArray(pending)) {
|
|
130
|
+
return { status: 400, error: 'Escalation is not a batch' };
|
|
131
|
+
}
|
|
132
|
+
// Write verb on a system ingress surface — scope-gate with non-disclosure.
|
|
133
|
+
const denied = await (0, helpers_1.assertWriteAccess)(auth.userId, escalation);
|
|
134
|
+
if (denied)
|
|
135
|
+
return { status: 404, error: 'Escalation not found' };
|
|
136
|
+
const violation = await (0, resolver_validation_1.checkResolverPayload)(escalation, resolverPayload, undefined, auth.userId);
|
|
137
|
+
if (violation)
|
|
138
|
+
return (0, resolve_1.validationFailure)(violation);
|
|
139
|
+
const redacted = await (0, resolve_1.redactPasswords)(resolverPayload, escalation.metadata?.form_schema);
|
|
140
|
+
const result = await escalationService.resolveBatchItemBySignalKey(signalKey, itemKey, redacted, { ...metadata, resolved_by: auth.userId }, await (0, resolve_1.resolverIdentity)(auth));
|
|
141
|
+
return batchOutcomeResult(result, itemKey, escalation.workflow_id);
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
return { status: 500, error: err.message };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Submit one batch item selecting the escalation by metadata facet — the
|
|
149
|
+
* faceted sibling of {@link resolveBatchItem}, mirroring resolve-by-metadata.
|
|
150
|
+
* RBAC folds into the SDK's atomic facet selection as a flat role filter
|
|
151
|
+
* (write_all roles; self-scope members act on their items by id).
|
|
152
|
+
*
|
|
153
|
+
* Schema enforcement is two-phase when enforcing roles exist: the item's
|
|
154
|
+
* schema is a function of the SELECTED row's role and version pin, so the row
|
|
155
|
+
* is picked first (scoped, priority-ordered), validated, then filled by
|
|
156
|
+
* asserted id — the SDK statement re-checks pending/batch state atomically,
|
|
157
|
+
* and a row that went terminal between phases surfaces as a 409.
|
|
158
|
+
*/
|
|
159
|
+
async function resolveBatchItemByMetadata(input, auth) {
|
|
160
|
+
try {
|
|
161
|
+
const { key, value, itemKey, resolverPayload, metadata } = input;
|
|
162
|
+
if (!key || !value)
|
|
163
|
+
return { status: 400, error: 'key and value are required' };
|
|
164
|
+
if (!itemKey)
|
|
165
|
+
return { status: 400, error: 'itemKey is required' };
|
|
166
|
+
if (!resolverPayload)
|
|
167
|
+
return { status: 400, error: 'resolverPayload is required' };
|
|
168
|
+
const writeScope = await (0, helpers_1.getEscalationWriteScope)(auth.userId);
|
|
169
|
+
const allowedRoles = (0, metadata_1.restrictScopeRoles)(writeScope.allRoles, writeScope.global, input.restrictRoles);
|
|
170
|
+
const resolvedBy = await (0, resolve_1.resolverIdentity)(auth);
|
|
171
|
+
const outcome = { ...metadata, resolved_by: auth.userId };
|
|
172
|
+
const enforcing = await (0, enforcement_cache_1.getEnforcingRoles)();
|
|
173
|
+
if (enforcing.size === 0) {
|
|
174
|
+
// Single atomic call — selection, fill, and (on the last item) the
|
|
175
|
+
// resolve + wake all inside the SDK statement.
|
|
176
|
+
const result = await escalationService.resolveBatchItemByMetadata(key, value, itemKey, resolverPayload, allowedRoles ?? undefined, outcome, resolvedBy);
|
|
177
|
+
return batchOutcomeResult(result, itemKey, result.escalation?.workflow_id ?? null);
|
|
178
|
+
}
|
|
179
|
+
// Phase 1: pick the row the fill would target (scoped, priority-ordered)
|
|
180
|
+
// and validate against ITS schema when its role enforces. The role
|
|
181
|
+
// restriction folds into the scoped query — never a client-side filter.
|
|
182
|
+
const found = await escalationService.findByMetadata(key, value, 'pending', 1, 0, allowedRoles === null ? undefined : { allRoles: allowedRoles, meUserId: auth.userId });
|
|
183
|
+
const row = found.escalations[0];
|
|
184
|
+
if (!row)
|
|
185
|
+
return { status: 404, error: 'No pending escalation found for this metadata' };
|
|
186
|
+
if (enforcing.has(row.role)) {
|
|
187
|
+
const report = await (0, resolver_validation_1.checkResolverPayload)(row, resolverPayload, undefined, auth.userId);
|
|
188
|
+
if (report)
|
|
189
|
+
return (0, resolve_1.validationFailure)(report);
|
|
190
|
+
}
|
|
191
|
+
// Phase 2: fill by asserted id. The SDK statement re-checks pending +
|
|
192
|
+
// batch state; a row that went terminal between phases maps to 409.
|
|
193
|
+
const redacted = await (0, resolve_1.redactPasswords)(resolverPayload, row.metadata?.form_schema);
|
|
194
|
+
const result = await escalationService.resolveBatchItem(row.id, itemKey, redacted, outcome, undefined, resolvedBy);
|
|
195
|
+
if (result.outcome === 'not-found') {
|
|
196
|
+
return { status: 409, error: 'A concurrent resolution is already in progress for this escalation' };
|
|
197
|
+
}
|
|
198
|
+
return batchOutcomeResult(result, itemKey, row.workflow_id);
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
return { status: 500, error: err.message };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/** Maps the SDK batch outcome vocabulary onto HTTP results. */
|
|
205
|
+
function batchOutcomeResult(result, itemKey, workflowId) {
|
|
206
|
+
switch (result.outcome) {
|
|
207
|
+
case 'completed':
|
|
208
|
+
return {
|
|
209
|
+
status: 200,
|
|
210
|
+
data: {
|
|
211
|
+
outcome: 'completed',
|
|
212
|
+
remaining: 0,
|
|
213
|
+
signaled: !!result.escalation?.signal_key,
|
|
214
|
+
escalationId: result.escalation?.id,
|
|
215
|
+
workflowId,
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
case 'accepted':
|
|
219
|
+
return {
|
|
220
|
+
status: 200,
|
|
221
|
+
data: {
|
|
222
|
+
outcome: 'accepted',
|
|
223
|
+
remaining: result.remaining,
|
|
224
|
+
escalationId: result.escalation?.id,
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
case 'duplicate-item':
|
|
228
|
+
return {
|
|
229
|
+
status: 409,
|
|
230
|
+
error: 'Batch item already submitted',
|
|
231
|
+
data: { error: 'Batch item already submitted', itemKey },
|
|
232
|
+
};
|
|
233
|
+
case 'claimed-by-other':
|
|
234
|
+
return { status: 409, error: 'Escalation is claimed by another user' };
|
|
235
|
+
case 'claim-expired':
|
|
236
|
+
return { status: 409, error: 'Your claim has expired — re-claim this escalation to resolve it' };
|
|
237
|
+
case 'not-found':
|
|
238
|
+
return { status: 404, error: 'Escalation not found' };
|
|
239
|
+
case 'unknown-item':
|
|
240
|
+
return { status: 400, error: 'itemKey is not in the declared batch' };
|
|
241
|
+
case 'not-batch':
|
|
242
|
+
return { status: 400, error: 'Escalation is not a batch' };
|
|
243
|
+
default:
|
|
244
|
+
// already-resolved / already-cancelled / already-expired
|
|
245
|
+
return { status: 409, error: 'Escalation not available for resolution' };
|
|
246
|
+
}
|
|
247
|
+
}
|
|
@@ -73,6 +73,15 @@ export declare function resolveAllOrNone(input: {
|
|
|
73
73
|
metadata?: Record<string, any>;
|
|
74
74
|
requireClaimed?: boolean;
|
|
75
75
|
}, auth: LTApiAuth): Promise<LTApiResult>;
|
|
76
|
+
/**
|
|
77
|
+
* The resolving principal's identity for `$resolution` delivery. The email is
|
|
78
|
+
* best-effort (one indexed read, tolerated failure) — the id alone satisfies
|
|
79
|
+
* the provenance contract.
|
|
80
|
+
*/
|
|
81
|
+
export declare function resolverIdentity(auth: LTApiAuth): Promise<{
|
|
82
|
+
id: string;
|
|
83
|
+
email?: string;
|
|
84
|
+
}>;
|
|
76
85
|
/**
|
|
77
86
|
* The canonical 422 for a schema-validation rejection. The full body rides in
|
|
78
87
|
* `data` (routes serialize `data ?? { error }`), so every transport — HTTP,
|
|
@@ -80,3 +89,5 @@ export declare function resolveAllOrNone(input: {
|
|
|
80
89
|
* role, schemaVersion. `code` also sits on the envelope for SDK branching.
|
|
81
90
|
*/
|
|
82
91
|
export declare function validationFailure(report: ResolverSchemaViolationReport): LTApiResult;
|
|
92
|
+
/** Replace password fields with ephemeral tokens so plaintext never enters the signal store. */
|
|
93
|
+
export declare function redactPasswords(payload: Record<string, any>, formSchema: any): Promise<Record<string, any>>;
|
|
@@ -37,7 +37,9 @@ exports.resolveEscalation = resolveEscalation;
|
|
|
37
37
|
exports.resolveBySignalKey = resolveBySignalKey;
|
|
38
38
|
exports.resolveByIds = resolveByIds;
|
|
39
39
|
exports.resolveAllOrNone = resolveAllOrNone;
|
|
40
|
+
exports.resolverIdentity = resolverIdentity;
|
|
40
41
|
exports.validationFailure = validationFailure;
|
|
42
|
+
exports.redactPasswords = redactPasswords;
|
|
41
43
|
const escalationService = __importStar(require("../../services/escalation"));
|
|
42
44
|
const userService = __importStar(require("../../services/user"));
|
|
43
45
|
const taskService = __importStar(require("../../services/task"));
|
package/build/api/settings.js
CHANGED
|
@@ -8,6 +8,7 @@ const socketio_1 = require("../lib/events/socketio");
|
|
|
8
8
|
const nats_ws_proxy_1 = require("../lib/events/nats-ws-proxy");
|
|
9
9
|
const config_1 = require("../modules/config");
|
|
10
10
|
const features_1 = require("../modules/features");
|
|
11
|
+
const search_1 = require("../modules/search");
|
|
11
12
|
const branding_1 = require("../modules/branding");
|
|
12
13
|
const version_1 = require("../modules/version");
|
|
13
14
|
const sso_1 = require("../modules/sso");
|
|
@@ -76,6 +77,7 @@ async function getSettings(req) {
|
|
|
76
77
|
enabled: (0, llm_1.hasLLMApiKey)(),
|
|
77
78
|
},
|
|
78
79
|
features: (0, features_1.getFeatureFlags)(),
|
|
80
|
+
search: (0, search_1.getSearchConfig)(),
|
|
79
81
|
branding: (0, branding_1.getBranding)(),
|
|
80
82
|
environment: {
|
|
81
83
|
longTailVersion: version_1.LONG_TAIL_VERSION,
|
package/build/index.js
CHANGED
|
@@ -172,6 +172,12 @@ async function main() {
|
|
|
172
172
|
// The examples ship the full scan demo (schemes 10/11); surface it.
|
|
173
173
|
scanCodes: true,
|
|
174
174
|
},
|
|
175
|
+
search: {
|
|
176
|
+
// The examples surface the global search bar with the seed data's
|
|
177
|
+
// primary facet; escalationId/workflowId are always present.
|
|
178
|
+
enabled: true,
|
|
179
|
+
facets: ['orderId'],
|
|
180
|
+
},
|
|
175
181
|
mcp: {
|
|
176
182
|
server: { enabled: true },
|
|
177
183
|
},
|
|
@@ -40,7 +40,7 @@ export declare function publishTaskEvent(params: {
|
|
|
40
40
|
* role hops (`system.escalation.*.{id}.>`).
|
|
41
41
|
*/
|
|
42
42
|
export declare function publishEscalationEvent(params: {
|
|
43
|
-
type: 'escalation.created' | 'escalation.resolved' | 'escalation.claimed' | 'escalation.released' | 'escalation.cancelled' | 'escalation.reassigned';
|
|
43
|
+
type: 'escalation.created' | 'escalation.resolved' | 'escalation.claimed' | 'escalation.released' | 'escalation.cancelled' | 'escalation.reassigned' | 'escalation.updated';
|
|
44
44
|
source: string;
|
|
45
45
|
workflowId: string;
|
|
46
46
|
workflowName: string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global search bar configuration surfaced to the dashboard via /api/settings.
|
|
3
|
+
*
|
|
4
|
+
* Opt-in (default off). `facets` lists the metadata facet names the search
|
|
5
|
+
* picklist offers; the dashboard prepends `escalationId` and `workflowId`
|
|
6
|
+
* unconditionally (long-tail-owned lookups), so `facets` is only the
|
|
7
|
+
* deployment's domain vocabulary. Configure through the `search` block of the
|
|
8
|
+
* `start()` config, or by env (`LT_SEARCH_BAR`, `LT_SEARCH_FACETS` csv) —
|
|
9
|
+
* env wins when set, so a deployment can flip the bar without a code change.
|
|
10
|
+
*/
|
|
11
|
+
export interface SearchConfig {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
facets: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Apply the start-config block, then the env overrides. Called once at boot;
|
|
17
|
+
* callable again in tests.
|
|
18
|
+
*/
|
|
19
|
+
export declare function configureSearch(patch?: Partial<SearchConfig>): void;
|
|
20
|
+
/** The resolved search configuration reported to the dashboard. */
|
|
21
|
+
export declare function getSearchConfig(): SearchConfig;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Global search bar configuration surfaced to the dashboard via /api/settings.
|
|
4
|
+
*
|
|
5
|
+
* Opt-in (default off). `facets` lists the metadata facet names the search
|
|
6
|
+
* picklist offers; the dashboard prepends `escalationId` and `workflowId`
|
|
7
|
+
* unconditionally (long-tail-owned lookups), so `facets` is only the
|
|
8
|
+
* deployment's domain vocabulary. Configure through the `search` block of the
|
|
9
|
+
* `start()` config, or by env (`LT_SEARCH_BAR`, `LT_SEARCH_FACETS` csv) —
|
|
10
|
+
* env wins when set, so a deployment can flip the bar without a code change.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.configureSearch = configureSearch;
|
|
14
|
+
exports.getSearchConfig = getSearchConfig;
|
|
15
|
+
// Mirrors the facet-key rule enforced by the faceted-query surface.
|
|
16
|
+
const FACET_KEY = /^[a-zA-Z0-9_]+$/;
|
|
17
|
+
const DEFAULTS = { enabled: false, facets: [] };
|
|
18
|
+
let search = { ...DEFAULTS };
|
|
19
|
+
function sanitizeFacets(names) {
|
|
20
|
+
if (!Array.isArray(names))
|
|
21
|
+
return [];
|
|
22
|
+
const out = [];
|
|
23
|
+
for (const n of names) {
|
|
24
|
+
if (typeof n !== 'string')
|
|
25
|
+
continue;
|
|
26
|
+
const trimmed = n.trim();
|
|
27
|
+
if (!FACET_KEY.test(trimmed)) {
|
|
28
|
+
console.warn(`[lt-search] dropping invalid search facet name: '${trimmed}'`);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (!out.includes(trimmed))
|
|
32
|
+
out.push(trimmed);
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Apply the start-config block, then the env overrides. Called once at boot;
|
|
38
|
+
* callable again in tests.
|
|
39
|
+
*/
|
|
40
|
+
function configureSearch(patch) {
|
|
41
|
+
search = {
|
|
42
|
+
enabled: patch?.enabled ?? DEFAULTS.enabled,
|
|
43
|
+
facets: sanitizeFacets(patch?.facets ?? DEFAULTS.facets),
|
|
44
|
+
};
|
|
45
|
+
const envEnabled = process.env.LT_SEARCH_BAR;
|
|
46
|
+
if (envEnabled !== undefined)
|
|
47
|
+
search.enabled = envEnabled === 'true';
|
|
48
|
+
const envFacets = process.env.LT_SEARCH_FACETS;
|
|
49
|
+
if (envFacets !== undefined)
|
|
50
|
+
search.facets = sanitizeFacets(envFacets.split(','));
|
|
51
|
+
}
|
|
52
|
+
/** The resolved search configuration reported to the dashboard. */
|
|
53
|
+
function getSearchConfig() {
|
|
54
|
+
return { enabled: search.enabled, facets: [...search.facets] };
|
|
55
|
+
}
|
|
@@ -86,4 +86,23 @@ function registerMetadataRoutes(router) {
|
|
|
86
86
|
}, req.auth);
|
|
87
87
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
88
88
|
});
|
|
89
|
+
/**
|
|
90
|
+
* POST /api/escalations/resolve-batch-item-by-metadata
|
|
91
|
+
* Submit one declared item of a batch escalation selected by metadata facet.
|
|
92
|
+
* Interim items return { outcome: 'accepted', remaining }; the LAST item
|
|
93
|
+
* completes the escalation and wakes the waiting workflow with the full
|
|
94
|
+
* collection.
|
|
95
|
+
* Body: { key, value, itemKey, resolverPayload, metadata?, restrictRoles? }
|
|
96
|
+
*/
|
|
97
|
+
router.post('/resolve-batch-item-by-metadata', async (req, res) => {
|
|
98
|
+
const result = await api.resolveBatchItemByMetadata({
|
|
99
|
+
key: req.body?.key,
|
|
100
|
+
value: req.body?.value,
|
|
101
|
+
itemKey: req.body?.itemKey,
|
|
102
|
+
resolverPayload: req.body?.resolverPayload,
|
|
103
|
+
metadata: req.body?.metadata,
|
|
104
|
+
restrictRoles: req.body?.restrictRoles,
|
|
105
|
+
}, req.auth);
|
|
106
|
+
res.status(result.status).json(result.data ?? { error: result.error });
|
|
107
|
+
});
|
|
89
108
|
}
|
|
@@ -85,6 +85,47 @@ function registerResolveRoutes(router) {
|
|
|
85
85
|
}, req.auth);
|
|
86
86
|
res.status(result.status).json(result.data ?? { error: result.error });
|
|
87
87
|
});
|
|
88
|
+
/**
|
|
89
|
+
* POST /api/escalations/resolve-batch-item-by-signal-key
|
|
90
|
+
* Submit ONE declared item of a batch escalation by its signal_key — the
|
|
91
|
+
* deterministic home signal id the waiting workflow parked on. For callers
|
|
92
|
+
* that already own that identity (a child calling home, a webhook).
|
|
93
|
+
* Literal single-segment path — registered before /:id routes.
|
|
94
|
+
* Body: { signalKey: string, itemKey: string, resolverPayload: Record<string, any>,
|
|
95
|
+
* metadata?: Record<string, any> }
|
|
96
|
+
*/
|
|
97
|
+
router.post('/resolve-batch-item-by-signal-key', async (req, res) => {
|
|
98
|
+
const result = await api.resolveBatchItemBySignalKey({
|
|
99
|
+
signalKey: req.body?.signalKey,
|
|
100
|
+
itemKey: req.body?.itemKey,
|
|
101
|
+
resolverPayload: req.body?.resolverPayload,
|
|
102
|
+
metadata: req.body?.metadata,
|
|
103
|
+
}, req.auth);
|
|
104
|
+
res.status(result.status).json(result.data ?? { error: result.error });
|
|
105
|
+
});
|
|
106
|
+
/**
|
|
107
|
+
* POST /api/escalations/:id/resolve-batch-item
|
|
108
|
+
* Submit ONE declared item of a batch escalation. Interim items return
|
|
109
|
+
* { outcome: 'accepted', remaining }; the LAST item completes the
|
|
110
|
+
* escalation and wakes the waiting workflow with the full collection.
|
|
111
|
+
* Claim-agnostic by default; assertClaim: true requires the caller's own
|
|
112
|
+
* live claim, asserted atomically.
|
|
113
|
+
* Body: { itemKey: string, resolverPayload: Record<string, any>,
|
|
114
|
+
* metadata?: Record<string, any>, assertClaim?: boolean }
|
|
115
|
+
*/
|
|
116
|
+
router.post('/:id/resolve-batch-item', async (req, res) => {
|
|
117
|
+
const auth = await (0, acting_1.effectiveWorkAuth)(req, res);
|
|
118
|
+
if (!auth)
|
|
119
|
+
return;
|
|
120
|
+
const result = await api.resolveBatchItem({
|
|
121
|
+
id: req.params.id,
|
|
122
|
+
itemKey: req.body?.itemKey,
|
|
123
|
+
resolverPayload: req.body?.resolverPayload,
|
|
124
|
+
metadata: req.body?.metadata,
|
|
125
|
+
assertClaim: req.body?.assertClaim,
|
|
126
|
+
}, auth);
|
|
127
|
+
res.status(result.status).json(result.data ?? { error: result.error });
|
|
128
|
+
});
|
|
88
129
|
/**
|
|
89
130
|
* POST /api/escalations/:id/resolve
|
|
90
131
|
* Resolve a pending escalation with a human-provided payload. Routes by
|
package/build/sdk/index.d.ts
CHANGED
|
@@ -222,6 +222,27 @@ export declare function createClient(options?: LTClientOptions): {
|
|
|
222
222
|
restrictRoles?: string[];
|
|
223
223
|
extraFacets?: Record<string, any>;
|
|
224
224
|
}, auth?: LTApiAuth) => Promise<LTApiResult<any>>;
|
|
225
|
+
resolveBatchItem: (input: {
|
|
226
|
+
id: string;
|
|
227
|
+
itemKey: string;
|
|
228
|
+
resolverPayload: Record<string, any>;
|
|
229
|
+
metadata?: Record<string, any>;
|
|
230
|
+
assertClaim?: boolean;
|
|
231
|
+
}, auth?: LTApiAuth) => Promise<LTApiResult<any>>;
|
|
232
|
+
resolveBatchItemBySignalKey: (input: {
|
|
233
|
+
signalKey: string;
|
|
234
|
+
itemKey: string;
|
|
235
|
+
resolverPayload: Record<string, any>;
|
|
236
|
+
metadata?: Record<string, any>;
|
|
237
|
+
}, auth?: LTApiAuth) => Promise<LTApiResult<any>>;
|
|
238
|
+
resolveBatchItemByMetadata: (input: {
|
|
239
|
+
key: string;
|
|
240
|
+
value: string;
|
|
241
|
+
itemKey: string;
|
|
242
|
+
resolverPayload: Record<string, any>;
|
|
243
|
+
metadata?: Record<string, any>;
|
|
244
|
+
restrictRoles?: string[];
|
|
245
|
+
}, auth?: LTApiAuth) => Promise<LTApiResult<any>>;
|
|
225
246
|
searchByFacets: (input: import("..").FacetQuery, auth?: LTApiAuth) => Promise<LTApiResult<any>>;
|
|
226
247
|
claimGroups: (input: {
|
|
227
248
|
query: import("..").FacetQuery;
|
package/build/sdk/index.js
CHANGED
|
@@ -143,6 +143,9 @@ function createClient(options = {}) {
|
|
|
143
143
|
findByMetadata: bindAuth(escalationsApi.findByMetadata, auth),
|
|
144
144
|
claimByMetadata: bindAuth(escalationsApi.claimByMetadata, auth),
|
|
145
145
|
resolveByMetadata: bindAuth(escalationsApi.resolveByMetadata, auth),
|
|
146
|
+
resolveBatchItem: bindAuth(escalationsApi.resolveBatchItem, auth),
|
|
147
|
+
resolveBatchItemBySignalKey: bindAuth(escalationsApi.resolveBatchItemBySignalKey, auth),
|
|
148
|
+
resolveBatchItemByMetadata: bindAuth(escalationsApi.resolveBatchItemByMetadata, auth),
|
|
146
149
|
// Faceted-routing surface (pond search + batch claim), RBAC-scoped to the caller's role.
|
|
147
150
|
searchByFacets: bindAuth(escalationsApi.searchByFacets, auth),
|
|
148
151
|
claimGroups: bindAuth(escalationsApi.claimGroups, auth),
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { BatchItemOutcome, LTEscalationRecord } from '../../types';
|
|
2
|
+
export interface ResolveBatchItemOutcome {
|
|
3
|
+
outcome: BatchItemOutcome;
|
|
4
|
+
/** Items still awaiting submission after this call (0 exactly when completed). */
|
|
5
|
+
remaining: number;
|
|
6
|
+
/** The post-fill row on `completed`/`accepted`; null on every failure outcome. */
|
|
7
|
+
escalation: LTEscalationRecord | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Fills one declared item of a batch escalation in a single atomic SDK
|
|
11
|
+
* statement (guarded fill + facet recompute + resolve-and-wake on the last
|
|
12
|
+
* item). Interim fills publish `escalation.updated` with progress; the
|
|
13
|
+
* completing fill publishes the standard `escalation.resolved`. Failure
|
|
14
|
+
* outcomes publish nothing — the row was untouched.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveBatchItem(id: string, itemKey: string, payload: Record<string, any>, metadata?: Record<string, any>, assertClaim?: string, resolvedBy?: {
|
|
17
|
+
id: string;
|
|
18
|
+
email?: string;
|
|
19
|
+
}): Promise<ResolveBatchItemOutcome>;
|
|
20
|
+
/**
|
|
21
|
+
* Batch-item fill selecting the row by its `signal_key` — the deterministic
|
|
22
|
+
* home signal id the parent parked on. For callers that already own that
|
|
23
|
+
* identity (a child calling home, a webhook), skipping both the UUID lookup
|
|
24
|
+
* and any facet duplication. Same event contract as {@link resolveBatchItem}.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveBatchItemBySignalKey(signalKey: string, itemKey: string, payload: Record<string, any>, metadata?: Record<string, any>, resolvedBy?: {
|
|
27
|
+
id: string;
|
|
28
|
+
email?: string;
|
|
29
|
+
}): Promise<ResolveBatchItemOutcome>;
|
|
30
|
+
/**
|
|
31
|
+
* Batch-item fill selecting the row by metadata facet — the highest-priority
|
|
32
|
+
* pending row whose metadata contains the key/value, scoped by `roles`.
|
|
33
|
+
* Same event contract as {@link resolveBatchItem}.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveBatchItemByMetadata(key: string, value: unknown, itemKey: string, payload: Record<string, any>, roles?: string[], metadata?: Record<string, any>, resolvedBy?: {
|
|
36
|
+
id: string;
|
|
37
|
+
email?: string;
|
|
38
|
+
}): Promise<ResolveBatchItemOutcome>;
|