agent-webui 2.8.1__tar.gz → 2.8.2__tar.gz
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.
- {agent_webui-2.8.1 → agent_webui-2.8.2}/PKG-INFO +2 -2
- {agent_webui-2.8.1 → agent_webui-2.8.2}/README.md +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/AdminView-DkoVw_JQ.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/AdminView-BIFRCbto.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/AgentLibraryView-Dw08aoiC.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/AgentLibraryView-aNq65894.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ArboraReadinessView-Dd-yF6Pc.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ArboraReadinessView-BmWLG_D9.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/AtlasView-Dw_6qT5o.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/AtlasView-bOHeqjzz.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/Availability-Ajw5i9OT.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/Availability-DcNRbzdy.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/BrokerView-DI5UtgKp.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/BrokerView-B3w_c03n.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/CatalogueView-DrB6Bt9v.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/CatalogueView-B0iAT03z.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ChartPage-BFlYluks.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ChartPage-CRAD2z1k.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/CodeGraphView-DoH8F7vn.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/CodeGraphView-BeQf4kUO.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ConfigurationView-BcWFtUz4.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ConfigurationView-B7myL6KX.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ConsoleConfirmView-BBmcpDTh.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ConsoleConfirmView-DC8vQRT4.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ContactPage-Rjy-Fzt1.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ContactPage-CrUMpT6z.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/CypherReplView-DXbPrlX9.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/CypherReplView-B_Gps99Z.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/DashboardView-Cj-Dyoz6.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/DashboardView-Dxfr5-0-.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/DashboardsView-B7N8NUhC.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/DashboardsView-DAhfgrRe.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/DataAnalystView-BP36t40R.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/DataAnalystView-DTZm34Nz.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/EcosystemView-DQhFdYI8.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/EcosystemView-KfiSPiGs.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ExploreQueryWorkspace-CQAypB0T.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ExploreQueryWorkspace-Dd3_FYVu.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ExtractionView-zeBq8fuD.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ExtractionView-VASGV56_.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/FilesView-Bh3WCxLU.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/FilesView-DLrYatRc.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/FleetView-DaJBH4yv.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/FleetView-C99Ga-hI.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/GoalsView-arsjahLZ.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/GoalsView-DAu9qK9a.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/Graph3DLodView-_3yOQ99X.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/Graph3DLodView-Bsfy0liY.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/Graph3DView-DCtaQVl1.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/Graph3DView-DwJKaNXc.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/GraphCanvas-CSptFCKQ.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/GraphCanvas-D615Ydp_.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/GraphView-DZXqwt-s.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/GraphView-BPbJ01X-.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ImportExportModal-D4ckXCpj.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ImportExportModal-B3fBFl0t.js +1 -1
- agent_webui-2.8.2/agent/agent_webui/dist/assets/IntegrationsView-BoP-b04a.js +2 -0
- agent_webui-2.8.1/agent/agent_webui/dist/assets/KnowledgeBaseView-CHEsj_tw.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/KnowledgeBaseView-jMCJn12P.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/KnowledgeView-B7qfWgXW.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/KnowledgeView-C08lo1OX.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/LLMTemplatesView-QaMibiWE.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/LLMTemplatesView-DPgr4JMg.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/LearnView-BISyBztX.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/LearnView-CwniIN2x.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/LiveDashboardsView-CM8T3z-S.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/LiveDashboardsView-BVlEIber.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/MagmaView-BW8WOf8d.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/MagmaView-Btqs3FEc.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/MarketsCalendar-EbKtpokY.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/MarketsCalendar-CzDpujKF.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/MarketsHome-9vobkP13.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/MarketsHome-CDlfVGyj.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/MarketsMenu-CHxdEPCF.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/MarketsMenu-B1bHhcpg.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/MarketsNews-C3RbvMk5.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/MarketsNews-DLO5rNe6.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/MarketsPortfolio-DyT66gGG.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/MarketsPortfolio-CFPLxeNB.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/MarketsShell-DKuBGMC2.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/MarketsShell-NPgz5G8J.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/McpAppsView-CKXmpZ9U.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/McpAppsView-w7Dr4bvn.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/MemoryView-BZEBvpR0.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/MemoryView-aQG3zHCd.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/NodeTypeBreakdown-BBddvmF0.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/NodeTypeBreakdown-BOMv1ZeK.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/NotFoundPage-D-8pbBKi.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/NotFoundPage-C2ECSjyN.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/Notices-DNamjpvv.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/Notices-BMgxi7sA.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ObjectExplorerView-DR-plmL6.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ObjectExplorerView--g4BJ5dV.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ObjectView-DX5PvjM9.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ObjectView-CbIoH6sb.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ObservabilityView-CtC3wFx4.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ObservabilityView-CfalBbSz.js +1 -1
- agent_webui-2.8.2/agent/agent_webui/dist/assets/OperateWorkspace-D400qwDi.js +1 -0
- agent_webui-2.8.1/agent/agent_webui/dist/assets/OpsPanelView-B00A1Ix-.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/OpsPanelView-BVKeYxwT.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/PrivacyPage-B5BNv8Wg.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/PrivacyPage-B5f2BGOV.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/PromptsView-D9879-Kf.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/PromptsView-loJvVKRN.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/PublicPageLayout-CZjpqd4R.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/PublicPageLayout-_LKXfe3w.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/SDDView-Ws5WYUZb.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/SDDView-Zjr9UcvP.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/SchedulingView-BBgfCFgt.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/SchedulingView-DR8FPiLA.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/SchemaView-DGhMmwmC.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/SchemaView-ChSQqt9G.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/SessionsView-jRaF2PEh.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/SessionsView-BwsQSk7r.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/SharePage-C4CYYKR7.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/SharePage-DUJXSbfY.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/SkillsView-BkkkGLS1.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/SkillsView-01A_BKpo.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/SparqlView-CRSmtx87.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/SparqlView-CaTSeagP.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/SystemStatusView-CBa2hfoD.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/SystemStatusView-CzjDdbH1.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/TableExplorerView-DgiC5cSe.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/TableExplorerView-Ctnjs49l.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/TemporalGraphView-DVaIqhF7.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/TemporalGraphView-DmNuWXin.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/TermsPage-CwXcVECt.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/TermsPage-Dq5ZQToT.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/ThankYouPage-CkeGuK6U.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/ThankYouPage-CRs3DWs5.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/TrendBadge-Cto5r-1S.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/TrendBadge-DwOOOIwz.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/UsageView-Bhyk0gOG.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/UsageView-DekU27sG.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/UserManagementView-xO_SUluQ.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/UserManagementView-DzKgnC7G.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/VertexView-Bkljwv0n.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/VertexView-COILYrFt.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/VizDemoView-B58FwOSu.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/VizDemoView-DmUb9Zv5.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/WorkWorkspace-B4PMyWKO.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/WorkWorkspace-DOjWpb5z.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/WorkflowEditorView-HfJAp1p3.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/WorkflowEditorView-Bx4xegQ5.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/WorkspaceIDEView-CR_Hg9Rc.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/WorkspaceIDEView-CXBs7DX5.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/chunk-D32TOXHM-KueescCg.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/chunk-D32TOXHM-DlmBzSI9.js +4 -4
- agent_webui-2.8.1/agent/agent_webui/dist/assets/highlighted-body-KQOG7T2V-qSdnQsR5.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/highlighted-body-KQOG7T2V-rcYJ5xue.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/identity-CwkFopGE.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/identity-Ba52P5P-.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/index-BMoFkgmK.css → agent_webui-2.8.2/agent/agent_webui/dist/assets/index-CdIjHcNl.css +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/index-BL_57l7k.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/index-GCzCgfSc.js +4 -4
- agent_webui-2.8.1/agent/agent_webui/dist/assets/loaded-workspace-commands-DS7_oKFh.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/loaded-workspace-commands-BAiOXoYc.js +1 -1
- agent_webui-2.8.2/agent/agent_webui/dist/assets/mermaid-MCJ5UELQ-B2-BBYrw.js +1 -0
- agent_webui-2.8.1/agent/agent_webui/dist/assets/model-BOQvdzSX.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/model-BPtIOW9U.js +2 -2
- agent_webui-2.8.2/agent/agent_webui/dist/assets/preload-helper-BLdHbfdN.js +1 -0
- agent_webui-2.8.1/agent/agent_webui/dist/assets/queries-H1CRh4k4.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/queries-Bn_hp_Ib.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/status-message-JWIBft3W.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/status-message-4rJx-ibz.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/tabs-A3rvoq-T.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/tabs-Bzz5t0iB.js +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/useMutation-jh7EKgU0.js → agent_webui-2.8.2/agent/agent_webui/dist/assets/useMutation-Bw3sL9K4.js +1 -1
- agent_webui-2.8.2/agent/agent_webui/dist/index.html +71 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/server.py +1 -1
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui.egg-info/PKG-INFO +2 -2
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui.egg-info/SOURCES.txt +86 -86
- {agent_webui-2.8.1 → agent_webui-2.8.2}/pyproject.toml +1 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/IntegrationsView-CesADaY9.js +0 -2
- agent_webui-2.8.1/agent/agent_webui/dist/assets/OperateWorkspace-DtojBKUU.js +0 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/mermaid-MCJ5UELQ-F6vEfdbO.js +0 -1
- agent_webui-2.8.1/agent/agent_webui/dist/assets/preload-helper-CRzLMJPS.js +0 -1
- agent_webui-2.8.1/agent/agent_webui/dist/index.html +0 -71
- {agent_webui-2.8.1 → agent_webui-2.8.2}/LICENSE +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__init__.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/conftest.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_api_extensions.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_bound_sweep_regressions.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_browser_control.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_bug_012_github_gitlab_contract.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_chat_resource_routes.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_contact_delivery.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_files_endpoints.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_host.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_markets_app.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_observability.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_oidc_session.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_parity_contract.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_pydantic_ai_compat.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_rbac.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_run_identity.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_security_boundaries.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_served_operations.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_spa_http_status.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/__tests__/test_workspace_helpers_chokepoint.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/api_extensions.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/__init__.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/__init__.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/catalog.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/chart.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/gateway.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/router.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/scanner.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/series.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/session.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/snapshots.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/apps/markets/timeframes.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/auth_policy.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/browser_control.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/browser_control_canonical.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/contact_delivery.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/apple-touch-icon.png +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/ChartPanel-Cxpkw3a6.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/LegalPageContent-BmhwYoKV.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/SessionExpiredNotice-CMttDxWl.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/WorkflowEditorView-DLioOiRN.css +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/activity-DupAOJCR.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/api-jtHn_WxH.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/api-validation-CCoR_LRu.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/app-window-KMAPJoaW.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/arrow-up-DpBEFU1W.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/badge-nQZ87mVE.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/braces-BNz2iAeD.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/bundle-mjs-DIyOrgL5.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/check-CPVKKX8l.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/chevron-down-DYWnPQti.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/chevron-left-BaGXvfgm.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/chevron-right-gs8WU8XT.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/chevron-up-C-rjGU5C.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/circle-alert-ByZ-1ERr.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/circle-dot-In4UilqT.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/contact-C94LhKRg.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/createLucideIcon-DTQSidPf.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-2txhAIHO.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-BHmo3Yb6.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-BKkt828_.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-BLRfKgTy.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-BjAObXUn.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-Bq6o2UDR.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-CWmwEm73.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-DMVqwVuR.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-DcreYulP.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/dist-mp1aFJDC.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/es2015-CgZynitj.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/external-link-Dyd5OsGm.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/eye-D0gCj30e.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/file-text-DqorJKDA.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/folder-open-BrzeUmMg.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/format-DHsGNrOH.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/funnel-Y4IuN8Q7.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/graphology-layout-forceatlas2-CF_uOjtN.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/hard-drive-9fR5RFS9.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/hourglass-1ui486hR.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/layout-grid-B4IFpzLD.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/layout.worker-CnC9u5pP.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/link-2-a9RZxW2S.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/play-D3mjq--Q.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/plus-s20KYBeu.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/react-dom-DAxA-E-a.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/refresh-cw-BVhl5aJX.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/save-CuEdPPgC.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/scan-search-GrqJngl3.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/scroll-area-srEWz9Q3.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/server-CE-xbAAj.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/sliders-vertical-Cr4E50uY.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/sparkles-Bae0tRI0.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/switch-B9Yml2pU.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/tag-D1RiwxuF.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/theme-colors-DKGWsgC0.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/transport-Din6U5N9.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/unavailable-notice-B7WdWNor.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/undo-2-D4EYZLW8.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/upload-DcybBZCN.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/uql-H85wtqTc.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/useQuery-BCV_z3lS.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/utils-C0okervd.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/wifi-off-Dz91unNp.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/assets/x-BdA_yxUR.js +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/favicon-16x16.png +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/favicon-32x32.png +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/favicon-48x48.png +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/favicon.ico +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/favicon.png +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/favicon.svg +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/icon-192x192.png +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/icon-512x512.png +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/og-image-v1.png +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/og-image-v1.svg +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/robots.txt +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/site.webmanifest +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/sitemap.xml +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/dist/spa-routes.json +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/host.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/icon.png +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/observability.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/oidc_session.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/orchestrator_model.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/public_shell.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/rbac.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/skills/__init__.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/skills/agent-webui-development/SKILL.md +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/skills/kg-webui-admin/SKILL.md +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/skills/kg-webui-dashboards/SKILL.md +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/skills/kg-webui-extraction/SKILL.md +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/skills/kg-webui-graphviz/SKILL.md +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/skills/kg-webui-ontology-operator/SKILL.md +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui/skills/kg-webui-swe/SKILL.md +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui.egg-info/dependency_links.txt +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui.egg-info/entry_points.txt +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui.egg-info/requires.txt +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/agent/agent_webui.egg-info/top_level.txt +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/setup.cfg +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_dashboard_entrypoint.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_eslint_hook_contract.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_explicit_auth_modes.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_gate_wrappers.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_graph_visualization.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_health_liveness_endpoint.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_identity_boundary.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_init.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_log_failure_error_code.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_package_author_privacy.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_privacy_boundaries.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_release_concurrency.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_release_gate_order.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_release_publication.py +0 -0
- {agent_webui-2.8.1 → agent_webui-2.8.2}/tests/test_startup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-webui
|
|
3
|
-
Version: 2.8.
|
|
3
|
+
Version: 2.8.2
|
|
4
4
|
Summary: Agent Web Interface for Pydantic AI Agents
|
|
5
5
|
Author-email: Repository Maintainers <maintainers@knuckles.team>
|
|
6
6
|
License: MIT
|
|
@@ -100,7 +100,7 @@ credentials and gateway delegation on the server side.
|
|
|
100
100
|
|---|---|
|
|
101
101
|
| Browser presentation, local interaction state, accessible route composition, and the FastAPI boundary | Arbora owns public routing, identity, policy, and fleet supervision; Agent Utilities owns agent behavior; Epistemic Graph owns durable knowledge; connector services own external-system effects |
|
|
102
102
|
|
|
103
|
-
Current package Version: 2.8.
|
|
103
|
+
Current package Version: 2.8.2.
|
|
104
104
|
|
|
105
105
|
## Key capabilities
|
|
106
106
|
|
|
@@ -54,7 +54,7 @@ credentials and gateway delegation on the server side.
|
|
|
54
54
|
|---|---|
|
|
55
55
|
| Browser presentation, local interaction state, accessible route composition, and the FastAPI boundary | Arbora owns public routing, identity, policy, and fleet supervision; Agent Utilities owns agent behavior; Epistemic Graph owns durable knowledge; connector services own external-system effects |
|
|
56
56
|
|
|
57
|
-
Current package Version: 2.8.
|
|
57
|
+
Current package Version: 2.8.2.
|
|
58
58
|
|
|
59
59
|
## Key capabilities
|
|
60
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./bundle-mjs-DIyOrgL5.js";import{t as r}from"./createLucideIcon-DTQSidPf.js";import{t as i}from"./refresh-cw-BVhl5aJX.js";import{t as a}from"./server-CE-xbAAj.js";import{t as o}from"./badge-nQZ87mVE.js";import{E as s,S as c,a as l,c as u,f as d,w as f,x as p}from"./api-validation-CCoR_LRu.js";import{E as m,Jn as h,Nn as g,O as _,T as v,Un as y,Yt as b,Zn as x,ar as S,dn as C,dt as w,fr as ee,ft as te,k as T,mt as ne,or as re,rn as E,rr as ie,w as D,yn as ae,zn as O}from"./index-BL_57l7k.js";import{i as oe,n as k,r as se,t as ce}from"./tabs-A3rvoq-T.js";import{n as A}from"./identity-CwkFopGE.js";import{t as j}from"./unavailable-notice-B7WdWNor.js";import M from"./UserManagementView-xO_SUluQ.js";var N={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};N.node;var le=r(N),P={name:`database-backup`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 12a9 3 0 0 0 5 2.69`,key:`1ui2ym`}],[`path`,{d:`M21 9.3V5`,key:`6k6cib`}],[`path`,{d:`M3 5v14a9 3 0 0 0 6.47 2.88`,key:`i62tjy`}],[`path`,{d:`M12 12v4h4`,key:`1bxaet`}],[`path`,{d:`M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16`,key:`1f4ei9`}]]};P.node;var ue=r(P),F=n(e(),1),I=c({endpoint:s(),local:d(),reachable:d().optional(),breaker:s().optional()}),L=c({mode:u([`single`,`sharded`]),default_graph:s().optional(),endpoints:l(I)});function R(){return w(`/dashboard/daemon/shards`,L)}function z(){return w(`/dashboard/daemon/status`)}var B=c({total_nodes:p(),total_relationships:p(),available:d().optional(),source_graphs:l(s()).optional(),degraded_graphs:l(s()).optional(),partial:d().optional()}),V=c({by_type:f(s(),p()),type_count:p(),total_typed_nodes:p(),truncated:d(),available:d(),source_graphs:l(s()),degraded_graphs:l(s()),partial:d()}),H=c({source_systems:l(s())});function U(){return w(`/enhanced/graph/stats`,B)}function de(){return w(`/enhanced/graph/node-types`,V)}function fe(){return w(`/enhanced/code/instances`,H)}function pe(){return ne(`/configure`,{action:`backup_status`})}function me(){return te(`/graph/configure`,{action:`backup_create`})}var W=t();function G(e){return e===void 0?`-`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function he({stats:e,placement:t}){return(0,W.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 gap-4`,children:[(0,W.jsxs)(`div`,{className:`rounded border p-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nodes`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:G(e?.total_nodes)})]}),(0,W.jsxs)(`div`,{className:`rounded border p-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Relationships`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:G(e?.total_relationships)})]}),(0,W.jsxs)(`div`,{className:`rounded border p-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Shard placement`}),(0,W.jsx)(`p`,{className:`text-lg font-semibold`,children:t.length?`${String(t.length)} shard(s)`:`-`})]})]})}function ge({byType:e,nodeTypes:t}){return e.length===0?null:(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`p`,{className:`text-sm font-medium mb-2 flex items-center gap-1`,children:[(0,W.jsx)(x,{className:`size-3.5`}),`Counts by type`,(0,W.jsxs)(`span`,{className:`text-muted-foreground font-normal`,children:[`(`,G(t?.type_count),` types, `,G(t?.total_typed_nodes),` nodes)`]})]}),t?.partial===!0&&(0,W.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 text-xs text-amber-500`,children:[(0,W.jsx)(C,{className:`size-3.5 shrink-0`}),`Partial — excludes `,t.degraded_graphs.join(`, `),`.`]}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(([e,t])=>(0,W.jsxs)(o,{variant:`outline`,className:`gap-1`,children:[e,(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:G(t)})]},e))})]})}function _e(e){return e?.partial===!0?(0,W.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-amber-500`,children:[(0,W.jsx)(C,{className:`size-3.5 shrink-0`}),`These totals are partial — `,(e.degraded_graphs??[]).join(`, `),` could not be read.`]}):null}function ve(e){return e.length===0?null:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Placed on`}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,W.jsxs)(o,{variant:e.reachable?`default`:`destructive`,className:`font-mono text-xs gap-1`,children:[e.endpoint,e.local&&(0,W.jsx)(`span`,{className:`opacity-70`,children:`· local`})]},e.endpoint))})]})}function ye({defaultGraph:e,stats:t,placement:n,byType:r,nodeTypes:i}){return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsxs)(T,{className:`text-base flex items-center gap-2`,children:[(0,W.jsx)(g,{className:`size-4`}),(0,W.jsx)(`span`,{className:`font-mono`,children:e}),(0,W.jsx)(o,{variant:`secondary`,children:`active`})]}),(0,W.jsx)(m,{children:`The active graph tenant served by this backend.`})]}),(0,W.jsxs)(v,{className:`space-y-4`,children:[he({stats:t,placement:n}),ge({byType:r,nodeTypes:i}),_e(t),ve(n)]})]})}function be({loading:e,sourcesUnavailable:t,sources:n}){return e?(0,W.jsx)(O,{className:`size-4 animate-spin text-muted-foreground`}):t?(0,W.jsx)(j,{what:`Indexed source tenants`}):n.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No indexed source tenants reported.`}):(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>(0,W.jsx)(o,{variant:`secondary`,className:`font-mono text-xs`,children:e},e))})}function xe(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(null),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)([]),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(!1),p=async()=>{f(!0);let[e,n,i,a]=await Promise.all([U(),R(),fe(),de()]);t(e.ok?e.data:null),r(a.ok?a.data:null),o(n.ok?n.data:null),c(i.ok&&i.data?i.data.source_systems:[]),u(!i.ok),f(!1)};(0,F.useEffect)(()=>{p()},[]);let g=a?.default_graph??`__commons__`,y=a?.endpoints??[],b=Object.entries(n?.by_type??{}).sort((e,t)=>t[1]-e[1]);return(0,W.jsxs)(`div`,{className:`space-y-6`,"data-testid":`admin-tenants-panel`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,W.jsx)(ee,{className:`size-5`}),`Tenants & Graphs`]}),(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Per-tenant node/edge counts and shard placement.`})]}),(0,W.jsxs)(E,{variant:`outline`,size:`sm`,onClick:()=>{p()},disabled:d,children:[(0,W.jsx)(i,{className:d?`size-4 animate-spin`:`size-4`}),(0,W.jsx)(`span`,{className:`ml-2`,children:`Refresh`})]})]}),ye({defaultGraph:g,stats:e,placement:y,byType:b,nodeTypes:n}),(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsxs)(T,{className:`text-base flex items-center gap-2`,children:[(0,W.jsx)(h,{className:`size-4`}),`Indexed source tenants`]}),(0,W.jsx)(m,{children:`Ingested source-systems that carry code in the graph.`})]}),(0,W.jsx)(v,{children:be({loading:d,sourcesUnavailable:l,sources:s})})]}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Note: full multi-tenant enumeration (a per-tenant catalog with per-tenant counts) is not yet exposed over the REST surface — the engine tenant catalog is reachable only over the UDS client. This panel shows the active graph with real statistics and shard placement plus indexed source tenants.`})]})}function Se(e){if(!e)return`outline`;let t=e.toLowerCase();return t===`closed`?`default`:t===`open`?`destructive`:`secondary`}function Ce({topology:e,endpoints:t,reachable:n}){return(0,W.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Mode`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold capitalize`,children:e?.mode??`-`})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Shards`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:t.length||`-`})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reachable`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:t.length?`${String(n)}/${String(t.length)}`:`-`})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Default graph`}),(0,W.jsx)(`p`,{className:`text-lg font-semibold font-mono truncate`,children:e?.default_graph??`-`})]})})]})}function we(e,t){return(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded border p-3 text-sm`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,W.jsx)(a,{className:`size-4 shrink-0 text-muted-foreground`}),(0,W.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,W.jsx)(`span`,{className:`font-mono truncate`,children:e.endpoint}),(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`writer #`,t,` `,e.local?`· local`:`· remote`]})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.local&&(0,W.jsx)(o,{variant:`outline`,children:`local`}),e.breaker&&(0,W.jsx)(o,{variant:Se(e.breaker),className:`font-mono text-xs`,children:e.breaker}),e.reachable?(0,W.jsxs)(o,{variant:`default`,className:`gap-1`,children:[(0,W.jsx)(re,{className:`size-3`}),`up`]}):(0,W.jsxs)(o,{variant:`destructive`,className:`gap-1`,children:[(0,W.jsx)(S,{className:`size-3`}),`down`]})]})]},e.endpoint)}function Te(e){return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{className:`text-base`,children:`Shards`}),(0,W.jsx)(m,{children:`Each configured engine endpoint and its live health.`})]}),(0,W.jsx)(v,{children:e.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No shard endpoints reported.`}):(0,W.jsx)(`div`,{className:`space-y-2`,children:e.map(we)})})]})}function Ee(e){return(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-sm`,children:[e.role!==void 0&&(0,W.jsxs)(o,{variant:`secondary`,className:`gap-1`,children:[`role: `,e.role]}),(0,W.jsxs)(o,{variant:e.running?`default`:`outline`,className:`gap-1`,children:[e.running?(0,W.jsx)(O,{className:`size-3 animate-spin`}):(0,W.jsx)(S,{className:`size-3`}),e.running?`running`:`stopped`]}),e.queue_depth!==void 0&&(0,W.jsxs)(o,{variant:`secondary`,children:[`queue: `,String(e.queue_depth)]})]})}function De(e){return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{className:`text-base`,children:`Daemon`}),(0,W.jsx)(m,{children:`The consolidated KG background daemon that hosts the local shard.`})]}),(0,W.jsx)(v,{children:e?Ee(e):(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Daemon status unavailable.`})})]})}function Oe({unavailable:e,topologyError:t,topology:n,endpoints:r,reachable:i,daemon:a}){return e?(0,W.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`The `,(0,W.jsx)(`code`,{children:`/api/dashboard/daemon/shards`}),` route is not activated on this backend yet.`]}):t?(0,W.jsx)(j,{what:`Shard topology (${t})`}):(0,W.jsxs)(W.Fragment,{children:[Ce({topology:n,endpoints:r,reachable:i}),Te(r),De(a)]})}function ke(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(null),[a,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(!1),f=async()=>{d(!0);let[e,n]=await Promise.all([R(),z()]);s(e.unavailable),l(!e.ok&&!e.unavailable?e.error??`The shard topology request failed.`:null),t(e.ok?e.data:null),r(n.ok?n.data:null),d(!1)};(0,F.useEffect)(()=>{f()},[]);let p=e?.endpoints??[],m=p.filter(e=>e.reachable).length;return(0,W.jsxs)(`div`,{className:`space-y-6`,"data-testid":`admin-shards-panel`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,W.jsx)(y,{className:`size-5`}),`Shard Topology`,e&&(0,W.jsx)(o,{variant:`secondary`,className:`uppercase`,children:e.mode})]}),(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`K-way writer layout, per-shard reachability and circuit-breaker state.`})]}),(0,W.jsxs)(E,{variant:`outline`,size:`sm`,onClick:()=>{f()},disabled:u,children:[(0,W.jsx)(i,{className:u?`size-4 animate-spin`:`size-4`}),(0,W.jsx)(`span`,{className:`ml-2`,children:`Refresh`})]})]}),Oe({unavailable:a,topologyError:c,topology:e,endpoints:p,reachable:m,daemon:n})]})}function Ae(e){if(e===void 0)return`-`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}function je(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(!1),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(!1),c=async()=>{a(!0);let e=await pe();r(!e.ok),t(e.ok?e.data:null),a(!1)};return(0,F.useEffect)(()=>{c()},[]),{status:e,loading:i,triggering:o,wired:!n,refresh:c,onTrigger:async()=>{s(!0),await me(),await c(),s(!1)}}}function Me({loading:e,triggering:t,wired:n,onRefresh:r,onTrigger:a}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsxs)(E,{variant:`outline`,size:`sm`,onClick:r,disabled:e,children:[(0,W.jsx)(i,{className:e?`size-4 animate-spin`:`size-4`}),(0,W.jsx)(`span`,{className:`ml-2`,children:`Refresh`})]}),(0,W.jsxs)(E,{size:`sm`,onClick:a,disabled:!n||t,title:n?`Trigger an online backup`:`Backup REST twin not wired yet`,children:[t?(0,W.jsx)(O,{className:`size-4 animate-spin`}):(0,W.jsx)(le,{className:`size-4`}),(0,W.jsx)(`span`,{className:`ml-2`,children:`Trigger backup`})]})]})}function Ne(){return(0,W.jsxs)(D,{className:`border-dashed`,children:[(0,W.jsxs)(_,{children:[(0,W.jsxs)(T,{className:`text-base flex items-center gap-2`,children:[(0,W.jsx)(o,{variant:`outline`,children:`read-only · not wired`}),`Backup/PITR not exposed over REST yet`]}),(0,W.jsxs)(m,{children:[`Online backup / restore (EG-090) is reachable today only over the epistemic-graph UDS client (a`,(0,W.jsx)(`code`,{children:` Method::Backup`}),` op streaming a per-shard MVCC snapshot). This panel will list snapshots, show the PITR window, and enable the trigger control as soon as the REST twin is wired; until then it is read-only by design and shows no fabricated backups.`]})]}),(0,W.jsxs)(v,{className:`text-sm text-muted-foreground space-y-2`,children:[(0,W.jsx)(`p`,{className:`font-medium text-foreground`,children:`The engine backup model:`}),(0,W.jsxs)(`ul`,{className:`list-disc pl-5 space-y-1`,children:[(0,W.jsx)(`li`,{children:`Online per-shard MVCC snapshot streamed verbatim (no write-stall).`}),(0,W.jsx)(`li`,{children:`Point-in-time restore to a chosen LSN / timestamp within the retained window.`})]})]})]})}function Pe({status:e,backupCount:t}){return(0,W.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 gap-4`,children:[(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Snapshots`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:t})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Last backup`}),(0,W.jsx)(`p`,{className:`text-lg font-semibold`,children:e?.last_backup_at??`-`})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground flex items-center gap-1`,children:[(0,W.jsx)(ie,{className:`size-3.5`}),`PITR window`]}),(0,W.jsxs)(`p`,{className:`text-xs font-mono`,children:[e?.pitr_window?.earliest??`-`,` → `,e?.pitr_window?.latest??`-`]})]})})]})}function Fe({backup:e}){return(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded border p-2 text-sm`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,W.jsx)(`span`,{className:`font-mono truncate`,children:e.id}),(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.created_at??`-`,` `,e.shard?`· ${e.shard}`:``,` `,e.lsn?`· LSN ${e.lsn}`:``]})]}),(0,W.jsx)(o,{variant:`secondary`,children:Ae(e.size_bytes)})]})}function Ie({backups:e}){return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{className:`text-base`,children:`Snapshots`}),(0,W.jsx)(m,{children:`Retained backups available for point-in-time restore.`})]}),(0,W.jsx)(v,{children:e.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No snapshots yet.`}):(0,W.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,W.jsx)(Fe,{backup:e},e.id))})})]})}function Le({loading:e,wired:t,status:n,backups:r}){return e?(0,W.jsx)(O,{className:`size-5 animate-spin text-muted-foreground`}):t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Pe,{status:n,backupCount:r.length}),(0,W.jsx)(Ie,{backups:r})]}):(0,W.jsx)(Ne,{})}function Re(){let e=je(),t=e.status?.backups??[];return(0,W.jsxs)(`div`,{className:`space-y-6`,"data-testid":`admin-backup-panel`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,W.jsx)(ue,{className:`size-5`}),`Backup & PITR`]}),(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Online backups and point-in-time restore (CONCEPT:EG-090).`})]}),(0,W.jsx)(Me,{loading:e.loading,triggering:e.triggering,wired:e.wired,onRefresh:()=>{e.refresh()},onTrigger:()=>{e.onTrigger()}})]}),(0,W.jsx)(Le,{loading:e.loading,wired:e.wired,status:e.status,backups:t})]})}var K=[[`idle_ms`,`Idle timeout`],[`absolute_ms`,`Absolute lifetime`],[`privileged_idle_ms`,`Privileged idle timeout`],[`privileged_absolute_ms`,`Privileged absolute lifetime`]];function ze(e){return Object.values(e).every(e=>Number.isInteger(e)&&e>=6e4&&e<=2592e6)}function q(e,t){return e===void 0||t===void 0||e<=t}function Be(e){return ze(e)&&q(e.idle_ms,e.absolute_ms)&&q(e.privileged_idle_ms,e.idle_ms)&&q(e.privileged_absolute_ms,e.absolute_ms)&&q(e.privileged_idle_ms,e.privileged_absolute_ms)}function Ve(e){return Object.fromEntries(K.flatMap(([t])=>e[t]===void 0?[]:[[t,e[t]]]))}function He(e,t){return Object.fromEntries(K.flatMap(([n])=>e[n]===t[n]?[]:[[n,e[n]]]))}function Ue({field:e,label:t,valueMs:n,onChangeMs:r}){return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`label`,{className:`block text-sm`,htmlFor:e,children:[t,` (minutes)`]}),(0,W.jsx)(b,{id:e,type:`number`,min:1,max:43200,value:Math.round(n/6e4),onChange:e=>{r(Number(e.target.value)*6e4)}})]})}function We(e,t){return!Number.isInteger(e)||e<8||e>256||!Be(t)}function Ge({registration:e,setRegistration:t,fallback:n,setFallback:r,minimum:i,setMinimum:a,durations:o,setDurations:s,onSave:c}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`label`,{className:`block text-sm`,htmlFor:`registration-policy`,children:`Registration`}),(0,W.jsxs)(`select`,{id:`registration-policy`,className:`rounded border bg-background p-2`,value:e,onChange:e=>{t(e.target.value)},children:[(0,W.jsx)(`option`,{value:`disabled`,children:`Disabled`}),(0,W.jsx)(`option`,{value:`admin_only`,children:`Administrator only`}),(0,W.jsx)(`option`,{value:`invite`,children:`Invitation`}),(0,W.jsx)(`option`,{value:`open`,children:`Open`})]}),(0,W.jsx)(`label`,{className:`block text-sm`,htmlFor:`policy-fallback`,children:`Local fallback`}),(0,W.jsxs)(`select`,{id:`policy-fallback`,className:`rounded border bg-background p-2`,value:n,onChange:e=>{r(e.target.value)},children:[(0,W.jsx)(`option`,{value:`off`,children:`Off`}),(0,W.jsx)(`option`,{value:`break_glass`,children:`Break glass only`}),(0,W.jsx)(`option`,{value:`full`,children:`Full`})]}),(0,W.jsx)(`label`,{className:`block text-sm`,htmlFor:`password-minimum`,children:`Minimum password length`}),(0,W.jsx)(b,{id:`password-minimum`,type:`number`,min:8,max:256,value:i,onChange:e=>{a(Number(e.target.value))}}),K.map(([e,t])=>{let n=o[e];return n===void 0?null:(0,W.jsx)(Ue,{field:e,label:t,valueMs:n,onChangeMs:t=>{s(n=>({...n,[e]:t}))}},e)}),(0,W.jsx)(E,{type:`button`,disabled:We(i,o),onClick:c,children:`Save identity policy`})]})}function Ke(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(`disabled`),[i,a]=(0,F.useState)(`break_glass`),[o,s]=(0,F.useState)(12),[c,l]=(0,F.useState)({}),[u,d]=(0,F.useState)(null),f=e=>{t(e),e.kind===`ready`&&(r(e.result.registration_policy),a(e.result.local_fallback),s(e.result.password_min_chars),l(Ve(e.result)))};(0,F.useEffect)(()=>{let e=!0;return A(`identity.policy.get`).then(t=>{e&&f(t)}),()=>{e=!1}},[]);let p=async()=>{if(e?.kind!==`ready`)return;let r=await A(`identity.policy.set`,{expected_epoch:e.result.epoch,registration_policy:n,local_fallback:i,password_min_chars:o,...He(c,e.result)});d(r),r.kind===`ready`&&t(r)};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Identity policy`}),(0,W.jsx)(m,{children:`Policy changes use the current configuration epoch and require fresh MFA.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[e===null&&(0,W.jsx)(`p`,{role:`status`,children:`Loading identity policy…`}),e!==null&&e.kind!==`ready`&&(0,W.jsx)(`p`,{role:`status`,children:e.message}),e?.kind===`ready`&&(0,W.jsx)(Ge,{registration:n,setRegistration:r,fallback:i,setFallback:a,minimum:o,setMinimum:s,durations:c,setDurations:l,onSave:()=>{p()}}),Object.keys(c).length>0&&(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Changing a session duration revokes existing sessions immediately.`}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`MFA policy editing is unavailable until the engine exposes those fields.`}),u&&(0,W.jsx)(`p`,{role:`status`,children:u.kind===`ready`?`Identity policy saved.`:u.message})]})]})}function J(e,t){return(e===`identity.sessions.list`||e===`identity.api_keys.list`)&&!t}function qe(e,t){return e.principal_id??e.id??e.handle??e.key_id??t}function Je(e,t){return e.name??e.username??e.principal_id??e.id??e.handle??e.key_id??`Record ${t+1}`}function Y(e){return e.handle??e.id??e.key_id??``}function Ye({item:e,index:t,revokeOp:n,onRevoke:r}){return(0,W.jsxs)(`li`,{className:`rounded border p-2`,children:[(0,W.jsx)(`strong`,{children:Je(e,t)}),e.status&&(0,W.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:e.status}),e.description&&(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),n&&Y(e)&&(0,W.jsx)(E,{type:`button`,size:`sm`,variant:`outline`,className:`ml-2`,onClick:()=>{r(Y(e))},children:`Revoke`})]})}function Xe({state:e,revokeOp:t,loadingHint:n,onRevoke:r,onLoadMore:i}){return e===null?(0,W.jsx)(`p`,{role:`status`,children:n}):e.kind===`ready`?Array.isArray(e.result.items)?e.result.items.length===0?(0,W.jsx)(`p`,{role:`status`,children:`No records reported.`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`ul`,{className:`space-y-2`,children:e.result.items.map((e,n)=>(0,W.jsx)(Ye,{item:e,index:n,revokeOp:t,onRevoke:r},qe(e,n)))}),e.result.next_cursor&&(0,W.jsx)(E,{type:`button`,variant:`outline`,onClick:i,children:`Load more`})]}):(0,W.jsx)(`p`,{role:`alert`,children:`The identity service returned an invalid list.`}):(0,W.jsx)(`p`,{role:`status`,children:e.message})}function Ze(e,t){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(0),[o,s]=(0,F.useState)(null);return(0,F.useEffect)(()=>{let n=!0;return J(e,t)?()=>void 0:(A(e,{...e===`identity.audit.list`||e===`identity.api_keys.list`?{limit:50}:{},...t?{principal_id:t}:{}}).then(e=>{n&&r(e)}),()=>{n=!1})},[e,t,i]),{state:n,mutation:o,revoke:async(e,t)=>{if(!e)return;let n=await A(e,{id:t});s(n),n.kind===`ready`&&a(e=>e+1)},loadMore:async()=>{if(n?.kind!==`ready`||!n.result.next_cursor)return;let i=await A(e,{after:n.result.next_cursor,limit:50,...t?{principal_id:t}:{}});i.kind===`ready`?r({kind:`ready`,result:{items:[...n.result.items,...i.result.items],next_cursor:i.result.next_cursor}}):s(i)},refresh:()=>{a(e=>e+1)}}}function X({title:e,op:t,description:n,principalId:r,revokeOp:i}){let a=Ze(t,r),o=J(t,r)?`Enter a principal id to inspect its records.`:`Loading…`;return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:e}),(0,W.jsx)(m,{children:n})]}),(0,W.jsxs)(v,{children:[r&&(0,W.jsxs)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:[`Principal: `,r]}),a.state!==null&&(0,W.jsx)(E,{type:`button`,size:`sm`,variant:`outline`,className:`mb-3`,onClick:a.refresh,children:`Refresh`}),(0,W.jsx)(Xe,{state:a.state,revokeOp:i,loadingHint:o,onRevoke:e=>{a.revoke(i,e)},onLoadMore:()=>{a.loadMore()}}),a.mutation&&(0,W.jsx)(`p`,{role:`status`,children:a.mutation.kind===`ready`?`Revocation confirmed.`:a.mutation.message})]})]})}function Z({kind:e}){let[t,n]=(0,F.useState)(``),[r,i]=(0,F.useState)(``);return(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),i(t.trim())},children:[(0,W.jsx)(b,{"aria-label":`${e===`sessions`?`Session`:`API key`} principal id`,placeholder:`Principal id`,value:t,onChange:e=>{n(e.target.value)}}),(0,W.jsxs)(E,{type:`submit`,disabled:!t.trim(),children:[`Load `,e]})]}),(0,W.jsx)(X,{title:e===`sessions`?`Sessions`:`API keys`,op:e===`sessions`?`identity.sessions.list`:`identity.api_keys.list`,principalId:r,revokeOp:e===`sessions`?`identity.sessions.revoke`:`identity.api_keys.revoke`,description:e===`sessions`?`Sessions for the selected principal.`:`Metadata only; secrets are never displayed.`})]})}function Q({kind:e}){let[t,n]=(0,F.useState)(``),[r,i]=(0,F.useState)(``),[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)(``),[l,u]=(0,F.useState)(`add`),[d,f]=(0,F.useState)(null),[p,h]=(0,F.useState)(!1),g=e===`group`,y=g?`Group`:`Role`,x=async()=>{h(!0);let e=a.split(`,`).map(e=>e.trim()).filter(Boolean);f(await A(g?`identity.groups.upsert`:`identity.roles.upsert`,g?{group_id:t,name:r,roles:e}:{role_id:t,name:r,scopes:e})),h(!1)},S=async()=>{h(!0),f(await A(g?`identity.groups.change_membership`:`identity.roles.change_user_role`,g?{principal_id:s,group_id:t,change:l}:{principal_id:s,role_id:t,change:l})),h(!1)};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsxs)(T,{children:[y,` administration`]}),(0,W.jsx)(m,{children:`Writes require administrator authority and fresh MFA.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[(0,W.jsx)(b,{"aria-label":`${y} id`,placeholder:`${y} id`,value:t,onChange:e=>{n(e.target.value)}}),(0,W.jsx)(b,{"aria-label":`${y} name`,placeholder:`Display name`,value:r,onChange:e=>{i(e.target.value)}}),(0,W.jsx)(b,{"aria-label":g?`Group roles`:`Role scopes`,placeholder:g?`Roles, comma separated`:`Scopes, comma separated`,value:a,onChange:e=>{o(e.target.value)}})]}),(0,W.jsxs)(E,{type:`button`,disabled:p||!t.trim()||!r.trim(),onClick:()=>{x()},children:[`Save `,y.toLowerCase()]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2 border-t pt-3`,children:[(0,W.jsx)(b,{"aria-label":`Member principal id`,className:`max-w-xs`,placeholder:`Principal id`,value:s,onChange:e=>{c(e.target.value)}}),(0,W.jsxs)(`select`,{"aria-label":`Membership action`,className:`rounded border bg-background p-2`,value:l,onChange:e=>{u(e.target.value)},children:[(0,W.jsx)(`option`,{value:`add`,children:`Add`}),(0,W.jsx)(`option`,{value:`remove`,children:`Remove`})]}),(0,W.jsx)(E,{type:`button`,disabled:p||!t.trim()||!s.trim(),onClick:()=>{S()},children:`Apply membership`})]}),d&&(0,W.jsx)(`p`,{role:`status`,children:d.kind===`ready`?`${y} change confirmed. Refresh the list.`:d.message})]})]})}function Qe(){let[e,t]=(0,F.useState)(``),[n,r]=(0,F.useState)(`{"groups":[]}`),[i,a]=(0,F.useState)(null),o=async()=>{try{let t=JSON.parse(n);if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Claims must be an object`);if(!Object.values(t).every(e=>Array.isArray(e)&&e.every(e=>typeof e==`string`)))throw Error(`Every claim must be a string array`);a(await A(`identity.idps.mapping_dry_run`,{idp_id:e,claims:t}))}catch{a({kind:`error`,message:`Enter a JSON object whose values are string arrays.`})}};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Mapping rule dry run`}),(0,W.jsx)(m,{children:`Preview the roles, groups and scopes a sample claim set would receive. This does not change an identity.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[(0,W.jsx)(b,{"aria-label":`Identity provider id`,placeholder:`Identity provider id`,value:e,onChange:e=>{t(e.target.value)}}),(0,W.jsx)(`textarea`,{"aria-label":`Sample claims JSON`,className:`w-full rounded border bg-background p-2 font-mono text-sm`,rows:4,value:n,onChange:e=>{r(e.target.value)}}),(0,W.jsx)(E,{type:`button`,disabled:!e.trim(),onClick:()=>{o()},children:`Evaluate mapping`}),i?.kind!==`ready`&&i!==null&&(0,W.jsx)(`p`,{role:`status`,children:i.message}),i?.kind===`ready`&&(0,W.jsxs)(`dl`,{className:`text-sm space-y-1`,children:[(0,W.jsx)(`dt`,{children:`Roles`}),(0,W.jsx)(`dd`,{children:i.result.roles.join(`, `)||`None`}),(0,W.jsx)(`dt`,{children:`Groups`}),(0,W.jsx)(`dd`,{children:i.result.groups.join(`, `)||`None`}),(0,W.jsx)(`dt`,{children:`Scopes`}),(0,W.jsx)(`dd`,{children:i.result.scopes.join(`, `)||`None`})]})]})]})}function $(){let[e,t]=(0,F.useState)(``),[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(`oidc`),[o,s]=(0,F.useState)(`{}`),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)(null),f=async()=>{try{let t=JSON.parse(o);if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Invalid configuration`);d(await A(`identity.idps.upsert`,{idp_id:e.trim(),kind:i,display_name:n.trim(),enabled:!1,config_json:o,jit_policy:`deny`,...c.trim()?{secret_ref:c.trim()}:{}}))}catch{d({kind:`error`,message:`Configuration must be a JSON object.`})}};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Configure identity provider`}),(0,W.jsx)(m,{children:`Use a secret reference; do not paste credentials. New providers start disabled with just-in-time provisioning denied until mapping rules are reviewed.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,W.jsx)(b,{"aria-label":`Provider id`,placeholder:`Provider id`,value:e,onChange:e=>{t(e.target.value)}}),(0,W.jsx)(b,{"aria-label":`Provider display name`,placeholder:`Display name`,value:n,onChange:e=>{r(e.target.value)}})]}),(0,W.jsxs)(`select`,{"aria-label":`Provider kind`,className:`rounded border bg-background p-2`,value:i,onChange:e=>{a(e.target.value)},children:[(0,W.jsx)(`option`,{value:`oidc`,children:`OIDC`}),(0,W.jsx)(`option`,{value:`saml`,children:`SAML`}),(0,W.jsx)(`option`,{value:`ldap`,children:`LDAP`}),(0,W.jsx)(`option`,{value:`scim`,children:`SCIM`})]}),(0,W.jsx)(b,{"aria-label":`Provider secret reference`,placeholder:`Secret reference (optional)`,value:c,onChange:e=>{l(e.target.value)}}),(0,W.jsx)(`textarea`,{"aria-label":`Provider configuration JSON`,className:`w-full rounded border bg-background p-2 font-mono text-sm`,rows:5,value:o,onChange:e=>{s(e.target.value)}}),(0,W.jsx)(E,{type:`button`,disabled:!e.trim()||!n.trim(),onClick:()=>{f()},children:`Save provider`}),u&&(0,W.jsx)(`p`,{role:`status`,children:u.kind===`ready`?`Provider saved. Refresh the list.`:u.message})]})]})}function $e(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(`break_glass`),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(null);return(0,F.useEffect)(()=>{let e=!0;return A(`identity.mode.status`).then(n=>{e&&t(n)}),()=>{e=!1}},[]),{state:e,target:n,setTarget:r,fallback:i,setFallback:a,acknowledged:o,setAcknowledged:s,transition:c,submit:async()=>{let e=await A(`identity.mode.transition`,n===`external`?{to:n,local_fallback:i}:{to:n});l(e),e.kind===`ready`&&t(await A(`identity.mode.status`))}}}function et(e,t,n){return!e||!t||n?.kind!==`ready`||t===n.result.mode}function tt(){let e=$e();return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Security mode`}),(0,W.jsx)(m,{children:`Mode transitions require a fresh MFA administrator session. A successful transition revokes existing sessions.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[e.state===null&&(0,W.jsx)(`p`,{role:`status`,children:`Loading mode…`}),e.state!==null&&e.state.kind!==`ready`&&(0,W.jsx)(`p`,{role:`status`,children:e.state.message}),e.state?.kind===`ready`&&(0,W.jsxs)(`p`,{children:[`Current mode: `,(0,W.jsx)(`strong`,{children:e.state.result.mode})]}),(0,W.jsx)(`label`,{className:`block text-sm`,htmlFor:`target-mode`,children:`Target mode`}),(0,W.jsxs)(`select`,{id:`target-mode`,className:`rounded border bg-background p-2`,value:e.target,onChange:t=>{e.setTarget(t.target.value)},children:[(0,W.jsx)(`option`,{value:``,children:`Select a mode`}),(0,W.jsx)(`option`,{value:`local`,children:`Local`}),(0,W.jsx)(`option`,{value:`external`,children:`External`})]}),e.target===`external`&&(0,W.jsxs)(`select`,{"aria-label":`Local fallback`,className:`rounded border bg-background p-2`,value:e.fallback,onChange:t=>{e.setFallback(t.target.value)},children:[(0,W.jsx)(`option`,{value:`off`,children:`No local fallback`}),(0,W.jsx)(`option`,{value:`break_glass`,children:`Break glass only`}),(0,W.jsx)(`option`,{value:`full`,children:`Full local fallback`})]}),(0,W.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:e.acknowledged,onChange:t=>{e.setAcknowledged(t.target.checked)}}),`I understand this transition revokes current sessions.`]}),(0,W.jsx)(E,{type:`button`,disabled:et(e.acknowledged,e.target,e.state),onClick:()=>{e.submit()},children:`Request transition`}),e.transition&&(0,W.jsx)(`p`,{role:`status`,children:e.transition.kind===`ready`?`Transition completed. Sign in again.`:e.transition.message})]})]})}function nt(){let[e,t]=(0,F.useState)(!1),[n,r]=(0,F.useState)(null),i=async()=>{r(await A(`identity.issuer.rotate`))};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Issuer key rotation`}),(0,W.jsx)(m,{children:`Rotate the Arbora signer with overlap. A fresh administrator MFA confirmation is required.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[(0,W.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>{t(e.target.checked)}}),`I understand issuer rotation changes the signing key.`]}),(0,W.jsx)(E,{type:`button`,disabled:!e,onClick:()=>{i()},children:`Request issuer rotation`}),n&&(0,W.jsx)(`p`,{role:`status`,children:n.kind===`ready`?`Issuer key rotated (epoch ${n.result.epoch}, key ${n.result.issuer_kid_current}).`:n.message})]})]})}function rt(){let[e,t]=(0,F.useState)(``),[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(null),c=async()=>{a(await A(`identity.scim_clients.list`))};(0,F.useEffect)(()=>{c()},[]);let l=async()=>{let t=await A(`identity.scim_clients.upsert`,{idp_id:e.trim(),principal_id:n.trim()});s(t),t.kind===`ready`&&c()},u=async e=>{let t=await A(`identity.scim_clients.remove`,{idp_id:e});s(t),t.kind===`ready`&&c()};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`SCIM clients`}),(0,W.jsx)(m,{children:`Bind an enabled SCIM provider to an active service principal.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[i===null&&(0,W.jsx)(`p`,{role:`status`,children:`Loading SCIM clients…`}),i&&i.kind!==`ready`&&(0,W.jsx)(`p`,{role:`status`,children:i.message}),i?.kind===`ready`&&(0,W.jsx)(`ul`,{className:`space-y-2`,children:i.result.items.map(e=>(0,W.jsxs)(`li`,{className:`flex items-center justify-between rounded border p-2`,children:[(0,W.jsxs)(`span`,{children:[e.idp_id,`: `,(0,W.jsx)(`code`,{children:e.principal_id}),` (`,e.enabled?`enabled`:`disabled`,`)`]}),(0,W.jsx)(E,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{u(e.idp_id)},children:`Remove`})]},e.idp_id))}),(0,W.jsx)(b,{"aria-label":`SCIM provider id`,placeholder:`Provider id`,value:e,onChange:e=>{t(e.target.value)}}),(0,W.jsx)(b,{"aria-label":`SCIM service principal id`,placeholder:`Service principal id`,value:n,onChange:e=>{r(e.target.value)}}),(0,W.jsx)(E,{type:`button`,disabled:!e.trim()||!n.trim(),onClick:()=>{l()},children:`Bind SCIM client`}),o&&(0,W.jsx)(`p`,{role:`status`,children:o.kind===`ready`?`SCIM client change confirmed.`:o.message})]})]})}function it(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(null),i=async()=>{t(await A(`identity.audit.verify`))},a=async()=>{let e=await A(`identity.audit.export`,{limit:500});if(r(e),e.kind!==`ready`)return;let t=URL.createObjectURL(new Blob([JSON.stringify(e.result,null,2)],{type:`application/json`})),n=document.createElement(`a`);n.href=t,n.download=`identity-audit-page.json`,n.click(),URL.revokeObjectURL(t)};return(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(X,{title:`Identity audit`,op:`identity.audit.list`,description:`Identity administration events.`}),(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Audit integrity and export`}),(0,W.jsx)(m,{children:`Verify the chain or export a bounded page with its continuation cursor.`})]}),(0,W.jsxs)(v,{className:`space-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(E,{type:`button`,variant:`outline`,onClick:()=>{i()},children:`Verify audit chain`}),(0,W.jsx)(E,{type:`button`,variant:`outline`,onClick:()=>{a()},children:`Export first audit page`})]}),e&&(0,W.jsx)(`p`,{role:`status`,children:e.kind===`ready`?e.result.valid?`Audit chain verified.`:`Audit chain broken at sequence ${e.result.first_broken_seq??`unknown`}.`:e.message}),n&&n.kind!==`ready`&&(0,W.jsx)(`p`,{role:`status`,children:n.message})]})]})]})}function at(){return(0,W.jsxs)(`div`,{className:`space-y-6`,"data-testid":`admin-view`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h1`,{className:`text-2xl font-bold flex items-center gap-2`,children:[(0,W.jsx)(ae,{className:`size-6`}),`Admin Console`]}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Arbora identity, security and engine administration.`})]}),(0,W.jsxs)(ce,{defaultValue:`users`,children:[(0,W.jsx)(se,{className:`flex h-auto flex-wrap justify-start`,children:[`users`,`service-accounts`,`groups`,`roles`,`idps`,`sessions`,`api-keys`,`audit`,`security-mode`,`policy`,`tenants`,`shards`,`backup`].map(e=>(0,W.jsx)(oe,{value:e,children:e.replaceAll(`-`,` `)},e))}),(0,W.jsx)(k,{value:`users`,children:(0,W.jsx)(M,{})}),(0,W.jsx)(k,{value:`service-accounts`,children:(0,W.jsx)(X,{title:`Service accounts`,op:`identity.service_accounts.list`,description:`Active service principals from Arbora identity.`})}),(0,W.jsxs)(k,{value:`groups`,className:`space-y-4`,children:[(0,W.jsx)(X,{title:`Groups`,op:`identity.groups.list`,description:`Groups and memberships from Arbora identity.`}),(0,W.jsx)(Q,{kind:`group`})]}),(0,W.jsxs)(k,{value:`roles`,className:`space-y-4`,children:[(0,W.jsx)(X,{title:`Roles and scopes`,op:`identity.roles.list`,description:`Roles and effective scope grants from Arbora identity.`}),(0,W.jsx)(Q,{kind:`role`})]}),(0,W.jsxs)(k,{value:`idps`,className:`space-y-4`,children:[(0,W.jsx)(X,{title:`Identity providers`,op:`identity.idps.list`,description:`Configured external authorities.`}),(0,W.jsx)($,{}),(0,W.jsx)(Qe,{}),(0,W.jsx)(rt,{})]}),(0,W.jsx)(k,{value:`sessions`,children:(0,W.jsx)(Z,{kind:`sessions`})}),(0,W.jsx)(k,{value:`api-keys`,children:(0,W.jsx)(Z,{kind:`api-keys`})}),(0,W.jsx)(k,{value:`audit`,children:(0,W.jsx)(it,{})}),(0,W.jsxs)(k,{value:`security-mode`,className:`space-y-4`,children:[(0,W.jsx)(tt,{}),(0,W.jsx)(nt,{})]}),(0,W.jsx)(k,{value:`policy`,children:(0,W.jsx)(Ke,{})}),(0,W.jsx)(k,{value:`tenants`,children:(0,W.jsx)(xe,{})}),(0,W.jsx)(k,{value:`shards`,children:(0,W.jsx)(ke,{})}),(0,W.jsx)(k,{value:`backup`,children:(0,W.jsx)(Re,{})})]})]})}export{at as default};
|
|
1
|
+
import{i as e,r as t,s as n}from"./bundle-mjs-DIyOrgL5.js";import{t as r}from"./createLucideIcon-DTQSidPf.js";import{t as i}from"./refresh-cw-BVhl5aJX.js";import{t as a}from"./server-CE-xbAAj.js";import{t as o}from"./badge-nQZ87mVE.js";import{E as s,S as c,a as l,c as u,f as d,w as f,x as p}from"./api-validation-CCoR_LRu.js";import{E as m,Jn as h,Nn as g,O as _,T as v,Un as y,Yt as b,Zn as x,ar as S,dn as C,dt as w,fr as ee,ft as te,k as T,mt as ne,or as re,rn as E,rr as ie,w as D,yn as ae,zn as O}from"./index-GCzCgfSc.js";import{i as oe,n as k,r as se,t as ce}from"./tabs-Bzz5t0iB.js";import{n as A}from"./identity-Ba52P5P-.js";import{t as j}from"./unavailable-notice-B7WdWNor.js";import M from"./UserManagementView-DzKgnC7G.js";var N={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};N.node;var le=r(N),P={name:`database-backup`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 12a9 3 0 0 0 5 2.69`,key:`1ui2ym`}],[`path`,{d:`M21 9.3V5`,key:`6k6cib`}],[`path`,{d:`M3 5v14a9 3 0 0 0 6.47 2.88`,key:`i62tjy`}],[`path`,{d:`M12 12v4h4`,key:`1bxaet`}],[`path`,{d:`M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16`,key:`1f4ei9`}]]};P.node;var ue=r(P),F=n(e(),1),I=c({endpoint:s(),local:d(),reachable:d().optional(),breaker:s().optional()}),L=c({mode:u([`single`,`sharded`]),default_graph:s().optional(),endpoints:l(I)});function R(){return w(`/dashboard/daemon/shards`,L)}function z(){return w(`/dashboard/daemon/status`)}var B=c({total_nodes:p(),total_relationships:p(),available:d().optional(),source_graphs:l(s()).optional(),degraded_graphs:l(s()).optional(),partial:d().optional()}),V=c({by_type:f(s(),p()),type_count:p(),total_typed_nodes:p(),truncated:d(),available:d(),source_graphs:l(s()),degraded_graphs:l(s()),partial:d()}),H=c({source_systems:l(s())});function U(){return w(`/enhanced/graph/stats`,B)}function de(){return w(`/enhanced/graph/node-types`,V)}function fe(){return w(`/enhanced/code/instances`,H)}function pe(){return ne(`/configure`,{action:`backup_status`})}function me(){return te(`/graph/configure`,{action:`backup_create`})}var W=t();function G(e){return e===void 0?`-`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function he({stats:e,placement:t}){return(0,W.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 gap-4`,children:[(0,W.jsxs)(`div`,{className:`rounded border p-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nodes`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:G(e?.total_nodes)})]}),(0,W.jsxs)(`div`,{className:`rounded border p-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Relationships`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:G(e?.total_relationships)})]}),(0,W.jsxs)(`div`,{className:`rounded border p-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Shard placement`}),(0,W.jsx)(`p`,{className:`text-lg font-semibold`,children:t.length?`${String(t.length)} shard(s)`:`-`})]})]})}function ge({byType:e,nodeTypes:t}){return e.length===0?null:(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`p`,{className:`text-sm font-medium mb-2 flex items-center gap-1`,children:[(0,W.jsx)(x,{className:`size-3.5`}),`Counts by type`,(0,W.jsxs)(`span`,{className:`text-muted-foreground font-normal`,children:[`(`,G(t?.type_count),` types, `,G(t?.total_typed_nodes),` nodes)`]})]}),t?.partial===!0&&(0,W.jsxs)(`p`,{className:`mb-2 flex items-center gap-1.5 text-xs text-amber-500`,children:[(0,W.jsx)(C,{className:`size-3.5 shrink-0`}),`Partial — excludes `,t.degraded_graphs.join(`, `),`.`]}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(([e,t])=>(0,W.jsxs)(o,{variant:`outline`,className:`gap-1`,children:[e,(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:G(t)})]},e))})]})}function _e(e){return e?.partial===!0?(0,W.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs text-amber-500`,children:[(0,W.jsx)(C,{className:`size-3.5 shrink-0`}),`These totals are partial — `,(e.degraded_graphs??[]).join(`, `),` could not be read.`]}):null}function ve(e){return e.length===0?null:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Placed on`}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,W.jsxs)(o,{variant:e.reachable?`default`:`destructive`,className:`font-mono text-xs gap-1`,children:[e.endpoint,e.local&&(0,W.jsx)(`span`,{className:`opacity-70`,children:`· local`})]},e.endpoint))})]})}function ye({defaultGraph:e,stats:t,placement:n,byType:r,nodeTypes:i}){return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsxs)(T,{className:`text-base flex items-center gap-2`,children:[(0,W.jsx)(g,{className:`size-4`}),(0,W.jsx)(`span`,{className:`font-mono`,children:e}),(0,W.jsx)(o,{variant:`secondary`,children:`active`})]}),(0,W.jsx)(m,{children:`The active graph tenant served by this backend.`})]}),(0,W.jsxs)(v,{className:`space-y-4`,children:[he({stats:t,placement:n}),ge({byType:r,nodeTypes:i}),_e(t),ve(n)]})]})}function be({loading:e,sourcesUnavailable:t,sources:n}){return e?(0,W.jsx)(O,{className:`size-4 animate-spin text-muted-foreground`}):t?(0,W.jsx)(j,{what:`Indexed source tenants`}):n.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No indexed source tenants reported.`}):(0,W.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>(0,W.jsx)(o,{variant:`secondary`,className:`font-mono text-xs`,children:e},e))})}function xe(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(null),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)([]),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(!1),p=async()=>{f(!0);let[e,n,i,a]=await Promise.all([U(),R(),fe(),de()]);t(e.ok?e.data:null),r(a.ok?a.data:null),o(n.ok?n.data:null),c(i.ok&&i.data?i.data.source_systems:[]),u(!i.ok),f(!1)};(0,F.useEffect)(()=>{p()},[]);let g=a?.default_graph??`__commons__`,y=a?.endpoints??[],b=Object.entries(n?.by_type??{}).sort((e,t)=>t[1]-e[1]);return(0,W.jsxs)(`div`,{className:`space-y-6`,"data-testid":`admin-tenants-panel`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,W.jsx)(ee,{className:`size-5`}),`Tenants & Graphs`]}),(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Per-tenant node/edge counts and shard placement.`})]}),(0,W.jsxs)(E,{variant:`outline`,size:`sm`,onClick:()=>{p()},disabled:d,children:[(0,W.jsx)(i,{className:d?`size-4 animate-spin`:`size-4`}),(0,W.jsx)(`span`,{className:`ml-2`,children:`Refresh`})]})]}),ye({defaultGraph:g,stats:e,placement:y,byType:b,nodeTypes:n}),(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsxs)(T,{className:`text-base flex items-center gap-2`,children:[(0,W.jsx)(h,{className:`size-4`}),`Indexed source tenants`]}),(0,W.jsx)(m,{children:`Ingested source-systems that carry code in the graph.`})]}),(0,W.jsx)(v,{children:be({loading:d,sourcesUnavailable:l,sources:s})})]}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Note: full multi-tenant enumeration (a per-tenant catalog with per-tenant counts) is not yet exposed over the REST surface — the engine tenant catalog is reachable only over the UDS client. This panel shows the active graph with real statistics and shard placement plus indexed source tenants.`})]})}function Se(e){if(!e)return`outline`;let t=e.toLowerCase();return t===`closed`?`default`:t===`open`?`destructive`:`secondary`}function Ce({topology:e,endpoints:t,reachable:n}){return(0,W.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Mode`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold capitalize`,children:e?.mode??`-`})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Shards`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:t.length||`-`})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reachable`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:t.length?`${String(n)}/${String(t.length)}`:`-`})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Default graph`}),(0,W.jsx)(`p`,{className:`text-lg font-semibold font-mono truncate`,children:e?.default_graph??`-`})]})})]})}function we(e,t){return(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded border p-3 text-sm`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,W.jsx)(a,{className:`size-4 shrink-0 text-muted-foreground`}),(0,W.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,W.jsx)(`span`,{className:`font-mono truncate`,children:e.endpoint}),(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`writer #`,t,` `,e.local?`· local`:`· remote`]})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.local&&(0,W.jsx)(o,{variant:`outline`,children:`local`}),e.breaker&&(0,W.jsx)(o,{variant:Se(e.breaker),className:`font-mono text-xs`,children:e.breaker}),e.reachable?(0,W.jsxs)(o,{variant:`default`,className:`gap-1`,children:[(0,W.jsx)(re,{className:`size-3`}),`up`]}):(0,W.jsxs)(o,{variant:`destructive`,className:`gap-1`,children:[(0,W.jsx)(S,{className:`size-3`}),`down`]})]})]},e.endpoint)}function Te(e){return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{className:`text-base`,children:`Shards`}),(0,W.jsx)(m,{children:`Each configured engine endpoint and its live health.`})]}),(0,W.jsx)(v,{children:e.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No shard endpoints reported.`}):(0,W.jsx)(`div`,{className:`space-y-2`,children:e.map(we)})})]})}function Ee(e){return(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-sm`,children:[e.role!==void 0&&(0,W.jsxs)(o,{variant:`secondary`,className:`gap-1`,children:[`role: `,e.role]}),(0,W.jsxs)(o,{variant:e.running?`default`:`outline`,className:`gap-1`,children:[e.running?(0,W.jsx)(O,{className:`size-3 animate-spin`}):(0,W.jsx)(S,{className:`size-3`}),e.running?`running`:`stopped`]}),e.queue_depth!==void 0&&(0,W.jsxs)(o,{variant:`secondary`,children:[`queue: `,String(e.queue_depth)]})]})}function De(e){return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{className:`text-base`,children:`Daemon`}),(0,W.jsx)(m,{children:`The consolidated KG background daemon that hosts the local shard.`})]}),(0,W.jsx)(v,{children:e?Ee(e):(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Daemon status unavailable.`})})]})}function Oe({unavailable:e,topologyError:t,topology:n,endpoints:r,reachable:i,daemon:a}){return e?(0,W.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`The `,(0,W.jsx)(`code`,{children:`/api/dashboard/daemon/shards`}),` route is not activated on this backend yet.`]}):t?(0,W.jsx)(j,{what:`Shard topology (${t})`}):(0,W.jsxs)(W.Fragment,{children:[Ce({topology:n,endpoints:r,reachable:i}),Te(r),De(a)]})}function ke(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(null),[a,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(!1),f=async()=>{d(!0);let[e,n]=await Promise.all([R(),z()]);s(e.unavailable),l(!e.ok&&!e.unavailable?e.error??`The shard topology request failed.`:null),t(e.ok?e.data:null),r(n.ok?n.data:null),d(!1)};(0,F.useEffect)(()=>{f()},[]);let p=e?.endpoints??[],m=p.filter(e=>e.reachable).length;return(0,W.jsxs)(`div`,{className:`space-y-6`,"data-testid":`admin-shards-panel`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,W.jsx)(y,{className:`size-5`}),`Shard Topology`,e&&(0,W.jsx)(o,{variant:`secondary`,className:`uppercase`,children:e.mode})]}),(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`K-way writer layout, per-shard reachability and circuit-breaker state.`})]}),(0,W.jsxs)(E,{variant:`outline`,size:`sm`,onClick:()=>{f()},disabled:u,children:[(0,W.jsx)(i,{className:u?`size-4 animate-spin`:`size-4`}),(0,W.jsx)(`span`,{className:`ml-2`,children:`Refresh`})]})]}),Oe({unavailable:a,topologyError:c,topology:e,endpoints:p,reachable:m,daemon:n})]})}function Ae(e){if(e===void 0)return`-`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}function je(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(!1),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(!1),c=async()=>{a(!0);let e=await pe();r(!e.ok),t(e.ok?e.data:null),a(!1)};return(0,F.useEffect)(()=>{c()},[]),{status:e,loading:i,triggering:o,wired:!n,refresh:c,onTrigger:async()=>{s(!0),await me(),await c(),s(!1)}}}function Me({loading:e,triggering:t,wired:n,onRefresh:r,onTrigger:a}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsxs)(E,{variant:`outline`,size:`sm`,onClick:r,disabled:e,children:[(0,W.jsx)(i,{className:e?`size-4 animate-spin`:`size-4`}),(0,W.jsx)(`span`,{className:`ml-2`,children:`Refresh`})]}),(0,W.jsxs)(E,{size:`sm`,onClick:a,disabled:!n||t,title:n?`Trigger an online backup`:`Backup REST twin not wired yet`,children:[t?(0,W.jsx)(O,{className:`size-4 animate-spin`}):(0,W.jsx)(le,{className:`size-4`}),(0,W.jsx)(`span`,{className:`ml-2`,children:`Trigger backup`})]})]})}function Ne(){return(0,W.jsxs)(D,{className:`border-dashed`,children:[(0,W.jsxs)(_,{children:[(0,W.jsxs)(T,{className:`text-base flex items-center gap-2`,children:[(0,W.jsx)(o,{variant:`outline`,children:`read-only · not wired`}),`Backup/PITR not exposed over REST yet`]}),(0,W.jsxs)(m,{children:[`Online backup / restore (EG-090) is reachable today only over the epistemic-graph UDS client (a`,(0,W.jsx)(`code`,{children:` Method::Backup`}),` op streaming a per-shard MVCC snapshot). This panel will list snapshots, show the PITR window, and enable the trigger control as soon as the REST twin is wired; until then it is read-only by design and shows no fabricated backups.`]})]}),(0,W.jsxs)(v,{className:`text-sm text-muted-foreground space-y-2`,children:[(0,W.jsx)(`p`,{className:`font-medium text-foreground`,children:`The engine backup model:`}),(0,W.jsxs)(`ul`,{className:`list-disc pl-5 space-y-1`,children:[(0,W.jsx)(`li`,{children:`Online per-shard MVCC snapshot streamed verbatim (no write-stall).`}),(0,W.jsx)(`li`,{children:`Point-in-time restore to a chosen LSN / timestamp within the retained window.`})]})]})]})}function Pe({status:e,backupCount:t}){return(0,W.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 gap-4`,children:[(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Snapshots`}),(0,W.jsx)(`p`,{className:`text-2xl font-bold`,children:t})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Last backup`}),(0,W.jsx)(`p`,{className:`text-lg font-semibold`,children:e?.last_backup_at??`-`})]})}),(0,W.jsx)(D,{children:(0,W.jsxs)(v,{className:`pt-6`,children:[(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground flex items-center gap-1`,children:[(0,W.jsx)(ie,{className:`size-3.5`}),`PITR window`]}),(0,W.jsxs)(`p`,{className:`text-xs font-mono`,children:[e?.pitr_window?.earliest??`-`,` → `,e?.pitr_window?.latest??`-`]})]})})]})}function Fe({backup:e}){return(0,W.jsxs)(`div`,{className:`flex items-center justify-between rounded border p-2 text-sm`,children:[(0,W.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,W.jsx)(`span`,{className:`font-mono truncate`,children:e.id}),(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.created_at??`-`,` `,e.shard?`· ${e.shard}`:``,` `,e.lsn?`· LSN ${e.lsn}`:``]})]}),(0,W.jsx)(o,{variant:`secondary`,children:Ae(e.size_bytes)})]})}function Ie({backups:e}){return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{className:`text-base`,children:`Snapshots`}),(0,W.jsx)(m,{children:`Retained backups available for point-in-time restore.`})]}),(0,W.jsx)(v,{children:e.length===0?(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No snapshots yet.`}):(0,W.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,W.jsx)(Fe,{backup:e},e.id))})})]})}function Le({loading:e,wired:t,status:n,backups:r}){return e?(0,W.jsx)(O,{className:`size-5 animate-spin text-muted-foreground`}):t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Pe,{status:n,backupCount:r.length}),(0,W.jsx)(Ie,{backups:r})]}):(0,W.jsx)(Ne,{})}function Re(){let e=je(),t=e.status?.backups??[];return(0,W.jsxs)(`div`,{className:`space-y-6`,"data-testid":`admin-backup-panel`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,W.jsx)(ue,{className:`size-5`}),`Backup & PITR`]}),(0,W.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Online backups and point-in-time restore (CONCEPT:EG-090).`})]}),(0,W.jsx)(Me,{loading:e.loading,triggering:e.triggering,wired:e.wired,onRefresh:()=>{e.refresh()},onTrigger:()=>{e.onTrigger()}})]}),(0,W.jsx)(Le,{loading:e.loading,wired:e.wired,status:e.status,backups:t})]})}var K=[[`idle_ms`,`Idle timeout`],[`absolute_ms`,`Absolute lifetime`],[`privileged_idle_ms`,`Privileged idle timeout`],[`privileged_absolute_ms`,`Privileged absolute lifetime`]];function ze(e){return Object.values(e).every(e=>Number.isInteger(e)&&e>=6e4&&e<=2592e6)}function q(e,t){return e===void 0||t===void 0||e<=t}function Be(e){return ze(e)&&q(e.idle_ms,e.absolute_ms)&&q(e.privileged_idle_ms,e.idle_ms)&&q(e.privileged_absolute_ms,e.absolute_ms)&&q(e.privileged_idle_ms,e.privileged_absolute_ms)}function Ve(e){return Object.fromEntries(K.flatMap(([t])=>e[t]===void 0?[]:[[t,e[t]]]))}function He(e,t){return Object.fromEntries(K.flatMap(([n])=>e[n]===t[n]?[]:[[n,e[n]]]))}function Ue({field:e,label:t,valueMs:n,onChangeMs:r}){return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`label`,{className:`block text-sm`,htmlFor:e,children:[t,` (minutes)`]}),(0,W.jsx)(b,{id:e,type:`number`,min:1,max:43200,value:Math.round(n/6e4),onChange:e=>{r(Number(e.target.value)*6e4)}})]})}function We(e,t){return!Number.isInteger(e)||e<8||e>256||!Be(t)}function Ge({registration:e,setRegistration:t,fallback:n,setFallback:r,minimum:i,setMinimum:a,durations:o,setDurations:s,onSave:c}){return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`label`,{className:`block text-sm`,htmlFor:`registration-policy`,children:`Registration`}),(0,W.jsxs)(`select`,{id:`registration-policy`,className:`rounded border bg-background p-2`,value:e,onChange:e=>{t(e.target.value)},children:[(0,W.jsx)(`option`,{value:`disabled`,children:`Disabled`}),(0,W.jsx)(`option`,{value:`admin_only`,children:`Administrator only`}),(0,W.jsx)(`option`,{value:`invite`,children:`Invitation`}),(0,W.jsx)(`option`,{value:`open`,children:`Open`})]}),(0,W.jsx)(`label`,{className:`block text-sm`,htmlFor:`policy-fallback`,children:`Local fallback`}),(0,W.jsxs)(`select`,{id:`policy-fallback`,className:`rounded border bg-background p-2`,value:n,onChange:e=>{r(e.target.value)},children:[(0,W.jsx)(`option`,{value:`off`,children:`Off`}),(0,W.jsx)(`option`,{value:`break_glass`,children:`Break glass only`}),(0,W.jsx)(`option`,{value:`full`,children:`Full`})]}),(0,W.jsx)(`label`,{className:`block text-sm`,htmlFor:`password-minimum`,children:`Minimum password length`}),(0,W.jsx)(b,{id:`password-minimum`,type:`number`,min:8,max:256,value:i,onChange:e=>{a(Number(e.target.value))}}),K.map(([e,t])=>{let n=o[e];return n===void 0?null:(0,W.jsx)(Ue,{field:e,label:t,valueMs:n,onChangeMs:t=>{s(n=>({...n,[e]:t}))}},e)}),(0,W.jsx)(E,{type:`button`,disabled:We(i,o),onClick:c,children:`Save identity policy`})]})}function Ke(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(`disabled`),[i,a]=(0,F.useState)(`break_glass`),[o,s]=(0,F.useState)(12),[c,l]=(0,F.useState)({}),[u,d]=(0,F.useState)(null),f=e=>{t(e),e.kind===`ready`&&(r(e.result.registration_policy),a(e.result.local_fallback),s(e.result.password_min_chars),l(Ve(e.result)))};(0,F.useEffect)(()=>{let e=!0;return A(`identity.policy.get`).then(t=>{e&&f(t)}),()=>{e=!1}},[]);let p=async()=>{if(e?.kind!==`ready`)return;let r=await A(`identity.policy.set`,{expected_epoch:e.result.epoch,registration_policy:n,local_fallback:i,password_min_chars:o,...He(c,e.result)});d(r),r.kind===`ready`&&t(r)};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Identity policy`}),(0,W.jsx)(m,{children:`Policy changes use the current configuration epoch and require fresh MFA.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[e===null&&(0,W.jsx)(`p`,{role:`status`,children:`Loading identity policy…`}),e!==null&&e.kind!==`ready`&&(0,W.jsx)(`p`,{role:`status`,children:e.message}),e?.kind===`ready`&&(0,W.jsx)(Ge,{registration:n,setRegistration:r,fallback:i,setFallback:a,minimum:o,setMinimum:s,durations:c,setDurations:l,onSave:()=>{p()}}),Object.keys(c).length>0&&(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Changing a session duration revokes existing sessions immediately.`}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`MFA policy editing is unavailable until the engine exposes those fields.`}),u&&(0,W.jsx)(`p`,{role:`status`,children:u.kind===`ready`?`Identity policy saved.`:u.message})]})]})}function J(e,t){return(e===`identity.sessions.list`||e===`identity.api_keys.list`)&&!t}function qe(e,t){return e.principal_id??e.id??e.handle??e.key_id??t}function Je(e,t){return e.name??e.username??e.principal_id??e.id??e.handle??e.key_id??`Record ${t+1}`}function Y(e){return e.handle??e.id??e.key_id??``}function Ye({item:e,index:t,revokeOp:n,onRevoke:r}){return(0,W.jsxs)(`li`,{className:`rounded border p-2`,children:[(0,W.jsx)(`strong`,{children:Je(e,t)}),e.status&&(0,W.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:e.status}),e.description&&(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),n&&Y(e)&&(0,W.jsx)(E,{type:`button`,size:`sm`,variant:`outline`,className:`ml-2`,onClick:()=>{r(Y(e))},children:`Revoke`})]})}function Xe({state:e,revokeOp:t,loadingHint:n,onRevoke:r,onLoadMore:i}){return e===null?(0,W.jsx)(`p`,{role:`status`,children:n}):e.kind===`ready`?Array.isArray(e.result.items)?e.result.items.length===0?(0,W.jsx)(`p`,{role:`status`,children:`No records reported.`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`ul`,{className:`space-y-2`,children:e.result.items.map((e,n)=>(0,W.jsx)(Ye,{item:e,index:n,revokeOp:t,onRevoke:r},qe(e,n)))}),e.result.next_cursor&&(0,W.jsx)(E,{type:`button`,variant:`outline`,onClick:i,children:`Load more`})]}):(0,W.jsx)(`p`,{role:`alert`,children:`The identity service returned an invalid list.`}):(0,W.jsx)(`p`,{role:`status`,children:e.message})}function Ze(e,t){let[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(0),[o,s]=(0,F.useState)(null);return(0,F.useEffect)(()=>{let n=!0;return J(e,t)?()=>void 0:(A(e,{...e===`identity.audit.list`||e===`identity.api_keys.list`?{limit:50}:{},...t?{principal_id:t}:{}}).then(e=>{n&&r(e)}),()=>{n=!1})},[e,t,i]),{state:n,mutation:o,revoke:async(e,t)=>{if(!e)return;let n=await A(e,{id:t});s(n),n.kind===`ready`&&a(e=>e+1)},loadMore:async()=>{if(n?.kind!==`ready`||!n.result.next_cursor)return;let i=await A(e,{after:n.result.next_cursor,limit:50,...t?{principal_id:t}:{}});i.kind===`ready`?r({kind:`ready`,result:{items:[...n.result.items,...i.result.items],next_cursor:i.result.next_cursor}}):s(i)},refresh:()=>{a(e=>e+1)}}}function X({title:e,op:t,description:n,principalId:r,revokeOp:i}){let a=Ze(t,r),o=J(t,r)?`Enter a principal id to inspect its records.`:`Loading…`;return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:e}),(0,W.jsx)(m,{children:n})]}),(0,W.jsxs)(v,{children:[r&&(0,W.jsxs)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:[`Principal: `,r]}),a.state!==null&&(0,W.jsx)(E,{type:`button`,size:`sm`,variant:`outline`,className:`mb-3`,onClick:a.refresh,children:`Refresh`}),(0,W.jsx)(Xe,{state:a.state,revokeOp:i,loadingHint:o,onRevoke:e=>{a.revoke(i,e)},onLoadMore:()=>{a.loadMore()}}),a.mutation&&(0,W.jsx)(`p`,{role:`status`,children:a.mutation.kind===`ready`?`Revocation confirmed.`:a.mutation.message})]})]})}function Z({kind:e}){let[t,n]=(0,F.useState)(``),[r,i]=(0,F.useState)(``);return(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),i(t.trim())},children:[(0,W.jsx)(b,{"aria-label":`${e===`sessions`?`Session`:`API key`} principal id`,placeholder:`Principal id`,value:t,onChange:e=>{n(e.target.value)}}),(0,W.jsxs)(E,{type:`submit`,disabled:!t.trim(),children:[`Load `,e]})]}),(0,W.jsx)(X,{title:e===`sessions`?`Sessions`:`API keys`,op:e===`sessions`?`identity.sessions.list`:`identity.api_keys.list`,principalId:r,revokeOp:e===`sessions`?`identity.sessions.revoke`:`identity.api_keys.revoke`,description:e===`sessions`?`Sessions for the selected principal.`:`Metadata only; secrets are never displayed.`})]})}function Q({kind:e}){let[t,n]=(0,F.useState)(``),[r,i]=(0,F.useState)(``),[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)(``),[l,u]=(0,F.useState)(`add`),[d,f]=(0,F.useState)(null),[p,h]=(0,F.useState)(!1),g=e===`group`,y=g?`Group`:`Role`,x=async()=>{h(!0);let e=a.split(`,`).map(e=>e.trim()).filter(Boolean);f(await A(g?`identity.groups.upsert`:`identity.roles.upsert`,g?{group_id:t,name:r,roles:e}:{role_id:t,name:r,scopes:e})),h(!1)},S=async()=>{h(!0),f(await A(g?`identity.groups.change_membership`:`identity.roles.change_user_role`,g?{principal_id:s,group_id:t,change:l}:{principal_id:s,role_id:t,change:l})),h(!1)};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsxs)(T,{children:[y,` administration`]}),(0,W.jsx)(m,{children:`Writes require administrator authority and fresh MFA.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[(0,W.jsx)(b,{"aria-label":`${y} id`,placeholder:`${y} id`,value:t,onChange:e=>{n(e.target.value)}}),(0,W.jsx)(b,{"aria-label":`${y} name`,placeholder:`Display name`,value:r,onChange:e=>{i(e.target.value)}}),(0,W.jsx)(b,{"aria-label":g?`Group roles`:`Role scopes`,placeholder:g?`Roles, comma separated`:`Scopes, comma separated`,value:a,onChange:e=>{o(e.target.value)}})]}),(0,W.jsxs)(E,{type:`button`,disabled:p||!t.trim()||!r.trim(),onClick:()=>{x()},children:[`Save `,y.toLowerCase()]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2 border-t pt-3`,children:[(0,W.jsx)(b,{"aria-label":`Member principal id`,className:`max-w-xs`,placeholder:`Principal id`,value:s,onChange:e=>{c(e.target.value)}}),(0,W.jsxs)(`select`,{"aria-label":`Membership action`,className:`rounded border bg-background p-2`,value:l,onChange:e=>{u(e.target.value)},children:[(0,W.jsx)(`option`,{value:`add`,children:`Add`}),(0,W.jsx)(`option`,{value:`remove`,children:`Remove`})]}),(0,W.jsx)(E,{type:`button`,disabled:p||!t.trim()||!s.trim(),onClick:()=>{S()},children:`Apply membership`})]}),d&&(0,W.jsx)(`p`,{role:`status`,children:d.kind===`ready`?`${y} change confirmed. Refresh the list.`:d.message})]})]})}function Qe(){let[e,t]=(0,F.useState)(``),[n,r]=(0,F.useState)(`{"groups":[]}`),[i,a]=(0,F.useState)(null),o=async()=>{try{let t=JSON.parse(n);if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Claims must be an object`);if(!Object.values(t).every(e=>Array.isArray(e)&&e.every(e=>typeof e==`string`)))throw Error(`Every claim must be a string array`);a(await A(`identity.idps.mapping_dry_run`,{idp_id:e,claims:t}))}catch{a({kind:`error`,message:`Enter a JSON object whose values are string arrays.`})}};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Mapping rule dry run`}),(0,W.jsx)(m,{children:`Preview the roles, groups and scopes a sample claim set would receive. This does not change an identity.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[(0,W.jsx)(b,{"aria-label":`Identity provider id`,placeholder:`Identity provider id`,value:e,onChange:e=>{t(e.target.value)}}),(0,W.jsx)(`textarea`,{"aria-label":`Sample claims JSON`,className:`w-full rounded border bg-background p-2 font-mono text-sm`,rows:4,value:n,onChange:e=>{r(e.target.value)}}),(0,W.jsx)(E,{type:`button`,disabled:!e.trim(),onClick:()=>{o()},children:`Evaluate mapping`}),i?.kind!==`ready`&&i!==null&&(0,W.jsx)(`p`,{role:`status`,children:i.message}),i?.kind===`ready`&&(0,W.jsxs)(`dl`,{className:`text-sm space-y-1`,children:[(0,W.jsx)(`dt`,{children:`Roles`}),(0,W.jsx)(`dd`,{children:i.result.roles.join(`, `)||`None`}),(0,W.jsx)(`dt`,{children:`Groups`}),(0,W.jsx)(`dd`,{children:i.result.groups.join(`, `)||`None`}),(0,W.jsx)(`dt`,{children:`Scopes`}),(0,W.jsx)(`dd`,{children:i.result.scopes.join(`, `)||`None`})]})]})]})}function $(){let[e,t]=(0,F.useState)(``),[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(`oidc`),[o,s]=(0,F.useState)(`{}`),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)(null),f=async()=>{try{let t=JSON.parse(o);if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Invalid configuration`);d(await A(`identity.idps.upsert`,{idp_id:e.trim(),kind:i,display_name:n.trim(),enabled:!1,config_json:o,jit_policy:`deny`,...c.trim()?{secret_ref:c.trim()}:{}}))}catch{d({kind:`error`,message:`Configuration must be a JSON object.`})}};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Configure identity provider`}),(0,W.jsx)(m,{children:`Use a secret reference; do not paste credentials. New providers start disabled with just-in-time provisioning denied until mapping rules are reviewed.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,W.jsx)(b,{"aria-label":`Provider id`,placeholder:`Provider id`,value:e,onChange:e=>{t(e.target.value)}}),(0,W.jsx)(b,{"aria-label":`Provider display name`,placeholder:`Display name`,value:n,onChange:e=>{r(e.target.value)}})]}),(0,W.jsxs)(`select`,{"aria-label":`Provider kind`,className:`rounded border bg-background p-2`,value:i,onChange:e=>{a(e.target.value)},children:[(0,W.jsx)(`option`,{value:`oidc`,children:`OIDC`}),(0,W.jsx)(`option`,{value:`saml`,children:`SAML`}),(0,W.jsx)(`option`,{value:`ldap`,children:`LDAP`}),(0,W.jsx)(`option`,{value:`scim`,children:`SCIM`})]}),(0,W.jsx)(b,{"aria-label":`Provider secret reference`,placeholder:`Secret reference (optional)`,value:c,onChange:e=>{l(e.target.value)}}),(0,W.jsx)(`textarea`,{"aria-label":`Provider configuration JSON`,className:`w-full rounded border bg-background p-2 font-mono text-sm`,rows:5,value:o,onChange:e=>{s(e.target.value)}}),(0,W.jsx)(E,{type:`button`,disabled:!e.trim()||!n.trim(),onClick:()=>{f()},children:`Save provider`}),u&&(0,W.jsx)(`p`,{role:`status`,children:u.kind===`ready`?`Provider saved. Refresh the list.`:u.message})]})]})}function $e(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(`break_glass`),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(null);return(0,F.useEffect)(()=>{let e=!0;return A(`identity.mode.status`).then(n=>{e&&t(n)}),()=>{e=!1}},[]),{state:e,target:n,setTarget:r,fallback:i,setFallback:a,acknowledged:o,setAcknowledged:s,transition:c,submit:async()=>{let e=await A(`identity.mode.transition`,n===`external`?{to:n,local_fallback:i}:{to:n});l(e),e.kind===`ready`&&t(await A(`identity.mode.status`))}}}function et(e,t,n){return!e||!t||n?.kind!==`ready`||t===n.result.mode}function tt(){let e=$e();return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Security mode`}),(0,W.jsx)(m,{children:`Mode transitions require a fresh MFA administrator session. A successful transition revokes existing sessions.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[e.state===null&&(0,W.jsx)(`p`,{role:`status`,children:`Loading mode…`}),e.state!==null&&e.state.kind!==`ready`&&(0,W.jsx)(`p`,{role:`status`,children:e.state.message}),e.state?.kind===`ready`&&(0,W.jsxs)(`p`,{children:[`Current mode: `,(0,W.jsx)(`strong`,{children:e.state.result.mode})]}),(0,W.jsx)(`label`,{className:`block text-sm`,htmlFor:`target-mode`,children:`Target mode`}),(0,W.jsxs)(`select`,{id:`target-mode`,className:`rounded border bg-background p-2`,value:e.target,onChange:t=>{e.setTarget(t.target.value)},children:[(0,W.jsx)(`option`,{value:``,children:`Select a mode`}),(0,W.jsx)(`option`,{value:`local`,children:`Local`}),(0,W.jsx)(`option`,{value:`external`,children:`External`})]}),e.target===`external`&&(0,W.jsxs)(`select`,{"aria-label":`Local fallback`,className:`rounded border bg-background p-2`,value:e.fallback,onChange:t=>{e.setFallback(t.target.value)},children:[(0,W.jsx)(`option`,{value:`off`,children:`No local fallback`}),(0,W.jsx)(`option`,{value:`break_glass`,children:`Break glass only`}),(0,W.jsx)(`option`,{value:`full`,children:`Full local fallback`})]}),(0,W.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:e.acknowledged,onChange:t=>{e.setAcknowledged(t.target.checked)}}),`I understand this transition revokes current sessions.`]}),(0,W.jsx)(E,{type:`button`,disabled:et(e.acknowledged,e.target,e.state),onClick:()=>{e.submit()},children:`Request transition`}),e.transition&&(0,W.jsx)(`p`,{role:`status`,children:e.transition.kind===`ready`?`Transition completed. Sign in again.`:e.transition.message})]})]})}function nt(){let[e,t]=(0,F.useState)(!1),[n,r]=(0,F.useState)(null),i=async()=>{r(await A(`identity.issuer.rotate`))};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Issuer key rotation`}),(0,W.jsx)(m,{children:`Rotate the Arbora signer with overlap. A fresh administrator MFA confirmation is required.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[(0,W.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>{t(e.target.checked)}}),`I understand issuer rotation changes the signing key.`]}),(0,W.jsx)(E,{type:`button`,disabled:!e,onClick:()=>{i()},children:`Request issuer rotation`}),n&&(0,W.jsx)(`p`,{role:`status`,children:n.kind===`ready`?`Issuer key rotated (epoch ${n.result.epoch}, key ${n.result.issuer_kid_current}).`:n.message})]})]})}function rt(){let[e,t]=(0,F.useState)(``),[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(null),c=async()=>{a(await A(`identity.scim_clients.list`))};(0,F.useEffect)(()=>{c()},[]);let l=async()=>{let t=await A(`identity.scim_clients.upsert`,{idp_id:e.trim(),principal_id:n.trim()});s(t),t.kind===`ready`&&c()},u=async e=>{let t=await A(`identity.scim_clients.remove`,{idp_id:e});s(t),t.kind===`ready`&&c()};return(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`SCIM clients`}),(0,W.jsx)(m,{children:`Bind an enabled SCIM provider to an active service principal.`})]}),(0,W.jsxs)(v,{className:`space-y-3`,children:[i===null&&(0,W.jsx)(`p`,{role:`status`,children:`Loading SCIM clients…`}),i&&i.kind!==`ready`&&(0,W.jsx)(`p`,{role:`status`,children:i.message}),i?.kind===`ready`&&(0,W.jsx)(`ul`,{className:`space-y-2`,children:i.result.items.map(e=>(0,W.jsxs)(`li`,{className:`flex items-center justify-between rounded border p-2`,children:[(0,W.jsxs)(`span`,{children:[e.idp_id,`: `,(0,W.jsx)(`code`,{children:e.principal_id}),` (`,e.enabled?`enabled`:`disabled`,`)`]}),(0,W.jsx)(E,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{u(e.idp_id)},children:`Remove`})]},e.idp_id))}),(0,W.jsx)(b,{"aria-label":`SCIM provider id`,placeholder:`Provider id`,value:e,onChange:e=>{t(e.target.value)}}),(0,W.jsx)(b,{"aria-label":`SCIM service principal id`,placeholder:`Service principal id`,value:n,onChange:e=>{r(e.target.value)}}),(0,W.jsx)(E,{type:`button`,disabled:!e.trim()||!n.trim(),onClick:()=>{l()},children:`Bind SCIM client`}),o&&(0,W.jsx)(`p`,{role:`status`,children:o.kind===`ready`?`SCIM client change confirmed.`:o.message})]})]})}function it(){let[e,t]=(0,F.useState)(null),[n,r]=(0,F.useState)(null),i=async()=>{t(await A(`identity.audit.verify`))},a=async()=>{let e=await A(`identity.audit.export`,{limit:500});if(r(e),e.kind!==`ready`)return;let t=URL.createObjectURL(new Blob([JSON.stringify(e.result,null,2)],{type:`application/json`})),n=document.createElement(`a`);n.href=t,n.download=`identity-audit-page.json`,n.click(),URL.revokeObjectURL(t)};return(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(X,{title:`Identity audit`,op:`identity.audit.list`,description:`Identity administration events.`}),(0,W.jsxs)(D,{children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(T,{children:`Audit integrity and export`}),(0,W.jsx)(m,{children:`Verify the chain or export a bounded page with its continuation cursor.`})]}),(0,W.jsxs)(v,{className:`space-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(E,{type:`button`,variant:`outline`,onClick:()=>{i()},children:`Verify audit chain`}),(0,W.jsx)(E,{type:`button`,variant:`outline`,onClick:()=>{a()},children:`Export first audit page`})]}),e&&(0,W.jsx)(`p`,{role:`status`,children:e.kind===`ready`?e.result.valid?`Audit chain verified.`:`Audit chain broken at sequence ${e.result.first_broken_seq??`unknown`}.`:e.message}),n&&n.kind!==`ready`&&(0,W.jsx)(`p`,{role:`status`,children:n.message})]})]})]})}function at(){return(0,W.jsxs)(`div`,{className:`space-y-6`,"data-testid":`admin-view`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`h1`,{className:`text-2xl font-bold flex items-center gap-2`,children:[(0,W.jsx)(ae,{className:`size-6`}),`Admin Console`]}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Arbora identity, security and engine administration.`})]}),(0,W.jsxs)(ce,{defaultValue:`users`,children:[(0,W.jsx)(se,{className:`flex h-auto flex-wrap justify-start`,children:[`users`,`service-accounts`,`groups`,`roles`,`idps`,`sessions`,`api-keys`,`audit`,`security-mode`,`policy`,`tenants`,`shards`,`backup`].map(e=>(0,W.jsx)(oe,{value:e,children:e.replaceAll(`-`,` `)},e))}),(0,W.jsx)(k,{value:`users`,children:(0,W.jsx)(M,{})}),(0,W.jsx)(k,{value:`service-accounts`,children:(0,W.jsx)(X,{title:`Service accounts`,op:`identity.service_accounts.list`,description:`Active service principals from Arbora identity.`})}),(0,W.jsxs)(k,{value:`groups`,className:`space-y-4`,children:[(0,W.jsx)(X,{title:`Groups`,op:`identity.groups.list`,description:`Groups and memberships from Arbora identity.`}),(0,W.jsx)(Q,{kind:`group`})]}),(0,W.jsxs)(k,{value:`roles`,className:`space-y-4`,children:[(0,W.jsx)(X,{title:`Roles and scopes`,op:`identity.roles.list`,description:`Roles and effective scope grants from Arbora identity.`}),(0,W.jsx)(Q,{kind:`role`})]}),(0,W.jsxs)(k,{value:`idps`,className:`space-y-4`,children:[(0,W.jsx)(X,{title:`Identity providers`,op:`identity.idps.list`,description:`Configured external authorities.`}),(0,W.jsx)($,{}),(0,W.jsx)(Qe,{}),(0,W.jsx)(rt,{})]}),(0,W.jsx)(k,{value:`sessions`,children:(0,W.jsx)(Z,{kind:`sessions`})}),(0,W.jsx)(k,{value:`api-keys`,children:(0,W.jsx)(Z,{kind:`api-keys`})}),(0,W.jsx)(k,{value:`audit`,children:(0,W.jsx)(it,{})}),(0,W.jsxs)(k,{value:`security-mode`,className:`space-y-4`,children:[(0,W.jsx)(tt,{}),(0,W.jsx)(nt,{})]}),(0,W.jsx)(k,{value:`policy`,children:(0,W.jsx)(Ke,{})}),(0,W.jsx)(k,{value:`tenants`,children:(0,W.jsx)(xe,{})}),(0,W.jsx)(k,{value:`shards`,children:(0,W.jsx)(ke,{})}),(0,W.jsx)(k,{value:`backup`,children:(0,W.jsx)(Re,{})})]})]})}export{at as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./bundle-mjs-DIyOrgL5.js";import{t as r}from"./external-link-Dyd5OsGm.js";import{t as i}from"./plus-s20KYBeu.js";import{t as a}from"./refresh-cw-BVhl5aJX.js";import{t as o}from"./sparkles-Bae0tRI0.js";import{t as s}from"./badge-nQZ87mVE.js";import{E as c,S as l,c as u,d,f,i as p,x as m}from"./api-validation-CCoR_LRu.js";import{C as h,E as ee,En as te,O as ne,T as re,Yt as g,in as _,jt as v,k as ie,on as ae,pn as oe,pr as se,qn as ce,rn as y,sr as le,w as ue}from"./index-BL_57l7k.js";import{i as de,n as b,r as fe,t as pe}from"./tabs-A3rvoq-T.js";import{t as x}from"./unavailable-notice-B7WdWNor.js";import{t as S}from"./status-message-JWIBft3W.js";import{t as me}from"./scroll-area-srEWz9Q3.js";var C=n(e()),w=t();function he(e){return e===`library`||e===`compose`||e===`external`||e===`config`}function ge(e,t,n,r){e!==t&&(n.current+=1,r.current+=1)}var _e=l({id:c().min(1),name:c().min(1),description:c(),kind:u([`local`,`a2a`]),mcp_server:c().nullable().optional(),model_preference:c().nullable().optional(),timestamp:c().nullable().optional(),status:c().optional(),runnable_bound:f().optional(),tools:d(l({id:c().optional(),name:c().optional()})).optional(),endpoint:c().nullable().optional()}),ve=l({id:c().min(1),name:c().min(1),mcp_server:c().nullable().optional(),tags:d(c())}),ye=l({mcp_server:c().min(1),tool_count:m().int().nonnegative(),sample_tools:d(c()),reason:c()}),be=l({id:c().min(1),provider:c().min(1),intelligence_level:c().optional(),vision:f().optional(),reasoning:f().optional(),tools_enabled:f().optional(),can_route:f().optional(),can_kg:f().optional(),context_window:m().int().positive().nullable().optional()}),xe=l({id:c().min(1),provider:c().min(1),chunk_size:m().int().positive().optional(),context_window:m().int().positive().nullable().optional()}),Se=l({app_profile:c(),deployment_profile:c(),chat_models:d(be),embedding_models:d(xe)});function Ce(e){e.controller.current?.abort();let t=new AbortController,n=e.sequence.current+1;return e.sequence.current=n,e.controller.current=t,{id:n,controller:t}}function T(e,t,n){return e.sequence.current===t&&e.controller.current===n&&!n.signal.aborted}function we(e){return e instanceof Error&&e.name===`AbortError`}function Te(e){for(let t of e)t.sequence.current+=1,t.controller.current?.abort(),t.controller.current=null}function Ee(e){window.history.pushState({},``,e),window.dispatchEvent(new Event(`history-state-changed`))}var E=120,D=32e3,O=2048;function k(e){let t=e.trim();if(!t)return`Enter the URL of the external agent`;if(I(t)>O)return`The URL must be 2,048 UTF-8 bytes or fewer`;try{let e=new URL(t);if(e.protocol!==`http:`&&e.protocol!==`https:`)return`Use an http:// or https:// URL`}catch{return`Enter a complete http:// or https:// URL`}return null}function A(e){if(!e.trim())return{value:void 0,error:null};try{let t=JSON.parse(e);return typeof t!=`object`||!t||Array.isArray(t)||Object.keys(t).length===0?{value:void 0,error:`Agent card JSON must be a non-empty JSON object`}:{value:t,error:null}}catch{return{value:void 0,error:`Enter valid JSON for the agent card`}}}function j(e){return e.trim()?k(e):null}function M(e,t,n){return n?`${e} ${t}`:e}function N(e,t){return t?(0,w.jsx)(`p`,{id:e,role:`alert`,className:`mt-1 text-[11px] text-red-400 font-medium`,children:t}):null}function P(e,t,n,r){return[e,!t.trim(),!!n,!!r].some(Boolean)}function De(e){return`${(e.replace(/[^A-Za-z0-9_.:-]/g,`-`).replace(/^[^A-Za-z0-9]+/,``)||`custom`).slice(0,114)}-agent`}function F(e){return Array.from(e).length}function I(e){return new TextEncoder().encode(e).byteLength}function L(){return null}async function Oe(e,t,n){let r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});return r.ok?{ok:!0}:{ok:!1,error:(await r.json().catch(L))?.detail??n}}function ke(e,t){let n=e.trim(),r=n?k(e):`An agent URL is required`,i=A(t);return{url:n,agentCard:i.value,error:r??i.error}}function Ae(e,t){return!e||!t?`Name and instructions are required`:F(e)>E?`Agent name must be ${E} characters or fewer`:I(t)>D?`Instructions must be ${D.toLocaleString()} bytes or fewer`:null}var je={app_profile:``,deployment_profile:``,chat_models:[],embedding_models:[]};function R(){return(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5`,children:[(0,w.jsx)(o,{className:`size-3.5 text-emerald-400`}),` Suggested, from what is installed`]}),(0,w.jsx)(x,{what:`Agent suggestions`})]})}function z(e,t){return(0,w.jsxs)(`div`,{className:`p-3.5 rounded-lg border border-emerald-500/20 bg-emerald-500/5 flex flex-col gap-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,w.jsx)(`span`,{className:`font-bold text-sm text-foreground`,children:e.mcp_server}),(0,w.jsxs)(s,{variant:`secondary`,className:`text-[10px]`,children:[e.tool_count,` tool`,e.tool_count===1?``:`s`]})]}),(0,w.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.reason}),(0,w.jsxs)(y,{size:`sm`,variant:`outline`,className:`self-start h-7 text-xs`,onClick:t.bind(null,e),children:[(0,w.jsx)(i,{className:`size-3.5 mr-1`}),` Build this agent`]})]},e.mcp_server)}function Me(e,t){return e.length===0?null:(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5`,children:[(0,w.jsx)(o,{className:`size-3.5 text-emerald-400`}),` Suggested, from what is installed`]}),(0,w.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:e.slice(0,6).map(e=>z(e,t))})]})}function B({loadingSuggestions:e,suggestionsUnavailable:t,suggestions:n,onStartFromSuggestion:r}){return e?null:t?R():Me(n,r)}async function V({refs:e,path:t,schema:n,fallback:r,setData:i,setLoading:a,setUnavailable:o,onFailure:s}){let c=Ce(e);try{a(!0);let r=await p(t,n,{signal:c.controller.signal});if(!T(e,c.id,c.controller))return;i(r),o(!1)}catch(t){if(!T(e,c.id,c.controller)||we(t))return;i(r),o(!0),s?.()}finally{T(e,c.id,c.controller)&&a(!1)}}function Ne(){_.error(`Failed to connect to the Agent Library`)}function H({agent:e,onArchive:t}){return(0,w.jsxs)(`div`,{className:`p-4 rounded-xl border border-border/40 bg-muted/10 backdrop-blur-sm hover:border-emerald-500/30 transition-all flex flex-col justify-between`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[e.kind===`a2a`?(0,w.jsx)(ce,{className:`size-4 text-teal-400 shrink-0`}):(0,w.jsx)(se,{className:`size-4 text-emerald-400 shrink-0`}),(0,w.jsx)(`h4`,{className:`font-bold text-sm text-foreground truncate`,children:e.name})]}),(0,w.jsx)(s,{variant:`outline`,className:`text-[10px] font-semibold shrink-0 ${e.kind===`a2a`?`bg-teal-500/10 border-teal-500/30 text-teal-400`:`bg-emerald-500/10 border-emerald-500/30 text-emerald-400`}`,children:e.kind===`a2a`?`External · A2A`:`Local`})]}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground leading-normal line-clamp-3`,children:e.description||`No description.`}),e.mcp_server&&(0,w.jsxs)(`div`,{className:`text-[10px] text-muted-foreground mt-2`,children:[(0,w.jsx)(ae,{className:`size-3 inline mr-1`}),`bound to `,(0,w.jsx)(`code`,{className:`font-mono`,children:e.mcp_server})]})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-center justify-between border-t border-border/30 pt-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-emerald-400 font-bold`,children:[(0,w.jsx)(le,{className:`size-3`}),e.runnable_bound===!1?`Prompt only`:`Delegatable`]}),(0,w.jsx)(`button`,{type:`button`,onClick:()=>{t(e)},className:`p-1.5 rounded text-muted-foreground hover:text-red-400 hover:bg-red-500/10 transition-all`,"aria-label":`Archive ${e.name}`,children:(0,w.jsx)(oe,{className:`size-3.5`})})]})]},e.id)}function U({loadingAgents:e,agentsUnavailable:t,filteredAgents:n,onArchive:r,onCancelLoading:i}){return e?(0,w.jsx)(`div`,{className:`flex justify-center py-12`,children:(0,w.jsx)(S,{status:`loading`,label:`Querying the graph...`,onCancel:i})}):t?(0,w.jsx)(`div`,{className:`text-center py-12`,children:(0,w.jsx)(x,{what:`The Agent Library`,className:`justify-center`})}):n.length===0?(0,w.jsx)(`div`,{className:`flex justify-center py-12`,children:(0,w.jsx)(S,{status:`empty`,label:`No agents yet. Compose one, or register an external A2A agent.`})}):(0,w.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:n.map(e=>H({agent:e,onArchive:r}))})}function Pe(e){let{loadingSuggestions:t,suggestionsUnavailable:n,suggestions:r,onStartFromSuggestion:o,search:s,onSearchChange:c,onRefresh:l,loadingAgents:u,onNewAgent:d,agentsUnavailable:f,filteredAgents:p,onArchive:m,onCancelLoadingAgents:h}=e;return(0,w.jsxs)(`div`,{className:`space-y-6`,children:[B({loadingSuggestions:t,suggestionsUnavailable:n,suggestions:r,onStartFromSuggestion:o}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1`,children:[(0,w.jsx)(te,{className:`absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground`}),(0,w.jsx)(g,{"aria-label":`Search agents`,placeholder:`Search your agents...`,value:s,onChange:e=>{c(e.target.value)},className:`pl-9 h-9 bg-muted/20`})]}),(0,w.jsx)(y,{variant:`outline`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:l,disabled:u,"aria-label":`Refresh agents`,children:(0,w.jsx)(a,{className:`size-4 ${u?`animate-spin`:``}`})}),(0,w.jsxs)(y,{size:`sm`,onClick:d,children:[(0,w.jsx)(i,{className:`size-4 mr-1.5`}),` New agent`]})]}),(0,w.jsx)(me,{className:`h-[calc(100vh-32rem)] min-h-[16rem] pr-2`,children:U({loadingAgents:u,agentsUnavailable:f,filteredAgents:p,onArchive:m,onCancelLoading:h})})]})}function W(e,t,n){return(0,w.jsxs)(`label`,{htmlFor:`compose-tool-${e.id}`,className:`flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted/20 cursor-pointer`,children:[(0,w.jsx)(h,{id:`compose-tool-${e.id}`,"aria-label":`Use ${e.name}${e.mcp_server?` from ${e.mcp_server}`:``}`,checked:t.has(e.id),onCheckedChange:n.bind(null,e.id)}),(0,w.jsx)(`span`,{className:`text-xs font-mono`,children:e.name}),e.mcp_server&&(0,w.jsx)(`span`,{className:`text-[10px] text-muted-foreground ml-auto`,children:e.mcp_server})]},e.id)}function G({loadingTools:e,toolsUnavailable:t,tools:n,selectedToolIds:r,onToggleTool:i}){return e?(0,w.jsx)(`div`,{className:`p-2`,children:(0,w.jsx)(S,{status:`loading`,label:`Loading tools...`,className:`text-xs`})}):t?(0,w.jsx)(`div`,{className:`p-2`,children:(0,w.jsx)(x,{what:`The tool catalog`})}):n.length===0?(0,w.jsx)(`div`,{className:`p-2`,children:(0,w.jsx)(S,{status:`empty`,label:`No tools ingested yet for this filter — the agent can still run prompt-only.`,className:`text-xs`})}):(0,w.jsx)(w.Fragment,{children:n.map(e=>W(e,r,i))})}function Fe(e){let{composeName:t,onComposeNameChange:n,composeDescription:r,onComposeDescriptionChange:i,composeInstructions:a,onComposeInstructionsChange:o,composeServer:s,onComposeServerChange:c,serverNames:l,composeModel:u,onComposeModelChange:d,chatModels:f,composing:p,onCompose:m}=e;return(0,w.jsxs)(`div`,{className:`max-w-2xl space-y-5`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-name`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Name`}),(0,w.jsx)(g,{id:`compose-agent-name`,required:!0,"aria-describedby":`compose-agent-name-help`,value:t,onChange:e=>{n(e.target.value)},placeholder:`e.g. release-notes-writer`,className:`mt-1 bg-muted/20`}),(0,w.jsx)(`p`,{id:`compose-agent-name-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Required. Up to 120 characters; leading and trailing whitespace is removed before saving.`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-description`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Description`}),(0,w.jsx)(g,{id:`compose-agent-description`,"aria-describedby":`compose-agent-description-help`,value:r,onChange:e=>{i(e.target.value)},placeholder:`One line: what does this agent do for you?`,className:`mt-1 bg-muted/20`}),(0,w.jsx)(`p`,{id:`compose-agent-description-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Optional one-line summary so you can recognize this agent later.`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-instructions`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Instructions (its system prompt)`}),(0,w.jsx)(v,{id:`compose-agent-instructions`,required:!0,maxLength:D,"aria-describedby":`compose-agent-instructions-help`,value:a,onChange:e=>{o(e.target.value)},placeholder:`You are a specialist that...`,className:`mt-1 bg-muted/20 font-mono text-xs leading-relaxed`,rows:8}),(0,w.jsx)(`p`,{id:`compose-agent-instructions-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Required. Describe the agent's role and how it should complete work (up to 32,000 UTF-8 bytes).`})]}),(0,w.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-server`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Bind an entire MCP server's tools (optional)`}),(0,w.jsxs)(`select`,{id:`compose-agent-server`,"aria-describedby":`compose-agent-server-help`,value:s,onChange:e=>{c(e.target.value)},className:`w-full h-9 mt-1 px-3 rounded-md border border-input bg-muted/20 text-xs`,children:[(0,w.jsx)(`option`,{value:``,children:`— none —`}),l.map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))]}),(0,w.jsx)(`p`,{id:`compose-agent-server-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Optional. Select a server to make all of its tools available to this agent.`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-model`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Preferred model (optional, advisory)`}),(0,w.jsxs)(`select`,{id:`compose-agent-model`,"aria-describedby":`compose-agent-model-help`,value:u,onChange:e=>{d(e.target.value)},className:`w-full h-9 mt-1 px-3 rounded-md border border-input bg-muted/20 text-xs`,children:[(0,w.jsx)(`option`,{value:``,children:`— default —`}),f.map(e=>(0,w.jsxs)(`option`,{value:e.id,children:[e.id,` (`,e.provider,`)`]},e.id))]}),(0,w.jsx)(`p`,{id:`compose-agent-model-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Optional hint for delegation; the default model is used when this is left unchanged.`})]})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{id:`compose-agent-tools-label`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Or pick individual tools`}),(0,w.jsx)(`p`,{id:`compose-agent-tools-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Choose specific tools when you do not want to grant access to an entire server.`}),(0,w.jsx)(`div`,{role:`group`,"aria-labelledby":`compose-agent-tools-label`,"aria-describedby":`compose-agent-tools-help`,className:`mt-2 max-h-56 overflow-y-auto rounded-lg border border-border/20 bg-muted/5 p-2 space-y-1`,children:G(e)})]}),(0,w.jsx)(y,{onClick:m,disabled:p||!t.trim()||!a.trim(),className:`bg-emerald-600 hover:bg-emerald-700`,children:p?`Saving...`:`Save agent to the Library`})]})}function Ie({a2aUrl:e,onA2aUrlChange:t,a2aCardJson:n,onA2aCardJsonChange:r,registering:i,onRegister:a}){let o=j(e),s=A(n).error;return(0,w.jsxs)(`div`,{className:`max-w-2xl space-y-5`,children:[(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Register an outside agent that speaks the A2A protocol. Give its URL and, if it doesn't publish a discoverable agent card, paste the card JSON yourself. The URL is used to discover the agent; it is not a secret.`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`external-agent-url`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Agent URL`}),(0,w.jsx)(g,{id:`external-agent-url`,type:`url`,required:!0,maxLength:O,"aria-describedby":M(`external-agent-url-help`,`external-agent-url-error`,o),"aria-invalid":!!o,value:e,onChange:e=>{t(e.target.value)},placeholder:`https://agent.example.com`,className:`mt-1 bg-muted/20 font-mono text-xs`}),(0,w.jsx)(`p`,{id:`external-agent-url-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Required. Use a complete http:// or https:// URL (up to 2,048 UTF-8 bytes).`}),N(`external-agent-url-error`,o)]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`external-agent-card-json`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Agent card JSON (optional — auto-fetched from the URL if left blank)`}),(0,w.jsx)(v,{id:`external-agent-card-json`,"aria-describedby":M(`external-agent-card-help`,`external-agent-card-error`,s),"aria-invalid":!!s,value:n,onChange:e=>{r(e.target.value)},placeholder:`{"name": "...", "description": "...", "capabilities": []}`,className:`mt-1 bg-muted/20 font-mono text-xs`,rows:8}),(0,w.jsx)(`p`,{id:`external-agent-card-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Optional. Leave blank to let the server fetch the card. If you paste one, it must be a non-empty JSON object.`}),N(`external-agent-card-error`,s)]}),(0,w.jsx)(y,{type:`button`,onClick:a,disabled:P(i,e,o,s),className:`bg-teal-600 hover:bg-teal-700`,children:i?`Registering...`:`Register external agent`})]})}function Le(e){return(0,w.jsxs)(`div`,{className:`p-3 rounded-lg border border-border/30 bg-muted/5 space-y-1.5`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`span`,{className:`font-mono font-bold text-xs`,children:e.id}),(0,w.jsx)(s,{variant:`outline`,className:`text-[9px]`,children:e.provider})]}),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.intelligence_level&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:e.intelligence_level}),e.can_route&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`router`}),e.can_kg&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`kg`}),e.vision&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`vision`}),e.reasoning&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`reasoning`}),e.tools_enabled&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`tools`})]}),e.context_window?(0,w.jsxs)(`div`,{className:`text-[10px] text-muted-foreground`,children:[e.context_window.toLocaleString(),` token context`]}):null]},e.id)}function K({configUnavailable:e,chatModels:t}){return(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground mb-2`,children:`Chat models`}),e?null:t.length===0?(0,w.jsx)(S,{status:`empty`,label:`No chat models configured.`,className:`text-xs`}):(0,w.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:t.map(Le)})]})}function q(e){return(0,w.jsxs)(`div`,{className:`p-3 rounded-lg border border-border/30 bg-muted/5 space-y-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`span`,{className:`font-mono font-bold text-xs`,children:e.id}),(0,w.jsx)(s,{variant:`outline`,className:`text-[9px]`,children:e.provider})]}),(0,w.jsxs)(`div`,{className:`text-[10px] text-muted-foreground`,children:[`chunk `,e.chunk_size??`—`,e.context_window?` · ${e.context_window.toLocaleString()} token context`:``]})]},e.id)}function J({configUnavailable:e,embeddingModels:t}){return(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground mb-2`,children:`Embedding models`}),e?null:t.length===0?(0,w.jsx)(S,{status:`empty`,label:`No embedding models configured.`,className:`text-xs`}):(0,w.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:t.map(q)})]})}function Re({loadingConfig:e,config:t,configUnavailable:n}){return e?(0,w.jsx)(`div`,{className:`space-y-6`,children:(0,w.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,w.jsx)(S,{status:`loading`,label:`Loading model configuration...`})})}):(0,w.jsxs)(`div`,{className:`space-y-6`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-4 text-xs`,children:[(0,w.jsxs)(`div`,{className:`rounded-md border border-border/30 bg-muted/10 px-3 py-2`,children:[(0,w.jsx)(`div`,{className:`text-muted-foreground`,children:`App profile`}),(0,w.jsx)(`div`,{className:`font-bold`,children:t.app_profile||`—`})]}),(0,w.jsxs)(`div`,{className:`rounded-md border border-border/30 bg-muted/10 px-3 py-2`,children:[(0,w.jsx)(`div`,{className:`text-muted-foreground`,children:`Deployment profile`}),(0,w.jsx)(`div`,{className:`font-bold`,children:t.deployment_profile||`—`})]})]}),n&&(0,w.jsx)(x,{what:`The model configuration summary`}),K({configUnavailable:n,chatModels:t.chat_models}),J({configUnavailable:n,embeddingModels:t.embedding_models}),(0,w.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Read-only view of the active `,(0,w.jsx)(`code`,{children:`AgentConfig`}),` model registry. Secrets and provider credentials are never sent to the browser.`]})]})}function Y(){let[e,t]=(0,C.useState)(`library`),[n,a]=(0,C.useState)([]),[s,c]=(0,C.useState)(!0),[l,u]=(0,C.useState)(``),[f,p]=(0,C.useState)([]),[m,h]=(0,C.useState)(!0),[te,g]=(0,C.useState)(!1),[v,ae]=(0,C.useState)([]),[oe,le]=(0,C.useState)(!1),[x,S]=(0,C.useState)(je),[me,be]=(0,C.useState)(!0),[xe,Ce]=(0,C.useState)(!1),[T,we]=(0,C.useState)(!1),[E,D]=(0,C.useState)(!1),[O,k]=(0,C.useState)(``),[A,j]=(0,C.useState)(``),[M,N]=(0,C.useState)(``),[P,F]=(0,C.useState)(``),[I,L]=(0,C.useState)(``),[R,z]=(0,C.useState)(new Set),[Me,B]=(0,C.useState)(!1),[H,U]=(0,C.useState)(``),[W,G]=(0,C.useState)(``),[Le,K]=(0,C.useState)(!1),q=(0,C.useRef)({sequence:{current:0},controller:{current:null}}),J=(0,C.useRef)({sequence:{current:0},controller:{current:null}}),Y=(0,C.useRef)({sequence:{current:0},controller:{current:null}}),ze=(0,C.useRef)({sequence:{current:0},controller:{current:null}}),X=(0,C.useRef)(0),Z=(0,C.useRef)(0),Q=async()=>{await V({refs:q.current,path:`/api/enhanced/agent-library/agents`,schema:d(_e),fallback:[],setData:a,setLoading:c,setUnavailable:Ce,onFailure:Ne})},Be=()=>{Te([q.current]),c(!1)},Ve=async()=>{await V({refs:J.current,path:`/api/enhanced/agent-library/suggestions`,schema:d(ye),fallback:[],setData:p,setLoading:h,setUnavailable:g})},$=async e=>{let t=e?`?mcp_server=${encodeURIComponent(e)}`:``;await V({refs:Y.current,path:`/api/enhanced/agent-library/tools${t}`,schema:d(ve),fallback:[],setData:ae,setLoading:le,setUnavailable:we})},He=async()=>{await V({refs:ze.current,path:`/api/enhanced/agent-library/config-summary`,schema:Se,fallback:je,setData:S,setLoading:be,setUnavailable:D})};(0,C.useEffect)(()=>(Q(),Ve(),$(),He(),Te.bind(null,[q.current,J.current,Y.current,ze.current])),[]);let Ue=(0,C.useMemo)(()=>{let e=new Set;for(let t of v)t.mcp_server&&e.add(t.mcp_server);return Array.from(e).sort()},[v]),We=e=>{z(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Ge=e=>{X.current+=1,t(`compose`),F(e.mcp_server),k(t=>t||De(e.mcp_server)),j(t=>t||`Uses the ${e.mcp_server} tools: ${e.sample_tools.join(`, `)}.`),$(e.mcp_server),_.message(`Composing an agent for '${e.mcp_server}'`)},Ke=()=>{X.current+=1,t(`compose`)},qe=async()=>{let n=O.trim(),r=M.trim(),i=Ae(n,r);if(i){_.error(i);return}let a=X.current,o=e;B(!0);try{let i=await Oe(`/api/enhanced/agent-library/agents`,{name:n,description:A.trim(),instructions:r,bind_server:P||void 0,model_preference:I||void 0,tool_ids:Array.from(R)},`Failed to compose the agent`);if(!i.ok){_.error(i.error);return}_.success(`Agent '${n}' saved and ready to delegate to`),X.current===a&&e===o&&(k(``),j(``),N(``),F(``),L(``),z(new Set),t(`library`)),Q(),Ve()}catch{_.error(`Network error composing the agent`)}finally{B(!1)}},Je=async e=>{try{if(!(await fetch(`/api/enhanced/agent-library/agents/${encodeURIComponent(e.id)}`,{method:`DELETE`})).ok){_.error(`Failed to archive that agent`);return}_.success(`Archived '${e.name}'`),Q()}catch{_.error(`Network error archiving the agent`)}},Ye=async()=>{let t=ke(H,W);if(t.error){_.error(t.error);return}let n=Z.current,r=e;K(!0);try{let i=await Oe(`/api/enhanced/agent-library/a2a`,{url:t.url,agent_card:t.agentCard},`Failed to register that agent`);if(!i.ok){_.error(i.error);return}_.success(`External agent registered`),Z.current===n&&e===r&&(U(``),G(``)),Q()}catch{_.error(`Network error registering the external agent`)}finally{K(!1)}},Xe=n.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())||e.description.toLowerCase().includes(l.toLowerCase())),Ze=[{id:`library`,label:`Library`,icon:se},{id:`compose`,label:`Compose an Agent`,icon:i},{id:`external`,label:`External Agents`,icon:ce},{id:`config`,label:`Model & Config`,icon:o}];return(0,w.jsx)(`div`,{className:`space-y-6`,children:(0,w.jsx)(ue,{className:`border-border/40 bg-card/60 backdrop-blur-md`,children:(0,w.jsxs)(pe,{value:e,onValueChange:n=>{let r=he(n)?n:e;ge(r,e,X,Z),t(r)},className:`w-full`,children:[(0,w.jsxs)(ne,{children:[(0,w.jsxs)(`div`,{className:`flex flex-col md:flex-row justify-between items-start md:items-center gap-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(ie,{className:`text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-teal-400 via-emerald-400 to-green-500`,children:`Agent Library`}),(0,w.jsx)(ee,{children:`Compose agents from prompts and tools you already have, register outside A2A agents, and call on any of them whenever you need. Saved agents live in the knowledge graph, not in this browser.`})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(y,{variant:`outline`,size:`sm`,onClick:()=>{Ee(`/prompts`)},children:[`Prompts Registry `,(0,w.jsx)(r,{className:`size-3.5 ml-1.5`})]}),(0,w.jsxs)(y,{variant:`outline`,size:`sm`,onClick:()=>{Ee(`/skills`)},children:[`Tools & Skills `,(0,w.jsx)(r,{className:`size-3.5 ml-1.5`})]})]})]}),(0,w.jsx)(fe,{"aria-label":`Agent library sections`,className:`flex flex-wrap justify-start h-auto gap-2 mt-4 rounded-none border-b border-border/40 bg-transparent p-0 pb-2`,children:Ze.map(e=>(0,w.jsxs)(de,{value:e.id,className:`flex items-center gap-2 rounded-md border border-transparent px-3 py-1.5 text-xs font-semibold data-[state=active]:border-emerald-500/30 data-[state=active]:bg-emerald-500/10 data-[state=active]:font-bold data-[state=active]:text-emerald-400`,children:[(0,w.jsx)(e.icon,{className:`size-3.5`}),(0,w.jsx)(`span`,{children:e.label})]},e.id))})]}),(0,w.jsxs)(re,{children:[(0,w.jsx)(b,{value:`library`,children:Pe({loadingSuggestions:m,suggestionsUnavailable:te,suggestions:f,onStartFromSuggestion:Ge,search:l,onSearchChange:u,onRefresh:()=>{Q(),Ve()},loadingAgents:s,onNewAgent:Ke,agentsUnavailable:xe,filteredAgents:Xe,onArchive:e=>{Je(e)},onCancelLoadingAgents:Be})}),(0,w.jsx)(b,{value:`compose`,children:Fe({composeName:O,onComposeNameChange:e=>{X.current+=1,k(e)},composeDescription:A,onComposeDescriptionChange:e=>{X.current+=1,j(e)},composeInstructions:M,onComposeInstructionsChange:e=>{X.current+=1,N(e)},composeServer:P,onComposeServerChange:e=>{X.current+=1,F(e),$(e||void 0)},serverNames:Ue,composeModel:I,onComposeModelChange:e=>{X.current+=1,L(e)},chatModels:x.chat_models,loadingTools:oe,toolsUnavailable:T,tools:v,selectedToolIds:R,onToggleTool:e=>{X.current+=1,We(e)},composing:Me,onCompose:()=>{qe()}})}),(0,w.jsx)(b,{value:`external`,children:Ie({a2aUrl:H,onA2aUrlChange:e=>{Z.current+=1,U(e)},a2aCardJson:W,onA2aCardJsonChange:e=>{Z.current+=1,G(e)},registering:Le,onRegister:()=>{Ye()}})}),(0,w.jsx)(b,{value:`config`,children:Re({loadingConfig:me,config:x,configUnavailable:E})})]})]})})})}export{Y as default};
|
|
1
|
+
import{i as e,r as t,s as n}from"./bundle-mjs-DIyOrgL5.js";import{t as r}from"./external-link-Dyd5OsGm.js";import{t as i}from"./plus-s20KYBeu.js";import{t as a}from"./refresh-cw-BVhl5aJX.js";import{t as o}from"./sparkles-Bae0tRI0.js";import{t as s}from"./badge-nQZ87mVE.js";import{E as c,S as l,c as u,d,f,i as p,x as m}from"./api-validation-CCoR_LRu.js";import{C as h,E as ee,En as te,O as ne,T as re,Yt as g,in as _,jt as v,k as ie,on as ae,pn as oe,pr as se,qn as ce,rn as y,sr as le,w as ue}from"./index-GCzCgfSc.js";import{i as de,n as b,r as fe,t as pe}from"./tabs-Bzz5t0iB.js";import{t as x}from"./unavailable-notice-B7WdWNor.js";import{t as S}from"./status-message-4rJx-ibz.js";import{t as me}from"./scroll-area-srEWz9Q3.js";var C=n(e()),w=t();function he(e){return e===`library`||e===`compose`||e===`external`||e===`config`}function ge(e,t,n,r){e!==t&&(n.current+=1,r.current+=1)}var _e=l({id:c().min(1),name:c().min(1),description:c(),kind:u([`local`,`a2a`]),mcp_server:c().nullable().optional(),model_preference:c().nullable().optional(),timestamp:c().nullable().optional(),status:c().optional(),runnable_bound:f().optional(),tools:d(l({id:c().optional(),name:c().optional()})).optional(),endpoint:c().nullable().optional()}),ve=l({id:c().min(1),name:c().min(1),mcp_server:c().nullable().optional(),tags:d(c())}),ye=l({mcp_server:c().min(1),tool_count:m().int().nonnegative(),sample_tools:d(c()),reason:c()}),be=l({id:c().min(1),provider:c().min(1),intelligence_level:c().optional(),vision:f().optional(),reasoning:f().optional(),tools_enabled:f().optional(),can_route:f().optional(),can_kg:f().optional(),context_window:m().int().positive().nullable().optional()}),xe=l({id:c().min(1),provider:c().min(1),chunk_size:m().int().positive().optional(),context_window:m().int().positive().nullable().optional()}),Se=l({app_profile:c(),deployment_profile:c(),chat_models:d(be),embedding_models:d(xe)});function Ce(e){e.controller.current?.abort();let t=new AbortController,n=e.sequence.current+1;return e.sequence.current=n,e.controller.current=t,{id:n,controller:t}}function T(e,t,n){return e.sequence.current===t&&e.controller.current===n&&!n.signal.aborted}function we(e){return e instanceof Error&&e.name===`AbortError`}function Te(e){for(let t of e)t.sequence.current+=1,t.controller.current?.abort(),t.controller.current=null}function Ee(e){window.history.pushState({},``,e),window.dispatchEvent(new Event(`history-state-changed`))}var E=120,D=32e3,O=2048;function k(e){let t=e.trim();if(!t)return`Enter the URL of the external agent`;if(I(t)>O)return`The URL must be 2,048 UTF-8 bytes or fewer`;try{let e=new URL(t);if(e.protocol!==`http:`&&e.protocol!==`https:`)return`Use an http:// or https:// URL`}catch{return`Enter a complete http:// or https:// URL`}return null}function A(e){if(!e.trim())return{value:void 0,error:null};try{let t=JSON.parse(e);return typeof t!=`object`||!t||Array.isArray(t)||Object.keys(t).length===0?{value:void 0,error:`Agent card JSON must be a non-empty JSON object`}:{value:t,error:null}}catch{return{value:void 0,error:`Enter valid JSON for the agent card`}}}function j(e){return e.trim()?k(e):null}function M(e,t,n){return n?`${e} ${t}`:e}function N(e,t){return t?(0,w.jsx)(`p`,{id:e,role:`alert`,className:`mt-1 text-[11px] text-red-400 font-medium`,children:t}):null}function P(e,t,n,r){return[e,!t.trim(),!!n,!!r].some(Boolean)}function De(e){return`${(e.replace(/[^A-Za-z0-9_.:-]/g,`-`).replace(/^[^A-Za-z0-9]+/,``)||`custom`).slice(0,114)}-agent`}function F(e){return Array.from(e).length}function I(e){return new TextEncoder().encode(e).byteLength}function L(){return null}async function Oe(e,t,n){let r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});return r.ok?{ok:!0}:{ok:!1,error:(await r.json().catch(L))?.detail??n}}function ke(e,t){let n=e.trim(),r=n?k(e):`An agent URL is required`,i=A(t);return{url:n,agentCard:i.value,error:r??i.error}}function Ae(e,t){return!e||!t?`Name and instructions are required`:F(e)>E?`Agent name must be ${E} characters or fewer`:I(t)>D?`Instructions must be ${D.toLocaleString()} bytes or fewer`:null}var je={app_profile:``,deployment_profile:``,chat_models:[],embedding_models:[]};function R(){return(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5`,children:[(0,w.jsx)(o,{className:`size-3.5 text-emerald-400`}),` Suggested, from what is installed`]}),(0,w.jsx)(x,{what:`Agent suggestions`})]})}function z(e,t){return(0,w.jsxs)(`div`,{className:`p-3.5 rounded-lg border border-emerald-500/20 bg-emerald-500/5 flex flex-col gap-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,w.jsx)(`span`,{className:`font-bold text-sm text-foreground`,children:e.mcp_server}),(0,w.jsxs)(s,{variant:`secondary`,className:`text-[10px]`,children:[e.tool_count,` tool`,e.tool_count===1?``:`s`]})]}),(0,w.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.reason}),(0,w.jsxs)(y,{size:`sm`,variant:`outline`,className:`self-start h-7 text-xs`,onClick:t.bind(null,e),children:[(0,w.jsx)(i,{className:`size-3.5 mr-1`}),` Build this agent`]})]},e.mcp_server)}function Me(e,t){return e.length===0?null:(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsxs)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5`,children:[(0,w.jsx)(o,{className:`size-3.5 text-emerald-400`}),` Suggested, from what is installed`]}),(0,w.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:e.slice(0,6).map(e=>z(e,t))})]})}function B({loadingSuggestions:e,suggestionsUnavailable:t,suggestions:n,onStartFromSuggestion:r}){return e?null:t?R():Me(n,r)}async function V({refs:e,path:t,schema:n,fallback:r,setData:i,setLoading:a,setUnavailable:o,onFailure:s}){let c=Ce(e);try{a(!0);let r=await p(t,n,{signal:c.controller.signal});if(!T(e,c.id,c.controller))return;i(r),o(!1)}catch(t){if(!T(e,c.id,c.controller)||we(t))return;i(r),o(!0),s?.()}finally{T(e,c.id,c.controller)&&a(!1)}}function Ne(){_.error(`Failed to connect to the Agent Library`)}function H({agent:e,onArchive:t}){return(0,w.jsxs)(`div`,{className:`p-4 rounded-xl border border-border/40 bg-muted/10 backdrop-blur-sm hover:border-emerald-500/30 transition-all flex flex-col justify-between`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[e.kind===`a2a`?(0,w.jsx)(ce,{className:`size-4 text-teal-400 shrink-0`}):(0,w.jsx)(se,{className:`size-4 text-emerald-400 shrink-0`}),(0,w.jsx)(`h4`,{className:`font-bold text-sm text-foreground truncate`,children:e.name})]}),(0,w.jsx)(s,{variant:`outline`,className:`text-[10px] font-semibold shrink-0 ${e.kind===`a2a`?`bg-teal-500/10 border-teal-500/30 text-teal-400`:`bg-emerald-500/10 border-emerald-500/30 text-emerald-400`}`,children:e.kind===`a2a`?`External · A2A`:`Local`})]}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground leading-normal line-clamp-3`,children:e.description||`No description.`}),e.mcp_server&&(0,w.jsxs)(`div`,{className:`text-[10px] text-muted-foreground mt-2`,children:[(0,w.jsx)(ae,{className:`size-3 inline mr-1`}),`bound to `,(0,w.jsx)(`code`,{className:`font-mono`,children:e.mcp_server})]})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-center justify-between border-t border-border/30 pt-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-emerald-400 font-bold`,children:[(0,w.jsx)(le,{className:`size-3`}),e.runnable_bound===!1?`Prompt only`:`Delegatable`]}),(0,w.jsx)(`button`,{type:`button`,onClick:()=>{t(e)},className:`p-1.5 rounded text-muted-foreground hover:text-red-400 hover:bg-red-500/10 transition-all`,"aria-label":`Archive ${e.name}`,children:(0,w.jsx)(oe,{className:`size-3.5`})})]})]},e.id)}function U({loadingAgents:e,agentsUnavailable:t,filteredAgents:n,onArchive:r,onCancelLoading:i}){return e?(0,w.jsx)(`div`,{className:`flex justify-center py-12`,children:(0,w.jsx)(S,{status:`loading`,label:`Querying the graph...`,onCancel:i})}):t?(0,w.jsx)(`div`,{className:`text-center py-12`,children:(0,w.jsx)(x,{what:`The Agent Library`,className:`justify-center`})}):n.length===0?(0,w.jsx)(`div`,{className:`flex justify-center py-12`,children:(0,w.jsx)(S,{status:`empty`,label:`No agents yet. Compose one, or register an external A2A agent.`})}):(0,w.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:n.map(e=>H({agent:e,onArchive:r}))})}function Pe(e){let{loadingSuggestions:t,suggestionsUnavailable:n,suggestions:r,onStartFromSuggestion:o,search:s,onSearchChange:c,onRefresh:l,loadingAgents:u,onNewAgent:d,agentsUnavailable:f,filteredAgents:p,onArchive:m,onCancelLoadingAgents:h}=e;return(0,w.jsxs)(`div`,{className:`space-y-6`,children:[B({loadingSuggestions:t,suggestionsUnavailable:n,suggestions:r,onStartFromSuggestion:o}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1`,children:[(0,w.jsx)(te,{className:`absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground`}),(0,w.jsx)(g,{"aria-label":`Search agents`,placeholder:`Search your agents...`,value:s,onChange:e=>{c(e.target.value)},className:`pl-9 h-9 bg-muted/20`})]}),(0,w.jsx)(y,{variant:`outline`,size:`icon`,className:`h-9 w-9 shrink-0`,onClick:l,disabled:u,"aria-label":`Refresh agents`,children:(0,w.jsx)(a,{className:`size-4 ${u?`animate-spin`:``}`})}),(0,w.jsxs)(y,{size:`sm`,onClick:d,children:[(0,w.jsx)(i,{className:`size-4 mr-1.5`}),` New agent`]})]}),(0,w.jsx)(me,{className:`h-[calc(100vh-32rem)] min-h-[16rem] pr-2`,children:U({loadingAgents:u,agentsUnavailable:f,filteredAgents:p,onArchive:m,onCancelLoading:h})})]})}function W(e,t,n){return(0,w.jsxs)(`label`,{htmlFor:`compose-tool-${e.id}`,className:`flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted/20 cursor-pointer`,children:[(0,w.jsx)(h,{id:`compose-tool-${e.id}`,"aria-label":`Use ${e.name}${e.mcp_server?` from ${e.mcp_server}`:``}`,checked:t.has(e.id),onCheckedChange:n.bind(null,e.id)}),(0,w.jsx)(`span`,{className:`text-xs font-mono`,children:e.name}),e.mcp_server&&(0,w.jsx)(`span`,{className:`text-[10px] text-muted-foreground ml-auto`,children:e.mcp_server})]},e.id)}function G({loadingTools:e,toolsUnavailable:t,tools:n,selectedToolIds:r,onToggleTool:i}){return e?(0,w.jsx)(`div`,{className:`p-2`,children:(0,w.jsx)(S,{status:`loading`,label:`Loading tools...`,className:`text-xs`})}):t?(0,w.jsx)(`div`,{className:`p-2`,children:(0,w.jsx)(x,{what:`The tool catalog`})}):n.length===0?(0,w.jsx)(`div`,{className:`p-2`,children:(0,w.jsx)(S,{status:`empty`,label:`No tools ingested yet for this filter — the agent can still run prompt-only.`,className:`text-xs`})}):(0,w.jsx)(w.Fragment,{children:n.map(e=>W(e,r,i))})}function Fe(e){let{composeName:t,onComposeNameChange:n,composeDescription:r,onComposeDescriptionChange:i,composeInstructions:a,onComposeInstructionsChange:o,composeServer:s,onComposeServerChange:c,serverNames:l,composeModel:u,onComposeModelChange:d,chatModels:f,composing:p,onCompose:m}=e;return(0,w.jsxs)(`div`,{className:`max-w-2xl space-y-5`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-name`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Name`}),(0,w.jsx)(g,{id:`compose-agent-name`,required:!0,"aria-describedby":`compose-agent-name-help`,value:t,onChange:e=>{n(e.target.value)},placeholder:`e.g. release-notes-writer`,className:`mt-1 bg-muted/20`}),(0,w.jsx)(`p`,{id:`compose-agent-name-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Required. Up to 120 characters; leading and trailing whitespace is removed before saving.`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-description`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Description`}),(0,w.jsx)(g,{id:`compose-agent-description`,"aria-describedby":`compose-agent-description-help`,value:r,onChange:e=>{i(e.target.value)},placeholder:`One line: what does this agent do for you?`,className:`mt-1 bg-muted/20`}),(0,w.jsx)(`p`,{id:`compose-agent-description-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Optional one-line summary so you can recognize this agent later.`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-instructions`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Instructions (its system prompt)`}),(0,w.jsx)(v,{id:`compose-agent-instructions`,required:!0,maxLength:D,"aria-describedby":`compose-agent-instructions-help`,value:a,onChange:e=>{o(e.target.value)},placeholder:`You are a specialist that...`,className:`mt-1 bg-muted/20 font-mono text-xs leading-relaxed`,rows:8}),(0,w.jsx)(`p`,{id:`compose-agent-instructions-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Required. Describe the agent's role and how it should complete work (up to 32,000 UTF-8 bytes).`})]}),(0,w.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-server`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Bind an entire MCP server's tools (optional)`}),(0,w.jsxs)(`select`,{id:`compose-agent-server`,"aria-describedby":`compose-agent-server-help`,value:s,onChange:e=>{c(e.target.value)},className:`w-full h-9 mt-1 px-3 rounded-md border border-input bg-muted/20 text-xs`,children:[(0,w.jsx)(`option`,{value:``,children:`— none —`}),l.map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))]}),(0,w.jsx)(`p`,{id:`compose-agent-server-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Optional. Select a server to make all of its tools available to this agent.`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`compose-agent-model`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Preferred model (optional, advisory)`}),(0,w.jsxs)(`select`,{id:`compose-agent-model`,"aria-describedby":`compose-agent-model-help`,value:u,onChange:e=>{d(e.target.value)},className:`w-full h-9 mt-1 px-3 rounded-md border border-input bg-muted/20 text-xs`,children:[(0,w.jsx)(`option`,{value:``,children:`— default —`}),f.map(e=>(0,w.jsxs)(`option`,{value:e.id,children:[e.id,` (`,e.provider,`)`]},e.id))]}),(0,w.jsx)(`p`,{id:`compose-agent-model-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Optional hint for delegation; the default model is used when this is left unchanged.`})]})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{id:`compose-agent-tools-label`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Or pick individual tools`}),(0,w.jsx)(`p`,{id:`compose-agent-tools-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Choose specific tools when you do not want to grant access to an entire server.`}),(0,w.jsx)(`div`,{role:`group`,"aria-labelledby":`compose-agent-tools-label`,"aria-describedby":`compose-agent-tools-help`,className:`mt-2 max-h-56 overflow-y-auto rounded-lg border border-border/20 bg-muted/5 p-2 space-y-1`,children:G(e)})]}),(0,w.jsx)(y,{onClick:m,disabled:p||!t.trim()||!a.trim(),className:`bg-emerald-600 hover:bg-emerald-700`,children:p?`Saving...`:`Save agent to the Library`})]})}function Ie({a2aUrl:e,onA2aUrlChange:t,a2aCardJson:n,onA2aCardJsonChange:r,registering:i,onRegister:a}){let o=j(e),s=A(n).error;return(0,w.jsxs)(`div`,{className:`max-w-2xl space-y-5`,children:[(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Register an outside agent that speaks the A2A protocol. Give its URL and, if it doesn't publish a discoverable agent card, paste the card JSON yourself. The URL is used to discover the agent; it is not a secret.`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`external-agent-url`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Agent URL`}),(0,w.jsx)(g,{id:`external-agent-url`,type:`url`,required:!0,maxLength:O,"aria-describedby":M(`external-agent-url-help`,`external-agent-url-error`,o),"aria-invalid":!!o,value:e,onChange:e=>{t(e.target.value)},placeholder:`https://agent.example.com`,className:`mt-1 bg-muted/20 font-mono text-xs`}),(0,w.jsx)(`p`,{id:`external-agent-url-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Required. Use a complete http:// or https:// URL (up to 2,048 UTF-8 bytes).`}),N(`external-agent-url-error`,o)]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`label`,{htmlFor:`external-agent-card-json`,className:`text-[10px] font-bold uppercase tracking-wider text-muted-foreground`,children:`Agent card JSON (optional — auto-fetched from the URL if left blank)`}),(0,w.jsx)(v,{id:`external-agent-card-json`,"aria-describedby":M(`external-agent-card-help`,`external-agent-card-error`,s),"aria-invalid":!!s,value:n,onChange:e=>{r(e.target.value)},placeholder:`{"name": "...", "description": "...", "capabilities": []}`,className:`mt-1 bg-muted/20 font-mono text-xs`,rows:8}),(0,w.jsx)(`p`,{id:`external-agent-card-help`,className:`mt-1 text-[11px] text-muted-foreground`,children:`Optional. Leave blank to let the server fetch the card. If you paste one, it must be a non-empty JSON object.`}),N(`external-agent-card-error`,s)]}),(0,w.jsx)(y,{type:`button`,onClick:a,disabled:P(i,e,o,s),className:`bg-teal-600 hover:bg-teal-700`,children:i?`Registering...`:`Register external agent`})]})}function Le(e){return(0,w.jsxs)(`div`,{className:`p-3 rounded-lg border border-border/30 bg-muted/5 space-y-1.5`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`span`,{className:`font-mono font-bold text-xs`,children:e.id}),(0,w.jsx)(s,{variant:`outline`,className:`text-[9px]`,children:e.provider})]}),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.intelligence_level&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:e.intelligence_level}),e.can_route&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`router`}),e.can_kg&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`kg`}),e.vision&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`vision`}),e.reasoning&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`reasoning`}),e.tools_enabled&&(0,w.jsx)(s,{variant:`secondary`,className:`text-[9px]`,children:`tools`})]}),e.context_window?(0,w.jsxs)(`div`,{className:`text-[10px] text-muted-foreground`,children:[e.context_window.toLocaleString(),` token context`]}):null]},e.id)}function K({configUnavailable:e,chatModels:t}){return(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground mb-2`,children:`Chat models`}),e?null:t.length===0?(0,w.jsx)(S,{status:`empty`,label:`No chat models configured.`,className:`text-xs`}):(0,w.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:t.map(Le)})]})}function q(e){return(0,w.jsxs)(`div`,{className:`p-3 rounded-lg border border-border/30 bg-muted/5 space-y-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsx)(`span`,{className:`font-mono font-bold text-xs`,children:e.id}),(0,w.jsx)(s,{variant:`outline`,className:`text-[9px]`,children:e.provider})]}),(0,w.jsxs)(`div`,{className:`text-[10px] text-muted-foreground`,children:[`chunk `,e.chunk_size??`—`,e.context_window?` · ${e.context_window.toLocaleString()} token context`:``]})]},e.id)}function J({configUnavailable:e,embeddingModels:t}){return(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground mb-2`,children:`Embedding models`}),e?null:t.length===0?(0,w.jsx)(S,{status:`empty`,label:`No embedding models configured.`,className:`text-xs`}):(0,w.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:t.map(q)})]})}function Re({loadingConfig:e,config:t,configUnavailable:n}){return e?(0,w.jsx)(`div`,{className:`space-y-6`,children:(0,w.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,w.jsx)(S,{status:`loading`,label:`Loading model configuration...`})})}):(0,w.jsxs)(`div`,{className:`space-y-6`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-4 text-xs`,children:[(0,w.jsxs)(`div`,{className:`rounded-md border border-border/30 bg-muted/10 px-3 py-2`,children:[(0,w.jsx)(`div`,{className:`text-muted-foreground`,children:`App profile`}),(0,w.jsx)(`div`,{className:`font-bold`,children:t.app_profile||`—`})]}),(0,w.jsxs)(`div`,{className:`rounded-md border border-border/30 bg-muted/10 px-3 py-2`,children:[(0,w.jsx)(`div`,{className:`text-muted-foreground`,children:`Deployment profile`}),(0,w.jsx)(`div`,{className:`font-bold`,children:t.deployment_profile||`—`})]})]}),n&&(0,w.jsx)(x,{what:`The model configuration summary`}),K({configUnavailable:n,chatModels:t.chat_models}),J({configUnavailable:n,embeddingModels:t.embedding_models}),(0,w.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Read-only view of the active `,(0,w.jsx)(`code`,{children:`AgentConfig`}),` model registry. Secrets and provider credentials are never sent to the browser.`]})]})}function Y(){let[e,t]=(0,C.useState)(`library`),[n,a]=(0,C.useState)([]),[s,c]=(0,C.useState)(!0),[l,u]=(0,C.useState)(``),[f,p]=(0,C.useState)([]),[m,h]=(0,C.useState)(!0),[te,g]=(0,C.useState)(!1),[v,ae]=(0,C.useState)([]),[oe,le]=(0,C.useState)(!1),[x,S]=(0,C.useState)(je),[me,be]=(0,C.useState)(!0),[xe,Ce]=(0,C.useState)(!1),[T,we]=(0,C.useState)(!1),[E,D]=(0,C.useState)(!1),[O,k]=(0,C.useState)(``),[A,j]=(0,C.useState)(``),[M,N]=(0,C.useState)(``),[P,F]=(0,C.useState)(``),[I,L]=(0,C.useState)(``),[R,z]=(0,C.useState)(new Set),[Me,B]=(0,C.useState)(!1),[H,U]=(0,C.useState)(``),[W,G]=(0,C.useState)(``),[Le,K]=(0,C.useState)(!1),q=(0,C.useRef)({sequence:{current:0},controller:{current:null}}),J=(0,C.useRef)({sequence:{current:0},controller:{current:null}}),Y=(0,C.useRef)({sequence:{current:0},controller:{current:null}}),ze=(0,C.useRef)({sequence:{current:0},controller:{current:null}}),X=(0,C.useRef)(0),Z=(0,C.useRef)(0),Q=async()=>{await V({refs:q.current,path:`/api/enhanced/agent-library/agents`,schema:d(_e),fallback:[],setData:a,setLoading:c,setUnavailable:Ce,onFailure:Ne})},Be=()=>{Te([q.current]),c(!1)},Ve=async()=>{await V({refs:J.current,path:`/api/enhanced/agent-library/suggestions`,schema:d(ye),fallback:[],setData:p,setLoading:h,setUnavailable:g})},$=async e=>{let t=e?`?mcp_server=${encodeURIComponent(e)}`:``;await V({refs:Y.current,path:`/api/enhanced/agent-library/tools${t}`,schema:d(ve),fallback:[],setData:ae,setLoading:le,setUnavailable:we})},He=async()=>{await V({refs:ze.current,path:`/api/enhanced/agent-library/config-summary`,schema:Se,fallback:je,setData:S,setLoading:be,setUnavailable:D})};(0,C.useEffect)(()=>(Q(),Ve(),$(),He(),Te.bind(null,[q.current,J.current,Y.current,ze.current])),[]);let Ue=(0,C.useMemo)(()=>{let e=new Set;for(let t of v)t.mcp_server&&e.add(t.mcp_server);return Array.from(e).sort()},[v]),We=e=>{z(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Ge=e=>{X.current+=1,t(`compose`),F(e.mcp_server),k(t=>t||De(e.mcp_server)),j(t=>t||`Uses the ${e.mcp_server} tools: ${e.sample_tools.join(`, `)}.`),$(e.mcp_server),_.message(`Composing an agent for '${e.mcp_server}'`)},Ke=()=>{X.current+=1,t(`compose`)},qe=async()=>{let n=O.trim(),r=M.trim(),i=Ae(n,r);if(i){_.error(i);return}let a=X.current,o=e;B(!0);try{let i=await Oe(`/api/enhanced/agent-library/agents`,{name:n,description:A.trim(),instructions:r,bind_server:P||void 0,model_preference:I||void 0,tool_ids:Array.from(R)},`Failed to compose the agent`);if(!i.ok){_.error(i.error);return}_.success(`Agent '${n}' saved and ready to delegate to`),X.current===a&&e===o&&(k(``),j(``),N(``),F(``),L(``),z(new Set),t(`library`)),Q(),Ve()}catch{_.error(`Network error composing the agent`)}finally{B(!1)}},Je=async e=>{try{if(!(await fetch(`/api/enhanced/agent-library/agents/${encodeURIComponent(e.id)}`,{method:`DELETE`})).ok){_.error(`Failed to archive that agent`);return}_.success(`Archived '${e.name}'`),Q()}catch{_.error(`Network error archiving the agent`)}},Ye=async()=>{let t=ke(H,W);if(t.error){_.error(t.error);return}let n=Z.current,r=e;K(!0);try{let i=await Oe(`/api/enhanced/agent-library/a2a`,{url:t.url,agent_card:t.agentCard},`Failed to register that agent`);if(!i.ok){_.error(i.error);return}_.success(`External agent registered`),Z.current===n&&e===r&&(U(``),G(``)),Q()}catch{_.error(`Network error registering the external agent`)}finally{K(!1)}},Xe=n.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())||e.description.toLowerCase().includes(l.toLowerCase())),Ze=[{id:`library`,label:`Library`,icon:se},{id:`compose`,label:`Compose an Agent`,icon:i},{id:`external`,label:`External Agents`,icon:ce},{id:`config`,label:`Model & Config`,icon:o}];return(0,w.jsx)(`div`,{className:`space-y-6`,children:(0,w.jsx)(ue,{className:`border-border/40 bg-card/60 backdrop-blur-md`,children:(0,w.jsxs)(pe,{value:e,onValueChange:n=>{let r=he(n)?n:e;ge(r,e,X,Z),t(r)},className:`w-full`,children:[(0,w.jsxs)(ne,{children:[(0,w.jsxs)(`div`,{className:`flex flex-col md:flex-row justify-between items-start md:items-center gap-4`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(ie,{className:`text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-teal-400 via-emerald-400 to-green-500`,children:`Agent Library`}),(0,w.jsx)(ee,{children:`Compose agents from prompts and tools you already have, register outside A2A agents, and call on any of them whenever you need. Saved agents live in the knowledge graph, not in this browser.`})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(y,{variant:`outline`,size:`sm`,onClick:()=>{Ee(`/prompts`)},children:[`Prompts Registry `,(0,w.jsx)(r,{className:`size-3.5 ml-1.5`})]}),(0,w.jsxs)(y,{variant:`outline`,size:`sm`,onClick:()=>{Ee(`/skills`)},children:[`Tools & Skills `,(0,w.jsx)(r,{className:`size-3.5 ml-1.5`})]})]})]}),(0,w.jsx)(fe,{"aria-label":`Agent library sections`,className:`flex flex-wrap justify-start h-auto gap-2 mt-4 rounded-none border-b border-border/40 bg-transparent p-0 pb-2`,children:Ze.map(e=>(0,w.jsxs)(de,{value:e.id,className:`flex items-center gap-2 rounded-md border border-transparent px-3 py-1.5 text-xs font-semibold data-[state=active]:border-emerald-500/30 data-[state=active]:bg-emerald-500/10 data-[state=active]:font-bold data-[state=active]:text-emerald-400`,children:[(0,w.jsx)(e.icon,{className:`size-3.5`}),(0,w.jsx)(`span`,{children:e.label})]},e.id))})]}),(0,w.jsxs)(re,{children:[(0,w.jsx)(b,{value:`library`,children:Pe({loadingSuggestions:m,suggestionsUnavailable:te,suggestions:f,onStartFromSuggestion:Ge,search:l,onSearchChange:u,onRefresh:()=>{Q(),Ve()},loadingAgents:s,onNewAgent:Ke,agentsUnavailable:xe,filteredAgents:Xe,onArchive:e=>{Je(e)},onCancelLoadingAgents:Be})}),(0,w.jsx)(b,{value:`compose`,children:Fe({composeName:O,onComposeNameChange:e=>{X.current+=1,k(e)},composeDescription:A,onComposeDescriptionChange:e=>{X.current+=1,j(e)},composeInstructions:M,onComposeInstructionsChange:e=>{X.current+=1,N(e)},composeServer:P,onComposeServerChange:e=>{X.current+=1,F(e),$(e||void 0)},serverNames:Ue,composeModel:I,onComposeModelChange:e=>{X.current+=1,L(e)},chatModels:x.chat_models,loadingTools:oe,toolsUnavailable:T,tools:v,selectedToolIds:R,onToggleTool:e=>{X.current+=1,We(e)},composing:Me,onCompose:()=>{qe()}})}),(0,w.jsx)(b,{value:`external`,children:Ie({a2aUrl:H,onA2aUrlChange:e=>{Z.current+=1,U(e)},a2aCardJson:W,onA2aCardJsonChange:e=>{Z.current+=1,G(e)},registering:Le,onRegister:()=>{Ye()}})}),(0,w.jsx)(b,{value:`config`,children:Re({loadingConfig:me,config:x,configUnavailable:E})})]})]})})})}export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./bundle-mjs-DIyOrgL5.js";import{t as r}from"./createLucideIcon-DTQSidPf.js";import{t as i}from"./refresh-cw-BVhl5aJX.js";import{t as a}from"./badge-nQZ87mVE.js";import{E as o,O as s,S as c,a as l,c as u,w as d,x as f}from"./api-validation-CCoR_LRu.js";import{E as p,O as m,T as h,ar as g,dn as _,k as v,mt as y,or as b,rn as x,rr as S,w as C,zn as w}from"./index-
|
|
1
|
+
import{i as e,r as t,s as n}from"./bundle-mjs-DIyOrgL5.js";import{t as r}from"./createLucideIcon-DTQSidPf.js";import{t as i}from"./refresh-cw-BVhl5aJX.js";import{t as a}from"./badge-nQZ87mVE.js";import{E as o,O as s,S as c,a as l,c as u,w as d,x as f}from"./api-validation-CCoR_LRu.js";import{E as p,O as m,T as h,ar as g,dn as _,k as v,mt as y,or as b,rn as x,rr as S,w as C,zn as w}from"./index-GCzCgfSc.js";import{t as T}from"./status-message-4rJx-ibz.js";var E={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};E.node;var D=r(E),O=n(e()),k=u([`ready`,`degraded`,`unavailable`,`stale`,`not_configured`]),A=c({state:k,reason:o().nullable().optional(),detail:d(o(),s()).nullable().optional(),latency_ms:f().nullable().optional()}).loose(),j=c({schema_version:o(),snapshot_id:o(),observed_at:o(),principal:c({subject:o().nullable(),tenant:o().nullable(),policy_epoch:f().nullable()}),overall:k,checks:c({engine:A,identity_policy:A,catalog:A,source_sync:A,synthetic_query:A,dense_index:A,sparse_index:A}),required_failures:l(o()),degraded_reasons:l(o()),refresh:c({mode:o(),cursor:o().nullable(),next_due_at:o().nullable()})});function M(e={}){return y(`/analyze`,{action:`readiness`,query:e.query??``,node_id:e.nodeId??``},j)}function N(e){return e.overall===`ready`}var P=[`engine`,`identity_policy`,`catalog`,`source_sync`,`synthetic_query`,`dense_index`,`sparse_index`],F={engine:`Engine`,identity_policy:`Identity / Policy`,catalog:`Catalog`,source_sync:`Source Sync`,synthetic_query:`Synthetic Query`,dense_index:`Dense Index`,sparse_index:`Sparse Index`},I=t(),L={ready:`bg-emerald-500/15 text-emerald-600 dark:text-emerald-400`,degraded:`bg-amber-500/15 text-amber-600 dark:text-amber-400`,unavailable:`bg-destructive/15 text-destructive`,stale:`bg-amber-500/15 text-amber-600 dark:text-amber-400`,not_configured:`bg-muted text-muted-foreground`},R={ready:`Ready`,degraded:`Degraded`,unavailable:`Unavailable`,stale:`Stale`,not_configured:`Not configured`};function z({state:e}){switch(e){case`ready`:return(0,I.jsx)(b,{className:`size-4`});case`degraded`:case`stale`:return(0,I.jsx)(_,{className:`size-4`});case`unavailable`:return(0,I.jsx)(g,{className:`size-4`});default:return(0,I.jsx)(D,{className:`size-4`})}}function B({state:e}){return(0,I.jsxs)(a,{variant:`outline`,className:L[e],children:[(0,I.jsx)(z,{state:e}),R[e]]})}function V(e){return typeof e.evidence_count==`number`?`evidence: ${String(e.evidence_count)}`:null}function H(e){return typeof e.coverage_pct==`number`?`coverage: ${e.coverage_pct.toFixed(1)}%`:null}function U(e){return typeof e.covered==`number`&&typeof e.expected==`number`?`${String(e.covered)}/${String(e.expected)} connectors`:null}function W(e){return typeof e.count==`number`?`${String(e.count)} routes resolved`:null}function G(e){return!Array.isArray(e.missing)||e.missing.length===0?null:`missing: ${e.missing.slice(0,4).join(`, `)}${e.missing.length>4?`…`:``}`}function K(e){return typeof e.latency_ms==`number`?`${e.latency_ms.toFixed(1)}ms`:null}var q=[V,H,U,W,G,K];function J(e){let t=q.map(t=>t(e)).filter(e=>e!==null);return t.length>0?t.join(` · `):null}function Y({name:e,check:t}){let n=F[e],r=J(t);return(0,I.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,I.jsx)(`td`,{className:`py-2 pr-4 font-medium text-sm`,children:n}),(0,I.jsx)(`td`,{className:`py-2 pr-4`,children:(0,I.jsx)(B,{state:t.state})}),(0,I.jsx)(`td`,{className:`py-2 pr-4 text-sm text-muted-foreground`,children:t.reason??`—`}),(0,I.jsx)(`td`,{className:`py-2 text-sm text-muted-foreground`,children:r??`—`})]})}function X({loading:e}){return e?(0,I.jsx)(w,{className:`size-4 animate-spin`}):(0,I.jsx)(i,{className:`size-4`})}function Z(){return(0,I.jsx)(C,{children:(0,I.jsxs)(h,{className:`flex items-center gap-2 p-4 text-sm text-muted-foreground`,children:[(0,I.jsx)(D,{className:`size-4 shrink-0`}),`The readiness capability is not activated on this backend yet (route not served). This is not a claim about graph readiness — it is an unreached endpoint.`]})})}function Q({error:e}){return(0,I.jsx)(C,{children:(0,I.jsx)(h,{className:`p-4`,children:(0,I.jsx)(T,{status:`error`,label:e})})})}function $({snapshot:e}){let t=e.required_failures.length===0&&e.degraded_reasons.length===0;return(0,I.jsxs)(I.Fragment,{children:[e.required_failures.length>0&&(0,I.jsxs)(`div`,{className:`flex items-start gap-2 text-destructive`,children:[(0,I.jsx)(g,{className:`size-4 mt-0.5 shrink-0`}),(0,I.jsxs)(`span`,{children:[`Required check(s) failing: `,e.required_failures.join(`, `)]})]}),e.degraded_reasons.length>0&&(0,I.jsxs)(`div`,{className:`flex items-start gap-2 text-amber-600 dark:text-amber-400`,children:[(0,I.jsx)(_,{className:`size-4 mt-0.5 shrink-0`}),(0,I.jsx)(`ul`,{className:`list-disc pl-4`,children:e.degraded_reasons.map(e=>(0,I.jsx)(`li`,{children:e},e))})]}),t&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-emerald-600 dark:text-emerald-400`,children:[(0,I.jsx)(b,{className:`size-4`}),`Every check reported ready.`]})]})}function ee({snapshot:e}){return(0,I.jsxs)(C,{children:[(0,I.jsxs)(m,{className:`flex flex-row items-center justify-between`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(v,{children:`Overall`}),(0,I.jsxs)(p,{children:[`Observed `,e.observed_at,` · `,(0,I.jsx)(`code`,{className:`text-xs`,children:e.snapshot_id})]})]}),(0,I.jsx)(B,{state:e.overall})]}),(0,I.jsxs)(h,{className:`flex flex-col gap-2 text-sm`,children:[(0,I.jsx)($,{snapshot:e}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,I.jsx)(S,{className:`size-3.5`}),`Refresh mode: `,e.refresh.mode]})]})]})}function te({snapshot:e}){return(0,I.jsxs)(C,{children:[(0,I.jsxs)(m,{children:[(0,I.jsx)(v,{children:`Checks`}),(0,I.jsx)(p,{children:`Every check the backend runs on this probe — none are skipped or cached.`})]}),(0,I.jsx)(h,{children:(0,I.jsx)(`div`,{className:`overflow-x-auto`,children:(0,I.jsxs)(`table`,{className:`w-full text-left`,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{className:`border-b text-xs uppercase text-muted-foreground`,children:[(0,I.jsx)(`th`,{className:`pb-2 pr-4 font-medium`,children:`Check`}),(0,I.jsx)(`th`,{className:`pb-2 pr-4 font-medium`,children:`State`}),(0,I.jsx)(`th`,{className:`pb-2 pr-4 font-medium`,children:`Reason`}),(0,I.jsx)(`th`,{className:`pb-2 font-medium`,children:`Detail`})]})}),(0,I.jsx)(`tbody`,{children:P.map(t=>(0,I.jsx)(Y,{name:t,check:e.checks[t]},t))})]})})})]})}function ne({snapshot:e}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(ee,{snapshot:e}),(0,I.jsx)(te,{snapshot:e})]})}function re(){return(0,I.jsx)(C,{children:(0,I.jsx)(h,{className:`p-6`,children:(0,I.jsx)(T,{status:`loading`,label:`Running the live readiness probe…`})})})}function ie(e,t,n,r){return!e&&!t&&!n&&r}function ae(){let[e,t]=(0,O.useState)(null),[n,r]=(0,O.useState)(null),[i,a]=(0,O.useState)(!1),[o,s]=(0,O.useState)(!1),c=(0,O.useCallback)(()=>{s(!0),r(null),a(!1),M().then(e=>{e.unavailable?(a(!0),t(null)):!e.ok||!e.data?(r(e.error??`Readiness snapshot request failed`),t(null)):t(e.data)}).catch(e=>{r(e instanceof Error?e.message:String(e)),t(null)}).finally(()=>{s(!1)})},[]);(0,O.useEffect)(()=>{c()},[c]);let l=ie(e,n,i,o);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 md:p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Arbora Readiness`}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Live `,(0,I.jsx)(`code`,{children:`arbora.readiness.v1`}),` snapshot — engine, identity/policy, catalog, source sync, dense/sparse index, and a real synthetic query. Never derived from liveness alone.`]})]}),(0,I.jsxs)(x,{variant:`outline`,size:`sm`,onClick:c,disabled:o,children:[(0,I.jsx)(X,{loading:o}),`Refresh`]})]}),i&&(0,I.jsx)(Z,{}),n&&!i&&(0,I.jsx)(Q,{error:n}),e&&(0,I.jsx)(ne,{snapshot:e}),l&&(0,I.jsx)(re,{})]})}export{ae as default,N as isReadinessReady};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,r as n,s as r}from"./bundle-mjs-DIyOrgL5.js";import{t as i}from"./useQuery-BCV_z3lS.js";import{t as a}from"./createLucideIcon-DTQSidPf.js";import{t as o}from"./braces-BNz2iAeD.js";import{t as s}from"./chevron-down-DYWnPQti.js";import{t as c}from"./chevron-right-gs8WU8XT.js";import{t as l}from"./external-link-Dyd5OsGm.js";import{t as ee}from"./play-D3mjq--Q.js";import{t as te}from"./plus-s20KYBeu.js";import{t as ne}from"./tag-D1RiwxuF.js";import{t as re}from"./x-BdA_yxUR.js";import{t as u}from"./badge-nQZ87mVE.js";import{D as ie,E as d,O as f,S as p,d as m,f as h,w as ae,x as oe}from"./api-validation-CCoR_LRu.js";import{$ as se,$n as ce,E as le,En as ue,Ft as de,It as fe,K as pe,Mt as me,Nn as he,Nt as ge,O as _e,Pt as ve,Q as ye,R as be,T as xe,Vt as Se,W as Ce,Yt as g,Z as we,Zn as Te,_n as Ee,cr as De,fn as Oe,fr as ke,gr as Ae,hn as je,ir as Me,jt as Ne,k as Pe,q as Fe,rn as _,sn as Ie,w as Le,xn as Re,zn as ze}from"./index-BL_57l7k.js";import{n as Be}from"./ChartPanel-Cxpkw3a6.js";import{_ as Ve,a as He,c as Ue,d as We,f as Ge,g as v,h as Ke,i as qe,l as Je,m as Ye,n as Xe,o as Ze,p as y,s as Qe,u as $e}from"./uql-H85wtqTc.js";import{n as b,t as x}from"./transport-Din6U5N9.js";import{t as S}from"./scroll-area-srEWz9Q3.js";import{o as et,t as tt}from"./theme-colors-DKGWsgC0.js";import{t as nt}from"./GraphCanvas-CSptFCKQ.js";import{a as rt,n as it,t as at}from"./model-BOQvdzSX.js";var ot={name:`arrow-right-left`,size:24,node:[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]};ot.node;var st=a(ot),ct={name:`file-braces`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]],aliases:[`file-json`]};ct.node;var lt=a(ct),ut={name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]};ut.node;var dt=a(ut),C=r(e(),1),ft=[`exists`,`missing`],pt={eq:`is`,neq:`is not`,contains:`contains`,startsWith:`starts with`,gt:`>`,gte:`>=`,lt:`<`,lte:`<=`,in:`is one of`,exists:`is set`,missing:`is not set`},mt=[`eq`,`neq`,`contains`,`startsWith`,`in`,`exists`,`missing`],ht=[`eq`,`neq`,`gt`,`gte`,`lt`,`lte`,`in`,`exists`,`missing`],gt={string:mt,number:ht,date:ht,boolean:[`eq`,`neq`,`exists`,`missing`],unknown:mt};function _t(e,t){return gt[e].filter(e=>t.includes(e))}function vt(e){return ft.includes(e)}var yt=0;function bt(e,t=`eq`,n){return yt+=1,{id:`clause-${String(yt)}`,field:e,op:t,value:n}}function xt(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e==`string`&&e.trim()!==``){let t=Number(e);return Number.isFinite(t)?t:null}return null}function w(e,t){let n=xt(e),r=xt(t);return n!==null&&r!==null?Math.sign(n-r):v(e).localeCompare(v(t))}function St(e){return e!=null&&e!==``}function Ct(e){return Array.isArray(e)?e:e===void 0?[]:[e]}var wt={eq:(e,t)=>v(e)===v(t),neq:(e,t)=>v(e)!==v(t),contains:(e,t)=>v(e).toLowerCase().includes(v(t).toLowerCase()),startsWith:(e,t)=>v(e).toLowerCase().startsWith(v(t).toLowerCase()),gt:(e,t)=>w(e,t)>0,gte:(e,t)=>w(e,t)>=0,lt:(e,t)=>w(e,t)<0,lte:(e,t)=>w(e,t)<=0,in:(e,t)=>Ct(t).some(t=>v(e)===v(t)),exists:e=>St(e),missing:e=>!St(e)};function T(e,t){if(t in e)return e[t];let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`)return;n=n[e]}return n}function Tt(e,t){return wt[t.op](T(e,t.field),t.value)}function Et(e,t){let n=t.toLowerCase();return Object.values(e).some(e=>v(e).toLowerCase().includes(n))}function Dt(e,t){return t.search.trim()!==``&&!Et(e,t.search.trim())?!1:t.clauses.length===0?!0:t.combinator===`or`?t.clauses.some(t=>Tt(e,t)):t.clauses.every(t=>Tt(e,t))}function Ot(e,t){if(!t)return e;let n=t.direction===`desc`?-1:1;return[...e].sort((e,r)=>n*w(T(e,t.field),T(r,t.field)))}function kt(e,t){return Ot(e.filter(e=>Dt(e,t)),t.sort).slice(0,t.limit)}function At(e){let t=pt[e.op];if(vt(e.op))return`${e.field} ${t}`;let n=Array.isArray(e.value)?e.value.join(`, `):v(e.value);return`${e.field} ${t} "${n}"`}function jt(e){let t=[];e.search.trim()!==``&&t.push(`search "${e.search.trim()}"`);let n=e.clauses.map(At);return n.length>0&&t.push(n.join(e.combinator===`or`?` OR `:` AND `)),e.sort&&t.push(`order by ${e.sort.field} ${e.sort.direction}`),t.push(`limit ${String(e.limit)}`),t.join(` `)}function Mt(e){let t=new Map,n=e=>{e.kind===`field`&&!t.has(e.id)&&t.set(e.id,e);for(let t of e.children??[])n(t)};for(let t of e.roots)n(t);return[...t.values()]}function Nt(e,t){return e.find(e=>e.id===t)?.dataType??`unknown`}function Pt(e,t){return e.label.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)}function Ft(e,t){let n=t.trim().toLowerCase();return n===``?[...e]:e.flatMap(e=>It(e,n))}function It(e,t){let n=(e.children??[]).flatMap(e=>It(e,t));return Pt(e,t)?[{...e,children:e.children}]:n.length>0?[{...e,children:n}]:[]}function Lt(e){return e.reduce((e,t)=>e+1+Lt(t.children??[]),0)}var E=n();function Rt({clause:e,position:t,fields:n,capabilities:r,onChange:i,onRemove:a}){let o=_t(Nt(n,e.field),r.filters);return(0,E.jsxs)(`div`,{className:`flex w-full flex-wrap items-center gap-1.5 sm:w-auto`,role:`group`,"aria-label":`Filter ${t}`,"data-testid":`atlas-filter-clause`,children:[(0,E.jsxs)(me,{value:e.field,onValueChange:t=>{i({...e,field:t})},children:[(0,E.jsx)(de,{className:`h-8 min-w-0 flex-1 text-xs sm:w-40 sm:flex-none`,"aria-label":`Filter ${t} field`,children:(0,E.jsx)(fe,{})}),(0,E.jsx)(ge,{children:n.map(e=>(0,E.jsx)(ve,{value:e.id,children:e.label},e.id))})]}),(0,E.jsxs)(me,{value:e.op,onValueChange:t=>{i({...e,op:t})},children:[(0,E.jsx)(de,{className:`h-8 min-w-0 flex-1 text-xs sm:w-28 sm:flex-none`,"aria-label":`Filter ${t} operator`,children:(0,E.jsx)(fe,{})}),(0,E.jsx)(ge,{children:o.map(e=>(0,E.jsx)(ve,{value:e,children:pt[e]},e))})]}),!vt(e.op)&&(0,E.jsx)(g,{"aria-label":`Filter ${t} value`,value:String(e.value??``),onChange:t=>{i({...e,value:t.target.value})},className:`h-8 min-w-0 flex-1 text-xs sm:w-44 sm:flex-none`,placeholder:`value`}),(0,E.jsx)(_,{variant:`ghost`,size:`icon`,className:`size-8`,"aria-label":`Remove filter ${t}`,onClick:a,children:(0,E.jsx)(re,{className:`size-3.5`})})]})}function zt(e,t){return e.map(e=>e.id===t.id?t:e)}function Bt(e){return e===`and`?`Match all filters; switch to match any`:`Match any filters; switch to match all`}function Vt({filters:e,fields:t,capabilities:n,onChange:r}){let i=t.length>0&&n.filters.length>0;return(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,"data-testid":`atlas-filter-bar`,children:[n.freeTextSearch&&(0,E.jsx)(g,{"aria-label":`Search results`,value:e.search,onChange:t=>{r({...e,search:t.target.value})},placeholder:`Search…`,className:`h-8 w-48 text-xs`}),e.clauses.map((i,a)=>(0,E.jsx)(Rt,{clause:i,position:a+1,fields:t,capabilities:n,onChange:t=>{r({...e,clauses:zt(e.clauses,t)})},onRemove:()=>{r({...e,clauses:e.clauses.filter(e=>e.id!==i.id)})}},i.id)),(0,E.jsxs)(_,{variant:`outline`,size:`sm`,className:`h-8`,"aria-label":`Add filter`,disabled:!i,onClick:()=>{r({...e,clauses:[...e.clauses,bt(t[0].id,n.filters[0])]})},children:[(0,E.jsx)(te,{className:`mr-1 size-3.5`}),`Filter`]}),e.clauses.length>1&&(0,E.jsxs)(_,{variant:`ghost`,size:`sm`,className:`h-8 text-xs`,"aria-label":Bt(e.combinator),onClick:()=>{r({...e,combinator:e.combinator===`and`?`or`:`and`})},children:[`match `,e.combinator===`and`?`all`:`any`]})]})}function Ht({data:e}){let t=Object.entries(e);return t.length===0?(0,E.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No properties.`}):(0,E.jsx)(`dl`,{className:`space-y-1`,children:t.map(([e,t])=>(0,E.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_1fr] gap-2 text-xs`,children:[(0,E.jsx)(`dt`,{className:`text-muted-foreground truncate font-mono`,children:e}),(0,E.jsx)(`dd`,{className:`font-mono break-all`,children:v(t)})]},e))})}function Ut({selection:e,pivots:t,onPivot:n,testId:r=`atlas-inspector`}){return e?(0,E.jsx)(S,{className:`h-full`,"data-testid":r,children:(0,E.jsxs)(`div`,{className:`space-y-4 p-3`,children:[(0,E.jsxs)(`div`,{className:`space-y-1`,children:[(0,E.jsx)(`p`,{className:`text-sm font-semibold break-all`,children:e.label}),(0,E.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,E.jsx)(u,{variant:`outline`,children:e.kind}),e.type&&(0,E.jsx)(u,{variant:`secondary`,children:e.type})]}),(0,E.jsx)(`p`,{className:`text-muted-foreground font-mono text-xs break-all`,children:e.id})]}),(0,E.jsx)(Ht,{data:e.data}),t.length>0&&(0,E.jsxs)(`div`,{className:`space-y-2 border-t pt-3`,children:[(0,E.jsx)(`p`,{className:`text-muted-foreground text-xs font-semibold uppercase`,children:`Explore from here`}),t.map(e=>(0,E.jsxs)(_,{variant:`outline`,size:`sm`,className:`w-full justify-start text-xs`,title:e.description,onClick:()=>{n(e)},children:[(0,E.jsx)(st,{className:`mr-2 size-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,children:e.label})]},e.id))]})]})}):(0,E.jsxs)(`div`,{className:`text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-4 text-center text-sm`,children:[(0,E.jsx)(dt,{className:`size-5`}),(0,E.jsx)(`p`,{children:`Select a node, edge or row to inspect it.`})]})}function Wt({adapters:e,activeId:t,onSelect:n}){return(0,E.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`atlas-modality-picker`,children:e.map(e=>{let r=e.icon;return(0,E.jsxs)(_,{size:`sm`,variant:e.id===t?`secondary`:`ghost`,className:`h-8 text-xs`,title:e.description,"data-testid":`atlas-modality-${e.id}`,onClick:()=>{n(e.id)},children:[(0,E.jsx)(r,{className:`mr-1.5 size-3.5`}),e.label]},e.id)})})}function Gt({text:e,capabilities:t,running:n,onChange:r,onRun:i}){let a=t.rawQuery;return(0,E.jsxs)(`div`,{className:`space-y-2`,"data-testid":`atlas-query-console`,children:[(0,E.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,E.jsx)(Ne,{"aria-label":`Query`,value:e,readOnly:!a,rows:3,spellCheck:!1,onChange:e=>{r(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&i()},className:`flex-1 font-mono text-xs ${a?``:`bg-muted/40`}`}),(0,E.jsxs)(_,{onClick:i,disabled:n,"data-testid":`atlas-run`,children:[n?(0,E.jsx)(ze,{className:`mr-2 size-4 animate-spin`}):(0,E.jsx)(ee,{className:`mr-2 size-4`}),`Run`]})]}),(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[t.rawQueryLanguage&&(0,E.jsx)(u,{variant:`secondary`,children:t.rawQueryLanguage}),!a&&(0,E.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Read-only: this modality has no text query language here — edit the filters instead.`,t.notes?.rawQuery?` ${t.notes.rawQuery}`:``]})]})]})}var Kt=class{items=new Map;register(e){this.items.set(e.id,e)}registerAll(e){for(let t of e)this.register(t)}get(e){return e?this.items.get(e)??null:null}has(e){return this.items.has(e)}list(){return[...this.items.values()]}get size(){return this.items.size}clear(){this.items.clear()}},D=new Kt;function qt(e,t){return{result:t,rows:Jt(()=>e.toRows(t),Ye),graph:e.toGraph?Jt(()=>e.toGraph?.(t)??null,null):null}}function Jt(e,t){try{return e()}catch{return t}}function Yt(e,t=D){return t.list().filter(t=>Xt(t,e)).sort((t,n)=>Zt(n,e)-Zt(t,e))}function Xt(e,t){try{return e.accepts(t)}catch{return!1}}function Zt(e,t){let n=e.prefers?.includes(t.result.shape)??!1;return e.priority+(n?1e3:0)}function Qt(e,t,n=D){let r=Yt(e,n);return r.length===0?null:r.find(e=>e.id===t)??r[0]}function O(){}function $t(e){let t=e.properties.name;return{kind:`node`,id:e.id,label:typeof t==`string`&&t?t:e.id,type:e.labels[0],data:e.properties}}function en({projection:e,selection:t,onSelect:n}){let r=e.graph,{nodes:i,relationships:a}=(0,C.useMemo)(()=>r?Ue(r):{nodes:[],relationships:[]},[r]),o=(0,C.useMemo)(()=>i.find(e=>e.id===t?.id)??null,[i,t?.id]);return i.length>3e3?(0,E.jsxs)(`p`,{className:`text-muted-foreground p-4 text-sm`,"data-testid":`atlas-graph2d-oversize`,children:[i.length.toLocaleString(),` nodes is beyond what this canvas draws smoothly. Narrow the filters, or use the level-of-detail explorer at `,(0,E.jsx)(`code`,{children:`/graph-3d/lod`}),`.`]}):(0,E.jsx)(`div`,{className:`h-full w-full`,"data-testid":`atlas-graph2d`,children:(0,E.jsx)(nt,{nodes:i,relationships:a,onUpdateNode:O,onDeleteNode:O,onAddNode:O,selectedNodeExternally:o,onSelectNode:e=>{n(e?$t(e):null)}})})}var tn={id:`graph2d`,label:`2D graph`,icon:he,priority:90,prefers:[`graph`],accepts:e=>(e.graph?.nodes.length??0)>0,component:en},nn={bloom:!0,depthOfField:!1};function rn(e){let t=e?`#0a0d14`:`#f6f7fb`;if(typeof window>`u`)return t;let n=window.getComputedStyle(document.documentElement).getPropertyValue(`--background`);return tt(n,t)}function an(e,t){if(t<0||t>=e.nodes.length)return null;let n=e.nodes[t];return{kind:`node`,id:n.id,label:n.name||n.id,type:n.type,data:{...n}}}function on({projection:e,selection:t,onSelect:n}){let r=et(),[i,a]=(0,C.useState)(()=>rn(r));(0,C.useEffect)(()=>{a(rn(r))},[r]);let o=e.graph,s=(0,C.useMemo)(()=>at(Qe(o??{nodes:[],edges:[],truncated:!1})),[o]),c=(0,C.useMemo)(()=>t?s.indexById.get(t.id)??null:null,[s,t]);return s.nodes.length>6e4?(0,E.jsxs)(`p`,{className:`text-muted-foreground p-4 text-sm`,"data-testid":`atlas-graph3d-oversize`,children:[s.nodes.length.toLocaleString(),` nodes exceeds what this scene uploads to the GPU. Use the level-of-detail explorer at `,(0,E.jsx)(`code`,{children:`/graph-3d/lod`}),`, which streams clusters instead.`]}):(0,E.jsx)(`div`,{className:`h-full w-full`,"data-testid":`atlas-graph3d`,children:(0,E.jsx)(rt,{model:s,isDark:r,background:i,selected:c,onSelect:e=>{n(e===null?null:an(s,e))},onExpand:()=>{},visibleMask:null,autoRotate:!1,frameToken:s.nodes.length,effects:nn,contextHops:1,relationshipFilter:null})})}var sn={id:`graph3d`,label:`3D graph`,icon:ke,priority:85,prefers:[`graph`],accepts:e=>(e.graph?.nodes.length??0)>0,component:on},cn=500;function ln(e){return Object.keys(e).slice(0,4).map(t=>`${t}: ${v(e[t])}`).join(` · `)}function un({row:e,index:t}){let[n,r]=(0,C.useState)(!1);return(0,E.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>{r(e=>!e)},"aria-expanded":n,className:`hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-1.5 text-left`,children:[(0,E.jsx)(n?s:c,{className:`text-muted-foreground size-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`text-muted-foreground w-10 shrink-0 font-mono text-xs`,children:t+1}),(0,E.jsx)(`span`,{className:`truncate font-mono text-xs`,children:ln(e)})]}),n&&(0,E.jsx)(`pre`,{className:`bg-muted/30 overflow-x-auto px-3 py-2 text-xs`,children:JSON.stringify(e,null,2)})]})}function dn({projection:e}){let t=e.rows.rows.slice(0,cn);return t.length===0?(0,E.jsx)(`p`,{className:`text-muted-foreground p-4 text-sm`,children:`No records to expand.`}):(0,E.jsx)(S,{className:`h-full w-full`,children:(0,E.jsx)(`div`,{"data-testid":`atlas-json`,children:t.map((e,t)=>(0,E.jsx)(un,{row:e,index:t},t))})})}var fn={id:`json`,label:`JSON`,icon:o,priority:60,prefers:[`tree`],accepts:e=>e.rows.rows.length>0,component:dn},pn=2e5;function mn(e){let t=Ve(e);return t.length<=pn?t:`${t.slice(0,pn)}\n\n… elided: payload is ${t.length.toLocaleString()} characters.`}function hn({projection:e}){return(0,E.jsx)(S,{className:`h-full w-full`,children:(0,E.jsx)(`pre`,{className:`p-3 font-mono text-xs`,"data-testid":`atlas-raw`,children:mn(e.result.payload)})})}var gn={id:`raw`,label:`Raw`,icon:lt,priority:10,accepts:()=>!0,component:hn},k=2e3;function _n(e,t){let n=v(e.id)||v(e.iri)||`row:${String(t)}`;return{kind:`row`,id:n,label:v(e.name)||n,type:v(e.type)||void 0,data:e}}function vn({projection:e,selection:t,onSelect:n}){let{columns:r,rows:i}=e.rows,a=(0,C.useCallback)((e,t)=>{n(_n(e,t))},[n]);return r.length===0?(0,E.jsx)(`p`,{className:`text-muted-foreground p-4 text-sm`,children:`This result has no columns to tabulate.`}):(0,E.jsxs)(S,{className:`h-full w-full`,children:[(0,E.jsxs)(`table`,{className:`w-full caption-bottom text-sm`,"data-testid":`atlas-table`,children:[(0,E.jsx)(`thead`,{className:`bg-muted/40 sticky top-0 [&_tr]:border-b`,children:(0,E.jsx)(`tr`,{children:r.map(e=>(0,E.jsx)(`th`,{className:`h-9 px-3 text-left align-middle font-medium whitespace-nowrap`,children:e.label},e.key))})}),(0,E.jsx)(`tbody`,{children:i.slice(0,k).map((e,n)=>{let i=_n(e,n).id;return(0,E.jsx)(`tr`,{onClick:()=>{a(e,n)},"aria-selected":t?.id===i,className:`hover:bg-muted/50 aria-selected:bg-accent cursor-pointer border-b transition-colors`,children:r.map(t=>{let n=v(e[t.key]);return(0,E.jsx)(`td`,{className:`max-w-xs truncate px-3 py-1.5 font-mono text-xs`,title:n,children:n},t.key)})},i)})})]}),i.length>k&&(0,E.jsxs)(`p`,{className:`text-muted-foreground p-3 text-xs`,children:[`Showing the first `,k.toLocaleString(),` of `,i.length.toLocaleString(),` rows.`]})]})}var yn={id:`table`,label:`Table`,icon:je,priority:80,prefers:[`rows`,`scalar`],accepts:e=>e.rows.columns.length>0,component:vn};function bn(){D.registerAll([tn,sn,yn,fn,gn])}var xn=[`t`,`time`,`ts`,`open_time`,`timestamp`],Sn={o:[`o`,`open`],h:[`h`,`high`],l:[`l`,`low`],c:[`c`,`close`]};function Cn(e,t){for(let n of t){let t=e[n],r=typeof t==`string`?Number(t):t;if(typeof r==`number`&&Number.isFinite(r))return r}return null}function wn(e){for(let t of xn){let n=e[t];if(typeof n==`number`&&Number.isFinite(n))return n;if(typeof n==`string`&&Number.isFinite(Date.parse(n)))return Date.parse(n)}return null}function Tn(e){let t=wn(e),[n,r,i,a]=[`o`,`h`,`l`,`c`].map(t=>Cn(e,Sn[t]));return t===null||n===null||r===null||i===null||a===null||i>Math.min(n,a)||r<Math.max(n,a)?null:{t,T:t,o:n,h:r,l:i,c:a,v:Cn(e,[`v`,`volume`])??0,final:!0}}function En(e){if(e.length<2)return null;let t=[];for(let n of e){let e=Tn(n);if(!e)return null;t.push(e)}return t.sort((e,t)=>e.t-t.t),t.map((e,n)=>({...e,T:t[n+1]?.t??e.t+1}))}function Dn({projection:e}){let t=(0,C.useMemo)(()=>{let t=En(e.rows.rows);return t?{title:`Candles from ${e.result.adapterId}`,timeframe:`1D`,bars:t,trail:[],overlays:[],panes:[],flips:[],events:[],showVolume:t.some(e=>e.v>0),showFlips:!1,flipLevel:null,priceDecimals:null}:null},[e]);return t?(0,E.jsx)(Be,{model:t,palette:`convention`}):null}var On={id:`ohlc`,label:`Candles`,icon:De,priority:70,prefers:[`series`],accepts:e=>En(e.rows.rows)!==null,component:Dn},kn=[{id:`markets`,label:`Markets`,blurb:`Trend states, flips and a scanner across markets, computed by the engine. Informational only.`,icon:Oe,routes:Fe,capability:be(`markets`),webmcpPageIds:[`apps.markets`,`apps.markets.chart`],atlasRenderers:[On],client:`src/apps/markets/api.ts`}];function An(){D.registerAll(kn.flatMap(e=>e.atlasRenderers))}function jn(e,t,n){let r=t.capabilities().notes;return e.id===`graph2d`||e.id===`graph3d`?r?.graphProjection?r.graphProjection:n?.graph?.note?n.graph.note:`This result does not project into nodes and edges.`:`This renderer cannot draw this result.`}function Mn({accepting:e,renderer:t,adapter:n,projection:r,onPickRenderer:i}){let a=new Set(e.map(e=>e.id));return(0,E.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`atlas-renderer-switcher`,children:D.list().map(e=>{let o=a.has(e.id),s=e.icon;return(0,E.jsxs)(_,{size:`sm`,variant:t?.id===e.id?`secondary`:`ghost`,className:`h-8 text-xs`,disabled:!o,title:o?e.label:jn(e,n,r),"data-testid":`atlas-renderer-${e.id}`,"data-state":t?.id===e.id?`selected`:`idle`,onClick:()=>{i(e.id)},children:[(0,E.jsx)(s,{className:`mr-1.5 size-3.5`}),e.label]},e.id)})})}function Nn({projection:e}){let{stats:t,sources:n,degraded:r}=e.result;return(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,E.jsxs)(u,{variant:`outline`,children:[t.rowCount.toLocaleString(),` rows`]}),(0,E.jsxs)(u,{variant:`outline`,children:[t.elapsedMs.toLocaleString(),` ms`]}),t.truncated&&(0,E.jsx)(u,{variant:`destructive`,children:`truncated`}),n.length>0&&(0,E.jsxs)(`span`,{className:`text-muted-foreground`,children:[`graphs: `,n.join(`, `)]}),t.note&&(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:t.note}),r&&(0,E.jsx)(`span`,{className:`text-amber-600 dark:text-amber-400`,"data-testid":`atlas-degraded`,children:r})]})}function Pn(e){let{projection:t,renderer:n,loading:r,error:i,adapter:a,ctx:o,selection:s,onSelect:c}=e;if(r)return(0,E.jsx)(Se,{className:`m-3 h-full`});if(i)return(0,E.jsx)(`p`,{className:`text-destructive p-4 text-sm`,children:i});if(!t)return(0,E.jsx)(`p`,{className:`text-muted-foreground p-4 text-sm`,children:`Run a query to see results here.`});if(!n)return(0,E.jsx)(`p`,{className:`text-muted-foreground p-4 text-sm`,children:`No renderer can draw this result.`});let l=n.component;return(0,E.jsx)(l,{projection:t,adapter:a,ctx:o,selection:s,onSelect:c})}function Fn(e){return(0,E.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b px-2 py-1.5`,children:[(0,E.jsx)(Mn,{...e}),e.projection&&(0,E.jsx)(Nn,{projection:e.projection})]}),(0,E.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,E.jsx)(Pn,{...e})})]})}var In={source:Te,collection:ne,field:Me,value:Me};function Ln({node:e,depth:t,onSeed:n}){let[r,i]=(0,C.useState)(t===0),a=e.children??[],o=In[e.kind],l=r?s:c;return(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`button`,{type:`button`,className:`hover:bg-muted/60 flex w-full items-center gap-1.5 rounded px-2 py-1 text-left text-sm`,style:{paddingLeft:`${String(t*12+8)}px`},onClick:()=>{a.length>0&&i(e=>!e),e.seedQuery&&n(e.seedQuery)},"aria-expanded":a.length>0?r:void 0,children:[a.length>0?(0,E.jsx)(l,{className:`text-muted-foreground size-3.5 shrink-0`}):(0,E.jsx)(`span`,{className:`w-3.5 shrink-0`}),(0,E.jsx)(o,{className:`text-muted-foreground size-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,children:e.label}),typeof e.count==`number`&&(0,E.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0 font-mono text-xs`,children:e.count.toLocaleString()})]}),r&&a.map(e=>(0,E.jsx)(Ln,{node:e,depth:t+1,onSeed:n},e.id))]})}function Rn({schema:e,loading:t,onSeed:n,query:r,testId:i=`atlas-schema-tree`}){let a=(0,C.useMemo)(()=>Ft(e.roots,r),[e.roots,r]);return t?(0,E.jsx)(Se,{className:`m-2 h-40`}):e.unavailable?(0,E.jsxs)(`p`,{className:`text-muted-foreground p-3 text-sm`,"data-testid":`atlas-schema-unavailable`,children:[`This modality cannot enumerate its sources here yet.`,e.note?` ${e.note}`:``]}):a.length===0?(0,E.jsx)(`p`,{className:`text-muted-foreground p-3 text-sm`,children:`Nothing matches that.`}):(0,E.jsx)(`div`,{"data-testid":i,children:a.map(e=>(0,E.jsx)(Ln,{node:e,depth:0,onSeed:n},e.id))})}function zn(e){let[t,n]=(0,C.useState)(``);return(0,E.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,E.jsxs)(`div`,{className:`relative border-b p-2`,children:[(0,E.jsx)(ue,{className:`text-muted-foreground pointer-events-none absolute top-1/2 left-4 size-3.5 -translate-y-1/2`}),(0,E.jsx)(g,{"aria-label":`Search sources`,value:t,onChange:e=>{n(e.target.value)},placeholder:`Search sources`,className:`h-8 pl-7 text-sm`})]}),(0,E.jsx)(S,{className:`flex-1`,children:(0,E.jsx)(Rn,{...e,query:t})}),(0,E.jsxs)(`p`,{className:`text-muted-foreground border-t px-3 py-1.5 text-xs`,children:[Lt(e.schema.roots).toLocaleString(),` entries`]})]})}var Bn=t({CYPHER_RESPONSE_SCHEMA:()=>Un,NODE_TYPE_RESPONSE_SCHEMA:()=>Wn,parsePayload:()=>$n,partialReason:()=>er,responseError:()=>Zn}),A=ae(d(),f()),Vn=p({payload:p({rows:m(A).optional()}).loose().optional()}).loose(),Hn={connection:d().nullable().optional(),graph:d().nullable().optional(),errors:ae(d(),f()).nullable().optional(),error:f().optional(),status:d().optional(),claims:m(f()).optional(),reasoning_trace:m(Vn).optional(),source_graphs:m(d()).optional(),degraded_graphs:m(d()).optional(),truncated:h().optional(),has_more:h().optional(),next_cursor:d().nullable().optional(),partial:h().optional()},Un=ie([m(A),p({rows:m(A),...Hn}).loose(),p({...Hn,reasoning_trace:m(Vn)}).loose(),p({status:d(),message:d().optional(),error:f().optional()}).loose(),p({error:f()}).loose()]),Wn=p({by_type:ae(d(),oe()).optional(),available:h().optional(),degraded_graphs:m(d()).optional(),partial:h().optional(),source_graphs:m(d()).optional(),truncated:h().optional()}).loose();function j(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function M(e){return typeof e==`string`&&e.trim()!==``?e:null}function N(e){return Array.isArray(e)?e.filter(e=>M(e)!==null):[]}function Gn(e){return[...new Set(e)]}function Kn(...e){let t=e.find(e=>typeof e==`boolean`);return typeof t==`boolean`?t:null}function qn(e,t){return j(e[t])?e[t]:null}function Jn(e){let t=qn(e,`provenance`)??{};return[...N(e.source_graphs),...N(t.source_graphs)]}function Yn(e){let t=qn(e,`provenance`)??{};return[...N(e.degraded_graphs),...N(t.degraded_graphs)]}function Xn(e,t=null){let n=j(e)?e:{},r=t??{},i=M(r.graph)??M(n.graph);return{raw:e,claims:Array.isArray(n.claims)?n.claims:null,reasoningTrace:Array.isArray(n.reasoning_trace)?n.reasoning_trace:null,sourceGraphs:Gn([...Jn(n),...Jn(r),...i===null?[]:[i]]),degradedGraphs:Gn([...Yn(n),...Yn(r)]),truncated:Kn(r.truncated,n.truncated),hasMore:Kn(r.has_more,n.has_more),nextCursor:M(r.next_cursor)??M(n.next_cursor)}}function P(e,t,n=j(t)?t:null){let r=j(t)?t:{},i=n?.errors,a=r.errors;return{rows:e,connection:M(n?.connection)??M(r.connection),graph:M(n?.graph)??M(r.graph),errors:j(i)?i:j(a)?a:null,metadata:Xn(t,n)}}function Zn(e){return j(e)?e.status===`error`?typeof e.message==`string`?e.message:`Cypher query failed.`:typeof e.error==`string`?e.error:e.error===null||e.error===void 0?null:j(e.error)?typeof e.error.message==`string`?e.error.message:typeof e.error.code==`string`?`Cypher query failed (${e.error.code}).`:`Cypher query failed.`:`Cypher query failed.`:null}function Qn(e){if(!Array.isArray(e.reasoning_trace))return null;let t=e.reasoning_trace;for(let n=t.length-1;n>=0;--n){let r=t[n];if(j(r)&&j(r.payload)&&Array.isArray(r.payload.rows)&&r.payload.rows.every(j))return P(r.payload.rows,e,r.payload)}return null}function $n(e){if(Array.isArray(e))return e.every(j)?{payload:P(e,e),error:null}:{payload:null,error:`Cypher route returned a non-row result.`};if(!j(e))return{payload:null,error:`Cypher route returned an invalid result shape.`};if(Array.isArray(e.rows))return e.rows.every(j)?{payload:P(e.rows,e),error:null}:{payload:null,error:`Cypher route returned a non-row result.`};let t=Qn(e);return t?{payload:t,error:null}:{payload:null,error:`Cypher response did not expose its raw query rows.`}}function er(e){let t=e.errors?Object.keys(e.errors):[],n=e.metadata?.degradedGraphs??[];if(t.length>0)return`Some graph query targets failed: ${t.join(`, `)}`;if(n.length>0)return`Skipped graphs: ${n.join(`, `)}`;let r=e.metadata?.raw;return j(r)&&r.partial===!0?`The graph query returned a partial result.`:null}var tr=t({CypherCompileError:()=>I,CypherSafetyError:()=>L,SERVER_RESULT_LIMIT:()=>256,TYPE_LIMIT:()=>200,boundedLimit:()=>R,compileCypher:()=>z,countTypes:()=>fr,escapeCypherString:()=>B,rawQueryError:()=>G,requestBody:()=>yr,schemaTree:()=>V,terminalLimit:()=>H}),nr=`cypher`,rr=/\b(?:call|create|delete|detach|drop|foreach|load\s+csv|merge|remove|set|use)\b/i,F={id:`n.id`,name:`n.name`,type:`n.node_type`,node_type:`n.node_type`},I=class extends Error{constructor(e){super(e),this.name=`CypherCompileError`}},L=class extends Error{constructor(e){super(e),this.name=`CypherSafetyError`}},ir={eq:(e,t)=>`${e} = $${t}`,neq:(e,t)=>`${e} != $${t}`,contains:(e,t)=>`toLower(${e}) CONTAINS toLower($${t})`};function R(e,t){let n=Number.isFinite(t)?Math.max(0,Math.floor(t)):0,r=Number.isFinite(e.limit)?Math.floor(e.limit):n;return Math.max(0,Math.min(r,n,256))}function ar(e){return typeof e==`string`?F[e.toLowerCase()]??null:null}function or(e,t,n){let r=ar(e.field),i=ir[e.op];if(!r)throw new I(`Unsupported Cypher filter field: ${e.field}`);if(!i)throw new I(`Unsupported Cypher filter operator: ${e.op}`);let a=`atlas_filter_${String(t)}`;return n[a]=e.value??``,i(r,a)}function sr(e,t){let n=e.trim();return n?(t.atlas_search=n,[F.id,F.name,F.type].map(e=>`toLower(${e}) CONTAINS toLower($atlas_search)`).join(` OR `)):null}function cr(e,t){let n=e.clauses.map((e,n)=>or(e,n,t)),r=n.length>0?`(${n.join(e.combinator===`or`?` OR `:` AND `)})`:null,i=sr(e.search,t),a=[r,i?`(${i})`:null].filter(e=>e!==null);return a.length>0?`\nWHERE ${a.join(` AND `)}`:``}function lr(e){if(!e)return``;let t=ar(e.field);if(!t)throw new I(`Unsupported Cypher sort field: ${e.field}`);return`\nORDER BY ${t} ${e.direction.toUpperCase()}`}function z({filters:e,ctx:t}){let n={},r=R(e,t.limit);return{text:`MATCH (n)${cr(e,n)}\nRETURN n.id AS id, n.name AS name, n.node_type AS type${lr(e.sort)}\nLIMIT ${String(r)}`,params:n,graph:t.graph,limit:r}}function B(e){return`'${e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\r/g,`\\r`).replace(/\n/g,`\\n`)}'`}function ur(e){return Object.entries(e).filter(([,e])=>Number.isFinite(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>({id:`type:${e}`,label:e,kind:`collection`,count:t,seedQuery:`MATCH (n) WHERE n.node_type = ${B(e)} RETURN n.id AS id, n.name AS name, n.node_type AS type LIMIT 200`}))}var dr=[{id:`id`,label:`id`,kind:`field`,dataType:`string`},{id:`name`,label:`name`,kind:`field`,dataType:`string`},{id:`type`,label:`type (node_type)`,kind:`field`,dataType:`string`}];function V(e,t){return{adapterId:nr,roots:[{id:`types`,label:`Node types`,kind:`source`,children:ur(e)},{id:`fields`,label:`Fields`,kind:`source`,children:dr}],unavailable:!1,note:t}}function fr(e){let t={};for(let n of e){let e=typeof n.type==`string`?n.type:null,r=typeof n.count==`number`?n.count:Number(n.count);e&&Number.isFinite(r)&&(t[e]=r)}return t}function H(e){let t=vr(e).trim();if(t===``||t.includes(`;`)||/\bunion\b/i.test(t)||t.match(/\blimit\b/gi)?.length!==1)return null;let n=/\blimit\s+([0-9]+)\s*$/i.exec(t);if(!n)return null;let r=Number(n[1]);return Number.isSafeInteger(r)?r:null}function pr(e){return{"'":`single-quote`,'"':`double-quote`,"`":`backtick`}[e]??`plain`}function U(e){return e===`
|
|
1
|
+
import{i as e,o as t,r as n,s as r}from"./bundle-mjs-DIyOrgL5.js";import{t as i}from"./useQuery-BCV_z3lS.js";import{t as a}from"./createLucideIcon-DTQSidPf.js";import{t as o}from"./braces-BNz2iAeD.js";import{t as s}from"./chevron-down-DYWnPQti.js";import{t as c}from"./chevron-right-gs8WU8XT.js";import{t as l}from"./external-link-Dyd5OsGm.js";import{t as ee}from"./play-D3mjq--Q.js";import{t as te}from"./plus-s20KYBeu.js";import{t as ne}from"./tag-D1RiwxuF.js";import{t as re}from"./x-BdA_yxUR.js";import{t as u}from"./badge-nQZ87mVE.js";import{D as ie,E as d,O as f,S as p,d as m,f as h,w as ae,x as oe}from"./api-validation-CCoR_LRu.js";import{$ as se,$n as ce,E as le,En as ue,Ft as de,It as fe,K as pe,Mt as me,Nn as he,Nt as ge,O as _e,Pt as ve,Q as ye,R as be,T as xe,Vt as Se,W as Ce,Yt as g,Z as we,Zn as Te,_n as Ee,cr as De,fn as Oe,fr as ke,gr as Ae,hn as je,ir as Me,jt as Ne,k as Pe,q as Fe,rn as _,sn as Ie,w as Le,xn as Re,zn as ze}from"./index-GCzCgfSc.js";import{n as Be}from"./ChartPanel-Cxpkw3a6.js";import{_ as Ve,a as He,c as Ue,d as We,f as Ge,g as v,h as Ke,i as qe,l as Je,m as Ye,n as Xe,o as Ze,p as y,s as Qe,u as $e}from"./uql-H85wtqTc.js";import{n as b,t as x}from"./transport-Din6U5N9.js";import{t as S}from"./scroll-area-srEWz9Q3.js";import{o as et,t as tt}from"./theme-colors-DKGWsgC0.js";import{t as nt}from"./GraphCanvas-D615Ydp_.js";import{a as rt,n as it,t as at}from"./model-BPtIOW9U.js";var ot={name:`arrow-right-left`,size:24,node:[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]};ot.node;var st=a(ot),ct={name:`file-braces`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]],aliases:[`file-json`]};ct.node;var lt=a(ct),ut={name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]};ut.node;var dt=a(ut),C=r(e(),1),ft=[`exists`,`missing`],pt={eq:`is`,neq:`is not`,contains:`contains`,startsWith:`starts with`,gt:`>`,gte:`>=`,lt:`<`,lte:`<=`,in:`is one of`,exists:`is set`,missing:`is not set`},mt=[`eq`,`neq`,`contains`,`startsWith`,`in`,`exists`,`missing`],ht=[`eq`,`neq`,`gt`,`gte`,`lt`,`lte`,`in`,`exists`,`missing`],gt={string:mt,number:ht,date:ht,boolean:[`eq`,`neq`,`exists`,`missing`],unknown:mt};function _t(e,t){return gt[e].filter(e=>t.includes(e))}function vt(e){return ft.includes(e)}var yt=0;function bt(e,t=`eq`,n){return yt+=1,{id:`clause-${String(yt)}`,field:e,op:t,value:n}}function xt(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e==`string`&&e.trim()!==``){let t=Number(e);return Number.isFinite(t)?t:null}return null}function w(e,t){let n=xt(e),r=xt(t);return n!==null&&r!==null?Math.sign(n-r):v(e).localeCompare(v(t))}function St(e){return e!=null&&e!==``}function Ct(e){return Array.isArray(e)?e:e===void 0?[]:[e]}var wt={eq:(e,t)=>v(e)===v(t),neq:(e,t)=>v(e)!==v(t),contains:(e,t)=>v(e).toLowerCase().includes(v(t).toLowerCase()),startsWith:(e,t)=>v(e).toLowerCase().startsWith(v(t).toLowerCase()),gt:(e,t)=>w(e,t)>0,gte:(e,t)=>w(e,t)>=0,lt:(e,t)=>w(e,t)<0,lte:(e,t)=>w(e,t)<=0,in:(e,t)=>Ct(t).some(t=>v(e)===v(t)),exists:e=>St(e),missing:e=>!St(e)};function T(e,t){if(t in e)return e[t];let n=e;for(let e of t.split(`.`)){if(!n||typeof n!=`object`)return;n=n[e]}return n}function Tt(e,t){return wt[t.op](T(e,t.field),t.value)}function Et(e,t){let n=t.toLowerCase();return Object.values(e).some(e=>v(e).toLowerCase().includes(n))}function Dt(e,t){return t.search.trim()!==``&&!Et(e,t.search.trim())?!1:t.clauses.length===0?!0:t.combinator===`or`?t.clauses.some(t=>Tt(e,t)):t.clauses.every(t=>Tt(e,t))}function Ot(e,t){if(!t)return e;let n=t.direction===`desc`?-1:1;return[...e].sort((e,r)=>n*w(T(e,t.field),T(r,t.field)))}function kt(e,t){return Ot(e.filter(e=>Dt(e,t)),t.sort).slice(0,t.limit)}function At(e){let t=pt[e.op];if(vt(e.op))return`${e.field} ${t}`;let n=Array.isArray(e.value)?e.value.join(`, `):v(e.value);return`${e.field} ${t} "${n}"`}function jt(e){let t=[];e.search.trim()!==``&&t.push(`search "${e.search.trim()}"`);let n=e.clauses.map(At);return n.length>0&&t.push(n.join(e.combinator===`or`?` OR `:` AND `)),e.sort&&t.push(`order by ${e.sort.field} ${e.sort.direction}`),t.push(`limit ${String(e.limit)}`),t.join(` `)}function Mt(e){let t=new Map,n=e=>{e.kind===`field`&&!t.has(e.id)&&t.set(e.id,e);for(let t of e.children??[])n(t)};for(let t of e.roots)n(t);return[...t.values()]}function Nt(e,t){return e.find(e=>e.id===t)?.dataType??`unknown`}function Pt(e,t){return e.label.toLowerCase().includes(t)||e.id.toLowerCase().includes(t)}function Ft(e,t){let n=t.trim().toLowerCase();return n===``?[...e]:e.flatMap(e=>It(e,n))}function It(e,t){let n=(e.children??[]).flatMap(e=>It(e,t));return Pt(e,t)?[{...e,children:e.children}]:n.length>0?[{...e,children:n}]:[]}function Lt(e){return e.reduce((e,t)=>e+1+Lt(t.children??[]),0)}var E=n();function Rt({clause:e,position:t,fields:n,capabilities:r,onChange:i,onRemove:a}){let o=_t(Nt(n,e.field),r.filters);return(0,E.jsxs)(`div`,{className:`flex w-full flex-wrap items-center gap-1.5 sm:w-auto`,role:`group`,"aria-label":`Filter ${t}`,"data-testid":`atlas-filter-clause`,children:[(0,E.jsxs)(me,{value:e.field,onValueChange:t=>{i({...e,field:t})},children:[(0,E.jsx)(de,{className:`h-8 min-w-0 flex-1 text-xs sm:w-40 sm:flex-none`,"aria-label":`Filter ${t} field`,children:(0,E.jsx)(fe,{})}),(0,E.jsx)(ge,{children:n.map(e=>(0,E.jsx)(ve,{value:e.id,children:e.label},e.id))})]}),(0,E.jsxs)(me,{value:e.op,onValueChange:t=>{i({...e,op:t})},children:[(0,E.jsx)(de,{className:`h-8 min-w-0 flex-1 text-xs sm:w-28 sm:flex-none`,"aria-label":`Filter ${t} operator`,children:(0,E.jsx)(fe,{})}),(0,E.jsx)(ge,{children:o.map(e=>(0,E.jsx)(ve,{value:e,children:pt[e]},e))})]}),!vt(e.op)&&(0,E.jsx)(g,{"aria-label":`Filter ${t} value`,value:String(e.value??``),onChange:t=>{i({...e,value:t.target.value})},className:`h-8 min-w-0 flex-1 text-xs sm:w-44 sm:flex-none`,placeholder:`value`}),(0,E.jsx)(_,{variant:`ghost`,size:`icon`,className:`size-8`,"aria-label":`Remove filter ${t}`,onClick:a,children:(0,E.jsx)(re,{className:`size-3.5`})})]})}function zt(e,t){return e.map(e=>e.id===t.id?t:e)}function Bt(e){return e===`and`?`Match all filters; switch to match any`:`Match any filters; switch to match all`}function Vt({filters:e,fields:t,capabilities:n,onChange:r}){let i=t.length>0&&n.filters.length>0;return(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,"data-testid":`atlas-filter-bar`,children:[n.freeTextSearch&&(0,E.jsx)(g,{"aria-label":`Search results`,value:e.search,onChange:t=>{r({...e,search:t.target.value})},placeholder:`Search…`,className:`h-8 w-48 text-xs`}),e.clauses.map((i,a)=>(0,E.jsx)(Rt,{clause:i,position:a+1,fields:t,capabilities:n,onChange:t=>{r({...e,clauses:zt(e.clauses,t)})},onRemove:()=>{r({...e,clauses:e.clauses.filter(e=>e.id!==i.id)})}},i.id)),(0,E.jsxs)(_,{variant:`outline`,size:`sm`,className:`h-8`,"aria-label":`Add filter`,disabled:!i,onClick:()=>{r({...e,clauses:[...e.clauses,bt(t[0].id,n.filters[0])]})},children:[(0,E.jsx)(te,{className:`mr-1 size-3.5`}),`Filter`]}),e.clauses.length>1&&(0,E.jsxs)(_,{variant:`ghost`,size:`sm`,className:`h-8 text-xs`,"aria-label":Bt(e.combinator),onClick:()=>{r({...e,combinator:e.combinator===`and`?`or`:`and`})},children:[`match `,e.combinator===`and`?`all`:`any`]})]})}function Ht({data:e}){let t=Object.entries(e);return t.length===0?(0,E.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No properties.`}):(0,E.jsx)(`dl`,{className:`space-y-1`,children:t.map(([e,t])=>(0,E.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_1fr] gap-2 text-xs`,children:[(0,E.jsx)(`dt`,{className:`text-muted-foreground truncate font-mono`,children:e}),(0,E.jsx)(`dd`,{className:`font-mono break-all`,children:v(t)})]},e))})}function Ut({selection:e,pivots:t,onPivot:n,testId:r=`atlas-inspector`}){return e?(0,E.jsx)(S,{className:`h-full`,"data-testid":r,children:(0,E.jsxs)(`div`,{className:`space-y-4 p-3`,children:[(0,E.jsxs)(`div`,{className:`space-y-1`,children:[(0,E.jsx)(`p`,{className:`text-sm font-semibold break-all`,children:e.label}),(0,E.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,E.jsx)(u,{variant:`outline`,children:e.kind}),e.type&&(0,E.jsx)(u,{variant:`secondary`,children:e.type})]}),(0,E.jsx)(`p`,{className:`text-muted-foreground font-mono text-xs break-all`,children:e.id})]}),(0,E.jsx)(Ht,{data:e.data}),t.length>0&&(0,E.jsxs)(`div`,{className:`space-y-2 border-t pt-3`,children:[(0,E.jsx)(`p`,{className:`text-muted-foreground text-xs font-semibold uppercase`,children:`Explore from here`}),t.map(e=>(0,E.jsxs)(_,{variant:`outline`,size:`sm`,className:`w-full justify-start text-xs`,title:e.description,onClick:()=>{n(e)},children:[(0,E.jsx)(st,{className:`mr-2 size-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,children:e.label})]},e.id))]})]})}):(0,E.jsxs)(`div`,{className:`text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-4 text-center text-sm`,children:[(0,E.jsx)(dt,{className:`size-5`}),(0,E.jsx)(`p`,{children:`Select a node, edge or row to inspect it.`})]})}function Wt({adapters:e,activeId:t,onSelect:n}){return(0,E.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`atlas-modality-picker`,children:e.map(e=>{let r=e.icon;return(0,E.jsxs)(_,{size:`sm`,variant:e.id===t?`secondary`:`ghost`,className:`h-8 text-xs`,title:e.description,"data-testid":`atlas-modality-${e.id}`,onClick:()=>{n(e.id)},children:[(0,E.jsx)(r,{className:`mr-1.5 size-3.5`}),e.label]},e.id)})})}function Gt({text:e,capabilities:t,running:n,onChange:r,onRun:i}){let a=t.rawQuery;return(0,E.jsxs)(`div`,{className:`space-y-2`,"data-testid":`atlas-query-console`,children:[(0,E.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,E.jsx)(Ne,{"aria-label":`Query`,value:e,readOnly:!a,rows:3,spellCheck:!1,onChange:e=>{r(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&i()},className:`flex-1 font-mono text-xs ${a?``:`bg-muted/40`}`}),(0,E.jsxs)(_,{onClick:i,disabled:n,"data-testid":`atlas-run`,children:[n?(0,E.jsx)(ze,{className:`mr-2 size-4 animate-spin`}):(0,E.jsx)(ee,{className:`mr-2 size-4`}),`Run`]})]}),(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[t.rawQueryLanguage&&(0,E.jsx)(u,{variant:`secondary`,children:t.rawQueryLanguage}),!a&&(0,E.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[`Read-only: this modality has no text query language here — edit the filters instead.`,t.notes?.rawQuery?` ${t.notes.rawQuery}`:``]})]})]})}var Kt=class{items=new Map;register(e){this.items.set(e.id,e)}registerAll(e){for(let t of e)this.register(t)}get(e){return e?this.items.get(e)??null:null}has(e){return this.items.has(e)}list(){return[...this.items.values()]}get size(){return this.items.size}clear(){this.items.clear()}},D=new Kt;function qt(e,t){return{result:t,rows:Jt(()=>e.toRows(t),Ye),graph:e.toGraph?Jt(()=>e.toGraph?.(t)??null,null):null}}function Jt(e,t){try{return e()}catch{return t}}function Yt(e,t=D){return t.list().filter(t=>Xt(t,e)).sort((t,n)=>Zt(n,e)-Zt(t,e))}function Xt(e,t){try{return e.accepts(t)}catch{return!1}}function Zt(e,t){let n=e.prefers?.includes(t.result.shape)??!1;return e.priority+(n?1e3:0)}function Qt(e,t,n=D){let r=Yt(e,n);return r.length===0?null:r.find(e=>e.id===t)??r[0]}function O(){}function $t(e){let t=e.properties.name;return{kind:`node`,id:e.id,label:typeof t==`string`&&t?t:e.id,type:e.labels[0],data:e.properties}}function en({projection:e,selection:t,onSelect:n}){let r=e.graph,{nodes:i,relationships:a}=(0,C.useMemo)(()=>r?Ue(r):{nodes:[],relationships:[]},[r]),o=(0,C.useMemo)(()=>i.find(e=>e.id===t?.id)??null,[i,t?.id]);return i.length>3e3?(0,E.jsxs)(`p`,{className:`text-muted-foreground p-4 text-sm`,"data-testid":`atlas-graph2d-oversize`,children:[i.length.toLocaleString(),` nodes is beyond what this canvas draws smoothly. Narrow the filters, or use the level-of-detail explorer at `,(0,E.jsx)(`code`,{children:`/graph-3d/lod`}),`.`]}):(0,E.jsx)(`div`,{className:`h-full w-full`,"data-testid":`atlas-graph2d`,children:(0,E.jsx)(nt,{nodes:i,relationships:a,onUpdateNode:O,onDeleteNode:O,onAddNode:O,selectedNodeExternally:o,onSelectNode:e=>{n(e?$t(e):null)}})})}var tn={id:`graph2d`,label:`2D graph`,icon:he,priority:90,prefers:[`graph`],accepts:e=>(e.graph?.nodes.length??0)>0,component:en},nn={bloom:!0,depthOfField:!1};function rn(e){let t=e?`#0a0d14`:`#f6f7fb`;if(typeof window>`u`)return t;let n=window.getComputedStyle(document.documentElement).getPropertyValue(`--background`);return tt(n,t)}function an(e,t){if(t<0||t>=e.nodes.length)return null;let n=e.nodes[t];return{kind:`node`,id:n.id,label:n.name||n.id,type:n.type,data:{...n}}}function on({projection:e,selection:t,onSelect:n}){let r=et(),[i,a]=(0,C.useState)(()=>rn(r));(0,C.useEffect)(()=>{a(rn(r))},[r]);let o=e.graph,s=(0,C.useMemo)(()=>at(Qe(o??{nodes:[],edges:[],truncated:!1})),[o]),c=(0,C.useMemo)(()=>t?s.indexById.get(t.id)??null:null,[s,t]);return s.nodes.length>6e4?(0,E.jsxs)(`p`,{className:`text-muted-foreground p-4 text-sm`,"data-testid":`atlas-graph3d-oversize`,children:[s.nodes.length.toLocaleString(),` nodes exceeds what this scene uploads to the GPU. Use the level-of-detail explorer at `,(0,E.jsx)(`code`,{children:`/graph-3d/lod`}),`, which streams clusters instead.`]}):(0,E.jsx)(`div`,{className:`h-full w-full`,"data-testid":`atlas-graph3d`,children:(0,E.jsx)(rt,{model:s,isDark:r,background:i,selected:c,onSelect:e=>{n(e===null?null:an(s,e))},onExpand:()=>{},visibleMask:null,autoRotate:!1,frameToken:s.nodes.length,effects:nn,contextHops:1,relationshipFilter:null})})}var sn={id:`graph3d`,label:`3D graph`,icon:ke,priority:85,prefers:[`graph`],accepts:e=>(e.graph?.nodes.length??0)>0,component:on},cn=500;function ln(e){return Object.keys(e).slice(0,4).map(t=>`${t}: ${v(e[t])}`).join(` · `)}function un({row:e,index:t}){let[n,r]=(0,C.useState)(!1);return(0,E.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>{r(e=>!e)},"aria-expanded":n,className:`hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-1.5 text-left`,children:[(0,E.jsx)(n?s:c,{className:`text-muted-foreground size-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`text-muted-foreground w-10 shrink-0 font-mono text-xs`,children:t+1}),(0,E.jsx)(`span`,{className:`truncate font-mono text-xs`,children:ln(e)})]}),n&&(0,E.jsx)(`pre`,{className:`bg-muted/30 overflow-x-auto px-3 py-2 text-xs`,children:JSON.stringify(e,null,2)})]})}function dn({projection:e}){let t=e.rows.rows.slice(0,cn);return t.length===0?(0,E.jsx)(`p`,{className:`text-muted-foreground p-4 text-sm`,children:`No records to expand.`}):(0,E.jsx)(S,{className:`h-full w-full`,children:(0,E.jsx)(`div`,{"data-testid":`atlas-json`,children:t.map((e,t)=>(0,E.jsx)(un,{row:e,index:t},t))})})}var fn={id:`json`,label:`JSON`,icon:o,priority:60,prefers:[`tree`],accepts:e=>e.rows.rows.length>0,component:dn},pn=2e5;function mn(e){let t=Ve(e);return t.length<=pn?t:`${t.slice(0,pn)}\n\n… elided: payload is ${t.length.toLocaleString()} characters.`}function hn({projection:e}){return(0,E.jsx)(S,{className:`h-full w-full`,children:(0,E.jsx)(`pre`,{className:`p-3 font-mono text-xs`,"data-testid":`atlas-raw`,children:mn(e.result.payload)})})}var gn={id:`raw`,label:`Raw`,icon:lt,priority:10,accepts:()=>!0,component:hn},k=2e3;function _n(e,t){let n=v(e.id)||v(e.iri)||`row:${String(t)}`;return{kind:`row`,id:n,label:v(e.name)||n,type:v(e.type)||void 0,data:e}}function vn({projection:e,selection:t,onSelect:n}){let{columns:r,rows:i}=e.rows,a=(0,C.useCallback)((e,t)=>{n(_n(e,t))},[n]);return r.length===0?(0,E.jsx)(`p`,{className:`text-muted-foreground p-4 text-sm`,children:`This result has no columns to tabulate.`}):(0,E.jsxs)(S,{className:`h-full w-full`,children:[(0,E.jsxs)(`table`,{className:`w-full caption-bottom text-sm`,"data-testid":`atlas-table`,children:[(0,E.jsx)(`thead`,{className:`bg-muted/40 sticky top-0 [&_tr]:border-b`,children:(0,E.jsx)(`tr`,{children:r.map(e=>(0,E.jsx)(`th`,{className:`h-9 px-3 text-left align-middle font-medium whitespace-nowrap`,children:e.label},e.key))})}),(0,E.jsx)(`tbody`,{children:i.slice(0,k).map((e,n)=>{let i=_n(e,n).id;return(0,E.jsx)(`tr`,{onClick:()=>{a(e,n)},"aria-selected":t?.id===i,className:`hover:bg-muted/50 aria-selected:bg-accent cursor-pointer border-b transition-colors`,children:r.map(t=>{let n=v(e[t.key]);return(0,E.jsx)(`td`,{className:`max-w-xs truncate px-3 py-1.5 font-mono text-xs`,title:n,children:n},t.key)})},i)})})]}),i.length>k&&(0,E.jsxs)(`p`,{className:`text-muted-foreground p-3 text-xs`,children:[`Showing the first `,k.toLocaleString(),` of `,i.length.toLocaleString(),` rows.`]})]})}var yn={id:`table`,label:`Table`,icon:je,priority:80,prefers:[`rows`,`scalar`],accepts:e=>e.rows.columns.length>0,component:vn};function bn(){D.registerAll([tn,sn,yn,fn,gn])}var xn=[`t`,`time`,`ts`,`open_time`,`timestamp`],Sn={o:[`o`,`open`],h:[`h`,`high`],l:[`l`,`low`],c:[`c`,`close`]};function Cn(e,t){for(let n of t){let t=e[n],r=typeof t==`string`?Number(t):t;if(typeof r==`number`&&Number.isFinite(r))return r}return null}function wn(e){for(let t of xn){let n=e[t];if(typeof n==`number`&&Number.isFinite(n))return n;if(typeof n==`string`&&Number.isFinite(Date.parse(n)))return Date.parse(n)}return null}function Tn(e){let t=wn(e),[n,r,i,a]=[`o`,`h`,`l`,`c`].map(t=>Cn(e,Sn[t]));return t===null||n===null||r===null||i===null||a===null||i>Math.min(n,a)||r<Math.max(n,a)?null:{t,T:t,o:n,h:r,l:i,c:a,v:Cn(e,[`v`,`volume`])??0,final:!0}}function En(e){if(e.length<2)return null;let t=[];for(let n of e){let e=Tn(n);if(!e)return null;t.push(e)}return t.sort((e,t)=>e.t-t.t),t.map((e,n)=>({...e,T:t[n+1]?.t??e.t+1}))}function Dn({projection:e}){let t=(0,C.useMemo)(()=>{let t=En(e.rows.rows);return t?{title:`Candles from ${e.result.adapterId}`,timeframe:`1D`,bars:t,trail:[],overlays:[],panes:[],flips:[],events:[],showVolume:t.some(e=>e.v>0),showFlips:!1,flipLevel:null,priceDecimals:null}:null},[e]);return t?(0,E.jsx)(Be,{model:t,palette:`convention`}):null}var On={id:`ohlc`,label:`Candles`,icon:De,priority:70,prefers:[`series`],accepts:e=>En(e.rows.rows)!==null,component:Dn},kn=[{id:`markets`,label:`Markets`,blurb:`Trend states, flips and a scanner across markets, computed by the engine. Informational only.`,icon:Oe,routes:Fe,capability:be(`markets`),webmcpPageIds:[`apps.markets`,`apps.markets.chart`],atlasRenderers:[On],client:`src/apps/markets/api.ts`}];function An(){D.registerAll(kn.flatMap(e=>e.atlasRenderers))}function jn(e,t,n){let r=t.capabilities().notes;return e.id===`graph2d`||e.id===`graph3d`?r?.graphProjection?r.graphProjection:n?.graph?.note?n.graph.note:`This result does not project into nodes and edges.`:`This renderer cannot draw this result.`}function Mn({accepting:e,renderer:t,adapter:n,projection:r,onPickRenderer:i}){let a=new Set(e.map(e=>e.id));return(0,E.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,"data-testid":`atlas-renderer-switcher`,children:D.list().map(e=>{let o=a.has(e.id),s=e.icon;return(0,E.jsxs)(_,{size:`sm`,variant:t?.id===e.id?`secondary`:`ghost`,className:`h-8 text-xs`,disabled:!o,title:o?e.label:jn(e,n,r),"data-testid":`atlas-renderer-${e.id}`,"data-state":t?.id===e.id?`selected`:`idle`,onClick:()=>{i(e.id)},children:[(0,E.jsx)(s,{className:`mr-1.5 size-3.5`}),e.label]},e.id)})})}function Nn({projection:e}){let{stats:t,sources:n,degraded:r}=e.result;return(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,E.jsxs)(u,{variant:`outline`,children:[t.rowCount.toLocaleString(),` rows`]}),(0,E.jsxs)(u,{variant:`outline`,children:[t.elapsedMs.toLocaleString(),` ms`]}),t.truncated&&(0,E.jsx)(u,{variant:`destructive`,children:`truncated`}),n.length>0&&(0,E.jsxs)(`span`,{className:`text-muted-foreground`,children:[`graphs: `,n.join(`, `)]}),t.note&&(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:t.note}),r&&(0,E.jsx)(`span`,{className:`text-amber-600 dark:text-amber-400`,"data-testid":`atlas-degraded`,children:r})]})}function Pn(e){let{projection:t,renderer:n,loading:r,error:i,adapter:a,ctx:o,selection:s,onSelect:c}=e;if(r)return(0,E.jsx)(Se,{className:`m-3 h-full`});if(i)return(0,E.jsx)(`p`,{className:`text-destructive p-4 text-sm`,children:i});if(!t)return(0,E.jsx)(`p`,{className:`text-muted-foreground p-4 text-sm`,children:`Run a query to see results here.`});if(!n)return(0,E.jsx)(`p`,{className:`text-muted-foreground p-4 text-sm`,children:`No renderer can draw this result.`});let l=n.component;return(0,E.jsx)(l,{projection:t,adapter:a,ctx:o,selection:s,onSelect:c})}function Fn(e){return(0,E.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b px-2 py-1.5`,children:[(0,E.jsx)(Mn,{...e}),e.projection&&(0,E.jsx)(Nn,{projection:e.projection})]}),(0,E.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,E.jsx)(Pn,{...e})})]})}var In={source:Te,collection:ne,field:Me,value:Me};function Ln({node:e,depth:t,onSeed:n}){let[r,i]=(0,C.useState)(t===0),a=e.children??[],o=In[e.kind],l=r?s:c;return(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`button`,{type:`button`,className:`hover:bg-muted/60 flex w-full items-center gap-1.5 rounded px-2 py-1 text-left text-sm`,style:{paddingLeft:`${String(t*12+8)}px`},onClick:()=>{a.length>0&&i(e=>!e),e.seedQuery&&n(e.seedQuery)},"aria-expanded":a.length>0?r:void 0,children:[a.length>0?(0,E.jsx)(l,{className:`text-muted-foreground size-3.5 shrink-0`}):(0,E.jsx)(`span`,{className:`w-3.5 shrink-0`}),(0,E.jsx)(o,{className:`text-muted-foreground size-3.5 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,children:e.label}),typeof e.count==`number`&&(0,E.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0 font-mono text-xs`,children:e.count.toLocaleString()})]}),r&&a.map(e=>(0,E.jsx)(Ln,{node:e,depth:t+1,onSeed:n},e.id))]})}function Rn({schema:e,loading:t,onSeed:n,query:r,testId:i=`atlas-schema-tree`}){let a=(0,C.useMemo)(()=>Ft(e.roots,r),[e.roots,r]);return t?(0,E.jsx)(Se,{className:`m-2 h-40`}):e.unavailable?(0,E.jsxs)(`p`,{className:`text-muted-foreground p-3 text-sm`,"data-testid":`atlas-schema-unavailable`,children:[`This modality cannot enumerate its sources here yet.`,e.note?` ${e.note}`:``]}):a.length===0?(0,E.jsx)(`p`,{className:`text-muted-foreground p-3 text-sm`,children:`Nothing matches that.`}):(0,E.jsx)(`div`,{"data-testid":i,children:a.map(e=>(0,E.jsx)(Ln,{node:e,depth:0,onSeed:n},e.id))})}function zn(e){let[t,n]=(0,C.useState)(``);return(0,E.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,E.jsxs)(`div`,{className:`relative border-b p-2`,children:[(0,E.jsx)(ue,{className:`text-muted-foreground pointer-events-none absolute top-1/2 left-4 size-3.5 -translate-y-1/2`}),(0,E.jsx)(g,{"aria-label":`Search sources`,value:t,onChange:e=>{n(e.target.value)},placeholder:`Search sources`,className:`h-8 pl-7 text-sm`})]}),(0,E.jsx)(S,{className:`flex-1`,children:(0,E.jsx)(Rn,{...e,query:t})}),(0,E.jsxs)(`p`,{className:`text-muted-foreground border-t px-3 py-1.5 text-xs`,children:[Lt(e.schema.roots).toLocaleString(),` entries`]})]})}var Bn=t({CYPHER_RESPONSE_SCHEMA:()=>Un,NODE_TYPE_RESPONSE_SCHEMA:()=>Wn,parsePayload:()=>$n,partialReason:()=>er,responseError:()=>Zn}),A=ae(d(),f()),Vn=p({payload:p({rows:m(A).optional()}).loose().optional()}).loose(),Hn={connection:d().nullable().optional(),graph:d().nullable().optional(),errors:ae(d(),f()).nullable().optional(),error:f().optional(),status:d().optional(),claims:m(f()).optional(),reasoning_trace:m(Vn).optional(),source_graphs:m(d()).optional(),degraded_graphs:m(d()).optional(),truncated:h().optional(),has_more:h().optional(),next_cursor:d().nullable().optional(),partial:h().optional()},Un=ie([m(A),p({rows:m(A),...Hn}).loose(),p({...Hn,reasoning_trace:m(Vn)}).loose(),p({status:d(),message:d().optional(),error:f().optional()}).loose(),p({error:f()}).loose()]),Wn=p({by_type:ae(d(),oe()).optional(),available:h().optional(),degraded_graphs:m(d()).optional(),partial:h().optional(),source_graphs:m(d()).optional(),truncated:h().optional()}).loose();function j(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function M(e){return typeof e==`string`&&e.trim()!==``?e:null}function N(e){return Array.isArray(e)?e.filter(e=>M(e)!==null):[]}function Gn(e){return[...new Set(e)]}function Kn(...e){let t=e.find(e=>typeof e==`boolean`);return typeof t==`boolean`?t:null}function qn(e,t){return j(e[t])?e[t]:null}function Jn(e){let t=qn(e,`provenance`)??{};return[...N(e.source_graphs),...N(t.source_graphs)]}function Yn(e){let t=qn(e,`provenance`)??{};return[...N(e.degraded_graphs),...N(t.degraded_graphs)]}function Xn(e,t=null){let n=j(e)?e:{},r=t??{},i=M(r.graph)??M(n.graph);return{raw:e,claims:Array.isArray(n.claims)?n.claims:null,reasoningTrace:Array.isArray(n.reasoning_trace)?n.reasoning_trace:null,sourceGraphs:Gn([...Jn(n),...Jn(r),...i===null?[]:[i]]),degradedGraphs:Gn([...Yn(n),...Yn(r)]),truncated:Kn(r.truncated,n.truncated),hasMore:Kn(r.has_more,n.has_more),nextCursor:M(r.next_cursor)??M(n.next_cursor)}}function P(e,t,n=j(t)?t:null){let r=j(t)?t:{},i=n?.errors,a=r.errors;return{rows:e,connection:M(n?.connection)??M(r.connection),graph:M(n?.graph)??M(r.graph),errors:j(i)?i:j(a)?a:null,metadata:Xn(t,n)}}function Zn(e){return j(e)?e.status===`error`?typeof e.message==`string`?e.message:`Cypher query failed.`:typeof e.error==`string`?e.error:e.error===null||e.error===void 0?null:j(e.error)?typeof e.error.message==`string`?e.error.message:typeof e.error.code==`string`?`Cypher query failed (${e.error.code}).`:`Cypher query failed.`:`Cypher query failed.`:null}function Qn(e){if(!Array.isArray(e.reasoning_trace))return null;let t=e.reasoning_trace;for(let n=t.length-1;n>=0;--n){let r=t[n];if(j(r)&&j(r.payload)&&Array.isArray(r.payload.rows)&&r.payload.rows.every(j))return P(r.payload.rows,e,r.payload)}return null}function $n(e){if(Array.isArray(e))return e.every(j)?{payload:P(e,e),error:null}:{payload:null,error:`Cypher route returned a non-row result.`};if(!j(e))return{payload:null,error:`Cypher route returned an invalid result shape.`};if(Array.isArray(e.rows))return e.rows.every(j)?{payload:P(e.rows,e),error:null}:{payload:null,error:`Cypher route returned a non-row result.`};let t=Qn(e);return t?{payload:t,error:null}:{payload:null,error:`Cypher response did not expose its raw query rows.`}}function er(e){let t=e.errors?Object.keys(e.errors):[],n=e.metadata?.degradedGraphs??[];if(t.length>0)return`Some graph query targets failed: ${t.join(`, `)}`;if(n.length>0)return`Skipped graphs: ${n.join(`, `)}`;let r=e.metadata?.raw;return j(r)&&r.partial===!0?`The graph query returned a partial result.`:null}var tr=t({CypherCompileError:()=>I,CypherSafetyError:()=>L,SERVER_RESULT_LIMIT:()=>256,TYPE_LIMIT:()=>200,boundedLimit:()=>R,compileCypher:()=>z,countTypes:()=>fr,escapeCypherString:()=>B,rawQueryError:()=>G,requestBody:()=>yr,schemaTree:()=>V,terminalLimit:()=>H}),nr=`cypher`,rr=/\b(?:call|create|delete|detach|drop|foreach|load\s+csv|merge|remove|set|use)\b/i,F={id:`n.id`,name:`n.name`,type:`n.node_type`,node_type:`n.node_type`},I=class extends Error{constructor(e){super(e),this.name=`CypherCompileError`}},L=class extends Error{constructor(e){super(e),this.name=`CypherSafetyError`}},ir={eq:(e,t)=>`${e} = $${t}`,neq:(e,t)=>`${e} != $${t}`,contains:(e,t)=>`toLower(${e}) CONTAINS toLower($${t})`};function R(e,t){let n=Number.isFinite(t)?Math.max(0,Math.floor(t)):0,r=Number.isFinite(e.limit)?Math.floor(e.limit):n;return Math.max(0,Math.min(r,n,256))}function ar(e){return typeof e==`string`?F[e.toLowerCase()]??null:null}function or(e,t,n){let r=ar(e.field),i=ir[e.op];if(!r)throw new I(`Unsupported Cypher filter field: ${e.field}`);if(!i)throw new I(`Unsupported Cypher filter operator: ${e.op}`);let a=`atlas_filter_${String(t)}`;return n[a]=e.value??``,i(r,a)}function sr(e,t){let n=e.trim();return n?(t.atlas_search=n,[F.id,F.name,F.type].map(e=>`toLower(${e}) CONTAINS toLower($atlas_search)`).join(` OR `)):null}function cr(e,t){let n=e.clauses.map((e,n)=>or(e,n,t)),r=n.length>0?`(${n.join(e.combinator===`or`?` OR `:` AND `)})`:null,i=sr(e.search,t),a=[r,i?`(${i})`:null].filter(e=>e!==null);return a.length>0?`\nWHERE ${a.join(` AND `)}`:``}function lr(e){if(!e)return``;let t=ar(e.field);if(!t)throw new I(`Unsupported Cypher sort field: ${e.field}`);return`\nORDER BY ${t} ${e.direction.toUpperCase()}`}function z({filters:e,ctx:t}){let n={},r=R(e,t.limit);return{text:`MATCH (n)${cr(e,n)}\nRETURN n.id AS id, n.name AS name, n.node_type AS type${lr(e.sort)}\nLIMIT ${String(r)}`,params:n,graph:t.graph,limit:r}}function B(e){return`'${e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\r/g,`\\r`).replace(/\n/g,`\\n`)}'`}function ur(e){return Object.entries(e).filter(([,e])=>Number.isFinite(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>({id:`type:${e}`,label:e,kind:`collection`,count:t,seedQuery:`MATCH (n) WHERE n.node_type = ${B(e)} RETURN n.id AS id, n.name AS name, n.node_type AS type LIMIT 200`}))}var dr=[{id:`id`,label:`id`,kind:`field`,dataType:`string`},{id:`name`,label:`name`,kind:`field`,dataType:`string`},{id:`type`,label:`type (node_type)`,kind:`field`,dataType:`string`}];function V(e,t){return{adapterId:nr,roots:[{id:`types`,label:`Node types`,kind:`source`,children:ur(e)},{id:`fields`,label:`Fields`,kind:`source`,children:dr}],unavailable:!1,note:t}}function fr(e){let t={};for(let n of e){let e=typeof n.type==`string`?n.type:null,r=typeof n.count==`number`?n.count:Number(n.count);e&&Number.isFinite(r)&&(t[e]=r)}return t}function H(e){let t=vr(e).trim();if(t===``||t.includes(`;`)||/\bunion\b/i.test(t)||t.match(/\blimit\b/gi)?.length!==1)return null;let n=/\blimit\s+([0-9]+)\s*$/i.exec(t);if(!n)return null;let r=Number(n[1]);return Number.isSafeInteger(r)?r:null}function pr(e){return{"'":`single-quote`,'"':`double-quote`,"`":`backtick`}[e]??`plain`}function U(e){return e===`
|
|
2
2
|
`?`
|
|
3
3
|
`:` `}var mr=(e,t)=>{if(e===`/`&&t===`/`)return{masked:` `,state:`line-comment`,skipNext:!0};if(e===`/`&&t===`*`)return{masked:` `,state:`block-comment`,skipNext:!0};let n=e===void 0?`plain`:pr(e);return n===`plain`?{masked:e??``,state:n,skipNext:!1}:{masked:` `,state:n,skipNext:!1}},hr=e=>({masked:U(e),state:e===`
|
|
4
4
|
`?`plain`:`line-comment`,skipNext:!1}),gr=(e,t)=>e===`*`&&t===`/`?{masked:` `,state:`plain`,skipNext:!0}:{masked:U(e),state:`block-comment`,skipNext:!1};function W(e,t,n,r){return n===`\\`||n===t&&r===t?{masked:` `,state:e,skipNext:!0}:{masked:U(n),state:n===t?`plain`:e,skipNext:!1}}function _r(e,t,n){switch(e){case`line-comment`:return hr(t,n);case`block-comment`:return gr(t,n);case`single-quote`:return W(e,`'`,t,n);case`double-quote`:return W(e,`"`,t,n);case`backtick`:return W(e,"`",t,n);default:return mr(t,n)}}function vr(e){let t=``,n=`plain`;for(let r=0;r<e.length;r+=1){let i=_r(n,e[r],e[r+1]);t+=i.masked,n=i.state,i.skipNext&&(r+=1)}return t}function G(e,t){if(rr.test(vr(e.text)))return`Atlas accepts read-only Cypher clauses only; writes, procedures, imports, and graph-context changes are disabled.`;let n=H(e.text);if(n===null)return`Raw Cypher is disabled until the query has one terminal literal LIMIT (for example, LIMIT 100).`;let r=Number.isFinite(t)?Math.min(Math.max(0,Math.floor(t)),256):0;return n>r?`Raw Cypher LIMIT ${String(n)} exceeds the active cap of ${String(r)}.`:e.limit===n?null:`The query limit changed after it was parsed; run it again to refresh the safety check.`}function yr(e,t){return{query:e.text,params:JSON.stringify(e.params),scope:`local`,graph:t??``}}var br=t({CypherCompileError:()=>I,CypherSafetyError:()=>L,compileCypher:()=>z,default:()=>Lr}),K=`cypher`,xr=`/api/graph/query`,Sr=`/api/enhanced/graph/node-types`,Cr={introspect:!0,filters:Ke,freeTextSearch:!0,sort:!0,rawQuery:!0,rawQueryLanguage:`cypher`,graphProjection:!0,pivots:!0,live:!1,notes:{filters:`Facet filters push down into generated Cypher over id, name, and node_type. Unsupported fields/operators are rejected before execution.`,graphProjection:`Rows project as nodes; columns ending in _id become heuristic links when they match another row id.`,limit:`Generated and raw queries carry one terminal server-side LIMIT (at most 256, the governed route ceiling). Atlas never slices raw rows in the browser; truncation is shown only when the backend reports it.`,rawQuery:`Raw Cypher is enabled only for a single statement with one terminal literal LIMIT at or below the active cap. Unsafe text is rejected before network execution.`}};function q(e,t,n){return{adapterId:K,shape:`empty`,payload:{rows:[],connection:null,graph:null,errors:null,...n?{metadata:n}:{}},stats:{elapsedMs:t,rowCount:0,truncated:!1},degraded:e,sources:[]}}function wr(e,t){let n=e.rows,r=e.metadata?.truncated===!0||e.metadata?.hasMore===!0;return{adapterId:K,shape:n.length>0?`rows`:`empty`,payload:e,stats:{elapsedMs:t,rowCount:n.length,truncated:r,note:r?`The graph backend reported that this result is incomplete.`:void 0},degraded:er(e),sources:e.metadata?.sourceGraphs??[]}}function Tr(e,t){if(!e.ok||e.data===null)return q(e.error??`The Cypher graph surface is not reachable.`,t);let n=Zn(e.data);if(n!==null)return q(n,t);let r=$n(e.data);return r.payload?wr(r.payload,t):q(r.error??`Cypher result could not be read.`,t)}async function Er({query:e,ctx:t,signal:n}){let r=G(e,t.limit);if(r!==null)return q(r,0);let i=Date.now();return Tr(await b(xr,yr(e,t.graph),n,Un),Date.now()-i)}function Dr(e){return[...new Set(e.flatMap(e=>Object.keys(e)))].map(e=>({key:e,label:e,type:`unknown`}))}function Or(e){return{columns:Dr(e.payload.rows),rows:e.payload.rows}}function kr(e){let t=Or(e),n=new Set(t.columns.map(e=>e.key));return Je(t,{labelColumn:n.has(`name`)?`name`:void 0,typeColumn:n.has(`type`)?`type`:n.has(`node_type`)?`node_type`:void 0,linkColumns:t.columns.map(e=>e.key).filter(e=>/_id$/i.test(e)&&e.toLowerCase()!==`id`),defaultType:`Cypher row`})}function Ar(e){return/^(?:https?:|urn:)[^<>\s]+$/i.test(e)}function jr({selection:e}){let t=[],n=typeof e.data.type==`string`?e.data.type:typeof e.data.node_type==`string`?e.data.node_type:e.type;return n&&t.push({id:`cypher:type:${n}`,label:`All ${n} nodes in Cypher`,description:`Run a bounded Cypher read for this node type.`,targetAdapterId:K,filters:{...y,clauses:[{id:`pivot-type`,field:`type`,op:`eq`,value:n}]}}),Ar(e.id)&&t.push({id:`sparql:describe:${e.id}`,label:`Describe in SPARQL`,description:`Open this IRI in the RDF modality.`,targetAdapterId:`sparql`,filters:y,seedQuery:`SELECT ?s ?p ?o WHERE { <${e.id}> ?p ?o } LIMIT 100`}),e.id&&t.unshift({id:`cypher:node:${e.id}`,label:`Inspect this node in Cypher`,description:`Fetch the selected node by its stable id.`,targetAdapterId:K,filters:y,seedQuery:`MATCH (n) WHERE n.id = ${B(e.id)} RETURN n.id AS id, n.name AS name, n.node_type AS type LIMIT 1`}),t}async function Mr(e,t){let n=Math.min(200,R(y,e.ctx.limit)),r=await Er({query:{text:`MATCH (n) WHERE n.node_type IS NOT NULL RETURN n.node_type AS type, count(*) AS count ORDER BY count DESC LIMIT ${String(n)}`,params:{},graph:t,limit:n},ctx:e.ctx,signal:e.signal});return r.degraded?{adapterId:K,roots:[],unavailable:!0,note:r.degraded}:V(fr(r.payload.rows))}function Nr(e){let t=[e.degraded_graphs?.length?`Skipped graphs: ${e.degraded_graphs.join(`, `)}`:null,e.truncated?`Only the first 200 node types are shown.`:null].filter(e=>e!==null);return t.length>0?t.join(` `):void 0}function Pr(e){return!e.ok||!e.data?{adapterId:K,roots:[],unavailable:!0,note:e.error??`Node-type introspection is unavailable.`}:e.data.available===!1?{adapterId:K,roots:[],unavailable:!0,note:`The graph engine cannot enumerate node types yet.`}:e.data.by_type===void 0?{adapterId:K,roots:[],unavailable:!0,note:`Node-type introspection returned no breakdown.`}:V(e.data.by_type,Nr(e.data))}async function Fr(e){return Pr(await x(Sr,e,Wn))}async function Ir(e){return e.ctx.graph===null?Fr(e.signal):Mr(e,e.ctx.graph)}var Lr={id:K,label:`Cypher / Property Graph`,description:`Read and project the property graph through the governed Cypher surface.`,icon:Ie,capabilities:()=>Cr,introspect:Ir,compile:z,describe:e=>e.text,parse:({text:e,ctx:t})=>{let n=H(e),r={text:e,params:{},graph:t.graph,limit:n},i=G(r,t.limit);if(i!==null)throw new L(i);return r},execute:Er,toRows:Or,toGraph:kr,pivots:jr},Rr=t({default:()=>$r}),J=`graph`,zr=`/api/enhanced/graph/graph3d`,Br=`/api/enhanced/graph/node-types`,Vr={introspect:!0,filters:Ke,freeTextSearch:!0,sort:!0,rawQuery:!1,graphProjection:!0,pivots:!0,live:!1,notes:{filters:`Filters are applied in the browser to the nodes this route returned — the route accepts no filter parameter yet, so a match count describes the returned page, not the whole graph.`,rawQuery:`This modality has no text query language here. Use the Cypher Console for arbitrary Cypher.`}};function Hr(e){return Object.entries(e).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>({id:`type:${e}`,label:e,kind:`collection`,count:t}))}var Ur=[{id:`name`,label:`name`,kind:`field`,dataType:`string`},{id:`type`,label:`type`,kind:`field`,dataType:`string`},{id:`id`,label:`id`,kind:`field`,dataType:`string`},{id:`degree`,label:`degree`,kind:`field`,dataType:`number`}];async function Wr({signal:e}){let t=await x(Br,e),n=t.data?.by_type;return!t.ok||!n?{adapterId:J,roots:[],unavailable:!0,note:t.error??`Node-type breakdown is not served here.`}:{adapterId:J,roots:[{id:`types`,label:`Node types`,kind:`source`,children:Hr(n)},{id:`fields`,label:`Fields`,kind:`source`,children:Ur}],unavailable:!1}}function Gr(e){let t=new Uint32Array(e.nodes.length),n=e=>e>=0&&e<t.length;for(let r of e.edges)n(r.s)&&(t[r.s]+=1),n(r.t)&&(t[r.t]+=1);return e.nodes.map((e,n)=>({id:e.id,name:e.name,type:e.type,degree:t[n]}))}function Kr(e,t){return e.edges.flatMap(n=>{let r=e.nodes[n.s]?.id,i=e.nodes[n.t]?.id;return!r||!i||!t.has(r)||!t.has(i)?[]:[{source:r,target:i,type:n.r,weight:n.w}]})}function qr(e,t){return{adapterId:J,shape:`graph`,payload:{nodes:[],edges:[],serverNodeCount:0,truncated:!1},stats:{elapsedMs:t,rowCount:0,truncated:!1},degraded:e,sources:[]}}async function Jr({query:e,signal:t}){let n=Date.now(),r=`${zr}?include_isolated=${e.includeIsolated?`true`:`false`}`,i=await x(r,t,it),a=i.data;if(!i.ok||!a)return qr(i.error??`The graph engine is not reachable.`,Date.now()-n);if(!a.available)return qr(`The graph engine is not reachable yet.`,Date.now()-n);let o=kt(Gr(a),e.filters);return{adapterId:J,shape:`graph`,payload:{nodes:o,edges:Kr(a,new Set(o.map(e=>e.id))),serverNodeCount:a.nodes.length,truncated:a.truncated},stats:{elapsedMs:Date.now()-n,rowCount:o.length,truncated:a.truncated||o.length<a.nodes.length,note:o.length<a.nodes.length?`${String(o.length)} of ${String(a.nodes.length)} returned nodes matched in the browser.`:void 0},degraded:a.degraded_graphs.length>0?`Skipped graphs: ${a.degraded_graphs.join(`, `)}`:null,sources:a.source_graphs}}function Yr(e){return{columns:[{key:`id`,label:`id`,type:`string`},{key:`name`,label:`name`,type:`string`},{key:`type`,label:`type`,type:`string`},{key:`degree`,label:`degree`,type:`number`}],rows:e.payload.nodes}}function Xr(e){return{nodes:e.payload.nodes.map(e=>({id:e.id,label:e.name||e.id,type:e.type,properties:e})),edges:e.payload.edges.map(e=>({source:e.source,target:e.target,type:e.type,weight:e.weight})),truncated:e.payload.truncated}}function Zr(e){return/^(https?:|urn:)\S+$/i.test(e)}function Qr({selection:e}){let t=[],n=typeof e.data.type==`string`?e.data.type:e.type;return n&&t.push({id:`graph:type:${n}`,label:`All ${n} nodes`,description:`Re-run this modality filtered to the selected node type.`,targetAdapterId:J,filters:{...y,clauses:[{id:`pivot-type`,field:`type`,op:`eq`,value:n}]}}),Zr(e.id)&&t.push({id:`sparql:describe:${e.id}`,label:`Describe in SPARQL`,description:`Open this entity in the RDF modality and list its predicates.`,targetAdapterId:`sparql`,filters:y,seedQuery:`SELECT ?p ?o WHERE { <${e.id}> ?p ?o } LIMIT 100`}),t}var $r={id:J,label:`Knowledge Graph`,description:`Entities and the relationships between them, as the engine stores them.`,icon:he,capabilities:()=>Vr,introspect:Wr,compile:({filters:e})=>({includeIsolated:!1,filters:e}),describe:e=>`nodes ${jt(e.filters)}`,execute:Jr,toRows:Yr,toGraph:Xr,pivots:Qr},ei=t({compileSparql:()=>ci,default:()=>xi,escapeSparqlLiteral:()=>X}),Y=`sparql`,ti=`/api/sparql`,ni=`SELECT DISTINCT ?class WHERE { ?s a ?class } LIMIT 100`,ri={introspect:!0,filters:[`eq`,`neq`,`contains`,`startsWith`],freeTextSearch:!0,sort:!1,rawQuery:!0,rawQueryLanguage:`sparql`,graphProjection:!0,pivots:!0,live:!1,notes:{sort:`Use ORDER BY in the query text; the facet sort does not map onto bound variables.`,filters:`Filters compile into FILTER clauses on ?s / ?p / ?o and run server-side.`}};function X(e){return v(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`)}function ii(e){let t=e.toLowerCase();return t===`s`||t===`subject`?`?s`:t===`p`||t===`predicate`?`?p`:`?o`}var ai={eq:(e,t)=>`STR(${e}) = "${t}"`,neq:(e,t)=>`STR(${e}) != "${t}"`,contains:(e,t)=>`CONTAINS(LCASE(STR(${e})), LCASE("${t}"))`,startsWith:(e,t)=>`STRSTARTS(LCASE(STR(${e})), LCASE("${t}"))`};function oi(e){let t=ai[e.op];return t?t(ii(e.field),X(e.value)):null}function si(e){let t=e.trim();if(t===``)return null;let n=X(t);return`CONTAINS(LCASE(STR(?o)), LCASE("${n}")) || CONTAINS(LCASE(STR(?s)), LCASE("${n}"))`}function ci({filters:e,ctx:t}){let n=[e.clauses.map(oi).filter(e=>e!==null).join(e.combinator===`or`?` || `:` && `),si(e.search)].filter(e=>e!==null&&e!==``),r=n.length>0?`\n FILTER(${n.map(e=>`(${e})`).join(` && `)})`:``,i=Math.min(e.limit,t.limit);return{text:`SELECT ?s ?p ?o WHERE {\n ?s ?p ?o.${r}\n} LIMIT ${String(i)}`}}var li=[{id:`s`,label:`?s (subject)`,kind:`field`,dataType:`string`},{id:`p`,label:`?p (predicate)`,kind:`field`,dataType:`string`},{id:`o`,label:`?o (object)`,kind:`field`,dataType:`string`}];function ui(e){return`SELECT ?s ?p ?o WHERE {\n ?s a <${e}>.\n ?s ?p ?o.\n} LIMIT 200`}var di={vars:[],bindings:[]};function fi(e){if(!e.ok||!e.data)return e.error??`SPARQL bridge unreachable.`;let{status:t,message:n}=e.data;return t!==void 0&&t!==`success`?n??`SPARQL query failed.`:null}function pi(e){return{vars:e.head?.vars??[],bindings:e.results?.bindings??[]}}async function mi(e,t){let n=await b(ti,{query:e},t),r=fi(n);return r!==null||!n.data?{payload:di,error:r??`SPARQL bridge unreachable.`}:{payload:pi(n.data),error:null}}async function hi({signal:e}){let{payload:t,error:n}=await mi(ni,e);return n===null?{adapterId:Y,roots:[{id:`classes`,label:`Classes`,kind:`source`,children:t.bindings.flatMap(e=>{let t=e.class?.value;return t?[{id:`class:${t}`,label:t,kind:`collection`,seedQuery:ui(t)}]:[]})},{id:`fields`,label:`Bound variables`,kind:`source`,children:li}],unavailable:!1}:{adapterId:Y,roots:[],unavailable:!0,note:n}}async function gi({query:e,signal:t}){let n=Date.now(),{payload:r,error:i}=await mi(e.text,t);return{adapterId:Y,shape:r.bindings.length===0?`empty`:`rows`,payload:r,stats:{elapsedMs:Date.now()-n,rowCount:r.bindings.length,truncated:!1},degraded:i,sources:[]}}function Z(e){return e?.value??``}function _i(e){let t=e.payload.vars;return{columns:t.map(e=>({key:e,label:`?${e}`,type:`string`})),rows:e.payload.bindings.map(e=>Object.fromEntries(t.map(t=>[t,Z(e[t])])))}}function vi(e){return e.includes(`s`)&&e.includes(`p`)&&e.includes(`o`)?[`s`,`p`,`o`]:e.length===3?[e[0],e[1],e[2]]:null}function yi(e){let t=vi(e.payload.vars);if(!t)return{nodes:[],edges:[],truncated:!1,note:`This projection needs a triple-shaped result — select ?s ?p ?o (or exactly three variables).`};let[n,r,i]=t;return $e(e.payload.bindings.map(e=>({subject:Z(e[n]),predicate:Z(e[r]),object:Z(e[i])})))}function bi({selection:e}){return/^(https?:|urn:)\S+$/i.test(e.id)?[{id:`sparql:describe:${e.id}`,label:`Describe this resource`,description:`Every predicate and object asserted about the selected IRI.`,targetAdapterId:Y,filters:y,seedQuery:`SELECT ?s ?p ?o WHERE {\n VALUES ?s { <${e.id}> }\n ?s ?p ?o.\n} LIMIT 200`}]:[]}var xi={id:Y,label:`SPARQL / RDF`,description:`The OWL/RDF side of the graph, queried with SPARQL 1.1.`,icon:Re,capabilities:()=>ri,introspect:hi,compile:ci,describe:e=>e.text,parse:({text:e})=>({text:e}),execute:gi,toRows:_i,toGraph:yi,pivots:bi},Si=t({compileSql:()=>Fi,default:()=>Zi}),Q=`sql`,Ci=`/api/graph/sql-schema`,wi=`/api/graph/table`,Ti=50,Ei={introspect:!0,filters:We,freeTextSearch:!0,sort:!0,rawQuery:!0,rawQueryLanguage:`sql`,graphProjection:!0,pivots:!0,live:!1,notes:{filters:`Filters push down into the catalog listing (table_schema / table_name / table_type). Open a table to edit its SELECT directly — this modality has no column-level filter pushdown into arbitrary tables.`,graphProjection:`The catalog does not track foreign keys yet (design §4): columns named "*_id" are treated as heuristic links, not confirmed foreign keys.`}},Di=new Set([`table_schema`,`table_name`,`table_type`]);function Oi(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`?String(e):JSON.stringify(e)}function $(e){return`'${Oi(e).replace(/'/g,`''`)}'`}function ki(e){return(Array.isArray(e)?e:[e]).map($).join(`, `)}var Ai={eq:(e,t)=>`${e} = ${$(t.value)}`,neq:(e,t)=>`${e} != ${$(t.value)}`,contains:(e,t)=>`${e} ILIKE '%' || ${$(t.value)} || '%'`,startsWith:(e,t)=>`${e} ILIKE ${$(t.value)} || '%'`,gt:(e,t)=>`${e} > ${$(t.value)}`,gte:(e,t)=>`${e} >= ${$(t.value)}`,lt:(e,t)=>`${e} < ${$(t.value)}`,lte:(e,t)=>`${e} <= ${$(t.value)}`,in:(e,t)=>`${e} IN (${ki(t.value)})`,exists:e=>`${e} IS NOT NULL`,missing:e=>`${e} IS NULL`};function ji(e){return Di.has(e.field)?Ai[e.op](e.field,e):null}function Mi(e){let t=e.trim();if(t===``)return null;let n=$(t);return`(table_name ILIKE '%' || ${n} || '%' OR table_schema ILIKE '%' || ${n} || '%')`}function Ni(e){let t=e.filters.clauses.map(ji).filter(e=>e!==null),n=Mi(e.filters.search),r=n?[...t,n]:t;if(r.length===0)return``;let i=e.filters.combinator===`or`?` OR `:` AND `;return`\nWHERE ${r.join(i)}`}function Pi(e){return!e||!Di.has(e.field)?`
|