m8-mcp-server 1.0.9 → 1.0.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"card-component.d.ts","sourceRoot":"","sources":["../../src/generator/card-component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAsB,MAAM,mBAAmB,CAAC;AAuXvG;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CAsD5F"}
1
+ {"version":3,"file":"card-component.d.ts","sourceRoot":"","sources":["../../src/generator/card-component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAsB,MAAM,mBAAmB,CAAC;AA4avG;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CAuD5F"}
@@ -1,8 +1,8 @@
1
- function p(t){const e=[];return(t.includes("\u6807\u9898")||t.includes("\u6587\u5B57"))&&(e.push({name:"title",type:"text",displayName:"\u6807\u9898\u5185\u5BB9"}),e.push({name:"fontSize",type:"font",displayName:"\u5B57\u4F53\u5927\u5C0F"}),e.push({name:"color",type:"color",displayName:"\u5B57\u4F53\u989C\u8272"})),(t.includes("\u56FE\u7247")||t.includes("\u8F6E\u64AD"))&&(e.push({name:"image",type:"uploadimage",displayName:"\u4E0A\u4F20\u56FE\u7247"}),e.push({name:"borderRadius",type:"text",displayName:"\u5706\u89D2"})),t.includes("\u80CC\u666F")&&e.push({name:"backgroundColor",type:"color",displayName:"\u80CC\u666F\u989C\u8272"}),(t.includes("\u5217\u8868")||t.includes("\u6570\u7EC4"))&&e.push({name:"list",type:"array",displayName:"\u5217\u8868\u6570\u636E"}),(t.includes("\u9AD8\u5EA6")||t.includes("\u5BBD\u5EA6"))&&e.push({name:"size",type:"text",displayName:"\u5C3A\u5BF8"}),e}function l(t){return`export default {
2
- name: "${t}",
3
- module_name: "${t}",
1
+ function p(a){const e=[];return(a.includes("\u6807\u9898")||a.includes("\u6587\u5B57"))&&(e.push({name:"title",type:"text",displayName:"\u6807\u9898\u5185\u5BB9"}),e.push({name:"fontSize",type:"font",displayName:"\u5B57\u4F53\u5927\u5C0F"}),e.push({name:"color",type:"color",displayName:"\u5B57\u4F53\u989C\u8272"})),(a.includes("\u56FE\u7247")||a.includes("\u8F6E\u64AD"))&&(e.push({name:"image",type:"uploadimage",displayName:"\u4E0A\u4F20\u56FE\u7247"}),e.push({name:"borderRadius",type:"text",displayName:"\u5706\u89D2"})),a.includes("\u80CC\u666F")&&e.push({name:"backgroundColor",type:"color",displayName:"\u80CC\u666F\u989C\u8272"}),(a.includes("\u5217\u8868")||a.includes("\u6570\u7EC4"))&&e.push({name:"list",type:"array",displayName:"\u5217\u8868\u6570\u636E"}),(a.includes("\u9AD8\u5EA6")||a.includes("\u5BBD\u5EA6"))&&e.push({name:"size",type:"text",displayName:"\u5C3A\u5BF8"}),e}function l(a){return`export default {
2
+ name: "${a}",
3
+ module_name: "${a}",
4
4
  version: "0.1.0"
5
- };`}function r(t,e){return`import base from "./base";
5
+ };`}function m(a,e){return`import base from "./base";
6
6
  import boxOptions from "../plugin/boxoptions/config";
7
7
 
8
8
  export default {
@@ -20,13 +20,13 @@ export default {
20
20
  displayName: "\u57FA\u7840\u914D\u7F6E",
21
21
  name: "basicSetting",
22
22
  value: [
23
- ${p(e).map(n=>{let a='""';return n.type==="color"&&(a='"#000000"'),n.type==="number"&&(a=14),n.type==="boolean"&&(a=!1),n.type==="array"&&(a="[]"),`{
24
- displayName: "${n.displayName}",
25
- name: "${n.name}",
26
- value: ${a},
27
- type: "${n.type}"
23
+ ${p(e).map(t=>{let n='""';return t.type==="color"&&(n='"#000000"'),t.type==="number"&&(n=14),t.type==="boolean"&&(n=!1),t.type==="array"&&(n="[]"),`{
24
+ displayName: "${t.displayName}",
25
+ name: "${t.name}",
26
+ value: ${n},
27
+ type: "${t.type}"
28
28
  }`}).join(`,
29
- `)}
29
+ `)}
30
30
  ]
31
31
  }
32
32
  ]
@@ -111,13 +111,66 @@ export default {
111
111
  }
112
112
  ]
113
113
  }
