shizai-agent-mcp 0.2.8 → 0.2.9
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 +1 -1
- package/bin/shizai-agent-mcp.js +16 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npx -y shizai-agent-mcp path
|
|
|
24
24
|
npx -y shizai-agent-mcp uninstall
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
当前 npm launcher 版本为 `0.2.
|
|
27
|
+
当前 npm launcher 版本为 `0.2.9`,默认下载最新的 `v0.6.7` Windows x64 资产:
|
|
28
28
|
`shizai-agent-v0.6.7-windows-x64.zip`。npm 包不附带浏览器自动化依赖,也不要求用户安装额外扩展。
|
|
29
29
|
|
|
30
30
|
`install` 覆盖文件后会自动注册 Codex MCP;需要跳过配置写入时使用
|
package/bin/shizai-agent-mcp.js
CHANGED
|
@@ -199,12 +199,22 @@ function install(version, options = {}) {
|
|
|
199
199
|
if (fs.existsSync(backup) && fs.existsSync(destination)) removeDirectoryWithRetries(backup);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
function replaceTomlSection(content, section, replacement) {
|
|
203
|
-
const
|
|
204
|
-
const
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
202
|
+
function replaceTomlSection(content, section, replacement) {
|
|
203
|
+
const header = `[${section}]`;
|
|
204
|
+
const lines = String(content || '').split(/\r?\n/);
|
|
205
|
+
const kept = [];
|
|
206
|
+
let skipping = false;
|
|
207
|
+
for (const line of lines) {
|
|
208
|
+
if (line.trim() === header) {
|
|
209
|
+
skipping = true;
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
if (skipping && /^\s*\[.*\]\s*$/.test(line)) skipping = false;
|
|
213
|
+
if (!skipping) kept.push(line);
|
|
214
|
+
}
|
|
215
|
+
const next = kept.join('\n').trimEnd();
|
|
216
|
+
return `${next}${next ? '\r\n\r\n' : ''}${replacement.trim()}\r\n`;
|
|
217
|
+
}
|
|
208
218
|
function tomlString(value) { return JSON.stringify(String(value)); }
|
|
209
219
|
function registerCodex(silent = false) {
|
|
210
220
|
const config = process.env.SHIZAI_CODEX_CONFIG || path.join(os.homedir(), '.codex', 'config.toml');
|