@swmansion/argent 0.14.1-next.14 → 0.14.1-next.15

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.
@@ -118565,6 +118565,19 @@ var fs20 = __toESM(require("node:fs"));
118565
118565
  var net5 = __toESM(require("node:net"));
118566
118566
  var path18 = __toESM(require("node:path"));
118567
118567
  init_src();
118568
+
118569
+ // ../tool-server/src/utils/electron-env.ts
118570
+ function electronGuiChildEnv(overrides = {}) {
118571
+ const env = { ...process.env, ...overrides };
118572
+ for (const key of Object.keys(env)) {
118573
+ if (key.toLowerCase() === "electron_run_as_node") {
118574
+ delete env[key];
118575
+ }
118576
+ }
118577
+ return env;
118578
+ }
118579
+
118580
+ // ../tool-server/src/tools/devices/boot-electron.ts
118568
118581
  var DEFAULT_READY_TIMEOUT_MS = 3e4;
118569
118582
  async function pickFreePort() {
118570
118583
  return new Promise((resolve5, reject) => {
@@ -118688,7 +118701,12 @@ async function bootElectronApp(options) {
118688
118701
  child = (0, import_node_child_process15.spawn)(launcher.command, args, {
118689
118702
  detached: true,
118690
118703
  stdio: ["ignore", "pipe", "pipe"],
118691
- env: { ...process.env, ELECTRON_ENABLE_LOGGING: "1" }
118704
+ // Strip ELECTRON_RUN_AS_NODE (see electronGuiChildEnv): if the tool-server
118705
+ // inherited it from an Electron-based MCP host, the Electron binary would
118706
+ // run in Node mode with no CDP endpoint — so boot-device fails below (the
118707
+ // child exits early, or the readiness probe times out) instead of the app
118708
+ // coming up.
118709
+ env: electronGuiChildEnv({ ELECTRON_ENABLE_LOGGING: "1" })
118692
118710
  });
118693
118711
  } catch (err) {
118694
118712
  throw new FailureError(
@@ -142252,7 +142270,11 @@ function createPreviewWindowManager(opts = {}) {
142252
142270
  const launchBin = wrapperBin ?? electronBin;
142253
142271
  const launchArgs = wrapperBin ? ["--no-sandbox", mainScript] : [mainScript];
142254
142272
  const next = (0, import_node_child_process27.spawn)(launchBin, launchArgs, {
142255
- env: { ...process.env, ARGENT_PREVIEW_URL: url2 },
142273
+ // Strip ELECTRON_RUN_AS_NODE so the child boots as a GUI Electron app, not
142274
+ // a bare Node runtime (see electronGuiChildEnv). An Electron-based MCP
142275
+ // host puts it in our env, and inheriting it makes main.cjs crash at
142276
+ // app.setName() with `app` undefined — the window never opens.
142277
+ env: electronGuiChildEnv({ ARGENT_PREVIEW_URL: url2 }),
142256
142278
  stdio: ["pipe", "ignore", "pipe"]
142257
142279
  });
142258
142280
  next.on("error", (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.14.1-next.14",
3
+ "version": "0.14.1-next.15",
4
4
  "description": "MCP server for iOS Simulator and Android Emulator control",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {