cloudcc-cli 2.3.9 → 2.4.1

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 (53) hide show
  1. package/README.md +48 -0
  2. package/bin/cc.js +2 -1
  3. package/bin/index.js +1 -0
  4. package/cloudcc-dev-skill/SKILL.md +31 -8
  5. package/cloudcc-dev-skill/cloudcc-dev-html.md +42 -0
  6. package/cloudcc-dev-skill/config.json +2 -2
  7. package/mcp/index.js +10 -4
  8. package/mcp/tools/JSP Migrator/handler.js +51 -866
  9. package/mcp/tools/Object Creator/handler.js +14 -4
  10. package/mcp/tools/Trigger List Retriever/handler.js +24 -8
  11. package/package.json +1 -1
  12. package/src/classes/docs/devguide.md +863 -356
  13. package/src/classes/docs/introduction.md +279 -143
  14. package/src/jsp/analyze.js +17 -0
  15. package/src/jsp/doc.js +18 -0
  16. package/src/jsp/docs/devguide.md +111 -0
  17. package/src/jsp/docs/introduction.md +50 -0
  18. package/src/jsp/docs.js +21 -0
  19. package/src/jsp/index.js +14 -0
  20. package/src/jsp/migration.js +871 -0
  21. package/src/jsp/split.js +17 -0
  22. package/src/object/create.js +36 -10
  23. package/src/object/docs/devguide.md +6 -3
  24. package/src/project/docs/devguide.md +1 -1
  25. package/src/script/docs/devguide.md +22 -2
  26. package/src/timer/docs/devguide.md +1038 -400
  27. package/src/timer/docs/introduction.md +343 -231
  28. package/src/triggers/docs/devguide.md +1027 -329
  29. package/src/triggers/docs/introduction.md +640 -369
  30. package/src/triggers/get.js +8 -0
  31. package/src/version/listModuleCommands.js +6 -0
  32. package/target/classes/com/cloudcc/core/BaseException.class +0 -0
  33. package/target/classes/com/cloudcc/core/BusiException.class +0 -0
  34. package/target/classes/com/cloudcc/core/CCObject.class +0 -0
  35. package/target/classes/com/cloudcc/core/CCSchedule.class +0 -0
  36. package/target/classes/com/cloudcc/core/CCService.class +0 -0
  37. package/target/classes/com/cloudcc/core/CCTrigger.class +0 -0
  38. package/target/classes/com/cloudcc/core/CCTriggerHandler.class +0 -0
  39. package/target/classes/com/cloudcc/core/DevLogger.class +0 -0
  40. package/target/classes/com/cloudcc/core/OperatationEnum.class +0 -0
  41. package/target/classes/com/cloudcc/core/PeakInterf.class +0 -0
  42. package/target/classes/com/cloudcc/core/SendEmail.class +0 -0
  43. package/target/classes/com/cloudcc/core/ServiceResult.class +0 -0
  44. package/target/classes/com/cloudcc/core/StringUtils.class +0 -0
  45. package/target/classes/com/cloudcc/core/TimeUtil.class +0 -0
  46. package/target/classes/com/cloudcc/core/Tool$1.class +0 -0
  47. package/target/classes/com/cloudcc/core/Tool.class +0 -0
  48. package/target/classes/com/cloudcc/core/TriggerInvoker.class +0 -0
  49. package/target/classes/com/cloudcc/core/TriggerMethod.class +0 -0
  50. package/target/classes/com/cloudcc/core/TriggerTimeEnum.class +0 -0
  51. package/target/classes/com/cloudcc/core/UserInfo.class +0 -0
  52. package/test/jsp.cli.test.js +70 -0
  53. package/test/object.cli.test.js +9 -1
package/README.md CHANGED
@@ -71,6 +71,46 @@ Resolve the script path on macOS/Linux with:
71
71
  echo "$(npm root -g)/cloudcc-cli/bin/mcp.js"
