@hotmeshio/long-tail 0.25.0 → 0.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/services/domain/seed.d.ts +12 -10
- package/build/services/domain/seed.js +31 -25
- package/build/shared/form-validation/x-lt-roster.js +22 -3
- package/build/start/workers.d.ts +3 -0
- package/build/start/workers.js +15 -5
- package/build/types/startup.d.ts +8 -1
- package/dashboard/dist/assets/{AdminDashboard-DWVRAu63.js → AdminDashboard-C_0ShYrm.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-DWVRAu63.js.map → AdminDashboard-C_0ShYrm.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-Exjtjbvp.js → AgentConfigPage-Cc9dI8lO.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-Exjtjbvp.js.map → AgentConfigPage-Cc9dI8lO.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-nDbZo6RB.js → AgentDetailPage-Sdmt5j-k.js} +3 -3
- package/dashboard/dist/assets/{AgentDetailPage-nDbZo6RB.js.map → AgentDetailPage-Sdmt5j-k.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-Dsk9iHps.js → AgentsPage-BuzXc1mg.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-Dsk9iHps.js.map → AgentsPage-BuzXc1mg.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-D1mCqj8Z.js → AvailableEscalationsPage-DU84iaBN.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-D1mCqj8Z.js.map → AvailableEscalationsPage-DU84iaBN.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-u5760MWZ.js → BotPicker-Ci5PUrkl.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-u5760MWZ.js.map → BotPicker-Ci5PUrkl.js.map} +1 -1
- package/dashboard/dist/assets/{BulkAssignModal-CtISXXmW.js → BulkAssignModal-PLx7SLvF.js} +2 -2
- package/dashboard/dist/assets/{BulkAssignModal-CtISXXmW.js.map → BulkAssignModal-PLx7SLvF.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-BKIlrQfU.js → CapabilitiesPage-DuSfgr6i.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-BKIlrQfU.js.map → CapabilitiesPage-DuSfgr6i.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-DlBVTFqc.js → CollapsibleSection-KOO37qs6.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-DlBVTFqc.js.map → CollapsibleSection-KOO37qs6.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-Pabkchg_.js → ConfirmDeleteModal-CI1eE-Nr.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-Pabkchg_.js.map → ConfirmDeleteModal-CI1eE-Nr.js.map} +1 -1
- package/dashboard/dist/assets/{ConnectedAppsPage-DG2YZGN3.js → ConnectedAppsPage-DZgbCC0G.js} +2 -2
- package/dashboard/dist/assets/{ConnectedAppsPage-DG2YZGN3.js.map → ConnectedAppsPage-DZgbCC0G.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-5t8S2qMi.js → CountdownTimer-C-Ngk8oq.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-5t8S2qMi.js.map → CountdownTimer-C-Ngk8oq.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-CPVbYQow.js → CredentialsPage-BR7s6eVu.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-CPVbYQow.js.map → CredentialsPage-BR7s6eVu.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-C7UbTrO-.js → CronLabel-BQ7Y1Nfd.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-C7UbTrO-.js.map → CronLabel-BQ7Y1Nfd.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-Yz7-LbtE.js → ElapsedCell-BT49mUIc.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-Yz7-LbtE.js.map → ElapsedCell-BT49mUIc.js.map} +1 -1
- package/dashboard/dist/assets/{EntityTimelinePanel-xgPRdKEq.js → EntityTimelinePanel-BtARWy3R.js} +2 -2
- package/dashboard/dist/assets/{EntityTimelinePanel-xgPRdKEq.js.map → EntityTimelinePanel-BtARWy3R.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-CqCd-y6B.js → EscalationListSchemaPage-EEBsNpTe.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-CqCd-y6B.js.map → EscalationListSchemaPage-EEBsNpTe.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-D8YVQNph.js → EscalationSchemaPage-BHSC46Ow.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-D8YVQNph.js.map → EscalationSchemaPage-BHSC46Ow.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTimeline-D6jrDcBb.js → EscalationTimeline-BWTUBxUf.js} +2 -2
- package/dashboard/dist/assets/{EscalationTimeline-D6jrDcBb.js.map → EscalationTimeline-BWTUBxUf.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationTitleSelect-CGGT-QTu.js → EscalationTitleSelect-DOsfY4u8.js} +2 -2
- package/dashboard/dist/assets/{EscalationTitleSelect-CGGT-QTu.js.map → EscalationTitleSelect-DOsfY4u8.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-B7O4ttP4.js → EscalationsOverview-Bl8g53x-.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-B7O4ttP4.js.map → EscalationsOverview-Bl8g53x-.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-DJniXnhe.js → EventTable-Bjx17W_i.js} +2 -2
- package/dashboard/dist/assets/{EventTable-DJniXnhe.js.map → EventTable-Bjx17W_i.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-f-LEKcHI.js → FilterBar-Dnse0soD.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-f-LEKcHI.js.map → FilterBar-Dnse0soD.js.map} +1 -1
- package/dashboard/dist/assets/{FormattedValue-CUtv1g3k.js → FormattedValue-DeVrRJy4.js} +2 -2
- package/dashboard/dist/assets/{FormattedValue-CUtv1g3k.js.map → FormattedValue-DeVrRJy4.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-CR0MtYv8.js → GraphInvokePage-HQEvbHTd.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-CR0MtYv8.js.map → GraphInvokePage-HQEvbHTd.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-HVw7T5ER.js → HomePage-DizTklVg.js} +2 -2
- package/dashboard/dist/assets/{HomePage-HVw7T5ER.js.map → HomePage-DizTklVg.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-CTGK5BXW.js → ListToolbar-B0qe2QZ5.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-CTGK5BXW.js.map → ListToolbar-B0qe2QZ5.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-B2bbKKu2.js → McpOverview-DmH-qtX9.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-B2bbKKu2.js.map → McpOverview-DmH-qtX9.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-DgLxwwJy.js → McpQueryDetailPage-B-qtmwLd.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-DgLxwwJy.js.map → McpQueryDetailPage-B-qtmwLd.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-CSkczeJP.js → McpQueryPage-DX1T-Ugq.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-CSkczeJP.js.map → McpQueryPage-DX1T-Ugq.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-CrUsDPRD.js → McpRunDetailPage-DNdl10nB.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-CrUsDPRD.js.map → McpRunDetailPage-DNdl10nB.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-twxFdTtJ.js → McpRunsPage-DVXVB4AJ.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-twxFdTtJ.js.map → McpRunsPage-DVXVB4AJ.js.map} +1 -1
- package/dashboard/dist/assets/{OperationsPage-gOVMrL_a.js → OperationsPage-BxgWQq8v.js} +3 -3
- package/dashboard/dist/assets/{OperationsPage-gOVMrL_a.js.map → OperationsPage-BxgWQq8v.js.map} +1 -1
- package/dashboard/dist/assets/{OperatorDashboard-BoeZIyup.js → OperatorDashboard-Cw86vOPg.js} +2 -2
- package/dashboard/dist/assets/{OperatorDashboard-BoeZIyup.js.map → OperatorDashboard-Cw86vOPg.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-CDktk1mi.js → PersonaDetailPage-BTIJ4A6p.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-CDktk1mi.js.map → PersonaDetailPage-BTIJ4A6p.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-Bs097x07.js → PersonasPage-D11PokPb.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-Bs097x07.js.map → PersonasPage-D11PokPb.js.map} +1 -1
- package/dashboard/dist/assets/{PortalPage-DjfjerpF.js → PortalPage-1rXm0cNK.js} +2 -2
- package/dashboard/dist/assets/{PortalPage-DjfjerpF.js.map → PortalPage-1rXm0cNK.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessDetailPage-B30RatjD.js → ProcessDetailPage-Cp5-969g.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-B30RatjD.js.map → ProcessDetailPage-Cp5-969g.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-DrvjzgWT.js → ProcessesListPage-assXQe-x.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-DrvjzgWT.js.map → ProcessesListPage-assXQe-x.js.map} +1 -1
- package/dashboard/dist/assets/ResolverForm-CMzNjmGG.js +8 -0
- package/dashboard/dist/assets/ResolverForm-CMzNjmGG.js.map +1 -0
- package/dashboard/dist/assets/{RoleDetailPage-ClYgn-3d.js → RoleDetailPage-c_Qij0Tf.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-ClYgn-3d.js.map → RoleDetailPage-c_Qij0Tf.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-B_3qWsvQ.js → RolesPage-D4oaYgTg.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-B_3qWsvQ.js.map → RolesPage-D4oaYgTg.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-CbJT50Hp.js → RunAsSelector-Fptil_sB.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-CbJT50Hp.js.map → RunAsSelector-Fptil_sB.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-CIIDuh8w.js → ScanCodesPage-BeZA_YJW.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-CIIDuh8w.js.map → ScanCodesPage-BeZA_YJW.js.map} +1 -1
- package/dashboard/dist/assets/{ScanSchemeDetailPage-Bd3P3eyh.js → ScanSchemeDetailPage-Bxi15xNr.js} +2 -2
- package/dashboard/dist/assets/{ScanSchemeDetailPage-Bd3P3eyh.js.map → ScanSchemeDetailPage-Bxi15xNr.js.map} +1 -1
- package/dashboard/dist/assets/{ScanStationPage-BiO34nov.js → ScanStationPage-t5Bz957t.js} +2 -2
- package/dashboard/dist/assets/{ScanStationPage-BiO34nov.js.map → ScanStationPage-t5Bz957t.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-BNOuYZ1m.js → StickyPagination-C2drZk7w.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-BNOuYZ1m.js.map → StickyPagination-C2drZk7w.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-ALVUnfF1.js → StreamMessageDetail-x-l5653y.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-ALVUnfF1.js.map → StreamMessageDetail-x-l5653y.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-B5b8-xqI.js → SwimlaneTimeline-Ds_CqLXL.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-B5b8-xqI.js.map → SwimlaneTimeline-Ds_CqLXL.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-CoV3WcTA.js → TaskDetailPage-BJGKEnIo.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-CoV3WcTA.js.map → TaskDetailPage-BJGKEnIo.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-CkMmOYOE.js → TasksListPage-DyLaZvTT.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-CkMmOYOE.js.map → TasksListPage-DyLaZvTT.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-DVkFgECX.js → TimeAgo-B_Ta97uy.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-DVkFgECX.js.map → TimeAgo-B_Ta97uy.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-CfTc6Txy.js → TimestampCell-CiTYBQw-.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-CfTc6Txy.js.map → TimestampCell-CiTYBQw-.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-kvqZqM0A.js → ToolTestPanel-Dw8Zu6xr.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-kvqZqM0A.js.map → ToolTestPanel-Dw8Zu6xr.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-CjkAAyy8.js → TopicDetailPage-DPMAWKTN.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-CjkAAyy8.js.map → TopicDetailPage-DPMAWKTN.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-CJZnv50y.js → TopicsPage-0Z2lAE0d.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-CJZnv50y.js.map → TopicsPage-0Z2lAE0d.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-CPJPZnN1.js → UserName-DrAbCpdY.js} +2 -2
- package/dashboard/dist/assets/{UserName-CPJPZnN1.js.map → UserName-DrAbCpdY.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-46UV5pJd.js → WorkflowExecutionPage-DQITqX-6.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-46UV5pJd.js.map → WorkflowExecutionPage-DQITqX-6.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-DtxYdQbQ.js → WorkflowsDashboard-CMJPiR6G.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-DtxYdQbQ.js.map → WorkflowsDashboard-CMJPiR6G.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-Cg4LSfck.js → WorkflowsOverview-DwVMLe1y.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-Cg4LSfck.js.map → WorkflowsOverview-DwVMLe1y.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-Del-RCgi.js → YamlWorkflowDetailPage-Do6s_wmW.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-Del-RCgi.js.map → YamlWorkflowDetailPage-Do6s_wmW.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-BF6Jtx24.js → YamlWorkflowsPage-8Sr6rZMZ.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-BF6Jtx24.js.map → YamlWorkflowsPage-8Sr6rZMZ.js.map} +1 -1
- package/dashboard/dist/assets/{agents-wL-3dMOX.js → agents-Maom-dbf.js} +2 -2
- package/dashboard/dist/assets/{agents-wL-3dMOX.js.map → agents-Maom-dbf.js.map} +1 -1
- package/dashboard/dist/assets/{bots-D72EsztP.js → bots-BESWftTA.js} +2 -2
- package/dashboard/dist/assets/{bots-D72EsztP.js.map → bots-BESWftTA.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-DXFo6bRb.js → capabilities-BnvJAmFQ.js} +2 -2
- package/dashboard/dist/assets/{capabilities-DXFo6bRb.js.map → capabilities-BnvJAmFQ.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-gQdOgVtH.js → controlplane-Cu7TD1RX.js} +2 -2
- package/dashboard/dist/assets/{controlplane-gQdOgVtH.js.map → controlplane-Cu7TD1RX.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-CSE5wfWQ.js → escalation-columns-BPSH8qMx.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-CSE5wfWQ.js.map → escalation-columns-BPSH8qMx.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-items-BIgBWbaw.js → escalation-items-uDQTphVW.js} +2 -2
- package/dashboard/dist/assets/{escalation-items-BIgBWbaw.js.map → escalation-items-uDQTphVW.js.map} +1 -1
- package/dashboard/dist/assets/{index-BvH8T-jb.js → index-AJNPDsTI.js} +2 -2
- package/dashboard/dist/assets/{index-BvH8T-jb.js.map → index-AJNPDsTI.js.map} +1 -1
- package/dashboard/dist/assets/{index-Cu0xdX2t.js → index-B4SNhwgt.js} +2 -2
- package/dashboard/dist/assets/{index-Cu0xdX2t.js.map → index-B4SNhwgt.js.map} +1 -1
- package/dashboard/dist/assets/{index-ujGmmwl6.js → index-BG7OpNg7.js} +2 -2
- package/dashboard/dist/assets/{index-ujGmmwl6.js.map → index-BG7OpNg7.js.map} +1 -1
- package/dashboard/dist/assets/{index-BaCDL5fh.js → index-BLbZsMRG.js} +27 -27
- package/dashboard/dist/assets/index-BLbZsMRG.js.map +1 -0
- package/dashboard/dist/assets/{index-C1iuZ4Q5.js → index-BLlg1aVG.js} +2 -2
- package/dashboard/dist/assets/{index-C1iuZ4Q5.js.map → index-BLlg1aVG.js.map} +1 -1
- package/dashboard/dist/assets/{index-Btm8FtTQ.js → index-BkVarz6E.js} +2 -2
- package/dashboard/dist/assets/{index-Btm8FtTQ.js.map → index-BkVarz6E.js.map} +1 -1
- package/dashboard/dist/assets/{index-czgLyfSo.js → index-BpWutGxS.js} +2 -2
- package/dashboard/dist/assets/{index-czgLyfSo.js.map → index-BpWutGxS.js.map} +1 -1
- package/dashboard/dist/assets/{index-CptTEhWp.js → index-BvI2_dSt.js} +2 -2
- package/dashboard/dist/assets/{index-CptTEhWp.js.map → index-BvI2_dSt.js.map} +1 -1
- package/dashboard/dist/assets/{index-C-QQ5rKF.js → index-D5JQweUm.js} +2 -2
- package/dashboard/dist/assets/{index-C-QQ5rKF.js.map → index-D5JQweUm.js.map} +1 -1
- package/dashboard/dist/assets/{index-h1Useskt.js → index-WA8py2Yc.js} +2 -2
- package/dashboard/dist/assets/{index-h1Useskt.js.map → index-WA8py2Yc.js.map} +1 -1
- package/dashboard/dist/assets/{index-CDxOQ84B.js → index-_yHsJJTS.js} +2 -2
- package/dashboard/dist/assets/{index-CDxOQ84B.js.map → index-_yHsJJTS.js.map} +1 -1
- package/dashboard/dist/assets/index-kGSUZCOb.js +3 -0
- package/dashboard/dist/assets/index-kGSUZCOb.js.map +1 -0
- package/dashboard/dist/assets/{index-D1lfq5iZ.js → index-qY2KDGkM.js} +2 -2
- package/dashboard/dist/assets/{index-D1lfq5iZ.js.map → index-qY2KDGkM.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-150lsM68.js → knowledge-DCFRNG8R.js} +2 -2
- package/dashboard/dist/assets/{knowledge-150lsM68.js.map → knowledge-DCFRNG8R.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-CRtY4v5W.js → mcp-CZhOocmN.js} +2 -2
- package/dashboard/dist/assets/{mcp-CRtY4v5W.js.map → mcp-CZhOocmN.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-CDsSMaYq.js → mcp-query-Wt8z6yAL.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-CDsSMaYq.js.map → mcp-query-Wt8z6yAL.js.map} +1 -1
- package/dashboard/dist/assets/{personas-C2Wm4ng1.js → personas-D2_foqJm.js} +2 -2
- package/dashboard/dist/assets/{personas-C2Wm4ng1.js.map → personas-D2_foqJm.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-BH0F9-jf.js → pipelines-Bb159fNz.js} +2 -2
- package/dashboard/dist/assets/{pipelines-BH0F9-jf.js.map → pipelines-Bb159fNz.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-BkUVpaOa.js → tasks-xAU6C6tb.js} +2 -2
- package/dashboard/dist/assets/{tasks-BkUVpaOa.js.map → tasks-xAU6C6tb.js.map} +1 -1
- package/dashboard/dist/assets/{topics-Crl8HKHq.js → topics-DFdqb2Te.js} +2 -2
- package/dashboard/dist/assets/{topics-Crl8HKHq.js.map → topics-DFdqb2Te.js.map} +1 -1
- package/dashboard/dist/assets/{useDebouncedValue-Dk3r5xo-.js → useDebouncedValue-CbHmpS4w.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-Dk3r5xo-.js.map → useDebouncedValue-CbHmpS4w.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-BXuyHKAs.js → useNamespace-B_00X1yb.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-BXuyHKAs.js.map → useNamespace-B_00X1yb.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-DSlkjQfb.js → useYamlActivityEvents-B4F-s9g0.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-DSlkjQfb.js.map → useYamlActivityEvents-B4F-s9g0.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-B230v5Za.js → yaml-workflows-DyjbPFVp.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-B230v5Za.js.map → yaml-workflows-DyjbPFVp.js.map} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/docs/code-owned-configuration.md +2 -2
- package/docs/domain-dictionary.md +19 -3
- package/docs/faceted-routing.md +4 -3
- package/docs/hitl/x-lt-display.md +1 -1
- package/docs/hitl/x-lt-roster.md +2 -2
- package/package.json +1 -1
- package/dashboard/dist/assets/ResolverForm-Bl8Pibyz.js +0 -8
- package/dashboard/dist/assets/ResolverForm-Bl8Pibyz.js.map +0 -1
- package/dashboard/dist/assets/index-BaCDL5fh.js.map +0 -1
- package/dashboard/dist/assets/index-CED9cLE2.js +0 -3
- package/dashboard/dist/assets/index-CED9cLE2.js.map +0 -1
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
import type { DomainDictionary } from '../../types';
|
|
1
2
|
/**
|
|
2
|
-
* Seed the domain dictionary
|
|
3
|
+
* Seed the domain dictionary declared by the host: inline in the start
|
|
4
|
+
* config, or in a JSON file named by path.
|
|
3
5
|
*
|
|
4
6
|
* Default (db-owned): the same insert-if-absent + drift-log contract as
|
|
5
|
-
* seedWorkflowConfig/seedMcpServer
|
|
6
|
-
* row is never overwritten, and a name/version mismatch against the
|
|
7
|
-
* one drift warning.
|
|
7
|
+
* seedWorkflowConfig/seedMcpServer: the DB row is runtime truth, an existing
|
|
8
|
+
* row is never overwritten, and a name/version mismatch against the declared
|
|
9
|
+
* document logs one drift warning.
|
|
8
10
|
*
|
|
9
|
-
* With `apply` (code-owned): the
|
|
10
|
-
* as parsed values; a changed document is written through the same
|
|
11
|
-
* PUT path uses, advancing the row's version counter exactly once.
|
|
12
|
-
* identical document is a no-op.
|
|
11
|
+
* With `apply` (code-owned): the declared document is compared against the
|
|
12
|
+
* stored one as parsed values; a changed document is written through the same
|
|
13
|
+
* upsert the PUT path uses, advancing the row's version counter exactly once.
|
|
14
|
+
* An identical document is a no-op.
|
|
13
15
|
*
|
|
14
16
|
* WARN-ONLY validation: hosts commonly seed roles after long-tail boots, so
|
|
15
17
|
* unknown references log warnings here (the PUT path enforces them hard).
|
|
16
|
-
* Never throws
|
|
18
|
+
* Never throws: a missing or malformed file must not brick boot.
|
|
17
19
|
*/
|
|
18
|
-
export declare function seedDomainDictionary(
|
|
20
|
+
export declare function seedDomainDictionary(source: string | DomainDictionary, apply?: boolean): Promise<void>;
|
|
@@ -14,38 +14,27 @@ const write_1 = require("./write");
|
|
|
14
14
|
const read_1 = require("./read");
|
|
15
15
|
const sql_1 = require("./sql");
|
|
16
16
|
/**
|
|
17
|
-
* Seed the domain dictionary
|
|
17
|
+
* Seed the domain dictionary declared by the host: inline in the start
|
|
18
|
+
* config, or in a JSON file named by path.
|
|
18
19
|
*
|
|
19
20
|
* Default (db-owned): the same insert-if-absent + drift-log contract as
|
|
20
|
-
* seedWorkflowConfig/seedMcpServer
|
|
21
|
-
* row is never overwritten, and a name/version mismatch against the
|
|
22
|
-
* one drift warning.
|
|
21
|
+
* seedWorkflowConfig/seedMcpServer: the DB row is runtime truth, an existing
|
|
22
|
+
* row is never overwritten, and a name/version mismatch against the declared
|
|
23
|
+
* document logs one drift warning.
|
|
23
24
|
*
|
|
24
|
-
* With `apply` (code-owned): the
|
|
25
|
-
* as parsed values; a changed document is written through the same
|
|
26
|
-
* PUT path uses, advancing the row's version counter exactly once.
|
|
27
|
-
* identical document is a no-op.
|
|
25
|
+
* With `apply` (code-owned): the declared document is compared against the
|
|
26
|
+
* stored one as parsed values; a changed document is written through the same
|
|
27
|
+
* upsert the PUT path uses, advancing the row's version counter exactly once.
|
|
28
|
+
* An identical document is a no-op.
|
|
28
29
|
*
|
|
29
30
|
* WARN-ONLY validation: hosts commonly seed roles after long-tail boots, so
|
|
30
31
|
* unknown references log warnings here (the PUT path enforces them hard).
|
|
31
|
-
* Never throws
|
|
32
|
+
* Never throws: a missing or malformed file must not brick boot.
|
|
32
33
|
*/
|
|
33
|
-
async function seedDomainDictionary(
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
: path_1.default.join(process.cwd(), dictionaryPath);
|
|
37
|
-
let dictionary;
|
|
38
|
-
try {
|
|
39
|
-
if (!(0, fs_1.existsSync)(resolved)) {
|
|
40
|
-
logger_1.loggerRegistry.warn(`[lt-domain] domainDictionaryPath not found: ${resolved}`);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
dictionary = JSON.parse((0, fs_1.readFileSync)(resolved, 'utf-8'));
|
|
44
|
-
}
|
|
45
|
-
catch (err) {
|
|
46
|
-
logger_1.loggerRegistry.warn(`[lt-domain] dictionary file unreadable (${resolved}): ${err.message}`);
|
|
34
|
+
async function seedDomainDictionary(source, apply = false) {
|
|
35
|
+
const dictionary = typeof source === 'string' ? readDictionaryFile(source) : source;
|
|
36
|
+
if (!dictionary)
|
|
47
37
|
return;
|
|
48
|
-
}
|
|
49
38
|
try {
|
|
50
39
|
const registry = await (0, write_1.snapshotRegistries)();
|
|
51
40
|
const { errors, warnings, dictionary: derived } = (0, validate_1.validateDictionary)(dictionary, registry);
|
|
@@ -75,10 +64,27 @@ async function seedDomainDictionary(dictionaryPath, apply = false) {
|
|
|
75
64
|
// Row already existed — drift check on name/version only (no deep diff).
|
|
76
65
|
if (doc && (doc.name !== dictionary.name || doc.version !== dictionary.version)) {
|
|
77
66
|
logger_1.loggerRegistry.warn(`[lt-domain] dictionary drift: DB holds "${doc.name}" v${doc.version}, ` +
|
|
78
|
-
`
|
|
67
|
+
`start config declares "${dictionary.name}" v${dictionary.version}; DB is runtime truth`);
|
|
79
68
|
}
|
|
80
69
|
}
|
|
81
70
|
catch (err) {
|
|
82
71
|
logger_1.loggerRegistry.warn(`[lt-domain] dictionary seed failed: ${err.message}`);
|
|
83
72
|
}
|
|
84
73
|
}
|
|
74
|
+
/** The dictionary in a JSON file, resolved against the host cwd; null (logged) when missing or unreadable. */
|
|
75
|
+
function readDictionaryFile(dictionaryPath) {
|
|
76
|
+
const resolved = path_1.default.isAbsolute(dictionaryPath)
|
|
77
|
+
? dictionaryPath
|
|
78
|
+
: path_1.default.join(process.cwd(), dictionaryPath);
|
|
79
|
+
try {
|
|
80
|
+
if (!(0, fs_1.existsSync)(resolved)) {
|
|
81
|
+
logger_1.loggerRegistry.warn(`[lt-domain] domainDictionaryPath not found: ${resolved}`);
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return JSON.parse((0, fs_1.readFileSync)(resolved, 'utf-8'));
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
logger_1.loggerRegistry.warn(`[lt-domain] dictionary file unreadable (${resolved}): ${err.message}`);
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -166,7 +166,17 @@ function flagFor(def, row) {
|
|
|
166
166
|
}
|
|
167
167
|
return undefined;
|
|
168
168
|
}
|
|
169
|
-
/**
|
|
169
|
+
/** A row's creation instant in ms; 0 when absent or unreadable. */
|
|
170
|
+
function createdAt(row) {
|
|
171
|
+
const raw = row.escalation.created_at;
|
|
172
|
+
const ms = raw instanceof Date ? raw.getTime() : typeof raw === 'string' ? Date.parse(raw) : NaN;
|
|
173
|
+
return Number.isNaN(ms) ? 0 : ms;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* The expected keys in order, each with its member row (query) or label
|
|
177
|
+
* (batch). Several rows sharing a key (a member that parked again) read as
|
|
178
|
+
* one entry on the newest row, so its state and actions follow the live row.
|
|
179
|
+
*/
|
|
170
180
|
function expectedEntries(def, ctx, rows) {
|
|
171
181
|
const seen = new Set();
|
|
172
182
|
const out = [];
|
|
@@ -179,8 +189,17 @@ function expectedEntries(def, ctx, rows) {
|
|
|
179
189
|
const e = def.expected;
|
|
180
190
|
if ('query' in e) {
|
|
181
191
|
const template = def.key ?? DEFAULT_KEY;
|
|
182
|
-
|
|
183
|
-
|
|
192
|
+
const newest = new Map();
|
|
193
|
+
for (const row of rows) {
|
|
194
|
+
const key = (0, x_lt_help_1.interpolateHelp)(template, row);
|
|
195
|
+
const held = newest.get(key);
|
|
196
|
+
if (!held || createdAt(row) > createdAt(held))
|
|
197
|
+
newest.set(key, row);
|
|
198
|
+
}
|
|
199
|
+
for (const row of rows) {
|
|
200
|
+
const key = (0, x_lt_help_1.interpolateHelp)(template, row);
|
|
201
|
+
push(key, { row: newest.get(key) });
|
|
202
|
+
}
|
|
184
203
|
}
|
|
185
204
|
else if ('list' in e) {
|
|
186
205
|
strings((0, ctx_path_1.resolveCtxPath)(e.list, ctx)).forEach((k) => push(k));
|
package/build/start/workers.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LTStartConfig, LTWorkerConfig } from '../types/startup';
|
|
2
|
+
import type { DomainDictionary } from '../types/domain-manifest';
|
|
2
3
|
type WorkerEntry = {
|
|
3
4
|
taskQueue: string;
|
|
4
5
|
workflow: (...args: any[]) => any;
|
|
@@ -15,6 +16,8 @@ export declare function buildConnection(): {
|
|
|
15
16
|
class: unknown;
|
|
16
17
|
options: Record<string, unknown>;
|
|
17
18
|
};
|
|
19
|
+
/** The declared domain dictionary: the inline document or its file path. Both set is a startup error. */
|
|
20
|
+
export declare function domainDictionarySource(startConfig: LTStartConfig): string | DomainDictionary | undefined;
|
|
18
21
|
/**
|
|
19
22
|
* Collect all workers: system, optional examples, and user-provided.
|
|
20
23
|
*/
|
package/build/start/workers.js
CHANGED
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.buildConnection = buildConnection;
|
|
37
|
+
exports.domainDictionarySource = domainDictionarySource;
|
|
37
38
|
exports.collectWorkers = collectWorkers;
|
|
38
39
|
exports.startWorkers = startWorkers;
|
|
39
40
|
const hotmesh_1 = require("@hotmeshio/hotmesh");
|
|
@@ -71,6 +72,14 @@ function createNoOpWorkflow(name) {
|
|
|
71
72
|
function buildConnection() {
|
|
72
73
|
return (0, db_1.getConnection)();
|
|
73
74
|
}
|
|
75
|
+
/** The declared domain dictionary: the inline document or its file path. Both set is a startup error. */
|
|
76
|
+
function domainDictionarySource(startConfig) {
|
|
77
|
+
const { domainDictionary, domainDictionaryPath } = startConfig.mcp ?? {};
|
|
78
|
+
if (domainDictionary && domainDictionaryPath) {
|
|
79
|
+
throw new Error('mcp.domainDictionary and mcp.domainDictionaryPath are exclusive: declare the dictionary once');
|
|
80
|
+
}
|
|
81
|
+
return domainDictionary ?? domainDictionaryPath;
|
|
82
|
+
}
|
|
74
83
|
/**
|
|
75
84
|
* Collect all workers: system, optional examples, and user-provided.
|
|
76
85
|
*/
|
|
@@ -389,12 +398,13 @@ async function startWorkers(startConfig, workers, builtinMcpServerFactories) {
|
|
|
389
398
|
logger_1.loggerRegistry.warn(`[long-tail] config apply (topics): orphans: [${orphanTopics.join(', ')}]`);
|
|
390
399
|
}
|
|
391
400
|
}
|
|
392
|
-
// Seed the domain dictionary (every container, workers or not)
|
|
393
|
-
// insert-if-absent, the DB row is runtime
|
|
394
|
-
// compared and applied,
|
|
395
|
-
|
|
401
|
+
// Seed the domain dictionary (every container, workers or not), declared
|
|
402
|
+
// inline or by file. Db-owned: insert-if-absent, the DB row is runtime
|
|
403
|
+
// truth. Code-owned: compared and applied, one version bump per change.
|
|
404
|
+
const domainSource = domainDictionarySource(startConfig);
|
|
405
|
+
if (domainSource) {
|
|
396
406
|
const { seedDomainDictionary } = await Promise.resolve().then(() => __importStar(require('../services/domain')));
|
|
397
|
-
await seedDomainDictionary(
|
|
407
|
+
await seedDomainDictionary(domainSource, startConfig.mcp?.domainDictionaryReset ?? codeOwnedBoot);
|
|
398
408
|
}
|
|
399
409
|
// Seed example topics when examples are enabled
|
|
400
410
|
if (startConfig.examples) {
|
package/build/types/startup.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { LTOAuthStartConfig } from './oauth';
|
|
|
8
8
|
import type { LTOAuthServerConfig } from './oauth-server';
|
|
9
9
|
import type { LTTelemetryAdapter } from './telemetry';
|
|
10
10
|
import type { LTEventAdapter } from './events';
|
|
11
|
+
import type { DomainDictionary } from './domain-manifest';
|
|
11
12
|
import type { LTLoggerAdapter } from './logger';
|
|
12
13
|
import type { LTMaintenanceConfig } from './maintenance';
|
|
13
14
|
import type { LTMcpAdapter } from './mcp';
|
|
@@ -635,7 +636,13 @@ export interface LTStartConfig {
|
|
|
635
636
|
*/
|
|
636
637
|
domainDictionaryPath?: string;
|
|
637
638
|
/**
|
|
638
|
-
*
|
|
639
|
+
* The DomainDictionary declared inline, the same document a
|
|
640
|
+
* `domainDictionaryPath` file holds. Seeded and applied exactly as the
|
|
641
|
+
* file is. Declare one of the two; both set is a startup error.
|
|
642
|
+
*/
|
|
643
|
+
domainDictionary?: DomainDictionary;
|
|
644
|
+
/**
|
|
645
|
+
* Ownership override for the domain dictionary. `true` → the document is
|
|
639
646
|
* compared and applied on every boot (a changed document bumps the
|
|
640
647
|
* dictionary version, exactly like a PUT); `false` → the DB owns the
|
|
641
648
|
* document after first insert. Omitted → follows `configSource`.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as o}from"./vendor-query-DvWWuNIB.js";import{c as n}from"./tasks-
|
|
2
|
-
//# sourceMappingURL=AdminDashboard-
|
|
1
|
+
import{j as o}from"./vendor-query-DvWWuNIB.js";import{c as n}from"./tasks-xAU6C6tb.js";import{z as m,a9 as c}from"./index-BLbZsMRG.js";import{u}from"./mcp-CZhOocmN.js";import{P as d}from"./PageHeaderWithStats-B_f_Sz_Q.js";import"./vendor-react-_9U4mKFr.js";import"./vendor-icons-C_DQEeBy.js";function S(){var e;m();const{data:t}=n({limit:1}),{data:a}=c({status:"pending",limit:1}),{data:s}=u(),l=((e=s==null?void 0:s.servers)==null?void 0:e.filter(i=>i.status==="connected").length)??0,r=s?`${l}/${s.total}`:"—";return o.jsx("div",{children:o.jsx(d,{title:"Admin",stats:[{label:"Tasks",value:(t==null?void 0:t.total)??"—"},{label:"Pending Escalations",value:(a==null?void 0:a.total)??"—",dotClass:"bg-status-pending"},{label:"MCP Servers",value:r},{label:"System",value:"Healthy",dotClass:"bg-status-success"}]})})}export{S as AdminDashboard};
|
|
2
|
+
//# sourceMappingURL=AdminDashboard-C_0ShYrm.js.map
|
package/dashboard/dist/assets/{AdminDashboard-DWVRAu63.js.map → AdminDashboard-C_0ShYrm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminDashboard-
|
|
1
|
+
{"version":3,"file":"AdminDashboard-C_0ShYrm.js","sources":["../../src/pages/admin/AdminDashboard.tsx"],"sourcesContent":["import { useTasks } from '../../api/tasks';\nimport { useEscalations } from '../../api/escalations';\nimport { useEscalationListEvents } from '../../hooks/useEventHooks';\nimport { useMcpServers } from '../../api/mcp';\nimport { PageHeaderWithStats } from '../../components/common/layout/PageHeaderWithStats';\n\nexport function AdminDashboard() {\n useEscalationListEvents();\n const { data: taskData } = useTasks({ limit: 1 });\n const { data: pendingEsc } = useEscalations({ status: 'pending', limit: 1 });\n const { data: mcpData } = useMcpServers();\n\n const connectedServers =\n mcpData?.servers?.filter((s) => s.status === 'connected').length ?? 0;\n const mcpLabel = mcpData ? `${connectedServers}/${mcpData.total}` : '—';\n\n return (\n <div>\n <PageHeaderWithStats\n title=\"Admin\"\n stats={[\n { label: 'Tasks', value: taskData?.total ?? '—' },\n { label: 'Pending Escalations', value: pendingEsc?.total ?? '—', dotClass: 'bg-status-pending' },\n { label: 'MCP Servers', value: mcpLabel },\n { label: 'System', value: 'Healthy', dotClass: 'bg-status-success' },\n ]}\n />\n </div>\n );\n}\n"],"names":["AdminDashboard","useEscalationListEvents","taskData","useTasks","pendingEsc","useEscalations","mcpData","useMcpServers","connectedServers","_a","s","mcpLabel","jsx","PageHeaderWithStats"],"mappings":"oSAMO,SAASA,GAAiB,OAC/BC,EAAA,EACA,KAAM,CAAE,KAAMC,CAAA,EAAaC,EAAS,CAAE,MAAO,EAAG,EAC1C,CAAE,KAAMC,CAAA,EAAeC,EAAe,CAAE,OAAQ,UAAW,MAAO,EAAG,EACrE,CAAE,KAAMC,CAAA,EAAYC,EAAA,EAEpBC,IACJC,EAAAH,GAAA,YAAAA,EAAS,UAAT,YAAAG,EAAkB,OAAQC,GAAMA,EAAE,SAAW,aAAa,SAAU,EAChEC,EAAWL,EAAU,GAAGE,CAAgB,IAAIF,EAAQ,KAAK,GAAK,IAEpE,aACG,MAAA,CACC,SAAAM,EAAAA,IAACC,EAAA,CACC,MAAM,QACN,MAAO,CACL,CAAE,MAAO,QAAS,OAAOX,GAAA,YAAAA,EAAU,QAAS,GAAA,EAC5C,CAAE,MAAO,sBAAuB,OAAOE,GAAA,YAAAA,EAAY,QAAS,IAAK,SAAU,mBAAA,EAC3E,CAAE,MAAO,cAAe,MAAOO,CAAA,EAC/B,CAAE,MAAO,SAAU,MAAO,UAAW,SAAU,mBAAA,CAAoB,CACrE,CAAA,EAEJ,CAEJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,a as f}from"./vendor-query-DvWWuNIB.js";import{a as ce,d as le,b as oe}from"./agents-wL-3dMOX.js";import{E as de,C as xe,u as pe,a as ue,b as me,c as he}from"./CronLabel-C7UbTrO-.js";import{g as fe,a as ve,c as be,y as ye}from"./index-BaCDL5fh.js";import{P as ge}from"./PageHeader-C4z1ExF7.js";import{y as E,p as U,O as je,R as Y,h as M,A as Z,ay as G,g as V,bX as ee,ac as we}from"./vendor-icons-C_DQEeBy.js";import{g as Ne}from"./knowledge-150lsM68.js";import{R as te}from"./RunAsSelector-CbJT50Hp.js";import{u as _e}from"./yaml-workflows-B230v5Za.js";import{u as se}from"./capabilities-DXFo6bRb.js";import{u as ke}from"./topics-Crl8HKHq.js";import{W as Q}from"./WorkflowPill-Cly9Ln_3.js";import{e as Ce,u as Se,f as qe}from"./vendor-react-_9U4mKFr.js";import"./BotPicker-u5760MWZ.js";import"./bots-D72EsztP.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Oe={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},Ae={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,x,m;const r=(x=(o=s.behaviors)==null?void 0:o.schedules)!=null&&x.length?s.behaviors.schedules.map(i=>({cron:i.cron||"",reaction_type:i.reaction_type||"durable",workflow_type:i.workflow_type||"",pipeline_id:i.pipeline_id||"",server_id:i.server_id||"",tool_name:i.tool_name||"",envelope:i.envelope?JSON.stringify(i.envelope,null,2):"{}",execute_as:i.execute_as||""})):(m=s.behaviors)!=null&&m.cron?[{cron:s.behaviors.cron,reaction_type:"durable",workflow_type:s.workflow_type??"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""}]:[];return{name:s.id,description:s.description??"",goals:s.goals??"",rules:s.rules??"",user_id:s.user_id??"",knowledge_domain:s.knowledge_domain??"",subscriptions:a.map(i=>({id:i.id,topic:i.topic,filter:i.filter?JSON.stringify(i.filter,null,2):"",reaction_type:i.reaction_type,workflow_type:i.workflow_type??"",pipeline_id:i.pipeline_id??"",mcp_prompt:i.mcp_prompt??"",server_id:i.server_id??"",tool_name:i.tool_name??"",input_mapping:JSON.stringify(i.input_mapping??{},null,2),execute_as:i.execute_as??"",enabled:i.enabled})),schedules:r}}function Ee(s){var r;const a={};return s.schedules.length>0&&(a.schedules=s.schedules.map(o=>({cron:o.cron,reaction_type:o.reaction_type||"durable",workflow_type:o.reaction_type==="pipeline"?void 0:o.workflow_type,pipeline_id:o.reaction_type==="pipeline"?o.pipeline_id:void 0,envelope:B(o.envelope)??{},execute_as:o.execute_as||void 0})),a.cron=s.schedules[0].cron),{id:s.name,description:s.description||void 0,goals:s.goals||void 0,rules:s.rules||void 0,user_id:s.user_id||void 0,knowledge_domain:s.knowledge_domain||void 0,behaviors:a,workflow_type:((r=s.schedules[0])==null?void 0:r.workflow_type)||void 0,pipeline_id:void 0}}function $e(s){return s.subscriptions.map(a=>({id:a.id,topic:a.topic,filter:a.filter?B(a.filter):void 0,reaction_type:a.reaction_type,workflow_type:a.workflow_type||void 0,pipeline_id:a.pipeline_id||void 0,mcp_prompt:a.mcp_prompt||void 0,server_id:a.server_id||void 0,tool_name:a.tool_name||void 0,input_mapping:B(a.input_mapping)??{},execute_as:a.execute_as||void 0,enabled:a.enabled}))}function B(s){if(s.trim())try{return JSON.parse(s)}catch{return}}function Pe(s,a,r,o){let x;try{x=JSON.parse(s)}catch{x={}}const m=o.includes(a),i=r===""||r===void 0||r===null||Array.isArray(r)&&r.length===0||r==="[]";if(!m&&i){const{[a]:p,...l}=x;return JSON.stringify(l,null,2)}let u=r;if(typeof r=="string")try{const p=JSON.parse(r);Array.isArray(p)&&(u=p)}catch{}return JSON.stringify({...x,[a]:u},null,2)}const S="section-header mt-[3em] first:mt-0",P="label",_="hint",A="input",L="input-json w-full";function Ie({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:identity"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Identity",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Name *"}),e.jsx("input",{type:"text",value:s.name,onChange:r=>a("name",r.target.value),placeholder:"health-monitor",className:A}),e.jsx("p",{className:_,children:"Lowercase, kebab-case. This appears everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:r=>a("description",r.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:A}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function We({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:motivation"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Motivation",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Goals"}),e.jsx("textarea",{value:s.goals,onChange:r=>a("goals",r.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Primary motivation. What the automation is trying to achieve."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Rules"}),e.jsx("textarea",{value:s.rules,onChange:r=>a("rules",r.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Te({form:s,set:a}){const{data:r}=Ne(),o=(r==null?void 0:r.domains)??[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Assign a knowledge domain — the automation's memory. It stores context here over time."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:knowledge"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Knowledge",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Knowledge Domain"}),e.jsx("input",{type:"text",value:s.knowledge_domain,onChange:x=>a("knowledge_domain",x.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:A,list:"domain-suggestions"}),e.jsx("datalist",{id:"domain-suggestions",children:o.map(x=>e.jsx("option",{value:x.domain},x.domain))}),e.jsx("p",{className:_,children:"Choose an existing domain to share memory, or type a new name to create one."})]}),o.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Existing Domains"}),e.jsx("div",{className:"space-y-0.5 mt-2",children:o.map(x=>e.jsxs("button",{type:"button",onClick:()=>a("knowledge_domain",x.domain),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${s.knowledge_domain===x.domain?"border-l-2 border-l-accent bg-accent/5":"hover:bg-surface-hover border-l-2 border-l-transparent"}`,children:[e.jsx(U,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary flex-1",children:x.domain}),e.jsxs("span",{className:"text-2xs text-text-quaternary",children:[x.count," entries"]}),e.jsx("span",{className:"text-2xs text-text-quaternary",children:e.jsx(fe,{date:x.latest})})]},x.domain))})]})]})}function Me({serverId:s,toolName:a,onChange:r}){const{data:o}=se(),x=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[m,i]=f.useState(!1),[u,p]=f.useState(""),l=f.useRef(null),h=f.useRef(null);f.useEffect(()=>{if(!m)return;function t(n){h.current&&!h.current.contains(n.target)&&i(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[m]);const c=a?`${a}`:"",d=m?u:c,y=f.useMemo(()=>{const t=(m?u:"").toLowerCase();return t?x.filter(n=>n.name.toLowerCase().includes(t)||n.serverName.toLowerCase().includes(t)||(n.description??"").toLowerCase().includes(t)):x},[x,u,m]),v=a?x.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsx("input",{ref:l,type:"text",value:d,onFocus:()=>{i(!0),p(c)},onChange:t=>{const n=t.target.value;p(n),n||r("",""),m||i(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!m&&(v==null?void 0:v.description)&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-1 italic",children:v.description}),m&&y.length>0&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:y.map(t=>e.jsxs("button",{type:"button",onClick:()=>{r(t.serverId,t.name),p(t.name),i(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===t.serverId&&a===t.name?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-2xs font-mono text-text-primary shrink-0",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-2xs font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(je,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),m&&y.length===0&&u&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center",children:e.jsxs("p",{className:"text-2xs text-text-quaternary",children:['No capabilities match "',u,'"']})})]})}const Le={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Je=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:r,onWorkflowTypeChange:o,pipelineId:x,onPipelineIdChange:m,serverId:i,toolName:u,onCapabilityChange:p,mcpPrompt:l,onMcpPromptChange:h,availableTypes:c=[...Je]}){const{data:d}=ve(),y=(d??[]).filter(n=>n.invocable).map(n=>n.workflow_type),{data:v}=_e({status:"active"}),t=((v==null?void 0:v.workflows)??[]).map(n=>({id:n.id,name:n.graph_topic||n.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:c.map(n=>{const b=s===n;return e.jsx("button",{type:"button",onClick:()=>a(n),className:`px-3 py-1.5 text-2xs font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Le[n]},n)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:r,onChange:n=>o(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),y.map(n=>e.jsx("option",{value:n,children:n},n))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:x,onChange:n=>m(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(Me,{serverId:i,toolName:u,onChange:p})]}),s==="mcp_query"&&h&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:l??"",onChange:n=>h(n.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Fe={task:"bg-status-active/10 text-status-active",workflow:"bg-accent/15 text-accent",escalation:"bg-status-warning/10 text-status-warning",activity:"bg-status-active/10 text-status-active",knowledge:"bg-accent/10 text-accent",file:"bg-status-draft/10 text-status-draft",agent:"bg-status-success/10 text-status-success",app:"bg-status-error/10 text-status-error",milestone:"bg-accent/10 text-accent"};function De({form:s,set:a}){const{data:r}=ke({limit:200}),{data:o}=se(),x=(r==null?void 0:r.topics)??[],m=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[i,u]=f.useState(0),p=(t,n,b)=>{const g=[...s.subscriptions];g[t]={...g[t],[n]:b},a("subscriptions",g)},l=()=>{a("subscriptions",[...s.subscriptions,{...Oe}]),u(s.subscriptions.length)},h=t=>{a("subscriptions",s.subscriptions.filter((n,b)=>b!==t)),i>=s.subscriptions.length-1&&u(Math.max(0,s.subscriptions.length-2))},c=s.subscriptions,d=c[i],y=t=>t.topic?t.reaction_type==="durable"?!!t.workflow_type:t.reaction_type==="pipeline"?!!t.pipeline_id:t.reaction_type==="mcp_query"?!!t.mcp_prompt:t.reaction_type==="capability"?!!t.server_id&&!!t.tool_name:!1:!1,v=d?x.find(t=>t.topic===d.topic):void 0;return c.length===0?e.jsxs("div",{className:"max-w-xl",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Y,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"}),e.jsx("p",{className:"text-2xs text-text-quaternary max-w-sm mb-6",children:"Each subscription listens for a topic pattern and runs a workflow when it matches."}),e.jsxs("button",{onClick:l,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Add first subscription"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-52 shrink-0 space-y-0.5",children:[c.map((t,n)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${i===n?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>u(n),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${y(t)?"bg-status-success":"bg-surface-border"}`}),e.jsx("span",{className:"text-2xs font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-2xs text-text-quaternary ml-3",children:["→ ",t.workflow_type||t.tool_name||t.reaction_type]})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove subscription "${t.topic||"new"}"?
|
|
1
|
+
import{j as e,a as f}from"./vendor-query-DvWWuNIB.js";import{a as ce,d as le,b as oe}from"./agents-Maom-dbf.js";import{E as de,C as xe,u as pe,a as ue,b as me,c as he}from"./CronLabel-BQ7Y1Nfd.js";import{g as fe,a as ve,c as be,y as ye}from"./index-BLbZsMRG.js";import{P as ge}from"./PageHeader-C4z1ExF7.js";import{y as E,p as U,O as je,R as Y,h as M,A as Z,ay as G,g as V,bX as ee,ac as we}from"./vendor-icons-C_DQEeBy.js";import{g as Ne}from"./knowledge-DCFRNG8R.js";import{R as te}from"./RunAsSelector-Fptil_sB.js";import{u as _e}from"./yaml-workflows-DyjbPFVp.js";import{u as se}from"./capabilities-BnvJAmFQ.js";import{u as ke}from"./topics-DFdqb2Te.js";import{W as Q}from"./WorkflowPill-Cly9Ln_3.js";import{e as Ce,u as Se,f as qe}from"./vendor-react-_9U4mKFr.js";import"./BotPicker-Ci5PUrkl.js";import"./bots-BESWftTA.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Oe={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},Ae={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,x,m;const r=(x=(o=s.behaviors)==null?void 0:o.schedules)!=null&&x.length?s.behaviors.schedules.map(i=>({cron:i.cron||"",reaction_type:i.reaction_type||"durable",workflow_type:i.workflow_type||"",pipeline_id:i.pipeline_id||"",server_id:i.server_id||"",tool_name:i.tool_name||"",envelope:i.envelope?JSON.stringify(i.envelope,null,2):"{}",execute_as:i.execute_as||""})):(m=s.behaviors)!=null&&m.cron?[{cron:s.behaviors.cron,reaction_type:"durable",workflow_type:s.workflow_type??"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""}]:[];return{name:s.id,description:s.description??"",goals:s.goals??"",rules:s.rules??"",user_id:s.user_id??"",knowledge_domain:s.knowledge_domain??"",subscriptions:a.map(i=>({id:i.id,topic:i.topic,filter:i.filter?JSON.stringify(i.filter,null,2):"",reaction_type:i.reaction_type,workflow_type:i.workflow_type??"",pipeline_id:i.pipeline_id??"",mcp_prompt:i.mcp_prompt??"",server_id:i.server_id??"",tool_name:i.tool_name??"",input_mapping:JSON.stringify(i.input_mapping??{},null,2),execute_as:i.execute_as??"",enabled:i.enabled})),schedules:r}}function Ee(s){var r;const a={};return s.schedules.length>0&&(a.schedules=s.schedules.map(o=>({cron:o.cron,reaction_type:o.reaction_type||"durable",workflow_type:o.reaction_type==="pipeline"?void 0:o.workflow_type,pipeline_id:o.reaction_type==="pipeline"?o.pipeline_id:void 0,envelope:B(o.envelope)??{},execute_as:o.execute_as||void 0})),a.cron=s.schedules[0].cron),{id:s.name,description:s.description||void 0,goals:s.goals||void 0,rules:s.rules||void 0,user_id:s.user_id||void 0,knowledge_domain:s.knowledge_domain||void 0,behaviors:a,workflow_type:((r=s.schedules[0])==null?void 0:r.workflow_type)||void 0,pipeline_id:void 0}}function $e(s){return s.subscriptions.map(a=>({id:a.id,topic:a.topic,filter:a.filter?B(a.filter):void 0,reaction_type:a.reaction_type,workflow_type:a.workflow_type||void 0,pipeline_id:a.pipeline_id||void 0,mcp_prompt:a.mcp_prompt||void 0,server_id:a.server_id||void 0,tool_name:a.tool_name||void 0,input_mapping:B(a.input_mapping)??{},execute_as:a.execute_as||void 0,enabled:a.enabled}))}function B(s){if(s.trim())try{return JSON.parse(s)}catch{return}}function Pe(s,a,r,o){let x;try{x=JSON.parse(s)}catch{x={}}const m=o.includes(a),i=r===""||r===void 0||r===null||Array.isArray(r)&&r.length===0||r==="[]";if(!m&&i){const{[a]:p,...l}=x;return JSON.stringify(l,null,2)}let u=r;if(typeof r=="string")try{const p=JSON.parse(r);Array.isArray(p)&&(u=p)}catch{}return JSON.stringify({...x,[a]:u},null,2)}const S="section-header mt-[3em] first:mt-0",P="label",_="hint",A="input",L="input-json w-full";function Ie({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:identity"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Identity",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Name *"}),e.jsx("input",{type:"text",value:s.name,onChange:r=>a("name",r.target.value),placeholder:"health-monitor",className:A}),e.jsx("p",{className:_,children:"Lowercase, kebab-case. This appears everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:r=>a("description",r.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:A}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function We({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:motivation"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Motivation",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Goals"}),e.jsx("textarea",{value:s.goals,onChange:r=>a("goals",r.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Primary motivation. What the automation is trying to achieve."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Rules"}),e.jsx("textarea",{value:s.rules,onChange:r=>a("rules",r.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Te({form:s,set:a}){const{data:r}=Ne(),o=(r==null?void 0:r.domains)??[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Assign a knowledge domain — the automation's memory. It stores context here over time."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:knowledge"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Knowledge",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Knowledge Domain"}),e.jsx("input",{type:"text",value:s.knowledge_domain,onChange:x=>a("knowledge_domain",x.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:A,list:"domain-suggestions"}),e.jsx("datalist",{id:"domain-suggestions",children:o.map(x=>e.jsx("option",{value:x.domain},x.domain))}),e.jsx("p",{className:_,children:"Choose an existing domain to share memory, or type a new name to create one."})]}),o.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Existing Domains"}),e.jsx("div",{className:"space-y-0.5 mt-2",children:o.map(x=>e.jsxs("button",{type:"button",onClick:()=>a("knowledge_domain",x.domain),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${s.knowledge_domain===x.domain?"border-l-2 border-l-accent bg-accent/5":"hover:bg-surface-hover border-l-2 border-l-transparent"}`,children:[e.jsx(U,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary flex-1",children:x.domain}),e.jsxs("span",{className:"text-2xs text-text-quaternary",children:[x.count," entries"]}),e.jsx("span",{className:"text-2xs text-text-quaternary",children:e.jsx(fe,{date:x.latest})})]},x.domain))})]})]})}function Me({serverId:s,toolName:a,onChange:r}){const{data:o}=se(),x=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[m,i]=f.useState(!1),[u,p]=f.useState(""),l=f.useRef(null),h=f.useRef(null);f.useEffect(()=>{if(!m)return;function t(n){h.current&&!h.current.contains(n.target)&&i(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[m]);const c=a?`${a}`:"",d=m?u:c,y=f.useMemo(()=>{const t=(m?u:"").toLowerCase();return t?x.filter(n=>n.name.toLowerCase().includes(t)||n.serverName.toLowerCase().includes(t)||(n.description??"").toLowerCase().includes(t)):x},[x,u,m]),v=a?x.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsx("input",{ref:l,type:"text",value:d,onFocus:()=>{i(!0),p(c)},onChange:t=>{const n=t.target.value;p(n),n||r("",""),m||i(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!m&&(v==null?void 0:v.description)&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-1 italic",children:v.description}),m&&y.length>0&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:y.map(t=>e.jsxs("button",{type:"button",onClick:()=>{r(t.serverId,t.name),p(t.name),i(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===t.serverId&&a===t.name?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-2xs font-mono text-text-primary shrink-0",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-2xs font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(je,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),m&&y.length===0&&u&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center",children:e.jsxs("p",{className:"text-2xs text-text-quaternary",children:['No capabilities match "',u,'"']})})]})}const Le={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Je=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:r,onWorkflowTypeChange:o,pipelineId:x,onPipelineIdChange:m,serverId:i,toolName:u,onCapabilityChange:p,mcpPrompt:l,onMcpPromptChange:h,availableTypes:c=[...Je]}){const{data:d}=ve(),y=(d??[]).filter(n=>n.invocable).map(n=>n.workflow_type),{data:v}=_e({status:"active"}),t=((v==null?void 0:v.workflows)??[]).map(n=>({id:n.id,name:n.graph_topic||n.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:c.map(n=>{const b=s===n;return e.jsx("button",{type:"button",onClick:()=>a(n),className:`px-3 py-1.5 text-2xs font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Le[n]},n)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:r,onChange:n=>o(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),y.map(n=>e.jsx("option",{value:n,children:n},n))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:x,onChange:n=>m(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(Me,{serverId:i,toolName:u,onChange:p})]}),s==="mcp_query"&&h&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:l??"",onChange:n=>h(n.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Fe={task:"bg-status-active/10 text-status-active",workflow:"bg-accent/15 text-accent",escalation:"bg-status-warning/10 text-status-warning",activity:"bg-status-active/10 text-status-active",knowledge:"bg-accent/10 text-accent",file:"bg-status-draft/10 text-status-draft",agent:"bg-status-success/10 text-status-success",app:"bg-status-error/10 text-status-error",milestone:"bg-accent/10 text-accent"};function De({form:s,set:a}){const{data:r}=ke({limit:200}),{data:o}=se(),x=(r==null?void 0:r.topics)??[],m=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[i,u]=f.useState(0),p=(t,n,b)=>{const g=[...s.subscriptions];g[t]={...g[t],[n]:b},a("subscriptions",g)},l=()=>{a("subscriptions",[...s.subscriptions,{...Oe}]),u(s.subscriptions.length)},h=t=>{a("subscriptions",s.subscriptions.filter((n,b)=>b!==t)),i>=s.subscriptions.length-1&&u(Math.max(0,s.subscriptions.length-2))},c=s.subscriptions,d=c[i],y=t=>t.topic?t.reaction_type==="durable"?!!t.workflow_type:t.reaction_type==="pipeline"?!!t.pipeline_id:t.reaction_type==="mcp_query"?!!t.mcp_prompt:t.reaction_type==="capability"?!!t.server_id&&!!t.tool_name:!1:!1,v=d?x.find(t=>t.topic===d.topic):void 0;return c.length===0?e.jsxs("div",{className:"max-w-xl",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(Y,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"}),e.jsx("p",{className:"text-2xs text-text-quaternary max-w-sm mb-6",children:"Each subscription listens for a topic pattern and runs a workflow when it matches."}),e.jsxs("button",{onClick:l,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Add first subscription"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-52 shrink-0 space-y-0.5",children:[c.map((t,n)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${i===n?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>u(n),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${y(t)?"bg-status-success":"bg-surface-border"}`}),e.jsx("span",{className:"text-2xs font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-2xs text-text-quaternary ml-3",children:["→ ",t.workflow_type||t.tool_name||t.reaction_type]})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove subscription "${t.topic||"new"}"?
|
|
2
2
|
|
|
3
3
|
This takes effect when you save.`)&&h(n)},className:"opacity-0 group-hover/sub:opacity-100 px-2 text-text-quaternary hover:text-status-error transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},n)),e.jsxs("button",{onClick:l,className:"w-full flex items-center gap-1.5 px-3 py-2 text-2xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3 h-3"})," Add"]})]}),d&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"When this event fires"}),e.jsx(Ue,{value:d.topic,onChange:t=>p(i,"topic",t),topics:x}),(v==null?void 0:v.payload_schema)&&e.jsxs("div",{className:"mt-3 p-3 rounded-md bg-surface-sunken border border-surface-border",children:[e.jsx("p",{className:"text-2xs text-text-quaternary mb-1 uppercase tracking-wider font-medium",children:"Payload Schema"}),e.jsx("pre",{className:"text-2xs font-mono text-text-secondary whitespace-pre-wrap overflow-x-auto max-h-40",children:JSON.stringify(v.payload_schema.properties??v.payload_schema,null,2)}),v.description&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-2 italic",children:v.description})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:d.reaction_type,onReactionTypeChange:t=>p(i,"reaction_type",t),workflowType:d.workflow_type,onWorkflowTypeChange:t=>p(i,"workflow_type",t),pipelineId:d.pipeline_id,onPipelineIdChange:t=>p(i,"pipeline_id",t),serverId:d.server_id,toolName:d.tool_name,onCapabilityChange:(t,n)=>{var $;const b=[...s.subscriptions],g={...b[i],server_id:t,tool_name:n},k=m.find(q=>q.serverId===t&&q.name===n),R=($=k==null?void 0:k.inputSchema)==null?void 0:$.properties;if(R&&n){const q={};for(const w of Object.keys(R))w.startsWith("_")||(q[w]=`{event.data.${w}}`);g.input_mapping=JSON.stringify(q,null,2)}b[i]=g,a("subscriptions",b)},mcpPrompt:d.mcp_prompt,onMcpPromptChange:t=>p(i,"mcp_prompt",t)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:d.execute_as,onChange:t=>p(i,"execute_as",t)}),e.jsx("p",{className:_,children:"Identity used when invoking the workflow."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"But only if"}),e.jsx("input",{type:"text",value:d.filter,onChange:t=>p(i,"filter",t.target.value),placeholder:'{"extension": "png"}',className:`${A} font-mono text-xs`}),e.jsx("p",{className:_,children:"JSON filter against event.data. Click an operator to insert:"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:[{label:"equals",value:'{"key": "val"}'},{label:"not equal",value:'{"key": {"$ne": "val"}}'},{label:"in list",value:'{"key": {"$in": ["a", "b"]}}'},{label:"exists",value:'{"key": {"$exists": true}}'}].map(t=>e.jsx("button",{type:"button",onClick:()=>p(i,"filter",t.value),className:"px-2 py-0.5 text-2xs font-mono rounded bg-accent/8 text-accent hover:bg-accent/15 transition-colors",children:t.label},t.label))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),d.reaction_type==="capability"&&d.tool_name?e.jsx(ze,{tool:m.find(t=>t.serverId===d.server_id&&t.name===d.tool_name),value:d.input_mapping,onChange:t=>p(i,"input_mapping",t),eventSchema:v==null?void 0:v.payload_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:d.input_mapping,onChange:t=>p(i,"input_mapping",t.target.value),rows:10,className:L,placeholder:`{
|
|
4
4
|
"data": {
|
|
@@ -13,4 +13,4 @@ This takes effect when you save.`)&&h(n)},className:"opacity-0 group-hover/sub:o
|
|
|
13
13
|
This takes effect when you save.`)&&i(h)},className:"opacity-0 group-hover/sched:opacity-100 px-2 text-text-quaternary hover:text-status-error transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},h)),e.jsxs("button",{onClick:m,className:"w-full flex items-center gap-1.5 px-3 py-2 text-2xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3 h-3"})," Add"]})]}),p&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run every"}),e.jsx("input",{type:"text",value:p.cron,onChange:l=>x(r,"cron",l.target.value),placeholder:"0 * * * *",className:`${A} font-mono`}),p.cron&&e.jsx("p",{className:"text-2xs text-accent/80 mt-1",children:z(p.cron)}),e.jsx("div",{className:"flex gap-3 mt-2 overflow-x-auto",children:Ye.map(l=>e.jsx("button",{type:"button",onClick:()=>x(r,"cron",l),className:`text-2xs font-mono whitespace-nowrap transition-colors ${p.cron===l?"text-accent font-medium":"text-accent/50 hover:text-accent"}`,children:z(l)},l))})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:p.reaction_type,onReactionTypeChange:l=>x(r,"reaction_type",l),workflowType:p.workflow_type,onWorkflowTypeChange:l=>x(r,"workflow_type",l),pipelineId:p.pipeline_id,onPipelineIdChange:l=>x(r,"pipeline_id",l),serverId:p.server_id,toolName:p.tool_name,onCapabilityChange:(l,h)=>{x(r,"server_id",l),x(r,"tool_name",h)},availableTypes:["durable","pipeline","capability"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:p.execute_as,onChange:l=>x(r,"execute_as",l)}),e.jsx("p",{className:_,children:"Identity used when invoking."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),e.jsx("textarea",{value:p.envelope,onChange:l=>x(r,"envelope",l.target.value),rows:10,className:L,placeholder:`{
|
|
14
14
|
"data": { "source": "cron" }
|
|
15
15
|
}`}),e.jsx("p",{className:_,children:"Static payload passed to the workflow on each invocation."})]})]})]})]})}function W({icon:s,color:a,title:r,children:o}){return e.jsxs("div",{className:"mb-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 pb-1.5 border-b border-surface-border/40",children:[e.jsx(s,{className:`w-3.5 h-3.5 ${a}`,strokeWidth:1.5}),e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-widest text-accent/80",children:r})]}),e.jsx("div",{className:"pl-5.5",children:o})]})}function T({label:s,children:a}){return e.jsxs("div",{className:"flex gap-3 py-0.5",children:[e.jsx("span",{className:"text-2xs text-text-quaternary w-20 shrink-0",children:s}),e.jsx("span",{className:"text-xs text-text-primary",children:a})]})}function Ke({form:s}){return e.jsxs("div",{children:[e.jsxs(W,{icon:V,color:"text-accent",title:"Identity",children:[e.jsx(T,{label:"Name",children:s.name||"—"}),s.description&&e.jsx(T,{label:"Description",children:s.description})]}),(s.goals||s.rules)&&e.jsxs(W,{icon:ee,color:"text-accent",title:"Motivation",children:[s.goals&&e.jsx(T,{label:"Goals",children:s.goals}),s.rules&&e.jsx(T,{label:"Rules",children:s.rules})]}),e.jsx(W,{icon:U,color:"text-accent",title:"Knowledge",children:e.jsx(T,{label:"Domain",children:s.knowledge_domain||"None"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-10",children:[e.jsx(W,{icon:Y,color:"text-accent",title:`Subscriptions (${s.subscriptions.length})`,children:s.subscriptions.length===0?e.jsx("span",{className:"text-2xs text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.subscriptions.map((a,r)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(de,{topic:a.topic||"unset"})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-2xs",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-2xs text-text-quaternary",children:a.reaction_type})]})]},r))})}),e.jsx(W,{icon:G,color:"text-accent",title:`Schedules (${s.schedules.length})`,children:s.schedules.length===0?e.jsx("span",{className:"text-2xs text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.schedules.map((a,r)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(xe,{cron:a.cron})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-2xs",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-2xs text-text-quaternary",children:"no workflow"})]})]},r))})})]}),e.jsx("div",{className:"border-l-2 border-status-success/30 pl-3 py-2 mt-6",children:e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"After saving, subscriptions and schedules activate immediately. You can pause the automation anytime."})})]})}const He=[{id:1,label:"Identity",icon:V},{id:2,label:"Motivation",icon:ee},{id:3,label:"Knowledge",icon:U},{id:4,label:"Subscriptions",icon:Y},{id:5,label:"Schedules",icon:G},{id:6,label:"Review",icon:we}];function xt(){var H;const{id:s}=Ce(),a=!s,r=Se(),{data:o}=be(),x=ye(),i=(x!==null?x:!!((H=o==null?void 0:o.ai)!=null&&H.enabled))?"Agent":"Automation",{data:u,isLoading:p}=ce(a?null:s),{data:l}=pe(a?null:s),h=le(),c=oe(),d=ue(),y=me(),v=he(),[t,n]=f.useState(X),[b,g]=f.useState(!1),[k,R]=f.useState(""),[$,q]=qe(),w=parseInt($.get("step")||"1",10),ne=f.useCallback(j=>{q(N=>{const O=new URLSearchParams(N);return O.set("step",String(j)),O},{replace:!0})},[q]);f.useEffect(()=>{if(!b){if(a){n(X),g(!0);return}u&&l&&(n(Re(u,l.subscriptions??[])),g(!0))}},[u,l,a,b]);const I=(j,N)=>n(O=>({...O,[j]:N})),ie=async()=>{R("");try{const j=Ee(t);let N=s;a?N=(await h.mutateAsync(j)).id:await c.mutateAsync({id:s,...j});const O=$e(t),re=(l==null?void 0:l.subscriptions)??[],J=new Set(re.map(C=>C.id));for(const C of O)if(C.id&&J.has(C.id)){const{id:F,...D}=C;await y.mutateAsync({agentId:N,subId:F,...D}),J.delete(F)}else{const{id:F,...D}=C;await d.mutateAsync({agentId:N,...D})}for(const C of J)await v.mutateAsync({agentId:N,subId:C});r(`/agents/${N}`)}catch(j){R(j.message)}};if(!a&&p)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-60 bg-surface-sunken rounded"})]});const K=h.isPending||c.isPending;return e.jsxs("div",{children:[e.jsx(ge,{title:a?`New ${i}`:`${i}: ${(u==null?void 0:u.id)??""}`,docsHash:"#docs:agents.md"}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:He.map(j=>{const N=j.icon,O=w===j.id;return e.jsxs("button",{onClick:()=>ne(j.id),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${O?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(N,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:j.label})]},j.id)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:ie,disabled:!t.name.trim()||K,className:"w-full btn-primary text-xs disabled:opacity-50",children:K?"Saving...":a?`Create ${i}`:"Save"}),e.jsx("button",{onClick:()=>r(a?"/agents":`/agents/${s}`),className:"w-full btn-ghost text-xs",children:"Cancel"})]}),k&&e.jsx("p",{className:"text-xs text-status-error mt-3",children:k})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2",children:[w===1&&e.jsx(Ie,{form:t,set:I}),w===2&&e.jsx(We,{form:t,set:I}),w===3&&e.jsx(Te,{form:t,set:I}),w===4&&e.jsx(De,{form:t,set:I}),w===5&&e.jsx(Ge,{form:t,set:I}),w===6&&e.jsx(Ke,{form:t})]})]})]})}export{xt as AgentConfigPage};
|
|
16
|
-
//# sourceMappingURL=AgentConfigPage-
|
|
16
|
+
//# sourceMappingURL=AgentConfigPage-Cc9dI8lO.js.map
|