shizai-agent-mcp 0.5.3 → 0.5.4

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 CHANGED
@@ -24,7 +24,7 @@ npx -y shizai-agent-mcp@latest path
24
24
  npx -y shizai-agent-mcp@latest uninstall
25
25
  ```
26
26
 
27
- 当前 npm launcher 版本为 `0.5.3`,默认下载最新的 `v0.7.27` Windows x64 资产:
27
+ 当前 npm launcher 版本为 `0.5.4`,默认下载最新的 `v0.7.27` Windows x64 资产:
28
28
  `shizai-agent-v0.7.27-windows-x64.zip`。npm 包不附带浏览器自动化依赖,也不要求用户安装额外扩展。
29
29
 
30
30
  `install` 覆盖文件后会自动注册 Codex MCP;需要跳过配置写入时使用
@@ -112,10 +112,22 @@ function verifySha256(file, expected) {
112
112
  const actual = crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex').toLowerCase();
113
113
  if (actual !== expected.toLowerCase()) throw new Error(`SHA256 校验失败:期望 ${expected},实际 ${actual}`);
114
114
  }
115
- function download(url, destination) {
116
- const script = `Invoke-WebRequest -UseBasicParsing -Uri ${psQuote(url)} -OutFile ${psQuote(destination)}`;
117
- runPowerShell(script);
118
- }
115
+ function download(url, destination, options = {}) {
116
+ const progress = options.progress !== false;
117
+ const curl = process.env.SHIZAI_AGENT_CURL || 'curl.exe';
118
+ const args = ['--fail', '--location', '--silent', '--show-error'];
119
+ if (progress) args.push('--progress-bar');
120
+ args.push('--output', destination, url);
121
+ try {
122
+ execFileSync(curl, args, { stdio: ['ignore', 'ignore', 'inherit'] });
123
+ if (progress) process.stderr.write('\n');
124
+ return;
125
+ } catch (error) {
126
+ if (error?.code !== 'ENOENT') throw error;
127
+ }
128
+ const script = `Invoke-WebRequest -UseBasicParsing -Uri ${psQuote(url)} -OutFile ${psQuote(destination)} -ProgressAction SilentlyContinue`;
129
+ runPowerShell(script);
130
+ }
119
131
  function install(version, options = {}) {
120
132
  const destination = validateInstallRoot();
121
133
  const asset = assetName(version);
@@ -130,10 +142,9 @@ function install(version, options = {}) {
130
142
  let verified = false;
131
143
  const stoppedProcesses = new Set();
132
144
  try {
133
- console.log(`下载 ${url}`);
134
- download(url, archive);
135
- try {
136
- download(`${url}.sha256`, checksum);
145
+ download(url, archive, { progress: true });
146
+ try {
147
+ download(`${url}.sha256`, checksum, { progress: false });
137
148
  const text = fs.readFileSync(checksum, 'utf8');
138
149
  const expected = (text.match(/[a-f0-9]{64}/i) || [])[0];
139
150
  if (!expected) throw new Error('校验文件中没有 SHA-256');
@@ -191,8 +202,9 @@ function install(version, options = {}) {
191
202
  cleanupInstallArtifacts(parent, [stage, backup]);
192
203
  const result = { installed: true, version, directory: destination, command: binaryPath(), verified, stopped_processes: [...stoppedProcesses].sort((left, right) => left - right) };
193
204
  if (!options.skipRegister) result.registration = registerCodex(true);
194
- json(result);
195
- return result;
205
+ console.log(`安装成功:Shizai Agent MCP v${version}`);
206
+ if (result.registration?.registered) console.log('Codex MCP 已注册');
207
+ return result;
196
208
  } finally {
197
209
  removeDirectoryWithRetries(temp);
198
210
  removeDirectoryWithRetries(stage);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shizai-agent-mcp",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Installer and launcher for the Shizai Agent local MCP server",
5
5
  "bin": {
6
6
  "shizai-agent-mcp": "bin/shizai-agent-mcp.js"