@hotmeshio/long-tail 0.25.0 → 0.25.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.
Files changed (282) hide show
  1. package/build/api/escalations/batch-flag.d.ts +19 -0
  2. package/build/api/escalations/batch-flag.js +138 -0
  3. package/build/api/escalations/index.d.ts +2 -0
  4. package/build/api/escalations/index.js +8 -1
  5. package/build/api/escalations/roster-action.d.ts +37 -0
  6. package/build/api/escalations/roster-action.js +179 -0
  7. package/build/api/scan-codes/choice-roles.d.ts +3 -0
  8. package/build/api/scan-codes/choice-roles.js +48 -0
  9. package/build/api/scan-codes/choice.js +8 -0
  10. package/build/api/scan-codes/fill-labels.d.ts +15 -0
  11. package/build/api/scan-codes/fill-labels.js +99 -0
  12. package/build/api/scan-codes/hold.js +1 -0
  13. package/build/api/scan-codes/present.js +7 -2
  14. package/build/api/scan-codes/verb-fill.js +22 -5
  15. package/build/routes/escalations/resolve.js +45 -0
  16. package/build/sdk/index.d.ts +11 -0
  17. package/build/sdk/index.js +3 -0
  18. package/build/services/domain/seed.d.ts +12 -10
  19. package/build/services/domain/seed.js +31 -25
  20. package/build/services/escalation/batch-flag.d.ts +25 -0
  21. package/build/services/escalation/batch-flag.js +51 -0
  22. package/build/services/escalation/index.d.ts +1 -0
  23. package/build/services/escalation/index.js +1 -0
  24. package/build/services/escalation/roster.d.ts +3 -1
  25. package/build/services/escalation/roster.js +6 -1
  26. package/build/services/scan-code/validate-subject.js +16 -0
  27. package/build/services/scan-code/validate.js +7 -0
  28. package/build/shared/form-validation/index.d.ts +1 -0
  29. package/build/shared/form-validation/index.js +1 -0
  30. package/build/shared/form-validation/x-lt-actions.d.ts +80 -0
  31. package/build/shared/form-validation/x-lt-actions.js +133 -0
  32. package/build/shared/form-validation/x-lt-roster.d.ts +2 -0
  33. package/build/shared/form-validation/x-lt-roster.js +50 -6
  34. package/build/start/workers.d.ts +3 -0
  35. package/build/start/workers.js +15 -5
  36. package/build/tsconfig.tsbuildinfo +1 -1
  37. package/build/types/escalation.d.ts +19 -0
  38. package/build/types/escalation.js +4 -0
  39. package/build/types/index.d.ts +1 -1
  40. package/build/types/scan-choice.d.ts +9 -0
  41. package/build/types/scan-code/response.d.ts +2 -0
  42. package/build/types/scan-code/rule.d.ts +17 -0
  43. package/build/types/startup.d.ts +8 -1
  44. package/dashboard/dist/assets/{AdminDashboard-DWVRAu63.js → AdminDashboard-B8MqNLiB.js} +2 -2
  45. package/dashboard/dist/assets/{AdminDashboard-DWVRAu63.js.map → AdminDashboard-B8MqNLiB.js.map} +1 -1
  46. package/dashboard/dist/assets/{AgentConfigPage-Exjtjbvp.js → AgentConfigPage-Yg81Eiuo.js} +2 -2
  47. package/dashboard/dist/assets/{AgentConfigPage-Exjtjbvp.js.map → AgentConfigPage-Yg81Eiuo.js.map} +1 -1
  48. package/dashboard/dist/assets/{AgentDetailPage-nDbZo6RB.js → AgentDetailPage-ZUGYEONO.js} +3 -3
  49. package/dashboard/dist/assets/{AgentDetailPage-nDbZo6RB.js.map → AgentDetailPage-ZUGYEONO.js.map} +1 -1
  50. package/dashboard/dist/assets/{AgentsPage-Dsk9iHps.js → AgentsPage-CZIWMwak.js} +2 -2
  51. package/dashboard/dist/assets/{AgentsPage-Dsk9iHps.js.map → AgentsPage-CZIWMwak.js.map} +1 -1
  52. package/dashboard/dist/assets/AvailableEscalationsPage-BVtpc4xO.js +2 -0
  53. package/dashboard/dist/assets/{AvailableEscalationsPage-D1mCqj8Z.js.map → AvailableEscalationsPage-BVtpc4xO.js.map} +1 -1
  54. package/dashboard/dist/assets/{BotPicker-u5760MWZ.js → BotPicker-8bf0yOCT.js} +2 -2
  55. package/dashboard/dist/assets/{BotPicker-u5760MWZ.js.map → BotPicker-8bf0yOCT.js.map} +1 -1
  56. package/dashboard/dist/assets/{BulkAssignModal-CtISXXmW.js → BulkAssignModal-B2lr1J6P.js} +2 -2
  57. package/dashboard/dist/assets/{BulkAssignModal-CtISXXmW.js.map → BulkAssignModal-B2lr1J6P.js.map} +1 -1
  58. package/dashboard/dist/assets/{CapabilitiesPage-BKIlrQfU.js → CapabilitiesPage-BQQBR2sj.js} +2 -2
  59. package/dashboard/dist/assets/{CapabilitiesPage-BKIlrQfU.js.map → CapabilitiesPage-BQQBR2sj.js.map} +1 -1
  60. package/dashboard/dist/assets/{CollapsibleSection-DlBVTFqc.js → CollapsibleSection-DFW8TYyU.js} +2 -2
  61. package/dashboard/dist/assets/{CollapsibleSection-DlBVTFqc.js.map → CollapsibleSection-DFW8TYyU.js.map} +1 -1
  62. package/dashboard/dist/assets/{ConfirmDeleteModal-Pabkchg_.js → ConfirmDeleteModal-DGlOlQAo.js} +2 -2
  63. package/dashboard/dist/assets/{ConfirmDeleteModal-Pabkchg_.js.map → ConfirmDeleteModal-DGlOlQAo.js.map} +1 -1
  64. package/dashboard/dist/assets/{ConnectedAppsPage-DG2YZGN3.js → ConnectedAppsPage-CIM9gzHj.js} +2 -2
  65. package/dashboard/dist/assets/{ConnectedAppsPage-DG2YZGN3.js.map → ConnectedAppsPage-CIM9gzHj.js.map} +1 -1
  66. package/dashboard/dist/assets/{CountdownTimer-5t8S2qMi.js → CountdownTimer-BD_iWm6S.js} +2 -2
  67. package/dashboard/dist/assets/{CountdownTimer-5t8S2qMi.js.map → CountdownTimer-BD_iWm6S.js.map} +1 -1
  68. package/dashboard/dist/assets/{CredentialsPage-CPVbYQow.js → CredentialsPage-CTtUkvoD.js} +2 -2
  69. package/dashboard/dist/assets/{CredentialsPage-CPVbYQow.js.map → CredentialsPage-CTtUkvoD.js.map} +1 -1
  70. package/dashboard/dist/assets/{CronLabel-C7UbTrO-.js → CronLabel-rZMptkYQ.js} +2 -2
  71. package/dashboard/dist/assets/{CronLabel-C7UbTrO-.js.map → CronLabel-rZMptkYQ.js.map} +1 -1
  72. package/dashboard/dist/assets/{DropZone-DCZpORx-.js → DropZone-u1JGfR9G.js} +2 -2
  73. package/dashboard/dist/assets/{DropZone-DCZpORx-.js.map → DropZone-u1JGfR9G.js.map} +1 -1
  74. package/dashboard/dist/assets/{ElapsedCell-Yz7-LbtE.js → ElapsedCell-CmK9gHC5.js} +2 -2
  75. package/dashboard/dist/assets/{ElapsedCell-Yz7-LbtE.js.map → ElapsedCell-CmK9gHC5.js.map} +1 -1
  76. package/dashboard/dist/assets/{EntityTimelinePanel-xgPRdKEq.js → EntityTimelinePanel-Cfg0EMZs.js} +2 -2
  77. package/dashboard/dist/assets/{EntityTimelinePanel-xgPRdKEq.js.map → EntityTimelinePanel-Cfg0EMZs.js.map} +1 -1
  78. package/dashboard/dist/assets/{EscalationListSchemaPage-CqCd-y6B.js → EscalationListSchemaPage-CPcbC1-9.js} +3 -3
  79. package/dashboard/dist/assets/{EscalationListSchemaPage-CqCd-y6B.js.map → EscalationListSchemaPage-CPcbC1-9.js.map} +1 -1
  80. package/dashboard/dist/assets/{EscalationSchemaPage-D8YVQNph.js → EscalationSchemaPage-BsYdNVN7.js} +3 -3
  81. package/dashboard/dist/assets/{EscalationSchemaPage-D8YVQNph.js.map → EscalationSchemaPage-BsYdNVN7.js.map} +1 -1
  82. package/dashboard/dist/assets/EscalationTimeline-D1enxZDs.js +2 -0
  83. package/dashboard/dist/assets/{EscalationTimeline-D6jrDcBb.js.map → EscalationTimeline-D1enxZDs.js.map} +1 -1
  84. package/dashboard/dist/assets/{EscalationTitleSelect-CGGT-QTu.js → EscalationTitleSelect-DwqhnPKX.js} +2 -2
  85. package/dashboard/dist/assets/{EscalationTitleSelect-CGGT-QTu.js.map → EscalationTitleSelect-DwqhnPKX.js.map} +1 -1
  86. package/dashboard/dist/assets/{EscalationsOverview-B7O4ttP4.js → EscalationsOverview-ChuKh02E.js} +2 -2
  87. package/dashboard/dist/assets/{EscalationsOverview-B7O4ttP4.js.map → EscalationsOverview-ChuKh02E.js.map} +1 -1
  88. package/dashboard/dist/assets/{EventTable-DJniXnhe.js → EventTable-GqZIKPce.js} +2 -2
  89. package/dashboard/dist/assets/{EventTable-DJniXnhe.js.map → EventTable-GqZIKPce.js.map} +1 -1
  90. package/dashboard/dist/assets/{FilterBar-f-LEKcHI.js → FilterBar-CqPFZkVU.js} +2 -2
  91. package/dashboard/dist/assets/{FilterBar-f-LEKcHI.js.map → FilterBar-CqPFZkVU.js.map} +1 -1
  92. package/dashboard/dist/assets/{GraphInvokePage-CR0MtYv8.js → GraphInvokePage-_fB7mtBU.js} +2 -2
  93. package/dashboard/dist/assets/{GraphInvokePage-CR0MtYv8.js.map → GraphInvokePage-_fB7mtBU.js.map} +1 -1
  94. package/dashboard/dist/assets/{HomePage-HVw7T5ER.js → HomePage-BXA0Cz0F.js} +2 -2
  95. package/dashboard/dist/assets/{HomePage-HVw7T5ER.js.map → HomePage-BXA0Cz0F.js.map} +1 -1
  96. package/dashboard/dist/assets/{ListToolbar-CTGK5BXW.js → ListToolbar-Bf4DFITI.js} +2 -2
  97. package/dashboard/dist/assets/{ListToolbar-CTGK5BXW.js.map → ListToolbar-Bf4DFITI.js.map} +1 -1
  98. package/dashboard/dist/assets/{McpOverview-B2bbKKu2.js → McpOverview-H61XQRji.js} +2 -2
  99. package/dashboard/dist/assets/{McpOverview-B2bbKKu2.js.map → McpOverview-H61XQRji.js.map} +1 -1
  100. package/dashboard/dist/assets/{McpQueryDetailPage-DgLxwwJy.js → McpQueryDetailPage-wbwK8WWq.js} +2 -2
  101. package/dashboard/dist/assets/{McpQueryDetailPage-DgLxwwJy.js.map → McpQueryDetailPage-wbwK8WWq.js.map} +1 -1
  102. package/dashboard/dist/assets/{McpQueryPage-CSkczeJP.js → McpQueryPage-CYvVEk3G.js} +2 -2
  103. package/dashboard/dist/assets/{McpQueryPage-CSkczeJP.js.map → McpQueryPage-CYvVEk3G.js.map} +1 -1
  104. package/dashboard/dist/assets/{McpRunDetailPage-CrUsDPRD.js → McpRunDetailPage-TZBX68i4.js} +2 -2
  105. package/dashboard/dist/assets/{McpRunDetailPage-CrUsDPRD.js.map → McpRunDetailPage-TZBX68i4.js.map} +1 -1
  106. package/dashboard/dist/assets/{McpRunsPage-twxFdTtJ.js → McpRunsPage-Cu91Mh52.js} +2 -2
  107. package/dashboard/dist/assets/{McpRunsPage-twxFdTtJ.js.map → McpRunsPage-Cu91Mh52.js.map} +1 -1
  108. package/dashboard/dist/assets/{NamespacePill-CSZT2fA4.js → NamespacePill-C5epAgq6.js} +2 -2
  109. package/dashboard/dist/assets/{NamespacePill-CSZT2fA4.js.map → NamespacePill-C5epAgq6.js.map} +1 -1
  110. package/dashboard/dist/assets/{OperationsPage-gOVMrL_a.js → OperationsPage-D-6sKw6y.js} +3 -3
  111. package/dashboard/dist/assets/{OperationsPage-gOVMrL_a.js.map → OperationsPage-D-6sKw6y.js.map} +1 -1
  112. package/dashboard/dist/assets/OperatorDashboard-DD8JUU3L.js +2 -0
  113. package/dashboard/dist/assets/{OperatorDashboard-BoeZIyup.js.map → OperatorDashboard-DD8JUU3L.js.map} +1 -1
  114. package/dashboard/dist/assets/{PageHeader-C4z1ExF7.js → PageHeader-BSWIspNB.js} +2 -2
  115. package/dashboard/dist/assets/{PageHeader-C4z1ExF7.js.map → PageHeader-BSWIspNB.js.map} +1 -1
  116. package/dashboard/dist/assets/{PageHeaderWithStats-B_f_Sz_Q.js → PageHeaderWithStats-DDjopQ-k.js} +2 -2
  117. package/dashboard/dist/assets/{PageHeaderWithStats-B_f_Sz_Q.js.map → PageHeaderWithStats-DDjopQ-k.js.map} +1 -1
  118. package/dashboard/dist/assets/{PersonaDetailPage-CDktk1mi.js → PersonaDetailPage-CGri6okV.js} +2 -2
  119. package/dashboard/dist/assets/{PersonaDetailPage-CDktk1mi.js.map → PersonaDetailPage-CGri6okV.js.map} +1 -1
  120. package/dashboard/dist/assets/{PersonasPage-Bs097x07.js → PersonasPage-DtHW6-Qx.js} +2 -2
  121. package/dashboard/dist/assets/{PersonasPage-Bs097x07.js.map → PersonasPage-DtHW6-Qx.js.map} +1 -1
  122. package/dashboard/dist/assets/PortalPage-Dgbk_mzr.js +2 -0
  123. package/dashboard/dist/assets/{PortalPage-DjfjerpF.js.map → PortalPage-Dgbk_mzr.js.map} +1 -1
  124. package/dashboard/dist/assets/{ProcessDetailPage-B30RatjD.js → ProcessDetailPage-BdkacBrD.js} +2 -2
  125. package/dashboard/dist/assets/{ProcessDetailPage-B30RatjD.js.map → ProcessDetailPage-BdkacBrD.js.map} +1 -1
  126. package/dashboard/dist/assets/{ProcessesListPage-DrvjzgWT.js → ProcessesListPage-DO5A-OfZ.js} +2 -2
  127. package/dashboard/dist/assets/{ProcessesListPage-DrvjzgWT.js.map → ProcessesListPage-DO5A-OfZ.js.map} +1 -1
  128. package/dashboard/dist/assets/ResolverForm-CqGE5lf-.js +8 -0
  129. package/dashboard/dist/assets/ResolverForm-CqGE5lf-.js.map +1 -0
  130. package/dashboard/dist/assets/{RoleDetailPage-ClYgn-3d.js → RoleDetailPage-DgVp0Hih.js} +2 -2
  131. package/dashboard/dist/assets/{RoleDetailPage-ClYgn-3d.js.map → RoleDetailPage-DgVp0Hih.js.map} +1 -1
  132. package/dashboard/dist/assets/{RolePill-Bw_n7EpR.js → RolePill-CoETDpjF.js} +2 -2
  133. package/dashboard/dist/assets/{RolePill-Bw_n7EpR.js.map → RolePill-CoETDpjF.js.map} +1 -1
  134. package/dashboard/dist/assets/{RolesPage-B_3qWsvQ.js → RolesPage-BmsWq83e.js} +2 -2
  135. package/dashboard/dist/assets/{RolesPage-B_3qWsvQ.js.map → RolesPage-BmsWq83e.js.map} +1 -1
  136. package/dashboard/dist/assets/RosterWidget-DR-T4Izu.js +2 -0
  137. package/dashboard/dist/assets/RosterWidget-DR-T4Izu.js.map +1 -0
  138. package/dashboard/dist/assets/{RunAsSelector-CbJT50Hp.js → RunAsSelector-CyUWGp5P.js} +2 -2
  139. package/dashboard/dist/assets/{RunAsSelector-CbJT50Hp.js.map → RunAsSelector-CyUWGp5P.js.map} +1 -1
  140. package/dashboard/dist/assets/{ScanCodesPage-CIIDuh8w.js → ScanCodesPage-Cy05JOt4.js} +2 -2
  141. package/dashboard/dist/assets/{ScanCodesPage-CIIDuh8w.js.map → ScanCodesPage-Cy05JOt4.js.map} +1 -1
  142. package/dashboard/dist/assets/{ScanSchemeDetailPage-Bd3P3eyh.js → ScanSchemeDetailPage-BX1afzOg.js} +2 -2
  143. package/dashboard/dist/assets/{ScanSchemeDetailPage-Bd3P3eyh.js.map → ScanSchemeDetailPage-BX1afzOg.js.map} +1 -1
  144. package/dashboard/dist/assets/ScanStationPage-DLAB41tb.js +2 -0
  145. package/dashboard/dist/assets/ScanStationPage-DLAB41tb.js.map +1 -0
  146. package/dashboard/dist/assets/{ScopeBadge-CKgfwTy3.js → ScopeBadge-CGsTtqFr.js} +2 -2
  147. package/dashboard/dist/assets/{ScopeBadge-CKgfwTy3.js.map → ScopeBadge-CGsTtqFr.js.map} +1 -1
  148. package/dashboard/dist/assets/{StickyPagination-BNOuYZ1m.js → StickyPagination-BzUTnYYE.js} +2 -2
  149. package/dashboard/dist/assets/{StickyPagination-BNOuYZ1m.js.map → StickyPagination-BzUTnYYE.js.map} +1 -1
  150. package/dashboard/dist/assets/{StreamMessageDetail-ALVUnfF1.js → StreamMessageDetail-D0W1ekgG.js} +2 -2
  151. package/dashboard/dist/assets/{StreamMessageDetail-ALVUnfF1.js.map → StreamMessageDetail-D0W1ekgG.js.map} +1 -1
  152. package/dashboard/dist/assets/{SwimlaneTimeline-B5b8-xqI.js → SwimlaneTimeline-BPBwmwuO.js} +2 -2
  153. package/dashboard/dist/assets/{SwimlaneTimeline-B5b8-xqI.js.map → SwimlaneTimeline-BPBwmwuO.js.map} +1 -1
  154. package/dashboard/dist/assets/{TagInput-B6fMAqxd.js → TagInput-S7UuVT_M.js} +2 -2
  155. package/dashboard/dist/assets/{TagInput-B6fMAqxd.js.map → TagInput-S7UuVT_M.js.map} +1 -1
  156. package/dashboard/dist/assets/{TaskDetailPage-CoV3WcTA.js → TaskDetailPage-VuaIXISy.js} +2 -2
  157. package/dashboard/dist/assets/{TaskDetailPage-CoV3WcTA.js.map → TaskDetailPage-VuaIXISy.js.map} +1 -1
  158. package/dashboard/dist/assets/{TaskQueuePill-BnDp_DE6.js → TaskQueuePill-BlHNpYiZ.js} +2 -2
  159. package/dashboard/dist/assets/{TaskQueuePill-BnDp_DE6.js.map → TaskQueuePill-BlHNpYiZ.js.map} +1 -1
  160. package/dashboard/dist/assets/{TasksListPage-CkMmOYOE.js → TasksListPage-KaUSoqos.js} +2 -2
  161. package/dashboard/dist/assets/{TasksListPage-CkMmOYOE.js.map → TasksListPage-KaUSoqos.js.map} +1 -1
  162. package/dashboard/dist/assets/{TimeAgo-DVkFgECX.js → TimeAgo-C_E6u0fr.js} +2 -2
  163. package/dashboard/dist/assets/{TimeAgo-DVkFgECX.js.map → TimeAgo-C_E6u0fr.js.map} +1 -1
  164. package/dashboard/dist/assets/{TimestampCell-CfTc6Txy.js → TimestampCell-CUJiAmax.js} +2 -2
  165. package/dashboard/dist/assets/{TimestampCell-CfTc6Txy.js.map → TimestampCell-CUJiAmax.js.map} +1 -1
  166. package/dashboard/dist/assets/{ToolPill-BRZWo4l8.js → ToolPill-D40uLM_v.js} +2 -2
  167. package/dashboard/dist/assets/{ToolPill-BRZWo4l8.js.map → ToolPill-D40uLM_v.js.map} +1 -1
  168. package/dashboard/dist/assets/{ToolTestPanel-kvqZqM0A.js → ToolTestPanel-Ch5nQANh.js} +2 -2
  169. package/dashboard/dist/assets/{ToolTestPanel-kvqZqM0A.js.map → ToolTestPanel-Ch5nQANh.js.map} +1 -1
  170. package/dashboard/dist/assets/{TopicDetailPage-CjkAAyy8.js → TopicDetailPage-BprToO7w.js} +2 -2
  171. package/dashboard/dist/assets/{TopicDetailPage-CjkAAyy8.js.map → TopicDetailPage-BprToO7w.js.map} +1 -1
  172. package/dashboard/dist/assets/{TopicsPage-CJZnv50y.js → TopicsPage-8SmCnQ-E.js} +2 -2
  173. package/dashboard/dist/assets/{TopicsPage-CJZnv50y.js.map → TopicsPage-8SmCnQ-E.js.map} +1 -1
  174. package/dashboard/dist/assets/{UserName-CPJPZnN1.js → UserName-BkJryunF.js} +2 -2
  175. package/dashboard/dist/assets/{UserName-CPJPZnN1.js.map → UserName-BkJryunF.js.map} +1 -1
  176. package/dashboard/dist/assets/{WorkflowExecutionPage-46UV5pJd.js → WorkflowExecutionPage-B2S5ODie.js} +2 -2
  177. package/dashboard/dist/assets/{WorkflowExecutionPage-46UV5pJd.js.map → WorkflowExecutionPage-B2S5ODie.js.map} +1 -1
  178. package/dashboard/dist/assets/{WorkflowPill-Cly9Ln_3.js → WorkflowPill-DJLcK_CM.js} +2 -2
  179. package/dashboard/dist/assets/{WorkflowPill-Cly9Ln_3.js.map → WorkflowPill-DJLcK_CM.js.map} +1 -1
  180. package/dashboard/dist/assets/{WorkflowsDashboard-DtxYdQbQ.js → WorkflowsDashboard-CABuRCXp.js} +2 -2
  181. package/dashboard/dist/assets/{WorkflowsDashboard-DtxYdQbQ.js.map → WorkflowsDashboard-CABuRCXp.js.map} +1 -1
  182. package/dashboard/dist/assets/{WorkflowsOverview-Cg4LSfck.js → WorkflowsOverview-BPUHAj8T.js} +2 -2
  183. package/dashboard/dist/assets/{WorkflowsOverview-Cg4LSfck.js.map → WorkflowsOverview-BPUHAj8T.js.map} +1 -1
  184. package/dashboard/dist/assets/{YamlWorkflowDetailPage-Del-RCgi.js → YamlWorkflowDetailPage-DZGjT-Tl.js} +2 -2
  185. package/dashboard/dist/assets/{YamlWorkflowDetailPage-Del-RCgi.js.map → YamlWorkflowDetailPage-DZGjT-Tl.js.map} +1 -1
  186. package/dashboard/dist/assets/{YamlWorkflowsPage-BF6Jtx24.js → YamlWorkflowsPage-DIxHURlM.js} +2 -2
  187. package/dashboard/dist/assets/{YamlWorkflowsPage-BF6Jtx24.js.map → YamlWorkflowsPage-DIxHURlM.js.map} +1 -1
  188. package/dashboard/dist/assets/{agents-wL-3dMOX.js → agents-BnDp2rcb.js} +2 -2
  189. package/dashboard/dist/assets/{agents-wL-3dMOX.js.map → agents-BnDp2rcb.js.map} +1 -1
  190. package/dashboard/dist/assets/{bots-D72EsztP.js → bots-maURYoyr.js} +2 -2
  191. package/dashboard/dist/assets/{bots-D72EsztP.js.map → bots-maURYoyr.js.map} +1 -1
  192. package/dashboard/dist/assets/{capabilities-DXFo6bRb.js → capabilities-5-TakMUh.js} +2 -2
  193. package/dashboard/dist/assets/{capabilities-DXFo6bRb.js.map → capabilities-5-TakMUh.js.map} +1 -1
  194. package/dashboard/dist/assets/{controlplane-gQdOgVtH.js → controlplane-BXVVTWoh.js} +2 -2
  195. package/dashboard/dist/assets/{controlplane-gQdOgVtH.js.map → controlplane-BXVVTWoh.js.map} +1 -1
  196. package/dashboard/dist/assets/escalation-columns-v8gx8wFb.js +2 -0
  197. package/dashboard/dist/assets/{escalation-columns-CSE5wfWQ.js.map → escalation-columns-v8gx8wFb.js.map} +1 -1
  198. package/dashboard/dist/assets/escalation-items-OWntjDaH.js +2 -0
  199. package/dashboard/dist/assets/escalation-items-OWntjDaH.js.map +1 -0
  200. package/dashboard/dist/assets/{index-Btm8FtTQ.js → index-BIfY4mR2.js} +2 -2
  201. package/dashboard/dist/assets/{index-Btm8FtTQ.js.map → index-BIfY4mR2.js.map} +1 -1
  202. package/dashboard/dist/assets/{index-h1Useskt.js → index-BTm3-qwq.js} +2 -2
  203. package/dashboard/dist/assets/{index-h1Useskt.js.map → index-BTm3-qwq.js.map} +1 -1
  204. package/dashboard/dist/assets/{index-Cu0xdX2t.js → index-CR9rhAvN.js} +2 -2
  205. package/dashboard/dist/assets/{index-Cu0xdX2t.js.map → index-CR9rhAvN.js.map} +1 -1
  206. package/dashboard/dist/assets/index-CWKs10VQ.js +13 -0
  207. package/dashboard/dist/assets/{index-D1lfq5iZ.js.map → index-CWKs10VQ.js.map} +1 -1
  208. package/dashboard/dist/assets/index-CvKegIVe.js +3 -0
  209. package/dashboard/dist/assets/index-CvKegIVe.js.map +1 -0
  210. package/dashboard/dist/assets/{index-BaCDL5fh.js → index-D7peGNN0.js} +27 -27
  211. package/dashboard/dist/assets/index-D7peGNN0.js.map +1 -0
  212. package/dashboard/dist/assets/{index-CptTEhWp.js → index-D_ojXTgO.js} +2 -2
  213. package/dashboard/dist/assets/{index-CptTEhWp.js.map → index-D_ojXTgO.js.map} +1 -1
  214. package/dashboard/dist/assets/index-Dafrbwk_.js +2 -0
  215. package/dashboard/dist/assets/{index-BvH8T-jb.js.map → index-Dafrbwk_.js.map} +1 -1
  216. package/dashboard/dist/assets/{index-czgLyfSo.js → index-Dk7nwVpm.js} +2 -2
  217. package/dashboard/dist/assets/{index-czgLyfSo.js.map → index-Dk7nwVpm.js.map} +1 -1
  218. package/dashboard/dist/assets/{index-CDxOQ84B.js → index-DvkcyTE2.js} +2 -2
  219. package/dashboard/dist/assets/{index-CDxOQ84B.js.map → index-DvkcyTE2.js.map} +1 -1
  220. package/dashboard/dist/assets/{index-C1iuZ4Q5.js → index-WPVpyoD3.js} +2 -2
  221. package/dashboard/dist/assets/{index-C1iuZ4Q5.js.map → index-WPVpyoD3.js.map} +1 -1
  222. package/dashboard/dist/assets/{index-C-QQ5rKF.js → index-YGTGxcTF.js} +2 -2
  223. package/dashboard/dist/assets/{index-C-QQ5rKF.js.map → index-YGTGxcTF.js.map} +1 -1
  224. package/dashboard/dist/assets/{index-ujGmmwl6.js → index-vgHzaGmW.js} +2 -2
  225. package/dashboard/dist/assets/{index-ujGmmwl6.js.map → index-vgHzaGmW.js.map} +1 -1
  226. package/dashboard/dist/assets/{knowledge-150lsM68.js → knowledge-L_zY1zmy.js} +2 -2
  227. package/dashboard/dist/assets/{knowledge-150lsM68.js.map → knowledge-L_zY1zmy.js.map} +1 -1
  228. package/dashboard/dist/assets/{mcp-query-CDsSMaYq.js → mcp-query-CFbGudkb.js} +2 -2
  229. package/dashboard/dist/assets/{mcp-query-CDsSMaYq.js.map → mcp-query-CFbGudkb.js.map} +1 -1
  230. package/dashboard/dist/assets/{mcp-CRtY4v5W.js → mcp-wCWFRA0T.js} +2 -2
  231. package/dashboard/dist/assets/{mcp-CRtY4v5W.js.map → mcp-wCWFRA0T.js.map} +1 -1
  232. package/dashboard/dist/assets/{personas-C2Wm4ng1.js → personas-B_VIacZJ.js} +2 -2
  233. package/dashboard/dist/assets/{personas-C2Wm4ng1.js.map → personas-B_VIacZJ.js.map} +1 -1
  234. package/dashboard/dist/assets/{pipelines-BH0F9-jf.js → pipelines-Bv0Z8xQA.js} +2 -2
  235. package/dashboard/dist/assets/{pipelines-BH0F9-jf.js.map → pipelines-Bv0Z8xQA.js.map} +1 -1
  236. package/dashboard/dist/assets/{tasks-BkUVpaOa.js → tasks-DP6yaNZs.js} +2 -2
  237. package/dashboard/dist/assets/{tasks-BkUVpaOa.js.map → tasks-DP6yaNZs.js.map} +1 -1
  238. package/dashboard/dist/assets/{topics-Crl8HKHq.js → topics-UBSIcpSR.js} +2 -2
  239. package/dashboard/dist/assets/{topics-Crl8HKHq.js.map → topics-UBSIcpSR.js.map} +1 -1
  240. package/dashboard/dist/assets/{useDebouncedValue-Dk3r5xo-.js → useDebouncedValue-R62q3Xpx.js} +2 -2
  241. package/dashboard/dist/assets/{useDebouncedValue-Dk3r5xo-.js.map → useDebouncedValue-R62q3Xpx.js.map} +1 -1
  242. package/dashboard/dist/assets/{useNamespace-BXuyHKAs.js → useNamespace-CAaszJDE.js} +2 -2
  243. package/dashboard/dist/assets/{useNamespace-BXuyHKAs.js.map → useNamespace-CAaszJDE.js.map} +1 -1
  244. package/dashboard/dist/assets/{useYamlActivityEvents-DSlkjQfb.js → useYamlActivityEvents-emCp9U69.js} +2 -2
  245. package/dashboard/dist/assets/{useYamlActivityEvents-DSlkjQfb.js.map → useYamlActivityEvents-emCp9U69.js.map} +1 -1
  246. package/dashboard/dist/assets/validate-C7yskdEn.js +2 -0
  247. package/dashboard/dist/assets/validate-C7yskdEn.js.map +1 -0
  248. package/dashboard/dist/assets/{vendor-icons-C_DQEeBy.js → vendor-icons-DUYcKTjP.js} +2 -2
  249. package/dashboard/dist/assets/{vendor-icons-C_DQEeBy.js.map → vendor-icons-DUYcKTjP.js.map} +1 -1
  250. package/dashboard/dist/assets/{yaml-workflows-B230v5Za.js → yaml-workflows-C2sOwz1p.js} +2 -2
  251. package/dashboard/dist/assets/{yaml-workflows-B230v5Za.js.map → yaml-workflows-C2sOwz1p.js.map} +1 -1
  252. package/dashboard/dist/index.html +2 -2
  253. package/docs/accumulator.md +1 -1
  254. package/docs/api/http/escalations.md +33 -0
  255. package/docs/api/sdk/escalations.md +26 -1
  256. package/docs/code-owned-configuration.md +2 -2
  257. package/docs/domain-dictionary.md +19 -3
  258. package/docs/faceted-routing.md +4 -3
  259. package/docs/hitl/escalation.md +9 -0
  260. package/docs/hitl/x-lt-display.md +1 -1
  261. package/docs/hitl/x-lt-embed.md +2 -0
  262. package/docs/hitl/x-lt-roster.md +32 -8
  263. package/docs/scan-codes.md +45 -3
  264. package/package.json +2 -2
  265. package/dashboard/dist/assets/AvailableEscalationsPage-D1mCqj8Z.js +0 -2
  266. package/dashboard/dist/assets/EscalationTimeline-D6jrDcBb.js +0 -2
  267. package/dashboard/dist/assets/FormattedValue-CUtv1g3k.js +0 -2
  268. package/dashboard/dist/assets/FormattedValue-CUtv1g3k.js.map +0 -1
  269. package/dashboard/dist/assets/OperatorDashboard-BoeZIyup.js +0 -2
  270. package/dashboard/dist/assets/PortalPage-DjfjerpF.js +0 -2
  271. package/dashboard/dist/assets/ResolverForm-Bl8Pibyz.js +0 -8
  272. package/dashboard/dist/assets/ResolverForm-Bl8Pibyz.js.map +0 -1
  273. package/dashboard/dist/assets/ScanStationPage-BiO34nov.js +0 -2
  274. package/dashboard/dist/assets/ScanStationPage-BiO34nov.js.map +0 -1
  275. package/dashboard/dist/assets/escalation-columns-CSE5wfWQ.js +0 -2
  276. package/dashboard/dist/assets/escalation-items-BIgBWbaw.js +0 -2
  277. package/dashboard/dist/assets/escalation-items-BIgBWbaw.js.map +0 -1
  278. package/dashboard/dist/assets/index-BaCDL5fh.js.map +0 -1
  279. package/dashboard/dist/assets/index-BvH8T-jb.js +0 -2
  280. package/dashboard/dist/assets/index-CED9cLE2.js +0 -3
  281. package/dashboard/dist/assets/index-CED9cLE2.js.map +0 -1
  282. package/dashboard/dist/assets/index-D1lfq5iZ.js +0 -13
