@hotmeshio/long-tail 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/build/api/escalations/create.js +30 -9
  2. package/build/api/roles.d.ts +32 -0
  3. package/build/api/roles.js +73 -0
  4. package/build/bin/ltc.js +23 -0
  5. package/build/lib/cli/commands/roles.d.ts +17 -0
  6. package/build/lib/cli/commands/roles.js +102 -0
  7. package/build/lib/db/schemas/017_role_schema_versions.sql +40 -0
  8. package/build/lib/db/schemas/018_role_upstreams.sql +21 -0
  9. package/build/routes/roles.js +20 -0
  10. package/build/scripts/ortho-populate.d.ts +80 -8
  11. package/build/scripts/ortho-populate.js +204 -52
  12. package/build/sdk/index.d.ts +2 -0
  13. package/build/sdk/index.js +2 -0
  14. package/build/services/interceptor/completion.js +17 -12
  15. package/build/services/orchestrator/condition.d.ts +25 -1
  16. package/build/services/orchestrator/condition.js +29 -1
  17. package/build/services/role/index.d.ts +15 -1
  18. package/build/services/role/index.js +45 -1
  19. package/build/services/role/sql.d.ts +23 -2
  20. package/build/services/role/sql.js +93 -16
  21. package/build/services/role/types.d.ts +41 -0
  22. package/build/system/mcp-servers/admin/index.js +3 -3
  23. package/build/system/mcp-servers/admin/schemas.d.ts +25 -2
  24. package/build/system/mcp-servers/admin/schemas.js +11 -2
  25. package/build/system/mcp-servers/admin/users.js +42 -0
  26. package/build/system/mcp-servers/human-queue-schemas.d.ts +6 -0
  27. package/build/system/mcp-servers/human-queue-schemas.js +4 -0
  28. package/build/system/mcp-servers/human-queue.js +10 -2
  29. package/build/system/seed/tool-manifests-admin.d.ts +371 -0
  30. package/build/system/seed/tool-manifests-admin.js +3 -1
  31. package/build/tsconfig.tsbuildinfo +1 -1
  32. package/build/types/escalation.d.ts +16 -0
  33. package/build/types/escalation.js +17 -0
  34. package/dashboard/dist/assets/{AdminDashboard-Bg1HgukI.js → AdminDashboard-rZDVS2G_.js} +2 -2
  35. package/dashboard/dist/assets/{AdminDashboard-Bg1HgukI.js.map → AdminDashboard-rZDVS2G_.js.map} +1 -1
  36. package/dashboard/dist/assets/{AgentConfigPage-HBe_YDU_.js → AgentConfigPage-CbyyCjCT.js} +2 -2
  37. package/dashboard/dist/assets/{AgentConfigPage-HBe_YDU_.js.map → AgentConfigPage-CbyyCjCT.js.map} +1 -1
  38. package/dashboard/dist/assets/{AgentDetailPage-BsaiYbwL.js → AgentDetailPage-DMeHvidT.js} +2 -2
  39. package/dashboard/dist/assets/{AgentDetailPage-BsaiYbwL.js.map → AgentDetailPage-DMeHvidT.js.map} +1 -1
  40. package/dashboard/dist/assets/{AgentsPage-DhN2lIBh.js → AgentsPage-C8fKLxh-.js} +2 -2
  41. package/dashboard/dist/assets/{AgentsPage-DhN2lIBh.js.map → AgentsPage-C8fKLxh-.js.map} +1 -1
  42. package/dashboard/dist/assets/{AvailableEscalationsPage-_xcWvlIz.js → AvailableEscalationsPage-CUHcybKU.js} +2 -2
  43. package/dashboard/dist/assets/{AvailableEscalationsPage-_xcWvlIz.js.map → AvailableEscalationsPage-CUHcybKU.js.map} +1 -1
  44. package/dashboard/dist/assets/{BotPicker-DY6iUVC9.js → BotPicker-DGhniNcy.js} +2 -2
  45. package/dashboard/dist/assets/{BotPicker-DY6iUVC9.js.map → BotPicker-DGhniNcy.js.map} +1 -1
  46. package/dashboard/dist/assets/{CapabilitiesPage-w1owqsmN.js → CapabilitiesPage-ClfuW4ya.js} +2 -2
  47. package/dashboard/dist/assets/{CapabilitiesPage-w1owqsmN.js.map → CapabilitiesPage-ClfuW4ya.js.map} +1 -1
  48. package/dashboard/dist/assets/{CollapsibleSection-DIMGjlJ-.js → CollapsibleSection-DnECdKEY.js} +2 -2
  49. package/dashboard/dist/assets/{CollapsibleSection-DIMGjlJ-.js.map → CollapsibleSection-DnECdKEY.js.map} +1 -1
  50. package/dashboard/dist/assets/{CredentialsPage-D1OmMHux.js → CredentialsPage-DdZ-jyyc.js} +2 -2
  51. package/dashboard/dist/assets/{CredentialsPage-D1OmMHux.js.map → CredentialsPage-DdZ-jyyc.js.map} +1 -1
  52. package/dashboard/dist/assets/{CronLabel-CQy3DrUQ.js → CronLabel-CymxLvY0.js} +2 -2
  53. package/dashboard/dist/assets/{CronLabel-CQy3DrUQ.js.map → CronLabel-CymxLvY0.js.map} +1 -1
  54. package/dashboard/dist/assets/{CustomDurationPicker-BoBkl9tw.js → CustomDurationPicker-8JHvVWD2.js} +2 -2
  55. package/dashboard/dist/assets/{CustomDurationPicker-BoBkl9tw.js.map → CustomDurationPicker-8JHvVWD2.js.map} +1 -1
  56. package/dashboard/dist/assets/{DropZone-QXbiuU0b.js → DropZone-DEX0BBqt.js} +2 -2
  57. package/dashboard/dist/assets/{DropZone-QXbiuU0b.js.map → DropZone-DEX0BBqt.js.map} +1 -1
  58. package/dashboard/dist/assets/{ElapsedCell-Donjm9gT.js → ElapsedCell-BRZfw_Af.js} +2 -2
  59. package/dashboard/dist/assets/{ElapsedCell-Donjm9gT.js.map → ElapsedCell-BRZfw_Af.js.map} +1 -1
  60. package/dashboard/dist/assets/EscalationSchemaPage-Do2iPKUl.js +9 -0
  61. package/dashboard/dist/assets/EscalationSchemaPage-Do2iPKUl.js.map +1 -0
  62. package/dashboard/dist/assets/{EscalationsOverview-CvHIJ_GG.js → EscalationsOverview-CiQO3ntf.js} +2 -2
  63. package/dashboard/dist/assets/{EscalationsOverview-CvHIJ_GG.js.map → EscalationsOverview-CiQO3ntf.js.map} +1 -1
  64. package/dashboard/dist/assets/{EventTable-DpAXMmT3.js → EventTable-CLuAbba_.js} +2 -2
  65. package/dashboard/dist/assets/{EventTable-DpAXMmT3.js.map → EventTable-CLuAbba_.js.map} +1 -1
  66. package/dashboard/dist/assets/{GraphInvokePage-De1XVx5d.js → GraphInvokePage-BFRi6Nny.js} +2 -2
  67. package/dashboard/dist/assets/{GraphInvokePage-De1XVx5d.js.map → GraphInvokePage-BFRi6Nny.js.map} +1 -1
  68. package/dashboard/dist/assets/{HomePage-BYR5VXXw.js → HomePage-m1pnxilb.js} +2 -2
  69. package/dashboard/dist/assets/{HomePage-BYR5VXXw.js.map → HomePage-m1pnxilb.js.map} +1 -1
  70. package/dashboard/dist/assets/{ListToolbar-Bx7jGzPA.js → ListToolbar-D4Y-M7wN.js} +2 -2
  71. package/dashboard/dist/assets/{ListToolbar-Bx7jGzPA.js.map → ListToolbar-D4Y-M7wN.js.map} +1 -1
  72. package/dashboard/dist/assets/{McpOverview-DXRKcJN0.js → McpOverview-mfJpETsW.js} +2 -2
  73. package/dashboard/dist/assets/{McpOverview-DXRKcJN0.js.map → McpOverview-mfJpETsW.js.map} +1 -1
  74. package/dashboard/dist/assets/{McpQueryDetailPage-CmW15w5e.js → McpQueryDetailPage-Cb99vI7v.js} +2 -2
  75. package/dashboard/dist/assets/{McpQueryDetailPage-CmW15w5e.js.map → McpQueryDetailPage-Cb99vI7v.js.map} +1 -1
  76. package/dashboard/dist/assets/{McpQueryPage-BE6I011z.js → McpQueryPage-CKKOxks0.js} +2 -2
  77. package/dashboard/dist/assets/{McpQueryPage-BE6I011z.js.map → McpQueryPage-CKKOxks0.js.map} +1 -1
  78. package/dashboard/dist/assets/{McpRunDetailPage-Dsa3G3XQ.js → McpRunDetailPage-CyTbHs0J.js} +2 -2
  79. package/dashboard/dist/assets/{McpRunDetailPage-Dsa3G3XQ.js.map → McpRunDetailPage-CyTbHs0J.js.map} +1 -1
  80. package/dashboard/dist/assets/{McpRunsPage-uTbym66Y.js → McpRunsPage-MIwmK-Ky.js} +2 -2
  81. package/dashboard/dist/assets/{McpRunsPage-uTbym66Y.js.map → McpRunsPage-MIwmK-Ky.js.map} +1 -1
  82. package/dashboard/dist/assets/{NamespacePill-BGf0jHwE.js → NamespacePill-CwKdoyRM.js} +2 -2
  83. package/dashboard/dist/assets/{NamespacePill-BGf0jHwE.js.map → NamespacePill-CwKdoyRM.js.map} +1 -1
  84. package/dashboard/dist/assets/OperationsPage-DPesph0U.js +2 -0
  85. package/dashboard/dist/assets/OperationsPage-DPesph0U.js.map +1 -0
  86. package/dashboard/dist/assets/{OperatorDashboard-i8cxaDlk.js → OperatorDashboard-K1gzULr7.js} +2 -2
  87. package/dashboard/dist/assets/{OperatorDashboard-i8cxaDlk.js.map → OperatorDashboard-K1gzULr7.js.map} +1 -1
  88. package/dashboard/dist/assets/{PageHeader-BZJsEVOC.js → PageHeader-BhaWTWcM.js} +2 -2
  89. package/dashboard/dist/assets/{PageHeader-BZJsEVOC.js.map → PageHeader-BhaWTWcM.js.map} +1 -1
  90. package/dashboard/dist/assets/{PageHeaderWithStats-BWuD7s9c.js → PageHeaderWithStats-yex5WmHB.js} +2 -2
  91. package/dashboard/dist/assets/{PageHeaderWithStats-BWuD7s9c.js.map → PageHeaderWithStats-yex5WmHB.js.map} +1 -1
  92. package/dashboard/dist/assets/{ProcessDetailPage-CP7GZhgs.js → ProcessDetailPage-DBIrY6Vd.js} +2 -2
  93. package/dashboard/dist/assets/{ProcessDetailPage-CP7GZhgs.js.map → ProcessDetailPage-DBIrY6Vd.js.map} +1 -1
  94. package/dashboard/dist/assets/{ProcessesListPage-btsU6hBR.js → ProcessesListPage-CrLGDCAD.js} +2 -2
  95. package/dashboard/dist/assets/{ProcessesListPage-btsU6hBR.js.map → ProcessesListPage-CrLGDCAD.js.map} +1 -1
  96. package/dashboard/dist/assets/RoleDetailPage-7j6Mk780.js +11 -0
  97. package/dashboard/dist/assets/RoleDetailPage-7j6Mk780.js.map +1 -0
  98. package/dashboard/dist/assets/{RolePill-Pb9TKSQN.js → RolePill-Cl71eDUA.js} +2 -2
  99. package/dashboard/dist/assets/{RolePill-Pb9TKSQN.js.map → RolePill-Cl71eDUA.js.map} +1 -1
  100. package/dashboard/dist/assets/RolesPage-B0ZgjB2V.js +2 -0
  101. package/dashboard/dist/assets/{RolesPage-1DBoEMsb.js.map → RolesPage-B0ZgjB2V.js.map} +1 -1
  102. package/dashboard/dist/assets/{RunAsSelector-Cp6j3FEY.js → RunAsSelector-DA0h41ml.js} +2 -2
  103. package/dashboard/dist/assets/{RunAsSelector-Cp6j3FEY.js.map → RunAsSelector-DA0h41ml.js.map} +1 -1
  104. package/dashboard/dist/assets/{StickyPagination-Pr8kawv8.js → StickyPagination-t5B71hwd.js} +2 -2
  105. package/dashboard/dist/assets/{StickyPagination-Pr8kawv8.js.map → StickyPagination-t5B71hwd.js.map} +1 -1
  106. package/dashboard/dist/assets/{StreamMessageDetail-BqmQ-N3y.js → StreamMessageDetail-CYFnZsYA.js} +2 -2
  107. package/dashboard/dist/assets/{StreamMessageDetail-BqmQ-N3y.js.map → StreamMessageDetail-CYFnZsYA.js.map} +1 -1
  108. package/dashboard/dist/assets/{SwimlaneTimeline-y1YmXrsj.js → SwimlaneTimeline-CY18gBek.js} +2 -2
  109. package/dashboard/dist/assets/{SwimlaneTimeline-y1YmXrsj.js.map → SwimlaneTimeline-CY18gBek.js.map} +1 -1
  110. package/dashboard/dist/assets/{TagInput-Df4myuYF.js → TagInput-B_WQiuer.js} +2 -2
  111. package/dashboard/dist/assets/{TagInput-Df4myuYF.js.map → TagInput-B_WQiuer.js.map} +1 -1
  112. package/dashboard/dist/assets/{TaskDetailPage-CT5rXHK5.js → TaskDetailPage-B9owzuhV.js} +2 -2
  113. package/dashboard/dist/assets/{TaskDetailPage-CT5rXHK5.js.map → TaskDetailPage-B9owzuhV.js.map} +1 -1
  114. package/dashboard/dist/assets/{TaskQueuePill-YalYdCNo.js → TaskQueuePill-Lgn2obNU.js} +2 -2
  115. package/dashboard/dist/assets/{TaskQueuePill-YalYdCNo.js.map → TaskQueuePill-Lgn2obNU.js.map} +1 -1
  116. package/dashboard/dist/assets/{TasksListPage-DOy6JlKS.js → TasksListPage-Dlsu7cWG.js} +2 -2
  117. package/dashboard/dist/assets/{TasksListPage-DOy6JlKS.js.map → TasksListPage-Dlsu7cWG.js.map} +1 -1
  118. package/dashboard/dist/assets/{TimeAgo-BAQwZSpq.js → TimeAgo-CSzifQXB.js} +2 -2
  119. package/dashboard/dist/assets/{TimeAgo-BAQwZSpq.js.map → TimeAgo-CSzifQXB.js.map} +1 -1
  120. package/dashboard/dist/assets/{TimestampCell-BK_jufns.js → TimestampCell-CIxgN57O.js} +2 -2
  121. package/dashboard/dist/assets/{TimestampCell-BK_jufns.js.map → TimestampCell-CIxgN57O.js.map} +1 -1
  122. package/dashboard/dist/assets/{ToolPill-VGpT6Quy.js → ToolPill-uVqcbHPE.js} +2 -2
  123. package/dashboard/dist/assets/{ToolPill-VGpT6Quy.js.map → ToolPill-uVqcbHPE.js.map} +1 -1
  124. package/dashboard/dist/assets/{ToolTestPanel-5PMQyUCe.js → ToolTestPanel-Bw844EW3.js} +2 -2
  125. package/dashboard/dist/assets/{ToolTestPanel-5PMQyUCe.js.map → ToolTestPanel-Bw844EW3.js.map} +1 -1
  126. package/dashboard/dist/assets/{TopicDetailPage-Cn1ShfR8.js → TopicDetailPage-HuDx2oAW.js} +2 -2
  127. package/dashboard/dist/assets/{TopicDetailPage-Cn1ShfR8.js.map → TopicDetailPage-HuDx2oAW.js.map} +1 -1
  128. package/dashboard/dist/assets/{TopicsPage-D67tjS8L.js → TopicsPage-CAG0RhAK.js} +2 -2
  129. package/dashboard/dist/assets/{TopicsPage-D67tjS8L.js.map → TopicsPage-CAG0RhAK.js.map} +1 -1
  130. package/dashboard/dist/assets/{UserName-Dsu1Jk4N.js → UserName-CoGYeig8.js} +2 -2
  131. package/dashboard/dist/assets/{UserName-Dsu1Jk4N.js.map → UserName-CoGYeig8.js.map} +1 -1
  132. package/dashboard/dist/assets/{WorkflowExecutionPage-BwQoOmUE.js → WorkflowExecutionPage-Dhb9EWgI.js} +2 -2
  133. package/dashboard/dist/assets/{WorkflowExecutionPage-BwQoOmUE.js.map → WorkflowExecutionPage-Dhb9EWgI.js.map} +1 -1
  134. package/dashboard/dist/assets/{WorkflowPill-pPUqmx6Q.js → WorkflowPill-IDjTRfQ8.js} +2 -2
  135. package/dashboard/dist/assets/{WorkflowPill-pPUqmx6Q.js.map → WorkflowPill-IDjTRfQ8.js.map} +1 -1
  136. package/dashboard/dist/assets/{WorkflowsDashboard-D3z7COgH.js → WorkflowsDashboard-bJ6Zebfv.js} +2 -2
  137. package/dashboard/dist/assets/{WorkflowsDashboard-D3z7COgH.js.map → WorkflowsDashboard-bJ6Zebfv.js.map} +1 -1
  138. package/dashboard/dist/assets/{WorkflowsOverview-C15JcxyY.js → WorkflowsOverview-B8262fVx.js} +2 -2
  139. package/dashboard/dist/assets/{WorkflowsOverview-C15JcxyY.js.map → WorkflowsOverview-B8262fVx.js.map} +1 -1
  140. package/dashboard/dist/assets/{YamlWorkflowDetailPage-BYq3t7E-.js → YamlWorkflowDetailPage-DhW3q2cO.js} +2 -2
  141. package/dashboard/dist/assets/{YamlWorkflowDetailPage-BYq3t7E-.js.map → YamlWorkflowDetailPage-DhW3q2cO.js.map} +1 -1
  142. package/dashboard/dist/assets/{YamlWorkflowsPage-B44WgwE_.js → YamlWorkflowsPage-C8hBjSn_.js} +2 -2
  143. package/dashboard/dist/assets/{YamlWorkflowsPage-B44WgwE_.js.map → YamlWorkflowsPage-C8hBjSn_.js.map} +1 -1
  144. package/dashboard/dist/assets/{agents-BRmmK6Y9.js → agents-j2YErVp4.js} +2 -2
  145. package/dashboard/dist/assets/{agents-BRmmK6Y9.js.map → agents-j2YErVp4.js.map} +1 -1
  146. package/dashboard/dist/assets/{bots-BD75mzGG.js → bots-CD8Bl5pL.js} +2 -2
  147. package/dashboard/dist/assets/{bots-BD75mzGG.js.map → bots-CD8Bl5pL.js.map} +1 -1
  148. package/dashboard/dist/assets/{capabilities-DDgC_Kds.js → capabilities-Dz190EAa.js} +2 -2
  149. package/dashboard/dist/assets/{capabilities-DDgC_Kds.js.map → capabilities-Dz190EAa.js.map} +1 -1
  150. package/dashboard/dist/assets/{controlplane-BJh12lMv.js → controlplane-CkUHGPA3.js} +2 -2
  151. package/dashboard/dist/assets/{controlplane-BJh12lMv.js.map → controlplane-CkUHGPA3.js.map} +1 -1
  152. package/dashboard/dist/assets/{escalation-DIJt2sgn.js → escalation-BXTwi4J1.js} +2 -2
  153. package/dashboard/dist/assets/{escalation-DIJt2sgn.js.map → escalation-BXTwi4J1.js.map} +1 -1
  154. package/dashboard/dist/assets/{escalation-columns-zl6E94Up.js → escalation-columns-GxxwSbDk.js} +2 -2
  155. package/dashboard/dist/assets/{escalation-columns-zl6E94Up.js.map → escalation-columns-GxxwSbDk.js.map} +1 -1
  156. package/dashboard/dist/assets/{index-DU7YumVJ.js → index-BK3PVYcd.js} +2 -2
  157. package/dashboard/dist/assets/{index-DU7YumVJ.js.map → index-BK3PVYcd.js.map} +1 -1
  158. package/dashboard/dist/assets/{index-CknKy4RA.js → index-BkwsJ-0v.js} +2 -2
  159. package/dashboard/dist/assets/{index-CknKy4RA.js.map → index-BkwsJ-0v.js.map} +1 -1
  160. package/dashboard/dist/assets/{index-B0kmiSmt.js → index-CaMVn0kW.js} +2 -2
  161. package/dashboard/dist/assets/{index-B0kmiSmt.js.map → index-CaMVn0kW.js.map} +1 -1
  162. package/dashboard/dist/assets/{index-BUbzfEA9.js → index-CkL8bpdH.js} +2 -2
  163. package/dashboard/dist/assets/{index-BUbzfEA9.js.map → index-CkL8bpdH.js.map} +1 -1
  164. package/dashboard/dist/assets/index-CoGkgm9-.js +6 -0
  165. package/dashboard/dist/assets/{index-DccCwyZl.js.map → index-CoGkgm9-.js.map} +1 -1
  166. package/dashboard/dist/assets/{index-CtDf8vvQ.js → index-D-7W2AHB.js} +9 -9
  167. package/dashboard/dist/assets/index-D-7W2AHB.js.map +1 -0
  168. package/dashboard/dist/assets/{index-CV4lEd4I.js → index-DGKgXObc.js} +2 -2
  169. package/dashboard/dist/assets/{index-CV4lEd4I.js.map → index-DGKgXObc.js.map} +1 -1
  170. package/dashboard/dist/assets/{index-DVVIeBBk.js → index-DTrcYOM2.js} +2 -2
  171. package/dashboard/dist/assets/{index-DVVIeBBk.js.map → index-DTrcYOM2.js.map} +1 -1
  172. package/dashboard/dist/assets/{index-BhznDv-4.js → index-NfVWOFbF.js} +2 -2
  173. package/dashboard/dist/assets/{index-BhznDv-4.js.map → index-NfVWOFbF.js.map} +1 -1
  174. package/dashboard/dist/assets/index-Wny0bRgq.css +1 -0
  175. package/dashboard/dist/assets/{index-DrUkTcn-.js → index-YliQ4kW_.js} +2 -2
  176. package/dashboard/dist/assets/{index-DrUkTcn-.js.map → index-YliQ4kW_.js.map} +1 -1
  177. package/dashboard/dist/assets/{index-CpgV4Kkp.js → index-eLRh-2NW.js} +2 -2
  178. package/dashboard/dist/assets/{index-CpgV4Kkp.js.map → index-eLRh-2NW.js.map} +1 -1
  179. package/dashboard/dist/assets/{index-CDPBXB4e.js → index-n-lZY5S6.js} +2 -2
  180. package/dashboard/dist/assets/{index-CDPBXB4e.js.map → index-n-lZY5S6.js.map} +1 -1
  181. package/dashboard/dist/assets/{index-j-C7g_Ej.js → index-qT7eB_Hk.js} +2 -2
  182. package/dashboard/dist/assets/{index-j-C7g_Ej.js.map → index-qT7eB_Hk.js.map} +1 -1
  183. package/dashboard/dist/assets/{knowledge-pNDWACXB.js → knowledge-CSAbLtk7.js} +2 -2
  184. package/dashboard/dist/assets/{knowledge-pNDWACXB.js.map → knowledge-CSAbLtk7.js.map} +1 -1
  185. package/dashboard/dist/assets/{mcp-xddLBwUW.js → mcp-D0Ha3aEo.js} +2 -2
  186. package/dashboard/dist/assets/{mcp-xddLBwUW.js.map → mcp-D0Ha3aEo.js.map} +1 -1
  187. package/dashboard/dist/assets/{mcp-query-CmNjvxTG.js → mcp-query-BySmvmuS.js} +2 -2
  188. package/dashboard/dist/assets/{mcp-query-CmNjvxTG.js.map → mcp-query-BySmvmuS.js.map} +1 -1
  189. package/dashboard/dist/assets/{pipelines-B05sd2nB.js → pipelines-DiqWgxJd.js} +2 -2
  190. package/dashboard/dist/assets/{pipelines-B05sd2nB.js.map → pipelines-DiqWgxJd.js.map} +1 -1
  191. package/dashboard/dist/assets/roles-BdtnzLsL.js +2 -0
  192. package/dashboard/dist/assets/roles-BdtnzLsL.js.map +1 -0
  193. package/dashboard/dist/assets/{tasks-Bm1OKrJA.js → tasks-DYCUi5nZ.js} +2 -2
  194. package/dashboard/dist/assets/{tasks-Bm1OKrJA.js.map → tasks-DYCUi5nZ.js.map} +1 -1
  195. package/dashboard/dist/assets/{topics-BVIqtmd4.js → topics-CA7i8ymr.js} +2 -2
  196. package/dashboard/dist/assets/{topics-BVIqtmd4.js.map → topics-CA7i8ymr.js.map} +1 -1
  197. package/dashboard/dist/assets/{useEventHooks-_qCzU74s.js → useEventHooks-SfWdyc5L.js} +2 -2
  198. package/dashboard/dist/assets/{useEventHooks-_qCzU74s.js.map → useEventHooks-SfWdyc5L.js.map} +1 -1
  199. package/dashboard/dist/assets/{useNamespace-CDnCSFpG.js → useNamespace-CZUsk5Vv.js} +2 -2
  200. package/dashboard/dist/assets/{useNamespace-CDnCSFpG.js.map → useNamespace-CZUsk5Vv.js.map} +1 -1
  201. package/dashboard/dist/assets/{useYamlActivityEvents-zrHMhaFM.js → useYamlActivityEvents-DKQ5dREx.js} +2 -2
  202. package/dashboard/dist/assets/{useYamlActivityEvents-zrHMhaFM.js.map → useYamlActivityEvents-DKQ5dREx.js.map} +1 -1
  203. package/dashboard/dist/assets/{users-BPBMZg27.js → users-BxKf5dAX.js} +2 -2
  204. package/dashboard/dist/assets/{users-BPBMZg27.js.map → users-BxKf5dAX.js.map} +1 -1
  205. package/dashboard/dist/assets/{vendor-icons-C1zVP_dv.js → vendor-icons-CEWCGPeJ.js} +76 -76
  206. package/dashboard/dist/assets/vendor-icons-CEWCGPeJ.js.map +1 -0
  207. package/dashboard/dist/assets/{workflows-CT6nTL1I.js → workflows-DNPQ-j-7.js} +2 -2
  208. package/dashboard/dist/assets/{workflows-CT6nTL1I.js.map → workflows-DNPQ-j-7.js.map} +1 -1
  209. package/dashboard/dist/assets/{yaml-workflows-CdfjkOKU.js → yaml-workflows-CA8BrFxc.js} +2 -2
  210. package/dashboard/dist/assets/{yaml-workflows-CdfjkOKU.js.map → yaml-workflows-CA8BrFxc.js.map} +1 -1
  211. package/dashboard/dist/index.html +3 -3
  212. package/docs/api/http/roles.md +62 -0
  213. package/docs/api/mcp/admin.md +32 -1
  214. package/docs/api/mcp/human-queue.md +2 -0
  215. package/docs/api/sdk/roles.md +39 -0
  216. package/docs/cli.md +13 -0
  217. package/docs/dashboard.md +13 -6
  218. package/docs/data.md +34 -0
  219. package/docs/hitl-guide.md +25 -3
  220. package/package.json +2 -2
  221. package/dashboard/dist/assets/OperationsPage-CAmiFHI6.js +0 -2
  222. package/dashboard/dist/assets/OperationsPage-CAmiFHI6.js.map +0 -1
  223. package/dashboard/dist/assets/RoleDetailPage-BB_e330f.js +0 -16
  224. package/dashboard/dist/assets/RoleDetailPage-BB_e330f.js.map +0 -1
  225. package/dashboard/dist/assets/RolesPage-1DBoEMsb.js +0 -2
  226. package/dashboard/dist/assets/index-BRtKQtQZ.css +0 -1
  227. package/dashboard/dist/assets/index-CtDf8vvQ.js.map +0 -1
  228. package/dashboard/dist/assets/index-DccCwyZl.js +0 -6
  229. package/dashboard/dist/assets/roles-bRgaMcdy.js +0 -2
  230. package/dashboard/dist/assets/roles-bRgaMcdy.js.map +0 -1
  231. package/dashboard/dist/assets/vendor-icons-C1zVP_dv.js.map +0 -1
