@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.0.119",
3
+ "version": "1.0.120",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "_doc": "MyClaw 注入清单 (auto-generated)。strategy: auto | on | off | delete",
3
- "_generated": "2026-04-02T14:44:32.731Z",
3
+ "_generated": "2026-04-02T14:47:39.655Z",
4
4
  "agents": [
5
5
  {
6
6
  "id": "danci",
package/start.js CHANGED
@@ -90,19 +90,36 @@ function startWindows() {
90
90
  console.log('');
91
91
 
92
92
  if (!gatewayRunning) {
93
- // Gateway 未运行: 在新窗口启动(launch 内部会再 patch 一次,幂等无害)
94
- console.log('[launch] 在新窗口启动 Gateway...');
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('start "OpenClaw Gateway" wsl -d OpenClaw -- myclaw launch', {
112
+ execSync('wsl -d OpenClaw -- myclaw launch', {
97
113
  stdio: 'inherit',
98
- shell: true,
99
114
  });
100
- console.log(' ' + C.g + '[OK]' + C.nc);
101
- } catch (err) {
102
- console.error(' ' + C.r + '[失败]' + C.nc + ' ' + err.message);
103
- }
115
+ } catch {}
116
+
104
117
  } else {
105
- // Gateway 已在运行,重启使 patch 生效
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
- // Step 4: 打开浏览器
116
- console.log('');
117
- console.log('[4/4] 打开浏览器...');
118
- try { execSync('myclaw open', { stdio: 'inherit', timeout: 10000 }); } catch {}
131
+ // Step 4: 打开浏览器
132
+ console.log('');
133
+ console.log('[4/4] 打开浏览器...');
134
+ try { execSync('myclaw open', { stdio: 'inherit', timeout: 10000 }); } catch {}
119
135
 
120
- if (gatewayRunning) {
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
- try { execSync('myclaw bat', { stdio: 'pipe', timeout: 10000 }); } catch {}
146
+ // 刷新桌面图标(仅非首次才做)
147
+ try { execSync('myclaw bat', { stdio: 'pipe', timeout: 10000 }); } catch {}
134
148
 
135
- console.log('');
136
- console.log(BAR);
137
- if (gatewayRunning) {
149
+ console.log('');
150
+ console.log(BAR);
138
151
  console.log(' OpenClaw 正在运行,浏览器已打开。');
139
- } else {
140
- console.log(' Gateway 正在新窗口中启动...');
152
+ console.log(BAR);
141
153
  }
142
- console.log(BAR);
143
154
  }
144
155
 
145
156
  // ============================================================================