@mcp-graph-workflow/mcp-graph 5.15.0 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/routes/code-graph.d.ts.map +1 -1
- package/dist/api/routes/code-graph.js +2 -1
- package/dist/api/routes/code-graph.js.map +1 -1
- package/dist/core/lsp/lsp-bridge.d.ts.map +1 -1
- package/dist/core/lsp/lsp-bridge.js +6 -0
- package/dist/core/lsp/lsp-bridge.js.map +1 -1
- package/dist/web/dashboard/dist/assets/{benchmark-tab-B1A0SasV.js → benchmark-tab-LbjYcnjd.js} +1 -1
- package/dist/web/dashboard/dist/assets/{context-tab-DUkoXaRk.js → context-tab-u_l0XUXT.js} +1 -1
- package/dist/web/dashboard/dist/assets/{gitnexus-tab-CRQq2LPk.js → gitnexus-tab-K304jKR3.js} +1 -1
- package/dist/web/dashboard/dist/assets/{graph-section-B3yPYErO.js → graph-section-3_2LPo7V.js} +1 -1
- package/dist/web/dashboard/dist/assets/{graph-tab-C6EW5fp0.js → graph-tab-KG6GQq1a.js} +1 -1
- package/dist/web/dashboard/dist/assets/{graph-utils-BYuSG24r.js → graph-utils-cpyaBhnE.js} +1 -1
- package/dist/web/dashboard/dist/assets/{index-bRmGsVKn.css → index-C1UckjqB.css} +1 -1
- package/dist/web/dashboard/dist/assets/{index-Cs6DRCJ0.js → index-Clwhz2ad.js} +1 -1
- package/dist/web/dashboard/dist/assets/{index-C_1iski-.js → index-Co7yktBf.js} +2 -2
- package/dist/web/dashboard/dist/assets/{index-BWMXofAC.js → index-DY9euqve.js} +1 -1
- package/dist/web/dashboard/dist/assets/{insights-tab-B_dx9SpZ.js → insights-tab-yrnRR8CL.js} +1 -1
- package/dist/web/dashboard/dist/assets/{journey-tab-CO7oVMz6.js → journey-tab-Cfh-qkYk.js} +1 -1
- package/dist/web/dashboard/dist/assets/{logs-tab-DOBGn4V2.js → logs-tab-B-8O6WzQ.js} +1 -1
- package/dist/web/dashboard/dist/assets/lsp-tab-CBM8pixC.js +74 -0
- package/dist/web/dashboard/dist/assets/{memories-tab-DpIssCFl.js → memories-tab-5t0pfAsS.js} +1 -1
- package/dist/web/dashboard/dist/assets/{prd-backlog-tab-T6zNUi5_.js → prd-backlog-tab-Bgt2qin9.js} +1 -1
- package/dist/web/dashboard/dist/assets/{siebel-tab-B0pcpfzn.js → siebel-tab-CjYyszVw.js} +3 -3
- package/dist/web/dashboard/dist/assets/{skills-tab-DiqEcBjJ.js → skills-tab-D-6Tem1J.js} +1 -1
- package/dist/web/dashboard/dist/assets/{style-gKCWR_EQ.js → style-Ci_RUKMJ.js} +1 -1
- package/dist/web/dashboard/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/dashboard/dist/assets/lsp-tab-BNDlSPfa.js +0 -69
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import{c as j,r as c,a as M,j as e,C as q}from"./index-C_1iski-.js";/**
|
|
2
|
-
* @license lucide-react v1.7.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Z=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ee=j("chevron-down",Z);/**
|
|
7
|
-
* @license lucide-react v1.7.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const te=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],se=j("chevron-right",te);/**
|
|
12
|
-
* @license lucide-react v1.7.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const ae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ne=j("circle-alert",ae);/**
|
|
17
|
-
* @license lucide-react v1.7.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const ce=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],re=j("circle",ce);/**
|
|
22
|
-
* @license lucide-react v1.7.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const le=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],P=j("file-code",le);/**
|
|
27
|
-
* @license lucide-react v1.7.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const ie=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],oe=j("file-text",ie);/**
|
|
32
|
-
* @license lucide-react v1.7.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const de=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],B=j("info",de);/**
|
|
37
|
-
* @license lucide-react v1.7.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const xe=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],ue=j("lightbulb",xe);/**
|
|
42
|
-
* @license lucide-react v1.7.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const me=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],z=j("list",me);/**
|
|
47
|
-
* @license lucide-react v1.7.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const he=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],R=j("refresh-cw",he);/**
|
|
52
|
-
* @license lucide-react v1.7.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const pe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],H=j("search",pe);/**
|
|
57
|
-
* @license lucide-react v1.7.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const fe=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],O=j("server",fe);/**
|
|
62
|
-
* @license lucide-react v1.7.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const ge=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],F=j("triangle-alert",ge),K=300*1e3;function be(){const t=new Map;return{get(s){const a=t.get(s);if(a){if(Date.now()-a.timestamp>K){t.delete(s);return}return a.data}},set(s,a){if(t.set(s,{data:a,timestamp:Date.now()}),t.size>200){const n=Date.now();for(const[i,d]of t)n-d.timestamp>K&&t.delete(i)}}}}function ye(){const[t,s]=c.useState(null),[a,n]=c.useState(null),[i,d]=c.useState(!0),[u,r]=c.useState(null),[w,o]=c.useState([]),[L,_]=c.useState(null),[E,N]=c.useState(null),[v,p]=c.useState([]),[k,D]=c.useState([]),[C,m]=c.useState(!1),h=c.useRef(be()).current,T=c.useCallback(async()=>{try{const l=await M.getLspLanguages();s(l)}catch(l){r(l instanceof Error?l.message:"Failed to load LSP languages")}},[]),A=c.useCallback(async()=>{try{const l=await M.getLspStatus();n(l)}catch{n({ok:!0,bridgeInitialized:!1,servers:{}})}},[]),I=c.useCallback(async()=>{d(!0),r(null),await Promise.all([T(),A()]),d(!1)},[T,A]);c.useEffect(()=>{I()},[I]);const W=c.useCallback(async(l,f,g)=>{const x=`def:${l}:${f}:${g}`,b=h.get(x);if(b){o(b);return}m(!0);try{const $=(await M.lspDefinition(l,f,g)).definitions??[];h.set(x,$),o($)}catch(y){r(y instanceof Error?y.message:"Definition lookup failed")}finally{m(!1)}},[h]),Y=c.useCallback(async(l,f,g)=>{const x=`refs:${l}:${f}:${g}`,b=h.get(x);if(b){_(b);return}m(!0);try{const y=await M.lspReferences(l,f,g),$={total:y.totalReferences??0,refs:y.references??[],byFile:y.byFile??{}};h.set(x,$),_($)}catch(y){r(y instanceof Error?y.message:"References lookup failed")}finally{m(!1)}},[h]),J=c.useCallback(async(l,f,g)=>{const x=`hover:${l}:${f}:${g}`,b=h.get(x);if(b!==void 0){N(b);return}m(!0);try{const $=(await M.lspHover(l,f,g)).hover??null;h.set(x,$),N($)}catch(y){r(y instanceof Error?y.message:"Hover lookup failed")}finally{m(!1)}},[h]),Q=c.useCallback(async l=>{const f=`diag:${l}`,g=h.get(f);if(g){p(g);return}m(!0);try{const b=(await M.lspDiagnostics(l)).diagnostics??[];h.set(f,b),p(b)}catch(x){r(x instanceof Error?x.message:"Diagnostics lookup failed")}finally{m(!1)}},[h]),X=c.useCallback(async l=>{const f=`sym:${l}`,g=h.get(f);if(g){D(g);return}m(!0);try{const b=(await M.lspSymbols(l)).symbols??[];h.set(f,b),D(b)}catch(x){r(x instanceof Error?x.message:"Symbols lookup failed")}finally{m(!1)}},[h]);return{languages:t,status:a,loading:i,error:u,operationLoading:C,definitions:w,references:L,hover:E,diagnostics:v,symbols:k,refresh:I,goToDefinition:W,findReferences:Y,getHover:J,getDiagnostics:Q,getSymbols:X}}const je=[{id:"status",label:"Status",icon:O},{id:"explorer",label:"Symbol Explorer",icon:H},{id:"diagnostics",label:"Diagnostics",icon:F},{id:"symbols",label:"Symbols",icon:z}],V={1:{icon:ne,color:"text-danger",label:"Error"},2:{icon:F,color:"text-warning",label:"Warning"},3:{icon:B,color:"text-accent",label:"Info"},4:{icon:ue,color:"text-muted",label:"Hint"}};function Ne({status:t}){const s={ready:{bg:"bg-success/15",text:"text-success"},starting:{bg:"bg-warning/15",text:"text-warning"},stopped:{bg:"bg-muted/15",text:"text-muted"},error:{bg:"bg-danger/15",text:"text-danger"}},a=t??"not installed",n=s[a]??{bg:"bg-muted/10",text:"text-muted",border:"border-dashed"};return e.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] font-medium px-2 py-0.5 rounded-full ${n.bg} ${n.text} ${n.border??""} border border-current/20`,children:[e.jsx(re,{className:"w-2 h-2 fill-current"}),a]})}function ve({lang:t,serverStatus:s}){const a=Math.round(t.confidence*100);return e.jsxs("div",{className:"p-4 rounded-xl border border-edge bg-surface-alt shadow-sm hover:shadow-md transition-shadow space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"w-4 h-4 text-accent"}),e.jsx("span",{className:"text-sm font-semibold capitalize",children:t.languageId})]}),e.jsxs("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-accent/10 text-accent",children:[t.fileCount," files"]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted",children:[e.jsx("span",{children:"Confidence"}),e.jsxs("span",{children:[a,"%"]})]}),e.jsx("div",{className:"h-1 rounded-full bg-edge overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-300",style:{width:`${a}%`}})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-muted",children:"Server"}),e.jsx(Ne,{status:s})]}),e.jsxs("div",{className:"text-[10px] text-muted",children:["Detected via: ",e.jsx("span",{className:"text-foreground",children:t.detectedVia})]}),t.serverCommand&&e.jsxs("div",{className:"text-[10px] text-muted truncate",title:t.serverCommand,children:["Command: ",e.jsx("code",{className:"text-foreground font-mono",children:t.serverCommand})]}),t.configFile&&e.jsxs("div",{className:"text-[10px] text-muted truncate",title:t.configFile,children:["Config: ",e.jsx("code",{className:"text-foreground font-mono",children:t.configFile})]})]})}function we({hover:t}){return e.jsxs("div",{className:"p-4 rounded-xl border border-edge bg-surface-alt space-y-2",children:[e.jsx("h4",{className:"text-xs font-semibold text-muted uppercase tracking-wider",children:"Hover Info"}),t.signature?e.jsx("pre",{className:"text-sm font-mono bg-surface p-3 rounded-lg overflow-x-auto border border-edge whitespace-pre-wrap",children:t.signature}):e.jsx("p",{className:"text-sm text-muted",children:"No signature available"}),t.documentation&&e.jsx("div",{className:"text-xs text-muted whitespace-pre-wrap",children:t.documentation}),t.language&&e.jsxs("span",{className:"text-[10px] text-muted",children:["Language: ",t.language]})]})}function U({title:t,locations:s}){return e.jsxs("div",{className:"p-4 rounded-xl border border-edge bg-surface-alt space-y-2",children:[e.jsxs("h4",{className:"text-xs font-semibold text-muted uppercase tracking-wider",children:[t," (",s.length,")"]}),s.length===0?e.jsx("p",{className:"text-sm text-muted",children:"No results found"}):e.jsx("ul",{className:"space-y-1",children:s.map((a,n)=>e.jsxs("li",{className:"flex items-center gap-2 text-xs py-1.5 px-2 rounded-lg hover:bg-surface-elevated transition-colors",children:[e.jsx(oe,{className:"w-3 h-3 text-muted flex-shrink-0"}),e.jsx("span",{className:"font-mono text-foreground truncate",title:a.file,children:a.file}),e.jsxs("span",{className:"text-muted flex-shrink-0",children:[":",a.startLine,":",a.startCharacter]}),a.hint&&e.jsx("span",{className:"text-accent text-[10px] ml-auto truncate",children:a.hint})]},`${a.file}-${a.startLine}-${a.startCharacter}-${n}`))})]})}function ke({references:t}){const s=Object.entries(t.byFile).sort(([,a],[,n])=>n-a);return e.jsxs("div",{className:"space-y-3",children:[e.jsx(U,{title:"References",locations:t.refs}),s.length>0&&e.jsxs("div",{className:"p-4 rounded-xl border border-edge bg-surface-alt space-y-2",children:[e.jsxs("h4",{className:"text-xs font-semibold text-muted uppercase tracking-wider",children:["By File (",t.total," total)"]}),e.jsx("ul",{className:"space-y-1",children:s.map(([a,n])=>e.jsxs("li",{className:"flex items-center justify-between text-xs py-1 px-2 rounded-lg hover:bg-surface-elevated transition-colors",children:[e.jsx("span",{className:"font-mono truncate text-foreground",title:a,children:a}),e.jsx("span",{className:"text-muted flex-shrink-0 ml-2",children:n})]},a))})]})]})}function Ce({diagnostic:t}){const s=V[t.severity]??V[3],a=s.icon;return e.jsxs("div",{className:"flex items-start gap-3 py-2.5 px-3 rounded-lg border border-edge bg-surface-alt hover:shadow-sm transition-shadow",children:[e.jsx(a,{className:`w-4 h-4 flex-shrink-0 mt-0.5 ${s.color}`}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"text-xs font-mono text-muted",children:[t.file,":",t.startLine,":",t.startCharacter]}),t.source&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-surface-elevated text-muted border border-edge",children:t.source}),t.code&&e.jsxs("span",{className:"text-[10px] font-mono text-muted",children:["[",t.code,"]"]})]}),e.jsx("p",{className:"text-sm text-foreground",children:t.message})]}),e.jsx("span",{className:`text-[10px] font-medium flex-shrink-0 ${s.color}`,children:s.label})]})}const Se={Function:"bg-accent/15 text-accent",Method:"bg-accent/15 text-accent",Class:"bg-warning/15 text-warning",Interface:"bg-success/15 text-success",Enum:"bg-danger/15 text-danger",Variable:"bg-muted/15 text-muted",Property:"bg-muted/15 text-muted",Constant:"bg-success/15 text-success",Module:"bg-warning/15 text-warning",Namespace:"bg-warning/15 text-warning"};function G({symbol:t,depth:s}){const[a,n]=c.useState(s<2),i=t.children&&t.children.length>0,d=Se[t.kind]??"bg-muted/10 text-muted";return e.jsxs("div",{children:[e.jsxs("button",{type:"button",onClick:()=>i&&n(!a),className:`flex items-center gap-2 w-full text-left py-1.5 px-2 rounded-lg hover:bg-surface-elevated transition-colors text-xs ${i?"cursor-pointer":"cursor-default"}`,style:{paddingLeft:`${s*16+8}px`},children:[i?a?e.jsx(ee,{className:"w-3 h-3 text-muted flex-shrink-0"}):e.jsx(se,{className:"w-3 h-3 text-muted flex-shrink-0"}):e.jsx("span",{className:"w-3 flex-shrink-0"}),e.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${d} flex-shrink-0`,children:t.kind}),e.jsx("span",{className:"font-mono text-foreground truncate",children:t.name}),e.jsxs("span",{className:"text-muted ml-auto flex-shrink-0",children:[t.startLine,"-",t.endLine]})]}),a&&i&&t.children.map((u,r)=>e.jsx(G,{symbol:u,depth:s+1},`${u.name}-${u.startLine}-${r}`))]})}function $e({symbols:t}){return t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted",children:[e.jsx(q,{className:"w-8 h-8 mb-2 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No symbols found for this file"})]}):e.jsx("div",{className:"rounded-xl border border-edge bg-surface-alt overflow-hidden divide-y divide-edge",children:t.map((s,a)=>e.jsx(G,{symbol:s,depth:0},`${s.name}-${s.startLine}-${a}`))})}function Le({languages:t,status:s}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 pt-4",children:[e.jsx(O,{className:"w-4 h-4 text-muted"}),e.jsx("span",{className:"text-xs text-muted",children:"Bridge:"}),e.jsx("span",{className:`text-xs font-medium ${s!=null&&s.bridgeInitialized?"text-success":"text-warning"}`,children:s!=null&&s.bridgeInitialized?"Initialized":"Not initialized"})]}),t.detected.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted",children:[e.jsx(P,{className:"w-10 h-10 mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No languages detected in this project"}),e.jsx("p",{className:"text-xs mt-1",children:"The LSP bridge will detect languages from project configuration files"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 p-4",children:t.detected.map(a=>e.jsx(ve,{lang:a,serverStatus:s==null?void 0:s.servers[a.languageId]},a.languageId))}),t.supportedLanguages.length>0&&e.jsxs("div",{className:"px-4 py-2 text-xs text-muted border-t border-edge",children:["Supported: ",t.supportedLanguages.join(", ")]})]})}function _e({goToDefinition:t,findReferences:s,getHover:a,operationLoading:n,definitions:i,references:d,hover:u}){const[r,w]=c.useState(""),[o,L]=c.useState(""),[_,E]=c.useState(""),N=parseInt(o,10)||0,v=parseInt(_,10)||0,p=r.trim().length>0&&N>0,k=c.useCallback(()=>{p&&t(r.trim(),N,v)},[r,N,v,p,t]),D=c.useCallback(()=>{p&&s(r.trim(),N,v)},[r,N,v,p,s]),C=c.useCallback(()=>{p&&a(r.trim(),N,v)},[r,N,v,p,a]),m=u!==null||i.length>0||d!==null;return e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx("input",{placeholder:"File path (e.g. src/main.ts)",value:r,onChange:S=>w(S.target.value),className:"flex-1 min-w-[200px] px-3 py-2 text-sm border border-edge rounded-lg bg-surface font-mono focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx("input",{placeholder:"Line",type:"number",min:1,value:o,onChange:S=>L(S.target.value),className:"w-20 px-3 py-2 text-sm border border-edge rounded-lg bg-surface text-center focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsx("input",{placeholder:"Col",type:"number",min:0,value:_,onChange:S=>E(S.target.value),className:"w-20 px-3 py-2 text-sm border border-edge rounded-lg bg-surface text-center focus:outline-none focus:ring-1 focus:ring-accent"})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs("button",{type:"button",onClick:k,disabled:!p||n,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg bg-accent text-white hover:bg-accent-light disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[e.jsx(q,{className:"w-3.5 h-3.5"}),"Definition"]}),e.jsxs("button",{type:"button",onClick:D,disabled:!p||n,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg border border-edge hover:bg-surface-elevated disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[e.jsx(H,{className:"w-3.5 h-3.5"}),"References"]}),e.jsxs("button",{type:"button",onClick:C,disabled:!p||n,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg border border-edge hover:bg-surface-elevated disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[e.jsx(B,{className:"w-3.5 h-3.5"}),"Hover"]})]}),n&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted py-2",children:[e.jsx(R,{className:"w-3 h-3 animate-spin"}),e.jsx("span",{children:"Loading..."})]}),!n&&m&&e.jsxs("div",{className:"space-y-3",children:[u&&e.jsx(we,{hover:u}),i.length>0&&e.jsx(U,{title:"Definitions",locations:i}),d&&e.jsx(ke,{references:d})]}),!n&&!m&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted",children:[e.jsx(H,{className:"w-10 h-10 mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"Enter a file path and position to explore symbols"}),e.jsx("p",{className:"text-xs mt-1",children:"Use Definition, References, or Hover to inspect code"})]})]})}function Me({getDiagnostics:t,operationLoading:s,diagnostics:a}){const[n,i]=c.useState(""),[d,u]=c.useState(!1),r=c.useCallback(()=>{n.trim()&&(u(!0),t(n.trim()))},[n,t]),w=c.useCallback(o=>{o.key==="Enter"&&r()},[r]);return e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{placeholder:"File path (e.g. src/main.ts)",value:n,onChange:o=>i(o.target.value),onKeyDown:w,className:"flex-1 px-3 py-2 text-sm border border-edge rounded-lg bg-surface font-mono focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsxs("button",{type:"button",onClick:r,disabled:!n.trim()||s,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg bg-accent text-white hover:bg-accent-light disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[e.jsx(F,{className:"w-3.5 h-3.5"}),"Load"]})]}),s&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted py-2",children:[e.jsx(R,{className:"w-3 h-3 animate-spin"}),e.jsx("span",{children:"Loading diagnostics..."})]}),!s&&a.length>0&&e.jsx("div",{className:"space-y-2",children:a.map((o,L)=>e.jsx(Ce,{diagnostic:o},`${o.file}-${o.startLine}-${o.startCharacter}-${L}`))}),!s&&a.length===0&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted",children:[e.jsx(F,{className:"w-10 h-10 mb-3 opacity-40"}),d?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm",children:"No diagnostics found for this file"}),e.jsx("p",{className:"text-xs mt-1",children:"The file may be error-free or the language server may not support diagnostics"})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm",children:"Enter a file path to load diagnostics"}),e.jsx("p",{className:"text-xs mt-1",children:"View errors, warnings, and hints from the language server"})]})]})]})}function De({getSymbols:t,operationLoading:s,symbols:a}){const[n,i]=c.useState(""),[d,u]=c.useState(!1),r=c.useCallback(()=>{n.trim()&&(u(!0),t(n.trim()))},[n,t]),w=c.useCallback(o=>{o.key==="Enter"&&r()},[r]);return e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{placeholder:"File path (e.g. src/main.ts)",value:n,onChange:o=>i(o.target.value),onKeyDown:w,className:"flex-1 px-3 py-2 text-sm border border-edge rounded-lg bg-surface font-mono focus:outline-none focus:ring-1 focus:ring-accent"}),e.jsxs("button",{type:"button",onClick:r,disabled:!n.trim()||s,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg bg-accent text-white hover:bg-accent-light disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[e.jsx(z,{className:"w-3.5 h-3.5"}),"Load"]})]}),s&&e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted py-2",children:[e.jsx(R,{className:"w-3 h-3 animate-spin"}),e.jsx("span",{children:"Loading symbols..."})]}),!s&&d&&e.jsx($e,{symbols:a}),!s&&!d&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-muted",children:[e.jsx(z,{className:"w-10 h-10 mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"Enter a file path to explore document symbols"}),e.jsx("p",{className:"text-xs mt-1",children:"View functions, classes, interfaces, and other symbols"})]})]})}function Re(){const{languages:t,status:s,loading:a,error:n,operationLoading:i,definitions:d,references:u,hover:r,diagnostics:w,symbols:o,refresh:L,goToDefinition:_,findReferences:E,getHover:N,getDiagnostics:v,getSymbols:p}=ye(),[k,D]=c.useState("status");return n&&!t?e.jsxs("div",{className:"flex items-center justify-center h-full text-danger",children:["Failed to load: ",n]}):a||!t?e.jsxs("div",{className:"flex items-center justify-center h-full text-muted",children:[e.jsx(R,{className:"w-4 h-4 animate-spin mr-2"}),"Loading LSP data..."]}):e.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-edge bg-surface-alt",children:[e.jsx("div",{className:"flex items-center gap-1",children:je.map(C=>{const m=C.icon,S=k===C.id;return e.jsxs("button",{type:"button",onClick:()=>D(C.id),className:`
|
|
67
|
-
inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg transition-colors
|
|
68
|
-
${S?"bg-accent/10 text-accent":"text-muted hover:bg-surface-elevated hover:text-foreground"}
|
|
69
|
-
`,children:[e.jsx(m,{className:"w-3.5 h-3.5"}),C.label]},C.id)})}),e.jsxs("button",{type:"button",onClick:()=>void L(),className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg border border-edge hover:bg-surface-elevated transition-colors",title:"Refresh LSP data",children:[e.jsx(R,{className:`w-3 h-3 ${a?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]})]}),n&&e.jsx("div",{className:"px-4 py-2 text-xs text-danger bg-danger/5 border-b border-danger/20",children:n}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[k==="status"&&e.jsx(Le,{languages:t,status:s}),k==="explorer"&&e.jsx(_e,{goToDefinition:_,findReferences:E,getHover:N,operationLoading:i,definitions:d,references:u,hover:r}),k==="diagnostics"&&e.jsx(Me,{getDiagnostics:v,operationLoading:i,diagnostics:w}),k==="symbols"&&e.jsx(De,{getSymbols:p,operationLoading:i,symbols:o})]})]})}export{Re as LspTab};
|