@hotmeshio/long-tail 0.22.1 → 0.22.3
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 +38 -19
- 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.js +18 -11
- package/build/api/roles.js +4 -0
- package/build/api/scan-codes/badge-policy.d.ts +10 -0
- package/build/api/scan-codes/badge-policy.js +72 -0
- package/build/api/scan-codes/choice.js +16 -10
- package/build/api/scan-codes/context.d.ts +45 -1
- package/build/api/scan-codes/context.js +51 -3
- package/build/api/scan-codes/execute.js +73 -35
- package/build/api/scan-codes/grant.d.ts +27 -0
- package/build/api/scan-codes/grant.js +67 -0
- package/build/api/scan-codes/hold.d.ts +10 -0
- package/build/api/scan-codes/hold.js +98 -0
- package/build/api/scan-codes/identity.d.ts +5 -2
- package/build/api/scan-codes/identity.js +26 -8
- 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/subject.d.ts +15 -0
- package/build/api/scan-codes/subject.js +68 -0
- package/build/api/scan-codes/verb-accumulate.d.ts +24 -0
- package/build/api/scan-codes/verb-accumulate.js +151 -0
- package/build/api/scan-codes/verb-fill.d.ts +6 -0
- package/build/api/scan-codes/verb-fill.js +155 -0
- 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 +33 -0
- package/build/api/scan-codes/verbs-subject.js +247 -0
- package/build/api/scan-codes/verbs.d.ts +11 -29
- package/build/api/scan-codes/verbs.js +51 -131
- package/build/index.d.ts +1 -0
- package/build/index.js +9 -2
- package/build/lib/db/schemas/037_scan_gtin_and_subject_grants.sql +27 -0
- package/build/routes/escalations/acting.d.ts +5 -0
- package/build/routes/escalations/acting.js +8 -1
- package/build/routes/scan-codes.js +3 -0
- package/build/sdk/index.d.ts +1 -0
- 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/iam/acting-identity.d.ts +29 -4
- package/build/services/iam/acting-identity.js +60 -17
- package/build/services/iam/ephemeral.d.ts +21 -0
- package/build/services/iam/ephemeral.js +32 -1
- package/build/services/iam/sql.d.ts +10 -0
- package/build/services/iam/sql.js +32 -3
- 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 +13 -10
- package/build/services/orchestrator/condition.js +8 -6
- package/build/services/role/badge-grant.d.ts +5 -0
- package/build/services/role/badge-grant.js +36 -0
- package/build/services/role/seed.js +5 -0
- package/build/services/role/types.d.ts +14 -0
- package/build/services/role/types.js +5 -0
- package/build/services/scan-code/index.d.ts +3 -2
- package/build/services/scan-code/index.js +8 -1
- package/build/services/scan-code/parse.d.ts +23 -20
- package/build/services/scan-code/parse.js +45 -90
- package/build/services/scan-code/read.js +1 -0
- package/build/services/scan-code/sql.d.ts +3 -3
- package/build/services/scan-code/sql.js +11 -8
- 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.d.ts +7 -0
- package/build/services/scan-code/validate-subject.js +185 -0
- package/build/services/scan-code/validate.d.ts +7 -0
- package/build/services/scan-code/validate.js +103 -18
- package/build/services/scan-code/write.d.ts +1 -0
- package/build/services/scan-code/write.js +9 -3
- package/build/shared/form-validation/field-validator.js +4 -0
- package/build/shared/form-validation/index.d.ts +1 -0
- package/build/shared/form-validation/index.js +1 -0
- package/build/shared/form-validation/x-lt-scan.d.ts +52 -0
- package/build/shared/form-validation/x-lt-scan.js +166 -0
- package/build/shared/scan-code/gtin.d.ts +11 -0
- package/build/shared/scan-code/gtin.js +38 -0
- package/build/shared/scan-code/index.d.ts +2 -0
- package/build/shared/scan-code/index.js +11 -0
- package/build/shared/scan-code/parse.d.ts +46 -0
- package/build/shared/scan-code/parse.js +133 -0
- package/build/system/mcp-servers/admin/scan-codes.js +10 -4
- package/build/system/mcp-servers/admin/schemas.d.ts +939 -28
- package/build/system/mcp-servers/admin/schemas.js +72 -6
- package/build/system/mcp-servers/human-queue-schemas.d.ts +6 -6
- 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 +16 -8
- package/build/types/escalation.js +18 -7
- package/build/types/index.d.ts +4 -4
- package/build/types/index.js +10 -1
- package/build/types/scan-code/constants.d.ts +182 -0
- package/build/types/{scan-code.js → scan-code/constants.js} +72 -11
- package/build/types/scan-code/index.d.ts +3 -0
- package/build/types/scan-code/index.js +17 -0
- package/build/types/scan-code/response.d.ts +145 -0
- package/build/types/scan-code/response.js +2 -0
- package/build/types/scan-code/rule.d.ts +229 -0
- package/build/types/scan-code/rule.js +2 -0
- package/build/types/startup.d.ts +3 -1
- package/dashboard/dist/assets/{AdminDashboard-BbWve-Ax.js → AdminDashboard-hI5-kKpL.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-BbWve-Ax.js.map → AdminDashboard-hI5-kKpL.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-M-9eTKhP.js → AgentConfigPage-DetU4HZe.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-M-9eTKhP.js.map → AgentConfigPage-DetU4HZe.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-CsakSlx5.js → AgentDetailPage-DrGXo8KQ.js} +3 -3
- package/dashboard/dist/assets/{AgentDetailPage-CsakSlx5.js.map → AgentDetailPage-DrGXo8KQ.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-Cj_cRTT1.js → AgentsPage-D4md5BzM.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-Cj_cRTT1.js.map → AgentsPage-D4md5BzM.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-BXJmMBM1.js → AvailableEscalationsPage-B2bS2ZJy.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-BXJmMBM1.js.map → AvailableEscalationsPage-B2bS2ZJy.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-CGB16rYU.js → BotPicker-BXtey255.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-CGB16rYU.js.map → BotPicker-BXtey255.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-MjxcU7N1.js → BulkAssignModal-CSL_PeZv.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-MjxcU7N1.js.map → BulkAssignModal-CSL_PeZv.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-5scufTHW.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-BxadotXn.js.map → CapabilitiesPage-5scufTHW.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-BBNpP-6h.js → CollapsibleSection-DjjDGxP_.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-BBNpP-6h.js.map → CollapsibleSection-DjjDGxP_.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-D_kAbT_D.js → ConfirmDeleteModal-DJSmsHQM.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-D_kAbT_D.js.map → ConfirmDeleteModal-DJSmsHQM.js.map} +1 -1
- package/dashboard/dist/assets/CountdownTimer-C5ZRYPfF.js +2 -0
- package/dashboard/dist/assets/{CountdownTimer-CI_JOAvk.js.map → CountdownTimer-C5ZRYPfF.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-C9OA1Q2J.js → CredentialsPage-CV6e60yC.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-C9OA1Q2J.js.map → CredentialsPage-CV6e60yC.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-sxLLBf2I.js → CronLabel-CnqhqW0B.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-sxLLBf2I.js.map → CronLabel-CnqhqW0B.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-jH9m8Dgl.js → ElapsedCell-C1IOn-tj.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-jH9m8Dgl.js.map → ElapsedCell-C1IOn-tj.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-Dl3Nr2kk.js → EntityTimelinePanel-Dz6Liig4.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-Dl3Nr2kk.js.map → EntityTimelinePanel-Dz6Liig4.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-DAK6It5J.js → EscalationListSchemaPage-bgdmLmrh.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-DAK6It5J.js.map → EscalationListSchemaPage-bgdmLmrh.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListView-CAHbdxKR.js → EscalationListView-CrlD3ZGt.js} +2 -2
- package/dashboard/dist/assets/{EscalationListView-CAHbdxKR.js.map → EscalationListView-CrlD3ZGt.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-DotfAMCL.js → EscalationSchemaPage-dxXO_T3t.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-DotfAMCL.js.map → EscalationSchemaPage-dxXO_T3t.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTimeline-DqmFydnU.js → EscalationTimeline-C3WQZQuM.js} +2 -2
- package/dashboard/dist/assets/{EscalationTimeline-DqmFydnU.js.map → EscalationTimeline-C3WQZQuM.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTitleSelect-BpRquguO.js → EscalationTitleSelect-CTtcETUO.js} +2 -2
- package/dashboard/dist/assets/{EscalationTitleSelect-BpRquguO.js.map → EscalationTitleSelect-CTtcETUO.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DtGOqnP4.js → EscalationsOverview-DAjZ7JY2.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DtGOqnP4.js.map → EscalationsOverview-DAjZ7JY2.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-DSHqKyX2.js → EventTable-B72DQP_v.js} +2 -2
- package/dashboard/dist/assets/{EventTable-DSHqKyX2.js.map → EventTable-B72DQP_v.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-Dxd0wNSW.js → FilterBar-CCTaA_LH.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-Dxd0wNSW.js.map → FilterBar-CCTaA_LH.js.map} +1 -1
- package/dashboard/dist/assets/GrantScopeField-BzWGzBfA.js +2 -0
- package/dashboard/dist/assets/GrantScopeField-BzWGzBfA.js.map +1 -0
- package/dashboard/dist/assets/{GraphInvokePage-ChqqGkro.js → GraphInvokePage-CAsCgFo3.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-ChqqGkro.js.map → GraphInvokePage-CAsCgFo3.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-ByKesG8w.js → HomePage-DseE_iSr.js} +2 -2
- package/dashboard/dist/assets/{HomePage-ByKesG8w.js.map → HomePage-DseE_iSr.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-Ddz_S2av.js → ListToolbar-1zdqnjW6.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-Ddz_S2av.js.map → ListToolbar-1zdqnjW6.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-CVe13tEv.js → McpOverview-DS_JXDW5.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-CVe13tEv.js.map → McpOverview-DS_JXDW5.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-BQYF2Mjq.js → McpQueryDetailPage-BeMUGcv3.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-BQYF2Mjq.js.map → McpQueryDetailPage-BeMUGcv3.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-DZi5lm7s.js → McpQueryPage-CeiLO_LR.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-DZi5lm7s.js.map → McpQueryPage-CeiLO_LR.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-DreARTE1.js → McpRunDetailPage-DYp1uZK2.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-DreARTE1.js.map → McpRunDetailPage-DYp1uZK2.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-DmO0YVhT.js → McpRunsPage-VeaDzcL4.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-DmO0YVhT.js.map → McpRunsPage-VeaDzcL4.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-DpjCO85T.js → OperationsPage-DK2mgaXf.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-DpjCO85T.js.map → OperationsPage-DK2mgaXf.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-Vv_MEBkv.js → OperatorDashboard-BNjLF0f7.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-Vv_MEBkv.js.map → OperatorDashboard-BNjLF0f7.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-CW-2uBHY.js → PersonaDetailPage-IQ2fZLa6.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-CW-2uBHY.js.map → PersonaDetailPage-IQ2fZLa6.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-CO6yYQdm.js → PersonasPage-DpGFEcU-.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-CO6yYQdm.js.map → PersonasPage-DpGFEcU-.js.map} +1 -1
- package/dashboard/dist/assets/{PortalPage-DcNqhBlg.js → PortalPage-D07xyvG_.js} +2 -2
- package/dashboard/dist/assets/{PortalPage-DcNqhBlg.js.map → PortalPage-D07xyvG_.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-BuipGZcC.js → ProcessDetailPage-t8EEYSMk.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-BuipGZcC.js.map → ProcessDetailPage-t8EEYSMk.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-D9DYntvl.js → ProcessesListPage-BDUXLFdb.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-D9DYntvl.js.map → ProcessesListPage-BDUXLFdb.js.map} +1 -1
- package/dashboard/dist/assets/ResolverForm-BwWOYv_Z.js +8 -0
- package/dashboard/dist/assets/ResolverForm-BwWOYv_Z.js.map +1 -0
- package/dashboard/dist/assets/RoleDetailPage-zMF3x2xi.js +8 -0
- package/dashboard/dist/assets/RoleDetailPage-zMF3x2xi.js.map +1 -0
- package/dashboard/dist/assets/{RolesPage-0QJOBSzF.js → RolesPage-CEBp_PpL.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-0QJOBSzF.js.map → RolesPage-CEBp_PpL.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-Dh4lyyRo.js → RunAsSelector-CC_EHN3z.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-Dh4lyyRo.js.map → RunAsSelector-CC_EHN3z.js.map} +1 -1
- package/dashboard/dist/assets/ScanCodesPage-DD4uU-jY.js +2 -0
- package/dashboard/dist/assets/ScanCodesPage-DD4uU-jY.js.map +1 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-CUW8gYFh.js +2 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-CUW8gYFh.js.map +1 -0
- package/dashboard/dist/assets/ScanStationPage-DpO_ESuf.js +2 -0
- package/dashboard/dist/assets/ScanStationPage-DpO_ESuf.js.map +1 -0
- package/dashboard/dist/assets/{StickyPagination-BSUyf5ja.js → StickyPagination-cNqSDm5f.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-BSUyf5ja.js.map → StickyPagination-cNqSDm5f.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail--tp7l2Sd.js → StreamMessageDetail-C4oZqQdB.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail--tp7l2Sd.js.map → StreamMessageDetail-C4oZqQdB.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-CxBZ2THh.js → SwimlaneTimeline-BjBiV7GT.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-CxBZ2THh.js.map → SwimlaneTimeline-BjBiV7GT.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-BJ1QrmPH.js → TaskDetailPage-pO_AnVS1.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-BJ1QrmPH.js.map → TaskDetailPage-pO_AnVS1.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-5BydGWmt.js → TasksListPage-DKDHlWP7.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-5BydGWmt.js.map → TasksListPage-DKDHlWP7.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-CCnz84Y4.js → TimeAgo-D2qchUuJ.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-CCnz84Y4.js.map → TimeAgo-D2qchUuJ.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-D0ru7Lya.js → TimestampCell-DeswZGGo.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-D0ru7Lya.js.map → TimestampCell-DeswZGGo.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-3Kpofmen.js → ToolTestPanel-DJh7PIUa.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-3Kpofmen.js.map → ToolTestPanel-DJh7PIUa.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-BaBXD_AK.js → TopicDetailPage-CsgDJ4Z4.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-BaBXD_AK.js.map → TopicDetailPage-CsgDJ4Z4.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-Cnm1AAjh.js → TopicsPage-tBRZDVDN.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-Cnm1AAjh.js.map → TopicsPage-tBRZDVDN.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-CXsdPiMZ.js → UserName-B-5JcDck.js} +2 -2
- package/dashboard/dist/assets/{UserName-CXsdPiMZ.js.map → UserName-B-5JcDck.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-zx3AUJFd.js → WorkflowExecutionPage-BPHVnhp6.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-zx3AUJFd.js.map → WorkflowExecutionPage-BPHVnhp6.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-DfAGK1l7.js → WorkflowsDashboard-CxLlfZmY.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DfAGK1l7.js.map → WorkflowsDashboard-CxLlfZmY.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-QIYvoa13.js → WorkflowsOverview-C4az5rwp.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-QIYvoa13.js.map → WorkflowsOverview-C4az5rwp.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DGgO3hyB.js → YamlWorkflowDetailPage-BmhlAUFQ.js} +8 -8
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DGgO3hyB.js.map → YamlWorkflowDetailPage-BmhlAUFQ.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-CEsHm0B9.js → YamlWorkflowsPage-CSbG5o2V.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-CEsHm0B9.js.map → YamlWorkflowsPage-CSbG5o2V.js.map} +1 -1
- package/dashboard/dist/assets/{agents-v_HH3Rji.js → agents-BohEn7vw.js} +2 -2
- package/dashboard/dist/assets/{agents-v_HH3Rji.js.map → agents-BohEn7vw.js.map} +1 -1
- package/dashboard/dist/assets/{bots-bwvWYrXz.js → bots-BG2EO-Wi.js} +2 -2
- package/dashboard/dist/assets/{bots-bwvWYrXz.js.map → bots-BG2EO-Wi.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-D4vaw_nQ.js → capabilities-CeFrBmYX.js} +2 -2
- package/dashboard/dist/assets/{capabilities-D4vaw_nQ.js.map → capabilities-CeFrBmYX.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-CiiZ6LJF.js → controlplane-Dhvt8l8F.js} +2 -2
- package/dashboard/dist/assets/{controlplane-CiiZ6LJF.js.map → controlplane-Dhvt8l8F.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-Dv-MB3eC.js → escalation-columns-BWMNxImp.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-Dv-MB3eC.js.map → escalation-columns-BWMNxImp.js.map} +1 -1
- package/dashboard/dist/assets/{index-CzjUgFt_.js → index-Bd_dgyfJ.js} +2 -2
- package/dashboard/dist/assets/{index-CzjUgFt_.js.map → index-Bd_dgyfJ.js.map} +1 -1
- package/dashboard/dist/assets/{index-IJmtbuLh.js → index-C8VlM2Oe.js} +2 -2
- package/dashboard/dist/assets/{index-IJmtbuLh.js.map → index-C8VlM2Oe.js.map} +1 -1
- package/dashboard/dist/assets/{index-CcuvGdvf.js → index-CiqSVDga.js} +2 -2
- package/dashboard/dist/assets/{index-CcuvGdvf.js.map → index-CiqSVDga.js.map} +1 -1
- package/dashboard/dist/assets/{index-C3WutFpT.js → index-Cl_YXEdp.js} +2 -2
- package/dashboard/dist/assets/{index-C3WutFpT.js.map → index-Cl_YXEdp.js.map} +1 -1
- package/dashboard/dist/assets/index-CtZWpy22.js +2 -0
- package/dashboard/dist/assets/index-CtZWpy22.js.map +1 -0
- package/dashboard/dist/assets/{index-CjenRVX_.js → index-D90D9y0J.js} +2 -2
- package/dashboard/dist/assets/{index-CjenRVX_.js.map → index-D90D9y0J.js.map} +1 -1
- package/dashboard/dist/assets/{index-BLB77tc8.js → index-DABkM7s-.js} +2 -2
- package/dashboard/dist/assets/{index-BLB77tc8.js.map → index-DABkM7s-.js.map} +1 -1
- package/dashboard/dist/assets/index-Dbwu51xm.js +3 -0
- package/dashboard/dist/assets/index-Dbwu51xm.js.map +1 -0
- package/dashboard/dist/assets/{index-2tzsxFat.js → index-Dc3Om6G3.js} +2 -2
- package/dashboard/dist/assets/{index-2tzsxFat.js.map → index-Dc3Om6G3.js.map} +1 -1
- package/dashboard/dist/assets/{index-D2VKBMng.js → index-Dc_zWK23.js} +2 -2
- package/dashboard/dist/assets/{index-D2VKBMng.js.map → index-Dc_zWK23.js.map} +1 -1
- package/dashboard/dist/assets/index-DcppjzP5.css +1 -0
- package/dashboard/dist/assets/{index-C_ISDOWJ.js → index-Y-bdW8vo.js} +2 -2
- package/dashboard/dist/assets/{index-C_ISDOWJ.js.map → index-Y-bdW8vo.js.map} +1 -1
- package/dashboard/dist/assets/{index-C4Lce2ET.js → index-dYKgd06u.js} +3 -3
- package/dashboard/dist/assets/{index-C4Lce2ET.js.map → index-dYKgd06u.js.map} +1 -1
- package/dashboard/dist/assets/index-fUsx_gYx.js +67 -0
- package/dashboard/dist/assets/index-fUsx_gYx.js.map +1 -0
- package/dashboard/dist/assets/{knowledge-D1YP2NzS.js → knowledge-CCcTidNV.js} +2 -2
- package/dashboard/dist/assets/{knowledge-D1YP2NzS.js.map → knowledge-CCcTidNV.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-Bb5psC61.js → mcp-CLA1z7Pg.js} +2 -2
- package/dashboard/dist/assets/{mcp-Bb5psC61.js.map → mcp-CLA1z7Pg.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-D5jUdZwN.js → mcp-query-CWG0WMAs.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-D5jUdZwN.js.map → mcp-query-CWG0WMAs.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-CDndbkp4.js → personas-8jURIzx6.js} +2 -2
- package/dashboard/dist/assets/{personas-CDndbkp4.js.map → personas-8jURIzx6.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-Dq3kNhKu.js → pipelines-hVVRAXqG.js} +2 -2
- package/dashboard/dist/assets/{pipelines-Dq3kNhKu.js.map → pipelines-hVVRAXqG.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-BlpDsWCy.js → tasks-BE1O57Bf.js} +2 -2
- package/dashboard/dist/assets/{tasks-BlpDsWCy.js.map → tasks-BE1O57Bf.js.map} +1 -1
- package/dashboard/dist/assets/{topics-C0YaR9fu.js → topics-Bg96Wp1r.js} +2 -2
- package/dashboard/dist/assets/{topics-C0YaR9fu.js.map → topics-Bg96Wp1r.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-B-KC5ba3.js → useDebouncedValue-DmEveyEy.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-B-KC5ba3.js.map → useDebouncedValue-DmEveyEy.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-Dkr5g2Ac.js → useNamespace-DHgkzIuL.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-Dkr5g2Ac.js.map → useNamespace-DHgkzIuL.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-BANBOshA.js → useYamlActivityEvents-RU0PvU8S.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-BANBOshA.js.map → useYamlActivityEvents-RU0PvU8S.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-BLYoJfmB.js → yaml-workflows-DQWE9ijc.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-BLYoJfmB.js.map → yaml-workflows-DQWE9ijc.js.map} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/docs/dashboard.md +1 -1
- package/docs/hitl/lookups.md +27 -18
- package/docs/hitl/x-lt-scan.md +51 -0
- package/docs/hitl/x-lt-validation.md +1 -1
- package/docs/hitl/x-lt-widget.md +1 -1
- package/docs/hitl-guide.md +3 -1
- package/docs/scan-codes.md +303 -33
- package/package.json +1 -1
- package/build/types/scan-code.d.ts +0 -317
- package/dashboard/dist/assets/CapabilitiesPage-BxadotXn.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-CI_JOAvk.js +0 -2
- package/dashboard/dist/assets/ResolverForm-BVG8X0sS.js +0 -8
- package/dashboard/dist/assets/ResolverForm-BVG8X0sS.js.map +0 -1
- package/dashboard/dist/assets/RoleDetailPage-KCXDqoJz.js +0 -8
- package/dashboard/dist/assets/RoleDetailPage-KCXDqoJz.js.map +0 -1
- package/dashboard/dist/assets/ScanCodesPage-CUhCz-Yr.js +0 -2
- package/dashboard/dist/assets/ScanCodesPage-CUhCz-Yr.js.map +0 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-qzXKNqJK.js +0 -2
- package/dashboard/dist/assets/ScanSchemeDetailPage-qzXKNqJK.js.map +0 -1
- package/dashboard/dist/assets/ScanStationPage-D8e8cG3t.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-D8e8cG3t.js.map +0 -1
- package/dashboard/dist/assets/index-CT-FN6CW.js +0 -3
- package/dashboard/dist/assets/index-CT-FN6CW.js.map +0 -1
- package/dashboard/dist/assets/index-D6pBLZFu.js +0 -2
- package/dashboard/dist/assets/index-D6pBLZFu.js.map +0 -1
- package/dashboard/dist/assets/index-Dh8MJl3L.css +0 -1
- package/dashboard/dist/assets/index-N71QQ3J5.js +0 -67
- package/dashboard/dist/assets/index-N71QQ3J5.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
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getKnowledgeSnapshot = getKnowledgeSnapshot;
|
|
4
|
+
exports.resolveRefEdition = resolveRefEdition;
|
|
4
5
|
exports.resolveLookupContext = resolveLookupContext;
|
|
5
6
|
exports.resolveLookupRefs = resolveLookupRefs;
|
|
6
7
|
/**
|
|
7
8
|
* Lookup snapshot cache — keeps escalation lookup resolution off the SQL hot
|
|
8
|
-
* path.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* the
|
|
12
|
-
* republish must become visible.
|
|
9
|
+
* path. An edition {domain, key, version} is immutable, so snapshots cache
|
|
10
|
+
* indefinitely under an LRU bound. A pinned ref resolves from memory after
|
|
11
|
+
* the first read; a current ref costs one indexed read to learn which
|
|
12
|
+
* edition is newest, then shares the same cache. Missing snapshots are never
|
|
13
|
+
* cached — a later seed or republish must become visible.
|
|
13
14
|
*/
|
|
14
15
|
const db_1 = require("../../lib/db");
|
|
16
|
+
const escalation_1 = require("../../types/escalation");
|
|
15
17
|
const sql_1 = require("./sql");
|
|
16
18
|
const SNAPSHOT_CACHE_MAX_ENTRIES = 256;
|
|
17
19
|
// Map preserves insertion order — delete+set on read keeps it LRU.
|
|
18
20
|
const snapshotCache = new Map();
|
|
21
|
+
function remember(cacheKey, snapshot) {
|
|
22
|
+
snapshotCache.set(cacheKey, snapshot);
|
|
23
|
+
while (snapshotCache.size > SNAPSHOT_CACHE_MAX_ENTRIES) {
|
|
24
|
+
const oldest = snapshotCache.keys().next().value;
|
|
25
|
+
snapshotCache.delete(oldest);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
19
28
|
/** The immutable snapshot at (domain, key, version), or null when absent. */
|
|
20
29
|
async function getKnowledgeSnapshot(domain, key, version) {
|
|
21
30
|
const cacheKey = `${domain} ${key} ${version}`;
|
|
@@ -33,13 +42,35 @@ async function getKnowledgeSnapshot(domain, key, version) {
|
|
|
33
42
|
data: rows[0].data ?? {},
|
|
34
43
|
tags: rows[0].tags ?? [],
|
|
35
44
|
};
|
|
36
|
-
|
|
37
|
-
while (snapshotCache.size > SNAPSHOT_CACHE_MAX_ENTRIES) {
|
|
38
|
-
const oldest = snapshotCache.keys().next().value;
|
|
39
|
-
snapshotCache.delete(oldest);
|
|
40
|
-
}
|
|
45
|
+
remember(cacheKey, snapshot);
|
|
41
46
|
return snapshot;
|
|
42
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The edition a ref names: its pin, or for a current ref the newest edition
|
|
50
|
+
* (the newest at `asOf` when given, so a closed row reads what was current
|
|
51
|
+
* when it closed). Null when there is none.
|
|
52
|
+
*/
|
|
53
|
+
async function resolveRefEdition(ref, asOf) {
|
|
54
|
+
if (!(0, escalation_1.isCurrentLookupRef)(ref)) {
|
|
55
|
+
const version = ref.version;
|
|
56
|
+
const snapshot = await getKnowledgeSnapshot(ref.domain, ref.key, version);
|
|
57
|
+
return snapshot ? { version, snapshot } : null;
|
|
58
|
+
}
|
|
59
|
+
const { rows } = await (0, db_1.getPool)().query(sql_1.GET_LATEST_KNOWLEDGE_VERSION, [ref.domain, ref.key, asOf ?? null]);
|
|
60
|
+
if (!rows[0])
|
|
61
|
+
return null;
|
|
62
|
+
const version = Number(rows[0].version);
|
|
63
|
+
const cacheKey = `${ref.domain} ${ref.key} ${version}`;
|
|
64
|
+
const cached = snapshotCache.get(cacheKey);
|
|
65
|
+
if (cached)
|
|
66
|
+
return { version, snapshot: cached };
|
|
67
|
+
const snapshot = {
|
|
68
|
+
data: rows[0].data ?? {},
|
|
69
|
+
tags: rows[0].tags ?? [],
|
|
70
|
+
};
|
|
71
|
+
remember(cacheKey, snapshot);
|
|
72
|
+
return { version, snapshot };
|
|
73
|
+
}
|
|
43
74
|
/** Structural check for one ref — malformed entries in stored metadata are skipped, not fatal. */
|
|
44
75
|
function isLookupRef(ref) {
|
|
45
76
|
if (!ref || typeof ref !== 'object')
|
|
@@ -47,7 +78,7 @@ function isLookupRef(ref) {
|
|
|
47
78
|
const r = ref;
|
|
48
79
|
return typeof r.domain === 'string' && r.domain.length > 0
|
|
49
80
|
&& typeof r.key === 'string' && r.key.length > 0
|
|
50
|
-
&& typeof r.version === 'number' && Number.isInteger(r.version) && r.version >= 1
|
|
81
|
+
&& ((0, escalation_1.isCurrentLookupRef)(r) || (typeof r.version === 'number' && Number.isInteger(r.version) && r.version >= 1))
|
|
51
82
|
&& (r.as === undefined || (typeof r.as === 'string' && r.as.length > 0));
|
|
52
83
|
}
|
|
53
84
|
/**
|
|
@@ -56,7 +87,7 @@ function isLookupRef(ref) {
|
|
|
56
87
|
* escalations without refs cost zero SQL. Missing snapshots are omitted —
|
|
57
88
|
* interpolated selects then fail closed rather than render the wrong list.
|
|
58
89
|
*/
|
|
59
|
-
async function resolveLookupContext(refs) {
|
|
90
|
+
async function resolveLookupContext(refs, asOf) {
|
|
60
91
|
if (!Array.isArray(refs) || refs.length === 0)
|
|
61
92
|
return null;
|
|
62
93
|
const valid = refs.filter(isLookupRef);
|
|
@@ -64,9 +95,9 @@ async function resolveLookupContext(refs) {
|
|
|
64
95
|
return null;
|
|
65
96
|
const ctx = {};
|
|
66
97
|
for (const ref of valid) {
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
ctx[ref.as ?? ref.key] = snapshot.data;
|
|
98
|
+
const edition = await resolveRefEdition(ref, asOf);
|
|
99
|
+
if (edition)
|
|
100
|
+
ctx[ref.as ?? ref.key] = edition.snapshot.data;
|
|
70
101
|
}
|
|
71
102
|
return ctx;
|
|
72
103
|
}
|
|
@@ -75,19 +106,21 @@ async function resolveLookupContext(refs) {
|
|
|
75
106
|
* `missing: true` marking a pin that has no snapshot — fail-visible per ref
|
|
76
107
|
* without failing the batch.
|
|
77
108
|
*/
|
|
78
|
-
async function resolveLookupRefs(refs) {
|
|
109
|
+
async function resolveLookupRefs(refs, asOf) {
|
|
79
110
|
const resolved = [];
|
|
80
111
|
for (const ref of refs) {
|
|
81
112
|
if (!isLookupRef(ref))
|
|
82
113
|
continue;
|
|
83
|
-
const
|
|
114
|
+
const current = (0, escalation_1.isCurrentLookupRef)(ref);
|
|
115
|
+
const edition = await resolveRefEdition(ref, asOf);
|
|
84
116
|
resolved.push({
|
|
85
117
|
domain: ref.domain,
|
|
86
118
|
key: ref.key,
|
|
87
|
-
version: ref.version,
|
|
119
|
+
version: edition?.version ?? (current ? null : ref.version),
|
|
120
|
+
...(current ? { current: true } : {}),
|
|
88
121
|
...(ref.as ? { as: ref.as } : {}),
|
|
89
|
-
data:
|
|
90
|
-
...(
|
|
122
|
+
data: edition ? edition.snapshot.data : null,
|
|
123
|
+
...(edition ? {} : { missing: true }),
|
|
91
124
|
});
|
|
92
125
|
}
|
|
93
126
|
return resolved;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EscalationLookupRef } from '../../types/escalation';
|
|
2
2
|
/**
|
|
3
|
-
* One message per ref
|
|
3
|
+
* One message per ref with no edition behind it (a pin that does not exist,
|
|
4
|
+
* or a current ref to an entry with no editions), naming what does.
|
|
4
5
|
* Shape is the caller's job (assertLookupRefs); this answers the second
|
|
5
6
|
* question a saver has: is there an edition behind the pin.
|
|
6
7
|
*/
|
|
@@ -2,25 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.describeMissingLookupRefs = describeMissingLookupRefs;
|
|
4
4
|
const db_1 = require("../../lib/db");
|
|
5
|
+
const escalation_1 = require("../../types/escalation");
|
|
5
6
|
const lookup_cache_1 = require("./lookup-cache");
|
|
6
7
|
const sql_1 = require("./sql");
|
|
7
8
|
/**
|
|
8
|
-
* One message per ref
|
|
9
|
+
* One message per ref with no edition behind it (a pin that does not exist,
|
|
10
|
+
* or a current ref to an entry with no editions), naming what does.
|
|
9
11
|
* Shape is the caller's job (assertLookupRefs); this answers the second
|
|
10
12
|
* question a saver has: is there an edition behind the pin.
|
|
11
13
|
*/
|
|
12
14
|
async function describeMissingLookupRefs(refs) {
|
|
13
15
|
const problems = [];
|
|
14
16
|
for (const ref of refs) {
|
|
15
|
-
|
|
16
|
-
if (snapshot)
|
|
17
|
+
if (await (0, lookup_cache_1.resolveRefEdition)(ref))
|
|
17
18
|
continue;
|
|
18
19
|
const { rows } = await (0, db_1.getPool)().query(sql_1.LIST_KNOWLEDGE_VERSIONS, [ref.domain, ref.key]);
|
|
19
20
|
const versions = rows.map((r) => Number(r.version)).sort((a, b) => a - b);
|
|
20
21
|
const where = versions.length
|
|
21
22
|
? `editions: ${versions.map((v) => `v${v}`).join(', ')}`
|
|
22
23
|
: `no knowledge entry ${ref.domain}/${ref.key}`;
|
|
23
|
-
|
|
24
|
+
const named = (0, escalation_1.isCurrentLookupRef)(ref) ? 'current' : `v${ref.version}`;
|
|
25
|
+
problems.push(`Lookup ref ${ref.domain}/${ref.key} ${named} names no edition (${where})`);
|
|
24
26
|
}
|
|
25
27
|
return problems;
|
|
26
28
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare const GET_KNOWLEDGE_VERSION = "\n SELECT domain, key, version, data, tags, change_summary, created_at\n FROM lt_knowledge_versions\n WHERE domain = $1 AND key = $2 AND version = $3";
|
|
2
2
|
export declare const LIST_KNOWLEDGE_VERSIONS = "\n SELECT v.version, v.change_summary, v.created_at,\n (v.version = k.current_version) AS is_current\n FROM lt_knowledge_versions v\n JOIN lt_knowledge k ON k.domain = v.domain AND k.key = v.key\n WHERE v.domain = $1 AND v.key = $2\n ORDER BY v.version DESC";
|
|
3
|
+
/** The newest edition, or the newest created at or before $3 when it is set. */
|
|
4
|
+
export declare const GET_LATEST_KNOWLEDGE_VERSION = "\n SELECT version, data, tags\n FROM lt_knowledge_versions\n WHERE domain = $1 AND key = $2\n AND ($3::timestamptz IS NULL OR created_at <= $3)\n ORDER BY version DESC\n LIMIT 1";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LIST_KNOWLEDGE_VERSIONS = exports.GET_KNOWLEDGE_VERSION = void 0;
|
|
3
|
+
exports.GET_LATEST_KNOWLEDGE_VERSION = exports.LIST_KNOWLEDGE_VERSIONS = exports.GET_KNOWLEDGE_VERSION = void 0;
|
|
4
4
|
exports.GET_KNOWLEDGE_VERSION = `
|
|
5
5
|
SELECT domain, key, version, data, tags, change_summary, created_at
|
|
6
6
|
FROM lt_knowledge_versions
|
|
@@ -12,3 +12,11 @@ exports.LIST_KNOWLEDGE_VERSIONS = `
|
|
|
12
12
|
JOIN lt_knowledge k ON k.domain = v.domain AND k.key = v.key
|
|
13
13
|
WHERE v.domain = $1 AND v.key = $2
|
|
14
14
|
ORDER BY v.version DESC`;
|
|
15
|
+
/** The newest edition, or the newest created at or before $3 when it is set. */
|
|
16
|
+
exports.GET_LATEST_KNOWLEDGE_VERSION = `
|
|
17
|
+
SELECT version, data, tags
|
|
18
|
+
FROM lt_knowledge_versions
|
|
19
|
+
WHERE domain = $1 AND key = $2
|
|
20
|
+
AND ($3::timestamptz IS NULL OR created_at <= $3)
|
|
21
|
+
ORDER BY version DESC
|
|
22
|
+
LIMIT 1`;
|
|
@@ -175,7 +175,7 @@ function registerHumanQueueTools(server) {
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
const refs = (0, lookups_1.readLookupRefs)(escalation.envelope);
|
|
178
|
-
const lookups = refs.length > 0 ? await (0, knowledge_1.resolveLookupRefs)(refs) : [];
|
|
178
|
+
const lookups = refs.length > 0 ? await (0, knowledge_1.resolveLookupRefs)(refs, (0, lookups_1.lookupAsOf)(escalation)) : [];
|
|
179
179
|
return {
|
|
180
180
|
content: [{
|
|
181
181
|
type: 'text',
|
|
@@ -2,10 +2,11 @@ import type { Types } from '@hotmeshio/hotmesh';
|
|
|
2
2
|
import { type AccumulateConfig, type AccumulatorResult, type EscalationLookupRef } from '../../types/escalation';
|
|
3
3
|
/**
|
|
4
4
|
* HotMesh's escalation config plus long-tail sugar. `schemaVersion` pins the
|
|
5
|
-
* role form version (lt_role_schemas) the resolve UI renders; `lookups`
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* workflow author sets, folded before the config
|
|
5
|
+
* role form version (lt_role_schemas) the resolve UI renders; `lookups` names
|
|
6
|
+
* the knowledge entries the form may read (the `lookup.*` context domain, see
|
|
7
|
+
* docs/hitl/lookups.md), each pinned to an edition or following the current
|
|
8
|
+
* one. Both are LITERALS the workflow author sets, folded before the config
|
|
9
|
+
* reaches the engine:
|
|
9
10
|
* schemaVersion into the GIN-indexed metadata (a queryable facet), lookups
|
|
10
11
|
* into the unindexed envelope (form plumbing, never a facet). Folding is a
|
|
11
12
|
* pure transform — no query, no activity — so a pinned `conditional` costs
|
|
@@ -57,17 +58,19 @@ export type ConditionEscalationConfig = Types.ConditionQueueConfig & {
|
|
|
57
58
|
* });
|
|
58
59
|
* ```
|
|
59
60
|
*
|
|
60
|
-
* **
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
61
|
+
* **Knowledge lookups — option lists the form reads.** Each ref names a
|
|
62
|
+
* knowledge entry; the resolve UI fetches it and the form addresses the
|
|
63
|
+
* content as the `lookup.*` context domain (`x-lt-options:
|
|
64
|
+
* "lookup.materials.items"`). Leave `version` out (or set `'current'`) and
|
|
65
|
+
* the form reads the newest edition, so a long-open row sees today's list
|
|
66
|
+
* and a closed row the list current when it closed. Pin a `version` when the
|
|
67
|
+
* form must read one exact edition.
|
|
65
68
|
*
|
|
66
69
|
* ```typescript
|
|
67
70
|
* const decision = await conditional<PickerResolverV1>(signalId, {
|
|
68
71
|
* role: 'catalog-picker',
|
|
69
72
|
* description: instructions,
|
|
70
|
-
* lookups: [{ domain: 'catalog', key: 'materials'
|
|
73
|
+
* lookups: [{ domain: 'catalog', key: 'materials' }],
|
|
71
74
|
* });
|
|
72
75
|
* ```
|
|
73
76
|
*
|
|
@@ -104,17 +104,19 @@ function toEngineConfig(escalation) {
|
|
|
104
104
|
* });
|
|
105
105
|
* ```
|
|
106
106
|
*
|
|
107
|
-
* **
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
107
|
+
* **Knowledge lookups — option lists the form reads.** Each ref names a
|
|
108
|
+
* knowledge entry; the resolve UI fetches it and the form addresses the
|
|
109
|
+
* content as the `lookup.*` context domain (`x-lt-options:
|
|
110
|
+
* "lookup.materials.items"`). Leave `version` out (or set `'current'`) and
|
|
111
|
+
* the form reads the newest edition, so a long-open row sees today's list
|
|
112
|
+
* and a closed row the list current when it closed. Pin a `version` when the
|
|
113
|
+
* form must read one exact edition.
|
|
112
114
|
*
|
|
113
115
|
* ```typescript
|
|
114
116
|
* const decision = await conditional<PickerResolverV1>(signalId, {
|
|
115
117
|
* role: 'catalog-picker',
|
|
116
118
|
* description: instructions,
|
|
117
|
-
* lookups: [{ domain: 'catalog', key: 'materials'
|
|
119
|
+
* lookups: [{ domain: 'catalog', key: 'materials' }],
|
|
118
120
|
* });
|
|
119
121
|
* ```
|
|
120
122
|
*
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RoleBadgeGrant } from './types';
|
|
2
|
+
/** The problem with a `properties.badge_grant` value, or null when it is usable (or absent). */
|
|
3
|
+
export declare function badgeGrantError(value: unknown): string | null;
|
|
4
|
+
/** The role's badge policy from its properties bag, or null when it declares none (or an unusable one). */
|
|
5
|
+
export declare function readBadgeGrant(properties: Record<string, unknown> | null | undefined): RoleBadgeGrant | null;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.badgeGrantError = badgeGrantError;
|
|
4
|
+
exports.readBadgeGrant = readBadgeGrant;
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
const SCOPES = ['action', 'subject'];
|
|
7
|
+
/** The problem with a `properties.badge_grant` value, or null when it is usable (or absent). */
|
|
8
|
+
function badgeGrantError(value) {
|
|
9
|
+
if (value === undefined || value === null)
|
|
10
|
+
return null;
|
|
11
|
+
if (typeof value !== 'object' || Array.isArray(value))
|
|
12
|
+
return 'properties.badge_grant must be an object';
|
|
13
|
+
const grant = value;
|
|
14
|
+
const known = new Set(['ttl_seconds', 'max_uses', 'scope']);
|
|
15
|
+
const extra = Object.keys(grant).filter((k) => !known.has(k));
|
|
16
|
+
if (extra.length)
|
|
17
|
+
return `properties.badge_grant has unknown key(s): ${extra.join(', ')}`;
|
|
18
|
+
if (grant.ttl_seconds !== undefined
|
|
19
|
+
&& (!Number.isInteger(grant.ttl_seconds) || grant.ttl_seconds < 1 || grant.ttl_seconds > 86_400)) {
|
|
20
|
+
return 'properties.badge_grant.ttl_seconds must be an integer from 1 to 86400';
|
|
21
|
+
}
|
|
22
|
+
if (grant.max_uses !== undefined && (!Number.isInteger(grant.max_uses) || grant.max_uses < 0)) {
|
|
23
|
+
return 'properties.badge_grant.max_uses must be a non-negative integer';
|
|
24
|
+
}
|
|
25
|
+
if (grant.scope !== undefined && !SCOPES.includes(grant.scope)) {
|
|
26
|
+
return `properties.badge_grant.scope must be one of ${SCOPES.join(', ')}`;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
/** The role's badge policy from its properties bag, or null when it declares none (or an unusable one). */
|
|
31
|
+
function readBadgeGrant(properties) {
|
|
32
|
+
const value = properties?.[types_1.ROLE_PROPERTY_KEYS.BADGE_GRANT];
|
|
33
|
+
if (value === undefined || value === null || badgeGrantError(value))
|
|
34
|
+
return null;
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
@@ -8,6 +8,8 @@ const db_1 = require("../../lib/db");
|
|
|
8
8
|
const logger_1 = require("../../lib/logger");
|
|
9
9
|
const index_1 = require("./index");
|
|
10
10
|
const sql_1 = require("./sql");
|
|
11
|
+
const badge_grant_1 = require("./badge-grant");
|
|
12
|
+
const types_1 = require("./types");
|
|
11
13
|
/** Recorded on schema snapshots written by the startup apply. */
|
|
12
14
|
exports.STARTUP_CHANGE_SUMMARY = 'startup apply (code)';
|
|
13
15
|
/** Metadata fields shared 1:1 between LTRoleConfig and UpdateRoleInput. */
|
|
@@ -79,6 +81,9 @@ async function listConfiguredRoles() {
|
|
|
79
81
|
* Escalation targets use replace semantics when declared.
|
|
80
82
|
*/
|
|
81
83
|
async function applyRoleConfig(cfg, codeOwned) {
|
|
84
|
+
const grantError = (0, badge_grant_1.badgeGrantError)(cfg.properties?.[types_1.ROLE_PROPERTY_KEYS.BADGE_GRANT]);
|
|
85
|
+
if (grantError)
|
|
86
|
+
throw new Error(`role ${cfg.role}: ${grantError}`);
|
|
82
87
|
const created = await (0, index_1.createRole)(cfg.role);
|
|
83
88
|
const pool = (0, db_1.getPool)();
|
|
84
89
|
const { rows } = await pool.query(sql_1.GET_ROLE_ROW, [cfg.role]);
|
|
@@ -15,6 +15,10 @@ export interface EscalationChain {
|
|
|
15
15
|
* MEMBER of exactly this one role, the dashboard drops the left nav, the
|
|
16
16
|
* role's escalation list becomes home, and navigation is held to the list,
|
|
17
17
|
* the detail page, and the scan screens. Multi-role users get full chrome.
|
|
18
|
+
* - BADGE_GRANT: RoleBadgeGrant — the badge policy at this role's stations.
|
|
19
|
+
* A badge scanned on a device signed in as a member of this role mints
|
|
20
|
+
* its acting grant under this policy instead of the badge scheme's own
|
|
21
|
+
* (see api/scan-codes/badge-policy.ts).
|
|
18
22
|
* - LINK_VARIABLES: RoleLinkVariable[] — metadata facet names members bind
|
|
19
23
|
* per device. Pins may reference `{lt:name}` as a whole facet value
|
|
20
24
|
* (e.g. `facets={"region":"{lt:region}"}`); the dashboard substitutes
|
|
@@ -27,7 +31,17 @@ export declare const ROLE_PROPERTY_KEYS: {
|
|
|
27
31
|
readonly WORKED_BY: "worked_by";
|
|
28
32
|
readonly KIOSK: "kiosk";
|
|
29
33
|
readonly LINK_VARIABLES: "link_variables";
|
|
34
|
+
readonly BADGE_GRANT: "badge_grant";
|
|
30
35
|
};
|
|
36
|
+
/** A station role's badge policy. Absent fields keep the badge scheme's value. */
|
|
37
|
+
export interface RoleBadgeGrant {
|
|
38
|
+
/** How long a badge scan stays primed (1-86400 s). */
|
|
39
|
+
ttl_seconds?: number;
|
|
40
|
+
/** 0 = TTL-bound; n = the grant covers n acts. */
|
|
41
|
+
max_uses?: number;
|
|
42
|
+
/** 'action' spends a use per act; 'subject' binds to one held item. */
|
|
43
|
+
scope?: 'action' | 'subject';
|
|
44
|
+
}
|
|
31
45
|
/**
|
|
32
46
|
* One link-variable declaration inside `properties.link_variables`. `name` is
|
|
33
47
|
* the metadata facet key (facet-key charset); `label` is the human annotation
|
|
@@ -14,6 +14,10 @@ exports.PORTAL_KEY = exports.PORTAL_LIMITS = exports.ROLE_PROPERTY_KEYS = void 0
|
|
|
14
14
|
* MEMBER of exactly this one role, the dashboard drops the left nav, the
|
|
15
15
|
* role's escalation list becomes home, and navigation is held to the list,
|
|
16
16
|
* the detail page, and the scan screens. Multi-role users get full chrome.
|
|
17
|
+
* - BADGE_GRANT: RoleBadgeGrant — the badge policy at this role's stations.
|
|
18
|
+
* A badge scanned on a device signed in as a member of this role mints
|
|
19
|
+
* its acting grant under this policy instead of the badge scheme's own
|
|
20
|
+
* (see api/scan-codes/badge-policy.ts).
|
|
17
21
|
* - LINK_VARIABLES: RoleLinkVariable[] — metadata facet names members bind
|
|
18
22
|
* per device. Pins may reference `{lt:name}` as a whole facet value
|
|
19
23
|
* (e.g. `facets={"region":"{lt:region}"}`); the dashboard substitutes
|
|
@@ -26,6 +30,7 @@ exports.ROLE_PROPERTY_KEYS = {
|
|
|
26
30
|
WORKED_BY: 'worked_by',
|
|
27
31
|
KIOSK: 'kiosk',
|
|
28
32
|
LINK_VARIABLES: 'link_variables',
|
|
33
|
+
BADGE_GRANT: 'badge_grant',
|
|
29
34
|
};
|
|
30
35
|
/** Bounds for a role's portals: how many, and the matrix of each (rows of cells, each cell a pin). */
|
|
31
36
|
exports.PORTAL_LIMITS = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { listScanSchemes, getScanScheme, listScanRules, getScanRule, } from './read';
|
|
2
2
|
export { upsertScanScheme, deleteScanScheme, upsertScanRule, deleteScanRule, seedScanScheme, seedScanRule, applyScanScheme, applyScanRule, type ScanSchemeInput, type ScanRuleInput, } from './write';
|
|
3
|
-
export { parseScanCode, interpolateScanTemplate, mentionsClaimToken, ScanTemplateError, type ScanParseResult, type ScanParseFailure, type ScanTemplateContext, } from './parse';
|
|
4
|
-
export { assertValidScheme, assertValidSteps } from './validate';
|
|
3
|
+
export { parseScanCode, interpolateScanTemplate, mentionsClaimToken, renderScanCopy, ScanTemplateError, type ScanParseResult, type ScanParseFailure, type ScanTemplateContext, } from './parse';
|
|
4
|
+
export { assertValidScheme, assertValidSteps, assertValidIdentityRule, assertSchemesCoexist, } from './validate';
|
|
5
|
+
export { isValidGtin, normalizeGtin, displayGtin } from '../../shared/scan-code';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertValidSteps = exports.assertValidScheme = exports.ScanTemplateError = exports.mentionsClaimToken = exports.interpolateScanTemplate = exports.parseScanCode = exports.applyScanRule = exports.applyScanScheme = exports.seedScanRule = exports.seedScanScheme = exports.deleteScanRule = exports.upsertScanRule = exports.deleteScanScheme = exports.upsertScanScheme = exports.getScanRule = exports.listScanRules = exports.getScanScheme = exports.listScanSchemes = void 0;
|
|
3
|
+
exports.displayGtin = exports.normalizeGtin = exports.isValidGtin = exports.assertSchemesCoexist = exports.assertValidIdentityRule = exports.assertValidSteps = exports.assertValidScheme = exports.ScanTemplateError = exports.renderScanCopy = exports.mentionsClaimToken = exports.interpolateScanTemplate = exports.parseScanCode = exports.applyScanRule = exports.applyScanScheme = exports.seedScanRule = exports.seedScanScheme = exports.deleteScanRule = exports.upsertScanRule = exports.deleteScanScheme = exports.upsertScanScheme = exports.getScanRule = exports.listScanRules = exports.getScanScheme = exports.listScanSchemes = void 0;
|
|
4
4
|
var read_1 = require("./read");
|
|
5
5
|
Object.defineProperty(exports, "listScanSchemes", { enumerable: true, get: function () { return read_1.listScanSchemes; } });
|
|
6
6
|
Object.defineProperty(exports, "getScanScheme", { enumerable: true, get: function () { return read_1.getScanScheme; } });
|
|
@@ -19,7 +19,14 @@ var parse_1 = require("./parse");
|
|
|
19
19
|
Object.defineProperty(exports, "parseScanCode", { enumerable: true, get: function () { return parse_1.parseScanCode; } });
|
|
20
20
|
Object.defineProperty(exports, "interpolateScanTemplate", { enumerable: true, get: function () { return parse_1.interpolateScanTemplate; } });
|
|
21
21
|
Object.defineProperty(exports, "mentionsClaimToken", { enumerable: true, get: function () { return parse_1.mentionsClaimToken; } });
|
|
22
|
+
Object.defineProperty(exports, "renderScanCopy", { enumerable: true, get: function () { return parse_1.renderScanCopy; } });
|
|
22
23
|
Object.defineProperty(exports, "ScanTemplateError", { enumerable: true, get: function () { return parse_1.ScanTemplateError; } });
|
|
23
24
|
var validate_1 = require("./validate");
|
|
24
25
|
Object.defineProperty(exports, "assertValidScheme", { enumerable: true, get: function () { return validate_1.assertValidScheme; } });
|
|
25
26
|
Object.defineProperty(exports, "assertValidSteps", { enumerable: true, get: function () { return validate_1.assertValidSteps; } });
|
|
27
|
+
Object.defineProperty(exports, "assertValidIdentityRule", { enumerable: true, get: function () { return validate_1.assertValidIdentityRule; } });
|
|
28
|
+
Object.defineProperty(exports, "assertSchemesCoexist", { enumerable: true, get: function () { return validate_1.assertSchemesCoexist; } });
|
|
29
|
+
var scan_code_1 = require("../../shared/scan-code");
|
|
30
|
+
Object.defineProperty(exports, "isValidGtin", { enumerable: true, get: function () { return scan_code_1.isValidGtin; } });
|
|
31
|
+
Object.defineProperty(exports, "normalizeGtin", { enumerable: true, get: function () { return scan_code_1.normalizeGtin; } });
|
|
32
|
+
Object.defineProperty(exports, "displayGtin", { enumerable: true, get: function () { return scan_code_1.displayGtin; } });
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { type ScanParseFailure } from '../../shared/scan-code';
|
|
1
2
|
import { type ParsedScanCode, type ScanScheme } from '../../types';
|
|
2
|
-
export
|
|
3
|
-
/** Why the code did not parse. */
|
|
4
|
-
reason: 'empty' | 'unknown_version' | 'scheme_disabled' | 'malformed';
|
|
5
|
-
detail: string;
|
|
6
|
-
}
|
|
3
|
+
export type { ScanParseFailure };
|
|
7
4
|
export type ScanParseResult = {
|
|
8
5
|
ok: true;
|
|
9
6
|
parsed: ParsedScanCode;
|
|
@@ -12,26 +9,26 @@ export type ScanParseResult = {
|
|
|
12
9
|
ok: false;
|
|
13
10
|
failure: ScanParseFailure;
|
|
14
11
|
};
|
|
15
|
-
/**
|
|
16
|
-
* Parse a raw scan string against the configured schemes. Pure — no I/O.
|
|
17
|
-
*
|
|
18
|
-
* The leading TWO digits pick the scheme (10-99, so a code never starts with a
|
|
19
|
-
* leading zero); the scheme then defines how the remainder splits into a
|
|
20
|
-
* single-digit category (0-9) and the target:
|
|
21
|
-
* - delimited: `10:1:ABC-123` (delimiter from the scheme row)
|
|
22
|
-
* - fixed: `1017554332` (one category digit, then target_length digits)
|
|
23
|
-
*/
|
|
12
|
+
/** Parse a raw scan string against the configured schemes. Pure; see shared/scan-code. */
|
|
24
13
|
export declare function parseScanCode(raw: string, schemes: ScanScheme[]): ScanParseResult;
|
|
25
14
|
export interface ScanTemplateContext {
|
|
26
15
|
target: string;
|
|
27
16
|
category: string;
|
|
28
17
|
scannedAt: string;
|
|
18
|
+
/** The code as scanned; defaults to the target. */
|
|
19
|
+
code?: string;
|
|
29
20
|
/** The acting user's single live claim, its metadata; absent when none or ambiguous. */
|
|
30
21
|
claim?: Record<string, unknown>;
|
|
31
|
-
/** The row
|
|
22
|
+
/** The row the step located (item-mode accumulate, hold), its metadata. */
|
|
32
23
|
item?: Record<string, unknown>;
|
|
24
|
+
/** The held subject's row: its metadata plus `id`. */
|
|
25
|
+
subject?: Record<string, unknown>;
|
|
26
|
+
/** The container a subject step located, its metadata. */
|
|
27
|
+
container?: Record<string, unknown>;
|
|
28
|
+
/** The batch a fill step read: `pending`, `total`, `filled`. */
|
|
29
|
+
fill?: Record<string, unknown>;
|
|
33
30
|
}
|
|
34
|
-
/** A
|
|
31
|
+
/** A bag token the context cannot resolve. */
|
|
35
32
|
export declare class ScanTemplateError extends Error {
|
|
36
33
|
readonly token: string;
|
|
37
34
|
readonly reason: string;
|
|
@@ -41,9 +38,15 @@ export declare class ScanTemplateError extends Error {
|
|
|
41
38
|
export declare function mentionsClaimToken(value: unknown): boolean;
|
|
42
39
|
/**
|
|
43
40
|
* Replace the template tokens inside string values of a params object.
|
|
44
|
-
* Deep, pure, non-mutating. The
|
|
45
|
-
*
|
|
46
|
-
* facet bags and throw
|
|
47
|
-
*
|
|
41
|
+
* Deep, pure, non-mutating. The scan tokens are plain text replacement; the
|
|
42
|
+
* bag tokens (`{claim.x}`, `{item.x}`, `{subject.x}`, `{container.x}`,
|
|
43
|
+
* `{fill.x}`) read the context's facet bags and throw
|
|
44
|
+
* {@link ScanTemplateError} when they cannot resolve, so a literal token
|
|
45
|
+
* never reaches a row. No expression language.
|
|
48
46
|
*/
|
|
49
47
|
export declare function interpolateScanTemplate<T>(value: T, ctx: ScanTemplateContext): T;
|
|
48
|
+
/**
|
|
49
|
+
* Render refusal copy, degrading instead of failing: a token with nothing to
|
|
50
|
+
* read becomes an empty string, so a refusal always has words to show.
|
|
51
|
+
*/
|
|
52
|
+
export declare function renderScanCopy(markdown: string, ctx: ScanTemplateContext): string;
|