72
72
  ```
73
73
 
74
+ # ReleaseV2.4.1
75
+
76
+ #### Release Date: 2026-4-9
77
+
78
+ #### Release Scope: Full
79
+
80
+ #### Release Content
81
+
82
+ - Docs alignment
83
+ - Refined `devguide` structure for `classes`, `timer`, and `triggers` to focus on implementation rules and avoid duplicated concept sections covered by `introduction`
84
+ - Added complete CLI command and argument sections in `classes` and `triggers` devguides, aligned with actual module handlers
85
+ - Expanded `timer` devguide command/argument coverage for all supported actions (`create`, `publish`, `pull`, `get`, `detail`, `pullList`, `delete`, `doc`)
86
+ - Query parameter documentation
87
+ - Added trigger list query field documentation in trigger devguide, including `fid`/`objId` semantics
88
+ - Clarified script list query docs: `condition.objName` is the query field and its value should be object **label** (not API name)
89
+ - MCP consistency
90
+ - Extended trigger list MCP schema and handler parameters (`objId`, paging, filter, sort) and aligned descriptions with CLI query body usage
91
+
92
+ # ReleaseV2.4.0
93
+
94
+ #### Release Date: 2026-4-8
95
+
96
+ #### Release Scope: Full
97
+
98
+ #### Release Content
99
+
100
+ - JSP migration module
101
+ - Added a new `jsp` resource module with `cloudcc analyze jsp`, `cloudcc split jsp`, and `cloudcc doc jsp <introduction|devguide>`
102
+ - Added migration pipeline support for JSP analysis and split generation, including parameter parsing and migration report output
103
+ - Added `src/jsp/docs/introduction.md` and `src/jsp/docs/devguide.md` for CLI-first JSP migration guidance
104
+ - CLI integration
105
+ - Registered `jsp` in `bin/index.js` and `src/version/listModuleCommands.js` so `cloudcc --help` and `cloudcc <action> -h` can discover JSP commands
106
+ - Improved CLI error handling in `bin/cc.js` by setting non-zero exit code and printing cleaner error messages
107
+ - MCP and skill alignment
108
+ - Refactored `mcp/tools/JSP Migrator/handler.js` to align with the new JSP module workflow
109
+ - Updated `cloudcc-dev-skill` docs/config to include JSP migration commands and latest skill metadata
110
+ - Documentation and tests
111
+ - Updated project devguide wording for current-directory project creation
112
+ - Added JSP CLI tests in `test/jsp.cli.test.js` for command contract coverage
113
+
74
114
  # ReleaseV2.3.9
75
115
 
76
116
  #### Release Date: 2026-4-3
@@ -121,6 +161,14 @@ echo "$(npm root -g)/cloudcc-cli/bin/mcp.js"
121
161
  - **`ENC` / `ENCD`**: **`ENC.js`** / **`ENCD.js`** + **`buildFieldData`** share **`schemefieldLength`** (≤255), **`masktype`**, **`encrypttype`**, **`maskcharacter`**; **`devguide`** / MCP document **`argvs[9..12]`**
122
162
  - **`LT` (geolocation)**: **`LT.js`** + **`buildFieldData`** **`validateCurrencyLikePrecision`** for **`obj`** length fields; **`displayType`**; **`devguide`** / MCP **`argvs[9..11]`**
123
163
  - Refreshed **`package.json` / npm** version to **2.3.12** (patch-line **2.3.9–2.3.12** changelog is consolidated in this **ReleaseV2.3.9** section); this README supplement documents **`C` + universal `helps`/`defaultValue`** without a new npm version bump
164
+ - **Classes**: Rewrote `src/classes/docs/devguide.md` as an AI-oriented custom-class spec (when to use classes, mandatory cloudcc-cli workflow, SOURCE-only business code, `UserInfo`/`CCService`, thin entry points, SDK usage, structure); expanded and aligned `src/classes/docs/introduction.md`
165
+ - **Timer**: Rewrote `src/timer/docs/devguide.md` as an AI-oriented scheduled-job (`CCSchedule`) spec (fit checks vs triggers/pages, cloudcc-cli `schedule/` workflow, idempotency/observability/batch/timezone, SDK alignment); expanded and aligned `src/timer/docs/introduction.md`
166
+ - **Timer (follow-up)**: Trimmed duplicate framing in `src/timer/docs/devguide.md` (removed redundant “sources” list wrapper and SDK appendix intro paragraphs; kept bullet lists and SDK reference content)
167
+ - **Triggers**: Rewrote `src/triggers/docs/devguide.md` as an AI-oriented trigger spec (fit checks vs schedulers/classes/pages, real project layout and CLI constraints, SDK usage, structure, recursion/perf pitfalls); expanded and aligned `src/triggers/docs/introduction.md`
168
+ - **Repo `cloudcc-cli.config.js`**: Default `use` is now `appstore-cn` (was `hls`); removed the `hls` environment block from the checked-in sample config
169
+ - Object
170
+ - **`cloudcc create object`** requires a **business description** as the **last** positional argument. The **`obj.remark`** payload is the default label-based prefix sentence plus a space plus that description. Supported forms: ``cloudcc create object <path> <label> <businessDescription>`` (auto-generated `nameLabel`) and ``cloudcc create object <path> <label> <nameLabel> <businessDescription>``. Omitting the description prints a usage hint and fails fast with an error.
171
+ - MCP tool **`create_custom_object`**: **`businessDescription`** is **required** (schema `z.string().min(1)`); **`mcp/tools/Object Creator/handler.js`** passes it as the trailing CLI argument. **`src/object/docs/devguide.md`** updated for the new contract.
124
172
 
125
173
  # ReleaseV2.3.8
126
174
 
package/bin/cc.js CHANGED
@@ -116,8 +116,9 @@ async function runWithArgvs(argv) {
116
116
  try {
117
117
  await cc[act](argv)
118
118
  } catch (e) {
119
+ process.exitCode = 1
119
120
  console.error()
120
- console.error(chalk.yellow("请查看帮助:cloudcc --help"), e)
121
+ console.error(chalk.yellow("请查看帮助:cloudcc --help"), e && e.message ? e.message : e)
121
122
  console.error()
122
123
  }
123
124
  }
package/bin/index.js CHANGED
@@ -11,6 +11,7 @@ const modules = {
11
11
  triggers: require("../src/triggers/index"),
12
12
  timer: require("../src/timer/index"),
13
13
  script: require("../src/script/index"),
14
+ jsp: require("../src/jsp/index"),
14
15
  token: require("../src/token/index"),
15
16
  object: require("../src/object/index"),
16
17
  recordType: require("../src/recordType/index"),
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cloudcc-dev-skill
3
- description: 用于 CloudCC CRM 二次开发设计与实施。优先通过 `cloudcc doc <module> introduction|devguide` 获取官方模块文档,再给出方案与代码。用户提到 CloudCC、cloudcc-cli、模块文档、对象/字段、权限、触发器、类、组件、页面、脚本、静态资源、菜单、应用、单点登录、身份提供方、校验规则时应优先使用。
3
+ description: 用于 CloudCC CRM 二次开发设计与实施。优先通过 `cloudcc doc <module> introduction|devguide` 获取官方模块文档,再给出方案与代码。用户提到 CloudCC、cloudcc-cli、模块文档、对象/字段、权限、触发器、类、组件、页面、脚本、JSP迁移、静态资源、菜单、应用、单点登录、身份提供方、校验规则时应优先使用。
4
4
  ---
5
5
 
6
6
  # CloudCC CRM 二开技能
@@ -14,16 +14,17 @@ description: 用于 CloudCC CRM 二次开发设计与实施。优先通过 `clou
14
14
 
