@swmansion/argent 0.25.3-next.4 → 0.25.3-next.5

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.
Binary file
Binary file
Binary file
Binary file
package/dist/cli-cmds.mjs CHANGED
@@ -21877,7 +21877,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
21877
21877
  var SESSION_ID2 = randomUUID5();
21878
21878
  function readCliVersion() {
21879
21879
  if (true) {
21880
- return "0.25.3-next.4";
21880
+ return "0.25.3-next.5";
21881
21881
  }
21882
21882
  return "0.0.0";
21883
21883
  }
@@ -16730,7 +16730,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16730
16730
  var SESSION_ID = randomUUID4();
16731
16731
  function readCliVersion() {
16732
16732
  if (true) {
16733
- return "0.25.3-next.4";
16733
+ return "0.25.3-next.5";
16734
16734
  }
16735
16735
  return "0.0.0";
16736
16736
  }
@@ -94811,7 +94811,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
94811
94811
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
94812
94812
  function readCliVersion() {
94813
94813
  if (true) {
94814
- return "0.25.3-next.4";
94814
+ return "0.25.3-next.5";
94815
94815
  }
94816
94816
  return "0.0.0";
94817
94817
  }
@@ -96171,7 +96171,7 @@ var import_node_path6 = __toESM(require("node:path"));
96171
96171
  var import_semver2 = __toESM(require_semver2());
96172
96172
 
96173
96173
  // ../tool-server/package.json
96174
- var version2 = "0.25.2";
96174
+ var version2 = "0.26.0";
96175
96175
 
96176
96176
  // ../tool-server/src/utils/update-checker.ts
96177
96177
  var import_update_core = __toESM(require_dist4());
@@ -108282,6 +108282,16 @@ var getPaths = () => {
108282
108282
  return { BINARY_PATH, RUN_DIR };
108283
108283
  };
108284
108284
  var READY_TIMEOUT_MS = 3e4;
108285
+ var STDERR_DRAIN_MS = 250;
108286
+ var STDERR_TAIL_LINES = 10;
108287
+ var STDERR_MAX_LINE_CHARS = 500;
108288
+ var ROUTINE_LOG_LINE = /^\[\S+\s+(?:INFO|DEBUG|TRACE)\s/;
108289
+ function exitedBeforeReadyMessage(code, signal, stderrTail) {
108290
+ const how = typeof code === "number" ? `exited with code ${code}` : signal ? `was killed by ${signal}` : "exited";
108291
+ const reason = stderrTail.join("\n");
108292
+ return `simulator-server ${how} before becoming ready${reason ? `:
108293
+ ${reason}` : ""}`;
108294
+ }
108285
108295
  var DISPLAY_PROBE_TIMEOUT_MS = 3e3;
108286
108296
  async function attachFoldableDisplay(api, device) {
108287
108297
  if (device.platform !== "ios" || api.transport) return;
@@ -108408,8 +108418,9 @@ async function spawnSimulatorServerProcess(udid, subcommand) {
108408
108418
  cleanup?.();
108409
108419
  fn();
108410
108420
  };
108421
+ let exited = false;
108411
108422
  const resolveWhenReady = () => {
108412
- if (apiUrl == null) return;
108423
+ if (apiUrl == null || exited) return;
108413
108424
  settle(() => resolve14({ proc, apiUrl, streamUrl }));
108414
108425
  };
108415
108426
  rl.on("line", (rawLine) => {
@@ -108431,23 +108442,47 @@ async function spawnSimulatorServerProcess(udid, subcommand) {
108431
108442
  }
108432
108443
  });
108433
108444
  const udidTag = typeof udid === "string" && udid.length > 0 ? udid.slice(0, 8) : "?";
108445
+ const stderrTail = [];
108446
+ let partialLine = "";
108447
+ const keepLine = (line) => {
108448
+ if (!line.trim() || ROUTINE_LOG_LINE.test(line)) return;
108449
+ stderrTail.push(line.trimEnd().slice(0, STDERR_MAX_LINE_CHARS));
108450
+ stderrTail.splice(0, Math.max(0, stderrTail.length - STDERR_TAIL_LINES));
108451
+ };
108434
108452
  proc.stderr?.on("data", (data) => {
108435
108453
  process.stderr.write(`[sim ${udidTag}] ${data}`);
108454
+ if (settled) return;
108455
+ const lines = (partialLine + data.toString()).split("\n");
108456
+ partialLine = (lines.pop() ?? "").slice(-STDERR_MAX_LINE_CHARS);
108457
+ lines.forEach(keepLine);
108436
108458
  });
108437
108459
  proc.on("exit", (code, signal) => {
108438
- settle(
108439
- () => reject(
108440
- new FailureError("simulator-server exited with code before becoming ready", {
108441
- error_code: FAILURE_CODES.SIMULATOR_SERVER_READY_EXITED,
108442
- failure_stage: "simulator_server_spawn_ready",
108443
- failure_area: "tool_server",
108444
- error_kind: "subprocess",
108445
- failure_command: "simulator_server",
108446
- ...typeof code === "number" ? { failure_exit_code: code } : {},
108447
- ...signal === "SIGABRT" || signal === "SIGHUP" || signal === "SIGINT" || signal === "SIGKILL" || signal === "SIGQUIT" || signal === "SIGTERM" ? { failure_signal: signal } : {}
108448
- })
108449
- )
108450
- );
108460
+ exited = true;
108461
+ clearTimeout(timer);
108462
+ const fail = () => {
108463
+ keepLine(partialLine);
108464
+ partialLine = "";
108465
+ settle(
108466
+ () => reject(
108467
+ new FailureError(exitedBeforeReadyMessage(code, signal, stderrTail), {
108468
+ error_code: FAILURE_CODES.SIMULATOR_SERVER_READY_EXITED,
108469
+ failure_stage: "simulator_server_spawn_ready",
108470
+ failure_area: "tool_server",
108471
+ error_kind: "subprocess",
108472
+ failure_command: "simulator_server",
108473
+ ...typeof code === "number" ? { failure_exit_code: code } : {},
108474
+ ...signal === "SIGABRT" || signal === "SIGHUP" || signal === "SIGINT" || signal === "SIGKILL" || signal === "SIGQUIT" || signal === "SIGTERM" ? { failure_signal: signal } : {}
108475
+ })
108476
+ )
108477
+ );
108478
+ };
108479
+ const stderr = proc.stderr;
108480
+ if (settled || !stderr || stderr.readableEnded) return fail();
108481
+ const drainTimer = setTimeout(fail, STDERR_DRAIN_MS);
108482
+ stderr.once("end", () => {
108483
+ clearTimeout(drainTimer);
108484
+ fail();
108485
+ });
108451
108486
  });
108452
108487
  proc.on("error", (err) => {
108453
108488
  settle(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.25.3-next.4",
3
+ "version": "0.25.3-next.5",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",