@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,479 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 云开发相关工具
|
|
3
|
+
* 提供云环境管理、云函数部署等操作
|
|
4
|
+
*/
|
|
5
|
+
import { cliClient } from '../cli-client.js';
|
|
6
|
+
import { formatError } from '../utils/helpers.js';
|
|
7
|
+
/**
|
|
8
|
+
* 执行获取云环境列表
|
|
9
|
+
*/
|
|
10
|
+
async function executeCloudEnvList(args) {
|
|
11
|
+
try {
|
|
12
|
+
const result = await cliClient.cloudEnvList(args.project);
|
|
13
|
+
if (result.success) {
|
|
14
|
+
// 合并 stdout 和 stderr,因为 Windows 上部分输出可能在 stderr
|
|
15
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
16
|
+
return {
|
|
17
|
+
content: [
|
|
18
|
+
{
|
|
19
|
+
type: 'text',
|
|
20
|
+
text: `获取云环境列表成功\n${output || ''}`.trim(),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return {
|
|
27
|
+
content: [
|
|
28
|
+
{
|
|
29
|
+
type: 'text',
|
|
30
|
+
text: `获取云环境列表失败 (退出码: ${result.code})\n${result.stderr || result.stdout || '未知错误'}`,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
isError: true,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
return {
|
|
39
|
+
content: [
|
|
40
|
+
{
|
|
41
|
+
type: 'text',
|
|
42
|
+
text: `执行失败: ${formatError(error)}`,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
isError: true,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 执行获取云函数列表
|
|
51
|
+
*/
|
|
52
|
+
async function executeCloudFunctionsList(args) {
|
|
53
|
+
try {
|
|
54
|
+
const result = await cliClient.cloudFunctionsList(args.project, args.env);
|
|
55
|
+
if (result.success) {
|
|
56
|
+
// 合并 stdout 和 stderr,因为 Windows 上部分输出可能在 stderr
|
|
57
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
58
|
+
return {
|
|
59
|
+
content: [
|
|
60
|
+
{
|
|
61
|
+
type: 'text',
|
|
62
|
+
text: `获取云函数列表成功\n环境: ${args.env}\n${output || ''}`.trim(),
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
return {
|
|
69
|
+
content: [
|
|
70
|
+
{
|
|
71
|
+
type: 'text',
|
|
72
|
+
text: `获取云函数列表失败 (退出码: ${result.code})\n环境: ${args.env}\n${result.stderr || result.stdout || '未知错误'}`,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
isError: true,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return {
|
|
81
|
+
content: [
|
|
82
|
+
{
|
|
83
|
+
type: 'text',
|
|
84
|
+
text: `执行失败: ${formatError(error)}`,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
isError: true,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* 执行获取云函数信息
|
|
93
|
+
*/
|
|
94
|
+
async function executeCloudFunctionsInfo(args) {
|
|
95
|
+
try {
|
|
96
|
+
const result = await cliClient.cloudFunctionsInfo(args.project, args.env, args.names);
|
|
97
|
+
if (result.success) {
|
|
98
|
+
return {
|
|
99
|
+
content: [
|
|
100
|
+
{
|
|
101
|
+
type: 'text',
|
|
102
|
+
text: `获取云函数信息成功\n环境: ${args.env}\n函数: ${args.names.join(', ')}\n${result.stdout || ''}`.trim(),
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return {
|
|
109
|
+
content: [
|
|
110
|
+
{
|
|
111
|
+
type: 'text',
|
|
112
|
+
text: `获取云函数信息失败 (退出码: ${result.code})\n环境: ${args.env}\n函数: ${args.names.join(', ')}\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 executeCloudFunctionsDeploy(args) {
|
|
135
|
+
try {
|
|
136
|
+
// 验证 names 和 paths 至少提供一个
|
|
137
|
+
if ((!args.names || args.names.length === 0) && (!args.paths || args.paths.length === 0)) {
|
|
138
|
+
return {
|
|
139
|
+
content: [
|
|
140
|
+
{
|
|
141
|
+
type: 'text',
|
|
142
|
+
text: '参数错误: 必须提供 names(云函数名称列表)或 paths(云函数路径列表)之一',
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
isError: true,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const result = await cliClient.cloudFunctionsDeploy(args.project, args.env, {
|
|
149
|
+
names: args.names,
|
|
150
|
+
paths: args.paths,
|
|
151
|
+
remoteNpmInstall: args.remoteNpmInstall,
|
|
152
|
+
});
|
|
153
|
+
if (result.success) {
|
|
154
|
+
const details = [];
|
|
155
|
+
if (args.names && args.names.length > 0) {
|
|
156
|
+
details.push(`函数名称: ${args.names.join(', ')}`);
|
|
157
|
+
}
|
|
158
|
+
if (args.paths && args.paths.length > 0) {
|
|
159
|
+
details.push(`函数路径: ${args.paths.join(', ')}`);
|
|
160
|
+
}
|
|
161
|
+
if (args.remoteNpmInstall) {
|
|
162
|
+
details.push('远程安装 npm 依赖: 是');
|
|
163
|
+
}
|
|
164
|
+
// 合并 stdout 和 stderr,因为 Windows 上部分输出可能在 stderr
|
|
165
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join('\n');
|
|
166
|
+
return {
|
|
167
|
+
content: [
|
|
168
|
+
{
|
|
169
|
+
type: 'text',
|
|
170
|
+
text: `部署云函数成功\n环境: ${args.env}\n${details.join('\n')}\n${output || ''}`.trim(),
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
return {
|
|
177
|
+
content: [
|
|
178
|
+
{
|
|
179
|
+
type: 'text',
|
|
180
|
+
text: `部署云函数失败 (退出码: ${result.code})\n环境: ${args.env}\n${result.stderr || result.stdout || '未知错误'}`,
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
isError: true,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
return {
|
|
189
|
+
content: [
|
|
190
|
+
{
|
|
191
|
+
type: 'text',
|
|
192
|
+
text: `执行失败: ${formatError(error)}`,
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
isError: true,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* 执行增量部署云函数
|
|
201
|
+
*/
|
|
202
|
+
async function executeCloudFunctionsIncDeploy(args) {
|
|
203
|
+
try {
|
|
204
|
+
// 验证 names 和 paths 至少提供一个
|
|
205
|
+
if ((!args.names || args.names.length === 0) && (!args.paths || args.paths.length === 0)) {
|
|
206
|
+
return {
|
|
207
|
+
content: [
|
|
208
|
+
{
|
|
209
|
+
type: 'text',
|
|
210
|
+
text: '参数错误: 必须提供 names(云函数名称列表)或 paths(云函数路径列表)之一',
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
isError: true,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
const result = await cliClient.cloudFunctionsIncDeploy(args.project, args.env, {
|
|
217
|
+
names: args.names,
|
|
218
|
+
paths: args.paths,
|
|
219
|
+
remoteNpmInstall: args.remoteNpmInstall,
|
|
220
|
+
});
|
|
221
|
+
if (result.success) {
|
|
222
|
+
const details = [];
|
|
223
|
+
if (args.names && args.names.length > 0) {
|
|
224
|
+
details.push(`函数名称: ${args.names.join(', ')}`);
|
|
225
|
+
}
|
|
226
|
+
if (args.paths && args.paths.length > 0) {
|
|
227
|
+
details.push(`函数路径: ${args.paths.join(', ')}`);
|
|
228
|
+
}
|
|
229
|
+
if (args.remoteNpmInstall) {
|
|
230
|
+
details.push('远程安装 npm 依赖: 是');
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
content: [
|
|
234
|
+
{
|
|
235
|
+
type: 'text',
|
|
236
|
+
text: `增量部署云函数成功\n环境: ${args.env}\n${details.join('\n')}\n${result.stdout || ''}`.trim(),
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
return {
|
|
243
|
+
content: [
|
|
244
|
+
{
|
|
245
|
+
type: 'text',
|
|
246
|
+
text: `增量部署云函数失败 (退出码: ${result.code})\n环境: ${args.env}\n${result.stderr || result.stdout || '未知错误'}`,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
isError: true,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
return {
|
|
255
|
+
content: [
|
|
256
|
+
{
|
|
257
|
+
type: 'text',
|
|
258
|
+
text: `执行失败: ${formatError(error)}`,
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
isError: true,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* 执行下载云函数
|
|
267
|
+
*/
|
|
268
|
+
async function executeCloudFunctionsDownload(args) {
|
|
269
|
+
try {
|
|
270
|
+
const result = await cliClient.cloudFunctionsDownload(args.project, args.env, args.name);
|
|
271
|
+
if (result.success) {
|
|
272
|
+
return {
|
|
273
|
+
content: [
|
|
274
|
+
{
|
|
275
|
+
type: 'text',
|
|
276
|
+
text: `下载云函数成功\n环境: ${args.env}\n函数: ${args.name}\n${result.stdout || ''}`.trim(),
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
return {
|
|
283
|
+
content: [
|
|
284
|
+
{
|
|
285
|
+
type: 'text',
|
|
286
|
+
text: `下载云函数失败 (退出码: ${result.code})\n环境: ${args.env}\n函数: ${args.name}\n${result.stderr || result.stdout || '未知错误'}`,
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
isError: true,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
return {
|
|
295
|
+
content: [
|
|
296
|
+
{
|
|
297
|
+
type: 'text',
|
|
298
|
+
text: `执行失败: ${formatError(error)}`,
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
isError: true,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* 云开发工具定义
|
|
307
|
+
*/
|
|
308
|
+
export const cloudTools = [
|
|
309
|
+
{
|
|
310
|
+
name: 'weapp_cloud_env_list',
|
|
311
|
+
description: '获取微信小程序云开发环境列表。返回当前小程序账号下的所有云开发环境信息。',
|
|
312
|
+
inputSchema: {
|
|
313
|
+
type: 'object',
|
|
314
|
+
properties: {
|
|
315
|
+
project: {
|
|
316
|
+
type: 'string',
|
|
317
|
+
description: '项目路径(必填)。小程序项目根目录,包含 project.config.json 的目录',
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
required: ['project'],
|
|
321
|
+
},
|
|
322
|
+
handler: executeCloudEnvList,
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: 'weapp_cloud_functions_list',
|
|
326
|
+
description: '获取指定云环境下的云函数列表。返回该环境下所有已部署的云函数信息。',
|
|
327
|
+
inputSchema: {
|
|
328
|
+
type: 'object',
|
|
329
|
+
properties: {
|
|
330
|
+
project: {
|
|
331
|
+
type: 'string',
|
|
332
|
+
description: '项目路径(必填)。小程序项目根目录,包含 project.config.json 的目录',
|
|
333
|
+
},
|
|
334
|
+
env: {
|
|
335
|
+
type: 'string',
|
|
336
|
+
description: '云环境 ID(必填)。要查询的云开发环境标识',
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
required: ['project', 'env'],
|
|
340
|
+
},
|
|
341
|
+
handler: executeCloudFunctionsList,
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'weapp_cloud_functions_info',
|
|
345
|
+
description: '获取指定云函数的详细信息。包括函数配置、状态、运行环境等信息。',
|
|
346
|
+
inputSchema: {
|
|
347
|
+
type: 'object',
|
|
348
|
+
properties: {
|
|
349
|
+
project: {
|
|
350
|
+
type: 'string',
|
|
351
|
+
description: '项目路径(必填)。小程序项目根目录,包含 project.config.json 的目录',
|
|
352
|
+
},
|
|
353
|
+
env: {
|
|
354
|
+
type: 'string',
|
|
355
|
+
description: '云环境 ID(必填)。云函数所在的云开发环境标识',
|
|
356
|
+
},
|
|
357
|
+
names: {
|
|
358
|
+
type: 'array',
|
|
359
|
+
items: {
|
|
360
|
+
type: 'string',
|
|
361
|
+
},
|
|
362
|
+
description: '云函数名称列表(必填)。要查询的云函数名称数组',
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
required: ['project', 'env', 'names'],
|
|
366
|
+
},
|
|
367
|
+
handler: executeCloudFunctionsInfo,
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
name: 'weapp_cloud_functions_deploy',
|
|
371
|
+
description: '部署云函数到云端。可以将本地开发的云函数完整部署到指定的云环境中。支持通过函数名称或函数路径指定要部署的函数,可选择是否在云端安装 npm 依赖。',
|
|
372
|
+
inputSchema: {
|
|
373
|
+
type: 'object',
|
|
374
|
+
properties: {
|
|
375
|
+
project: {
|
|
376
|
+
type: 'string',
|
|
377
|
+
description: '项目路径(必填)。小程序项目根目录,包含 project.config.json 的目录',
|
|
378
|
+
},
|
|
379
|
+
env: {
|
|
380
|
+
type: 'string',
|
|
381
|
+
description: '云环境 ID(必填)。要部署到的云开发环境标识',
|
|
382
|
+
},
|
|
383
|
+
names: {
|
|
384
|
+
type: 'array',
|
|
385
|
+
items: {
|
|
386
|
+
type: 'string',
|
|
387
|
+
},
|
|
388
|
+
description: '云函数名称列表(与 paths 二选一)。要部署的云函数名称数组',
|
|
389
|
+
},
|
|
390
|
+
paths: {
|
|
391
|
+
type: 'array',
|
|
392
|
+
items: {
|
|
393
|
+
type: 'string',
|
|
394
|
+
},
|
|
395
|
+
description: '云函数路径列表(与 names 二选一)。要部署的云函数本地路径数组',
|
|
396
|
+
},
|
|
397
|
+
remoteNpmInstall: {
|
|
398
|
+
type: 'boolean',
|
|
399
|
+
description: '是否在云端安装 npm 依赖(可选)。设为 true 时会在云端执行 npm install',
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
required: ['project', 'env'],
|
|
403
|
+
},
|
|
404
|
+
handler: executeCloudFunctionsDeploy,
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: 'weapp_cloud_functions_inc_deploy',
|
|
408
|
+
description: '增量部署云函数到云端。只部署云函数的变更部分,速度更快。适用于大型云函数或仅需更新部分代码的场景。',
|
|
409
|
+
inputSchema: {
|
|
410
|
+
type: 'object',
|
|
411
|
+
properties: {
|
|
412
|
+
project: {
|
|
413
|
+
type: 'string',
|
|
414
|
+
description: '项目路径(必填)。小程序项目根目录,包含 project.config.json 的目录',
|
|
415
|
+
},
|
|
416
|
+
env: {
|
|
417
|
+
type: 'string',
|
|
418
|
+
description: '云环境 ID(必填)。要部署到的云开发环境标识',
|
|
419
|
+
},
|
|
420
|
+
names: {
|
|
421
|
+
type: 'array',
|
|
422
|
+
items: {
|
|
423
|
+
type: 'string',
|
|
424
|
+
},
|
|
425
|
+
description: '云函数名称列表(与 paths 二选一)。要增量部署的云函数名称数组',
|
|
426
|
+
},
|
|
427
|
+
paths: {
|
|
428
|
+
type: 'array',
|
|
429
|
+
items: {
|
|
430
|
+
type: 'string',
|
|
431
|
+
},
|
|
432
|
+
description: '云函数路径列表(与 names 二选一)。要增量部署的云函数本地路径数组',
|
|
433
|
+
},
|
|
434
|
+
remoteNpmInstall: {
|
|
435
|
+
type: 'boolean',
|
|
436
|
+
description: '是否在云端安装 npm 依赖(可选)。设为 true 时会在云端执行 npm install',
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
required: ['project', 'env'],
|
|
440
|
+
},
|
|
441
|
+
handler: executeCloudFunctionsIncDeploy,
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
name: 'weapp_cloud_functions_download',
|
|
445
|
+
description: '从云端下载云函数代码到本地。用于将已部署的云函数代码下载到本地进行查看或修改。',
|
|
446
|
+
inputSchema: {
|
|
447
|
+
type: 'object',
|
|
448
|
+
properties: {
|
|
449
|
+
project: {
|
|
450
|
+
type: 'string',
|
|
451
|
+
description: '项目路径(必填)。小程序项目根目录,包含 project.config.json 的目录',
|
|
452
|
+
},
|
|
453
|
+
env: {
|
|
454
|
+
type: 'string',
|
|
455
|
+
description: '云环境 ID(必填)。云函数所在的云开发环境标识',
|
|
456
|
+
},
|
|
457
|
+
name: {
|
|
458
|
+
type: 'string',
|
|
459
|
+
description: '云函数名称(必填)。要下载的云函数名称',
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
required: ['project', 'env', 'name'],
|
|
463
|
+
},
|
|
464
|
+
handler: executeCloudFunctionsDownload,
|
|
465
|
+
},
|
|
466
|
+
];
|
|
467
|
+
/**
|
|
468
|
+
* 工具执行映射表(向后兼容)
|
|
469
|
+
* @deprecated 直接使用工具的 handler 方法
|
|
470
|
+
*/
|
|
471
|
+
export const cloudToolExecutors = {
|
|
472
|
+
weapp_cloud_env_list: executeCloudEnvList,
|
|
473
|
+
weapp_cloud_functions_list: executeCloudFunctionsList,
|
|
474
|
+
weapp_cloud_functions_info: executeCloudFunctionsInfo,
|
|
475
|
+
weapp_cloud_functions_deploy: executeCloudFunctionsDeploy,
|
|
476
|
+
weapp_cloud_functions_inc_deploy: executeCloudFunctionsIncDeploy,
|
|
477
|
+
weapp_cloud_functions_download: executeCloudFunctionsDownload,
|
|
478
|
+
};
|
|
479
|
+
//# sourceMappingURL=cloud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud.js","sourceRoot":"","sources":["../../src/tools/cloud.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,KAAK,UAAU,mBAAmB,CAAC,IAAyB;IAC1D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE1D,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,gDAAgD;YAChD,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,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AA4B,EAAE,2BAA2B;IACzD,gCAAgC,EAAE,8BAA8B;IAChE,8BAA8B,EAAE,6BAA6B;CAC9D,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工具注册中心
|
|
3
|
+
* 统一导出所有工具定义
|
|
4
|
+
*/
|
|
5
|
+
import { ToolDefinition } from '../types.js';
|
|
6
|
+
export { authTools } from './auth.js';
|
|
7
|
+
export { previewTools } from './preview.js';
|
|
8
|
+
export { projectTools } from './project.js';
|
|
9
|
+
export { buildTools } from './build.js';
|
|
10
|
+
export { automationTools } from './automation.js';
|
|
11
|
+
export { cloudTools } from './cloud.js';
|
|
12
|
+
export declare const allTools: ToolDefinition[];
|
|
13
|
+
export declare const toolStats: {
|
|
14
|
+
total: number;
|
|
15
|
+
auth: number;
|
|
16
|
+
preview: number;
|
|
17
|
+
project: number;
|
|
18
|
+
build: number;
|
|
19
|
+
automation: number;
|
|
20
|
+
cloud: number;
|
|
21
|
+
};
|
|
22
|
+
export declare const toolNames: string[];
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAS7C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,eAAO,MAAM,QAAQ,EAAE,cAAc,EAOpC,CAAC;AAGF,eAAO,MAAM,SAAS;;;;;;;;CAQrB,CAAC;AAGF,eAAO,MAAM,SAAS,UAAoC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { authTools } from './auth.js';
|
|
2
|
+
import { previewTools } from './preview.js';
|
|
3
|
+
import { projectTools } from './project.js';
|
|
4
|
+
import { buildTools } from './build.js';
|
|
5
|
+
import { automationTools } from './automation.js';
|
|
6
|
+
import { cloudTools } from './cloud.js';
|
|
7
|
+
// 导出所有工具分类
|
|
8
|
+
export { authTools } from './auth.js';
|
|
9
|
+
export { previewTools } from './preview.js';
|
|
10
|
+
export { projectTools } from './project.js';
|
|
11
|
+
export { buildTools } from './build.js';
|
|
12
|
+
export { automationTools } from './automation.js';
|
|
13
|
+
export { cloudTools } from './cloud.js';
|
|
14
|
+
// 导出所有工具定义数组
|
|
15
|
+
export const allTools = [
|
|
16
|
+
...authTools,
|
|
17
|
+
...previewTools,
|
|
18
|
+
...projectTools,
|
|
19
|
+
...buildTools,
|
|
20
|
+
...automationTools,
|
|
21
|
+
...cloudTools,
|
|
22
|
+
];
|
|
23
|
+
// 工具数量统计
|
|
24
|
+
export const toolStats = {
|
|
25
|
+
total: allTools.length,
|
|
26
|
+
auth: authTools.length,
|
|
27
|
+
preview: previewTools.length,
|
|
28
|
+
project: projectTools.length,
|
|
29
|
+
build: buildTools.length,
|
|
30
|
+
automation: automationTools.length,
|
|
31
|
+
cloud: cloudTools.length,
|
|
32
|
+
};
|
|
33
|
+
// 导出工具名称列表
|
|
34
|
+
export const toolNames = allTools.map((tool) => tool.name);
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,aAAa;AACb,MAAM,CAAC,MAAM,QAAQ,GAAqB;IACxC,GAAG,SAAS;IACZ,GAAG,YAAY;IACf,GAAG,YAAY;IACf,GAAG,UAAU;IACb,GAAG,eAAe;IAClB,GAAG,UAAU;CACd,CAAC;AAEF,SAAS;AACT,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,KAAK,EAAE,QAAQ,CAAC,MAAM;IACtB,IAAI,EAAE,SAAS,CAAC,MAAM;IACtB,OAAO,EAAE,YAAY,CAAC,MAAM;IAC5B,OAAO,EAAE,YAAY,CAAC,MAAM;IAC5B,KAAK,EAAE,UAAU,CAAC,MAAM;IACxB,UAAU,EAAE,eAAe,CAAC,MAAM;IAClC,KAAK,EAAE,UAAU,CAAC,MAAM;CACzB,CAAC;AAEF,WAAW;AACX,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ToolDefinition, ToolResult } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 执行预览工具
|
|
4
|
+
*/
|
|
5
|
+
declare function executePreview(args: {
|
|
6
|
+
project: string;
|
|
7
|
+
qrFormat?: 'terminal' | 'image' | 'base64';
|
|
8
|
+
qrOutput?: string;
|
|
9
|
+
infoOutput?: string;
|
|
10
|
+
}): Promise<ToolResult>;
|
|
11
|
+
/**
|
|
12
|
+
* 执行自动预览工具
|
|
13
|
+
*/
|
|
14
|
+
declare function executeAutoPreview(args: {
|
|
15
|
+
project: string;
|
|
16
|
+
infoOutput?: string;
|
|
17
|
+
}): Promise<ToolResult>;
|
|
18
|
+
/**
|
|
19
|
+
* 执行上传工具
|
|
20
|
+
*/
|
|
21
|
+
declare function executeUpload(args: {
|
|
22
|
+
project: string;
|
|
23
|
+
version: string;
|
|
24
|
+
desc: string;
|
|
25
|
+
infoOutput?: string;
|
|
26
|
+
}): Promise<ToolResult>;
|
|
27
|
+
/**
|
|
28
|
+
* 工具定义数组
|
|
29
|
+
*/
|
|
30
|
+
export declare const previewTools: ToolDefinition[];
|
|
31
|
+
/**
|
|
32
|
+
* 工具执行映射表(向后兼容)
|
|
33
|
+
* @deprecated 直接使用工具的 handler 方法
|
|
34
|
+
*/
|
|
35
|
+
export declare const previewToolExecutors: {
|
|
36
|
+
weapp_preview: typeof executePreview;
|
|
37
|
+
weapp_auto_preview: typeof executeAutoPreview;
|
|
38
|
+
weapp_upload: typeof executeUpload;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/tools/preview.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzD;;GAEG;AACH,iBAAe,cAAc,CAAC,IAAI,EAAE;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,UAAU,CAAC,CAqEtB;AAED;;GAEG;AACH,iBAAe,kBAAkB,CAAC,IAAI,EAAE;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,UAAU,CAAC,CAgEtB;AAED;;GAEG;AACH,iBAAe,aAAa,CAAC,IAAI,EAAE;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,UAAU,CAAC,CAsGtB;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,EA4ExC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC"}
|