@mastergo/magic-mcp 0.1.8 → 0.1.9-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -497,9 +497,9 @@ AI must analyze component design and infer:
497
497
  Users need to actively call this tool to get the component development workflow. When Generator is mentioned, please actively call this tool.
498
498
  This tool provides a structured workflow for component development following best practices.
499
499
  You must provide an absolute rootPath of workspace to save workflow files.
500
- `,Tc=class extends Ke{constructor(){super();this.name=EZ;this.description=TZ;this.schema=ee.object({rootPath:ee.string().describe("The root path of the project, if the user does not provide, you can use the current directory as the root path"),fileId:ee.string().describe("MasterGo design file ID (format: file/<fileId> in MasterGo URL)"),layerId:ee.string().describe("Layer ID of the specific component or element to retrieve (format: ?layer_id=<layerId> / file=<fileId> in MasterGo URL)"),sourceLayerId:ee.string().optional().describe("Source layer ID from URL parameter source_layer_id. When provided, use this instead of layerId for all queries.")})}async execute({rootPath:r,fileId:n,layerId:o,sourceLayerId:i}){var p;let s=`${r}/.mastergo/`;er.default.existsSync(s)||er.default.mkdirSync(s,{recursive:!0});let a=`${s}/component-workflow.md`,c=await ft.getComponentStyleJson(n,o,i),u=`${s}/${c[0].name}.json`,l=m=>{if(m.path&&m.path.length>0){m.imageUrls=[];let h=m.id.replaceAll("/","&"),d=`${s}/images`;er.default.existsSync(d)||er.default.mkdirSync(d,{recursive:!0}),(m.path??[]).forEach((f,x)=>{let g=`${d}/${h}-${x}.svg`;er.default.existsSync(g)||er.default.writeFileSync(g,`<svg width="100%" height="100%" viewBox="0 0 16 16"xmlns="http://www.w3.org/2000/svg">
500
+ `,Tc=class extends Ke{constructor(){super();this.name=EZ;this.description=TZ;this.schema=ee.object({rootPath:ee.string().describe("The root path of the project, if the user does not provide, you can use the current directory as the root path"),fileId:ee.string().describe("MasterGo design file ID (format: file/<fileId> in MasterGo URL)"),layerId:ee.string().describe("Layer ID of the specific component or element to retrieve (format: ?layer_id=<layerId> / file=<fileId> in MasterGo URL)"),sourceLayerId:ee.string().optional().describe("Source layer ID from URL parameter source_layer_id. When provided, use this instead of layerId for all queries.")})}async execute({rootPath:r,fileId:n,layerId:o,sourceLayerId:i}){var p;let s=`${r}/.mastergo/`;er.default.existsSync(s)||er.default.mkdirSync(s,{recursive:!0});let a=`${s}/component-workflow.md`,c=await ft.getComponentStyleJson(n,o,i),u=`${s}/${c[0].name}.json`,l=m=>{if(m.path&&m.path.length>0){m.imageUrls=[];let h=m.id.replaceAll("/","&").replaceAll(":","_"),d=`${s}/images`;er.default.existsSync(d)||er.default.mkdirSync(d,{recursive:!0}),(m.path??[]).forEach((f,x)=>{let g=`${d}/${h}-${x}.svg`;er.default.existsSync(g)||er.default.writeFileSync(g,`<svg width="100%" height="100%" viewBox="0 0 16 16"xmlns="http://www.w3.org/2000/svg">
501
501
  <path d="${f}" fill="currentColor"/>
