@hotmeshio/long-tail 0.5.12 → 0.6.2
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 +1 -0
- package/build/api/escalations/bulk.js +9 -1
- package/build/api/escalations/cancel.js +5 -7
- package/build/api/escalations/claim.js +18 -15
- package/build/api/escalations/create.d.ts +6 -0
- package/build/api/escalations/create.js +11 -8
- package/build/api/escalations/facets.d.ts +18 -0
- package/build/api/escalations/facets.js +115 -0
- package/build/api/escalations/helpers.d.ts +70 -1
- package/build/api/escalations/helpers.js +101 -7
- package/build/api/escalations/index.d.ts +3 -2
- package/build/api/escalations/index.js +7 -1
- package/build/api/escalations/list.d.ts +21 -2
- package/build/api/escalations/list.js +109 -10
- package/build/api/escalations/metadata.js +22 -27
- package/build/api/escalations/resolve.d.ts +19 -1
- package/build/api/escalations/resolve.js +111 -26
- package/build/api/escalations/single.js +8 -8
- package/build/api/users.d.ts +6 -0
- package/build/api/users.js +29 -1
- package/build/bin/ltc.js +40 -0
- package/build/lib/cli/commands/escalations.d.ts +36 -0
- package/build/lib/cli/commands/escalations.js +98 -0
- package/build/lib/db/schemas/001_schema.sql +10 -5
- package/build/lib/db/schemas/012_lt_tasks_workflow_id_unique.sql +20 -0
- package/build/lib/db/schemas/013_role_scope.sql +37 -0
- package/build/modules/version.d.ts +10 -5
- package/build/modules/version.js +27 -11
- package/build/routes/escalations/facets.d.ts +7 -0
- package/build/routes/escalations/facets.js +81 -0
- package/build/routes/escalations/index.js +3 -0
- package/build/routes/escalations/list.js +46 -0
- package/build/routes/escalations/resolve.js +22 -4
- package/build/routes/users.js +9 -5
- package/build/sdk/index.d.ts +33 -2
- package/build/sdk/index.js +7 -0
- package/build/services/escalation/crud.d.ts +56 -6
- package/build/services/escalation/crud.js +102 -31
- package/build/services/escalation/facet-sql.d.ts +18 -0
- package/build/services/escalation/facet-sql.js +118 -0
- package/build/services/escalation/facets.d.ts +45 -0
- package/build/services/escalation/facets.js +218 -0
- package/build/services/escalation/index.d.ts +1 -0
- package/build/services/escalation/index.js +8 -1
- package/build/services/escalation/queries.d.ts +45 -0
- package/build/services/escalation/queries.js +107 -6
- package/build/services/escalation/sql.d.ts +10 -4
- package/build/services/escalation/sql.js +36 -8
- package/build/services/interceptor/activities/escalation.d.ts +2 -0
- package/build/services/interceptor/activities/escalation.js +1 -1
- package/build/services/interceptor/lifecycle.js +4 -0
- package/build/services/mcp/server-tools.js +10 -4
- package/build/services/orchestrator/condition.js +6 -2
- package/build/services/role/index.js +2 -3
- package/build/services/role/sql.d.ts +8 -0
- package/build/services/role/sql.js +17 -1
- package/build/services/task/crud.js +22 -14
- package/build/services/task/process.js +3 -21
- package/build/services/task/sql.d.ts +24 -1
- package/build/services/task/sql.js +65 -1
- package/build/services/user/crud.d.ts +1 -0
- package/build/services/user/crud.js +29 -11
- package/build/services/user/index.d.ts +2 -1
- package/build/services/user/index.js +12 -1
- package/build/services/user/rbac.d.ts +18 -0
- package/build/services/user/rbac.js +27 -0
- package/build/services/user/roles.d.ts +7 -2
- package/build/services/user/roles.js +21 -5
- package/build/services/user/scope.d.ts +22 -0
- package/build/services/user/scope.js +50 -0
- package/build/services/user/seed-admin.js +34 -17
- package/build/services/user/sql.d.ts +18 -7
- package/build/services/user/sql.js +38 -13
- package/build/services/user/sso-provision.js +41 -24
- package/build/services/user/types.d.ts +9 -5
- package/build/system/mcp-servers/admin/escalations.js +65 -0
- package/build/system/mcp-servers/admin/schemas.d.ts +325 -0
- package/build/system/mcp-servers/admin/schemas.js +63 -2
- package/build/system/mcp-servers/admin/users.js +28 -2
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/envelope.d.ts +7 -0
- package/build/types/facets.d.ts +60 -0
- package/build/types/facets.js +10 -0
- package/build/types/index.d.ts +2 -1
- package/build/types/user.d.ts +11 -0
- package/dashboard/dist/assets/AdminDashboard-C5gfVEeL.js +2 -0
- package/dashboard/dist/assets/{AdminDashboard-LTiYLuzq.js.map → AdminDashboard-C5gfVEeL.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-nlOudfpZ.js → AgentConfigPage-CWEnuiGN.js} +6 -6
- package/dashboard/dist/assets/{AgentConfigPage-nlOudfpZ.js.map → AgentConfigPage-CWEnuiGN.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-BSUnDvGp.js → AgentDetailPage-B6IE27iK.js} +3 -3
- package/dashboard/dist/assets/AgentDetailPage-B6IE27iK.js.map +1 -0
- package/dashboard/dist/assets/AgentsPage-Blhh2RsK.js +2 -0
- package/dashboard/dist/assets/{AgentsPage-DpS0cCYe.js.map → AgentsPage-Blhh2RsK.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-ClwAle76.js +2 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-ClwAle76.js.map +1 -0
- package/dashboard/dist/assets/{BotPicker-BhKmq7M7.js → BotPicker-DSozotGk.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-BhKmq7M7.js.map → BotPicker-DSozotGk.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-CrS_DTA1.js +2 -0
- package/dashboard/dist/assets/CapabilitiesPage-CrS_DTA1.js.map +1 -0
- package/dashboard/dist/assets/{CollapsibleSection-D7SVwNVk.js → CollapsibleSection-1i6bOQ1L.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-D7SVwNVk.js.map → CollapsibleSection-1i6bOQ1L.js.map} +1 -1
- package/dashboard/dist/assets/CopyableId-blg-gZvT.js +2 -0
- package/dashboard/dist/assets/CopyableId-blg-gZvT.js.map +1 -0
- package/dashboard/dist/assets/{CredentialsPage-fat5Z2U9.js → CredentialsPage-BxJio06E.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-fat5Z2U9.js.map → CredentialsPage-BxJio06E.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-OOP4P2mJ.js → CronLabel-BAfIHHz4.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-OOP4P2mJ.js.map → CronLabel-BAfIHHz4.js.map} +1 -1
- package/dashboard/dist/assets/{CustomDurationPicker-COacSAXO.js → CustomDurationPicker-BLF0NFJK.js} +2 -2
- package/dashboard/dist/assets/{CustomDurationPicker-COacSAXO.js.map → CustomDurationPicker-BLF0NFJK.js.map} +1 -1
- package/dashboard/dist/assets/{DataTable-D9yuBv0w.js → DataTable-ZWgVQg7F.js} +2 -2
- package/dashboard/dist/assets/DataTable-ZWgVQg7F.js.map +1 -0
- package/dashboard/dist/assets/{DropZone-Bfw2YLVS.js → DropZone-CEx_wk-g.js} +2 -2
- package/dashboard/dist/assets/{DropZone-Bfw2YLVS.js.map → DropZone-CEx_wk-g.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-CkfCD-m7.js → ElapsedCell-nKGJvznH.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-CkfCD-m7.js.map → ElapsedCell-nKGJvznH.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-BmI8jxlh.js → EscalationsOverview-bNNVA6R2.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-BmI8jxlh.js.map → EscalationsOverview-bNNVA6R2.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-CeKfFk3m.js → EventTable-BCuDdqlU.js} +2 -2
- package/dashboard/dist/assets/{EventTable-CeKfFk3m.js.map → EventTable-BCuDdqlU.js.map} +1 -1
- package/dashboard/dist/assets/FilterBar-BQ2JGg8U.js +2 -0
- package/dashboard/dist/assets/FilterBar-BQ2JGg8U.js.map +1 -0
- package/dashboard/dist/assets/GraphInvokePage-BPAvqHls.js +2 -0
- package/dashboard/dist/assets/GraphInvokePage-BPAvqHls.js.map +1 -0
- package/dashboard/dist/assets/HomePage-BZ1YTrjR.js +2 -0
- package/dashboard/dist/assets/HomePage-BZ1YTrjR.js.map +1 -0
- package/dashboard/dist/assets/{ListToolbar-BJaCzAXS.js → ListToolbar-DIJZfEgu.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-BJaCzAXS.js.map → ListToolbar-DIJZfEgu.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-CvnDG5OB.js → McpOverview-DCfSCfPg.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-CvnDG5OB.js.map → McpOverview-DCfSCfPg.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-DwmSIcIL.js → McpQueryDetailPage-mb7rmtNe.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-DwmSIcIL.js.map → McpQueryDetailPage-mb7rmtNe.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-CU6FMEEk.js → McpQueryPage-D9b1T0I3.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-CU6FMEEk.js.map → McpQueryPage-D9b1T0I3.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-8a6lsehv.js → McpRunDetailPage-Bz2UyuNm.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-8a6lsehv.js.map → McpRunDetailPage-Bz2UyuNm.js.map} +1 -1
- package/dashboard/dist/assets/McpRunsPage-Dw7w_ZO-.js +2 -0
- package/dashboard/dist/assets/McpRunsPage-Dw7w_ZO-.js.map +1 -0
- package/dashboard/dist/assets/{NamespacePill-D6btr6e8.js → NamespacePill-D27vqDXy.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-D6btr6e8.js.map → NamespacePill-D27vqDXy.js.map} +1 -1
- package/dashboard/dist/assets/OperatorDashboard-CTzSDW3N.js +2 -0
- package/dashboard/dist/assets/{OperatorDashboard-g9o7I925.js.map → OperatorDashboard-CTzSDW3N.js.map} +1 -1
- package/dashboard/dist/assets/PageHeader-B_1zTx2q.js +2 -0
- package/dashboard/dist/assets/PageHeader-B_1zTx2q.js.map +1 -0
- package/dashboard/dist/assets/{PageHeaderWithStats-DJQCZ0FR.js → PageHeaderWithStats-D-cPg7UD.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-DJQCZ0FR.js.map → PageHeaderWithStats-D-cPg7UD.js.map} +1 -1
- package/dashboard/dist/assets/PriorityBadge-B4ykBH7f.js +2 -0
- package/dashboard/dist/assets/PriorityBadge-B4ykBH7f.js.map +1 -0
- package/dashboard/dist/assets/{ProcessDetailPage-ByyWCs2A.js → ProcessDetailPage-olG2CS-h.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-ByyWCs2A.js.map → ProcessDetailPage-olG2CS-h.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-BTsXds4l.js → ProcessesListPage-CUZSL06Y.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-BTsXds4l.js.map → ProcessesListPage-CUZSL06Y.js.map} +1 -1
- package/dashboard/dist/assets/RolePill-B-V-31lC.js +2 -0
- package/dashboard/dist/assets/RolePill-B-V-31lC.js.map +1 -0
- package/dashboard/dist/assets/RolesPage-DLnaW6iD.js +2 -0
- package/dashboard/dist/assets/RolesPage-DLnaW6iD.js.map +1 -0
- package/dashboard/dist/assets/RowActions-BA9L9djf.js +2 -0
- package/dashboard/dist/assets/RowActions-BA9L9djf.js.map +1 -0
- package/dashboard/dist/assets/{RunAsSelector-BzkZXpSX.js → RunAsSelector-BoLHF4fy.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-BzkZXpSX.js.map → RunAsSelector-BoLHF4fy.js.map} +1 -1
- package/dashboard/dist/assets/StickyPagination-BEMY1L-H.js +2 -0
- package/dashboard/dist/assets/StickyPagination-BEMY1L-H.js.map +1 -0
- package/dashboard/dist/assets/{StreamMessageDetail-B6ch-6SY.js → StreamMessageDetail-CVRVWXcU.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-B6ch-6SY.js.map → StreamMessageDetail-CVRVWXcU.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-CjvfUkls.js → SwimlaneTimeline-DDpU0-Jn.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-CjvfUkls.js.map → SwimlaneTimeline-DDpU0-Jn.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-CZSeyesi.js → TagInput-BHVfG307.js} +2 -2
- package/dashboard/dist/assets/{TagInput-CZSeyesi.js.map → TagInput-BHVfG307.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-BjHU6opi.js → TaskDetailPage-B_xQtJMg.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-BjHU6opi.js.map → TaskDetailPage-B_xQtJMg.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-CQrXrSxk.js → TaskQueuePill-CGlxXqWt.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-CQrXrSxk.js.map → TaskQueuePill-CGlxXqWt.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-Bem44zd0.js → TasksListPage-CsrdIOKk.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-Bem44zd0.js.map → TasksListPage-CsrdIOKk.js.map} +1 -1
- package/dashboard/dist/assets/TimeAgo-DmicaxjT.js +2 -0
- package/dashboard/dist/assets/{TimeAgo-CUIYqSt_.js.map → TimeAgo-DmicaxjT.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell--tnreI1i.js → TimestampCell-DeK89eRV.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell--tnreI1i.js.map → TimestampCell-DeK89eRV.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-O09jsTQM.js → ToolPill-NV7PxSpA.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-O09jsTQM.js.map → ToolPill-NV7PxSpA.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-OD99H7Pk.js → ToolTestPanel-D3s2n9-9.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-OD99H7Pk.js.map → ToolTestPanel-D3s2n9-9.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-rh_dsTJI.js → TopicDetailPage-qyv7UWT_.js} +3 -3
- package/dashboard/dist/assets/TopicDetailPage-qyv7UWT_.js.map +1 -0
- package/dashboard/dist/assets/TopicsPage-CEUfMoed.js +2 -0
- package/dashboard/dist/assets/TopicsPage-CEUfMoed.js.map +1 -0
- package/dashboard/dist/assets/{UserName-C__c8BN0.js → UserName-Bn_BxI8K.js} +2 -2
- package/dashboard/dist/assets/{UserName-C__c8BN0.js.map → UserName-Bn_BxI8K.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-Bw6QdtUO.js → WorkflowExecutionPage-DAk2RqpB.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-Bw6QdtUO.js.map → WorkflowExecutionPage-DAk2RqpB.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill-CS-IsR0U.js → WorkflowPill-DDR0B6DN.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill-CS-IsR0U.js.map → WorkflowPill-DDR0B6DN.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowsDashboard-DfBgM80t.js +2 -0
- package/dashboard/dist/assets/WorkflowsDashboard-DfBgM80t.js.map +1 -0
- package/dashboard/dist/assets/{WorkflowsOverview-BRc0QbA7.js → WorkflowsOverview--Dkoo9Jq.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-BRc0QbA7.js.map → WorkflowsOverview--Dkoo9Jq.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DdzspNQR.js → YamlWorkflowDetailPage-B6HYbfFj.js} +25 -25
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-DdzspNQR.js.map → YamlWorkflowDetailPage-B6HYbfFj.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-Djw5ZbgQ.js → YamlWorkflowsPage-CJE-PxC0.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-Djw5ZbgQ.js.map → YamlWorkflowsPage-CJE-PxC0.js.map} +1 -1
- package/dashboard/dist/assets/{agents-xstNkF6c.js → agents-DUciUZpt.js} +2 -2
- package/dashboard/dist/assets/{agents-xstNkF6c.js.map → agents-DUciUZpt.js.map} +1 -1
- package/dashboard/dist/assets/{bots-BztAI0s_.js → bots-BnyqCfuC.js} +2 -2
- package/dashboard/dist/assets/{bots-BztAI0s_.js.map → bots-BnyqCfuC.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-CEDwtxNL.js → capabilities-CkTWWT0q.js} +2 -2
- package/dashboard/dist/assets/{capabilities-CEDwtxNL.js.map → capabilities-CkTWWT0q.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-BlGEsRKe.js → controlplane-D9HaFZsC.js} +2 -2
- package/dashboard/dist/assets/{controlplane-BlGEsRKe.js.map → controlplane-D9HaFZsC.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-iI4QKlP-.js → escalation-De9JnTKI.js} +2 -2
- package/dashboard/dist/assets/{escalation-iI4QKlP-.js.map → escalation-De9JnTKI.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-Df7Pluzg.js +2 -0
- package/dashboard/dist/assets/escalation-columns-Df7Pluzg.js.map +1 -0
- package/dashboard/dist/assets/index-7hqtQI43.js +2 -0
- package/dashboard/dist/assets/index-7hqtQI43.js.map +1 -0
- package/dashboard/dist/assets/{index-CAqEy2Db.js → index-B07xLlyz.js} +2 -2
- package/dashboard/dist/assets/{index-CAqEy2Db.js.map → index-B07xLlyz.js.map} +1 -1
- package/dashboard/dist/assets/{index-D1xVY4JR.js → index-B1kc6itM.js} +24 -24
- package/dashboard/dist/assets/index-B1kc6itM.js.map +1 -0
- package/dashboard/dist/assets/index-BAhkWcOq.js +9 -0
- package/dashboard/dist/assets/index-BAhkWcOq.js.map +1 -0
- package/dashboard/dist/assets/{index-Dsi5o7dx.js → index-BsIaUbKD.js} +2 -2
- package/dashboard/dist/assets/{index-Dsi5o7dx.js.map → index-BsIaUbKD.js.map} +1 -1
- package/dashboard/dist/assets/index-BxdiKgnH.js +6 -0
- package/dashboard/dist/assets/index-BxdiKgnH.js.map +1 -0
- package/dashboard/dist/assets/{index-B7VC0vjf.js → index-BzMsh6Ui.js} +2 -2
- package/dashboard/dist/assets/{index-B7VC0vjf.js.map → index-BzMsh6Ui.js.map} +1 -1
- package/dashboard/dist/assets/index-CN0efCE9.js +6 -0
- package/dashboard/dist/assets/index-CN0efCE9.js.map +1 -0
- package/dashboard/dist/assets/{index-B5qsp8lb.js → index-CgD9fA9P.js} +2 -2
- package/dashboard/dist/assets/{index-B5qsp8lb.js.map → index-CgD9fA9P.js.map} +1 -1
- package/dashboard/dist/assets/{index-CUfgt3mV.js → index-Cqjf-yVP.js} +2 -2
- package/dashboard/dist/assets/{index-CUfgt3mV.js.map → index-Cqjf-yVP.js.map} +1 -1
- package/dashboard/dist/assets/{index-DjJ6VCuc.js → index-DNugmBs7.js} +2 -2
- package/dashboard/dist/assets/{index-DjJ6VCuc.js.map → index-DNugmBs7.js.map} +1 -1
- package/dashboard/dist/assets/{index-BUmnJ4eT.js → index-DjxTV3cn.js} +2 -2
- package/dashboard/dist/assets/{index-BUmnJ4eT.js.map → index-DjxTV3cn.js.map} +1 -1
- package/dashboard/dist/assets/index-DpAS4-DA.js +2 -0
- package/dashboard/dist/assets/index-DpAS4-DA.js.map +1 -0
- package/dashboard/dist/assets/index-nO0cim3_.css +1 -0
- package/dashboard/dist/assets/{knowledge-BKg0cr39.js → knowledge-D4SvdNv5.js} +2 -2
- package/dashboard/dist/assets/{knowledge-BKg0cr39.js.map → knowledge-D4SvdNv5.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-CVdHpKlz.js → mcp-DVxt4T9J.js} +2 -2
- package/dashboard/dist/assets/{mcp-CVdHpKlz.js.map → mcp-DVxt4T9J.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-CYxZcbwQ.js → mcp-query-CLP9EnnU.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-CYxZcbwQ.js.map → mcp-query-CLP9EnnU.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-BOEv7P6O.js → pipelines-C_x0LTBN.js} +2 -2
- package/dashboard/dist/assets/{pipelines-BOEv7P6O.js.map → pipelines-C_x0LTBN.js.map} +1 -1
- package/dashboard/dist/assets/{roles-c5cV2QYQ.js → roles-QaGFZQ58.js} +2 -2
- package/dashboard/dist/assets/{roles-c5cV2QYQ.js.map → roles-QaGFZQ58.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-JV3BjeEF.js → tasks-1eTuP02d.js} +2 -2
- package/dashboard/dist/assets/{tasks-JV3BjeEF.js.map → tasks-1eTuP02d.js.map} +1 -1
- package/dashboard/dist/assets/{topics-BDaPnhnQ.js → topics-B3p8K0PW.js} +2 -2
- package/dashboard/dist/assets/{topics-BDaPnhnQ.js.map → topics-B3p8K0PW.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-a7Dnh8G4.js → useEventHooks-BNZky4xM.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-a7Dnh8G4.js.map → useEventHooks-BNZky4xM.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-BSwEV0e9.js → useNamespace-Dx81_JM0.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-BSwEV0e9.js.map → useNamespace-Dx81_JM0.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-BuqvL-cn.js → useYamlActivityEvents-D5T3TbE7.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-BuqvL-cn.js.map → useYamlActivityEvents-D5T3TbE7.js.map} +1 -1
- package/dashboard/dist/assets/users-BEMysNdR.js +2 -0
- package/dashboard/dist/assets/users-BEMysNdR.js.map +1 -0
- package/dashboard/dist/assets/{vendor-icons-D5ycKPA2.js → vendor-icons--Ivmp-RX.js} +132 -112
- package/dashboard/dist/assets/vendor-icons--Ivmp-RX.js.map +1 -0
- package/dashboard/dist/assets/{workflows-DF-9Voyi.js → workflows-C4rjvQbI.js} +2 -2
- package/dashboard/dist/assets/{workflows-DF-9Voyi.js.map → workflows-C4rjvQbI.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-2roKaSSK.js → yaml-workflows-4rJ5v5rJ.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-2roKaSSK.js.map → yaml-workflows-4rJ5v5rJ.js.map} +1 -1
- package/dashboard/dist/index.html +3 -3
- package/docs/api/http/escalations.md +131 -10
- package/docs/api/http/roles.md +44 -9
- package/docs/api/http/users.md +15 -6
- package/docs/api/mcp/admin.md +8 -2
- package/docs/api/mcp/human-queue.md +34 -2
- package/docs/api/sdk/escalations.md +155 -2
- package/docs/api/sdk/roles.md +11 -0
- package/docs/api/sdk/users.md +26 -1
- package/docs/auth.md +1 -1
- package/docs/dashboard.md +5 -4
- package/docs/data.md +9 -2
- package/docs/faceted-routing.md +221 -0
- package/docs/hitl-guide.md +50 -0
- package/docs/iam.md +31 -0
- package/docs/mcp.md +8 -0
- package/package.json +2 -2
- package/dashboard/dist/assets/AdminDashboard-LTiYLuzq.js +0 -2
- package/dashboard/dist/assets/AgentDetailPage-BSUnDvGp.js.map +0 -1
- package/dashboard/dist/assets/AgentsPage-DpS0cCYe.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-BEylRqjP.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-BEylRqjP.js.map +0 -1
- package/dashboard/dist/assets/CapabilitiesPage-DLIleX2L.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-DLIleX2L.js.map +0 -1
- package/dashboard/dist/assets/CopyableId-DaT0ZRHg.js +0 -2
- package/dashboard/dist/assets/CopyableId-DaT0ZRHg.js.map +0 -1
- package/dashboard/dist/assets/DataTable-D9yuBv0w.js.map +0 -1
- package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js +0 -2
- package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js.map +0 -1
- package/dashboard/dist/assets/GraphInvokePage-BZBPBCSq.js +0 -2
- package/dashboard/dist/assets/GraphInvokePage-BZBPBCSq.js.map +0 -1
- package/dashboard/dist/assets/HomePage-dM7U2tl6.js +0 -2
- package/dashboard/dist/assets/HomePage-dM7U2tl6.js.map +0 -1
- package/dashboard/dist/assets/McpRunsPage-CPMYWgm_.js +0 -2
- package/dashboard/dist/assets/McpRunsPage-CPMYWgm_.js.map +0 -1
- package/dashboard/dist/assets/OperatorDashboard-g9o7I925.js +0 -2
- package/dashboard/dist/assets/PageHeader-Dk2Pe44Q.js +0 -2
- package/dashboard/dist/assets/PageHeader-Dk2Pe44Q.js.map +0 -1
- package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js +0 -2
- package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js.map +0 -1
- package/dashboard/dist/assets/RolePill-Du-aNnjR.js +0 -2
- package/dashboard/dist/assets/RolePill-Du-aNnjR.js.map +0 -1
- package/dashboard/dist/assets/RolesPage-B2Kdf-L9.js +0 -2
- package/dashboard/dist/assets/RolesPage-B2Kdf-L9.js.map +0 -1
- package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js +0 -2
- package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js.map +0 -1
- package/dashboard/dist/assets/StickyPagination-BWhFSr2d.js +0 -2
- package/dashboard/dist/assets/StickyPagination-BWhFSr2d.js.map +0 -1
- package/dashboard/dist/assets/TimeAgo-CUIYqSt_.js +0 -2
- package/dashboard/dist/assets/TopicDetailPage-rh_dsTJI.js.map +0 -1
- package/dashboard/dist/assets/TopicsPage-CD_40_v-.js +0 -2
- package/dashboard/dist/assets/TopicsPage-CD_40_v-.js.map +0 -1
- package/dashboard/dist/assets/WorkflowsDashboard-BgI-iOP6.js +0 -2
- package/dashboard/dist/assets/WorkflowsDashboard-BgI-iOP6.js.map +0 -1
- package/dashboard/dist/assets/escalation-columns-nVYVt7Gl.js +0 -2
- package/dashboard/dist/assets/escalation-columns-nVYVt7Gl.js.map +0 -1
- package/dashboard/dist/assets/index-CMviPjXQ.js +0 -9
- package/dashboard/dist/assets/index-CMviPjXQ.js.map +0 -1
- package/dashboard/dist/assets/index-CP0JEQhZ.js +0 -6
- package/dashboard/dist/assets/index-CP0JEQhZ.js.map +0 -1
- package/dashboard/dist/assets/index-ClvYSNZd.css +0 -1
- package/dashboard/dist/assets/index-D1xVY4JR.js.map +0 -1
- package/dashboard/dist/assets/index-DPLy-jwO.js +0 -2
- package/dashboard/dist/assets/index-DPLy-jwO.js.map +0 -1
- package/dashboard/dist/assets/index-DzVYjoex.js +0 -6
- package/dashboard/dist/assets/index-DzVYjoex.js.map +0 -1
- package/dashboard/dist/assets/index-FuhiJuHL.js +0 -2
- package/dashboard/dist/assets/index-FuhiJuHL.js.map +0 -1
- package/dashboard/dist/assets/users-Pn85K_3C.js +0 -2
- package/dashboard/dist/assets/users-Pn85K_3C.js.map +0 -1
- package/dashboard/dist/assets/vendor-icons-D5ycKPA2.js.map +0 -1
|
@@ -16,6 +16,16 @@ Claiming is implicit: `assigned_to` is set and `assigned_until` is set to a futu
|
|
|
16
16
|
|
|
17
17
|
`cancelled` is a terminal state. A cancelled escalation cannot be claimed, resolved, or re-cancelled. When a workflow is terminated (`POST /api/workflows/:workflowId/terminate`), HotMesh automatically cancels any pending escalations tied to that workflow. Escalations can also be cancelled directly via `POST /api/escalations/:id/cancel`.
|
|
18
18
|
|
|
19
|
+
## Work-Surface Scope
|
|
20
|
+
|
|
21
|
+
A role is a task queue with four verbs — **search** (list/get), **claim**, **ack** (resolve), **delete** (cancel). A `member`'s grant carries `read_scope` (`self` | `all`) and `write_scope` (`none` | `self` | `all`) that set the breadth of those verbs on a given role's escalations. `admin` and `superadmin` ignore scope and act on the whole queue.
|
|
22
|
+
|
|
23
|
+
- `read_scope` governs which escalations a member **sees** — list, `/available`, get-by-id, find-by-metadata, and stats. `self` means escalations assigned to the member (`assigned_to = user`); `all` means the whole role queue.
|
|
24
|
+
- `write_scope` governs which escalations a member may **act on** — claim, resolve, cancel. `self` means only items already assigned to them; `none` is read-only.
|
|
25
|
+
- Releasing and escalating are queue-management verbs and require `write_scope=all`. Creating a standalone escalation (`POST /api/escalations`) requires `write_scope=all` or global escalation access.
|
|
26
|
+
|
|
27
|
+
Defaults are `read_scope=all` and `write_scope=all` — the full-queue worker — so a plain `member` works the whole queue. See [Work-Surface Scope](roles.md#work-surface-scope) in the Roles API for the five member profiles and the **write ⊆ read** constraint.
|
|
28
|
+
|
|
19
29
|
## List escalations
|
|
20
30
|
|
|
21
31
|
```
|
|
@@ -31,9 +41,34 @@ GET /api/escalations
|
|
|
31
41
|
| `type` | `string` | Filter by escalation type |
|
|
32
42
|
| `subtype` | `string` | Filter by subtype |
|
|
33
43
|
| `assigned_to` | `string` | Filter by claimer's user ID |
|
|
44
|
+
| `priority` | `integer` | Filter by priority (1–4) |
|
|
45
|
+
| `search` | `string` | Free-text across description/type/role/ids/metadata values (server-side) |
|
|
46
|
+
| `sort_by` / `order` | `string` | Single-column sort + direction (`asc`/`desc`) |
|
|
34
47
|
| `limit` | `integer` | Max results (default: 50) |
|
|
35
48
|
| `offset` | `integer` | Pagination offset (default: 0) |
|
|
36
49
|
|
|
50
|
+
**Faceted query parameters** (JSON-encoded — a "facet" is a key/value *inside* the row's
|
|
51
|
+
`metadata` JSONB; the filter and count run in SQL, role-scoped):
|
|
52
|
+
|
|
53
|
+
| Parameter | JSON shape | Description |
|
|
54
|
+
|-----------|-----------|-------------|
|
|
55
|
+
| `facets` | object | Required facets — `metadata @> facets`. `{"flags":"too_short"}` ≡ `metadata.flags == "too_short"` for a top-level scalar (containment for nested/arrays) |
|
|
56
|
+
| `block` | array of objects | Exclude rows containing ANY set — `NOT (metadata @> ANY(block))` |
|
|
57
|
+
| `range` | array of `{facet, op, value}` | Numeric range, op ∈ `< <= > >= =`, e.g. `[{"facet":"confidence","op":"<=","value":0.7}]` |
|
|
58
|
+
| `exists` | array of strings | Keys that must be present — `metadata ? key` |
|
|
59
|
+
| `roles` | array of strings | Restrict to these roles (narrows within scope, never widens) |
|
|
60
|
+
| `available` | `true`/`false` | `true` = unclaimed/expired only; `false` = held now |
|
|
61
|
+
| `orderBy` | array of `{field, direction?, numeric?}` | Sort by column or `metadata.<key>` |
|
|
62
|
+
|
|
63
|
+
When any faceted parameter is present the request runs through the scoped faceted query.
|
|
64
|
+
Example (URL-encode the JSON values):
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
GET /api/escalations?status=pending&facets={"flags":"too_short"}&range=[{"facet":"confidence","op":"<=","value":0.7}]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
See [Faceted Routing — the human / operations query](../../faceted-routing.md#the-human--operations-query).
|
|
71
|
+
|
|
37
72
|
**Response 200:**
|
|
38
73
|
|
|
39
74
|
```json
|
|
@@ -108,6 +143,8 @@ GET /api/escalations/:id
|
|
|
108
143
|
|-----------|-------------|
|
|
109
144
|
| `id` | Escalation UUID |
|
|
110
145
|
|
|
146
|
+
**Scope:** Enforces read scope. A `member` with `read_scope=self` sees only escalations assigned to them; an item outside their read surface returns 404.
|
|
147
|
+
|
|
111
148
|
**Response 200:** A single escalation object.
|
|
112
149
|
|
|
113
150
|
**Response 404:**
|
|
@@ -126,6 +163,8 @@ Locks the escalation so no other reviewer can pick it up. The lock is time-boxed
|
|
|
126
163
|
|
|
127
164
|
The `userId` is read from the auth token (`req.auth.userId`), not from the request body.
|
|
128
165
|
|
|
166
|
+
**Scope:** Governed by write scope. A `member` with `write_scope=self` may claim only items already assigned to them; `write_scope=none` cannot claim.
|
|
167
|
+
|
|
129
168
|
**Request body:**
|
|
130
169
|
|
|
131
170
|
| Field | Type | Default | Description |
|
|
@@ -156,11 +195,14 @@ POST /api/escalations/:id/resolve
|
|
|
156
195
|
|
|
157
196
|
Resolving an escalation starts a new workflow execution with the resolver's payload injected into `envelope.resolver`. The workflow re-runs, hits the `if (envelope.resolver)` branch, and completes with the human's decision as the final result.
|
|
158
197
|
|
|
198
|
+
**Scope:** Governed by write scope (resolve is the **ack** verb). A `member` with `write_scope=self` may resolve only items assigned to them; `write_scope=none` cannot resolve.
|
|
199
|
+
|
|
159
200
|
**Request body:**
|
|
160
201
|
|
|
161
202
|
| Field | Type | Required | Description |
|
|
162
203
|
|-------|------|----------|-------------|
|
|
163
204
|
| `resolverPayload` | `object` | yes | The reviewer's decision — injected into `envelope.resolver` |
|
|
205
|
+
| `metadata` | `object` | no | Outcome facets merged into the escalation's GIN-indexed metadata. Records *what happened* (disposition, timing) next to *what was asked*; `@>`-queryable. Distinct from `resolverPayload`, which resumes the workflow and is not indexed |
|
|
164
206
|
|
|
165
207
|
**Example request:**
|
|
166
208
|
|
|
@@ -169,6 +211,11 @@ Resolving an escalation starts a new workflow execution with the resolver's payl
|
|
|
169
211
|
"resolverPayload": {
|
|
170
212
|
"approved": true,
|
|
171
213
|
"notes": "Content is fine, AI was overly cautious"
|
|
214
|
+
},
|
|
215
|
+
"metadata": {
|
|
216
|
+
"outcome": "approved",
|
|
217
|
+
"reviewedBy": "alice",
|
|
218
|
+
"durationMs": 1240
|
|
172
219
|
}
|
|
173
220
|
}
|
|
174
221
|
```
|
|
@@ -239,6 +286,7 @@ For callers that know the deterministic signal id (webhooks — e.g. `signal-sca
|
|
|
239
286
|
|-------|------|----------|-------------|
|
|
240
287
|
| `signalKey` | `string` | yes | The signal id passed to `conditionLT(signalId, config)` |
|
|
241
288
|
| `resolverPayload` | `object` | yes | The decision payload delivered to the waiting workflow |
|
|
289
|
+
| `metadata` | `object` | no | Outcome facets merged into the row's GIN-indexed metadata (see [Resolve an escalation](#resolve-an-escalation)) |
|
|
242
290
|
|
|
243
291
|
Returns `404` when the key is unknown, `409` when the escalation is already terminal, and `200 { signaled: true }` on success. RBAC-scoped to the caller's visible roles.
|
|
244
292
|
|
|
@@ -377,7 +425,7 @@ Returns distinct escalation type values across all escalations.
|
|
|
377
425
|
GET /api/escalations/stats
|
|
378
426
|
```
|
|
379
427
|
|
|
380
|
-
Aggregated escalation statistics. RBAC-scoped: superadmins see all; others see only their roles.
|
|
428
|
+
Aggregated escalation statistics. RBAC-scoped: superadmins see all; others see only their roles. The aggregate reflects `read_all` memberships only — a member's `read_scope=self` items are not aggregated here, since self-scope members get the single-item surface rather than a queue dashboard.
|
|
381
429
|
|
|
382
430
|
**Query parameters:**
|
|
383
431
|
|
|
@@ -573,7 +621,7 @@ Resolve multiple escalations and start AI triage workflows (mcpTriage) for each.
|
|
|
573
621
|
PATCH /api/escalations/:id/escalate
|
|
574
622
|
```
|
|
575
623
|
|
|
576
|
-
Reassign a single escalation to a different role. The caller must be authorized to escalate from the current role to the target role (checked via escalation chains).
|
|
624
|
+
Reassign a single escalation to a different role. The caller must be authorized to escalate from the current role to the target role (checked via escalation chains). Escalating is a queue-management verb and requires `write_scope=all` for a `member`.
|
|
577
625
|
|
|
578
626
|
**Path parameters:**
|
|
579
627
|
|
|
@@ -723,7 +771,7 @@ Cancel multiple escalations at once. Skips any that are already terminal.
|
|
|
723
771
|
POST /api/escalations/:id/release
|
|
724
772
|
```
|
|
725
773
|
|
|
726
|
-
Release a claimed escalation back to the available pool. Only the user who holds the current claim can release it.
|
|
774
|
+
Release a claimed escalation back to the available pool. Only the user who holds the current claim can release it. Releasing is a queue-management verb and requires `write_scope=all` for a `member`.
|
|
727
775
|
|
|
728
776
|
**Path parameters:**
|
|
729
777
|
|
|
@@ -790,6 +838,8 @@ All three endpoints accept an optional `assignee` field — an `external_id` fro
|
|
|
790
838
|
GET /api/escalations/by-metadata?key=orderId&value=order-123
|
|
791
839
|
```
|
|
792
840
|
|
|
841
|
+
Scoped to the caller's read access. A `member` with `read_scope=self` matches only escalations assigned to them.
|
|
842
|
+
|
|
793
843
|
| Parameter | Type | Description |
|
|
794
844
|
|-----------|------|-------------|
|
|
795
845
|
| `key` | `string` | **Required.** Metadata field name |
|
|
@@ -815,6 +865,8 @@ POST /api/escalations/claim-by-metadata
|
|
|
815
865
|
|
|
816
866
|
Finds one available (pending + unassigned/expired) escalation matching the metadata and claims it atomically.
|
|
817
867
|
|
|
868
|
+
**Scope:** For non-global callers this is scoped to `write_scope=all` roles. Self-scope members are excluded here — their items are pre-claimed and resolved by id, not discovered through the queue.
|
|
869
|
+
|
|
818
870
|
**Body:**
|
|
819
871
|
|
|
820
872
|
```json
|
|
@@ -835,22 +887,22 @@ Finds one available (pending + unassigned/expired) escalation matching the metad
|
|
|
835
887
|
| `metadata` | `object` | Additional metadata to merge (new keys added, existing overwritten) |
|
|
836
888
|
| `provisionIfAbsent` | `object` | JIT-provision the assignee if they don't exist (superadmin only) |
|
|
837
889
|
|
|
838
|
-
**`provisionIfAbsent`** — when the `assignee` doesn't exist in `lt_users` or lacks the escalation's role, provision them inline:
|
|
890
|
+
**`provisionIfAbsent`** — when the `assignee` doesn't exist in `lt_users` or lacks the escalation's role, provision them inline. Each role entry accepts optional `read_scope` and `write_scope`, so a global caller can JIT-provision a one-time user with `read_scope=self` + `write_scope=self` and pre-claim their item in the same call:
|
|
839
891
|
|
|
840
892
|
```json
|
|
841
893
|
{
|
|
842
894
|
"key": "orderId",
|
|
843
895
|
"value": "order-123",
|
|
844
|
-
"assignee": "
|
|
896
|
+
"assignee": "new-user",
|
|
845
897
|
"provisionIfAbsent": {
|
|
846
|
-
"displayName": "
|
|
847
|
-
"email": "
|
|
848
|
-
"roles": [{ "role": "
|
|
898
|
+
"displayName": "New User",
|
|
899
|
+
"email": "new-user@example.com",
|
|
900
|
+
"roles": [{ "role": "operator", "type": "member", "read_scope": "self", "write_scope": "self" }]
|
|
849
901
|
}
|
|
850
902
|
}
|
|
851
903
|
```
|
|
852
904
|
|
|
853
|
-
Only callers with global escalation access (superadmin, admin/admin) can use this flag. The user is created with the declared roles if absent. If the user exists but lacks a required role, the role is added. The happy path (user exists, has role) adds zero extra queries.
|
|
905
|
+
Only callers with global escalation access (superadmin, admin/admin) can use this flag. The user is created with the declared roles if absent. If the user exists but lacks a required role, the role is added. The happy path (user exists, has role) adds zero extra queries. A user provisioned at `read_self` + `write_self` sees and acts on exactly the one item the workflow routed to them.
|
|
854
906
|
|
|
855
907
|
**Response 200:**
|
|
856
908
|
|
|
@@ -869,7 +921,7 @@ Only callers with global escalation access (superadmin, admin/admin) can use thi
|
|
|
869
921
|
POST /api/escalations/resolve-by-metadata
|
|
870
922
|
```
|
|
871
923
|
|
|
872
|
-
Single atomic query finds the pending escalation by metadata, auto-claims if unclaimed, and resolves it. RBAC is enforced in the SQL WHERE clause.
|
|
924
|
+
Single atomic query finds the pending escalation by metadata, auto-claims if unclaimed, and resolves it. RBAC is enforced in the SQL WHERE clause. Write scope is honored here: a `member` with `write_scope=self` may resolve their own assigned item atomically, which is how a one-time user completes the form routed to them.
|
|
873
925
|
|
|
874
926
|
**Signal guard:** If the escalation has `metadata.signal_id` (created by `conditionLT`), the SQL does NOT resolve it directly. Instead, the endpoint signals the running workflow — `conditionLT` receives the signal and resolves the escalation durably inside the workflow. This preserves the same transactional integrity as the standard resolve-by-ID path.
|
|
875
927
|
|
|
@@ -909,3 +961,72 @@ Single atomic query finds the pending escalation by metadata, auto-claims if unc
|
|
|
909
961
|
"workflowId": "..."
|
|
910
962
|
}
|
|
911
963
|
```
|
|
964
|
+
|
|
965
|
+
## Resolve a set of escalations
|
|
966
|
+
|
|
967
|
+
```
|
|
968
|
+
POST /api/escalations/resolve-by-ids
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
Resolve many escalations in one guarded statement — the set-based sibling of `POST /:id/resolve`. Used for bookkeeping rows that are woken collectively (it does not deliver a per-row signal). RBAC: a scoped caller may only resolve rows whose role they hold (global principals are unrestricted).
|
|
972
|
+
|
|
973
|
+
| Field | Type | Required | Description |
|
|
974
|
+
|-------|------|----------|-------------|
|
|
975
|
+
| `ids` | `string[]` | yes | Escalation ids to resolve as one set |
|
|
976
|
+
| `resolverPayload` | `object` | yes | Payload applied to every row |
|
|
977
|
+
| `metadata` | `object` | no | Outcome patch merged into each row's GIN-indexed metadata |
|
|
978
|
+
|
|
979
|
+
**Response 200:** `{ "resolved": <count>, "escalationIds": [...] }` — only the rows that were still `pending` are resolved and returned.
|
|
980
|
+
|
|
981
|
+
## Faceted search
|
|
982
|
+
|
|
983
|
+
```
|
|
984
|
+
POST /api/escalations/search-by-facets
|
|
985
|
+
```
|
|
986
|
+
|
|
987
|
+
Item-level faceted search over a single pond `role`, scoped to the caller's role. The body is a faceted query.
|
|
988
|
+
|
|
989
|
+
| Field | Type | Required | Description |
|
|
990
|
+
|-------|------|----------|-------------|
|
|
991
|
+
| `role` | `string` | yes | Pond role to search |
|
|
992
|
+
| `status` | `string` | no | e.g. `pending` |
|
|
993
|
+
| `available` | `boolean` | no | Only rows not currently claimed |
|
|
994
|
+
| `facets` | `object` | no | Metadata facet equality filters |
|
|
995
|
+
| `orderBy` | `{ column, direction }[]` | no | Sort order |
|
|
996
|
+
| `limit` / `offset` | `integer` | no | Paging |
|
|
997
|
+
|
|
998
|
+
**Response 200:** `{ "escalations": [...], "total": <n> }`.
|
|
999
|
+
|
|
1000
|
+
## Claim groups
|
|
1001
|
+
|
|
1002
|
+
```
|
|
1003
|
+
POST /api/escalations/claim-groups
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
Batch-claim complete origin groups (e.g. all units of an order) in priority order over a pond, assigned to the caller. RBAC-scoped to the pond role.
|
|
1007
|
+
|
|
1008
|
+
| Field | Type | Required | Description |
|
|
1009
|
+
|-------|------|----------|-------------|
|
|
1010
|
+
| `query` | FacetQuery | yes | The pond/facet selector (see search-by-facets) |
|
|
1011
|
+
| `limit` | `integer` | no | Max groups to claim |
|
|
1012
|
+
| `durationMinutes` | `integer` | no | Claim TTL |
|
|
1013
|
+
| `sizeFacet` | `string` | no | Metadata key holding the group size |
|
|
1014
|
+
|
|
1015
|
+
**Response 200:** `{ "groups": [...] }`.
|
|
1016
|
+
|
|
1017
|
+
## Claim by facets
|
|
1018
|
+
|
|
1019
|
+
```
|
|
1020
|
+
POST /api/escalations/claim-by-facets
|
|
1021
|
+
```
|
|
1022
|
+
|
|
1023
|
+
Batch-claim individual rows matching a facet query (`FOR UPDATE SKIP LOCKED`), assigned to the caller. With `allOrNone`, commits only when the full `limit` is acquired. RBAC-scoped to the pond role.
|
|
1024
|
+
|
|
1025
|
+
| Field | Type | Required | Description |
|
|
1026
|
+
|-------|------|----------|-------------|
|
|
1027
|
+
| `query` | FacetQuery | yes | The pond/facet selector |
|
|
1028
|
+
| `limit` | `integer` | no | Max rows to claim |
|
|
1029
|
+
| `durationMinutes` | `integer` | no | Claim TTL |
|
|
1030
|
+
| `allOrNone` | `boolean` | no | Commit only if the full set was acquired |
|
|
1031
|
+
|
|
1032
|
+
**Response 200:** `{ "claimed": [...] }`.
|
package/docs/api/http/roles.md
CHANGED
|
@@ -6,16 +6,41 @@ Role management endpoints are nested under `/api/users/:id/roles`. All endpoints
|
|
|
6
6
|
|
|
7
7
|
## Role Types
|
|
8
8
|
|
|
9
|
-
Every role assignment has a `type` that controls management permissions.
|
|
9
|
+
Every role assignment has a `type` that controls management permissions.
|
|
10
10
|
|
|
11
11
|
| Type | Permissions |
|
|
12
12
|
|------|-------------|
|
|
13
|
-
| `member` |
|
|
14
|
-
| `admin` | Everything a member can do, plus manage users within this role |
|
|
13
|
+
| `member` | Work the role's task queue at the breadth set by its work-surface scope (see below) |
|
|
14
|
+
| `admin` | Everything a member can do on the whole queue, plus manage users within this role |
|
|
15
15
|
| `superadmin` | Full access — manage all roles, all users, system configuration |
|
|
16
16
|
|
|
17
17
|
A user can hold multiple roles with different types. For example, a user might be a `member` of `reviewer` and an `admin` of `senior-reviewer`.
|
|
18
18
|
|
|
19
|
+
## Work-Surface Scope
|
|
20
|
+
|
|
21
|
+
A role is a task queue with four verbs — **search**, **claim**, **ack** (resolve), **delete** (cancel). A `member` carries two orthogonal scope axes that set the breadth of those verbs. `admin` and `superadmin` ignore scope and always act on the whole queue.
|
|
22
|
+
|
|
23
|
+
| Axis | Values | Governs |
|
|
24
|
+
|------|--------|---------|
|
|
25
|
+
| `read_scope` | `self`, `all` | **search** — which escalations the member sees |
|
|
26
|
+
| `write_scope` | `none`, `self`, `all` | **claim / ack / delete** — which escalations the member may act on |
|
|
27
|
+
|
|
28
|
+
`self` means escalations assigned to the member (`assigned_to = user`); `all` means the whole role queue. The only constraint is **write ⊆ read** — you cannot act on what you cannot see — so `write_scope=all` requires `read_scope=all`. Both default to `all`, which is the full-queue worker.
|
|
29
|
+
|
|
30
|
+
The five member profiles:
|
|
31
|
+
|
|
32
|
+
| read_scope | write_scope | Profile |
|
|
33
|
+
|-----------|------------|---------|
|
|
34
|
+
| `all` | `all` | Full worker — search and act on the whole queue (default) |
|
|
35
|
+
| `all` | `self` | See the whole queue, act only on own items (e.g. a chat-style room) |
|
|
36
|
+
| `self` | `self` | Own items only — a one-time user filling in their pre-assigned form |
|
|
37
|
+
| `all` | `none` | Read-only observer / auditor of the queue |
|
|
38
|
+
| `self` | `none` | Read-only view of one's own items |
|
|
39
|
+
|
|
40
|
+
Releasing and escalating are queue-management verbs (they move an item out of the member's hands) and require `write_scope=all`; creating a standalone escalation likewise requires `write_scope=all`. A member with `write_scope=self` may only claim/ack/delete items already assigned to them.
|
|
41
|
+
|
|
42
|
+
This makes one-time and limited-surface users first-class: a workflow can assign an escalation to a named person (pre-claim) and provision them as `read_self` + `write_self`, and they see and act on exactly that one item — no access to the rest of the queue, no table, just the JIT form the workflow routed to them.
|
|
43
|
+
|
|
19
44
|
## Special Roles
|
|
20
45
|
|
|
21
46
|
Three role names have fixed types and elevated permissions:
|
|
@@ -26,7 +51,7 @@ Three role names have fixed types and elevated permissions:
|
|
|
26
51
|
| `engineer` | `admin` | Full (builder) | Engineer role only | Assign users to `engineer` role |
|
|
27
52
|
| `admin` | `admin` | Escalations + user management | All roles — role filter ignored | Assign users to any non-special role. Bulk actions on all escalations |
|
|
28
53
|
|
|
29
|
-
All other role names are dynamic. A dynamic role can have type `member` (
|
|
54
|
+
All other role names are dynamic. A dynamic role can have type `member` (work the queue at its read/write scope) or `admin` (whole-queue access plus manage users within that role and bulk actions).
|
|
30
55
|
|
|
31
56
|
## Dashboard Access
|
|
32
57
|
|
|
@@ -36,9 +61,9 @@ The dashboard adapts to the authenticated user's access tier:
|
|
|
36
61
|
|------|-----------|------|
|
|
37
62
|
| **Builder** | `superadmin` or `engineer` role | Full dashboard: workflows, pipelines, MCP, design, storage, admin, all home page sections |
|
|
38
63
|
| **Operations** | Any role with `admin` type | Home page (escalations only), escalation pages, user/role management (scoped to their roles) |
|
|
39
|
-
| **Operator** | Any role with `member` type | Home page (escalations only), escalation pages |
|
|
64
|
+
| **Operator** | Any role with `member` type | Home page (escalations only), escalation pages — scoped to the member's read scope |
|
|
40
65
|
|
|
41
|
-
Bulk escalation actions (bulk claim, assign, triage, escalate) require `admin` or `superadmin` type. Plain `member` users work on escalations one at a time.
|
|
66
|
+
Bulk escalation actions (bulk claim, assign, triage, escalate) require `admin` or `superadmin` type. Plain `member` users work on escalations one at a time. A member whose read scope is `self` lands directly on their own item in user mode — the queue list and aggregate stats reflect only `read_all` memberships.
|
|
42
67
|
|
|
43
68
|
## API Access by Tier
|
|
44
69
|
|
|
@@ -62,6 +87,8 @@ When assigning roles via `POST /api/users/:id/roles`, the caller's own roles det
|
|
|
62
87
|
| `engineer` | Any role up to `admin` type (never `superadmin` type) |
|
|
63
88
|
| `*/admin` (non-builder) | `member` or `admin` type for roles they themselves hold |
|
|
64
89
|
|
|
90
|
+
A caller who may assign a role may set any work-surface scope (`read_scope`/`write_scope`) on it. Scope is a refinement of a `member` grant; it is ignored for `admin`/`superadmin`, which always act on the whole queue.
|
|
91
|
+
|
|
65
92
|
## List roles for a user
|
|
66
93
|
|
|
67
94
|
```
|
|
@@ -113,11 +140,13 @@ POST /api/users/:id/roles
|
|
|
113
140
|
|-------|------|----------|-------------|
|
|
114
141
|
| `role` | `string` | yes | Role name (e.g., `reviewer`) |
|
|
115
142
|
| `type` | `string` | yes | `superadmin`, `admin`, or `member` |
|
|
143
|
+
| `read_scope` | `string` | no | `self` or `all` (default `all`). Search breadth for a `member`; ignored for admin/superadmin |
|
|
144
|
+
| `write_scope` | `string` | no | `none`, `self`, or `all` (default `all`). Claim/ack/delete breadth for a `member` |
|
|
116
145
|
|
|
117
|
-
**Example request
|
|
146
|
+
**Example request** — a one-time user who works only their own assigned item:
|
|
118
147
|
|
|
119
148
|
```json
|
|
120
|
-
{ "role": "
|
|
149
|
+
{ "role": "customer-triage", "type": "member", "read_scope": "self", "write_scope": "self" }
|
|
121
150
|
```
|
|
122
151
|
|
|
123
152
|
**Response 201:**
|
|
@@ -125,8 +154,10 @@ POST /api/users/:id/roles
|
|
|
125
154
|
```json
|
|
126
155
|
{
|
|
127
156
|
"user_id": "b2c3d4e5-...",
|
|
128
|
-
"role": "
|
|
157
|
+
"role": "customer-triage",
|
|
129
158
|
"type": "member",
|
|
159
|
+
"read_scope": "self",
|
|
160
|
+
"write_scope": "self",
|
|
130
161
|
"created_at": "2025-01-15T12:00:00.000Z"
|
|
131
162
|
}
|
|
132
163
|
```
|
|
@@ -141,6 +172,10 @@ POST /api/users/:id/roles
|
|
|
141
172
|
{ "error": "type must be superadmin, admin, or member" }
|
|
142
173
|
```
|
|
143
174
|
|
|
175
|
+
```json
|
|
176
|
+
{ "error": "write_scope=all requires read_scope=all (cannot act on what you cannot see)" }
|
|
177
|
+
```
|
|
178
|
+
|
|
144
179
|
A user can hold each role at most once. The primary key is `(user_id, role)`. Adding a role that already exists will return an error.
|
|
145
180
|
|
|
146
181
|
## Remove role from user
|
package/docs/api/http/users.md
CHANGED
|
@@ -41,8 +41,8 @@ GET /api/users?role=reviewer&status=active&limit=10
|
|
|
41
41
|
"created_at": "2025-01-10T08:00:00.000Z",
|
|
42
42
|
"updated_at": "2025-01-10T08:00:00.000Z",
|
|
43
43
|
"roles": [
|
|
44
|
-
{ "user_id": "b2c3d4e5-...", "role": "reviewer", "type": "member", "created_at": "2025-01-10T08:00:00.000Z" },
|
|
45
|
-
{ "user_id": "b2c3d4e5-...", "role": "senior-reviewer", "type": "admin", "created_at": "2025-01-10T08:00:00.000Z" }
|
|
44
|
+
{ "user_id": "b2c3d4e5-...", "role": "reviewer", "type": "member", "read_scope": "all", "write_scope": "all", "created_at": "2025-01-10T08:00:00.000Z" },
|
|
45
|
+
{ "user_id": "b2c3d4e5-...", "role": "senior-reviewer", "type": "admin", "read_scope": "all", "write_scope": "all", "created_at": "2025-01-10T08:00:00.000Z" }
|
|
46
46
|
]
|
|
47
47
|
}
|
|
48
48
|
],
|
|
@@ -92,22 +92,27 @@ Each element in `roles`:
|
|
|
92
92
|
|-------|------|----------|-------------|
|
|
93
93
|
| `role` | `string` | yes | Role name |
|
|
94
94
|
| `type` | `string` | yes | `superadmin`, `admin`, or `member` |
|
|
95
|
+
| `read_scope` | `string` | no | `self` or `all` (default `all`). Search breadth for a `member`; ignored for admin/superadmin |
|
|
96
|
+
| `write_scope` | `string` | no | `none`, `self`, or `all` (default `all`). Claim/ack/delete breadth for a `member` |
|
|
97
|
+
|
|
98
|
+
`read_scope` and `write_scope` set the work-surface scope of a `member` grant — how much of the role's queue the user can see and act on. Both default to `all` (the full-queue worker), so a `member` written without scope works the whole queue. The constraint is **write ⊆ read**: `write_scope=all` requires `read_scope=all`. See the [Work-Surface Scope](roles.md#work-surface-scope) section of the Roles API for the five member profiles.
|
|
95
99
|
|
|
96
100
|
**Example request:**
|
|
97
101
|
|
|
98
102
|
```json
|
|
99
103
|
{
|
|
100
|
-
"external_id": "
|
|
101
|
-
"email": "
|
|
102
|
-
"display_name": "
|
|
104
|
+
"external_id": "new-user",
|
|
105
|
+
"email": "new-user@example.com",
|
|
106
|
+
"display_name": "New User",
|
|
103
107
|
"roles": [
|
|
104
108
|
{ "role": "reviewer", "type": "member" },
|
|
109
|
+
{ "role": "customer-triage", "type": "member", "read_scope": "self", "write_scope": "self" },
|
|
105
110
|
{ "role": "senior-reviewer", "type": "admin" }
|
|
106
111
|
]
|
|
107
112
|
}
|
|
108
113
|
```
|
|
109
114
|
|
|
110
|
-
**Response 201:** The created user object with roles array.
|
|
115
|
+
**Response 201:** The created user object with roles array. Each returned role object includes its `read_scope` and `write_scope`.
|
|
111
116
|
|
|
112
117
|
**Response 400:**
|
|
113
118
|
|
|
@@ -119,6 +124,10 @@ Each element in `roles`:
|
|
|
119
124
|
{ "error": "Each role must have a role name and type (superadmin, admin, member)" }
|
|
120
125
|
```
|
|
121
126
|
|
|
127
|
+
```json
|
|
128
|
+
{ "error": "write_scope=all requires read_scope=all" }
|
|
129
|
+
```
|
|
130
|
+
|
|
122
131
|
**Response 409:**
|
|
123
132
|
|
|
124
133
|
```json
|
package/docs/api/mcp/admin.md
CHANGED
|
@@ -54,6 +54,8 @@ Get all tasks and escalations for a process (origin_id).
|
|
|
54
54
|
|
|
55
55
|
## Escalations
|
|
56
56
|
|
|
57
|
+
Escalations belong to a role's queue. Which of them a person sees and acts on is set by their work-surface scope: a role membership carries a `type` (`member`, `admin`, or `superadmin`) plus `read_scope` (`self` | `all`) — which escalations a member sees — and `write_scope` (`none` | `self` | `all`) — which they may claim, resolve, or cancel — with write ⊆ read. `read_self`/`write_self` narrows a member to items assigned to them (`assigned_to = user`); an `admin` or `superadmin` acts on the whole queue. The tools below operate at whole-queue breadth and need a role permitted to act on the target (see [Access](#access) above). The `assigned_to` filter on `find_escalations` pairs with this model — it narrows results to one user's items, the same surface a `read_self` member sees. Defaults are `all`/`all`. See the [Roles API](../http/roles.md) for the full scope model.
|
|
58
|
+
|
|
57
59
|
### find_escalations
|
|
58
60
|
|
|
59
61
|
Search escalations with optional filters and sorting. Returns full records
|
|
@@ -659,11 +661,13 @@ Create a new user account with optional roles.
|
|
|
659
661
|
| external_id | string | Yes | External identifier |
|
|
660
662
|
| display_name | string | No | Display name |
|
|
661
663
|
| email | string | No | Email address |
|
|
662
|
-
| roles | object[] | No | Roles array (each: role
|
|
664
|
+
| roles | object[] | No | Roles array (each: `role`, `type`: superadmin/admin/member, optional `read_scope`, `write_scope`) |
|
|
665
|
+
|
|
666
|
+
Each role entry may carry a member work-surface scope: `read_scope` (`self` \| `all`, default `all`) and `write_scope` (`none` \| `self` \| `all`, default `all`), with write ⊆ read. This is how a one-time user is provisioned — e.g. `{ "role": "customer-triage", "type": "member", "read_scope": "self", "write_scope": "self" }` for someone who only handles their own pre-assigned escalation.
|
|
663
667
|
|
|
664
668
|
### add_user_role
|
|
665
669
|
|
|
666
|
-
Assign a role to a user.
|
|
670
|
+
Assign a role to a user. For a `member`, optional scope narrows the work surface.
|
|
667
671
|
|
|
668
672
|
| | |
|
|
669
673
|
|---|---|
|
|
@@ -676,6 +680,8 @@ Assign a role to a user.
|
|
|
676
680
|
| user_id | string | Yes | User ID |
|
|
677
681
|
| role | string | Yes | Role name |
|
|
678
682
|
| type | string | Yes | Role type: superadmin, admin, or member |
|
|
683
|
+
| read_scope | string | No | Member search breadth: `self` or `all` (default `all`) |
|
|
684
|
+
| write_scope | string | No | Member claim/ack/delete breadth: `none`, `self`, or `all` (default `all`) |
|
|
679
685
|
|
|
680
686
|
### remove_user_role
|
|
681
687
|
|
|
@@ -65,7 +65,7 @@ List available escalations for a role. Returns pending, unassigned escalations.
|
|
|
65
65
|
|
|
66
66
|
### claim_and_resolve
|
|
67
67
|
|
|
68
|
-
Claim an escalation and immediately resolve it with a payload. Atomic operation.
|
|
68
|
+
Claim an escalation and immediately resolve it with a payload. Atomic operation. A read/write service account uses this to close out work and record the outcome in one call.
|
|
69
69
|
|
|
70
70
|
| | |
|
|
71
71
|
|---|---|
|
|
@@ -77,7 +77,24 @@ Claim an escalation and immediately resolve it with a payload. Atomic operation.
|
|
|
77
77
|
|-------|------|----------|-------------|
|
|
78
78
|
| escalation_id | string | Yes | The escalation ID to claim and resolve |
|
|
79
79
|
| resolver_id | string | Yes | Identifier for who/what is resolving |
|
|
80
|
-
| payload | object | Yes | Resolution payload data |
|
|
80
|
+
| payload | object | Yes | Resolution payload data — resumes the waiting workflow |
|
|
81
|
+
| metadata | object | No | Outcome facets merged into the escalation's metadata: the durable, `@>`-queryable record of what happened (disposition, reviewer, timing). Distinct from `payload`, which is not indexed |
|
|
82
|
+
|
|
83
|
+
### resolve_escalation
|
|
84
|
+
|
|
85
|
+
Resolve an already-claimed escalation with a payload. Use when the claim happened externally (e.g. via API).
|
|
86
|
+
|
|
87
|
+
| | |
|
|
88
|
+
|---|---|
|
|
89
|
+
| Read-safe | No |
|
|
90
|
+
|
|
91
|
+
**Parameters:**
|
|
92
|
+
|
|
93
|
+
| Field | Type | Required | Description |
|
|
94
|
+
|-------|------|----------|-------------|
|
|
95
|
+
| escalation_id | string | Yes | The escalation ID to resolve |
|
|
96
|
+
| payload | object | Yes | Resolution payload data — resumes the waiting workflow |
|
|
97
|
+
| metadata | object | No | Outcome facets merged into the escalation's metadata (see `claim_and_resolve`) |
|
|
81
98
|
|
|
82
99
|
### escalate_and_wait
|
|
83
100
|
|
|
@@ -99,3 +116,18 @@ Create an escalation and pause the workflow until a human responds. Returns a si
|
|
|
99
116
|
| type | string | No | Escalation type classification (default: "mcp") |
|
|
100
117
|
| subtype | string | No | Escalation subtype (default: "wait_for_human") |
|
|
101
118
|
| priority | number | No | Priority: 1 (highest) to 4 (lowest) (default: 1) |
|
|
119
|
+
|
|
120
|
+
## Scope and One-Time Users
|
|
121
|
+
|
|
122
|
+
Escalations created by these tools land in the target role's queue. Each member of that role sees and acts on them according to their work-surface scope — two axes carried by the role membership alongside its `type` (`member`, `admin`, or `superadmin`):
|
|
123
|
+
|
|
124
|
+
- `read_scope` (`self` | `all`) governs which escalations a member sees. `read_all` shows the whole role queue; `read_self` shows only items assigned to the member (`assigned_to = user`).
|
|
125
|
+
- `write_scope` (`none` | `self` | `all`) governs which a member may claim and resolve. `write_self` acts only on the member's own assigned items; `write_all` acts on the whole queue. The constraint is write ⊆ read — you cannot act on what you cannot see.
|
|
126
|
+
|
|
127
|
+
An `admin` or `superadmin` member ignores scope and always acts on the whole queue. The defaults are `all`/`all` — the full-queue worker.
|
|
128
|
+
|
|
129
|
+
`get_available_work` lists pending, unassigned escalations for a role: the shared pool that whole-queue (`write_all`) workers pull from. A `write_self` member does not draw from this pool — their item is pre-assigned to them.
|
|
130
|
+
|
|
131
|
+
### The one-time-user pattern
|
|
132
|
+
|
|
133
|
+
To route a single escalation to a named person, set `assigned_to` when creating it — the `assigned_to` field on `escalate_and_wait` pre-claims the item for that user — and provision that person as a `member` of the role with `read_self` + `write_self`. The result is a scoped single-item surface: they see and act on exactly that one escalation, with no access to the rest of the queue. The scoped membership is provisioned through the platform's user and escalation APIs (see the [Roles API](../http/roles.md)); these MCP tools supply the `assigned_to` pre-claim.
|