@hotmeshio/long-tail 0.5.0 → 0.5.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 (228) hide show
  1. package/README.md +41 -1
  2. package/build/adapters/express.d.ts +1 -0
  3. package/build/adapters/express.js +4 -0
  4. package/build/api/yaml-workflows/crud.d.ts +1 -0
  5. package/build/api/yaml-workflows/crud.js +2 -2
  6. package/build/routes/mcp-endpoint.js +3 -5
  7. package/build/services/topics/system-topics.js +27 -27
  8. package/build/services/yaml-workflow/invoke.js +77 -6
  9. package/build/start/graph-workflows.d.ts +14 -0
  10. package/build/start/graph-workflows.js +126 -0
  11. package/build/start/workers.js +14 -0
  12. package/build/system/mcp-servers/admin/schemas.d.ts +2 -2
  13. package/build/tsconfig.tsbuildinfo +1 -1
  14. package/build/types/startup.d.ts +28 -0
  15. package/dashboard/dist/assets/{AdminDashboard-CgJC8ZZF.js → AdminDashboard-CMzR4d-w.js} +2 -2
  16. package/dashboard/dist/assets/{AdminDashboard-CgJC8ZZF.js.map → AdminDashboard-CMzR4d-w.js.map} +1 -1
  17. package/dashboard/dist/assets/{AgentConfigPage-Bjl2Lsvo.js → AgentConfigPage-DHCpN4xk.js} +6 -6
  18. package/dashboard/dist/assets/{AgentConfigPage-Bjl2Lsvo.js.map → AgentConfigPage-DHCpN4xk.js.map} +1 -1
  19. package/dashboard/dist/assets/{AgentDetailPage-D5dHrfaM.js → AgentDetailPage-CSrejvSl.js} +3 -3
  20. package/dashboard/dist/assets/{AgentDetailPage-D5dHrfaM.js.map → AgentDetailPage-CSrejvSl.js.map} +1 -1
  21. package/dashboard/dist/assets/{AgentsPage-Mom3N1Av.js → AgentsPage-ntuzWHCD.js} +2 -2
  22. package/dashboard/dist/assets/{AgentsPage-Mom3N1Av.js.map → AgentsPage-ntuzWHCD.js.map} +1 -1
  23. package/dashboard/dist/assets/{AvailableEscalationsPage-B2ZAb41C.js → AvailableEscalationsPage-Ci24fdxC.js} +2 -2
  24. package/dashboard/dist/assets/{AvailableEscalationsPage-B2ZAb41C.js.map → AvailableEscalationsPage-Ci24fdxC.js.map} +1 -1
  25. package/dashboard/dist/assets/{BotPicker-dCvnjynP.js → BotPicker-lj42d48P.js} +2 -2
  26. package/dashboard/dist/assets/{BotPicker-dCvnjynP.js.map → BotPicker-lj42d48P.js.map} +1 -1
  27. package/dashboard/dist/assets/CapabilitiesPage-Bea9yLmU.js +2 -0
  28. package/dashboard/dist/assets/CapabilitiesPage-Bea9yLmU.js.map +1 -0
  29. package/dashboard/dist/assets/{CollapsibleSection-bW0UZN9b.js → CollapsibleSection-BeBsI1M4.js} +2 -2
  30. package/dashboard/dist/assets/{CollapsibleSection-bW0UZN9b.js.map → CollapsibleSection-BeBsI1M4.js.map} +1 -1
  31. package/dashboard/dist/assets/{CredentialsPage-DVOK3aaR.js → CredentialsPage-BDzFa3HV.js} +2 -2
  32. package/dashboard/dist/assets/{CredentialsPage-DVOK3aaR.js.map → CredentialsPage-BDzFa3HV.js.map} +1 -1
  33. package/dashboard/dist/assets/{CronLabel-Cv5em7OP.js → CronLabel-DeNm1I4r.js} +2 -2
  34. package/dashboard/dist/assets/{CronLabel-Cv5em7OP.js.map → CronLabel-DeNm1I4r.js.map} +1 -1
  35. package/dashboard/dist/assets/{CustomDurationPicker-Dy4NBqhZ.js → CustomDurationPicker-C2OH9YcV.js} +2 -2
  36. package/dashboard/dist/assets/{CustomDurationPicker-Dy4NBqhZ.js.map → CustomDurationPicker-C2OH9YcV.js.map} +1 -1
  37. package/dashboard/dist/assets/{DropZone-CptiQ0wc.js → DropZone-Dwpgbueb.js} +2 -2
  38. package/dashboard/dist/assets/{DropZone-CptiQ0wc.js.map → DropZone-Dwpgbueb.js.map} +1 -1
  39. package/dashboard/dist/assets/{ElapsedCell-TQqWaVRq.js → ElapsedCell-WdzqA0dR.js} +2 -2
  40. package/dashboard/dist/assets/{ElapsedCell-TQqWaVRq.js.map → ElapsedCell-WdzqA0dR.js.map} +1 -1
  41. package/dashboard/dist/assets/{EscalationsOverview-Cv5UvuHI.js → EscalationsOverview-BIEeflEV.js} +2 -2
  42. package/dashboard/dist/assets/{EscalationsOverview-Cv5UvuHI.js.map → EscalationsOverview-BIEeflEV.js.map} +1 -1
  43. package/dashboard/dist/assets/{EventTable-Doky6fCO.js → EventTable-NIhWP__B.js} +2 -2
  44. package/dashboard/dist/assets/{EventTable-Doky6fCO.js.map → EventTable-NIhWP__B.js.map} +1 -1
  45. package/dashboard/dist/assets/GraphInvokePage-DtAW8ilc.js +2 -0
  46. package/dashboard/dist/assets/GraphInvokePage-DtAW8ilc.js.map +1 -0
  47. package/dashboard/dist/assets/HomePage-HsO-M8ub.js +2 -0
  48. package/dashboard/dist/assets/{HomePage-CzvVyTq4.js.map → HomePage-HsO-M8ub.js.map} +1 -1
  49. package/dashboard/dist/assets/{ListToolbar-Cfec9gz_.js → ListToolbar-DqaRlXrF.js} +2 -2
  50. package/dashboard/dist/assets/{ListToolbar-Cfec9gz_.js.map → ListToolbar-DqaRlXrF.js.map} +1 -1
  51. package/dashboard/dist/assets/{McpOverview-BN4GsBGI.js → McpOverview-B4GsHxij.js} +2 -2
  52. package/dashboard/dist/assets/{McpOverview-BN4GsBGI.js.map → McpOverview-B4GsHxij.js.map} +1 -1
  53. package/dashboard/dist/assets/McpQueryDetailPage-DZKpzWST.js +5 -0
  54. package/dashboard/dist/assets/McpQueryDetailPage-DZKpzWST.js.map +1 -0
  55. package/dashboard/dist/assets/{McpQueryPage-BK5L2PqJ.js → McpQueryPage-B-8WR3GV.js} +2 -2
  56. package/dashboard/dist/assets/{McpQueryPage-BK5L2PqJ.js.map → McpQueryPage-B-8WR3GV.js.map} +1 -1
  57. package/dashboard/dist/assets/McpRunDetailPage-Dt7Ai3qB.js +2 -0
  58. package/dashboard/dist/assets/McpRunDetailPage-Dt7Ai3qB.js.map +1 -0
  59. package/dashboard/dist/assets/{McpRunsPage-QsXid9Xe.js → McpRunsPage-Bdke-HoQ.js} +2 -2
  60. package/dashboard/dist/assets/{McpRunsPage-QsXid9Xe.js.map → McpRunsPage-Bdke-HoQ.js.map} +1 -1
  61. package/dashboard/dist/assets/NamespacePill-DnJl4Lre.js +2 -0
  62. package/dashboard/dist/assets/NamespacePill-DnJl4Lre.js.map +1 -0
  63. package/dashboard/dist/assets/{OperatorDashboard-CZQSINho.js → OperatorDashboard-VZ97mufd.js} +2 -2
  64. package/dashboard/dist/assets/{OperatorDashboard-CZQSINho.js.map → OperatorDashboard-VZ97mufd.js.map} +1 -1
  65. package/dashboard/dist/assets/{PageHeader-BuJpMxyu.js → PageHeader-Bnt2iQQa.js} +2 -2
  66. package/dashboard/dist/assets/{PageHeader-BuJpMxyu.js.map → PageHeader-Bnt2iQQa.js.map} +1 -1
  67. package/dashboard/dist/assets/{PageHeaderWithStats-yD_PTbOl.js → PageHeaderWithStats-BuKc9MKt.js} +2 -2
  68. package/dashboard/dist/assets/{PageHeaderWithStats-yD_PTbOl.js.map → PageHeaderWithStats-BuKc9MKt.js.map} +1 -1
  69. package/dashboard/dist/assets/{ProcessDetailPage-DUCOOvOK.js → ProcessDetailPage-BLfLfmWX.js} +2 -2
  70. package/dashboard/dist/assets/{ProcessDetailPage-DUCOOvOK.js.map → ProcessDetailPage-BLfLfmWX.js.map} +1 -1
  71. package/dashboard/dist/assets/{ProcessesListPage-CXvSLTIM.js → ProcessesListPage-DG54t-Nd.js} +2 -2
  72. package/dashboard/dist/assets/{ProcessesListPage-CXvSLTIM.js.map → ProcessesListPage-DG54t-Nd.js.map} +1 -1
  73. package/dashboard/dist/assets/{RolePill-SasQKc_B.js → RolePill-DQTT1s9v.js} +2 -2
  74. package/dashboard/dist/assets/{RolePill-SasQKc_B.js.map → RolePill-DQTT1s9v.js.map} +1 -1
  75. package/dashboard/dist/assets/{RolesPage-DlQR0Iz_.js → RolesPage-Bdlv3DdW.js} +2 -2
  76. package/dashboard/dist/assets/{RolesPage-DlQR0Iz_.js.map → RolesPage-Bdlv3DdW.js.map} +1 -1
  77. package/dashboard/dist/assets/{RunAsSelector-DP-jxsv6.js → RunAsSelector-BFxxMvL3.js} +2 -2
  78. package/dashboard/dist/assets/{RunAsSelector-DP-jxsv6.js.map → RunAsSelector-BFxxMvL3.js.map} +1 -1
  79. package/dashboard/dist/assets/{SwimlaneTimeline-BmASA0nN.js → SwimlaneTimeline-BZmad7WQ.js} +2 -2
  80. package/dashboard/dist/assets/{SwimlaneTimeline-BmASA0nN.js.map → SwimlaneTimeline-BZmad7WQ.js.map} +1 -1
  81. package/dashboard/dist/assets/{TagInput-DvF3j8MA.js → TagInput-B00uqhjX.js} +2 -2
  82. package/dashboard/dist/assets/{TagInput-DvF3j8MA.js.map → TagInput-B00uqhjX.js.map} +1 -1
  83. package/dashboard/dist/assets/{TaskDetailPage-CRowpkeZ.js → TaskDetailPage-CLl2mgBC.js} +2 -2
  84. package/dashboard/dist/assets/{TaskDetailPage-CRowpkeZ.js.map → TaskDetailPage-CLl2mgBC.js.map} +1 -1
  85. package/dashboard/dist/assets/{TaskQueuePill-BCQrS2oK.js → TaskQueuePill-CUsofm0X.js} +2 -2
  86. package/dashboard/dist/assets/{TaskQueuePill-BCQrS2oK.js.map → TaskQueuePill-CUsofm0X.js.map} +1 -1
  87. package/dashboard/dist/assets/{TasksListPage-uJ6z37J-.js → TasksListPage-DoHXxZF-.js} +2 -2
  88. package/dashboard/dist/assets/{TasksListPage-uJ6z37J-.js.map → TasksListPage-DoHXxZF-.js.map} +1 -1
  89. package/dashboard/dist/assets/{TimeAgo-BxwngK1D.js → TimeAgo-DZF9w8Rl.js} +2 -2
  90. package/dashboard/dist/assets/{TimeAgo-BxwngK1D.js.map → TimeAgo-DZF9w8Rl.js.map} +1 -1
  91. package/dashboard/dist/assets/{TimestampCell-CDmichOM.js → TimestampCell-DPpoTdrw.js} +2 -2
  92. package/dashboard/dist/assets/{TimestampCell-CDmichOM.js.map → TimestampCell-DPpoTdrw.js.map} +1 -1
  93. package/dashboard/dist/assets/ToolPill-DjvedZSn.js +2 -0
  94. package/dashboard/dist/assets/ToolPill-DjvedZSn.js.map +1 -0
  95. package/dashboard/dist/assets/ToolTestPanel-DtAgJQfr.js +2 -0
  96. package/dashboard/dist/assets/ToolTestPanel-DtAgJQfr.js.map +1 -0
  97. package/dashboard/dist/assets/TopicDetailPage-W9RKkNNp.js +9 -0
  98. package/dashboard/dist/assets/TopicDetailPage-W9RKkNNp.js.map +1 -0
  99. package/dashboard/dist/assets/{TopicsPage-letISGGD.js → TopicsPage-Bc-4ne6V.js} +2 -2
  100. package/dashboard/dist/assets/{TopicsPage-letISGGD.js.map → TopicsPage-Bc-4ne6V.js.map} +1 -1
  101. package/dashboard/dist/assets/{UserName-W6_Iz2Qb.js → UserName-O2Q4-E6E.js} +2 -2
  102. package/dashboard/dist/assets/{UserName-W6_Iz2Qb.js.map → UserName-O2Q4-E6E.js.map} +1 -1
  103. package/dashboard/dist/assets/{WorkflowExecutionPage-Cfx-xlRT.js → WorkflowExecutionPage-DEDsBmn1.js} +2 -2
  104. package/dashboard/dist/assets/{WorkflowExecutionPage-Cfx-xlRT.js.map → WorkflowExecutionPage-DEDsBmn1.js.map} +1 -1
  105. package/dashboard/dist/assets/{WorkflowPill-Z-zHRKOK.js → WorkflowPill-F1oKUzmc.js} +2 -2
  106. package/dashboard/dist/assets/{WorkflowPill-Z-zHRKOK.js.map → WorkflowPill-F1oKUzmc.js.map} +1 -1
  107. package/dashboard/dist/assets/{WorkflowsDashboard-DC4XHMWt.js → WorkflowsDashboard-Bcf17vCt.js} +2 -2
  108. package/dashboard/dist/assets/{WorkflowsDashboard-DC4XHMWt.js.map → WorkflowsDashboard-Bcf17vCt.js.map} +1 -1
  109. package/dashboard/dist/assets/{WorkflowsOverview-GefO_yn0.js → WorkflowsOverview-Cwo2rqGT.js} +2 -2
  110. package/dashboard/dist/assets/{WorkflowsOverview-GefO_yn0.js.map → WorkflowsOverview-Cwo2rqGT.js.map} +1 -1
  111. package/dashboard/dist/assets/YamlWorkflowDetailPage-Bv8ZFwO-.js +33 -0
  112. package/dashboard/dist/assets/YamlWorkflowDetailPage-Bv8ZFwO-.js.map +1 -0
  113. package/dashboard/dist/assets/YamlWorkflowsPage-DOiEQDOq.js +2 -0
  114. package/dashboard/dist/assets/YamlWorkflowsPage-DOiEQDOq.js.map +1 -0
  115. package/dashboard/dist/assets/{agents-BI5OeN84.js → agents-D09G0HCv.js} +2 -2
  116. package/dashboard/dist/assets/{agents-BI5OeN84.js.map → agents-D09G0HCv.js.map} +1 -1
  117. package/dashboard/dist/assets/{bots-1UzUCsrR.js → bots-D0LhyZZM.js} +2 -2
  118. package/dashboard/dist/assets/{bots-1UzUCsrR.js.map → bots-D0LhyZZM.js.map} +1 -1
  119. package/dashboard/dist/assets/{capabilities-BUbl-ojp.js → capabilities-DON4-NXs.js} +2 -2
  120. package/dashboard/dist/assets/{capabilities-BUbl-ojp.js.map → capabilities-DON4-NXs.js.map} +1 -1
  121. package/dashboard/dist/assets/{controlplane-DTFrH_vN.js → controlplane-Bihd1kXf.js} +2 -2
  122. package/dashboard/dist/assets/{controlplane-DTFrH_vN.js.map → controlplane-Bihd1kXf.js.map} +1 -1
  123. package/dashboard/dist/assets/{escalation-BQhCt4W0.js → escalation-CP2XbdXK.js} +2 -2
  124. package/dashboard/dist/assets/{escalation-BQhCt4W0.js.map → escalation-CP2XbdXK.js.map} +1 -1
  125. package/dashboard/dist/assets/{escalation-columns-J20k5CcY.js → escalation-columns-9aw8Y4qq.js} +2 -2
  126. package/dashboard/dist/assets/{escalation-columns-J20k5CcY.js.map → escalation-columns-9aw8Y4qq.js.map} +1 -1
  127. package/dashboard/dist/assets/helpers-DzO-OGPe.js +2 -0
  128. package/dashboard/dist/assets/helpers-DzO-OGPe.js.map +1 -0
  129. package/dashboard/dist/assets/{index-CVGgSoda.js → index-B-BK3vtk.js} +2 -2
  130. package/dashboard/dist/assets/{index-CVGgSoda.js.map → index-B-BK3vtk.js.map} +1 -1
  131. package/dashboard/dist/assets/{index-CWEOhAiK.js → index-B7lEd0cY.js} +25 -25
  132. package/dashboard/dist/assets/index-B7lEd0cY.js.map +1 -0
  133. package/dashboard/dist/assets/index-BBBGETMs.js +6 -0
  134. package/dashboard/dist/assets/index-BBBGETMs.js.map +1 -0
  135. package/dashboard/dist/assets/index-BFyzZGtv.css +1 -0
  136. package/dashboard/dist/assets/{index-vgxjge70.js → index-BInTEEIX.js} +2 -2
  137. package/dashboard/dist/assets/{index-vgxjge70.js.map → index-BInTEEIX.js.map} +1 -1
  138. package/dashboard/dist/assets/index-BTp73vYK.js +2 -0
  139. package/dashboard/dist/assets/index-BTp73vYK.js.map +1 -0
  140. package/dashboard/dist/assets/index-CCup2uaP.js +2 -0
  141. package/dashboard/dist/assets/{index-C9ClHiiW.js.map → index-CCup2uaP.js.map} +1 -1
  142. package/dashboard/dist/assets/index-CMRW_PE-.js +9 -0
  143. package/dashboard/dist/assets/index-CMRW_PE-.js.map +1 -0
  144. package/dashboard/dist/assets/index-Cb7aSzox.js +2 -0
  145. package/dashboard/dist/assets/{index-si70YcIP.js.map → index-Cb7aSzox.js.map} +1 -1
  146. package/dashboard/dist/assets/index-Cjb8ulHm.js +2 -0
  147. package/dashboard/dist/assets/{index-WQQJ_cp7.js.map → index-Cjb8ulHm.js.map} +1 -1
  148. package/dashboard/dist/assets/index-DgLZ8Ix5.js +2 -0
  149. package/dashboard/dist/assets/{index-DasoTRjT.js.map → index-DgLZ8Ix5.js.map} +1 -1
  150. package/dashboard/dist/assets/index-H5Yb8CY2.js +2 -0
  151. package/dashboard/dist/assets/index-H5Yb8CY2.js.map +1 -0
  152. package/dashboard/dist/assets/{index-CLUYzdwz.js → index-_JsRJPds.js} +2 -2
  153. package/dashboard/dist/assets/{index-CLUYzdwz.js.map → index-_JsRJPds.js.map} +1 -1
  154. package/dashboard/dist/assets/{index-C-mbURj-.js → index-rbuNUyAh.js} +2 -2
  155. package/dashboard/dist/assets/{index-C-mbURj-.js.map → index-rbuNUyAh.js.map} +1 -1
  156. package/dashboard/dist/assets/{knowledge-D9Tuh-o-.js → knowledge-Bl_KaoKJ.js} +2 -2
  157. package/dashboard/dist/assets/{knowledge-D9Tuh-o-.js.map → knowledge-Bl_KaoKJ.js.map} +1 -1
  158. package/dashboard/dist/assets/{mcp-BO8QnWyk.js → mcp-DXbFGoA8.js} +2 -2
  159. package/dashboard/dist/assets/{mcp-BO8QnWyk.js.map → mcp-DXbFGoA8.js.map} +1 -1
  160. package/dashboard/dist/assets/{mcp-query-WLtQtr51.js → mcp-query-Bg69DF2x.js} +2 -2
  161. package/dashboard/dist/assets/{mcp-query-WLtQtr51.js.map → mcp-query-Bg69DF2x.js.map} +1 -1
  162. package/dashboard/dist/assets/{pipelines-BAVf9xud.js → pipelines-DK9LTg9F.js} +2 -2
  163. package/dashboard/dist/assets/{pipelines-BAVf9xud.js.map → pipelines-DK9LTg9F.js.map} +1 -1
  164. package/dashboard/dist/assets/{roles-mGO2-2hA.js → roles-BrsBN4hO.js} +2 -2
  165. package/dashboard/dist/assets/{roles-mGO2-2hA.js.map → roles-BrsBN4hO.js.map} +1 -1
  166. package/dashboard/dist/assets/{tasks-JVRVCx0f.js → tasks-CwjvPECN.js} +2 -2
  167. package/dashboard/dist/assets/{tasks-JVRVCx0f.js.map → tasks-CwjvPECN.js.map} +1 -1
  168. package/dashboard/dist/assets/{topics-BLVnahd7.js → topics-BrwkmaFR.js} +2 -2
  169. package/dashboard/dist/assets/{topics-BLVnahd7.js.map → topics-BrwkmaFR.js.map} +1 -1
  170. package/dashboard/dist/assets/{useEventHooks-BwjAi0Qq.js → useEventHooks-Cd1GM1NG.js} +2 -2
  171. package/dashboard/dist/assets/{useEventHooks-BwjAi0Qq.js.map → useEventHooks-Cd1GM1NG.js.map} +1 -1
  172. package/dashboard/dist/assets/{useNamespace-DkHmXddZ.js → useNamespace-D9lghZ25.js} +2 -2
  173. package/dashboard/dist/assets/{useNamespace-DkHmXddZ.js.map → useNamespace-D9lghZ25.js.map} +1 -1
  174. package/dashboard/dist/assets/useYamlActivityEvents-vOhAwmKO.js +2 -0
  175. package/dashboard/dist/assets/useYamlActivityEvents-vOhAwmKO.js.map +1 -0
  176. package/dashboard/dist/assets/{users-BvizpAkV.js → users-ChQ7soaq.js} +2 -2
  177. package/dashboard/dist/assets/{users-BvizpAkV.js.map → users-ChQ7soaq.js.map} +1 -1
  178. package/dashboard/dist/assets/{vendor-icons-Doy0g69_.js → vendor-icons-Dj2F0Jrb.js} +38 -38
  179. package/dashboard/dist/assets/vendor-icons-Dj2F0Jrb.js.map +1 -0
  180. package/dashboard/dist/assets/workflows-BLKji1_1.js +2 -0
  181. package/dashboard/dist/assets/{workflows-CyEYa01a.js.map → workflows-BLKji1_1.js.map} +1 -1
  182. package/dashboard/dist/assets/yaml-workflows-BUhMfdaw.js +2 -0
  183. package/dashboard/dist/assets/{yaml-workflows-i3GzrEme.js.map → yaml-workflows-BUhMfdaw.js.map} +1 -1
  184. package/dashboard/dist/index.html +3 -3
  185. package/docs/story.md +13 -9
  186. package/package.json +1 -1
  187. package/dashboard/dist/assets/CapabilitiesPage-CK2fJ9Sy.js +0 -2
  188. package/dashboard/dist/assets/CapabilitiesPage-CK2fJ9Sy.js.map +0 -1
  189. package/dashboard/dist/assets/HomePage-CzvVyTq4.js +0 -2
  190. package/dashboard/dist/assets/McpQueryDetailPage-lCW668WQ.js +0 -5
  191. package/dashboard/dist/assets/McpQueryDetailPage-lCW668WQ.js.map +0 -1
  192. package/dashboard/dist/assets/McpRunDetailPage-CQOeYqxa.js +0 -2
  193. package/dashboard/dist/assets/McpRunDetailPage-CQOeYqxa.js.map +0 -1
  194. package/dashboard/dist/assets/ServerName-CHspudaC.js +0 -2
  195. package/dashboard/dist/assets/ServerName-CHspudaC.js.map +0 -1
  196. package/dashboard/dist/assets/StepIndicator-CuUIGxKk.js +0 -2
  197. package/dashboard/dist/assets/StepIndicator-CuUIGxKk.js.map +0 -1
  198. package/dashboard/dist/assets/ToolPill-1aTqYtzp.js +0 -2
  199. package/dashboard/dist/assets/ToolPill-1aTqYtzp.js.map +0 -1
  200. package/dashboard/dist/assets/ToolTestPanel-xjTn8sU8.js +0 -2
  201. package/dashboard/dist/assets/ToolTestPanel-xjTn8sU8.js.map +0 -1
  202. package/dashboard/dist/assets/TopicDetailPage-Dm0hDlS8.js +0 -9
  203. package/dashboard/dist/assets/TopicDetailPage-Dm0hDlS8.js.map +0 -1
  204. package/dashboard/dist/assets/YamlWorkflowsPage-CMsrFooO.js +0 -2
  205. package/dashboard/dist/assets/YamlWorkflowsPage-CMsrFooO.js.map +0 -1
  206. package/dashboard/dist/assets/helpers-ge6Eu90Y.js +0 -2
  207. package/dashboard/dist/assets/helpers-ge6Eu90Y.js.map +0 -1
  208. package/dashboard/dist/assets/index-C--SEsU7.css +0 -1
  209. package/dashboard/dist/assets/index-C45DvtAZ.js +0 -15
  210. package/dashboard/dist/assets/index-C45DvtAZ.js.map +0 -1
  211. package/dashboard/dist/assets/index-C9ClHiiW.js +0 -2
  212. package/dashboard/dist/assets/index-CWEOhAiK.js.map +0 -1
  213. package/dashboard/dist/assets/index-CWlP6vHG.js +0 -6
  214. package/dashboard/dist/assets/index-CWlP6vHG.js.map +0 -1
  215. package/dashboard/dist/assets/index-DasoTRjT.js +0 -2
  216. package/dashboard/dist/assets/index-FhasoOjO.js +0 -2
  217. package/dashboard/dist/assets/index-FhasoOjO.js.map +0 -1
  218. package/dashboard/dist/assets/index-WQQJ_cp7.js +0 -2
  219. package/dashboard/dist/assets/index-hAZiac0C.js +0 -2
  220. package/dashboard/dist/assets/index-hAZiac0C.js.map +0 -1
  221. package/dashboard/dist/assets/index-si70YcIP.js +0 -2
  222. package/dashboard/dist/assets/useExpandedRows-CkcEntB-.js +0 -2
  223. package/dashboard/dist/assets/useExpandedRows-CkcEntB-.js.map +0 -1
  224. package/dashboard/dist/assets/useYamlActivityEvents-CsaR5dWj.js +0 -2
  225. package/dashboard/dist/assets/useYamlActivityEvents-CsaR5dWj.js.map +0 -1
  226. package/dashboard/dist/assets/vendor-icons-Doy0g69_.js.map +0 -1
  227. package/dashboard/dist/assets/workflows-CyEYa01a.js +0 -2
  228. package/dashboard/dist/assets/yaml-workflows-i3GzrEme.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"bots-1UzUCsrR.js","sources":["../../src/api/bots.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { BotRecord, BotApiKeyRecord } from './types';\nimport type { LTRoleType } from './types';\n\ninterface BotListResponse {\n bots: BotRecord[];\n total: number;\n}\n\ninterface BotFilters {\n limit?: number;\n offset?: number;\n}\n\n// ── Query hooks ──────────────────────────────────────────────────────────────\n\nexport function useBots(filters: BotFilters = {}) {\n const params = new URLSearchParams();\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<BotListResponse>({\n queryKey: ['bots', filters],\n queryFn: () => apiFetch(`/bot-accounts?${params}`),\n });\n}\n\nexport function useBotApiKeys(botId: string) {\n return useQuery<{ keys: BotApiKeyRecord[] }>({\n queryKey: ['bots', botId, 'api-keys'],\n queryFn: () => apiFetch(`/bot-accounts/${botId}/api-keys`),\n enabled: !!botId,\n });\n}\n\n// ── Mutation hooks ───────────────────────────────────────────────────────────\n\nexport function useCreateBot() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (data: {\n name: string;\n description?: string;\n display_name?: string;\n roles?: { role: string; type: LTRoleType }[];\n }) =>\n apiFetch('/bot-accounts', {\n method: 'POST',\n body: JSON.stringify(data),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n\nexport function useUpdateBot() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({\n id,\n ...data\n }: {\n id: string;\n display_name?: string;\n description?: string;\n status?: string;\n }) =>\n apiFetch(`/bot-accounts/${id}`, {\n method: 'PUT',\n body: JSON.stringify(data),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n\nexport function useDeleteBot() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch(`/bot-accounts/${id}`, { method: 'DELETE' }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n\nexport function useCreateBotApiKey() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({\n botId,\n name,\n scopes,\n }: {\n botId: string;\n name: string;\n scopes?: string[];\n }) =>\n apiFetch<{ id: string; rawKey: string }>(`/bot-accounts/${botId}/api-keys`, {\n method: 'POST',\n body: JSON.stringify({ name, scopes }),\n }),\n onSuccess: (_data, vars) => {\n queryClient.invalidateQueries({ queryKey: ['bots', vars.botId, 'api-keys'] });\n },\n });\n}\n\nexport function useRevokeBotApiKey() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ botId, keyId }: { botId: string; keyId: string }) =>\n apiFetch(`/bot-accounts/${botId}/api-keys/${keyId}`, { method: 'DELETE' }),\n onSuccess: (_data, vars) => {\n queryClient.invalidateQueries({ queryKey: ['bots', vars.botId, 'api-keys'] });\n },\n });\n}\n\nexport function useAddBotRole() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({\n botId,\n role,\n type,\n }: {\n botId: string;\n role: string;\n type: LTRoleType;\n }) =>\n apiFetch(`/bot-accounts/${botId}/roles`, {\n method: 'POST',\n body: JSON.stringify({ role, type }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n\nexport function useRemoveBotRole() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ botId, role }: { botId: string; role: string }) =>\n apiFetch(`/bot-accounts/${botId}/roles/${encodeURIComponent(role)}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n"],"names":["useBots","filters","params","useQuery","apiFetch","useBotApiKeys","botId","useCreateBot","queryClient","useQueryClient","useMutation","data","useUpdateBot","id","useDeleteBot","useCreateBotApiKey","name","scopes","_data","vars","useRevokeBotApiKey","keyId","useAddBotRole","role","type","useRemoveBotRole"],"mappings":"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"}
