@hotmeshio/long-tail 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/build/api/escalations/accumulate.d.ts +96 -0
- package/build/api/escalations/accumulate.js +516 -0
- package/build/api/escalations/index.d.ts +1 -0
- package/build/api/escalations/index.js +10 -1
- package/build/api/roles.d.ts +4 -5
- package/build/api/roles.js +53 -4
- package/build/api/scan-codes/execute.js +2 -0
- package/build/api/scan-codes/verbs.d.ts +15 -0
- package/build/api/scan-codes/verbs.js +65 -0
- package/build/index.js +60 -0
- package/build/lib/db/schemas/036_role_portals.sql +12 -0
- package/build/routes/escalations/accumulate.d.ts +7 -0
- package/build/routes/escalations/accumulate.js +150 -0
- package/build/routes/escalations/index.js +5 -0
- package/build/sdk/index.d.ts +25 -0
- package/build/sdk/index.js +8 -0
- package/build/services/escalation/accumulate.d.ts +81 -0
- package/build/services/escalation/accumulate.js +154 -0
- package/build/services/escalation/index.d.ts +1 -0
- package/build/services/escalation/index.js +1 -0
- package/build/services/mcp/playwright-server/schemas.d.ts +2 -2
- package/build/services/orchestrator/condition.d.ts +40 -3
- package/build/services/orchestrator/condition.js +42 -2
- package/build/services/role/index.js +1 -0
- package/build/services/role/seed.js +6 -1
- package/build/services/role/sql.d.ts +6 -3
- package/build/services/role/sql.js +7 -2
- package/build/services/role/types.d.ts +38 -10
- package/build/services/role/types.js +10 -1
- package/build/services/scan-code/validate.js +16 -0
- package/build/shared/form-validation/display-only-widgets.d.ts +16 -0
- package/build/shared/form-validation/display-only-widgets.js +25 -0
- package/build/shared/form-validation/index.d.ts +2 -0
- package/build/shared/form-validation/index.js +2 -0
- package/build/shared/form-validation/x-lt-bind.d.ts +2 -14
- package/build/shared/form-validation/x-lt-bind.js +12 -8
- package/build/shared/form-validation/x-lt-invoke.d.ts +38 -0
- package/build/shared/form-validation/x-lt-invoke.js +103 -0
- package/build/system/mcp-servers/admin/escalations.js +39 -0
- package/build/system/mcp-servers/admin/schemas.d.ts +192 -13
- package/build/system/mcp-servers/admin/schemas.js +39 -3
- package/build/system/mcp-servers/admin/users.js +1 -0
- package/build/system/mcp-servers/docs.js +4 -0
- package/build/system/mcp-servers/human-queue-schemas.d.ts +85 -0
- package/build/system/mcp-servers/human-queue-schemas.js +19 -1
- package/build/system/mcp-servers/human-queue.d.ts +2 -0
- package/build/system/mcp-servers/human-queue.js +77 -0
- package/build/system/seed/tool-manifests-admin.d.ts +922 -103
- package/build/system/seed/tool-manifests-admin.js +4 -1
- package/build/system/seed/tool-manifests-escalation.d.ts +174 -0
- package/build/system/seed/tool-manifests-escalation.js +56 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/escalation.d.ts +52 -0
- package/build/types/escalation.js +29 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/index.js +3 -1
- package/build/types/scan-code.d.ts +24 -0
- package/build/types/scan-code.js +9 -0
- package/build/types/startup.d.ts +20 -0
- package/dashboard/dist/assets/{AdminDashboard-DplvDBti.js → AdminDashboard-uarpHB88.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-DplvDBti.js.map → AdminDashboard-uarpHB88.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-D8Bf6YxO.js → AgentConfigPage-BcUaDD5E.js} +6 -6
- package/dashboard/dist/assets/{AgentConfigPage-D8Bf6YxO.js.map → AgentConfigPage-BcUaDD5E.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-BN8g0Y2G.js → AgentDetailPage-BaZBhK6i.js} +3 -3
- package/dashboard/dist/assets/{AgentDetailPage-BN8g0Y2G.js.map → AgentDetailPage-BaZBhK6i.js.map} +1 -1
- package/dashboard/dist/assets/AgentsPage-CuVFSDc4.js +2 -0
- package/dashboard/dist/assets/{AgentsPage-7JJBHku8.js.map → AgentsPage-CuVFSDc4.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-iO5NyyIK.js +2 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-iO5NyyIK.js.map +1 -0
- package/dashboard/dist/assets/{BotPicker-CGCnIz8I.js → BotPicker-CClMby6B.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-CGCnIz8I.js.map → BotPicker-CClMby6B.js.map} +1 -1
- package/dashboard/dist/assets/BulkAssignModal-BL8FRgkN.js +2 -0
- package/dashboard/dist/assets/{BulkAssignModal-NJBcoj-f.js.map → BulkAssignModal-BL8FRgkN.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-D53ogPor.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-F8dpNn9B.js.map → CapabilitiesPage-D53ogPor.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-BZW6VpCU.js → CollapsibleSection-ow8jpbtD.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-BZW6VpCU.js.map → CollapsibleSection-ow8jpbtD.js.map} +1 -1
- package/dashboard/dist/assets/{ConfirmDeleteModal-64adXLdq.js → ConfirmDeleteModal-CeEDt9iJ.js} +2 -2
- package/dashboard/dist/assets/{ConfirmDeleteModal-64adXLdq.js.map → ConfirmDeleteModal-CeEDt9iJ.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-BxDub9d2.js → CountdownTimer-CSqyZMCG.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-BxDub9d2.js.map → CountdownTimer-CSqyZMCG.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-CnLzopLL.js → CredentialsPage-Dx7SxA23.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-CnLzopLL.js.map → CredentialsPage-Dx7SxA23.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-CAD5UYDT.js → CronLabel-LYPxpvNN.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-CAD5UYDT.js.map → CronLabel-LYPxpvNN.js.map} +1 -1
- package/dashboard/dist/assets/DataTable-spX1dFyb.js +2 -0
- package/dashboard/dist/assets/DataTable-spX1dFyb.js.map +1 -0
- package/dashboard/dist/assets/{DropZone-XlcY8hEH.js → DropZone-f1o-GLM8.js} +2 -2
- package/dashboard/dist/assets/{DropZone-XlcY8hEH.js.map → DropZone-f1o-GLM8.js.map} +1 -1
- package/dashboard/dist/assets/{ElapsedCell-CwO4ufd0.js → ElapsedCell-BZJTSm9N.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-CwO4ufd0.js.map → ElapsedCell-BZJTSm9N.js.map} +1 -1
- package/dashboard/dist/assets/EntityTimelinePanel-0wIIW2en.js +2 -0
- package/dashboard/dist/assets/{EntityTimelinePanel-CkF-oW-m.js.map → EntityTimelinePanel-0wIIW2en.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-h9JO_q5f.js → EscalationListSchemaPage-CoYvtMzj.js} +3 -3
- package/dashboard/dist/assets/{EscalationListSchemaPage-h9JO_q5f.js.map → EscalationListSchemaPage-CoYvtMzj.js.map} +1 -1
- package/dashboard/dist/assets/EscalationListView-DWFHPufv.js +2 -0
- package/dashboard/dist/assets/EscalationListView-DWFHPufv.js.map +1 -0
- package/dashboard/dist/assets/{EscalationSchemaPage-mJFL5_Se.js → EscalationSchemaPage-C9Xu_A25.js} +3 -3
- package/dashboard/dist/assets/{EscalationSchemaPage-mJFL5_Se.js.map → EscalationSchemaPage-C9Xu_A25.js.map} +1 -1
- package/dashboard/dist/assets/EscalationTimeline-D8W2LNNk.js +2 -0
- package/dashboard/dist/assets/EscalationTimeline-D8W2LNNk.js.map +1 -0
- package/dashboard/dist/assets/EscalationTitleSelect-DLK8NWMp.js +2 -0
- package/dashboard/dist/assets/EscalationTitleSelect-DLK8NWMp.js.map +1 -0
- package/dashboard/dist/assets/{EscalationsOverview-DlXUFqWJ.js → EscalationsOverview-CW57FaP9.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-DlXUFqWJ.js.map → EscalationsOverview-CW57FaP9.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-Ike2xchn.js → EventTable-D1ctWhKf.js} +2 -2
- package/dashboard/dist/assets/{EventTable-Ike2xchn.js.map → EventTable-D1ctWhKf.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-DMOR-O1c.js → FilterBar-C-iur-Nj.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-DMOR-O1c.js.map → FilterBar-C-iur-Nj.js.map} +1 -1
- package/dashboard/dist/assets/GraphInvokePage-CcA_44M4.js +2 -0
- package/dashboard/dist/assets/{GraphInvokePage-CKtvWowP.js.map → GraphInvokePage-CcA_44M4.js.map} +1 -1
- package/dashboard/dist/assets/HomePage-Dc085ghJ.js +2 -0
- package/dashboard/dist/assets/{HomePage-BQ3Q791Q.js.map → HomePage-Dc085ghJ.js.map} +1 -1
- package/dashboard/dist/assets/ListToolbar-h_ziBt4O.js +2 -0
- package/dashboard/dist/assets/{ListToolbar-DdJzj472.js.map → ListToolbar-h_ziBt4O.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-BbtrduWn.js → McpOverview-qXXhbNWV.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-BbtrduWn.js.map → McpOverview-qXXhbNWV.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-C1L4T-Wt.js → McpQueryDetailPage-SEzSbZrd.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-C1L4T-Wt.js.map → McpQueryDetailPage-SEzSbZrd.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryPage-Cy0V0kv9.js +2 -0
- package/dashboard/dist/assets/{McpQueryPage-CfJy7HZ7.js.map → McpQueryPage-Cy0V0kv9.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-CA9yv7he.js → McpRunDetailPage-DjJO5vSb.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-CA9yv7he.js.map → McpRunDetailPage-DjJO5vSb.js.map} +1 -1
- package/dashboard/dist/assets/McpRunsPage-BfjiJ8mM.js +2 -0
- package/dashboard/dist/assets/{McpRunsPage-D7QXjW9z.js.map → McpRunsPage-BfjiJ8mM.js.map} +1 -1
- package/dashboard/dist/assets/{NamespacePill-Bb3revqD.js → NamespacePill-DADRJOUl.js} +2 -2
- package/dashboard/dist/assets/{NamespacePill-Bb3revqD.js.map → NamespacePill-DADRJOUl.js.map} +1 -1
- package/dashboard/dist/assets/OperationsPage-dJcER0T_.js +3 -0
- package/dashboard/dist/assets/OperationsPage-dJcER0T_.js.map +1 -0
- package/dashboard/dist/assets/OperatorDashboard-zCkW4eqk.js +2 -0
- package/dashboard/dist/assets/{OperatorDashboard-sXNDh1Ph.js.map → OperatorDashboard-zCkW4eqk.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeader-Di5Sz3an.js → PageHeader-Csq434-v.js} +2 -2
- package/dashboard/dist/assets/{PageHeader-Di5Sz3an.js.map → PageHeader-Csq434-v.js.map} +1 -1
- package/dashboard/dist/assets/{PageHeaderWithStats-DutKJ-h2.js → PageHeaderWithStats-CSnk1p5A.js} +2 -2
- package/dashboard/dist/assets/{PageHeaderWithStats-DutKJ-h2.js.map → PageHeaderWithStats-CSnk1p5A.js.map} +1 -1
- package/dashboard/dist/assets/{PersonaDetailPage-NeHD-Gra.js → PersonaDetailPage-Cx6L3Jvu.js} +2 -2
- package/dashboard/dist/assets/{PersonaDetailPage-NeHD-Gra.js.map → PersonaDetailPage-Cx6L3Jvu.js.map} +1 -1
- package/dashboard/dist/assets/{PersonasPage-DavKXRWX.js → PersonasPage-DOgGUlJl.js} +2 -2
- package/dashboard/dist/assets/{PersonasPage-DavKXRWX.js.map → PersonasPage-DOgGUlJl.js.map} +1 -1
- package/dashboard/dist/assets/PortalPage-BKuL1BeJ.js +2 -0
- package/dashboard/dist/assets/PortalPage-BKuL1BeJ.js.map +1 -0
- package/dashboard/dist/assets/{ProcessDetailPage-DkdKJGe6.js → ProcessDetailPage-BFcFSDUv.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-DkdKJGe6.js.map → ProcessDetailPage-BFcFSDUv.js.map} +1 -1
- package/dashboard/dist/assets/ProcessesListPage-BaHV2cXp.js +2 -0
- package/dashboard/dist/assets/{ProcessesListPage-CjwVKe32.js.map → ProcessesListPage-BaHV2cXp.js.map} +1 -1
- package/dashboard/dist/assets/ResolverForm-Bgc0Zrya.js +7 -0
- package/dashboard/dist/assets/ResolverForm-Bgc0Zrya.js.map +1 -0
- package/dashboard/dist/assets/RoleDetailPage-BPY6i3CU.js +8 -0
- package/dashboard/dist/assets/RoleDetailPage-BPY6i3CU.js.map +1 -0
- package/dashboard/dist/assets/{RolePill-DhnVPK4q.js → RolePill-BafrASDX.js} +2 -2
- package/dashboard/dist/assets/{RolePill-DhnVPK4q.js.map → RolePill-BafrASDX.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-OM9KM8Pg.js → RolesPage-DSqqKPbv.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-OM9KM8Pg.js.map → RolesPage-DSqqKPbv.js.map} +1 -1
- package/dashboard/dist/assets/RunAsSelector-B29iWwel.js +2 -0
- package/dashboard/dist/assets/{RunAsSelector-fFMt1bGe.js.map → RunAsSelector-B29iWwel.js.map} +1 -1
- package/dashboard/dist/assets/{ScanCodesPage-AujH-pPQ.js → ScanCodesPage-S8aAJfnC.js} +2 -2
- package/dashboard/dist/assets/{ScanCodesPage-AujH-pPQ.js.map → ScanCodesPage-S8aAJfnC.js.map} +1 -1
- package/dashboard/dist/assets/{ScanSchemeDetailPage-eKQpmsC_.js → ScanSchemeDetailPage-CUBRAtmJ.js} +2 -2
- package/dashboard/dist/assets/{ScanSchemeDetailPage-eKQpmsC_.js.map → ScanSchemeDetailPage-CUBRAtmJ.js.map} +1 -1
- package/dashboard/dist/assets/ScanStationPage-R9t1-CeQ.js +2 -0
- package/dashboard/dist/assets/{ScanStationPage-C1_ppDoZ.js.map → ScanStationPage-R9t1-CeQ.js.map} +1 -1
- package/dashboard/dist/assets/{ScopeBadge-CXUg0FHo.js → ScopeBadge-b6MIBiYD.js} +2 -2
- package/dashboard/dist/assets/{ScopeBadge-CXUg0FHo.js.map → ScopeBadge-b6MIBiYD.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-B91Pk9xh.js → StickyPagination-CkW_A507.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-B91Pk9xh.js.map → StickyPagination-CkW_A507.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-C7SPqaJt.js → StreamMessageDetail-yzWX0wac.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-C7SPqaJt.js.map → StreamMessageDetail-yzWX0wac.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-BcHR8ylf.js → SwimlaneTimeline-Cf4DXFxj.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-BcHR8ylf.js.map → SwimlaneTimeline-Cf4DXFxj.js.map} +1 -1
- package/dashboard/dist/assets/{TagInput-BZ8vb2oW.js → TagInput-ZrIIrEUP.js} +2 -2
- package/dashboard/dist/assets/{TagInput-BZ8vb2oW.js.map → TagInput-ZrIIrEUP.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-Bqj0I_I0.js → TaskDetailPage-DCDcEps9.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-Bqj0I_I0.js.map → TaskDetailPage-DCDcEps9.js.map} +1 -1
- package/dashboard/dist/assets/{TaskQueuePill-Bxir8WRl.js → TaskQueuePill-DkQ1uc6y.js} +2 -2
- package/dashboard/dist/assets/{TaskQueuePill-Bxir8WRl.js.map → TaskQueuePill-DkQ1uc6y.js.map} +1 -1
- package/dashboard/dist/assets/TasksListPage-BBATgpf7.js +2 -0
- package/dashboard/dist/assets/{TasksListPage-BB1f79lL.js.map → TasksListPage-BBATgpf7.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-BFnODmNe.js → TimeAgo-CSNVEjch.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-BFnODmNe.js.map → TimeAgo-CSNVEjch.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell-BXgLOBsr.js → TimestampCell-Du1nBrPn.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell-BXgLOBsr.js.map → TimestampCell-Du1nBrPn.js.map} +1 -1
- package/dashboard/dist/assets/{ToolPill-FkgTXIhq.js → ToolPill-Baxm02L6.js} +2 -2
- package/dashboard/dist/assets/{ToolPill-FkgTXIhq.js.map → ToolPill-Baxm02L6.js.map} +1 -1
- package/dashboard/dist/assets/ToolTestPanel-CF-h_5Rg.js +2 -0
- package/dashboard/dist/assets/{ToolTestPanel-Bwe3J5lj.js.map → ToolTestPanel-CF-h_5Rg.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-DAF07vZ9.js → TopicDetailPage-Dr1UmWcp.js} +3 -3
- package/dashboard/dist/assets/{TopicDetailPage-DAF07vZ9.js.map → TopicDetailPage-Dr1UmWcp.js.map} +1 -1
- package/dashboard/dist/assets/TopicsPage-CUUo-Ylf.js +2 -0
- package/dashboard/dist/assets/{TopicsPage-C1gxBUap.js.map → TopicsPage-CUUo-Ylf.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-BzXJUE6q.js → UserName-kBh1dc39.js} +2 -2
- package/dashboard/dist/assets/{UserName-BzXJUE6q.js.map → UserName-kBh1dc39.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-SkRU5cRX.js → WorkflowExecutionPage-CCRSbnDx.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-SkRU5cRX.js.map → WorkflowExecutionPage-CCRSbnDx.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowPill--AYMW7u_.js → WorkflowPill-ZepbO_ny.js} +2 -2
- package/dashboard/dist/assets/{WorkflowPill--AYMW7u_.js.map → WorkflowPill-ZepbO_ny.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowsDashboard-BNQVvyek.js +2 -0
- package/dashboard/dist/assets/{WorkflowsDashboard-CZAqRk1N.js.map → WorkflowsDashboard-BNQVvyek.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-BoN44VTE.js → WorkflowsOverview-DswubNJN.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-BoN44VTE.js.map → WorkflowsOverview-DswubNJN.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-CqjhtdJf.js → YamlWorkflowDetailPage-Cw9Dlmup.js} +11 -11
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-CqjhtdJf.js.map → YamlWorkflowDetailPage-Cw9Dlmup.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-CwnJkzyb.js → YamlWorkflowsPage-DB8xnIXy.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-CwnJkzyb.js.map → YamlWorkflowsPage-DB8xnIXy.js.map} +1 -1
- package/dashboard/dist/assets/{agents-gV0Ys-sY.js → agents-BwEnf6N9.js} +2 -2
- package/dashboard/dist/assets/{agents-gV0Ys-sY.js.map → agents-BwEnf6N9.js.map} +1 -1
- package/dashboard/dist/assets/{bots-B97itB3I.js → bots-CCmJTT2u.js} +2 -2
- package/dashboard/dist/assets/{bots-B97itB3I.js.map → bots-CCmJTT2u.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-CR9xZgGd.js → capabilities-BZHgp_nh.js} +2 -2
- package/dashboard/dist/assets/{capabilities-CR9xZgGd.js.map → capabilities-BZHgp_nh.js.map} +1 -1
- package/dashboard/dist/assets/{constants-BHkpVaqx.js → constants-CeBBTzf5.js} +2 -2
- package/dashboard/dist/assets/{constants-BHkpVaqx.js.map → constants-CeBBTzf5.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-YxvP1KCa.js → controlplane-CyfwUlFA.js} +2 -2
- package/dashboard/dist/assets/{controlplane-YxvP1KCa.js.map → controlplane-CyfwUlFA.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-BJPTNmLW.js +2 -0
- package/dashboard/dist/assets/escalation-columns-BJPTNmLW.js.map +1 -0
- package/dashboard/dist/assets/index-3gbd5neL.js +67 -0
- package/dashboard/dist/assets/index-3gbd5neL.js.map +1 -0
- package/dashboard/dist/assets/index-BAAVTyZ-.js +2 -0
- package/dashboard/dist/assets/{index-BQpV-DTG.js.map → index-BAAVTyZ-.js.map} +1 -1
- package/dashboard/dist/assets/{index-B9BBCqLI.js → index-BC6Jenlo.js} +2 -2
- package/dashboard/dist/assets/{index-B9BBCqLI.js.map → index-BC6Jenlo.js.map} +1 -1
- package/dashboard/dist/assets/index-C7KHqOTQ.js +2 -0
- package/dashboard/dist/assets/{index-Bp9KBLT5.js.map → index-C7KHqOTQ.js.map} +1 -1
- package/dashboard/dist/assets/index-CDrqqbSR.js +3 -0
- package/dashboard/dist/assets/index-CDrqqbSR.js.map +1 -0
- package/dashboard/dist/assets/index-CVwzCZ43.js +2 -0
- package/dashboard/dist/assets/{index-CFbo9FU9.js.map → index-CVwzCZ43.js.map} +1 -1
- package/dashboard/dist/assets/index-CaGF6TCC.js +2 -0
- package/dashboard/dist/assets/index-CaGF6TCC.js.map +1 -0
- package/dashboard/dist/assets/index-ClVbfe4z.js +13 -0
- package/dashboard/dist/assets/{index-Cfvkl2J0.js.map → index-ClVbfe4z.js.map} +1 -1
- package/dashboard/dist/assets/{index-DMeaiKgf.js → index-CuVkSmj5.js} +2 -2
- package/dashboard/dist/assets/{index-DMeaiKgf.js.map → index-CuVkSmj5.js.map} +1 -1
- package/dashboard/dist/assets/{index-ipqwPavs.js → index-DAuX_PlL.js} +2 -2
- package/dashboard/dist/assets/{index-ipqwPavs.js.map → index-DAuX_PlL.js.map} +1 -1
- package/dashboard/dist/assets/{index-CIpHj4di.js → index-DBWS5QL8.js} +2 -2
- package/dashboard/dist/assets/{index-CIpHj4di.js.map → index-DBWS5QL8.js.map} +1 -1
- package/dashboard/dist/assets/index-DIWCI6HC.js +2 -0
- package/dashboard/dist/assets/{index-CUZ6LYye.js.map → index-DIWCI6HC.js.map} +1 -1
- package/dashboard/dist/assets/{index-DwOnWeu8.js → index-DZ8X_Gp4.js} +2 -2
- package/dashboard/dist/assets/{index-DwOnWeu8.js.map → index-DZ8X_Gp4.js.map} +1 -1
- package/dashboard/dist/assets/index-Dh8MJl3L.css +1 -0
- package/dashboard/dist/assets/{knowledge-XX6cW4Ob.js → knowledge-CqyLhUMg.js} +2 -2
- package/dashboard/dist/assets/{knowledge-XX6cW4Ob.js.map → knowledge-CqyLhUMg.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-CH13hNH2.js → mcp-Cvu6bFYH.js} +2 -2
- package/dashboard/dist/assets/{mcp-CH13hNH2.js.map → mcp-Cvu6bFYH.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-Duydd3JA.js → mcp-query-qC6A3e9l.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-Duydd3JA.js.map → mcp-query-qC6A3e9l.js.map} +1 -1
- package/dashboard/dist/assets/metadata-display-COo3mMCr.js +2 -0
- package/dashboard/dist/assets/metadata-display-COo3mMCr.js.map +1 -0
- package/dashboard/dist/assets/{personas-mDk4lLQS.js → personas-BKN_lJuV.js} +2 -2
- package/dashboard/dist/assets/{personas-mDk4lLQS.js.map → personas-BKN_lJuV.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-B5GcgCeF.js → pipelines-BldIfv85.js} +2 -2
- package/dashboard/dist/assets/{pipelines-B5GcgCeF.js.map → pipelines-BldIfv85.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-CItmNsRp.js → tasks-B-Uay8uL.js} +2 -2
- package/dashboard/dist/assets/{tasks-CItmNsRp.js.map → tasks-B-Uay8uL.js.map} +1 -1
- package/dashboard/dist/assets/{topics-CJYG7BX5.js → topics-438EQogt.js} +2 -2
- package/dashboard/dist/assets/{topics-CJYG7BX5.js.map → topics-438EQogt.js.map} +1 -1
- package/dashboard/dist/assets/useContainerWidth-DSLp1gEm.js +2 -0
- package/dashboard/dist/assets/useContainerWidth-DSLp1gEm.js.map +1 -0
- package/dashboard/dist/assets/{useDebouncedValue-BrwgXcp8.js → useDebouncedValue-Cw8hYZ8y.js} +2 -2
- package/dashboard/dist/assets/{useDebouncedValue-BrwgXcp8.js.map → useDebouncedValue-Cw8hYZ8y.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-CHty0HAS.js → useNamespace-D1218GQ8.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-CHty0HAS.js.map → useNamespace-D1218GQ8.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-CoTsia7t.js → useYamlActivityEvents-BAQf_y_U.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-CoTsia7t.js.map → useYamlActivityEvents-BAQf_y_U.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-DeBdvyKJ.js → vendor-icons-B7OcUM6b.js} +2 -2
- package/dashboard/dist/assets/{vendor-icons-DeBdvyKJ.js.map → vendor-icons-B7OcUM6b.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-CiWwx5rM.js → yaml-workflows-CN01gEB0.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-CiWwx5rM.js.map → yaml-workflows-CN01gEB0.js.map} +1 -1
- package/dashboard/dist/index.html +3 -3
- package/docs/accumulator.md +113 -0
- package/docs/api/http/escalations.md +89 -0
- package/docs/api/http/roles.md +1 -0
- package/docs/api/sdk/escalations.md +91 -0
- package/docs/api/sdk/roles.md +2 -0
- package/docs/architecture.md +1 -1
- package/docs/code-owned-configuration.md +2 -1
- package/docs/dashboard.md +10 -4
- package/docs/hitl/design.md +1 -1
- package/docs/hitl/escalation.md +37 -1
- package/docs/hitl/invoke-form.md +4 -0
- package/docs/hitl/pinned-views.md +4 -0
- package/docs/hitl/portal.md +97 -0
- package/docs/hitl/resolution.md +41 -0
- package/docs/hitl/x-lt-embed.md +1 -1
- package/docs/hitl/x-lt-invoke.md +95 -0
- package/docs/hitl/x-lt-list-schema.md +3 -1
- package/docs/hitl/x-lt-widget.md +1 -0
- package/docs/hitl-guide.md +8 -1
- package/docs/scan-codes.md +15 -2
- package/docs/sdk.md +1 -1
- package/docs/workflows.md +2 -2
- package/package.json +4 -2
- package/dashboard/dist/assets/AgentsPage-7JJBHku8.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-lz5qwSjg.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-lz5qwSjg.js.map +0 -1
- package/dashboard/dist/assets/BulkAssignModal-NJBcoj-f.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-F8dpNn9B.js +0 -2
- package/dashboard/dist/assets/DataTable-7C7riavf.js +0 -2
- package/dashboard/dist/assets/DataTable-7C7riavf.js.map +0 -1
- package/dashboard/dist/assets/EntityTimelinePanel-CkF-oW-m.js +0 -2
- package/dashboard/dist/assets/EscalationListView-AHW2xtlr.js +0 -2
- package/dashboard/dist/assets/EscalationListView-AHW2xtlr.js.map +0 -1
- package/dashboard/dist/assets/GraphInvokePage-CKtvWowP.js +0 -2
- package/dashboard/dist/assets/HomePage-BQ3Q791Q.js +0 -2
- package/dashboard/dist/assets/ListToolbar-DdJzj472.js +0 -2
- package/dashboard/dist/assets/McpQueryPage-CfJy7HZ7.js +0 -2
- package/dashboard/dist/assets/McpRunsPage-D7QXjW9z.js +0 -2
- package/dashboard/dist/assets/OperationsPage-aLHHAP2X.js +0 -3
- package/dashboard/dist/assets/OperationsPage-aLHHAP2X.js.map +0 -1
- package/dashboard/dist/assets/OperatorDashboard-sXNDh1Ph.js +0 -2
- package/dashboard/dist/assets/ProcessesListPage-CjwVKe32.js +0 -2
- package/dashboard/dist/assets/ResolverForm-Bk-wDkN-.js +0 -3
- package/dashboard/dist/assets/ResolverForm-Bk-wDkN-.js.map +0 -1
- package/dashboard/dist/assets/RoleDetailPage-WQt0y5l7.js +0 -8
- package/dashboard/dist/assets/RoleDetailPage-WQt0y5l7.js.map +0 -1
- package/dashboard/dist/assets/RunAsSelector-fFMt1bGe.js +0 -2
- package/dashboard/dist/assets/ScanStationPage-C1_ppDoZ.js +0 -2
- package/dashboard/dist/assets/TasksListPage-BB1f79lL.js +0 -2
- package/dashboard/dist/assets/ToolTestPanel-Bwe3J5lj.js +0 -2
- package/dashboard/dist/assets/TopicsPage-C1gxBUap.js +0 -2
- package/dashboard/dist/assets/WorkflowsDashboard-CZAqRk1N.js +0 -2
- package/dashboard/dist/assets/escalation-columns-uq-IV2aj.js +0 -2
- package/dashboard/dist/assets/escalation-columns-uq-IV2aj.js.map +0 -1
- package/dashboard/dist/assets/index-3ezfWLkE.js +0 -6
- package/dashboard/dist/assets/index-3ezfWLkE.js.map +0 -1
- package/dashboard/dist/assets/index-BQpV-DTG.js +0 -2
- package/dashboard/dist/assets/index-Bp9KBLT5.js +0 -2
- package/dashboard/dist/assets/index-Bpvfr4OW.css +0 -1
- package/dashboard/dist/assets/index-CFbo9FU9.js +0 -2
- package/dashboard/dist/assets/index-CIwlVfvV.js +0 -67
- package/dashboard/dist/assets/index-CIwlVfvV.js.map +0 -1
- package/dashboard/dist/assets/index-CUZ6LYye.js +0 -2
- package/dashboard/dist/assets/index-Cfvkl2J0.js +0 -13
- package/dashboard/dist/assets/index-SGyrXGp8.js +0 -3
- package/dashboard/dist/assets/index-SGyrXGp8.js.map +0 -1
- package/dashboard/dist/assets/invoke-context-DrVyUEfs.js +0 -2
- package/dashboard/dist/assets/invoke-context-DrVyUEfs.js.map +0 -1
- package/dashboard/dist/assets/metadata-display--TzK0REC.js +0 -2
- package/dashboard/dist/assets/metadata-display--TzK0REC.js.map +0 -1
- package/dashboard/dist/assets/resolver-payload-m9AGKZ3a.js +0 -2
- package/dashboard/dist/assets/resolver-payload-m9AGKZ3a.js.map +0 -1
- package/docs/compilation.md +0 -152
- package/docs/compiler.md +0 -311
- package/docs/contributing.md +0 -56
- package/docs/design-principles.md +0 -245
- package/docs/schema-exchange.md +0 -173
- package/docs/self-test.md +0 -106
- package/docs/story.md +0 -184
|
@@ -37,6 +37,14 @@ export declare const SCAN_VERBS: {
|
|
|
37
37
|
readonly RESOLVE: "resolve";
|
|
38
38
|
readonly ESCALATE: "escalate";
|
|
39
39
|
readonly CANCEL: "cancel";
|
|
40
|
+
/**
|
|
41
|
+
* Add the scanned item to an accumulator escalation. With
|
|
42
|
+
* `params.accumulate.containerFacet` the scan locates the ITEM's own row
|
|
43
|
+
* and joins it to the container that shares that facet value, writing
|
|
44
|
+
* both rows in one statement; without it the scan locates the CONTAINER
|
|
45
|
+
* and adds `params.itemKey`.
|
|
46
|
+
*/
|
|
47
|
+
readonly ACCUMULATE: "accumulate";
|
|
40
48
|
/** Locate the row, then PRESENT its reality + the step's labeled choices. */
|
|
41
49
|
readonly PRESENT: "present";
|
|
42
50
|
};
|
|
@@ -150,6 +158,22 @@ export interface ScanStepParams {
|
|
|
150
158
|
closeCurrent?: 'resolve' | 'cancel';
|
|
151
159
|
/** Claim window (claim verbs). */
|
|
152
160
|
durationMinutes?: number;
|
|
161
|
+
/** Item key template (accumulate, container-locate mode). Defaults to `{scan.target}`. */
|
|
162
|
+
itemKey?: string;
|
|
163
|
+
/** Accumulate verb options. */
|
|
164
|
+
accumulate?: ScanAccumulateParams;
|
|
165
|
+
}
|
|
166
|
+
export interface ScanAccumulateParams {
|
|
167
|
+
/**
|
|
168
|
+
* Item-locate mode: the scanned target is the item's own escalation (found
|
|
169
|
+
* by the scheme facet); the container is the pending accumulator whose
|
|
170
|
+
* metadata carries this facet with the same value the item row holds.
|
|
171
|
+
*/
|
|
172
|
+
containerFacet?: string;
|
|
173
|
+
/** Expected container queue(s); intersects with the actor's write scope. */
|
|
174
|
+
containerRoles?: string[];
|
|
175
|
+
/** Item-locate mode: also write the item's row as the reciprocal (default true). */
|
|
176
|
+
reciprocal?: boolean;
|
|
153
177
|
}
|
|
154
178
|
export interface ScanStep {
|
|
155
179
|
query: ScanStepQuery;
|
package/build/types/scan-code.js
CHANGED
|
@@ -37,6 +37,14 @@ exports.SCAN_VERBS = {
|
|
|
37
37
|
RESOLVE: 'resolve',
|
|
38
38
|
ESCALATE: 'escalate',
|
|
39
39
|
CANCEL: 'cancel',
|
|
40
|
+
/**
|
|
41
|
+
* Add the scanned item to an accumulator escalation. With
|
|
42
|
+
* `params.accumulate.containerFacet` the scan locates the ITEM's own row
|
|
43
|
+
* and joins it to the container that shares that facet value, writing
|
|
44
|
+
* both rows in one statement; without it the scan locates the CONTAINER
|
|
45
|
+
* and adds `params.itemKey`.
|
|
46
|
+
*/
|
|
47
|
+
ACCUMULATE: 'accumulate',
|
|
40
48
|
/** Locate the row, then PRESENT its reality + the step's labeled choices. */
|
|
41
49
|
PRESENT: 'present',
|
|
42
50
|
};
|
|
@@ -48,6 +56,7 @@ exports.SCAN_MUTATING_VERBS = [
|
|
|
48
56
|
exports.SCAN_VERBS.RESOLVE,
|
|
49
57
|
exports.SCAN_VERBS.ESCALATE,
|
|
50
58
|
exports.SCAN_VERBS.CANCEL,
|
|
59
|
+
exports.SCAN_VERBS.ACCUMULATE,
|
|
51
60
|
];
|
|
52
61
|
exports.SCAN_OUTCOMES = {
|
|
53
62
|
/** A step matched and its action ran (or the located item is returned for show verbs). */
|
package/build/types/startup.d.ts
CHANGED
|
@@ -220,6 +220,26 @@ export interface LTRoleConfig {
|
|
|
220
220
|
url: string;
|
|
221
221
|
badge?: boolean;
|
|
222
222
|
}[];
|
|
223
|
+
/**
|
|
224
|
+
* Named portal views: each a matrix of pin cells (1..4 rows of 1..6) rendered
|
|
225
|
+
* as one page at /portal/:role/:key, with optional count tiles above the
|
|
226
|
+
* panels (the live total of a list URL, with a blurb). Members pick a portal
|
|
227
|
+
* from the global menu.
|
|
228
|
+
*/
|
|
229
|
+
portals?: {
|
|
230
|
+
key: string;
|
|
231
|
+
label: string;
|
|
232
|
+
rows: {
|
|
233
|
+
label: string;
|
|
234
|
+
url: string;
|
|
235
|
+
badge?: boolean;
|
|
236
|
+
}[][];
|
|
237
|
+
counts?: {
|
|
238
|
+
label: string;
|
|
239
|
+
url: string;
|
|
240
|
+
blurb?: string;
|
|
241
|
+
}[];
|
|
242
|
+
}[];
|
|
223
243
|
/** Server-side resolver schema validation for this role. */
|
|
224
244
|
enforce_schema?: boolean;
|
|
225
245
|
sla_minutes?: number;
|
|
@@ -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-B-Uay8uL.js";import{z as m,a9 as c}from"./index-3gbd5neL.js";import{u}from"./mcp-Cvu6bFYH.js";import{P as d}from"./PageHeaderWithStats-CSnk1p5A.js";import"./vendor-react-_9U4mKFr.js";import"./vendor-icons-B7OcUM6b.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-uarpHB88.js.map
|
package/dashboard/dist/assets/{AdminDashboard-DplvDBti.js.map → AdminDashboard-uarpHB88.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminDashboard-
|
|
1
|
+
{"version":3,"file":"AdminDashboard-uarpHB88.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,6 +1,6 @@
|
|
|
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-gV0Ys-sY.js";import{E as de,C as xe,u as pe,a as ue,b as me,c as he}from"./CronLabel-CAD5UYDT.js";import{g as fe,a as ve,c as be,y as ye}from"./index-CIwlVfvV.js";import{P as ge}from"./PageHeader-Di5Sz3an.js";import{w as E,n as U,J as je,R as Y,g as M,y as Z,ar as G,f as V,bW as ee,aa as we}from"./vendor-icons-DeBdvyKJ.js";import{g as Ne}from"./knowledge-XX6cW4Ob.js";import{R as te}from"./RunAsSelector-fFMt1bGe.js";import{u as _e}from"./yaml-workflows-CiWwx5rM.js";import{u as se}from"./capabilities-CR9xZgGd.js";import{u as ke}from"./topics-CJYG7BX5.js";import{W as Q}from"./WorkflowPill--AYMW7u_.js";import{e as Ce,u as Se,f as qe}from"./vendor-react-_9U4mKFr.js";import"./BotPicker-CGCnIz8I.js";import"./bots-B97itB3I.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-BwEnf6N9.js";import{E as de,C as xe,u as pe,a as ue,b as me,c as he}from"./CronLabel-LYPxpvNN.js";import{g as fe,a as ve,c as be,y as ye}from"./index-3gbd5neL.js";import{P as ge}from"./PageHeader-Csq434-v.js";import{x as E,o as K,K as je,R as U,g as M,z as Z,ax as Y,f as V,bX as ee,ab as we}from"./vendor-icons-B7OcUM6b.js";import{g as Ne}from"./knowledge-CqyLhUMg.js";import{R as te}from"./RunAsSelector-B29iWwel.js";import{u as _e}from"./yaml-workflows-CN01gEB0.js";import{u as se}from"./capabilities-BZHgp_nh.js";import{u as ke}from"./topics-438EQogt.js";import{W as Q}from"./WorkflowPill-ZepbO_ny.js";import{e as Ce,u as Se,f as qe}from"./vendor-react-_9U4mKFr.js";import"./BotPicker-CClMby6B.js";import"./bots-CCmJTT2u.js";const X={name:"",description:"",goals:"",rules:"",user_id:"",knowledge_domain:"",subscriptions:[],schedules:[]},Oe={topic:"",filter:"",reaction_type:"durable",workflow_type:"",pipeline_id:"",mcp_prompt:"",server_id:"",tool_name:"",input_mapping:"{}",execute_as:"",enabled:!0},Ae={cron:"0 * * * *",reaction_type:"durable",workflow_type:"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""};function Re(s,a){var o,x,m;const r=(x=(o=s.behaviors)==null?void 0:o.schedules)!=null&&x.length?s.behaviors.schedules.map(i=>({cron:i.cron||"",reaction_type:i.reaction_type||"durable",workflow_type:i.workflow_type||"",pipeline_id:i.pipeline_id||"",server_id:i.server_id||"",tool_name:i.tool_name||"",envelope:i.envelope?JSON.stringify(i.envelope,null,2):"{}",execute_as:i.execute_as||""})):(m=s.behaviors)!=null&&m.cron?[{cron:s.behaviors.cron,reaction_type:"durable",workflow_type:s.workflow_type??"",pipeline_id:"",server_id:"",tool_name:"",envelope:"{}",execute_as:""}]:[];return{name:s.id,description:s.description??"",goals:s.goals??"",rules:s.rules??"",user_id:s.user_id??"",knowledge_domain:s.knowledge_domain??"",subscriptions:a.map(i=>({id:i.id,topic:i.topic,filter:i.filter?JSON.stringify(i.filter,null,2):"",reaction_type:i.reaction_type,workflow_type:i.workflow_type??"",pipeline_id:i.pipeline_id??"",mcp_prompt:i.mcp_prompt??"",server_id:i.server_id??"",tool_name:i.tool_name??"",input_mapping:JSON.stringify(i.input_mapping??{},null,2),execute_as:i.execute_as??"",enabled:i.enabled})),schedules:r}}function Ee(s){var r;const a={};return s.schedules.length>0&&(a.schedules=s.schedules.map(o=>({cron:o.cron,reaction_type:o.reaction_type||"durable",workflow_type:o.reaction_type==="pipeline"?void 0:o.workflow_type,pipeline_id:o.reaction_type==="pipeline"?o.pipeline_id:void 0,envelope:B(o.envelope)??{},execute_as:o.execute_as||void 0})),a.cron=s.schedules[0].cron),{id:s.name,description:s.description||void 0,goals:s.goals||void 0,rules:s.rules||void 0,user_id:s.user_id||void 0,knowledge_domain:s.knowledge_domain||void 0,behaviors:a,workflow_type:((r=s.schedules[0])==null?void 0:r.workflow_type)||void 0,pipeline_id:void 0}}function $e(s){return s.subscriptions.map(a=>({id:a.id,topic:a.topic,filter:a.filter?B(a.filter):void 0,reaction_type:a.reaction_type,workflow_type:a.workflow_type||void 0,pipeline_id:a.pipeline_id||void 0,mcp_prompt:a.mcp_prompt||void 0,server_id:a.server_id||void 0,tool_name:a.tool_name||void 0,input_mapping:B(a.input_mapping)??{},execute_as:a.execute_as||void 0,enabled:a.enabled}))}function B(s){if(s.trim())try{return JSON.parse(s)}catch{return}}function Pe(s,a,r,o){let x;try{x=JSON.parse(s)}catch{x={}}const m=o.includes(a),i=r===""||r===void 0||r===null||Array.isArray(r)&&r.length===0||r==="[]";if(!m&&i){const{[a]:p,...l}=x;return JSON.stringify(l,null,2)}let u=r;if(typeof r=="string")try{const p=JSON.parse(r);Array.isArray(p)&&(u=p)}catch{}return JSON.stringify({...x,[a]:u},null,2)}const S="section-header mt-[3em] first:mt-0",P="label",_="hint",A="input",L="input-json w-full";function Ie({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Give your automation a name and describe what it does. The name appears everywhere — in events, logs, and the dashboard."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:identity"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Identity",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Name *"}),e.jsx("input",{type:"text",value:s.name,onChange:r=>a("name",r.target.value),placeholder:"health-monitor",className:A}),e.jsx("p",{className:_,children:"Lowercase, kebab-case. This appears everywhere."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:r=>a("description",r.target.value),placeholder:"Watches for workflow failures and captures diagnostics",className:A}),e.jsx("p",{className:_,children:"One sentence that explains what this automation does."})]})]})}function We({form:s,set:a}){return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Goals define what drives the automation. Rules define what constrains it."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:motivation"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Motivation",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Goals"}),e.jsx("textarea",{value:s.goals,onChange:r=>a("goals",r.target.value),placeholder:"Detect failures early, capture diagnostics, alert before cascading",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Primary motivation. What the automation is trying to achieve."})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Rules"}),e.jsx("textarea",{value:s.rules,onChange:r=>a("rules",r.target.value),placeholder:"Never auto-restart failed workflows. Always escalate to humans.",rows:4,className:`${A} resize-none`}),e.jsx("p",{className:_,children:"Guardrails. What it must never do, even when goals suggest it should."})]})]})]})}function Te({form:s,set:a}){const{data:r}=Ne(),o=(r==null?void 0:r.domains)??[];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Assign a knowledge domain — the automation's memory. It stores context here over time."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:knowledge"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Knowledge",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Knowledge Domain"}),e.jsx("input",{type:"text",value:s.knowledge_domain,onChange:x=>a("knowledge_domain",x.target.value),placeholder:"e.g., system-health, content-review, vendor-data",className:A,list:"domain-suggestions"}),e.jsx("datalist",{id:"domain-suggestions",children:o.map(x=>e.jsx("option",{value:x.domain},x.domain))}),e.jsx("p",{className:_,children:"Choose an existing domain to share memory, or type a new name to create one."})]}),o.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:P,children:"Existing Domains"}),e.jsx("div",{className:"space-y-0.5 mt-2",children:o.map(x=>e.jsxs("button",{type:"button",onClick:()=>a("knowledge_domain",x.domain),className:`w-full flex items-center gap-3 px-3 py-2 rounded-md text-left transition-colors ${s.knowledge_domain===x.domain?"border-l-2 border-l-accent bg-accent/5":"hover:bg-surface-hover border-l-2 border-l-transparent"}`,children:[e.jsx(K,{className:"w-3.5 h-3.5 text-text-quaternary shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary flex-1",children:x.domain}),e.jsxs("span",{className:"text-2xs text-text-quaternary",children:[x.count," entries"]}),e.jsx("span",{className:"text-2xs text-text-quaternary",children:e.jsx(fe,{date:x.latest})})]},x.domain))})]})]})}function Me({serverId:s,toolName:a,onChange:r}){const{data:o}=se(),x=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[m,i]=f.useState(!1),[u,p]=f.useState(""),l=f.useRef(null),h=f.useRef(null);f.useEffect(()=>{if(!m)return;function t(n){h.current&&!h.current.contains(n.target)&&i(!1)}return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[m]);const c=a?`${a}`:"",d=m?u:c,y=f.useMemo(()=>{const t=(m?u:"").toLowerCase();return t?x.filter(n=>n.name.toLowerCase().includes(t)||n.serverName.toLowerCase().includes(t)||(n.description??"").toLowerCase().includes(t)):x},[x,u,m]),v=a?x.find(t=>t.serverId===s&&t.name===a):void 0;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsx("input",{ref:l,type:"text",value:d,onFocus:()=>{i(!0),p(c)},onChange:t=>{const n=t.target.value;p(n),n||r("",""),m||i(!0)},placeholder:"Search capabilities...",className:"input font-mono text-sm w-full"}),!m&&(v==null?void 0:v.description)&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-1 italic",children:v.description}),m&&y.length>0&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-64 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:y.map(t=>e.jsxs("button",{type:"button",onClick:()=>{r(t.serverId,t.name),p(t.name),i(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===t.serverId&&a===t.name?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-2xs font-mono text-text-primary shrink-0",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-2xs font-medium shrink-0 bg-accent/10 text-accent",children:[e.jsx(je,{className:"w-2 h-2",strokeWidth:1.5}),t.serverName]}),t.description&&e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:t.description})]},`${t.serverId}:${t.name}`))}),m&&y.length===0&&u&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 rounded-md border border-surface-border bg-surface shadow-lg px-3 py-4 text-center",children:e.jsxs("p",{className:"text-2xs text-text-quaternary",children:['No capabilities match "',u,'"']})})]})}const Le={durable:"Workflow",pipeline:"Pipeline",capability:"Capability",mcp_query:"MCP Query"},Je=["durable","pipeline","capability","mcp_query"];function ae({reactionType:s,onReactionTypeChange:a,workflowType:r,onWorkflowTypeChange:o,pipelineId:x,onPipelineIdChange:m,serverId:i,toolName:u,onCapabilityChange:p,mcpPrompt:l,onMcpPromptChange:h,availableTypes:c=[...Je]}){const{data:d}=ve(),y=(d??[]).filter(n=>n.invocable).map(n=>n.workflow_type),{data:v}=_e({status:"active"}),t=((v==null?void 0:v.workflows)??[]).map(n=>({id:n.id,name:n.graph_topic||n.id}));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1",children:c.map(n=>{const b=s===n;return e.jsx("button",{type:"button",onClick:()=>a(n),className:`px-3 py-1.5 text-2xs font-medium rounded-md transition-colors ${b?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:Le[n]},n)})}),s==="durable"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Workflow *"}),e.jsxs("select",{value:r,onChange:n=>o(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select workflow..."}),y.map(n=>e.jsx("option",{value:n,children:n},n))]})]}),s==="pipeline"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Pipeline *"}),e.jsxs("select",{value:x,onChange:n=>m(n.target.value),className:"input",children:[e.jsx("option",{value:"",children:"Select pipeline..."}),t.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))]})]}),s==="capability"&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Capability *"}),e.jsx(Me,{serverId:i,toolName:u,onChange:p})]}),s==="mcp_query"&&h&&e.jsxs("div",{children:[e.jsx("label",{className:"label",children:"Prompt *"}),e.jsx("textarea",{value:l??"",onChange:n=>h(n.target.value),placeholder:"Analyze the error and suggest remediation...",rows:3,className:"input resize-none"})]})]})}const Fe={task:"bg-status-active/10 text-status-active",workflow:"bg-accent/15 text-accent",escalation:"bg-status-warning/10 text-status-warning",activity:"bg-status-active/10 text-status-active",knowledge:"bg-accent/10 text-accent",file:"bg-status-draft/10 text-status-draft",agent:"bg-status-success/10 text-status-success",app:"bg-status-error/10 text-status-error",milestone:"bg-accent/10 text-accent"};function De({form:s,set:a}){const{data:r}=ke({limit:200}),{data:o}=se(),x=(r==null?void 0:r.topics)??[],m=f.useMemo(()=>{var t;return((t=o==null?void 0:o.categories)==null?void 0:t.flatMap(n=>n.tools))??[]},[o]),[i,u]=f.useState(0),p=(t,n,b)=>{const g=[...s.subscriptions];g[t]={...g[t],[n]:b},a("subscriptions",g)},l=()=>{a("subscriptions",[...s.subscriptions,{...Oe}]),u(s.subscriptions.length)},h=t=>{a("subscriptions",s.subscriptions.filter((n,b)=>b!==t)),i>=s.subscriptions.length-1&&u(Math.max(0,s.subscriptions.length-2))},c=s.subscriptions,d=c[i],y=t=>t.topic?t.reaction_type==="durable"?!!t.workflow_type:t.reaction_type==="pipeline"?!!t.pipeline_id:t.reaction_type==="mcp_query"?!!t.mcp_prompt:t.reaction_type==="capability"?!!t.server_id&&!!t.tool_name:!1:!1,v=d?x.find(t=>t.topic===d.topic):void 0;return c.length===0?e.jsxs("div",{className:"max-w-xl",children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-8",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(U,{className:"w-8 h-8 text-text-quaternary/40 mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-tertiary mb-2",children:"No event subscriptions yet"}),e.jsx("p",{className:"text-2xs text-text-quaternary max-w-sm mb-6",children:"Each subscription listens for a topic pattern and runs a workflow when it matches."}),e.jsxs("button",{onClick:l,className:"flex items-center gap-2 text-xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Add first subscription"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 flex items-start justify-between mb-6",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. When a matching event is published, the automation runs the configured workflow with the event payload."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:subscriptions"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Subscriptions",children:e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5})})]}),e.jsxs("div",{className:"flex gap-8",children:[e.jsxs("div",{className:"w-52 shrink-0 space-y-0.5",children:[c.map((t,n)=>e.jsxs("div",{className:`group/sub flex items-center rounded-md transition-colors ${i===n?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>u(n),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full dot-ring shrink-0 ${y(t)?"bg-status-success":"bg-surface-border"}`}),e.jsx("span",{className:"text-2xs font-mono truncate",children:t.topic||"new subscription"})]}),e.jsxs("span",{className:"text-2xs text-text-quaternary ml-3",children:["→ ",t.workflow_type||t.tool_name||t.reaction_type]})]}),e.jsx("button",{onClick:b=>{b.stopPropagation(),confirm(`Remove subscription "${t.topic||"new"}"?
|
|
2
2
|
|
|
3
|
-
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(
|
|
3
|
+
This takes effect when you save.`)&&h(n)},className:"opacity-0 group-hover/sub:opacity-100 px-2 text-text-quaternary hover:text-status-error transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},n)),e.jsxs("button",{onClick:l,className:"w-full flex items-center gap-1.5 px-3 py-2 text-2xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3 h-3"})," Add"]})]}),d&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"When this event fires"}),e.jsx(Ke,{value:d.topic,onChange:t=>p(i,"topic",t),topics:x}),(v==null?void 0:v.payload_schema)&&e.jsxs("div",{className:"mt-3 p-3 rounded-md bg-surface-sunken border border-surface-border",children:[e.jsx("p",{className:"text-2xs text-text-quaternary mb-1 uppercase tracking-wider font-medium",children:"Payload Schema"}),e.jsx("pre",{className:"text-2xs font-mono text-text-secondary whitespace-pre-wrap overflow-x-auto max-h-40",children:JSON.stringify(v.payload_schema.properties??v.payload_schema,null,2)}),v.description&&e.jsx("p",{className:"text-2xs text-text-tertiary mt-2 italic",children:v.description})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:d.reaction_type,onReactionTypeChange:t=>p(i,"reaction_type",t),workflowType:d.workflow_type,onWorkflowTypeChange:t=>p(i,"workflow_type",t),pipelineId:d.pipeline_id,onPipelineIdChange:t=>p(i,"pipeline_id",t),serverId:d.server_id,toolName:d.tool_name,onCapabilityChange:(t,n)=>{var $;const b=[...s.subscriptions],g={...b[i],server_id:t,tool_name:n},k=m.find(q=>q.serverId===t&&q.name===n),R=($=k==null?void 0:k.inputSchema)==null?void 0:$.properties;if(R&&n){const q={};for(const w of Object.keys(R))w.startsWith("_")||(q[w]=`{event.data.${w}}`);g.input_mapping=JSON.stringify(q,null,2)}b[i]=g,a("subscriptions",b)},mcpPrompt:d.mcp_prompt,onMcpPromptChange:t=>p(i,"mcp_prompt",t)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:d.execute_as,onChange:t=>p(i,"execute_as",t)}),e.jsx("p",{className:_,children:"Identity used when invoking the workflow."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"But only if"}),e.jsx("input",{type:"text",value:d.filter,onChange:t=>p(i,"filter",t.target.value),placeholder:'{"extension": "png"}',className:`${A} font-mono text-xs`}),e.jsx("p",{className:_,children:"JSON filter against event.data. Click an operator to insert:"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:[{label:"equals",value:'{"key": "val"}'},{label:"not equal",value:'{"key": {"$ne": "val"}}'},{label:"in list",value:'{"key": {"$in": ["a", "b"]}}'},{label:"exists",value:'{"key": {"$exists": true}}'}].map(t=>e.jsx("button",{type:"button",onClick:()=>p(i,"filter",t.value),className:"px-2 py-0.5 text-2xs font-mono rounded bg-accent/8 text-accent hover:bg-accent/15 transition-colors",children:t.label},t.label))})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),d.reaction_type==="capability"&&d.tool_name?e.jsx(ze,{tool:m.find(t=>t.serverId===d.server_id&&t.name===d.tool_name),value:d.input_mapping,onChange:t=>p(i,"input_mapping",t),eventSchema:v==null?void 0:v.payload_schema}):e.jsxs(e.Fragment,{children:[e.jsx("textarea",{value:d.input_mapping,onChange:t=>p(i,"input_mapping",t.target.value),rows:10,className:L,placeholder:`{
|
|
4
4
|
"data": {
|
|
5
5
|
"orderId": "{event.data.orderId}",
|
|
6
6
|
"error": "{event.data.error}"
|
|
@@ -8,9 +8,9 @@ This takes effect when you save.`)&&h(n)},className:"opacity-0 group-hover/sub:o
|
|
|
8
8
|
}`}),e.jsxs("p",{className:_,children:["Maps event fields to workflow input. ","{event.data.fieldName}"," resolves at runtime."]})]})]})]})]})]})}function ze({tool:s,value:a,onChange:r,eventSchema:o}){var y,v;const[x,m]=f.useState(!1),i=((y=s==null?void 0:s.inputSchema)==null?void 0:y.properties)??{},u=((v=s==null?void 0:s.inputSchema)==null?void 0:v.required)??[],p=Object.entries(i).filter(([t])=>!t.startsWith("_")),l=f.useMemo(()=>[...p].sort(([t],[n])=>{const b=u.indexOf(t),g=u.indexOf(n);return b!==-1&&g!==-1?b-g:b!==-1?-1:g!==-1?1:t.localeCompare(n)}),[p,u]),h=f.useMemo(()=>{const t=[{value:"{event.type}",label:"event type"},{value:"{event.source}",label:"event source"},{value:"{event.timestamp}",label:"ISO timestamp"},{value:"{event.workflowId}",label:"workflow ID"},{value:"{event.workflowName}",label:"workflow name"}],n=o==null?void 0:o.properties;if(n)for(const[b,g]of Object.entries(n))t.push({value:`{event.data.${b}}`,label:g.description||b});return t},[o]),c=f.useMemo(()=>{try{return JSON.parse(a)}catch{return{}}},[a]),d=(t,n)=>{r(Pe(a,t,n,u))};return l.length===0||x?e.jsxs("div",{children:[l.length>0&&e.jsx("div",{className:"flex justify-end mb-1",children:e.jsx("button",{type:"button",onClick:()=>m(!1),className:"text-2xs text-accent hover:text-accent-hover transition-colors",children:"Form view"})}),e.jsx("textarea",{value:a,onChange:t=>r(t.target.value),rows:8,className:L,placeholder:`{
|
|
9
9
|
"domain": "{event.data.name}",
|
|
10
10
|
"key": "{event.data.path}"
|
|
11
|
-
}`}),e.jsxs("p",{className:_,children:["Maps event fields to capability inputs. ","{event.data.fieldName}"," resolves at runtime."]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Map each input to an event field or enter a static value."}),e.jsx("button",{type:"button",onClick:()=>m(!0),className:"text-2xs text-text-tertiary hover:text-accent transition-colors",children:"Raw JSON"})]}),e.jsx("div",{className:"space-y-4",children:l.map(([t,n])=>{const b=u.includes(t),g=n.description,k=n.type,R=typeof c[t]=="string"?c[t]:typeof c[t]=="object"?JSON.stringify(c[t]):c[t]!=null?String(c[t]):"";return e.jsxs("div",{className:"bg-surface-sunken/30 rounded-md px-4 py-3",children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[e.jsxs("label",{className:"text-2xs font-semibold uppercase tracking-wider text-text-secondary",children:[t.replace(/[_-]/g," "),b&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]}),k&&e.jsx("span",{className:"text-2xs text-text-quaternary",children:k})]}),g&&e.jsx("p",{className:"text-2xs text-text-quaternary mb-2",children:g}),e.jsx(Be,{value:R,onChange:$=>d(t,$),suggestions:h,fieldType:k,placeholder:`{event.data.${t}}`})]},t)})})]})}function Be({value:s,onChange:a,suggestions:r,fieldType:o,placeholder:x}){const[m,i]=f.useState(!1),[u,p]=f.useState(""),l=f.useRef(null);f.useEffect(()=>{if(!m)return;function c(d){l.current&&!l.current.contains(d.target)&&i(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[m]);const h=r.filter(c=>c.value.toLowerCase().includes(u.toLowerCase())||c.label.toLowerCase().includes(u.toLowerCase()));if(o==="object")return e.jsx("textarea",{value:s,onChange:c=>{try{a(JSON.parse(c.target.value))}catch{a(c.target.value)}},rows:3,className:`${L} text-xs`,placeholder:'{ "source": "{event.source}" }'});if(o==="array"){const c=(()=>{try{const d=JSON.parse(s);if(Array.isArray(d))return d.map(String)}catch{}return s?s.split(",").map(d=>d.trim()).filter(Boolean):[]})();return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2 min-h-[28px]",children:c.map((d,y)=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-2xs font-mono bg-accent/10 text-accent rounded-full",children:[d,e.jsx("button",{type:"button",onClick:()=>{const v=c.filter((t,n)=>n!==y);a(JSON.stringify(v))},className:"text-accent/50 hover:text-accent ml-0.5",children:"×"})]},y))}),e.jsx("input",{type:"text",className:"input font-mono text-xs w-full",placeholder:"Type a value and press Enter",onKeyDown:d=>{if(d.key==="Enter"||d.key===","){d.preventDefault();const y=d.target.value.trim();y&&(a(JSON.stringify([...c,y])),d.target.value="")}}})]})}return e.jsxs("div",{ref:l,className:"relative",children:[e.jsx("input",{type:"text",value:s,onFocus:()=>{i(!0),p("")},onChange:c=>{a(c.target.value),p(c.target.value),m||i(!0)},className:"input font-mono text-xs w-full",placeholder:x}),m&&h.length>0&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-48 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:h.map(c=>e.jsxs("button",{type:"button",onClick:()=>{a(c.value),i(!1)},className:`w-full text-left px-3 py-1.5 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===c.value?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-2xs font-mono text-accent shrink-0",children:c.value}),e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:c.label})]},c.value))})]})}function
|
|
11
|
+
}`}),e.jsxs("p",{className:_,children:["Maps event fields to capability inputs. ","{event.data.fieldName}"," resolves at runtime."]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-2xs text-text-tertiary",children:"Map each input to an event field or enter a static value."}),e.jsx("button",{type:"button",onClick:()=>m(!0),className:"text-2xs text-text-tertiary hover:text-accent transition-colors",children:"Raw JSON"})]}),e.jsx("div",{className:"space-y-4",children:l.map(([t,n])=>{const b=u.includes(t),g=n.description,k=n.type,R=typeof c[t]=="string"?c[t]:typeof c[t]=="object"?JSON.stringify(c[t]):c[t]!=null?String(c[t]):"";return e.jsxs("div",{className:"bg-surface-sunken/30 rounded-md px-4 py-3",children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-0.5",children:[e.jsxs("label",{className:"text-2xs font-semibold uppercase tracking-wider text-text-secondary",children:[t.replace(/[_-]/g," "),b&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]}),k&&e.jsx("span",{className:"text-2xs text-text-quaternary",children:k})]}),g&&e.jsx("p",{className:"text-2xs text-text-quaternary mb-2",children:g}),e.jsx(Be,{value:R,onChange:$=>d(t,$),suggestions:h,fieldType:k,placeholder:`{event.data.${t}}`})]},t)})})]})}function Be({value:s,onChange:a,suggestions:r,fieldType:o,placeholder:x}){const[m,i]=f.useState(!1),[u,p]=f.useState(""),l=f.useRef(null);f.useEffect(()=>{if(!m)return;function c(d){l.current&&!l.current.contains(d.target)&&i(!1)}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[m]);const h=r.filter(c=>c.value.toLowerCase().includes(u.toLowerCase())||c.label.toLowerCase().includes(u.toLowerCase()));if(o==="object")return e.jsx("textarea",{value:s,onChange:c=>{try{a(JSON.parse(c.target.value))}catch{a(c.target.value)}},rows:3,className:`${L} text-xs`,placeholder:'{ "source": "{event.source}" }'});if(o==="array"){const c=(()=>{try{const d=JSON.parse(s);if(Array.isArray(d))return d.map(String)}catch{}return s?s.split(",").map(d=>d.trim()).filter(Boolean):[]})();return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2 min-h-[28px]",children:c.map((d,y)=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-2xs font-mono bg-accent/10 text-accent rounded-full",children:[d,e.jsx("button",{type:"button",onClick:()=>{const v=c.filter((t,n)=>n!==y);a(JSON.stringify(v))},className:"text-accent/50 hover:text-accent ml-0.5",children:"×"})]},y))}),e.jsx("input",{type:"text",className:"input font-mono text-xs w-full",placeholder:"Type a value and press Enter",onKeyDown:d=>{if(d.key==="Enter"||d.key===","){d.preventDefault();const y=d.target.value.trim();y&&(a(JSON.stringify([...c,y])),d.target.value="")}}})]})}return e.jsxs("div",{ref:l,className:"relative",children:[e.jsx("input",{type:"text",value:s,onFocus:()=>{i(!0),p("")},onChange:c=>{a(c.target.value),p(c.target.value),m||i(!0)},className:"input font-mono text-xs w-full",placeholder:x}),m&&h.length>0&&e.jsx("div",{className:"absolute z-[100] left-0 right-0 mt-1 max-h-48 overflow-y-auto rounded-md border border-surface-border bg-surface shadow-lg",children:h.map(c=>e.jsxs("button",{type:"button",onClick:()=>{a(c.value),i(!1)},className:`w-full text-left px-3 py-1.5 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===c.value?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-2xs font-mono text-accent shrink-0",children:c.value}),e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:c.label})]},c.value))})]})}function Ke({value:s,onChange:a,topics:r}){const[o,x]=f.useState(!1),[m,i]=f.useState(""),u=f.useRef(null),p=f.useRef(null);f.useEffect(()=>{function c(d){p.current&&!p.current.contains(d.target)&&x(!1)}return o&&document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[o]);const l=o?m:s,h=r.filter(c=>c.topic.toLowerCase().includes((o?m:"").toLowerCase())||(c.description??"").toLowerCase().includes((o?m:"").toLowerCase()));return e.jsxs("div",{ref:p,className:"relative",children:[e.jsx("input",{ref:u,type:"text",value:l,onFocus:()=>{x(!0),i(s)},onChange:c=>{const d=c.target.value;i(d),a(d),o||x(!0)},placeholder:"workflow.failed or app.>",className:`${A} font-mono`}),o&&h.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:h.map(c=>{const d=Fe[c.category]??"bg-surface-sunken text-text-tertiary";return e.jsxs("button",{type:"button",onClick:()=>{a(c.topic),i(c.topic),x(!1)},className:`w-full text-left px-3 py-2 hover:bg-surface-hover transition-colors flex items-center gap-3 ${s===c.topic?"bg-accent/5":""}`,children:[e.jsx("span",{className:"text-2xs font-mono text-text-primary shrink-0",children:c.topic}),e.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-2xs font-medium shrink-0 ${d}`,children:c.category}),c.description&&e.jsx("span",{className:"text-2xs text-text-quaternary truncate",children:c.description})]},c.topic)})})]})}const Ue=["*/5 * * * *","*/15 * * * *","0 * * * *","0 */4 * * *","0 7 * * *","0 9 * * 1-5"];function z(s){return{"* * * * *":"Every minute","*/5 * * * *":"Every 5 min","*/15 * * * *":"Every 15 min","0 * * * *":"Hourly","0 */4 * * *":"Every 4 hours","0 7 * * *":"Daily 7 AM UTC","0 9 * * 1-5":"Weekdays 9 AM UTC","0 0 * * 1":"Weekly Monday"}[s]||s}function Ye({form:s,set:a}){const[r,o]=f.useState(0),x=(l,h,c)=>{const d=[...s.schedules];d[l]={...d[l],[h]:c},a("schedules",d)},m=()=>{a("schedules",[...s.schedules,{...Ae}]),o(s.schedules.length)},i=l=>{a("schedules",s.schedules.filter((h,c)=>c!==l)),r>=s.schedules.length-1&&o(Math.max(0,s.schedules.length-2))},u=s.schedules,p=u[r];return u.length===0?e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 mb-8 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Optional. Each schedule runs a workflow on a cron timer."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:schedule"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Schedule",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 schedules"}),e.jsx("p",{className:"text-2xs text-text-quaternary max-w-sm mb-6",children:"Add a schedule to run a workflow on a recurring cron timer."}),e.jsxs("button",{onClick:m,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 schedule"]})]})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"border-l-2 border-accent/30 pl-3 py-1 mb-6 flex items-start justify-between",children:[e.jsx("p",{className:"text-xs text-text-secondary italic leading-relaxed",children:"Each schedule runs a workflow on a timer. An automation can have multiple schedules targeting different workflows."}),e.jsx("button",{onClick:()=>{window.location.hash="#docs:agents.md:schedule"},className:"text-text-quaternary hover:text-accent transition-colors shrink-0 ml-3",title:"Docs: Schedule",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-48 shrink-0 space-y-0.5",children:[u.map((l,h)=>e.jsxs("div",{className:`group/sched flex items-center rounded-md transition-colors ${r===h?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsxs("button",{onClick:()=>o(h),className:"flex-1 text-left px-3 py-2 min-w-0",children:[e.jsx("span",{className:"text-2xs font-mono block",children:l.cron||"new schedule"}),e.jsxs("span",{className:"text-2xs text-text-quaternary",children:[(l.reaction_type==="pipeline"?l.pipeline_id:l.workflow_type)||"no target"," · ",z(l.cron)]})]}),e.jsx("button",{onClick:c=>{c.stopPropagation(),confirm(`Remove schedule "${l.cron||"new"}"?
|
|
12
12
|
|
|
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:
|
|
13
|
+
This takes effect when you save.`)&&i(h)},className:"opacity-0 group-hover/sched:opacity-100 px-2 text-text-quaternary hover:text-status-error transition-all",title:"Remove",children:e.jsx(Z,{className:"w-3 h-3"})})]},h)),e.jsxs("button",{onClick:m,className:"w-full flex items-center gap-1.5 px-3 py-2 text-2xs text-accent hover:text-accent-hover transition-colors",children:[e.jsx(M,{className:"w-3 h-3"})," Add"]})]}),p&&e.jsxs("div",{className:"flex-1 min-w-0 space-y-12",children:[e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run every"}),e.jsx("input",{type:"text",value:p.cron,onChange:l=>x(r,"cron",l.target.value),placeholder:"0 * * * *",className:`${A} font-mono`}),p.cron&&e.jsx("p",{className:"text-2xs text-accent/80 mt-1",children:z(p.cron)}),e.jsx("div",{className:"flex gap-3 mt-2 overflow-x-auto",children:Ue.map(l=>e.jsx("button",{type:"button",onClick:()=>x(r,"cron",l),className:`text-2xs font-mono whitespace-nowrap transition-colors ${p.cron===l?"text-accent font-medium":"text-accent/50 hover:text-accent"}`,children:z(l)},l))})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"Run this reaction"}),e.jsx(ae,{reactionType:p.reaction_type,onReactionTypeChange:l=>x(r,"reaction_type",l),workflowType:p.workflow_type,onWorkflowTypeChange:l=>x(r,"workflow_type",l),pipelineId:p.pipeline_id,onPipelineIdChange:l=>x(r,"pipeline_id",l),serverId:p.server_id,toolName:p.tool_name,onCapabilityChange:(l,h)=>{x(r,"server_id",l),x(r,"tool_name",h)},availableTypes:["durable","pipeline","capability"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"As identity"}),e.jsx(te,{selected:p.execute_as,onChange:l=>x(r,"execute_as",l)}),e.jsx("p",{className:_,children:"Identity used when invoking."})]}),e.jsxs("div",{children:[e.jsx("label",{className:S,children:"With this data"}),e.jsx("textarea",{value:p.envelope,onChange:l=>x(r,"envelope",l.target.value),rows:10,className:L,placeholder:`{
|
|
14
14
|
"data": { "source": "cron" }
|
|
15
|
-
}`}),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
|
|
16
|
-
//# sourceMappingURL=AgentConfigPage-
|
|
15
|
+
}`}),e.jsx("p",{className:_,children:"Static payload passed to the workflow on each invocation."})]})]})]})]})}function W({icon:s,color:a,title:r,children:o}){return e.jsxs("div",{className:"mb-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 pb-1.5 border-b border-surface-border/40",children:[e.jsx(s,{className:`w-3.5 h-3.5 ${a}`,strokeWidth:1.5}),e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-widest text-accent/80",children:r})]}),e.jsx("div",{className:"pl-5.5",children:o})]})}function T({label:s,children:a}){return e.jsxs("div",{className:"flex gap-3 py-0.5",children:[e.jsx("span",{className:"text-2xs text-text-quaternary w-20 shrink-0",children:s}),e.jsx("span",{className:"text-xs text-text-primary",children:a})]})}function Ge({form:s}){return e.jsxs("div",{children:[e.jsxs(W,{icon:V,color:"text-accent",title:"Identity",children:[e.jsx(T,{label:"Name",children:s.name||"—"}),s.description&&e.jsx(T,{label:"Description",children:s.description})]}),(s.goals||s.rules)&&e.jsxs(W,{icon:ee,color:"text-accent",title:"Motivation",children:[s.goals&&e.jsx(T,{label:"Goals",children:s.goals}),s.rules&&e.jsx(T,{label:"Rules",children:s.rules})]}),e.jsx(W,{icon:K,color:"text-accent",title:"Knowledge",children:e.jsx(T,{label:"Domain",children:s.knowledge_domain||"None"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-10",children:[e.jsx(W,{icon:U,color:"text-accent",title:`Subscriptions (${s.subscriptions.length})`,children:s.subscriptions.length===0?e.jsx("span",{className:"text-2xs text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.subscriptions.map((a,r)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(de,{topic:a.topic||"unset"})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-2xs",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-2xs text-text-quaternary",children:a.reaction_type})]})]},r))})}),e.jsx(W,{icon:Y,color:"text-accent",title:`Schedules (${s.schedules.length})`,children:s.schedules.length===0?e.jsx("span",{className:"text-2xs text-text-quaternary",children:"None configured"}):e.jsx("div",{className:"divide-y divide-surface-border/30",children:s.schedules.map((a,r)=>e.jsxs("div",{className:"flex items-center py-1.5",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(xe,{cron:a.cron})}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("span",{className:"text-text-quaternary text-2xs",children:"→"}),a.workflow_type?e.jsx(Q,{type:a.workflow_type}):e.jsx("span",{className:"text-2xs text-text-quaternary",children:"no workflow"})]})]},r))})})]}),e.jsx("div",{className:"border-l-2 border-status-success/30 pl-3 py-2 mt-6",children:e.jsx("p",{className:"text-2xs text-text-tertiary leading-relaxed",children:"After saving, subscriptions and schedules activate immediately. You can pause the automation anytime."})})]})}const He=[{id:1,label:"Identity",icon:V},{id:2,label:"Motivation",icon:ee},{id:3,label:"Knowledge",icon:K},{id:4,label:"Subscriptions",icon:U},{id:5,label:"Schedules",icon:Y},{id:6,label:"Review",icon:we}];function xt(){var H;const{id:s}=Ce(),a=!s,r=Se(),{data:o}=be(),x=ye(),i=(x!==null?x:!!((H=o==null?void 0:o.ai)!=null&&H.enabled))?"Agent":"Automation",{data:u,isLoading:p}=ce(a?null:s),{data:l}=pe(a?null:s),h=le(),c=oe(),d=ue(),y=me(),v=he(),[t,n]=f.useState(X),[b,g]=f.useState(!1),[k,R]=f.useState(""),[$,q]=qe(),w=parseInt($.get("step")||"1",10),ne=f.useCallback(j=>{q(N=>{const O=new URLSearchParams(N);return O.set("step",String(j)),O},{replace:!0})},[q]);f.useEffect(()=>{if(!b){if(a){n(X),g(!0);return}u&&l&&(n(Re(u,l.subscriptions??[])),g(!0))}},[u,l,a,b]);const I=(j,N)=>n(O=>({...O,[j]:N})),ie=async()=>{R("");try{const j=Ee(t);let N=s;a?N=(await h.mutateAsync(j)).id:await c.mutateAsync({id:s,...j});const O=$e(t),re=(l==null?void 0:l.subscriptions)??[],J=new Set(re.map(C=>C.id));for(const C of O)if(C.id&&J.has(C.id)){const{id:F,...D}=C;await y.mutateAsync({agentId:N,subId:F,...D}),J.delete(F)}else{const{id:F,...D}=C;await d.mutateAsync({agentId:N,...D})}for(const C of J)await v.mutateAsync({agentId:N,subId:C});r(`/agents/${N}`)}catch(j){R(j.message)}};if(!a&&p)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-60 bg-surface-sunken rounded"})]});const G=h.isPending||c.isPending;return e.jsxs("div",{children:[e.jsx(ge,{title:a?`New ${i}`:`${i}: ${(u==null?void 0:u.id)??""}`,docsHash:"#docs:agents.md"}),e.jsxs("div",{className:"flex gap-10",children:[e.jsxs("nav",{className:"w-44 shrink-0 sticky top-0 self-start pt-2",children:[e.jsx("div",{className:"space-y-0.5",children:He.map(j=>{const N=j.icon,O=w===j.id;return e.jsxs("button",{onClick:()=>ne(j.id),className:`w-full flex items-center gap-2.5 px-3 py-2 rounded-md text-left transition-colors ${O?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(N,{className:"w-3.5 h-3.5 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-xs font-medium",children:j.label})]},j.id)})}),e.jsxs("div",{className:"mt-8 pt-4 border-t border-surface-border space-y-2",children:[e.jsx("button",{onClick:ie,disabled:!t.name.trim()||G,className:"w-full btn-primary text-xs disabled:opacity-50",children:G?"Saving...":a?`Create ${i}`:"Save"}),e.jsx("button",{onClick:()=>r(a?"/agents":`/agents/${s}`),className:"w-full btn-ghost text-xs",children:"Cancel"})]}),k&&e.jsx("p",{className:"text-xs text-status-error mt-3",children:k})]}),e.jsxs("div",{className:"flex-1 min-w-0 pt-2",children:[w===1&&e.jsx(Ie,{form:t,set:I}),w===2&&e.jsx(We,{form:t,set:I}),w===3&&e.jsx(Te,{form:t,set:I}),w===4&&e.jsx(De,{form:t,set:I}),w===5&&e.jsx(Ye,{form:t,set:I}),w===6&&e.jsx(Ge,{form:t})]})]})]})}export{xt as AgentConfigPage};
|
|
16
|
+
//# sourceMappingURL=AgentConfigPage-BcUaDD5E.js.map
|