@lore-ai/cli 0.1.6
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 +178 -0
- package/dist/bin/lore.js +14666 -0
- package/dist/bin/lore.js.map +1 -0
- package/dist/ui/assets/Analytics-W2ANIC2s.js +1 -0
- package/dist/ui/assets/ConversationDetail-Ct-hROwS.js +5 -0
- package/dist/ui/assets/Conversations-iK7E6GEl.js +1 -0
- package/dist/ui/assets/MarkdownPreview-2zDiish4.js +17 -0
- package/dist/ui/assets/MarkdownPreview-ZgkIHsf0.css +1 -0
- package/dist/ui/assets/Mcps-CCT1FQ4H.js +1 -0
- package/dist/ui/assets/Overview-B_jOY8il.js +1 -0
- package/dist/ui/assets/PhaseReview-B_DDY9YB.js +1 -0
- package/dist/ui/assets/RepoScans-FxiMynYO.js +2 -0
- package/dist/ui/assets/RepoSelector-DmPRS8kf.js +1 -0
- package/dist/ui/assets/ResizablePanels-Bbb4S6Ss.js +1 -0
- package/dist/ui/assets/Review-KjvS-DNP.js +3 -0
- package/dist/ui/assets/ScanConversation-BonEB7pv.js +1 -0
- package/dist/ui/assets/Scans-DXf2sNms.js +1 -0
- package/dist/ui/assets/Skills-MvVWWoB2.js +1 -0
- package/dist/ui/assets/ToolUsage-DA5MJNwl.js +33 -0
- package/dist/ui/assets/Vetting-BRGVrtOA.js +1 -0
- package/dist/ui/assets/index-CVSL0ryk.js +12 -0
- package/dist/ui/assets/index-DYKYIfPr.css +1 -0
- package/dist/ui/assets/markdown-CZuQZQX5.js +35 -0
- package/dist/ui/index.html +15 -0
- package/package.json +96 -0
- package/prompts/analyze-feedback.md +67 -0
- package/prompts/apply-refs-update.md +149 -0
- package/prompts/apply-skill-update.md +151 -0
- package/prompts/check-relevance.md +137 -0
- package/prompts/classify-conversations.md +78 -0
- package/prompts/cluster-repo-summaries.md +76 -0
- package/prompts/detect-staleness.md +42 -0
- package/prompts/distill-changes.md +62 -0
- package/prompts/distill-decisions.md +48 -0
- package/prompts/distill-patterns.md +39 -0
- package/prompts/generate-changelog.md +42 -0
- package/prompts/generate-references.md +192 -0
- package/prompts/generate-repo-skill.md +387 -0
- package/prompts/global-summary.md +55 -0
- package/prompts/orchestrate-merge.md +70 -0
- package/prompts/pr-description.md +49 -0
- package/prompts/research-repo.md +121 -0
- package/prompts/summarize-conversation.md +64 -0
- package/prompts/test-mcp.md +62 -0
- package/prompts/test-skill.md +72 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./markdown-CZuQZQX5.js";import{T as o}from"./index-CVSL0ryk.js";import{t as h}from"./Overview-B_jOY8il.js";const j="";async function m(a){const t=await fetch(`${j}${a}`);if(!t.ok)throw new Error(`Failed to fetch ${a}`);return t.json()}function N(){const a=o({queryKey:["metrics","overview"],queryFn:()=>m("/api/metrics/overview"),staleTime:3e4}),t=o({queryKey:["metrics","quality"],queryFn:()=>m("/api/metrics/quality"),staleTime:6e4}),n=o({queryKey:["metrics","memory"],queryFn:()=>m("/api/metrics/memory"),staleTime:6e4});if(a.isLoading||t.isLoading||n.isLoading)return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("div",{className:"text-zinc-500",children:"Loading analytics..."})});const r=a.data,c=t.data,x=n.data;return e.jsxs("div",{className:"max-w-6xl",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-6",children:"Analytics"}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[e.jsx(l,{label:"Total Scans",value:r?.totalScans??0,color:"text-blue-400"}),e.jsx(l,{label:"Avg Duration",value:`${Math.round((r?.averageDurationMs??0)/1e3)}s`,color:"text-emerald-400"}),e.jsx(l,{label:"Rate-Limit Events",value:r?.totalRateLimitEvents??0,color:"text-amber-400"}),e.jsx(l,{label:"Avg Score",value:c?.summary.averageScore??0,color:"text-purple-400",suffix:"/100"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-8",children:[e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-zinc-400 uppercase tracking-wider mb-3",children:"Skill Quality"}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-emerald-400",children:c?.summary.approved??0}),e.jsx("div",{className:"text-xs text-zinc-500",children:"Approved"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-amber-400",children:c?.summary.probation??0}),e.jsx("div",{className:"text-xs text-zinc-500",children:"Probation"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-red-400",children:c?.summary.rejected??0}),e.jsx("div",{className:"text-xs text-zinc-500",children:"Rejected"})]})]}),e.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:c?.skills.map(s=>e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded bg-[#1e1f2a]",children:[e.jsx(p,{status:s.status}),e.jsx("span",{className:"text-sm text-zinc-200 flex-1 truncate",children:s.name}),e.jsxs("span",{className:"text-xs text-zinc-400",children:["usage:",s.passiveUsage]}),e.jsx(u,{score:s.breakdown.total})]},s.name))})]}),e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-zinc-400 uppercase tracking-wider mb-3",children:"Corrections Detected"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-400",children:c?.corrections.total??0}),e.jsx("div",{className:"text-xs text-zinc-500",children:"Total"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-amber-400",children:c?.corrections.highConfidence??0}),e.jsx("div",{className:"text-xs text-zinc-500",children:"High Confidence"})]})]}),c?.corrections.lastScanAt&&e.jsxs("div",{className:"text-xs text-zinc-500",children:["Last scanned: ",h(c.corrections.lastScanAt)]})]})]}),e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4 mb-8",children:[e.jsx("h3",{className:"text-sm font-semibold text-zinc-400 uppercase tracking-wider mb-3",children:"Phase Performance (Averages)"}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:Object.entries(r?.phaseAverages??{}).map(([s,i])=>e.jsxs("div",{className:"bg-[#1e1f2a] rounded-lg p-3",children:[e.jsx("div",{className:"text-sm font-medium text-zinc-200 capitalize",children:s}),e.jsxs("div",{className:"flex items-end gap-2 mt-1",children:[e.jsxs("span",{className:"text-xl font-bold text-blue-400",children:[Math.round(i.avgDurationMs/1e3),"s"]}),e.jsxs("span",{className:"text-xs text-zinc-500 mb-0.5",children:[i.avgItems," items"]})]})]},s))})]}),e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4 mb-8",children:[e.jsx("h3",{className:"text-sm font-semibold text-zinc-400 uppercase tracking-wider mb-3",children:"Memory Usage"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-zinc-500 text-sm",children:"Total Conversations:"})," ",e.jsx("span",{className:"text-zinc-200",children:x?.totalConversations??0})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-zinc-500 text-sm",children:"Estimated Tokens:"})," ",e.jsx("span",{className:"text-zinc-200",children:(x?.totalTokensEstimate??0).toLocaleString()})]})]}),e.jsx("div",{className:"space-y-2 max-h-40 overflow-y-auto",children:Object.entries(x?.perRepo??{}).map(([s,i])=>e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded bg-[#1e1f2a] text-sm",children:[e.jsx("span",{className:"text-zinc-200 flex-1 truncate",children:s}),e.jsxs("span",{className:"text-xs text-zinc-400",children:[i.count," convos"]}),e.jsxs("span",{className:"text-xs text-zinc-500",children:[i.tokens.toLocaleString()," tok"]})]},s))})]}),e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-zinc-400 uppercase tracking-wider mb-3",children:"Recent Scans"}),e.jsxs("div",{className:"space-y-1",children:[(r?.recentScans??[]).map(s=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg bg-[#1e1f2a]",children:[e.jsx("span",{className:s.success?"text-emerald-400":"text-red-400",children:s.success?"โ":"โ"}),e.jsx("span",{className:"text-sm text-zinc-200 flex-1",children:h(s.startedAt)}),e.jsxs("span",{className:"text-xs text-zinc-400",children:[Math.round(s.totalDurationMs/1e3),"s"]}),e.jsxs("span",{className:"text-xs text-zinc-500",children:[s.totalItemsProcessed," items"]}),e.jsx("span",{className:"text-[10px] text-zinc-600",children:s.trigger}),s.totalRateLimitEvents>0&&e.jsxs("span",{className:"text-[10px] text-amber-400",children:["RL:",s.totalRateLimitEvents]})]},s.id)),(r?.recentScans??[]).length===0&&e.jsxs("p",{className:"text-sm text-zinc-500 px-3 py-4",children:["No scans recorded yet. Run ",e.jsx("code",{className:"text-zinc-300",children:"lore sync"})," to start."]})]})]})]})}function l({label:a,value:t,color:n,suffix:d}){return e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4",children:[e.jsxs("div",{className:`text-3xl font-bold ${n}`,children:[typeof t=="number"?t.toLocaleString():t,d&&e.jsx("span",{className:"text-lg text-zinc-500",children:d})]}),e.jsx("div",{className:"text-sm text-zinc-500 mt-1",children:a})]})}function p({status:a}){const t={approved:"bg-emerald-400",probation:"bg-amber-400",rejected:"bg-red-400"};return e.jsx("span",{className:`w-2 h-2 rounded-full ${t[a]??"bg-zinc-400"}`})}function u({score:a}){let t="text-red-400";return a>=70?t="text-emerald-400":a>=50&&(t="text-amber-400"),e.jsx("span",{className:`text-xs font-mono font-bold ${t}`,children:a})}export{N as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as h,j as e}from"./markdown-CZuQZQX5.js";import{S as j,M as w,t as y,T as m}from"./Overview-B_jOY8il.js";import{c as g,d as b,L as v}from"./index-CVSL0ryk.js";const N=/^```(\w*)\s*$/;function k(t){const n=t.split(`
|
|
2
|
+
`),r=[];let s=0,o=[];function c(){if(o.length>0){const l=o.join(`
|
|
3
|
+
`);r.push(...E(l)),o=[]}}for(;s<n.length;){const l=n[s].match(N);if(l){c();const u=l[1]||"text",i=[];for(s++;s<n.length;){if(n[s].trimEnd()==="```"){s++;break}i.push(n[s]),s++}r.push({type:"code",language:u,content:i.join(`
|
|
4
|
+
`)})}else o.push(n[s]),s++}return c(),r}function E(t){const n=[],r=/`([^`]+)`/g;let s=0,o;for(;(o=r.exec(t))!==null;)o.index>s&&n.push({type:"text",content:t.slice(s,o.index)}),n.push({type:"inline-code",content:o[1]}),s=r.lastIndex;return s<t.length&&n.push({type:"text",content:t.slice(s)}),n}function C({text:t}){const n=h.useMemo(()=>k(t),[t]);return e.jsx("div",{className:"text-sm text-zinc-200 leading-relaxed space-y-2",children:n.map((r,s)=>{switch(r.type){case"code":return e.jsx(T,{language:r.language,code:r.content},s);case"inline-code":return e.jsx("code",{className:"bg-[#1e1f2a] text-amber-300 text-[13px] px-1.5 py-0.5 rounded font-mono",children:r.content},s);case"text":return r.content.trim()?e.jsx("span",{className:"whitespace-pre-wrap break-words",children:r.content},s):null;default:return null}})})}const L={typescript:"text-blue-400",ts:"text-blue-400",javascript:"text-yellow-400",js:"text-yellow-400",tsx:"text-blue-400",jsx:"text-yellow-400",python:"text-green-400",py:"text-green-400",rust:"text-orange-400",go:"text-cyan-400",json:"text-amber-400",yaml:"text-pink-400",yml:"text-pink-400",bash:"text-emerald-400",sh:"text-emerald-400",shell:"text-emerald-400",zsh:"text-emerald-400",sql:"text-violet-400",html:"text-red-400",css:"text-blue-300",markdown:"text-zinc-400",md:"text-zinc-400",text:"text-zinc-500",diff:"text-rose-400",xml:"text-orange-300",toml:"text-pink-300",graphql:"text-pink-400"};function T({language:t,code:n}){const[r,s]=h.useState(!1),o=n.split(`
|
|
5
|
+
`),c=L[t.toLowerCase()]??"text-zinc-500",l=async()=>{try{await navigator.clipboard.writeText(n),s(!0),setTimeout(()=>s(!1),2e3)}catch{}};return e.jsxs("div",{className:"rounded-lg overflow-hidden border border-[#27282f] bg-[#0d0e14] my-2",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 bg-[#14151d] border-b border-[#27282f]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:`w-3.5 h-3.5 ${c}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5"})}),e.jsx("span",{className:`text-[11px] font-mono font-medium ${c}`,children:t})]}),e.jsx("button",{onClick:l,className:"flex items-center gap-1 text-[11px] text-zinc-500 hover:text-zinc-300 transition-colors",title:"Copy code",children:r?e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3.5 h-3.5 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),e.jsx("span",{className:"text-emerald-400",children:"Copied"})]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"})}),e.jsx("span",{children:"Copy"})]})})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx("table",{className:"w-full border-collapse",children:e.jsx("tbody",{children:o.map((u,i)=>e.jsxs("tr",{className:"hover:bg-[#16171f]/60",children:[e.jsx("td",{className:"text-right text-[11px] text-zinc-600 select-none px-3 py-0 font-mono leading-5 align-top w-[1%] whitespace-nowrap border-r border-[#1e1f2a]",children:i+1}),e.jsx("td",{className:"text-[13px] text-zinc-300 font-mono px-3 py-0 leading-5 whitespace-pre",children:z(u,t)})]},i))})})})]})}function z(t,n){const r=[],s=n.toLowerCase(),c=["//","#","--"].find(a=>t.trimStart().startsWith(a));if(c){const a=t.indexOf(c);return a>0&&r.push(t.slice(0,a)),r.push(e.jsx("span",{className:"text-zinc-600 italic",children:t.slice(a)},"cmt")),r}const l=[],u=/(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`(?:[^`\\]|\\.)*`)/g;let i;for(;(i=u.exec(t))!==null;)l.push({type:"string",value:i[0],index:i.index});const f=/\b(\d+\.?\d*(?:e[+-]?\d+)?)\b/gi;for(;(i=f.exec(t))!==null;)l.some(a=>i.index>=a.index&&i.index<a.index+a.value.length)||l.push({type:"number",value:i[0],index:i.index});const p=R(s);if(p.length>0){const a=new RegExp(`\\b(${p.join("|")})\\b`,"g");for(;(i=a.exec(t))!==null;)l.some(d=>i.index>=d.index&&i.index<d.index+d.value.length)||l.push({type:"keyword",value:i[0],index:i.index})}l.sort((a,d)=>a.index-d.index);let x=0;for(const a of l){if(a.index>x&&r.push(t.slice(x,a.index)),a.index<x)continue;const d=a.type==="string"?"text-emerald-300":a.type==="number"?"text-amber-300":"text-purple-400 font-medium";r.push(e.jsx("span",{className:d,children:a.value},`${a.index}-${a.type}`)),x=a.index+a.value.length}return x<t.length&&r.push(t.slice(x)),r.length>0?r:[t]}function R(t){switch(t){case"typescript":case"ts":case"tsx":return["import","export","from","const","let","var","function","return","if","else","for","while","class","interface","type","extends","implements","new","this","async","await","try","catch","throw","finally","switch","case","break","default","typeof","instanceof","void","null","undefined","true","false","enum","readonly","as","in","of","do","continue","yield","super","static","public","private","protected","abstract","declare","namespace","module","require","satisfies"];case"javascript":case"js":case"jsx":return["import","export","from","const","let","var","function","return","if","else","for","while","class","extends","new","this","async","await","try","catch","throw","finally","switch","case","break","default","typeof","instanceof","void","null","undefined","true","false","in","of","do","continue","yield","super","static"];case"python":case"py":return["import","from","def","return","if","elif","else","for","while","class","with","as","try","except","finally","raise","pass","lambda","yield","assert","del","global","nonlocal","True","False","None","and","or","not","in","is","async","await","break","continue","self"];case"rust":return["fn","let","mut","const","struct","enum","impl","trait","pub","use","mod","crate","self","super","return","if","else","for","while","loop","match","break","continue","async","await","move","ref","where","type","as","true","false","unsafe","extern"];case"go":return["func","var","const","type","struct","interface","return","if","else","for","range","switch","case","break","default","import","package","defer","go","chan","select","map","nil","true","false","make","append","len","cap","error","string","int","bool"];case"bash":case"sh":case"shell":case"zsh":return["if","then","else","elif","fi","for","while","do","done","case","esac","function","return","exit","echo","export","source","local","readonly","shift","set","unset","true","false"];case"sql":return["SELECT","FROM","WHERE","INSERT","UPDATE","DELETE","CREATE","DROP","ALTER","TABLE","INDEX","JOIN","LEFT","RIGHT","INNER","OUTER","ON","AND","OR","NOT","IN","EXISTS","GROUP","BY","ORDER","HAVING","LIMIT","OFFSET","AS","SET","VALUES","INTO","NULL","PRIMARY","KEY","FOREIGN","REFERENCES","UNIQUE","DEFAULT","CASCADE","DISTINCT"];case"json":case"yaml":case"yml":case"text":case"diff":case"md":case"markdown":return[];default:return["import","export","from","const","let","var","function","return","if","else","for","while","class","true","false","null","async","await","try","catch","throw","new","this"]}}function S(){const{id:t}=g(),{data:n,isLoading:r}=b(t);return r?e.jsx("div",{className:"text-zinc-500 py-8 text-center",children:"Loading conversation..."}):n?e.jsxs("div",{className:"max-w-4xl",children:[e.jsxs(v,{to:"/conversations",className:"inline-flex items-center gap-1.5 px-3 py-1.5 mb-4 text-xs text-zinc-400 hover:text-white bg-[#16171f] hover:bg-[#1e1f2a] border border-[#27282f] hover:border-zinc-600 rounded-lg transition-colors",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18"})}),"Back to conversations"]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-bold text-white",children:n.title}),e.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[e.jsx(j,{source:n.source}),e.jsx(w,{mode:n.mode}),e.jsxs("span",{className:"text-xs text-zinc-500",children:[n.messageCount," messages"]}),n.createdAt&&e.jsx("span",{className:"text-xs text-zinc-500",children:y(n.createdAt)}),n.project&&e.jsxs("span",{className:"text-xs text-zinc-500",children:["Project: ",n.project]})]})]}),e.jsx("div",{className:"space-y-3",children:n.messages.map((s,o)=>e.jsx(A,{message:s},o))})]}):e.jsx("div",{className:"text-zinc-500 py-8 text-center",children:"Conversation not found."})}function A({message:t}){const n=t.role==="user",r=!t.text&&t.toolCalls.length>0;return e.jsx("div",{className:`flex ${n?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`rounded-xl px-4 py-3 ${n?"bg-blue-600/20 border border-blue-500/20 max-w-[80%] min-w-[180px]":r?"bg-[#16171f] border border-[#27282f] max-w-[260px] min-w-[160px]":"bg-[#16171f] border border-[#27282f] max-w-[85%] min-w-[220px]"}`,children:[e.jsx("div",{className:"flex items-center gap-2 mb-1.5",children:e.jsx("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${n?"text-blue-400":"text-emerald-400"}`,children:t.role})}),t.text?e.jsx(C,{text:t.text}):r?null:e.jsx("div",{className:"text-sm text-zinc-500 italic",children:"(empty)"}),t.toolCalls.length>0&&e.jsx("div",{className:`space-y-1 ${t.text?"mt-2":""}`,children:t.toolCalls.map((s,o)=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-zinc-500 bg-[#0f1117]/50 rounded px-2 py-1",children:[e.jsx("svg",{className:"w-3 h-3 shrink-0 text-zinc-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17L17.25 21A2.652 2.652 0 0021 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 11-3.586-3.586l6.837-5.63"})}),e.jsx(m,{content:s.name,className:"text-zinc-400 font-mono truncate",children:s.name}),s.status&&e.jsxs("span",{className:`shrink-0 ${s.status==="completed"?"text-emerald-500":"text-amber-500"}`,children:["(",s.status,")"]})]},o))}),t.files.length>0&&e.jsx("div",{className:"mt-2 space-y-0.5",children:t.files.map((s,o)=>e.jsx(m,{content:s,className:"text-xs text-zinc-500 font-mono truncate",children:s},o))})]})})}export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i,j as e}from"./markdown-CZuQZQX5.js";import{T as g,t as z,S as A,M as P}from"./Overview-B_jOY8il.js";import{R as M}from"./RepoSelector-DmPRS8kf.js";import{u as $,a as B,b as F,L as E}from"./index-CVSL0ryk.js";function Q(){const[n,s]=$(),[o,p]=i.useState(n.get("view")||"repos"),[m,j]=i.useState(n.get("search")??""),[c,l]=i.useState(n.get("source")??""),[a,R]=i.useState(n.get("mode")??""),[h,S]=i.useState([]),x=parseInt(n.get("page")??"1",10),C=B(o==="list"?{page:x,limit:30,source:c||void 0,search:m||void 0,mode:a||void 0}:void 0),w=F(),d=C.data??null,u=w.data??null,y=o==="repos"?w.isLoading:C.isLoading,b=i.useMemo(()=>{if(!u)return null;if(h.length===0)return u;const t=u.repos.filter(r=>h.some(v=>r.repo.toLowerCase().includes(v.toLowerCase())||v.toLowerCase().includes(r.repo.toLowerCase())));return{...u,repos:t,totalRepos:t.length,totalConversations:t.reduce((r,v)=>r+v.conversationCount,0)}},[u,h]),k=t=>{const r=new URLSearchParams(n);r.set("page",String(t)),s(r)},f=()=>{const t=new URLSearchParams;m&&t.set("search",m),c&&t.set("source",c),a&&t.set("mode",a),t.set("page","1"),t.set("view","list"),p("list"),s(t)},L=t=>{p(t);const r=new URLSearchParams(n);r.set("view",t),s(r)};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"Conversations"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(M,{mode:"filter",value:h,onChange:S,align:"right"}),e.jsxs("div",{className:"flex gap-1 bg-[#16171f] border border-[#27282f] rounded-lg p-0.5",children:[e.jsx("button",{onClick:()=>L("repos"),className:`px-3 py-1.5 text-xs rounded-md transition-colors ${o==="repos"?"bg-blue-600/20 text-blue-400":"text-zinc-500 hover:text-zinc-300"}`,children:"By Repo"}),e.jsx("button",{onClick:()=>L("list"),className:`px-3 py-1.5 text-xs rounded-md transition-colors ${o==="list"?"bg-blue-600/20 text-blue-400":"text-zinc-500 hover:text-zinc-300"}`,children:"All"})]})]})]}),o==="repos"?y?e.jsx("div",{className:"text-zinc-500 text-center py-8",children:"Loading..."}):b?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-between mb-3",children:e.jsxs("div",{className:"text-xs text-zinc-500",children:[b.totalConversations," conversations across ",b.totalRepos," repos",h.length>0&&e.jsx("span",{className:"text-blue-400 ml-1",children:"(filtered)"})]})}),e.jsx("div",{className:"space-y-2",children:b.repos.map(t=>e.jsx(I,{group:t},t.repoPath))})]}):null:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-3 mb-6",children:[e.jsx("input",{type:"text",placeholder:"Search conversations...",value:m,onChange:t=>j(t.target.value),onKeyDown:t=>t.key==="Enter"&&f(),className:"flex-1 bg-[#16171f] border border-[#27282f] rounded-lg px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:border-blue-500/50"}),e.jsxs("select",{value:c,onChange:t=>{l(t.target.value),setTimeout(f,0)},className:"bg-[#16171f] border border-[#27282f] rounded-lg px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:border-blue-500/50",children:[e.jsx("option",{value:"",children:"All Sources"}),e.jsx("option",{value:"cursor",children:"Cursor"}),e.jsx("option",{value:"claude-code",children:"Claude Code"})]}),e.jsxs("select",{value:a,onChange:t=>{R(t.target.value),setTimeout(f,0)},className:"bg-[#16171f] border border-[#27282f] rounded-lg px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:border-blue-500/50",children:[e.jsx("option",{value:"",children:"All Modes"}),e.jsx("option",{value:"agent",children:"Agent"}),e.jsx("option",{value:"chat",children:"Chat"}),e.jsx("option",{value:"edit",children:"Edit"}),e.jsx("option",{value:"claude-code",children:"Claude Code"})]}),e.jsx("button",{onClick:f,className:"bg-blue-600 hover:bg-blue-500 text-white text-sm px-4 py-2 rounded-lg transition-colors",children:"Filter"})]}),y?e.jsx("div",{className:"text-zinc-500 text-center py-8",children:"Loading..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-xs text-zinc-500 mb-3",children:[d?.total??0," conversations found"]}),e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl overflow-hidden",children:[d?.items.map(t=>e.jsx(N,{conversation:t},t.id)),d?.items.length===0&&e.jsx("div",{className:"px-4 py-8 text-center text-zinc-500 text-sm",children:"No conversations match your filters."})]}),d&&d.totalPages>1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4",children:[e.jsx("button",{onClick:()=>k(x-1),disabled:x<=1,className:"px-3 py-1.5 text-sm rounded-lg bg-[#16171f] border border-[#27282f] text-zinc-400 hover:text-zinc-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Previous"}),e.jsxs("span",{className:"text-sm text-zinc-500",children:["Page ",x," of ",d.totalPages]}),e.jsx("button",{onClick:()=>k(x+1),disabled:x>=d.totalPages,className:"px-3 py-1.5 text-sm rounded-lg bg-[#16171f] border border-[#27282f] text-zinc-400 hover:text-zinc-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Next"})]})]})]})]})}const I=i.memo(function({group:s}){const[o,p]=i.useState(!1),j=Math.min(s.conversationCount/50*100,100),c=s.conversations.filter(a=>a.matchMethod!=="ai"),l=s.conversations.filter(a=>a.matchMethod==="ai");return e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl overflow-hidden",children:[e.jsxs("button",{onClick:()=>p(!o),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-[#1e1f2a] transition-colors",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-blue-600/10 border border-blue-500/20 flex items-center justify-center flex-shrink-0",children:e.jsx("svg",{className:"w-4 h-4 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{content:s.repo,className:"text-sm font-medium text-zinc-200 truncate",children:s.repo}),e.jsx("span",{className:"text-xs text-zinc-500 font-mono",children:s.conversationCount}),l.length>0&&e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20 font-medium",children:[l.length," AI"]})]}),e.jsx(g,{content:s.repoPath,className:"text-[11px] text-zinc-600 truncate mt-0.5",children:s.repoPath}),e.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[e.jsx("div",{className:"flex-1 h-1 bg-[#0f1117] rounded-full overflow-hidden max-w-[200px]",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-blue-600 to-blue-400 rounded-full",style:{width:`${j}%`}})}),e.jsxs("div",{className:"flex gap-1.5",children:[s.sources.claudeCode>0&&e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:["CC: ",s.sources.claudeCode]}),s.sources.cursor>0&&e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-purple-500/10 text-purple-400 border border-purple-500/20",children:["Cursor: ",s.sources.cursor]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.latestActivity&&e.jsx("span",{className:"text-xs text-zinc-600",children:z(s.latestActivity)}),e.jsx("svg",{className:`w-4 h-4 text-zinc-600 transition-transform ${o?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]})]}),o&&e.jsxs("div",{className:"border-t border-[#27282f]",children:[c.map(a=>e.jsx(N,{conversation:a},a.id)),c.length>0&&l.length>0&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 bg-[#0f1117]",children:[e.jsx("div",{className:"flex-1 h-px bg-amber-500/20"}),e.jsxs("span",{className:"text-[10px] text-amber-400/70 font-medium uppercase tracking-wider flex items-center gap-1",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})}),"AI classified (",l.length,")"]}),e.jsx("div",{className:"flex-1 h-px bg-amber-500/20"})]}),c.length===0&&l.length>0&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 bg-[#0f1117]",children:[e.jsx("div",{className:"flex-1 h-px bg-amber-500/20"}),e.jsxs("span",{className:"text-[10px] text-amber-400/70 font-medium uppercase tracking-wider flex items-center gap-1",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})}),"All AI classified (",l.length,")"]}),e.jsx("div",{className:"flex-1 h-px bg-amber-500/20"})]}),l.map(a=>e.jsx(N,{conversation:a},a.id))]})]})}),N=i.memo(function({conversation:s}){return e.jsxs(E,{to:`/conversations/${s.id}`,className:`flex items-center gap-3 px-4 py-3 border-b border-[#27282f] last:border-b-0 hover:bg-[#1e1f2a] transition-colors ${s.matchMethod==="ai"?"bg-amber-500/[0.02]":""}`,children:[e.jsx(A,{source:s.source}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(g,{content:s.title,className:"text-sm text-zinc-200 truncate",children:s.title}),s.matchMethod==="ai"&&e.jsxs("span",{className:"flex-shrink-0 text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400/80 border border-amber-500/20 font-medium leading-none",children:["AI ",s.aiConfidence?`${Math.round(s.aiConfidence*100)}%`:""]})]}),e.jsxs("div",{className:"text-xs text-zinc-500 mt-0.5",children:[s.messageCount," messages",s.project&&` ยท ${s.project}`,s.createdAt&&` ยท ${z(s.createdAt)}`]}),s.aiReason&&e.jsxs(g,{content:s.aiReason??"",className:"text-[11px] text-amber-400/50 italic truncate mt-0.5",children:["โ",s.aiReason,"โ"]})]}),e.jsx(P,{mode:s.mode})]})});export{Q as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{a as t,j as e,M as f,c as g,d as j}from"./markdown-CZuQZQX5.js";function k({content:o,streaming:r=!1,title:n,maxHeight:p="calc(100vh - 200px)"}){const s=t.useRef(null),[l,a]=t.useState(!0),[d,c]=t.useState(!1);t.useEffect(()=>{l&&r&&s.current&&(s.current.scrollTop=s.current.scrollHeight)},[o,l,r]);const i=()=>{if(!s.current)return;const{scrollTop:u,scrollHeight:h,clientHeight:b}=s.current,m=h-u-b<40;a(m)},x=async()=>{try{await navigator.clipboard.writeText(o),c(!0),setTimeout(()=>c(!1),2e3)}catch{}};return o?e.jsxs("div",{className:"bg-[#0d0e14] rounded-lg border border-[#27282f] flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-[#27282f]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[n&&e.jsx("span",{className:"text-xs font-medium text-zinc-300",children:n}),r&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-blue-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse"}),"Streaming"]})]}),e.jsx("button",{onClick:x,className:"flex items-center gap-1 px-2 py-1 text-[10px] rounded bg-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-700 transition-colors",children:d?e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),"Copied"]}):e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"})}),"Copy"]})})]}),e.jsxs("div",{ref:s,onScroll:i,className:"overflow-y-auto p-5",style:{maxHeight:p},children:[e.jsx("div",{className:`prose prose-invert prose-sm max-w-none
|
|
2
|
+
prose-headings:text-zinc-100 prose-headings:font-semibold
|
|
3
|
+
prose-h1:text-lg prose-h1:border-b prose-h1:border-[#27282f] prose-h1:pb-2
|
|
4
|
+
prose-h2:text-base prose-h2:mt-6
|
|
5
|
+
prose-h3:text-sm
|
|
6
|
+
prose-p:text-zinc-300 prose-p:leading-relaxed
|
|
7
|
+
prose-a:text-blue-400 prose-a:no-underline hover:prose-a:underline
|
|
8
|
+
prose-strong:text-zinc-200
|
|
9
|
+
prose-code:text-emerald-400 prose-code:bg-[#1e1f2a] prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded prose-code:text-xs prose-code:before:content-none prose-code:after:content-none
|
|
10
|
+
prose-pre:bg-[#16171f] prose-pre:rounded-lg prose-pre:border prose-pre:border-[#27282f] prose-pre:text-xs prose-pre:my-3
|
|
11
|
+
prose-li:text-zinc-300 prose-li:marker:text-zinc-600
|
|
12
|
+
prose-table:border-collapse
|
|
13
|
+
prose-th:bg-[#16171f] prose-th:text-zinc-300 prose-th:text-xs prose-th:px-3 prose-th:py-2 prose-th:border prose-th:border-[#27282f]
|
|
14
|
+
prose-td:text-zinc-400 prose-td:text-xs prose-td:px-3 prose-td:py-2 prose-td:border prose-td:border-[#27282f]
|
|
15
|
+
prose-hr:border-[#27282f]
|
|
16
|
+
prose-blockquote:border-l-blue-500/50 prose-blockquote:bg-blue-500/5 prose-blockquote:px-4 prose-blockquote:py-1 prose-blockquote:rounded-r
|
|
17
|
+
`,children:e.jsx(f,{remarkPlugins:[j],rehypePlugins:[g],children:o})}),r&&e.jsx("div",{className:"inline-block w-2 h-4 bg-blue-400 animate-pulse rounded-sm ml-0.5"})]})]}):e.jsxs("div",{className:"bg-[#0d0e14] rounded-lg border border-[#27282f] p-8 text-center",children:[e.jsx("p",{className:"text-zinc-500 text-sm",children:r?"Waiting for content...":"No content available"}),r&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse"}),e.jsx("span",{className:"text-xs text-blue-400",children:"Streaming"})]})]})}export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#abb2bf;background:#282c34}.hljs-comment,.hljs-quote{color:#5c6370;font-style:italic}.hljs-doctag,.hljs-keyword,.hljs-formula{color:#c678dd}.hljs-section,.hljs-name,.hljs-selector-tag,.hljs-deletion,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-string,.hljs-regexp,.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string{color:#98c379}.hljs-attr,.hljs-variable,.hljs-template-variable,.hljs-type,.hljs-selector-class,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-number{color:#d19a66}.hljs-symbol,.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-title{color:#61aeee}.hljs-built_in,.hljs-title.class_,.hljs-class .hljs-title{color:#e6c07b}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./markdown-CZuQZQX5.js";import{t as c}from"./Overview-B_jOY8il.js";import{g as d}from"./index-CVSL0ryk.js";function r(){const{data:n,isLoading:i}=d(),a=n?.servers??[];return i?t.jsx("div",{className:"text-zinc-500 py-8 text-center",children:"Loading..."}):t.jsxs("div",{className:"max-w-6xl",children:[t.jsx("h2",{className:"text-2xl font-bold text-white mb-6",children:"MCPs"}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.map(s=>t.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h4",{className:"text-sm font-semibold text-zinc-200",children:s.name}),t.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium border ${s.status==="active"?"text-emerald-400 bg-emerald-500/10 border-emerald-500/20":"text-zinc-500 bg-zinc-500/10 border-zinc-500/20"}`,children:s.status==="active"?"Active":s.lastUsed?`Unused since ${new Date(s.lastUsed).toLocaleDateString()}`:"Unused"})]}),t.jsxs("div",{className:"text-xs text-zinc-500 mb-2",children:[s.totalInvocations.toLocaleString()," invocations ยท ",s.tools.length," tools"]}),s.lastUsed&&t.jsxs("div",{className:"text-xs text-zinc-600 mb-3",children:["Last used: ",c(s.lastUsed)]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[s.tools.slice(0,8).map(e=>{const l=e.split("_").pop()??e;return t.jsx("span",{className:"px-1.5 py-0.5 bg-[#0f1117] rounded text-[10px] text-zinc-500 font-mono",children:l},e)}),s.tools.length>8&&t.jsxs("span",{className:"px-1.5 py-0.5 text-[10px] text-zinc-600",children:["+",s.tools.length-8," more"]})]})]},s.name)),a.length===0&&t.jsx("div",{className:"col-span-2 text-center text-zinc-500 py-8 text-sm",children:"No MCP servers found."})]})]})}export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c,j as e}from"./markdown-CZuQZQX5.js";import{a as p,h as b,g as j,P as N,U as w,L as u}from"./index-CVSL0ryk.js";function S({content:t,children:n,className:r="",position:s="top",maxWidth:l=400}){const i=c.useRef(null),[o,a]=c.useState(!1),v=c.useCallback(()=>{const x=i.current;x&&x.scrollWidth>x.clientWidth&&a(!0)},[]),g=c.useCallback(()=>{a(!1)},[]);return e.jsxs("div",{ref:i,className:`relative ${r}`,onMouseEnter:v,onMouseLeave:g,children:[n,o&&e.jsx("div",{className:`absolute z-50 px-2.5 py-1.5 text-xs text-zinc-200 bg-[#1e1f2a] border border-[#3f3f46] rounded-lg shadow-xl whitespace-pre-wrap break-all pointer-events-none ${s==="top"?"bottom-full mb-1.5":"top-full mt-1.5"} left-0`,style:{maxWidth:l},children:t})]})}function y(){const t=p({limit:10}),n=b(),r=j(),s=N(),l=w(),i=t.isLoading||n.isLoading||r.isLoading||s.isLoading||l.isLoading,o={totalConversations:t.data?.total??0,totalTools:n.data?.tools.length??0,activeMcps:r.data?.servers.filter(a=>a.status==="active").length??0,pendingReviews:s.data?.items.length??0,state:l.data??null,recentConversations:t.data?.items??[]};return i?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("div",{className:"text-zinc-500",children:"Loading..."})}):e.jsxs("div",{className:"max-w-6xl",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-6",children:"Overview"}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[e.jsx(d,{label:"Conversations",value:o.totalConversations,color:"text-blue-400",href:"/conversations"}),e.jsx(d,{label:"Tools Used",value:o.totalTools,color:"text-emerald-400",href:"/tool-usage"}),e.jsx(d,{label:"Active MCPs",value:o.activeMcps,color:"text-purple-400",href:"/mcps"}),e.jsx(d,{label:"Pending Reviews",value:o.pendingReviews,color:"text-amber-400",href:"/review"})]}),o.state&&e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4 mb-8",children:[e.jsx("h3",{className:"text-sm font-semibold text-zinc-400 uppercase tracking-wider mb-3",children:"Scan Status"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-zinc-500",children:"Last Scan:"})," ",e.jsx("span",{className:"text-zinc-200",children:o.state.lastScanAt?new Date(o.state.lastScanAt).toLocaleString():"Never"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-zinc-500",children:"Total Scans:"})," ",e.jsx("span",{className:"text-zinc-200",children:o.state.scanCount})]})]})]}),e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-zinc-400 uppercase tracking-wider",children:"Recent Conversations"}),e.jsx(u,{to:"/conversations",className:"text-xs text-blue-400 hover:text-blue-300",children:"View all"})]}),e.jsxs("div",{className:"space-y-1",children:[o.recentConversations.map(a=>e.jsxs(u,{to:`/conversations/${a.id}`,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-[#1e1f2a] transition-colors",children:[e.jsx(m,{source:a.source}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(S,{content:a.title,className:"text-sm text-zinc-200 truncate",children:a.title}),e.jsxs("div",{className:"text-xs text-zinc-500",children:[a.messageCount," messages",a.createdAt&&` ยท ${f(a.createdAt)}`]})]}),e.jsx(h,{mode:a.mode})]},a.id)),o.recentConversations.length===0&&e.jsxs("p",{className:"text-sm text-zinc-500 px-3 py-4",children:["No conversations found. Run ",e.jsx("code",{className:"text-zinc-300",children:"lore sync"})," to scan."]})]})]})]})}function d({label:t,value:n,color:r,href:s}){return e.jsxs(u,{to:s,className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4 hover:border-[#3f3f46] transition-colors",children:[e.jsx("div",{className:`text-3xl font-bold ${r}`,children:n.toLocaleString()}),e.jsx("div",{className:"text-sm text-zinc-500 mt-1",children:t})]})}function m({source:t}){const n=t==="cursor"?"bg-blue-500/10 text-blue-400 border-blue-500/20":"bg-orange-500/10 text-orange-400 border-orange-500/20";return e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium border ${n}`,children:t==="cursor"?"Cursor":"Claude"})}function h({mode:t}){const n={agent:"text-emerald-400",chat:"text-blue-400",edit:"text-amber-400","claude-code":"text-orange-400"};return e.jsx("span",{className:`text-[10px] font-medium ${n[t]??"text-zinc-500"}`,children:t})}function f(t){const n=new Date(t),s=Math.floor((new Date().getTime()-n.getTime())/1e3);return s<60?"just now":s<3600?`${Math.floor(s/60)}m ago`:s<86400?`${Math.floor(s/3600)}h ago`:s<604800?`${Math.floor(s/86400)}d ago`:n.toLocaleDateString()}const L=Object.freeze(Object.defineProperty({__proto__:null,ModeBadge:h,SourceBadge:m,default:y,timeAgo:f},Symbol.toStringTag,{value:"Module"}));export{h as M,L as O,m as S,S as T,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./markdown-CZuQZQX5.js";import{S as u,T as x,t as h,M as C}from"./Overview-B_jOY8il.js";import{u as f,e as v,L as y}from"./index-CVSL0ryk.js";const i=[{key:"classify",label:"Classify",description:"AI classification of unmatched conversations to repos",accentColor:"purple",bgColor:"bg-purple-600/20",borderColor:"border-purple-500/30",textColor:"text-purple-400"},{key:"distill",label:"Distill",description:"Processing conversations into documentation",accentColor:"blue",bgColor:"bg-blue-600/20",borderColor:"border-blue-500/30",textColor:"text-blue-400"},{key:"skill-gen",label:"Skill Gen",description:"Generating SKILL.md files per repo",accentColor:"emerald",bgColor:"bg-emerald-600/20",borderColor:"border-emerald-500/30",textColor:"text-emerald-400"},{key:"vet",label:"Vet",description:"Testing and scoring skills/MCPs",accentColor:"amber",bgColor:"bg-amber-600/20",borderColor:"border-amber-500/30",textColor:"text-amber-400"},{key:"legacy",label:"Legacy",description:"Conversations created before phase tracking was added",accentColor:"zinc",bgColor:"bg-zinc-600/20",borderColor:"border-zinc-500/30",textColor:"text-zinc-400"}];function z(){const[o,c]=f(),a=o.get("tab")||"classify",{data:r,isLoading:m}=v(),b=t=>{const n=new URLSearchParams(o);n.set("tab",t),c(n)},g=t=>r?t==="legacy"?r.legacy:r.phases[t]??[]:[],p=t=>r?r.counts[t]??0:0,l=g(a),s=i.find(t=>t.key===a)??i[0];return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"Phase Review"}),e.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Review conversations grouped by the lore process phase that created them.",r&&e.jsxs("span",{className:"ml-1",children:[r.total-(r.counts.legacy??0)," tagged, ",r.counts.legacy??0," legacy"]})]})]}),e.jsx("div",{className:"flex gap-1 bg-[#16171f] border border-[#27282f] rounded-lg p-1 mb-6 overflow-x-auto",children:i.map(t=>{const n=a===t.key,d=p(t.key);return e.jsxs("button",{onClick:()=>b(t.key),className:`flex items-center gap-1.5 px-3 py-2 text-xs rounded-md transition-colors whitespace-nowrap ${n?`${t.bgColor} ${t.textColor}`:"text-zinc-500 hover:text-zinc-300 hover:bg-[#1e1f2a]"}`,children:[t.label,d>0&&e.jsx("span",{className:`px-1.5 py-0.5 rounded-full text-[10px] font-medium ${n?`${t.bgColor} ${t.textColor}`:"bg-zinc-700/50 text-zinc-400"}`,children:d})]},t.key)})}),e.jsxs("div",{className:`flex items-center gap-2 mb-4 px-3 py-2 rounded-lg ${s.bgColor} border ${s.borderColor}`,children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${s.textColor} bg-current`}),e.jsx("span",{className:`text-xs ${s.textColor}`,children:s.description}),e.jsxs("span",{className:"text-xs text-zinc-600 ml-auto",children:[l.length," conversation",l.length!==1?"s":""]})]}),m?e.jsx("div",{className:"text-zinc-500 text-center py-12",children:"Loading conversations..."}):l.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"text-zinc-600 text-sm",children:a==="legacy"?"No legacy conversations found.":`No conversations tagged with the "${s.label}" phase yet.`}),e.jsx("div",{className:"text-zinc-700 text-xs mt-1",children:a!=="legacy"&&"Conversations will appear here after the next lore run."})]}):e.jsx("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl overflow-hidden",children:l.map(t=>e.jsx(j,{conversation:t,phaseColor:s.textColor},t.id))})]})}function j({conversation:o,phaseColor:c}){return e.jsxs(y,{to:`/conversations/${o.id}`,className:"flex items-center gap-3 px-4 py-3 border-b border-[#27282f] last:border-b-0 hover:bg-[#1e1f2a] transition-colors",children:[e.jsx(u,{source:o.source}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(x,{content:o.title,className:"text-sm text-zinc-200 truncate",children:o.title}),o.matchMethod==="ai"&&e.jsxs("span",{className:"flex-shrink-0 text-[9px] px-1 py-0.5 rounded bg-amber-500/10 text-amber-400/80 border border-amber-500/20 font-medium leading-none",children:["AI ",o.aiConfidence?`${Math.round(o.aiConfidence*100)}%`:""]})]}),e.jsxs("div",{className:"text-xs text-zinc-500 mt-0.5",children:[o.messageCount," messages",o.project&&` ยท ${o.project}`,o.createdAt&&` ยท ${h(o.createdAt)}`]}),o.aiReason&&e.jsxs(x,{content:o.aiReason??"",className:"text-[11px] text-amber-400/50 italic truncate mt-0.5",children:["โ",o.aiReason,"โ"]})]}),e.jsx(C,{mode:o.mode})]})}export{z as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPreview-2zDiish4.js","assets/markdown-CZuQZQX5.js","assets/MarkdownPreview-ZgkIHsf0.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,a as r}from"./markdown-CZuQZQX5.js";import{_ as Y,V as Z,i as ee,x as te,W as se,X as ne,Y as re,Z as ae,$ as le,a0 as ie,q as A,a1 as ce}from"./index-CVSL0ryk.js";import{R as oe}from"./RepoSelector-DmPRS8kf.js";import{R as de}from"./ResizablePanels-Bbb4S6Ss.js";const xe={completed:{dot:"bg-emerald-500",ring:"ring-emerald-500/20",line:"bg-emerald-500/50",text:"text-emerald-400",label:"text-zinc-200",bg:"bg-emerald-500/5",border:"border-emerald-500/20"},active:{dot:"bg-blue-500",ring:"ring-blue-500/30",line:"bg-blue-500/30",text:"text-blue-400",label:"text-white",bg:"bg-blue-500/5",border:"border-blue-500/30"},skipped:{dot:"bg-amber-500",ring:"ring-amber-500/20",line:"bg-amber-500/30",text:"text-amber-400",label:"text-zinc-400",bg:"bg-amber-500/5",border:"border-amber-500/20"},failed:{dot:"bg-red-500",ring:"ring-red-500/20",line:"bg-red-500/30",text:"text-red-400",label:"text-zinc-400",bg:"bg-red-500/5",border:"border-red-500/20"},pending:{dot:"bg-zinc-600",ring:"ring-zinc-600/20",line:"bg-zinc-700",text:"text-zinc-500",label:"text-zinc-500",bg:"bg-zinc-500/5",border:"border-[#27282f]"}},ue={summarize:"1",cluster:"2",generate:"3"};function me({phases:t,onPhaseClick:n,selectedPhase:a}){return t.length===0?e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-zinc-500 text-sm",children:"No scan phases to display"})}):e.jsx("div",{className:"space-y-0",children:t.map((s,l)=>{const c=xe[s.status],p=l===t.length-1,h=a===s.name;return e.jsx("button",{onClick:()=>n(s.name),className:`w-full text-left transition-colors rounded-lg ${h?`${c.bg} border ${c.border}`:"hover:bg-[#1e1f2a]"}`,children:e.jsxs("div",{className:"flex gap-3 px-3 py-3",children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",style:{width:28},children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:`w-7 h-7 rounded-full ${c.dot} ring-4 ${c.ring} flex items-center justify-center text-[10px] font-bold text-white ${s.status==="active"?"animate-pulse":""}`,children:ue[s.name]??"?"}),s.status==="active"&&e.jsx("div",{className:"absolute inset-0 rounded-full bg-blue-500/20 animate-ping"})]}),!p&&e.jsx("div",{className:`w-0.5 flex-1 min-h-[24px] mt-1 rounded-full ${s.status==="completed"||s.status==="skipped"?c.line:"bg-zinc-700 border-dashed"}`,style:s.status==="pending"?{backgroundImage:"repeating-linear-gradient(to bottom, #3f3f46 0px, #3f3f46 4px, transparent 4px, transparent 8px)"}:void 0})]}),e.jsxs("div",{className:"flex-1 min-w-0 pb-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-sm font-medium ${c.label}`,children:s.label}),s.status==="active"&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-blue-500/10 text-blue-400 border border-blue-500/20",children:"active"}),s.status==="skipped"&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-amber-500/10 text-amber-400 border border-amber-500/20",children:"skipped"}),s.status==="failed"&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-red-500/10 text-red-400 border border-red-500/20",children:"failed"})]}),e.jsxs("div",{className:"flex-shrink-0 text-right",children:[s.startedAt&&e.jsx("div",{className:"text-[10px] text-zinc-500",children:pe(s.startedAt)}),s.durationMs!=null&&e.jsx("div",{className:`text-[10px] ${c.text}`,children:he(s.durationMs)})]})]}),s.summary&&e.jsx("p",{className:`text-xs mt-1 ${c.text}`,children:s.summary})]})]})},s.name)})})}function pe(t){try{return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function he(t){if(t<1e3)return`${t}ms`;const n=Math.round(t/1e3);if(n<60)return`${n}s`;const a=Math.floor(n/60),s=n%60;return`${a}m ${s}s`}const be=r.lazy(()=>Y(()=>import("./MarkdownPreview-2zDiish4.js"),__vite__mapDeps([0,1,2]))),_={completed:{bg:"bg-emerald-500/10",text:"text-emerald-400",label:"Completed"},active:{bg:"bg-blue-500/10",text:"text-blue-400",label:"Running"},skipped:{bg:"bg-amber-500/10",text:"text-amber-400",label:"Skipped"},failed:{bg:"bg-red-500/10",text:"text-red-400",label:"Failed"},pending:{bg:"bg-zinc-500/10",text:"text-zinc-500",label:"Pending"}};function fe({phase:t,markdownContent:n,isStreaming:a,expanded:s,onToggleExpand:l}){const c=_[t.status]??_.pending;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-[#16171f] rounded-lg border border-[#27282f] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h3",{className:"text-sm font-semibold text-white",children:t.label}),e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx("button",{onClick:l,className:"flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded text-zinc-500 hover:text-zinc-200 hover:bg-[#1e1f2a] transition-colors",title:s?"Collapse panel":"Expand to full screen",children:s?e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"})}):e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})})}),e.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full border ${c.bg} ${c.text} border-current/20`,children:c.label})]})]}),t.summary&&e.jsx("p",{className:"text-xs text-zinc-400 mb-2",children:t.summary}),e.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-zinc-500",children:[t.startedAt&&e.jsxs("span",{children:["Started: ",V(t.startedAt)]}),t.completedAt&&e.jsxs("span",{children:["Completed: ",V(t.completedAt)]}),t.durationMs!=null&&e.jsxs("span",{children:["Duration: ",ke(t.durationMs)]})]})]}),t.name==="generate"&&(n||a)?e.jsx(r.Suspense,{fallback:e.jsx(ge,{}),children:e.jsx(be,{content:n??"",streaming:a,title:"SKILL.md Preview",maxHeight:"calc(100vh - 340px)"})}):t.name==="summarize"&&t.conversations?.length?e.jsx(je,{conversations:t.conversations,outputLines:t.outputLines??[],isActive:t.status==="active",expanded:s}):e.jsx(ve,{lines:t.outputLines??[],phaseName:t.name})]})}function ge(){return e.jsxs("div",{className:"bg-[#0d0e14] rounded-lg border border-[#27282f] flex flex-col animate-pulse",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-[#27282f]",children:[e.jsx("div",{className:"h-3 w-32 bg-zinc-800 rounded"}),e.jsx("div",{className:"h-5 w-14 bg-zinc-800 rounded"})]}),e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("div",{className:"h-3 w-3/4 bg-zinc-800 rounded"}),e.jsx("div",{className:"h-3 w-full bg-zinc-800 rounded"}),e.jsx("div",{className:"h-3 w-5/6 bg-zinc-800 rounded"}),e.jsx("div",{className:"h-3 w-2/3 bg-zinc-800 rounded"}),e.jsx("div",{className:"h-16 w-full bg-zinc-800/60 rounded-lg mt-4"}),e.jsx("div",{className:"h-3 w-full bg-zinc-800 rounded"}),e.jsx("div",{className:"h-3 w-4/5 bg-zinc-800 rounded"})]})]})}const O={new:{color:"text-blue-400",label:"New"},stale:{color:"text-amber-400",label:"Re-summarized"},cached:{color:"text-emerald-400",label:"Cached"},trivial:{color:"text-zinc-500",label:"Trivial"}};function je({conversations:t,outputLines:n,isActive:a,expanded:s}){const[l,c]=r.useState(!1),[p,h]=r.useState(null),b=t.reduce((o,i)=>(o[i.status]=(o[i.status]??0)+1,o),{}),x=p?t.find(o=>o.id===p):null;return x?e.jsx("div",{className:"space-y-3",children:e.jsx(I,{conversation:x,focused:!0,onClose:()=>h(null)})}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 bg-[#16171f] rounded-lg border border-[#27282f]",children:[e.jsxs("span",{className:"text-[10px] text-zinc-500",children:[t.length," conversations"]}),e.jsx("div",{className:"flex items-center gap-2 ml-auto",children:Object.entries(b).map(([o,i])=>{const m=O[o]??O.trivial;return e.jsxs("span",{className:`flex items-center gap-1 text-[10px] ${m.color}`,children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current"}),i," ",m.label.toLowerCase()]},o)})})]}),e.jsx("div",{className:`space-y-1.5 overflow-y-auto ${s?"max-h-[calc(100vh-250px)]":"max-h-[calc(100vh-400px)]"}`,children:t.map(o=>e.jsx(I,{conversation:o,onFocus:()=>h(o.id)},o.id))}),n.length>0&&e.jsxs("div",{className:"bg-[#0d0e14] rounded-lg border border-[#27282f] overflow-hidden",children:[e.jsxs("button",{onClick:()=>c(!l),className:"w-full flex items-center justify-between px-3 py-2 hover:bg-[#1e1f2a] transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-zinc-500",children:"Raw Output"}),e.jsxs("span",{className:"text-[10px] text-zinc-600 font-mono",children:[n.length," lines"]}),a&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse"})]}),e.jsx("svg",{className:`w-3 h-3 text-zinc-500 transition-transform ${l?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),l&&e.jsx("div",{className:"max-h-[200px] overflow-y-auto px-3 pb-2 space-y-0.5",children:n.map((o,i)=>e.jsx("div",{className:"text-[10px] font-mono text-zinc-600 leading-4",children:o},i))})]})]})}function I({conversation:t,focused:n,onFocus:a,onClose:s}){const l=O[t.status]??O.trivial,c=t.source==="cursor"?"Cursor":t.source==="claude-code"?"Claude Code":t.source,p=t.source==="cursor"?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-orange-500/10 text-orange-400 border-orange-500/20",h={completed:"text-emerald-400",partial:"text-amber-400",abandoned:"text-red-400",unknown:"text-zinc-500"},b=!!t.summary;return n?e.jsxs("div",{className:"bg-[#16171f] rounded-lg border border-[#27282f] overflow-hidden flex flex-col max-h-[calc(100vh-200px)]",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[#27282f]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${l.color} bg-current`}),e.jsx("span",{className:"text-sm text-zinc-100 font-medium truncate",children:t.title}),e.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded border flex-shrink-0 ${p}`,children:c})]}),e.jsx("button",{onClick:s,className:"p-1 rounded hover:bg-[#27282f] transition-colors text-zinc-500 hover:text-zinc-300 flex-shrink-0",title:"Back to list",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsxs("div",{className:"overflow-y-auto flex-1 p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:`text-xs ${l.color}`,children:l.label}),e.jsxs("span",{className:"text-xs text-zinc-600",children:[t.messageCount," message",t.messageCount!==1?"s":""]}),t.outcome&&t.outcome!=="unknown"&&e.jsx("span",{className:`text-xs ${h[t.outcome]??"text-zinc-500"}`,children:t.outcome})]}),t.summary&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Summary"}),e.jsx("p",{className:"text-sm text-zinc-300 leading-relaxed mt-1.5",children:t.summary})]}),t.toolsUsed&&t.toolsUsed.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Tools"}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:t.toolsUsed.map(x=>e.jsx("span",{className:"text-[10px] px-2 py-1 rounded bg-blue-500/10 text-blue-400/80 border border-blue-500/20",children:x},x))})]}),t.filesModified&&t.filesModified.length>0&&e.jsxs("div",{children:[e.jsxs("span",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:["Files Modified (",t.filesModified.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:t.filesModified.map(x=>e.jsx("span",{className:"text-[10px] px-2 py-1 rounded bg-zinc-800 text-zinc-400 border border-[#27282f] font-mono",children:x},x))})]})]})]}):e.jsx("div",{className:"bg-[#16171f] rounded-lg border border-[#27282f] overflow-hidden",children:e.jsx("button",{onClick:()=>b&&a?.(),className:`w-full p-3 text-left transition-colors ${b?"hover:bg-[#1e1f2a] cursor-pointer":""}`,children:e.jsxs("div",{className:"flex items-start gap-2.5",children:[b?e.jsx("svg",{className:`w-3 h-3 mt-0.5 flex-shrink-0 transition-transform ${l.color}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):e.jsx("div",{className:`w-2 h-2 rounded-full mt-1 flex-shrink-0 ${l.color} bg-current`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-zinc-200 truncate font-medium",children:t.title}),e.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded border flex-shrink-0 ${p}`,children:c})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[e.jsx("span",{className:`text-[10px] ${l.color}`,children:l.label}),e.jsxs("span",{className:"text-[10px] text-zinc-600",children:[t.messageCount," message",t.messageCount!==1?"s":""]}),t.outcome&&t.outcome!=="unknown"&&e.jsx("span",{className:`text-[10px] ${h[t.outcome]??"text-zinc-500"}`,children:t.outcome})]}),t.summary&&e.jsx("p",{className:"text-[10px] text-zinc-500 mt-1.5 line-clamp-2 leading-relaxed",children:t.summary})]})]})})})}function ve({lines:t,phaseName:n}){return t.length===0?e.jsx("div",{className:"bg-[#0d0e14] rounded-lg border border-[#27282f] p-6 text-center",children:e.jsx("p",{className:"text-xs text-zinc-500",children:n==="summarize"?"Conversation summaries will appear here during the summarize phase.":n==="cluster"?"Cluster information will appear here during the cluster phase.":"Phase output will appear here."})}):e.jsxs("div",{className:"bg-[#0d0e14] rounded-lg border border-[#27282f] overflow-hidden",children:[e.jsx("div",{className:"px-3 py-2 border-b border-[#27282f]",children:e.jsxs("span",{className:"text-[10px] text-zinc-500",children:[t.length," output lines"]})}),e.jsx("div",{className:"max-h-[400px] overflow-y-auto p-3 space-y-0.5",children:t.map((a,s)=>e.jsx(Ne,{line:a},s))})]})}function Ne({line:t}){let n="text-zinc-500";return t.includes("[summarize]")?n="text-blue-400/80":t.includes("[cluster]")?n="text-purple-400/80":t.includes("[generate]")||t.includes("[skill-gen]")?n="text-emerald-400/80":t.includes("ERROR")||t.includes("error")?n="text-red-400/80":t.includes("Done")||t.includes("complete")?n="text-emerald-400/80":(t.includes("Warning")||t.includes("warning"))&&(n="text-amber-400/80"),e.jsx("div",{className:`text-[11px] font-mono leading-5 ${n}`,children:t})}function V(t){try{return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function ke(t){if(t<1e3)return`${t}ms`;const n=Math.round(t/1e3);if(n<60)return`${n}s`;const a=Math.floor(n/60),s=n%60;return`${a}m ${s}s`}function we({files:t,onResolved:n}){const[a,s]=r.useState(()=>new Set(t)),l=Z(),c=r.useCallback(i=>{s(m=>{const u=new Set(m);return u.has(i)?u.delete(i):u.add(i),u})},[]),p=r.useCallback(()=>{s(new Set(t))},[t]),h=r.useCallback(()=>{s(new Set)},[]),b=r.useCallback(async()=>{const i=t.filter(u=>a.has(u)),m=t.filter(u=>!a.has(u));await l.mutateAsync({approve:i,reject:m}),n?.()},[t,a,l,n]),x=a.size,o=t.length-x;return e.jsxs("div",{className:"bg-[#16171f] rounded-xl border border-amber-500/20 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-amber-500/5 border-b border-amber-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126z"})}),e.jsxs("span",{className:"text-sm font-medium text-amber-400",children:["Orphaned Files (",t.length,")"]})]}),e.jsxs("span",{className:"text-[10px] text-zinc-500",children:[x," to delete, ",o," to keep"]})]}),e.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:t.map(i=>{const m=a.has(i);return e.jsxs("button",{onClick:()=>c(i),className:`w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors border-b border-[#27282f] last:border-b-0 ${m?"bg-red-500/5 hover:bg-red-500/10":"bg-emerald-500/5 hover:bg-emerald-500/10"}`,children:[e.jsx("div",{className:`flex-shrink-0 w-5 h-5 rounded flex items-center justify-center ${m?"bg-red-500/20 text-red-400":"bg-emerald-500/20 text-emerald-400"}`,children:m?e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"})}):e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs font-mono text-zinc-300 truncate block",children:i}),e.jsx("span",{className:`text-[10px] ${m?"text-red-400/70":"text-emerald-400/70"}`,children:m?"Will be deleted":"Will be kept"})]})]},i)})}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-[#0f1017] border-t border-[#27282f]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:p,className:"px-2 py-1 text-[10px] rounded bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors",children:"Delete All"}),e.jsx("button",{onClick:h,className:"px-2 py-1 text-[10px] rounded bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20 transition-colors",children:"Keep All"})]}),e.jsxs("button",{onClick:b,disabled:l.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-blue-600/20 text-blue-400 border border-blue-500/30 hover:bg-blue-600/30 transition-colors disabled:opacity-40",children:[l.isPending?e.jsxs("svg",{className:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),l.isPending?"Resolving...":"Confirm"]})]})]})}function ye(t,n={}){const{enabled:a=!0,maxEvents:s=100,reconnectDelay:l=3e3}=n,[c,p]=r.useState(new Map),[h,b]=r.useState(null),[x,o]=r.useState(!1),[i,m]=r.useState(null),u=r.useRef(null),N=r.useRef(null),f=r.useRef(t);f.current=t;const W=r.useCallback(()=>{p(new Map),b(null),m(null)},[]);return r.useEffect(()=>{if(!a){u.current&&(u.current.close(),u.current=null),o(!1);return}function w(){const g=new EventSource("/api/events/stream");u.current=g,g.onopen=()=>{o(!0),m(null)},g.onerror=()=>{o(!1),g.close(),u.current=null,N.current=setTimeout(()=>{a&&w()},l)},g.addEventListener("connected",()=>{o(!0)});const L=v=>{try{const M=JSON.parse(v.data),R={type:v.type,data:M,timestamp:new Date().toISOString()};if(f.current.length>0&&!f.current.includes(v.type))return;b(R),p(j=>{const S=new Map(j),y=[...S.get(v.type)??[],R];return S.set(v.type,y.length>s?y.slice(-s):y),S})}catch{}};if(t.length>0)for(const v of t)g.addEventListener(v,L);else g.onmessage=L}return w(),()=>{u.current&&(u.current.close(),u.current=null),N.current&&(clearTimeout(N.current),N.current=null),o(!1)}},[a,l,s]),{events:c,lastEvent:h,connected:x,error:i,reset:W}}const Se=["skill:scanStart","skill:scanEnd","skill:phaseStart","skill:phaseComplete","skill:phaseSkipped","skill:checkpoint","skill:markdownChunk","skill:conversationSummary","skill:orphansFound","skill:orphansResolved","skill:output","scan:phase","scan:progress"];function Ee(){const[t,n]=r.useState([]),[a,s]=r.useState(null),[l,c]=r.useState(!1),[p,h]=r.useState([]),[b,x]=r.useState(null),[o,i]=r.useState(!1),[m,u]=r.useState(!1),N=r.useRef(0),f=ee();te();const W=se(),w=ne(!0),g=re(),L=ae(),v=le(),M=ie(),R=w.data?.running??!1,j=R||o,{lastEvent:S,connected:B,reset:y}=ye(Se,{enabled:j});r.useEffect(()=>{w.data&&i(w.data.running)},[w.data]);const k=w.data,$=W.data?.checkpoint??null,z=t[0]??null,H=[{name:"summarize",label:"Summarizing conversations",status:"pending"},{name:"cluster",label:"Clustering by repo",status:"pending"},{name:"generate",label:"Generating skill",status:"pending"}],E=k?.phases?.length?k.phases.map(d=>d.name==="summarize"&&k.conversations?.length?{...d,conversations:k.conversations}:d):H,K=$&&z&&$.repoName.toLowerCase()===z.toLowerCase()&&$.completedPhases.length>0,D=k?.error||b;r.useEffect(()=>{if(!j)return;const d=async()=>{try{const T=await ce(N.current);T.lines.length>0&&(h(X=>[...X,...T.lines]),N.current=T.total)}catch{}};d();const C=setInterval(d,1500);return()=>clearInterval(C)},[j]),r.useEffect(()=>{(S?.type==="skill:orphansFound"||S?.type==="skill:orphansResolved")&&f.invalidateQueries({queryKey:A.repoScanStatus})},[S,f]),r.useEffect(()=>{E.find(C=>C.status==="active")?.name==="generate"&&a!=="generate"&&s("generate")},[E,a]);const q=r.useCallback(async()=>{if(z){x(null),h([]),N.current=0,i(!0),s(null),y();try{await g.mutateAsync({repoName:z,force:l}),f.invalidateQueries({queryKey:A.repoScanStatus})}catch(d){i(!1);const C=d instanceof Error?d.message:"Failed to start scan";x(C)}}},[z,l,g,y,f]),Q=r.useCallback(async()=>{x(null),h([]),N.current=0,i(!0),y();try{await L.mutateAsync(),f.invalidateQueries({queryKey:A.repoScanStatus})}catch(d){i(!1);const C=d instanceof Error?d.message:"Failed to resume scan";x(C)}},[L,y,f]),U=r.useCallback(async()=>{try{await v.mutateAsync(),i(!1),f.invalidateQueries({queryKey:A.repoScanStatus})}catch{}},[v,f]),G=r.useCallback(async()=>{try{await M.mutateAsync()}catch{}},[M]),J=e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold text-white",children:"Repo Scan"}),e.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"Dedicated skill generation for a single repository"})]}),e.jsxs("div",{className:"bg-[#16171f] rounded-xl border border-[#27282f] p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-xs text-zinc-400 font-medium",children:"Target Repository"}),B&&j&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-emerald-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"Live"]})]}),e.jsx(oe,{mode:"filter",value:t,onChange:d=>n(d.slice(-1)),className:"w-full"}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:l,onChange:d=>c(d.target.checked),className:"w-3.5 h-3.5 rounded border-zinc-600 bg-[#0f1117] text-blue-500 focus:ring-blue-500/30"}),e.jsx("span",{className:"text-xs text-zinc-400",children:"Force regeneration (ignore cache)"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[j?e.jsxs("button",{onClick:U,disabled:v.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-red-600/20 text-red-400 border border-red-500/30 hover:bg-red-600/30 transition-colors disabled:opacity-40",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}),"Stop Scan"]}):e.jsxs("button",{onClick:q,disabled:!z||g.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-blue-600/20 text-blue-400 border border-blue-500/30 hover:bg-blue-600/30 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[g.isPending?e.jsxs("svg",{className:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 010 1.972l-11.54 6.347a1.125 1.125 0 01-1.667-.986V5.653z"})}),g.isPending?"Starting...":"Start Scan"]}),!z&&!j&&e.jsx("span",{className:"text-[10px] text-zinc-600",children:"Select a repo first"})]})]}),K&&!j&&e.jsx("div",{className:"bg-amber-500/5 rounded-xl border border-amber-500/20 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("svg",{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs text-amber-400 font-medium",children:"Interrupted scan detected"}),e.jsxs("p",{className:"text-[11px] text-zinc-400 mt-1",children:["Previous scan for ",e.jsx("span",{className:"text-zinc-300",children:$.repoName})," completed"," ",$.completedPhases.length,"/3 phases."]}),e.jsxs("div",{className:"flex items-center gap-2 mt-2.5",children:[e.jsx("button",{onClick:Q,disabled:L.isPending,className:"px-2.5 py-1 text-[11px] rounded-md bg-amber-500/20 text-amber-400 border border-amber-500/30 hover:bg-amber-500/30 transition-colors",children:"Resume Scan"}),e.jsx("button",{onClick:G,disabled:M.isPending,className:"px-2.5 py-1 text-[11px] rounded-md bg-zinc-800 text-zinc-400 hover:bg-zinc-700 transition-colors",children:"Discard"})]})]})]})}),D&&e.jsx("div",{className:"bg-red-500/5 rounded-xl border border-red-500/20 p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("svg",{className:"w-4 h-4 text-red-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126z"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-xs text-red-400",children:D}),b&&e.jsx("button",{onClick:()=>x(null),className:"text-[10px] text-zinc-500 hover:text-zinc-300 mt-1",children:"Dismiss"})]})]})}),e.jsxs("div",{className:"bg-[#16171f] rounded-xl border border-[#27282f] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-xs font-medium text-zinc-400",children:"Pipeline Progress"}),o&&!R&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-blue-400",children:[e.jsxs("svg",{className:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Starting..."]}),R&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[10px] text-blue-400",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse"}),"Running"]})]}),e.jsx(me,{phases:E,onPhaseClick:s,selectedPhase:a})]}),k?.pendingOrphans&&k.pendingOrphans.files.length>0&&e.jsx(we,{files:k.pendingOrphans.files,onResolved:()=>{f.invalidateQueries({queryKey:A.repoScanStatus})}}),p.length>0&&e.jsx(Ce,{lines:p,running:j})]}),P=E.find(d=>d.name===a),F=P?e.jsx(fe,{phase:P,markdownContent:k?.markdownContent,isStreaming:j&&P.name==="generate"&&P.status==="active",expanded:m,onToggleExpand:()=>u(d=>!d)}):e.jsx(ze,{isRunning:j,hasPhases:E.some(d=>d.status!=="pending")});return m&&P?e.jsx("div",{className:"max-w-6xl w-full",children:F}):e.jsx(de,{left:J,right:F,rightVisible:!!a||j,initialRightWidth:520,minRightWidth:360,maxRightWidth:800})}function ze({isRunning:t,hasPhases:n}){return e.jsxs("div",{className:"bg-[#16171f] rounded-lg border border-[#27282f] p-8 text-center",children:[e.jsx("svg",{className:"w-10 h-10 text-zinc-700 mx-auto mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),e.jsx("p",{className:"text-sm text-zinc-500 mb-1",children:t?"Click a phase in the timeline to view details":n?"Select a phase to view its materials":"Select a repository and start a scan"}),e.jsx("p",{className:"text-xs text-zinc-600",children:"Phase materials include conversation summaries, cluster info, and the generated SKILL.md"})]})}function Ce({lines:t,running:n}){const[a,s]=r.useState(!1),l=r.useRef(null);return r.useEffect(()=>{l.current&&!a&&(l.current.scrollTop=l.current.scrollHeight)},[t,a]),e.jsxs("div",{className:"bg-[#0d0e14] rounded-xl border border-[#27282f] overflow-hidden",children:[e.jsxs("button",{onClick:()=>s(!a),className:"w-full flex items-center justify-between px-3 py-2 hover:bg-[#1e1f2a] transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-zinc-500",children:"Terminal Output"}),e.jsxs("span",{className:"text-[10px] text-zinc-600 font-mono",children:[t.length," lines"]}),n&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse"})]}),e.jsx("svg",{className:`w-3 h-3 text-zinc-500 transition-transform ${a?"":"rotate-180"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),!a&&e.jsx("div",{ref:l,className:"max-h-[200px] overflow-y-auto px-3 pb-2 space-y-0.5",children:t.map((c,p)=>e.jsx("div",{className:"text-[10px] font-mono text-zinc-600 leading-4",children:c},p))})]})}export{Ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,j as t}from"./markdown-CZuQZQX5.js";import{x as M,b as E,a2 as B}from"./index-CVSL0ryk.js";function q({mode:s,value:x,onChange:r,align:b="left",className:f=""}){const l=M(),p=E(),a=B(),[i,k]=n.useState(!1),[d,L]=n.useState(""),g=n.useRef(null),v=n.useRef(null),[z,m]=n.useState(null);n.useEffect(()=>{if(!i)return;const e=o=>{g.current&&!g.current.contains(o.target)&&v.current&&!v.current.contains(o.target)&&k(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);const C=s==="config"?l.isLoading:p.isLoading,c=n.useMemo(()=>s==="config"?(l.data?.repos??[]).map(e=>({name:e.name,path:e.path,conversationCount:e.conversationCount,score:e.score,included:e.included,excluded:e.excluded})):p.data?p.data.repos.map(e=>({name:e.repo,path:e.repoPath,conversationCount:e.conversationCount,score:0,included:!1,excluded:!1})):[],[s,l.data,p.data]),j=s==="config"?l.data?.config:void 0;n.useEffect(()=>{s==="config"&&l.data&&m(l.data.repos.filter(e=>e.selected).map(e=>e.name))},[s,l.data]);const h=n.useMemo(()=>s==="filter"?new Set(x??[]):new Set(z??[]),[s,x,z]),y=n.useMemo(()=>{if(!d)return c;const e=d.toLowerCase();return c.filter(o=>o.name.toLowerCase().includes(e)||o.path.toLowerCase().includes(e))},[c,d]),w=h.size,u=c.length,S=n.useCallback(e=>{const o=new Set(h);o.has(e)?o.delete(e):o.add(e);const N=Array.from(o);s==="filter"?r?.(N):(m(N),a.mutate({mode:"whitelist",include:N}))},[s,h,r,a]),R=n.useCallback(()=>{const e=c.map(o=>o.name);s==="filter"?r?.(e):(m(e),a.mutate({mode:"all"}))},[s,c,r,a]),A=n.useCallback(()=>{s==="filter"?r?.([]):(m([]),a.mutate({mode:"whitelist",include:[]}))},[s,r,a]),$=n.useCallback(()=>{a.mutate({mode:"auto"})},[a]);return t.jsxs("div",{className:`relative ${f}`,children:[t.jsxs("button",{ref:v,onClick:()=>k(!i),className:"flex items-center gap-2 px-3 py-1.5 text-xs rounded-md bg-[#16171f] border border-[#27282f] text-zinc-300 hover:border-zinc-600 transition-colors",children:[t.jsx("svg",{className:"w-3.5 h-3.5 text-zinc-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})}),t.jsx("span",{children:C?"Loading...":w===u&&u>0?`All repos (${u})`:w===0?`${u} repos`:`${w} of ${u} repos`}),t.jsx("svg",{className:`w-3 h-3 text-zinc-500 transition-transform ${i?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),i&&t.jsxs("div",{ref:g,className:`absolute z-50 top-full mt-1 w-80 bg-[#16171f] border border-[#27282f] rounded-xl shadow-2xl overflow-hidden ${b==="right"?"right-0":"left-0"}`,children:[t.jsxs("div",{className:"p-2 border-b border-[#27282f]",children:[t.jsx("input",{type:"text",placeholder:"Search repos...",value:d,onChange:e=>L(e.target.value),className:"w-full bg-[#0f1117] border border-[#27282f] rounded-md px-2.5 py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:border-blue-500/50",autoFocus:!0}),t.jsxs("div",{className:"flex items-center gap-1.5 mt-2",children:[t.jsx("button",{onClick:R,className:"px-2 py-1 text-[10px] rounded bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 transition-colors",children:"Select All"}),t.jsx("button",{onClick:A,className:"px-2 py-1 text-[10px] rounded bg-zinc-500/10 text-zinc-400 hover:bg-zinc-500/20 transition-colors",children:"Clear"}),s==="config"&&t.jsx("button",{onClick:$,className:`px-2 py-1 text-[10px] rounded transition-colors ${j?.mode==="auto"?"bg-emerald-500/20 text-emerald-400":"bg-zinc-500/10 text-zinc-400 hover:bg-zinc-500/20"}`,children:"Auto"}),s==="config"&&j&&t.jsxs("span",{className:"ml-auto text-[10px] text-zinc-600",children:["mode: ",j.mode]})]})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto",children:C?t.jsx("div",{className:"px-3 py-4 text-xs text-zinc-500 text-center",children:"Loading repos..."}):y.length===0?t.jsx("div",{className:"px-3 py-4 text-xs text-zinc-500 text-center",children:d?"No repos match your search":"No repos with conversation data"}):y.map(e=>t.jsx(W,{repo:e,showScore:s==="config",checked:h.has(e.name),onToggle:()=>S(e.name)},e.name))})]})]})}function W({repo:s,showScore:x,checked:r,onToggle:b}){const f=s.name.includes("/")?s.name.split("/").pop():s.name;return t.jsxs("button",{onClick:b,className:"w-full flex items-center gap-2.5 px-3 py-2 text-left hover:bg-[#1e1f2a] transition-colors border-b border-[#27282f] last:border-b-0",children:[t.jsx("div",{className:`w-4 h-4 rounded border flex-shrink-0 flex items-center justify-center transition-colors ${r?"bg-blue-600 border-blue-500":"bg-[#0f1117] border-[#27282f]"}`,children:r&&t.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"text-xs text-zinc-200 truncate",children:f}),s.included&&t.jsx("span",{className:"text-[9px] px-1 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20",children:"included"}),s.excluded&&t.jsx("span",{className:"text-[9px] px-1 py-0.5 rounded bg-red-500/10 text-red-400 border border-red-500/20",children:"excluded"})]}),s.name!==f&&t.jsx("div",{className:"text-[10px] text-zinc-600 truncate",children:s.name})]}),x&&t.jsx("div",{className:`flex-shrink-0 text-[10px] font-mono px-1.5 py-0.5 rounded ${s.score>=60?"bg-emerald-500/10 text-emerald-400":s.score>=30?"bg-yellow-500/10 text-yellow-400":"bg-zinc-500/10 text-zinc-500"}`,children:Math.round(s.score)}),t.jsxs("span",{className:"flex-shrink-0 text-[10px] text-zinc-500 tabular-nums min-w-[32px] text-right",children:[s.conversationCount,"c"]})]})}export{q as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,j as t}from"./markdown-CZuQZQX5.js";function M({left:l,right:p,rightVisible:x,initialRightWidth:g=420,minRightWidth:i=280,maxRightWidth:a=700,minLeftWidth:o=300}){const[c,y]=e.useState(g),r=e.useRef(!1),u=e.useRef(null),d=e.useRef(0),f=e.useRef(0),b=e.useCallback(s=>{s.preventDefault(),r.current=!0,d.current=s.clientX,f.current=c,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[c]);return e.useEffect(()=>{const s=w=>{if(!r.current||!u.current)return;const R=d.current-w.clientX,h=u.current.getBoundingClientRect().width;let n=f.current+R;n=Math.max(i,Math.min(a,n));const v=8;h-v-n<o&&(n=h-v-o),y(n)},m=()=>{r.current&&(r.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",s),document.addEventListener("mouseup",m),()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",m)}},[i,a,o]),x?t.jsxs("div",{ref:u,className:"flex w-full gap-0",children:[t.jsx("div",{className:"flex-1 min-w-0",children:l}),t.jsxs("div",{onMouseDown:b,className:"flex-shrink-0 w-2 cursor-col-resize group relative flex items-center justify-center",children:[t.jsx("div",{className:"absolute inset-y-0 w-[3px] rounded-full bg-[#27282f] group-hover:bg-purple-500/50 group-active:bg-purple-500/80 transition-colors"}),t.jsx("div",{className:"absolute inset-y-0 -left-1 -right-1"})]}),t.jsx("div",{className:"flex-shrink-0 sticky top-4 self-start",style:{width:c},children:p})]}):t.jsx("div",{className:"max-w-6xl w-full",children:l})}export{M as R};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as u,j as e}from"./markdown-CZuQZQX5.js";import{i as L,P as W,Q as q,R as N,S as y,q as w}from"./index-CVSL0ryk.js";import{t as B,T as z}from"./Overview-B_jOY8il.js";function H(){const t=L(),[s,r]=u.useState("pending"),i=W(),n=q(),[l,o]=u.useState(null),[d,b]=u.useState(!1),[k,f]=u.useState(!1),c=i.data?.items??[],v=n.data?.items??[],A=i.isLoading||n.isLoading;function x(){t.invalidateQueries({queryKey:w.pending}),t.invalidateQueries({queryKey:w.output})}async function P(a){try{await N(a),o(null),x()}catch(g){console.error("Failed to accept:",g)}}async function R(a){try{await y(a),o(null),x()}catch(g){console.error("Failed to reject:",g)}}async function $(){b(!0);try{await Promise.all(c.map(a=>N(a.id))),o(null),x()}catch(a){console.error("Failed to accept all:",a),x()}finally{b(!1)}}async function S(){b(!0),f(!1);try{await Promise.all(c.map(a=>y(a.id))),o(null),x()}catch(a){console.error("Failed to reject all:",a),x()}finally{b(!1)}}return A?e.jsx("div",{className:"text-zinc-500 py-8 text-center",children:"Loading..."}):e.jsxs("div",{className:"max-w-6xl",children:[e.jsx("h2",{className:"text-2xl font-bold text-white mb-6",style:{textWrap:"balance"},children:"Review"}),e.jsxs("nav",{className:"flex gap-1 mb-6 bg-[#16171f] rounded-lg p-1 w-fit border border-[#27282f]",role:"tablist",children:[e.jsxs("button",{role:"tab","aria-selected":s==="pending",onClick:()=>r("pending"),className:`px-4 py-1.5 rounded-md text-sm transition-colors focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:outline-none ${s==="pending"?"bg-[#2563eb]/20 text-blue-400":"text-zinc-500 hover:text-zinc-300"}`,children:["Pending (",e.jsx("span",{className:"tabular-nums",children:c.length}),")"]}),e.jsxs("button",{role:"tab","aria-selected":s==="conclusions",onClick:()=>r("conclusions"),className:`px-4 py-1.5 rounded-md text-sm transition-colors focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:outline-none ${s==="conclusions"?"bg-[#2563eb]/20 text-blue-400":"text-zinc-500 hover:text-zinc-300"}`,children:["Conclusions (",e.jsx("span",{className:"tabular-nums",children:v.length}),")"]})]}),s==="pending"&&e.jsxs("section",{"aria-label":"Pending proposals",children:[c.length>1&&e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsxs("button",{onClick:$,disabled:d,"aria-label":`Accept all ${c.length} pending items`,className:"px-3 py-1.5 text-xs rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white transition-colors disabled:opacity-50 font-medium flex items-center gap-1.5 focus-visible:ring-2 focus-visible:ring-emerald-400 focus-visible:outline-none",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),"Accept All (",e.jsx("span",{className:"tabular-nums",children:c.length}),")"]}),k?e.jsxs("div",{className:"flex items-center gap-2 bg-red-600/10 border border-red-500/20 rounded-lg px-3 py-1.5",children:[e.jsx("span",{className:"text-xs text-red-400",children:"Discard all proposals?"}),e.jsx("button",{onClick:S,disabled:d,className:"text-xs font-medium text-red-400 hover:text-red-300 underline focus-visible:ring-2 focus-visible:ring-red-400 focus-visible:outline-none rounded",children:"Confirm"}),e.jsx("button",{onClick:()=>f(!1),className:"text-xs text-zinc-500 hover:text-zinc-300 focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:outline-none rounded",children:"Cancel"})]}):e.jsxs("button",{onClick:()=>f(!0),disabled:d,"aria-label":`Reject all ${c.length} pending items`,className:"px-3 py-1.5 text-xs rounded-lg bg-red-600/20 hover:bg-red-600/30 text-red-400 border border-red-500/20 transition-colors disabled:opacity-50 font-medium flex items-center gap-1.5 focus-visible:ring-2 focus-visible:ring-red-400 focus-visible:outline-none",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"Reject All (",e.jsx("span",{className:"tabular-nums",children:c.length}),")"]}),d&&e.jsx("span",{className:"text-xs text-zinc-500",children:"Processing..."})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"w-80 flex-shrink-0",children:c.length===0?e.jsxs("div",{className:"text-sm text-zinc-500 bg-[#16171f] border border-[#27282f] rounded-xl p-6 text-center",children:["No pending proposals. Run"," ",e.jsx("code",{className:"text-zinc-300 bg-[#0f1117] px-1.5 py-0.5 rounded text-xs",children:"lore sync"})," ","to generate new ones."]}):e.jsx("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl overflow-hidden",children:c.map(a=>e.jsx(T,{item:a,isSelected:l===a.id,onSelect:()=>o(a.id)},a.id))})}),e.jsx("div",{className:"flex-1 min-w-0",children:l?e.jsx(Q,{item:c.find(a=>a.id===l),onAccept:P,onReject:R}):e.jsx("div",{className:"text-sm text-zinc-500 bg-[#16171f] border border-[#27282f] rounded-xl p-8 text-center",children:"Select a pending item to preview."})})]})]}),s==="conclusions"&&e.jsx(K,{output:v})]})}function T({item:t,isSelected:s,onSelect:r}){const i=t.title||J(t);return e.jsxs("button",{onClick:r,className:`w-full text-left px-4 py-3 border-b border-[#27282f] last:border-b-0 transition-colors focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-inset focus-visible:outline-none ${s?"bg-blue-600/10 border-l-2 border-l-blue-500":"hover:bg-[#1e1f2a]"}`,children:[t.repo&&e.jsx("div",{className:"mb-1.5",children:e.jsx(m,{repo:t.repo})}),e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(j,{type:t.type}),e.jsx("span",{className:"text-[11px] text-zinc-600 tabular-nums",children:B(t.createdAt)})]}),e.jsx(z,{content:i,className:"text-sm text-zinc-300 truncate mt-0.5 font-medium",children:i})]})}function Q({item:t,onAccept:s,onReject:r}){return e.jsxs("article",{className:"bg-[#16171f] border border-[#27282f] rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-[#27282f]",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[t.repo&&e.jsx(m,{repo:t.repo}),e.jsx(j,{type:t.type}),e.jsx("span",{className:"text-xs text-zinc-500 tabular-nums flex-shrink-0",children:new Date(t.createdAt).toLocaleString()})]}),e.jsxs("div",{className:"flex gap-2 flex-shrink-0 ml-3",children:[e.jsx("button",{onClick:()=>s(t.id),"aria-label":"Accept this proposal",className:"px-3 py-1.5 text-sm rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white transition-colors font-medium focus-visible:ring-2 focus-visible:ring-emerald-400 focus-visible:outline-none",children:"Accept"}),e.jsx("button",{onClick:()=>r(t.id),"aria-label":"Reject this proposal",className:"px-3 py-1.5 text-sm rounded-lg bg-red-600/20 hover:bg-red-600/30 text-red-400 border border-red-500/20 transition-colors font-medium focus-visible:ring-2 focus-visible:ring-red-400 focus-visible:outline-none",children:"Reject"})]})]}),e.jsx("div",{className:"p-5 max-h-[70vh] overflow-auto",children:e.jsx(C,{type:t.type,content:t.content,title:t.title})})]})}function C({type:t,content:s,title:r}){return t==="adr"?e.jsx(D,{content:s}):t==="architecture"?e.jsx(M,{content:s}):t==="changelog"?e.jsx(F,{content:s,title:r}):e.jsx("pre",{className:"text-sm text-zinc-300 whitespace-pre-wrap font-mono bg-[#0f1117] rounded-lg p-4 leading-relaxed",children:s})}function D({content:t}){const s=u.useMemo(()=>h(t),[t]);return s?e.jsxs("div",{className:"space-y-4",children:[s.title&&e.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[e.jsx("h3",{className:"text-lg font-semibold text-white",style:{textWrap:"balance"},children:s.title}),s.repo&&e.jsx(m,{repo:s.repo})]}),s.context&&e.jsx(p,{label:"Context",children:e.jsx("p",{className:"text-sm text-zinc-300 leading-relaxed",children:s.context})}),s.decision&&e.jsx(p,{label:"Decision",children:e.jsx("p",{className:"text-sm text-zinc-200 leading-relaxed font-medium",children:s.decision})}),s.alternatives&&s.alternatives.length>0&&e.jsx(p,{label:"Alternatives Considered",children:e.jsx("ul",{className:"space-y-1.5",children:s.alternatives.map((r,i)=>e.jsxs("li",{className:"text-sm text-zinc-400 flex gap-2",children:[e.jsx("span",{className:"text-zinc-600 flex-shrink-0",children:"--"}),e.jsx("span",{children:r})]},i))})}),s.consequences&&e.jsx(p,{label:"Consequences",children:e.jsx("p",{className:"text-sm text-zinc-400 leading-relaxed",children:s.consequences})})]}):e.jsx("pre",{className:"text-sm text-zinc-300 whitespace-pre-wrap font-mono bg-[#0f1117] rounded-lg p-4 leading-relaxed",children:t})}function M({content:t}){const s=u.useMemo(()=>h(t),[t]);if(!s)return e.jsx("pre",{className:"text-sm text-zinc-300 whitespace-pre-wrap font-mono bg-[#0f1117] rounded-lg p-4 leading-relaxed",children:t});const r=s.changes??[],i=s.patterns??[];return e.jsxs("div",{className:"space-y-5",children:[r.length>0&&e.jsx(p,{label:`Changes (${r.length})`,children:e.jsx("div",{className:"space-y-3",children:r.map((n,l)=>e.jsxs("div",{className:"bg-[#0f1117] rounded-lg p-3 border border-[#1e1f2a]",children:[e.jsxs("div",{className:"flex items-start gap-2 mb-1 flex-wrap",children:[n.repo&&e.jsx(m,{repo:n.repo}),n.type&&e.jsx(E,{type:n.type}),e.jsx("span",{className:"text-sm text-zinc-200 font-medium leading-snug",children:n.summary??"Untitled change"})]}),n.details&&e.jsx("p",{className:"text-xs text-zinc-400 leading-relaxed mt-1.5",children:n.details}),n.files&&n.files.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:n.files.map((o,d)=>e.jsx("span",{className:"text-[10px] font-mono text-zinc-500 bg-[#16171f] px-1.5 py-0.5 rounded",children:o},d))})]},l))})}),i.length>0&&e.jsx(p,{label:`Patterns (${i.length})`,children:e.jsx("div",{className:"space-y-3",children:i.map((n,l)=>e.jsxs("div",{className:"bg-[#0f1117] rounded-lg p-3 border border-[#1e1f2a]",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-0.5",children:[n.repo&&e.jsx(m,{repo:n.repo}),e.jsx("span",{className:"text-sm text-cyan-400 font-medium",children:n.name??"Pattern"})]}),n.description&&e.jsx("p",{className:"text-xs text-zinc-400 leading-relaxed mt-1",children:n.description}),n.examples&&n.examples.length>0&&e.jsx("div",{className:"mt-2 space-y-0.5",children:n.examples.map((o,d)=>e.jsx("div",{className:"text-[11px] font-mono text-zinc-500",children:o},d))})]},l))})}),r.length===0&&i.length===0&&e.jsx("pre",{className:"text-sm text-zinc-300 whitespace-pre-wrap font-mono bg-[#0f1117] rounded-lg p-4 leading-relaxed",children:t})]})}function F({content:t,title:s}){const r=t.split(`
|
|
2
|
+
`);return e.jsxs("div",{className:"space-y-1",children:[s&&e.jsx("h3",{className:"text-lg font-semibold text-white mb-3",style:{textWrap:"balance"},children:s}),r.map((i,n)=>{const l=i.trim();return l?l.startsWith("### ")?e.jsx("h4",{className:"text-sm font-semibold text-zinc-200 mt-3 mb-1",children:l.slice(4)},n):l.startsWith("## ")?e.jsx("h3",{className:"text-base font-semibold text-zinc-100 mt-4 mb-1.5",children:l.slice(3)},n):l.startsWith("# ")?e.jsx("h2",{className:"text-lg font-bold text-white mt-4 mb-2",children:l.slice(2)},n):l.startsWith("- ")||l.startsWith("* ")?e.jsxs("div",{className:"flex gap-2 text-sm text-zinc-300 leading-relaxed",children:[e.jsx("span",{className:"text-zinc-600 flex-shrink-0",children:"--"}),e.jsx("span",{children:l.slice(2)})]},n):e.jsx("p",{className:"text-sm text-zinc-400 leading-relaxed",children:l},n):e.jsx("div",{className:"h-2"},n)})]})}function K({output:t}){return t.length===0?e.jsx("div",{className:"text-sm text-zinc-500 bg-[#16171f] border border-[#27282f] rounded-xl p-6 text-center",children:"No accepted conclusions yet."}):e.jsx("section",{"aria-label":"Accepted conclusions",className:"space-y-4",children:t.map((s,r)=>e.jsxs("article",{className:"bg-[#16171f] border border-[#27282f] rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-5 py-3 border-b border-[#27282f]",children:[e.jsx(j,{type:s.type}),e.jsx("span",{className:"text-sm text-zinc-300 font-medium",children:s.name})]}),e.jsx("div",{className:"p-5",children:e.jsx(C,{type:s.type,content:s.content})})]},r))})}function p({label:t,children:s}){return e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs uppercase tracking-wider text-zinc-500 font-medium mb-2",children:t}),s]})}function j({type:t}){const s={changelog:"text-blue-400 bg-blue-500/10 border-blue-500/20",adr:"text-purple-400 bg-purple-500/10 border-purple-500/20",architecture:"text-emerald-400 bg-emerald-500/10 border-emerald-500/20"},r={changelog:"Changelog",adr:"Decision",architecture:"Architecture"};return e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium border ${s[t]??"text-zinc-500 bg-zinc-500/10 border-zinc-500/20"}`,children:r[t]??t})}function m({repo:t}){return e.jsx(z,{content:t,className:"inline-flex max-w-[200px]",children:e.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 truncate block",children:t})})}function E({type:t}){const s={feature:"text-emerald-400 bg-emerald-500/10",bugfix:"text-red-400 bg-red-500/10",refactor:"text-amber-400 bg-amber-500/10",docs:"text-blue-400 bg-blue-500/10",chore:"text-zinc-400 bg-zinc-500/10"};return e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium flex-shrink-0 ${s[t]??"text-zinc-400 bg-zinc-500/10"}`,children:t})}function h(t){try{const s=JSON.parse(t);return typeof s=="object"&&s!==null?s:null}catch{return null}}function J(t){if(t.type==="adr"){const s=h(t.content);if(s?.title&&typeof s.title=="string")return s.title}if(t.type==="architecture"){const s=h(t.content);if(s){const r=Array.isArray(s.changes)?s.changes.length:0,i=Array.isArray(s.patterns)?s.patterns.length:0;if(r>0||i>0)return`${r} change${r!==1?"s":""}, ${i} pattern${i!==1?"s":""}`}}if(t.type==="changelog"){const s=t.content.split(`
|
|
3
|
+
`).find(r=>r.trim());if(s)return s.replace(/^#+\s*/,"").slice(0,80)}return t.content.slice(0,60)+(t.content.length>60?"...":"")}export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,j as e}from"./markdown-CZuQZQX5.js";import{c as b,N as f,O as g,L as m}from"./index-CVSL0ryk.js";const j={classify:"Classification",distill:"Distillation","skill-gen":"Skill Generation",vet:"Vetting"},N={classify:"text-blue-400 bg-blue-500/10 border-blue-500/20",distill:"text-amber-400 bg-amber-500/10 border-amber-500/20","skill-gen":"text-emerald-400 bg-emerald-500/10 border-emerald-500/20",vet:"text-purple-400 bg-purple-500/10 border-purple-500/20"};function x({phase:t,conversations:s}){const[n,l]=u.useState(!1),r=j[t]??t,i=N[t]??"text-zinc-400 bg-zinc-500/10 border-zinc-500/20";return s.length===0?null:e.jsxs("div",{className:`border rounded-lg overflow-hidden ${i.split(" ").slice(1).join(" ")}`,children:[e.jsxs("button",{type:"button",onClick:()=>l(!n),className:"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-white/5 transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("svg",{className:`w-3.5 h-3.5 transition-transform ${n?"rotate-90":""} ${i.split(" ")[0]}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})}),e.jsx("span",{className:`text-xs font-medium ${i.split(" ")[0]}`,children:r}),e.jsxs("span",{className:"text-[10px] text-zinc-500",children:[s.length," conversation",s.length!==1?"s":""]})]}),e.jsxs("span",{className:"text-[10px] text-zinc-600",children:[s.reduce((a,o)=>a+o.messageCount,0)," messages total"]})]}),n&&e.jsx("div",{className:"border-t border-inherit",children:s.map(a=>e.jsxs("a",{href:`/conversations/${a.id}`,className:"flex items-center justify-between px-3 py-2 hover:bg-white/5 transition-colors border-b border-inherit last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full flex-shrink-0 ${a.source==="cursor"?"bg-blue-400":"bg-orange-400"}`}),e.jsx("span",{className:"text-xs text-zinc-300 truncate",children:a.title})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0 ml-2",children:[e.jsxs("span",{className:"text-[10px] text-zinc-500",children:[a.messageCount," msgs"]}),a.createdAt&&e.jsx("span",{className:"text-[10px] text-zinc-600",children:new Date(a.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]},a.id))})]})}const v=[{pattern:/Scanning Cursor conversations/i,phase:"scan-cursor",label:"Scanning Cursor",color:"border-blue-500"},{pattern:/Scanning Claude Code conversations/i,phase:"scan-claude",label:"Scanning Claude Code",color:"border-orange-500"},{pattern:/Invoking Claude.*distillation/i,phase:"distill",label:"Distillation",color:"border-amber-500"},{pattern:/Writing results to review queue/i,phase:"write",label:"Writing Results",color:"border-emerald-500"},{pattern:/\[skill-gen\]/i,phase:"skill-gen",label:"Skill Generation",color:"border-purple-500"},{pattern:/\[Phase 1\]/i,phase:"phase-1",label:"Phase 1: Research",color:"border-cyan-500"},{pattern:/\[Phase 2a?\]/i,phase:"phase-2",label:"Phase 2: Writing",color:"border-green-500"},{pattern:/\[Phase 2b\]/i,phase:"phase-2b",label:"Phase 2b: References",color:"border-teal-500"},{pattern:/Sync complete/i,phase:"complete",label:"Complete",color:"border-emerald-400"},{pattern:/^ERROR:/i,phase:"error",label:"Error",color:"border-red-500"}];function k(t){for(const s of v)if(s.pattern.test(t))return s;return null}function w(t){const s=t.match(/^\[(\d{2}:\d{2}:\d{2})\]\s*/);return s?{timestamp:s[1],content:t.slice(s[0].length)}:{timestamp:null,content:t}}function z(t){return/^(Sync started|Sync complete|Total:|Queued:|ERROR:)/i.test(t)}function y({output:t,conversations:s}){if(t.length===0)return e.jsx("div",{className:"text-zinc-500 text-sm py-4 text-center",children:"No terminal output recorded for this run."});const n=new Set,l=[];let r=null;for(let i=0;i<t.length;i++){const a=t[i],{timestamp:o,content:d}=w(a),c=k(d);c&&c.phase!==r&&(r&&s[r]&&!n.has(r)&&(n.add(r),l.push(e.jsx("div",{className:"ml-6 my-2",children:e.jsx(x,{phase:r,conversations:s[r]})},`conv-${r}`))),r=c.phase,l.push(e.jsxs("div",{className:`flex items-center gap-2 my-2 py-1.5 px-3 bg-[#12131a] border-l-2 ${c.color} rounded-r`,children:[e.jsx("span",{className:"text-xs font-semibold text-white",children:c.label}),o&&e.jsx("span",{className:"text-[10px] text-zinc-500 ml-auto",children:o})]},`phase-${i}`)));const p=z(d);l.push(e.jsxs("div",{className:`flex gap-2 py-0.5 px-3 font-mono text-[11px] leading-relaxed ${p?"text-zinc-200 font-medium":"text-zinc-500"} ${d.startsWith("ERROR")?"text-red-400":""}`,children:[o&&e.jsx("span",{className:"text-zinc-700 flex-shrink-0 select-none w-14 text-right",children:o}),e.jsx("span",{className:"whitespace-pre-wrap break-all",children:d})]},`line-${i}`))}r&&s[r]&&!n.has(r)&&(n.add(r),l.push(e.jsx("div",{className:"ml-6 my-2",children:e.jsx(x,{phase:r,conversations:s[r]})},`conv-${r}-final`)));for(const[i,a]of Object.entries(s))!n.has(i)&&a.length>0&&l.push(e.jsx("div",{className:"ml-6 my-2",children:e.jsx(x,{phase:i,conversations:a})},`conv-remaining-${i}`));return e.jsx("div",{className:"bg-[#0d0e14] rounded-lg border border-[#1e1f2a] overflow-hidden",children:e.jsx("div",{className:"max-h-[600px] overflow-y-auto py-2",children:l})})}function h(t){if(t<1e3)return`${t}ms`;const s=Math.floor(t/1e3);if(s<60)return`${s}s`;const n=Math.floor(s/60),l=s%60;return`${n}m ${l}s`}function C(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function S({status:t}){return e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium rounded-full ${t==="completed"?"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:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t==="completed"?"bg-emerald-400":"bg-red-400"}`}),t==="completed"?"Completed":"Failed"]})}const $={scan:"๐",distill:"๐งช",write:"โ๏ธ","skill-gen":"โก"},L={completed:"border-emerald-500/30 bg-emerald-500/5",failed:"border-red-500/30 bg-red-500/5",skipped:"border-zinc-500/30 bg-zinc-500/5"};function R({phase:t}){return e.jsxs("div",{className:`flex flex-col gap-1 px-3 py-2 rounded-lg border ${L[t.status]??"border-zinc-700 bg-zinc-800/30"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-sm",children:$[t.name]??"๐"}),e.jsx("span",{className:"text-xs font-medium text-zinc-200 capitalize",children:t.name})]}),e.jsx("span",{className:"text-[10px] text-zinc-500",children:h(t.duration)}),t.detail&&e.jsx("span",{className:"text-[10px] text-zinc-600 truncate max-w-[180px]",children:t.detail})]})}function P({repos:t}){const s=t.flatMap(n=>n.changedFiles.map(l=>({file:l,repo:n.repo,skillPath:n.skillPath})));return s.length===0?null:e.jsxs("div",{className:"bg-[#16171f] rounded-lg border border-[#27282f] p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-zinc-200 mb-3",children:"Modified Skill Files"}),e.jsx("div",{className:"space-y-1.5",children:s.map(({file:n,repo:l})=>e.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 rounded bg-[#0d0e14] border border-[#1e1f2a]",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("svg",{className:"w-3.5 h-3.5 text-zinc-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),e.jsx("span",{className:"text-xs text-zinc-300 truncate font-mono",children:n})]}),e.jsx("span",{className:"text-[10px] text-zinc-600 flex-shrink-0 ml-2",children:l})]},`${l}-${n}`))})]})}function E(){const{id:t}=b(),{data:s,isLoading:n}=f(t),{data:l}=g(t);if(n)return e.jsx("div",{className:"text-zinc-500 py-8 text-center",children:"Loading scan details..."});if(!s)return e.jsxs("div",{className:"text-zinc-500 py-8 text-center",children:["Scan not found.",e.jsx(m,{to:"/scans",className:"text-blue-400 hover:text-blue-300 ml-2",children:"Back to scans"})]});const r=l?.phases??{};return e.jsxs("div",{className:"max-w-5xl space-y-6",children:[e.jsxs(m,{to:"/scans",className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs text-zinc-400 hover:text-white bg-[#16171f] hover:bg-[#1e1f2a] border border-[#27282f] hover:border-zinc-600 rounded-lg transition-colors",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18"})}),"Back to scans"]}),e.jsxs("div",{className:"bg-[#16171f] rounded-lg border border-[#27282f] p-5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold text-white",children:"Scan Run"}),e.jsx("p",{className:"text-xs text-zinc-500 mt-0.5 font-mono",children:s.id})]}),e.jsx(S,{status:s.status})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs text-zinc-400",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("svg",{className:"w-3.5 h-3.5 text-zinc-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),h(s.duration)]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("svg",{className:"w-3.5 h-3.5 text-zinc-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 00-1.883 2.542l.857 6a2.25 2.25 0 002.227 1.932H19.05a2.25 2.25 0 002.227-1.932l.857-6a2.25 2.25 0 00-1.883-2.542m-16.5 0V6A2.25 2.25 0 016 3.75h3.879a1.5 1.5 0 011.06.44l2.122 2.12a1.5 1.5 0 001.06.44H18A2.25 2.25 0 0120.25 9v.776"})}),s.itemsScanned," items scanned"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("svg",{className:"w-3.5 h-3.5 text-zinc-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"})}),C(s.timestamp)]}),s.dryRun&&e.jsx("span",{className:"px-2 py-0.5 bg-amber-500/10 text-amber-400 text-[10px] rounded-full border border-amber-500/20",children:"Dry Run"})]}),s.summary&&e.jsx("p",{className:"mt-3 text-xs text-zinc-400",children:s.summary}),s.errors.length>0&&e.jsx("div",{className:"mt-3 space-y-1",children:s.errors.map((i,a)=>e.jsx("p",{className:"text-[11px] text-red-400 font-mono",children:i},a))})]}),s.phases.length>0&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold text-zinc-300 mb-2",children:"Phases"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.phases.map((i,a)=>e.jsx(R,{phase:i},a))})]}),s.repos.length>0&&e.jsx(P,{repos:s.repos}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold text-zinc-300 mb-2",children:"Timeline"}),e.jsx(y,{output:s.output??[],conversations:r})]})]})}export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,a as l}from"./markdown-CZuQZQX5.js";import{s as ie,t as be,v as ge,i as je,w as ve,x as ye,q as X,y as te,z as se,A as ne,B as Ne,C as Se,D as ke,E as we,F as ze,G as Ce,H as Re,I as Le,J as $e,K as Ee,M as De,L as Me}from"./index-CVSL0ryk.js";import{t as B,T as q}from"./Overview-B_jOY8il.js";import{R as Pe}from"./ResizablePanels-Bbb4S6Ss.js";import{R as Ae}from"./RepoSelector-DmPRS8kf.js";const Te={blue:{phase:"text-blue-400",progress:"from-blue-600 to-blue-400",live:"text-emerald-500",liveDot:"bg-emerald-500",runningDot:"bg-green-500"},purple:{phase:"text-purple-400",progress:"from-purple-600 to-purple-400",live:"text-purple-400",liveDot:"bg-purple-400",runningDot:"bg-purple-500"},emerald:{phase:"text-emerald-400",progress:"from-emerald-600 to-emerald-400",live:"text-emerald-500",liveDot:"bg-emerald-500",runningDot:"bg-emerald-500"}};function Z({lines:t,running:r,error:s,phase:c,title:i,progress:o,headerSlot:x,onClose:y,onStop:g,accent:j="blue"}){const u=l.useRef(null),h=Te[j];return l.useEffect(()=>{u.current&&u.current.scrollIntoView({behavior:"smooth"})},[t]),e.jsxs("div",{className:"rounded-lg border border-[#27282f] overflow-hidden bg-[#0a0b10]",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-[#111218] border-b border-[#27282f]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${r?`${h.runningDot} animate-pulse`:s?"bg-red-500":"bg-zinc-600"}`}),e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-zinc-700"}),e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-zinc-700"})]}),e.jsxs("span",{className:"text-[11px] font-mono text-zinc-500 ml-1.5",children:[i,r&&c&&e.jsxs("span",{className:`${h.phase} ml-1.5`,children:["โ ",c]}),!r&&s&&e.jsx("span",{className:"text-red-400 ml-1.5",children:"โ failed"}),!r&&!s&&c&&e.jsx("span",{className:"text-emerald-400 ml-1.5",children:"โ done"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:`flex items-center gap-1 text-[10px] ${h.live} font-mono`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${h.liveDot} animate-pulse`}),"LIVE"]}),g&&e.jsx("button",{onClick:g,className:"text-red-400 hover:text-red-300 transition-colors p-0.5",title:"Stop",children:e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})})})]}),!r&&y&&e.jsx("button",{onClick:y,className:"text-zinc-600 hover:text-zinc-400 transition-colors p-0.5",title:"Close terminal",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]}),r&&o&&e.jsxs("div",{className:"px-3 py-1.5 bg-[#0d0e14] border-b border-[#27282f]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("span",{className:"text-[10px] text-zinc-500 font-mono",children:["Step ",o.current," / ",o.total]}),e.jsxs("span",{className:"text-[10px] text-zinc-500 font-mono",children:[o.percent,"%"]})]}),e.jsx("div",{className:"h-1.5 bg-[#1e1f2a] rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full bg-gradient-to-r ${h.progress} rounded-full transition-all duration-500`,style:{width:`${o.percent}%`}})})]}),x,e.jsxs("div",{className:"h-72 overflow-y-auto overflow-x-hidden font-mono text-[12px] leading-[1.6] p-3 scrollbar-thin",children:[t.length===0&&r&&e.jsxs("div",{className:"text-zinc-600 flex items-center gap-2",children:[e.jsx(P,{}),"Waiting for output..."]}),t.map((R,N)=>e.jsx(Oe,{line:R,index:N},N)),r&&e.jsx("div",{className:"text-zinc-600 animate-pulse mt-0.5",children:e.jsx("span",{className:"inline-block w-2 h-3.5 bg-zinc-500 animate-blink"})}),e.jsx("div",{ref:u})]})]})}const Ie=/^(\[\d{2}:\d{2}:\d{2}\])\s(.*)$/;function Fe(t){return t.includes("ERROR")||t.includes("[stderr]")?"text-red-400":t.includes("[plan]")?"text-cyan-400":t.includes("[orchestrator]")?"text-purple-400":t.includes("[repo:")||t.includes("[global]")?"text-indigo-400":t.includes("[lore]")||t.includes("[multi-agent]")?"text-blue-400":t.includes("[tokenizer]")?"text-zinc-500":t.includes("[classifier]")?"text-purple-400":t.includes("Queued:")||t.includes("complete")||t.includes("Done")||t.includes("assigned")?"text-emerald-400":t.includes("Scanning")||t.includes("Invoking")||t.includes("Classifying")?"text-amber-300":t.includes("Warning")||t.includes("Cancelled")||t.includes("unassigned")?"text-amber-400":"text-zinc-400"}function Oe({line:t,index:r}){const s=Fe(t),c=t.match(Ie);return e.jsxs("div",{className:"flex hover:bg-[#111218]/80 -mx-3 px-3",children:[e.jsx("span",{className:"text-zinc-700 select-none w-8 shrink-0 text-right mr-3",children:r+1}),c?e.jsxs("span",{className:"whitespace-pre-wrap break-all",children:[e.jsx("span",{className:"text-zinc-600",children:c[1]})," ",e.jsx("span",{className:s,children:c[2]})]}):e.jsx("span",{className:`whitespace-pre-wrap break-all ${s}`,children:t})]})}function P({className:t}){return e.jsxs("svg",{className:`w-4 h-4 animate-spin text-blue-400 ${t??""}`,viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}const Be=[{label:"1h",hours:1},{label:"3h",hours:3},{label:"6h",hours:6},{label:"12h",hours:12}],We=[{label:"1d",hours:24},{label:"3d",hours:72},{label:"7d",hours:168},{label:"30d",hours:720}],re=[{key:"1h",label:"Every hour",desc:"Runs at :MM every hour"},{key:"3h",label:"Every 3 hours",desc:"Runs every 3 hours"},{key:"6h",label:"Every 6 hours",desc:"Runs every 6 hours"},{key:"12h",label:"Every 12 hours",desc:"Runs twice daily"},{key:"1d",label:"Daily",desc:"Runs daily at chosen time"},{key:"3d",label:"Every 3 days",desc:"Every 3 days at chosen time"},{key:"7d",label:"Weekly",desc:"Mondays at chosen time"},{key:"30d",label:"Monthly",desc:"1st of month at chosen time"}];function le(t){return!!t&&["1d","3d","7d","30d"].includes(t)}function ee(t){const r=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),c=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");return`${r}-${s}-${c}T${i}:${o}`}function ae(t){const r=new Date(t).getTime()-Date.now();if(r<=0)return"any moment";const s=Math.floor(r/6e4);if(s<60)return`${s}m`;const c=Math.floor(s/60);return c<24?`${c}h ${s%60}m`:`${Math.floor(c/24)}d ${c%24}h`}function Ge({open:t,onClose:r}){const{data:s,isLoading:c}=ie(),i=be(),o=ge(),[x,y]=l.useState("once"),[g,j]=l.useState(""),[u,h]=l.useState(""),[R,N]=l.useState(null),[p,S]=l.useState(null),[k,L]=l.useState("09:00"),[A,d]=l.useState(null),[v,$]=l.useState(!1),W=l.useRef(null),w=s&&(s.scheduledAt||s.interval);l.useEffect(()=>{t&&($(!1),d(null),T())},[t]);function T(){y("once"),j(""),h(""),N(null),S(null),L("09:00")}function G(){s&&(y(s.mode??"once"),h(s.instructions??""),d(null),s.mode==="periodic"?(S(s.interval),L(s.runAt??"09:00"),j(""),N(null)):(S(null),s.scheduledAt?j(ee(new Date(s.scheduledAt))):j(""),N(null)))}if(!t)return null;const I=(a,m)=>{const J=new Date(Date.now()+m*60*60*1e3);j(ee(J)),N(a),d(null)},V=a=>{j(a),N(null),d(null)},b=a=>{S(a),d(null)},F=async()=>{if(x==="once"){if(!g){d("Pick a time first");return}const a=new Date(g);if(isNaN(a.getTime())){d("Invalid date");return}if(a.getTime()<=Date.now()){d("Must be in the future");return}try{await i.mutateAsync({mode:"once",scheduledAt:a.toISOString(),instructions:u.trim()||void 0}),r()}catch(m){d(m instanceof Error?m.message:"Failed to schedule")}}else{if(!p){d("Select an interval");return}const a=re.find(m=>m.key===p);try{await i.mutateAsync({mode:"periodic",interval:p,intervalLabel:a?.label,runAt:k,instructions:u.trim()||void 0}),r()}catch(m){d(m instanceof Error?m.message:"Failed to schedule")}}},Q=async()=>{try{await o.mutateAsync()}catch{}},K=()=>{G(),$(!0)},E=a=>{a.target===W.current&&r()},O=ee(new Date(Date.now()+6e4)),H=x==="once"?!g:!p,U=!w||v;return e.jsx("div",{ref:W,onClick:E,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:e.jsxs("div",{className:"w-full max-w-md bg-[#16171f] border border-[#27282f] rounded-2xl shadow-2xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-[#27282f]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[v&&e.jsx("button",{onClick:()=>$(!1),className:"text-zinc-500 hover:text-zinc-300 transition-colors",title:"Back",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),e.jsx("h3",{className:"text-sm font-semibold text-white",children:v?"Edit Schedule":"Schedule Scan"})]}),e.jsx("button",{onClick:r,className:"text-zinc-500 hover:text-zinc-300 transition-colors",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx("div",{className:"px-5 py-4 space-y-4",children:c?e.jsx("div",{className:"text-zinc-500 text-sm text-center py-4",children:"Loading..."}):w&&!v?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/20 rounded-xl px-4 py-3",children:[s.mode==="periodic"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-xs text-amber-400 font-medium mb-1",children:"Periodic scan active"}),e.jsx("div",{className:"text-sm text-amber-200",children:s.intervalLabel??`Every ${s.interval}`}),e.jsx("div",{className:"text-xs text-amber-400/60 mt-0.5",children:s.runAt?`Runs at ${s.runAt} via crontab`:"Runs automatically via crontab"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-xs text-amber-400 font-medium mb-1",children:"One-off scan scheduled"}),e.jsx("div",{className:"text-sm text-amber-200",children:new Date(s.scheduledAt).toLocaleString()}),e.jsxs("div",{className:"text-xs text-amber-400/60 mt-0.5",children:["in ",ae(s.scheduledAt)]})]}),s.instructions&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-amber-500/10",children:[e.jsx("div",{className:"text-[10px] text-amber-500/50 uppercase tracking-wider mb-0.5",children:"Instructions"}),e.jsx("div",{className:"text-xs text-amber-300/80",children:s.instructions})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:K,className:"flex-1 px-4 py-2 text-sm rounded-lg bg-amber-600 hover:bg-amber-500 text-white transition-colors font-medium",children:"Edit"}),e.jsx("button",{onClick:Q,disabled:o.isPending,className:"flex-1 px-4 py-2 text-sm rounded-lg bg-red-600/20 text-red-400 border border-red-500/30 hover:bg-red-600/30 transition-colors disabled:opacity-50 font-medium",children:o.isPending?"Removing...":"Delete"})]})]}):U?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex bg-[#0f1117] rounded-lg p-0.5 border border-[#27282f]",children:[e.jsx("button",{onClick:()=>{y("once"),d(null)},className:`flex-1 px-3 py-1.5 text-xs rounded-md font-medium transition-colors ${x==="once"?"bg-[#1e1f2a] text-white shadow-sm":"text-zinc-500 hover:text-zinc-300"}`,children:"One-off"}),e.jsx("button",{onClick:()=>{y("periodic"),d(null)},className:`flex-1 px-3 py-1.5 text-xs rounded-md font-medium transition-colors ${x==="periodic"?"bg-[#1e1f2a] text-white shadow-sm":"text-zinc-500 hover:text-zinc-300"}`,children:"Periodic"})]}),x==="once"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-zinc-500 mb-2 font-medium",children:"Quick select"}),e.jsx("div",{className:"flex gap-1.5 mb-1.5",children:Be.map(a=>e.jsx("button",{onClick:()=>I(a.label,a.hours),className:`flex-1 px-2 py-1.5 text-xs rounded-lg border transition-colors ${R===a.label?"bg-amber-600/20 text-amber-400 border-amber-500/30":"text-zinc-500 border-[#27282f] hover:text-zinc-300 hover:border-zinc-600"}`,children:a.label},a.label))}),e.jsx("div",{className:"flex gap-1.5",children:We.map(a=>e.jsx("button",{onClick:()=>I(a.label,a.hours),className:`flex-1 px-2 py-1.5 text-xs rounded-lg border transition-colors ${R===a.label?"bg-amber-600/20 text-amber-400 border-amber-500/30":"text-zinc-500 border-[#27282f] hover:text-zinc-300 hover:border-zinc-600"}`,children:a.label},a.label))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-zinc-500 mb-1.5 font-medium",children:"Or pick a date & time"}),e.jsx("input",{type:"datetime-local",value:g,min:O,onChange:a=>V(a.target.value),className:"w-full bg-[#0f1117] border border-[#27282f] rounded-lg px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:border-amber-500/50 [color-scheme:dark]"}),g&&e.jsxs("div",{className:"text-[11px] text-zinc-600 mt-1",children:[new Date(g).toLocaleString()," (in ",ae(new Date(g).toISOString()),")"]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-zinc-500 mb-2 font-medium",children:"Run every"}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5",children:re.map(a=>e.jsxs("button",{onClick:()=>b(a.key),className:`text-left px-3 py-2 rounded-lg border transition-colors ${p===a.key?"bg-amber-600/20 text-amber-400 border-amber-500/30":"text-zinc-400 border-[#27282f] hover:text-zinc-200 hover:border-zinc-600"}`,children:[e.jsx("div",{className:"text-xs font-medium",children:a.label}),e.jsx("div",{className:`text-[10px] mt-0.5 ${p===a.key?"text-amber-500/60":"text-zinc-600"}`,children:a.desc})]},a.key))})]}),p&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-zinc-500 mb-1.5 font-medium",children:le(p)?"Run at time":"Start at minute"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"time",value:k,onChange:a=>L(a.target.value),className:"bg-[#0f1117] border border-[#27282f] rounded-lg px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:border-amber-500/50 [color-scheme:dark]"}),e.jsx("span",{className:"text-[11px] text-zinc-600",children:le(p)?`Scans will run at ${k||"09:00"}`:`Scans will run at :${(k||"09:00").split(":")[1]??"00"} past the hour`})]})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs text-zinc-500 mb-1.5 font-medium",children:["Instructions ",e.jsx("span",{className:"text-zinc-600",children:"(optional)"})]}),e.jsx("textarea",{value:u,onChange:a=>h(a.target.value),placeholder:"E.g., Focus on architecture decisions and ignore trivial changes...",rows:2,className:"w-full bg-[#0f1117] border border-[#27282f] rounded-lg px-3 py-2.5 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:border-amber-500/50 resize-none"})]}),A&&e.jsx("div",{className:"text-xs text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:A}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsx("button",{onClick:()=>v?$(!1):r(),className:"flex-1 px-4 py-2 text-sm rounded-lg text-zinc-400 border border-[#27282f] hover:border-zinc-600 hover:text-zinc-300 transition-colors",children:v?"Back":"Cancel"}),e.jsx("button",{onClick:F,disabled:H||i.isPending,className:"flex-1 px-4 py-2 text-sm rounded-lg bg-amber-600 hover:bg-amber-500 text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed font-medium",children:i.isPending?"Saving...":v?"Update":x==="periodic"?"Start Periodic":"Schedule"})]})]}):null})]})})}function rt(){const t=je(),{data:r,isLoading:s}=ve(),{data:c}=ye(),{data:i}=ie(),o=r?.runs??[],[x,y]=l.useState(null),[g,j]=l.useState(!1),[u,h]=l.useState(null),[R,N]=l.useState([]),[p,S]=l.useState(!1),k=l.useRef(0),L=l.useRef(null),A=l.useRef(null),[d,v]=l.useState(null),[$,W]=l.useState([]),[w,T]=l.useState(!1),G=l.useRef(0),I=l.useRef(null),V=l.useRef(null),[b,F]=l.useState(null),[Q,K]=l.useState([]),[E,O]=l.useState(!1),H=l.useRef(0),U=l.useRef(null),a=l.useRef(null),m=l.useCallback(()=>{t.invalidateQueries({queryKey:X.runHistory}),t.invalidateQueries({queryKey:X.repos}),t.invalidateQueries({queryKey:X.repoScanHistory})},[t]);l.useEffect(()=>{te().then(n=>{h(n),n.running&&S(!0)}).catch(()=>{})},[]),l.useEffect(()=>(u?.running&&(L.current=setInterval(async()=>{try{const n=await te();h(n),n.running||m()}catch{}},2e3)),()=>{L.current&&clearInterval(L.current)}),[u?.running,m]),l.useEffect(()=>{if(u?.running||p){const n=async()=>{try{const f=await Se(k.current);f.lines.length>0&&(N(_=>[..._,...f.lines]),k.current=f.total)}catch{}};n(),A.current=setInterval(n,1e3)}return()=>{A.current&&clearInterval(A.current)}},[u?.running,p]);const J=async()=>{N([]),k.current=0,S(!0);try{await ke(),h({running:!0,phase:"Starting...",error:null,progress:null})}catch(n){console.error("Failed to start classification:",n)}},oe=async()=>{try{await we(),h(n=>n&&{...n,running:!1,phase:"Cancelled"})}catch(n){console.error("Failed to stop classification:",n)}};l.useEffect(()=>{se().then(n=>{v(n),n.running&&T(!0)}).catch(()=>{})},[]),l.useEffect(()=>(d?.running&&(I.current=setInterval(async()=>{try{const n=await se();v(n),n.running||m()}catch{}},2e3)),()=>{I.current&&clearInterval(I.current)}),[d?.running,m]),l.useEffect(()=>{if(d?.running||w){const n=async()=>{try{const f=await ze(G.current);f.lines.length>0&&(W(_=>[..._,...f.lines]),G.current=f.total)}catch{}};n(),V.current=setInterval(n,1e3)}return()=>{V.current&&clearInterval(V.current)}},[d?.running,w]);const de=async()=>{W([]),G.current=0,T(!0);try{const n=c?.repos?.filter(f=>f.selected).map(f=>f.name);await Ce({selectedRepoNames:n}),v({running:!0,phase:"Starting...",error:null,progress:null,results:[]})}catch(n){console.error("Failed to start skill generation:",n)}},xe=async()=>{try{await Re(),v(n=>n&&{...n,running:!1,phase:"Cancelled"})}catch(n){console.error("Failed to stop skill generation:",n)}};l.useEffect(()=>{ne().then(n=>{F(n),n.running&&O(!0)}).catch(()=>{})},[]),l.useEffect(()=>(b?.running&&(U.current=setInterval(async()=>{try{const n=await ne();F(n),n.running||m()}catch{}},2e3)),()=>{U.current&&clearInterval(U.current)}),[b?.running,m]),l.useEffect(()=>{if(b?.running||E){const n=async()=>{try{const f=await Le(H.current);f.lines.length>0&&(K(_=>[..._,...f.lines]),H.current=f.total)}catch{}};n(),a.current=setInterval(n,1e3)}return()=>{a.current&&clearInterval(a.current)}},[b?.running,E]);const ue=async()=>{K([]),H.current=0,O(!0);try{await $e(),F({running:!0,phase:"Starting...",startedAt:null,error:null,progress:null})}catch(n){console.error("Failed to start sync:",n)}},me=async()=>{try{await Ee(),F(n=>n&&{...n,running:!1,phase:"Cancelled"})}catch(n){console.error("Failed to stop sync:",n)}},z=u?.running??!1,D=d?.running??!1,M=b?.running??!1,he=p||w||E,pe=e.jsxs("div",{className:"max-w-6xl",children:[e.jsx("div",{className:"flex items-center justify-between mb-6",children:e.jsx("h2",{className:"text-2xl font-bold text-white",children:"Scans"})}),e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-4 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx(Ae,{mode:"config"}),e.jsx("div",{className:"w-px h-6 bg-[#27282f]"}),e.jsxs("button",{onClick:ue,disabled:M,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-blue-600/20 text-blue-400 border border-blue-500/30 hover:bg-blue-600/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[M&&e.jsx(P,{className:"w-3 h-3"}),M?"Syncing...":"Run Sync"]}),e.jsxs("button",{onClick:J,disabled:z,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-purple-600/20 text-purple-400 border border-purple-500/30 hover:bg-purple-600/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[z&&e.jsx(P,{className:"w-3 h-3"}),z?"Classifying...":"AI Classify"]}),e.jsxs("button",{onClick:de,disabled:D,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-emerald-600/20 text-emerald-400 border border-emerald-500/30 hover:bg-emerald-600/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[D&&e.jsx(P,{className:"w-3 h-3"}),D?"Generating...":"Generate Skills"]}),e.jsx("div",{className:"w-px h-6 bg-[#27282f]"}),e.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-amber-600/20 text-amber-400 border border-amber-500/30 hover:bg-amber-600/30 transition-colors",children:[e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),i?i.mode==="periodic"?"Periodic":"Scheduled":"Schedule Scan"]}),i&&e.jsx("span",{className:"px-2 py-1 text-[10px] rounded-full bg-amber-500/10 text-amber-400 border border-amber-500/20 cursor-pointer hover:bg-amber-500/20 transition-colors",onClick:()=>j(!0),title:i.mode==="periodic"?`Runs ${i.intervalLabel??`every ${i.interval}`}`:`Scheduled for ${new Date(i.scheduledAt).toLocaleString()}`,children:i.mode==="periodic"?i.intervalLabel??`Every ${i.interval}`:`in ${qe(i.scheduledAt)}`}),e.jsx("button",{onClick:async()=>{await Ne(),h(null),m()},disabled:z,className:"px-2.5 py-1.5 text-xs rounded-md text-zinc-500 hover:text-zinc-300 hover:bg-zinc-800 transition-colors disabled:opacity-50",title:"Reset AI classification cache",children:"Reset Cache"}),R.length>0&&!p&&e.jsx("button",{onClick:()=>S(!0),className:"px-2 py-1.5 text-xs rounded-md text-purple-500 hover:text-purple-300 hover:bg-zinc-800 transition-colors",children:"Classify Log"}),$.length>0&&!w&&e.jsx("button",{onClick:()=>T(!0),className:"px-2 py-1.5 text-xs rounded-md text-emerald-500 hover:text-emerald-300 hover:bg-zinc-800 transition-colors",children:"Skills Log"}),Q.length>0&&!E&&e.jsx("button",{onClick:()=>O(!0),className:"px-2 py-1.5 text-xs rounded-md text-blue-500 hover:text-blue-300 hover:bg-zinc-800 transition-colors",children:"Sync Log"})]}),(z||D||M)&&e.jsxs("div",{className:"flex items-center gap-4 mt-3 pt-3 border-t border-[#27282f]",children:[M&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-blue-400",children:[e.jsx(P,{className:"w-3 h-3"}),"Sync: ",b?.phase??"Running..."]}),z&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-purple-400",children:[e.jsx(P,{className:"w-3 h-3"}),"Classify: ",u?.phase??"Running..."]}),D&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[e.jsx(P,{className:"w-3 h-3"}),"Skills: ",d?.phase??"Running..."]})]})]}),e.jsx(Ve,{}),e.jsx("h3",{className:"text-sm font-medium text-zinc-400 mb-3",children:"Run History"}),s?e.jsx("div",{className:"text-zinc-500 py-8 text-center",children:"Loading..."}):o.length===0?e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl p-8 text-center text-zinc-500",children:["No scans recorded yet. Run ",e.jsx("code",{className:"text-blue-400",children:"lore sync"})," or click ",e.jsx("strong",{children:"Run Sync"})," above."]}):e.jsx("div",{className:"space-y-2",children:o.map(n=>e.jsx(Qe,{run:n,expanded:x===n.id,onToggle:()=>y(x===n.id?null:n.id)},n.id))})]}),fe=e.jsxs("div",{className:"space-y-3",children:[E&&e.jsxs("div",{children:[e.jsx(Z,{title:"lore sync",lines:Q,running:M,error:b?.error??null,phase:b?.phase??"",progress:b?.progress??null,onClose:()=>O(!1),onStop:me,accent:"blue"}),!M&&b?.error&&e.jsxs("div",{className:"mt-2 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:[e.jsx("div",{className:"text-xs text-red-300 font-medium",children:"Sync failed"}),e.jsx("div",{className:"text-[11px] text-red-400/70 mt-0.5 font-mono",children:b.error})]})]}),p&&e.jsxs("div",{children:[e.jsx(Z,{title:"lore classify",lines:R,running:z,error:u?.error??null,phase:u?.phase??"",progress:u?.progress??null,onClose:()=>S(!1),onStop:oe,accent:"purple"}),!z&&u?.error&&e.jsxs("div",{className:"mt-2 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:[e.jsx("div",{className:"text-xs text-red-300 font-medium",children:"Classification failed"}),e.jsx("div",{className:"text-[11px] text-red-400/70 mt-0.5 font-mono",children:u.error})]})]}),w&&e.jsxs("div",{children:[e.jsx(Z,{title:"lore skills",lines:$,running:D,error:d?.error??null,phase:d?.phase??"",progress:d?.progress??null,onClose:()=>T(!1),onStop:xe,accent:"emerald"}),!D&&d?.error&&e.jsxs("div",{className:"mt-2 bg-red-500/10 border border-red-500/20 rounded-lg px-3 py-2",children:[e.jsx("div",{className:"text-xs text-red-300 font-medium",children:"Skill generation failed"}),e.jsx("div",{className:"text-[11px] text-red-400/70 mt-0.5 font-mono",children:d.error})]})]})]});return e.jsxs(e.Fragment,{children:[e.jsx(Ge,{open:g,onClose:()=>j(!1)}),e.jsx(Pe,{left:pe,right:fe,rightVisible:he,initialRightWidth:420,minRightWidth:280,maxRightWidth:700,minLeftWidth:400})]})}function Ve(){const{data:t,isLoading:r}=De(),s=t?.repos??[],[c,i]=l.useState(null);return r?e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-zinc-400 mb-3",children:"Repo Scans"}),e.jsx("div",{className:"text-zinc-500 py-4 text-center text-xs",children:"Loading..."})]}):s.length===0?null:e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-zinc-400 mb-3",children:"Repo Scans"}),e.jsx("div",{className:"space-y-2",children:s.map(o=>e.jsx(He,{repo:o,expanded:c===o.repo,onToggle:()=>i(c===o.repo?null:o.repo)},o.repo))})]})}function He({repo:t,expanded:r,onToggle:s}){const c=t.repo.includes("/")?t.repo.split("/").pop():t.repo,i={generated:"text-green-400 bg-green-500/10",updated:"text-blue-400 bg-blue-500/10",skipped:"text-zinc-400 bg-zinc-500/10",failed:"text-red-400 bg-red-500/10"};return e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl overflow-hidden",children:[e.jsxs("button",{onClick:s,className:"w-full text-left px-4 py-3 flex items-center gap-3 hover:bg-[#1e1f2a] transition-colors",children:[e.jsx("svg",{className:`w-3.5 h-3.5 text-zinc-500 flex-shrink-0 transition-transform ${r?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),e.jsx("span",{className:"text-zinc-200 text-sm font-medium min-w-[120px]",children:c}),t.lastScanAt?e.jsx("span",{className:"text-zinc-500 text-xs min-w-[80px]",children:B(t.lastScanAt)}):e.jsx("span",{className:"text-zinc-600 text-xs min-w-[80px]",children:"never"}),t.lastScanStatus&&e.jsx(ce,{status:t.lastScanStatus}),t.totalScans>0&&e.jsxs("span",{className:"text-zinc-500 text-xs tabular-nums",children:[t.totalScans," scan",t.totalScans!==1?"s":""]}),t.summariesCount>0&&e.jsxs("span",{className:"bg-purple-500/10 text-purple-400 text-xs px-2 py-0.5 rounded-full",children:[t.summariesCount," summar",t.summariesCount!==1?"ies":"y"]}),t.lastSkillStatus&&e.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${i[t.lastSkillStatus]??i.skipped}`,children:t.lastSkillStatus}),t.lastScanErrors.length>0&&e.jsxs("span",{className:"bg-red-500/10 text-red-400 text-xs px-2 py-0.5 rounded-full",children:[t.lastScanErrors.length," error",t.lastScanErrors.length!==1?"s":""]})]}),r&&e.jsx(Ue,{repo:t})]})}function Ue({repo:t}){return e.jsxs("div",{className:"border-t border-[#27282f] px-4 py-4 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[e.jsx(C,{label:"Last Scan",value:t.lastScanAt?new Date(t.lastScanAt).toLocaleString():"--"}),e.jsx(C,{label:"Duration",value:t.lastScanDuration?Y(t.lastScanDuration):"--"}),e.jsx(C,{label:"Items Scanned",value:String(t.lastScanItemsScanned)}),e.jsx(C,{label:"Total Scans",value:String(t.totalScans)}),e.jsx(C,{label:"Summaries",value:String(t.summariesCount)}),e.jsx(C,{label:"Last Summary",value:t.lastSummaryAt?B(t.lastSummaryAt):"--"}),e.jsx(C,{label:"Last Skill Gen",value:t.lastSkillGenAt?B(t.lastSkillGenAt):"--"}),e.jsx(C,{label:"Last Cluster",value:t.lastClusterAt?B(t.lastClusterAt):"--"})]}),t.repoPath&&e.jsx("div",{className:"text-xs text-zinc-600 font-mono truncate",children:t.repoPath}),t.lastScanErrors.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs uppercase tracking-wider text-red-400 mb-1.5",children:"Last Scan Errors"}),e.jsx("div",{className:"bg-red-500/5 border border-red-500/20 rounded-lg p-2.5 space-y-1",children:t.lastScanErrors.map((r,s)=>e.jsx("div",{className:"text-xs text-red-300 font-mono break-all",children:r},s))})]}),t.recentScans.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs uppercase tracking-wider text-zinc-500 mb-2",children:"Recent Scans"}),e.jsx("div",{className:"bg-[#0f1117] rounded-lg border border-[#27282f] overflow-hidden",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[#27282f] text-zinc-500 uppercase tracking-wider",children:[e.jsx("th",{className:"text-left px-3 py-1.5",children:"When"}),e.jsx("th",{className:"text-left px-3 py-1.5",children:"Status"}),e.jsx("th",{className:"text-left px-3 py-1.5",children:"Skill"}),e.jsx("th",{className:"text-left px-3 py-1.5",children:"Reason"})]})}),e.jsx("tbody",{children:t.recentScans.map((r,s)=>e.jsx(_e,{scan:r},s))})]})})]})]})}function C({label:t,value:r}){return e.jsxs("div",{className:"bg-[#0f1117] border border-[#27282f] rounded-lg px-3 py-2",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-600 mb-0.5",children:t}),e.jsx("div",{className:"text-sm text-zinc-300 tabular-nums",children:r})]})}function _e({scan:t}){const r={generated:"text-green-400 bg-green-500/10",updated:"text-blue-400 bg-blue-500/10",skipped:"text-zinc-400 bg-zinc-500/10",failed:"text-red-400 bg-red-500/10"},s=r[t.skillStatus]??r.skipped;return e.jsxs("tr",{className:"border-b border-[#27282f] last:border-b-0 hover:bg-[#1e1f2a]",children:[e.jsx("td",{className:"px-3 py-1.5 text-zinc-400",children:t.timestamp?B(t.timestamp):"--"}),e.jsx("td",{className:"px-3 py-1.5",children:e.jsx(ce,{status:t.status})}),e.jsx("td",{className:"px-3 py-1.5",children:e.jsx("span",{className:`px-1.5 py-0.5 rounded ${s}`,children:t.skillStatus})}),e.jsx("td",{className:"px-3 py-1.5 text-zinc-500 max-w-[200px]",children:e.jsx(q,{content:t.reason,className:"truncate",children:t.reason})})]})}function ce({status:t}){return t==="completed"?e.jsx("span",{className:"flex items-center gap-1 text-xs text-green-400",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):e.jsx("span",{className:"flex items-center gap-1 text-xs text-red-400",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})}function qe(t){const r=new Date(t).getTime()-Date.now();if(r<=0)return"any moment";const s=Math.floor(r/6e4);if(s<60)return`${s}m`;const c=Math.floor(s/60);return c<24?`${c}h ${s%60}m`:`${Math.floor(c/24)}d ${c%24}h`}function Qe({run:t,expanded:r,onToggle:s}){const c=(t.repos??[]).filter(x=>x.skillStatus==="generated"||x.skillStatus==="updated").length,i=(t.errors??[]).length,o=t.duration?Y(t.duration):"--";return e.jsxs("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl overflow-hidden",children:[e.jsxs("button",{onClick:s,className:"w-full text-left px-4 py-3 flex items-center gap-4 hover:bg-[#1e1f2a] transition-colors",children:[e.jsx("svg",{className:`w-4 h-4 text-zinc-500 transition-transform ${r?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),e.jsx(Xe,{status:t.status}),e.jsx("span",{className:"text-zinc-300 text-sm min-w-[100px]",children:t.timestamp?B(t.timestamp):"--"}),e.jsx(q,{content:t.summary??"",className:"text-zinc-400 text-sm flex-1 truncate",children:t.summary}),e.jsx("span",{className:"text-zinc-500 text-xs tabular-nums",children:o}),e.jsxs("span",{className:"text-zinc-500 text-xs min-w-[80px] text-right",children:[t.itemsScanned," items"]}),c>0&&e.jsxs("span",{className:"bg-blue-500/10 text-blue-400 text-xs px-2 py-0.5 rounded-full",children:[c," repo",c!==1?"s":""]}),i>0&&e.jsxs("span",{className:"bg-red-500/10 text-red-400 text-xs px-2 py-0.5 rounded-full",children:[i," error",i!==1?"s":""]}),t.dryRun&&e.jsx("span",{className:"bg-yellow-500/10 text-yellow-400 text-xs px-2 py-0.5 rounded-full",children:"dry run"}),e.jsx(Me,{to:`/scans/${t.id}`,onClick:x=>x.stopPropagation(),className:"text-blue-400 hover:text-blue-300 text-xs px-2 py-0.5 rounded hover:bg-blue-500/10 transition-colors flex-shrink-0",children:"Details โ"})]}),r&&e.jsx(Ke,{run:t})]})}function Ke({run:t}){const r=t.phases??[],s=t.repos??[],c=t.errors??[];return e.jsxs("div",{className:"border-t border-[#27282f] px-4 py-4 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-4 text-xs text-zinc-500",children:[e.jsx("span",{children:t.timestamp?new Date(t.timestamp).toLocaleString():"--"}),t.duration>0&&e.jsxs("span",{children:["Duration: ",Y(t.duration)]}),t.prompt&&e.jsxs(q,{content:t.prompt,className:"text-zinc-400 italic truncate max-w-xs",children:["Prompt: โ",t.prompt,"โ"]})]}),r.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs uppercase tracking-wider text-zinc-500 mb-2",children:"Phases"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2",children:r.map((i,o)=>e.jsx(Ye,{phase:i},o))})]}),s.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-xs uppercase tracking-wider text-zinc-500 mb-2",children:["Repos (",s.length,")"]}),e.jsx("div",{className:"bg-[#0f1117] rounded-lg border border-[#27282f] overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[#27282f] text-zinc-500 text-xs uppercase tracking-wider",children:[e.jsx("th",{className:"text-left px-3 py-2",children:"Repo"}),e.jsx("th",{className:"text-left px-3 py-2",children:"Status"}),e.jsx("th",{className:"text-left px-3 py-2",children:"Reason"}),e.jsx("th",{className:"text-left px-3 py-2",children:"Tools"}),e.jsx("th",{className:"text-right px-3 py-2",children:"Actions"})]})}),e.jsx("tbody",{children:s.map((i,o)=>e.jsx(Je,{repo:i},o))})]})})]}),c.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-xs uppercase tracking-wider text-red-400 mb-2",children:["Errors (",c.length,")"]}),e.jsx("div",{className:"bg-red-500/5 border border-red-500/20 rounded-lg p-3 space-y-1.5",children:c.map((i,o)=>e.jsx("div",{className:"text-xs text-red-300 font-mono break-all",children:i},o))})]})]})}function Ye({phase:t}){const r={completed:"text-green-400 bg-green-500/10",failed:"text-red-400 bg-red-500/10",skipped:"text-zinc-400 bg-zinc-500/10"}[t.status];return e.jsxs("div",{className:"bg-[#0f1117] border border-[#27282f] rounded-lg px-3 py-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-zinc-300 text-sm font-medium capitalize",children:t.name}),e.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${r}`,children:t.status})]}),e.jsxs("div",{className:"text-xs text-zinc-500",children:[t.detail,t.duration>0&&e.jsxs("span",{className:"ml-2 text-zinc-600",children:["(",Y(t.duration),")"]})]})]})}function Je({repo:t}){const r={generated:"text-green-400 bg-green-500/10",updated:"text-blue-400 bg-blue-500/10",skipped:"text-zinc-400 bg-zinc-500/10",failed:"text-red-400 bg-red-500/10"},s=r[t.skillStatus]??r.skipped,c=()=>{if(t.skillPath)window.open(`vscode://file/${t.skillPath}`,"_blank");else if(t.repoPath){const x=`${t.repoPath}/.cursor/skills`;window.open(`vscode://file/${x}`,"_blank")}},i=()=>{const x=t.skillPath||`${t.repoPath}/.cursor/skills`;navigator.clipboard.writeText(x).catch(()=>{})},o=t.repo.includes("/")?t.repo.split("/").pop():t.repo;return e.jsxs("tr",{className:"border-b border-[#27282f] last:border-b-0 hover:bg-[#1e1f2a]",children:[e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("div",{className:"text-zinc-200 font-medium text-sm",children:o}),e.jsx(q,{content:t.repoPath,className:"text-zinc-600 text-xs font-mono truncate max-w-[200px]",position:"bottom",children:t.repoPath})]}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${s}`,children:t.skillStatus})}),e.jsx("td",{className:"px-3 py-2 text-zinc-400 text-xs max-w-[180px]",children:e.jsx(q,{content:t.reason??"",className:"truncate",children:t.reason})}),e.jsx("td",{className:"px-3 py-2",children:t.toolsUsed.length>0?e.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.toolsUsed.slice(0,3).map((x,y)=>e.jsx("span",{className:"text-xs bg-[#27282f] text-zinc-400 px-1.5 py-0.5 rounded",children:x},y)),t.toolsUsed.length>3&&e.jsxs("span",{className:"text-xs text-zinc-500",children:["+",t.toolsUsed.length-3]})]}):e.jsx("span",{className:"text-zinc-600 text-xs",children:"--"})}),e.jsx("td",{className:"px-3 py-2 text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx("button",{onClick:c,className:"text-xs bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 px-2.5 py-1 rounded transition-colors",title:"Open in Cursor",children:"Open"}),e.jsx("button",{onClick:i,className:"text-xs bg-[#27282f] text-zinc-400 hover:bg-[#32333b] px-2 py-1 rounded transition-colors",title:"Copy path",children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",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"})})})]})})]})}function Xe({status:t}){return t==="completed"?e.jsx("span",{className:"flex items-center gap-1 text-xs text-green-400",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):e.jsx("span",{className:"flex items-center gap-1 text-xs text-red-400",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})}function Y(t){if(!t||t<=0)return"--";const r=Math.floor(t/1e3);if(r<60)return`${r}s`;const s=Math.floor(r/60),c=r%60;if(s<60)return`${s}m ${c}s`;const i=Math.floor(s/60),o=s%60;return`${i}h ${o}m`}export{rt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./markdown-CZuQZQX5.js";import{T as r,t as x}from"./Overview-B_jOY8il.js";import{f as i}from"./index-CVSL0ryk.js";function o(){const{data:l,isLoading:a}=i(),s=l?.skills??[];return a?t.jsx("div",{className:"text-zinc-500 py-8 text-center",children:"Loading..."}):t.jsxs("div",{className:"max-w-6xl",children:[t.jsx("h2",{className:"text-2xl font-bold text-white mb-6",children:"Skills"}),t.jsx("div",{className:"bg-[#16171f] border border-[#27282f] rounded-xl overflow-hidden",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-[#27282f] text-zinc-500 text-xs uppercase tracking-wider",children:[t.jsx("th",{className:"text-left px-4 py-2.5",children:"Skill"}),t.jsx("th",{className:"text-left px-4 py-2.5",children:"Path"}),t.jsx("th",{className:"text-right px-4 py-2.5",children:"Usage Count"}),t.jsx("th",{className:"text-right px-4 py-2.5",children:"Last Used"})]})}),t.jsxs("tbody",{children:[s.map(e=>t.jsxs("tr",{className:"border-b border-[#27282f] last:border-b-0 hover:bg-[#1e1f2a]",children:[t.jsx("td",{className:"px-4 py-2.5 text-zinc-200 font-medium",children:e.name}),t.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-mono text-xs max-w-xs",children:t.jsx(r,{content:e.path,className:"truncate",position:"bottom",children:e.path})}),t.jsx("td",{className:"px-4 py-2.5 text-right text-zinc-400",children:e.count}),t.jsx("td",{className:"px-4 py-2.5 text-right text-zinc-500 text-xs",children:e.lastUsed?x(e.lastUsed):"โ"})]},e.name)),s.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:4,className:"px-4 py-8 text-center text-zinc-500",children:"No skills detected."})})]})]})})]})}export{o as default};
|