@sciagent/cli 1.0.51 → 1.0.52

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sciagent/cli",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "description": "SciAgent CLI - AI Research Assistant",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  "@sciagent/cli-linux-arm64": "1.0.39",
20
20
  "@sciagent/cli-darwin-x64": "1.0.39",
21
21
  "@sciagent/cli-darwin-arm64": "1.0.39",
22
- "@sciagent/cli-win32-x64": "1.0.51",
22
+ "@sciagent/cli-win32-x64": "1.0.52",
23
23
  "@sciagent/cli-win32-arm64": "1.0.39"
24
24
  },
25
25
  "keywords": [
@@ -27,7 +27,10 @@ const ARCH_MAP = {
27
27
  };
28
28
 
29
29
  // 当前版本号 - 每次发布时同步更新
30
- const CURRENT_VERSION = '1.0.51';
30
+ const CURRENT_VERSION = '1.0.52';
31
+
32
+ // GitHub Releases 回退版本列表(当当前版本的 release 不存在时尝试)
33
+ const GITHUB_FALLBACK_VERSIONS = ['1.0.50', '1.0.48', '1.0.46', '1.0.40', '1.0.38', '1.0.36'];
31
34
 
32
35
  // Releases 服务器配置
33
36
  // 优先使用环境变量,否则使用默认服务器
@@ -590,6 +593,7 @@ function installBinaryPackage(platform, arch) {
590
593
  }
591
594
 
592
595
  async function main() {
596
+ console.log('[postinstall] Starting postinstall script...');
593
597
  const platform = PLATFORM_MAP[process.platform];
594
598
  const arch = ARCH_MAP[process.arch];
595
599
 
@@ -632,7 +636,19 @@ async function main() {
632
636
  // Releases 服务器失败,尝试 GitHub Releases
633
637
  console.log('');
634
638
  console.log(' 尝试从 GitHub Releases 下载...');
635
- const githubSuccess = await downloadFromGitHub(platform, arch, CURRENT_VERSION);
639
+
640
+ // 尝试当前版本
641
+ let githubSuccess = await downloadFromGitHub(platform, arch, CURRENT_VERSION);
642
+
643
+ // 如果当前版本失败,尝试回退版本
644
+ if (!githubSuccess) {
645
+ for (const fallbackVersion of GITHUB_FALLBACK_VERSIONS) {
646
+ if (fallbackVersion === CURRENT_VERSION) continue;
647
+ console.log(` 尝试回退版本 v${fallbackVersion}...`);
648
+ githubSuccess = await downloadFromGitHub(platform, arch, fallbackVersion);
649
+ if (githubSuccess) break;
650
+ }
651
+ }
636
652
 
637
653
  if (!githubSuccess) {
638
654
  // GitHub 也失败,回退到 npm 包安装