@icyfenix-dmla/cli 2026.5.13-1007 → 2026.5.13-2308

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.5.13-1007",
3
+ "version": "2026.5.13-2308",
4
4
  "description": "DMLA 沙箱服务命令行工具",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -66,7 +66,7 @@ const DATASETS = [
66
66
  id: 'chinese-poetry',
67
67
  name: 'Chinese Poetry (古诗词)',
68
68
  url: 'https://www.modelscope.cn/datasets/icyfenix/Chinese-Poetry.git',
69
- size: '~50MB',
69
+ size: '~380MB',
70
70
  format: 'git',
71
71
  targetDir: 'datasets/chinese-poetry',
72
72
  source: 'ModelScope (icyfenix)'
@@ -851,7 +851,66 @@ async function downloadDataset(dataPath, dataset) {
851
851
  } catch (error) {
852
852
  console.log()
853
853
  console.log(chalk.red(`下载失败: ${error.message}`))
854
- console.log(chalk.yellow('您可以稍后重试'))
854
+
855
+ // 检查是否有不完整的数据残留
856
+ const hasIncompleteData = fs.existsSync(targetDir)
857
+
858
+ if (hasIncompleteData) {
859
+ console.log(chalk.yellow(`目录 ${targetDir} 存在不完整数据`))
860
+ }
861
+
862
+ // 提供重试或删除选项
863
+ while (true) {
864
+ try {
865
+ const choices = ['重试下载']
866
+ if (hasIncompleteData) {
867
+ choices.push('删除不完整数据并返回')
868
+ }
869
+ choices.push('保留现状并返回')
870
+
871
+ const { choice } = await prompt({
872
+ type: 'select',
873
+ name: 'choice',
874
+ message: '如何处理?',
875
+ choices,
876
+ styles: {
877
+ primary: chalk.cyan.bold
878
+ }
879
+ })
880
+
881
+ if (choice === '重试下载') {
882
+ // 删除不完整数据后重试
883
+ if (hasIncompleteData && fs.existsSync(targetDir)) {
884
+ console.log(chalk.gray('删除不完整数据...'))
885
+ fs.rmSync(targetDir, { recursive: true, force: true })
886
+ }
887
+ console.log(chalk.gray('重新下载...'))
888
+ console.log()
889
+ // 递归调用自身重试
890
+ await downloadDataset(dataPath, dataset)
891
+ return // 重试成功后退出
892
+ } else if (choice === '删除不完整数据并返回') {
893
+ fs.rmSync(targetDir, { recursive: true, force: true })
894
+ console.log(chalk.gray('不完整数据已删除'))
895
+ return
896
+ } else {
897
+ // 保留现状并返回
898
+ // 创建标记文件表明数据不完整
899
+ if (!fs.existsSync(targetDir)) {
900
+ fs.mkdirSync(targetDir, { recursive: true })
901
+ }
902
+ fs.writeFileSync(path.join(targetDir, '.lfs-incomplete'), `下载失败: ${error.message}`)
903
+ console.log(chalk.yellow('已保留不完整数据,可稍后重试'))
904
+ return
905
+ }
906
+ } catch (promptError) {
907
+ if (isUserCancel(promptError)) {
908
+ console.log(chalk.gray('返回上一级'))
909
+ return
910
+ }
911
+ throw promptError
912
+ }
913
+ }
855
914
  }
856
915
  }
857
916
 
package/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "buildTime": "2026-05-13T02:08:13.257Z",
3
- "cliVersion": "2026.5.13-1007"
2
+ "buildTime": "2026-05-13T15:10:08.177Z",
3
+ "cliVersion": "2026.5.13-2308"
4
4
  }