modu-platform 0.3.0 → 0.3.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.
- package/README.md +6 -16
- package/bin/modu.js +12 -11
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -29,10 +29,10 @@ npx -y modu-platform <verb> # 一次性执行(注意:包名是 modu-platfo
|
|
|
29
29
|
| `modu admin credential set --project <dir> --password <pw> [--username] [--dsn]` | **设初始口令**(打破「首个账号没口令登不进去」) |
|
|
30
30
|
| `modu backup` / `modu restore` | 项目库备份 / 恢复 |
|
|
31
31
|
| `modu env <create\|list\|promote>` | 派生环境(UAT / 预发) |
|
|
32
|
-
| `modu cockpit --project <dir>` |
|
|
32
|
+
| `modu cockpit --project <dir>` | API-only sidecar(Pro cockpit UI 的数据源;只绑 127.0.0.1) |
|
|
33
33
|
| `modu change <list\|show\|apply\|rollback>` | 变更集管理 |
|
|
34
34
|
| `modu release <show\|note>` | 发布记录 |
|
|
35
|
-
| `modu mcp` |
|
|
35
|
+
| `modu mcp` | 指路 MESA Pro(MCP 本体在 `mesa-pro`) |
|
|
36
36
|
| `modu help` / `modu --help` | 用法(缺少动词时也会打印) |
|
|
37
37
|
|
|
38
38
|
## 从零起一个应用(六条命令)
|
|
@@ -272,20 +272,10 @@ MODU_S3_FORCE_PATH_STYLE=true # 已忽略:实现恒为 path-styl
|
|
|
272
272
|
|
|
273
273
|
## MCP 配置
|
|
274
274
|
|
|
275
|
-
|
|
275
|
+
MCP 已迁入 MESA Pro;基础包不含 MCP 本体。`modu mcp` 只打印指路(安装 `mesa-pro` 后使用 `mesa-mcp`):
|
|
276
276
|
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
"mcpServers": {
|
|
280
|
-
"modu": { "command": "modu", "args": ["mcp"] }
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
工具面覆盖:项目建立(`project_create` 建项目骨架)、研发(`list_materials` / `validate_spec` / `spec_apply` 等)、数据源接入等。`spec_apply` 默认走提案制,`--allow-apply` 显式开启直写:
|
|
286
|
-
|
|
287
|
-
```json
|
|
288
|
-
{ "command": "modu", "args": ["mcp", "--allow-apply"] }
|
|
277
|
+
```bash
|
|
278
|
+
modu mcp # → 提示使用 MESA Pro 的 mesa-mcp
|
|
289
279
|
```
|
|
290
280
|
|
|
291
281
|
## 安装态能力边界
|
|
@@ -293,7 +283,7 @@ MODU_S3_FORCE_PATH_STYLE=true # 已忽略:实现恒为 path-styl
|
|
|
293
283
|
本包是**纯二进制载体**,与仓库态 CLI 的边界:
|
|
294
284
|
|
|
295
285
|
- `project_build` / `project_serve` 等需要仓库态的子进程工具明确拒绝(不假成功)——本地运行请用 `modu hub`;
|
|
296
|
-
- `doctor` / `catalog` / `prompt` / `grow` / `drift` / `migrate` 等工程脚手架动词不在此载体(建项目用 `modu new
|
|
286
|
+
- `doctor` / `catalog` / `prompt` / `grow` / `drift` / `migrate` 等工程脚手架动词不在此载体(建项目用 `modu new`;校验与测试用 `modu validate` / `modu test`);
|
|
297
287
|
- 运行时无 Node 依赖要求——二进制自包含(PGlite / wasm 与 workbench 壳产物已内嵌,`modu hub` 不需要仓库里的 dist),Node 只用于执行本包的入口脚本。
|
|
298
288
|
|
|
299
289
|
## 平台支持
|
package/bin/modu.js
CHANGED
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
* 平台包(modu-platform-<platform>-<arch>,optionalDependencies)无 bin、无 exports,
|
|
7
7
|
* 本文件经 require.resolve 子路径定位其中的二进制。
|
|
8
8
|
*
|
|
9
|
-
* mcp
|
|
10
|
-
* 让应用侧 {"command":"modu","args":["mcp"]} 真正起 MCP(cli-surface.md §3.1④)——
|
|
11
|
-
* modu 服务端二进制内的 mcp 分支只是指路(退出 1),不承载协议。
|
|
9
|
+
* `mcp` 动词在基础版只做 MESA Pro 指路:MCP 本体在 mesa-pro,不在本包内。
|
|
12
10
|
*/
|
|
13
11
|
"use strict";
|
|
14
12
|
|
|
@@ -16,9 +14,9 @@ const { spawn } = require("node:child_process");
|
|
|
16
14
|
|
|
17
15
|
// 与 modu-server/build.binary.mjs 的 TARGETS 同源:目录名 / 双产物文件名
|
|
18
16
|
const TARGETS = {
|
|
19
|
-
"darwin arm64": ["modu-platform-darwin-arm64", "modu-darwin-arm64"
|
|
20
|
-
"linux x64": ["modu-platform-linux-x64", "modu-linux-x64"
|
|
21
|
-
"win32 x64": ["modu-platform-windows-x64", "modu-windows-x64.exe"
|
|
17
|
+
"darwin arm64": ["modu-platform-darwin-arm64", "modu-darwin-arm64"],
|
|
18
|
+
"linux x64": ["modu-platform-linux-x64", "modu-linux-x64"],
|
|
19
|
+
"win32 x64": ["modu-platform-windows-x64", "modu-windows-x64.exe"],
|
|
22
20
|
};
|
|
23
21
|
|
|
24
22
|
const target = TARGETS[`${process.platform} ${process.arch}`];
|
|
@@ -26,7 +24,7 @@ if (!target) {
|
|
|
26
24
|
console.error(`modu 不支持当前平台 ${process.platform}-${process.arch}(支持:darwin-arm64 / linux-x64 / windows-x64)。`);
|
|
27
25
|
process.exit(1);
|
|
28
26
|
}
|
|
29
|
-
const [platformPkg, serverBin
|
|
27
|
+
const [platformPkg, serverBin] = target;
|
|
30
28
|
|
|
31
29
|
// require.resolve 以本包位置为起点(modu-platform 与平台包在宿主 node_modules 平级)
|
|
32
30
|
function resolveBinary(subpath) {
|
|
@@ -41,10 +39,13 @@ function resolveBinary(subpath) {
|
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
const userArgs = process.argv.slice(2);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
if (userArgs[0] === "mcp") {
|
|
43
|
+
console.error("modu mcp 需要 MESA Pro:安装 mesa-pro 后把 mesa-mcp 放到 PATH,或设置 MODU_MCP_BIN。");
|
|
44
|
+
console.error("基础版(MESA)不包含 MCP 本体;见 docs/requirements/open-core-split.md。");
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
const binary = resolveBinary(serverBin);
|
|
48
|
+
const args = userArgs;
|
|
48
49
|
|
|
49
50
|
const child = spawn(binary, args, { stdio: "inherit", env: process.env, windowsHide: true });
|
|
50
51
|
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modu-platform",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "MESA 命令行:低代码业务平台的基础发行版(项目建立 · 研发 · 运维;MCP 在 mesa-pro)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
7
7
|
"modu": "bin/modu.js"
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"README.md"
|
|
15
15
|
],
|
|
16
16
|
"optionalDependencies": {
|
|
17
|
-
"modu-platform-darwin-arm64": "0.3.
|
|
18
|
-
"modu-platform-linux-x64": "0.3.
|
|
19
|
-
"modu-platform-windows-x64": "0.3.
|
|
17
|
+
"modu-platform-darwin-arm64": "0.3.1",
|
|
18
|
+
"modu-platform-linux-x64": "0.3.1",
|
|
19
|
+
"modu-platform-windows-x64": "0.3.1"
|
|
20
20
|
}
|
|
21
21
|
}
|