@myvillage/cli 1.48.5 → 1.48.6
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
|
@@ -135,10 +135,24 @@ export async function getMCPTools(agentDir, agentConfig) {
|
|
|
135
135
|
args: stdioArgs,
|
|
136
136
|
env: { ...process.env, ...resolveEnvVars(server.env || {}) },
|
|
137
137
|
});
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
// @ai-sdk/mcp only passes windowsHide:true to its internal spawn()
|
|
139
|
+
// when it detects Electron (it probes `'type' in process`). Our agent
|
|
140
|
+
// daemon is plain Node running detached with no console, so each
|
|
141
|
+
// cmd/npx child would otherwise get a *visible* console window on
|
|
142
|
+
// Windows. Briefly mimic Electron across the spawn so the child's
|
|
143
|
+
// console is created hidden, then restore the global so we don't
|
|
144
|
+
// mislead other libraries into thinking they're in Electron.
|
|
145
|
+
const hadProcessType = 'type' in process;
|
|
146
|
+
const prevProcessType = process.type;
|
|
147
|
+
if (isWindows && !hadProcessType) process.type = 'browser';
|
|
148
|
+
try {
|
|
149
|
+
client = await withTimeout(
|
|
150
|
+
createMCPClient({ transport: stdioTransport }),
|
|
151
|
+
`${name} (stdio ${server.command})`,
|
|
152
|
+
);
|
|
153
|
+
} finally {
|
|
154
|
+
if (isWindows && !hadProcessType) delete process.type;
|
|
155
|
+
}
|
|
142
156
|
}
|
|
143
157
|
|
|
144
158
|
activeClients.push(client);
|