1
+ {"version":3,"file":"bots-D0LhyZZM.js","sources":["../../src/api/bots.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { BotRecord, BotApiKeyRecord } from './types';\nimport type { LTRoleType } from './types';\n\ninterface BotListResponse {\n bots: BotRecord[];\n total: number;\n}\n\ninterface BotFilters {\n limit?: number;\n offset?: number;\n}\n\n// ── Query hooks ──────────────────────────────────────────────────────────────\n\nexport function useBots(filters: BotFilters = {}) {\n const params = new URLSearchParams();\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<BotListResponse>({\n queryKey: ['bots', filters],\n queryFn: () => apiFetch(`/bot-accounts?${params}`),\n });\n}\n\nexport function useBotApiKeys(botId: string) {\n return useQuery<{ keys: BotApiKeyRecord[] }>({\n queryKey: ['bots', botId, 'api-keys'],\n queryFn: () => apiFetch(`/bot-accounts/${botId}/api-keys`),\n enabled: !!botId,\n });\n}\n\n// ── Mutation hooks ───────────────────────────────────────────────────────────\n\nexport function useCreateBot() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (data: {\n name: string;\n description?: string;\n display_name?: string;\n roles?: { role: string; type: LTRoleType }[];\n }) =>\n apiFetch('/bot-accounts', {\n method: 'POST',\n body: JSON.stringify(data),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n\nexport function useUpdateBot() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({\n id,\n ...data\n }: {\n id: string;\n display_name?: string;\n description?: string;\n status?: string;\n }) =>\n apiFetch(`/bot-accounts/${id}`, {\n method: 'PUT',\n body: JSON.stringify(data),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n\nexport function useDeleteBot() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch(`/bot-accounts/${id}`, { method: 'DELETE' }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n\nexport function useCreateBotApiKey() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({\n botId,\n name,\n scopes,\n }: {\n botId: string;\n name: string;\n scopes?: string[];\n }) =>\n apiFetch<{ id: string; rawKey: string }>(`/bot-accounts/${botId}/api-keys`, {\n method: 'POST',\n body: JSON.stringify({ name, scopes }),\n }),\n onSuccess: (_data, vars) => {\n queryClient.invalidateQueries({ queryKey: ['bots', vars.botId, 'api-keys'] });\n },\n });\n}\n\nexport function useRevokeBotApiKey() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ botId, keyId }: { botId: string; keyId: string }) =>\n apiFetch(`/bot-accounts/${botId}/api-keys/${keyId}`, { method: 'DELETE' }),\n onSuccess: (_data, vars) => {\n queryClient.invalidateQueries({ queryKey: ['bots', vars.botId, 'api-keys'] });\n },\n });\n}\n\nexport function useAddBotRole() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({\n botId,\n role,\n type,\n }: {\n botId: string;\n role: string;\n type: LTRoleType;\n }) =>\n apiFetch(`/bot-accounts/${botId}/roles`, {\n method: 'POST',\n body: JSON.stringify({ role, type }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n\nexport function useRemoveBotRole() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ botId, role }: { botId: string; role: string }) =>\n apiFetch(`/bot-accounts/${botId}/roles/${encodeURIComponent(role)}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['bots'] });\n },\n });\n}\n"],"names":["useBots","filters","params","useQuery","apiFetch","useBotApiKeys","botId","useCreateBot","queryClient","useQueryClient","useMutation","data","useUpdateBot","id","useDeleteBot","useCreateBotApiKey","name","scopes","_data","vars","useRevokeBotApiKey","keyId","useAddBotRole","role","type","useRemoveBotRole"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{u as i}from"./vendor-query-B2UbickB.js";import{d as e}from"./index-CWEOhAiK.js";function t(){return i({queryKey:["capabilities"],queryFn:()=>e("/capabilities")})}export{t as u};
2
- //# sourceMappingURL=capabilities-BUbl-ojp.js.map
1
+ import{u as i}from"./vendor-query-B2UbickB.js";import{d as e}from"./index-B7lEd0cY.js";function t(){return i({queryKey:["capabilities"],queryFn:()=>e("/capabilities")})}export{t as u};
2
+ //# sourceMappingURL=capabilities-DON4-NXs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities-BUbl-ojp.js","sources":["../../src/api/capabilities.ts"],"sourcesContent":["import { useQuery } from '@tanstack/react-query';\nimport { apiFetch } from './client';\n\nexport interface CapabilityTool {\n name: string;\n description: string;\n inputSchema: Record<string, any>;\n serverName: string;\n serverId: string;\n}\n\nexport interface CapabilityCategory {\n name: string;\n tools: CapabilityTool[];\n}\n\nexport interface CapabilitiesResponse {\n categories: CapabilityCategory[];\n totalTools: number;\n}\n\nexport function useCapabilities() {\n return useQuery<CapabilitiesResponse>({\n queryKey: ['capabilities'],\n queryFn: () => apiFetch('/capabilities'),\n });\n}\n"],"names":["useCapabilities","useQuery","apiFetch"],"mappings":"uFAqBO,SAASA,GAAkB,CAChC,OAAOC,EAA+B,CACpC,SAAU,CAAC,cAAc,EACzB,QAAS,IAAMC,EAAS,eAAe,CAAA,CACxC,CACH"}
1
+ {"version":3,"file":"capabilities-DON4-NXs.js","sources":["../../src/api/capabilities.ts"],"sourcesContent":["import { useQuery } from '@tanstack/react-query';\nimport { apiFetch } from './client';\n\nexport interface CapabilityTool {\n name: string;\n description: string;\n inputSchema: Record<string, any>;\n serverName: string;\n serverId: string;\n}\n\nexport interface CapabilityCategory {\n name: string;\n tools: CapabilityTool[];\n}\n\nexport interface CapabilitiesResponse {\n categories: CapabilityCategory[];\n totalTools: number;\n}\n\nexport function useCapabilities() {\n return useQuery<CapabilitiesResponse>({\n queryKey: ['capabilities'],\n queryFn: () => apiFetch('/capabilities'),\n });\n}\n"],"names":["useCapabilities","useQuery","apiFetch"],"mappings":"uFAqBO,SAASA,GAAkB,CAChC,OAAOC,EAA+B,CACpC,SAAU,CAAC,cAAc,EACzB,QAAS,IAAMC,EAAS,eAAe,CAAA,CACxC,CACH"}
@@ -1,2 +1,2 @@
1
- import{u as o,c as l,b as a}from"./vendor-query-B2UbickB.js";import{d as n}from"./index-CWEOhAiK.js";function s(){return n("/controlplane/apps")}function c(e){return n(`/controlplane/rollcall?app_id=${encodeURIComponent(e)}`)}function i(e){return n("/controlplane/throttle",{method:"POST",body:JSON.stringify(e)})}function p(e){return n("/controlplane/subscribe",{method:"POST",body:JSON.stringify(e)})}function m(e,t,u){let r=`/controlplane/streams?app_id=${encodeURIComponent(e)}&duration=${encodeURIComponent(t)}`;return n(r)}function b(){return o({queryKey:["controlplane","apps"],queryFn:s,staleTime:6e4})}function h(e,t){return o({queryKey:["controlplane","rollcall",e],queryFn:()=>c(e),enabled:!!e,refetchInterval:t})}function S(){const e=a();return l({mutationFn:i,onSuccess:()=>{setTimeout(()=>{e.invalidateQueries({queryKey:["controlplane","rollcall"]})},1500)}})}function d(e,t,u,r){return o({queryKey:["controlplane","streams",e,t,""],queryFn:()=>m(e,t),enabled:!!e,staleTime:15e3,refetchInterval:r})}function q(){return l({mutationFn:p})}export{S as a,q as b,h as c,d,b as u};
2
- //# sourceMappingURL=controlplane-DTFrH_vN.js.map
1
+ import{u as o,c as l,b as a}from"./vendor-query-B2UbickB.js";import{d as n}from"./index-B7lEd0cY.js";function s(){return n("/controlplane/apps")}function c(e){return n(`/controlplane/rollcall?app_id=${encodeURIComponent(e)}`)}function i(e){return n("/controlplane/throttle",{method:"POST",body:JSON.stringify(e)})}function p(e){return n("/controlplane/subscribe",{method:"POST",body:JSON.stringify(e)})}function m(e,t,u){let r=`/controlplane/streams?app_id=${encodeURIComponent(e)}&duration=${encodeURIComponent(t)}`;return n(r)}function b(){return o({queryKey:["controlplane","apps"],queryFn:s,staleTime:6e4})}function h(e,t){return o({queryKey:["controlplane","rollcall",e],queryFn:()=>c(e),enabled:!!e,refetchInterval:t})}function S(){const e=a();return l({mutationFn:i,onSuccess:()=>{setTimeout(()=>{e.invalidateQueries({queryKey:["controlplane","rollcall"]})},1500)}})}function d(e,t,u,r){return o({queryKey:["controlplane","streams",e,t,""],queryFn:()=>m(e,t),enabled:!!e,staleTime:15e3,refetchInterval:r})}function q(){return l({mutationFn:p})}export{S as a,q as b,h as c,d,b as u};
2
+ //# sourceMappingURL=controlplane-Bihd1kXf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"controlplane-DTFrH_vN.js","sources":["../../src/api/controlplane.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\n\n// ── Types ───────────────────────────────────────────────────────────────────\n\nexport interface ControlPlaneApp {\n appId: string;\n version: string;\n}\n\nexport interface QuorumProfile {\n namespace: string;\n app_id: string;\n engine_id: string;\n entity?: string;\n worker_topic?: string;\n stream?: string;\n stream_depth?: number;\n counts?: Record<string, number>;\n inited?: string;\n timestamp?: string;\n throttle?: number;\n reclaimDelay?: number;\n reclaimCount?: number;\n system?: {\n TotalMemoryGB: string;\n FreeMemoryGB: string;\n UsedMemoryGB: string;\n CPULoad: Array<Record<string, string>>;\n NetworkStats: Array<Record<string, unknown>>;\n };\n is_scout?: boolean;\n signature?: string;\n}\n\n// ── API functions ───────────────────────────────────────────────────────────\n\nfunction fetchApps() {\n return apiFetch<{ apps: ControlPlaneApp[] }>('/controlplane/apps');\n}\n\nfunction fetchRollCall(appId: string) {\n return apiFetch<{ profiles: QuorumProfile[] }>(`/controlplane/rollcall?app_id=${encodeURIComponent(appId)}`);\n}\n\nfunction postThrottle(body: { appId: string; throttle: number; topic?: string; guid?: string; scope?: 'engines' | 'workers' | 'all' }) {\n return apiFetch<{ success: boolean }>('/controlplane/throttle', {\n method: 'POST',\n body: JSON.stringify(body),\n });\n}\n\nfunction postSubscribe(body: { appId: string }) {\n return apiFetch<{ subscribed: boolean; appId: string }>('/controlplane/subscribe', {\n method: 'POST',\n body: JSON.stringify(body),\n });\n}\n\nexport interface StreamStats {\n pending: number;\n processed: number;\n byStream: Array<{ stream_type: 'engine' | 'worker'; stream_name: string; count: number }>;\n}\n\nfunction fetchStreamStats(appId: string, duration: string, stream?: string) {\n let url = `/controlplane/streams?app_id=${encodeURIComponent(appId)}&duration=${encodeURIComponent(duration)}`;\n if (stream) url += `&stream=${encodeURIComponent(stream)}`;\n return apiFetch<StreamStats>(url);\n}\n\n// ── Hooks ───────────────────────────────────────────────────────────────────\n\nexport function useControlPlaneApps() {\n return useQuery({\n queryKey: ['controlplane', 'apps'],\n queryFn: fetchApps,\n staleTime: 60_000,\n });\n}\n\nexport function useRollCall(appId: string, refetchInterval?: number | false) {\n return useQuery({\n queryKey: ['controlplane', 'rollcall', appId],\n queryFn: () => fetchRollCall(appId),\n enabled: !!appId,\n refetchInterval: refetchInterval ?? false,\n });\n}\n\nexport function useThrottle() {\n const qc = useQueryClient();\n return useMutation({\n mutationFn: postThrottle,\n onSuccess: () => {\n // Delay refetch so mesh members have time to process the throttle message\n setTimeout(() => {\n qc.invalidateQueries({ queryKey: ['controlplane', 'rollcall'] });\n }, 1500);\n },\n });\n}\n\nexport function useStreamStats(appId: string, duration: string, stream?: string, refetchInterval?: number | false) {\n return useQuery({\n queryKey: ['controlplane', 'streams', appId, duration, stream ?? ''],\n queryFn: () => fetchStreamStats(appId, duration, stream),\n enabled: !!appId,\n staleTime: 15_000,\n refetchInterval: refetchInterval ?? false,\n });\n}\n\nexport function useSubscribeMesh() {\n return useMutation({\n mutationFn: postSubscribe,\n });\n}\n"],"names":["fetchApps","apiFetch","fetchRollCall","appId","postThrottle","body","postSubscribe","fetchStreamStats","duration","stream","url","useControlPlaneApps","useQuery","useRollCall","refetchInterval","useThrottle","qc","useQueryClient","useMutation","useStreamStats","useSubscribeMesh"],"mappings":"qGAqCA,SAASA,GAAY,CACnB,OAAOC,EAAsC,oBAAoB,CACnE,CAEA,SAASC,EAAcC,EAAe,CACpC,OAAOF,EAAwC,iCAAiC,mBAAmBE,CAAK,CAAC,EAAE,CAC7G,CAEA,SAASC,EAAaC,EAAiH,CACrI,OAAOJ,EAA+B,yBAA0B,CAC9D,OAAQ,OACR,KAAM,KAAK,UAAUI,CAAI,CAAA,CAC1B,CACH,CAEA,SAASC,EAAcD,EAAyB,CAC9C,OAAOJ,EAAiD,0BAA2B,CACjF,OAAQ,OACR,KAAM,KAAK,UAAUI,CAAI,CAAA,CAC1B,CACH,CAQA,SAASE,EAAiBJ,EAAeK,EAAkBC,EAAiB,CAC1E,IAAIC,EAAM,gCAAgC,mBAAmBP,CAAK,CAAC,aAAa,mBAAmBK,CAAQ,CAAC,GAE5G,OAAOP,EAAsBS,CAAG,CAClC,CAIO,SAASC,GAAsB,CACpC,OAAOC,EAAS,CACd,SAAU,CAAC,eAAgB,MAAM,EACjC,QAASZ,EACT,UAAW,GAAA,CACZ,CACH,CAEO,SAASa,EAAYV,EAAeW,EAAkC,CAC3E,OAAOF,EAAS,CACd,SAAU,CAAC,eAAgB,WAAYT,CAAK,EAC5C,QAAS,IAAMD,EAAcC,CAAK,EAClC,QAAS,CAAC,CAACA,EACX,gBAAiBW,CAAmB,CACrC,CACH,CAEO,SAASC,GAAc,CAC5B,MAAMC,EAAKC,EAAA,EACX,OAAOC,EAAY,CACjB,WAAYd,EACZ,UAAW,IAAM,CAEf,WAAW,IAAM,CACfY,EAAG,kBAAkB,CAAE,SAAU,CAAC,eAAgB,UAAU,EAAG,CACjE,EAAG,IAAI,CACT,CAAA,CACD,CACH,CAEO,SAASG,EAAehB,EAAeK,EAAkBC,EAAiBK,EAAkC,CACjH,OAAOF,EAAS,CACd,SAAU,CAAC,eAAgB,UAAWT,EAAOK,EAAoB,EAAE,EACnE,QAAS,IAAMD,EAAiBJ,EAAOK,CAAgB,EACvD,QAAS,CAAC,CAACL,EACX,UAAW,KACX,gBAAiBW,CAAmB,CACrC,CACH,CAEO,SAASM,GAAmB,CACjC,OAAOF,EAAY,CACjB,WAAYZ,CAAA,CACb,CACH"}
1
+ {"version":3,"file":"controlplane-Bihd1kXf.js","sources":["../../src/api/controlplane.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\n\n// ── Types ───────────────────────────────────────────────────────────────────\n\nexport interface ControlPlaneApp {\n appId: string;\n version: string;\n}\n\nexport interface QuorumProfile {\n namespace: string;\n app_id: string;\n engine_id: string;\n entity?: string;\n worker_topic?: string;\n stream?: string;\n stream_depth?: number;\n counts?: Record<string, number>;\n inited?: string;\n timestamp?: string;\n throttle?: number;\n reclaimDelay?: number;\n reclaimCount?: number;\n system?: {\n TotalMemoryGB: string;\n FreeMemoryGB: string;\n UsedMemoryGB: string;\n CPULoad: Array<Record<string, string>>;\n NetworkStats: Array<Record<string, unknown>>;\n };\n is_scout?: boolean;\n signature?: string;\n}\n\n// ── API functions ───────────────────────────────────────────────────────────\n\nfunction fetchApps() {\n return apiFetch<{ apps: ControlPlaneApp[] }>('/controlplane/apps');\n}\n\nfunction fetchRollCall(appId: string) {\n return apiFetch<{ profiles: QuorumProfile[] }>(`/controlplane/rollcall?app_id=${encodeURIComponent(appId)}`);\n}\n\nfunction postThrottle(body: { appId: string; throttle: number; topic?: string; guid?: string; scope?: 'engines' | 'workers' | 'all' }) {\n return apiFetch<{ success: boolean }>('/controlplane/throttle', {\n method: 'POST',\n body: JSON.stringify(body),\n });\n}\n\nfunction postSubscribe(body: { appId: string }) {\n return apiFetch<{ subscribed: boolean; appId: string }>('/controlplane/subscribe', {\n method: 'POST',\n body: JSON.stringify(body),\n });\n}\n\nexport interface StreamStats {\n pending: number;\n processed: number;\n byStream: Array<{ stream_type: 'engine' | 'worker'; stream_name: string; count: number }>;\n}\n\nfunction fetchStreamStats(appId: string, duration: string, stream?: string) {\n let url = `/controlplane/streams?app_id=${encodeURIComponent(appId)}&duration=${encodeURIComponent(duration)}`;\n if (stream) url += `&stream=${encodeURIComponent(stream)}`;\n return apiFetch<StreamStats>(url);\n}\n\n// ── Hooks ───────────────────────────────────────────────────────────────────\n\nexport function useControlPlaneApps() {\n return useQuery({\n queryKey: ['controlplane', 'apps'],\n queryFn: fetchApps,\n staleTime: 60_000,\n });\n}\n\nexport function useRollCall(appId: string, refetchInterval?: number | false) {\n return useQuery({\n queryKey: ['controlplane', 'rollcall', appId],\n queryFn: () => fetchRollCall(appId),\n enabled: !!appId,\n refetchInterval: refetchInterval ?? false,\n });\n}\n\nexport function useThrottle() {\n const qc = useQueryClient();\n return useMutation({\n mutationFn: postThrottle,\n onSuccess: () => {\n // Delay refetch so mesh members have time to process the throttle message\n setTimeout(() => {\n qc.invalidateQueries({ queryKey: ['controlplane', 'rollcall'] });\n }, 1500);\n },\n });\n}\n\nexport function useStreamStats(appId: string, duration: string, stream?: string, refetchInterval?: number | false) {\n return useQuery({\n queryKey: ['controlplane', 'streams', appId, duration, stream ?? ''],\n queryFn: () => fetchStreamStats(appId, duration, stream),\n enabled: !!appId,\n staleTime: 15_000,\n refetchInterval: refetchInterval ?? false,\n });\n}\n\nexport function useSubscribeMesh() {\n return useMutation({\n mutationFn: postSubscribe,\n });\n}\n"],"names":["fetchApps","apiFetch","fetchRollCall","appId","postThrottle","body","postSubscribe","fetchStreamStats","duration","stream","url","useControlPlaneApps","useQuery","useRollCall","refetchInterval","useThrottle","qc","useQueryClient","useMutation","useStreamStats","useSubscribeMesh"],"mappings":"qGAqCA,SAASA,GAAY,CACnB,OAAOC,EAAsC,oBAAoB,CACnE,CAEA,SAASC,EAAcC,EAAe,CACpC,OAAOF,EAAwC,iCAAiC,mBAAmBE,CAAK,CAAC,EAAE,CAC7G,CAEA,SAASC,EAAaC,EAAiH,CACrI,OAAOJ,EAA+B,yBAA0B,CAC9D,OAAQ,OACR,KAAM,KAAK,UAAUI,CAAI,CAAA,CAC1B,CACH,CAEA,SAASC,EAAcD,EAAyB,CAC9C,OAAOJ,EAAiD,0BAA2B,CACjF,OAAQ,OACR,KAAM,KAAK,UAAUI,CAAI,CAAA,CAC1B,CACH,CAQA,SAASE,EAAiBJ,EAAeK,EAAkBC,EAAiB,CAC1E,IAAIC,EAAM,gCAAgC,mBAAmBP,CAAK,CAAC,aAAa,mBAAmBK,CAAQ,CAAC,GAE5G,OAAOP,EAAsBS,CAAG,CAClC,CAIO,SAASC,GAAsB,CACpC,OAAOC,EAAS,CACd,SAAU,CAAC,eAAgB,MAAM,EACjC,QAASZ,EACT,UAAW,GAAA,CACZ,CACH,CAEO,SAASa,EAAYV,EAAeW,EAAkC,CAC3E,OAAOF,EAAS,CACd,SAAU,CAAC,eAAgB,WAAYT,CAAK,EAC5C,QAAS,IAAMD,EAAcC,CAAK,EAClC,QAAS,CAAC,CAACA,EACX,gBAAiBW,CAAmB,CACrC,CACH,CAEO,SAASC,GAAc,CAC5B,MAAMC,EAAKC,EAAA,EACX,OAAOC,EAAY,CACjB,WAAYd,EACZ,UAAW,IAAM,CAEf,WAAW,IAAM,CACfY,EAAG,kBAAkB,CAAE,SAAU,CAAC,eAAgB,UAAU,EAAG,CACjE,EAAG,IAAI,CACT,CAAA,CACD,CACH,CAEO,SAASG,EAAehB,EAAeK,EAAkBC,EAAiBK,EAAkC,CACjH,OAAOF,EAAS,CACd,SAAU,CAAC,eAAgB,UAAWT,EAAOK,EAAoB,EAAE,EACnE,QAAS,IAAMD,EAAiBJ,EAAOK,CAAgB,EACvD,QAAS,CAAC,CAACL,EACX,UAAW,KACX,gBAAiBW,CAAmB,CACrC,CACH,CAEO,SAASM,GAAmB,CACjC,OAAOF,EAAY,CACjB,WAAYZ,CAAA,CACb,CACH"}
@@ -1,2 +1,2 @@
1
- import{a,j as r}from"./vendor-query-B2UbickB.js";import{x as l,y as c,z as m}from"./index-CWEOhAiK.js";const n=[{maxMs:0,color:"text-status-error"},{maxMs:300*1e3,color:"text-status-error"},{maxMs:900*1e3,color:"text-status-warning"},{maxMs:1/0,color:"text-text-secondary"}];function u(t){if(t<=0)return n[0].color;for(const e of n)if(t<e.maxMs)return e.color;return n[n.length-1].color}function w({until:t}){const[e,s]=a.useState(()=>new Date(t).getTime()-Date.now());a.useEffect(()=>{const o=setInterval(()=>{s(new Date(t).getTime()-Date.now())},1e3);return()=>clearInterval(o)},[t]);const i=a.useMemo(()=>{const o=new Date(t);return[{label:"ms",value:String(Math.max(0,e))},{label:"until",value:o.toISOString()},{label:"local",value:l(o,"MMM d, yyyy h:mm:ss a")}]},[t,e]);return r.jsx(c,{options:i,children:r.jsx("span",{className:`text-xs font-mono ${u(e)}`,children:m(e)})})}function d(t){return!!(t.assigned_to&&t.assigned_until&&new Date(t.assigned_until)>new Date)}function g(t){return!t.workflow_type}export{w as C,d as a,g as i};
2
- //# sourceMappingURL=escalation-BQhCt4W0.js.map
1
+ import{a,j as r}from"./vendor-query-B2UbickB.js";import{x as l,y as c,z as m}from"./index-B7lEd0cY.js";const n=[{maxMs:0,color:"text-status-error"},{maxMs:300*1e3,color:"text-status-error"},{maxMs:900*1e3,color:"text-status-warning"},{maxMs:1/0,color:"text-text-secondary"}];function u(t){if(t<=0)return n[0].color;for(const e of n)if(t<e.maxMs)return e.color;return n[n.length-1].color}function w({until:t}){const[e,s]=a.useState(()=>new Date(t).getTime()-Date.now());a.useEffect(()=>{const o=setInterval(()=>{s(new Date(t).getTime()-Date.now())},1e3);return()=>clearInterval(o)},[t]);const i=a.useMemo(()=>{const o=new Date(t);return[{label:"ms",value:String(Math.max(0,e))},{label:"until",value:o.toISOString()},{label:"local",value:l(o,"MMM d, yyyy h:mm:ss a")}]},[t,e]);return r.jsx(c,{options:i,children:r.jsx("span",{className:`text-xs font-mono ${u(e)}`,children:m(e)})})}function d(t){return!!(t.assigned_to&&t.assigned_until&&new Date(t.assigned_until)>new Date)}function g(t){return!t.workflow_type}export{w as C,d as a,g as i};
2
+ //# sourceMappingURL=escalation-CP2XbdXK.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"escalation-BQhCt4W0.js","sources":["../../src/components/common/display/CountdownTimer.tsx","../../src/lib/escalation.ts"],"sourcesContent":["import { useState, useEffect, useMemo } from 'react';\nimport { format as fnsFormat } from 'date-fns';\nimport { formatRemaining } from '../../../lib/format';\nimport { DateTooltip } from './DateTooltip';\n\nconst COUNTDOWN_THRESHOLDS = [\n { maxMs: 0, color: 'text-status-error' },\n { maxMs: 5 * 60 * 1000, color: 'text-status-error' },\n { maxMs: 15 * 60 * 1000, color: 'text-status-warning' },\n { maxMs: Infinity, color: 'text-text-secondary' },\n] as const;\n\nfunction countdownColor(remainingMs: number): string {\n if (remainingMs <= 0) return COUNTDOWN_THRESHOLDS[0].color;\n for (const t of COUNTDOWN_THRESHOLDS) {\n if (remainingMs < t.maxMs) return t.color;\n }\n return COUNTDOWN_THRESHOLDS[COUNTDOWN_THRESHOLDS.length - 1].color;\n}\n\nexport function CountdownTimer({ until }: { until: string }) {\n const [remaining, setRemaining] = useState(() => new Date(until).getTime() - Date.now());\n\n useEffect(() => {\n const interval = setInterval(() => {\n setRemaining(new Date(until).getTime() - Date.now());\n }, 1000);\n return () => clearInterval(interval);\n }, [until]);\n\n const options = useMemo(() => {\n const d = new Date(until);\n return [\n { label: 'ms', value: String(Math.max(0, remaining)) },\n { label: 'until', value: d.toISOString() },\n { label: 'local', value: fnsFormat(d, 'MMM d, yyyy h:mm:ss a') },\n ];\n }, [until, remaining]);\n\n return (\n <DateTooltip options={options}>\n <span className={`text-xs font-mono ${countdownColor(remaining)}`}>\n {formatRemaining(remaining)}\n </span>\n </DateTooltip>\n );\n}\n","import type { LTEscalationRecord } from '../api/types';\n\nexport function isEffectivelyClaimed(esc: LTEscalationRecord): boolean {\n return !!(\n esc.assigned_to &&\n esc.assigned_until &&\n new Date(esc.assigned_until) > new Date()\n );\n}\n\n/** An ACK escalation has no associated workflow — it's a notification, not a task. */\nexport function isAckEscalation(esc: LTEscalationRecord): boolean {\n return !esc.workflow_type;\n}\n\nexport function isAvailable(esc: LTEscalationRecord): boolean {\n return (\n esc.status === 'pending' &&\n (!esc.assigned_to ||\n !esc.assigned_until ||\n new Date(esc.assigned_until) <= new Date())\n );\n}\n"],"names":["COUNTDOWN_THRESHOLDS","countdownColor","remainingMs","t","CountdownTimer","until","remaining","setRemaining","useState","useEffect","interval","options","useMemo","d","fnsFormat","jsx","DateTooltip","formatRemaining","isEffectivelyClaimed","esc","isAckEscalation"],"mappings":"uGAKA,MAAMA,EAAuB,CAC3B,CAAE,MAAO,EAAgB,MAAO,mBAAA,EAChC,CAAE,MAAO,IAAS,IAAO,MAAO,mBAAA,EAChC,CAAE,MAAO,IAAU,IAAM,MAAO,qBAAA,EAChC,CAAE,MAAO,IAAiB,MAAO,qBAAA,CACnC,EAEA,SAASC,EAAeC,EAA6B,CACnD,GAAIA,GAAe,EAAG,OAAOF,EAAqB,CAAC,EAAE,MACrD,UAAWG,KAAKH,EACd,GAAIE,EAAcC,EAAE,MAAO,OAAOA,EAAE,MAEtC,OAAOH,EAAqBA,EAAqB,OAAS,CAAC,EAAE,KAC/D,CAEO,SAASI,EAAe,CAAE,MAAAC,GAA4B,CAC3D,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,SAAS,IAAM,IAAI,KAAKH,CAAK,EAAE,QAAA,EAAY,KAAK,KAAK,EAEvFI,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAW,YAAY,IAAM,CACjCH,EAAa,IAAI,KAAKF,CAAK,EAAE,UAAY,KAAK,KAAK,CACrD,EAAG,GAAI,EACP,MAAO,IAAM,cAAcK,CAAQ,CACrC,EAAG,CAACL,CAAK,CAAC,EAEV,MAAMM,EAAUC,EAAAA,QAAQ,IAAM,CAC5B,MAAMC,EAAI,IAAI,KAAKR,CAAK,EACxB,MAAO,CACL,CAAE,MAAO,KAAM,MAAO,OAAO,KAAK,IAAI,EAAGC,CAAS,CAAC,CAAA,EACnD,CAAE,MAAO,QAAS,MAAOO,EAAE,aAAY,EACvC,CAAE,MAAO,QAAS,MAAOC,EAAUD,EAAG,uBAAuB,CAAA,CAAE,CAEnE,EAAG,CAACR,EAAOC,CAAS,CAAC,EAErB,OACES,EAAAA,IAACC,EAAA,CAAY,QAAAL,EACX,SAAAI,MAAC,QAAK,UAAW,qBAAqBd,EAAeK,CAAS,CAAC,GAC5D,SAAAW,EAAgBX,CAAS,EAC5B,EACF,CAEJ,CC5CO,SAASY,EAAqBC,EAAkC,CACrE,MAAO,CAAC,EACNA,EAAI,aACJA,EAAI,gBACJ,IAAI,KAAKA,EAAI,cAAc,EAAI,IAAI,KAEvC,CAGO,SAASC,EAAgBD,EAAkC,CAChE,MAAO,CAACA,EAAI,aACd"}
1
+ {"version":3,"file":"escalation-CP2XbdXK.js","sources":["../../src/components/common/display/CountdownTimer.tsx","../../src/lib/escalation.ts"],"sourcesContent":["import { useState, useEffect, useMemo } from 'react';\nimport { format as fnsFormat } from 'date-fns';\nimport { formatRemaining } from '../../../lib/format';\nimport { DateTooltip } from './DateTooltip';\n\nconst COUNTDOWN_THRESHOLDS = [\n { maxMs: 0, color: 'text-status-error' },\n { maxMs: 5 * 60 * 1000, color: 'text-status-error' },\n { maxMs: 15 * 60 * 1000, color: 'text-status-warning' },\n { maxMs: Infinity, color: 'text-text-secondary' },\n] as const;\n\nfunction countdownColor(remainingMs: number): string {\n if (remainingMs <= 0) return COUNTDOWN_THRESHOLDS[0].color;\n for (const t of COUNTDOWN_THRESHOLDS) {\n if (remainingMs < t.maxMs) return t.color;\n }\n return COUNTDOWN_THRESHOLDS[COUNTDOWN_THRESHOLDS.length - 1].color;\n}\n\nexport function CountdownTimer({ until }: { until: string }) {\n const [remaining, setRemaining] = useState(() => new Date(until).getTime() - Date.now());\n\n useEffect(() => {\n const interval = setInterval(() => {\n setRemaining(new Date(until).getTime() - Date.now());\n }, 1000);\n return () => clearInterval(interval);\n }, [until]);\n\n const options = useMemo(() => {\n const d = new Date(until);\n return [\n { label: 'ms', value: String(Math.max(0, remaining)) },\n { label: 'until', value: d.toISOString() },\n { label: 'local', value: fnsFormat(d, 'MMM d, yyyy h:mm:ss a') },\n ];\n }, [until, remaining]);\n\n return (\n <DateTooltip options={options}>\n <span className={`text-xs font-mono ${countdownColor(remaining)}`}>\n {formatRemaining(remaining)}\n </span>\n </DateTooltip>\n );\n}\n","import type { LTEscalationRecord } from '../api/types';\n\nexport function isEffectivelyClaimed(esc: LTEscalationRecord): boolean {\n return !!(\n esc.assigned_to &&\n esc.assigned_until &&\n new Date(esc.assigned_until) > new Date()\n );\n}\n\n/** An ACK escalation has no associated workflow — it's a notification, not a task. */\nexport function isAckEscalation(esc: LTEscalationRecord): boolean {\n return !esc.workflow_type;\n}\n\nexport function isAvailable(esc: LTEscalationRecord): boolean {\n return (\n esc.status === 'pending' &&\n (!esc.assigned_to ||\n !esc.assigned_until ||\n new Date(esc.assigned_until) <= new Date())\n );\n}\n"],"names":["COUNTDOWN_THRESHOLDS","countdownColor","remainingMs","t","CountdownTimer","until","remaining","setRemaining","useState","useEffect","interval","options","useMemo","d","fnsFormat","jsx","DateTooltip","formatRemaining","isEffectivelyClaimed","esc","isAckEscalation"],"mappings":"uGAKA,MAAMA,EAAuB,CAC3B,CAAE,MAAO,EAAgB,MAAO,mBAAA,EAChC,CAAE,MAAO,IAAS,IAAO,MAAO,mBAAA,EAChC,CAAE,MAAO,IAAU,IAAM,MAAO,qBAAA,EAChC,CAAE,MAAO,IAAiB,MAAO,qBAAA,CACnC,EAEA,SAASC,EAAeC,EAA6B,CACnD,GAAIA,GAAe,EAAG,OAAOF,EAAqB,CAAC,EAAE,MACrD,UAAWG,KAAKH,EACd,GAAIE,EAAcC,EAAE,MAAO,OAAOA,EAAE,MAEtC,OAAOH,EAAqBA,EAAqB,OAAS,CAAC,EAAE,KAC/D,CAEO,SAASI,EAAe,CAAE,MAAAC,GAA4B,CAC3D,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,SAAS,IAAM,IAAI,KAAKH,CAAK,EAAE,QAAA,EAAY,KAAK,KAAK,EAEvFI,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAW,YAAY,IAAM,CACjCH,EAAa,IAAI,KAAKF,CAAK,EAAE,UAAY,KAAK,KAAK,CACrD,EAAG,GAAI,EACP,MAAO,IAAM,cAAcK,CAAQ,CACrC,EAAG,CAACL,CAAK,CAAC,EAEV,MAAMM,EAAUC,EAAAA,QAAQ,IAAM,CAC5B,MAAMC,EAAI,IAAI,KAAKR,CAAK,EACxB,MAAO,CACL,CAAE,MAAO,KAAM,MAAO,OAAO,KAAK,IAAI,EAAGC,CAAS,CAAC,CAAA,EACnD,CAAE,MAAO,QAAS,MAAOO,EAAE,aAAY,EACvC,CAAE,MAAO,QAAS,MAAOC,EAAUD,EAAG,uBAAuB,CAAA,CAAE,CAEnE,EAAG,CAACR,EAAOC,CAAS,CAAC,EAErB,OACES,EAAAA,IAACC,EAAA,CAAY,QAAAL,EACX,SAAAI,MAAC,QAAK,UAAW,qBAAqBd,EAAeK,CAAS,CAAC,GAC5D,SAAAW,EAAgBX,CAAS,EAC5B,EACF,CAEJ,CC5CO,SAASY,EAAqBC,EAAkC,CACrE,MAAO,CAAC,EACNA,EAAI,aACJA,EAAI,gBACJ,IAAI,KAAKA,EAAI,cAAc,EAAI,IAAI,KAEvC,CAGO,SAASC,EAAgBD,EAAkC,CAChE,MAAO,CAACA,EAAI,aACd"}
@@ -1,2 +1,2 @@
1
- import{j as a}from"./vendor-query-B2UbickB.js";import{F as x,b as l,a as p}from"./FilterBar-Ck4K4rzu.js";import{P as m}from"./PriorityBadge-DfQY9St9.js";import{R as u}from"./RolePill-SasQKc_B.js";import{W as d}from"./WorkflowPill-Z-zHRKOK.js";import{T as h}from"./TimestampCell-CDmichOM.js";import{C as y,i as j,a as v}from"./escalation-BQhCt4W0.js";import{a9 as b,aa as k,ab as f,ac as r}from"./vendor-icons-Doy0g69_.js";import{L as N}from"./vendor-react-CXumBFUA.js";function g({row:e}){if(j(e)){const t=e.status==="resolved"?"text-status-success":"text-text-tertiary";return a.jsx(f,{className:`w-3 h-3 shrink-0 ${t}`})}return e.status==="resolved"?a.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-success text-status-success"}):e.status==="cancelled"?a.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-error text-status-error"}):v(e)?a.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-warning text-status-warning"}):a.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-active text-status-active"})}const A=[{key:"description",label:"Summary",render:e=>a.jsxs("div",{className:"flex items-start gap-2 overflow-hidden",children:[a.jsx("span",{className:"mt-1 shrink-0",children:a.jsx(g,{row:e})}),a.jsxs("div",{className:"min-w-0 overflow-hidden",children:[a.jsx("p",{className:"text-xs text-text-primary truncate",children:e.description||e.type}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx(d,{type:e.type}),e.subtype&&e.subtype!==e.type&&a.jsx("span",{className:"text-[10px] text-text-tertiary whitespace-nowrap",children:e.subtype})]})]})]}),className:"max-w-0"},{key:"task_id",label:"Task",render:e=>e.task_id?a.jsxs(N,{to:`/workflows/tasks/detail/${e.task_id}`,onClick:t=>t.stopPropagation(),className:"group/task inline-flex items-center gap-1 text-xs font-mono text-text-secondary hover:text-accent transition-colors",children:[e.task_id.slice(0,12),"…",a.jsx(b,{size:10,className:"opacity-0 group-hover/task:opacity-100 transition-opacity"})]}):a.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-36 whitespace-nowrap"},{key:"role",label:"Role",render:e=>a.jsx(u,{role:e.role}),className:"w-28"},{key:"priority",label:"Priority",render:e=>a.jsx(m,{priority:e.priority}),className:"w-20",sortable:!0},{key:"created_at",label:"Created",render:e=>a.jsx(h,{date:e.created_at}),className:"w-40",sortable:!0}],B={key:"expires",label:a.jsx(k,{className:"w-3.5 h-3.5 text-text-tertiary"}),render:e=>e.assigned_until?a.jsx(y,{until:e.assigned_until}):a.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-16 whitespace-nowrap"},C=[{value:"1",label:"P1"},{value:"2",label:"P2"},{value:"3",label:"P3"},{value:"4",label:"P4"}],w=[{value:"available",label:"Available"},{value:"claimed",label:"Claimed"},{value:"resolved",label:"Resolved"}];function M({filters:e,setFilter:t,roles:i,types:n,showStatus:o=!1,actions:c}){return a.jsxs(x,{actions:c,children:[o&&a.jsx(l,{label:"Status",value:e.status??"",onChange:s=>t("status",s),options:w}),a.jsx(l,{label:"Role",value:e.role,onChange:s=>t("role",s),options:i.map(s=>({value:s,label:s}))}),a.jsx(l,{label:"Type",value:e.type,onChange:s=>t("type",s),options:n.map(s=>({value:s,label:s}))}),a.jsx(l,{label:"Priority",value:e.priority,onChange:s=>t("priority",s),options:C}),a.jsx(p,{label:"Search",value:e.search??"",onChange:s=>t("search",s),placeholder:"ID, workflow, origin…"})]})}export{A as E,B as T,M as a};
2
- //# sourceMappingURL=escalation-columns-J20k5CcY.js.map
1
+ import{j as a}from"./vendor-query-B2UbickB.js";import{F as x,b as l,a as p}from"./FilterBar-Ck4K4rzu.js";import{P as m}from"./PriorityBadge-DfQY9St9.js";import{R as u}from"./RolePill-DQTT1s9v.js";import{W as d}from"./WorkflowPill-F1oKUzmc.js";import{T as h}from"./TimestampCell-DPpoTdrw.js";import{C as y,i as j,a as v}from"./escalation-CP2XbdXK.js";import{a6 as b,a7 as k,a8 as f,a9 as r}from"./vendor-icons-Dj2F0Jrb.js";import{L as N}from"./vendor-react-CXumBFUA.js";function g({row:e}){if(j(e)){const t=e.status==="resolved"?"text-status-success":"text-text-tertiary";return a.jsx(f,{className:`w-3 h-3 shrink-0 ${t}`})}return e.status==="resolved"?a.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-success text-status-success"}):e.status==="cancelled"?a.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-error text-status-error"}):v(e)?a.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-warning text-status-warning"}):a.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-active text-status-active"})}const A=[{key:"description",label:"Summary",render:e=>a.jsxs("div",{className:"flex items-start gap-2 overflow-hidden",children:[a.jsx("span",{className:"mt-1 shrink-0",children:a.jsx(g,{row:e})}),a.jsxs("div",{className:"min-w-0 overflow-hidden",children:[a.jsx("p",{className:"text-xs text-text-primary truncate",children:e.description||e.type}),a.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[a.jsx(d,{type:e.type}),e.subtype&&e.subtype!==e.type&&a.jsx("span",{className:"text-[10px] text-text-tertiary whitespace-nowrap",children:e.subtype})]})]})]}),className:"max-w-0"},{key:"task_id",label:"Task",render:e=>e.task_id?a.jsxs(N,{to:`/workflows/tasks/detail/${e.task_id}`,onClick:t=>t.stopPropagation(),className:"group/task inline-flex items-center gap-1 text-xs font-mono text-text-secondary hover:text-accent transition-colors",children:[e.task_id.slice(0,12),"…",a.jsx(b,{size:10,className:"opacity-0 group-hover/task:opacity-100 transition-opacity"})]}):a.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-36 whitespace-nowrap"},{key:"role",label:"Role",render:e=>a.jsx(u,{role:e.role}),className:"w-28"},{key:"priority",label:"Priority",render:e=>a.jsx(m,{priority:e.priority}),className:"w-20",sortable:!0},{key:"created_at",label:"Created",render:e=>a.jsx(h,{date:e.created_at}),className:"w-40",sortable:!0}],B={key:"expires",label:a.jsx(k,{className:"w-3.5 h-3.5 text-text-tertiary"}),render:e=>e.assigned_until?a.jsx(y,{until:e.assigned_until}):a.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-16 whitespace-nowrap"},C=[{value:"1",label:"P1"},{value:"2",label:"P2"},{value:"3",label:"P3"},{value:"4",label:"P4"}],w=[{value:"available",label:"Available"},{value:"claimed",label:"Claimed"},{value:"resolved",label:"Resolved"}];function M({filters:e,setFilter:t,roles:i,types:n,showStatus:o=!1,actions:c}){return a.jsxs(x,{actions:c,children:[o&&a.jsx(l,{label:"Status",value:e.status??"",onChange:s=>t("status",s),options:w}),a.jsx(l,{label:"Role",value:e.role,onChange:s=>t("role",s),options:i.map(s=>({value:s,label:s}))}),a.jsx(l,{label:"Type",value:e.type,onChange:s=>t("type",s),options:n.map(s=>({value:s,label:s}))}),a.jsx(l,{label:"Priority",value:e.priority,onChange:s=>t("priority",s),options:C}),a.jsx(p,{label:"Search",value:e.search??"",onChange:s=>t("search",s),placeholder:"ID, workflow, origin…"})]})}export{A as E,B as T,M as a};
2
+ //# sourceMappingURL=escalation-columns-9aw8Y4qq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"escalation-columns-J20k5CcY.js","sources":["../../src/pages/operator/escalation-columns.tsx"],"sourcesContent":["import { Link } from 'react-router-dom';\nimport { ExternalLink, Circle, Bell, Clock } from 'lucide-react';\nimport type { Column } from '../../components/common/data/DataTable';\nimport { FilterBar, FilterSelect, FilterInput } from '../../components/common/data/FilterBar';\nimport { PriorityBadge } from '../../components/common/display/PriorityBadge';\nimport { RolePill } from '../../components/common/display/RolePill';\nimport { WorkflowPill } from '../../components/common/display/WorkflowPill';\nimport { TimestampCell } from '../../components/common/display/TimestampCell';\nimport { CountdownTimer } from '../../components/common/display/CountdownTimer';\nimport { isEffectivelyClaimed, isAckEscalation } from '../../lib/escalation';\nimport type { LTEscalationRecord } from '../../api/types';\n\n/** Status dot — rendered inline before summary. */\nfunction StatusDot({ row }: { row: LTEscalationRecord }) {\n if (isAckEscalation(row)) {\n const color = row.status === 'resolved' ? 'text-status-success' : 'text-text-tertiary';\n return <Bell className={`w-3 h-3 shrink-0 ${color}`} />;\n }\n if (row.status === 'resolved') {\n return <Circle className=\"w-2.5 h-2.5 shrink-0 fill-status-success text-status-success\" />;\n }\n if (row.status === 'cancelled') {\n return <Circle className=\"w-2.5 h-2.5 shrink-0 fill-status-error text-status-error\" />;\n }\n if (isEffectivelyClaimed(row)) {\n return <Circle className=\"w-2.5 h-2.5 shrink-0 fill-status-warning text-status-warning\" />;\n }\n // pending (unclaimed)\n return <Circle className=\"w-2.5 h-2.5 shrink-0 fill-status-active text-status-active\" />;\n}\n\n/** Base columns shared by all escalation list pages. */\nexport const ESCALATION_COLUMNS: Column<LTEscalationRecord>[] = [\n {\n key: 'description',\n label: 'Summary',\n render: (row) => (\n <div className=\"flex items-start gap-2 overflow-hidden\">\n <span className=\"mt-1 shrink-0\"><StatusDot row={row} /></span>\n <div className=\"min-w-0 overflow-hidden\">\n <p className=\"text-xs text-text-primary truncate\">{row.description || row.type}</p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <WorkflowPill type={row.type} />\n {row.subtype && row.subtype !== row.type && (\n <span className=\"text-[10px] text-text-tertiary whitespace-nowrap\">{row.subtype}</span>\n )}\n </div>\n </div>\n </div>\n ),\n className: 'max-w-0',\n },\n {\n key: 'task_id',\n label: 'Task',\n render: (row) =>\n row.task_id ? (\n <Link\n to={`/workflows/tasks/detail/${row.task_id}`}\n onClick={(e) => e.stopPropagation()}\n className=\"group/task inline-flex items-center gap-1 text-xs font-mono text-text-secondary hover:text-accent transition-colors\"\n >\n {row.task_id.slice(0, 12)}…\n <ExternalLink size={10} className=\"opacity-0 group-hover/task:opacity-100 transition-opacity\" />\n </Link>\n ) : (\n <span className=\"text-xs text-text-tertiary\">—</span>\n ),\n className: 'w-36 whitespace-nowrap',\n },\n {\n key: 'role',\n label: 'Role',\n render: (row) => <RolePill role={row.role} />,\n className: 'w-28',\n },\n {\n key: 'priority',\n label: 'Priority',\n render: (row) => <PriorityBadge priority={row.priority} />,\n className: 'w-20',\n sortable: true,\n },\n {\n key: 'created_at',\n label: 'Created',\n render: (row) => <TimestampCell date={row.created_at} />,\n className: 'w-40',\n sortable: true,\n },\n];\n\n/** Time-remaining column for claimed escalations — aligns with checkbox column on All Escalations. */\nexport const TIME_LEFT_COLUMN: Column<LTEscalationRecord> = {\n key: 'expires',\n label: (<Clock className=\"w-3.5 h-3.5 text-text-tertiary\" />) as any,\n render: (row) =>\n row.assigned_until ? (\n <CountdownTimer until={row.assigned_until} />\n ) : (\n <span className=\"text-xs text-text-tertiary\">—</span>\n ),\n className: 'w-16 whitespace-nowrap',\n};\n\n/** Status icon column — color-coded filled circle, or bell for ACK/notification escalations. */\nexport const STATUS_COLUMN: Column<LTEscalationRecord> = {\n key: 'status',\n label: '',\n render: (row) => {\n if (isAckEscalation(row)) {\n const color = row.status === 'resolved' ? 'text-status-success' : 'text-text-tertiary';\n return <Bell className={`w-3 h-3 ${color}`} />;\n }\n if (row.status === 'resolved') {\n return <Circle className=\"w-2.5 h-2.5 fill-status-success text-status-success\" />;\n }\n if (isEffectivelyClaimed(row)) {\n return <Circle className=\"w-2.5 h-2.5 fill-status-warning text-status-warning\" />;\n }\n // pending (unclaimed)\n return <Circle className=\"w-2.5 h-2.5 fill-text-tertiary text-text-tertiary\" />;\n },\n className: 'w-8',\n};\n\n/** Claimed-only status icon (always orange, or bell for ACK). */\nexport const CLAIMED_STATUS_COLUMN: Column<LTEscalationRecord> = {\n key: 'status',\n label: '',\n render: (row) =>\n isAckEscalation(row)\n ? <Bell className=\"w-3 h-3 text-status-warning\" />\n : <Circle className=\"w-2.5 h-2.5 fill-status-warning text-status-warning\" />,\n className: 'w-8',\n};\n\n/** Priority filter options shared by both pages. */\nexport const PRIORITY_OPTIONS = [\n { value: '1', label: 'P1' },\n { value: '2', label: 'P2' },\n { value: '3', label: 'P3' },\n { value: '4', label: 'P4' },\n];\n\n/** Status filter options for escalation list pages. */\nexport const STATUS_OPTIONS = [\n { value: 'available', label: 'Available' },\n { value: 'claimed', label: 'Claimed' },\n { value: 'resolved', label: 'Resolved' },\n];\n\n/** Shared filter bar for escalation list pages. */\nexport function EscalationFilterBar({\n filters,\n setFilter,\n roles,\n types,\n showStatus = false,\n actions,\n}: {\n filters: { role: string; type: string; priority: string; status?: string; search?: string };\n setFilter: (key: any, value: string) => void;\n roles: string[];\n types: string[];\n showStatus?: boolean;\n actions?: React.ReactNode;\n}) {\n return (\n <FilterBar actions={actions}>\n {showStatus && (\n <FilterSelect\n label=\"Status\"\n value={filters.status ?? ''}\n onChange={(v) => setFilter('status', v)}\n options={STATUS_OPTIONS}\n />\n )}\n <FilterSelect\n label=\"Role\"\n value={filters.role}\n onChange={(v) => setFilter('role', v)}\n options={roles.map((r) => ({ value: r, label: r }))}\n />\n <FilterSelect\n label=\"Type\"\n value={filters.type}\n onChange={(v) => setFilter('type', v)}\n options={types.map((t) => ({ value: t, label: t }))}\n />\n <FilterSelect\n label=\"Priority\"\n value={filters.priority}\n onChange={(v) => setFilter('priority', v)}\n options={PRIORITY_OPTIONS}\n />\n <FilterInput\n label=\"Search\"\n value={filters.search ?? ''}\n onChange={(v) => setFilter('search', v)}\n placeholder=\"ID, workflow, origin…\"\n />\n </FilterBar>\n );\n}\n"],"names":["StatusDot","row","isAckEscalation","color","jsx","Bell","Circle","isEffectivelyClaimed","ESCALATION_COLUMNS","jsxs","WorkflowPill","Link","e","ExternalLink","RolePill","PriorityBadge","TimestampCell","TIME_LEFT_COLUMN","Clock","CountdownTimer","PRIORITY_OPTIONS","STATUS_OPTIONS","EscalationFilterBar","filters","setFilter","roles","types","showStatus","actions","FilterBar","FilterSelect","v","r","t","FilterInput"],"mappings":"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"}
1
+ {"version":3,"file":"escalation-columns-9aw8Y4qq.js","sources":["../../src/pages/operator/escalation-columns.tsx"],"sourcesContent":["import { Link } from 'react-router-dom';\nimport { ExternalLink, Circle, Bell, Clock } from 'lucide-react';\nimport type { Column } from '../../components/common/data/DataTable';\nimport { FilterBar, FilterSelect, FilterInput } from '../../components/common/data/FilterBar';\nimport { PriorityBadge } from '../../components/common/display/PriorityBadge';\nimport { RolePill } from '../../components/common/display/RolePill';\nimport { WorkflowPill } from '../../components/common/display/WorkflowPill';\nimport { TimestampCell } from '../../components/common/display/TimestampCell';\nimport { CountdownTimer } from '../../components/common/display/CountdownTimer';\nimport { isEffectivelyClaimed, isAckEscalation } from '../../lib/escalation';\nimport type { LTEscalationRecord } from '../../api/types';\n\n/** Status dot — rendered inline before summary. */\nfunction StatusDot({ row }: { row: LTEscalationRecord }) {\n if (isAckEscalation(row)) {\n const color = row.status === 'resolved' ? 'text-status-success' : 'text-text-tertiary';\n return <Bell className={`w-3 h-3 shrink-0 ${color}`} />;\n }\n if (row.status === 'resolved') {\n return <Circle className=\"w-2.5 h-2.5 shrink-0 fill-status-success text-status-success\" />;\n }\n if (row.status === 'cancelled') {\n return <Circle className=\"w-2.5 h-2.5 shrink-0 fill-status-error text-status-error\" />;\n }\n if (isEffectivelyClaimed(row)) {\n return <Circle className=\"w-2.5 h-2.5 shrink-0 fill-status-warning text-status-warning\" />;\n }\n // pending (unclaimed)\n return <Circle className=\"w-2.5 h-2.5 shrink-0 fill-status-active text-status-active\" />;\n}\n\n/** Base columns shared by all escalation list pages. */\nexport const ESCALATION_COLUMNS: Column<LTEscalationRecord>[] = [\n {\n key: 'description',\n label: 'Summary',\n render: (row) => (\n <div className=\"flex items-start gap-2 overflow-hidden\">\n <span className=\"mt-1 shrink-0\"><StatusDot row={row} /></span>\n <div className=\"min-w-0 overflow-hidden\">\n <p className=\"text-xs text-text-primary truncate\">{row.description || row.type}</p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <WorkflowPill type={row.type} />\n {row.subtype && row.subtype !== row.type && (\n <span className=\"text-[10px] text-text-tertiary whitespace-nowrap\">{row.subtype}</span>\n )}\n </div>\n </div>\n </div>\n ),\n className: 'max-w-0',\n },\n {\n key: 'task_id',\n label: 'Task',\n render: (row) =>\n row.task_id ? (\n <Link\n to={`/workflows/tasks/detail/${row.task_id}`}\n onClick={(e) => e.stopPropagation()}\n className=\"group/task inline-flex items-center gap-1 text-xs font-mono text-text-secondary hover:text-accent transition-colors\"\n >\n {row.task_id.slice(0, 12)}…\n <ExternalLink size={10} className=\"opacity-0 group-hover/task:opacity-100 transition-opacity\" />\n </Link>\n ) : (\n <span className=\"text-xs text-text-tertiary\">—</span>\n ),\n className: 'w-36 whitespace-nowrap',\n },\n {\n key: 'role',\n label: 'Role',\n render: (row) => <RolePill role={row.role} />,\n className: 'w-28',\n },\n {\n key: 'priority',\n label: 'Priority',\n render: (row) => <PriorityBadge priority={row.priority} />,\n className: 'w-20',\n sortable: true,\n },\n {\n key: 'created_at',\n label: 'Created',\n render: (row) => <TimestampCell date={row.created_at} />,\n className: 'w-40',\n sortable: true,\n },\n];\n\n/** Time-remaining column for claimed escalations — aligns with checkbox column on All Escalations. */\nexport const TIME_LEFT_COLUMN: Column<LTEscalationRecord> = {\n key: 'expires',\n label: (<Clock className=\"w-3.5 h-3.5 text-text-tertiary\" />) as any,\n render: (row) =>\n row.assigned_until ? (\n <CountdownTimer until={row.assigned_until} />\n ) : (\n <span className=\"text-xs text-text-tertiary\">—</span>\n ),\n className: 'w-16 whitespace-nowrap',\n};\n\n/** Status icon column — color-coded filled circle, or bell for ACK/notification escalations. */\nexport const STATUS_COLUMN: Column<LTEscalationRecord> = {\n key: 'status',\n label: '',\n render: (row) => {\n if (isAckEscalation(row)) {\n const color = row.status === 'resolved' ? 'text-status-success' : 'text-text-tertiary';\n return <Bell className={`w-3 h-3 ${color}`} />;\n }\n if (row.status === 'resolved') {\n return <Circle className=\"w-2.5 h-2.5 fill-status-success text-status-success\" />;\n }\n if (isEffectivelyClaimed(row)) {\n return <Circle className=\"w-2.5 h-2.5 fill-status-warning text-status-warning\" />;\n }\n // pending (unclaimed)\n return <Circle className=\"w-2.5 h-2.5 fill-text-tertiary text-text-tertiary\" />;\n },\n className: 'w-8',\n};\n\n/** Claimed-only status icon (always orange, or bell for ACK). */\nexport const CLAIMED_STATUS_COLUMN: Column<LTEscalationRecord> = {\n key: 'status',\n label: '',\n render: (row) =>\n isAckEscalation(row)\n ? <Bell className=\"w-3 h-3 text-status-warning\" />\n : <Circle className=\"w-2.5 h-2.5 fill-status-warning text-status-warning\" />,\n className: 'w-8',\n};\n\n/** Priority filter options shared by both pages. */\nexport const PRIORITY_OPTIONS = [\n { value: '1', label: 'P1' },\n { value: '2', label: 'P2' },\n { value: '3', label: 'P3' },\n { value: '4', label: 'P4' },\n];\n\n/** Status filter options for escalation list pages. */\nexport const STATUS_OPTIONS = [\n { value: 'available', label: 'Available' },\n { value: 'claimed', label: 'Claimed' },\n { value: 'resolved', label: 'Resolved' },\n];\n\n/** Shared filter bar for escalation list pages. */\nexport function EscalationFilterBar({\n filters,\n setFilter,\n roles,\n types,\n showStatus = false,\n actions,\n}: {\n filters: { role: string; type: string; priority: string; status?: string; search?: string };\n setFilter: (key: any, value: string) => void;\n roles: string[];\n types: string[];\n showStatus?: boolean;\n actions?: React.ReactNode;\n}) {\n return (\n <FilterBar actions={actions}>\n {showStatus && (\n <FilterSelect\n label=\"Status\"\n value={filters.status ?? ''}\n onChange={(v) => setFilter('status', v)}\n options={STATUS_OPTIONS}\n />\n )}\n <FilterSelect\n label=\"Role\"\n value={filters.role}\n onChange={(v) => setFilter('role', v)}\n options={roles.map((r) => ({ value: r, label: r }))}\n />\n <FilterSelect\n label=\"Type\"\n value={filters.type}\n onChange={(v) => setFilter('type', v)}\n options={types.map((t) => ({ value: t, label: t }))}\n />\n <FilterSelect\n label=\"Priority\"\n value={filters.priority}\n onChange={(v) => setFilter('priority', v)}\n options={PRIORITY_OPTIONS}\n />\n <FilterInput\n label=\"Search\"\n value={filters.search ?? ''}\n onChange={(v) => setFilter('search', v)}\n placeholder=\"ID, workflow, origin…\"\n />\n </FilterBar>\n );\n}\n"],"names":["StatusDot","row","isAckEscalation","color","jsx","Bell","Circle","isEffectivelyClaimed","ESCALATION_COLUMNS","jsxs","WorkflowPill","Link","e","ExternalLink","RolePill","PriorityBadge","TimestampCell","TIME_LEFT_COLUMN","Clock","CountdownTimer","PRIORITY_OPTIONS","STATUS_OPTIONS","EscalationFilterBar","filters","setFilter","roles","types","showStatus","actions","FilterBar","FilterSelect","v","r","t","FilterInput"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ const l=["Describe","Discover","Compile","Deploy","Test","Verify"];function a(t){return t?t.status==="completed"?"completed":t.status==="failed"?"failed":"in_progress":"pending"}function u(t){const e=t.match(/```json\s*([\s\S]*?)```/)||t.match(/\{[\s\S]*?\n\}/);if(!e)return null;try{return JSON.parse((e[1]??e[0]).trim())}catch{return null}}const i=new Set(["token","authorization","bearer_token","access_token","api_token"]);function p(t){if(!(t!=null&&t.properties))return{};const e={},s=sessionStorage.getItem("lt_token")||"";for(const[r,o]of Object.entries(t.properties)){const n=o;n.default!==void 0?e[r]=n.default:i.has(r.toLowerCase())&&n.type==="string"?e[r]=s:n.type==="string"?e[r]="":n.type==="number"||n.type==="integer"?e[r]=n.minimum??0:n.type==="boolean"?e[r]=!1:n.type==="object"?e[r]={}:n.type==="array"?e[r]=[]:e[r]=null}return e}export{l as S,p as b,u as e,a as m};
2
+ //# sourceMappingURL=helpers-DzO-OGPe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers-DzO-OGPe.js","sources":["../../src/pages/mcp/mcp-query-detail/helpers.ts"],"sourcesContent":["// ── Shared helpers for MCP Query Detail wizard panels ────────────────────────\n\nexport type Step = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport const STEP_LABELS_BASE = ['Describe', 'Discover', 'Compile', 'Deploy', 'Test', 'Verify'] as const;\n\nexport function mapStatus(exec: { status?: string } | undefined): string {\n if (!exec) return 'pending';\n if (exec.status === 'completed') return 'completed';\n if (exec.status === 'failed') return 'failed';\n return 'in_progress';\n}\n\nexport function extractJsonFromSummary(summary: string): Record<string, unknown> | null {\n const match = summary.match(/```json\\s*([\\s\\S]*?)```/) || summary.match(/\\{[\\s\\S]*?\\n\\}/);\n if (!match) return null;\n try { return JSON.parse((match[1] ?? match[0]).trim()); } catch { return null; }\n}\n\n// ── Helpers migrated from yaml-workflow-detail ───────────────────────────────\n\nexport type Section = 'invoke' | 'tools' | 'config';\n\n/** Keys that should auto-fill with the current session token when building test input skeletons. */\nconst TOKEN_FIELD_NAMES = new Set(['token', 'authorization', 'bearer_token', 'access_token', 'api_token']);\n\nexport function buildSkeleton(schema: Record<string, any>): Record<string, any> {\n if (!schema?.properties) return {};\n const result: Record<string, any> = {};\n // Auto-fill token fields with the current session token so test invocations\n // always use a fresh credential instead of requiring manual paste.\n const sessionToken = sessionStorage.getItem('lt_token') || '';\n for (const [key, prop] of Object.entries(schema.properties)) {\n const p = prop as any;\n if (p.default !== undefined) result[key] = p.default;\n else if (TOKEN_FIELD_NAMES.has(key.toLowerCase()) && p.type === 'string') result[key] = sessionToken;\n else if (p.type === 'string') result[key] = '';\n else if (p.type === 'number' || p.type === 'integer') result[key] = p.minimum ?? 0;\n else if (p.type === 'boolean') result[key] = false;\n else if (p.type === 'object') result[key] = {};\n else if (p.type === 'array') result[key] = [];\n else result[key] = null;\n }\n return result;\n}\n\nexport function inferFieldType(schemaProp: any): string {\n if (!schemaProp) return 'string';\n return schemaProp.type || 'string';\n}\n\nexport const metadataLabels: Record<string, string> = {\n app: 'MCP Workflow Server', tpc: 'MCP Workflow Tool', vrs: 'Version', ngn: 'Engine ID',\n jid: 'Job ID', gid: 'Run ID', aid: 'Activity ID', ts: 'Time Series',\n jc: 'Created', ju: 'Updated', trc: 'Trace ID', js: 'Job Status',\n};\n\nexport const jobStatusLabels: Record<number, string> = { 0: 'Completed', 1: 'Pending', 2: 'Error' };\n\nexport function parseCompactTimestamp(val: string): string {\n const match = val.match(/^(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})\\.(\\d+)$/);\n if (!match) return val;\n const [, y, mo, d, h, mi, s, ms] = match;\n return `${y}-${mo}-${d} ${h}:${mi}:${s}.${ms}`;\n}\n\nexport function formatMetadataValue(key: string, value: unknown): string {\n if (key === 'js' && typeof value === 'number') return jobStatusLabels[value] ?? `Unknown (${value})`;\n if ((key === 'jc' || key === 'ju') && typeof value === 'string') return parseCompactTimestamp(value);\n return String(value ?? '');\n}\n\nexport function sourceLabel(s: string | undefined) {\n if (s === 'llm') return 'LLM';\n if (s === 'db') return 'DB';\n return 'MCP';\n}\n\nexport function sourceColor(s: string | undefined) {\n if (s === 'llm') return 'bg-purple-500/10 text-purple-400 border-purple-500/20';\n return 'bg-accent-primary/10 text-accent border-accent-primary/20';\n}\n"],"names":["STEP_LABELS_BASE","mapStatus","exec","extractJsonFromSummary","summary","match","TOKEN_FIELD_NAMES","buildSkeleton","schema","result","sessionToken","key","prop","p"],"mappings":"AAIO,MAAMA,EAAmB,CAAC,WAAY,WAAY,UAAW,SAAU,OAAQ,QAAQ,EAEvF,SAASC,EAAUC,EAA+C,CACvE,OAAKA,EACDA,EAAK,SAAW,YAAoB,YACpCA,EAAK,SAAW,SAAiB,SAC9B,cAHW,SAIpB,CAEO,SAASC,EAAuBC,EAAiD,CACtF,MAAMC,EAAQD,EAAQ,MAAM,yBAAyB,GAAKA,EAAQ,MAAM,gBAAgB,EACxF,GAAI,CAACC,EAAO,OAAO,KACnB,GAAI,CAAE,OAAO,KAAK,OAAOA,EAAM,CAAC,GAAKA,EAAM,CAAC,GAAG,MAAM,CAAG,MAAQ,CAAE,OAAO,IAAM,CACjF,CAOA,MAAMC,MAAwB,IAAI,CAAC,QAAS,gBAAiB,eAAgB,eAAgB,WAAW,CAAC,EAElG,SAASC,EAAcC,EAAkD,CAC9E,GAAI,EAACA,GAAA,MAAAA,EAAQ,YAAY,MAAO,CAAA,EAChC,MAAMC,EAA8B,CAAA,EAG9BC,EAAe,eAAe,QAAQ,UAAU,GAAK,GAC3D,SAAW,CAACC,EAAKC,CAAI,IAAK,OAAO,QAAQJ,EAAO,UAAU,EAAG,CAC3D,MAAMK,EAAID,EACNC,EAAE,UAAY,OAAWJ,EAAOE,CAAG,EAAIE,EAAE,QACpCP,EAAkB,IAAIK,EAAI,YAAA,CAAa,GAAKE,EAAE,OAAS,SAAUJ,EAAOE,CAAG,EAAID,EAC/EG,EAAE,OAAS,SAAUJ,EAAOE,CAAG,EAAI,GACnCE,EAAE,OAAS,UAAYA,EAAE,OAAS,UAAWJ,EAAOE,CAAG,EAAIE,EAAE,SAAW,EACxEA,EAAE,OAAS,UAAWJ,EAAOE,CAAG,EAAI,GACpCE,EAAE,OAAS,SAAUJ,EAAOE,CAAG,EAAI,CAAA,EACnCE,EAAE,OAAS,QAASJ,EAAOE,CAAG,EAAI,CAAA,EACtCF,EAAOE,CAAG,EAAI,IACrB,CACA,OAAOF,CACT"}
@@ -1,6 +1,6 @@
1
- import{a as p,j as e,b as Ve}from"./vendor-query-B2UbickB.js";import{s as xe,c as U,C as ze,J as Z,j as Be,v as qe,g as He,h as Ke,w as Ye,u as Qe}from"./index-CWEOhAiK.js";import{u as Ge}from"./useCollapsedSections-BU5HULGs.js";import{a as Xe}from"./roles-mGO2-2hA.js";import{P as Ze}from"./PageHeader-BuJpMxyu.js";import{C as ce,i as et,a as tt}from"./escalation-BQhCt4W0.js";import{u as st}from"./workflows-CyEYa01a.js";import{g as at}from"./useEventHooks-BwjAi0Qq.js";import{U as de}from"./UserName-W6_Iz2Qb.js";import{u as nt,C as rt}from"./CustomDurationPicker-Dy4NBqhZ.js";import{S as be}from"./StatusBadge-XQlNFwmH.js";import{R as ye}from"./RolePill-SasQKc_B.js";import{C as E}from"./CopyableId-DaT0ZRHg.js";import{U as ve,ad as it,ab as lt,ae as Ne}from"./vendor-icons-Doy0g69_.js";import{C as ae}from"./CollapsibleSection-bW0UZN9b.js";import{L as Se,e as ot,c as ct}from"./vendor-react-CXumBFUA.js";import"./users-BvizpAkV.js";import"./constants-BHkpVaqx.js";const we="lt_view_mode";function dt(t){const[a,i]=p.useState(()=>{try{const s=localStorage.getItem(we);if(s!==null)return s==="dev"}catch{}return t}),n=p.useCallback(()=>{i(s=>{const l=!s;try{localStorage.setItem(we,l?"dev":"user")}catch{}return l})},[]);return{isDevMode:a,toggleMode:n}}function xt(t){const{mode:a,activeView:i,onActiveViewChange:n,onClaim:s,claimPending:l,workflowType:x,json:c,onResolve:r,resolvePending:o,resolveError:d,requestTriage:u,triageNotes:h,currentRole:b,escalationTargets:m,onEscalate:j,escalatePending:g,escalateError:f,onRelease:R,releasePending:S,assignedTo:I,assignedUntil:W,onSubmitAttempt:A}=t,_=nt(),[k,y]=p.useState("30"),[w,v]=p.useState(0),[$,L]=p.useState(""),[V,D]=p.useState(""),C=k==="custom",z=p.useCallback(N=>v(N),[]);if(a==="terminal")return null;const P=()=>{const N=C?w:parseInt(k);!N||N<=0||s(N)},ee=()=>{if(L(""),u){const Q={_lt:{needsTriage:!0}};h.trim()&&(Q.notes=h.trim()),r(Q);return}let N;try{N=JSON.parse(c)}catch{L("Invalid JSON");return}const Y=N._form_schema,O=Y==null?void 0:Y.required;if(O!=null&&O.length){const Q=O.filter(F=>{const M=N[F];return M==null||typeof M=="string"&&M.trim()===""});if(Q.length>0){A==null||A();const F=Q.map(te=>te.replace(/[_-]/g," ")),M=F.length<=2?F.join(", "):`${F.slice(0,2).join(", ")}...`;L(`Required: ${M}`);return}}r(N)},B=N=>`text-xs transition-colors ${N?"text-accent font-medium":"text-text-tertiary hover:text-accent"}`;return e.jsxs("div",{className:"sticky bottom-0 h-[80px] bg-surface/95 backdrop-blur-sm border-t border-surface-border -mx-10 px-10 pt-3 pb-5 z-10","data-testid":"escalation-action-bar",children:[a==="available"&&e.jsxs("div",{"data-testid":"claim-bar",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[_.map(N=>e.jsx("button",{onClick:()=>{y(N.value),v(0)},className:B(!C&&k===N.value),children:N.label},N.value)),e.jsx("button",{onClick:()=>y("custom"),className:B(C),children:"Other"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-1"}),C&&e.jsx(rt,{onChange:z,compact:!0,autoFocus:!0}),e.jsx("button",{onClick:P,disabled:l||C&&w<=0,className:"btn-primary text-xs",children:l?"Claiming...":"Claim"})]})]}),a==="claimed_by_other"&&e.jsxs("div",{className:"flex items-center gap-4","data-testid":"claimed-other-bar",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Claimed by ",e.jsx("span",{className:"font-medium text-text-primary",children:I?e.jsx(de,{userId:I}):"unknown"})]}),W&&e.jsx(ce,{until:W})]}),a==="claimed_by_me"&&e.jsxs("div",{"data-testid":"action-bar",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[e.jsx("button",{onClick:()=>n("resolve"),className:B(i==="resolve"),children:x?"Resolve":"Acknowledge"}),m.length>0&&e.jsx("button",{onClick:()=>n("escalate"),className:B(i==="escalate"),children:"Escalate"}),e.jsx("button",{onClick:()=>n("release"),className:`text-xs transition-colors ${i==="release"?"text-status-error font-medium":"text-text-tertiary hover:text-status-error"}`,children:"Release"})]}),i==="resolve"&&(x?e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1"}),$&&e.jsx("span",{className:"text-xs text-status-error",children:$}),d&&e.jsx("span",{className:"text-xs text-status-error",children:d.message}),e.jsx("button",{onClick:ee,disabled:o,className:"btn-primary text-xs",children:o?"Submitting...":u?"Send to Triage":"Submit"})]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:"Notification — acknowledge to resolve"}),e.jsx("div",{className:"flex-1"}),d&&e.jsx("span",{className:"text-xs text-status-error mr-3",children:d.message}),e.jsx("button",{onClick:()=>r({acknowledged:!0}),disabled:o,className:"btn-primary text-xs",children:o?"Acknowledging...":"Acknowledge"})]})),i==="escalate"&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-text-secondary",children:["From ",e.jsx("span",{className:"font-medium text-text-primary",children:b})," to"]}),e.jsxs("select",{value:V,onChange:N=>D(N.target.value),className:"select text-xs","data-testid":"escalate-select",children:[e.jsx("option",{value:"",children:"Select role..."}),m.map(N=>e.jsx("option",{value:N,children:N},N))]}),e.jsx("div",{className:"flex-1"}),f&&e.jsx("span",{className:"text-xs text-status-error",children:f.message}),e.jsx("button",{onClick:()=>j(V),disabled:!V||g,className:"btn-primary text-xs",children:g?"Escalating...":"Escalate"})]}),i==="release"&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:"Release back to pool?"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>n("resolve"),className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:R,disabled:S,className:"btn-primary text-xs bg-status-error hover:bg-status-error/80",children:S?"Releasing...":"Yes, Release"})]})]})]})}const ke=48;function ut({label:t,value:a}){const[i,n]=p.useState(!1),s=typeof a=="object"?JSON.stringify(a):String(a??""),l=s.length>ke;return e.jsxs("div",{className:"text-left max-w-xs",children:[e.jsx("span",{className:"text-[9px] text-text-quaternary",children:t}),l&&!i?e.jsxs("button",{onClick:()=>n(!0),className:"block text-[11px] font-mono text-text-secondary hover:text-accent transition-colors text-left",title:s,children:[s.slice(0,ke),"…"]}):l&&i?e.jsx("button",{onClick:()=>n(!1),className:"block text-[11px] font-mono text-text-secondary break-all text-left",children:s}):e.jsx("p",{className:"text-[11px] font-mono text-text-secondary",children:s})]})}function mt({esc:t,claimedByMe:a,claimed:i,isTerminal:n,traceUrl:s,isDevMode:l,showDetails:x,onToggleDetails:c}){const{isBuilder:r}=xe(),o=et(t);return l?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o&&e.jsx(lt,{className:"w-5 h-5 text-text-tertiary shrink-0"}),e.jsxs("p",{className:"text-[1.5rem] leading-snug font-light text-text-secondary",children:[t.type,t.subtype?` / ${t.subtype}`:""]})]}),t.description&&e.jsx("p",{className:"text-sm leading-relaxed text-text-tertiary mb-4",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-end gap-x-6 gap-y-3 mt-4 mb-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Status"}),e.jsx("span",{className:"mb-1 inline-block",children:e.jsx(be,{status:t.status})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Role"}),e.jsx(ye,{role:t.role,size:"md"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Created"}),e.jsx("span",{className:"inline-flex items-center mb-1 text-xs text-text-secondary",children:e.jsx(U,{date:t.created_at})})]}),t.assigned_to&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Claimed by"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-text-primary",children:[e.jsx(ve,{className:"w-3 h-3 shrink-0 text-accent/75"}),e.jsx(de,{userId:t.assigned_to})]})]}),i&&!n&&t.assigned_until&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Time left"}),e.jsx("span",{className:"inline-flex items-center h-5",children:e.jsx(ce,{until:t.assigned_until})})]}),t.resolved_at&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Resolved"}),e.jsx("span",{className:"inline-flex items-center h-5 text-xs text-text-secondary",children:e.jsx(U,{date:t.resolved_at})})]})]})]}):e.jsxs("div",{className:"-mt-6 mb-2",children:[t.description&&e.jsx("p",{className:"text-2xl font-light text-text-primary leading-relaxed mb-5",children:t.description}),e.jsxs("div",{className:"bg-surface-sunken/50 rounded-md px-5 py-4 flex flex-wrap gap-x-8 gap-y-4 items-end",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Status"}),e.jsx(be,{status:t.status})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Assigned to Role"}),e.jsx(ye,{role:t.role,size:"md"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Created"}),e.jsx("span",{className:"text-xs text-text-secondary",children:e.jsx(U,{date:t.created_at})})]}),i&&t.assigned_to&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Claimed By"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-text-primary",children:[e.jsx(ve,{className:"w-3 h-3 text-accent/75"}),e.jsx(de,{userId:t.assigned_to})]})]}),i&&t.claimed_at&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Claimed"}),e.jsx("span",{className:"text-xs text-text-secondary",children:e.jsx(U,{date:t.claimed_at})})]}),i&&!n&&t.assigned_until&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Time Remaining"}),e.jsx("span",{className:"text-xs",children:e.jsx(ce,{until:t.assigned_until})})]}),t.resolved_at&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Completed"}),e.jsx("span",{className:"text-xs text-status-success",children:e.jsx(U,{date:t.resolved_at})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Priority"}),e.jsxs("span",{className:"text-xs text-text-secondary",children:["P",t.priority]})]}),r&&e.jsx("div",{children:e.jsx("button",{onClick:c,className:"text-text-tertiary/50 hover:text-accent transition-colors",title:x?"Hide details":"Show details",children:e.jsx(it,{className:`w-3.5 h-3.5 transition-opacity duration-200 ${x?"opacity-100 text-accent":"opacity-60"}`})})})]}),r&&e.jsxs(ze,{open:x,children:[e.jsxs("div",{className:"mt-px bg-surface-sunken/30 rounded-b-md px-5 py-4 flex flex-wrap gap-x-8 gap-y-4 border-t border-surface-border/30",children:[e.jsx(E,{label:"Escalation ID",value:t.id}),t.task_id&&e.jsx(E,{label:"Task ID",value:t.task_id,href:r?`/workflows/tasks/detail/${t.task_id}`:void 0}),e.jsx(E,{label:"Workflow Name",value:t.workflow_type,href:r&&t.workflow_type?`/workflows/executions?entity=${encodeURIComponent(t.workflow_type)}`:void 0}),e.jsx(E,{label:"Workflow ID",value:t.workflow_id,href:r&&t.workflow_id?`/workflows/executions/${t.workflow_id}`:void 0}),e.jsx(E,{label:"Task Queue",value:t.task_queue,href:r&&t.task_queue?`/admin/controlplane?queue=${encodeURIComponent(t.task_queue)}`:void 0}),t.origin_id&&t.origin_id!==t.workflow_id&&e.jsx(E,{label:"Origin",value:t.origin_id,href:`/processes/detail/${t.origin_id}`}),t.trace_id&&e.jsx(E,{label:"Trace",value:t.trace_id,href:s?s.replace("{traceId}",t.trace_id):void 0,external:!0})]}),t.metadata&&Object.keys(t.metadata).length>0&&e.jsxs("div",{className:"px-5 py-3 border-t border-surface-border/20",children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Metadata"}),e.jsx("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:Object.entries(t.metadata).filter(([d])=>!d.startsWith("_")).map(([d,u])=>e.jsx(ut,{label:d,value:u},d))})]})]})]})}function H(t){return t.replace(/`([^`]+)`/g,'<code class="px-1 py-0.5 bg-surface-sunken rounded text-xs font-mono">$1</code>').replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="text-accent-primary hover:underline" target="_blank" rel="noopener noreferrer">$1</a>')}function ie({content:t,compact:a}){const i=[],n=/^```(\w*)\n([\s\S]*?)^```$/gm;let s=0,l;for(;(l=n.exec(t))!==null;)l.index>s&&i.push({type:"text",text:t.slice(s,l.index)}),i.push({type:"code",lang:l[1],code:l[2].replace(/\n$/,"")}),s=l.index+l[0].length;s<t.length&&i.push({type:"text",text:t.slice(s)});const x=a?{text:"text-xs",heading:"text-xs",list:"text-xs",code:"text-[11px]"}:{text:"text-sm",heading:"text-sm",list:"text-sm",code:"text-xs"},c=[];for(const r of i){if(r.type==="code"){const o=r.code.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");c.push(`<pre class="my-2 p-2.5 bg-surface-sunken rounded-md overflow-x-auto"><code class="${x.code} font-mono text-text-secondary leading-relaxed">${o}</code></pre>`);continue}c.push(...pt(r.text,x))}return e.jsx("div",{className:"prose-sm",dangerouslySetInnerHTML:{__html:c.join(`
1
+ import{a as p,j as e,b as Ve}from"./vendor-query-B2UbickB.js";import{s as xe,c as U,C as ze,J as Z,j as Be,v as qe,g as He,h as Ke,w as Ye,u as Qe}from"./index-B7lEd0cY.js";import{u as Ge}from"./useCollapsedSections-BU5HULGs.js";import{a as Xe}from"./roles-BrsBN4hO.js";import{P as Ze}from"./PageHeader-Bnt2iQQa.js";import{C as ce,i as et,a as tt}from"./escalation-CP2XbdXK.js";import{u as st}from"./workflows-BLKji1_1.js";import{g as at}from"./useEventHooks-Cd1GM1NG.js";import{U as de}from"./UserName-O2Q4-E6E.js";import{u as nt,C as rt}from"./CustomDurationPicker-C2OH9YcV.js";import{S as be}from"./StatusBadge-XQlNFwmH.js";import{R as ye}from"./RolePill-DQTT1s9v.js";import{C as E}from"./CopyableId-DaT0ZRHg.js";import{U as ve,aa as it,a8 as lt,ab as Ne}from"./vendor-icons-Dj2F0Jrb.js";import{C as ae}from"./CollapsibleSection-BeBsI1M4.js";import{L as Se,e as ot,c as ct}from"./vendor-react-CXumBFUA.js";import"./users-ChQ7soaq.js";import"./constants-BHkpVaqx.js";const we="lt_view_mode";function dt(t){const[a,i]=p.useState(()=>{try{const s=localStorage.getItem(we);if(s!==null)return s==="dev"}catch{}return t}),n=p.useCallback(()=>{i(s=>{const l=!s;try{localStorage.setItem(we,l?"dev":"user")}catch{}return l})},[]);return{isDevMode:a,toggleMode:n}}function xt(t){const{mode:a,activeView:i,onActiveViewChange:n,onClaim:s,claimPending:l,workflowType:x,json:c,onResolve:r,resolvePending:o,resolveError:d,requestTriage:u,triageNotes:h,currentRole:b,escalationTargets:m,onEscalate:j,escalatePending:g,escalateError:f,onRelease:R,releasePending:S,assignedTo:I,assignedUntil:W,onSubmitAttempt:A}=t,_=nt(),[k,y]=p.useState("30"),[w,v]=p.useState(0),[$,L]=p.useState(""),[V,D]=p.useState(""),C=k==="custom",z=p.useCallback(N=>v(N),[]);if(a==="terminal")return null;const P=()=>{const N=C?w:parseInt(k);!N||N<=0||s(N)},ee=()=>{if(L(""),u){const Q={_lt:{needsTriage:!0}};h.trim()&&(Q.notes=h.trim()),r(Q);return}let N;try{N=JSON.parse(c)}catch{L("Invalid JSON");return}const Y=N._form_schema,O=Y==null?void 0:Y.required;if(O!=null&&O.length){const Q=O.filter(F=>{const M=N[F];return M==null||typeof M=="string"&&M.trim()===""});if(Q.length>0){A==null||A();const F=Q.map(te=>te.replace(/[_-]/g," ")),M=F.length<=2?F.join(", "):`${F.slice(0,2).join(", ")}...`;L(`Required: ${M}`);return}}r(N)},B=N=>`text-xs transition-colors ${N?"text-accent font-medium":"text-text-tertiary hover:text-accent"}`;return e.jsxs("div",{className:"sticky bottom-0 h-[80px] bg-surface/95 backdrop-blur-sm border-t border-surface-border -mx-10 px-10 pt-3 pb-5 z-10","data-testid":"escalation-action-bar",children:[a==="available"&&e.jsxs("div",{"data-testid":"claim-bar",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[_.map(N=>e.jsx("button",{onClick:()=>{y(N.value),v(0)},className:B(!C&&k===N.value),children:N.label},N.value)),e.jsx("button",{onClick:()=>y("custom"),className:B(C),children:"Other"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-1"}),C&&e.jsx(rt,{onChange:z,compact:!0,autoFocus:!0}),e.jsx("button",{onClick:P,disabled:l||C&&w<=0,className:"btn-primary text-xs",children:l?"Claiming...":"Claim"})]})]}),a==="claimed_by_other"&&e.jsxs("div",{className:"flex items-center gap-4","data-testid":"claimed-other-bar",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Claimed by ",e.jsx("span",{className:"font-medium text-text-primary",children:I?e.jsx(de,{userId:I}):"unknown"})]}),W&&e.jsx(ce,{until:W})]}),a==="claimed_by_me"&&e.jsxs("div",{"data-testid":"action-bar",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[e.jsx("button",{onClick:()=>n("resolve"),className:B(i==="resolve"),children:x?"Resolve":"Acknowledge"}),m.length>0&&e.jsx("button",{onClick:()=>n("escalate"),className:B(i==="escalate"),children:"Escalate"}),e.jsx("button",{onClick:()=>n("release"),className:`text-xs transition-colors ${i==="release"?"text-status-error font-medium":"text-text-tertiary hover:text-status-error"}`,children:"Release"})]}),i==="resolve"&&(x?e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1"}),$&&e.jsx("span",{className:"text-xs text-status-error",children:$}),d&&e.jsx("span",{className:"text-xs text-status-error",children:d.message}),e.jsx("button",{onClick:ee,disabled:o,className:"btn-primary text-xs",children:o?"Submitting...":u?"Send to Triage":"Submit"})]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:"Notification — acknowledge to resolve"}),e.jsx("div",{className:"flex-1"}),d&&e.jsx("span",{className:"text-xs text-status-error mr-3",children:d.message}),e.jsx("button",{onClick:()=>r({acknowledged:!0}),disabled:o,className:"btn-primary text-xs",children:o?"Acknowledging...":"Acknowledge"})]})),i==="escalate"&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-text-secondary",children:["From ",e.jsx("span",{className:"font-medium text-text-primary",children:b})," to"]}),e.jsxs("select",{value:V,onChange:N=>D(N.target.value),className:"select text-xs","data-testid":"escalate-select",children:[e.jsx("option",{value:"",children:"Select role..."}),m.map(N=>e.jsx("option",{value:N,children:N},N))]}),e.jsx("div",{className:"flex-1"}),f&&e.jsx("span",{className:"text-xs text-status-error",children:f.message}),e.jsx("button",{onClick:()=>j(V),disabled:!V||g,className:"btn-primary text-xs",children:g?"Escalating...":"Escalate"})]}),i==="release"&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:"Release back to pool?"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>n("resolve"),className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:R,disabled:S,className:"btn-primary text-xs bg-status-error hover:bg-status-error/80",children:S?"Releasing...":"Yes, Release"})]})]})]})}const ke=48;function ut({label:t,value:a}){const[i,n]=p.useState(!1),s=typeof a=="object"?JSON.stringify(a):String(a??""),l=s.length>ke;return e.jsxs("div",{className:"text-left max-w-xs",children:[e.jsx("span",{className:"text-[9px] text-text-quaternary",children:t}),l&&!i?e.jsxs("button",{onClick:()=>n(!0),className:"block text-[11px] font-mono text-text-secondary hover:text-accent transition-colors text-left",title:s,children:[s.slice(0,ke),"…"]}):l&&i?e.jsx("button",{onClick:()=>n(!1),className:"block text-[11px] font-mono text-text-secondary break-all text-left",children:s}):e.jsx("p",{className:"text-[11px] font-mono text-text-secondary",children:s})]})}function mt({esc:t,claimedByMe:a,claimed:i,isTerminal:n,traceUrl:s,isDevMode:l,showDetails:x,onToggleDetails:c}){const{isBuilder:r}=xe(),o=et(t);return l?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o&&e.jsx(lt,{className:"w-5 h-5 text-text-tertiary shrink-0"}),e.jsxs("p",{className:"text-[1.5rem] leading-snug font-light text-text-secondary",children:[t.type,t.subtype?` / ${t.subtype}`:""]})]}),t.description&&e.jsx("p",{className:"text-sm leading-relaxed text-text-tertiary mb-4",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-end gap-x-6 gap-y-3 mt-4 mb-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Status"}),e.jsx("span",{className:"mb-1 inline-block",children:e.jsx(be,{status:t.status})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Role"}),e.jsx(ye,{role:t.role,size:"md"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Created"}),e.jsx("span",{className:"inline-flex items-center mb-1 text-xs text-text-secondary",children:e.jsx(U,{date:t.created_at})})]}),t.assigned_to&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Claimed by"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-text-primary",children:[e.jsx(ve,{className:"w-3 h-3 shrink-0 text-accent/75"}),e.jsx(de,{userId:t.assigned_to})]})]}),i&&!n&&t.assigned_until&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Time left"}),e.jsx("span",{className:"inline-flex items-center h-5",children:e.jsx(ce,{until:t.assigned_until})})]}),t.resolved_at&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Resolved"}),e.jsx("span",{className:"inline-flex items-center h-5 text-xs text-text-secondary",children:e.jsx(U,{date:t.resolved_at})})]})]})]}):e.jsxs("div",{className:"-mt-6 mb-2",children:[t.description&&e.jsx("p",{className:"text-2xl font-light text-text-primary leading-relaxed mb-5",children:t.description}),e.jsxs("div",{className:"bg-surface-sunken/50 rounded-md px-5 py-4 flex flex-wrap gap-x-8 gap-y-4 items-end",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Status"}),e.jsx(be,{status:t.status})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Assigned to Role"}),e.jsx(ye,{role:t.role,size:"md"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Created"}),e.jsx("span",{className:"text-xs text-text-secondary",children:e.jsx(U,{date:t.created_at})})]}),i&&t.assigned_to&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Claimed By"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-text-primary",children:[e.jsx(ve,{className:"w-3 h-3 text-accent/75"}),e.jsx(de,{userId:t.assigned_to})]})]}),i&&t.claimed_at&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Claimed"}),e.jsx("span",{className:"text-xs text-text-secondary",children:e.jsx(U,{date:t.claimed_at})})]}),i&&!n&&t.assigned_until&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Time Remaining"}),e.jsx("span",{className:"text-xs",children:e.jsx(ce,{until:t.assigned_until})})]}),t.resolved_at&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Completed"}),e.jsx("span",{className:"text-xs text-status-success",children:e.jsx(U,{date:t.resolved_at})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Priority"}),e.jsxs("span",{className:"text-xs text-text-secondary",children:["P",t.priority]})]}),r&&e.jsx("div",{children:e.jsx("button",{onClick:c,className:"text-text-tertiary/50 hover:text-accent transition-colors",title:x?"Hide details":"Show details",children:e.jsx(it,{className:`w-3.5 h-3.5 transition-opacity duration-200 ${x?"opacity-100 text-accent":"opacity-60"}`})})})]}),r&&e.jsxs(ze,{open:x,children:[e.jsxs("div",{className:"mt-px bg-surface-sunken/30 rounded-b-md px-5 py-4 flex flex-wrap gap-x-8 gap-y-4 border-t border-surface-border/30",children:[e.jsx(E,{label:"Escalation ID",value:t.id}),t.task_id&&e.jsx(E,{label:"Task ID",value:t.task_id,href:r?`/workflows/tasks/detail/${t.task_id}`:void 0}),e.jsx(E,{label:"Workflow Name",value:t.workflow_type,href:r&&t.workflow_type?`/workflows/executions?entity=${encodeURIComponent(t.workflow_type)}`:void 0}),e.jsx(E,{label:"Workflow ID",value:t.workflow_id,href:r&&t.workflow_id?`/workflows/executions/${t.workflow_id}`:void 0}),e.jsx(E,{label:"Task Queue",value:t.task_queue,href:r&&t.task_queue?`/admin/controlplane?queue=${encodeURIComponent(t.task_queue)}`:void 0}),t.origin_id&&t.origin_id!==t.workflow_id&&e.jsx(E,{label:"Origin",value:t.origin_id,href:`/processes/detail/${t.origin_id}`}),t.trace_id&&e.jsx(E,{label:"Trace",value:t.trace_id,href:s?s.replace("{traceId}",t.trace_id):void 0,external:!0})]}),t.metadata&&Object.keys(t.metadata).length>0&&e.jsxs("div",{className:"px-5 py-3 border-t border-surface-border/20",children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Metadata"}),e.jsx("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:Object.entries(t.metadata).filter(([d])=>!d.startsWith("_")).map(([d,u])=>e.jsx(ut,{label:d,value:u},d))})]})]})]})}function H(t){return t.replace(/`([^`]+)`/g,'<code class="px-1 py-0.5 bg-surface-sunken rounded text-xs font-mono">$1</code>').replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="text-accent-primary hover:underline" target="_blank" rel="noopener noreferrer">$1</a>')}function ie({content:t,compact:a}){const i=[],n=/^```(\w*)\n([\s\S]*?)^```$/gm;let s=0,l;for(;(l=n.exec(t))!==null;)l.index>s&&i.push({type:"text",text:t.slice(s,l.index)}),i.push({type:"code",lang:l[1],code:l[2].replace(/\n$/,"")}),s=l.index+l[0].length;s<t.length&&i.push({type:"text",text:t.slice(s)});const x=a?{text:"text-xs",heading:"text-xs",list:"text-xs",code:"text-[11px]"}:{text:"text-sm",heading:"text-sm",list:"text-sm",code:"text-xs"},c=[];for(const r of i){if(r.type==="code"){const o=r.code.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");c.push(`<pre class="my-2 p-2.5 bg-surface-sunken rounded-md overflow-x-auto"><code class="${x.code} font-mono text-text-secondary leading-relaxed">${o}</code></pre>`);continue}c.push(...pt(r.text,x))}return e.jsx("div",{className:"prose-sm",dangerouslySetInnerHTML:{__html:c.join(`
2
2
  `)}})}function pt(t,a){const i=t.split(`
