@birchcraft/mcp-weapp-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +207 -0
- package/dist/cli-client.d.ts +132 -0
- package/dist/cli-client.d.ts.map +1 -0
- package/dist/cli-client.js +363 -0
- package/dist/cli-client.js.map +1 -0
- package/dist/client.d.ts +9 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +129 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +52 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +171 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +41 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +292 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/auth.d.ts +6 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +128 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/automation.d.ts +35 -0
- package/dist/tools/automation.d.ts.map +1 -0
- package/dist/tools/automation.js +245 -0
- package/dist/tools/automation.js.map +1 -0
- package/dist/tools/build.d.ts +14 -0
- package/dist/tools/build.d.ts.map +1 -0
- package/dist/tools/build.js +210 -0
- package/dist/tools/build.js.map +1 -0
- package/dist/tools/cloud.d.ts +72 -0
- package/dist/tools/cloud.d.ts.map +1 -0
- package/dist/tools/cloud.js +479 -0
- package/dist/tools/cloud.js.map +1 -0
- package/dist/tools/index.d.ts +23 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +35 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/preview.d.ts +41 -0
- package/dist/tools/preview.d.ts.map +1 -0
- package/dist/tools/preview.js +311 -0
- package/dist/tools/preview.js.map +1 -0
- package/dist/tools/project.d.ts +50 -0
- package/dist/tools/project.d.ts.map +1 -0
- package/dist/tools/project.js +308 -0
- package/dist/tools/project.js.map +1 -0
- package/dist/types.d.ts +133 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +29 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/helpers.d.ts +45 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +116 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/logger.d.ts +22 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +50 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 预览和上传工具模块
|
|
3
|
+
* 包含预览二维码生成、自动预览和代码上传功能
|
|
4
|
+
*/
|
|
5
|
+
import { cliClient } from '../cli-client.js';
|
|
6
|
+
import { isValidProjectPath, formatError } from '../utils/helpers.js';
|
|
7
|
+
/**
|
|
8
|
+
* 执行预览工具
|
|
9
|
+
*/
|
|
10
|
+
async function executePreview(args) {
|
|
11
|
+
// 验证项目路径
|
|
12
|
+
if (!isValidProjectPath(args.project)) {
|
|
13
|
+
return {
|
|
14
|
+
content: [
|
|
15
|
+
{
|
|
16
|
+
type: 'text',
|
|
17
|
+
text: `错误: 无效的项目路径: ${args.project}\n请确保路径存在且包含 project.config.json 文件。`,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
isError: true,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const result = await cliClient.preview(args.project, args.qrFormat || 'terminal', args.qrOutput, args.infoOutput);
|
|
25
|
+
if (result.success) {
|
|
26
|
+
const outputLines = ['✅ 预览二维码生成成功!'];
|
|
27
|
+
// 合并 stdout 和 stderr,因为 Windows 上部分输出可能在 stderr
|
|
28
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
29
|
+
if (output) {
|
|
30
|
+
outputLines.push('', '📝 输出信息:', output);
|
|
31
|
+
}
|
|
32
|
+
if (args.qrOutput) {
|
|
33
|
+
outputLines.push('', `📱 二维码已保存至: ${args.qrOutput}`);
|
|
34
|
+
}
|
|
35
|
+
if (args.infoOutput) {
|
|
36
|
+
outputLines.push(`📄 预览信息已保存至: ${args.infoOutput}`);
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: 'text',
|
|
42
|
+
text: outputLines.join('\n'),
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return {
|
|
49
|
+
content: [
|
|
50
|
+
{
|
|
51
|
+
type: 'text',
|
|
52
|
+
text: `❌ 预览失败 (退出码: ${result.code})\n\n${result.stderr || result.stdout || '未知错误'}`,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
isError: true,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return {
|
|
61
|
+
content: [
|
|
62
|
+
{
|
|
63
|
+
type: 'text',
|
|
64
|
+
text: `❌ 执行预览命令时出错: ${formatError(error)}`,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
isError: true,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 执行自动预览工具
|
|
73
|
+
*/
|
|
74
|
+
async function executeAutoPreview(args) {
|
|
75
|
+
// 验证项目路径
|
|
76
|
+
if (!isValidProjectPath(args.project)) {
|
|
77
|
+
return {
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: 'text',
|
|
81
|
+
text: `错误: 无效的项目路径: ${args.project}\n请确保路径存在且包含 project.config.json 文件。`,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
isError: true,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
const result = await cliClient.autoPreview(args.project, args.infoOutput);
|
|
89
|
+
if (result.success) {
|
|
90
|
+
const outputLines = ['✅ 自动预览启动成功!'];
|
|
91
|
+
if (result.stdout) {
|
|
92
|
+
outputLines.push('', '📝 输出信息:', result.stdout);
|
|
93
|
+
}
|
|
94
|
+
if (args.infoOutput) {
|
|
95
|
+
outputLines.push('', `📄 预览信息已保存至: ${args.infoOutput}`);
|
|
96
|
+
}
|
|
97
|
+
outputLines.push('', '提示: 请使用微信扫描二维码预览小程序。', '如需停止自动预览,请关闭微信开发者工具或运行 quit 命令。');
|
|
98
|
+
return {
|
|
99
|
+
content: [
|
|
100
|
+
{
|
|
101
|
+
type: 'text',
|
|
102
|
+
text: outputLines.join('\n'),
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return {
|
|
109
|
+
content: [
|
|
110
|
+
{
|
|
111
|
+
type: 'text',
|
|
112
|
+
text: `❌ 自动预览启动失败 (退出码: ${result.code})\n\n${result.stderr || result.stdout || '未知错误'}`,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
isError: true,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
return {
|
|
121
|
+
content: [
|
|
122
|
+
{
|
|
123
|
+
type: 'text',
|
|
124
|
+
text: `❌ 执行自动预览命令时出错: ${formatError(error)}`,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
isError: true,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* 执行上传工具
|
|
133
|
+
*/
|
|
134
|
+
async function executeUpload(args) {
|
|
135
|
+
// 验证项目路径
|
|
136
|
+
if (!isValidProjectPath(args.project)) {
|
|
137
|
+
return {
|
|
138
|
+
content: [
|
|
139
|
+
{
|
|
140
|
+
type: 'text',
|
|
141
|
+
text: `错误: 无效的项目路径: ${args.project}\n请确保路径存在且包含 project.config.json 文件。`,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
isError: true,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
// 验证版本号格式
|
|
148
|
+
const versionRegex = /^\d+\.\d+\.\d+$/;
|
|
149
|
+
if (!versionRegex.test(args.version)) {
|
|
150
|
+
return {
|
|
151
|
+
content: [
|
|
152
|
+
{
|
|
153
|
+
type: 'text',
|
|
154
|
+
text: `错误: 无效的版本号格式: ${args.version}\n版本号必须使用 x.y.z 格式(如 1.0.0)。`,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
isError: true,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
// 验证版本描述
|
|
161
|
+
if (!args.desc || args.desc.trim().length === 0) {
|
|
162
|
+
return {
|
|
163
|
+
content: [
|
|
164
|
+
{
|
|
165
|
+
type: 'text',
|
|
166
|
+
text: '错误: 版本描述不能为空。',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
isError: true,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
const result = await cliClient.upload(args.project, args.version, args.desc, args.infoOutput);
|
|
174
|
+
if (result.success) {
|
|
175
|
+
const outputLines = [
|
|
176
|
+
'✅ 代码上传成功!',
|
|
177
|
+
'',
|
|
178
|
+
'📦 上传详情:',
|
|
179
|
+
` 版本号: ${args.version}`,
|
|
180
|
+
` 版本描述: ${args.desc}`,
|
|
181
|
+
];
|
|
182
|
+
if (result.stdout) {
|
|
183
|
+
outputLines.push('', '📝 输出信息:', result.stdout);
|
|
184
|
+
}
|
|
185
|
+
if (args.infoOutput) {
|
|
186
|
+
outputLines.push('', `📄 上传信息已保存至: ${args.infoOutput}`);
|
|
187
|
+
}
|
|
188
|
+
outputLines.push('', '提示: 代码已上传到微信公众平台。', '您可以在微信公众平台后台将此版本设置为体验版或提交审核。');
|
|
189
|
+
return {
|
|
190
|
+
content: [
|
|
191
|
+
{
|
|
192
|
+
type: 'text',
|
|
193
|
+
text: outputLines.join('\n'),
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
return {
|
|
200
|
+
content: [
|
|
201
|
+
{
|
|
202
|
+
type: 'text',
|
|
203
|
+
text: `❌ 代码上传失败 (退出码: ${result.code})\n\n${result.stderr || result.stdout || '未知错误'}`,
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
isError: true,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
return {
|
|
212
|
+
content: [
|
|
213
|
+
{
|
|
214
|
+
type: 'text',
|
|
215
|
+
text: `❌ 执行上传命令时出错: ${formatError(error)}`,
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
isError: true,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* 工具定义数组
|
|
224
|
+
*/
|
|
225
|
+
export const previewTools = [
|
|
226
|
+
{
|
|
227
|
+
name: 'weapp_preview',
|
|
228
|
+
description: '生成微信小程序预览二维码,用于在真机上预览小程序效果',
|
|
229
|
+
inputSchema: {
|
|
230
|
+
type: 'object',
|
|
231
|
+
properties: {
|
|
232
|
+
project: {
|
|
233
|
+
type: 'string',
|
|
234
|
+
description: '小程序项目路径,必须是包含 project.config.json 的目录',
|
|
235
|
+
},
|
|
236
|
+
qrFormat: {
|
|
237
|
+
type: 'string',
|
|
238
|
+
enum: ['terminal', 'image', 'base64'],
|
|
239
|
+
description: '二维码格式:terminal(终端输出)、image(图片文件)、base64(Base64编码)',
|
|
240
|
+
default: 'terminal',
|
|
241
|
+
},
|
|
242
|
+
qrOutput: {
|
|
243
|
+
type: 'string',
|
|
244
|
+
description: '二维码图片输出路径(当 qrFormat 为 image 时使用)',
|
|
245
|
+
},
|
|
246
|
+
infoOutput: {
|
|
247
|
+
type: 'string',
|
|
248
|
+
description: '预览信息输出文件路径(JSON格式)',
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
required: ['project'],
|
|
252
|
+
},
|
|
253
|
+
handler: executePreview,
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
name: 'weapp_auto_preview',
|
|
257
|
+
description: '自动预览小程序,将自动打开微信开发者工具并生成预览二维码',
|
|
258
|
+
inputSchema: {
|
|
259
|
+
type: 'object',
|
|
260
|
+
properties: {
|
|
261
|
+
project: {
|
|
262
|
+
type: 'string',
|
|
263
|
+
description: '小程序项目路径,必须是包含 project.config.json 的目录',
|
|
264
|
+
},
|
|
265
|
+
infoOutput: {
|
|
266
|
+
type: 'string',
|
|
267
|
+
description: '预览信息输出文件路径(JSON格式)',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
required: ['project'],
|
|
271
|
+
},
|
|
272
|
+
handler: executeAutoPreview,
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: 'weapp_upload',
|
|
276
|
+
description: '上传微信小程序代码到微信公众平台,用于提交审核或发布体验版',
|
|
277
|
+
inputSchema: {
|
|
278
|
+
type: 'object',
|
|
279
|
+
properties: {
|
|
280
|
+
project: {
|
|
281
|
+
type: 'string',
|
|
282
|
+
description: '小程序项目路径,必须是包含 project.config.json 的目录',
|
|
283
|
+
},
|
|
284
|
+
version: {
|
|
285
|
+
type: 'string',
|
|
286
|
+
description: '版本号,格式为 x.y.z(如 1.0.0)',
|
|
287
|
+
},
|
|
288
|
+
desc: {
|
|
289
|
+
type: 'string',
|
|
290
|
+
description: '版本描述信息,将在微信公众平台显示',
|
|
291
|
+
},
|
|
292
|
+
infoOutput: {
|
|
293
|
+
type: 'string',
|
|
294
|
+
description: '上传信息输出文件路径(JSON格式)',
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
required: ['project', 'version', 'desc'],
|
|
298
|
+
},
|
|
299
|
+
handler: executeUpload,
|
|
300
|
+
},
|
|
301
|
+
];
|
|
302
|
+
/**
|
|
303
|
+
* 工具执行映射表(向后兼容)
|
|
304
|
+
* @deprecated 直接使用工具的 handler 方法
|
|
305
|
+
*/
|
|
306
|
+
export const previewToolExecutors = {
|
|
307
|
+
weapp_preview: executePreview,
|
|
308
|
+
weapp_auto_preview: executeAutoPreview,
|
|
309
|
+
weapp_upload: executeUpload,
|
|
310
|
+
};
|
|
311
|
+
//# sourceMappingURL=preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../../src/tools/preview.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;GAEG;AACH,KAAK,UAAU,cAAc,CAAC,IAK7B;IACC,SAAS;IACT,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,gBAAgB,IAAI,CAAC,OAAO,sCAAsC;iBACzE;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CACpC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,QAAQ,IAAI,UAAU,EAC3B,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,UAAU,CAChB,CAAC;QAEF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,MAAM,WAAW,GAAa,CAAC,cAAc,CAAC,CAAC;YAE/C,gDAAgD;YAChD,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzE,IAAI,MAAM,EAAE,CAAC;gBACX,WA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AE,aAAa;KACvB;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,aAAa,EAAE,cAAc;IAC7B,kBAAkB,EAAE,kBAAkB;IACtC,YAAY,EAAE,aAAa;CAC5B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 项目管理相关工具
|
|
3
|
+
* 提供打开、关闭、退出等基础操作
|
|
4
|
+
*/
|
|
5
|
+
import { ToolDefinition, ToolResult } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* 执行打开工具/项目
|
|
8
|
+
*/
|
|
9
|
+
declare function executeOpen(args: {
|
|
10
|
+
projectPath?: string;
|
|
11
|
+
}): Promise<ToolResult>;
|
|
12
|
+
/**
|
|
13
|
+
* 执行以其他模式打开
|
|
14
|
+
*/
|
|
15
|
+
declare function executeOpenOther(args: {
|
|
16
|
+
projectPath: string;
|
|
17
|
+
}): Promise<ToolResult>;
|
|
18
|
+
/**
|
|
19
|
+
* 执行关闭项目
|
|
20
|
+
*/
|
|
21
|
+
declare function executeClose(args: {
|
|
22
|
+
projectPath?: string;
|
|
23
|
+
}): Promise<ToolResult>;
|
|
24
|
+
/**
|
|
25
|
+
* 执行退出工具
|
|
26
|
+
*/
|
|
27
|
+
declare function executeQuit(): Promise<ToolResult>;
|
|
28
|
+
/**
|
|
29
|
+
* 执行重置文件监听
|
|
30
|
+
*/
|
|
31
|
+
declare function executeResetFileutils(args: {
|
|
32
|
+
projectPath?: string;
|
|
33
|
+
}): Promise<ToolResult>;
|
|
34
|
+
/**
|
|
35
|
+
* 项目管理工具定义
|
|
36
|
+
*/
|
|
37
|
+
export declare const projectTools: ToolDefinition[];
|
|
38
|
+
/**
|
|
39
|
+
* 工具执行映射表(向后兼容)
|
|
40
|
+
* @deprecated 直接使用工具的 handler 方法
|
|
41
|
+
*/
|
|
42
|
+
export declare const projectToolExecutors: {
|
|
43
|
+
weapp_open: typeof executeOpen;
|
|
44
|
+
weapp_open_other: typeof executeOpenOther;
|
|
45
|
+
weapp_close: typeof executeClose;
|
|
46
|
+
weapp_quit: typeof executeQuit;
|
|
47
|
+
weapp_reset_fileutils: typeof executeResetFileutils;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/tools/project.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzD;;GAEG;AACH,iBAAe,WAAW,CAAC,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAwC9E;AAED;;GAEG;AACH,iBAAe,gBAAgB,CAAC,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAmClF;AAED;;GAEG;AACH,iBAAe,YAAY,CAAC,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAwC/E;AAED;;GAEG;AACH,iBAAe,WAAW,IAAI,OAAO,CAAC,UAAU,CAAC,CAmChD;AAED;;GAEG;AACH,iBAAe,qBAAqB,CAAC,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAwCxF;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EAuExC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;CAMhC,CAAC"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 项目管理相关工具
|
|
3
|
+
* 提供打开、关闭、退出等基础操作
|
|
4
|
+
*/
|
|
5
|
+
import { cliClient } from '../cli-client.js';
|
|
6
|
+
import { formatError } from '../utils/helpers.js';
|
|
7
|
+
/**
|
|
8
|
+
* 执行打开工具/项目
|
|
9
|
+
*/
|
|
10
|
+
async function executeOpen(args) {
|
|
11
|
+
try {
|
|
12
|
+
const result = await cliClient.open(args.projectPath);
|
|
13
|
+
if (result.success) {
|
|
14
|
+
const message = args.projectPath
|
|
15
|
+
? `成功打开项目: ${args.projectPath}`
|
|
16
|
+
: '成功打开微信开发者工具';
|
|
17
|
+
// 合并 stdout 和 stderr
|
|
18
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
19
|
+
return {
|
|
20
|
+
content: [
|
|
21
|
+
{
|
|
22
|
+
type: 'text',
|
|
23
|
+
text: `${message}\n${output || ''}`.trim(),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return {
|
|
30
|
+
content: [
|
|
31
|
+
{
|
|
32
|
+
type: 'text',
|
|
33
|
+
text: `打开失败 (退出码: ${result.code})\n${result.stderr || result.stdout || '未知错误'}`,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
isError: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: `执行失败: ${formatError(error)}`,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
isError: true,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 执行以其他模式打开
|
|
54
|
+
*/
|
|
55
|
+
async function executeOpenOther(args) {
|
|
56
|
+
try {
|
|
57
|
+
const result = await cliClient.openOther(args.projectPath);
|
|
58
|
+
if (result.success) {
|
|
59
|
+
return {
|
|
60
|
+
content: [
|
|
61
|
+
{
|
|
62
|
+
type: 'text',
|
|
63
|
+
text: `成功以其他模式打开项目: ${args.projectPath}\n${result.stdout || ''}`.trim(),
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
return {
|
|
70
|
+
content: [
|
|
71
|
+
{
|
|
72
|
+
type: 'text',
|
|
73
|
+
text: `以其他模式打开失败 (退出码: ${result.code})\n${result.stderr || result.stdout || '未知错误'}`,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
isError: true,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return {
|
|
82
|
+
content: [
|
|
83
|
+
{
|
|
84
|
+
type: 'text',
|
|
85
|
+
text: `执行失败: ${formatError(error)}`,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
isError: true,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 执行关闭项目
|
|
94
|
+
*/
|
|
95
|
+
async function executeClose(args) {
|
|
96
|
+
try {
|
|
97
|
+
const result = await cliClient.close(args.projectPath);
|
|
98
|
+
if (result.success) {
|
|
99
|
+
const message = args.projectPath
|
|
100
|
+
? `成功关闭项目: ${args.projectPath}`
|
|
101
|
+
: '成功关闭当前项目';
|
|
102
|
+
// 合并 stdout 和 stderr
|
|
103
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
104
|
+
return {
|
|
105
|
+
content: [
|
|
106
|
+
{
|
|
107
|
+
type: 'text',
|
|
108
|
+
text: `${message}\n${output || ''}`.trim(),
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return {
|
|
115
|
+
content: [
|
|
116
|
+
{
|
|
117
|
+
type: 'text',
|
|
118
|
+
text: `关闭失败 (退出码: ${result.code})\n${result.stderr || result.stdout || '未知错误'}`,
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
isError: true,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
return {
|
|
127
|
+
content: [
|
|
128
|
+
{
|
|
129
|
+
type: 'text',
|
|
130
|
+
text: `执行失败: ${formatError(error)}`,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
isError: true,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* 执行退出工具
|
|
139
|
+
*/
|
|
140
|
+
async function executeQuit() {
|
|
141
|
+
try {
|
|
142
|
+
const result = await cliClient.quit();
|
|
143
|
+
if (result.success) {
|
|
144
|
+
return {
|
|
145
|
+
content: [
|
|
146
|
+
{
|
|
147
|
+
type: 'text',
|
|
148
|
+
text: `成功退出微信开发者工具\n${result.stdout || ''}`.trim(),
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
return {
|
|
155
|
+
content: [
|
|
156
|
+
{
|
|
157
|
+
type: 'text',
|
|
158
|
+
text: `退出失败 (退出码: ${result.code})\n${result.stderr || result.stdout || '未知错误'}`,
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
isError: true,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
return {
|
|
167
|
+
content: [
|
|
168
|
+
{
|
|
169
|
+
type: 'text',
|
|
170
|
+
text: `执行失败: ${formatError(error)}`,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
isError: true,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* 执行重置文件监听
|
|
179
|
+
*/
|
|
180
|
+
async function executeResetFileutils(args) {
|
|
181
|
+
try {
|
|
182
|
+
const result = await cliClient.resetFileutils(args.projectPath);
|
|
183
|
+
if (result.success) {
|
|
184
|
+
const message = args.projectPath
|
|
185
|
+
? `成功重置项目文件监听: ${args.projectPath}`
|
|
186
|
+
: '成功重置文件监听';
|
|
187
|
+
// 合并 stdout 和 stderr
|
|
188
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
189
|
+
return {
|
|
190
|
+
content: [
|
|
191
|
+
{
|
|
192
|
+
type: 'text',
|
|
193
|
+
text: `${message}\n${output || ''}`.trim(),
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
return {
|
|
200
|
+
content: [
|
|
201
|
+
{
|
|
202
|
+
type: 'text',
|
|
203
|
+
text: `重置失败 (退出码: ${result.code})\n${result.stderr || result.stdout || '未知错误'}`,
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
isError: true,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
return {
|
|
212
|
+
content: [
|
|
213
|
+
{
|
|
214
|
+
type: 'text',
|
|
215
|
+
text: `执行失败: ${formatError(error)}`,
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
isError: true,
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* 项目管理工具定义
|
|
224
|
+
*/
|
|
225
|
+
export const projectTools = [
|
|
226
|
+
{
|
|
227
|
+
name: 'weapp_open',
|
|
228
|
+
description: '打开微信开发者工具或指定项目。如果不指定项目路径,则只打开工具;如果指定项目路径,则打开对应的小程序项目。',
|
|
229
|
+
inputSchema: {
|
|
230
|
+
type: 'object',
|
|
231
|
+
properties: {
|
|
232
|
+
projectPath: {
|
|
233
|
+
type: 'string',
|
|
234
|
+
description: '项目路径(可选)。小程序项目根目录,包含 project.config.json 的目录',
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
required: [],
|
|
238
|
+
},
|
|
239
|
+
handler: executeOpen,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: 'weapp_open_other',
|
|
243
|
+
description: '以其他模式打开微信小程序项目。会以独立窗口或不同模式打开项目,用于特殊场景下的开发调试。',
|
|
244
|
+
inputSchema: {
|
|
245
|
+
type: 'object',
|
|
246
|
+
properties: {
|
|
247
|
+
projectPath: {
|
|
248
|
+
type: 'string',
|
|
249
|
+
description: '项目路径(必填)。小程序项目根目录,包含 project.config.json 的目录',
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
required: ['projectPath'],
|
|
253
|
+
},
|
|
254
|
+
handler: executeOpenOther,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: 'weapp_close',
|
|
258
|
+
description: '关闭微信小程序项目。可以关闭指定项目,或不指定项目路径时关闭当前活动项目。',
|
|
259
|
+
inputSchema: {
|
|
260
|
+
type: 'object',
|
|
261
|
+
properties: {
|
|
262
|
+
projectPath: {
|
|
263
|
+
type: 'string',
|
|
264
|
+
description: '项目路径(可选)。指定要关闭的小程序项目路径',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
required: [],
|
|
268
|
+
},
|
|
269
|
+
handler: executeClose,
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'weapp_quit',
|
|
273
|
+
description: '完全退出微信开发者工具。此操作会关闭整个开发者工具进程,所有打开的项目都会被关闭。',
|
|
274
|
+
inputSchema: {
|
|
275
|
+
type: 'object',
|
|
276
|
+
properties: {},
|
|
277
|
+
required: [],
|
|
278
|
+
},
|
|
279
|
+
handler: executeQuit,
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: 'weapp_reset_fileutils',
|
|
283
|
+
description: '重置微信开发者工具的文件监听。当文件监听出现异常或需要刷新文件状态时,可以使用此工具重置文件监听模块。',
|
|
284
|
+
inputSchema: {
|
|
285
|
+
type: 'object',
|
|
286
|
+
properties: {
|
|
287
|
+
projectPath: {
|
|
288
|
+
type: 'string',
|
|
289
|
+
description: '项目路径(可选)。指定要重置文件监听的项目路径',
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
required: [],
|
|
293
|
+
},
|
|
294
|
+
handler: executeResetFileutils,
|
|
295
|
+
},
|
|
296
|
+
];
|
|
297
|
+
/**
|
|
298
|
+
* 工具执行映射表(向后兼容)
|
|
299
|
+
* @deprecated 直接使用工具的 handler 方法
|
|
300
|
+
*/
|
|
301
|
+
export const projectToolExecutors = {
|
|
302
|
+
weapp_open: executeOpen,
|
|
303
|
+
weapp_open_other: executeOpenOther,
|
|
304
|
+
weapp_close: executeClose,
|
|
305
|
+
weapp_quit: executeQuit,
|
|
306
|
+
weapp_reset_fileutils: executeResetFileutils,
|
|
307
|
+
};
|
|
308
|
+
//# sourceMappingURL=project.js.map
|