@hotmeshio/long-tail 0.14.4 → 0.16.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/README.md +23 -9
- package/build/api/escalations/create.js +18 -0
- package/build/api/escalations/index.d.ts +1 -0
- package/build/api/escalations/index.js +3 -1
- package/build/api/escalations/lookups.d.ts +20 -0
- package/build/api/escalations/lookups.js +90 -0
- package/build/api/escalations/metadata.d.ts +1 -1
- package/build/api/escalations/metadata.js +4 -4
- package/build/api/escalations/resolve.d.ts +1 -1
- package/build/api/escalations/resolve.js +6 -6
- package/build/api/knowledge.d.ts +9 -0
- package/build/api/knowledge.js +24 -0
- package/build/bin/ltc.js +10 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +3 -2
- package/build/lib/cli/commands/escalations.d.ts +3 -0
- package/build/lib/cli/commands/escalations.js +25 -0
- package/build/lib/cli/commands/knowledge.d.ts +5 -0
- package/build/lib/cli/commands/knowledge.js +17 -2
- package/build/lib/cli/scanner.js +2 -0
- package/build/lib/db/schemas/033_knowledge_versions.sql +33 -0
- package/build/routes/escalations/single.js +10 -0
- package/build/routes/knowledge.js +35 -2
- package/build/sdk/index.d.ts +5 -0
- package/build/sdk/index.js +3 -0
- package/build/services/diagnostics/patterns.js +1 -1
- package/build/services/escalation/crud.d.ts +3 -3
- package/build/services/escalation/crud.js +9 -2
- package/build/services/escalation/resolver-validation.js +6 -0
- package/build/services/escalation/sql.d.ts +1 -1
- package/build/services/escalation/sql.js +1 -1
- package/build/services/knowledge/index.d.ts +18 -0
- package/build/services/knowledge/index.js +52 -0
- package/build/services/knowledge/lookup-cache.d.ts +29 -0
- package/build/services/knowledge/lookup-cache.js +94 -0
- package/build/services/knowledge/sql.d.ts +2 -0
- package/build/services/knowledge/sql.js +14 -0
- package/build/services/mcp/server-tools.js +30 -0
- package/build/services/orchestrator/condition.d.ts +33 -13
- package/build/services/orchestrator/condition.js +41 -14
- package/build/services/yaml-workflow/durable-compiler/parser.js +4 -1
- package/build/shared/form-validation/ctx-path.d.ts +12 -0
- package/build/shared/form-validation/ctx-path.js +56 -0
- package/build/shared/form-validation/field-validator.d.ts +4 -2
- package/build/shared/form-validation/field-validator.js +21 -17
- 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-help.d.ts +1 -1
- package/build/shared/form-validation/x-lt-help.js +2 -1
- package/build/shared/form-validation/x-lt-options.d.ts +1 -16
- package/build/shared/form-validation/x-lt-options.js +35 -23
- package/build/system/activities/knowledge.d.ts +3 -0
- package/build/system/activities/knowledge.js +5 -2
- package/build/system/activities/sql.d.ts +6 -10
- package/build/system/activities/sql.js +105 -49
- package/build/system/mcp-servers/admin/schemas.d.ts +4 -4
- package/build/system/mcp-servers/knowledge.js +23 -2
- package/build/system/seed/tool-manifests-escalation.js +12 -0
- package/build/system/seed/tool-manifests-knowledge.d.ts +36 -0
- package/build/system/seed/tool-manifests-knowledge.js +15 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/escalation.d.ts +37 -3
- package/build/types/escalation.js +42 -2
- package/dashboard/dist/assets/{AdminDashboard-CUqnrc7h.js → AdminDashboard-BVgjY4zN.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-CUqnrc7h.js.map → AdminDashboard-BVgjY4zN.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-lmUOwyHO.js → AgentConfigPage-ChL59YL5.js} +6 -6
- package/dashboard/dist/assets/AgentConfigPage-ChL59YL5.js.map +1 -0
- package/dashboard/dist/assets/{AgentDetailPage-C_xAw6aF.js → AgentDetailPage-IJfgCOIF.js} +2 -2
- package/dashboard/dist/assets/AgentDetailPage-IJfgCOIF.js.map +1 -0
- package/dashboard/dist/assets/{AgentsPage-CHCGAkpN.js → AgentsPage-C7PnPXz_.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-CHCGAkpN.js.map → AgentsPage-C7PnPXz_.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-C5f2rqHa.js +2 -0
- package/dashboard/dist/assets/{AvailableEscalationsPage-BvQdHMl2.js.map → AvailableEscalationsPage-C5f2rqHa.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-Dsr8Yyj_.js → BotPicker-CBf6bHLV.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-Dsr8Yyj_.js.map → BotPicker-CBf6bHLV.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-CbUftMR2.js → BulkAssignModal-CkxoPByA.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-CbUftMR2.js.map → BulkAssignModal-CkxoPByA.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-D7USh3F0.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-CPNUJPHs.js.map → CapabilitiesPage-D7USh3F0.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-DffGX2tR.js → CollapsibleSection-DfPpAIxa.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-DffGX2tR.js.map → CollapsibleSection-DfPpAIxa.js.map} +1 -1
- package/dashboard/dist/assets/CountdownTimer-DVL7WIcE.js +2 -0
- package/dashboard/dist/assets/CountdownTimer-DVL7WIcE.js.map +1 -0
- package/dashboard/dist/assets/{CredentialsPage-UXnD_Rau.js → CredentialsPage-BHZ5SKIu.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-UXnD_Rau.js.map → CredentialsPage-BHZ5SKIu.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-CctUYUlI.js → CronLabel-wE8Hms6c.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-CctUYUlI.js.map → CronLabel-wE8Hms6c.js.map} +1 -1
- package/dashboard/dist/assets/{DropZone-7UoXQ4qL.js → DropZone-Pv-v5RAs.js} +2 -2
- package/dashboard/dist/assets/{DropZone-7UoXQ4qL.js.map → DropZone-Pv-v5RAs.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-C7_Y8xXn.js → ElapsedCell-B4VxKHpw.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-C7_Y8xXn.js.map → ElapsedCell-B4VxKHpw.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-pRu91gZK.js → EntityTimelinePanel-CFbQDHOj.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-pRu91gZK.js.map → EntityTimelinePanel-CFbQDHOj.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-B3f2mjqg.js → EscalationListSchemaPage-YTgexl4f.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-B3f2mjqg.js.map → EscalationListSchemaPage-YTgexl4f.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-AJ85FRZy.js → EscalationSchemaPage-Sjk05eHP.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-AJ85FRZy.js.map → EscalationSchemaPage-Sjk05eHP.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-DMLLWzjS.js → EscalationsOverview-gHWPjUpZ.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DMLLWzjS.js.map → EscalationsOverview-gHWPjUpZ.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-BlNuCTN6.js → EventTable-C9lHQ57t.js} +2 -2
- package/dashboard/dist/assets/{EventTable-BlNuCTN6.js.map → EventTable-C9lHQ57t.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-B-rkcWkV.js → FilterBar-BY--ANxv.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-B-rkcWkV.js.map → FilterBar-BY--ANxv.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-Bkt5tAFo.js → GraphInvokePage-B-Oo5s-W.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-Bkt5tAFo.js.map → GraphInvokePage-B-Oo5s-W.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-CIE9bCFQ.js → HomePage-BrcjKOaJ.js} +2 -2
- package/dashboard/dist/assets/{HomePage-CIE9bCFQ.js.map → HomePage-BrcjKOaJ.js.map} +1 -1
- package/dashboard/dist/assets/ListToolbar-D5TQ4X_M.js +2 -0
- package/dashboard/dist/assets/{ListToolbar-C_-Utxqm.js.map → ListToolbar-D5TQ4X_M.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-c0p171OK.js → McpOverview-jlukVWQ7.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-c0p171OK.js.map → McpOverview-jlukVWQ7.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-B61I9-dM.js → McpQueryDetailPage-BWKbvJSd.js} +3 -3
- package/dashboard/dist/assets/{McpQueryDetailPage-B61I9-dM.js.map → McpQueryDetailPage-BWKbvJSd.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryPage-BH2Pon4M.js +2 -0
- package/dashboard/dist/assets/{McpQueryPage-Viqi13Fa.js.map → McpQueryPage-BH2Pon4M.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-CiAx_xyV.js → McpRunDetailPage-kUnq2QSO.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-CiAx_xyV.js.map → McpRunDetailPage-kUnq2QSO.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-BpfvNRbE.js → McpRunsPage-BTucgt64.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-BpfvNRbE.js.map → McpRunsPage-BTucgt64.js.map} +1 -1
- package/dashboard/dist/assets/{NamespacePill-CKp_9EaI.js → NamespacePill-DONj6eUU.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-CKp_9EaI.js.map → NamespacePill-DONj6eUU.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-DGKwUE6h.js → OperationsPage-Cp8WL-ld.js} +3 -3
- package/dashboard/dist/assets/{OperationsPage-DGKwUE6h.js.map → OperationsPage-Cp8WL-ld.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-ha-05tgB.js → OperatorDashboard-wHyeLWzX.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-ha-05tgB.js.map → OperatorDashboard-wHyeLWzX.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-CDDpHpdv.js → PageHeader-CFVw67M6.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-CDDpHpdv.js.map → PageHeader-CFVw67M6.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-DIWH6fRv.js → PageHeaderWithStats-D9tQxILm.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-DIWH6fRv.js.map → PageHeaderWithStats-D9tQxILm.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-DMH-D1ns.js → PersonaDetailPage-BXlTqLDK.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-DMH-D1ns.js.map → PersonaDetailPage-BXlTqLDK.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-YLjCcQcU.js → PersonasPage-DlmdJ3Dm.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-YLjCcQcU.js.map → PersonasPage-DlmdJ3Dm.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-W5_2FJHn.js → ProcessDetailPage-D88ocvmT.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-W5_2FJHn.js.map → ProcessDetailPage-D88ocvmT.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-5f_2S9ER.js → ProcessesListPage-DpXm-KtK.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-5f_2S9ER.js.map → ProcessesListPage-DpXm-KtK.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-CuDTO13n.js → RoleDetailPage-DE2Rj2QE.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-CuDTO13n.js.map → RoleDetailPage-DE2Rj2QE.js.map} +1 -1
- package/dashboard/dist/assets/{RolePill-C0hExOmI.js → RolePill-Di_5hfvw.js} +2 -2
- package/dashboard/dist/assets/{RolePill-C0hExOmI.js.map → RolePill-Di_5hfvw.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-McMYumsZ.js → RolesPage-CZSvJlsz.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-McMYumsZ.js.map → RolesPage-CZSvJlsz.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-CC87e67k.js → RunAsSelector-BawZcqAk.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-CC87e67k.js.map → RunAsSelector-BawZcqAk.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-Zk6Jorv_.js → ScanCodesPage-DSlpA9kK.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-Zk6Jorv_.js.map → ScanCodesPage-DSlpA9kK.js.map} +1 -1
- package/dashboard/dist/assets/{ScanSchemeDetailPage-B79pya8o.js → ScanSchemeDetailPage-BK4hisGD.js} +2 -2
- package/dashboard/dist/assets/{ScanSchemeDetailPage-B79pya8o.js.map → ScanSchemeDetailPage-BK4hisGD.js.map} +1 -1
- package/dashboard/dist/assets/{ScanStationPage-BLlHMmd_.js → ScanStationPage-D3QjajFD.js} +2 -2
- package/dashboard/dist/assets/{ScanStationPage-BLlHMmd_.js.map → ScanStationPage-D3QjajFD.js.map} +1 -1
- package/dashboard/dist/assets/{ScopeBadge-BBQvz4pj.js → ScopeBadge-CqIIeWjK.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-BBQvz4pj.js.map → ScopeBadge-CqIIeWjK.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-CnJgQPU1.js → StickyPagination-BfZwU2NR.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-CnJgQPU1.js.map → StickyPagination-BfZwU2NR.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-CU5wrqO_.js → StreamMessageDetail-C7zIHX5D.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-CU5wrqO_.js.map → StreamMessageDetail-C7zIHX5D.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-D5m-_zgy.js → SwimlaneTimeline-DNSo8AT8.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-D5m-_zgy.js.map → SwimlaneTimeline-DNSo8AT8.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-BXxXs1JD.js → TagInput-BLwxTNsI.js} +2 -2
- package/dashboard/dist/assets/{TagInput-BXxXs1JD.js.map → TagInput-BLwxTNsI.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-SvVSH39Q.js → TaskDetailPage-BOJ8pwh3.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-SvVSH39Q.js.map → TaskDetailPage-BOJ8pwh3.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-BKGJBVZG.js → TaskQueuePill-DVgcqd-h.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-BKGJBVZG.js.map → TaskQueuePill-DVgcqd-h.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-BtpwvxkS.js → TasksListPage-C4CYqZf8.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-BtpwvxkS.js.map → TasksListPage-C4CYqZf8.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-BPODA7Dm.js → TimeAgo-JRPi9IEd.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-BPODA7Dm.js.map → TimeAgo-JRPi9IEd.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-DEQXlxbH.js → TimestampCell-BVYyU-nl.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-DEQXlxbH.js.map → TimestampCell-BVYyU-nl.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-BY6zLSfA.js → ToolPill-C6hkOqPx.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-BY6zLSfA.js.map → ToolPill-C6hkOqPx.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-Ztc0pRSh.js → ToolTestPanel-IGrd44Au.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-Ztc0pRSh.js.map → ToolTestPanel-IGrd44Au.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-BmpEqg-Q.js → TopicDetailPage-DhianNey.js} +3 -3
- package/dashboard/dist/assets/{TopicDetailPage-BmpEqg-Q.js.map → TopicDetailPage-DhianNey.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-BVW5y6vE.js → TopicsPage-Glhqz_Nv.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-BVW5y6vE.js.map → TopicsPage-Glhqz_Nv.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-D915g7ba.js → UserName-CD9OqhNI.js} +2 -2
- package/dashboard/dist/assets/{UserName-D915g7ba.js.map → UserName-CD9OqhNI.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-CIl9ESgk.js → WorkflowExecutionPage-8Q2438Ry.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-CIl9ESgk.js.map → WorkflowExecutionPage-8Q2438Ry.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-qp5UF3-y.js → WorkflowPill-CN-952iI.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill-qp5UF3-y.js.map → WorkflowPill-CN-952iI.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-DtkaGgdZ.js → WorkflowsDashboard-CkAoYT86.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DtkaGgdZ.js.map → WorkflowsDashboard-CkAoYT86.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-DANXhmXb.js → WorkflowsOverview-Zh_EidMp.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-DANXhmXb.js.map → WorkflowsOverview-Zh_EidMp.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-m6Ub7qtE.js → YamlWorkflowDetailPage-BKJbFT8C.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-m6Ub7qtE.js.map → YamlWorkflowDetailPage-BKJbFT8C.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-5MOsxbLW.js → YamlWorkflowsPage-DK1z6iFt.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-5MOsxbLW.js.map → YamlWorkflowsPage-DK1z6iFt.js.map} +1 -1
- package/dashboard/dist/assets/{agents-DacpnIqz.js → agents-BEASyYpg.js} +2 -2
- package/dashboard/dist/assets/{agents-DacpnIqz.js.map → agents-BEASyYpg.js.map} +1 -1
- package/dashboard/dist/assets/{bots-El47Xy5a.js → bots-CaXqSHat.js} +2 -2
- package/dashboard/dist/assets/{bots-El47Xy5a.js.map → bots-CaXqSHat.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-DGC__Aob.js → capabilities-Cijq-qev.js} +2 -2
- package/dashboard/dist/assets/{capabilities-DGC__Aob.js.map → capabilities-Cijq-qev.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-Bzx-qd8m.js → controlplane-HGuRC7AW.js} +2 -2
- package/dashboard/dist/assets/{controlplane-Bzx-qd8m.js.map → controlplane-HGuRC7AW.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-BmY7BriY.js → escalation-columns-BLVz8XCP.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-BmY7BriY.js.map → escalation-columns-BLVz8XCP.js.map} +1 -1
- package/dashboard/dist/assets/index-BJDAXUzO.js +2 -0
- package/dashboard/dist/assets/index-BJDAXUzO.js.map +1 -0
- package/dashboard/dist/assets/{index-CoIh4ipz.js → index-CEIp6WWg.js} +2 -2
- package/dashboard/dist/assets/{index-CoIh4ipz.js.map → index-CEIp6WWg.js.map} +1 -1
- package/dashboard/dist/assets/index-CK_ohh6Q.js +3 -0
- package/dashboard/dist/assets/index-CK_ohh6Q.js.map +1 -0
- package/dashboard/dist/assets/{index-Ce6ghhpn.js → index-CLQ0HBHR.js} +2 -2
- package/dashboard/dist/assets/{index-Ce6ghhpn.js.map → index-CLQ0HBHR.js.map} +1 -1
- package/dashboard/dist/assets/{index-Cfw6FARc.js → index-Cg0vCZng.js} +2 -2
- package/dashboard/dist/assets/{index-Cfw6FARc.js.map → index-Cg0vCZng.js.map} +1 -1
- package/dashboard/dist/assets/{index-SU2xrnBD.js → index-CgXVDPW-.js} +31 -31
- package/dashboard/dist/assets/index-CgXVDPW-.js.map +1 -0
- package/dashboard/dist/assets/index-ClY0ihQ5.js +2 -0
- package/dashboard/dist/assets/{index-DH_xm9UQ.js.map → index-ClY0ihQ5.js.map} +1 -1
- package/dashboard/dist/assets/{index-ZtpEajtq.js → index-D2OU2MJb.js} +2 -2
- package/dashboard/dist/assets/{index-ZtpEajtq.js.map → index-D2OU2MJb.js.map} +1 -1
- package/dashboard/dist/assets/{index-CHwg51qz.js → index-IkgBE7e_.js} +2 -2
- package/dashboard/dist/assets/{index-CHwg51qz.js.map → index-IkgBE7e_.js.map} +1 -1
- package/dashboard/dist/assets/{index-BPK2cB4Q.js → index-Xi3LO4Ye.js} +4 -4
- package/dashboard/dist/assets/{index-BPK2cB4Q.js.map → index-Xi3LO4Ye.js.map} +1 -1
- package/dashboard/dist/assets/{index-DpsVlk5z.js → index-YMd3ZiPd.js} +2 -2
- package/dashboard/dist/assets/{index-DpsVlk5z.js.map → index-YMd3ZiPd.js.map} +1 -1
- package/dashboard/dist/assets/{index-Bwlnpbpd.js → index-t1JXcmBG.js} +2 -2
- package/dashboard/dist/assets/{index-Bwlnpbpd.js.map → index-t1JXcmBG.js.map} +1 -1
- package/dashboard/dist/assets/{index-DYz57kr_.js → index-tCDjx1kF.js} +2 -2
- package/dashboard/dist/assets/{index-DYz57kr_.js.map → index-tCDjx1kF.js.map} +1 -1
- package/dashboard/dist/assets/knowledge-DpaUJtVW.js +2 -0
- package/dashboard/dist/assets/knowledge-DpaUJtVW.js.map +1 -0
- package/dashboard/dist/assets/{mcp-BEqxxlW9.js → mcp-BkkLq6OE.js} +2 -2
- package/dashboard/dist/assets/{mcp-BEqxxlW9.js.map → mcp-BkkLq6OE.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-qXTlQfc_.js → mcp-query-DeXu3La5.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-qXTlQfc_.js.map → mcp-query-DeXu3La5.js.map} +1 -1
- package/dashboard/dist/assets/{personas-jJEDmBtg.js → personas-BRbKVVko.js} +2 -2
- package/dashboard/dist/assets/{personas-jJEDmBtg.js.map → personas-BRbKVVko.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-BNPJh69x.js → pipelines-B7xo92sK.js} +2 -2
- package/dashboard/dist/assets/{pipelines-BNPJh69x.js.map → pipelines-B7xo92sK.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-DhD71qXJ.js → tasks-BGyqM1Ho.js} +2 -2
- package/dashboard/dist/assets/{tasks-DhD71qXJ.js.map → tasks-BGyqM1Ho.js.map} +1 -1
- package/dashboard/dist/assets/{topics-CrXwwuW-.js → topics-I81rKc75.js} +2 -2
- package/dashboard/dist/assets/{topics-CrXwwuW-.js.map → topics-I81rKc75.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-DL7R0ASv.js → useEventHooks-CjV3uNxt.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-DL7R0ASv.js.map → useEventHooks-CjV3uNxt.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-ETqzJakA.js → useNamespace-B-HMdRka.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-ETqzJakA.js.map → useNamespace-B-HMdRka.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-SqY67S-F.js → useYamlActivityEvents-CNsAlsgz.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-SqY67S-F.js.map → useYamlActivityEvents-CNsAlsgz.js.map} +1 -1
- package/dashboard/dist/assets/{users-DF8dTbOo.js → users-DiTqBepm.js} +2 -2
- package/dashboard/dist/assets/{users-DF8dTbOo.js.map → users-DiTqBepm.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-BgsXTN4h.js → vendor-icons-h-jlRSb9.js} +141 -146
- package/dashboard/dist/assets/vendor-icons-h-jlRSb9.js.map +1 -0
- package/dashboard/dist/assets/{workflows-Bdke7fzx.js → workflows-TA0p_3B8.js} +2 -2
- package/dashboard/dist/assets/{workflows-Bdke7fzx.js.map → workflows-TA0p_3B8.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-UMxHYunb.js → yaml-workflows-DN9-DBnQ.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-UMxHYunb.js.map → yaml-workflows-DN9-DBnQ.js.map} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/docs/api/http/escalations.md +31 -8
- package/docs/api/http/knowledge.md +24 -2
- package/docs/api/http/roles.md +1 -1
- package/docs/api/mcp/admin.md +1 -1
- package/docs/api/mcp/human-queue.md +14 -0
- package/docs/api/mcp/knowledge.md +17 -1
- package/docs/api/sdk/escalations.md +38 -15
- package/docs/api/sdk/knowledge.md +27 -0
- package/docs/api/sdk/roles.md +1 -1
- package/docs/compilation.md +1 -1
- package/docs/compiler.md +2 -2
- package/docs/dashboard.md +1 -1
- package/docs/data.md +3 -3
- package/docs/hitl/escalation.md +14 -12
- package/docs/hitl/iframe.md +2 -2
- package/docs/hitl/lookups.md +134 -0
- package/docs/hitl/resolution.md +4 -4
- package/docs/hitl/roles.md +4 -4
- package/docs/hitl/x-lt-show-if.md +1 -1
- package/docs/hitl/x-lt-transition.md +2 -2
- package/docs/hitl/x-lt-validation.md +2 -1
- package/docs/hitl/x-lt-widget.md +2 -2
- package/docs/hitl-guide.md +6 -3
- package/docs/story.md +1 -1
- package/package.json +1 -1
- package/dashboard/dist/assets/AgentConfigPage-lmUOwyHO.js.map +0 -1
- package/dashboard/dist/assets/AgentDetailPage-C_xAw6aF.js.map +0 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-BvQdHMl2.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-CPNUJPHs.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-Bb_VuJc8.js +0 -2
- package/dashboard/dist/assets/CountdownTimer-Bb_VuJc8.js.map +0 -1
- package/dashboard/dist/assets/ListToolbar-C_-Utxqm.js +0 -2
- package/dashboard/dist/assets/McpQueryPage-Viqi13Fa.js +0 -2
- package/dashboard/dist/assets/index-B4ZNPgcz.js +0 -2
- package/dashboard/dist/assets/index-B4ZNPgcz.js.map +0 -1
- package/dashboard/dist/assets/index-Cqc7Wu5Y.js +0 -3
- package/dashboard/dist/assets/index-Cqc7Wu5Y.js.map +0 -1
- package/dashboard/dist/assets/index-DH_xm9UQ.js +0 -2
- package/dashboard/dist/assets/index-SU2xrnBD.js.map +0 -1
- package/dashboard/dist/assets/knowledge-k-5jr2BN.js +0 -2
- package/dashboard/dist/assets/knowledge-k-5jr2BN.js.map +0 -1
- package/dashboard/dist/assets/vendor-icons-BgsXTN4h.js.map +0 -1
|
@@ -33,22 +33,33 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.conditionLT =
|
|
36
|
+
exports.conditionLT = void 0;
|
|
37
|
+
exports.conditional = conditional;
|
|
37
38
|
const hotmesh_1 = require("@hotmeshio/hotmesh");
|
|
38
39
|
const escalation_1 = require("../../types/escalation");
|
|
39
40
|
const interceptorActivities = __importStar(require("../interceptor/activities"));
|
|
40
41
|
const LT_ACTIVITY_QUEUE = 'lt-interceptor';
|
|
41
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Fold the sugar before the config reaches the engine: schemaVersion into the
|
|
44
|
+
* GIN-indexed metadata (it is a queryable pin), lookups into the unindexed
|
|
45
|
+
* envelope (they are form plumbing, never a facet). Everything else passes
|
|
46
|
+
* through.
|
|
47
|
+
*/
|
|
42
48
|
function toEngineConfig(escalation) {
|
|
43
|
-
if (!escalation || escalation.schemaVersion == null)
|
|
49
|
+
if (!escalation || (escalation.schemaVersion == null && escalation.lookups == null)) {
|
|
44
50
|
return escalation;
|
|
45
|
-
|
|
51
|
+
}
|
|
52
|
+
const { schemaVersion, lookups, ...config } = escalation;
|
|
53
|
+
if (lookups != null)
|
|
54
|
+
(0, escalation_1.assertLookupRefs)(lookups);
|
|
46
55
|
return {
|
|
47
56
|
...config,
|
|
48
|
-
|
|
49
|
-
...config.metadata,
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
...(schemaVersion != null
|
|
58
|
+
? { metadata: { ...config.metadata, [escalation_1.ESCALATION_METADATA_KEYS.SCHEMA_VERSION]: schemaVersion } }
|
|
59
|
+
: {}),
|
|
60
|
+
...(lookups != null
|
|
61
|
+
? { envelope: { ...config.envelope, [escalation_1.ESCALATION_ENVELOPE_KEYS.LOOKUPS]: lookups } }
|
|
62
|
+
: {}),
|
|
52
63
|
};
|
|
53
64
|
}
|
|
54
65
|
/**
|
|
@@ -64,7 +75,7 @@ function toEngineConfig(escalation) {
|
|
|
64
75
|
* from the engine automatically.
|
|
65
76
|
*
|
|
66
77
|
* ```typescript
|
|
67
|
-
* const decision = await
|
|
78
|
+
* const decision = await conditional<{ approved: boolean }>(signalId, {
|
|
68
79
|
* role: 'reviewer',
|
|
69
80
|
* type: 'orderPipeline',
|
|
70
81
|
* subtype: stationName,
|
|
@@ -85,13 +96,27 @@ function toEngineConfig(escalation) {
|
|
|
85
96
|
* ```typescript
|
|
86
97
|
* import { INTAKE_SCHEMA_VERSION, type IntakeResolverV1 } from './forms';
|
|
87
98
|
*
|
|
88
|
-
* const decision = await
|
|
99
|
+
* const decision = await conditional<IntakeResolverV1>(signalId, {
|
|
89
100
|
* role: INTAKE_ROLE,
|
|
90
101
|
* description: instructions,
|
|
91
102
|
* schemaVersion: INTAKE_SCHEMA_VERSION, // the form version this code is written for
|
|
92
103
|
* });
|
|
93
104
|
* ```
|
|
94
105
|
*
|
|
106
|
+
* **Pin versioned knowledge lookups — option lists the form reads.** Each ref
|
|
107
|
+
* names an immutable knowledge edition; the resolve UI fetches them once and
|
|
108
|
+
* the form addresses the content as the `lookup.*` context domain
|
|
109
|
+
* (`x-lt-options: "lookup.materials.items"`). Evolve the list by writing the
|
|
110
|
+
* entry (a new version mints automatically) and repinning the literal here.
|
|
111
|
+
*
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const decision = await conditional<PickerResolverV1>(signalId, {
|
|
114
|
+
* role: 'catalog-picker',
|
|
115
|
+
* description: instructions,
|
|
116
|
+
* lookups: [{ domain: 'catalog', key: 'materials', version: 2 }],
|
|
117
|
+
* });
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
95
120
|
* **With an SLA (hotmesh 0.25.1+) — add `timeout` to the config.** The same
|
|
96
121
|
* single wait arms a resume timer alongside the escalation row: when the timer
|
|
97
122
|
* fires first, this helper returns `false`, the row transitions to
|
|
@@ -100,7 +125,7 @@ function toEngineConfig(escalation) {
|
|
|
100
125
|
* timer is inert.
|
|
101
126
|
*
|
|
102
127
|
* ```typescript
|
|
103
|
-
* const decision = await
|
|
128
|
+
* const decision = await conditional<{ approved: boolean }>(signalId, {
|
|
104
129
|
* role: 'reviewer',
|
|
105
130
|
* description: instructions,
|
|
106
131
|
* metadata: { orderId },
|
|
@@ -121,7 +146,7 @@ function toEngineConfig(escalation) {
|
|
|
121
146
|
* ```typescript
|
|
122
147
|
* import type { EscalationResolution } from '@hotmeshio/hotmesh/types';
|
|
123
148
|
*
|
|
124
|
-
* const decision = await
|
|
149
|
+
* const decision = await conditional<{
|
|
125
150
|
* approved: boolean;
|
|
126
151
|
* $resolution?: EscalationResolution;
|
|
127
152
|
* }>(signalId, { role: 'print-operator' });
|
|
@@ -142,10 +167,10 @@ function toEngineConfig(escalation) {
|
|
|
142
167
|
*
|
|
143
168
|
* ```typescript
|
|
144
169
|
* await activities.ltCreateEscalation({ type: 'approval', role: 'reviewer', metadata: { signal_id: signalId } });
|
|
145
|
-
* const decision = await
|
|
170
|
+
* const decision = await conditional<{ approved: boolean }>(signalId);
|
|
146
171
|
* ```
|
|
147
172
|
*/
|
|
148
|
-
async function
|
|
173
|
+
async function conditional(signalId, escalation) {
|
|
149
174
|
const raw = await hotmesh_1.Durable.workflow.condition(signalId, toEngineConfig(escalation));
|
|
150
175
|
// false = timeout, null = escalation was cancelled — propagate both as-is
|
|
151
176
|
if (raw === null || raw === false)
|
|
@@ -176,3 +201,5 @@ async function conditionLT(signalId, escalation) {
|
|
|
176
201
|
}
|
|
177
202
|
return raw;
|
|
178
203
|
}
|
|
204
|
+
/** @deprecated Alias of {@link conditional}. */
|
|
205
|
+
exports.conditionLT = conditional;
|
|
@@ -61,7 +61,10 @@ function extractDurablePrimitives(source) {
|
|
|
61
61
|
primitives.push(prim);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
// conditionLT (LT-specific
|
|
64
|
+
// conditional / conditionLT (LT-specific wrappers)
|
|
65
|
+
if (/\bconditional\s*[<(]/.test(source) && !seen.has('conditional')) {
|
|
66
|
+
primitives.push('conditional');
|
|
67
|
+
}
|
|
65
68
|
if (/conditionLT/.test(source) && !seen.has('conditionLT')) {
|
|
66
69
|
primitives.push('conditionLT');
|
|
67
70
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const INTERPOLATION_PATTERN: RegExp;
|
|
2
|
+
/** Whether a token embeds `{{domain.path}}` interpolation segments. */
|
|
3
|
+
export declare function hasInterpolation(token: unknown): token is string;
|
|
4
|
+
/** Resolve a concrete `"domain.path"` (x-lt-bind syntax, `a.b[0].c`) against the context. */
|
|
5
|
+
export declare function resolveCtxPath(path: string, ctx: Record<string, unknown> | undefined): unknown;
|
|
6
|
+
/**
|
|
7
|
+
* Interpolate every `{{domain.path}}` segment against the context. Returns
|
|
8
|
+
* the concrete path, or null when any segment resolves to nothing (missing,
|
|
9
|
+
* null, empty string) or to a non-scalar — an unanswered cascade parent
|
|
10
|
+
* yields no path, so the dependent field offers nothing.
|
|
11
|
+
*/
|
|
12
|
+
export declare function interpolatePath(template: string, ctx: Record<string, unknown> | undefined): string | null;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INTERPOLATION_PATTERN = void 0;
|
|
4
|
+
exports.hasInterpolation = hasInterpolation;
|
|
5
|
+
exports.resolveCtxPath = resolveCtxPath;
|
|
6
|
+
exports.interpolatePath = interpolatePath;
|
|
7
|
+
/**
|
|
8
|
+
* Context-path resolution shared by every token that names a `"domain.path"`.
|
|
9
|
+
*
|
|
10
|
+
* A path may embed `{{domain.path}}` interpolation segments — the same
|
|
11
|
+
* grammar as x-lt-help tokens — resolved against the live context before the
|
|
12
|
+
* walk. This is what makes cascading selects work: a field can declare
|
|
13
|
+
*
|
|
14
|
+
* x-lt-options: "lookup.geo.regions.{{resolver.country}}"
|
|
15
|
+
*
|
|
16
|
+
* and its option list follows the submitter's country answer, re-resolved
|
|
17
|
+
* locally on every edit. An unresolved segment means "no concrete path yet",
|
|
18
|
+
* never a literal placeholder.
|
|
19
|
+
*/
|
|
20
|
+
const x_lt_bind_1 = require("./x-lt-bind");
|
|
21
|
+
exports.INTERPOLATION_PATTERN = /\{\{\s*([^{}]+?)\s*\}\}/g;
|
|
22
|
+
/** Whether a token embeds `{{domain.path}}` interpolation segments. */
|
|
23
|
+
function hasInterpolation(token) {
|
|
24
|
+
return typeof token === 'string' && /\{\{[^{}]+\}\}/.test(token);
|
|
25
|
+
}
|
|
26
|
+
/** Resolve a concrete `"domain.path"` (x-lt-bind syntax, `a.b[0].c`) against the context. */
|
|
27
|
+
function resolveCtxPath(path, ctx) {
|
|
28
|
+
if (!ctx)
|
|
29
|
+
return undefined;
|
|
30
|
+
const dot = path.indexOf('.');
|
|
31
|
+
const root = ctx[dot === -1 ? path : path.slice(0, dot)];
|
|
32
|
+
if (dot === -1)
|
|
33
|
+
return root;
|
|
34
|
+
if (root === null || typeof root !== 'object')
|
|
35
|
+
return undefined;
|
|
36
|
+
return (0, x_lt_bind_1.getDeep)(root, path.slice(dot + 1));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Interpolate every `{{domain.path}}` segment against the context. Returns
|
|
40
|
+
* the concrete path, or null when any segment resolves to nothing (missing,
|
|
41
|
+
* null, empty string) or to a non-scalar — an unanswered cascade parent
|
|
42
|
+
* yields no path, so the dependent field offers nothing.
|
|
43
|
+
*/
|
|
44
|
+
function interpolatePath(template, ctx) {
|
|
45
|
+
let unresolved = false;
|
|
46
|
+
const concrete = template.replace(exports.INTERPOLATION_PATTERN, (_match, rawPath) => {
|
|
47
|
+
const value = resolveCtxPath(rawPath, ctx);
|
|
48
|
+
if (typeof value === 'string' && value.trim().length > 0)
|
|
49
|
+
return value;
|
|
50
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
51
|
+
return String(value);
|
|
52
|
+
unresolved = true;
|
|
53
|
+
return '';
|
|
54
|
+
});
|
|
55
|
+
return unresolved ? null : concrete;
|
|
56
|
+
}
|
|
@@ -9,8 +9,10 @@ interface ChecklistItem {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Resolve a checklist widget's item definitions from its `x-lt-source`
|
|
12
|
-
* "domain.path" against the escalation context.
|
|
13
|
-
*
|
|
12
|
+
* "domain.path" against the escalation context. Paths may embed
|
|
13
|
+
* `{{domain.path}}` interpolation segments (cascading sources). Missing
|
|
14
|
+
* domain/path, an unresolved segment, or a non-array value yields an empty
|
|
15
|
+
* list.
|
|
14
16
|
*/
|
|
15
17
|
export declare function resolveChecklistItems(sourcePath: unknown, ctx: Record<string, unknown> | undefined): ChecklistItem[];
|
|
16
18
|
/**
|
|
@@ -6,26 +6,25 @@ exports.validateFieldType = validateFieldType;
|
|
|
6
6
|
exports.validateFieldConstraints = validateFieldConstraints;
|
|
7
7
|
exports.validateField = validateField;
|
|
8
8
|
const x_lt_options_1 = require("./x-lt-options");
|
|
9
|
+
const ctx_path_1 = require("./ctx-path");
|
|
9
10
|
/**
|
|
10
11
|
* Resolve a checklist widget's item definitions from its `x-lt-source`
|
|
11
|
-
* "domain.path" against the escalation context.
|
|
12
|
-
*
|
|
12
|
+
* "domain.path" against the escalation context. Paths may embed
|
|
13
|
+
* `{{domain.path}}` interpolation segments (cascading sources). Missing
|
|
14
|
+
* domain/path, an unresolved segment, or a non-array value yields an empty
|
|
15
|
+
* list.
|
|
13
16
|
*/
|
|
14
17
|
function resolveChecklistItems(sourcePath, ctx) {
|
|
15
18
|
if (typeof sourcePath !== 'string' || !ctx)
|
|
16
19
|
return [];
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (!domainObj || typeof domainObj !== 'object')
|
|
22
|
-
return [];
|
|
23
|
-
let cur = domainObj;
|
|
24
|
-
for (const p of sourcePath.slice(dot + 1).split('.')) {
|
|
25
|
-
cur = cur[p];
|
|
26
|
-
if (cur === undefined)
|
|
20
|
+
let concrete = sourcePath;
|
|
21
|
+
if ((0, ctx_path_1.hasInterpolation)(sourcePath)) {
|
|
22
|
+
const resolved = (0, ctx_path_1.interpolatePath)(sourcePath, ctx);
|
|
23
|
+
if (resolved === null)
|
|
27
24
|
return [];
|
|
25
|
+
concrete = resolved;
|
|
28
26
|
}
|
|
27
|
+
const cur = (0, ctx_path_1.resolveCtxPath)(concrete, ctx);
|
|
29
28
|
return Array.isArray(cur) ? cur : [];
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
@@ -97,12 +96,17 @@ function validateFieldConstraints(value, fieldSchema, ctx) {
|
|
|
97
96
|
return undefined;
|
|
98
97
|
// Option membership — the form's select widget constrains choices; API-first
|
|
99
98
|
// callers are unconstrained, so the effective option list is the contract:
|
|
100
|
-
// the static enum, or the x-lt-options list resolved from context.
|
|
99
|
+
// the static enum, or the x-lt-options list resolved from context. An
|
|
100
|
+
// interpolated list that currently offers nothing fails closed — a stale
|
|
101
|
+
// cascade child value never submits.
|
|
101
102
|
const allowed = (0, x_lt_options_1.resolveFieldOptions)(fieldSchema, ctx);
|
|
102
|
-
if (allowed &&
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
if (allowed !== undefined && value !== undefined && value !== null && value !== '') {
|
|
104
|
+
if (allowed.length === 0) {
|
|
105
|
+
return 'No valid options for this selection';
|
|
106
|
+
}
|
|
107
|
+
if (!allowed.includes(value)) {
|
|
108
|
+
return `Must be one of: ${allowed.map((v) => String(v)).join(', ')}`;
|
|
109
|
+
}
|
|
106
110
|
}
|
|
107
111
|
if (typeof value === 'string') {
|
|
108
112
|
const s = value.trim();
|
|
@@ -32,5 +32,6 @@ __exportStar(require("./x-lt-show-if"), exports);
|
|
|
32
32
|
__exportStar(require("./x-lt-require-any"), exports);
|
|
33
33
|
__exportStar(require("./x-lt-require-sum"), exports);
|
|
34
34
|
__exportStar(require("./x-lt-options"), exports);
|
|
35
|
+
__exportStar(require("./ctx-path"), exports);
|
|
35
36
|
__exportStar(require("./field-validator"), exports);
|
|
36
37
|
__exportStar(require("./validate-resolver-payload"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The token domains a help template may reference. */
|
|
2
|
-
export declare const HELP_DOMAINS: readonly ["escalation", "metadata", "envelope", "payload", "resolver"];
|
|
2
|
+
export declare const HELP_DOMAINS: readonly ["escalation", "metadata", "envelope", "payload", "resolver", "lookup"];
|
|
3
3
|
export type HelpDomain = (typeof HELP_DOMAINS)[number];
|
|
4
4
|
export type HelpTokenContext = Partial<Record<HelpDomain, Record<string, unknown> | null>>;
|
|
5
5
|
/** Replace every `{{domain.path}}` token with its value from the context. */
|
|
@@ -16,6 +16,7 @@ exports.defaultHelpMarkdown = defaultHelpMarkdown;
|
|
|
16
16
|
* {{envelope.formDefaults.customer.name}} — the workflow-sent input envelope
|
|
17
17
|
* {{payload.category}} — the escalation context payload
|
|
18
18
|
* {{resolver.notes}} — the submitted resolver payload
|
|
19
|
+
* {{lookup.materials.items}} — versioned knowledge lookups pinned on the row
|
|
19
20
|
*
|
|
20
21
|
* Paths reuse the x-lt-bind syntax (`a.b[0].c`). A missing value renders as an
|
|
21
22
|
* em dash. `x-lt-context` is accepted as the plain-text fallback source when
|
|
@@ -23,7 +24,7 @@ exports.defaultHelpMarkdown = defaultHelpMarkdown;
|
|
|
23
24
|
*/
|
|
24
25
|
const x_lt_bind_1 = require("./x-lt-bind");
|
|
25
26
|
/** The token domains a help template may reference. */
|
|
26
|
-
exports.HELP_DOMAINS = ['escalation', 'metadata', 'envelope', 'payload', 'resolver'];
|
|
27
|
+
exports.HELP_DOMAINS = ['escalation', 'metadata', 'envelope', 'payload', 'resolver', 'lookup'];
|
|
27
28
|
const TOKEN_PATTERN = /\{\{\s*([^{}]+?)\s*\}\}/g;
|
|
28
29
|
const MISSING_VALUE = '—';
|
|
29
30
|
function formatTokenValue(value) {
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* x-lt-options — a select's option list resolved from the escalation context.
|
|
3
|
-
* The field-level token names a `"domain.path"`; the value at that path is an
|
|
4
|
-
* array of scalars (strings or numbers) that becomes the field's option list,
|
|
5
|
-
* so one static role form can offer a different legal set per escalation
|
|
6
|
-
* (e.g. `[1..N]` where N rides the envelope).
|
|
7
|
-
*
|
|
8
|
-
* x-lt-options "domain.path" — e.g. "envelope.left_quantity_options"
|
|
9
|
-
*
|
|
10
|
-
* A static `enum` takes precedence when both are present — the same
|
|
11
|
-
* static-over-dynamic rule as x-lt-minimum/x-lt-maximum. A path that resolves
|
|
12
|
-
* to nothing, or to no scalar entries, yields no options: the field renders as
|
|
13
|
-
* a plain input for its type and membership is not enforced. Non-scalar
|
|
14
|
-
* entries in a resolved array are dropped.
|
|
15
|
-
*/
|
|
16
1
|
export declare const X_LT_OPTIONS = "x-lt-options";
|
|
17
2
|
export type OptionValue = string | number;
|
|
18
3
|
/**
|
|
19
4
|
* The field's effective option list: the static `enum` when present, else the
|
|
20
|
-
* scalars at the token's `"domain.path"`.
|
|
5
|
+
* scalars at the token's `"domain.path"`.
|
|
21
6
|
*/
|
|
22
7
|
export declare function resolveFieldOptions(fieldSchema: Record<string, unknown> | null | undefined, ctx: Record<string, unknown> | undefined): OptionValue[] | undefined;
|
|
@@ -1,26 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.X_LT_OPTIONS = void 0;
|
|
4
|
+
exports.resolveFieldOptions = resolveFieldOptions;
|
|
2
5
|
/**
|
|
3
6
|
* x-lt-options — a select's option list resolved from the escalation context.
|
|
4
7
|
* The field-level token names a `"domain.path"`; the value at that path is an
|
|
5
8
|
* array of scalars (strings or numbers) that becomes the field's option list,
|
|
6
9
|
* so one static role form can offer a different legal set per escalation
|
|
7
|
-
* (e.g. `[1..N]` where N rides the envelope
|
|
10
|
+
* (e.g. `[1..N]` where N rides the envelope, or a versioned knowledge lookup
|
|
11
|
+
* under the `lookup` domain).
|
|
8
12
|
*
|
|
9
13
|
* x-lt-options "domain.path" — e.g. "envelope.left_quantity_options"
|
|
14
|
+
* paths may embed {{domain.path}} interpolation segments —
|
|
15
|
+
* e.g. "lookup.geo.regions.{{resolver.country}}" — making
|
|
16
|
+
* the option list follow another answer (cascading selects)
|
|
10
17
|
*
|
|
11
18
|
* A static `enum` takes precedence when both are present — the same
|
|
12
|
-
* static-over-dynamic rule as x-lt-minimum/x-lt-maximum.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
19
|
+
* static-over-dynamic rule as x-lt-minimum/x-lt-maximum. Resolution is a
|
|
20
|
+
* tri-state:
|
|
21
|
+
*
|
|
22
|
+
* undefined — no dynamic contract: a plain path that resolves to nothing
|
|
23
|
+
* (the field renders as its plain input; membership unenforced)
|
|
24
|
+
* [] — a dynamic (interpolated) contract offering nothing YET: the
|
|
25
|
+
* select renders disabled and a present value fails membership
|
|
26
|
+
* values — the option list
|
|
27
|
+
*
|
|
28
|
+
* Non-scalar entries in a resolved array are dropped.
|
|
16
29
|
*/
|
|
17
|
-
|
|
18
|
-
exports.X_LT_OPTIONS = void 0;
|
|
19
|
-
exports.resolveFieldOptions = resolveFieldOptions;
|
|
30
|
+
const ctx_path_1 = require("./ctx-path");
|
|
20
31
|
exports.X_LT_OPTIONS = 'x-lt-options';
|
|
21
32
|
/**
|
|
22
33
|
* The field's effective option list: the static `enum` when present, else the
|
|
23
|
-
* scalars at the token's `"domain.path"`.
|
|
34
|
+
* scalars at the token's `"domain.path"`.
|
|
24
35
|
*/
|
|
25
36
|
function resolveFieldOptions(fieldSchema, ctx) {
|
|
26
37
|
if (!fieldSchema)
|
|
@@ -30,22 +41,23 @@ function resolveFieldOptions(fieldSchema, ctx) {
|
|
|
30
41
|
return staticEnum;
|
|
31
42
|
}
|
|
32
43
|
const sourcePath = fieldSchema[exports.X_LT_OPTIONS];
|
|
33
|
-
if (typeof sourcePath !== 'string'
|
|
34
|
-
return undefined;
|
|
35
|
-
const dot = sourcePath.indexOf('.');
|
|
36
|
-
if (dot === -1)
|
|
44
|
+
if (typeof sourcePath !== 'string')
|
|
37
45
|
return undefined;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
// Interpolated tokens are a standing contract: even unresolvable, the field
|
|
47
|
+
// stays a (disabled) select and fails closed. Plain paths keep the legacy
|
|
48
|
+
// undefined-on-miss reading.
|
|
49
|
+
const dynamic = (0, ctx_path_1.hasInterpolation)(sourcePath);
|
|
50
|
+
const miss = dynamic ? [] : undefined;
|
|
51
|
+
let concrete = sourcePath;
|
|
52
|
+
if (dynamic) {
|
|
53
|
+
const resolved = (0, ctx_path_1.interpolatePath)(sourcePath, ctx);
|
|
54
|
+
if (resolved === null)
|
|
55
|
+
return miss;
|
|
56
|
+
concrete = resolved;
|
|
46
57
|
}
|
|
58
|
+
const cur = (0, ctx_path_1.resolveCtxPath)(concrete, ctx);
|
|
47
59
|
if (!Array.isArray(cur))
|
|
48
|
-
return
|
|
60
|
+
return miss;
|
|
49
61
|
const scalars = cur.filter((v) => typeof v === 'string' || (typeof v === 'number' && Number.isFinite(v)));
|
|
50
|
-
return scalars.length > 0 ? scalars :
|
|
62
|
+
return scalars.length > 0 ? scalars : miss;
|
|
51
63
|
}
|
|
@@ -8,6 +8,7 @@ export declare function storeKnowledge(args: {
|
|
|
8
8
|
id: string;
|
|
9
9
|
domain: string;
|
|
10
10
|
key: string;
|
|
11
|
+
current_version: number;
|
|
11
12
|
created: boolean;
|
|
12
13
|
updated_at: string;
|
|
13
14
|
}>;
|
|
@@ -51,6 +52,7 @@ export declare function setKnowledgeField(args: {
|
|
|
51
52
|
id: string;
|
|
52
53
|
domain: string;
|
|
53
54
|
key: string;
|
|
55
|
+
current_version: number;
|
|
54
56
|
created: boolean;
|
|
55
57
|
updated_at: string;
|
|
56
58
|
}>;
|
|
@@ -77,5 +79,6 @@ export declare function appendKnowledge(args: {
|
|
|
77
79
|
id: string;
|
|
78
80
|
domain: string;
|
|
79
81
|
key: string;
|
|
82
|
+
current_version: number;
|
|
80
83
|
updated_at: string;
|
|
81
84
|
}>;
|
|
@@ -44,6 +44,7 @@ async function getKnowledge(args) {
|
|
|
44
44
|
key: row.key,
|
|
45
45
|
data: row.data,
|
|
46
46
|
tags: row.tags,
|
|
47
|
+
current_version: row.current_version,
|
|
47
48
|
created_at: row.created_at.toISOString(),
|
|
48
49
|
updated_at: row.updated_at.toISOString(),
|
|
49
50
|
};
|
|
@@ -66,13 +67,14 @@ async function searchKnowledge(args) {
|
|
|
66
67
|
const limitIdx = params.length;
|
|
67
68
|
params.push(offset);
|
|
68
69
|
const offsetIdx = params.length;
|
|
69
|
-
const { rows } = await client.query(`SELECT id, domain, key, data, tags, created_at, updated_at
|
|
70
|
+
const { rows } = await client.query(`SELECT id, domain, key, data, tags, current_version, created_at, updated_at
|
|
70
71
|
FROM lt_knowledge
|
|
71
72
|
WHERE domain = $1 AND data @> $2::jsonb${tagClause}
|
|
72
73
|
ORDER BY updated_at DESC LIMIT $${limitIdx} OFFSET $${offsetIdx}`, params);
|
|
73
74
|
return {
|
|
74
75
|
entries: rows.map((r) => ({
|
|
75
76
|
id: r.id, domain: r.domain, key: r.key, data: r.data, tags: r.tags,
|
|
77
|
+
current_version: r.current_version,
|
|
76
78
|
created_at: r.created_at.toISOString(), updated_at: r.updated_at.toISOString(),
|
|
77
79
|
})),
|
|
78
80
|
total: countResult.rows[0].total,
|
|
@@ -99,12 +101,13 @@ async function listKnowledge(args) {
|
|
|
99
101
|
const queryParams = [...params, limit, offset];
|
|
100
102
|
const limitIdx = params.length + 1;
|
|
101
103
|
const offsetIdx = params.length + 2;
|
|
102
|
-
const { rows } = await client.query(`SELECT id, domain, key, data, tags, created_at, updated_at
|
|
104
|
+
const { rows } = await client.query(`SELECT id, domain, key, data, tags, current_version, created_at, updated_at
|
|
103
105
|
FROM lt_knowledge WHERE domain = $1${extraClauses}
|
|
104
106
|
ORDER BY updated_at DESC LIMIT $${limitIdx} OFFSET $${offsetIdx}`, queryParams);
|
|
105
107
|
return {
|
|
106
108
|
entries: rows.map((r) => ({
|
|
107
109
|
id: r.id, domain: r.domain, key: r.key, data: r.data, tags: r.tags,
|
|
110
|
+
current_version: r.current_version,
|
|
108
111
|
created_at: r.created_at.toISOString(), updated_at: r.updated_at.toISOString(),
|
|
109
112
|
})),
|
|
110
113
|
total: countResult.rows[0].total,
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
export declare const UPSERT_KNOWLEDGE = "\n INSERT INTO lt_knowledge (domain, key, data, tags)\n
|
|
2
|
-
export declare const REPLACE_KNOWLEDGE = "\n INSERT INTO lt_knowledge (domain, key, data, tags)\n
|
|
3
|
-
export declare const GET_KNOWLEDGE = "\n SELECT id, domain, key, data, tags, created_at, updated_at\n FROM lt_knowledge WHERE domain = $1 AND key = $2";
|
|
4
|
-
export declare const SEARCH_KNOWLEDGE = "\n SELECT id, domain, key, data, tags, created_at, updated_at\n FROM lt_knowledge\n WHERE domain = $1 AND data @> $2::jsonb";
|
|
5
|
-
export declare const COUNT_KNOWLEDGE_SEARCH = "\n SELECT COUNT(*)::int AS total FROM lt_knowledge\n WHERE domain = $1 AND data @> $2::jsonb";
|
|
6
|
-
export declare const LIST_KNOWLEDGE = "\n SELECT id, domain, key, data, tags, created_at, updated_at\n FROM lt_knowledge WHERE domain = $1";
|
|
7
|
-
export declare const COUNT_KNOWLEDGE_LIST = "\n SELECT COUNT(*)::int AS total FROM lt_knowledge WHERE domain = $1";
|
|
1
|
+
export declare const UPSERT_KNOWLEDGE = "\n WITH upserted AS (\n INSERT INTO lt_knowledge (domain, key, data, tags)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (domain, key) DO UPDATE SET\n data = CASE\n WHEN jsonb_typeof(lt_knowledge.data) = 'object'\n THEN lt_knowledge.data || EXCLUDED.data\n ELSE EXCLUDED.data\n END,\n tags = ARRAY(SELECT DISTINCT unnest(lt_knowledge.tags || EXCLUDED.tags)),\n current_version = CASE\n WHEN (CASE\n WHEN jsonb_typeof(lt_knowledge.data) = 'object'\n THEN lt_knowledge.data || EXCLUDED.data\n ELSE EXCLUDED.data\n END) IS DISTINCT FROM lt_knowledge.data\n THEN lt_knowledge.current_version + 1\n ELSE lt_knowledge.current_version\n END\n RETURNING id, domain, key, data, tags, current_version, (xmax = 0) AS created, updated_at\n ), snapshot AS (\n INSERT INTO lt_knowledge_versions (domain, key, version, data, tags)\n SELECT domain, key, current_version, data, tags FROM upserted\n ON CONFLICT (domain, key, version) DO NOTHING\n )\n SELECT id, domain, key, current_version, created, updated_at FROM upserted";
|
|
2
|
+
export declare const REPLACE_KNOWLEDGE = "\n WITH upserted AS (\n INSERT INTO lt_knowledge (domain, key, data, tags)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (domain, key) DO UPDATE SET\n data = EXCLUDED.data,\n tags = EXCLUDED.tags,\n current_version = CASE\n WHEN EXCLUDED.data IS DISTINCT FROM lt_knowledge.data\n THEN lt_knowledge.current_version + 1\n ELSE lt_knowledge.current_version\n END\n RETURNING id, domain, key, data, tags, current_version, (xmax = 0) AS created, updated_at\n ), snapshot AS (\n INSERT INTO lt_knowledge_versions (domain, key, version, data, tags)\n SELECT domain, key, current_version, data, tags FROM upserted\n ON CONFLICT (domain, key, version) DO NOTHING\n )\n SELECT id, domain, key, current_version, created, updated_at FROM upserted";
|
|
3
|
+
export declare const GET_KNOWLEDGE = "\n SELECT id, domain, key, data, tags, current_version, created_at, updated_at\n FROM lt_knowledge WHERE domain = $1 AND key = $2";
|
|
8
4
|
export declare const DELETE_KNOWLEDGE = "\n DELETE FROM lt_knowledge WHERE domain = $1 AND key = $2";
|
|
9
5
|
export declare const LIST_DOMAINS = "\n SELECT domain, COUNT(*)::int AS count, MAX(updated_at) AS latest\n FROM lt_knowledge GROUP BY domain ORDER BY latest DESC";
|
|
10
|
-
export declare const SET_KNOWLEDGE_FIELD = "\n INSERT INTO lt_knowledge (domain, key, data, tags)\n
|
|
11
|
-
export declare const REMOVE_KNOWLEDGE_FIELD = "\n UPDATE lt_knowledge\n
|
|
12
|
-
export declare const APPEND_KNOWLEDGE = "\n INSERT INTO lt_knowledge (domain, key, data)\n
|
|
6
|
+
export declare const SET_KNOWLEDGE_FIELD = "\n WITH upserted AS (\n INSERT INTO lt_knowledge (domain, key, data, tags)\n VALUES ($1, $2, $3::jsonb, $4)\n ON CONFLICT (domain, key) DO UPDATE SET\n data = jsonb_set(lt_knowledge.data, $5::text[], $6::jsonb, true),\n tags = ARRAY(SELECT DISTINCT unnest(lt_knowledge.tags || EXCLUDED.tags)),\n current_version = CASE\n WHEN jsonb_set(lt_knowledge.data, $5::text[], $6::jsonb, true) IS DISTINCT FROM lt_knowledge.data\n THEN lt_knowledge.current_version + 1\n ELSE lt_knowledge.current_version\n END\n RETURNING id, domain, key, data, tags, current_version, (xmax = 0) AS created, updated_at\n ), snapshot AS (\n INSERT INTO lt_knowledge_versions (domain, key, version, data, tags)\n SELECT domain, key, current_version, data, tags FROM upserted\n ON CONFLICT (domain, key, version) DO NOTHING\n )\n SELECT id, domain, key, current_version, created, updated_at FROM upserted";
|
|
7
|
+
export declare const REMOVE_KNOWLEDGE_FIELD = "\n WITH updated AS (\n UPDATE lt_knowledge\n SET data = data #- $3::text[],\n current_version = CASE\n WHEN data #- $3::text[] IS DISTINCT FROM data\n THEN current_version + 1\n ELSE current_version\n END\n WHERE domain = $1 AND key = $2\n RETURNING id, domain, key, data, tags, current_version, updated_at\n ), snapshot AS (\n INSERT INTO lt_knowledge_versions (domain, key, version, data, tags)\n SELECT domain, key, current_version, data, tags FROM updated\n ON CONFLICT (domain, key, version) DO NOTHING\n )\n SELECT id, domain, key, current_version, updated_at FROM updated";
|
|
8
|
+
export declare const APPEND_KNOWLEDGE = "\n WITH upserted AS (\n INSERT INTO lt_knowledge (domain, key, data)\n VALUES ($1, $2, $3::jsonb)\n ON CONFLICT (domain, key) DO UPDATE SET\n data = CASE\n WHEN lt_knowledge.data #> $4::text[] IS NULL\n THEN jsonb_set(lt_knowledge.data, $4::text[], jsonb_build_array($5::jsonb))\n ELSE jsonb_set(lt_knowledge.data, $4::text[], (lt_knowledge.data #> $4::text[]) || jsonb_build_array($5::jsonb))\n END,\n current_version = lt_knowledge.current_version + 1\n RETURNING id, domain, key, data, tags, current_version, updated_at\n ), snapshot AS (\n INSERT INTO lt_knowledge_versions (domain, key, version, data, tags)\n SELECT domain, key, current_version, data, tags FROM upserted\n ON CONFLICT (domain, key, version) DO NOTHING\n )\n SELECT id, domain, key, current_version, updated_at FROM upserted";
|