@icyfenix-dmla/cli 2026.6.11-1945 → 2026.6.11-2001

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": "@icyfenix-dmla/cli",
3
- "version": "2026.6.11-1945",
3
+ "version": "2026.6.11-2001",
4
4
  "description": "DMLA 沙箱服务命令行工具",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -8,6 +8,16 @@ import path from 'path'
8
8
  import { fileURLToPath } from 'url'
9
9
  import fs from 'fs'
10
10
 
11
+ /**
12
+ * 获取当前包的版本号
13
+ */
14
+ function getCurrentVersion() {
15
+ const __filename = fileURLToPath(import.meta.url)
16
+ const __dirname = path.dirname(__filename)
17
+ const pkgPath = path.resolve(__dirname, '../package.json')
18
+ return JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version
19
+ }
20
+
11
21
  /**
12
22
  * 运行 update 命令
13
23
  */
@@ -15,6 +25,15 @@ export async function runUpdate() {
15
25
  console.log(chalk.blue('更新 DMLA...'))
16
26
  console.log()
17
27
 
28
+ // 在 npm update 之前读取当前版本(更新后旧文件可能被删除导致读取失败)
29
+ let oldVersion
30
+ try {
31
+ oldVersion = getCurrentVersion()
32
+ console.log(chalk.gray(`当前版本: ${oldVersion}`))
33
+ } catch {
34
+ // 读取失败时继续执行更新
35
+ }
36
+
18
37
  try {
19
38
  // 直接执行 npm 更新
20
39
  console.log(chalk.cyan('正在从 npm 更新...'))
@@ -26,12 +45,25 @@ export async function runUpdate() {
26
45
  console.log()
27
46
  console.log(chalk.green('✓ 更新完成'))
28
47
 
29
- // 重新读取版本号(npm update 后 package.json 已更新)
30
- const __filename = fileURLToPath(import.meta.url)
31
- const __dirname = path.dirname(__filename)
32
- const pkgPath = path.resolve(__dirname, '../package.json')
33
- const newVersion = JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version
34
- console.log(chalk.cyan(`当前版本: ${newVersion}`))
48
+ // 尝试读取更新后的版本号
49
+ // npm update 可能删除了当前进程的旧文件,需要用 npm list 获取新版本
50
+ try {
51
+ const newVersion = execSync('npm list -g @icyfenix-dmla/cli --depth=0 --json', {
52
+ encoding: 'utf-8'
53
+ })
54
+ const parsed = JSON.parse(newVersion)
55
+ const version = parsed?.dependencies?.['@icyfenix-dmla/cli']?.version
56
+ if (version) {
57
+ console.log(chalk.cyan(`更新后版本: ${version}`))
58
+ if (oldVersion && version !== oldVersion) {
59
+ console.log(chalk.green(`${oldVersion} → ${version}`))
60
+ } else if (oldVersion && version === oldVersion) {
61
+ console.log(chalk.gray('已是最新版本'))
62
+ }
63
+ }
64
+ } catch {
65
+ // npm list 读取失败时静默跳过,不影响更新结果
66
+ }
35
67
 
36
68
  // 提示用户更新 Docker 镜像(可选)
37
69
  console.log()
@@ -31,7 +31,9 @@ const SOFT_DEPS = [
31
31
  'datasets',
32
32
  'ipywidgets',
33
33
  'accelerate',
34
- 'bitsandbytes'
34
+ 'bitsandbytes',
35
+ 'flash-linear-attention',
36
+ 'causal-conv1d'
35
37
  ]
36
38
 
37
39
  // 环境检测结果缓存
package/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "buildTime": "2026-06-11T11:46:24.774Z",
3
- "cliVersion": "2026.6.11-1945"
2
+ "buildTime": "2026-06-11T12:02:46.693Z",
3
+ "cliVersion": "2026.6.11-2001"
4
4
  }