@yeaft/webchat-agent 1.0.252 → 1.0.254

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 CHANGED
@@ -16,6 +16,13 @@ import { connect } from './connection.js';
16
16
  import { loadMcpServers } from './mcp.js';
17
17
 
18
18
  const execAsync = promisify(exec);
19
+
20
+ // Startup maintenance is non-interactive. Without windowsHide, each exec()
21
+ // creates a visible cmd.exe window on Windows before the Agent connects.
22
+ function execHiddenAsync(command, options = {}) {
23
+ return execAsync(command, { ...options, windowsHide: true });
24
+ }
25
+
19
26
  const __dirname = dirname(fileURLToPath(import.meta.url));
20
27
 
21
28
  // Load package version
@@ -148,7 +155,7 @@ async function ensureDependencies() {
148
155
  if (!existsSync(nodeModulesPath)) {
149
156
  console.log('[Startup] node_modules not found, running npm install...');
150
157
  try {
151
- await execAsync('npm install', { cwd: agentDir, timeout: 120000 });
158
+ await execHiddenAsync('npm install', { cwd: agentDir, timeout: 120000 });
152
159
  console.log('[Startup] npm install completed');
153
160
  } catch (e) {
154
161
  console.warn('[Startup] npm install failed:', e.message);
@@ -179,7 +186,7 @@ async function ensureYeaftSkills() {
179
186
  if (!existsSync(installDir)) {
180
187
  console.log('[Startup] yeaft-skills not found, installing as marketplace plugin...');
181
188
  mkdirSync(marketplacesDir, { recursive: true });
182
- await execAsync(`git clone ${REPO_URL} "${installDir}"`, { timeout: 60000 });
189
+ await execHiddenAsync(`git clone ${REPO_URL} "${installDir}"`, { timeout: 60000 });
183
190
  needsCacheUpdate = true;
184
191
  console.log('[Startup] yeaft-skills installed');
185
192
  } else {
@@ -187,10 +194,10 @@ async function ensureYeaftSkills() {
187
194
  // Record HEAD before pull to detect changes
188
195
  let headBefore = '';
189
196
  try {
190
- const { stdout: h } = await execAsync('git rev-parse HEAD', { cwd: installDir, timeout: 5000 });
197
+ const { stdout: h } = await execHiddenAsync('git rev-parse HEAD', { cwd: installDir, timeout: 5000 });
191
198
  headBefore = h.trim();
192
199
  } catch { /* ignore */ }
193
- const { stdout } = await execAsync('git pull --ff-only', {
200
+ const { stdout } = await execHiddenAsync('git pull --ff-only', {
194
201
  cwd: installDir,
195
202
  timeout: 30000
196
203
  });
@@ -203,14 +210,14 @@ async function ensureYeaftSkills() {
203
210
  // Double-check: compare HEAD after pull
204
211
  if (!needsCacheUpdate && headBefore) {
205
212
  try {
206
- const { stdout: h2 } = await execAsync('git rev-parse HEAD', { cwd: installDir, timeout: 5000 });
213
+ const { stdout: h2 } = await execHiddenAsync('git rev-parse HEAD', { cwd: installDir, timeout: 5000 });
207
214
  if (h2.trim() !== headBefore) needsCacheUpdate = true;
208
215
  } catch { /* ignore */ }
209
216
  }
210
217
  }
211
218
  // Get current commit SHA for installed_plugins.json
212
219
  try {
213
- const { stdout: sha } = await execAsync('git rev-parse HEAD', { cwd: installDir, timeout: 5000 });
220
+ const { stdout: sha } = await execHiddenAsync('git rev-parse HEAD', { cwd: installDir, timeout: 5000 });
214
221
  gitSha = sha.trim();
215
222
  } catch { /* non-critical */ }
216
223
 
@@ -1 +1 @@
1
- {"version":"1.0.252"}
1
+ {"version":"1.0.254"}