@wangcansun/cc-config 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/README.md +364 -0
  2. package/cli.mjs +40202 -0
  3. package/dashboard/dist/client/assets/activity-DS5YBWMm.js +1 -0
  4. package/dashboard/dist/client/assets/commands-DhNv8XVR.js +1 -0
  5. package/dashboard/dist/client/assets/dashboard-DIyDYrl6.js +1 -0
  6. package/dashboard/dist/client/assets/detail-panel-C8SGLgm-.js +1 -0
  7. package/dashboard/dist/client/assets/header-CBzSNzdI.js +1 -0
  8. package/dashboard/dist/client/assets/index-CFEz1CGb.js +14 -0
  9. package/dashboard/dist/client/assets/index-CHtRMAMT.css +1 -0
  10. package/dashboard/dist/client/assets/index-CaDf51H6.js +76 -0
  11. package/dashboard/dist/client/assets/markdown-viewer-Bj8nSOSJ.js +17 -0
  12. package/dashboard/dist/client/assets/mcp-BX69kbwu.js +1 -0
  13. package/dashboard/dist/client/assets/plugins-BslRzmVr.js +2 -0
  14. package/dashboard/dist/client/assets/profiles-CfOCpDPJ.js +2 -0
  15. package/dashboard/dist/client/assets/recommended-BAj0agKu.js +1 -0
  16. package/dashboard/dist/client/assets/search-box-CqaIZ9mR.js +1 -0
  17. package/dashboard/dist/client/assets/select-BtWQJMup.js +1 -0
  18. package/dashboard/dist/client/assets/settings-CicCcNf_.js +1 -0
  19. package/dashboard/dist/client/assets/skills-DML4G4BP.js +1 -0
  20. package/dashboard/dist/client/assets/tag-Q3V7Jugn.js +1 -0
  21. package/dashboard/dist/client/favicon.ico +0 -0
  22. package/dashboard/dist/client/icon-192.png +0 -0
  23. package/dashboard/dist/client/icon-32.png +0 -0
  24. package/dashboard/dist/client/icon-512.png +0 -0
  25. package/dashboard/dist/client/icon.png +0 -0
  26. package/dashboard/dist/client/index.html +19 -0
  27. package/dashboard/dist/server.mjs +41832 -0
  28. package/mcp/server.mjs +26607 -0
  29. package/package.json +36 -0
