@gemini-suite/vera-mcp 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. See [Conven
4
4
 
5
5
  <!-- MONOWEAVE:BELOW -->
6
6
 
7
+ ## [0.1.9](https://github.com/Volue/vera/compare/@gemini-suite/vera-mcp@0.1.8...@gemini-suite/vera-mcp@0.1.9) "@gemini-suite/vera-mcp" (2026-02-17)
8
+
9
+
10
+
11
+
7
12
  ## [0.1.8](https://github.com/Volue/vera/compare/@gemini-suite/vera-mcp@0.1.8-next.0...@gemini-suite/vera-mcp@0.1.8) "@gemini-suite/vera-mcp" (2026-02-17)
8
13
 
9
14
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @gemini-suite/vera-mcp
2
2
 
3
- > A Model Context Protocol (MCP) server that enables AI assistants to access Wave Design System documentation and resources.
3
+ > A Model Context Protocol (MCP) server that enables AI assistants to access Vera Design System documentation and resources.
4
4
 
5
5
  ## Available Tools
6
6
 
@@ -8,7 +8,7 @@ The following tools are available in the Wave MCP server and can be executed by
8
8
 
9
9
  | Tool Name | Description |
10
10
  | ------------------------ | -------------------------------------------------------------------------------- |
11
- | `init` | Initialize the Wave Design System in your project |
11
+ | `init` | Initialize the Vera Design System in your project |
12
12
  | `list_components` | List all available components grouped by category |
13
13
  | `get_component` | Get comprehensive documentation for a specific component |
14
14
  | `list_patterns` | List all UX patterns grouped by category |
@@ -32,7 +32,7 @@ Use the button above or manually add to your `.vscode/mcp.json`:
32
32
  ```json
33
33
  {
34
34
  "servers": {
35
- "Wave Design System": {
35
+ "Vera Design System": {
36
36
  "type": "stdio",
37
37
  "command": "npx",
38
38
  "args": ["-y", "@gemini-suite/vera-mcp@latest"]
@@ -1,14 +1,14 @@
1
- var A=Object.defineProperty;var s=(e,t)=>A(e,"name",{value:t,configurable:!0});import{a as p,f as u,u as y,g as d}from"./server-yX5dvPLU.js";import P from"@gemini-suite/design-colors/generic";import*as D from"@gemini-suite/design-icons";import*as N from"@gemini-suite/design-media-queries";import j from"remark-parse";import O from"unified";import{z as v}from"zod";import{core as F,data as H,background as V,foreground as G,border as X,rgb as q}from"@gemini-suite/design-colors/flat";function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},m.apply(null,arguments)}s(m,"_extends");const J="0 1px 2.5px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.08)), 0 3px 9px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.048))",Q="0 0.4px 2.2px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.022)), 0 1.4px 5px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.04)), 0 5px 14px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.06))",Y="0 0.3px 2px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.015)), 0 1.5px 8px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.024)), 0 4px 16px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.04)), 0 8px 24px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.07))",K="0 0.7px 2px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.015)), 0 1.6px 8px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.024)), 0 3.3px 16px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.034)), 0 5px 26px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.06)), 0 12px 42px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.08))";var Z=Object.freeze({__proto__:null,elevationL:K,elevationM:Y,elevationS:Q,elevationXs:J}),h={base:{2:"0.125rem",4:"0.25rem",6:"0.375rem",8:"0.5rem",12:"0.75rem",14:"0.875rem",16:"1rem",20:"1.25rem",24:"1.5rem",28:"1.75rem",32:"2rem",36:"2.25rem",40:"2.5rem",44:"2.75rem",48:"3rem",64:"4rem",72:"4.5rem",80:"5rem",96:"6rem",112:"7rem",128:"8rem"},borderRadius:{xs:"0.25rem",s:"0.375rem",m:"0.5rem",l:"0.75rem",xl:"1rem",full:"100vh"},spacing:{xs:"0.25rem",s:"0.5rem",m:"1rem",l:"1.5rem",xl:"2rem",xxl:"3rem",xxxl:"4.5rem"}},g={font:{family:{base:"'Source Sans Pro', system-ui, -apple-system, 'Segoe UI'",display:"'FK Display', 'Source Sans Pro', system-ui, -apple-system, 'Segoe UI', sans-serif",mono:"ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"},weight:{normal:"400",semibold:"600"}},size:{font:{base:"16px",eta:"12px",zeta:"14px",epsilon:"16px",delta:"19px",gamma:"21px",beta:"28px",alpha:"38px",giga:"51px"},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"normal",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",body:"1.5",base:"1.5rem",small:"1.25rem",xSmall:"1.125rem",zeta:"1.714286",epsilon:"1.5",delta:"1.263158",gamma:"1.52381",beta:"1.714286",alpha:"1.263158",giga:"1.411765"}}};function ee(e){return e.charAt(0).toUpperCase()+e.slice(1)}s(ee,"capitalizeFirstLetter");var T=Object.keys(h.spacing).reduce(function(e,t){var n;return m({},e,(n={},n["spacing"+ee(t)]=h.spacing[t],n))},{}),C={colors:m({},F,H,V,G,X,q),space:T,zIndices:{auto:"auto",0:"0",1:"100",2:"200",3:"300",4:"400",5:"500",9:"900"},fonts:g.font.family,fontWeights:g.font.weight,fontSizes:g.size.font,lineHeights:g.size.lineHeight,letterSpacings:g.size.letterSpacing,sizes:m({},h.base,{measureNarrow:"30ch",measureMedium:"60ch",measureWide:"90ch",containerNarrow:"32rem",containerMedium:"48rem",containerWide:"74rem"}),radii:m({},h.borderRadius,T),shadows:m({},Z,{lift:"0 10px 20px -5px rgba(0, 0, 0, 0.15)"})};const te=O().use(j),B={Components:"component","UX patterns":"pattern"};function ne(e,t){const n=te.parse(e);let o=null;return n.children.reduce((r,a)=>{if(p(a,"heading")&&a.depth===2)return o=oe(a),r;if(!o||!p(a,"list"))return r;const i=o,c=a.children.map(l=>re(l,i,t)).filter(l=>l!==null);return r.concat(c)},[])}s(ne,"parseLlmsIndex");function oe(e){const[t]=e.children;if(!t||!p(t,"text"))return null;const n=t.value.trim();if(!(n in B))return null;const o=B[n];return{title:n,type:o}}s(oe,"extractSectionContext");function re(e,t,n){const[o]=e.children;if(!o||!p(o,"paragraph")||o.children.length!==2)return null;const[r,a]=o.children;if(!p(r,"link")||!p(a,"text")||r.children.length!==1)return null;const i=r.children[0];if(!p(i,"text"))return null;const c=i.value.trim(),l=r.url.replace(/^\//,""),z=new URL(l,`${n}/`).toString(),W=ae(l),U=se(t.title,l,t.type),M=ce(a.value);return{name:c,slug:W,category:U,section:t.title,type:t.type,url:z,description:M??void 0}}s(re,"listItemToResource");function ae(e){return e.replace(/\.md$/,"").split("/").pop()??""}s(ae,"deriveSlug");function se(e,t,n){const o=t.replace(/\.md$/,"").split("/");if(n==="component"||n==="pattern"){const r=o.length>=3?o[o.length-2]:null;return r?`${e} / ${ie(r)}`:e}return e}s(se,"deriveCategory");function ie(e){return e.split("-").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}s(ie,"formatSegment");function ce(e){if(!e)return null;const t=e.replace(/^\s*:\s*/,"").trim();return t.toLowerCase()==="no description available"?null:t}s(ce,"normalizeDescription");const x=process.env.USE_STABLE_DOCS==="true"||process.env.USE_STABLE_DOCS==="1"?"https://wave.volue.com":"https://next.wave-design-system.pages.dev",le=`${x}/llms.txt`,de=1e3*60*15,pe=process.env.WAVE_RESOURCES_CACHE_TIME?Number.parseInt(process.env.WAVE_RESOURCES_CACHE_TIME,10):de;function b(e){const t=new URL(e,x);return t.pathname.endsWith(".md")||(t.pathname+=".md"),t.toString()}s(b,"createUrl");let S=null,R=0;async function me(){if(S!==null&&Date.now()<R)return S;const e=await ue();return S=e,R=Date.now()+pe,e}s(me,"listCachedResources");let f=null;async function ue(){return f||(f=ge().finally(()=>{f=null})),f}s(ue,"idempotentLoadResourcesFromLlms");async function ge(){const e=await u(le,void 0,"fetch llms.txt");return ne(e,x)}s(ge,"loadResourcesFromLlms");async function he(e){return u(e.url,void 0,`fetch ${e.name} documentation`)}s(he,"fetchComponent");function fe(e){return u(e.url,void 0,`fetch ${e.name} pattern`)}s(fe,"fetchPattern");async function ye(){return u(b("get-started/developing"),void 0,"fetch developing guide")}s(ye,"fetchDevelopingGuide");async function ve(){return u(b("tokens/colors"),void 0,"fetch color usage guidelines")}s(ve,"fetchColorUsageGuidelines");function w(){return Object.entries(D).map(([e,t])=>({name:e,svg:t}))}s(w,"listIcons");function xe(){const e=w();return y(e.map(t=>t.name))}s(xe,"getIconNames");function be(e,t){const n=t.trim().toLowerCase();return e.find(o=>o.name.toLowerCase()===n)}s(be,"findIconByName");async function E(e){return(await me()).filter(n=>n.type===e)}s(E,"listResourcesByType");function I(e,t){const n=t.trim().toLowerCase();return e.find(o=>o.name.toLowerCase()===n)}s(I,"findResourceByName");function k(){return E("component")}s(k,"listComponents");async function Se(){const e=await k();return y(e.map(t=>t.name))}s(Se,"getComponentNames");function $(){return E("pattern")}s($,"listPatterns");async function we(){const e=await $();return y(e.map(t=>t.name))}s(we,"getPatternNames");function L(e){return e.reduce((t,n)=>(t[n.category]||(t[n.category]=[]),t[n.category].push(n),t),{})}s(L,"groupResourcesByCategory");const ke={name:"get_color_usage",description:"Retrieve the Wave Design System color tokens and guidelines for applying color in user interfaces.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{const o=await ve();return{content:[{type:"text",text:JSON.stringify(P)},{type:"text",text:`Here are the Wave Design System color usage guidelines:
1
+ var P=Object.defineProperty;var s=(e,t)=>P(e,"name",{value:t,configurable:!0});import{a as p,f as u,u as y,g as d}from"./server-DHaCm-qj.js";import D from"@gemini-suite/design-colors/generic";import*as V from"@gemini-suite/design-icons";import*as N from"@gemini-suite/design-media-queries";import j from"remark-parse";import W from"unified";import{z as v}from"zod";import{core as O,data as F,background as H,foreground as G,border as X,rgb as q}from"@gemini-suite/design-colors/flat";function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},m.apply(null,arguments)}s(m,"_extends");const J="0 1px 2.5px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.08)), 0 3px 9px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.048))",Q="0 0.4px 2.2px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.022)), 0 1.4px 5px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.04)), 0 5px 14px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.06))",Y="0 0.3px 2px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.015)), 0 1.5px 8px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.024)), 0 4px 16px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.04)), 0 8px 24px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.07))",K="0 0.7px 2px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.015)), 0 1.6px 8px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.024)), 0 3.3px 16px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.034)), 0 5px 26px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.06)), 0 12px 42px hsla(var(--shadow-color, 191, 74%, 6%), calc(var(--shadow-intensity, 1) * 0.08))";var Z=Object.freeze({__proto__:null,elevationL:K,elevationM:Y,elevationS:Q,elevationXs:J}),h={base:{2:"0.125rem",4:"0.25rem",6:"0.375rem",8:"0.5rem",12:"0.75rem",14:"0.875rem",16:"1rem",20:"1.25rem",24:"1.5rem",28:"1.75rem",32:"2rem",36:"2.25rem",40:"2.5rem",44:"2.75rem",48:"3rem",64:"4rem",72:"4.5rem",80:"5rem",96:"6rem",112:"7rem",128:"8rem"},borderRadius:{xs:"0.25rem",s:"0.375rem",m:"0.5rem",l:"0.75rem",xl:"1rem",full:"100vh"},spacing:{xs:"0.25rem",s:"0.5rem",m:"1rem",l:"1.5rem",xl:"2rem",xxl:"3rem",xxxl:"4.5rem"}},g={font:{family:{base:"'Source Sans Pro', system-ui, -apple-system, 'Segoe UI'",display:"'FK Display', 'Source Sans Pro', system-ui, -apple-system, 'Segoe UI', sans-serif",mono:"ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"},weight:{normal:"400",semibold:"600"}},size:{font:{base:"16px",eta:"12px",zeta:"14px",epsilon:"16px",delta:"19px",gamma:"21px",beta:"28px",alpha:"38px",giga:"51px"},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"normal",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",body:"1.5",base:"1.5rem",small:"1.25rem",xSmall:"1.125rem",zeta:"1.714286",epsilon:"1.5",delta:"1.263158",gamma:"1.52381",beta:"1.714286",alpha:"1.263158",giga:"1.411765"}}};function ee(e){return e.charAt(0).toUpperCase()+e.slice(1)}s(ee,"capitalizeFirstLetter");var T=Object.keys(h.spacing).reduce(function(e,t){var n;return m({},e,(n={},n["spacing"+ee(t)]=h.spacing[t],n))},{}),C={colors:m({},O,F,H,G,X,q),space:T,zIndices:{auto:"auto",0:"0",1:"100",2:"200",3:"300",4:"400",5:"500",9:"900"},fonts:g.font.family,fontWeights:g.font.weight,fontSizes:g.size.font,lineHeights:g.size.lineHeight,letterSpacings:g.size.letterSpacing,sizes:m({},h.base,{measureNarrow:"30ch",measureMedium:"60ch",measureWide:"90ch",containerNarrow:"32rem",containerMedium:"48rem",containerWide:"74rem"}),radii:m({},h.borderRadius,T),shadows:m({},Z,{lift:"0 10px 20px -5px rgba(0, 0, 0, 0.15)"})};const te=W().use(j),B={Components:"component","UX patterns":"pattern"};function ne(e,t){const n=te.parse(e);let o=null;return n.children.reduce((r,a)=>{if(p(a,"heading")&&a.depth===2)return o=oe(a),r;if(!o||!p(a,"list"))return r;const i=o,c=a.children.map(l=>re(l,i,t)).filter(l=>l!==null);return r.concat(c)},[])}s(ne,"parseLlmsIndex");function oe(e){const[t]=e.children;if(!t||!p(t,"text"))return null;const n=t.value.trim();if(!(n in B))return null;const o=B[n];return{title:n,type:o}}s(oe,"extractSectionContext");function re(e,t,n){const[o]=e.children;if(!o||!p(o,"paragraph")||o.children.length!==2)return null;const[r,a]=o.children;if(!p(r,"link")||!p(a,"text")||r.children.length!==1)return null;const i=r.children[0];if(!p(i,"text"))return null;const c=i.value.trim(),l=r.url.replace(/^\//,""),z=new URL(l,`${n}/`).toString(),U=ae(l),M=se(t.title,l,t.type),A=ce(a.value);return{name:c,slug:U,category:M,section:t.title,type:t.type,url:z,description:A??void 0}}s(re,"listItemToResource");function ae(e){return e.replace(/\.md$/,"").split("/").pop()??""}s(ae,"deriveSlug");function se(e,t,n){const o=t.replace(/\.md$/,"").split("/");if(n==="component"||n==="pattern"){const r=o.length>=3?o[o.length-2]:null;return r?`${e} / ${ie(r)}`:e}return e}s(se,"deriveCategory");function ie(e){return e.split("-").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}s(ie,"formatSegment");function ce(e){if(!e)return null;const t=e.replace(/^\s*:\s*/,"").trim();return t.toLowerCase()==="no description available"?null:t}s(ce,"normalizeDescription");const x=process.env.USE_STABLE_DOCS==="true"||process.env.USE_STABLE_DOCS==="1"?"https://wave.volue.com":"https://next.wave-design-system.pages.dev",le=`${x}/llms.txt`,de=1e3*60*15,pe=process.env.WAVE_RESOURCES_CACHE_TIME?Number.parseInt(process.env.WAVE_RESOURCES_CACHE_TIME,10):de;function b(e){const t=new URL(e,x);return t.pathname.endsWith(".md")||(t.pathname+=".md"),t.toString()}s(b,"createUrl");let S=null,R=0;async function me(){if(S!==null&&Date.now()<R)return S;const e=await ue();return S=e,R=Date.now()+pe,e}s(me,"listCachedResources");let f=null;async function ue(){return f||(f=ge().finally(()=>{f=null})),f}s(ue,"idempotentLoadResourcesFromLlms");async function ge(){const e=await u(le,void 0,"fetch llms.txt");return ne(e,x)}s(ge,"loadResourcesFromLlms");async function he(e){return u(e.url,void 0,`fetch ${e.name} documentation`)}s(he,"fetchComponent");function fe(e){return u(e.url,void 0,`fetch ${e.name} pattern`)}s(fe,"fetchPattern");async function ye(){return u(b("get-started/developing"),void 0,"fetch developing guide")}s(ye,"fetchDevelopingGuide");async function ve(){return u(b("tokens/colors"),void 0,"fetch color usage guidelines")}s(ve,"fetchColorUsageGuidelines");function w(){return Object.entries(V).map(([e,t])=>({name:e,svg:t}))}s(w,"listIcons");function xe(){const e=w();return y(e.map(t=>t.name))}s(xe,"getIconNames");function be(e,t){const n=t.trim().toLowerCase();return e.find(o=>o.name.toLowerCase()===n)}s(be,"findIconByName");async function E(e){return(await me()).filter(n=>n.type===e)}s(E,"listResourcesByType");function I(e,t){const n=t.trim().toLowerCase();return e.find(o=>o.name.toLowerCase()===n)}s(I,"findResourceByName");function k(){return E("component")}s(k,"listComponents");async function Se(){const e=await k();return y(e.map(t=>t.name))}s(Se,"getComponentNames");function $(){return E("pattern")}s($,"listPatterns");async function we(){const e=await $();return y(e.map(t=>t.name))}s(we,"getPatternNames");function L(e){return e.reduce((t,n)=>(t[n.category]||(t[n.category]=[]),t[n.category].push(n),t),{})}s(L,"groupResourcesByCategory");const ke={name:"get_color_usage",description:"Retrieve the Vera Design System color tokens and guidelines for applying color in user interfaces.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{const o=await ve();return{content:[{type:"text",text:JSON.stringify(D)},{type:"text",text:`Here are the Vera Design System color usage guidelines:
2
2
 
3
3
  ${o}
4
4
 
5
5
  ---
6
- Source: ${b("tokens/colors")}`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve color usage guidelines: ${d(o)}`}]}}})}},$e={name:"get_component",description:"Retrieve comprehensive documentation for a specific Wave Design System component by name. This tool retrieves the import instructions, basic usage and advanced configuration examples, code snippets for common scenarios, available props/properties table and some general guidelines for a given Wave Design System component.",async ctx(){try{return{componentNames:await Se()}}catch(e){throw new Error(`Failed to initialize component tool: ${d(e)}`)}},exec(e,{ctx:t,name:n,description:o}){e.tool(n,o,{name:v.enum(t.componentNames).describe("The name of the component to retrieve documentation for. This can be derived from calling the `get_components` tool.")},async({name:r})=>{try{const a=await k(),i=I(a,r);if(!i)throw new Error("Component not found");const c=await he(i);return c?{content:[{type:"text",text:`Here is the documentation for the \`${i.name}\` component from the Wave Design System:
6
+ Source: ${b("tokens/colors")}`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve color usage guidelines: ${d(o)}`}]}}})}},$e={name:"get_component",description:"Retrieve comprehensive documentation for a specific Vera Design System component by name. This tool retrieves the import instructions, basic usage and advanced configuration examples, code snippets for common scenarios, available props/properties table and some general guidelines for a given Vera Design System component.",async ctx(){try{return{componentNames:await Se()}}catch(e){throw new Error(`Failed to initialize component tool: ${d(e)}`)}},exec(e,{ctx:t,name:n,description:o}){e.tool(n,o,{name:v.enum(t.componentNames).describe("The name of the component to retrieve documentation for. This can be derived from calling the `get_components` tool.")},async({name:r})=>{try{const a=await k(),i=I(a,r);if(!i)throw new Error("Component not found");const c=await he(i);return c?{content:[{type:"text",text:`Here is the documentation for the \`${i.name}\` component from the Vera Design System:
7
7
 
8
8
  ${c}
9
9
 
10
10
  ---
11
- Source: ${i.url}`}]}:{content:[{type:"text",text:`No documentation content found for the \`${i.name}\` component.`}]}}catch(a){return{isError:!0,content:[{type:"text",text:`Failed to retrieve documentation for \`${r}\`: ${d(a)}`}]}}})}},Te={name:"get_icon",description:"Retrieve a specific icon information by name from Wave Design System.",exec(e,{name:t,description:n}){e.tool(t,n,{name:v.enum(xe()).describe("The icon name to retrieve. This can be derived from calling the `list_icon` tool.")},async({name:o})=>{try{const r=w(),a=be(r,o);if(!a)throw new Error("Icon not found.");const i=`<SvgIcon iconName="${a.name}" />`,c=`<div class="svgIcon svgIcon--stroked">
11
+ Source: ${i.url}`}]}:{content:[{type:"text",text:`No documentation content found for the \`${i.name}\` component.`}]}}catch(a){return{isError:!0,content:[{type:"text",text:`Failed to retrieve documentation for \`${r}\`: ${d(a)}`}]}}})}},Te={name:"get_icon",description:"Retrieve a specific icon information by name from Vera Design System.",exec(e,{name:t,description:n}){e.tool(t,n,{name:v.enum(xe()).describe("The icon name to retrieve. This can be derived from calling the `list_icon` tool.")},async({name:o})=>{try{const r=w(),a=be(r,o);if(!a)throw new Error("Icon not found.");const i=`<SvgIcon iconName="${a.name}" />`,c=`<div class="svgIcon svgIcon--stroked">
12
12
  <svg focusable="false" aria-hidden="true">
13
13
  <use xlink:href="#svg--${a.name}"></use>
14
14
  </svg>
@@ -30,12 +30,12 @@ ${c}
30
30
 
31
31
  \`\`\`svg
32
32
  ${a.svg}
33
- \`\`\``}]}}catch(r){return{isError:!0,content:[{type:"text",text:`Failed to retrieve icon \`${o}\`: ${d(r)}`}]}}})}},Ce={name:"get_pattern",description:"Retrieve documentation for a specific Wave Design System UX pattern by name. This tool provides guidance, examples and components that implement the selected pattern.",async ctx(){try{return{patternNames:await we()}}catch(e){throw new Error(`Failed to initialize pattern tool: ${d(e)}`)}},exec(e,{ctx:t,name:n,description:o}){e.tool(n,o,{name:v.enum(t.patternNames).describe("The name of the UX pattern to retrieve documentation for. This can be derived from calling the `list_patterns` tool.")},async({name:r})=>{try{const a=await $(),i=I(a,r);if(!i)throw new Error("Pattern not found");const c=await fe(i);return{content:[{type:"text",text:`Here are the guidelines for the \`${i.name}\` UX pattern from the Wave Design System:
33
+ \`\`\``}]}}catch(r){return{isError:!0,content:[{type:"text",text:`Failed to retrieve icon \`${o}\`: ${d(r)}`}]}}})}},Ce={name:"get_pattern",description:"Retrieve documentation for a specific Vera Design System UX pattern by name. This tool provides guidance, examples and components that implement the selected pattern.",async ctx(){try{return{patternNames:await we()}}catch(e){throw new Error(`Failed to initialize pattern tool: ${d(e)}`)}},exec(e,{ctx:t,name:n,description:o}){e.tool(n,o,{name:v.enum(t.patternNames).describe("The name of the UX pattern to retrieve documentation for. This can be derived from calling the `list_patterns` tool.")},async({name:r})=>{try{const a=await $(),i=I(a,r);if(!i)throw new Error("Pattern not found");const c=await fe(i);return{content:[{type:"text",text:`Here are the guidelines for the \`${i.name}\` UX pattern from the Vera Design System:
34
34
 
35
35
  ${c}
36
36
 
37
37
  ---
38
- Source: ${i.url}`}]}}catch(a){return{isError:!0,content:[{type:"text",text:`Failed to retrieve documentation for \`${r}\`: ${d(a)}`}]}}})}},Be={name:"get_styling_guidelines",description:"Retrieve guidelines for styling Wave Design System components and creating custom styled components.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>({content:[{type:"text",text:`Wave Design System components can be styled using standard React approaches (className, style prop), but Wave provides specialized styling APIs for customizing component styles and creating custom styled components. These APIs are powered by Stitches.js, a CSS-in-JS library with near-zero runtime. They are the recommended approach because they integrate seamlessly with Wave's design tokens and provide type-safe styles.
38
+ Source: ${i.url}`}]}}catch(a){return{isError:!0,content:[{type:"text",text:`Failed to retrieve documentation for \`${r}\`: ${d(a)}`}]}}})}},Be={name:"get_styling_guidelines",description:"Retrieve guidelines for styling Vera Design System components and creating custom styled components.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>({content:[{type:"text",text:`Vera Design System components can be styled using standard React approaches (className, style prop), but Wave provides specialized styling APIs for customizing component styles and creating custom styled components. These APIs are powered by Stitches.js, a CSS-in-JS library with near-zero runtime. They are the recommended approach because they integrate seamlessly with Wave's design tokens and provide type-safe styles.
39
39
 
40
40
  ## Styling APIs
41
41
 
@@ -190,8 +190,8 @@ const Button = styled('button', {
190
190
  1. **Use design tokens**: Always prefer design tokens (prefixed with \`$\`) over hardcoded values for consistency. Use the \`get_tokens\` tool to discover available tokens.
191
191
  2. **Choose the right API**: Use \`css\` prop for one-off styles, \`styled()\` for reusable components
192
192
  3. **Semantic breakpoints**: Use Wave's semantic media query tokens rather than arbitrary pixel values
193
- `}]}))}},Re={colors:["background","backgroundColor","backgroundImage","border","borderBlock","borderBlockEnd","borderBlockStart","borderBottom","borderBottomColor","borderColor","borderInline","borderInlineEnd","borderInlineStart","borderLeft","borderLeftColor","borderRight","borderRightColor","borderTop","borderTopColor","caretColor","color","columnRuleColor","fill","outlineColor","stroke","textDecorationColor"],fonts:["fontFamily"],fontSizes:["fontSize"],fontWeights:["fontWeight"],lineHeights:["lineHeight"],letterSpacings:["letterSpacing"],radii:["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],sizes:["blockSize","minBlockSize","maxBlockSize","inlineSize","minInlineSize","maxInlineSize","width","minWidth","maxWidth","height","minHeight","maxHeight","flexBasis","gridTemplateColumns","gridTemplateRows"],space:["gap","gridGap","columnGap","gridColumnGap","rowGap","gridRowGap","inset","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingInline","paddingInlineEnd","paddingInlineStart","top","right","bottom","left","scrollMargin","scrollMarginTop","scrollMarginRight","scrollMarginBottom","scrollMarginLeft","scrollMarginX","scrollMarginY","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollPadding","scrollPaddingTop","scrollPaddingRight","scrollPaddingBottom","scrollPaddingLeft","scrollPaddingX","scrollPaddingY","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart"],zIndices:["zIndex"],shadows:["boxShadow","textShadow"],transitions:["transition"],borderWidths:["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderStyles:["borderStyle","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},Ee={name:"get_tokens",description:"Retrieve the Wave Design System design tokens (colors, fonts, spacing, font styles, etc.) exposed by the `@gemini-suite/vera-react` package. Includes token type mappings to CSS properties and usage examples.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{const o=Object.entries(Re).map(([r,a])=>`| ${r} | ${a.join(", ")} |`).join(`
194
- `);return{content:[{type:"text",text:`Below is a list of design tokens available from Wave Design System.
193
+ `}]}))}},Re={colors:["background","backgroundColor","backgroundImage","border","borderBlock","borderBlockEnd","borderBlockStart","borderBottom","borderBottomColor","borderColor","borderInline","borderInlineEnd","borderInlineStart","borderLeft","borderLeftColor","borderRight","borderRightColor","borderTop","borderTopColor","caretColor","color","columnRuleColor","fill","outlineColor","stroke","textDecorationColor"],fonts:["fontFamily"],fontSizes:["fontSize"],fontWeights:["fontWeight"],lineHeights:["lineHeight"],letterSpacings:["letterSpacing"],radii:["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],sizes:["blockSize","minBlockSize","maxBlockSize","inlineSize","minInlineSize","maxInlineSize","width","minWidth","maxWidth","height","minHeight","maxHeight","flexBasis","gridTemplateColumns","gridTemplateRows"],space:["gap","gridGap","columnGap","gridColumnGap","rowGap","gridRowGap","inset","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockEnd","marginBlockStart","marginInline","marginInlineEnd","marginInlineStart","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingInline","paddingInlineEnd","paddingInlineStart","top","right","bottom","left","scrollMargin","scrollMarginTop","scrollMarginRight","scrollMarginBottom","scrollMarginLeft","scrollMarginX","scrollMarginY","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollPadding","scrollPaddingTop","scrollPaddingRight","scrollPaddingBottom","scrollPaddingLeft","scrollPaddingX","scrollPaddingY","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart"],zIndices:["zIndex"],shadows:["boxShadow","textShadow"],transitions:["transition"],borderWidths:["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderStyles:["borderStyle","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},Ee={name:"get_tokens",description:"Retrieve the Vera Design System design tokens (colors, fonts, spacing, font styles, etc.) exposed by the `@gemini-suite/vera-react` package. Includes token type mappings to CSS properties and usage examples.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{const o=Object.entries(Re).map(([r,a])=>`| ${r} | ${a.join(", ")} |`).join(`
194
+ `);return{content:[{type:"text",text:`Below is a list of design tokens available from Vera Design System.
195
195
  There are ${Object.keys(C).length} token types available:
196
196
 
197
197
  ${JSON.stringify(C)}`},{type:"text",text:`## Token Type to CSS Property Mapping
@@ -256,7 +256,7 @@ const rawSize = theme.sizes['20'].value;
256
256
  // .computedValue (or default) returns serialized CSS variables ("var(--colors-foregroundAccent)")
257
257
  const cssVar = theme.colors.foregroundAccent.computedValue;
258
258
  \`\`\`
259
- `}]}})}},Ie={name:"init",description:"Get guide on how to setup or create a project that includes Wave Design System.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{return{content:[{type:"text",text:`The getting started documentation for developing with Wave Design System is included below.
259
+ `}]}})}},Ie={name:"init",description:"Get guide on how to setup or create a project that includes Vera Design System.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{return{content:[{type:"text",text:`The getting started documentation for developing with Vera Design System is included below.
260
260
 
261
261
  It's **important** that if the project is using a tool like Vite or Next.js, one of the pre-configured starter templates should be used instead of manual configuration:
262
262
 
@@ -266,7 +266,7 @@ It's **important** that if the project is using a tool like Vite or Next.js, one
266
266
  ---
267
267
 
268
268
  ${await ye()}
269
- `}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve getting started documentation: ${d(o)}`}]}}})}},Le={name:"list_components",description:"List all components available from the Wave Design System. This tool retrieves the names of all available Wave Design System components grouped by category.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{const o=await k(),r=L(o);return{content:[{type:"text",text:`The following components are available in the Wave Design System:
269
+ `}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve getting started documentation: ${d(o)}`}]}}})}},Le={name:"list_components",description:"List all components available from the Vera Design System. This tool retrieves the names of all available Vera Design System components grouped by category.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{const o=await k(),r=L(o);return{content:[{type:"text",text:`The following components are available in the Vera Design System:
270
270
 
271
271
  ${Object.entries(r).map(([i,c])=>`## ${i}
272
272
  ${c.map(l=>`- ${l.name}`).join(`
@@ -276,12 +276,12 @@ ${c.map(l=>`- ${l.name}`).join(`
276
276
 
277
277
  Use the \`get_component\` tool to get more information about a specific component.
278
278
 
279
- Use these components from the \`@gemini-suite/vera-react\` package.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the component index: ${d(o)}`}]}}})}},_e={name:"list_icons",description:"List all icons available from the Wave Design System. Icons are sourced directly from the `@gemini-suite/design-icons` package.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{return{content:[{type:"text",text:`The following icons are available in the Wave Design System:
279
+ Use these components from the \`@gemini-suite/vera-react\` package.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the component index: ${d(o)}`}]}}})}},_e={name:"list_icons",description:"List all icons available from the Vera Design System. Icons are sourced directly from the `@gemini-suite/design-icons` package.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{return{content:[{type:"text",text:`The following icons are available in the Vera Design System:
280
280
 
281
281
  ${w().map(a=>`- ${a.name}`).join(`
282
282
  `)}
283
283
 
284
- Use the \`get_icon\` tool to retrieve the SVG markup and usage guidelines for a specific icon.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the icon data: ${d(o)}`}]}}})}},ze={name:"list_patterns",description:"List all UX patterns available from the Wave Design System. This tool retrieves the names of all available Wave Design System patterns grouped by category.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{const o=await $(),r=L(o);return{content:[{type:"text",text:`The following UX patterns are available in the Wave Design System:
284
+ Use the \`get_icon\` tool to retrieve the SVG markup and usage guidelines for a specific icon.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the icon data: ${d(o)}`}]}}})}},ze={name:"list_patterns",description:"List all UX patterns available from the Vera Design System. This tool retrieves the names of all available Vera Design System patterns grouped by category.",exec(e,{name:t,description:n}){e.tool(t,n,async()=>{try{const o=await $(),r=L(o);return{content:[{type:"text",text:`The following UX patterns are available in the Vera Design System:
285
285
 
286
286
  ${Object.entries(r).map(([i,c])=>`## ${i}
287
287
  ${c.map(l=>`- ${l.name}`).join(`
@@ -289,4 +289,4 @@ ${c.map(l=>`- ${l.name}`).join(`
289
289
 
290
290
  `)}
291
291
 
292
- Use the \`get_pattern\` tool to access detailed guidance for a specific pattern.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the pattern index: ${d(o)}`}]}}})}},We=[Ie,Le,$e,ze,Ce,ke,_e,Te,Ee,Be],_=new Set;async function Ue(e){await Promise.all(We.map(async t=>{if(_.has(t.name))return;const n=await t.ctx?.();_.add(t.name),t.exec(e,{name:t.name,description:t.description,ctx:n})}))}s(Ue,"initializeTools");export{Ue as i};
292
+ Use the \`get_pattern\` tool to access detailed guidance for a specific pattern.`}]}}catch(o){return{isError:!0,content:[{type:"text",text:`Failed to retrieve the pattern index: ${d(o)}`}]}}})}},Ue=[Ie,Le,$e,ze,Ce,ke,_e,Te,Ee,Be],_=new Set;async function Me(e){await Promise.all(Ue.map(async t=>{if(_.has(t.name))return;const n=await t.ctx?.();_.add(t.name),t.exec(e,{name:t.name,description:t.description,ctx:n})}))}s(Me,"initializeTools");export{Me as i};
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- var e=Object.defineProperty;var t=(o,r)=>e(o,"name",{value:r,configurable:!0});import{i}from"./server-yX5dvPLU.js";import{s as g}from"./server-yX5dvPLU.js";import"node:fs";import"node:url";import"@modelcontextprotocol/sdk/server/mcp.js";if(i(import.meta.url)){const r=process.argv.slice(2)[0]||"stdio";async function s(){try{switch(r){case"stdio":await import("./transports/stdio.js");break;case"http":process.argv.push("--auto-run"),await import("./transports/http.js");break;default:console.error(`Unknown transport: ${r}`),console.error("Available transports: stdio, http"),process.exit(1)}}catch(a){console.error("Error running transport:",a),process.exit(1)}}t(s,"run"),s()}export{g as server};
2
+ var e=Object.defineProperty;var t=(o,r)=>e(o,"name",{value:r,configurable:!0});import{i}from"./server-DHaCm-qj.js";import{s as g}from"./server-DHaCm-qj.js";import"node:fs";import"node:url";import"@modelcontextprotocol/sdk/server/mcp.js";if(i(import.meta.url)){const r=process.argv.slice(2)[0]||"stdio";async function s(){try{switch(r){case"stdio":await import("./transports/stdio.js");break;case"http":process.argv.push("--auto-run"),await import("./transports/http.js");break;default:console.error(`Unknown transport: ${r}`),console.error("Available transports: stdio, http"),process.exit(1)}}catch(a){console.error("Error running transport:",a),process.exit(1)}}t(s,"run"),s()}export{g as server};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var t=(r,e)=>i(r,"name",{value:e,configurable:!0});import{realpathSync as c}from"node:fs";import{pathToFileURL as f}from"node:url";import{McpServer as p}from"@modelcontextprotocol/sdk/server/mcp.js";async function u(r,e,s){const n=await fetch(r,e);if(!n.ok){const a=s??`fetch ${r}`;throw new Error(`Failed to ${a}: ${n.status} ${n.statusText}`)}return n.text()}t(u,"fetchMarkdown");function m(r,e){return r.type===e}t(m,"isNodeType");function v(r){return Array.from(new Set(r))}t(v,"uniq");function h(r){return r instanceof Error?r.message:"Unknown error"}t(h,"getErrorMessage");function g(r){if(!process.argv[1])return!1;const e=c(process.argv[1]),s=f(e);return r===s.href}t(g,"isEntryFile");var l="0.1.9",o={version:l};const w=new p({name:"Vera Design System",version:o.version},{capabilities:{tools:{}}});export{m as a,u as f,h as g,g as i,o as p,w as s,v as u};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- var h=Object.defineProperty;var i=(e,s)=>h(e,"name",{value:s,configurable:!0});import{StreamableHTTPServerTransport as f}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{isInitializeRequest as g}from"@modelcontextprotocol/sdk/types.js";import I from"cors";import l from"express";import{randomUUID as S}from"node:crypto";import{s as m,p as T,i as w}from"../server-yX5dvPLU.js";import{i as y}from"../index-CX_RGZzy.js";import"node:fs";import"node:url";import"@modelcontextprotocol/sdk/server/mcp.js";import"@gemini-suite/design-colors/generic";import"@gemini-suite/design-icons";import"@gemini-suite/design-media-queries";import"remark-parse";import"unified";import"zod";import"@gemini-suite/design-colors/flat";const t=l(),P=process.env.CORS_ORIGIN?.split(",")??"*";t.use(I({origin:P,exposedHeaders:["Mcp-Session-Id"],allowedHeaders:["Content-Type","mcp-session-id"]})),t.use(l.json());const r=new Map;t.post("/mcp",async(e,s)=>{const n=e.headers["mcp-session-id"];let o;if(n&&r.has(n))o=r.get(n);else if(!n&&g(e.body))o=new f({sessionIdGenerator:i(()=>S(),"sessionIdGenerator"),onsessioninitialized:i(v=>{r.set(v,o)},"onsessioninitialized")}),o.onclose=()=>{o.sessionId&&r.has(o.sessionId)&&r.delete(o.sessionId)},await y(m),await m.connect(o);else return s.status(400).json({error:{message:"Bad Request: No valid session ID provided"}});await o.handleRequest(e,s,e.body)});const d=i(async(e,s)=>{const n=e.headers["mcp-session-id"];if(!n||!r.has(n))return s.status(404).send("Invalid or missing session ID");await r.get(n).handleRequest(e,s)},"handleSessionRequest");t.get("/mcp",d),t.delete("/mcp",d),t.get("/",(e,s)=>{s.json({name:"Wave MCP Server",version:T.version,description:"MCP server for Wave Design System",endpoints:{"/":"Server information (this response)","/mcp":"Streamable HTTP endpoint for MCP connection","/health":"Health check endpoint"}})}),t.get("/health",(e,s)=>{s.json({status:"healthy",timestamp:new Date().toISOString(),uptime:process.uptime()})});const a=process.env.HOST??"localhost",p=process.env.PORT?Number(process.env.PORT):3e3;let c=null;(process.argv.includes("--auto-run")||w(import.meta.url))&&(c=t.listen(p,a,e=>{e&&(console.error("\u274C Failed to start server:",e),process.exit(1)),console.log(`\u{1F680} Wave MCP Server running on http://${a}:${p}`),console.log(`\u{1F517} Connect via http://${a}:${p}/mcp`)}));const u=i(async()=>{const e=Array.from(r.values()).map(s=>s.close());c&&e.push(new Promise(s=>c.close(()=>s()))),await Promise.allSettled(e),console.log("\u{1F44B} Server shut down gracefully"),process.exit(0)},"cleanup");process.on("SIGTERM",u),process.on("SIGINT",u);export{t as default};
2
+ var v=Object.defineProperty;var i=(e,s)=>v(e,"name",{value:s,configurable:!0});import{StreamableHTTPServerTransport as f}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{isInitializeRequest as g}from"@modelcontextprotocol/sdk/types.js";import I from"cors";import l from"express";import{randomUUID as S}from"node:crypto";import{s as m,p as T,i as w}from"../server-DHaCm-qj.js";import{i as y}from"../index-DCrtFnUq.js";import"node:fs";import"node:url";import"@modelcontextprotocol/sdk/server/mcp.js";import"@gemini-suite/design-colors/generic";import"@gemini-suite/design-icons";import"@gemini-suite/design-media-queries";import"remark-parse";import"unified";import"zod";import"@gemini-suite/design-colors/flat";const t=l(),P=process.env.CORS_ORIGIN?.split(",")??"*";t.use(I({origin:P,exposedHeaders:["Mcp-Session-Id"],allowedHeaders:["Content-Type","mcp-session-id"]})),t.use(l.json());const r=new Map;t.post("/mcp",async(e,s)=>{const n=e.headers["mcp-session-id"];let o;if(n&&r.has(n))o=r.get(n);else if(!n&&g(e.body))o=new f({sessionIdGenerator:i(()=>S(),"sessionIdGenerator"),onsessioninitialized:i(h=>{r.set(h,o)},"onsessioninitialized")}),o.onclose=()=>{o.sessionId&&r.has(o.sessionId)&&r.delete(o.sessionId)},await y(m),await m.connect(o);else return s.status(400).json({error:{message:"Bad Request: No valid session ID provided"}});await o.handleRequest(e,s,e.body)});const d=i(async(e,s)=>{const n=e.headers["mcp-session-id"];if(!n||!r.has(n))return s.status(404).send("Invalid or missing session ID");await r.get(n).handleRequest(e,s)},"handleSessionRequest");t.get("/mcp",d),t.delete("/mcp",d),t.get("/",(e,s)=>{s.json({name:"Wave MCP Server",version:T.version,description:"MCP server for Vera Design System",endpoints:{"/":"Server information (this response)","/mcp":"Streamable HTTP endpoint for MCP connection","/health":"Health check endpoint"}})}),t.get("/health",(e,s)=>{s.json({status:"healthy",timestamp:new Date().toISOString(),uptime:process.uptime()})});const a=process.env.HOST??"localhost",p=process.env.PORT?Number(process.env.PORT):3e3;let c=null;(process.argv.includes("--auto-run")||w(import.meta.url))&&(c=t.listen(p,a,e=>{e&&(console.error("\u274C Failed to start server:",e),process.exit(1)),console.log(`\u{1F680} Wave MCP Server running on http://${a}:${p}`),console.log(`\u{1F517} Connect via http://${a}:${p}/mcp`)}));const u=i(async()=>{const e=Array.from(r.values()).map(s=>s.close());c&&e.push(new Promise(s=>c.close(()=>s()))),await Promise.allSettled(e),console.log("\u{1F44B} Server shut down gracefully"),process.exit(0)},"cleanup");process.on("SIGTERM",u),process.on("SIGINT",u);export{t as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- var s=Object.defineProperty;var t=(o,r)=>s(o,"name",{value:r,configurable:!0});import{StdioServerTransport as e}from"@modelcontextprotocol/sdk/server/stdio.js";import{s as i}from"../server-yX5dvPLU.js";import{i as p}from"../index-CX_RGZzy.js";import"node:fs";import"node:url";import"@modelcontextprotocol/sdk/server/mcp.js";import"@gemini-suite/design-colors/generic";import"@gemini-suite/design-icons";import"@gemini-suite/design-media-queries";import"remark-parse";import"unified";import"zod";import"@gemini-suite/design-colors/flat";async function a(){await p(i);const o=new e;await i.connect(o);const r=t(async()=>{await o.close(),process.exit(0)},"cleanup");process.on("SIGTERM",r),process.on("SIGINT",r)}t(a,"main"),a().catch(o=>{console.error("\u274C Failed to start server:",o),process.exit(1)});
2
+ var s=Object.defineProperty;var t=(o,r)=>s(o,"name",{value:r,configurable:!0});import{StdioServerTransport as e}from"@modelcontextprotocol/sdk/server/stdio.js";import{s as i}from"../server-DHaCm-qj.js";import{i as p}from"../index-DCrtFnUq.js";import"node:fs";import"node:url";import"@modelcontextprotocol/sdk/server/mcp.js";import"@gemini-suite/design-colors/generic";import"@gemini-suite/design-icons";import"@gemini-suite/design-media-queries";import"remark-parse";import"unified";import"zod";import"@gemini-suite/design-colors/flat";async function a(){await p(i);const o=new e;await i.connect(o);const r=t(async()=>{await o.close(),process.exit(0)},"cleanup");process.on("SIGTERM",r),process.on("SIGINT",r)}t(a,"main"),a().catch(o=>{console.error("\u274C Failed to start server:",o),process.exit(1)});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gemini-suite/vera-mcp",
3
- "version": "0.1.8",
4
- "description": "An MCP server that connects AI tools to the Wave Design System",
3
+ "version": "0.1.9",
4
+ "description": "An MCP server that connects AI tools to the Vera Design System",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
7
7
  "type": "git",
@@ -67,7 +67,7 @@
67
67
  "zod": "3.25.76"
68
68
  },