15
15
  - 先确认 CLI 可用:优先检查 `cloudcc --version`。
16
16
  - 若未安装,执行:`npm i -g cloudcc-cli@latest`。
17
- - 只要涉及 CloudCC 设计或开发,先查文档再回答:优先 `introduction`,落地时看 `devguide`。
17
+ - 当进行 CloudCC 方案设计时,必须读取所有模块的`introduction`文档后,再设计
18
+ - 当进行 CloudCC 方案开发时,需要读取,对应模块的`devguide`信息后,再开发
18
19
  - 命令统一格式:`cloudcc doc <module> <introduction|devguide>`。
19
20
  - 特例:`config` 仅支持 `devguide`,不支持 `introduction`。
20
21
 
21
- ## 模块指令清单(按仓库当前实现)
22
+ ## 模块指令清单
22
23
 
23
24
  ### 基础与环境
24
25
 
25
26
  - 项目:`cloudcc doc project introduction`、`cloudcc doc project devguide`
26
- - 配置:`cloudcc doc config devguide`(仅该子命令)
27
+ - 配置:`cloudcc doc config devguide`
27
28
 
28
29
  ### 元数据与模型
29
30
 
@@ -51,11 +52,18 @@ description: 用于 CloudCC CRM 二次开发设计与实施。优先通过 `clou
51
52
 
52
53
  ### 前端扩展
53
54
 
54
- - 组件:`cloudcc doc plugin introduction`、`cloudcc doc plugin devguide`
55
+ - 自定义Vue组件:`cloudcc doc plugin introduction`、`cloudcc doc plugin devguide`
56
+ - 自定义Html组件:`./cloudcc-dev-html.md`
55
57
  - 自定义页面:`cloudcc doc customPage introduction`、`cloudcc doc customPage devguide`
56
58
  - 客户端脚本:`cloudcc doc script introduction`、`cloudcc doc script devguide`
57
59
  - 静态资源:`cloudcc doc staticResource introduction`、`cloudcc doc staticResource devguide`
58
60
 
61
+ ### 迁移与改造
62
+
63
+ - JSP 迁移文档:`cloudcc doc jsp introduction`、`cloudcc doc jsp devguide`
64
+ - JSP 分析:`cloudcc analyze jsp <encodeURI(JSON.stringify(params))>`
65
+ - JSP 拆分生成:`cloudcc split jsp <encodeURI(JSON.stringify(params))>`
66
+
59
67
  ### 平台导航与系统能力
60
68
 
61
69
  - 菜单:`cloudcc doc menu introduction`、`cloudcc doc menu devguide`
@@ -66,13 +74,28 @@ description: 用于 CloudCC CRM 二次开发设计与实施。优先通过 `clou
66
74
 
