@aiyiran/myclaw 1.0.163 → 1.0.164
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/index.js +1 -1
- package/package.json +1 -1
- package/start.js +19 -0
- package/wsl2.js +15 -5
package/index.js
CHANGED
|
@@ -1131,7 +1131,7 @@ function showHelp() {
|
|
|
1131
1131
|
console.log(' up 升级 + 刷新桌面快捷方式 (= update + bat)');
|
|
1132
1132
|
console.log(' open 打开浏览器控制台(自动带 token)');
|
|
1133
1133
|
console.log(' fix 兜底修复(自动补装 WSL + Chrome,仅限 Windows)');
|
|
1134
|
-
console.log(' wsl2 WSL2 一键安装/修复 (仅限 Windows, 可选: --cli)');
|
|
1134
|
+
console.log(' wsl2 WSL2 一键安装/修复 (仅限 Windows, 可选: --cli, --remote)');
|
|
1135
1135
|
console.log(' safe 开启虚拟机屏蔽 (禁止自动挂载 Windows 盘符)');
|
|
1136
1136
|
console.log(' bat 在桌面生成一键启动脚本 (仅限 Windows)');
|
|
1137
1137
|
console.log(' list 查看注入资源管理列表(智能体/技能/配置)');
|
package/package.json
CHANGED
package/start.js
CHANGED
|
@@ -66,6 +66,25 @@ function startWindows() {
|
|
|
66
66
|
}
|
|
67
67
|
console.log('');
|
|
68
68
|
|
|
69
|
+
// Step 2.5: 自动检测虚拟机屏蔽(safe)
|
|
70
|
+
console.log('[safe] 虚拟机屏蔽...');
|
|
71
|
+
try {
|
|
72
|
+
const conf = execSync('wsl -d OpenClaw -u root -- cat /etc/wsl.conf 2>/dev/null', {
|
|
73
|
+
encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'],
|
|
74
|
+
});
|
|
75
|
+
if (conf.includes('enabled = false') || conf.includes('enabled=false')) {
|
|
76
|
+
console.log(' ' + C.g + '[已开启]' + C.nc);
|
|
77
|
+
} else {
|
|
78
|
+
console.log(' ' + C.y + '[未开启,正在启用...]' + C.nc);
|
|
79
|
+
try { execSync('myclaw safe', { stdio: 'inherit', timeout: 30000 }); } catch {}
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
// wsl.conf 不存在,说明还没开启
|
|
83
|
+
console.log(' ' + C.y + '[未开启,正在启用...]' + C.nc);
|
|
84
|
+
try { execSync('myclaw safe', { stdio: 'inherit', timeout: 30000 }); } catch {}
|
|
85
|
+
}
|
|
86
|
+
console.log('');
|
|
87
|
+
|
|
69
88
|
// Step 3: 检查 Gateway
|
|
70
89
|
console.log('[3/4] Gateway...');
|
|
71
90
|
let gatewayRunning = false;
|
package/wsl2.js
CHANGED
|
@@ -506,10 +506,11 @@ function runCliMode() {
|
|
|
506
506
|
console.log(' 1. 重新安装 Phase 1 (启用功能 + 下载)');
|
|
507
507
|
console.log(' 2. 重新安装 Phase 2 (导入 Linux 环境)');
|
|
508
508
|
console.log(' 3. 重新设置安装包路径');
|
|
509
|
+
console.log(' 4. WSL2虚拟机重装 (强制远程 + 阶段1重启)');
|
|
509
510
|
console.log(' 0. 退出');
|
|
510
511
|
console.log('');
|
|
511
512
|
|
|
512
|
-
const choice = await question('请输入选项 (0-
|
|
513
|
+
const choice = await question('请输入选项 (0-4): ');
|
|
513
514
|
|
|
514
515
|
switch (choice.trim()) {
|
|
515
516
|
case '1':
|
|
@@ -517,7 +518,7 @@ function runCliMode() {
|
|
|
517
518
|
console.log('[' + C.y + '执行' + C.nc + '] 开始 Phase 1 安装...');
|
|
518
519
|
setState('needs-features');
|
|
519
520
|
rl.close();
|
|
520
|
-
runPhase1();
|
|
521
|
+
runPhase1(false);
|
|
521
522
|
break;
|
|
522
523
|
|
|
523
524
|
case '2':
|
|
@@ -525,7 +526,7 @@ function runCliMode() {
|
|
|
525
526
|
console.log('[' + C.y + '执行' + C.nc + '] 开始 Phase 2 安装...');
|
|
526
527
|
setState('phase1-done');
|
|
527
528
|
rl.close();
|
|
528
|
-
runPhase2();
|
|
529
|
+
runPhase2(false);
|
|
529
530
|
break;
|
|
530
531
|
|
|
531
532
|
case '3':
|
|
@@ -543,6 +544,15 @@ function runCliMode() {
|
|
|
543
544
|
rl.close();
|
|
544
545
|
break;
|
|
545
546
|
|
|
547
|
+
case '4':
|
|
548
|
+
console.log('');
|
|
549
|
+
console.log('[' + C.y + '执行' + C.nc + '] WSL2虚拟机重装 (强制远程下载)...');
|
|
550
|
+
console.log('');
|
|
551
|
+
setState('needs-features');
|
|
552
|
+
rl.close();
|
|
553
|
+
runPhase1(true);
|
|
554
|
+
break;
|
|
555
|
+
|
|
546
556
|
case '0':
|
|
547
557
|
console.log('');
|
|
548
558
|
console.log('已退出。');
|
|
@@ -626,9 +636,9 @@ function run() {
|
|
|
626
636
|
}
|
|
627
637
|
|
|
628
638
|
if (state === 'phase1-done') {
|
|
629
|
-
runPhase2();
|
|
639
|
+
runPhase2(forceRemote);
|
|
630
640
|
} else {
|
|
631
|
-
runPhase1();
|
|
641
|
+
runPhase1(forceRemote);
|
|
632
642
|
}
|
|
633
643
|
}
|
|
634
644
|
|