@@ -59,7 +59,9 @@ exports.ADMIN_TOOLS = [
59
59
  { name: 'list_roles', description: 'List all distinct roles known to the system.', read_safe: true, inputSchema: { type: 'object', properties: {} } },
60
60
  { name: 'create_role', description: 'Create a new role. Lowercase alphanumeric with hyphens/underscores.', read_safe: false, inputSchema: { type: 'object', properties: { role: { type: 'string' } }, required: ['role'] } },
61
61
  { name: 'add_escalation_chain', description: 'Define an escalation path from one role to another.', read_safe: false, inputSchema: { type: 'object', properties: { source_role: { type: 'string' }, target_role: { type: 'string' } }, required: ['source_role', 'target_role'] } },
62
- { name: 'update_role', description: 'Update role metadata with PATCH semantics (omitted fields keep their values): display name, description, form/metadata schemas, properties bag, ops_visible flag, parent role, and the typed operational targets.', read_safe: false, inputSchema: { type: 'object', properties: { role: { type: 'string' }, title: { type: 'string' }, description: { type: 'string' }, form_schema: { type: 'object' }, metadata_schema: { type: 'object' }, properties: { type: 'object' }, ops_visible: { type: 'boolean' }, parent_role: { type: 'string' }, sla_minutes: { type: 'number' }, target_per_hour: { type: 'number' }, worker_count: { type: 'integer' } }, required: ['role'] } },
62
+ { name: 'update_role', description: 'Update role metadata with PATCH semantics (omitted fields keep their values): display name, description, form/metadata schemas, properties bag, ops_visible flag, parent role, and the typed operational targets. A schema change snapshots the pair into the version history.', read_safe: false, inputSchema: { type: 'object', properties: { role: { type: 'string' }, title: { type: 'string' }, description: { type: 'string' }, form_schema: { type: 'object' }, metadata_schema: { type: 'object' }, properties: { type: 'object' }, ops_visible: { type: 'boolean' }, parent_role: { type: 'string' }, sla_minutes: { type: 'number' }, target_per_hour: { type: 'number' }, worker_count: { type: 'integer' }, upstream_roles: { type: 'array', items: { type: 'string' } }, change_summary: { type: 'string' } }, required: ['role'] } },
63
+ { name: 'get_role_schema', description: 'Fetch a role\'s form_schema + metadata_schema pair — the live (latest) schema, or an immutable snapshot when a version is given (the version escalations pin via metadata.schema_version).', read_safe: true, inputSchema: { type: 'object', properties: { role: { type: 'string' }, version: { type: 'integer' } }, required: ['role'] } },
64
+ { name: 'list_role_schema_versions', description: 'List a role\'s schema version history, newest first. Each schema edit creates a new version; fetch a full snapshot with get_role_schema.', read_safe: true, inputSchema: { type: 'object', properties: { role: { type: 'string' } }, required: ['role'] } },
63
65
  { name: 'diagnose_job', description: 'Read-only diagnosis for a single workflow job: status, idle time, stream summary, escalation row, and structured findings with evidence.', read_safe: true, inputSchema: { type: 'object', properties: { workflow_id: { type: 'string' }, app_id: { type: 'string' }, max_events: { type: 'integer' }, include: { type: 'array', items: { type: 'string', enum: ['events', 'streams'] } }, verbosity: { type: 'string', enum: ['summary', 'full'] } }, required: ['workflow_id'] } },
64
66
  { name: 'find_stalled_jobs', description: 'List workflow jobs idle beyond a threshold, each classified as healthy-wait or likely-fault.', read_safe: true, inputSchema: { type: 'object', properties: { app_id: { type: 'string' }, idle_minutes: { type: 'integer' }, workflow_type: { type: 'string' }, limit: { type: 'integer' } } } },
65
67
  { name: 'find_orphaned_signals', description: 'Scan recent worker streams for signals whose waiting workflow is gone.', read_safe: true, inputSchema: { type: 'object', properties: { app_id: { type: 'string' }, within_hours: { type: 'integer' }, limit: { type: 'integer' } } } },
@@ -1 +1 @@
1
- {"root":["../index.ts","../vitest.config.ts","../vitest.integration.config.ts","../adapters/express.ts","../api/agent-subscriptions.ts","../api/agents.ts","../api/auth-sso.ts","../api/auth.ts","../api/bot-accounts.ts","../api/capabilities.ts","../api/controlplane.ts","../api/dba.ts","../api/diagnostics.ts","../api/exports.ts","../api/files.ts","../api/index.ts","../api/insight.ts","../api/knowledge.ts","../api/maintenance.ts","../api/namespaces.ts","../api/overview.ts","../api/pipelines.ts","../api/roles.ts","../api/settings.ts","../api/tasks.ts","../api/topics.ts","../api/users.ts","../api/workflow-sets.ts","../api/escalations/bulk.ts","../api/escalations/cancel.ts","../api/escalations/claim.ts","../api/escalations/create.ts","../api/escalations/facets.ts","../api/escalations/helpers.ts","../api/escalations/index.ts","../api/escalations/list.ts","../api/escalations/metadata.ts","../api/escalations/resolve.ts","../api/escalations/single.ts","../api/mcp/index.ts","../api/mcp/servers.ts","../api/mcp/tools.ts","../api/workflows/config.ts","../api/workflows/discovery.ts","../api/workflows/index.ts","../api/workflows/invocation.ts","../api/yaml-workflows/cron.ts","../api/yaml-workflows/crud.ts","../api/yaml-workflows/deploy.ts","../api/yaml-workflows/helpers.ts","../api/yaml-workflows/index.ts","../api/yaml-workflows/versions.ts","../bin/ltc.ts","../lib/cli/auth.ts","../lib/cli/client.ts","../lib/cli/compile.ts","../lib/cli/format.ts","../lib/cli/init.ts","../lib/cli/output.ts","../lib/cli/scanner.ts","../lib/cli/types.ts","../lib/cli/commands/escalations.ts","../lib/cli/commands/knowledge.ts","../lib/cli/commands/mcp.ts","../lib/cli/commands/pipelines.ts","../lib/cli/commands/status.ts","../lib/cli/commands/streams.ts","../lib/cli/commands/users.ts","../lib/cli/commands/workflows.ts","../lib/db/index.ts","../lib/db/migrate.ts","../lib/events/callback.ts","../lib/events/index.ts","../lib/events/matching.ts","../lib/events/memory.ts","../lib/events/nats-ws-proxy.ts","../lib/events/nats.ts","../lib/events/publish.ts","../lib/events/socketio.ts","../lib/events/system-events.ts","../lib/logger/index.ts","../lib/logger/pino.ts","../lib/storage/index.ts","../lib/storage/local.ts","../lib/storage/mime.ts","../lib/storage/s3.ts","../lib/storage/types.ts","../lib/telemetry/honeycomb.ts","../lib/telemetry/index.ts","../modules/auth.ts","../modules/config.ts","../modules/defaults.ts","../modules/features.ts","../modules/ltconfig.ts","../modules/maintenance.ts","../modules/sso.ts","../modules/utils.ts","../modules/version.ts","../routes/agents.ts","../routes/auth-sso.ts","../routes/auth.ts","../routes/bot-accounts.ts","../routes/capabilities.ts","../routes/controlplane.ts","../routes/dba.ts","../routes/delegation.ts","../routes/diagnostics.ts","../routes/docs.ts","../routes/exports.ts","../routes/file-browser.ts","../routes/files.ts","../routes/index.ts","../routes/insight.ts","../routes/knowledge.ts","../routes/maintenance.ts","../routes/mcp-endpoint.ts","../routes/mcp.ts","../routes/namespaces.ts","../routes/nats-credentials.ts","../routes/oauth.ts","../routes/overview.ts","../routes/pipelines.ts","../routes/roles.ts","../routes/settings.ts","../routes/tasks.ts","../routes/topics.ts","../routes/users.ts","../routes/workflow-sets.ts","../routes/escalations/bulk.ts","../routes/escalations/facets.ts","../routes/escalations/index.ts","../routes/escalations/list.ts","../routes/escalations/metadata.ts","../routes/escalations/resolve.ts","../routes/escalations/single.ts","../routes/workflows/config.ts","../routes/workflows/discovery.ts","../routes/workflows/index.ts","../routes/workflows/invocation.ts","../routes/yaml-workflows/cron.ts","../routes/yaml-workflows/crud.ts","../routes/yaml-workflows/deployment.ts","../routes/yaml-workflows/index.ts","../routes/yaml-workflows/versions.ts","../scripts/ortho-populate.ts","../scripts/process-helpers.ts","../scripts/process.ts","../scripts/token.ts","../sdk/index.ts","../services/dba.ts","../services/hotmesh-utils.ts","../services/workflow-invocation.ts","../services/agent/index.ts","../services/agent/input-mapper.ts","../services/agent/sql.ts","../services/agent/subscription-sql.ts","../services/agent/subscriptions.ts","../services/agent/trigger-registry.ts","../services/auth/bot-api-key.ts","../services/auth/delegation.ts","../services/auth/index.ts","../services/auth/service-token.ts","../services/auth/sql.ts","../services/config/cache.ts","../services/config/index.ts","../services/config/provider.ts","../services/config/read.ts","../services/config/sql.ts","../services/config/write.ts","../services/controlplane/index.ts","../services/controlplane/quorum-bridge.ts","../services/controlplane/sql.ts","../services/controlplane/stream-messages-sql.ts","../services/controlplane/types.ts","../services/cron/index.ts","../services/diagnostics/index.ts","../services/diagnostics/patterns.ts","../services/escalation/bulk.ts","../services/escalation/client.ts","../services/escalation/crud.ts","../services/escalation/facet-sql.ts","../services/escalation/facets.ts","../services/escalation/index.ts","../services/escalation/map.ts","../services/escalation/metrics-cache.ts","../services/escalation/queries.ts","../services/escalation/sql.ts","../services/escalation/types.ts","../services/escalation-strategy/default.ts","../services/escalation-strategy/index.ts","../services/escalation-strategy/mcp.ts","../services/export/client.ts","../services/export/index.ts","../services/export/post-process.ts","../services/export/types.ts","../services/iam/activity.ts","../services/iam/bots.ts","../services/iam/context.ts","../services/iam/credentials.ts","../services/iam/envelope.ts","../services/iam/ephemeral.ts","../services/iam/index.ts","../services/iam/principal.ts","../services/iam/resolve.ts","../services/iam/sql.ts","../services/insight/index.ts","../services/insight/prompts.ts","../services/interceptor/activity-interceptor.ts","../services/interceptor/completion.ts","../services/interceptor/context.ts","../services/interceptor/escalation.ts","../services/interceptor/index.ts","../services/interceptor/lifecycle.ts","../services/interceptor/state.ts","../services/interceptor/types.ts","../services/interceptor/activities/config.ts","../services/interceptor/activities/escalation.ts","../services/interceptor/activities/index.ts","../services/interceptor/activities/task.ts","../services/interceptor/activities/workflow.ts","../services/llm/detect.ts","../services/llm/index.ts","../services/llm/translate.ts","../services/llm/types.ts","../services/llm/providers/anthropic.ts","../services/llm/providers/openai.ts","../services/maintenance/index.ts","../services/mcp/adapter.ts","../services/mcp/db.ts","../services/mcp/exposure.ts","../services/mcp/external-server.ts","../services/mcp/index.ts","../services/mcp/register-tool.ts","../services/mcp/seed-service-account.ts","../services/mcp/server-lifecycle.ts","../services/mcp/server-tools.ts","../services/mcp/server.ts","../services/mcp/sql.ts","../services/mcp/types.ts","../services/mcp/workflow-compiler-server.ts","../services/mcp/workflow-server.ts","../services/mcp/client/connection-dispatch.ts","../services/mcp/client/connection-lifecycle.ts","../services/mcp/client/connection-test.ts","../services/mcp/client/connection.ts","../services/mcp/client/index.ts","../services/mcp/client/tools.ts","../services/mcp/db-server/index.ts","../services/mcp/db-server/schemas.ts","../services/mcp/db-server/tools.ts","../services/mcp/playwright-server/index.ts","../services/mcp/playwright-server/lifecycle.ts","../services/mcp/playwright-server/schemas.ts","../services/mcp/playwright-server/tools.ts","../services/namespace/index.ts","../services/namespace/sql.ts","../services/namespace/types.ts","../services/oauth/crypto.ts","../services/oauth/db.ts","../services/oauth/index.ts","../services/oauth/sql.ts","../services/oauth/state.ts","../services/oauth/providers/anthropic.ts","../services/oauth/providers/github.ts","../services/oauth/providers/google.ts","../services/oauth/providers/index.ts","../services/oauth/providers/microsoft.ts","../services/oauth/providers/mock.ts","../services/oauth/providers/registry.ts","../services/oauth/providers/types.ts","../services/orchestrator/condition.ts","../services/orchestrator/index.ts","../services/orchestrator/types.ts","../services/overview/index.ts","../services/overview/sql.ts","../services/pipelines/enrichment.ts","../services/pipelines/events.ts","../services/pipelines/execution-builder.ts","../services/pipelines/index.ts","../services/pipelines/queries.ts","../services/pipelines/sql.ts","../services/pipelines/types.ts","../services/role/index.ts","../services/role/sql.ts","../services/role/types.ts","../services/task/crud.ts","../services/task/index.ts","../services/task/process.ts","../services/task/resolve.ts","../services/task/sql.ts","../services/task/types.ts","../services/topics/index.ts","../services/topics/sql.ts","../services/topics/system-topics.ts","../services/user/auth.ts","../services/user/crud.ts","../services/user/index.ts","../services/user/rbac.ts","../services/user/roles.ts","../services/user/scope.ts","../services/user/seed-admin.ts","../services/user/sql.ts","../services/user/sso-provision.ts","../services/user/types.ts","../services/workers/registry.ts","../services/workflow-sets/db.ts","../services/workflow-sets/index.ts","../services/workflow-sets/sql.ts","../services/yaml-workflow/builder-regenerate.ts","../services/yaml-workflow/db-utils.ts","../services/yaml-workflow/db-versions.ts","../services/yaml-workflow/db.ts","../services/yaml-workflow/deployer-helpers.ts","../services/yaml-workflow/deployer.ts","../services/yaml-workflow/generator.ts","../services/yaml-workflow/index.ts","../services/yaml-workflow/input-analyzer-helpers.ts","../services/yaml-workflow/input-analyzer.ts","../services/yaml-workflow/invoke.ts","../services/yaml-workflow/pipe-validator.ts","../services/yaml-workflow/sql.ts","../services/yaml-workflow/types.ts","../services/yaml-workflow/durable-compiler/index.ts","../services/yaml-workflow/durable-compiler/parser.ts","../services/yaml-workflow/durable-compiler/prompts.ts","../services/yaml-workflow/durable-compiler/types.ts","../services/yaml-workflow/pattern-detector/array-source.ts","../services/yaml-workflow/pattern-detector/collapse.ts","../services/yaml-workflow/pattern-detector/index.ts","../services/yaml-workflow/pattern-detector/run-detection.ts","../services/yaml-workflow/pattern-detector/types.ts","../services/yaml-workflow/pipeline/analyze.ts","../services/yaml-workflow/pipeline/extract-helpers.ts","../services/yaml-workflow/pipeline/extract.ts","../services/yaml-workflow/pipeline/index.ts","../services/yaml-workflow/pipeline/prompt-templates.ts","../services/yaml-workflow/pipeline/prompts.ts","../services/yaml-workflow/pipeline/validate.ts","../services/yaml-workflow/pipeline/build/dag-assembly.ts","../services/yaml-workflow/pipeline/build/dag.ts","../services/yaml-workflow/pipeline/build/index.ts","../services/yaml-workflow/pipeline/build/iteration.ts","../services/yaml-workflow/pipeline/build/metadata.ts","../services/yaml-workflow/pipeline/build/transform.ts","../services/yaml-workflow/pipeline/build/utils.ts","../services/yaml-workflow/pipeline/build/wiring.ts","../services/yaml-workflow/pipeline/compile/index.ts","../services/yaml-workflow/pipeline/compile/llm-call.ts","../services/yaml-workflow/pipeline/compile/parse-plan.ts","../services/yaml-workflow/pipeline/compile/summarize.ts","../services/yaml-workflow/workers/callbacks.ts","../services/yaml-workflow/workers/events.ts","../services/yaml-workflow/workers/index.ts","../services/yaml-workflow/workers/register.ts","../services/yaml-workflow/workers/scope.ts","../start/adapters.ts","../start/config.ts","../start/graph-workflows.ts","../start/index.ts","../start/server.ts","../start/socket-auth.ts","../start/workers.ts","../system/index.ts","../system/activities/claude-code.ts","../system/activities/file-storage.ts","../system/activities/http.ts","../system/activities/knowledge.ts","../system/activities/oauth.ts","../system/activities/schema-exchange.ts","../system/activities/sql.ts","../system/activities/triage/cache.ts","../system/activities/triage/context.ts","../system/activities/triage/discovery.ts","../system/activities/triage/index.ts","../system/activities/triage/llm.ts","../system/activities/triage/tools.ts","../system/mcp-servers/claude-code.ts","../system/mcp-servers/docs.ts","../system/mcp-servers/events.ts","../system/mcp-servers/file-storage.ts","../system/mcp-servers/http-fetch.ts","../system/mcp-servers/human-queue-schemas.ts","../system/mcp-servers/human-queue.ts","../system/mcp-servers/knowledge.ts","../system/mcp-servers/oauth.ts","../system/mcp-servers/schema-exchange.ts","../system/mcp-servers/translation.ts","../system/mcp-servers/vision-prompts.ts","../system/mcp-servers/vision.ts","../system/mcp-servers/workflow-compiler.ts","../system/mcp-servers/workflow.ts","../system/mcp-servers/admin/agent-subscriptions.ts","../system/mcp-servers/admin/agents.ts","../system/mcp-servers/admin/bot-accounts.ts","../system/mcp-servers/admin/controlplane.ts","../system/mcp-servers/admin/diagnostics.ts","../system/mcp-servers/admin/escalations.ts","../system/mcp-servers/admin/exports.ts","../system/mcp-servers/admin/index.ts","../system/mcp-servers/admin/maintenance.ts","../system/mcp-servers/admin/mcp-servers.ts","../system/mcp-servers/admin/ortho.ts","../system/mcp-servers/admin/overview.ts","../system/mcp-servers/admin/pipelines.ts","../system/mcp-servers/admin/schemas.ts","../system/mcp-servers/admin/settings.ts","../system/mcp-servers/admin/tasks.ts","../system/mcp-servers/admin/topics.ts","../system/mcp-servers/admin/users.ts","../system/mcp-servers/admin/workflow-config.ts","../system/mcp-servers/admin/workflows.ts","../system/mcp-servers/admin/yaml-workflows.ts","../system/mcp-servers/db-query/index.ts","../system/mcp-servers/db-query/schemas.ts","../system/mcp-servers/db-query/tools.ts","../system/seed/index.ts","../system/seed/tool-manifests-admin.ts","../system/seed/tool-manifests-data.ts","../system/seed/tool-manifests-escalation.ts","../system/seed/tool-manifests-events.ts","../system/seed/tool-manifests-knowledge.ts","../system/seed/tool-manifests-workflows.ts","../system/workflows/tool-result-guard.ts","../system/workflows/capability-invoke/activities.ts","../system/workflows/capability-invoke/index.ts","../system/workflows/mcp-deterministic/activities.ts","../system/workflows/mcp-deterministic/index.ts","../system/workflows/mcp-query/index.ts","../system/workflows/mcp-query/prompts.ts","../system/workflows/mcp-query/strategy-advisors.ts","../system/workflows/mcp-query/types.ts","../system/workflows/mcp-query/activities/caches.ts","../system/workflows/mcp-query/activities/discovery.ts","../system/workflows/mcp-query/activities/index.ts","../system/workflows/mcp-query/activities/llm.ts","../system/workflows/mcp-query/activities/tool-executor.ts","../system/workflows/mcp-query/activities/tool-loader.ts","../system/workflows/mcp-query-router/activities.ts","../system/workflows/mcp-query-router/index.ts","../system/workflows/mcp-query-router/prompts.ts","../system/workflows/mcp-triage/activities-proxy.ts","../system/workflows/mcp-triage/index.ts","../system/workflows/mcp-triage/prompts.ts","../system/workflows/mcp-triage/response-builders.ts","../system/workflows/mcp-triage/response.ts","../system/workflows/mcp-triage/types.ts","../system/workflows/mcp-triage-deterministic/activities.ts","../system/workflows/mcp-triage-deterministic/index.ts","../system/workflows/mcp-triage-router/activities.ts","../system/workflows/mcp-triage-router/index.ts","../system/workflows/mcp-workflow-builder/index.ts","../system/workflows/mcp-workflow-builder/prompts.ts","../system/workflows/mcp-workflow-builder/activities/caches.ts","../system/workflows/mcp-workflow-builder/activities/index.ts","../system/workflows/mcp-workflow-builder/activities/llm.ts","../system/workflows/mcp-workflow-builder/activities/tool-loader.ts","../system/workflows/mcp-workflow-planner/index.ts","../system/workflows/mcp-workflow-planner/prompts.ts","../system/workflows/mcp-workflow-planner/activities/analyze.ts","../system/workflows/mcp-workflow-planner/activities/index.ts","../system/workflows/mcp-workflow-planner/activities/persist.ts","../system/workflows/mcp-workflow-planner/activities/plan.ts","../system/workflows/shared/discovery.ts","../system/workflows/shared/index.ts","../system/workflows/shared/llm-caller.ts","../system/workflows/shared/prompts.ts","../system/workflows/shared/strategy-advisors.ts","../system/workflows/shared/tool-executor.ts","../system/workflows/shared/tool-loader.ts","../system/workflows/shared/types.ts","../types/agent.ts","../types/auth.ts","../types/config.ts","../types/delegation.ts","../types/discovery.ts","../types/envelope.ts","../types/escalation-strategy.ts","../types/escalation.ts","../types/events.ts","../types/export.ts","../types/express.d.ts","../types/facets.ts","../types/index.ts","../types/logger.ts","../types/maintenance.ts","../types/mcp.ts","../types/oauth.ts","../types/sdk.ts","../types/startup.ts","../types/task.ts","../types/telemetry.ts","../types/tool-context.ts","../types/user.ts","../types/workflow-set.ts","../types/workflow.ts","../types/yaml-workflow.ts","../workers/index.ts"],"version":"5.9.3"}
1
+ {"root":["../index.ts","../vitest.config.ts","../vitest.integration.config.ts","../adapters/express.ts","../api/agent-subscriptions.ts","../api/agents.ts","../api/auth-sso.ts","../api/auth.ts","../api/bot-accounts.ts","../api/capabilities.ts","../api/controlplane.ts","../api/dba.ts","../api/diagnostics.ts","../api/exports.ts","../api/files.ts","../api/index.ts","../api/insight.ts","../api/knowledge.ts","../api/maintenance.ts","../api/namespaces.ts","../api/overview.ts","../api/pipelines.ts","../api/roles.ts","../api/settings.ts","../api/tasks.ts","../api/topics.ts","../api/users.ts","../api/workflow-sets.ts","../api/escalations/bulk.ts","../api/escalations/cancel.ts","../api/escalations/claim.ts","../api/escalations/create.ts","../api/escalations/facets.ts","../api/escalations/helpers.ts","../api/escalations/index.ts","../api/escalations/list.ts","../api/escalations/metadata.ts","../api/escalations/resolve.ts","../api/escalations/single.ts","../api/mcp/index.ts","../api/mcp/servers.ts","../api/mcp/tools.ts","../api/workflows/config.ts","../api/workflows/discovery.ts","../api/workflows/index.ts","../api/workflows/invocation.ts","../api/yaml-workflows/cron.ts","../api/yaml-workflows/crud.ts","../api/yaml-workflows/deploy.ts","../api/yaml-workflows/helpers.ts","../api/yaml-workflows/index.ts","../api/yaml-workflows/versions.ts","../bin/ltc.ts","../lib/cli/auth.ts","../lib/cli/client.ts","../lib/cli/compile.ts","../lib/cli/format.ts","../lib/cli/init.ts","../lib/cli/output.ts","../lib/cli/scanner.ts","../lib/cli/types.ts","../lib/cli/commands/escalations.ts","../lib/cli/commands/knowledge.ts","../lib/cli/commands/mcp.ts","../lib/cli/commands/pipelines.ts","../lib/cli/commands/roles.ts","../lib/cli/commands/status.ts","../lib/cli/commands/streams.ts","../lib/cli/commands/users.ts","../lib/cli/commands/workflows.ts","../lib/db/index.ts","../lib/db/migrate.ts","../lib/events/callback.ts","../lib/events/index.ts","../lib/events/matching.ts","../lib/events/memory.ts","../lib/events/nats-ws-proxy.ts","../lib/events/nats.ts","../lib/events/publish.ts","../lib/events/socketio.ts","../lib/events/system-events.ts","../lib/logger/index.ts","../lib/logger/pino.ts","../lib/storage/index.ts","../lib/storage/local.ts","../lib/storage/mime.ts","../lib/storage/s3.ts","../lib/storage/types.ts","../lib/telemetry/honeycomb.ts","../lib/telemetry/index.ts","../modules/auth.ts","../modules/config.ts","../modules/defaults.ts","../modules/features.ts","../modules/ltconfig.ts","../modules/maintenance.ts","../modules/sso.ts","../modules/utils.ts","../modules/version.ts","../routes/agents.ts","../routes/auth-sso.ts","../routes/auth.ts","../routes/bot-accounts.ts","../routes/capabilities.ts","../routes/controlplane.ts","../routes/dba.ts","../routes/delegation.ts","../routes/diagnostics.ts","../routes/docs.ts","../routes/exports.ts","../routes/file-browser.ts","../routes/files.ts","../routes/index.ts","../routes/insight.ts","../routes/knowledge.ts","../routes/maintenance.ts","../routes/mcp-endpoint.ts","../routes/mcp.ts","../routes/namespaces.ts","../routes/nats-credentials.ts","../routes/oauth.ts","../routes/overview.ts","../routes/pipelines.ts","../routes/roles.ts","../routes/settings.ts","../routes/tasks.ts","../routes/topics.ts","../routes/users.ts","../routes/workflow-sets.ts","../routes/escalations/bulk.ts","../routes/escalations/facets.ts","../routes/escalations/index.ts","../routes/escalations/list.ts","../routes/escalations/metadata.ts","../routes/escalations/resolve.ts","../routes/escalations/single.ts","../routes/workflows/config.ts","../routes/workflows/discovery.ts","../routes/workflows/index.ts","../routes/workflows/invocation.ts","../routes/yaml-workflows/cron.ts","../routes/yaml-workflows/crud.ts","../routes/yaml-workflows/deployment.ts","../routes/yaml-workflows/index.ts","../routes/yaml-workflows/versions.ts","../scripts/ortho-populate.ts","../scripts/process-helpers.ts","../scripts/process.ts","../scripts/token.ts","../sdk/index.ts","../services/dba.ts","../services/hotmesh-utils.ts","../services/workflow-invocation.ts","../services/agent/index.ts","../services/agent/input-mapper.ts","../services/agent/sql.ts","../services/agent/subscription-sql.ts","../services/agent/subscriptions.ts","../services/agent/trigger-registry.ts","../services/auth/bot-api-key.ts","../services/auth/delegation.ts","../services/auth/index.ts","../services/auth/service-token.ts","../services/auth/sql.ts","../services/config/cache.ts","../services/config/index.ts","../services/config/provider.ts","../services/config/read.ts","../services/config/sql.ts","../services/config/write.ts","../services/controlplane/index.ts","../services/controlplane/quorum-bridge.ts","../services/controlplane/sql.ts","../services/controlplane/stream-messages-sql.ts","../services/controlplane/types.ts","../services/cron/index.ts","../services/diagnostics/index.ts","../services/diagnostics/patterns.ts","../services/escalation/bulk.ts","../services/escalation/client.ts","../services/escalation/crud.ts","../services/escalation/facet-sql.ts","../services/escalation/facets.ts","../services/escalation/index.ts","../services/escalation/map.ts","../services/escalation/metrics-cache.ts","../services/escalation/queries.ts","../services/escalation/sql.ts","../services/escalation/types.ts","../services/escalation-strategy/default.ts","../services/escalation-strategy/index.ts","../services/escalation-strategy/mcp.ts","../services/export/client.ts","../services/export/index.ts","../services/export/post-process.ts","../services/export/types.ts","../services/iam/activity.ts","../services/iam/bots.ts","../services/iam/context.ts","../services/iam/credentials.ts","../services/iam/envelope.ts","../services/iam/ephemeral.ts","../services/iam/index.ts","../services/iam/principal.ts","../services/iam/resolve.ts","../services/iam/sql.ts","../services/insight/index.ts","../services/insight/prompts.ts","../services/interceptor/activity-interceptor.ts","../services/interceptor/completion.ts","../services/interceptor/context.ts","../services/interceptor/escalation.ts","../services/interceptor/index.ts","../services/interceptor/lifecycle.ts","../services/interceptor/state.ts","../services/interceptor/types.ts","../services/interceptor/activities/config.ts","../services/interceptor/activities/escalation.ts","../services/interceptor/activities/index.ts","../services/interceptor/activities/task.ts","../services/interceptor/activities/workflow.ts","../services/llm/detect.ts","../services/llm/index.ts","../services/llm/translate.ts","../services/llm/types.ts","../services/llm/providers/anthropic.ts","../services/llm/providers/openai.ts","../services/maintenance/index.ts","../services/mcp/adapter.ts","../services/mcp/db.ts","../services/mcp/exposure.ts","../services/mcp/external-server.ts","../services/mcp/index.ts","../services/mcp/register-tool.ts","../services/mcp/seed-service-account.ts","../services/mcp/server-lifecycle.ts","../services/mcp/server-tools.ts","../services/mcp/server.ts","../services/mcp/sql.ts","../services/mcp/types.ts","../services/mcp/workflow-compiler-server.ts","../services/mcp/workflow-server.ts","../services/mcp/client/connection-dispatch.ts","../services/mcp/client/connection-lifecycle.ts","../services/mcp/client/connection-test.ts","../services/mcp/client/connection.ts","../services/mcp/client/index.ts","../services/mcp/client/tools.ts","../services/mcp/db-server/index.ts","../services/mcp/db-server/schemas.ts","../services/mcp/db-server/tools.ts","../services/mcp/playwright-server/index.ts","../services/mcp/playwright-server/lifecycle.ts","../services/mcp/playwright-server/schemas.ts","../services/mcp/playwright-server/tools.ts","../services/namespace/index.ts","../services/namespace/sql.ts","../services/namespace/types.ts","../services/oauth/crypto.ts","../services/oauth/db.ts","../services/oauth/index.ts","../services/oauth/sql.ts","../services/oauth/state.ts","../services/oauth/providers/anthropic.ts","../services/oauth/providers/github.ts","../services/oauth/providers/google.ts","../services/oauth/providers/index.ts","../services/oauth/providers/microsoft.ts","../services/oauth/providers/mock.ts","../services/oauth/providers/registry.ts","../services/oauth/providers/types.ts","../services/orchestrator/condition.ts","../services/orchestrator/index.ts","../services/orchestrator/types.ts","../services/overview/index.ts","../services/overview/sql.ts","../services/pipelines/enrichment.ts","../services/pipelines/events.ts","../services/pipelines/execution-builder.ts","../services/pipelines/index.ts","../services/pipelines/queries.ts","../services/pipelines/sql.ts","../services/pipelines/types.ts","../services/role/index.ts","../services/role/sql.ts","../services/role/types.ts","../services/task/crud.ts","../services/task/index.ts","../services/task/process.ts","../services/task/resolve.ts","../services/task/sql.ts","../services/task/types.ts","../services/topics/index.ts","../services/topics/sql.ts","../services/topics/system-topics.ts","../services/user/auth.ts","../services/user/crud.ts","../services/user/index.ts","../services/user/rbac.ts","../services/user/roles.ts","../services/user/scope.ts","../services/user/seed-admin.ts","../services/user/sql.ts","../services/user/sso-provision.ts","../services/user/types.ts","../services/workers/registry.ts","../services/workflow-sets/db.ts","../services/workflow-sets/index.ts","../services/workflow-sets/sql.ts","../services/yaml-workflow/builder-regenerate.ts","../services/yaml-workflow/db-utils.ts","../services/yaml-workflow/db-versions.ts","../services/yaml-workflow/db.ts","../services/yaml-workflow/deployer-helpers.ts","../services/yaml-workflow/deployer.ts","../services/yaml-workflow/generator.ts","../services/yaml-workflow/index.ts","../services/yaml-workflow/input-analyzer-helpers.ts","../services/yaml-workflow/input-analyzer.ts","../services/yaml-workflow/invoke.ts","../services/yaml-workflow/pipe-validator.ts","../services/yaml-workflow/sql.ts","../services/yaml-workflow/types.ts","../services/yaml-workflow/durable-compiler/index.ts","../services/yaml-workflow/durable-compiler/parser.ts","../services/yaml-workflow/durable-compiler/prompts.ts","../services/yaml-workflow/durable-compiler/types.ts","../services/yaml-workflow/pattern-detector/array-source.ts","../services/yaml-workflow/pattern-detector/collapse.ts","../services/yaml-workflow/pattern-detector/index.ts","../services/yaml-workflow/pattern-detector/run-detection.ts","../services/yaml-workflow/pattern-detector/types.ts","../services/yaml-workflow/pipeline/analyze.ts","../services/yaml-workflow/pipeline/extract-helpers.ts","../services/yaml-workflow/pipeline/extract.ts","../services/yaml-workflow/pipeline/index.ts","../services/yaml-workflow/pipeline/prompt-templates.ts","../services/yaml-workflow/pipeline/prompts.ts","../services/yaml-workflow/pipeline/validate.ts","../services/yaml-workflow/pipeline/build/dag-assembly.ts","../services/yaml-workflow/pipeline/build/dag.ts","../services/yaml-workflow/pipeline/build/index.ts","../services/yaml-workflow/pipeline/build/iteration.ts","../services/yaml-workflow/pipeline/build/metadata.ts","../services/yaml-workflow/pipeline/build/transform.ts","../services/yaml-workflow/pipeline/build/utils.ts","../services/yaml-workflow/pipeline/build/wiring.ts","../services/yaml-workflow/pipeline/compile/index.ts","../services/yaml-workflow/pipeline/compile/llm-call.ts","../services/yaml-workflow/pipeline/compile/parse-plan.ts","../services/yaml-workflow/pipeline/compile/summarize.ts","../services/yaml-workflow/workers/callbacks.ts","../services/yaml-workflow/workers/events.ts","../services/yaml-workflow/workers/index.ts","../services/yaml-workflow/workers/register.ts","../services/yaml-workflow/workers/scope.ts","../start/adapters.ts","../start/config.ts","../start/graph-workflows.ts","../start/index.ts","../start/server.ts","../start/socket-auth.ts","../start/workers.ts","../system/index.ts","../system/activities/claude-code.ts","../system/activities/file-storage.ts","../system/activities/http.ts","../system/activities/knowledge.ts","../system/activities/oauth.ts","../system/activities/schema-exchange.ts","../system/activities/sql.ts","../system/activities/triage/cache.ts","../system/activities/triage/context.ts","../system/activities/triage/discovery.ts","../system/activities/triage/index.ts","../system/activities/triage/llm.ts","../system/activities/triage/tools.ts","../system/mcp-servers/claude-code.ts","../system/mcp-servers/docs.ts","../system/mcp-servers/events.ts","../system/mcp-servers/file-storage.ts","../system/mcp-servers/http-fetch.ts","../system/mcp-servers/human-queue-schemas.ts","../system/mcp-servers/human-queue.ts","../system/mcp-servers/knowledge.ts","../system/mcp-servers/oauth.ts","../system/mcp-servers/schema-exchange.ts","../system/mcp-servers/translation.ts","../system/mcp-servers/vision-prompts.ts","../system/mcp-servers/vision.ts","../system/mcp-servers/workflow-compiler.ts","../system/mcp-servers/workflow.ts","../system/mcp-servers/admin/agent-subscriptions.ts","../system/mcp-servers/admin/agents.ts","../system/mcp-servers/admin/bot-accounts.ts","../system/mcp-servers/admin/controlplane.ts","../system/mcp-servers/admin/diagnostics.ts","../system/mcp-servers/admin/escalations.ts","../system/mcp-servers/admin/exports.ts","../system/mcp-servers/admin/index.ts","../system/mcp-servers/admin/maintenance.ts","../system/mcp-servers/admin/mcp-servers.ts","../system/mcp-servers/admin/ortho.ts","../system/mcp-servers/admin/overview.ts","../system/mcp-servers/admin/pipelines.ts","../system/mcp-servers/admin/schemas.ts","../system/mcp-servers/admin/settings.ts","../system/mcp-servers/admin/tasks.ts","../system/mcp-servers/admin/topics.ts","../system/mcp-servers/admin/users.ts","../system/mcp-servers/admin/workflow-config.ts","../system/mcp-servers/admin/workflows.ts","../system/mcp-servers/admin/yaml-workflows.ts","../system/mcp-servers/db-query/index.ts","../system/mcp-servers/db-query/schemas.ts","../system/mcp-servers/db-query/tools.ts","../system/seed/index.ts","../system/seed/tool-manifests-admin.ts","../system/seed/tool-manifests-data.ts","../system/seed/tool-manifests-escalation.ts","../system/seed/tool-manifests-events.ts","../system/seed/tool-manifests-knowledge.ts","../system/seed/tool-manifests-workflows.ts","../system/workflows/tool-result-guard.ts","../system/workflows/capability-invoke/activities.ts","../system/workflows/capability-invoke/index.ts","../system/workflows/mcp-deterministic/activities.ts","../system/workflows/mcp-deterministic/index.ts","../system/workflows/mcp-query/index.ts","../system/workflows/mcp-query/prompts.ts","../system/workflows/mcp-query/strategy-advisors.ts","../system/workflows/mcp-query/types.ts","../system/workflows/mcp-query/activities/caches.ts","../system/workflows/mcp-query/activities/discovery.ts","../system/workflows/mcp-query/activities/index.ts","../system/workflows/mcp-query/activities/llm.ts","../system/workflows/mcp-query/activities/tool-executor.ts","../system/workflows/mcp-query/activities/tool-loader.ts","../system/workflows/mcp-query-router/activities.ts","../system/workflows/mcp-query-router/index.ts","../system/workflows/mcp-query-router/prompts.ts","../system/workflows/mcp-triage/activities-proxy.ts","../system/workflows/mcp-triage/index.ts","../system/workflows/mcp-triage/prompts.ts","../system/workflows/mcp-triage/response-builders.ts","../system/workflows/mcp-triage/response.ts","../system/workflows/mcp-triage/types.ts","../system/workflows/mcp-triage-deterministic/activities.ts","../system/workflows/mcp-triage-deterministic/index.ts","../system/workflows/mcp-triage-router/activities.ts","../system/workflows/mcp-triage-router/index.ts","../system/workflows/mcp-workflow-builder/index.ts","../system/workflows/mcp-workflow-builder/prompts.ts","../system/workflows/mcp-workflow-builder/activities/caches.ts","../system/workflows/mcp-workflow-builder/activities/index.ts","../system/workflows/mcp-workflow-builder/activities/llm.ts","../system/workflows/mcp-workflow-builder/activities/tool-loader.ts","../system/workflows/mcp-workflow-planner/index.ts","../system/workflows/mcp-workflow-planner/prompts.ts","../system/workflows/mcp-workflow-planner/activities/analyze.ts","../system/workflows/mcp-workflow-planner/activities/index.ts","../system/workflows/mcp-workflow-planner/activities/persist.ts","../system/workflows/mcp-workflow-planner/activities/plan.ts","../system/workflows/shared/discovery.ts","../system/workflows/shared/index.ts","../system/workflows/shared/llm-caller.ts","../system/workflows/shared/prompts.ts","../system/workflows/shared/strategy-advisors.ts","../system/workflows/shared/tool-executor.ts","../system/workflows/shared/tool-loader.ts","../system/workflows/shared/types.ts","../types/agent.ts","../types/auth.ts","../types/config.ts","../types/delegation.ts","../types/discovery.ts","../types/envelope.ts","../types/escalation-strategy.ts","../types/escalation.ts","../types/events.ts","../types/export.ts","../types/express.d.ts","../types/facets.ts","../types/index.ts","../types/logger.ts","../types/maintenance.ts","../types/mcp.ts","../types/oauth.ts","../types/sdk.ts","../types/startup.ts","../types/task.ts","../types/telemetry.ts","../types/tool-context.ts","../types/user.ts","../types/workflow-set.ts","../types/workflow.ts","../types/yaml-workflow.ts","../workers/index.ts"],"version":"5.9.3"}
@@ -1,3 +1,19 @@
1
+ /**
2
+ * Reserved keys inside `lt_escalations.metadata`. Everything else in the bag
3
+ * is caller-owned. These ride the GIN-indexed surface so they survive the
4
+ * engine's atomic Leg1 write untouched and are queryable like any facet.
5
+ */
6
+ export declare const ESCALATION_METADATA_KEYS: {
7
+ /**
8
+ * Pins the lt_role_schemas version this escalation was created against.
9
+ * The resolver UI renders that exact snapshot even after the role's schema
10
+ * moves on; absent, the latest role schema applies. Set ergonomically via
11
+ * `conditionLT`'s `schemaVersion` config field.
12
+ */
13
+ readonly SCHEMA_VERSION: "schema_version";
14
+ /** Per-escalation resolver form override — a full JSON Schema embedded on the row. */
15
+ readonly FORM_SCHEMA: "form_schema";
16
+ };
1
17
  export type LTEscalationStatus = 'pending' | 'resolved' | 'cancelled'
2
18
  /** SLA timer on a `conditionLT`/`condition` wait fired first — the workflow resumed with `false`; the row is terminal */
3
19
  | 'expired';
@@ -1,7 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ESCALATION_METADATA_KEYS = void 0;
3
4
  exports.isEffectivelyClaimed = isEffectivelyClaimed;
4
5
  exports.isAvailable = isAvailable;
6
+ /**
7
+ * Reserved keys inside `lt_escalations.metadata`. Everything else in the bag
8
+ * is caller-owned. These ride the GIN-indexed surface so they survive the
9
+ * engine's atomic Leg1 write untouched and are queryable like any facet.
10
+ */
11
+ exports.ESCALATION_METADATA_KEYS = {
12
+ /**
13
+ * Pins the lt_role_schemas version this escalation was created against.
14
+ * The resolver UI renders that exact snapshot even after the role's schema
15
+ * moves on; absent, the latest role schema applies. Set ergonomically via
16
+ * `conditionLT`'s `schemaVersion` config field.
17
+ */
18
+ SCHEMA_VERSION: 'schema_version',
19
+ /** Per-escalation resolver form override — a full JSON Schema embedded on the row. */
20
+ FORM_SCHEMA: 'form_schema',
21
+ };
5
22
  /**
6
23
  * An escalation is "effectively claimed" when assigned_to is set
7
24
  * and assigned_until is in the future. Status remains 'pending'.
@@ -1,2 +1,2 @@
1
- import{j as o}from"./vendor-query-B2UbickB.js";import{c as n}from"./tasks-Bm1OKrJA.js";import{t as m}from"./index-CtDf8vvQ.js";import{f as c}from"./useEventHooks-_qCzU74s.js";import{u}from"./mcp-xddLBwUW.js";import{P as d}from"./PageHeaderWithStats-BWuD7s9c.js";import"./vendor-react-CXumBFUA.js";import"./vendor-icons-C1zVP_dv.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-Bg1HgukI.js.map
1
+ import{j as o}from"./vendor-query-B2UbickB.js";import{c as n}from"./tasks-DYCUi5nZ.js";import{t as m}from"./index-D-7W2AHB.js";import{f as c}from"./useEventHooks-SfWdyc5L.js";import{u}from"./mcp-D0Ha3aEo.js";import{P as d}from"./PageHeaderWithStats-yex5WmHB.js";import"./vendor-react-CXumBFUA.js";import"./vendor-icons-CEWCGPeJ.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-rZDVS2G_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminDashboard-Bg1HgukI.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-rZDVS2G_.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 v}from"./vendor-query-B2UbickB.js";import{a as re,d as le,b as oe}from"./agents-BRmmK6Y9.js";import{E as ce,C as de,u as pe,a as xe,b as ue,c as me}from"./CronLabel-CQy3DrUQ.js";import{b as he,u as fe}from"./index-CtDf8vvQ.js";import{P as ve}from"./PageHeader-BZJsEVOC.js";import{B as O,e as U,t as be,R as Y,l as M,p as Z,a6 as G,b as V,aP as ee,V as ye}from"./vendor-icons-C1zVP_dv.js";import{e as ge}from"./knowledge-pNDWACXB.js";import{R as te}from"./RunAsSelector-Cp6j3FEY.js";import{u as je}from"./workflows-CT6nTL1I.js";import{u as we}from"./yaml-workflows-CdfjkOKU.js";import{u as se}from"./capabilities-DDgC_Kds.js";import{u as Ne}from"./topics-BVIqtmd4.js";import{W as Q}from"./WorkflowPill-pPUqmx6Q.js";import{e as _e,c as ke,f as Ce}from"./vendor-react-CXumBFUA.js";import"./BotPicker-DY6iUVC9.js";import"./bots-BD75mzGG.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Se={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},qe={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,x,u;const r=(x=(o=s.behaviors)==null?void 0:o.schedules)!=null&&x.length?s.behaviors.schedules.map(n=>({cron:n.cron||"",reaction_type:n.reaction_type||"durable",workflow_type:n.workflow_type||"",pipeline_id:n.pipeline_id||"",server_id:n.server_id||"",tool_name:n.tool_name||"",envelope:n.envelope?JSON.stringify(n.envelope,null,2):"{}",execute_as:n.execute_as||""})):(u=s.behaviors)!=null&&u.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(n=>({id:n.id,topic:n.topic,filter:n.filter?JSON.stringify(n.filter,null,2):"",reaction_type:n.reaction_type,workflow_type:n.workflow_type??"",pipeline_id:n.pipeline_id??"",mcp_prompt:n.mcp_prompt??"",server_id:n.server_id??"",tool_name:n.tool_name??"",input_mapping:JSON.stringify(n.input_mapping??{},null,2),execute_as:n.execute_as??"",enabled:n.enabled})),schedules:r}}function Ae(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 Oe(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 Ee(s,a,r,o){let x;try{x=JSON.parse(s)}catch{x={}}const u=o.includes(a),n=r===""||r===void 0||r===null||Array.isArray(r)&&r.length===0||r==="[]";if(!u&&n){const{[a]:p,...c}=x;return JSON.stringify(c,null,2)}let h=r;if(typeof r=="string")try{const p=JSON.parse(r);Array.isArray(p)&&(h=p)}catch{}return JSON.stringify({...x,[a]:h},null,2)}const S="section-header mt-[3em] first:mt-0",P="label",_="hint",R="input",L="input-json w-full";function Pe({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-[12px] 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(O,{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:R}),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:R}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function $e({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-[12px] 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(O,{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:`${R} 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:`${R} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Ie({form:s,set:a}){const{data:r}=ge(),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-[12px] 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(O,{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:R,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-[10px] text-text-quaternary",children:[x.count," entries"]}),e.jsx("span",{className:"text-[9px] text-text-quaternary",children:e.jsx(he,{date:x.latest})})]},x.domain))})]})]})}function We({serverId:s,toolName:a,onChange:r}){const{data:o}=se(),x=v.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[u,n]=v.useState(!1),[h,p]=v.useState(""),c=v.useRef(null),f=v.useRef(null);v.useEffect(()=>{if(!u)return;function t(i){f.current&&!f.current.contains(i.target)&&n(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[u]);const l=a?`${a}`:"",d=u?h:l,y=v.useMemo(()=>{const t=(u?h:"").toLowerCase();return t?x.filter(i=>i.name.toLowerCase().includes(t)||i.serverName.toLowerCase().includes(t)||(i.description??"").toLowerCase().includes(t)):x},[x,h,u]),m=a?x.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:f,className:"relative",children:[e.jsx("input",{ref:c,type:"text",value:d,onFocus:()=>{n(!0),p(l)},onChange:t=>{const i=t.target.value;p(i),i||r("",""),u||n(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!u&&(m==null?void 0:m.description)&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-1 italic",children:m.description}),u&&y.length>0&&e.jsx("div",{className:"absolute z-50 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),n(!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-[11px] 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-[9px] font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(be,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),u&&y.length===0&&h&&e.jsx("div",{className:"absolute z-50 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-[11px] text-text-quaternary",children:['No capabilities match "',h,'"']})})]})}const Te={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Me=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:r,onWorkflowTypeChange:o,pipelineId:x,onPipelineIdChange:u,serverId:n,toolName:h,onCapabilityChange:p,mcpPrompt:c,onMcpPromptChange:f,availableTypes:l=[...Me]}){const{data:d}=je(),y=(d??[]).filter(i=>i.invocable).map(i=>i.workflow_type),{data:m}=we({status:"active"}),t=((m==null?void 0:m.workflows)??[]).map(i=>({id:i.id,name:i.graph_topic||i.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:l.map(i=>{const b=s===i;return e.jsx("button",{type:"button",onClick:()=>a(i),className:`px-3 py-1.5 text-[11px] font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Te[i]},i)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:r,onChange:i=>o(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),y.map(i=>e.jsx("option",{value:i,children:i},i))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:x,onChange:i=>u(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(We,{serverId:n,toolName:h,onChange:p})]}),s==="mcp_query"&&f&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:c??"",onChange:i=>f(i.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Le={task:"bg-blue-400/15 text-blue-400",workflow:"bg-accent/15 text-accent",escalation:"bg-amber-400/15 text-amber-400",activity:"bg-cyan-400/15 text-cyan-400",knowledge:"bg-violet-400/15 text-violet-400",file:"bg-orange-400/15 text-orange-400",agent:"bg-emerald-400/15 text-emerald-400",app:"bg-rose-400/15 text-rose-400",milestone:"bg-violet-400/15 text-violet-400"};function Je({form:s,set:a}){const{data:r}=Ne({limit:200}),{data:o}=se(),x=(r==null?void 0:r.topics)??[],u=v.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[n,h]=v.useState(0),p=(t,i,b)=>{const g=[...s.subscriptions];g[t]={...g[t],[i]:b},a("subscriptions",g)},c=()=>{a("subscriptions",[...s.subscriptions,{...Se}]),h(s.subscriptions.length)},f=t=>{a("subscriptions",s.subscriptions.filter((i,b)=>b!==t)),n>=s.subscriptions.length-1&&h(Math.max(0,s.subscriptions.length-2))},l=s.subscriptions,d=l[n],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,m=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-[12px] 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(O,{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-[11px] 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-[12px] 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(O,{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,i)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${n===i?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>h(i),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-1.5 h-1.5 rounded-full shrink-0 ${y(t)?"bg-emerald-400":"bg-zinc-500"}`}),e.jsx("span",{className:"text-[11px] font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-[9px] 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 v}from"./vendor-query-B2UbickB.js";import{a as re,d as le,b as oe}from"./agents-j2YErVp4.js";import{E as ce,C as de,u as pe,a as xe,b as ue,c as me}from"./CronLabel-CymxLvY0.js";import{b as he,u as fe}from"./index-D-7W2AHB.js";import{P as ve}from"./PageHeader-BhaWTWcM.js";import{B as O,e as U,t as be,R as Y,l as M,p as Z,a6 as G,b as V,aP as ee,V as ye}from"./vendor-icons-CEWCGPeJ.js";import{e as ge}from"./knowledge-CSAbLtk7.js";import{R as te}from"./RunAsSelector-DA0h41ml.js";import{u as je}from"./workflows-DNPQ-j-7.js";import{u as we}from"./yaml-workflows-CA8BrFxc.js";import{u as se}from"./capabilities-Dz190EAa.js";import{u as Ne}from"./topics-CA7i8ymr.js";import{W as Q}from"./WorkflowPill-IDjTRfQ8.js";import{e as _e,c as ke,f as Ce}from"./vendor-react-CXumBFUA.js";import"./BotPicker-DGhniNcy.js";import"./bots-CD8Bl5pL.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Se={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},qe={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,x,u;const r=(x=(o=s.behaviors)==null?void 0:o.schedules)!=null&&x.length?s.behaviors.schedules.map(n=>({cron:n.cron||"",reaction_type:n.reaction_type||"durable",workflow_type:n.workflow_type||"",pipeline_id:n.pipeline_id||"",server_id:n.server_id||"",tool_name:n.tool_name||"",envelope:n.envelope?JSON.stringify(n.envelope,null,2):"{}",execute_as:n.execute_as||""})):(u=s.behaviors)!=null&&u.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(n=>({id:n.id,topic:n.topic,filter:n.filter?JSON.stringify(n.filter,null,2):"",reaction_type:n.reaction_type,workflow_type:n.workflow_type??"",pipeline_id:n.pipeline_id??"",mcp_prompt:n.mcp_prompt??"",server_id:n.server_id??"",tool_name:n.tool_name??"",input_mapping:JSON.stringify(n.input_mapping??{},null,2),execute_as:n.execute_as??"",enabled:n.enabled})),schedules:r}}function Ae(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 Oe(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 Ee(s,a,r,o){let x;try{x=JSON.parse(s)}catch{x={}}const u=o.includes(a),n=r===""||r===void 0||r===null||Array.isArray(r)&&r.length===0||r==="[]";if(!u&&n){const{[a]:p,...c}=x;return JSON.stringify(c,null,2)}let h=r;if(typeof r=="string")try{const p=JSON.parse(r);Array.isArray(p)&&(h=p)}catch{}return JSON.stringify({...x,[a]:h},null,2)}const S="section-header mt-[3em] first:mt-0",P="label",_="hint",R="input",L="input-json w-full";function Pe({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-[12px] 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(O,{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:R}),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:R}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function $e({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-[12px] 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(O,{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:`${R} 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:`${R} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Ie({form:s,set:a}){const{data:r}=ge(),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-[12px] 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(O,{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:R,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-[10px] text-text-quaternary",children:[x.count," entries"]}),e.jsx("span",{className:"text-[9px] text-text-quaternary",children:e.jsx(he,{date:x.latest})})]},x.domain))})]})]})}function We({serverId:s,toolName:a,onChange:r}){const{data:o}=se(),x=v.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[u,n]=v.useState(!1),[h,p]=v.useState(""),c=v.useRef(null),f=v.useRef(null);v.useEffect(()=>{if(!u)return;function t(i){f.current&&!f.current.contains(i.target)&&n(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[u]);const l=a?`${a}`:"",d=u?h:l,y=v.useMemo(()=>{const t=(u?h:"").toLowerCase();return t?x.filter(i=>i.name.toLowerCase().includes(t)||i.serverName.toLowerCase().includes(t)||(i.description??"").toLowerCase().includes(t)):x},[x,h,u]),m=a?x.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:f,className:"relative",children:[e.jsx("input",{ref:c,type:"text",value:d,onFocus:()=>{n(!0),p(l)},onChange:t=>{const i=t.target.value;p(i),i||r("",""),u||n(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!u&&(m==null?void 0:m.description)&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-1 italic",children:m.description}),u&&y.length>0&&e.jsx("div",{className:"absolute z-50 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),n(!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-[11px] 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-[9px] font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(be,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-[10px] text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),u&&y.length===0&&h&&e.jsx("div",{className:"absolute z-50 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-[11px] text-text-quaternary",children:['No capabilities match "',h,'"']})})]})}const Te={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Me=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:r,onWorkflowTypeChange:o,pipelineId:x,onPipelineIdChange:u,serverId:n,toolName:h,onCapabilityChange:p,mcpPrompt:c,onMcpPromptChange:f,availableTypes:l=[...Me]}){const{data:d}=je(),y=(d??[]).filter(i=>i.invocable).map(i=>i.workflow_type),{data:m}=we({status:"active"}),t=((m==null?void 0:m.workflows)??[]).map(i=>({id:i.id,name:i.graph_topic||i.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:l.map(i=>{const b=s===i;return e.jsx("button",{type:"button",onClick:()=>a(i),className:`px-3 py-1.5 text-[11px] font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Te[i]},i)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:r,onChange:i=>o(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),y.map(i=>e.jsx("option",{value:i,children:i},i))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:x,onChange:i=>u(i.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(We,{serverId:n,toolName:h,onChange:p})]}),s==="mcp_query"&&f&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:c??"",onChange:i=>f(i.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Le={task:"bg-blue-400/15 text-blue-400",workflow:"bg-accent/15 text-accent",escalation:"bg-amber-400/15 text-amber-400",activity:"bg-cyan-400/15 text-cyan-400",knowledge:"bg-violet-400/15 text-violet-400",file:"bg-orange-400/15 text-orange-400",agent:"bg-emerald-400/15 text-emerald-400",app:"bg-rose-400/15 text-rose-400",milestone:"bg-violet-400/15 text-violet-400"};function Je({form:s,set:a}){const{data:r}=Ne({limit:200}),{data:o}=se(),x=(r==null?void 0:r.topics)??[],u=v.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(i=>i.tools))??[]},[o]),[n,h]=v.useState(0),p=(t,i,b)=>{const g=[...s.subscriptions];g[t]={...g[t],[i]:b},a("subscriptions",g)},c=()=>{a("subscriptions",[...s.subscriptions,{...Se}]),h(s.subscriptions.length)},f=t=>{a("subscriptions",s.subscriptions.filter((i,b)=>b!==t)),n>=s.subscriptions.length-1&&h(Math.max(0,s.subscriptions.length-2))},l=s.subscriptions,d=l[n],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,m=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-[12px] 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(O,{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-[11px] 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-[12px] 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(O,{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,i)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${n===i?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>h(i),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-1.5 h-1.5 rounded-full shrink-0 ${y(t)?"bg-emerald-400":"bg-zinc-500"}`}),e.jsx("span",{className:"text-[11px] font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-[9px] 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.`)&&f(i)},className:"opacity-0 group-hover/sub:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},i)),e.jsxs("button",{onClick:c,className:"w-full flex items-center gap-1.5 px-3 py-2 text-[11px] 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(ze,{value:d.topic,onChange:t=>p(n,"topic",t),topics:x}),(m==null?void 0:m.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-[10px] text-text-quaternary mb-1 uppercase tracking-wider font-medium",children:"Payload Schema"}),e.jsx("pre",{className:"text-[11px] font-mono text-text-secondary whitespace-pre-wrap overflow-x-auto max-h-40",children:JSON.stringify(m.payload_schema.properties??m.payload_schema,null,2)}),m.description&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-2 italic",children:m.description})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:d.reaction_type,onReactionTypeChange:t=>p(n,"reaction_type",t),workflowType:d.workflow_type,onWorkflowTypeChange:t=>p(n,"workflow_type",t),pipelineId:d.pipeline_id,onPipelineIdChange:t=>p(n,"pipeline_id",t),serverId:d.server_id,toolName:d.tool_name,onCapabilityChange:(t,i)=>{var A;const b=[...s.subscriptions],g={...b[n],server_id:t,tool_name:i},k=u.find(w=>w.serverId===t&&w.name===i),E=(A=k==null?void 0:k.inputSchema)==null?void 0:A.properties;if(E&&i){const w={};for(const $ of Object.keys(E))$.startsWith("_")||(w[$]=`{event.data.${$}}`);g.input_mapping=JSON.stringify(w,null,2)}b[n]=g,a("subscriptions",b)},mcpPrompt:d.mcp_prompt,onMcpPromptChange:t=>p(n,"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(n,"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(n,"filter",t.target.value),placeholder:'{"extension": "png"}',className:`${R} 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(n,"filter",t.value),className:"px-2 py-0.5 text-[10px] 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(Fe,{tool:u.find(t=>t.serverId===d.server_id&&t.name===d.tool_name),value:d.input_mapping,onChange:t=>p(n,"input_mapping",t),eventSchema:m==null?void 0:m.payload_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:d.input_mapping,onChange:t=>p(n,"input_mapping",t.target.value),rows:10,className:L,placeholder:`{
4
4
  "data": {
@@ -13,4 +13,4 @@ This takes effect when you save.`)&&f(i)},className:"opacity-0 group-hover/sub:o
13
13
  This takes effect when you save.`)&&n(f)},className:"opacity-0 group-hover/sched:opacity-100 px-2 text-text-quaternary hover:text-red-400 transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},f)),e.jsxs("button",{onClick:u,className:"w-full flex items-center gap-1.5 px-3 py-2 text-[11px] 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:`${R} font-mono`}),p.cron&&e.jsx("p",{className:"text-[11px] text-accent/80 mt-1",children:z(p.cron)}),e.jsx("div",{className:"flex gap-3 mt-2 overflow-x-auto",children:Be.map(c=>e.jsx("button",{type:"button",onClick:()=>x(r,"cron",c),className:`text-[10px] 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,f)=>{x(r,"server_id",c),x(r,"tool_name",f)},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-[10px] text-text-quaternary w-20 shrink-0",children:s}),e.jsx("span",{className:"text-xs text-text-primary",children:a})]})}function Ye({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-rose-400",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-emerald-400",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-cyan-400",title:`Subscriptions (${s.subscriptions.length})`,children:s.subscriptions.length===0?e.jsx("span",{className:"text-[11px] 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(ce,{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-[10px]",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-[11px] text-text-quaternary",children:a.reaction_type})]})]},r))})}),e.jsx(W,{icon:G,color:"text-amber-400",title:`Schedules (${s.schedules.length})`,children:s.schedules.length===0?e.jsx("span",{className:"text-[11px] 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(de,{cron:a.cron})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-[10px]",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-[11px] text-text-quaternary",children:"no workflow"})]})]},r))})})]}),e.jsx("div",{className:"border-l-2 border-emerald-400/30 pl-3 py-2 mt-6",children:e.jsx("p",{className:"text-[11px] text-text-tertiary leading-relaxed",children:"After saving, subscriptions and schedules activate immediately. You can pause the automation anytime."})})]})}const Ge=[{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:ye}];function dt(){var H;const{id:s}=_e(),a=!s,r=ke(),{data:o}=fe(),u=!!((H=o==null?void 0:o.ai)!=null&&H.enabled)?"Agent":"Automation",{data:n,isLoading:h}=re(a?null:s),{data:p}=pe(a?null:s),c=le(),f=oe(),l=xe(),d=ue(),y=me(),[m,t]=v.useState(X),[i,b]=v.useState(!1),[g,k]=v.useState(""),[E,A]=Ce(),w=parseInt(E.get("step")||"1",10),$=v.useCallback(j=>{A(N=>{const q=new URLSearchParams(N);return q.set("step",String(j)),q},{replace:!0})},[A]);v.useEffect(()=>{if(!i){if(a){t(X),b(!0);return}n&&p&&(t(Re(n,p.subscriptions??[])),b(!0))}},[n,p,a,i]);const I=(j,N)=>t(q=>({...q,[j]:N})),ne=async()=>{k("");try{const j=Ae(m);let N=s;a?N=(await c.mutateAsync(j)).id:await f.mutateAsync({id:s,...j});const q=Oe(m),ie=(p==null?void 0:p.subscriptions)??[],J=new Set(ie.map(C=>C.id));for(const C of q)if(C.id&&J.has(C.id)){const{id:F,...D}=C;await d.mutateAsync({agentId:N,subId:F,...D}),J.delete(F)}else{const{id:F,...D}=C;await l.mutateAsync({agentId:N,...D})}for(const C of J)await y.mutateAsync({agentId:N,subId:C});r(`/agents/${N}`)}catch(j){k(j.message)}};if(!a&&h)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=c.isPending||f.isPending;return e.jsxs("div",{children:[e.jsx(ve,{title:a?`New ${u}`:`${u}: ${(n==null?void 0:n.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:Ge.map(j=>{const N=j.icon,q=w===j.id;return e.jsxs("button",{onClick:()=>$(j.id),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${q?"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:ne,disabled:!m.name.trim()||K,className:"w-full btn-primary text-xs disabled:opacity-50",children:K?"Saving...":a?`Create ${u}`:"Save"}),e.jsx("button",{onClick:()=>r(a?"/agents":`/agents/${s}`),className:"w-full btn-ghost text-xs",children:"Cancel"})]}),g&&e.jsx("p",{className:"text-xs text-status-error mt-3",children:g})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2",children:[w===1&&e.jsx(Pe,{form:m,set:I}),w===2&&e.jsx($e,{form:m,set:I}),w===3&&e.jsx(Ie,{form:m,set:I}),w===4&&e.jsx(Je,{form:m,set:I}),w===5&&e.jsx(Ue,{form:m,set:I}),w===6&&e.jsx(Ye,{form:m})]})]})]})}export{dt as AgentConfigPage};
16
- //# sourceMappingURL=AgentConfigPage-HBe_YDU_.js.map
16
+ //# sourceMappingURL=AgentConfigPage-CbyyCjCT.js.map