@hotmeshio/long-tail 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/build/api/escalations/claim.d.ts +4 -1
  2. package/build/api/escalations/claim.js +6 -2
  3. package/build/index.js +4 -0
  4. package/build/routes/escalations/single.js +3 -1
  5. package/build/sdk/index.d.ts +1 -0
  6. package/build/services/escalation/crud.d.ts +10 -2
  7. package/build/services/escalation/crud.js +20 -12
  8. package/dashboard/dist/assets/{AdminDashboard-DeZsR4pA.js → AdminDashboard-C4h1R-lz.js} +2 -2
  9. package/dashboard/dist/assets/{AdminDashboard-DeZsR4pA.js.map → AdminDashboard-C4h1R-lz.js.map} +1 -1
  10. package/dashboard/dist/assets/{AgentConfigPage-Bi5ZAsjf.js → AgentConfigPage-EWC8VQ7R.js} +2 -2
  11. package/dashboard/dist/assets/{AgentConfigPage-Bi5ZAsjf.js.map → AgentConfigPage-EWC8VQ7R.js.map} +1 -1
  12. package/dashboard/dist/assets/{AgentDetailPage-CIbKor5E.js → AgentDetailPage-DaLfa80d.js} +2 -2
  13. package/dashboard/dist/assets/{AgentDetailPage-CIbKor5E.js.map → AgentDetailPage-DaLfa80d.js.map} +1 -1
  14. package/dashboard/dist/assets/{AgentsPage-CRFZ6KDu.js → AgentsPage-islj_zrh.js} +2 -2
  15. package/dashboard/dist/assets/{AgentsPage-CRFZ6KDu.js.map → AgentsPage-islj_zrh.js.map} +1 -1
  16. package/dashboard/dist/assets/{AvailableEscalationsPage-DDsmXjpi.js → AvailableEscalationsPage-B8NjwwKQ.js} +2 -2
  17. package/dashboard/dist/assets/{AvailableEscalationsPage-DDsmXjpi.js.map → AvailableEscalationsPage-B8NjwwKQ.js.map} +1 -1
  18. package/dashboard/dist/assets/{BotPicker-dUpw1wW6.js → BotPicker-CnX8xfka.js} +2 -2
  19. package/dashboard/dist/assets/{BotPicker-dUpw1wW6.js.map → BotPicker-CnX8xfka.js.map} +1 -1
  20. package/dashboard/dist/assets/{CapabilitiesPage-Ca2jEln-.js → CapabilitiesPage-DK7wGMFt.js} +2 -2
  21. package/dashboard/dist/assets/{CapabilitiesPage-Ca2jEln-.js.map → CapabilitiesPage-DK7wGMFt.js.map} +1 -1
  22. package/dashboard/dist/assets/{CollapsibleSection-BXlR5QmW.js → CollapsibleSection-WqEpMTyx.js} +2 -2
  23. package/dashboard/dist/assets/{CollapsibleSection-BXlR5QmW.js.map → CollapsibleSection-WqEpMTyx.js.map} +1 -1
  24. package/dashboard/dist/assets/{CountdownTimer-rnoWmFqx.js → CountdownTimer-BvQw_3WJ.js} +2 -2
  25. package/dashboard/dist/assets/{CountdownTimer-rnoWmFqx.js.map → CountdownTimer-BvQw_3WJ.js.map} +1 -1
  26. package/dashboard/dist/assets/{CredentialsPage-CGyCCzGh.js → CredentialsPage-CfT60FiU.js} +2 -2
  27. package/dashboard/dist/assets/{CredentialsPage-CGyCCzGh.js.map → CredentialsPage-CfT60FiU.js.map} +1 -1
  28. package/dashboard/dist/assets/{CronLabel-CAu2hmQf.js → CronLabel-ds7dLz6S.js} +2 -2
  29. package/dashboard/dist/assets/{CronLabel-CAu2hmQf.js.map → CronLabel-ds7dLz6S.js.map} +1 -1
  30. package/dashboard/dist/assets/{CustomDurationPicker-hlnadaFt.js → CustomDurationPicker-D-iY1f4n.js} +2 -2
  31. package/dashboard/dist/assets/{CustomDurationPicker-hlnadaFt.js.map → CustomDurationPicker-D-iY1f4n.js.map} +1 -1
  32. package/dashboard/dist/assets/{ElapsedCell-B1eoCzEw.js → ElapsedCell-DRQhFky_.js} +2 -2
  33. package/dashboard/dist/assets/{ElapsedCell-B1eoCzEw.js.map → ElapsedCell-DRQhFky_.js.map} +1 -1
  34. package/dashboard/dist/assets/{EntityTimelinePanel-CIOyjwjM.js → EntityTimelinePanel-nCgWdmpK.js} +2 -2
  35. package/dashboard/dist/assets/{EntityTimelinePanel-CIOyjwjM.js.map → EntityTimelinePanel-nCgWdmpK.js.map} +1 -1
  36. package/dashboard/dist/assets/{EscalationListSchemaPage-DQNQ7o_4.js → EscalationListSchemaPage-DBCnPMG9.js} +2 -2
  37. package/dashboard/dist/assets/{EscalationListSchemaPage-DQNQ7o_4.js.map → EscalationListSchemaPage-DBCnPMG9.js.map} +1 -1
  38. package/dashboard/dist/assets/{EscalationSchemaPage-DFgDn4R3.js → EscalationSchemaPage-DfzRTqhV.js} +2 -2
  39. package/dashboard/dist/assets/{EscalationSchemaPage-DFgDn4R3.js.map → EscalationSchemaPage-DfzRTqhV.js.map} +1 -1
  40. package/dashboard/dist/assets/{EscalationsOverview-DfbKtXVZ.js → EscalationsOverview-CWd2Ivso.js} +2 -2
  41. package/dashboard/dist/assets/{EscalationsOverview-DfbKtXVZ.js.map → EscalationsOverview-CWd2Ivso.js.map} +1 -1
  42. package/dashboard/dist/assets/{EventTable-CZPkvhao.js → EventTable-Dm9Fbab1.js} +2 -2
  43. package/dashboard/dist/assets/{EventTable-CZPkvhao.js.map → EventTable-Dm9Fbab1.js.map} +1 -1
  44. package/dashboard/dist/assets/{FilterBar-CYjKK9Cp.js → FilterBar-DR4cJvTB.js} +2 -2
  45. package/dashboard/dist/assets/{FilterBar-CYjKK9Cp.js.map → FilterBar-DR4cJvTB.js.map} +1 -1
  46. package/dashboard/dist/assets/{GraphInvokePage-DY9u42vt.js → GraphInvokePage-DQt64Ru0.js} +2 -2
  47. package/dashboard/dist/assets/{GraphInvokePage-DY9u42vt.js.map → GraphInvokePage-DQt64Ru0.js.map} +1 -1
  48. package/dashboard/dist/assets/{HomePage-p_CYlGnh.js → HomePage-D7qNiqtw.js} +2 -2
  49. package/dashboard/dist/assets/{HomePage-p_CYlGnh.js.map → HomePage-D7qNiqtw.js.map} +1 -1
  50. package/dashboard/dist/assets/{ListToolbar-Dz-1RXSH.js → ListToolbar-BdZkpRMo.js} +2 -2
  51. package/dashboard/dist/assets/{ListToolbar-Dz-1RXSH.js.map → ListToolbar-BdZkpRMo.js.map} +1 -1
  52. package/dashboard/dist/assets/{McpOverview-BUI9sVTk.js → McpOverview-DHAEYY1b.js} +2 -2
  53. package/dashboard/dist/assets/{McpOverview-BUI9sVTk.js.map → McpOverview-DHAEYY1b.js.map} +1 -1
  54. package/dashboard/dist/assets/{McpQueryDetailPage-CVN_UAB3.js → McpQueryDetailPage-BfGhRO_c.js} +2 -2
  55. package/dashboard/dist/assets/{McpQueryDetailPage-CVN_UAB3.js.map → McpQueryDetailPage-BfGhRO_c.js.map} +1 -1
  56. package/dashboard/dist/assets/{McpQueryPage-DRTKSPDR.js → McpQueryPage-3EXLX1Eq.js} +2 -2
  57. package/dashboard/dist/assets/{McpQueryPage-DRTKSPDR.js.map → McpQueryPage-3EXLX1Eq.js.map} +1 -1
  58. package/dashboard/dist/assets/{McpRunDetailPage-CTb1AxR3.js → McpRunDetailPage-DHI0F65P.js} +2 -2
  59. package/dashboard/dist/assets/{McpRunDetailPage-CTb1AxR3.js.map → McpRunDetailPage-DHI0F65P.js.map} +1 -1
  60. package/dashboard/dist/assets/{McpRunsPage-BWLwjVd0.js → McpRunsPage-C6-KpYCY.js} +2 -2
  61. package/dashboard/dist/assets/{McpRunsPage-BWLwjVd0.js.map → McpRunsPage-C6-KpYCY.js.map} +1 -1
  62. package/dashboard/dist/assets/{OperationsPage-BSl_oUAJ.js → OperationsPage-BNW7uris.js} +2 -2
  63. package/dashboard/dist/assets/{OperationsPage-BSl_oUAJ.js.map → OperationsPage-BNW7uris.js.map} +1 -1
  64. package/dashboard/dist/assets/{OperatorDashboard-DGs9kPOZ.js → OperatorDashboard-DLp9gCTA.js} +2 -2
  65. package/dashboard/dist/assets/{OperatorDashboard-DGs9kPOZ.js.map → OperatorDashboard-DLp9gCTA.js.map} +1 -1
  66. package/dashboard/dist/assets/{PersonaDetailPage-C33MgXUY.js → PersonaDetailPage-DFv4Zwmq.js} +2 -2
  67. package/dashboard/dist/assets/{PersonaDetailPage-C33MgXUY.js.map → PersonaDetailPage-DFv4Zwmq.js.map} +1 -1
  68. package/dashboard/dist/assets/{PersonasPage-BbLOHq5X.js → PersonasPage-C52o87Zv.js} +2 -2
  69. package/dashboard/dist/assets/{PersonasPage-BbLOHq5X.js.map → PersonasPage-C52o87Zv.js.map} +1 -1
  70. package/dashboard/dist/assets/{ProcessDetailPage-zwd0HCJl.js → ProcessDetailPage-CKCxXogl.js} +2 -2
  71. package/dashboard/dist/assets/{ProcessDetailPage-zwd0HCJl.js.map → ProcessDetailPage-CKCxXogl.js.map} +1 -1
  72. package/dashboard/dist/assets/{ProcessesListPage-DnfmK6jf.js → ProcessesListPage-D1bxIy7-.js} +2 -2
  73. package/dashboard/dist/assets/{ProcessesListPage-DnfmK6jf.js.map → ProcessesListPage-D1bxIy7-.js.map} +1 -1
  74. package/dashboard/dist/assets/{RoleDetailPage-axZtFPC_.js → RoleDetailPage-_MrbOGW_.js} +2 -2
  75. package/dashboard/dist/assets/{RoleDetailPage-axZtFPC_.js.map → RoleDetailPage-_MrbOGW_.js.map} +1 -1
  76. package/dashboard/dist/assets/{RolesPage-DN6yqH7-.js → RolesPage-ZVCkB4iF.js} +2 -2
  77. package/dashboard/dist/assets/{RolesPage-DN6yqH7-.js.map → RolesPage-ZVCkB4iF.js.map} +1 -1
  78. package/dashboard/dist/assets/{RunAsSelector-DrGsUhL8.js → RunAsSelector-BAqa1Tya.js} +2 -2
  79. package/dashboard/dist/assets/{RunAsSelector-DrGsUhL8.js.map → RunAsSelector-BAqa1Tya.js.map} +1 -1
  80. package/dashboard/dist/assets/{ScanCodesPage-BmQjEyWZ.js → ScanCodesPage-b7WkFiy-.js} +2 -2
  81. package/dashboard/dist/assets/{ScanCodesPage-BmQjEyWZ.js.map → ScanCodesPage-b7WkFiy-.js.map} +1 -1
  82. package/dashboard/dist/assets/{ScanSchemeDetailPage-VODehqGs.js → ScanSchemeDetailPage-BCsEgS-s.js} +2 -2
  83. package/dashboard/dist/assets/{ScanSchemeDetailPage-VODehqGs.js.map → ScanSchemeDetailPage-BCsEgS-s.js.map} +1 -1
  84. package/dashboard/dist/assets/ScanStationPage-CPC9CdCR.js +2 -0
  85. package/dashboard/dist/assets/ScanStationPage-CPC9CdCR.js.map +1 -0
  86. package/dashboard/dist/assets/{StickyPagination-9VkHiOsT.js → StickyPagination-CgSzarlP.js} +2 -2
  87. package/dashboard/dist/assets/{StickyPagination-9VkHiOsT.js.map → StickyPagination-CgSzarlP.js.map} +1 -1
  88. package/dashboard/dist/assets/{StreamMessageDetail-C37J6Qyz.js → StreamMessageDetail-B4E3S5RB.js} +2 -2
  89. package/dashboard/dist/assets/{StreamMessageDetail-C37J6Qyz.js.map → StreamMessageDetail-B4E3S5RB.js.map} +1 -1
  90. package/dashboard/dist/assets/{SwimlaneTimeline-NVGsBIX-.js → SwimlaneTimeline-BkcjucMZ.js} +2 -2
  91. package/dashboard/dist/assets/{SwimlaneTimeline-NVGsBIX-.js.map → SwimlaneTimeline-BkcjucMZ.js.map} +1 -1
  92. package/dashboard/dist/assets/{TaskDetailPage-5sbMHi5U.js → TaskDetailPage-D7e8x2gX.js} +2 -2
  93. package/dashboard/dist/assets/{TaskDetailPage-5sbMHi5U.js.map → TaskDetailPage-D7e8x2gX.js.map} +1 -1
  94. package/dashboard/dist/assets/{TasksListPage-C9AN7IBb.js → TasksListPage-B4mxP9Ey.js} +2 -2
  95. package/dashboard/dist/assets/{TasksListPage-C9AN7IBb.js.map → TasksListPage-B4mxP9Ey.js.map} +1 -1
  96. package/dashboard/dist/assets/{TimeAgo-CsbQGlSd.js → TimeAgo-D6sbYsUO.js} +2 -2
  97. package/dashboard/dist/assets/{TimeAgo-CsbQGlSd.js.map → TimeAgo-D6sbYsUO.js.map} +1 -1
  98. package/dashboard/dist/assets/{TimestampCell-DlbIkV-G.js → TimestampCell-DFDf3NAT.js} +2 -2
  99. package/dashboard/dist/assets/{TimestampCell-DlbIkV-G.js.map → TimestampCell-DFDf3NAT.js.map} +1 -1
  100. package/dashboard/dist/assets/{ToolTestPanel-BKbLocvr.js → ToolTestPanel-DbWw0-Le.js} +2 -2
  101. package/dashboard/dist/assets/{ToolTestPanel-BKbLocvr.js.map → ToolTestPanel-DbWw0-Le.js.map} +1 -1
  102. package/dashboard/dist/assets/{TopicDetailPage-fOnTfDso.js → TopicDetailPage-C6CPcvuO.js} +2 -2
  103. package/dashboard/dist/assets/{TopicDetailPage-fOnTfDso.js.map → TopicDetailPage-C6CPcvuO.js.map} +1 -1
  104. package/dashboard/dist/assets/{TopicsPage-BoVkp7DM.js → TopicsPage-C8_XpeT2.js} +2 -2
  105. package/dashboard/dist/assets/{TopicsPage-BoVkp7DM.js.map → TopicsPage-C8_XpeT2.js.map} +1 -1
  106. package/dashboard/dist/assets/{UserName-0gjVPU_U.js → UserName-CIoJvf_e.js} +2 -2
  107. package/dashboard/dist/assets/{UserName-0gjVPU_U.js.map → UserName-CIoJvf_e.js.map} +1 -1
  108. package/dashboard/dist/assets/{WorkflowExecutionPage-B28OxTS_.js → WorkflowExecutionPage-Bq3kSkRr.js} +2 -2
  109. package/dashboard/dist/assets/{WorkflowExecutionPage-B28OxTS_.js.map → WorkflowExecutionPage-Bq3kSkRr.js.map} +1 -1
  110. package/dashboard/dist/assets/{WorkflowsDashboard-Bzvz6tTY.js → WorkflowsDashboard-y2L_zwnf.js} +2 -2
  111. package/dashboard/dist/assets/{WorkflowsDashboard-Bzvz6tTY.js.map → WorkflowsDashboard-y2L_zwnf.js.map} +1 -1
  112. package/dashboard/dist/assets/{WorkflowsOverview-BkcRU4Ej.js → WorkflowsOverview-ChE1Mm3P.js} +2 -2
  113. package/dashboard/dist/assets/{WorkflowsOverview-BkcRU4Ej.js.map → WorkflowsOverview-ChE1Mm3P.js.map} +1 -1
  114. package/dashboard/dist/assets/{YamlWorkflowDetailPage-CmM78sYi.js → YamlWorkflowDetailPage-D0aY_inb.js} +2 -2
  115. package/dashboard/dist/assets/{YamlWorkflowDetailPage-CmM78sYi.js.map → YamlWorkflowDetailPage-D0aY_inb.js.map} +1 -1
  116. package/dashboard/dist/assets/{YamlWorkflowsPage-Dp6vG1au.js → YamlWorkflowsPage-DJ0JitPs.js} +2 -2
  117. package/dashboard/dist/assets/{YamlWorkflowsPage-Dp6vG1au.js.map → YamlWorkflowsPage-DJ0JitPs.js.map} +1 -1
  118. package/dashboard/dist/assets/{agents-MeqzOPD6.js → agents-Bu5Ly_ER.js} +2 -2
  119. package/dashboard/dist/assets/{agents-MeqzOPD6.js.map → agents-Bu5Ly_ER.js.map} +1 -1
  120. package/dashboard/dist/assets/{bots-DTGXnvX_.js → bots-Cb14wZ1Y.js} +2 -2
  121. package/dashboard/dist/assets/{bots-DTGXnvX_.js.map → bots-Cb14wZ1Y.js.map} +1 -1
  122. package/dashboard/dist/assets/{capabilities-BjlARR7F.js → capabilities-DeHLk9JJ.js} +2 -2
  123. package/dashboard/dist/assets/{capabilities-BjlARR7F.js.map → capabilities-DeHLk9JJ.js.map} +1 -1
  124. package/dashboard/dist/assets/{controlplane-DMYI0OaL.js → controlplane-YBZ3SbA6.js} +2 -2
  125. package/dashboard/dist/assets/{controlplane-DMYI0OaL.js.map → controlplane-YBZ3SbA6.js.map} +1 -1
  126. package/dashboard/dist/assets/{escalation-columns-BMO_H3cb.js → escalation-columns-CA9DQlhA.js} +2 -2
  127. package/dashboard/dist/assets/{escalation-columns-BMO_H3cb.js.map → escalation-columns-CA9DQlhA.js.map} +1 -1
  128. package/dashboard/dist/assets/{index-Ch-OS1pk.js → index-B0qNe7Ux.js} +2 -2
  129. package/dashboard/dist/assets/{index-Ch-OS1pk.js.map → index-B0qNe7Ux.js.map} +1 -1
  130. package/dashboard/dist/assets/{index-CGCD5hTX.js → index-B4Nea96C.js} +2 -2
  131. package/dashboard/dist/assets/{index-CGCD5hTX.js.map → index-B4Nea96C.js.map} +1 -1
  132. package/dashboard/dist/assets/{index-B3FzpDEG.js → index-B7fE-rND.js} +2 -2
  133. package/dashboard/dist/assets/{index-B3FzpDEG.js.map → index-B7fE-rND.js.map} +1 -1
  134. package/dashboard/dist/assets/{index-DuhqzYwC.js → index-BAKroiNw.js} +2 -2
  135. package/dashboard/dist/assets/{index-DuhqzYwC.js.map → index-BAKroiNw.js.map} +1 -1
  136. package/dashboard/dist/assets/{index-k5vcLICm.js → index-BRmgxeZM.js} +2 -2
  137. package/dashboard/dist/assets/{index-k5vcLICm.js.map → index-BRmgxeZM.js.map} +1 -1
  138. package/dashboard/dist/assets/{index-3QEnMBNG.js → index-BaDimDGQ.js} +2 -2
  139. package/dashboard/dist/assets/{index-3QEnMBNG.js.map → index-BaDimDGQ.js.map} +1 -1
  140. package/dashboard/dist/assets/{index-DuyzcDuV.js → index-BhurEB5s.js} +2 -2
  141. package/dashboard/dist/assets/{index-DuyzcDuV.js.map → index-BhurEB5s.js.map} +1 -1
  142. package/dashboard/dist/assets/{index-D3iDAWK2.js → index-CQriisJy.js} +2 -2
  143. package/dashboard/dist/assets/{index-D3iDAWK2.js.map → index-CQriisJy.js.map} +1 -1
  144. package/dashboard/dist/assets/{index-CkkOh8y9.js → index-D5MSJsiW.js} +2 -2
  145. package/dashboard/dist/assets/{index-CkkOh8y9.js.map → index-D5MSJsiW.js.map} +1 -1
  146. package/dashboard/dist/assets/{index-BU4oujVO.js → index-Ntul2ZC1.js} +3 -3
  147. package/dashboard/dist/assets/{index-BU4oujVO.js.map → index-Ntul2ZC1.js.map} +1 -1
  148. package/dashboard/dist/assets/{index-D6kXz3H8.js → index-YUv7aNb4.js} +2 -2
  149. package/dashboard/dist/assets/{index-D6kXz3H8.js.map → index-YUv7aNb4.js.map} +1 -1
  150. package/dashboard/dist/assets/{index-Dsgqxdyh.js → index-chMUPSOd.js} +2 -2
  151. package/dashboard/dist/assets/{index-Dsgqxdyh.js.map → index-chMUPSOd.js.map} +1 -1
  152. package/dashboard/dist/assets/index-uWUJXqGS.js +3 -0
  153. package/dashboard/dist/assets/index-uWUJXqGS.js.map +1 -0
  154. package/dashboard/dist/assets/{knowledge-DAV1Jy7b.js → knowledge-B1HqYuB2.js} +2 -2
  155. package/dashboard/dist/assets/{knowledge-DAV1Jy7b.js.map → knowledge-B1HqYuB2.js.map} +1 -1
  156. package/dashboard/dist/assets/{mcp-CivbxL1P.js → mcp-dhihqJpH.js} +2 -2
  157. package/dashboard/dist/assets/{mcp-CivbxL1P.js.map → mcp-dhihqJpH.js.map} +1 -1
  158. package/dashboard/dist/assets/{mcp-query-CGvWNrgo.js → mcp-query-B_gkB7JK.js} +2 -2
  159. package/dashboard/dist/assets/{mcp-query-CGvWNrgo.js.map → mcp-query-B_gkB7JK.js.map} +1 -1
  160. package/dashboard/dist/assets/metadata-display-DHjqWkLG.js +2 -0
  161. package/dashboard/dist/assets/metadata-display-DHjqWkLG.js.map +1 -0
  162. package/dashboard/dist/assets/{personas-lI3aUr6t.js → personas-Bw_OlfI6.js} +2 -2
  163. package/dashboard/dist/assets/{personas-lI3aUr6t.js.map → personas-Bw_OlfI6.js.map} +1 -1
  164. package/dashboard/dist/assets/{pipelines-DjPfnTmx.js → pipelines-BYwn0LXY.js} +2 -2
  165. package/dashboard/dist/assets/{pipelines-DjPfnTmx.js.map → pipelines-BYwn0LXY.js.map} +1 -1
  166. package/dashboard/dist/assets/{tasks-Co_S55BO.js → tasks-t6bPmJ7P.js} +2 -2
  167. package/dashboard/dist/assets/{tasks-Co_S55BO.js.map → tasks-t6bPmJ7P.js.map} +1 -1
  168. package/dashboard/dist/assets/{topics-2IGhZXBi.js → topics-Bgo9xw80.js} +2 -2
  169. package/dashboard/dist/assets/{topics-2IGhZXBi.js.map → topics-Bgo9xw80.js.map} +1 -1
  170. package/dashboard/dist/assets/{useEventHooks-D0C5yke4.js → useEventHooks-BJbMbg_h.js} +2 -2
  171. package/dashboard/dist/assets/{useEventHooks-D0C5yke4.js.map → useEventHooks-BJbMbg_h.js.map} +1 -1
  172. package/dashboard/dist/assets/{useNamespace-LG52DTT-.js → useNamespace-CaXJuSFG.js} +2 -2
  173. package/dashboard/dist/assets/{useNamespace-LG52DTT-.js.map → useNamespace-CaXJuSFG.js.map} +1 -1
  174. package/dashboard/dist/assets/{useYamlActivityEvents-1IZGVpWC.js → useYamlActivityEvents-B47LQrDk.js} +2 -2
  175. package/dashboard/dist/assets/{useYamlActivityEvents-1IZGVpWC.js.map → useYamlActivityEvents-B47LQrDk.js.map} +1 -1
  176. package/dashboard/dist/assets/{users-C-eHT1i6.js → users-D0jvzUqW.js} +2 -2
  177. package/dashboard/dist/assets/{users-C-eHT1i6.js.map → users-D0jvzUqW.js.map} +1 -1
  178. package/dashboard/dist/assets/{workflows-C16CeY4e.js → workflows-DRoZRrMH.js} +2 -2
  179. package/dashboard/dist/assets/{workflows-C16CeY4e.js.map → workflows-DRoZRrMH.js.map} +1 -1
  180. package/dashboard/dist/assets/{yaml-workflows-BBenayT9.js → yaml-workflows-BdhYyIef.js} +2 -2
  181. package/dashboard/dist/assets/{yaml-workflows-BBenayT9.js.map → yaml-workflows-BdhYyIef.js.map} +1 -1
  182. package/dashboard/dist/index.html +1 -1
  183. package/docs/api/http/escalations.md +5 -1
  184. package/docs/hitl/iframe.md +56 -6
  185. package/package.json +1 -1
  186. package/dashboard/dist/assets/ScanStationPage-Y-9Gs7t5.js +0 -2
  187. package/dashboard/dist/assets/ScanStationPage-Y-9Gs7t5.js.map +0 -1
  188. package/dashboard/dist/assets/index-LF1gEc6w.js +0 -3
  189. package/dashboard/dist/assets/index-LF1gEc6w.js.map +0 -1
