@myvillage/cli 1.48.3 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myvillage/cli",
3
- "version": "1.48.3",
3
+ "version": "1.48.6",
4
4
  "description": "MyVillageOS CLI for community developers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -118,15 +118,41 @@ export async function getMCPTools(agentDir, agentConfig) {
118
118
  ? arg.replace(/\$\{(\w+)\}/g, (_, name) => process.env[name] || '')
119
119
  : arg,
120
120
  );
121
+ // On Windows, npx/node/uvx live behind .cmd/.bat shims that a bare
122
+ // spawn() can't resolve (PATHEXT is applied by the shell, not by
123
+ // spawn) — which surfaces as "spawn npx ENOENT". Route the command
124
+ // through `cmd /c` so the shell resolves the real executable for any
125
+ // command, not just npx.
126
+ const isWindows = process.platform === 'win32';
127
+ const stdioCommand = isWindows
128
+ ? (process.env.ComSpec || 'cmd')
129
+ : server.command;
130
+ const stdioArgs = isWindows
131
+ ? ['/c', server.command, ...resolvedArgs]
132
+ : resolvedArgs;
121
133
  const stdioTransport = new Experimental_StdioMCPTransport({
122
- command: server.command,
123
- args: resolvedArgs,
134
+ command: stdioCommand,
135
+ args: stdioArgs,
124
136
  env: { ...process.env, ...resolveEnvVars(server.env || {}) },
125
137
  });
126
- client = await withTimeout(
127
- createMCPClient({ transport: stdioTransport }),
128
- `${name} (stdio ${server.command})`,
129
- );
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
+ }
130
156
  }
131
157
 
132
158
  activeClients.push(client);
@@ -120,10 +120,15 @@ function starterEnvFile() {
120
120
  '# environment of every MCP subprocess it spawns. Use it for tokens, API',
121
121
  '# keys, and any other secret your tools (or remote MCPs) need.',
122
122
  '#',
123
- '# Examples:',
124
- '# GITHUB_TOKEN=ghp_xxxxxxxxxxxx',
125
- '# GMAIL_TOKEN=xxxxxxxxxxxx',
123
+ '# Examples (the curated recipes — install with `myvillage agent add-mcp`):',
124
+ '# GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxxxxxxxxxxx',
126
125
  '# SLACK_BOT_TOKEN=xoxb-xxxxxxxxxxxx',
126
+ '# SLACK_TEAM_ID=T01234567',
127
+ '# TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxx',
128
+ '# TWILIO_API_KEY=SKxxxxxxxxxxxx',
129
+ '# TWILIO_API_SECRET=xxxxxxxxxxxx',
130
+ '#',
131
+ '# Gmail uses file-based auth (~/.gmail-mcp/credentials.json), no env var needed.',
127
132
  '#',
128
133
  '# This file is plaintext — keep it out of version control.',
129
134
  '',