titan-agent 6.5.3 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +200 -47
- package/assets/agent-skills/NOTICE-ECC.md +39 -0
- package/assets/agent-skills/agent-introspection-debugging/SKILL.md +153 -0
- package/assets/agent-skills/continuous-agent-loop/SKILL.md +45 -0
- package/assets/agent-skills/continuous-learning/SKILL.md +131 -0
- package/assets/agent-skills/continuous-learning/config.json +18 -0
- package/assets/agent-skills/continuous-learning/evaluate-session.sh +69 -0
- package/assets/agent-skills/production-audit/SKILL.md +206 -0
- package/assets/agent-skills/recursive-decision-ledger/SKILL.md +79 -0
- package/assets/agent-skills/scientific-thinking-literature-review/SKILL.md +192 -0
- package/assets/agent-skills/scientific-thinking-scholar-evaluation/SKILL.md +160 -0
- package/assets/agent-skills/verification-loop/SKILL.md +126 -0
- package/dist/agent/agent.js +104 -29
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/agentLoop.js +6 -2
- package/dist/agent/agentLoop.js.map +1 -1
- package/dist/agent/autoModeClassifier.js +26 -2
- package/dist/agent/autoModeClassifier.js.map +1 -1
- package/dist/agent/contextManager.js +1 -1
- package/dist/agent/contextManager.js.map +1 -1
- package/dist/agent/goalDriver.js +2 -0
- package/dist/agent/goalDriver.js.map +1 -1
- package/dist/agent/goalSpec.js +229 -0
- package/dist/agent/goalSpec.js.map +1 -0
- package/dist/agent/heartbeat.js +130 -0
- package/dist/agent/heartbeat.js.map +1 -0
- package/dist/agent/missionDecompose.js +38 -0
- package/dist/agent/missionDecompose.js.map +1 -0
- package/dist/agent/muscleMemory.js +291 -0
- package/dist/agent/muscleMemory.js.map +1 -0
- package/dist/agent/observationWriter.js +56 -0
- package/dist/agent/observationWriter.js.map +1 -0
- package/dist/agent/promptSectionCaps.js +6 -0
- package/dist/agent/promptSectionCaps.js.map +1 -1
- package/dist/agent/reminders.js +101 -0
- package/dist/agent/reminders.js.map +1 -0
- package/dist/agent/systemWidgets.js +41 -0
- package/dist/agent/systemWidgets.js.map +1 -0
- package/dist/agent/toolRunner.js +24 -0
- package/dist/agent/toolRunner.js.map +1 -1
- package/dist/agent/toolSearch.js +12 -2
- package/dist/agent/toolSearch.js.map +1 -1
- package/dist/channels/messenger.js +39 -0
- package/dist/channels/messenger.js.map +1 -1
- package/dist/config/config.js +7 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/schema.js +36 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/eval/harness.js +17 -4
- package/dist/eval/harness.js.map +1 -1
- package/dist/gateway/onboarding.js +91 -0
- package/dist/gateway/onboarding.js.map +1 -0
- package/dist/gateway/routes/skills.js +2 -1
- package/dist/gateway/routes/skills.js.map +1 -1
- package/dist/gateway/routes/studioRouter.js +88 -0
- package/dist/gateway/routes/studioRouter.js.map +1 -0
- package/dist/gateway/routes/watchRouter.js +4 -4
- package/dist/gateway/routes/watchRouter.js.map +1 -1
- package/dist/gateway/server.js +270 -46
- package/dist/gateway/server.js.map +1 -1
- package/dist/gateway/slashCommands.js +31 -0
- package/dist/gateway/slashCommands.js.map +1 -1
- package/dist/mcp/agentTools.js +135 -0
- package/dist/mcp/agentTools.js.map +1 -0
- package/dist/mcp/server.js +19 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/memory/graph.js +2 -0
- package/dist/memory/graph.js.map +1 -1
- package/dist/memory/taxonomy.js +117 -0
- package/dist/memory/taxonomy.js.map +1 -0
- package/dist/providers/errorTaxonomy.js +4 -0
- package/dist/providers/errorTaxonomy.js.map +1 -1
- package/dist/providers/moa.js +151 -0
- package/dist/providers/moa.js.map +1 -0
- package/dist/providers/modelCapabilities.js +78 -2
- package/dist/providers/modelCapabilities.js.map +1 -1
- package/dist/providers/ollama.js +9 -2
- package/dist/providers/ollama.js.map +1 -1
- package/dist/providers/openai.js +1 -1
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/openai_compat.js +52 -4
- package/dist/providers/openai_compat.js.map +1 -1
- package/dist/providers/router.js +16 -0
- package/dist/providers/router.js.map +1 -1
- package/dist/recipes/runner.js +8 -1
- package/dist/recipes/runner.js.map +1 -1
- package/dist/recipes/store.js +2 -1
- package/dist/recipes/store.js.map +1 -1
- package/dist/skills/builtin/codebase_explore.js +214 -0
- package/dist/skills/builtin/codebase_explore.js.map +1 -0
- package/dist/skills/builtin/config_audit.js +160 -0
- package/dist/skills/builtin/config_audit.js.map +1 -0
- package/dist/skills/builtin/delegate_agent.js +107 -0
- package/dist/skills/builtin/delegate_agent.js.map +1 -0
- package/dist/skills/builtin/memory_map.js +38 -0
- package/dist/skills/builtin/memory_map.js.map +1 -0
- package/dist/skills/builtin/reminders.js +67 -0
- package/dist/skills/builtin/reminders.js.map +1 -0
- package/dist/skills/builtin/spec.js +139 -0
- package/dist/skills/builtin/spec.js.map +1 -0
- package/dist/skills/builtin/widget_gallery.js +12 -5
- package/dist/skills/builtin/widget_gallery.js.map +1 -1
- package/dist/skills/frontmatterLoader.js +7 -1
- package/dist/skills/frontmatterLoader.js.map +1 -1
- package/dist/skills/registry.js +12 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/substrate/traceBus.js.map +1 -1
- package/dist/telemetry/traceStore.js +127 -0
- package/dist/telemetry/traceStore.js.map +1 -0
- package/dist/utils/benchMode.js +8 -0
- package/dist/utils/benchMode.js.map +1 -0
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/contrast.js +69 -0
- package/dist/utils/contrast.js.map +1 -0
- package/dist/watch/sessionContext.js +14 -0
- package/dist/watch/sessionContext.js.map +1 -0
- package/dist/watch/sessionTrace.js +51 -0
- package/dist/watch/sessionTrace.js.map +1 -0
- package/dist/watch/studioBuffer.js +53 -0
- package/dist/watch/studioBuffer.js.map +1 -0
- package/package.json +29 -28
- package/ui/dist/assets/AboutYouMemory-57X5SqHQ.js +1 -0
- package/ui/dist/assets/AuditPanel-AyB8ciLZ.js +1 -0
- package/ui/dist/assets/AutonomyPanel-wmVPr-n3.js +1 -0
- package/ui/dist/assets/AutopilotPanel-CbLy4lJP.js +1 -0
- package/ui/dist/assets/AutoresearchPanel-DxRO1rBF.js +1 -0
- package/ui/dist/assets/BackupPanel-BUh9rQ-3.js +1 -0
- package/ui/dist/assets/BrowserPanel-OqKwGrIL.js +1 -0
- package/ui/dist/assets/CPActivity-DGfS7EY3.js +1 -0
- package/ui/dist/assets/CPAgentDetail-p0Kvzhhb.js +1 -0
- package/ui/dist/assets/CPAgents-B6wSSQZM.js +1 -0
- package/ui/dist/assets/CPApprovals-CYv9Do0i.js +1 -0
- package/ui/dist/assets/CPCosts-Dx6Q71rN.js +1 -0
- package/ui/dist/assets/CPDashboard-DA8-tE-l.js +1 -0
- package/ui/dist/assets/CPFiles-BJ49tzai.js +1 -0
- package/ui/dist/assets/CPGoals-h0dKL5V_.js +1 -0
- package/ui/dist/assets/CPInbox-CDvefgNH.js +1 -0
- package/ui/dist/assets/CPIssueDetail-CnmLzzDD.js +1 -0
- package/ui/dist/assets/CPIssues-DknAIMyl.js +1 -0
- package/ui/dist/assets/CPLayout-C2nqgkmY.js +2 -0
- package/ui/dist/assets/CPOrg-tDbHFphX.js +1 -0
- package/ui/dist/assets/CPRuns-UlrIURqG.js +1 -0
- package/ui/dist/assets/CPSocial-B-gHgvEw.js +1 -0
- package/ui/dist/assets/CPVoice-CJy938ZF.js +1 -0
- package/ui/dist/assets/ChannelsPanel-DLbxg1zO.js +1 -0
- package/ui/dist/assets/CheckpointsPanel-BB6TT0aE.js +1 -0
- package/ui/dist/assets/CommandPostHub-fIslwU_t.js +2 -0
- package/ui/dist/assets/ConfirmDialog-6hcNjmAh.js +9 -0
- package/ui/dist/assets/CronPanel-DLpw3Y25.js +1 -0
- package/ui/dist/assets/DataTable-KVqtDzvP.js +1 -0
- package/ui/dist/assets/DreamPanel-lcMXpbEb.js +5 -0
- package/ui/dist/assets/EmptyState-D-Dg8B8r.js +1 -0
- package/ui/dist/assets/EvalHarnessPanel-BKzRiiQw.js +2 -0
- package/ui/dist/assets/EvalPanel-Dtodacmj.js +1 -0
- package/ui/dist/assets/FileViewer-DjcVKkO2.js +60 -0
- package/ui/dist/assets/FilesPanel-BI90Pplh.js +1 -0
- package/ui/dist/assets/FleetPanel-tr0wjAwr.js +1 -0
- package/ui/dist/assets/HomelabPanel-m8vMm5rE.js +1 -0
- package/ui/dist/assets/InfraView-3WriJnyE.js +2 -0
- package/ui/dist/assets/IntegrationsPanel-BmL70fOw.js +1 -0
- package/ui/dist/assets/IntelligenceView-BGVxCKD3.js +2 -0
- package/ui/dist/assets/LearningPanel-CrYLQ6eV.js +1 -0
- package/ui/dist/assets/LiveStudio-CnW3eZYF.js +2 -0
- package/ui/dist/assets/LogsPanel-DbShr4Ic.js +1 -0
- package/ui/dist/assets/McpPanel-uMYEsPI4.js +1 -0
- package/ui/dist/assets/MemoryGraphPanel-C7-Z8f0v.js +1 -0
- package/ui/dist/assets/MemoryTaxonomyPanel-KrxN8U1G.js +1 -0
- package/ui/dist/assets/MemoryWikiPanel-DI3q6IHC.js +1 -0
- package/ui/dist/assets/MeshPanel-D4-g2tlu.js +1 -0
- package/ui/dist/assets/MissionCanvas-D8cjakJe.js +61 -0
- package/ui/dist/assets/MissionChat-BvqCUf1E.js +3 -0
- package/ui/dist/assets/MissionLibrary-CZoJQ9WD.js +1 -0
- package/ui/dist/assets/MissionStart-CXCq-_AD.js +1 -0
- package/ui/dist/assets/NvidiaPanel-BfI1K5Pg.js +1 -0
- package/ui/dist/assets/OrganismPanel-B7Gm9pP-.js +1 -0
- package/ui/dist/assets/OverviewPanel-B9tKWRK2.js +1 -0
- package/ui/dist/assets/PageHeader-CH85uoZG.js +1 -0
- package/ui/dist/assets/PersonaProfilesPanel-BPi8fl-U.js +3 -0
- package/ui/dist/assets/PersonasPanel-Dwr7sycT.js +1 -0
- package/ui/dist/assets/PhoneDeskPanel-D7qc6wUI.js +1 -0
- package/ui/dist/assets/RecipesPanel-DcqPWRSU.js +1 -0
- package/ui/dist/assets/SecurityPanel-Bv_B9Ahf.js +1 -0
- package/ui/dist/assets/SelfImprovePanel-Ca4rGwEG.js +1 -0
- package/ui/dist/assets/SelfProposalsPanel-DteMSASq.js +1 -0
- package/ui/dist/assets/SessionsPanel-BdbbKTbL.js +1 -0
- package/ui/dist/assets/SessionsTab-BJipiVJs.js +1 -0
- package/ui/dist/assets/SettingsPanel-mV7ykOCc.js +1 -0
- package/ui/dist/assets/SettingsView-Bu_wYTT5.js +2 -0
- package/ui/dist/assets/SkeletonLoader-9H7QWa9E.js +1 -0
- package/ui/dist/assets/SkillsPanel-CHwX2kDR.js +1 -0
- package/ui/dist/assets/SomaView-Bpsm4ZW7.js +5 -0
- package/ui/dist/assets/SomaView-Dghh9om4.css +1 -0
- package/ui/dist/assets/StatCard-wmSgMAM3.js +1 -0
- package/ui/dist/assets/TeamsPanel-XJiHxdDX.js +1 -0
- package/ui/dist/assets/TelemetryPanel-_pmGVxpO.js +1 -0
- package/ui/dist/assets/TitanCanvas-Cb7KG80W.css +1 -0
- package/ui/dist/assets/TitanCanvas-CmLy7p2N.js +883 -0
- package/ui/dist/assets/ToolsView-PHizHZBx.js +2 -0
- package/ui/dist/assets/TraceViewer-CYAzIcfB.js +1 -0
- package/ui/dist/assets/TracesPanel-CRSN_dzK.js +1 -0
- package/ui/dist/assets/TrainingPanel-B9rcuMsV.js +1 -0
- package/ui/dist/assets/VoiceOverlay-BL_ns1ZA.js +7 -0
- package/ui/dist/assets/VramPanel-BNPQ06_9.js +1 -0
- package/ui/dist/assets/WatchView-BgAkNnur.js +13 -0
- package/ui/dist/assets/WorkTab-RRpPpEOg.js +1 -0
- package/ui/dist/assets/WorkflowBuilderPanel-BPHIH8pf.js +1 -0
- package/ui/dist/assets/WorkflowsPanel-DqtmT0NB.js +1 -0
- package/ui/dist/assets/approvalHeadline-BRg3ReTi.js +1 -0
- package/ui/dist/assets/archive-DcK9HrbE.js +1 -0
- package/ui/dist/assets/arrow-left-4c2FnES1.js +1 -0
- package/ui/dist/assets/book-open-Ds_yciQm.js +1 -0
- package/ui/dist/assets/bot-CWDCc265.js +1 -0
- package/ui/dist/assets/chart-column-hhZMdCgB.js +1 -0
- package/ui/dist/assets/chevron-right-A_pvnRh_.js +1 -0
- package/ui/dist/assets/circle-check-big-C-JUM7wb.js +1 -0
- package/ui/dist/assets/circle-stop-yZuG9ZAE.js +1 -0
- package/ui/dist/assets/clipboard-list-C2HUEjZc.js +1 -0
- package/ui/dist/assets/clock-DSPgndSD.js +1 -0
- package/ui/dist/assets/clsx-CjueKrWZ.js +1 -0
- package/ui/dist/assets/createLucideIcon-qnlrxww7.js +1 -0
- package/ui/dist/assets/database-C1SgHa8T.js +1 -0
- package/ui/dist/assets/dollar-sign-D9siqK91.js +1 -0
- package/ui/dist/assets/download-CJZWQNfV.js +1 -0
- package/ui/dist/assets/external-link-CpQLWKKE.js +1 -0
- package/ui/dist/assets/file-text-BbGTi-Po.js +1 -0
- package/ui/dist/assets/flask-conical-B1YVft4E.js +1 -0
- package/ui/dist/assets/folder-EbR-w2Mq.js +1 -0
- package/ui/dist/assets/funnel-D2Dkn8Pf.js +1 -0
- package/ui/dist/assets/git-branch-CQ2yNSzU.js +1 -0
- package/ui/dist/assets/git-pull-request-BxL5wlGX.js +1 -0
- package/ui/dist/assets/index-Cz8190xO.css +2 -0
- package/ui/dist/assets/index-WI-E4I3h.js +243 -0
- package/ui/dist/assets/jsx-runtime-B15e6lOy.js +1 -0
- package/ui/dist/assets/layers-BPu5SRjI.js +1 -0
- package/ui/dist/assets/legacy-BIzifT-t.js +3 -0
- package/ui/dist/assets/lightbulb-BY7CpMte.js +1 -0
- package/ui/dist/assets/link-VDQkrGJw.js +1 -0
- package/ui/dist/assets/list-todo-DfnNUV_T.js +1 -0
- package/ui/dist/assets/message-square-BpzrINHz.js +1 -0
- package/ui/dist/assets/mic-De6oZFaV.js +1 -0
- package/ui/dist/assets/missions-y-qg_f9b.js +1 -0
- package/ui/dist/assets/network-CM7y1ats.js +1 -0
- package/ui/dist/assets/pause-C4TDJSfA.js +1 -0
- package/ui/dist/assets/pencil-Dd_vzHE-.js +1 -0
- package/ui/dist/assets/play-9WxZWVHA.js +1 -0
- package/ui/dist/assets/plug-Dm25Wbrc.js +1 -0
- package/ui/dist/assets/plus-CHryCIkk.js +1 -0
- package/ui/dist/assets/radio-D-XnoAVu.js +1 -0
- package/ui/dist/assets/refresh-cw-Disd5wRB.js +1 -0
- package/ui/dist/assets/rotate-ccw-Cw1T2W1T.js +1 -0
- package/ui/dist/assets/save-DP7oNar2.js +1 -0
- package/ui/dist/assets/search-aNVcX-nv.js +1 -0
- package/ui/dist/assets/send-D7iQD57b.js +1 -0
- package/ui/dist/assets/server-DFfeYjoM.js +1 -0
- package/ui/dist/assets/settings-5NWXzgyY.js +1 -0
- package/ui/dist/assets/shared-DLz_Jtg3.js +1 -0
- package/ui/dist/assets/shield-check-Cd50jCAn.js +1 -0
- package/ui/dist/assets/square-DlcoJ1ZM.js +1 -0
- package/ui/dist/assets/terminal-DgFz2Vsf.js +1 -0
- package/ui/dist/assets/test-tube-BimtS92_.js +1 -0
- package/ui/dist/assets/toggle-right-BMaR-sfT.js +1 -0
- package/ui/dist/assets/trash-2-CwUv7ww1.js +1 -0
- package/ui/dist/assets/trending-up-Ba9TwEow.js +1 -0
- package/ui/dist/assets/trophy-Gfv1QC45.js +1 -0
- package/ui/dist/assets/volume-2-BVlfVl2U.js +1 -0
- package/ui/dist/assets/wifi-off-CWLeusSV.js +1 -0
- package/ui/dist/assets/zoom-out-DeggJ7RM.js +1 -0
- package/ui/dist/index.html +4 -2
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/AuditPanel-BaftX5MP.js +0 -1
- package/ui/dist/assets/AutonomyPanel-CmaXJV8d.js +0 -11
- package/ui/dist/assets/AutopilotPanel-CbohPtXW.js +0 -1
- package/ui/dist/assets/AutoresearchPanel-DCwiQ2v2.js +0 -6
- package/ui/dist/assets/BackupPanel-DAy9G7Wt.js +0 -1
- package/ui/dist/assets/BrowserPanel-D6UaSxap.js +0 -6
- package/ui/dist/assets/CPActivity-BYDsUoMn.js +0 -1
- package/ui/dist/assets/CPAgentDetail-Bb9-GAJY.js +0 -1
- package/ui/dist/assets/CPAgents-BTZuGnki.js +0 -1
- package/ui/dist/assets/CPApprovals-BME2ARkO.js +0 -1
- package/ui/dist/assets/CPCosts-mOXwWq0i.js +0 -1
- package/ui/dist/assets/CPDashboard-CTlKGXXQ.js +0 -1
- package/ui/dist/assets/CPFiles-BO73EZwJ.js +0 -1
- package/ui/dist/assets/CPGoals-BNWhNP14.js +0 -1
- package/ui/dist/assets/CPInbox-ybe4r8LW.js +0 -16
- package/ui/dist/assets/CPIssueDetail-DaMMGbjw.js +0 -1
- package/ui/dist/assets/CPIssues-BgpQOISw.js +0 -1
- package/ui/dist/assets/CPLayout-bgErauTx.js +0 -2
- package/ui/dist/assets/CPOrg-C8l5SIWJ.js +0 -8
- package/ui/dist/assets/CPRuns-DB8S7loF.js +0 -1
- package/ui/dist/assets/CPSocial-Qw5rKy_4.js +0 -11
- package/ui/dist/assets/CPVoice-DfwHPewA.js +0 -1
- package/ui/dist/assets/ChannelsPanel-DS21E-Iz.js +0 -1
- package/ui/dist/assets/CheckpointsPanel-9-l_8GdG.js +0 -1
- package/ui/dist/assets/CommandPostHub-z55Yrhj1.js +0 -24
- package/ui/dist/assets/CronPanel-kEZK3gpx.js +0 -1
- package/ui/dist/assets/DataTable-PnhPeDBG.js +0 -1
- package/ui/dist/assets/DreamPanel-DIrtlk2K.js +0 -15
- package/ui/dist/assets/EmptyState-CfvU7SdB.js +0 -1
- package/ui/dist/assets/EvalHarnessPanel-uYb_ZEQG.js +0 -2
- package/ui/dist/assets/EvalPanel-CDG-njyj.js +0 -1
- package/ui/dist/assets/FileViewer-CVO3TRs3.js +0 -61
- package/ui/dist/assets/FilesPanel-CaLPog2e.js +0 -16
- package/ui/dist/assets/FleetPanel-BtlaV6pH.js +0 -1
- package/ui/dist/assets/HomelabPanel-BZvN4LPM.js +0 -6
- package/ui/dist/assets/InfraView-C0zEuFrR.js +0 -2
- package/ui/dist/assets/InlineEditableField-mBzpbcLB.js +0 -1
- package/ui/dist/assets/Input-CbrMbLgn.js +0 -1
- package/ui/dist/assets/IntegrationsPanel-B4TyR6jC.js +0 -1
- package/ui/dist/assets/IntelligenceView-DZ4HxYZ3.js +0 -2
- package/ui/dist/assets/LearningPanel-B4RIm_iQ.js +0 -1
- package/ui/dist/assets/LogsPanel-DbP3Mwnr.js +0 -1
- package/ui/dist/assets/McpPanel-BmNUFozc.js +0 -1
- package/ui/dist/assets/MemoryGraphPanel-JPurHV0L.js +0 -16
- package/ui/dist/assets/MemoryWikiPanel-DdvCAZHa.js +0 -6
- package/ui/dist/assets/MeshPanel-Bf-4brXL.js +0 -11
- package/ui/dist/assets/MissionCanvas-CJyhnauG.js +0 -72
- package/ui/dist/assets/MissionChat-C2Nto3zM.js +0 -7
- package/ui/dist/assets/MissionLibrary-RXyBHsLL.js +0 -5
- package/ui/dist/assets/MissionStart-wUkcEP0T.js +0 -1
- package/ui/dist/assets/Modal-BmS7C6FN.js +0 -1
- package/ui/dist/assets/NvidiaPanel-4DlcQlyl.js +0 -1
- package/ui/dist/assets/OrganismPanel-C2LYDPrn.js +0 -1
- package/ui/dist/assets/OverviewPanel-DK8uuq4D.js +0 -1
- package/ui/dist/assets/PageHeader-bnc85wQN.js +0 -1
- package/ui/dist/assets/PersonaProfilesPanel-DGtokXUu.js +0 -8
- package/ui/dist/assets/PersonasPanel-dR8VppcD.js +0 -1
- package/ui/dist/assets/PhoneDeskPanel-CdVOY7H9.js +0 -11
- package/ui/dist/assets/RecipesPanel-D3Zs2wxr.js +0 -1
- package/ui/dist/assets/SecurityPanel-BMERf796.js +0 -1
- package/ui/dist/assets/SelfImprovePanel-BxqWHXCU.js +0 -1
- package/ui/dist/assets/SelfProposalsPanel-CuC94vdx.js +0 -2
- package/ui/dist/assets/SessionsPanel-CQ8qvzp7.js +0 -1
- package/ui/dist/assets/SessionsTab-B3eHV3jf.js +0 -1
- package/ui/dist/assets/SettingsPanel-Cumls7N2.js +0 -1
- package/ui/dist/assets/SettingsView-BtA67pol.js +0 -2
- package/ui/dist/assets/SkeletonLoader-Cax7YTqW.js +0 -1
- package/ui/dist/assets/SkillsPanel-CA415CT8.js +0 -11
- package/ui/dist/assets/SomaView-BtCkeWfZ.css +0 -1
- package/ui/dist/assets/SomaView-eG3wI4S1.js +0 -5
- package/ui/dist/assets/StatCard-Djr487DV.js +0 -1
- package/ui/dist/assets/StatusBadge-JpCoA33_.js +0 -1
- package/ui/dist/assets/Tabs-DJHu-roP.js +0 -1
- package/ui/dist/assets/TeamsPanel-C_Vu6vnY.js +0 -1
- package/ui/dist/assets/TelemetryPanel-D4PXsd-X.js +0 -1
- package/ui/dist/assets/TitanCanvas-BfitWg9R.css +0 -1
- package/ui/dist/assets/TitanCanvas-TuYZSZO7.js +0 -1117
- package/ui/dist/assets/ToolsView-BvTN6vFn.js +0 -2
- package/ui/dist/assets/Tooltip-B1LhTXJ8.js +0 -6
- package/ui/dist/assets/TraceViewer-Bh8Jo3Dr.js +0 -1
- package/ui/dist/assets/TrainingPanel-Dmbd1rJ-.js +0 -1
- package/ui/dist/assets/VoiceOverlay-B_ss7Zg_.js +0 -17
- package/ui/dist/assets/VramPanel-CPICbZ2s.js +0 -1
- package/ui/dist/assets/WatchView-BCgLVfiV.js +0 -13
- package/ui/dist/assets/WorkTab-iptofXO9.js +0 -1
- package/ui/dist/assets/WorkflowsPanel-3RYkFHyf.js +0 -11
- package/ui/dist/assets/approvalHeadline-DB9SgR-9.js +0 -1
- package/ui/dist/assets/archive-gZFnGd5A.js +0 -6
- package/ui/dist/assets/arrow-left-qA0Qer2h.js +0 -6
- package/ui/dist/assets/book-open-DIxdPqmD.js +0 -6
- package/ui/dist/assets/bot-CvIF1uHi.js +0 -6
- package/ui/dist/assets/chart-column-BQiM-Td4.js +0 -6
- package/ui/dist/assets/check-DgyDEFtq.js +0 -6
- package/ui/dist/assets/chevron-right-CQ1NTOtd.js +0 -6
- package/ui/dist/assets/chevron-up-UyfdjRp6.js +0 -6
- package/ui/dist/assets/circle-check-big-CAFcaPPH.js +0 -6
- package/ui/dist/assets/circle-stop-C-8xGv0n.js +0 -6
- package/ui/dist/assets/clipboard-list-9DdqBj1F.js +0 -6
- package/ui/dist/assets/clock-CF9BCIpL.js +0 -6
- package/ui/dist/assets/clsx-B-dksMZM.js +0 -1
- package/ui/dist/assets/dollar-sign-LDRZBae6.js +0 -6
- package/ui/dist/assets/download-BBNXvBO0.js +0 -6
- package/ui/dist/assets/external-link-D_ji4Bec.js +0 -6
- package/ui/dist/assets/file-text-DrdTDEYp.js +0 -6
- package/ui/dist/assets/flask-conical-BGn5PgFX.js +0 -6
- package/ui/dist/assets/folder-BeZZUGnK.js +0 -6
- package/ui/dist/assets/funnel-CAJgGO5M.js +0 -6
- package/ui/dist/assets/git-branch-BcXabeOs.js +0 -6
- package/ui/dist/assets/index-CUgepw5Q.js +0 -337
- package/ui/dist/assets/index-Dm6zcSTS.css +0 -1
- package/ui/dist/assets/layers-DxYDmPA_.js +0 -6
- package/ui/dist/assets/legacy-dHWI7k8P.js +0 -3
- package/ui/dist/assets/lightbulb-B0Du4SM4.js +0 -6
- package/ui/dist/assets/link-CUpaumqr.js +0 -6
- package/ui/dist/assets/list-todo-CDDhmPQB.js +0 -6
- package/ui/dist/assets/message-square-D5VWlv-Q.js +0 -6
- package/ui/dist/assets/mic-Ddcc6Ann.js +0 -6
- package/ui/dist/assets/missions-2zox16Tc.js +0 -1
- package/ui/dist/assets/network-DaJ7ugwX.js +0 -6
- package/ui/dist/assets/pause-BukaK6rs.js +0 -6
- package/ui/dist/assets/pencil-D_YwQBeg.js +0 -6
- package/ui/dist/assets/play-BjdwtYMk.js +0 -6
- package/ui/dist/assets/plug-yISDdeW2.js +0 -6
- package/ui/dist/assets/plus-BSjTdepW.js +0 -6
- package/ui/dist/assets/proxy-CWET5FFX.js +0 -9
- package/ui/dist/assets/radio-B7kX_yWE.js +0 -6
- package/ui/dist/assets/refresh-cw-CwDpzXUn.js +0 -6
- package/ui/dist/assets/rotate-ccw-7SQDTI0_.js +0 -6
- package/ui/dist/assets/save-CjTPAQM0.js +0 -6
- package/ui/dist/assets/search-BP7VlNxX.js +0 -6
- package/ui/dist/assets/send-C2XDuRPf.js +0 -6
- package/ui/dist/assets/server-BE8W-AT4.js +0 -6
- package/ui/dist/assets/shield-check-s7la2J2K.js +0 -6
- package/ui/dist/assets/terminal-B8IK4WsO.js +0 -6
- package/ui/dist/assets/test-tube-Xfn9DJeg.js +0 -11
- package/ui/dist/assets/toggle-right-CHpzOIlj.js +0 -11
- package/ui/dist/assets/trash-2-B1C85ePK.js +0 -6
- package/ui/dist/assets/trending-up-DDGHQZY1.js +0 -6
- package/ui/dist/assets/trophy-D0LhJSPA.js +0 -6
- package/ui/dist/assets/volume-2-DMaE91b5.js +0 -6
- package/ui/dist/assets/wifi-off-DR9h8HGA.js +0 -6
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as ee,r as d,b as m,j as e,Z as I,C as se,n as te,A as w,m as ae,U as ne,l as le,K as re}from"./index-CUgepw5Q.js";import{P as B}from"./PageHeader-bnc85wQN.js";import{S as h}from"./StatCard-Djr487DV.js";import{S as ie}from"./SkeletonLoader-Cax7YTqW.js";import{R as ce}from"./refresh-cw-CwDpzXUn.js";import{C as de}from"./clock-CF9BCIpL.js";import{M as oe}from"./message-square-D5VWlv-Q.js";import{S as xe}from"./server-BE8W-AT4.js";import{C as me}from"./chart-column-BQiM-Td4.js";import{N as D}from"./network-DaJ7ugwX.js";import{C as A}from"./circle-check-big-CAFcaPPH.js";import{W as he}from"./wifi-off-DR9h8HGA.js";import{D as ue}from"./dollar-sign-LDRZBae6.js";import"./chevron-right-CQ1NTOtd.js";import"./clsx-B-dksMZM.js";/**
|
|
2
|
-
* @license lucide-react v0.513.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const pe=[["path",{d:"M6 5v11",key:"mdvv1e"}],["path",{d:"M12 5v6",key:"14ar3b"}],["path",{d:"M18 5v14",key:"7ji314"}]],ge=ee("kanban",pe),je=15e3;function be(n){const r=Math.floor(n/86400),g=Math.floor(n%86400/3600),f=Math.floor(n%3600/60);return r>0?`${r}d ${g}h ${f}m`:g>0?`${g}h ${f}m`:`${f}m`}function fe(n){return n>=1024?`${(n/1024).toFixed(1)} GB`:`${Math.round(n)} MB`}function S(n){return fe(n/1024/1024)}function Ne(n){const r=Math.floor((Date.now()-new Date(n).getTime())/1e3);return r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function M({status:n}){const r={online:"bg-success shadow-success/40",offline:"bg-error shadow-error/40",working:"bg-warning shadow-warning/40 animate-pulse",unknown:"bg-text-muted shadow-none"};return e.jsx("div",{className:`h-2.5 w-2.5 rounded-full shadow-lg ${r[n]}`})}function b({title:n,icon:r,children:g}){return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(r,{className:"h-4 w-4 text-accent-hover"}),e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wider text-text-secondary",children:n})]}),g]})}function Ie(){var L,U,V;const[n,r]=d.useState(!0),[g,f]=d.useState([]),[i,P]=d.useState(null),[c,E]=d.useState(null),[x,F]=d.useState(null),[k,q]=d.useState([]),[G,O]=d.useState([]),[R,_]=d.useState([]),[$,K]=d.useState([]),[C,W]=d.useState([]),[z,Z]=d.useState(new Date),v=d.useCallback(async()=>{try{const[s,l,a,u,o,j,p,T,N]=await Promise.all([m("/api/homelab/machines").then(t=>t.ok?t.json():null).catch(()=>null),m("/api/vram").then(t=>t.ok?t.json():null).catch(()=>null),m("/api/stats").then(t=>t.ok?t.json():null).catch(()=>null),m("/api/activity/summary").then(t=>t.ok?t.json():null).catch(()=>null),m("/api/command-post/agents").then(t=>t.ok?t.json():null).catch(()=>null),m("/api/command-post/issues").then(t=>t.ok?t.json():null).catch(()=>null),m("/api/command-post/activity?limit=15").then(t=>t.ok?t.json():null).catch(()=>null),m("/api/command-post/budgets").then(t=>t.ok?t.json():null).catch(()=>null),m("/api/mesh/peers").then(t=>t.ok?t.json():null).catch(()=>null)]);Array.isArray(s==null?void 0:s.machines)&&f(s.machines.map(t=>({name:String(t.name??"Unknown"),ip:String(t.ip??""),role:String(t.role??""),online:t.online===!0}))),l&&P(l),a&&E(a),u&&F(u),Array.isArray(o)&&q(o);const J=Array.isArray(j)?j:(j==null?void 0:j.issues)??[];O(J);const Q=Array.isArray(p)?p:(p==null?void 0:p.feed)??(p==null?void 0:p.activity)??[];_(Q),Array.isArray(T)&&K(T);const Y=(N==null?void 0:N.peers)??(Array.isArray(N)?N:[]);W(Y),Z(new Date)}finally{r(!1)}},[]);if(d.useEffect(()=>{v();const s=setInterval(v,je);return()=>clearInterval(s)},[v]),n)return e.jsxs("div",{className:"space-y-4",children:[e.jsx(B,{title:"Homelab",breadcrumbs:[{label:"Monitoring"},{label:"Homelab"}]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:e.jsx(ie,{variant:"metric",count:8})})]});const H=!!i&&typeof i.totalVRAM=="number"&&Number.isFinite(i.totalVRAM)&&i.totalVRAM>0&&typeof i.usedVRAM=="number"&&Number.isFinite(i.usedVRAM),y=H?Math.round(i.usedVRAM/i.totalVRAM*100):0,X=s=>G.filter(l=>l.status===s);return e.jsxs("div",{className:"space-y-6",children:[e.jsx(B,{title:"Homelab",breadcrumbs:[{label:"Monitoring"},{label:"Homelab"}],actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:v,className:"flex items-center gap-1.5 rounded-lg bg-bg-tertiary px-3 py-1.5 text-xs text-text-secondary hover:bg-border hover:text-text transition-colors",children:[e.jsx(ce,{className:"h-3.5 w-3.5"})," Refresh"]}),e.jsxs("span",{className:"text-[10px] text-text-muted",children:["Updated ",z.toLocaleTimeString()]})]})}),c&&e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(h,{title:"Uptime",value:be(c.uptime??0),icon:e.jsx(de,{className:"h-4 w-4"})}),e.jsx(h,{title:"Total Requests",value:(c.totalRequests??0).toLocaleString(),icon:e.jsx(I,{className:"h-4 w-4"})}),e.jsx(h,{title:"Active Sessions",value:c.activeSessions??0,icon:e.jsx(oe,{className:"h-4 w-4"})}),e.jsx(h,{title:"Active Model",value:((L=c.model)==null?void 0:L.split("/").pop())??"unknown",icon:e.jsx(se,{className:"h-4 w-4"}),subtitle:c.provider})]}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx(b,{title:"Machines",icon:xe,children:e.jsx("div",{className:"grid gap-2",children:g.map(s=>e.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border bg-bg-secondary px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{status:s.online===null?"unknown":s.online?"online":"offline"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text",children:s.name}),e.jsx("p",{className:"text-[11px] text-text-muted",children:s.role})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-xs font-mono text-text-secondary",children:s.ip}),e.jsx("p",{className:"text-[10px] text-text-muted",children:s.online?"Online":s.online===!1?"Offline":"Checking..."})]})]},s.ip))})}),e.jsx(b,{title:"GPU / VRAM",icon:te,children:H?e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[e.jsx("span",{className:"text-text-secondary",children:"VRAM Usage"}),e.jsxs("span",{className:"text-text-muted",children:[S(i.usedVRAM)," / ",S(i.totalVRAM)," (",y,"%)"]})]}),e.jsx("div",{className:"h-3 rounded-full bg-bg-tertiary overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all ${y>90?"bg-error":y>70?"bg-warning":"bg-accent"}`,style:{width:`${y}%`}})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(M,{status:i.state==="idle"?"online":"working"}),e.jsx("span",{className:"text-text-secondary capitalize",children:i.state})]}),((U=i.models)==null?void 0:U.length)>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wider text-text-muted mb-1",children:"Loaded Models"}),i.models.map(s=>e.jsxs("div",{className:"flex justify-between text-xs py-0.5",children:[e.jsx("span",{className:"text-text-secondary",children:s.name}),e.jsx("span",{className:"text-text-muted font-mono",children:S(s.vram)})]},s.id))]}),((V=i.leases)==null?void 0:V.length)>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wider text-text-muted mb-1",children:"Active Leases"}),i.leases.map(s=>e.jsxs("div",{className:"flex justify-between text-xs py-0.5",children:[e.jsx("span",{className:"text-text-secondary",children:s.service}),e.jsxs("span",{className:"text-text-muted font-mono",children:[s.requiredMB," MB"]})]},s.leaseId))]})]}):e.jsx("div",{className:"rounded-xl border border-border bg-bg-secondary p-4 text-center text-xs text-text-muted",children:"No GPU detected on this gateway host. VRAM orchestration is inactive."})})]}),x&&e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-5",children:[e.jsx(h,{title:"Tool Calls (24h)",value:x.toolCallsLast24h,icon:e.jsx(I,{className:"h-4 w-4"})}),e.jsx(h,{title:"Active Goals",value:x.activeGoals,icon:e.jsx(me,{className:"h-4 w-4"})}),e.jsx(h,{title:"Autopilot",value:x.autopilotEnabled?"On":"Off",icon:e.jsx(w,{className:"h-4 w-4"}),subtitle:`${x.autopilotRunsToday} runs today`}),e.jsx(h,{title:"Knowledge Graph",value:x.graphStats.entities,icon:e.jsx(D,{className:"h-4 w-4"}),subtitle:`${x.graphStats.edges} edges`}),e.jsx(h,{title:"System Status",value:x.status==="idle"?"Idle":x.status,icon:x.status==="idle"?e.jsx(A,{className:"h-4 w-4"}):e.jsx(w,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx(b,{title:"Mesh Network",icon:D,children:e.jsx("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:C.length>0?e.jsx("div",{className:"space-y-2",children:C.map(s=>{var l;return e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{className:"h-3.5 w-3.5 text-success"}),e.jsx("span",{className:"text-text-secondary",children:s.host||s.nodeId.slice(0,12)})]}),e.jsxs("span",{className:"text-text-muted",children:[((l=s.models)==null?void 0:l.length)??0," models"]})]},s.nodeId)})}):e.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[e.jsx(he,{className:"h-3.5 w-3.5"}),"No mesh peers connected"]})})}),e.jsx(b,{title:"Active Agents",icon:ne,children:e.jsx("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:k.length>0?e.jsx("div",{className:"space-y-2",children:k.map(s=>{const l=s.status==="active"||s.status==="running",a=s.lastHeartbeat&&Date.now()-new Date(s.lastHeartbeat).getTime()>36e5;return e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{status:a?"offline":l?"working":"online"}),e.jsx("span",{className:"text-text font-medium",children:s.name||s.id.slice(0,12)}),s.role&&e.jsxs("span",{className:"text-text-muted",children:["(",s.role,")"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"capitalize text-text-secondary",children:s.status}),s.lastHeartbeat&&e.jsx("span",{className:"text-text-muted",children:Ne(s.lastHeartbeat)})]})]},s.id)})}):e.jsx("p",{className:"text-xs text-text-muted",children:"No agents registered"})})})]}),e.jsx(b,{title:"Task Board",icon:ge,children:e.jsx("div",{className:"grid grid-cols-3 gap-3",children:["todo","in_progress","done"].map(s=>{const l=s==="in_progress"?"In Progress":s.charAt(0).toUpperCase()+s.slice(1),a=X(s),u=s==="todo"?"text-text-muted":s==="in_progress"?"text-warning":"text-success";return e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary/50 p-3 min-h-[120px]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("p",{className:`text-[10px] font-semibold uppercase tracking-wider ${u}`,children:l}),e.jsxs("span",{className:"text-[10px] text-text-muted",children:["(",a==null?void 0:a.length,")"]})]}),(a==null?void 0:a.length)>0?e.jsxs("div",{className:"space-y-1.5",children:[a.slice(0,8).map(o=>e.jsxs("div",{className:"rounded-lg border border-border bg-bg p-2 text-xs",children:[e.jsxs("div",{className:"flex items-start gap-1.5",children:[e.jsx("span",{className:"text-accent font-semibold shrink-0",children:o.id.slice(0,6)}),e.jsx("span",{className:"text-text-secondary",children:o.title||o.description||"Untitled"})]}),o.assigneeAgentId&&e.jsxs("p",{className:"text-[10px] text-text-muted mt-0.5",children:["→ ",o.assigneeAgentId]})]},o.id)),(a==null?void 0:a.length)>8&&e.jsxs("p",{className:"text-[10px] text-text-muted text-center",children:["+",(a==null?void 0:a.length)-8," more"]})]}):e.jsx("p",{className:"text-[10px] text-text-muted italic text-center py-4",children:"Empty"})]},s)})})}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx(b,{title:"Live Activity",icon:w,children:e.jsx("div",{className:"rounded-xl border border-border bg-bg-secondary p-3 max-h-[320px] overflow-y-auto",children:R.length>0?e.jsx("div",{className:"space-y-0",children:R.slice(0,15).map((s,l)=>{const a=s.timestamp?new Date(s.timestamp).toLocaleTimeString():"",u=s.type||"event",o=u.includes("agent"),j=u.includes("tool");return e.jsxs("div",{className:"flex gap-2.5 py-1.5 border-b border-border/50 last:border-0 text-xs",children:[e.jsx("span",{className:"text-text-muted shrink-0 w-[52px] text-[10px]",children:a}),e.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase ${j?"bg-accent/15 text-accent":o?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:u.slice(0,10)}),e.jsx("span",{className:"text-text-secondary truncate",children:s.message||s.detail||s.content||""})]},l)})}):e.jsx("p",{className:"text-xs text-text-muted italic text-center py-6",children:"No recent activity"})})}),e.jsx(b,{title:"Budget Tracking",icon:ue,children:e.jsx("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:$.length>0?e.jsx("div",{className:"space-y-3",children:$.map(s=>{const l=s.limitUsd>0?Math.round(s.currentSpend/s.limitUsd*100):0;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[e.jsx("span",{className:"text-text-secondary font-medium",children:s.name}),e.jsxs("span",{className:"text-text-muted",children:["$",s.currentSpend.toFixed(2)," / $",s.limitUsd.toFixed(2)," (",s.period,")"]})]}),e.jsx("div",{className:"h-2 rounded-full bg-bg-tertiary overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all ${l>90?"bg-error":l>70?"bg-warning":"bg-success"}`,style:{width:`${Math.min(l,100)}%`}})})]},s.id)})}):e.jsx("p",{className:"text-xs text-text-muted",children:"No budget policies configured"})})})]}),(c==null?void 0:c.health)&&e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5 rounded-xl border border-border bg-bg-secondary px-4 py-3",children:[c.health.ollamaHealthy?e.jsx(A,{className:"h-4 w-4 text-success"}):e.jsx(le,{className:"h-4 w-4 text-error"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text",children:"Ollama"}),e.jsx("p",{className:"text-[10px] text-text-muted",children:c.health.ollamaHealthy?"Healthy":"Unhealthy"})]})]}),e.jsxs("div",{className:"flex items-center gap-2.5 rounded-xl border border-border bg-bg-secondary px-4 py-3",children:[c.health.ttsHealthy?e.jsx(A,{className:"h-4 w-4 text-success"}):e.jsx(re,{className:"h-4 w-4 text-warning"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text",children:"TTS"}),e.jsx("p",{className:"text-[10px] text-text-muted",children:c.health.ttsHealthy?"Healthy":"Unavailable"})]})]}),e.jsxs("div",{className:"flex items-center gap-2.5 rounded-xl border border-border bg-bg-secondary px-4 py-3",children:[e.jsx(w,{className:"h-4 w-4 text-accent"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-text",children:"LLM Requests"}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:[c.health.activeLlmRequests," active"]})]})]})]})]})}export{Ie as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomelabPanel-BZvN4LPM.js","assets/index-CUgepw5Q.js","assets/index-Dm6zcSTS.css","assets/PageHeader-bnc85wQN.js","assets/chevron-right-CQ1NTOtd.js","assets/StatCard-Djr487DV.js","assets/SkeletonLoader-Cax7YTqW.js","assets/clsx-B-dksMZM.js","assets/refresh-cw-CwDpzXUn.js","assets/clock-CF9BCIpL.js","assets/message-square-D5VWlv-Q.js","assets/server-BE8W-AT4.js","assets/chart-column-BQiM-Td4.js","assets/network-DaJ7ugwX.js","assets/circle-check-big-CAFcaPPH.js","assets/wifi-off-DR9h8HGA.js","assets/dollar-sign-LDRZBae6.js","assets/NvidiaPanel-4DlcQlyl.js","assets/save-CjTPAQM0.js","assets/external-link-D_ji4Bec.js","assets/search-BP7VlNxX.js","assets/FilesPanel-CaLPog2e.js","assets/plus-BSjTdepW.js","assets/arrow-left-qA0Qer2h.js","assets/pencil-D_YwQBeg.js","assets/trash-2-B1C85ePK.js","assets/download-BBNXvBO0.js","assets/check-DgyDEFtq.js","assets/TitanCanvas-TuYZSZO7.js","assets/chevron-up-UyfdjRp6.js","assets/file-text-DrdTDEYp.js","assets/terminal-B8IK4WsO.js","assets/book-open-DIxdPqmD.js","assets/rotate-ccw-7SQDTI0_.js","assets/send-C2XDuRPf.js","assets/mic-Ddcc6Ann.js","assets/flask-conical-BGn5PgFX.js","assets/archive-gZFnGd5A.js","assets/radio-B7kX_yWE.js","assets/test-tube-Xfn9DJeg.js","assets/VoiceOverlay-B_ss7Zg_.js","assets/volume-2-DMaE91b5.js","assets/folder-BeZZUGnK.js","assets/shield-check-s7la2J2K.js","assets/bot-CvIF1uHi.js","assets/link-CUpaumqr.js","assets/TitanCanvas-BfitWg9R.css","assets/LogsPanel-DbP3Mwnr.js","assets/TelemetryPanel-D4PXsd-X.js","assets/git-branch-BcXabeOs.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as t,j as e,_ as a}from"./index-CUgepw5Q.js";import{c as i}from"./clsx-B-dksMZM.js";const r=t.lazy(()=>a(()=>import("./HomelabPanel-BZvN4LPM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),d=t.lazy(()=>a(()=>import("./NvidiaPanel-4DlcQlyl.js"),__vite__mapDeps([17,1,2,3,4,8,18,14,19,20]))),n=t.lazy(()=>a(()=>import("./FilesPanel-CaLPog2e.js"),__vite__mapDeps([21,1,2,22,8,4,23,9,24,25,18,26,27,28,29,30,11,13,31,32,33,20,34,10,35,36,37,38,39,40,41,42,43,19,44,15,12,45,46]))),c=t.lazy(()=>a(()=>import("./LogsPanel-DbP3Mwnr.js"),__vite__mapDeps([47,1,2,3,4,8]))),m=t.lazy(()=>a(()=>import("./TelemetryPanel-D4PXsd-X.js"),__vite__mapDeps([48,1,2,5,9,49,12,11]))),x=[{id:"homelab",label:"Homelab"},{id:"gpu",label:"GPU / NVIDIA"},{id:"files",label:"Files"},{id:"logs",label:"Logs"},{id:"telemetry",label:"Telemetry"}];function p(){const[l,o]=t.useState("homelab");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"shrink-0 px-5 pt-4 pb-0",children:[e.jsx("h1",{className:"text-sm font-semibold text-text mb-3",children:"Infrastructure"}),e.jsx("div",{className:"flex items-center gap-0.5 border-b border-border/50",children:x.map(s=>e.jsxs("button",{onClick:()=>o(s.id),className:i("px-3 py-2 text-xs font-medium transition-colors relative",l===s.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[s.label,l===s.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},s.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(t.Suspense,{fallback:e.jsx("div",{className:"skeleton-shimmer h-40 rounded-lg"}),children:[l==="homelab"&&e.jsx(r,{}),l==="gpu"&&e.jsx(d,{}),l==="files"&&e.jsx(n,{}),l==="logs"&&e.jsx(c,{}),l==="telemetry"&&e.jsx(m,{})]})})]})}export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,j as t,X as N}from"./index-CUgepw5Q.js";import{c as g}from"./clsx-B-dksMZM.js";import{C as w}from"./check-DgyDEFtq.js";import{P as S}from"./pencil-D_YwQBeg.js";function P({value:s,onSave:h,placeholder:p,multiline:a=!1,className:k,displayValue:E,emptyLabel:j="—",hidePencil:C=!1,maxLength:x,title:v}){const[i,o]=r.useState(!1),[c,l]=r.useState(s),[f,y]=r.useState(!1),n=r.useRef(null);r.useEffect(()=>{i&&n.current&&(n.current.focus(),"select"in n.current&&n.current.select())},[i]),r.useEffect(()=>{i||l(s)},[s,i]);const u=async()=>{if(c===s){o(!1);return}y(!0);try{await h(c),o(!1)}catch{}finally{y(!1)}},m=()=>{l(s),o(!1)},b=e=>{e.key==="Enter"&&!a||e.key==="Enter"&&a&&e.metaKey?(e.preventDefault(),u()):e.key==="Escape"&&(e.preventDefault(),m())};if(i){const e=g("bg-bg-tertiary border border-accent/60 rounded px-2 py-1 text-sm text-text","focus:outline-none focus:border-accent","w-full",a&&"resize-none min-h-[60px]");return t.jsxs("span",{className:"inline-flex items-start gap-1 w-full",children:[a?t.jsx("textarea",{ref:n,value:c,onChange:d=>l(d.target.value),onKeyDown:b,placeholder:p,maxLength:x,className:e,disabled:f}):t.jsx("input",{ref:n,type:"text",value:c,onChange:d=>l(d.target.value),onKeyDown:b,placeholder:p,maxLength:x,className:e,disabled:f}),t.jsx("button",{onClick:u,disabled:f,className:"text-success hover:bg-success/10 rounded p-1 shrink-0",title:a?"Save (Cmd+Enter)":"Save (Enter)",type:"button",children:t.jsx(w,{size:14})}),t.jsx("button",{onClick:m,disabled:f,className:"text-text-muted hover:bg-bg-tertiary rounded p-1 shrink-0",title:"Cancel (Esc)",type:"button",children:t.jsx(N,{size:14})})]})}const D=E??(s&&s.length>0?s:j);return t.jsxs("span",{className:g("inline-flex items-center gap-1 cursor-pointer group","hover:bg-bg-tertiary rounded px-1 -mx-1",k),onClick:()=>o(!0),title:v??"Click to edit",role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(!0))},children:[t.jsx("span",{children:D}),!C&&t.jsx(S,{size:10,className:"text-text-muted opacity-0 group-hover:opacity-60 transition-opacity shrink-0"})]})}export{P as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,j as e,L as b}from"./index-CUgepw5Q.js";import{c as d}from"./clsx-B-dksMZM.js";const m={primary:"text-white shadow-sm glow-accent-hover bg-[image:var(--gradient-accent)] hover:brightness-110",secondary:"bg-bg-tertiary text-text border border-border hover:border-border-light hover:bg-bg-secondary",ghost:"text-text-secondary hover:text-text hover:bg-bg-tertiary",danger:"bg-error/10 text-error border border-error/20 hover:bg-error/20"},p={sm:"px-2.5 py-1 text-xs gap-1.5 rounded-md",md:"px-3.5 py-2 text-sm gap-2 rounded-lg",lg:"px-5 py-2.5 text-sm gap-2 rounded-lg"},g=n.forwardRef(({variant:r="primary",size:t="md",icon:o,loading:s,disabled:a,children:i,className:l,...c},x)=>e.jsxs("button",{ref:x,disabled:a||s,className:d("inline-flex items-center justify-center font-medium transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50","disabled:opacity-50 disabled:pointer-events-none",m[r],p[t],l),...c,children:[s?e.jsx(b,{size:t==="sm"?14:16,className:"animate-spin"}):o,i]}));g.displayName="Button";const u=n.forwardRef(({icon:r,error:t,className:o,...s},a)=>e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"relative",children:[r&&e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-muted pointer-events-none",children:r}),e.jsx("input",{ref:a,className:d("w-full rounded-lg border bg-bg py-2 text-sm text-text outline-none transition-colors","placeholder:text-text-muted",r?"pl-10 pr-3":"px-3",t?"border-error focus:border-error":"border-border focus:border-accent",o),...s})]}),t&&e.jsx("p",{className:"mt-1 text-xs text-error",children:t})]}));u.displayName="Input";export{g as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e,i as B,ao as A,E as T,a8 as w,b as C,V as F,a9 as K}from"./index-CUgepw5Q.js";import{P as U}from"./PageHeader-bnc85wQN.js";import{C as R}from"./circle-check-big-CAFcaPPH.js";import{P as q}from"./plug-yISDdeW2.js";import{S as I}from"./save-CjTPAQM0.js";import{C as M}from"./chevron-right-CQ1NTOtd.js";const k=[{id:"anthropic",label:"Anthropic",fieldKey:"anthropicKey",fieldType:"key",placeholder:"sk-ant-..."},{id:"openai",label:"OpenAI",fieldKey:"openaiKey",fieldType:"key",placeholder:"sk-..."},{id:"google",label:"Google AI",fieldKey:"googleKey",fieldType:"key",placeholder:"AIza..."},{id:"groq",label:"Groq",fieldKey:"groqKey",fieldType:"key",placeholder:"gsk_..."},{id:"mistral",label:"Mistral",fieldKey:"mistralKey",fieldType:"key",placeholder:"API key"},{id:"openrouter",label:"OpenRouter",fieldKey:"openrouterKey",fieldType:"key",placeholder:"sk-or-..."},{id:"fireworks",label:"Fireworks AI",fieldKey:"fireworksKey",fieldType:"key",placeholder:"API key"},{id:"xai",label:"xAI (Grok)",fieldKey:"xaiKey",fieldType:"key",placeholder:"xai-..."},{id:"together",label:"Together AI",fieldKey:"togetherKey",fieldType:"key",placeholder:"API key"},{id:"deepseek",label:"DeepSeek",fieldKey:"deepseekKey",fieldType:"key",placeholder:"sk-..."},{id:"perplexity",label:"Perplexity",fieldKey:"perplexityKey",fieldType:"key",placeholder:"pplx-..."},{id:"ollama",label:"Ollama",fieldKey:"ollamaUrl",fieldType:"url",placeholder:"http://localhost:11434"}];function O({configured:a}){return e.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${a?"bg-success/10 text-success":"bg-border-light/20 text-text-muted"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${a?"bg-success":"bg-border-light"}`}),a?"Configured":"Not configured"]})}function V({provider:a,configured:b,currentUrl:o,onSave:p,saving:v}){const[y,f]=l.useState(!1),[i,d]=l.useState(a.fieldType==="url"&&o||""),[x,u]=l.useState(!1),g=a.fieldType==="key",c=v===a.id;return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary",children:[e.jsxs("button",{onClick:()=>f(!y),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[y?e.jsx(F,{className:"h-4 w-4 text-text-muted"}):e.jsx(M,{className:"h-4 w-4 text-text-muted"}),e.jsx("span",{className:"text-sm font-medium text-text",children:a.label})]}),e.jsx(O,{configured:b})]}),y&&e.jsxs("div",{className:"border-t border-bg-tertiary px-4 py-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:g?"API Key":"Base URL"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`integration-${a.id}`,name:`integration-${a.id}`,type:g&&!x?"password":"text",value:i,onChange:j=>d(j.target.value),placeholder:a.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),g&&e.jsx("button",{type:"button",onClick:()=>u(!x),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:x?e.jsx(A,{className:"h-4 w-4"}):e.jsx(T,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>p(a.fieldKey,i),disabled:c||!i,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(I,{className:"h-3.5 w-3.5"}),c?"Saving...":"Save"]})})]})]})}function W(){const[a,b]=l.useState({}),[o,p]=l.useState({clientIdSet:!1,clientSecretSet:!1}),[v,y]=l.useState(!0),[f,i]=l.useState(null),[d,x]=l.useState(null),[u,g]=l.useState(""),[c,j]=l.useState(""),[N,P]=l.useState(!1);l.useEffect(()=>{(async()=>{var t;try{const r=await w();if(r.providers&&b(r.providers),(t=r.oauth)!=null&&t.google){const m=r.oauth.google;try{const n=await(await C("/api/auth/google/status")).json();m.connected=n.connected,m.email=n.email}catch{}p(m)}}catch{}finally{y(!1)}})()},[]);const G=()=>{window.location.href="/api/auth/google/start"},E=async()=>{try{await C("/api/auth/google/disconnect",{method:"POST"}),p(s=>({...s,connected:!1,email:void 0})),h("success","Google account disconnected")}catch{h("error","Failed to disconnect")}},h=(s,t)=>{x({type:s,message:t}),setTimeout(()=>x(null),3e3)},D=async(s,t)=>{var m,S;const r=((m=k.find(n=>n.fieldKey===s))==null?void 0:m.id)||s;i(r);try{await K({[s]:t});const n=await w();n.providers&&b(n.providers),h("success",`${((S=k.find(L=>L.fieldKey===s))==null?void 0:S.label)||"Provider"} saved`)}catch(n){h("error",n instanceof Error?n.message:"Failed to save")}finally{i(null)}},$=async()=>{var s;i("oauth");try{const t={};u&&(t.googleOAuthClientId=u),c&&(t.googleOAuthClientSecret=c),await K(t);const r=await w();(s=r.oauth)!=null&&s.google&&p(r.oauth.google),h("success","Google OAuth settings saved"),g(""),j("")}catch(t){h("error",t instanceof Error?t.message:"Failed to save")}finally{i(null)}};return v?e.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((s,t)=>e.jsx("div",{className:"h-14 animate-pulse rounded-xl border border-border bg-bg-secondary"},t))}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(U,{title:"Integrations",subtitle:"Configure LLM providers and external service connections",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Integrations"}]}),d&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${d.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[d.type==="success"?e.jsx(R,{className:"h-4 w-4"}):e.jsx(B,{className:"h-4 w-4"}),d.message]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"LLM Providers"}),e.jsx("div",{className:"space-y-2",children:k.map(s=>{const t=a[s.id],r=s.id==="ollama"?!!(t!=null&&t.baseUrl):!!(t!=null&&t.configured);return e.jsx(V,{provider:s,configured:r,currentUrl:s.fieldType==="url"?(t==null?void 0:t.baseUrl)||"":void 0,onSave:D,saving:f},s.id)})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Google Services (OAuth)"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"Google OAuth 2.0"}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:o.connected&&o.email?`Connected as ${o.email}`:"Gmail, Drive, Calendar, Docs, Sheets, Tasks"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{configured:!!o.connected}),o.clientIdSet&&!o.connected&&e.jsxs("button",{onClick:G,className:"flex items-center gap-1.5 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white hover:bg-accent/80 transition-colors",children:[e.jsx(q,{className:"h-3.5 w-3.5"}),"Connect Google"]}),o.connected&&e.jsx("button",{onClick:E,className:"flex items-center gap-1.5 rounded-lg border border-red-500/30 px-3 py-1.5 text-xs font-medium text-red-400 hover:bg-red-500/10 transition-colors",children:"Disconnect"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Client ID"}),e.jsx("input",{id:"integration-google-client-id",name:"integration-google-client-id",type:"text",value:u,onChange:s=>g(s.target.value),placeholder:o.clientIdSet?"(configured)":"your-client-id.apps.googleusercontent.com",className:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Client Secret"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"integration-google-client-secret",name:"integration-google-client-secret",type:N?"text":"password",value:c,onChange:s=>j(s.target.value),placeholder:o.clientSecretSet?"(configured)":"GOCSPX-...",className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>P(!N),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:N?e.jsx(A,{className:"h-4 w-4"}):e.jsx(T,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:$,disabled:f==="oauth"||!u&&!c,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(I,{className:"h-3.5 w-3.5"}),f==="oauth"?"Saving...":"Save OAuth Settings"]})})]})]})]})}export{W as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AutopilotPanel-CbohPtXW.js","assets/index-CUgepw5Q.js","assets/index-Dm6zcSTS.css","assets/PageHeader-bnc85wQN.js","assets/chevron-right-CQ1NTOtd.js","assets/WorkflowsPanel-3RYkFHyf.js","assets/Input-CbrMbLgn.js","assets/clsx-B-dksMZM.js","assets/InlineEditableField-mBzpbcLB.js","assets/check-DgyDEFtq.js","assets/pencil-D_YwQBeg.js","assets/refresh-cw-CwDpzXUn.js","assets/plus-BSjTdepW.js","assets/play-BjdwtYMk.js","assets/pause-BukaK6rs.js","assets/trash-2-B1C85ePK.js","assets/clock-CF9BCIpL.js","assets/toggle-right-CHpzOIlj.js","assets/book-open-DIxdPqmD.js","assets/LearningPanel-B4RIm_iQ.js","assets/lightbulb-B0Du4SM4.js","assets/TitanCanvas-TuYZSZO7.js","assets/chevron-up-UyfdjRp6.js","assets/file-text-DrdTDEYp.js","assets/server-BE8W-AT4.js","assets/network-DaJ7ugwX.js","assets/terminal-B8IK4WsO.js","assets/save-CjTPAQM0.js","assets/rotate-ccw-7SQDTI0_.js","assets/search-BP7VlNxX.js","assets/send-C2XDuRPf.js","assets/message-square-D5VWlv-Q.js","assets/mic-Ddcc6Ann.js","assets/flask-conical-BGn5PgFX.js","assets/archive-gZFnGd5A.js","assets/radio-B7kX_yWE.js","assets/test-tube-Xfn9DJeg.js","assets/VoiceOverlay-B_ss7Zg_.js","assets/volume-2-DMaE91b5.js","assets/folder-BeZZUGnK.js","assets/shield-check-s7la2J2K.js","assets/external-link-D_ji4Bec.js","assets/bot-CvIF1uHi.js","assets/wifi-off-DR9h8HGA.js","assets/chart-column-BQiM-Td4.js","assets/link-CUpaumqr.js","assets/TitanCanvas-BfitWg9R.css","assets/trending-up-DDGHQZY1.js","assets/MemoryGraphPanel-JPurHV0L.js","assets/SelfImprovePanel-BxqWHXCU.js","assets/circle-check-big-CAFcaPPH.js","assets/trophy-D0LhJSPA.js","assets/PersonasPanel-dR8VppcD.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as o,j as e,_ as t}from"./index-CUgepw5Q.js";import{c as a}from"./clsx-B-dksMZM.js";const i=o.lazy(()=>t(()=>import("./AutopilotPanel-CbohPtXW.js"),__vite__mapDeps([0,1,2,3,4]))),n=o.lazy(()=>t(()=>import("./WorkflowsPanel-3RYkFHyf.js"),__vite__mapDeps([5,1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18]))),d=o.lazy(()=>t(()=>import("./LearningPanel-B4RIm_iQ.js"),__vite__mapDeps([19,1,2,3,4,11,18,20,21,22,12,23,24,25,26,27,10,28,29,30,31,32,33,16,34,35,36,37,38,39,9,40,41,42,43,44,45,15,46,47]))),c=o.lazy(()=>t(()=>import("./MemoryGraphPanel-JPurHV0L.js"),__vite__mapDeps([48,1,2,25,11,15,29]))),m=o.lazy(()=>t(()=>import("./SelfImprovePanel-BxqWHXCU.js"),__vite__mapDeps([49,1,2,3,4,11,50,16,51,47,42,13,26,35,15]))),x=o.lazy(()=>t(()=>import("./PersonasPanel-dR8VppcD.js"),__vite__mapDeps([52,1,2]))),p=[{id:"autopilot",label:"Autopilot"},{id:"workflows",label:"Workflows"},{id:"learning",label:"Learning"},{id:"memory",label:"Memory & Graph"},{id:"self-improve",label:"Self-Improve"},{id:"personas",label:"Personas"}];function f(){const[l,r]=o.useState("autopilot");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"shrink-0 px-5 pt-4 pb-0",children:[e.jsx("h1",{className:"text-sm font-semibold text-text mb-3",children:"Intelligence"}),e.jsx("div",{className:"flex items-center gap-0.5 border-b border-border/50",children:p.map(s=>e.jsxs("button",{onClick:()=>r(s.id),className:a("px-3 py-2 text-xs font-medium transition-colors relative",l===s.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[s.label,l===s.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},s.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(o.Suspense,{fallback:e.jsx("div",{className:"skeleton-shimmer h-40 rounded-lg"}),children:[l==="autopilot"&&e.jsx(i,{}),l==="workflows"&&e.jsx(n,{}),l==="learning"&&e.jsx(d,{}),l==="memory"&&e.jsx(c,{}),l==="self-improve"&&e.jsx(m,{}),l==="personas"&&e.jsx(x,{})]})})]})}export{f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as e,W as g,K as j,b as m}from"./index-CUgepw5Q.js";import{P as f}from"./PageHeader-bnc85wQN.js";import{R as N}from"./refresh-cw-CwDpzXUn.js";import{B as u}from"./book-open-DIxdPqmD.js";import{L as v}from"./lightbulb-B0Du4SM4.js";import{D as y}from"./TitanCanvas-TuYZSZO7.js";import{T as C}from"./trending-up-DDGHQZY1.js";import"./chevron-right-CQ1NTOtd.js";import"./chevron-up-UyfdjRp6.js";import"./plus-BSjTdepW.js";import"./file-text-DrdTDEYp.js";import"./server-BE8W-AT4.js";import"./network-DaJ7ugwX.js";import"./terminal-B8IK4WsO.js";import"./save-CjTPAQM0.js";import"./pencil-D_YwQBeg.js";import"./rotate-ccw-7SQDTI0_.js";import"./search-BP7VlNxX.js";import"./send-C2XDuRPf.js";import"./message-square-D5VWlv-Q.js";import"./mic-Ddcc6Ann.js";import"./flask-conical-BGn5PgFX.js";import"./clock-CF9BCIpL.js";import"./archive-gZFnGd5A.js";import"./radio-B7kX_yWE.js";import"./test-tube-Xfn9DJeg.js";import"./VoiceOverlay-B_ss7Zg_.js";import"./volume-2-DMaE91b5.js";import"./folder-BeZZUGnK.js";import"./check-DgyDEFtq.js";import"./shield-check-s7la2J2K.js";import"./external-link-D_ji4Bec.js";import"./bot-CvIF1uHi.js";import"./wifi-off-DR9h8HGA.js";import"./chart-column-BQiM-Td4.js";import"./link-CUpaumqr.js";import"./trash-2-B1C85ePK.js";function w(t){return t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`:`${Math.floor(t/86400)}d ${Math.floor(t%86400/3600)}h`}function k(t){return t<1e3?String(t):t<1e6?`${(t/1e3).toFixed(1)}K`:`${(t/1e6).toFixed(2)}M`}function a({icon:t,label:d,value:s,color:l,sub:o}){return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-md",style:{backgroundColor:l+"15"},children:e.jsx(t,{className:"h-3.5 w-3.5",style:{color:l}})}),e.jsx("p",{className:"text-xs text-text-muted",children:d})]}),e.jsx("p",{className:"text-2xl font-bold text-text",children:s}),o&&e.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:o})]})}function de(){const[t,d]=i.useState(null),[s,l]=i.useState(null),[o,b]=i.useState(null),[h,x]=i.useState(!0),p=()=>{x(!0),Promise.all([m("/api/learning").then(r=>r.ok?r.json():null).catch(()=>null),m("/api/stats").then(r=>r.ok?r.json():null).catch(()=>null),m("/api/graphiti").then(r=>r.ok?r.json():null).catch(()=>null)]).then(([r,c,n])=>{d(r),l(c),b(n?{nodeCount:n.nodeCount||0,edgeCount:n.edgeCount||0,episodeCount:n.episodeCount||0}:null)}).finally(()=>x(!1))};return i.useEffect(()=>{p()},[]),h?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-10 animate-pulse rounded-xl bg-bg-secondary"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:Array.from({length:8}).map((r,c)=>e.jsx("div",{className:"h-24 animate-pulse rounded-xl bg-bg-secondary"},c))})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(f,{title:"Learning",subtitle:"Knowledge base, tool mastery, and memory systems",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Memory"},{label:"Learning"}],actions:e.jsxs("button",{onClick:p,className:"flex items-center gap-1.5 rounded-lg bg-bg-tertiary px-3 py-1.5 text-xs text-text-secondary hover:bg-border hover:text-text transition-colors",children:[e.jsx(N,{className:"h-3.5 w-3.5"})," Refresh"]})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Knowledge Base"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(a,{icon:u,label:"Knowledge Entries",value:(t==null?void 0:t.knowledgeEntries)??0,color:"#6366f1",sub:"Facts, patterns, corrections"}),e.jsx(a,{icon:g,label:"Tools Tracked",value:(t==null?void 0:t.toolsTracked)??0,color:"#22d3ee",sub:"Success rates learned"}),e.jsx(a,{icon:j,label:"Error Patterns",value:(t==null?void 0:t.errorPatterns)??0,color:"#f59e0b",sub:"Known failure modes"}),e.jsx(a,{icon:v,label:"Corrections",value:(t==null?void 0:t.corrections)??0,color:"#34d399",sub:"User-taught improvements"})]})]}),o&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Memory Graph"}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsx(a,{icon:y,label:"Entities",value:o.nodeCount,color:"#818cf8",sub:"People, topics, projects"}),e.jsx(a,{icon:C,label:"Relationships",value:o.edgeCount,color:"#22d3ee",sub:"Connections between entities"}),e.jsx(a,{icon:u,label:"Episodes",value:o.episodeCount,color:"#34d399",sub:"Conversation memories"})]})]}),s&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"System"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsx("p",{className:"text-xs text-text-muted",children:"Tokens Used"}),e.jsx("p",{className:"text-xl font-bold text-text",children:k(s.totalTokens)})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsx("p",{className:"text-xs text-text-muted",children:"Requests"}),e.jsx("p",{className:"text-xl font-bold text-text",children:s.totalRequests})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsx("p",{className:"text-xs text-text-muted",children:"Uptime"}),e.jsx("p",{className:"text-xl font-bold text-text",children:w(s.uptime)})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4",children:[e.jsx("p",{className:"text-xs text-text-muted",children:"Memory"}),e.jsxs("p",{className:"text-xl font-bold text-text",children:[s.memoryMB,"MB"]})]})]})]})]})}export{de as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,aR as v,j as e}from"./index-CUgepw5Q.js";import{P as j}from"./PageHeader-bnc85wQN.js";import{R as y}from"./refresh-cw-CwDpzXUn.js";import"./chevron-right-CQ1NTOtd.js";const x={debug:"bg-text-muted/20 text-text-secondary",info:"bg-info/20 text-info",warn:"bg-warning/20 text-warning",warning:"bg-warning/20 text-warning",error:"bg-error/20 text-error"};function k(){const[c,u]=r.useState([]),[g,m]=r.useState(!0),[i,d]=r.useState(null),[n,b]=r.useState(""),[o,h]=r.useState(100),[l,p]=r.useState(!1),s=r.useRef(null),a=r.useCallback(async()=>{try{const t=await v(n||void 0,o);u(t),d(null)}catch(t){d(t instanceof Error?t.message:"Failed to fetch logs")}finally{m(!1)}},[n,o]);return r.useEffect(()=>{a()},[a]),r.useEffect(()=>(l?s.current=setInterval(a,5e3):s.current&&(clearInterval(s.current),s.current=null),()=>{s.current&&clearInterval(s.current)}),[l,a]),g?e.jsx("div",{className:"h-96 animate-pulse rounded-xl border border-border bg-bg-secondary"}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(j,{title:"Logs",subtitle:"Recent gateway and skill activity",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"Logs"}]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("select",{value:n,onChange:t=>b(t.target.value),className:"rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent",children:[e.jsx("option",{value:"",children:"All levels"}),e.jsx("option",{value:"debug",children:"Debug"}),e.jsx("option",{value:"info",children:"Info"}),e.jsx("option",{value:"warn",children:"Warn"}),e.jsx("option",{value:"error",children:"Error"})]}),e.jsxs("select",{value:o,onChange:t=>h(Number(t.target.value)),className:"rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent",children:[e.jsx("option",{value:50,children:"50 entries"}),e.jsx("option",{value:100,children:"100 entries"}),e.jsx("option",{value:200,children:"200 entries"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-text-secondary",children:[e.jsx("input",{type:"checkbox",checked:l,onChange:t=>p(t.target.checked),className:"h-4 w-4 rounded border-border accent-accent"}),"Auto-refresh (5s)"]}),e.jsx("button",{onClick:a,className:"ml-auto rounded-lg p-2 text-text-secondary transition-colors hover:bg-bg-tertiary hover:text-text",title:"Refresh",children:e.jsx(y,{className:"h-4 w-4"})})]}),i&&e.jsx("div",{className:"rounded-lg border border-error/50 bg-bg-secondary px-4 py-2 text-sm text-error",children:i}),e.jsx("div",{className:"max-h-[600px] overflow-y-auto rounded-xl border border-border bg-bg-secondary",children:c.length===0?e.jsx("p",{className:"px-4 py-12 text-center text-text-muted",children:"No logs found"}):e.jsx("div",{className:"divide-y divide-border",children:c.map((t,f)=>e.jsxs("div",{className:"flex items-start gap-3 px-4 py-2.5",children:[e.jsx("span",{className:"shrink-0 font-mono text-xs text-text-muted",children:new Date(t.timestamp).toLocaleTimeString()}),e.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-xs font-medium uppercase ${x[t.level]??x.debug}`,children:t.level}),e.jsx("span",{className:"min-w-0 break-all text-sm text-text",children:t.message})]},f))})})]})}export{k as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,j as e,G as A,ai as k,aj as z,ak as u,al as $,am as R,an as I}from"./index-CUgepw5Q.js";import{P as E}from"./PageHeader-bnc85wQN.js";import{R as D}from"./refresh-cw-CwDpzXUn.js";import{P as L}from"./plus-BSjTdepW.js";import{S as g}from"./server-BE8W-AT4.js";import{P as F}from"./plug-yISDdeW2.js";import{T as G,P as H}from"./test-tube-Xfn9DJeg.js";import{T as B}from"./trash-2-B1C85ePK.js";import"./chevron-right-CQ1NTOtd.js";function Y(){const[l,h]=d.useState([]),[j,N]=d.useState([]),[y,x]=d.useState(!0),[m,c]=d.useState(!1),[v,p]=d.useState(null),[o,i]=d.useState(null),[r,a]=d.useState({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n=async()=>{x(!0);try{const[t,s]=await Promise.all([k(),z()]);h(t),N(s)}catch{}x(!1)};d.useEffect(()=>{n()},[]);const f=async()=>{try{await u({id:r.id,name:r.name,description:r.description,type:r.type,...r.type==="stdio"?{command:r.command,args:r.args.split(/\s+/).filter(Boolean)}:{url:r.url}}),c(!1),a({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n()}catch(t){alert(t.message)}},C=async t=>{try{await u({presetId:t}),n()}catch(s){alert(s.message)}},P=async t=>{confirm(`Remove MCP server "${t}"?`)&&(await I(t),n())},w=async(t,s)=>{await R(t,s),n()},M=async t=>{p(t),i(null);try{const s=await $(t);i({id:t,...s})}catch(s){i({id:t,ok:!1,tools:0,error:s.message})}p(null)},T=t=>t==="connected"?"text-[var(--success)]":t==="error"?"text-[var(--error)]":"text-[var(--text-muted)]",S=t=>t==="connected"?"bg-[var(--success)]":t==="error"?"bg-[var(--error)]":"bg-[var(--text-muted)]",b=j.filter(t=>!l.some(s=>s.id===t.id));return e.jsxs("div",{className:"space-y-6",children:[e.jsx(E,{title:"MCP Connections",subtitle:"Connect to external tools via Model Context Protocol",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"MCP"}],actions:e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(D,{size:14})}),e.jsxs("button",{onClick:()=>c(!m),className:"flex items-center gap-2 px-3 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] transition-colors",children:[e.jsx(L,{size:14})," Add Server"]})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Configured Servers"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--text)]",children:l.length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connected"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--success)]",children:l.filter(t=>t.status==="connected").length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"External Tools"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--accent)]",children:l.reduce((t,s)=>t+s.toolCount,0)})]})]}),m&&e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)]",children:"Add MCP Server"}),b.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)] mb-2",children:"Quick Add Presets"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:b.map(t=>e.jsxs("button",{onClick:()=>C(t.id),className:"flex items-center gap-2 px-3 py-1.5 text-xs rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:[e.jsx(g,{size:12})," ",t.name]},t.id))})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"ID"}),e.jsx("input",{id:"mcp-server-id",name:"mcp-server-id",value:r.id,onChange:t=>a({...r,id:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"my-server"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Name"}),e.jsx("input",{id:"mcp-server-name",name:"mcp-server-name",value:r.name,onChange:t=>a({...r,name:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"My MCP Server"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Description"}),e.jsx("input",{id:"mcp-server-description",name:"mcp-server-description",value:r.description,onChange:t=>a({...r,description:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"What does this server do?"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Type"}),e.jsxs("select",{id:"mcp-server-type",name:"mcp-server-type",value:r.type,onChange:t=>a({...r,type:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",children:[e.jsx("option",{value:"stdio",children:"stdio (local process)"}),e.jsx("option",{value:"http",children:"HTTP (remote server)"})]})]}),r.type==="stdio"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Command"}),e.jsx("input",{id:"mcp-server-command",name:"mcp-server-command",value:r.command,onChange:t=>a({...r,command:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"npx @modelcontextprotocol/server-xxx"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Arguments (space-separated)"}),e.jsx("input",{id:"mcp-server-args",name:"mcp-server-args",value:r.args,onChange:t=>a({...r,args:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"--port 3000"})]})]}):e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Server URL"}),e.jsx("input",{id:"mcp-server-url",name:"mcp-server-url",value:r.url,onChange:t=>a({...r,url:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"http://localhost:3000/mcp"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:f,disabled:!r.id||!r.name,className:"px-4 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] disabled:opacity-40 transition-colors",children:"Add Server"}),e.jsx("button",{onClick:()=>c(!1),className:"px-4 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:"Cancel"})]})]}),y?e.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading MCP servers..."}):l.length===0?e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-8 text-center",children:[e.jsx(F,{className:"w-10 h-10 text-[var(--text-muted)] mx-auto mb-3"}),e.jsx("p",{className:"text-[var(--text-secondary)] mb-1",children:"No MCP servers configured"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Add an MCP server to connect TITAN to external tools like databases, APIs, and services."})]}):e.jsx("div",{className:"space-y-3",children:l.map(t=>e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:t.type==="stdio"?e.jsx(g,{size:18,className:"text-[var(--text-muted)]"}):e.jsx(A,{size:18,className:"text-[var(--text-muted)]"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-[var(--text)]",children:t.name}),e.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${S(t.status)}`}),e.jsx("span",{className:T(t.status),children:t.status})]}),t.toolCount>0&&e.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--accent)]/10 text-[var(--accent)]",children:[t.toolCount," tools"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:t.description}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-1 font-mono",children:t.type==="stdio"?`${t.command} ${(t.args||[]).join(" ")}`:t.url})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>M(t.id),disabled:v===t.id,title:"Test connection",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--bg-tertiary)] transition-colors disabled:opacity-40",children:e.jsx(G,{size:14,className:v===t.id?"animate-pulse":""})}),e.jsx("button",{onClick:()=>w(t.id,!t.enabled),title:t.enabled?"Disable":"Enable",className:`p-1.5 rounded-md transition-colors hover:bg-[var(--bg-tertiary)] ${t.enabled?"text-[var(--success)]":"text-[var(--text-muted)]"}`,children:e.jsx(H,{size:14})}),e.jsx("button",{onClick:()=>P(t.id),title:"Remove",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--error)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(B,{size:14})})]})]}),(o==null?void 0:o.id)===t.id&&e.jsx("div",{className:`mt-3 px-3 py-2 rounded-md text-xs ${o.ok?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:o.ok?`Connected successfully — ${o.tools} tools discovered`:`Connection failed: ${o.error}`})]},t.id))}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)] mb-2",children:"About MCP"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:["Model Context Protocol (MCP) is the universal standard for connecting AI agents to external tools. TITAN acts as both an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"server"})," (exposing its tools to other agents) and an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"client"})," (connecting to external MCP servers). Add any MCP-compatible server and its tools automatically become available in TITAN."]})]})]})}export{Y as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as ve,r as j,b as je,j as o,X as $e}from"./index-CUgepw5Q.js";import{N as Ne}from"./network-DaJ7ugwX.js";import{R as ze}from"./refresh-cw-CwDpzXUn.js";import{T as Le}from"./trash-2-B1C85ePK.js";import{S as Re}from"./search-BP7VlNxX.js";/**
|
|
2
|
-
* @license lucide-react v0.513.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Pe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Fe=ve("maximize-2",Pe);/**
|
|
7
|
-
* @license lucide-react v0.513.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Te=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Ee=ve("zoom-in",Te);/**
|
|
12
|
-
* @license lucide-react v0.513.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Ie=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Ae=ve("zoom-out",Ie),Me={person:"#818cf8",topic:"#22d3ee",project:"#34d399",place:"#fbbf24",fact:"#f472b6",tool:"#fb923c",preference:"#a78bfa",software:"#38bdf8",system:"#e879f9",event:"#fb7185",product:"#4ade80",company:"#facc15",file:"#94a3b8",technology:"#2dd4bf",hardware:"#f97316",component:"#c084fc",feature:"#67e8f9",directory:"#a1a1aa",social_post:"#ec4899"},qe={person:"Person",topic:"Topic",project:"Project",place:"Place",fact:"Fact",tool:"Tool",preference:"Preference",software:"Software",system:"System",event:"Event",product:"Product",company:"Company",file:"File",technology:"Technology",hardware:"Hardware",component:"Component",feature:"Feature",directory:"Directory",social_post:"Social Post"},Se=["#f0abfc","#86efac","#fda4af","#7dd3fc","#d9f99d","#fcd34d"];function re(s){const y=s==null?void 0:s.toLowerCase();if(Me[y])return Me[y];let N=0;for(let L=0;L<((y==null?void 0:y.length)??0);L++)N=(N<<5)-N+y.charCodeAt(L)|0;return Se[Math.abs(N)%Se.length]}function Ce(s){const y=parseInt(s.slice(1),16);return[y>>16&255,y>>8&255,y&255]}function pe(s){return typeof s=="number"&&Number.isFinite(s)}function A(s){return pe(s.x)&&pe(s.y)}function Ye(s,y,N,L){var me,te,W;const S=s.length;if(S===0||!Number.isFinite(N)||!Number.isFinite(L)||N<=0||L<=0)return;const q=N/2,x=L/2,C=new Map;for(let d=0;d<S;d++){const $=((me=s[d].type)==null?void 0:me.toLowerCase())??"unknown";C.has($)||C.set($,[]),C.get($).push(d)}const P=[...C.keys()],k=new Map,v=Math.min(N,L)*.3;for(let d=0;d<P.length;d++){const $=d/P.length*Math.PI*2-Math.PI/2;k.set(P[d],{x:q+Math.cos($)*v,y:x+Math.sin($)*v})}for(let d=0;d<S;d++){const $=s[d];if(A($))continue;const oe=k.get(((te=$.type)==null?void 0:te.toLowerCase())??"unknown")??{x:q,y:x},se=Math.min(N,L)*.12;$.x=oe.x+(Math.random()-.5)*se,$.y=oe.y+(Math.random()-.5)*se,$.vx=0,$.vy=0}const Z=new Map(s.map(d=>[d.id,d])),O=Math.sqrt(S/50),le=Math.min(200,Math.max(80,Math.round(60+S*.2))),ae=4e3*O,fe=.003/O,Q=.003/O,de=.015,H=new Map;for(const d of y)H.has(d.from)||H.set(d.from,new Set),H.has(d.to)||H.set(d.to,new Set),H.get(d.from).add(d.to),H.get(d.to).add(d.from);for(let d=0;d<le;d++){const $=.9-d/le*.35,oe=d/le;if(S>200)for(let i=0;i<S;i++){const u=s[i];if(!A(u))continue;const t=H.get(u.id)??new Set;for(let e=i+1;e<S;e++){if(!t.has(s[e].id)&&Math.random()>.2)continue;const n=s[e];if(!A(n))continue;const a=u.x-n.x,r=u.y-n.y,l=a*a+r*r,h=Math.sqrt(l)||1,z=ae/(l+100),f=a/h*z,p=r/h*z;u.vx+=f,u.vy+=p,n.vx-=f,n.vy-=p}}else for(let i=0;i<S;i++)for(let u=i+1;u<S;u++){const t=s[i],e=s[u];if(!A(t)||!A(e))continue;const n=t.x-e.x,a=t.y-e.y,r=n*n+a*a,l=Math.sqrt(r)||1,h=ae/(r+100),z=n/l*h,f=a/l*h;t.vx+=z,t.vy+=f,e.vx-=z,e.vy-=f}for(const i of y){const u=Z.get(i.from),t=Z.get(i.to);if(!u||!t||!A(u)||!A(t))continue;const e=t.x-u.x,n=t.y-u.y,a=Math.sqrt(e*e+n*n)||1,r=a*fe,l=e/a*r,h=n/a*r;u.vx+=l,u.vy+=h,t.vx-=l,t.vy-=h}const se=de*(1-oe*.5);for(const i of s){if(!A(i))continue;const u=k.get(((W=i.type)==null?void 0:W.toLowerCase())??"unknown");u&&(i.vx+=(u.x-i.x)*se,i.vy+=(u.y-i.y)*se)}for(const i of s)A(i)&&(i.vx+=(q-i.x)*Q,i.vy+=(x-i.y)*Q);const U=40;for(const i of s)A(i)&&(i.vx*=$,i.vy*=$,i.x+=i.vx,i.y+=i.vy,(!Number.isFinite(i.x)||!Number.isFinite(i.y))&&(i.x=q,i.y=x),i.x=Math.max(U,Math.min(Math.max(U,N-U),i.x)),i.y=Math.max(U,Math.min(Math.max(U,L-U),i.y)))}}function _e(s,y,N,L,S){const q=(s+N)/2,x=(y+L)/2,C=N-s,k=-(L-y),v=C,Z=Math.sqrt(k*k+v*v)||1;return{cx:q+k/Z*S,cy:x+v/Z*S}}function De(s,y,N,L,S,q,x){const C=Math.atan2(N-S,y-L),P=8,k=y-Math.cos(C)*q,v=N-Math.sin(C)*q;s.beginPath(),s.moveTo(k,v),s.lineTo(k-Math.cos(C-Math.PI/6)*P,v-Math.sin(C-Math.PI/6)*P),s.lineTo(k-Math.cos(C)*P*.5,v-Math.sin(C)*P*.5),s.lineTo(k-Math.cos(C+Math.PI/6)*P,v-Math.sin(C+Math.PI/6)*P),s.closePath(),s.fillStyle=x,s.fill()}function Ze(){const[s,y]=j.useState(null),[N,L]=j.useState(!0),[S,q]=j.useState(null),[x,C]=j.useState(null),[P,k]=j.useState(null),[v,Z]=j.useState(""),[O,le]=j.useState(new Set),ae=j.useRef(null),fe=j.useRef(null),Q=j.useRef({x:0,y:0,zoom:1,dragging:!1,startX:0,startY:0}),de=j.useRef(0),H=j.useRef(0),me=j.useRef(new Map),te=j.useCallback(async()=>{var t;try{const e=await je("/api/graphiti",{headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error(`${e.status}: ${e.statusText}`);const n=await e.json();if((t=n.nodes)!=null&&t.length){const a=fe.current,r=(a==null?void 0:a.clientWidth)??1200,l=(a==null?void 0:a.clientHeight)??600;for(const h of n.nodes){const z=me.current.get(h.id);z&&pe(z.x)&&pe(z.y)&&(h.x=z.x,h.y=z.y)}Ye(n.nodes,n.edges??[],r,l);for(const h of n.nodes)A(h)&&me.current.set(h.id,{x:h.x,y:h.y})}y(n),q(null)}catch(e){q(e instanceof Error?e.message:"Failed to load graph"),y(null)}finally{L(!1)}},[]);j.useEffect(()=>{te()},[te]);const W=j.useMemo(()=>{if(!s)return{nodes:[],edges:[]};const t=v.toLowerCase().trim();let e=s.nodes;if(O.size>0&&(e=e.filter(r=>{var l;return!O.has((l=r.type)==null?void 0:l.toLowerCase())})),t){const r=new Set;for(const l of e)(l.label.toLowerCase().includes(t)||l.facts.some(h=>h.toLowerCase().includes(t)))&&r.add(l.id);for(const l of s.edges)r.has(l.from)&&r.add(l.to),r.has(l.to)&&r.add(l.from);e=e.filter(l=>r.has(l.id))}const n=new Set(e.map(r=>r.id)),a=(s.edges??[]).filter(r=>n.has(r.from)&&n.has(r.to));return{nodes:e,edges:a}},[s,v,O]),d=j.useMemo(()=>{if(!v.trim()||!s)return null;const t=v.toLowerCase().trim(),e=s.nodes.find(n=>n.label.toLowerCase().includes(t));return(e==null?void 0:e.id)??null},[v,s]),$=async()=>{if(confirm("Clear the entire memory graph? This cannot be undone."))try{await je("/api/graphiti",{method:"DELETE"}),te(),C(null)}catch{}},oe=t=>{const e=Q.current;e.zoom=Math.max(.2,Math.min(4,e.zoom*t)),k(n=>n)},se=()=>{Q.current={x:0,y:0,zoom:1,dragging:!1,startX:0,startY:0},k(t=>t)},U=t=>{le(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})};j.useEffect(()=>{const t=ae.current;if(!t||!W.nodes.length)return;const e=t.getContext("2d");if(!e)return;const n=window.devicePixelRatio||1,a=t.getBoundingClientRect();if(!Number.isFinite(a.width)||!Number.isFinite(a.height)||a.width<=0||a.height<=0)return;t.width=a.width*n,t.height=a.height*n,e.scale(n,n);const r=a.width,l=a.height,{nodes:h,edges:z}=W,f=h.filter(A),p=new Map(f.map(T=>[T.id,T])),Y=()=>{H.current++;const T=H.current,m=Q.current;e.clearRect(0,0,r,l);const D=e.createRadialGradient(r/2,l/2,0,r/2,l/2,r*.7);D.addColorStop(0,"#0c0c14"),D.addColorStop(1,"#09090b"),e.fillStyle=D,e.fillRect(0,0,r,l),e.fillStyle="rgba(255,255,255,0.02)";const F=35*m.zoom,ue=(m.x%F+F)%F,ge=(m.y%F+F)%F;for(let c=ue;c<r;c+=F)for(let _=ge;_<l;_+=F)e.fillRect(c,_,1,1);for(let c=0;c<15;c++){const _=(T*.15+c*127)%r,M=(T*.1+c*173)%l,w=.02+Math.sin(T*.008+c)*.01;e.beginPath(),e.arc(_,M,1,0,Math.PI*2),e.fillStyle=`rgba(99,102,241,${w})`,e.fill()}const K=new Set,X=(x==null?void 0:x.id)??P??d;if(X){K.add(X);for(const c of z)c.from===X&&K.add(c.to),c.to===X&&K.add(c.from)}const ye=X!=null;for(const c of z){const _=p.get(c.from),M=p.get(c.to);if(!_||!M)continue;const w=ye&&(c.from===X||c.to===X);if(ye&&!w&&h.length>100)continue;const V=_.x*m.zoom+m.x,J=_.y*m.zoom+m.y,g=M.x*m.zoom+m.x,b=M.y*m.zoom+m.y;if(V<-50&&g<-50||J<-50&&b<-50||V>r+50&&g>r+50||J>l+50&&b>l+50)continue;const R=z.indexOf(c),be=15+R%3*6,{cx:ne,cy:ie}=_e(V,J,g,b,be*(R%2===0?1:-1));if(w&&(e.beginPath(),e.moveTo(V,J),e.quadraticCurveTo(ne,ie,g,b),e.strokeStyle="rgba(99,102,241,0.12)",e.lineWidth=5,e.stroke()),e.beginPath(),e.moveTo(V,J),e.quadraticCurveTo(ne,ie,g,b),w){const I=re(_.type),[B,G,ce]=Ce(I);e.strokeStyle=`rgba(${B},${G},${ce},0.5)`,e.lineWidth=1.8}else e.strokeStyle="rgba(100,116,139,0.04)",e.lineWidth=.5;if(e.stroke(),w){const I=Math.max(10,Math.min(24,M.size||14))*m.zoom;De(e,g,b,ne,ie,I+3,"rgba(148,163,184,0.6)")}if(w&&c.label&&c.label!=="co_mentioned"){const B=.25*V+.5*ne+.25*g,G=(1-.5)*(1-.5)*J+2*(1-.5)*.5*ie+.5*.5*b;e.font=`${Math.max(9,10*m.zoom)}px "Inter", system-ui, sans-serif`;const ce=e.measureText(c.label).width+12;e.fillStyle="rgba(15,15,25,0.85)",e.beginPath(),e.roundRect(B-ce/2,G-11,ce,18,4),e.fill(),e.strokeStyle="rgba(99,102,241,0.3)",e.lineWidth=.5,e.stroke(),e.fillStyle="var(--color-accent-light)",e.textAlign="center",e.textBaseline="middle",e.fillText(c.label,B,G)}}for(const c of f){const _=re(c.type),[M,w,E]=Ce(_),V=Math.max(8,Math.min(24,c.size||12)),J=Math.sin(T*.025+c.id.charCodeAt(0)*.5)*1,g=(V+J)*m.zoom;if(!Number.isFinite(g)||g<=0)continue;const b=c.x*m.zoom+m.x,R=c.y*m.zoom+m.y;if(!Number.isFinite(b)||!Number.isFinite(R)||b<-g*3||R<-g*3||b>r+g*3||R>l+g*3)continue;const be=P===c.id,ne=(x==null?void 0:x.id)===c.id,ie=d===c.id,I=be||ne||ie,B=ye&&!K.has(c.id);if(!B){const xe=I?.2:.05+Math.sin(T*.02+c.id.charCodeAt(0))*.015,he=I?g*3.5:g*2,ee=e.createRadialGradient(b,R,g*.3,b,R,he);ee.addColorStop(0,`rgba(${M},${w},${E},${xe})`),ee.addColorStop(.5,`rgba(${M},${w},${E},${xe*.3})`),ee.addColorStop(1,`rgba(${M},${w},${E},0)`),e.fillStyle=ee,e.beginPath(),e.arc(b,R,he,0,Math.PI*2),e.fill()}const G=e.createRadialGradient(b-g*.3,R-g*.35,0,b,R,g);B?(G.addColorStop(0,`rgba(${M},${w},${E},0.06)`),G.addColorStop(1,`rgba(${M},${w},${E},0.02)`)):(G.addColorStop(0,`rgba(${M},${w},${E},${I?.45:.25})`),G.addColorStop(1,`rgba(${M},${w},${E},${I?.18:.07})`)),e.beginPath(),e.arc(b,R,g,0,Math.PI*2),e.fillStyle=G,e.fill(),e.beginPath(),e.arc(b,R,g,0,Math.PI*2),B?(e.strokeStyle=`rgba(${M},${w},${E},0.08)`,e.lineWidth=.5):I?(e.strokeStyle=`rgba(${M},${w},${E},0.9)`,e.lineWidth=2.5):(e.strokeStyle=`rgba(${M},${w},${E},0.4)`,e.lineWidth=1),e.stroke(),ne&&(e.beginPath(),e.arc(b,R,g+5,0,Math.PI*2),e.setLineDash([4,4]),e.lineDashOffset=-T*.3,e.strokeStyle=`rgba(${M},${w},${E},0.4)`,e.lineWidth=1,e.stroke(),e.setLineDash([]));const ce=c.facts.length>=3;if(!B&&(I||ye&&K.has(c.id)||m.zoom>=1.3||m.zoom>=.8&&ce)){const xe=m.zoom>1?20:12,he=c.label.length>xe?c.label.slice(0,xe-1)+"…":c.label,ee=Math.max(9,11*m.zoom);e.font=`600 ${ee}px "Inter", system-ui, sans-serif`;const we=e.measureText(he).width+8;if(e.fillStyle="rgba(9,9,11,0.75)",e.beginPath(),e.roundRect(b-we/2,R-ee/2-1,we,ee+2,3),e.fill(),e.fillStyle=I?"#fafafa":"#a1a1aa",e.textAlign="center",e.textBaseline="middle",e.fillText(he,b,R),m.zoom>.7){const ke=Math.max(7,8*m.zoom);e.font=`500 ${ke}px "Inter", system-ui, sans-serif`,e.fillStyle=`rgba(${M},${w},${E},${I?.9:.5})`,e.fillText(c.type,b,R+g+Math.max(9,11*m.zoom))}}}de.current=requestAnimationFrame(Y)};return de.current=requestAnimationFrame(Y),()=>cancelAnimationFrame(de.current)},[W,P,x,d]),j.useEffect(()=>{const t=ae.current;if(!t||!W.nodes.length)return;const e=Q.current,n=(f,p)=>{const Y=t.getBoundingClientRect(),T=f-Y.left,m=p-Y.top;for(const D of[...W.nodes].reverse()){const F=Math.max(8,Math.min(24,D.size||12))*e.zoom;if(!A(D)||!Number.isFinite(F)||F<=0)continue;const ue=D.x*e.zoom+e.x,ge=D.y*e.zoom+e.y;if(!Number.isFinite(ue)||!Number.isFinite(ge))continue;const K=T-ue,X=m-ge;if(K*K+X*X<=(F+6)*(F+6))return D}return null},a=f=>{f.preventDefault();const p=t.getBoundingClientRect(),Y=f.clientX-p.left,T=f.clientY-p.top,m=e.zoom,D=f.deltaY>0?.92:1.08;e.zoom=Math.max(.2,Math.min(4,e.zoom*D)),e.x=Y-(Y-e.x)*(e.zoom/m),e.y=T-(T-e.y)*(e.zoom/m),k(F=>F)},r=f=>{e.dragging=!0,e.startX=f.clientX-e.x,e.startY=f.clientY-e.y,t.style.cursor="grabbing"},l=f=>{if(e.dragging)e.x=f.clientX-e.startX,e.y=f.clientY-e.startY,k(p=>p);else{const p=n(f.clientX,f.clientY);k((p==null?void 0:p.id)??null),t.style.cursor=p?"pointer":"grab"}},h=()=>{e.dragging=!1,t.style.cursor="grab"},z=f=>{if(e.dragging)return;const p=n(f.clientX,f.clientY);C(Y=>(Y==null?void 0:Y.id)===(p==null?void 0:p.id)?null:p??null)};return t.addEventListener("wheel",a,{passive:!1}),t.addEventListener("mousedown",r),t.addEventListener("mousemove",l),t.addEventListener("mouseup",h),t.addEventListener("mouseleave",h),t.addEventListener("click",z),()=>{t.removeEventListener("wheel",a),t.removeEventListener("mousedown",r),t.removeEventListener("mousemove",l),t.removeEventListener("mouseup",h),t.removeEventListener("mouseleave",h),t.removeEventListener("click",z)}},[W]);const i=j.useMemo(()=>{var e;if(!s)return[];const t=new Map;for(const n of s.nodes){const a=((e=n.type)==null?void 0:e.toLowerCase())??"unknown";t.set(a,(t.get(a)??0)+1)}return[...t.entries()].sort((n,a)=>a[1]-n[1]).map(([n,a])=>({type:n,count:a}))},[s]);if(N)return o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"h-12 animate-pulse rounded-xl bg-bg-secondary"}),o.jsx("div",{className:"animate-pulse rounded-xl border border-border bg-bg",style:{height:"60vh",minHeight:400}})]});const u=s&&s.nodes.length>0;return o.jsxs("div",{className:"space-y-4",ref:fe,children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-accent/10",children:o.jsx(Ne,{className:"h-4 w-4 text-accent-hover"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-lg font-semibold text-text",children:"Memory Graph"}),o.jsx("p",{className:"text-xs text-text-muted",children:"Temporal knowledge graph powered by entity extraction"})]})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[u&&o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>oe(1.2),className:"rounded-lg p-1.5 text-text-muted hover:bg-bg-tertiary hover:text-text transition-colors",title:"Zoom in",children:o.jsx(Ee,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>oe(.8),className:"rounded-lg p-1.5 text-text-muted hover:bg-bg-tertiary hover:text-text transition-colors",title:"Zoom out",children:o.jsx(Ae,{className:"h-4 w-4"})}),o.jsx("button",{onClick:se,className:"rounded-lg p-1.5 text-text-muted hover:bg-bg-tertiary hover:text-text transition-colors",title:"Fit view",children:o.jsx(Fe,{className:"h-4 w-4"})}),o.jsx("div",{className:"mx-1 h-4 w-px bg-bg-tertiary"})]}),o.jsxs("button",{onClick:te,className:"flex items-center gap-1.5 rounded-lg bg-bg-tertiary px-3 py-1.5 text-xs text-text-secondary hover:bg-border hover:text-text transition-colors",children:[o.jsx(ze,{className:"h-3.5 w-3.5"})," Refresh"]}),o.jsxs("button",{onClick:$,className:"flex items-center gap-1.5 rounded-lg bg-bg-tertiary px-3 py-1.5 text-xs text-error hover:bg-error/10 transition-colors",children:[o.jsx(Le,{className:"h-3.5 w-3.5"})," Clear"]})]})]}),S&&o.jsx("div",{className:"rounded-xl border border-error/50 bg-error/5 p-4 text-sm text-error",children:S}),o.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{label:"Entities",value:(s==null?void 0:s.nodeCount)??0,color:"var(--color-accent-hover)"},{label:"Relationships",value:(s==null?void 0:s.edgeCount)??0,color:"var(--color-cyan)"},{label:"Episodes",value:(s==null?void 0:s.episodeCount)??0,color:"var(--color-emerald)"}].map(({label:t,value:e,color:n})=>o.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary px-4 py-3",children:[o.jsx("p",{className:"text-xs text-text-muted",children:t}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("p",{className:"text-2xl font-bold",style:{color:n},children:e.toLocaleString()}),e>0&&o.jsx("div",{className:"h-1.5 w-1.5 rounded-full animate-pulse",style:{backgroundColor:n}})]})]},t))}),u&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"relative",children:[o.jsx(Re,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-text-muted"}),o.jsx("input",{type:"text",value:v,onChange:t=>Z(t.target.value),placeholder:"Search entities and facts...",className:"w-full rounded-lg border border-border bg-bg-secondary py-2 pl-9 pr-8 text-sm text-text placeholder:text-text-muted focus:border-accent focus:outline-none"}),v&&o.jsx("button",{onClick:()=>Z(""),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted hover:text-text",children:o.jsx($e,{className:"h-3.5 w-3.5"})})]}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.map(({type:t,count:e})=>{const n=re(t),a=O.has(t);return o.jsxs("button",{onClick:()=>U(t),className:`inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[11px] font-medium transition-all ${a?"bg-bg-tertiary/50 text-text-muted opacity-40":"bg-bg-tertiary text-text-secondary hover:brightness-110"}`,children:[o.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:a?"var(--color-border-light)":n}}),qe[t]??t.charAt(0).toUpperCase()+t.slice(1),o.jsx("span",{className:"text-text-muted",children:e})]},t)})})]}),u?o.jsxs("div",{className:"relative rounded-xl border border-border bg-bg overflow-hidden shadow-2xl shadow-black/50",style:{height:"60vh",minHeight:400},children:[o.jsx("canvas",{ref:ae,style:{width:"100%",height:"100%",cursor:"grab"}}),o.jsxs("div",{className:"absolute bottom-3 right-3 rounded-md bg-bg/80 px-2 py-1 text-[10px] text-text-muted backdrop-blur-sm border border-bg-tertiary",children:[Math.round(Q.current.zoom*100),"%"]}),(v||O.size>0)&&o.jsxs("div",{className:"absolute top-3 left-3 rounded-md bg-bg/80 px-2 py-1 text-[10px] text-text-muted backdrop-blur-sm border border-bg-tertiary",children:["Showing ",W.nodes.length," of ",(s==null?void 0:s.nodes.length)??0," entities"]})]}):o.jsxs("div",{className:"relative rounded-xl border border-border bg-bg-secondary overflow-hidden flex flex-col items-center justify-center",style:{height:"60vh",minHeight:400},children:[o.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl bg-accent/10 border border-accent/20 mb-4",children:o.jsx(Ne,{className:"h-7 w-7 text-accent-hover"})}),o.jsx("p",{className:"text-sm font-medium text-text-secondary",children:"No entities in the graph yet"}),o.jsx("p",{className:"mt-1 max-w-sm text-center text-xs text-text-muted",children:"Start chatting with TITAN to build the knowledge graph. Entities, relationships, and facts are extracted automatically from conversations."})]}),x&&o.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary overflow-hidden",children:[o.jsxs("div",{className:"flex items-center gap-3 border-b border-bg-tertiary px-4 py-3",children:[o.jsx("div",{className:"h-3.5 w-3.5 rounded-full shadow-lg",style:{backgroundColor:re(x.type),boxShadow:`0 0 8px ${re(x.type)}40`}}),o.jsx("span",{className:"font-semibold text-text",children:x.label}),o.jsx("span",{className:"rounded-md bg-bg-tertiary px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-text-secondary",children:x.type})]}),o.jsxs("div",{className:"space-y-3 p-4",children:[x.facts.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"mb-2 text-xs font-medium uppercase tracking-wider text-text-muted",children:"Facts"}),o.jsx("div",{className:"space-y-1.5",children:x.facts.map((t,e)=>o.jsx("p",{className:"text-xs text-[#d4d4d8] pl-3 border-l-2",style:{borderColor:re(x.type)+"40"},children:t},e))})]}),s&&(()=>{const t=s.edges.filter(n=>n.from===x.id||n.to===x.id);if(!t.length)return null;const e=new Map(s.nodes.map(n=>[n.id,n]));return o.jsxs("div",{children:[o.jsxs("p",{className:"mb-2 text-xs font-medium uppercase tracking-wider text-text-muted",children:["Relationships (",t.length,")"]}),o.jsxs("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:[t.slice(0,30).map((n,a)=>{const r=e.get(n.from===x.id?n.to:n.from),l=r?re(r.type):"#64748b";return o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"text-text-secondary",children:n.label}),o.jsx("span",{className:"text-text-muted",children:"→"}),o.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[o.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:l}}),o.jsx("span",{className:"text-[#d4d4d8]",children:(r==null?void 0:r.label)??"?"})]})]},a)}),t.length>30&&o.jsxs("p",{className:"text-[10px] text-text-muted",children:["+ ",t.length-30," more"]})]})]})})()]})]})]})}export{Ze as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as N,r as n,b as h,j as e}from"./index-CUgepw5Q.js";import{P as u}from"./PageHeader-bnc85wQN.js";import{A as v}from"./arrow-left-qA0Qer2h.js";import{L as w}from"./link-CUpaumqr.js";import{C as k}from"./clock-CF9BCIpL.js";import{S}from"./search-BP7VlNxX.js";import{B as C}from"./book-open-DIxdPqmD.js";import"./chevron-right-CQ1NTOtd.js";/**
|
|
2
|
-
* @license lucide-react v0.513.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const L=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],M=N("tag",L),A={person:"var(--color-accent-hover)",topic:"var(--color-cyan)",project:"var(--color-emerald)",place:"#fbbf24",company:"#facc15",technology:"#2dd4bf",event:"#fb7185"};function d(a){return A[a==null?void 0:a.toLowerCase()]??"#94a3b8"}function b(a){const l=Math.floor((Date.now()-new Date(a).getTime())/1e3);return l<60?"just now":l<3600?`${Math.floor(l/60)}m ago`:l<86400?`${Math.floor(l/3600)}h ago`:`${Math.floor(l/86400)}d ago`}function _(){const[a,l]=n.useState([]),[t,i]=n.useState(null),[g,f]=n.useState(!0),[c,j]=n.useState(""),[o,y]=n.useState(""),x=n.useCallback(async()=>{try{const s=new URLSearchParams;c&&s.set("q",c),o&&s.set("type",o);const r=await h(`/api/wiki/entities?${s}`);r.ok&&l(await r.json())}catch{}finally{f(!1)}},[c,o]),m=async s=>{try{const r=await h(`/api/wiki/entity/${encodeURIComponent(s)}`);r.ok&&i(await r.json())}catch{}};n.useEffect(()=>{x()},[x]);const p=[...new Set(a.map(s=>s.type))].sort();return t?e.jsxs("div",{className:"space-y-4",children:[e.jsx(u,{title:t.name,breadcrumbs:[{label:"Memory"},{label:"Wiki",href:"/memory-wiki"},{label:t.name}],actions:e.jsxs("button",{onClick:()=>i(null),className:"flex items-center gap-1.5 rounded-lg bg-bg-tertiary px-3 py-1.5 text-xs text-text-secondary hover:text-text transition-colors",children:[e.jsx(v,{className:"h-3.5 w-3.5"})," Back to list"]})}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-5",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"h-4 w-4 rounded-full",style:{backgroundColor:d(t.type),boxShadow:`0 0 10px ${d(t.type)}50`}}),e.jsx("h2",{className:"text-xl font-bold text-text",children:t.name}),e.jsx("span",{className:"rounded-md bg-bg-tertiary px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider text-text-secondary",children:t.type})]}),t.summary&&e.jsx("p",{className:"text-sm text-text-secondary mb-2",children:t.summary}),t.aliases.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[e.jsx(M,{className:"h-3 w-3"})," Also known as: ",t.aliases.join(", ")]}),e.jsxs("div",{className:"flex gap-4 mt-3 text-[10px] text-text-muted",children:[e.jsxs("span",{children:["First seen: ",new Date(t.firstSeen).toLocaleDateString()]}),e.jsxs("span",{children:["Last seen: ",b(t.lastSeen)]})]})]}),t.facts.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted mb-3",children:["Facts (",t.facts.length,")"]}),e.jsx("div",{className:"space-y-2",children:t.facts.map((s,r)=>e.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[e.jsx("span",{className:"text-accent mt-0.5",children:"•"}),e.jsx("span",{className:"text-text-secondary",children:s})]},r))})]}),t.related.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted mb-3",children:[e.jsx(w,{className:"h-3 w-3 inline mr-1"})," Related (",t.related.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:t.related.map(s=>e.jsxs("button",{onClick:()=>m(s.name),className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-bg px-3 py-1.5 text-xs hover:border-accent transition-colors",children:[e.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:d(s.type)}}),e.jsx("span",{className:"text-text",children:s.name}),e.jsxs("span",{className:"text-text-muted",children:["(",s.relation,")"]})]},s.id))})]}),t.episodes.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider text-text-muted mb-3",children:[e.jsx(k,{className:"h-3 w-3 inline mr-1"})," Episode History (",t.episodes.length,")"]}),e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:t.episodes.map(s=>e.jsxs("div",{className:"border-l-2 border-border pl-3 py-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-text-muted mb-0.5",children:[e.jsx("span",{children:new Date(s.createdAt).toLocaleString()}),e.jsx("span",{className:"rounded bg-bg-tertiary px-1.5 py-0.5",children:s.source})]}),e.jsx("p",{className:"text-xs text-text-secondary",children:s.content})]},s.id))})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(u,{title:"Memory Wiki",breadcrumbs:[{label:"Memory"},{label:"Wiki"}]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(S,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-text-muted"}),e.jsx("input",{type:"text",value:c,onChange:s=>j(s.target.value),placeholder:"Search entities, facts, summaries...",className:"w-full rounded-lg border border-border bg-bg-secondary py-2 pl-9 pr-4 text-sm text-text placeholder:text-text-muted focus:border-accent focus:outline-none"})]}),e.jsxs("select",{value:o,onChange:s=>y(s.target.value),className:"rounded-lg border border-border bg-bg-secondary px-3 py-2 text-sm text-text-secondary focus:border-accent focus:outline-none",children:[e.jsx("option",{value:"",children:"All types"}),p.map(s=>e.jsx("option",{value:s,children:s},s))]})]}),e.jsxs("div",{className:"flex gap-3 text-xs text-text-muted",children:[e.jsxs("span",{children:[a.length," entities"]}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:[p.length," types"]})]}),g?e.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:Array.from({length:9}).map((s,r)=>e.jsx("div",{className:"h-24 animate-pulse rounded-xl border border-border bg-bg-secondary"},r))}):e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[a.map(s=>e.jsxs("button",{onClick:()=>m(s.name),className:"rounded-xl border border-border bg-bg-secondary p-4 text-left hover:border-accent transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:d(s.type)}}),e.jsx("span",{className:"font-medium text-sm text-text truncate",children:s.name})]}),e.jsx("p",{className:"text-xs text-text-secondary line-clamp-2 mb-2",children:s.summary||"No summary"}),e.jsxs("div",{className:"flex items-center justify-between text-[10px] text-text-muted",children:[e.jsx("span",{className:"capitalize",children:s.type}),e.jsxs("span",{children:[s.factCount," facts"]}),e.jsx("span",{children:b(s.lastSeen)})]})]},s.id)),a.length===0&&e.jsxs("div",{className:"col-span-full py-12 text-center",children:[e.jsx(C,{className:"h-8 w-8 text-text-muted mx-auto mb-2"}),e.jsx("p",{className:"text-text-muted",children:"No entities found"})]})]})]})}export{_ as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{c as l,r as n,j as e,as as y,at as j,au as N,av as f,aw as v}from"./index-CUgepw5Q.js";import{D as k}from"./DataTable-PnhPeDBG.js";import{P as w}from"./PageHeader-bnc85wQN.js";import{R as P}from"./refresh-cw-CwDpzXUn.js";import{S as C}from"./shield-check-s7la2J2K.js";import"./chevron-right-CQ1NTOtd.js";/**
|
|
2
|
-
* @license lucide-react v0.513.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const R=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],M=l("shield-x",R);/**
|
|
7
|
-
* @license lucide-react v0.513.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const S=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],A=l("unplug",S);function q(){const[d,i]=n.useState([]),[o,m]=n.useState([]),[x,h]=n.useState(!0),[c,a]=n.useState(null),r=async()=>{try{const[s,t]=await Promise.all([y(),j()]);i(s),m(t),a(null)}catch(s){a(s instanceof Error?s.message:"Failed to fetch mesh data")}finally{h(!1)}};n.useEffect(()=>{r()},[]);const p=async s=>{try{await N(s),await r()}catch(t){a(t instanceof Error?t.message:"Failed to approve peer")}},g=async s=>{try{await f(s),await r()}catch(t){a(t instanceof Error?t.message:"Failed to reject peer")}},u=async s=>{try{await v(s),await r()}catch(t){a(t instanceof Error?t.message:"Failed to revoke peer")}},b=[{key:"nodeId",header:"Node ID",render:s=>e.jsx("span",{className:"font-mono text-xs",children:s.nodeId})},{key:"url",header:"URL"},{key:"status",header:"Status",render:s=>e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-success"}),e.jsx("span",{className:"capitalize",children:s.status})]})},{key:"connectedAt",header:"Connected At",render:s=>s.connectedAt?e.jsx("span",{children:new Date(s.connectedAt).toLocaleString()}):e.jsx("span",{className:"text-text-muted",children:"-"})},{key:"_actions",header:"",className:"w-16",render:s=>e.jsx("button",{onClick:t=>{t.stopPropagation(),u(s.id)},className:"rounded-md p-1.5 text-error transition-colors hover:bg-bg-tertiary",title:"Revoke peer",children:e.jsx(A,{className:"h-4 w-4"})})}];return x?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"}),e.jsx("div",{className:"h-48 animate-pulse rounded-xl border border-border bg-bg-secondary"})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(w,{title:"Mesh Network",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Mesh"}],actions:e.jsx("button",{onClick:r,className:"rounded-lg p-2 text-text-secondary transition-colors hover:bg-bg-tertiary hover:text-text",title:"Refresh",children:e.jsx(P,{className:"h-4 w-4"})})}),c&&e.jsx("div",{className:"rounded-lg border border-error/50 bg-bg-secondary px-4 py-2 text-sm text-error",children:c}),e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-3 text-sm font-medium text-text-secondary",children:["Pending Requests (",o.length,")"]}),o.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-bg-secondary p-6 text-center text-text-muted",children:"No pending requests"}):e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:o.map(s=>e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsx("p",{className:"font-mono text-sm text-text",children:s.nodeId}),e.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:s.url}),s.name&&e.jsx("p",{className:"mt-1 text-xs text-text-muted",children:s.name}),e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsxs("button",{onClick:()=>p(s.id),className:"flex items-center gap-1.5 rounded-lg bg-success px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-success/80",children:[e.jsx(C,{className:"h-3.5 w-3.5"}),"Approve"]}),e.jsxs("button",{onClick:()=>g(s.id),className:"flex items-center gap-1.5 rounded-lg bg-error px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-error/80",children:[e.jsx(M,{className:"h-3.5 w-3.5"}),"Reject"]})]})]},s.id))})]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-3 text-sm font-medium text-text-secondary",children:["Connected Peers (",d.length,")"]}),e.jsx(k,{columns:b,data:d,emptyMessage:"No connected peers"})]})]})}export{q as default};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import{r as o,j as e,p as Ne,u as Se,aC as Ce}from"./index-CUgepw5Q.js";import{p as ee,f as Me,h as $e,i as De,g as Te,a as de,s as Ae,b as ze,d as Oe,e as Fe}from"./missions-2zox16Tc.js";import{F as Le}from"./FileViewer-CVO3TRs3.js";function Ee({member:t,room:a,anchor:r,availableModels:s,onClose:d,onTalkInChat:u}){const p=o.useRef(null),[l,v]=o.useState("main"),[y,h]=o.useState(""),[b,c]=o.useState(!1),[m,f]=o.useState(!1),[w,j]=o.useState(null);o.useEffect(()=>{const g=E=>{E.key==="Escape"&&d()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[d]);const A=320,T=360,C=Re(r,A,T);async function S(){f(!0),j(null);try{await ee(a.id,`@${t.name} quick check-in — how's it going? Anything I can clear for you?`),d()}catch(g){j(g.message)}finally{f(!1)}}async function L(g){const E=y.trim();if(!(!E||b)){c(!0),j(null);try{await ee(a.id,`@${t.name} ${g}${E}`),h(""),d()}catch(W){j(W.message)}finally{c(!1)}}}async function z(g){f(!0),j(null);try{await De(a.id,t.agentId,g),v("main")}catch(E){j(E.message)}finally{f(!1)}}async function k(){f(!0),j(null);try{await Me(a.id,t.agentId,!t.paused)}catch(g){j(g.message)}finally{f(!1)}}async function R(){f(!0),j(null);try{await $e(a.id,!a.longRunningMode)}catch(g){j(g.message)}finally{f(!1)}}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[60]",onClick:d,"aria-hidden":!0}),e.jsxs("div",{ref:p,className:"absolute z-[61] flex flex-col titan-modal-surface overflow-hidden",style:{left:C.x,top:C.y,width:A,maxHeight:T,borderRadius:12},onClick:g=>g.stopPropagation(),children:[e.jsx("div",{className:"h-1.5",style:{background:`linear-gradient(90deg, ${t.color}, ${ue(t.color,-25)})`}}),e.jsxs("div",{className:"px-4 pt-3 pb-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center text-white font-bold text-[14px]",style:{background:`linear-gradient(135deg, ${t.color}, ${ue(t.color,-25)})`},children:t.name[0]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm",children:t.name}),e.jsxs("div",{className:"text-[11px] text-text-muted",children:[t.role," · ",Pe(t)]})]}),e.jsx("button",{onClick:d,"aria-label":"Close",className:"titan-close-btn w-7 h-7 rounded-full flex items-center justify-center text-sm",style:{border:"1px solid var(--theme-menu-border)"},children:"✕"})]}),t.currentActivity&&e.jsxs("div",{className:"px-4 pb-2 text-[11px] text-text-secondary italic leading-snug border-b border-border/60",children:['"',t.currentActivity,'"']}),w&&e.jsx("div",{className:"px-4 py-2 text-[11px] text-error bg-error/10 border-b border-error/30",children:w}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l==="main"&&e.jsxs("div",{className:"p-2 grid grid-cols-2 gap-2",children:[e.jsx(H,{icon:"👋",label:"Nudge",hint:"A friendly check-in",onClick:S,disabled:m}),e.jsx(H,{icon:"💬",label:"Talk to them",hint:"Send a message just to them",onClick:()=>{u?(u(t.agentId,`@${t.name} `),d()):v("talk")},disabled:m}),e.jsx(H,{icon:"🧭",label:"Steer",hint:"Redirect them mid-task",onClick:()=>v("steer"),disabled:m}),e.jsx(H,{icon:"🧠",label:"Model",hint:t.modelOverride?Ie(t.modelOverride):"default",onClick:()=>v("model"),disabled:m}),e.jsx(H,{icon:t.paused?"▶":"⏸",label:t.paused?"Resume agent":"Pause agent",hint:t.paused?"Bring them back":"Skip them for now",onClick:k,disabled:m,wide:!1}),e.jsx(H,{icon:"🏃",label:a.longRunningMode?"Marathon ON":"Marathon mode",hint:a.longRunningMode?"running 72h goal":"72h auto-run",onClick:R,disabled:m,active:!!a.longRunningMode})]}),(l==="talk"||l==="steer")&&e.jsxs("div",{className:"p-3 flex flex-col gap-2",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-muted",children:l==="talk"?`Message ${t.name}`:`Steer ${t.name}`}),e.jsx("textarea",{autoFocus:!0,value:y,onChange:g=>h(g.target.value),rows:4,onKeyDown:g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),L(l==="steer"?"steer: ":""))},placeholder:l==="steer"?'e.g. "skip the chart, focus on cost comparison"':"Type a private note to them…",className:"bg-bg-tertiary border border-border rounded-lg p-2 text-sm text-text outline-none focus:border-accent resize-none"}),l==="steer"&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["Slow down","Be thorough","Wrap it up","Skip the chart"].map(g=>e.jsx("button",{onClick:()=>h(g.toLowerCase()),className:"px-2 py-0.5 text-[11px] bg-bg-tertiary border border-border rounded-full text-text-muted hover:text-text",children:g},g))}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("button",{onClick:()=>v("main"),className:"text-xs text-text-muted hover:text-text",children:"← Back"}),e.jsx("button",{onClick:()=>L(l==="steer"?"steer: ":""),disabled:!y.trim()||b,className:"px-3 py-1.5 rounded-lg font-bold text-bg-deep bg-gradient-to-br from-accent to-accent2 disabled:opacity-50 text-xs",children:b?"Sending…":"Send ⌘↵"})]})]}),l==="model"&&e.jsxs("div",{className:"p-3 flex flex-col gap-2",children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-text-muted",children:[t.name,"'s brain"]}),e.jsx("div",{className:"text-[11px] text-text-secondary leading-snug",children:"Pick a specific model for this agent on this mission. Empty = the role's default."}),t.modelOverride&&e.jsxs("div",{className:"px-2.5 py-1.5 rounded-lg bg-accent/10 border border-accent/40 text-[12px] text-text flex items-center justify-between",children:[e.jsxs("span",{className:"truncate",children:["Now: ",e.jsx("b",{children:t.modelOverride})]}),e.jsx("button",{onClick:()=>z(null),className:"text-[11px] text-text-muted hover:text-text shrink-0",children:"clear"})]}),e.jsx("div",{className:"flex flex-col gap-1 max-h-48 overflow-y-auto",children:s.length===0?e.jsx("div",{className:"text-[11px] text-text-muted italic",children:"No models discovered. /api/models returned empty."}):s.map(g=>{const E=t.modelOverride===g.id;return e.jsxs("button",{onClick:()=>z(g.id),disabled:m,className:`flex items-center justify-between px-2.5 py-1.5 rounded-lg text-[12px] border text-left ${E?"bg-accent/10 border-accent/60 text-text":"bg-bg-tertiary/40 border-border text-text-secondary hover:text-text hover:border-border-light"}`,children:[e.jsx("span",{className:"truncate",children:g.id}),e.jsx("span",{className:"text-[10px] text-text-muted ml-2 shrink-0",children:g.provider})]},g.id)})}),e.jsx("button",{onClick:()=>v("main"),className:"text-xs text-text-muted hover:text-text self-start mt-1",children:"← Back"})]})]})]})]})}function H({icon:t,label:a,hint:r,onClick:s,disabled:d,wide:u,active:p}){return e.jsxs("button",{onClick:s,disabled:d,className:`text-left p-2.5 rounded-xl border transition-colors ${p?"bg-accent/15 border-accent/50 text-text":"bg-bg-tertiary/40 border-border text-text-secondary hover:text-text hover:border-border-light"} ${u?"col-span-2":""} disabled:opacity-50`,children:[e.jsx("div",{className:"text-lg leading-none mb-1",children:t}),e.jsx("div",{className:"text-[12px] font-semibold leading-tight",children:a}),r&&e.jsx("div",{className:"text-[10px] text-text-muted leading-snug mt-0.5 truncate",children:r})]})}function Re({x:t,y:a},r,s){const d=window.innerWidth,u=window.innerHeight;return{x:Math.max(8,Math.min(t,d-r-8)),y:Math.max(8,Math.min(a,u-s-8))}}function Pe(t){return t.paused?"paused (by you)":t.state==="working"?"working":t.state==="editing"?"editing":t.state==="blocked"?"needs you":t.state==="done"?"done":"idle"}function Ie(t){return t.length<=24?t:t.slice(0,22)+"…"}function ue(t,a){const r=t.replace("#","");if(r.length!==6)return t;const s=parseInt(r,16);let d=s>>16&255,u=s>>8&255,p=s&255;const l=Math.round(255*(a/100));return d=Math.max(0,Math.min(255,d+l)),u=Math.max(0,Math.min(255,u+l)),p=Math.max(0,Math.min(255,p+l)),"#"+(d<<16|u<<8|p).toString(16).padStart(6,"0")}const Be=12;function Ye(t){const a=new Map;for(const s of t){const d=s.activityLog??[];for(const u of d){const p=`${s.agentId}::${u.activity}`,l=a.get(p);if(!l){a.set(p,{id:p,agentId:s.agentId,agentName:s.name,agentColor:s.color,icon:u.icon,activity:u.activity,detail:u.detail,at:u.at,count:1,recentDetails:u.detail?[u.detail]:[]});continue}l.count+=1,u.at>l.at&&(l.at=u.at,l.icon=u.icon,u.detail&&(l.detail=u.detail)),u.detail&&(l.recentDetails=[u.detail,...l.recentDetails.filter(v=>v!==u.detail)].slice(0,3))}}return Array.from(a.values()).sort((s,d)=>s.at<d.at?1:-1).slice(0,Be)}const We=[{cmd:"/slow down",label:"Slow down",hint:"be more careful"},{cmd:"/be thorough",label:"Be thorough",hint:"dig deeper"},{cmd:"/wrap it up",label:"Wrap it up",hint:"finish what you have"},{cmd:"/pause",label:"Pause",hint:"pause the team"}];function He(t){try{const a=localStorage.getItem(he(t));return a?JSON.parse(a):{}}catch{return{}}}function Ge(t,a){try{localStorage.setItem(he(t),JSON.stringify(a))}catch{}}function he(t){return`titan-desk:${t}`}function fe(t){return`titan-desk-furniture:${t}`}function Ke(t){const a={cabinet:[],trash:[],permanentlyHidden:[],cabinetOpen:!1,trashOpen:!1};try{const r=localStorage.getItem(fe(t));if(!r)return a;const s=JSON.parse(r);return{cabinet:Array.isArray(s.cabinet)?s.cabinet:[],trash:Array.isArray(s.trash)?s.trash:[],permanentlyHidden:Array.isArray(s.permanentlyHidden)?s.permanentlyHidden:[],cabinetOpen:!!s.cabinetOpen,trashOpen:!!s.trashOpen}}catch{return a}}function _e(t,a){try{localStorage.setItem(fe(t),JSON.stringify(a))}catch{}}function $t(){const{id:t}=Ne(),a=Se(),[r,s]=o.useState(null),[d,u]=o.useState(!0),[p,l]=o.useState(null),[v,y]=o.useState(""),[h,b]=o.useState(!1),[c,m]=o.useState(!1),f=o.useRef(null),[w,j]=o.useState(()=>({width:typeof window>"u"?1400:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}));o.useLayoutEffect(()=>{const n=f.current;if(!n)return;const i=()=>{const M=n.getBoundingClientRect();j($=>{const P=Math.max(320,Math.round(M.width)),N=Math.max(320,Math.round(M.height));return $.width===P&&$.height===N?$:{width:P,height:N}})};i();const x=typeof ResizeObserver<"u"?new ResizeObserver(i):null;return x==null||x.observe(n),window.addEventListener("resize",i),()=>{x==null||x.disconnect(),window.removeEventListener("resize",i)}},[d,r==null?void 0:r.id]);const A=o.useCallback(()=>{var i;const n=(i=f.current)==null?void 0:i.getBoundingClientRect();return n||{left:0,top:0,width:typeof window>"u"?1400:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}},[]),T=o.useCallback((n,i)=>{const x=A();return{x:n-x.left,y:i-x.top}},[A]),C=o.useCallback((n,i)=>{const x=T(n,i);return{x:Math.max(8,Math.min(x.x,w.width-328)),y:Math.max(8,Math.min(x.y,w.height-368))}},[w,T]),[S,L]=o.useState({});o.useEffect(()=>{t&&L(He(t))},[t]);const z=o.useCallback(n=>{L(n),t&&Ge(t,n)},[t]),[k,R]=o.useState({cabinet:[],trash:[],permanentlyHidden:[],cabinetOpen:!1,trashOpen:!1});o.useEffect(()=>{t&&R(Ke(t))},[t]);const g=o.useCallback(n=>{R(n),t&&_e(t,n)},[t]),[E,W]=o.useState([]);o.useEffect(()=>{Ce().then(W).catch(()=>W([]))},[]);const[B,G]=o.useState(null),[J,V]=o.useState(null),te=o.useCallback(async n=>{if(t){V({ref:n,loading:!0});try{const i=await Te(t,n);V({ref:n,loading:!1,file:i})}catch(i){V({ref:n,loading:!1,error:i.message})}}},[t]);o.useEffect(()=>{if(!t)return;let n=!0;return u(!0),de(t).then(({mission:i})=>{n&&(s(i),u(!1))}).catch(i=>{n&&(l(i.message),u(!1))}),()=>{n=!1}},[t]),o.useEffect(()=>t?Ae(t,i=>{if(i.kind==="mission_deleted"){a("/mission");return}i.kind!=="hello"&&de(t).then(({mission:x})=>s(x)).catch(()=>{})}):void 0,[t,a]);const ae=o.useCallback(async n=>{if(!(!r||!n.trim()||h)){b(!0);try{await ee(r.id,n.trim()),y("")}catch(i){l(i.message)}finally{b(!1)}}},[r,h]),me=o.useCallback(async(n,i)=>{if(r)try{await ze(r.id,n,i)}catch(x){l(x.message)}},[r]),ge=o.useCallback(async()=>{if(!r)return;const n=r.status==="paused"?"working":"paused";try{await Oe(r.id,n)}catch(i){l(i.message)}},[r]),be=o.useCallback(async()=>{if(!(!r||!window.confirm(`Delete this mission?
|
|
2
|
-
|
|
3
|
-
"${r.goal.slice(0,120)}${r.goal.length>120?"…":""}"
|
|
4
|
-
|
|
5
|
-
The file is renamed on disk (recoverable manually), but the mission disappears from the UI immediately.`)))try{await Fe(r.id),a("/mission")}catch(i){l(i.message)}},[r,a]),K=o.useMemo(()=>r?[...r.messages].reverse().find(i=>i.kind==="question"&&!i.answer):void 0,[r]),_=o.useMemo(()=>{if(!r)return[];const n=new Map;for(const i of r.messages)if(!(i.kind!=="agent"||!Array.isArray(i.sources)))for(const x of i.sources)(x.type==="file"||x.type==="report")&&n.set(x.ref,{ref:x.ref,description:x.description,type:x.type});return Array.from(n.values())},[r]),X=o.useMemo(()=>r?Ye(r.team.map(n=>({agentId:n.agentId,name:n.name,color:n.color,activityLog:n.activityLog}))):[],[r]),U=o.useMemo(()=>{if(!r)return[];const n=new Map;for(const i of r.messages)if(!(i.kind!=="agent"||!Array.isArray(i.sources)))for(const x of i.sources)x.type==="fact"&&n.set(x.ref,{ref:x.ref,description:x.description});return Array.from(n.values()).slice(0,8)},[r]),O=o.useMemo(()=>{if(!r)return[];const n=[];n.push({id:"goal",kind:"goal"}),n.push({id:"document",kind:"document"}),n.push({id:"cost",kind:"cost"}),n.push({id:"clock",kind:"clock"}),n.push({id:"cabinet",kind:"cabinet"}),n.push({id:"trash",kind:"trash"});for(const i of r.team)n.push({id:`agent:${i.agentId}`,kind:"agent",ref:i.agentId});for(const i of _)n.push({id:`file:${i.ref}`,kind:"file",ref:i.ref});for(const i of U)n.push({id:`fact:${i.ref}`,kind:"fact",ref:i.ref});for(const i of X)n.push({id:i.id,kind:"activity",ref:i.id});return K&&n.push({id:`q:${K.approvalId}`,kind:"question",ref:K.approvalId}),n},[r,_,U,X,K]),ne=o.useCallback(n=>k.cabinet.includes(n)||k.trash.includes(n)||k.permanentlyHidden.includes(n),[k]),ve=o.useCallback((n,i)=>i==="cabinet"?(g({...k,cabinet:[...new Set([...k.cabinet,n])],trash:k.trash.filter(x=>x!==n)}),!0):i==="trash"?(g({...k,trash:[...new Set([...k.trash,n])],cabinet:k.cabinet.filter(x=>x!==n)}),!0):!1,[k,g]),re=o.useCallback(n=>{g({...k,cabinet:k.cabinet.filter(i=>i!==n),trash:k.trash.filter(i=>i!==n)})},[k,g]),se=o.useCallback(()=>{g({...k,cabinetOpen:!k.cabinetOpen})},[k,g]),ie=o.useCallback(()=>{g({...k,trashOpen:!k.trashOpen})},[k,g]),ye=o.useCallback(n=>{g({...k,trash:k.trash.filter(i=>i!==n),permanentlyHidden:[...new Set([...k.permanentlyHidden,n])]})},[k,g]),Y=o.useCallback((n,i)=>{const x=w.width,M=w.height,$=x/2,P=M/2;if(n.kind==="goal")return{x:$-220,y:90,z:5,rotation:-1.2};if(n.kind==="document")return{x:$-240,y:P-220,z:4,rotation:.4};if(n.kind==="cost")return{x:x-130,y:90,z:6,rotation:2};if(n.kind==="clock")return{x:x-440,y:M-240,z:7,rotation:-1.5};if(n.kind==="cabinet")return{x:30,y:M-280,z:3,rotation:0};if(n.kind==="trash")return{x:x-130,y:M-220,z:13,rotation:0};if(n.kind==="question")return{x:$+120,y:200,z:30,rotation:-3};if(n.kind==="agent"){const N=i.filter(F=>F.kind==="agent").findIndex(F=>F.id===n.id),D=N%2,I=Math.floor(N/2);return{x:x-280+D*20,y:200+I*180+D*30,z:10+N,rotation:(N%2===0?-1:1)*(1.5+N*.5)}}if(n.kind==="file"){const N=i.filter(F=>F.kind==="file").findIndex(F=>F.id===n.id),D=N%2,I=Math.floor(N/2);return{x:60+D*30,y:180+I*180+D*25,z:8+N,rotation:(N%2===0?1:-1)*(2+N*.3)}}if(n.kind==="fact"){const N=i.filter(F=>F.kind==="fact").findIndex(F=>F.id===n.id),D=N%3,I=Math.floor(N/3);return{x:$-160+D*100+(I%2===0?0:25),y:M-280+I*80,z:12+N,rotation:(N%2===0?-1:1)*(4+N*.7)}}if(n.kind==="activity"){const N=i.filter(Z=>Z.kind==="activity").findIndex(Z=>Z.id===n.id),D=Math.max(4,Math.floor((x-120)/180)),I=N%D,F=Math.floor(N/D);return{x:40+I*180+(F%2===0?0:40),y:M-200-F*110,z:14+N,rotation:(N%2===0?-1:1)*(2+N*.3)}}return{x:100,y:100,z:1,rotation:0}},[w]),oe=o.useCallback(n=>S[n.id]??Y(n,O),[S,O,Y]),q=o.useCallback((n,i)=>{const x={...S,[n]:i};z(x)},[S,z]),ke=o.useCallback(n=>{const i=Math.max(0,...O.map(M=>(S[M.id]??Y(M,O)).z)),x=S[n]??Y(O.find(M=>M.id===n),O);x.z>=i||q(n,{...x,z:i+1})},[O,S,Y,q]),we=o.useCallback(()=>{t&&z({})},[t,z]),je=o.useCallback((n,i,x)=>{g({...k,cabinet:k.cabinet.filter(D=>D!==n),trash:k.trash.filter(D=>D!==n)});const M=Math.max(0,...O.map(D=>(S[D.id]??Y(D,O)).z)),$=S[n],P=($==null?void 0:$.rotation)??Math.random()*6-3,N=T(i,x);q(n,{x:N.x-80,y:N.y-20,z:M+1,rotation:P})},[k,g,O,S,Y,q,T]);if(d)return e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm",style:{background:"var(--theme-bg-base, #3a2a1c)",color:"var(--theme-paper-fg, #f3e9d0)"},children:"Setting the desk…"});if(p||!r)return e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center flex-col gap-3",style:{background:"var(--theme-bg-base, #3a2a1c)"},children:[e.jsx("div",{className:"text-[#ffb4a2] text-sm",children:p??"Mission not found."}),e.jsx("button",{onClick:()=>a("/mission"),className:"text-sm hover:underline",style:{color:"var(--theme-paper-fg, #f3e9d0)"},children:"← Start a new mission"})]});const{working:le,blocked:ce}=pe(r);return e.jsxs("div",{ref:f,className:"absolute inset-0 overflow-hidden font-sans",style:{...xt,color:"var(--theme-paper-fg, #f3e9d0)",fontFamily:"var(--theme-font-display, ui-sans-serif, system-ui)"},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0",style:ht}),e.jsx("div",{className:"pointer-events-none absolute inset-0",style:ft}),e.jsxs("header",{className:"relative z-30 flex flex-wrap items-center justify-between gap-3 px-4 py-3 sm:px-5 sm:py-3.5",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-3",children:[e.jsx("button",{onClick:()=>a("/mission"),className:"hover:text-white text-sm",style:{color:"var(--theme-metal-bright, #e7d6a8)"},title:"New mission",children:"←"}),e.jsx("button",{onClick:()=>a("/mission/library"),className:"text-[10px] uppercase tracking-widest hover:text-white rounded-full px-2 py-0.5",style:{color:"var(--theme-ink-soft, #d9c08c)",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},title:"Browse past missions",children:"Library"}),e.jsx("button",{onClick:()=>a("/space/home"),className:"text-[10px] uppercase tracking-widest hover:text-white rounded-full px-2 py-0.5 inline-flex items-center gap-1",style:{color:"var(--theme-ink-soft, #d9c08c)",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},title:"Back to the canvas spaces",children:"🌌 Canvas"}),e.jsxs("div",{className:"min-w-0 font-semibold tracking-tight",style:{color:"var(--theme-paper-fg, #f3e9d0)"},children:[e.jsx("span",{style:{background:"linear-gradient(90deg, var(--theme-metal-bright, #f3d27a), var(--theme-metal, #d8a85a))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"TITAN"}),e.jsx("span",{className:"font-normal",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:" › "}),e.jsx("span",{className:"font-normal",style:{color:"var(--theme-metal-bright, #e7d6a8)"},children:"Desk"})]})]}),e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-start gap-2 sm:justify-end",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${ce>0?"bg-error animate-pulse":le>0?"bg-accent animate-pulse":"bg-success"}`}),e.jsx("span",{style:{color:"var(--theme-metal-bright, #e7d6a8)"},children:bt(r.status,le,ce)})]}),r.longRunningMode&&e.jsx("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold",style:{background:"linear-gradient(90deg, rgba(245,210,122,0.18), rgba(176,138,58,0.18))",border:"1px solid var(--theme-metal-dark, #b08a3a)",color:"var(--theme-metal-bright, #ffd86e)"},title:"Marathon mode — long-running multi-agent collaboration (72h cap)",children:"🏃 Marathon"}),e.jsx("button",{onClick:we,className:"px-3 py-1.5 text-xs rounded-full hover:text-white",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-metal-bright, #e7d6a8)"},title:"Reset every item to a sensible starting position",children:"Tidy up"}),e.jsx("button",{onClick:()=>a(`/mission/${r.id}`),className:"px-3 py-1.5 text-xs rounded-full hover:text-white",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-metal-bright, #e7d6a8)"},title:"Switch to the chat thread view",children:"Chat view"}),e.jsx("button",{onClick:ge,className:"px-3 py-1.5 text-xs rounded-full hover:text-white",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-metal-bright, #e7d6a8)"},children:r.status==="paused"?"Resume":"Pause"}),e.jsx("button",{onClick:be,className:"px-3 py-1.5 text-xs rounded-full hover:text-[#ff9c9c] hover:border-[#ff9c9c]/50 transition-colors",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-ink-soft, #d9c08c)"},title:"Delete this mission",children:"🗑 Delete"}),e.jsx("button",{onClick:()=>m(n=>!n),className:"w-8 h-8 rounded-full hover:text-white font-semibold text-sm flex items-center justify-center",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-metal-bright, #e7d6a8)"},title:"What's this?",children:"?"})]})]}),e.jsx(mt,{items:O,room:r,poseOf:oe,isHidden:ne}),e.jsx("div",{className:"absolute inset-0 z-10 pointer-events-none",children:O.map(n=>{if(ne(n.id))return null;const i=oe(n),x=n.kind==="agent",M=n.kind==="file"||n.kind==="fact"||n.kind==="activity";return e.jsx(Xe,{pose:i,onGrab:()=>ke(n.id),onPose:$=>q(n.id,$),onClick:x?($,P)=>G({agentId:n.ref,anchor:C($,P)}):void 0,onDrop:M?$=>ve(n.id,$):void 0,children:e.jsx(Ue,{item:n,room:r,openQuestion:K,fileSources:_,factSources:U,activityStickies:X,furniture:k,onOpenCabinet:se,onOpenTrash:ie,onOpenFile:te,onAnswer:me})},n.id)})}),k.cabinetOpen&&e.jsx(dt,{itemIds:k.cabinet,items:O,fileSources:_,factSources:U,activityStickies:X,onRestore:re,onRestoreAt:je,onOpenFile:te,onClose:se}),k.trashOpen&&e.jsx(ut,{itemIds:k.trash,items:O,fileSources:_,factSources:U,activityStickies:X,onRestore:re,onDeleteForever:ye,onClose:ie}),B&&(()=>{const n=r.team.find(x=>x.agentId===B.agentId);if(!n)return null;const i=E.map(x=>({id:x.id,label:x.name,provider:x.provider}));return e.jsx(Ee,{member:n,room:r,anchor:B.anchor,availableModels:i,onClose:()=>G(null)})})(),e.jsxs("footer",{className:"absolute left-0 right-0 bottom-0 z-30 px-3 pb-12 pt-3 sm:px-5 md:pb-8 flex flex-col gap-2",style:{background:"linear-gradient(to top, var(--theme-leather-edge, rgba(29,19,10,0.95)), transparent)"},children:[e.jsxs("div",{className:"flex max-h-24 flex-wrap items-center gap-2 overflow-y-auto pr-1 max-w-5xl mx-auto w-full sm:max-h-none sm:overflow-visible sm:pr-0",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:"quick steer"}),We.map(n=>e.jsx("button",{onClick:()=>ae(n.cmd),disabled:h,title:n.hint,className:"px-2.5 py-1 text-[11px] rounded-full hover:text-white disabled:opacity-50",style:{color:"var(--theme-metal-bright, #e7d6a8)",background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:n.label},n.cmd))]}),e.jsx("div",{className:"flex items-center gap-3 max-w-5xl mx-auto w-full",children:e.jsxs("form",{onSubmit:n=>{n.preventDefault(),ae(v)},className:"min-w-0 flex-1 h-11 flex items-center gap-2.5 px-3.5 rounded-full",style:{background:"var(--theme-leather, rgba(42,29,17,0.8))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:[e.jsx("input",{value:v,onChange:n=>y(n.target.value),placeholder:'Tell the team — "Add a one-line risk note at the top"',className:"min-w-0 flex-1 bg-transparent outline-none text-sm placeholder:text-[#d9c08c]/50",style:{color:"var(--theme-paper-fg, #f3e9d0)"}}),e.jsx("span",{className:"px-2 py-1 text-[10px] uppercase tracking-widest rounded",style:{color:"var(--theme-ink-soft, #d9c08c)",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:"↵"})]})}),e.jsx("div",{className:"max-w-5xl mx-auto w-full text-center text-[11px] italic",style:{color:"var(--theme-ink-soft, #d9c08c)",opacity:.7},children:"Your team works independently, but asks before risky or sensitive changes."})]}),J&&e.jsx(Le,{state:J,onClose:()=>V(null)}),c&&e.jsxs("div",{className:"absolute left-4 right-4 top-20 z-40 rounded-xl p-4 backdrop-blur-xl shadow-2xl sm:left-auto sm:right-5 sm:w-80",style:{background:"var(--theme-leather, rgba(42,29,17,0.95))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:[e.jsx("button",{onClick:()=>m(!1),className:"absolute top-3 right-3 hover:text-white text-sm",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:"✕"}),e.jsx("h3",{className:"font-semibold text-sm mb-2",style:{color:"var(--theme-paper-fg, #f3e9d0)"},children:"The desk"}),e.jsxs("p",{className:"text-xs leading-relaxed mb-3",style:{color:"var(--theme-metal-bright, #e7d6a8)"},children:["Everything the team produces lands on this desk as a physical object. Drag anything anywhere. ",e.jsx("b",{children:"Tidy up"})," resets the layout if it gets cluttered."]}),e.jsxs("ul",{className:"space-y-2 text-xs",style:{color:"var(--theme-metal-bright, #e7d6a8)"},children:[e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"📜"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Leather placard"})," — your mission goal."]})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"📄"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Paper sheets"})," — files the team wrote. Double-click to open."]})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"👤"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Index cards"})," — each AI helper, showing what they're doing now."]})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"💡"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Sticky notes"})," — facts the team picked up while working."]})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"📕"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Pink card"})," — a question waiting on you."]})]})]})]}),e.jsx("style",{children:pt})]})}function Xe({pose:t,onGrab:a,onPose:r,onClick:s,onDrop:d,children:u}){const[p,l]=o.useState(null),v=p?{x:p.x,y:p.y}:{x:t.x,y:t.y},y=o.useCallback(h=>{if(h.pointerType==="mouse"&&h.button!==0||h.target.closest("[data-no-drag]"))return;h.preventDefault(),a();const c=h.currentTarget,m=h.clientX,f=h.clientY,w=h.pointerId,j=t.x,A=t.y;l({dx:0,dy:0,x:j,y:A});try{c.setPointerCapture(w)}catch{}const T=S=>{if(S.pointerId!==w)return;const L=S.clientX-m,z=S.clientY-f;l({dx:L,dy:z,x:j+L,y:A+z})},C=S=>{if(S.pointerId!==w)return;const L=S.clientX-m,z=S.clientY-f;window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",C);try{c.releasePointerCapture(w)}catch{}const k=j+L,R=A+z;if(l(null),!(Math.abs(L)>4||Math.abs(z)>4)){s&&s(S.clientX,S.clientY);return}if(d){const E=document.elementsFromPoint(S.clientX,S.clientY);for(const W of E){const B=W.closest("[data-drop-target]");if(!B||B.contains(c))continue;const G=B.getAttribute("data-drop-target");if(G){if(d(G)!==!1)return;break}}}r({...t,x:k,y:R})};window.addEventListener("pointermove",T),window.addEventListener("pointerup",C),window.addEventListener("pointercancel",C)},[t,a,r,s,d]);return e.jsx("div",{onPointerDown:y,className:"absolute select-none pointer-events-auto cursor-grab touch-none active:cursor-grabbing",style:{left:v.x,top:v.y,zIndex:p?999:t.z,transform:`rotate(${t.rotation}deg) ${p?"scale(1.03)":""}`,transition:p?"transform 80ms ease-out":"transform 200ms ease-out",filter:p?"drop-shadow(0 22px 32px rgba(0,0,0,0.55))":"drop-shadow(0 6px 14px rgba(0,0,0,0.42))",willChange:p?"left, top":void 0},children:u})}function Ue({item:t,room:a,openQuestion:r,fileSources:s,factSources:d,activityStickies:u,furniture:p,onOpenCabinet:l,onOpenTrash:v,onOpenFile:y,onAnswer:h}){if(t.kind==="goal")return e.jsx(qe,{goal:a.goal,status:a.status});if(t.kind==="document")return e.jsx(Ve,{room:a});if(t.kind==="cost")return e.jsx(Ze,{room:a});if(t.kind==="clock")return e.jsx(Qe,{room:a});if(t.kind==="cabinet")return e.jsx(lt,{count:p.cabinet.length,onOpen:l});if(t.kind==="trash")return e.jsx(ct,{count:p.trash.length,onOpen:v});if(t.kind==="agent"){const b=a.team.find(c=>c.agentId===t.ref);return b?e.jsx(tt,{member:b}):null}if(t.kind==="file"){const b=s.find(c=>c.ref===t.ref);return b?e.jsx(nt,{file:b,onOpen:()=>y(b.ref)}):null}if(t.kind==="fact"){const b=d.find(c=>c.ref===t.ref);return b?e.jsx(rt,{fact:b}):null}if(t.kind==="activity"){const b=u.find(c=>c.id===t.ref);return b?e.jsx(st,{sticky:b}):null}return t.kind==="question"&&r?e.jsx(ot,{msg:r,onAnswer:b=>h(r.approvalId,b)}):null}function qe({goal:t,status:a}){const r={forming:{text:"forming the team…",dotColor:"#c4a14a",dotGlow:"#c4a14a"},working:{text:"in progress — TITAN",dotColor:"#8ed1ff",dotGlow:"#8ed1ff"},paused:{text:"paused — your call",dotColor:"#d9c08c",dotGlow:"#d9c08c"},blocked:{text:"needs your input",dotColor:"#ff9c9c",dotGlow:"#ff9c9c"},done:{text:"complete · signed off",dotColor:"#22c55e",dotGlow:"#22c55e"},failed:{text:"stopped — see chat",dotColor:"#ef4444",dotGlow:"#ef4444"}},s=r[a]??r.working;return e.jsxs("div",{className:"w-[420px] px-5 py-4 relative",style:{background:"linear-gradient(140deg, var(--theme-leather, #6b2c2a) 0%, var(--theme-leather-edge, #4a1816) 60%, var(--theme-bolt, #3b110f) 100%)",border:"1px solid var(--theme-bolt, #2a0908)",borderRadius:10,boxShadow:"inset 0 0 24px var(--theme-shadow, rgba(0,0,0,0.5)), 0 0 0 4px rgba(0,0,0,0.08), 0 0 32px color-mix(in srgb, var(--theme-accent, #c45a30) 28%, transparent)",backgroundBlendMode:"multiply",color:"var(--theme-paper-fg, #f3e9d0)"},children:[e.jsx("div",{className:"text-[10px] uppercase mb-1.5",style:{letterSpacing:"0.16em",color:"var(--theme-ink-soft, #d9c08c)",fontWeight:600},children:"Active Mission"}),e.jsx("div",{className:"leading-snug font-semibold tracking-tight",style:{fontSize:22,color:"var(--theme-paper-fg, #f3e9d0)"},children:t}),e.jsxs("div",{className:"mt-2 flex items-center gap-2 text-[10px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, rgba(217,192,140,0.7))"},children:[e.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${a==="working"||a==="blocked"||a==="forming"?"animate-pulse":""}`,style:{background:s.dotColor,boxShadow:`0 0 6px ${s.dotGlow}`}}),e.jsx("span",{children:s.text})]})]})}function Ve({room:t}){var y;const a=((y=t.artifact)==null?void 0:y.content)??"",r=o.useRef(a.length),[s,d]=o.useState(!1);o.useEffect(()=>{if(a.length>r.current){d(!0);const h=setTimeout(()=>d(!1),2e3);return r.current=a.length,()=>clearTimeout(h)}r.current=a.length},[a]);const u=o.useMemo(()=>a.split(`
|
|
6
|
-
`).filter(b=>b.trim().length>0).slice(0,10),[a]),p=a.trim().split(/\s+/).filter(Boolean).length,l=t.team.some(h=>h.state==="working"||h.state==="editing"),v=l&&t.team.some(h=>(h.state==="working"||h.state==="editing")&&(h.name.toLowerCase().includes("analyst")||(h.role??"").toLowerCase().includes("analyst")));return e.jsxs("div",{className:"w-[620px] max-w-[92vw] rounded-md p-8 pt-7 relative",style:{background:"var(--theme-paper, #f7f5ee)",color:"var(--theme-ink, #1a1f2e)",fontFamily:'var(--theme-font-display, "Iowan Old Style", "Charter", "Georgia", serif)',backgroundImage:"repeating-linear-gradient(180deg, transparent 0 26px, var(--theme-paper-line, #d8d3c2) 26px 27px)",backgroundPosition:"0 56px",boxShadow:"0 18px 40px var(--theme-shadow, rgba(0,0,0,0.45)), 0 6px 14px var(--theme-shadow, rgba(0,0,0,0.35)), 0 0 0 1px color-mix(in srgb, var(--theme-accent, #c45a30) 12%, transparent)"},children:[e.jsx("h1",{className:"text-[22px] font-semibold tracking-tight leading-tight mb-1",children:yt(t.goal,70)}),e.jsxs("div",{className:"text-[11px] uppercase tracking-widest mb-4 flex items-center gap-2",style:{color:"var(--theme-ink-soft, #8a8472)"},children:[e.jsxs("span",{children:["Draft · ",p," words · ",vt(t.status)]}),s&&l&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--theme-accent, #c4a35a)"}}),e.jsx("span",{className:"text-[10px] italic",children:"Writing…"})]})]}),u.length>0?e.jsx("div",{className:"text-[14px] leading-[1.6] space-y-3",children:u.map((h,b)=>e.jsxs("p",{children:[h,s&&l&&b===u.length-1&&e.jsx("span",{className:"inline-block w-0.5 h-3.5 ml-0.5 align-middle animate-pulse",style:{background:"var(--theme-accent, #c4a35a)"}})]},b))}):e.jsx("div",{className:"text-[12px] italic py-6 text-center",style:{color:"var(--theme-ink-soft, #8a8472)"},children:"The team is just getting started — your document fills in as they work."}),v&&e.jsx(Je,{})]})}function Je(){return e.jsxs("div",{className:"mt-5 pt-4",style:{borderTop:"1px dashed var(--theme-paper-line, #d8d3c2)"},children:[e.jsxs("svg",{viewBox:"0 0 320 110",className:"w-full h-[110px]","aria-hidden":!0,style:{overflow:"visible"},children:[e.jsx("line",{x1:"22",y1:"6",x2:"22",y2:"92",stroke:"var(--theme-ink-soft, #8a8472)",strokeWidth:"1",opacity:"0.5"}),e.jsx("line",{x1:"22",y1:"92",x2:"312",y2:"92",stroke:"var(--theme-ink-soft, #8a8472)",strokeWidth:"1",opacity:"0.5"}),[20,44,68].map(t=>e.jsx("line",{x1:"18",y1:t,x2:"22",y2:t,stroke:"var(--theme-ink-soft, #8a8472)",strokeWidth:"1",opacity:"0.35"},t)),[{x:40,h:52},{x:82,h:68},{x:124,h:32},{x:166,h:78},{x:208,h:46},{x:250,h:62},{x:292,h:40}].map((t,a)=>e.jsx("rect",{x:t.x-12,y:92-t.h,width:24,height:t.h,fill:"none",stroke:"var(--theme-accent, #c45a30)",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.55",style:{animation:"tetherFlow 2.4s linear infinite"}},a))]}),e.jsx("div",{className:"text-[11px] italic mt-1 text-center",style:{color:"var(--theme-ink-soft, #8a8472)"},children:"Analyst computing…"})]})}function Ze({room:t}){return e.jsxs("div",{className:"w-[110px] h-[110px] rounded-full flex flex-col items-center justify-center",style:{background:"radial-gradient(circle at 35% 30%, var(--theme-leather, #2b1a14) 0%, var(--theme-leather-edge, #1a0e08) 70%)",boxShadow:"inset 0 0 18px var(--theme-shadow, rgba(0,0,0,0.6)), 0 0 0 5px var(--theme-metal-dark, #6e4a26), 0 0 0 6px var(--theme-bolt, #382213)",color:"var(--theme-paper-fg, #f3e9d0)"},title:"Tokens + dollars spent this mission",children:[e.jsx("span",{className:"text-[9px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:"spent"}),e.jsxs("span",{className:"text-[20px] font-bold tabular-nums",children:["$",t.cost.usd.toFixed(2)]}),e.jsxs("span",{className:"text-[9px] tabular-nums",style:{color:"var(--theme-ink-soft, rgba(217,192,140,0.8))"},children:[(t.cost.tokens/1e3).toFixed(1),"k tok"]})]})}function Qe({room:t}){const[a,r]=o.useState(()=>new Date);o.useEffect(()=>{const m=setInterval(()=>r(new Date),1e3);return()=>clearInterval(m)},[]);const s=String(a.getHours()).padStart(2,"0"),d=String(a.getMinutes()).padStart(2,"0"),u=String(a.getSeconds()).padStart(2,"0"),p=o.useMemo(()=>{try{const m=new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(new Date).find(f=>f.type==="timeZoneName");return(m==null?void 0:m.value)??""}catch{return""}},[]),l=o.useMemo(()=>new Date(t.createdAt).getTime(),[t.createdAt]),v=t.status==="paused"||t.status==="done"||t.status==="failed",y=v?Math.max(0,new Date(t.updatedAt).getTime()-l):Math.max(0,a.getTime()-l),h=et(y),{working:b,blocked:c}=pe(t);return e.jsxs("div",{className:"w-[260px] p-4 pb-3",style:{background:"radial-gradient(ellipse at 30% 25%, var(--theme-leather, #4a2e18) 0%, var(--theme-bolt, #2a1808) 75%, var(--theme-leather-edge, #1a0e04) 100%)",borderRadius:14,boxShadow:"0 0 0 3px var(--theme-metal-dark, #b08a3a), 0 0 0 5px var(--theme-bolt, #5a3a14), 0 12px 22px var(--theme-shadow, rgba(0,0,0,0.5)), inset 0 0 16px rgba(0,0,0,0.6)",color:"var(--theme-metal-bright, #f5d27a)"},children:[e.jsxs("div",{className:"text-[9px] uppercase tracking-[0.28em] text-center mb-1.5",style:{color:"var(--theme-metal, #c4a14a)"},children:["TITAN",p?" · "+p:""]}),e.jsxs("div",{className:"flex items-baseline justify-center gap-1 mb-1",style:{fontFamily:'"DSEG7 Classic", "Orbitron", "Menlo", monospace',textShadow:"0 0 10px rgba(245,210,122,0.65), 0 0 22px rgba(245,210,122,0.35)"},children:[e.jsx(xe,{value:s}),e.jsx("span",{className:"text-[28px] font-bold opacity-80 -translate-y-0.5 animate-pulse",children:":"}),e.jsx(xe,{value:d}),e.jsx("span",{className:"text-[20px] font-bold opacity-60 -translate-y-0.5",children:":"}),e.jsx("span",{className:"text-[24px] font-bold opacity-80 tabular-nums",children:u})]}),e.jsxs("div",{className:"text-center text-[10px] uppercase tracking-[0.22em] mb-1.5",style:{fontFamily:"system-ui",color:"var(--theme-metal, rgba(196,161,74,0.85))"},children:["Mission · ",h.hh,":",h.mm,":",h.ss,v&&e.jsxs("span",{className:"ml-1.5",style:{color:"var(--theme-ink-soft, rgba(217,192,140,0.7))"},children:["· ",t.status]})]}),e.jsxs("div",{className:"flex items-center justify-center gap-3 pt-2",style:{fontFamily:"system-ui",borderTop:"1px solid var(--theme-bolt, rgba(90,58,20,0.6))"},children:[e.jsx(Q,{n:b,label:"working",tone:"accent"}),e.jsx(Q,{n:c,label:c===1?"needs you":"need you",tone:"warn"}),e.jsx(Q,{n:t.team.length,label:"on team",tone:"muted"})]})]})}function xe({value:t}){return e.jsx("span",{className:"text-[34px] font-bold tabular-nums leading-none",children:t})}function Q({n:t,label:a,tone:r}){const s=r==="accent"?"#8ed1ff":r==="warn"?"#ff9c9c":"var(--theme-metal, #c4a14a)";return e.jsxs("div",{className:"flex flex-col items-center leading-tight",children:[e.jsx("span",{className:"text-[18px] font-bold tabular-nums",style:{color:s},children:t}),e.jsx("span",{className:"text-[9px] uppercase tracking-widest",style:{color:"var(--theme-metal, rgba(196,161,74,0.8))"},children:a})]})}function et(t){const a=Math.floor(t/1e3),r=String(Math.floor(a/3600)).padStart(2,"0"),s=String(Math.floor(a%3600/60)).padStart(2,"0"),d=String(a%60).padStart(2,"0");return{hh:r,mm:s,ss:d}}function tt({member:t}){const a=t.state==="blocked",r=t.state==="editing",s=t.state==="working",d=t.state==="done",u=s||r,p=at(t.color,a),l=u?`${t.agentId.charCodeAt(0)%10*.34}s`:"0s",v=a?"stickyBreatheUrgent 1.2s ease-in-out infinite":s?"stickyBreathe 1.8s ease-in-out infinite":r?"stickyBreathe 2.4s ease-in-out infinite":"none",y=d?.65:1,h=jt(t.state),b=t.currentActivity??(d?"wrapped up":a?"awaiting your call":"standing by");return e.jsxs("div",{className:"w-[220px] p-3.5 pt-5 text-[#2a2418] relative",style:{background:p,boxShadow:"0 1px 0 rgba(255,255,255,0.55) inset, 0 12px 18px rgba(0,0,0,0.42)",fontFamily:'"Bradley Hand", "Marker Felt", "Comic Sans MS", cursive',animation:v,animationDelay:l,opacity:y,transition:"opacity 400ms ease-out"},children:[e.jsx("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 w-20 h-4 opacity-70 pointer-events-none",style:{background:"linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.25))",boxShadow:"0 1px 2px rgba(0,0,0,0.15)"}}),e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-md flex items-center justify-center text-white font-bold text-[13px]",style:{background:`linear-gradient(135deg, ${t.color}, ${Nt(t.color,-25)})`,boxShadow:`0 2px 6px ${t.color}55`,fontFamily:"system-ui"},children:t.name[0]}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("div",{className:"font-semibold text-[15px] text-[#2a2418]",children:t.name}),e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[#6b5a3a]",style:{fontFamily:"system-ui"},children:t.role})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-1 text-[10px] text-[#6b5a3a]",style:{fontFamily:"system-ui"},children:[d?e.jsx("span",{className:"text-[12px] leading-none","aria-label":"done",children:"✓"}):e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${kt(t.state)}`,style:{boxShadow:`0 0 6px ${wt(t.state)}`}}),e.jsx("span",{children:h})]})]}),e.jsx("div",{className:"text-[14px] text-[#2a2418] leading-snug min-h-[2.4rem] break-words",children:t.currentActivity??e.jsx("span",{className:"italic text-[#6b5a3a]",children:b})}),(u||a)&&e.jsx("div",{className:"absolute -inset-1 -z-10 pointer-events-none rounded-[2px] blur-md",style:{background:a?"radial-gradient(circle at 50% 50%, rgba(239,68,68,0.6), transparent 70%)":`radial-gradient(circle at 30% 30%, ${t.color}55, transparent 70%)`,animation:a?"deskAlarm 1.2s ease-in-out infinite":"deskGlow 4.2s ease-in-out infinite"}})]})}function at(t,a){if(a)return"linear-gradient(165deg, #ffd6d6 0%, #ffbaba 100%), linear-gradient(45deg, transparent 49%, rgba(0,0,0,0.04) 49% 51%, transparent 51%)";const r=t.toLowerCase();return r.includes("6366f1")||r.includes("8b5cf6")?"linear-gradient(160deg, #e7e1ff 0%, #cfc4ff 100%)":r.includes("22c55e")||r.includes("10b981")?"linear-gradient(160deg, #d9f7d9 0%, #b8edb8 100%)":r.includes("f59e0b")||r.includes("eab308")?"linear-gradient(160deg, #fff2a8 0%, #ffe88a 100%)":r.includes("ef4444")||r.includes("f97316")?"linear-gradient(160deg, #ffd6c2 0%, #ffbf9e 100%)":r.includes("06b6d4")||r.includes("0ea5e9")?"linear-gradient(160deg, #cef3f7 0%, #a8e4ec 100%)":"linear-gradient(160deg, #fff2a8 0%, #ffe88a 100%)"}function nt({file:t,onOpen:a}){const r=o.useMemo(()=>{const s=t.ref.lastIndexOf("/");return s>=0?t.ref.slice(s+1):t.ref},[t.ref]);return e.jsxs("div",{onDoubleClick:a,title:"Double-click to open",className:"w-[200px] p-3",style:{background:"linear-gradient(170deg, var(--theme-paper, #fdfbf3) 0%, var(--theme-paper, #f1eada) 100%)",color:"var(--theme-ink, #1a1f2e)",borderRadius:4,boxShadow:"0 1px 0 rgba(255,255,255,0.6) inset, 0 0 0 1px rgba(0,0,0,0.06)"},children:[e.jsx("div",{className:"absolute top-0 right-0 w-4 h-4",style:{background:"linear-gradient(225deg, var(--theme-paper-line, #d8cdb3) 0%, var(--theme-paper, #f1eada) 50%, transparent 50%)",borderBottomLeftRadius:4}}),e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-base leading-none",children:t.type==="report"?"📊":"📄"}),e.jsx("span",{className:"text-[9px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, #8a8472)"},children:t.type})]}),e.jsx("div",{className:"font-semibold text-[12px] leading-tight break-words",style:{color:"var(--theme-ink, #1a1f2e)"},children:r}),t.description&&e.jsx("div",{className:"text-[10px] mt-1 leading-snug line-clamp-2",style:{color:"var(--theme-ink-soft, #5a5240)"},children:t.description}),e.jsx("button",{"data-no-drag":!0,onClick:a,className:"mt-2 w-full px-2 py-1 text-[10px] font-semibold uppercase tracking-widest rounded",style:{background:"var(--theme-ink, #1a1f2e)",color:"var(--theme-paper-fg, #f3e9d0)"},children:"Open ↗"})]})}function rt({fact:t}){const a=t.description??t.ref;return e.jsxs("div",{className:"w-[160px] p-3",style:{background:"linear-gradient(160deg, var(--theme-sticky-yellow, #fff2a8) 0%, var(--theme-sticky-yellow, #ffe88a) 100%)",boxShadow:"0 1px 0 rgba(255,255,255,0.5) inset, 0 8px 14px var(--theme-shadow, rgba(0,0,0,0.35))",fontFamily:'"Bradley Hand", "Comic Sans MS", cursive',color:"var(--theme-ink, #3a2e10)"},children:[e.jsx("div",{className:"absolute -top-2 left-1/2 -translate-x-1/2 w-12 h-3.5 opacity-60",style:{background:"linear-gradient(180deg, var(--theme-sticky-tape, rgba(255,255,255,0.65)), rgba(255,255,255,0.25))"}}),e.jsx("div",{className:"text-[12px] leading-snug",children:a})]})}function st({sticky:t}){const a=it(t.agentColor),r=t.count>1,s=r?`${t.agentName} · ${t.activity} × ${t.count}
|
|
7
|
-
latest: ${t.recentDetails[0]??"(no detail)"}
|
|
8
|
-
`+(t.recentDetails.length>1?`prior: ${t.recentDetails.slice(1).join(" · ")}
|
|
9
|
-
`:"")+`most recent at ${new Date(t.at).toLocaleTimeString()}`:`${t.agentName} ${t.activity}${t.detail?": "+t.detail:""} · ${new Date(t.at).toLocaleTimeString()}`;return e.jsxs("div",{className:"w-[170px] p-2.5 relative",title:s,style:{background:a,boxShadow:"0 1px 0 rgba(255,255,255,0.55) inset, 0 6px 10px var(--theme-shadow, rgba(0,0,0,0.32))",fontFamily:'"Bradley Hand", "Marker Felt", "Comic Sans MS", cursive',color:"var(--theme-ink, #2a2418)"},children:[e.jsx("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 w-10 h-3 opacity-60 pointer-events-none",style:{background:"linear-gradient(180deg, var(--theme-sticky-tape, rgba(255,255,255,0.7)), rgba(255,255,255,0.25))"}}),r&&e.jsxs("div",{className:"absolute -top-2 -right-2 min-w-[22px] h-[22px] px-1.5 rounded-full flex items-center justify-center text-[11px] font-semibold pointer-events-none",style:{background:"var(--theme-metal-dark, #5a4818)",color:"var(--theme-sticky-yellow, #fff8c8)",boxShadow:"0 1px 3px rgba(0,0,0,0.35)",fontFamily:"system-ui"},"aria-label":`${t.count} repeated activities`,children:["×",t.count]}),e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"text-base leading-none",children:t.icon}),e.jsx("span",{className:"text-[10px] uppercase tracking-widest truncate",style:{fontFamily:"system-ui",color:"var(--theme-ink-soft, #6b5a3a)"},children:t.agentName})]}),e.jsx("div",{className:"text-[12px] leading-snug",children:t.activity}),t.detail&&e.jsxs("div",{className:"text-[11px] mt-1 leading-snug break-words line-clamp-3",style:{color:"var(--theme-ink-soft, #5a4818)"},children:[r?e.jsx("span",{style:{color:"var(--theme-ink-soft, #5a4818)",opacity:.7},children:"latest: "}):null,t.detail]})]})}function it(t){const a=t.toLowerCase();return a.includes("6366f1")||a.includes("8b5cf6")?"linear-gradient(160deg, #efeaff 0%, #e0d5ff 100%)":a.includes("22c55e")||a.includes("10b981")||a.includes("4adbb5")?"linear-gradient(160deg, #e7faea 0%, #cef0d4 100%)":a.includes("f59e0b")||a.includes("eab308")||a.includes("ff9a4a")?"linear-gradient(160deg, #fff8c8 0%, #ffefa3 100%)":a.includes("ef4444")||a.includes("f97316")||a.includes("ff5d6c")?"linear-gradient(160deg, #ffe2d4 0%, #ffcfba 100%)":a.includes("06b6d4")||a.includes("0ea5e9")||a.includes("6ea8ff")?"linear-gradient(160deg, #e0f5fa 0%, #c5e9f1 100%)":"linear-gradient(160deg, #fff8c8 0%, #ffefa3 100%)"}function ot({msg:t,onAnswer:a}){const[r,s]=o.useState(!1),[d,u]=o.useState(""),p=o.useRef(null);return o.useEffect(()=>{r&&p.current&&p.current.focus()},[r]),e.jsxs("div",{className:"w-[300px] p-4 rounded-xl",style:{background:"linear-gradient(180deg, var(--theme-sticky-pink, #ffe9eb), var(--theme-sticky-pink, #ffd0d4))",boxShadow:"0 18px 36px rgba(255,93,108,0.45), 0 0 0 1.5px var(--theme-accent, rgba(196,90,48,0.6)), 0 0 0 4px rgba(255,93,108,0.12)",animation:"questionLift 4s ease-in-out infinite",color:"#5c1820",transform:"translateY(-10px)"},children:[e.jsx("div",{className:"absolute -top-2 -right-2 w-5 h-5 rounded-full",style:{background:"radial-gradient(circle at 35% 30%, var(--theme-metal-bright, #ffd86e) 0%, var(--theme-metal-dark, #b07a1a) 70%, var(--theme-bolt, #6a4710) 100%)",boxShadow:"0 2px 4px var(--theme-shadow, rgba(0,0,0,0.5))"}}),e.jsxs("div",{className:"text-[10px] uppercase mb-1.5",style:{letterSpacing:"0.16em",color:"rgba(92,24,32,0.7)",fontWeight:600},children:[t.from.name," asks"]}),e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 mb-2 bg-[#5c1820] text-[#ffd0d4] text-[10px] uppercase tracking-widest font-bold rounded-full",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"}),"TITAN paused — your call."]}),e.jsx("div",{className:"text-[13px] leading-snug",children:t.content}),r?e.jsxs("div",{className:"mt-3",children:[e.jsx("textarea",{ref:p,"data-no-drag":!0,value:d,onChange:l=>u(l.target.value),onKeyDown:l=>{if(l.key==="Enter"&&(l.metaKey||l.ctrlKey)){l.preventDefault();const v=d.trim();v&&a(v)}else l.key==="Escape"&&s(!1)},rows:2,placeholder:"Your answer…",className:"w-full bg-white/90 border border-[rgba(160,41,56,0.25)] rounded-lg p-2 text-[12px] text-[#5c1820] outline-none"}),e.jsxs("div",{className:"flex items-center justify-end gap-2 mt-1",children:[e.jsx("button",{"data-no-drag":!0,onClick:()=>s(!1),className:"text-[10px] text-[#5c1820]/70 hover:text-[#5c1820]",children:"cancel"}),e.jsx("button",{"data-no-drag":!0,onClick:()=>{const l=d.trim();l&&a(l)},disabled:!d.trim(),className:"px-2 py-0.5 rounded text-[11px] font-semibold disabled:opacity-50 text-[var(--theme-paper,#f3e9d0)] bg-[var(--theme-ink,#1a1f2e)]",children:"Send"})]})]}):e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[t.quickReplies.map((l,v)=>e.jsx("button",{"data-no-drag":!0,onClick:()=>a(l),className:`px-2.5 py-1 rounded-lg text-[11px] font-semibold border ${v===t.quickReplies.length-1?"border-transparent text-[var(--theme-paper,#f3e9d0)] bg-[var(--theme-ink,#1a1f2e)]":"bg-white border-[rgba(160,41,56,0.25)] text-[#5c1820]"}`,children:l},l)),e.jsx("button",{"data-no-drag":!0,onClick:()=>s(!0),className:"px-2.5 py-1 rounded-lg text-[11px] font-medium underline underline-offset-2 text-[#5c1820]/80 hover:text-[#5c1820]",children:"or type…"})]})]})}function lt({count:t,onOpen:a}){return e.jsxs("div",{"data-drop-target":"cabinet",className:"w-[140px] flex flex-col",style:{color:"var(--theme-metal-bright, #f5d27a)"},title:t>0?`${t} filed — click to open`:"Drop files & notes here",children:[e.jsx("button",{"data-no-drag":!0,onClick:a,className:"text-left flex flex-col gap-1 p-0 bg-transparent border-none",children:[0,1].map(r=>e.jsxs("div",{className:"relative w-full h-[58px] flex items-center justify-center",style:{background:"linear-gradient(180deg, var(--theme-leather, #5a3a18) 0%, var(--theme-leather-edge, #3a230b) 100%), repeating-linear-gradient(90deg, rgba(255,180,90,0.05) 0px, rgba(60,30,10,0.08) 2px)",border:"1px solid var(--theme-bolt, #2a1808)",boxShadow:"inset 0 -2px 0 rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.08) inset"},children:[e.jsx("div",{className:"px-3 py-0.5 text-[10px] uppercase tracking-widest font-bold",style:{background:"linear-gradient(180deg, var(--theme-metal-bright, #ffd86e) 0%, var(--theme-metal-dark, #b07a1a) 100%)",borderRadius:2,boxShadow:"0 1px 2px var(--theme-shadow, rgba(0,0,0,0.4))",color:"var(--theme-bolt, #3a2a10)"},children:r===0?"Files":"Drafts"}),e.jsx("div",{className:"absolute right-3 w-6 h-1.5 rounded",style:{background:"linear-gradient(180deg, var(--theme-metal-bright, #ffd86e) 0%, var(--theme-metal-dark, #8a5810) 100%)",boxShadow:"0 1px 2px var(--theme-shadow, rgba(0,0,0,0.5))"}})]},r))}),t>0&&e.jsxs("div",{className:"mt-1 text-center text-[10px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:[t," ",t===1?"item":"items"," inside"]})]})}function ct({count:t,onOpen:a}){const r=Math.min(t,6);return e.jsxs("button",{type:"button","data-drop-target":"trash","data-no-drag":!0,onClick:a,className:"relative w-[110px] h-[120px] p-0 bg-transparent border-none cursor-pointer",title:t>0?`${t} tossed — click to open the bin`:"Drop notes here to toss them",children:[e.jsx("div",{className:"absolute inset-x-3 top-3 bottom-12 flex flex-wrap gap-1 items-end justify-center overflow-hidden",children:Array.from({length:r}).map((s,d)=>e.jsx("div",{className:"rounded-full",style:{width:18+d*5%14,height:18+d*7%12,background:"radial-gradient(circle at 35% 30%, var(--theme-paper, #fffaee) 0%, var(--theme-paper-line, #d6cdb1) 70%, var(--theme-ink-soft, #a99b71) 100%)",boxShadow:"inset -2px -2px 4px rgba(0,0,0,0.18), 0 1px 2px var(--theme-shadow, rgba(0,0,0,0.3))",transform:`rotate(${d*37%60-30}deg)`}},d))}),e.jsx("div",{className:"absolute left-2 right-2 bottom-0 h-[80px] overflow-hidden",style:{clipPath:"polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%)",background:"repeating-linear-gradient(90deg, var(--theme-leather, #5a3a18) 0px, var(--theme-leather, #5a3a18) 2px, var(--theme-leather-edge, #3a230b) 2px, var(--theme-leather-edge, #3a230b) 4px),repeating-linear-gradient(0deg, transparent 0 6px, rgba(0,0,0,0.25) 6px 7px)",border:"1px solid var(--theme-bolt, #2a1808)",borderRadius:4,boxShadow:"inset 0 4px 8px var(--theme-shadow, rgba(0,0,0,0.5))"}}),e.jsx("div",{className:"absolute left-1 right-1 bottom-[78px] h-2.5 rounded-sm",style:{background:"linear-gradient(180deg, var(--theme-metal-dark, #6b4720) 0%, var(--theme-leather-edge, #3a230b) 100%)",border:"1px solid var(--theme-bolt, #1a0f05)",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.1)"}}),t>0&&e.jsxs("div",{className:"absolute -bottom-5 left-1/2 -translate-x-1/2 text-[10px] uppercase tracking-widest whitespace-nowrap",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:[t," tossed"]})]})}function dt({itemIds:t,items:a,fileSources:r,factSources:s,activityStickies:d,onRestore:u,onRestoreAt:p,onOpenFile:l,onClose:v}){const[y,h]=o.useState(null);o.useEffect(()=>{if(!y)return;const c=f=>{h(w=>w?{...w,x:f.clientX,y:f.clientY}:null)},m=f=>{p(y.itemId,f.clientX,f.clientY),h(null)};return window.addEventListener("mousemove",c),window.addEventListener("mouseup",m),()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",m)}},[y,p]);function b(c,m,f,w){c.target.closest("[data-no-drag]")||(c.preventDefault(),h({itemId:m,label:f,icon:w,x:c.clientX,y:c.clientY}),v())}return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:v,children:[e.jsxs("div",{className:"relative w-full max-w-2xl max-h-[80vh] flex flex-col rounded-2xl overflow-hidden",onClick:c=>c.stopPropagation(),style:{background:"linear-gradient(180deg, var(--theme-leather, #4a2e18) 0%, var(--theme-bolt, #2a1808) 100%)",boxShadow:"0 0 0 3px var(--theme-metal-dark, #b08a3a), 0 30px 60px var(--theme-shadow, rgba(0,0,0,0.6))",color:"var(--theme-metal-bright, #f5d27a)"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",style:{borderBottom:"1px solid var(--theme-metal-dark, #6e4724)"},children:[e.jsx("span",{className:"text-2xl",children:"🗄️"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"Filing cabinet"}),e.jsxs("div",{className:"text-[11px]",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:[t.length," item",t.length===1?"":"s"," filed · drag a row out, or click ",e.jsx("b",{children:"to desk"})]})]}),e.jsx("button",{"data-no-drag":!0,onClick:v,className:"w-8 h-8 rounded-full hover:text-white flex items-center justify-center",style:{background:"var(--theme-leather-edge, #1a0f05)",border:"1px solid var(--theme-metal-dark, #6e4724)",color:"var(--theme-ink-soft, #d9c08c)"},children:"✕"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-2",children:[t.length===0&&e.jsx("div",{className:"text-center py-12 italic",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:"Nothing filed yet. Drag a file or sticky note onto the cabinet to file it."}),t.map(c=>{const m=a.find(C=>C.id===c);if(!m)return e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg",style:{background:"var(--theme-leather-edge, rgba(26,15,5,0.4))",border:"1px solid var(--theme-metal-dark, rgba(110,71,36,0.5))",color:"var(--theme-ink-soft, rgba(217,192,140,0.7))"},children:[e.jsxs("span",{className:"text-xs italic",children:[c," (no longer in mission)"]}),e.jsx("button",{"data-no-drag":!0,onClick:()=>u(c),className:"text-[11px] hover:text-white",children:"remove"})]},c);const f=m.kind==="file"?r.find(C=>C.ref===m.ref):void 0,w=m.kind==="fact"?s.find(C=>C.ref===m.ref):void 0,j=m.kind==="activity"?d.find(C=>C.id===m.ref):void 0,A=f?f.type==="report"?"📊":"📄":w?"💡":j?j.icon:"📌",T=(f==null?void 0:f.ref)??(w==null?void 0:w.ref)??(j?`${j.agentName} · ${j.activity}`:c);return e.jsxs("div",{onMouseDown:C=>b(C,c,T,A),className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-colors cursor-grab active:cursor-grabbing",style:{background:"var(--theme-leather-edge, rgba(26,15,5,0.4))",border:"1px solid var(--theme-metal-dark, rgba(110,71,36,0.5))"},title:"Drag out to place on the desk, or use the buttons →",children:[e.jsx("span",{className:"text-lg leading-none",children:A}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs truncate",style:{color:"var(--theme-metal-bright, #f5d27a)"},children:T}),((f==null?void 0:f.description)??(w==null?void 0:w.description))&&e.jsx("div",{className:"text-[10px] truncate",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:(f==null?void 0:f.description)??(w==null?void 0:w.description)})]}),f&&e.jsx("button",{"data-no-drag":!0,onClick:()=>l(f.ref),className:"px-2 py-1 text-[10px] rounded hover:text-white",style:{background:"var(--theme-metal-dark, #6e4724)",border:"1px solid var(--theme-metal-dark, #b08a3a)",color:"var(--theme-metal-bright, #f5d27a)"},children:"Open ↗"}),e.jsx("button",{"data-no-drag":!0,onClick:()=>u(c),className:"px-2 py-1 text-[10px] rounded hover:text-white",style:{background:"var(--theme-leather-edge, #1a0f05)",border:"1px solid var(--theme-metal-dark, #6e4724)",color:"var(--theme-ink-soft, #d9c08c)"},children:"to desk"})]},c)})]})]}),y&&e.jsx("div",{className:"fixed z-[70] pointer-events-none",style:{left:y.x-80,top:y.y-20},children:e.jsxs("div",{className:"px-3 py-2 rounded text-xs flex items-center gap-2 shadow-2xl",style:{transform:"rotate(-2deg)",background:"var(--theme-paper, #fdfbf3)",color:"var(--theme-ink, #1a1f2e)"},children:[e.jsx("span",{children:y.icon}),e.jsx("span",{className:"font-semibold truncate max-w-[200px]",children:y.label})]})})]})}function ut({itemIds:t,items:a,fileSources:r,factSources:s,activityStickies:d,onRestore:u,onDeleteForever:p,onClose:l}){return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:l,children:e.jsxs("div",{className:"relative w-full max-w-2xl max-h-[80vh] flex flex-col rounded-2xl overflow-hidden text-[#f5d27a]",onClick:v=>v.stopPropagation(),style:{background:"linear-gradient(180deg, #4a2018 0%, #2a0e08 100%)",boxShadow:"0 0 0 3px #c46a52, 0 30px 60px var(--theme-shadow, rgba(0,0,0,0.6))"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3 border-b border-[#6e3024]",children:[e.jsx("span",{className:"text-2xl",children:"🗑️"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"Wastebasket"}),e.jsxs("div",{className:"text-[11px] text-[#e9b09a]",children:[t.length," item",t.length===1?"":"s"," tossed ·",e.jsx("span",{className:"ml-1",children:"restore to desk, or delete forever"})]})]}),e.jsx("button",{onClick:l,className:"w-8 h-8 rounded-full bg-[#1a0a08] border border-[#6e3024] text-[#e9b09a] hover:text-white flex items-center justify-center",children:"✕"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-2",children:[t.length===0&&e.jsx("div",{className:"text-center py-12 text-[#e9b09a] italic",children:"Nothing in the bin. Drag a file, sticky, or activity onto the wastebasket to toss it."}),t.map(v=>{const y=a.find(j=>j.id===v),h=(y==null?void 0:y.kind)==="file"?r.find(j=>j.ref===y.ref):void 0,b=(y==null?void 0:y.kind)==="fact"?s.find(j=>j.ref===y.ref):void 0,c=(y==null?void 0:y.kind)==="activity"?d.find(j=>j.id===y.ref):void 0,m=h?h.type==="report"?"📊":"📄":b?"💡":c?c.icon:"📌",f=(h==null?void 0:h.ref)??(b==null?void 0:b.ref)??(c?`${c.agentName} · ${c.activity}`:v),w=(h==null?void 0:h.description)??(b==null?void 0:b.description)??(c==null?void 0:c.detail);return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 bg-[#1a0a08]/60 border border-[#6e3024]/50 rounded-lg hover:bg-[#1a0a08]/80 transition-colors",title:y?"Restore to the desk or delete forever":"This item no longer exists in the mission",children:[e.jsx("span",{className:"text-lg leading-none opacity-70",children:m}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs text-[#f5d27a] truncate line-through decoration-[#c46a52]/50",children:f}),w&&e.jsx("div",{className:"text-[10px] text-[#e9b09a]/80 truncate",children:w})]}),e.jsx("button",{"data-no-drag":!0,onClick:()=>u(v),className:"px-2.5 py-1 text-[10px] bg-[#1a0a08] border border-[#6e3024] rounded text-[#e9b09a] hover:text-white hover:border-[#c46a52]",title:"Pull this item back out of the bin and put it on the desk",children:"↩ to desk"}),e.jsx("button",{"data-no-drag":!0,onClick:()=>{window.confirm(`Delete this forever?
|
|
10
|
-
|
|
11
|
-
"${f.slice(0,100)}${f.length>100?"…":""}"
|
|
12
|
-
|
|
13
|
-
The item will never reappear on the desk again, even after a reload. This is UI-only — the underlying mission file/note isn't deleted on disk.`)&&p(v)},className:"px-2.5 py-1 text-[10px] bg-[#3a0a08] border border-[#c46a52]/60 rounded text-[#ff9c9c] hover:text-white hover:bg-[#5a0e0a] hover:border-[#ff9c9c]",title:"Permanently hide this item — gone for good",children:"✕ Delete forever"})]},v)})]}),t.length>0&&e.jsx("div",{className:"px-5 py-2 border-t border-[#6e3024] text-center text-[10px] text-[#e9b09a]/70 uppercase tracking-widest",children:"tip: drag items onto the wastebasket from the desk · restore is non-destructive"})]})})}const xt={background:["radial-gradient(ellipse 120px 80px at 78% 28%, rgba(40,18,8,0.55) 0%, rgba(40,18,8,0) 70%)","radial-gradient(ellipse 90px 60px at 22% 72%, rgba(40,18,8,0.45) 0%, rgba(40,18,8,0) 75%)","repeating-linear-gradient(92deg, rgba(255,180,90,0.05) 0px, rgba(60,30,10,0.08) 3px, rgba(255,180,90,0.04) 7px, rgba(60,30,10,0.10) 11px, rgba(255,180,90,0.06) 16px)","repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.03) 4px)","linear-gradient(180deg, var(--theme-bg-base, #6e4724) 0%, var(--theme-bg-grain, #5a3717) 50%, var(--theme-leather-edge, #482a13) 100%)"].join(",")},ht={background:"radial-gradient(ellipse 80% 60% at 20% 0%, rgba(255,220,140,0.18) 0%, rgba(0,0,0,0) 55%)"},ft={background:"radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 50%, var(--theme-bg-vignette, rgba(0,0,0,0.45)) 100%)"},pt=`
|
|
14
|
-
@keyframes deskGlow {
|
|
15
|
-
0%, 100% { opacity: 0.5; }
|
|
16
|
-
50% { opacity: 0.8; }
|
|
17
|
-
}
|
|
18
|
-
@keyframes deskAlarm {
|
|
19
|
-
0%, 100% { opacity: 0.5; }
|
|
20
|
-
50% { opacity: 1; }
|
|
21
|
-
}
|
|
22
|
-
@keyframes deskFloat {
|
|
23
|
-
0%, 100% { transform: translateY(0); }
|
|
24
|
-
50% { transform: translateY(-3px); }
|
|
25
|
-
}
|
|
26
|
-
/* Phase 3 polish — Sage decision card sits ~10px elevated and
|
|
27
|
-
floats gently. Uses an offset baseline so the card stays raised
|
|
28
|
-
relative to the rest of the desk furniture. */
|
|
29
|
-
@keyframes questionLift {
|
|
30
|
-
0%, 100% { transform: translateY(-10px); }
|
|
31
|
-
50% { transform: translateY(-13px); }
|
|
32
|
-
}
|
|
33
|
-
/* v6.1.0-alpha.24 — gentle bob on working sticky notes. Lives on an
|
|
34
|
-
INNER wrapper so it composes with the parent Draggable's rotation
|
|
35
|
-
transform. */
|
|
36
|
-
@keyframes stickyBreathe {
|
|
37
|
-
0%, 100% { transform: translateY(0); }
|
|
38
|
-
50% { transform: translateY(-2.5px); }
|
|
39
|
-
}
|
|
40
|
-
/* Phase 2 polish — faster breath for "needs you" cards (1.2s). */
|
|
41
|
-
@keyframes stickyBreatheUrgent {
|
|
42
|
-
0%, 100% { transform: translateY(0); }
|
|
43
|
-
50% { transform: translateY(-3.5px); }
|
|
44
|
-
}
|
|
45
|
-
/* Phase 2 polish — generic bead-fade keyframe. Actual path travel
|
|
46
|
-
is implemented via SVG animateMotion + mpath in LivingDeskLayer
|
|
47
|
-
so it works without offset-path support. Kept as a fallback. */
|
|
48
|
-
@keyframes beadFlow {
|
|
49
|
-
0%, 100% { opacity: 0; }
|
|
50
|
-
10%, 90% { opacity: 0.9; }
|
|
51
|
-
}
|
|
52
|
-
/* Tether-line dash flow — animates stroke-dashoffset to give the
|
|
53
|
-
thread a moving-current feel. The dasharray defines the segment
|
|
54
|
-
pattern. */
|
|
55
|
-
@keyframes tetherFlow {
|
|
56
|
-
to { stroke-dashoffset: -20; }
|
|
57
|
-
}
|
|
58
|
-
/* Dust mote drift — slow vertical drift with a gentle horizontal
|
|
59
|
-
wobble. Two duration variants so motes don't tick in unison. */
|
|
60
|
-
@keyframes mote1 {
|
|
61
|
-
0% { transform: translate(0, 0) scale(1); opacity: 0; }
|
|
62
|
-
10% { opacity: 0.55; }
|
|
63
|
-
90% { opacity: 0.45; }
|
|
64
|
-
100% { transform: translate(14px, -90vh) scale(1.1); opacity: 0; }
|
|
65
|
-
}
|
|
66
|
-
@keyframes mote2 {
|
|
67
|
-
0% { transform: translate(0, 0) scale(0.9); opacity: 0; }
|
|
68
|
-
10% { opacity: 0.4; }
|
|
69
|
-
90% { opacity: 0.3; }
|
|
70
|
-
100% { transform: translate(-12px, -90vh) scale(1); opacity: 0; }
|
|
71
|
-
}
|
|
72
|
-
`;function mt({items:t,room:a,poseOf:r,isHidden:s}){const d=t.find(c=>c.kind==="document"),u=d&&!s(d.id)?r(d):null,p=o.useMemo(()=>{if(!u)return[];const c=[];for(const m of t){if(m.kind!=="agent"||s(m.id))continue;const f=a.team.find(w=>w.agentId===m.ref);f&&(f.paused||f.state!=="working"&&f.state!=="editing"||c.push({item:m,member:f,pose:r(m)}))}return c},[t,a.team,r,s,u]),l=p.length>0,v=220,y=110,h=620,b=300;return e.jsxs(e.Fragment,{children:[u&&p.length>0&&e.jsxs("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",style:{zIndex:5},"aria-hidden":!0,children:[e.jsx("defs",{children:e.jsxs("radialGradient",{id:"tetherNodeGlow",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--theme-metal-bright, #ffd86e)",stopOpacity:"0.9"}),e.jsx("stop",{offset:"100%",stopColor:"var(--theme-metal-bright, #ffd86e)",stopOpacity:"0"})]})}),p.map(({item:c,member:m,pose:f})=>{const w=f.x+v/2,j=f.y+y/2,A=u.x+h/2,T=u.y+b/2,C=(w+A)/2,S=(j+T)/2-40,L=`M ${w} ${j} Q ${C} ${S}, ${A} ${T}`,z=m.state==="editing"?"rgba(245, 158, 11, 0.55)":m.state==="blocked"?"rgba(239, 68, 68, 0.7)":"rgba(255, 216, 110, 0.55)",k=m.color,R=`tether-path-${c.id}`;return e.jsxs("g",{children:[e.jsx("path",{id:R,d:L,fill:"none",stroke:z,strokeWidth:1.4,strokeDasharray:"8 8",style:{animation:"tetherFlow 1.6s linear infinite"}}),e.jsx("circle",{cx:w,cy:j,r:14,fill:"url(#tetherNodeGlow)"}),e.jsx("circle",{r:3.2,fill:k,opacity:.95,children:e.jsx("animateMotion",{dur:"2.2s",repeatCount:"indefinite",children:e.jsx("mpath",{href:`#${R}`})})})]},c.id)})]}),l&&e.jsx("div",{className:"absolute inset-0 pointer-events-none overflow-hidden",style:{zIndex:6},"aria-hidden":!0,children:gt.map((c,m)=>e.jsx("span",{className:"absolute rounded-full",style:{left:`${c.left}vw`,bottom:`${-5+c.delay%12}vh`,width:c.size,height:c.size,background:"radial-gradient(circle at 35% 30%, rgba(255,250,235,0.85) 0%, rgba(212,196,158,0.4) 60%, rgba(0,0,0,0) 100%)",animation:`${m%2===0?"mote1":"mote2"} ${c.duration}s linear infinite`,animationDelay:`${c.delay}s`,filter:"blur(0.4px)"}},m))})]})}const gt=[{left:6,size:3,duration:28,delay:0},{left:14,size:2,duration:36,delay:3},{left:22,size:4,duration:30,delay:8},{left:30,size:2,duration:40,delay:1},{left:38,size:3,duration:26,delay:5},{left:46,size:3,duration:34,delay:11},{left:54,size:2,duration:38,delay:2},{left:62,size:4,duration:32,delay:7},{left:70,size:3,duration:30,delay:9},{left:78,size:2,duration:36,delay:4},{left:86,size:3,duration:28,delay:12},{left:94,size:4,duration:34,delay:6}];function pe(t){let a=0,r=0;for(const s of t.team)(s.state==="working"||s.state==="editing")&&a++,s.state==="blocked"&&r++;return{working:a,blocked:r}}function bt(t,a,r){return t==="paused"?"Paused":t==="done"?"Done":t==="failed"?"Stopped":r>0?`${a} working · ${r} needs you`:a>0?`${a} working`:t==="forming"?"Forming team…":"Idle"}function vt(t){return t==="paused"?"paused":t==="done"?"done":t==="failed"?"stopped":t==="blocked"?"waiting on you":"auto-saving"}function yt(t,a){return t.length<=a?t:t.slice(0,a-1)+"…"}function kt(t){switch(t){case"working":return"bg-accent animate-pulse";case"editing":return"bg-warning animate-pulse";case"blocked":return"bg-error animate-pulse";case"done":return"bg-success";default:return"bg-text-muted"}}function wt(t){switch(t){case"working":return"#6366f1";case"editing":return"#f59e0b";case"blocked":return"#ef4444";case"done":return"#22c55e";default:return"#71717a"}}function jt(t){return t==="working"?"working":t==="editing"?"editing":t==="blocked"?"needs you":t==="done"?"done":"idle"}function Nt(t,a){const r=t.replace("#","");if(r.length!==6)return t;const s=parseInt(r,16);let d=s>>16&255,u=s>>8&255,p=s&255;const l=Math.round(255*(a/100));return d=Math.max(0,Math.min(255,d+l)),u=Math.max(0,Math.min(255,u+l)),p=Math.max(0,Math.min(255,p+l)),"#"+(d<<16|u<<8|p).toString(16).padStart(6,"0")}export{$t as default};
|