cloudcc-cli 2.2.5 → 2.2.7
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/.cloudcc-cache.json +38 -0
- package/README.md +1435 -522
- package/bin/cc.js +7 -2
- package/bin/index.js +4 -0
- package/java/com/cloudcc/core/BaseException.java +100 -0
- package/java/com/cloudcc/core/BusiException.java +43 -0
- package/java/com/cloudcc/core/CCService.java +3 -1
- package/java/com/cloudcc/core/StringUtils.java +7 -0
- package/java/com/cloudcc/core/TimeUtil.java +33 -0
- package/java/com/cloudcc/core/UserInfo.java +9 -0
- package/package.json +7 -1
- package/pom.xml +1 -1
- package/skill/BACKEND_CODE.md +114 -0
- package/skill/CLI_CHEATSHEET.md +90 -0
- package/skill/INSTALL_AND_BOOTSTRAP.md +59 -0
- package/skill/OBJECTS_AND_FIELDS.md +120 -0
- package/skill/REQUIREMENTS_BREAKDOWN.md +98 -0
- package/skill/SKILL.md +33 -0
- package/skill/VUE_CUSTOM_COMPONENT.md +50 -0
- package/src/api/backend-sdk-java.md +427 -0
- package/src/api/ccdk-sdk.md +1039 -0
- package/src/application/create.js +114 -0
- package/src/application/get.js +13 -0
- package/src/application/index.js +8 -0
- package/src/classes/doc.js +486 -0
- package/src/classes/index.js +1 -0
- package/src/mcp/cliRunner.js +61 -0
- package/src/mcp/index.js +84 -12
- package/src/mcp/readme.md +6 -3
- package/src/mcp/tools/Application Creator/handler.js +78 -0
- package/src/mcp/tools/Approval/handler.js +34 -151
- package/src/mcp/tools/Class Creator/handler.js +18 -15
- package/src/mcp/tools/Class Detail Retriever/handler.js +8 -9
- package/src/mcp/tools/Class Editor Guide/handler.js +5 -19
- package/src/mcp/tools/Class List Retriever/handler.js +8 -3
- package/src/mcp/tools/Class Publisher/handler.js +7 -9
- package/src/mcp/tools/Class Puller/handler.js +6 -65
- package/src/mcp/tools/Client Script Detail Retriever/handler.js +12 -18
- package/src/mcp/tools/Client Script Editor Guide/handler.js +9 -605
- package/src/mcp/tools/Client Script List Retriever/handler.js +30 -33
- package/src/mcp/tools/Client Script Publisher/handler.js +12 -11
- package/src/mcp/tools/Client Script Puller/handler.js +23 -30
- package/src/mcp/tools/CloudCC Development Overview/handler.js +11 -5
- package/src/mcp/tools/Component Creator/handler.js +12 -11
- package/src/mcp/tools/Component Detail Retriever/handler.js +12 -9
- package/src/mcp/tools/Component Editor Guide/handler.js +5 -22
- package/src/mcp/tools/Component List Retriever/handler.js +21 -18
- package/src/mcp/tools/Component Publisher/handler.js +25 -3
- package/src/mcp/tools/Component Puller/handler.js +13 -16
- package/src/mcp/tools/Dev Environment Creator/handler.js +5 -72
- package/src/mcp/tools/Dev Environment Validator/handler.js +5 -66
- package/src/mcp/tools/Developer Key Setup Guide/handler.js +11 -20
- package/src/mcp/tools/JSP Migrator/handler.js +842 -0
- package/src/mcp/tools/Menu Creator/handler.js +86 -0
- package/src/mcp/tools/Object Creator/handler.js +14 -6
- package/src/mcp/tools/Object Fields Creator/handler.js +9 -10
- package/src/mcp/tools/Object Fields Retriever/handler.js +6 -3
- package/src/mcp/tools/Object List Retriever/handler.js +10 -7
- package/src/mcp/tools/Scheduled Class Creator/handler.js +12 -16
- package/src/mcp/tools/Scheduled Class Detail Retriever/handler.js +7 -9
- package/src/mcp/tools/Scheduled Class List Retriever/handler.js +21 -23
- package/src/mcp/tools/Scheduled Class Publisher/handler.js +7 -9
- package/src/mcp/tools/Scheduled Class Puller/handler.js +6 -70
- package/src/mcp/tools/Trigger Creator/handler.js +12 -20
- package/src/mcp/tools/Trigger Detail Retriever/handler.js +7 -9
- package/src/mcp/tools/Trigger Editor Guide/handler.js +10 -35
- package/src/mcp/tools/Trigger List Retriever/handler.js +12 -4
- package/src/mcp/tools/Trigger Publisher/handler.js +8 -11
- package/src/mcp/tools/Trigger Puller/handler.js +12 -17
- package/src/menu/common.js +16 -0
- package/src/menu/create-object.js +94 -0
- package/src/menu/create-page.js +108 -0
- package/src/menu/create-script.js +108 -0
- package/src/menu/create-site.js +108 -0
- package/src/menu/create.js +54 -0
- package/src/menu/index.js +7 -0
- package/src/plugin/doc.js +801 -0
- package/src/plugin/index.js +1 -0
- package/src/plugin/pull.js +3 -0
- package/src/project/doc.js +378 -0
- package/src/project/index.js +1 -0
- package/src/script/doc.js +259 -0
- package/src/script/index.js +1 -0
- package/src/timer/index.js +1 -0
- package/src/triggers/doc.js +342 -0
- package/src/triggers/index.js +5 -0
- package/target/classes/com/cloudcc/core/BaseException.class +0 -0
- package/target/classes/com/cloudcc/core/BusiException.class +0 -0
- package/target/classes/com/cloudcc/core/CCService.class +0 -0
- package/target/classes/com/cloudcc/core/StringUtils.class +0 -0
- package/target/classes/com/cloudcc/core/TimeUtil.class +0 -0
- package/target/classes/com/cloudcc/core/UserInfo.class +0 -0
- package/template/lib/ccopenapi-0.0.4.jar +0 -0
- package/test/application.cli.test.js +30 -0
- package/test/classes.cli.test.js +121 -0
- package/test/fields.cli.test.js +69 -0
- package/test/mcp.cli.test.js +21 -0
- package/test/menu.cli.test.js +41 -0
- package/test/object.cli.test.js +64 -0
- package/test/plugin.cli.test.js +109 -0
- package/test/script.cli.test.js +101 -0
- package/test/timer.cli.test.js +107 -0
- package/test/trigger.cli.test.js +146 -0
- package/.vscode/settings.json +0 -3
- package/bin/mcp-svc.js +0 -13
- package/src/mcp/MCP/345/234/272/346/231/257/346/250/241/346/213/237.md +0 -8
- package/src/mcp/index-sse-svc.js +0 -126
- package/src/mcp/index-streamable-svc.js +0 -180
- package/src/mcp/tools/Class Detail Retriever/prompt.js +0 -37
- package/src/mcp/tools/Class Editor Guide/prompt.js +0 -468
- package/src/mcp/tools/Class Publisher/prompt.js +0 -40
- package/src/mcp/tools/Class Puller/prompt.js +0 -49
- package/src/mcp/tools/Client Script Creator/handler.js +0 -179
- package/src/mcp/tools/CloudCC Development Overview/prompt.js +0 -870
- package/src/mcp/tools/Component Editor Guide/prompt.js +0 -519
- package/src/mcp/tools/Component Publisher/prompt.js +0 -659
- package/src/mcp/tools/Dev Environment Creator/prompt.js +0 -273
- package/src/mcp/tools/Dev Environment Validator/prompt.js +0 -193
- package/src/mcp/tools/Developer Key Setup Guide/prompt.js +0 -71
- package/src/mcp/tools/Object Fields Retriever/prompt.js +0 -10
- package/src/mcp/tools/Object List Retriever/prompt.js +0 -10
- package/src/mcp/tools/ccdk/fetcher.js +0 -18
- package/src/mcp/tools/ccdk/handler.js +0 -98
- package/src/mcp/tools/ccdk/prompt.js +0 -453
- package/target/ccopenapi-0.0.3-classes.jar +0 -0
- package/target/ccopenapi-0.0.3.jar +0 -0
- package/target/maven-archiver/pom.properties +0 -3
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +0 -18
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +0 -19
- package/template/lib/ccopenapi-0.0.3.jar +0 -0
|
@@ -3,15 +3,20 @@
|
|
|
3
3
|
* 提供自定义类的查询功能
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const { runCcJsonCommand } = require('../../cliRunner');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* 获取类列表
|
|
10
11
|
*/
|
|
11
12
|
async function listClasses({ projectPath = process.cwd() }) {
|
|
12
13
|
try {
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
const resolvedPath = path.resolve(projectPath);
|
|
15
|
+
const run = runCcJsonCommand(['get', 'classes'], { cwd: resolvedPath });
|
|
16
|
+
if (!run.success) {
|
|
17
|
+
return { content: [{ type: 'text', text: `✗ 查询失败: ${run.detail || 'cc 命令执行失败'}` }] };
|
|
18
|
+
}
|
|
19
|
+
const classList = run.data || [];
|
|
15
20
|
|
|
16
21
|
if (!classList || classList.length === 0) {
|
|
17
22
|
return { content: [{ type: 'text', text: '未找到任何类' }] };
|
|
@@ -3,22 +3,20 @@
|
|
|
3
3
|
* 发布自定义类到服务器
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const { runCcCommand, buildRunDetail } = require('../../cliRunner');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* 发布类到服务器
|
|
10
11
|
*/
|
|
11
12
|
async function publishClass({ className, projectPath = process.cwd() }) {
|
|
12
13
|
try {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
await publishClassModule(className);
|
|
18
|
-
return { content: [{ type: 'text', text: `✓ 发布成功!类 ${className} 已发布到服务器` }] };
|
|
19
|
-
} finally {
|
|
20
|
-
process.chdir(originalCwd);
|
|
14
|
+
const resolvedPath = path.resolve(projectPath);
|
|
15
|
+
const run = runCcCommand(['publish', 'classes', className], { cwd: resolvedPath });
|
|
16
|
+
if (!run.success) {
|
|
17
|
+
return { content: [{ type: 'text', text: `✗ 发布失败: ${buildRunDetail(run) || 'cc 命令执行失败'}` }] };
|
|
21
18
|
}
|
|
19
|
+
return { content: [{ type: 'text', text: `✓ 发布成功!类 ${className} 已发布到服务器` }] };
|
|
22
20
|
} catch (error) {
|
|
23
21
|
return { content: [{ type: 'text', text: `✗ 发布失败: ${error.message}` }] };
|
|
24
22
|
}
|
|
@@ -3,79 +3,20 @@
|
|
|
3
3
|
* 从服务器拉取自定义类
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const fs = require('fs');
|
|
7
6
|
const path = require('path');
|
|
8
|
-
const
|
|
9
|
-
const pullClassModule = require('../../../classes/pull');
|
|
10
|
-
const pullListModule = require('../../../classes/pullList');
|
|
7
|
+
const { runCcCommand, buildRunDetail } = require('../../cliRunner');
|
|
11
8
|
|
|
12
9
|
/**
|
|
13
10
|
* 从服务器拉取类
|
|
14
11
|
*/
|
|
15
12
|
async function pullClass({ className, projectPath = process.cwd() }) {
|
|
16
13
|
try {
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (!fs.existsSync(configPath)) {
|
|
22
|
-
// 本地不存在,查询服务器
|
|
23
|
-
try {
|
|
24
|
-
const queryString = encodeURI(JSON.stringify({
|
|
25
|
-
name: className
|
|
26
|
-
}));
|
|
27
|
-
const classList = await getClassModule(queryString, projectPath, true);
|
|
28
|
-
|
|
29
|
-
if (!classList || classList.length === 0) {
|
|
30
|
-
return {
|
|
31
|
-
content: [{
|
|
32
|
-
type: 'text',
|
|
33
|
-
text: `✗ 拉取失败: 服务器上不存在类 ${className}`
|
|
34
|
-
}]
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// 找到匹配的类
|
|
39
|
-
const targetClass = classList.find(item => item.name === className || item.apiname === className);
|
|
40
|
-
if (!targetClass) {
|
|
41
|
-
return {
|
|
42
|
-
content: [{
|
|
43
|
-
type: 'text',
|
|
44
|
-
text: `✗ 拉取失败: 服务器上未找到类 ${className}`
|
|
45
|
-
}]
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// 使用 ID 从服务器拉取并在本地创建
|
|
50
|
-
const originalCwd = process.cwd();
|
|
51
|
-
process.chdir(projectPath);
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
await pullListModule(targetClass.id, projectPath, true);
|
|
55
|
-
return {
|
|
56
|
-
content: [{
|
|
57
|
-
type: 'text',
|
|
58
|
-
text: `✓ 拉取成功!已从服务器拉取类 ${className} 并在本地创建\n\n本地路径: classes/${className}/`
|
|
59
|
-
}]
|
|
60
|
-
};
|
|
61
|
-
} finally {
|
|
62
|
-
process.chdir(originalCwd);
|
|
63
|
-
}
|
|
64
|
-
} catch (error) {
|
|
65
|
-
return { content: [{ type: 'text', text: `✗ 拉取失败: ${error.message}` }] };
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// 本地存在,直接更新
|
|
70
|
-
const originalCwd = process.cwd();
|
|
71
|
-
process.chdir(projectPath);
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
await pullClassModule(className);
|
|
75
|
-
return { content: [{ type: 'text', text: `✓ 拉取成功!本地文件已更新: classes/${className}/${className}.java` }] };
|
|
76
|
-
} finally {
|
|
77
|
-
process.chdir(originalCwd);
|
|
14
|
+
const resolvedPath = path.resolve(projectPath);
|
|
15
|
+
const run = runCcCommand(['pull', 'classes', className], { cwd: resolvedPath });
|
|
16
|
+
if (!run.success) {
|
|
17
|
+
return { content: [{ type: 'text', text: `✗ 拉取失败: ${buildRunDetail(run) || 'cc 命令执行失败'}` }] };
|
|
78
18
|
}
|
|
19
|
+
return { content: [{ type: 'text', text: `✓ 拉取成功!本地文件已更新: classes/${className}/${className}.java` }] };
|
|
79
20
|
} catch (error) {
|
|
80
21
|
return { content: [{ type: 'text', text: `✗ 拉取失败: ${error.message}` }] };
|
|
81
22
|
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* 获取客户端脚本的详细信息
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const { runCcJsonCommand } = require('../../cliRunner');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* 获取客户端脚本详细信息
|
|
@@ -14,29 +15,22 @@ const detailScriptModule = require('../../../script/detail');
|
|
|
14
15
|
*/
|
|
15
16
|
async function getClientScriptDetail({ scriptPath, scriptId, projectPath = process.cwd() }) {
|
|
16
17
|
try {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
// 调用 detail.js 模块
|
|
22
|
-
const detail = await detailScriptModule(['detail', 'script', scriptPath, scriptId, projectPath]);
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
content: [{
|
|
26
|
-
type: 'text',
|
|
27
|
-
text: JSON.stringify(detail, null, 2)
|
|
28
|
-
}]
|
|
29
|
-
};
|
|
30
|
-
} catch (error) {
|
|
18
|
+
const resolvedPath = path.resolve(projectPath);
|
|
19
|
+
const run = runCcJsonCommand(['detail', 'script', scriptPath || '', scriptId || '', resolvedPath], { cwd: resolvedPath });
|
|
20
|
+
if (!run.success) {
|
|
31
21
|
return {
|
|
32
22
|
content: [{
|
|
33
23
|
type: 'text',
|
|
34
|
-
text: `✗ 获取失败: ${
|
|
24
|
+
text: `✗ 获取失败: ${run.detail || 'cc 命令执行失败'}`
|
|
35
25
|
}]
|
|
36
26
|
};
|
|
37
|
-
} finally {
|
|
38
|
-
process.chdir(originalCwd);
|
|
39
27
|
}
|
|
28
|
+
return {
|
|
29
|
+
content: [{
|
|
30
|
+
type: 'text',
|
|
31
|
+
text: JSON.stringify(run.data, null, 2)
|
|
32
|
+
}]
|
|
33
|
+
};
|
|
40
34
|
} catch (error) {
|
|
41
35
|
return {
|
|
42
36
|
content: [{
|