@aiyiran/myclaw 1.0.119 → 1.0.120
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 +1 -1
- package/patch-manifest.json +1 -1
- package/start.js +36 -25
package/package.json
CHANGED
package/patch-manifest.json
CHANGED
package/start.js
CHANGED
|
@@ -90,19 +90,36 @@ function startWindows() {
|
|
|
90
90
|
console.log('');
|
|
91
91
|
|
|
92
92
|
if (!gatewayRunning) {
|
|
93
|
-
//
|
|
94
|
-
|
|
93
|
+
// ============================================================
|
|
94
|
+
// 首次启动: 在当前窗口直接 launch,不开新窗口,不刷图标
|
|
95
|
+
// ============================================================
|
|
96
|
+
console.log('[launch] 在当前窗口启动 Gateway...');
|
|
97
|
+
|
|
98
|
+
// Step 4: 先打开浏览器(延迟几秒后 Gateway 就绑了)
|
|
99
|
+
console.log('');
|
|
100
|
+
console.log('[4/4] 打开浏览器 (Gateway 启动后自动连接)...');
|
|
101
|
+
try { execSync('myclaw open', { stdio: 'inherit', timeout: 10000 }); } catch {}
|
|
102
|
+
|
|
103
|
+
console.log('');
|
|
104
|
+
console.log(BAR);
|
|
105
|
+
console.log(' Gateway 正在当前窗口启动...');
|
|
106
|
+
console.log(' 关闭此窗口 = 停止服务');
|
|
107
|
+
console.log(BAR);
|
|
108
|
+
console.log('');
|
|
109
|
+
|
|
110
|
+
// 直接在当前窗口执行 launch(阻塞,关窗口 = 停服务)
|
|
95
111
|
try {
|
|
96
|
-
execSync('
|
|
112
|
+
execSync('wsl -d OpenClaw -- myclaw launch', {
|
|
97
113
|
stdio: 'inherit',
|
|
98
|
-
shell: true,
|
|
99
114
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
console.error(' ' + C.r + '[失败]' + C.nc + ' ' + err.message);
|
|
103
|
-
}
|
|
115
|
+
} catch {}
|
|
116
|
+
|
|
104
117
|
} else {
|
|
105
|
-
//
|
|
118
|
+
// ============================================================
|
|
119
|
+
// 非首次启动: Gateway 已在运行
|
|
120
|
+
// ============================================================
|
|
121
|
+
|
|
122
|
+
// 重启使 patch 生效
|
|
106
123
|
console.log('[restart] 重启 Gateway 使插件生效...');
|
|
107
124
|
try {
|
|
108
125
|
execSync('wsl -d OpenClaw -- openclaw gateway restart', { stdio: 'pipe', timeout: 15000 });
|
|
@@ -110,15 +127,13 @@ function startWindows() {
|
|
|
110
127
|
} catch {
|
|
111
128
|
console.log(' ' + C.y + '[跳过]' + C.nc + ' 重启失败,手动 myclaw restart');
|
|
112
129
|
}
|
|
113
|
-
}
|
|
114
130
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
// Step 4: 打开浏览器
|
|
132
|
+
console.log('');
|
|
133
|
+
console.log('[4/4] 打开浏览器...');
|
|
134
|
+
try { execSync('myclaw open', { stdio: 'inherit', timeout: 10000 }); } catch {}
|
|
119
135
|
|
|
120
|
-
|
|
121
|
-
// Gateway 已有,附带打开 WSL 终端
|
|
136
|
+
// 打开 WSL 终端
|
|
122
137
|
console.log('');
|
|
123
138
|
console.log('[terminal] 打开 WSL 终端...');
|
|
124
139
|
try {
|
|
@@ -127,19 +142,15 @@ function startWindows() {
|
|
|
127
142
|
shell: true,
|
|
128
143
|
});
|
|
129
144
|
} catch {}
|
|
130
|
-
}
|
|
131
145
|
|
|
132
|
-
|
|
133
|
-
|
|
146
|
+
// 刷新桌面图标(仅非首次才做)
|
|
147
|
+
try { execSync('myclaw bat', { stdio: 'pipe', timeout: 10000 }); } catch {}
|
|
134
148
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (gatewayRunning) {
|
|
149
|
+
console.log('');
|
|
150
|
+
console.log(BAR);
|
|
138
151
|
console.log(' OpenClaw 正在运行,浏览器已打开。');
|
|
139
|
-
|
|
140
|
-
console.log(' Gateway 正在新窗口中启动...');
|
|
152
|
+
console.log(BAR);
|
|
141
153
|
}
|
|
142
|
-
console.log(BAR);
|
|
143
154
|
}
|
|
144
155
|
|
|
145
156
|
// ============================================================================
|