evolcore 0.0.37 → 0.0.38

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/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 0.0.38 (2026-10-24)
9
+
10
+ ### npm 升级稳定性
11
+
12
+ - 修复 npm 升级在 registry 元数据暂未同步时误报目标版本不存在的问题。
13
+ - 改进升级失败诊断,保留 npm 错误码和具体错误信息,便于定位网络、权限和版本解析问题。
14
+
8
15
  ## 0.0.37 (2026-10-24)
9
16
 
10
17
  ### 升级与重启稳定性
@@ -394,20 +394,36 @@ export async function preparePackageCache(target, registry, options = {}) {
394
394
  const run = (args) => new Promise((resolve, reject) => {
395
395
  let failure = null;
396
396
  let output = '';
397
+ let errorOutput = '';
397
398
  const child = execFile(npm.command, [...npm.argsPrefix, ...args, '--registry', registry, ...npmConfigArgs(options.npmConfig), '--ignore-scripts'], {
398
399
  timeout: 180_000, windowsHide: isWindows, signal: options.signal, maxBuffer: 8 * 1024 * 1024,
399
- }, (error, stdout) => { failure = error; output = String(stdout ?? ''); });
400
+ }, (error, stdout, stderr) => {
401
+ failure = error;
402
+ output = String(stdout ?? '');
403
+ errorOutput = String(stderr ?? '');
404
+ });
400
405
  child.once('error', error => { failure = error; });
401
406
  child.once('close', code => {
402
- if (failure || code !== 0 || options.signal?.aborted)
403
- reject(new Error(options.signal?.aborted
404
- ? 'Package cache preparation timed out or was cancelled' : 'npm cache preparation failed; check registry connectivity, credentials, disk space and permissions'));
405
- else
407
+ if (!failure && code === 0 && !options.signal?.aborted) {
406
408
  resolve(output);
409
+ return;
410
+ }
411
+ if (options.signal?.aborted) {
412
+ reject(new Error('Package cache preparation timed out or was cancelled'));
413
+ return;
414
+ }
415
+ const codeText = failure && 'code' in failure && failure.code ? ` (${String(failure.code)})` : '';
416
+ const detail = (errorOutput || failure?.stderr || failure?.message || '')
417
+ .replace(/\s+/g, ' ').trim().slice(0, 500);
418
+ reject(new Error(`npm cache preparation failed${codeText}${detail ? `: ${detail}` : ''}`));
407
419
  });
408
420
  });
409
421
  options.onPhase?.('downloading');
410
- await run(['cache', 'add', spec, '--prefer-offline']);
422
+ // Revalidate registry metadata before resolving the exact version. A stale
423
+ // install-v1 packument can otherwise report ETARGET even when the registry
424
+ // already contains the selected release. The tarball itself remains cached
425
+ // and is reused when npm can do so.
426
+ await run(['cache', 'add', spec, '--prefer-online']);
411
427
  options.onPhase?.('tarball-check');
412
428
  const metadata = JSON.parse(await run(['view', spec, 'name', 'version', 'dist', '--json', '--offline']));
413
429
  const [packed] = JSON.parse(await run(['pack', spec, '--dry-run', '--json', '--offline']));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evolcore",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "description": "AI Agent gateway connecting Claude, Codex, Gemini, and the bundled ecagent runner to messaging channels with multi-project session management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",