502
- </svg>`),m.imageUrls.push(g)}),delete m.path}m.children&&m.children.forEach(h=>{l(h)})};l(c[0]),er.default.existsSync(a)||er.default.writeFileSync(a,ak),er.default.writeFileSync(u,JSON.stringify(c[0]));try{return{content:[{type:"text",text:JSON.stringify({files:{workflow:a,componentSpec:u},message:"Component development files successfully created",rules:[`Follow the component workflow process defined in file://${a} for structured development. This workflow contains a lot of content, you'll need to read it in multiple sessions.`,`Implement the component according to the specifications in file://${u}, ensuring all properties and states are properly handled.`]})}]}}catch(m){let h=((p=m.response)==null?void 0:p.data)??(m==null?void 0:m.message);return{isError:!0,content:[{type:"text",text:JSON.stringify(h)}]}}}};var Pc={name:"@mastergo/magic-mcp",version:"0.1.8",description:"MasterGo MCP standalone service",main:"dist/index.js",bin:{"mastergo-magic-mcp":"dist/index.js"},files:["dist/**/*","!**/*.map","!**/.DS_Store","!**/.idea","!**/.vscode"],engines:{node:">=18"},scripts:{build:"node build.js",start:"node dist/index.js --token=test --url=http://localhost:3000 --debug",prepare:"npm run build",prepublishOnly:"npm run build"},keywords:["mastergo","mcp","ai"],author:"",license:"ISC",private:!1,dependencies:{"@modelcontextprotocol/sdk":"^1.6.1",axios:"1.6.0","https-proxy-agent":"^9.0.0",zod:"^3.22.4"},devDependencies:{"@types/node":"^20.8.10","@typescript-eslint/eslint-plugin":"^6.9.1","@typescript-eslint/parser":"^6.9.1",esbuild:"^0.25.1","esbuild-plugin-tsc":"^0.5.0",eslint:"^8.52.0",pkg:"^5.8.1",prettier:"^3.0.3","ts-node":"^10.9.1",typescript:"^5.2.2"}};var RZ=`version_${Pc.version.replace(/\./g,"_")}`,CZ=`the current version is ${Pc.version}`,Rc=class extends Ke{constructor(){super();this.name=RZ;this.description=CZ;this.schema=ee.object({})}async execute({}){return{content:[{type:"text",text:JSON.stringify(Pc.version)}]}}};function IZ(){let{token:t,baseUrl:e,rules:r,debug:n,noRule:o,proxy:i}=H0();n&&(process.env.DEBUG="true",console.log("Debug information:"),console.log(`Token: ${t?"set":"not set"}`),console.log(`API URL: ${e||"default"}`),console.log(`Rules: ${r.length>0?r.join(", "):"none"}`),console.log(`No Rule: ${o?"enabled":"disabled"}`),console.log(`Proxy: ${i||"none"}`),console.log("Debug mode: enabled"));let s=new Fa({name:"MasterGoMcpServer",version:"0.0.1"});new Rc().register(s),new wc().register(s),new $c().register(s),new Sc().register(s),new zc().register(s),new Ec().register(s),new Tc().register(s),s.connect(new Va)}IZ();
502
+ </svg>`),m.imageUrls.push(g)}),delete m.path}m.children&&m.children.forEach(h=>{l(h)})};l(c[0]),er.default.existsSync(a)||er.default.writeFileSync(a,ak),er.default.writeFileSync(u,JSON.stringify(c[0]));try{return{content:[{type:"text",text:JSON.stringify({files:{workflow:a,componentSpec:u},message:"Component development files successfully created",rules:[`Follow the component workflow process defined in file://${a} for structured development. This workflow contains a lot of content, you'll need to read it in multiple sessions.`,`Implement the component according to the specifications in file://${u}, ensuring all properties and states are properly handled.`]})}]}}catch(m){let h=((p=m.response)==null?void 0:p.data)??(m==null?void 0:m.message);return{isError:!0,content:[{type:"text",text:JSON.stringify(h)}]}}}};var Pc={name:"@mastergo/magic-mcp",version:"0.1.9-alpha.0",description:"MasterGo MCP standalone service",main:"dist/index.js",bin:{"mastergo-magic-mcp":"dist/index.js"},files:["dist/**/*","!**/*.map","!**/.DS_Store","!**/.idea","!**/.vscode"],engines:{node:">=18"},scripts:{build:"node build.js",start:"node dist/index.js --token=test --url=http://localhost:3000 --debug",prepare:"npm run build",prepublishOnly:"npm run build"},keywords:["mastergo","mcp","ai"],author:"",license:"ISC",private:!1,dependencies:{"@modelcontextprotocol/sdk":"^1.6.1",axios:"1.6.0","https-proxy-agent":"^9.0.0",zod:"^3.22.4"},devDependencies:{"@types/node":"^20.8.10","@typescript-eslint/eslint-plugin":"^6.9.1","@typescript-eslint/parser":"^6.9.1",esbuild:"^0.25.1","esbuild-plugin-tsc":"^0.5.0",eslint:"^8.52.0",pkg:"^5.8.1",prettier:"^3.0.3","ts-node":"^10.9.1",typescript:"^5.2.2"}};var RZ=`version_${Pc.version.replace(/\./g,"_")}`,CZ=`the current version is ${Pc.version}`,Rc=class extends Ke{constructor(){super();this.name=RZ;this.description=CZ;this.schema=ee.object({})}async execute({}){return{content:[{type:"text",text:JSON.stringify(Pc.version)}]}}};function IZ(){let{token:t,baseUrl:e,rules:r,debug:n,noRule:o,proxy:i}=H0();n&&(process.env.DEBUG="true",console.log("Debug information:"),console.log(`Token: ${t?"set":"not set"}`),console.log(`API URL: ${e||"default"}`),console.log(`Rules: ${r.length>0?r.join(", "):"none"}`),console.log(`No Rule: ${o?"enabled":"disabled"}`),console.log(`Proxy: ${i||"none"}`),console.log("Debug mode: enabled"));let s=new Fa({name:"MasterGoMcpServer",version:"0.0.1"});new Rc().register(s),new wc().register(s),new $c().register(s),new Sc().register(s),new zc().register(s),new Ec().register(s),new Tc().register(s),s.connect(new Va)}IZ();
503
503
  /*! Bundled license information:
504
504
 
505
505
  mime-db/index.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastergo/magic-mcp",
3
- "version": "0.1.8",
3
+ "version": "0.1.9-alpha.0",
4
4
  "description": "MasterGo MCP standalone service",
5
5
  "main": "dist/index.js",
6
6
  "bin": {