@hotmeshio/long-tail 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/agent-subscriptions.js +14 -0
- package/build/lib/events/index.js +3 -0
- package/build/lib/events/nats.js +2 -0
- package/build/services/agent/index.js +14 -0
- package/build/services/agent/trigger-registry.d.ts +2 -0
- package/build/services/agent/trigger-registry.js +37 -8
- package/build/start/workers.js +3 -0
- package/build/types/events.d.ts +1 -1
- package/dashboard/dist/assets/AdminDashboard-ntLz5Pro.js +2 -0
- package/dashboard/dist/assets/{AdminDashboard-DISq0Tz8.js.map → AdminDashboard-ntLz5Pro.js.map} +1 -1
- package/dashboard/dist/assets/AgentConfigPage-D27vWOI6.js +16 -0
- package/dashboard/dist/assets/{AgentConfigPage-DqaJpB3K.js.map → AgentConfigPage-D27vWOI6.js.map} +1 -1
- package/dashboard/dist/assets/AgentDetailPage-Cm2KFR4O.js +4 -0
- package/dashboard/dist/assets/{AgentDetailPage-BPzPk2GC.js.map → AgentDetailPage-Cm2KFR4O.js.map} +1 -1
- package/dashboard/dist/assets/AgentsPage-_ptA-0YO.js +2 -0
- package/dashboard/dist/assets/{AgentsPage-CLcxJWjC.js.map → AgentsPage-_ptA-0YO.js.map} +1 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-bdPqEzbx.js +2 -0
- package/dashboard/dist/assets/{AvailableEscalationsPage-hOcjAAIj.js.map → AvailableEscalationsPage-bdPqEzbx.js.map} +1 -1
- package/dashboard/dist/assets/BotPicker-CYfFMpkY.js +2 -0
- package/dashboard/dist/assets/{BotPicker-DuAZgHbJ.js.map → BotPicker-CYfFMpkY.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-M7-ZTFNV.js +2 -0
- package/dashboard/dist/assets/{CapabilitiesPage-PRel6TXd.js.map → CapabilitiesPage-M7-ZTFNV.js.map} +1 -1
- package/dashboard/dist/assets/CollapsibleSection-DU5KAtQ-.js +2 -0
- package/dashboard/dist/assets/{CollapsibleSection-DnoUFQVf.js.map → CollapsibleSection-DU5KAtQ-.js.map} +1 -1
- package/dashboard/dist/assets/ConfirmDeleteModal-_hW5Vc05.js +2 -0
- package/dashboard/dist/assets/{ConfirmDeleteModal-dOxidrSR.js.map → ConfirmDeleteModal-_hW5Vc05.js.map} +1 -1
- package/dashboard/dist/assets/CopyableId-DiWqv41D.js +2 -0
- package/dashboard/dist/assets/{CopyableId-D0SQ39nR.js.map → CopyableId-DiWqv41D.js.map} +1 -1
- package/dashboard/dist/assets/CredentialsPage-CmbwypSF.js +2 -0
- package/dashboard/dist/assets/{CredentialsPage-CqedUU7b.js.map → CredentialsPage-CmbwypSF.js.map} +1 -1
- package/dashboard/dist/assets/CronLabel-nycfAefc.js +2 -0
- package/dashboard/dist/assets/{CronLabel-CPEjE-mH.js.map → CronLabel-nycfAefc.js.map} +1 -1
- package/dashboard/dist/assets/CustomDurationPicker-gNZRBaHg.js +2 -0
- package/dashboard/dist/assets/{CustomDurationPicker-BIQWzbv0.js.map → CustomDurationPicker-gNZRBaHg.js.map} +1 -1
- package/dashboard/dist/assets/DataTable-DGerT2ZM.js +2 -0
- package/dashboard/dist/assets/{DataTable-D9yuBv0w.js.map → DataTable-DGerT2ZM.js.map} +1 -1
- package/dashboard/dist/assets/DropZone-vNcqMd05.js +2 -0
- package/dashboard/dist/assets/{DropZone-e5EOL5gC.js.map → DropZone-vNcqMd05.js.map} +1 -1
- package/dashboard/dist/assets/ElapsedCell-CdvQbtve.js +2 -0
- package/dashboard/dist/assets/{ElapsedCell-CzVjr74Y.js.map → ElapsedCell-CdvQbtve.js.map} +1 -1
- package/dashboard/dist/assets/EmptyState-DMldv8c5.js +2 -0
- package/dashboard/dist/assets/{EmptyState-BcsfPq9T.js.map → EmptyState-DMldv8c5.js.map} +1 -1
- package/dashboard/dist/assets/EscalationsOverview-BNENCL_2.js +2 -0
- package/dashboard/dist/assets/{EscalationsOverview-Bcrb44xJ.js.map → EscalationsOverview-BNENCL_2.js.map} +1 -1
- package/dashboard/dist/assets/EventTable-BqDAyXyc.js +2 -0
- package/dashboard/dist/assets/{EventTable-CGfJU7e1.js.map → EventTable-BqDAyXyc.js.map} +1 -1
- package/dashboard/dist/assets/EventTopicPill-CnHFBglc.js +2 -0
- package/dashboard/dist/assets/{EventTopicPill-xJJnxvlP.js.map → EventTopicPill-CnHFBglc.js.map} +1 -1
- package/dashboard/dist/assets/FilterBar-TYiTtUgv.js +2 -0
- package/dashboard/dist/assets/{FilterBar-Ck4K4rzu.js.map → FilterBar-TYiTtUgv.js.map} +1 -1
- package/dashboard/dist/assets/HomePage-fterfLKH.js +2 -0
- package/dashboard/dist/assets/{HomePage-BIzUcGW9.js.map → HomePage-fterfLKH.js.map} +1 -1
- package/dashboard/dist/assets/ListToolbar-BO5Igi6v.js +2 -0
- package/dashboard/dist/assets/{ListToolbar-DNAGFe14.js.map → ListToolbar-BO5Igi6v.js.map} +1 -1
- package/dashboard/dist/assets/McpOverview-BQokGg0z.js +2 -0
- package/dashboard/dist/assets/{McpOverview-BpYk21es.js.map → McpOverview-BQokGg0z.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryDetailPage-0WOp2n_j.js +5 -0
- package/dashboard/dist/assets/{McpQueryDetailPage-DlrZiSuL.js.map → McpQueryDetailPage-0WOp2n_j.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryPage-DUey_h9J.js +2 -0
- package/dashboard/dist/assets/{McpQueryPage-COfPssO7.js.map → McpQueryPage-DUey_h9J.js.map} +1 -1
- package/dashboard/dist/assets/McpRunDetailPage-Cv4qyr91.js +2 -0
- package/dashboard/dist/assets/{McpRunDetailPage-Cra0nQSw.js.map → McpRunDetailPage-Cv4qyr91.js.map} +1 -1
- package/dashboard/dist/assets/McpRunsPage-B3R6KZ61.js +2 -0
- package/dashboard/dist/assets/{McpRunsPage-BlgcGN3k.js.map → McpRunsPage-B3R6KZ61.js.map} +1 -1
- package/dashboard/dist/assets/Modal-Qe8lW7gQ.js +2 -0
- package/dashboard/dist/assets/{Modal-DEODGeqx.js.map → Modal-Qe8lW7gQ.js.map} +1 -1
- package/dashboard/dist/assets/OperatorDashboard-dldvzjcg.js +2 -0
- package/dashboard/dist/assets/{OperatorDashboard-BbO6cWzb.js.map → OperatorDashboard-dldvzjcg.js.map} +1 -1
- package/dashboard/dist/assets/PageHeader-DF4BeEm4.js +2 -0
- package/dashboard/dist/assets/{PageHeader-B_gV_jKk.js.map → PageHeader-DF4BeEm4.js.map} +1 -1
- package/dashboard/dist/assets/PageHeaderWithStats-BQZw6BgA.js +2 -0
- package/dashboard/dist/assets/{PageHeaderWithStats-D0I0nrnx.js.map → PageHeaderWithStats-BQZw6BgA.js.map} +1 -1
- package/dashboard/dist/assets/PriorityBadge-DMyB3WLZ.js +2 -0
- package/dashboard/dist/assets/{PriorityBadge-DfQY9St9.js.map → PriorityBadge-DMyB3WLZ.js.map} +1 -1
- package/dashboard/dist/assets/ProcessDetailPage-Beo-QVL-.js +2 -0
- package/dashboard/dist/assets/{ProcessDetailPage-s_iV8ICg.js.map → ProcessDetailPage-Beo-QVL-.js.map} +1 -1
- package/dashboard/dist/assets/ProcessesListPage-C_ars8gp.js +2 -0
- package/dashboard/dist/assets/{ProcessesListPage-MnLMnxAa.js.map → ProcessesListPage-C_ars8gp.js.map} +1 -1
- package/dashboard/dist/assets/RolePill-DrBZ7JJj.js +2 -0
- package/dashboard/dist/assets/{RolePill-BOBytzrP.js.map → RolePill-DrBZ7JJj.js.map} +1 -1
- package/dashboard/dist/assets/RolesPage-DgSXFFGL.js +2 -0
- package/dashboard/dist/assets/{RolesPage-BH7KASM7.js.map → RolesPage-DgSXFFGL.js.map} +1 -1
- package/dashboard/dist/assets/RowActions-QcakGbVA.js +2 -0
- package/dashboard/dist/assets/{RowActions-Dg-Fsm5O.js.map → RowActions-QcakGbVA.js.map} +1 -1
- package/dashboard/dist/assets/RunAsSelector-CYMeZwrM.js +2 -0
- package/dashboard/dist/assets/{RunAsSelector-_QbJKhlo.js.map → RunAsSelector-CYMeZwrM.js.map} +1 -1
- package/dashboard/dist/assets/ServerName-D5NKD06M.js +2 -0
- package/dashboard/dist/assets/{ServerName-uqa4eBqm.js.map → ServerName-D5NKD06M.js.map} +1 -1
- package/dashboard/dist/assets/StatCard-PZQmmCHK.js +2 -0
- package/dashboard/dist/assets/{StatCard-DlgF0CJC.js.map → StatCard-PZQmmCHK.js.map} +1 -1
- package/dashboard/dist/assets/StatusBadge-ME2R6a7K.js +2 -0
- package/dashboard/dist/assets/{StatusBadge-XQlNFwmH.js.map → StatusBadge-ME2R6a7K.js.map} +1 -1
- package/dashboard/dist/assets/StepIndicator-CDDVahOz.js +2 -0
- package/dashboard/dist/assets/{StepIndicator-CuUIGxKk.js.map → StepIndicator-CDDVahOz.js.map} +1 -1
- package/dashboard/dist/assets/StickyPagination-Ddy93Q5I.js +2 -0
- package/dashboard/dist/assets/{StickyPagination-F9FZsRy9.js.map → StickyPagination-Ddy93Q5I.js.map} +1 -1
- package/dashboard/dist/assets/SwimlaneTimeline-CYYA8nd9.js +2 -0
- package/dashboard/dist/assets/{SwimlaneTimeline-og79Llvs.js.map → SwimlaneTimeline-CYYA8nd9.js.map} +1 -1
- package/dashboard/dist/assets/TagInput-B45Dm3IW.js +2 -0
- package/dashboard/dist/assets/{TagInput-D3f11sbM.js.map → TagInput-B45Dm3IW.js.map} +1 -1
- package/dashboard/dist/assets/TaskDetailPage-CoZFkJ6d.js +2 -0
- package/dashboard/dist/assets/TaskDetailPage-CoZFkJ6d.js.map +1 -0
- package/dashboard/dist/assets/TaskQueuePill-BJRUjVDv.js +2 -0
- package/dashboard/dist/assets/{TaskQueuePill-Bc45J7X1.js.map → TaskQueuePill-BJRUjVDv.js.map} +1 -1
- package/dashboard/dist/assets/TasksListPage-Czu08px3.js +2 -0
- package/dashboard/dist/assets/{TasksListPage-BYj3OqUi.js.map → TasksListPage-Czu08px3.js.map} +1 -1
- package/dashboard/dist/assets/TimeAgo-CJ56IUy6.js +2 -0
- package/dashboard/dist/assets/{TimeAgo-W7TdJpV-.js.map → TimeAgo-CJ56IUy6.js.map} +1 -1
- package/dashboard/dist/assets/TimestampCell-QtcYZ9Jx.js +2 -0
- package/dashboard/dist/assets/{TimestampCell-Bi2nc9Q_.js.map → TimestampCell-QtcYZ9Jx.js.map} +1 -1
- package/dashboard/dist/assets/ToolPill-DpDv3FwI.js +2 -0
- package/dashboard/dist/assets/{ToolPill-CuoXcmhv.js.map → ToolPill-DpDv3FwI.js.map} +1 -1
- package/dashboard/dist/assets/ToolTestPanel-BzFOwzd_.js +2 -0
- package/dashboard/dist/assets/{ToolTestPanel-Dl3C53zb.js.map → ToolTestPanel-BzFOwzd_.js.map} +1 -1
- package/dashboard/dist/assets/TopicDetailPage-DwShZbh9.js +9 -0
- package/dashboard/dist/assets/{TopicDetailPage-CjaZn4WP.js.map → TopicDetailPage-DwShZbh9.js.map} +1 -1
- package/dashboard/dist/assets/TopicsPage-DKXlpZl_.js +2 -0
- package/dashboard/dist/assets/{TopicsPage-BfsJEC1p.js.map → TopicsPage-DKXlpZl_.js.map} +1 -1
- package/dashboard/dist/assets/UserName-zlR1so37.js +2 -0
- package/dashboard/dist/assets/{UserName-b4baWHM_.js.map → UserName-zlR1so37.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowExecutionPage-BMNIxeJB.js +2 -0
- package/dashboard/dist/assets/{WorkflowExecutionPage-BGmJnXnk.js.map → WorkflowExecutionPage-BMNIxeJB.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowPill-B5B3yGlh.js +2 -0
- package/dashboard/dist/assets/{WorkflowPill-Bg2-0Hkg.js.map → WorkflowPill-B5B3yGlh.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowsDashboard-BlAPZbQZ.js +2 -0
- package/dashboard/dist/assets/{WorkflowsDashboard-BzH7jMRu.js.map → WorkflowsDashboard-BlAPZbQZ.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowsOverview-NnPi6rwS.js +2 -0
- package/dashboard/dist/assets/{WorkflowsOverview-BcUgBvjD.js.map → WorkflowsOverview-NnPi6rwS.js.map} +1 -1
- package/dashboard/dist/assets/YamlWorkflowsPage-C4mZum6x.js +2 -0
- package/dashboard/dist/assets/{YamlWorkflowsPage-OhpCQJ0l.js.map → YamlWorkflowsPage-C4mZum6x.js.map} +1 -1
- package/dashboard/dist/assets/{agents-Ce3HmPz4.js → agents-B5wvILeV.js} +2 -2
- package/dashboard/dist/assets/{agents-Ce3HmPz4.js.map → agents-B5wvILeV.js.map} +1 -1
- package/dashboard/dist/assets/{bots-B0BomNnf.js → bots-BPlouRDm.js} +2 -2
- package/dashboard/dist/assets/{bots-B0BomNnf.js.map → bots-BPlouRDm.js.map} +1 -1
- package/dashboard/dist/assets/capabilities-DkvRG09b.js +2 -0
- package/dashboard/dist/assets/{capabilities-t-w5N9K9.js.map → capabilities-DkvRG09b.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-BrtAZnJM.js → controlplane-0m_rA-UW.js} +2 -2
- package/dashboard/dist/assets/{controlplane-BrtAZnJM.js.map → controlplane-0m_rA-UW.js.map} +1 -1
- package/dashboard/dist/assets/escalation-CfIAIUg2.js +2 -0
- package/dashboard/dist/assets/{escalation-DilnDxw2.js.map → escalation-CfIAIUg2.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-CLIdxlbe.js +2 -0
- package/dashboard/dist/assets/{escalation-columns-C0slywOY.js.map → escalation-columns-CLIdxlbe.js.map} +1 -1
- package/dashboard/dist/assets/helpers-prGqC38M.js +2 -0
- package/dashboard/dist/assets/{helpers-BMvPqQr8.js.map → helpers-prGqC38M.js.map} +1 -1
- package/dashboard/dist/assets/index-4T7Z_gQ4.js +281 -0
- package/dashboard/dist/assets/index-4T7Z_gQ4.js.map +1 -0
- package/dashboard/dist/assets/index-BR3SwTNI.js +2 -0
- package/dashboard/dist/assets/{index-pIMl0mYp.js.map → index-BR3SwTNI.js.map} +1 -1
- package/dashboard/dist/assets/index-BWKIigEk.js +2 -0
- package/dashboard/dist/assets/{index-qNuxC8kX.js.map → index-BWKIigEk.js.map} +1 -1
- package/dashboard/dist/assets/index-BgVuyWhi.js +15 -0
- package/dashboard/dist/assets/{index-D_wqdvG_.js.map → index-BgVuyWhi.js.map} +1 -1
- package/dashboard/dist/assets/index-C0sDEKdo.js +2 -0
- package/dashboard/dist/assets/{index-30-pN97P.js.map → index-C0sDEKdo.js.map} +1 -1
- package/dashboard/dist/assets/index-C2MJzu6J.js +2 -0
- package/dashboard/dist/assets/{index-f-0Duls3.js.map → index-C2MJzu6J.js.map} +1 -1
- package/dashboard/dist/assets/index-CFoddJDr.js +6 -0
- package/dashboard/dist/assets/{index-Ck2QdJXT.js.map → index-CFoddJDr.js.map} +1 -1
- package/dashboard/dist/assets/index-CrMxD5Ib.js +6 -0
- package/dashboard/dist/assets/{index-DPW_i3fH.js.map → index-CrMxD5Ib.js.map} +1 -1
- package/dashboard/dist/assets/index-CuY5hPYB.js +2 -0
- package/dashboard/dist/assets/{index-DnsVYMMg.js.map → index-CuY5hPYB.js.map} +1 -1
- package/dashboard/dist/assets/index-CwkJBn87.js +2 -0
- package/dashboard/dist/assets/{index-Bl9wzQ8Q.js.map → index-CwkJBn87.js.map} +1 -1
- package/dashboard/dist/assets/index-DeL84Cag.js +2 -0
- package/dashboard/dist/assets/{index-DNmlrCAp.js.map → index-DeL84Cag.js.map} +1 -1
- package/dashboard/dist/assets/index-DqeLbz6j.js +2 -0
- package/dashboard/dist/assets/{index-BxOuF0hm.js.map → index-DqeLbz6j.js.map} +1 -1
- package/dashboard/dist/assets/index-P9huxx3-.js +2 -0
- package/dashboard/dist/assets/{index-H5TlloTk.js.map → index-P9huxx3-.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-D01NdF5h.js → knowledge-CUZxyRCO.js} +2 -2
- package/dashboard/dist/assets/{knowledge-D01NdF5h.js.map → knowledge-CUZxyRCO.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-CjXjDZI0.js → mcp-B5VQPoF3.js} +2 -2
- package/dashboard/dist/assets/{mcp-CjXjDZI0.js.map → mcp-B5VQPoF3.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-LlKQcWLJ.js → mcp-query-Ba5Zj3yg.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-LlKQcWLJ.js.map → mcp-query-Ba5Zj3yg.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-runs-C0C54hU6.js → mcp-runs-CAiEr5Fc.js} +2 -2
- package/dashboard/dist/assets/{mcp-runs-C0C54hU6.js.map → mcp-runs-CAiEr5Fc.js.map} +1 -1
- package/dashboard/dist/assets/namespaces-sVr5scma.js +2 -0
- package/dashboard/dist/assets/{namespaces-6qWDXXJV.js.map → namespaces-sVr5scma.js.map} +1 -1
- package/dashboard/dist/assets/{roles-Dtj0uabn.js → roles-E_bA4e0f.js} +2 -2
- package/dashboard/dist/assets/{roles-Dtj0uabn.js.map → roles-E_bA4e0f.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-BevFBjZq.js → tasks-CL6Gv8jB.js} +2 -2
- package/dashboard/dist/assets/{tasks-BevFBjZq.js.map → tasks-CL6Gv8jB.js.map} +1 -1
- package/dashboard/dist/assets/{topics-BMG5tx2g.js → topics-DbtPHERP.js} +2 -2
- package/dashboard/dist/assets/{topics-BMG5tx2g.js.map → topics-DbtPHERP.js.map} +1 -1
- package/dashboard/dist/assets/{useCollapsedSections-BU5HULGs.js → useCollapsedSections-CGNA5oKV.js} +2 -2
- package/dashboard/dist/assets/{useCollapsedSections-BU5HULGs.js.map → useCollapsedSections-CGNA5oKV.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-CPyvFlVR.js → useEventHooks-C6c618cj.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-CPyvFlVR.js.map → useEventHooks-C6c618cj.js.map} +1 -1
- package/dashboard/dist/assets/{useExpandedRows-CkcEntB-.js → useExpandedRows-Cg9iq6Vy.js} +2 -2
- package/dashboard/dist/assets/{useExpandedRows-CkcEntB-.js.map → useExpandedRows-Cg9iq6Vy.js.map} +1 -1
- package/dashboard/dist/assets/{useFilterParams-DZCAaBC7.js → useFilterParams-CGRYFw_A.js} +2 -2
- package/dashboard/dist/assets/{useFilterParams-DZCAaBC7.js.map → useFilterParams-CGRYFw_A.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-Bll8NPNQ.js → useYamlActivityEvents-eK7kIUdh.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-Bll8NPNQ.js.map → useYamlActivityEvents-eK7kIUdh.js.map} +1 -1
- package/dashboard/dist/assets/{users-XZ349b0r.js → users-CCHSIAxt.js} +2 -2
- package/dashboard/dist/assets/{users-XZ349b0r.js.map → users-CCHSIAxt.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-B_Yla7iD.js → vendor-icons-D8-ZINAH.js} +2 -2
- package/dashboard/dist/assets/{vendor-icons-B_Yla7iD.js.map → vendor-icons-D8-ZINAH.js.map} +1 -1
- package/dashboard/dist/assets/vendor-query-DLp59M9_.js +35 -0
- package/dashboard/dist/assets/vendor-query-DLp59M9_.js.map +1 -0
- package/dashboard/dist/assets/vendor-react-Co3Y8ikm.js +26 -0
- package/dashboard/dist/assets/vendor-react-Co3Y8ikm.js.map +1 -0
- package/dashboard/dist/assets/{workflows-Do-Eiv8f.js → workflows-BNbocg_9.js} +2 -2
- package/dashboard/dist/assets/{workflows-Do-Eiv8f.js.map → workflows-BNbocg_9.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-DolGRQ5f.js → yaml-workflows-Cu1FUwrc.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-DolGRQ5f.js.map → yaml-workflows-Cu1FUwrc.js.map} +1 -1
- package/dashboard/dist/index.html +4 -4
- package/package.json +1 -1
- package/dashboard/dist/assets/AdminDashboard-DISq0Tz8.js +0 -2
- package/dashboard/dist/assets/AgentConfigPage-DqaJpB3K.js +0 -16
- package/dashboard/dist/assets/AgentDetailPage-BPzPk2GC.js +0 -4
- package/dashboard/dist/assets/AgentsPage-CLcxJWjC.js +0 -2
- package/dashboard/dist/assets/AvailableEscalationsPage-hOcjAAIj.js +0 -2
- package/dashboard/dist/assets/BotPicker-DuAZgHbJ.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-PRel6TXd.js +0 -2
- package/dashboard/dist/assets/CollapsibleSection-DnoUFQVf.js +0 -2
- package/dashboard/dist/assets/ConfirmDeleteModal-dOxidrSR.js +0 -2
- package/dashboard/dist/assets/CopyableId-D0SQ39nR.js +0 -2
- package/dashboard/dist/assets/CredentialsPage-CqedUU7b.js +0 -2
- package/dashboard/dist/assets/CronLabel-CPEjE-mH.js +0 -2
- package/dashboard/dist/assets/CustomDurationPicker-BIQWzbv0.js +0 -2
- package/dashboard/dist/assets/DataTable-D9yuBv0w.js +0 -2
- package/dashboard/dist/assets/DropZone-e5EOL5gC.js +0 -2
- package/dashboard/dist/assets/ElapsedCell-CzVjr74Y.js +0 -2
- package/dashboard/dist/assets/EmptyState-BcsfPq9T.js +0 -2
- package/dashboard/dist/assets/EscalationsOverview-Bcrb44xJ.js +0 -2
- package/dashboard/dist/assets/EventTable-CGfJU7e1.js +0 -2
- package/dashboard/dist/assets/EventTopicPill-xJJnxvlP.js +0 -2
- package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js +0 -2
- package/dashboard/dist/assets/HomePage-BIzUcGW9.js +0 -2
- package/dashboard/dist/assets/ListToolbar-DNAGFe14.js +0 -2
- package/dashboard/dist/assets/McpOverview-BpYk21es.js +0 -2
- package/dashboard/dist/assets/McpQueryDetailPage-DlrZiSuL.js +0 -5
- package/dashboard/dist/assets/McpQueryPage-COfPssO7.js +0 -2
- package/dashboard/dist/assets/McpRunDetailPage-Cra0nQSw.js +0 -2
- package/dashboard/dist/assets/McpRunsPage-BlgcGN3k.js +0 -2
- package/dashboard/dist/assets/Modal-DEODGeqx.js +0 -2
- package/dashboard/dist/assets/OperatorDashboard-BbO6cWzb.js +0 -2
- package/dashboard/dist/assets/PageHeader-B_gV_jKk.js +0 -2
- package/dashboard/dist/assets/PageHeaderWithStats-D0I0nrnx.js +0 -2
- package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js +0 -2
- package/dashboard/dist/assets/ProcessDetailPage-s_iV8ICg.js +0 -2
- package/dashboard/dist/assets/ProcessesListPage-MnLMnxAa.js +0 -2
- package/dashboard/dist/assets/RolePill-BOBytzrP.js +0 -2
- package/dashboard/dist/assets/RolesPage-BH7KASM7.js +0 -2
- package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js +0 -2
- package/dashboard/dist/assets/RunAsSelector-_QbJKhlo.js +0 -2
- package/dashboard/dist/assets/ServerName-uqa4eBqm.js +0 -2
- package/dashboard/dist/assets/StatCard-DlgF0CJC.js +0 -2
- package/dashboard/dist/assets/StatusBadge-XQlNFwmH.js +0 -2
- package/dashboard/dist/assets/StepIndicator-CuUIGxKk.js +0 -2
- package/dashboard/dist/assets/StickyPagination-F9FZsRy9.js +0 -2
- package/dashboard/dist/assets/SwimlaneTimeline-og79Llvs.js +0 -2
- package/dashboard/dist/assets/TagInput-D3f11sbM.js +0 -2
- package/dashboard/dist/assets/TaskDetailPage-DPV4ySd9.js +0 -2
- package/dashboard/dist/assets/TaskDetailPage-DPV4ySd9.js.map +0 -1
- package/dashboard/dist/assets/TaskQueuePill-Bc45J7X1.js +0 -2
- package/dashboard/dist/assets/TasksListPage-BYj3OqUi.js +0 -2
- package/dashboard/dist/assets/TimeAgo-W7TdJpV-.js +0 -2
- package/dashboard/dist/assets/TimestampCell-Bi2nc9Q_.js +0 -2
- package/dashboard/dist/assets/ToolPill-CuoXcmhv.js +0 -2
- package/dashboard/dist/assets/ToolTestPanel-Dl3C53zb.js +0 -2
- package/dashboard/dist/assets/TopicDetailPage-CjaZn4WP.js +0 -9
- package/dashboard/dist/assets/TopicsPage-BfsJEC1p.js +0 -2
- package/dashboard/dist/assets/UserName-b4baWHM_.js +0 -2
- package/dashboard/dist/assets/WorkflowExecutionPage-BGmJnXnk.js +0 -2
- package/dashboard/dist/assets/WorkflowPill-Bg2-0Hkg.js +0 -2
- package/dashboard/dist/assets/WorkflowsDashboard-BzH7jMRu.js +0 -2
- package/dashboard/dist/assets/WorkflowsOverview-BcUgBvjD.js +0 -2
- package/dashboard/dist/assets/YamlWorkflowsPage-OhpCQJ0l.js +0 -2
- package/dashboard/dist/assets/capabilities-t-w5N9K9.js +0 -2
- package/dashboard/dist/assets/escalation-DilnDxw2.js +0 -2
- package/dashboard/dist/assets/escalation-columns-C0slywOY.js +0 -2
- package/dashboard/dist/assets/helpers-BMvPqQr8.js +0 -2
- package/dashboard/dist/assets/index-30-pN97P.js +0 -2
- package/dashboard/dist/assets/index-Bl9wzQ8Q.js +0 -2
- package/dashboard/dist/assets/index-BxOuF0hm.js +0 -2
- package/dashboard/dist/assets/index-Ck2QdJXT.js +0 -6
- package/dashboard/dist/assets/index-DNmlrCAp.js +0 -2
- package/dashboard/dist/assets/index-DPW_i3fH.js +0 -6
- package/dashboard/dist/assets/index-DZX-E_3q.js +0 -63
- package/dashboard/dist/assets/index-DZX-E_3q.js.map +0 -1
- package/dashboard/dist/assets/index-D_wqdvG_.js +0 -15
- package/dashboard/dist/assets/index-DnsVYMMg.js +0 -2
- package/dashboard/dist/assets/index-H5TlloTk.js +0 -2
- package/dashboard/dist/assets/index-f-0Duls3.js +0 -2
- package/dashboard/dist/assets/index-pIMl0mYp.js +0 -2
- package/dashboard/dist/assets/index-qNuxC8kX.js +0 -2
- package/dashboard/dist/assets/namespaces-6qWDXXJV.js +0 -2
- package/dashboard/dist/assets/vendor-query-B2UbickB.js +0 -18
- package/dashboard/dist/assets/vendor-query-B2UbickB.js.map +0 -1
- package/dashboard/dist/assets/vendor-react-CX88sFS5.js +0 -22
- package/dashboard/dist/assets/vendor-react-CX88sFS5.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,a as u}from"./vendor-query-B2UbickB.js";import{d as H,e as $,f as O,g as U}from"./mcp-CjXjDZI0.js";import{S as z}from"./StepIndicator-CuUIGxKk.js";import{P as J}from"./PageHeader-B_gV_jKk.js";import{T as Y}from"./TagInput-D3f11sbM.js";import{X as q,H as K,aj as V,ak as X}from"./vendor-icons-B_Yla7iD.js";import{e as G,c as W,f as Q}from"./vendor-react-CX88sFS5.js";import"./index-DZX-E_3q.js";const T={name:"",description:"",mode:"network",transport_type:"sse",command:"",args:"",env_vars:"{}",url:"",auto_connect:!1,tags:[],compile_hints:"",credential_providers:[],discovered_tools:null};function Z(s){const t=s.transport_config??{},r=!!t.builtin;let a="network";return r?a="in-process":s.transport_type==="stdio"&&(a="local-process"),{name:s.name,description:s.description??"",mode:a,transport_type:s.transport_type,command:t.command??"",args:(t.args??[]).join(", "),env_vars:t.env?JSON.stringify(t.env,null,2):"{}",url:t.url??"",auto_connect:s.auto_connect,tags:s.tags??[],compile_hints:s.compile_hints??"",credential_providers:s.credential_providers??[],discovered_tools:s.tool_manifest??null}}function M(s){let t={};return s.mode==="local-process"?t={command:s.command.trim(),args:s.args.split(",").map(r=>r.trim()).filter(Boolean),env:s.env_vars.trim()?JSON.parse(s.env_vars):void 0}:s.mode==="network"&&(t={url:s.url.trim()}),{name:s.name.trim(),description:s.description.trim()||void 0,transport_type:s.mode==="local-process"?"stdio":s.transport_type,transport_config:t,auto_connect:s.auto_connect,tags:s.tags,compile_hints:s.compile_hints.trim()||void 0,credential_providers:s.credential_providers.length>0?s.credential_providers:void 0}}const L=["Transport","Discovery","Test","Review"];function E(s,t){return s===1?!(!t.name.trim()||t.mode==="network"&&!t.url.trim()||t.mode==="local-process"&&!t.command.trim()):!0}const c="label",h="hint",ee=[{value:"in-process",label:"In-Process",hint:"Built-in server running inside the app"},{value:"network",label:"Network Service",hint:"Remote server via SSE or Streamable HTTP"},{value:"local-process",label:"Local Process",hint:"Spawn a local command via stdio"}];function se({form:s,set:t,isBuiltin:r}){return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Connection Mode"}),e.jsx("div",{className:"grid grid-cols-3 gap-3 mt-1",children:ee.map(a=>{const d=s.mode===a.value,l=r&&a.value!=="in-process";return e.jsxs("button",{type:"button",disabled:l,onClick:()=>{t("mode",a.value),a.value==="local-process"&&t("transport_type","stdio"),a.value==="network"&&t("transport_type","sse")},className:`text-left p-3 rounded-md border transition-colors ${d?"border-accent bg-accent/5":l?"border-surface-border bg-surface-sunken opacity-50 cursor-not-allowed":"border-surface-border hover:border-text-tertiary cursor-pointer"}`,children:[e.jsx("span",{className:`text-xs font-medium ${d?"text-accent":"text-text-primary"}`,children:a.label}),e.jsx("span",{className:"block text-[10px] text-text-tertiary mt-0.5",children:a.hint})]},a.value)})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Name"}),e.jsx("input",{type:"text",value:s.name,onChange:a=>t("name",a.target.value),placeholder:"e.g., vision-server",className:"input text-xs w-full",disabled:r})]}),e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Description"}),e.jsx("input",{type:"text",value:s.description,onChange:a=>t("description",a.target.value),placeholder:"Optional description",className:"input text-xs w-full"})]})]}),s.mode==="in-process"&&e.jsx("div",{children:e.jsx("p",{className:h,children:"This server runs in-process via InMemoryTransport. Transport is managed automatically — no configuration needed."})}),s.mode==="network"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Server URL"}),e.jsx("input",{type:"text",value:s.url,onChange:a=>t("url",a.target.value),placeholder:"https://mcp-server.example.com/sse",className:"input text-xs w-full font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Transport Protocol"}),e.jsx("div",{className:"flex gap-2 mt-1",children:["sse","streamable-http"].map(a=>e.jsx("button",{type:"button",onClick:()=>t("transport_type",a),className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${s.transport_type===a?"border-accent bg-accent/5 text-accent font-medium":"border-surface-border text-text-secondary hover:border-text-tertiary"}`,children:a==="sse"?"SSE":"Streamable HTTP"},a))})]})]}),s.mode==="local-process"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Command"}),e.jsx("input",{type:"text",value:s.command,onChange:a=>t("command",a.target.value),placeholder:"e.g., npx",className:"input text-xs w-full font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Arguments (comma-separated)"}),e.jsx("input",{type:"text",value:s.args,onChange:a=>t("args",a.target.value),placeholder:"e.g., -y, @modelcontextprotocol/server-filesystem, /tmp",className:"input text-xs w-full font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Environment Variables (JSON)"}),e.jsx("textarea",{value:s.env_vars,onChange:a=>t("env_vars",a.target.value),className:"input-json w-full",rows:3,spellCheck:!1})]})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s.auto_connect,onChange:a=>t("auto_connect",a.target.checked),className:"w-4 h-4 rounded border-border accent-accent"}),e.jsx("span",{className:"text-xs text-text-primary",children:"Auto-connect on startup"})]})]})}function te({form:s,set:t}){const[r,a]=u.useState(""),d=n=>{const i=n.trim().toLowerCase();i&&!s.credential_providers.includes(i)&&t("credential_providers",[...s.credential_providers,i]),a("")},l=n=>{t("credential_providers",s.credential_providers.filter(i=>i!==n))},p=n=>{n.key==="Enter"||n.key===","?(n.preventDefault(),d(r)):n.key==="Backspace"&&!r&&s.credential_providers.length>0&&l(s.credential_providers[s.credential_providers.length-1])};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Tags"}),e.jsx(Y,{tags:s.tags,onChange:n=>t("tags",n),placeholder:"Add tag (e.g., database, analytics)..."}),e.jsx("p",{className:h,children:"Tags enable tool discovery. Workflows filter available MCP servers by tags to find relevant tools."})]}),e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Compile Hints"}),e.jsx("textarea",{value:s.compile_hints,onChange:n=>t("compile_hints",n.target.value),placeholder:"Guidance for the workflow compiler when generating YAML from this server's tools...",className:"input text-xs w-full leading-relaxed",rows:4,spellCheck:!1}),e.jsx("p",{className:h,children:"Free-form text that guides the workflow compiler. Describe how tools should be composed, sequenced, or parameterized."})]}),e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Credential Providers"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 bg-surface-sunken border border-surface-border rounded-md px-2 py-1.5 focus-within:ring-1 focus-within:ring-accent-primary",children:[s.credential_providers.map(n=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-accent/10 text-accent text-[11px] font-medium",children:[n,e.jsx("button",{type:"button",onClick:()=>l(n),className:"hover:text-status-error transition-colors",children:e.jsx(q,{className:"w-2.5 h-2.5"})})]},n)),e.jsx("input",{type:"text",value:r,onChange:n=>a(n.target.value),onKeyDown:p,onBlur:()=>{r.trim()&&d(r)},placeholder:s.credential_providers.length===0?"Add provider (e.g., github, slack)...":"",className:"flex-1 min-w-[80px] bg-transparent text-xs text-text-primary outline-none placeholder:text-text-tertiary"})]}),e.jsx("p",{className:h,children:"IAM credential providers required by this server's tools. Users will be prompted to connect these before tool execution."})]})]})}function ae({form:s,set:t}){const r=H(),a=s.mode==="in-process",d=()=>{const n=M(s);r.mutate({transport_type:n.transport_type,transport_config:n.transport_config},{onSuccess:i=>{i.success&&t("discovered_tools",i.tools)}})},l=r.data,p=s.discovered_tools??(l==null?void 0:l.tools)??[];return e.jsx("div",{className:"space-y-5",children:a?e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-text-secondary",children:"In-process servers connect lazily on first tool call. No connection test needed."}),s.discovered_tools&&s.discovered_tools.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsxs("p",{className:"text-xs text-text-tertiary mb-2",children:[s.discovered_tools.length," tool",s.discovered_tools.length!==1?"s":""," cached from last connection"]}),e.jsx(I,{tools:s.discovered_tools})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:d,disabled:r.isPending,className:"btn-primary text-xs",children:r.isPending?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(K,{className:"w-3 h-3 animate-spin"}),"Connecting..."]}):"Test Connection"}),(l==null?void 0:l.success)&&e.jsxs("span",{className:"flex items-center gap-1 text-xs text-status-success",children:[e.jsx(V,{className:"w-3.5 h-3.5"}),"Connected — ",p.length," tool",p.length!==1?"s":""," discovered"]}),l&&!l.success&&e.jsxs("span",{className:"flex items-center gap-1 text-xs text-status-error",children:[e.jsx(X,{className:"w-3.5 h-3.5"}),l.error||"Connection failed"]})]}),p.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-text-tertiary mb-2",children:"Discovered tools"}),e.jsx(I,{tools:p})]}),e.jsx("p",{className:h,children:"Tests connectivity by connecting to the server and listing available tools. The server must be reachable from this machine."})]})})}function I({tools:s}){return e.jsx("div",{className:"max-h-[280px] overflow-y-auto border border-surface-border rounded-md divide-y divide-surface-border",children:s.map(t=>e.jsxs("div",{className:"px-3 py-2",children:[e.jsx("span",{className:"text-xs font-medium text-text-primary font-mono",children:t.name}),t.description&&e.jsx("span",{className:"block text-[10px] text-text-tertiary mt-0.5 line-clamp-2",children:t.description})]},t.name))})}const re={"in-process":"In-Process",network:"Network Service","local-process":"Local Process"},ne={stdio:"stdio",sse:"SSE","streamable-http":"Streamable HTTP"};function le({form:s}){const t=s.discovered_tools??[];return e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{label:"Name",value:s.name}),s.description&&e.jsx(x,{label:"Description",value:s.description}),e.jsx(x,{label:"Mode",value:re[s.mode]??s.mode}),s.mode==="network"&&e.jsxs(e.Fragment,{children:[e.jsx(x,{label:"Transport",value:ne[s.transport_type]??s.transport_type}),e.jsx(x,{label:"URL",value:s.url,mono:!0})]}),s.mode==="local-process"&&e.jsxs(e.Fragment,{children:[e.jsx(x,{label:"Command",value:s.command,mono:!0}),s.args&&e.jsx(x,{label:"Args",value:s.args,mono:!0})]}),e.jsx(x,{label:"Auto-connect",value:s.auto_connect?"Yes":"No"}),s.tags.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Tags"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:s.tags.map(r=>e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent/10 text-accent text-[11px] font-medium",children:r},r))})]}),s.credential_providers.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:c,children:"Credential Providers"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:s.credential_providers.map(r=>e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-accent/10 text-accent text-[11px] font-medium",children:r},r))})]}),s.compile_hints&&e.jsx(x,{label:"Compile Hints",value:s.compile_hints}),t.length>0&&e.jsx(x,{label:"Discovered Tools",value:`${t.length} tool${t.length!==1?"s":""}`})]})}function x({label:s,value:t,mono:r}){return e.jsxs("div",{children:[e.jsx("label",{className:c,children:s}),e.jsx("p",{className:`text-xs text-text-primary mt-0.5 ${r?"font-mono":""}`,children:t})]})}function ve(){var C,k,P;const{serverId:s}=G(),t=!s,r=W(),{data:a,isLoading:d}=$(s??""),l=O(),p=U(),[n,i]=u.useState(T),[N,y]=u.useState(!1),[R,_]=u.useState(""),[D,f]=Q(),o=parseInt(D.get("step")||"1",10),j=u.useCallback(m=>{f(v=>{const g=new URLSearchParams(v);return g.set("step",String(m)),g},{replace:!1})},[f]);u.useEffect(()=>{if(!N){if(t){i(T),y(!0);return}a&&(i(Z(a)),y(!0))}},[a,t,N]);const b=(m,v)=>i(g=>({...g,[m]:v})),A=!!((C=a==null?void 0:a.transport_config)!=null&&C.builtin),F=()=>{_("");const m=M(n);a?p.mutate({id:a.id,...m},{onSuccess:()=>r("/mcp/servers")}):l.mutate(m,{onSuccess:()=>r("/mcp/servers"),onError:v=>_(v.message)})};if(!t&&d)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"})]});if(!t&&!a&&!d)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Server not found."});const B=o===L.length,w=l.isPending||p.isPending,S=R||((k=l.error)==null?void 0:k.message)||((P=p.error)==null?void 0:P.message);return e.jsxs("div",{children:[e.jsx(J,{title:t?"Register MCP Server":(a==null?void 0:a.name)??""}),e.jsxs("div",{className:"max-w-3xl",children:[e.jsx(z,{steps:L,currentStep:o-1,onStepClick:m=>j(m+1)}),e.jsxs("div",{className:"min-h-[360px] py-2",children:[o===1&&e.jsx(se,{form:n,set:b,isBuiltin:A}),o===2&&e.jsx(te,{form:n,set:b}),o===3&&e.jsx(ae,{form:n,set:b}),o===4&&e.jsx(le,{form:n})]}),S&&e.jsx("p",{className:"text-xs text-status-error mt-4",children:S}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-surface-border mt-4",children:[e.jsx("div",{children:o>1&&e.jsx("button",{onClick:()=>j(o-1),className:"btn-secondary text-xs",children:"Back"})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>r("/mcp/servers"),className:"btn-ghost text-xs",children:"Cancel"}),B?e.jsx("button",{onClick:F,disabled:!E(o,n)||w,className:"btn-primary text-xs",children:w?"Saving...":a?"Save":"Register"}):e.jsx("button",{onClick:()=>j(o+1),disabled:!E(o,n),className:"btn-primary text-xs",children:"Next"})]})]})]})]})}export{ve as McpServerDetailPage};
|
|
2
|
-
//# sourceMappingURL=index-BxOuF0hm.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{j as e,a as c}from"./vendor-query-B2UbickB.js";import{c as H,d as K,b as U,u as G,e as Q,f as X}from"./workflows-Do-Eiv8f.js";import{P as Y}from"./PageHeader-B_gV_jKk.js";import{P as B,a4 as W,a as L,a9 as Z,aa as ee}from"./vendor-icons-B_Yla7iD.js";import{S as I,j as V}from"./index-DZX-E_3q.js";import{W as te}from"./WorkflowPill-Bg2-0Hkg.js";import{B as se}from"./BotPicker-DuAZgHbJ.js";import{L as ae,c as z,f as ne}from"./vendor-react-CX88sFS5.js";import{D as re}from"./DataTable-D9yuBv0w.js";import{e as oe,d as A,C as le,j as ce}from"./helpers-BMvPqQr8.js";import"./bots-B0BomNnf.js";import"./EmptyState-BcsfPq9T.js";import"./TimeAgo-W7TdJpV-.js";import"./StatusBadge-XQlNFwmH.js";function ie({mode:t,onChange:a}){const f=(r,n,o)=>e.jsxs("button",{onClick:()=>a(r),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md transition-colors ${t===r?"bg-accent/10 text-accent font-medium":"text-text-tertiary hover:text-text-secondary hover:bg-surface-hover"}`,children:[n,o]});return e.jsxs("div",{className:"flex gap-1 p-0.5 bg-surface-sunken rounded-lg w-fit",children:[f("now",e.jsx(B,{className:"w-3.5 h-3.5"}),"Start Now"),f("schedule",e.jsx(W,{className:"w-3.5 h-3.5"}),"Schedule")]})}function xe({configs:t,selectedType:a,onSelect:f,tierMap:r,activeTypes:n}){return e.jsxs("div",{children:[e.jsx(I,{className:"mb-4",children:"Select Workflow"}),e.jsx("div",{children:t.map(o=>{const m=a===o.workflow_type,i=r.get(o.workflow_type)??"durable",x=i==="certified"?"certified":i==="configured"?"configured":"durable";return e.jsxs("button",{onClick:()=>f(o),className:`w-full text-left px-6 py-3.5 border-b border-surface-border/50 transition-colors duration-150 ${m?"border-l-2 border-l-accent":"hover:bg-surface-hover/30"}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{type:o.workflow_type,size:"md",variant:x}),(n==null?void 0:n.has(o.workflow_type))&&e.jsx("span",{title:"Cron schedule active",children:e.jsx(W,{className:"w-3 h-3 text-status-success/70 shrink-0"})}),o.execute_as&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[9px] bg-accent/10 text-accent rounded",children:[e.jsx(L,{className:"w-2.5 h-2.5"}),o.execute_as]})]}),o.description&&e.jsx("p",{className:"text-[10px] text-text-quaternary mt-1 leading-snug",children:o.description})]},o.workflow_type)})})]})}const R=`{
|
|
2
|
-
"data": {},
|
|
3
|
-
"metadata": {}
|
|
4
|
-
}`;function de(t){return typeof t=="boolean"?"boolean":typeof t=="number"?"number":Array.isArray(t)?"array":t!==null&&typeof t=="object"?"object":"string"}function D(t){if(!t)return[];const a=t.data;return!a||typeof a!="object"?[]:Object.entries(a).map(([f,r])=>({key:f,type:de(r),defaultValue:r}))}function T(t){return{...t}}function q(t,a){return JSON.stringify({data:t,metadata:a},null,2)}function ue({config:t,overrideBot:a,onOverrideChange:f,showOverride:r}){const{user:n}=V(),o=a||t.execute_as;return e.jsxs("div",{className:"bg-surface-sunken rounded-lg px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-tertiary uppercase tracking-wider font-medium",children:"Running as"}),o&&!a&&e.jsx("span",{className:"text-[9px] text-text-tertiary",children:"configured default"}),a&&e.jsx("span",{className:"text-[9px] text-accent",children:"admin override"})]}),e.jsx("div",{className:"flex items-center gap-1.5",children:o?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"w-3.5 h-3.5 text-accent/70"}),e.jsx("span",{className:"text-xs text-text-primary font-mono",children:o})]}):e.jsxs(e.Fragment,{children:[e.jsx(Z,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-xs text-text-primary",children:(n==null?void 0:n.displayName)||(n==null?void 0:n.username)||"you"})]})}),r&&f&&e.jsxs("div",{className:"pt-1 border-t border-surface-border",children:[e.jsx("label",{className:"text-[10px] text-text-tertiary mb-1 block",children:"Override identity"}),e.jsx(se,{selected:a??"",onChange:f,placeholder:t.execute_as?`Default: ${t.execute_as}`:"Invoking user (default)"})]})]})}function me({selectedConfig:t,isJsonMode:a,hasFormView:f,jsonInput:r,formFields:n,dataFields:o,onJsonChange:m,onToggleMode:i,onUpdateFormField:x,onSetFormFields:w}){return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[e.jsx("label",{className:"block text-xs text-text-secondary",children:"Envelope"}),e.jsxs("div",{className:"flex items-center gap-3",children:[f&&e.jsx("button",{type:"button",onClick:i,className:"text-[10px] text-accent hover:underline",children:a?"Form view":"JSON view"}),t.envelope_schema?e.jsx("span",{className:"text-[10px] text-accent",children:"Pre-filled from workflow config"}):e.jsx("span",{className:"text-[10px] text-status-warning",children:"No template"})]})]}),!t.envelope_schema&&e.jsx("div",{className:"bg-surface-sunken border border-surface-border rounded px-4 py-3 mb-3",children:e.jsxs("p",{className:"text-xs text-text-secondary leading-relaxed",children:["This workflow has no input template. Edit the JSON directly below, or register it as a ",e.jsx(ae,{to:"/workflows/registry/new",className:"text-status-success hover:underline",children:"certified workflow"})," in the Workflow Registry for pre-filled fields and form-based input."]})}),a||!f?e.jsx("textarea",{value:r,onChange:d=>m(d.target.value),className:"input-json",rows:12,spellCheck:!1}):e.jsx("div",{className:"space-y-3",children:o.map(({key:d,type:l})=>{var b,N;const p=n[d],j=typeof p=="string"?p:JSON.stringify(p??(l==="array"?[]:{}),null,2),v=Math.min(20,Math.max(4,((N=(b=j==null?void 0:j.split)==null?void 0:b.call(j,`
|
|
5
|
-
`))==null?void 0:N.length)??4));return e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[d,e.jsx("span",{className:"ml-2 font-normal normal-case",children:l})]}),l==="boolean"?e.jsxs("select",{value:String(p??!1),onChange:g=>x(d,g.target.value,l),className:"select text-xs w-full",children:[e.jsx("option",{value:"true",children:"true"}),e.jsx("option",{value:"false",children:"false"})]}):l==="object"||l==="array"?e.jsx("textarea",{value:j,onChange:g=>{try{x(d,JSON.parse(g.target.value),l)}catch{w({...n,[d]:g.target.value})}},className:"input-json w-full",rows:v,spellCheck:!1}):e.jsx("input",{type:l==="number"?"number":"text",value:String(p??""),onChange:g=>x(d,g.target.value,l),className:"input text-xs w-full"})]},d)})}),e.jsxs("p",{className:"text-[10px] text-text-tertiary mt-1.5",children:["The envelope wraps your workflow input. ",e.jsx("code",{className:"text-accent/80",children:"data"})," holds workflow-specific fields; ",e.jsx("code",{className:"text-accent/80",children:"metadata"})," is optional context."]})]})}function pe({selected:t,executionsPath:a}){var y,$;const f=z(),{isSuperAdmin:r,hasRoleType:n}=V(),o=r||n("admin"),m=H(),[i,x]=c.useState(R),[w,d]=c.useState(""),[l,p]=c.useState({}),[j,v]=c.useState(!1),[b,N]=c.useState(""),g=(((y=t.roles)==null?void 0:y.length)??0)>0||((($=t.consumes)==null?void 0:$.length)??0)>0,[E,M]=c.useState(g),O=c.useMemo(()=>D(t.envelope_schema??null),[t.envelope_schema]),J=O.length>0,s=c.useMemo(()=>{if(!t.envelope_schema)return{};const u=t.envelope_schema.metadata;return u&&typeof u=="object"?u:{}},[t.envelope_schema]);c.useEffect(()=>{var P;d(""),m.reset();const u=sessionStorage.getItem("lt:invoke:prefill");if(u){sessionStorage.removeItem("lt:invoke:prefill"),x(u);try{const _=JSON.parse(u),F=(_==null?void 0:_.data)??_;F&&typeof F=="object"&&p(T(F))}catch{}v(!0),N("");return}const S=t.envelope_schema?JSON.stringify(t.envelope_schema,null,2):R;x(S),(P=t.envelope_schema)!=null&&P.data&&typeof t.envelope_schema.data=="object"?p(T(t.envelope_schema.data)):p({}),v(!D(t.envelope_schema??null).length),N(""),M(g)},[t.workflow_type]);const h=()=>{if(j)try{const u=JSON.parse(i);u.data&&typeof u.data=="object"&&p(T(u.data))}catch{}else x(q(l,s));v(!j)},k=(u,S,P)=>{let _=S;P==="number"?_=S===""?0:Number(S):P==="boolean"&&(_=S==="true"||S===!0);const F={...l,[u]:_};p(F),x(q(F,s))},C=async()=>{d("");let u;try{u=JSON.parse(i)}catch{d("Invalid JSON");return}const{data:S,metadata:P}=u;if(!S||typeof S!="object"){d('Envelope must include a "data" object');return}try{const _={...P??{}};E&&(_.certified=!0),await m.mutateAsync({workflowType:t.workflow_type,data:S,metadata:_,...b?{execute_as:b}:{}}),f(a)}catch{}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-mono font-medium text-text-primary",children:t.workflow_type}),t.description&&e.jsx("p",{className:"text-xs text-text-quaternary mt-1 leading-relaxed",children:t.description})]}),e.jsx(ue,{config:t,overrideBot:b,onOverrideChange:N,showOverride:o}),g&&e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:E,onChange:u=>M(u.target.checked),className:"rounded border-surface-border text-accent focus:ring-accent/30"}),e.jsx(ee,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("span",{className:"text-xs text-text-secondary",children:"Enable task tracking and escalation routing"})]}),e.jsx(me,{selectedConfig:t,isJsonMode:j,hasFormView:J,jsonInput:i,formFields:l,dataFields:O,onJsonChange:u=>{x(u),d("")},onToggleMode:h,onUpdateFormField:k,onSetFormFields:p}),w&&e.jsx("p",{className:"text-xs text-status-error",children:w}),m.error&&e.jsx("p",{className:"text-xs text-status-error",children:m.error.message}),m.isSuccess&&e.jsx("p",{className:"text-xs text-status-success",children:"Workflow started"}),e.jsx("button",{onClick:C,disabled:m.isPending,className:"btn-primary",children:m.isPending?"Starting...":"Start Workflow"})]})}function he({children:t,className:a=""}){return e.jsx("span",{className:`px-2 py-0.5 text-[10px] bg-surface-sunken rounded-full text-text-secondary ${a}`,children:t})}function fe({selected:t,activeTypes:a}){const f=z(),r=K(),[n,o]=c.useState(""),[m,i]=c.useState(""),[x,w]=c.useState(""),[d,l]=c.useState("json"),p=c.useMemo(()=>t!=null&&t.envelope_schema?JSON.stringify(t.envelope_schema,null,2):R,[t==null?void 0:t.envelope_schema]),j=m!==p,v=c.useMemo(()=>{try{return JSON.parse(m)}catch{return null}},[m]),b=c.useMemo(()=>v?oe(v):null,[v]);c.useEffect(()=>{o(t.cron_schedule??""),i(t.envelope_schema?JSON.stringify(t.envelope_schema,null,2):R),w(""),l("json"),r.reset()},[t.workflow_type]);const{data:N,isLoading:g}=U({entity:t.workflow_type,limit:10}),E=()=>{let s;try{s=JSON.parse(m)}catch{w("Invalid JSON in envelope");return}w(""),r.mutate({config:t,cron_schedule:n.trim()||null,envelope_schema:s})},M=()=>{o(""),r.mutate({config:t,cron_schedule:null})},O=()=>{i(p),w("")},J=(s,h)=>{if(!v)return;const k={...v.data??{}},C=k[s];typeof C=="number"?k[s]=h===""?0:Number(h):typeof C=="boolean"?k[s]=h==="true":k[s]=h,i(JSON.stringify({...v,data:k},null,2))};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h2",{className:"text-lg font-mono font-medium text-text-primary",children:t.workflow_type}),t.cron_schedule&&e.jsx(he,{className:a.has(t.workflow_type)?"bg-status-success/10 text-status-success":"bg-surface-sunken text-text-tertiary",children:a.has(t.workflow_type)?"active":"inactive"})]}),t.description&&e.jsx("p",{className:"text-xs text-text-quaternary mt-1 leading-relaxed",children:t.description})]}),e.jsx("div",{className:"bg-surface-sunken rounded-lg px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] text-text-tertiary uppercase tracking-wider font-medium mr-2",children:"Cron runs as"}),e.jsx(L,{className:"w-3.5 h-3.5 text-accent/70"}),e.jsx("span",{className:"text-xs text-text-primary font-mono",children:t.execute_as??"lt-system"}),!t.execute_as&&e.jsx("span",{className:"text-[9px] text-text-tertiary ml-1",children:"system bot"})]})}),e.jsxs("div",{children:[e.jsx(I,{className:"mb-3",children:"Schedule"}),e.jsxs("div",{className:"flex gap-3 items-start",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("input",{type:"text",value:n,onChange:s=>{o(s.target.value),r.reset()},placeholder:"0 */6 * * *",className:"input font-mono w-full"}),n.trim()&&A(n.trim())&&e.jsx("p",{className:"text-xs text-text-secondary mt-1.5",children:A(n.trim())})]}),e.jsx("button",{onClick:E,disabled:r.isPending,className:"btn-primary text-xs shrink-0",children:r.isPending?"Saving...":"Save"}),t.cron_schedule&&e.jsx("button",{onClick:M,disabled:r.isPending,className:"btn-ghost text-xs text-status-error shrink-0",children:"Clear"})]}),r.isSuccess&&e.jsx("p",{className:"text-[10px] text-status-success mt-2",children:"Schedule updated"}),r.error&&e.jsx("p",{className:"text-[10px] text-status-error mt-2",children:r.error.message})]}),e.jsxs("div",{className:"bg-surface-sunken rounded-lg p-4",children:[e.jsx(I,{className:"mb-2",children:"Common Patterns"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-6 gap-y-1.5",children:le.map(([s,h])=>e.jsxs("button",{type:"button",onClick:()=>{o(s),r.reset()},className:"flex items-center gap-2 text-left py-0.5 group",children:[e.jsx("code",{className:"font-mono text-[11px] text-accent group-hover:text-accent-hover",children:s}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:h})]},s))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between mb-2",children:[e.jsx(I,{children:"Cron Envelope"}),e.jsxs("div",{className:"flex items-center gap-3",children:[j&&e.jsx("button",{type:"button",onClick:O,className:"text-[10px] text-status-warning hover:text-status-warning/80 transition-colors",children:"Reset to default"}),b&&e.jsxs("div",{className:"flex rounded overflow-hidden border border-surface-border",children:[e.jsx("button",{type:"button",onClick:()=>l("form"),className:`px-2 py-0.5 text-[10px] transition-colors ${d==="form"?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-secondary"}`,children:"Form"}),e.jsx("button",{type:"button",onClick:()=>l("json"),className:`px-2 py-0.5 text-[10px] transition-colors ${d==="json"?"bg-accent/10 text-accent":"text-text-tertiary hover:text-text-secondary"}`,children:"JSON"})]})]})]}),e.jsx("p",{className:"text-[10px] text-text-tertiary mb-3",children:"This envelope is sent as the workflow input on each cron invocation."}),d==="form"&&b?e.jsx("div",{className:"space-y-3",children:b.map(({key:s,value:h,type:k})=>e.jsxs("div",{children:[e.jsx("label",{className:"block text-[11px] text-text-secondary mb-1 font-mono",children:s}),k==="boolean"?e.jsxs("select",{value:h,onChange:C=>J(s,C.target.value),className:"input text-xs w-full",children:[e.jsx("option",{value:"true",children:"true"}),e.jsx("option",{value:"false",children:"false"})]}):e.jsx("input",{type:k==="number"?"number":"text",value:h,onChange:C=>J(s,C.target.value),className:"input text-xs font-mono w-full"})]},s))}):e.jsx("textarea",{value:m,onChange:s=>{i(s.target.value),w("")},className:"input-json w-full",rows:10,spellCheck:!1}),x&&e.jsx("p",{className:"text-[10px] text-status-error mt-2",children:x}),j&&e.jsx("p",{className:"text-[10px] text-accent mt-1.5",children:"Envelope has been customized. Changes will be saved with the schedule."})]}),e.jsxs("div",{children:[e.jsx(I,{className:"mb-3",children:"Recent Executions"}),e.jsx(re,{columns:ce,data:(N==null?void 0:N.jobs)??[],keyFn:s=>s.workflow_id,onRowClick:s=>f(`/workflows/executions/${s.workflow_id}`),isLoading:g,emptyMessage:"No executions yet"})]})]})}function je(){const[t,a]=ne(),{data:f,isLoading:r}=G(),{data:n,isLoading:o}=Q(),{data:m}=X(),i=t.get("mode")||"now",x=t.get("type")??"",w=f??[],d=c.useMemo(()=>{const s=new Map;for(const h of n??[])s.set(h.workflow_type,h.tier??"durable");return s},[n]),l=c.useMemo(()=>{const s=w.filter(y=>y.invocable),h=new Set(w.map(y=>y.workflow_type)),C=(n??[]).filter(y=>y.active&&!h.has(y.workflow_type)).map(y=>({workflow_type:y.workflow_type,task_queue:y.task_queue??"",invocable:!0,description:null,default_role:"reviewer",roles:[],invocation_roles:[],consumes:[],envelope_schema:null,resolver_schema:null,cron_schedule:null,execute_as:null}));return[...s,...C]},[w,n]),p=l.find(s=>s.workflow_type===x),j=new Set((m??[]).filter(s=>s.active).map(s=>s.workflow_type)),v="/workflows/executions",b=c.useRef(null),[N,g]=c.useState(!0),E=`${x}:${i}`,M=c.useRef(E);c.useEffect(()=>{if(M.current!==E){g(!1);const s=setTimeout(()=>{M.current=E,g(!0)},120);return()=>clearTimeout(s)}},[E]),c.useEffect(()=>{l.length===1&&!t.get("type")&&a({type:l[0].workflow_type,mode:i},{replace:!0})},[l.length]);const O=s=>{const h={mode:s};x&&(h.type=x),a(h,{replace:!0})},J=s=>{a({type:s.workflow_type,mode:i},{replace:!0})};return r||o?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-40 bg-surface-sunken rounded"})]}):e.jsxs("div",{children:[e.jsx(Y,{title:"Invoke Workflow",docsHash:"#docs:dashboard.md:invoke-workflow",actions:e.jsx(ie,{mode:i,onChange:O})}),l.length===0?e.jsxs("div",{className:"py-16 text-center",children:[e.jsx("p",{className:"text-sm text-text-primary mb-1",children:"No invocable workflows"}),e.jsx("p",{className:"text-xs text-text-tertiary",children:"Mark workflows as invocable in the registry, or start the server with examples enabled."})]}):e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx(xe,{configs:l,selectedType:x,onSelect:J,tierMap:d,activeTypes:j}),e.jsx("div",{ref:b,className:`lg:col-span-2 transition-all duration-200 ease-out ${N?"opacity-100 translate-y-0":"opacity-0 translate-y-1"}`,children:x&&p?i==="now"?e.jsx(pe,{selected:p,executionsPath:v}):e.jsx(fe,{selected:p,activeTypes:j}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-accent/[0.06] flex items-center justify-center mb-4",children:i==="schedule"?e.jsx(W,{className:"w-5 h-5 text-accent/50"}):e.jsx(B,{className:"w-5 h-5 text-accent/50"})}),e.jsx("p",{className:"text-sm text-text-secondary mb-1",children:i==="schedule"?"Automate on a schedule":"Ready when you are"}),e.jsx("p",{className:"text-xs text-text-quaternary",children:i==="schedule"?"Choose a workflow to configure its schedule":"Choose a workflow from the list to get started"})]})})]})]})}function Je(){return e.jsx(je,{})}export{Je as DurableInvokePage,je as StartWorkflowPage};
|
|
6
|
-
//# sourceMappingURL=index-Ck2QdJXT.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as n,j as t}from"./vendor-query-B2UbickB.js";import{h}from"./workflows-Do-Eiv8f.js";import{D as g}from"./DataTable-D9yuBv0w.js";import{F as y,b as j}from"./FilterBar-Ck4K4rzu.js";import{R as q,a as u}from"./RowActions-Dg-Fsm5O.js";import{u as C}from"./useFilterParams-DZCAaBC7.js";import{P as R}from"./PageHeader-B_gV_jKk.js";import{T as b}from"./TaskQueuePill-Bc45J7X1.js";import{W as _}from"./WorkflowPill-Bg2-0Hkg.js";import{aa as v,ad as N,Y as I}from"./vendor-icons-B_Yla7iD.js";import{c as P}from"./vendor-react-CX88sFS5.js";import"./index-DZX-E_3q.js";import"./EmptyState-BcsfPq9T.js";function H(){const r=P(),{data:c,isLoading:m}=h(),{filters:s,setFilter:i}=C({filters:{search:"",queue:""}}),[a,p]=n.useState(s.search);n.useEffect(()=>{if(a===s.search)return;const e=setTimeout(()=>i("search",a),300);return()=>clearTimeout(e)},[a,i,s.search]);const o=c??[],d=n.useMemo(()=>[...new Set(o.map(e=>e.task_queue).filter(Boolean))].sort(),[o]),f=n.useMemo(()=>{let e=o;if(s.search){const l=s.search.toLowerCase();e=e.filter(w=>w.name.toLowerCase().includes(l))}return s.queue&&(e=e.filter(l=>l.task_queue===s.queue)),e},[o,s]),k=[{key:"name",label:"Workflow",render:e=>t.jsx(_,{type:e.name})},{key:"task_queue",label:"Queue",render:e=>t.jsx(b,{queue:e.task_queue}),className:"whitespace-nowrap"},{key:"registered",label:"Status",render:e=>e.registered?t.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-accent/10 text-accent",children:[t.jsx(v,{className:"w-3 h-3"}),"Certified"]}):t.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-surface-sunken text-text-tertiary",children:"Durable"}),className:"whitespace-nowrap"},{key:"actions",label:"",render:e=>t.jsx(q,{children:e.registered?t.jsx(u,{icon:N,title:"View config",onClick:()=>r(`/workflows/registry/${encodeURIComponent(e.name)}`)}):t.jsx(u,{icon:I,title:"Register workflow",onClick:()=>r(`/workflows/registry/new?workflow_type=${encodeURIComponent(e.name)}&task_queue=${encodeURIComponent(e.task_queue)}`)})}),className:"w-16 text-right"}],x=e=>{e.registered?r(`/workflows/registry/${encodeURIComponent(e.name)}`):r(`/workflows/registry/new?workflow_type=${encodeURIComponent(e.name)}&task_queue=${encodeURIComponent(e.task_queue)}`)};return t.jsxs("div",{children:[t.jsx(R,{title:"Workers",docsHash:"#docs:dashboard.md:task-queues"}),t.jsxs(y,{children:[t.jsx("input",{type:"text",placeholder:"Search workers...",value:a,onChange:e=>p(e.target.value),className:"input text-[11px] py-1 px-2 w-56"}),t.jsx(j,{label:"Queue",value:s.queue,onChange:e=>i("queue",e),options:d.map(e=>({value:e,label:e}))})]}),t.jsx(g,{columns:k,data:f,keyFn:e=>e.name,onRowClick:x,isLoading:m,emptyMessage:"No active workers"})]})}export{H as WorkersPage};
|
|
2
|
-
//# sourceMappingURL=index-DNmlrCAp.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as h,j as e}from"./vendor-query-B2UbickB.js";import{d as J,C as Ve,J as te,j as Ue,t as ze,g as Be,h as He,v as Ke,u as Ye}from"./index-DZX-E_3q.js";import{u as qe}from"./useCollapsedSections-BU5HULGs.js";import{a as Ge}from"./roles-Dtj0uabn.js";import{P as Qe}from"./PageHeader-B_gV_jKk.js";import{C as oe,i as Xe,a as Ze}from"./escalation-DilnDxw2.js";import{u as et}from"./workflows-Do-Eiv8f.js";import{g as tt}from"./useEventHooks-CPyvFlVR.js";import{U as de}from"./UserName-b4baWHM_.js";import{u as st,C as at}from"./CustomDurationPicker-BIQWzbv0.js";import{S as be}from"./StatusBadge-XQlNFwmH.js";import{R as ye}from"./RolePill-BOBytzrP.js";import{C as E}from"./CopyableId-D0SQ39nR.js";import{U as ve,a7 as rt,a5 as nt,a8 as Ne}from"./vendor-icons-B_Yla7iD.js";import{C as ae}from"./CollapsibleSection-DnoUFQVf.js";import{L as Ee,e as it,c as lt}from"./vendor-react-CX88sFS5.js";import"./users-XZ349b0r.js";import"./constants-BHkpVaqx.js";const we="lt_view_mode";function ct(t){const[a,i]=h.useState(()=>{try{const l=localStorage.getItem(we);if(l!==null)return l==="dev"}catch{}return t}),r=h.useCallback(()=>{i(l=>{const s=!l;try{localStorage.setItem(we,s?"dev":"user")}catch{}return s})},[]);return{isDevMode:a,toggleMode:r}}function ot(t){const{mode:a,activeView:i,onActiveViewChange:r,onClaim:l,claimPending:s,workflowType:m,json:o,onResolve:n,resolvePending:c,resolveError:x,requestTriage:p,triageNotes:u,currentRole:y,escalationTargets:d,onEscalate:j,escalatePending:g,escalateError:f,onRelease:S,releasePending:R,assignedTo:$,assignedUntil:A,onSubmitAttempt:M}=t,C=st(),[k,b]=h.useState("30"),[N,w]=h.useState(0),[I,L]=h.useState(""),[V,Q]=h.useState(""),_=k==="custom",W=h.useCallback(v=>w(v),[]);if(a==="terminal")return null;const O=()=>{const v=_?N:parseInt(k);!v||v<=0||l(v)},ee=()=>{if(L(""),p){const P={_lt:{needsTriage:!0}};u.trim()&&(P.notes=u.trim()),n(P);return}let v;try{v=JSON.parse(o)}catch{L("Invalid JSON");return}const X=v._form_schema,U=X==null?void 0:X.required;if(U!=null&&U.length){const P=U.filter(Y=>{const D=v[Y];return D==null||typeof D=="string"&&D.trim()===""});if(P.length>0){M==null||M();const Y=P.map(q=>q.replace(/[_-]/g," ")),D=Y.length<=2?Y.join(", "):`${Y.slice(0,2).join(", ")}...`;L(`Required: ${D}`);return}}n(v)},K=v=>`text-xs transition-colors ${v?"text-accent font-medium":"text-text-tertiary hover:text-accent"}`;return e.jsxs("div",{className:"sticky h-[80px] bg-surface/95 backdrop-blur-sm border-t border-surface-border -mx-10 px-10 pt-3 pb-5 z-10",style:{bottom:"calc(var(--feed-height, 0px) - 8px)"},"data-testid":"escalation-action-bar",children:[a==="available"&&e.jsxs("div",{"data-testid":"claim-bar",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[C.map(v=>e.jsx("button",{onClick:()=>{b(v.value),w(0)},className:K(!_&&k===v.value),children:v.label},v.value)),e.jsx("button",{onClick:()=>b("custom"),className:K(_),children:"Other"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-1"}),_&&e.jsx(at,{onChange:W,compact:!0,autoFocus:!0}),e.jsx("button",{onClick:O,disabled:s||_&&N<=0,className:"btn-primary text-xs",children:s?"Claiming...":"Claim"})]})]}),a==="claimed_by_other"&&e.jsxs("div",{className:"flex items-center gap-4","data-testid":"claimed-other-bar",children:[e.jsxs("p",{className:"text-sm text-text-secondary",children:["Claimed by ",e.jsx("span",{className:"font-medium text-text-primary",children:$?e.jsx(de,{userId:$}):"unknown"})]}),A&&e.jsx(oe,{until:A})]}),a==="claimed_by_me"&&e.jsxs("div",{"data-testid":"action-bar",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[e.jsx("button",{onClick:()=>r("resolve"),className:K(i==="resolve"),children:m?"Resolve":"Acknowledge"}),d.length>0&&e.jsx("button",{onClick:()=>r("escalate"),className:K(i==="escalate"),children:"Escalate"}),e.jsx("button",{onClick:()=>r("release"),className:`text-xs transition-colors ${i==="release"?"text-status-error font-medium":"text-text-tertiary hover:text-status-error"}`,children:"Release"})]}),i==="resolve"&&(m?e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex-1"}),I&&e.jsx("span",{className:"text-xs text-status-error",children:I}),x&&e.jsx("span",{className:"text-xs text-status-error",children:x.message}),e.jsx("button",{onClick:ee,disabled:c,className:"btn-primary text-xs",children:c?"Submitting...":p?"Send to Triage":"Submit"})]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:"Notification — acknowledge to resolve"}),e.jsx("div",{className:"flex-1"}),x&&e.jsx("span",{className:"text-xs text-status-error mr-3",children:x.message}),e.jsx("button",{onClick:()=>n({acknowledged:!0}),disabled:c,className:"btn-primary text-xs",children:c?"Acknowledging...":"Acknowledge"})]})),i==="escalate"&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-text-secondary",children:["From ",e.jsx("span",{className:"font-medium text-text-primary",children:y})," to"]}),e.jsxs("select",{value:V,onChange:v=>Q(v.target.value),className:"select text-xs","data-testid":"escalate-select",children:[e.jsx("option",{value:"",children:"Select role..."}),d.map(v=>e.jsx("option",{value:v,children:v},v))]}),e.jsx("div",{className:"flex-1"}),f&&e.jsx("span",{className:"text-xs text-status-error",children:f.message}),e.jsx("button",{onClick:()=>j(V),disabled:!V||g,className:"btn-primary text-xs",children:g?"Escalating...":"Escalate"})]}),i==="release"&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:"Release back to pool?"}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>r("resolve"),className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:S,disabled:R,className:"btn-primary text-xs bg-status-error hover:bg-status-error/80",children:R?"Releasing...":"Yes, Release"})]})]})]})}function dt({esc:t,claimedByMe:a,claimed:i,isTerminal:r,traceUrl:l,isDevMode:s,showDetails:m,onToggleDetails:o}){const n=Xe(t);return s?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n&&e.jsx(nt,{className:"w-5 h-5 text-text-tertiary shrink-0"}),e.jsxs("p",{className:"text-[1.5rem] leading-snug font-light text-text-secondary",children:[t.type,t.subtype?` / ${t.subtype}`:""]})]}),t.description&&e.jsx("p",{className:"text-sm leading-relaxed text-text-tertiary mb-4",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-end gap-x-6 gap-y-3 mt-4 mb-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Status"}),e.jsx("span",{className:"mb-1 inline-block",children:e.jsx(be,{status:t.status})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Role"}),e.jsx(ye,{role:t.role,size:"md"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Created"}),e.jsx("span",{className:"inline-flex items-center mb-1 text-xs text-text-secondary",children:e.jsx(J,{date:t.created_at})})]}),t.assigned_to&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Claimed by"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-text-primary",children:[e.jsx(ve,{className:"w-3 h-3 shrink-0 text-accent/75"}),e.jsx(de,{userId:t.assigned_to})]})]}),i&&!r&&t.assigned_until&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Time left"}),e.jsx("span",{className:"inline-flex items-center h-5",children:e.jsx(oe,{until:t.assigned_until})})]}),t.resolved_at&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:"Resolved"}),e.jsx("span",{className:"inline-flex items-center h-5 text-xs text-text-secondary",children:e.jsx(J,{date:t.resolved_at})})]})]})]}):e.jsxs("div",{className:"-mt-6 mb-2",children:[t.description&&e.jsx("p",{className:"text-2xl font-light text-text-primary leading-relaxed mb-5",children:t.description}),e.jsxs("div",{className:"bg-surface-sunken/50 rounded-md px-5 py-4 flex flex-wrap gap-x-8 gap-y-4 items-end",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Status"}),e.jsx(be,{status:t.status})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Assigned to Role"}),e.jsx(ye,{role:t.role,size:"md"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Created"}),e.jsx("span",{className:"text-xs text-text-secondary",children:e.jsx(J,{date:t.created_at})})]}),i&&t.assigned_to&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Claimed By"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-medium text-text-primary",children:[e.jsx(ve,{className:"w-3 h-3 text-accent/75"}),e.jsx(de,{userId:t.assigned_to})]})]}),i&&t.claimed_at&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Claimed"}),e.jsx("span",{className:"text-xs text-text-secondary",children:e.jsx(J,{date:t.claimed_at})})]}),i&&!r&&t.assigned_until&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Time Remaining"}),e.jsx("span",{className:"text-xs",children:e.jsx(oe,{until:t.assigned_until})})]}),t.resolved_at&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Completed"}),e.jsx("span",{className:"text-xs text-status-success",children:e.jsx(J,{date:t.resolved_at})})]}),e.jsx("div",{children:e.jsx("button",{onClick:o,className:"text-text-tertiary/50 hover:text-accent transition-colors",title:m?"Hide details":"Show details",children:e.jsx(rt,{className:`w-3.5 h-3.5 transition-opacity duration-200 ${m?"opacity-100 text-accent":"opacity-60"}`})})})]}),e.jsx(Ve,{open:m,children:e.jsxs("div",{className:"mt-px bg-surface-sunken/30 rounded-b-md px-5 py-4 flex flex-wrap gap-x-8 gap-y-4 border-t border-surface-border/30",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary",children:"Priority"}),e.jsxs("p",{className:"text-[12px] text-text-secondary mt-0.5",children:["P",t.priority]})]}),e.jsx(E,{label:"Escalation ID",value:t.id}),t.task_id&&e.jsx(E,{label:"Task ID",value:t.task_id,href:`/workflows/tasks/detail/${t.task_id}`}),e.jsx(E,{label:"Workflow Name",value:t.workflow_type,href:t.workflow_type?`/workflows/registry/${t.workflow_type}`:void 0}),e.jsx(E,{label:"Workflow ID",value:t.workflow_id,href:t.workflow_id?`/workflows/executions/${t.workflow_id}`:void 0}),e.jsx(E,{label:"Task Queue",value:t.task_queue}),t.origin_id&&t.origin_id!==t.workflow_id&&e.jsx(E,{label:"Origin",value:t.origin_id,href:`/processes/detail/${t.origin_id}`}),t.trace_id&&e.jsx(E,{label:"Trace",value:t.trace_id,href:l?l.replace("{traceId}",t.trace_id):void 0,external:!0})]})})]})}function B(t){return t.replace(/`([^`]+)`/g,'<code class="px-1 py-0.5 bg-surface-sunken rounded text-xs font-mono">$1</code>').replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="text-accent-primary hover:underline" target="_blank" rel="noopener noreferrer">$1</a>')}function ie({content:t,compact:a}){const i=[],r=/^```(\w*)\n([\s\S]*?)^```$/gm;let l=0,s;for(;(s=r.exec(t))!==null;)s.index>l&&i.push({type:"text",text:t.slice(l,s.index)}),i.push({type:"code",lang:s[1],code:s[2].replace(/\n$/,"")}),l=s.index+s[0].length;l<t.length&&i.push({type:"text",text:t.slice(l)});const m=a?{text:"text-xs",heading:"text-xs",list:"text-xs",code:"text-[11px]"}:{text:"text-sm",heading:"text-sm",list:"text-sm",code:"text-xs"},o=[];for(const n of i){if(n.type==="code"){const c=n.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");o.push(`<pre class="my-2 p-2.5 bg-surface-sunken rounded-md overflow-x-auto"><code class="${m.code} font-mono text-text-secondary leading-relaxed">${c}</code></pre>`);continue}o.push(...xt(n.text,m))}return e.jsx("div",{className:"prose-sm",dangerouslySetInnerHTML:{__html:o.join(`
|
|
2
|
-
`)}})}function xt(t,a){const i=t.split(`
|
|
3
|
-
`),r=[];let l=!1,s=!1,m=[];for(const o of i){const n=o.trim();if(n.startsWith("|")&&n.endsWith("|")){const c=n.slice(1,-1).split("|").map(x=>x.trim());if(c.every(x=>/^[-:]+$/.test(x)))continue;s||(s=!0,m=[]),m.push(c);continue}if(s){s=!1;const[c,...x]=m;r.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const p of c)r.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${B(p)}</th>`);r.push("</tr></thead><tbody>");for(const p of x){r.push("<tr>");for(const u of p)r.push(`<td class="py-1 px-2 border-b border-border/50">${B(u)}</td>`);r.push("</tr>")}r.push("</tbody></table></div>"),m=[]}if(!n){l&&(r.push("</ul>"),l=!1);continue}if(n.startsWith("### ")){l&&(r.push("</ul>"),l=!1),r.push(`<h4 class="${a.heading} font-semibold text-text-primary mt-3 mb-1">${B(n.slice(4))}</h4>`);continue}if(n.startsWith("## ")){l&&(r.push("</ul>"),l=!1),r.push(`<h3 class="${a.heading} font-semibold text-text-primary mt-3 mb-1">${B(n.slice(3))}</h3>`);continue}if(/^[-*_]{3,}$/.test(n)){l&&(r.push("</ul>"),l=!1),r.push('<hr class="border-border my-3" />');continue}if(/^[-*] /.test(n)){l||(r.push('<ul class="space-y-1 my-1">'),l=!0),r.push(`<li class="${a.list} text-text-secondary flex gap-2"><span class="text-text-tertiary shrink-0">-</span><span>${B(n.slice(2))}</span></li>`);continue}l&&(r.push("</ul>"),l=!1),r.push(`<p class="${a.text} text-text-secondary my-1">${B(n)}</p>`)}if(s&&m.length){const[o,...n]=m;r.push('<div class="overflow-x-auto my-2"><table class="text-xs w-full"><thead><tr>');for(const c of o)r.push(`<th class="text-left py-1 px-2 border-b border-border text-text-secondary font-medium">${B(c)}</th>`);r.push("</tr></thead><tbody>");for(const c of n){r.push("<tr>");for(const x of c)r.push(`<td class="py-1 px-2 border-b border-border/50">${B(x)}</td>`);r.push("</tr>")}r.push("</tbody></table></div>")}return l&&r.push("</ul>"),r}function le({children:t}){return e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1.5",children:t})}function ut({payload:t,isTerminal:a,resolverPayload:i,onRetryTriage:r,isRetrying:l}){const s=t.title,m=t.summary,o=t.diagnosis,n=t.tool_calls_made,c=t.result,x=i==null?void 0:i._lt,p=(x==null?void 0:x.triaged)===!0,u=x==null?void 0:x.triageWorkflowId,y=a&&p,[d,j]=h.useState(!1);return y?e.jsxs("div",{className:"rounded-md border border-status-success/30 bg-surface-raised",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-status-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 1a7 7 0 110 14A7 7 0 018 1zm3.36 4.65a.5.5 0 00-.72 0L7 9.29 5.36 7.65a.5.5 0 10-.72.7l2 2a.5.5 0 00.72 0l4-4a.5.5 0 000-.7z"})}),e.jsx("span",{className:"text-xs font-medium text-status-success",children:"Resolved by AI Triage"})]}),typeof n=="number"&&e.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-status-success/10 text-status-success",children:[n," tool calls used"]})]}),e.jsxs("div",{className:"px-4 py-4 space-y-4",children:[s&&e.jsx("p",{className:"text-sm font-medium text-text-primary",children:s}),o&&e.jsxs("div",{children:[e.jsx(le,{children:"Triage diagnosis"}),e.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:e.jsx(ie,{content:o})})]}),e.jsx("div",{className:"flex items-center gap-3",children:u&&e.jsx(Ee,{to:`/workflows/executions/${u}`,className:"text-[10px] text-accent hover:underline",children:"View triage execution"})})]})]}):e.jsxs("div",{className:"rounded-md border border-status-warning/30 bg-surface-raised",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-status-warning shrink-0",viewBox:"0 0 16 16",fill:"currentColor",children:e.jsx("path",{d:"M8 1a7 7 0 110 14A7 7 0 018 1zm0 3a.75.75 0 00-.75.75v3.5a.75.75 0 001.5 0v-3.5A.75.75 0 008 4zm0 7a.75.75 0 100-1.5.75.75 0 000 1.5z"})}),e.jsx("span",{className:"text-xs font-medium text-status-warning",children:"Tool Rounds Exhausted"})]}),typeof n=="number"&&e.jsxs("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-status-warning/10 text-status-warning",children:[n," tool calls used"]})]}),e.jsxs("div",{className:"px-4 py-4 space-y-4",children:[s&&e.jsx("p",{className:"text-sm font-medium text-text-primary",children:s}),m&&e.jsxs("div",{children:[e.jsx(le,{children:"What happened"}),e.jsx("div",{className:"text-xs text-text-secondary leading-relaxed",children:e.jsx(ie,{content:m})})]}),o&&e.jsxs("div",{children:[e.jsx(le,{children:"What went wrong"}),e.jsx("div",{className:"text-xs text-text-primary leading-relaxed",children:e.jsx(ie,{content:o})})]}),c!=null&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>j(!d),className:"flex items-center gap-1 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary hover:text-text-secondary transition-colors",children:[e.jsx("svg",{className:`w-3 h-3 transition-transform ${d?"rotate-90":""}`,viewBox:"0 0 12 12",fill:"currentColor",children:e.jsx("path",{d:"M4.5 2l4 4-4 4"})}),"Partial results"]}),d&&e.jsx("div",{className:"mt-2",children:e.jsx(te,{data:c,defaultMode:"tree"})})]}),r&&!a&&e.jsx("div",{className:"pt-2",children:e.jsxs("button",{onClick:r,disabled:l,className:"inline-flex items-center gap-2 px-4 py-2 text-xs font-medium bg-accent text-text-inverse rounded-md hover:bg-accent/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 14 14",fill:"currentColor",children:e.jsx("path",{d:"M7 1a6 6 0 100 12A6 6 0 007 1zm2.5 6.5l-3.5 2V5.5l3.5 2z"})}),l?"Sending to triage...":"Retry with AI Triage"]})})]})]})}function mt({triage:t,payload:a}){const i=t.confidence??0,r=i>=.8?"text-status-success":i>=.5?"text-status-pending":"text-status-error",l=pt(t.originalData,a);return e.jsxs("div",{className:"space-y-5",children:[t.diagnosis&&e.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:t.diagnosis}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-text-tertiary",children:[t.tool_calls_made!=null&&e.jsxs("span",{children:[t.tool_calls_made," tool call",t.tool_calls_made!==1?"s":""]}),t.tool_calls_made!=null&&e.jsx("span",{className:"text-text-quaternary",children:"·"}),e.jsxs("span",{className:`font-medium ${r}`,children:[Math.round(i*100),"% confidence"]})]}),t.actions_taken&&t.actions_taken.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.actions_taken.map((s,m)=>e.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-[11px]
|
|
4
|
-
text-text-secondary`,children:[e.jsx("svg",{className:"w-3 h-3 text-status-success shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),s]},m))}),t.recommendation&&e.jsx("p",{className:"text-[11px] text-text-tertiary italic",children:t.recommendation}),l.length>0&&e.jsx("div",{className:"space-y-4 pt-2",children:l.map(s=>e.jsx(ht,{diff:s},s.key))})]})}function pt(t,a){if(!t)return[];const i=[];for(const r of Object.keys(t)){if(r.startsWith("_"))continue;const l=t[r],s=a[r];s!==void 0&&JSON.stringify(l)!==JSON.stringify(s)&&i.push({key:r,label:r.replace(/[_-]/g," "),original:l,corrected:s})}return i}function ht({diff:t}){const a=ke(t.original),i=ke(t.corrected);return a!==null&&i!==null?e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal",children:"(original)"})]}),e.jsx("p",{className:"text-sm text-text-tertiary leading-relaxed line-through decoration-text-tertiary/30",children:a})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal text-status-success",children:"(corrected)"})]}),e.jsx("p",{className:"text-sm text-text-primary leading-relaxed",children:i})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal",children:"(original)"})]}),e.jsx("pre",{className:"text-xs text-text-tertiary font-mono whitespace-pre-wrap leading-relaxed",children:typeof t.original=="object"?JSON.stringify(t.original,null,2):String(t.original)})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:[t.label," ",e.jsx("span",{className:"normal-case font-normal text-status-success",children:"(corrected)"})]}),e.jsx("pre",{className:"text-xs text-text-primary font-mono whitespace-pre-wrap leading-relaxed",children:typeof t.corrected=="object"?JSON.stringify(t.corrected,null,2):String(t.corrected)})]})]})}function ke(t){return t==null?"null":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):null}function _e({src:t,escalation:a,schema:i,onResolve:r,onEscalate:l,submitAttempted:s}){const m=h.useRef(null),o=h.useRef("");h.useEffect(()=>{try{const c=new URL(t);o.current=c.origin}catch{o.current=""}},[t]);const n=h.useCallback(()=>{const c=m.current;if(!(c!=null&&c.contentWindow)||!o.current)return;const p={type:"lt:init",escalation:{id:a.id,type:a.type,subtype:a.subtype,description:a.description,status:a.status,priority:a.priority,role:a.role,workflow_type:a.workflow_type},schema:i};c.contentWindow.postMessage(p,o.current)},[a,i]);return h.useEffect(()=>{const c=x=>{if(x.origin!==o.current)return;const p=x.data;if(!(!p||typeof p!="object"||typeof p.type!="string"))switch(p.type){case"lt:ready":n();break;case"lt:submit":p.payload&&typeof p.payload=="object"&&r(p.payload);break;case"lt:escalate":typeof p.target=="string"&&p.target&&l(p.target);break;case"lt:resize":{const u=m.current;u&&typeof p.height=="number"&&p.height>0&&(u.style.height=`${Math.min(p.height,2e3)}px`);break}}};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},[n,r,l]),h.useEffect(()=>{if(!s)return;const c=m.current;c!=null&&c.contentWindow&&o.current&&c.contentWindow.postMessage({type:"lt:validate"},o.current)},[s]),e.jsx("div",{className:"rounded-md border border-surface-border overflow-hidden bg-white",children:e.jsx("iframe",{ref:m,src:t,sandbox:"allow-scripts allow-same-origin allow-forms",className:"w-full border-0",style:{minHeight:"400px"},title:"HITL Viewport",onLoad:n})})}function ft({fieldKey:t,value:a,onChange:i,schema:r}){const l=h.useRef(null),s=(r==null?void 0:r.accept)??void 0,m=t.replace(/[_-]/g," "),o=r==null?void 0:r.description,n=h.useCallback(x=>{var y;const p=(y=x.target.files)==null?void 0:y[0];if(!p)return;const u=new FileReader;u.onload=()=>{typeof u.result=="string"&&i(u.result)},u.readAsDataURL(p)},[i]),c=a.startsWith("data:");return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:m}),o&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:o}),e.jsxs("div",{className:"mt-1",children:[e.jsx("input",{ref:l,type:"file",accept:s,onChange:n,className:"hidden"}),e.jsx("button",{type:"button",onClick:()=>{var x;return(x=l.current)==null?void 0:x.click()},className:"btn-secondary text-xs px-3 py-1.5",children:c?"Replace file":"Choose file"}),c&&e.jsx("span",{className:"ml-2 text-xs text-status-success",children:"File attached"})]})]})}function gt({fieldKey:t,value:a,onChange:i,schema:r}){const l=t.replace(/[_-]/g," "),s=r==null?void 0:r.description,m=(r==null?void 0:r["x-lt-language"])??"",o=h.useCallback(n=>{if(n.key==="Tab"){n.preventDefault();const c=n.currentTarget,x=c.selectionStart,p=c.selectionEnd,u=a.substring(0,x)+" "+a.substring(p);i(u),requestAnimationFrame(()=>{c.selectionStart=c.selectionEnd=x+2})}},[a,i]);return e.jsxs("div",{children:[e.jsxs("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:[l,m&&e.jsx("span",{className:"ml-2 text-text-tertiary/60 normal-case font-normal",children:m})]}),s&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:s}),e.jsx("textarea",{value:a,onChange:n=>i(n.target.value),onKeyDown:o,className:"input w-full mt-1 font-mono text-xs leading-relaxed",rows:10,spellCheck:!1})]})}function jt({fieldKey:t,value:a,onChange:i,schema:r}){const l=h.useRef(null),[s,m]=h.useState(!1),o=t.replace(/[_-]/g," "),n=r==null?void 0:r.description;h.useEffect(()=>{const d=l.current;if(!d)return;const j=d.getContext("2d");if(j&&(j.lineWidth=2,j.lineCap="round",j.strokeStyle="#1E1535",a&&a.startsWith("data:"))){const g=new Image;g.onload=()=>j.drawImage(g,0,0),g.src=a}},[]);const c=h.useCallback(d=>{const g=l.current.getBoundingClientRect();return"touches"in d?{x:d.touches[0].clientX-g.left,y:d.touches[0].clientY-g.top}:{x:d.clientX-g.left,y:d.clientY-g.top}},[]),x=h.useCallback(d=>{var f;m(!0);const j=(f=l.current)==null?void 0:f.getContext("2d");if(!j)return;const g=c(d);j.beginPath(),j.moveTo(g.x,g.y)},[c]),p=h.useCallback(d=>{var f;if(!s)return;const j=(f=l.current)==null?void 0:f.getContext("2d");if(!j)return;const g=c(d);j.lineTo(g.x,g.y),j.stroke()},[s,c]),u=h.useCallback(()=>{m(!1);const d=l.current;d&&i(d.toDataURL("image/png"))},[i]),y=h.useCallback(()=>{const d=l.current;if(!d)return;const j=d.getContext("2d");j&&(j.clearRect(0,0,d.width,d.height),i(""))},[i]);return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:o}),n&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:n}),e.jsx("div",{className:"mt-1 border border-surface-border rounded-md overflow-hidden bg-white",children:e.jsx("canvas",{ref:l,width:400,height:150,className:"w-full cursor-crosshair touch-none",onMouseDown:x,onMouseMove:p,onMouseUp:u,onMouseLeave:u,onTouchStart:x,onTouchMove:p,onTouchEnd:u})}),e.jsx("button",{type:"button",onClick:y,className:"mt-1 text-[10px] text-text-tertiary hover:text-accent transition-colors",children:"Clear"})]})}function bt({fieldKey:t,value:a,onChange:i,schema:r}){const l=t.replace(/[_-]/g," "),s=r==null?void 0:r.description;return e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:l}),s&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:s}),e.jsx("textarea",{value:a,onChange:m=>i(m.target.value),className:"input w-full mt-1 text-sm leading-relaxed",rows:8,placeholder:"Supports plain text. Markdown formatting is preserved."})]})}const Ce={"file-upload":ft,"code-editor":gt,signature:jt,"rich-text":bt};function Se({value:t,onChange:a,disabled:i,submitAttempted:r}){const[l,s]=h.useState({}),[m,o]=h.useState({}),[n,c]=h.useState(null),[x,p]=h.useState(!1),[u,y]=h.useState(new Set);h.useEffect(()=>{try{const b=JSON.parse(t);if(typeof b=="object"&&b!==null&&!Array.isArray(b)){const N={},w={};for(const[I,L]of Object.entries(b))I.startsWith("_")?w[I]=L:N[I]=L;s(N),o(w),c(w._form_schema&&typeof w._form_schema=="object"?w._form_schema:null),p(!1)}}catch{p(!0)}},[t]);const d=h.useCallback(b=>{s(b),a(JSON.stringify({...b,...m},null,2))},[m,a]),j=h.useCallback((b,N)=>{d({...l,[b]:N})},[l,d]),g=h.useCallback(b=>{y(N=>{if(N.has(b))return N;const w=new Set(N);return w.add(b),w})},[]);if(x)return e.jsx("p",{className:"text-xs text-status-error",children:"Unable to parse resolver data as form. Use the JSON editor below."});const f=Object.entries(l);if(f.length===0)return e.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No resolver fields defined."});const S=n==null?void 0:n["x-lt-order"],R=S?[...f].sort((b,N)=>{const w=S.indexOf(b[0]),I=S.indexOf(N[0]);return(w===-1?1/0:w)-(I===-1?1/0:I)}):f,$=new Set((n==null?void 0:n.required)??[]),A=n==null?void 0:n["x-lt-layout"],M=n==null?void 0:n.title,C=n==null?void 0:n.description,k=R.map(([b,N])=>{var W;const w=(W=n==null?void 0:n.properties)==null?void 0:W[b],I=(w==null?void 0:w.readOnly)===!0,L=(w==null?void 0:w["x-lt-span"])??1,V=$.has(b),Q=u.has(b)||!!r;let _;if(V&&Q&&(N==null||typeof N=="string"&&N.trim()==="")&&(_="Required"),Q&&typeof N=="string"&&N.trim()!==""&&w){const O=w.format;O==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(N)&&(_="Enter a valid email address"),O==="uri"&&!/^https?:\/\/.+/.test(N)&&(_="Enter a valid URL")}return e.jsx("div",{className:A==="two-column"&&L>=2?"col-span-2":"",children:e.jsx(Re,{fieldKey:b,value:N,onChange:O=>j(b,O),onBlur:()=>g(b),schema:n,isRequired:V,isReadOnly:I,error:_})},b)});return e.jsxs("div",{className:`pb-8 ${i?"opacity-60 pointer-events-none":""}`,children:[M&&e.jsx("h3",{className:"text-lg font-light text-text-primary mb-1",children:M}),C&&e.jsx("p",{className:"text-sm text-text-secondary leading-relaxed mb-6",children:C}),A==="two-column"?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-14 gap-y-6",children:k}):e.jsx("div",{className:"space-y-6",children:k})]})}function Re({fieldKey:t,value:a,onChange:i,onBlur:r,schema:l,isRequired:s,isReadOnly:m,error:o}){var p;const n=t.replace(/[_-]/g," "),c=(p=l==null?void 0:l.properties)==null?void 0:p[t];if(m){const u=a===null?"null":typeof a=="object"?JSON.stringify(a,null,2):String(a);return e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),e.jsx("p",{className:"text-sm text-text-secondary mt-0.5 whitespace-pre-wrap",children:u})]})}const x=c==null?void 0:c["x-lt-widget"];if(x&&x in Ce&&typeof a=="string"){const u=Ce[x];return e.jsx(u,{fieldKey:t,value:a,onChange:y=>i(y),schema:c})}if(typeof a=="boolean")return e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:a,onChange:u=>{i(u.target.checked),r==null||r()},className:"w-3.5 h-3.5 rounded accent-accent"}),e.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[n,s&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})]}),e.jsx(G,{error:o})]});if(typeof a=="number")return e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),e.jsx("input",{type:"number",value:a,onChange:u=>i(parseFloat(u.target.value)||0),onBlur:r,step:"any",className:Z(!!o)}),e.jsx(G,{error:o})]});if(typeof a=="string"){const u=(c==null?void 0:c.format)==="password",y=c==null?void 0:c.enum,d=c==null?void 0:c.description;if(y!=null&&y.length)return e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),d&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:d}),e.jsx("select",{value:a,onChange:f=>i(f.target.value),onBlur:r,className:Z(!!o),children:y.map(f=>e.jsx("option",{value:f,children:f},f))}),e.jsx(G,{error:o})]});if(u)return e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),d&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:d}),e.jsx("input",{type:"password",value:a,onChange:f=>i(f.target.value),onBlur:r,className:Z(!!o),autoComplete:"off"}),e.jsx(G,{error:o})]});const j=c==null?void 0:c.format,g={date:"date","date-time":"datetime-local",email:"email",uri:"url"};return j&&j in g?e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),d&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:d}),e.jsx("input",{type:g[j],value:a,onChange:f=>i(f.target.value),onBlur:r,className:Z(!!o)}),e.jsx(G,{error:o})]}):j==="textarea"||a.length>80?e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),d&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:d}),e.jsx("textarea",{value:a,onChange:f=>i(f.target.value),onBlur:r,className:`${Z(!!o)} leading-relaxed`,rows:Math.min(6,Math.max(3,Math.ceil(a.length/60)))}),e.jsx(G,{error:o})]}):e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),d&&e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:d}),e.jsx("input",{type:"text",value:a,onChange:f=>i(f.target.value),onBlur:r,className:Z(!!o)}),e.jsx(G,{error:o})]})}if(a===null)return e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),e.jsx("p",{className:"text-xs text-text-tertiary italic mt-1",children:"null"})]});if(Array.isArray(a))return e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:a.map((u,y)=>e.jsx("span",{className:"px-2 py-0.5 text-[11px] font-mono bg-surface-sunken rounded text-text-secondary",children:String(u)},y))})]});if(typeof a=="object"){const u=Object.entries(a);return e.jsxs("div",{children:[e.jsx(F,{isRequired:s,children:n}),e.jsx("div",{className:"ml-4 mt-2 pl-4 border-l border-accent-faint space-y-3",children:u.map(([y,d])=>e.jsx(Re,{fieldKey:y,value:d,onChange:j=>i({...a,[y]:j})},y))})]})}return null}function F({children:t,isRequired:a}){return e.jsxs("label",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-secondary",children:[t,a&&e.jsx("span",{className:"text-status-error ml-0.5",children:"*"})]})}function G({error:t}){return t?e.jsx("p",{className:"text-[10px] text-status-error mt-1 animate-[field-error-in_0.3s_ease-out]",children:t}):null}function Z(t){return t?"input text-sm w-full mt-1 border-status-error/50 focus:border-status-error animate-[field-shake_0.4s_ease-in-out]":"input text-sm w-full mt-1"}function Te({json:t,onJsonChange:a,requestTriage:i,onRequestTriageChange:r,triageNotes:l,onTriageNotesChange:s,isDevMode:m=!0,disabled:o=!1,submitAttempted:n=!1,showTriage:c=!1}){const[x,p]=h.useState("form"),{visibleJson:u,hiddenFields:y}=h.useMemo(()=>{try{const g=JSON.parse(t);if(typeof g=="object"&&g!==null&&!Array.isArray(g)){const f={},S={};for(const[R,$]of Object.entries(g))R.startsWith("_")?f[R]=$:S[R]=$;return{visibleJson:JSON.stringify(S,null,2),hiddenFields:f}}}catch{}return{visibleJson:t,hiddenFields:{}}},[t]),d=h.useCallback(g=>{try{const f=JSON.parse(g);a(JSON.stringify({...f,...y},null,2))}catch{a(g)}},[y,a]),j=Object.keys(y).length>0;return e.jsxs(e.Fragment,{children:[(c||m)&&e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c?i?e.jsxs("button",{onClick:()=>r(!1),className:"group flex items-center gap-2 text-left","data-testid":"triage-cancel",children:[e.jsx("span",{className:"flex items-center justify-center w-5 h-5 rounded-full bg-accent/10 text-accent shrink-0",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("span",{className:"text-xs text-text-secondary group-hover:text-text-primary transition-colors",children:["AI Triage active."," ",e.jsx("span",{className:"text-accent group-hover:underline",children:"Cancel"})]})]}):e.jsxs("button",{onClick:()=>r(!0),className:"group flex items-center gap-2.5 text-left my-4","data-testid":"triage-callout",children:[e.jsx("span",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-accent/10 text-accent shrink-0 animate-[triage-glow_6s_ease-in-out_infinite]",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.674M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})}),e.jsxs("span",{className:"text-[13px] text-text-secondary group-hover:text-text-primary transition-colors",children:["This form doesn't capture the issue?"," ",e.jsx("span",{className:"text-accent group-hover:underline",children:"Request AI Triage"})]})]}):e.jsx("span",{}),m&&!i&&e.jsx("button",{onClick:()=>p(x==="form"?"json":"form"),className:"text-[10px] text-text-tertiary hover:text-accent transition-colors",children:x==="form"?"Raw JSON":"Form"})]}),e.jsxs("div",{className:"relative min-h-[200px]",children:[e.jsx("div",{className:i?"pointer-events-none select-none":"",children:x==="form"?e.jsx(Se,{value:t,onChange:a,disabled:o,submitAttempted:n}):e.jsxs("div",{children:[j&&e.jsx("p",{className:"text-[10px] text-text-quaternary mb-2 italic",children:"Form schema hidden. Edit the resolver values below — they will be merged with the schema on submit."}),e.jsx("textarea",{value:u,onChange:g=>d(g.target.value),className:"input-json w-full",rows:Math.max(8,u.split(`
|
|
5
|
-
`).length+2),spellCheck:!1,"data-testid":"resolve-json"})]})}),i&&e.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col bg-surface/90 backdrop-blur-[2px] rounded-md border border-accent/20 p-5","data-testid":"triage-overlay",children:[e.jsx("p",{className:"text-xs text-text-secondary mb-3 leading-relaxed",children:"The resolution form will not be submitted. Describe the issue so AI triage can diagnose and fix it using available tools. The corrected result will come back as a new escalation for your review."}),e.jsx("textarea",{value:l,onChange:g=>s(g.target.value),placeholder:"e.g. Content is in Spanish — needs translation to English before review...",className:"input text-xs w-full flex-1 min-h-[80px] resize-none",autoFocus:!0,"data-testid":"triage-notes"})]})]})]})}function H({children:t}){return e.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-widest text-text-tertiary",children:t})}function re({children:t}){return e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5 font-mono",children:t})}function yt({esc:t}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-accent/60 mb-3",children:"Classification"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-x-8 gap-y-4",children:[e.jsxs("div",{children:[e.jsx(H,{children:"Type"}),e.jsx(re,{children:t.type})]}),t.subtype&&e.jsxs("div",{children:[e.jsx(H,{children:"Subtype"}),e.jsx(re,{children:t.subtype})]}),e.jsxs("div",{children:[e.jsx(H,{children:"Priority"}),e.jsxs(re,{children:["P",t.priority]})]}),e.jsxs("div",{children:[e.jsx(H,{children:"Status"}),e.jsx(re,{children:t.status})]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-accent/60 mb-3",children:"References"}),e.jsxs("div",{className:"flex flex-wrap gap-x-8 gap-y-4",children:[e.jsx(E,{label:"Escalation ID",value:t.id}),t.task_id&&e.jsx(E,{label:"Task ID",value:t.task_id,href:`/workflows/tasks/detail/${t.task_id}`}),t.workflow_type&&e.jsx(E,{label:"Workflow Name",value:t.workflow_type,href:`/workflows/registry/${t.workflow_type}`}),t.workflow_id&&e.jsx(E,{label:"Workflow ID",value:t.workflow_id,href:`/workflows/executions/${t.workflow_id}`}),t.task_queue&&e.jsx(E,{label:"Task Queue",value:t.task_queue}),t.origin_id&&t.origin_id!==t.workflow_id&&e.jsx(E,{label:"Origin ID",value:t.origin_id}),t.parent_id&&e.jsx(E,{label:"Parent ID",value:t.parent_id}),t.trace_id&&e.jsx(E,{label:"Trace ID",value:t.trace_id}),t.span_id&&e.jsx(E,{label:"Span ID",value:t.span_id})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-accent/60 mb-3",children:"Timeline"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-x-8 gap-y-4",children:[e.jsxs("div",{children:[e.jsx(H,{children:"Created"}),e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5",children:e.jsx(J,{date:t.created_at})})]}),t.claimed_at&&e.jsxs("div",{children:[e.jsx(H,{children:"Claimed"}),e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5",children:e.jsx(J,{date:t.claimed_at})})]}),t.resolved_at&&e.jsxs("div",{children:[e.jsx(H,{children:"Resolved"}),e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5",children:e.jsx(J,{date:t.resolved_at})})]}),e.jsxs("div",{children:[e.jsx(H,{children:"Updated"}),e.jsx("p",{className:"text-[12px] text-text-secondary mt-0.5",children:e.jsx(J,{date:t.updated_at})})]})]})]}),t.metadata&&Object.keys(t.metadata).length>0&&e.jsx("div",{children:e.jsx(te,{data:t.metadata,label:"Metadata"})})]})}function vt({isRoundsExhausted:t,payloadObj:a,isTerminal:i,resolverPayload:r,onRetryTriage:l,isRetrying:s}){return e.jsxs(e.Fragment,{children:[t&&a&&e.jsx("div",{className:"mt-8",children:e.jsx(ut,{payload:a,isTerminal:i,resolverPayload:r,onRetryTriage:l,isRetrying:s})}),(a==null?void 0:a.category)==="missing_credential"&&e.jsxs("div",{className:"mt-8 bg-status-warning/10 border border-status-warning/30 rounded-md px-5 py-4 flex items-start gap-3",children:[e.jsx(Ne,{size:20,className:"text-status-warning mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text-primary mb-1",children:"Missing Credential"}),e.jsxs("p",{className:"text-xs text-text-secondary mb-3",children:["This workflow requires a ",e.jsx("span",{className:"font-medium capitalize",children:String(a.provider)})," credential to continue. Register one and then resolve this escalation to retry."]}),e.jsxs(Ee,{to:"/credentials",className:"btn-primary text-xs inline-flex items-center gap-1.5",children:[e.jsx(Ne,{size:12}),"Go to Credentials"]})]})]})]})}function Nt({isCollapsed:t,toggleSection:a,esc:i,escalationPayload:r,resolverPayload:l,triageData:s,payloadObj:m,isTerminal:o,claimedByMe:n,activeView:c,metadataFormSchema:x,json:p,onJsonChange:u,requestTriage:y,onRequestTriageChange:d,triageNotes:j,onTriageNotesChange:g,isDevMode:f,onResolve:S,onEscalate:R,submitAttempted:$,isCertified:A,hasAI:M}){return e.jsxs("div",{className:"mt-8 space-y-6",children:[f&&e.jsx(ae,{title:"Escalation Record",sectionKey:"record",isCollapsed:t("record"),onToggle:a,contentClassName:"mt-4 ml-9",children:e.jsx(yt,{esc:i})}),f&&e.jsx(ae,{title:"Input / Output",sectionKey:"context",isCollapsed:t("context"),onToggle:a,contentClassName:"mt-4 ml-9",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[!!i.envelope&&e.jsx("div",{children:e.jsx(te,{data:i.envelope,label:"Input Envelope"})}),r!=null&&e.jsx("div",{children:e.jsx(te,{data:r,label:"Escalation Context"})})]}),l!=null&&e.jsx("div",{className:"max-w-xl",children:e.jsx(te,{data:l,label:"Resolver Payload"})})]})}),f&&s&&m&&e.jsx(ae,{title:"AI Triage",sectionKey:"triage",isCollapsed:t("triage"),onToggle:a,contentClassName:"mt-4 ml-9",children:e.jsx(mt,{triage:s,payload:m})}),!f&&o&&l!=null&&(()=>{const C=typeof l=="object"&&l!==null?l:{},k=x,b=k?{...C,_form_schema:k}:C;return e.jsx("div",{className:"pt-6",children:e.jsx(Se,{value:JSON.stringify(b,null,2),onChange:()=>{},disabled:!0})})})(),!o&&(n||!f)&&c==="resolve"&&!!(i.workflow_type||x)&&(()=>{const C=x,k=C==null?void 0:C["x-lt-viewport"],b=(k==null?void 0:k.type)==="iframe"&&!!k.src&&S&&R;return f?e.jsx(ae,{title:"Submit Your Resolution",sectionKey:"resolver",isCollapsed:t("resolver"),onToggle:a,contentClassName:"mt-4 ml-9",children:b?e.jsx(_e,{src:k.src,escalation:i,schema:C,onResolve:S,onEscalate:R}):e.jsx(Te,{json:p,onJsonChange:u,requestTriage:y,onRequestTriageChange:d,triageNotes:j,onTriageNotesChange:g,isDevMode:f,submitAttempted:$,showTriage:!!A&&!!M})}):e.jsx("div",{className:"pt-6",children:b?e.jsx(_e,{src:k.src,escalation:i,schema:C,onResolve:S,onEscalate:R}):e.jsx(Te,{json:p,onJsonChange:u,requestTriage:y,onRequestTriageChange:d,triageNotes:j,onTriageNotesChange:g,isDevMode:f,disabled:!n,submitAttempted:$,showTriage:!!A&&!!M})})})()]})}function ce(t){if(!t)return null;try{return JSON.parse(t)}catch{return t}}function wt(t){if(!t)return!1;try{const a=JSON.parse(t);return!!(a&&typeof a=="object"&&a._triage)}catch{return!1}}function Vt(){var pe,he,fe,ge;const{id:t}=it(),{user:a,hasRoleType:i,hasRole:r}=Ue(),l=lt(),{data:s,isLoading:m}=ze(t);tt(t);const o=Be(),n=He(),c=Ke(),{data:x}=Ge((s==null?void 0:s.role)??""),{data:p}=et(),{data:u}=Ye(),y=i("admin")||i("superadmin")||r("engineer"),{isDevMode:d,toggleMode:j}=ct(!1),g=p==null?void 0:p.find(T=>T.workflow_type===(s==null?void 0:s.workflow_type)),f=((pe=u==null?void 0:u.telemetry)==null?void 0:pe.traceUrl)??null,[S,R]=h.useState("resolve"),[$,A]=h.useState("{}"),{isCollapsed:M,toggle:C,collapse:k,expand:b}=qe("escalation-detail"),[N,w]=h.useState(!1),[I,L]=h.useState(""),[V,Q]=h.useState(!1),_=(g==null?void 0:g.resolver_schema)??null,W=((he=s==null?void 0:s.metadata)==null?void 0:he.form_schema)??null,O=W??_,ee=h.useRef(!1);h.useEffect(()=>{if(ee.current)return;const T=W??(_!=null&&_.properties?_:null);if(T!=null&&T.properties){ee.current=!0;const je={_form_schema:T};for(const[Oe,Fe]of Object.entries(T.properties)){const Je=Fe;je[Oe]=Je.default??""}A(JSON.stringify(je,null,2))}else O&&(ee.current=!0,A(JSON.stringify(O,null,2)))},[O,W,_]);const K=wt(s==null?void 0:s.escalation_payload),v=(s==null?void 0:s.subtype)==="rounds_exhausted",X=(s==null?void 0:s.subtype)==="wait_for_human";if(h.useEffect(()=>{(K||v)&&k("context"),X&&W&&(k("context"),b("resolver"))},[K,v,X,W,k,b]),m)return e.jsxs("div",{className:"animate-pulse space-y-8",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-64"}),e.jsx("div",{className:"h-32 bg-surface-sunken rounded w-full"})]});if(!s)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Escalation not found."});const U=Ze(s),P=U&&s.assigned_to===(a==null?void 0:a.userId),Y=U&&!P,D=s.status==="resolved"||s.status==="cancelled",q=ce(s.escalation_payload),xe=ce(s.resolver_payload),ne=ce(s.envelope),Ie=!!((fe=ne==null?void 0:ne.metadata)!=null&&fe.certified),$e=!!((ge=u==null?void 0:u.ai)!=null&&ge.enabled),z=typeof q=="object"&&q!==null&&!Array.isArray(q)?q:null,Ae=z==null?void 0:z._triage,Me=D?"terminal":P?"claimed_by_me":Y?"claimed_by_other":"available",We=T=>{o.mutate({id:s.id,durationMinutes:T}),k("context"),k("triage"),b("resolver")},se=()=>l(-1),ue=async T=>{await n.mutateAsync({id:s.id,resolverPayload:T}),se()},me=async T=>{T&&(await c.mutateAsync({id:s.id,targetRole:T}),se())},Pe=async()=>{P||await o.mutateAsync({id:s.id,durationMinutes:30});const T=(z==null?void 0:z.diagnosis)||s.description||"";await n.mutateAsync({id:s.id,resolverPayload:{_lt:{needsTriage:!0},notes:T}}),se()},De=async()=>{await o.mutateAsync({id:s.id,durationMinutes:0}),se()},Le=y?e.jsx("button",{onClick:j,className:"text-text-tertiary hover:text-accent transition-colors",title:d?"Switch to user view":"Switch to developer view",children:d?e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5"})}):e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}):void 0;return e.jsxs("div",{className:"min-h-[calc(100vh-9rem)] flex flex-col",children:[e.jsx(Qe,{title:"Escalation",actions:Le}),e.jsx(dt,{esc:s,claimedByMe:P,claimed:U,isTerminal:D,traceUrl:f,isDevMode:d,showDetails:!M("details"),onToggleDetails:()=>C("details")}),e.jsx(vt,{isRoundsExhausted:v,payloadObj:z,isTerminal:D,resolverPayload:xe,onRetryTriage:Pe,isRetrying:o.isPending||n.isPending}),e.jsx(Nt,{isCollapsed:M,toggleSection:C,esc:s,escalationPayload:q,resolverPayload:xe,triageData:Ae,payloadObj:z,isTerminal:D,claimedByMe:P,activeView:S,metadataFormSchema:W,json:$,onJsonChange:A,requestTriage:N,onRequestTriageChange:w,triageNotes:I,onTriageNotesChange:L,isDevMode:d,onResolve:ue,onEscalate:me,submitAttempted:V,isCertified:Ie,hasAI:$e}),e.jsx("div",{className:"flex-1"}),e.jsx(ot,{mode:Me,activeView:S,onActiveViewChange:R,onClaim:We,claimPending:o.isPending,workflowType:s.workflow_type,json:$,onResolve:ue,resolvePending:n.isPending,resolveError:n.error,requestTriage:N,triageNotes:I,currentRole:s.role,escalationTargets:(x==null?void 0:x.targets)??[],onEscalate:me,escalatePending:c.isPending,escalateError:c.error,onRelease:De,releasePending:o.isPending,assignedTo:s.assigned_to,assignedUntil:s.assigned_until,onSubmitAttempt:()=>Q(!0)})]})}export{Vt as EscalationDetailPage};
|
|
6
|
-
//# sourceMappingURL=index-DPW_i3fH.js.map
|