titan-agent 6.3.6 → 6.4.1
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/THIRD_PARTY_NOTICES.md +3 -0
- package/dist/agent/agent.js +6 -2
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/autoSkillGen.js +55 -17
- package/dist/agent/autoSkillGen.js.map +1 -1
- package/dist/agent/learningCurator.js +383 -0
- package/dist/agent/learningCurator.js.map +1 -0
- package/dist/agent/trajectoryLogger.js +2 -2
- package/dist/agent/trajectoryLogger.js.map +1 -1
- package/dist/config/schema.js +22 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/gateway/server.js +6 -1
- package/dist/gateway/server.js.map +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/package.json +1 -1
- package/ui/dist/assets/AuditPanel-B55jmQpR.js +1 -0
- package/ui/dist/assets/{AutonomyPanel-CcOxsveF.js → AutonomyPanel-MP5tOLxX.js} +2 -2
- package/ui/dist/assets/{AutopilotPanel-CjrYEF2s.js → AutopilotPanel-DB38vjfF.js} +1 -1
- package/ui/dist/assets/AutoresearchPanel-CFvfx18N.js +6 -0
- package/ui/dist/assets/{BackupPanel-BhU-utCn.js → BackupPanel-0a5SbfaS.js} +1 -1
- package/ui/dist/assets/{BrowserPanel-Dr-B5Kva.js → BrowserPanel-CvOVGtTp.js} +2 -2
- package/ui/dist/assets/{CPActivity-C5kJWqWc.js → CPActivity-FlC0Ac-0.js} +1 -1
- package/ui/dist/assets/{CPAgentDetail-BVE3LoLA.js → CPAgentDetail-CNiDw2g2.js} +1 -1
- package/ui/dist/assets/{CPAgents-BKBSyXHs.js → CPAgents-2qeSr80C.js} +1 -1
- package/ui/dist/assets/{CPApprovals-AkRGu05y.js → CPApprovals-D2m2dYBD.js} +1 -1
- package/ui/dist/assets/{CPCosts-DC5mPwVm.js → CPCosts-CbRtk5BJ.js} +1 -1
- package/ui/dist/assets/{CPDashboard-C7G-H6HW.js → CPDashboard-sGImoKeh.js} +1 -1
- package/ui/dist/assets/CPFiles-OVqWt7zC.js +1 -0
- package/ui/dist/assets/{CPGoals-BL0rrvT5.js → CPGoals-wgG_oJF6.js} +1 -1
- package/ui/dist/assets/{CPInbox-CBUkqu4i.js → CPInbox-C4toHLIj.js} +1 -1
- package/ui/dist/assets/{CPIssueDetail-HuI9tPu4.js → CPIssueDetail-CYVivz76.js} +1 -1
- package/ui/dist/assets/{CPIssues-Do9d-evH.js → CPIssues-CrYg3hHZ.js} +1 -1
- package/ui/dist/assets/CPLayout-BXcOZUo7.js +2 -0
- package/ui/dist/assets/{CPOrg-WHkSBNGU.js → CPOrg-BvU8zgIR.js} +1 -1
- package/ui/dist/assets/{CPRuns-B4Pz5QkG.js → CPRuns-tXHGoKnO.js} +1 -1
- package/ui/dist/assets/{CPSocial-DayQlwZL.js → CPSocial-Dxt58jcE.js} +1 -1
- package/ui/dist/assets/{CPVoice-C2ry-Muk.js → CPVoice-DBWsPDYo.js} +1 -1
- package/ui/dist/assets/{ChannelsPanel-CeIEB9Es.js → ChannelsPanel-Cc1rpsDr.js} +1 -1
- package/ui/dist/assets/{CheckpointsPanel-BkqqvLDL.js → CheckpointsPanel-BMxuQIKg.js} +1 -1
- package/ui/dist/assets/{CommandPostHub-Jd5_PAh3.js → CommandPostHub--U1dHmDw.js} +4 -4
- package/ui/dist/assets/{CronPanel-COkBBcTV.js → CronPanel-C7uIoKAb.js} +1 -1
- package/ui/dist/assets/{DataTable-YQ9l5Xab.js → DataTable-DtjGbNj5.js} +1 -1
- package/ui/dist/assets/DreamPanel-DhjOkThA.js +15 -0
- package/ui/dist/assets/EmptyState-cLzelkoZ.js +1 -0
- package/ui/dist/assets/{EvalHarnessPanel-DXU9jNmm.js → EvalHarnessPanel-Dm6DyPTs.js} +2 -2
- package/ui/dist/assets/{EvalPanel-CY1kmmoG.js → EvalPanel-BDiX_uNI.js} +1 -1
- package/ui/dist/assets/{FileViewer-BPLxBXEr.js → FileViewer-CHrDPOA5.js} +1 -1
- package/ui/dist/assets/{FilesPanel-B5RpGquX.js → FilesPanel-CNCqxSjS.js} +2 -2
- package/ui/dist/assets/{FleetPanel-1g-MrF81.js → FleetPanel-UOTqdrh3.js} +1 -1
- package/ui/dist/assets/{HomelabPanel-CxkWfeeN.js → HomelabPanel-8GyBOfWC.js} +1 -1
- package/ui/dist/assets/InfraView-Ds53Fjni.js +2 -0
- package/ui/dist/assets/{InlineEditableField-BuXVLQiL.js → InlineEditableField-CFx4EOF1.js} +1 -1
- package/ui/dist/assets/{Input-C6OxbFDH.js → Input-CT_e2ZXD.js} +1 -1
- package/ui/dist/assets/IntegrationsPanel-_MC_FcOZ.js +1 -0
- package/ui/dist/assets/IntelligenceView-DHKwRkc_.js +2 -0
- package/ui/dist/assets/LearningPanel-DIsuxMlC.js +1 -0
- package/ui/dist/assets/LogsPanel-hUcRe-Pt.js +1 -0
- package/ui/dist/assets/McpPanel-B2L9oapp.js +1 -0
- package/ui/dist/assets/MemoryGraphPanel-eVPWv4Fz.js +16 -0
- package/ui/dist/assets/{MemoryWikiPanel-BNv9ycwr.js → MemoryWikiPanel-CDuJkatJ.js} +2 -7
- package/ui/dist/assets/MeshPanel-C42VpfJ5.js +11 -0
- package/ui/dist/assets/{MissionCanvas-BR9tT-Vs.js → MissionCanvas-BMw2FCD5.js} +1 -1
- package/ui/dist/assets/{MissionChat-B_fuBUn5.js → MissionChat-C9HHYet2.js} +1 -1
- package/ui/dist/assets/{MissionLibrary-C9fCMdpu.js → MissionLibrary-D2yhbAJg.js} +1 -1
- package/ui/dist/assets/{MissionStart-Bb2fCB2u.js → MissionStart-BKeop9F5.js} +1 -1
- package/ui/dist/assets/{Modal-9_l_CYE2.js → Modal-Bdo-V7t6.js} +1 -1
- package/ui/dist/assets/NvidiaPanel-CEss--Dl.js +1 -0
- package/ui/dist/assets/{OrganismPanel-d6mPFcBq.js → OrganismPanel-CToPtDaz.js} +1 -1
- package/ui/dist/assets/{OverviewPanel-DF7eBJCF.js → OverviewPanel-D7IolCYo.js} +1 -1
- package/ui/dist/assets/PageHeader-CjDtUo8m.js +1 -0
- package/ui/dist/assets/{PersonaProfilesPanel-qAgZyu1B.js → PersonaProfilesPanel-Df5og1Sg.js} +1 -1
- package/ui/dist/assets/{PersonasPanel-CxDpp_3j.js → PersonasPanel-DKr-x2AB.js} +1 -1
- package/ui/dist/assets/{PhoneDeskPanel-CLp3E_Ry.js → PhoneDeskPanel-CkEnpVrz.js} +1 -1
- package/ui/dist/assets/{RecipesPanel-DqMMQnyc.js → RecipesPanel-CiQiYqpA.js} +1 -1
- package/ui/dist/assets/{SecurityPanel-BQ3-aMmO.js → SecurityPanel-nTFIdiqf.js} +1 -1
- package/ui/dist/assets/SelfImprovePanel-mPChEVjC.js +1 -0
- package/ui/dist/assets/{SelfProposalsPanel-d5W-0A3P.js → SelfProposalsPanel-CXIGD8P3.js} +2 -2
- package/ui/dist/assets/{SessionsPanel-DzbNc8iW.js → SessionsPanel-C8nt7rxV.js} +1 -1
- package/ui/dist/assets/{SessionsTab-CuRh8SAw.js → SessionsTab-Bp5WaW_Q.js} +1 -1
- package/ui/dist/assets/SettingsPanel-Cg5tgqDO.js +1 -0
- package/ui/dist/assets/SettingsView-DosHEIoU.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-CrZUFaIM.js → SkeletonLoader-DwBcLrhl.js} +1 -1
- package/ui/dist/assets/{SkillsPanel-eyCYqSuP.js → SkillsPanel-CHnd8BmR.js} +1 -1
- package/ui/dist/assets/{SomaView-CvHD2r-j.js → SomaView-1zShMywA.js} +1 -1
- package/ui/dist/assets/{StatCard-_MlD8k-5.js → StatCard-BUO6lNlX.js} +1 -1
- package/ui/dist/assets/{StatusBadge-MIQ4EfQR.js → StatusBadge-CmSemYNT.js} +1 -1
- package/ui/dist/assets/{Tabs-DkooY-W7.js → Tabs-Zo1JoN_G.js} +1 -1
- package/ui/dist/assets/{TeamsPanel-fa--osWi.js → TeamsPanel-C96TIEna.js} +1 -1
- package/ui/dist/assets/{TelemetryPanel-BEEWcoNE.js → TelemetryPanel-DlI9vEZU.js} +1 -1
- package/ui/dist/assets/{TitanCanvas-LWyPGpf5.js → TitanCanvas-BewmO4FZ.js} +52 -27
- package/ui/dist/assets/ToolsView-BY73iyvj.js +2 -0
- package/ui/dist/assets/{Tooltip-DrpHNalN.js → Tooltip-DHrJsv5K.js} +1 -1
- package/ui/dist/assets/{TraceViewer-XsmYbc0e.js → TraceViewer-BVH6WsWN.js} +1 -1
- package/ui/dist/assets/{TrainingPanel-CmJXLn4n.js → TrainingPanel-Beam9vXX.js} +1 -1
- package/ui/dist/assets/{VoiceOverlay-D2N-c76K.js → VoiceOverlay-B03bLRa6.js} +1 -1
- package/ui/dist/assets/{VramPanel-h6zjNx-6.js → VramPanel-Cv48drRb.js} +1 -1
- package/ui/dist/assets/{WatchView-DDNt13KH.js → WatchView-VtZRF3Ah.js} +1 -1
- package/ui/dist/assets/{WorkTab-CLXkjuee.js → WorkTab-gIgsVURN.js} +1 -1
- package/ui/dist/assets/{WorkflowsPanel-BYtLGQVm.js → WorkflowsPanel-xGphoCgy.js} +1 -1
- package/ui/dist/assets/{archive-BSupLPZM.js → archive-B27XcT_v.js} +1 -1
- package/ui/dist/assets/{arrow-left-BaVVZjqf.js → arrow-left-DSU0t1ZF.js} +1 -1
- package/ui/dist/assets/{book-open-CZxMkLs8.js → book-open-CCt4Gq9I.js} +1 -1
- package/ui/dist/assets/{bot-Cv-edYov.js → bot-DK7dbBfX.js} +1 -1
- package/ui/dist/assets/{chart-column-BSVdQ9RP.js → chart-column-CixcF9Pi.js} +1 -1
- package/ui/dist/assets/{check-DbgTEg8O.js → check-oX--Xdud.js} +1 -1
- package/ui/dist/assets/{chevron-right-DfToq0aQ.js → chevron-right-D1DyaeTm.js} +1 -1
- package/ui/dist/assets/{chevron-up-DMS2Tjip.js → chevron-up-uKeW050h.js} +1 -1
- package/ui/dist/assets/{circle-check-big-BBQqeCVt.js → circle-check-big-C7KjulF6.js} +1 -1
- package/ui/dist/assets/{circle-stop-CZNS3Uri.js → circle-stop-DMMdkBs2.js} +1 -1
- package/ui/dist/assets/{clipboard-list-CzMXlUCb.js → clipboard-list-C3GIPAT3.js} +1 -1
- package/ui/dist/assets/{clock-BvWNugZo.js → clock-BgvC0T_E.js} +1 -1
- package/ui/dist/assets/{dollar-sign-pghzkByE.js → dollar-sign-DuP1ZChI.js} +1 -1
- package/ui/dist/assets/{download-CupMD2Qi.js → download-CnPu926z.js} +1 -1
- package/ui/dist/assets/{external-link-8Pnd2MvS.js → external-link-fIw1hJS5.js} +1 -1
- package/ui/dist/assets/{file-text-rkojc4Uq.js → file-text-kYsk6v9z.js} +1 -1
- package/ui/dist/assets/{flask-conical-BtbE3rIA.js → flask-conical-CAMJ0Plo.js} +1 -1
- package/ui/dist/assets/{folder-65U1Euur.js → folder-Dq6luLP7.js} +1 -1
- package/ui/dist/assets/{funnel-D9FpWHn9.js → funnel-hj2rC4MH.js} +1 -1
- package/ui/dist/assets/{git-branch-D6YV_OC1.js → git-branch-DX_X3HtU.js} +1 -1
- package/ui/dist/assets/{index-BslUQuVl.js → index-BISxhHXP.js} +19 -19
- package/ui/dist/assets/index-Dm6zcSTS.css +1 -0
- package/ui/dist/assets/{layers-rc37Q5yX.js → layers-BseADaVO.js} +1 -1
- package/ui/dist/assets/{legacy-BydeSW77.js → legacy-B7aW_gUV.js} +1 -1
- package/ui/dist/assets/{lightbulb-BEx7BdxD.js → lightbulb-DdDY0MbY.js} +1 -1
- package/ui/dist/assets/link-BZZB4JyS.js +6 -0
- package/ui/dist/assets/{list-todo-6N1AZe4i.js → list-todo-bSv3SQAa.js} +1 -1
- package/ui/dist/assets/{message-square-BEGY8pHF.js → message-square-D9n28WBl.js} +1 -1
- package/ui/dist/assets/{mic-CGj6cLoV.js → mic-DsWOcLkn.js} +1 -1
- package/ui/dist/assets/{missions-BohoEPZo.js → missions-CmBxbp0k.js} +1 -1
- package/ui/dist/assets/{network-DxIkmFJR.js → network-CkgG0zu0.js} +1 -1
- package/ui/dist/assets/{pause-CxvyFedA.js → pause-CvgG1y4I.js} +1 -1
- package/ui/dist/assets/{pencil-D5LooNFk.js → pencil-c0GVcCA9.js} +1 -1
- package/ui/dist/assets/{play-6W8amqUG.js → play-CuwPKVSv.js} +1 -1
- package/ui/dist/assets/{plug-C3Ecy-Ji.js → plug-D-b321IK.js} +1 -1
- package/ui/dist/assets/{plus-BtmCDNeU.js → plus-IFwPqtUW.js} +1 -1
- package/ui/dist/assets/{proxy-BD29vUSb.js → proxy-Dm6tNAsg.js} +1 -1
- package/ui/dist/assets/{radio-Bl9Tibea.js → radio-BNdFCb41.js} +1 -1
- package/ui/dist/assets/{refresh-cw-BHphkMjv.js → refresh-cw-CFv1BDy9.js} +1 -1
- package/ui/dist/assets/{rotate-ccw-DQzGCkVc.js → rotate-ccw-iCpZfipQ.js} +1 -1
- package/ui/dist/assets/{save-Bk90yLic.js → save-o5ciSOaB.js} +1 -1
- package/ui/dist/assets/{search-DxM6zcDJ.js → search-DmeBed-X.js} +1 -1
- package/ui/dist/assets/{send-ChZ5Hsne.js → send-BoLKNmgS.js} +1 -1
- package/ui/dist/assets/{server-CSOB40Ah.js → server-Ov6rxCAc.js} +1 -1
- package/ui/dist/assets/{shield-check-uMK1alGs.js → shield-check-CKPsc0rI.js} +1 -1
- package/ui/dist/assets/{terminal-lIpm0q0K.js → terminal-CcPGcWeJ.js} +1 -1
- package/ui/dist/assets/{test-tube-DuTInDo7.js → test-tube-564jDt0t.js} +1 -1
- package/ui/dist/assets/{toggle-right-j4jgj1NQ.js → toggle-right-B7gXrucx.js} +1 -1
- package/ui/dist/assets/{trash-2-2Qmp8Fyr.js → trash-2-B7yIJ8B5.js} +1 -1
- package/ui/dist/assets/{trending-up-BydxQces.js → trending-up-DdxHXTsD.js} +1 -1
- package/ui/dist/assets/{trophy-B8Fq83wO.js → trophy-mttLLqgk.js} +1 -1
- package/ui/dist/assets/{volume-2-B6qThcBF.js → volume-2-DcpX5fnm.js} +1 -1
- package/ui/dist/assets/{wifi-off-BX5XYuML.js → wifi-off-B4cf3i9g.js} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/AuditPanel-C7rrUHBM.js +0 -1
- package/ui/dist/assets/AutoresearchPanel-CBdGRAdZ.js +0 -6
- package/ui/dist/assets/CPFiles-IhcbsdvY.js +0 -1
- package/ui/dist/assets/CPLayout-DlpdPzBu.js +0 -2
- package/ui/dist/assets/DreamPanel-B5M--_sB.js +0 -15
- package/ui/dist/assets/EmptyState-DtSIPEVv.js +0 -1
- package/ui/dist/assets/InfraView-CYH3ieie.js +0 -2
- package/ui/dist/assets/IntegrationsPanel-CPZclot5.js +0 -1
- package/ui/dist/assets/IntelligenceView-DqwlFo91.js +0 -2
- package/ui/dist/assets/LearningPanel-DHQSZZGb.js +0 -1
- package/ui/dist/assets/LogsPanel-XfC4fyQ6.js +0 -1
- package/ui/dist/assets/McpPanel-CBN7xizL.js +0 -1
- package/ui/dist/assets/MemoryGraphPanel-BBxgK2Lo.js +0 -16
- package/ui/dist/assets/MeshPanel-GFPkWStS.js +0 -11
- package/ui/dist/assets/NvidiaPanel-CiB9Nlbq.js +0 -1
- package/ui/dist/assets/PageHeader-BQEb_uAl.js +0 -1
- package/ui/dist/assets/SelfImprovePanel-C-ylXP-k.js +0 -1
- package/ui/dist/assets/SettingsPanel-C1FbNM3W.js +0 -1
- package/ui/dist/assets/SettingsView-ZTklN8Q3.js +0 -2
- package/ui/dist/assets/ToolsView-UCDMsvb1.js +0 -2
- package/ui/dist/assets/index-DmgXt1oB.css +0 -1
package/ui/dist/index.html
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<link rel="manifest" href="/manifest.json" />
|
|
10
10
|
<link rel="apple-touch-icon" href="/titan-logo.png" />
|
|
11
11
|
<title>TITAN Mission Control</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-BISxhHXP.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Dm6zcSTS.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body class="bg-zinc-950 text-zinc-100">
|
|
16
16
|
<div id="root"></div>
|
package/ui/dist/sw.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* but a default falls back to the source-controlled value here.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
const CACHE_NAME = 'titan-' + ('
|
|
23
|
+
const CACHE_NAME = 'titan-' + ('1779480857237');
|
|
24
24
|
const ASSETS_PREFIX = '/assets/';
|
|
25
25
|
|
|
26
26
|
self.addEventListener('install', (event) => {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,j as e,aJ as S,aK as A}from"./index-BslUQuVl.js";import{C as v}from"./clipboard-list-CzMXlUCb.js";import{R as C}from"./refresh-cw-BHphkMjv.js";import{F as T}from"./funnel-D9FpWHn9.js";function E(){var b;const[c,p]=d.useState([]),[r,h]=d.useState(null),[g,i]=d.useState(!0),[a,n]=d.useState(""),[l,x]=d.useState(""),m=async()=>{i(!0);try{const[t,s]=await Promise.all([S({source:a||void 0,action:l||void 0,limit:100}),A(24)]);p(t),h(s)}catch{}i(!1)};d.useEffect(()=>{m()},[a,l]);const j=t=>t==="success"?"text-[var(--success)]":t==="failure"?"text-[var(--error)]":t==="escalated"?"text-[var(--warning)]":"text-[var(--text-muted)]",f=t=>t==="success"?"bg-[var(--success)]/10 border-[var(--success)]/20":t==="failure"?"bg-[var(--error)]/10 border-[var(--error)]/20":t==="escalated"?"bg-[var(--warning)]/10 border-[var(--warning)]/20":"bg-[var(--bg-tertiary)] border-[var(--border)]",u=t=>t.startsWith("daemon")?"bg-purple-500/10 text-purple-400 border-purple-500/20":t==="autopilot"?"bg-blue-500/10 text-blue-400 border-blue-500/20":t==="user"?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":t==="initiative"?"bg-amber-500/10 text-amber-400 border-amber-500/20":"bg-[var(--bg-tertiary)] text-[var(--text-muted)] border-[var(--border)]",N=t=>{try{const s=new Date(t),o=new Date().getTime()-s.getTime();return o<6e4?`${Math.round(o/1e3)}s ago`:o<36e5?`${Math.round(o/6e4)}m ago`:o<864e5?`${Math.round(o/36e5)}h ago`:s.toLocaleDateString()}catch{return t}},y=[...new Set(c.map(t=>t.source))].sort(),w=[...new Set(c.map(t=>t.action))].sort();return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"w-6 h-6 text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-[var(--text)]",children:"Audit Log"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Every autonomous action logged for accountability"})]})]}),e.jsx("button",{onClick:m,className:"p-2 rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(C,{size:14})})]}),r&&e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 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:"Actions (24h)"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--text)]",children:r.totalActions})]}),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:"Success Rate"}),e.jsxs("p",{className:`text-2xl font-bold ${r.successRate>=80?"text-[var(--success)]":r.successRate>=50?"text-[var(--warning)]":"text-[var(--error)]"}`,children:[r.successRate,"%"]})]}),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:"Sources"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--text)]",children:Object.keys(r.bySource).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:"Top Tool"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--accent)] truncate",children:((b=r.topTools[0])==null?void 0:b.tool)||"none"})]})]}),r&&Object.keys(r.bySource).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-semibold text-[var(--text)] mb-3",children:"Actions by Source (24h)"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(r.bySource).sort((t,s)=>s[1]-t[1]).map(([t,s])=>e.jsxs("button",{onClick:()=>n(a===t?"":t),className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${a===t?"bg-[var(--accent)] text-white border-[var(--accent)]":u(t)}`,children:[t,": ",s]},t))})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(T,{size:14,className:"text-[var(--text-muted)]"}),e.jsxs("select",{value:a,onChange:t=>n(t.target.value),className:"px-3 py-1.5 text-xs bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md text-[var(--text)]",children:[e.jsx("option",{value:"",children:"All Sources"}),y.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsxs("select",{value:l,onChange:t=>x(t.target.value),className:"px-3 py-1.5 text-xs bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md text-[var(--text)]",children:[e.jsx("option",{value:"",children:"All Actions"}),w.map(t=>e.jsx("option",{value:t,children:t},t))]}),(a||l)&&e.jsx("button",{onClick:()=>{n(""),x("")},className:"text-xs text-[var(--accent)] hover:underline",children:"Clear"})]}),g?e.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading audit log..."}):c.length===0?e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-8 text-center",children:[e.jsx(v,{className:"w-10 h-10 text-[var(--text-muted)] mx-auto mb-3"}),e.jsx("p",{className:"text-[var(--text-secondary)]",children:"No audit entries found"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Autonomous actions will appear here as TITAN operates."})]}):e.jsx("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg overflow-hidden",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[var(--text-muted)]",children:[e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Time"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Action"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Source"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Tool"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Result"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Detail"})]})}),e.jsx("tbody",{children:c.map((t,s)=>e.jsxs("tr",{className:"border-b border-[var(--border)]/50 last:border-0 hover:bg-[var(--bg-tertiary)] transition-colors",children:[e.jsx("td",{className:"px-4 py-2 text-[var(--text-muted)] whitespace-nowrap",children:N(t.timestamp)}),e.jsx("td",{className:"px-4 py-2 text-[var(--text)] font-medium",children:t.action}),e.jsx("td",{className:"px-4 py-2",children:e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] border ${u(t.source)}`,children:t.source})}),e.jsx("td",{className:"px-4 py-2 text-[var(--text-secondary)] font-mono",children:t.tool||"-"}),e.jsx("td",{className:"px-4 py-2",children:t.result?e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] border ${f(t.result)} ${j(t.result)}`,children:t.result}):"-"}),e.jsx("td",{className:"px-4 py-2 text-[var(--text-muted)] max-w-[200px] truncate",children:t.detail?JSON.stringify(t.detail):"-"})]},s))})]})})})]})}export{E as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as q,r as p,b as T,j as e,a7 as O,V as W}from"./index-BslUQuVl.js";import{F as A}from"./flask-conical-BtbE3rIA.js";import{P as D}from"./play-6W8amqUG.js";import{P as B}from"./pause-CxvyFedA.js";import{R as H}from"./refresh-cw-BHphkMjv.js";import{T as V}from"./trophy-B8Fq83wO.js";import{T as G}from"./trending-up-BydxQces.js";import{C as U}from"./clock-BvWNugZo.js";import{C as J}from"./chevron-right-DfToq0aQ.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 X=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Y=q("settings-2",X);function L(t){const x=Date.now()-new Date(t).getTime(),i=Math.floor(x/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function P(t){if(t<60)return`${Math.round(t)}s`;const x=Math.floor(t/60),i=Math.round(t%60);return`${x}m ${i}s`}function K({runs:t}){if(t.length<2)return e.jsx("div",{className:"flex items-center justify-center h-[200px] rounded-xl border border-bg-tertiary bg-bg-secondary text-text-muted text-sm",children:"Need at least 2 runs to show chart"});const x=800,i=200,a={top:20,right:20,bottom:30,left:50},b=x-a.left-a.right,$=i-a.top-a.bottom,N=t.map(r=>r.val_score),y=Math.max(0,Math.min(...N)-5),_=Math.min(100,Math.max(...N)+5),j=t.length>0?t[0].val_score:null,f=r=>a.left+r/(t.length-1)*b,S=r=>a.top+$-(r-y)/(_-y)*$,v=t.map((r,l)=>`${l===0?"M":"L"} ${f(l)} ${S(r.val_score)}`).join(" "),d=j!=null?S(j):null;return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-4 overflow-x-auto",children:[e.jsx("h3",{className:"text-xs font-medium text-text-secondary mb-2 uppercase tracking-wide",children:"Val Score Over Time"}),e.jsxs("svg",{viewBox:`0 0 ${x} ${i}`,className:"w-full",style:{minWidth:400},children:[[0,.25,.5,.75,1].map(r=>{const l=a.top+$*(1-r),R=y+(_-y)*r;return e.jsxs("g",{children:[e.jsx("line",{x1:a.left,y1:l,x2:x-a.right,y2:l,stroke:"#27272a",strokeWidth:"1"}),e.jsx("text",{x:a.left-8,y:l+4,textAnchor:"end",fill:"#52525b",fontSize:"10",children:R.toFixed(0)})]},r)}),j!=null&&j>=y&&j<=_&&d!=null&&e.jsxs("g",{children:[e.jsx("line",{x1:a.left,y1:d,x2:x-a.right,y2:d,stroke:"#eab308",strokeWidth:"1",strokeDasharray:"6,4"}),e.jsx("text",{x:x-a.right+4,y:d+3,fill:"#eab308",fontSize:"9",children:"baseline"})]}),e.jsx("path",{d:v,fill:"none",stroke:"#8b5cf6",strokeWidth:"2"}),t.map((r,l)=>{const R=l>0&&r.val_score>t[l-1].val_score,m=l>0&&r.val_score<t[l-1].val_score?"var(--color-error)":R?"var(--color-success)":"var(--color-purple)";return e.jsx("circle",{cx:f(l),cy:S(r.val_score),r:"4",fill:m,stroke:"#18181b",strokeWidth:"2",children:e.jsxs("title",{children:["Run ",l+1,": ",r.val_score," (",L(r.timestamp),")"]})},l)}),t.map((r,l)=>t.length>10&&l%Math.ceil(t.length/10)!==0&&l!==t.length-1?null:e.jsxs("text",{x:f(l),y:i-5,textAnchor:"middle",fill:"#52525b",fontSize:"9",children:["#",l+1]},l))]})]})}function C({icon:t,label:x,value:i,sub:a,color:b="text-text"}){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-1",children:[e.jsx("span",{className:"text-text-muted",children:t}),e.jsx("span",{className:"text-[10px] font-medium text-text-muted uppercase tracking-wider",children:x})]}),e.jsx("div",{className:`text-2xl font-bold ${b}`,children:i}),a&&e.jsx("div",{className:"text-[10px] text-text-muted mt-0.5",children:a})]})}function ne(){const[t,x]=p.useState([]),[i,a]=p.useState(!0),[b,$]=p.useState(!1),[N,y]=p.useState(null),[_,j]=p.useState(!1),[f,S]=p.useState(!1),v=p.useRef(null),d=p.useCallback((s,h)=>{y({type:s,message:h}),setTimeout(()=>y(null),3e3)},[]),r=p.useCallback(async()=>{try{const s=await T("/api/autoresearch/results");if(s.ok){const h=await s.json();x(h.runs||[])}}catch{}finally{a(!1)}},[]);p.useEffect(()=>{r()},[r]),p.useEffect(()=>(f?v.current&&(clearInterval(v.current),v.current=null):v.current=setInterval(r,3e4),()=>{v.current&&clearInterval(v.current)}),[f,r]);const l=async()=>{j(!0);try{(await T("/api/autoresearch/trigger",{method:"POST"})).ok?d("success","Autoresearch experiment started"):d("error","Failed to trigger experiment")}catch{d("error","Failed to connect to API")}finally{j(!1)}},R=async()=>{try{(await T("/api/message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:"Deploy the best autoresearch LoRA adapter to Ollama. Use train_deploy."})})).ok?d("success","Deploying best model to Ollama..."):d("error","Failed to start deployment")}catch{d("error","Connection error")}},w=t.length>0?Math.max(...t.map(s=>s.val_score)):0,m=t.length>0?t[0].val_score:null,k=m!=null&&t.length>0?t.reduce((s,h)=>s+(h.val_score-m),0)/t.length:null,u=t.length>0?t[t.length-1]:null,g=u==null?void 0:u.hyperparams,F=(s,h)=>{const c=[],o=s.hyperparams,n=h.hyperparams;return o.lr!==n.lr&&c.push(`LR: ${n.lr} → ${o.lr}`),o.rank!==n.rank&&c.push(`Rank: ${n.rank} → ${o.rank}`),o.alpha!==n.alpha&&c.push(`Alpha: ${n.alpha} → ${o.alpha}`),o.epochs!==n.epochs&&c.push(`Epochs: ${n.epochs} → ${o.epochs}`),o.batch_size!==n.batch_size&&c.push(`Batch: ${n.batch_size} → ${o.batch_size}`),o.dropout!==n.dropout&&c.push(`Dropout: ${n.dropout} → ${o.dropout}`),o.grad_accum!==n.grad_accum&&c.push(`GradAccum: ${n.grad_accum} → ${o.grad_accum}`),o.max_seq_len!==n.max_seq_len&&c.push(`SeqLen: ${n.max_seq_len} → ${o.max_seq_len}`),c.length>0?c:["No changes"]};return i?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"h-20 animate-pulse rounded-xl border border-border bg-bg-secondary"},s))}):e.jsxs("div",{className:"space-y-6 max-w-6xl",children:[N&&e.jsx("div",{className:`fixed top-4 right-4 z-50 rounded-lg px-4 py-2.5 text-sm font-medium shadow-lg ${N.type==="success"?"bg-success/20 text-success border border-success/30":"bg-error/20 text-error border border-error/30"}`,children:N.message}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-xl font-bold text-text flex items-center gap-2",children:[e.jsx(A,{className:"h-5 w-5 text-purple"}),"Autoresearch"]}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:"Autonomous hyper-parameter search and LoRA fine-tuning"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>S(!f),className:"flex items-center gap-1 rounded-lg border border-bg-tertiary px-2.5 py-1.5 text-xs text-text-secondary hover:bg-bg-tertiary",children:[f?e.jsx(D,{className:"h-3 w-3"}):e.jsx(B,{className:"h-3 w-3"}),f?"Resume":"Pause"]}),e.jsx("button",{onClick:r,className:"flex items-center gap-1 rounded-lg border border-bg-tertiary px-2.5 py-1.5 text-xs text-text-secondary hover:bg-bg-tertiary",children:e.jsx(H,{className:"h-3 w-3"})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-4",children:[e.jsx(C,{icon:e.jsx(A,{className:"h-4 w-4"}),label:"Total Runs",value:t.length}),e.jsx(C,{icon:e.jsx(V,{className:"h-4 w-4"}),label:"Best Val Score",value:w>0?w.toFixed(1):"—",sub:m!=null&&w>m?`+${(w-m).toFixed(1)} from baseline`:void 0,color:m!=null&&w>m?"text-success":"text-text"}),e.jsx(C,{icon:e.jsx(G,{className:"h-4 w-4"}),label:"Avg Improvement",value:k!=null?`${k>=0?"+":""}${k.toFixed(1)}`:"—",color:k!=null?k>0?"text-success":k<0?"text-error":"text-text":"text-text"}),e.jsx(C,{icon:e.jsx(U,{className:"h-4 w-4"}),label:"Last Run",value:u?L(u.timestamp):"Never",sub:u?`Score: ${u.val_score}`:void 0})]}),e.jsx(K,{runs:t}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:l,disabled:_,className:"flex items-center gap-2 rounded-lg bg-purple px-4 py-2 text-sm font-medium text-white hover:bg-[#7c3aed] disabled:opacity-50",children:[e.jsx(D,{className:"h-4 w-4"}),_?"Starting...":"Run Experiment"]}),e.jsxs("button",{onClick:R,disabled:t.length===0,className:"flex items-center gap-2 rounded-lg border border-bg-tertiary px-4 py-2 text-sm font-medium text-text-secondary hover:bg-bg-tertiary disabled:opacity-50",children:[e.jsx(O,{className:"h-4 w-4"}),"Deploy Best Model"]}),u&&e.jsxs("span",{className:"text-xs text-text-muted",children:[u.num_examples," training examples · ",P(u.training_time_s)]})]}),t.length>0&&e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-bg-tertiary",children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"What Made TITAN Better"}),e.jsx("p",{className:"text-[10px] text-text-muted",children:"Experiment history — how each change affected val_score"})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-bg-tertiary",children:[e.jsx("th",{className:"px-4 py-2 text-[10px] font-medium text-text-muted",children:"#"}),e.jsx("th",{className:"px-4 py-2 text-[10px] font-medium text-text-muted",children:"Date"}),e.jsx("th",{className:"px-4 py-2 text-[10px] font-medium text-text-muted",children:"Changes"}),e.jsx("th",{className:"px-4 py-2 text-[10px] font-medium text-text-muted text-right",children:"Score"}),e.jsx("th",{className:"px-4 py-2 text-[10px] font-medium text-text-muted text-right",children:"Δ"}),e.jsx("th",{className:"px-4 py-2 text-[10px] font-medium text-text-muted text-right",children:"Duration"}),e.jsx("th",{className:"px-4 py-2 text-[10px] font-medium text-text-muted text-right",children:"Examples"})]})}),e.jsx("tbody",{children:[...t].reverse().map((s,h)=>{const c=t.length-1-h,o=c>0?t[c-1]:null,n=o?s.val_score-o.val_score:m!=null?s.val_score-m:0,z=o?F(s,o):["Initial run"],M=new Date(s.timestamp);return e.jsxs("tr",{className:"border-b border-bg-tertiary last:border-0 hover:bg-[#27272a30]",children:[e.jsx("td",{className:"px-4 py-2 text-text-muted font-mono",children:c+1}),e.jsxs("td",{className:"px-4 py-2 text-text-secondary",children:[M.toLocaleDateString()," ",M.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]}),e.jsx("td",{className:"px-4 py-2 text-text-secondary",children:z.map((E,I)=>e.jsx("span",{className:"inline-block mr-1.5 rounded bg-bg-tertiary px-1.5 py-0.5 text-[10px] font-mono",children:E},I))}),e.jsx("td",{className:"px-4 py-2 text-right font-mono text-text font-medium",children:s.val_score.toFixed(1)}),e.jsx("td",{className:"px-4 py-2 text-right font-mono",children:e.jsxs("span",{className:n>0?"text-success":n<0?"text-error":"text-text-muted",children:[n>0?"+":"",n.toFixed(1)]})}),e.jsx("td",{className:"px-4 py-2 text-right text-text-muted",children:P(s.training_time_s)}),e.jsx("td",{className:"px-4 py-2 text-right text-text-muted",children:s.num_examples})]},c)})})]})})]}),e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>$(!b),className:"flex w-full items-center gap-2 text-xs font-medium text-text-secondary uppercase tracking-wider hover:text-text",children:[b?e.jsx(W,{className:"h-3.5 w-3.5"}):e.jsx(J,{className:"h-3.5 w-3.5"}),e.jsx(Y,{className:"h-3.5 w-3.5"}),"Current Hyperparameters"]}),b&&g&&e.jsx("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:[{label:"Learning Rate",value:g.lr},{label:"LoRA Rank",value:g.rank},{label:"LoRA Alpha",value:g.alpha},{label:"Dropout",value:g.dropout},{label:"Epochs",value:g.epochs},{label:"Batch Size",value:g.batch_size},{label:"Grad Accum",value:g.grad_accum},{label:"Max Seq Len",value:g.max_seq_len}].map(({label:s,value:h})=>e.jsxs("div",{className:"rounded-lg border border-bg-tertiary bg-bg-secondary px-3 py-2",children:[e.jsx("div",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:s}),e.jsx("div",{className:"text-sm font-mono text-text mt-0.5",children:h})]},s))}),b&&!g&&e.jsx("div",{className:"mt-3 rounded-lg border border-bg-tertiary bg-bg-secondary px-4 py-3 text-xs text-text-muted",children:"No runs yet — hyperparameters will appear after the first experiment"})]}),t.length===0&&e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-8 text-center",children:[e.jsx(A,{className:"h-8 w-8 text-text-muted mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-text-secondary",children:"No autoresearch runs yet"}),e.jsx("p",{className:"text-xs text-text-muted mt-1",children:'Click "Run Experiment" to start fine-tuning qwen3.5:35b on the RTX 5090'})]})]})}export{ne as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,j as e,b as f,X as j}from"./index-BslUQuVl.js";import{F as N}from"./folder-65U1Euur.js";import{F as y}from"./flask-conical-BtbE3rIA.js";import{S as v}from"./search-DxM6zcDJ.js";import{R as p}from"./refresh-cw-BHphkMjv.js";import{F as w}from"./file-text-rkojc4Uq.js";async function h(t){const a=await f(t);if(!a.ok)throw new Error(`HTTP ${a.status}`);return a.json()}function b(t){return t===void 0?"—":t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}K`:`${(t/1024/1024).toFixed(1)}M`}function g(t){const a=Math.floor((Date.now()-new Date(t).getTime())/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`}function k({path:t,onClose:a}){const[r,c]=i.useState(null);return i.useEffect(()=>{c(null),h(`/api/files/content?path=${encodeURIComponent(t)}`).then(l=>c(l)).catch(l=>c({error:String(l)}))},[t]),e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 flex items-center justify-center p-4",onClick:a,children:e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl w-full max-w-5xl max-h-[90vh] flex flex-col shadow-2xl",onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-text truncate",children:t}),r&&"sizeBytes"in r&&e.jsxs("div",{className:"text-xs text-text-muted",children:[b(r.sizeBytes)," · ",r.encoding,r.truncated?" · truncated at 1MB":""]})]}),e.jsx("button",{onClick:a,className:"p-1 rounded hover:bg-bg-tertiary text-text-muted",title:"Close",children:e.jsx(j,{size:18})})]}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[r===null&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),r&&"error"in r&&e.jsx("div",{className:"text-error text-sm py-8 text-center",children:r.error}),r&&"content"in r&&e.jsx("pre",{className:"text-[12px] font-mono leading-snug whitespace-pre-wrap text-text-secondary",children:r.content})]})]})})}function C(){const[t,a]=i.useState([]),[r,c]=i.useState(!0),[l,m]=i.useState(""),[o,n]=i.useState(null),d=i.useCallback(async()=>{c(!0);try{const s=await h("/api/files/edited?limit=300");a(s.files||[])}catch{}c(!1)},[]);i.useEffect(()=>{d()},[d]);const x=l?t.filter(s=>s.path.toLowerCase().includes(l.toLowerCase())):t;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-bg-secondary",children:[e.jsx(v,{size:14,className:"text-text-muted"}),e.jsx("input",{type:"text",placeholder:"Filter by path…",value:l,onChange:s=>m(s.target.value),className:"flex-1 bg-transparent text-sm outline-none"})]}),e.jsxs("button",{onClick:d,className:"px-3 py-1.5 rounded-lg border border-border bg-bg-secondary text-sm hover:bg-bg-tertiary flex items-center gap-1.5",title:"Refresh",children:[e.jsx(p,{size:14,className:r?"animate-spin":""}),r?"Loading":"Refresh"]}),e.jsxs("div",{className:"text-xs text-text-muted",children:[x.length," / ",t.length]})]}),r&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),!r&&x.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:l?"No files match filter":"No file edits recorded yet"}),x.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:x.map(s=>e.jsxs("button",{onClick:()=>s.readable&&s.exists&&n(s.path),disabled:!s.readable||!s.exists,className:"w-full flex items-start gap-3 px-4 py-2.5 text-left hover:bg-bg-tertiary transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(w,{size:14,className:s.isSelfMod?"text-accent mt-0.5 flex-shrink-0":"text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-mono text-text truncate",children:s.path}),e.jsxs("div",{className:"text-xs text-text-muted mt-0.5 flex items-center gap-2 flex-wrap",children:[s.isSelfMod&&e.jsx("span",{className:"px-1 rounded bg-accent/15 text-accent text-[10px]",children:"self-mod"}),e.jsxs("span",{children:["×",s.writeCount]}),s.tools.length>0&&e.jsx("span",{children:s.tools.join("+")}),s.channels.length>0&&e.jsxs("span",{children:["via ",s.channels.join(", ")]}),!s.exists&&e.jsx("span",{className:"text-warn",children:"deleted"}),e.jsx("span",{children:b(s.sizeBytes)})]})]}),e.jsx("div",{className:"text-xs text-text-muted flex-shrink-0",children:g(s.lastWrittenAt)})]},s.path))}),o&&e.jsx(k,{path:o,onClose:()=>n(null)})]})}function S(){const[t,a]=i.useState([]),[r,c]=i.useState(!0),[l,m]=i.useState(null),o=i.useCallback(async()=>{c(!0);try{const n=await h("/api/research/recent?limit=50");a(n.research||[])}catch{}c(!1)},[]);return i.useEffect(()=>{o()},[o]),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:o,className:"px-3 py-1.5 rounded-lg border border-border bg-bg-secondary text-sm hover:bg-bg-tertiary flex items-center gap-1.5",children:[e.jsx(p,{size:14,className:r?"animate-spin":""}),r?"Loading":"Refresh"]}),e.jsxs("div",{className:"text-xs text-text-muted",children:[t.length," items"]})]}),r&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),!r&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"No research recorded yet. Complete a goal and results will appear here."}),e.jsx("div",{className:"space-y-2",children:t.map(n=>{var u;const d=l===n.id,x=n.content.slice(0,200),s=n.subtaskTitle?`${n.goalTitle} — ${n.subtaskTitle}`:((u=n.tags)==null?void 0:u.join(" · "))||n.kind;return e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary overflow-hidden",children:[e.jsxs("button",{onClick:()=>m(d?null:n.id),className:"w-full text-left px-4 py-3 hover:bg-bg-tertiary transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-bg-tertiary text-text-muted uppercase tracking-wide font-medium",children:n.kind.replace(/_/g," ")}),e.jsx("span",{className:"text-xs text-text-muted",children:g(n.at)})]}),e.jsx("div",{className:"text-sm font-medium text-text truncate",children:s}),!d&&e.jsxs("div",{className:"text-xs text-text-secondary mt-1 line-clamp-2",children:[x,n.content.length>200?"…":""]})]}),d&&e.jsx("div",{className:"px-4 pb-4",children:e.jsx("pre",{className:"text-[12px] font-mono leading-snug whitespace-pre-wrap text-text-secondary",children:n.content})})]},n.id)})})]})}function M(){const[t,a]=i.useState("files");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>a("files"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors ${t==="files"?"bg-accent/15 text-accent border border-accent/30":"text-text-secondary hover:text-text hover:bg-bg-tertiary border border-transparent"}`,children:[e.jsx(N,{size:14})," Files edited"]}),e.jsxs("button",{onClick:()=>a("research"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors ${t==="research"?"bg-accent/15 text-accent border border-accent/30":"text-text-secondary hover:text-text hover:bg-bg-tertiary border border-transparent"}`,children:[e.jsx(y,{size:14})," Research"]})]}),t==="files"?e.jsx(C,{}):e.jsx(S,{})]})}export{M as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CommandPostHub-Jd5_PAh3.js","assets/index-BslUQuVl.js","assets/index-DmgXt1oB.css","assets/Input-C6OxbFDH.js","assets/clsx-B-dksMZM.js","assets/Modal-9_l_CYE2.js","assets/proxy-BD29vUSb.js","assets/InlineEditableField-BuXVLQiL.js","assets/check-DbgTEg8O.js","assets/pencil-D5LooNFk.js","assets/Tooltip-DrpHNalN.js","assets/approvalHeadline-DB9SgR-9.js","assets/chevron-right-DfToq0aQ.js","assets/bot-Cv-edYov.js","assets/pause-CxvyFedA.js","assets/dollar-sign-pghzkByE.js","assets/git-branch-D6YV_OC1.js","assets/chart-column-BSVdQ9RP.js","assets/clock-BvWNugZo.js","assets/message-square-BEGY8pHF.js","assets/file-text-rkojc4Uq.js","assets/terminal-lIpm0q0K.js","assets/refresh-cw-BHphkMjv.js","assets/circle-stop-CZNS3Uri.js","assets/send-ChZ5Hsne.js","assets/plus-BtmCDNeU.js","assets/trash-2-2Qmp8Fyr.js","assets/CPIssues-Do9d-evH.js","assets/StatusBadge-MIQ4EfQR.js","assets/PageHeader-BQEb_uAl.js","assets/EmptyState-DtSIPEVv.js","assets/Tabs-DkooY-W7.js","assets/SkeletonLoader-CrZUFaIM.js","assets/list-todo-6N1AZe4i.js","assets/CPIssueDetail-HuI9tPu4.js","assets/arrow-left-BaVVZjqf.js","assets/CPAgents-BKBSyXHs.js","assets/CPAgentDetail-BVE3LoLA.js","assets/circle-check-big-BBQqeCVt.js","assets/save-Bk90yLic.js","assets/CPApprovals-AkRGu05y.js","assets/shield-check-uMK1alGs.js","assets/CPActivity-C5kJWqWc.js","assets/CPGoals-BL0rrvT5.js","assets/CPRuns-B4Pz5QkG.js","assets/play-6W8amqUG.js","assets/CPCosts-DC5mPwVm.js","assets/CPOrg-WHkSBNGU.js","assets/network-DxIkmFJR.js","assets/CPFiles-IhcbsdvY.js","assets/folder-65U1Euur.js","assets/flask-conical-BtbE3rIA.js","assets/search-DxM6zcDJ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as t,r as s,q as _,v as e,N as l,_ as o}from"./index-BslUQuVl.js";const a=s.lazy(()=>o(()=>import("./CommandPostHub-Jd5_PAh3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]))),i=s.lazy(()=>o(()=>import("./CPIssues-Do9d-evH.js"),__vite__mapDeps([27,1,2,3,4,28,29,12,30,31,5,6,32,25,33]))),r=s.lazy(()=>o(()=>import("./CPIssueDetail-HuI9tPu4.js"),__vite__mapDeps([34,1,2,3,4,28,29,12,32,35,19,24]))),n=s.lazy(()=>o(()=>import("./CPAgents-BKBSyXHs.js"),__vite__mapDeps([36,1,2,3,4,28,29,12,30,32]))),x=s.lazy(()=>o(()=>import("./CPAgentDetail-BVE3LoLA.js"),__vite__mapDeps([37,1,2,3,4,28,29,12,30,31,32,35,38,15,18,39]))),m=s.lazy(()=>o(()=>import("./CPApprovals-AkRGu05y.js"),__vite__mapDeps([40,1,2,3,4,28,29,12,30,31,32,11,41,8]))),j=s.lazy(()=>o(()=>import("./CPActivity-C5kJWqWc.js"),__vite__mapDeps([42,1,2,3,4,29,12,30,31,32,41,15,13]))),p=s.lazy(()=>o(()=>import("./CPGoals-BL0rrvT5.js"),__vite__mapDeps([43,1,2,3,4,28,29,12,30,5,6,32,25,26]))),u=s.lazy(()=>o(()=>import("./CPRuns-B4Pz5QkG.js"),__vite__mapDeps([44,1,2,3,4,28,29,12,30,32,45]))),c=s.lazy(()=>o(()=>import("./CPCosts-DC5mPwVm.js"),__vite__mapDeps([46,1,2,3,4,28,29,12,30,5,6,32,25,15,26]))),d=s.lazy(()=>o(()=>import("./CPOrg-WHkSBNGU.js"),__vite__mapDeps([47,1,2,3,4,28,29,12,30,32,48,26]))),P=s.lazy(()=>o(()=>import("./CPFiles-IhcbsdvY.js"),__vite__mapDeps([49,1,2,50,51,52,22,20])));function E(){return t.jsx("div",{className:"flex items-center justify-center h-full text-sm",style:{color:"#c4b49a"},children:"Loading..."})}function h(){return t.jsx("div",{className:"h-full overflow-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(s.Suspense,{fallback:t.jsx(E,{}),children:t.jsxs(_,{children:[t.jsx(e,{index:!0,element:t.jsx(a,{})}),t.jsx(e,{path:"dashboard",element:t.jsx(a,{})}),t.jsx(e,{path:"issues",element:t.jsx(i,{})}),t.jsx(e,{path:"issues/:id",element:t.jsx(r,{})}),t.jsx(e,{path:"agents",element:t.jsx(n,{})}),t.jsx(e,{path:"agents/:id",element:t.jsx(x,{})}),t.jsx(e,{path:"approvals",element:t.jsx(m,{})}),t.jsx(e,{path:"activity",element:t.jsx(j,{})}),t.jsx(e,{path:"goals",element:t.jsx(p,{})}),t.jsx(e,{path:"runs",element:t.jsx(u,{})}),t.jsx(e,{path:"costs",element:t.jsx(c,{})}),t.jsx(e,{path:"org",element:t.jsx(d,{})}),t.jsx(e,{path:"files",element:t.jsx(P,{})}),t.jsx(e,{path:"*",element:t.jsx(l,{to:"/command-post",replace:!0})})]})})})})}export{h as CPLayout,h as default};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{c as D,r as n,aa as v,ab as w,ac as M,ad as $,j as e,f as G,K as P}from"./index-BslUQuVl.js";import{P as R}from"./PageHeader-BQEb_uAl.js";import{R as _}from"./refresh-cw-BHphkMjv.js";import"./chevron-right-DfToq0aQ.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 F=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],I=D("calendar",F);/**
|
|
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 O=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],k=D("moon",O);function T(){const[t,o]=n.useState(null),[f,b]=n.useState([]),[C,x]=n.useState(null),[m,d]=n.useState(!0),[p,j]=n.useState(!1),[y,i]=n.useState(null),N=n.useCallback(async()=>{try{const s=await v(60);b(s.dates)}catch{}},[]),S=n.useCallback(async()=>{d(!0),i(null);try{const s=await w();o(s),x((s==null?void 0:s.date)??null)}catch(s){i(s.message)}d(!1)},[]),E=n.useCallback(async s=>{d(!0),i(null);try{const a=await M(s);o(a),x(s)}catch(a){i(a.message)}d(!1)},[]),L=n.useCallback(async()=>{j(!0),i(null);try{const s=await $();o(s),x(s.date),await N()}catch(s){i(s.message)}j(!1)},[N]);return n.useEffect(()=>{let s=!1;return(async()=>{d(!0),i(null);try{const a=await v(60);if(s)return;if(b(a.dates),a.dates.length===0){o(null),x(null);return}const r=await w();if(s)return;o(r),x((r==null?void 0:r.date)??null)}catch(a){s||i(a.message)}finally{s||d(!1)}})(),()=>{s=!0}},[]),e.jsxs("div",{className:"space-y-4",children:[e.jsx(R,{title:"Dream Mode",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Identity"},{label:"Dreams"}]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:S,disabled:m,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(_,{className:`w-4 h-4 ${m?"animate-spin":""}`})," Latest"]}),e.jsxs("button",{onClick:L,disabled:p,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#6366f1]/20 text-[#a5b4fc] text-sm font-medium hover:bg-[#6366f1]/30 disabled:opacity-50",title:"Run a dream cycle right now instead of waiting for the nightly cron",children:[e.jsx(G,{className:`w-4 h-4 ${p?"animate-spin":""}`})," ",p?"Generating…":"Generate now"]})]}),y&&e.jsxs("div",{className:"p-3 rounded-lg border border-red-900/50 bg-red-950/20 text-sm text-red-300 flex items-start gap-2",children:[e.jsx(P,{className:"w-4 h-4 mt-0.5 shrink-0"}),e.jsx("span",{children:y})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[200px_1fr] gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-xs uppercase tracking-wide text-[#52525b] mb-2 flex items-center gap-1",children:[e.jsx(I,{className:"w-3 h-3"})," History"]}),f.length===0&&e.jsx("div",{className:"text-xs text-[#52525b] p-2",children:'No dreams yet. Run "Generate now" or wait for the nightly cron.'}),e.jsx("div",{className:"space-y-1 max-h-[60vh] overflow-y-auto",children:f.map(s=>e.jsx("button",{onClick:()=>E(s),className:`w-full text-left text-xs px-2 py-1.5 rounded ${C===s?"bg-[#27272a] text-[#e4e4e7]":"text-[#a1a1aa] hover:bg-[#1a1a1f]"}`,children:s},s))})]}),e.jsxs("div",{className:"min-w-0",children:[!t&&!m&&e.jsxs("div",{className:"p-6 text-center text-[#52525b] text-sm rounded-lg border border-[#27272a] bg-[#0a0a0f]",children:[e.jsx(k,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),"No dream selected."]}),t&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-[#52525b] flex-wrap",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(k,{className:"w-3 h-3"})," ",t.date]}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:["model: ",e.jsx("span",{className:"text-[#a1a1aa]",children:t.model})]}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:[t.activity.successfulTrajectories,"/",t.activity.trajectories," trajectories"]}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:[t.activity.toolsExercised.length," tools"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.sectionsEmitted.map(s=>e.jsx("span",{className:"text-[10px] uppercase tracking-wide px-2 py-0.5 rounded bg-emerald-950/40 text-emerald-300",children:s},s)),Object.entries(t.sectionsSkipped).map(([s,a])=>e.jsxs("span",{title:a,className:"text-[10px] uppercase tracking-wide px-2 py-0.5 rounded bg-[#27272a] text-[#52525b]",children:[s," skipped"]},s))]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2",children:Object.entries(t.drives.delta).map(([s,a])=>{const r=t.drives.start[s]??0,h=t.drives.end[s]??0,u=a>.005?"↑":a<-.005?"↓":"·",c=a>.005?"text-emerald-300":a<-.005?"text-red-300":"text-[#52525b]";return e.jsxs("div",{className:"p-2 rounded bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-[#52525b]",children:s}),e.jsxs("div",{className:"text-xs text-[#a1a1aa]",children:[r.toFixed(2)," → ",h.toFixed(2)]}),e.jsxs("div",{className:`text-xs font-medium ${c}`,children:[u," ",a>=0?"+":"",a.toFixed(3)]})]},s)})}),e.jsx("div",{className:"p-4 rounded-lg border border-[#27272a] bg-[#0a0a0f] prose prose-invert prose-sm max-w-none",children:t.markdown.split(/^## /m).map((s,a)=>{if(a===0){const c=s.split(`
|
|
12
|
-
`).filter(l=>l.trim());return e.jsx("div",{className:"mb-4",children:c.map((l,g)=>l.startsWith("# ")?e.jsx("h2",{className:"text-lg font-semibold text-[#e4e4e7] mb-1",children:l.slice(2)},g):l.startsWith("*")&&l.endsWith("*")?e.jsx("p",{className:"text-xs italic text-[#52525b]",children:l.slice(1,-1)},g):e.jsx("p",{className:"text-sm text-[#a1a1aa]",children:l},g))},"head")}const r=s.indexOf(`
|
|
13
|
-
`),h=r>=0?s.slice(0,r):s,u=r>=0?s.slice(r+1).trim():"";return e.jsxs("div",{className:"mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-[#e4e4e7] mb-2",children:h}),u.split(`
|
|
14
|
-
|
|
15
|
-
`).filter(c=>c.trim()).map((c,l)=>e.jsx("p",{className:"text-sm text-[#d4d4d8] leading-relaxed mb-2",children:c},l))]},`s${a}`)})}),t.audioPath&&e.jsxs("div",{className:"text-xs text-[#52525b]",children:["audio: ",e.jsx("code",{className:"px-1 py-0.5 rounded bg-[#0a0a0f]",children:t.audioPath})]})]})]})]})]})}export{T as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./index-BslUQuVl.js";import{B as r}from"./Input-C6OxbFDH.js";function n({icon:s,title:x,description:m,action:e,className:a}){return t.jsxs("div",{className:`flex flex-col items-center justify-center py-16 text-center ${a??""}`,children:[s&&t.jsx("div",{className:"mb-4 text-text-muted opacity-50",children:s}),t.jsx("h3",{className:"text-sm font-medium text-text-secondary",children:x}),m&&t.jsx("p",{className:"mt-1 max-w-sm text-xs text-text-muted",children:m}),e&&t.jsx(r,{variant:"secondary",size:"sm",onClick:e.onClick,className:"mt-4",children:e.label})]})}export{n as E};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomelabPanel-CxkWfeeN.js","assets/index-BslUQuVl.js","assets/index-DmgXt1oB.css","assets/PageHeader-BQEb_uAl.js","assets/chevron-right-DfToq0aQ.js","assets/StatCard-_MlD8k-5.js","assets/SkeletonLoader-CrZUFaIM.js","assets/clsx-B-dksMZM.js","assets/refresh-cw-BHphkMjv.js","assets/clock-BvWNugZo.js","assets/message-square-BEGY8pHF.js","assets/server-CSOB40Ah.js","assets/chart-column-BSVdQ9RP.js","assets/network-DxIkmFJR.js","assets/circle-check-big-BBQqeCVt.js","assets/wifi-off-BX5XYuML.js","assets/dollar-sign-pghzkByE.js","assets/NvidiaPanel-CiB9Nlbq.js","assets/save-Bk90yLic.js","assets/external-link-8Pnd2MvS.js","assets/search-DxM6zcDJ.js","assets/FilesPanel-B5RpGquX.js","assets/plus-BtmCDNeU.js","assets/arrow-left-BaVVZjqf.js","assets/pencil-D5LooNFk.js","assets/trash-2-2Qmp8Fyr.js","assets/download-CupMD2Qi.js","assets/check-DbgTEg8O.js","assets/TitanCanvas-LWyPGpf5.js","assets/chevron-up-DMS2Tjip.js","assets/file-text-rkojc4Uq.js","assets/terminal-lIpm0q0K.js","assets/book-open-CZxMkLs8.js","assets/rotate-ccw-DQzGCkVc.js","assets/send-ChZ5Hsne.js","assets/mic-CGj6cLoV.js","assets/flask-conical-BtbE3rIA.js","assets/archive-BSupLPZM.js","assets/radio-Bl9Tibea.js","assets/test-tube-DuTInDo7.js","assets/VoiceOverlay-D2N-c76K.js","assets/volume-2-B6qThcBF.js","assets/folder-65U1Euur.js","assets/shield-check-uMK1alGs.js","assets/bot-Cv-edYov.js","assets/TitanCanvas-BfitWg9R.css","assets/LogsPanel-XfC4fyQ6.js","assets/TelemetryPanel-BEEWcoNE.js","assets/git-branch-D6YV_OC1.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as t,j as e,_ as a}from"./index-BslUQuVl.js";import{c as i}from"./clsx-B-dksMZM.js";const r=t.lazy(()=>a(()=>import("./HomelabPanel-CxkWfeeN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),d=t.lazy(()=>a(()=>import("./NvidiaPanel-CiB9Nlbq.js"),__vite__mapDeps([17,1,2,8,18,14,19,20]))),n=t.lazy(()=>a(()=>import("./FilesPanel-B5RpGquX.js"),__vite__mapDeps([21,1,2,22,8,4,23,9,24,25,18,26,27,28,29,30,11,13,31,32,33,20,34,10,35,36,37,38,39,40,41,42,43,19,44,15,45]))),c=t.lazy(()=>a(()=>import("./LogsPanel-XfC4fyQ6.js"),__vite__mapDeps([46,1,2,8]))),m=t.lazy(()=>a(()=>import("./TelemetryPanel-BEEWcoNE.js"),__vite__mapDeps([47,1,2,5,9,48,12,11]))),x=[{id:"homelab",label:"Homelab"},{id:"gpu",label:"GPU / NVIDIA"},{id:"files",label:"Files"},{id:"logs",label:"Logs"},{id:"telemetry",label:"Telemetry"}];function p(){const[l,o]=t.useState("homelab");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"shrink-0 px-5 pt-4 pb-0",children:[e.jsx("h1",{className:"text-sm font-semibold text-text mb-3",children:"Infrastructure"}),e.jsx("div",{className:"flex items-center gap-0.5 border-b border-border/50",children:x.map(s=>e.jsxs("button",{onClick:()=>o(s.id),className:i("px-3 py-2 text-xs font-medium transition-colors relative",l===s.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[s.label,l===s.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},s.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(t.Suspense,{fallback:e.jsx("div",{className:"skeleton-shimmer h-40 rounded-lg"}),children:[l==="homelab"&&e.jsx(r,{}),l==="gpu"&&e.jsx(d,{}),l==="files"&&e.jsx(n,{}),l==="logs"&&e.jsx(c,{}),l==="telemetry"&&e.jsx(m,{})]})})]})}export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e,i as F,an as T,E as I,a8 as S,b as C,V as U,a9 as K}from"./index-BslUQuVl.js";import{P as A}from"./plug-C3Ecy-Ji.js";import{C as R}from"./circle-check-big-BBQqeCVt.js";import{S as O}from"./save-Bk90yLic.js";import{C as q}from"./chevron-right-DfToq0aQ.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 P({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 M({provider:a,configured:b,currentUrl:o,onSave:p,saving:v}){const[f,y]=l.useState(!1),[c,d]=l.useState(a.fieldType==="url"&&o||""),[x,u]=l.useState(!1),h=a.fieldType==="key",i=v===a.id;return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary",children:[e.jsxs("button",{onClick:()=>y(!f),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:[f?e.jsx(U,{className:"h-4 w-4 text-text-muted"}):e.jsx(q,{className:"h-4 w-4 text-text-muted"}),e.jsx("span",{className:"text-sm font-medium text-text",children:a.label})]}),e.jsx(P,{configured:b})]}),f&&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:h?"API Key":"Base URL"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`integration-${a.id}`,name:`integration-${a.id}`,type:h&&!x?"password":"text",value:c,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"}),h&&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(T,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>p(a.fieldKey,c),disabled:i||!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(O,{className:"h-3.5 w-3.5"}),i?"Saving...":"Save"]})})]})]})}function J(){const[a,b]=l.useState({}),[o,p]=l.useState({clientIdSet:!1,clientSecretSet:!1}),[v,f]=l.useState(!0),[y,c]=l.useState(null),[d,x]=l.useState(null),[u,h]=l.useState(""),[i,j]=l.useState(""),[N,G]=l.useState(!1);l.useEffect(()=>{(async()=>{var t;try{const n=await S();if(n.providers&&b(n.providers),(t=n.oauth)!=null&&t.google){const g=n.oauth.google;try{const r=await(await C("/api/auth/google/status")).json();g.connected=r.connected,g.email=r.email}catch{}p(g)}}catch{}finally{f(!1)}})()},[]);const E=()=>{window.location.href="/api/auth/google/start"},D=async()=>{try{await C("/api/auth/google/disconnect",{method:"POST"}),p(s=>({...s,connected:!1,email:void 0})),m("success","Google account disconnected")}catch{m("error","Failed to disconnect")}},m=(s,t)=>{x({type:s,message:t}),setTimeout(()=>x(null),3e3)},$=async(s,t)=>{var g,w;const n=((g=k.find(r=>r.fieldKey===s))==null?void 0:g.id)||s;c(n);try{await K({[s]:t});const r=await S();r.providers&&b(r.providers),m("success",`${((w=k.find(B=>B.fieldKey===s))==null?void 0:w.label)||"Provider"} saved`)}catch(r){m("error",r instanceof Error?r.message:"Failed to save")}finally{c(null)}},L=async()=>{var s;c("oauth");try{const t={};u&&(t.googleOAuthClientId=u),i&&(t.googleOAuthClientSecret=i),await K(t);const n=await S();(s=n.oauth)!=null&&s.google&&p(n.oauth.google),m("success","Google OAuth settings saved"),h(""),j("")}catch(t){m("error",t instanceof Error?t.message:"Failed to save")}finally{c(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.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-accent/10",children:e.jsx(A,{className:"h-4 w-4 text-accent-hover"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-text",children:"Integrations"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Configure LLM providers and external service connections"})]})]}),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(F,{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],n=s.id==="ollama"?!!(t!=null&&t.baseUrl):!!(t!=null&&t.configured);return e.jsx(M,{provider:s,configured:n,currentUrl:s.fieldType==="url"?(t==null?void 0:t.baseUrl)||"":void 0,onSave:$,saving:y},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(P,{configured:!!o.connected}),o.clientIdSet&&!o.connected&&e.jsxs("button",{onClick:E,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(A,{className:"h-3.5 w-3.5"}),"Connect Google"]}),o.connected&&e.jsx("button",{onClick:D,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=>h(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:i,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:()=>G(!N),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:N?e.jsx(T,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:L,disabled:y==="oauth"||!u&&!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(O,{className:"h-3.5 w-3.5"}),y==="oauth"?"Saving...":"Save OAuth Settings"]})})]})]})]})}export{J as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AutopilotPanel-CjrYEF2s.js","assets/index-BslUQuVl.js","assets/index-DmgXt1oB.css","assets/PageHeader-BQEb_uAl.js","assets/chevron-right-DfToq0aQ.js","assets/WorkflowsPanel-BYtLGQVm.js","assets/Input-C6OxbFDH.js","assets/clsx-B-dksMZM.js","assets/InlineEditableField-BuXVLQiL.js","assets/check-DbgTEg8O.js","assets/pencil-D5LooNFk.js","assets/refresh-cw-BHphkMjv.js","assets/plus-BtmCDNeU.js","assets/play-6W8amqUG.js","assets/pause-CxvyFedA.js","assets/trash-2-2Qmp8Fyr.js","assets/clock-BvWNugZo.js","assets/toggle-right-j4jgj1NQ.js","assets/book-open-CZxMkLs8.js","assets/LearningPanel-DHQSZZGb.js","assets/lightbulb-BEx7BdxD.js","assets/TitanCanvas-LWyPGpf5.js","assets/chevron-up-DMS2Tjip.js","assets/file-text-rkojc4Uq.js","assets/server-CSOB40Ah.js","assets/network-DxIkmFJR.js","assets/terminal-lIpm0q0K.js","assets/save-Bk90yLic.js","assets/rotate-ccw-DQzGCkVc.js","assets/search-DxM6zcDJ.js","assets/send-ChZ5Hsne.js","assets/message-square-BEGY8pHF.js","assets/mic-CGj6cLoV.js","assets/flask-conical-BtbE3rIA.js","assets/archive-BSupLPZM.js","assets/radio-Bl9Tibea.js","assets/test-tube-DuTInDo7.js","assets/VoiceOverlay-D2N-c76K.js","assets/volume-2-B6qThcBF.js","assets/folder-65U1Euur.js","assets/shield-check-uMK1alGs.js","assets/external-link-8Pnd2MvS.js","assets/bot-Cv-edYov.js","assets/wifi-off-BX5XYuML.js","assets/TitanCanvas-BfitWg9R.css","assets/trending-up-BydxQces.js","assets/MemoryGraphPanel-BBxgK2Lo.js","assets/SelfImprovePanel-C-ylXP-k.js","assets/circle-check-big-BBQqeCVt.js","assets/trophy-B8Fq83wO.js","assets/PersonasPanel-CxDpp_3j.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as o,j as e,_ as t}from"./index-BslUQuVl.js";import{c as a}from"./clsx-B-dksMZM.js";const i=o.lazy(()=>t(()=>import("./AutopilotPanel-CjrYEF2s.js"),__vite__mapDeps([0,1,2,3,4]))),n=o.lazy(()=>t(()=>import("./WorkflowsPanel-BYtLGQVm.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-DHQSZZGb.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]))),c=o.lazy(()=>t(()=>import("./MemoryGraphPanel-BBxgK2Lo.js"),__vite__mapDeps([46,1,2,25,11,15,29]))),m=o.lazy(()=>t(()=>import("./SelfImprovePanel-C-ylXP-k.js"),__vite__mapDeps([47,1,2,11,48,16,49,45,42,4,13,26,35,15]))),x=o.lazy(()=>t(()=>import("./PersonasPanel-CxDpp_3j.js"),__vite__mapDeps([50,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-BslUQuVl.js";import{P as f}from"./PageHeader-BQEb_uAl.js";import{R as N}from"./refresh-cw-BHphkMjv.js";import{B as u}from"./book-open-CZxMkLs8.js";import{L as v}from"./lightbulb-BEx7BdxD.js";import{D as y}from"./TitanCanvas-LWyPGpf5.js";import{T as C}from"./trending-up-BydxQces.js";import"./chevron-right-DfToq0aQ.js";import"./chevron-up-DMS2Tjip.js";import"./plus-BtmCDNeU.js";import"./file-text-rkojc4Uq.js";import"./server-CSOB40Ah.js";import"./network-DxIkmFJR.js";import"./terminal-lIpm0q0K.js";import"./save-Bk90yLic.js";import"./pencil-D5LooNFk.js";import"./rotate-ccw-DQzGCkVc.js";import"./search-DxM6zcDJ.js";import"./send-ChZ5Hsne.js";import"./message-square-BEGY8pHF.js";import"./mic-CGj6cLoV.js";import"./flask-conical-BtbE3rIA.js";import"./clock-BvWNugZo.js";import"./archive-BSupLPZM.js";import"./radio-Bl9Tibea.js";import"./test-tube-DuTInDo7.js";import"./VoiceOverlay-D2N-c76K.js";import"./volume-2-B6qThcBF.js";import"./folder-65U1Euur.js";import"./check-DbgTEg8O.js";import"./shield-check-uMK1alGs.js";import"./external-link-8Pnd2MvS.js";import"./bot-Cv-edYov.js";import"./wifi-off-BX5XYuML.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:r,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:r}),o&&e.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:o})]})}function ie(){const[t,d]=i.useState(null),[r,l]=i.useState(null),[o,b]=i.useState(null),[h,x]=i.useState(!0),p=()=>{x(!0),Promise.all([m("/api/learning").then(s=>s.ok?s.json():null).catch(()=>null),m("/api/stats").then(s=>s.ok?s.json():null).catch(()=>null),m("/api/graphiti").then(s=>s.ok?s.json():null).catch(()=>null)]).then(([s,c,n])=>{d(s),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((s,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"})]})]}),r&&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(r.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:r.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(r.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:[r.memoryMB,"MB"]})]})]})]})]})}export{ie as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,aQ as v,j as e}from"./index-BslUQuVl.js";import{R as j}from"./refresh-cw-BHphkMjv.js";const x={debug:"bg-text-muted/20 text-text-secondary",info:"bg-info/20 text-info",warn:"bg-warning/20 text-warning",warning:"bg-warning/20 text-warning",error:"bg-error/20 text-error"};function w(){const[c,u]=r.useState([]),[g,m]=r.useState(!0),[i,d]=r.useState(null),[a,b]=r.useState(""),[o,h]=r.useState(100),[l,p]=r.useState(!1),s=r.useRef(null),n=r.useCallback(async()=>{try{const t=await v(a||void 0,o);u(t),d(null)}catch(t){d(t instanceof Error?t.message:"Failed to fetch logs")}finally{m(!1)}},[a,o]);return r.useEffect(()=>{n()},[n]),r.useEffect(()=>(l?s.current=setInterval(n,5e3):s.current&&(clearInterval(s.current),s.current=null),()=>{s.current&&clearInterval(s.current)}),[l,n]),g?e.jsx("div",{className:"h-96 animate-pulse rounded-xl border border-border bg-bg-secondary"}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-text",children:"Logs"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("select",{value:a,onChange:t=>b(t.target.value),className:"rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent",children:[e.jsx("option",{value:"",children:"All levels"}),e.jsx("option",{value:"debug",children:"Debug"}),e.jsx("option",{value:"info",children:"Info"}),e.jsx("option",{value:"warn",children:"Warn"}),e.jsx("option",{value:"error",children:"Error"})]}),e.jsxs("select",{value:o,onChange:t=>h(Number(t.target.value)),className:"rounded-lg border border-border bg-bg px-3 py-2 text-sm text-text outline-none focus:border-accent",children:[e.jsx("option",{value:50,children:"50 entries"}),e.jsx("option",{value:100,children:"100 entries"}),e.jsx("option",{value:200,children:"200 entries"})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-text-secondary",children:[e.jsx("input",{type:"checkbox",checked:l,onChange:t=>p(t.target.checked),className:"h-4 w-4 rounded border-border accent-accent"}),"Auto-refresh (5s)"]}),e.jsx("button",{onClick:n,className:"ml-auto rounded-lg p-2 text-text-secondary transition-colors hover:bg-bg-tertiary hover:text-text",title:"Refresh",children:e.jsx(j,{className:"h-4 w-4"})})]}),i&&e.jsx("div",{className:"rounded-lg border border-error/50 bg-bg-secondary px-4 py-2 text-sm text-error",children:i}),e.jsx("div",{className:"max-h-[600px] overflow-y-auto rounded-xl border border-border bg-bg-secondary",children:c.length===0?e.jsx("p",{className:"px-4 py-12 text-center text-text-muted",children:"No logs found"}):e.jsx("div",{className:"divide-y divide-border",children:c.map((t,f)=>e.jsxs("div",{className:"flex items-start gap-3 px-4 py-2.5",children:[e.jsx("span",{className:"shrink-0 font-mono text-xs text-text-muted",children:new Date(t.timestamp).toLocaleTimeString()}),e.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-xs font-medium uppercase ${x[t.level]??x.debug}`,children:t.level}),e.jsx("span",{className:"min-w-0 break-all text-sm text-text",children:t.message})]},f))})})]})}export{w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,j as e,G as k,ah as z,ai as $,aj as b,ak as R,al as I,am as E}from"./index-BslUQuVl.js";import{P as h}from"./plug-C3Ecy-Ji.js";import{R as D}from"./refresh-cw-BHphkMjv.js";import{P as L}from"./plus-BtmCDNeU.js";import{S as g}from"./server-CSOB40Ah.js";import{T as G,P as B}from"./test-tube-DuTInDo7.js";import{T as F}from"./trash-2-2Qmp8Fyr.js";function O(){const[o,j]=d.useState([]),[N,y]=d.useState([]),[f,x]=d.useState(!0),[m,c]=d.useState(!1),[v,p]=d.useState(null),[l,i]=d.useState(null),[s,a]=d.useState({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n=async()=>{x(!0);try{const[t,r]=await Promise.all([z(),$()]);j(t),y(r)}catch{}x(!1)};d.useEffect(()=>{n()},[]);const C=async()=>{try{await b({id:s.id,name:s.name,description:s.description,type:s.type,...s.type==="stdio"?{command:s.command,args:s.args.split(/\s+/).filter(Boolean)}:{url:s.url}}),c(!1),a({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n()}catch(t){alert(t.message)}},P=async t=>{try{await b({presetId:t}),n()}catch(r){alert(r.message)}},w=async t=>{confirm(`Remove MCP server "${t}"?`)&&(await E(t),n())},M=async(t,r)=>{await I(t,r),n()},T=async t=>{p(t),i(null);try{const r=await R(t);i({id:t,...r})}catch(r){i({id:t,ok:!1,tools:0,error:r.message})}p(null)},S=t=>t==="connected"?"text-[var(--success)]":t==="error"?"text-[var(--error)]":"text-[var(--text-muted)]",A=t=>t==="connected"?"bg-[var(--success)]":t==="error"?"bg-[var(--error)]":"bg-[var(--text-muted)]",u=N.filter(t=>!o.some(r=>r.id===t.id));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-6 h-6 text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-[var(--text)]",children:"MCP Connections"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connect to external tools via Model Context Protocol"})]})]}),e.jsxs("div",{className:"flex gap-2",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:o.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:o.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:o.reduce((t,r)=>t+r.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"}),u.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:u.map(t=>e.jsxs("button",{onClick:()=>P(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:s.id,onChange:t=>a({...s,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:s.name,onChange:t=>a({...s,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:s.description,onChange:t=>a({...s,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:s.type,onChange:t=>a({...s,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)"})]})]}),s.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:s.command,onChange:t=>a({...s,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:s.args,onChange:t=>a({...s,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:s.url,onChange:t=>a({...s,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:C,disabled:!s.id||!s.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"})]})]}),f?e.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading MCP servers..."}):o.length===0?e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-8 text-center",children:[e.jsx(h,{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:o.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(k,{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 ${A(t.status)}`}),e.jsx("span",{className:S(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:()=>T(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:()=>M(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(B,{size:14})}),e.jsx("button",{onClick:()=>w(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(F,{size:14})})]})]}),(l==null?void 0:l.id)===t.id&&e.jsx("div",{className:`mt-3 px-3 py-2 rounded-md text-xs ${l.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:l.ok?`Connected successfully — ${l.tools} tools discovered`:`Connection failed: ${l.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{O as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as ye,r as j,b as be,j as o,X as Se}from"./index-BslUQuVl.js";import{N as ve}from"./network-DxIkmFJR.js";import{R as Ce}from"./refresh-cw-BHphkMjv.js";import{T as ke}from"./trash-2-2Qmp8Fyr.js";import{S as $e}from"./search-DxM6zcDJ.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 ze=[["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"}]],Le=ye("maximize-2",ze);/**
|
|
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 Re=[["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"}]],Pe=ye("zoom-in",Re);/**
|
|
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 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:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Ee=ye("zoom-out",Te),we={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"},Ie={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"},je=["#f0abfc","#86efac","#fda4af","#7dd3fc","#d9f99d","#fcd34d"];function se(n){const g=n==null?void 0:n.toLowerCase();if(we[g])return we[g];let z=0;for(let P=0;P<((g==null?void 0:g.length)??0);P++)z=(z<<5)-z+g.charCodeAt(P)|0;return je[Math.abs(z)%je.length]}function Me(n){const g=parseInt(n.slice(1),16);return[g>>16&255,g>>8&255,g&255]}function Fe(n,g,z,P){var me,K,_;const S=n.length;if(S===0)return;const q=z/2,h=P/2,C=new Map;for(let d=0;d<S;d++){const $=((me=n[d].type)==null?void 0:me.toLowerCase())??"unknown";C.has($)||C.set($,[]),C.get($).push(d)}const T=[...C.keys()],k=new Map,v=Math.min(z,P)*.3;for(let d=0;d<T.length;d++){const $=d/T.length*Math.PI*2-Math.PI/2;k.set(T[d],{x:q+Math.cos($)*v,y:h+Math.sin($)*v})}for(let d=0;d<S;d++){const $=n[d];if($.x!==void 0)continue;const V=k.get(((K=$.type)==null?void 0:K.toLowerCase())??"unknown")??{x:q,y:h},J=Math.min(z,P)*.12;$.x=V.x+(Math.random()-.5)*J,$.y=V.y+(Math.random()-.5)*J,$.vx=0,$.vy=0}const G=new Map(n.map(d=>[d.id,d])),W=Math.sqrt(S/50),le=Math.min(200,Math.max(80,Math.round(60+S*.2))),ne=4e3*W,fe=.003/W,O=.003/W,de=.015,Y=new Map;for(const d of g)Y.has(d.from)||Y.set(d.from,new Set),Y.has(d.to)||Y.set(d.to,new Set),Y.get(d.from).add(d.to),Y.get(d.to).add(d.from);for(let d=0;d<le;d++){const $=.9-d/le*.35,V=d/le;if(S>200)for(let l=0;l<S;l++){const u=n[l],t=Y.get(u.id)??new Set;for(let e=l+1;e<S;e++){if(!t.has(n[e].id)&&Math.random()>.2)continue;const s=n[e];let c=u.x-s.x,r=u.y-s.y;const i=c*c+r*r,x=Math.sqrt(i)||1,L=ne/(i+100),f=c/x*L,y=r/x*L;u.vx+=f,u.vy+=y,s.vx-=f,s.vy-=y}}else for(let l=0;l<S;l++)for(let u=l+1;u<S;u++){const t=n[l],e=n[u];let s=t.x-e.x,c=t.y-e.y;const r=s*s+c*c,i=Math.sqrt(r)||1,x=ne/(r+100),L=s/i*x,f=c/i*x;t.vx+=L,t.vy+=f,e.vx-=L,e.vy-=f}for(const l of g){const u=G.get(l.from),t=G.get(l.to);if(!u||!t)continue;const e=t.x-u.x,s=t.y-u.y,c=Math.sqrt(e*e+s*s)||1,r=c*fe,i=e/c*r,x=s/c*r;u.vx+=i,u.vy+=x,t.vx-=i,t.vy-=x}const J=de*(1-V*.5);for(const l of n){const u=k.get(((_=l.type)==null?void 0:_.toLowerCase())??"unknown");u&&(l.vx+=(u.x-l.x)*J,l.vy+=(u.y-l.y)*J)}for(const l of n)l.vx+=(q-l.x)*O,l.vy+=(h-l.y)*O;const re=40;for(const l of n)l.vx*=$,l.vy*=$,l.x+=l.vx,l.y+=l.vy,l.x=Math.max(re,Math.min(z-re,l.x)),l.y=Math.max(re,Math.min(P-re,l.y))}}function Ae(n,g,z,P,S){const q=(n+z)/2,h=(g+P)/2,C=z-n,k=-(P-g),v=C,G=Math.sqrt(k*k+v*v)||1;return{cx:q+k/G*S,cy:h+v/G*S}}function qe(n,g,z,P,S,q,h){const C=Math.atan2(z-S,g-P),T=8,k=g-Math.cos(C)*q,v=z-Math.sin(C)*q;n.beginPath(),n.moveTo(k,v),n.lineTo(k-Math.cos(C-Math.PI/6)*T,v-Math.sin(C-Math.PI/6)*T),n.lineTo(k-Math.cos(C)*T*.5,v-Math.sin(C)*T*.5),n.lineTo(k-Math.cos(C+Math.PI/6)*T,v-Math.sin(C+Math.PI/6)*T),n.closePath(),n.fillStyle=h,n.fill()}function Ge(){const[n,g]=j.useState(null),[z,P]=j.useState(!0),[S,q]=j.useState(null),[h,C]=j.useState(null),[T,k]=j.useState(null),[v,G]=j.useState(""),[W,le]=j.useState(new Set),ne=j.useRef(null),fe=j.useRef(null),O=j.useRef({x:0,y:0,zoom:1,dragging:!1,startX:0,startY:0}),de=j.useRef(0),Y=j.useRef(0),me=j.useRef(new Map),K=j.useCallback(async()=>{var t;try{const e=await be("/api/graphiti",{headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error(`${e.status}: ${e.statusText}`);const s=await e.json();if((t=s.nodes)!=null&&t.length){const c=fe.current,r=(c==null?void 0:c.clientWidth)??1200,i=(c==null?void 0:c.clientHeight)??600;for(const x of s.nodes){const L=me.current.get(x.id);L&&(x.x=L.x,x.y=L.y)}Fe(s.nodes,s.edges??[],r,i);for(const x of s.nodes)x.x!==void 0&&x.y!==void 0&&me.current.set(x.id,{x:x.x,y:x.y})}g(s),q(null)}catch(e){q(e instanceof Error?e.message:"Failed to load graph"),g(null)}finally{P(!1)}},[]);j.useEffect(()=>{K()},[K]);const _=j.useMemo(()=>{if(!n)return{nodes:[],edges:[]};const t=v.toLowerCase().trim();let e=n.nodes;if(W.size>0&&(e=e.filter(r=>{var i;return!W.has((i=r.type)==null?void 0:i.toLowerCase())})),t){const r=new Set;for(const i of e)(i.label.toLowerCase().includes(t)||i.facts.some(x=>x.toLowerCase().includes(t)))&&r.add(i.id);for(const i of n.edges)r.has(i.from)&&r.add(i.to),r.has(i.to)&&r.add(i.from);e=e.filter(i=>r.has(i.id))}const s=new Set(e.map(r=>r.id)),c=(n.edges??[]).filter(r=>s.has(r.from)&&s.has(r.to));return{nodes:e,edges:c}},[n,v,W]),d=j.useMemo(()=>{if(!v.trim()||!n)return null;const t=v.toLowerCase().trim(),e=n.nodes.find(s=>s.label.toLowerCase().includes(t));return(e==null?void 0:e.id)??null},[v,n]),$=async()=>{if(confirm("Clear the entire memory graph? This cannot be undone."))try{await be("/api/graphiti",{method:"DELETE"}),K(),C(null)}catch{}},V=t=>{const e=O.current;e.zoom=Math.max(.2,Math.min(4,e.zoom*t)),k(s=>s)},J=()=>{O.current={x:0,y:0,zoom:1,dragging:!1,startX:0,startY:0},k(t=>t)},re=t=>{le(e=>{const s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})};j.useEffect(()=>{const t=ne.current;if(!t||!_.nodes.length)return;const e=t.getContext("2d");if(!e)return;const s=window.devicePixelRatio||1,c=t.getBoundingClientRect();t.width=c.width*s,t.height=c.height*s,e.scale(s,s);const r=c.width,i=c.height,{nodes:x,edges:L}=_,f=new Map(x.map(M=>[M.id,M])),y=()=>{Y.current++;const M=Y.current,m=O.current;e.clearRect(0,0,r,i);const B=e.createRadialGradient(r/2,i/2,0,r/2,i/2,r*.7);B.addColorStop(0,"#0c0c14"),B.addColorStop(1,"#09090b"),e.fillStyle=B,e.fillRect(0,0,r,i),e.fillStyle="rgba(255,255,255,0.02)";const E=35*m.zoom,ae=(m.x%E+E)%E,ue=(m.y%E+E)%E;for(let a=ae;a<r;a+=E)for(let A=ue;A<i;A+=E)e.fillRect(a,A,1,1);for(let a=0;a<15;a++){const A=(M*.15+a*127)%r,N=(M*.1+a*173)%i,w=.02+Math.sin(M*.008+a)*.01;e.beginPath(),e.arc(A,N,1,0,Math.PI*2),e.fillStyle=`rgba(99,102,241,${w})`,e.fill()}const ee=new Set,D=(h==null?void 0:h.id)??T??d;if(D){ee.add(D);for(const a of L)a.from===D&&ee.add(a.to),a.to===D&&ee.add(a.from)}const te=D!=null;for(const a of L){const A=f.get(a.from),N=f.get(a.to);if(!A||!N)continue;const w=te&&(a.from===D||a.to===D);if(te&&!w&&x.length>100)continue;const Z=A.x*m.zoom+m.x,Q=A.y*m.zoom+m.y,p=N.x*m.zoom+m.x,b=N.y*m.zoom+m.y;if(Z<-50&&p<-50||Q<-50&&b<-50||Z>r+50&&p>r+50||Q>i+50&&b>i+50)continue;const R=L.indexOf(a),ge=15+R%3*6,{cx:oe,cy:ce}=Ae(Z,Q,p,b,ge*(R%2===0?1:-1));if(w&&(e.beginPath(),e.moveTo(Z,Q),e.quadraticCurveTo(oe,ce,p,b),e.strokeStyle="rgba(99,102,241,0.12)",e.lineWidth=5,e.stroke()),e.beginPath(),e.moveTo(Z,Q),e.quadraticCurveTo(oe,ce,p,b),w){const F=se(A.type),[X,H,ie]=Me(F);e.strokeStyle=`rgba(${X},${H},${ie},0.5)`,e.lineWidth=1.8}else e.strokeStyle="rgba(100,116,139,0.04)",e.lineWidth=.5;if(e.stroke(),w){const F=Math.max(10,Math.min(24,N.size||14))*m.zoom;qe(e,p,b,oe,ce,F+3,"rgba(148,163,184,0.6)")}if(w&&a.label&&a.label!=="co_mentioned"){const X=.25*Z+.5*oe+.25*p,H=(1-.5)*(1-.5)*Q+2*(1-.5)*.5*ce+.5*.5*b;e.font=`${Math.max(9,10*m.zoom)}px "Inter", system-ui, sans-serif`;const ie=e.measureText(a.label).width+12;e.fillStyle="rgba(15,15,25,0.85)",e.beginPath(),e.roundRect(X-ie/2,H-11,ie,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(a.label,X,H)}}for(const a of x){const A=se(a.type),[N,w,I]=Me(A),Z=Math.max(8,Math.min(24,a.size||12)),Q=Math.sin(M*.025+a.id.charCodeAt(0)*.5)*1,p=(Z+Q)*m.zoom,b=a.x*m.zoom+m.x,R=a.y*m.zoom+m.y;if(b<-p*3||R<-p*3||b>r+p*3||R>i+p*3)continue;const ge=T===a.id,oe=(h==null?void 0:h.id)===a.id,ce=d===a.id,F=ge||oe||ce,X=te&&!ee.has(a.id);if(!X){const xe=F?.2:.05+Math.sin(M*.02+a.id.charCodeAt(0))*.015,he=F?p*3.5:p*2,U=e.createRadialGradient(b,R,p*.3,b,R,he);U.addColorStop(0,`rgba(${N},${w},${I},${xe})`),U.addColorStop(.5,`rgba(${N},${w},${I},${xe*.3})`),U.addColorStop(1,`rgba(${N},${w},${I},0)`),e.fillStyle=U,e.beginPath(),e.arc(b,R,he,0,Math.PI*2),e.fill()}const H=e.createRadialGradient(b-p*.3,R-p*.35,0,b,R,p);X?(H.addColorStop(0,`rgba(${N},${w},${I},0.06)`),H.addColorStop(1,`rgba(${N},${w},${I},0.02)`)):(H.addColorStop(0,`rgba(${N},${w},${I},${F?.45:.25})`),H.addColorStop(1,`rgba(${N},${w},${I},${F?.18:.07})`)),e.beginPath(),e.arc(b,R,p,0,Math.PI*2),e.fillStyle=H,e.fill(),e.beginPath(),e.arc(b,R,p,0,Math.PI*2),X?(e.strokeStyle=`rgba(${N},${w},${I},0.08)`,e.lineWidth=.5):F?(e.strokeStyle=`rgba(${N},${w},${I},0.9)`,e.lineWidth=2.5):(e.strokeStyle=`rgba(${N},${w},${I},0.4)`,e.lineWidth=1),e.stroke(),oe&&(e.beginPath(),e.arc(b,R,p+5,0,Math.PI*2),e.setLineDash([4,4]),e.lineDashOffset=-M*.3,e.strokeStyle=`rgba(${N},${w},${I},0.4)`,e.lineWidth=1,e.stroke(),e.setLineDash([]));const ie=a.facts.length>=3;if(!X&&(F||te&&ee.has(a.id)||m.zoom>=1.3||m.zoom>=.8&&ie)){const xe=m.zoom>1?20:12,he=a.label.length>xe?a.label.slice(0,xe-1)+"…":a.label,U=Math.max(9,11*m.zoom);e.font=`600 ${U}px "Inter", system-ui, sans-serif`;const pe=e.measureText(he).width+8;if(e.fillStyle="rgba(9,9,11,0.75)",e.beginPath(),e.roundRect(b-pe/2,R-U/2-1,pe,U+2,3),e.fill(),e.fillStyle=F?"#fafafa":"#a1a1aa",e.textAlign="center",e.textBaseline="middle",e.fillText(he,b,R),m.zoom>.7){const Ne=Math.max(7,8*m.zoom);e.font=`500 ${Ne}px "Inter", system-ui, sans-serif`,e.fillStyle=`rgba(${N},${w},${I},${F?.9:.5})`,e.fillText(a.type,b,R+p+Math.max(9,11*m.zoom))}}}de.current=requestAnimationFrame(y)};return de.current=requestAnimationFrame(y),()=>cancelAnimationFrame(de.current)},[_,T,h,d]),j.useEffect(()=>{const t=ne.current;if(!t||!_.nodes.length)return;const e=O.current,s=(f,y)=>{const M=t.getBoundingClientRect(),m=f-M.left,B=y-M.top;for(const E of[..._.nodes].reverse()){const ae=Math.max(8,Math.min(24,E.size||12))*e.zoom,ue=E.x*e.zoom+e.x,ee=E.y*e.zoom+e.y,D=m-ue,te=B-ee;if(D*D+te*te<=(ae+6)*(ae+6))return E}return null},c=f=>{f.preventDefault();const y=t.getBoundingClientRect(),M=f.clientX-y.left,m=f.clientY-y.top,B=e.zoom,E=f.deltaY>0?.92:1.08;e.zoom=Math.max(.2,Math.min(4,e.zoom*E)),e.x=M-(M-e.x)*(e.zoom/B),e.y=m-(m-e.y)*(e.zoom/B),k(ae=>ae)},r=f=>{e.dragging=!0,e.startX=f.clientX-e.x,e.startY=f.clientY-e.y,t.style.cursor="grabbing"},i=f=>{if(e.dragging)e.x=f.clientX-e.startX,e.y=f.clientY-e.startY,k(y=>y);else{const y=s(f.clientX,f.clientY);k((y==null?void 0:y.id)??null),t.style.cursor=y?"pointer":"grab"}},x=()=>{e.dragging=!1,t.style.cursor="grab"},L=f=>{if(e.dragging)return;const y=s(f.clientX,f.clientY);C(M=>(M==null?void 0:M.id)===(y==null?void 0:y.id)?null:y??null)};return t.addEventListener("wheel",c,{passive:!1}),t.addEventListener("mousedown",r),t.addEventListener("mousemove",i),t.addEventListener("mouseup",x),t.addEventListener("mouseleave",x),t.addEventListener("click",L),()=>{t.removeEventListener("wheel",c),t.removeEventListener("mousedown",r),t.removeEventListener("mousemove",i),t.removeEventListener("mouseup",x),t.removeEventListener("mouseleave",x),t.removeEventListener("click",L)}},[_]);const l=j.useMemo(()=>{var e;if(!n)return[];const t=new Map;for(const s of n.nodes){const c=((e=s.type)==null?void 0:e.toLowerCase())??"unknown";t.set(c,(t.get(c)??0)+1)}return[...t.entries()].sort((s,c)=>c[1]-s[1]).map(([s,c])=>({type:s,count:c}))},[n]);if(z)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=n&&n.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(ve,{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:()=>V(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(Pe,{className:"h-4 w-4"})}),o.jsx("button",{onClick:()=>V(.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(Ee,{className:"h-4 w-4"})}),o.jsx("button",{onClick:J,className:"rounded-lg p-1.5 text-text-muted hover:bg-bg-tertiary hover:text-text transition-colors",title:"Fit view",children:o.jsx(Le,{className:"h-4 w-4"})}),o.jsx("div",{className:"mx-1 h-4 w-px bg-bg-tertiary"})]}),o.jsxs("button",{onClick:K,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(Ce,{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(ke,{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:(n==null?void 0:n.nodeCount)??0,color:"var(--color-accent-hover)"},{label:"Relationships",value:(n==null?void 0:n.edgeCount)??0,color:"var(--color-cyan)"},{label:"Episodes",value:(n==null?void 0:n.episodeCount)??0,color:"var(--color-emerald)"}].map(({label:t,value:e,color:s})=>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:s},children:e.toLocaleString()}),e>0&&o.jsx("div",{className:"h-1.5 w-1.5 rounded-full animate-pulse",style:{backgroundColor:s}})]})]},t))}),u&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"relative",children:[o.jsx($e,{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=>G(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:()=>G(""),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-text-muted hover:text-text",children:o.jsx(Se,{className:"h-3.5 w-3.5"})})]}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:l.map(({type:t,count:e})=>{const s=se(t),c=W.has(t);return o.jsxs("button",{onClick:()=>re(t),className:`inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[11px] font-medium transition-all ${c?"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:c?"var(--color-border-light)":s}}),Ie[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:ne,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(O.current.zoom*100),"%"]}),(v||W.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 ",_.nodes.length," of ",(n==null?void 0:n.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(ve,{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."})]}),h&&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:se(h.type),boxShadow:`0 0 8px ${se(h.type)}40`}}),o.jsx("span",{className:"font-semibold text-text",children:h.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:h.type})]}),o.jsxs("div",{className:"space-y-3 p-4",children:[h.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:h.facts.map((t,e)=>o.jsx("p",{className:"text-xs text-[#d4d4d8] pl-3 border-l-2",style:{borderColor:se(h.type)+"40"},children:t},e))})]}),n&&(()=>{const t=n.edges.filter(s=>s.from===h.id||s.to===h.id);if(!t.length)return null;const e=new Map(n.nodes.map(s=>[s.id,s]));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((s,c)=>{const r=e.get(s.from===h.id?s.to:s.from),i=r?se(r.type):"#64748b";return o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"text-text-secondary",children:s.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:i}}),o.jsx("span",{className:"text-[#d4d4d8]",children:(r==null?void 0:r.label)??"?"})]})]},c)}),t.length>30&&o.jsxs("p",{className:"text-[10px] text-text-muted",children:["+ ",t.length-30," more"]})]})]})})()]})]})]})}export{Ge as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{c as l,r as n,j as e,ar as y,as as j,at as N,au as f,av as k}from"./index-BslUQuVl.js";import{D as v}from"./DataTable-YQ9l5Xab.js";import{R as w}from"./refresh-cw-BHphkMjv.js";import{S as P}from"./shield-check-uMK1alGs.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 C=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],R=l("shield-x",C);/**
|
|
7
|
-
* @license lucide-react v0.513.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const S=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],E=l("unplug",S);function _(){const[d,i]=n.useState([]),[o,x]=n.useState([]),[m,h]=n.useState(!0),[c,a]=n.useState(null),r=async()=>{try{const[s,t]=await Promise.all([y(),j()]);i(s),x(t),a(null)}catch(s){a(s instanceof Error?s.message:"Failed to fetch mesh data")}finally{h(!1)}};n.useEffect(()=>{r()},[]);const p=async s=>{try{await N(s),await r()}catch(t){a(t instanceof Error?t.message:"Failed to approve peer")}},g=async s=>{try{await f(s),await r()}catch(t){a(t instanceof Error?t.message:"Failed to reject peer")}},u=async s=>{try{await k(s),await r()}catch(t){a(t instanceof Error?t.message:"Failed to revoke peer")}},b=[{key:"nodeId",header:"Node ID",render:s=>e.jsx("span",{className:"font-mono text-xs",children:s.nodeId})},{key:"url",header:"URL"},{key:"status",header:"Status",render:s=>e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-success"}),e.jsx("span",{className:"capitalize",children:s.status})]})},{key:"connectedAt",header:"Connected At",render:s=>s.connectedAt?e.jsx("span",{children:new Date(s.connectedAt).toLocaleString()}):e.jsx("span",{className:"text-text-muted",children:"-"})},{key:"_actions",header:"",className:"w-16",render:s=>e.jsx("button",{onClick:t=>{t.stopPropagation(),u(s.id)},className:"rounded-md p-1.5 text-error transition-colors hover:bg-bg-tertiary",title:"Revoke peer",children:e.jsx(E,{className:"h-4 w-4"})})}];return m?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"}),e.jsx("div",{className:"h-48 animate-pulse rounded-xl border border-border bg-bg-secondary"})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-text",children:"Mesh Network"}),e.jsx("button",{onClick:r,className:"rounded-lg p-2 text-text-secondary transition-colors hover:bg-bg-tertiary hover:text-text",title:"Refresh",children:e.jsx(w,{className:"h-4 w-4"})})]}),c&&e.jsx("div",{className:"rounded-lg border border-error/50 bg-bg-secondary px-4 py-2 text-sm text-error",children:c}),e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-3 text-sm font-medium text-text-secondary",children:["Pending Requests (",o.length,")"]}),o.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-bg-secondary p-6 text-center text-text-muted",children:"No pending requests"}):e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:o.map(s=>e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsx("p",{className:"font-mono text-sm text-text",children:s.nodeId}),e.jsx("p",{className:"mt-1 text-xs text-text-secondary",children:s.url}),s.name&&e.jsx("p",{className:"mt-1 text-xs text-text-muted",children:s.name}),e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsxs("button",{onClick:()=>p(s.id),className:"flex items-center gap-1.5 rounded-lg bg-success px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-success/80",children:[e.jsx(P,{className:"h-3.5 w-3.5"}),"Approve"]}),e.jsxs("button",{onClick:()=>g(s.id),className:"flex items-center gap-1.5 rounded-lg bg-error px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-error/80",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),"Reject"]})]})]},s.id))})]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-3 text-sm font-medium text-text-secondary",children:["Connected Peers (",d.length,")"]}),e.jsx(v,{columns:b,data:d,emptyMessage:"No connected peers"})]})]})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,b as y,j as e,C as U,i as K,Z as O,A as B,h as E,a8 as G,a9 as T,an as D,E as L}from"./index-BslUQuVl.js";import{R as V}from"./refresh-cw-BHphkMjv.js";import{S as $}from"./save-Bk90yLic.js";import{C as M}from"./circle-check-big-BBQqeCVt.js";import{E as F}from"./external-link-8Pnd2MvS.js";import{S as H}from"./search-DxM6zcDJ.js";const _={enabled:!1,apiKey:"",cuopt:{enabled:!1,url:"http://localhost:5000"},asr:{enabled:!1,grpcUrl:"localhost:50051",healthUrl:"http://localhost:9000"},openshell:{enabled:!1,binaryPath:"openshell",policyPath:""}};function v({status:s}){const l={unknown:"bg-border-light",checking:"bg-[#eab308] animate-pulse",healthy:"bg-success",unhealthy:"bg-error"},d={unknown:"Not checked",checking:"Checking...",healthy:"Healthy",unhealthy:"Unreachable"};return e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-text-muted",children:[e.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l[s]}`}),d[s]]})}function f({title:s,description:l,icon:d,enabled:r,onToggle:h,children:p}){return e.jsxs("div",{className:`rounded-xl border bg-bg-secondary transition-colors ${r?"border-[#76b900]/30":"border-bg-tertiary"}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`flex h-9 w-9 items-center justify-center rounded-lg ${r?"bg-nvidia/15":"bg-bg-tertiary"}`,children:e.jsx(d,{className:`h-4.5 w-4.5 ${r?"text-nvidia":"text-text-muted"}`})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:s}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:l})]})]}),e.jsx("button",{onClick:h,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${r?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${r?"translate-x-6":"translate-x-1"}`})})]}),r&&e.jsx("div",{className:"border-t border-bg-tertiary px-5 py-4 space-y-3",children:p})]})}function u({id:s,label:l,value:d,onChange:r,placeholder:h,type:p="text",secret:x=!1}){const[m,b]=o.useState(!1);return e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:l}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:s,name:s,type:x&&!m?"password":p,value:d,onChange:n=>r(n.target.value),placeholder:h,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-[#76b900] transition-colors"}),x&&e.jsx("button",{type:"button",onClick:()=>b(!m),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:m?e.jsx(D,{className:"h-4 w-4"}):e.jsx(L,{className:"h-4 w-4"})})]})]})}function J(){const[s,l]=o.useState(_),[d,r]=o.useState(!0),[h,p]=o.useState(!1),[x,m]=o.useState(null),[b,n]=o.useState({cuopt:"unknown",asr:"unknown",nim:"unknown"}),[g,j]=o.useState(!1),N=o.useCallback((t,a)=>{m({type:t,message:a}),setTimeout(()=>m(null),3e3)},[]);o.useEffect(()=>{(async()=>{var a,c,w,S,k,A,I,C;try{const i=await G();i.nvidia&&(l({enabled:i.nvidia.enabled??!1,apiKey:"",cuopt:{enabled:((a=i.nvidia.cuopt)==null?void 0:a.enabled)??!1,url:((c=i.nvidia.cuopt)==null?void 0:c.url)??"http://localhost:5000"},asr:{enabled:((w=i.nvidia.asr)==null?void 0:w.enabled)??!1,grpcUrl:((S=i.nvidia.asr)==null?void 0:S.grpcUrl)??"localhost:50051",healthUrl:((k=i.nvidia.asr)==null?void 0:k.healthUrl)??"http://localhost:9000"},openshell:{enabled:((A=i.nvidia.openshell)==null?void 0:A.enabled)??!1,binaryPath:((I=i.nvidia.openshell)==null?void 0:I.binaryPath)??"openshell",policyPath:((C=i.nvidia.openshell)==null?void 0:C.policyPath)??""}}),j(i.nvidia.apiKeySet??!1))}catch{}finally{r(!1)}})()},[]);const P=o.useCallback(async()=>{if(s.cuopt.enabled){n(t=>({...t,cuopt:"checking"}));try{const a=await(await y("/api/nvidia/health/cuopt")).json();n(c=>({...c,cuopt:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,cuopt:"unhealthy"}))}}if(s.asr.enabled){n(t=>({...t,asr:"checking"}));try{const a=await(await y("/api/nvidia/health/asr")).json();n(c=>({...c,asr:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,asr:"unhealthy"}))}}if(g||s.apiKey){n(t=>({...t,nim:"checking"}));try{const a=await(await y("/api/nvidia/health/nim")).json();n(c=>({...c,nim:a.healthy?"healthy":"unhealthy"}))}catch{n(t=>({...t,nim:"unhealthy"}))}}},[s.cuopt.enabled,s.asr.enabled,g,s.apiKey]),R=async()=>{p(!0);try{const t={nvidia:{enabled:s.enabled,cuopt:s.cuopt,asr:s.asr,openshell:s.openshell}};s.apiKey&&(t.nvidia.apiKey=s.apiKey),await T(t),N("success","NVIDIA configuration saved"),s.apiKey&&(j(!0),l(a=>({...a,apiKey:""})))}catch(t){N("error",t instanceof Error?t.message:"Failed to save")}finally{p(!1)}};return d?e.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((t,a)=>e.jsx("div",{className:"h-20 animate-pulse rounded-xl border border-border bg-bg-secondary"},a))}):e.jsxs("div",{className:"space-y-6 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-nvidia/15",children:e.jsx(U,{className:"h-5 w-5 text-nvidia"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-text",children:"NVIDIA"}),e.jsx("p",{className:"text-xs text-text-muted",children:"GPU-accelerated AI services — NIM, cuOpt, Nemotron-ASR, OpenShell"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:P,className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary hover:bg-bg-tertiary transition-colors",children:[e.jsx(V,{className:"h-3.5 w-3.5"}),"Check Health"]}),e.jsxs("button",{onClick:R,disabled:h,className:"flex items-center gap-2 rounded-lg bg-nvidia px-4 py-1.5 text-xs font-medium text-black transition-colors hover:bg-nvidia/80 disabled:opacity-50",children:[e.jsx($,{className:"h-3.5 w-3.5"}),h?"Saving...":"Save"]})]})]}),x&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${x.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[x.type==="success"?e.jsx(M,{className:"h-4 w-4"}):e.jsx(K,{className:"h-4 w-4"}),x.message]}),e.jsx("div",{className:`rounded-xl border p-5 transition-colors ${s.enabled?"border-[#76b900]/30 bg-nvidia/5":"border-bg-tertiary bg-bg-secondary"}`,children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-medium text-text",children:"Enable NVIDIA Skills"}),e.jsxs("p",{className:"text-xs text-text-muted mt-0.5",children:["Load NVIDIA GPU-accelerated skills (cuOpt, AI-Q Research, etc.) when TITAN starts. Equivalent to setting ",e.jsx("code",{className:"text-nvidia/70 bg-nvidia/10 px-1 rounded",children:"TITAN_NVIDIA=1"})]})]}),e.jsx("button",{onClick:()=>l(t=>({...t,enabled:!t.enabled})),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${s.enabled?"bg-nvidia":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${s.enabled?"translate-x-6":"translate-x-1"}`})})]})}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(O,{className:"h-4 w-4 text-nvidia"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"NVIDIA NIM API"}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:"Cloud inference for Nemotron 3 Super and other NIM models"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{status:b.nim}),g&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Key configured"]})]})]}),e.jsx(u,{id:"nvidia-api-key",label:"API Key",value:s.apiKey,onChange:t=>l(a=>({...a,apiKey:t})),placeholder:g?"(configured — enter new key to replace)":"nvapi-...",secret:!0}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Get your key at"," ",e.jsxs("a",{href:"https://build.nvidia.com",target:"_blank",rel:"noopener noreferrer",className:"text-nvidia hover:underline inline-flex items-center gap-0.5",children:["build.nvidia.com ",e.jsx(F,{className:"h-2.5 w-2.5"})]})]})]}),e.jsxs(f,{title:"cuOpt Optimization",description:"GPU-accelerated routing, scheduling, and mathematical programming (MILP/LP/QP)",icon:B,enabled:s.cuopt.enabled,onToggle:()=>l(t=>({...t,cuopt:{...t.cuopt,enabled:!t.cuopt.enabled}})),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Service Status"}),e.jsx(v,{status:b.cuopt})]}),e.jsx(u,{id:"nvidia-cuopt-url",label:"cuOpt Server URL",value:s.cuopt.url,onChange:t=>l(a=>({...a,cuopt:{...a.cuopt,url:t}})),placeholder:"http://localhost:5000"}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Start cuOpt: ",e.jsx("code",{className:"bg-bg-tertiary px-1.5 py-0.5 rounded text-text-secondary",children:"docker compose -f docker-compose.nvidia.yml --profile cuopt up -d"})]})]}),e.jsxs(f,{title:"Nemotron-ASR Streaming",description:"NVIDIA speech recognition with 24ms median finalization — replaces faster-whisper for voice chat",icon:H,enabled:s.asr.enabled,onToggle:()=>l(t=>({...t,asr:{...t.asr,enabled:!t.asr.enabled}})),children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-text-muted",children:"Service Status"}),e.jsx(v,{status:b.asr})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{id:"nvidia-asr-grpc-url",label:"gRPC Address",value:s.asr.grpcUrl,onChange:t=>l(a=>({...a,asr:{...a.asr,grpcUrl:t}})),placeholder:"localhost:50051"}),e.jsx(u,{id:"nvidia-asr-health-url",label:"Health Check URL",value:s.asr.healthUrl,onChange:t=>l(a=>({...a,asr:{...a.asr,healthUrl:t}})),placeholder:"http://localhost:9000"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["Start ASR: ",e.jsx("code",{className:"bg-bg-tertiary px-1.5 py-0.5 rounded text-text-secondary",children:"docker compose -f docker-compose.nvidia.yml --profile asr up -d"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["VRAM: ~3-4 GB. Set ",e.jsx("code",{className:"bg-bg-tertiary px-1 rounded text-text-secondary",children:"STT_ENGINE=nemotron-asr"})," in voice agent env."]})]}),e.jsxs(f,{title:"OpenShell Sandbox",description:"NVIDIA secure sandbox runtime for code execution with declarative policy enforcement",icon:E,enabled:s.openshell.enabled,onToggle:()=>l(t=>({...t,openshell:{...t.openshell,enabled:!t.openshell.enabled}})),children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(u,{id:"nvidia-openshell-binary-path",label:"Binary Path",value:s.openshell.binaryPath,onChange:t=>l(a=>({...a,openshell:{...a.openshell,binaryPath:t}})),placeholder:"openshell"}),e.jsx(u,{id:"nvidia-openshell-policy-path",label:"Policy File Path (optional)",value:s.openshell.policyPath,onChange:t=>l(a=>({...a,openshell:{...a.openshell,policyPath:t}})),placeholder:"Auto-detected"})]}),e.jsxs("p",{className:"text-[10px] text-text-muted",children:["When enabled, code execution uses OpenShell instead of Docker. Set ",e.jsx("code",{className:"bg-bg-tertiary px-1 rounded text-text-secondary",children:'sandbox.engine: "openshell"'})," in config."]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:"VRAM Budget (RTX 5090, 32 GB)"}),e.jsxs("div",{className:"space-y-2",children:[[{label:"Nemotron 3 Nano 30B",vram:"~24 GB",note:"Full local inference"},{label:"Nemotron 3 Nano 4B",vram:"~3 GB",note:"Lightweight variant"},{label:"Nemotron-ASR",vram:"~3-4 GB",note:"Speech recognition"},{label:"cuOpt",vram:"~2-4 GB",note:"Optimization solver"}].map(({label:t,vram:a,note:c})=>e.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-text",children:t}),e.jsx("span",{className:"text-[10px] text-text-muted ml-2",children:c})]}),e.jsx("span",{className:"text-xs font-mono text-nvidia",children:a})]},t)),e.jsx("div",{className:"border-t border-bg-tertiary pt-2 mt-2",children:e.jsx("p",{className:"text-[10px] text-text-muted",children:"Recommended: Nano 4B + ASR + cuOpt = ~10 GB, leaving room for other models. Or use NIM cloud API for LLM inference (0 GB local)."})})]})]}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-2",children:"Quick Start"}),e.jsxs("div",{className:"space-y-2 text-xs text-text-muted",children:[e.jsx("p",{children:"Start all NVIDIA services:"}),e.jsx("code",{className:"block bg-bg border border-bg-tertiary rounded-lg px-3 py-2 text-text-secondary font-mono text-xs",children:"docker compose -f docker-compose.nvidia.yml --profile all up -d"}),e.jsx("p",{className:"mt-2",children:"Or start individual services:"}),e.jsxs("div",{className:"space-y-1 font-mono text-[10px] text-text-muted",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"cuopt:"})," --profile cuopt"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"asr:"})," --profile asr (includes Riva bridge)"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-nvidia",children:"voice:"})," --profile voice (ASR + bridge)"]})]})]})]})]})}export{J as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,D as i}from"./index-BslUQuVl.js";import{C as r}from"./chevron-right-DfToq0aQ.js";function h({title:n,subtitle:l,breadcrumbs:t,actions:a}){return e.jsxs("div",{className:"mb-4 md:mb-6",children:[t&&t.length>0&&e.jsx("nav",{className:"mb-2 flex items-center gap-1 text-[10px] md:text-xs text-text-muted overflow-x-auto scrollbar-thin pb-1",children:t.map((s,x)=>e.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[x>0&&e.jsx(r,{size:12,className:"opacity-50 flex-shrink-0"}),s.href?e.jsx(i,{to:s.href,className:"hover:text-text transition-colors whitespace-nowrap",children:s.label}):e.jsx("span",{className:x===t.length-1?"text-text-secondary whitespace-nowrap":"",children:s.label})]},x))}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg md:text-xl font-semibold text-text",children:n}),l&&e.jsx("p",{className:"mt-0.5 text-[11px] md:text-sm text-text-muted",children:l})]}),a&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:a})]})]})}export{h as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,a8 as Je,b as p,j as e,B as Ve,A as he,i as We,C as Ge,W as He,V as I,S as be,Z as ge,l as Pe,a9 as Ke}from"./index-BslUQuVl.js";import{R as k}from"./refresh-cw-BHphkMjv.js";import{C as je}from"./circle-check-big-BBQqeCVt.js";import{C as Ue}from"./clock-BvWNugZo.js";import{T as Ze}from"./trophy-B8Fq83wO.js";import{T as fe}from"./trending-up-BydxQces.js";import{B as ze}from"./bot-Cv-edYov.js";import{C as Q}from"./chevron-right-DfToq0aQ.js";import{P as ye}from"./play-6W8amqUG.js";import{T as Xe}from"./terminal-lIpm0q0K.js";import{R as Ye}from"./radio-Bl9Tibea.js";import{T as et}from"./trash-2-2Qmp8Fyr.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 B={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 ${B[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 ut(){var me,ue;const[j,B]=a.useState(null),[f,ve]=a.useState([]),[V,we]=a.useState([]),[h,Se]=a.useState([]),[r,ke]=a.useState(null),[Ce,Re]=a.useState(!0),[C,W]=a.useState(null),[R,G]=a.useState(null),[A,_e]=a.useState(!1),[N,Te]=a.useState(!0),[i,H]=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([]),[x,De]=a.useState(null),[P,K]=a.useState(!1),[U,Z]=a.useState(!1),[z,X]=a.useState(!1),[g,Y]=a.useState([]),[S,Be]=a.useState(!0),[Ae,_]=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),[q,ae]=a.useState(120),[M,re]=a.useState(!1),[$,ne]=a.useState(!1),[le,ie]=a.useState([]),[xe,ce]=a.useState(0),m=a.useCallback((t,s)=>{G({type:t,message:s}),setTimeout(()=>G(null),3e3)},[]),y=a.useCallback(async()=>{try{const s=(await Je()).selfImprove||{};B(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 c=s.schedule||["0 2 * * *"],o=J.findIndex(n=>JSON.stringify(n.value)===JSON.stringify(c));ce(o>=0?o:0);try{const n=await p("/api/self-improve/history");if(n.ok){const d=await n.json();ve(d.sessions||[])}}catch{}try{const n=await p("/api/training/runs");if(n.ok){const d=await n.json();we(d.runs||[])}}catch{}try{const[n,d]=await Promise.all([p("/api/autoresearch/results"),p("/api/autoresearch/performance")]);if(n.ok){const l=await n.json();Se(l.runs||[])}if(d.ok){const l=await d.json();ke(l)}}catch{}try{const[n,d]=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(d.ok){const l=await d.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=new EventSource("/api/training/stream");return ee.current=t,t.onopen=()=>_(!0),t.onerror=()=>_(!1),t.onmessage=s=>{try{const c=JSON.parse(s.data);if(c.type==="connected"){_(!0);return}Y(o=>{const n=[...o,c];return n.length>200?n.slice(-200):n})}catch{}},()=>{t.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 Ke({selfImprove:{runsPerDay:F,budgetMinutes:T,maxDailyBudgetMinutes:q,autoApply:M,pauseOnWeekends:$,areas:le,schedule:((t=J[xe])==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=>{W(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{W(null)}},Oe=t=>{ie(s=>s.includes(t)?s.filter(c=>c!==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:i})})).ok?m("success",`Training data generation started for ${i==="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)}},qe=async()=>{Z(!0);try{(await p("/api/autoresearch/trigger",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:i,config:u})})).ok?m("success",`Training started for ${i==="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)}},Ie=async()=>{X(!0);try{(await p("/api/autoresearch/deploy",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:i})})).ok?m("success",`Model deployed as ${i==="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.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-purple/10",children:e.jsx(Ve,{className:"h-4 w-4 text-purple-light"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-text",children:"Self-Improvement"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Autonomous optimization of prompts, tool selection, and response quality"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",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(We,{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?"+":"",c=t>=0?"text-success":"text-error";return e.jsxs("p",{className:`text-[10px] mt-0.5 ${c}`,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(Ge,{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:()=>H("tool_router"),className:`rounded-xl border p-4 text-left transition-all ${i==="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 ${i==="tool_router"?"bg-purple/20":"bg-bg-tertiary"}`,children:e.jsx(He,{className:`h-3.5 w-3.5 ${i==="tool_router"?"text-purple-light":"text-text-muted"}`})}),e.jsx("span",{className:`text-sm font-medium ${i==="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:()=>H("main_agent"),className:`rounded-xl border p-4 text-left transition-all ${i==="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 ${i==="main_agent"?"bg-purple/20":"bg-bg-tertiary"}`,children:e.jsx(ze,{className:`h-3.5 w-3.5 ${i==="main_agent"?"text-purple-light":"text-text-muted"}`})}),e.jsx("span",{className:`text-sm font-medium ${i==="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: ",(x==null?void 0:x.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(I,{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:P,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:[P?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:qe,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:Ie,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(i==="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:()=>Be(!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(I,{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:[Ae?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(Pe,{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 c,o,n;const t=[...g].reverse().find(d=>{var l;return((l=d.detail)==null?void 0:l.pct)!==void 0});if(!t||t.type==="complete")return null;const s=((c=t.detail)==null?void 0:c.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 c={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=c[t.type]||"text-text-muted",d=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:d}),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(!A),className:"flex w-full items-center gap-2 text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:[A?e.jsx(I,{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"]}),A&&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:xe,onChange:t=>ce(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:[q," min"]})]}),e.jsx("input",{id:"schedule-max-daily-budget",name:"schedule-max-daily-budget",type:"range",min:30,max:480,step:30,value:q,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)})})]})})]}),V.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:V.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&&i==="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 c=Math.max(...h.map(l=>l.val_score),100),o=Math.min(...h.map(l=>l.val_score),0),n=c-o||1,d=(t.val_score-o)/n*100;return e.jsx("div",{className:"flex-1 rounded-t transition-all hover:opacity-80",style:{height:`${Math.max(d,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&&i==="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: ",(x==null?void 0:x.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 c=Math.max(...b.map(l=>l.val_score),100),o=Math.min(...b.map(l=>l.val_score),0),n=c-o||1,d=(t.val_score-o)/n*100;return e.jsx("div",{className:"flex-1 rounded-t transition-all hover:opacity-80",style:{height:`${Math.max(d,4)}%`,backgroundColor:(x==null?void 0:x.baseline)!=null?t.val_score>=x.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:(x==null?void 0:x.baseline)!=null?`baseline: ${x.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>=((x==null?void 0:x.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{ut as default};
|