@@ -21,12 +21,15 @@ export declare function claimEscalation(input: {
21
21
  * Release a claimed escalation back to the pool.
22
22
  *
23
23
  * Only the user who holds the claim can release it. Publishes a
24
- * `escalation.released` event.
24
+ * `escalation.released` event unless `quiet` — the identical release with no
25
+ * event, for bookkeeping releases that are not lifecycle transitions.
25
26
  *
26
27
  * @param input.id — escalation UUID
28
+ * @param input.quiet — suppress the `released` event (default: loud)
27
29
  * @param auth — authenticated user context
28
30
  * @returns `{ status: 200, data: { escalation } }` or 409
29
31
  */
30
32
  export declare function releaseEscalation(input: {
31
33
  id: string;
34
+ quiet?: boolean;
32
35
  }, auth: LTApiAuth): Promise<LTApiResult>;
@@ -81,9 +81,11 @@ async function claimEscalation(input, auth) {
81
81
  * Release a claimed escalation back to the pool.
82
82
  *
83
83
  * Only the user who holds the claim can release it. Publishes a
84
- * `escalation.released` event.
84
+ * `escalation.released` event unless `quiet` — the identical release with no
85
+ * event, for bookkeeping releases that are not lifecycle transitions.
85
86
  *
86
87
  * @param input.id — escalation UUID
88
+ * @param input.quiet — suppress the `released` event (default: loud)
87
89
  * @param auth — authenticated user context
88
90
  * @returns `{ status: 200, data: { escalation } }` or 409
89
91
  */
@@ -97,7 +99,9 @@ async function releaseEscalation(input, auth) {
97
99
  const manageDenied = await (0, helpers_1.assertQueueManageAccess)(auth.userId, escalation.role);
98
100
  if (manageDenied)
99
101
  return manageDenied;
100
- const result = await escalationService.releaseEscalation(input.id, auth.userId);
102
+ const result = await escalationService.releaseEscalation(input.id, auth.userId, {
103
+ quiet: input.quiet === true,
104
+ });
101
105
  if (!result) {
102
106
  return { status: 409, error: 'Escalation not found or not claimed by you' };
103
107
  }
package/build/index.js CHANGED
@@ -167,6 +167,10 @@ async function main() {
167
167
  },
168
168
  },
169
169
  examples: true,
170
+ features: {
171
+ // The examples ship the full scan demo (schemes 10/11); surface it.
172
+ scanCodes: true,
173
+ },
170
174
  mcp: {
171
175
  server: { enabled: true },
172
176
  },
@@ -84,12 +84,14 @@ function registerSingleRoutes(router) {
84
84
  * Release a claimed escalation back to the available pool.
85
85
  * Only the assigned actor (token user, or the badged person when an
86
86
  * X-LT-Acting-Token grant rides the request) may release their own claim.
87
+ * `quiet: true` in the body performs the identical release without the
88
+ * `released` event — bookkeeping releases only; default stays loud.
87
89
  */
88
90
  router.post('/:id/release', async (req, res) => {
89
91
  const auth = await (0, acting_1.effectiveWorkAuth)(req, res);
90
92
  if (!auth)
91
93
  return;
92
- const result = await api.releaseEscalation({ id: req.params.id }, auth);
94
+ const result = await api.releaseEscalation({ id: req.params.id, quiet: req.body?.quiet === true }, auth);
93
95
  res.status(result.status).json(result.data ?? { error: result.error });
94
96
  });
95
97
  /**
@@ -139,6 +139,7 @@ export declare function createClient(options?: LTClientOptions): {
139
139
  }, auth?: LTApiAuth) => Promise<LTApiResult<any>>;
140
140
  release: (input: {
141
141
  id: string;
142
+ quiet?: boolean;
142
143
  }, auth?: LTApiAuth) => Promise<LTApiResult<any>>;
143
144
  resolve: (input: {
144
145
  id: string;
@@ -134,8 +134,16 @@ export declare function getEscalationScopeRows(ids: string[]): Promise<{
134
134
  /**
135
135
  * Release a single escalation claim back to the available pool.
136
136
  * Only the assigned user (or superadmin via route) may release.
137
- */
138
- export declare function releaseEscalation(id: string, userId: string): Promise<LTEscalationRecord | null>;
137
+ *
138
+ * `quiet` performs the identical release without publishing the `released`
139
+ * event — for bookkeeping releases (a dispatcher's held-skip loop frees rows
140
+ * every ranking window) that are not lifecycle transitions. Faceted machine
141
+ * claims are already silent; this is the release-side counterpart. Default
142
+ * stays loud.
143
+ */
144
+ export declare function releaseEscalation(id: string, userId: string, opts?: {
145
+ quiet?: boolean;
146
+ }): Promise<LTEscalationRecord | null>;
139
147
  /**
140
148
  * Sweep expired claims back to the available pool, returning the count cleared.
141
149
  * Availability is already query-time in the implicit model, but long-tail's
@@ -328,24 +328,32 @@ async function getEscalationScopeRows(ids) {
328
328
  /**
329
329
  * Release a single escalation claim back to the available pool.
330
330
  * Only the assigned user (or superadmin via route) may release.
331
+ *
332
+ * `quiet` performs the identical release without publishing the `released`
333
+ * event — for bookkeeping releases (a dispatcher's held-skip loop frees rows
334
+ * every ranking window) that are not lifecycle transitions. Faceted machine
335
+ * claims are already silent; this is the release-side counterpart. Default
336
+ * stays loud.
331
337
  */
332
- async function releaseEscalation(id, userId) {
338
+ async function releaseEscalation(id, userId, opts) {
333
339
  const client = await (0, client_1.escalations)();
334
340
  const result = await client.release({ id, assignee: userId });
335
341
  if (!result.ok)
336
342
  return null;
337
343
  const released = (0, map_1.toEscalationRecord)(result.entry);
338
- publishEscalationChange({
339
- type: 'escalation.released',
340
- source: 'service',
341
- workflowId: released.workflow_id || '',
342
- workflowName: released.workflow_type || '',
343
- taskQueue: released.task_queue || '',
344
- escalationId: released.id,
345
- role: released.role,
346
- status: 'released',
347
- data: (0, escalation_wire_1.escalationEventData)(released, { released_by: userId }),
348
- });
344
+ if (!opts?.quiet) {
345
+ publishEscalationChange({
346
+ type: 'escalation.released',
347
+ source: 'service',
348
+ workflowId: released.workflow_id || '',
349
+ workflowName: released.workflow_type || '',
350
+ taskQueue: released.task_queue || '',
351
+ escalationId: released.id,
352
+ role: released.role,
353
+ status: 'released',
354
+ data: (0, escalation_wire_1.escalationEventData)(released, { released_by: userId }),
355
+ });
356
+ }
349
357
  return released;
350
358
  }
351
359
  /**
@@ -1,2 +1,2 @@
1
- import{j as o}from"./vendor-query-RUZdMvN6.js";import{c as n}from"./tasks-Co_S55BO.js";import{Q as m}from"./index-BU4oujVO.js";import{f as c}from"./useEventHooks-D0C5yke4.js";import{u}from"./mcp-CivbxL1P.js";import{P as d}from"./PageHeaderWithStats-JXeUFa_g.js";import"./vendor-react-CdqEC2zv.js";import"./vendor-icons-BPsNpK3Y.js";function j(){var a;c();const{data:s}=n({limit:1}),{data:e}=m({status:"pending",limit:1}),{data:t}=u(),r=((a=t==null?void 0:t.servers)==null?void 0:a.filter(i=>i.status==="connected").length)??0,l=t?`${r}/${t.total}`:"—";return o.jsx("div",{children:o.jsx(d,{title:"Admin",stats:[{label:"Tasks",value:(s==null?void 0:s.total)??"—"},{label:"Pending Escalations",value:(e==null?void 0:e.total)??"—",dotClass:"bg-status-pending"},{label:"MCP Servers",value:l},{label:"System",value:"Healthy",dotClass:"bg-status-success"}]})})}export{j as AdminDashboard};
2
- //# sourceMappingURL=AdminDashboard-DeZsR4pA.js.map
1
+ import{j as o}from"./vendor-query-RUZdMvN6.js";import{c as n}from"./tasks-t6bPmJ7P.js";import{Q as m}from"./index-Ntul2ZC1.js";import{f as c}from"./useEventHooks-BJbMbg_h.js";import{u}from"./mcp-dhihqJpH.js";import{P as d}from"./PageHeaderWithStats-JXeUFa_g.js";import"./vendor-react-CdqEC2zv.js";import"./vendor-icons-BPsNpK3Y.js";function j(){var a;c();const{data:s}=n({limit:1}),{data:e}=m({status:"pending",limit:1}),{data:t}=u(),r=((a=t==null?void 0:t.servers)==null?void 0:a.filter(i=>i.status==="connected").length)??0,l=t?`${r}/${t.total}`:"—";return o.jsx("div",{children:o.jsx(d,{title:"Admin",stats:[{label:"Tasks",value:(s==null?void 0:s.total)??"—"},{label:"Pending Escalations",value:(e==null?void 0:e.total)??"—",dotClass:"bg-status-pending"},{label:"MCP Servers",value:l},{label:"System",value:"Healthy",dotClass:"bg-status-success"}]})})}export{j as AdminDashboard};
2
+ //# sourceMappingURL=AdminDashboard-C4h1R-lz.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminDashboard-DeZsR4pA.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":"4UAMO,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-C4h1R-lz.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":"4UAMO,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-RUZdMvN6.js";import{a as le,d as ce,b as oe}from"./agents-MeqzOPD6.js";import{E as de,C as xe,u as pe,a as ue,b as me,c as he}from"./CronLabel-CAu2hmQf.js";import{b as fe,u as ve,l as be}from"./index-BU4oujVO.js";import{P as ye}from"./PageHeader-BpeBHqyc.js";import{B as E,m as U,A as ge,R as Y,e as M,T as Z,ap as G,d as V,bb as ee,a8 as je}from"./vendor-icons-BPsNpK3Y.js";import{e as we}from"./knowledge-DAV1Jy7b.js";import{R as te}from"./RunAsSelector-DrGsUhL8.js";import{u as Ne}from"./workflows-C16CeY4e.js";import{u as _e}from"./yaml-workflows-BBenayT9.js";import{u as se}from"./capabilities-BjlARR7F.js";import{u as ke}from"./topics-2IGhZXBi.js";import{W as Q}from"./WorkflowPill-BcA7S3gI.js";import{e as Ce,u as Se,f as qe}from"./vendor-react-CdqEC2zv.js";import"./BotPicker-dUpw1wW6.js";import"./bots-DTGXnvX_.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Ae={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},Oe={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,...c}=x;return JSON.stringify(c,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",O="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:O}),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:O}),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:`${O} 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:`${O} 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}=we(),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:O,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(U,{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(""),c=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 l=a?`${a}`:"",d=m?u:l,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:c,type:"text",value:d,onFocus:()=>{i(!0),p(l)},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(ge,{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:c,onMcpPromptChange:h,availableTypes:l=[...Je]}){const{data:d}=Ne(),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:l.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:c??"",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)},c=()=>{a("subscriptions",[...s.subscriptions,{...Ae}]),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))},l=s.subscriptions,d=l[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 l.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(Y,{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:c,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:[l.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-RUZdMvN6.js";import{a as le,d as ce,b as oe}from"./agents-Bu5Ly_ER.js";import{E as de,C as xe,u as pe,a as ue,b as me,c as he}from"./CronLabel-ds7dLz6S.js";import{b as fe,u as ve,l as be}from"./index-Ntul2ZC1.js";import{P as ye}from"./PageHeader-BpeBHqyc.js";import{B as E,m as U,A as ge,R as Y,e as M,T as Z,ap as G,d as V,bb as ee,a8 as je}from"./vendor-icons-BPsNpK3Y.js";import{e as we}from"./knowledge-B1HqYuB2.js";import{R as te}from"./RunAsSelector-BAqa1Tya.js";import{u as Ne}from"./workflows-DRoZRrMH.js";import{u as _e}from"./yaml-workflows-BdhYyIef.js";import{u as se}from"./capabilities-DeHLk9JJ.js";import{u as ke}from"./topics-Bgo9xw80.js";import{W as Q}from"./WorkflowPill-BcA7S3gI.js";import{e as Ce,u as Se,f as qe}from"./vendor-react-CdqEC2zv.js";import"./BotPicker-CnX8xfka.js";import"./bots-Cb14wZ1Y.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Ae={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},Oe={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,...c}=x;return JSON.stringify(c,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",O="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:O}),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:O}),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:`${O} 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:`${O} 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}=we(),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:O,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(U,{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(""),c=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 l=a?`${a}`:"",d=m?u:l,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:c,type:"text",value:d,onFocus:()=>{i(!0),p(l)},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(ge,{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:c,onMcpPromptChange:h,availableTypes:l=[...Je]}){const{data:d}=Ne(),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:l.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:c??"",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)},c=()=>{a("subscriptions",[...s.subscriptions,{...Ae}]),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))},l=s.subscriptions,d=l[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 l.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(Y,{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:c,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:[l.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:c,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(Ue,{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:`${O} 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:c=>x(r,"cron",c.target.value),placeholder:"0 * * * *",className:`${O} 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:Ye.map(c=>e.jsx("button",{type:"button",onClick:()=>x(r,"cron",c),className:`text-2xs font-mono whitespace-nowrap transition-colors ${p.cron===c?"text-accent font-medium":"text-accent/50 hover:text-accent"}`,children:z(c)},c))})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:p.reaction_type,onReactionTypeChange:c=>x(r,"reaction_type",c),workflowType:p.workflow_type,onWorkflowTypeChange:c=>x(r,"workflow_type",c),pipelineId:p.pipeline_id,onPipelineIdChange:c=>x(r,"pipeline_id",c),serverId:p.server_id,toolName:p.tool_name,onCapabilityChange:(c,h)=>{x(r,"server_id",c),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:c=>x(r,"execute_as",c)}),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:c=>x(r,"envelope",c.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 Ke({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:U,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:Y,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:G,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:U},{id:4,label:"Subscriptions",icon:Y},{id:5,label:"Schedules",icon:G},{id:6,label:"Review",icon:je}];function pt(){var H;const{id:s}=Ce(),a=!s,r=Se(),{data:o}=ve(),x=be(),i=(x!==null?x:!!((H=o==null?void 0:o.ai)!=null&&H.enabled))?"Agent":"Automation",{data:u,isLoading:p}=le(a?null:s),{data:c}=pe(a?null:s),h=ce(),l=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 A=new URLSearchParams(N);return A.set("step",String(j)),A},{replace:!0})},[q]);f.useEffect(()=>{if(!b){if(a){n(X),g(!0);return}u&&c&&(n(Re(u,c.subscriptions??[])),g(!0))}},[u,c,a,b]);const I=(j,N)=>n(A=>({...A,[j]:N})),ie=async()=>{R("");try{const j=Ee(t);let N=s;a?N=(await h.mutateAsync(j)).id:await l.mutateAsync({id:s,...j});const A=$e(t),re=(c==null?void 0:c.subscriptions)??[],J=new Set(re.map(C=>C.id));for(const C of A)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 K=h.isPending||l.isPending;return e.jsxs("div",{children:[e.jsx(ye,{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,A=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 ${A?"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()||K,className:"w-full btn-primary text-xs disabled:opacity-50",children:K?"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(Ge,{form:t,set:I}),w===6&&e.jsx(Ke,{form:t})]})]})]})}export{pt as AgentConfigPage};
16
- //# sourceMappingURL=AgentConfigPage-Bi5ZAsjf.js.map
16
+ //# sourceMappingURL=AgentConfigPage-EWC8VQ7R.js.map