@hotmeshio/long-tail 0.22.2 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/escalations/accumulate.js +7 -1
- package/build/api/escalations/lookups.d.ts +9 -2
- package/build/api/escalations/lookups.js +15 -3
- package/build/api/escalations/metadata.d.ts +2 -0
- package/build/api/escalations/metadata.js +9 -0
- package/build/api/escalations/resolve-batch.d.ts +2 -1
- package/build/api/escalations/resolve-batch.js +6 -5
- package/build/api/scan-codes/locate.js +4 -0
- package/build/api/scan-codes/present.d.ts +1 -1
- package/build/api/scan-codes/present.js +43 -0
- package/build/api/scan-codes/verb-accumulate.js +5 -1
- package/build/api/scan-codes/verb-fill.js +4 -1
- package/build/api/scan-codes/verb-into-subject.d.ts +12 -0
- package/build/api/scan-codes/verb-into-subject.js +157 -0
- package/build/api/scan-codes/verbs-subject.d.ts +23 -4
- package/build/api/scan-codes/verbs-subject.js +32 -55
- package/build/api/scan-codes/verbs.d.ts +10 -8
- package/build/api/scan-codes/verbs.js +25 -16
- package/build/index.d.ts +1 -1
- package/build/index.js +3 -2
- package/build/sdk/index.d.ts +1 -0
- package/build/services/escalation/batch.d.ts +4 -4
- package/build/services/escalation/batch.js +7 -4
- package/build/services/escalation/claim-asserted.d.ts +10 -0
- package/build/services/escalation/claim-asserted.js +64 -0
- package/build/services/escalation/facets.d.ts +3 -1
- package/build/services/escalation/facets.js +7 -3
- package/build/services/escalation/index.d.ts +1 -0
- package/build/services/escalation/index.js +3 -1
- package/build/services/knowledge/lookup-cache.d.ts +16 -4
- package/build/services/knowledge/lookup-cache.js +53 -20
- package/build/services/knowledge/lookup-refs.d.ts +3 -2
- package/build/services/knowledge/lookup-refs.js +6 -4
- package/build/services/knowledge/sql.d.ts +2 -0
- package/build/services/knowledge/sql.js +9 -1
- package/build/services/mcp/server-tools.js +1 -1
- package/build/services/orchestrator/condition.d.ts +17 -11
- package/build/services/orchestrator/condition.js +12 -7
- package/build/services/scan-code/index.d.ts +1 -1
- package/build/services/scan-code/index.js +2 -1
- package/build/services/scan-code/validate-facts.d.ts +5 -0
- package/build/services/scan-code/validate-facts.js +24 -0
- package/build/services/scan-code/validate-query.d.ts +8 -0
- package/build/services/scan-code/validate-query.js +36 -0
- package/build/services/scan-code/validate-subject.js +29 -2
- package/build/services/scan-code/validate.js +17 -8
- package/build/shared/scan-code/gtin.d.ts +6 -0
- package/build/shared/scan-code/gtin.js +13 -0
- package/build/shared/scan-code/index.d.ts +1 -1
- package/build/shared/scan-code/index.js +2 -1
- package/build/system/mcp-servers/admin/schemas.d.ts +185 -5
- package/build/system/mcp-servers/admin/schemas.js +16 -3
- package/build/system/seed/tool-manifests-admin.d.ts +202 -1
- package/build/system/seed/tool-manifests-admin.js +2 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/escalation.d.ts +23 -8
- package/build/types/escalation.js +18 -7
- package/build/types/index.d.ts +3 -3
- package/build/types/index.js +3 -1
- package/build/types/scan-code/response.d.ts +5 -0
- package/build/types/scan-code/rule.d.ts +32 -2
- package/dashboard/dist/assets/{AdminDashboard-DBW12qQt.js → AdminDashboard-DKrqLGjn.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-DBW12qQt.js.map → AdminDashboard-DKrqLGjn.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-CmHv8U9M.js → AgentConfigPage-BoQhRW6U.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-CmHv8U9M.js.map → AgentConfigPage-BoQhRW6U.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-D1scIbz-.js → AgentDetailPage-DZhzuZmO.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-D1scIbz-.js.map → AgentDetailPage-DZhzuZmO.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-BA_ai9HJ.js → AgentsPage-5MynmbWX.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-BA_ai9HJ.js.map → AgentsPage-5MynmbWX.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-C2_5aEFW.js → AvailableEscalationsPage-CWMyy3IL.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-C2_5aEFW.js.map → AvailableEscalationsPage-CWMyy3IL.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-BZo4Kp4a.js → BotPicker-C3LR6Sqy.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-BZo4Kp4a.js.map → BotPicker-C3LR6Sqy.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-BFhyxY2T.js → BulkAssignModal-COjoOIIH.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-BFhyxY2T.js.map → BulkAssignModal-COjoOIIH.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-CvOX6vAc.js → CapabilitiesPage-DKxLvOfB.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-CvOX6vAc.js.map → CapabilitiesPage-DKxLvOfB.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-GCJsV9Oq.js → CollapsibleSection-Cz5sRx-r.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-GCJsV9Oq.js.map → CollapsibleSection-Cz5sRx-r.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-CAgYLcef.js → ConfirmDeleteModal-Beq1vQtY.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-CAgYLcef.js.map → ConfirmDeleteModal-Beq1vQtY.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-Dik2z0M_.js → CountdownTimer-BUBl_4mP.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-Dik2z0M_.js.map → CountdownTimer-BUBl_4mP.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-twd2xCOW.js → CredentialsPage-DhiHiPsG.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-twd2xCOW.js.map → CredentialsPage-DhiHiPsG.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-DdnIuudX.js → CronLabel-C9SkawB-.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-DdnIuudX.js.map → CronLabel-C9SkawB-.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-DCctVv5R.js → ElapsedCell-BeK1SUDK.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-DCctVv5R.js.map → ElapsedCell-BeK1SUDK.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-CMnskyWv.js → EntityTimelinePanel-BThdefKj.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-CMnskyWv.js.map → EntityTimelinePanel-BThdefKj.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-VfCn6WDb.js → EscalationListSchemaPage-DlDIYb-p.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-VfCn6WDb.js.map → EscalationListSchemaPage-DlDIYb-p.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListView-CGQZxcC-.js → EscalationListView-DTIVuym4.js} +2 -2
- package/dashboard/dist/assets/{EscalationListView-CGQZxcC-.js.map → EscalationListView-DTIVuym4.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-BX0tx-PM.js → EscalationSchemaPage-CQt-Embr.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-BX0tx-PM.js.map → EscalationSchemaPage-CQt-Embr.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTimeline-DKoSM56J.js → EscalationTimeline-DNKNp6pL.js} +2 -2
- package/dashboard/dist/assets/{EscalationTimeline-DKoSM56J.js.map → EscalationTimeline-DNKNp6pL.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTitleSelect-DWGLBOmS.js → EscalationTitleSelect-Dewrv8wX.js} +2 -2
- package/dashboard/dist/assets/{EscalationTitleSelect-DWGLBOmS.js.map → EscalationTitleSelect-Dewrv8wX.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-C2XoguaA.js → EscalationsOverview-BzH-Y-5x.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-C2XoguaA.js.map → EscalationsOverview-BzH-Y-5x.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-CBUWq7--.js → EventTable-C97m6IZv.js} +2 -2
- package/dashboard/dist/assets/{EventTable-CBUWq7--.js.map → EventTable-C97m6IZv.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-8IdbleZ9.js → FilterBar-D-6xVHIw.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-8IdbleZ9.js.map → FilterBar-D-6xVHIw.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-CUvoPzsW.js → GraphInvokePage-Bwi8EF9Y.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-CUvoPzsW.js.map → GraphInvokePage-Bwi8EF9Y.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-BP7v9GLJ.js → HomePage-Z_Q03C0z.js} +2 -2
- package/dashboard/dist/assets/{HomePage-BP7v9GLJ.js.map → HomePage-Z_Q03C0z.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-Cnacuwoy.js → ListToolbar-_jWTw5no.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-Cnacuwoy.js.map → ListToolbar-_jWTw5no.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-C2JoNoDA.js → McpOverview-CjqTuP0N.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-C2JoNoDA.js.map → McpOverview-CjqTuP0N.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-C_nih0w-.js → McpQueryDetailPage-leCsje1U.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-C_nih0w-.js.map → McpQueryDetailPage-leCsje1U.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-U_wNXow2.js → McpQueryPage-C-PyXYX4.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-U_wNXow2.js.map → McpQueryPage-C-PyXYX4.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-DtKoJq6J.js → McpRunDetailPage-JDrr3uUQ.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-DtKoJq6J.js.map → McpRunDetailPage-JDrr3uUQ.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-CnYtfGhf.js → McpRunsPage-DERXQLgZ.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-CnYtfGhf.js.map → McpRunsPage-DERXQLgZ.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-C7hupIer.js → OperationsPage-B2DA7n9m.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-C7hupIer.js.map → OperationsPage-B2DA7n9m.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-fVuLn2D5.js → OperatorDashboard-C8RtPv8P.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-fVuLn2D5.js.map → OperatorDashboard-C8RtPv8P.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-C-4o8lPw.js → PersonaDetailPage-ChXwJ6u5.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-C-4o8lPw.js.map → PersonaDetailPage-ChXwJ6u5.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-BL1FwLmv.js → PersonasPage-BFFxncSE.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-BL1FwLmv.js.map → PersonasPage-BFFxncSE.js.map} +1 -1
- package/dashboard/dist/assets/{PortalPage-tJG5sgb1.js → PortalPage-Xk1zVneM.js} +2 -2
- package/dashboard/dist/assets/{PortalPage-tJG5sgb1.js.map → PortalPage-Xk1zVneM.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-Dz_jY4Yt.js → ProcessDetailPage-D7EYwW-j.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-Dz_jY4Yt.js.map → ProcessDetailPage-D7EYwW-j.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-Cbn9cter.js → ProcessesListPage-CakYRtnE.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-Cbn9cter.js.map → ProcessesListPage-CakYRtnE.js.map} +1 -1
- package/dashboard/dist/assets/{ResolverForm-Bk8iXQ6-.js → ResolverForm-BwVOJUpJ.js} +6 -6
- package/dashboard/dist/assets/ResolverForm-BwVOJUpJ.js.map +1 -0
- package/dashboard/dist/assets/{RoleDetailPage-owPi6gI9.js → RoleDetailPage-CKbGwezP.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-owPi6gI9.js.map → RoleDetailPage-CKbGwezP.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-NwmMvZFa.js → RolesPage-Czu7Zku4.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-NwmMvZFa.js.map → RolesPage-Czu7Zku4.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-tgEooTyU.js → RunAsSelector-6BLScYTX.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-tgEooTyU.js.map → RunAsSelector-6BLScYTX.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-CUv_8ic6.js → ScanCodesPage-Cv9q8Bvt.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-CUv_8ic6.js.map → ScanCodesPage-Cv9q8Bvt.js.map} +1 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-BxazXYIc.js +2 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-BxazXYIc.js.map +1 -0
- package/dashboard/dist/assets/ScanStationPage-Cg8LCFR7.js +2 -0
- package/dashboard/dist/assets/ScanStationPage-Cg8LCFR7.js.map +1 -0
- package/dashboard/dist/assets/{StickyPagination-CsTI_gvJ.js → StickyPagination-DsdtYoXR.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-CsTI_gvJ.js.map → StickyPagination-DsdtYoXR.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-auRlvjTh.js → StreamMessageDetail-CT3FQoT3.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-auRlvjTh.js.map → StreamMessageDetail-CT3FQoT3.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-BLoVHYAd.js → SwimlaneTimeline-C8TjkJ10.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-BLoVHYAd.js.map → SwimlaneTimeline-C8TjkJ10.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-BPsZ1bK_.js → TaskDetailPage-DGUzdBFN.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-BPsZ1bK_.js.map → TaskDetailPage-DGUzdBFN.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-BNGM74yT.js → TasksListPage-BVIP6-EZ.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-BNGM74yT.js.map → TasksListPage-BVIP6-EZ.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-BnAHXGK7.js → TimeAgo-C-rd9F9g.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-BnAHXGK7.js.map → TimeAgo-C-rd9F9g.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-J4yae6mc.js → TimestampCell-DPbchDOI.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-J4yae6mc.js.map → TimestampCell-DPbchDOI.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-BdzzgXDu.js → ToolTestPanel-DAUC8DHK.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-BdzzgXDu.js.map → ToolTestPanel-DAUC8DHK.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-DJKg8lb7.js → TopicDetailPage-70mMKBzG.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-DJKg8lb7.js.map → TopicDetailPage-70mMKBzG.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-DQV0WxG6.js → TopicsPage-CE3hBthn.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-DQV0WxG6.js.map → TopicsPage-CE3hBthn.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-Ct09nGh5.js → UserName-BDBDA-LR.js} +2 -2
- package/dashboard/dist/assets/{UserName-Ct09nGh5.js.map → UserName-BDBDA-LR.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-B5WJOsee.js → WorkflowExecutionPage-BbkLZ1co.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-B5WJOsee.js.map → WorkflowExecutionPage-BbkLZ1co.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-Hc87TRgD.js → WorkflowsDashboard-Bp1L7Ggz.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-Hc87TRgD.js.map → WorkflowsDashboard-Bp1L7Ggz.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-CJQbyOj-.js → WorkflowsOverview-IeTKHAi4.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-CJQbyOj-.js.map → WorkflowsOverview-IeTKHAi4.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-BMeED677.js → YamlWorkflowDetailPage-DtKCXnKt.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-BMeED677.js.map → YamlWorkflowDetailPage-DtKCXnKt.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-BMMg0Id6.js → YamlWorkflowsPage-CEcZBV_3.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-BMMg0Id6.js.map → YamlWorkflowsPage-CEcZBV_3.js.map} +1 -1
- package/dashboard/dist/assets/{agents-CdFkgFvg.js → agents-BT-sEk81.js} +2 -2
- package/dashboard/dist/assets/{agents-CdFkgFvg.js.map → agents-BT-sEk81.js.map} +1 -1
- package/dashboard/dist/assets/{bots-Mj3LHWWg.js → bots-DRoAdLek.js} +2 -2
- package/dashboard/dist/assets/{bots-Mj3LHWWg.js.map → bots-DRoAdLek.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-Dw1ObK2-.js → capabilities-Bc-nJk6y.js} +2 -2
- package/dashboard/dist/assets/{capabilities-Dw1ObK2-.js.map → capabilities-Bc-nJk6y.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-DcNE1APv.js → controlplane-aXceSIRf.js} +2 -2
- package/dashboard/dist/assets/{controlplane-DcNE1APv.js.map → controlplane-aXceSIRf.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-D364Trpy.js → escalation-columns-Bf09Q89t.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-D364Trpy.js.map → escalation-columns-Bf09Q89t.js.map} +1 -1
- package/dashboard/dist/assets/index-BCFEQEMC.js +2 -0
- package/dashboard/dist/assets/index-BCFEQEMC.js.map +1 -0
- package/dashboard/dist/assets/{index-Bd6-KmBE.js → index-BEPKAjna.js} +2 -2
- package/dashboard/dist/assets/{index-Bd6-KmBE.js.map → index-BEPKAjna.js.map} +1 -1
- package/dashboard/dist/assets/{index-BQeHJHYN.js → index-BUYokcrl.js} +25 -25
- package/dashboard/dist/assets/index-BUYokcrl.js.map +1 -0
- package/dashboard/dist/assets/{index-MDD4JYtu.js → index-Ba-s5Yb5.js} +2 -2
- package/dashboard/dist/assets/{index-MDD4JYtu.js.map → index-Ba-s5Yb5.js.map} +1 -1
- package/dashboard/dist/assets/{index-BRGTmoYY.js → index-C3VTJcrp.js} +2 -2
- package/dashboard/dist/assets/{index-BRGTmoYY.js.map → index-C3VTJcrp.js.map} +1 -1
- package/dashboard/dist/assets/{index-Dyotfa_k.js → index-CZyO9hRb.js} +2 -2
- package/dashboard/dist/assets/{index-Dyotfa_k.js.map → index-CZyO9hRb.js.map} +1 -1
- package/dashboard/dist/assets/{index-eDm6cz0F.js → index-CcgmR-7-.js} +2 -2
- package/dashboard/dist/assets/{index-eDm6cz0F.js.map → index-CcgmR-7-.js.map} +1 -1
- package/dashboard/dist/assets/{index-DkcI4V_H.js → index-CuBGGwXf.js} +2 -2
- package/dashboard/dist/assets/{index-DkcI4V_H.js.map → index-CuBGGwXf.js.map} +1 -1
- package/dashboard/dist/assets/index-D1mKf_qz.js +3 -0
- package/dashboard/dist/assets/index-D1mKf_qz.js.map +1 -0
- package/dashboard/dist/assets/{index-Bq5XNEzD.js → index-DBxpyIw5.js} +2 -2
- package/dashboard/dist/assets/{index-Bq5XNEzD.js.map → index-DBxpyIw5.js.map} +1 -1
- package/dashboard/dist/assets/{index-B3veJ698.js → index-DH03y-UT.js} +2 -2
- package/dashboard/dist/assets/{index-B3veJ698.js.map → index-DH03y-UT.js.map} +1 -1
- package/dashboard/dist/assets/{index-BiVce3n0.js → index-Djsoi8DI.js} +2 -2
- package/dashboard/dist/assets/{index-BiVce3n0.js.map → index-Djsoi8DI.js.map} +1 -1
- package/dashboard/dist/assets/{index-DPStdq4T.js → index-h2gX31B2.js} +2 -2
- package/dashboard/dist/assets/{index-DPStdq4T.js.map → index-h2gX31B2.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-Bafewjxk.js → knowledge-BhW8V-Hq.js} +2 -2
- package/dashboard/dist/assets/{knowledge-Bafewjxk.js.map → knowledge-BhW8V-Hq.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-vLIutbnc.js → mcp-BYfSMQzh.js} +2 -2
- package/dashboard/dist/assets/{mcp-vLIutbnc.js.map → mcp-BYfSMQzh.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-BzTtIG90.js → mcp-query-DUJoOk_q.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-BzTtIG90.js.map → mcp-query-DUJoOk_q.js.map} +1 -1
- package/dashboard/dist/assets/metadata-display-B7X5hGxG.js +2 -0
- package/dashboard/dist/assets/metadata-display-B7X5hGxG.js.map +1 -0
- package/dashboard/dist/assets/{personas-WD40EDS_.js → personas-jT1O_SB4.js} +2 -2
- package/dashboard/dist/assets/{personas-WD40EDS_.js.map → personas-jT1O_SB4.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-DFwULWs3.js → pipelines-Bp-wIaz2.js} +2 -2
- package/dashboard/dist/assets/{pipelines-DFwULWs3.js.map → pipelines-Bp-wIaz2.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-La_-WAUn.js → tasks-CCrvnXbz.js} +2 -2
- package/dashboard/dist/assets/{tasks-La_-WAUn.js.map → tasks-CCrvnXbz.js.map} +1 -1
- package/dashboard/dist/assets/{topics-CzYMlvqm.js → topics-Blft0I1L.js} +2 -2
- package/dashboard/dist/assets/{topics-CzYMlvqm.js.map → topics-Blft0I1L.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-C0FQyANW.js → useDebouncedValue-BYqbcism.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-C0FQyANW.js.map → useDebouncedValue-BYqbcism.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-WW_XjAb3.js → useNamespace-BfxJAUgG.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-WW_XjAb3.js.map → useNamespace-BfxJAUgG.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-B3YxPeFt.js → useYamlActivityEvents-BukJuWpb.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-B3YxPeFt.js.map → useYamlActivityEvents-BukJuWpb.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-COHOjdhF.js → yaml-workflows-DeRWqMGk.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-COHOjdhF.js.map → yaml-workflows-DeRWqMGk.js.map} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/docs/accumulator.md +1 -1
- package/docs/api/sdk/escalations.md +1 -1
- package/docs/hitl/escalation.md +12 -0
- package/docs/hitl/lookups.md +27 -18
- package/docs/hitl/resolution.md +1 -1
- package/docs/hitl/x-lt-validation.md +1 -1
- package/docs/hitl/x-lt-widget.md +1 -1
- package/docs/hitl-guide.md +1 -1
- package/docs/scan-codes.md +86 -16
- package/package.json +2 -2
- package/dashboard/dist/assets/ResolverForm-Bk8iXQ6-.js.map +0 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-YHqbu7oK.js +0 -2
- package/dashboard/dist/assets/ScanSchemeDetailPage-YHqbu7oK.js.map +0 -1
- package/dashboard/dist/assets/ScanStationPage-B275l6r_.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-B275l6r_.js.map +0 -1
- package/dashboard/dist/assets/index-BQeHJHYN.js.map +0 -1
- package/dashboard/dist/assets/index-BmNAVd4s.js +0 -2
- package/dashboard/dist/assets/index-BmNAVd4s.js.map +0 -1
- package/dashboard/dist/assets/index-WSm8bgE7.js +0 -3
- package/dashboard/dist/assets/index-WSm8bgE7.js.map +0 -1
- package/dashboard/dist/assets/metadata-display-COo3mMCr.js +0 -2
- package/dashboard/dist/assets/metadata-display-COo3mMCr.js.map +0 -1
|
@@ -33,9 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.bags = bags;
|
|
37
|
+
exports.claimGuard = claimGuard;
|
|
36
38
|
exports.matchGuard = matchGuard;
|
|
39
|
+
exports.failedAdd = failedAdd;
|
|
40
|
+
exports.rendered = rendered;
|
|
37
41
|
exports.accumulateFromSubject = accumulateFromSubject;
|
|
38
|
-
exports.
|
|
42
|
+
exports.already = already;
|
|
39
43
|
const scanCodeService = __importStar(require("../../services/scan-code"));
|
|
40
44
|
const escalationService = __importStar(require("../../services/escalation"));
|
|
41
45
|
const accumulate_1 = require("../escalations/accumulate");
|
|
@@ -52,13 +56,18 @@ const subject_1 = require("./subject");
|
|
|
52
56
|
// the pairing first (match), refusing with nothing written when it is wrong,
|
|
53
57
|
// then writes by id in one atomic statement: the subject joins the scanned
|
|
54
58
|
// container with its own row as the reciprocal (from: 'subject'), or the
|
|
55
|
-
// subject's row collects the scanned code (into: 'subject'
|
|
59
|
+
// subject's row collects the scanned code (into: 'subject', in
|
|
60
|
+
// verb-into-subject.ts).
|
|
56
61
|
const STOCK_REFUSAL = 'That is not where this one goes.';
|
|
57
62
|
const STOCK_CONFLICT = 'That container just closed. Scan it again, or the next one.';
|
|
58
63
|
const STOCK_PLACED = 'This one is already placed.';
|
|
59
|
-
/** The step's template bags with the subject
|
|
60
|
-
function bags(ctx, container) {
|
|
61
|
-
return {
|
|
64
|
+
/** The step's template bags with the subject, the container, and the scanned item's row once located. */
|
|
65
|
+
function bags(ctx, container, item) {
|
|
66
|
+
return {
|
|
67
|
+
...(0, context_1.templateContext)(ctx),
|
|
68
|
+
...(container ? { container: container.metadata ?? {} } : {}),
|
|
69
|
+
...(item ? { item: item.metadata ?? {} } : {}),
|
|
70
|
+
};
|
|
62
71
|
}
|
|
63
72
|
/** Refuse the act when someone else holds a live claim on the subject. */
|
|
64
73
|
async function claimGuard(step, ctx, subject) {
|
|
@@ -82,10 +91,10 @@ async function locateContainer(step, ctx) {
|
|
|
82
91
|
status: 'pending',
|
|
83
92
|
exists: [escalation_1.ESCALATION_ACCUMULATE_KEYS.COUNT],
|
|
84
93
|
limit: 2,
|
|
85
|
-
});
|
|
94
|
+
}, { total: false });
|
|
86
95
|
return found.escalations.filter((row) => row.id !== ctx.subject?.row.id);
|
|
87
96
|
}
|
|
88
|
-
const WHOLE_BAG_TOKEN = /^\{(subject|container)\.([a-zA-Z0-9_]+)\}$/;
|
|
97
|
+
const WHOLE_BAG_TOKEN = /^\{(subject|container|item)\.([a-zA-Z0-9_]+)\}$/;
|
|
89
98
|
/**
|
|
90
99
|
* One match.target template as the values it allows. A template that is a
|
|
91
100
|
* single bag token naming a list facet (`{subject.offeredContainers}`) allows every
|
|
@@ -110,11 +119,11 @@ function expandTarget(template, tpl) {
|
|
|
110
119
|
* The pre-write guard. Returns the refusal when the pairing is wrong, null
|
|
111
120
|
* when it holds (or the step declares no match).
|
|
112
121
|
*/
|
|
113
|
-
function matchGuard(step, ctx, container) {
|
|
122
|
+
function matchGuard(step, ctx, container, item) {
|
|
114
123
|
const match = step.match;
|
|
115
124
|
if (!match)
|
|
116
125
|
return null;
|
|
117
|
-
const tpl = bags(ctx, container);
|
|
126
|
+
const tpl = bags(ctx, container, item);
|
|
118
127
|
const expected = (match.target ?? []).flatMap((t) => expandTarget(t, tpl));
|
|
119
128
|
const targetOk = match.target === undefined || expected.includes(ctx.parsed.target);
|
|
120
129
|
const subjectMeta = (ctx.subject?.row.metadata ?? {});
|
|
@@ -126,15 +135,20 @@ function matchGuard(step, ctx, container) {
|
|
|
126
135
|
const markdown = scanCodeService.renderScanCopy(step.refuse?.markdown ?? STOCK_REFUSAL, tpl);
|
|
127
136
|
return (0, context_1.refused)(markdown, { refusal: { markdown, ...(expected.length ? { expected } : {}) } });
|
|
128
137
|
}
|
|
129
|
-
|
|
130
|
-
|
|
138
|
+
const PLACED_OUTCOMES = ['reciprocal-terminal', 'reciprocal-full', 'reciprocal-duplicate'];
|
|
139
|
+
/**
|
|
140
|
+
* Map a failed add onto what the bench says. 404 falls through. `keepSubject`
|
|
141
|
+
* leaves the hold in place when the reciprocal was already placed (the
|
|
142
|
+
* subject is the container the actor is still filling).
|
|
143
|
+
*/
|
|
144
|
+
function failedAdd(step, ctx, result, container, keepSubject = false) {
|
|
131
145
|
const outcome = result.data?.outcome;
|
|
132
146
|
if (result.status === 404)
|
|
133
147
|
return null;
|
|
134
148
|
if (result.status === 403)
|
|
135
149
|
return (0, context_1.forbidden)(result.error);
|
|
136
|
-
if (outcome
|
|
137
|
-
return (0, context_1.refused)(STOCK_PLACED, { clearSubject:
|
|
150
|
+
if (outcome && PLACED_OUTCOMES.includes(outcome)) {
|
|
151
|
+
return (0, context_1.refused)(STOCK_PLACED, { clearSubject: !keepSubject });
|
|
138
152
|
}
|
|
139
153
|
if (outcome === 'claimed-by-other' || outcome === 'claim-expired')
|
|
140
154
|
return (0, context_1.conflict)(result.error);
|
|
@@ -145,8 +159,9 @@ function failedAdd(step, ctx, result, container) {
|
|
|
145
159
|
}
|
|
146
160
|
return (0, context_1.refused)(result.error ?? STOCK_REFUSAL);
|
|
147
161
|
}
|
|
148
|
-
|
|
149
|
-
|
|
162
|
+
/** The step's itemKey, payload and metadata, or null when a template token has nothing to read. */
|
|
163
|
+
function rendered(step, ctx, itemKeyDefault, item) {
|
|
164
|
+
const tpl = bags(ctx, undefined, item);
|
|
150
165
|
try {
|
|
151
166
|
return {
|
|
152
167
|
itemKey: scanCodeService.interpolateScanTemplate(step.params?.itemKey ?? itemKeyDefault ?? '', tpl),
|
|
@@ -217,46 +232,8 @@ async function accumulateFromSubject(step, ctx) {
|
|
|
217
232
|
},
|
|
218
233
|
}, step, bags(ctx, container));
|
|
219
234
|
}
|
|
220
|
-
/** The subject's own row collects the scanned code. */
|
|
221
|
-
async function accumulateIntoSubject(step, ctx) {
|
|
222
|
-
const subject = ctx.subject;
|
|
223
|
-
const claimed = await claimGuard(step, ctx, subject);
|
|
224
|
-
if (claimed)
|
|
225
|
-
return claimed;
|
|
226
|
-
const mismatch = matchGuard(step, ctx);
|
|
227
|
-
if (mismatch)
|
|
228
|
-
return mismatch;
|
|
229
|
-
const values = rendered(step, ctx, '{scan.target}');
|
|
230
|
-
if (!values)
|
|
231
|
-
return null;
|
|
232
|
-
const notPrimed = (await (0, grant_1.identityGate)(step, ctx)) ?? (await (0, grant_1.spendGrant)(ctx));
|
|
233
|
-
if (notPrimed)
|
|
234
|
-
return notPrimed;
|
|
235
|
-
const result = await (0, accumulate_1.accumulateItem)({
|
|
236
|
-
id: subject.row.id,
|
|
237
|
-
itemKey: values.itemKey,
|
|
238
|
-
payload: values.payload,
|
|
239
|
-
metadata: values.metadata,
|
|
240
|
-
}, ctx.auth);
|
|
241
|
-
if (result.status !== 200) {
|
|
242
|
-
if (result.data?.outcome === 'duplicate-item') {
|
|
243
|
-
return already(step, subject.row);
|
|
244
|
-
}
|
|
245
|
-
return failedAdd(step, ctx, result);
|
|
246
|
-
}
|
|
247
|
-
const data = result.data;
|
|
248
|
-
return (0, context_1.withDone)({
|
|
249
|
-
status: 200,
|
|
250
|
-
data: {
|
|
251
|
-
outcome: types_1.SCAN_OUTCOMES.EXECUTED,
|
|
252
|
-
verb: step.verb,
|
|
253
|
-
escalation: { id: subject.row.id, ...result.data },
|
|
254
|
-
clearSubject: data.outcome === 'completed',
|
|
255
|
-
},
|
|
256
|
-
}, step, bags(ctx));
|
|
257
|
-
}
|
|
258
235
|
/** The item is already where the scan says: harmless, nothing written. */
|
|
259
|
-
function already(step, row) {
|
|
236
|
+
function already(step, row, keepSubject = false) {
|
|
260
237
|
return {
|
|
261
238
|
status: 200,
|
|
262
239
|
data: {
|
|
@@ -264,7 +241,7 @@ function already(step, row) {
|
|
|
264
241
|
verb: step.verb,
|
|
265
242
|
escalation: { id: row.id },
|
|
266
243
|
already: true,
|
|
267
|
-
clearSubject:
|
|
244
|
+
clearSubject: !keepSubject,
|
|
268
245
|
},
|
|
269
246
|
};
|
|
270
247
|
}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { type ScanExecuteResponse, type ScanStep } from '../../types';
|
|
2
2
|
import type { LTApiResult } from '../../types/sdk';
|
|
3
3
|
import { type StepContext } from './context';
|
|
4
|
-
|
|
4
|
+
/** Claims the scanned row; a presented choice passes the row it showed. */
|
|
5
|
+
export declare function claimStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
5
6
|
/**
|
|
6
7
|
* Resolves the row the step's query names: the scanned target, the extra
|
|
7
8
|
* facets, and the claim state, all inside the atomic statement. A presented
|
|
8
9
|
* choice passes the row it showed, so the resolve lands on that row or misses.
|
|
9
10
|
*/
|
|
10
11
|
export declare function resolveStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
11
|
-
export declare function escalateStep(step: ScanStep, ctx: StepContext): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
12
|
-
export declare function releaseStep(step: ScanStep, ctx: StepContext): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
12
|
+
export declare function escalateStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
13
|
+
export declare function releaseStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
13
14
|
/**
|
|
14
|
-
* Dispatch one CHOICE verb against an already-presented row.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Dispatch one CHOICE verb against an already-presented row. Every verb that
|
|
16
|
+
* writes the row writes that row by id, so a code shared by several rows
|
|
17
|
+
* never moves the write elsewhere. Unlike the step walk (where a miss falls
|
|
18
|
+
* through to the next step), a miss answers with the truth: FORBIDDEN when
|
|
19
|
+
* the actor holds no write scope here, CONFLICT when a concurrent actor won.
|
|
18
20
|
*/
|
|
19
21
|
export declare function dispatchChoiceVerb(step: ScanStep, ctx: StepContext, row: Record<string, any>): Promise<LTApiResult<ScanExecuteResponse>>;
|
|
20
|
-
export declare function cancelStep(step: ScanStep, ctx: StepContext): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
22
|
+
export declare function cancelStep(step: ScanStep, ctx: StepContext, presentedId?: string): Promise<LTApiResult<ScanExecuteResponse> | null>;
|
|
21
23
|
export { accumulateStep } from './verb-accumulate';
|
|
@@ -54,7 +54,8 @@ const hold_1 = require("./hold");
|
|
|
54
54
|
// ctx.auth is the effective actor: the badged person when a grant rode the
|
|
55
55
|
// request, otherwise the authenticated principal. Attribution and write
|
|
56
56
|
// scoping both derive from it, live, inside the escalation APIs.
|
|
57
|
-
|
|
57
|
+
/** Claims the scanned row; a presented choice passes the row it showed. */
|
|
58
|
+
async function claimStep(step, ctx, presentedId) {
|
|
58
59
|
const metadata = await (0, context_1.templated)(step, ctx, (tpl) => (0, context_1.interpolatedMetadata)(step, ctx, tpl));
|
|
59
60
|
if (metadata === null)
|
|
60
61
|
return null;
|
|
@@ -67,6 +68,7 @@ async function claimStep(step, ctx) {
|
|
|
67
68
|
durationMinutes: step.params?.durationMinutes,
|
|
68
69
|
metadata: { ...metadata, ...(0, context_1.provenance)(ctx) },
|
|
69
70
|
restrictRoles: step.query?.roles,
|
|
71
|
+
assertId: presentedId,
|
|
70
72
|
}, ctx.auth);
|
|
71
73
|
if (result.status === 404)
|
|
72
74
|
return null;
|
|
@@ -115,19 +117,19 @@ async function resolveStep(step, ctx, presentedId) {
|
|
|
115
117
|
?? (result.data.escalationId ? { id: result.data.escalationId } : undefined);
|
|
116
118
|
return (0, context_1.executed)(escalation, step);
|
|
117
119
|
}
|
|
118
|
-
async function escalateStep(step, ctx) {
|
|
120
|
+
async function escalateStep(step, ctx, presentedId) {
|
|
119
121
|
// Close the located escalation first when configured — the close doubles as
|
|
120
122
|
// the condition check AND the double-scan guard (second scan finds nothing
|
|
121
123
|
// to close and falls through).
|
|
122
124
|
if (step.params?.closeCurrent === 'resolve') {
|
|
123
|
-
const closed = await resolveStep({ ...step, params: { ...step.params, resolverPayload: step.params?.resolverPayload ?? {} } }, ctx);
|
|
125
|
+
const closed = await resolveStep({ ...step, params: { ...step.params, resolverPayload: step.params?.resolverPayload ?? {} } }, ctx, presentedId);
|
|
124
126
|
if (closed === null)
|
|
125
127
|
return null;
|
|
126
128
|
if (closed.data?.outcome !== types_1.SCAN_OUTCOMES.EXECUTED)
|
|
127
129
|
return closed;
|
|
128
130
|
}
|
|
129
131
|
else if (step.params?.closeCurrent === 'cancel') {
|
|
130
|
-
const cancelled = await cancelStep(step, ctx);
|
|
132
|
+
const cancelled = await cancelStep(step, ctx, presentedId);
|
|
131
133
|
if (cancelled === null)
|
|
132
134
|
return null;
|
|
133
135
|
if (cancelled.data?.outcome !== types_1.SCAN_OUTCOMES.EXECUTED)
|
|
@@ -152,9 +154,11 @@ async function escalateStep(step, ctx) {
|
|
|
152
154
|
return created;
|
|
153
155
|
return (0, context_1.executed)(created.data, step);
|
|
154
156
|
}
|
|
155
|
-
async function releaseStep(step, ctx) {
|
|
157
|
+
async function releaseStep(step, ctx, presentedId) {
|
|
156
158
|
// Locate the caller's own claim; release-by-id re-asserts the assignee
|
|
157
159
|
// inside the SDK, so a lost race resolves to 409, never a foreign release.
|
|
160
|
+
if (presentedId)
|
|
161
|
+
return releaseById(presentedId, step, ctx);
|
|
158
162
|
const scope = await (0, helpers_1.getEscalationReadScope)(ctx.auth.userId);
|
|
159
163
|
const readable = [...scope.allRoles, ...scope.selfRoles];
|
|
160
164
|
const roles = (0, metadata_1.restrictScopeRoles)(readable, scope.global, step.query?.roles);
|
|
@@ -169,23 +173,27 @@ async function releaseStep(step, ctx) {
|
|
|
169
173
|
});
|
|
170
174
|
if (escalations.length === 0)
|
|
171
175
|
return null;
|
|
176
|
+
return releaseById(escalations[0].id, step, ctx);
|
|
177
|
+
}
|
|
178
|
+
async function releaseById(id, step, ctx) {
|
|
172
179
|
const notPrimed = await (0, grant_1.spendGrant)(ctx);
|
|
173
180
|
if (notPrimed)
|
|
174
181
|
return notPrimed;
|
|
175
|
-
const result = await (0, claim_1.releaseEscalation)({ id
|
|
182
|
+
const result = await (0, claim_1.releaseEscalation)({ id }, ctx.auth);
|
|
176
183
|
if (result.status === 403)
|
|
177
184
|
return (0, context_1.forbidden)(result.error);
|
|
178
|
-
if (result.status === 409)
|
|
185
|
+
if (result.status === 409 || result.status === 404)
|
|
179
186
|
return (0, context_1.conflict)(result.error);
|
|
180
187
|
if (result.status !== 200)
|
|
181
188
|
return result;
|
|
182
189
|
return (0, context_1.executed)(result.data.escalation, step);
|
|
183
190
|
}
|
|
184
191
|
/**
|
|
185
|
-
* Dispatch one CHOICE verb against an already-presented row.
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
192
|
+
* Dispatch one CHOICE verb against an already-presented row. Every verb that
|
|
193
|
+
* writes the row writes that row by id, so a code shared by several rows
|
|
194
|
+
* never moves the write elsewhere. Unlike the step walk (where a miss falls
|
|
195
|
+
* through to the next step), a miss answers with the truth: FORBIDDEN when
|
|
196
|
+
* the actor holds no write scope here, CONFLICT when a concurrent actor won.
|
|
189
197
|
*/
|
|
190
198
|
async function dispatchChoiceVerb(step, ctx, row) {
|
|
191
199
|
switch (step.verb) {
|
|
@@ -195,15 +203,15 @@ async function dispatchChoiceVerb(step, ctx, row) {
|
|
|
195
203
|
return (await (0, hold_1.holdStep)(step, ctx, row));
|
|
196
204
|
case types_1.SCAN_VERBS.CLAIM:
|
|
197
205
|
case types_1.SCAN_VERBS.CLAIM_SHOW_DETAIL:
|
|
198
|
-
return (await claimStep(step, ctx)) ?? (await missReason(step, ctx, 'the item is no longer claimable'));
|
|
206
|
+
return (await claimStep(step, ctx, row.id)) ?? (await missReason(step, ctx, 'the item is no longer claimable'));
|
|
199
207
|
case types_1.SCAN_VERBS.RESOLVE:
|
|
200
208
|
return (await resolveStep(step, ctx, row.id)) ?? (await missReason(step, ctx, 'the item is no longer resolvable'));
|
|
201
209
|
case types_1.SCAN_VERBS.ESCALATE:
|
|
202
|
-
return (await escalateStep(step, ctx)) ?? (await missReason(step, ctx, 'the item already moved on'));
|
|
210
|
+
return (await escalateStep(step, ctx, row.id)) ?? (await missReason(step, ctx, 'the item already moved on'));
|
|
203
211
|
case types_1.SCAN_VERBS.RELEASE:
|
|
204
|
-
return (await releaseStep(step, ctx)) ?? (0, context_1.conflict)('no claim of yours to release');
|
|
212
|
+
return (await releaseStep(step, ctx, row.id)) ?? (0, context_1.conflict)('no claim of yours to release');
|
|
205
213
|
case types_1.SCAN_VERBS.CANCEL:
|
|
206
|
-
return (await cancelStep(step, ctx)) ?? (await missReason(step, ctx, 'the item is no longer cancellable'));
|
|
214
|
+
return (await cancelStep(step, ctx, row.id)) ?? (await missReason(step, ctx, 'the item is no longer cancellable'));
|
|
207
215
|
default:
|
|
208
216
|
throw new Error(`unknown choice verb "${step.verb}"`);
|
|
209
217
|
}
|
|
@@ -218,7 +226,7 @@ async function missReason(step, ctx, raceMessage) {
|
|
|
218
226
|
}
|
|
219
227
|
return (0, context_1.conflict)(raceMessage);
|
|
220
228
|
}
|
|
221
|
-
async function cancelStep(step, ctx) {
|
|
229
|
+
async function cancelStep(step, ctx, presentedId) {
|
|
222
230
|
// Claim-as-lock: the atomic claim pins the row to this caller (or extends
|
|
223
231
|
// their claim), serializing concurrent double-scans before the cancel.
|
|
224
232
|
const notPrimed = await (0, grant_1.spendGrant)(ctx);
|
|
@@ -229,6 +237,7 @@ async function cancelStep(step, ctx) {
|
|
|
229
237
|
value: ctx.parsed.target,
|
|
230
238
|
metadata: (0, context_1.provenance)(ctx),
|
|
231
239
|
restrictRoles: step.query?.roles,
|
|
240
|
+
assertId: presentedId,
|
|
232
241
|
}, ctx.auth);
|
|
233
242
|
if (claimed.status === 404)
|
|
234
243
|
return null;
|
package/build/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export * as TaskService from './services/task';
|
|
|
12
12
|
export * as EscalationService from './services/escalation';
|
|
13
13
|
export * as ConfigService from './services/config';
|
|
14
14
|
export * as UserService from './services/user';
|
|
15
|
-
export { assertValidScheme as assertValidScanScheme, assertValidSteps as assertValidScanSteps, assertValidIdentityRule as assertValidScanIdentityRule, isValidGtin, normalizeGtin, type ScanSchemeInput, type ScanRuleInput, } from './services/scan-code';
|
|
15
|
+
export { assertValidScheme as assertValidScanScheme, assertValidSteps as assertValidScanSteps, assertValidIdentityRule as assertValidScanIdentityRule, isValidGtin, normalizeGtin, displayGtin, type ScanSchemeInput, type ScanRuleInput, } from './services/scan-code';
|
|
16
16
|
export * as TopicService from './services/topics';
|
|
17
17
|
export { seedSystemTopics, seedConfigTopics } from './services/topics/system-topics';
|
|
18
18
|
export { ltConfig } from './modules/ltconfig';
|
package/build/index.js
CHANGED
|
@@ -36,8 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
exports.LTExpressAdapter = exports.api = exports.KnowledgeApi = exports.resolveCredential = exports.mimeFromPath = exports.getStorageBackend = exports.listOAuthConnections = exports.getFreshAccessToken = exports.createClient = exports.CallbackEventAdapter = exports.builtinMcpServerFactories = exports.getSystemAgents = exports.getSystemWorkers = exports.registerMcpTool = exports.getToolContext = exports.getActivityIdentity = exports.McpEscalationStrategy = exports.DefaultEscalationStrategy = exports.escalationStrategyRegistry = exports.McpVisionServer = exports.McpTranslationServer = void 0;
|
|
39
|
+
exports.McpClient = exports.McpService = exports.BuiltInMcpAdapter = exports.mcpRegistry = exports.defaultMaintenanceConfig = exports.maintenanceRegistry = exports.PinoLoggerAdapter = exports.loggerRegistry = exports.HoneycombTelemetryAdapter = exports.telemetryRegistry = exports.publishKnowledgeEvent = exports.publishAgentEvent = exports.publishWorkflowEvent = exports.publishActivityEvent = exports.publishEscalationEvent = exports.publishTaskEvent = exports.publishMilestoneEvent = exports.SocketIOEventAdapter = exports.InMemoryEventAdapter = exports.NatsEventAdapter = exports.eventRegistry = exports.ltConfig = exports.seedConfigTopics = exports.seedSystemTopics = exports.TopicService = exports.displayGtin = exports.normalizeGtin = exports.isValidGtin = exports.assertValidScanIdentityRule = exports.assertValidScanSteps = exports.assertValidScanScheme = exports.UserService = exports.ConfigService = exports.EscalationService = exports.TaskService = exports.setAuthAdapter = exports.signToken = exports.requireAdmin = exports.requireAuth = exports.createAuthMiddleware = exports.JwtAuthAdapter = exports.conditionalAccumulator = exports.conditionLT = exports.conditional = exports.executeLT = exports.createLTActivityInterceptor = exports.createLTInterceptor = exports.registerLT = exports.midnightTheme = exports.start = void 0;
|
|
40
|
+
exports.LTExpressAdapter = exports.api = exports.KnowledgeApi = exports.resolveCredential = exports.mimeFromPath = exports.getStorageBackend = exports.listOAuthConnections = exports.getFreshAccessToken = exports.createClient = exports.CallbackEventAdapter = exports.builtinMcpServerFactories = exports.getSystemAgents = exports.getSystemWorkers = exports.registerMcpTool = exports.getToolContext = exports.getActivityIdentity = exports.McpEscalationStrategy = exports.DefaultEscalationStrategy = exports.escalationStrategyRegistry = exports.McpVisionServer = exports.McpTranslationServer = exports.McpServer = void 0;
|
|
41
41
|
const config_1 = require("./modules/config");
|
|
42
42
|
const logger_1 = require("./lib/logger");
|
|
43
43
|
const midnight_1 = require("./themes/midnight");
|
|
@@ -76,6 +76,7 @@ Object.defineProperty(exports, "assertValidScanSteps", { enumerable: true, get:
|
|
|
76
76
|
Object.defineProperty(exports, "assertValidScanIdentityRule", { enumerable: true, get: function () { return scan_code_1.assertValidIdentityRule; } });
|
|
77
77
|
Object.defineProperty(exports, "isValidGtin", { enumerable: true, get: function () { return scan_code_1.isValidGtin; } });
|
|
78
78
|
Object.defineProperty(exports, "normalizeGtin", { enumerable: true, get: function () { return scan_code_1.normalizeGtin; } });
|
|
79
|
+
Object.defineProperty(exports, "displayGtin", { enumerable: true, get: function () { return scan_code_1.displayGtin; } });
|
|
79
80
|
exports.TopicService = __importStar(require("./services/topics"));
|
|
80
81
|
var system_topics_1 = require("./services/topics/system-topics");
|
|
81
82
|
Object.defineProperty(exports, "seedSystemTopics", { enumerable: true, get: function () { return system_topics_1.seedSystemTopics; } });
|
package/build/sdk/index.d.ts
CHANGED
|
@@ -213,6 +213,7 @@ export declare function createClient(options?: LTClientOptions): {
|
|
|
213
213
|
metadata?: Record<string, any>;
|
|
214
214
|
provisionIfAbsent?: import("../api/escalations/helpers").ProvisionIfAbsent;
|
|
215
215
|
restrictRoles?: string[];
|
|
216
|
+
assertId?: string;
|
|
216
217
|
}, auth?: LTApiAuth) => Promise<LTApiResult<any>>;
|
|
217
218
|
resolveByMetadata: (input: {
|
|
218
219
|
key: string;
|
|
@@ -9,14 +9,14 @@ export interface ResolveBatchItemOutcome {
|
|
|
9
9
|
/**
|
|
10
10
|
* Fills one declared item of a batch escalation in a single atomic SDK
|
|
11
11
|
* statement (guarded fill + facet recompute + resolve-and-wake on the last
|
|
12
|
-
* item). Interim fills publish `escalation.updated` with progress; the
|
|
12
|
+
* item). `actor` is recorded under `envelope.batch_filled_by[itemKey]`. Interim fills publish `escalation.updated` with progress; the
|
|
13
13
|
* completing fill publishes the standard `escalation.resolved`. Failure
|
|
14
14
|
* outcomes publish nothing — the row was untouched.
|
|
15
15
|
*/
|
|
16
16
|
export declare function resolveBatchItem(id: string, itemKey: string, payload: Record<string, any>, metadata?: Record<string, any>, assertClaim?: string, resolvedBy?: {
|
|
17
17
|
id: string;
|
|
18
18
|
email?: string;
|
|
19
|
-
}): Promise<ResolveBatchItemOutcome>;
|
|
19
|
+
}, actor?: string): Promise<ResolveBatchItemOutcome>;
|
|
20
20
|
/**
|
|
21
21
|
* Batch-item fill selecting the row by its `signal_key` — the deterministic
|
|
22
22
|
* home signal id the parent parked on. For callers that already own that
|
|
@@ -26,7 +26,7 @@ export declare function resolveBatchItem(id: string, itemKey: string, payload: R
|
|
|
26
26
|
export declare function resolveBatchItemBySignalKey(signalKey: string, itemKey: string, payload: Record<string, any>, metadata?: Record<string, any>, resolvedBy?: {
|
|
27
27
|
id: string;
|
|
28
28
|
email?: string;
|
|
29
|
-
}): Promise<ResolveBatchItemOutcome>;
|
|
29
|
+
}, actor?: string): Promise<ResolveBatchItemOutcome>;
|
|
30
30
|
/**
|
|
31
31
|
* Batch-item fill selecting the row by metadata facet — the highest-priority
|
|
32
32
|
* pending row whose metadata contains the key/value, scoped by `roles`.
|
|
@@ -35,4 +35,4 @@ export declare function resolveBatchItemBySignalKey(signalKey: string, itemKey:
|
|
|
35
35
|
export declare function resolveBatchItemByMetadata(key: string, value: unknown, itemKey: string, payload: Record<string, any>, roles?: string[], metadata?: Record<string, any>, resolvedBy?: {
|
|
36
36
|
id: string;
|
|
37
37
|
email?: string;
|
|
38
|
-
}): Promise<ResolveBatchItemOutcome>;
|
|
38
|
+
}, actor?: string): Promise<ResolveBatchItemOutcome>;
|
|
@@ -11,11 +11,11 @@ const map_1 = require("./map");
|
|
|
11
11
|
/**
|
|
12
12
|
* Fills one declared item of a batch escalation in a single atomic SDK
|
|
13
13
|
* statement (guarded fill + facet recompute + resolve-and-wake on the last
|
|
14
|
-
* item). Interim fills publish `escalation.updated` with progress; the
|
|
14
|
+
* item). `actor` is recorded under `envelope.batch_filled_by[itemKey]`. Interim fills publish `escalation.updated` with progress; the
|
|
15
15
|
* completing fill publishes the standard `escalation.resolved`. Failure
|
|
16
16
|
* outcomes publish nothing — the row was untouched.
|
|
17
17
|
*/
|
|
18
|
-
async function resolveBatchItem(id, itemKey, payload, metadata, assertClaim, resolvedBy) {
|
|
18
|
+
async function resolveBatchItem(id, itemKey, payload, metadata, assertClaim, resolvedBy, actor) {
|
|
19
19
|
if (!(0, uuid_1.isUuid)(id))
|
|
20
20
|
return { outcome: 'not-found', remaining: -1, escalation: null };
|
|
21
21
|
const client = await (0, client_1.escalations)();
|
|
@@ -26,6 +26,7 @@ async function resolveBatchItem(id, itemKey, payload, metadata, assertClaim, res
|
|
|
26
26
|
metadata,
|
|
27
27
|
assertClaim,
|
|
28
28
|
resolvedBy,
|
|
29
|
+
actor,
|
|
29
30
|
});
|
|
30
31
|
return settleBatchOutcome(result, itemKey);
|
|
31
32
|
}
|
|
@@ -35,7 +36,7 @@ async function resolveBatchItem(id, itemKey, payload, metadata, assertClaim, res
|
|
|
35
36
|
* identity (a child calling home, a webhook), skipping both the UUID lookup
|
|
36
37
|
* and any facet duplication. Same event contract as {@link resolveBatchItem}.
|
|
37
38
|
*/
|
|
38
|
-
async function resolveBatchItemBySignalKey(signalKey, itemKey, payload, metadata, resolvedBy) {
|
|
39
|
+
async function resolveBatchItemBySignalKey(signalKey, itemKey, payload, metadata, resolvedBy, actor) {
|
|
39
40
|
const client = await (0, client_1.escalations)();
|
|
40
41
|
const result = await client.resolveBatchItem({
|
|
41
42
|
signalKey,
|
|
@@ -43,6 +44,7 @@ async function resolveBatchItemBySignalKey(signalKey, itemKey, payload, metadata
|
|
|
43
44
|
payload,
|
|
44
45
|
metadata,
|
|
45
46
|
resolvedBy,
|
|
47
|
+
actor,
|
|
46
48
|
});
|
|
47
49
|
return settleBatchOutcome(result, itemKey);
|
|
48
50
|
}
|
|
@@ -51,7 +53,7 @@ async function resolveBatchItemBySignalKey(signalKey, itemKey, payload, metadata
|
|
|
51
53
|
* pending row whose metadata contains the key/value, scoped by `roles`.
|
|
52
54
|
* Same event contract as {@link resolveBatchItem}.
|
|
53
55
|
*/
|
|
54
|
-
async function resolveBatchItemByMetadata(key, value, itemKey, payload, roles, metadata, resolvedBy) {
|
|
56
|
+
async function resolveBatchItemByMetadata(key, value, itemKey, payload, roles, metadata, resolvedBy, actor) {
|
|
55
57
|
const client = await (0, client_1.escalations)();
|
|
56
58
|
const result = await client.resolveBatchItemByMetadata({
|
|
57
59
|
key,
|
|
@@ -61,6 +63,7 @@ async function resolveBatchItemByMetadata(key, value, itemKey, payload, roles, m
|
|
|
61
63
|
payload,
|
|
62
64
|
metadata,
|
|
63
65
|
resolvedBy,
|
|
66
|
+
actor,
|
|
64
67
|
});
|
|
65
68
|
return settleBatchOutcome(result, itemKey);
|
|
66
69
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ClaimResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Claims one named row, the same claim `claimByMetadata` makes on the row it
|
|
4
|
+
* picks: pending, the facet still matches, the role is allowed, and no live
|
|
5
|
+
* claim by someone else. One statement; a miss writes nothing.
|
|
6
|
+
* $1=filter $2=assignee $3=minutes $4=roles $5=metadata patch $6=id
|
|
7
|
+
*/
|
|
8
|
+
export declare const CLAIM_ASSERTED = "WITH target AS MATERIALIZED (\n SELECT id, assigned_to AS prior_assigned_to FROM public.hmsh_escalations\n WHERE id = $6\n AND metadata @> $1::jsonb\n AND ($4::text[] IS NULL OR role = ANY($4::text[]))\n AND status = 'pending'\n AND (assigned_to IS NULL OR assigned_until IS NULL OR assigned_until <= NOW() OR assigned_to = $2)\n FOR UPDATE SKIP LOCKED\n)\nUPDATE public.hmsh_escalations e\nSET assigned_to = $2,\n claimed_at = NOW(),\n claim_expires_at = NOW() + ($3 * INTERVAL '1 minute'),\n assigned_until = NOW() + ($3 * INTERVAL '1 minute'),\n metadata = CASE WHEN $5::jsonb IS NOT NULL\n THEN COALESCE(e.metadata, '{}'::jsonb) || $5::jsonb\n ELSE e.metadata END,\n updated_at = NOW()\nFROM target WHERE e.id = target.id\nRETURNING e.*, target.prior_assigned_to\n";
|
|
9
|
+
/** Claim the row `id` when it still carries `key = value`; null when it does not. */
|
|
10
|
+
export declare function claimAssertedByMetadata(id: string, key: string, value: string, userId: string, durationMinutes?: number, metadata?: Record<string, any>, allowedRoles?: string[] | null): Promise<ClaimResult | null>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CLAIM_ASSERTED = void 0;
|
|
4
|
+
exports.claimAssertedByMetadata = claimAssertedByMetadata;
|
|
5
|
+
const db_1 = require("../../lib/db");
|
|
6
|
+
const escalation_wire_1 = require("../../lib/events/escalation-wire");
|
|
7
|
+
const uuid_1 = require("../../lib/uuid");
|
|
8
|
+
const client_1 = require("./client");
|
|
9
|
+
const crud_1 = require("./crud");
|
|
10
|
+
const map_1 = require("./map");
|
|
11
|
+
/**
|
|
12
|
+
* Claims one named row, the same claim `claimByMetadata` makes on the row it
|
|
13
|
+
* picks: pending, the facet still matches, the role is allowed, and no live
|
|
14
|
+
* claim by someone else. One statement; a miss writes nothing.
|
|
15
|
+
* $1=filter $2=assignee $3=minutes $4=roles $5=metadata patch $6=id
|
|
16
|
+
*/
|
|
17
|
+
exports.CLAIM_ASSERTED = `\
|
|
18
|
+
WITH target AS MATERIALIZED (
|
|
19
|
+
SELECT id, assigned_to AS prior_assigned_to FROM public.hmsh_escalations
|
|
20
|
+
WHERE id = $6
|
|
21
|
+
AND metadata @> $1::jsonb
|
|
22
|
+
AND ($4::text[] IS NULL OR role = ANY($4::text[]))
|
|
23
|
+
AND status = 'pending'
|
|
24
|
+
AND (assigned_to IS NULL OR assigned_until IS NULL OR assigned_until <= NOW() OR assigned_to = $2)
|
|
25
|
+
FOR UPDATE SKIP LOCKED
|
|
26
|
+
)
|
|
27
|
+
UPDATE public.hmsh_escalations e
|
|
28
|
+
SET assigned_to = $2,
|
|
29
|
+
claimed_at = NOW(),
|
|
30
|
+
claim_expires_at = NOW() + ($3 * INTERVAL '1 minute'),
|
|
31
|
+
assigned_until = NOW() + ($3 * INTERVAL '1 minute'),
|
|
32
|
+
metadata = CASE WHEN $5::jsonb IS NOT NULL
|
|
33
|
+
THEN COALESCE(e.metadata, '{}'::jsonb) || $5::jsonb
|
|
34
|
+
ELSE e.metadata END,
|
|
35
|
+
updated_at = NOW()
|
|
36
|
+
FROM target WHERE e.id = target.id
|
|
37
|
+
RETURNING e.*, target.prior_assigned_to
|
|
38
|
+
`;
|
|
39
|
+
/** Claim the row `id` when it still carries `key = value`; null when it does not. */
|
|
40
|
+
async function claimAssertedByMetadata(id, key, value, userId, durationMinutes = 30, metadata, allowedRoles) {
|
|
41
|
+
if (!(0, uuid_1.isUuid)(id))
|
|
42
|
+
return null;
|
|
43
|
+
await (0, client_1.ensureEscalationCompatView)();
|
|
44
|
+
const { rows } = await (0, db_1.getPool)().query(exports.CLAIM_ASSERTED, [
|
|
45
|
+
JSON.stringify({ [key]: value }), userId, durationMinutes,
|
|
46
|
+
allowedRoles ?? null, metadata ? JSON.stringify(metadata) : null, id,
|
|
47
|
+
]);
|
|
48
|
+
if (rows.length === 0)
|
|
49
|
+
return null;
|
|
50
|
+
const { prior_assigned_to: prior, ...entry } = rows[0];
|
|
51
|
+
const escalation = (0, map_1.toEscalationRecord)(entry);
|
|
52
|
+
(0, crud_1.publishEscalationChange)({
|
|
53
|
+
type: 'escalation.claimed',
|
|
54
|
+
source: 'service',
|
|
55
|
+
workflowId: escalation.workflow_id || '',
|
|
56
|
+
workflowName: escalation.workflow_type || '',
|
|
57
|
+
taskQueue: escalation.task_queue || '',
|
|
58
|
+
escalationId: escalation.id,
|
|
59
|
+
role: escalation.role,
|
|
60
|
+
status: 'claimed',
|
|
61
|
+
data: (0, escalation_wire_1.escalationEventData)(escalation),
|
|
62
|
+
});
|
|
63
|
+
return { escalation, isExtension: prior === userId };
|
|
64
|
+
}
|
|
@@ -2,7 +2,9 @@ import type { ClaimedGroup, FacetQuery, GroupSummary, LTEscalationRecord } from
|
|
|
2
2
|
/** Ensure the compat view + the origin_id index exist before the first query. */
|
|
3
3
|
export declare function ensureFacetReady(): Promise<void>;
|
|
4
4
|
/** Item-level faceted search — filter/sort over top-level columns and metadata facets. */
|
|
5
|
-
export declare function searchByFacets(query: FacetQuery
|
|
5
|
+
export declare function searchByFacets(query: FacetQuery, opts?: {
|
|
6
|
+
total?: boolean;
|
|
7
|
+
}): Promise<{
|
|
6
8
|
escalations: LTEscalationRecord[];
|
|
7
9
|
total: number;
|
|
8
10
|
}>;
|
|
@@ -45,7 +45,7 @@ function ensureFacetReady() {
|
|
|
45
45
|
}
|
|
46
46
|
// ── Reads ────────────────────────────────────────────────────────────────────
|
|
47
47
|
/** Item-level faceted search — filter/sort over top-level columns and metadata facets. */
|
|
48
|
-
async function searchByFacets(query) {
|
|
48
|
+
async function searchByFacets(query, opts = {}) {
|
|
49
49
|
await ensureFacetReady();
|
|
50
50
|
const pool = (0, db_1.getPool)();
|
|
51
51
|
const params = [];
|
|
@@ -55,9 +55,13 @@ async function searchByFacets(query) {
|
|
|
55
55
|
const offset = query.offset ?? 0;
|
|
56
56
|
const [rows, count] = await Promise.all([
|
|
57
57
|
pool.query(`SELECT * FROM public.lt_escalations WHERE ${where} ORDER BY ${order} LIMIT $${params.length + 1} OFFSET $${params.length + 2}`, [...params, limit, offset]),
|
|
58
|
-
|
|
58
|
+
// A caller that only picks among a few rows skips the count.
|
|
59
|
+
opts.total === false
|
|
60
|
+
? null
|
|
61
|
+
: pool.query(`SELECT count(*)::int AS total FROM public.lt_escalations WHERE ${where}`, params),
|
|
59
62
|
]);
|
|
60
|
-
|
|
63
|
+
const escalations = (0, map_1.toEscalationRecords)(rows.rows);
|
|
64
|
+
return { escalations, total: count ? count.rows[0]?.total ?? 0 : escalations.length };
|
|
61
65
|
}
|
|
62
66
|
/**
|
|
63
67
|
* Order-level view of the pond — what a batched dispatcher reads to page by
|
|
@@ -14,9 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.AnalyticsInputError = exports.resetAnalyticsCaches = exports.resolveEntitySystem = exports.timelineByFacet = exports.aggregateByFacets = exports.claimByFacets = exports.claimGroups = exports.countByFacets = exports.searchGroups = exports.searchByFacets = exports.ensureFacetReady = exports.ensureEscalationCompatView = void 0;
|
|
17
|
+
exports.AnalyticsInputError = exports.resetAnalyticsCaches = exports.resolveEntitySystem = exports.timelineByFacet = exports.aggregateByFacets = exports.claimByFacets = exports.claimGroups = exports.countByFacets = exports.searchGroups = exports.searchByFacets = exports.ensureFacetReady = exports.ensureEscalationCompatView = exports.claimAssertedByMetadata = void 0;
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
19
|
__exportStar(require("./crud"), exports);
|
|
20
|
+
var claim_asserted_1 = require("./claim-asserted");
|
|
21
|
+
Object.defineProperty(exports, "claimAssertedByMetadata", { enumerable: true, get: function () { return claim_asserted_1.claimAssertedByMetadata; } });
|
|
20
22
|
__exportStar(require("./batch"), exports);
|
|
21
23
|
__exportStar(require("./accumulate"), exports);
|
|
22
24
|
__exportStar(require("./bulk"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EscalationLookupRef } from '../../types/escalation';
|
|
2
2
|
interface KnowledgeSnapshot {
|
|
3
3
|
data: Record<string, unknown>;
|
|
4
4
|
tags: string[];
|
|
@@ -6,24 +6,36 @@ interface KnowledgeSnapshot {
|
|
|
6
6
|
export interface ResolvedLookup {
|
|
7
7
|
domain: string;
|
|
8
8
|
key: string;
|
|
9
|
-
|
|
9
|
+
/** The edition served; null when a current ref found no edition. */
|
|
10
|
+
version: number | null;
|
|
11
|
+
/** The ref follows the newest edition rather than pinning one. */
|
|
12
|
+
current?: true;
|
|
10
13
|
as?: string;
|
|
11
14
|
data: Record<string, unknown> | null;
|
|
12
15
|
missing?: boolean;
|
|
13
16
|
}
|
|
14
17
|
/** The immutable snapshot at (domain, key, version), or null when absent. */
|
|
15
18
|
export declare function getKnowledgeSnapshot(domain: string, key: string, version: number): Promise<KnowledgeSnapshot | null>;
|
|
19
|
+
/**
|
|
20
|
+
* The edition a ref names: its pin, or for a current ref the newest edition
|
|
21
|
+
* (the newest at `asOf` when given, so a closed row reads what was current
|
|
22
|
+
* when it closed). Null when there is none.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveRefEdition(ref: EscalationLookupRef, asOf?: string | null): Promise<{
|
|
25
|
+
version: number;
|
|
26
|
+
snapshot: KnowledgeSnapshot;
|
|
27
|
+
} | null>;
|
|
16
28
|
/**
|
|
17
29
|
* Resolve a metadata `lookups` array into the form-context `lookup` domain:
|
|
18
30
|
* { [as ?? key]: data }. Returns null when there is nothing to resolve, so
|
|
19
31
|
* escalations without refs cost zero SQL. Missing snapshots are omitted —
|
|
20
32
|
* interpolated selects then fail closed rather than render the wrong list.
|
|
21
33
|
*/
|
|
22
|
-
export declare function resolveLookupContext(refs: unknown): Promise<Record<string, unknown> | null>;
|
|
34
|
+
export declare function resolveLookupContext(refs: unknown, asOf?: string | null): Promise<Record<string, unknown> | null>;
|
|
23
35
|
/**
|
|
24
36
|
* Full per-ref resolution for the lookups endpoint: every ref answers, with
|
|
25
37
|
* `missing: true` marking a pin that has no snapshot — fail-visible per ref
|
|
26
38
|
* without failing the batch.
|
|
27
39
|
*/
|
|
28
|
-
export declare function resolveLookupRefs(refs: EscalationLookupRef[]): Promise<ResolvedLookup[]>;
|
|
40
|
+
export declare function resolveLookupRefs(refs: EscalationLookupRef[], asOf?: string | null): Promise<ResolvedLookup[]>;
|
|
29
41
|
export {};
|