@@ -0,0 +1,17 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CFEz1CGb.js","assets/index-CaDf51H6.js","assets/index-CHtRMAMT.css"])))=>i.map(i=>d[i]);
2
+ import{r as X,j as H,_ as Ue}from"./index-CaDf51H6.js";function ae(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,l=t.indexOf(n);for(;l!==-1;)i++,l=t.indexOf(n,l+n.length);return i}function Ar(){}function Dr(){}const M=T(/[A-Za-z]/),te=T(/[\dA-Za-z]/),Fr=T(/[#-'*+\--9=?A-Z^-~]/);function Ve(e){return e!==null&&(e<32||e===127)}const Sr=T(/\d/),vr=T(/[\dA-Fa-f]/),Lr=T(/[!-/:-@[-`{-~]/);function P(e){return e!==null&&e<-2}function A(e){return e!==null&&(e<0||e===32)}function S(e){return e===-2||e===-1||e===32}const U=T(new RegExp("\\p{P}|\\p{S}","u")),I=T(/\s/);function T(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ge(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const V=function(e){if(e==null)return Je;if(typeof e=="function")return G(e);if(typeof e=="object")return Array.isArray(e)?Qe(e):Ze(e);if(typeof e=="string")return Ke(e);throw new Error("Expected function, string, or object as test")};function Qe(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=V(e[t]);return G(i);function i(...l){let u=-1;for(;++u<n.length;)if(n[u].apply(this,l))return!0;return!1}}function Ze(e){const n=e;return G(t);function t(i){const l=i;let u;for(u in e)if(l[u]!==n[u])return!1;return!0}}function Ke(e){return G(n);function n(t){return t&&t.type===e}}function G(e){return n;function n(t,i,l){return!!(Xe(t)&&e.call(this,t,typeof i=="number"?i:void 0,l||void 0))}}function Je(){return!0}function Xe(e){return e!==null&&typeof e=="object"&&"type"in e}const be=[],Ye=!0,Y=!1,et="skip";function de(e,n,t,i){let l;typeof n=="function"&&typeof t!="function"?(i=t,t=n):l=n;const u=V(l),r=i?-1:1;a(e,void 0,[])();function a(o,s,h){const c=o&&typeof o=="object"?o:{};if(typeof c.type=="string"){const g=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(o.type+(g?"<"+g+">":""))+")"})}return m;function m(){let g=be,p,b,d;if((!n||u(o,s,h[h.length-1]||void 0))&&(g=tt(t(o,h)),g[0]===Y))return g;if("children"in o&&o.children){const k=o;if(k.children&&g[0]!==et)for(b=(i?k.children.length:-1)+r,d=h.concat(k);b>-1&&b<k.children.length;){const x=k.children[b];if(p=a(x,b,d)(),p[0]===Y)return p;b=typeof p[1]=="number"?p[1]:b+r}}return g}}}function tt(e){return Array.isArray(e)?e:typeof e=="number"?[Ye,e]:e==null?be:[e]}function nt(e,n,t){const l=V((t||{}).ignore||[]),u=rt(n);let r=-1;for(;++r<u.length;)de(e,"text",a);function a(s,h){let c=-1,m;for(;++c<h.length;){const g=h[c],p=m?m.children:void 0;if(l(g,p?p.indexOf(g):void 0,m))return;m=g}if(m)return o(s,h)}function o(s,h){const c=h[h.length-1],m=u[r][0],g=u[r][1];let p=0;const d=c.children.indexOf(s);let k=!1,x=[];m.lastIndex=0;let w=m.exec(s.value);for(;w;){const D=w.index,C={index:w.index,input:w.input,stack:[...h,s]};let y=g(...w,C);if(typeof y=="string"&&(y=y.length>0?{type:"text",value:y}:void 0),y===!1?m.lastIndex=D+1:(p!==D&&x.push({type:"text",value:s.value.slice(p,D)}),Array.isArray(y)?x.push(...y):y&&x.push(y),p=D+w[0].length,k=!0),!m.global)break;w=m.exec(s.value)}return k?(p<s.value.length&&x.push({type:"text",value:s.value.slice(p)}),c.children.splice(d,1,...x)):x=[s],d+x.length}}function rt(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!e[0]||Array.isArray(e[0])?e:[e];let i=-1;for(;++i<t.length;){const l=t[i];n.push([it(l[0]),lt(l[1])])}return n}function it(e){return typeof e=="string"?new RegExp(Ge(e),"g"):e}function lt(e){return typeof e=="function"?e:function(){return e}}const Q="phrasing",Z=["autolink","link","image","label"];function ot(){return{transforms:[pt],enter:{literalAutolink:at,literalAutolinkEmail:K,literalAutolinkHttp:K,literalAutolinkWww:K},exit:{literalAutolink:ht,literalAutolinkEmail:ft,literalAutolinkHttp:st,literalAutolinkWww:ct}}}function ut(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Q,notInConstruct:Z},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Q,notInConstruct:Z},{character:":",before:"[ps]",after:"\\/",inConstruct:Q,notInConstruct:Z}]}}function at(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function K(e){this.config.enter.autolinkProtocol.call(this,e)}function st(e){this.config.exit.autolinkProtocol.call(this,e)}function ct(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function ft(e){this.config.exit.autolinkEmail.call(this,e)}function ht(e){this.exit(e)}function pt(e){nt(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,mt],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),gt]],{ignore:["link","linkReference"]})}function mt(e,n,t,i,l){let u="";if(!xe(l)||(/^w/i.test(n)&&(t=n+t,n="",u="http://"),!kt(t)))return!1;const r=bt(t+i);if(!r[0])return!1;const a={type:"link",title:null,url:u+n+r[0],children:[{type:"text",value:n+r[0]}]};return r[1]?[a,{type:"text",value:r[1]}]:a}function gt(e,n,t,i){return!xe(i,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function kt(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function bt(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],i=t.indexOf(")");const l=ae(e,"(");let u=ae(e,")");for(;i!==-1&&l>u;)e+=t.slice(0,i+1),t=t.slice(i+1),i=t.indexOf(")"),u++;return[e,t]}function xe(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||I(t)||U(t))&&(!n||t!==47)}function j(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}we.peek=St;function dt(){this.buffer()}function xt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function wt(){this.buffer()}function yt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ct(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=j(this.sliceSerialize(e)).toLowerCase(),t.label=n}function At(e){this.exit(e)}function Dt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=j(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Ft(e){this.exit(e)}function St(){return"["}function we(e,n,t,i){const l=t.createTracker(i);let u=l.move("[^");const r=t.enter("footnoteReference"),a=t.enter("reference");return u+=l.move(t.safe(t.associationId(e),{after:"]",before:u})),a(),r(),u+=l.move("]"),u}function vt(){return{enter:{gfmFootnoteCallString:dt,gfmFootnoteCall:xt,gfmFootnoteDefinitionLabelString:wt,gfmFootnoteDefinition:yt},exit:{gfmFootnoteCallString:Ct,gfmFootnoteCall:At,gfmFootnoteDefinitionLabelString:Dt,gfmFootnoteDefinition:Ft}}}function Lt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:we},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(i,l,u,r){const a=u.createTracker(r);let o=a.move("[^");const s=u.enter("footnoteDefinition"),h=u.enter("label");return o+=a.move(u.safe(u.associationId(i),{before:o,after:"]"})),h(),o+=a.move("]:"),i.children&&i.children.length>0&&(a.shift(4),o+=a.move((n?`
3
+ `:" ")+u.indentLines(u.containerFlow(i,a.current()),n?ye:Tt))),s(),o}}function Tt(e,n,t){return n===0?e:ye(e,n,t)}function ye(e,n,t){return(t?"":" ")+e}const zt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ce.peek=_t;function It(){return{canContainEols:["delete"],enter:{strikethrough:Pt},exit:{strikethrough:Rt}}}function Et(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:zt}],handlers:{delete:Ce}}}function Pt(e){this.enter({type:"delete",children:[]},e)}function Rt(e){this.exit(e)}function Ce(e,n,t,i){const l=t.createTracker(i),u=t.enter("strikethrough");let r=l.move("~~");return r+=t.containerPhrasing(e,{...l.current(),before:r,after:"~"}),r+=l.move("~~"),u(),r}function _t(){return"~"}function Mt(e){return e.length}function Ot(e,n){const t=n||{},i=(t.align||[]).concat(),l=t.stringLength||Mt,u=[],r=[],a=[],o=[];let s=0,h=-1;for(;++h<e.length;){const b=[],d=[];let k=-1;for(e[h].length>s&&(s=e[h].length);++k<e[h].length;){const x=jt(e[h][k]);if(t.alignDelimiters!==!1){const w=l(x);d[k]=w,(o[k]===void 0||w>o[k])&&(o[k]=w)}b.push(x)}r[h]=b,a[h]=d}let c=-1;if(typeof i=="object"&&"length"in i)for(;++c<s;)u[c]=se(i[c]);else{const b=se(i);for(;++c<s;)u[c]=b}c=-1;const m=[],g=[];for(;++c<s;){const b=u[c];let d="",k="";b===99?(d=":",k=":"):b===108?d=":":b===114&&(k=":");let x=t.alignDelimiters===!1?1:Math.max(1,o[c]-d.length-k.length);const w=d+"-".repeat(x)+k;t.alignDelimiters!==!1&&(x=d.length+x+k.length,x>o[c]&&(o[c]=x),g[c]=x),m[c]=w}r.splice(1,0,m),a.splice(1,0,g),h=-1;const p=[];for(;++h<r.length;){const b=r[h],d=a[h];c=-1;const k=[];for(;++c<s;){const x=b[c]||"";let w="",D="";if(t.alignDelimiters!==!1){const C=o[c]-(d[c]||0),y=u[c];y===114?w=" ".repeat(C):y===99?C%2?(w=" ".repeat(C/2+.5),D=" ".repeat(C/2-.5)):(w=" ".repeat(C/2),D=w):D=" ".repeat(C)}t.delimiterStart!==!1&&!c&&k.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&x==="")&&(t.delimiterStart!==!1||c)&&k.push(" "),t.alignDelimiters!==!1&&k.push(w),k.push(x),t.alignDelimiters!==!1&&k.push(D),t.padding!==!1&&k.push(" "),(t.delimiterEnd!==!1||c!==s-1)&&k.push("|")}p.push(t.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return p.join(`
4
+ `)}function jt(e){return e==null?"":String(e)}function se(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function Bt(e,n,t,i){const l=t.enter("blockquote"),u=t.createTracker(i);u.move("> "),u.shift(2);const r=t.indentLines(t.containerFlow(e,u.current()),$t);return l(),r}function $t(e,n,t){return">"+(t?"":" ")+e}function Ht(e,n){return ce(e,n.inConstruct,!0)&&!ce(e,n.notInConstruct,!1)}function ce(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let i=-1;for(;++i<n.length;)if(e.includes(n[i]))return!0;return!1}function fe(e,n,t,i){let l=-1;for(;++l<t.unsafe.length;)if(t.unsafe[l].character===`
5
+ `&&Ht(t.stack,t.unsafe[l]))return/[ \t]/.test(i.before)?"":" ";return`\\
6
+ `}function qt(e,n){const t=String(e);let i=t.indexOf(n),l=i,u=0,r=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;i!==-1;)i===l?++u>r&&(r=u):u=1,l=i+n.length,i=t.indexOf(n,l);return r}function Wt(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Nt(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function Ut(e,n,t,i){const l=Nt(t),u=e.value||"",r=l==="`"?"GraveAccent":"Tilde";if(Wt(e,t)){const c=t.enter("codeIndented"),m=t.indentLines(u,Vt);return c(),m}const a=t.createTracker(i),o=l.repeat(Math.max(qt(u,l)+1,3)),s=t.enter("codeFenced");let h=a.move(o);if(e.lang){const c=t.enter(`codeFencedLang${r}`);h+=a.move(t.safe(e.lang,{before:h,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${r}`);h+=a.move(" "),h+=a.move(t.safe(e.meta,{before:h,after:`
7
+ `,encode:["`"],...a.current()})),c()}return h+=a.move(`
8
+ `),u&&(h+=a.move(u+`
9
+ `)),h+=a.move(o),s(),h}function Vt(e,n,t){return(t?"":" ")+e}function ne(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Gt(e,n,t,i){const l=ne(t),u=l==='"'?"Quote":"Apostrophe",r=t.enter("definition");let a=t.enter("label");const o=t.createTracker(i);let s=o.move("[");return s+=o.move(t.safe(t.associationId(e),{before:s,after:"]",...o.current()})),s+=o.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=o.move("<"),s+=o.move(t.safe(e.url,{before:s,after:">",...o.current()})),s+=o.move(">")):(a=t.enter("destinationRaw"),s+=o.move(t.safe(e.url,{before:s,after:e.title?" ":`
10
+ `,...o.current()}))),a(),e.title&&(a=t.enter(`title${u}`),s+=o.move(" "+l),s+=o.move(t.safe(e.title,{before:s,after:l,...o.current()})),s+=o.move(l),a()),r(),s}function Qt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function O(e){return"&#x"+e.toString(16).toUpperCase()+";"}function W(e){if(e===null||A(e)||I(e))return 1;if(U(e))return 2}function N(e,n,t){const i=W(e),l=W(n);return i===void 0?l===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ae.peek=Zt;function Ae(e,n,t,i){const l=Qt(t),u=t.enter("emphasis"),r=t.createTracker(i),a=r.move(l);let o=r.move(t.containerPhrasing(e,{after:l,before:a,...r.current()}));const s=o.charCodeAt(0),h=N(i.before.charCodeAt(i.before.length-1),s,l);h.inside&&(o=O(s)+o.slice(1));const c=o.charCodeAt(o.length-1),m=N(i.after.charCodeAt(0),c,l);m.inside&&(o=o.slice(0,-1)+O(c));const g=r.move(l);return u(),t.attentionEncodeSurroundingInfo={after:m.outside,before:h.outside},a+o+g}function Zt(e,n,t){return t.options.emphasis||"*"}function Kt(e,n,t,i){let l,u,r;typeof n=="function"&&typeof t!="function"?(u=void 0,r=n,l=t):(u=n,r=t,l=i),de(e,u,a,l);function a(o,s){const h=s[s.length-1],c=h?h.children.indexOf(o):void 0;return r(o,c,h)}}const Jt={};function De(e,n){const t=Jt,i=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,l=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Fe(e,i,l)}function Fe(e,n,t){if(Xt(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return he(e.children,n,t)}return Array.isArray(e)?he(e,n,t):""}function he(e,n,t){const i=[];let l=-1;for(;++l<e.length;)i[l]=Fe(e[l],n,t);return i.join("")}function Xt(e){return!!(e&&typeof e=="object")}function Yt(e,n){let t=!1;return Kt(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return t=!0,Y}),!!((!e.depth||e.depth<3)&&De(e)&&(n.options.setext||t))}function en(e,n,t,i){const l=Math.max(Math.min(6,e.depth||1),1),u=t.createTracker(i);if(Yt(e,t)){const h=t.enter("headingSetext"),c=t.enter("phrasing"),m=t.containerPhrasing(e,{...u.current(),before:`
11
+ `,after:`
12
+ `});return c(),h(),m+`
13
+ `+(l===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(`
14
+ `))+1))}const r="#".repeat(l),a=t.enter("headingAtx"),o=t.enter("phrasing");u.move(r+" ");let s=t.containerPhrasing(e,{before:"# ",after:`
15
+ `,...u.current()});return/^[\t ]/.test(s)&&(s=O(s.charCodeAt(0))+s.slice(1)),s=s?r+" "+s:r,t.options.closeAtx&&(s+=" "+r),o(),a(),s}Se.peek=tn;function Se(e){return e.value||""}function tn(){return"<"}ve.peek=nn;function ve(e,n,t,i){const l=ne(t),u=l==='"'?"Quote":"Apostrophe",r=t.enter("image");let a=t.enter("label");const o=t.createTracker(i);let s=o.move("![");return s+=o.move(t.safe(e.alt,{before:s,after:"]",...o.current()})),s+=o.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),s+=o.move("<"),s+=o.move(t.safe(e.url,{before:s,after:">",...o.current()})),s+=o.move(">")):(a=t.enter("destinationRaw"),s+=o.move(t.safe(e.url,{before:s,after:e.title?" ":")",...o.current()}))),a(),e.title&&(a=t.enter(`title${u}`),s+=o.move(" "+l),s+=o.move(t.safe(e.title,{before:s,after:l,...o.current()})),s+=o.move(l),a()),s+=o.move(")"),r(),s}function nn(){return"!"}Le.peek=rn;function Le(e,n,t,i){const l=e.referenceType,u=t.enter("imageReference");let r=t.enter("label");const a=t.createTracker(i);let o=a.move("![");const s=t.safe(e.alt,{before:o,after:"]",...a.current()});o+=a.move(s+"]["),r();const h=t.stack;t.stack=[],r=t.enter("reference");const c=t.safe(t.associationId(e),{before:o,after:"]",...a.current()});return r(),t.stack=h,u(),l==="full"||!s||s!==c?o+=a.move(c+"]"):l==="shortcut"?o=o.slice(0,-1):o+=a.move("]"),o}function rn(){return"!"}Te.peek=ln;function Te(e,n,t){let i=e.value||"",l="`",u=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(i);)l+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++u<t.unsafe.length;){const r=t.unsafe[u],a=t.compilePattern(r);let o;if(r.atBreak)for(;o=a.exec(i);){let s=o.index;i.charCodeAt(s)===10&&i.charCodeAt(s-1)===13&&s--,i=i.slice(0,s)+" "+i.slice(o.index+1)}}return l+i+l}function ln(){return"`"}function ze(e,n){const t=De(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ie.peek=on;function Ie(e,n,t,i){const l=ne(t),u=l==='"'?"Quote":"Apostrophe",r=t.createTracker(i);let a,o;if(ze(e,t)){const h=t.stack;t.stack=[],a=t.enter("autolink");let c=r.move("<");return c+=r.move(t.containerPhrasing(e,{before:c,after:">",...r.current()})),c+=r.move(">"),a(),t.stack=h,c}a=t.enter("link"),o=t.enter("label");let s=r.move("[");return s+=r.move(t.containerPhrasing(e,{before:s,after:"](",...r.current()})),s+=r.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),s+=r.move("<"),s+=r.move(t.safe(e.url,{before:s,after:">",...r.current()})),s+=r.move(">")):(o=t.enter("destinationRaw"),s+=r.move(t.safe(e.url,{before:s,after:e.title?" ":")",...r.current()}))),o(),e.title&&(o=t.enter(`title${u}`),s+=r.move(" "+l),s+=r.move(t.safe(e.title,{before:s,after:l,...r.current()})),s+=r.move(l),o()),s+=r.move(")"),a(),s}function on(e,n,t){return ze(e,t)?"<":"["}Ee.peek=un;function Ee(e,n,t,i){const l=e.referenceType,u=t.enter("linkReference");let r=t.enter("label");const a=t.createTracker(i);let o=a.move("[");const s=t.containerPhrasing(e,{before:o,after:"]",...a.current()});o+=a.move(s+"]["),r();const h=t.stack;t.stack=[],r=t.enter("reference");const c=t.safe(t.associationId(e),{before:o,after:"]",...a.current()});return r(),t.stack=h,u(),l==="full"||!s||s!==c?o+=a.move(c+"]"):l==="shortcut"?o=o.slice(0,-1):o+=a.move("]"),o}function un(){return"["}function re(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function an(e){const n=re(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function sn(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Pe(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function cn(e,n,t,i){const l=t.enter("list"),u=t.bulletCurrent;let r=e.ordered?sn(t):re(t);const a=e.ordered?r==="."?")":".":an(t);let o=n&&t.bulletLastUsed?r===t.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((r==="*"||r==="-")&&h&&(!h.children||!h.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(o=!0),Pe(t)===r&&h){let c=-1;for(;++c<e.children.length;){const m=e.children[c];if(m&&m.type==="listItem"&&m.children&&m.children[0]&&m.children[0].type==="thematicBreak"){o=!0;break}}}}o&&(r=a),t.bulletCurrent=r;const s=t.containerFlow(e,i);return t.bulletLastUsed=r,t.bulletCurrent=u,l(),s}function fn(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function hn(e,n,t,i){const l=fn(t);let u=t.bulletCurrent||re(t);n&&n.type==="list"&&n.ordered&&(u=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+u);let r=u.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(r=Math.ceil(r/4)*4);const a=t.createTracker(i);a.move(u+" ".repeat(r-u.length)),a.shift(r);const o=t.enter("listItem"),s=t.indentLines(t.containerFlow(e,a.current()),h);return o(),s;function h(c,m,g){return m?(g?"":" ".repeat(r))+c:(g?u:u+" ".repeat(r-u.length))+c}}function pn(e,n,t,i){const l=t.enter("paragraph"),u=t.enter("phrasing"),r=t.containerPhrasing(e,i);return u(),l(),r}const mn=V(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function gn(e,n,t,i){return(e.children.some(function(r){return mn(r)})?t.containerPhrasing:t.containerFlow).call(t,e,i)}function kn(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Re.peek=bn;function Re(e,n,t,i){const l=kn(t),u=t.enter("strong"),r=t.createTracker(i),a=r.move(l+l);let o=r.move(t.containerPhrasing(e,{after:l,before:a,...r.current()}));const s=o.charCodeAt(0),h=N(i.before.charCodeAt(i.before.length-1),s,l);h.inside&&(o=O(s)+o.slice(1));const c=o.charCodeAt(o.length-1),m=N(i.after.charCodeAt(0),c,l);m.inside&&(o=o.slice(0,-1)+O(c));const g=r.move(l+l);return u(),t.attentionEncodeSurroundingInfo={after:m.outside,before:h.outside},a+o+g}function bn(e,n,t){return t.options.strong||"*"}function dn(e,n,t,i){return t.safe(e.value,i)}function xn(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function wn(e,n,t){const i=(Pe(t)+(t.options.ruleSpaces?" ":"")).repeat(xn(t));return t.options.ruleSpaces?i.slice(0,-1):i}const _e={blockquote:Bt,break:fe,code:Ut,definition:Gt,emphasis:Ae,hardBreak:fe,heading:en,html:Se,image:ve,imageReference:Le,inlineCode:Te,link:Ie,linkReference:Ee,list:cn,listItem:hn,paragraph:pn,root:gn,strong:Re,text:dn,thematicBreak:wn};function yn(){return{enter:{table:Cn,tableData:pe,tableHeader:pe,tableRow:Dn},exit:{codeText:Fn,table:An,tableData:J,tableHeader:J,tableRow:J}}}function Cn(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function An(e){this.exit(e),this.data.inTable=void 0}function Dn(e){this.enter({type:"tableRow",children:[]},e)}function J(e){this.exit(e)}function pe(e){this.enter({type:"tableCell",children:[]},e)}function Fn(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Sn));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function Sn(e,n){return n==="|"?n:e}function vn(e){const n=e||{},t=n.tableCellPadding,i=n.tablePipeAlign,l=n.stringLength,u=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
16
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:r,tableCell:o,tableRow:a}};function r(g,p,b,d){return s(h(g,b,d),g.align)}function a(g,p,b,d){const k=c(g,b,d),x=s([k]);return x.slice(0,x.indexOf(`
17
+ `))}function o(g,p,b,d){const k=b.enter("tableCell"),x=b.enter("phrasing"),w=b.containerPhrasing(g,{...d,before:u,after:u});return x(),k(),w}function s(g,p){return Ot(g,{align:p,alignDelimiters:i,padding:t,stringLength:l})}function h(g,p,b){const d=g.children;let k=-1;const x=[],w=p.enter("table");for(;++k<d.length;)x[k]=c(d[k],p,b);return w(),x}function c(g,p,b){const d=g.children;let k=-1;const x=[],w=p.enter("tableRow");for(;++k<d.length;)x[k]=o(d[k],g,p,b);return w(),x}function m(g,p,b){let d=_e.inlineCode(g,p,b);return b.stack.includes("tableCell")&&(d=d.replace(/\|/g,"\\$&")),d}}function Ln(){return{exit:{taskListCheckValueChecked:me,taskListCheckValueUnchecked:me,paragraph:zn}}}function Tn(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:In}}}function me(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function zn(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const i=t.children[0];if(i&&i.type==="text"){const l=n.children;let u=-1,r;for(;++u<l.length;){const a=l[u];if(a.type==="paragraph"){r=a;break}}r===t&&(i.value=i.value.slice(1),i.value.length===0?t.children.shift():t.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,t.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function In(e,n,t,i){const l=e.children[0],u=typeof e.checked=="boolean"&&l&&l.type==="paragraph",r="["+(e.checked?"x":" ")+"] ",a=t.createTracker(i);u&&a.move(r);let o=_e.listItem(e,n,t,{...i,...a.current()});return u&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),o;function s(h){return h+r}}function En(){return[ot(),vt(),It(),yn(),Ln()]}function Pn(e){return{extensions:[ut(),Lt(e),Et(),vn(e),Tn()]}}function _(e,n,t,i){const l=e.length;let u=0,r;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,t=t>0?t:0,i.length<1e4)r=Array.from(i),r.unshift(n,t),e.splice(...r);else for(t&&e.splice(n,t);u<i.length;)r=i.slice(u,u+1e4),r.unshift(n,0),e.splice(...r),u+=1e4,n+=1e4}function Tr(e,n){return e.length>0?(_(e,e.length,0,n),e):n}const ge={}.hasOwnProperty;function Rn(e){const n={};let t=-1;for(;++t<e.length;)_n(n,e[t]);return n}function _n(e,n){let t;for(t in n){const l=(ge.call(e,t)?e[t]:void 0)||(e[t]={}),u=n[t];let r;if(u)for(r in u){ge.call(l,r)||(l[r]=[]);const a=u[r];Mn(l[r],Array.isArray(a)?a:a?[a]:[])}}}function Mn(e,n){let t=-1;const i=[];for(;++t<n.length;)(n[t].add==="after"?e:i).push(n[t]);_(e,0,0,i)}const On={tokenize:Wn,partial:!0},Me={tokenize:Nn,partial:!0},Oe={tokenize:Un,partial:!0},je={tokenize:Vn,partial:!0},jn={tokenize:Gn,partial:!0},Be={name:"wwwAutolink",tokenize:Hn,previous:He},$e={name:"protocolAutolink",tokenize:qn,previous:qe},L={name:"emailAutolink",tokenize:$n,previous:We},F={};function Bn(){return{text:F}}let z=48;for(;z<123;)F[z]=L,z++,z===58?z=65:z===91&&(z=97);F[43]=L;F[45]=L;F[46]=L;F[95]=L;F[72]=[L,$e];F[104]=[L,$e];F[87]=[L,Be];F[119]=[L,Be];function $n(e,n,t){const i=this;let l,u;return r;function r(c){return!ee(c)||!We.call(i,i.previous)||ie(i.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return ee(c)?(e.consume(c),a):c===64?(e.consume(c),o):t(c)}function o(c){return c===46?e.check(jn,h,s)(c):c===45||c===95||te(c)?(u=!0,e.consume(c),o):h(c)}function s(c){return e.consume(c),l=!0,o}function h(c){return u&&l&&M(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function Hn(e,n,t){const i=this;return l;function l(r){return r!==87&&r!==119||!He.call(i,i.previous)||ie(i.events)?t(r):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(On,e.attempt(Me,e.attempt(Oe,u),t),t)(r))}function u(r){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(r)}}function qn(e,n,t){const i=this;let l="",u=!1;return r;function r(c){return(c===72||c===104)&&qe.call(i,i.previous)&&!ie(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(M(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const m=l.toLowerCase();if(m==="http"||m==="https")return e.consume(c),o}return t(c)}function o(c){return c===47?(e.consume(c),u?s:(u=!0,o)):t(c)}function s(c){return c===null||Ve(c)||A(c)||I(c)||U(c)?t(c):e.attempt(Me,e.attempt(Oe,h),t)(c)}function h(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function Wn(e,n,t){let i=0;return l;function l(r){return(r===87||r===119)&&i<3?(i++,e.consume(r),l):r===46&&i===3?(e.consume(r),u):t(r)}function u(r){return r===null?t(r):n(r)}}function Nn(e,n,t){let i,l,u;return r;function r(s){return s===46||s===95?e.check(je,o,a)(s):s===null||A(s)||I(s)||s!==45&&U(s)?o(s):(u=!0,e.consume(s),r)}function a(s){return s===95?i=!0:(l=i,i=void 0),e.consume(s),r}function o(s){return l||i||!u?t(s):n(s)}}function Un(e,n){let t=0,i=0;return l;function l(r){return r===40?(t++,e.consume(r),l):r===41&&i<t?u(r):r===33||r===34||r===38||r===39||r===41||r===42||r===44||r===46||r===58||r===59||r===60||r===63||r===93||r===95||r===126?e.check(je,n,u)(r):r===null||A(r)||I(r)?n(r):(e.consume(r),l)}function u(r){return r===41&&i++,e.consume(r),l}}function Vn(e,n,t){return i;function i(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),i):a===38?(e.consume(a),u):a===93?(e.consume(a),l):a===60||a===null||A(a)||I(a)?n(a):t(a)}function l(a){return a===null||a===40||a===91||A(a)||I(a)?n(a):i(a)}function u(a){return M(a)?r(a):t(a)}function r(a){return a===59?(e.consume(a),i):M(a)?(e.consume(a),r):t(a)}}function Gn(e,n,t){return i;function i(u){return e.consume(u),l}function l(u){return te(u)?t(u):n(u)}}function He(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||A(e)}function qe(e){return!M(e)}function We(e){return!(e===47||ee(e))}function ee(e){return e===43||e===45||e===46||e===95||te(e)}function ie(e){let n=e.length,t=!1;for(;n--;){const i=e[n][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){t=!0;break}if(i._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}function Qn(e,n,t){const i=[];let l=-1;for(;++l<e.length;){const u=e[l].resolveAll;u&&!i.includes(u)&&(n=u(n,t),i.push(u))}return n}function v(e,n,t,i){const l=i?i-1:Number.POSITIVE_INFINITY;let u=0;return r;function r(o){return S(o)?(e.enter(t),a(o)):n(o)}function a(o){return S(o)&&u++<l?(e.consume(o),a):(e.exit(t),n(o))}}const Zn={partial:!0,tokenize:Kn};function Kn(e,n,t){return i;function i(u){return S(u)?v(e,l,"linePrefix")(u):l(u)}function l(u){return u===null||P(u)?n(u):t(u)}}const Jn={tokenize:lr,partial:!0};function Xn(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:nr,continuation:{tokenize:rr},exit:ir}},text:{91:{name:"gfmFootnoteCall",tokenize:tr},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Yn,resolveTo:er}}}}function Yn(e,n,t){const i=this;let l=i.events.length;const u=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let r;for(;l--;){const o=i.events[l][1];if(o.type==="labelImage"){r=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return a;function a(o){if(!r||!r._balanced)return t(o);const s=j(i.sliceSerialize({start:r.end,end:i.now()}));return s.codePointAt(0)!==94||!u.includes(s.slice(1))?t(o):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),n(o))}}function er(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},r={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},a=[e[t+1],e[t+2],["enter",i,n],e[t+3],e[t+4],["enter",l,n],["exit",l,n],["enter",u,n],["enter",r,n],["exit",r,n],["exit",u,n],e[e.length-2],e[e.length-1],["exit",i,n]];return e.splice(t,e.length-t+1,...a),e}function tr(e,n,t){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u=0,r;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),o}function o(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(c){if(u>999||c===93&&!r||c===null||c===91||A(c))return t(c);if(c===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return l.includes(j(i.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return A(c)||(r=!0),u++,e.consume(c),c===92?h:s}function h(c){return c===91||c===92||c===93?(e.consume(c),u++,s):s(c)}}function nr(e,n,t){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let u,r=0,a;return o;function o(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):t(p)}function h(p){if(r>999||p===93&&!a||p===null||p===91||A(p))return t(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return u=j(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return A(p)||(a=!0),r++,e.consume(p),p===92?c:h}function c(p){return p===91||p===92||p===93?(e.consume(p),r++,h):h(p)}function m(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l.includes(u)||l.push(u),v(e,g,"gfmFootnoteDefinitionWhitespace")):t(p)}function g(p){return n(p)}}function rr(e,n,t){return e.check(Zn,n,e.attempt(Jn,n,t))}function ir(e){e.exit("gfmFootnoteDefinition")}function lr(e,n,t){const i=this;return v(e,l,"gfmFootnoteDefinitionIndent",5);function l(u){const r=i.events[i.events.length-1];return r&&r[1].type==="gfmFootnoteDefinitionIndent"&&r[2].sliceSerialize(r[1],!0).length===4?n(u):t(u)}}function or(e){let t=(e||{}).singleTilde;const i={name:"strikethrough",tokenize:u,resolveAll:l};return t==null&&(t=!0),{text:{126:i},insideSpan:{null:[i]},attentionMarkers:{null:[126]}};function l(r,a){let o=-1;for(;++o<r.length;)if(r[o][0]==="enter"&&r[o][1].type==="strikethroughSequenceTemporary"&&r[o][1]._close){let s=o;for(;s--;)if(r[s][0]==="exit"&&r[s][1].type==="strikethroughSequenceTemporary"&&r[s][1]._open&&r[o][1].end.offset-r[o][1].start.offset===r[s][1].end.offset-r[s][1].start.offset){r[o][1].type="strikethroughSequence",r[s][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},r[s][1].start),end:Object.assign({},r[o][1].end)},c={type:"strikethroughText",start:Object.assign({},r[s][1].end),end:Object.assign({},r[o][1].start)},m=[["enter",h,a],["enter",r[s][1],a],["exit",r[s][1],a],["enter",c,a]],g=a.parser.constructs.insideSpan.null;g&&_(m,m.length,0,Qn(g,r.slice(s+1,o),a)),_(m,m.length,0,[["exit",c,a],["enter",r[o][1],a],["exit",r[o][1],a],["exit",h,a]]),_(r,s-1,o-s+3,m),o=s+m.length-2;break}}for(o=-1;++o<r.length;)r[o][1].type==="strikethroughSequenceTemporary"&&(r[o][1].type="data");return r}function u(r,a,o){const s=this.previous,h=this.events;let c=0;return m;function m(p){return s===126&&h[h.length-1][1].type!=="characterEscape"?o(p):(r.enter("strikethroughSequenceTemporary"),g(p))}function g(p){const b=W(s);if(p===126)return c>1?o(p):(r.consume(p),c++,g);if(c<2&&!t)return o(p);const d=r.exit("strikethroughSequenceTemporary"),k=W(p);return d._open=!k||k===2&&!!b,d._close=!b||b===2&&!!k,a(p)}}}class ur{constructor(){this.map=[]}add(n,t,i){ar(this,n,t,i)}consume(n){if(this.map.sort(function(u,r){return u[0]-r[0]}),this.map.length===0)return;let t=this.map.length;const i=[];for(;t>0;)t-=1,i.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];i.push(n.slice()),n.length=0;let l=i.pop();for(;l;){for(const u of l)n.push(u);l=i.pop()}this.map.length=0}}function ar(e,n,t,i){let l=0;if(!(t===0&&i.length===0)){for(;l<e.map.length;){if(e.map[l][0]===n){e.map[l][1]+=t,e.map[l][2].push(...i);return}l+=1}e.map.push([n,t,i])}}function sr(e,n){let t=!1;const i=[];for(;n<e.length;){const l=e[n];if(t){if(l[0]==="enter")l[1].type==="tableContent"&&i.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const u=i.length-1;i[u]=i[u]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return i}function cr(){return{flow:{null:{name:"table",tokenize:fr,resolveAll:hr}}}}function fr(e,n,t){const i=this;let l=0,u=0,r;return a;function a(f){let R=i.events.length-1;for(;R>-1;){const ue=i.events[R][1].type;if(ue==="lineEnding"||ue==="linePrefix")R--;else break}const le=R>-1?i.events[R][1].type:null,oe=le==="tableHead"||le==="tableRow"?y:o;return oe===y&&i.parser.lazy[i.now().line]?t(f):oe(f)}function o(f){return e.enter("tableHead"),e.enter("tableRow"),s(f)}function s(f){return f===124||(r=!0,u+=1),h(f)}function h(f){return f===null?t(f):P(f)?u>1?(u=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),g):t(f):S(f)?v(e,h,"whitespace")(f):(u+=1,r&&(r=!1,l+=1),f===124?(e.enter("tableCellDivider"),e.consume(f),e.exit("tableCellDivider"),r=!0,h):(e.enter("data"),c(f)))}function c(f){return f===null||f===124||A(f)?(e.exit("data"),h(f)):(e.consume(f),f===92?m:c)}function m(f){return f===92||f===124?(e.consume(f),c):c(f)}function g(f){return i.interrupt=!1,i.parser.lazy[i.now().line]?t(f):(e.enter("tableDelimiterRow"),r=!1,S(f)?v(e,p,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):p(f))}function p(f){return f===45||f===58?d(f):f===124?(r=!0,e.enter("tableCellDivider"),e.consume(f),e.exit("tableCellDivider"),b):C(f)}function b(f){return S(f)?v(e,d,"whitespace")(f):d(f)}function d(f){return f===58?(u+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(f),e.exit("tableDelimiterMarker"),k):f===45?(u+=1,k(f)):f===null||P(f)?D(f):C(f)}function k(f){return f===45?(e.enter("tableDelimiterFiller"),x(f)):C(f)}function x(f){return f===45?(e.consume(f),x):f===58?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(f),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(f))}function w(f){return S(f)?v(e,D,"whitespace")(f):D(f)}function D(f){return f===124?p(f):f===null||P(f)?!r||l!==u?C(f):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(f)):C(f)}function C(f){return t(f)}function y(f){return e.enter("tableRow"),B(f)}function B(f){return f===124?(e.enter("tableCellDivider"),e.consume(f),e.exit("tableCellDivider"),B):f===null||P(f)?(e.exit("tableRow"),n(f)):S(f)?v(e,B,"whitespace")(f):(e.enter("data"),$(f))}function $(f){return f===null||f===124||A(f)?(e.exit("data"),B(f)):(e.consume(f),f===92?Ne:$)}function Ne(f){return f===92||f===124?(e.consume(f),$):$(f)}}function hr(e,n){let t=-1,i=!0,l=0,u=[0,0,0,0],r=[0,0,0,0],a=!1,o=0,s,h,c;const m=new ur;for(;++t<e.length;){const g=e[t],p=g[1];g[0]==="enter"?p.type==="tableHead"?(a=!1,o!==0&&(ke(m,n,o,s,h),h=void 0,o=0),s={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(t,0,[["enter",s,n]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(i=!0,c=void 0,u=[0,0,0,0],r=[0,t+1,0,0],a&&(a=!1,h={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(t,0,[["enter",h,n]])),l=p.type==="tableDelimiterRow"?2:h?3:1):l&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(i=!1,r[2]===0&&(u[1]!==0&&(r[0]=r[1],c=q(m,n,u,l,void 0,c),u=[0,0,0,0]),r[2]=t)):p.type==="tableCellDivider"&&(i?i=!1:(u[1]!==0&&(r[0]=r[1],c=q(m,n,u,l,void 0,c)),u=r,r=[u[1],t,0,0])):p.type==="tableHead"?(a=!0,o=t):p.type==="tableRow"||p.type==="tableDelimiterRow"?(o=t,u[1]!==0?(r[0]=r[1],c=q(m,n,u,l,t,c)):r[1]!==0&&(c=q(m,n,r,l,t,c)),l=0):l&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(r[3]=t)}for(o!==0&&ke(m,n,o,s,h),m.consume(n.events),t=-1;++t<n.events.length;){const g=n.events[t];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=sr(n.events,t))}return e}function q(e,n,t,i,l,u){const r=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(u.end=Object.assign({},E(n.events,t[0])),e.add(t[0],0,[["exit",u,n]]));const o=E(n.events,t[1]);if(u={type:r,start:Object.assign({},o),end:Object.assign({},o)},e.add(t[1],0,[["enter",u,n]]),t[2]!==0){const s=E(n.events,t[2]),h=E(n.events,t[3]),c={type:a,start:Object.assign({},s),end:Object.assign({},h)};if(e.add(t[2],0,[["enter",c,n]]),i!==2){const m=n.events[t[2]],g=n.events[t[3]];if(m[1].end=Object.assign({},g[1].end),m[1].type="chunkText",m[1].contentType="text",t[3]>t[2]+1){const p=t[2]+1,b=t[3]-t[2]-1;e.add(p,b,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return l!==void 0&&(u.end=Object.assign({},E(n.events,l)),e.add(l,0,[["exit",u,n]]),u=void 0),u}function ke(e,n,t,i,l){const u=[],r=E(n.events,t);l&&(l.end=Object.assign({},r),u.push(["exit",l,n])),i.end=Object.assign({},r),u.push(["exit",i,n]),e.add(t+1,0,u)}function E(e,n){const t=e[n],i=t[0]==="enter"?"start":"end";return t[1][i]}const pr={name:"tasklistCheck",tokenize:gr};function mr(){return{text:{91:pr}}}function gr(e,n,t){const i=this;return l;function l(o){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?t(o):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),u)}function u(o){return A(o)?(e.enter("taskListCheckValueUnchecked"),e.consume(o),e.exit("taskListCheckValueUnchecked"),r):o===88||o===120?(e.enter("taskListCheckValueChecked"),e.consume(o),e.exit("taskListCheckValueChecked"),r):t(o)}function r(o){return o===93?(e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(o)}function a(o){return P(o)?n(o):S(o)?e.check({tokenize:kr},n,t)(o):t(o)}}function kr(e,n,t){return v(e,i,"whitespace");function i(l){return l===null?t(l):n(l)}}function br(e){return Rn([Bn(),Xn(),or(e),cr(),mr()])}const dr={};function xr(e){const n=this,t=e||dr,i=n.data(),l=i.micromarkExtensions||(i.micromarkExtensions=[]),u=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),r=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);l.push(br(t)),u.push(En()),r.push(Pn(t))}const wr=X.lazy(()=>Ue(()=>import("./index-CFEz1CGb.js"),__vite__mapDeps([0,1,2])));function yr(e){return e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,"").trim()}function zr({content:e,className:n}){const t=X.useMemo(()=>yr(e),[e]);return H.jsx(X.Suspense,{fallback:H.jsx("p",{style:{color:"var(--text-muted)"},children:"Loading viewer..."}),children:H.jsx("div",{className:n??"skill-markdown",children:H.jsx(wr,{remarkPlugins:[xr],children:t})})})}export{zr as M,te as a,M as b,W as c,Ve as d,Fr as e,v as f,Lr as g,vr as h,Sr as i,P as j,A as k,Zn as l,S as m,j as n,Ar as o,Tr as p,Rn as q,Qn as r,_ as s,De as t,Dr as u,Kt as v};
@@ -0,0 +1 @@
1
+ import{j as e,u as _,v as J,r as a,B as w,w as Q,x as X,h as Z,y as q}from"./index-CaDf51H6.js";import{H as ee}from"./header-CBzSNzdI.js";import{D as se}from"./detail-panel-C8SGLgm-.js";import{T as M}from"./tag-Q3V7Jugn.js";import{S as te}from"./search-box-CqaIZ9mR.js";function D({server:s,onClick:m}){const o=s.enabled!==!1;return e.jsxs("div",{className:"flex items-center gap-4 px-5 py-4 cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onClick:m,onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--bg-hover)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:o?"var(--status-green)":"var(--text-muted)"}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm",style:{color:"var(--text-primary)",fontWeight:510},children:s.name}),e.jsxs("p",{className:"text-xs font-mono truncate mt-0.5",style:{color:"var(--text-faint)"},children:[s.config.command,s.config.args&&s.config.args.length>0?" "+s.config.args.join(" "):""]})]}),e.jsx(M,{label:o?"Connected":"Disabled",variant:o?"green":"gray"}),e.jsx("svg",{className:"w-4 h-4 shrink-0",style:{color:"var(--text-faint)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})}function W({icon:s,label:m,count:o,children:d}){const[c,l]=a.useState(!0);return e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("button",{className:"w-full flex items-center justify-between px-5 py-3 text-left transition-colors hover:bg-bg-hover",style:{borderBottom:c?"1px solid var(--border)":"none"},onClick:()=>l(!c),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base",children:s}),e.jsx("span",{className:"text-sm font-medium",style:{color:m==="User"?"var(--accent-light)":"var(--text-muted)"},children:m}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-secondary)"},children:o})]}),e.jsx("svg",{className:"w-4 h-4 transition-transform",style:{color:"var(--text-muted)",transform:c?"rotate(0deg)":"rotate(-90deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),c&&e.jsx("div",{children:d})]})}function H(s){switch(s){case"mcp-registry":return"green";case"npm":return"blue";case"smithery":return"orange"}}function A(s){switch(s){case"mcp-registry":return"Official Registry";case"npm":return"npm";case"smithery":return"Smithery"}}function re({result:s,onInstall:m}){return e.jsx("div",{className:"rounded-lg p-5 transition-colors hover:bg-bg-hover",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("code",{className:"text-sm font-mono font-medium",style:{color:"var(--accent-light)"},children:s.name}),e.jsx(M,{label:A(s.source),variant:H(s.source)}),s.version&&e.jsx(M,{label:`v${s.version}`,variant:"gray"})]}),s.description&&e.jsx("p",{className:"text-xs mt-1 line-clamp-2",style:{color:"var(--text-secondary)"},children:s.description}),e.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[s.repositoryUrl&&e.jsx("a",{href:s.repositoryUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs underline transition-colors",style:{color:"var(--text-muted)"},onClick:o=>o.stopPropagation(),children:"Repository"}),s.npmUrl&&e.jsx("a",{href:s.npmUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs underline transition-colors",style:{color:"var(--text-muted)"},onClick:o=>o.stopPropagation(),children:"npm"})]})]}),e.jsx(w,{variant:"primary",size:"sm",onClick:()=>m(s),children:"Install"})]})})}function ae(){return e.jsx("div",{className:"space-y-3",children:[1,2,3].map(s=>e.jsx("div",{className:"rounded-lg p-5 animate-pulse",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 rounded w-48 mb-2",style:{backgroundColor:"var(--border)"}}),e.jsx("div",{className:"h-3 rounded w-full mb-1",style:{backgroundColor:"var(--border)"}}),e.jsx("div",{className:"h-3 rounded w-2/3",style:{backgroundColor:"var(--border)"}})]}),e.jsx("div",{className:"h-8 w-16 rounded-lg",style:{backgroundColor:"var(--border)"}})]})},s))})}function le({result:s,onConfirm:m,onCancel:o,installing:d,error:c}){const l=s.installCommand?s.installCommand.split(" ").slice(1):["-y",s.name],[x,u]=a.useState(s.name),[v,y]=a.useState("npx"),[h,f]=a.useState(l.join(" ")),[r,g]=a.useState([]),L=()=>{g(t=>[...t,{key:"",value:""}])},k=(t,i,p)=>{g(j=>j.map((R,C)=>C===t?{...R,[i]:p}:R))},T=t=>{g(i=>i.filter((p,j)=>j!==t))},b=()=>{const t={};for(const i of r)i.key.trim()&&(t[i.key.trim()]=i.value);m(x.trim(),v.trim(),h.trim().split(/\s+/).filter(Boolean),t)};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-50",style:{backgroundColor:"var(--overlay-bg)"},onClick:o}),e.jsxs("div",{className:"fixed z-50 rounded-lg p-6 shadow-2xl",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"480px",maxWidth:"95vw",maxHeight:"85vh",overflowY:"auto",backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},onClick:t=>t.stopPropagation(),children:[e.jsx("h2",{className:"text-lg font-medium mb-1",style:{color:"var(--text-primary)"},children:"Install MCP Server"}),e.jsx("p",{className:"text-xs mb-5",style:{color:"var(--text-muted)"},children:"This will add the server to your user-level MCP config (~/.claude/.mcp.json)."}),e.jsx("div",{className:"mb-4",children:e.jsx(M,{label:A(s.source),variant:H(s.source)})}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-xs font-medium mb-1",style:{color:"var(--text-secondary)"},children:"Server Name"}),e.jsx("input",{type:"text",value:x,onChange:t=>u(t.target.value),className:"w-full px-3 py-2 rounded-lg text-sm font-mono outline-none",style:{backgroundColor:"var(--bg-secondary)",border:"1px solid var(--card-border)",color:"var(--text-primary)"}})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-xs font-medium mb-1",style:{color:"var(--text-secondary)"},children:"Command"}),e.jsx("input",{type:"text",value:v,onChange:t=>y(t.target.value),className:"w-full px-3 py-2 rounded-lg text-sm font-mono outline-none",style:{backgroundColor:"var(--bg-secondary)",border:"1px solid var(--card-border)",color:"var(--text-primary)"}})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-xs font-medium mb-1",style:{color:"var(--text-secondary)"},children:"Arguments (space-separated)"}),e.jsx("input",{type:"text",value:h,onChange:t=>f(t.target.value),className:"w-full px-3 py-2 rounded-lg text-sm font-mono outline-none",style:{backgroundColor:"var(--bg-secondary)",border:"1px solid var(--card-border)",color:"var(--text-primary)"}})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("label",{className:"text-xs font-medium",style:{color:"var(--text-secondary)"},children:"Environment Variables"}),e.jsx("button",{className:"text-xs px-2 py-0.5 rounded transition-colors",style:{color:"var(--accent-light)",backgroundColor:"rgba(94, 106, 210, 0.1)"},onClick:L,children:"+ Add"})]}),r.length===0&&e.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"No environment variables"}),r.map((t,i)=>e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx("input",{type:"text",placeholder:"KEY",value:t.key,onChange:p=>k(i,"key",p.target.value),className:"flex-1 px-2 py-1.5 rounded text-xs font-mono outline-none",style:{backgroundColor:"var(--bg-secondary)",border:"1px solid var(--card-border)",color:"var(--accent-light)"}}),e.jsx("input",{type:"text",placeholder:"value",value:t.value,onChange:p=>k(i,"value",p.target.value),className:"flex-1 px-2 py-1.5 rounded text-xs font-mono outline-none",style:{backgroundColor:"var(--bg-secondary)",border:"1px solid var(--card-border)",color:"var(--text-secondary)"}}),e.jsx("button",{className:"text-xs px-1.5 py-1 rounded transition-colors",style:{color:"var(--status-red)"},onClick:()=>T(i),children:"x"})]},i))]}),e.jsxs("div",{className:"mb-5",children:[e.jsx("label",{className:"block text-xs font-medium mb-1",style:{color:"var(--text-muted)"},children:"Config Preview"}),e.jsx("pre",{className:"rounded-lg p-3 text-xs font-mono overflow-x-auto",style:{backgroundColor:"var(--bg-secondary)",color:"var(--text-secondary)"},children:JSON.stringify({[x||"server-name"]:{command:v,...h.trim()?{args:h.trim().split(/\s+/)}:{},...r.some(t=>t.key.trim())?{env:Object.fromEntries(r.filter(t=>t.key.trim()).map(t=>[t.key,t.value]))}:{}}},null,2)})]}),c&&e.jsx("div",{className:"rounded-lg px-3 py-2 mb-4 text-xs",style:{backgroundColor:"rgba(255, 71, 87, 0.15)",color:"var(--status-red)"},children:c}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx(w,{variant:"secondary",size:"md",onClick:o,disabled:d,children:"Cancel"}),e.jsx(w,{variant:"primary",size:"md",onClick:b,disabled:d||!x.trim()||!v.trim(),children:d?"Installing...":"Install"})]})]})]})}function ne({onInstalled:s}){const{t:m}=_(),[o,d]=a.useState(""),[c,l]=a.useState("all"),[x,u]=a.useState([]),[v,y]=a.useState([]),[h,f]=a.useState(!1),[r,g]=a.useState(!1),[L,k]=a.useState(!0),[T,b]=a.useState(!1),[t,i]=a.useState(null),[p,j]=a.useState(!1),[R,C]=a.useState(null),[E,B]=a.useState(null),S=a.useRef(null),O=a.useRef(!1);a.useEffect(()=>{O.current||(O.current=!0,k(!0),X().then(n=>{y(n.results),f(n.smitheryAvailable)}).catch(()=>{}).finally(()=>k(!1)))},[]);const z=a.useCallback(async n=>{if(!n.trim()){u([]),b(!1),g(!1);return}g(!0);try{const I=await Z(n);u(I.results),f(I.smitheryAvailable),b(!0)}catch{b(!0)}finally{g(!1)}},[]);a.useEffect(()=>{if(S.current&&clearTimeout(S.current),!o.trim()){u([]),b(!1);return}return S.current=setTimeout(()=>z(o),300),()=>{S.current&&clearTimeout(S.current)}},[o,z]),a.useEffect(()=>{if(!E)return;const n=setTimeout(()=>B(null),4e3);return()=>clearTimeout(n)},[E]);const P=o.trim().length>0,F=P?x:v,V=P?r:L,N=c==="all"?F:F.filter(n=>n.source===c),Y=async(n,I,G,$)=>{j(!0),C(null);try{await q(n,I,G,Object.keys($).length>0?$:void 0),i(null),B(`Successfully installed "${n}"`),s()}catch(U){C(U instanceof Error?U.message:"Install failed")}finally{j(!1)}},K=[{key:"all",label:"All"},{key:"mcp-registry",label:"Official Registry"},{key:"npm",label:"npm"},{key:"smithery",label:"Smithery"}];return e.jsxs("div",{children:[e.jsx("div",{className:"mb-4",children:e.jsx(te,{value:o,onChange:d,placeholder:m("config.mcp.searchStorePlaceholder")})}),e.jsx("div",{className:"flex items-center gap-2 mb-4 flex-wrap",children:K.map(n=>e.jsx("button",{className:"px-3 py-1 rounded-full text-xs font-medium transition-colors",style:{backgroundColor:c===n.key?"var(--accent)":"var(--input-bg)",color:c===n.key?"#fff":"var(--text-secondary)"},onClick:()=>l(n.key),children:n.label},n.key))}),!h&&T&&e.jsx("p",{className:"text-xs mb-4",style:{color:"var(--text-muted)"},children:"Set SMITHERY_API_KEY environment variable to enable Smithery search."}),E&&e.jsxs("div",{className:"rounded-lg px-4 py-3 mb-4 text-sm flex items-center gap-2",style:{backgroundColor:"rgba(0, 184, 148, 0.15)",color:"var(--status-green)"},children:[e.jsx("svg",{className:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),E]}),V?e.jsx(ae,{}):P&&T&&N.length===0?e.jsx("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsxs("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:["No results found for “",o,"”",c!=="all"?` in ${A(c)}`:"","."]})}):N.length>0?e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:P?`${N.length} result${N.length!==1?"s":""}`:`Top ${N.length} MCP Servers`}),N.map(n=>e.jsx(re,{result:n,onInstall:i},`${n.source}-${n.name}`))]}):e.jsxs("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("p",{className:"text-sm mb-2",style:{color:"var(--text-muted)"},children:"Search for MCP servers across npm, Official MCP Registry, and Smithery."}),e.jsx("p",{className:"text-xs",style:{color:"var(--text-faint)"},children:"Type a search term above to get started."})]}),t&&e.jsx(le,{result:t,onConfirm:Y,onCancel:()=>{i(null),C(null)},installing:p,error:R})]})}function xe(){const{t:s}=_(),{data:m,isLoading:o,mutate:d}=J(),c=m??[],[l,x]=a.useState(null),[u,v]=a.useState("installed"),y=c.filter(r=>r.source==="user"||!r.source),h=c.filter(r=>r.source==="system");async function f(r){try{await Q(r),d(),x(null)}catch(g){console.error("Failed to remove MCP server",g)}}return e.jsxs("div",{children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-bg-primary",children:[e.jsx(ee,{title:s("config.mcp.title",{n:c.length}),children:e.jsx(w,{variant:"primary",size:"md",onClick:()=>v("store"),children:s("config.mcp.install")})}),e.jsxs("div",{className:"flex items-center gap-1 mb-4",children:[e.jsx("button",{className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors",style:{backgroundColor:u==="installed"?"var(--accent)":"transparent",color:u==="installed"?"#fff":"var(--text-muted)"},onClick:()=>v("installed"),children:s("config.mcp.installed")}),e.jsx("button",{className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors",style:{backgroundColor:u==="store"?"var(--accent)":"transparent",color:u==="store"?"#fff":"var(--text-muted)"},onClick:()=>v("store"),children:s("config.mcp.store")})]})]}),u==="installed"?e.jsxs(e.Fragment,{children:[o?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):c.length===0?e.jsx("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsxs("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:["No MCP servers configured. Click “Add Server” to get started, or browse the ",e.jsx("button",{className:"underline",style:{color:"var(--accent-light)"},onClick:()=>v("store"),children:"MCP Store"}),"."]})}):e.jsxs("div",{className:"space-y-6",children:[y.length>0&&e.jsx(W,{icon:"👤",label:"User",count:y.length,children:y.map(r=>e.jsx(D,{server:r,onClick:()=>x(r)},r.name))}),h.length>0&&e.jsx(W,{icon:"🔧",label:"System",count:h.length,children:h.map(r=>e.jsx(D,{server:r,onClick:()=>x(r)},r.name))})]}),e.jsx(se,{open:l!==null,onClose:()=>x(null),title:(l==null?void 0:l.name)??"",subtitle:"MCP Server",tags:l?[{label:l.enabled!==!1?"Connected":"Disabled",variant:l.enabled!==!1?"green":"red"}]:[],actions:l&&l.source!=="system"?e.jsx(w,{variant:"danger",size:"sm",onClick:()=>f(l.name),children:"Remove"}):void 0,children:l&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Connection Config"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Command"}),e.jsx("code",{className:"text-xs font-mono",style:{color:"var(--accent-light)"},children:l.config.command})]}),l.config.args&&l.config.args.length>0&&e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Args"}),e.jsx("code",{className:"text-xs font-mono text-right",style:{color:"var(--text-secondary)"},children:l.config.args.join(" ")})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Scope"}),e.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:"Global"})]})]})]}),l.config.env&&Object.keys(l.config.env).length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Environment Variables"}),e.jsx("div",{className:"rounded-lg p-3 space-y-2",style:{backgroundColor:"var(--bg-secondary)"},children:Object.entries(l.config.env).map(([r])=>e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("code",{className:"text-xs font-mono",style:{color:"var(--accent-light)"},children:r}),e.jsx("code",{className:"text-xs font-mono",style:{color:"var(--text-muted)"},children:"--------"})]},r))})]}),e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Tools Provided"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:e.jsx(M,{label:"Tools available when connected",variant:"purple"})})]})]})})]}):e.jsx(ne,{onInstalled:()=>d()})]})}export{xe as default};
@@ -0,0 +1,2 @@
1
+ import{r as u,j as e,B as C,i as $,k as U,u as L,l as E,m as A,n as z,t as W,o as F,p as H,q as V}from"./index-CaDf51H6.js";import{H as O}from"./header-CBzSNzdI.js";import{D as B}from"./detail-panel-C8SGLgm-.js";import{S as D}from"./search-box-CqaIZ9mR.js";import{T as y}from"./tag-Q3V7Jugn.js";import{S as q}from"./select-BtWQJMup.js";import{M as G}from"./markdown-viewer-Bj8nSOSJ.js";function K({open:r,onClose:i,title:l,message:d,command:p,commandNote:m}){const[h,a]=u.useState(!1);if(!r)return null;function t(){p&&(navigator.clipboard.writeText(p),a(!0),setTimeout(()=>a(!1),2e3))}return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--overlay-bg)"},onClick:i,children:e.jsxs("div",{className:"rounded-lg p-6 w-full max-w-lg mx-4",style:{backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--card-border)",boxShadow:"rgba(0,0,0,0.4) 0px 8px 24px"},onClick:v=>v.stopPropagation(),children:[e.jsx("h3",{className:"text-lg mb-3",style:{color:"var(--text-primary)",fontWeight:510},children:l}),e.jsx("p",{className:"text-sm mb-4 whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:d}),p&&e.jsxs("div",{className:"rounded-lg p-3 mb-4 flex items-center justify-between gap-3",style:{backgroundColor:"var(--bg-secondary)",border:"1px solid var(--border)"},children:[e.jsx("code",{className:"text-sm font-mono flex-1 min-w-0 break-all",style:{color:"var(--accent-light)"},children:p}),e.jsx("button",{onClick:t,className:"shrink-0 px-3 py-1.5 rounded text-xs font-medium transition-colors hover:bg-bg-hover",style:{color:h?"var(--status-green)":"var(--text-secondary)",border:"1px solid var(--border)"},children:h?"✓ Copied":"📋 Copy"})]}),m&&e.jsx("p",{className:"text-xs mb-4",style:{color:"var(--text-muted)"},children:m}),e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(C,{variant:"primary",size:"md",onClick:i,children:"Got it"})})]})})}function _({plugin:r,onClick:i}){return e.jsxs("div",{className:"flex items-center gap-4 px-5 py-4 cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onClick:i,onMouseEnter:l=>{l.currentTarget.style.backgroundColor="var(--bg-hover)"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="transparent"},children:[e.jsx("div",{className:"w-9 h-9 rounded-lg shrink-0 flex items-center justify-center text-white text-sm font-medium",style:{backgroundColor:"var(--accent)"},children:r.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm",style:{color:"var(--text-primary)",fontWeight:510},children:r.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[e.jsx(y,{label:`v${r.version}`,variant:"gray"}),e.jsx(y,{label:r.marketplace,variant:"blue"}),r.enabled?e.jsx(y,{label:"Enabled",variant:"green"}):e.jsx(y,{label:"Disabled",variant:"red"})]})]}),e.jsx("svg",{className:"w-4 h-4 shrink-0",style:{color:"var(--text-faint)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})}function J(r){return r.type==="http"?`# HTTP MCP server — connect via an MCP client:
2
+ # url: ${r.url??""}`:[r.command??"",...r.args??[]].filter(Boolean).join(" ")}function T({text:r,label:i="Copy"}){const[l,d]=u.useState(!1),p=m=>{m.stopPropagation(),navigator.clipboard.writeText(r),d(!0),window.setTimeout(()=>d(!1),1500)};return e.jsxs("button",{onClick:p,className:"inline-flex items-center gap-1 rounded px-2 py-1 transition-colors hover:bg-bg-hover",style:{fontSize:"11px",color:l?"var(--status-green)":"var(--text-muted)",border:"1px solid var(--card-border)"},title:l?"Copied!":r,children:[l?e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):e.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),l?"Copied":i]})}function R({primary:r,secondary:i,onClick:l}){return e.jsxs("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l())},className:"rounded-lg px-3 py-2 cursor-pointer transition-colors hover:bg-bg-hover",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("code",{className:"text-xs font-mono font-medium",style:{color:"var(--text-primary)"},children:r}),i&&e.jsx("p",{className:"text-xs mt-1 line-clamp-3",style:{color:"var(--text-secondary)"},children:i.replace(/^"|"$/g,"")})]})}function S({title:r,count:i,children:l}){return e.jsxs("section",{children:[e.jsxs("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3 flex items-center gap-2",style:{color:"var(--text-muted)"},children:[r,e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-secondary)"},children:i})]}),l]})}function Q({preview:r,pluginName:i,onClose:l}){const[d,p]=u.useState(null),[m,h]=u.useState(!0);return u.useEffect(()=>{let a=!1;return h(!0),p(null),U(r.filePath).then(({content:t})=>{a||p(t)}).catch(()=>{a||p("*Failed to load content*")}).finally(()=>{a||h(!1)}),()=>{a=!0}},[r.filePath]),u.useEffect(()=>{const a=t=>{t.key==="Escape"&&l()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[l]),e.jsxs("div",{className:"fixed inset-0 flex flex-col",style:{backgroundColor:"var(--bg-primary)",zIndex:60},children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 shrink-0 gap-3",style:{borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-secondary)"},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("code",{className:"text-base font-mono font-medium truncate",style:{color:"var(--accent-light)"},children:r.kind==="command"?`/${r.name}`:r.name}),e.jsx(y,{label:r.kind==="command"?"Command":"Skill",variant:"blue"}),e.jsx(y,{label:i,variant:"gray"}),e.jsx(y,{label:"Read-only",variant:"orange"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsx("code",{className:"text-xs font-mono hidden lg:block",style:{color:"var(--text-muted)"},children:r.filePath}),e.jsx("button",{className:"w-8 h-8 rounded-lg flex items-center justify-center transition-colors hover:bg-bg-hover",style:{color:"var(--text-secondary)"},onClick:l,"aria-label":"Close preview",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto px-8 py-6",children:m?e.jsx("div",{className:"max-w-4xl mx-auto text-center py-12",children:e.jsx("p",{style:{color:"var(--text-muted)"},children:"Loading content..."})}):e.jsx(G,{content:d??"*No content available*",className:"max-w-4xl mx-auto skill-markdown"})})]})}function X({pluginName:r}){const[i,l]=u.useState(null),[d,p]=u.useState(!0),[m,h]=u.useState(null),[a,t]=u.useState(null);if(u.useEffect(()=>{let s=!1;return p(!0),h(null),l(null),t(null),fetch(`/api/plugins/${encodeURIComponent(r)}/contents`).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}).then(n=>{s||l(n)}).catch(n=>{s||h(String(n))}).finally(()=>{s||p(!1)}),()=>{s=!0}},[r]),d)return e.jsx("div",{className:"space-y-3",children:[0,1,2].map(s=>e.jsx("div",{className:"rounded-lg h-14 animate-pulse",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"}},s))});if(m||!i)return e.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["Could not load plugin contents",m?` (${m})`:"","."]});const{commands:v,skills:f,mcpServers:x}=i;return v.length>0||f.length>0||x.length>0?e.jsxs(e.Fragment,{children:[v.length>0&&e.jsx(S,{title:"Commands",count:v.length,children:e.jsx("div",{className:"space-y-2",children:v.map(s=>e.jsx(R,{primary:`/${s.name}`,secondary:s.description,onClick:()=>t({kind:"command",name:s.name,filePath:s.filePath})},s.filePath))})}),f.length>0&&e.jsx(S,{title:"Skills",count:f.length,children:e.jsx("div",{className:"space-y-2",children:f.map(s=>e.jsx(R,{primary:s.name,secondary:s.description,onClick:()=>t({kind:"skill",name:s.name,filePath:s.filePath})},s.filePath))})}),x.length>0&&e.jsx(S,{title:"MCP Servers",count:x.length,children:e.jsx("div",{className:"space-y-2",children:x.map(s=>{const n=J(s);return e.jsxs("div",{className:"rounded-lg px-3 py-2 space-y-2",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("code",{className:"text-xs font-mono font-medium",style:{color:"var(--text-primary)"},children:s.name}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:"var(--border)",color:"var(--text-secondary)"},children:s.type})]}),s.type==="stdio"&&n&&e.jsx(T,{text:n,label:"Copy"}),s.type==="http"&&s.url&&e.jsx(T,{text:s.url,label:"Copy URL"})]}),e.jsx("code",{className:"block text-xs font-mono px-2 py-1.5 rounded break-all whitespace-pre-wrap",style:{backgroundColor:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:s.type==="http"?s.url:n}),e.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Run this in your terminal to inspect the server's tools and prompts."})]},s.name)})})}),a&&$.createPortal(e.jsx(Q,{preview:a,pluginName:r,onClose:()=>t(null)}),document.body)]}):e.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"This plugin does not expose any commands, skills, or MCP servers."})}function Y(){const{t:r}=L(),{data:i,isLoading:l,mutate:d}=E(),p=i??[],[m,h]=u.useState(""),[a,t]=u.useState(null),[v,f]=u.useState({}),[x,k]=u.useState(null),s=p.filter(o=>o.name.toLowerCase().includes(m.toLowerCase()));async function n(o){try{await F(o),d(),t(null)}catch(b){console.error("Failed to remove plugin",b)}}async function w(o){try{await W(o.name,!o.enabled),d(),t({...o,enabled:!o.enabled})}catch(b){console.error("Failed to toggle plugin",b)}}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(D,{value:m,onChange:h,placeholder:r("config.plugins.searchInstalledPlaceholder")})}),l?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):s.length===0?e.jsx("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:m?"No plugins match your search.":"No plugins installed."})}):e.jsx("div",{className:"space-y-6",children:Object.entries(s.reduce((o,b)=>{const N=b.marketplace||"unknown";return o[N]||(o[N]=[]),o[N].push(b),o},{})).map(([o,b])=>{const N=v[o];return e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("button",{className:"w-full flex items-center justify-between px-5 py-3 text-left transition-colors hover:bg-bg-hover",style:{borderBottom:N?"none":"1px solid var(--border)"},onClick:()=>f(c=>({...c,[o]:!c[o]})),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",style:{color:"var(--accent-light)"},children:o}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-secondary)"},children:b.length})]}),e.jsx("svg",{className:"w-4 h-4 transition-transform",style:{color:"var(--text-muted)",transform:N?"rotate(-90deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),!N&&e.jsx("div",{children:b.map(c=>e.jsx(_,{plugin:c,onClick:()=>t(c)},c.name))})]},o)})}),e.jsx(B,{open:a!==null,onClose:()=>t(null),title:(a==null?void 0:a.name)??"",subtitle:a==null?void 0:a.marketplace,icon:e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center text-text-primary text-sm font-medium",style:{background:"linear-gradient(135deg, var(--accent), var(--accent-light))"},children:a==null?void 0:a.name.charAt(0).toUpperCase()}),tags:a?[{label:`v${a.version}`,variant:"gray"},{label:a.marketplace,variant:"blue"},{label:a.enabled?"Enabled":"Disabled",variant:a.enabled?"green":"red"}]:[],actions:a?e.jsxs(e.Fragment,{children:[e.jsx(C,{variant:"secondary",size:"sm",title:"Dashboard cannot fetch marketplace updates. Run `/plugin marketplace update` in Claude Code — command copied to clipboard.",onClick:()=>{const o=`/plugin marketplace update ${a.marketplace}`;navigator.clipboard.writeText(o),k({title:"Check for Updates",message:"Dashboard cannot fetch marketplace updates directly — this runs in Claude Code.",command:o,commandNote:"The command has been copied to your clipboard. Paste it into Claude Code to refresh this marketplace."})},children:"Check Updates"}),e.jsx(C,{variant:"secondary",size:"sm",onClick:()=>w(a),children:a.enabled?"Disable":"Enable"}),e.jsx(C,{variant:"danger",size:"sm",onClick:()=>n(a.name),children:"Remove"})]}):void 0,children:a&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Metadata"}),e.jsx("div",{className:"space-y-2",children:[{label:"Marketplace",value:a.marketplace},{label:"Installed",value:new Date(a.installedAt).toLocaleDateString()},{label:"Last Updated",value:new Date(a.lastUpdated).toLocaleDateString()},{label:"Install Path",value:a.installPath}].map(({label:o,value:b})=>e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:o}),e.jsx("span",{className:"text-xs text-right break-all font-mono",style:{color:"var(--text-secondary)",maxWidth:"240px"},children:b})]},o))})]}),e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Status"}),e.jsx("div",{className:"flex gap-2",children:e.jsx(y,{label:a.enabled?"Enabled":"Disabled",variant:a.enabled?"green":"red"})})]}),e.jsx(X,{pluginName:a.name})]})}),e.jsx(K,{open:x!==null,onClose:()=>k(null),title:(x==null?void 0:x.title)??"",message:(x==null?void 0:x.message)??"",command:x==null?void 0:x.command,commandNote:x==null?void 0:x.commandNote})]})}function Z(){const{t:r}=L(),{data:i,isLoading:l}=A(),d=i??[],[p,m]=u.useState(null),[h,a]=u.useState(""),[t,v]=u.useState(null),[f,x]=u.useState(!1),k=p??(d.length>0?d[0].name:null),{data:s,isLoading:n}=z(k),o=(s??[]).filter(c=>c.name.toLowerCase().includes(h.toLowerCase())||c.description.toLowerCase().includes(h.toLowerCase())||(c.category??"").toLowerCase().includes(h.toLowerCase())),b=o.reduce((c,j)=>{const g=j.category||"other";return c[g]||(c[g]=[]),c[g].push(j),c},{}),N=Object.entries(b).sort(([c],[j])=>c.localeCompare(j));return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-56",children:e.jsx(q,{value:k??"",onChange:c=>{m(c),a(""),v(null)},options:d.length===0?[{value:"",label:"No marketplaces"}]:d.map(c=>({value:c.name,label:c.name})),placeholder:r("config.plugins.marketplaceSelectPlaceholder"),disabled:l||d.length===0})}),e.jsx("div",{className:"flex-1",children:e.jsx(D,{value:h,onChange:a,placeholder:r("config.plugins.searchAvailablePlaceholder")})}),o.length>0&&e.jsxs("span",{className:"text-xs shrink-0",style:{color:"var(--text-muted)"},children:[o.length," plugin",o.length!==1?"s":""]})]}),n||l?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):k?o.length===0?e.jsx("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:h?"No plugins match your search.":"No plugins found in this marketplace."})}):e.jsx("div",{className:"space-y-4",children:N.map(([c,j])=>e.jsxs("div",{children:[e.jsxs("h3",{className:"text-xs font-medium uppercase tracking-wider mb-2 px-1",style:{color:"var(--text-muted)"},children:[c," (",j.length,")"]}),e.jsx("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:j.map((g,I)=>e.jsxs("div",{className:"flex items-center gap-4 px-5 py-4 cursor-pointer transition-colors hover:bg-bg-hover",style:{borderBottom:I<j.length-1?"1px solid var(--border)":"none"},onClick:()=>v(g),children:[e.jsx("div",{className:"w-9 h-9 rounded-lg shrink-0 flex items-center justify-center text-text-primary text-sm font-medium",style:{background:g.installed?"linear-gradient(135deg, var(--status-green), #4ade80)":"linear-gradient(135deg, var(--accent), var(--accent-hover))"},children:g.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-primary)"},children:g.name}),g.installed?e.jsx(y,{label:"Installed",variant:"green"}):e.jsx(y,{label:"Available",variant:"blue"}),g.installed&&g.enabled&&e.jsx(y,{label:"Enabled",variant:"green"})]}),e.jsx("p",{className:"text-xs mt-1 line-clamp-2",style:{color:"var(--text-secondary)"},children:g.description||"No description available."})]}),!g.installed&&e.jsxs("code",{className:"text-xs font-mono px-2 py-1 rounded shrink-0 cursor-pointer inline-flex items-center gap-1.5 transition-colors hover:opacity-80",style:{backgroundColor:"var(--bg-secondary)",color:"var(--accent-light)",border:"1px solid var(--border)"},title:"Click to copy",onClick:M=>{M.stopPropagation(),navigator.clipboard.writeText(`/plugin install ${g.name}@${k}`);const P=M.currentTarget;P.style.color="var(--status-green)",setTimeout(()=>{P.style.color="var(--accent-light)"},1e3)},children:["/plugin install ",g.name,"@",k,e.jsxs("svg",{className:"w-3 h-3 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:[e.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),e.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]})]}),e.jsx("svg",{className:"w-4 h-4 shrink-0",style:{color:"var(--text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]},g.name))})]},c))}):e.jsx("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:'No marketplaces configured. Add one in the "Manage Marketplaces" tab.'})}),e.jsx(B,{open:t!==null,onClose:()=>v(null),title:(t==null?void 0:t.name)??"",subtitle:t==null?void 0:t.marketplace,icon:e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center text-text-primary text-sm font-medium",style:{background:t!=null&&t.installed?"linear-gradient(135deg, var(--status-green), #4ade80)":"linear-gradient(135deg, var(--accent), var(--accent-hover))"},children:t==null?void 0:t.name.charAt(0).toUpperCase()}),tags:t?[{label:`v${t.version}`,variant:"gray"},{label:t.marketplace,variant:"blue"},{label:t.installed?"Installed":"Available",variant:t.installed?"green":"blue"},...t.category?[{label:t.category,variant:"purple"}]:[]]:[],actions:t&&!t.installed?e.jsx(C,{variant:"primary",size:"sm",title:"Plugin install must be run inside Claude Code. The command is copied to your clipboard.",onClick:()=>{const c=`/plugin install ${t.name}@${t.marketplace}`;navigator.clipboard.writeText(c),x(!0),setTimeout(()=>x(!1),2e3)},children:f?"Copied!":"Copy Install Command"}):void 0,children:t&&e.jsxs("div",{className:"space-y-5",children:[e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Description"}),e.jsx("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:t.description||"No description available."})]}),e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Details"}),e.jsx("div",{className:"space-y-2",children:[{label:"Version",value:t.version},{label:"Marketplace",value:t.marketplace},...t.category?[{label:"Category",value:t.category}]:[],...t.homepage?[{label:"Homepage",value:t.homepage}]:[]].map(({label:c,value:j})=>e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:c}),c==="Homepage"?e.jsx("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-right break-all font-mono hover:underline",style:{color:"var(--accent-hover)",maxWidth:"240px"},children:j}):e.jsx("span",{className:"text-xs text-right break-all font-mono",style:{color:"var(--text-secondary)",maxWidth:"240px"},children:j})]},c))})]}),!t.installed&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Installation"}),e.jsxs("div",{className:"rounded-lg p-3",style:{backgroundColor:"var(--bg-secondary)"},children:[e.jsx("p",{className:"text-xs mb-2",style:{color:"var(--text-secondary)"},children:"Run this command in Claude Code to install:"}),e.jsxs("code",{className:"text-xs block font-mono px-2 py-1 rounded",style:{backgroundColor:"var(--border)",color:"var(--accent-light)"},children:["/plugin install ",t.name,"@",t.marketplace]})]})]})]})})]})}function ee(){const{data:r,isLoading:i,mutate:l}=A(),d=r??[],[p,m]=u.useState(""),[h,a]=u.useState(""),[t,v]=u.useState(null),[f,x]=u.useState(!1);async function k(){if(!p.trim()||!h.trim()){v("Both name and repository are required.");return}v(null),x(!0);try{await H(p.trim(),h.trim()),l(),m(""),a("")}catch(n){v(n instanceof Error?n.message:"Failed to add marketplace")}finally{x(!1)}}async function s(n){try{await V(n),l()}catch(w){console.error("Failed to remove marketplace",w)}}return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-lg p-5 mb-6",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("h3",{className:"text-sm font-medium mb-4",style:{color:"var(--text-primary)"},children:"Add Marketplace"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs block mb-1",style:{color:"var(--text-muted)"},children:"Name"}),e.jsx("input",{type:"text",value:p,onChange:n=>m(n.target.value),placeholder:"e.g., my-plugins",className:"w-full px-3 py-2 rounded-lg text-sm outline-none",style:{backgroundColor:"var(--border)",border:"1px solid var(--input-border)",color:"var(--text-primary)"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs block mb-1",style:{color:"var(--text-muted)"},children:"GitHub Repository"}),e.jsx("input",{type:"text",value:h,onChange:n=>a(n.target.value),placeholder:"e.g., owner/repo-name",className:"w-full px-3 py-2 rounded-lg text-sm outline-none",style:{backgroundColor:"var(--border)",border:"1px solid var(--input-border)",color:"var(--text-primary)"}})]}),t&&e.jsx("p",{className:"text-xs",style:{color:"var(--status-red)"},children:t}),e.jsx(C,{variant:"primary",size:"md",onClick:k,disabled:f,children:f?"Adding...":"Add Marketplace"})]}),e.jsxs("p",{className:"text-xs mt-3",style:{color:"var(--text-muted)"},children:["Note: Adding a marketplace here only registers it. To clone the repository, run ",e.jsx("code",{style:{color:"var(--accent-light)"},children:"/marketplace add"})," in Claude Code."]})]}),e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider mb-3",style:{color:"var(--text-muted)"},children:"Registered Marketplaces"}),i?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):d.length===0?e.jsx("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No marketplaces registered."})}):e.jsx("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:d.map((n,w)=>e.jsxs("div",{className:"flex items-center gap-4 px-5 py-4",style:{borderBottom:w<d.length-1?"1px solid var(--border)":"none"},children:[e.jsx("div",{className:"w-9 h-9 rounded-lg shrink-0 flex items-center justify-center text-text-primary text-sm font-medium",style:{background:"linear-gradient(135deg, var(--text-secondary), var(--accent-hover))"},children:n.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-primary)"},children:n.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[e.jsx(y,{label:n.source.repo,variant:"blue"}),e.jsx(y,{label:n.source.source,variant:"gray"}),e.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:["Updated: ",new Date(n.lastUpdated).toLocaleDateString()]})]})]}),e.jsx(C,{variant:"danger",size:"sm",onClick:()=>s(n.name),children:"Remove"})]},n.name))})]})}function ce(){const{t:r}=L(),[i,l]=u.useState("installed"),{data:d}=E(),p=(d??[]).length;return e.jsxs("div",{children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-bg-primary",children:[e.jsx(O,{title:r("config.plugins.title",{n:p})}),e.jsx("div",{className:"flex items-center gap-1 mb-4",children:[{id:"installed",label:r("config.plugins.installed")},{id:"marketplace",label:r("config.plugins.marketplace")},{id:"manage",label:r("config.plugins.manageMarketplaces")}].map(({id:m,label:h})=>e.jsx("button",{className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors",style:{backgroundColor:i===m?"var(--accent)":"transparent",color:i===m?"#fff":"var(--text-muted)"},onClick:()=>l(m),children:h},m))})]}),i==="installed"&&e.jsx(Y,{}),i==="marketplace"&&e.jsx(Z,{}),i==="manage"&&e.jsx(ee,{})]})}export{ce as default};
@@ -0,0 +1,2 @@
1
+ import{j as e,B as h,r as m,I as S,J as L,b as D,u as R,K as E,L as O,M as W}from"./index-CaDf51H6.js";import{H as z}from"./header-CBzSNzdI.js";import{T as C}from"./tag-Q3V7Jugn.js";import{S as A}from"./select-BtWQJMup.js";function I({open:r,onClose:s,onConfirm:p,title:o,message:x,confirmLabel:c="Confirm",variant:n="danger"}){return r?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--overlay-bg)"},onClick:s,children:e.jsxs("div",{className:"rounded-lg p-6 w-full max-w-md mx-4",style:{backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--card-border)",boxShadow:"rgba(0,0,0,0.4) 0px 2px 4px"},onClick:d=>d.stopPropagation(),children:[e.jsx("h3",{className:"text-lg mb-2",style:{color:"var(--text-primary)",fontWeight:510},children:o}),e.jsx("p",{className:"text-sm mb-6",style:{color:"var(--text-secondary)"},children:x}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx(h,{variant:"ghost",size:"md",onClick:s,children:"Cancel"}),e.jsx(h,{variant:n,size:"md",onClick:p,children:c})]})]})}):null}function F({profile:r,onActivate:s,onExport:p,onDelete:o}){var n,d;const x=((n=r.plugins)==null?void 0:n.length)??0,c=Object.keys(r.mcpServers??{}).length;return e.jsxs("div",{className:"rounded-lg p-5 flex flex-col gap-4",style:{backgroundColor:"var(--card-bg)",border:r.active?"1px solid var(--accent)":"1px solid var(--card-border)"},children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-medium text-base shrink-0",style:{backgroundColor:"var(--accent)"},children:r.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm",style:{color:"var(--text-primary)",fontWeight:510},children:r.name}),e.jsxs("p",{className:"text-xs mt-0.5",style:{color:"var(--text-faint)"},children:["Created ",new Date(r.createdAt).toLocaleDateString()]})]})]}),r.active&&e.jsx(C,{label:"Active",variant:"green"})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx(C,{label:`${x} plugins`,variant:"purple"}),e.jsx(C,{label:`${c} MCPs`,variant:"blue"}),((d=r.commands)==null?void 0:d.length)>0&&e.jsx(C,{label:`${r.commands.length} commands`,variant:"gray"})]}),r.description&&e.jsx("p",{className:"text-xs",style:{color:"var(--text-secondary)"},children:r.description}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx(h,{variant:r.active?"ghost":"primary",size:"sm",onClick:s,disabled:r.active,children:r.active?"Active":"Activate"}),e.jsx(h,{variant:"secondary",size:"sm",onClick:p,children:"Export"}),e.jsx(h,{variant:"danger",size:"sm",onClick:o,children:"Delete"})]})]})}function T({profiles:r}){const[s,p]=m.useState(""),[o,x]=m.useState("json"),[c,n]=m.useState(!1),[d,u]=m.useState({plugins:!0,mcpServers:!0,commands:!0,settings:!0,credentials:!1});function v(t){u(a=>({...a,[t]:!a[t]}))}async function f(){if(s){n(!0);try{const{data:t}=await S(s),a=new Blob([t],{type:o==="json"?"application/json":"text/yaml"}),i=URL.createObjectURL(a),j=document.createElement("a");j.href=i,j.download=`${s}-export.${o}`,j.click(),URL.revokeObjectURL(i)}catch(t){console.error("Export failed",t)}finally{n(!1)}}}const b=[{value:"",label:"Select a profile..."},...r.map(t=>({value:t.name,label:t.name}))];return e.jsxs("div",{className:"rounded-lg p-5 h-full",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("h2",{className:"text-base mb-4",style:{color:"var(--text-primary)",fontWeight:510},children:"Export"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-xs uppercase tracking-wider mb-2",style:{color:"var(--text-muted)",fontWeight:510},children:"Profile"}),e.jsx(A,{value:s,onChange:p,options:b,placeholder:"Select a profile..."})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-xs uppercase tracking-wider mb-2",style:{color:"var(--text-muted)",fontWeight:510},children:"Include"}),e.jsx("div",{className:"space-y-2",children:Object.keys(d).map(t=>e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:d[t],onChange:()=>v(t),className:"w-4 h-4 rounded",style:{accentColor:"var(--accent)"}}),e.jsx("span",{className:"text-sm capitalize",style:{color:"var(--text-secondary)"},children:t==="mcpServers"?"MCP Servers":t}),t==="credentials"&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(255, 71, 87, 0.15)",color:"var(--status-red)"},children:"sensitive"})]},t))})]}),e.jsxs("div",{className:"mb-5",children:[e.jsx("label",{className:"block text-xs uppercase tracking-wider mb-2",style:{color:"var(--text-muted)",fontWeight:510},children:"Format"}),e.jsx("div",{className:"flex gap-2",children:["json","yaml"].map(t=>e.jsx("button",{onClick:()=>x(t),className:"px-4 py-1.5 rounded-md text-sm transition-colors",style:{backgroundColor:o===t?"var(--accent)":"var(--input-bg)",color:o===t?"#fff":"var(--text-secondary)",border:o===t?"none":"1px solid var(--card-border)",fontWeight:510},children:t.toUpperCase()},t))})]}),e.jsx(h,{variant:"primary",size:"md",onClick:f,disabled:!s||c,children:c?"Exporting...":"Export to File"})]})}function U(){const[r,s]=m.useState(null),[p,o]=m.useState(null),[x,c]=m.useState(null),[n,d]=m.useState(!1),[u,v]=m.useState(!1),[f,b]=m.useState(null),t=m.useRef(null);function a(l){o(l.name);const g=new FileReader;g.onload=N=>{var w;const k=(w=N.target)==null?void 0:w.result;s(k);try{const P=JSON.parse(k);c(P)}catch{c({raw:k.slice(0,200)})}},g.readAsText(l)}function i(l){l.preventDefault(),d(!1);const g=l.dataTransfer.files[0];g&&a(g)}function j(l){var N;const g=(N=l.target.files)==null?void 0:N[0];g&&a(g)}async function y(l){if(r){v(!0),b(null);try{await L(r,l),b(`Import successful (${l} strategy applied).`)}catch(g){b(`Import failed: ${g.message}`)}finally{v(!1)}}}return e.jsxs("div",{className:"rounded-lg p-5 h-full",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("h2",{className:"text-base mb-4",style:{color:"var(--text-primary)",fontWeight:510},children:"Import"}),e.jsxs("div",{className:"rounded-lg border-2 border-dashed p-8 text-center mb-4 cursor-pointer transition-colors",style:{borderColor:n?"var(--accent)":"var(--card-border)",backgroundColor:n?"rgba(94, 106, 210, 0.05)":"transparent"},onDragOver:l=>{l.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:i,onClick:()=>{var l;return(l=t.current)==null?void 0:l.click()},children:[e.jsx("input",{ref:t,type:"file",accept:".json,.yaml,.yml",className:"hidden",onChange:j}),e.jsx("svg",{className:"w-8 h-8 mx-auto mb-2",style:{color:"var(--text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),p?e.jsx("p",{className:"text-sm",style:{color:"var(--accent-light)",fontWeight:510},children:p}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm",style:{color:"var(--text-secondary)",fontWeight:510},children:"Drop JSON or YAML file here"}),e.jsx("p",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:"or click to browse"})]})]}),x&&e.jsxs("div",{className:"mb-4",children:[e.jsx("h3",{className:"text-xs uppercase tracking-wider mb-2",style:{color:"var(--text-muted)",fontWeight:510},children:"Preview"}),e.jsxs("pre",{className:"text-xs rounded-lg p-3 overflow-auto max-h-48 whitespace-pre-wrap",style:{backgroundColor:"var(--bg-secondary)",color:"var(--text-secondary)"},children:[JSON.stringify(x,null,2).slice(0,600),JSON.stringify(x,null,2).length>600?`
2
+ ...`:""]})]}),f&&e.jsx("div",{className:"rounded-lg px-4 py-2.5 mb-4 text-sm",style:{backgroundColor:f.includes("failed")?"rgba(255, 71, 87, 0.1)":"rgba(39, 166, 68, 0.1)",color:f.includes("failed")?"var(--status-red)":"var(--status-green)"},children:f}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(h,{variant:"secondary",size:"md",onClick:()=>y("merge"),disabled:!r||u,children:u?"Importing...":"Merge (keep existing)"}),e.jsx(h,{variant:"primary",size:"md",onClick:()=>y("replace"),disabled:!r||u,children:"Replace All"})]})]})}function H(){const r=D(),{t:s}=R(),{data:p,isLoading:o,mutate:x}=E(),c=p??[],[n,d]=m.useState("profiles"),[u,v]=m.useState(null);async function f(a){try{await O(a),x()}catch(i){console.error("Failed to activate profile",i)}}async function b(a){try{await W(a),x(),v(null)}catch(i){console.error("Failed to delete profile",i)}}async function t(a){try{const{data:i}=await S(a),j=new Blob([i],{type:"application/json"}),y=URL.createObjectURL(j),l=document.createElement("a");l.href=y,l.download=`${a}-profile.json`,l.click(),URL.revokeObjectURL(y)}catch(i){console.error("Failed to export profile",i)}}return e.jsxs("div",{children:[e.jsx(z,{title:s("profiles.title"),children:n==="profiles"&&c.length>0&&e.jsx(h,{variant:"primary",size:"md",onClick:()=>r("/config"),children:s("profiles.saveCurrent")})}),e.jsx("div",{className:"flex items-center gap-1 mb-6 p-1 rounded-lg",style:{backgroundColor:"var(--bg-tertiary)"},children:[{id:"profiles",label:s("profiles.tabs.profiles")},{id:"export-import",label:s("profiles.tabs.exportImport")}].map(({id:a,label:i})=>e.jsx("button",{className:"px-4 py-2 rounded-md text-sm transition-colors",style:{backgroundColor:n===a?"var(--accent)":"transparent",color:n===a?"#fff":"var(--text-muted)",fontWeight:n===a?510:400},onClick:()=>d(a),children:i},a))}),n==="export-import"?o?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsx(T,{profiles:c}),e.jsx(U,{})]}):o?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):c.length===0?e.jsxs("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--border, var(--card-border))"},children:[e.jsx("h3",{className:"text-base mb-2",style:{color:"var(--text-primary)",fontWeight:510},children:s("profiles.emptyTitle")}),e.jsx("p",{className:"text-sm mb-6",style:{color:"var(--text-muted)"},children:s("profiles.emptyBody")}),e.jsx(h,{variant:"primary",size:"md",onClick:()=>r("/config"),children:s("profiles.saveCurrent")})]}):e.jsx("div",{className:"grid grid-cols-2 gap-4",children:c.map(a=>e.jsx(F,{profile:a,onActivate:()=>f(a.name),onExport:()=>t(a.name),onDelete:()=>v(a.name)},a.name))}),e.jsx(I,{open:u!==null,onClose:()=>v(null),onConfirm:()=>u&&b(u),title:"Delete Profile",message:`Are you sure you want to delete profile "${u}"? This action cannot be undone.`,confirmLabel:"Delete",variant:"danger"})]})}export{H as default};
@@ -0,0 +1 @@
1
+ import{u as w,f as R,r as n,g as P,j as e,s as M,h as L}from"./index-CaDf51H6.js";import{H as E}from"./header-CBzSNzdI.js";import{T as b}from"./tag-Q3V7Jugn.js";import{S as I}from"./search-box-CqaIZ9mR.js";const $={plugin:"🧩",mcp:"🔌",skill:"⚡"},A={Trending:"green",Popular:"blue",New:"purple",Rising:"orange"},F=["All","Plugins","MCP Servers","Skills"],k=["development","productivity","database","ai","devops","testing","documentation"];function T({label:t,active:r,onClick:d}){return e.jsx("button",{className:"px-3 py-1.5 rounded-lg text-xs font-medium transition-colors",style:{backgroundColor:r?"var(--accent)":"var(--bg-tertiary)",color:r?"#fff":"var(--text-muted)",border:r?"none":"1px solid var(--border)"},onClick:d,children:t})}function C({rec:t}){const[r,d]=n.useState(!1),c=n.useCallback(()=>{t.installCommand&&navigator.clipboard.writeText(t.installCommand).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})},[t.installCommand]),o=$[t.type]??"📦",y=A[t.popularity]??"gray";return e.jsxs("div",{className:"rounded-lg p-5 flex flex-col gap-3",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-lg shrink-0",children:o}),e.jsx("span",{className:"font-mono text-sm font-medium truncate",style:{color:"var(--accent-light)"},children:t.name})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(b,{label:t.popularity,variant:y}),t.category&&e.jsx(b,{label:t.category,variant:"gray"})]})]}),e.jsx("p",{className:"text-sm leading-relaxed",style:{color:"var(--text-secondary)"},children:t.description}),e.jsx("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)",fontStyle:"italic"},children:t.reason}),e.jsxs("div",{className:"flex items-center gap-2 mt-auto pt-1",children:[t.installCommand&&e.jsx("button",{className:"px-3 py-1.5 rounded-lg text-xs font-medium transition-colors",style:{backgroundColor:r?"var(--status-green)":"var(--accent)",color:"#fff"},onClick:c,children:r?"Copied!":"Copy Install"}),t.url&&e.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"px-3 py-1.5 rounded-lg text-xs font-medium transition-colors",style:{backgroundColor:"var(--bg-tertiary)",color:"var(--text-secondary)",border:"1px solid var(--border)",textDecoration:"none"},children:"View"}),e.jsx("span",{className:"ml-auto text-xs px-2 py-0.5 rounded",style:{backgroundColor:"var(--bg-tertiary)",color:"var(--text-muted)"},children:t.type})]})]})}function V({result:t}){const[r,d]=n.useState(!1),c=n.useCallback(()=>{t.installCommand&&navigator.clipboard.writeText(t.installCommand).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})},[t.installCommand]),o={"skills.sh":"purple","mcp-registry":"green",npm:"blue",smithery:"orange"};return e.jsx("div",{className:"rounded-lg p-4 transition-colors hover:bg-bg-hover",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("div",{className:"flex items-start justify-between gap-3",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("code",{className:"text-sm font-mono font-medium",style:{color:"var(--accent-light)"},children:t.name}),e.jsx(b,{label:t.source,variant:o[t.source]??"gray"}),t.badge&&e.jsx(b,{label:t.badge,variant:"blue"})]}),t.description&&e.jsx("p",{className:"text-xs mt-1 line-clamp-2",style:{color:"var(--text-secondary)"},children:t.description}),t.installCommand&&e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx("code",{className:"text-xs font-mono px-2 py-1 rounded",style:{backgroundColor:"var(--bg-secondary)",color:"var(--text-secondary)"},children:t.installCommand}),e.jsx("button",{className:"p-1 rounded transition-colors hover:bg-bg-hover shrink-0",style:{color:r?"var(--status-green)":"var(--text-muted)"},onClick:c,title:"Copy install command",children:r?e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),t.url&&e.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs underline mt-1 inline-block transition-colors",style:{color:"var(--text-muted)"},children:"View"})]})})})}function _(){return e.jsx("div",{className:"space-y-3",children:[1,2,3].map(t=>e.jsx("div",{className:"rounded-lg p-4 animate-pulse",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("div",{className:"flex items-start gap-3",children:e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 rounded w-48 mb-2",style:{backgroundColor:"var(--border)"}}),e.jsx("div",{className:"h-3 rounded w-full mb-1",style:{backgroundColor:"var(--border)"}}),e.jsx("div",{className:"h-3 rounded w-2/3",style:{backgroundColor:"var(--border)"}})]})})},t))})}function B(){const{t}=w(),[r,d]=n.useState(""),[c,o]=n.useState([]),[y,p]=n.useState(!1),[j,x]=n.useState(!1),f=n.useRef(null),m=n.useCallback(async u=>{if(!u.trim()){o([]),x(!1),p(!1);return}p(!0);try{const[g,v]=await Promise.allSettled([M(u),L(u)]),h=[];if(g.status==="fulfilled")for(const i of g.value)h.push({name:i.name,source:"skills.sh",installCommand:i.installCommand,url:i.url,badge:i.installs});if(v.status==="fulfilled")for(const i of v.value.results)h.push({name:i.name,description:i.description,source:i.source,installCommand:i.installCommand,url:i.repositoryUrl??i.npmUrl});o(h),x(!0)}catch{x(!0)}finally{p(!1)}},[]);return n.useEffect(()=>{if(f.current&&clearTimeout(f.current),!r.trim()){o([]),x(!1);return}return f.current=setTimeout(()=>m(r),500),()=>{f.current&&clearTimeout(f.current)}},[r,m]),e.jsxs("div",{className:"mt-10",children:[e.jsx("h2",{className:"text-lg font-medium mb-1",style:{color:"var(--text-primary)"},children:t("recommended.findMore")}),e.jsx("p",{className:"text-sm mb-4",style:{color:"var(--text-muted)"},children:t("recommended.findMoreBody")}),e.jsx("div",{className:"mb-4",children:e.jsx(I,{value:r,onChange:d,placeholder:t("recommended.findMorePlaceholder")})}),y?e.jsx(_,{}):j&&c.length===0?e.jsx("div",{className:"rounded-lg p-8 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsxs("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:["No results found for “",r,"”."]})}):c.length>0?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:[c.length," result",c.length!==1?"s":""," from skills.sh and MCP registries"]}),c.map(u=>e.jsx(V,{result:u},`${u.source}-${u.name}`))]}):null]})}function H(){const{t}=w(),{data:r,isLoading:d,mutate:c}=R(),[o,y]=n.useState(!1),[p,j]=n.useState("All"),[x,f]=n.useState(null),m=(r==null?void 0:r.recommendations)??[],u=(r==null?void 0:r.generatedAt)??null,g=(r==null?void 0:r.model)??null,v=n.useMemo(()=>{const s=new Set;for(const l of m)l.category&&s.add(l.category);return k.filter(l=>s.has(l)).concat([...s].filter(l=>!k.includes(l)))},[m]),h=n.useMemo(()=>{let s=m;return p==="Plugins"?s=s.filter(l=>l.type==="plugin"):p==="MCP Servers"?s=s.filter(l=>l.type==="mcp"):p==="Skills"&&(s=s.filter(l=>l.type==="skill")),x&&(s=s.filter(l=>l.category===x)),s},[m,p,x]),i=n.useCallback(async()=>{y(!0);try{const s=await P();await c(s,!1)}catch{}finally{y(!1)}},[c]),S=m.length===0&&!d&&!o;return e.jsxs("div",{children:[e.jsx(E,{title:t("recommended.title"),subtitle:t("recommended.subtitle"),children:e.jsxs("button",{className:"px-4 py-2 rounded-lg text-sm font-medium transition-colors flex items-center gap-2",style:{backgroundColor:o?"var(--bg-tertiary)":"var(--accent)",color:o?"var(--text-muted)":"#fff",cursor:o?"not-allowed":"pointer"},disabled:o,onClick:i,children:[o&&e.jsx("span",{className:"inline-block w-4 h-4 rounded-full border-2 animate-spin",style:{borderColor:"var(--card-border)",borderTopColor:"var(--accent-light)"}}),t(o?"recommended.generating":"recommended.refresh")]})}),u&&e.jsxs("p",{className:"text-xs mb-4",style:{color:"var(--text-muted)"},children:["Generated ",new Date(u).toLocaleString(),g&&g!=="static"&&g!=="static-fallback"?` via ${g}`:g==="static"||g==="static-fallback"?" (static fallback)":""]}),m.length>0&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-6",children:[F.map(s=>e.jsx(T,{label:s,active:p===s,onClick:()=>{j(s),f(null)}},s)),e.jsx("span",{className:"w-px h-5 mx-1",style:{backgroundColor:"var(--border)"}}),v.map(s=>e.jsx(T,{label:s,active:x===s,onClick:()=>f(x===s?null:s)},s))]}),(d||o)&&m.length===0&&e.jsxs("div",{className:"rounded-lg p-12 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("span",{className:"inline-block w-8 h-8 rounded-full border-3 animate-spin mb-4",style:{borderWidth:"3px",borderColor:"var(--card-border)",borderTopColor:"var(--accent-light)"}}),e.jsx("p",{className:"text-sm",style:{color:"var(--text-secondary)"},children:o?"Generating personalized recommendations...":"Loading recommendations..."}),e.jsx("p",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:"This may take a few seconds"})]}),S&&e.jsxs("div",{className:"rounded-lg p-12 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("p",{className:"text-lg mb-2",style:{color:"var(--text-muted)"},children:t("recommended.emptyTitle")}),e.jsx("p",{className:"text-sm mb-4",style:{color:"var(--text-faint)"},children:t("recommended.emptyBody")}),e.jsx("button",{className:"px-5 py-2.5 rounded-lg text-sm font-medium",style:{backgroundColor:"var(--accent)",color:"#fff"},onClick:i,children:t("recommended.generate")})]}),h.length>0&&(()=>{const s=h.filter(a=>a.popularity==="Top"||a.popularity==="Popular"),l=h.filter(a=>a.popularity==="Trending"||a.popularity==="Rising"||a.popularity==="New"),N=h.filter(a=>!["Top","Popular","Trending","Rising","New"].includes(a.popularity));return e.jsxs("div",{className:"space-y-8",children:[s.length>0&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-3 flex items-center gap-2",style:{color:"var(--text-secondary)"},children:[e.jsx("span",{children:"🏆"})," Top / Most Popular",e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-muted)"},children:s.length})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px"},children:s.map(a=>e.jsx(C,{rec:a},`${a.type}-${a.name}`))})]}),l.length>0&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-3 flex items-center gap-2",style:{color:"var(--text-secondary)"},children:[e.jsx("span",{children:"🔥"})," Trending / Rising",e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-muted)"},children:l.length})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px"},children:l.map(a=>e.jsx(C,{rec:a},`${a.type}-${a.name}`))})]}),N.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",style:{color:"var(--text-secondary)"},children:"Other"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"16px"},children:N.map(a=>e.jsx(C,{rec:a},`${a.type}-${a.name}`))})]})]})})(),m.length>0&&h.length===0&&!d&&e.jsx("div",{className:"rounded-lg p-8 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No recommendations match the current filter."})}),e.jsx(B,{})]})}export{H as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./index-CaDf51H6.js";function a({value:r,onChange:t,placeholder:o="Search..."}){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-3 flex items-center pointer-events-none","aria-hidden":"true",children:e.jsx("svg",{className:"w-4 h-4",style:{color:"var(--text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-4.35-4.35M17 11A6 6 0 1 1 5 11a6 6 0 0 1 12 0z"})})}),e.jsx("input",{type:"text",value:r,onChange:s=>t(s.target.value),placeholder:o,className:"w-full pl-9 pr-4 py-2 rounded-md text-sm outline-none transition-colors search-input",style:{backgroundColor:"var(--bg-tertiary)",border:"1px solid",color:"var(--text-primary)"}})]})}export{a as S};
@@ -0,0 +1 @@
1
+ import{r as c,j as r}from"./index-CaDf51H6.js";function m({value:o,onChange:i,options:u,placeholder:v,disabled:n}){const[d,a]=c.useState(!1),l=c.useRef(null);c.useEffect(()=>{const e=t=>{l.current&&!l.current.contains(t.target)&&a(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const s=u.find(e=>e.value===o);return r.jsxs("div",{ref:l,className:"relative",children:[r.jsxs("button",{type:"button",className:"w-full flex items-center justify-between px-3 py-2 rounded-lg text-sm transition-colors",style:{backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--border)",color:s?"var(--text-primary)":"var(--text-muted)",opacity:n?.5:1,cursor:n?"not-allowed":"pointer"},onClick:()=>!n&&a(!d),disabled:n,children:[r.jsx("span",{className:"truncate",children:(s==null?void 0:s.label)??v??"Select..."}),r.jsx("svg",{className:"w-4 h-4 shrink-0 ml-2",style:{color:"var(--text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),d&&r.jsx("div",{className:"absolute z-50 w-full mt-1 rounded-lg overflow-hidden shadow-xl max-h-60 overflow-y-auto",style:{backgroundColor:"var(--bg-secondary)",border:"1px solid var(--border-strong)"},children:u.map(e=>r.jsx("button",{type:"button",className:"w-full text-left px-3 py-2 text-sm transition-colors",style:{backgroundColor:e.value===o?"var(--bg-hover)":"transparent",color:e.value===o?"var(--text-primary)":"var(--text-secondary)"},onMouseEnter:t=>{t.target.style.backgroundColor="var(--bg-hover)"},onMouseLeave:t=>{t.target.style.backgroundColor=e.value===o?"var(--bg-hover)":"transparent"},onClick:()=>{i(e.value),a(!1)},children:e.label},e.value))})]})}export{m as S};
@@ -0,0 +1 @@
1
+ import{u as j,j as e,r as i,B as S,c as E,E as V,F as k,G as T,H as L}from"./index-CaDf51H6.js";import{H as O}from"./header-CBzSNzdI.js";import{S as F}from"./select-BtWQJMup.js";import{T as M}from"./tag-Q3V7Jugn.js";const N=["claude-opus-4-5","claude-sonnet-4-5","claude-haiku-4-5","claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022"];function P({value:r,onChange:l}){const{t:n}=j(),o=[{value:"",label:n("config.settings.modelSelectPlaceholder")},...N.map(s=>({value:s,label:s})),...r&&!N.includes(r)?[{value:r,label:r}]:[]];return e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-xs uppercase tracking-wider",style:{color:"var(--text-muted)",fontWeight:510},children:n("config.settings.model")}),e.jsx(F,{value:r,onChange:l,options:o,placeholder:n("config.settings.modelSelectPlaceholder")}),e.jsx("input",{type:"text",value:r,onChange:s=>l(s.target.value),placeholder:n("config.settings.modelCustomPlaceholder"),className:"w-full px-3 py-2 rounded-md text-sm outline-none",style:{backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--card-border)",color:"var(--text-primary)"},onFocus:s=>{s.currentTarget.style.borderColor="var(--accent)"},onBlur:s=>{s.currentTarget.style.borderColor="var(--card-border)"}})]})}function B({vars:r,onAdd:l,onRemove:n}){const{t:o}=j(),[s,m]=i.useState(""),[u,p]=i.useState(""),[v,f]=i.useState({});function g(){const t=s.trim(),d=u.trim();t&&(l(t,d),m(""),p(""))}function y(t){f(d=>({...d,[t]:!d[t]}))}const h={backgroundColor:"var(--bg-tertiary)",border:"1px solid var(--card-border)",color:"var(--text-primary)"};return e.jsxs("div",{className:"space-y-2",children:[Object.entries(r).length===0?e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:o("config.settings.noEnv")}):e.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid var(--card-border)"},children:Object.entries(r).map(([t,d],b)=>e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",style:{borderBottom:b<Object.entries(r).length-1?"1px solid var(--border)":"none"},children:[e.jsx("code",{className:"text-sm font-mono flex-1",style:{color:"var(--accent-light)"},children:t}),e.jsx("code",{className:"text-sm font-mono flex-1 text-right",style:{color:"var(--text-secondary)"},children:v[t]?d:"--------"}),e.jsx("button",{onClick:()=>y(t),className:"text-xs px-2 py-1 rounded transition-colors",style:{color:"var(--text-muted)",backgroundColor:"var(--border)"},title:v[t]?o("config.settings.envHide"):o("config.settings.envShow"),children:v[t]?o("config.settings.envHide"):o("config.settings.envShow")}),e.jsx("button",{onClick:()=>n(t),className:"p-1 rounded transition-colors",style:{color:"var(--status-red)"},title:o("config.settings.envRemove"),children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},t))}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{type:"text",value:s,onChange:t=>m(t.target.value),placeholder:o("config.settings.envKeyPlaceholder"),className:"flex-1 px-3 py-2 rounded-md text-sm font-mono outline-none",style:h,onFocus:t=>{t.currentTarget.style.borderColor="var(--accent)"},onBlur:t=>{t.currentTarget.style.borderColor="var(--card-border)"},onKeyDown:t=>t.key==="Enter"&&g()}),e.jsx("input",{type:"text",value:u,onChange:t=>p(t.target.value),placeholder:o("config.settings.envValuePlaceholder"),className:"flex-1 px-3 py-2 rounded-md text-sm outline-none",style:h,onFocus:t=>{t.currentTarget.style.borderColor="var(--accent)"},onBlur:t=>{t.currentTarget.style.borderColor="var(--card-border)"},onKeyDown:t=>t.key==="Enter"&&g()}),e.jsx(S,{variant:"primary",size:"md",onClick:g,children:o("config.settings.envAdd")})]})]})}const H={PreToolUse:"blue",PostToolUse:"green",Notification:"yellow",Stop:"orange",SubagentStop:"pink"};function R({hooks:r}){const l=Object.entries(r);return l.length===0?e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No hooks configured."}):e.jsx("div",{className:"space-y-3",children:l.map(([n,o])=>e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsx(M,{label:n,variant:H[n]??"gray"})}),e.jsx("div",{className:"space-y-2",children:o.map((s,m)=>e.jsxs("div",{className:"rounded-lg p-3",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--border)"},children:[e.jsxs("code",{className:"block text-xs font-mono",style:{color:"var(--accent-light)"},children:[s.command,s.args&&s.args.length>0?" "+s.args.join(" "):""]}),s.timeout!==void 0&&e.jsxs("p",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:["Timeout: ",s.timeout,"ms"]})]},m))})]},n))})}function z(){const{t:r}=j(),{data:l,isLoading:n,mutate:o}=E(),s=l??{},[m,u]=i.useState({}),[p,v]=i.useState(!0),[f,g]=i.useState(!1),[y,h]=i.useState(""),t=n||p;i.useEffect(()=>{async function c(){try{const a=await V();u(a)}catch(a){console.error("Failed to load env vars",a)}finally{v(!1)}}c()},[]),i.useEffect(()=>{s.model!==void 0&&h(s.model??"")},[s.model]);async function d(){g(!0);try{await k({model:y}),o()}catch(c){console.error("Failed to save model",c)}finally{g(!1)}}async function b(c,a){try{await T(c,a),u(x=>({...x,[c]:a}))}catch(x){console.error("Failed to set env var",x)}}async function C(c){try{await L(c),u(a=>{const x={...a};return delete x[c],x})}catch(a){console.error("Failed to remove env var",a)}}const w=s.hooks??{};return e.jsxs("div",{children:[e.jsx(O,{title:r("config.settings.title")}),t?e.jsx("p",{style:{color:"var(--text-secondary)"},children:r("common.loading")}):e.jsxs("div",{className:"space-y-6 max-w-2xl",children:[e.jsxs("section",{className:"rounded-lg p-5",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("h2",{className:"text-sm mb-4",style:{color:"var(--text-primary)",fontWeight:510},children:r("config.settings.model")}),e.jsx(P,{value:y,onChange:h}),e.jsx("div",{className:"mt-4",children:e.jsx(S,{variant:"primary",size:"md",onClick:d,disabled:f,children:r(f?"common.saving":"common.save")})})]}),e.jsxs("section",{className:"rounded-lg p-5",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("h2",{className:"text-sm mb-4",style:{color:"var(--text-primary)",fontWeight:510},children:r("config.settings.envVars")}),e.jsx(B,{vars:m,onAdd:b,onRemove:C})]}),e.jsxs("section",{className:"rounded-lg p-5",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("h2",{className:"text-sm mb-4",style:{color:"var(--text-primary)",fontWeight:510},children:r("config.settings.hooks")}),e.jsx(R,{hooks:w})]})]})]})}export{z as default};
@@ -0,0 +1 @@
1
+ import{u as z,z as V,r as t,j as e,A as I,C as A,s as G,k as _}from"./index-CaDf51H6.js";import{H as D}from"./header-CBzSNzdI.js";import{S as F}from"./search-box-CqaIZ9mR.js";import{T as b}from"./tag-Q3V7Jugn.js";import{M as J}from"./markdown-viewer-Bj8nSOSJ.js";function E(l){const r=l.replace(/\\/g,"/").split("/"),c=r.indexOf("cache");if(c!==-1&&r[c+2])return r[c+2];const i=r.indexOf("skills");return i>=2?r[i-2]:"Custom"}function M({icon:l,label:r,count:c,children:i}){const[d,h]=t.useState(!0);return e.jsxs("div",{children:[e.jsxs("button",{className:"flex items-center gap-2 mb-3 w-full text-left",onClick:()=>h(!d),children:[e.jsx("span",{className:"text-base",children:l}),e.jsx("h3",{className:"text-sm font-medium",style:{color:r==="User"?"var(--accent-light)":"var(--text-muted)"},children:r}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"var(--border)",color:"var(--text-secondary)"},children:c}),e.jsx("svg",{className:"w-4 h-4 ml-auto transition-transform",style:{color:"var(--text-muted)",transform:d?"rotate(0deg)":"rotate(-90deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),d&&i]})}function K(){return e.jsx("div",{className:"space-y-3",children:[1,2,3].map(l=>e.jsx("div",{className:"rounded-lg p-5 animate-pulse",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 rounded w-64 mb-2",style:{backgroundColor:"var(--border)"}}),e.jsx("div",{className:"h-3 rounded w-24 mb-3",style:{backgroundColor:"var(--border)"}}),e.jsx("div",{className:"h-3 rounded w-full",style:{backgroundColor:"var(--border)"}})]}),e.jsx("div",{className:"h-8 w-16 rounded-lg",style:{backgroundColor:"var(--border)"}})]})},l))})}function Q({result:l}){const[r,c]=t.useState(!1),i=t.useCallback(()=>{navigator.clipboard.writeText(l.installCommand).then(()=>{c(!0),setTimeout(()=>c(!1),2e3)})},[l.installCommand]);return e.jsx("div",{className:"rounded-lg p-5 transition-colors hover:bg-bg-hover",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[e.jsx("code",{className:"text-sm font-mono font-medium",style:{color:"var(--accent-light)"},children:l.name}),e.jsx(b,{label:l.installs,variant:"blue"})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx("code",{className:"text-xs font-mono px-2 py-1 rounded",style:{backgroundColor:"var(--bg-secondary)",color:"var(--text-secondary)"},children:l.installCommand}),e.jsx("button",{className:"p-1 rounded transition-colors hover:bg-bg-hover shrink-0",style:{color:r?"var(--status-green)":"var(--text-muted)"},onClick:i,title:"Copy install command",children:r?e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"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"})})})]}),e.jsx("div",{className:"mt-2",children:e.jsx("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs underline transition-colors",style:{color:"var(--text-muted)"},children:"View on skills.sh"})})]})})})}function X(){const{t:l}=z(),[r,c]=t.useState(""),[i,d]=t.useState([]),[h,T]=t.useState([]),[o,g]=t.useState(!1),[k,f]=t.useState(!0),[N,v]=t.useState(!1),p=t.useRef(null),C=t.useRef(!1);t.useEffect(()=>{C.current||(C.current=!0,f(!0),A().then(n=>T(n)).catch(()=>{}).finally(()=>f(!1)))},[]);const j=t.useCallback(async n=>{if(!n.trim()){d([]),v(!1),g(!1);return}g(!0);try{const y=await G(n);d(y),v(!0)}catch{v(!0)}finally{g(!1)}},[]);t.useEffect(()=>{if(p.current&&clearTimeout(p.current),!r.trim()){d([]),v(!1);return}return p.current=setTimeout(()=>j(r),500),()=>{p.current&&clearTimeout(p.current)}},[r,j]);const x=r.trim().length>0,u=x?i:h,S=x?o:k;return e.jsxs("div",{children:[e.jsx("div",{className:"mb-4",children:e.jsx(F,{value:r,onChange:c,placeholder:l("config.skills.searchPlaceholder")})}),S?e.jsx(K,{}):x&&N&&i.length===0?e.jsx("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsxs("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:["No results found for “",r,"”."]})}):u.length>0?e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:x?`${u.length} result${u.length!==1?"s":""}`:`Top ${u.length} Skills`}),u.map(n=>e.jsx(Q,{result:n},n.name))]}):e.jsxs("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsx("p",{className:"text-sm mb-2",style:{color:"var(--text-muted)"},children:"Search the skills.sh ecosystem — 91,000+ skills available"}),e.jsx("p",{className:"text-xs",style:{color:"var(--text-faint)"},children:"Type a search term above to discover skills for Claude."})]})]})}function te(){const{t:l}=z(),{data:r,isLoading:c,mutate:i}=V(),d=r??[],[h,T]=t.useState(""),[o,g]=t.useState(null),[k,f]=t.useState(null),[N,v]=t.useState(!1),[p,C]=t.useState({}),[j,x]=t.useState(!1),[u,S]=t.useState(""),[n,y]=t.useState("installed");async function H(s){g(s),f(null),v(!0);try{const{content:a}=await _(s.filePath);f(a)}catch{f("*Failed to load content*")}finally{v(!1)}}async function O(){if(o)try{await I(o.filePath,u),f(u),x(!1),i()}catch(s){console.error("Failed to save",s)}}const R=d.filter(s=>s.name.toLowerCase().includes(h.toLowerCase())||(s.description??"").toLowerCase().includes(h.toLowerCase())),w=R.filter(s=>s.source==="user"),B=R.filter(s=>s.source!=="user"),W=B.reduce((s,a)=>{const m=E(a.filePath);return s[m]||(s[m]=[]),s[m].push(a),s},{});function $(s){C(a=>({...a,[s]:!a[s]}))}function P(s,a,m){return e.jsxs("div",{className:"flex items-start gap-4 px-5 py-3 cursor-pointer transition-colors hover:bg-bg-hover",style:{borderBottom:a<m-1?"1px solid var(--border)":"none"},onClick:()=>H(s),children:[e.jsx("code",{className:"text-sm font-mono shrink-0",style:{color:"var(--accent-light)"},children:s.name}),e.jsxs("div",{className:"flex-1 min-w-0",children:[s.description&&e.jsx("p",{className:"text-xs",style:{color:"var(--text-secondary)"},children:s.description}),s.tags&&s.tags.length>0&&e.jsx("div",{className:"flex gap-1.5 mt-1 flex-wrap",children:s.tags.map(L=>e.jsx(b,{label:L,variant:"gray"},L))})]}),e.jsx(b,{label:"skill",variant:"purple"})]},s.name)}return e.jsxs("div",{children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-bg-primary",children:[e.jsx(D,{title:l("config.skills.title",{n:d.length})}),e.jsxs("div",{className:"flex items-center gap-1 mb-4",children:[e.jsx("button",{className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors",style:{backgroundColor:n==="installed"?"var(--accent)":"transparent",color:n==="installed"?"#fff":"var(--text-muted)"},onClick:()=>y("installed"),children:l("config.skills.installed")}),e.jsx("button",{className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors",style:{backgroundColor:n==="store"?"var(--accent)":"transparent",color:n==="store"?"#fff":"var(--text-muted)"},onClick:()=>y("store"),children:l("config.skills.store")})]})]}),n==="installed"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(F,{value:h,onChange:T,placeholder:l("config.skills.searchPlaceholder")})}),c?e.jsx("p",{style:{color:"var(--text-secondary)"},children:"Loading..."}):R.length===0?e.jsx("div",{className:"rounded-lg p-10 text-center",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:h?"No skills match your search.":e.jsxs(e.Fragment,{children:["No skills found. Browse the"," ",e.jsx("button",{className:"underline",style:{color:"var(--accent-light)"},onClick:()=>y("store"),children:"Skill Store"})," ","to discover and install skills."]})})}):e.jsxs("div",{className:"space-y-6",children:[w.length>0&&e.jsx(M,{icon:"👤",label:"User",count:w.length,children:e.jsx("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:w.map((s,a)=>P(s,a,w.length))})}),B.length>0&&e.jsx(M,{icon:"🔧",label:"System",count:B.length,children:e.jsx("div",{className:"space-y-4",children:Object.entries(W).map(([s,a])=>{const m=p[s];return e.jsxs("div",{className:"rounded-lg overflow-hidden",style:{backgroundColor:"var(--card-bg)",border:"1px solid var(--card-border)"},children:[e.jsxs("button",{className:"w-full flex items-center justify-between px-5 py-3 text-left transition-colors hover:bg-bg-hover",style:{borderBottom:m?"none":"1px solid var(--border)"},onClick:()=>$(s),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",style:{color:"var(--text-primary)"},children:s}),e.jsx(b,{label:`${a.length}`,variant:"purple"})]}),e.jsx("svg",{className:"w-4 h-4 transition-transform",style:{color:"var(--text-muted)",transform:m?"rotate(-90deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),!m&&e.jsx("div",{children:a.map((L,U)=>P(L,U,a.length))})]},s)})})})]}),o&&e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col",style:{backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 shrink-0",style:{borderBottom:"1px solid var(--border)",backgroundColor:"var(--bg-secondary)"},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("code",{className:"text-base font-mono font-medium",style:{color:"var(--accent-light)"},children:o.name}),e.jsx(b,{label:o.source==="user"?"User":"System",variant:o.source==="user"?"purple":"gray"}),e.jsx(b,{label:E(o.filePath),variant:"blue"}),o.description&&e.jsxs("span",{className:"text-xs truncate",style:{color:"var(--text-muted)"},children:["— ",o.description]})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsx("code",{className:"text-xs font-mono hidden lg:block",style:{color:"var(--text-muted)"},children:o.filePath}),o.source==="user"&&!j&&!N&&e.jsx("button",{onClick:()=>{x(!0),S(k??"")},className:"px-3 py-1.5 rounded-lg text-sm font-medium transition-colors hover:bg-bg-hover",style:{color:"var(--accent-light)"},children:"Edit"}),e.jsx("button",{className:"w-8 h-8 rounded-lg flex items-center justify-center transition-colors hover:bg-bg-hover",style:{color:"var(--text-secondary)"},onClick:()=>{g(null),x(!1),f(null)},children:"✕"})]})]}),e.jsx("div",{className:"flex-1 overflow-auto px-8 py-6",children:j?e.jsxs("div",{className:"max-w-4xl mx-auto flex flex-col h-full",children:[e.jsx("textarea",{value:u,onChange:s=>S(s.target.value),className:"flex-1 w-full p-4 rounded-lg font-mono text-sm resize-none outline-none",style:{backgroundColor:"var(--bg-secondary)",color:"var(--text-secondary)",border:"1px solid var(--card-border)",minHeight:"500px"}}),e.jsxs("div",{className:"flex gap-3 mt-4 justify-end",children:[e.jsx("button",{onClick:()=>x(!1),className:"px-4 py-2 rounded-lg text-sm btn-secondary",children:"Cancel"}),e.jsx("button",{onClick:O,className:"px-4 py-2 rounded-lg text-sm btn-primary",children:"Save"})]})]}):N?e.jsx("div",{className:"max-w-4xl mx-auto text-center py-12",children:e.jsx("p",{style:{color:"var(--text-muted)"},children:"Loading content..."})}):e.jsx(J,{content:k??"*No content available*",className:"max-w-4xl mx-auto skill-markdown"})})]})]}):e.jsx(X,{})]})}export{te as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./index-CaDf51H6.js";const t={green:{bg:"rgba(39, 166, 68, 0.15)",color:"var(--status-green)"},blue:{bg:"rgba(94, 106, 210, 0.15)",color:"var(--accent-light)"},orange:{bg:"rgba(138, 143, 152, 0.15)",color:"var(--text-secondary)"},purple:{bg:"rgba(94, 106, 210, 0.15)",color:"var(--accent-light)"},red:{bg:"rgba(255, 71, 87, 0.15)",color:"var(--status-red)"},yellow:{bg:"rgba(138, 143, 152, 0.15)",color:"var(--text-secondary)"},pink:{bg:"rgba(94, 106, 210, 0.12)",color:"var(--accent-hover)"},gray:{bg:"var(--border)",color:"var(--text-muted)"}};function c({label:o,variant:e="gray"}){const r=t[e];return a.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs",style:{backgroundColor:r.bg,color:r.color,fontWeight:510},children:o})}export{c as T};
Binary file
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Claude Config Manager</title>
7
+ <meta name="description" content="Manage your Claude configuration, plugins, MCP servers, and more." />
8
+ <meta name="theme-color" content="#D97757" />
9
+ <link rel="icon" type="image/x-icon" href="/favicon.ico" />
10
+ <link rel="icon" type="image/png" sizes="32x32" href="/icon-32.png" />
11
+ <link rel="icon" type="image/png" sizes="192x192" href="/icon-192.png" />
12
+ <link rel="apple-touch-icon" sizes="192x192" href="/icon-192.png" />
13
+ <script type="module" crossorigin src="/assets/index-CaDf51H6.js"></script>
14
+ <link rel="stylesheet" crossorigin href="/assets/index-CHtRMAMT.css">
15
+ </head>
16
+ <body>
17
+ <div id="root"></div>
18
+ </body>
19
+ </html>