@microi.net/cli 5.9.4 → 5.9.6
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 +1 -1
- package/.mcp.json +1 -1
- package/.workbuddy-plugin/marketplace.json +2 -2
- package/.workbuddy-plugin/plugin.json +1 -1
- package/LICENSE +21 -21
- package/README.md +71 -71
- package/assets/build-meta.json +7 -7
- package/assets/feature-matrix.json +138 -138
- package/assets/logo.svg +4 -4
- package/cordis.patch.yml +1 -1
- package/package.json +1 -1
- package/scripts/codex-marketplace.json +20 -20
- package/scripts/mcp-codex-stdio-adapter.js +189 -189
- package/scripts/mcp-server.js +1 -0
- package/scripts/mcp-trae-windows-launcher.cmd +21 -21
- package/scripts/microi-cli-mcp.js +7 -7
- package/scripts/microi-cli.js +44 -49
- package/scripts/microi-codex-broker.js +466 -466
- package/scripts/microi-codex-router.js +635 -634
- package/scripts/microi-skills.meta.json +248 -248
- package/skills/.microi-skills-version.json +2 -2
- package/skills/.progressive-disclosure-manifest.json +55 -46
- package/skills/ai-engine/agents/openai.yaml +4 -4
- package/skills/app-store/agents/openai.yaml +4 -4
- package/skills/datasource-engine/agents/openai.yaml +4 -4
- package/skills/job-engine/agents/openai.yaml +4 -4
- package/skills/message-notification/agents/openai.yaml +5 -5
- package/skills/microi-ai-app-auth.js +652 -652
- package/skills/microi-ai-application/agents/openai.yaml +4 -4
- package/skills/microi-codex/SKILL.md +11 -6
- package/skills/microi-codex-installer/SKILL.md +1 -1
- package/skills/microi-codex-installer/agents/openai.yaml +7 -7
- package/skills/microi-db-schema/agents/openai.yaml +4 -4
- package/skills/microi-deployment/SKILL.md +6 -4
- package/skills/microi-docs-coverage/references/capability-map.md +1 -1
- package/skills/microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs +894 -894
- package/skills/microi-microservice/SKILL.md +5 -0
- package/skills/microi-solution-quotation/agents/openai.yaml +4 -4
- package/skills/microi-solution-quotation/scripts/build_solution_quote.py +296 -296
- package/skills/microi-system-delivery/SKILL.md +18 -6
- package/skills/microi-system-delivery/references/progressive-01-/346/240/207/345/207/206/345/267/245/344/275/234/346/265/201.md +39 -1
- package/skills/microi-system-delivery/references/progressive-02-/350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/345/277/205/351/241/273/350/246/206/347/233/226/347/232/204/345/235/221.md +5 -3
- package/skills/microi-uniapp-frontend/SKILL.md +3 -1
- package/skills/microi.v8.js +1921 -1921
- package/skills/module-engine/SKILL.md +26 -0
- package/skills/ocr-engine/agents/openai.yaml +4 -4
- package/skills/page-engine/SKILL.md +21 -0
- package/skills/page-engine/examples/compact-dashboard.json +1444 -1444
- package/skills/playwright-e2e/SKILL.md +5 -4
- package/skills/playwright-e2e/references/progressive-03-microi-helper-/346/250/241/346/235/277.md +3 -3
- package/skills/report-engine/SKILL.md +12 -0
- package/skills/report-engine/agents/openai.yaml +4 -4
- package/skills/scripts/optimize-progressive-disclosure.mjs +204 -204
- package/skills/scripts/refresh-progressive-disclosure.mjs +64 -64
- package/skills/scripts/sync-embedded-skills.mjs +46 -46
- package/skills/scripts/validate-progressive-disclosure.mjs +57 -57
- package/skills/search-engine/agents/openai.yaml +4 -4
- package/skills/translate-engine/agents/openai.yaml +4 -4
- package/skills/ui-design/assets/pattern-showcase/app.js +54 -54
- package/skills/ui-design/assets/pattern-showcase/index.html +163 -163
- package/skills/ui-design/assets/pattern-showcase/styles.css +311 -311
- package/skills/unity-integration/agents/openai.yaml +4 -4
- package/skills/v8-file-upload/SKILL.md +2 -0
- package/skills/v8-image-processing/agents/openai.yaml +4 -4
- package/skills/v8-mongodb/SKILL.md +2 -1
- package/skills/v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs +203 -203
- package/skills/v8-security/SKILL.md +6 -0
- package/skills/v8-tcp-integration/agents/openai.yaml +4 -4
- package/skills/vision-engine/agents/openai.yaml +4 -4
- package/skills/workspace-conventions/SKILL.md +5 -4
- 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 +13 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "microi-net",
|
|
3
|
-
"interface": {
|
|
4
|
-
"displayName": "Microi.Net"
|
|
5
|
-
},
|
|
6
|
-
"plugins": [
|
|
7
|
-
{
|
|
8
|
-
"name": "microi",
|
|
9
|
-
"source": {
|
|
10
|
-
"source": "local",
|
|
11
|
-
"path": "./plugins/microi"
|
|
12
|
-
},
|
|
13
|
-
"policy": {
|
|
14
|
-
"installation": "AVAILABLE",
|
|
15
|
-
"authentication": "ON_USE"
|
|
16
|
-
},
|
|
17
|
-
"category": "developer-tools"
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "microi-net",
|
|
3
|
+
"interface": {
|
|
4
|
+
"displayName": "Microi.Net"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "microi",
|
|
9
|
+
"source": {
|
|
10
|
+
"source": "local",
|
|
11
|
+
"path": "./plugins/microi"
|
|
12
|
+
},
|
|
13
|
+
"policy": {
|
|
14
|
+
"installation": "AVAILABLE",
|
|
15
|
+
"authentication": "ON_USE"
|
|
16
|
+
},
|
|
17
|
+
"category": "developer-tools"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -1,189 +1,189 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/*
|
|
3
|
-
* Codex MCP stdio adapter for the bundled Microi MCP server.
|
|
4
|
-
*
|
|
5
|
-
* The MCP SDK version used by Microi currently speaks newline-delimited
|
|
6
|
-
* JSON-RPC over stdio. Some Codex runtimes send and expect Content-Length
|
|
7
|
-
* framed JSON-RPC. This adapter bridges both formats without changing the
|
|
8
|
-
* normal VS Code/Cursor/Trae/Claude MCP configuration.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const childProcess = require('node:child_process');
|
|
12
|
-
const path = require('node:path');
|
|
13
|
-
|
|
14
|
-
const target = process.argv[2];
|
|
15
|
-
if (!target) {
|
|
16
|
-
console.error('[microi-mcp-adapter] Missing target MCP server path.');
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const child = childProcess.spawn(process.execPath, [target, ...process.argv.slice(3)], {
|
|
21
|
-
cwd: process.cwd(),
|
|
22
|
-
env: process.env,
|
|
23
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
24
|
-
windowsHide: true,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
let inputBuffer = Buffer.alloc(0);
|
|
28
|
-
let outputBuffer = Buffer.alloc(0);
|
|
29
|
-
let clientFraming = null; // 'content-length' | 'line'
|
|
30
|
-
let shutdownRequested = false;
|
|
31
|
-
let requestedExitCode = 0;
|
|
32
|
-
let forceExitTimer = null;
|
|
33
|
-
|
|
34
|
-
function stopChildAndExit(exitCode = 0) {
|
|
35
|
-
if (shutdownRequested) return;
|
|
36
|
-
shutdownRequested = true;
|
|
37
|
-
requestedExitCode = exitCode;
|
|
38
|
-
|
|
39
|
-
if (!child.stdin.destroyed) {
|
|
40
|
-
child.stdin.end();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (child.exitCode !== null) {
|
|
44
|
-
process.exit(requestedExitCode);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
child.kill('SIGTERM');
|
|
49
|
-
} catch {
|
|
50
|
-
process.exit(requestedExitCode);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
forceExitTimer = setTimeout(() => {
|
|
54
|
-
try {
|
|
55
|
-
child.kill('SIGKILL');
|
|
56
|
-
} catch {
|
|
57
|
-
// 子进程可能已在超时边界退出。
|
|
58
|
-
}
|
|
59
|
-
process.exit(requestedExitCode);
|
|
60
|
-
}, 2000);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Codex 会为每个 MCP 连接启动一个适配器。客户端退出、重载或异常断开时,
|
|
64
|
-
// 必须同步终止其子 MCP 服务,否则孤儿进程会持续累积并挤占前端构建内存。
|
|
65
|
-
process.stdin.on('end', () => stopChildAndExit(0));
|
|
66
|
-
process.stdin.on('error', () => stopChildAndExit(1));
|
|
67
|
-
process.stdout.on('error', error => {
|
|
68
|
-
stopChildAndExit(error && error.code === 'EPIPE' ? 0 : 1);
|
|
69
|
-
});
|
|
70
|
-
process.on('disconnect', () => stopChildAndExit(0));
|
|
71
|
-
for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
|
|
72
|
-
process.on(signal, () => stopChildAndExit(0));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const parentPid = process.ppid;
|
|
76
|
-
if (parentPid > 1) {
|
|
77
|
-
const parentWatchTimer = setInterval(() => {
|
|
78
|
-
try {
|
|
79
|
-
process.kill(parentPid, 0);
|
|
80
|
-
} catch (error) {
|
|
81
|
-
if (error && error.code === 'ESRCH') {
|
|
82
|
-
stopChildAndExit(0);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}, 5000);
|
|
86
|
-
parentWatchTimer.unref();
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
process.on('exit', () => {
|
|
90
|
-
if (child.exitCode === null) {
|
|
91
|
-
try {
|
|
92
|
-
child.kill('SIGKILL');
|
|
93
|
-
} catch {
|
|
94
|
-
// 退出阶段只做尽力清理。
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
function writeLineToChild(jsonText) {
|
|
100
|
-
if (!child.stdin.destroyed) {
|
|
101
|
-
child.stdin.write(jsonText.trimEnd() + '\n');
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function writeToClient(jsonText) {
|
|
106
|
-
const text = jsonText.trim();
|
|
107
|
-
if (!text) return;
|
|
108
|
-
|
|
109
|
-
if (clientFraming === 'line') {
|
|
110
|
-
process.stdout.write(text + '\n');
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const bytes = Buffer.byteLength(text, 'utf8');
|
|
115
|
-
process.stdout.write(`Content-Length: ${bytes}\r\n\r\n${text}`);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function processInputBuffer() {
|
|
119
|
-
while (inputBuffer.length > 0) {
|
|
120
|
-
const asText = inputBuffer.toString('utf8');
|
|
121
|
-
|
|
122
|
-
if (/^Content-Length:/i.test(asText)) {
|
|
123
|
-
clientFraming = 'content-length';
|
|
124
|
-
const headerEnd = asText.indexOf('\r\n\r\n');
|
|
125
|
-
if (headerEnd < 0) return;
|
|
126
|
-
|
|
127
|
-
const header = asText.slice(0, headerEnd);
|
|
128
|
-
const match = header.match(/Content-Length:\s*(\d+)/i);
|
|
129
|
-
if (!match) {
|
|
130
|
-
console.error('[microi-mcp-adapter] Invalid Content-Length header.');
|
|
131
|
-
stopChildAndExit(1);
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const length = Number(match[1]);
|
|
136
|
-
const bodyStart = Buffer.byteLength(asText.slice(0, headerEnd + 4), 'utf8');
|
|
137
|
-
if (inputBuffer.length < bodyStart + length) return;
|
|
138
|
-
|
|
139
|
-
const body = inputBuffer.slice(bodyStart, bodyStart + length).toString('utf8');
|
|
140
|
-
writeLineToChild(body);
|
|
141
|
-
inputBuffer = inputBuffer.slice(bodyStart + length);
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
clientFraming = clientFraming || 'line';
|
|
146
|
-
const newline = inputBuffer.indexOf(0x0a);
|
|
147
|
-
if (newline < 0) return;
|
|
148
|
-
|
|
149
|
-
const line = inputBuffer.slice(0, newline + 1).toString('utf8').trim();
|
|
150
|
-
inputBuffer = inputBuffer.slice(newline + 1);
|
|
151
|
-
if (line) {
|
|
152
|
-
writeLineToChild(line);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
process.stdin.on('data', chunk => {
|
|
158
|
-
inputBuffer = Buffer.concat([inputBuffer, chunk]);
|
|
159
|
-
processInputBuffer();
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
child.stdout.on('data', chunk => {
|
|
163
|
-
outputBuffer = Buffer.concat([outputBuffer, chunk]);
|
|
164
|
-
let newlineIndex;
|
|
165
|
-
while ((newlineIndex = outputBuffer.indexOf(0x0a)) >= 0) {
|
|
166
|
-
const line = outputBuffer.slice(0, newlineIndex).toString('utf8').trim();
|
|
167
|
-
outputBuffer = outputBuffer.slice(newlineIndex + 1);
|
|
168
|
-
if (line) writeToClient(line);
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
child.stderr.on('data', chunk => {
|
|
173
|
-
process.stderr.write(chunk);
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
child.on('exit', code => {
|
|
177
|
-
if (forceExitTimer) {
|
|
178
|
-
clearTimeout(forceExitTimer);
|
|
179
|
-
}
|
|
180
|
-
if (outputBuffer.length > 0) {
|
|
181
|
-
writeToClient(outputBuffer.toString('utf8'));
|
|
182
|
-
}
|
|
183
|
-
process.exit(shutdownRequested ? requestedExitCode : (code || 0));
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
child.on('error', err => {
|
|
187
|
-
console.error(`[microi-mcp-adapter] Failed to start ${path.basename(target)}: ${err.message}`);
|
|
188
|
-
stopChildAndExit(1);
|
|
189
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* Codex MCP stdio adapter for the bundled Microi MCP server.
|
|
4
|
+
*
|
|
5
|
+
* The MCP SDK version used by Microi currently speaks newline-delimited
|
|
6
|
+
* JSON-RPC over stdio. Some Codex runtimes send and expect Content-Length
|
|
7
|
+
* framed JSON-RPC. This adapter bridges both formats without changing the
|
|
8
|
+
* normal VS Code/Cursor/Trae/Claude MCP configuration.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const childProcess = require('node:child_process');
|
|
12
|
+
const path = require('node:path');
|
|
13
|
+
|
|
14
|
+
const target = process.argv[2];
|
|
15
|
+
if (!target) {
|
|
16
|
+
console.error('[microi-mcp-adapter] Missing target MCP server path.');
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const child = childProcess.spawn(process.execPath, [target, ...process.argv.slice(3)], {
|
|
21
|
+
cwd: process.cwd(),
|
|
22
|
+
env: process.env,
|
|
23
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
24
|
+
windowsHide: true,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
let inputBuffer = Buffer.alloc(0);
|
|
28
|
+
let outputBuffer = Buffer.alloc(0);
|
|
29
|
+
let clientFraming = null; // 'content-length' | 'line'
|
|
30
|
+
let shutdownRequested = false;
|
|
31
|
+
let requestedExitCode = 0;
|
|
32
|
+
let forceExitTimer = null;
|
|
33
|
+
|
|
34
|
+
function stopChildAndExit(exitCode = 0) {
|
|
35
|
+
if (shutdownRequested) return;
|
|
36
|
+
shutdownRequested = true;
|
|
37
|
+
requestedExitCode = exitCode;
|
|
38
|
+
|
|
39
|
+
if (!child.stdin.destroyed) {
|
|
40
|
+
child.stdin.end();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (child.exitCode !== null) {
|
|
44
|
+
process.exit(requestedExitCode);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
child.kill('SIGTERM');
|
|
49
|
+
} catch {
|
|
50
|
+
process.exit(requestedExitCode);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
forceExitTimer = setTimeout(() => {
|
|
54
|
+
try {
|
|
55
|
+
child.kill('SIGKILL');
|
|
56
|
+
} catch {
|
|
57
|
+
// 子进程可能已在超时边界退出。
|
|
58
|
+
}
|
|
59
|
+
process.exit(requestedExitCode);
|
|
60
|
+
}, 2000);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Codex 会为每个 MCP 连接启动一个适配器。客户端退出、重载或异常断开时,
|
|
64
|
+
// 必须同步终止其子 MCP 服务,否则孤儿进程会持续累积并挤占前端构建内存。
|
|
65
|
+
process.stdin.on('end', () => stopChildAndExit(0));
|
|
66
|
+
process.stdin.on('error', () => stopChildAndExit(1));
|
|
67
|
+
process.stdout.on('error', error => {
|
|
68
|
+
stopChildAndExit(error && error.code === 'EPIPE' ? 0 : 1);
|
|
69
|
+
});
|
|
70
|
+
process.on('disconnect', () => stopChildAndExit(0));
|
|
71
|
+
for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
|
|
72
|
+
process.on(signal, () => stopChildAndExit(0));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const parentPid = process.ppid;
|
|
76
|
+
if (parentPid > 1) {
|
|
77
|
+
const parentWatchTimer = setInterval(() => {
|
|
78
|
+
try {
|
|
79
|
+
process.kill(parentPid, 0);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
if (error && error.code === 'ESRCH') {
|
|
82
|
+
stopChildAndExit(0);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, 5000);
|
|
86
|
+
parentWatchTimer.unref();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
process.on('exit', () => {
|
|
90
|
+
if (child.exitCode === null) {
|
|
91
|
+
try {
|
|
92
|
+
child.kill('SIGKILL');
|
|
93
|
+
} catch {
|
|
94
|
+
// 退出阶段只做尽力清理。
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
function writeLineToChild(jsonText) {
|
|
100
|
+
if (!child.stdin.destroyed) {
|
|
101
|
+
child.stdin.write(jsonText.trimEnd() + '\n');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function writeToClient(jsonText) {
|
|
106
|
+
const text = jsonText.trim();
|
|
107
|
+
if (!text) return;
|
|
108
|
+
|
|
109
|
+
if (clientFraming === 'line') {
|
|
110
|
+
process.stdout.write(text + '\n');
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const bytes = Buffer.byteLength(text, 'utf8');
|
|
115
|
+
process.stdout.write(`Content-Length: ${bytes}\r\n\r\n${text}`);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function processInputBuffer() {
|
|
119
|
+
while (inputBuffer.length > 0) {
|
|
120
|
+
const asText = inputBuffer.toString('utf8');
|
|
121
|
+
|
|
122
|
+
if (/^Content-Length:/i.test(asText)) {
|
|
123
|
+
clientFraming = 'content-length';
|
|
124
|
+
const headerEnd = asText.indexOf('\r\n\r\n');
|
|
125
|
+
if (headerEnd < 0) return;
|
|
126
|
+
|
|
127
|
+
const header = asText.slice(0, headerEnd);
|
|
128
|
+
const match = header.match(/Content-Length:\s*(\d+)/i);
|
|
129
|
+
if (!match) {
|
|
130
|
+
console.error('[microi-mcp-adapter] Invalid Content-Length header.');
|
|
131
|
+
stopChildAndExit(1);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const length = Number(match[1]);
|
|
136
|
+
const bodyStart = Buffer.byteLength(asText.slice(0, headerEnd + 4), 'utf8');
|
|
137
|
+
if (inputBuffer.length < bodyStart + length) return;
|
|
138
|
+
|
|
139
|
+
const body = inputBuffer.slice(bodyStart, bodyStart + length).toString('utf8');
|
|
140
|
+
writeLineToChild(body);
|
|
141
|
+
inputBuffer = inputBuffer.slice(bodyStart + length);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
clientFraming = clientFraming || 'line';
|
|
146
|
+
const newline = inputBuffer.indexOf(0x0a);
|
|
147
|
+
if (newline < 0) return;
|
|
148
|
+
|
|
149
|
+
const line = inputBuffer.slice(0, newline + 1).toString('utf8').trim();
|
|
150
|
+
inputBuffer = inputBuffer.slice(newline + 1);
|
|
151
|
+
if (line) {
|
|
152
|
+
writeLineToChild(line);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
process.stdin.on('data', chunk => {
|
|
158
|
+
inputBuffer = Buffer.concat([inputBuffer, chunk]);
|
|
159
|
+
processInputBuffer();
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
child.stdout.on('data', chunk => {
|
|
163
|
+
outputBuffer = Buffer.concat([outputBuffer, chunk]);
|
|
164
|
+
let newlineIndex;
|
|
165
|
+
while ((newlineIndex = outputBuffer.indexOf(0x0a)) >= 0) {
|
|
166
|
+
const line = outputBuffer.slice(0, newlineIndex).toString('utf8').trim();
|
|
167
|
+
outputBuffer = outputBuffer.slice(newlineIndex + 1);
|
|
168
|
+
if (line) writeToClient(line);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
child.stderr.on('data', chunk => {
|
|
173
|
+
process.stderr.write(chunk);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
child.on('exit', code => {
|
|
177
|
+
if (forceExitTimer) {
|
|
178
|
+
clearTimeout(forceExitTimer);
|
|
179
|
+
}
|
|
180
|
+
if (outputBuffer.length > 0) {
|
|
181
|
+
writeToClient(outputBuffer.toString('utf8'));
|
|
182
|
+
}
|
|
183
|
+
process.exit(shutdownRequested ? requestedExitCode : (code || 0));
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
child.on('error', err => {
|
|
187
|
+
console.error(`[microi-mcp-adapter] Failed to start ${path.basename(target)}: ${err.message}`);
|
|
188
|
+
stopChildAndExit(1);
|
|
189
|
+
});
|
package/scripts/mcp-server.js
CHANGED
|
@@ -261,6 +261,7 @@ ${e}`).digest("hex").slice(0,46)}`}function Dte(t,e){if(t.Code!==1)throw new Err
|
|
|
261
261
|
|
|
262
262
|
## Microi\u543E\u7801\u57FA\u7840\u89C4\u8303\uFF08\u4EFB\u4F55 AI \u6A21\u578B\u5F3A\u5236\u8BFB\u53D6\uFF09
|
|
263
263
|
\u6BCF\u6B21\u65B0\u5EFA\u6216\u63A5\u7EED\u543E\u7801\u4EFB\u52A1\uFF0C\u5FC5\u987B\u5148\u5B8C\u6574\u8BFB\u53D6\u5DE5\u4F5C\u533A microi.skills/workspace-conventions/SKILL.md\uFF1B\u672A\u521D\u59CB\u5316\u65F6\u8BFB\u53D6\u5DF2\u5B89\u88C5\u543E\u7801\u63D2\u4EF6\u4E2D\u7684 skills/workspace-conventions/SKILL.md\u3002\u8FDB\u5EA6\u64AD\u62A5\u548C\u975E\u963B\u585E\u81EA\u52A8\u66F4\u65B0\u90FD\u662F\u65E0\u6761\u4EF6\u57FA\u7840\u89C4\u5219\uFF0C\u4E0D\u80FD\u7B49\u7528\u6237\u63D0\u9192\u3002
|
|
264
|
+
\u968F\u540E\u9ED8\u8BA4\u5B8C\u6574\u8BFB\u53D6 microi.skills/microi-system-delivery/SKILL.md\u3001microi.skills/microi-system-delivery/references/progressive-01-\u6807\u51C6\u5DE5\u4F5C\u6D41.md \u4E2D\u7684\u539F 1\u20138 \u53CA\u540E\u7EED\u589E\u8865\uFF0C\u518D\u6309\u603B\u63A7\u8BFB\u53D6\u76F8\u5173\u4E13\u9879 Skills\uFF1B\u7528\u6237\u65E0\u9700\u6307\u5B9A Skill \u540D\u79F0\u3002\u5B9E\u73B0\u524D\u5148\u62A5\u544A\u5DF2\u8BFB\u53D6\u7684\u6587\u4EF6\u8DEF\u5F84\u53CA\u672C\u6B21\u9002\u7528\u7684\u4EA4\u4ED8\u6E05\u5355\uFF0C\u6309\u5B8C\u6574\u5F00\u53D1\u3001\u5C40\u90E8\u4FEE\u6539\u3001\u53EA\u8BFB\u5206\u6790\u7684\u5B9E\u9645\u8303\u56F4\u6267\u884C\uFF0C\u4E0D\u989D\u5916\u6388\u6743\u751F\u4EA7\u5199\u5165\u6216\u5BA2\u6237\u90E8\u7F72\u3002\u6587\u4EF6\u7F3A\u5931\u65F6\u6309\u5B89\u88C5\u89C4\u8303\u6267\u884C microi ai init --workspace "<\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84>" \u6062\u590D\uFF1B\u5BBF\u4E3B\u65E0\u672C\u5730\u6587\u4EF6/\u7EC8\u7AEF\u80FD\u529B\u6216\u672A\u53D6\u5F97\u5B8C\u6574\u6B63\u6587\u65F6\u4E0D\u80FD\u58F0\u79F0\u5DF2\u81EA\u52A8\u52A0\u8F7D\uFF0C\u4E5F\u4E0D\u80FD\u628A\u4EC5\u8FDE\u901A MCP \u7B49\u540C\u4E8E\u5DF2\u8BFB\u53D6\u4EA4\u4ED8\u89C4\u5219\u3002
|
|
264
265
|
\u9996\u6B21\u5DE5\u4F5C\u8BF4\u660E\u4EE5\u201CMicroi\u543E\u7801\u5F00\u53D1\u5DE5\u5177\u7248\u672C\u201D\u62A5\u544A\u5B9E\u9645 CLI \u7248\u672C\u3001npm \u5B98\u65B9 latest\uFF08\u9644\u67E5\u8BE2\u65F6\u95F4\uFF09\u3001\u81EA\u52A8\u66F4\u65B0\u4E0E Skills/MCP \u540C\u6B65\u72B6\u6001\uFF1B\u7528 microi version --json \u56DE\u8BFB CLI\uFF0C\u7528 npm \u5B98\u65B9 registry \u67E5\u8BE2 latest\u3002\u672A\u77E5\u9879\u5199\u68C0\u6D4B\u4E2D\uFF0C\u4E0D\u5F97\u628A\u672C MCP \u534F\u8BAE\u7248\u672C\u6216 expectedVersion \u5F53\u6210 CLI/npm \u6700\u65B0\u7248\u3002
|
|
265
266
|
\u5DF2\u6709 CLI \u65F6\u5FC5\u987B\u6295\u9012 microi update --background --workspace "<\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84>" --json\uFF0C\u81EA\u52A8\u5347\u7EA7 @microi.net/cli \u5E76\u540C\u6B65 Skills\u3001AI \u89C4\u5219\u548C MCP\u3002\u66F4\u65B0\u5931\u8D25\u5EF6\u540E\u91CD\u8BD5\u5E76\u51C6\u786E\u62A5\u544A\uFF0C\u4E0D\u963B\u65AD\u5F53\u524D\u5DE5\u4F5C\u3001\u4E0D\u5F3A\u5236\u91CD\u8F7D\u3001\u4E0D\u7EC8\u6B62\u6B63\u5728\u8FD0\u884C\u7684 MCP\uFF1B\u7528\u6237\u660E\u786E\u5173\u95ED\u6216\u5BBF\u4E3B\u65E0\u6267\u884C\u6743\u9650\u65F6\u62A5\u544A\u9650\u5236\uFF0C\u7B7E\u540D\u684C\u9762\u5B89\u88C5\u76EE\u5F55\u901A\u8FC7\u684C\u9762\u5B98\u65B9\u6E20\u9053\u66F4\u65B0\u3002\u5B8C\u6574\u6267\u884C\u53CA\u9A8C\u6536\u89C4\u5219\u4EE5\u57FA\u7840\u5165\u53E3\u4E3A\u51C6\u3002
|
|
266
267
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
setlocal
|
|
3
|
-
|
|
4
|
-
if "%~1"=="" (
|
|
5
|
-
>&2 echo [microi-trae-mcp] Missing Node or Electron runtime path.
|
|
6
|
-
exit /b 2
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
if "%~2"=="" (
|
|
10
|
-
>&2 echo [microi-trae-mcp] Missing MCP adapter path.
|
|
11
|
-
exit /b 2
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
if "%~3"=="" (
|
|
15
|
-
>&2 echo [microi-trae-mcp] Missing MCP server path.
|
|
16
|
-
exit /b 2
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
call "%~1" "%~2" "%~3"
|
|
20
|
-
set "MICROI_MCP_EXIT_CODE=%ERRORLEVEL%"
|
|
21
|
-
endlocal & exit /b %MICROI_MCP_EXIT_CODE%
|
|
1
|
+
@echo off
|
|
2
|
+
setlocal
|
|
3
|
+
|
|
4
|
+
if "%~1"=="" (
|
|
5
|
+
>&2 echo [microi-trae-mcp] Missing Node or Electron runtime path.
|
|
6
|
+
exit /b 2
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
if "%~2"=="" (
|
|
10
|
+
>&2 echo [microi-trae-mcp] Missing MCP adapter path.
|
|
11
|
+
exit /b 2
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
if "%~3"=="" (
|
|
15
|
+
>&2 echo [microi-trae-mcp] Missing MCP server path.
|
|
16
|
+
exit /b 2
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
call "%~1" "%~2" "%~3"
|
|
20
|
+
set "MICROI_MCP_EXIT_CODE=%ERRORLEVEL%"
|
|
21
|
+
endlocal & exit /b %MICROI_MCP_EXIT_CODE%
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
// Keep the configured entry name stable and independent from mcp-server.js.
|
|
5
|
-
// Historical VS Code extensions scanned arguments containing that basename
|
|
6
|
-
// and rewrote them to their own extension directory during activation.
|
|
7
|
-
require('./mcp-server.js');
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Keep the configured entry name stable and independent from mcp-server.js.
|
|
5
|
+
// Historical VS Code extensions scanned arguments containing that basename
|
|
6
|
+
// and rewrote them to their own extension directory during activation.
|
|
7
|
+
require('./mcp-server.js');
|