mcp-optimizer 0.0.5-alpha.1 → 0.0.6-alpha.1

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.
@@ -30,7 +30,9 @@ async function runLighthouseAudit(url, opts) {
30
30
  // Run via npx to ensure local package is used
31
31
  const cmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
32
32
  const reportJson = await new Promise((resolve, reject) => {
33
- execFile(cmd, args, { maxBuffer: 10 * 1024 * 1024 }, (err, stdout, stderr) => {
33
+ // Use a shell on Windows to ensure .cmd/.bat wrappers are executed
34
+ // correctly (avoids spawn EINVAL in some environments).
35
+ execFile(cmd, args, { maxBuffer: 10 * 1024 * 1024, shell: true, env: process.env }, (err, stdout, stderr) => {
34
36
  if (err) {
35
37
  const message = stderr || (err && err.message) || String(err);
36
38
  return reject(new Error(message));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-optimizer",
3
- "version": "0.0.5-alpha.1",
3
+ "version": "0.0.6-alpha.1",
4
4
  "description": "An MCP server that runs Lighthouse audits and enables LLMs to automatically optimize your code.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -31,7 +31,9 @@ export async function runLighthouseAudit(
31
31
  const cmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
32
32
 
33
33
  const reportJson: string = await new Promise((resolve, reject) => {
34
- execFile(cmd, args, { maxBuffer: 10 * 1024 * 1024 }, (err: any, stdout: string, stderr: string) => {
34
+ // Use a shell on Windows to ensure .cmd/.bat wrappers are executed
35
+ // correctly (avoids spawn EINVAL in some environments).
36
+ execFile(cmd, args, { maxBuffer: 10 * 1024 * 1024, shell: true, env: process.env }, (err: any, stdout: string, stderr: string) => {
35
37
  if (err) {
36
38
  const message = stderr || (err && err.message) || String(err);
37
39
  return reject(new Error(message));