@wangcansun/cc-config 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.mjs +12 -2
- package/dashboard/dist/client/assets/activity-4TqyD_rE.js +1 -0
- package/dashboard/dist/client/assets/{commands-DhNv8XVR.js → commands-DEkiXZYl.js} +1 -1
- package/dashboard/dist/client/assets/dashboard-kD72rFaQ.js +1 -0
- package/dashboard/dist/client/assets/{detail-panel-C8SGLgm-.js → detail-panel-BIvsI61i.js} +1 -1
- package/dashboard/dist/client/assets/{header-CBzSNzdI.js → header-BTV9BL6u.js} +1 -1
- package/dashboard/dist/client/assets/{index-CaDf51H6.js → index-C8Brdl4F.js} +2 -2
- package/dashboard/dist/client/assets/{index-CFEz1CGb.js → index-CUdpRxTZ.js} +1 -1
- package/dashboard/dist/client/assets/{markdown-viewer-Bj8nSOSJ.js → markdown-viewer-Bcu9HM71.js} +3 -3
- package/dashboard/dist/client/assets/{mcp-BX69kbwu.js → mcp-DrHxDxfw.js} +1 -1
- package/dashboard/dist/client/assets/{plugins-BslRzmVr.js → plugins-husUl0t4.js} +1 -1
- package/dashboard/dist/client/assets/{profiles-CfOCpDPJ.js → profiles-tCUJYeeT.js} +1 -1
- package/dashboard/dist/client/assets/{recommended-BAj0agKu.js → recommended-Brh5GAZB.js} +1 -1
- package/dashboard/dist/client/assets/{search-box-CqaIZ9mR.js → search-box-CO7338GK.js} +1 -1
- package/dashboard/dist/client/assets/{select-BtWQJMup.js → select-BdEpCEBk.js} +1 -1
- package/dashboard/dist/client/assets/{settings-CicCcNf_.js → settings-DpddxKm5.js} +1 -1
- package/dashboard/dist/client/assets/{skills-DML4G4BP.js → skills-BvLEIHVX.js} +1 -1
- package/dashboard/dist/client/assets/{tag-Q3V7Jugn.js → tag-CkZkoVAp.js} +1 -1
- package/dashboard/dist/client/index.html +1 -1
- package/dashboard/dist/server.mjs +12 -2
- package/package.json +1 -1
- package/dashboard/dist/client/assets/activity-DS5YBWMm.js +0 -1
- package/dashboard/dist/client/assets/dashboard-DIyDYrl6.js +0 -1
package/cli.mjs
CHANGED
|
@@ -24492,7 +24492,7 @@ var SessionManager = class {
|
|
|
24492
24492
|
sessions.sort((a, b) => {
|
|
24493
24493
|
if (a.alive !== b.alive)
|
|
24494
24494
|
return a.alive ? -1 : 1;
|
|
24495
|
-
return b.startedAt - a.startedAt;
|
|
24495
|
+
return (b.lastActive ?? b.startedAt) - (a.lastActive ?? a.startedAt);
|
|
24496
24496
|
});
|
|
24497
24497
|
setCache("all-sessions", sessions);
|
|
24498
24498
|
return sessions;
|
|
@@ -24513,7 +24513,8 @@ var SessionManager = class {
|
|
|
24513
24513
|
continue;
|
|
24514
24514
|
const existing = sessionMap.get(entry.sessionId);
|
|
24515
24515
|
if (existing) {
|
|
24516
|
-
if (entry.timestamp && entry.timestamp > existing.startedAt) {
|
|
24516
|
+
if (entry.timestamp && entry.timestamp > (existing.lastActive ?? existing.startedAt)) {
|
|
24517
|
+
existing.lastActive = entry.timestamp;
|
|
24517
24518
|
}
|
|
24518
24519
|
if (entry.display) {
|
|
24519
24520
|
existing.lastMessage = entry.display;
|
|
@@ -24524,6 +24525,7 @@ var SessionManager = class {
|
|
|
24524
24525
|
sessionId: entry.sessionId,
|
|
24525
24526
|
cwd: entry.project ?? "",
|
|
24526
24527
|
startedAt: entry.timestamp ?? 0,
|
|
24528
|
+
lastActive: entry.timestamp ?? 0,
|
|
24527
24529
|
alive: false,
|
|
24528
24530
|
lastMessage: entry.display,
|
|
24529
24531
|
projectDir: entry.project
|
|
@@ -24614,6 +24616,13 @@ var SessionManager = class {
|
|
|
24614
24616
|
existing.historyFile = historyFile;
|
|
24615
24617
|
if (!existing.projectDir)
|
|
24616
24618
|
existing.projectDir = decodedPath;
|
|
24619
|
+
try {
|
|
24620
|
+
const fileStat = await stat(historyFile);
|
|
24621
|
+
if (fileStat.mtimeMs > (existing.lastActive ?? existing.startedAt)) {
|
|
24622
|
+
existing.lastActive = fileStat.mtimeMs;
|
|
24623
|
+
}
|
|
24624
|
+
} catch {
|
|
24625
|
+
}
|
|
24617
24626
|
if (!existing.projectConfig) {
|
|
24618
24627
|
existing.projectConfig = await this.getProjectConfig(existing.cwd || decodedPath);
|
|
24619
24628
|
}
|
|
@@ -24639,6 +24648,7 @@ var SessionManager = class {
|
|
|
24639
24648
|
sessionId: entry,
|
|
24640
24649
|
cwd: decodedPath,
|
|
24641
24650
|
startedAt: entryStat.mtimeMs,
|
|
24651
|
+
lastActive: entryStat.mtimeMs,
|
|
24642
24652
|
alive: false,
|
|
24643
24653
|
projectDir: decodedPath
|
|
24644
24654
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as I,a as P,r as u,j as e,N as B}from"./index-C8Brdl4F.js";import{H as R}from"./header-BTV9BL6u.js";import{S as L}from"./search-box-CO7338GK.js";import{T as f}from"./tag-CkZkoVAp.js";function k(t){if(!t)return"unknown";const r=Date.now()-t,l=Math.floor(r/1e3);if(l<30)return"just now";if(l<60)return`${l}s ago`;const c=Math.floor(l/60);if(c<60)return`${c}m ago`;const i=Math.floor(c/60);if(i<24)return`${i}h ago`;const o=Math.floor(i/24);if(o<30)return`${o}d ago`;const d=new Date(t);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][d.getMonth()]} ${d.getDate()}`}function T(t,s=60){return t.length<=s?t:"..."+t.slice(t.length-s+3)}function v(t){return t.lastActive??t.startedAt??0}function E(t,s=120){if(!t)return"";const r=t.replace(/\n/g," ").trim();return r.length<=s?r:r.slice(0,s)+"..."}function S(t){return`claude --resume ${t}`}function D({sessionId:t,size:s="sm"}){const[r,l]=u.useState(!1),c=o=>{o.stopPropagation(),navigator.clipboard.writeText(S(t)),l(!0),window.setTimeout(()=>l(!1),1500)},i=s==="sm";return e.jsx("button",{onClick:c,className:"inline-flex items-center gap-1 rounded transition-colors hover:bg-bg-hover",style:{padding:i?"2px 6px":"4px 10px",fontSize:i?"11px":"12px",color:r?"var(--status-green)":"var(--text-muted)",border:"1px solid var(--card-border)"},title:r?"Copied!":`Copy: ${S(t)}`,children:r?e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),"Resume"]})})}function M({icon:t,label:s,count:r,defaultOpen:l,labelColor:c,children:i}){const[o,d]=u.useState(l??!0);return e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("button",{className:"w-full flex items-center justify-between px-5 py-3 text-left transition-colors hover:bg-bg-hover",style:{borderBottom:o?"1px solid var(--border)":"none"},onClick:()=>d(!o),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base",children:t}),e.jsx("span",{className:"text-sm font-medium",style:{color:c??"var(--text-muted)"},children:s}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-secondary)"},children:r})]}),e.jsx("svg",{className:"w-4 h-4 transition-transform",style:{color:"var(--text-muted)",transform:o?"rotate(0deg)":"rotate(-90deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o&&e.jsx("div",{children:i})]})}function w({session:t,isLast:s,onClick:r}){var l,c,i;return e.jsxs("div",{className:"flex items-start gap-4 px-5 py-4 cursor-pointer transition-colors hover:bg-bg-hover",style:{borderBottom:s?"none":"1px solid var(--border)"},onClick:r,children:[e.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full shrink-0 mt-1.5",style:{backgroundColor:t.alive?"var(--status-green)":"var(--text-muted)"}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[t.name?e.jsx("span",{className:"text-sm font-medium truncate max-w-full",style:{color:"var(--text-primary)"},title:t.name,children:t.name}):e.jsx("span",{className:"font-mono text-sm font-medium",style:{color:"var(--accent-light)"},children:t.sessionId}),t.pid>0&&e.jsx(f,{label:`PID ${t.pid}`,variant:"gray"}),t.ide&&e.jsx(f,{label:`${t.ide.name} (${t.ide.transport})`,variant:"purple"}),((l=t.projectConfig)==null?void 0:l.hasClaudeMd)&&e.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},title:"CLAUDE.md",children:"📄"}),((c=t.projectConfig)==null?void 0:c.hasMcpJson)&&e.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},title:".mcp.json",children:"🔌"}),((i=t.projectConfig)==null?void 0:i.hasProjectSettings)&&e.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},title:"Project Settings",children:"⚙️"}),e.jsx("span",{className:"ml-auto",children:e.jsx(D,{sessionId:t.sessionId})})]}),t.name&&e.jsx("p",{className:"font-mono text-xs truncate",style:{color:"var(--text-muted)"},children:t.sessionId}),e.jsx("p",{className:"font-mono text-xs truncate",style:{color:"var(--text-secondary)"},children:t.cwd}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[e.jsx("span",{className:"text-xs shrink-0",style:{color:"var(--text-muted)"},children:k(t.lastActive??t.startedAt)}),t.lastMessage&&e.jsxs("span",{className:"text-sm truncate",style:{color:"var(--text-secondary)"},children:["💬 ",E(t.lastMessage)]})]})]}),e.jsx("svg",{className:"w-4 h-4 shrink-0 mt-0.5",style:{color:"var(--text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})}function F({session:t,onClose:s}){const r=t!==null,l=u.useCallback(c=>{c.key==="Escape"&&s()},[s]);return u.useEffect(()=>{if(r)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[r,l]),e.jsxs(e.Fragment,{children:[r&&e.jsx("div",{className:"fixed inset-0 z-40",style:{backgroundColor:"var(--overlay-bg)"},onClick:s}),e.jsx("div",{className:"fixed top-0 right-0 z-50 h-full flex flex-col",style:{width:"60%",minWidth:"480px",maxWidth:"900px",backgroundColor:"var(--bg-secondary)",borderLeft:"1px solid var(--card-border)",transform:r?"translateX(0)":"translateX(100%)",transition:"transform 0.25s ease-in-out",boxShadow:r?"-8px 0 32px rgba(0, 0, 0, 0.4)":"none"},children:t&&e.jsx(H,{session:t,onClose:s})})]})}function H({session:t,onClose:s}){const{data:r,isLoading:l}=B(t.historyFile??null),[c,i]=u.useState(""),o=u.useMemo(()=>r?[...c.trim()?r.filter(x=>x.text.toLowerCase().includes(c.toLowerCase())):r].sort((x,y)=>{const h=x.timestamp?Date.parse(x.timestamp):0;return(y.timestamp?Date.parse(y.timestamp):0)-h}):[],[r,c]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 shrink-0 gap-3",style:{borderBottom:"1px solid var(--border)"},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[e.jsx("span",{className:"inline-block w-3 h-3 rounded-full shrink-0",style:{backgroundColor:t.alive?"var(--status-green)":"var(--text-muted)"}}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-base font-medium truncate",style:{color:"var(--text-primary)"},title:t.name??void 0,children:t.name??(t.pid>0?`PID ${t.pid}`:"Session")}),e.jsx(f,{label:t.alive?"Running":"Terminated",variant:t.alive?"green":"gray"}),t.ide&&e.jsx(f,{label:`${t.ide.name} (${t.ide.transport})`,variant:"purple"})]}),t.name&&t.pid>0&&e.jsxs("p",{className:"text-xs mt-0.5",style:{color:"var(--text-muted)"},children:["PID ",t.pid]})]})]}),e.jsx(D,{sessionId:t.sessionId,size:"md"}),e.jsx("button",{className:"w-8 h-8 rounded-lg flex items-center justify-center shrink-0 transition-colors hover:bg-bg-hover",style:{color:"var(--text-secondary)"},onClick:s,children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-5 space-y-6",children:[e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Metadata"}),e.jsxs("div",{className:"rounded-lg p-4 space-y-3",style:{backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--border)"},children:[e.jsx(j,{label:"Session ID",children:e.jsx("code",{className:"text-xs font-mono break-all",style:{color:"var(--accent-light)"},children:t.sessionId})}),t.pid>0&&e.jsx(j,{label:"PID",children:e.jsx("code",{className:"text-xs font-mono",style:{color:"var(--accent-light)"},children:t.pid})}),e.jsx(j,{label:"Working Directory",children:e.jsx("code",{className:"text-xs font-mono break-all",style:{color:"var(--text-secondary)"},children:t.cwd})}),t.projectDir&&t.projectDir!==t.cwd&&e.jsx(j,{label:"Project Directory",children:e.jsx("code",{className:"text-xs font-mono break-all",style:{color:"var(--text-secondary)"},children:t.projectDir})}),e.jsx(j,{label:"Started",children:e.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:t.startedAt?`${new Date(t.startedAt).toLocaleString()} (${k(t.startedAt)})`:"Unknown"})}),t.lastActive&&t.lastActive!==t.startedAt&&e.jsx(j,{label:"Last Active",children:e.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:`${new Date(t.lastActive).toLocaleString()} (${k(t.lastActive)})`})}),t.ide&&e.jsx(j,{label:"IDE",children:e.jsxs("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:[t.ide.name,e.jsx("span",{style:{color:"var(--text-muted)"},children:" via "}),t.ide.transport]})}),t.projectConfig&&e.jsx(j,{label:"Project Config",children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.projectConfig.hasClaudeMd&&e.jsx(f,{label:"CLAUDE.md",variant:"blue"}),t.projectConfig.hasMcpJson&&e.jsx(f,{label:".mcp.json",variant:"purple"}),t.projectConfig.hasProjectSettings&&e.jsx(f,{label:"Project Settings",variant:"orange"}),!t.projectConfig.hasClaudeMd&&!t.projectConfig.hasMcpJson&&!t.projectConfig.hasProjectSettings&&e.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"None detected"})]})})]})]}),e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Instruction History"}),t.historyFile?l?e.jsxs("div",{className:"flex items-center gap-2 py-4",children:[e.jsx("span",{className:"inline-block w-4 h-4 rounded-full border-2 animate-spin",style:{borderColor:"var(--card-border)",borderTopColor:"var(--accent-light)"}}),e.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:"Loading history..."})]}):!r||r.length===0?e.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"No user messages found in session history."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-3",children:e.jsx(L,{value:c,onChange:i,placeholder:"Filter instructions..."})}),e.jsxs("p",{className:"text-xs mb-3",style:{color:"var(--text-muted)"},children:[o.length," of ",r.length," message",r.length!==1?"s":""]}),e.jsx("div",{className:"space-y-2",children:o.length===0?e.jsx("p",{className:"text-xs py-4 text-center",style:{color:"var(--text-muted)"},children:"No messages match your filter."}):o.map((d,x)=>e.jsxs("div",{className:"rounded-lg p-3",style:{backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--border)"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx(f,{label:d.role??"user",variant:"blue"}),d.timestamp&&e.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:new Date(d.timestamp).toLocaleString()})]}),e.jsx("p",{className:"text-xs whitespace-pre-wrap break-words mt-2",style:{color:"var(--text-secondary)"},children:d.text.length>800?d.text.slice(0,800)+"...":d.text})]},x))})]}):e.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"No history file available for this session."})]})]})]})}function j({label:t,children:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6",children:[e.jsx("span",{className:"text-xs shrink-0",style:{color:"var(--text-muted)"},children:t}),e.jsx("div",{className:"text-right",children:s})]})}function X(){const{t}=I(),{data:s,isLoading:r}=P(),l=s??[],[c,i]=u.useState(null),[o,d]=u.useState(""),[x,y]=u.useState("all"),h=u.useMemo(()=>{if(!o.trim())return l;const a=o.toLowerCase();return l.filter(n=>n.cwd.toLowerCase().includes(a)||n.sessionId.toLowerCase().includes(a)||String(n.pid).includes(a)||(n.lastMessage??"").toLowerCase().includes(a)||(n.projectDir??"").toLowerCase().includes(a))},[l,o]),g=u.useMemo(()=>h.filter(a=>a.alive).sort((a,n)=>v(n)-v(a)),[h]),C=u.useMemo(()=>{const a=h.filter(m=>!m.alive).sort((m,p)=>v(p)-v(m)),n={};for(const m of a){const p=m.projectDir||m.cwd||"Unknown";n[p]||(n[p]=[]),n[p].push(m)}return Object.entries(n).sort(([,m],[,p])=>{const $=Math.max(...m.map(N=>v(N)));return Math.max(...p.map(N=>v(N)))-$})},[h]),b=u.useMemo(()=>[...h].sort((a,n)=>v(n)-v(a)).slice(0,10),[h]),A=l.length;return e.jsxs("div",{children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-bg-primary",children:[e.jsx(R,{title:t("activity.title"),subtitle:r?"Loading sessions...":t("activity.subtitle",{running:g.length,total:A})}),e.jsxs("div",{className:"flex items-center gap-1 mb-4",children:[e.jsx("button",{className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors",style:{backgroundColor:x==="recent"?"var(--accent)":"transparent",color:x==="recent"?"#fff":"var(--text-muted)"},onClick:()=>y("recent"),children:t("activity.recent",{count:10})}),e.jsx("button",{className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors",style:{backgroundColor:x==="all"?"var(--accent)":"transparent",color:x==="all"?"#fff":"var(--text-muted)"},onClick:()=>y("all"),children:t("activity.allSessions")}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"w-72",children:e.jsx(L,{value:o,onChange:d,placeholder:t("activity.searchPlaceholder")})})]})]}),r?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):x==="recent"?b.length===0?e.jsx("div",{className:"rounded-lg p-8 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No recent sessions."})}):e.jsx("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:b.map((a,n)=>e.jsx(w,{session:a,isLast:n===b.length-1,onClick:()=>i(a)},a.sessionId))}):h.length===0?e.jsxs("div",{className:"rounded-lg p-8 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("p",{className:"text-lg mb-2",style:{color:"var(--text-muted)"},children:o?"No matching sessions":"No sessions found"}),e.jsx("p",{className:"text-sm",style:{color:"var(--text-faint)"},children:o?"Try a different search term.":"Sessions appear here when Claude Code instances are running or have conversation history."})]}):e.jsxs("div",{className:"space-y-6",children:[g.length>0&&e.jsx(M,{icon:"🟢",label:"Running",count:g.length,defaultOpen:!0,labelColor:"var(--status-green)",children:g.map((a,n)=>e.jsx(w,{session:a,isLast:n===g.length-1,onClick:()=>i(a)},a.sessionId))}),C.map(([a,n])=>e.jsx(M,{icon:"📁",label:T(a),count:n.length,defaultOpen:C.length<=3,children:n.map((m,p)=>e.jsx(w,{session:m,isLast:p===n.length-1,onClick:()=>i(m)},m.sessionId))},a))]}),e.jsx(F,{session:c,onClose:()=>i(null)})]})}export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as w,D as S,r as a,j as e,k as L,A as B}from"./index-
|
|
1
|
+
import{u as w,D as S,r as a,j as e,k as L,A as B}from"./index-C8Brdl4F.js";import{H as E}from"./header-BTV9BL6u.js";import{T as M}from"./tag-CkZkoVAp.js";import{M as P}from"./markdown-viewer-Bcu9HM71.js";function N({icon:o,label:r,count:l,children:c}){const[n,s]=a.useState(!0);return e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("button",{className:"w-full flex items-center justify-between px-5 py-3 text-left transition-colors hover:bg-bg-hover",style:{borderBottom:n?"1px solid var(--border)":"none"},onClick:()=>s(!n),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base",children:o}),e.jsx("span",{className:"text-sm font-medium",style:{color:r==="User"?"var(--accent-light)":"var(--text-muted)"},children:r}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-secondary)"},children:l})]}),e.jsx("svg",{className:"w-4 h-4 transition-transform",style:{color:"var(--text-muted)",transform:n?"rotate(0deg)":"rotate(-90deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&e.jsx("div",{children:c})]})}function k({cmd:o,isLast:r,onClick:l}){return e.jsxs("div",{className:"flex items-start gap-4 px-5 py-4 cursor-pointer transition-colors hover:bg-bg-hover",style:{borderBottom:r?"none":"1px solid var(--border)"},onClick:l,children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("code",{className:"text-sm font-mono font-medium",style:{color:"var(--accent-light)"},children:["/",o.name]}),o.args&&o.args.length>0&&e.jsx("span",{className:"text-xs font-mono",style:{color:"var(--text-muted)"},children:o.args.map(c=>`[${c}]`).join(" ")})]}),o.description&&e.jsx("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:o.description})]}),e.jsx("svg",{className:"w-4 h-4 shrink-0 mt-0.5",style:{color:"var(--text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})}function z(){const{t:o}=w(),{data:r,isLoading:l,mutate:c}=S(),n=r??[],[s,p]=a.useState(null),[g,i]=a.useState(null),[f,v]=a.useState(!1),[j,x]=a.useState(!1),[h,y]=a.useState(""),m=n.filter(t=>t.source==="user"),u=n.filter(t=>t.source!=="user");async function b(t){p(t),i(null),v(!0);try{const{content:d}=await L(t.filePath);i(d)}catch{i("*Failed to load content*")}finally{v(!1)}}async function C(){if(s)try{await B(s.filePath,h),i(h),x(!1),c()}catch(t){console.error("Failed to save",t)}}return e.jsxs("div",{children:[e.jsx(E,{title:o("config.commands.title",{n:n.length})}),l?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):n.length===0?e.jsx("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No custom commands found."})}):e.jsxs("div",{className:"space-y-6",children:[m.length>0&&e.jsx(N,{icon:"👤",label:"User",count:m.length,children:m.map((t,d)=>e.jsx(k,{cmd:t,isLast:d===m.length-1,onClick:()=>b(t)},t.name))}),u.length>0&&e.jsx(N,{icon:"🔧",label:"System",count:u.length,children:u.map((t,d)=>e.jsx(k,{cmd:t,isLast:d===u.length-1,onClick:()=>b(t)},t.name))})]}),s&&e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col",style:{backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 shrink-0",style:{borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-secondary)"},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsxs("code",{className:"text-base font-mono font-medium",style:{color:"var(--accent-light)"},children:["/",s.name]}),e.jsx(M,{label:s.source==="user"?"User":"System",variant:s.source==="user"?"purple":"gray"}),s.description&&e.jsxs("span",{className:"text-xs truncate",style:{color:"var(--text-muted)"},children:["— ",s.description]})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsx("code",{className:"text-xs font-mono hidden lg:block",style:{color:"var(--text-muted)"},children:s.filePath}),s.source==="user"&&!j&&!f&&e.jsx("button",{onClick:()=>{x(!0),y(g??"")},className:"px-3 py-1.5 rounded-lg text-sm font-medium transition-colors hover:bg-bg-hover",style:{color:"var(--accent-light)"},children:"Edit"}),e.jsx("button",{className:"w-8 h-8 rounded-lg flex items-center justify-center transition-colors hover:bg-bg-hover",style:{color:"var(--text-secondary)"},onClick:()=>{p(null),x(!1),i(null)},children:"✕"})]})]}),e.jsx("div",{className:"flex-1 overflow-auto px-8 py-6",children:j?e.jsxs("div",{className:"max-w-4xl mx-auto flex flex-col h-full",children:[e.jsx("textarea",{value:h,onChange:t=>y(t.target.value),className:"flex-1 w-full p-4 rounded-lg font-mono text-sm resize-none outline-none",style:{backgroundColor:"var(--bg-secondary)",color:"var(--text-secondary)",border:"1px solid var(--card-border)",minHeight:"500px"}}),e.jsxs("div",{className:"flex gap-3 mt-4 justify-end",children:[e.jsx("button",{onClick:()=>x(!1),className:"px-4 py-2 rounded-lg text-sm btn-secondary",children:"Cancel"}),e.jsx("button",{onClick:C,className:"px-4 py-2 rounded-lg text-sm btn-primary",children:"Save"})]})]}):f?e.jsx("div",{className:"max-w-4xl mx-auto text-center py-12",children:e.jsx("p",{style:{color:"var(--text-muted)"},children:"Loading content..."})}):e.jsx(P,{content:g??"*No content available*",className:"max-w-4xl mx-auto skill-markdown"})})]})]})}export{z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,u as g,a as k,b as N,c as M,d as j,e as C,r as b}from"./index-C8Brdl4F.js";import{H as L}from"./header-BTV9BL6u.js";function v({title:r,value:n,subtitle:s}){return e.jsxs("div",{className:"rounded-lg p-5",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("p",{className:"text-xs uppercase tracking-wider mb-2",style:{color:"var(--text-muted)",fontWeight:510},children:r}),e.jsx("p",{className:"text-3xl mb-1",style:{color:"var(--text-primary)",fontWeight:510},children:n}),s&&e.jsx("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:s})]})}function $(r){if(!r)return"";const n=Date.now()-r,s=Math.floor(n/1e3);if(s<30)return"just now";if(s<60)return`${s}s ago`;const l=Math.floor(s/60);if(l<60)return`${l}m ago`;const o=Math.floor(l/60);if(o<24)return`${o}h ago`;const a=Math.floor(o/24);if(a<30)return`${a}d ago`;const t=new Date(r);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]} ${t.getDate()}`}function p({title:r,entries:n,barColor:s,maxItems:l=8}){const o=n.slice(0,l),a=o.length>0?o[0].usageCount:0;return e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("div",{className:"px-5 py-3",style:{borderBottom:"1px solid var(--border)"},children:e.jsx("h3",{className:"text-lg",style:{color:"var(--text-primary)",fontWeight:510},children:r})}),o.length===0?e.jsx("div",{className:"px-5 py-6 text-center",children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No data yet."})}):e.jsx("div",{className:"py-1",children:o.map(t=>{const c=a>0?t.usageCount/a*100:0,i=$(t.lastUsedAt);return e.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 transition-colors",onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--bg-hover)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{className:"font-mono text-xs shrink-0 truncate",style:{color:"var(--accent-light)",width:"180px"},title:t.name,children:t.name.length>26?t.name.slice(0,24)+"...":t.name}),e.jsx("div",{className:"flex-1 h-5 rounded overflow-hidden",style:{backgroundColor:"var(--border)"},children:e.jsx("div",{className:"h-full rounded",style:{width:`${Math.max(c,2)}%`,backgroundColor:s,opacity:.85,transition:"width 0.3s ease"}})}),e.jsx("span",{className:"text-xs shrink-0 text-right",style:{color:"var(--text-secondary)",width:"44px",fontWeight:510},children:t.usageCount}),i&&e.jsx("span",{className:"text-xs shrink-0 text-right",style:{color:"var(--text-faint)",width:"64px"},children:i})]},t.name)})})]})}function S(r){if(!r)return"";const n=Date.now()-r,s=Math.floor(n/1e3);if(s<30)return"just now";if(s<60)return`${s}s ago`;const l=Math.floor(s/60);if(l<60)return`${l}m ago`;const o=Math.floor(l/60);if(o<24)return`${o}h ago`;const a=Math.floor(o/24);if(a<30)return`${a}d ago`;const t=new Date(r);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]} ${t.getDate()}`}function B(r,n=48){return r?r.length<=n?r:"..."+r.slice(r.length-n+3):""}function W(r,n=80){if(!r)return"";const s=r.replace(/\n/g," ").trim();return s.length<=n?s:s.slice(0,n)+"..."}function A(){const{t:r}=g(),{data:n,isLoading:s}=k(),l=N(),o=(n??[]).slice().sort((a,t)=>(t.lastActive??t.startedAt)-(a.lastActive??a.startedAt)).slice(0,5);return e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("div",{className:"px-5 py-3 flex items-center justify-between",style:{borderBottom:"1px solid var(--border)"},children:[e.jsx("h3",{className:"text-lg",style:{color:"var(--text-primary)",fontWeight:510},children:r("overview.recentSessions")}),e.jsx("button",{className:"text-xs transition-colors",style:{color:"var(--text-muted)"},onClick:()=>l("/activity"),children:r("overview.viewAll")})]}),s?e.jsx("div",{className:"px-5 py-6",children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Loading..."})}):o.length===0?e.jsx("div",{className:"px-5 py-6 text-center",children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No sessions found."})}):e.jsx("div",{children:o.map((a,t)=>e.jsxs("div",{className:"flex items-start gap-3 px-5 py-3 cursor-pointer transition-colors",style:{borderBottom:t<o.length-1?"1px solid var(--border)":"none"},onClick:()=>l("/activity"),onMouseEnter:c=>{c.currentTarget.style.backgroundColor="var(--bg-hover)"},onMouseLeave:c=>{c.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full shrink-0 mt-1.5",style:{backgroundColor:a.alive?"var(--status-green)":"var(--text-muted)"}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[a.name&&e.jsx("p",{className:"text-sm font-medium truncate mb-0.5",style:{color:"var(--text-primary)"},title:a.name,children:a.name}),e.jsx("p",{className:"font-mono text-xs truncate mb-0.5",style:{color:"var(--text-secondary)"},title:a.projectDir??a.cwd,children:B(a.projectDir??a.cwd)}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-xs shrink-0",style:{color:"var(--text-faint)"},children:S(a.lastActive??a.startedAt)}),a.lastMessage&&e.jsx("span",{className:"text-xs truncate",style:{color:"var(--text-faint)"},children:W(a.lastMessage)})]})]})]},a.sessionId))})]})}function h({icon:r,label:n,children:s}){return e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 transition-colors",onMouseEnter:l=>{l.currentTarget.style.backgroundColor="var(--bg-hover)"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="transparent"},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"shrink-0 w-5 h-5 flex items-center justify-center",style:{color:"var(--text-muted)"},children:r}),e.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:n})]}),e.jsx("div",{className:"flex items-center gap-2",children:s})]})}function x({label:r,color:n}){const l={green:{bg:"rgba(39, 166, 68, 0.15)",text:"var(--status-green)"},blue:{bg:"rgba(94, 106, 210, 0.15)",text:"var(--accent-light)"},yellow:{bg:"rgba(138, 143, 152, 0.15)",text:"var(--text-secondary)"},gray:{bg:"var(--border)",text:"var(--text-muted)"}}[n];return e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:l.bg,color:l.text,fontWeight:510},children:r})}function D(){return e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",style:{color:"var(--status-green)"},children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function T(){return e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}function H(){return e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 10h16M4 14h16M4 18h16"})})}function R(){return e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2"})})}function I(){return e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}function J(){return e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})}function E(){const{t:r}=g(),{data:n,isLoading:s}=M(),{data:l,isLoading:o}=j(),a=s||o,t=n??{},c=l,i=t.model??"",d=t.hooks??{},u=Object.values(d).reduce((w,f)=>w+(Array.isArray(f)?f.length:0),0),y=t.env??{},m=Object.keys(y).length;return e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("div",{className:"px-5 py-3",style:{borderBottom:"1px solid var(--border)"},children:e.jsx("h3",{className:"text-lg",style:{color:"var(--text-primary)",fontWeight:510},children:r("overview.environmentHealth")})}),a?e.jsx("div",{className:"px-5 py-6",children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Loading..."})}):e.jsxs("div",{children:[e.jsx(h,{icon:e.jsx(T,{}),label:"Model",children:i?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm font-mono",style:{color:"var(--accent-light)"},children:i.length>30?i.slice(0,28)+"...":i}),e.jsx(D,{})]}):e.jsx("span",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Not configured"})}),e.jsx(h,{icon:e.jsx(H,{}),label:r("overview.plugins"),children:c&&c.plugins>0?e.jsx(x,{label:r("overview.active",{count:c.plugins}),color:"green"}):e.jsx(x,{label:r("overview.hooksNone"),color:"gray"})}),e.jsx(h,{icon:e.jsx(R,{}),label:r("overview.mcpServers"),children:c&&c.mcpServers>0?e.jsx(x,{label:r("overview.configured",{count:c.mcpServers}),color:"blue"}):e.jsx(x,{label:r("overview.hooksNone"),color:"gray"})}),e.jsx(h,{icon:e.jsx(I,{}),label:"Hooks",children:u>0?e.jsx(x,{label:`${u} hook${u!==1?"s":""}`,color:"yellow"}):e.jsx(x,{label:r("overview.hooksNone"),color:"gray"})}),e.jsx(h,{icon:e.jsx(J,{}),label:"Env Vars",children:m>0?e.jsx(x,{label:r("overview.envSet",{count:m}),color:"blue"}):e.jsx(x,{label:r("overview.hooksNone"),color:"gray"})})]})]})}function O(r){if(!r)return"";const n=Date.now()-r,s=Math.floor(n/1e3);if(s<30)return"just now";if(s<60)return`${s}s ago`;const l=Math.floor(s/60);if(l<60)return`${l}m ago`;const o=Math.floor(l/60);if(o<24)return`${o}h ago`;const a=Math.floor(o/24);if(a<30)return`${a}d ago`;const t=new Date(r);return`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t.getMonth()]} ${t.getDate()}`}function U({entry:r,maxCount:n,barColor:s}){const l=n>0?r.usageCount/n*100:0,o=O(r.lastUsedAt);return e.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 transition-colors hover:bg-bg-hover",children:[e.jsx("span",{className:"font-mono text-xs shrink-0",style:{color:"var(--accent-light)",width:"200px"},title:r.name,children:r.name.length>28?r.name.slice(0,26)+"...":r.name}),e.jsx("div",{className:"flex-1 h-5 rounded overflow-hidden",style:{backgroundColor:"var(--border)"},children:e.jsx("div",{className:"h-full rounded",style:{width:`${Math.max(l,2)}%`,backgroundColor:s,opacity:.85,transition:"width 0.3s ease"}})}),e.jsx("span",{className:"text-xs shrink-0 text-right",style:{color:"var(--text-secondary)",width:"44px",fontWeight:510},children:r.usageCount}),o&&e.jsx("span",{className:"text-xs shrink-0 text-right",style:{color:"var(--text-faint)",width:"64px"},children:o})]})}function V({server:r,tools:n,totalCalls:s,toolCount:l}){const[o,a]=b.useState(!1),t=n.length>0?n[0].usageCount:0;return e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("button",{className:"w-full flex items-center justify-between px-5 py-3 text-left transition-colors hover:bg-bg-hover",style:{borderBottom:o?"1px solid var(--border)":"none"},onClick:()=>a(!o),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-mono text-sm",style:{color:"var(--text-secondary)",fontWeight:510},children:r}),e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-secondary)"},children:[s," calls"]}),e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-muted)"},children:[l," tools"]})]}),e.jsx("svg",{className:"w-4 h-4 transition-transform",style:{color:"var(--text-faint)",transform:o?"rotate(0deg)":"rotate(-90deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),o&&e.jsx("div",{className:"py-1",children:n.map(c=>e.jsx(U,{entry:c,maxCount:t,barColor:"var(--accent)"},c.name))})]})}function F({metrics:r,mcpToolsByServer:n}){const[s,l]=b.useState(!0);return r.mcpServerBreakdown.length===0?null:e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("button",{className:"w-full flex items-center justify-between px-5 py-3 text-left transition-colors hover:bg-bg-hover",style:{borderBottom:s?"1px solid var(--border)":"none"},onClick:()=>l(!s),children:[e.jsx("h2",{className:"text-lg",style:{color:"var(--text-primary)",fontWeight:510},children:"MCP Server Usage"}),e.jsx("svg",{className:"w-4 h-4 transition-transform",style:{color:"var(--text-faint)",transform:s?"rotate(0deg)":"rotate(-90deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),s&&e.jsx("div",{className:"p-5 space-y-3",children:r.mcpServerBreakdown.map(o=>e.jsx(V,{server:o.server,tools:n[o.server]??[],totalCalls:o.totalCalls,toolCount:o.toolCount},o.server))})]})}function q(){const{t:r}=g(),{data:n,isLoading:s}=j(),{data:l,isLoading:o}=C(),a=s||o,t=n,c=l,i={};if(c!=null&&c.mcpTools)for(const d of c.mcpTools){const u=d.mcpServer??"unknown";i[u]||(i[u]=[]),i[u].push(d)}return e.jsxs("div",{children:[e.jsx(L,{title:r("overview.title")}),a?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-5 gap-4",children:[e.jsx(v,{title:r("overview.plugins"),value:(t==null?void 0:t.plugins)??0,color:"purple"}),e.jsx(v,{title:r("overview.mcpServers"),value:(t==null?void 0:t.mcpServers)??0,color:"blue"}),e.jsx(v,{title:r("overview.skills"),value:(t==null?void 0:t.skills)??0,color:"green"}),e.jsx(v,{title:r("overview.profiles"),value:(t==null?void 0:t.profiles)??0,color:"orange"}),e.jsx(v,{title:r("overview.sessions"),value:(t==null?void 0:t.sessions)??0,color:"blue"})]}),c&&e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsx(p,{title:r("overview.topSkills"),entries:c.topSkills,barColor:"var(--accent)",maxItems:8}),e.jsx(p,{title:r("overview.topTools"),entries:c.topTools,barColor:"var(--accent-light)",maxItems:8})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsx(A,{}),e.jsx(E,{})]}),c&&e.jsx(F,{metrics:c,mcpToolsByServer:i})]})]})}export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-C8Brdl4F.js";import{T as c}from"./tag-CkZkoVAp.js";function p({open:r,onClose:a,title:n,subtitle:l,icon:t,tags:s,children:d,actions:o}){return e.jsxs(e.Fragment,{children:[r&&e.jsx("div",{className:"fixed inset-0 z-40",style:{backgroundColor:"var(--overlay-bg)"},onClick:a}),e.jsxs("div",{className:"fixed top-0 right-0 z-50 h-full flex flex-col",style:{width:"440px",backgroundColor:"var(--bg-secondary)",borderLeft:"1px solid var(--card-border)",transform:r?"translateX(0)":"translateX(100%)",transition:"transform 0.25s ease-in-out",boxShadow:r?"-8px 0 32px rgba(0, 0, 0, 0.4)":"none"},children:[e.jsxs("div",{className:"flex items-start justify-between p-5 shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[t&&e.jsx("div",{className:"shrink-0 mt-0.5 text-xl",children:t}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"truncate",style:{color:"var(--text-primary)",fontWeight:510},children:n}),l&&e.jsx("p",{className:"text-sm mt-0.5 truncate",style:{color:"var(--text-secondary)"},children:l}),s&&s.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:s.map((i,x)=>e.jsx(c,{label:i.label,variant:i.variant},x))})]})]}),e.jsx("button",{onClick:a,className:"shrink-0 ml-3 p-1 rounded transition-colors",style:{color:"var(--text-muted)"},"aria-label":"Close panel",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:d}),o&&e.jsx("div",{className:"shrink-0 flex items-center justify-end gap-3 p-4",style:{borderTop:"1px solid var(--border)"},children:o})]})]})}export{p as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-C8Brdl4F.js";function i({title:r,subtitle:s,children:t}){return e.jsxs("div",{className:"sticky top-0 z-10 pb-4 flex items-start justify-between mb-6",style:{backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl",style:{color:"var(--text-primary)",fontWeight:510,letterSpacing:"-0.288px"},children:r}),s&&e.jsx("p",{className:"text-sm mt-1",style:{color:"var(--text-secondary)"},children:s})]}),t&&e.jsx("div",{className:"flex items-center gap-3 shrink-0 ml-6",children:t})]})}export{i as H};
|