@hotmeshio/long-tail 0.22.3 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/build/api/escalations/accumulate.js +7 -1
  2. package/build/api/escalations/resolve-batch.d.ts +2 -1
  3. package/build/api/escalations/resolve-batch.js +6 -5
  4. package/build/services/escalation/batch.d.ts +4 -4
  5. package/build/services/escalation/batch.js +7 -4
  6. package/build/services/orchestrator/condition.d.ts +4 -1
  7. package/build/services/orchestrator/condition.js +4 -1
  8. package/build/types/escalation.d.ts +9 -0
  9. package/build/types/escalation.js +2 -0
  10. package/build/types/index.d.ts +1 -1
  11. package/dashboard/dist/assets/{AdminDashboard-hI5-kKpL.js → AdminDashboard-DKrqLGjn.js} +2 -2
  12. package/dashboard/dist/assets/{AdminDashboard-hI5-kKpL.js.map → AdminDashboard-DKrqLGjn.js.map} +1 -1
  13. package/dashboard/dist/assets/{AgentConfigPage-DetU4HZe.js → AgentConfigPage-BoQhRW6U.js} +2 -2
  14. package/dashboard/dist/assets/{AgentConfigPage-DetU4HZe.js.map → AgentConfigPage-BoQhRW6U.js.map} +1 -1
  15. package/dashboard/dist/assets/{AgentDetailPage-DrGXo8KQ.js → AgentDetailPage-DZhzuZmO.js} +2 -2
  16. package/dashboard/dist/assets/{AgentDetailPage-DrGXo8KQ.js.map → AgentDetailPage-DZhzuZmO.js.map} +1 -1
  17. package/dashboard/dist/assets/{AgentsPage-D4md5BzM.js → AgentsPage-5MynmbWX.js} +2 -2
  18. package/dashboard/dist/assets/{AgentsPage-D4md5BzM.js.map → AgentsPage-5MynmbWX.js.map} +1 -1
  19. package/dashboard/dist/assets/{AvailableEscalationsPage-B2bS2ZJy.js → AvailableEscalationsPage-CWMyy3IL.js} +2 -2
  20. package/dashboard/dist/assets/{AvailableEscalationsPage-B2bS2ZJy.js.map → AvailableEscalationsPage-CWMyy3IL.js.map} +1 -1
  21. package/dashboard/dist/assets/{BotPicker-BXtey255.js → BotPicker-C3LR6Sqy.js} +2 -2
  22. package/dashboard/dist/assets/{BotPicker-BXtey255.js.map → BotPicker-C3LR6Sqy.js.map} +1 -1
  23. package/dashboard/dist/assets/{BulkAssignModal-CSL_PeZv.js → BulkAssignModal-COjoOIIH.js} +2 -2
  24. package/dashboard/dist/assets/{BulkAssignModal-CSL_PeZv.js.map → BulkAssignModal-COjoOIIH.js.map} +1 -1
  25. package/dashboard/dist/assets/{CapabilitiesPage-5scufTHW.js → CapabilitiesPage-DKxLvOfB.js} +2 -2
  26. package/dashboard/dist/assets/{CapabilitiesPage-5scufTHW.js.map → CapabilitiesPage-DKxLvOfB.js.map} +1 -1
  27. package/dashboard/dist/assets/{CollapsibleSection-DjjDGxP_.js → CollapsibleSection-Cz5sRx-r.js} +2 -2
  28. package/dashboard/dist/assets/{CollapsibleSection-DjjDGxP_.js.map → CollapsibleSection-Cz5sRx-r.js.map} +1 -1
  29. package/dashboard/dist/assets/{ConfirmDeleteModal-DJSmsHQM.js → ConfirmDeleteModal-Beq1vQtY.js} +2 -2
  30. package/dashboard/dist/assets/{ConfirmDeleteModal-DJSmsHQM.js.map → ConfirmDeleteModal-Beq1vQtY.js.map} +1 -1
  31. package/dashboard/dist/assets/{CountdownTimer-C5ZRYPfF.js → CountdownTimer-BUBl_4mP.js} +2 -2
  32. package/dashboard/dist/assets/{CountdownTimer-C5ZRYPfF.js.map → CountdownTimer-BUBl_4mP.js.map} +1 -1
  33. package/dashboard/dist/assets/{CredentialsPage-CV6e60yC.js → CredentialsPage-DhiHiPsG.js} +2 -2
  34. package/dashboard/dist/assets/{CredentialsPage-CV6e60yC.js.map → CredentialsPage-DhiHiPsG.js.map} +1 -1
  35. package/dashboard/dist/assets/{CronLabel-CnqhqW0B.js → CronLabel-C9SkawB-.js} +2 -2
  36. package/dashboard/dist/assets/{CronLabel-CnqhqW0B.js.map → CronLabel-C9SkawB-.js.map} +1 -1
  37. package/dashboard/dist/assets/{ElapsedCell-C1IOn-tj.js → ElapsedCell-BeK1SUDK.js} +2 -2
  38. package/dashboard/dist/assets/{ElapsedCell-C1IOn-tj.js.map → ElapsedCell-BeK1SUDK.js.map} +1 -1
  39. package/dashboard/dist/assets/{EntityTimelinePanel-Dz6Liig4.js → EntityTimelinePanel-BThdefKj.js} +2 -2
  40. package/dashboard/dist/assets/{EntityTimelinePanel-Dz6Liig4.js.map → EntityTimelinePanel-BThdefKj.js.map} +1 -1
  41. package/dashboard/dist/assets/{EscalationListSchemaPage-bgdmLmrh.js → EscalationListSchemaPage-DlDIYb-p.js} +2 -2
  42. package/dashboard/dist/assets/{EscalationListSchemaPage-bgdmLmrh.js.map → EscalationListSchemaPage-DlDIYb-p.js.map} +1 -1
  43. package/dashboard/dist/assets/{EscalationListView-CrlD3ZGt.js → EscalationListView-DTIVuym4.js} +2 -2
  44. package/dashboard/dist/assets/{EscalationListView-CrlD3ZGt.js.map → EscalationListView-DTIVuym4.js.map} +1 -1
  45. package/dashboard/dist/assets/{EscalationSchemaPage-dxXO_T3t.js → EscalationSchemaPage-CQt-Embr.js} +2 -2
  46. package/dashboard/dist/assets/{EscalationSchemaPage-dxXO_T3t.js.map → EscalationSchemaPage-CQt-Embr.js.map} +1 -1
  47. package/dashboard/dist/assets/{EscalationTimeline-C3WQZQuM.js → EscalationTimeline-DNKNp6pL.js} +2 -2
  48. package/dashboard/dist/assets/{EscalationTimeline-C3WQZQuM.js.map → EscalationTimeline-DNKNp6pL.js.map} +1 -1
  49. package/dashboard/dist/assets/{EscalationTitleSelect-CTtcETUO.js → EscalationTitleSelect-Dewrv8wX.js} +2 -2
  50. package/dashboard/dist/assets/{EscalationTitleSelect-CTtcETUO.js.map → EscalationTitleSelect-Dewrv8wX.js.map} +1 -1
  51. package/dashboard/dist/assets/{EscalationsOverview-DAjZ7JY2.js → EscalationsOverview-BzH-Y-5x.js} +2 -2
  52. package/dashboard/dist/assets/{EscalationsOverview-DAjZ7JY2.js.map → EscalationsOverview-BzH-Y-5x.js.map} +1 -1
  53. package/dashboard/dist/assets/{EventTable-B72DQP_v.js → EventTable-C97m6IZv.js} +2 -2
  54. package/dashboard/dist/assets/{EventTable-B72DQP_v.js.map → EventTable-C97m6IZv.js.map} +1 -1
  55. package/dashboard/dist/assets/{FilterBar-CCTaA_LH.js → FilterBar-D-6xVHIw.js} +2 -2
  56. package/dashboard/dist/assets/{FilterBar-CCTaA_LH.js.map → FilterBar-D-6xVHIw.js.map} +1 -1
  57. package/dashboard/dist/assets/{GraphInvokePage-CAsCgFo3.js → GraphInvokePage-Bwi8EF9Y.js} +2 -2
  58. package/dashboard/dist/assets/{GraphInvokePage-CAsCgFo3.js.map → GraphInvokePage-Bwi8EF9Y.js.map} +1 -1
  59. package/dashboard/dist/assets/{HomePage-DseE_iSr.js → HomePage-Z_Q03C0z.js} +2 -2
  60. package/dashboard/dist/assets/{HomePage-DseE_iSr.js.map → HomePage-Z_Q03C0z.js.map} +1 -1
  61. package/dashboard/dist/assets/{ListToolbar-1zdqnjW6.js → ListToolbar-_jWTw5no.js} +2 -2
  62. package/dashboard/dist/assets/{ListToolbar-1zdqnjW6.js.map → ListToolbar-_jWTw5no.js.map} +1 -1
  63. package/dashboard/dist/assets/{McpOverview-DS_JXDW5.js → McpOverview-CjqTuP0N.js} +2 -2
  64. package/dashboard/dist/assets/{McpOverview-DS_JXDW5.js.map → McpOverview-CjqTuP0N.js.map} +1 -1
  65. package/dashboard/dist/assets/{McpQueryDetailPage-BeMUGcv3.js → McpQueryDetailPage-leCsje1U.js} +2 -2
  66. package/dashboard/dist/assets/{McpQueryDetailPage-BeMUGcv3.js.map → McpQueryDetailPage-leCsje1U.js.map} +1 -1
  67. package/dashboard/dist/assets/{McpQueryPage-CeiLO_LR.js → McpQueryPage-C-PyXYX4.js} +2 -2
  68. package/dashboard/dist/assets/{McpQueryPage-CeiLO_LR.js.map → McpQueryPage-C-PyXYX4.js.map} +1 -1
  69. package/dashboard/dist/assets/{McpRunDetailPage-DYp1uZK2.js → McpRunDetailPage-JDrr3uUQ.js} +2 -2
  70. package/dashboard/dist/assets/{McpRunDetailPage-DYp1uZK2.js.map → McpRunDetailPage-JDrr3uUQ.js.map} +1 -1
  71. package/dashboard/dist/assets/{McpRunsPage-VeaDzcL4.js → McpRunsPage-DERXQLgZ.js} +2 -2
  72. package/dashboard/dist/assets/{McpRunsPage-VeaDzcL4.js.map → McpRunsPage-DERXQLgZ.js.map} +1 -1
  73. package/dashboard/dist/assets/{OperationsPage-DK2mgaXf.js → OperationsPage-B2DA7n9m.js} +2 -2
  74. package/dashboard/dist/assets/{OperationsPage-DK2mgaXf.js.map → OperationsPage-B2DA7n9m.js.map} +1 -1
  75. package/dashboard/dist/assets/{OperatorDashboard-BNjLF0f7.js → OperatorDashboard-C8RtPv8P.js} +2 -2
  76. package/dashboard/dist/assets/{OperatorDashboard-BNjLF0f7.js.map → OperatorDashboard-C8RtPv8P.js.map} +1 -1
  77. package/dashboard/dist/assets/{PersonaDetailPage-IQ2fZLa6.js → PersonaDetailPage-ChXwJ6u5.js} +2 -2
  78. package/dashboard/dist/assets/{PersonaDetailPage-IQ2fZLa6.js.map → PersonaDetailPage-ChXwJ6u5.js.map} +1 -1
  79. package/dashboard/dist/assets/{PersonasPage-DpGFEcU-.js → PersonasPage-BFFxncSE.js} +2 -2
  80. package/dashboard/dist/assets/{PersonasPage-DpGFEcU-.js.map → PersonasPage-BFFxncSE.js.map} +1 -1
  81. package/dashboard/dist/assets/{PortalPage-D07xyvG_.js → PortalPage-Xk1zVneM.js} +2 -2
  82. package/dashboard/dist/assets/{PortalPage-D07xyvG_.js.map → PortalPage-Xk1zVneM.js.map} +1 -1
  83. package/dashboard/dist/assets/{ProcessDetailPage-t8EEYSMk.js → ProcessDetailPage-D7EYwW-j.js} +2 -2
  84. package/dashboard/dist/assets/{ProcessDetailPage-t8EEYSMk.js.map → ProcessDetailPage-D7EYwW-j.js.map} +1 -1
  85. package/dashboard/dist/assets/{ProcessesListPage-BDUXLFdb.js → ProcessesListPage-CakYRtnE.js} +2 -2
  86. package/dashboard/dist/assets/{ProcessesListPage-BDUXLFdb.js.map → ProcessesListPage-CakYRtnE.js.map} +1 -1
  87. package/dashboard/dist/assets/{ResolverForm-BwWOYv_Z.js → ResolverForm-BwVOJUpJ.js} +2 -2
  88. package/dashboard/dist/assets/{ResolverForm-BwWOYv_Z.js.map → ResolverForm-BwVOJUpJ.js.map} +1 -1
  89. package/dashboard/dist/assets/{RoleDetailPage-zMF3x2xi.js → RoleDetailPage-CKbGwezP.js} +2 -2
  90. package/dashboard/dist/assets/{RoleDetailPage-zMF3x2xi.js.map → RoleDetailPage-CKbGwezP.js.map} +1 -1
  91. package/dashboard/dist/assets/{RolesPage-CEBp_PpL.js → RolesPage-Czu7Zku4.js} +2 -2
  92. package/dashboard/dist/assets/{RolesPage-CEBp_PpL.js.map → RolesPage-Czu7Zku4.js.map} +1 -1
  93. package/dashboard/dist/assets/{RunAsSelector-CC_EHN3z.js → RunAsSelector-6BLScYTX.js} +2 -2
  94. package/dashboard/dist/assets/{RunAsSelector-CC_EHN3z.js.map → RunAsSelector-6BLScYTX.js.map} +1 -1
  95. package/dashboard/dist/assets/{ScanCodesPage-DD4uU-jY.js → ScanCodesPage-Cv9q8Bvt.js} +2 -2
  96. package/dashboard/dist/assets/{ScanCodesPage-DD4uU-jY.js.map → ScanCodesPage-Cv9q8Bvt.js.map} +1 -1
  97. package/dashboard/dist/assets/{ScanSchemeDetailPage-CUW8gYFh.js → ScanSchemeDetailPage-BxazXYIc.js} +2 -2
  98. package/dashboard/dist/assets/{ScanSchemeDetailPage-CUW8gYFh.js.map → ScanSchemeDetailPage-BxazXYIc.js.map} +1 -1
  99. package/dashboard/dist/assets/{ScanStationPage-DpO_ESuf.js → ScanStationPage-Cg8LCFR7.js} +2 -2
  100. package/dashboard/dist/assets/{ScanStationPage-DpO_ESuf.js.map → ScanStationPage-Cg8LCFR7.js.map} +1 -1
  101. package/dashboard/dist/assets/{StickyPagination-cNqSDm5f.js → StickyPagination-DsdtYoXR.js} +2 -2
  102. package/dashboard/dist/assets/{StickyPagination-cNqSDm5f.js.map → StickyPagination-DsdtYoXR.js.map} +1 -1
  103. package/dashboard/dist/assets/{StreamMessageDetail-C4oZqQdB.js → StreamMessageDetail-CT3FQoT3.js} +2 -2
  104. package/dashboard/dist/assets/{StreamMessageDetail-C4oZqQdB.js.map → StreamMessageDetail-CT3FQoT3.js.map} +1 -1
  105. package/dashboard/dist/assets/{SwimlaneTimeline-BjBiV7GT.js → SwimlaneTimeline-C8TjkJ10.js} +2 -2
  106. package/dashboard/dist/assets/{SwimlaneTimeline-BjBiV7GT.js.map → SwimlaneTimeline-C8TjkJ10.js.map} +1 -1
  107. package/dashboard/dist/assets/{TaskDetailPage-pO_AnVS1.js → TaskDetailPage-DGUzdBFN.js} +2 -2
  108. package/dashboard/dist/assets/{TaskDetailPage-pO_AnVS1.js.map → TaskDetailPage-DGUzdBFN.js.map} +1 -1
  109. package/dashboard/dist/assets/{TasksListPage-DKDHlWP7.js → TasksListPage-BVIP6-EZ.js} +2 -2
  110. package/dashboard/dist/assets/{TasksListPage-DKDHlWP7.js.map → TasksListPage-BVIP6-EZ.js.map} +1 -1
  111. package/dashboard/dist/assets/{TimeAgo-D2qchUuJ.js → TimeAgo-C-rd9F9g.js} +2 -2
  112. package/dashboard/dist/assets/{TimeAgo-D2qchUuJ.js.map → TimeAgo-C-rd9F9g.js.map} +1 -1
  113. package/dashboard/dist/assets/{TimestampCell-DeswZGGo.js → TimestampCell-DPbchDOI.js} +2 -2
  114. package/dashboard/dist/assets/{TimestampCell-DeswZGGo.js.map → TimestampCell-DPbchDOI.js.map} +1 -1
  115. package/dashboard/dist/assets/{ToolTestPanel-DJh7PIUa.js → ToolTestPanel-DAUC8DHK.js} +2 -2
  116. package/dashboard/dist/assets/{ToolTestPanel-DJh7PIUa.js.map → ToolTestPanel-DAUC8DHK.js.map} +1 -1
  117. package/dashboard/dist/assets/{TopicDetailPage-CsgDJ4Z4.js → TopicDetailPage-70mMKBzG.js} +2 -2
  118. package/dashboard/dist/assets/{TopicDetailPage-CsgDJ4Z4.js.map → TopicDetailPage-70mMKBzG.js.map} +1 -1
  119. package/dashboard/dist/assets/{TopicsPage-tBRZDVDN.js → TopicsPage-CE3hBthn.js} +2 -2
  120. package/dashboard/dist/assets/{TopicsPage-tBRZDVDN.js.map → TopicsPage-CE3hBthn.js.map} +1 -1
  121. package/dashboard/dist/assets/{UserName-B-5JcDck.js → UserName-BDBDA-LR.js} +2 -2
  122. package/dashboard/dist/assets/{UserName-B-5JcDck.js.map → UserName-BDBDA-LR.js.map} +1 -1
  123. package/dashboard/dist/assets/{WorkflowExecutionPage-BPHVnhp6.js → WorkflowExecutionPage-BbkLZ1co.js} +2 -2
  124. package/dashboard/dist/assets/{WorkflowExecutionPage-BPHVnhp6.js.map → WorkflowExecutionPage-BbkLZ1co.js.map} +1 -1
  125. package/dashboard/dist/assets/{WorkflowsDashboard-CxLlfZmY.js → WorkflowsDashboard-Bp1L7Ggz.js} +2 -2
  126. package/dashboard/dist/assets/{WorkflowsDashboard-CxLlfZmY.js.map → WorkflowsDashboard-Bp1L7Ggz.js.map} +1 -1
  127. package/dashboard/dist/assets/{WorkflowsOverview-C4az5rwp.js → WorkflowsOverview-IeTKHAi4.js} +2 -2
  128. package/dashboard/dist/assets/{WorkflowsOverview-C4az5rwp.js.map → WorkflowsOverview-IeTKHAi4.js.map} +1 -1
  129. package/dashboard/dist/assets/{YamlWorkflowDetailPage-BmhlAUFQ.js → YamlWorkflowDetailPage-DtKCXnKt.js} +2 -2
  130. package/dashboard/dist/assets/{YamlWorkflowDetailPage-BmhlAUFQ.js.map → YamlWorkflowDetailPage-DtKCXnKt.js.map} +1 -1
  131. package/dashboard/dist/assets/{YamlWorkflowsPage-CSbG5o2V.js → YamlWorkflowsPage-CEcZBV_3.js} +2 -2
  132. package/dashboard/dist/assets/{YamlWorkflowsPage-CSbG5o2V.js.map → YamlWorkflowsPage-CEcZBV_3.js.map} +1 -1
  133. package/dashboard/dist/assets/{agents-BohEn7vw.js → agents-BT-sEk81.js} +2 -2
  134. package/dashboard/dist/assets/{agents-BohEn7vw.js.map → agents-BT-sEk81.js.map} +1 -1
  135. package/dashboard/dist/assets/{bots-BG2EO-Wi.js → bots-DRoAdLek.js} +2 -2
  136. package/dashboard/dist/assets/{bots-BG2EO-Wi.js.map → bots-DRoAdLek.js.map} +1 -1
  137. package/dashboard/dist/assets/{capabilities-CeFrBmYX.js → capabilities-Bc-nJk6y.js} +2 -2
  138. package/dashboard/dist/assets/{capabilities-CeFrBmYX.js.map → capabilities-Bc-nJk6y.js.map} +1 -1
  139. package/dashboard/dist/assets/{controlplane-Dhvt8l8F.js → controlplane-aXceSIRf.js} +2 -2
  140. package/dashboard/dist/assets/{controlplane-Dhvt8l8F.js.map → controlplane-aXceSIRf.js.map} +1 -1
  141. package/dashboard/dist/assets/{escalation-columns-BWMNxImp.js → escalation-columns-Bf09Q89t.js} +2 -2
  142. package/dashboard/dist/assets/{escalation-columns-BWMNxImp.js.map → escalation-columns-Bf09Q89t.js.map} +1 -1
  143. package/dashboard/dist/assets/{index-CtZWpy22.js → index-BCFEQEMC.js} +2 -2
  144. package/dashboard/dist/assets/{index-CtZWpy22.js.map → index-BCFEQEMC.js.map} +1 -1
  145. package/dashboard/dist/assets/{index-dYKgd06u.js → index-BEPKAjna.js} +2 -2
  146. package/dashboard/dist/assets/{index-dYKgd06u.js.map → index-BEPKAjna.js.map} +1 -1
  147. package/dashboard/dist/assets/{index-fUsx_gYx.js → index-BUYokcrl.js} +3 -3
  148. package/dashboard/dist/assets/{index-fUsx_gYx.js.map → index-BUYokcrl.js.map} +1 -1
  149. package/dashboard/dist/assets/{index-Y-bdW8vo.js → index-Ba-s5Yb5.js} +2 -2
  150. package/dashboard/dist/assets/{index-Y-bdW8vo.js.map → index-Ba-s5Yb5.js.map} +1 -1
  151. package/dashboard/dist/assets/{index-Dc_zWK23.js → index-C3VTJcrp.js} +2 -2
  152. package/dashboard/dist/assets/{index-Dc_zWK23.js.map → index-C3VTJcrp.js.map} +1 -1
  153. package/dashboard/dist/assets/{index-Dc3Om6G3.js → index-CZyO9hRb.js} +2 -2
  154. package/dashboard/dist/assets/{index-Dc3Om6G3.js.map → index-CZyO9hRb.js.map} +1 -1
  155. package/dashboard/dist/assets/{index-DABkM7s-.js → index-CcgmR-7-.js} +2 -2
  156. package/dashboard/dist/assets/{index-DABkM7s-.js.map → index-CcgmR-7-.js.map} +1 -1
  157. package/dashboard/dist/assets/{index-Cl_YXEdp.js → index-CuBGGwXf.js} +2 -2
  158. package/dashboard/dist/assets/{index-Cl_YXEdp.js.map → index-CuBGGwXf.js.map} +1 -1
  159. package/dashboard/dist/assets/index-D1mKf_qz.js +3 -0
  160. package/dashboard/dist/assets/index-D1mKf_qz.js.map +1 -0
  161. package/dashboard/dist/assets/{index-D90D9y0J.js → index-DBxpyIw5.js} +2 -2
  162. package/dashboard/dist/assets/{index-D90D9y0J.js.map → index-DBxpyIw5.js.map} +1 -1
  163. package/dashboard/dist/assets/{index-C8VlM2Oe.js → index-DH03y-UT.js} +2 -2
  164. package/dashboard/dist/assets/{index-C8VlM2Oe.js.map → index-DH03y-UT.js.map} +1 -1
  165. package/dashboard/dist/assets/{index-CiqSVDga.js → index-Djsoi8DI.js} +2 -2
  166. package/dashboard/dist/assets/{index-CiqSVDga.js.map → index-Djsoi8DI.js.map} +1 -1
  167. package/dashboard/dist/assets/{index-Bd_dgyfJ.js → index-h2gX31B2.js} +2 -2
  168. package/dashboard/dist/assets/{index-Bd_dgyfJ.js.map → index-h2gX31B2.js.map} +1 -1
  169. package/dashboard/dist/assets/{knowledge-CCcTidNV.js → knowledge-BhW8V-Hq.js} +2 -2
  170. package/dashboard/dist/assets/{knowledge-CCcTidNV.js.map → knowledge-BhW8V-Hq.js.map} +1 -1
  171. package/dashboard/dist/assets/{mcp-CLA1z7Pg.js → mcp-BYfSMQzh.js} +2 -2
  172. package/dashboard/dist/assets/{mcp-CLA1z7Pg.js.map → mcp-BYfSMQzh.js.map} +1 -1
  173. package/dashboard/dist/assets/{mcp-query-CWG0WMAs.js → mcp-query-DUJoOk_q.js} +2 -2
  174. package/dashboard/dist/assets/{mcp-query-CWG0WMAs.js.map → mcp-query-DUJoOk_q.js.map} +1 -1
  175. package/dashboard/dist/assets/{personas-8jURIzx6.js → personas-jT1O_SB4.js} +2 -2
  176. package/dashboard/dist/assets/{personas-8jURIzx6.js.map → personas-jT1O_SB4.js.map} +1 -1
  177. package/dashboard/dist/assets/{pipelines-hVVRAXqG.js → pipelines-Bp-wIaz2.js} +2 -2
  178. package/dashboard/dist/assets/{pipelines-hVVRAXqG.js.map → pipelines-Bp-wIaz2.js.map} +1 -1
  179. package/dashboard/dist/assets/{tasks-BE1O57Bf.js → tasks-CCrvnXbz.js} +2 -2
  180. package/dashboard/dist/assets/{tasks-BE1O57Bf.js.map → tasks-CCrvnXbz.js.map} +1 -1
  181. package/dashboard/dist/assets/{topics-Bg96Wp1r.js → topics-Blft0I1L.js} +2 -2
  182. package/dashboard/dist/assets/{topics-Bg96Wp1r.js.map → topics-Blft0I1L.js.map} +1 -1
  183. package/dashboard/dist/assets/{useDebouncedValue-DmEveyEy.js → useDebouncedValue-BYqbcism.js} +2 -2
  184. package/dashboard/dist/assets/{useDebouncedValue-DmEveyEy.js.map → useDebouncedValue-BYqbcism.js.map} +1 -1
  185. package/dashboard/dist/assets/{useNamespace-DHgkzIuL.js → useNamespace-BfxJAUgG.js} +2 -2
  186. package/dashboard/dist/assets/{useNamespace-DHgkzIuL.js.map → useNamespace-BfxJAUgG.js.map} +1 -1
  187. package/dashboard/dist/assets/{useYamlActivityEvents-RU0PvU8S.js → useYamlActivityEvents-BukJuWpb.js} +2 -2
  188. package/dashboard/dist/assets/{useYamlActivityEvents-RU0PvU8S.js.map → useYamlActivityEvents-BukJuWpb.js.map} +1 -1
  189. package/dashboard/dist/assets/{yaml-workflows-DQWE9ijc.js → yaml-workflows-DeRWqMGk.js} +2 -2
  190. package/dashboard/dist/assets/{yaml-workflows-DQWE9ijc.js.map → yaml-workflows-DeRWqMGk.js.map} +1 -1
  191. package/dashboard/dist/index.html +1 -1
  192. package/docs/accumulator.md +1 -1
  193. package/docs/api/sdk/escalations.md +1 -1
  194. package/docs/hitl/escalation.md +12 -0
  195. package/docs/hitl/resolution.md +1 -1
  196. package/package.json +2 -2
  197. package/dashboard/dist/assets/index-Dbwu51xm.js +0 -3
  198. package/dashboard/dist/assets/index-Dbwu51xm.js.map +0 -1
