@microi.net/cli 5.6.2 → 5.6.3
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/.codebuddy-plugin/marketplace.json +2 -2
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +2 -2
- package/.workbuddy-plugin/marketplace.json +2 -2
- package/.workbuddy-plugin/plugin.json +1 -1
- package/README.md +2 -2
- package/assets/build-meta.json +7 -6
- package/assets/feature-matrix.json +138 -129
- package/cordis.patch.yml +2 -2
- package/package.json +1 -1
- package/scripts/mcp-server.js +2 -2
- package/scripts/microi-cli.js +34 -34
- package/scripts/microi-skills.meta.json +217 -217
- package/skills/.microi-skills-version.json +3 -3
- package/skills/.progressive-disclosure-manifest.json +58 -58
- package/skills/app-store/SKILL.md +6 -0
- package/skills/email-engine/SKILL.md +3 -2
- package/skills/job-engine/SKILL.md +10 -3
- package/skills/microi-client-frontend/SKILL.md +5 -2
- package/skills/microi-codex/SKILL.md +57 -48
- package/skills/microi-codex-installer/SKILL.md +12 -3
- package/skills/microi-deployment/SKILL.md +2 -0
- package/skills/microi-form-engine/SKILL.md +2 -0
- package/skills/playwright-e2e/SKILL.md +8 -8
- package/skills/playwright-e2e/references/progressive-01-/345/205/250/350/207/252/345/212/250/347/231/273/345/275/225-/345/205/215/351/252/214/350/257/201/347/240/201-/344/275/206/344/270/215/345/205/215/345/257/206/347/240/201-/345/277/205/350/257/273.md +3 -3
- package/skills/playwright-e2e/references/progressive-02-/346/226/207/345/255/227/345/257/271/346/257/224/345/272/246/344/270/216/345/217/257/350/257/273/346/200/247/350/207/252/345/212/250/345/214/226/346/243/200/346/237/245-/345/277/205/345/201/232.md +2 -2
- package/skills/playwright-e2e/references/progressive-03-microi-helper-/346/250/241/346/235/277.md +3 -3
- package/skills/playwright-e2e/references/progressive-04-ci-/345/273/272/350/256/256.md +3 -3
- package/skills/system-observability/SKILL.md +62 -8
- package/skills/v8-explorer-tree/SKILL.md +228 -226
- package/skills/v8-file-upload/SKILL.md +18 -1
- package/skills/v8-file-upload/references/progressive-01-/345/205/254/346/234/211/346/241/266-vs-/347/247/201/346/234/211/346/241/266.md +1 -1
- package/skills/v8-file-upload/references/progressive-02-office-/346/226/207/344/273/266/345/234/250/347/272/277/347/274/226/350/276/221/347/211/210/346/234/254/345/217/267/350/247/204/345/210/231.md +3 -3
- package/skills/v8-sql-query/SKILL.md +141 -133
- package/skills/v8-tcp-integration/SKILL.md +2 -2
- package/skills/v8-workflow/SKILL.md +12 -4
- package/skills/workspace-conventions/SKILL.md +8 -6
- package/skills/workspace-conventions/references/progressive-01-/347/211/210/346/234/254/346/233/264/346/226/260/346/227/245/345/277/227/344/277/235/346/212/244/350/247/204/345/210/231-/345/274/272/345/210/266.md +6 -6
- package/skills/workspace-conventions/references/progressive-02-microi-net-api-/346/234/254/345/234/260/345/220/257/345/212/250/347/272/246/345/256/232.md +21 -21
- package/skills/workspace-conventions/references/progressive-03-cli-/344/270/216-ide-/346/217/222/344/273/266/351/224/231/347/211/210/345/205/261/345/255/230/347/272/246/345/256/232.md +1 -1
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
"url": "https://microi.net"
|
|
6
6
|
},
|
|
7
7
|
"description": "Microi吾码官方 AI 插件市场",
|
|
8
|
-
"version": "5.6.
|
|
8
|
+
"version": "5.6.3",
|
|
9
9
|
"plugins": [
|
|
10
10
|
{
|
|
11
11
|
"name": "microi",
|
|
12
12
|
"source": ".",
|
|
13
13
|
"description": "Microi吾码 AI 开发插件:服务器连接、Skills、MCP、V8 全量同步与低代码交付",
|
|
14
|
-
"version": "5.6.
|
|
14
|
+
"version": "5.6.3",
|
|
15
15
|
"strict": true
|
|
16
16
|
}
|
|
17
17
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microi",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.3",
|
|
4
4
|
"description": "Microi吾码低代码平台的 Codex 开发插件,共享 VS Code/CLI 的连接、同步、MCP、V8 与交付能力。",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Microi.Net",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"interface": {
|
|
22
22
|
"displayName": "Microi吾码",
|
|
23
23
|
"shortDescription": "在 Codex 中开发、同步、调试和交付 Microi 应用",
|
|
24
|
-
"longDescription": "@microi.net/cli 同时提供 Microi吾码 CLI 与 Codex Plugin,复用 Microi.
|
|
24
|
+
"longDescription": "@microi.net/cli 同时提供 Microi吾码 CLI 与 Codex Plugin,复用 Microi.Code 的配置、Token、MCP Server 和全套领域 Skill,覆盖连接登录、代码同步、V8/表单/模块/工作流、微应用、性能测试与 Playwright。",
|
|
25
25
|
"developerName": "Microi.Net",
|
|
26
26
|
"category": "Developer Tools",
|
|
27
27
|
"capabilities": [
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
"url": "https://microi.net"
|
|
6
6
|
},
|
|
7
7
|
"description": "Microi吾码官方 AI 插件市场",
|
|
8
|
-
"version": "5.6.
|
|
8
|
+
"version": "5.6.3",
|
|
9
9
|
"plugins": [
|
|
10
10
|
{
|
|
11
11
|
"name": "microi",
|
|
12
12
|
"source": ".",
|
|
13
13
|
"description": "Microi吾码 AI 开发插件:服务器连接、Skills、MCP、V8 全量同步与低代码交付",
|
|
14
|
-
"version": "5.6.
|
|
14
|
+
"version": "5.6.3",
|
|
15
15
|
"strict": true
|
|
16
16
|
}
|
|
17
17
|
]
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- 全局命令 `microi`;
|
|
6
6
|
- Codex Plugin、DeepSeek Harness 原生 profile bundle,以及 WorkBuddy/CodeBuddy 兼容 plugin 与 marketplace 清单;
|
|
7
|
-
- 与 Microi.
|
|
7
|
+
- 与 Microi.Code 同源的 MCP Server、连接/Token/同步协议;
|
|
8
8
|
- 支持多服务器、租户、产品类型和网络环境的 `microi_codex` 路由;
|
|
9
9
|
- 全套 Microi Skills 与 VS Code 命令覆盖矩阵。
|
|
10
10
|
|
|
@@ -62,7 +62,7 @@ microi dsh status --json
|
|
|
62
62
|
microi dsh install
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
默认幂等安装到 DSH 官方 `web` 与 `headless` profile;也可用 `--profile <名称>` 指定一个 profile。本包通过 `dsh.bundle.patch` 和 `cordis.patch.yml` 接入官方 `@deepseek-ai/dsh-mcp-client`,不是向 DSH 写入无效的 `.mcp.json`。安装后新建 DSH 会话,工具入口为 `mcp__microi__microi_codex`。开发源码可用 `microi dsh install --source <Microi.
|
|
65
|
+
默认幂等安装到 DSH 官方 `web` 与 `headless` profile;也可用 `--profile <名称>` 指定一个 profile。本包通过 `dsh.bundle.patch` 和 `cordis.patch.yml` 接入官方 `@deepseek-ai/dsh-mcp-client`,不是向 DSH 写入无效的 `.mcp.json`。安装后新建 DSH 会话,工具入口为 `mcp__microi__microi_codex`。开发源码可用 `microi dsh install --source <Microi.Code目录> --force` 验收。
|
|
66
66
|
|
|
67
67
|
后台更新会在检测到 DSH 时自动幂等升级 bundle;DSH 或 pnpm 不存在、网络失败时只记录延后状态,不影响其它宿主和当前任务。
|
|
68
68
|
|
package/assets/build-meta.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
"builtAt": "2026-09-
|
|
3
|
-
"version": "5.6.
|
|
2
|
+
"builtAt": "2026-09-13T23:23:56.245Z",
|
|
3
|
+
"version": "5.6.3",
|
|
4
4
|
"sourceProducts": [
|
|
5
5
|
"vscode-extension",
|
|
6
6
|
"microi-cli",
|
|
7
|
-
"codex-plugin"
|
|
7
|
+
"codex-plugin",
|
|
8
|
+
"microi-code-desktop"
|
|
8
9
|
],
|
|
9
10
|
"commands": 55,
|
|
10
11
|
"skills": 67,
|
|
11
12
|
"hashes": {
|
|
12
|
-
"mcpServer": "
|
|
13
|
-
"cli": "
|
|
13
|
+
"mcpServer": "e2018877e45cd3f00baaadc39b52d72bcbcb7a469ec152b4b5d737d56e01ca09",
|
|
14
|
+
"cli": "430095f107eeb382553fcfa8ace1558f7c321a8f1980933f6f9d2f0b27ef2b92",
|
|
14
15
|
"router": "ffc14787fc2d3d6173b7a779b77139b759eb1d482cea787f71283f4017a4e223",
|
|
15
16
|
"broker": "caae2730cc411d11c20f33b367968f7538aae8f5b65a713fcc557deedaefcf70",
|
|
16
|
-
"dshBundle": "
|
|
17
|
+
"dshBundle": "79cbd14ad534d8b9a1e85a94dec6cf7cea4c212da4ec478180957a031ffaf113"
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -1,129 +1,138 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": 1,
|
|
3
|
-
"products": [
|
|
4
|
-
"vscode-extension",
|
|
5
|
-
"microi-cli",
|
|
6
|
-
"codex-plugin"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
"microi.
|
|
17
|
-
"microi.
|
|
18
|
-
"microi.
|
|
19
|
-
"microi.
|
|
20
|
-
"microi.
|
|
21
|
-
"microi.
|
|
22
|
-
"microi.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"microi.
|
|
34
|
-
"microi.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"microi.
|
|
47
|
-
"microi.
|
|
48
|
-
"microi.
|
|
49
|
-
"microi.
|
|
50
|
-
"microi.
|
|
51
|
-
"microi.
|
|
52
|
-
"microi.
|
|
53
|
-
"microi.
|
|
54
|
-
"microi.
|
|
55
|
-
"microi.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"microi.microApp.
|
|
82
|
-
"microi.microApp.
|
|
83
|
-
"microi.microApp.
|
|
84
|
-
"microi.microApp.
|
|
85
|
-
"microi.microApp.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"microi.mcp.
|
|
112
|
-
"microi.mcp.
|
|
113
|
-
"microi.mcp.
|
|
114
|
-
"microi.mcp.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"products": [
|
|
4
|
+
"vscode-extension",
|
|
5
|
+
"microi-cli",
|
|
6
|
+
"codex-plugin",
|
|
7
|
+
"microi-code-desktop"
|
|
8
|
+
],
|
|
9
|
+
"groups": [
|
|
10
|
+
{
|
|
11
|
+
"id": "connection-and-auth",
|
|
12
|
+
"adapter": "bundled-cli",
|
|
13
|
+
"workflow": "microi profile/auth/doctor 与 Codex 原生设置",
|
|
14
|
+
"surfaceDifference": "VS Code Webview 与树视图改为对话、JSON 输出和工作区文件。",
|
|
15
|
+
"commands": [
|
|
16
|
+
"microi.showSettings",
|
|
17
|
+
"microi.login",
|
|
18
|
+
"microi.logout",
|
|
19
|
+
"microi.switchOsClient",
|
|
20
|
+
"microi.refreshTree",
|
|
21
|
+
"microi.openLocalFolder",
|
|
22
|
+
"microi.copyEngineKey",
|
|
23
|
+
"microi.searchEngine"
|
|
24
|
+
],
|
|
25
|
+
"desktopSurface": "服务器连接 / 官方账号 / 项目选择"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "remote-execution-debug-and-performance",
|
|
29
|
+
"adapter": "skill-and-mcp",
|
|
30
|
+
"workflow": "v8-debugging/performance-testing Skills + microi_codex 原工具",
|
|
31
|
+
"surfaceDifference": "VS Code DAP/Webview 改为结构化执行、诊断、补丁、复测及报告;远端执行能力和安全门保持一致。",
|
|
32
|
+
"commands": [
|
|
33
|
+
"microi.showPerformanceTest",
|
|
34
|
+
"microi.remoteExecute",
|
|
35
|
+
"microi.remoteDebug",
|
|
36
|
+
"microi.stopDebugSession"
|
|
37
|
+
],
|
|
38
|
+
"desktopSurface": "吾码工具与 AI 开发;原 VS Code DAP 面板继续保留"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "source-sync-and-diff",
|
|
42
|
+
"adapter": "bundled-cli-and-codex-native",
|
|
43
|
+
"workflow": "microi pull/push/sync status + Codex 文件读取、搜索和 diff",
|
|
44
|
+
"surfaceDifference": "VS Code 编辑器命令改为 Codex 文件链接、补丁和终端输出。",
|
|
45
|
+
"commands": [
|
|
46
|
+
"microi.push",
|
|
47
|
+
"microi.openFile",
|
|
48
|
+
"microi.diffWithRemote",
|
|
49
|
+
"microi.showSyncStatus",
|
|
50
|
+
"microi.checkSyncConflicts",
|
|
51
|
+
"microi.syncResults.open",
|
|
52
|
+
"microi.syncResults.refresh",
|
|
53
|
+
"microi.syncResults.clear",
|
|
54
|
+
"microi.pullServer",
|
|
55
|
+
"microi.syncServer",
|
|
56
|
+
"microi.pullTableFields",
|
|
57
|
+
"microi.pullModuleTree",
|
|
58
|
+
"microi.pullDbSchema"
|
|
59
|
+
],
|
|
60
|
+
"desktopSurface": "项目资源:编辑、拉取、推送、同步差异;AI 审阅"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "resource-authoring",
|
|
64
|
+
"adapter": "mcp",
|
|
65
|
+
"workflow": "microi_codex 中的 create/save/get/list 原工具及对应领域 Skill",
|
|
66
|
+
"surfaceDifference": "QuickPick/InputBox 改为对话确认;仍复用原工具 schema、确认口令、审计和回读。",
|
|
67
|
+
"commands": [
|
|
68
|
+
"microi.createEngine",
|
|
69
|
+
"microi.createFormEvent",
|
|
70
|
+
"microi.createWorkflowNodeEvent",
|
|
71
|
+
"microi.createMenuButtonEvent"
|
|
72
|
+
],
|
|
73
|
+
"desktopSurface": "AI 开发 + 同源 MCP / Skills / Harness 工作区工具"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "micro-app",
|
|
77
|
+
"adapter": "skill-mcp-and-shell",
|
|
78
|
+
"workflow": "microi-microservice Skill + scaffold/sync/publish MCP 原工具 + 受控 npm build",
|
|
79
|
+
"surfaceDifference": "VS Code 进度条与选择框改为阶段化对话和构建日志。",
|
|
80
|
+
"commands": [
|
|
81
|
+
"microi.microApp.create",
|
|
82
|
+
"microi.microApp.pull",
|
|
83
|
+
"microi.microApp.build",
|
|
84
|
+
"microi.microApp.push",
|
|
85
|
+
"microi.microApp.buildAndPush",
|
|
86
|
+
"microi.microApp.pushRuntimeOnly",
|
|
87
|
+
"microi.microApp.buildAndPushRuntimeOnly",
|
|
88
|
+
"microi.microApp.buildAndPublishStore",
|
|
89
|
+
"microi.microApp.syncSource",
|
|
90
|
+
"microi.microApp.showSyncStatus"
|
|
91
|
+
],
|
|
92
|
+
"desktopSurface": "AI 开发 + 同源 MCP / Skills / Harness 工作区工具"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "ai-bootstrap",
|
|
96
|
+
"adapter": "bundled-cli-and-skills",
|
|
97
|
+
"workflow": "microi ai init / mcp init 与同源 Skills、typings、AGENTS 注入",
|
|
98
|
+
"surfaceDifference": "初始化结果以结构化文本返回。",
|
|
99
|
+
"commands": [
|
|
100
|
+
"microi.initializeAiConfig",
|
|
101
|
+
"microi.configureMcp"
|
|
102
|
+
],
|
|
103
|
+
"desktopSurface": "AI 开发 + 同源 MCP / Skills / Harness 工作区工具"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "mcp-lifecycle",
|
|
107
|
+
"adapter": "codex-plugin-native-and-router",
|
|
108
|
+
"workflow": "Codex Plugin 启停策略、microi_codex profiles、CLI doctor/mcp init",
|
|
109
|
+
"surfaceDifference": "进程启停和输出由 Codex 插件宿主托管,不复制 VS Code MCP 面板。",
|
|
110
|
+
"commands": [
|
|
111
|
+
"microi.mcp.refreshStatus",
|
|
112
|
+
"microi.mcp.diagnose",
|
|
113
|
+
"microi.mcp.startAll",
|
|
114
|
+
"microi.mcp.startServer",
|
|
115
|
+
"microi.mcp.stopServer",
|
|
116
|
+
"microi.mcp.restartServer",
|
|
117
|
+
"microi.mcp.showOutput",
|
|
118
|
+
"microi.mcp.showConfig",
|
|
119
|
+
"microi.mcp.openServerOptions",
|
|
120
|
+
"microi.mcp.showInstalled",
|
|
121
|
+
"microi.mcp.removeServerConfig"
|
|
122
|
+
],
|
|
123
|
+
"desktopSurface": "AI 开发 + 同源 MCP / Skills / Harness 工作区工具"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "playwright",
|
|
127
|
+
"adapter": "skill-browser-and-shell",
|
|
128
|
+
"workflow": "playwright-e2e Skill + Codex 浏览器/终端 + 原测试上下文接口",
|
|
129
|
+
"surfaceDifference": "VS Code 命令改为 Codex 浏览器验收与可点击报告文件。",
|
|
130
|
+
"commands": [
|
|
131
|
+
"microi.initPlaywright",
|
|
132
|
+
"microi.runPlaywright",
|
|
133
|
+
"microi.openPlaywrightReport"
|
|
134
|
+
],
|
|
135
|
+
"desktopSurface": "AI 开发 + 同源 MCP / Skills / Harness 工作区工具"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
}
|
package/cordis.patch.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Generated from Microi.
|
|
1
|
+
# Generated from Microi.Code/codex/src/microi-dsh-profile-bootstrap.js.
|
|
2
2
|
# Installed by: dsh plugin --profile <name> add @microi.net/cli
|
|
3
3
|
- insert:
|
|
4
4
|
- id: microi-mcp
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
serverName: microi
|
|
8
8
|
transport: stdio
|
|
9
9
|
command: !!js process.execPath
|
|
10
|
-
args: ["-e","/*\n * DeepSeek Harness 通过 profile bundle 加载此 `node -e` 引导脚本。\n * DSH 不保证 MCP 子进程 cwd 位于 npm 包根,因此按 DSH_HOME/profile 定位\n * 当前版本的 @microi.net/cli,再复用 Codex 同源适配器与多连接路由器。\n */\nconst fs = require('node:fs');\nconst os = require('node:os');\nconst path = require('node:path');\nconst packageName = '@microi.net/cli';\nconst expectedVersion = '5.6.
|
|
10
|
+
args: ["-e","/*\n * DeepSeek Harness 通过 profile bundle 加载此 `node -e` 引导脚本。\n * DSH 不保证 MCP 子进程 cwd 位于 npm 包根,因此按 DSH_HOME/profile 定位\n * 当前版本的 @microi.net/cli,再复用 Codex 同源适配器与多连接路由器。\n */\nconst fs = require('node:fs');\nconst os = require('node:os');\nconst path = require('node:path');\nconst packageName = '@microi.net/cli';\nconst expectedVersion = '5.6.3';\n\nfunction readJson(filePath) {\n try { return JSON.parse(fs.readFileSync(filePath, 'utf8')); }\n catch { return undefined; }\n}\n\nfunction expandHome(value) {\n if (value === '~') return os.homedir();\n if (value.startsWith('~/') || value.startsWith('~\\\\')) return path.join(os.homedir(), value.slice(2));\n return value;\n}\n\nfunction validRoot(value) {\n const root = path.resolve(value);\n const pkg = readJson(path.join(root, 'package.json'));\n const patch = path.join(root, 'cordis.patch.yml');\n const adapter = path.join(root, 'scripts', 'mcp-codex-stdio-adapter.js');\n const router = path.join(root, 'scripts', 'microi-codex-router.js');\n if (pkg?.name !== packageName || pkg?.version !== expectedVersion) return undefined;\n if (pkg?.dsh?.bundle?.patch !== './cordis.patch.yml') return undefined;\n if (![patch, adapter, router].every(filePath => fs.existsSync(filePath))) return undefined;\n return { root: fs.realpathSync(root), adapter, router, modifiedAt: fs.statSync(router).mtimeMs };\n}\n\nfunction findPlugin() {\n const explicit = String(process.env.MICROI_DSH_PLUGIN_ROOT || '').trim();\n if (explicit) {\n const plugin = validRoot(explicit);\n if (!plugin) throw new Error(`MICROI_DSH_PLUGIN_ROOT 不是版本 ${expectedVersion} 的有效 Microi DSH bundle:${explicit}`);\n return plugin;\n }\n const configuredHome = String(process.env.DSH_HOME || '').trim();\n const dshHome = path.resolve(expandHome(configuredHome || path.join(os.homedir(), '.dsh')));\n const profilesRoot = path.join(dshHome, 'profiles');\n const candidates = [];\n if (fs.existsSync(profilesRoot)) {\n for (const entry of fs.readdirSync(profilesRoot, { withFileTypes: true })) {\n if (!entry.isDirectory() || entry.name === 'node_modules') continue;\n const root = path.join(profilesRoot, entry.name, 'node_modules', '@microi.net', 'cli');\n const plugin = validRoot(root);\n if (plugin) candidates.push(plugin);\n }\n }\n candidates.sort((left, right) => right.modifiedAt - left.modifiedAt);\n if (!candidates[0]) throw new Error(`未在 ${profilesRoot} 找到版本 ${expectedVersion} 的 ${packageName}`);\n return candidates[0];\n}\n\ntry {\n const plugin = findPlugin();\n process.env.MICROI_DSH_PLUGIN_ROOT = plugin.root;\n process.env.MICROI_CODEX_PLUGIN_ROOT = plugin.root;\n process.env.MICROI_TOOL_SOURCE = 'dsh';\n process.env.MICROI_TOOL_VERSION = expectedVersion;\n process.env.MICROI_WORKSPACE_ROOT = process.env.MICROI_WORKSPACE_ROOT || process.cwd();\n process.argv[2] = plugin.router;\n require(plugin.adapter);\n} catch (error) {\n console.error(`[microi-dsh-bootstrap] ${error instanceof Error ? error.message : String(error)}`);\n process.exit(1);\n}\n"]
|
|
11
11
|
env:
|
|
12
12
|
MICROI_TOOL_SOURCE: dsh
|
|
13
13
|
cwd: !!js process.cwd()
|
package/package.json
CHANGED