@hotmeshio/long-tail 0.21.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/escalations/accumulate.d.ts +8 -0
- package/build/api/escalations/accumulate.js +25 -0
- package/build/api/escalations/index.d.ts +1 -1
- package/build/api/escalations/index.js +2 -1
- package/build/api/scan-codes/context.d.ts +14 -1
- package/build/api/scan-codes/context.js +30 -2
- package/build/api/scan-codes/identity.js +1 -0
- package/build/api/scan-codes/verbs.d.ts +9 -3
- package/build/api/scan-codes/verbs.js +77 -23
- package/build/index.d.ts +2 -1
- package/build/index.js +3 -2
- package/build/routes/escalations/accumulate.js +8 -0
- package/build/sdk/index.d.ts +3 -0
- package/build/sdk/index.js +1 -0
- package/build/services/scan-code/index.d.ts +1 -1
- package/build/services/scan-code/index.js +3 -1
- package/build/services/scan-code/parse.d.ts +17 -3
- package/build/services/scan-code/parse.js +37 -4
- package/build/services/scan-code/validate.js +19 -0
- package/build/system/mcp-servers/admin/escalations.js +6 -1
- package/build/system/mcp-servers/admin/schemas.d.ts +6 -3
- package/build/system/mcp-servers/admin/schemas.js +2 -1
- package/build/system/seed/tool-manifests-admin.d.ts +189 -0
- package/build/system/seed/tool-manifests-admin.js +1 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/index.js +2 -1
- package/build/types/scan-code.d.ts +31 -1
- package/build/types/scan-code.js +20 -2
- package/dashboard/dist/assets/{AdminDashboard-uarpHB88.js → AdminDashboard-Covdam48.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-uarpHB88.js.map → AdminDashboard-Covdam48.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-BcUaDD5E.js → AgentConfigPage-CE1k6J5r.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-BcUaDD5E.js.map → AgentConfigPage-CE1k6J5r.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-BaZBhK6i.js → AgentDetailPage-CWJZIZP1.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-BaZBhK6i.js.map → AgentDetailPage-CWJZIZP1.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-CuVFSDc4.js → AgentsPage---Dg5ufF.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-CuVFSDc4.js.map → AgentsPage---Dg5ufF.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-iO5NyyIK.js → AvailableEscalationsPage-CpbC8oTN.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-iO5NyyIK.js.map → AvailableEscalationsPage-CpbC8oTN.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-CClMby6B.js → BotPicker-D3drO3-T.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-CClMby6B.js.map → BotPicker-D3drO3-T.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-BL8FRgkN.js → BulkAssignModal-BOAWsViq.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-BL8FRgkN.js.map → BulkAssignModal-BOAWsViq.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-D53ogPor.js → CapabilitiesPage-RGgD3YZO.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-D53ogPor.js.map → CapabilitiesPage-RGgD3YZO.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-ow8jpbtD.js → CollapsibleSection-DNkZn87n.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-ow8jpbtD.js.map → CollapsibleSection-DNkZn87n.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-CeEDt9iJ.js → ConfirmDeleteModal-BqzOwhPr.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-CeEDt9iJ.js.map → ConfirmDeleteModal-BqzOwhPr.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-CSqyZMCG.js → CountdownTimer-BaexQMK6.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-CSqyZMCG.js.map → CountdownTimer-BaexQMK6.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-Dx7SxA23.js → CredentialsPage-D7abp0aS.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-Dx7SxA23.js.map → CredentialsPage-D7abp0aS.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-LYPxpvNN.js → CronLabel-DZiWmTwJ.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-LYPxpvNN.js.map → CronLabel-DZiWmTwJ.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-BZJTSm9N.js → ElapsedCell-BdGO_w4v.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-BZJTSm9N.js.map → ElapsedCell-BdGO_w4v.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-0wIIW2en.js → EntityTimelinePanel-DIDcF5Yu.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-0wIIW2en.js.map → EntityTimelinePanel-DIDcF5Yu.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-CoYvtMzj.js → EscalationListSchemaPage-C28rn9XC.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-CoYvtMzj.js.map → EscalationListSchemaPage-C28rn9XC.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListView-DWFHPufv.js → EscalationListView-CkBnkpDJ.js} +2 -2
- package/dashboard/dist/assets/{EscalationListView-DWFHPufv.js.map → EscalationListView-CkBnkpDJ.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-C9Xu_A25.js → EscalationSchemaPage-W5r0A1kj.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-C9Xu_A25.js.map → EscalationSchemaPage-W5r0A1kj.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTimeline-D8W2LNNk.js → EscalationTimeline-DKyTz6sM.js} +2 -2
- package/dashboard/dist/assets/{EscalationTimeline-D8W2LNNk.js.map → EscalationTimeline-DKyTz6sM.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTitleSelect-DLK8NWMp.js → EscalationTitleSelect-CzKfavri.js} +2 -2
- package/dashboard/dist/assets/{EscalationTitleSelect-DLK8NWMp.js.map → EscalationTitleSelect-CzKfavri.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-CW57FaP9.js → EscalationsOverview-Tdu3Yx2c.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-CW57FaP9.js.map → EscalationsOverview-Tdu3Yx2c.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-D1ctWhKf.js → EventTable-DiIxOJwO.js} +2 -2
- package/dashboard/dist/assets/{EventTable-D1ctWhKf.js.map → EventTable-DiIxOJwO.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-C-iur-Nj.js → FilterBar-CvMBCVIo.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-C-iur-Nj.js.map → FilterBar-CvMBCVIo.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-CcA_44M4.js → GraphInvokePage-DO-yyhi6.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-CcA_44M4.js.map → GraphInvokePage-DO-yyhi6.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-Dc085ghJ.js → HomePage-DSS3eHR2.js} +2 -2
- package/dashboard/dist/assets/{HomePage-Dc085ghJ.js.map → HomePage-DSS3eHR2.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-h_ziBt4O.js → ListToolbar-C3-Tqqub.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-h_ziBt4O.js.map → ListToolbar-C3-Tqqub.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-qXXhbNWV.js → McpOverview-DEJmsdVi.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-qXXhbNWV.js.map → McpOverview-DEJmsdVi.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-SEzSbZrd.js → McpQueryDetailPage-DYJr16l7.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-SEzSbZrd.js.map → McpQueryDetailPage-DYJr16l7.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-Cy0V0kv9.js → McpQueryPage-BBcG_UuU.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-Cy0V0kv9.js.map → McpQueryPage-BBcG_UuU.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-DjJO5vSb.js → McpRunDetailPage-C6xw0kBg.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-DjJO5vSb.js.map → McpRunDetailPage-C6xw0kBg.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-BfjiJ8mM.js → McpRunsPage-CRQqrF4Q.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-BfjiJ8mM.js.map → McpRunsPage-CRQqrF4Q.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-dJcER0T_.js → OperationsPage-Dlfwzf-0.js} +2 -2
- package/dashboard/dist/assets/{OperationsPage-dJcER0T_.js.map → OperationsPage-Dlfwzf-0.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-zCkW4eqk.js → OperatorDashboard-DoiDGZ9R.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-zCkW4eqk.js.map → OperatorDashboard-DoiDGZ9R.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-Cx6L3Jvu.js → PersonaDetailPage-BzbA4Prr.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-Cx6L3Jvu.js.map → PersonaDetailPage-BzbA4Prr.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-DOgGUlJl.js → PersonasPage-B36yn4hU.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-DOgGUlJl.js.map → PersonasPage-B36yn4hU.js.map} +1 -1
- package/dashboard/dist/assets/{PortalPage-BKuL1BeJ.js → PortalPage-BkD4YfDf.js} +2 -2
- package/dashboard/dist/assets/{PortalPage-BKuL1BeJ.js.map → PortalPage-BkD4YfDf.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-BFcFSDUv.js → ProcessDetailPage-BT0eiBWY.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-BFcFSDUv.js.map → ProcessDetailPage-BT0eiBWY.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-BaHV2cXp.js → ProcessesListPage-BEqeeNae.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-BaHV2cXp.js.map → ProcessesListPage-BEqeeNae.js.map} +1 -1
- package/dashboard/dist/assets/{ResolverForm-Bgc0Zrya.js → ResolverForm-BwgjIX97.js} +2 -2
- package/dashboard/dist/assets/{ResolverForm-Bgc0Zrya.js.map → ResolverForm-BwgjIX97.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-BPY6i3CU.js → RoleDetailPage-BFuLNJXa.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-BPY6i3CU.js.map → RoleDetailPage-BFuLNJXa.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-DSqqKPbv.js → RolesPage-80quJU5-.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-DSqqKPbv.js.map → RolesPage-80quJU5-.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-B29iWwel.js → RunAsSelector-BoePhWVD.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-B29iWwel.js.map → RunAsSelector-BoePhWVD.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-S8aAJfnC.js → ScanCodesPage-Cu1bKEix.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-S8aAJfnC.js.map → ScanCodesPage-Cu1bKEix.js.map} +1 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-D9AbS6UY.js +2 -0
- package/dashboard/dist/assets/ScanSchemeDetailPage-D9AbS6UY.js.map +1 -0
- package/dashboard/dist/assets/{ScanStationPage-R9t1-CeQ.js → ScanStationPage-gcZGefvT.js} +2 -2
- package/dashboard/dist/assets/{ScanStationPage-R9t1-CeQ.js.map → ScanStationPage-gcZGefvT.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-CkW_A507.js → StickyPagination-9ITrei_d.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-CkW_A507.js.map → StickyPagination-9ITrei_d.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-yzWX0wac.js → StreamMessageDetail-BkYvEHFY.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-yzWX0wac.js.map → StreamMessageDetail-BkYvEHFY.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-Cf4DXFxj.js → SwimlaneTimeline-B1rotFix.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-Cf4DXFxj.js.map → SwimlaneTimeline-B1rotFix.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-DCDcEps9.js → TaskDetailPage-zhn_U_eC.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-DCDcEps9.js.map → TaskDetailPage-zhn_U_eC.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-BBATgpf7.js → TasksListPage-CNbNeagx.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-BBATgpf7.js.map → TasksListPage-CNbNeagx.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-CSNVEjch.js → TimeAgo-0YVMBwls.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-CSNVEjch.js.map → TimeAgo-0YVMBwls.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-Du1nBrPn.js → TimestampCell-DB7r3np8.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-Du1nBrPn.js.map → TimestampCell-DB7r3np8.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-CF-h_5Rg.js → ToolTestPanel-BLfA02wv.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-CF-h_5Rg.js.map → ToolTestPanel-BLfA02wv.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-Dr1UmWcp.js → TopicDetailPage-eAqPKShq.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-Dr1UmWcp.js.map → TopicDetailPage-eAqPKShq.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-CUUo-Ylf.js → TopicsPage-BNNWD-zl.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-CUUo-Ylf.js.map → TopicsPage-BNNWD-zl.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-kBh1dc39.js → UserName-Pw46tO_k.js} +2 -2
- package/dashboard/dist/assets/{UserName-kBh1dc39.js.map → UserName-Pw46tO_k.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-CCRSbnDx.js → WorkflowExecutionPage-DvA51lT3.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-CCRSbnDx.js.map → WorkflowExecutionPage-DvA51lT3.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-BNQVvyek.js → WorkflowsDashboard-DFDTwnhn.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-BNQVvyek.js.map → WorkflowsDashboard-DFDTwnhn.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-DswubNJN.js → WorkflowsOverview-5i2Tcy-p.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-DswubNJN.js.map → WorkflowsOverview-5i2Tcy-p.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-Cw9Dlmup.js → YamlWorkflowDetailPage-p4VEYZS0.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-Cw9Dlmup.js.map → YamlWorkflowDetailPage-p4VEYZS0.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-DB8xnIXy.js → YamlWorkflowsPage-Cq-hMVxl.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-DB8xnIXy.js.map → YamlWorkflowsPage-Cq-hMVxl.js.map} +1 -1
- package/dashboard/dist/assets/{agents-BwEnf6N9.js → agents-EyBPJMYa.js} +2 -2
- package/dashboard/dist/assets/{agents-BwEnf6N9.js.map → agents-EyBPJMYa.js.map} +1 -1
- package/dashboard/dist/assets/{bots-CCmJTT2u.js → bots-DX6jjqtF.js} +2 -2
- package/dashboard/dist/assets/{bots-CCmJTT2u.js.map → bots-DX6jjqtF.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-BZHgp_nh.js → capabilities-ZdLv9xBQ.js} +2 -2
- package/dashboard/dist/assets/{capabilities-BZHgp_nh.js.map → capabilities-ZdLv9xBQ.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-CyfwUlFA.js → controlplane-CpvZaJuw.js} +2 -2
- package/dashboard/dist/assets/{controlplane-CyfwUlFA.js.map → controlplane-CpvZaJuw.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-BJPTNmLW.js → escalation-columns-Mvsze5eV.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-BJPTNmLW.js.map → escalation-columns-Mvsze5eV.js.map} +1 -1
- package/dashboard/dist/assets/{index-CDrqqbSR.js → index-B_GT23TE.js} +3 -3
- package/dashboard/dist/assets/{index-CDrqqbSR.js.map → index-B_GT23TE.js.map} +1 -1
- package/dashboard/dist/assets/{index-CVwzCZ43.js → index-BbCjGO3M.js} +2 -2
- package/dashboard/dist/assets/{index-CVwzCZ43.js.map → index-BbCjGO3M.js.map} +1 -1
- package/dashboard/dist/assets/{index-CuVkSmj5.js → index-Bhb89oHH.js} +2 -2
- package/dashboard/dist/assets/{index-CuVkSmj5.js.map → index-Bhb89oHH.js.map} +1 -1
- package/dashboard/dist/assets/{index-3gbd5neL.js → index-CgUcYveM.js} +33 -33
- package/dashboard/dist/assets/index-CgUcYveM.js.map +1 -0
- package/dashboard/dist/assets/{index-BAAVTyZ-.js → index-Cn8uJsd7.js} +2 -2
- package/dashboard/dist/assets/{index-BAAVTyZ-.js.map → index-Cn8uJsd7.js.map} +1 -1
- package/dashboard/dist/assets/{index-C7KHqOTQ.js → index-D-Xs4rAW.js} +2 -2
- package/dashboard/dist/assets/{index-C7KHqOTQ.js.map → index-D-Xs4rAW.js.map} +1 -1
- package/dashboard/dist/assets/{index-DZ8X_Gp4.js → index-DGmzBY9D.js} +2 -2
- package/dashboard/dist/assets/{index-DZ8X_Gp4.js.map → index-DGmzBY9D.js.map} +1 -1
- package/dashboard/dist/assets/{index-DBWS5QL8.js → index-DZhtP2Ok.js} +2 -2
- package/dashboard/dist/assets/{index-DBWS5QL8.js.map → index-DZhtP2Ok.js.map} +1 -1
- package/dashboard/dist/assets/{index-ClVbfe4z.js → index-DkrBFFSO.js} +2 -2
- package/dashboard/dist/assets/{index-ClVbfe4z.js.map → index-DkrBFFSO.js.map} +1 -1
- package/dashboard/dist/assets/{index-BC6Jenlo.js → index-Eo-l3Lqo.js} +2 -2
- package/dashboard/dist/assets/{index-BC6Jenlo.js.map → index-Eo-l3Lqo.js.map} +1 -1
- package/dashboard/dist/assets/{index-DIWCI6HC.js → index-PfSRKerc.js} +2 -2
- package/dashboard/dist/assets/{index-DIWCI6HC.js.map → index-PfSRKerc.js.map} +1 -1
- package/dashboard/dist/assets/{index-DAuX_PlL.js → index-oFKUFGQL.js} +2 -2
- package/dashboard/dist/assets/{index-DAuX_PlL.js.map → index-oFKUFGQL.js.map} +1 -1
- package/dashboard/dist/assets/{index-CaGF6TCC.js → index-z5Hpeidu.js} +2 -2
- package/dashboard/dist/assets/{index-CaGF6TCC.js.map → index-z5Hpeidu.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-CqyLhUMg.js → knowledge-CgloEkaf.js} +2 -2
- package/dashboard/dist/assets/{knowledge-CqyLhUMg.js.map → knowledge-CgloEkaf.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-Cvu6bFYH.js → mcp-Bix7QYO7.js} +2 -2
- package/dashboard/dist/assets/{mcp-Cvu6bFYH.js.map → mcp-Bix7QYO7.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-qC6A3e9l.js → mcp-query-o-sGX2ST.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-qC6A3e9l.js.map → mcp-query-o-sGX2ST.js.map} +1 -1
- package/dashboard/dist/assets/{personas-BKN_lJuV.js → personas-30azkJ_s.js} +2 -2
- package/dashboard/dist/assets/{personas-BKN_lJuV.js.map → personas-30azkJ_s.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-BldIfv85.js → pipelines-Bfk2GFK7.js} +2 -2
- package/dashboard/dist/assets/{pipelines-BldIfv85.js.map → pipelines-Bfk2GFK7.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-B-Uay8uL.js → tasks-CpdopewW.js} +2 -2
- package/dashboard/dist/assets/{tasks-B-Uay8uL.js.map → tasks-CpdopewW.js.map} +1 -1
- package/dashboard/dist/assets/{topics-438EQogt.js → topics--bvCV9Yp.js} +2 -2
- package/dashboard/dist/assets/{topics-438EQogt.js.map → topics--bvCV9Yp.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-Cw8hYZ8y.js → useDebouncedValue-Da0lPmj3.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-Cw8hYZ8y.js.map → useDebouncedValue-Da0lPmj3.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-D1218GQ8.js → useNamespace-DD_Esl6n.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-D1218GQ8.js.map → useNamespace-DD_Esl6n.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-BAQf_y_U.js → useYamlActivityEvents-AeAhZJJk.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-BAQf_y_U.js.map → useYamlActivityEvents-AeAhZJJk.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-CN01gEB0.js → yaml-workflows-BHAOOGvn.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-CN01gEB0.js.map → yaml-workflows-BHAOOGvn.js.map} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/docs/accumulator.md +3 -3
- package/docs/api/http/escalations.md +2 -1
- package/docs/api/sdk/escalations.md +3 -2
- package/docs/scan-codes.md +20 -9
- package/package.json +1 -1
- package/dashboard/dist/assets/ScanSchemeDetailPage-CUBRAtmJ.js +0 -2
- package/dashboard/dist/assets/ScanSchemeDetailPage-CUBRAtmJ.js.map +0 -1
- package/dashboard/dist/assets/index-3gbd5neL.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as e,a as y}from"./vendor-query-DvWWuNIB.js";import{as as ie,aT as oe,aU as B,J as ce,aV as de,w as Y,x as Z,I as xe,aW as E,aX as me,aY as ue,aZ as he,Z as pe}from"./index-3gbd5neL.js";import{A as fe}from"./AutoGrowTextarea-7X3T9La8.js";import{C as be}from"./ConfirmDeleteModal-CeEDt9iJ.js";import{aQ as Q,z as ve,bz as ee,G as z,bA as ye,a0 as te,az as ge,o as D,al as je,P as se,L as ae,aA as Ne,I as X,x as we,p as ne,ab as _e,bB as ke}from"./vendor-icons-B7OcUM6b.js";import{u as Se,L as W,e as Ce,f as $e}from"./vendor-react-_9U4mKFr.js";function Pe({role:t}){const{data:s}=ie({role:t,limit:100}),a=(s==null?void 0:s.users)??[];return a.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Assign users to this role to staff its queue. Members see and resolve escalations here according to their read/write scope; admins manage the role itself."}):e.jsx("div",{className:"divide-y divide-surface-border/40",children:a.map(i=>{const d=i.roles.find(o=>o.role===t);return d?e.jsxs("div",{className:"flex items-center justify-between py-1.5 gap-2",children:[e.jsx("span",{className:"text-xs text-text-secondary truncate",children:i.display_name||i.external_id}),e.jsx("span",{className:"text-2xs text-text-quaternary font-mono shrink-0",children:Le(d)})]},i.id):null})})}function Le(t){return t.type==="superadmin"||t.type==="admin"?t.type:`member · read ${t.read_scope} · write ${t.write_scope}`}function H(t){return t==null?"":JSON.stringify(t,null,2)}function q(t){const s=t.trim();if(!s)return{ok:!0,value:void 0};try{const a=JSON.parse(s);return typeof a!="object"||Array.isArray(a)||a===null?{ok:!1}:{ok:!0,value:a}}catch{return{ok:!1}}}const J=/^[a-zA-Z0-9_]+$/;function Ae(t){var a;const s=q(t);return s.ok&&((a=s.value)==null?void 0:a.kiosk)===!0}function Re(t){const s=q(t);if(!s.ok)return null;const a={...s.value??{}};return a.kiosk===!0?delete a.kiosk:a.kiosk=!0,JSON.stringify(a,null,2)}const Ee={title:"",description:"",ops_visible:!1,ops_home_default:!1,enforce_schema:!1,parent_role:"",metadata_schema:"",properties:"{}",sla_minutes:"",target_per_hour:"",worker_count:"",priority_threshold_minutes:"",priority_facet:"",entity_facet:"",entity_state_source:"role",portals:[]};function qe(t){return{title:t.title??"",description:t.description??"",ops_visible:t.ops_visible,ops_home_default:t.ops_home_default,enforce_schema:t.enforce_schema,parent_role:t.parent_role??"",metadata_schema:H(t.metadata_schema),properties:H(t.properties)||"{}",sla_minutes:t.sla_minutes!=null?String(t.sla_minutes):"",target_per_hour:t.target_per_hour!=null?String(t.target_per_hour):"",worker_count:t.worker_count!=null?String(t.worker_count):"",priority_threshold_minutes:t.priority_threshold_minutes!=null?String(t.priority_threshold_minutes):"",priority_facet:t.priority_facet??"",entity_facet:t.entity_facet??"",entity_state_source:t.entity_state_source??"role",portals:t.portals??[]}}function w({icon:t,label:s,annotation:a,aside:i,accent:d=!1,children:o}){const r=d?"text-accent":"text-text-tertiary";return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(t,{className:`w-3 h-3 ${r} shrink-0`,strokeWidth:1.5}),e.jsx("span",{className:`text-2xs font-semibold uppercase tracking-widest ${r}`,children:s}),a&&e.jsxs("span",{className:"text-2xs text-text-quaternary truncate",children:["— ",a]})]}),i]}),e.jsx("div",{className:`border-l-2 pl-5 ${d?"border-accent/15":"border-surface-border/60"}`,children:o})]})}function G(){return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-success"}),e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-status-success",children:"Live"})]})}function U({checked:t,onChange:s,title:a}){return e.jsx("button",{onClick:s,title:a,className:`w-9 h-5 rounded-full transition-colors relative shrink-0 ${t?"bg-accent":"bg-surface-border"}`,children:e.jsx("span",{className:`absolute top-[3px] left-0 w-3.5 h-3.5 rounded-full bg-text-inverse transition-transform shadow ${t?"translate-x-[18px]":"translate-x-[3px]"}`})})}function Oe({items:t,empty:s,onRemove:a}){return t.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:s}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(i=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-2xs bg-accent/10 rounded-sm font-mono text-accent",children:[i,e.jsx("button",{onClick:()=>a(i),className:"text-accent/50 hover:text-status-error transition-colors leading-none ml-0.5",children:"×"})]},i))})}function Me({role:t,draft:s,update:a}){const i=Se(),d=oe(),[o,r]=y.useState(!1),u=t.user_count>0||t.chain_count>0||t.workflow_count>0;return e.jsxs("div",{className:"space-y-14",children:[e.jsx(w,{icon:Q,label:"Identity",annotation:"name and description",accent:!0,children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Display Name"}),e.jsx("input",{type:"text",value:s.title,onChange:c=>a({title:c.target.value}),placeholder:`e.g., ${t.role.charAt(0).toUpperCase()+t.role.slice(1)}`,className:"input text-sm w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Description"}),e.jsx(fe,{value:s.description,onChange:c=>a({description:c}),placeholder:"A short description shown on role cards and in the operations view.",rows:2})]})]})}),e.jsx("div",{className:"border-t border-surface-border/40 pt-6",children:u?e.jsxs("p",{className:"text-2xs text-text-quaternary leading-relaxed",children:["This role is referenced by"," ",[t.user_count>0?`${t.user_count} member${t.user_count===1?"":"s"}`:null,t.workflow_count>0?`${t.workflow_count} workflow${t.workflow_count===1?"":"s"}`:null,t.chain_count>0?"routing config":null].filter(Boolean).join(", ")," ","and cannot be deleted."]}):e.jsxs("button",{onClick:()=>r(!0),className:"px-3 py-1.5 text-xs rounded-md text-status-error/60 hover:text-status-error hover:bg-status-error/10 transition-colors flex items-center gap-1",children:[e.jsx(ve,{className:"w-3 h-3"})," Delete this role"]})}),e.jsx(be,{open:o,onClose:()=>r(!1),onConfirm:()=>d.mutate(t.role,{onSuccess:()=>i("/admin/roles")}),title:"Delete Role",description:e.jsxs(e.Fragment,{children:["Delete role ",e.jsx("span",{className:"font-medium font-mono text-text-primary",children:t.role}),"? This cannot be undone."]}),isPending:d.isPending,error:d.error})]})}function Te({role:t,allRoles:s,draft:a,update:i,errors:d}){const o=parseFloat(a.sla_minutes),r=parseFloat(a.target_per_hour),u=parseFloat(a.worker_count),c=!isNaN(o)&&o>0,v=!isNaN(r)&&r>0,g=!isNaN(u)&&u>0,N=c&&g&&!v?`→ target ≈ ${(u/(o/60)).toFixed(1)}/h`:c&&v&&!g?`→ workers ≈ ${(r*(o/60)).toFixed(1)}`:v&&g&&!c?`→ SLA ≈ ${(u/r*60).toFixed(0)}m`:null,l=y.useMemo(()=>s.filter(n=>{if(n.role===t.role)return!1;let m=n;const b=new Set;for(;m!=null&&m.parent_role;){if(m.parent_role===t.role)return!1;if(b.has(m.parent_role))break;b.add(m.parent_role),m=s.find(_=>_.role===m.parent_role)}return!0}),[s,t]);return e.jsxs("div",{className:"space-y-14",children:[e.jsx(w,{icon:ee,label:"Pace Board",annotation:"this role on the Pace Board",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Show this role on the Pace Board"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Roles appear on the Operations chart and table with live counts, pace, and the time-in-state mix."})]}),e.jsx(U,{checked:a.ops_visible,onChange:()=>i({ops_visible:!a.ops_visible}),title:"Show this role on the Pace Board"})]})}),e.jsx(w,{icon:z,label:"Capacity",annotation:"throughput = workers / (sla / 60)",children:e.jsxs("div",{className:"flex items-end gap-6",children:[[{key:"sla_minutes",label:"SLA",unit:"min",placeholder:"30"},{key:"target_per_hour",label:"Target",unit:"/h",placeholder:"20"},{key:"worker_count",label:"Workers",unit:"",placeholder:"4"}].map(({key:n,label:m,unit:b,placeholder:_})=>e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:[m,b&&e.jsx("span",{className:"normal-case font-normal ml-1",children:b})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:a[n],onChange:x=>i({[n]:x.target.value}),placeholder:_,className:"input text-xs w-20 font-mono"})]},n)),N&&e.jsx("span",{className:"text-2xs text-accent font-mono whitespace-nowrap pb-2",children:N})]})}),e.jsxs(w,{icon:z,label:"Priority",annotation:"when a pending item counts as overdue",children:[e.jsxs("div",{className:"flex items-end gap-6",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:["Threshold",e.jsx("span",{className:"normal-case font-normal ml-1",children:"min"})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:a.priority_threshold_minutes,onChange:n=>i({priority_threshold_minutes:n.target.value}),placeholder:a.sla_minutes||"60",className:"input text-xs w-20 font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:"Age Facet"}),e.jsx("input",{type:"text",value:a.priority_facet,onChange:n=>i({priority_facet:n.target.value}),placeholder:"created_at",className:"input text-xs w-36 font-mono"}),d.priority_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:d.priority_facet})]})]}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["Pending unclaimed items older than the threshold count as priority. Age is measured from the metadata facet (an ISO 8601 UTC timestamp, e.g. ",e.jsx("code",{className:"font-mono",children:"authorized_at"}),") or from"," ",e.jsx("code",{className:"font-mono",children:"created_at"})," when blank; the threshold falls back to SLA when blank."]})]}),e.jsxs(w,{icon:ye,label:"Entity",annotation:"what moves through this role",accent:!0,children:[e.jsx("input",{type:"text",value:a.entity_facet,onChange:n=>i({entity_facet:n.target.value}),placeholder:"serialNumber",className:"input text-xs w-44 font-mono"}),d.entity_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:d.entity_facet}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["The metadata key naming the entity that moves through this role —"," ",e.jsx("code",{className:"font-mono",children:"serialNumber"}),","," ",e.jsx("code",{className:"font-mono",children:"orderId"}),". Roles sharing a key form that entity's system: its state mix, per-entity dwell, and timelines all derive from it. Blank = the role has no entity notion."]}),a.entity_facet.trim()!==""&&e.jsxs("div",{className:"mt-5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1.5",children:"States from"}),e.jsx("div",{className:"flex items-center gap-1",children:[{value:"role",label:"Role"},{value:"subtype",label:"Subtypes"}].map(({value:n,label:m})=>e.jsx("button",{onClick:()=>i({entity_state_source:n}),className:`px-2.5 py-1 text-2xs rounded transition-colors ${a.entity_state_source===n?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:m},n))}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:["How this role names the entity's state. ",e.jsx("strong",{children:"Role"}),": being here is one state (a servicing or harvesting queue)."," ",e.jsx("strong",{children:"Subtypes"}),": this one role holds several states, named by each escalation's subtype (a fleet role parking"," ",e.jsx("code",{className:"font-mono",children:"ready"})," /"," ",e.jsx("code",{className:"font-mono",children:"printing"}),")."]})]})]}),e.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-out ${a.ops_visible?"opacity-100 max-h-[900px]":"opacity-0 max-h-0 pointer-events-none"}`,"aria-hidden":!a.ops_visible,children:e.jsx(w,{icon:te,label:"Sequence",annotation:"where this role sits in its segment",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Prior Step"}),e.jsxs("select",{value:a.parent_role,onChange:n=>i({parent_role:n.target.value}),className:"select text-sm w-full font-mono",children:[e.jsx("option",{value:"",children:"None — root process"}),l.map(n=>e.jsx("option",{value:n.role,children:n.title?`${n.role} — ${n.title}`:n.role},n.role))]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Places this role in one Pace Board sequence. A role with no prior step starts its own sequence."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Upstream Inputs"}),e.jsx(G,{})]}),e.jsx(Ie,{role:t,allRoles:s})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Home Segment"}),e.jsx(U,{checked:a.ops_home_default,onChange:()=>i({ops_home_default:!a.ops_home_default}),title:"Lead the home Pace Board with this role's sequence"})]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Lead the home page's Pace Board with this role's sequence. One role holds this — saving it here releases the previous holder. Unset everywhere, the board opens on its first sequence."})]})]})})})]})}function Ie({role:t,allRoles:s}){const a=B(),[i,d]=y.useState(""),o=t.upstream_roles??[],r=y.useMemo(()=>s.map(c=>c.role).filter(c=>c!==t.role&&c!=="superadmin"&&!o.includes(c)),[s,t.role,o]),u=c=>a.mutate({role:t.role,upstream_roles:c},{onSuccess:()=>d("")});return e.jsxs("div",{className:"space-y-2",children:[r.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:i,onChange:c=>d(c.target.value),className:"select text-xs font-mono flex-1",children:[e.jsx("option",{value:"",children:"Add upstream input…"}),r.map(c=>e.jsx("option",{value:c,children:c},c))]}),e.jsx("button",{onClick:()=>{i&&u([...o,i])},disabled:!i||a.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:a.isPending?"…":"Add"})]}),e.jsx(Oe,{items:o,empty:"Roles from other sequences this role draws input from. Add one above and it lands here.",onRemove:c=>u(o.filter(v=>v!==c))}),a.error&&e.jsx("p",{className:"text-2xs text-status-error",children:a.error.message})]})}function De({role:t,draft:s,update:a,errors:i,editingJson:d,startEditingJson:o,setMetadataSchemaError:r}){return e.jsxs("div",{className:"space-y-14",children:[e.jsx(w,{icon:ge,label:"Enforcement",annotation:"server-side resolver validation",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Enforce the escalation form schema"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Every resolve surface — API, MCP, CLI — validates submitted payloads against this role's form schema and rejects violations with field-level errors before any state changes."})]}),e.jsx(U,{checked:s.enforce_schema,onChange:()=>a({enforce_schema:!s.enforce_schema}),title:"Validate every resolve payload against this role's form schema"})]})}),e.jsxs(w,{icon:D,label:"Escalation Schema",annotation:"the resolve form",accent:!0,aside:t.current_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_schema_version," in use"]}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["The form a person completes to resolve this role's escalations. Versioned — each save adds one; workflows pin any version via"," ",e.jsx("code",{className:"font-mono",children:"schemaVersion"}),"."]}),e.jsx(W,{to:`/admin/roles/${encodeURIComponent(t.role)}/schema`,className:"text-xs text-accent hover:underline",children:t.form_schema?`Open schema editor — v${t.current_schema_version??1} in use →`:"Define the escalation form →"})]}),e.jsxs(w,{icon:je,label:"Escalations List Schema",annotation:"rich list view",aside:t.current_list_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_list_schema_version," in use"]}):void 0,children:[e.jsx("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:"Richly formats the escalation list when it's scoped to just this role. Versioned on its own timeline — separate from the resolve form."}),e.jsx(W,{to:`/admin/roles/${encodeURIComponent(t.role)}/list-schema`,className:"text-xs text-accent hover:underline",children:t.list_schema?`Open list schema editor — v${t.current_list_schema_version??1} in use →`:"Define the list view →"})]}),e.jsxs(w,{icon:D,label:"Metadata Schema",annotation:"validates metadata at creation",aside:!d.has("metadata_schema")&&t.metadata_schema?e.jsx("button",{onClick:()=>o("metadata_schema"),className:"text-2xs text-accent hover:underline",children:"Edit"}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["Validates ",e.jsx("code",{className:"font-mono",children:"metadata"})," at creation time. Keys appear in faceted search autocomplete."]}),!d.has("metadata_schema")&&t.metadata_schema?e.jsx(ce,{data:t.metadata_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:s.metadata_schema,onChange:u=>{const c=u.target.value;a({metadata_schema:c}),r(q(c).ok?void 0:"Invalid JSON")},rows:10,spellCheck:!1,className:"input text-xs font-mono w-full resize-y",placeholder:`{
|
|
1
|
+
import{j as e,a as y}from"./vendor-query-DvWWuNIB.js";import{as as ie,aT as oe,aU as B,J as ce,aV as de,w as Y,x as Z,I as xe,aW as E,aX as me,aY as ue,aZ as he,Z as pe}from"./index-CgUcYveM.js";import{A as fe}from"./AutoGrowTextarea-7X3T9La8.js";import{C as be}from"./ConfirmDeleteModal-BqzOwhPr.js";import{aQ as Q,z as ve,bz as ee,G as z,bA as ye,a0 as te,az as ge,o as D,al as je,P as se,L as ae,aA as Ne,I as X,x as we,p as ne,ab as _e,bB as ke}from"./vendor-icons-B7OcUM6b.js";import{u as Se,L as W,e as Ce,f as $e}from"./vendor-react-_9U4mKFr.js";function Pe({role:t}){const{data:s}=ie({role:t,limit:100}),a=(s==null?void 0:s.users)??[];return a.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Assign users to this role to staff its queue. Members see and resolve escalations here according to their read/write scope; admins manage the role itself."}):e.jsx("div",{className:"divide-y divide-surface-border/40",children:a.map(i=>{const d=i.roles.find(o=>o.role===t);return d?e.jsxs("div",{className:"flex items-center justify-between py-1.5 gap-2",children:[e.jsx("span",{className:"text-xs text-text-secondary truncate",children:i.display_name||i.external_id}),e.jsx("span",{className:"text-2xs text-text-quaternary font-mono shrink-0",children:Le(d)})]},i.id):null})})}function Le(t){return t.type==="superadmin"||t.type==="admin"?t.type:`member · read ${t.read_scope} · write ${t.write_scope}`}function H(t){return t==null?"":JSON.stringify(t,null,2)}function q(t){const s=t.trim();if(!s)return{ok:!0,value:void 0};try{const a=JSON.parse(s);return typeof a!="object"||Array.isArray(a)||a===null?{ok:!1}:{ok:!0,value:a}}catch{return{ok:!1}}}const J=/^[a-zA-Z0-9_]+$/;function Ae(t){var a;const s=q(t);return s.ok&&((a=s.value)==null?void 0:a.kiosk)===!0}function Re(t){const s=q(t);if(!s.ok)return null;const a={...s.value??{}};return a.kiosk===!0?delete a.kiosk:a.kiosk=!0,JSON.stringify(a,null,2)}const Ee={title:"",description:"",ops_visible:!1,ops_home_default:!1,enforce_schema:!1,parent_role:"",metadata_schema:"",properties:"{}",sla_minutes:"",target_per_hour:"",worker_count:"",priority_threshold_minutes:"",priority_facet:"",entity_facet:"",entity_state_source:"role",portals:[]};function qe(t){return{title:t.title??"",description:t.description??"",ops_visible:t.ops_visible,ops_home_default:t.ops_home_default,enforce_schema:t.enforce_schema,parent_role:t.parent_role??"",metadata_schema:H(t.metadata_schema),properties:H(t.properties)||"{}",sla_minutes:t.sla_minutes!=null?String(t.sla_minutes):"",target_per_hour:t.target_per_hour!=null?String(t.target_per_hour):"",worker_count:t.worker_count!=null?String(t.worker_count):"",priority_threshold_minutes:t.priority_threshold_minutes!=null?String(t.priority_threshold_minutes):"",priority_facet:t.priority_facet??"",entity_facet:t.entity_facet??"",entity_state_source:t.entity_state_source??"role",portals:t.portals??[]}}function w({icon:t,label:s,annotation:a,aside:i,accent:d=!1,children:o}){const r=d?"text-accent":"text-text-tertiary";return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(t,{className:`w-3 h-3 ${r} shrink-0`,strokeWidth:1.5}),e.jsx("span",{className:`text-2xs font-semibold uppercase tracking-widest ${r}`,children:s}),a&&e.jsxs("span",{className:"text-2xs text-text-quaternary truncate",children:["— ",a]})]}),i]}),e.jsx("div",{className:`border-l-2 pl-5 ${d?"border-accent/15":"border-surface-border/60"}`,children:o})]})}function G(){return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full dot-ring bg-status-success"}),e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-status-success",children:"Live"})]})}function U({checked:t,onChange:s,title:a}){return e.jsx("button",{onClick:s,title:a,className:`w-9 h-5 rounded-full transition-colors relative shrink-0 ${t?"bg-accent":"bg-surface-border"}`,children:e.jsx("span",{className:`absolute top-[3px] left-0 w-3.5 h-3.5 rounded-full bg-text-inverse transition-transform shadow ${t?"translate-x-[18px]":"translate-x-[3px]"}`})})}function Oe({items:t,empty:s,onRemove:a}){return t.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:s}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(i=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-2xs bg-accent/10 rounded-sm font-mono text-accent",children:[i,e.jsx("button",{onClick:()=>a(i),className:"text-accent/50 hover:text-status-error transition-colors leading-none ml-0.5",children:"×"})]},i))})}function Me({role:t,draft:s,update:a}){const i=Se(),d=oe(),[o,r]=y.useState(!1),u=t.user_count>0||t.chain_count>0||t.workflow_count>0;return e.jsxs("div",{className:"space-y-14",children:[e.jsx(w,{icon:Q,label:"Identity",annotation:"name and description",accent:!0,children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Display Name"}),e.jsx("input",{type:"text",value:s.title,onChange:c=>a({title:c.target.value}),placeholder:`e.g., ${t.role.charAt(0).toUpperCase()+t.role.slice(1)}`,className:"input text-sm w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Description"}),e.jsx(fe,{value:s.description,onChange:c=>a({description:c}),placeholder:"A short description shown on role cards and in the operations view.",rows:2})]})]})}),e.jsx("div",{className:"border-t border-surface-border/40 pt-6",children:u?e.jsxs("p",{className:"text-2xs text-text-quaternary leading-relaxed",children:["This role is referenced by"," ",[t.user_count>0?`${t.user_count} member${t.user_count===1?"":"s"}`:null,t.workflow_count>0?`${t.workflow_count} workflow${t.workflow_count===1?"":"s"}`:null,t.chain_count>0?"routing config":null].filter(Boolean).join(", ")," ","and cannot be deleted."]}):e.jsxs("button",{onClick:()=>r(!0),className:"px-3 py-1.5 text-xs rounded-md text-status-error/60 hover:text-status-error hover:bg-status-error/10 transition-colors flex items-center gap-1",children:[e.jsx(ve,{className:"w-3 h-3"})," Delete this role"]})}),e.jsx(be,{open:o,onClose:()=>r(!1),onConfirm:()=>d.mutate(t.role,{onSuccess:()=>i("/admin/roles")}),title:"Delete Role",description:e.jsxs(e.Fragment,{children:["Delete role ",e.jsx("span",{className:"font-medium font-mono text-text-primary",children:t.role}),"? This cannot be undone."]}),isPending:d.isPending,error:d.error})]})}function Te({role:t,allRoles:s,draft:a,update:i,errors:d}){const o=parseFloat(a.sla_minutes),r=parseFloat(a.target_per_hour),u=parseFloat(a.worker_count),c=!isNaN(o)&&o>0,v=!isNaN(r)&&r>0,g=!isNaN(u)&&u>0,N=c&&g&&!v?`→ target ≈ ${(u/(o/60)).toFixed(1)}/h`:c&&v&&!g?`→ workers ≈ ${(r*(o/60)).toFixed(1)}`:v&&g&&!c?`→ SLA ≈ ${(u/r*60).toFixed(0)}m`:null,l=y.useMemo(()=>s.filter(n=>{if(n.role===t.role)return!1;let m=n;const b=new Set;for(;m!=null&&m.parent_role;){if(m.parent_role===t.role)return!1;if(b.has(m.parent_role))break;b.add(m.parent_role),m=s.find(_=>_.role===m.parent_role)}return!0}),[s,t]);return e.jsxs("div",{className:"space-y-14",children:[e.jsx(w,{icon:ee,label:"Pace Board",annotation:"this role on the Pace Board",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Show this role on the Pace Board"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Roles appear on the Operations chart and table with live counts, pace, and the time-in-state mix."})]}),e.jsx(U,{checked:a.ops_visible,onChange:()=>i({ops_visible:!a.ops_visible}),title:"Show this role on the Pace Board"})]})}),e.jsx(w,{icon:z,label:"Capacity",annotation:"throughput = workers / (sla / 60)",children:e.jsxs("div",{className:"flex items-end gap-6",children:[[{key:"sla_minutes",label:"SLA",unit:"min",placeholder:"30"},{key:"target_per_hour",label:"Target",unit:"/h",placeholder:"20"},{key:"worker_count",label:"Workers",unit:"",placeholder:"4"}].map(({key:n,label:m,unit:b,placeholder:_})=>e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:[m,b&&e.jsx("span",{className:"normal-case font-normal ml-1",children:b})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:a[n],onChange:x=>i({[n]:x.target.value}),placeholder:_,className:"input text-xs w-20 font-mono"})]},n)),N&&e.jsx("span",{className:"text-2xs text-accent font-mono whitespace-nowrap pb-2",children:N})]})}),e.jsxs(w,{icon:z,label:"Priority",annotation:"when a pending item counts as overdue",children:[e.jsxs("div",{className:"flex items-end gap-6",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:["Threshold",e.jsx("span",{className:"normal-case font-normal ml-1",children:"min"})]}),e.jsx("input",{type:"number",min:"0",step:"any",value:a.priority_threshold_minutes,onChange:n=>i({priority_threshold_minutes:n.target.value}),placeholder:a.sla_minutes||"60",className:"input text-xs w-20 font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1",children:"Age Facet"}),e.jsx("input",{type:"text",value:a.priority_facet,onChange:n=>i({priority_facet:n.target.value}),placeholder:"created_at",className:"input text-xs w-36 font-mono"}),d.priority_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:d.priority_facet})]})]}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["Pending unclaimed items older than the threshold count as priority. Age is measured from the metadata facet (an ISO 8601 UTC timestamp, e.g. ",e.jsx("code",{className:"font-mono",children:"authorized_at"}),") or from"," ",e.jsx("code",{className:"font-mono",children:"created_at"})," when blank; the threshold falls back to SLA when blank."]})]}),e.jsxs(w,{icon:ye,label:"Entity",annotation:"what moves through this role",accent:!0,children:[e.jsx("input",{type:"text",value:a.entity_facet,onChange:n=>i({entity_facet:n.target.value}),placeholder:"serialNumber",className:"input text-xs w-44 font-mono"}),d.entity_facet&&e.jsx("p",{className:"text-2xs text-status-error mt-0.5",children:d.entity_facet}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-3",children:["The metadata key naming the entity that moves through this role —"," ",e.jsx("code",{className:"font-mono",children:"serialNumber"}),","," ",e.jsx("code",{className:"font-mono",children:"orderId"}),". Roles sharing a key form that entity's system: its state mix, per-entity dwell, and timelines all derive from it. Blank = the role has no entity notion."]}),a.entity_facet.trim()!==""&&e.jsxs("div",{className:"mt-5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-quaternary mb-1.5",children:"States from"}),e.jsx("div",{className:"flex items-center gap-1",children:[{value:"role",label:"Role"},{value:"subtype",label:"Subtypes"}].map(({value:n,label:m})=>e.jsx("button",{onClick:()=>i({entity_state_source:n}),className:`px-2.5 py-1 text-2xs rounded transition-colors ${a.entity_state_source===n?"bg-accent/10 text-accent font-semibold":"icon-link"}`,children:m},n))}),e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:["How this role names the entity's state. ",e.jsx("strong",{children:"Role"}),": being here is one state (a servicing or harvesting queue)."," ",e.jsx("strong",{children:"Subtypes"}),": this one role holds several states, named by each escalation's subtype (a fleet role parking"," ",e.jsx("code",{className:"font-mono",children:"ready"})," /"," ",e.jsx("code",{className:"font-mono",children:"printing"}),")."]})]})]}),e.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-out ${a.ops_visible?"opacity-100 max-h-[900px]":"opacity-0 max-h-0 pointer-events-none"}`,"aria-hidden":!a.ops_visible,children:e.jsx(w,{icon:te,label:"Sequence",annotation:"where this role sits in its segment",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Prior Step"}),e.jsxs("select",{value:a.parent_role,onChange:n=>i({parent_role:n.target.value}),className:"select text-sm w-full font-mono",children:[e.jsx("option",{value:"",children:"None — root process"}),l.map(n=>e.jsx("option",{value:n.role,children:n.title?`${n.role} — ${n.title}`:n.role},n.role))]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Places this role in one Pace Board sequence. A role with no prior step starts its own sequence."})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Upstream Inputs"}),e.jsx(G,{})]}),e.jsx(Ie,{role:t,allRoles:s})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("label",{className:"block text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:"Home Segment"}),e.jsx(U,{checked:a.ops_home_default,onChange:()=>i({ops_home_default:!a.ops_home_default}),title:"Lead the home Pace Board with this role's sequence"})]}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1.5",children:"Lead the home page's Pace Board with this role's sequence. One role holds this — saving it here releases the previous holder. Unset everywhere, the board opens on its first sequence."})]})]})})})]})}function Ie({role:t,allRoles:s}){const a=B(),[i,d]=y.useState(""),o=t.upstream_roles??[],r=y.useMemo(()=>s.map(c=>c.role).filter(c=>c!==t.role&&c!=="superadmin"&&!o.includes(c)),[s,t.role,o]),u=c=>a.mutate({role:t.role,upstream_roles:c},{onSuccess:()=>d("")});return e.jsxs("div",{className:"space-y-2",children:[r.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:i,onChange:c=>d(c.target.value),className:"select text-xs font-mono flex-1",children:[e.jsx("option",{value:"",children:"Add upstream input…"}),r.map(c=>e.jsx("option",{value:c,children:c},c))]}),e.jsx("button",{onClick:()=>{i&&u([...o,i])},disabled:!i||a.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:a.isPending?"…":"Add"})]}),e.jsx(Oe,{items:o,empty:"Roles from other sequences this role draws input from. Add one above and it lands here.",onRemove:c=>u(o.filter(v=>v!==c))}),a.error&&e.jsx("p",{className:"text-2xs text-status-error",children:a.error.message})]})}function De({role:t,draft:s,update:a,errors:i,editingJson:d,startEditingJson:o,setMetadataSchemaError:r}){return e.jsxs("div",{className:"space-y-14",children:[e.jsx(w,{icon:ge,label:"Enforcement",annotation:"server-side resolver validation",accent:!0,children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Enforce the escalation form schema"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"Every resolve surface — API, MCP, CLI — validates submitted payloads against this role's form schema and rejects violations with field-level errors before any state changes."})]}),e.jsx(U,{checked:s.enforce_schema,onChange:()=>a({enforce_schema:!s.enforce_schema}),title:"Validate every resolve payload against this role's form schema"})]})}),e.jsxs(w,{icon:D,label:"Escalation Schema",annotation:"the resolve form",accent:!0,aside:t.current_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_schema_version," in use"]}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["The form a person completes to resolve this role's escalations. Versioned — each save adds one; workflows pin any version via"," ",e.jsx("code",{className:"font-mono",children:"schemaVersion"}),"."]}),e.jsx(W,{to:`/admin/roles/${encodeURIComponent(t.role)}/schema`,className:"text-xs text-accent hover:underline",children:t.form_schema?`Open schema editor — v${t.current_schema_version??1} in use →`:"Define the escalation form →"})]}),e.jsxs(w,{icon:je,label:"Escalations List Schema",annotation:"rich list view",aside:t.current_list_schema_version!=null?e.jsxs("span",{className:"text-2xs font-mono text-text-quaternary",children:["v",t.current_list_schema_version," in use"]}):void 0,children:[e.jsx("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:"Richly formats the escalation list when it's scoped to just this role. Versioned on its own timeline — separate from the resolve form."}),e.jsx(W,{to:`/admin/roles/${encodeURIComponent(t.role)}/list-schema`,className:"text-xs text-accent hover:underline",children:t.list_schema?`Open list schema editor — v${t.current_list_schema_version??1} in use →`:"Define the list view →"})]}),e.jsxs(w,{icon:D,label:"Metadata Schema",annotation:"validates metadata at creation",aside:!d.has("metadata_schema")&&t.metadata_schema?e.jsx("button",{onClick:()=>o("metadata_schema"),className:"text-2xs text-accent hover:underline",children:"Edit"}):void 0,children:[e.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 leading-relaxed",children:["Validates ",e.jsx("code",{className:"font-mono",children:"metadata"})," at creation time. Keys appear in faceted search autocomplete."]}),!d.has("metadata_schema")&&t.metadata_schema?e.jsx(ce,{data:t.metadata_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:s.metadata_schema,onChange:u=>{const c=u.target.value;a({metadata_schema:c}),r(q(c).ok?void 0:"Invalid JSON")},rows:10,spellCheck:!1,className:"input text-xs font-mono w-full resize-y",placeholder:`{
|
|
2
2
|
"type": "object",
|
|
3
3
|
"properties": {
|
|
4
4
|
"order_id": { "type": "string" }
|
|
5
5
|
},
|
|
6
6
|
"required": ["order_id"]
|
|
7
7
|
}`}),i.metadata_schema&&e.jsx("p",{className:"text-2xs text-status-error mt-1",children:i.metadata_schema})]})]})]})}function Ue({role:t}){return e.jsxs("div",{className:"space-y-14",children:[e.jsx(w,{icon:D,label:"Link Variables",annotation:"facet names members bind per device — pins reference them as {lt:name}",aside:e.jsx(G,{}),children:e.jsx(Fe,{role:t})}),e.jsx(w,{icon:se,label:"Default Pins",annotation:"pinned views every member starts with",aside:e.jsx(G,{}),accent:!0,children:e.jsx(Ve,{role:t})})]})}function Be(t){var a;const s=(a=t.properties)==null?void 0:a.link_variables;return Array.isArray(s)?s.filter(i=>typeof(i==null?void 0:i.name)=="string"):[]}function Fe({role:t}){const s=B(),[a,i]=y.useState(""),[d,o]=y.useState(""),[r,u]=y.useState(""),c=Be(t),v=l=>s.mutate({role:t.role,properties:{...t.properties??{},link_variables:l.length?l:void 0}},{onSuccess:()=>{i(""),o(""),u("")}}),g=a.trim(),N=J.test(g)&&!c.some(l=>l.name===g);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:a,onChange:l=>i(l.target.value),placeholder:"facet name — e.g. region",className:"input text-xs font-mono w-40 shrink-0"}),e.jsx("input",{type:"text",value:d,onChange:l=>o(l.target.value),placeholder:"label (optional)",className:"input text-xs flex-1"}),e.jsx("input",{type:"text",value:r,onChange:l=>u(l.target.value),placeholder:"default (optional)",className:"input text-xs font-mono w-36 shrink-0"}),e.jsx("button",{onClick:()=>{N&&v([...c,{name:g,...d.trim()?{label:d.trim()}:{},...r.trim()?{default:r.trim()}:{}}])},disabled:!N||s.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:s.isPending?"…":"Add"})]}),c.length===0?e.jsxs("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:["Facet names members bind per device. A pin below can then carry",e.jsxs("span",{className:"font-mono",children:[' facets={"region":"',"{lt:region}",'"} ']}),"and each device opens it scoped to its own value."]}):e.jsx("div",{className:"divide-y divide-surface-border/60",children:c.map(l=>e.jsxs("div",{className:"flex items-baseline gap-3 py-2.5 text-2xs","data-testid":"link-var-decl",children:[e.jsx("span",{className:"font-mono font-medium text-text-secondary shrink-0",children:l.name}),l.label&&e.jsx("span",{className:"text-text-quaternary truncate",children:l.label}),e.jsx("span",{className:"font-mono text-text-quaternary truncate flex-1",children:l.default?`default: ${l.default}`:"no default — unset drops the facet"}),e.jsx("span",{className:"font-mono text-text-quaternary shrink-0",title:"Reference in a pin URL",children:de(l.name)}),e.jsx("button",{onClick:()=>v(c.filter(n=>n.name!==l.name)),className:"text-text-quaternary hover:text-status-error transition-colors leading-none shrink-0","aria-label":`Remove variable ${l.name}`,children:"×"})]},l.name))}),s.error&&e.jsx("p",{className:"text-2xs text-status-error",children:s.error.message})]})}function Ve({role:t}){const s=B(),[a,i]=y.useState(""),[d,o]=y.useState(""),[r,u]=y.useState(!0),{values:c,defaults:v}=Y(),g=t.default_pins??[],N=n=>s.mutate({role:t.role,default_pins:n.length?n:null},{onSuccess:()=>{i(""),o(""),u(!0)}}),l=a.trim()!==""&&d.trim().startsWith("/");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:a,onChange:n=>i(n.target.value),placeholder:"Label — e.g. Needs harvesting",className:"input text-xs w-40 shrink-0"}),e.jsx("input",{type:"text",value:d,onChange:n=>o(n.target.value),placeholder:'/escalations/available?role=… or …facets={"region":"{lt:region}"}',className:"input text-xs font-mono flex-1"}),e.jsxs("label",{className:"flex items-center gap-1 text-2xs text-text-tertiary shrink-0",title:"Show a live count beside the label",children:[e.jsx("input",{type:"checkbox",checked:r,onChange:n=>u(n.target.checked),className:"w-3 h-3 accent-accent"}),"count"]}),e.jsx("button",{onClick:()=>{l&&N([...g,{label:a.trim(),url:d.trim(),badge:r}])},disabled:!l||s.isPending,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:s.isPending?"…":"Add"})]}),g.length===0?e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"Pinned views every member starts with — the persona's exact queries. Add one above and it lands here."}):e.jsx("div",{className:"divide-y divide-surface-border/60",children:g.map(n=>{const m=Z(n.url);return e.jsxs("div",{className:"py-2.5",children:[e.jsxs("div",{className:"flex items-baseline gap-3 text-2xs",children:[e.jsx("span",{className:"font-medium text-text-secondary shrink-0",children:n.label}),n.badge&&e.jsx("span",{className:"text-2xs text-accent shrink-0",title:"Shows a live count",children:"count"}),e.jsx("span",{className:"font-mono text-text-quaternary truncate flex-1",title:n.url,children:n.url}),e.jsx("button",{onClick:()=>N(g.filter(b=>b.label!==n.label)),className:"text-text-quaternary hover:text-status-error transition-colors leading-none shrink-0","aria-label":`Remove pin ${n.label}`,children:"×"})]}),m.length>0&&e.jsxs("p",{className:"mt-1.5 font-mono text-2xs text-text-tertiary","data-testid":"pin-binding-caption",children:[m.map(b=>{const _=c[b]??v[b];return`${b} = ${_?`'${_}'`:"<empty>"}`}).join(", "),e.jsx("span",{className:"font-sans",children:" on this device"})]})]},n.label)})}),s.error&&e.jsx("p",{className:"text-2xs text-status-error",children:s.error.message})]})}const $={ROLE:"role",MINE:"mine",CUSTOM:"custom"},K="border border-surface-border bg-surface-sunken rounded-[var(--lt-radius-section)] overflow-hidden",Ke="flex items-center gap-3 px-4 py-2.5 border-b border-surface-border bg-surface-hover",We="flex items-center gap-2 px-3 py-2 border-b border-surface-border bg-surface-hover",T="border border-dashed border-surface-border rounded-[var(--lt-radius-section)] flex items-center justify-center p-3 min-w-0 overflow-hidden";function Je(t){const s=he(t);if(!s)return"page";const a=s.view??"default";return s.layout?`${a} · ${s.layout}`:a}function Ge({role:t,draft:s,update:a}){const{data:i}=xe(),{values:d,defaults:o}=Y(),r=s.portals,[u,c]=y.useState(""),v=y.useMemo(()=>{var n;return[...(t.default_pins??[]).map((m,b)=>({key:`${$.ROLE}:${b}`,source:$.ROLE,pin:m})),...(((n=i==null?void 0:i.preferences)==null?void 0:n.pinnedViews)??[]).map(m=>({key:`${$.MINE}:${m.id}`,source:$.MINE,pin:{label:m.label,url:m.url,badge:m.badge}}))]},[t.default_pins,i]),g=n=>a({portals:n}),N=(n,m)=>g(r.flatMap((b,_)=>_===n?m?[m]:[]:[b])),l=n=>{const m=u.trim()||`Portal ${r.length+1}`;g([...r,{key:ue(m,r.map(b=>b.key)),label:m,rows:[[n]]}]),c("")};return e.jsx(w,{icon:ae,label:"Portals",annotation:"named pages of pinned views, one row of panels per matrix row",accent:!0,children:e.jsxs("div",{className:"space-y-6",children:[r.length===0&&e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"A portal lays pins out as one page: one row with one view fills the screen, a row with three views splits it into three columns. Give a role several: urgent items by facility for the floor screen, the day's focus for the team with a panel per person. Members choose one from the global menu; a kiosk role lands on the first. Save writes the portals with the rest of the role."}),r.map((n,m)=>e.jsx(ze,{role:t.role,portal:n,options:v,bindings:{values:d,defaults:o},onChange:b=>N(m,b)},n.key)),r.length<E.MAX_PORTALS&&e.jsxs("div",{className:`${T} flex-wrap gap-3 py-5`,"data-testid":"new-portal",children:[e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-widest text-text-quaternary",children:"New portal"}),e.jsx("input",{type:"text",value:u,onChange:n=>c(n.target.value),placeholder:"Name, e.g. Focus of the day",className:"input text-xs w-52 shrink-0","aria-label":"New portal name"}),e.jsx(I,{options:v,label:"Start it with a view",onPick:l,testId:"add-portal"})]})]})})}function ze({role:t,portal:s,options:a,bindings:i,onChange:d}){const[o,r]=y.useState(s.label),u=s.rows,c=x=>{const p=x.filter(h=>h.length>0);d(p.length?{...s,rows:p}:null)},v=(x,p)=>{const h=u.map(f=>[...f]);x>=h.length?h.push([p]):h[x].push(p),c(h)},g=(x,p)=>{const h=u.map(f=>[...f]);h[x].splice(p,1),c(h)},N=(x,p,h)=>{if(!h.trim())return;const f=u.map(P=>P.map(S=>({...S})));f[x][p].label=h.trim(),d({...s,rows:f})},l=()=>{const x=o.trim();if(!x){r(s.label);return}x!==s.label&&d({...s,label:x})},n=s.counts??[],m=x=>d(x.length?{...s,counts:x}:(({counts:p,...h})=>h)(s)),b=x=>m([...n,{label:x.label,url:x.url}]),_=(x,p)=>m(n.map((h,f)=>f===x?{...h,...p}:h));return e.jsxs("section",{className:K,"data-testid":`portal-${s.key}`,children:[e.jsxs("div",{className:Ke,children:[e.jsx(Xe,{rows:u}),e.jsx("input",{type:"text",value:o,onChange:x=>r(x.target.value),onBlur:l,onKeyDown:x=>{x.key==="Enter"&&x.target.blur()},className:"input text-xs w-52","aria-label":`Portal name for ${s.key}`}),e.jsx("span",{className:"font-mono text-2xs text-text-quaternary truncate",title:"The portal's address segment",children:s.key}),e.jsxs(W,{to:me(t,s.key),className:"ml-auto inline-flex items-center gap-1 text-2xs text-accent hover:underline shrink-0","data-testid":`open-portal-${s.key}`,children:["Open ",e.jsx(Ne,{className:"w-3 h-3",strokeWidth:1.5})]}),e.jsx("button",{onClick:()=>d(null),className:"text-text-quaternary hover:text-status-error transition-colors leading-none shrink-0","aria-label":`Remove portal ${s.label}`,title:"Remove this portal",children:"×"})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"grid gap-3",style:{gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))${n.length<E.MAX_COUNTS?" 12rem":""}`},"data-testid":`portal-${s.key}-counts`,children:[n.map((x,p)=>e.jsxs("div",{className:`${K} min-w-0 bg-surface-raised px-3 py-2 space-y-1.5`,"data-testid":`portal-${s.key}-count-${p}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",defaultValue:x.label,onBlur:h=>{h.target.value.trim()&&_(p,{label:h.target.value.trim()})},onKeyDown:h=>{h.key==="Enter"&&h.target.blur()},className:"input text-2xs py-0.5 px-1.5 min-w-0 flex-1 uppercase tracking-widest","aria-label":`Count title ${p+1} of ${s.label}`}),e.jsx("button",{onClick:()=>m(n.filter((h,f)=>f!==p)),className:"text-text-quaternary hover:text-status-error transition-colors leading-none shrink-0","aria-label":`Remove count ${x.label} from ${s.label}`,title:"Remove this count",children:"×"})]}),e.jsx("input",{type:"text",defaultValue:x.blurb??"",onBlur:h=>_(p,{blurb:h.target.value.trim()||void 0}),onKeyDown:h=>{h.key==="Enter"&&h.target.blur()},placeholder:"One line under the number",className:"input text-xs py-0.5 px-1.5 w-full","aria-label":`Count blurb ${p+1} of ${s.label}`}),e.jsx("p",{className:"font-mono text-2xs text-text-quaternary truncate",title:x.url,children:x.url})]},`${x.url}-${p}`)),n.length<E.MAX_COUNTS&&e.jsx("div",{className:T,children:e.jsx(I,{options:a,label:n.length===0?"Add a count above the panels":"Add a count",onPick:b,testId:`add-count-${s.key}`})})]}),u.map((x,p)=>{const h=x.length<E.MAX_COLS;return e.jsxs("div",{className:"grid gap-3",style:{gridTemplateColumns:`repeat(${x.length}, minmax(0, 1fr))${h?" 12rem":""}`},"data-testid":`portal-${s.key}-row-${p}`,children:[x.map((f,P)=>{const S=Z(f.url);return e.jsxs("div",{className:`${K} min-w-0 bg-surface-raised`,"data-testid":`portal-${s.key}-cell-${p}-${P}`,children:[e.jsxs("div",{className:We,children:[e.jsx("input",{type:"text",defaultValue:f.label,onBlur:C=>N(p,P,C.target.value),onKeyDown:C=>{C.key==="Enter"&&C.target.blur()},className:"input text-xs py-0.5 px-1.5 min-w-0 flex-1 font-medium","aria-label":`Panel title for row ${p+1} cell ${P+1}`,title:"The panel's title; rename it for the person or place it serves"}),e.jsx("span",{className:"text-2xs text-accent shrink-0",title:"The view this pin asks for",children:Je(f.url)}),e.jsx("button",{onClick:()=>g(p,P),className:"text-text-quaternary hover:text-status-error transition-colors leading-none shrink-0","aria-label":`Remove ${f.label} from row ${p+1} of ${s.label}`,title:"Remove this panel",children:"×"})]}),e.jsxs("div",{className:"px-3 py-2 space-y-0.5",children:[e.jsx("p",{className:"font-mono text-2xs text-text-quaternary truncate",title:f.url,children:f.url}),S.length>0&&e.jsxs("p",{className:"font-mono text-2xs text-text-quaternary",children:[S.map(C=>{const O=i.values[C]??i.defaults[C];return`${C} = ${O?`'${O}'`:"<empty>"}`}).join(", "),e.jsx("span",{className:"font-sans",children:" on this device"})]})]})]},`${p}-${P}`)}),h&&e.jsx("div",{className:T,children:e.jsx(I,{options:a,label:"Add a view to this row",onPick:f=>v(p,f),testId:`add-cell-${s.key}-${p}`})})]},p)}),u.length<E.MAX_ROWS&&e.jsx("div",{className:`${T} py-4`,children:e.jsx(I,{options:a,label:"Start a new row with a view",onPick:x=>v(u.length,x),testId:`add-row-${s.key}`})})]})]})}function Xe({rows:t}){return e.jsx("div",{className:"flex flex-col gap-0.5 w-14 shrink-0","aria-hidden":!0,"data-testid":"portal-sketch",children:t.map((s,a)=>e.jsx("div",{className:"flex gap-0.5",children:s.map((i,d)=>e.jsx("span",{className:"flex-1 h-1.5 rounded-sm bg-accent/40",title:i.label},d))},a))})}function I({options:t,label:s,onPick:a,testId:i}){const[d,o]=y.useState(!1),[r,u]=y.useState(""),[c,v]=y.useState(""),g=r.trim()!==""&&c.trim().startsWith("/"),N=l=>{if(l===$.CUSTOM){o(!0);return}const n=t.find(m=>m.key===l);n&&a(n.pin)};return e.jsxs("div",{className:"space-y-1.5 w-full min-w-0",children:[e.jsxs("select",{value:"",onChange:l=>N(l.target.value),className:"select text-xs w-full","aria-label":s,"data-testid":i,children:[e.jsxs("option",{value:"",disabled:!0,children:[s,"…"]}),t.some(l=>l.source===$.ROLE)&&e.jsx("optgroup",{label:"Role pins",children:t.filter(l=>l.source===$.ROLE).map(l=>e.jsx("option",{value:l.key,children:l.pin.label},l.key))}),t.some(l=>l.source===$.MINE)&&e.jsx("optgroup",{label:"My pins",children:t.filter(l=>l.source===$.MINE).map(l=>e.jsx("option",{value:l.key,children:l.pin.label},l.key))}),e.jsx("option",{value:$.CUSTOM,children:"Label and URL…"})]}),d&&e.jsxs("div",{className:"flex flex-col gap-1.5","data-testid":`${i}-custom`,children:[e.jsx("input",{type:"text",value:r,onChange:l=>u(l.target.value),placeholder:"Label",className:"input text-xs w-full","aria-label":"View label"}),e.jsx("input",{type:"text",value:c,onChange:l=>v(l.target.value),placeholder:"/escalations/available?role=…",className:"input text-xs font-mono w-full","aria-label":"View URL"}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{o(!1),u(""),v("")},className:"px-2 py-1 text-xs text-text-tertiary hover:text-text-primary transition-colors",children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>{g&&(a({label:r.trim(),url:c.trim(),badge:!0}),o(!1),u(""),v(""))},disabled:!g,className:"px-2.5 py-1 text-xs rounded bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed shrink-0",children:"Add"})]})]})]})}const re=[{key:"identity",label:"Identity",icon:Q},{key:"pace-board",label:"Pace Board",icon:ee},{key:"schemas",label:"Schemas",icon:D},{key:"members",label:"Members",icon:ne},{key:"pins",label:"Pins",icon:se},{key:"portal",label:"Portal",icon:ae}],He=t=>re.some(s=>s.key===t);function at(){const{role:t}=Ce(),{data:s,isLoading:a}=pe(),i=B(),d=(s==null?void 0:s.roles)??[],o=d.find(j=>j.role===t),[r,u]=y.useState(Ee),[c,v]=y.useState(!1),[g,N]=y.useState(!1),[l,n]=y.useState({}),[m,b]=y.useState(new Set),_=j=>b(k=>new Set([...k,j])),[x,p]=$e(),h=x.get("section"),f=He(h)?h:"identity",P=y.useCallback(j=>{p(k=>{const L=new URLSearchParams(k);return L.set("section",j),L},{replace:!0})},[p]);y.useEffect(()=>{o&&(u(qe(o)),v(!1),N(!1),n({}),b(new Set))},[t,o==null?void 0:o.role]);const S=j=>{u(k=>({...k,...j})),v(!0),N(!1)},C=()=>{if(!o)return;const j=q(r.metadata_schema),k=q(r.properties),L=r.priority_facet.trim(),F=r.entity_facet.trim(),A={};if(j.ok||(A.metadata_schema="Invalid JSON"),k.ok||(A.properties="Invalid JSON"),L&&!J.test(L)&&(A.priority_facet="Letters, numbers, underscores only"),F&&!J.test(F)&&(A.entity_facet="Letters, numbers, underscores only"),n(A),Object.keys(A).length)return;const M=V=>{const R=parseFloat(V);return isNaN(R)?null:R},le=V=>{const R=M(V);return R==null?null:Math.round(R)};i.mutate({role:o.role,title:r.title.trim()||null,description:r.description.trim()||null,ops_visible:r.ops_visible,ops_home_default:r.ops_home_default,enforce_schema:r.enforce_schema,parent_role:r.parent_role||null,metadata_schema:j.value??null,properties:k.value??{},sla_minutes:M(r.sla_minutes),target_per_hour:M(r.target_per_hour),worker_count:le(r.worker_count),priority_threshold_minutes:M(r.priority_threshold_minutes),priority_facet:L||null,entity_facet:F||null,entity_state_source:r.entity_state_source,portals:r.portals.length?r.portals:null},{onSuccess:()=>{v(!1),N(!0),b(new Set),window.setTimeout(()=>N(!1),2500)}})};if(a)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-4 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-64 bg-surface-sunken rounded"})]});if(!o)return e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx(X,{className:"w-12 h-12 text-text-quaternary mb-4",strokeWidth:1}),e.jsx("h2",{className:"heading-3 mb-2",children:"Role not found"})]});const O=c&&!Object.values(l).some(Boolean);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-10 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx(X,{className:"w-5 h-5 text-accent",strokeWidth:1.5}),e.jsx("h1",{className:"text-lg font-mono font-medium text-text-primary",children:o.role}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:dashboard.md:role-detail"},className:"text-text-quaternary hover:text-accent transition-colors",title:"Open docs for this page",children:e.jsx(we,{className:"w-4 h-4",strokeWidth:1.5})}),o.parent_role&&e.jsxs("span",{className:"flex items-center gap-1 text-2xs text-text-quaternary font-mono",children:[e.jsx(te,{className:"w-3 h-3"})," ",o.parent_role]})]}),o.title&&e.jsx("p",{className:"text-sm text-text-secondary pl-8",children:o.title})]}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:re.map(j=>{const k=j.icon,L=f===j.key;return e.jsxs("button",{onClick:()=>P(j.key),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${L?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(k,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:j.label})]},j.key)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:C,disabled:!O||i.isPending,className:"w-full px-3 py-1.5 text-xs rounded-md bg-accent text-text-inverse hover:bg-accent-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:i.isPending?"Saving…":c?"Save changes":"Save"}),g&&e.jsxs("span",{className:"flex items-center justify-center gap-1 text-xs text-status-success animate-page-enter",children:[e.jsx(_e,{className:"w-3 h-3"})," Saved"]}),i.error&&e.jsx("p",{className:"text-2xs text-status-error leading-relaxed",children:i.error.message}),Object.values(l).some(Boolean)&&e.jsx("p",{className:"text-2xs text-status-error leading-relaxed",children:"Fix the highlighted fields before saving."})]})]}),e.jsxs("div",{className:`flex-1 min-w-0 pt-2 ${f==="portal"?"":"max-w-3xl"}`,children:[f==="identity"&&e.jsx(Me,{role:o,draft:r,update:S,errors:l}),f==="pace-board"&&e.jsx(Te,{role:o,allRoles:d,draft:r,update:S,errors:l}),f==="schemas"&&e.jsx(De,{role:o,draft:r,update:S,errors:l,editingJson:m,startEditingJson:_,setMetadataSchemaError:j=>n(k=>({...k,metadata_schema:j}))}),f==="members"&&e.jsxs("div",{className:"space-y-14",children:[e.jsx(w,{icon:ne,label:"Members",annotation:"read = what appears · write = what they can act on",accent:!0,children:e.jsx(Pe,{role:o.role})}),e.jsx(w,{icon:ke,label:"Kiosk",annotation:"the locked viewport for single-role logins",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-secondary",children:"Lock single-role members to this queue"}),e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed mt-1",children:"A member who holds only this role signs in to a locked viewport: no side navigation, this queue as home, held to the list, the item detail, and the scan screens. Members with other roles keep the full dashboard."})]}),e.jsx(U,{checked:Ae(r.properties),onChange:()=>{const j=Re(r.properties);j!==null&&S({properties:j})},title:"Kiosk viewport"})]})})]}),f==="pins"&&e.jsx(Ue,{role:o}),f==="portal"&&e.jsx(Ge,{role:o,draft:r,update:S})]})]})]})}export{at as RoleDetailPage};
|
|
8
|
-
//# sourceMappingURL=RoleDetailPage-
|
|
8
|
+
//# sourceMappingURL=RoleDetailPage-BFuLNJXa.js.map
|