@swmansion/argent 0.34.1-next.2 → 0.34.1-next.4

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/dist/cli-cmds.mjs CHANGED
@@ -10552,6 +10552,10 @@ var FAILURE_CODES = {
10552
10552
  AX_DAEMON_READY_TIMEOUT: "AX_DAEMON_READY_TIMEOUT",
10553
10553
  AX_DAEMON_EXITED_BEFORE_READY: "AX_DAEMON_EXITED_BEFORE_READY",
10554
10554
  AX_DAEMON_PROCESS_ERROR: "AX_DAEMON_PROCESS_ERROR",
10555
+ // The daemon died on a fault signal (SIGSEGV, SIGABRT, ...), before or after
10556
+ // it connected. Kept apart from the two codes above so a crash is not read
10557
+ // as an ordinary exit.
10558
+ AX_DAEMON_CRASHED: "AX_DAEMON_CRASHED",
10555
10559
  AX_FACTORY_OPTIONS_MISSING: "AX_FACTORY_OPTIONS_MISSING",
10556
10560
  AX_WRONG_PLATFORM: "AX_WRONG_PLATFORM",
10557
10561
  AX_DEVICE_ID_INVALID: "AX_DEVICE_ID_INVALID",
@@ -36081,7 +36085,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
36081
36085
  var SESSION_ID2 = randomUUID5();
36082
36086
  function readCliVersion() {
36083
36087
  if (true) {
36084
- return "0.34.1-next.1";
36088
+ return "0.34.1-next.3";
36085
36089
  }
36086
36090
  return "0.0.0";
36087
36091
  }
package/dist/client.js CHANGED
@@ -9125,6 +9125,10 @@ var FAILURE_CODES = {
9125
9125
  AX_DAEMON_READY_TIMEOUT: "AX_DAEMON_READY_TIMEOUT",
9126
9126
  AX_DAEMON_EXITED_BEFORE_READY: "AX_DAEMON_EXITED_BEFORE_READY",
9127
9127
  AX_DAEMON_PROCESS_ERROR: "AX_DAEMON_PROCESS_ERROR",
9128
+ // The daemon died on a fault signal (SIGSEGV, SIGABRT, ...), before or after
9129
+ // it connected. Kept apart from the two codes above so a crash is not read
9130
+ // as an ordinary exit.
9131
+ AX_DAEMON_CRASHED: "AX_DAEMON_CRASHED",
9128
9132
  AX_FACTORY_OPTIONS_MISSING: "AX_FACTORY_OPTIONS_MISSING",
9129
9133
  AX_WRONG_PLATFORM: "AX_WRONG_PLATFORM",
9130
9134
  AX_DEVICE_ID_INVALID: "AX_DEVICE_ID_INVALID",
@@ -15884,6 +15884,10 @@ var FAILURE_CODES = {
15884
15884
  AX_DAEMON_READY_TIMEOUT: "AX_DAEMON_READY_TIMEOUT",
15885
15885
  AX_DAEMON_EXITED_BEFORE_READY: "AX_DAEMON_EXITED_BEFORE_READY",
15886
15886
  AX_DAEMON_PROCESS_ERROR: "AX_DAEMON_PROCESS_ERROR",
15887
+ // The daemon died on a fault signal (SIGSEGV, SIGABRT, ...), before or after
15888
+ // it connected. Kept apart from the two codes above so a crash is not read
15889
+ // as an ordinary exit.
15890
+ AX_DAEMON_CRASHED: "AX_DAEMON_CRASHED",
15887
15891
  AX_FACTORY_OPTIONS_MISSING: "AX_FACTORY_OPTIONS_MISSING",
15888
15892
  AX_WRONG_PLATFORM: "AX_WRONG_PLATFORM",
15889
15893
  AX_DEVICE_ID_INVALID: "AX_DEVICE_ID_INVALID",
@@ -16989,7 +16993,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16989
16993
  var SESSION_ID = randomUUID4();
16990
16994
  function readCliVersion() {
16991
16995
  if (true) {
16992
- return "0.34.1-next.1";
16996
+ return "0.34.1-next.3";
16993
16997
  }
16994
16998
  return "0.0.0";
16995
16999
  }
@@ -25835,6 +25835,10 @@ var FAILURE_CODES = {
25835
25835
  AX_DAEMON_READY_TIMEOUT: "AX_DAEMON_READY_TIMEOUT",
25836
25836
  AX_DAEMON_EXITED_BEFORE_READY: "AX_DAEMON_EXITED_BEFORE_READY",
25837
25837
  AX_DAEMON_PROCESS_ERROR: "AX_DAEMON_PROCESS_ERROR",
25838
+ // The daemon died on a fault signal (SIGSEGV, SIGABRT, ...), before or after
25839
+ // it connected. Kept apart from the two codes above so a crash is not read
25840
+ // as an ordinary exit.
25841
+ AX_DAEMON_CRASHED: "AX_DAEMON_CRASHED",
25838
25842
  AX_FACTORY_OPTIONS_MISSING: "AX_FACTORY_OPTIONS_MISSING",
25839
25843
  AX_WRONG_PLATFORM: "AX_WRONG_PLATFORM",
25840
25844
  AX_DEVICE_ID_INVALID: "AX_DEVICE_ID_INVALID",
@@ -1595,6 +1595,10 @@ var init_failure_codes = __esm({
1595
1595
  AX_DAEMON_READY_TIMEOUT: "AX_DAEMON_READY_TIMEOUT",
1596
1596
  AX_DAEMON_EXITED_BEFORE_READY: "AX_DAEMON_EXITED_BEFORE_READY",
1597
1597
  AX_DAEMON_PROCESS_ERROR: "AX_DAEMON_PROCESS_ERROR",
1598
+ // The daemon died on a fault signal (SIGSEGV, SIGABRT, ...), before or after
1599
+ // it connected. Kept apart from the two codes above so a crash is not read
1600
+ // as an ordinary exit.
1601
+ AX_DAEMON_CRASHED: "AX_DAEMON_CRASHED",
1598
1602
  AX_FACTORY_OPTIONS_MISSING: "AX_FACTORY_OPTIONS_MISSING",
1599
1603
  AX_WRONG_PLATFORM: "AX_WRONG_PLATFORM",
1600
1604
  AX_DEVICE_ID_INVALID: "AX_DEVICE_ID_INVALID",
@@ -101281,7 +101285,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
101281
101285
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
101282
101286
  function readCliVersion() {
101283
101287
  if (true) {
101284
- return "0.34.1-next.1";
101288
+ return "0.34.1-next.3";
101285
101289
  }
101286
101290
  return "0.0.0";
101287
101291
  }
@@ -104695,7 +104699,112 @@ function startListener(endpoint, onConnection) {
104695
104699
  }
104696
104700
  });
104697
104701
  }
104698
- function waitForDaemonConnection(server, proc, timeoutMs) {
104702
+ var DARWIN_SIGNALS = {
104703
+ 1: "SIGHUP",
104704
+ 2: "SIGINT",
104705
+ 3: "SIGQUIT",
104706
+ 4: "SIGILL",
104707
+ 5: "SIGTRAP",
104708
+ 6: "SIGABRT",
104709
+ 7: "SIGEMT",
104710
+ 8: "SIGFPE",
104711
+ 9: "SIGKILL",
104712
+ 10: "SIGBUS",
104713
+ 11: "SIGSEGV",
104714
+ 12: "SIGSYS",
104715
+ 13: "SIGPIPE",
104716
+ 14: "SIGALRM",
104717
+ 15: "SIGTERM"
104718
+ };
104719
+ var FAULT_SIGNALS = /* @__PURE__ */ new Set([
104720
+ "SIGILL",
104721
+ "SIGTRAP",
104722
+ "SIGABRT",
104723
+ "SIGEMT",
104724
+ "SIGFPE",
104725
+ "SIGBUS",
104726
+ "SIGSEGV",
104727
+ "SIGSYS"
104728
+ ]);
104729
+ var SIMCTL_CHILD_SIGNAL = /Child process terminated with signal (\d+)/;
104730
+ var STDERR_DRAIN_MS = 250;
104731
+ var STDERR_TAIL_CHARS = 4e3;
104732
+ var DAEMON_EXIT_GRACE_MS = 1e3;
104733
+ function readAxDaemonExit(code, signal, stderr) {
104734
+ if (signal) return { code, signal };
104735
+ const reported = SIMCTL_CHILD_SIGNAL.exec(stderr);
104736
+ if (!reported) return { code };
104737
+ const number4 = Number(reported[1]);
104738
+ return { code, signal: DARWIN_SIGNALS[number4] ?? `signal ${number4}` };
104739
+ }
104740
+ var AxDaemonCrashError = class extends FailureError {
104741
+ signalName;
104742
+ constructor(message, signal, signalName) {
104743
+ super(message, signal);
104744
+ this.name = "AxDaemonCrashError";
104745
+ this.signalName = signalName;
104746
+ }
104747
+ };
104748
+ function findInCauses(err, pick2) {
104749
+ let current = err;
104750
+ for (let depth = 0; current instanceof Error && depth < 8; depth++) {
104751
+ const found = pick2(current);
104752
+ if (found !== void 0) return found;
104753
+ current = current.cause;
104754
+ }
104755
+ return void 0;
104756
+ }
104757
+ function axDaemonCrashSignal(err) {
104758
+ return findInCauses(
104759
+ err,
104760
+ (error63) => error63 instanceof AxDaemonCrashError ? error63.signalName : void 0
104761
+ );
104762
+ }
104763
+ var startFailureDegraded = /* @__PURE__ */ new WeakMap();
104764
+ function axStartFailureDegraded(err) {
104765
+ return findInCauses(err, (error63) => startFailureDegraded.get(error63));
104766
+ }
104767
+ function axDaemonExitError(exit, phase) {
104768
+ const suffix = phase === "connecting" ? " before connecting" : "";
104769
+ const signal = {
104770
+ error_code: phase === "connecting" ? FAILURE_CODES.AX_DAEMON_EXITED_BEFORE_READY : FAILURE_CODES.AX_DAEMON_PROCESS_ERROR,
104771
+ failure_stage: phase === "connecting" ? "ax_service_spawn_ready" : "ax_service_process_exit",
104772
+ failure_area: "tool_server",
104773
+ error_kind: "subprocess",
104774
+ ...subprocessFailureMetadata(exit, "ax_service")
104775
+ };
104776
+ if (exit.signal === void 0) {
104777
+ return new FailureError(`ax-service exited with code ${exit.code}${suffix}`, signal);
104778
+ }
104779
+ if (!FAULT_SIGNALS.has(exit.signal)) {
104780
+ return new FailureError(`ax-service was killed by ${exit.signal}${suffix}`, signal);
104781
+ }
104782
+ return new AxDaemonCrashError(
104783
+ `ax-service crashed with ${exit.signal}${suffix}`,
104784
+ { ...signal, error_code: FAILURE_CODES.AX_DAEMON_CRASHED },
104785
+ exit.signal
104786
+ );
104787
+ }
104788
+ function watchDaemonExit(proc, onExit) {
104789
+ return new Promise((resolve19) => {
104790
+ let stderrTail = "";
104791
+ proc.stderr?.on("data", (chunk) => {
104792
+ stderrTail = (stderrTail + chunk.toString()).slice(-STDERR_TAIL_CHARS);
104793
+ });
104794
+ proc.once("exit", (code, signal) => {
104795
+ onExit();
104796
+ const settle3 = () => resolve19(readAxDaemonExit(code, signal, stderrTail));
104797
+ const stderr = proc.stderr;
104798
+ if (signal || !stderr || stderr.readableEnded) return settle3();
104799
+ const timer = setTimeout(settle3, STDERR_DRAIN_MS);
104800
+ stderr.once("end", () => {
104801
+ clearTimeout(timer);
104802
+ settle3();
104803
+ });
104804
+ });
104805
+ });
104806
+ }
104807
+ function waitForDaemonConnection(server, proc, exited, timeoutMs) {
104699
104808
  return new Promise((resolve19, reject) => {
104700
104809
  let settled = false;
104701
104810
  const onConnection = (socket) => {
@@ -104704,19 +104813,12 @@ function waitForDaemonConnection(server, proc, timeoutMs) {
104704
104813
  cleanup();
104705
104814
  resolve19(socket);
104706
104815
  };
104707
- const onExit = (code) => {
104816
+ void exited.then((exit) => {
104708
104817
  if (settled) return;
104709
104818
  settled = true;
104710
104819
  cleanup();
104711
- reject(
104712
- new FailureError(`ax-service exited with code ${code} before connecting`, {
104713
- error_code: FAILURE_CODES.AX_DAEMON_EXITED_BEFORE_READY,
104714
- failure_stage: "ax_service_spawn_ready",
104715
- failure_area: "tool_server",
104716
- error_kind: "subprocess"
104717
- })
104718
- );
104719
- };
104820
+ reject(axDaemonExitError(exit, "connecting"));
104821
+ });
104720
104822
  const onError = (err) => {
104721
104823
  if (settled) return;
104722
104824
  settled = true;
@@ -104750,11 +104852,9 @@ function waitForDaemonConnection(server, proc, timeoutMs) {
104750
104852
  const cleanup = () => {
104751
104853
  clearTimeout(timer);
104752
104854
  server.off("connection", onConnection);
104753
- proc.off("exit", onExit);
104754
104855
  proc.off("error", onError);
104755
104856
  };
104756
104857
  server.on("connection", onConnection);
104757
- proc.on("exit", onExit);
104758
104858
  proc.on("error", onError);
104759
104859
  });
104760
104860
  }
@@ -104809,6 +104909,10 @@ var axServiceBlueprint = {
104809
104909
  let nextRpcId = 1;
104810
104910
  let daemonSocket = null;
104811
104911
  let disposed = false;
104912
+ let exitSeen = false;
104913
+ let awaitingVerdict = false;
104914
+ let disconnectTimer;
104915
+ const exitGraceMs = host.kind === "local" ? DAEMON_EXIT_GRACE_MS : 0;
104812
104916
  const failPending = (err) => {
104813
104917
  for (const { reject, timer } of pendingRpc.values()) {
104814
104918
  clearTimeout(timer);
@@ -104816,7 +104920,18 @@ var axServiceBlueprint = {
104816
104920
  }
104817
104921
  pendingRpc.clear();
104818
104922
  };
104923
+ const terminate = (err) => {
104924
+ if (disposed) return;
104925
+ clearTimeout(disconnectTimer);
104926
+ awaitingVerdict = false;
104927
+ failPending(err);
104928
+ events.emit("terminated", err);
104929
+ };
104819
104930
  const { entitlementBypassActive } = await host.bootstrapAx(udid);
104931
+ const startFailed = (err) => {
104932
+ if (err instanceof Error) startFailureDegraded.set(err, !entitlementBypassActive);
104933
+ return err;
104934
+ };
104820
104935
  const server = await startListener(endpoint, (socket) => {
104821
104936
  if (daemonSocket && !daemonSocket.destroyed) {
104822
104937
  daemonSocket.destroy();
@@ -104849,57 +104964,29 @@ var axServiceBlueprint = {
104849
104964
  }
104850
104965
  });
104851
104966
  socket.on("close", () => {
104852
- if (daemonSocket === socket) {
104853
- daemonSocket = null;
104854
- if (!disposed) {
104855
- const err = new FailureError("ax-service daemon disconnected", {
104856
- error_code: FAILURE_CODES.AX_DAEMON_PROCESS_ERROR,
104857
- failure_stage: "ax_service_socket_close",
104858
- failure_area: "tool_server",
104859
- error_kind: "subprocess"
104860
- });
104861
- failPending(err);
104862
- events.emit("terminated", err);
104863
- }
104864
- }
104967
+ if (daemonSocket !== socket) return;
104968
+ daemonSocket = null;
104969
+ if (disposed) return;
104970
+ awaitingVerdict = true;
104971
+ if (exitSeen) return;
104972
+ const disconnected = () => terminate(
104973
+ new FailureError("ax-service daemon disconnected", {
104974
+ error_code: FAILURE_CODES.AX_DAEMON_PROCESS_ERROR,
104975
+ failure_stage: "ax_service_socket_close",
104976
+ failure_area: "tool_server",
104977
+ error_kind: "subprocess"
104978
+ })
104979
+ );
104980
+ if (exitGraceMs === 0) disconnected();
104981
+ else disconnectTimer = setTimeout(disconnected, exitGraceMs);
104865
104982
  });
104866
104983
  socket.on("error", () => {
104867
104984
  });
104985
+ }).catch((err) => {
104986
+ throw startFailed(err);
104868
104987
  });
104869
- if (endpoint.transport === "tcp") {
104870
- await host.startProxy(udid, endpoint.port);
104871
- }
104872
- const proc = host.spawnAxDaemon(udid, endpoint);
104873
- proc.on("exit", (code) => {
104874
- if (disposed) return;
104875
- const err = new FailureError(`ax-service exited with code ${code}`, {
104876
- error_code: FAILURE_CODES.AX_DAEMON_PROCESS_ERROR,
104877
- failure_stage: "ax_service_process_exit",
104878
- failure_area: "tool_server",
104879
- error_kind: "subprocess"
104880
- });
104881
- failPending(err);
104882
- events.emit("terminated", err);
104883
- });
104884
- proc.on("error", (err) => {
104885
- if (disposed) return;
104886
- const error63 = new FailureError(
104887
- err instanceof Error ? err.message : String(err),
104888
- {
104889
- error_code: FAILURE_CODES.AX_DAEMON_PROCESS_ERROR,
104890
- failure_stage: "ax_service_spawn_process",
104891
- failure_area: "tool_server",
104892
- error_kind: "subprocess"
104893
- },
104894
- { cause: err instanceof Error ? err : new Error(String(err)) }
104895
- );
104896
- failPending(error63);
104897
- events.emit("terminated", error63);
104898
- });
104899
- try {
104900
- daemonSocket = await waitForDaemonConnection(server, proc, 1e4);
104901
- } catch (err) {
104902
- if (!proc.killed) proc.kill("SIGTERM");
104988
+ let proxyStarted = false;
104989
+ const abandonStart = async () => {
104903
104990
  server.close();
104904
104991
  if (endpoint.transport === "unix") {
104905
104992
  try {
@@ -104907,14 +104994,51 @@ var axServiceBlueprint = {
104907
104994
  } catch {
104908
104995
  }
104909
104996
  }
104910
- if (endpoint.transport === "tcp") {
104997
+ if (endpoint.transport === "tcp" && proxyStarted) {
104911
104998
  await host.stopProxy(udid, endpoint.port);
104912
104999
  }
104913
- throw err;
105000
+ };
105001
+ let proc;
105002
+ try {
105003
+ if (endpoint.transport === "tcp") {
105004
+ await host.startProxy(udid, endpoint.port);
105005
+ proxyStarted = true;
105006
+ }
105007
+ proc = host.spawnAxDaemon(udid, endpoint);
105008
+ } catch (err) {
105009
+ await abandonStart();
105010
+ throw startFailed(err);
104914
105011
  }
105012
+ const exited = watchDaemonExit(proc, () => {
105013
+ exitSeen = true;
105014
+ clearTimeout(disconnectTimer);
105015
+ });
105016
+ proc.on("error", (err) => {
105017
+ terminate(
105018
+ new FailureError(
105019
+ err instanceof Error ? err.message : String(err),
105020
+ {
105021
+ error_code: FAILURE_CODES.AX_DAEMON_PROCESS_ERROR,
105022
+ failure_stage: "ax_service_spawn_process",
105023
+ failure_area: "tool_server",
105024
+ error_kind: "subprocess"
105025
+ },
105026
+ { cause: err instanceof Error ? err : new Error(String(err)) }
105027
+ )
105028
+ );
105029
+ });
105030
+ try {
105031
+ daemonSocket = await waitForDaemonConnection(server, proc, exited, 1e4);
105032
+ } catch (err) {
105033
+ if (!proc.killed) proc.kill("SIGTERM");
105034
+ await abandonStart();
105035
+ throw startFailed(err);
105036
+ }
105037
+ void exited.then((exit) => terminate(axDaemonExitError(exit, "connected")));
104915
105038
  function query(command, timeoutMs = 5e3, params) {
104916
105039
  return new Promise((resolve19, reject) => {
104917
- if (!daemonSocket || daemonSocket.destroyed) {
105040
+ const socket = daemonSocket && !daemonSocket.destroyed ? daemonSocket : null;
105041
+ if (!socket && !awaitingVerdict) {
104918
105042
  reject(
104919
105043
  new FailureError("ax-service not connected", {
104920
105044
  error_code: FAILURE_CODES.AX_QUERY_FAILED,
@@ -104940,7 +105064,7 @@ var axServiceBlueprint = {
104940
105064
  }
104941
105065
  }, timeoutMs);
104942
105066
  pendingRpc.set(id, { resolve: resolve19, reject, timer });
104943
- daemonSocket.write(
105067
+ socket?.write(
104944
105068
  JSON.stringify(params === void 0 ? { id, command } : { id, command, params }) + "\n"
104945
105069
  );
104946
105070
  });
@@ -105058,6 +105182,8 @@ var axServiceBlueprint = {
105058
105182
  api,
105059
105183
  dispose: async () => {
105060
105184
  disposed = true;
105185
+ clearTimeout(disconnectTimer);
105186
+ awaitingVerdict = false;
105061
105187
  failPending(new Error("ax-service disposed"));
105062
105188
  if (daemonSocket && !daemonSocket.destroyed) {
105063
105189
  daemonSocket.destroy();
@@ -123212,6 +123338,9 @@ function registerCaptureOnDemandSender(deviceId, endpoint, send) {
123212
123338
  if (entry.onDemand) entry.send(false);
123213
123339
  };
123214
123340
  }
123341
+ function simulatorServerDeviceIds() {
123342
+ return [...servers.keys()];
123343
+ }
123215
123344
  function captureOnDemandDropped(deviceId, endpoint) {
123216
123345
  const server = servers.get(deviceId);
123217
123346
  if (server?.endpoint === endpoint) server.onDemand = false;
@@ -124859,7 +124988,7 @@ var getPaths = () => {
124859
124988
  return { BINARY_PATH, RUN_DIR };
124860
124989
  };
124861
124990
  var READY_TIMEOUT_MS = 3e4;
124862
- var STDERR_DRAIN_MS = 250;
124991
+ var STDERR_DRAIN_MS2 = 250;
124863
124992
  var STDERR_TAIL_LINES = 10;
124864
124993
  var STDERR_MAX_LINE_CHARS = 500;
124865
124994
  var ROUTINE_LOG_LINE = /^\[\S+\s+(?:INFO|DEBUG|TRACE)\s/;
@@ -125055,7 +125184,7 @@ async function spawnSimulatorServerProcess(udid, subcommand) {
125055
125184
  };
125056
125185
  const stderr = proc.stderr;
125057
125186
  if (settled || !stderr || stderr.readableEnded) return fail();
125058
- const drainTimer = setTimeout(fail, STDERR_DRAIN_MS);
125187
+ const drainTimer = setTimeout(fail, STDERR_DRAIN_MS2);
125059
125188
  stderr.once("end", () => {
125060
125189
  clearTimeout(drainTimer);
125061
125190
  fail();
@@ -128427,8 +128556,8 @@ function parseVegaDeviceList(stdout) {
128427
128556
  }
128428
128557
  return devices;
128429
128558
  }
128430
- function filterVvdShadowsFromAndroid(androidDevices, vvdAdbSerials) {
128431
- return androidDevices.filter((d) => !vvdAdbSerials.has(d.serial));
128559
+ function filterVvdShadowsFromAndroid(androidDevices2, vvdAdbSerials) {
128560
+ return androidDevices2.filter((d) => !vvdAdbSerials.has(d.serial));
128432
128561
  }
128433
128562
  async function readVegaInfo() {
128434
128563
  try {
@@ -128603,12 +128732,12 @@ function sortIosRemote(a, b) {
128603
128732
  const bBooted = b.state === "Booted" ? 0 : 1;
128604
128733
  return aBooted - bBooted;
128605
128734
  }
128606
- async function resolveVvdShadowAdbSerials(androidDevices, vega) {
128735
+ async function resolveVvdShadowAdbSerials(androidDevices2, vega) {
128607
128736
  if (!vega.some((d) => d.kind === "vvd" && d.state === "running")) return /* @__PURE__ */ new Set();
128608
128737
  const vvdPorts = await listRunningVvdConsolePorts();
128609
128738
  if (vvdPorts.size === 0) return /* @__PURE__ */ new Set();
128610
128739
  const shadows = /* @__PURE__ */ new Set();
128611
- for (const d of androidDevices) {
128740
+ for (const d of androidDevices2) {
128612
128741
  const port = consolePortFromAdbSerial(d.serial);
128613
128742
  if (port !== null && vvdPorts.has(port)) shadows.add(d.serial);
128614
128743
  }
@@ -129596,7 +129725,8 @@ var DEGRADED_STANDING_HINT = "This simulator was not booted through argent, so s
129596
129725
  function externalCaveat(deviceId, body) {
129597
129726
  return `${externalSupportHint(deviceId) ?? "This device is supplied by an external provider."} ${body}`;
129598
129727
  }
129599
- var EXTERNAL_BLIND_BODY = "The accessibility read returned no elements, and argent cannot reboot this device to apply the pre-boot accessibility settings. Restart it from that application, or take a screenshot to see the screen.";
129728
+ var EXTERNAL_BLIND_TAIL = ", and argent cannot reboot this device to apply the pre-boot accessibility settings. Restart it from that application, or take a screenshot to see the screen.";
129729
+ var EXTERNAL_BLIND_BODY = `The accessibility read returned no elements${EXTERNAL_BLIND_TAIL}`;
129600
129730
  var EXTERNAL_STANDING_BODY = "System dialogs and native modals may not appear in this tree; everything else reads normally. Argent cannot reboot this device to apply the full accessibility settings \u2014 restart it from that application if something you expect is missing.";
129601
129731
  function isStandingCaveat(hint) {
129602
129732
  return hint === DEGRADED_STANDING_HINT || Boolean(hint?.endsWith(EXTERNAL_STANDING_BODY));
@@ -129604,10 +129734,21 @@ function isStandingCaveat(hint) {
129604
129734
  function isBlindCaveat(hint) {
129605
129735
  return hint === DEGRADED_BLIND_HINT || Boolean(hint?.endsWith(EXTERNAL_BLIND_BODY));
129606
129736
  }
129737
+ function startFailure(err) {
129738
+ return `The accessibility service failed to start (${errMsg(err)})`;
129739
+ }
129740
+ var DEGRADED_START_FAILED_TAIL = ", and this simulator was not booted through argent, so the pre-boot accessibility settings were never applied. Call boot-device with force=true to reboot it with those settings \u2014 this restarts the simulator. If it fails to start again after that reboot, do not reboot again: the boot was not the cause.";
129741
+ function axCrashHint(signal) {
129742
+ return `The accessibility service (ax-service) crashed with ${signal}, so the accessibility tree could not be read. Every describe starts the service again. If this hint repeats, the crash is in the service on this host: rebooting the simulator (boot-device with force=true) or restarting the tool-server will not fix it, because both start the same binary again. While it crashes, system dialogs and SpringBoard chrome cannot be read through describe. describe continues on the app's native view hierarchy where that is available, and \`screenshot\` shows the rest.`;
129743
+ }
129744
+ var NATIVE_FALLBACK_LEAD = "The native fallback has no tree for this read, for a reason of its own, unrelated to the crash:";
129607
129745
  var bootCaveatToldDevices = /* @__PURE__ */ new Set();
129746
+ var readFacts = /* @__PURE__ */ new WeakMap();
129608
129747
  function withBootCaveatOncePerDevice(deviceId, data) {
129609
129748
  if (!isStandingCaveat(data.hint)) {
129610
- if (!isBlindCaveat(data.hint)) bootCaveatToldDevices.delete(deviceId);
129749
+ const facts = readFacts.get(data);
129750
+ const stillDegraded = facts?.daemonGone ? facts.degraded !== false : isBlindCaveat(data.hint);
129751
+ if (!stillDegraded) bootCaveatToldDevices.delete(deviceId);
129611
129752
  return data;
129612
129753
  }
129613
129754
  if (!bootCaveatToldDevices.has(deviceId)) {
@@ -129636,6 +129777,12 @@ function lendsNativeDevtools(deviceId) {
129636
129777
  }
129637
129778
  var iosRequires = ["xcrun"];
129638
129779
  async function describeIos(registry2, device, params, options = {}) {
129780
+ const facts = {};
129781
+ const data = await readIos(registry2, device, params, options, facts);
129782
+ readFacts.set(data, facts);
129783
+ return data;
129784
+ }
129785
+ async function readIos(registry2, device, params, options, facts) {
129639
129786
  const isTvOs = options.isTvOs ?? await isTvOsSimulator(device.id);
129640
129787
  if (isTvOs) {
129641
129788
  return { tree: emptyTree(), source: "ax-service", hint: TVOS_HINT };
@@ -129644,38 +129791,59 @@ async function describeIos(registry2, device, params, options = {}) {
129644
129791
  let degraded;
129645
129792
  let resolverHint;
129646
129793
  let readFailureHint;
129794
+ let startFailureHint;
129795
+ let crashSignal;
129647
129796
  let axApi;
129648
129797
  try {
129649
129798
  const axRef = axServiceRef(device);
129650
129799
  axApi = await registry2.resolveService(axRef.urn, axRef.options);
129651
129800
  degraded = axApi.degraded;
129801
+ facts.degraded = degraded;
129652
129802
  } catch (err) {
129653
129803
  if (isFirstLaunchRefusal(err)) throw err;
129654
129804
  resolverHint = tcpArtifactHint(err);
129655
- degraded = resolverHint === void 0;
129805
+ crashSignal = axDaemonCrashSignal(err);
129806
+ facts.degraded = axStartFailureDegraded(err);
129807
+ const explained = resolverHint !== void 0 || crashSignal !== void 0;
129808
+ degraded = !explained && facts.degraded !== false;
129809
+ if (!explained) {
129810
+ facts.daemonGone = true;
129811
+ startFailureHint = !degraded ? `${startFailure(err)}.` : isExternalId(device.id) ? externalCaveat(device.id, `${startFailure(err)}${EXTERNAL_BLIND_TAIL}`) : `${startFailure(err)}${DEGRADED_START_FAILED_TAIL}`;
129812
+ }
129656
129813
  }
129657
129814
  if (axApi) {
129658
129815
  try {
129659
129816
  tree = adaptAXDescribeToDescribeResult(await axApi.describe());
129660
129817
  } catch (err) {
129661
- readFailureHint = `The accessibility read failed (${errMsg(err)}).`;
129818
+ crashSignal = axDaemonCrashSignal(err);
129819
+ if (crashSignal === void 0) {
129820
+ readFailureHint = `The accessibility read failed (${errMsg(err)}).`;
129821
+ }
129662
129822
  }
129663
129823
  }
129664
- const degradedHint = !degraded ? void 0 : tree.children.length === 0 ? DEGRADED_BLIND_HINT : DEGRADED_STANDING_HINT;
129824
+ const crashHint = crashSignal === void 0 ? void 0 : axCrashHint(crashSignal);
129825
+ if (crashHint !== void 0) facts.daemonGone = true;
129826
+ const degradedHint = !degraded || crashHint !== void 0 || startFailureHint !== void 0 ? void 0 : tree.children.length === 0 ? DEGRADED_BLIND_HINT : DEGRADED_STANDING_HINT;
129665
129827
  const deviceDegradedHint = degradedHint !== void 0 && isExternalId(device.id) ? externalCaveat(
129666
129828
  device.id,
129667
129829
  degradedHint === DEGRADED_BLIND_HINT ? EXTERNAL_BLIND_BODY : EXTERNAL_STANDING_BODY
129668
129830
  ) : degradedHint;
129669
- const hint = resolverHint ?? (readFailureHint ? deviceDegradedHint ? `${deviceDegradedHint}. ${readFailureHint}` : readFailureHint : deviceDegradedHint);
129831
+ const hint = resolverHint ?? crashHint ?? startFailureHint ?? (readFailureHint ? deviceDegradedHint ? `${deviceDegradedHint}. ${readFailureHint}` : readFailureHint : deviceDegradedHint);
129670
129832
  if (tree.children.length > 0) {
129671
129833
  return { tree, source: "ax-service", hint };
129672
129834
  }
129835
+ const daemonGoneHint = crashHint ?? (degraded ? void 0 : startFailureHint);
129673
129836
  if (params.bundleId && !isInjectableBundleId(params.bundleId)) {
129674
- return { tree, source: "ax-service", hint: hint ?? NON_INJECTABLE_HINT };
129837
+ return {
129838
+ tree,
129839
+ source: "ax-service",
129840
+ hint: daemonGoneHint ? `${daemonGoneHint} ${NON_INJECTABLE_HINT}` : hint ?? NON_INJECTABLE_HINT
129841
+ };
129675
129842
  }
129676
129843
  if (isExternalId(device.id) && !lendsNativeDevtools(device.id)) {
129844
+ const provider = externalSupportHint(device.id) ?? "This device is supplied by an external provider.";
129677
129845
  return {
129678
- hint: hint ?? `${externalSupportHint(device.id) ?? "This device is supplied by an external provider."} The native view-hierarchy fallback is unavailable on it, so an empty tree here means the accessibility tree itself was empty. Take a screenshot to see the screen.`,
129846
+ hint: daemonGoneHint ? `${daemonGoneHint} ${provider} The native view-hierarchy fallback is unavailable on it. Take a screenshot to see the screen.` : hint ?? `${provider} The native view-hierarchy fallback is unavailable on it, so an empty tree here means the accessibility tree itself was empty. Take a screenshot to see the screen.`,
129679
129847
  source: "ax-service",
129680
129848
  tree
129681
129849
  };
@@ -129695,7 +129863,7 @@ async function describeIos(registry2, device, params, options = {}) {
129695
129863
  });
129696
129864
  if (state3 !== "connected") {
129697
129865
  const diagnosis = buildAppStateMessage(target.bundleId, state3);
129698
- const merged = hint ? `${hint} ${diagnosis}` : diagnosis;
129866
+ const merged = crashHint ? `${crashHint} ${NATIVE_FALLBACK_LEAD} ${diagnosis}` : hint ? `${hint} ${diagnosis}` : diagnosis;
129699
129867
  return state3 === "unregistered" || state3 === "connecting" ? { tree, source: "ax-service", hint: merged } : { tree, source: "ax-service", should_restart: true, hint: merged };
129700
129868
  }
129701
129869
  const rawResult = await nativeApi.queryViewHierarchy(
@@ -145449,8 +145617,14 @@ function findAndroidNativeRecord(id) {
145449
145617
  function liveAndroidNetworkCaptures(deviceId) {
145450
145618
  return [...liveInspectors.get(deviceKeyOf(deviceId)) ?? []].filter((handle) => handle.isLive()).map((handle) => handle.packageName).sort();
145451
145619
  }
145620
+ function liveAndroidNetworkCaptureSerials() {
145621
+ return liveCaptureSerials(() => true);
145622
+ }
145452
145623
  function liveAndroidNetworkCaptureDevices(packageName) {
145453
- const serials = allHandles().filter((handle) => handle.packageName === packageName && handle.isLive()).map((handle) => handle.serial);
145624
+ return liveCaptureSerials((handle) => handle.packageName === packageName);
145625
+ }
145626
+ function liveCaptureSerials(matches2) {
145627
+ const serials = allHandles().filter((handle) => matches2(handle) && handle.isLive()).map((handle) => handle.serial);
145454
145628
  return [...new Set(serials)].sort();
145455
145629
  }
145456
145630
  async function attachAndroidNetworkInspectorToLaunch(deviceId, packageName) {
@@ -162259,7 +162433,12 @@ init_adb();
162259
162433
  var execFileAsync35 = (0, import_node_util35.promisify)(import_node_child_process46.execFile);
162260
162434
  var LOG_READ_TIMEOUT_MS = 5e3;
162261
162435
  var RETRY_DELAY_MS = 300;
162262
- async function findRuntimeDevice(cdp) {
162436
+ var OTHER_TRANSPORTS_GRACE_MS = 500;
162437
+ var NOT_FOUND = { found: [], unresolved: [] };
162438
+ async function findRuntimeDevices(cdp, {
162439
+ awaitSerials = [],
162440
+ waitSerials = []
162441
+ } = {}) {
162263
162442
  const marker = `argent-device-probe:${(0, import_node_crypto15.randomUUID)()}`;
162264
162443
  const logged = await cdp.evaluate(
162265
162444
  `(function () {
@@ -162268,30 +162447,88 @@ async function findRuntimeDevice(cdp) {
162268
162447
  return true;
162269
162448
  })()`
162270
162449
  ).catch(() => false);
162271
- if (logged !== true) return void 0;
162450
+ if (logged !== true) return NOT_FOUND;
162272
162451
  const checks = [
162273
- async () => firstFound((await androidSerials()).map((serial) => () => logcatHolds(serial, marker))),
162274
- async () => firstFound((await bootedSimulators()).map((udid) => () => simulatorLogHolds(udid, marker)))
162452
+ async () => androidDevices(await androidSerials(), marker, awaitSerials, waitSerials),
162453
+ async () => {
162454
+ const udids = await bootedSimulators();
162455
+ const udid = await firstFound(udids.map((udid2) => () => simulatorLogHolds(udid2, marker)));
162456
+ return udid === void 0 ? void 0 : { found: [udid], unresolved: [] };
162457
+ }
162275
162458
  ];
162276
162459
  for (let attempt = 0; attempt < 2; attempt++) {
162277
162460
  if (attempt > 0) await new Promise((r) => setTimeout(r, RETRY_DELAY_MS));
162278
162461
  const found = await firstFound(checks);
162279
162462
  if (found !== void 0) return found;
162280
162463
  }
162281
- return void 0;
162464
+ return NOT_FOUND;
162282
162465
  }
162283
162466
  function firstFound(checks) {
162284
162467
  return new Promise((resolve19) => {
162285
162468
  let left = checks.length;
162286
162469
  if (left === 0) resolve19(void 0);
162287
162470
  for (const check3 of checks) {
162288
- void check3().then((id) => {
162289
- if (id !== void 0) resolve19(id);
162471
+ void check3().then((value) => {
162472
+ if (value !== void 0) resolve19(value);
162290
162473
  else if (--left === 0) resolve19(void 0);
162291
162474
  });
162292
162475
  }
162293
162476
  });
162294
162477
  }
162478
+ async function androidDevices(serials, marker, awaitSerials, waitSerials) {
162479
+ const listed = [...new Set(serials)];
162480
+ const awaited = listed.filter(
162481
+ (serial) => awaitSerials.includes(serial) || waitSerials.includes(serial)
162482
+ );
162483
+ const answers = /* @__PURE__ */ new Map();
162484
+ await new Promise((resolve19) => {
162485
+ let graceOver = false;
162486
+ let grace;
162487
+ const settle3 = () => {
162488
+ const held = heldSerials(answers);
162489
+ const waitingOn = listed.filter(
162490
+ (serial) => !answers.has(serial) && (!graceOver || awaited.includes(serial)) && !held.some((found2) => anotherDevice(serial, found2))
162491
+ );
162492
+ if (waitingOn.length === 0) {
162493
+ clearTimeout(grace);
162494
+ resolve19();
162495
+ }
162496
+ };
162497
+ settle3();
162498
+ for (const serial of listed) {
162499
+ void logcatHolds(serial, marker).then((read) => {
162500
+ answers.set(serial, read);
162501
+ if (read === "held") {
162502
+ grace ??= setTimeout(() => {
162503
+ graceOver = true;
162504
+ settle3();
162505
+ }, OTHER_TRANSPORTS_GRACE_MS);
162506
+ }
162507
+ settle3();
162508
+ });
162509
+ }
162510
+ });
162511
+ const found = heldSerials(answers);
162512
+ if (found.length === 0) return void 0;
162513
+ const unresolved = [...new Set(awaitSerials)].filter(
162514
+ (serial) => (!listed.includes(serial) || answers.get(serial) === "failed") && !found.some((device) => anotherDevice(serial, device))
162515
+ );
162516
+ return { found, unresolved };
162517
+ }
162518
+ function heldSerials(answers) {
162519
+ return [...answers].filter(([, read]) => read === "held").map(([serial]) => serial);
162520
+ }
162521
+ function anotherDevice(a, b) {
162522
+ if (a === b) return false;
162523
+ const portA = consolePortFromAdbSerial(a);
162524
+ const portB = consolePortFromAdbSerial(b);
162525
+ if (portA !== null && portB !== null) return portA !== portB;
162526
+ if (isUsbSerial(a) && isUsbSerial(b)) return true;
162527
+ return portA !== null && isUsbSerial(b) || portB !== null && isUsbSerial(a);
162528
+ }
162529
+ function isUsbSerial(serial) {
162530
+ return !serial.startsWith("emulator-") && !serial.includes(":") && !serial.includes("._");
162531
+ }
162295
162532
  async function androidSerials() {
162296
162533
  try {
162297
162534
  const { stdout } = await runAdb(["devices"], { timeoutMs: ADB_DEVICES_TIMEOUT_MS });
@@ -162310,9 +162547,9 @@ async function logcatHolds(serial, marker) {
162310
162547
  ["-s", serial, "logcat", "-d", "-s", "ReactNativeJS", "-e", marker],
162311
162548
  { timeoutMs: LOG_READ_TIMEOUT_MS }
162312
162549
  );
162313
- return stdout.includes(marker) ? serial : void 0;
162550
+ return stdout.includes(marker) ? "held" : "absent";
162314
162551
  } catch {
162315
- return void 0;
162552
+ return "failed";
162316
162553
  }
162317
162554
  }
162318
162555
  async function simulatorLogHolds(udid, marker) {
@@ -162341,6 +162578,9 @@ async function simulatorLogHolds(udid, marker) {
162341
162578
  }
162342
162579
  }
162343
162580
 
162581
+ // ../tool-server/src/tools/profiler/react/react-profiler-start.ts
162582
+ init_external_devices();
162583
+
162344
162584
  // ../tool-server/src/utils/react-profiler/devtools-bootstrap.ts
162345
162585
  function bootstrapFailureMessage(bootstrap) {
162346
162586
  switch (bootstrap.reason) {
@@ -162362,17 +162602,47 @@ function bootstrapFailureMessage(bootstrap) {
162362
162602
 
162363
162603
  // ../tool-server/src/utils/profiler-shared/network-capture-warning.ts
162364
162604
  var CAPTURE_COST = "It can slow the app, so the timings in this profile can differ from a run without it.";
162365
- function nativeNetworkCaptureWarning(deviceId, runtimeApp) {
162366
- let packages;
162605
+ function nativeNetworkCaptureWarning(deviceId, runtimeApp, runtimeDevices = { found: [], unresolved: [] }) {
162367
162606
  try {
162368
- packages = liveAndroidNetworkCaptures(deviceId);
162607
+ if (runtimeDevices.found.length > 0) {
162608
+ return foundDeviceWarning(runtimeDevices, runtimeApp);
162609
+ }
162610
+ const packages = liveAndroidNetworkCaptures(deviceId);
162369
162611
  if (packages.length === 0) return logicalDeviceWarning(deviceId, runtimeApp);
162612
+ const apps = packages.join(", ");
162613
+ const one = packages.length === 1;
162614
+ return `Native network capture is on for ${apps} on this device: Argent attaches its in-app agent to the processes of ${one ? "that app" : "these apps"}. ${CAPTURE_COST} To profile without it, stop this profile, call native-network-logs with stop: true for ${one ? "that app" : "each of these apps"}, then restart-app and profile again.`;
162370
162615
  } catch {
162371
162616
  return void 0;
162372
162617
  }
162373
- const apps = packages.join(", ");
162374
- const one = packages.length === 1;
162375
- return `Native network capture is on for ${apps} on this device: Argent attaches its in-app agent to the processes of ${one ? "that app" : "these apps"}. ${CAPTURE_COST} To profile without it, stop this profile, call native-network-logs with stop: true for ${one ? "that app" : "each of these apps"}, then restart-app and profile again.`;
162618
+ }
162619
+ function foundDeviceWarning({ found, unresolved }, runtimeApp) {
162620
+ const captures = found.map((device) => ({ device, packages: liveAndroidNetworkCaptures(device) })).filter(({ packages }) => packages.length > 0);
162621
+ const appId = runtimeApp?.platform === "android" ? runtimeApp.appId : void 0;
162622
+ const maybe = appId ? unresolved.filter((serial) => liveAndroidNetworkCaptures(serial).includes(appId)) : [];
162623
+ const first = captures[0];
162624
+ if (!first && (!appId || maybe.length === 0)) return void 0;
162625
+ const sentences = [];
162626
+ if (first) {
162627
+ const apps = [...new Set(captures.flatMap(({ packages }) => packages))].sort();
162628
+ const where = captures.length === 1 ? `${first.device}, the device this profile runs on` : `${captures.map(({ device }) => device).join(" and ")}, adb serials of the device this profile runs on`;
162629
+ sentences.push(
162630
+ `Native network capture is on for ${apps.join(", ")} on ${where}: Argent attaches its in-app agent to the processes of ${apps.length === 1 ? "that app" : "these apps"}.`
162631
+ );
162632
+ }
162633
+ if (appId && maybe.length > 0) {
162634
+ const one = maybe.length === 1;
162635
+ sentences.push(
162636
+ `Native network capture is ${first ? "also " : ""}on for ${appId} on ${maybe.join(", ")}, ${one ? "which" : "each of which"} may also be the device this profile runs on: ${one ? "its logcat" : "their logcats"} could not be read to tell. Argent attaches its in-app agent to the processes of that app there.`
162637
+ );
162638
+ }
162639
+ const stops = [
162640
+ ...captures.flatMap(({ device, packages }) => packages.map((app) => ({ app, device }))),
162641
+ ...appId ? maybe.map((device) => ({ app: appId, device })) : []
162642
+ ];
162643
+ const stop = first && captures.length === 1 && maybe.length === 0 ? `with udid ${first.device} and stop: true for ${first.packages.length === 1 ? "that app" : "each of these apps"}` : `with stop: true for ${stops.map(({ app, device }) => `${app} with udid ${device}`).join(", ")}`;
162644
+ const restart = first?.device ?? found[0];
162645
+ return `${sentences.join(" ")} ${CAPTURE_COST} To profile without it, stop this profile, call native-network-logs ${stop}, then restart-app on ${restart} and profile again.`;
162376
162646
  }
162377
162647
  function logicalDeviceWarning(deviceId, runtimeApp) {
162378
162648
  const appId = runtimeApp?.appId;
@@ -162429,6 +162699,25 @@ function failedTakeoverText({ session_id, reason: reason2 }) {
162429
162699
  const run2 = session_id ? `session ${session_id}` : "a recording with no owner record";
162430
162700
  return `Before it failed, this start stopped ${run2} (reason: ${reason2}), and nothing is recording now.`;
162431
162701
  }
162702
+ function findProfiledDevices(cdp) {
162703
+ return findRuntimeDevices(cdp, {
162704
+ awaitSerials: idsOf(liveAndroidNetworkCaptureSerials),
162705
+ waitSerials: idsOf(simulatorServerDeviceIds).map(externalNativeId)
162706
+ });
162707
+ }
162708
+ function trackedIds(found) {
162709
+ const driven = idsOf(simulatorServerDeviceIds).filter(
162710
+ (id) => found.includes(externalNativeId(id))
162711
+ );
162712
+ return [.../* @__PURE__ */ new Set([...found, ...driven])];
162713
+ }
162714
+ function idsOf(lookup) {
162715
+ try {
162716
+ return lookup();
162717
+ } catch {
162718
+ return [];
162719
+ }
162720
+ }
162432
162721
  function safeGetState(registry2, urn) {
162433
162722
  try {
162434
162723
  return registry2.getServiceState(urn);
@@ -162629,7 +162918,7 @@ Fails if the Hermes runtime is not reachable or the Metro CDP connection cannot
162629
162918
  }
162630
162919
  await cdp.send("Profiler.stop").catch(ignore);
162631
162920
  api.profilingActive = false;
162632
- const runtimeDevice = isLogicalKeyedDevice(api.deviceId) ? await findRuntimeDevice(cdp) : void 0;
162921
+ const runtimeDevices = isLogicalKeyedDevice(api.deviceId) ? await findProfiledDevices(cdp) : { found: [], unresolved: [] };
162633
162922
  const sessionId = crypto6.randomUUID();
162634
162923
  const ownerPayload = {
162635
162924
  sessionId,
@@ -162712,8 +163001,8 @@ Fails if the Hermes runtime is not reachable or the Metro CDP connection cannot
162712
163001
  api.sessionId = sessionId;
162713
163002
  api.ownerToolServerPid = process.pid;
162714
163003
  trackProfilingRun(api.deviceId, api);
162715
- if (runtimeDevice) trackProfilingRun(runtimeDevice, api);
162716
- const warning = nativeNetworkCaptureWarning(deviceId ?? params.device_id, api.runtimeApp);
163004
+ for (const device of trackedIds(runtimeDevices.found)) trackProfilingRun(device, api);
163005
+ const warning = nativeNetworkCaptureWarning(api.deviceId, api.runtimeApp, runtimeDevices);
162717
163006
  return {
162718
163007
  started_at: new Date(startedAtEpochMs).toISOString(),
162719
163008
  startedAtEpochMs,
@@ -162721,7 +163010,7 @@ Fails if the Hermes runtime is not reachable or the Metro CDP connection cannot
162721
163010
  detected_architecture: api.detectedArchitecture,
162722
163011
  ...tookOver ? { took_over: tookOver } : {},
162723
163012
  ...warning ? { warning } : {},
162724
- ...isLogicalKeyedDevice(api.deviceId) && !runtimeDevice ? { [RESULT_NOTE_KEY]: UNKNOWN_DEVICE_NOTE } : {}
163013
+ ...isLogicalKeyedDevice(api.deviceId) && runtimeDevices.found.length === 0 ? { [RESULT_NOTE_KEY]: UNKNOWN_DEVICE_NOTE } : {}
162725
163014
  };
162726
163015
  }
162727
163016
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.34.1-next.2",
3
+ "version": "0.34.1-next.4",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
6
6
  "license": "Apache-2.0",