69
69
  "devDependencies": {
70
- "@gemini-suite/vera-react": "1.6.1",
70
+ "@gemini-suite/vera-react": "1.6.2",
71
71
  "@types/node": "22.19.7",
72
72
  "@volue/eslint-config": "1.3.12",
73
73
  "eslint": "9.39.2",
@@ -1 +0,0 @@
1
- var i=Object.defineProperty;var t=(e,r)=>i(e,"name",{value:r,configurable:!0});import{realpathSync as c}from"node:fs";import{pathToFileURL as f}from"node:url";import{McpServer as p}from"@modelcontextprotocol/sdk/server/mcp.js";async function u(e,r,s){const n=await fetch(e,r);if(!n.ok){const a=s??`fetch ${e}`;throw new Error(`Failed to ${a}: ${n.status} ${n.statusText}`)}return n.text()}t(u,"fetchMarkdown");function v(e,r){return e.type===r}t(v,"isNodeType");function m(e){return Array.from(new Set(e))}t(m,"uniq");function h(e){return e instanceof Error?e.message:"Unknown error"}t(h,"getErrorMessage");function g(e){if(!process.argv[1])return!1;const r=c(process.argv[1]),s=f(r);return e===s.href}t(g,"isEntryFile");var l="0.1.8",o={version:l};const w=new p({name:"Wave Design System",version:o.version},{capabilities:{tools:{}}});export{v as a,u as f,h as g,g as i,o as p,w as s,m as u};