titan-agent 5.1.2 → 5.2.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/README.md +7 -7
- package/dist/gateway/metrics.js +20 -1
- package/dist/gateway/metrics.js.map +1 -1
- package/dist/gateway/server.js +5 -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-B84Mp16G.js → AuditPanel-DLy0WJQZ.js} +1 -1
- package/ui/dist/assets/{AutonomyPanel-DOtiTFxV.js → AutonomyPanel-DjFAQGns.js} +1 -1
- package/ui/dist/assets/{AutopilotPanel-nTb1Dnru.js → AutopilotPanel-nBluaHA4.js} +1 -1
- package/ui/dist/assets/{AutoresearchPanel-D46mX8VF.js → AutoresearchPanel-BDy8y_Cs.js} +1 -1
- package/ui/dist/assets/{BackupPanel-DGM1XXbG.js → BackupPanel-B_Fv2pJA.js} +1 -1
- package/ui/dist/assets/{BrowserPanel-Cn1tTN3y.js → BrowserPanel-DOCT3-Rq.js} +1 -1
- package/ui/dist/assets/{CPAgents-CEraUkME.js → CPAgents-CpkHf0b8.js} +1 -1
- package/ui/dist/assets/{CPDashboard-B_yidGAe.js → CPDashboard-CnMd6qNK.js} +1 -1
- package/ui/dist/assets/{CPFiles-BBS8jtYH.js → CPFiles-BDRjJpYl.js} +1 -1
- package/ui/dist/assets/{CPGoals-DL5v21TZ.js → CPGoals-2DrwHk62.js} +1 -1
- package/ui/dist/assets/{CPInbox-CyLQJBYF.js → CPInbox-C6l2o4FD.js} +1 -1
- package/ui/dist/assets/{CPSocial-BkEtQ1Um.js → CPSocial-Cea6NptR.js} +1 -1
- package/ui/dist/assets/{ChannelsPanel-CD2kHhA5.js → ChannelsPanel-5EhhyXeg.js} +1 -1
- package/ui/dist/assets/{CheckpointsPanel-BrUTFPu_.js → CheckpointsPanel-BVt2oEUe.js} +1 -1
- package/ui/dist/assets/{CommandPostHub-BPPaUv1B.js → CommandPostHub-PXKE62DN.js} +3 -3
- package/ui/dist/assets/{CronPanel-CsfQctFp.js → CronPanel-lAsoKavq.js} +1 -1
- package/ui/dist/assets/{DaemonPanel-CNUggBbL.js → DaemonPanel-xt08Rs10.js} +1 -1
- package/ui/dist/assets/{DataTable-DuAEp_QJ.js → DataTable-BHOu7fZP.js} +1 -1
- package/ui/dist/assets/{EmptyState-DFrAEZDm.js → EmptyState-Dk7BBthD.js} +1 -1
- package/ui/dist/assets/EvalHarnessPanel-CJv8CUDy.js +1 -0
- package/ui/dist/assets/{EvalPanel-DEX0a5-b.js → EvalPanel-D9rDf1bk.js} +1 -1
- package/ui/dist/assets/{FilesPanel-DATsiAqG.js → FilesPanel-CNrDLmix.js} +1 -1
- package/ui/dist/assets/{FleetPanel-QYQKqx4W.js → FleetPanel-DP_ji0AE.js} +1 -1
- package/ui/dist/assets/{HomelabPanel-DhuXd3ZD.js → HomelabPanel-B4bCsrBw.js} +1 -1
- package/ui/dist/assets/{InfraView-eS7cpESw.js → InfraView-C5OYx_9s.js} +2 -2
- package/ui/dist/assets/{InlineEditableField-zIAnW4AR.js → InlineEditableField-DyBCbIoN.js} +1 -1
- package/ui/dist/assets/{Input-bFsLI0fq.js → Input-DWnbv1Yh.js} +1 -1
- package/ui/dist/assets/{IntegrationsPanel-C_FswSRN.js → IntegrationsPanel-DsB6hjvE.js} +1 -1
- package/ui/dist/assets/{IntelligenceView-smQ6aBwx.js → IntelligenceView-PIFGvIg_.js} +2 -2
- package/ui/dist/assets/{LearningPanel-BEgF_iND.js → LearningPanel-D_S4HFX5.js} +1 -1
- package/ui/dist/assets/{LogsPanel-Br1P8ST6.js → LogsPanel-BnWNREPX.js} +1 -1
- package/ui/dist/assets/{McpPanel-ByvQ12J_.js → McpPanel-CIMxZ2Am.js} +1 -1
- package/ui/dist/assets/{MemoryGraphPanel-BGOeSaET.js → MemoryGraphPanel-DD7x4rrm.js} +1 -1
- package/ui/dist/assets/{MemoryWikiPanel-CR8btd66.js → MemoryWikiPanel-BPPVAH0b.js} +1 -1
- package/ui/dist/assets/{MeshPanel-BjkcSOMz.js → MeshPanel-CiuwR3oV.js} +1 -1
- package/ui/dist/assets/{NvidiaPanel-NYt42w7L.js → NvidiaPanel-DVntoRrH.js} +1 -1
- package/ui/dist/assets/{OrganismPanel-PHvISvVn.js → OrganismPanel-pqIKtHrW.js} +1 -1
- package/ui/dist/assets/{OverviewPanel-q35zdMr6.js → OverviewPanel-gqYRhmpF.js} +1 -1
- package/ui/dist/assets/{PageHeader-Cwn3OALc.js → PageHeader-CF75km05.js} +1 -1
- package/ui/dist/assets/{PaperclipPanel-BDpQki0d.js → PaperclipPanel-CwN5-cKg.js} +1 -1
- package/ui/dist/assets/{PersonasPanel-DxrGW5C4.js → PersonasPanel-ClC_TTGX.js} +1 -1
- package/ui/dist/assets/{RecipesPanel-CYRdBx5u.js → RecipesPanel-Di2l-eOe.js} +1 -1
- package/ui/dist/assets/{SecurityPanel-i1QMctV0.js → SecurityPanel-DjC4pXGM.js} +1 -1
- package/ui/dist/assets/{SelfImprovePanel-DbybAZWp.js → SelfImprovePanel-CNpCp5N4.js} +1 -1
- package/ui/dist/assets/{SelfProposalsPanel-DtcTUDDd.js → SelfProposalsPanel-BJL6Fjxo.js} +1 -1
- package/ui/dist/assets/{SessionsPanel-B7QmOizR.js → SessionsPanel-EAGKDQp0.js} +1 -1
- package/ui/dist/assets/{SessionsTab-BdJj_vsI.js → SessionsTab-tc0njI15.js} +1 -1
- package/ui/dist/assets/{SettingsPanel-DnEvJUFe.js → SettingsPanel-BdSGImIa.js} +1 -1
- package/ui/dist/assets/{SettingsView-C39dk_yr.js → SettingsView-DQB64bjy.js} +2 -2
- package/ui/dist/assets/{SkeletonLoader-CsiR8ED9.js → SkeletonLoader-P8SFCyGi.js} +1 -1
- package/ui/dist/assets/{SkillsPanel-DM4qBFDS.js → SkillsPanel-lDMl_8da.js} +1 -1
- package/ui/dist/assets/{SomaView-CWnPKEQI.js → SomaView-BG7YvBu2.js} +1 -1
- package/ui/dist/assets/{StatCard-CY8lgeWm.js → StatCard-Cv2u-yqA.js} +1 -1
- package/ui/dist/assets/{StatusBadge-CGvKbP7R.js → StatusBadge-JJeoEdCm.js} +1 -1
- package/ui/dist/assets/{TeamsPanel-Bf6GaUni.js → TeamsPanel-D-iCyyYd.js} +1 -1
- package/ui/dist/assets/{TelemetryPanel-JZ90gJXC.js → TelemetryPanel-DHNFyCwn.js} +1 -1
- package/ui/dist/assets/{TitanCanvas-Hk49NFcA.js → TitanCanvas-BhurNMK3.js} +3 -3
- package/ui/dist/assets/ToolsView-C8sWxLny.js +2 -0
- package/ui/dist/assets/{Tooltip-CcoZrKsl.js → Tooltip-D4IeQDJL.js} +1 -1
- package/ui/dist/assets/{TraceViewer-ojGf0drx.js → TraceViewer-CMd-Wi0z.js} +1 -1
- package/ui/dist/assets/{TrainingPanel-CWnP4H2l.js → TrainingPanel-CLtiBq2h.js} +1 -1
- package/ui/dist/assets/{VoiceOverlay-Dn6iaYgd.js → VoiceOverlay-BXPVdnJc.js} +1 -1
- package/ui/dist/assets/{VramPanel-CLd9Ggck.js → VramPanel-DjuwGUzA.js} +1 -1
- package/ui/dist/assets/{WatchView-CQBemwsm.js → WatchView-B7sDnMpl.js} +1 -1
- package/ui/dist/assets/{WorkTab-BOfTN-Bd.js → WorkTab-B5nQ4Y7A.js} +1 -1
- package/ui/dist/assets/{WorkflowsPanel-qzNS0p0u.js → WorkflowsPanel-2z0TeXyR.js} +1 -1
- package/ui/dist/assets/{arrow-left-c-8OFZUV.js → arrow-left-BKOkzkae.js} +1 -1
- package/ui/dist/assets/{chart-column-x6L66Qw7.js → chart-column-D39PCk17.js} +1 -1
- package/ui/dist/assets/{circle-check-big-WaW3U3Xl.js → circle-check-big-CMz0QouP.js} +1 -1
- package/ui/dist/assets/{dollar-sign-D2Oce4Ru.js → dollar-sign-Bu8fZOQl.js} +1 -1
- package/ui/dist/assets/{download-YvPDLlFJ.js → download-vvx6zJ-U.js} +1 -1
- package/ui/dist/assets/{eye-off-DIMcxsdQ.js → eye-off-BPXFIzlW.js} +1 -1
- package/ui/dist/assets/{funnel-DqD9srZu.js → funnel-Bqns-i8I.js} +1 -1
- package/ui/dist/assets/{git-branch-0FamUEbU.js → git-branch-CdmeqL8d.js} +1 -1
- package/ui/dist/assets/{index-NatBSFxj.js → index-C6oarzis.js} +2 -2
- package/ui/dist/assets/index-DsFoD9SP.css +1 -0
- package/ui/dist/assets/{legacy-DOO7F5cq.js → legacy-DFIaZTiF.js} +1 -1
- package/ui/dist/assets/{lightbulb-Bk6KlR6q.js → lightbulb-DOL6Q-iP.js} +1 -1
- package/ui/dist/assets/{pause-DDC_zUiJ.js → pause-B0XymOnS.js} +1 -1
- package/ui/dist/assets/{play-BPXbHToG.js → play-Dwp2l5HG.js} +1 -1
- package/ui/dist/assets/{plug-Dxp-sWVF.js → plug-DRlTjWqQ.js} +1 -1
- package/ui/dist/assets/{proxy-vU7v4NVM.js → proxy-sXxWK7WF.js} +1 -1
- package/ui/dist/assets/{square-Bn_0tYME.js → square-yh0jffQZ.js} +1 -1
- package/ui/dist/assets/{target-BrtxUtzl.js → target-GxtNG2RW.js} +1 -1
- package/ui/dist/assets/{toggle-right-CYphlpN5.js → toggle-right-CYQd_Ux1.js} +1 -1
- package/ui/dist/assets/{trash-2-C_Jsp23A.js → trash-2-B4jp_pAQ.js} +1 -1
- package/ui/dist/assets/{trending-up-DrtLViSm.js → trending-up-B26tNhFP.js} +1 -1
- package/ui/dist/assets/{trophy-DdRzAOfo.js → trophy-Bf3ZeSeb.js} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/ToolsView-Cq7Fuq3i.js +0 -2
- package/ui/dist/assets/index-D932CbpQ.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as e,T as m,f as j,A as N,aw as f,ax as y,ay as w}from"./index-
|
|
1
|
+
import{r as n,j as e,T as m,f as j,A as N,aw as f,ax as y,ay as w}from"./index-C6oarzis.js";import{i as R,R as S,C as P}from"./TitanCanvas-BhurNMK3.js";import{P as k}from"./pause-B0XymOnS.js";import{P as E}from"./play-Dwp2l5HG.js";import"./VoiceOverlay-BXPVdnJc.js";function M(){const[s,v]=n.useState(null),[h,o]=n.useState(!0),[i,x]=n.useState([]),g=n.useRef(null),r=async()=>{o(!0);try{v(await f())}catch{}o(!1)};n.useEffect(()=>{r();const a=new EventSource("/api/daemon/stream");g.current=a,a.onmessage=d=>{try{const t=JSON.parse(d.data);x(l=>[{event:t.event||"message",data:JSON.stringify(t.data||t,null,0),time:new Date().toLocaleTimeString()},...l].slice(0,50))}catch{}};for(const d of["daemon:started","daemon:stopped","daemon:paused","daemon:resumed","daemon:heartbeat","goal:subtask:ready","health:ollama:down","health:ollama:degraded","cron:stuck"])a.addEventListener(d,t=>{x(l=>[{event:d,data:t.data||"",time:new Date().toLocaleTimeString()},...l].slice(0,50))});const c=setInterval(r,15e3);return()=>{a.close(),clearInterval(c)}},[]);const u=async()=>{await y(),r()},p=async()=>{await w(),r()},b=a=>a<6e4?`${Math.round(a/1e3)}s`:a<36e5?`${Math.round(a/6e4)}m`:`${Math.round(a/36e5)}h ${Math.round(a%36e5/6e4)}m`;return h&&!s?e.jsx("div",{className:"text-[var(--text-muted)]",children:"Loading daemon status..."}):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(R,{className:"w-6 h-6 text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-[var(--text)]",children:"Daemon"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Persistent background watchers and event loop"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:r,className:"p-2 rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(S,{size:14})}),(s==null?void 0:s.running)&&!s.paused&&e.jsxs("button",{onClick:u,className:"flex items-center gap-2 px-3 py-1.5 text-sm rounded-md bg-[var(--warning)]/15 text-[var(--warning)] border border-[var(--warning)]/25 hover:bg-[var(--warning)]/25 transition-colors",children:[e.jsx(k,{size:14})," Pause"]}),(s==null?void 0:s.running)&&s.paused&&e.jsxs("button",{onClick:p,className:"flex items-center gap-2 px-3 py-1.5 text-sm rounded-md bg-[var(--success)]/15 text-[var(--success)] border border-[var(--success)]/25 hover:bg-[var(--success)]/25 transition-colors",children:[e.jsx(E,{size:14})," Resume"]})]})]}),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:"Status"}),e.jsx("div",{className:"flex items-center gap-2 mt-1",children:s!=null&&s.running?s.paused?e.jsxs(e.Fragment,{children:[e.jsx(m,{size:18,className:"text-[var(--warning)]"}),e.jsx("span",{className:"text-lg font-semibold text-[var(--warning)]",children:"Paused"})]}):e.jsxs(e.Fragment,{children:[e.jsx(j,{size:18,className:"text-[var(--success)]"}),e.jsx("span",{className:"text-lg font-semibold text-[var(--success)]",children:"Running"})]}):e.jsx(e.Fragment,{children:e.jsx("span",{className:"text-lg font-semibold text-[var(--text-muted)]",children:"Stopped"})})})]}),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:"Uptime"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx(P,{size:18,className:"text-[var(--text-muted)]"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:s?b(s.uptimeMs):"-"})]})]}),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 / Hour"}),e.jsxs("p",{className:"text-lg font-semibold text-[var(--text)] mt-1",children:[(s==null?void 0:s.actionsThisHour)??0," ",e.jsxs("span",{className:"text-sm font-normal text-[var(--text-muted)]",children:["/ ",(s==null?void 0:s.maxActionsPerHour)??10]})]})]}),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:"Error Rate"}),e.jsxs("p",{className:`text-lg font-semibold mt-1 ${((s==null?void 0:s.errorRatePercent)??0)>30?"text-[var(--error)]":"text-[var(--text)]"}`,children:[(s==null?void 0:s.errorRatePercent)??0,"%"]})]})]}),(s==null?void 0:s.pauseReason)&&e.jsxs("div",{className:"bg-[var(--warning)]/10 border border-[var(--warning)]/25 rounded-lg p-3 flex items-center gap-2",children:[e.jsx(m,{size:16,className:"text-[var(--warning)] flex-shrink-0"}),e.jsx("span",{className:"text-sm text-[var(--warning)]",children:s.pauseReason})]}),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:"Active Watchers"}),s!=null&&s.activeWatchers&&s.activeWatchers.length>0?e.jsx("div",{className:"flex flex-wrap gap-2",children:s.activeWatchers.map(a=>e.jsxs("span",{className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-[var(--success)]/10 text-[var(--success)] border border-[var(--success)]/20",children:[e.jsx(N,{size:12})," ",a]},a))}):e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No active watchers"})]}),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:"Event Feed"}),i.length>0?e.jsx("div",{className:"space-y-1 max-h-64 overflow-y-auto font-mono text-xs",children:i.map((a,c)=>e.jsxs("div",{className:"flex gap-3 py-1 border-b border-[var(--border)]/50 last:border-0",children:[e.jsx("span",{className:"text-[var(--text-muted)] flex-shrink-0 w-16",children:a.time}),e.jsx("span",{className:"text-[var(--accent)] flex-shrink-0",children:a.event}),e.jsx("span",{className:"text-[var(--text-secondary)] truncate",children:a.data})]},c))}):e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Waiting for events..."})]})]})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-C6oarzis.js";function i({columns:s,data:d,onRowClick:a,emptyMessage:x="No data available"}){return e.jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-secondary",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-bg-tertiary",children:s.map(t=>e.jsx("th",{className:`px-4 py-3 text-sm font-medium text-text-secondary ${t.className??""}`,children:t.header},t.key))})}),e.jsx("tbody",{children:d.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:s.length,className:"px-4 py-12 text-center text-text-muted",children:x})}):d.map((t,n)=>e.jsx("tr",{onClick:()=>a==null?void 0:a(t),className:`border-t border-border transition-colors hover:bg-bg-tertiary/50 ${a?"cursor-pointer":""}`,children:s.map(r=>e.jsx("td",{className:`px-4 py-3 text-text ${r.className??""}`,children:r.render?r.render(t):String(t[r.key]??"")},r.key))},n))})]})})}export{i as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-C6oarzis.js";import{B as r}from"./Input-DWnbv1Yh.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as N,r as c,j as s,e as E,h as T}from"./index-C6oarzis.js";import{R as $,L as j,W as v}from"./TitanCanvas-BhurNMK3.js";import{P as y}from"./play-Dwp2l5HG.js";import{a as k,C as A}from"./VoiceOverlay-BXPVdnJc.js";import{C as L}from"./circle-check-big-CMz0QouP.js";const M={"widget-creation":"Widget Creation",safety:"Safety","tool-routing":"Tool Routing","gate-format":"Gate Format",pipeline:"Pipeline Classification",adversarial:"Adversarial","tool-routing-v2":"Tool Routing v2",session:"Session Management","widget-v2":"Widget v2","gate-format-v2":"Gate Format v2",content:"Content Quality"};async function O(){const e=await N("/api/eval/suites");if(!e.ok)throw new Error(`/api/eval/suites failed: ${e.status}`);const t=await e.json();return Array.isArray(t.suites)?t.suites:[]}async function F(e){const t=await N("/api/eval/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({suite:e})});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(`/api/eval/run failed: ${t.status} ${r.slice(0,200)}`)}return t.json()}function w(e){return e.total?Math.round(e.passed/e.total*100):NaN}function S(e){return Number.isNaN(e)?"slate":e>=100?"emerald":e>=80?"amber":"red"}const C={emerald:"bg-emerald-500/15 text-emerald-300 border-emerald-500/40",amber:"bg-amber-500/15 text-amber-300 border-amber-500/40",red:"bg-red-500/15 text-red-300 border-red-500/40",slate:"bg-slate-500/15 text-slate-300 border-slate-500/40"};function G(){const[e,t]=c.useState([]),[r,n]=c.useState(!1),[p,m]=c.useState(null),d=c.useCallback(async()=>{n(!0);try{const a=await O();t(o=>{const i=new Map(o.map(l=>[l.name,l]));return a.map(l=>i.get(l)??{name:l,status:"idle"})})}catch(a){console.error("listEvalSuites failed:",a),t([])}finally{n(!1)}},[]);c.useEffect(()=>{d()},[d]);const x=c.useCallback(async a=>{t(o=>o.map(i=>i.name===a?{...i,status:"running",error:void 0}:i));try{const o=await F(a);t(i=>i.map(l=>l.name===a?{...l,status:"done",result:o}:l))}catch(o){t(i=>i.map(l=>l.name===a?{...l,status:"error",error:o.message}:l))}},[]),h=c.useCallback(async()=>{for(const a of e)await x(a.name)},[e,x]),u=e.reduce((a,o)=>{var i,l,b;return{total:a.total+(((i=o.result)==null?void 0:i.total)??0),passed:a.passed+(((l=o.result)==null?void 0:l.passed)??0),failed:a.failed+(((b=o.result)==null?void 0:b.failed)??0)}},{total:0,passed:0,failed:0}),f=w(u),R=S(f),g=e.some(a=>a.status==="running");return s.jsxs("div",{className:"flex h-full flex-col gap-4 p-4 text-slate-200",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Eval Harness"}),s.jsx("button",{onClick:d,disabled:r||g,className:"rounded border border-slate-700 bg-slate-800/40 p-1.5 hover:bg-slate-800 disabled:opacity-50",title:"Refresh suite list",children:s.jsx($,{className:`h-3.5 w-3.5 ${r?"animate-spin":""}`})}),s.jsxs("button",{onClick:h,disabled:e.length===0||g,className:"ml-auto flex items-center gap-1.5 rounded border border-emerald-500/40 bg-emerald-500/10 px-3 py-1.5 text-sm text-emerald-300 hover:bg-emerald-500/20 disabled:opacity-50",children:[g?s.jsx(j,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(y,{className:"h-3.5 w-3.5"}),"Run all suites"]})]}),s.jsxs("div",{className:`flex items-center gap-3 rounded-lg border p-3 text-sm ${C[R]}`,children:[s.jsxs("div",{className:"font-medium",children:["Overall: ",u.passed,"/",u.total," passed",Number.isFinite(f)&&s.jsxs("span",{className:"ml-2 opacity-80",children:["(",f,"%)"]})]}),u.failed>0&&s.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[s.jsx(E,{className:"h-3.5 w-3.5"}),u.failed," failure",u.failed===1?"":"s"]})]}),s.jsxs("div",{className:"flex-1 space-y-2 overflow-auto",children:[e.length===0&&!r&&s.jsxs("div",{className:"rounded border border-slate-700 bg-slate-800/30 p-4 text-center text-sm text-slate-400",children:["No eval suites available. Verify ",s.jsx("code",{className:"font-mono text-xs",children:"/api/eval/suites"})," on the gateway."]}),e.map(a=>s.jsx(P,{suite:a,expanded:p===a.name,onToggle:()=>m(o=>o===a.name?null:a.name),onRun:()=>x(a.name)},a.name))]})]})}function P({suite:e,expanded:t,onToggle:r,onRun:n}){var x;const p=M[e.name]??e.name,m=e.result?w(e.result):NaN,d=S(m);return s.jsxs("div",{className:`rounded-lg border ${C[d]}`,children:[s.jsxs("div",{className:"flex items-center gap-3 p-3",children:[s.jsx("button",{onClick:r,disabled:!e.result,className:"text-slate-300 disabled:opacity-30","aria-label":t?"Collapse":"Expand",children:t?s.jsx(k,{className:"h-4 w-4"}):s.jsx(A,{className:"h-4 w-4"})}),s.jsx("div",{className:"font-medium text-slate-100",children:p}),s.jsx("div",{className:"text-xs text-slate-400",children:e.result?`${e.result.passed}/${e.result.total} (${m}%)`:e.status==="running"?"running…":e.status==="error"?`error: ${e.error}`:"idle"}),((x=e.result)==null?void 0:x.durationMs)!==void 0&&s.jsxs("div",{className:"text-xs text-slate-500",children:[(e.result.durationMs/1e3).toFixed(1),"s"]}),s.jsxs("button",{onClick:n,disabled:e.status==="running",className:"ml-auto flex items-center gap-1 rounded border border-slate-600 bg-slate-800/60 px-2 py-1 text-xs text-slate-200 hover:bg-slate-800 disabled:opacity-50",children:[e.status==="running"?s.jsx(j,{className:"h-3 w-3 animate-spin"}):s.jsx(y,{className:"h-3 w-3"}),"Run"]})]}),t&&e.result&&s.jsx("div",{className:"space-y-1.5 border-t border-slate-700/40 px-3 py-2",children:e.result.results.map(h=>s.jsx(q,{caseResult:h},h.name))})]})}function q({caseResult:e}){const t=e.expectedToolSequence!==void 0&&JSON.stringify(e.expectedToolSequence)!==JSON.stringify(e.toolsUsed);return s.jsxs("div",{className:`rounded p-2 text-xs ${e.passed?"bg-slate-800/30":"bg-red-950/30"}`,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[e.passed?s.jsx(L,{className:"h-3.5 w-3.5 text-emerald-400"}):s.jsx(T,{className:"h-3.5 w-3.5 text-red-400"}),s.jsx("div",{className:"font-mono text-slate-200",children:e.name}),s.jsxs("div",{className:"ml-auto text-slate-500",children:[e.durationMs,"ms"]})]}),!e.passed&&e.errors.length>0&&s.jsx("ul",{className:"mt-1 ml-5 list-disc text-red-300",children:e.errors.map((r,n)=>s.jsx("li",{children:r},n))}),t&&s.jsxs("div",{className:"mt-2 ml-5 grid grid-cols-2 gap-2 rounded bg-slate-900/40 p-2",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"mb-1 flex items-center gap-1 text-slate-400",children:[s.jsx(v,{className:"h-3 w-3"})," expected"]}),(e.expectedToolSequence??[]).map((r,n)=>s.jsxs("div",{className:"font-mono text-emerald-300",children:[n+1,". ",r]},n))]}),s.jsxs("div",{children:[s.jsxs("div",{className:"mb-1 flex items-center gap-1 text-slate-400",children:[s.jsx(v,{className:"h-3 w-3"})," actual"]}),e.toolsUsed.length===0&&s.jsx("div",{className:"italic text-slate-500",children:"(no tool calls)"}),e.toolsUsed.map((r,n)=>{var d;const m=((d=e.expectedToolSequence)==null?void 0:d[n])===r;return s.jsxs("div",{className:`font-mono ${m?"text-emerald-300":"text-red-300"}`,children:[n+1,". ",r]},n)})]})]})]})}export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,b3 as u,b4 as p,b5 as j,j as e,e as N,T as v,b6 as y}from"./index-
|
|
1
|
+
import{r as a,b3 as u,b4 as p,b5 as j,j as e,e as N,T as v,b6 as y}from"./index-C6oarzis.js";import{P as T}from"./PageHeader-CF75km05.js";import{R as w}from"./TitanCanvas-BhurNMK3.js";import{P as k}from"./play-Dwp2l5HG.js";import"./VoiceOverlay-BXPVdnJc.js";function E(){const[t,x]=a.useState(null),[r,o]=a.useState([]),[i,b]=a.useState([]),[d,n]=a.useState(!0),[c,m]=a.useState(!1),l=a.useCallback(async()=>{n(!0);try{const[s,h,f]=await Promise.all([u(),p(),j()]);x(s),o(h.tests||[]),b(f.tests||[])}catch{}n(!1)},[]);a.useEffect(()=>{l()},[l]);const g=async()=>{m(!0);try{await y(),await l()}catch{}m(!1)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(T,{title:"Test Lab",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Quality"},{label:"Tests"}]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:l,disabled:d,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(w,{className:`w-4 h-4 ${d?"animate-spin":""}`})," Refresh"]}),e.jsxs("button",{onClick:g,disabled:c,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#6366f1] text-white text-sm font-medium hover:bg-[#4f46e5] disabled:opacity-50",children:[e.jsx(k,{className:"w-4 h-4"})," ",c?"Running...":"Run Tests"]})]}),t&&e.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b]",children:"Total"}),e.jsx("div",{className:"text-sm font-semibold text-[#e4e4e7]",children:t.total})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b]",children:"Passing"}),e.jsx("div",{className:"text-sm font-semibold text-emerald-400",children:t.passing})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b]",children:"Failing"}),e.jsx("div",{className:"text-sm font-semibold text-red-400",children:t.failing})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b]",children:"Flaky"}),e.jsx("div",{className:"text-sm font-semibold text-amber-400",children:t.flaky})]})]}),r.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium text-[#e4e4e7] flex items-center gap-2",children:[e.jsx(N,{className:"w-4 h-4 text-red-400"})," Failing Tests"]}),r.map(s=>e.jsxs("div",{className:"p-2 rounded-lg bg-red-950/20 border border-red-900/50",children:[e.jsx("div",{className:"text-xs text-[#e4e4e7]",children:s.name}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.suite," • ",s.error.slice(0,60)]})]},s.name))]}),i.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium text-[#e4e4e7] flex items-center gap-2",children:[e.jsx(v,{className:"w-4 h-4 text-amber-400"})," Flaky Tests"]}),i.map(s=>e.jsxs("div",{className:"p-2 rounded-lg bg-amber-950/20 border border-amber-900/50",children:[e.jsx("div",{className:"text-xs text-[#e4e4e7]",children:s.name}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.suite," • ",s.passRate.toFixed(1),"% pass rate"]})]},s.name))]})]})}export{E as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as E,r,a4 as me,a5 as ue,j as e,X as q,a6 as he,a7 as pe,a8 as I,a9 as ve,aa as fe}from"./index-
|
|
1
|
+
import{c as E,r,a4 as me,a5 as ue,j as e,X as q,a6 as he,a7 as pe,a8 as I,a9 as ve,aa as fe}from"./index-C6oarzis.js";import{P as be,R as ge,H as je,C as Ne,j as U,c as ye,k as J,D as Z,F as X,f as we}from"./TitanCanvas-BhurNMK3.js";import{C as G}from"./VoiceOverlay-BXPVdnJc.js";import{A as ke}from"./arrow-left-BKOkzkae.js";import{T as Q}from"./trash-2-B4jp_pAQ.js";import{D as Ce}from"./download-vvx6zJ-U.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,a_ as c,j as e}from"./index-
|
|
1
|
+
import{r as a,a_ as c,j as e}from"./index-C6oarzis.js";import{P as x}from"./PageHeader-CF75km05.js";import{R as n,g as o}from"./TitanCanvas-BhurNMK3.js";import"./VoiceOverlay-BXPVdnJc.js";function h(){const[i,d]=a.useState([]),[r,l]=a.useState(!0),t=a.useCallback(async()=>{l(!0);try{const s=await c();d(s.nodes||[])}catch{}l(!1)},[]);return a.useEffect(()=>{t()},[t]),e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{title:"Fleet Router",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Mesh"},{label:"Fleet"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:t,disabled:r,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(n,{className:`w-4 h-4 ${r?"animate-spin":""}`})," Refresh"]})}),e.jsx("div",{className:"space-y-2",children:i.map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(o,{className:`w-4 h-4 ${s.status==="online"?"text-emerald-400":s.status==="busy"?"text-amber-400":"text-red-400"}`}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:s.name}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.address," • ",s.capabilities.join(", ")]})]})]}),e.jsx("div",{className:"text-xs text-[#52525b]",children:s.status})]},s.id))})]})}export{h as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ee,r as d,b as m,j as e,Z as I,C as se,H as te,A as w,W as ae,h as ne,T as le}from"./index-
|
|
1
|
+
import{c as ee,r as d,b as m,j as e,Z as I,C as se,H as te,A as w,W as ae,h as ne,T as le}from"./index-C6oarzis.js";import{P as B}from"./PageHeader-CF75km05.js";import{S as h}from"./StatCard-Cv2u-yqA.js";import{S as re}from"./SkeletonLoader-P8SFCyGi.js";import{R as ie,C as ce,M as de,h as oe,N as D,b as xe,U as me}from"./TitanCanvas-BhurNMK3.js";import{C as he}from"./chart-column-D39PCk17.js";import{C as A}from"./circle-check-big-CMz0QouP.js";import{D as ue}from"./dollar-sign-Bu8fZOQl.js";import"./VoiceOverlay-BXPVdnJc.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomelabPanel-
|
|
2
|
-
import{r as s,j as e,n as o,_ as a}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomelabPanel-B4bCsrBw.js","assets/index-C6oarzis.js","assets/index-DsFoD9SP.css","assets/PageHeader-CF75km05.js","assets/VoiceOverlay-BXPVdnJc.js","assets/StatCard-Cv2u-yqA.js","assets/SkeletonLoader-P8SFCyGi.js","assets/TitanCanvas-BhurNMK3.js","assets/TitanCanvas-BfitWg9R.css","assets/chart-column-D39PCk17.js","assets/circle-check-big-CMz0QouP.js","assets/dollar-sign-Bu8fZOQl.js","assets/NvidiaPanel-DVntoRrH.js","assets/eye-off-BPXFIzlW.js","assets/FilesPanel-CNrDLmix.js","assets/arrow-left-BKOkzkae.js","assets/trash-2-B4jp_pAQ.js","assets/download-vvx6zJ-U.js","assets/LogsPanel-BnWNREPX.js","assets/TelemetryPanel-DHNFyCwn.js","assets/git-branch-CdmeqL8d.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as s,j as e,n as o,_ as a}from"./index-C6oarzis.js";const r=s.lazy(()=>a(()=>import("./HomelabPanel-B4bCsrBw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),n=s.lazy(()=>a(()=>import("./NvidiaPanel-DVntoRrH.js"),__vite__mapDeps([12,1,2,7,4,8,10,13]))),d=s.lazy(()=>a(()=>import("./FilesPanel-CNrDLmix.js"),__vite__mapDeps([14,1,2,7,4,8,15,16,17]))),c=s.lazy(()=>a(()=>import("./LogsPanel-BnWNREPX.js"),__vite__mapDeps([18,1,2,7,4,8]))),m=s.lazy(()=>a(()=>import("./TelemetryPanel-DHNFyCwn.js"),__vite__mapDeps([19,1,2,5,7,4,8,20,9]))),x=[{id:"homelab",label:"Homelab"},{id:"gpu",label:"GPU / NVIDIA"},{id:"files",label:"Files"},{id:"logs",label:"Logs"},{id:"telemetry",label:"Telemetry"}];function u(){const[l,i]=s.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(t=>e.jsxs("button",{onClick:()=>i(t.id),className:o("px-3 py-2 text-xs font-medium transition-colors relative",l===t.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[t.label,l===t.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},t.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(s.Suspense,{fallback:e.jsx("div",{className:"skeleton-shimmer h-40 rounded-lg"}),children:[l==="homelab"&&e.jsx(r,{}),l==="gpu"&&e.jsx(n,{}),l==="files"&&e.jsx(d,{}),l==="logs"&&e.jsx(c,{}),l==="telemetry"&&e.jsx(m,{})]})})]})}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,n as m,j as t,X as N}from"./index-
|
|
1
|
+
import{r,n as m,j as t,X as N}from"./index-C6oarzis.js";import{k as w,j as S}from"./TitanCanvas-BhurNMK3.js";function I({value:s,onSave:h,placeholder:p,multiline:a=!1,className:k,displayValue:j,emptyLabel:E="—",hidePencil:C=!1,maxLength:x,title:v}){const[i,c]=r.useState(!1),[o,l]=r.useState(s),[f,y]=r.useState(!1),n=r.useRef(null);r.useEffect(()=>{i&&n.current&&(n.current.focus(),"select"in n.current&&n.current.select())},[i]),r.useEffect(()=>{i||l(s)},[s,i]);const u=async()=>{if(o===s){c(!1);return}y(!0);try{await h(o),c(!1)}catch{}finally{y(!1)}},b=()=>{l(s),c(!1)},g=e=>{e.key==="Enter"&&!a||e.key==="Enter"&&a&&e.metaKey?(e.preventDefault(),u()):e.key==="Escape"&&(e.preventDefault(),b())};if(i){const e=m("bg-bg-tertiary border border-accent/60 rounded px-2 py-1 text-sm text-text","focus:outline-none focus:border-accent","w-full",a&&"resize-none min-h-[60px]");return t.jsxs("span",{className:"inline-flex items-start gap-1 w-full",children:[a?t.jsx("textarea",{ref:n,value:o,onChange:d=>l(d.target.value),onKeyDown:g,placeholder:p,maxLength:x,className:e,disabled:f}):t.jsx("input",{ref:n,type:"text",value:o,onChange:d=>l(d.target.value),onKeyDown:g,placeholder:p,maxLength:x,className:e,disabled:f}),t.jsx("button",{onClick:u,disabled:f,className:"text-success hover:bg-success/10 rounded p-1 shrink-0",title:a?"Save (Cmd+Enter)":"Save (Enter)",type:"button",children:t.jsx(w,{size:14})}),t.jsx("button",{onClick:b,disabled:f,className:"text-text-muted hover:bg-bg-tertiary rounded p-1 shrink-0",title:"Cancel (Esc)",type:"button",children:t.jsx(N,{size:14})})]})}const D=j??(s&&s.length>0?s:E);return t.jsxs("span",{className:m("inline-flex items-center gap-1 cursor-pointer group","hover:bg-bg-tertiary rounded px-1 -mx-1",k),onClick:()=>c(!0),title:v??"Click to edit",role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),c(!0))},children:[t.jsx("span",{children:D}),!C&&t.jsx(S,{size:10,className:"text-text-muted opacity-0 group-hover:opacity-60 transition-opacity shrink-0"})]})}export{I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,j as e,n as d}from"./index-
|
|
1
|
+
import{r as n,j as e,n as d}from"./index-C6oarzis.js";import{L as b}from"./TitanCanvas-BhurNMK3.js";const m={primary:"text-white shadow-sm glow-accent-hover bg-[image:var(--gradient-accent)] hover:brightness-110",secondary:"bg-bg-tertiary text-text border border-border hover:border-border-light hover:bg-bg-secondary",ghost:"text-text-secondary hover:text-text hover:bg-bg-tertiary",danger:"bg-error/10 text-error border border-error/20 hover:bg-error/20"},p={sm:"px-2.5 py-1 text-xs gap-1.5 rounded-md",md:"px-3.5 py-2 text-sm gap-2 rounded-lg",lg:"px-5 py-2.5 text-sm gap-2 rounded-lg"},g=n.forwardRef(({variant:r="primary",size:t="md",icon:o,loading:s,disabled:a,children:i,className:l,...x},c)=>e.jsxs("button",{ref:c,disabled:a||s,className:d("inline-flex items-center justify-center font-medium transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50","disabled:opacity-50 disabled:pointer-events-none",m[r],p[t],l),...x,children:[s?e.jsx(b,{size:t==="sm"?14:16,className:"animate-spin"}):o,i]}));g.displayName="Button";const u=n.forwardRef(({icon:r,error:t,className:o,...s},a)=>e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"relative",children:[r&&e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-text-muted pointer-events-none",children:r}),e.jsx("input",{ref:a,className:d("w-full rounded-lg border bg-bg py-2 text-sm text-text outline-none transition-colors","placeholder:text-text-muted",r?"pl-10 pr-3":"px-3",t?"border-error focus:border-error":"border-border focus:border-accent",o),...s})]}),t&&e.jsx("p",{className:"mt-1 text-xs text-error",children:t})]}));u.displayName="Input";export{g as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e,e as F,K as S,b as C,$ as K}from"./index-
|
|
1
|
+
import{r as l,j as e,e as F,K as S,b as C,$ as K}from"./index-C6oarzis.js";import{P as A}from"./plug-DRlTjWqQ.js";import{C as U}from"./circle-check-big-CMz0QouP.js";import{E as T}from"./eye-off-BPXFIzlW.js";import{i as I,c as O}from"./TitanCanvas-BhurNMK3.js";import{a as R,C as q}from"./VoiceOverlay-BXPVdnJc.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(R,{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 Q(){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"},$=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)},D=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(U,{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:D,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:$,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{Q as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AutopilotPanel-
|
|
2
|
-
import{r as s,j as e,n as a,_ as t}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AutopilotPanel-nBluaHA4.js","assets/index-C6oarzis.js","assets/index-DsFoD9SP.css","assets/PageHeader-CF75km05.js","assets/VoiceOverlay-BXPVdnJc.js","assets/WorkflowsPanel-2z0TeXyR.js","assets/Input-DWnbv1Yh.js","assets/TitanCanvas-BhurNMK3.js","assets/TitanCanvas-BfitWg9R.css","assets/InlineEditableField-DyBCbIoN.js","assets/target-GxtNG2RW.js","assets/play-Dwp2l5HG.js","assets/pause-B0XymOnS.js","assets/trash-2-B4jp_pAQ.js","assets/toggle-right-CYQd_Ux1.js","assets/LearningPanel-D_S4HFX5.js","assets/lightbulb-DOL6Q-iP.js","assets/trending-up-B26tNhFP.js","assets/MemoryGraphPanel-DD7x4rrm.js","assets/SelfImprovePanel-CNpCp5N4.js","assets/circle-check-big-CMz0QouP.js","assets/trophy-Bf3ZeSeb.js","assets/PersonasPanel-ClC_TTGX.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as s,j as e,n as a,_ as t}from"./index-C6oarzis.js";const i=s.lazy(()=>t(()=>import("./AutopilotPanel-nBluaHA4.js"),__vite__mapDeps([0,1,2,3,4]))),n=s.lazy(()=>t(()=>import("./WorkflowsPanel-2z0TeXyR.js"),__vite__mapDeps([5,1,2,3,4,6,7,8,9,10,11,12,13,14]))),d=s.lazy(()=>t(()=>import("./LearningPanel-D_S4HFX5.js"),__vite__mapDeps([15,1,2,3,4,7,8,16,17]))),c=s.lazy(()=>t(()=>import("./MemoryGraphPanel-DD7x4rrm.js"),__vite__mapDeps([18,1,2,7,4,8,13]))),m=s.lazy(()=>t(()=>import("./SelfImprovePanel-CNpCp5N4.js"),__vite__mapDeps([19,1,2,7,4,8,20,21,17,11,13]))),x=s.lazy(()=>t(()=>import("./PersonasPanel-ClC_TTGX.js"),__vite__mapDeps([22,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 u(){const[l,r]=s.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(o=>e.jsxs("button",{onClick:()=>r(o.id),className:a("px-3 py-2 text-xs font-medium transition-colors relative",l===o.id?"text-accent":"text-text-muted hover:text-text-secondary"),children:[o.label,l===o.id&&e.jsx("div",{className:"absolute bottom-0 left-1 right-1 h-[2px] bg-accent rounded-full"})]},o.id))})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-5",children:e.jsxs(s.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{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as e,T as g,b as x}from"./index-
|
|
1
|
+
import{r as o,j as e,T as g,b as x}from"./index-C6oarzis.js";import{P as j}from"./PageHeader-CF75km05.js";import{R as f,d as p,W as N,D as v}from"./TitanCanvas-BhurNMK3.js";import{L as y}from"./lightbulb-DOL6Q-iP.js";import{T as C}from"./trending-up-B26tNhFP.js";import"./VoiceOverlay-BXPVdnJc.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 l({icon:t,label:i,value:r,color:n,sub:a}){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:n+"15"},children:e.jsx(t,{className:"h-3.5 w-3.5",style:{color:n}})}),e.jsx("p",{className:"text-xs text-text-muted",children:i})]}),e.jsx("p",{className:"text-2xl font-bold text-text",children:r}),a&&e.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:a})]})}function R(){const[t,i]=o.useState(null),[r,n]=o.useState(null),[a,b]=o.useState(null),[h,m]=o.useState(!0),u=()=>{m(!0),Promise.all([x("/api/learning").then(s=>s.ok?s.json():null).catch(()=>null),x("/api/stats").then(s=>s.ok?s.json():null).catch(()=>null),x("/api/graphiti").then(s=>s.ok?s.json():null).catch(()=>null)]).then(([s,c,d])=>{i(s),n(c),b(d?{nodeCount:d.nodeCount||0,edgeCount:d.edgeCount||0,episodeCount:d.episodeCount||0}:null)}).finally(()=>m(!1))};return o.useEffect(()=>{u()},[]),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(j,{title:"Learning",subtitle:"Knowledge base, tool mastery, and memory systems",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Memory"},{label:"Learning"}],actions:e.jsxs("button",{onClick:u,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(f,{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(l,{icon:p,label:"Knowledge Entries",value:(t==null?void 0:t.knowledgeEntries)??0,color:"#6366f1",sub:"Facts, patterns, corrections"}),e.jsx(l,{icon:N,label:"Tools Tracked",value:(t==null?void 0:t.toolsTracked)??0,color:"#22d3ee",sub:"Success rates learned"}),e.jsx(l,{icon:g,label:"Error Patterns",value:(t==null?void 0:t.errorPatterns)??0,color:"#f59e0b",sub:"Known failure modes"}),e.jsx(l,{icon:y,label:"Corrections",value:(t==null?void 0:t.corrections)??0,color:"#34d399",sub:"User-taught improvements"})]})]}),a&&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(l,{icon:v,label:"Entities",value:a.nodeCount,color:"#818cf8",sub:"People, topics, projects"}),e.jsx(l,{icon:C,label:"Relationships",value:a.edgeCount,color:"#22d3ee",sub:"Connections between entities"}),e.jsx(l,{icon:p,label:"Episodes",value:a.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{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,ab as v,j as e}from"./index-
|
|
1
|
+
import{r,ab as v,j as e}from"./index-C6oarzis.js";import{R as j}from"./TitanCanvas-BhurNMK3.js";import"./VoiceOverlay-BXPVdnJc.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 L(){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{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,j as e,G as k,ai as z,aj as $,ak as b,al as R,am as I,an as E}from"./index-NatBSFxj.js";import{P as h}from"./plug-Dxp-sWVF.js";import{R as D,P as L,h as g,l as G,m as B}from"./TitanCanvas-Hk49NFcA.js";import{T as F}from"./trash-2-C_Jsp23A.js";import"./VoiceOverlay-Dn6iaYgd.js";function J(){const[n,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:""}),o=async()=>{x(!0);try{const[t,r]=await Promise.all([z(),$()]);j(t),y(r)}catch{}x(!1)};d.useEffect(()=>{o()},[]);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:""}),o()}catch(t){alert(t.message)}},P=async t=>{try{await b({presetId:t}),o()}catch(r){alert(r.message)}},w=async t=>{confirm(`Remove MCP server "${t}"?`)&&(await E(t),o())},M=async(t,r)=>{await I(t,r),o()},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=>!n.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:o,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:n.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:n.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:n.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..."}):n.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:n.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{J as default};
|
|
1
|
+
import{r as d,j as e,G as k,ai as z,aj as $,ak as b,al as R,am as I,an as E}from"./index-C6oarzis.js";import{P as h}from"./plug-DRlTjWqQ.js";import{R as D,P as L,h as g,l as G,m as B}from"./TitanCanvas-BhurNMK3.js";import{T as F}from"./trash-2-B4jp_pAQ.js";import"./VoiceOverlay-BXPVdnJc.js";function J(){const[n,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:""}),o=async()=>{x(!0);try{const[t,r]=await Promise.all([z(),$()]);j(t),y(r)}catch{}x(!1)};d.useEffect(()=>{o()},[]);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:""}),o()}catch(t){alert(t.message)}},P=async t=>{try{await b({presetId:t}),o()}catch(r){alert(r.message)}},w=async t=>{confirm(`Remove MCP server "${t}"?`)&&(await E(t),o())},M=async(t,r)=>{await I(t,r),o()},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=>!n.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:o,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:n.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:n.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:n.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..."}):n.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:n.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{J as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ye,r as j,b as be,j as o,X as Se}from"./index-
|
|
1
|
+
import{c as ye,r as j,b as be,j as o,X as Se}from"./index-C6oarzis.js";import{N as ve,R as Ce,a as ke}from"./TitanCanvas-BhurNMK3.js";import{T as $e}from"./trash-2-B4jp_pAQ.js";import"./VoiceOverlay-BXPVdnJc.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as g,r as n,b as h,j as e}from"./index-
|
|
1
|
+
import{c as g,r as n,b as h,j as e}from"./index-C6oarzis.js";import{P as u}from"./PageHeader-CF75km05.js";import{A as v}from"./arrow-left-BKOkzkae.js";import{C as w,a as k,d as S}from"./TitanCanvas-BhurNMK3.js";import"./VoiceOverlay-BXPVdnJc.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-C6oarzis.js";import{D as v}from"./DataTable-BHOu7fZP.js";import{R as w,n as P}from"./TitanCanvas-BhurNMK3.js";import"./VoiceOverlay-BXPVdnJc.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,b as y,j as e,C as K,e as U,Z as O,A as B,d as E,K as G,$ as T}from"./index-NatBSFxj.js";import{R as D,c as L,E as V,a as $,i as M}from"./TitanCanvas-Hk49NFcA.js";import{C as F}from"./circle-check-big-WaW3U3Xl.js";import{E as H}from"./eye-off-DIMcxsdQ.js";import"./VoiceOverlay-Dn6iaYgd.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(H,{className:"h-4 w-4"}):e.jsx(M,{className:"h-4 w-4"})})]})]})}function X(){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,k,S,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:((k=i.nvidia.asr)==null?void 0:k.grpcUrl)??"localhost:50051",healthUrl:((S=i.nvidia.asr)==null?void 0:S.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(K,{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(D,{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(L,{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(F,{className:"h-4 w-4"}):e.jsx(U,{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(V,{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:$,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{X as default};
|
|
1
|
+
import{r as o,b as y,j as e,C as K,e as U,Z as O,A as B,d as E,K as G,$ as T}from"./index-C6oarzis.js";import{R as D,c as L,E as V,a as $,i as M}from"./TitanCanvas-BhurNMK3.js";import{C as F}from"./circle-check-big-CMz0QouP.js";import{E as H}from"./eye-off-BPXFIzlW.js";import"./VoiceOverlay-BXPVdnJc.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(H,{className:"h-4 w-4"}):e.jsx(M,{className:"h-4 w-4"})})]})]})}function X(){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,k,S,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:((k=i.nvidia.asr)==null?void 0:k.grpcUrl)??"localhost:50051",healthUrl:((S=i.nvidia.asr)==null?void 0:S.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(K,{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(D,{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(L,{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(F,{className:"h-4 w-4"}):e.jsx(U,{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(V,{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:$,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{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,aX as g,aY as b,j as e,T as d,d as f,aZ as h}from"./index-
|
|
1
|
+
import{r as t,aX as g,aY as b,j as e,T as d,d as f,aZ as h}from"./index-C6oarzis.js";import{P as p}from"./PageHeader-CF75km05.js";import{R as j}from"./TitanCanvas-BhurNMK3.js";import{C as u}from"./circle-check-big-CMz0QouP.js";import"./VoiceOverlay-BXPVdnJc.js";function A(){const[n,m]=t.useState([]),[i,o]=t.useState({}),[l,c]=t.useState(!0),r=t.useCallback(async()=>{c(!0);try{const[s,a]=await Promise.all([g(),b()]);m(s.alerts||[]),o(a)}catch{}c(!1)},[]);t.useEffect(()=>{r()},[r]);const x=async s=>{try{await h(s),await r()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(p,{title:"Organism Monitor",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Safety"},{label:"Organism"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:r,disabled:l,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(j,{className:`w-4 h-4 ${l?"animate-spin":""}`})," Refresh"]})}),Object.keys(i).length>0&&e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Object.entries(i).map(([s,a])=>e.jsxs("div",{className:"p-2 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsx("div",{className:"text-xs text-[#52525b] capitalize",children:s}),e.jsx("div",{className:"text-sm font-semibold text-[#e4e4e7]",children:typeof a=="number"?a.toFixed(2):a})]},s))}),e.jsx("div",{className:"space-y-2",children:n.map(s=>e.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${s.severity==="critical"?"bg-red-950/20 border-red-900/50":s.severity==="warning"?"bg-amber-950/20 border-amber-900/50":"bg-[#0a0a0f] border-[#27272a]"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[s.severity==="critical"?e.jsx(d,{className:"w-4 h-4 text-red-400"}):s.severity==="warning"?e.jsx(d,{className:"w-4 h-4 text-amber-400"}):e.jsx(f,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:s.message}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[s.source," • ",new Date(s.timestamp).toLocaleString()]})]})]}),!s.acknowledged&&e.jsxs("button",{onClick:()=>x(s.id),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] text-xs hover:bg-[#3f3f46]",children:[e.jsx(u,{className:"w-3.5 h-3.5"})," Ack"]})]},s.id))})]})}export{A as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as v,r as o,j as e,Z as x,A as h,H as f,C as j,aB as p}from"./index-
|
|
1
|
+
import{c as v,r as o,j as e,Z as x,A as h,H as f,C as j,aB as p}from"./index-C6oarzis.js";import{S as a}from"./StatCard-Cv2u-yqA.js";import{P as n}from"./PageHeader-CF75km05.js";import{S as g}from"./SkeletonLoader-P8SFCyGi.js";import{C as y,M as b,h as w}from"./TitanCanvas-BhurNMK3.js";import"./VoiceOverlay-BXPVdnJc.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,aA as i}from"./index-
|
|
1
|
+
import{j as e,aA as i}from"./index-C6oarzis.js";import{C as r}from"./VoiceOverlay-BXPVdnJc.js";function h({title:n,subtitle:a,breadcrumbs:t,actions:l}){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}),a&&e.jsx("p",{className:"mt-0.5 text-[11px] md:text-sm text-text-muted",children:a})]}),l&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:l})]})]})}export{h as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,b0 as m,j as e,b1 as d,b2 as p}from"./index-
|
|
1
|
+
import{r as t,b0 as m,j as e,b1 as d,b2 as p}from"./index-C6oarzis.js";import{P as x}from"./PageHeader-CF75km05.js";import{R as u,p as f,q as h}from"./TitanCanvas-BhurNMK3.js";import{P as b}from"./play-Dwp2l5HG.js";import{S as g}from"./square-yh0jffQZ.js";import"./VoiceOverlay-BXPVdnJc.js";function S(){const[a,n]=t.useState(null),[r,l]=t.useState(!0),s=t.useCallback(async()=>{l(!0);try{const o=await m();n(o)}catch{}l(!1)},[]);t.useEffect(()=>{s()},[s]);const i=async()=>{try{await d(),await s()}catch{}},c=async()=>{try{await p(),await s()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{title:"Paperclip",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Paperclip"}]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("button",{onClick:s,disabled:r,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(u,{className:`w-4 h-4 ${r?"animate-spin":""}`})," Refresh"]})}),a&&e.jsxs("div",{className:"p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(f,{className:`w-4 h-4 ${a.running?"text-emerald-400":"text-[#52525b]"}`}),e.jsx("span",{className:"text-sm font-medium text-[#e4e4e7]",children:a.running?"Running":"Stopped"}),a.pid&&e.jsxs("span",{className:"text-xs text-[#52525b]",children:["PID ",a.pid]})]}),a.url&&e.jsx("div",{className:"text-xs text-[#52525b] mb-3",children:a.url}),e.jsxs("div",{className:"flex gap-2",children:[!a.running&&e.jsxs("button",{onClick:i,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#6366f1] text-white text-sm font-medium hover:bg-[#4f46e5]",children:[e.jsx(b,{className:"w-4 h-4"})," Start"]}),a.running&&e.jsxs("button",{onClick:c,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-red-600 text-white text-sm font-medium hover:bg-red-700",children:[e.jsx(g,{className:"w-4 h-4"})," Stop"]}),e.jsxs("button",{onClick:s,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46]",children:[e.jsx(h,{className:"w-4 h-4"})," Reset"]})]})]})]})}export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as s,a2 as y,a3 as j}from"./index-
|
|
1
|
+
import{r as a,j as s,a2 as y,a3 as j}from"./index-C6oarzis.js";function w(){const[r,g]=a.useState([]),[c,l]=a.useState("default"),[h,f]=a.useState(!0),[o,d]=a.useState(null),[n,x]=a.useState(null),[i,b]=a.useState("all");a.useEffect(()=>{(async()=>{try{const t=await y();g(t.personas),l(t.active)}catch(t){d(t instanceof Error?t.message:"Failed to fetch personas")}finally{f(!1)}})()},[]);const p=a.useMemo(()=>{const e=new Set(r.map(t=>t.division));return["all",...Array.from(e).sort()]},[r]),m=a.useMemo(()=>i==="all"?r:r.filter(e=>e.division===i),[r,i]),v=async e=>{if(!(e===c||n)){x(e);try{const t=await j(e);l(t.active)}catch(t){d(t instanceof Error?t.message:"Failed to switch persona")}finally{x(null)}}};return h?s.jsx("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-3",children:Array.from({length:6}).map((e,t)=>s.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"},t))}):o?s.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:o}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h2",{className:"text-lg font-semibold text-text",children:"Personas"}),s.jsxs("span",{className:"text-sm text-text-muted",children:[r.length," available"]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:p.map(e=>s.jsx("button",{onClick:()=>b(e),className:`rounded-lg px-3 py-1.5 text-sm font-medium capitalize transition-colors ${i===e?"bg-accent text-white":"bg-bg-tertiary text-text-secondary hover:text-text"}`,children:e},e))}),s.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[m.map(e=>{const t=e.id===c,u=e.id===n;return s.jsxs("button",{onClick:()=>v(e.id),disabled:t||!!n,className:`rounded-xl border p-4 text-left transition-all ${t?"border-accent bg-accent/10 ring-1 ring-accent/30":"border-border bg-bg-secondary hover:border-border-light hover:bg-bg-secondary"} ${u?"opacity-60":""} disabled:cursor-default`,children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("h3",{className:"font-medium text-text",children:e.name}),t&&s.jsx("span",{className:"rounded-full bg-accent/20 px-2 py-0.5 text-xs font-medium text-accent-hover",children:"Active"}),u&&s.jsx("span",{className:"text-xs text-text-secondary",children:"Switching..."})]}),s.jsx("p",{className:"text-sm text-text-secondary line-clamp-2",children:e.description}),s.jsx("p",{className:"mt-2 text-xs capitalize text-text-muted",children:e.division})]},e.id)}),m.length===0&&s.jsx("p",{className:"col-span-full py-12 text-center text-text-muted",children:"No personas in this division"})]})]})}export{w as default};
|