@aiyiran/myclaw 1.0.34 → 1.0.37

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 (4) hide show
  1. package/config.js +1 -1
  2. package/index.js +6 -2
  3. package/package.json +1 -1
  4. package/wsl2.js +15 -12
package/config.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  module.exports = {
7
7
  // Gateway 认证 Token
8
- TOKEN: 'qwertyuiop1234567890',
8
+ TOKEN: 'aiyiran',
9
9
 
10
10
  // 默认控制台地址
11
11
  DEFAULT_URL: 'http://127.0.0.1:18789',
package/index.js CHANGED
@@ -358,9 +358,11 @@ if not errorlevel 1 (
358
358
  echo.
359
359
  echo ============================================
360
360
  echo OpenClaw 已在运行!浏览器已打开
361
+ echo 输入 exit 可关闭此窗口
361
362
  echo ============================================
362
363
  echo.
363
364
  wsl -d OpenClaw
365
+ pause
364
366
  exit /b
365
367
  )
366
368
 
@@ -372,12 +374,14 @@ echo 关闭此窗口将停止服务
372
374
  echo ============================================
373
375
  echo.
374
376
  wsl -d OpenClaw -- openclaw gateway
377
+ echo.
378
+ echo [!] Gateway 已退出
375
379
  pause
376
380
  `;
377
381
 
378
382
 
379
- // 写入 bat 文件
380
- fs.writeFileSync(batPath, batContent, 'utf8');
383
+ // 写入 bat 文件(Windows CMD 需要 CRLF 换行符)
384
+ fs.writeFileSync(batPath, batContent.replace(/\n/g, '\r\n'), 'utf8');
381
385
 
382
386
  // 用 PowerShell 创建带图标的桌面快捷方式
383
387
  const psScript = `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.0.34",
3
+ "version": "1.0.37",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
package/wsl2.js CHANGED
@@ -402,9 +402,7 @@ function run() {
402
402
  console.log('[' + C.b + 'MyClaw' + C.nc + '] WSL2 一键安装向导');
403
403
  console.log(bar);
404
404
 
405
- const forceReinstall = process.argv.includes('--reinstall');
406
-
407
- if (state === 'ready' && !forceReinstall) {
405
+ if (state === 'ready') {
408
406
  console.log('');
409
407
  console.log('[' + C.g + 'OK' + C.nc + '] WSL2 已完全安装就绪!');
410
408
  console.log('');
@@ -417,16 +415,21 @@ function run() {
417
415
  console.log('');
418
416
  console.log('输入 ' + C.y + 'wsl' + C.nc + ' 即可进入 Linux 环境。');
419
417
  console.log('');
420
- console.log('如需重新安装 Linux 环境,运行:');
421
- console.log(' ' + C.y + 'myclaw wsl2 --reinstall' + C.nc);
422
- console.log('');
423
- return;
424
- }
425
418
 
426
- if (state === 'ready' && forceReinstall) {
427
- console.log('');
428
- console.log('[' + C.y + '重装模式' + C.nc + '] 将重新导入 Linux 环境...');
429
- runPhase2();
419
+ // 询问是否重装
420
+ const readline = require('readline');
421
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
422
+ rl.question('是否要重新安装 Linux 环境? (y/N): ', (answer) => {
423
+ rl.close();
424
+ if (answer.trim().toLowerCase() === 'y') {
425
+ console.log('');
426
+ console.log('[' + C.y + '重装模式' + C.nc + '] 将重新导入 Linux 环境...');
427
+ runPhase2();
428
+ } else {
429
+ console.log('');
430
+ console.log('已取消。');
431
+ }
432
+ });
430
433
  return;
431
434
  }
432
435