67
75
  ## 使用流程(执行顺序)
68
76
 
69
- 1. 方案阶段:先调用 `cloudcc doc <module> introduction`,确认能力边界与适用场景。
77
+ 1. 方案阶段:先调用
78
+ `cloudcc doc <module> introduction`,确认能力边界与适用场景。
70
79
  2. 实施阶段:再调用 `cloudcc doc <module> devguide`,按文档落地 CLI 命令与配置。
71
- 3. 环境阶段:涉及项目初始化或鉴权问题时,优先查看 `project devguide` 与 `config devguide`。
80
+ 3. 环境阶段:涉及项目初始化或鉴权问题时,优先查看 `project devguide` 与
81
+ `config devguide`。
82
+ 4. 若是旧系统 JSP 改造,先看 `cloudcc doc jsp devguide` 中的“JSP 迁移规则”章节,再执行 `cloudcc analyze jsp` / `cloudcc split jsp`。
72
83
 
73
84
  ## 响应要求
74
85
 
75
86
  - 给方案或代码前,先明确引用了哪些 `cloudcc doc` 模块文档。
76
87
  - 若用户没有指定模块,先反问业务对象(如对象、权限、触发器、页面)或先给一个最小可行模块列表。
77
88
  - 输出命令时保持可直接复制执行,不混用过时命令格式。
78
- - **发布日志/Release Notes 规则(强制)**:凡是更新发布记录、版本日志、README `Release`/`Release Notes` 区块,内容必须使用英文(标题、日期标签、条目描述均不得使用中文)。
89
+ - 若用户在 IDE / MCP 场景中做 JSP 迁移,可使用 MCP 工具 `get_jsp_migration_rules`、`analyze_jsp_migration`、`split_jsp_to_cloudcc`,但其规则来源仍以 `cloudcc doc jsp devguide` 为准。
90
+ - **发布日志/Release Notes 规则(强制)**:凡是更新发布记录、版本日志、README 中
91
+ `Release`/`Release Notes`
92
+ 区块,内容必须使用英文(标题、日期标签、条目描述均不得使用中文)。
93
+
94
+ ## 快速规则
95
+
96
+ - 先确认 CLI 可用:优先检查 `cloudcc --version`。
97
+ - 若未安装,执行:`npm i -g cloudcc-cli@latest`。
98
+ - 当进行 CloudCC 方案设计时,必须读取所有模块的`introduction`文档后,再设计
99
+ - 当进行 CloudCC 方案开发时,需要读取,对应模块的`devguide`信息后,再开发
100
+ - 命令统一格式:`cloudcc doc <module> <introduction|devguide>`。
101
+ - 特例:`config` 仅支持 `devguide`,不支持 `introduction`。
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: cloudcc-dev-html
3
+ description: 指导在 CloudCC 相关仓库中编写单个 HTML 入口页:推荐 Tailwind(tailwindcss-browser)、Alpine.js、ECharts(BootCDN)、可使用 window.$CCDK。用户提到单页 HTML、html/index、BootCDN、Tailwind、Alpine、ECharts、CCDK、$CCDK 时使用。
4
+ ---
5
+
6
+ # CloudCC 单 HTML 页面开发规范
7
+
8
+ 版本信息见同目录 [config.json](config.json)。
9
+
10
+ ## 1. 技能用途:创建单个 HTML 页面
11
+
12
+ - 本技能用于在项目中编写**单个 HTML 入口文件**(通常为 **`html/index.html`**),在 CloudCC 内嵌或单独打开,与 `plugins/` 等业务源码区分存放。
13
+ - 静态依赖(样式、脚本、字体等)**优先使用线上绝对地址**(`https://...`)引入;**公有云**推荐 [BootCDN](https://www.bootcdn.cn/) 等中国大陆可稳定访问的源;**私有云 / 内网**可将所需文件下载后上传到组织静态资源,再改为静态资源 URL。
14
+ - 平台业务接口与模块说明以 **cloudcc-dev-skill**(`cloudcc doc <module>`)为准;本技能不替代平台开发指南。
15
+
16
+ ## 2. 页面推荐的样式与交互库
17
+
18
+ 以下为独立页**推荐**组合(通过 BootCDN 固定版本,升级时改 URL 中版本号;私有云按上一节改链)。
19
+
20
+ **样式:Tailwind CSS(tailwindcss-browser,浏览器端编译)**
21
+
22
+ ```html
23
+ <script src="https://cdn.bootcdn.net/ajax/libs/tailwindcss-browser/4.1.13/index.global.min.js"></script>
24
+ ```
25
+
26
+ **交互:Alpine.js v3(CDN 构建,使用 `defer`,放在 `head`;与 Tailwind 同页时 Tailwind 在前、Alpine 在后)**
27
+
28
+ ```html
29
+ <script defer src="https://cdn.bootcdn.net/ajax/libs/alpinejs/3.15.0/cdn.min.js"></script>
30
+ ```
31
+
32
+ **图表:ECharts(按需引入;与 Tailwind、Alpine 同页时,建议放在二者之后,在初始化图表的脚本之前加载)**
33
+
34
+ ```html
35
+ <script src="https://cdn.bootcdn.net/ajax/libs/echarts/6.0.0/echarts.min.js"></script>
36
+ ```
37
+
38
+ ## 3. 页面可使用 CCDK
39
+
40
+ - 在 CloudCC 运行环境(自定义页面、内嵌 HTML 等)中,可通过 **`window.$CCDK`** 使用平台提供的 **CCDK** 能力;脚本应通过该入口调用,不依赖未文档化的其它全局名。
41
+ - 在浏览器中直接打开本地文件时通常**没有** `$CCDK`,须做存在性判断或区分环境,避免报错。
42
+ - CCDK 具体 API 以平台文档及 **cloudcc-dev-skill** 中相关说明为准。
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "1.0.0",
3
- "releaseDate": "2026-04-01"
2
+ "version": "1.0.3",
3
+ "releaseDate": "2026-04-07"
4
4
  }