@@ -1,2 +1,2 @@
1
- import{u as l,b as a,c as s}from"./vendor-query-DvWWuNIB.js";import{m as r}from"./index-BaCDL5fh.js";function f(e={}){const o=new URLSearchParams;return e.status&&o.set("status",e.status),e.graph_topic&&o.set("graph_topic",e.graph_topic),e.app_id&&o.set("app_id",e.app_id),e.search&&o.set("search",e.search),e.set_id&&o.set("set_id",e.set_id),e.limit&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows?${o}`)})}function m(){return l({queryKey:["yamlWorkflowAppIds"],queryFn:()=>r("/yaml-workflows/app-ids")})}function c(e){return l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows/${e}`),enabled:!!e})}function w(){const e=a();return s({mutationFn:o=>r("/yaml-workflows",{method:"POST",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function k(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/deploy`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function p(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/activate`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function d(){const e=a();return s({mutationFn:({id:o,data:t,sync:n,execute_as:u})=>r(`/yaml-workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,sync:n,...u?{execute_as:u}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function h(){const e=a();return s({mutationFn:({id:o,task_queue:t,compilation_feedback:n})=>r(`/yaml-workflows/${o}/regenerate`,{method:"POST",body:JSON.stringify({task_queue:t,compilation_feedback:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function q(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/archive`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function W(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/restore`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"}),e.invalidateQueries({queryKey:["yamlWorkflow"],refetchType:"all"})}})}function S(){const e=a();return s({mutationFn:({id:o,...t})=>r(`/yaml-workflows/${o}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function v(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function T(e){return l({queryKey:["yamlWorkflows",e,"versions"],queryFn:()=>r(`/yaml-workflows/${e}/versions`),enabled:!!e})}function F(e,o){return l({queryKey:["yamlWorkflows",e,"versions",o],queryFn:()=>r(`/yaml-workflows/${e}/versions/${o}`),enabled:!!e&&o!==null})}export{m as a,S as b,c,T as d,k as e,p as f,q as g,W as h,v as i,h as j,F as k,d as l,w as m,f as u};
2
- //# sourceMappingURL=yaml-workflows-B230v5Za.js.map
1
+ import{u as l,b as a,c as s}from"./vendor-query-DvWWuNIB.js";import{m as r}from"./index-D7peGNN0.js";function f(e={}){const o=new URLSearchParams;return e.status&&o.set("status",e.status),e.graph_topic&&o.set("graph_topic",e.graph_topic),e.app_id&&o.set("app_id",e.app_id),e.search&&o.set("search",e.search),e.set_id&&o.set("set_id",e.set_id),e.limit&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows?${o}`)})}function m(){return l({queryKey:["yamlWorkflowAppIds"],queryFn:()=>r("/yaml-workflows/app-ids")})}function c(e){return l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows/${e}`),enabled:!!e})}function w(){const e=a();return s({mutationFn:o=>r("/yaml-workflows",{method:"POST",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function k(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/deploy`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function p(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/activate`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function d(){const e=a();return s({mutationFn:({id:o,data:t,sync:n,execute_as:u})=>r(`/yaml-workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,sync:n,...u?{execute_as:u}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function h(){const e=a();return s({mutationFn:({id:o,task_queue:t,compilation_feedback:n})=>r(`/yaml-workflows/${o}/regenerate`,{method:"POST",body:JSON.stringify({task_queue:t,compilation_feedback:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function q(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/archive`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function W(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/restore`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"}),e.invalidateQueries({queryKey:["yamlWorkflow"],refetchType:"all"})}})}function S(){const e=a();return s({mutationFn:({id:o,...t})=>r(`/yaml-workflows/${o}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function v(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function T(e){return l({queryKey:["yamlWorkflows",e,"versions"],queryFn:()=>r(`/yaml-workflows/${e}/versions`),enabled:!!e})}function F(e,o){return l({queryKey:["yamlWorkflows",e,"versions",o],queryFn:()=>r(`/yaml-workflows/${e}/versions/${o}`),enabled:!!e&&o!==null})}export{m as a,S as b,c,T as d,k as e,p as f,q as g,W as h,v as i,h as j,F as k,d as l,w as m,f as u};
2
+ //# sourceMappingURL=yaml-workflows-C2sOwz1p.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"yaml-workflows-B230v5Za.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
1
+ {"version":3,"file":"yaml-workflows-C2sOwz1p.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"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"}
@@ -8,10 +8,10 @@
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
11
- <script type="module" crossorigin src="./assets/index-BaCDL5fh.js"></script>
11
+ <script type="module" crossorigin src="./assets/index-D7peGNN0.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="./assets/vendor-query-DvWWuNIB.js">
13
13
  <link rel="modulepreload" crossorigin href="./assets/vendor-react-_9U4mKFr.js">
14
- <link rel="modulepreload" crossorigin href="./assets/vendor-icons-C_DQEeBy.js">
14
+ <link rel="modulepreload" crossorigin href="./assets/vendor-icons-DUYcKTjP.js">
15
15
  <link rel="stylesheet" crossorigin href="./assets/index-CnU7Jjz3.css">
16
16
  </head>
17
17
  <body>
@@ -53,7 +53,7 @@ Written by the fold at creation, inside the row's Leg1 commit, and maintained by
53
53
  | `envelope` | `accumulate_items` | `Record<itemKey, { payload?, at, actor?, reciprocalId? }>` |
54
54
  | `envelope` | `accumulate_config` | the folded `{ unique, resolveAtMax }` |
55
55
 
56
- A batch row records each fill's time and actor under `envelope.batch_filled_at` and `envelope.batch_filled_by`, and may start with entries already satisfied through `filled` (see [Creating Escalations](hitl/escalation.md)). A batch wait may add `partialOnTimeout: true`; it stores `envelope.batch_partial_on_timeout` and its timer delivers `{ ...filledItems, $trigger: 'timeout' }` instead of `false`.
56
+ A batch row records each fill's time and actor under `envelope.batch_filled_at` and `envelope.batch_filled_by`, and may start with entries already satisfied through `filled` (see [Creating Escalations](hitl/escalation.md)). A batch wait may add `partialOnTimeout: true`; it stores `envelope.batch_partial_on_timeout` and its timer delivers `{ ...filledItems, $trigger: 'timeout' }` instead of `false`. A pending key may carry a flag in `envelope.batch_flags` (it stays pending and still fills); a wait that adds `wakeOnFlag: true` ends on the first flag and delivers `{ ...filledItems, $flags, $trigger: 'flag' }`.
57
57
 
58
58
  ## Operations
59
59
 
@@ -1137,6 +1137,39 @@ Submit ONE declared item of a batch escalation (a `conditional` wait created wit
1137
1137
 
1138
1138
  Claim semantics: claim-agnostic by default; `assertClaim: true` (by id) requires the caller's own live claim, asserted atomically. RBAC mirrors the single-resolve forms: the by-id form answers 404 for rows outside the caller's read scope and 403 inside it but outside write scope; the ingress forms collapse a write denial to 404.
1139
1139
 
1140
+ ### Batch item flags
1141
+
1142
+ ```
1143
+ POST /api/escalations/:id/flag-batch-item
1144
+ POST /api/escalations/:id/unflag-batch-item
1145
+ ```
1146
+
1147
+ Flag ONE pending key of a batch escalation, or clear its flag. **Body:** `{ itemKey, label, payload? }` to flag, `{ itemKey }` to unflag.
1148
+
1149
+ A flag writes `envelope.batch_flags[itemKey]` (`label`, `payload`, the caller as `actor`, the database `at`) in one statement, only while the row and the key are pending. The key stays pending and still fills. On a wait declared with `wakeOnFlag`, the flag resolves the row (recording the caller in `metadata.resolved_by`) and the workflow wakes with the items so far, `$flags` and `$trigger: "flag"`: the answer is `{ outcome: 'completed', workflowId }`. Otherwise it is `{ outcome: 'flagged' }`.
1150
+
1151
+ Refusals: a key already filled 409, a key without a flag (unflag) 409, an undeclared key 400, a non-batch row 400, a row no longer pending 409. RBAC is the by-id batch fill's: 404 outside read scope, 403 outside write scope. Both carry `X-LT-Acting-Token` as the other work verbs do.
1152
+
1153
+ ### Roster actions
1154
+
1155
+ ```
1156
+ POST /api/escalations/:id/roster-action
1157
+ ```
1158
+
1159
+ Run one action a [roster](../../hitl/x-lt-roster.md#actions) entry offers on this row's form. **Body:** `{ field, action, entry, code? }`: the roster field, the action's index among its `x-lt-actions`, the entry key, and a key-in's entered code.
1160
+
1161
+ The request is a pointer. The server re-reads the action from the row's pinned form schema, requires the entry to be on the roster it computes, builds the payload from the declaration, and runs the act (resolve, batch fill, flag, unflag) through its own endpoint as the person acting, under their RBAC and `enforce_schema`. With `X-LT-Acting-Token`, the person acting is the badged person; the badge is read first and spent only when the act runs, and a use is returned when the act does not land.
1162
+
1163
+ | Status | `outcome` | Meaning |
1164
+ |--------|-----------|---------|
1165
+ | 403 | `needs_badge` | The action is limited to roles the person acting lacks; a badge of that role answers it |
1166
+ | 403 | `role_refused` | The badged person lacks the roles; the badge is not spent |
1167
+ | 401 | `not_primed` | The badge expired or was spent |
1168
+ | 422 | `code_mismatch` | The entered code does not name the entry's code |
1169
+ | 409 | | The action or the entry is no longer offered |
1170
+
1171
+ Otherwise the answer is the act's own.
1172
+
1140
1173
  ## Accumulate items
1141
1174
 
1142
1175
  ```
@@ -453,7 +453,7 @@ if (bin === null) return cancelled();
453
453
  ship(bin.$accumulated.map((item) => item.itemKey), bin.$trigger);
454
454
  ```
455
455
 
456
- Requires hotmesh 0.29.0+. `conditional` accepts the same `accumulate` field and returns `T | false | null`; `partialOnTimeout: true` on a `batch` wait likewise makes the timer deliver the filled items with `$trigger: 'timeout'`. See [Creating Escalations](../../hitl/escalation.md#open-accumulation--items-arrive-over-time).
456
+ Requires hotmesh 0.29.0+. `conditional` accepts the same `accumulate` field and returns `T | false | null`; `partialOnTimeout: true` on a `batch` wait likewise makes the timer deliver the filled items with `$trigger: 'timeout'`, and `wakeOnFlag: true` makes a flag on a pending key deliver them with `$flags` and `$trigger: 'flag'` (hotmesh 0.31.3+). See [Creating Escalations](../../hitl/escalation.md#open-accumulation--items-arrive-over-time).
457
457
 
458
458
  ### Two-step form
459
459
 
@@ -859,6 +859,31 @@ await lt.escalations.resolveBatchItemByMetadata({ key, value, itemKey, resolverP
859
859
 
860
860
  **Auth:** Required
861
861
 
862
+ ## flagBatchItem / unflagBatchItem
863
+
864
+ Flag ONE pending key of a batch escalation (for example, `Missing`), or clear its flag. The flag lands in `envelope.batch_flags[itemKey]` with the caller as its actor; the key stays pending and still fills. A wait declared with `wakeOnFlag: true` ends on the flag, and the workflow wakes with the items so far, `$flags` and `$trigger: 'flag'`.
865
+
866
+ ```typescript
867
+ await lt.escalations.flagBatchItem({ id, itemKey: '00812999000011#1', label: 'Missing', payload: { note: 'not on the pallet' } });
868
+ await lt.escalations.unflagBatchItem({ id, itemKey: '00812999000011#1' });
869
+ ```
870
+
871
+ **Returns:** `LTApiResult<{ outcome: 'flagged' | 'completed' | 'unflagged', itemKey, escalationId, workflowId? }>`. 409 for a key already filled, a key without a flag, or a row no longer pending; 400 for an undeclared key or a non-batch row.
872
+
873
+ **Auth:** Required
874
+
875
+ ## runRosterAction
876
+
877
+ Run one action a [roster](../../hitl/x-lt-roster.md#actions) entry offers on a row's form, by pointer: the roster field, the action's index, the entry key, and a key-in's entered code. The server re-reads the action, checks the entry and any `roles` limit, and runs the act as the caller (or as the badged person with `actingToken`).
878
+
879
+ ```typescript
880
+ await lt.escalations.runRosterAction({ id: matchingRowId, field: 'shoes', action: 2, entry: '00812999000011#1', code: '812999000011' });
881
+ ```
882
+
883
+ **Returns:** the act's own result, or a refusal with `outcome` `needs_badge`, `role_refused`, `not_primed` or `code_mismatch`.
884
+
885
+ **Auth:** Required
886
+
862
887
  ## accumulate / accumulateBySignalKey / accumulateByMetadata
863
888
 
864
889
  Add ONE item to an open accumulator escalation (`conditionalAccumulator` with `accumulate: {...}`). Interim adds return `accepted` with the count held and slots remaining; the add that reaches `max` returns `completed` and the waiting workflow resumes with the ordered collection, in the same statement. See [Resolution — Accumulator items](../../hitl/resolution.md#accumulator-items).
@@ -50,7 +50,7 @@ topics: [
50
50
  ],
51
51
  ```
52
52
 
53
- The domain dictionary's override lives beside its path:
53
+ The domain dictionary's override lives beside its declaration:
54
54
  `mcp.domainDictionaryReset`.
55
55
 
56
56
  ## Per-surface semantics
@@ -64,7 +64,7 @@ The domain dictionary's override lives beside its path:
64
64
  | Agents | `agents[]` | description, status, goals, rules, domain, schedules | capabilities, metadata, run history |
65
65
  | Agent subscriptions | `agents[].subscriptions` | reaction fields on (agent, topic) | `enabled` — the admin kill-switch |
66
66
  | Scan schemes | `scanSchemes[]` | whole scheme + its rules (one ownership unit; `enabled` is declarative here) | — |
67
- | Domain dictionary | `mcp.domainDictionaryPath` | whole document (version bumps once per change) | — |
67
+ | Domain dictionary | `mcp.domainDictionary` (inline) or `mcp.domainDictionaryPath` | whole document (version bumps once per change) | — |
68
68
  | Graph workflows | `graphWorkflows[]` | always compare-and-apply: description/schema sync, redeploy on YAML version bump | run history |
69
69
 
70
70
  `certified` on a workflow profile is explicit-only under code ownership: an
@@ -78,14 +78,30 @@ same `PATCH /api/roles/:role` that manages every other role dial:
78
78
 
79
79
  ## Registration and editing
80
80
 
81
- Seed at boot by pointing the start config at a JSON file:
81
+ Declare the dictionary in the start config, inline like roles and topics:
82
+
83
+ ```typescript
84
+ mcp: {
85
+ domainDictionary: {
86
+ name: 'floor',
87
+ version: '3',
88
+ overview: 'Orders move from print to ship; each station is a role.',
89
+ terms: [ { term: 'bin', kind: 'entity', maps_to: { role: 'binning' }, guidance: '...' } ],
90
+ },
91
+ }
92
+ ```
93
+
94
+ or point it at a JSON file holding the same document:
82
95
 
83
96
  ```typescript
84
97
  mcp: { domainDictionaryPath: 'src/longtail/domain.json' }
85
98
  ```
86
99
 
87
- Seeding is insert-if-absent: the DB row is runtime truth, and a name/version
88
- mismatch between file and DB logs a drift warning. Edit live with
100
+ Declare one of the two; both at once stops startup with an error. Under
101
+ `configSource: 'code'` (or `mcp.domainDictionaryReset: true`) the declared
102
+ document is compared and applied on every boot, one version bump per change.
103
+ Otherwise seeding is insert-if-absent: the DB row is runtime truth, and a
104
+ name/version mismatch between the declaration and the DB logs a drift warning. Edit live with
89
105
  `PUT /api/domain` (admin) — the body is `{ doc, expected_version? }`;
90
106
  `expected_version` arms optimistic concurrency (409 on conflict). Writes
91
107
  validate references against the live registries: unknown roles and workflows
@@ -123,14 +123,15 @@ Values are strings — jsonb containment is type-sensitive, so numeric facets
123
123
  are not templatable. Link variables are a view convenience: RBAC read scope
124
124
  still governs what any query can return.
125
125
 
126
- `{lt:me}` is built in: it always reads the signed-in user's id, so one pin
127
- means "mine" for whoever signs in on a shared station. Every completing
126
+ `{lt:me}` is built in: it reads the person acting, the badged person while a
127
+ badge grant is live and the signed-in user otherwise, so one pin means "mine"
128
+ on a shared station and on a personal login. Every completing
128
129
  resolve records its completer in the row's `metadata.resolved_by` (resolves,
129
130
  batch fills, both rows of an accumulate add, scan acts), so a role can pin a
130
131
  "My recent work" list, newest first:
131
132
 
132
133
  ```
133
- /escalations?status=resolved&facets={"resolved_by":"{lt:me}"}&orderBy=[{"field":"resolved_at","direction":"desc"}]
134
+ /escalations/available?status=resolved&facets={"resolved_by":"{lt:me}"}&orderBy=[{"field":"resolved_at","direction":"desc"}]
134
135
  ```
135
136
 
136
137
  `resolved_at` sorts with rows that have no completion time last, in either
@@ -106,6 +106,15 @@ Items are submitted via `POST /api/escalations/:id/resolve-batch-item`, `POST /a
106
106
 
107
107
  `timeout` and cancellation keep their standard semantics (`false` / `null`); a plain resolve on a batch row remains an admin override that resolves the whole row with the payload given. Add `partialOnTimeout: true` (hotmesh 0.29.0+) and the timer instead resumes the wait with the items filled so far plus `$trigger: 'timeout'`, the same value the expired row stores as `resolver_payload`.
108
108
 
109
+ A pending key can be flagged (`flagBatchItem`, or a [roster](x-lt-roster.md#actions) action): the flag is stored in `envelope.batch_flags[itemKey]` and the key stays pending. Add `wakeOnFlag: true` (hotmesh 0.31.3+) and a flag ends the wait instead: it resumes with the items filled so far, `$flags` (each flag's `label`, `payload`, `actor` and `at`) and `$trigger: 'flag'`, so the workflow can route the order, for example to a manager.
110
+
111
+ ```typescript
112
+ const result = await conditional<Record<string, unknown>>(signalId, {
113
+ role: 'matching', metadata: { orderId }, batch: shoeKeys, wakeOnFlag: true,
114
+ });
115
+ if (result && result.$trigger === 'flag') return sendToManager(orderId, result.$flags);
116
+ ```
117
+
109
118
  Entries already satisfied before the wait begins go in `filled` (hotmesh 0.31.0+), keyed by item key with their `payload`, the `at` they were satisfied (from the source of record, never a clock read in the workflow), and an optional `actor`. The row starts with that progress: those keys are left out of `batch_pending`, their payloads, times, and actors are written beside the rest, and the completing wake delivers them with the collection. Every key in `filled` must be declared in `batch`, and at least one must stay open; a `filled` that covers every key throws, so skip the wait instead.
110
119
 
111
120
  ```typescript
@@ -10,7 +10,7 @@ Read-only facts — order numbers, quantities, product names — render as a den
10
10
  | Section | `x-lt-section-options` at the schema root | read-only fields in that section |
11
11
  | Schema | at the schema root | every read-only field |
12
12
 
13
- Only read-only fields (`readOnly: true`) render as dictionary rows. Editable fields keep their inputs, and content widgets (`markdown`, `attachment`, `image`) keep their block rendering regardless of display settings.
13
+ Only read-only fields (`readOnly: true`) render as dictionary rows. Editable fields keep their inputs, and content widgets (`markdown`, `attachment`, `image`) and embed widgets (`link`, `escalation`, `escalation-list`, `invoke`, `roster`) keep their block rendering regardless of display settings.
14
14
 
15
15
  ```json
16
16
  {
@@ -209,6 +209,8 @@ On success the row updates in place through the standard query invalidation —
209
209
 
210
210
  Declare one action for the happy path and leave the exception path to the form. A batch of N sibling items collapses from N navigations to N clicks on one page.
211
211
 
212
+ An action limited to roles (`roles`) belongs on a [roster](x-lt-roster.md#actions), whose actions run on the server where the limit is checked. The escalation list does not offer an action that declares `roles`.
213
+
212
214
  ### Empty and loading states
213
215
 
214
216
  - **Loading** — three skeleton rows are displayed.
@@ -1,6 +1,6 @@
1
1
  # Roster (`x-lt-widget: "roster"`)
2
2
 
3
- A roster lists every member a container row expects, each marked **waiting**, **in**, or **flagged**, with the count in its heading ("3 of 5 in · 1 Missing"). The person works from it: a member that arrives ticks in, an action on a member resolves its row in place, and the rest of the form can wait until every member is accounted for.
3
+ A roster lists every member a container row expects, each marked **waiting**, **in**, or **flagged**, with the count in its heading ("3 of 5 in · 1 Missing"). The person works from it: a member that arrives ticks in, an action on an entry acts in place, and the rest of the form can wait until every member is accounted for.
4
4
 
5
5
  Like the other [embed widgets](x-lt-embed.md), a roster is display-only: declare it `readOnly`, keep it out of `required`, and it contributes nothing to the resolver payload.
6
6
 
@@ -42,12 +42,13 @@ Like the other [embed widgets](x-lt-embed.md), a roster is display-only: declare
42
42
  | `key` | For a `query` set: a template naming each member row's entry. Default `{{escalation.id}}`. |
43
43
  | `in` | Where arrivals are read. `items` reads the row's held keys (its accumulated items, or a batch's filled keys); any other entry is a `domain.path` naming a string or an array, such as a scan field in the live form (`resolver.bags`, a field the form declares). Default `["items"]`. |
44
44
  | `flagged` | Rules over each member row's own context: `when` is an [`x-lt-showIf`](x-lt-show-if.md) condition (or an array of them), `label` is the text the entry shows. The first matching rule wins. |
45
+ | `countedBy` | The separator of counted keys (`"#"` for `<code>#1`, `<code>#2`). The nth occurrence of a code in an `in` source then ticks `<code>#n`, so two scans of one code into a form field tick both of its keys. |
45
46
 
46
47
  ### Expected sets
47
48
 
48
49
  | Set | Shape | Entries |
49
50
  |-----|-------|---------|
50
- | `query` | `{ "role": "...", "roles": [...], "facets": {...}, "status": "..." }` | Member rows matching the role(s) and facets. Facet values are `{{domain.path}}` templates over the host row. Every status is read unless `status` names one, so a member resolved as missing stays on the roster. Up to 200 rows. |
51
+ | `query` | `{ "role": "...", "roles": [...], "facets": {...}, "status": "..." }` | Member rows matching the role(s) and facets. Facet values are `{{domain.path}}` templates over the host row. Every status is read unless `status` names one, so a member resolved as missing stays on the roster. Up to 200 rows. When several rows share a key (a member that parked again), the entry reads the newest. |
51
52
  | `list` | `"metadata.members"` | The keys in an array on the host row. |
52
53
  | `batch` | `true`, with optional `"labels": "envelope.boxLabels"` | The row's batch keys; a batch key is in once filled. `labels` names a per-key map whose entry each column reads as `{{item.label.*}}`. |
53
54
 
@@ -55,7 +56,7 @@ Stamp the container's id on each member row when the container opens (`packingBo
55
56
 
56
57
  ### State
57
58
 
58
- An entry is **in** when its key is held or appears in an `in` source, **flagged** when its member row matches a `flagged` rule, and **waiting** otherwise. In reads before flagged: a member a manager confirms into the box reads in, even though its own row was resolved as "needs a manager".
59
+ An entry is **in** when its key is held or appears in an `in` source, **flagged** when its member row matches a `flagged` rule (on a `batch` set, when its key carries a flag), and **waiting** otherwise. In reads before flagged: a member a manager confirms into the box reads in, even though its own row was resolved as "needs a manager".
59
60
 
60
61
  ## Columns
61
62
 
@@ -65,22 +66,45 @@ An entry is **in** when its key is held or appears in an `in` source, **flagged*
65
66
  |-------|-------|
66
67
  | `{{item.itemKey}}` | The entry key |
67
68
  | `{{item.label.*}}` | The entry's value in a batch `labels` map |
68
- | `{{item.payload.*}}`, `{{item.actor}}`, `{{item.at}}` | The held item, once it is in |
69
+ | `{{item.payload.*}}`, `{{item.actor}}`, `{{item.at}}` | The item once it is in: its payload, who filled it, and when. A batch entry reads them from `batch_items`, `batch_filled_by` and `batch_filled_at`, whether the key was filled by a scan, the API, or `conditional`'s `filled`. |
70
+
71
+ `format: "date"` renders a time and `format: "user"` a person's name: `{ "label": "Received", "value": "{{item.at}}", "format": "date" }`, `{ "label": "By", "value": "{{item.actor}}", "format": "user" }`.
69
72
 
70
73
  Without `x-lt-columns`, each entry shows its key.
71
74
 
72
75
  ## Actions
73
76
 
74
- `x-lt-actions` resolve the entry's member row through the standard resolve endpoint, as the [escalation list's actions](x-lt-embed.md#x-lt-actions-optional) do: RBAC and `enforce_schema` apply, the resolve records the viewer in the row's `metadata.resolved_by`, and a refused action shows the server's reason on the entry.
77
+ Each `x-lt-actions` entry is one act on the entry:
78
+
79
+ | Act | Shape | Offered by default | What it does |
80
+ |-----|-------|--------------------|--------------|
81
+ | Resolve | `"resolverPayload": { ... }` | `waiting` | Resolves the entry's member row (a `query` set). String leaves interpolate against the member row. |
82
+ | Fill | `"fill": { "payload": { ... }, "enterCode": true }` | `waiting`, `flagged` | Fills the entry's batch key, as a scan would. With `enterCode`, the person types the code from the label and the server checks it against the key (a UPC-A matches its GTIN-14 key); the payload records it as `enteredCode`. |
83
+ | Flag | `"flag": { "label": "Missing", "payload": { ... } }` | `waiting` | Flags the entry's batch key. The key stays pending and still fills; the entry reads flagged under the label and counts in `roster.<field>.flagged`. |
84
+ | Unflag | `"unflag": true` | `flagged` | Clears the entry's flag while the row is pending ("Found it"). |
75
85
 
76
86
  | Field | Description |
77
87
  |-------|-------------|
78
88
  | `label` | Button text |
79
- | `resolverPayload` | The canned payload; string leaves interpolate against the member row |
80
- | `when` | The entry state(s) that offer the action: `"waiting"` (default), `"in"`, `"flagged"`, or an array |
89
+ | `when` | The entry state(s) that offer the action: `"waiting"`, `"in"`, `"flagged"`, or an array |
81
90
  | `confirm` | A confirmation asked in place, beside the entry, before firing |
91
+ | `roles` | The action runs only for a person holding one of these roles |
92
+ | `refuse` | What a person without the roles is told |
93
+
94
+ ```json
95
+ "x-lt-actions": [
96
+ { "label": "Missing", "flag": { "label": "Missing" }, "confirm": "Mark this shoe missing?" },
97
+ { "label": "Found it", "unflag": true },
98
+ { "label": "Key in (manager)", "fill": { "payload": { "source": "key-in" }, "enterCode": true },
99
+ "roles": ["manager"], "refuse": "A manager's badge is needed to key a box in." }
100
+ ]
101
+ ```
102
+
103
+ **Actions run on the server.** The dashboard sends only which action and which entry (`POST /api/escalations/:id/roster-action`). The server re-reads the action from the row's pinned form schema, confirms the entry is on the roster it computes, builds the payload from the declaration, and checks `roles` against the person acting. The act then runs through its own endpoint (resolve, batch fill, flag, unflag) under that person's RBAC and `enforce_schema`, records them as the resolver, filler or flagger, and shows a refusal's reason on the entry.
104
+
105
+ **Roles and badges.** An action with `roles` shows to everyone. A person without one of the roles is asked for a badge, and the action runs as whoever badges in; a badge without the roles is refused with `refuse`, and the badge is not spent. On a read-only station login every action runs through a badge, as before. A role limit is an act control layered on RBAC: the person must also be allowed to write the row.
82
106
 
83
- An entry with no member row (a `list` or `batch` set) offers no actions.
107
+ On a wait declared with `wakeOnFlag`, a flag ends the wait: the workflow wakes with the items filled so far, `$flags`, and `$trigger: "flag"`, and can route the order (for example, to a manager). Without it, the flag is recorded and the wait continues.
84
108
 
85
109
  Moving work to another person is a resolve with an outcome. "Send to a manager" above resolves the member row with `outcome: "needs-manager"`; the member's workflow opens a row in the manager's role, where only a manager can resolve it, and the manager's confirm adds the bag to the box.
86
110
 
@@ -278,6 +278,19 @@ duration, form on screen. An unsatisfied identity requirement never
278
278
  auto-fires as the wrong actor — the scan stops over at the badge screen and
279
279
  completes on its own once a badge primes.
280
280
 
281
+ **Choices limited to a role.** A choice may declare `roles`: it shows to
282
+ everyone and runs only for a person holding one of them (superadmin always
283
+ does). A station without a badge of that role sees the choice withheld and is
284
+ asked for one; a badge without the role is refused with the choice's `refuse`
285
+ copy, and the badge is not spent. The manager walks over, badges, and the
286
+ choice runs as the manager.
287
+
288
+ ```jsonc
289
+ { "label": "Add without scan", "verb": "resolve", "roles": ["manager"],
290
+ "refuse": "A manager's badge is needed to add a bag without its scan.",
291
+ "params": { "resolverPayload": { "outcome": "added-by-manager" } } }
292
+ ```
293
+
281
294
  ## Holding an item: the bench motion
282
295
 
283
296
  At a bench where items go into containers, every act is one item going into
@@ -312,6 +325,19 @@ reads. A fill or an into-subject add that leaves slots open shows its done
312
325
  copy under the hold; without done copy the station shows the count ("2 of 5
313
326
  checked off" for a fill, "2 of 5 added" for an add).
314
327
 
328
+ **The held row's list on screen.** `hold.show` names a [roster](hitl/x-lt-roster.md)
329
+ field of the held row's form. The station renders that roster, with its columns
330
+ and heading, under the hold card for as long as the row is held, refreshed on
331
+ the row's own events and after each scan. Each fill ticks its entry in while the
332
+ motion continues, and a refused scan reads on the hold card with the list
333
+ unchanged.
334
+
335
+ ```jsonc
336
+ "params": { "hold": { "ttlSeconds": 300, "label": "{item.orderId}",
337
+ "expect": { "schemes": [16], "prompt": "Scan each shoe box." },
338
+ "show": "shoes" } }
339
+ ```
340
+
315
341
  The server trusts nothing about the subject. Each request re-parses its
316
342
  code, re-reads the row under the station's read scope, requires the row to
317
343
  still carry the code's target and to be pending. A subject that fails is
@@ -328,14 +354,30 @@ row.
328
354
  | `accumulate` with `accumulate.into: "subject"` | The held row collects the scanned code (`itemKey` defaults to `{scan.target}`). Use it when the container has no row yet: the first item for a container tells the workflow which container was scanned. With `accumulate.item`, the scanned code's own pending row is written as the reciprocal in the same statement (see below). On a bounded accumulator the answer carries `progress` and the subject stays held while slots remain. |
329
355
  | `fill` with `fill.into: "subject"` | One expected item is checked off: the held row is a batch whose keys are codes, and the scan fills the first open key for its code. A code expected twice is declared `<code>#1`, `<code>#2` and takes two scans; a third is refused. The answer carries `progress: { filled, total, remaining }`, the subject stays held while items remain, and the last fill completes the row. On a `gtin` scheme a refusal's `expected` lists codes as the package prints them (EAN-13, or EAN-8), not the stored 14-digit form. `fill.into: "scanned"` fills the row the scan itself names. |
330
356
 
357
+ **Naming what a fill still expects.** Codes alone do not tell a person which
358
+ box to take. `fill.labels` names a per-key map on the batch row (the map a batch
359
+ roster's `labels` names, e.g. `envelope.shoe_labels`), and `fill.label` how one
360
+ entry reads: `{label.<path>}` reads the entry's map value and `{code}` its
361
+ printed code. With them, `{fill.pending}` lists the open entries by label,
362
+ `{fill.next}` names the next one (in done copy, the one after this fill), and a
363
+ refusal's `expected` reads the labels. An entry the map does not name reads as
364
+ its code; without `fill.labels`, both tokens read codes.
365
+
366
+ ```jsonc
367
+ "refuse": { "markdown": "Not one of this order's shoes. Still to match: {fill.pending}." },
368
+ "done": { "markdown": "Matched. Next: {fill.next}" },
369
+ "params": { "fill": { "into": "subject", "labels": "envelope.shoe_labels",
370
+ "label": "{label.model}, {label.size} (UPC {code})" } }
371
+ ```
372
+
331
373
  **`match` and `refuse`** check the pairing before anything is written.
332
374
  `match.target` lists templates the scanned target must equal (e.g.
333
375
  `["{subject.containerCode}"]`); `match.facets` lists facets the located container
334
376
  must share with the held row (e.g. `["containerKey"]`). A miss answers `refused`
335
377
  with `refuse.markdown` rendered, and nothing is written. The copy may read
336
- `{container.<facet>}` (the container the scan named) and `{fill.pending}`
337
- (what a fill still expects), so the station says what is wrong and where the
338
- item goes: "That's Acme West's container. This one goes in **C-12**." When the
378
+ `{container.<facet>}` (the container the scan named), `{fill.pending}`
379
+ (what a fill still expects) and `{fill.next}` (the next open entry), so the
380
+ station says what is wrong and where the item goes: "That's Acme West's container. This one goes in **C-12**." When the
339
381
  write itself loses a race (the container closed, another bench took the free
340
382
  container), the answer is `refused` with `refuse.conflict`, and a step that
341
383
  declares `refuse.conflict` also clears the subject so the next item scan
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/long-tail",
3
- "version": "0.25.0",
3
+ "version": "0.25.2",
4
4
  "description": "Long Tail Workflows — Durable AI workflows with human-in-the-loop escalation. Powered by PostgreSQL.",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -78,7 +78,7 @@
78
78
  "@anthropic-ai/sdk": "^0.92.0",
79
79
  "@aws-sdk/client-s3": "^3.1017.0",
80
80
  "@aws-sdk/s3-request-presigner": "^3.1045.0",
81
- "@hotmeshio/hotmesh": "^0.31.2",
81
+ "@hotmeshio/hotmesh": "^0.31.3",
82
82
  "@modelcontextprotocol/sdk": "^1.27.1",
83
83
  "@opentelemetry/exporter-trace-otlp-proto": "^0.215.0",
84
84
  "@opentelemetry/resources": "^2.5.1",
@@ -1,2 +0,0 @@
1
- import{a as m,j as e}from"./vendor-query-DvWWuNIB.js";import{w as ut,x as mt,c as xt,y as ht,M as Se,z as gt,A as ft,B as pt,E as bt,G as yt,H as jt,I as vt,K as Ct,L as kt,O as Nt,Q as wt,r as Pt,R as St,T as Rt,U as Et,V as Tt,W as At,X as Bt,Y as Ot,Z as Lt,_ as Mt,$ as Ft,a0 as zt,a1 as It,a2 as Ut,a3 as $t,a4 as Vt,a5 as _t,a6 as qt}from"./index-BaCDL5fh.js";import{a as Re,u as Ee,f as Ht}from"./vendor-react-_9U4mKFr.js";import{i as Kt}from"./task-queues-7-sHKPsN.js";import{X as re,ak as Dt,y as Gt,al as Qt,am as Wt,$ as Yt,j as Xt,an as Jt,P as Zt,ao as es}from"./vendor-icons-C_DQEeBy.js";import{u as Te,C as ts,r as ss,B as as,a as ns}from"./BulkAssignModal-CtISXXmW.js";import{E as is}from"./EscalationTitleSelect-CGGT-QTu.js";import{u as ls,E as rs,a as os,t as cs}from"./EscalationTimeline-D6jrDcBb.js";import{m as ds,E as us,a as ms}from"./escalation-columns-CSE5wfWQ.js";import{u as xs}from"./useFilterParams-DBRw1Hcv.js";import{u as hs}from"./useDebouncedValue-Dk3r5xo-.js";import{D as gs}from"./DataTable-FjFhx0SE.js";import{S as fs}from"./StickyPagination-BNOuYZ1m.js";import{P as ps}from"./constants-CeBBTzf5.js";import{R as bs,a as ys}from"./RowActions-Bdd7z4eB.js";import{i as js}from"./escalation-items-BIgBWbaw.js";import"./UserName-CPJPZnN1.js";import"./FormattedValue-CUtv1g3k.js";import"./EntityTimelinePanel-xgPRdKEq.js";import"./FilterBar-f-LEKcHI.js";import"./PriorityBadge-r33mpDju.js";import"./RolePill-Bw_n7EpR.js";import"./WorkflowPill-Cly9Ln_3.js";import"./CountdownTimer-5t8S2qMi.js";import"./EmptyState-DgC_6njU.js";import"./useContainerWidth-DSLp1gEm.js";import"./StatusBadge-DHVwxre2.js";function vs(){const{pathname:t,search:n}=Re(),u=Ee(),{resolveUrl:l}=ut();m.useEffect(()=>{const g=t+n;if(mt(g).length===0)return;const p=l(g);p!==g&&u(p,{replace:!0})},[t,n,l,u])}const Cs=["<","<=",">",">=","="],ks=["priority","created_at","updated_at","status","role"],O="input text-xs py-1",Ne="select text-xs py-1",H="text-text-tertiary hover:text-text-primary transition-colors";function we(t){return t==="true"?!0:t==="false"?!1:t.trim()!==""&&!Number.isNaN(Number(t))?Number(t):t}const Ns=t=>Object.entries(t??{}).map(([n,u])=>({key:n,value:String(u)})),ws=t=>(t??[]).map(n=>{const[u,l]=Object.entries(n)[0]??["",""];return{key:u,value:String(l)}});function A({title:t,hint:n,children:u}){return e.jsxs("div",{className:"border-t border-surface-border/50 py-3 first:border-t-0 first:pt-1",children:[e.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between",children:[e.jsx("span",{className:"text-2xs font-medium uppercase tracking-wide text-text-tertiary",children:t}),n&&e.jsx("span",{className:"text-2xs font-mono text-text-tertiary/70",children:n})]}),u]})}function K({value:t,onChange:n,placeholder:u}){return e.jsx("input",{list:"lt-facet-keys",className:`${O} w-40`,placeholder:u,value:t,onChange:l=>n(l.target.value)})}function Ps({value:t,onChange:n,facetKeys:u=[],search:l="",onSearchChange:g}){const p=Ns(t.facets),b=ws(t.block),f=t.range??[],r=t.exists??[],k=t.orderBy??[],P=a=>{const o={};for(const c of a)c.key&&(o[c.key]=we(c.value));n({...t,facets:Object.keys(o).length?o:void 0})},E=a=>{const o=a.filter(c=>c.key).map(c=>({[c.key]:we(c.value)}));n({...t,block:o.length?o:void 0})},T=a=>n({...t,range:a.length?a:void 0}),y=a=>n({...t,exists:a.length?a:void 0}),v=a=>n({...t,orderBy:a.length?a:void 0});return e.jsxs("div",{className:"text-xs",children:[e.jsx("datalist",{id:"lt-facet-keys",children:u.map(a=>e.jsx("option",{value:a},a))}),e.jsxs("datalist",{id:"lt-sort-fields",children:[ks.map(a=>e.jsx("option",{value:a},a)),u.map(a=>e.jsx("option",{value:`metadata.${a}`},a))]}),g&&e.jsx(A,{title:"Match id",hint:"id · workflow · origin",children:e.jsx("input",{className:`${O} w-full`,placeholder:"Exact escalation, workflow, or origin id…",value:l,onChange:a=>g(a.target.value)})}),e.jsx(A,{title:"Has facet",hint:"metadata @>",children:[...p,{key:"",value:""}].map((a,o)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(K,{value:a.key,placeholder:"key",onChange:c=>{const i=[...p];i[o]={...a,key:c},P(i)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${O} w-40`,placeholder:"value",value:a.value,onChange:c=>{const i=[...p];i[o]={...a,value:c.target.value},P(i)}}),o<p.length&&e.jsx("button",{className:H,onClick:()=>P(p.filter((c,i)=>i!==o)),children:"×"})]},o))}),e.jsx(A,{title:"Range",hint:"numeric",children:[...f,{facet:"",op:"<=",value:0}].map((a,o)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(K,{value:a.facet,placeholder:"numeric facet",onChange:c=>{const i=[...f];i[o]={...a,facet:c},T(i.filter(j=>j.facet))}}),e.jsx("select",{className:Ne,value:a.op,onChange:c=>{const i=[...f];i[o]={...a,op:c.target.value},T(i.filter(j=>j.facet))},children:Cs.map(c=>e.jsx("option",{value:c,children:c},c))}),e.jsx("input",{type:"number",className:`${O} w-24`,value:a.value,onChange:c=>{const i=[...f];i[o]={...a,value:Number(c.target.value)},T(i.filter(j=>j.facet))}}),o<f.length&&e.jsx("button",{className:H,onClick:()=>T(f.filter((c,i)=>i!==o)),children:"×"})]},o))}),e.jsx(A,{title:"Has key",hint:"metadata ? key",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[r.map(a=>e.jsxs("span",{className:"flex items-center gap-1 rounded bg-accent/15 px-1.5 py-0.5 text-accent",children:[a,e.jsx("button",{className:"text-accent/70 hover:text-accent",onClick:()=>y(r.filter(o=>o!==a)),children:"×"})]},a)),e.jsx(K,{value:"",placeholder:"+ key",onChange:a=>{a&&!r.includes(a)&&y([...r,a])}})]})}),e.jsx(A,{title:"Exclude",hint:"NOT @>",children:[...b,{key:"",value:""}].map((a,o)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx(K,{value:a.key,placeholder:"key",onChange:c=>{const i=[...b];i[o]={...a,key:c},E(i)}}),e.jsx("span",{className:"text-text-tertiary",children:"="}),e.jsx("input",{className:`${O} w-40`,placeholder:"value",value:a.value,onChange:c=>{const i=[...b];i[o]={...a,value:c.target.value},E(i)}}),o<b.length&&e.jsx("button",{className:H,onClick:()=>E(b.filter((c,i)=>i!==o)),children:"×"})]},o))}),e.jsx(A,{title:"Sort by",children:[...k,{field:"",direction:"asc"}].map((a,o)=>e.jsxs("div",{className:"mb-1 flex items-center gap-1",children:[e.jsx("input",{list:"lt-sort-fields",className:`${O} w-44`,placeholder:"column or metadata.key",value:a.field,onChange:c=>{const i=[...k];i[o]={...a,field:c.target.value},v(i.filter(j=>j.field))}}),e.jsxs("select",{className:Ne,value:a.direction??"asc",onChange:c=>{const i=[...k];i[o]={...a,direction:c.target.value},v(i.filter(j=>j.field))},children:[e.jsx("option",{value:"asc",children:"asc"}),e.jsx("option",{value:"desc",children:"desc"})]}),e.jsxs("label",{className:"flex items-center gap-1 text-text-tertiary",children:[e.jsx("input",{type:"checkbox",checked:!!a.numeric,onChange:c=>{const i=[...k];i[o]={...a,numeric:c.target.checked},v(i.filter(j=>j.field))}}),"num"]}),o<k.length&&e.jsx("button",{className:H,onClick:()=>v(k.filter((c,i)=>i!==o)),children:"×"})]},o))})]})}function Ss({value:t,onChange:n,facetKeys:u,search:l,onSearchChange:g,activeFacetCount:p,onClear:b,onClose:f}){return e.jsxs("div",{className:"h-full overflow-y-auto",children:[e.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-4 py-3 bg-surface-raised border-b border-surface-border/50",children:[e.jsx("span",{className:"text-xs font-semibold text-text-primary",children:"Faceted query"}),e.jsxs("div",{className:"flex items-center gap-2",children:[p>0&&e.jsx("button",{onClick:b,className:"text-2xs text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),e.jsx("button",{onClick:f,className:"p-1 rounded hover:bg-surface-hover text-text-tertiary hover:text-text-primary transition-colors",title:"Close",children:e.jsx(re,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"px-4 py-2",children:[e.jsxs("p",{className:"mb-2 text-2xs leading-snug text-text-tertiary",children:["Precise metadata facets plus exact correlation-id lookup — they compose in one SQL query. Facet keys are the ones that actually exist in your visible escalations. Set status to ",e.jsx("span",{className:"font-medium",children:"All"})," to find an order across every status; the whole query is shareable via the URL."]}),e.jsx(Ps,{value:t,onChange:n,facetKeys:u,search:l,onSearchChange:g})]})]})}const Rs=t=>t.isPriorityPending||t.isClaimPending||t.isAssignPending||t.isUnassignPending||t.isTriagePending||t.isCancelPending,D="inline-flex items-center h-7 px-2.5 text-2xs font-medium text-text-secondary bg-surface border border-surface-border rounded-[4px] hover:border-accent/50 hover:text-text-primary transition-colors disabled:opacity-50 disabled:hover:border-surface-border",Pe=`${D} appearance-none cursor-pointer`,Es="inline-flex items-center h-7 px-2.5 text-2xs font-medium text-status-error bg-surface border border-status-error/30 rounded-[4px] hover:border-status-error hover:bg-status-error/5 transition-colors disabled:opacity-50";function Ts(t){var f;const n=Rs(t),u=Te(),{data:l}=xt(),g=ht(),p=g!==null?g:((f=l==null?void 0:l.ai)==null?void 0:f.enabled)===!0,b=t.selectedCount>0;return e.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${b?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0 pointer-events-none"}`,children:e.jsx("div",{className:"overflow-hidden",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-2 py-2.5 pl-3 pr-2 mt-4 mb-3 bg-surface-sunken/60 border-l-2 border-l-accent",children:[e.jsxs("span",{className:"text-2xs font-semibold uppercase tracking-wider text-accent tabular-nums",children:[t.selectedCount," selected"]}),e.jsx("div",{className:"mx-1 h-4 w-px bg-surface-border"}),e.jsxs("select",{onChange:r=>{r.target.value&&(t.onSetPriority(parseInt(r.target.value)),r.target.value="")},disabled:n,className:Pe,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Priority…"}),ps.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))]}),e.jsxs("select",{onChange:r=>{r.target.value&&(t.onClaim(parseInt(r.target.value)),r.target.value="")},disabled:n,className:Pe,defaultValue:"",children:[e.jsx("option",{value:"",disabled:!0,children:"Claim for…"}),u.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))]}),e.jsx("button",{onClick:t.onAssign,disabled:n,className:D,children:t.isAssignPending?"Assigning…":"Assign to…"}),e.jsx("button",{onClick:t.onUnassign,disabled:n,className:D,children:t.isUnassignPending?"Unassigning…":"Unassign"}),p&&e.jsx("button",{onClick:t.onTriage,disabled:n,className:D,children:t.isTriagePending?"Triaging…":"Triage"}),t.cancelLabel!==!1&&e.jsx("button",{onClick:t.onCancel,disabled:n,className:Es,children:t.isCancelPending?t.cancelLabel?`${t.cancelLabel}…`:"Cancelling…":t.cancelLabel||"Cancel"}),e.jsx("div",{className:"flex-1"}),n&&e.jsx("span",{className:"text-2xs text-text-tertiary animate-pulse",children:"Processing…"}),e.jsx("button",{onClick:t.onClearSelection,className:"px-1 text-2xs font-medium text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"})]})})})}function As({open:t,onClose:n,selectedCount:u,onSubmit:l,isPending:g}){const[p,b]=m.useState(""),f=()=>{l(p||void 0)};return e.jsx(Se,{open:t,onClose:n,title:"Submit for AI Triage",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Submit ",e.jsx("span",{className:"font-medium text-text-primary",children:u})," escalation(s) for AI triage? The triage orchestrator will take over resolution."]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium text-text-secondary block mb-1",children:["Triage hint ",e.jsx("span",{className:"text-text-tertiary",children:"(optional)"})]}),e.jsx("input",{type:"text",value:p,onChange:r=>b(r.target.value),placeholder:"e.g., image_orientation",className:"input text-xs font-mono w-full"}),e.jsx("p",{className:"text-2xs text-text-tertiary mt-1",children:"Guides the triage workflow on what remediation to apply"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:n,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:f,disabled:g,className:"btn-primary text-xs",children:g?"Submitting...":"Submit for Triage"})]})]})})}function B(t,n,u){return l=>{t.mutate(l,{onSuccess:()=>{n(),u==null||u()}})}}function Bs(t){const n=()=>[...t.selectedIds];return{handleSetPriority:r=>{B(t.setPriority,t.clearSelection)({ids:n(),priority:r})},handleBulkClaim:r=>{B(t.bulkClaim,t.clearSelection)({ids:n(),durationMinutes:r})},handleBulkTriage:r=>{B(t.bulkTriage,t.clearSelection,t.closeTriageModal)({ids:n(),hint:r})},handleBulkAssign:(r,k,P)=>{B(t.bulkAssign,t.clearSelection,t.closeAssignModal)({ids:n(),targetUserId:r,durationMinutes:k,reassign:P})},handleBulkUnassign:()=>{B(t.bulkUnassign,t.clearSelection)({ids:n()})},handleBulkCancel:()=>{B(t.bulkCancel,t.clearSelection,t.closeCancelModal)({ids:n()})}}}function Os({claimTarget:t,onClose:n,claimDuration:u,onDurationChange:l,claimDurations:g,onCustomClaimChange:p,onClaim:b,isPending:f}){return e.jsx(Se,{open:!!t,onClose:n,title:"Claim Escalation",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Claim ",e.jsx("span",{className:"font-medium text-text-primary",children:t==null?void 0:t.type})," for:"]}),e.jsxs("select",{value:u,onChange:r=>{l(r.target.value)},className:"select w-full text-sm",children:[g.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value)),e.jsx("option",{value:"custom",children:"Other..."})]}),u==="custom"&&e.jsx(ts,{onChange:p,autoFocus:!0}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:n,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:b,className:"btn-primary text-xs",disabled:f,children:f?"Claiming...":"Claim"})]})]})})}function ra(){var ke;vs();const t=Ee(),{filters:n,setFilter:u,pagination:l}=xs({filters:{role:"",type:"",subtype:"",priority:"",status:"available",search:""}});gt({role:n.role||null,verbs:["created","claimed","updated"]});const g=hs(n.search),p=Te(),[b,f]=m.useState(null),[r,k]=m.useState("30"),[P,E]=m.useState(0),T=m.useCallback(s=>E(s),[]),[y,v]=m.useState(new Set),a=m.useRef(null),o=m.useRef(null),c=m.useCallback(s=>{var x;if((x=o.current)==null||x.disconnect(),o.current=null,!s||typeof ResizeObserver>"u")return;const d=new ResizeObserver(()=>{var q;(q=a.current)==null||q.style.setProperty("--lt-sticky-top",`${s.offsetHeight-1}px`)});d.observe(s),o.current=d},[]),[i,j]=m.useState(!1),[L,M]=Ht(),h=m.useMemo(()=>ft(L),[L]),N=m.useCallback(s=>{M(d=>{const x=new URLSearchParams(d);return pt(x,s),x.delete("page"),x})},[M]),{data:F}=bt(i),z=yt(h)+(n.search?1:0),G="facet-query",{setPanel:oe,closePanel:ce,open:Ae,ownerKey:Be}=jt();m.useEffect(()=>{if(!i){ce(G);return}oe(e.jsx(Ss,{value:h,onChange:N,facetKeys:(F==null?void 0:F.keys)??[],search:n.search??"",onSearchChange:s=>u("search",s),activeFacetCount:z,onClear:()=>{N({}),u("search","")},onClose:()=>j(!1)}),{width:420,key:G})},[i,h,N,F,n.search,u,z,oe,ce]);const de=Ae&&Be===G,Q=m.useRef(!1);m.useEffect(()=>{if(de){Q.current=!0;return}Q.current&&(Q.current=!1,j(!1))},[de]);const[Oe,W]=m.useState(!1),[Le,Y]=m.useState(!1),[Me,X]=m.useState(!1),Fe=m.useCallback(s=>N({...h,orderBy:s}),[h,N]),I=Re(),{data:U}=vt(),ue=Ct(),ze=m.useCallback(()=>{var x;const s=window.prompt("Pin label:");if(!(s!=null&&s.trim()))return;const d=((x=U==null?void 0:U.preferences)==null?void 0:x.pinnedViews)??[];ue.mutate({pinnedViews:[...d,{id:kt(),label:s.trim(),url:I.pathname+I.search,badge:!0}]})},[I.pathname,I.search,U,ue]),{canBulk:Ie}=Nt(),{kiosk:J}=wt(),me=h.facets?Object.keys(h.facets):[],Ue=L.get("view"),$e=m.useCallback(s=>{M(d=>{const x=new URLSearchParams(d);return s?x.set("view",s):x.delete("view"),x},{replace:!0})},[M]),Z=Ue==="timeline",Ve=m.useCallback(s=>{const{[s]:d,...x}=h.facets??{};N({...h,facets:Object.keys(x).length>0?x:void 0})},[h,N]),xe=Pt(),he=St(),ge=Rt(),ee=Et(),fe=Tt(),te=At(),$=Bt(),{data:se}=Ot(),{data:S}=Lt(),{data:ae}=Mt(),{user:V,isSuperAdmin:_e,hasRoleType:qe}=Ft(),pe=_e||qe("admin"),be=m.useMemo(()=>new Set(((V==null?void 0:V.roles)??[]).map(s=>s.role)),[V]),He=m.useMemo(()=>{const s=(S==null?void 0:S.roles)??[];return(pe?s:s.filter(x=>be.has(x.role)&&!Kt(x.role))).map(x=>({value:x.role,label:zt(x)})).sort((x,q)=>x.label.localeCompare(q.label))},[S,pe,be]);m.useEffect(()=>{v(new Set)},[n.role,n.type,n.subtype,n.priority,n.status,g,l.page,l.pageSize]);const ne=m.useMemo(()=>({...It(L,_t.AVAILABLE),search:g||void 0}),[L,g]),ye=100,{escalations:C,total:w,groups:Ke,listSchema:De,listSchemaVersion:Ge,singleRole:R,hasRichView:je,isLoading:Qe,isFetching:ve,error:_,refetch:We}=ls(ne,{limit:Z?ye:l.pageSize,offset:l.offset}),Ye=Ut(R??"",void 0,!!R),ie=R?ss((ke=Ye.data)==null?void 0:ke.form_schema).cancel:void 0,le=$t(ne.view,je),Xe=le===qt.RICH,Ce=m.useMemo(()=>{if(!h.jeopardy||!R)return null;const s=((S==null?void 0:S.roles)??[]).find(x=>x.role===R),d=(s==null?void 0:s.priority_threshold_minutes)??(s==null?void 0:s.sla_minutes)??null;return d!=null?Vt(d*6e4):null},[h.jeopardy,R,S]),Je=m.useMemo(()=>{const s=new Set;for(const d of C)y.has(d.id)&&s.add(d.role);return[...s]},[C,y]),Ze=m.useMemo(()=>C.filter(s=>y.has(s.id)&&js(s)).length,[C,y]),et=m.useCallback(()=>v(new Set),[]),tt=()=>{if(!b)return;const s=r==="custom"?P:parseInt(r);!s||s<=0||xe.mutate({id:b.id,durationMinutes:s},{onSuccess:()=>{f(null),t(`/escalations/detail/${b.id}`)}})},{handleSetPriority:st,handleBulkClaim:at,handleBulkTriage:nt,handleBulkAssign:it,handleBulkUnassign:lt,handleBulkCancel:rt}=Bs({selectedIds:y,clearSelection:et,setPriority:he,bulkClaim:ge,bulkTriage:te,bulkAssign:ee,bulkUnassign:fe,bulkCancel:$,closeTriageModal:()=>W(!1),closeAssignModal:()=>Y(!1),closeCancelModal:()=>X(!1)}),ot=s=>{const d=new Set(y);d.has(s)?d.delete(s):d.add(s),v(d)},ct=()=>{y.size===C.length?v(new Set):v(new Set(C.map(s=>s.id)))},dt=[Ie?{key:"select",label:e.jsx("input",{type:"checkbox",checked:C.length>0&&y.size===C.length,onChange:ct,className:"rounded"}),render:s=>e.jsx("input",{type:"checkbox",checked:y.has(s.id),onChange:d=>{d.stopPropagation(),ot(s.id)},onClick:d=>d.stopPropagation(),className:"rounded"}),className:"w-10",priority:1}:{key:"spacer",label:"",render:()=>null,className:"w-10",priority:3},...ds({highlightKeys:me}),{key:"actions",label:"",render:s=>e.jsx(bs,{children:e.jsx(ys,{icon:Dt,title:"Claim escalation",onClick:()=>f(s),alwaysVisible:!0,colorClass:"text-accent/40 hover:text-accent",size:"sm"})}),className:"w-10 text-right"}];return e.jsxs("div",{ref:a,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-10 min-w-0",children:[e.jsx(is,{role:n.role,options:He,onChange:s=>u("role",s),locked:J}),!J&&e.jsx("button",{onClick:()=>{window.location.hash="#docs:dashboard.md:all-escalations"},className:"text-text-quaternary hover:text-accent transition-colors mt-1 shrink-0",title:"Open docs for this page",children:e.jsx(Gt,{className:"w-4 h-4",strokeWidth:1.5})})]}),e.jsxs("div",{ref:c,className:"sticky top-0 z-20 bg-surface",children:[e.jsx(us,{filters:n,setFilter:u,roles:(se==null?void 0:se.roles)??[],types:(ae==null?void 0:ae.types)??[],showStatus:!0,showSearch:!1,showRole:!J,actions:e.jsxs(e.Fragment,{children:[Z&&e.jsxs("span",{className:"text-2xs text-text-tertiary whitespace-nowrap",children:[w>100&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"font-medium text-text-secondary",children:[(l.page-1)*100+1,"–",Math.min(l.page*100,w)]})," of "]}),e.jsx("span",{className:"font-medium text-text-secondary",children:w})," ",w===1?"escalation":"escalations"]}),e.jsx(rs,{orderBy:h.orderBy,onChange:Fe}),e.jsx("div",{role:"radiogroup","aria-label":"List view",className:"flex items-center rounded overflow-hidden border border-surface-border",children:[{key:"table",title:"Table view",Icon:Qt},{key:"rich",title:"Rich view",Icon:Wt},{key:"timeline",title:"Timeline view",Icon:Yt}].filter(s=>s.key!=="rich"||je).map(({key:s,title:d,Icon:x})=>e.jsx("button",{role:"radio","aria-checked":le===s,onClick:()=>$e(s),className:`px-1.5 py-1 transition-colors ${le===s?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:d,children:e.jsx(x,{className:"w-3.5 h-3.5"})},s))}),e.jsxs("button",{onClick:()=>j(s=>!s),"aria-pressed":i,className:`relative rounded border border-surface-border px-1.5 py-1 transition-colors ${i?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:"Faceted query",children:[e.jsx(Xt,{className:"w-3.5 h-3.5"}),z>0&&e.jsx("span",{className:"absolute -right-1 -top-1 flex h-3.5 min-w-[14px] items-center justify-center rounded-full bg-accent px-0.5 text-2xs font-medium text-text-inverse",children:z})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>We(),disabled:ve,className:"inline-flex h-7 w-7 items-center justify-center rounded icon-link hover:bg-surface-hover disabled:opacity-50",title:"Refresh",children:e.jsx(Jt,{className:`w-4 h-4 ${ve?"animate-spin":""}`})}),e.jsx("button",{onClick:ze,className:"inline-flex h-7 w-7 items-center justify-center rounded icon-link hover:bg-surface-hover",title:"Pin this view — save the current filters to your Pinned section","data-testid":"pin-current-view",children:e.jsx(Zt,{className:"w-4 h-4"})})]})]})}),e.jsx(Ts,{selectedCount:y.size,onClearSelection:()=>v(new Set),onSetPriority:st,onClaim:at,onAssign:()=>Y(!0),onUnassign:lt,onTriage:()=>W(!0),onCancel:()=>X(!0),isPriorityPending:he.isPending,isClaimPending:ge.isPending,isAssignPending:ee.isPending,isUnassignPending:fe.isPending,isTriagePending:te.isPending,isCancelPending:$.isPending,cancelLabel:ie}),(h.facets&&Object.keys(h.facets).length>0||h.jeopardy)&&e.jsxs("div",{className:"bg-surface/98 backdrop-blur-sm border-b border-surface-border/30 -mx-page-x px-page-x py-2 flex items-center gap-1.5 flex-wrap",children:[h.jeopardy&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-status-error px-2.5 py-0.5 text-2xs font-semibold text-text-inverse",children:[e.jsx(es,{className:"w-2.5 h-2.5",strokeWidth:2.5}),"in jeopardy",Ce&&e.jsxs("span",{className:"font-mono font-normal opacity-90",children:["> ",Ce]}),e.jsx("button",{onClick:()=>N({...h,jeopardy:void 0}),className:"ml-0.5 -mr-0.5 flex items-center text-text-inverse/70 hover:text-text-inverse transition-colors","aria-label":"Clear jeopardy filter",children:e.jsx(re,{className:"w-2.5 h-2.5"})})]}),Object.entries(h.facets??{}).map(([s,d])=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-accent/25 bg-accent/8 px-2.5 py-0.5 text-2xs font-medium text-accent/90",children:[e.jsx("span",{className:"font-mono text-text-tertiary",children:s}),e.jsx("span",{className:"text-text-quaternary",children:"="}),e.jsx("span",{className:"font-mono max-w-[160px] truncate",title:String(d),children:String(d)}),e.jsx("button",{onClick:()=>Ve(s),className:"ml-0.5 -mr-0.5 flex items-center text-text-quaternary hover:text-status-error transition-colors","aria-label":`Remove ${s} filter`,children:e.jsx(re,{className:"w-2.5 h-2.5"})})]},s)),Object.keys(h.facets??{}).length>1&&e.jsx("button",{onClick:()=>N({...h,facets:void 0}),className:"text-2xs text-text-quaternary hover:text-text-secondary transition-colors px-1",children:"clear all"})]})]}),_&&e.jsx("div",{className:"mb-4 px-4 py-3 rounded-md bg-status-error/10 border border-status-error/20 text-xs text-status-error",children:_.message==="Session expired"?"Your session has expired. Please log in again.":`Failed to load escalations: ${_.message}`}),Z?e.jsx(os,{escalations:C,highlightKeys:me,onRowClick:s=>t(`/escalations/detail/${s.id}`,{state:{from:"/escalations/available"}}),total:w,page:l.page,totalPages:Math.ceil(w/ye),onPageChange:l.setPage}):Xe?e.jsx(ms,{role:R,listSchema:De,listSchemaVersion:Ge,activeEscalations:C,groups:Ke,onRowClick:s=>t(`/escalations/detail/${s.id}`,{state:{from:"/escalations/available"}}),onOpenGroup:s=>t(s),onAddFacet:(s,d)=>N({...h,facets:{...h.facets??{},[s]:typeof d=="object"&&d!==null?JSON.stringify(d):d}}),total:w,page:l.page,totalPages:l.totalPages(w),pageSize:l.pageSize,onPageChange:l.setPage,onPageSizeChange:l.setPageSize}):e.jsxs(e.Fragment,{children:[e.jsx(gs,{columns:dt,data:C,layout:"fixed",...cs(ne.layout),keyFn:s=>s.id,onRowClick:s=>t(`/escalations/detail/${s.id}`,{state:{from:"/escalations/available"}}),isLoading:Qe,emptyMessage:_?"Unable to load data":"No escalations"}),e.jsx(fs,{page:l.page,totalPages:l.totalPages(w),onPageChange:l.setPage,total:w,pageSize:l.pageSize,onPageSizeChange:l.setPageSize})]}),e.jsx(Os,{claimTarget:b,onClose:()=>f(null),claimDuration:r,onDurationChange:s=>{k(s),E(0)},claimDurations:p,customClaimMinutes:P,onCustomClaimChange:T,onClaim:tt,isPending:xe.isPending}),e.jsx(As,{open:Oe,onClose:()=>W(!1),selectedCount:y.size,onSubmit:nt,isPending:te.isPending}),e.jsx(as,{open:Le,onClose:()=>Y(!1),selectedCount:y.size,selectedRoles:Je,claimedCount:Ze,onSubmit:it,isPending:ee.isPending}),e.jsx(ns,{open:Me,onClose:()=>X(!1),onConfirm:rt,selectedCount:y.size,isPending:$.isPending,error:$.error,actionLabel:typeof ie=="string"?ie:void 0})]})}export{ra as AvailableEscalationsPage};
2
- //# sourceMappingURL=AvailableEscalationsPage-D1mCqj8Z.js.map
@@ -1,2 +0,0 @@
1
- import{j as e,a as P}from"./vendor-query-DvWWuNIB.js";import{X as Q,bH as W,bI as X,d as H,e as Y,as as Z,b as J,u as B,C as K,U as tt}from"./vendor-icons-C_DQEeBy.js";import{ba as et,bb as st,a8 as at,bc as rt,a9 as nt,bd as T,ai as A}from"./index-BaCDL5fh.js";import{j as it,l as ot,i as lt}from"./escalation-items-BIgBWbaw.js";import{D as ct}from"./DataTable-FjFhx0SE.js";import{m as dt}from"./escalation-columns-CSE5wfWQ.js";import{U as xt}from"./UserName-CPJPZnN1.js";import{L as E}from"./vendor-react-_9U4mKFr.js";const k="created_at";function _(t){return t.replace(/^metadata\./,"")}function Lt({orderBy:t,onChange:s}){const i=t==null?void 0:t[0],r=(i==null?void 0:i.field)??k,o=(i==null?void 0:i.direction)??"desc",n=r===k,c=d=>s([{...i??{},field:r,direction:d}]);return e.jsxs("div",{className:"flex items-center gap-1.5",children:[!n&&e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-accent/25 bg-accent/8 px-2 py-0.5 text-2xs font-medium text-accent/90",children:[e.jsx("span",{className:"text-text-quaternary",children:"sort"}),e.jsx("span",{className:"font-mono max-w-[120px] truncate",title:r,children:_(r)}),e.jsx("button",{onClick:()=>s(void 0),className:"ml-0.5 -mr-0.5 flex items-center text-text-quaternary hover:text-status-error transition-colors","aria-label":"Reset sort to created date",children:e.jsx(Q,{className:"w-2.5 h-2.5"})})]}),e.jsxs("div",{className:"flex items-center rounded overflow-hidden border border-surface-border",role:"radiogroup","aria-label":"Sort direction",children:[e.jsx("button",{type:"button",role:"radio","aria-checked":o==="desc",onClick:()=>c("desc"),className:`px-1.5 py-1 transition-colors ${o==="desc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:n?"Newest first":`${_(r)} descending`,children:e.jsx(W,{className:"w-3.5 h-3.5"})}),e.jsx("button",{type:"button",role:"radio","aria-checked":o==="asc",onClick:()=>c("asc"),className:`px-1.5 py-1 border-l border-surface-border transition-colors ${o==="asc"?"bg-accent text-text-inverse":"icon-link hover:bg-surface-hover"}`,title:n?"Oldest first":`${_(r)} ascending`,children:e.jsx(X,{className:"w-3.5 h-3.5"})})]})]})}function ut(t){if(!t)return null;const{"x-lt-related":s,"x-lt-row-detail":i,...r}=t,o=Array.isArray(r["x-lt-columns"])?r["x-lt-columns"].filter(n=>!(n!=null&&n.related)):r["x-lt-columns"];return{...r,"x-lt-columns":o}}function mt(t){try{return ot(t).groupKey??void 0}catch{return}}function Tt(t,{limit:s,offset:i,staleTime:r,enabled:o=!0}){var j,a,u,m,v;const{available:n,claimed:c,apiStatus:d}=et(t.statusFilter),p=st(t),l=at(p??"",void 0,o&&!!p),x=((j=l.data)==null?void 0:j.list_schema)??null,f=!p||l.isFetched,b=t.view==="table"||t.view==="timeline"?void 0:mt(x),y={role:t.role,type:t.type,subtype:t.subtype,priority:t.priority,limit:s,offset:i,sort_by:"created_at",order:"desc",search:t.search,...t.facets,include:it(ut(x))?"envelope":void 0,...b?{groupBy:b}:{},...r!==void 0?{staleTime:r}:{}},C=rt({...y,enabled:o&&n&&f}),$=nt({status:d,claimed:c||void 0,...y,enabled:o&&!n&&f}),h=n?C:$,w=!!p&&!!x&&!!x["x-lt-layout"]&&x["x-lt-layout"]!=="table";return{escalations:((a=h.data)==null?void 0:a.escalations)??[],total:((u=h.data)==null?void 0:u.total)??0,groups:b?((m=h.data)==null?void 0:m.groups)??null:null,listSchema:x,listSchemaVersion:((v=l.data)==null?void 0:v.version)??null,singleRole:p,hasRichView:w,isLoading:h.isLoading,isFetching:h.isFetching,error:h.error,refetch:()=>{h.refetch()}}}function pt(t){return t===T.COMPACT?{fold:"never",density:"compact"}:t===T.CARDS?{fold:"always",density:"default"}:{fold:"auto",density:"default"}}function At({escalations:t,highlightKeys:s,onRowClick:i,isLoading:r,emptyMessage:o="No escalations",layout:n}){const c=P.useMemo(()=>dt({highlightKeys:s}),[s]);return e.jsx(ct,{columns:c,data:t,layout:"fixed",...pt(n),inline:!0,keyFn:d=>d.id,onRowClick:i,isLoading:r,emptyMessage:o})}const R={pending:"--lt-status-queued-graphic",claimed:"--lt-status-claimed-graphic",resolved:"--lt-status-success-graphic",cancelled:"--lt-text-quaternary",expired:"--lt-text-tertiary"},V="--lt-text-quaternary";function ht(t){return R[t]??V}const N=Object.fromEntries(Object.entries(R).map(([t,s])=>[t,`rgb(var(${s}))`])),D=40,ft=64,bt=24,F=3;function G(t){return t<6e4?`${Math.round(t/1e3)}s`:t<36e5?`${Math.round(t/6e4)}m`:t<864e5?`${(t/36e5).toFixed(1)}h`:`${(t/864e5).toFixed(1)}d`}function O(t){const s=Date.now()-t;return s<6e4?"just now":s<36e5?`${Math.round(s/6e4)}m ago`:s<864e5?`${Math.round(s/36e5)}h ago`:`${Math.round(s/864e5)}d ago`}function q(t){return t.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function yt(t,s){return t?[...s.filter(r=>r in t),...Object.keys(t).filter(r=>!s.includes(r))].map(r=>[r,t[r]]):[]}function vt({e:t}){const s=t.endMs-t.startMs;if(s<=0)return null;const i=N.pending,r=N.claimed,o=t.status==="cancelled"||t.status==="expired"?N.cancelled:N.resolved;let n=100,c=0,d=0;return t.claimedMs!==null?(n=Math.max(0,Math.min(100,(t.claimedMs-t.startMs)/s*100)),t.isOpen?c=100-n:(c=Math.max(0,Math.min(100-n,(t.endMs-t.claimedMs)/s*100)),d=Math.max(0,100-n-c))):t.isOpen||(d=100,n=0),e.jsxs("div",{className:"mt-2 h-0.5 rounded-full overflow-hidden flex bg-surface-sunken",children:[n>0&&e.jsx("div",{style:{width:`${n}%`,backgroundColor:i,opacity:.6}}),c>0&&e.jsx("div",{style:{width:`${c}%`,backgroundColor:r,opacity:.6}}),d>0&&e.jsx("div",{style:{width:`${d}%`,backgroundColor:o,opacity:.6}})]})}function jt({gapMs:t,heightPx:s}){return e.jsx("div",{className:"relative flex items-center justify-center",style:{height:s},children:t>=6e4&&e.jsx("span",{className:"text-2xs text-text-quaternary font-mono bg-surface px-2 relative z-10",children:G(t)})})}function U({e:t,highlightKeys:s,onRowClick:i}){const[r,o]=P.useState(!1),n=N[t.displayStatus]??`rgb(var(${V}))`,c=yt(t.metadata,s),d=r?c:c.slice(0,F),p=c.length-F;return e.jsxs("div",{className:"cursor-pointer max-w-[460px] min-w-[260px] w-full bg-surface-raised rounded-lg shadow-sm border border-surface-border/60 px-3.5 pt-2.5 pb-2 hover:shadow-md hover:border-surface-border transition-all duration-150",style:{borderTopWidth:"3px",borderTopColor:n},onClick:()=>i==null?void 0:i(t),children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-1.5",children:[e.jsx("span",{className:"text-2xs font-bold uppercase tracking-widest text-text-quaternary shrink-0",children:q(t.role)}),e.jsxs("span",{className:"text-xs font-semibold text-text-primary truncate",title:t.type,children:[t.type,t.subtype&&t.subtype!==t.type&&t.subtype!==""&&e.jsxs("span",{className:"font-normal text-text-tertiary",children:[" · ",t.subtype]})]})]}),d.length>0&&e.jsxs("div",{className:"border-t border-surface-border/40 pt-1 space-y-px",children:[d.map(([l,x])=>{const f=String(x),b=s.includes(l);return e.jsxs("div",{className:"group/row flex items-center gap-1.5 -mx-1 px-1 py-[2px] rounded",children:[e.jsx("span",{className:`shrink-0 w-[60px] text-2xs font-mono uppercase tracking-wide truncate ${b?"text-accent":"text-text-quaternary"}`,title:l,children:l}),e.jsx("span",{className:`flex-1 min-w-0 text-2xs font-medium truncate ${b?"text-text-primary":"text-text-tertiary"}`,title:f,children:f}),e.jsxs("span",{className:"flex items-center gap-px shrink-0 opacity-0 group-hover/row:opacity-100 transition-opacity",children:[e.jsx(E,{to:A(l,x,t.role),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Filter ${q(t.role)}: ${l} = ${f}`,onClick:y=>y.stopPropagation(),children:e.jsx(Z,{className:"w-2.5 h-2.5"})}),e.jsx(E,{to:A(l,x),className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Search all: ${l} = ${f}`,onClick:y=>y.stopPropagation(),children:e.jsx(J,{className:"w-2.5 h-2.5"})})]})]},l)}),p>0&&e.jsx("button",{className:"flex items-center gap-0.5 text-2xs text-text-quaternary hover:text-accent transition-colors mt-0.5 -mx-1 px-1 py-px",onClick:l=>{l.stopPropagation(),o(x=>!x)},children:r?e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"w-2.5 h-2.5"})," less"]}):e.jsxs(e.Fragment,{children:[e.jsx(K,{className:"w-2.5 h-2.5"})," ",p," more"]})})]}),e.jsx(vt,{e:t}),t.assigned_to&&e.jsxs("div",{className:"mt-1 flex items-center justify-end gap-1 text-2xs text-text-tertiary",children:[e.jsx(tt,{className:"w-3 h-3 shrink-0",strokeWidth:1.5}),e.jsx(xt,{userId:t.assigned_to,className:"truncate max-w-[70%]"})]})]})}function Et({escalations:t,highlightKeys:s=[],onRowClick:i,total:r,page:o,totalPages:n,onPageChange:c}){var w,j;const d=Date.now(),l=t.map(a=>{const u=new Date(a.created_at).getTime(),m=a.resolved_at?new Date(a.resolved_at).getTime():null,v=a.claimed_at?new Date(a.claimed_at).getTime():null,M=!m&&a.status!=="cancelled"&&a.status!=="expired",S=m??(M?d:u+3e4),g=a.status==="pending"&&lt(a)?"claimed":a.status;return{...a,startMs:u,claimedMs:v,endMs:S,isOpen:M,displayStatus:g}});if(l.length===0)return e.jsx("p",{className:"mt-12 text-center text-sm text-text-tertiary",children:"No escalations matched."});const x=l.length,b=Math.max(Math.abs((((w=l[x-1])==null?void 0:w.startMs)??0)-(((j=l[0])==null?void 0:j.startMs)??0)),1)/Math.max(x-1,1),y=ft/Math.max(b,1),$=new Set(l.map(a=>new Date(a.startMs).toDateString())).size>1;function h(a){const u=new Date(a),m=u.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return $?u.toLocaleDateString([],{month:"short",day:"numeric"})+" "+m:m}return e.jsxs("div",{className:"mt-4 pb-24",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-1/2 -translate-x-px inset-y-0 w-px bg-surface-border/80"}),l.map((a,u)=>{const m=l[u-1],v=m?Math.abs(a.startMs-m.startMs):null,M=v!==null?Math.max(bt,Math.round(v*y)):0,S=u%2===0,g=ht(a.displayStatus),z=`rgb(var(${g}))`,I=a.endMs-a.startMs,L=a.isOpen?O(a.startMs):`${O(a.startMs)} · ${G(I)}`;return e.jsxs("div",{children:[u>0&&e.jsx(jt,{gapMs:v,heightPx:M}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-1 flex justify-end items-center",children:S?e.jsxs("div",{className:"flex items-center",children:[e.jsx(U,{e:a,highlightKeys:s,onRowClick:i}),e.jsx("div",{className:"flex-shrink-0 h-px bg-surface-border/70",style:{width:D}})]}):e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums pr-3",children:L})}),e.jsx("div",{className:"relative z-10 flex-shrink-0 w-3.5 h-3.5 rounded-full border-2 border-surface cursor-pointer transition-all duration-150 hover:scale-[1.5]",style:{backgroundColor:z,boxShadow:`0 0 0 3px rgb(var(${g}) / 0.16), 0 1px 3px rgb(var(${g}) / 0.19)`},onClick:()=>i==null?void 0:i(a)}),e.jsx("div",{className:"flex-1 flex justify-start items-center",children:S?e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums pl-3",children:L}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"flex-shrink-0 h-px bg-surface-border/70",style:{width:D}}),e.jsx(U,{e:a,highlightKeys:s,onRowClick:i})]})})]}),e.jsx("div",{className:"flex justify-center relative z-10 mt-0.5",children:e.jsx("span",{className:"text-2xs text-text-quaternary font-mono tabular-nums bg-surface px-1.5",children:h(a.startMs)})})]},a.id)})]}),n>1&&e.jsxs("div",{className:"sticky bottom-0 z-20 bg-surface/95 backdrop-blur-sm border-t border-surface-border -mx-page-x px-page-x pt-2 pb-4 flex items-center justify-between mt-10",children:[e.jsxs("span",{className:"text-2xs text-text-tertiary",children:["Page ",e.jsx("span",{className:"font-medium text-text-secondary",children:o})," ","of ",e.jsx("span",{className:"font-medium text-text-secondary",children:n})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>c(o-1),disabled:o<=1,className:"p-1.5 rounded hover:bg-surface-hover disabled:opacity-30 text-text-tertiary hover:text-text-primary transition-colors disabled:cursor-not-allowed",children:e.jsx(H,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>c(o+1),disabled:o>=n,className:"p-1.5 rounded hover:bg-surface-hover disabled:opacity-30 text-text-tertiary hover:text-text-primary transition-colors disabled:cursor-not-allowed",children:e.jsx(Y,{className:"w-4 h-4"})})]})]})]})}export{Lt as E,Et as a,At as b,pt as t,Tt as u};
2
- //# sourceMappingURL=EscalationTimeline-D6jrDcBb.js.map