yymaxapi 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/bin/yymaxapi.js +38 -13
  2. package/package.json +1 -1
package/bin/yymaxapi.js CHANGED
@@ -1925,7 +1925,7 @@ async function main() {
1925
1925
  { name: '→ 查看配置', value: 'view_config' },
1926
1926
  { name: '→ 恢复默认', value: 'restore' },
1927
1927
  new inquirer.Separator(chalk.gray('── 安装 ──')),
1928
- { name: '📦 安装/更新 OpenClaw', value: 'install_openclaw' },
1928
+ { name: ' 安装/更新 OpenClaw', value: 'install_openclaw' },
1929
1929
  new inquirer.Separator(''),
1930
1930
  { name: chalk.gray('退出'), value: 'exit' }
1931
1931
  ]
@@ -2810,23 +2810,48 @@ async function installOrUpdateOpenClaw() {
2810
2810
 
2811
2811
  if (currentVersion) {
2812
2812
  console.log(chalk.cyan(`当前版本: ${currentVersion}`));
2813
+
2814
+ // 已安装 — 提醒备份 workspace
2815
+ const homeDir = os.homedir();
2816
+ const workspaceDirs = [
2817
+ path.join(homeDir, '.openclaw', 'workspace'),
2818
+ path.join(homeDir, '.clawdbot', 'workspace'),
2819
+ ].filter(d => fs.existsSync(d));
2820
+
2821
+ if (workspaceDirs.length > 0) {
2822
+ console.log(chalk.yellow('\n⚠ 更新前建议备份以下目录(包含对话记忆等数据):'));
2823
+ for (const d of workspaceDirs) {
2824
+ console.log(chalk.yellow(` ${d}`));
2825
+ }
2826
+ console.log('');
2827
+ }
2828
+
2829
+ const { confirmUpdate } = await inquirer.prompt([{
2830
+ type: 'confirm',
2831
+ name: 'confirmUpdate',
2832
+ message: '确认更新 OpenClaw 到最新版?',
2833
+ default: false
2834
+ }]);
2835
+ if (!confirmUpdate) {
2836
+ console.log(chalk.gray('已取消'));
2837
+ return;
2838
+ }
2813
2839
  } else {
2814
2840
  console.log(chalk.yellow('未检测到 OpenClaw 安装'));
2815
- }
2816
2841
 
2817
- const actionLabel = currentVersion ? '更新到最新版' : '安装最新版';
2818
- const { confirm } = await inquirer.prompt([{
2819
- type: 'confirm',
2820
- name: 'confirm',
2821
- message: `${actionLabel} OpenClaw?`,
2822
- default: true
2823
- }]);
2824
-
2825
- if (!confirm) {
2826
- console.log(chalk.gray('已取消'));
2827
- return;
2842
+ const { confirmInstall } = await inquirer.prompt([{
2843
+ type: 'confirm',
2844
+ name: 'confirmInstall',
2845
+ message: '确认安装 OpenClaw 最新版?',
2846
+ default: true
2847
+ }]);
2848
+ if (!confirmInstall) {
2849
+ console.log(chalk.gray('已取消'));
2850
+ return;
2851
+ }
2828
2852
  }
2829
2853
 
2854
+ const actionLabel = currentVersion ? '更新' : '安装';
2830
2855
  const spinner = ora({ text: `正在${actionLabel} OpenClaw...`, spinner: 'dots' }).start();
2831
2856
 
2832
2857
  const isWin = process.platform === 'win32';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yymaxapi",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "跨平台 OpenClaw/Clawdbot 配置管理工具 - 管理中转地址、模型切换、API Keys、测速优化",
5
5
  "main": "bin/yymaxapi.js",
6
6
  "bin": {