@@ -493,9 +493,15 @@ function itemsView(escalation) {
493
493
  if (isBatch(escalation)) {
494
494
  const store = (envelope[escalation_1.ESCALATION_BATCH_KEYS.ITEMS] ?? {});
495
495
  const filledAt = (envelope[escalation_1.ESCALATION_BATCH_KEYS.FILLED_AT] ?? {});
496
+ const filledBy = (envelope[escalation_1.ESCALATION_BATCH_KEYS.FILLED_BY] ?? {});
496
497
  const keys = (metadata[escalation_1.ESCALATION_BATCH_KEYS.KEYS] ?? []);
497
498
  const items = Object.entries(store)
498
- .map(([itemKey, payload]) => ({ itemKey, payload: payload, at: filledAt[itemKey] ?? '' }))
499
+ .map(([itemKey, payload]) => ({
500
+ itemKey,
501
+ payload: payload,
502
+ at: filledAt[itemKey] ?? '',
503
+ ...(typeof filledBy[itemKey] === 'string' ? { actor: filledBy[itemKey] } : {}),
504
+ }))
499
505
  .sort((a, b) => a.at.localeCompare(b.at) || a.itemKey.localeCompare(b.itemKey));
500
506
  return {
501
507
  escalationId: escalation.id,
@@ -8,7 +8,8 @@ import type { LTApiAuth, LTApiResult } from '../../types/sdk';
8
8
  *
9
9
  * Each item validates against the SAME versioned form schema a single-item
10
10
  * resolver gets (metadata.form_schema → pinned lt_role_schemas → live role
11
- * schema), including the submit guard.
11
+ * schema), including the submit guard. Every fill records the caller as the
12
+ * entry's actor (`envelope.batch_filled_by[itemKey]`).
12
13
  *
13
14
  * Claim semantics: claim-agnostic by default — a batch accumulates
14
15
  * contributions from multiple principals, so the single-owner claim lock is
@@ -52,7 +52,8 @@ const metadata_1 = require("./metadata");
52
52
  *
53
53
  * Each item validates against the SAME versioned form schema a single-item
54
54
  * resolver gets (metadata.form_schema → pinned lt_role_schemas → live role
55
- * schema), including the submit guard.
55
+ * schema), including the submit guard. Every fill records the caller as the
56
+ * entry's actor (`envelope.batch_filled_by[itemKey]`).
56
57
  *
57
58
  * Claim semantics: claim-agnostic by default — a batch accumulates
58
59
  * contributions from multiple principals, so the single-owner claim lock is
@@ -100,7 +101,7 @@ async function resolveBatchItem(input, auth) {
100
101
  // resolved_by merges on every fill; the completing fill's stamp is the
101
102
  // resolution provenance, matching single-resolve. $resolution rides the
102
103
  // completing item's signal only.
103
- const result = await escalationService.resolveBatchItem(escalation.id, itemKey, redacted, { ...metadata, resolved_by: auth.userId }, input.assertClaim ? auth.userId : undefined, await (0, resolve_1.resolverIdentity)(auth));
104
+ const result = await escalationService.resolveBatchItem(escalation.id, itemKey, redacted, { ...metadata, resolved_by: auth.userId }, input.assertClaim ? auth.userId : undefined, await (0, resolve_1.resolverIdentity)(auth), auth.userId);
104
105
  return batchOutcomeResult(result, itemKey, escalation.workflow_id);
105
106
  }
106
107
  catch (err) {
@@ -140,7 +141,7 @@ async function resolveBatchItemBySignalKey(input, auth) {
140
141
  if (violation)
141
142
  return (0, resolve_1.validationFailure)(violation);
142
143
  const redacted = await (0, resolve_1.redactPasswords)(resolverPayload, escalation.metadata?.form_schema);
143
- const result = await escalationService.resolveBatchItemBySignalKey(signalKey, itemKey, redacted, { ...metadata, resolved_by: auth.userId }, await (0, resolve_1.resolverIdentity)(auth));
144
+ const result = await escalationService.resolveBatchItemBySignalKey(signalKey, itemKey, redacted, { ...metadata, resolved_by: auth.userId }, await (0, resolve_1.resolverIdentity)(auth), auth.userId);
144
145
  return batchOutcomeResult(result, itemKey, escalation.workflow_id);
145
146
  }
146
147
  catch (err) {
@@ -176,7 +177,7 @@ async function resolveBatchItemByMetadata(input, auth) {
176
177
  if (enforcing.size === 0) {
177
178
  // Single atomic call — selection, fill, and (on the last item) the
178
179
  // resolve + wake all inside the SDK statement.
179
- const result = await escalationService.resolveBatchItemByMetadata(key, value, itemKey, resolverPayload, allowedRoles ?? undefined, outcome, resolvedBy);
180
+ const result = await escalationService.resolveBatchItemByMetadata(key, value, itemKey, resolverPayload, allowedRoles ?? undefined, outcome, resolvedBy, auth.userId);
180
181
  return batchOutcomeResult(result, itemKey, result.escalation?.workflow_id ?? null);
181
182
  }
182
183
  // Phase 1: pick the row the fill would target (scoped, priority-ordered)
@@ -194,7 +195,7 @@ async function resolveBatchItemByMetadata(input, auth) {
194
195
  // Phase 2: fill by asserted id. The SDK statement re-checks pending +
195
196
  // batch state; a row that went terminal between phases maps to 409.
196
197
  const redacted = await (0, resolve_1.redactPasswords)(resolverPayload, row.metadata?.form_schema);
197
- const result = await escalationService.resolveBatchItem(row.id, itemKey, redacted, outcome, undefined, resolvedBy);
198
+ const result = await escalationService.resolveBatchItem(row.id, itemKey, redacted, outcome, undefined, resolvedBy, auth.userId);
198
199
  if (result.outcome === 'not-found') {
199
200
  return { status: 409, error: 'A concurrent resolution is already in progress for this escalation' };
200
201
  }
@@ -9,14 +9,14 @@ export interface ResolveBatchItemOutcome {
9
9
  /**
10
10
  * Fills one declared item of a batch escalation in a single atomic SDK
11
11
  * statement (guarded fill + facet recompute + resolve-and-wake on the last
12
- * item). Interim fills publish `escalation.updated` with progress; the
12
+ * item). `actor` is recorded under `envelope.batch_filled_by[itemKey]`. Interim fills publish `escalation.updated` with progress; the
13
13
  * completing fill publishes the standard `escalation.resolved`. Failure
14
14
  * outcomes publish nothing — the row was untouched.
15
15
  */
16
16
  export declare function resolveBatchItem(id: string, itemKey: string, payload: Record<string, any>, metadata?: Record<string, any>, assertClaim?: string, resolvedBy?: {
17
17
  id: string;
18
18
  email?: string;
19
- }): Promise<ResolveBatchItemOutcome>;
19
+ }, actor?: string): Promise<ResolveBatchItemOutcome>;
20
20
  /**
21
21
  * Batch-item fill selecting the row by its `signal_key` — the deterministic
22
22
  * home signal id the parent parked on. For callers that already own that
@@ -26,7 +26,7 @@ export declare function resolveBatchItem(id: string, itemKey: string, payload: R
26
26
  export declare function resolveBatchItemBySignalKey(signalKey: string, itemKey: string, payload: Record<string, any>, metadata?: Record<string, any>, resolvedBy?: {
27
27
  id: string;
28
28
  email?: string;
29
- }): Promise<ResolveBatchItemOutcome>;
29
+ }, actor?: string): Promise<ResolveBatchItemOutcome>;
30
30
  /**
31
31
  * Batch-item fill selecting the row by metadata facet — the highest-priority
32
32
  * pending row whose metadata contains the key/value, scoped by `roles`.
@@ -35,4 +35,4 @@ export declare function resolveBatchItemBySignalKey(signalKey: string, itemKey:
35
35
  export declare function resolveBatchItemByMetadata(key: string, value: unknown, itemKey: string, payload: Record<string, any>, roles?: string[], metadata?: Record<string, any>, resolvedBy?: {
36
36
  id: string;
37
37
  email?: string;
38
- }): Promise<ResolveBatchItemOutcome>;
38
+ }, actor?: string): Promise<ResolveBatchItemOutcome>;
@@ -11,11 +11,11 @@ const map_1 = require("./map");
11
11
  /**
12
12
  * Fills one declared item of a batch escalation in a single atomic SDK
13
13
  * statement (guarded fill + facet recompute + resolve-and-wake on the last
14
- * item). Interim fills publish `escalation.updated` with progress; the
14
+ * item). `actor` is recorded under `envelope.batch_filled_by[itemKey]`. Interim fills publish `escalation.updated` with progress; the
15
15
  * completing fill publishes the standard `escalation.resolved`. Failure
16
16
  * outcomes publish nothing — the row was untouched.
17
17
  */
18
- async function resolveBatchItem(id, itemKey, payload, metadata, assertClaim, resolvedBy) {
18
+ async function resolveBatchItem(id, itemKey, payload, metadata, assertClaim, resolvedBy, actor) {
19
19
  if (!(0, uuid_1.isUuid)(id))
20
20
  return { outcome: 'not-found', remaining: -1, escalation: null };
21
21
  const client = await (0, client_1.escalations)();
@@ -26,6 +26,7 @@ async function resolveBatchItem(id, itemKey, payload, metadata, assertClaim, res
26
26
  metadata,
27
27
  assertClaim,
28
28
  resolvedBy,
29
+ actor,
29
30
  });
30
31
  return settleBatchOutcome(result, itemKey);
31
32
  }
@@ -35,7 +36,7 @@ async function resolveBatchItem(id, itemKey, payload, metadata, assertClaim, res
35
36
  * identity (a child calling home, a webhook), skipping both the UUID lookup
36
37
  * and any facet duplication. Same event contract as {@link resolveBatchItem}.
37
38
  */
38
- async function resolveBatchItemBySignalKey(signalKey, itemKey, payload, metadata, resolvedBy) {
39
+ async function resolveBatchItemBySignalKey(signalKey, itemKey, payload, metadata, resolvedBy, actor) {
39
40
  const client = await (0, client_1.escalations)();
40
41
  const result = await client.resolveBatchItem({
41
42
  signalKey,
@@ -43,6 +44,7 @@ async function resolveBatchItemBySignalKey(signalKey, itemKey, payload, metadata
43
44
  payload,
44
45
  metadata,
45
46
  resolvedBy,
47
+ actor,
46
48
  });
47
49
  return settleBatchOutcome(result, itemKey);
48
50
  }
@@ -51,7 +53,7 @@ async function resolveBatchItemBySignalKey(signalKey, itemKey, payload, metadata
51
53
  * pending row whose metadata contains the key/value, scoped by `roles`.
52
54
  * Same event contract as {@link resolveBatchItem}.
53
55
  */
54
- async function resolveBatchItemByMetadata(key, value, itemKey, payload, roles, metadata, resolvedBy) {
56
+ async function resolveBatchItemByMetadata(key, value, itemKey, payload, roles, metadata, resolvedBy, actor) {
55
57
  const client = await (0, client_1.escalations)();
56
58
  const result = await client.resolveBatchItemByMetadata({
57
59
  key,
@@ -61,6 +63,7 @@ async function resolveBatchItemByMetadata(key, value, itemKey, payload, roles, m
61
63
  payload,
62
64
  metadata,
63
65
  resolvedBy,
66
+ actor,
64
67
  });
65
68
  return settleBatchOutcome(result, itemKey);
66
69
  }
@@ -122,7 +122,10 @@ export type ConditionEscalationConfig = Types.ConditionQueueConfig & {
122
122
  * items persist on the terminal row for audit. Add `partialOnTimeout: true`
123
123
  * (hotmesh 0.29.0+) and the timer instead resumes with the items filled so
124
124
  * far plus `$trigger: 'timeout'`. A plain resolve on a batch row remains an
125
- * admin override that resolves the whole row with its payload.
125
+ * admin override that resolves the whole row with its payload. Entries
126
+ * already satisfied go in `filled` (hotmesh 0.31.0+), keyed by item key
127
+ * with `payload`, `at` from the source of record, and an optional `actor`;
128
+ * the row starts with that progress and delivers them with the collection.
126
129
  *
127
130
  * **Open accumulation — items arrive over time (hotmesh 0.29.0+).** Declare
128
131
  * `accumulate` and the escalation holds items added via `accumulateItem`
@@ -168,7 +168,10 @@ function toEngineConfig(escalation) {
168
168
  * items persist on the terminal row for audit. Add `partialOnTimeout: true`
169
169
  * (hotmesh 0.29.0+) and the timer instead resumes with the items filled so
170
170
  * far plus `$trigger: 'timeout'`. A plain resolve on a batch row remains an
171
- * admin override that resolves the whole row with its payload.
171
+ * admin override that resolves the whole row with its payload. Entries
172
+ * already satisfied go in `filled` (hotmesh 0.31.0+), keyed by item key
173
+ * with `payload`, `at` from the source of record, and an optional `actor`;
174
+ * the row starts with that progress and delivers them with the collection.
172
175
  *
173
176
  * **Open accumulation — items arrive over time (hotmesh 0.29.0+).** Declare
174
177
  * `accumulate` and the escalation holds items added via `accumulateItem`
@@ -20,6 +20,13 @@ export type BatchItemOutcome = Types.BatchItemOutcome;
20
20
  * entry. Re-exported from the HotMesh SDK.
21
21
  */
22
22
  export type AccumulateConfig = Types.AccumulateConfig;
23
+ /**
24
+ * One batch entry satisfied before the wait begins (`conditional`'s `filled`
25
+ * field, keyed by item key): its `payload`, the `at` it was satisfied from
26
+ * the source of record, and an optional `actor`. Re-exported from the
27
+ * HotMesh SDK.
28
+ */
29
+ export type BatchFilledEntry = Types.BatchFilledEntry;
23
30
  /**
24
31
  * What an accumulator wait resolves with on every terminal path except
25
32
  * cancel: the ordered `$accumulated` collection and the `$trigger` that
@@ -57,6 +64,8 @@ export declare const ESCALATION_BATCH_KEYS: {
57
64
  readonly ITEMS: "batch_items";
58
65
  /** Envelope: `Record<itemKey, iso8601>` fill timestamps from the database clock. */
59
66
  readonly FILLED_AT: "batch_filled_at";
67
+ /** Envelope: `Record<itemKey, userId>`, the actor of each attributed fill. */
68
+ readonly FILLED_BY: "batch_filled_by";
60
69
  /** Envelope: set by `partialOnTimeout`; the timer delivers the filled items. */
61
70
  readonly PARTIAL_ON_TIMEOUT: "batch_partial_on_timeout";
62
71
  };
@@ -25,6 +25,8 @@ exports.ESCALATION_BATCH_KEYS = {
25
25
  ITEMS: 'batch_items',
26
26
  /** Envelope: `Record<itemKey, iso8601>` fill timestamps from the database clock. */
27
27
  FILLED_AT: 'batch_filled_at',
28
+ /** Envelope: `Record<itemKey, userId>`, the actor of each attributed fill. */
29
+ FILLED_BY: 'batch_filled_by',
28
30
  /** Envelope: set by `partialOnTimeout`; the timer delivers the filled items. */
29
31
  PARTIAL_ON_TIMEOUT: 'batch_partial_on_timeout',
30
32
  };
@@ -1,6 +1,6 @@
1
1
  export type { LTEnvelope, } from './envelope';
2
2
  export type { LTTaskStatus, LTTaskPriority, LTTaskRecord, LTMilestone, } from './task';
3
- export type { LTEscalationStatus, LTEscalationPriority, LTEscalationRecord, EscalationResolution, BatchItemOutcome, AccumulateConfig, AccumulatorResult, AccumulatedItem, AccumulatorTrigger, AccumulateItemOutcome, RemoveAccumulatedItemOutcome, EscalationLookupRef, } from './escalation';
3
+ export type { LTEscalationStatus, LTEscalationPriority, LTEscalationRecord, EscalationResolution, BatchItemOutcome, BatchFilledEntry, AccumulateConfig, AccumulatorResult, AccumulatedItem, AccumulatorTrigger, AccumulateItemOutcome, RemoveAccumulatedItemOutcome, EscalationLookupRef, } from './escalation';
4
4
  export { isEffectivelyClaimed, isAvailable, ESCALATION_METADATA_KEYS, ESCALATION_BATCH_KEYS, ESCALATION_ACCUMULATE_KEYS, ACCUMULATOR_RESULT_KEYS, LOOKUP_VERSION_CURRENT, isCurrentLookupRef, } from './escalation';
5
5
  export type { DomainDictionary, DomainTerm, DomainTermKind, DomainTermMapping, DomainRunbook, DomainIndex, } from './domain-manifest';
6
6
  export type { FacetRangeOp, FacetRange, FacetOrder, FacetQuery, ContainerSelector, ClaimedGroup, GroupSummary, } from './facets';
@@ -1,2 +1,2 @@
1
- import{j as o}from"./vendor-query-DvWWuNIB.js";import{c as n}from"./tasks-BE1O57Bf.js";import{z as m,a9 as c}from"./index-fUsx_gYx.js";import{u}from"./mcp-CLA1z7Pg.js";import{P as d}from"./PageHeaderWithStats-DHj8Mqox.js";import"./vendor-react-_9U4mKFr.js";import"./vendor-icons-CeVtUKyP.js";function S(){var e;m();const{data:t}=n({limit:1}),{data:a}=c({status:"pending",limit:1}),{data:s}=u(),l=((e=s==null?void 0:s.servers)==null?void 0:e.filter(i=>i.status==="connected").length)??0,r=s?`${l}/${s.total}`:"—";return o.jsx("div",{children:o.jsx(d,{title:"Admin",stats:[{label:"Tasks",value:(t==null?void 0:t.total)??"—"},{label:"Pending Escalations",value:(a==null?void 0:a.total)??"—",dotClass:"bg-status-pending"},{label:"MCP Servers",value:r},{label:"System",value:"Healthy",dotClass:"bg-status-success"}]})})}export{S as AdminDashboard};
2
- //# sourceMappingURL=AdminDashboard-hI5-kKpL.js.map
1
+ import{j as o}from"./vendor-query-DvWWuNIB.js";import{c as n}from"./tasks-CCrvnXbz.js";import{z as m,a9 as c}from"./index-BUYokcrl.js";import{u}from"./mcp-BYfSMQzh.js";import{P as d}from"./PageHeaderWithStats-DHj8Mqox.js";import"./vendor-react-_9U4mKFr.js";import"./vendor-icons-CeVtUKyP.js";function S(){var e;m();const{data:t}=n({limit:1}),{data:a}=c({status:"pending",limit:1}),{data:s}=u(),l=((e=s==null?void 0:s.servers)==null?void 0:e.filter(i=>i.status==="connected").length)??0,r=s?`${l}/${s.total}`:"—";return o.jsx("div",{children:o.jsx(d,{title:"Admin",stats:[{label:"Tasks",value:(t==null?void 0:t.total)??"—"},{label:"Pending Escalations",value:(a==null?void 0:a.total)??"—",dotClass:"bg-status-pending"},{label:"MCP Servers",value:r},{label:"System",value:"Healthy",dotClass:"bg-status-success"}]})})}export{S as AdminDashboard};
2
+ //# sourceMappingURL=AdminDashboard-DKrqLGjn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminDashboard-hI5-kKpL.js","sources":["../../src/pages/admin/AdminDashboard.tsx"],"sourcesContent":["import { useTasks } from '../../api/tasks';\nimport { useEscalations } from '../../api/escalations';\nimport { useEscalationListEvents } from '../../hooks/useEventHooks';\nimport { useMcpServers } from '../../api/mcp';\nimport { PageHeaderWithStats } from '../../components/common/layout/PageHeaderWithStats';\n\nexport function AdminDashboard() {\n useEscalationListEvents();\n const { data: taskData } = useTasks({ limit: 1 });\n const { data: pendingEsc } = useEscalations({ status: 'pending', limit: 1 });\n const { data: mcpData } = useMcpServers();\n\n const connectedServers =\n mcpData?.servers?.filter((s) => s.status === 'connected').length ?? 0;\n const mcpLabel = mcpData ? `${connectedServers}/${mcpData.total}` : '—';\n\n return (\n <div>\n <PageHeaderWithStats\n title=\"Admin\"\n stats={[\n { label: 'Tasks', value: taskData?.total ?? '—' },\n { label: 'Pending Escalations', value: pendingEsc?.total ?? '—', dotClass: 'bg-status-pending' },\n { label: 'MCP Servers', value: mcpLabel },\n { label: 'System', value: 'Healthy', dotClass: 'bg-status-success' },\n ]}\n />\n </div>\n );\n}\n"],"names":["AdminDashboard","useEscalationListEvents","taskData","useTasks","pendingEsc","useEscalations","mcpData","useMcpServers","connectedServers","_a","s","mcpLabel","jsx","PageHeaderWithStats"],"mappings":"oSAMO,SAASA,GAAiB,OAC/BC,EAAA,EACA,KAAM,CAAE,KAAMC,CAAA,EAAaC,EAAS,CAAE,MAAO,EAAG,EAC1C,CAAE,KAAMC,CAAA,EAAeC,EAAe,CAAE,OAAQ,UAAW,MAAO,EAAG,EACrE,CAAE,KAAMC,CAAA,EAAYC,EAAA,EAEpBC,IACJC,EAAAH,GAAA,YAAAA,EAAS,UAAT,YAAAG,EAAkB,OAAQC,GAAMA,EAAE,SAAW,aAAa,SAAU,EAChEC,EAAWL,EAAU,GAAGE,CAAgB,IAAIF,EAAQ,KAAK,GAAK,IAEpE,aACG,MAAA,CACC,SAAAM,EAAAA,IAACC,EAAA,CACC,MAAM,QACN,MAAO,CACL,CAAE,MAAO,QAAS,OAAOX,GAAA,YAAAA,EAAU,QAAS,GAAA,EAC5C,CAAE,MAAO,sBAAuB,OAAOE,GAAA,YAAAA,EAAY,QAAS,IAAK,SAAU,mBAAA,EAC3E,CAAE,MAAO,cAAe,MAAOO,CAAA,EAC/B,CAAE,MAAO,SAAU,MAAO,UAAW,SAAU,mBAAA,CAAoB,CACrE,CAAA,EAEJ,CAEJ"}
1
+ {"version":3,"file":"AdminDashboard-DKrqLGjn.js","sources":["../../src/pages/admin/AdminDashboard.tsx"],"sourcesContent":["import { useTasks } from '../../api/tasks';\nimport { useEscalations } from '../../api/escalations';\nimport { useEscalationListEvents } from '../../hooks/useEventHooks';\nimport { useMcpServers } from '../../api/mcp';\nimport { PageHeaderWithStats } from '../../components/common/layout/PageHeaderWithStats';\n\nexport function AdminDashboard() {\n useEscalationListEvents();\n const { data: taskData } = useTasks({ limit: 1 });\n const { data: pendingEsc } = useEscalations({ status: 'pending', limit: 1 });\n const { data: mcpData } = useMcpServers();\n\n const connectedServers =\n mcpData?.servers?.filter((s) => s.status === 'connected').length ?? 0;\n const mcpLabel = mcpData ? `${connectedServers}/${mcpData.total}` : '—';\n\n return (\n <div>\n <PageHeaderWithStats\n title=\"Admin\"\n stats={[\n { label: 'Tasks', value: taskData?.total ?? '—' },\n { label: 'Pending Escalations', value: pendingEsc?.total ?? '—', dotClass: 'bg-status-pending' },\n { label: 'MCP Servers', value: mcpLabel },\n { label: 'System', value: 'Healthy', dotClass: 'bg-status-success' },\n ]}\n />\n </div>\n );\n}\n"],"names":["AdminDashboard","useEscalationListEvents","taskData","useTasks","pendingEsc","useEscalations","mcpData","useMcpServers","connectedServers","_a","s","mcpLabel","jsx","PageHeaderWithStats"],"mappings":"oSAMO,SAASA,GAAiB,OAC/BC,EAAA,EACA,KAAM,CAAE,KAAMC,CAAA,EAAaC,EAAS,CAAE,MAAO,EAAG,EAC1C,CAAE,KAAMC,CAAA,EAAeC,EAAe,CAAE,OAAQ,UAAW,MAAO,EAAG,EACrE,CAAE,KAAMC,CAAA,EAAYC,EAAA,EAEpBC,IACJC,EAAAH,GAAA,YAAAA,EAAS,UAAT,YAAAG,EAAkB,OAAQC,GAAMA,EAAE,SAAW,aAAa,SAAU,EAChEC,EAAWL,EAAU,GAAGE,CAAgB,IAAIF,EAAQ,KAAK,GAAK,IAEpE,aACG,MAAA,CACC,SAAAM,EAAAA,IAACC,EAAA,CACC,MAAM,QACN,MAAO,CACL,CAAE,MAAO,QAAS,OAAOX,GAAA,YAAAA,EAAU,QAAS,GAAA,EAC5C,CAAE,MAAO,sBAAuB,OAAOE,GAAA,YAAAA,EAAY,QAAS,IAAK,SAAU,mBAAA,EAC3E,CAAE,MAAO,cAAe,MAAOO,CAAA,EAC/B,CAAE,MAAO,SAAU,MAAO,UAAW,SAAU,mBAAA,CAAoB,CACrE,CAAA,EAEJ,CAEJ"}
@@ -1,4 +1,4 @@
1
- import{j as e,a as f}from"./vendor-query-DvWWuNIB.js";import{a as ce,d as le,b as oe}from"./agents-BohEn7vw.js";import{E as de,C as xe,u as pe,a as ue,b as me,c as he}from"./CronLabel-CnqhqW0B.js";import{g as fe,a as ve,c as be,y as ye}from"./index-fUsx_gYx.js";import{P as ge}from"./PageHeader-CMd3f4bz.js";import{x as E,o as K,K as je,R as U,g as M,z as Z,ax as Y,f as V,bX as ee,ab as we}from"./vendor-icons-CeVtUKyP.js";import{g as Ne}from"./knowledge-CCcTidNV.js";import{R as te}from"./RunAsSelector-CC_EHN3z.js";import{u as _e}from"./yaml-workflows-DQWE9ijc.js";import{u as se}from"./capabilities-CeFrBmYX.js";import{u as ke}from"./topics-Bg96Wp1r.js";import{W as Q}from"./WorkflowPill-Dg7BDTyM.js";import{e as Ce,u as Se,f as qe}from"./vendor-react-_9U4mKFr.js";import"./BotPicker-BXtey255.js";import"./bots-BG2EO-Wi.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Oe={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},Ae={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,x,m;const r=(x=(o=s.behaviors)==null?void 0:o.schedules)!=null&&x.length?s.behaviors.schedules.map(i=>({cron:i.cron||"",reaction_type:i.reaction_type||"durable",workflow_type:i.workflow_type||"",pipeline_id:i.pipeline_id||"",server_id:i.server_id||"",tool_name:i.tool_name||"",envelope:i.envelope?JSON.stringify(i.envelope,null,2):"{}",execute_as:i.execute_as||""})):(m=s.behaviors)!=null&&m.cron?[{cron:s.behaviors.cron,reaction_type:"durable",workflow_type:s.workflow_type??"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""}]:[];return{name:s.id,description:s.description??"",goals:s.goals??"",rules:s.rules??"",user_id:s.user_id??"",knowledge_domain:s.knowledge_domain??"",subscriptions:a.map(i=>({id:i.id,topic:i.topic,filter:i.filter?JSON.stringify(i.filter,null,2):"",reaction_type:i.reaction_type,workflow_type:i.workflow_type??"",pipeline_id:i.pipeline_id??"",mcp_prompt:i.mcp_prompt??"",server_id:i.server_id??"",tool_name:i.tool_name??"",input_mapping:JSON.stringify(i.input_mapping??{},null,2),execute_as:i.execute_as??"",enabled:i.enabled})),schedules:r}}function Ee(s){var r;const a={};return s.schedules.length>0&&(a.schedules=s.schedules.map(o=>({cron:o.cron,reaction_type:o.reaction_type||"durable",workflow_type:o.reaction_type==="pipeline"?void 0:o.workflow_type,pipeline_id:o.reaction_type==="pipeline"?o.pipeline_id:void 0,envelope:B(o.envelope)??{},execute_as:o.execute_as||void 0})),a.cron=s.schedules[0].cron),{id:s.name,description:s.description||void 0,goals:s.goals||void 0,rules:s.rules||void 0,user_id:s.user_id||void 0,knowledge_domain:s.knowledge_domain||void 0,behaviors:a,workflow_type:((r=s.schedules[0])==null?void 0:r.workflow_type)||void 0,pipeline_id:void 0}}function $e(s){return s.subscriptions.map(a=>({id:a.id,topic:a.topic,filter:a.filter?B(a.filter):void 0,reaction_type:a.reaction_type,workflow_type:a.workflow_type||void 0,pipeline_id:a.pipeline_id||void 0,mcp_prompt:a.mcp_prompt||void 0,server_id:a.server_id||void 0,tool_name:a.tool_name||void 0,input_mapping:B(a.input_mapping)??{},execute_as:a.execute_as||void 0,enabled:a.enabled}))}function B(s){if(s.trim())try{return JSON.parse(s)}catch{return}}function Pe(s,a,r,o){let x;try{x=JSON.parse(s)}catch{x={}}const m=o.includes(a),i=r===""||r===void 0||r===null||Array.isArray(r)&&r.length===0||r==="[]";if(!m&&i){const{[a]:p,...l}=x;return JSON.stringify(l,null,2)}let u=r;if(typeof r=="string")try{const p=JSON.parse(r);Array.isArray(p)&&(u=p)}catch{}return JSON.stringify({...x,[a]:u},null,2)}const S="section-header mt-[3em] first:mt-0",P="label",_="hint",A="input",L="input-json w-full";function Ie({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:identity"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Identity",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Name *"}),e.jsx("input",{type:"text",value:s.name,onChange:r=>a("name",r.target.value),placeholder:"health-monitor",className:A}),e.jsx("p",{className:_,children:"Lowercase, kebab-case. This appears everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:r=>a("description",r.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:A}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function We({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:motivation"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Motivation",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Goals"}),e.jsx("textarea",{value:s.goals,onChange:r=>a("goals",r.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Primary motivation. What the automation is trying to achieve."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Rules"}),e.jsx("textarea",{value:s.rules,onChange:r=>a("rules",r.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Te({form:s,set:a}){const{data:r}=Ne(),o=(r==null?void 0:r.domains)??[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Assign a knowledge domain — the automation's memory. It stores context here over time."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:knowledge"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Knowledge",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Knowledge Domain"}),e.jsx("input",{type:"text",value:s.knowledge_domain,onChange:x=>a("knowledge_domain",x.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:A,list:"domain-suggestions"}),e.jsx("datalist",{id:"domain-suggestions",children:o.map(x=>e.jsx("option",{value:x.domain},x.domain))}),e.jsx("p",{className:_,children:"Choose an existing domain to share memory, or type a new name to create one."})]}),o.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Existing Domains"}),e.jsx("div",{className:"space-y-0.5 mt-2",children:o.map(x=>e.jsxs("button",{type:"button",onClick:()=>a("knowledge_domain",x.domain),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${s.knowledge_domain===x.domain?"border-l-2 border-l-accent bg-accent/5":"hover:bg-surface-hover border-l-2 border-l-transparent"}`,children:[e.jsx(K,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary flex-1",children:x.domain}),e.jsxs("span",{className:"text-2xs text-text-quaternary",children:[x.count," entries"]}),e.jsx("span",{className:"text-2xs text-text-quaternary",children:e.jsx(fe,{date:x.latest})})]},x.domain))})]})]})}function Me({serverId:s,toolName:a,onChange:r}){const{data:o}=se(),x=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[m,i]=f.useState(!1),[u,p]=f.useState(""),l=f.useRef(null),h=f.useRef(null);f.useEffect(()=>{if(!m)return;function t(n){h.current&&!h.current.contains(n.target)&&i(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[m]);const c=a?`${a}`:"",d=m?u:c,y=f.useMemo(()=>{const t=(m?u:"").toLowerCase();return t?x.filter(n=>n.name.toLowerCase().includes(t)||n.serverName.toLowerCase().includes(t)||(n.description??"").toLowerCase().includes(t)):x},[x,u,m]),v=a?x.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsx("input",{ref:l,type:"text",value:d,onFocus:()=>{i(!0),p(c)},onChange:t=>{const n=t.target.value;p(n),n||r("",""),m||i(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!m&&(v==null?void 0:v.description)&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-1 italic",children:v.description}),m&&y.length>0&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:y.map(t=>e.jsxs("button",{type:"button",onClick:()=>{r(t.serverId,t.name),p(t.name),i(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===t.serverId&&a===t.name?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-2xs font-mono text-text-primary shrink-0",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-2xs font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(je,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),m&&y.length===0&&u&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center",children:e.jsxs("p",{className:"text-2xs text-text-quaternary",children:['No capabilities match "',u,'"']})})]})}const Le={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Je=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:r,onWorkflowTypeChange:o,pipelineId:x,onPipelineIdChange:m,serverId:i,toolName:u,onCapabilityChange:p,mcpPrompt:l,onMcpPromptChange:h,availableTypes:c=[...Je]}){const{data:d}=ve(),y=(d??[]).filter(n=>n.invocable).map(n=>n.workflow_type),{data:v}=_e({status:"active"}),t=((v==null?void 0:v.workflows)??[]).map(n=>({id:n.id,name:n.graph_topic||n.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:c.map(n=>{const b=s===n;return e.jsx("button",{type:"button",onClick:()=>a(n),className:`px-3 py-1.5 text-2xs font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Le[n]},n)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:r,onChange:n=>o(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),y.map(n=>e.jsx("option",{value:n,children:n},n))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:x,onChange:n=>m(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(Me,{serverId:i,toolName:u,onChange:p})]}),s==="mcp_query"&&h&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:l??"",onChange:n=>h(n.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Fe={task:"bg-status-active/10 text-status-active",workflow:"bg-accent/15 text-accent",escalation:"bg-status-warning/10 text-status-warning",activity:"bg-status-active/10 text-status-active",knowledge:"bg-accent/10 text-accent",file:"bg-status-draft/10 text-status-draft",agent:"bg-status-success/10 text-status-success",app:"bg-status-error/10 text-status-error",milestone:"bg-accent/10 text-accent"};function De({form:s,set:a}){const{data:r}=ke({limit:200}),{data:o}=se(),x=(r==null?void 0:r.topics)??[],m=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[i,u]=f.useState(0),p=(t,n,b)=>{const g=[...s.subscriptions];g[t]={...g[t],[n]:b},a("subscriptions",g)},l=()=>{a("subscriptions",[...s.subscriptions,{...Oe}]),u(s.subscriptions.length)},h=t=>{a("subscriptions",s.subscriptions.filter((n,b)=>b!==t)),i>=s.subscriptions.length-1&&u(Math.max(0,s.subscriptions.length-2))},c=s.subscriptions,d=c[i],y=t=>t.topic?t.reaction_type==="durable"?!!t.workflow_type:t.reaction_type==="pipeline"?!!t.pipeline_id:t.reaction_type==="mcp_query"?!!t.mcp_prompt:t.reaction_type==="capability"?!!t.server_id&&!!t.tool_name:!1:!1,v=d?x.find(t=>t.topic===d.topic):void 0;return c.length===0?e.jsxs("div",{className:"max-w-xl",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(U,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"}),e.jsx("p",{className:"text-2xs text-text-quaternary max-w-sm mb-6",children:"Each subscription listens for a topic pattern and runs a workflow when it matches."}),e.jsxs("button",{onClick:l,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Add first subscription"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-52 shrink-0 space-y-0.5",children:[c.map((t,n)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${i===n?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>u(n),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${y(t)?"bg-status-success":"bg-surface-border"}`}),e.jsx("span",{className:"text-2xs font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-2xs text-text-quaternary ml-3",children:["→ ",t.workflow_type||t.tool_name||t.reaction_type]})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove subscription "${t.topic||"new"}"?
1
+ import{j as e,a as f}from"./vendor-query-DvWWuNIB.js";import{a as ce,d as le,b as oe}from"./agents-BT-sEk81.js";import{E as de,C as xe,u as pe,a as ue,b as me,c as he}from"./CronLabel-C9SkawB-.js";import{g as fe,a as ve,c as be,y as ye}from"./index-BUYokcrl.js";import{P as ge}from"./PageHeader-CMd3f4bz.js";import{x as E,o as K,K as je,R as U,g as M,z as Z,ax as Y,f as V,bX as ee,ab as we}from"./vendor-icons-CeVtUKyP.js";import{g as Ne}from"./knowledge-BhW8V-Hq.js";import{R as te}from"./RunAsSelector-6BLScYTX.js";import{u as _e}from"./yaml-workflows-DeRWqMGk.js";import{u as se}from"./capabilities-Bc-nJk6y.js";import{u as ke}from"./topics-Blft0I1L.js";import{W as Q}from"./WorkflowPill-Dg7BDTyM.js";import{e as Ce,u as Se,f as qe}from"./vendor-react-_9U4mKFr.js";import"./BotPicker-C3LR6Sqy.js";import"./bots-DRoAdLek.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Oe={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},Ae={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,x,m;const r=(x=(o=s.behaviors)==null?void 0:o.schedules)!=null&&x.length?s.behaviors.schedules.map(i=>({cron:i.cron||"",reaction_type:i.reaction_type||"durable",workflow_type:i.workflow_type||"",pipeline_id:i.pipeline_id||"",server_id:i.server_id||"",tool_name:i.tool_name||"",envelope:i.envelope?JSON.stringify(i.envelope,null,2):"{}",execute_as:i.execute_as||""})):(m=s.behaviors)!=null&&m.cron?[{cron:s.behaviors.cron,reaction_type:"durable",workflow_type:s.workflow_type??"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""}]:[];return{name:s.id,description:s.description??"",goals:s.goals??"",rules:s.rules??"",user_id:s.user_id??"",knowledge_domain:s.knowledge_domain??"",subscriptions:a.map(i=>({id:i.id,topic:i.topic,filter:i.filter?JSON.stringify(i.filter,null,2):"",reaction_type:i.reaction_type,workflow_type:i.workflow_type??"",pipeline_id:i.pipeline_id??"",mcp_prompt:i.mcp_prompt??"",server_id:i.server_id??"",tool_name:i.tool_name??"",input_mapping:JSON.stringify(i.input_mapping??{},null,2),execute_as:i.execute_as??"",enabled:i.enabled})),schedules:r}}function Ee(s){var r;const a={};return s.schedules.length>0&&(a.schedules=s.schedules.map(o=>({cron:o.cron,reaction_type:o.reaction_type||"durable",workflow_type:o.reaction_type==="pipeline"?void 0:o.workflow_type,pipeline_id:o.reaction_type==="pipeline"?o.pipeline_id:void 0,envelope:B(o.envelope)??{},execute_as:o.execute_as||void 0})),a.cron=s.schedules[0].cron),{id:s.name,description:s.description||void 0,goals:s.goals||void 0,rules:s.rules||void 0,user_id:s.user_id||void 0,knowledge_domain:s.knowledge_domain||void 0,behaviors:a,workflow_type:((r=s.schedules[0])==null?void 0:r.workflow_type)||void 0,pipeline_id:void 0}}function $e(s){return s.subscriptions.map(a=>({id:a.id,topic:a.topic,filter:a.filter?B(a.filter):void 0,reaction_type:a.reaction_type,workflow_type:a.workflow_type||void 0,pipeline_id:a.pipeline_id||void 0,mcp_prompt:a.mcp_prompt||void 0,server_id:a.server_id||void 0,tool_name:a.tool_name||void 0,input_mapping:B(a.input_mapping)??{},execute_as:a.execute_as||void 0,enabled:a.enabled}))}function B(s){if(s.trim())try{return JSON.parse(s)}catch{return}}function Pe(s,a,r,o){let x;try{x=JSON.parse(s)}catch{x={}}const m=o.includes(a),i=r===""||r===void 0||r===null||Array.isArray(r)&&r.length===0||r==="[]";if(!m&&i){const{[a]:p,...l}=x;return JSON.stringify(l,null,2)}let u=r;if(typeof r=="string")try{const p=JSON.parse(r);Array.isArray(p)&&(u=p)}catch{}return JSON.stringify({...x,[a]:u},null,2)}const S="section-header mt-[3em] first:mt-0",P="label",_="hint",A="input",L="input-json w-full";function Ie({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:identity"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Identity",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Name *"}),e.jsx("input",{type:"text",value:s.name,onChange:r=>a("name",r.target.value),placeholder:"health-monitor",className:A}),e.jsx("p",{className:_,children:"Lowercase, kebab-case. This appears everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:r=>a("description",r.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:A}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function We({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:motivation"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Motivation",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Goals"}),e.jsx("textarea",{value:s.goals,onChange:r=>a("goals",r.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Primary motivation. What the automation is trying to achieve."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Rules"}),e.jsx("textarea",{value:s.rules,onChange:r=>a("rules",r.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Te({form:s,set:a}){const{data:r}=Ne(),o=(r==null?void 0:r.domains)??[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Assign a knowledge domain — the automation's memory. It stores context here over time."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:knowledge"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Knowledge",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Knowledge Domain"}),e.jsx("input",{type:"text",value:s.knowledge_domain,onChange:x=>a("knowledge_domain",x.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:A,list:"domain-suggestions"}),e.jsx("datalist",{id:"domain-suggestions",children:o.map(x=>e.jsx("option",{value:x.domain},x.domain))}),e.jsx("p",{className:_,children:"Choose an existing domain to share memory, or type a new name to create one."})]}),o.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Existing Domains"}),e.jsx("div",{className:"space-y-0.5 mt-2",children:o.map(x=>e.jsxs("button",{type:"button",onClick:()=>a("knowledge_domain",x.domain),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${s.knowledge_domain===x.domain?"border-l-2 border-l-accent bg-accent/5":"hover:bg-surface-hover border-l-2 border-l-transparent"}`,children:[e.jsx(K,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary flex-1",children:x.domain}),e.jsxs("span",{className:"text-2xs text-text-quaternary",children:[x.count," entries"]}),e.jsx("span",{className:"text-2xs text-text-quaternary",children:e.jsx(fe,{date:x.latest})})]},x.domain))})]})]})}function Me({serverId:s,toolName:a,onChange:r}){const{data:o}=se(),x=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[m,i]=f.useState(!1),[u,p]=f.useState(""),l=f.useRef(null),h=f.useRef(null);f.useEffect(()=>{if(!m)return;function t(n){h.current&&!h.current.contains(n.target)&&i(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[m]);const c=a?`${a}`:"",d=m?u:c,y=f.useMemo(()=>{const t=(m?u:"").toLowerCase();return t?x.filter(n=>n.name.toLowerCase().includes(t)||n.serverName.toLowerCase().includes(t)||(n.description??"").toLowerCase().includes(t)):x},[x,u,m]),v=a?x.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsx("input",{ref:l,type:"text",value:d,onFocus:()=>{i(!0),p(c)},onChange:t=>{const n=t.target.value;p(n),n||r("",""),m||i(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!m&&(v==null?void 0:v.description)&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-1 italic",children:v.description}),m&&y.length>0&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:y.map(t=>e.jsxs("button",{type:"button",onClick:()=>{r(t.serverId,t.name),p(t.name),i(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===t.serverId&&a===t.name?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-2xs font-mono text-text-primary shrink-0",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-2xs font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(je,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),m&&y.length===0&&u&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center",children:e.jsxs("p",{className:"text-2xs text-text-quaternary",children:['No capabilities match "',u,'"']})})]})}const Le={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Je=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:r,onWorkflowTypeChange:o,pipelineId:x,onPipelineIdChange:m,serverId:i,toolName:u,onCapabilityChange:p,mcpPrompt:l,onMcpPromptChange:h,availableTypes:c=[...Je]}){const{data:d}=ve(),y=(d??[]).filter(n=>n.invocable).map(n=>n.workflow_type),{data:v}=_e({status:"active"}),t=((v==null?void 0:v.workflows)??[]).map(n=>({id:n.id,name:n.graph_topic||n.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:c.map(n=>{const b=s===n;return e.jsx("button",{type:"button",onClick:()=>a(n),className:`px-3 py-1.5 text-2xs font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Le[n]},n)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:r,onChange:n=>o(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),y.map(n=>e.jsx("option",{value:n,children:n},n))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:x,onChange:n=>m(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(Me,{serverId:i,toolName:u,onChange:p})]}),s==="mcp_query"&&h&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:l??"",onChange:n=>h(n.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Fe={task:"bg-status-active/10 text-status-active",workflow:"bg-accent/15 text-accent",escalation:"bg-status-warning/10 text-status-warning",activity:"bg-status-active/10 text-status-active",knowledge:"bg-accent/10 text-accent",file:"bg-status-draft/10 text-status-draft",agent:"bg-status-success/10 text-status-success",app:"bg-status-error/10 text-status-error",milestone:"bg-accent/10 text-accent"};function De({form:s,set:a}){const{data:r}=ke({limit:200}),{data:o}=se(),x=(r==null?void 0:r.topics)??[],m=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[i,u]=f.useState(0),p=(t,n,b)=>{const g=[...s.subscriptions];g[t]={...g[t],[n]:b},a("subscriptions",g)},l=()=>{a("subscriptions",[...s.subscriptions,{...Oe}]),u(s.subscriptions.length)},h=t=>{a("subscriptions",s.subscriptions.filter((n,b)=>b!==t)),i>=s.subscriptions.length-1&&u(Math.max(0,s.subscriptions.length-2))},c=s.subscriptions,d=c[i],y=t=>t.topic?t.reaction_type==="durable"?!!t.workflow_type:t.reaction_type==="pipeline"?!!t.pipeline_id:t.reaction_type==="mcp_query"?!!t.mcp_prompt:t.reaction_type==="capability"?!!t.server_id&&!!t.tool_name:!1:!1,v=d?x.find(t=>t.topic===d.topic):void 0;return c.length===0?e.jsxs("div",{className:"max-w-xl",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(U,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"}),e.jsx("p",{className:"text-2xs text-text-quaternary max-w-sm mb-6",children:"Each subscription listens for a topic pattern and runs a workflow when it matches."}),e.jsxs("button",{onClick:l,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Add first subscription"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-52 shrink-0 space-y-0.5",children:[c.map((t,n)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${i===n?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>u(n),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${y(t)?"bg-status-success":"bg-surface-border"}`}),e.jsx("span",{className:"text-2xs font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-2xs text-text-quaternary ml-3",children:["→ ",t.workflow_type||t.tool_name||t.reaction_type]})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove subscription "${t.topic||"new"}"?
2
2
 
3
3
  This takes effect when you save.`)&&h(n)},className:"opacity-0 group-hover/sub:opacity-100 px-2 text-text-quaternary hover:text-status-error transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},n)),e.jsxs("button",{onClick:l,className:"w-full flex items-center gap-1.5 px-3 py-2 text-2xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3 h-3"})," Add"]})]}),d&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"When this event fires"}),e.jsx(Ke,{value:d.topic,onChange:t=>p(i,"topic",t),topics:x}),(v==null?void 0:v.payload_schema)&&e.jsxs("div",{className:"mt-3 p-3 rounded-md bg-surface-sunken border border-surface-border",children:[e.jsx("p",{className:"text-2xs text-text-quaternary mb-1 uppercase tracking-wider font-medium",children:"Payload Schema"}),e.jsx("pre",{className:"text-2xs font-mono text-text-secondary whitespace-pre-wrap overflow-x-auto max-h-40",children:JSON.stringify(v.payload_schema.properties??v.payload_schema,null,2)}),v.description&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-2 italic",children:v.description})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:d.reaction_type,onReactionTypeChange:t=>p(i,"reaction_type",t),workflowType:d.workflow_type,onWorkflowTypeChange:t=>p(i,"workflow_type",t),pipelineId:d.pipeline_id,onPipelineIdChange:t=>p(i,"pipeline_id",t),serverId:d.server_id,toolName:d.tool_name,onCapabilityChange:(t,n)=>{var $;const b=[...s.subscriptions],g={...b[i],server_id:t,tool_name:n},k=m.find(q=>q.serverId===t&&q.name===n),R=($=k==null?void 0:k.inputSchema)==null?void 0:$.properties;if(R&&n){const q={};for(const w of Object.keys(R))w.startsWith("_")||(q[w]=`{event.data.${w}}`);g.input_mapping=JSON.stringify(q,null,2)}b[i]=g,a("subscriptions",b)},mcpPrompt:d.mcp_prompt,onMcpPromptChange:t=>p(i,"mcp_prompt",t)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:d.execute_as,onChange:t=>p(i,"execute_as",t)}),e.jsx("p",{className:_,children:"Identity used when invoking the workflow."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"But only if"}),e.jsx("input",{type:"text",value:d.filter,onChange:t=>p(i,"filter",t.target.value),placeholder:'{"extension": "png"}',className:`${A} font-mono text-xs`}),e.jsx("p",{className:_,children:"JSON filter against event.data. Click an operator to insert:"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:[{label:"equals",value:'{"key": "val"}'},{label:"not equal",value:'{"key": {"$ne": "val"}}'},{label:"in list",value:'{"key": {"$in": ["a", "b"]}}'},{label:"exists",value:'{"key": {"$exists": true}}'}].map(t=>e.jsx("button",{type:"button",onClick:()=>p(i,"filter",t.value),className:"px-2 py-0.5 text-2xs font-mono rounded bg-accent/8 text-accent hover:bg-accent/15 transition-colors",children:t.label},t.label))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),d.reaction_type==="capability"&&d.tool_name?e.jsx(ze,{tool:m.find(t=>t.serverId===d.server_id&&t.name===d.tool_name),value:d.input_mapping,onChange:t=>p(i,"input_mapping",t),eventSchema:v==null?void 0:v.payload_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:d.input_mapping,onChange:t=>p(i,"input_mapping",t.target.value),rows:10,className:L,placeholder:`{
4
4
  "data": {
@@ -13,4 +13,4 @@ This takes effect when you save.`)&&h(n)},className:"opacity-0 group-hover/sub:o
13
13
  This takes effect when you save.`)&&i(h)},className:"opacity-0 group-hover/sched:opacity-100 px-2 text-text-quaternary hover:text-status-error transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},h)),e.jsxs("button",{onClick:m,className:"w-full flex items-center gap-1.5 px-3 py-2 text-2xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3 h-3"})," Add"]})]}),p&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run every"}),e.jsx("input",{type:"text",value:p.cron,onChange:l=>x(r,"cron",l.target.value),placeholder:"0 * * * *",className:`${A} font-mono`}),p.cron&&e.jsx("p",{className:"text-2xs text-accent/80 mt-1",children:z(p.cron)}),e.jsx("div",{className:"flex gap-3 mt-2 overflow-x-auto",children:Ue.map(l=>e.jsx("button",{type:"button",onClick:()=>x(r,"cron",l),className:`text-2xs font-mono whitespace-nowrap transition-colors ${p.cron===l?"text-accent font-medium":"text-accent/50 hover:text-accent"}`,children:z(l)},l))})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:p.reaction_type,onReactionTypeChange:l=>x(r,"reaction_type",l),workflowType:p.workflow_type,onWorkflowTypeChange:l=>x(r,"workflow_type",l),pipelineId:p.pipeline_id,onPipelineIdChange:l=>x(r,"pipeline_id",l),serverId:p.server_id,toolName:p.tool_name,onCapabilityChange:(l,h)=>{x(r,"server_id",l),x(r,"tool_name",h)},availableTypes:["durable","pipeline","capability"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:p.execute_as,onChange:l=>x(r,"execute_as",l)}),e.jsx("p",{className:_,children:"Identity used when invoking."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),e.jsx("textarea",{value:p.envelope,onChange:l=>x(r,"envelope",l.target.value),rows:10,className:L,placeholder:`{
14
14
  "data": { "source": "cron" }
15
15
  }`}),e.jsx("p",{className:_,children:"Static payload passed to the workflow on each invocation."})]})]})]})]})}function W({icon:s,color:a,title:r,children:o}){return e.jsxs("div",{className:"mb-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 pb-1.5 border-b border-surface-border/40",children:[e.jsx(s,{className:`w-3.5 h-3.5 ${a}`,strokeWidth:1.5}),e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-widest text-accent/80",children:r})]}),e.jsx("div",{className:"pl-5.5",children:o})]})}function T({label:s,children:a}){return e.jsxs("div",{className:"flex gap-3 py-0.5",children:[e.jsx("span",{className:"text-2xs text-text-quaternary w-20 shrink-0",children:s}),e.jsx("span",{className:"text-xs text-text-primary",children:a})]})}function Ge({form:s}){return e.jsxs("div",{children:[e.jsxs(W,{icon:V,color:"text-accent",title:"Identity",children:[e.jsx(T,{label:"Name",children:s.name||"—"}),s.description&&e.jsx(T,{label:"Description",children:s.description})]}),(s.goals||s.rules)&&e.jsxs(W,{icon:ee,color:"text-accent",title:"Motivation",children:[s.goals&&e.jsx(T,{label:"Goals",children:s.goals}),s.rules&&e.jsx(T,{label:"Rules",children:s.rules})]}),e.jsx(W,{icon:K,color:"text-accent",title:"Knowledge",children:e.jsx(T,{label:"Domain",children:s.knowledge_domain||"None"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-10",children:[e.jsx(W,{icon:U,color:"text-accent",title:`Subscriptions (${s.subscriptions.length})`,children:s.subscriptions.length===0?e.jsx("span",{className:"text-2xs text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.subscriptions.map((a,r)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(de,{topic:a.topic||"unset"})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-2xs",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-2xs text-text-quaternary",children:a.reaction_type})]})]},r))})}),e.jsx(W,{icon:Y,color:"text-accent",title:`Schedules (${s.schedules.length})`,children:s.schedules.length===0?e.jsx("span",{className:"text-2xs text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.schedules.map((a,r)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(xe,{cron:a.cron})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-2xs",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-2xs text-text-quaternary",children:"no workflow"})]})]},r))})})]}),e.jsx("div",{className:"border-l-2 border-status-success/30 pl-3 py-2 mt-6",children:e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"After saving, subscriptions and schedules activate immediately. You can pause the automation anytime."})})]})}const He=[{id:1,label:"Identity",icon:V},{id:2,label:"Motivation",icon:ee},{id:3,label:"Knowledge",icon:K},{id:4,label:"Subscriptions",icon:U},{id:5,label:"Schedules",icon:Y},{id:6,label:"Review",icon:we}];function xt(){var H;const{id:s}=Ce(),a=!s,r=Se(),{data:o}=be(),x=ye(),i=(x!==null?x:!!((H=o==null?void 0:o.ai)!=null&&H.enabled))?"Agent":"Automation",{data:u,isLoading:p}=ce(a?null:s),{data:l}=pe(a?null:s),h=le(),c=oe(),d=ue(),y=me(),v=he(),[t,n]=f.useState(X),[b,g]=f.useState(!1),[k,R]=f.useState(""),[$,q]=qe(),w=parseInt($.get("step")||"1",10),ne=f.useCallback(j=>{q(N=>{const O=new URLSearchParams(N);return O.set("step",String(j)),O},{replace:!0})},[q]);f.useEffect(()=>{if(!b){if(a){n(X),g(!0);return}u&&l&&(n(Re(u,l.subscriptions??[])),g(!0))}},[u,l,a,b]);const I=(j,N)=>n(O=>({...O,[j]:N})),ie=async()=>{R("");try{const j=Ee(t);let N=s;a?N=(await h.mutateAsync(j)).id:await c.mutateAsync({id:s,...j});const O=$e(t),re=(l==null?void 0:l.subscriptions)??[],J=new Set(re.map(C=>C.id));for(const C of O)if(C.id&&J.has(C.id)){const{id:F,...D}=C;await y.mutateAsync({agentId:N,subId:F,...D}),J.delete(F)}else{const{id:F,...D}=C;await d.mutateAsync({agentId:N,...D})}for(const C of J)await v.mutateAsync({agentId:N,subId:C});r(`/agents/${N}`)}catch(j){R(j.message)}};if(!a&&p)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-60 bg-surface-sunken rounded"})]});const G=h.isPending||c.isPending;return e.jsxs("div",{children:[e.jsx(ge,{title:a?`New ${i}`:`${i}: ${(u==null?void 0:u.id)??""}`,docsHash:"#docs:agents.md"}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:He.map(j=>{const N=j.icon,O=w===j.id;return e.jsxs("button",{onClick:()=>ne(j.id),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${O?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(N,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:j.label})]},j.id)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:ie,disabled:!t.name.trim()||G,className:"w-full btn-primary text-xs disabled:opacity-50",children:G?"Saving...":a?`Create ${i}`:"Save"}),e.jsx("button",{onClick:()=>r(a?"/agents":`/agents/${s}`),className:"w-full btn-ghost text-xs",children:"Cancel"})]}),k&&e.jsx("p",{className:"text-xs text-status-error mt-3",children:k})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2",children:[w===1&&e.jsx(Ie,{form:t,set:I}),w===2&&e.jsx(We,{form:t,set:I}),w===3&&e.jsx(Te,{form:t,set:I}),w===4&&e.jsx(De,{form:t,set:I}),w===5&&e.jsx(Ye,{form:t,set:I}),w===6&&e.jsx(Ge,{form:t})]})]})]})}export{xt as AgentConfigPage};
16
- //# sourceMappingURL=AgentConfigPage-DetU4HZe.js.map
16
+ //# sourceMappingURL=AgentConfigPage-BoQhRW6U.js.map