@hotmeshio/long-tail 0.4.3 → 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/api/settings.js +4 -0
- package/build/lib/db/index.d.ts +1 -7
- package/build/lib/db/schemas/008_capability_reaction.sql +12 -0
- package/build/lib/db/schemas/009_file_topic_category.sql +10 -0
- package/build/lib/events/index.d.ts +9 -0
- package/build/lib/events/index.js +18 -0
- package/build/lib/events/nats.d.ts +15 -1
- package/build/lib/events/nats.js +46 -2
- package/build/lib/events/publish.d.ts +10 -0
- package/build/lib/events/publish.js +28 -0
- package/build/modules/config.d.ts +1 -7
- package/build/services/agent/index.js +14 -0
- package/build/services/agent/subscription-sql.d.ts +3 -3
- package/build/services/agent/subscription-sql.js +7 -5
- package/build/services/agent/subscriptions.d.ts +3 -1
- package/build/services/agent/subscriptions.js +6 -0
- package/build/services/agent/trigger-registry.d.ts +2 -0
- package/build/services/agent/trigger-registry.js +55 -8
- package/build/services/topics/system-topics.js +29 -0
- package/build/services/yaml-workflow/deployer.d.ts +1 -1
- package/build/services/yaml-workflow/deployer.js +2 -2
- package/build/services/yaml-workflow/invoke.d.ts +2 -0
- package/build/services/yaml-workflow/invoke.js +5 -1
- package/build/start/adapters.js +11 -9
- package/build/start/config.js +4 -0
- package/build/start/workers.js +15 -3
- package/build/system/index.js +16 -0
- package/build/system/mcp-servers/file-storage.js +18 -0
- package/build/system/workflows/capability-invoke/activities.d.ts +12 -0
- package/build/system/workflows/capability-invoke/activities.js +14 -0
- package/build/system/workflows/capability-invoke/index.d.ts +14 -0
- package/build/system/workflows/capability-invoke/index.js +74 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/events.d.ts +13 -1
- package/build/types/startup.d.ts +7 -0
- package/dashboard/dist/assets/AdminDashboard-ntLz5Pro.js +2 -0
- package/dashboard/dist/assets/{AdminDashboard-Dr5wTIZT.js.map → AdminDashboard-ntLz5Pro.js.map} +1 -1
- package/dashboard/dist/assets/AgentConfigPage-D27vWOI6.js +16 -0
- package/dashboard/dist/assets/AgentConfigPage-D27vWOI6.js.map +1 -0
- package/dashboard/dist/assets/AgentDetailPage-Cm2KFR4O.js +4 -0
- package/dashboard/dist/assets/AgentDetailPage-Cm2KFR4O.js.map +1 -0
- package/dashboard/dist/assets/AgentsPage-_ptA-0YO.js +2 -0
- package/dashboard/dist/assets/AgentsPage-_ptA-0YO.js.map +1 -0
- package/dashboard/dist/assets/AvailableEscalationsPage-bdPqEzbx.js +2 -0
- package/dashboard/dist/assets/{AvailableEscalationsPage-UzjXcO3W.js.map → AvailableEscalationsPage-bdPqEzbx.js.map} +1 -1
- package/dashboard/dist/assets/BotPicker-CYfFMpkY.js +2 -0
- package/dashboard/dist/assets/{BotPicker-CM-_u73k.js.map → BotPicker-CYfFMpkY.js.map} +1 -1
- package/dashboard/dist/assets/CapabilitiesPage-M7-ZTFNV.js +2 -0
- package/dashboard/dist/assets/CapabilitiesPage-M7-ZTFNV.js.map +1 -0
- package/dashboard/dist/assets/CollapsibleSection-DU5KAtQ-.js +2 -0
- package/dashboard/dist/assets/{CollapsibleSection-CnPKa7df.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-DiWqv41D.js.map +1 -0
- package/dashboard/dist/assets/CredentialsPage-CmbwypSF.js +2 -0
- package/dashboard/dist/assets/{CredentialsPage-CImIzra4.js.map → CredentialsPage-CmbwypSF.js.map} +1 -1
- package/dashboard/dist/assets/CronLabel-nycfAefc.js +2 -0
- package/dashboard/dist/assets/CronLabel-nycfAefc.js.map +1 -0
- package/dashboard/dist/assets/CustomDurationPicker-gNZRBaHg.js +2 -0
- package/dashboard/dist/assets/{CustomDurationPicker-5JzEgS7I.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-BEW3jBzf.js.map → DropZone-vNcqMd05.js.map} +1 -1
- package/dashboard/dist/assets/ElapsedCell-CdvQbtve.js +2 -0
- package/dashboard/dist/assets/{ElapsedCell-B79BF5Mj.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-QvWvbpx3.js.map → EscalationsOverview-BNENCL_2.js.map} +1 -1
- package/dashboard/dist/assets/EventTable-BqDAyXyc.js +2 -0
- package/dashboard/dist/assets/{EventTable-DAclQwfr.js.map → EventTable-BqDAyXyc.js.map} +1 -1
- package/dashboard/dist/assets/EventTopicPill-CnHFBglc.js +2 -0
- package/dashboard/dist/assets/{EventTopicPill-By-6sXDp.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-DVOi7rR1.js.map → HomePage-fterfLKH.js.map} +1 -1
- package/dashboard/dist/assets/ListToolbar-BO5Igi6v.js +2 -0
- package/dashboard/dist/assets/{ListToolbar-Bntl2hex.js.map → ListToolbar-BO5Igi6v.js.map} +1 -1
- package/dashboard/dist/assets/McpOverview-BQokGg0z.js +2 -0
- package/dashboard/dist/assets/{McpOverview-B-xSYPJj.js.map → McpOverview-BQokGg0z.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryDetailPage-0WOp2n_j.js +5 -0
- package/dashboard/dist/assets/{McpQueryDetailPage-Cq71BzjB.js.map → McpQueryDetailPage-0WOp2n_j.js.map} +1 -1
- package/dashboard/dist/assets/McpQueryPage-DUey_h9J.js +2 -0
- package/dashboard/dist/assets/{McpQueryPage-Dfz87aZF.js.map → McpQueryPage-DUey_h9J.js.map} +1 -1
- package/dashboard/dist/assets/McpRunDetailPage-Cv4qyr91.js +2 -0
- package/dashboard/dist/assets/McpRunDetailPage-Cv4qyr91.js.map +1 -0
- package/dashboard/dist/assets/McpRunsPage-B3R6KZ61.js +2 -0
- package/dashboard/dist/assets/{McpRunsPage-MUYvUYqz.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-Rih1SZrn.js.map → OperatorDashboard-dldvzjcg.js.map} +1 -1
- package/dashboard/dist/assets/PageHeader-DF4BeEm4.js +2 -0
- package/dashboard/dist/assets/{PageHeader-Bo0SpcCK.js.map → PageHeader-DF4BeEm4.js.map} +1 -1
- package/dashboard/dist/assets/PageHeaderWithStats-BQZw6BgA.js +2 -0
- package/dashboard/dist/assets/{PageHeaderWithStats-7K5BdhOj.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-BMkWCjqD.js.map → ProcessDetailPage-Beo-QVL-.js.map} +1 -1
- package/dashboard/dist/assets/ProcessesListPage-C_ars8gp.js +2 -0
- package/dashboard/dist/assets/{ProcessesListPage-vZjUSc7S.js.map → ProcessesListPage-C_ars8gp.js.map} +1 -1
- package/dashboard/dist/assets/RolePill-DrBZ7JJj.js +2 -0
- package/dashboard/dist/assets/{RolePill-BDzPFQUv.js.map → RolePill-DrBZ7JJj.js.map} +1 -1
- package/dashboard/dist/assets/RolesPage-DgSXFFGL.js +2 -0
- package/dashboard/dist/assets/{RolesPage-kjeAsj3_.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-DC4SLtTq.js.map → RunAsSelector-CYMeZwrM.js.map} +1 -1
- package/dashboard/dist/assets/ServerName-D5NKD06M.js +2 -0
- package/dashboard/dist/assets/{ServerName-CEOFF7UG.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-CYYA8nd9.js.map +1 -0
- package/dashboard/dist/assets/TagInput-B45Dm3IW.js +2 -0
- package/dashboard/dist/assets/{TagInput-VBY0xIwb.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-DZykFijh.js.map → TaskQueuePill-BJRUjVDv.js.map} +1 -1
- package/dashboard/dist/assets/TasksListPage-Czu08px3.js +2 -0
- package/dashboard/dist/assets/{TasksListPage-69ZWCaCP.js.map → TasksListPage-Czu08px3.js.map} +1 -1
- package/dashboard/dist/assets/TimeAgo-CJ56IUy6.js +2 -0
- package/dashboard/dist/assets/{TimeAgo-CttiZG0k.js.map → TimeAgo-CJ56IUy6.js.map} +1 -1
- package/dashboard/dist/assets/TimestampCell-QtcYZ9Jx.js +2 -0
- package/dashboard/dist/assets/{TimestampCell-CYFbEhqc.js.map → TimestampCell-QtcYZ9Jx.js.map} +1 -1
- package/dashboard/dist/assets/ToolPill-DpDv3FwI.js +2 -0
- package/dashboard/dist/assets/{ToolPill-RP2Tvlrx.js.map → ToolPill-DpDv3FwI.js.map} +1 -1
- package/dashboard/dist/assets/ToolTestPanel-BzFOwzd_.js +2 -0
- package/dashboard/dist/assets/ToolTestPanel-BzFOwzd_.js.map +1 -0
- package/dashboard/dist/assets/TopicDetailPage-DwShZbh9.js +9 -0
- package/dashboard/dist/assets/{TopicDetailPage-Aq4-6GLl.js.map → TopicDetailPage-DwShZbh9.js.map} +1 -1
- package/dashboard/dist/assets/TopicsPage-DKXlpZl_.js +2 -0
- package/dashboard/dist/assets/{TopicsPage-BYFKjRY_.js.map → TopicsPage-DKXlpZl_.js.map} +1 -1
- package/dashboard/dist/assets/UserName-zlR1so37.js +2 -0
- package/dashboard/dist/assets/{UserName-C4_T5-rI.js.map → UserName-zlR1so37.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowExecutionPage-BMNIxeJB.js +2 -0
- package/dashboard/dist/assets/WorkflowExecutionPage-BMNIxeJB.js.map +1 -0
- package/dashboard/dist/assets/WorkflowPill-B5B3yGlh.js +2 -0
- package/dashboard/dist/assets/WorkflowPill-B5B3yGlh.js.map +1 -0
- package/dashboard/dist/assets/WorkflowsDashboard-BlAPZbQZ.js +2 -0
- package/dashboard/dist/assets/{WorkflowsDashboard-_LMWc-OC.js.map → WorkflowsDashboard-BlAPZbQZ.js.map} +1 -1
- package/dashboard/dist/assets/WorkflowsOverview-NnPi6rwS.js +2 -0
- package/dashboard/dist/assets/{WorkflowsOverview-DFrfw554.js.map → WorkflowsOverview-NnPi6rwS.js.map} +1 -1
- package/dashboard/dist/assets/YamlWorkflowsPage-C4mZum6x.js +2 -0
- package/dashboard/dist/assets/{YamlWorkflowsPage-CZzGwfol.js.map → YamlWorkflowsPage-C4mZum6x.js.map} +1 -1
- package/dashboard/dist/assets/{agents-CsKILVSU.js → agents-B5wvILeV.js} +2 -2
- package/dashboard/dist/assets/{agents-CsKILVSU.js.map → agents-B5wvILeV.js.map} +1 -1
- package/dashboard/dist/assets/{bots-BzEs6Q9L.js → bots-BPlouRDm.js} +2 -2
- package/dashboard/dist/assets/{bots-BzEs6Q9L.js.map → bots-BPlouRDm.js.map} +1 -1
- package/dashboard/dist/assets/capabilities-DkvRG09b.js +2 -0
- package/dashboard/dist/assets/capabilities-DkvRG09b.js.map +1 -0
- package/dashboard/dist/assets/{controlplane-COYEIIAz.js → controlplane-0m_rA-UW.js} +2 -2
- package/dashboard/dist/assets/{controlplane-COYEIIAz.js.map → controlplane-0m_rA-UW.js.map} +1 -1
- package/dashboard/dist/assets/escalation-CfIAIUg2.js +2 -0
- package/dashboard/dist/assets/{escalation-BZjS2202.js.map → escalation-CfIAIUg2.js.map} +1 -1
- package/dashboard/dist/assets/escalation-columns-CLIdxlbe.js +2 -0
- package/dashboard/dist/assets/{escalation-columns-DtRVmPSB.js.map → escalation-columns-CLIdxlbe.js.map} +1 -1
- package/dashboard/dist/assets/helpers-prGqC38M.js +2 -0
- package/dashboard/dist/assets/{helpers-BngVEys5.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-BPxglOYm.css +1 -0
- package/dashboard/dist/assets/index-BR3SwTNI.js +2 -0
- package/dashboard/dist/assets/{index-COgyD_H2.js.map → index-BR3SwTNI.js.map} +1 -1
- package/dashboard/dist/assets/index-BWKIigEk.js +2 -0
- package/dashboard/dist/assets/{index-Byp8BDPs.js.map → index-BWKIigEk.js.map} +1 -1
- package/dashboard/dist/assets/index-BgVuyWhi.js +15 -0
- package/dashboard/dist/assets/{index-DykjJxzr.js.map → index-BgVuyWhi.js.map} +1 -1
- package/dashboard/dist/assets/index-C0sDEKdo.js +2 -0
- package/dashboard/dist/assets/{index-DxMNiFPS.js.map → index-C0sDEKdo.js.map} +1 -1
- package/dashboard/dist/assets/index-C2MJzu6J.js +2 -0
- package/dashboard/dist/assets/{index-ByxH4qQ-.js.map → index-C2MJzu6J.js.map} +1 -1
- package/dashboard/dist/assets/index-CFoddJDr.js +6 -0
- package/dashboard/dist/assets/{index-BCsShN2l.js.map → index-CFoddJDr.js.map} +1 -1
- package/dashboard/dist/assets/index-CrMxD5Ib.js +6 -0
- package/dashboard/dist/assets/index-CrMxD5Ib.js.map +1 -0
- package/dashboard/dist/assets/index-CuY5hPYB.js +2 -0
- package/dashboard/dist/assets/{index-Bq5MSkCL.js.map → index-CuY5hPYB.js.map} +1 -1
- package/dashboard/dist/assets/index-CwkJBn87.js +2 -0
- package/dashboard/dist/assets/{index-R61-yG56.js.map → index-CwkJBn87.js.map} +1 -1
- package/dashboard/dist/assets/index-DeL84Cag.js +2 -0
- package/dashboard/dist/assets/{index-xgl431mG.js.map → index-DeL84Cag.js.map} +1 -1
- package/dashboard/dist/assets/index-DqeLbz6j.js +2 -0
- package/dashboard/dist/assets/{index-ABsZZf_U.js.map → index-DqeLbz6j.js.map} +1 -1
- package/dashboard/dist/assets/index-P9huxx3-.js +2 -0
- package/dashboard/dist/assets/{index-BwivT39P.js.map → index-P9huxx3-.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-DhCbDgy4.js → knowledge-CUZxyRCO.js} +2 -2
- package/dashboard/dist/assets/{knowledge-DhCbDgy4.js.map → knowledge-CUZxyRCO.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-xh7T0I-f.js → mcp-B5VQPoF3.js} +2 -2
- package/dashboard/dist/assets/{mcp-xh7T0I-f.js.map → mcp-B5VQPoF3.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-il3CfU3U.js → mcp-query-Ba5Zj3yg.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-il3CfU3U.js.map → mcp-query-Ba5Zj3yg.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-runs-4fyRpegc.js → mcp-runs-CAiEr5Fc.js} +2 -2
- package/dashboard/dist/assets/{mcp-runs-4fyRpegc.js.map → mcp-runs-CAiEr5Fc.js.map} +1 -1
- package/dashboard/dist/assets/namespaces-sVr5scma.js +2 -0
- package/dashboard/dist/assets/{namespaces-BBTvHnRF.js.map → namespaces-sVr5scma.js.map} +1 -1
- package/dashboard/dist/assets/{roles-D7bx5FAM.js → roles-E_bA4e0f.js} +2 -2
- package/dashboard/dist/assets/{roles-D7bx5FAM.js.map → roles-E_bA4e0f.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-BgxRbhVM.js → tasks-CL6Gv8jB.js} +2 -2
- package/dashboard/dist/assets/{tasks-BgxRbhVM.js.map → tasks-CL6Gv8jB.js.map} +1 -1
- package/dashboard/dist/assets/{topics-CTtCboHe.js → topics-DbtPHERP.js} +2 -2
- package/dashboard/dist/assets/{topics-CTtCboHe.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-C6c618cj.js +2 -0
- package/dashboard/dist/assets/useEventHooks-C6c618cj.js.map +1 -0
- 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-CSMX9He5.js → useYamlActivityEvents-eK7kIUdh.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-CSMX9He5.js.map → useYamlActivityEvents-eK7kIUdh.js.map} +1 -1
- package/dashboard/dist/assets/{users-CyF-5WLI.js → users-CCHSIAxt.js} +2 -2
- package/dashboard/dist/assets/{users-CyF-5WLI.js.map → users-CCHSIAxt.js.map} +1 -1
- package/dashboard/dist/assets/{vendor-icons-BNtvBbnj.js → vendor-icons-D8-ZINAH.js} +3 -3
- package/dashboard/dist/assets/{vendor-icons-BNtvBbnj.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-Bf4_w24H.js → workflows-BNbocg_9.js} +2 -2
- package/dashboard/dist/assets/{workflows-Bf4_w24H.js.map → workflows-BNbocg_9.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-Cp1N0NMK.js → yaml-workflows-Cu1FUwrc.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-Cp1N0NMK.js.map → yaml-workflows-Cu1FUwrc.js.map} +1 -1
- package/dashboard/dist/index.html +5 -5
- package/docs/agents.md +9 -9
- package/docs/api/http/agents.md +12 -10
- package/docs/api/http/settings.md +4 -0
- package/docs/api/sdk/agents.md +4 -2
- package/docs/api/sdk/settings.md +2 -1
- package/docs/dashboard.md +1 -1
- package/package.json +2 -2
- package/dashboard/dist/assets/AdminDashboard-Dr5wTIZT.js +0 -2
- package/dashboard/dist/assets/AgentConfigPage-D52KyJY-.js +0 -13
- package/dashboard/dist/assets/AgentConfigPage-D52KyJY-.js.map +0 -1
- package/dashboard/dist/assets/AgentDetailPage-Cbo_qrYF.js +0 -4
- package/dashboard/dist/assets/AgentDetailPage-Cbo_qrYF.js.map +0 -1
- package/dashboard/dist/assets/AgentsPage-CvuF8--H.js +0 -2
- package/dashboard/dist/assets/AgentsPage-CvuF8--H.js.map +0 -1
- package/dashboard/dist/assets/AvailableEscalationsPage-UzjXcO3W.js +0 -2
- package/dashboard/dist/assets/BotPicker-CM-_u73k.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-D1QEHMKw.js +0 -2
- package/dashboard/dist/assets/CapabilitiesPage-D1QEHMKw.js.map +0 -1
- package/dashboard/dist/assets/CollapsibleSection-CnPKa7df.js +0 -2
- package/dashboard/dist/assets/ConfirmDeleteModal-dOxidrSR.js +0 -2
- package/dashboard/dist/assets/CopyableId-DmLF-RqZ.js +0 -2
- package/dashboard/dist/assets/CopyableId-DmLF-RqZ.js.map +0 -1
- package/dashboard/dist/assets/CredentialsPage-CImIzra4.js +0 -2
- package/dashboard/dist/assets/CronLabel-5HPAmciI.js +0 -2
- package/dashboard/dist/assets/CronLabel-5HPAmciI.js.map +0 -1
- package/dashboard/dist/assets/CustomDurationPicker-5JzEgS7I.js +0 -2
- package/dashboard/dist/assets/DataTable-D9yuBv0w.js +0 -2
- package/dashboard/dist/assets/DropZone-BEW3jBzf.js +0 -2
- package/dashboard/dist/assets/ElapsedCell-B79BF5Mj.js +0 -2
- package/dashboard/dist/assets/EmptyState-BcsfPq9T.js +0 -2
- package/dashboard/dist/assets/EscalationsOverview-QvWvbpx3.js +0 -2
- package/dashboard/dist/assets/EventTable-DAclQwfr.js +0 -2
- package/dashboard/dist/assets/EventTopicPill-By-6sXDp.js +0 -2
- package/dashboard/dist/assets/FilterBar-Ck4K4rzu.js +0 -2
- package/dashboard/dist/assets/HomePage-DVOi7rR1.js +0 -2
- package/dashboard/dist/assets/ListToolbar-Bntl2hex.js +0 -2
- package/dashboard/dist/assets/McpOverview-B-xSYPJj.js +0 -2
- package/dashboard/dist/assets/McpQueryDetailPage-Cq71BzjB.js +0 -5
- package/dashboard/dist/assets/McpQueryPage-Dfz87aZF.js +0 -2
- package/dashboard/dist/assets/McpRunDetailPage-CXXRgMmJ.js +0 -2
- package/dashboard/dist/assets/McpRunDetailPage-CXXRgMmJ.js.map +0 -1
- package/dashboard/dist/assets/McpRunsPage-MUYvUYqz.js +0 -2
- package/dashboard/dist/assets/Modal-DEODGeqx.js +0 -2
- package/dashboard/dist/assets/OperatorDashboard-Rih1SZrn.js +0 -2
- package/dashboard/dist/assets/PageHeader-Bo0SpcCK.js +0 -2
- package/dashboard/dist/assets/PageHeaderWithStats-7K5BdhOj.js +0 -2
- package/dashboard/dist/assets/PriorityBadge-DfQY9St9.js +0 -2
- package/dashboard/dist/assets/ProcessDetailPage-BMkWCjqD.js +0 -2
- package/dashboard/dist/assets/ProcessesListPage-vZjUSc7S.js +0 -2
- package/dashboard/dist/assets/RolePill-BDzPFQUv.js +0 -2
- package/dashboard/dist/assets/RolesPage-kjeAsj3_.js +0 -2
- package/dashboard/dist/assets/RowActions-Dg-Fsm5O.js +0 -2
- package/dashboard/dist/assets/RunAsSelector-DC4SLtTq.js +0 -2
- package/dashboard/dist/assets/ServerName-CEOFF7UG.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-MUUXgT3o.js +0 -2
- package/dashboard/dist/assets/SwimlaneTimeline-MUUXgT3o.js.map +0 -1
- package/dashboard/dist/assets/TagInput-VBY0xIwb.js +0 -2
- package/dashboard/dist/assets/TaskDetailPage-C0AlG_2t.js +0 -2
- package/dashboard/dist/assets/TaskDetailPage-C0AlG_2t.js.map +0 -1
- package/dashboard/dist/assets/TaskQueuePill-DZykFijh.js +0 -2
- package/dashboard/dist/assets/TasksListPage-69ZWCaCP.js +0 -2
- package/dashboard/dist/assets/TimeAgo-CttiZG0k.js +0 -2
- package/dashboard/dist/assets/TimestampCell-CYFbEhqc.js +0 -2
- package/dashboard/dist/assets/ToolPill-RP2Tvlrx.js +0 -2
- package/dashboard/dist/assets/ToolTestPanel-CY_PLZSe.js +0 -2
- package/dashboard/dist/assets/ToolTestPanel-CY_PLZSe.js.map +0 -1
- package/dashboard/dist/assets/TopicDetailPage-Aq4-6GLl.js +0 -9
- package/dashboard/dist/assets/TopicsPage-BYFKjRY_.js +0 -2
- package/dashboard/dist/assets/UserName-C4_T5-rI.js +0 -2
- package/dashboard/dist/assets/WorkflowExecutionPage-DUSTBasv.js +0 -2
- package/dashboard/dist/assets/WorkflowExecutionPage-DUSTBasv.js.map +0 -1
- package/dashboard/dist/assets/WorkflowPill-pPuGH8v9.js +0 -2
- package/dashboard/dist/assets/WorkflowPill-pPuGH8v9.js.map +0 -1
- package/dashboard/dist/assets/WorkflowsDashboard-_LMWc-OC.js +0 -2
- package/dashboard/dist/assets/WorkflowsOverview-DFrfw554.js +0 -2
- package/dashboard/dist/assets/YamlWorkflowsPage-CZzGwfol.js +0 -2
- package/dashboard/dist/assets/escalation-BZjS2202.js +0 -2
- package/dashboard/dist/assets/escalation-columns-DtRVmPSB.js +0 -2
- package/dashboard/dist/assets/helpers-BngVEys5.js +0 -2
- package/dashboard/dist/assets/index-ABsZZf_U.js +0 -2
- package/dashboard/dist/assets/index-BCsShN2l.js +0 -6
- package/dashboard/dist/assets/index-Bq5MSkCL.js +0 -2
- package/dashboard/dist/assets/index-BwivT39P.js +0 -2
- package/dashboard/dist/assets/index-Byp8BDPs.js +0 -2
- package/dashboard/dist/assets/index-ByxH4qQ-.js +0 -2
- package/dashboard/dist/assets/index-COgyD_H2.js +0 -2
- package/dashboard/dist/assets/index-DXEYynKO.css +0 -1
- package/dashboard/dist/assets/index-DcpCR9c_.js +0 -63
- package/dashboard/dist/assets/index-DcpCR9c_.js.map +0 -1
- package/dashboard/dist/assets/index-DuPY59Yu.js +0 -5
- package/dashboard/dist/assets/index-DuPY59Yu.js.map +0 -1
- package/dashboard/dist/assets/index-DxMNiFPS.js +0 -2
- package/dashboard/dist/assets/index-DykjJxzr.js +0 -15
- package/dashboard/dist/assets/index-R61-yG56.js +0 -2
- package/dashboard/dist/assets/index-xgl431mG.js +0 -2
- package/dashboard/dist/assets/namespaces-BBTvHnRF.js +0 -2
- package/dashboard/dist/assets/settings-nt6qyR1S.js +0 -2
- package/dashboard/dist/assets/settings-nt6qyR1S.js.map +0 -1
- package/dashboard/dist/assets/useEventHooks-CkJOmbF-.js +0 -2
- package/dashboard/dist/assets/useEventHooks-CkJOmbF-.js.map +0 -1
- 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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowExecutionPage-DUSTBasv.js","sources":["../../src/pages/workflows/workflow-execution/ExecutionHeader.tsx","../../src/pages/workflows/workflow-execution/ExecutionInputResult.tsx","../../src/pages/workflows/WorkflowExecutionPage.tsx"],"sourcesContent":["import { Link } from 'react-router-dom';\nimport { StatusBadge } from '../../../components/common/display/StatusBadge';\nimport type { WorkflowExecution, LTTaskRecord, LTEscalationRecord } from '../../../api/types';\nimport { DateValue } from '../../../components/common/display/DateValue';\nimport { DurationValue } from '../../../components/common/display/DurationValue';\n\nfunction MetadataField({\n label,\n value,\n mono,\n truncate,\n children,\n}: {\n label: string;\n value?: string;\n mono?: boolean;\n truncate?: boolean;\n children?: React.ReactNode;\n}) {\n return (\n <div>\n <p className=\"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1\">\n {label}\n </p>\n {children || (\n <p\n className={`text-xs text-text-primary ${mono ? 'font-mono' : ''} ${truncate ? 'truncate' : ''}`}\n title={truncate ? value : undefined}\n >\n {value}\n </p>\n )}\n </div>\n );\n}\n\n/**\n * Split a HotMesh compound entity key (taskQueue-workflowName) on the last '-'.\n * Workflow names are camelCase, so the last segment is always the workflow type.\n */\nfunction splitEntityKey(compound: string): { taskQueue: string; workflowType: string } {\n const lastDash = compound.lastIndexOf('-');\n if (lastDash <= 0) return { taskQueue: compound, workflowType: compound };\n return {\n taskQueue: compound.substring(0, lastDash),\n workflowType: compound.substring(lastDash + 1),\n };\n}\n\ninterface ExecutionHeaderProps {\n execution: WorkflowExecution;\n task?: LTTaskRecord | null;\n childTasks?: LTTaskRecord[];\n escalations?: LTEscalationRecord[];\n}\n\nexport function ExecutionHeader({ execution, task, escalations }: ExecutionHeaderProps) {\n // Determine parent relationship — prefer execution-level pj (from HotMesh\n // raw state), fall back to lt_tasks record. When the SDK adds\n // parent_workflow_id natively, it flows through automatically.\n const executionParent = (execution as any).parent_workflow_id as string | undefined;\n const isLeaf = task && task.workflow_id === execution.workflow_id;\n const taskParent = isLeaf ? task.parent_workflow_id : null;\n const rawParent = executionParent || taskParent || null;\n // Filter self-references — cron-invoked workflows store themselves as parent\n const parentWorkflowId = rawParent && rawParent !== execution.workflow_id ? rawParent : null;\n\n // Split compound HotMesh keys into separate task queue / workflow type\n const { taskQueue, workflowType } = splitEntityKey(execution.workflow_type);\n\n return (\n <div className=\"px-6 py-6 mb-6\">\n\n <div className=\"grid grid-cols-2 sm:grid-cols-4 gap-y-4 gap-x-8\">\n <MetadataField label=\"Workflow Type\" value={workflowType} mono />\n <MetadataField label=\"Task Queue\" value={taskQueue} mono />\n <MetadataField label=\"Start Time\">\n {execution.start_time\n ? <DateValue date={execution.start_time} format=\"datetime\" className=\"text-text-primary\" />\n : <span className=\"text-xs text-text-tertiary\">--</span>}\n </MetadataField>\n <MetadataField label=\"End Time\">\n {execution.close_time\n ? <DateValue date={execution.close_time} format=\"datetime\" className=\"text-text-primary\" />\n : <span className=\"text-xs text-text-tertiary\">--</span>}\n </MetadataField>\n <MetadataField label=\"Duration\">\n <DurationValue ms={execution.duration_ms} className=\"font-mono text-text-primary\" />\n </MetadataField>\n <MetadataField\n label=\"History Size\"\n value={`${execution.summary.total_events} events`}\n />\n <MetadataField\n label=\"Activities\"\n value={`${execution.summary.activities.completed} / ${execution.summary.activities.total}`}\n />\n <MetadataField\n label=\"Run ID\"\n value={execution.workflow_id}\n mono\n truncate\n />\n </div>\n\n {/* Related links */}\n {(parentWorkflowId || task || (escalations && escalations.length > 0)) && (\n <div className=\"mt-5 pt-4 border-t border-surface-border space-y-3\">\n {/* Parent navigation */}\n {parentWorkflowId && (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary shrink-0\">\n Parent\n </span>\n <Link\n to={`/workflows/executions/${parentWorkflowId}`}\n className=\"text-xs font-mono text-accent hover:underline truncate\"\n title={parentWorkflowId}\n >\n {parentWorkflowId}\n </Link>\n </div>\n )}\n\n {/* Process link — deep-links to process list filtered by this workflow */}\n {false && (\n <div className=\"flex items-center gap-2\">\n <span className=\"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary shrink-0\">\n Process\n </span>\n <Link\n to={`/processes/all?search=${encodeURIComponent(execution.workflow_id)}`}\n className=\"text-xs font-mono text-accent hover:underline truncate\"\n >\n Find in Processes\n </Link>\n </div>\n )}\n\n {/* Escalation links */}\n {escalations && escalations.length > 0 && (\n <div className=\"flex items-start gap-2\">\n <span className=\"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary shrink-0 mt-0.5\">\n {escalations.length === 1 ? 'Escalation' : 'Escalations'}\n </span>\n <div className=\"flex flex-wrap gap-x-4 gap-y-1\">\n {escalations.map((esc) => (\n <Link\n key={esc.id}\n to={`/escalations/detail/${esc.id}`}\n className=\"inline-flex items-center gap-1.5 text-xs font-mono text-accent hover:underline\"\n >\n <span>{esc.type}</span>\n <StatusBadge status={esc.status} />\n </Link>\n ))}\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import { JsonViewer } from '../../../components/common/data/JsonViewer';\nimport type { WorkflowExecution } from '../../../api/types';\n\ninterface ExecutionInputResultProps {\n execution: WorkflowExecution;\n}\n\n/**\n * Extract the workflow input envelope from the workflow_execution_started event.\n * HotMesh 0.13.0+ includes the actual trigger arguments (the envelope passed\n * to startWorkflow) in the start event's `input` attribute.\n */\nfunction extractInput(execution: WorkflowExecution): Record<string, unknown> | null {\n const startEvent = execution.events.find(\n (e) => e.event_type === 'workflow_execution_started',\n );\n const input = (startEvent?.attributes as any)?.input;\n return input && typeof input === 'object' ? input : null;\n}\n\nexport function ExecutionInputResult({ execution }: ExecutionInputResultProps) {\n const input = extractInput(execution);\n\n // Result: unwrap the workflow return — the `data` field is what LT users care about\n const rawResult = execution.result as Record<string, unknown> | null | undefined;\n const result = rawResult?.data ?? rawResult ?? null;\n\n if (!input && !result) return null;\n\n return (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6\">\n {input !== null && (\n <div>\n <JsonViewer data={input} label=\"Input Envelope\" />\n </div>\n )}\n {result !== null && (\n <div>\n <JsonViewer data={result} label=\"Result\" />\n </div>\n )}\n </div>\n );\n}\n","import { useState, useRef, useEffect } from 'react';\nimport { useParams, useLocation, useNavigate, Link } from 'react-router-dom';\nimport { useWorkflowExecution, useTerminateWorkflow } from '../../api/workflows';\nimport { useWorkflowDetailEvents } from '../../hooks/useEventHooks';\nimport { useCollapsedSections } from '../../hooks/useCollapsedSections';\nimport { useTaskByWorkflowId, useChildTasks } from '../../api/tasks';\nimport { useEscalationsByWorkflowId } from '../../api/escalations';\n\nimport { PageHeader } from '../../components/common/layout/PageHeader';\nimport { CollapsibleSection } from '../../components/common/layout/CollapsibleSection';\nimport { ListToolbar } from '../../components/common/data/ListToolbar';\nimport { StatusBadge } from '../../components/common/display/StatusBadge';\n\nimport { ExecutionHeader } from './workflow-execution/ExecutionHeader';\nimport { ExecutionInputResult } from './workflow-execution/ExecutionInputResult';\nimport { SwimlaneTimeline } from './workflow-execution/SwimlaneTimeline';\nimport { EventTable } from './workflow-execution/EventTable';\n\nfunction ActionsDropdown({ isRunning, hasToolCalls, workflowId, onAction }: {\n isRunning: boolean;\n hasToolCalls: boolean;\n workflowId: string;\n onAction: (action: 'restart' | 'terminate') => void;\n}) {\n const [open, setOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const handler = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', handler);\n return () => document.removeEventListener('mousedown', handler);\n }, [open]);\n\n return (\n <div className=\"relative\" ref={ref}>\n <button onClick={() => setOpen(!open)} className=\"btn-primary text-xs\">\n Actions\n </button>\n {open && (\n <div className=\"absolute right-0 mt-1 w-44 bg-surface-raised border border-surface-border rounded-md shadow-lg z-10\">\n <button\n onClick={() => { onAction('restart'); setOpen(false); }}\n className=\"block w-full text-left px-4 py-2 text-xs text-text-secondary hover:bg-surface-hover\"\n >\n Restart Workflow\n </button>\n {isRunning && (\n <button\n onClick={() => { onAction('terminate'); setOpen(false); }}\n className=\"block w-full text-left px-4 py-2 text-xs text-status-error hover:bg-surface-hover\"\n >\n Terminate\n </button>\n )}\n {hasToolCalls && (\n <Link\n to={`/mcp/queries/${workflowId}?step=3`}\n className=\"block w-full text-left px-4 py-2 text-xs text-accent hover:bg-surface-hover\"\n onClick={() => setOpen(false)}\n >\n Compile into Pipeline\n </Link>\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport function WorkflowExecutionPage() {\n const { workflowId } = useParams<{ workflowId: string }>();\n const { pathname } = useLocation();\n useWorkflowDetailEvents(workflowId);\n\n const executionTitle = pathname.startsWith('/workflows/durable/')\n ? 'Durable Execution'\n : 'Durable Execution';\n const { data: execution, isLoading, error, refetch, isFetching } = useWorkflowExecution(workflowId!);\n const { data: task } = useTaskByWorkflowId(workflowId!);\n const { data: childTasksData } = useChildTasks(workflowId!);\n const { data: escalationsData } = useEscalationsByWorkflowId(workflowId);\n const navigate = useNavigate();\n const terminateMutation = useTerminateWorkflow();\n const { isCollapsed, toggle } = useCollapsedSections('workflow-execution');\n\n const handleAction = (action: 'restart' | 'terminate') => {\n if (action === 'terminate') {\n if (confirm('Are you sure you want to terminate this workflow?')) {\n terminateMutation.mutate(workflowId!);\n }\n } else if (action === 'restart' && execution) {\n // Extract entity from workflow_id (format: {entity}-{guid})\n const entity = execution.workflow_id.replace(/-[A-Za-z0-9_-]{20,}$/, '');\n // Extract original input from the started event\n const startEvent = execution.events.find((e) => e.event_type === 'workflow_execution_started');\n const input = (startEvent?.attributes as any)?.input;\n if (input) {\n sessionStorage.setItem('lt:invoke:prefill', JSON.stringify(input));\n }\n navigate(`/workflows/start?type=${encodeURIComponent(entity)}&mode=now`);\n }\n };\n\n if (isLoading) {\n return (\n <div className=\"animate-pulse space-y-4\">\n <div className=\"h-8 bg-surface-sunken rounded w-64\" />\n <div className=\"h-60 bg-surface-sunken rounded\" />\n </div>\n );\n }\n\n if (error || !execution) {\n const msg = (error as Error)?.message ?? '';\n const isExpired = msg.includes('expired') || msg.includes('no longer available');\n\n return (\n <div>\n <Link to=\"/workflows/executions\" className=\"text-xs text-text-tertiary hover:text-text-primary\">\n ← Workflows\n </Link>\n <div className=\"mt-4 text-center py-8\">\n <p className=\"text-sm text-text-primary mb-1\">\n {isExpired\n ? 'Execution data is no longer available'\n : error\n ? 'Unable to load execution'\n : 'Execution not found'}\n </p>\n <p className=\"text-xs text-text-tertiary\">\n {isExpired\n ? \"This workflow's underlying job has expired. The task record is preserved, but the execution timeline has been cleaned up.\"\n : msg || 'The workflow could not be resolved.'}\n </p>\n </div>\n </div>\n );\n }\n\n const isRunning = execution.status !== 'completed' && execution.status !== 'failed';\n const hasToolCalls = execution.status === 'completed' && execution.events.some(\n (e) => {\n if (e.event_type !== 'activity_task_completed') return false;\n const actType = (e.attributes as any).activity_type;\n return actType === 'callDbTool' || actType === 'callVisionTool' || actType === 'callMcpTool' || actType?.startsWith('mcp_');\n },\n );\n\n return (\n <div>\n <PageHeader\n title={executionTitle}\n actions={\n <div className=\"flex items-center gap-3\">\n <ListToolbar\n onRefresh={() => refetch()}\n isFetching={isFetching}\n apiPath={`/workflow-states/${workflowId}/execution`}\n />\n <StatusBadge status={execution.status} />\n <ActionsDropdown\n isRunning={isRunning}\n hasToolCalls={hasToolCalls}\n workflowId={workflowId!}\n onAction={handleAction}\n />\n </div>\n }\n />\n\n <ExecutionHeader\n execution={execution}\n task={task}\n childTasks={childTasksData?.tasks}\n escalations={escalationsData?.escalations}\n />\n\n {terminateMutation.error && (\n <div className=\"py-3 mb-6\">\n <p className=\"text-xs text-status-error\">\n Terminate failed: {terminateMutation.error.message}\n </p>\n </div>\n )}\n\n\n <div className=\"space-y-6\">\n <CollapsibleSection title=\"Details\" sectionKey=\"details\" isCollapsed={isCollapsed('details')} onToggle={toggle} contentClassName=\"mt-4 ml-9\">\n <ExecutionInputResult execution={execution} />\n </CollapsibleSection>\n\n <CollapsibleSection title=\"Execution Timeline\" sectionKey=\"timeline\" isCollapsed={isCollapsed('timeline')} onToggle={toggle} contentClassName=\"mt-4 ml-9\">\n <SwimlaneTimeline\n events={execution.events}\n childTasks={childTasksData?.tasks}\n />\n </CollapsibleSection>\n\n <CollapsibleSection title=\"Events\" sectionKey=\"events\" isCollapsed={isCollapsed('events')} onToggle={toggle} contentClassName=\"mt-4 ml-9\">\n <EventTable\n events={execution.events}\n childTasks={childTasksData?.tasks}\n />\n </CollapsibleSection>\n </div>\n </div>\n );\n}\n"],"names":["MetadataField","label","value","mono","truncate","children","jsx","splitEntityKey","compound","lastDash","ExecutionHeader","execution","task","escalations","executionParent","taskParent","rawParent","parentWorkflowId","taskQueue","workflowType","jsxs","DateValue","DurationValue","Link","esc","StatusBadge","extractInput","startEvent","e","input","_a","ExecutionInputResult","rawResult","result","JsonViewer","ActionsDropdown","isRunning","hasToolCalls","workflowId","onAction","open","setOpen","useState","ref","useRef","useEffect","handler","WorkflowExecutionPage","useParams","pathname","useLocation","useWorkflowDetailEvents","executionTitle","isLoading","error","refetch","isFetching","useWorkflowExecution","useTaskByWorkflowId","childTasksData","useChildTasks","escalationsData","useEscalationsByWorkflowId","navigate","useNavigate","terminateMutation","useTerminateWorkflow","isCollapsed","toggle","useCollapsedSections","handleAction","action","entity","msg","isExpired","actType","PageHeader","ListToolbar","CollapsibleSection","SwimlaneTimeline","EventTable"],"mappings":"iuBAMA,SAASA,EAAc,CACrB,MAAAC,EACA,MAAAC,EACA,KAAAC,EACA,SAAAC,EACA,SAAAC,CACF,EAMG,CACD,cACG,MAAA,CACC,SAAA,CAAAC,EAAAA,IAAC,IAAA,CAAE,UAAU,8EACV,SAAAL,EACH,EACCI,GACCC,EAAAA,IAAC,IAAA,CACC,UAAW,6BAA6BH,EAAO,YAAc,EAAE,IAAIC,EAAW,WAAa,EAAE,GAC7F,MAAOA,EAAWF,EAAQ,OAEzB,SAAAA,CAAA,CAAA,CACH,EAEJ,CAEJ,CAMA,SAASK,EAAeC,EAA+D,CACrF,MAAMC,EAAWD,EAAS,YAAY,GAAG,EACzC,OAAIC,GAAY,EAAU,CAAE,UAAWD,EAAU,aAAcA,CAAA,EACxD,CACL,UAAWA,EAAS,UAAU,EAAGC,CAAQ,EACzC,aAAcD,EAAS,UAAUC,EAAW,CAAC,CAAA,CAEjD,CASO,SAASC,EAAgB,CAAE,UAAAC,EAAW,KAAAC,EAAM,YAAAC,GAAqC,CAItF,MAAMC,EAAmBH,EAAkB,mBAErCI,EADSH,GAAQA,EAAK,cAAgBD,EAAU,YAC1BC,EAAK,mBAAqB,KAChDI,EAAYF,GAAmBC,GAAc,KAE7CE,EAAmBD,GAAaA,IAAcL,EAAU,YAAcK,EAAY,KAGlF,CAAE,UAAAE,EAAW,aAAAC,CAAA,EAAiBZ,EAAeI,EAAU,aAAa,EAE1E,OACES,EAAAA,KAAC,MAAA,CAAI,UAAU,iBAEb,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,kDACb,SAAA,CAAAd,MAACN,GAAc,MAAM,gBAAgB,MAAOmB,EAAc,KAAI,GAAC,QAC9DnB,EAAA,CAAc,MAAM,aAAa,MAAOkB,EAAW,KAAI,GAAC,EACzDZ,EAAAA,IAACN,GAAc,MAAM,aAClB,WAAU,WACPM,EAAAA,IAACe,GAAU,KAAMV,EAAU,WAAY,OAAO,WAAW,UAAU,mBAAA,CAAoB,QACtF,OAAA,CAAK,UAAU,6BAA6B,SAAA,IAAA,CAAE,CAAA,CACrD,EACAL,EAAAA,IAACN,GAAc,MAAM,WAClB,WAAU,WACPM,EAAAA,IAACe,GAAU,KAAMV,EAAU,WAAY,OAAO,WAAW,UAAU,mBAAA,CAAoB,QACtF,OAAA,CAAK,UAAU,6BAA6B,SAAA,IAAA,CAAE,CAAA,CACrD,EACAL,EAAAA,IAACN,EAAA,CAAc,MAAM,WACnB,SAAAM,EAAAA,IAACgB,EAAA,CAAc,GAAIX,EAAU,YAAa,UAAU,6BAAA,CAA8B,CAAA,CACpF,EACAL,EAAAA,IAACN,EAAA,CACC,MAAM,eACN,MAAO,GAAGW,EAAU,QAAQ,YAAY,SAAA,CAAA,EAE1CL,EAAAA,IAACN,EAAA,CACC,MAAM,aACN,MAAO,GAAGW,EAAU,QAAQ,WAAW,SAAS,MAAMA,EAAU,QAAQ,WAAW,KAAK,EAAA,CAAA,EAE1FL,EAAAA,IAACN,EAAA,CACC,MAAM,SACN,MAAOW,EAAU,YACjB,KAAI,GACJ,SAAQ,EAAA,CAAA,CACV,EACF,GAGEM,GAAoBL,GAASC,GAAeA,EAAY,OAAS,IACjEO,EAAAA,KAAC,MAAA,CAAI,UAAU,qDAEZ,SAAA,CAAAH,GACCG,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACb,SAAA,CAAAd,EAAAA,IAAC,OAAA,CAAK,UAAU,kFAAkF,SAAA,SAElG,EACAA,EAAAA,IAACiB,EAAA,CACC,GAAI,yBAAyBN,CAAgB,GAC7C,UAAU,yDACV,MAAOA,EAEN,SAAAA,CAAA,CAAA,CACH,EACF,EAID,GAeAJ,GAAeA,EAAY,OAAS,GACnCO,EAAAA,KAAC,MAAA,CAAI,UAAU,yBACb,SAAA,CAAAd,EAAAA,IAAC,QAAK,UAAU,yFACb,WAAY,SAAW,EAAI,aAAe,aAAA,CAC7C,QACC,MAAA,CAAI,UAAU,iCACZ,SAAAO,EAAY,IAAKW,GAChBJ,EAAAA,KAACG,EAAA,CAEC,GAAI,uBAAuBC,EAAI,EAAE,GACjC,UAAU,iFAEV,SAAA,CAAAlB,EAAAA,IAAC,OAAA,CAAM,WAAI,IAAA,CAAK,EAChBA,EAAAA,IAACmB,EAAA,CAAY,OAAQD,EAAI,MAAA,CAAQ,CAAA,CAAA,EAL5BA,EAAI,EAAA,CAOZ,CAAA,CACH,CAAA,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,EAEJ,CAEJ,CCvJA,SAASE,EAAaf,EAA8D,OAClF,MAAMgB,EAAahB,EAAU,OAAO,KACjCiB,GAAMA,EAAE,aAAe,4BAAA,EAEpBC,GAASC,EAAAH,GAAA,YAAAA,EAAY,aAAZ,YAAAG,EAAgC,MAC/C,OAAOD,GAAS,OAAOA,GAAU,SAAWA,EAAQ,IACtD,CAEO,SAASE,EAAqB,CAAE,UAAApB,GAAwC,CAC7E,MAAMkB,EAAQH,EAAaf,CAAS,EAG9BqB,EAAYrB,EAAU,OACtBsB,GAASD,GAAA,YAAAA,EAAW,OAAQA,GAAa,KAE/C,MAAI,CAACH,GAAS,CAACI,EAAe,KAG5Bb,EAAAA,KAAC,MAAA,CAAI,UAAU,6CACZ,SAAA,CAAAS,IAAU,YACR,MAAA,CACC,SAAAvB,EAAAA,IAAC4B,GAAW,KAAML,EAAO,MAAM,gBAAA,CAAiB,CAAA,CAClD,EAEDI,IAAW,MACV3B,EAAAA,IAAC,MAAA,CACC,SAAAA,EAAAA,IAAC4B,GAAW,KAAMD,EAAQ,MAAM,QAAA,CAAS,CAAA,CAC3C,CAAA,EAEJ,CAEJ,CCzBA,SAASE,EAAgB,CAAE,UAAAC,EAAW,aAAAC,EAAc,WAAAC,EAAY,SAAAC,GAK7D,CACD,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAS,EAAK,EAChCC,EAAMC,EAAAA,OAAuB,IAAI,EAEvCC,OAAAA,EAAAA,UAAU,IAAM,CACd,GAAI,CAACL,EAAM,OACX,MAAMM,EAAWlB,GAAkB,CAC7Be,EAAI,SAAW,CAACA,EAAI,QAAQ,SAASf,EAAE,MAAc,GAAGa,EAAQ,EAAK,CAC3E,EACA,gBAAS,iBAAiB,YAAaK,CAAO,EACvC,IAAM,SAAS,oBAAoB,YAAaA,CAAO,CAChE,EAAG,CAACN,CAAI,CAAC,EAGPpB,EAAAA,KAAC,MAAA,CAAI,UAAU,WAAW,IAAAuB,EACxB,SAAA,CAAArC,EAAAA,IAAC,SAAA,CAAO,QAAS,IAAMmC,EAAQ,CAACD,CAAI,EAAG,UAAU,sBAAsB,SAAA,SAAA,CAEvE,EACCA,GACCpB,EAAAA,KAAC,MAAA,CAAI,UAAU,sGACb,SAAA,CAAAd,EAAAA,IAAC,SAAA,CACC,QAAS,IAAM,CAAEiC,EAAS,SAAS,EAAGE,EAAQ,EAAK,CAAG,EACtD,UAAU,sFACX,SAAA,kBAAA,CAAA,EAGAL,GACC9B,EAAAA,IAAC,SAAA,CACC,QAAS,IAAM,CAAEiC,EAAS,WAAW,EAAGE,EAAQ,EAAK,CAAG,EACxD,UAAU,oFACX,SAAA,WAAA,CAAA,EAIFJ,GACC/B,EAAAA,IAACiB,EAAA,CACC,GAAI,gBAAgBe,CAAU,UAC9B,UAAU,8EACV,QAAS,IAAMG,EAAQ,EAAK,EAC7B,SAAA,uBAAA,CAAA,CAED,CAAA,CAEJ,CAAA,EAEJ,CAEJ,CAEO,SAASM,IAAwB,CACtC,KAAM,CAAE,WAAAT,CAAA,EAAeU,EAAA,EACjB,CAAE,SAAAC,CAAA,EAAaC,EAAA,EACrBC,EAAwBb,CAAU,EAElC,MAAMc,GAAiBH,EAAS,WAAW,qBAAqB,EAC5D,qBAEE,CAAE,KAAMtC,EAAW,UAAA0C,EAAW,MAAAC,EAAO,QAAAC,EAAS,WAAAC,CAAA,EAAeC,EAAqBnB,CAAW,EAC7F,CAAE,KAAM1B,GAAS8C,EAAoBpB,CAAW,EAChD,CAAE,KAAMqB,GAAmBC,EAActB,CAAW,EACpD,CAAE,KAAMuB,GAAoBC,EAA2BxB,CAAU,EACjEyB,EAAWC,EAAA,EACXC,EAAoBC,EAAA,EACpB,CAAE,YAAAC,EAAa,OAAAC,GAAWC,EAAqB,oBAAoB,EAEnEC,EAAgBC,GAAoC,OACxD,GAAIA,IAAW,YACT,QAAQ,mDAAmD,GAC7DN,EAAkB,OAAO3B,CAAW,UAE7BiC,IAAW,WAAa5D,EAAW,CAE5C,MAAM6D,EAAS7D,EAAU,YAAY,QAAQ,uBAAwB,EAAE,EAEjEgB,EAAahB,EAAU,OAAO,KAAMiB,GAAMA,EAAE,aAAe,4BAA4B,EACvFC,GAASC,EAAAH,GAAA,YAAAA,EAAY,aAAZ,YAAAG,EAAgC,MAC3CD,GACF,eAAe,QAAQ,oBAAqB,KAAK,UAAUA,CAAK,CAAC,EAEnEkC,EAAS,yBAAyB,mBAAmBS,CAAM,CAAC,WAAW,CACzE,CACF,EAEA,GAAInB,EACF,OACEjC,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACb,SAAA,CAAAd,EAAAA,IAAC,MAAA,CAAI,UAAU,oCAAA,CAAqC,EACpDA,EAAAA,IAAC,MAAA,CAAI,UAAU,gCAAA,CAAiC,CAAA,EAClD,EAIJ,GAAIgD,GAAS,CAAC3C,EAAW,CACvB,MAAM8D,GAAOnB,GAAA,YAAAA,EAAiB,UAAW,GACnCoB,EAAYD,EAAI,SAAS,SAAS,GAAKA,EAAI,SAAS,qBAAqB,EAE/E,cACG,MAAA,CACC,SAAA,CAAAnE,MAACiB,EAAA,CAAK,GAAG,wBAAwB,UAAU,qDAAqD,SAAA,cAEhG,EACAH,EAAAA,KAAC,MAAA,CAAI,UAAU,wBACb,SAAA,CAAAd,EAAAA,IAAC,KAAE,UAAU,iCACV,WACG,wCACAgD,EACE,2BACA,qBAAA,CACR,QACC,IAAA,CAAE,UAAU,6BACV,SAAAoB,EACG,4HACAD,GAAO,qCAAA,CACb,CAAA,CAAA,CACF,CAAA,EACF,CAEJ,CAEA,MAAMrC,EAAYzB,EAAU,SAAW,aAAeA,EAAU,SAAW,SACrE0B,EAAe1B,EAAU,SAAW,aAAeA,EAAU,OAAO,KACvEiB,GAAM,CACL,GAAIA,EAAE,aAAe,0BAA2B,MAAO,GACvD,MAAM+C,EAAW/C,EAAE,WAAmB,cACtC,OAAO+C,IAAY,cAAgBA,IAAY,kBAAoBA,IAAY,gBAAiBA,GAAA,YAAAA,EAAS,WAAW,QACtH,CAAA,EAGF,cACG,MAAA,CACC,SAAA,CAAArE,EAAAA,IAACsE,EAAA,CACC,MAAOxB,EACP,QACEhC,EAAAA,KAAC,MAAA,CAAI,UAAU,0BACb,SAAA,CAAAd,EAAAA,IAACuE,EAAA,CACC,UAAW,IAAMtB,EAAA,EACjB,WAAAC,EACA,QAAS,oBAAoBlB,CAAU,YAAA,CAAA,EAEzChC,EAAAA,IAACmB,EAAA,CAAY,OAAQd,EAAU,MAAA,CAAQ,EACvCL,EAAAA,IAAC6B,EAAA,CACC,UAAAC,EACA,aAAAC,EACA,WAAAC,EACA,SAAUgC,CAAA,CAAA,CACZ,CAAA,CACF,CAAA,CAAA,EAIJhE,EAAAA,IAACI,EAAA,CACC,UAAAC,EACA,KAAAC,EACA,WAAY+C,GAAA,YAAAA,EAAgB,MAC5B,YAAaE,GAAA,YAAAA,EAAiB,WAAA,CAAA,EAG/BI,EAAkB,OACjB3D,EAAAA,IAAC,MAAA,CAAI,UAAU,YACb,SAAAc,EAAAA,KAAC,IAAA,CAAE,UAAU,4BAA4B,SAAA,CAAA,qBACpB6C,EAAkB,MAAM,OAAA,CAAA,CAC7C,CAAA,CACF,EAIF7C,EAAAA,KAAC,MAAA,CAAI,UAAU,YACb,SAAA,CAAAd,MAACwE,GAAmB,MAAM,UAAU,WAAW,UAAU,YAAaX,EAAY,SAAS,EAAG,SAAUC,EAAQ,iBAAiB,YAC/H,SAAA9D,EAAAA,IAACyB,EAAA,CAAqB,UAAApB,EAAsB,EAC9C,EAEAL,EAAAA,IAACwE,EAAA,CAAmB,MAAM,qBAAqB,WAAW,WAAW,YAAaX,EAAY,UAAU,EAAG,SAAUC,EAAQ,iBAAiB,YAC5I,SAAA9D,EAAAA,IAACyE,EAAA,CACC,OAAQpE,EAAU,OAClB,WAAYgD,GAAA,YAAAA,EAAgB,KAAA,CAAA,EAEhC,EAEArD,EAAAA,IAACwE,EAAA,CAAmB,MAAM,SAAS,WAAW,SAAS,YAAaX,EAAY,QAAQ,EAAG,SAAUC,EAAQ,iBAAiB,YAC5H,SAAA9D,EAAAA,IAAC0E,EAAA,CACC,OAAQrE,EAAU,OAClB,WAAYgD,GAAA,YAAAA,EAAgB,KAAA,CAAA,CAC9B,CACF,CAAA,CAAA,CACF,CAAA,EACF,CAEJ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./vendor-query-B2UbickB.js";import{c as d,W as u,S as f,a9 as m}from"./vendor-icons-BNtvBbnj.js";const s=[{text:"text-rose-400",bg:"bg-rose-400/[0.08]"},{text:"text-pink-400",bg:"bg-pink-400/[0.08]"},{text:"text-fuchsia-400",bg:"bg-fuchsia-400/[0.08]"},{text:"text-purple-400",bg:"bg-purple-400/[0.08]"},{text:"text-violet-400",bg:"bg-violet-400/[0.08]"},{text:"text-indigo-400",bg:"bg-indigo-400/[0.08]"},{text:"text-blue-400",bg:"bg-blue-400/[0.08]"},{text:"text-sky-400",bg:"bg-sky-400/[0.08]"},{text:"text-cyan-400",bg:"bg-cyan-400/[0.08]"},{text:"text-teal-400",bg:"bg-teal-400/[0.08]"},{text:"text-emerald-400",bg:"bg-emerald-400/[0.08]"},{text:"text-green-400",bg:"bg-green-400/[0.08]"},{text:"text-lime-400",bg:"bg-lime-400/[0.08]"},{text:"text-yellow-400",bg:"bg-yellow-400/[0.08]"},{text:"text-amber-400",bg:"bg-amber-400/[0.08]"},{text:"text-orange-400",bg:"bg-orange-400/[0.08]"},{text:"text-red-400",bg:"bg-red-400/[0.08]"},{text:"text-stone-400",bg:"bg-stone-400/[0.08]"},{text:"text-rose-300",bg:"bg-rose-300/[0.08]"},{text:"text-violet-300",bg:"bg-violet-300/[0.08]"},{text:"text-sky-300",bg:"bg-sky-300/[0.08]"},{text:"text-teal-300",bg:"bg-teal-300/[0.08]"},{text:"text-amber-300",bg:"bg-amber-300/[0.08]"},{text:"text-pink-300",bg:"bg-pink-300/[0.08]"}];function h(e){let t=0;for(let x=0;x<e.length;x++)t=(t<<5)-t+e.charCodeAt(x)|0;return Math.abs(t)}function k(e){return s[h(e)%s.length]}const y={certified:m,configured:f,pipeline:u,durable:d},C={certified:"text-status-success",configured:"text-status-info"};function I({type:e,size:t="sm",certified:x,variant:r}){const l=t==="md"?"px-2.5 py-0.5 gap-1.5":t==="xs"?"px-1 py-px gap-0.5":"px-1.5 py-px gap-1",a=t==="md"?"13px":t==="xs"?"9px":"11px",i=t==="md"?"w-3.5 h-3.5":t==="xs"?"w-2 h-2":"w-2.5 h-2.5",o=r??(x?"certified":"durable"),c=y[o],b=C[o],g=b?null:k(e),p=b||((g==null?void 0:g.text)??"text-accent/75");return n.jsxs("span",{className:`inline-flex items-center ${l} font-mono text-text-secondary border border-surface-border rounded-lg`,style:{fontSize:a,lineHeight:1.1},children:[n.jsx(c,{className:`${i} shrink-0 ${p}`}),e]})}export{I as W};
|
|
2
|
-
//# sourceMappingURL=WorkflowPill-pPuGH8v9.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowPill-pPuGH8v9.js","sources":["../../src/lib/type-color.ts","../../src/components/common/display/WorkflowPill.tsx"],"sourcesContent":["/**\n * Deterministic color assignment for workflow type names.\n *\n * Maps any string to a consistent color from a curated 24-color palette.\n * The same type name always produces the same color across the entire UI.\n * Uses a simple hash to distribute names evenly across the palette.\n *\n * Each entry provides:\n * text — icon and text color (Tailwind class)\n * bg — subtle background tint (Tailwind class)\n */\n\nconst PALETTE: Array<{ text: string; bg: string }> = [\n { text: 'text-rose-400', bg: 'bg-rose-400/[0.08]' },\n { text: 'text-pink-400', bg: 'bg-pink-400/[0.08]' },\n { text: 'text-fuchsia-400', bg: 'bg-fuchsia-400/[0.08]' },\n { text: 'text-purple-400', bg: 'bg-purple-400/[0.08]' },\n { text: 'text-violet-400', bg: 'bg-violet-400/[0.08]' },\n { text: 'text-indigo-400', bg: 'bg-indigo-400/[0.08]' },\n { text: 'text-blue-400', bg: 'bg-blue-400/[0.08]' },\n { text: 'text-sky-400', bg: 'bg-sky-400/[0.08]' },\n { text: 'text-cyan-400', bg: 'bg-cyan-400/[0.08]' },\n { text: 'text-teal-400', bg: 'bg-teal-400/[0.08]' },\n { text: 'text-emerald-400', bg: 'bg-emerald-400/[0.08]' },\n { text: 'text-green-400', bg: 'bg-green-400/[0.08]' },\n { text: 'text-lime-400', bg: 'bg-lime-400/[0.08]' },\n { text: 'text-yellow-400', bg: 'bg-yellow-400/[0.08]' },\n { text: 'text-amber-400', bg: 'bg-amber-400/[0.08]' },\n { text: 'text-orange-400', bg: 'bg-orange-400/[0.08]' },\n { text: 'text-red-400', bg: 'bg-red-400/[0.08]' },\n { text: 'text-stone-400', bg: 'bg-stone-400/[0.08]' },\n { text: 'text-rose-300', bg: 'bg-rose-300/[0.08]' },\n { text: 'text-violet-300', bg: 'bg-violet-300/[0.08]' },\n { text: 'text-sky-300', bg: 'bg-sky-300/[0.08]' },\n { text: 'text-teal-300', bg: 'bg-teal-300/[0.08]' },\n { text: 'text-amber-300', bg: 'bg-amber-300/[0.08]' },\n { text: 'text-pink-300', bg: 'bg-pink-300/[0.08]' },\n];\n\nfunction hash(str: string): number {\n let h = 0;\n for (let i = 0; i < str.length; i++) {\n h = ((h << 5) - h + str.charCodeAt(i)) | 0;\n }\n return Math.abs(h);\n}\n\nexport function typeColor(typeName: string): { text: string; bg: string } {\n return PALETTE[hash(typeName) % PALETTE.length];\n}\n","import { Workflow, ShieldCheck, Settings, Wand2 } from 'lucide-react';\nimport { typeColor } from '../../../lib/type-color';\n\ntype WorkflowVariant = 'durable' | 'configured' | 'certified' | 'pipeline';\n\ninterface WorkflowPillProps {\n type: string;\n size?: 'xs' | 'sm' | 'md';\n /** @deprecated Use `variant` instead */\n certified?: boolean;\n variant?: WorkflowVariant;\n}\n\nconst VARIANT_ICON: Record<WorkflowVariant, typeof Workflow> = {\n certified: ShieldCheck,\n configured: Settings,\n pipeline: Wand2,\n durable: Workflow,\n};\n\nconst VARIANT_FIXED_COLOR: Record<string, string> = {\n certified: 'text-status-success',\n configured: 'text-status-info',\n};\n\nexport function WorkflowPill({ type, size = 'sm', certified, variant }: WorkflowPillProps) {\n const sizeClass = size === 'md'\n ? 'px-2.5 py-0.5 gap-1.5'\n : size === 'xs'\n ? 'px-1 py-px gap-0.5'\n : 'px-1.5 py-px gap-1';\n const fontSize = size === 'md' ? '13px' : size === 'xs' ? '9px' : '11px';\n const iconClass = size === 'md' ? 'w-3.5 h-3.5' : size === 'xs' ? 'w-2 h-2' : 'w-2.5 h-2.5';\n\n const resolved = variant ?? (certified ? 'certified' : 'durable');\n const Icon = VARIANT_ICON[resolved];\n\n // Pipeline and durable variants get a type-name-derived color.\n // Certified and configured keep their fixed semantic colors.\n const fixedColor = VARIANT_FIXED_COLOR[resolved];\n const derived = fixedColor ? null : typeColor(type);\n const iconColor = fixedColor || (derived?.text ?? 'text-accent/75');\n\n return (\n <span className={`inline-flex items-center ${sizeClass} font-mono text-text-secondary border border-surface-border rounded-lg`} style={{ fontSize, lineHeight: 1.1 }}>\n <Icon className={`${iconClass} shrink-0 ${iconColor}`} />\n {type}\n </span>\n );\n}\n"],"names":["PALETTE","hash","str","h","i","typeColor","typeName","VARIANT_ICON","ShieldCheck","Settings","Wand2","Workflow","VARIANT_FIXED_COLOR","WorkflowPill","type","size","certified","variant","sizeClass","fontSize","iconClass","resolved","Icon","fixedColor","derived","iconColor","jsxs","jsx"],"mappings":"oHAYA,MAAMA,EAA+C,CACnD,CAAE,KAAM,gBAAqB,GAAI,oBAAA,EACjC,CAAE,KAAM,gBAAqB,GAAI,oBAAA,EACjC,CAAE,KAAM,mBAAqB,GAAI,uBAAA,EACjC,CAAE,KAAM,kBAAqB,GAAI,sBAAA,EACjC,CAAE,KAAM,kBAAqB,GAAI,sBAAA,EACjC,CAAE,KAAM,kBAAqB,GAAI,sBAAA,EACjC,CAAE,KAAM,gBAAqB,GAAI,oBAAA,EACjC,CAAE,KAAM,eAAqB,GAAI,mBAAA,EACjC,CAAE,KAAM,gBAAqB,GAAI,oBAAA,EACjC,CAAE,KAAM,gBAAqB,GAAI,oBAAA,EACjC,CAAE,KAAM,mBAAqB,GAAI,uBAAA,EACjC,CAAE,KAAM,iBAAqB,GAAI,qBAAA,EACjC,CAAE,KAAM,gBAAqB,GAAI,oBAAA,EACjC,CAAE,KAAM,kBAAqB,GAAI,sBAAA,EACjC,CAAE,KAAM,iBAAqB,GAAI,qBAAA,EACjC,CAAE,KAAM,kBAAqB,GAAI,sBAAA,EACjC,CAAE,KAAM,eAAqB,GAAI,mBAAA,EACjC,CAAE,KAAM,iBAAqB,GAAI,qBAAA,EACjC,CAAE,KAAM,gBAAqB,GAAI,oBAAA,EACjC,CAAE,KAAM,kBAAqB,GAAI,sBAAA,EACjC,CAAE,KAAM,eAAqB,GAAI,mBAAA,EACjC,CAAE,KAAM,gBAAqB,GAAI,oBAAA,EACjC,CAAE,KAAM,iBAAqB,GAAI,qBAAA,EACjC,CAAE,KAAM,gBAAqB,GAAI,oBAAA,CACnC,EAEA,SAASC,EAAKC,EAAqB,CACjC,IAAIC,EAAI,EACR,QAASC,EAAI,EAAGA,EAAIF,EAAI,OAAQE,IAC9BD,GAAMA,GAAK,GAAKA,EAAID,EAAI,WAAWE,CAAC,EAAK,EAE3C,OAAO,KAAK,IAAID,CAAC,CACnB,CAEO,SAASE,EAAUC,EAAgD,CACxE,OAAON,EAAQC,EAAKK,CAAQ,EAAIN,EAAQ,MAAM,CAChD,CCpCA,MAAMO,EAAyD,CAC7D,UAAYC,EACZ,WAAYC,EACZ,SAAYC,EACZ,QAAYC,CACd,EAEMC,EAA8C,CAClD,UAAY,sBACZ,WAAY,kBACd,EAEO,SAASC,EAAa,CAAE,KAAAC,EAAM,KAAAC,EAAO,KAAM,UAAAC,EAAW,QAAAC,GAA8B,CACzF,MAAMC,EAAYH,IAAS,KACvB,wBACAA,IAAS,KACP,qBACA,qBACAI,EAAWJ,IAAS,KAAO,OAASA,IAAS,KAAO,MAAQ,OAC5DK,EAAYL,IAAS,KAAO,cAAgBA,IAAS,KAAO,UAAY,cAExEM,EAAWJ,IAAYD,EAAY,YAAc,WACjDM,EAAOf,EAAac,CAAQ,EAI5BE,EAAaX,EAAoBS,CAAQ,EACzCG,EAAUD,EAAa,KAAOlB,EAAUS,CAAI,EAC5CW,EAAYF,KAAeC,GAAA,YAAAA,EAAS,OAAQ,kBAElD,OACEE,EAAAA,KAAC,OAAA,CAAK,UAAW,4BAA4BR,CAAS,yEAA0E,MAAO,CAAE,SAAAC,EAAU,WAAY,GAAA,EAC7J,SAAA,CAAAQ,MAACL,GAAK,UAAW,GAAGF,CAAS,aAAaK,CAAS,GAAI,EACtDX,CAAA,EACH,CAEJ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u,j as s}from"./vendor-query-B2UbickB.js";import{T as h}from"./TimestampCell-CYFbEhqc.js";import{E as D}from"./ElapsedCell-B79BF5Mj.js";import{u as R,e as z,b as E}from"./workflows-Bf4_w24H.js";import{i as W}from"./index-DcpCR9c_.js";import{b as A}from"./useEventHooks-CkJOmbF-.js";import{u as L}from"./useFilterParams-DZCAaBC7.js";import{D as M}from"./DataTable-D9yuBv0w.js";import{W as I}from"./WorkflowPill-pPuGH8v9.js";import{P as U}from"./PageHeader-Bo0SpcCK.js";import{F as O,b as f}from"./FilterBar-Ck4K4rzu.js";import{S as B}from"./StickyPagination-F9FZsRy9.js";import{L as H}from"./ListToolbar-Bntl2hex.js";import{R as G,a as w}from"./RowActions-Dg-Fsm5O.js";import{r as J,S as V}from"./vendor-icons-BNtvBbnj.js";import{c as q}from"./vendor-react-CX88sFS5.js";import"./EmptyState-BcsfPq9T.js";const K={running:"in_progress",completed:"completed",failed:"failed"},Q={in_progress:"bg-status-active",completed:"bg-status-success",failed:"bg-status-error"},X={running:"text-status-active",completed:"text-status-success",failed:"text-status-error"};function Y(d,n,p,a,r){return[{key:"workflow_id",label:"Workflow ID / Type",render:e=>{const o=Q[K[e.status]??e.status]??"bg-status-pending",m=e.status==="running"?" animate-pulse":"";return s.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[s.jsx("span",{className:`w-1.5 h-1.5 shrink-0 rounded-full mt-1.5 ${o}${m}`,title:e.status}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"font-mono text-xs text-text-primary truncate block",children:e.workflow_id}),s.jsx("div",{className:"mt-0.5",children:s.jsx(I,{type:e.entity,variant:r.get(e.entity)??"durable",size:"xs"})})]})]})}},{key:"created_at",label:"Created",render:e=>s.jsx(h,{date:e.created_at}),className:"w-40",sortable:!0},{key:"updated_at",label:"Updated",render:e=>s.jsx(h,{date:e.updated_at}),className:"w-40",sortable:!0},{key:"duration",label:"Duration",render:e=>s.jsx(D,{startDate:e.created_at,endDate:e.status==="running"?null:e.updated_at,isLive:e.status==="running"}),className:"w-28"},{key:"actions",label:"",render:e=>s.jsxs(G,{children:[s.jsx(w,{icon:J,title:`Filter by ${e.entity}`,onClick:()=>d(e.entity)}),s.jsx("button",{onClick:o=>{o.stopPropagation(),n(e.status)},className:"opacity-0 group-hover/row:opacity-100 transition-opacity",title:`Filter by ${e.status}`,children:s.jsx("svg",{className:`w-[18px] h-[18px] ${X[e.status]??"text-text-tertiary"} hover:opacity-70`,viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("circle",{cx:"12",cy:"12",r:"6"})})}),p&&s.jsx(w,{icon:V,title:"View config",onClick:()=>a(`/workflows/registry/${encodeURIComponent(e.entity)}`)})]}),className:"w-24 text-right"}]}function xe({tier:d="all"}){A();const n=q(),{isSuperAdmin:p}=W(),{filters:a,setFilter:r,pagination:e,sort:o,setSort:m}=L({filters:{search:"",entity:"",status:"",tier:d}}),l=a.tier||"all",v=l==="certified"?"true":l==="durable"?"false":void 0,{data:g}=R(),{data:x}=z(),k=u.useMemo(()=>{const t=new Map;for(const y of x??[])t.set(y.workflow_type,y.tier??"durable");return t},[x]),j=Y(t=>r("entity",t),t=>r("status",t),p,n,k),[c,S]=u.useState(a.search);u.useEffect(()=>{if(c===a.search)return;const t=setTimeout(()=>r("search",c),300);return()=>clearTimeout(t)},[c,r,a.search]);const{data:i,isLoading:C,refetch:_,isFetching:$}=E({limit:e.pageSize,offset:e.offset,entity:a.entity||void 0,search:a.search||void 0,status:a.status||void 0,sort_by:o.sort_by||void 0,order:o.sort_by?o.order:void 0,registered:v}),b=(i==null?void 0:i.total)??0,N=(i==null?void 0:i.jobs)??[],T=u.useMemo(()=>[...new Set((g??[]).map(t=>t.workflow_type))].sort(),[g]),P="Durable Executions",F=l==="certified"?"No certified workflow executions found":l==="durable"?"No durable workflow executions found":"No workflow executions found";return s.jsxs("div",{children:[s.jsx(U,{title:P,docsHash:"#docs:dashboard.md:durable-executions"}),s.jsxs(O,{actions:s.jsx(H,{onRefresh:()=>_(),isFetching:$,apiPath:`/workflow-states/jobs?limit=${e.pageSize}&offset=${e.offset}${a.entity?`&entity=${a.entity}`:""}${a.search?`&search=${a.search}`:""}${a.status?`&status=${a.status}`:""}${o.sort_by?`&sort_by=${o.sort_by}&order=${o.order}`:""}`}),children:[s.jsx("input",{type:"text",placeholder:"Search workflow ID...",value:c,onChange:t=>S(t.target.value),className:"input text-[11px] py-1 px-2 w-56"}),s.jsx(f,{label:"Type",value:a.entity,onChange:t=>r("entity",t),options:T.map(t=>({value:t,label:t}))}),s.jsx(f,{label:"Status",value:a.status,onChange:t=>r("status",t),options:[{value:"running",label:"Running"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}]}),s.jsx(f,{label:"Tier",value:a.tier==="all"?"":a.tier,onChange:t=>r("tier",t||"all"),options:[{value:"certified",label:"Certified"},{value:"durable",label:"Durable"}]})]}),s.jsx(M,{columns:j,data:N,keyFn:t=>t.workflow_id,onRowClick:t=>n(`/workflows/executions/${t.workflow_id}`),isLoading:C,emptyMessage:F,sort:o,onSort:m}),s.jsx(B,{page:e.page,totalPages:e.totalPages(b),onPageChange:e.setPage,total:b,pageSize:e.pageSize,onPageSizeChange:e.setPageSize})]})}export{xe as WorkflowsDashboard};
|
|
2
|
-
//# sourceMappingURL=WorkflowsDashboard-_LMWc-OC.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as x,j as t}from"./vendor-query-B2UbickB.js";import{b as C,u as k}from"./workflows-Bf4_w24H.js";import{b as $}from"./useEventHooks-CkJOmbF-.js";import{P as D}from"./PageHeader-Bo0SpcCK.js";import{S as h}from"./StatCard-DlgF0CJC.js";import{c as w}from"./vendor-react-CX88sFS5.js";import"./index-DcpCR9c_.js";import"./vendor-icons-BNtvBbnj.js";const v=[{label:"1h",ms:36e5},{label:"24h",ms:864e5},{label:"7d",ms:6048e5},{label:"30d",ms:2592e6}];function T(r){return r<1e3?`${Math.round(r)}ms`:r<6e4?`${(r/1e3).toFixed(1)}s`:r<36e5?`${(r/6e4).toFixed(1)}m`:`${(r/36e5).toFixed(1)}h`}function p({value:r,colorClass:o,onClick:f}){return r===0?t.jsx("span",{className:"text-text-tertiary",children:"0"}):t.jsx("button",{onClick:f,className:`${o} hover:underline tabular-nums font-medium`,children:r})}function _(){$();const r=w(),[o,f]=x.useState("24h"),{data:c}=C({limit:500}),{data:g}=k(),b=x.useMemo(()=>{const e=v.find(i=>i.label===o);return Date.now()-e.ms},[o]),n=x.useMemo(()=>((c==null?void 0:c.jobs)??[]).filter(e=>new Date(e.created_at).getTime()>=b),[c==null?void 0:c.jobs,b]),j=x.useMemo(()=>{const e=new Map;for(const a of n){const s=e.get(a.entity)??{total:0,running:0,completed:0,failed:0,durations:[]};if(s.total++,a.status==="running"&&s.running++,a.status==="completed"){s.completed++;const m=new Date(a.updated_at).getTime()-new Date(a.created_at).getTime();m>0&&s.durations.push(m)}a.status==="failed"&&s.failed++,e.set(a.entity,s)}const i=[];for(const[a,s]of e)i.push({type:a,...s,avgDuration:s.durations.length>0?s.durations.reduce((m,N)=>m+N,0)/s.durations.length:null});return i.sort((a,s)=>s.total-a.total)},[n]),u=x.useMemo(()=>({total:n.length,running:n.filter(e=>e.status==="running").length,completed:n.filter(e=>e.status==="completed").length,failed:n.filter(e=>e.status==="failed").length}),[n]),y=(g==null?void 0:g.length)??0,l=(e,i)=>{const a=new URLSearchParams;e&&a.set("entity",e),i&&a.set("status",i);const s=a.toString();r(`/workflows/executions${s?`?${s}`:""}`)},d="pb-2 text-[10px] font-semibold uppercase tracking-widest text-text-tertiary";return t.jsxs("div",{children:[t.jsx(D,{title:"Workflows",actions:t.jsxs("span",{className:"text-xs text-text-tertiary",children:[y," certified type",y!==1?"s":""]})}),t.jsx("div",{className:"flex items-center gap-1 mb-6",children:v.map(e=>t.jsx("button",{onClick:()=>f(e.label),className:`px-3 py-1 text-xs rounded-full transition-colors ${o===e.label?"bg-accent text-text-inverse":"text-text-tertiary hover:text-text-primary hover:bg-surface-hover"}`,children:e.label},e.label))}),t.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[t.jsx(h,{label:"Total",value:u.total,onClick:()=>l()}),t.jsx(h,{label:"Running",value:u.running,colorClass:"text-status-active",onClick:()=>l(void 0,"running")}),t.jsx(h,{label:"Completed",value:u.completed,colorClass:"text-status-success",onClick:()=>l(void 0,"completed")}),t.jsx(h,{label:"Failed",value:u.failed,colorClass:"text-status-error",onClick:()=>l(void 0,"failed")})]}),j.length>0&&t.jsxs("table",{className:"w-full text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-surface-border",children:[t.jsx("th",{className:d,children:"Type"}),t.jsx("th",{className:`${d} text-right w-20`,children:"Total"}),t.jsx("th",{className:`${d} text-right w-20`,children:"Running"}),t.jsx("th",{className:`${d} text-right w-24`,children:"Completed"}),t.jsx("th",{className:`${d} text-right w-20`,children:"Failed"}),t.jsx("th",{className:`${d} text-right w-28`,children:"Avg Duration"})]})}),t.jsx("tbody",{children:j.map(e=>t.jsxs("tr",{className:"border-b border-surface-border last:border-b-0",children:[t.jsx("td",{className:"py-3 text-sm font-mono text-text-primary",children:t.jsx("button",{onClick:()=>l(e.type),className:"hover:text-accent hover:underline",children:e.type})}),t.jsx("td",{className:"py-3 text-sm text-right",children:t.jsx(p,{value:e.total,colorClass:"text-text-secondary",onClick:()=>l(e.type)})}),t.jsx("td",{className:"py-3 text-sm text-right",children:t.jsx(p,{value:e.running,colorClass:"text-status-active",onClick:()=>l(e.type,"running")})}),t.jsx("td",{className:"py-3 text-sm text-right",children:t.jsx(p,{value:e.completed,colorClass:"text-status-success",onClick:()=>l(e.type,"completed")})}),t.jsx("td",{className:"py-3 text-sm text-right",children:t.jsx(p,{value:e.failed,colorClass:"text-status-error",onClick:()=>l(e.type,"failed")})}),t.jsx("td",{className:"py-3 text-sm font-mono text-text-secondary text-right",children:e.avgDuration!==null?T(e.avgDuration):"—"})]},e.type))})]}),j.length===0&&t.jsx("div",{className:"py-16 text-center",children:t.jsxs("p",{className:"text-sm text-text-tertiary",children:["No workflow activity in the last ",o]})})]})}export{_ as WorkflowsOverview};
|
|
2
|
-
//# sourceMappingURL=WorkflowsOverview-DFrfw554.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as x,j as e}from"./vendor-query-B2UbickB.js";import{l as W,n as z,o as $,u as F}from"./yaml-workflows-Cp1N0NMK.js";import{a as q,d as Y}from"./useYamlActivityEvents-CSMX9He5.js";import{u as B}from"./useFilterParams-DZCAaBC7.js";import{u as D}from"./useExpandedRows-CkcEntB-.js";import{P}from"./PageHeader-Bo0SpcCK.js";import{F as V,a as H,b as O}from"./FilterBar-Ck4K4rzu.js";import{E as U}from"./EmptyState-BcsfPq9T.js";import{R as J}from"./RunAsSelector-DC4SLtTq.js";import{b as A,T as G}from"./ToolPill-RP2Tvlrx.js";import{X as L,a3 as X,aa as K,P as T,m as Q,ab as Z,a4 as ee,W as te}from"./vendor-icons-BNtvBbnj.js";import{L as se,c as re}from"./vendor-react-CX88sFS5.js";import{S as w}from"./index-DcpCR9c_.js";import{d as M,C as ae}from"./helpers-BngVEys5.js";import{S as E}from"./StatusBadge-XQlNFwmH.js";import{S as ne}from"./ServerName-CEOFF7UG.js";import"./BotPicker-CM-_u73k.js";import"./bots-BzEs6Q9L.js";import"./TimeAgo-CttiZG0k.js";const I={mcp:{border:"border-blue-500",text:"text-blue-500",icon:"MCP"},db:{border:"border-blue-500",text:"text-blue-500",icon:"DB"},llm:{border:"border-violet-500",text:"text-violet-500",icon:"LLM"},transform:{border:"border-emerald-500",text:"text-emerald-500",icon:"Map"}};function oe({steps:t,manifest:i,isComplete:r}){const a=i.filter(s=>s.type==="worker"),u=a.length,o=a.map(s=>{const l=t.find(d=>d.activityId===s.activity_id),p=s.tool_source||"mcp",f=I[p]||I.mcp;return{activityId:s.activity_id,title:s.title||s.mcp_tool_name||s.activity_id,toolName:s.mcp_tool_name,colors:f,status:(l==null?void 0:l.status)||"pending",error:l==null?void 0:l.error}});return e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] text-text-secondary mb-3",children:r?`All ${u} steps completed`:`Running step ${o.filter(s=>s.status==="completed").length+1} of ${u}...`}),e.jsx("div",{className:"space-y-0",children:o.map((s,l)=>{const p=l===o.length-1;return e.jsxs("div",{className:"flex items-stretch gap-2",children:[e.jsxs("div",{className:"flex flex-col items-center w-4 shrink-0",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full shrink-0 border-2 transition-colors ${s.status==="completed"?"bg-status-success border-status-success":s.status==="running"?`${s.colors.border} bg-transparent animate-pulse`:s.status==="failed"?"bg-status-error border-status-error":"bg-surface-sunken border-surface-border"}`}),!p&&e.jsx("span",{className:`w-px flex-1 transition-colors ${s.status==="completed"?"bg-status-success/30":"bg-surface-border"}`})]}),e.jsxs("div",{className:p?"":"pb-3",children:[e.jsx("p",{className:`text-[11px] font-medium ${s.status==="running"?"text-text-primary":s.status==="completed"?"text-text-secondary":s.status==="failed"?"text-status-error":"text-text-tertiary"}`,children:s.title}),s.toolName&&e.jsx("span",{className:"text-[9px] text-text-tertiary font-mono",children:s.toolName}),s.error&&e.jsx("p",{className:"text-[9px] text-status-error mt-0.5",children:s.error})]})]},s.activityId)})})]})}function ie({workflow:t,onClose:i}){const r=W(),[a,u]=x.useState(!1),[o,s]=x.useState({}),[l,p]=x.useState(""),[f,d]=x.useState(""),[m,j]=x.useState(""),[b,N]=x.useState(null),[v,y]=x.useState(null),{steps:k,isComplete:n}=q(b);x.useEffect(()=>{N(null),y(null),d(""),r.reset();const h=A(t.input_schema);s(h),p(JSON.stringify(h,null,2)),u(!1)},[t.id]),x.useEffect(()=>{if(n&&b){const h=b,g=setTimeout(()=>{y({jobId:h}),N(null)},800);return()=>clearTimeout(g)}},[n,b]);const c=()=>{if(!a)p(JSON.stringify(o,null,2));else try{s(JSON.parse(l))}catch{}u(!a)},S=async()=>{d(""),y(null);let h;if(a)try{h=JSON.parse(l)}catch{d("Invalid JSON");return}else h={...o};try{const g=await r.mutateAsync({id:t.id,data:h,sync:!1,...m?{execute_as:m}:{}});g.job_id&&N(g.job_id)}catch{}},_=!!b,R=t.app_id||"longtail";return e.jsxs("div",{className:"border-l border-surface-border bg-surface-raised flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border shrink-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-text-primary truncate",children:t.app_id}),e.jsx("code",{className:"text-[11px] font-mono text-accent truncate block",children:t.graph_topic})]}),e.jsx("button",{onClick:()=>{_||i()},className:"p-1 text-text-tertiary hover:text-text-primary shrink-0 ml-2",children:e.jsx(L,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-4",children:_?e.jsx(oe,{steps:k,manifest:t.activity_manifest,isComplete:n}):v?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-status-success",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("p",{className:"text-xs font-medium text-status-success",children:"Workflow completed"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(se,{to:`/mcp/executions/${encodeURIComponent(v.jobId)}?namespace=${encodeURIComponent(R)}`,className:"inline-flex items-center gap-1.5 text-xs text-accent hover:underline",children:[e.jsx(X,{size:12})," View execution"]}),e.jsxs("button",{onClick:()=>y(null),className:"btn-primary text-xs inline-flex items-center gap-1.5",children:[e.jsx(K,{size:12})," Run again"]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{selected:m,onChange:j}),t.description&&e.jsx("p",{className:"text-[11px] text-text-secondary leading-relaxed",children:t.description}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("label",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:"Input"}),e.jsx("button",{onClick:c,className:"text-[10px] text-accent hover:underline",children:a?"Form view":"JSON view"})]}),a?e.jsx("textarea",{value:l,onChange:h=>p(h.target.value),className:"w-full bg-surface-sunken border border-surface-border rounded-md px-3 py-2 font-mono text-[11px] text-text-primary focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent-primary resize-y",rows:6,spellCheck:!1}):e.jsxs("div",{className:"space-y-3 max-h-[300px] overflow-y-auto",children:[Object.entries(o).map(([h,g])=>e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:h}),typeof g=="boolean"?e.jsxs("select",{value:String(g),onChange:C=>s({...o,[h]:C.target.value==="true"}),className:"w-full bg-surface-sunken border border-surface-border rounded-md px-3 py-1.5 text-xs text-text-primary focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent-primary",children:[e.jsx("option",{value:"true",children:"true"}),e.jsx("option",{value:"false",children:"false"})]}):typeof g=="object"?e.jsx("textarea",{value:JSON.stringify(g,null,2),onChange:C=>{try{s({...o,[h]:JSON.parse(C.target.value)})}catch{}},className:"w-full min-h-[60px] px-3 py-1.5 bg-surface-sunken border border-surface-border rounded-md font-mono text-xs text-text-primary resize-y focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent-primary"}):e.jsx("input",{type:typeof g=="number"?"number":"text",value:String(g??""),onChange:C=>s({...o,[h]:typeof g=="number"?Number(C.target.value):C.target.value}),className:"w-full bg-surface-sunken border border-surface-border rounded-md px-3 py-1.5 text-xs text-text-primary focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent-primary"})]},h)),Object.keys(o).length===0&&e.jsx("p",{className:"text-[11px] text-text-tertiary italic",children:"No input fields defined"})]}),f&&e.jsx("p",{className:"text-[11px] text-status-error mt-1",children:f})]}),r.isError&&e.jsx("div",{className:"bg-status-error/10 border border-status-error/20 rounded-md px-3 py-2",children:e.jsx("p",{className:"text-[11px] text-status-error",children:r.error instanceof Error?r.error.message:"Invocation failed"})}),e.jsx("button",{onClick:S,disabled:r.isPending,className:"btn-primary text-xs disabled:opacity-50 inline-flex items-center gap-1.5",children:r.isPending?"Starting...":e.jsxs(e.Fragment,{children:[e.jsx(T,{size:12})," Run"]})})]})})]})}function ce({cronInput:t,setCronInput:i,setCron:r,hasCronSchedule:a,onSave:u,onClear:o}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx(w,{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:t,onChange:s=>{i(s.target.value),r.reset()},placeholder:"0 */6 * * *",className:"input-json w-full"}),t.trim()&&M(t.trim())&&e.jsx("p",{className:"text-xs text-text-secondary mt-1.5",children:M(t.trim())})]}),e.jsx("button",{onClick:u,disabled:r.isPending,className:"btn-primary text-xs shrink-0",children:r.isPending?"Saving...":"Save"}),a&&e.jsx("button",{onClick:o,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(w,{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:ae.map(([s,l])=>e.jsxs("button",{type:"button",onClick:()=>{i(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:l})]},s))})]})]})}function le({workflow:t,onClose:i}){const r=z(),a=$(),[u,o]=x.useState(""),[s,l]=x.useState(""),[p,f]=x.useState(!1),[d,m]=x.useState({}),[j,b]=x.useState("{}");x.useEffect(()=>{o(t.cron_schedule??""),l(t.execute_as??""),r.reset(),a.reset();const n=t.cron_envelope||{},c=Object.keys(n).length>0?n:A(t.input_schema);m(c),b(JSON.stringify(c,null,2)),f(!1)},[t.id]);const N=()=>{if(!p)b(JSON.stringify(d,null,2));else try{m(JSON.parse(j))}catch{}f(!p)},v=()=>{let n;if(p)try{n=JSON.parse(j)}catch{return}else n={...d};r.mutate({id:t.id,cron_schedule:u.trim(),cron_envelope:Object.keys(n).length>0?n:null,execute_as:s||null})},y=()=>{a.mutate(t.id,{onSuccess:()=>{o("")}})},k={isPending:r.isPending||a.isPending,isSuccess:r.isSuccess||a.isSuccess,error:r.error||a.error,reset:()=>{r.reset(),a.reset()}};return e.jsxs("div",{className:"border-l border-surface-border bg-surface-raised flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-surface-border shrink-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-text-primary truncate",children:"Cron Schedule"}),e.jsx("code",{className:"text-[11px] font-mono text-accent truncate block",children:t.graph_topic})]}),e.jsx("button",{onClick:i,className:"p-1 text-text-tertiary hover:text-text-primary shrink-0 ml-2",children:e.jsx(L,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-4",children:[e.jsx(J,{selected:s,onChange:l}),e.jsx(ce,{cronInput:u,setCronInput:o,setCron:k,hasCronSchedule:!!t.cron_schedule,onSave:v,onClear:y}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx(w,{children:"Default Input"}),e.jsx("button",{onClick:N,className:"text-[10px] text-accent hover:underline",children:p?"Form view":"JSON view"})]}),p?e.jsx("textarea",{value:j,onChange:n=>b(n.target.value),className:"w-full bg-surface-sunken border border-surface-border rounded-md px-3 py-2 font-mono text-[11px] text-text-primary focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent-primary resize-y",rows:6,spellCheck:!1}):e.jsxs("div",{className:"space-y-3 max-h-[200px] overflow-y-auto",children:[Object.entries(d).map(([n,c])=>e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:n}),typeof c=="boolean"?e.jsxs("select",{value:String(c),onChange:S=>m({...d,[n]:S.target.value==="true"}),className:"w-full bg-surface-sunken border border-surface-border rounded-md px-3 py-1.5 text-xs text-text-primary focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent-primary",children:[e.jsx("option",{value:"true",children:"true"}),e.jsx("option",{value:"false",children:"false"})]}):typeof c=="object"?e.jsx("textarea",{value:JSON.stringify(c,null,2),onChange:S=>{try{m({...d,[n]:JSON.parse(S.target.value)})}catch{}},className:"w-full min-h-[60px] px-3 py-1.5 bg-surface-sunken border border-surface-border rounded-md font-mono text-xs text-text-primary resize-y focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent-primary"}):e.jsx("input",{type:typeof c=="number"?"number":"text",value:String(c??""),onChange:S=>m({...d,[n]:typeof c=="number"?Number(S.target.value):S.target.value}),className:"w-full bg-surface-sunken border border-surface-border rounded-md px-3 py-1.5 text-xs text-text-primary focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent-primary"})]},n)),Object.keys(d).length===0&&e.jsx("p",{className:"text-[11px] text-text-tertiary italic",children:"No input fields defined"})]})]})]})]})}function de(t){const i=new Map;for(const r of t){const a=i.get(r.app_id)??[];a.push(r),i.set(r.app_id,a)}return[...i.entries()].map(([r,a])=>{var f;const u={active:0,deployed:1,draft:2,archived:3},o=a.reduce((d,m)=>(u[m.status]??9)<(u[d]??9)?m.status:d,a[0].status),s=a.reduce((d,m)=>m.updated_at>d?m.updated_at:d,a[0].updated_at),l=a.reduce((d,m)=>{const j=parseInt(m.app_version||"0",10);return j>d?j:d},0),p=((f=a.find(d=>d.set_id))==null?void 0:f.set_id)||null;return{appId:r,workflows:a,toolCount:a.length,status:o,updatedAt:s,appVersion:String(l),setId:p}})}function ue(t,i){if(!i)return!0;const r=i.toLowerCase();return t.appId.toLowerCase().includes(r)?!0:t.workflows.some(a=>{var u,o;return a.graph_topic.toLowerCase().includes(r)||((u=a.name)==null?void 0:u.toLowerCase().includes(r))||((o=a.description)==null?void 0:o.toLowerCase().includes(r))})}function xe(t,i){if(!i)return t;const r=i.toLowerCase();return t.filter(a=>{var u,o;return a.graph_topic.toLowerCase().includes(r)||((u=a.name)==null?void 0:u.toLowerCase().includes(r))||((o=a.description)==null?void 0:o.toLowerCase().includes(r))})}function pe({wf:t,onTry:i,onCron:r}){const a=t.status==="active",u=!!t.cron_schedule;return e.jsxs("tr",{onClick:a?i:void 0,className:`group/row hover:bg-surface-hover/50 transition-colors border-b border-surface-border/15 ${a?"cursor-pointer":""}`,children:[e.jsxs("td",{className:"pl-14 pr-6 py-2.5",children:[e.jsx(G,{name:t.graph_topic,size:"md"}),t.description&&e.jsx("p",{className:"text-[11px] leading-snug text-text-quaternary mt-0.5",children:t.description})]}),e.jsxs("td",{className:"px-4 py-2.5 w-20 text-[10px] text-text-quaternary font-mono whitespace-nowrap",children:["v",t.content_version]}),e.jsx("td",{className:"px-4 py-2.5 w-28 whitespace-nowrap",children:e.jsx(E,{status:t.status})}),e.jsx("td",{className:"px-4 py-2.5 w-16",children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[a&&e.jsx("button",{onClick:o=>{o.stopPropagation(),i()},className:"opacity-0 group-hover/row:opacity-100 transition-opacity text-text-tertiary hover:text-accent",title:"Test tool",children:e.jsx(T,{className:"w-3.5 h-3.5",strokeWidth:1.5})}),e.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:u?"text-status-success":"opacity-0 group-hover/row:opacity-100 transition-opacity text-text-tertiary hover:text-accent",title:u?`Cron: ${t.cron_schedule}`:"Schedule cron",children:e.jsx(ee,{className:"w-3.5 h-3.5",strokeWidth:1.5})})]})})]})}function me({server:t,expanded:i,onToggle:r,onTryTool:a,onWorkbench:u,onCron:o,visibleTools:s}){return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:r,className:"group/row border-b border-surface-border/50 transition-colors duration-100 cursor-pointer row-hover",children:[e.jsx("td",{className:"px-6 py-2.5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`transition-transform duration-150 ${i?"rotate-90":""} text-text-tertiary`,children:e.jsx(Q,{size:14})}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(ne,{name:t.appId,short:!1}),e.jsx("sup",{className:"text-[9px] font-normal text-accent/70",children:t.toolCount})]})]})}),e.jsxs("td",{className:"px-4 py-2.5 text-[10px] text-text-quaternary font-mono whitespace-nowrap",children:["v",t.appVersion]}),e.jsx("td",{className:"px-4 py-2.5 whitespace-nowrap",children:e.jsx(E,{status:t.status})}),e.jsx("td",{className:"px-4 py-2.5 w-16",children:e.jsx("div",{className:"flex items-center justify-end gap-1.5",children:t.setId&&e.jsx("button",{onClick:l=>{l.stopPropagation(),u()},className:"opacity-0 group-hover/row:opacity-100 transition-opacity text-text-tertiary hover:text-accent",title:"Open workbench",children:e.jsx(Z,{className:"w-3.5 h-3.5",strokeWidth:1.5})})})})]}),i&&s.map(l=>e.jsx(pe,{wf:l,onTry:()=>a(l),onCron:()=>o(l)},l.id))]})}function Le(){const t=re(),{filters:i,setFilter:r}=B({filters:{status:"",server:"",search:""}}),{data:a,isLoading:u}=F({status:i.status||void 0,app_id:i.server||void 0,search:i.search||void 0,limit:200,offset:0}),o=(a==null?void 0:a.workflows)??[],{data:s}=Y({limit:100}),l=x.useMemo(()=>{const n=new Map;for(const c of(s==null?void 0:s.sets)??[])c.source_workflow_id&&n.set(c.id,c.source_workflow_id);return n},[s==null?void 0:s.sets]),p=x.useMemo(()=>de(o),[o]),f=x.useMemo(()=>[...new Set(o.map(c=>c.app_id))].sort().map(c=>({value:c,label:c})),[o]),d=x.useMemo(()=>i.search?p.filter(n=>ue(n,i.search)):p,[p,i.search]),{expandedIds:m,toggle:j}=D("lt:expanded:yaml-workflows"),[b,N]=x.useState(null),[v,y]=x.useState(null),k=b||v;return u?e.jsxs("div",{children:[e.jsx(P,{title:"MCP Pipeline Tools",docsHash:"#docs:dashboard.md:mcp-pipeline-tools"}),e.jsx("div",{className:"animate-pulse space-y-0",children:Array.from({length:4}).map((n,c)=>e.jsx("div",{className:"h-14 border-b last:border-b-0 px-6 flex items-center",children:e.jsx("div",{className:"h-3 bg-surface-sunken rounded w-full"})},c))})]}):e.jsxs("div",{children:[e.jsx(P,{title:"MCP Pipeline Tools",docsHash:"#docs:dashboard.md:mcp-pipeline-tools",actions:e.jsx("button",{onClick:()=>t("/mcp/queries/new"),className:"btn-primary text-xs",children:"Design Pipeline"})}),e.jsx("p",{className:"text-sm text-text-secondary mb-6 max-w-2xl leading-relaxed",children:"Deterministic tools compiled from dynamic MCP executions. Each tool is a YAML DAG that the router discovers and invokes automatically."}),e.jsxs(V,{children:[e.jsx(H,{label:"Search",value:i.search,onChange:n=>r("search",n),placeholder:"Server or tool name…"}),f.length>1&&e.jsx(O,{label:"Server",value:i.server,onChange:n=>r("server",n),options:f}),e.jsx(O,{label:"Status",value:i.status,onChange:n=>r("status",n),options:[{value:"draft",label:"Draft"},{value:"deployed",label:"Deployed"},{value:"active",label:"Active"},{value:"archived",label:"Archived"}]})]}),e.jsxs("div",{className:"flex gap-0",children:[e.jsx("div",{className:`${k?"flex-1 min-w-0":"w-full"} transition-all`,children:d.length===0?e.jsx("div",{className:"cursor-pointer",onClick:()=>t("/mcp/queries/new"),children:e.jsx(U,{icon:te,title:"No pipelines yet",description:"Click to open the MCP Tool Designer and create your first deterministic tool."})}):e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"sticky top-[2.75rem] z-10 bg-surface px-6 py-3 text-left text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:"Server / Tool"}),e.jsx("th",{className:"sticky top-[2.75rem] z-10 bg-surface px-4 py-3 text-left text-[10px] font-semibold uppercase tracking-widest text-text-tertiary w-20",children:"Version"}),e.jsx("th",{className:"sticky top-[2.75rem] z-10 bg-surface px-4 py-3 text-left text-[10px] font-semibold uppercase tracking-widest text-text-tertiary w-28",children:"Status"}),e.jsx("th",{className:"sticky top-[2.75rem] z-10 bg-surface w-16"})]})}),e.jsx("tbody",{children:d.map(n=>e.jsx(me,{server:n,expanded:m.has(n.appId),onToggle:()=>j(n.appId),onTryTool:c=>{y(null),N(c)},onWorkbench:()=>{if(n.setId){const c=l.get(n.setId);c&&t(`/mcp/queries/${c}?mode=plan&set_id=${n.setId}&step=2`)}},onCron:c=>{N(null),y(c)},visibleTools:xe(n.workflows,i.search)},n.appId))})]})}),b&&e.jsx("div",{className:"w-[380px] shrink-0 sticky top-0 max-h-screen overflow-y-auto",children:e.jsx(ie,{workflow:b,onClose:()=>N(null)})}),v&&e.jsx("div",{className:"w-[380px] shrink-0 sticky top-0 max-h-screen overflow-y-auto",children:e.jsx(le,{workflow:v,onClose:()=>y(null)})})]})]})}export{Le as YamlWorkflowsPage};
|
|
2
|
-
//# sourceMappingURL=YamlWorkflowsPage-CZzGwfol.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a,j as r}from"./vendor-query-B2UbickB.js";import{v as l,w as c,x as m}from"./index-DcpCR9c_.js";const n=[{maxMs:0,color:"text-status-error"},{maxMs:300*1e3,color:"text-status-error"},{maxMs:900*1e3,color:"text-status-warning"},{maxMs:1/0,color:"text-text-secondary"}];function u(t){if(t<=0)return n[0].color;for(const e of n)if(t<e.maxMs)return e.color;return n[n.length-1].color}function w({until:t}){const[e,s]=a.useState(()=>new Date(t).getTime()-Date.now());a.useEffect(()=>{const o=setInterval(()=>{s(new Date(t).getTime()-Date.now())},1e3);return()=>clearInterval(o)},[t]);const i=a.useMemo(()=>{const o=new Date(t);return[{label:"ms",value:String(Math.max(0,e))},{label:"until",value:o.toISOString()},{label:"local",value:l(o,"MMM d, yyyy h:mm:ss a")}]},[t,e]);return r.jsx(c,{options:i,children:r.jsx("span",{className:`text-xs font-mono ${u(e)}`,children:m(e)})})}function d(t){return!!(t.assigned_to&&t.assigned_until&&new Date(t.assigned_until)>new Date)}function g(t){return!t.workflow_type}export{w as C,d as a,g as i};
|
|
2
|
-
//# sourceMappingURL=escalation-BZjS2202.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./vendor-query-B2UbickB.js";import{F as x,b as l}from"./FilterBar-Ck4K4rzu.js";import{P as m}from"./PriorityBadge-DfQY9St9.js";import{R as p}from"./RolePill-BDzPFQUv.js";import{W as u}from"./WorkflowPill-pPuGH8v9.js";import{T as d}from"./TimestampCell-CYFbEhqc.js";import{C as y,i as h,a as j}from"./escalation-BZjS2202.js";import{a3 as v,a4 as b,a5 as f,a6 as r}from"./vendor-icons-BNtvBbnj.js";import{L as k}from"./vendor-react-CX88sFS5.js";function N({row:e}){if(h(e)){const t=e.status==="resolved"?"text-status-success":"text-text-tertiary";return s.jsx(f,{className:`w-3 h-3 shrink-0 ${t}`})}return e.status==="resolved"?s.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-success text-status-success"}):e.status==="cancelled"?s.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-error text-status-error"}):j(e)?s.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-warning text-status-warning"}):s.jsx(r,{className:"w-2.5 h-2.5 shrink-0 fill-status-active text-status-active"})}const I=[{key:"description",label:"Summary",render:e=>s.jsxs("div",{className:"flex items-start gap-2 overflow-hidden",children:[s.jsx("span",{className:"mt-1 shrink-0",children:s.jsx(N,{row:e})}),s.jsxs("div",{className:"min-w-0 overflow-hidden",children:[s.jsx("p",{className:"text-xs text-text-primary truncate",children:e.description||e.type}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[s.jsx(u,{type:e.type}),e.subtype&&e.subtype!==e.type&&s.jsx("span",{className:"text-[10px] text-text-tertiary whitespace-nowrap",children:e.subtype})]})]})]}),className:"max-w-0"},{key:"task_id",label:"Task",render:e=>e.task_id?s.jsxs(k,{to:`/workflows/tasks/detail/${e.task_id}`,onClick:t=>t.stopPropagation(),className:"group/task inline-flex items-center gap-1 text-xs font-mono text-text-secondary hover:text-accent transition-colors",children:[e.task_id.slice(0,12),"…",s.jsx(v,{size:10,className:"opacity-0 group-hover/task:opacity-100 transition-opacity"})]}):s.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-36 whitespace-nowrap"},{key:"role",label:"Role",render:e=>s.jsx(p,{role:e.role}),className:"w-28"},{key:"priority",label:"Priority",render:e=>s.jsx(m,{priority:e.priority}),className:"w-20",sortable:!0},{key:"created_at",label:"Created",render:e=>s.jsx(d,{date:e.created_at}),className:"w-40",sortable:!0}],A={key:"expires",label:s.jsx(b,{className:"w-3.5 h-3.5 text-text-tertiary"}),render:e=>e.assigned_until?s.jsx(y,{until:e.assigned_until}):s.jsx("span",{className:"text-xs text-text-tertiary",children:"—"}),className:"w-16 whitespace-nowrap"},C=[{value:"1",label:"P1"},{value:"2",label:"P2"},{value:"3",label:"P3"},{value:"4",label:"P4"}],g=[{value:"available",label:"Available"},{value:"claimed",label:"Claimed"},{value:"resolved",label:"Resolved"}];function B({filters:e,setFilter:t,roles:i,types:n,showStatus:o=!1,actions:c}){return s.jsxs(x,{actions:c,children:[o&&s.jsx(l,{label:"Status",value:e.status??"",onChange:a=>t("status",a),options:g}),s.jsx(l,{label:"Role",value:e.role,onChange:a=>t("role",a),options:i.map(a=>({value:a,label:a}))}),s.jsx(l,{label:"Type",value:e.type,onChange:a=>t("type",a),options:n.map(a=>({value:a,label:a}))}),s.jsx(l,{label:"Priority",value:e.priority,onChange:a=>t("priority",a),options:C})]})}export{I as E,A as T,B as a};
|
|
2
|
-
//# sourceMappingURL=escalation-columns-DtRVmPSB.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./vendor-query-B2UbickB.js";import{T as o}from"./TimeAgo-CttiZG0k.js";import{S as l}from"./StatusBadge-XQlNFwmH.js";const i={"* * * * *":"Every minute","*/5 * * * *":"Every 5 minutes","*/15 * * * *":"Every 15 minutes","*/30 * * * *":"Every 30 minutes","0 * * * *":"Every hour","0 */2 * * *":"Every 2 hours","0 */6 * * *":"Every 6 hours","0 */12 * * *":"Every 12 hours","0 0 * * *":"Daily at midnight","0 9 * * *":"Daily at 9 AM","0 9 * * 1-5":"Weekdays at 9 AM","0 0 * * 0":"Weekly (Sunday midnight)","0 0 1 * *":"Monthly (1st at midnight)","0 2 * * *":"Daily at 2 AM"};function c(t){return i[t]??""}const f=[["*/15 * * * *","Every 15 min"],["0 * * * *","Every hour"],["0 */6 * * *","Every 6 hours"],["0 9 * * *","Daily 9 AM"],["0 9 * * 1-5","Weekdays 9 AM"],["0 0 * * 0","Weekly (Sun)"]];function E(t){const r=t==null?void 0:t.data;if(!r||typeof r!="object"||Array.isArray(r))return null;const s=Object.entries(r);return s.length===0||!s.every(([,e])=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null)?null:s.map(([e,a])=>({key:e,value:a===null?"":String(a),type:a===null?"string":typeof a}))}const h=[{key:"workflow_id",label:"Workflow ID",render:t=>n.jsx("span",{className:"font-mono text-[11px] text-text-secondary",children:t.workflow_id.length>40?`${t.workflow_id.slice(0,40)}...`:t.workflow_id})},{key:"status",label:"Status",render:t=>n.jsx(l,{status:t.status}),className:"w-28"},{key:"created_at",label:"Started",render:t=>n.jsx(o,{date:t.created_at}),className:"w-32"}];export{f as C,c as d,E as e,h as j};
|
|
2
|
-
//# sourceMappingURL=helpers-BngVEys5.js.map
|
|
@@ -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-xh7T0I-f.js";import{S as z}from"./StepIndicator-CuUIGxKk.js";import{P as J}from"./PageHeader-Bo0SpcCK.js";import{T as Y}from"./TagInput-VBY0xIwb.js";import{X as q,H as K,ai as V,aj as X}from"./vendor-icons-BNtvBbnj.js";import{e as G,c as W,f as Q}from"./vendor-react-CX88sFS5.js";import"./index-DcpCR9c_.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-ABsZZf_U.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-Bf4_w24H.js";import{P as Y}from"./PageHeader-Bo0SpcCK.js";import{P as B,a4 as W,a as L,a8 as Z,a9 as ee}from"./vendor-icons-BNtvBbnj.js";import{S as I,i as V}from"./index-DcpCR9c_.js";import{W as te}from"./WorkflowPill-pPuGH8v9.js";import{B as se}from"./BotPicker-CM-_u73k.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-BngVEys5.js";import"./bots-BzEs6Q9L.js";import"./EmptyState-BcsfPq9T.js";import"./TimeAgo-CttiZG0k.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-BCsShN2l.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u as O,c as _,j as e,a as i,b as ae}from"./vendor-query-B2UbickB.js";import{f as ne,a as le}from"./vendor-react-CX88sFS5.js";import{P as ie}from"./PageHeader-Bo0SpcCK.js";import{F as oe,a as ce}from"./FilterBar-Ck4K4rzu.js";import{L as xe}from"./ListToolbar-Bntl2hex.js";import{E as de}from"./EmptyState-BcsfPq9T.js";import{D as ue}from"./DropZone-BEW3jBzf.js";import{b as v}from"./index-DcpCR9c_.js";import{F as pe,m as X,K as Q,O as me,k as he,as as fe,at as ge,au as je,av as be,aw as ye,X as Ne,ax as ve,a3 as we,ay as ke,n as Se,az as H,aA as Ce,l as Fe}from"./vendor-icons-BNtvBbnj.js";import{T as J}from"./TimeAgo-CttiZG0k.js";function Te(t,a=100,n){const s=new URLSearchParams;t&&s.set("prefix",t),s.set("pageSize",String(a)),n&&s.set("continuationToken",n);const o=s.toString();return O({queryKey:["fileBrowse",t,a,n],queryFn:()=>v(`/file-browser/browse?${o}`)})}function $e(t){return O({queryKey:["fileMetadata",t],queryFn:()=>v(`/file-browser/metadata/${t}`),enabled:!!t})}function Pe(){return _({mutationFn:t=>v("/file-browser/signed-url",{method:"POST",body:JSON.stringify(t)})})}function Ue(){return _({mutationFn:t=>v(`/file-browser/delete/${t}`,{method:"DELETE"})})}function Ee(){return _({mutationFn:async({path:t,file:a})=>{const n=await a.arrayBuffer();return v(`/file-browser/upload?path=${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:n})}})}function De(t){return O({queryKey:["filePreviewUrl",t],queryFn:async()=>(await v("/file-browser/signed-url",{method:"POST",body:JSON.stringify({path:t,expiresIn:3600})})).url,enabled:!!t,staleTime:3e3*1e3})}function Le({prefix:t,onNavigate:a}){const n=t?t.replace(/\/+$/,"").split("/").filter(Boolean):[];return e.jsxs("nav",{className:"flex items-center gap-1 text-sm mb-6 min-h-[28px]",children:[e.jsxs("button",{onClick:()=>a(""),className:`flex items-center gap-1.5 px-1.5 py-0.5 rounded transition-colors ${n.length===0?"text-text-primary font-medium":"text-text-secondary hover:text-text-primary hover:bg-surface-hover"}`,children:[e.jsx(pe,{className:"w-4 h-4 text-accent/75",strokeWidth:1.5}),e.jsx("span",{children:"Root"})]}),n.map((s,o)=>{const l=o===n.length-1,d=n.slice(0,o+1).join("/")+"/";return e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(X,{className:"w-3.5 h-3.5 text-text-tertiary"}),e.jsx("button",{onClick:()=>a(d),className:`px-1.5 py-0.5 rounded transition-colors ${l?"text-text-primary font-medium":"text-text-secondary hover:text-text-primary hover:bg-surface-hover"}`,children:s})]},d)})]})}function Be(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(1)} GB`}function S(t){return t.split("/").pop()||t}function I({label:t,value:a,mono:n,children:s}){return e.jsxs("div",{children:[e.jsx("dt",{className:"text-[10px] uppercase tracking-wider text-text-tertiary mb-0.5",children:t}),e.jsx("dd",{className:`text-sm text-text-secondary ${n?"font-mono text-xs break-all":""}`,children:s||a})]})}function Re({url:t}){const[a,n]=i.useState(null),[s,o]=i.useState(!1);return a===null&&!s&&fetch(t).then(l=>{if(!l.ok)throw new Error;return l.text()}).then(l=>n(l.slice(0,1e5))).catch(()=>o(!0)),s?e.jsx("p",{className:"text-xs text-text-tertiary",children:"Could not load preview"}):a===null?e.jsx("div",{className:"animate-pulse h-32 bg-surface-sunken rounded"}):e.jsx("pre",{className:"font-mono text-xs text-text-secondary bg-surface-sunken rounded-md p-3 overflow-x-auto max-h-[400px] overflow-y-auto whitespace-pre-wrap break-words",children:a})}function Ie({metadata:t}){const[a,n]=i.useState(null);async function s(o,l){await navigator.clipboard.writeText(o),n(l),setTimeout(()=>n(null),2e3)}return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-[10px] uppercase tracking-wider text-text-tertiary mb-0.5",children:"Path"}),e.jsxs("dd",{onClick:()=>s(t.path,"path"),className:"group flex items-center gap-1.5 text-xs font-mono text-text-secondary break-all cursor-pointer hover:text-text-primary transition-colors",title:"Click to copy",children:[e.jsx("span",{className:"flex-1",children:t.path}),a==="path"?e.jsx(Q,{className:"w-3.5 h-3.5 text-status-success shrink-0"}):e.jsx(me,{className:"w-3.5 h-3.5 opacity-0 group-hover:opacity-100 text-text-tertiary shrink-0 transition-opacity"})]})]}),e.jsx(I,{label:"Type",value:t.content_type}),e.jsx(I,{label:"Size",value:Be(t.size)}),e.jsx(I,{label:"Modified",children:e.jsx(J,{date:t.modified_at})})]})}async function Oe(t,a){const s=await(await fetch(t)).blob(),o=URL.createObjectURL(s),l=document.createElement("a");l.href=o,l.download=a,l.style.display="none",document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(o)}function _e(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(1)} GB`}function ze(t){var n;const a=((n=t.split(".").pop())==null?void 0:n.toLowerCase())||"";return["png","jpg","jpeg","gif","svg","webp"].includes(a)?e.jsx(fe,{className:"w-4 h-4 text-accent/60",strokeWidth:1.5}):["json"].includes(a)?e.jsx(ge,{className:"w-4 h-4 text-accent/60",strokeWidth:1.5}):["csv","xlsx","xls"].includes(a)?e.jsx(je,{className:"w-4 h-4 text-accent/60",strokeWidth:1.5}):["txt","md","html","xml","yaml","yml","css","js","ts"].includes(a)?e.jsx(be,{className:"w-4 h-4 text-accent/60",strokeWidth:1.5}):e.jsx(ye,{className:"w-4 h-4 text-accent/60",strokeWidth:1.5})}function Me(t){var n;const a=((n=t.split(".").pop())==null?void 0:n.toLowerCase())||"";return["png","jpg","jpeg","gif","svg","webp"].includes(a)}function qe(t){const a=t.replace(/\/+$/,"");return a.split("/").pop()||a}function We(t){return t.split("/").pop()||t}function Ae({directories:t,files:a,onNavigate:n,onSelect:s,selectedFile:o}){return e.jsxs("table",{className:"w-full mt-2",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-left text-[10px] uppercase tracking-wider text-text-tertiary",children:[e.jsx("th",{className:"pb-2 pl-2 font-medium",children:"Name"}),e.jsx("th",{className:"pb-2 font-medium w-24 text-right",children:"Size"}),e.jsx("th",{className:"pb-2 pr-2 font-medium w-40 text-right",children:"Modified"})]})}),e.jsxs("tbody",{children:[t.map(l=>e.jsxs("tr",{onClick:()=>n(l),className:"row-hover cursor-pointer group",children:[e.jsx("td",{className:"py-2 pl-2",children:e.jsxs("span",{className:"flex items-center gap-2.5",children:[e.jsx(he,{className:"w-4 h-4 text-accent/75 shrink-0",strokeWidth:1.5}),e.jsx("span",{className:"text-sm text-text-primary group-hover:text-accent transition-colors",children:qe(l)})]})}),e.jsx("td",{className:"py-2 text-right text-xs text-text-tertiary",children:"—"}),e.jsx("td",{className:"py-2 pr-2 text-right text-xs text-text-tertiary",children:"—"})]},l)),a.map(l=>e.jsxs("tr",{onClick:()=>s(l.path),className:`row-hover cursor-pointer group ${o===l.path?"bg-surface-hover":""}`,children:[e.jsx("td",{className:"py-2 pl-2",children:e.jsxs("span",{className:"flex items-center gap-2.5",children:[ze(l.path),e.jsx("span",{className:"text-sm text-text-primary truncate",children:We(l.path)})]})}),e.jsx("td",{className:"py-2 text-right text-xs text-text-secondary tabular-nums",children:_e(l.size)}),e.jsx("td",{className:"py-2 pr-2 text-right text-xs text-text-secondary",children:e.jsx(J,{date:l.modified_at})})]},l.path))]})]})}const Ke=[{label:"1 hour",value:3600},{label:"6 hours",value:21600},{label:"24 hours",value:86400},{label:"7 days",value:604800},{label:"30 days",value:2592e3}];function Ge({filePath:t,onClose:a,onDeleted:n}){var j,k;const{data:s,isLoading:o}=$e(t),l=Pe(),d=Ue(),[w,f]=i.useState(!1),[b,C]=i.useState(!1),[y,h]=i.useState(!1),{data:u}=De(t),g=((j=s==null?void 0:s.content_type)==null?void 0:j.startsWith("image/"))||Me(t),F=/\.(ts|tsx|js|jsx|json|md|yaml|yml|toml|xml|csv|sql|sh|py|rb|go|rs|java|c|cpp|h|css|scss|html|txt|log|env|ini|cfg|conf)$/i,p=((k=s==null?void 0:s.content_type)==null?void 0:k.startsWith("text/"))||(s==null?void 0:s.content_type)==="application/json"||(s==null?void 0:s.content_type)==="application/xml"||(s==null?void 0:s.content_type)==="application/octet-stream"&&F.test(t),U=(s==null?void 0:s.content_type)==="application/pdf";async function E(){try{const c=await l.mutateAsync({path:t,expiresIn:3600}),x=c.url.startsWith("http")?c.url:`${window.location.origin}${c.url}`;Oe(x,S(t))}catch{}}async function T(c){f(!1);try{const x=await l.mutateAsync({path:t,expiresIn:c}),N=x.url.startsWith("http")?x.url:`${window.location.origin}${x.url}`;await navigator.clipboard.writeText(N),C(!0),setTimeout(()=>C(!1),2e3)}catch{}}return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"w-[380px] shrink-0 border-l border-surface-border bg-surface overflow-y-auto",children:[e.jsxs("div",{className:"sticky top-0 bg-surface z-10 px-5 pt-5 pb-3 border-b border-surface-border",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-medium text-text-primary truncate pr-2",title:S(t),children:S(t)}),e.jsx("button",{onClick:a,className:"text-text-tertiary hover:text-text-primary shrink-0",children:e.jsx(Ne,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[e.jsxs("button",{onClick:E,className:"btn-ghost flex items-center gap-1.5 !px-2.5 !py-1.5 text-xs",title:"Download",children:[e.jsx(ve,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Download"})]}),e.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"btn-ghost flex items-center gap-1.5 !px-2.5 !py-1.5 text-xs",title:"Open in new tab",children:[e.jsx(we,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Open"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>f(c=>!c),className:"btn-ghost flex items-center gap-1.5 !px-2.5 !py-1.5 text-xs",title:"Share with signed URL",children:[b?e.jsx(Q,{className:"w-3.5 h-3.5 text-status-success"}):e.jsx(ke,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:b?"Copied":"Share"})]}),w&&e.jsx("div",{className:"absolute top-full left-0 mt-1 bg-surface-raised border border-surface-border rounded-md shadow-lg py-1 z-20 min-w-[120px]",children:Ke.map(c=>e.jsx("button",{onClick:()=>T(c.value),className:"w-full text-left px-3 py-1.5 text-xs text-text-secondary hover:bg-surface-hover hover:text-text-primary transition-colors",children:c.label},c.value))})]}),e.jsxs("button",{onClick:()=>h(!0),className:"btn-ghost flex items-center gap-1.5 !px-2.5 !py-1.5 text-xs text-status-error/70 hover:text-status-error",title:"Delete file",children:[e.jsx(Se,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Delete"})]})]}),y&&e.jsxs("div",{className:"mt-3 p-3 bg-status-error/5 border border-status-error/20 rounded-md",children:[e.jsxs("p",{className:"text-xs text-text-primary mb-2",children:["Permanently delete ",e.jsx("span",{className:"font-medium",children:S(t)}),"? This cannot be undone."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>h(!1),className:"btn-secondary text-xs",disabled:d.isPending,children:"Cancel"}),e.jsx("button",{onClick:async()=>{try{await d.mutateAsync(t),h(!1),n==null||n()}catch{}},className:"btn-primary text-xs !bg-status-error hover:!bg-status-error/90",disabled:d.isPending,children:d.isPending?"Deleting...":"Delete"})]}),d.isError&&e.jsx("p",{className:"text-xs text-status-error mt-2",children:d.error.message})]}),l.isError&&e.jsx("p",{className:"text-xs text-status-error mt-2",children:l.error.message})]}),e.jsx("div",{className:"p-5",children:o?e.jsxs("div",{className:"animate-pulse space-y-3",children:[e.jsx("div",{className:"h-48 bg-surface-sunken rounded"}),e.jsx("div",{className:"h-4 bg-surface-sunken rounded w-2/3"})]}):e.jsxs(e.Fragment,{children:[g&&u&&e.jsx("div",{className:"mb-5 rounded-md border border-surface-border bg-surface-sunken overflow-hidden",style:{maxHeight:"400px"},children:e.jsx("img",{src:u,alt:S(t),className:"w-full object-cover object-top",style:{maxHeight:"400px"}})}),p&&u&&e.jsx("div",{className:"mb-5",children:e.jsx(Re,{url:u})}),U&&u&&e.jsx("div",{className:"mb-5 p-4 bg-surface-sunken rounded-md text-center",children:e.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:text-accent-hover text-sm font-medium",children:"Open PDF in new tab"})}),s&&e.jsx(Ie,{metadata:s})]})})]})})}const He=[25,50,100,200];function at(){const[t,a]=ne(),n=t.get("prefix")||"",[s,o]=i.useState(""),[l,d]=i.useState(""),[w,f]=i.useState(null),[b,C]=i.useState(100),[y,h]=i.useState([]),[u,g]=i.useState();i.useEffect(()=>{const r=setTimeout(()=>{d(s),g(void 0),h([])},300);return()=>clearTimeout(r)},[s]);const F=l?`${n}${l}`:n,{data:p,isLoading:U,isFetching:E,refetch:T}=Te(F,b,u),j=Ee(),k=ae(),c=i.useRef(null),[x,N]=i.useState(null),[$,z]=i.useState(""),M=i.useCallback(r=>{N(r),z(n)},[n]),[q,W]=i.useState(""),Z=i.useCallback(()=>{if(!x)return;W("");let r=x.length;for(const m of x){const K=`${$}${m.name}`;j.mutate({path:K,file:m},{onSuccess:()=>{r--,k.invalidateQueries({queryKey:["fileBrowse"]}),r<=0&&N(null)},onError:G=>{r--,W(G.message),console.error("[Upload] failed:",K,G)}})}},[x,$,j,k]),D=(p==null?void 0:p.directories)??[],P=(p==null?void 0:p.files)??[],L=p==null?void 0:p.nextToken,A=i.useCallback(r=>{o(""),d(""),f(null),g(void 0),h([]),a(r?{prefix:r}:{})},[a]);function V(){L&&(h(r=>[...r,u||""]),g(L))}function Y(){if(y.length===0)return;const r=[...y],m=r.pop();h(r),g(m||void 0)}function ee(r){C(r),g(void 0),h([])}const te=D.length===0&&P.length===0,se=y.length+1,B=!!L,R=y.length>0,re=`/file-browser/browse?prefix=${encodeURIComponent(F)}&pageSize=${b}${u?`&continuationToken=${encodeURIComponent(u)}`:""}`;return e.jsxs(ue,{onDrop:M,label:"Drop files to upload",children:[e.jsxs("div",{className:"flex gap-0",children:[e.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:r=>{const m=Array.from(r.target.files||[]);m.length&&M(m),r.target.value=""}}),e.jsxs("div",{className:"flex-1 min-w-0 overflow-hidden",children:[e.jsx(ie,{title:"Files",docsHash:"#docs:dashboard.md:files",actions:e.jsxs("button",{onClick:()=>{var r;return(r=c.current)==null?void 0:r.click()},disabled:j.isPending,className:"btn-primary text-xs inline-flex items-center gap-1.5",children:[e.jsx(H,{className:"w-3.5 h-3.5"}),j.isPending?"Uploading...":"Upload"]})}),e.jsx(Le,{prefix:n,onNavigate:A}),e.jsx(oe,{actions:e.jsx(xe,{onRefresh:()=>T(),isFetching:E,apiPath:re}),children:e.jsx(ce,{label:"Search",value:s,onChange:o,placeholder:"Filter by prefix..."})}),U?e.jsx("div",{className:"animate-pulse space-y-2 mt-4",children:Array.from({length:6}).map((r,m)=>e.jsx("div",{className:"h-10 bg-surface-sunken rounded"},m))}):te?e.jsx("div",{className:"cursor-pointer",onClick:()=>{var r;return(r=c.current)==null?void 0:r.click()},children:e.jsx(de,{icon:Ce,title:s?"No matching files":"No files yet",description:s?void 0:"Drop files here or click to upload"})}):e.jsx(Ae,{directories:D,files:P,onNavigate:A,onSelect:f,selectedFile:w}),(R||B||P.length>0)&&e.jsxs("div",{className:"flex items-center justify-between pt-4 pb-2",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("p",{className:"text-xs text-text-tertiary",children:["Page ",se," · ",P.length+D.length," items"]}),e.jsx("select",{value:b,onChange:r=>ee(parseInt(r.target.value)),className:"select text-xs py-1",children:He.map(r=>e.jsxs("option",{value:r,children:[r," / page"]},r))})]}),(R||B)&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("button",{onClick:Y,disabled:!R,className:"btn-ghost text-xs disabled:opacity-30 disabled:cursor-not-allowed flex items-center gap-1",children:[e.jsx(Fe,{className:"w-3.5 h-3.5"}),"Previous"]}),e.jsxs("button",{onClick:V,disabled:!B,className:"btn-ghost text-xs disabled:opacity-30 disabled:cursor-not-allowed flex items-center gap-1",children:["Next",e.jsx(X,{className:"w-3.5 h-3.5"})]})]})]})]}),w&&e.jsx(Ge,{filePath:w,onClose:()=>f(null),onDeleted:()=>{f(null),T()}})]}),x&&le.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-black/30",onClick:()=>N(null)}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-surface-raised border border-surface-border rounded-lg shadow-lg w-full max-w-sm",children:[e.jsx("div",{className:"px-5 py-4 border-b border-surface-border",children:e.jsxs("h3",{className:"text-sm font-medium text-text-primary",children:["Upload ",x.length," file",x.length>1?"s":""]})}),e.jsxs("div",{className:"px-5 py-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Destination folder"}),e.jsx("input",{type:"text",value:$,onChange:r=>z(r.target.value),placeholder:"e.g., images/ or leave empty for root",className:"input text-xs w-full font-mono"})]}),e.jsx("div",{className:"text-[10px] text-text-quaternary space-y-0.5",children:x.map((r,m)=>e.jsxs("p",{className:"truncate",children:[$,r.name," ",e.jsxs("span",{className:"text-text-tertiary",children:["(",(r.size/1024).toFixed(1)," KB)"]})]},m))}),q&&e.jsx("p",{className:"text-xs text-status-error",children:q})]}),e.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-surface-border",children:[e.jsx("button",{onClick:()=>N(null),className:"btn-ghost text-xs",children:"Cancel"}),e.jsxs("button",{onClick:Z,className:"btn-primary text-xs",children:[e.jsx(H,{className:"w-3.5 h-3.5 mr-1.5 inline"}),"Upload"]})]})]})})]}),document.body)]})}export{at as FilesPage};
|
|
2
|
-
//# sourceMappingURL=index-Bq5MSkCL.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as x,j as e}from"./vendor-query-B2UbickB.js";import{b as I,c as M,d as F,e as E,f as z,u as $}from"./users-CyF-5WLI.js";import{u as P}from"./useFilterParams-DZCAaBC7.js";import{D as R}from"./DataTable-D9yuBv0w.js";import{S as A}from"./StickyPagination-F9FZsRy9.js";import{F as O,b as G}from"./FilterBar-Ck4K4rzu.js";import{T as B}from"./TimestampCell-CYFbEhqc.js";import{C as w}from"./ConfirmDeleteModal-dOxidrSR.js";import{R as U,a as b}from"./RowActions-Dg-Fsm5O.js";import{P as T}from"./PageHeader-Bo0SpcCK.js";import{R as N}from"./RolePill-BDzPFQUv.js";import{M as k}from"./Modal-DEODGeqx.js";import{u as L,a as q,b as H,c as J,d as Y,e as Q,f as V,g as W,h as X}from"./bots-BzEs6Q9L.js";import{u as K}from"./roles-D7bx5FAM.js";import{T as Z}from"./TimeAgo-CttiZG0k.js";import{K as ee,O as te,ak as se,n as S,Y as ae,J as D,U as ne,a as ie}from"./vendor-icons-BNtvBbnj.js";import{f as le}from"./vendor-react-CX88sFS5.js";import"./index-DcpCR9c_.js";import"./EmptyState-BcsfPq9T.js";function re({open:a,onClose:l}){const t=I(),[n,i]=x.useState({external_id:"",email:"",display_name:"",password:""}),[o,p]=x.useState(a);a!==o&&(p(a),a&&i({external_id:"",email:"",display_name:"",password:""}));const m=()=>{n.external_id.trim()&&t.mutate({external_id:n.external_id.trim(),email:n.email.trim()||void 0,display_name:n.display_name.trim()||void 0,password:n.password||void 0},{onSuccess:l})},d=(s,r)=>i(h=>({...h,[s]:r}));return e.jsx(k,{open:a,onClose:l,title:"Create User",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"External ID (required)"}),e.jsx("input",{type:"text",value:n.external_id,onChange:s=>d("external_id",s.target.value),placeholder:"e.g., john.doe",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Display Name"}),e.jsx("input",{type:"text",value:n.display_name,onChange:s=>d("display_name",s.target.value),placeholder:"John Doe",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Email"}),e.jsx("input",{type:"text",value:n.email,onChange:s=>d("email",s.target.value),placeholder:"john@example.com",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Password"}),e.jsx("input",{type:"password",value:n.password,onChange:s=>d("password",s.target.value),placeholder:"Leave blank for no password",className:"input text-xs w-full"})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:l,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:m,disabled:!n.external_id.trim()||t.isPending,className:"btn-primary text-xs",children:t.isPending?"Creating...":"Create"})]})]})})}function ce({open:a,onClose:l,user:t}){const n=M(),[i,o]=x.useState({display_name:"",email:"",status:"active"}),[p,m]=x.useState(t);t!==p&&(m(t),t&&o({display_name:t.display_name??"",email:t.email??"",status:t.status}));const d=()=>{t&&n.mutate({id:t.id,display_name:i.display_name.trim()||void 0,email:i.email.trim()||void 0,status:i.status},{onSuccess:l})};return e.jsx(k,{open:a,onClose:l,title:`Edit — ${(t==null?void 0:t.display_name)||(t==null?void 0:t.external_id)||""}`,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Display Name"}),e.jsx("input",{type:"text",value:i.display_name,onChange:s=>o(r=>({...r,display_name:s.target.value})),className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Email"}),e.jsx("input",{type:"text",value:i.email,onChange:s=>o(r=>({...r,email:s.target.value})),className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Status"}),e.jsxs("select",{value:i.status,onChange:s=>o(r=>({...r,status:s.target.value})),className:"select text-xs w-full",children:[e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"inactive",children:"Inactive"}),e.jsx("option",{value:"suspended",children:"Suspended"})]})]}),n.error&&e.jsx("p",{className:"text-xs text-status-error",children:n.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:l,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:d,disabled:n.isPending,className:"btn-primary text-xs",children:n.isPending?"Saving...":"Save"})]})]})})}function oe({open:a,onClose:l}){const t=L(),[n,i]=x.useState({name:"",display_name:"",description:""}),[o,p]=x.useState(a);a!==o&&(p(a),a&&i({name:"",display_name:"",description:""}));const m=()=>{n.name.trim()&&t.mutate({name:n.name.trim(),display_name:n.display_name.trim()||void 0,description:n.description.trim()||void 0},{onSuccess:l})},d=(s,r)=>i(h=>({...h,[s]:r}));return e.jsx(k,{open:a,onClose:l,title:"Create Bot",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Name (required)"}),e.jsx("input",{type:"text",value:n.name,onChange:s=>d("name",s.target.value.replace(/\s+/g,"-").toLowerCase()),placeholder:"e.g., ci-bot",className:"input text-xs w-full font-mono"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Display Name"}),e.jsx("input",{type:"text",value:n.display_name,onChange:s=>d("display_name",s.target.value),placeholder:"CI Bot",className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("input",{type:"text",value:n.description,onChange:s=>d("description",s.target.value),placeholder:"Runs scheduled workflows",className:"input text-xs w-full"})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:l,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:m,disabled:!n.name.trim()||t.isPending,className:"btn-primary text-xs",children:t.isPending?"Creating...":"Create"})]})]})})}function de({open:a,onClose:l,bot:t}){const n=q(),[i,o]=x.useState({display_name:"",description:"",status:"active"}),[p,m]=x.useState(t);t!==p&&(m(t),t&&o({display_name:t.display_name??"",description:t.description??"",status:t.status}));const d=()=>{t&&n.mutate({id:t.id,display_name:i.display_name.trim()||void 0,description:i.description.trim()||void 0,status:i.status},{onSuccess:l})};return e.jsx(k,{open:a,onClose:l,title:`Edit — ${(t==null?void 0:t.display_name)||(t==null?void 0:t.external_id)||""}`,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Display Name"}),e.jsx("input",{type:"text",value:i.display_name,onChange:s=>o(r=>({...r,display_name:s.target.value})),className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Description"}),e.jsx("input",{type:"text",value:i.description,onChange:s=>o(r=>({...r,description:s.target.value})),className:"input text-xs w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Status"}),e.jsxs("select",{value:i.status,onChange:s=>o(r=>({...r,status:s.target.value})),className:"select text-xs w-full",children:[e.jsx("option",{value:"active",children:"Active"}),e.jsx("option",{value:"inactive",children:"Inactive"}),e.jsx("option",{value:"suspended",children:"Suspended"})]})]}),n.error&&e.jsx("p",{className:"text-xs text-status-error",children:n.error.message}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:l,className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:d,disabled:n.isPending,className:"btn-primary text-xs",children:n.isPending?"Saving...":"Save"})]})]})})}function xe({botId:a}){const{data:l}=H(a),t=J(),n=Y(),[i,o]=x.useState(""),[p,m]=x.useState(null),[d,s]=x.useState(!1),[r,h]=x.useState(null),v=(l==null?void 0:l.keys)??[],c=()=>{i.trim()&&t.mutate({botId:a,name:i.trim(),scopes:["mcp:tool:call"]},{onSuccess:y=>{m(y.rawKey),o("")}})},g=()=>{p&&(navigator.clipboard.writeText(p),s(!0),setTimeout(()=>s(!1),2e3))},f=()=>{r&&n.mutate({botId:a,keyId:r.id},{onSuccess:()=>h(null)})};return e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-3",children:"API Keys"}),p&&e.jsxs("div",{className:"mb-3 p-3 bg-status-success/10 border border-status-success/30 rounded-md",children:[e.jsx("p",{className:"text-[10px] font-semibold text-status-success mb-1",children:"Key generated — copy now, it won't be shown again"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"text-[11px] font-mono text-text-primary bg-surface-sunken px-2 py-1 rounded flex-1 overflow-hidden text-ellipsis",children:p}),e.jsx("button",{onClick:g,className:"text-text-tertiary hover:text-text-primary shrink-0",title:"Copy to clipboard",children:d?e.jsx(ee,{className:"w-3.5 h-3.5 text-status-success"}):e.jsx(te,{className:"w-3.5 h-3.5"})})]})]}),v.length===0?e.jsx("p",{className:"text-xs text-text-tertiary mb-3",children:"No API keys."}):e.jsx("div",{className:"space-y-1.5 mb-3",children:v.map(y=>e.jsxs("div",{className:"group/key flex items-center justify-between px-2.5 py-1.5 bg-surface-sunken rounded text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{className:"w-3 h-3 text-text-tertiary"}),e.jsx("span",{className:"text-text-primary font-mono",children:y.name}),y.last_used_at&&e.jsxs("span",{className:"text-[10px] text-text-tertiary",children:["used ",e.jsx(Z,{date:y.last_used_at})]})]}),e.jsx("button",{onClick:()=>h(y),className:"opacity-0 group-hover/key:opacity-100 transition-opacity text-text-tertiary hover:text-status-error",title:"Revoke key",children:e.jsx(S,{className:"w-3 h-3"})})]},y.id))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:i,onChange:y=>o(y.target.value),placeholder:"Key name...",className:"input text-xs flex-1 font-mono"}),e.jsxs("button",{onClick:c,disabled:!i.trim()||t.isPending,className:"btn-primary text-xs inline-flex items-center gap-1",children:[e.jsx(ae,{className:"w-3 h-3"}),t.isPending?"...":"Generate"]})]}),t.error&&e.jsx("p",{className:"text-[10px] text-status-error mt-1",children:t.error.message}),e.jsx(w,{open:!!r,onClose:()=>h(null),onConfirm:f,title:"Revoke API Key",description:e.jsxs(e.Fragment,{children:["Revoke API key"," ",e.jsx("span",{className:"font-medium text-text-primary font-mono",children:r==null?void 0:r.name}),"? This bot will no longer be able to authenticate with this key."]}),isPending:n.isPending,error:n.error})]})}function me({bot:a}){const{data:l}=K(),t=Q(),n=V(),[i,o]=x.useState(""),[p,m]=x.useState("member"),d=(l==null?void 0:l.roles)??[],s=a.roles??[],r=x.useMemo(()=>{const c=new Set(s.map(g=>g.role));return d.filter(g=>!c.has(g))},[d,s]),h=()=>{i.trim()&&t.mutate({botId:a.id,role:i.trim(),type:p},{onSuccess:()=>{o(""),m("member")}})},v=c=>{n.mutate({botId:a.id,role:c})};return e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-3",children:"Roles"}),s.length===0?e.jsx("p",{className:"text-xs text-text-tertiary mb-3",children:"No roles assigned."}):e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:s.map(c=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary",children:[e.jsx(N,{role:c.role}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:c.type}),e.jsx("button",{onClick:()=>v(c.role),className:"text-text-tertiary hover:text-status-error transition-colors ml-0.5",title:`Remove ${c.role}`,children:"×"})]},c.role))}),r.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:i,onChange:c=>o(c.target.value),className:"select text-xs font-mono flex-1",children:[e.jsx("option",{value:"",children:"Select a role..."}),r.map(c=>e.jsx("option",{value:c,children:c},c))]}),e.jsxs("select",{value:p,onChange:c=>m(c.target.value),className:"select text-xs w-24",children:[e.jsx("option",{value:"member",children:"member"}),e.jsx("option",{value:"admin",children:"admin"}),e.jsx("option",{value:"superadmin",children:"superadmin"})]}),e.jsx("button",{onClick:h,disabled:!i||t.isPending,className:"btn-primary text-xs",children:t.isPending?"...":"Add"})]}),t.error&&e.jsx("p",{className:"text-[10px] text-status-error mt-1",children:t.error.message})]})}function pe({bot:a}){return a?e.jsxs("div",{className:"border-l border-surface-border pl-6 pt-4 min-h-[300px] space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-text-primary",children:a.display_name||a.external_id}),a.description&&e.jsx("p",{className:"text-xs text-text-tertiary mt-0.5",children:a.description})]}),e.jsx(xe,{botId:a.id}),e.jsx(me,{bot:a})]}):e.jsx("div",{className:"border-l border-surface-border pl-6 pt-4 min-h-[300px]",children:e.jsx("p",{className:"text-xs text-text-tertiary",children:"Select a bot to manage its API keys and roles."})})}const ue={active:"bg-status-success",inactive:"bg-text-tertiary",suspended:"bg-status-error"};function he({embedded:a=!1}){const{pagination:l}=P({filters:{}}),t=W(),[n,i]=x.useState(!1),[o,p]=x.useState(null),[m,d]=x.useState(null),[s,r]=x.useState(null),{data:h,isLoading:v}=X({limit:l.pageSize,offset:l.offset}),c=(h==null?void 0:h.total)??0,g=(h==null?void 0:h.bots)??[],f=x.useMemo(()=>m?g.find(j=>j.id===m.id)??m:null,[g,m]),y=[{key:"display_name",label:"Bot",render:j=>e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${ue[j.status]??"bg-status-pending"}`,title:j.status}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-text-primary",children:j.display_name||j.external_id}),j.description&&e.jsx("p",{className:"text-xs text-text-tertiary",children:j.description})]})]})},{key:"roles",label:"Roles",render:j=>e.jsx("div",{className:"flex gap-1 flex-wrap",children:(j.roles??[]).map(u=>e.jsx(N,{role:u.role},u.role))})},{key:"created_at",label:"Created",render:j=>e.jsx(B,{date:j.created_at}),className:"w-44"},{key:"actions",label:"",render:j=>e.jsxs(U,{children:[e.jsx(b,{icon:D,title:"Edit bot",onClick:()=>p(j)}),e.jsx(b,{icon:S,title:"Delete bot",onClick:()=>r(j),colorClass:"text-text-tertiary hover:text-status-error"})]}),className:"w-16 text-right"}],C=()=>{s&&t.mutate(s.id,{onSuccess:()=>{r(null),(m==null?void 0:m.id)===s.id&&d(null)}})};return e.jsxs("div",{children:[a?e.jsx("div",{className:"flex justify-end mb-4",children:e.jsx("button",{onClick:()=>i(!0),className:"btn-primary text-xs",children:"Add Bot"})}):e.jsx(T,{title:"Service Accounts",actions:e.jsx("button",{onClick:()=>i(!0),className:"btn-primary text-xs",children:"Add Bot"})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_360px] gap-6",children:[e.jsxs("div",{className:"overflow-x-clip",children:[e.jsx(R,{columns:y,data:g,keyFn:j=>j.id,isLoading:v,emptyMessage:"No bots yet",onRowClick:j=>d(j),activeRowKey:(f==null?void 0:f.id)??null}),e.jsx(A,{page:l.page,totalPages:l.totalPages(c),onPageChange:l.setPage,total:c,pageSize:l.pageSize,onPageSizeChange:l.setPageSize})]}),e.jsx(pe,{bot:f})]}),e.jsx(oe,{open:n,onClose:()=>i(!1)}),e.jsx(de,{open:!!o,onClose:()=>p(null),bot:o}),e.jsx(w,{open:!!s,onClose:()=>r(null),onConfirm:C,title:"Delete Bot",description:e.jsxs(e.Fragment,{children:["Delete"," ",e.jsx("span",{className:"font-medium text-text-primary",children:(s==null?void 0:s.display_name)||(s==null?void 0:s.external_id)}),"? This will also revoke all API keys. This action cannot be undone."]}),isPending:t.isPending,error:t.error})]})}function je({user:a}){const{data:l}=K(),t=F(),n=E(),[i,o]=x.useState(""),[p,m]=x.useState("member"),d=(l==null?void 0:l.roles)??[],s=(a==null?void 0:a.roles)??[],r=x.useMemo(()=>{const c=new Set(s.map(g=>g.role));return d.filter(g=>!c.has(g))},[d,s]),h=()=>{!a||!i.trim()||t.mutate({userId:a.id,role:i.trim(),type:p},{onSuccess:()=>{o(""),m("member")}})},v=c=>{a&&n.mutate({userId:a.id,role:c})};return e.jsxs("div",{className:"border-l border-surface-border pl-6 pt-4 min-h-[300px]",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-4",children:"Role Membership"}),a?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-text-primary",children:a.display_name||a.external_id}),e.jsx("p",{className:"text-[10px] text-text-tertiary mt-0.5",children:"Member of:"})]}),s.length===0?e.jsx("p",{className:"text-xs text-text-tertiary",children:"No roles assigned."}):e.jsx("div",{className:"flex flex-wrap gap-2",children:s.map(c=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs bg-surface-sunken rounded-full text-text-secondary",children:[e.jsx(N,{role:c.role}),e.jsx("span",{className:"text-[9px] text-text-tertiary",children:c.type}),e.jsx("button",{onClick:()=>v(c.role),className:"text-text-tertiary hover:text-status-error transition-colors ml-0.5",title:`Remove ${c.role}`,children:"×"})]},c.role))}),r.length>0&&e.jsxs("div",{className:"pt-3 border-t border-surface-border",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Add Role"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:i,onChange:c=>o(c.target.value),className:"select text-xs font-mono flex-1",children:[e.jsx("option",{value:"",children:"Select a role..."}),r.map(c=>e.jsx("option",{value:c,children:c},c))]}),e.jsxs("select",{value:p,onChange:c=>m(c.target.value),className:"select text-xs w-24",children:[e.jsx("option",{value:"member",children:"member"}),e.jsx("option",{value:"admin",children:"admin"}),e.jsx("option",{value:"superadmin",children:"superadmin"})]}),e.jsx("button",{onClick:h,disabled:!i||t.isPending,className:"btn-primary text-xs",children:t.isPending?"...":"Add"})]}),t.error&&e.jsx("p",{className:"text-[10px] text-status-error mt-1",children:t.error.message})]})]}):e.jsx("p",{className:"text-xs text-text-tertiary",children:"Select a user to manage their roles."})]})}function ge({active:a,onChange:l}){const t=(n,i,o)=>e.jsxs("button",{onClick:()=>l(n),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md transition-colors ${a===n?"bg-accent/10 text-accent font-medium":"text-text-tertiary hover:text-text-secondary hover:bg-surface-hover"}`,children:[i,o]});return e.jsxs("div",{className:"flex gap-1 p-0.5 bg-surface-sunken rounded-lg w-fit",children:[t("users",e.jsx(ne,{className:"w-3.5 h-3.5"}),"User Accounts"),t("service-accounts",e.jsx(ie,{className:"w-3.5 h-3.5"}),"Service Accounts")]})}const ye=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"suspended",label:"Suspended"}],ve={active:"bg-status-success",inactive:"bg-text-tertiary",suspended:"bg-status-error"};function ze(){const[a,l]=le(),n=a.get("tab")==="service-accounts"?"service-accounts":"users",i=o=>{l(o==="users"?{}:{tab:o})};return e.jsxs("div",{children:[e.jsx(T,{title:"Accounts",docsHash:"#docs:dashboard.md:accounts",actions:e.jsx(ge,{active:n,onChange:i})}),n==="users"?e.jsx(fe,{}):e.jsx(he,{embedded:!0})]})}function fe(){const{filters:a,setFilter:l,pagination:t}=P({filters:{status:""}}),n=z(),[i,o]=x.useState(!1),[p,m]=x.useState(null),[d,s]=x.useState(null),[r,h]=x.useState(null),{data:v,isLoading:c}=$({status:a.status||void 0,limit:t.pageSize,offset:t.offset}),g=(v==null?void 0:v.total)??0,f=(v==null?void 0:v.users)??[],y=x.useMemo(()=>d?f.find(u=>u.id===d.id)??d:null,[f,d]),C=[{key:"display_name",label:"User",render:u=>e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${ve[u.status]??"bg-status-pending"}`,title:u.status}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-text-primary",children:u.display_name||u.external_id}),u.email&&e.jsx("p",{className:"text-xs text-text-tertiary",children:u.email})]})]})},{key:"roles",label:"Roles",render:u=>e.jsx("div",{className:"flex gap-1 flex-wrap",children:(u.roles??[]).map(_=>e.jsx(N,{role:_.role},_.role))})},{key:"created_at",label:"Created",render:u=>e.jsx(B,{date:u.created_at}),className:"w-44"},{key:"actions",label:"",render:u=>e.jsxs(U,{children:[e.jsx(b,{icon:D,title:"Edit user",onClick:()=>m(u)}),e.jsx(b,{icon:S,title:"Delete user",onClick:()=>h(u),colorClass:"text-text-tertiary hover:text-status-error"})]}),className:"w-16 text-right"}],j=()=>{r&&n.mutate(r.id,{onSuccess:()=>h(null)})};return e.jsxs("div",{children:[e.jsx("div",{className:"flex justify-end mb-4",children:e.jsx("button",{onClick:()=>o(!0),className:"btn-primary text-xs",children:"Add User"})}),e.jsx(O,{children:e.jsx(G,{label:"Status",value:a.status,onChange:u=>l("status",u),options:ye})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_320px] gap-6",children:[e.jsxs("div",{className:"overflow-x-clip",children:[e.jsx(R,{columns:C,data:f,keyFn:u=>u.id,isLoading:c,emptyMessage:"No users found",onRowClick:u=>s(u),activeRowKey:(y==null?void 0:y.id)??null}),e.jsx(A,{page:t.page,totalPages:t.totalPages(g),onPageChange:t.setPage,total:g,pageSize:t.pageSize,onPageSizeChange:t.setPageSize})]}),e.jsx(je,{user:y})]}),e.jsx(re,{open:i,onClose:()=>o(!1)}),e.jsx(ce,{open:!!p,onClose:()=>m(null),user:p}),e.jsx(w,{open:!!r,onClose:()=>h(null),onConfirm:j,title:"Delete User",description:e.jsxs(e.Fragment,{children:["Delete"," ",e.jsx("span",{className:"font-medium text-text-primary",children:(r==null?void 0:r.display_name)||(r==null?void 0:r.external_id)}),"? This action cannot be undone."]}),isPending:n.isPending,error:n.error})]})}export{ze as UsersPage};
|
|
2
|
-
//# sourceMappingURL=index-BwivT39P.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as k,u as R,b as O,j as e,a as d}from"./vendor-query-B2UbickB.js";import{P as F}from"./PageHeader-Bo0SpcCK.js";import{b}from"./index-DcpCR9c_.js";import{M}from"./Modal-DEODGeqx.js";import{R as g,C}from"./constants-BHkpVaqx.js";import{al as E,af as T,a9 as W,am as j,n as I,a4 as D}from"./vendor-icons-BNtvBbnj.js";import"./vendor-react-CX88sFS5.js";function $(){return R({queryKey:["maintenance"],queryFn:()=>b("/config/maintenance")})}function _(){const t=O();return k({mutationFn:r=>b("/config/maintenance",{method:"PUT",body:JSON.stringify(r)}),onSuccess:()=>{t.invalidateQueries({queryKey:["maintenance"]})}})}function q(){return k({mutationFn:t=>b("/dba/prune",{method:"POST",body:JSON.stringify(t)})})}function v({checked:t,onToggle:r,label:a,hint:s,safety:i,value:l,onChange:c}){const n=i==="safe"?W:i==="moderate"?E:T,o=i==="safe"?"text-status-success":i==="moderate"?"text-status-warning":"text-status-error",m=i==="safe"?"Safe":i==="moderate"?"Careful":"Permanent";return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer w-80 shrink-0",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:x=>r(x.target.checked),className:"w-4 h-4 rounded border-border accent-accent shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-text-primary",children:a}),e.jsxs("span",{className:`flex items-center gap-0.5 text-[9px] ${o}`,children:[e.jsx(n,{className:"w-3 h-3",strokeWidth:1.5}),m]})]}),e.jsx("p",{className:"text-[10px] text-text-tertiary",children:s})]})]}),e.jsx("select",{value:l,onChange:x=>c(x.target.value),disabled:!t,className:`select text-xs w-36 transition-opacity ${t?"":"opacity-40 cursor-not-allowed"}`,children:g.map(x=>e.jsx("option",{value:x.value,children:x.label},x.value))})]})}function L(){return e.jsxs("div",{className:"flex items-start gap-2 mt-2 px-3 py-2 rounded bg-surface-sunken",children:[e.jsx(j,{className:"w-3.5 h-3.5 text-text-tertiary shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[10px] text-text-tertiary leading-relaxed",children:"Stripping preserves workflow results and timeline data needed for the execution detail view. Transient jobs are internal bookkeeping that accumulates over time."})]})}const f={pruneJobs:!0,expire:"30 days",engineStreams:!0,engineStreamsExpire:"1 day",workerStreams:!0,workerStreamsExpire:"90 days",stripAttributes:!1,pruneTransient:!1};function N(t){return t.pruneJobs||t.engineStreams||t.workerStreams||t.stripAttributes||t.pruneTransient}function P({fields:t,onChange:r}){const a=(s,i)=>r({...t,[s]:i});return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Stream Messages"}),e.jsx("p",{className:"text-[10px] text-text-tertiary mb-4",children:"Processed routing messages. Already consumed — safe to remove after a short retention window."}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(v,{checked:t.engineStreams,onToggle:s=>a("engineStreams",s),label:"Engine messages",hint:"Internal orchestration signals",safety:"safe",value:t.engineStreamsExpire,onChange:s=>a("engineStreamsExpire",s)}),e.jsx(v,{checked:t.workerStreams,onToggle:s=>a("workerStreams",s),label:"Worker messages",hint:"Activity dispatch and response payloads",safety:"safe",value:t.workerStreamsExpire,onChange:s=>a("workerStreamsExpire",s)})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-1",children:"Completed Workflows"}),e.jsx("p",{className:"text-[10px] text-text-tertiary mb-4",children:"Choose how to handle completed workflow records. Reducing strips step-level detail but keeps the workflow and its results. Deleting removes the record entirely."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"flex items-start gap-2.5 cursor-pointer",children:[e.jsx("input",{type:"radio",name:"workflow-cleanup",checked:!t.stripAttributes&&!t.pruneJobs,onChange:()=>r({...t,stripAttributes:!1,pruneJobs:!1}),className:"w-4 h-4 mt-0.5 accent-accent shrink-0"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-text-primary",children:"Keep as-is"}),e.jsx("p",{className:"text-[10px] text-text-tertiary",children:"No changes to completed workflow records."})]})]}),e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsxs("label",{className:"flex items-start gap-2.5 cursor-pointer w-80 shrink-0",children:[e.jsx("input",{type:"radio",name:"workflow-cleanup",checked:t.stripAttributes&&!t.pruneJobs,onChange:()=>r({...t,stripAttributes:!0,pruneJobs:!1}),className:"w-4 h-4 mt-0.5 accent-accent shrink-0"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-text-primary",children:"Reduce completed workflows"}),e.jsxs("span",{className:"flex items-center gap-0.5 text-[9px] text-status-warning",children:[e.jsx(E,{className:"w-3 h-3",strokeWidth:1.5}),"Careful"]})]}),e.jsx("p",{className:"text-[10px] text-text-tertiary",children:"Strips step-level execution detail (activity inputs/outputs, internal state). Workflow results and timeline are preserved."})]})]}),e.jsx("select",{value:t.expire,onChange:s=>a("expire",s.target.value),disabled:!t.stripAttributes||t.pruneJobs,className:`select text-xs w-36 transition-opacity mt-0.5 ${!t.stripAttributes||t.pruneJobs?"opacity-40 cursor-not-allowed":""}`,children:g.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))})]}),e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsxs("label",{className:"flex items-start gap-2.5 cursor-pointer w-80 shrink-0",children:[e.jsx("input",{type:"radio",name:"workflow-cleanup",checked:t.pruneJobs,onChange:()=>r({...t,pruneJobs:!0,stripAttributes:!1}),className:"w-4 h-4 mt-0.5 accent-accent shrink-0"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-text-primary",children:"Delete completed workflows"}),e.jsxs("span",{className:"flex items-center gap-0.5 text-[9px] text-status-error",children:[e.jsx(T,{className:"w-3 h-3",strokeWidth:1.5}),"Permanent"]})]}),e.jsx("p",{className:"text-[10px] text-text-tertiary",children:"Permanently removes workflow records. Results, timeline, and all execution data are deleted and cannot be recovered."})]})]}),e.jsx("select",{value:t.expire,onChange:s=>a("expire",s.target.value),disabled:!t.pruneJobs,className:`select text-xs w-36 transition-opacity mt-0.5 ${t.pruneJobs?"":"opacity-40 cursor-not-allowed"}`,children:g.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))})]})]}),e.jsx(L,{})]})]})}function p({label:t,value:r}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-light text-text-primary",children:r.toLocaleString()}),e.jsx("p",{className:"text-[10px] text-text-tertiary",children:t})]})}function U(){const t=q(),[r,a]=d.useState(f),[s,i]=d.useState(null),[l,c]=d.useState(!1),n=()=>{i(null),t.mutate({expire:r.expire,jobs:r.pruneJobs,engineStreams:r.engineStreams,engineStreamsExpire:r.engineStreamsExpire,workerStreams:r.workerStreams,workerStreamsExpire:r.workerStreamsExpire,attributes:r.stripAttributes,pruneTransient:r.pruneTransient},{onSuccess:o=>{i(o),c(!1)}})};return e.jsxs("div",{className:"space-y-8",children:[e.jsx(P,{fields:r,onChange:a}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-surface-border",children:[e.jsx("p",{className:"text-[10px] text-text-tertiary",children:N(r)?"This action permanently deletes data and cannot be undone.":"Select at least one operation to enable pruning."}),e.jsx("button",{onClick:()=>c(!0),disabled:!N(r)||t.isPending,className:"bg-status-error text-white px-4 py-1.5 rounded-md text-xs hover:opacity-90 transition-opacity disabled:opacity-40 shrink-0",children:t.isPending?"Pruning...":"Prune Now"})]}),s&&e.jsxs("div",{className:"bg-surface-sunken rounded-md px-4 py-3",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-2",children:"Results"}),e.jsxs("div",{className:"flex flex-wrap gap-6",children:[s.jobs!=null&&s.jobs>0&&e.jsx(p,{label:"Jobs deleted",value:s.jobs}),s.engineStreams!=null&&s.engineStreams>0&&e.jsx(p,{label:"Engine streams",value:s.engineStreams}),s.workerStreams!=null&&s.workerStreams>0&&e.jsx(p,{label:"Worker streams",value:s.workerStreams}),s.streams!=null&&s.engineStreams==null&&s.streams>0&&e.jsx(p,{label:"Streams",value:s.streams}),s.attributes!=null&&s.attributes>0&&e.jsx(p,{label:"Artifacts stripped",value:s.attributes}),s.transient!=null&&s.transient>0&&e.jsx(p,{label:"Transient deleted",value:s.transient}),s.marked!=null&&s.marked>0&&e.jsx(p,{label:"Marked pruned",value:s.marked}),Object.values(s).every(o=>!o||o===0)&&e.jsx("p",{className:"text-xs text-text-tertiary",children:"Nothing to prune within the selected retention windows."})]})]}),t.error&&e.jsx("p",{className:"text-xs text-status-error",children:t.error.message}),e.jsx(M,{open:l,onClose:()=>c(!1),title:"Confirm Prune",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-secondary",children:"This will permanently delete data. This action cannot be undone."}),e.jsxs("ul",{className:"text-xs text-text-secondary space-y-1 list-disc list-inside",children:[r.pruneJobs&&e.jsxs("li",{children:["Delete jobs older than ",r.expire]}),r.engineStreams&&e.jsxs("li",{children:["Delete engine streams older than ",r.engineStreamsExpire]}),r.workerStreams&&e.jsxs("li",{children:["Delete worker streams older than ",r.workerStreamsExpire]}),r.stripAttributes&&e.jsx("li",{children:"Strip execution artifacts from completed jobs"}),r.pruneTransient&&e.jsx("li",{children:"Delete transient (entity-less) jobs"})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[e.jsx("button",{onClick:()=>c(!1),className:"btn-secondary text-xs",children:"Cancel"}),e.jsx("button",{onClick:n,className:"bg-status-error text-white px-3 py-1.5 rounded-md text-xs hover:opacity-90 transition-opacity",disabled:t.isPending,children:t.isPending?"Pruning...":"Confirm Prune"})]})]})})]})}function w(t){var c;if(!((c=t==null?void 0:t.rules)!=null&&c.length))return f;const r=t.rules,a=r.find(n=>n.target==="streams"&&n.action==="delete"),s=r.find(n=>n.target==="jobs"&&n.action==="delete"&&n.hasEntity===!1),i=r.find(n=>n.target==="jobs"&&n.action==="prune"&&n.hasEntity===!0),l=r.find(n=>n.target==="jobs"&&n.action==="delete"&&n.pruned===!0);return{pruneJobs:!!l,expire:(l==null?void 0:l.olderThan)??"180 days",engineStreams:!!a,engineStreamsExpire:(a==null?void 0:a.olderThan)??"1 day",workerStreams:!!a,workerStreamsExpire:(a==null?void 0:a.olderThan)??"90 days",stripAttributes:!!i,pruneTransient:!!s}}function H(t){const r=[];return t.engineStreams&&r.push({target:"streams",action:"delete",olderThan:t.engineStreamsExpire}),t.workerStreams&&t.workerStreamsExpire!==t.engineStreamsExpire&&r.push({target:"streams",action:"delete",olderThan:t.workerStreamsExpire}),t.pruneTransient&&r.push({target:"jobs",action:"delete",olderThan:t.expire,hasEntity:!1}),t.stripAttributes&&r.push({target:"jobs",action:"prune",olderThan:t.expire,hasEntity:!0}),t.pruneJobs&&r.push({target:"jobs",action:"delete",olderThan:t.expire,pruned:!0}),r}function S(t){var r;return((r=C.find(a=>a.value===t))==null?void 0:r.label)??""}function K(){const{data:t,isLoading:r}=$(),a=_(),[s,i]=d.useState(""),[l,c]=d.useState(f),[n,o]=d.useState(""),m=d.useCallback(()=>{t!=null&&t.config&&(i(t.config.schedule),c(w(t.config)),o(JSON.stringify({schedule:t.config.schedule,fields:w(t.config)})))},[t]);d.useEffect(()=>{m()},[m]);const x=JSON.stringify({schedule:s,fields:l}),y=n!==""&&x!==n,h=(t==null?void 0:t.active)??!1,J=()=>{const u=H(l);a.mutate({schedule:s,rules:u},{onSuccess:()=>{o(JSON.stringify({schedule:s,fields:l}))}})},A=()=>{m()};return r?e.jsx("div",{className:"animate-pulse h-40 bg-surface-sunken rounded"}):e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_auto] gap-10",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-4",children:"Schedule"}),e.jsxs("div",{className:"flex items-end gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-[10px] text-text-tertiary mb-1",children:"Cron Expression"}),e.jsx("input",{type:"text",value:s,onChange:u=>i(u.target.value),placeholder:"0 2 * * *",className:"input text-xs font-mono w-48"})]}),e.jsx("div",{children:e.jsxs("div",{className:"flex items-center gap-1.5 h-8",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${h?"bg-status-success":"bg-text-tertiary"}`}),e.jsx("span",{className:`text-xs ${h?"text-status-success":"text-text-tertiary"}`,children:h?"Active":"Inactive"})]})}),S(s)&&e.jsx("p",{className:"text-xs text-text-tertiary h-8 flex items-center",children:S(s)})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:C.map(u=>e.jsx("button",{type:"button",onClick:()=>i(u.value),className:`px-2.5 py-1 text-[10px] rounded-full transition-colors ${s===u.value?"bg-accent/10 text-accent font-medium":"bg-surface-sunken text-text-tertiary hover:text-text-secondary"}`,children:u.label},u.value))})]}),e.jsxs("div",{className:"lg:w-72",children:[e.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-text-tertiary mb-4",children:"How It Works"}),e.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 rounded bg-surface-sunken",children:[e.jsx(j,{className:"w-3.5 h-3.5 text-text-tertiary shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[10px] text-text-tertiary leading-relaxed",children:"Rules execute sequentially on each cron cycle. Engine streams can be pruned aggressively since they only contain internal routing data. Worker streams should be retained longer to preserve execution playback and input enrichment."})]})]})]}),e.jsx(P,{fields:l,onChange:c}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-surface-border",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[y&&e.jsx("button",{onClick:A,className:"text-[10px] text-text-tertiary hover:text-text-primary transition-colors",children:"Revert changes"}),a.error&&e.jsx("p",{className:"text-xs text-status-error",children:a.error.message})]}),e.jsx("button",{onClick:J,disabled:!y||!s.trim()||a.isPending,className:"btn-primary text-xs disabled:opacity-40 shrink-0",children:a.isPending?"Saving...":"Save Schedule"})]})]})}function Q({mode:t,onChange:r}){const a=(s,i,l)=>e.jsxs("button",{onClick:()=>r(s),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md transition-colors ${t===s?"bg-accent/10 text-accent font-medium":"text-text-tertiary hover:text-text-secondary hover:bg-surface-hover"}`,children:[i,l]});return e.jsxs("div",{className:"flex gap-1 p-0.5 bg-surface-sunken rounded-lg w-fit",children:[a("prune",e.jsx(I,{className:"w-3.5 h-3.5"}),"Prune Now"),a("schedule",e.jsx(D,{className:"w-3.5 h-3.5"}),"Schedule")]})}function ee(){const[t,r]=d.useState("schedule");return e.jsxs("div",{children:[e.jsx(F,{title:"DB Maintenance",docsHash:"#docs:dashboard.md:db-maintenance",actions:e.jsx(Q,{mode:t,onChange:r})}),e.jsxs("div",{className:"flex items-start gap-2 px-4 py-3 mb-8 rounded-md bg-accent/5 border border-accent/10",children:[e.jsx(j,{className:"w-4 h-4 text-accent shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-text-secondary leading-relaxed",children:"Workflow data grows as jobs complete. Operations are ordered safest-first: stream messages are always safe to prune, workflow reduction preserves results, and deletion is permanent."})]}),t==="prune"?e.jsx(U,{}):e.jsx(K,{})]})}export{ee as MaintenancePage};
|
|
2
|
-
//# sourceMappingURL=index-Byp8BDPs.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,a as f}from"./vendor-query-B2UbickB.js";import{u as L,a as D,b as E,c as R}from"./mcp-xh7T0I-f.js";import{E as z}from"./EmptyState-BcsfPq9T.js";import{C as F}from"./ConfirmDeleteModal-dOxidrSR.js";import{P}from"./PageHeader-Bo0SpcCK.js";import{F as I,a as _,b as T}from"./FilterBar-Ck4K4rzu.js";import{S as $}from"./StickyPagination-F9FZsRy9.js";import{u as q}from"./useFilterParams-DZCAaBC7.js";import{u as A}from"./useExpandedRows-CkcEntB-.js";import{T as B}from"./ToolTestPanel-CY_PLZSe.js";import{R as H,a as v}from"./RowActions-Dg-Fsm5O.js";import{S as G}from"./StatusBadge-XQlNFwmH.js";import{T as J}from"./ToolPill-RP2Tvlrx.js";import{S as O}from"./ServerName-CEOFF7UG.js";import{m as U,ag as W,ah as K,J as Q,n as V,P as X}from"./vendor-icons-BNtvBbnj.js";import{c as Y}from"./vendor-react-CX88sFS5.js";import"./index-DcpCR9c_.js";import"./Modal-DEODGeqx.js";import"./RunAsSelector-DC4SLtTq.js";import"./BotPicker-CM-_u73k.js";import"./bots-BzEs6Q9L.js";function Z(r){var t,a;return!!((t=r.metadata)!=null&&t.builtin)||!!((a=r.transport_config)!=null&&a.builtin)}function ee(r,t){var o;if(!t)return!0;const a=t.toLowerCase();return r.name.toLowerCase().includes(a)||(o=r.description)!=null&&o.toLowerCase().includes(a)||(r.tags??[]).some(d=>d.toLowerCase().includes(a))?!0:(r.tool_manifest??[]).some(d=>{var p;return d.name.toLowerCase().includes(a)||((p=d.description)==null?void 0:p.toLowerCase().includes(a))})}function te(r,t){if(!t)return r;const a=t.toLowerCase();return r.filter(c=>{var o;return c.name.toLowerCase().includes(a)||((o=c.description)==null?void 0:o.toLowerCase().includes(a))})}function se({server:r,expanded:t,onToggle:a,onEdit:c,onDelete:o,onTryTool:d,connect:p,disconnect:b,visibleTools:h}){const n=r.tool_manifest??[],u=Z(r),x=r.tags??[];return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:n.length>0?a:void 0,className:`group/row border-b border-surface-border/50 transition-colors duration-100 ${n.length>0?"cursor-pointer row-hover":""}`,children:[e.jsx("td",{className:"px-6 py-2.5",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`transition-transform duration-150 ${t?"rotate-90":""} ${n.length===0?"opacity-0":"text-text-tertiary"}`,children:e.jsx(U,{size:14})}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(O,{name:r.name,serverId:r.id,short:!1}),n.length>0&&e.jsx("sup",{className:"text-[9px] font-normal text-accent/70",children:n.length})]}),x.length>0&&e.jsxs("div",{className:"flex gap-1 ml-auto shrink-0",children:[x.slice(0,3).map(i=>e.jsx("span",{className:"inline-block px-1.5 py-0 text-[9px] text-text-tertiary bg-surface-sunken rounded",children:i},i)),x.length>3&&e.jsx("span",{className:"text-[9px] text-text-quaternary",title:x.slice(3).join(", "),children:"…"})]})]})}),e.jsx("td",{className:"px-4 py-2.5 w-28 whitespace-nowrap",children:e.jsx(G,{status:r.status})}),e.jsx("td",{className:"px-4 py-2.5 w-16",children:e.jsxs(H,{children:[!u&&(r.status==="connected"?e.jsx(v,{icon:W,title:"Disconnect server",onClick:()=>b.mutate(r.id)}):e.jsx(v,{icon:K,title:"Connect server",onClick:()=>p.mutate(r.id),colorClass:"text-text-tertiary hover:text-status-success"})),e.jsx(v,{icon:Q,title:"Edit server",onClick:c}),!u&&e.jsx(v,{icon:V,title:"Delete server",onClick:o,colorClass:"text-text-tertiary hover:text-status-error"})]})})]}),t&&h.map(i=>e.jsxs("tr",{onClick:()=>d(i),className:"group/row cursor-pointer hover:bg-surface-hover/50 transition-colors border-b border-surface-border/15",children:[e.jsxs("td",{className:"pl-14 pr-6 py-2.5",children:[e.jsx(J,{name:i.name,size:"md"}),i.description&&e.jsx("p",{className:"text-[11px] leading-snug text-text-quaternary mt-0.5",children:i.description})]}),e.jsx("td",{className:"px-4 py-2.5 w-28"}),e.jsx("td",{className:"px-4 py-2.5 w-16",children:e.jsx("div",{className:"flex items-center justify-end",children:e.jsx("button",{onClick:m=>{m.stopPropagation(),d(i)},className:"opacity-0 group-hover/row:opacity-100 transition-opacity text-text-tertiary hover:text-accent",title:"Try tool",children:e.jsx(X,{className:"w-3.5 h-3.5",strokeWidth:1.5})})})})]},i.name))]})}function Se(){const r=Y(),{filters:t,setFilter:a,pagination:c}=q({filters:{status:"",search:"",tag:""}}),{data:o,isLoading:d}=L({status:t.status||void 0,search:t.search||void 0,tags:t.tag||void 0}),p=D(),b=E(),h=R(),[n,u]=f.useState(null),{expandedIds:x,toggle:i}=A("lt:expanded:mcp-servers"),[m,C]=f.useState(null),g=(o==null?void 0:o.servers)??[],y=(o==null?void 0:o.total)??0,k=f.useMemo(()=>{const s=new Set;for(const l of g)for(const w of l.tags??[])s.add(w);return[...s].sort().map(l=>({value:l,label:l}))},[g]),j=f.useMemo(()=>t.search?g.filter(s=>ee(s,t.search)):g,[g,t.search]);f.useEffect(()=>{if(!t.search)return;const s=t.search.toLowerCase();for(const l of j)(l.tool_manifest??[]).some(N=>{var S;return N.name.toLowerCase().includes(s)||((S=N.description)==null?void 0:S.toLowerCase().includes(s))})&&!x.has(l.id)&&i(l.id)},[t.search,j]);const M=()=>{n&&h.mutate(n.id,{onSuccess:()=>u(null)})};return d?e.jsxs("div",{children:[e.jsx(P,{title:"MCP Server Tools"}),e.jsx("div",{className:"animate-pulse space-y-0",children:Array.from({length:5}).map((s,l)=>e.jsx("div",{className:"h-14 border-b last:border-b-0 px-6 flex items-center",children:e.jsx("div",{className:"h-3 bg-surface-sunken rounded w-full"})},l))})]}):e.jsxs("div",{children:[e.jsx(P,{title:"MCP Server Tools",docsHash:"#docs:dashboard.md:mcp-server-tools",actions:e.jsx("button",{onClick:()=>r("/mcp/servers/new"),className:"btn-primary text-xs",children:"Register Server"})}),e.jsx("p",{className:"text-sm text-text-secondary mb-6 max-w-2xl leading-relaxed",children:"Registered MCP servers and their available tools. Each server exposes tools that can be used by the MCP Tool Designer."}),e.jsxs(I,{children:[e.jsx(_,{label:"Search",value:t.search,onChange:s=>a("search",s),placeholder:"Server or tool name..."}),e.jsx(T,{label:"Tag",value:t.tag,onChange:s=>a("tag",s),options:k}),e.jsx(T,{label:"Status",value:t.status,onChange:s=>a("status",s),options:[{value:"registered",label:"Registered"},{value:"connected",label:"Connected"},{value:"error",label:"Error"},{value:"disconnected",label:"Disconnected"}]})]}),e.jsxs("div",{className:"flex gap-0 ",children:[e.jsxs("div",{className:`${m?"flex-1 min-w-0":"w-full"} transition-all`,children:[j.length===0?e.jsx(z,{title:"No servers found"}):e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"sticky top-[2.75rem] z-10 bg-surface px-6 py-3 text-left text-[10px] font-semibold uppercase tracking-widest text-text-tertiary",children:"Server / Tool"}),e.jsx("th",{className:"sticky top-[2.75rem] z-10 bg-surface px-4 py-3 text-left text-[10px] font-semibold uppercase tracking-widest text-text-tertiary w-28",children:"Status"}),e.jsx("th",{className:"sticky top-[2.75rem] z-10 bg-surface w-16"})]})}),e.jsx("tbody",{children:j.map(s=>e.jsx(se,{server:s,expanded:x.has(s.id),onToggle:()=>i(s.id),onEdit:()=>r(`/mcp/servers/${s.id}`),onDelete:()=>u(s),onTryTool:l=>C({serverId:s.id,serverName:s.name,tool:l}),connect:p,disconnect:b,visibleTools:te(s.tool_manifest??[],t.search)},s.id))})]}),e.jsx($,{page:c.page,totalPages:c.totalPages(y),onPageChange:c.setPage,total:y,pageSize:c.pageSize,onPageSizeChange:c.setPageSize})]}),m&&e.jsx("div",{className:"w-[380px] shrink-0 sticky top-0 max-h-screen overflow-y-auto",children:e.jsx(B,{serverId:m.serverId,serverName:m.serverName,tool:m.tool,onClose:()=>C(null)})})]}),e.jsx(F,{open:!!n,onClose:()=>u(null),onConfirm:M,title:"Delete MCP Server",description:e.jsxs(e.Fragment,{children:["Delete"," ",e.jsx("span",{className:"font-medium text-text-primary",children:n==null?void 0:n.name}),"? This will remove the server registration."]}),isPending:h.isPending,error:h.error})]})}export{Se as McpServersPage};
|
|
2
|
-
//# sourceMappingURL=index-ByxH4qQ-.js.map
|