3
3
  `),n=[];let s=!1,l=!1,x=[];for(const c of i){const r=c.trim();if(r.startsWith("|")&&r.endsWith("|")){const o=r.slice(1,-1).split("|").map(d=>d.trim());if(o.every(d=>/^[-:]+$/.test(d)))continue;l||(l=!0,x=[]),x.push(o);continue}if(l){l=!1;const[o,...d]=x;n.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const u of o)n.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${H(u)}</th>`);n.push("</tr></thead><tbody>");for(const u of d){n.push("<tr>");for(const h of u)n.push(`<td class="py-1 px-2 border-b border-border/50">${H(h)}</td>`);n.push("</tr>")}n.push("</tbody></table></div>"),x=[]}if(!r){s&&(n.push("</ul>"),s=!1);continue}if(r.startsWith("### ")){s&&(n.push("</ul>"),s=!1),n.push(`<h4 class="${a.heading} font-semibold text-text-primary mt-3 mb-1">${H(r.slice(4))}</h4>`);continue}if(r.startsWith("## ")){s&&(n.push("</ul>"),s=!1),n.push(`<h3 class="${a.heading} font-semibold text-text-primary mt-3 mb-1">${H(r.slice(3))}</h3>`);continue}if(/^[-*_]{3,}$/.test(r)){s&&(n.push("</ul>"),s=!1),n.push('<hr class="border-border my-3" />');continue}if(/^[-*] /.test(r)){s||(n.push('<ul class="space-y-1 my-1">'),s=!0),n.push(`<li class="${a.list} text-text-secondary flex gap-2"><span class="text-text-tertiary shrink-0">-</span><span>${H(r.slice(2))}</span></li>`);continue}s&&(n.push("</ul>"),s=!1),n.push(`<p class="${a.text} text-text-secondary my-1">${H(r)}</p>`)}if(l&&x.length){const[c,...r]=x;n.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const o of c)n.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${H(o)}</th>`);n.push("</tr></thead><tbody>");for(const o of r){n.push("<tr>");for(const d of o)n.push(`<td class="py-1 px-2 border-b border-border/50">${H(d)}</td>`);n.push("</tr>")}n.push("</tbody></table></div>")}return s&&n.push("</ul>"),n}function le({children:t}){return e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:t})}function ht({payload:t,isTerminal:a,resolverPayload:i,onRetryTriage:n,isRetrying:s}){const l=t.title,x=t.summary,c=t.diagnosis,r=t.tool_calls_made,o=t.result,d=i==null?void 0:i._lt,u=(d==null?void 0:d.triaged)===!0,h=d==null?void 0:d.triageWorkflowId,b=a&&u,[m,j]=p.useState(!1);return b?e.jsxs("div",{className:"rounded-md border border-status-success/30 bg-surface-raised",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-status-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 1a7 7 0 110 14A7 7 0 018 1zm3.36 4.65a.5.5 0 00-.72 0L7 9.29 5.36 7.65a.5.5 0 10-.72.7l2 2a.5.5 0 00.72 0l4-4a.5.5 0 000-.7z"})}),e.jsx("span",{className:"text-xs font-medium text-status-success",children:"Resolved by AI Triage"})]}),typeof r=="number"&&e.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-status-success/10 text-status-success",children:[r," tool calls used"]})]}),e.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l&&e.jsx("p",{className:"text-sm font-medium text-text-primary",children:l}),c&&e.jsxs("div",{children:[e.jsx(le,{children:"Triage diagnosis"}),e.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:e.jsx(ie,{content:c})})]}),e.jsx("div",{className:"flex items-center gap-3",children:h&&e.jsx(Se,{to:`/workflows/executions/${h}`,className:"text-[10px] text-accent hover:underline",children:"View triage execution"})})]})]}):e.jsxs("div",{className:"rounded-md border border-status-warning/30 bg-surface-raised",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-status-warning shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 1a7 7 0 110 14A7 7 0 018 1zm0 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 4zm0 7a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),e.jsx("span",{className:"text-xs font-medium text-status-warning",children:"Tool Rounds Exhausted"})]}),typeof r=="number"&&e.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-status-warning/10 text-status-warning",children:[r," tool calls used"]})]}),e.jsxs("div",{className:"px-4 py-4 space-y-4",children:[l&&e.jsx("p",{className:"text-sm font-medium text-text-primary",children:l}),x&&e.jsxs("div",{children:[e.jsx(le,{children:"What happened"}),e.jsx("div",{className:"text-xs text-text-secondary leading-relaxed",children:e.jsx(ie,{content:x})})]}),c&&e.jsxs("div",{children:[e.jsx(le,{children:"What went wrong"}),e.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:e.jsx(ie,{content:c})})]}),o!=null&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>j(!m),className:"flex items-center gap-1 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary hover:text-text-secondary transition-colors",children:[e.jsx("svg",{className:`w-3 h-3 transition-transform ${m?"rotate-90":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:e.jsx("path",{d:"M4.5 2l4 4-4 4"})}),"Partial results"]}),m&&e.jsx("div",{className:"mt-2",children:e.jsx(Z,{data:o,defaultMode:"tree"})})]}),n&&!a&&e.jsx("div",{className:"pt-2",children:e.jsxs("button",{onClick:n,disabled:s,className:"inline-flex items-center gap-2 px-4 py-2 text-xs font-medium bg-accent text-text-inverse rounded-md hover:bg-accent/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"currentColor",children:e.jsx("path",{d:"M7 1a6 6 0 100 12A6 6 0 007 1zm2.5 6.5l-3.5 2V5.5l3.5 2z"})}),s?"Sending to triage...":"Retry with AI Triage"]})})]})]})}function ft({triage:t,payload:a}){const i=t.confidence??0,n=i>=.8?"text-status-success":i>=.5?"text-status-pending":"text-status-error",s=jt(t.originalData,a);return e.jsxs("div",{className:"space-y-5",children:[t.diagnosis&&e.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:t.diagnosis}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-tertiary",children:[t.tool_calls_made!=null&&e.jsxs("span",{children:[t.tool_calls_made," tool call",t.tool_calls_made!==1?"s":""]}),t.tool_calls_made!=null&&e.jsx("span",{className:"text-text-quaternary",children:"·"}),e.jsxs("span",{className:`font-medium ${n}`,children:[Math.round(i*100),"% confidence"]})]}),t.actions_taken&&t.actions_taken.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.actions_taken.map((l,x)=>e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px]
4
4
  text-text-secondary`,children:[e.jsx("svg",{className:"w-3 h-3 text-status-success shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),l]},x))}),t.recommendation&&e.jsx("p",{className:"text-[11px] text-text-tertiary italic",children:t.recommendation}),s.length>0&&e.jsx("div",{className:"space-y-4 pt-2",children:s.map(l=>e.jsx(gt,{diff:l},l.key))})]})}function jt(t,a){if(!t)return[];const i=[];for(const n of Object.keys(t)){if(n.startsWith("_"))continue;const s=t[n],l=a[n];l!==void 0&&JSON.stringify(s)!==JSON.stringify(l)&&i.push({key:n,label:n.replace(/[_-]/g," "),original:s,corrected:l})}return i}function gt({diff:t}){const a=_e(t.original),i=_e(t.corrected);return a!==null&&i!==null?e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal",children:"(original)"})]}),e.jsx("p",{className:"text-sm text-text-tertiary leading-relaxed line-through decoration-text-tertiary/30",children:a})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal text-status-success",children:"(corrected)"})]}),e.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:i})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal",children:"(original)"})]}),e.jsx("pre",{className:"text-xs text-text-tertiary font-mono whitespace-pre-wrap leading-relaxed",children:typeof t.original=="object"?JSON.stringify(t.original,null,2):String(t.original)})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal text-status-success",children:"(corrected)"})]}),e.jsx("pre",{className:"text-xs text-text-primary font-mono whitespace-pre-wrap leading-relaxed",children:typeof t.corrected=="object"?JSON.stringify(t.corrected,null,2):String(t.corrected)})]})]})}function _e(t){return t==null?"null":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):null}function Ce({src:t,escalation:a,schema:i,onResolve:n,onEscalate:s,submitAttempted:l}){const x=p.useRef(null),c=p.useRef("");p.useEffect(()=>{try{const o=new URL(t);c.current=o.origin}catch{c.current=""}},[t]);const r=p.useCallback(()=>{const o=x.current;if(!(o!=null&&o.contentWindow)||!c.current)return;const u={type:"lt:init",escalation:{id:a.id,type:a.type,subtype:a.subtype,description:a.description,status:a.status,priority:a.priority,role:a.role,workflow_type:a.workflow_type},schema:i};o.contentWindow.postMessage(u,c.current)},[a,i]);return p.useEffect(()=>{const o=d=>{if(d.origin!==c.current)return;const u=d.data;if(!(!u||typeof u!="object"||typeof u.type!="string"))switch(u.type){case"lt:ready":r();break;case"lt:submit":u.payload&&typeof u.payload=="object"&&n(u.payload);break;case"lt:escalate":typeof u.target=="string"&&u.target&&s(u.target);break;case"lt:resize":{const h=x.current;h&&typeof u.height=="number"&&u.height>0&&(h.style.height=`${Math.min(u.height,2e3)}px`);break}}};return window.addEventListener("message",o),()=>window.removeEventListener("message",o)},[r,n,s]),p.useEffect(()=>{if(!l)return;const o=x.current;o!=null&&o.contentWindow&&c.current&&o.contentWindow.postMessage({type:"lt:validate"},c.current)},[l]),e.jsx("div",{className:"rounded-md border border-surface-border overflow-hidden bg-white",children:e.jsx("iframe",{ref:x,src:t,sandbox:"allow-scripts allow-same-origin allow-forms",className:"w-full border-0",style:{minHeight:"400px"},title:"HITL Viewport",onLoad:r})})}function bt({fieldKey:t,value:a,onChange:i,schema:n}){const s=p.useRef(null),l=(n==null?void 0:n.accept)??void 0,x=t.replace(/[_-]/g," "),c=n==null?void 0:n.description,r=p.useCallback(d=>{var b;const u=(b=d.target.files)==null?void 0:b[0];if(!u)return;const h=new FileReader;h.onload=()=>{typeof h.result=="string"&&i(h.result)},h.readAsDataURL(u)},[i]),o=a.startsWith("data:");return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:x}),c&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:c}),e.jsxs("div",{className:"mt-1",children:[e.jsx("input",{ref:s,type:"file",accept:l,onChange:r,className:"hidden"}),e.jsx("button",{type:"button",onClick:()=>{var d;return(d=s.current)==null?void 0:d.click()},className:"btn-secondary text-xs px-3 py-1.5",children:o?"Replace file":"Choose file"}),o&&e.jsx("span",{className:"ml-2 text-xs text-status-success",children:"File attached"})]})]})}function yt({fieldKey:t,value:a,onChange:i,schema:n}){const s=t.replace(/[_-]/g," "),l=n==null?void 0:n.description,x=(n==null?void 0:n["x-lt-language"])??"",c=p.useCallback(r=>{if(r.key==="Tab"){r.preventDefault();const o=r.currentTarget,d=o.selectionStart,u=o.selectionEnd,h=a.substring(0,d)+" "+a.substring(u);i(h),requestAnimationFrame(()=>{o.selectionStart=o.selectionEnd=d+2})}},[a,i]);return e.jsxs("div",{children:[e.jsxs("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:[s,x&&e.jsx("span",{className:"ml-2 text-text-tertiary/60 normal-case font-normal",children:x})]}),l&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:l}),e.jsx("textarea",{value:a,onChange:r=>i(r.target.value),onKeyDown:c,className:"input w-full mt-1 font-mono text-xs leading-relaxed",rows:10,spellCheck:!1})]})}function vt({fieldKey:t,value:a,onChange:i,schema:n}){const s=p.useRef(null),[l,x]=p.useState(!1),c=t.replace(/[_-]/g," "),r=n==null?void 0:n.description;p.useEffect(()=>{const m=s.current;if(!m)return;const j=m.getContext("2d");if(j&&(j.lineWidth=2,j.lineCap="round",j.strokeStyle="#1E1535",a&&a.startsWith("data:"))){const g=new Image;g.onload=()=>j.drawImage(g,0,0),g.src=a}},[]);const o=p.useCallback(m=>{const g=s.current.getBoundingClientRect();return"touches"in m?{x:m.touches[0].clientX-g.left,y:m.touches[0].clientY-g.top}:{x:m.clientX-g.left,y:m.clientY-g.top}},[]),d=p.useCallback(m=>{var f;x(!0);const j=(f=s.current)==null?void 0:f.getContext("2d");if(!j)return;const g=o(m);j.beginPath(),j.moveTo(g.x,g.y)},[o]),u=p.useCallback(m=>{var f;if(!l)return;const j=(f=s.current)==null?void 0:f.getContext("2d");if(!j)return;const g=o(m);j.lineTo(g.x,g.y),j.stroke()},[l,o]),h=p.useCallback(()=>{x(!1);const m=s.current;m&&i(m.toDataURL("image/png"))},[i]),b=p.useCallback(()=>{const m=s.current;if(!m)return;const j=m.getContext("2d");j&&(j.clearRect(0,0,m.width,m.height),i(""))},[i]);return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:c}),r&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:r}),e.jsx("div",{className:"mt-1 border border-surface-border rounded-md overflow-hidden bg-white",children:e.jsx("canvas",{ref:s,width:400,height:150,className:"w-full cursor-crosshair touch-none",onMouseDown:d,onMouseMove:u,onMouseUp:h,onMouseLeave:h,onTouchStart:d,onTouchMove:u,onTouchEnd:h})}),e.jsx("button",{type:"button",onClick:b,className:"mt-1 text-[10px] text-text-tertiary hover:text-accent transition-colors",children:"Clear"})]})}function Nt({fieldKey:t,value:a,onChange:i,schema:n}){const s=t.replace(/[_-]/g," "),l=n==null?void 0:n.description;return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:s}),l&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:l}),e.jsx("textarea",{value:a,onChange:x=>i(x.target.value),className:"input w-full mt-1 text-sm leading-relaxed",rows:8,placeholder:"Supports plain text. Markdown formatting is preserved."})]})}const Te={"file-upload":bt,"code-editor":yt,signature:vt,"rich-text":Nt};function Re({value:t,onChange:a,disabled:i,submitAttempted:n}){const[s,l]=p.useState({}),[x,c]=p.useState({}),[r,o]=p.useState(null),[d,u]=p.useState(!1),[h,b]=p.useState(new Set);p.useEffect(()=>{try{const y=JSON.parse(t);if(typeof y=="object"&&y!==null&&!Array.isArray(y)){const w={},v={};for(const[$,L]of Object.entries(y))$.startsWith("_")?v[$]=L:w[$]=L;l(w),c(v),o(v._form_schema&&typeof v._form_schema=="object"?v._form_schema:null),u(!1)}}catch{u(!0)}},[t]);const m=p.useCallback(y=>{l(y),a(JSON.stringify({...y,...x},null,2))},[x,a]),j=p.useCallback((y,w)=>{m({...s,[y]:w})},[s,m]),g=p.useCallback(y=>{b(w=>{if(w.has(y))return w;const v=new Set(w);return v.add(y),v})},[]);if(d)return e.jsx("p",{className:"text-xs text-status-error",children:"Unable to parse resolver data as form. Use the JSON editor below."});const f=Object.entries(s);if(f.length===0)return e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No resolver fields defined."});const R=r==null?void 0:r["x-lt-order"],S=R?[...f].sort((y,w)=>{const v=R.indexOf(y[0]),$=R.indexOf(w[0]);return(v===-1?1/0:v)-($===-1?1/0:$)}):f,I=new Set((r==null?void 0:r.required)??[]),W=r==null?void 0:r["x-lt-layout"],A=r==null?void 0:r.title,_=r==null?void 0:r.description,k=S.map(([y,w])=>{var z;const v=(z=r==null?void 0:r.properties)==null?void 0:z[y],$=(v==null?void 0:v.readOnly)===!0,L=(v==null?void 0:v["x-lt-span"])??1,V=I.has(y),D=h.has(y)||!!n;let C;if(V&&D&&(w==null||typeof w=="string"&&w.trim()==="")&&(C="Required"),D&&typeof w=="string"&&w.trim()!==""&&v){const P=v.format;P==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(w)&&(C="Enter a valid email address"),P==="uri"&&!/^https?:\/\/.+/.test(w)&&(C="Enter a valid URL")}return e.jsx("div",{className:W==="two-column"&&L>=2?"col-span-2":"",children:e.jsx(Ie,{fieldKey:y,value:w,onChange:P=>j(y,P),onBlur:()=>g(y),schema:r,isRequired:V,isReadOnly:$,error:C})},y)});return e.jsxs("div",{className:`pb-8 ${i?"opacity-60 pointer-events-none":""}`,children:[A&&e.jsx("h3",{className:"text-lg font-light text-text-primary mb-1",children:A}),_&&e.jsx("p",{className:"text-sm text-text-secondary leading-relaxed mb-6",children:_}),W==="two-column"?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-14 gap-y-6",children:k}):e.jsx("div",{className:"space-y-6",children:k})]})}function Ie({fieldKey:t,value:a,onChange:i,onBlur:n,schema:s,isRequired:l,isReadOnly:x,error:c}){var u;const r=t.replace(/[_-]/g," "),o=(u=s==null?void 0:s.properties)==null?void 0:u[t];if(x){const h=a===null?"null":typeof a=="object"?JSON.stringify(a,null,2):String(a);return e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),e.jsx("p",{className:"text-sm text-text-secondary mt-0.5 whitespace-pre-wrap",children:h})]})}const d=o==null?void 0:o["x-lt-widget"];if(d&&d in Te&&typeof a=="string"){const h=Te[d];return e.jsx(h,{fieldKey:t,value:a,onChange:b=>i(b),schema:o})}if(typeof a=="boolean")return e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:a,onChange:h=>{i(h.target.checked),n==null||n()},className:"w-3.5 h-3.5 rounded accent-accent"}),e.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[r,l&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})]}),e.jsx(G,{error:c})]});if(typeof a=="number")return e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),e.jsx("input",{type:"number",value:a,onChange:h=>i(parseFloat(h.target.value)||0),onBlur:n,step:"any",className:X(!!c)}),e.jsx(G,{error:c})]});if(typeof a=="string"){const h=(o==null?void 0:o.format)==="password",b=o==null?void 0:o.enum,m=o==null?void 0:o.description;if(b!=null&&b.length)return e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("select",{value:a,onChange:f=>i(f.target.value),onBlur:n,className:X(!!c),children:b.map(f=>e.jsx("option",{value:f,children:f},f))}),e.jsx(G,{error:c})]});if(h)return e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("input",{type:"password",value:a,onChange:f=>i(f.target.value),onBlur:n,className:X(!!c),autoComplete:"off"}),e.jsx(G,{error:c})]});const j=o==null?void 0:o.format,g={date:"date","date-time":"datetime-local",email:"email",uri:"url"};return j&&j in g?e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("input",{type:g[j],value:a,onChange:f=>i(f.target.value),onBlur:n,className:X(!!c)}),e.jsx(G,{error:c})]}):j==="textarea"||a.length>80?e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("textarea",{value:a,onChange:f=>i(f.target.value),onBlur:n,className:`${X(!!c)} leading-relaxed`,rows:Math.min(6,Math.max(3,Math.ceil(a.length/60)))}),e.jsx(G,{error:c})]}):e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),m&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:m}),e.jsx("input",{type:"text",value:a,onChange:f=>i(f.target.value),onBlur:n,className:X(!!c)}),e.jsx(G,{error:c})]})}if(a===null)return e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),e.jsx("p",{className:"text-xs text-text-tertiary italic mt-1",children:"null"})]});if(Array.isArray(a))return e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:a.map((h,b)=>e.jsx("span",{className:"px-2 py-0.5 text-[11px] font-mono bg-surface-sunken rounded text-text-secondary",children:String(h)},b))})]});if(typeof a=="object"){const h=Object.entries(a);return e.jsxs("div",{children:[e.jsx(J,{isRequired:l,children:r}),e.jsx("div",{className:"ml-4 mt-2 pl-4 border-l border-accent-faint space-y-3",children:h.map(([b,m])=>e.jsx(Ie,{fieldKey:b,value:m,onChange:j=>i({...a,[b]:j})},b))})]})}return null}function J({children:t,isRequired:a}){return e.jsxs("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[t,a&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})}function G({error:t}){return t?e.jsx("p",{className:"text-[10px] text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:t}):null}function X(t){return t?"input text-sm w-full mt-1 border-status-error/50 focus:border-status-error animate-[field-shake_0.4s_ease-in-out]":"input text-sm w-full mt-1"}function Ee({json:t,onJsonChange:a,requestTriage:i,onRequestTriageChange:n,triageNotes:s,onTriageNotesChange:l,isDevMode:x=!0,disabled:c=!1,submitAttempted:r=!1,showTriage:o=!1}){const[d,u]=p.useState("form"),{visibleJson:h,hiddenFields:b}=p.useMemo(()=>{try{const g=JSON.parse(t);if(typeof g=="object"&&g!==null&&!Array.isArray(g)){const f={},R={};for(const[S,I]of Object.entries(g))S.startsWith("_")?f[S]=I:R[S]=I;return{visibleJson:JSON.stringify(R,null,2),hiddenFields:f}}}catch{}return{visibleJson:t,hiddenFields:{}}},[t]),m=p.useCallback(g=>{try{const f=JSON.parse(g);a(JSON.stringify({...f,...b},null,2))}catch{a(g)}},[b,a]),j=Object.keys(b).length>0;return e.jsxs(e.Fragment,{children:[(o||x)&&e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o?i?e.jsxs("button",{onClick:()=>n(!1),className:"group flex items-center gap-2 text-left","data-testid":"triage-cancel",children:[e.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-accent/10 text-accent shrink-0",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("span",{className:"text-xs text-text-secondary group-hover:text-text-primary transition-colors",children:["AI Triage active."," ",e.jsx("span",{className:"text-accent group-hover:underline",children:"Cancel"})]})]}):e.jsxs("button",{onClick:()=>n(!0),className:"group flex items-center gap-2.5 text-left my-4","data-testid":"triage-callout",children:[e.jsx("span",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-accent/10 text-accent shrink-0 animate-[triage-glow_6s_ease-in-out_infinite]",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.674M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})}),e.jsxs("span",{className:"text-[13px] text-text-secondary group-hover:text-text-primary transition-colors",children:["This form doesn't capture the issue?"," ",e.jsx("span",{className:"text-accent group-hover:underline",children:"Request AI Triage"})]})]}):e.jsx("span",{}),x&&!i&&e.jsx("button",{onClick:()=>u(d==="form"?"json":"form"),className:"text-[10px] text-text-tertiary hover:text-accent transition-colors",children:d==="form"?"Raw JSON":"Form"})]}),e.jsxs("div",{className:"relative min-h-[200px]",children:[e.jsx("div",{className:i?"pointer-events-none select-none":"",children:d==="form"?e.jsx(Re,{value:t,onChange:a,disabled:c,submitAttempted:r}):e.jsxs("div",{children:[j&&e.jsx("p",{className:"text-[10px] text-text-quaternary mb-2 italic",children:"Form schema hidden. Edit the resolver values below — they will be merged with the schema on submit."}),e.jsx("textarea",{value:h,onChange:g=>m(g.target.value),className:"input-json w-full",rows:Math.max(8,h.split(`
5
5
  `).length+2),spellCheck:!1,"data-testid":"resolve-json"})]})}),i&&e.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col bg-surface/90 backdrop-blur-[2px] rounded-md border border-accent/20 p-5","data-testid":"triage-overlay",children:[e.jsx("p",{className:"text-xs text-text-secondary mb-3 leading-relaxed",children:"The resolution form will not be submitted. Describe the issue so AI triage can diagnose and fix it using available tools. The corrected result will come back as a new escalation for your review."}),e.jsx("textarea",{value:s,onChange:g=>l(g.target.value),placeholder:"e.g. Content is in Spanish — needs translation to English before review...",className:"input text-xs w-full flex-1 min-h-[80px] resize-none",autoFocus:!0,"data-testid":"triage-notes"})]})]})]})}function K({children:t}){return e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary",children:t})}function ne({children:t}){return e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5 font-mono",children:t})}function wt({esc:t}){const{isBuilder:a}=xe();return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-accent/60 mb-3",children:"Classification"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-x-8 gap-y-4",children:[e.jsxs("div",{children:[e.jsx(K,{children:"Type"}),e.jsx(ne,{children:t.type})]}),t.subtype&&e.jsxs("div",{children:[e.jsx(K,{children:"Subtype"}),e.jsx(ne,{children:t.subtype})]}),e.jsxs("div",{children:[e.jsx(K,{children:"Priority"}),e.jsxs(ne,{children:["P",t.priority]})]}),e.jsxs("div",{children:[e.jsx(K,{children:"Status"}),e.jsx(ne,{children:t.status})]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-accent/60 mb-3",children:"References"}),e.jsxs("div",{className:"flex flex-wrap gap-x-8 gap-y-4",children:[e.jsx(E,{label:"Escalation ID",value:t.id}),t.task_id&&e.jsx(E,{label:"Task ID",value:t.task_id,href:a?`/workflows/tasks/detail/${t.task_id}`:void 0}),t.workflow_type&&e.jsx(E,{label:"Workflow Name",value:t.workflow_type,href:a?`/workflows/executions?entity=${encodeURIComponent(t.workflow_type)}`:void 0}),t.workflow_id&&e.jsx(E,{label:"Workflow ID",value:t.workflow_id,href:a?`/workflows/executions/${t.workflow_id}`:void 0}),t.task_queue&&e.jsx(E,{label:"Task Queue",value:t.task_queue,href:a?`/admin/controlplane?queue=${encodeURIComponent(t.task_queue)}`:void 0}),t.origin_id&&t.origin_id!==t.workflow_id&&e.jsx(E,{label:"Origin ID",value:t.origin_id}),t.parent_id&&e.jsx(E,{label:"Parent ID",value:t.parent_id}),t.trace_id&&e.jsx(E,{label:"Trace ID",value:t.trace_id}),t.span_id&&e.jsx(E,{label:"Span ID",value:t.span_id})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-accent/60 mb-3",children:"Timeline"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-x-8 gap-y-4",children:[e.jsxs("div",{children:[e.jsx(K,{children:"Created"}),e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5",children:e.jsx(U,{date:t.created_at})})]}),t.claimed_at&&e.jsxs("div",{children:[e.jsx(K,{children:"Claimed"}),e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5",children:e.jsx(U,{date:t.claimed_at})})]}),t.resolved_at&&e.jsxs("div",{children:[e.jsx(K,{children:"Resolved"}),e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5",children:e.jsx(U,{date:t.resolved_at})})]}),e.jsxs("div",{children:[e.jsx(K,{children:"Updated"}),e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5",children:e.jsx(U,{date:t.updated_at})})]})]})]}),t.metadata&&Object.keys(t.metadata).length>0&&e.jsx("div",{children:e.jsx(Z,{data:t.metadata,label:"Metadata"})})]})}function kt({isRoundsExhausted:t,payloadObj:a,isTerminal:i,resolverPayload:n,onRetryTriage:s,isRetrying:l}){return e.jsxs(e.Fragment,{children:[t&&a&&e.jsx("div",{className:"mt-8",children:e.jsx(ht,{payload:a,isTerminal:i,resolverPayload:n,onRetryTriage:s,isRetrying:l})}),(a==null?void 0:a.category)==="missing_credential"&&e.jsxs("div",{className:"mt-8 bg-status-warning/10 border border-status-warning/30 rounded-md px-5 py-4 flex items-start gap-3",children:[e.jsx(Ne,{size:20,className:"text-status-warning mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text-primary mb-1",children:"Missing Credential"}),e.jsxs("p",{className:"text-xs text-text-secondary mb-3",children:["This workflow requires a ",e.jsx("span",{className:"font-medium capitalize",children:String(a.provider)})," credential to continue. Register one and then resolve this escalation to retry."]}),e.jsxs(Se,{to:"/credentials",className:"btn-primary text-xs inline-flex items-center gap-1.5",children:[e.jsx(Ne,{size:12}),"Go to Credentials"]})]})]})]})}function _t({isCollapsed:t,toggleSection:a,esc:i,escalationPayload:n,resolverPayload:s,triageData:l,payloadObj:x,isTerminal:c,claimedByMe:r,activeView:o,metadataFormSchema:d,json:u,onJsonChange:h,requestTriage:b,onRequestTriageChange:m,triageNotes:j,onTriageNotesChange:g,isDevMode:f,onResolve:R,onEscalate:S,submitAttempted:I,isCertified:W,hasAI:A}){return e.jsxs("div",{className:"mt-8 space-y-6",children:[f&&e.jsx(ae,{title:"Escalation Record",sectionKey:"record",isCollapsed:t("record"),onToggle:a,contentClassName:"mt-4 ml-9",children:e.jsx(wt,{esc:i})}),f&&e.jsx(ae,{title:"Input / Output",sectionKey:"context",isCollapsed:t("context"),onToggle:a,contentClassName:"mt-4 ml-9",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[!!i.envelope&&e.jsx("div",{children:e.jsx(Z,{data:i.envelope,label:"Input Envelope"})}),n!=null&&e.jsx("div",{children:e.jsx(Z,{data:n,label:"Escalation Context"})})]}),s!=null&&e.jsx("div",{className:"max-w-xl",children:e.jsx(Z,{data:s,label:"Resolver Payload"})})]})}),f&&l&&x&&e.jsx(ae,{title:"AI Triage",sectionKey:"triage",isCollapsed:t("triage"),onToggle:a,contentClassName:"mt-4 ml-9",children:e.jsx(ft,{triage:l,payload:x})}),!f&&c&&s!=null&&(()=>{const _=typeof s=="object"&&s!==null?s:{},k=d,y=k?{..._,_form_schema:k}:_;return e.jsx("div",{className:"pt-6",children:e.jsx(Re,{value:JSON.stringify(y,null,2),onChange:()=>{},disabled:!0})})})(),!c&&(r||!f)&&o==="resolve"&&!!(i.workflow_type||d)&&(()=>{const _=d,k=_==null?void 0:_["x-lt-viewport"],y=(k==null?void 0:k.type)==="iframe"&&!!k.src&&R&&S;return f?e.jsx(ae,{title:"Submit Your Resolution",sectionKey:"resolver",isCollapsed:t("resolver"),onToggle:a,contentClassName:"mt-4 ml-9",children:y?e.jsx(Ce,{src:k.src,escalation:i,schema:_,onResolve:R,onEscalate:S}):e.jsx(Ee,{json:u,onJsonChange:h,requestTriage:b,onRequestTriageChange:m,triageNotes:j,onTriageNotesChange:g,isDevMode:f,submitAttempted:I,showTriage:!!W&&!!A})}):e.jsx("div",{className:"pt-6",children:y?e.jsx(Ce,{src:k.src,escalation:i,schema:_,onResolve:R,onEscalate:S}):e.jsx(Ee,{json:u,onJsonChange:h,requestTriage:b,onRequestTriageChange:m,triageNotes:j,onTriageNotesChange:g,isDevMode:f,disabled:!r,submitAttempted:I,showTriage:!!W&&!!A})})})()]})}function oe(t){if(!t)return null;try{return JSON.parse(t)}catch{return t}}function Ct(t){if(!t)return!1;try{const a=JSON.parse(t);return!!(a&&typeof a=="object"&&a._triage)}catch{return!1}}function Bt(){var pe,he,fe,je;const{id:t}=ot(),{user:a}=Be(),i=ct(),n=Ve(),{data:s,isLoading:l}=qe(t);at(t);const x=He(),c=Ke(),r=Ye(),{data:o}=Xe((s==null?void 0:s.role)??""),{data:d}=st(),{data:u}=Qe(),{isBuilder:h}=xe(),{isDevMode:b,toggleMode:m}=dt(!1),j=d==null?void 0:d.find(T=>T.workflow_type===(s==null?void 0:s.workflow_type)),g=((pe=u==null?void 0:u.telemetry)==null?void 0:pe.traceUrl)??null,[f,R]=p.useState("resolve"),[S,I]=p.useState("{}"),{isCollapsed:W,toggle:A,collapse:_,expand:k}=Ge("escalation-detail"),[y,w]=p.useState(!1),[v,$]=p.useState(""),[L,V]=p.useState(!1),D=(j==null?void 0:j.resolver_schema)??null,C=((he=s==null?void 0:s.metadata)==null?void 0:he.form_schema)??null,z=C??D,P=p.useRef(!1);p.useEffect(()=>{if(P.current)return;const T=C??(D!=null&&D.properties?D:null);if(T!=null&&T.properties){P.current=!0;const ge={_form_schema:T};for(const[Fe,Je]of Object.entries(T.properties)){const Ue=Je;ge[Fe]=Ue.default??""}I(JSON.stringify(ge,null,2))}else z&&(P.current=!0,I(JSON.stringify(z,null,2)))},[z,C,D]);const ee=Ct(s==null?void 0:s.escalation_payload),B=(s==null?void 0:s.subtype)==="rounds_exhausted",N=(s==null?void 0:s.subtype)==="wait_for_human";if(p.useEffect(()=>{(ee||B)&&_("context"),N&&C&&(_("context"),k("resolver"))},[ee,B,N,C,_,k]),l)return e.jsxs("div",{className:"animate-pulse space-y-8",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-32 bg-surface-sunken rounded w-full"})]});if(!s)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Escalation not found."});const Y=tt(s),O=Y&&s.assigned_to===(a==null?void 0:a.userId),Q=Y&&!O,F=s.status==="resolved"||s.status==="cancelled",M=oe(s.escalation_payload),te=oe(s.resolver_payload),re=oe(s.envelope),$e=!!((fe=re==null?void 0:re.metadata)!=null&&fe.certified),Ae=!!((je=u==null?void 0:u.ai)!=null&&je.enabled),q=typeof M=="object"&&M!==null&&!Array.isArray(M)?M:null,Me=q==null?void 0:q._triage,We=F?"terminal":O?"claimed_by_me":Q?"claimed_by_other":"available",De=T=>{x.mutate({id:s.id,durationMinutes:T}),_("context"),_("triage"),k("resolver")},se=()=>{n.resetQueries({queryKey:["escalations"]}),n.resetQueries({queryKey:["escalationStats"]}),i(-1)},ue=async T=>{await c.mutateAsync({id:s.id,resolverPayload:T}),se()},me=async T=>{T&&(await r.mutateAsync({id:s.id,targetRole:T}),se())},Le=async()=>{O||await x.mutateAsync({id:s.id,durationMinutes:30});const T=(q==null?void 0:q.diagnosis)||s.description||"";await c.mutateAsync({id:s.id,resolverPayload:{_lt:{needsTriage:!0},notes:T}}),se()},Pe=async()=>{await x.mutateAsync({id:s.id,durationMinutes:0}),se()},Oe=h?e.jsx("button",{onClick:m,className:"text-text-tertiary hover:text-accent transition-colors",title:b?"Switch to user view":"Switch to developer view",children:b?e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5"})}):e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}):void 0;return e.jsxs("div",{className:"min-h-[calc(100vh-9rem)] flex flex-col",children:[e.jsx(Ze,{title:"Escalation",actions:Oe}),e.jsx(mt,{esc:s,claimedByMe:O,claimed:Y,isTerminal:F,traceUrl:g,isDevMode:b,showDetails:!W("details"),onToggleDetails:()=>A("details")}),e.jsx(kt,{isRoundsExhausted:B,payloadObj:q,isTerminal:F,resolverPayload:te,onRetryTriage:Le,isRetrying:x.isPending||c.isPending}),e.jsx(_t,{isCollapsed:W,toggleSection:A,esc:s,escalationPayload:M,resolverPayload:te,triageData:Me,payloadObj:q,isTerminal:F,claimedByMe:O,activeView:f,metadataFormSchema:C,json:S,onJsonChange:I,requestTriage:y,onRequestTriageChange:w,triageNotes:v,onTriageNotesChange:$,isDevMode:b,onResolve:ue,onEscalate:me,submitAttempted:L,isCertified:$e,hasAI:Ae}),e.jsx("div",{className:"flex-1"}),e.jsx(xt,{mode:We,activeView:f,onActiveViewChange:R,onClaim:De,claimPending:x.isPending,workflowType:s.workflow_type,json:S,onResolve:ue,resolvePending:c.isPending,resolveError:c.error,requestTriage:y,triageNotes:v,currentRole:s.role,escalationTargets:((o==null?void 0:o.targets)??[]).filter(T=>T!==s.role),onEscalate:me,escalatePending:r.isPending,escalateError:r.error,onRelease:Pe,releasePending:x.isPending,assignedTo:s.assigned_to,assignedUntil:s.assigned_until,onSubmitAttempt:()=>V(!0)})]})}export{Bt as EscalationDetailPage};
6
- //# sourceMappingURL=index-CVGgSoda.js.map
6
+ //# sourceMappingURL=index-B-BK3vtk.js.map