titan-agent 6.5.2 → 7.0.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 +180 -53
- 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 +67 -26
- 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/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 +3 -0
- 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 +18 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/eval/harness.js +13 -3
- 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 +251 -43
- package/dist/gateway/server.js.map +1 -1
- package/dist/memory/taxonomy.js +117 -0
- package/dist/memory/taxonomy.js.map +1 -0
- package/dist/providers/modelCapabilities.js +13 -0
- package/dist/providers/modelCapabilities.js.map +1 -1
- package/dist/providers/ollama.js +8 -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 +38 -2
- package/dist/providers/openai_compat.js.map +1 -1
- package/dist/providers/router.js +14 -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/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 +4 -3
- package/ui/dist/assets/AboutYouMemory-CZKEOd_O.js +11 -0
- package/ui/dist/assets/AuditPanel-Bu71N5Er.js +1 -0
- package/ui/dist/assets/{AutonomyPanel-CmaXJV8d.js → AutonomyPanel-DB-39dX4.js} +2 -2
- package/ui/dist/assets/{AutopilotPanel-CbohPtXW.js → AutopilotPanel-Cj8oKxWv.js} +1 -1
- package/ui/dist/assets/{AutoresearchPanel-DCwiQ2v2.js → AutoresearchPanel-3s8pjm6Z.js} +2 -2
- package/ui/dist/assets/BackupPanel-EUQJMJE7.js +1 -0
- package/ui/dist/assets/{BrowserPanel-D6UaSxap.js → BrowserPanel-Beo4F5Ar.js} +2 -2
- package/ui/dist/assets/Button-MdXmb4_n.js +1 -0
- package/ui/dist/assets/CPActivity-B1Se9VVc.js +1 -0
- package/ui/dist/assets/CPAgentDetail-BYji6tT8.js +1 -0
- package/ui/dist/assets/CPAgents-BSUKucTe.js +1 -0
- package/ui/dist/assets/CPApprovals-B4v0em6e.js +1 -0
- package/ui/dist/assets/CPCosts-9ikh61Kv.js +1 -0
- package/ui/dist/assets/CPDashboard-sOok2T5v.js +1 -0
- package/ui/dist/assets/{CPFiles-BO73EZwJ.js → CPFiles-DB2nY5JE.js} +1 -1
- package/ui/dist/assets/CPGoals-8Z1yOY8e.js +1 -0
- package/ui/dist/assets/CPInbox-Cq6-UY8F.js +11 -0
- package/ui/dist/assets/CPIssueDetail-NAGfmJg8.js +1 -0
- package/ui/dist/assets/CPIssues-BzX6Rckx.js +1 -0
- package/ui/dist/assets/CPLayout-BcRM6QSg.js +2 -0
- package/ui/dist/assets/CPOrg-B7DQ4UQP.js +1 -0
- package/ui/dist/assets/CPRuns-D-cpPw_M.js +1 -0
- package/ui/dist/assets/{CPSocial-Qw5rKy_4.js → CPSocial-DshtmcK0.js} +3 -3
- package/ui/dist/assets/CPVoice-DfXRnQVU.js +1 -0
- package/ui/dist/assets/{ChannelsPanel-DS21E-Iz.js → ChannelsPanel-BnaTOeyf.js} +1 -1
- package/ui/dist/assets/CheckpointsPanel-C62naE4U.js +1 -0
- package/ui/dist/assets/CommandPostHub-B_L1CAss.js +24 -0
- package/ui/dist/assets/ConfirmDialog-VErHWAbo.js +1 -0
- package/ui/dist/assets/CronPanel-BwMrrZ5d.js +1 -0
- package/ui/dist/assets/{DataTable-PnhPeDBG.js → DataTable-BCqSUuN7.js} +1 -1
- package/ui/dist/assets/{DreamPanel-DIrtlk2K.js → DreamPanel-BNAcCLBB.js} +2 -2
- package/ui/dist/assets/EmptyState-D9kQf1PX.js +1 -0
- package/ui/dist/assets/{EvalHarnessPanel-uYb_ZEQG.js → EvalHarnessPanel-BaMLdBNm.js} +2 -2
- package/ui/dist/assets/EvalPanel-CW-SSjtg.js +1 -0
- package/ui/dist/assets/{FileViewer-CVO3TRs3.js → FileViewer-BL00nsd7.js} +1 -1
- package/ui/dist/assets/FilesPanel-CeC6YUSd.js +16 -0
- package/ui/dist/assets/FleetPanel-EyWF7l3W.js +1 -0
- package/ui/dist/assets/{HomelabPanel-BZvN4LPM.js → HomelabPanel-BRfKRYe7.js} +2 -2
- package/ui/dist/assets/InfraView-Jmqhg_Yc.js +2 -0
- package/ui/dist/assets/{InlineEditableField-mBzpbcLB.js → InlineEditableField-DgMrLDj1.js} +1 -1
- package/ui/dist/assets/Input-CBTwa_Iw.js +1 -0
- package/ui/dist/assets/IntegrationsPanel-DQL-7Ec6.js +1 -0
- package/ui/dist/assets/IntelligenceView-DxD78qfP.js +2 -0
- package/ui/dist/assets/LearningPanel-C_JzSbJU.js +1 -0
- package/ui/dist/assets/LiveStudio-Db5yeaWo.js +7 -0
- package/ui/dist/assets/{LogsPanel-DbP3Mwnr.js → LogsPanel-CpinKwaZ.js} +1 -1
- package/ui/dist/assets/McpPanel-D-MqN_f-.js +1 -0
- package/ui/dist/assets/MemoryGraphPanel-BnD5jRqf.js +1 -0
- package/ui/dist/assets/MemoryTaxonomyPanel-BBI202dd.js +6 -0
- package/ui/dist/assets/MemoryWikiPanel-Dn3XZHL0.js +6 -0
- package/ui/dist/assets/{MeshPanel-Bf-4brXL.js → MeshPanel-C-mRJpr0.js} +1 -1
- package/ui/dist/assets/{MissionCanvas-CJyhnauG.js → MissionCanvas-CbZW83Ch.js} +1 -1
- package/ui/dist/assets/{MissionChat-C2Nto3zM.js → MissionChat-Bs75jPAD.js} +1 -1
- package/ui/dist/assets/{MissionLibrary-RXyBHsLL.js → MissionLibrary-BxQ6SxPe.js} +1 -1
- package/ui/dist/assets/MissionStart-CBuBPasl.js +1 -0
- package/ui/dist/assets/Modal-ybPGvlQs.js +9 -0
- package/ui/dist/assets/{NvidiaPanel-4DlcQlyl.js → NvidiaPanel-DdG13OX4.js} +1 -1
- package/ui/dist/assets/OrganismPanel-xZWUJKyr.js +1 -0
- package/ui/dist/assets/OverviewPanel-B45ZYhJV.js +1 -0
- package/ui/dist/assets/{PageHeader-bnc85wQN.js → PageHeader-DdrbS1aq.js} +1 -1
- package/ui/dist/assets/PersonaProfilesPanel-CKER-EU5.js +8 -0
- package/ui/dist/assets/{PersonasPanel-dR8VppcD.js → PersonasPanel-CMMQ3nh3.js} +1 -1
- package/ui/dist/assets/{PhoneDeskPanel-CdVOY7H9.js → PhoneDeskPanel-Bw_Y-cVE.js} +2 -2
- package/ui/dist/assets/RecipesPanel-DzMcxpJJ.js +1 -0
- package/ui/dist/assets/SecurityPanel-BCq3Fzbr.js +1 -0
- package/ui/dist/assets/SelfImprovePanel-YE3hT8jK.js +1 -0
- package/ui/dist/assets/SelfProposalsPanel-DXuqBM6p.js +1 -0
- package/ui/dist/assets/SessionsPanel-DORz5goR.js +1 -0
- package/ui/dist/assets/SessionsTab-qYHDOuC8.js +1 -0
- package/ui/dist/assets/SettingsPanel-BbwPu1i7.js +1 -0
- package/ui/dist/assets/SettingsView-zgqkDDBJ.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-Cax7YTqW.js → SkeletonLoader-r6OGXaU9.js} +1 -1
- package/ui/dist/assets/SkillsPanel-BjEOBMRo.js +11 -0
- package/ui/dist/assets/{SomaView-eG3wI4S1.js → SomaView-DLzApZVW.js} +2 -2
- package/ui/dist/assets/{StatCard-Djr487DV.js → StatCard-DLq8aBps.js} +1 -1
- package/ui/dist/assets/{StatusBadge-JpCoA33_.js → StatusBadge-BqlvIbdj.js} +1 -1
- package/ui/dist/assets/{Tabs-DJHu-roP.js → Tabs-DdUThlp1.js} +1 -1
- package/ui/dist/assets/TeamsPanel-uIIKoU7I.js +1 -0
- package/ui/dist/assets/{TelemetryPanel-D4PXsd-X.js → TelemetryPanel-dVr3yQQr.js} +1 -1
- package/ui/dist/assets/TitanCanvas-xHAJqwG2.js +945 -0
- package/ui/dist/assets/ToolsView-CG1mZdiy.js +2 -0
- package/ui/dist/assets/{Tooltip-B1LhTXJ8.js → Tooltip-C2tXJcrN.js} +1 -1
- package/ui/dist/assets/TraceViewer-BIMD_Osr.js +1 -0
- package/ui/dist/assets/TracesPanel-nMUiyMj5.js +1 -0
- package/ui/dist/assets/TrainingPanel-CT5R4HWm.js +1 -0
- package/ui/dist/assets/{VoiceOverlay-B_ss7Zg_.js → VoiceOverlay-Br4QnCtw.js} +3 -3
- package/ui/dist/assets/VramPanel-CdnJYytg.js +1 -0
- package/ui/dist/assets/WatchView-TNU6Ns1Q.js +13 -0
- package/ui/dist/assets/WorkTab-wTlX_UKP.js +1 -0
- package/ui/dist/assets/WorkflowBuilderPanel-CDpVt5ux.js +6 -0
- package/ui/dist/assets/WorkflowsPanel-zsFqsLdn.js +11 -0
- package/ui/dist/assets/{archive-gZFnGd5A.js → archive-Bh689DNg.js} +1 -1
- package/ui/dist/assets/{arrow-left-qA0Qer2h.js → arrow-left-WkVYLm80.js} +1 -1
- package/ui/dist/assets/{book-open-DIxdPqmD.js → book-open-ohEXgUsS.js} +1 -1
- package/ui/dist/assets/{bot-CvIF1uHi.js → bot-DvEcyQcD.js} +1 -1
- package/ui/dist/assets/{chart-column-BQiM-Td4.js → chart-column-w3goFd5f.js} +1 -1
- package/ui/dist/assets/{check-DgyDEFtq.js → check-CuRYh4Zh.js} +1 -1
- package/ui/dist/assets/{chevron-right-CQ1NTOtd.js → chevron-right-DbLSHmff.js} +1 -1
- package/ui/dist/assets/{circle-check-big-CAFcaPPH.js → circle-check-big-Bkba568b.js} +1 -1
- package/ui/dist/assets/{circle-stop-C-8xGv0n.js → circle-stop-Bx2ohEg8.js} +1 -1
- package/ui/dist/assets/{clipboard-list-9DdqBj1F.js → clipboard-list-Dj9tORnu.js} +1 -1
- package/ui/dist/assets/{clock-CF9BCIpL.js → clock-JyQAYy6X.js} +1 -1
- package/ui/dist/assets/{dollar-sign-LDRZBae6.js → dollar-sign-XxwPAA2a.js} +1 -1
- package/ui/dist/assets/{download-BBNXvBO0.js → download-D1izVEOL.js} +1 -1
- package/ui/dist/assets/{external-link-D_ji4Bec.js → external-link-DZ_rZsIt.js} +1 -1
- package/ui/dist/assets/{file-text-DrdTDEYp.js → file-text-Cfawu8Bs.js} +1 -1
- package/ui/dist/assets/{flask-conical-BGn5PgFX.js → flask-conical-Ql8QxhgY.js} +1 -1
- package/ui/dist/assets/{folder-BeZZUGnK.js → folder-DAdIw-Pb.js} +1 -1
- package/ui/dist/assets/{funnel-CAJgGO5M.js → funnel-FycfZcXo.js} +1 -1
- package/ui/dist/assets/{git-branch-BcXabeOs.js → git-branch-C2qrhGGu.js} +1 -1
- package/ui/dist/assets/index-Cml2x9pA.js +507 -0
- package/ui/dist/assets/index-yWybhcfI.css +1 -0
- package/ui/dist/assets/{layers-DxYDmPA_.js → layers-yzjtGlHB.js} +1 -1
- package/ui/dist/assets/{legacy-dHWI7k8P.js → legacy-D21WSMF1.js} +1 -1
- package/ui/dist/assets/{lightbulb-B0Du4SM4.js → lightbulb-BZJNK69S.js} +1 -1
- package/ui/dist/assets/{link-CUpaumqr.js → link-CnFkBkaY.js} +1 -1
- package/ui/dist/assets/{list-todo-CDDhmPQB.js → list-todo-BlgfQHup.js} +1 -1
- package/ui/dist/assets/{message-square-D5VWlv-Q.js → message-square-CRsG9u6_.js} +1 -1
- package/ui/dist/assets/{mic-Ddcc6Ann.js → mic-B32RHc7Y.js} +1 -1
- package/ui/dist/assets/{missions-2zox16Tc.js → missions-1iw8Z2_0.js} +1 -1
- package/ui/dist/assets/{network-DaJ7ugwX.js → network-C9RXQGrV.js} +1 -1
- package/ui/dist/assets/{pause-BukaK6rs.js → pause-BT1Bc2q3.js} +1 -1
- package/ui/dist/assets/{pencil-D_YwQBeg.js → pencil-BK5IU6o0.js} +1 -1
- package/ui/dist/assets/{play-BjdwtYMk.js → play-Cl1nC_gc.js} +1 -1
- package/ui/dist/assets/{plug-yISDdeW2.js → plug-DvcpOalj.js} +1 -1
- package/ui/dist/assets/{plus-BSjTdepW.js → plus-Dpo1qfrl.js} +1 -1
- package/ui/dist/assets/{radio-B7kX_yWE.js → radio-C5c9IyqX.js} +1 -1
- package/ui/dist/assets/{refresh-cw-CwDpzXUn.js → refresh-cw-C-iZkzuS.js} +1 -1
- package/ui/dist/assets/{rotate-ccw-7SQDTI0_.js → rotate-ccw-qzrB3SNw.js} +1 -1
- package/ui/dist/assets/{save-CjTPAQM0.js → save-DwR9wQVu.js} +1 -1
- package/ui/dist/assets/{search-BP7VlNxX.js → search-D10l0m3-.js} +1 -1
- package/ui/dist/assets/{send-C2XDuRPf.js → send-DtXGsaFW.js} +1 -1
- package/ui/dist/assets/{server-BE8W-AT4.js → server-BzisF3LL.js} +1 -1
- package/ui/dist/assets/settings-Dbwd1_-c.js +6 -0
- package/ui/dist/assets/{shield-check-s7la2J2K.js → shield-check-CXlDJyAW.js} +1 -1
- package/ui/dist/assets/square-BBC-JKzY.js +11 -0
- package/ui/dist/assets/{terminal-B8IK4WsO.js → terminal-DaBIlWEM.js} +1 -1
- package/ui/dist/assets/{test-tube-Xfn9DJeg.js → test-tube-CDATRD5t.js} +1 -1
- package/ui/dist/assets/{toggle-right-CHpzOIlj.js → toggle-right-DTmrC5RD.js} +1 -1
- package/ui/dist/assets/{trash-2-B1C85ePK.js → trash-2-CTeyjxD_.js} +1 -1
- package/ui/dist/assets/{trending-up-DDGHQZY1.js → trending-up-CXPRjRV4.js} +1 -1
- package/ui/dist/assets/{trophy-D0LhJSPA.js → trophy-DbVdXRtU.js} +1 -1
- package/ui/dist/assets/{volume-2-DMaE91b5.js → volume-2-DYDBmm3M.js} +1 -1
- package/ui/dist/assets/{wifi-off-DR9h8HGA.js → wifi-off-BBuIGbiP.js} +1 -1
- package/ui/dist/assets/zoom-out-D47_pRAO.js +16 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/AuditPanel-BaftX5MP.js +0 -1
- package/ui/dist/assets/BackupPanel-DAy9G7Wt.js +0 -1
- 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/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/CPVoice-DfwHPewA.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/EmptyState-CfvU7SdB.js +0 -1
- package/ui/dist/assets/EvalPanel-CDG-njyj.js +0 -1
- package/ui/dist/assets/FilesPanel-CaLPog2e.js +0 -16
- package/ui/dist/assets/FleetPanel-BtlaV6pH.js +0 -1
- package/ui/dist/assets/InfraView-C0zEuFrR.js +0 -2
- 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/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/MissionStart-wUkcEP0T.js +0 -1
- package/ui/dist/assets/Modal-BmS7C6FN.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/PersonaProfilesPanel-DGtokXUu.js +0 -8
- 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/SkillsPanel-CA415CT8.js +0 -11
- package/ui/dist/assets/TeamsPanel-C_Vu6vnY.js +0 -1
- package/ui/dist/assets/TitanCanvas-TuYZSZO7.js +0 -1117
- package/ui/dist/assets/ToolsView-BvTN6vFn.js +0 -2
- package/ui/dist/assets/TraceViewer-Bh8Jo3Dr.js +0 -1
- package/ui/dist/assets/TrainingPanel-Dmbd1rJ-.js +0 -1
- 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/chevron-up-UyfdjRp6.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/proxy-CWET5FFX.js +0 -9
|
@@ -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 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 +0,0 @@
|
|
|
1
|
-
import{r as b,u as W,j as e}from"./index-CUgepw5Q.js";import{c as _}from"./missions-2zox16Tc.js";const G={id:"hourly",label:"Every hour",cron:"0 * * * *",cadence:"24 runs/day"},L={id:"every4h",label:"Every 4 hours",cron:"0 */4 * * *",cadence:"6 runs/day"},A={id:"every6h",label:"Every 6 hours",cron:"0 */6 * * *",cadence:"4 runs/day"},I={id:"daily7",label:"Daily at 7am",cron:"0 7 * * *",cadence:"once/day"},M={id:"weekly",label:"Weekly (Mon 9am)",cron:"0 9 * * 1",cadence:"once/week"},H={id:"nightly",label:"Nightly at 11pm",cron:"0 23 * * *",cadence:"once/day"},D={id:"twice",label:"Twice daily (7am + 7pm)",cron:"0 7,19 * * *",cadence:"2 runs/day"},V=[{id:"research-digest",icon:"📰",title:"Daily research digest",blurb:"Scout researches your topic and writes a fresh briefing for the first run.",goalTemplate:'Research the latest developments on "{{topic}}" and produce a clear HTML briefing (write_file with a .html extension) with 5 highlights, an inline SVG chart of the most important trend, and clickable source links throughout.',suggestedPlayId:"research",fields:[{key:"topic",label:"Your topic",hint:"What you want a fresh briefing on each morning",defaultValue:"AI agents in business",placeholder:"AI agents in business"}],schedules:[I,D,M],whatItDoes:"Scout searches the web for fresh developments on your topic, reads the top 5 sources end-to-end, and writes a one-page briefing. The briefing lands on your desk as a paper sheet, and the chat thread captures every URL Scout looked at so you can dig in further if anything catches your eye.",accent:{from:"#6366f1",to:"#8b5cf6"}},{id:"inbox-triage",icon:"📬",title:"Inbox triage",blurb:"Sage sorts and summarizes incoming email so important threads stay visible.",goalTemplate:'Read my inbox and produce a triaged summary: "needs reply within 24h", "informational", "newsletters", and "junk". Cap at 30 messages per run.',suggestedPlayId:"inbox",fields:[],schedules:[L,A,I],whatItDoes:"Sage opens your inbox, classifies up to 30 recent threads into four buckets (urgent / informational / newsletters / junk), and pins the urgent ones to the desk as sticky notes. The full triage lands as a paper sheet you can scan in under a minute.",accent:{from:"#06b6d4",to:"#0ea5e9"}},{id:"code-review",icon:"🔍",title:"Code review",blurb:"Builder reviews your repo changes and reports only meaningful findings.",goalTemplate:"Review the diff in {{repoPath}} since the last review. Flag bugs, regressions, and obvious improvements. Don't nitpick formatting.",suggestedPlayId:"code-review",fields:[{key:"repoPath",label:"Repo path or URL",hint:"Local path on the host, or a GitHub repo URL",defaultValue:"~/Desktop/MyProject",placeholder:"~/projects/repo"}],schedules:[H,D],whatItDoes:"Builder pulls the latest changes from your repo and writes a concise review focused on real defects (logic bugs, regressions, security smells). Formatting nits are skipped. Findings land as a paper sheet; if there's nothing to report, Builder closes silently.",accent:{from:"#22c55e",to:"#10b981"}},{id:"lead-scout",icon:"🎯",title:"Lead scout",blurb:"Scout scans freelance + opportunity boards and surfaces matches for your skills.",goalTemplate:'Scan Upwork, Indeed, and HackerNews "who is hiring" for new postings matching: {{skills}}. Filter to budget >= ${{minBudget}} and remote OK.',suggestedPlayId:"lead-scout",fields:[{key:"skills",label:"Skills to match",hint:"Comma-separated keywords. Scout fuzzy-matches.",defaultValue:"TypeScript, Node.js, AI agents",placeholder:"React, Python, design"},{key:"minBudget",label:"Minimum budget (USD)",hint:"Skip postings paying less.",defaultValue:"500"}],schedules:[L,A,I],whatItDoes:"Scout sweeps the boards you care about for postings that match your skill keywords and budget floor. New matches land as sticky notes; the running log of every posting seen sits as a paper sheet you can browse anytime.",accent:{from:"#f59e0b",to:"#eab308"}},{id:"market-watch",icon:"📈",title:"Market watch",blurb:"Analyst tracks tickers + crypto and writes a brief if anything moves >3%.",goalTemplate:"Check the latest price + 24h move for: {{tickers}}. If any moved more than 3% (up or down) since the last run, produce an HTML brief (write_file with a .html extension) with a sparkline SVG per ticker and a one-paragraph explanation with 2 source links.",suggestedPlayId:"analyst",fields:[{key:"tickers",label:"Tickers / coins",hint:"Comma-separated. Stocks or crypto.",defaultValue:"BTC, ETH, NVDA, AAPL",placeholder:"TSLA, SPY, BTC"}],schedules:[G,L,A],whatItDoes:"Each cycle, Analyst pulls the latest price and 24-hour move for every ticker you listed. If anything jumped or dropped more than 3%, it writes a one-paragraph explanation with 2 source links. Quiet runs close silently — your desk only fills up when something actually moved.",accent:{from:"#ef4444",to:"#f97316"}},{id:"creative-prompts",icon:"🎨",title:"Daily creative prompt",blurb:"Writer creates a fresh writing, sketching, or music prompt for the first run.",goalTemplate:"Generate a fresh {{discipline}} prompt for me today. Make it specific enough to start in 5 minutes but open enough to take in any direction. Include a 1-line warm-up exercise.",fields:[{key:"discipline",label:"Discipline",hint:"What kind of prompt you want.",defaultValue:"songwriting",placeholder:"short fiction · songwriting · sketching"}],schedules:[I,M],whatItDoes:"Writer creates one fresh creative prompt tailored to the discipline you chose, with a quick warm-up exercise to get started. The prompt lands as a sticky note on the desk so you can grab it when you need it.",accent:{from:"#ec4899",to:"#8b5cf6"}}];function Y(s,n){return s.goalTemplate.replace(/\{\{(\w+)\}\}/g,(i,r)=>{const u=n[r];return u&&u.trim().length>0?u.trim():r})}const z=["Plan my mom's 70th birthday party","Write a thank-you note to my landlord","Summarize this long email I got","Draft the Q1 investor update","Review a code change"],x="var(--theme-font-display, 'Iowan Old Style', 'Charter', Georgia, serif)",d="var(--theme-font-mono, 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace)",c="var(--theme-paper, #f3e9d0)",o="var(--theme-ink-soft, #a0a8d0)",t="var(--theme-metal, #c4a35a)",g="var(--theme-metal-bright, #f3d27a)",m="var(--theme-metal-dark, #8a6a3a)",F="var(--theme-bolt, #2a1808)",E="var(--theme-leather, #4a2818)",v="var(--theme-leather-edge, #2a1408)",U="var(--theme-leather-stitch, #d4a060)",h="var(--theme-bg-base, #1a1235)",R="var(--theme-bg-grain, #0e0820)",K="var(--theme-bg-vignette, rgba(0,0,0,0.6))",j="var(--theme-shadow, rgba(0,0,0,0.55))",Q="var(--theme-accent, #c45a30)";function ee(){const[s,n]=b.useState(""),[i,r]=b.useState(!1),[u,N]=b.useState(null),[$,k]=b.useState(null),S=W();async function y(a,p){const f=a.trim();if(!(!f||i)){r(!0),N(null);try{const{mission:w}=await _(f,p);S(`/mission/${w.id}`)}catch(w){N(w.message),r(!1)}}}return e.jsxs("div",{className:"min-h-full w-full flex flex-col items-center",style:{color:c,fontFamily:x,background:`radial-gradient(120% 80% at 50% -10%, ${R} 0%, ${h} 60%, ${h} 100%)`},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:`radial-gradient(circle at 50% 12%, ${Q}22 0%, transparent 55%)`}}),e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{boxShadow:`inset 0 0 240px 60px ${K}`}}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-8 w-full max-w-5xl px-6 pt-10 pb-28 md:py-14",children:[e.jsxs("div",{className:"w-full flex items-center",style:{paddingRight:260},children:[e.jsxs("div",{className:"flex items-center gap-3 text-[11px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:[e.jsx("span",{style:{color:g,fontWeight:700},children:"TITAN"}),e.jsx("span",{style:{opacity:.6},children:"·"}),e.jsx("span",{children:"MISSION CONTROL"})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx(P,{onClick:()=>S("/mission/library"),title:"See your past missions",children:"Past missions →"}),e.jsx(P,{onClick:()=>S("/space/home"),title:"Back to the canvas spaces",children:"🌌 Canvas"})]})]}),e.jsxs("section",{className:"relative w-full max-w-3xl rounded-3xl overflow-hidden",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${v}`,boxShadow:`0 30px 80px ${j}, inset 0 1px 0 ${t}33`,padding:"36px 36px 28px"},children:[e.jsx(C,{position:"tl"}),e.jsx(C,{position:"tr"}),e.jsx(C,{position:"bl"}),e.jsx(C,{position:"br"}),e.jsx("div",{className:"text-[10px] uppercase tracking-[0.4em] mb-3",style:{color:t,fontFamily:d,fontWeight:600},children:"◆ New Mission"}),e.jsx("h1",{className:"text-4xl md:text-5xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600,letterSpacing:0,textShadow:`0 2px 12px ${j}`},children:"What's the mission?"}),e.jsx("p",{className:"mt-3 text-[15px] leading-relaxed max-w-xl",style:{color:o},children:"Tell me anything — a thank-you note, a birthday plan, a Q1 report. I’ll assemble a small team of AI specialists and we’ll work it out together."}),e.jsxs("form",{onSubmit:a=>{a.preventDefault(),y(s)},className:"mt-6 flex flex-col gap-3",children:[e.jsx("textarea",{autoFocus:!0,value:s,onChange:a=>n(a.target.value),placeholder:"Try: Help me write a birthday speech for my mom",rows:3,disabled:i,className:"w-full resize-none outline-none rounded-2xl px-5 py-4 text-base leading-relaxed",style:{background:`${h}80`,color:c,border:`1px solid ${t}44`,fontFamily:x,boxShadow:`inset 0 2px 8px ${j}`},onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&(a.preventDefault(),y(s))}}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"⌘↵ to dispatch · voice coming soon"}),e.jsxs("div",{className:"flex w-full items-center gap-2 sm:w-auto",children:[e.jsx("button",{type:"button",disabled:!0,title:"Voice is coming next release",className:"w-11 h-11 rounded-full flex items-center justify-center cursor-not-allowed",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o,opacity:.55},children:"🎤"}),e.jsx("button",{type:"submit",disabled:!s.trim()||i,className:"h-11 flex-1 rounded-xl px-5 text-sm font-bold tracking-wide transition-transform sm:flex-none",style:{background:s.trim()&&!i?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}66`,color:s.trim()&&!i?F:o,border:`1px solid ${m}`,boxShadow:s.trim()&&!i?`0 6px 18px ${j}, inset 0 1px 0 ${g}`:"none",cursor:s.trim()&&!i?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},onMouseDown:a=>{s.trim()&&!i&&(a.currentTarget.style.transform="translateY(1px)")},onMouseUp:a=>{a.currentTarget.style.transform=""},onMouseLeave:a=>{a.currentTarget.style.transform=""},children:i?"Dispatching…":"Start mission →"})]})]})]}),u&&e.jsx("div",{className:"mt-4 text-sm rounded-lg px-3 py-2",style:{color:"#ffb4a8",background:"#5a1a1a55",border:"1px solid #8a3a3a"},children:u})]}),e.jsxs("div",{className:"w-full max-w-3xl flex flex-col items-center gap-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.35em]",style:{color:o,fontFamily:d},children:"— or try a one-shot —"}),e.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:z.map(a=>e.jsx("button",{type:"button",onClick:()=>y(a),disabled:i,className:"px-3 py-1.5 text-xs rounded-full transition-colors disabled:opacity-50",style:{background:`${v}99`,color:c,border:`1px solid ${t}33`,fontFamily:x},onMouseEnter:p=>{p.currentTarget.style.borderColor=`${t}88`,p.currentTarget.style.background=`${E}`},onMouseLeave:p=>{p.currentTarget.style.borderColor=`${t}33`,p.currentTarget.style.background=`${v}99`},children:a},a))})]}),e.jsxs("section",{className:"w-full mt-4 flex flex-col gap-4",children:[e.jsxs("header",{className:"flex items-baseline justify-between pb-3",style:{borderBottom:`1px solid ${t}33`},children:[e.jsxs("h2",{className:"text-xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600},children:["Mission starters",e.jsx("span",{className:"ml-3 text-[10px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:"saved cadence"})]}),e.jsx("span",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"click → 3 steps → launch"})]}),e.jsx("p",{className:"text-sm leading-relaxed max-w-2xl",style:{color:o},children:"Pick a starter recipe, customize it, and launch the first run. TITAN saves the cadence with the mission request."}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3 mt-2",children:V.map(a=>e.jsx(J,{template:a,onClick:()=>k(a)},a.id))})]}),e.jsx("div",{className:"h-20"})]}),$&&e.jsx(q,{template:$,onClose:()=>k(null),onLaunch:async(a,p,f)=>{try{const w=JSON.parse(localStorage.getItem("titan-pending-schedules")??"[]");w.push({at:new Date().toISOString(),templateId:$.id,goal:a,scheduleId:p}),localStorage.setItem("titan-pending-schedules",JSON.stringify(w))}catch{}k(null),await y(a,f)}})]})}function P({onClick:s,title:n,children:i}){return e.jsx("button",{onClick:s,title:n,className:"px-3 py-1 text-[10px] uppercase tracking-[0.2em] rounded-full transition-colors",style:{color:o,border:`1px solid ${t}33`,background:"transparent",fontFamily:d},onMouseEnter:r=>{r.currentTarget.style.color=c,r.currentTarget.style.borderColor=`${t}99`},onMouseLeave:r=>{r.currentTarget.style.color=o,r.currentTarget.style.borderColor=`${t}33`},children:i})}function C({position:s}){const n={position:"absolute"};return s==="tl"&&(n.top=10,n.left=10),s==="tr"&&(n.top=10,n.right=10),s==="bl"&&(n.bottom=10,n.left=10),s==="br"&&(n.bottom=10,n.right=10),e.jsx("div",{style:{...n,width:6,height:6,borderRadius:"50%",background:t,boxShadow:`0 0 6px ${g}, inset 0 1px 0 ${g}`,opacity:.7,pointerEvents:"none"}})}function J({template:s,onClick:n}){const[i,r]=b.useState(!1);return e.jsxs("button",{type:"button",onClick:n,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),className:"text-left rounded-2xl relative overflow-hidden transition-all",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${i?t:v}`,boxShadow:i?`0 14px 36px ${j}, inset 0 1px 0 ${t}55`:`0 6px 18px ${j}, inset 0 1px 0 ${t}22`,transform:i?"translateY(-2px)":"translateY(0)",padding:"14px 16px 14px"},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md mb-3",style:{background:`linear-gradient(180deg, ${g} 0%, ${t} 55%, ${m} 100%)`,border:`1px solid ${m}`,boxShadow:`inset 0 1px 0 ${g}aa, 0 1px 3px ${j}`,color:F},children:[e.jsx("span",{className:"text-base leading-none",children:s.icon}),e.jsx("span",{className:"text-xs uppercase tracking-[0.16em] truncate",style:{fontFamily:x,fontWeight:700,letterSpacing:"0.12em"},children:s.title})]}),e.jsx("p",{className:"text-[13px] leading-snug mb-3",style:{color:c,opacity:.88},children:s.blurb}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.schedules.slice(0,2).map(u=>e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full",style:{background:`${v}cc`,color:c,border:`1px solid ${U}55`,fontFamily:d,opacity:.85},children:u.label},u.id)),e.jsx("span",{className:"ml-auto text-[10px] uppercase tracking-[0.2em] transition-opacity",style:{color:g,fontFamily:d,opacity:i?1:0},children:"Set up →"})]})]})}function q({template:s,onClose:n,onLaunch:i}){const[r,u]=b.useState(1),[N,$]=b.useState(()=>Object.fromEntries(s.fields.map(l=>[l.key,l.defaultValue]))),[k,S]=b.useState(s.schedules[0]),[y,a]=b.useState(!1),p=Y(s,N),f=r!==1||s.fields.every(l=>(N[l.key]??"").trim().length>0);async function w(){if(!y){a(!0);try{await i(p,k.id,s.suggestedPlayId)}finally{a(!1)}}}const B={background:`${h}aa`,color:c,border:`1px solid ${t}33`,fontFamily:x};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center backdrop-blur-sm p-4 md:p-8",style:{background:`${R}cc`},onClick:n,children:e.jsxs("div",{className:"relative w-full max-w-2xl rounded-2xl overflow-hidden flex flex-col",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${t}55`,boxShadow:`0 40px 100px ${j}, inset 0 1px 0 ${t}55`,color:c,fontFamily:x},onClick:l=>l.stopPropagation(),children:[e.jsx("div",{style:{height:4,background:`linear-gradient(90deg, ${m}, ${g}, ${m})`}}),e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",style:{borderBottom:`1px solid ${t}22`},children:[e.jsx("span",{className:"text-2xl leading-none",children:s.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm truncate",style:{color:c},children:s.title}),e.jsxs("div",{className:"text-[11px]",style:{color:o,fontFamily:d},children:["Step ",r," of 3 · ",r===1?"Customize":r===2?"Cadence":"Launch"]})]}),e.jsx("button",{onClick:n,className:"w-8 h-8 rounded-full flex items-center justify-center text-sm",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o},title:"Close",children:"✕"})]}),e.jsx("div",{className:"px-5 py-2 flex items-center gap-2",style:{borderBottom:`1px solid ${t}11`},children:[1,2,3].map(l=>e.jsx("div",{className:"h-1 flex-1 rounded-full transition-colors",style:{background:l<=r?`linear-gradient(90deg, ${t}, ${g})`:`${h}66`}},l))}),e.jsxs("div",{className:"p-5 max-h-[60vh] overflow-y-auto",children:[r===1&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:s.blurb}),s.fields.length===0&&e.jsxs("div",{className:"text-sm italic",style:{color:o},children:["This template runs as-is — no setup needed. Click ",e.jsx("b",{style:{color:c},children:"Next"})," to pick a cadence."]}),s.fields.map(l=>e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em]",style:{color:t,fontFamily:d,fontWeight:600},children:l.label}),e.jsx("input",{value:N[l.key]??"",onChange:T=>$(O=>({...O,[l.key]:T.target.value})),placeholder:l.placeholder??l.defaultValue,className:"px-3 py-2 rounded-lg text-sm outline-none",style:B}),l.hint&&e.jsx("span",{className:"text-[11px]",style:{color:o},children:l.hint})]},l.key)),e.jsxs("div",{className:"mt-2 px-3 py-2.5 rounded-lg",style:{background:`${h}66`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Preview goal"}),e.jsx("div",{className:"text-sm leading-snug",style:{color:c},children:p})]})]}),r===2&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Which cadence should TITAN remember?"}),s.schedules.map(l=>{const T=l.id===k.id;return e.jsxs("button",{onClick:()=>S(l),className:"flex items-center justify-between p-3 rounded-xl text-left transition-colors",style:{background:T?`${t}1f`:`${h}55`,border:`1px solid ${T?t:`${t}22`}`,color:T?c:o},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-sm",style:{color:c},children:l.label}),e.jsx("span",{className:"text-[11px]",style:{color:o,fontFamily:d},children:l.cadence})]}),e.jsx("code",{className:"text-[10px]",style:{color:o,fontFamily:d},children:l.cron})]},l.id)}),e.jsx("div",{className:"text-[11px] italic px-1 pt-1",style:{color:o},children:"This starts the first run immediately and saves the cadence selection for recurring mission support."})]}),r===3&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Quick recap before we kick off."}),e.jsxs("div",{className:"rounded-xl p-4",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"What I'll do"}),e.jsx("div",{className:"text-sm leading-relaxed",style:{color:c},children:s.whatItDoes})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[12px]",children:[e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Goal"}),e.jsx("div",{className:"leading-snug",style:{color:c},children:p})]}),e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Cadence"}),e.jsx("div",{className:"font-semibold",style:{color:c},children:k.label}),e.jsx("div",{className:"text-[11px] mt-0.5",style:{color:o,fontFamily:d},children:k.cadence})]})]})]})]}),e.jsxs("div",{className:"px-5 py-3 flex items-center justify-between",style:{borderTop:`1px solid ${t}22`,background:`${v}66`},children:[e.jsx("button",{onClick:()=>r>1?u(l=>l-1):n(),className:"px-4 py-2 text-sm",style:{color:o,background:"transparent",fontFamily:x},children:r>1?"← Back":"Cancel"}),r<3?e.jsx("button",{onClick:()=>u(l=>l+1),disabled:!f,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:f?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}55`,color:F,border:`1px solid ${m}`,opacity:f?1:.5,cursor:f?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},children:"Next →"}):e.jsx("button",{onClick:w,disabled:y,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:y?`${m}55`:`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`,color:F,border:`1px solid ${m}`,opacity:y?.6:1,cursor:y?"wait":"pointer",fontFamily:x,letterSpacing:"0.04em"},children:y?"Launching…":"Launch first run 🚀"})]})]})})}export{ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,j as e,X as x}from"./index-CUgepw5Q.js";import{c as y}from"./clsx-B-dksMZM.js";import{A as p,m as l}from"./proxy-CWET5FFX.js";const u={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl"};function j({open:s,onClose:t,title:i,children:m,footer:n,size:o="md",hideCloseButton:c=!1}){const a=r.useCallback(d=>{d.key==="Escape"&&t()},[t]);return r.useEffect(()=>{if(s)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s,a]),e.jsx(p,{children:s&&e.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",children:[e.jsx(l.div,{className:"absolute inset-0 titan-menu-overlay",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15}}),e.jsxs(l.div,{className:y("relative w-full mx-4 titan-modal-surface",u[o]),initial:{opacity:0,y:-16,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-16,scale:.97},transition:{duration:.2,ease:"easeOut"},children:[i&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--theme-menu-border)"},children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:i}),!c&&e.jsx("button",{type:"button",onClick:t,className:"titan-close-btn","aria-label":"Close",children:e.jsx(x,{size:16})})]}),e.jsx("div",{className:"px-4 py-4",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:m}),n&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-3",style:{borderTop:"1px solid var(--theme-menu-border)"},children:n})]})]})})}export{j as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,bG as b,bH as g,j as e,K as d,h,bI as f}from"./index-CUgepw5Q.js";import{P as p}from"./PageHeader-bnc85wQN.js";import{R as j}from"./refresh-cw-CwDpzXUn.js";import{C as u}from"./circle-check-big-CAFcaPPH.js";import"./chevron-right-CQ1NTOtd.js";function A(){const[n,m]=t.useState([]),[i,o]=t.useState({}),[l,c]=t.useState(!0),r=t.useCallback(async()=>{c(!0);try{const[s,a]=await Promise.all([b(),g()]);m(s.alerts||[]),o(a)}catch{}c(!1)},[]);t.useEffect(()=>{r()},[r]);const x=async s=>{try{await f(s),await r()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(p,{title:"Organism Monitor",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Safety"},{label:"Organism"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:r,disabled:l,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(j,{className:`w-4 h-4 ${l?"animate-spin":""}`})," Refresh"]})}),Object.keys(i).length>0&&e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Object.entries(i).map(([s,a])=>e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b] capitalize",children:s}),e.jsx("div",{className:"text-sm font-semibold text-[#e4e4e7]",children:typeof a=="number"?a.toFixed(2):a})]},s))}),e.jsx("div",{className:"space-y-2",children:n.map(s=>e.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${s.severity==="critical"?"bg-red-950/20 border-red-900/50":s.severity==="warning"?"bg-amber-950/20 border-amber-900/50":"bg-[#0a0a0f] border-[#27272a]"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[s.severity==="critical"?e.jsx(d,{className:"w-4 h-4 text-red-400"}):s.severity==="warning"?e.jsx(d,{className:"w-4 h-4 text-amber-400"}):e.jsx(h,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:s.message}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.source," • ",new Date(s.timestamp).toLocaleString()]})]})]}),!s.acknowledged&&e.jsxs("button",{onClick:()=>x(s.id),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] text-xs hover:bg-[#3f3f46]",children:[e.jsx(u,{className:"w-3.5 h-3.5"})," Ack"]})]},s.id))})]})}export{A as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e,Z as v,A as x,n as f,C as h,bw as p}from"./index-CUgepw5Q.js";import{S as a}from"./StatCard-Djr487DV.js";import{P as c}from"./PageHeader-bnc85wQN.js";import{S as g}from"./SkeletonLoader-Cax7YTqW.js";import{C as j}from"./clock-CF9BCIpL.js";import{M as b}from"./message-square-D5VWlv-Q.js";import{S}from"./server-BE8W-AT4.js";import{L as w}from"./layers-DxYDmPA_.js";import"./chevron-right-CQ1NTOtd.js";import"./clsx-B-dksMZM.js";function y(t){const s=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);return s>0?`${s}d ${r}h ${i}m`:r>0?`${r}h ${i}m`:`${i}m`}function m(t){const s=t/1024/1024;return s>1024?`${(s/1024).toFixed(1)} GB`:`${s.toFixed(0)} MB`}function R(){const[t,s]=l.useState(null),[r,i]=l.useState(null),[d,u]=l.useState(!0),n=async()=>{try{const o=await p();s(o),i(null)}catch(o){i(o instanceof Error?o.message:"Failed to fetch stats")}finally{u(!1)}};return l.useEffect(()=>{n();const o=setInterval(n,1e4);return()=>clearInterval(o)},[]),d?e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsx(c,{title:"System Overview",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Monitoring"},{label:"Overview"}]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:e.jsx(g,{variant:"metric",count:8})})]}):r?e.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:r}):t?e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsx(c,{title:"System Overview",subtitle:"Real-time system health and metrics",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Monitoring"},{label:"Overview"}]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(a,{title:"Uptime",value:y(t.uptime),icon:e.jsx(j,{className:"h-5 w-5"})}),e.jsx(a,{title:"Total Requests",value:t.totalRequests.toLocaleString(),icon:e.jsx(v,{className:"h-5 w-5"})}),e.jsx(a,{title:"Active Agents",value:t.activeAgents,icon:e.jsx(x,{className:"h-5 w-5"})}),e.jsx(a,{title:"Active Sessions",value:t.activeSessions,icon:e.jsx(b,{className:"h-5 w-5"})}),e.jsx(a,{title:"Memory Usage",value:m(t.memoryUsage.heapUsed),icon:e.jsx(f,{className:"h-5 w-5"}),subtitle:`${m(t.memoryUsage.heapTotal)} total`}),e.jsx(a,{title:"Model",value:t.model,icon:e.jsx(h,{className:"h-5 w-5"})}),e.jsx(a,{title:"Provider",value:t.provider,icon:e.jsx(S,{className:"h-5 w-5"})}),e.jsx(a,{title:"Version",value:t.version,icon:e.jsx(w,{className:"h-5 w-5"})})]})]}):null}export{R as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{c as f,r,bh as j,bi as g,j as e,bj as N}from"./index-CUgepw5Q.js";import{P as u}from"./PageHeader-bnc85wQN.js";import{R as v}from"./refresh-cw-CwDpzXUn.js";import{C as m}from"./check-DgyDEFtq.js";import{P as h}from"./pause-BukaK6rs.js";import{V as w}from"./volume-2-DMaE91b5.js";import{C as y}from"./clock-CF9BCIpL.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 P=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],k=f("lock",P);function S(){const[t,p]=r.useState(null),[a,b]=r.useState(null),[n,x]=r.useState(!0),i=r.useCallback(async()=>{x(!0);try{const[s,l]=await Promise.all([j(),g()]);p(s),b(l)}catch{}x(!1)},[]);r.useEffect(()=>{i()},[i]);const c=(t==null?void 0:t.enabled)??!1,o=(t==null?void 0:t.profiles)??[];return e.jsxs("div",{className:"space-y-4",children:[e.jsx(u,{title:"Persona Profiles",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Identity"},{label:"Personas"}]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("button",{onClick:i,disabled:n,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(v,{className:`w-4 h-4 ${n?"animate-spin":""}`})," Refresh"]})}),c?e.jsxs("div",{className:"p-4 rounded-lg border border-[#27272a] bg-[#0a0a0f] text-sm flex items-start gap-3",children:[e.jsx(m,{className:"w-4 h-4 text-emerald-400 mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-emerald-300 mb-1",children:"Personas enabled"}),e.jsxs("div",{className:"text-[#a1a1aa]",children:["Active right now: ",e.jsx("span",{className:"text-[#e4e4e7] font-medium",children:(a==null?void 0:a.activeName)??"—"}),(a==null?void 0:a.windDown)&&e.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 text-amber-300",children:[e.jsx(h,{className:"w-3 h-3"})," wind-down active"]})]}),e.jsx("div",{className:"text-xs text-[#52525b] mt-1",children:a==null?void 0:a.reason})]})]}):e.jsxs("div",{className:"p-4 rounded-lg border border-amber-900/50 bg-amber-950/20 text-sm",children:[e.jsx("div",{className:"font-semibold text-amber-300 mb-1",children:"Personas disabled"}),e.jsxs("div",{className:"text-[#a1a1aa]",children:["TITAN behaves as a single default persona. To enable Dad Mode (and any other defined profiles), add to ",e.jsx("code",{className:"px-1 py-0.5 rounded bg-[#0a0a0f] text-[#e4e4e7]",children:"~/.titan/titan.json"}),":"]}),e.jsx("pre",{className:"mt-2 p-2 rounded bg-[#0a0a0f] text-xs text-[#a1a1aa] overflow-x-auto",children:`{
|
|
7
|
-
"personas": { "enabled": true }
|
|
8
|
-
}`}),e.jsxs("div",{className:"text-[#a1a1aa] mt-1",children:["Then restart ",e.jsx("code",{className:"px-1 py-0.5 rounded bg-[#0a0a0f]",children:"titan.service"}),"."]})]}),c&&t&&Object.keys(t.channelPins).length>0&&e.jsxs("div",{className:"p-3 rounded-lg border border-[#27272a] bg-[#0a0a0f]",children:[e.jsx("div",{className:"text-xs uppercase tracking-wide text-[#52525b] mb-2",children:"Channel pins"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(t.channelPins).map(([s,l])=>e.jsxs("span",{className:"text-xs px-2 py-1 rounded bg-[#27272a] text-[#a1a1aa]",children:[s," → ",e.jsx("span",{className:"text-[#e4e4e7]",children:l})]},s))})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[o.map(s=>{const l=c&&(a==null?void 0:a.activeId)===s.id;return e.jsxs("div",{className:`p-4 rounded-lg border ${l?"border-emerald-700 bg-emerald-950/20":"border-[#27272a] bg-[#0a0a0f]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-[#e4e4e7]",children:s.name}),e.jsx("div",{className:"text-xs text-[#52525b]",children:s.id})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[s.windDown&&e.jsxs("span",{title:"windDown=true: pauses autopilot when active",className:"text-xs px-1.5 py-0.5 rounded bg-amber-950/40 text-amber-300 inline-flex items-center gap-1",children:[e.jsx(h,{className:"w-3 h-3"})," wind-down"]}),s.voiceId&&e.jsxs("span",{title:`voiceId: ${s.voiceId}`,className:"text-xs px-1.5 py-0.5 rounded bg-[#27272a] text-[#a1a1aa] inline-flex items-center gap-1",children:[e.jsx(w,{className:"w-3 h-3"})," voice"]}),l&&e.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded bg-emerald-950/40 text-emerald-300 inline-flex items-center gap-1",children:[e.jsx(m,{className:"w-3 h-3"})," active"]})]})]}),s.description&&e.jsx("div",{className:"text-xs text-[#a1a1aa] mb-3",children:s.description}),s.schedule&&e.jsxs("div",{className:"text-xs text-[#a1a1aa] flex items-center gap-1 mb-2",children:[e.jsx(y,{className:"w-3 h-3"})," ",s.schedule.from," – ",s.schedule.to," local"]}),(s.allowedTools.length>0||s.deniedTools.length>0)&&e.jsxs("div",{className:"space-y-1.5 mt-2",children:[s.allowedTools.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-wide text-[#52525b] mb-1 flex items-center gap-1",children:[e.jsx(k,{className:"w-3 h-3"})," allowed only"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.allowedTools.map(d=>e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-[#27272a] text-[#a1a1aa]",children:d},d))})]}),s.deniedTools.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-[#52525b] mb-1",children:"denied"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:s.deniedTools.map(d=>e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-red-950/30 text-red-300",children:d},d))})]})]})]},s.id)}),o.length===0&&!n&&e.jsx("div",{className:"text-sm text-[#52525b] p-3",children:"No persona profiles defined."})]})]})}export{S as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,ay as p,j as e,az as h,aA as f}from"./index-CUgepw5Q.js";import{P as u}from"./PageHeader-bnc85wQN.js";import{R as b}from"./refresh-cw-CwDpzXUn.js";import{B as g}from"./book-open-DIxdPqmD.js";import{P as j}from"./play-BjdwtYMk.js";import{T as N}from"./trash-2-B1C85ePK.js";import"./chevron-right-CQ1NTOtd.js";function E(){const[d,o]=a.useState([]),[i,n]=a.useState(!0),[c,r]=a.useState(null),t=a.useCallback(async()=>{n(!0);try{const s=await p();o(s.recipes||[])}catch{}n(!1)},[]);a.useEffect(()=>{t()},[t]);const m=async s=>{r(s);try{await h(s)}catch{}r(null)},x=async s=>{if(confirm("Delete this recipe?"))try{await f(s),await t()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(u,{title:"Recipe Kitchen",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Recipes"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:t,disabled:i,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(b,{className:`w-4 h-4 ${i?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:d.map(s=>{var l;return e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(g,{className:"w-4 h-4 text-[#6366f1] shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm text-[#e4e4e7] truncate",children:s.name}),e.jsx("div",{className:"text-xs text-[#52525b] truncate",children:s.description}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.steps.length," steps • ",(l=s.tags)==null?void 0:l.join(", ")]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("button",{onClick:()=>m(s.id),disabled:c===s.id,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#6366f1] text-white text-xs hover:bg-[#4f46e5] disabled:opacity-50",children:[e.jsx(j,{className:"w-3.5 h-3.5"})," ",c===s.id?"Running...":"Run"]}),e.jsx("button",{onClick:()=>x(s.id),className:"p-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] hover:bg-[#3f3f46] hover:text-red-400",children:e.jsx(N,{className:"w-3.5 h-3.5"})})]})]},s.id)})})]})}export{E as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,b as n,j as e}from"./index-CUgepw5Q.js";import{P as i}from"./PageHeader-bnc85wQN.js";import"./chevron-right-CQ1NTOtd.js";function b(){const[a,d]=t.useState(null),[o,l]=t.useState(!0);if(t.useEffect(()=>{n("/api/config",{headers:{"Content-Type":"application/json"}}).then(s=>s.json()).then(s=>d(s.security||{})).catch(()=>d({})).finally(()=>l(!1))},[]),o)return e.jsx("div",{className:"text-[var(--text-muted)]",children:"Loading security config..."});const r=a||{};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(i,{title:"Security",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Settings"},{label:"Security"}]}),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:"Sandbox Mode"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:String(r.sandboxMode||"none")})]}),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:"Shield"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:r.shield?"Enabled":"Disabled"})]}),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:"Denied Tools"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:Array.isArray(r.deniedTools)?r.deniedTools.length:0})]})]}),Array.isArray(r.deniedTools)&&r.deniedTools.length>0&&e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("h2",{className:"text-sm font-medium text-[var(--text-secondary)] mb-2",children:"Denied Tools"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r.deniedTools.map(s=>e.jsx("span",{className:"px-2 py-1 text-xs rounded bg-red-500/10 text-red-400 border border-red-500/20",children:s},s))})]})]})}export{b as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,a8 as Je,b as p,j as e,A as he,i as Pe,C as Ve,W as We,V as q,S as be,Z as ge,l as Ge,a9 as He}from"./index-CUgepw5Q.js";import{P as Ke}from"./PageHeader-bnc85wQN.js";import{R as k}from"./refresh-cw-CwDpzXUn.js";import{C as je}from"./circle-check-big-CAFcaPPH.js";import{C as Ue}from"./clock-CF9BCIpL.js";import{T as Ze}from"./trophy-D0LhJSPA.js";import{T as fe}from"./trending-up-DDGHQZY1.js";import{B as ze}from"./bot-CvIF1uHi.js";import{C as Q}from"./chevron-right-CQ1NTOtd.js";import{P as ye}from"./play-BjdwtYMk.js";import{T as Xe}from"./terminal-B8IK4WsO.js";import{R as Ye}from"./radio-B7kX_yWE.js";import{T as et}from"./trash-2-B1C85ePK.js";const D={prompts:"System Prompts","tool-selection":"Tool Selection","response-quality":"Response Quality","error-recovery":"Error Recovery"},J=[{label:"Once daily (2am)",value:["0 2 * * *"]},{label:"Twice daily (2am + 2pm)",value:["0 2 * * *","0 14 * * *"]},{label:"Three times (2am + 10am + 6pm)",value:["0 2 * * *","0 10 * * *","0 18 * * *"]}];function Ne({status:j}){const A={running:"bg-info/10 text-info",completed:"bg-success/10 text-success",failed:"bg-error/10 text-error",training:"bg-warning/10 text-warning",deployed:"bg-purple/10 text-purple"},f={running:"bg-info",completed:"bg-success",failed:"bg-error",training:"bg-warning",deployed:"bg-purple"};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[j]||"bg-border-light/20 text-text-muted"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${f[j]||"bg-border-light"}`}),j]})}function pt(){var me,ue;const[j,A]=a.useState(null),[f,ve]=a.useState([]),[P,we]=a.useState([]),[h,Se]=a.useState([]),[r,ke]=a.useState(null),[Ce,Re]=a.useState(!0),[C,V]=a.useState(null),[R,W]=a.useState(null),[B,_e]=a.useState(!1),[N,Te]=a.useState(!0),[x,G]=a.useState("tool_router"),[E,Me]=a.useState(!1),[u,v]=a.useState({baseModel:"unsloth/Qwen2.5-32B-bnb-4bit",loraRank:32,learningRate:1e-4,epochs:2,timeBudgetMin:60,maxSeqLength:2048}),[b,$e]=a.useState([]),[d,De]=a.useState(null),[H,K]=a.useState(!1),[U,Z]=a.useState(!1),[z,X]=a.useState(!1),[g,Y]=a.useState([]),[S,Ae]=a.useState(!0),[Be,_]=a.useState(!1),L=a.useRef(null),O=a.useRef(null),ee=a.useRef(null),[F,te]=a.useState(1),[T,se]=a.useState(30),[I,ae]=a.useState(120),[M,re]=a.useState(!1),[$,ne]=a.useState(!1),[le,ie]=a.useState([]),[ce,xe]=a.useState(0),m=a.useCallback((t,s)=>{W({type:t,message:s}),setTimeout(()=>W(null),3e3)},[]),y=a.useCallback(async()=>{try{const s=(await Je()).selfImprove||{};A(s),te(s.runsPerDay||1),se(s.budgetMinutes||30),ae(s.maxDailyBudgetMinutes||120),re(s.autoApply||!1),ne(s.pauseOnWeekends||!1),ie(s.areas||["prompts","tool-selection","response-quality","error-recovery"]);const i=s.schedule||["0 2 * * *"],o=J.findIndex(n=>JSON.stringify(n.value)===JSON.stringify(i));xe(o>=0?o:0);try{const n=await p("/api/self-improve/history");if(n.ok){const c=await n.json();ve(c.sessions||[])}}catch{}try{const n=await p("/api/training/runs");if(n.ok){const c=await n.json();we(c.runs||[])}}catch{}try{const[n,c]=await Promise.all([p("/api/autoresearch/results"),p("/api/autoresearch/performance")]);if(n.ok){const l=await n.json();Se(l.runs||[])}if(c.ok){const l=await c.json();ke(l)}}catch{}try{const[n,c]=await Promise.all([p("/api/autoresearch/results?type=agent"),p("/api/autoresearch/performance?type=agent")]);if(n.ok){const l=await n.json();$e(l.runs||[])}if(c.ok){const l=await c.json();De(l)}}catch{}}catch{}finally{Re(!1)}},[]);a.useEffect(()=>{y()},[y]),a.useEffect(()=>(N&&(L.current=setInterval(y,1e4)),()=>{L.current&&clearInterval(L.current)}),[N,y]),a.useEffect(()=>{const t=localStorage.getItem("titan-token")||localStorage.getItem("titan_token")||"",s=`/api/training/stream${t?`?token=${encodeURIComponent(t)}`:""}`,i=new EventSource(s);return ee.current=i,i.onopen=()=>_(!0),i.onerror=()=>_(!1),i.onmessage=o=>{try{const n=JSON.parse(o.data);if(n.type==="connected"){_(!0);return}Y(c=>{const l=[...c,n];return l.length>200?l.slice(-200):l})}catch{}},()=>{i.close(),ee.current=null,_(!1)}},[]),a.useEffect(()=>{O.current&&S&&O.current.scrollIntoView({behavior:"smooth"})},[g,S]);const Ee=a.useCallback(async()=>{try{await p("/api/training/progress",{method:"DELETE"}),Y([])}catch{}},[]),Le=async()=>{var t;try{await He({selfImprove:{runsPerDay:F,budgetMinutes:T,maxDailyBudgetMinutes:I,autoApply:M,pauseOnWeekends:$,areas:le,schedule:((t=J[ce])==null?void 0:t.value)||["0 2 * * *"]}}),m("success","Self-improvement settings saved"),await y()}catch(s){m("error",s instanceof Error?s.message:"Failed to save")}},de=async t=>{V(t);try{(await p("/api/message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:`Run a self-improvement experiment on ${t} using self_improve_start with area="${t}" and budgetMinutes=${T}`,sessionId:"self-improve"})})).ok?(m("success",`Self-improvement started for ${D[t]||t}`),setTimeout(y,2e3)):m("error","Failed to start self-improvement")}catch(s){m("error",s instanceof Error?s.message:"Failed to start")}finally{V(null)}},Oe=t=>{ie(s=>s.includes(t)?s.filter(i=>i!==t):[...s,t])},Fe=async()=>{K(!0);try{(await p("/api/autoresearch/generate-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:x})})).ok?m("success",`Training data generation started for ${x==="main_agent"?"Main Agent":"Tool Router"}`):m("error","Failed to start data generation")}catch(t){m("error",t instanceof Error?t.message:"Failed")}finally{K(!1)}},Ie=async()=>{Z(!0);try{(await p("/api/autoresearch/trigger",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:x,config:u})})).ok?m("success",`Training started for ${x==="main_agent"?"Main Agent":"Tool Router"}`):m("error","Failed to start training")}catch(t){m("error",t instanceof Error?t.message:"Failed")}finally{Z(!1)}},qe=async()=>{X(!0);try{(await p("/api/autoresearch/deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:x})})).ok?m("success",`Model deployed as ${x==="main_agent"?"titan-agent":"titan-qwen"}`):m("error","Failed to deploy model")}catch(t){m("error",t instanceof Error?t.message:"Failed")}finally{X(!1)}};if(Ce)return e.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((t,s)=>e.jsx("div",{className:"h-20 animate-pulse rounded-xl border border-border bg-bg-secondary"},s))});const w=f.length,oe=w>0?(f.reduce((t,s)=>t+(s.bestScore-s.baselineScore),0)/w).toFixed(1):"0",Qe=w>0?(f.filter(t=>t.bestScore>t.baselineScore).length/w*100).toFixed(0):"0";return e.jsxs("div",{className:"space-y-6",children:[e.jsx(Ke,{title:"Self-Improvement",subtitle:"Autonomous optimization of prompts, tool selection, and response quality",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Knowledge"},{label:"Self-Improve"}],actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>Te(!N),className:`flex items-center gap-1.5 rounded-lg border px-3 py-1.5 text-xs transition-colors ${N?"border-success/30 text-success bg-success/5":"border-border text-text-muted hover:bg-bg-tertiary"}`,children:[e.jsx(he,{className:`h-3.5 w-3.5 ${N?"animate-pulse":""}`}),N?"Live":"Paused"]}),e.jsxs("button",{onClick:y,className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary transition-colors hover:bg-bg-tertiary",children:[e.jsx(k,{className:"h-3.5 w-3.5"}),"Refresh"]})]})}),R&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${R.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[R.type==="success"?e.jsx(je,{className:"h-4 w-4"}):e.jsx(Pe,{className:"h-4 w-4"}),R.message]}),e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[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-1",children:[e.jsx(Ue,{className:"h-3.5 w-3.5 text-text-muted"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Total Sessions"})]}),e.jsx("p",{className:"text-2xl font-bold text-text",children:w+((r==null?void 0:r.totalRuns)||0)}),r&&r.totalRuns>0&&e.jsxs("p",{className:"text-[10px] text-text-muted mt-0.5",children:[w," self-improve + ",r.totalRuns," autoresearch"]})]}),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-1",children:[e.jsx(Ze,{className:"h-3.5 w-3.5 text-warning"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Best Val Score"})]}),e.jsx("p",{className:"text-2xl font-bold text-warning",children:(r==null?void 0:r.bestScore)||"—"}),r&&r.baseline>0&&(()=>{const t=r.bestScore-r.baseline,s=t>=0?"+":"",i=t>=0?"text-success":"text-error";return e.jsxs("p",{className:`text-[10px] mt-0.5 ${i}`,children:[s,t.toFixed(1)," from ",r.baseline," baseline"]})})()]}),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-1",children:[e.jsx(fe,{className:"h-3.5 w-3.5 text-success"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Success Rate"})]}),e.jsxs("p",{className:"text-2xl font-bold text-info",children:[Qe,"%"]}),e.jsxs("p",{className:"text-[10px] text-text-muted mt-0.5",children:["avg improvement: ",Number(oe)>=0?"+":"",oe]})]}),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-1",children:[e.jsx(Ve,{className:"h-3.5 w-3.5 text-purple"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Deployed Model"})]}),e.jsx("p",{className:"text-lg font-bold text-purple",children:"titan-qwen"}),e.jsxs("p",{className:"text-[10px] text-text-muted mt-0.5",children:["Q4_K_M • 19GB • ",(j==null?void 0:j.enabled)!==!1?"🟢 Active":"⚫ Off"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Model Training"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[e.jsxs("button",{onClick:()=>G("tool_router"),className:`rounded-xl border p-4 text-left transition-all ${x==="tool_router"?"border-purple bg-purple/5 ring-1 ring-purple/20":"border-bg-tertiary bg-bg-secondary hover:border-border"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-lg ${x==="tool_router"?"bg-purple/20":"bg-bg-tertiary"}`,children:e.jsx(We,{className:`h-3.5 w-3.5 ${x==="tool_router"?"text-purple-light":"text-text-muted"}`})}),e.jsx("span",{className:`text-sm font-medium ${x==="tool_router"?"text-text":"text-text-secondary"}`,children:"Tool Router"})]}),e.jsx("p",{className:"text-xs text-text-muted mb-1",children:"titan-qwen"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-success font-medium",children:["Score: ",(r==null?void 0:r.bestScore)||"—"]}),e.jsx("span",{className:"text-[10px] text-text-muted",children:"•"}),e.jsx("span",{className:"text-[10px] text-text-muted",children:h.length>0?`${((me=h[h.length-1])==null?void 0:me.num_examples)||0} examples`:"No data"})]}),e.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:"Brain / Tool Selection"})]}),e.jsxs("button",{onClick:()=>G("main_agent"),className:`rounded-xl border p-4 text-left transition-all ${x==="main_agent"?"border-purple bg-purple/5 ring-1 ring-purple/20":"border-bg-tertiary bg-bg-secondary hover:border-border"}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:`flex h-7 w-7 items-center justify-center rounded-lg ${x==="main_agent"?"bg-purple/20":"bg-bg-tertiary"}`,children:e.jsx(ze,{className:`h-3.5 w-3.5 ${x==="main_agent"?"text-purple-light":"text-text-muted"}`})}),e.jsx("span",{className:`text-sm font-medium ${x==="main_agent"?"text-text":"text-text-secondary"}`,children:"Main Agent"})]}),e.jsx("p",{className:"text-xs text-text-muted mb-1",children:"titan-agent"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-warning font-medium",children:["Score: ",(d==null?void 0:d.bestScore)||"—"]}),e.jsx("span",{className:"text-[10px] text-text-muted",children:"•"}),e.jsx("span",{className:"text-[10px] text-text-muted",children:b.length>0?`${((ue=b[b.length-1])==null?void 0:ue.num_examples)||0} examples`:"No data"})]}),e.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:"Primary LLM / Full Agent"})]})]}),e.jsxs("button",{onClick:()=>Me(!E),className:"flex w-full items-center gap-2 text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:[E?e.jsx(q,{className:"h-3.5 w-3.5"}):e.jsx(Q,{className:"h-3.5 w-3.5"}),e.jsx(be,{className:"h-3.5 w-3.5"}),"Training Configuration"]}),E&&e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5 space-y-4 mb-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Base Model"}),e.jsxs("select",{id:"train-base-model",name:"train-base-model",value:u.baseModel,onChange:t=>v(s=>({...s,baseModel:t.target.value})),className:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none",children:[e.jsx("option",{value:"unsloth/Qwen2.5-32B-bnb-4bit",children:"Qwen 2.5 32B (4-bit)"}),e.jsx("option",{value:"unsloth/Qwen2.5-14B-bnb-4bit",children:"Qwen 2.5 14B (4-bit)"}),e.jsx("option",{value:"unsloth/Qwen2.5-7B-bnb-4bit",children:"Qwen 2.5 7B (4-bit)"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"LoRA Rank"}),e.jsx("span",{className:"text-sm font-medium text-text",children:u.loraRank})]}),e.jsx("input",{id:"train-lora-rank",name:"train-lora-rank",type:"range",min:4,max:64,step:4,value:u.loraRank,onChange:t=>v(s=>({...s,loraRank:Number(t.target.value)})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"4"}),e.jsx("span",{children:"32"}),e.jsx("span",{children:"64"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Learning Rate"}),e.jsx("span",{className:"text-sm font-medium text-text font-mono",children:u.learningRate.toExponential(0)})]}),e.jsx("input",{id:"train-learning-rate",name:"train-learning-rate",type:"range",min:-5,max:-3,step:.5,value:Math.log10(u.learningRate),onChange:t=>v(s=>({...s,learningRate:Math.pow(10,Number(t.target.value))})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"1e-5"}),e.jsx("span",{children:"1e-4"}),e.jsx("span",{children:"1e-3"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Epochs"}),e.jsx("span",{className:"text-sm font-medium text-text",children:u.epochs})]}),e.jsx("input",{id:"train-epochs",name:"train-epochs",type:"range",min:1,max:10,value:u.epochs,onChange:t=>v(s=>({...s,epochs:Number(t.target.value)})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"5"}),e.jsx("span",{children:"10"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Time Budget"}),e.jsxs("span",{className:"text-sm font-medium text-text",children:[u.timeBudgetMin," min"]})]}),e.jsx("input",{id:"train-time-budget",name:"train-time-budget",type:"range",min:5,max:120,step:5,value:u.timeBudgetMin,onChange:t=>v(s=>({...s,timeBudgetMin:Number(t.target.value)})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"5 min"}),e.jsx("span",{children:"60 min"}),e.jsx("span",{children:"120 min"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Max Sequence Length"}),e.jsx("span",{className:"text-sm font-medium text-text",children:u.maxSeqLength})]}),e.jsx("input",{id:"train-max-seq-length",name:"train-max-seq-length",type:"range",min:512,max:4096,step:256,value:u.maxSeqLength,onChange:t=>v(s=>({...s,maxSeqLength:Number(t.target.value)})),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"512"}),e.jsx("span",{children:"2048"}),e.jsx("span",{children:"4096"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("button",{onClick:Fe,disabled:H,className:"flex items-center justify-center gap-2 rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 text-xs font-medium text-text transition-colors hover:border-purple/50 hover:bg-bg-secondary disabled:opacity-50",children:[H?e.jsx(k,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ge,{className:"h-3.5 w-3.5 text-warning"}),"Generate Training Data"]}),e.jsxs("button",{onClick:Ie,disabled:U,className:"flex items-center justify-center gap-2 rounded-xl bg-purple px-4 py-3 text-xs font-medium text-white transition-colors hover:bg-purple/80 disabled:opacity-50",children:[U?e.jsx(k,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ye,{className:"h-3.5 w-3.5"}),"Start Training"]}),e.jsxs("button",{onClick:qe,disabled:z,className:"flex items-center justify-center gap-2 rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 text-xs font-medium text-text transition-colors hover:border-success/50 hover:bg-bg-secondary disabled:opacity-50",children:[z?e.jsx(k,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(je,{className:"h-3.5 w-3.5 text-success"}),"Deploy Best Model"]}),e.jsxs("button",{onClick:()=>de(x==="main_agent"?"agent-benchmark":"tool-benchmark"),disabled:C!==null,className:"flex items-center justify-center gap-2 rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 text-xs font-medium text-text transition-colors hover:border-[#3b82f6]/50 hover:bg-bg-secondary disabled:opacity-50",children:[e.jsx(fe,{className:"h-3.5 w-3.5 text-info"}),"Run Benchmark"]})]})]}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>Ae(!S),className:"flex w-full items-center gap-2 text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:[S?e.jsx(q,{className:"h-3.5 w-3.5"}):e.jsx(Q,{className:"h-3.5 w-3.5"}),e.jsx(Xe,{className:"h-3.5 w-3.5"}),"Live Training Activity",e.jsxs("span",{className:"ml-auto flex items-center gap-1.5",children:[Be?e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-success",children:[e.jsx(Ye,{className:"h-3 w-3 animate-pulse"})," Connected"]}):e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-error",children:[e.jsx(Ge,{className:"h-3 w-3"})," Disconnected"]}),g.length>0&&e.jsx("span",{className:"rounded-full bg-purple/20 px-1.5 py-0.5 text-[10px] text-purple-light",children:g.length})]})]}),S&&e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg overflow-hidden",children:[g.length>0&&(()=>{var i,o,n;const t=[...g].reverse().find(c=>{var l;return((l=c.detail)==null?void 0:l.pct)!==void 0});if(!t||t.type==="complete")return null;const s=((i=t.detail)==null?void 0:i.pct)||0;return e.jsxs("div",{className:"border-b border-bg-tertiary px-4 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{className:"text-xs text-text-secondary",children:t.message}),e.jsxs("span",{className:"text-xs font-medium text-purple",children:[s,"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-bg-tertiary overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-purple to-accent transition-all duration-500",style:{width:`${s}%`}})}),((o=t.detail)==null?void 0:o.current)!==void 0&&((n=t.detail)==null?void 0:n.total)!==void 0&&e.jsxs("div",{className:"flex items-center justify-between mt-1",children:[e.jsxs("span",{className:"text-[10px] text-text-muted",children:[t.detail.current," / ",t.detail.total," examples"]}),t.detail.category&&e.jsxs("span",{className:"text-[10px] text-text-muted",children:["Category: ",t.detail.category]})]})]})})(),e.jsxs("div",{className:"max-h-64 overflow-y-auto p-3 font-mono text-[11px] leading-5 scrollbar-thin",children:[g.length===0?e.jsxs("div",{className:"flex items-center justify-center py-8 text-text-muted",children:[e.jsx(he,{className:"h-4 w-4 mr-2"}),e.jsx("span",{children:"No training activity yet. Start training to see live progress."})]}):g.map((t,s)=>{var pe;const i={info:"text-info",progress:"text-purple",success:"text-success",error:"text-error",complete:"text-warning",connected:"text-success"},o={info:"●",progress:"◆",success:"✓",error:"✗",complete:"★",connected:"◉"},n=i[t.type]||"text-text-muted",c=o[t.type]||"·",l=t.timestamp?new Date(t.timestamp).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):"";return e.jsxs("div",{className:"flex items-start gap-2 hover:bg-bg-secondary/50 rounded px-1",children:[e.jsx("span",{className:"text-border shrink-0 select-none",children:l}),e.jsx("span",{className:`shrink-0 ${n}`,children:c}),e.jsxs("span",{className:`${t.type==="error"?"text-error":"text-text-secondary"}`,children:[t.message,((pe=t.detail)==null?void 0:pe.category)&&t.type==="progress"&&e.jsxs("span",{className:"text-text-muted",children:[" [",t.detail.category,"]"]})]})]},s)}),e.jsx("div",{ref:O})]}),g.length>0&&e.jsxs("div",{className:"border-t border-bg-tertiary px-3 py-2 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] text-text-muted",children:[g.filter(t=>t.type==="success"||t.type==="progress").length," successes"," · ",g.filter(t=>t.type==="error").length," errors"]}),e.jsxs("button",{onClick:Ee,className:"flex items-center gap-1 text-[10px] text-text-muted hover:text-text-secondary transition-colors",children:[e.jsx(et,{className:"h-3 w-3"}),"Clear"]})]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Run Now"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(D).map(([t,s])=>e.jsxs("button",{onClick:()=>de(t),disabled:C!==null,className:"flex items-center gap-3 rounded-xl border border-bg-tertiary bg-bg-secondary p-4 text-left transition-colors hover:border-purple/50 hover:bg-bg-secondary disabled:opacity-50",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-purple/10",children:C===t?e.jsx(k,{className:"h-4 w-4 text-purple-light animate-spin"}):e.jsx(ye,{className:"h-4 w-4 text-purple-light"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text",children:s}),e.jsx("p",{className:"text-xs text-text-muted",children:C===t?"Running...":"Start experiment"})]})]},t))})]}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>_e(!B),className:"flex w-full items-center gap-2 text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:[B?e.jsx(q,{className:"h-3.5 w-3.5"}):e.jsx(Q,{className:"h-3.5 w-3.5"}),e.jsx(be,{className:"h-3.5 w-3.5"}),"Schedule Settings"]}),B&&e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-6 space-y-5",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Runs per day"}),e.jsx("span",{className:"text-sm font-medium text-text",children:F})]}),e.jsx("input",{id:"schedule-runs-per-day",name:"schedule-runs-per-day",type:"range",min:1,max:12,value:F,onChange:t=>te(Number(t.target.value)),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"1"}),e.jsx("span",{children:"6"}),e.jsx("span",{children:"12"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"Schedule"}),e.jsx("select",{id:"schedule-preset",name:"schedule-preset",value:ce,onChange:t=>xe(Number(t.target.value)),className:"w-full rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none",children:J.map((t,s)=>e.jsx("option",{value:s,children:t.label},s))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Budget per run (minutes)"}),e.jsxs("span",{className:"text-sm font-medium text-text",children:[T," min"]})]}),e.jsx("input",{id:"schedule-budget-minutes",name:"schedule-budget-minutes",type:"range",min:5,max:120,step:5,value:T,onChange:t=>se(Number(t.target.value)),className:"w-full accent-purple"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-text-muted mt-1",children:[e.jsx("span",{children:"5 min"}),e.jsx("span",{children:"60 min"}),e.jsx("span",{children:"120 min"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Max daily budget (minutes)"}),e.jsxs("span",{className:"text-sm font-medium text-text",children:[I," min"]})]}),e.jsx("input",{id:"schedule-max-daily-budget",name:"schedule-max-daily-budget",type:"range",min:30,max:480,step:30,value:I,onChange:t=>ae(Number(t.target.value)),className:"w-full accent-purple"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-xs text-text-muted",children:"Improvement areas"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(D).map(([t,s])=>e.jsx("button",{onClick:()=>Oe(t),className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${le.includes(t)?"bg-purple text-white":"bg-bg-tertiary text-text-muted hover:text-text-secondary"}`,children:s},t))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Auto-apply improvements"}),e.jsx("button",{onClick:()=>re(!M),className:`relative h-5 w-9 rounded-full transition-colors ${M?"bg-purple":"bg-border"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0.5 h-4 w-4 rounded-full bg-white transition-transform ${M?"translate-x-4":""}`})})]}),e.jsxs("label",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Pause on weekends"}),e.jsx("button",{onClick:()=>ne(!$),className:`relative h-5 w-9 rounded-full transition-colors ${$?"bg-purple":"bg-border"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0.5 h-4 w-4 rounded-full bg-white transition-transform ${$?"translate-x-4":""}`})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:Le,className:"flex items-center gap-2 rounded-lg bg-purple px-4 py-2 text-xs font-medium text-white transition-colors hover:bg-purple/80",children:"Save Settings"})})]})]}),f.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Session History"}),e.jsx("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary overflow-hidden",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-bg-tertiary",children:[e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Date"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Area"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Baseline"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Best"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"+Δ"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"K/D/C"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Status"})]})}),e.jsx("tbody",{children:f.slice().reverse().slice(0,10).map(t=>{const s=t.bestScore-t.baselineScore;return e.jsxs("tr",{className:"border-b border-bg-tertiary last:border-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-secondary",children:t.startedAt.slice(0,10)}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text",children:D[t.area]||t.area}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.baselineScore}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text font-medium",children:t.bestScore}),e.jsxs("td",{className:`px-4 py-2.5 text-xs font-medium ${s>0?"text-success":"text-text-muted"}`,children:[s>0?"+":"",s]}),e.jsxs("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:[t.keeps,"/",t.discards,"/",t.crashes]}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx(Ne,{status:t.applied?"deployed":t.status})})]},t.id)})})]})})]}),P.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Model Training"}),e.jsx("div",{className:"space-y-2",children:P.slice().reverse().slice(0,5).map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ge,{className:"h-4 w-4 text-warning"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-text",children:t.id}),e.jsxs("p",{className:"text-xs text-text-muted",children:[t.baseModel," • ",t.dataPoints," samples • ",t.method]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[t.finalLoss!==void 0&&e.jsxs("span",{className:"text-xs text-text-muted",children:["loss: ",t.finalLoss.toFixed(4)]}),e.jsx(Ne,{status:t.status})]})]},t.id))})]}),h.length>0&&x==="tool_router"&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Autoresearch Experiments — Tool Router"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-bg-tertiary",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Val Score Over Time"}),e.jsxs("span",{className:"text-xs text-success font-medium",children:["Best: ",(r==null?void 0:r.bestScore)||Math.max(...h.map(t=>t.val_score))]})]}),e.jsx("div",{className:"h-16 flex items-end gap-1",children:h.map((t,s)=>{const i=Math.max(...h.map(l=>l.val_score),100),o=Math.min(...h.map(l=>l.val_score),0),n=i-o||1,c=(t.val_score-o)/n*100;return e.jsx("div",{className:"flex-1 rounded-t transition-all hover:opacity-80",style:{height:`${Math.max(c,4)}%`,backgroundColor:(r==null?void 0:r.baseline)!=null?t.val_score>=r.baseline?"var(--color-success)":"var(--color-error)":"var(--color-purple)"},title:`Run ${s+1}: ${t.val_score} (${new Date(t.timestamp).toLocaleDateString()})`},s)})}),e.jsxs("div",{className:"relative mt-1",children:[e.jsx("div",{className:"border-t border-dashed border-border-light/50 absolute w-full"}),e.jsx("span",{className:"text-[9px] text-text-muted relative -top-2",children:(r==null?void 0:r.baseline)!=null?`baseline: ${r.baseline}`:"baseline: —"})]})]}),e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-bg-tertiary",children:[e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"#"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Date"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Score"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"LR"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Rank"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Epochs"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Examples"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Duration"})]})}),e.jsx("tbody",{children:h.slice().reverse().slice(0,20).map((t,s)=>e.jsxs("tr",{className:"border-b border-bg-tertiary last:border-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:h.length-s}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-secondary",children:new Date(t.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),e.jsx("td",{className:`px-4 py-2.5 text-xs font-bold ${t.val_score>=((r==null?void 0:r.baseline)||78)?"text-success":"text-error"}`,children:t.val_score}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted font-mono",children:t.hyperparams.lr}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.hyperparams.rank}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.hyperparams.epochs}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.num_examples}),e.jsxs("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:[Math.round(t.training_time_s/60),"m ",Math.round(t.training_time_s%60),"s"]})]},s))})]})]})]}),b.length>0&&x==="main_agent"&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Autoresearch Experiments — Main Agent"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-bg-tertiary",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Val Score Over Time"}),e.jsxs("span",{className:"text-xs text-warning font-medium",children:["Best: ",(d==null?void 0:d.bestScore)||Math.max(...b.map(t=>t.val_score))]})]}),e.jsx("div",{className:"h-16 flex items-end gap-1",children:b.map((t,s)=>{const i=Math.max(...b.map(l=>l.val_score),100),o=Math.min(...b.map(l=>l.val_score),0),n=i-o||1,c=(t.val_score-o)/n*100;return e.jsx("div",{className:"flex-1 rounded-t transition-all hover:opacity-80",style:{height:`${Math.max(c,4)}%`,backgroundColor:(d==null?void 0:d.baseline)!=null?t.val_score>=d.baseline?"var(--color-warning)":"var(--color-error)":"var(--color-purple)"},title:`Run ${s+1}: ${t.val_score} (${new Date(t.timestamp).toLocaleDateString()})`},s)})}),e.jsxs("div",{className:"relative mt-1",children:[e.jsx("div",{className:"border-t border-dashed border-border-light/50 absolute w-full"}),e.jsx("span",{className:"text-[9px] text-text-muted relative -top-2",children:(d==null?void 0:d.baseline)!=null?`baseline: ${d.baseline}`:"baseline: —"})]})]}),e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-bg-tertiary",children:[e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"#"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Date"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Score"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"LR"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Rank"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Epochs"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Examples"}),e.jsx("th",{className:"px-4 py-2.5 text-xs font-medium text-text-muted",children:"Duration"})]})}),e.jsx("tbody",{children:b.slice().reverse().slice(0,20).map((t,s)=>e.jsxs("tr",{className:"border-b border-bg-tertiary last:border-0",children:[e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:b.length-s}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-secondary",children:new Date(t.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),e.jsx("td",{className:`px-4 py-2.5 text-xs font-bold ${t.val_score>=((d==null?void 0:d.baseline)||70)?"text-warning":"text-error"}`,children:t.val_score}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted font-mono",children:t.hyperparams.lr}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.hyperparams.rank}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.hyperparams.epochs}),e.jsx("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:t.num_examples}),e.jsxs("td",{className:"px-4 py-2.5 text-xs text-text-muted",children:[Math.round(t.training_time_s/60),"m ",Math.round(t.training_time_s%60),"s"]})]},s))})]})]})]})]})}export{pt as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as i,b as m,j as t,K as E,l as v,k as h}from"./index-CUgepw5Q.js";import{P as g}from"./PageHeader-bnc85wQN.js";import{G as I}from"./TitanCanvas-TuYZSZO7.js";import{C as f}from"./clock-CF9BCIpL.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"./book-open-DIxdPqmD.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"./archive-gZFnGd5A.js";import"./radio-B7kX_yWE.js";import"./test-tube-Xfn9DJeg.js";import"./VoiceOverlay-B_ss7Zg_.js";import"./volume-2-DMaE91b5.js";import"./refresh-cw-CwDpzXUn.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";const M={captured:{label:"Captured",color:"text-blue-400",icon:f},review_pending:{label:"Reviewing",color:"text-amber-400",icon:f},approved:{label:"Approved — ready for PR",color:"text-emerald-400",icon:h},rejected:{label:"Rejected",color:"text-rose-400",icon:v},pr_open:{label:"PR open — awaiting merge",color:"text-purple-400",icon:I},merged:{label:"Merged ✓",color:"text-emerald-500",icon:h},closed_unmerged:{label:"Closed unmerged",color:"text-slate-400",icon:v},error:{label:"Error",color:"text-rose-500",icon:E}};function be(){const[x,p]=i.useState([]),[j,u]=i.useState(!0),[y,N]=i.useState(!1),[w,P]=i.useState(null),[n,o]=i.useState(null),[b,S]=i.useState({}),l=i.useCallback(async()=>{try{const e=await m("/api/self-proposals");if(e.status===404){N(!0),u(!1);return}const s=await e.json();p(s.proposals||[])}catch{p([])}finally{u(!1)}},[]);i.useEffect(()=>{l();const e=setInterval(l,15e3);return()=>clearInterval(e)},[l]);const R=async(e,s)=>{var a;if(!((a=b[e])!=null&&a[s]))try{const d=await m(`/api/self-proposals/${e}/files/${s}`);if(!d.ok)return;const r=await d.text();S(c=>({...c,[e]:{...c[e]||{},[s]:r}}))}catch{}},C=async e=>{o(e);try{await m(`/api/self-proposals/${e}/review`,{method:"POST"}),await l()}finally{o(null)}},T=async e=>{o(e);try{const a=await(await m(`/api/self-proposals/${e}/open-pr`,{method:"POST"})).json();a.prUrl?window.open(a.prUrl,"_blank"):a.errorMessage?alert("PR creation failed: "+a.errorMessage):a.bundlePath&&alert(`No git checkout — bundle exported to:
|
|
2
|
-
`+a.bundlePath),await l()}finally{o(null)}},k=async e=>{if(window.confirm("Dismiss this self-proposal? This marks it rejected and prevents PR creation.")){o(e);try{await m(`/api/self-proposals/${e}/dismiss`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:"dismissed by user from UI"})}),await l()}finally{o(null)}}};return y?t.jsxs("div",{className:"space-y-6",children:[t.jsx(g,{title:"Self-Proposals",subtitle:"Autonomous outputs captured for human-gated merge",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Agent"}]}),t.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-6",children:[t.jsx("p",{className:"text-[var(--text)] font-medium mb-2",children:"Self-Modification is off."}),t.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Enable by setting ",t.jsx("code",{className:"bg-[var(--bg-tertiary)] px-1 rounded",children:"selfMod.enabled: true"})," in ",t.jsx("code",{className:"bg-[var(--bg-tertiary)] px-1 rounded",children:"titan.json"}),". When on, autonomous writes from Soma-driven goals are captured, reviewed by the specialist panel, and proposed as GitHub PRs for your merge."]})]})]}):j?t.jsx("div",{className:"text-[var(--text-muted)]",children:"Loading self-proposals..."}):t.jsxs("div",{className:"space-y-6",children:[t.jsx(g,{title:"Self-Proposals",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Agent"},{label:"Self-Proposals"}]}),t.jsx("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:t.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"TITAN autonomously wrote these outputs while working on Soma-driven goals. Its specialist panel (Analyst, Builder, Writer) reviews each for safety + utility. You are the final merge gate — no PR is ever merged without your click on GitHub."})}),x.length===0?t.jsx("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-6 text-center",children:t.jsx("p",{className:"text-[var(--text-muted)]",children:"No self-proposals yet. They appear here when TITAN writes code under an autonomous Soma-driven session."})}):t.jsx("div",{className:"space-y-3",children:x.map(e=>{const s=M[e.status],a=s.icon,d=w===e.id;return t.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg overflow-hidden",children:[t.jsx("button",{className:"w-full p-4 text-left hover:bg-[var(--bg-tertiary)]",onClick:()=>P(d?null:e.id),children:t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx(a,{className:`w-4 h-4 ${s.color}`}),t.jsx("span",{className:`text-xs font-medium ${s.color}`,children:s.label}),e.drive&&t.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--bg-tertiary)] text-[var(--text-muted)]",children:["drive: ",e.drive]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:[e.files.length," file",e.files.length===1?"":"s"]})]}),t.jsx("p",{className:"text-sm font-medium text-[var(--text)] truncate",children:e.title}),e.goalTitle&&t.jsxs("p",{className:"text-xs text-[var(--text-muted)] mt-1 truncate",children:["Goal: ",e.goalTitle]})]}),t.jsx("div",{className:"text-xs text-[var(--text-muted)] whitespace-nowrap",children:new Date(e.createdAt).toLocaleString()})]})}),d&&t.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-[var(--border)]",children:[e.rejectionReason&&t.jsxs("div",{className:"mt-3 p-3 bg-rose-500/10 border border-rose-500/30 rounded text-sm",children:[t.jsx("p",{className:"font-medium text-rose-400 mb-1",children:"Rejection"}),t.jsx("p",{className:"text-[var(--text)]",children:e.rejectionReason})]}),e.errorMessage&&t.jsxs("div",{className:"mt-3 p-3 bg-amber-500/10 border border-amber-500/30 rounded text-sm",children:[t.jsx("p",{className:"font-medium text-amber-400 mb-1",children:"Error"}),t.jsx("p",{className:"text-[var(--text)]",children:e.errorMessage})]}),e.verdicts.length>0&&t.jsxs("div",{className:"mt-3",children:[t.jsx("p",{className:"text-xs font-medium text-[var(--text-muted)] mb-2",children:"Specialist verdicts"}),t.jsx("div",{className:"space-y-2",children:e.verdicts.map(r=>t.jsxs("div",{className:"p-2 bg-[var(--bg-tertiary)] rounded text-xs",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:"font-semibold text-[var(--text)] capitalize",children:r.specialistId}),t.jsx("span",{className:r.vote==="approve"?"text-emerald-400":r.vote==="reject"?"text-rose-400":"text-amber-400",children:r.vote})]}),t.jsx("p",{className:"text-[var(--text-muted)]",children:r.rationale})]},r.specialistId))})]}),e.files.length>0&&t.jsxs("div",{className:"mt-3",children:[t.jsx("p",{className:"text-xs font-medium text-[var(--text-muted)] mb-2",children:"Captured files"}),t.jsx("div",{className:"space-y-2",children:e.files.map(r=>{var c;return t.jsxs("details",{className:"bg-[var(--bg-tertiary)] rounded",onToggle:A=>{A.target.open&&R(e.id,r.capturedPath)},children:[t.jsxs("summary",{className:"p-2 cursor-pointer text-xs text-[var(--text)]",children:[t.jsx("code",{children:r.capturedPath}),t.jsxs("span",{className:"text-[var(--text-muted)] ml-2",children:["(",r.lineCount," lines, ",r.size," bytes)"]})]}),t.jsx("pre",{className:"p-3 text-xs overflow-x-auto max-h-96 bg-[var(--bg-primary)] text-[var(--text)]",children:((c=b[e.id])==null?void 0:c[r.capturedPath])??"Loading..."})]},r.capturedPath)})})]}),t.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[e.status==="captured"&&t.jsx("button",{onClick:()=>C(e.id),disabled:n===e.id,className:"px-3 py-1.5 text-xs bg-blue-600 hover:bg-blue-500 disabled:opacity-50 text-white rounded",children:n===e.id?"Reviewing...":"Run specialist review"}),e.status==="approved"&&t.jsx("button",{onClick:()=>T(e.id),disabled:n===e.id,className:"px-3 py-1.5 text-xs bg-purple-600 hover:bg-purple-500 disabled:opacity-50 text-white rounded",children:n===e.id?"Opening PR...":"Open GitHub PR"}),e.prUrl&&t.jsxs("a",{href:e.prUrl,target:"_blank",rel:"noopener noreferrer",className:"px-3 py-1.5 text-xs bg-[var(--bg-tertiary)] hover:bg-[var(--bg-primary)] text-[var(--text)] rounded border border-[var(--border)]",children:["View PR #",e.prNumber??""]}),(e.status==="captured"||e.status==="review_pending"||e.status==="approved")&&t.jsx("button",{onClick:()=>k(e.id),disabled:n===e.id,className:"px-3 py-1.5 text-xs bg-[var(--bg-tertiary)] hover:bg-rose-600 hover:text-white disabled:opacity-50 text-[var(--text-muted)] rounded border border-[var(--border)]",children:"Dismiss"})]})]})]},e.id)})})]})}export{be as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,j as s,X as k,bx as C,by as M,bz as L,bA as E}from"./index-CUgepw5Q.js";import{P as D}from"./PageHeader-bnc85wQN.js";import"./Input-CbrMbLgn.js";import{D as A}from"./DataTable-PnhPeDBG.js";import{I as P}from"./InlineEditableField-mBzpbcLB.js";import{S as F}from"./search-BP7VlNxX.js";import{T as I}from"./trash-2-B1C85ePK.js";import"./chevron-right-CQ1NTOtd.js";import"./clsx-B-dksMZM.js";import"./check-DgyDEFtq.js";import"./pencil-D_YwQBeg.js";function J(){const[p,b]=a.useState([]),[g,f]=a.useState(!0),[c,n]=a.useState(null),[o,y]=a.useState(""),[l,i]=a.useState(null),[m,r]=a.useState([]),[j,x]=a.useState(!1),d=async()=>{try{const e=await C();b(e),n(null)}catch(e){n(e instanceof Error?e.message:"Failed to fetch sessions")}finally{f(!1)}};a.useEffect(()=>{d()},[]);const N=async e=>{i(e.id),x(!0);try{const t=await M(e.id);r(t)}catch{r([])}finally{x(!1)}},w=async e=>{try{await E(e),l===e&&(i(null),r([])),await d()}catch(t){n(t instanceof Error?t.message:"Failed to delete session")}},S=p.filter(e=>{var u,h;if(!o)return!0;const t=o.toLowerCase();return e.id.toLowerCase().includes(t)||((u=e.name)==null?void 0:u.toLowerCase().includes(t))||((h=e.lastMessage)==null?void 0:h.toLowerCase().includes(t))}),v=[{key:"id",header:"ID",render:e=>s.jsxs("span",{className:"font-mono text-xs",children:[e.id.slice(0,12),"..."]})},{key:"name",header:"Name",render:e=>s.jsx("span",{className:"text-sm text-text",children:s.jsx(P,{value:e.name??"",onSave:async t=>{await L(e.id,t),await d()},placeholder:"Session name",emptyLabel:"Untitled",hidePencil:!0})})},{key:"messageCount",header:"Messages"},{key:"lastMessage",header:"Last Message",render:e=>s.jsx("span",{className:"block max-w-xs truncate text-text-secondary",children:e.lastMessage??"-"})},{key:"createdAt",header:"Created",render:e=>s.jsx("span",{children:new Date(e.createdAt).toLocaleString()})},{key:"_actions",header:"",className:"w-16",render:e=>s.jsx("button",{onClick:t=>{t.stopPropagation(),w(e.id)},className:"rounded-md p-1.5 text-error transition-colors hover:bg-bg-tertiary",title:"Delete session",children:s.jsx(I,{className:"h-4 w-4"})})}];return g?s.jsx("div",{className:"h-64 animate-pulse rounded-xl border border-border bg-bg-secondary"}):s.jsxs("div",{className:"flex gap-4",children:[s.jsxs("div",{className:`space-y-4 ${l?"flex-1":"w-full"}`,children:[s.jsx(D,{title:"Sessions",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Monitoring"},{label:"Sessions"}]}),s.jsxs("div",{className:"relative",children:[s.jsx(F,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-muted"}),s.jsx("input",{value:o,onChange:e=>y(e.target.value),placeholder:"Search sessions...",className:"w-full rounded-lg border border-border bg-bg py-2 pl-10 pr-3 text-sm text-text outline-none focus:border-accent"})]}),c&&s.jsx("div",{className:"rounded-lg border border-error/50 bg-bg-secondary px-4 py-2 text-sm text-error",children:c}),s.jsx(A,{columns:v,data:S,onRowClick:N,emptyMessage:"No sessions found"})]}),l&&s.jsxs("div",{className:"w-96 shrink-0 rounded-xl border border-border bg-bg-secondary",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[s.jsx("h3",{className:"text-sm font-medium text-text",children:"Messages"}),s.jsx("button",{onClick:()=>{i(null),r([])},className:"rounded-md p-1 text-text-muted hover:text-text",children:s.jsx(k,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"max-h-[600px] overflow-y-auto p-4",children:j?s.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((e,t)=>s.jsx("div",{className:"h-12 animate-pulse rounded-lg bg-bg-tertiary"},t))}):m.length===0?s.jsx("p",{className:"text-center text-sm text-text-muted",children:"No messages"}):s.jsx("div",{className:"space-y-3",children:m.map((e,t)=>s.jsxs("div",{className:`rounded-lg p-3 text-sm ${e.role==="user"?"bg-accent/10 text-text":e.role==="assistant"?"bg-bg-tertiary text-text":"bg-bg text-text-secondary"}`,children:[s.jsx("span",{className:"mb-1 block text-xs font-medium uppercase text-text-muted",children:e.role}),s.jsx("p",{className:"whitespace-pre-wrap",children:e.content})]},t))})})]})]})}export{J as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as e,b as j,X as A}from"./index-CUgepw5Q.js";import{A as E,m as v}from"./proxy-CWET5FFX.js";const C=["initiative","deliberation","autopilot","agent-","company-","swarm","subagent","plan-"],S=["webchat","messenger-admin","messenger","twilio-admin","twilio","livekit","api"];function p(s){return C.some(a=>s===a||s.startsWith(a))}function g(s){return S.some(a=>s===a||s.startsWith(a))}function F(){const[s,a]=c.useState([]),[o,x]=c.useState(!0),[l,m]=c.useState("internal"),[u,n]=c.useState(null);c.useEffect(()=>{let t=!0;const i=async()=>{try{const h=await j("/api/sessions");if(!h.ok)return;const b=await h.json();if(!t)return;a(Array.isArray(b)?b:[]),x(!1)}catch{}};i();const r=setInterval(i,15e3);return()=>{t=!1,clearInterval(r)}},[]);const d=c.useMemo(()=>{let t=s;return l==="internal"?t=t.filter(i=>p(i.channel)):l==="user"?t=t.filter(i=>g(i.channel)):l!=="all"&&(t=t.filter(i=>i.channel===l)),t.sort((i,r)=>(r.lastActive||"").localeCompare(i.lastActive||""))},[s,l]),w=c.useMemo(()=>{const t=new Map;for(const i of d){const r=t.get(i.channel)||[];r.push(i),t.set(i.channel,r)}return[...t.entries()].sort((i,r)=>i[0].localeCompare(r[0]))},[d]),y=s.filter(t=>p(t.channel)).length,k=s.filter(t=>g(t.channel)).length;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] text-text-muted mb-2",children:"Internal sessions are TITAN's background thought-trains: autopilot runs, deliberation plans, sub-agent delegations. You wouldn't normally see these in chat."}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsxs(f,{active:l==="internal",onClick:()=>m("internal"),children:["Internal ",e.jsxs("span",{className:"text-text-muted ml-1",children:["(",y,")"]})]}),e.jsxs(f,{active:l==="user",onClick:()=>m("user"),children:["User chats ",e.jsxs("span",{className:"text-text-muted ml-1",children:["(",k,")"]})]}),e.jsxs(f,{active:l==="all",onClick:()=>m("all"),children:["All ",e.jsxs("span",{className:"text-text-muted ml-1",children:["(",s.length,")"]})]})]})]}),o?e.jsx("div",{className:"p-6 text-center text-[12px] text-text-muted",children:"Loading sessions…"}):d.length===0?e.jsx("div",{className:"p-8 text-center text-[12px] text-text-muted bg-bg-secondary/50 border border-border rounded-xl",children:"No sessions in this filter."}):e.jsx("div",{className:"space-y-4",children:w.map(([t,i])=>e.jsxs("div",{className:"bg-bg-secondary/50 border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2.5 flex items-center justify-between border-b border-border/50",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[12px] text-text-secondary font-medium",children:t}),e.jsx("span",{className:"text-[10px] text-text-muted",children:i.length})]}),e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:p(t)?"internal":g(t)?"user":"other"})]}),e.jsxs("div",{className:"divide-y divide-border/30",children:[i.slice(0,8).map(r=>{var h;return e.jsxs("div",{onClick:()=>n(r),className:"px-4 py-2.5 flex items-start gap-3 hover:bg-bg-tertiary/30 cursor-pointer",children:[e.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-1.5 flex-shrink-0 ${r.status==="active"?"bg-emerald-400":"bg-white/20"}`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[12px] text-text truncate",children:r.name||((h=r.lastMessage)==null?void 0:h.slice(0,80))||"(untitled)"}),e.jsxs("div",{className:"text-[10px] text-white/35 mt-0.5",children:[r.messageCount," msg · ",N(r.lastActive)," · ",r.userId]})]})]},r.id)}),i.length>8&&e.jsxs("div",{className:"px-4 py-2 text-[10px] text-text-muted italic",children:["+ ",i.length-8," more ",t," session",i.length-8===1?"":"s"]})]})]},t))}),e.jsx(I,{open:u!==null,session:u,onClose:()=>n(null)})]})}function f({active:s,onClick:a,children:o}){return e.jsx("button",{onClick:a,className:`px-3 py-1 text-[11px] rounded-lg transition-colors ${s?"bg-indigo-600 text-white":"bg-bg-tertiary text-text-muted hover:text-text"}`,children:o})}function I({open:s,session:a,onClose:o}){const[x,l]=c.useState([]),[m,u]=c.useState(!1);return c.useEffect(()=>{if(!s||!a){l([]);return}u(!0),j(`/api/sessions/${a.id}`).then(n=>n.ok?n.json():null).then(n=>{const d=Array.isArray(n)?n:(n==null?void 0:n.messages)||[];l(d)}).catch(()=>{}).finally(()=>u(!1))},[s,a]),c.useEffect(()=>{if(!s)return;const n=d=>{d.key==="Escape"&&o()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[s,o]),e.jsx(E,{children:s&&a&&e.jsxs(e.Fragment,{children:[e.jsx(v.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.18},onClick:o,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",zIndex:99}},"backdrop"),e.jsxs(v.aside,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{duration:.28,ease:[.32,.72,0,1]},style:{position:"fixed",top:0,right:0,bottom:0,width:"min(600px, 100vw)",background:"rgba(10, 12, 20, 0.96)",backdropFilter:"blur(24px)",borderLeft:"1px solid rgba(167, 139, 250, 0.15)",zIndex:100,display:"flex",flexDirection:"column",boxShadow:"-20px 0 60px rgba(0,0,0,0.5)"},children:[e.jsxs("div",{className:"px-6 py-4 border-b border-border flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-wider text-text-muted font-semibold mb-1",children:a.channel}),e.jsx("div",{className:"text-[16px] font-semibold text-white/95 truncate",children:a.name||"(untitled session)"}),e.jsxs("div",{className:"text-[11px] text-white/35 mt-1",children:[a.messageCount," messages · ",N(a.lastActive)]})]}),e.jsx("button",{onClick:o,className:"text-white/55 hover:text-text p-1.5 rounded","aria-label":"Close",children:e.jsx(A,{size:18})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-3",children:[m&&e.jsx("div",{className:"text-[12px] text-white/35",children:"Loading transcript…"}),!m&&x.length===0&&e.jsx("div",{className:"text-[12px] text-white/35 italic",children:"No messages."}),x.map((n,d)=>e.jsxs("div",{className:`p-3 rounded-lg border-l-2 ${n.role==="assistant"?"bg-purple-500/[0.03] border-purple-400/50":n.role==="user"?"bg-bg-tertiary/30 border-white/20":"bg-bg-secondary/50 border-white/10"}`,children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-text-muted font-semibold mb-1",children:n.role}),e.jsxs("div",{className:"text-[12px] text-white/85 whitespace-pre-wrap leading-relaxed",style:{wordBreak:"break-word"},children:[(n.content||"").slice(0,2e3),(n.content||"").length>2e3&&e.jsx("span",{className:"text-text-muted",children:"… (truncated)"})]})]},d))]})]},"panel")]})})}function N(s){if(!s)return"";const a=Date.parse(s);if(isNaN(a))return"";const o=Math.max(0,Math.floor((Date.now()-a)/1e3));if(o<60)return`${o}s ago`;const x=Math.floor(o/60);if(x<60)return`${x}m ago`;const l=Math.floor(x/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}export{C as INTERNAL_CHANNEL_PREFIXES,S as USER_CHANNEL_PREFIXES,F as default,p as isInternalChannel,g as isUserChannel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,j as e,b as _,aB as we,i as ee,m as Ne,L as te,a8 as se,aC as Se,aD as ke,aE as Ce,aF as Ve,t as Ee,aG as Te,aH as ae,aI as Le,aJ as Ue,a9 as Pe}from"./index-CUgepw5Q.js";import"./Input-CbrMbLgn.js";import{P as re}from"./PageHeader-bnc85wQN.js";import{H as ce}from"./Tooltip-B1LhTXJ8.js";import{C as Ae}from"./circle-check-big-CAFcaPPH.js";import{M as B}from"./mic-Ddcc6Ann.js";import{R as Ie}from"./refresh-cw-CwDpzXUn.js";import{W as Me}from"./wifi-off-DR9h8HGA.js";import{D as Fe}from"./download-BBNXvBO0.js";import{P as $e}from"./play-BjdwtYMk.js";import{S as Re}from"./save-CjTPAQM0.js";import"./clsx-B-dksMZM.js";import"./chevron-right-CQ1NTOtd.js";const oe=[{id:"oak",label:"Oak",swatch:"linear-gradient(135deg, #6e4724, #482a13)"},{id:"walnut",label:"Walnut",swatch:"linear-gradient(135deg, #4a2e18, #2a1808)"},{id:"mahogany",label:"Mahogany",swatch:"linear-gradient(135deg, #5e2a1a, #38160c)"},{id:"white",label:"White",swatch:"linear-gradient(135deg, #f4f1ea, #ddd9ce)"}],H="titan-desk-theme";function Oe(){try{const r=localStorage.getItem(H);if(r==="oak"||r==="walnut"||r==="mahogany"||r==="white")return r}catch{}return"oak"}function De(r){try{localStorage.setItem(H,r)}catch{}}function _e({className:r}){const[f,p]=a.useState(Oe);a.useEffect(()=>{const n=h=>{if(h.key===H&&h.newValue){const x=h.newValue;oe.some(j=>j.id===x)&&p(x)}};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)},[]);const C=a.useCallback(n=>{p(n),De(n),window.dispatchEvent(new CustomEvent("desk-theme",{detail:n}))},[]);return e.jsxs("div",{className:`flex items-center gap-2 ${r??""}`,children:[e.jsx("span",{className:"text-[10px] uppercase tracking-widest text-[#a89070]",children:"Desk"}),oe.map(n=>e.jsx("button",{type:"button",onClick:()=>C(n.id),title:n.label,className:`w-5 h-5 rounded-full border-2 transition-transform hover:scale-110 ${f===n.id?"border-[#c4a35a] scale-110":"border-transparent"}`,style:{background:n.swatch}},n.id))]})}const F=["ollama","lmstudio","localai"];function Be({ok:r}){return r?e.jsx("div",{className:"h-2 w-2 rounded-full bg-success shadow-[0_0_6px_rgba(34,197,94,0.4)]"}):e.jsx("div",{className:"h-2 w-2 rounded-full bg-border-light"})}function He({models:r,selectedModel:f,onSelect:p,onSwitch:C,currentModel:n}){const h=n.includes("/")?n.split("/")[0]:"",[x,j]=a.useState(h);a.useEffect(()=>{j(h)},[h]);const b=a.useMemo(()=>[...new Set(r.map(i=>i.provider))].sort((i,m)=>{const l=F.includes(i.toLowerCase()),k=F.includes(m.toLowerCase());return l&&!k?-1:!l&&k?1:i.localeCompare(m)}),[r]),S=a.useMemo(()=>r.filter(o=>o.provider===x),[r,x]),U=o=>{j(o);const i=r.filter(l=>l.provider===o),m=i.find(l=>l.id===n);m?p(m.id):i.length>0&&p(i[0].id)},$=f!==n,y=F.includes(x.toLowerCase());return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx("label",{className:"text-xs text-text-muted",children:"Provider"}),e.jsx(ce,{title:"AI Provider",description:"The company or service that hosts the AI model. Local providers (Ollama, LM Studio) run on your machine. Cloud providers (Anthropic, OpenAI) run remotely and require an API key."})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[e.jsx("select",{value:x,onChange:o=>U(o.target.value),className:"w-full rounded-lg border border-border bg-bg px-3 py-2.5 text-sm text-text outline-none transition-colors focus:border-accent min-h-[44px]",children:b.map(o=>{const i=F.includes(o.toLowerCase()),m=r.filter(l=>l.provider===o).length;return e.jsxs("option",{value:o,children:[i?`💻 ${o} (local)`:o," — ",m," model",m!==1?"s":""]},o)})}),y&&e.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap rounded bg-success/15 px-2 py-1 text-xs font-medium text-success self-start mt-0.5 sm:self-auto sm:mt-0",children:[e.jsx(ke,{className:"h-3 w-3"})," Local"]}),!y&&x&&e.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap rounded bg-accent/15 px-2 py-1 text-xs font-medium text-accent-hover self-start mt-0.5 sm:self-auto sm:mt-0",children:[e.jsx(Ce,{className:"h-3 w-3"})," Cloud"]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx("label",{className:"text-xs text-text-muted",children:"Model"}),e.jsx(ce,{title:"Model Selection",description:"The specific AI model TITAN uses to think and respond. Larger models are smarter but slower and cost more. You can switch anytime without losing conversation history."})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-2 md:gap-3",children:[e.jsxs("select",{value:f,onChange:o=>p(o.target.value),className:"w-full rounded-lg border border-border bg-bg px-3 py-2.5 text-sm text-text outline-none transition-colors focus:border-accent min-h-[44px]",children:[S.map(o=>e.jsxs("option",{value:o.id,disabled:!o.available,children:[o.name,o.id===n?" (active)":"",o.available?"":" — unavailable"]},o.id)),S.length===0&&e.jsx("option",{disabled:!0,children:"No models for this provider"})]}),e.jsx("button",{onClick:C,disabled:!$,className:"rounded-lg bg-accent px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50 min-h-[44px] w-full sm:w-auto active:scale-[0.98]",children:"Switch"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-bg px-3 py-2.5",children:[e.jsx("div",{className:"h-2 w-2 rounded-full bg-success animate-pulse flex-shrink-0"}),e.jsx("span",{className:"text-xs text-text-muted",children:"Active:"}),e.jsx("span",{className:"text-xs text-text-secondary font-mono overflow-x-auto scrollbar-thin",children:n||"None"})]})]})}function mt(){var X,Y,J;const[r,f]=a.useState(null),[p,C]=a.useState([]),[n,h]=a.useState(!0),[x,j]=a.useState(!1),[b,S]=a.useState(""),[U,$]=a.useState(null),[y,o]=a.useState(null),[i,m]=a.useState(!1),[l,k]=a.useState(""),[V,E]=a.useState("andrew"),[w,W]=a.useState("f5-tts"),[ne,q]=a.useState("http://localhost:5006"),[ie,T]=a.useState(["andrew"]),[We,qe]=a.useState(null),[Ke,ze]=a.useState(!1),[Ge,Qe]=a.useState(""),P=[{id:"f5-tts",name:"F5-TTS",desc:"Voice cloning with MLX (Apple Silicon)",defaultUrl:"http://localhost:5006",defaultVoices:["andrew"]}],[Xe,le]=a.useState(null),[de,Ye]=a.useState(!1),[xe,Je]=a.useState(""),[K,R]=a.useState([]),[z,G]=a.useState(!1),[v,me]=a.useState(null),[L,ue]=a.useState(null),[O,Q]=a.useState(!1),A=t=>{var s;return((s=t==null?void 0:t.agent)==null?void 0:s.model)??(t==null?void 0:t.model)??""};a.useEffect(()=>{(async()=>{try{const[s,c]=await Promise.all([se(),Se()]);f(s),C(c),S(A(s));const d=(s==null?void 0:s.voice)??{};m(d.enabled??!1),k(d.livekitUrl??""),E(d.ttsVoice??"andrew"),W(d.ttsEngine??"f5-tts"),q(d.ttsUrl??"http://localhost:5006")}catch(s){const c=s instanceof Error?s.message:"Failed to load config";$(c),u("error",c)}finally{h(!1)}})()},[]),a.useEffect(()=>{(async()=>{var t;try{const s=await _("/api/voice/voices");if(s.ok){const c=await s.json();(t=c.voices)!=null&&t.length&&T(c.voices)}}catch{}})()},[]);const D=async()=>{Q(!0);try{const[t,s]=await Promise.allSettled([_("/api/voice/health").then(c=>c.json()),_("/api/voice/status").then(c=>c.json())]);t.status==="fulfilled"&&me(t.value),s.status==="fulfilled"&&(ue(s.value),s.value.livekitUrl&&!l&&k(s.value.livekitUrl))}catch{}Q(!1)};a.useEffect(()=>{n||D()},[n]),a.useEffect(()=>{i&&we().then(t=>{var s;le({installed:t.installed,running:t.running,voices:t.voices}),R(t.voices.map(c=>({name:c,hasTranscript:!1,sizeBytes:0}))),(s=t.voices)!=null&&s.length&&T(["andrew",...t.voices])}).catch(()=>{})},[i]);const pe=async()=>{const t=document.createElement("input");t.type="file",t.accept="audio/wav,audio/mp3,audio/mpeg,audio/flac,.wav,.mp3,.flac",t.onchange=async()=>{var g;const s=(g=t.files)==null?void 0:g[0];if(!s)return;const c=prompt('Name this voice (e.g., "robin", "jarvis"):',s.name.replace(/\.[^.]+$/,""));if(!c)return;const d=prompt("(Optional) Transcript of the audio — improves cloning quality:","")||"";G(!0);try{const N=await s.arrayBuffer(),I=btoa(String.fromCharCode(...new Uint8Array(N))),M=await Te(c,I,d),je=M!=null&&M.duration?` Duration: ${M.duration}s,`:"";u("success",`Voice "${c}" uploaded!${je} preprocessed and normalized.`);const Z=await ae();R(Z.voices||[]),T(["default",...Z.voices.map(ye=>ye.name)]),E(c)}catch(N){u("error",N instanceof Error?N.message:"Failed to upload voice")}finally{G(!1)}},t.click()},he=async t=>{try{u("success",`Generating preview for "${t}"...`);const s=["Hello, how can I help you today?","I am ready to assist you with anything you need.","Good morning. It is a pleasure to be of service."],c=s[Math.floor(Math.random()*s.length)],d=await Le(t,c),g=new Blob([d],{type:"audio/wav"}),N=URL.createObjectURL(g),I=new Audio(N);I.onended=()=>URL.revokeObjectURL(N),I.play()}catch(s){u("error",s instanceof Error?s.message:"Failed to preview voice")}},be=async t=>{if(confirm(`Delete voice "${t}"?`))try{await Ue(t);const s=await ae();R(s.voices||[]),T(["andrew",...s.voices.map(c=>c.name)]),V===t&&E("default"),u("success",`Voice "${t}" deleted`)}catch(s){u("error",s instanceof Error?s.message:"Failed to delete voice")}},u=(t,s)=>{o({type:t,message:s}),setTimeout(()=>o(null),3e3)},ge=async()=>{if(!(!b||b===A(r??{})))try{const t=p.find(c=>c.id===b);await Ve(b,t==null?void 0:t.provider),Ee("model_switched",{model:b,provider:t==null?void 0:t.provider});const s=await se();f(s),S(A(s)),u("success",`Switched to ${b}`)}catch(t){u("error",t instanceof Error?t.message:"Failed to switch model")}},fe=async()=>{var t,s,c,d;j(!0);try{const g=await Pe({voice:{enabled:i,livekitUrl:l,ttsVoice:V,ttsEngine:w,ttsUrl:ne||"http://localhost:5005",sttUrl:((t=r==null?void 0:r.voice)==null?void 0:t.sttUrl)??"http://localhost:48421",livekitApiKey:((s=r==null?void 0:r.voice)==null?void 0:s.livekitApiKey)??"",livekitApiSecret:((c=r==null?void 0:r.voice)==null?void 0:c.livekitApiSecret)??"",agentUrl:((d=r==null?void 0:r.voice)==null?void 0:d.agentUrl)??""}});f(g),u("success","Settings saved"),i&&D()}catch(g){u("error",g instanceof Error?g.message:"Failed to save settings")}finally{j(!1)}};if(n)return e.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((t,s)=>e.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"},s))});if(U)return e.jsxs("div",{className:"space-y-4",children:[e.jsx(re,{title:"Settings",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Settings"},{label:"Settings"}]}),e.jsxs("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 text-error",children:[e.jsx(ee,{className:"h-5 w-5"}),e.jsx("p",{className:"text-sm font-medium",children:"Failed to load settings"})]}),e.jsx("p",{className:"mt-2 text-sm text-text-secondary",children:U}),e.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 rounded-lg bg-bg-tertiary px-4 py-2 text-sm text-text hover:bg-border transition-colors",children:"Retry"})]})]});const ve=r?A(r):"";return e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsx(re,{title:"Settings",subtitle:"Provider, model, voice, theme, and channel configuration",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"Settings"}]}),e.jsx("div",{className:"rounded-lg border border-border bg-bg-secondary/50 px-3 py-2.5",children:e.jsx(_e,{})}),y&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-3 md:px-4 py-2.5 md:py-2 text-[11px] md:text-sm ${y.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[y.type==="success"?e.jsx(Ae,{className:"h-4 w-4"}):e.jsx(ee,{className:"h-4 w-4"}),y.message]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-3 md:p-6",children:[e.jsx("h3",{className:"mb-3 md:mb-4 text-[11px] md:text-sm font-medium text-text-secondary",children:"Model"}),e.jsx(He,{models:p,selectedModel:b,onSelect:S,onSwitch:ge,currentModel:ve})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-3 md:p-6",children:[e.jsxs("div",{className:"mb-3 md:mb-4 flex items-center justify-between flex-wrap gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4 text-accent-hover"}),e.jsx("h3",{className:"text-sm font-medium text-text-secondary",children:"Voice"}),e.jsx("span",{className:"rounded-full bg-accent/20 px-2 py-0.5 text-[9px] font-medium text-purple-light",children:((X=P.find(t=>t.id===w))==null?void 0:X.name)||w})]}),e.jsxs("button",{onClick:D,disabled:O,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-[10px] text-text-muted hover:bg-bg-tertiary hover:text-text-secondary transition-colors",children:[e.jsx(Ie,{className:`h-3 w-3 ${O?"animate-spin":""}`}),O?"Scanning...":"Scan Services"]})]}),e.jsxs("div",{className:"space-y-4",children:[v&&e.jsxs("div",{className:"rounded-lg border border-bg-tertiary bg-bg p-3",children:[e.jsx("p",{className:"mb-2 text-[10px] font-medium uppercase tracking-wider text-text-muted",children:"Service Discovery"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{label:"LiveKit Server",ok:v.livekit},{label:"Voice Agent",ok:v.agent},{label:"STT",ok:v.stt},{label:`TTS (${((Y=P.find(t=>t.id===w))==null?void 0:Y.name)||"TTS"})`,ok:v.tts}].map(({label:t,ok:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Be,{ok:s}),e.jsx("span",{className:`text-xs ${s?"text-text-secondary":"text-text-muted"}`,children:t}),s&&e.jsx("span",{className:"text-[9px] text-success",children:"Online"})]},t))}),(L==null?void 0:L.available)!==void 0&&e.jsx("div",{className:"mt-2 flex items-center gap-2 border-t border-bg-tertiary pt-2",children:L.available?e.jsxs(e.Fragment,{children:[e.jsx(Ne,{className:"h-3.5 w-3.5 text-success"}),e.jsx("span",{className:"text-xs text-success",children:"Voice system ready"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Me,{className:"h-3.5 w-3.5 text-text-muted"}),e.jsx("span",{className:"text-xs text-text-muted",children:L.reason||"Voice not available"})]})})]}),e.jsxs("label",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:i,onChange:t=>m(t.target.checked),className:"h-4 w-4 rounded border-border accent-accent"}),e.jsx("span",{className:"text-sm text-text",children:"Enable Voice Chat"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-2 block text-xs text-text-muted",children:"TTS Engine"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:P.map(t=>e.jsxs("button",{type:"button",onClick:()=>{W(t.id),q(t.defaultUrl),E(t.defaultVoices[0]||"default"),T(t.defaultVoices)},className:`rounded-lg border p-3 text-left transition-all min-h-[64px] active:scale-[0.98] sm:min-h-[56px] ${w===t.id?"border-accent bg-accent/10":"border-border hover:border-border-light"}`,children:[e.jsx("div",{className:"text-xs font-medium text-text",children:t.name}),e.jsx("div",{className:"mt-0.5 text-[10px] text-text-muted",children:t.desc})]},t.id))}),e.jsx("div",{className:"mt-3 rounded-xl border border-border bg-bg-secondary p-4 space-y-4",children:de?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4 text-accent2 animate-spin"}),e.jsx("span",{className:"text-sm font-medium text-text",children:"Installing F5-TTS..."})]}),e.jsx("div",{className:"rounded-lg bg-bg border border-bg-tertiary p-3",children:e.jsx("p",{className:"text-xs text-text-secondary font-mono break-all",children:xe})})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-success shadow-[0_0_6px_rgba(34,197,94,0.4)]"}),e.jsx("span",{className:"text-sm text-text",children:"F5-TTS Running"})]})}),e.jsxs("div",{className:"rounded-lg border border-bg-tertiary bg-bg p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs font-medium text-text-secondary",children:"Cloned Voices"}),e.jsxs("button",{onClick:pe,disabled:z,className:"flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium text-accent2 border border-border hover:border-accent2/50 hover:bg-accent2/10 transition-colors disabled:opacity-50",children:[z?e.jsx(te,{className:"h-3 w-3 animate-spin"}):e.jsx(Fe,{className:"h-3 w-3 rotate-180"}),"Upload Voice"]})]}),e.jsx("p",{className:"text-[10px] text-text-muted leading-relaxed",children:"Upload 5-10 seconds of clear speech. No background noise or music. Adding a transcript significantly improves quality."}),K.length>0?e.jsx("div",{className:"space-y-1.5",children:K.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-bg-tertiary px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-3.5 w-3.5 text-accent2"}),e.jsx("span",{className:"text-sm text-text capitalize",children:t.name}),e.jsxs("span",{className:"text-[9px] text-text-muted",children:[(t.sizeBytes/1024).toFixed(0),"KB"]}),t.hasTranscript&&e.jsx("span",{className:"rounded bg-success/15 px-1 py-0.5 text-[8px] text-success",children:"transcript"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>he(t.name),className:"text-text-muted hover:text-accent2 transition-colors",title:"Preview voice",children:e.jsx($e,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>be(t.name),className:"text-text-muted hover:text-error transition-colors",title:"Delete voice",children:e.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})})})]})]},t.name))}):e.jsx("p",{className:"text-xs text-text-muted",children:"No cloned voices yet. Upload a 5-10 second WAV reference to clone any voice."})]})]})})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:["LiveKit URL",(v==null?void 0:v.livekit)&&e.jsx("span",{className:"rounded bg-success/15 px-1.5 py-0.5 text-[9px] font-medium text-success",children:"Connected"})]}),e.jsx("input",{value:l,onChange:t=>k(t.target.value),placeholder:"ws://localhost:7880",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-2 block text-xs text-text-muted",children:"Voice"}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:ie.map(t=>e.jsx("button",{type:"button",onClick:()=>E(t),className:`rounded-lg border px-3 py-2 text-sm transition-all capitalize ${V===t?"border-accent bg-accent/10 text-text":"border-border text-text-secondary hover:border-border-light hover:text-text"}`,children:t},t))}),e.jsx("p",{className:"mt-2 text-xs text-text-muted",children:"F5-TTS voice cloning via MLX. Upload a 5-10 second reference audio to clone any voice."})]}),V&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-bg px-3 py-2",children:[e.jsx(B,{className:"h-3.5 w-3.5 text-accent-hover"}),e.jsx("span",{className:"text-xs text-text-muted",children:"Selected:"}),e.jsx("span",{className:"text-xs font-mono text-text-secondary",children:V}),e.jsx("span",{className:"ml-auto rounded bg-accent/15 px-1.5 py-0.5 text-[9px] font-medium text-purple-light",children:((J=P.find(t=>t.id===w))==null?void 0:J.name)||w})]})]})]}),e.jsxs("button",{onClick:fe,disabled:x,className:"flex items-center gap-2 rounded-lg bg-accent px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(Re,{className:"h-4 w-4"}),x?"Saving...":"Save Settings"]})]})}export{mt as default};
|