package/mcp/index.js CHANGED
@@ -115,7 +115,8 @@ mcpServer.registerTool(
115
115
  description: '在 CloudCC CRM 系统中创建一个自定义对象(Custom Object),相当于数据库的表。',
116
116
  inputSchema: z.object({
117
117
  label: z.string().min(1).describe('对象的显示标签(例如: 客户)'),
118
- projectPath: z.string().describe('项目根路径,默认为当前工作目录')
118
+ projectPath: z.string().describe('项目根路径,默认为当前工作目录'),
119
+ businessDescription: z.string().min(1).describe('对象业务功能描述(必填),拼接到默认 remark 文案之后')
119
120
  })
120
121
  },
121
122
  customObjectHandler.createCustomObject
@@ -393,10 +394,15 @@ mcpServer.registerTool(
393
394
  mcpServer.registerTool(
394
395
  'get_trigger_list',
395
396
  {
396
- description: '获取 CloudCC CRM 服务器上的触发器列表,可选筛选条件',
397
+ description: '获取 CloudCC CRM 服务器上的触发器列表。支持按触发器名称、对象ID筛选,并支持分页/扩展过滤/排序参数。',
397
398
  inputSchema: z.object({
398
- triggerName: z.string().optional().describe('可选,触发器名称(用于筛选)'),
399
- targetObjectId: z.string().optional().describe('可选,目标对象ID(用于筛选)'),
399
+ triggerName: z.string().optional().describe('可选,触发器名称(映射到查询字段 sname)'),
400
+ targetObjectId: z.string().optional().describe('可选,目标对象ID(映射到查询字段 fid)'),
401
+ objId: z.string().optional().describe('可选,目标对象ID语义化别名(会映射到 fid)'),
402
+ shownum: z.union([z.string(), z.number()]).optional().describe('可选,每页条数(默认 2000)'),
403
+ showpage: z.union([z.string(), z.number()]).optional().describe('可选,页码(默认 1)'),
404
+ rptcond: z.string().optional().describe('可选,扩展过滤条件(默认空字符串)'),
405
+ rptorder: z.string().optional().describe('可选,排序条件(默认空字符串)'),
400
406
  projectPath: z.string().describe('项目根目录路径,默认为当前工作目录')
401
407
  })
402
408
  },