@sciagent/cli 1.1.59 → 1.1.61

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/bin/sciagent.js CHANGED
@@ -36,10 +36,15 @@ const JIHULAB_DEPLOY_TOKEN = 'gldt-5kp7mgt4ztyyBMx1Uvn6';
36
36
  const JIHULAB_BASE_URL = `https://jihulab.com/api/v4/projects/${JIHULAB_PROJECT_ID}/packages/generic/sciagent`;
37
37
  const SELF_HOSTED_URL = process.env.RELEASE_SERVER_URL || 'https://px1-jcy.matpool.com:26741?token=BdZ2oxzimV';
38
38
 
39
+ // Parse SELF_HOSTED_URL to separate base URL from query params (e.g. ?token=xxx)
40
+ const _url = new URL(SELF_HOSTED_URL);
41
+ const SELF_HOSTED_BASE = `${_url.protocol}//${_url.host}`;
42
+ const SELF_HOSTED_QUERY = _url.search;
43
+
39
44
  // 下载源列表(按优先级排序)
40
45
  const DOWNLOAD_MIRRORS = [
41
46
  { name: 'JihuLab CDN', getUrl: (platform, arch, version, filename) => `${JIHULAB_BASE_URL}/${version}/${filename}`, auth: 'jihulab' },
42
- { name: 'Self-hosted', getUrl: (platform, arch, version, filename) => `${SELF_HOSTED_URL}/api/releases/download/${platform}/${arch}/${version}`, auth: 'none' },
47
+ { name: 'Self-hosted', getUrl: (platform, arch, version, filename) => `${SELF_HOSTED_BASE}/api/releases/download/${platform}/${arch}/${version}${SELF_HOSTED_QUERY}`, auth: 'none' },
43
48
  ];
44
49
 
45
50
  // 平台和架构映射
@@ -169,7 +174,7 @@ function applyPendingUpdate(installDir) {
169
174
  function fetchLatestVersion() {
170
175
  return new Promise((resolve) => {
171
176
  // 使用自建服务器 /api/releases/list 获取所有版本,取最新的
172
- const url = `${SELF_HOSTED_URL}/api/releases/list`;
177
+ const url = `${SELF_HOSTED_BASE}/api/releases/list${SELF_HOSTED_QUERY}`;
173
178
 
174
179
  const protocol = url.startsWith('https') ? https : http;
175
180
  const request = protocol.get(url, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sciagent/cli",
3
- "version": "1.1.59",
3
+ "version": "1.1.61",
4
4
  "description": "SciAgent CLI - AI Research Assistant",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -41,10 +41,15 @@ const JIHULAB_BASE_URL = `https://jihulab.com/api/v4/projects/${JIHULAB_PROJECT_
41
41
  // 自建服务器配置(备用源)
42
42
  const SELF_HOSTED_URL = process.env.RELEASE_SERVER_URL || 'https://px1-jcy.matpool.com:26741?token=BdZ2oxzimV';
43
43
 
44
+ // Parse SELF_HOSTED_URL to separate base URL from query params (e.g. ?token=xxx)
45
+ const _url = new URL(SELF_HOSTED_URL);
46
+ const SELF_HOSTED_BASE = `${_url.protocol}//${_url.host}`;
47
+ const SELF_HOSTED_QUERY = _url.search;
48
+
44
49
  // 下载源列表(按优先级排序)
45
50
  const DOWNLOAD_MIRRORS = [
46
51
  { name: 'JihuLab CDN', getUrl: (platform, arch, version, filename) => `${JIHULAB_BASE_URL}/${version}/${filename}`, auth: 'jihulab' },
47
- { name: 'Self-hosted', getUrl: (platform, arch, version, filename) => `${SELF_HOSTED_URL}/api/releases/download/${platform}/${arch}/${version}`, auth: 'none' },
52
+ { name: 'Self-hosted', getUrl: (platform, arch, version, filename) => `${SELF_HOSTED_BASE}/api/releases/download/${platform}/${arch}/${version}${SELF_HOSTED_QUERY}`, auth: 'none' },
48
53
  ];
49
54
 
50
55
  // PyPI 镜像源列表(国内优先)