114
+ },
115
+ {
116
+ name: "event",
117
+ displayName: "\u4E8B\u4EF6\uFF08\u65B0\uFF09",
118
+ type: "array",
119
+ value: [
120
+ {
121
+ name: "onMounted",
122
+ displayName: "onMounted\u4E8B\u4EF6",
123
+ dynamic: true,
124
+ type: "array",
125
+ value: [],
126
+ template: {
127
+ name: "templeteMounted_1",
128
+ displayName: "\u52A8\u4F5C",
129
+ type: "text",
130
+ value: 'console.log("onMounted\u4E8B\u4EF6:", e)'
131
+ }
132
+ },
133
+ {
134
+ name: "onClick",
135
+ displayName: "onClick\u4E8B\u4EF6",
136
+ dynamic: true,
137
+ type: "array",
138
+ value: [
139
+ {
140
+ name: "OnClick_1",
141
+ displayName: "\u52A8\u4F5C",
142
+ type: "text",
143
+ value: 'console.log("OnClick\u4E8B\u4EF6:", e)'
144
+ }
145
+ ],
146
+ template: {
147
+ name: "templeteOnClick_1",
148
+ displayName: "\u52A8\u4F5C",
149
+ type: "text",
150
+ value: 'console.log("OnClick\u4E8B\u4EF6:", e)'
151
+ }
152
+ },
153
+ {
154
+ name: "onChange",
155
+ displayName: "onChange\u4E8B\u4EF6",
156
+ dynamic: true,
157
+ type: "array",
158
+ value: [],
159
+ template: {
160
+ name: "templeteOnChange_1",
161
+ displayName: "\u503C\u53D8\u52A8",
162
+ type: "text",
163
+ value: 'console.log("onChange\u4E8B\u4EF6:", e)'
164
+ }
165
+ }
166
+ ]
114
167
  }
115
168
  ]
116
169
  }
117
170
  ]
118
- };`}function m(t){return`<template>
171
+ };`}function r(a){return`<template>
119
172
  <div class="epoint-component" :style="boxOptions">
120
- <div class="${t.toLowerCase()}-container">
173
+ <div class="${a.toLowerCase()}-container">
121
174
  <!-- \u7EC4\u4EF6\u5185\u5BB9 -->
122
175
  <div>{{ config.options.basicSetting.title || '\u9ED8\u8BA4\u6807\u9898' }}</div>
123
176
  </div>
@@ -164,7 +217,7 @@ export default {
164
217
 
165
218
  <style lang="scss" scoped>
166
219
  @import './css/index.scss';
167
- </style>`}function c(t){return`.${t.toLowerCase()}-container {
220
+ </style>`}function c(a){return`.${a.toLowerCase()}-container {
168
221
  width: 100%;
169
222
  height: 100%;
170
223
  position: relative;
@@ -198,7 +251,7 @@ export { default as component } from './index.vue';
198
251
 
199
252
  export default {
200
253
  install
201
- };`}function g(){return`export default {
254
+ };`}function y(){return`export default {
202
255
  displayName: '\u901A\u7528\u5BB9\u5668\u6837\u5F0F',
203
256
  name: 'boxOptions',
204
257
  value: [
@@ -265,8 +318,8 @@ export default {
265
318
  ]
266
319
  }
267
320
  ]
268
- };`}function y(){return`import eventGenerate from '@epoint-mrc/vue-cli-plugin-mc/src/mccontext/eventgenerate.js';
321
+ };`}function g(){return`import eventGenerate from '@epoint-mrc/vue-cli-plugin-mc/src/mccontext/eventgenerate.js';
269
322
 
270
323
  export default {
271
324
  mixins: [eventGenerate]
272
- };`}function f(t){const{componentName:e,requirement:i,projectName:o}=t,n=o?`card_components/${o}/${e}`:`card_components/${e}`,a=[{path:`${n}/index.vue`,content:m(e),language:"vue"},{path:`${n}/index.js`,content:d(),language:"javascript"},{path:`${n}/js/base.js`,content:l(e),language:"javascript"},{path:`${n}/js/config.js`,content:r(e,i),language:"javascript"},{path:`${n}/mock/data.js`,content:u(),language:"javascript"},{path:`${n}/css/index.scss`,content:c(e),language:"scss"},{path:`${n}/plugin/boxoptions/config.js`,content:g(),language:"javascript"},{path:`${n}/plugin/eventgenerate/index.js`,content:y(),language:"javascript"}],s=`npm run ioc create ${e}`;return{files:a,createCommand:s,explanation:`\u5DF2\u751F\u6210\u7EC4\u4EF6 ${e} \u7684\u4EE3\u7801\u6587\u4EF6\u3002\u8BF7\u786E\u4FDD\u5148\u8FD0\u884C '${s}' \u521B\u5EFA\u7EC4\u4EF6\u6A21\u677F\u3002`}}export{f as generateCardComponentCode};
325
+ };`}function f(a){const{componentName:e,requirement:i,projectName:o}=a,t=o?`src/card_components/${o}/${e}`:`src/card_components/${e}`,n=[{path:`${t}/index.vue`,content:r(e),language:"vue"},{path:`${t}/index.js`,content:d(),language:"javascript"},{path:`${t}/js/base.js`,content:l(e),language:"javascript"},{path:`${t}/js/config.js`,content:m(e,i),language:"javascript"},{path:`${t}/mock/data.js`,content:u(),language:"javascript"},{path:`${t}/css/index.scss`,content:c(e),language:"scss"},{path:`${t}/plugin/boxoptions/config.js`,content:y(),language:"javascript"},{path:`${t}/plugin/eventgenerate/index.js`,content:g(),language:"javascript"}],s=`npm run ioc create ${e}`;return{files:n,createCommand:s,explanation:`\u5DF2\u751F\u6210\u7EC4\u4EF6 ${e} \u7684\u4EE3\u7801\u6587\u4EF6\u3002\u8BF7\u786E\u4FDD\u5148\u8FD0\u884C '${s}' \u521B\u5EFA\u7EC4\u4EF6\u6A21\u677F\u3002`}}export{f as generateCardComponentCode};
@@ -1 +1 @@
1
- {"version":3,"file":"generate-code.d.ts","sourceRoot":"","sources":["../../src/tools/generate-code.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAoC,MAAM,mBAAmB,CAAC;AAGtG;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,cAqFpC,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAmH5F"}
1
+ {"version":3,"file":"generate-code.d.ts","sourceRoot":"","sources":["../../src/tools/generate-code.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAoC,MAAM,mBAAmB,CAAC;AAGtG;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,cAiDpC,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAmH5F"}
@@ -1,39 +1,3 @@
1
- import{codeGenerator as a}from"../generator/index.js";const y={name:"generate_code",description:`\u6839\u636E\u9700\u6C42\u751F\u6210\u7B26\u5408 M8 \u6846\u67B6\u89C4\u8303\u7684\u4EE3\u7801\uFF0C\u4E25\u683C\u9075\u5FAA\u5185\u7F6E\u89C4\u8303\u3002
2
-
3
- ## \u5FC5\u987B\u9075\u5FAA\u7684\u89C4\u8303
4
-
5
- ### 1. \u7EC4\u4EF6\u4F7F\u7528\u89C4\u8303
6
- - **\u53EA\u80FD\u4F7F\u7528 M8 \u7EC4\u4EF6\u5E93\u4E2D\u7684\u7EC4\u4EF6**\uFF1A\u5982 em-field\uFF08\u8F93\u5165\u6846\uFF09\u3001em-button\uFF08\u6309\u94AE\uFF09\u3001em-cell\uFF08\u5355\u5143\u683C\uFF09\u7B49
7
- - **\u4E0D\u5B58\u5728\u7684\u7EC4\u4EF6\u4F1A\u88AB\u81EA\u52A8\u8FC7\u6EE4**\uFF1A\u5982 em-input \u4F1A\u81EA\u52A8\u4FEE\u6B63\u4E3A em-field
8
- - \u5E38\u89C1\u7EC4\u4EF6\u6620\u5C04\uFF1A
9
- - em-input/em-textarea \u2192 em-field
10
- - em-select \u2192 em-picker
11
- - em-date/em-time \u2192 em-datepicker
12
-
13
- ### 2. API \u8C03\u7528\u89C4\u8303
14
- - **Toast/\u63D0\u793A**\uFF1A\u5FC5\u987B\u4F7F\u7528 \`ejs.ui.toast({ message: "\u63D0\u793A\u5185\u5BB9" })\` \u800C\u975E uni.showToast
15
- - **Loading**\uFF1A\u5FC5\u987B\u4F7F\u7528 \`ejs.ui.showWaiting({ message: "\u52A0\u8F7D\u4E2D..." })\` \u548C \`ejs.ui.closeWaiting()\`
16
- - **\u786E\u8BA4\u6846**\uFF1A\u5FC5\u987B\u4F7F\u7528 \`ejs.ui.confirm({ title: "\u6807\u9898", message: "\u5185\u5BB9" })\`
17
- - **\u9009\u62E9\u5668**\uFF1A\u4F18\u5148\u4F7F\u7528 \`ejs.ui.picker\`\u3001\`ejs.ui.pickDate\` \u7B49 API
18
-
19
- ### 3. \u8BF7\u6C42\u89C4\u8303
20
- - **\u5FC5\u987B\u4F7F\u7528** \`Util.ajax + Config.serverUrl\` \u53D1\u9001\u8BF7\u6C42
21
- - **\u7981\u6B62\u4F7F\u7528** fetch\u3001axios\u3001uni.request
22
- - Mock \u8DEF\u5F84\u683C\u5F0F\uFF1A\`/rest/mock/[\u6A21\u5757\u540D]/[\u63A5\u53E3\u540D]\`
23
-
24
- ### 4. \u6587\u4EF6\u7ED3\u6784\u89C4\u8303
25
- - **Vue \u6837\u5F0F\u5FC5\u987B\u5265\u79BB**\uFF1A\u6837\u5F0F\u653E\u5728 \`css/[\u6A21\u5757\u540D].scss\`\uFF0C\u901A\u8FC7 \`@import\` \u5F15\u5165
26
- - **\u8DEF\u5F84\u56FA\u5B9A**\uFF1A\u9875\u9762\u9ED8\u8BA4\u751F\u6210\u5728 \`src/pages/[\u6A21\u5757\u540D]/\` \u4E0B
27
- - **full-page \u7C7B\u578B**\uFF1A\u81EA\u52A8\u751F\u6210 index.vue + css/[\u6A21\u5757\u540D].scss + router.js + mock.js
28
-
29
- ### 5. \u751F\u6210\u7684\u6587\u4EF6
30
- \`\`\`
31
- src/pages/[\u6A21\u5757\u540D]/
32
- \u251C\u2500\u2500 index.vue # Vue \u9875\u9762\u7EC4\u4EF6
33
- \u251C\u2500\u2500 router.js # \u8DEF\u7531\u914D\u7F6E
34
- \u251C\u2500\u2500 mock.js # Mock \u6570\u636E
35
- \u2514\u2500\u2500 css/
36
- \u2514\u2500\u2500 [\u6A21\u5757\u540D].scss # \u6837\u5F0F\u6587\u4EF6
37
- \`\`\``,inputSchema:{type:"object",properties:{type:{oneOf:[{type:"string",enum:["vue-component","javascript","scss","api-call","full-page"],description:"\u5355\u4E00\u4EE3\u7801\u7C7B\u578B\uFF0Cfull-page \u4F1A\u751F\u6210\u5B8C\u6574\u9875\u9762\uFF08Vue + SCSS + Router + Mock\uFF09"},{type:"array",items:{type:"string",enum:["vue-component","javascript","scss","api-call","router","mock"]},description:"\u591A\u9009\u4EE3\u7801\u7C7B\u578B\u6570\u7EC4\uFF0C\u4E00\u6B21\u751F\u6210\u591A\u79CD\u4EE3\u7801"}],description:"\u4EE3\u7801\u7C7B\u578B\uFF1A\u5355\u9009\u5B57\u7B26\u4E32\u6216\u591A\u9009\u6570\u7EC4\u3002\u63A8\u8350\u4F7F\u7528 full-page \u4E00\u6B21\u751F\u6210\u5B8C\u6574\u9875\u9762"},requirement:{type:"string",description:'\u9700\u6C42\u63CF\u8FF0\uFF0C\u5982"\u767B\u5F55\u9875\u9762\uFF0C\u5305\u542B\u7528\u6237\u540D\u3001\u5BC6\u7801\u8F93\u5165\u6846\u548C\u767B\u5F55\u6309\u94AE"'},vueVersion:{type:"number",enum:[2,3],description:"Vue \u7248\u672C\uFF0C2 \u4F7F\u7528 Options API (M8.3)\uFF0C3 \u4F7F\u7528 Composition API (M8.4)\uFF0C\u9ED8\u8BA4 2"},components:{type:"array",items:{type:"string"},description:"\u4F7F\u7528\u7684\u7EC4\u4EF6\u5217\u8868\uFF0C\u53EA\u80FD\u4F7F\u7528 M8 \u7EC4\u4EF6\u5E93\u4E2D\u7684\u7EC4\u4EF6\uFF08\u5982 em-field\u3001em-button\uFF09\u3002\u5982\u4E0D\u6307\u5B9A\u4F1A\u6839\u636E\u9700\u6C42\u81EA\u52A8\u63A8\u8350"},modulePath:{type:"string",description:"\u6A21\u5757\u8DEF\u5F84\uFF0C\u9ED8\u8BA4\u4E3A src/pages/[\u6A21\u5757\u540D]\u3002\u901A\u5E38\u65E0\u9700\u6307\u5B9A"},useMock:{type:"boolean",description:"\u662F\u5426\u4F7F\u7528 Mock \u6570\u636E\uFF0C\u9ED8\u8BA4 true"}},required:["type","requirement"]}};async function f(s){try{const t=s.type,n=s.requirement,r=s.vueVersion||2,c=s.components||[],m=s.modulePath,i=s.useMock!==!1;if(!t)return{content:[{type:"text",text:"\u9519\u8BEF\uFF1A\u4EE3\u7801\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A"}],isError:!0};if(!n||n.trim().length===0)return{content:[{type:"text",text:"\u9519\u8BEF\uFF1A\u9700\u6C42\u63CF\u8FF0\u4E0D\u80FD\u4E3A\u7A7A"}],isError:!0};let u;if(t==="full-page")u=["vue-component","scss","router","mock"];else if(Array.isArray(t))u=t;else{const e=a.generateCode({type:t,requirement:n,vueVersion:r,components:c,useMock:i});return{content:[{type:"text",text:["# \u751F\u6210\u7684\u4EE3\u7801","",`**\u8BED\u8A00**: ${e.language}`,`**Vue \u7248\u672C**: ${r}`,`**\u4F7F\u7528 Mock**: ${i?"\u662F":"\u5426"}`,"","```"+e.language,e.code,"```","","## \u8BF4\u660E","",e.explanation].join(`
38
- `)}]}}const p=a.generateMultipleCode({types:u,requirement:n,vueVersion:r,components:c,modulePath:m,useMock:i}),o=["# \u751F\u6210\u7684\u4EE3\u7801","",`**\u6A21\u5757\u8DEF\u5F84**: ${p.modulePath}`,`**Vue \u7248\u672C**: ${r}`,`**\u4F7F\u7528 Mock**: ${i?"\u662F":"\u5426"}`,""];for(const e of p.files)o.push(`## ${e.relativePath||e.filename}`),o.push(""),o.push("```"+e.language),o.push(e.code),o.push("```"),o.push("");return o.push(p.explanation),{content:[{type:"text",text:o.join(`
39
- `)}]}}catch(t){return{content:[{type:"text",text:`\u4EE3\u7801\u751F\u6210\u5931\u8D25: ${t instanceof Error?t.message:"\u672A\u77E5\u9519\u8BEF"}`}],isError:!0}}}export{f as executeGenerateCode,y as generateCodeDefinition};
1
+ import{codeGenerator as a}from"../generator/index.js";const d={name:"generate_code",description:"\u6839\u636E\u9700\u6C42\u751F\u6210\u7B26\u5408 M8 \u6846\u67B6\u89C4\u8303\u7684\u4EE3\u7801\uFF0C\u4E25\u683C\u9075\u5FAA\u5185\u7F6E\u89C4\u8303\u3002",inputSchema:{type:"object",properties:{type:{oneOf:[{type:"string",enum:["vue-component","javascript","scss","api-call","full-page"],description:"\u5355\u4E00\u4EE3\u7801\u7C7B\u578B\uFF0Cfull-page \u4F1A\u751F\u6210\u5B8C\u6574\u9875\u9762\uFF08Vue + SCSS + Router + Mock\uFF09"},{type:"array",items:{type:"string",enum:["vue-component","javascript","scss","api-call","router","mock"]},description:"\u591A\u9009\u4EE3\u7801\u7C7B\u578B\u6570\u7EC4\uFF0C\u4E00\u6B21\u751F\u6210\u591A\u79CD\u4EE3\u7801"}],description:"\u4EE3\u7801\u7C7B\u578B\uFF1A\u5355\u9009\u5B57\u7B26\u4E32\u6216\u591A\u9009\u6570\u7EC4\u3002\u63A8\u8350\u4F7F\u7528 full-page \u4E00\u6B21\u751F\u6210\u5B8C\u6574\u9875\u9762"},requirement:{type:"string",description:'\u9700\u6C42\u63CF\u8FF0\uFF0C\u5982"\u767B\u5F55\u9875\u9762\uFF0C\u5305\u542B\u7528\u6237\u540D\u3001\u5BC6\u7801\u8F93\u5165\u6846\u548C\u767B\u5F55\u6309\u94AE"'},vueVersion:{type:"number",enum:[2,3],description:"Vue \u7248\u672C\uFF0C2 \u4F7F\u7528 Options API (M8.3)\uFF0C3 \u4F7F\u7528 Composition API (M8.4)\uFF0C\u9ED8\u8BA4 2"},components:{type:"array",items:{type:"string"},description:"\u4F7F\u7528\u7684\u7EC4\u4EF6\u5217\u8868\uFF0C\u53EA\u80FD\u4F7F\u7528 M8 \u7EC4\u4EF6\u5E93\u4E2D\u7684\u7EC4\u4EF6\uFF08\u5982 em-field\u3001em-button\uFF09\u3002\u5982\u4E0D\u6307\u5B9A\u4F1A\u6839\u636E\u9700\u6C42\u81EA\u52A8\u63A8\u8350"},modulePath:{type:"string",description:"\u6A21\u5757\u8DEF\u5F84\uFF0C\u9ED8\u8BA4\u4E3A src/pages/[\u6A21\u5757\u540D]\u3002\u901A\u5E38\u65E0\u9700\u6307\u5B9A"},useMock:{type:"boolean",description:"\u662F\u5426\u4F7F\u7528 Mock \u6570\u636E\uFF0C\u9ED8\u8BA4 true"}},required:["type","requirement"]}};async function f(n){try{const t=n.type,r=n.requirement,s=n.vueVersion||2,c=n.components||[],l=n.modulePath,i=n.useMock!==!1;if(!t)return{content:[{type:"text",text:"\u9519\u8BEF\uFF1A\u4EE3\u7801\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A"}],isError:!0};if(!r||r.trim().length===0)return{content:[{type:"text",text:"\u9519\u8BEF\uFF1A\u9700\u6C42\u63CF\u8FF0\u4E0D\u80FD\u4E3A\u7A7A"}],isError:!0};let p;if(t==="full-page")p=["vue-component","scss","router","mock"];else if(Array.isArray(t))p=t;else{const e=a.generateCode({type:t,requirement:r,vueVersion:s,components:c,useMock:i});return{content:[{type:"text",text:["# \u751F\u6210\u7684\u4EE3\u7801","",`**\u8BED\u8A00**: ${e.language}`,`**Vue \u7248\u672C**: ${s}`,`**\u4F7F\u7528 Mock**: ${i?"\u662F":"\u5426"}`,"","```"+e.language,e.code,"```","","## \u8BF4\u660E","",e.explanation].join(`
2
+ `)}]}}const u=a.generateMultipleCode({types:p,requirement:r,vueVersion:s,components:c,modulePath:l,useMock:i}),o=["# \u751F\u6210\u7684\u4EE3\u7801","",`**\u6A21\u5757\u8DEF\u5F84**: ${u.modulePath}`,`**Vue \u7248\u672C**: ${s}`,`**\u4F7F\u7528 Mock**: ${i?"\u662F":"\u5426"}`,""];for(const e of u.files)o.push(`## ${e.relativePath||e.filename}`),o.push(""),o.push("```"+e.language),o.push(e.code),o.push("```"),o.push("");return o.push(u.explanation),{content:[{type:"text",text:o.join(`
3
+ `)}]}}catch(t){return{content:[{type:"text",text:`\u4EE3\u7801\u751F\u6210\u5931\u8D25: ${t instanceof Error?t.message:"\u672A\u77E5\u9519\u8BEF"}`}],isError:!0}}}export{f as executeGenerateCode,d as generateCodeDefinition};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m8-mcp-server",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "M8 移动前端跨端框架 MCP Server - 提供文档查询、智能推荐和代码生成服务",
5
5
  "main": "dist/index.js",
6
6
  "bin": {