@swmansion/argent 0.16.1-next.11 → 0.16.1-next.3

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
@@ -6226,7 +6226,6 @@ var FAILURE_CODES = {
6226
6226
  NATIVE_DEVTOOLS_RPC_TIMEOUT: "NATIVE_DEVTOOLS_RPC_TIMEOUT",
6227
6227
  NATIVE_DEVTOOLS_RPC_ERROR: "NATIVE_DEVTOOLS_RPC_ERROR",
6228
6228
  NATIVE_DEVTOOLS_SERVICE_DISPOSED: "NATIVE_DEVTOOLS_SERVICE_DISPOSED",
6229
- NATIVE_DEVTOOLS_SOCKET_BIND_FAILED: "NATIVE_DEVTOOLS_SOCKET_BIND_FAILED",
6230
6229
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
6231
6230
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
6232
6231
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -8424,11 +8423,6 @@ var STATUS_GLYPH = {
8424
8423
  error: "\u2717",
8425
8424
  skip: "\xB7"
8426
8425
  };
8427
- var MAX_RENDER_DEPTH = 20;
8428
- function stepIndent(depth) {
8429
- if (typeof depth !== "number" || !Number.isInteger(depth) || depth <= 0) return "";
8430
- return " ".repeat(Math.min(depth, MAX_RENDER_DEPTH));
8431
- }
8432
8426
  function printHelp() {
8433
8427
  console.log(`Usage: argent flow <subcommand> [options]
8434
8428
 
@@ -8497,12 +8491,11 @@ function parseRunArgs(argv) {
8497
8491
  }
8498
8492
  function renderEchoLine(s) {
8499
8493
  if (!s.message) return void 0;
8500
- const indent = stepIndent(s.depth);
8501
8494
  if (s.status === "skip") {
8502
8495
  const reason = s.reason ? ` \u2014 ${s.reason}` : "";
8503
- return ` ${STATUS_GLYPH.skip} ${indent}\u203A ${s.message}${reason}`;
8496
+ return ` ${STATUS_GLYPH.skip} \u203A ${s.message}${reason}`;
8504
8497
  }
8505
- return ` ${indent}\u203A ${s.message}`;
8498
+ return ` \u203A ${s.message}`;
8506
8499
  }
8507
8500
  function renderStepLine(s, n2, topFlow) {
8508
8501
  const where = s.flow && s.flow !== topFlow ? ` [${s.flow}]` : "";
@@ -8510,10 +8503,7 @@ function renderStepLine(s, n2, topFlow) {
8510
8503
  const label = what ? `${s.kind} ${what}` : s.kind;
8511
8504
  const reason = s.reason ? ` \u2014 ${s.reason}` : "";
8512
8505
  const glyph = s.status === "pass" && s.warning ? "\u26A0" : STATUS_GLYPH[s.status];
8513
- return ` ${glyph} ${String(n2).padStart(2)} ${stepIndent(s.depth)}${label}${where}${reason}`;
8514
- }
8515
- function renderUnderStepLine(s, n2, text2) {
8516
- return `${" ".repeat(5 + Math.max(2, String(n2).length))}${stepIndent(s.depth)}${text2}`;
8506
+ return ` ${glyph} ${String(n2).padStart(2)} ${label}${where}${reason}`;
8517
8507
  }
8518
8508
  function renderSummary(report, opts = {}) {
8519
8509
  const warnings = report.steps.filter((s) => s.warning).length;
@@ -8600,10 +8590,10 @@ function renderReport(report) {
8600
8590
  }
8601
8591
  n2++;
8602
8592
  lines.push(renderStepLine(s, n2, report.flow));
8603
- if (s.warning) lines.push(renderUnderStepLine(s, n2, `\u26A0 ${s.warning}`));
8593
+ if (s.warning) lines.push(` \u26A0 ${s.warning}`);
8604
8594
  if (s.artifacts && typeof s.artifacts === "object") {
8605
8595
  for (const [k, v] of Object.entries(s.artifacts)) {
8606
- if (typeof v === "string") lines.push(renderUnderStepLine(s, n2, `${k}: ${v}`));
8596
+ if (typeof v === "string") lines.push(` ${k}: ${v}`);
8607
8597
  }
8608
8598
  }
8609
8599
  }
@@ -8678,7 +8668,7 @@ async function flow(argv, options) {
8678
8668
  }
8679
8669
  liveIndex++;
8680
8670
  console.log(renderStepLine(s, liveIndex, flowName));
8681
- if (s.warning) console.log(renderUnderStepLine(s, liveIndex, `\u26A0 ${s.warning}`));
8671
+ if (s.warning) console.log(` \u26A0 ${s.warning}`);
8682
8672
  };
8683
8673
  let report;
8684
8674
  try {
@@ -16120,7 +16120,6 @@ var FAILURE_CODES = {
16120
16120
  NATIVE_DEVTOOLS_RPC_TIMEOUT: "NATIVE_DEVTOOLS_RPC_TIMEOUT",
16121
16121
  NATIVE_DEVTOOLS_RPC_ERROR: "NATIVE_DEVTOOLS_RPC_ERROR",
16122
16122
  NATIVE_DEVTOOLS_SERVICE_DISPOSED: "NATIVE_DEVTOOLS_SERVICE_DISPOSED",
16123
- NATIVE_DEVTOOLS_SOCKET_BIND_FAILED: "NATIVE_DEVTOOLS_SOCKET_BIND_FAILED",
16124
16123
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
16125
16124
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
16126
16125
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -17652,7 +17652,6 @@ var FAILURE_CODES = {
17652
17652
  NATIVE_DEVTOOLS_RPC_TIMEOUT: "NATIVE_DEVTOOLS_RPC_TIMEOUT",
17653
17653
  NATIVE_DEVTOOLS_RPC_ERROR: "NATIVE_DEVTOOLS_RPC_ERROR",
17654
17654
  NATIVE_DEVTOOLS_SERVICE_DISPOSED: "NATIVE_DEVTOOLS_SERVICE_DISPOSED",
17655
- NATIVE_DEVTOOLS_SOCKET_BIND_FAILED: "NATIVE_DEVTOOLS_SOCKET_BIND_FAILED",
17656
17655
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
17657
17656
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
17658
17657
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -18897,11 +18896,6 @@ var STATUS_GLYPH = {
18897
18896
  error: "\u2717",
18898
18897
  skip: "\xB7"
18899
18898
  };
18900
- var MAX_RENDER_DEPTH = 20;
18901
- function stepIndent(depth) {
18902
- if (typeof depth !== "number" || !Number.isInteger(depth) || depth <= 0) return "";
18903
- return " ".repeat(Math.min(depth, MAX_RENDER_DEPTH));
18904
- }
18905
18899
  function stepLabel(step) {
18906
18900
  if (step.kind === "echo") return step.message ?? "";
18907
18901
  if (step.kind === "run") return `run ${step.flow ?? ""}`.trim();
@@ -18925,15 +18919,12 @@ async function flowRunToMcpContent(result, ctx) {
18925
18919
  const reason = step.reason ?? step.error;
18926
18920
  const suffix = reason ? ` \u2014 ${reason}` : "";
18927
18921
  const warning = step.warning ? ` \u26A0 ${step.warning}` : "";
18928
- blocks.push({
18929
- type: "text",
18930
- text: `[${num}] ${glyph}${stepIndent(step.depth)}${stepLabel(step)}${suffix}${warning}`
18931
- });
18922
+ blocks.push({ type: "text", text: `[${num}] ${glyph}${stepLabel(step)}${suffix}${warning}` });
18932
18923
  if (step.result !== void 0) {
18933
18924
  blocks.push(...await toMcpContent(step.result, step.outputHint, ctx, step.args));
18934
18925
  }
18935
18926
  if (isRecord(step.artifacts)) {
18936
- blocks.push(...await stepArtifactBlocks(step.artifacts, step.status, ctx, step.depth));
18927
+ blocks.push(...await stepArtifactBlocks(step.artifacts, step.status, ctx));
18937
18928
  }
18938
18929
  }
18939
18930
  if (result.ok !== void 0) {
@@ -18946,7 +18937,7 @@ async function flowRunToMcpContent(result, ctx) {
18946
18937
  }
18947
18938
  return blocks;
18948
18939
  }
18949
- async function stepArtifactBlocks(artifacts, status, ctx, depth) {
18940
+ async function stepArtifactBlocks(artifacts, status, ctx) {
18950
18941
  const failed = status === "fail" || status === "error";
18951
18942
  const entries = [];
18952
18943
  let diffImage;
@@ -18962,8 +18953,7 @@ async function stepArtifactBlocks(artifacts, status, ctx, depth) {
18962
18953
  entries.push([k, v]);
18963
18954
  }
18964
18955
  }
18965
- const indent = stepIndent(depth);
18966
- const blocks = entries.length > 0 ? [{ type: "text", text: entries.map(([k, v]) => ` ${indent}${k}: ${v}`).join("\n") }] : [];
18956
+ const blocks = entries.length > 0 ? [{ type: "text", text: entries.map(([k, v]) => ` ${k}: ${v}`).join("\n") }] : [];
18967
18957
  if (diffImage) blocks.push(diffImage);
18968
18958
  return blocks;
18969
18959
  }
@@ -293,7 +293,6 @@ var init_failure_codes = __esm({
293
293
  NATIVE_DEVTOOLS_RPC_TIMEOUT: "NATIVE_DEVTOOLS_RPC_TIMEOUT",
294
294
  NATIVE_DEVTOOLS_RPC_ERROR: "NATIVE_DEVTOOLS_RPC_ERROR",
295
295
  NATIVE_DEVTOOLS_SERVICE_DISPOSED: "NATIVE_DEVTOOLS_SERVICE_DISPOSED",
296
- NATIVE_DEVTOOLS_SOCKET_BIND_FAILED: "NATIVE_DEVTOOLS_SOCKET_BIND_FAILED",
297
296
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
298
297
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
299
298
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -105218,7 +105217,7 @@ async function shutdown(timeoutMs = SHORT_FLUSH_TIMEOUT_MS) {
105218
105217
  // ../tool-server/src/http.ts
105219
105218
  var import_express3 = __toESM(require_express2());
105220
105219
  var import_bytes2 = __toESM(require_bytes());
105221
- var import_node_fs11 = require("node:fs");
105220
+ var import_node_fs10 = require("node:fs");
105222
105221
  var import_promises9 = require("node:fs/promises");
105223
105222
  var import_node_os8 = require("node:os");
105224
105223
  var import_node_path9 = require("node:path");
@@ -105269,7 +105268,7 @@ init_android_binary();
105269
105268
  // ../tool-server/src/utils/vega-cli.ts
105270
105269
  var import_node_child_process4 = require("node:child_process");
105271
105270
  var import_node_util3 = require("node:util");
105272
- var import_node_fs5 = require("node:fs");
105271
+ var import_node_fs4 = require("node:fs");
105273
105272
  var import_promises3 = require("node:fs/promises");
105274
105273
  var import_node_os3 = require("node:os");
105275
105274
  var import_node_path3 = require("node:path");
@@ -105279,9 +105278,7 @@ init_subprocess_error();
105279
105278
  // ../tool-server/src/utils/vega-process.ts
105280
105279
  var import_node_child_process3 = require("node:child_process");
105281
105280
  var import_node_util2 = require("node:util");
105282
- var import_node_fs4 = require("node:fs");
105283
105281
  var execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process3.execFile);
105284
- var PS_BIN = ["/bin/ps", "/usr/bin/ps"].find((p) => (0, import_node_fs4.existsSync)(p)) ?? "ps";
105285
105282
  var PS_ARGS = ["-A", "-ww", "-o", "command="];
105286
105283
  var PS_ARGS_WITH_PID = ["-A", "-ww", "-o", "pid=,command="];
105287
105284
  var VVD_PROCESS_RE = /(?:^|\/)(?:vega|kepler)-virtual-device(?:\s|$)/;
@@ -105315,7 +105312,7 @@ function parseVvdPids(psOutput) {
105315
105312
  }
105316
105313
  async function listRunningVvdConsolePorts() {
105317
105314
  try {
105318
- const { stdout } = await execFileAsync2(PS_BIN, [...PS_ARGS], {
105315
+ const { stdout } = await execFileAsync2("ps", [...PS_ARGS], {
105319
105316
  timeout: VVD_PS_PROBE_TIMEOUT_MS,
105320
105317
  maxBuffer: 16 * 1024 * 1024
105321
105318
  });
@@ -105330,7 +105327,7 @@ async function listRunningVvdConsolePorts() {
105330
105327
  }
105331
105328
  async function listRunningVvdPids() {
105332
105329
  try {
105333
- const { stdout } = await execFileAsync2(PS_BIN, [...PS_ARGS_WITH_PID], {
105330
+ const { stdout } = await execFileAsync2("ps", [...PS_ARGS_WITH_PID], {
105334
105331
  timeout: 5e3,
105335
105332
  maxBuffer: 16 * 1024 * 1024
105336
105333
  });
@@ -105350,7 +105347,7 @@ var VEGA_BINARY_TTL_MS = 6e4;
105350
105347
  var cachedVegaBinary;
105351
105348
  async function isExecutable(p) {
105352
105349
  try {
105353
- await (0, import_promises3.access)(p, import_node_fs5.constants.X_OK);
105350
+ await (0, import_promises3.access)(p, import_node_fs4.constants.X_OK);
105354
105351
  return true;
105355
105352
  } catch {
105356
105353
  return false;
@@ -105413,15 +105410,10 @@ async function reapVegaGroup(child) {
105413
105410
  }
105414
105411
  }
105415
105412
  async function collectDescendantPids(rootPid) {
105416
- let stdout;
105417
- try {
105418
- ({ stdout } = await execFileAsync3(PS_BIN, ["-A", "-o", "pid=,ppid="], {
105419
- timeout: 1500,
105420
- maxBuffer: 16 * 1024 * 1024
105421
- }));
105422
- } catch {
105423
- return [];
105424
- }
105413
+ const { stdout } = await execFileAsync3("ps", ["-A", "-o", "pid=,ppid="], {
105414
+ timeout: 1500,
105415
+ maxBuffer: 16 * 1024 * 1024
105416
+ });
105425
105417
  const childrenByParent = /* @__PURE__ */ new Map();
105426
105418
  for (const line of stdout.split("\n")) {
105427
105419
  const m = line.trim().match(/^(\d+)\s+(\d+)$/);
@@ -105447,15 +105439,10 @@ async function collectDescendantPids(rootPid) {
105447
105439
  return descendants;
105448
105440
  }
105449
105441
  async function pgidMembers(pgid) {
105450
- let stdout;
105451
- try {
105452
- ({ stdout } = await execFileAsync3(PS_BIN, ["-A", "-o", "pid=,pgid="], {
105453
- timeout: 1500,
105454
- maxBuffer: 16 * 1024 * 1024
105455
- }));
105456
- } catch {
105457
- return [];
105458
- }
105442
+ const { stdout } = await execFileAsync3("ps", ["-A", "-o", "pid=,pgid="], {
105443
+ timeout: 1500,
105444
+ maxBuffer: 16 * 1024 * 1024
105445
+ });
105459
105446
  const members = [];
105460
105447
  for (const line of stdout.split("\n")) {
105461
105448
  const m = line.trim().match(/^(\d+)\s+(\d+)$/);
@@ -105480,7 +105467,7 @@ async function reapLingeringGroupMembers(pid) {
105480
105467
  } catch {
105481
105468
  }
105482
105469
  }
105483
- function resolveSpawnCwd(getCwd = () => process.cwd(), dirExists = import_node_fs5.existsSync, fallback = (0, import_node_os3.tmpdir)()) {
105470
+ function resolveSpawnCwd(getCwd = () => process.cwd(), dirExists = import_node_fs4.existsSync, fallback = (0, import_node_os3.tmpdir)()) {
105484
105471
  try {
105485
105472
  const cwd = getCwd();
105486
105473
  if (dirExists(cwd)) return cwd;
@@ -105771,7 +105758,7 @@ function toSimulatorNetworkError(toolLabel, err, apiUrl, fallbackHint) {
105771
105758
  }
105772
105759
 
105773
105760
  // ../tool-server/src/utils/update-checker.ts
105774
- var import_node_fs6 = __toESM(require("node:fs"));
105761
+ var import_node_fs5 = __toESM(require("node:fs"));
105775
105762
  var import_node_os4 = __toESM(require("node:os"));
105776
105763
  var import_node_path4 = __toESM(require("node:path"));
105777
105764
  var import_semver = __toESM(require_semver2());
@@ -105789,7 +105776,7 @@ function getSuppressionFilePath() {
105789
105776
  }
105790
105777
  function loadSuppressUntil() {
105791
105778
  try {
105792
- const raw = import_node_fs6.default.readFileSync(getSuppressionFilePath(), "utf8");
105779
+ const raw = import_node_fs5.default.readFileSync(getSuppressionFilePath(), "utf8");
105793
105780
  const parsed = JSON.parse(raw);
105794
105781
  const value = parsed.suppressUntil;
105795
105782
  return typeof value === "number" && Number.isFinite(value) ? value : 0;
@@ -105799,8 +105786,8 @@ function loadSuppressUntil() {
105799
105786
  }
105800
105787
  function persistSuppressUntil(value) {
105801
105788
  const filePath = getSuppressionFilePath();
105802
- import_node_fs6.default.mkdirSync(import_node_path4.default.dirname(filePath), { recursive: true });
105803
- import_node_fs6.default.writeFileSync(filePath, JSON.stringify({ suppressUntil: value }));
105789
+ import_node_fs5.default.mkdirSync(import_node_path4.default.dirname(filePath), { recursive: true });
105790
+ import_node_fs5.default.writeFileSync(filePath, JSON.stringify({ suppressUntil: value }));
105804
105791
  }
105805
105792
  var state2 = {
105806
105793
  updateAvailable: false,
@@ -105892,7 +105879,7 @@ ACTION REQUIRED: Save a note (via TODO, task list) that an Argent update to v${l
105892
105879
  }
105893
105880
 
105894
105881
  // ../tool-server/src/preview.ts
105895
- var import_node_fs9 = __toESM(require("node:fs"));
105882
+ var import_node_fs8 = __toESM(require("node:fs"));
105896
105883
  var import_node_os6 = __toESM(require("node:os"));
105897
105884
  var import_node_path6 = __toESM(require("node:path"));
105898
105885
  var import_express = __toESM(require_express2());
@@ -105917,7 +105904,6 @@ var import_node_util8 = require("node:util");
105917
105904
 
105918
105905
  // ../tool-server/src/utils/simctl-config.ts
105919
105906
  var SIMCTL_SPAWN_TIMEOUT_MS = 1e4;
105920
- var SIMCTL_KILL_SIGNAL = "SIGKILL";
105921
105907
 
105922
105908
  // ../tool-server/src/utils/ios-devices.ts
105923
105909
  var import_node_child_process6 = require("node:child_process");
@@ -105926,8 +105912,7 @@ var execFileAsync5 = (0, import_node_util5.promisify)(import_node_child_process6
105926
105912
  async function listIosSimulators() {
105927
105913
  try {
105928
105914
  const { stdout } = await execFileAsync5("xcrun", ["simctl", "list", "devices", "--json"], {
105929
- timeout: 1e4,
105930
- killSignal: SIMCTL_KILL_SIGNAL
105915
+ timeout: 1e4
105931
105916
  });
105932
105917
  const data = JSON.parse(stdout);
105933
105918
  const out = [];
@@ -105989,7 +105974,7 @@ async function ensureAutomationEnabled(udid) {
105989
105974
  "-bool",
105990
105975
  "true"
105991
105976
  ],
105992
- { timeout: SIMCTL_SPAWN_TIMEOUT_MS, killSignal: SIMCTL_KILL_SIGNAL }
105977
+ { timeout: SIMCTL_SPAWN_TIMEOUT_MS }
105993
105978
  );
105994
105979
  }
105995
105980
  async function isEntitlementBypassActive(udid) {
@@ -106004,7 +105989,7 @@ async function isEntitlementBypassActive(udid) {
106004
105989
  "com.apple.Accessibility",
106005
105990
  "IgnoreAXServerEntitlements"
106006
105991
  ],
106007
- { timeout: SIMCTL_SPAWN_TIMEOUT_MS, killSignal: SIMCTL_KILL_SIGNAL }
105992
+ { timeout: SIMCTL_SPAWN_TIMEOUT_MS }
106008
105993
  ).then(({ stdout }) => stdout.trim() === "1").catch(() => false);
106009
105994
  }
106010
105995
  function accessibilityPlistPath(udid) {
@@ -106239,7 +106224,7 @@ async function ensureAccessibilityEnabled(udid) {
106239
106224
  "-bool",
106240
106225
  "true"
106241
106226
  ],
106242
- { timeout: SIMCTL_SPAWN_TIMEOUT_MS, killSignal: SIMCTL_KILL_SIGNAL }
106227
+ { timeout: SIMCTL_SPAWN_TIMEOUT_MS }
106243
106228
  )
106244
106229
  )
106245
106230
  );
@@ -106249,7 +106234,7 @@ async function setupNativeDevtoolsEnvLocal(udid, endpoint) {
106249
106234
  const result = await execFileAsync8(
106250
106235
  "xcrun",
106251
106236
  ["simctl", "spawn", udid, "launchctl", "getenv", "DYLD_INSERT_LIBRARIES"],
106252
- { encoding: "utf8", timeout: SIMCTL_SPAWN_TIMEOUT_MS, killSignal: SIMCTL_KILL_SIGNAL }
106237
+ { encoding: "utf8", timeout: SIMCTL_SPAWN_TIMEOUT_MS }
106253
106238
  ).catch((e) => ({ stdout: e.stdout ?? "" }));
106254
106239
  const existing = (result.stdout ?? "").trim();
106255
106240
  const updated = buildDyldInsertLibraries(existing, bootstrapPath);
@@ -106257,7 +106242,7 @@ async function setupNativeDevtoolsEnvLocal(udid, endpoint) {
106257
106242
  await execFileAsync8(
106258
106243
  "xcrun",
106259
106244
  ["simctl", "spawn", udid, "launchctl", "setenv", "DYLD_INSERT_LIBRARIES", updated],
106260
- { timeout: SIMCTL_SPAWN_TIMEOUT_MS, killSignal: SIMCTL_KILL_SIGNAL }
106245
+ { timeout: SIMCTL_SPAWN_TIMEOUT_MS }
106261
106246
  );
106262
106247
  }
106263
106248
  if (endpoint.transport === "tcp") {
@@ -106275,7 +106260,7 @@ async function setupNativeDevtoolsEnvLocal(udid, endpoint) {
106275
106260
  "NATIVE_DEVTOOLS_IOS_CDP_PORT",
106276
106261
  String(endpoint.port)
106277
106262
  ],
106278
- { timeout: SIMCTL_SPAWN_TIMEOUT_MS, killSignal: SIMCTL_KILL_SIGNAL }
106263
+ { timeout: SIMCTL_SPAWN_TIMEOUT_MS }
106279
106264
  );
106280
106265
  } else {
106281
106266
  await execFileAsync8(
@@ -106289,7 +106274,7 @@ async function setupNativeDevtoolsEnvLocal(udid, endpoint) {
106289
106274
  "NATIVE_DEVTOOLS_IOS_CDP_SOCKET",
106290
106275
  endpoint.socketPath
106291
106276
  ],
106292
- { timeout: SIMCTL_SPAWN_TIMEOUT_MS, killSignal: SIMCTL_KILL_SIGNAL }
106277
+ { timeout: SIMCTL_SPAWN_TIMEOUT_MS }
106293
106278
  );
106294
106279
  }
106295
106280
  await ensureAccessibilityEnabled(udid);
@@ -106319,9 +106304,7 @@ function parseUIKitApplicationBundleIds(stdout) {
106319
106304
  }
106320
106305
  async function listRunningUIKitApplicationBundleIds(udid) {
106321
106306
  const { stdout } = await execFileAsync8("xcrun", ["simctl", "spawn", udid, "launchctl", "list"], {
106322
- encoding: "utf8",
106323
- timeout: SIMCTL_SPAWN_TIMEOUT_MS,
106324
- killSignal: SIMCTL_KILL_SIGNAL
106307
+ encoding: "utf8"
106325
106308
  });
106326
106309
  return parseUIKitApplicationBundleIds(stdout);
106327
106310
  }
@@ -115939,7 +115922,7 @@ init_src();
115939
115922
 
115940
115923
  // ../tool-server/src/utils/vega-sdk.ts
115941
115924
  var import_promises4 = require("node:fs/promises");
115942
- var import_node_fs7 = require("node:fs");
115925
+ var import_node_fs6 = require("node:fs");
115943
115926
  var import_node_os5 = require("node:os");
115944
115927
  var import_node_path5 = require("node:path");
115945
115928
  var import_semver2 = __toESM(require_semver2());
@@ -115962,7 +115945,7 @@ function sdkComponentRoots(config2) {
115962
115945
  return Array.from(new Set(roots));
115963
115946
  }
115964
115947
  async function resolveVersion(channelDir, preferred) {
115965
- if (preferred && (0, import_node_fs7.existsSync)((0, import_node_path5.join)(channelDir, preferred))) return preferred;
115948
+ if (preferred && (0, import_node_fs6.existsSync)((0, import_node_path5.join)(channelDir, preferred))) return preferred;
115966
115949
  try {
115967
115950
  const versions = (await (0, import_promises4.readdir)(channelDir)).filter((e) => import_semver2.default.valid(e)).sort(import_semver2.default.rcompare);
115968
115951
  return versions[0] ?? null;
@@ -115980,7 +115963,7 @@ async function resolveVegaSdkImagesDir() {
115980
115963
  const version4 = await resolveVersion(channelDir, preferred);
115981
115964
  if (!version4) continue;
115982
115965
  const imagesDir = (0, import_node_path5.join)(channelDir, version4, "vvd", "images");
115983
- if ((0, import_node_fs7.existsSync)(imagesDir)) return imagesDir;
115966
+ if ((0, import_node_fs6.existsSync)(imagesDir)) return imagesDir;
115984
115967
  }
115985
115968
  return null;
115986
115969
  }
@@ -116811,43 +116794,6 @@ function nativeDevtoolsRef(device, { transport = "unix" } = {}) {
116811
116794
  function getNativeDevtoolsSocketPath(udid) {
116812
116795
  return `/tmp/argent-nd-${udid.slice(0, 8)}.sock`;
116813
116796
  }
116814
- function bindNativeDevtoolsUnixSocket(server, socketPath) {
116815
- return new Promise((resolve7, reject) => {
116816
- let retried = false;
116817
- const onListening = () => {
116818
- server.off("error", onError);
116819
- resolve7();
116820
- };
116821
- const onError = (err) => {
116822
- if ((err.code === "EADDRINUSE" || err.code === "EEXIST") && !retried) {
116823
- retried = true;
116824
- try {
116825
- fs13.unlinkSync(socketPath);
116826
- } catch {
116827
- }
116828
- server.listen(socketPath);
116829
- return;
116830
- }
116831
- server.off("listening", onListening);
116832
- server.off("error", onError);
116833
- server.close();
116834
- reject(
116835
- new FailureError(
116836
- `native-devtools failed to bind unix socket ${socketPath}: ${err.code ?? err.message}`,
116837
- {
116838
- error_code: FAILURE_CODES.NATIVE_DEVTOOLS_SOCKET_BIND_FAILED,
116839
- failure_stage: "native_devtools_socket_bind",
116840
- failure_area: "tool_server",
116841
- error_kind: "network"
116842
- }
116843
- )
116844
- );
116845
- };
116846
- server.on("error", onError);
116847
- server.once("listening", onListening);
116848
- server.listen(socketPath);
116849
- });
116850
- }
116851
116797
  var nativeDevtoolsBlueprint = {
116852
116798
  namespace: NATIVE_DEVTOOLS_NAMESPACE,
116853
116799
  getURN(device) {
@@ -117058,7 +117004,7 @@ var nativeDevtoolsBlueprint = {
117058
117004
  });
117059
117005
  await host.startProxy(udid, endpoint.port);
117060
117006
  } else {
117061
- await bindNativeDevtoolsUnixSocket(server, socketPath);
117007
+ server.listen(socketPath);
117062
117008
  }
117063
117009
  await ensureEnvReady().catch(() => {
117064
117010
  });
@@ -117955,7 +117901,7 @@ var TraceProcessorUnavailableError = class _TraceProcessorUnavailableError exten
117955
117901
  };
117956
117902
 
117957
117903
  // ../native-devtools-android/src/wasm-trace-processor.ts
117958
- var import_node_fs8 = require("node:fs");
117904
+ var import_node_fs7 = require("node:fs");
117959
117905
  var import_promises5 = require("node:fs/promises");
117960
117906
  var path13 = __toESM(require("node:path"));
117961
117907
  var import_node_url2 = require("node:url");
@@ -117970,7 +117916,7 @@ function engineGlobals() {
117970
117916
  function resolveTraceProcessorAssets() {
117971
117917
  const dir = path13.join(__dirname, "..", "assets", "trace-processor");
117972
117918
  const wasmOverride = process.env.ARGENT_TRACE_PROCESSOR_WASM;
117973
- if (wasmOverride && !(0, import_node_fs8.existsSync)(wasmOverride)) {
117919
+ if (wasmOverride && !(0, import_node_fs7.existsSync)(wasmOverride)) {
117974
117920
  throw new TraceProcessorUnavailableError("wasm_path_invalid", { path: wasmOverride });
117975
117921
  }
117976
117922
  return {
@@ -118098,8 +118044,8 @@ async function createEngine() {
118098
118044
  setupWorkerScope(dir);
118099
118045
  silenceDecoderWarning();
118100
118046
  const g = engineGlobals();
118101
- g.__TP_WASM_BYTES = new Uint8Array((0, import_node_fs8.readFileSync)(wasmPath));
118102
- const src = patchGlueForNode((0, import_node_fs8.readFileSync)(gluePath, "utf8"));
118047
+ g.__TP_WASM_BYTES = new Uint8Array((0, import_node_fs7.readFileSync)(wasmPath));
118048
+ const src = patchGlueForNode((0, import_node_fs7.readFileSync)(gluePath, "utf8"));
118103
118049
  import_node_vm.default.runInThisContext(src, { filename: "engine_bundle.node.patched.js" });
118104
118050
  const bridge = g.__TP_bridge;
118105
118051
  if (!bridge) throw new Error("patched glue did not expose globalThis.__TP_bridge");
@@ -118784,7 +118730,7 @@ function findUiFile(name) {
118784
118730
  import_node_path6.default.resolve(__dirname, "..", "..", "ui", name)
118785
118731
  ];
118786
118732
  for (const p of candidates) {
118787
- if (import_node_fs9.default.existsSync(p)) return p;
118733
+ if (import_node_fs8.default.existsSync(p)) return p;
118788
118734
  }
118789
118735
  return null;
118790
118736
  }
@@ -119107,7 +119053,7 @@ data: ${JSON.stringify(data)}
119107
119053
  const roots = /* @__PURE__ */ new Set();
119108
119054
  for (const r of [import_node_os6.default.tmpdir(), process.cwd(), "/tmp"]) {
119109
119055
  try {
119110
- roots.add(import_node_fs9.default.realpathSync(r));
119056
+ roots.add(import_node_fs8.default.realpathSync(r));
119111
119057
  } catch {
119112
119058
  }
119113
119059
  }
@@ -119126,8 +119072,8 @@ data: ${JSON.stringify(data)}
119126
119072
  let real;
119127
119073
  let size;
119128
119074
  try {
119129
- real = import_node_fs9.default.realpathSync(src);
119130
- const st = import_node_fs9.default.statSync(real);
119075
+ real = import_node_fs8.default.realpathSync(src);
119076
+ const st = import_node_fs8.default.statSync(real);
119131
119077
  if (!st.isFile()) throw new Error("not a file");
119132
119078
  size = st.size;
119133
119079
  } catch {
@@ -119144,7 +119090,7 @@ data: ${JSON.stringify(data)}
119144
119090
  }
119145
119091
  res.set("Cache-Control", "no-store");
119146
119092
  res.type(mime);
119147
- import_node_fs9.default.createReadStream(real).on("error", () => {
119093
+ import_node_fs8.default.createReadStream(real).on("error", () => {
119148
119094
  if (!res.headersSent) res.status(404).end();
119149
119095
  }).pipe(res);
119150
119096
  });
@@ -119196,7 +119142,7 @@ data: ${JSON.stringify(data)}
119196
119142
  }
119197
119143
 
119198
119144
  // ../tool-server/src/artifacts.ts
119199
- var import_node_fs10 = require("node:fs");
119145
+ var import_node_fs9 = require("node:fs");
119200
119146
  var import_promises7 = require("node:fs/promises");
119201
119147
  var import_node_child_process15 = require("node:child_process");
119202
119148
 
@@ -119324,7 +119270,7 @@ function makeArtifactRoute(registry2) {
119324
119270
  res.setHeader("Content-Type", entry.mimeType);
119325
119271
  res.setHeader("Content-Disposition", `attachment; filename="${entry.filename}"`);
119326
119272
  if (entry.size > 0) res.setHeader("Content-Length", String(entry.size));
119327
- const stream = (0, import_node_fs10.createReadStream)(entry.path);
119273
+ const stream = (0, import_node_fs9.createReadStream)(entry.path);
119328
119274
  stream.on("error", () => {
119329
119275
  if (!res.headersSent) res.status(500).json({ error: `Failed to read artifact "${id}"` });
119330
119276
  else res.destroy();
@@ -119991,7 +119937,7 @@ function createHttpApp(registry2, options) {
119991
119937
  }
119992
119938
  const id = (0, import_node_crypto6.randomUUID)();
119993
119939
  const tarPath = (0, import_node_path9.join)((0, import_node_os8.tmpdir)(), `argent-upload-${id}.tar.gz`);
119994
- const ws = (0, import_node_fs11.createWriteStream)(tarPath);
119940
+ const ws = (0, import_node_fs10.createWriteStream)(tarPath);
119995
119941
  let received = 0;
119996
119942
  let released = false;
119997
119943
  const releaseInFlight = () => {
@@ -120329,15 +120275,15 @@ function createHttpApp(registry2, options) {
120329
120275
 
120330
120276
  // ../tool-server/src/event-log.ts
120331
120277
  var import_bunyan = __toESM(require_bunyan());
120332
- var import_node_fs12 = require("node:fs");
120278
+ var import_node_fs11 = require("node:fs");
120333
120279
  var import_node_path10 = require("node:path");
120334
120280
  init_src();
120335
120281
  function createToolServerEventLog({
120336
120282
  filePath
120337
120283
  }) {
120338
- (0, import_node_fs12.mkdirSync)((0, import_node_path10.dirname)(filePath), { recursive: true });
120339
- (0, import_node_fs12.writeFileSync)(filePath, "");
120340
- const fileStream = (0, import_node_fs12.createWriteStream)(filePath, { flags: "a" });
120284
+ (0, import_node_fs11.mkdirSync)((0, import_node_path10.dirname)(filePath), { recursive: true });
120285
+ (0, import_node_fs11.writeFileSync)(filePath, "");
120286
+ const fileStream = (0, import_node_fs11.createWriteStream)(filePath, { flags: "a" });
120341
120287
  let disposed = false;
120342
120288
  let disposePromise = null;
120343
120289
  let streamError = null;
@@ -121638,10 +121584,6 @@ var zodSchema2 = external_exports.object({
121638
121584
  var nativeDevtoolsStatusTool = {
121639
121585
  id: "native-devtools-status",
121640
121586
  capability: { apple: { simulator: true, device: true }, appleRemote: { simulator: true } },
121641
- // The "injectable is false" recovery sentence inlines NON_INJECTABLE_RECOVERY
121642
- // verbatim: the description must stay a plain literal so scripts/extract-tools.mjs
121643
- // can read it statically for the spidershield scan. The verbatim match is pinned
121644
- // by native-devtools-status.test.ts.
121645
121587
  description: `Check whether native devtools are connected to a specific app and whether the next launch is prepared for injection.
121646
121588
  Use when you need to verify native devtools readiness before calling native-full-hierarchy, native-describe-screen, or native-network-logs.
121647
121589
 
@@ -121654,7 +121596,7 @@ Returns { envSetup, appRunning, connected, requiresRestart, nextLaunchWillBeInje
121654
121596
  - injectable: whether native devtools can ever be injected into this app. Apple system apps (bundle ids under com.apple.) are platform binaries with library validation, so the dylib can never load into them.
121655
121597
 
121656
121598
  Call this before using app-scoped native hierarchy tools or native-network-logs.
121657
- If injectable is false: this is a TERMINAL state \u2014 the app can never be injected. Do NOT restart/retry. Use the standard \`describe\` tool (its accessibility path reads the screen without injection) or \`screenshot\` (then interact by coordinate). Do not fall back to the native-devtools feature tools (native-describe-screen, native-find-views, native-full-hierarchy, native-network-logs, native-view-at-point, native-user-interactable-view-at-point) \u2014 they run the same injection precheck and fail with the same non-injectable error.
121599
+ If injectable is false: this is a TERMINAL state \u2014 the app can never be injected. Do NOT restart/retry. ${NON_INJECTABLE_RECOVERY}
121658
121600
  If appRunning is false and nextLaunchWillBeInjected is true: use launch-app normally.
121659
121601
  If requiresRestart is true: call restart-app, then proceed with the native feature.
121660
121602
  Returns { status: "init_failed", message, attempts } instead when the simulator's native-devtools environment failed to initialize.
@@ -122177,20 +122119,6 @@ function normalizeWsUrl(wsUrl, port) {
122177
122119
  return url2.toString();
122178
122120
  }
122179
122121
 
122180
- // ../tool-server/src/utils/debugger/device-alias.ts
122181
- var logicalIdToConnectId = /* @__PURE__ */ new Map();
122182
- function rememberDeviceAlias(logicalDeviceId, connectDeviceId) {
122183
- if (!logicalDeviceId || logicalDeviceId === connectDeviceId) return;
122184
- logicalIdToConnectId.set(logicalDeviceId, connectDeviceId);
122185
- }
122186
- function canonicalDeviceId(deviceId) {
122187
- if (!deviceId) return deviceId;
122188
- return logicalIdToConnectId.get(deviceId) ?? deviceId;
122189
- }
122190
- function forgetDeviceAlias(logicalDeviceId) {
122191
- if (logicalDeviceId) logicalIdToConnectId.delete(logicalDeviceId);
122192
- }
122193
-
122194
122122
  // ../tool-server/src/utils/debugger/source-resolver.ts
122195
122123
  var fs18 = __toESM(require("node:fs/promises"));
122196
122124
  var path17 = __toESM(require("node:path"));
@@ -122609,7 +122537,6 @@ var jsRuntimeDebuggerBlueprint = {
122609
122537
  consoleEvents,
122610
122538
  consoleSocketUrl: consoleServer.url
122611
122539
  };
122612
- rememberDeviceAlias(api.logicalDeviceId, deviceId);
122613
122540
  const events = new TypedEventEmitter();
122614
122541
  cdp.events.on("disconnected", (error52) => {
122615
122542
  events.emit(
@@ -122625,7 +122552,6 @@ var jsRuntimeDebuggerBlueprint = {
122625
122552
  return {
122626
122553
  api,
122627
122554
  dispose: async () => {
122628
- forgetDeviceAlias(api.logicalDeviceId);
122629
122555
  await consoleServer.close();
122630
122556
  logWriter.close();
122631
122557
  await cdp.disconnect();
@@ -125788,14 +125714,6 @@ init_zod();
125788
125714
  var import_node_child_process24 = require("node:child_process");
125789
125715
  var import_node_util18 = require("node:util");
125790
125716
  init_src();
125791
-
125792
- // ../tool-server/src/tools/open-url/deep-link-note.ts
125793
- function httpDeepLinkNote(url2) {
125794
- if (!/^https?:/i.test(url2)) return void 0;
125795
- return "This is a web URL \u2014 it opens the native app only if an app installed on this device is verified for the link's domain (iOS Universal Links / Android App Links); otherwise it opens in the browser. On iOS simulators it may open in Safari even when the owning app is installed. To reliably open an installed app, use its custom scheme (scheme://path) or launch-app with its bundle id.";
125796
- }
125797
-
125798
- // ../tool-server/src/tools/open-url/platforms/ios.ts
125799
125717
  var execFileAsync18 = (0, import_node_util18.promisify)(import_node_child_process24.execFile);
125800
125718
  var iosImpl3 = {
125801
125719
  requires: ["xcrun"],
@@ -125815,7 +125733,7 @@ var iosImpl3 = {
125815
125733
  { cause: err instanceof Error ? err : new Error(String(err)) }
125816
125734
  );
125817
125735
  }
125818
- return { opened: true, url: params.url, note: httpDeepLinkNote(params.url) };
125736
+ return { opened: true, url: params.url };
125819
125737
  }
125820
125738
  };
125821
125739
 
@@ -125839,7 +125757,7 @@ var androidImpl5 = {
125839
125757
  error_kind: "subprocess"
125840
125758
  });
125841
125759
  }
125842
- return { opened: true, url: params.url, note: httpDeepLinkNote(params.url) };
125760
+ return { opened: true, url: params.url };
125843
125761
  }
125844
125762
  };
125845
125763
 
@@ -125848,7 +125766,7 @@ var iosRemoteImpl5 = {
125848
125766
  requires: ["sim-remote"],
125849
125767
  handler: async (_services, params) => {
125850
125768
  await simctlOpenUrl(params.udid, params.url);
125851
- return { opened: true, url: params.url, note: httpDeepLinkNote(params.url) };
125769
+ return { opened: true, url: params.url };
125852
125770
  }
125853
125771
  };
125854
125772
 
@@ -125879,8 +125797,7 @@ var openUrlTool = {
125879
125797
  description: `Open a URL or URL scheme on the device.
125880
125798
  Use to navigate to a web page or deep-link into an app. On Chromium, this navigates the primary renderer to the given URL.
125881
125799
  Cross-platform schemes: https://, tel:, mailto:. iOS also: messages://, settings://, maps://. Android also: geo:, plus any app-specific deep link.
125882
- Deep-linking caveat: an https:// link opens the native app only when an installed app is verified for the link's domain (iOS Universal Links / Android App Links) \u2014 otherwise it opens in the browser, and on iOS simulators it may open in Safari even when the owning app is installed. To reliably open an installed app, use its custom scheme (scheme://path) or launch-app with its bundle id.
125883
- Returns { opened, url, note? }. note carries the deep-linking caveat when a web URL was opened on a native device. Fails if no app is registered to handle the URI (iOS/Android) or the renderer rejects the navigation (Chromium).`,
125800
+ Returns { opened, url }. Fails if no app is registered to handle the URI (iOS/Android) or the renderer rejects the navigation (Chromium).`,
125884
125801
  zodSchema: zodSchema14,
125885
125802
  capability: capability6,
125886
125803
  services: (params) => {
@@ -133937,19 +133854,18 @@ var RN_ONLY_TOOL_CAPABILITY = {
133937
133854
  android: { emulator: true, device: true, unknown: true }
133938
133855
  };
133939
133856
  function debuggerServiceRef(params) {
133940
- const deviceId = canonicalDeviceId(params.device_id);
133941
- if (deviceId && deviceId.startsWith(CHROMIUM_ID_PREFIX)) {
133942
- const device = resolveDevice(deviceId);
133857
+ if (params.device_id && params.device_id.startsWith(CHROMIUM_ID_PREFIX)) {
133858
+ const device = resolveDevice(params.device_id);
133943
133859
  return chromiumJsRuntimeDebuggerRef(device);
133944
133860
  }
133945
- return `JsRuntimeDebugger:${params.port}:${deviceId}`;
133861
+ return `JsRuntimeDebugger:${params.port}:${params.device_id}`;
133946
133862
  }
133947
133863
 
133948
133864
  // ../tool-server/src/tools/debugger/debugger-connect.ts
133949
133865
  var zodSchema29 = external_exports.object({
133950
133866
  port: external_exports.coerce.number().default(8081).describe("Metro server port (ignored for Chromium \u2014 its CDP port is encoded in device_id)"),
133951
133867
  device_id: external_exports.string().describe(
133952
- "Device id from list-devices: iOS simulator UDID, Android serial, Vega serial (amazon-...), or Chromium device id (chromium-cdp-<port>). Pass this SAME id as device_id to every subsequent debugger-* call to pin them to this device. The returned logicalDeviceId is informational (Metro's own per-connection handle, absent on Vega); you do not switch to it \u2014 forwarding it still resolves here, but the list-devices id is the stable one."
133868
+ "Device id: iOS simulator UDID, Android logicalDeviceId returned by Metro, Vega serial (amazon-...), or Chromium device id (chromium-cdp-<port>) from list-devices. When a logicalDeviceId is returned, forward it as device_id to all subsequent debugger-* calls to pin them to this device; when none is returned (Vega), keep passing the id you connected with."
133953
133869
  )
133954
133870
  });
133955
133871
  var debuggerConnectTool = {
@@ -133982,7 +133898,7 @@ init_zod();
133982
133898
  var zodSchema30 = external_exports.object({
133983
133899
  port: external_exports.coerce.number().default(8081).describe("Metro server port (ignored for Chromium)"),
133984
133900
  device_id: external_exports.string().describe(
133985
- "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID, Android serial, Vega serial, or Chromium device id). The logicalDeviceId debugger-connect returns also resolves here, but prefer the stable list-devices id."
133901
+ "Device id from debugger-connect (iOS simulator UDID, Android logicalDeviceId, Vega serial, or Chromium device id)."
133986
133902
  )
133987
133903
  });
133988
133904
  var debuggerStatusTool = {
@@ -134017,7 +133933,7 @@ init_zod();
134017
133933
  var zodSchema31 = external_exports.object({
134018
133934
  port: external_exports.coerce.number().default(8081).describe("Metro server port (ignored for Chromium)"),
134019
133935
  device_id: external_exports.string().describe(
134020
- "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID, Android serial, Vega serial, or Chromium device id). The logicalDeviceId debugger-connect returns also resolves here, but prefer the stable list-devices id."
133936
+ "Device id from debugger-connect (iOS simulator UDID, Android logicalDeviceId, Vega serial, or Chromium device id)."
134021
133937
  ),
134022
133938
  expression: external_exports.string().describe("JavaScript expression to evaluate in the app runtime")
134023
133939
  });
@@ -134048,7 +133964,7 @@ init_src();
134048
133964
  var zodSchema32 = external_exports.object({
134049
133965
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
134050
133966
  device_id: external_exports.string().describe(
134051
- "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
133967
+ "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
134052
133968
  )
134053
133969
  });
134054
133970
  var debuggerReloadMetroTool = {
@@ -134063,7 +133979,7 @@ Use when you want to apply code changes or reset JS state. Returns { reloaded, p
134063
133979
  // want that on Chromium later, it deserves its own tool.
134064
133980
  capability: RN_ONLY_TOOL_CAPABILITY,
134065
133981
  services: (params) => ({
134066
- debugger: `JsRuntimeDebugger:${params.port}:${canonicalDeviceId(params.device_id)}`
133982
+ debugger: `JsRuntimeDebugger:${params.port}:${params.device_id}`
134067
133983
  }),
134068
133984
  async execute(services, _params) {
134069
133985
  const api = services.debugger;
@@ -134866,7 +134782,7 @@ function buildTextTree(data, opts) {
134866
134782
  var zodSchema33 = external_exports.object({
134867
134783
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
134868
134784
  device_id: external_exports.string().describe(
134869
- "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
134785
+ "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
134870
134786
  ),
134871
134787
  onScreenOnly: external_exports.boolean().default(true).describe(
134872
134788
  "When true (default), only components visible on screen are returned. Set to false to include all mounted components including those scrolled off-screen. Useful when you need to understand the full page structure."
@@ -134905,7 +134821,7 @@ Use when you need tap coordinates for a React Native UI element. Returns a compa
134905
134821
  // for DOM-tree discovery on Chromium.
134906
134822
  capability: RN_ONLY_TOOL_CAPABILITY,
134907
134823
  services: (params) => ({
134908
- debugger: `JsRuntimeDebugger:${params.port}:${canonicalDeviceId(params.device_id)}`
134824
+ debugger: `JsRuntimeDebugger:${params.port}:${params.device_id}`
134909
134825
  }),
134910
134826
  async execute(services, params) {
134911
134827
  const api = services.debugger;
@@ -134933,7 +134849,7 @@ Use when you need tap coordinates for a React Native UI element. Returns a compa
134933
134849
  const deviceLine = [
134934
134850
  `device: ${api.deviceName}`,
134935
134851
  `app: ${api.appName}`,
134936
- ...api.logicalDeviceId ? [`logicalDeviceId: ${api.logicalDeviceId}`] : []
134852
+ ...api.logicalDeviceId ? [`udid: ${api.logicalDeviceId}`] : []
134937
134853
  ].join(" | ");
134938
134854
  return `[${deviceLine}]
134939
134855
  ${tree}`;
@@ -135373,7 +135289,7 @@ function filterInspectItems(items, includeSkipped = false) {
135373
135289
  var zodSchema34 = external_exports.object({
135374
135290
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
135375
135291
  device_id: external_exports.string().describe(
135376
- "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
135292
+ "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
135377
135293
  ),
135378
135294
  x: external_exports.coerce.number().describe("Logical X coordinate on device screen"),
135379
135295
  y: external_exports.coerce.number().describe("Logical Y coordinate on device screen"),
@@ -135410,7 +135326,7 @@ Use when you need the source file and line for a component at a tap coordinate.
135410
135326
  // out of scope for this port.
135411
135327
  capability: RN_ONLY_TOOL_CAPABILITY,
135412
135328
  services: (params) => ({
135413
- debugger: `JsRuntimeDebugger:${params.port}:${canonicalDeviceId(params.device_id)}`
135329
+ debugger: `JsRuntimeDebugger:${params.port}:${params.device_id}`
135414
135330
  }),
135415
135331
  async execute(services, params) {
135416
135332
  const api = services.debugger;
@@ -135507,7 +135423,7 @@ init_zod();
135507
135423
  var zodSchema35 = external_exports.object({
135508
135424
  port: external_exports.coerce.number().default(8081).describe("Metro server port (ignored for Chromium)"),
135509
135425
  device_id: external_exports.string().describe(
135510
- "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID, Android serial, Vega serial, or Chromium device id). The logicalDeviceId debugger-connect returns also resolves here, but prefer the stable list-devices id."
135426
+ "Device id from debugger-connect (iOS simulator UDID, Android logicalDeviceId, Vega serial, or Chromium device id)."
135511
135427
  )
135512
135428
  });
135513
135429
  var debuggerLogRegistryTool = {
@@ -135595,9 +135511,7 @@ ${lines.join("\n")}`;
135595
135511
  }
135596
135512
  var zodSchema36 = external_exports.object({
135597
135513
  port: external_exports.coerce.number().default(8081).describe("Metro server port (RN only; ignored on Chromium)"),
135598
- device_id: external_exports.string().describe(
135599
- "Device id from list-devices (iOS simulator UDID or Android serial) \u2014 the same id used with debugger-connect."
135600
- ),
135514
+ device_id: external_exports.string().describe("Device UDID (logicalDeviceId)."),
135601
135515
  pageIndex: external_exports.union([external_exports.coerce.number().int().nonnegative(), external_exports.literal("latest")]).default("latest").describe(
135602
135516
  'Page index (0-based) or "latest" for the most recent page. Each page contains up to 50 entries.'
135603
135517
  )
@@ -135619,7 +135533,7 @@ Fails if the app is not connected (RN) or the device is not reachable (Chromium)
135619
135533
  if (device.platform === "chromium") {
135620
135534
  return { chromium: chromiumCdpRef(device) };
135621
135535
  }
135622
- return { inspector: `NetworkInspector:${params.port}:${canonicalDeviceId(params.device_id)}` };
135536
+ return { inspector: `NetworkInspector:${params.port}:${params.device_id}` };
135623
135537
  },
135624
135538
  async execute(services, params) {
135625
135539
  if (resolveDevice(params.device_id).platform === "chromium") {
@@ -135683,9 +135597,7 @@ function redactHeaders(headers) {
135683
135597
  var MAX_BODY_SIZE = 1e3;
135684
135598
  var zodSchema37 = external_exports.object({
135685
135599
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
135686
- device_id: external_exports.string().describe(
135687
- "Device id from list-devices (iOS simulator UDID or Android serial) \u2014 the same id used with debugger-connect."
135688
- ),
135600
+ device_id: external_exports.string().describe("Device UDID (logicalDeviceId)."),
135689
135601
  requestId: external_exports.string().describe("The requestId from view-network-logs to get full details for"),
135690
135602
  includeBody: external_exports.coerce.boolean().default(true).describe("Whether to include the response body (if captured). Defaults to true.")
135691
135603
  });
@@ -135704,7 +135616,7 @@ Returns an error message string if the requestId is not found \u2014 use view-ne
135704
135616
  if (device.platform === "chromium") {
135705
135617
  return { chromium: chromiumCdpRef(device) };
135706
135618
  }
135707
- return { inspector: `NetworkInspector:${params.port}:${canonicalDeviceId(params.device_id)}` };
135619
+ return { inspector: `NetworkInspector:${params.port}:${params.device_id}` };
135708
135620
  },
135709
135621
  async execute(services, params) {
135710
135622
  if (resolveDevice(params.device_id).platform === "chromium") {
@@ -136263,7 +136175,7 @@ var NO_RENDERERS_ATTACHED_ERROR = "React DevTools hook is present but no React r
136263
136175
  var zodSchema40 = external_exports.object({
136264
136176
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
136265
136177
  device_id: external_exports.string().describe(
136266
- "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
136178
+ "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
136267
136179
  ),
136268
136180
  sample_interval_us: external_exports.coerce.number().int().positive().default(100).describe("CPU sampling interval in microseconds (default 100)"),
136269
136181
  force: external_exports.boolean().default(false).describe(
@@ -136294,9 +136206,8 @@ Fails if the Hermes runtime is not reachable or the Metro CDP connection cannot
136294
136206
  capability: RN_ONLY_TOOL_CAPABILITY,
136295
136207
  services: () => ({}),
136296
136208
  async execute(_services, params) {
136297
- const deviceId = canonicalDeviceId(params.device_id);
136298
- const jsdUrn = `${JS_RUNTIME_DEBUGGER_NAMESPACE}:${params.port}:${deviceId}`;
136299
- const psUrn = `${REACT_PROFILER_SESSION_NAMESPACE}:${params.port}:${deviceId}`;
136209
+ const jsdUrn = `${JS_RUNTIME_DEBUGGER_NAMESPACE}:${params.port}:${params.device_id}`;
136210
+ const psUrn = `${REACT_PROFILER_SESSION_NAMESPACE}:${params.port}:${params.device_id}`;
136300
136211
  const ignore = () => {
136301
136212
  };
136302
136213
  async function disposeAndWait() {
@@ -136563,7 +136474,7 @@ async function readCommitTree(path36) {
136563
136474
  var zodSchema41 = external_exports.object({
136564
136475
  port: external_exports.coerce.number().default(8081).describe("Metro server port"),
136565
136476
  device_id: external_exports.string().describe(
136566
- "Device id from list-devices \u2014 the SAME id you passed to debugger-connect (iOS simulator UDID or Android serial)."
136477
+ "Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId)."
136567
136478
  )
136568
136479
  });
136569
136480
  function normalizeChangeDescription(raw) {
@@ -136649,7 +136560,7 @@ Fails if no active profiling session exists or the CDP connection was lost durin
136649
136560
  capability: RN_ONLY_TOOL_CAPABILITY,
136650
136561
  services: () => ({}),
136651
136562
  async execute(_services, params) {
136652
- const psUrn = `${REACT_PROFILER_SESSION_NAMESPACE}:${params.port}:${canonicalDeviceId(params.device_id)}`;
136563
+ const psUrn = `${REACT_PROFILER_SESSION_NAMESPACE}:${params.port}:${params.device_id}`;
136653
136564
  const snapshot = registry2.getSnapshot();
136654
136565
  const entry = snapshot.services.get(psUrn);
136655
136566
  if (!entry || entry.state !== "RUNNING" /* RUNNING */) {
@@ -139207,7 +139118,7 @@ var nativeProfilerSessionBlueprint = {
139207
139118
  var import_child_process4 = require("child_process");
139208
139119
  init_src();
139209
139120
  var import_fs9 = require("fs");
139210
- var import_node_fs13 = require("node:fs");
139121
+ var import_node_fs12 = require("node:fs");
139211
139122
  var path22 = __toESM(require("path"));
139212
139123
 
139213
139124
  // ../tool-server/src/utils/ios-profiler/notify.ts
@@ -140856,7 +140767,7 @@ function resolveDefaultTemplatePath() {
140856
140767
  )
140857
140768
  ];
140858
140769
  for (const candidate of candidates) {
140859
- if ((0, import_node_fs13.existsSync)(candidate)) return candidate;
140770
+ if ((0, import_node_fs12.existsSync)(candidate)) return candidate;
140860
140771
  }
140861
140772
  throw new FailureError(
140862
140773
  `Argent.tracetemplate not found. Looked in:
@@ -149179,11 +149090,7 @@ returns a notice with the prerequisite instead of running.`,
149179
149090
  };
149180
149091
  let aborted2;
149181
149092
  try {
149182
- await execSteps(state3, flow.steps, {
149183
- flow: params.name,
149184
- runStack: [params.name],
149185
- depth: 0
149186
- });
149093
+ await execSteps(state3, flow.steps, params.name, [params.name]);
149187
149094
  } finally {
149188
149095
  aborted2 = state3.signal?.aborted === true;
149189
149096
  if (state3.pinned) await restoreStatusBar(device);
@@ -149318,13 +149225,7 @@ function stepTarget(step) {
149318
149225
  return void 0;
149319
149226
  }
149320
149227
  }
149321
- function childScope(scope, overrides = {}) {
149322
- return { ...scope, ...overrides, depth: scope.depth + 1 };
149323
- }
149324
- function depthOf(scope) {
149325
- return scope.depth ? { depth: scope.depth } : {};
149326
- }
149327
- async function execSteps(state3, steps, scope) {
149228
+ async function execSteps(state3, steps, sourceFlow, runStack) {
149328
149229
  for (const step of steps) {
149329
149230
  const index = state3.reports.length;
149330
149231
  if (state3.stopped) {
@@ -149332,14 +149233,13 @@ async function execSteps(state3, steps, scope) {
149332
149233
  index,
149333
149234
  kind: step.kind,
149334
149235
  status: "skip",
149335
- flow: scope.flow,
149236
+ flow: sourceFlow,
149336
149237
  target: stepTarget(step),
149337
- ...depthOf(scope),
149338
149238
  // Carry the echo's message so a skipped narration renders as a skip
149339
149239
  // line rather than vanishing — matching reportBlockSkipped.
149340
149240
  ...step.kind === "echo" ? { message: step.message } : {}
149341
149241
  });
149342
- if (step.kind === "when") reportBlockSkipped(state3, step.steps, childScope(scope));
149242
+ if (step.kind === "when") reportBlockSkipped(state3, step.steps, sourceFlow);
149343
149243
  continue;
149344
149244
  }
149345
149245
  if (state3.signal?.aborted) {
@@ -149349,25 +149249,22 @@ async function execSteps(state3, steps, scope) {
149349
149249
  kind: step.kind,
149350
149250
  status: "skip",
149351
149251
  reason: "run aborted",
149352
- flow: scope.flow,
149252
+ flow: sourceFlow,
149353
149253
  target: stepTarget(step),
149354
- ...depthOf(scope),
149355
149254
  ...step.kind === "echo" ? { message: step.message } : {}
149356
149255
  });
149357
- if (step.kind === "when") {
149358
- reportBlockSkipped(state3, step.steps, childScope(scope), "run aborted");
149359
- }
149256
+ if (step.kind === "when") reportBlockSkipped(state3, step.steps, sourceFlow, "run aborted");
149360
149257
  continue;
149361
149258
  }
149362
149259
  if (step.kind === "run") {
149363
- await execRunStep(state3, step, scope);
149260
+ await execRunStep(state3, step, runStack);
149364
149261
  continue;
149365
149262
  }
149366
149263
  if (step.kind === "when") {
149367
- await execWhenStep(state3, step, scope);
149264
+ await execWhenStep(state3, step, sourceFlow, runStack);
149368
149265
  continue;
149369
149266
  }
149370
- const report = await execLeafStep(state3, step, index, scope);
149267
+ const report = await execLeafStep(state3, step, index, sourceFlow);
149371
149268
  pushReport(state3, report);
149372
149269
  if (report.status === "fail" || report.status === "error") state3.stopped = true;
149373
149270
  }
@@ -149376,7 +149273,7 @@ function describeWhenCondition(cond) {
149376
149273
  if (cond.kind === "platform") return `platform ${cond.platform}`;
149377
149274
  return conditionLabel(cond, describeSelector);
149378
149275
  }
149379
- function reportBlockSkipped(state3, steps, scope, reason) {
149276
+ function reportBlockSkipped(state3, steps, sourceFlow, reason) {
149380
149277
  for (const step of steps) {
149381
149278
  pushReport(state3, {
149382
149279
  index: state3.reports.length,
@@ -149386,20 +149283,17 @@ function reportBlockSkipped(state3, steps, scope, reason) {
149386
149283
  // A `run:` line is attributed to the fragment it names, matching the
149387
149284
  // executed marker in execRunStep; everything else belongs to the
149388
149285
  // enclosing flow.
149389
- flow: step.kind === "run" ? step.flow : scope.flow,
149286
+ flow: step.kind === "run" ? step.flow : sourceFlow,
149390
149287
  target: stepTarget(step),
149391
- ...depthOf(scope),
149392
149288
  ...step.kind === "echo" ? { message: step.message } : {}
149393
149289
  });
149394
- if (step.kind === "when") reportBlockSkipped(state3, step.steps, childScope(scope), reason);
149290
+ if (step.kind === "when") reportBlockSkipped(state3, step.steps, sourceFlow, reason);
149395
149291
  }
149396
149292
  }
149397
- async function execWhenStep(state3, step, scope) {
149293
+ async function execWhenStep(state3, step, sourceFlow, runStack) {
149398
149294
  const index = state3.reports.length;
149399
149295
  const label = describeWhenCondition(step.condition);
149400
149296
  const target = stepTarget(step);
149401
- const marker = { index, kind: "when", flow: scope.flow, target, ...depthOf(scope) };
149402
- const inner = childScope(scope);
149403
149297
  let met;
149404
149298
  if (step.condition.kind === "platform") {
149405
149299
  const platform = state3.device.platform === "ios-remote" ? "ios" : state3.device.platform;
@@ -149407,18 +149301,28 @@ async function execWhenStep(state3, step, scope) {
149407
149301
  } else {
149408
149302
  const probe3 = await probeWhenCondition(state3, step.condition);
149409
149303
  if (probe3.aborted) {
149410
- pushReport(state3, { ...marker, status: "skip", reason: "run aborted" });
149411
- reportBlockSkipped(state3, step.steps, inner, "run aborted");
149304
+ pushReport(state3, {
149305
+ index,
149306
+ kind: "when",
149307
+ status: "skip",
149308
+ reason: "run aborted",
149309
+ flow: sourceFlow,
149310
+ target
149311
+ });
149312
+ reportBlockSkipped(state3, step.steps, sourceFlow, "run aborted");
149412
149313
  return;
149413
149314
  }
149414
149315
  if (!probe3.ok && probe3.indeterminate) {
149415
149316
  pushReport(state3, {
149416
- ...marker,
149317
+ index,
149318
+ kind: "when",
149417
149319
  status: "error",
149418
- reason: `could not evaluate when guard (${label}): ${probe3.reason}`
149320
+ reason: `could not evaluate when guard (${label}): ${probe3.reason}`,
149321
+ flow: sourceFlow,
149322
+ target
149419
149323
  });
149420
149324
  state3.stopped = true;
149421
- reportBlockSkipped(state3, step.steps, inner, "when guard errored");
149325
+ reportBlockSkipped(state3, step.steps, sourceFlow, "when guard errored");
149422
149326
  return;
149423
149327
  }
149424
149328
  met = probe3.ok;
@@ -149426,34 +149330,37 @@ async function execWhenStep(state3, step, scope) {
149426
149330
  if (!met) {
149427
149331
  const n = step.steps.length;
149428
149332
  pushReport(state3, {
149429
- ...marker,
149333
+ index,
149334
+ kind: "when",
149430
149335
  status: "skip",
149431
- reason: `condition not met (${label}) \u2014 block skipped (${n} step${n === 1 ? "" : "s"})`
149336
+ reason: `condition not met (${label}) \u2014 block skipped (${n} step${n === 1 ? "" : "s"})`,
149337
+ flow: sourceFlow,
149338
+ target
149432
149339
  });
149433
- reportBlockSkipped(state3, step.steps, inner, "when block skipped");
149340
+ reportBlockSkipped(state3, step.steps, sourceFlow, "when block skipped");
149434
149341
  return;
149435
149342
  }
149436
- pushReport(state3, { ...marker, status: "pass", reason: `condition met (${label})` });
149437
- await execSteps(state3, step.steps, inner);
149343
+ pushReport(state3, {
149344
+ index,
149345
+ kind: "when",
149346
+ status: "pass",
149347
+ reason: `condition met (${label})`,
149348
+ flow: sourceFlow,
149349
+ target
149350
+ });
149351
+ await execSteps(state3, step.steps, sourceFlow, runStack);
149438
149352
  }
149439
- async function execRunStep(state3, step, scope) {
149353
+ async function execRunStep(state3, step, runStack) {
149440
149354
  const index = state3.reports.length;
149441
149355
  const target = step.flow;
149442
149356
  const fail = (reason) => {
149443
- pushReport(state3, {
149444
- index,
149445
- kind: "run",
149446
- status: "error",
149447
- flow: target,
149448
- reason,
149449
- ...depthOf(scope)
149450
- });
149357
+ pushReport(state3, { index, kind: "run", status: "error", flow: target, reason });
149451
149358
  state3.stopped = true;
149452
149359
  };
149453
- if (scope.runStack.includes(target)) {
149454
- return fail(`cyclic flow reference: ${[...scope.runStack, target].join(" \u2192 ")}`);
149360
+ if (runStack.includes(target)) {
149361
+ return fail(`cyclic flow reference: ${[...runStack, target].join(" \u2192 ")}`);
149455
149362
  }
149456
- if (scope.runStack.length >= MAX_RUN_DEPTH) {
149363
+ if (runStack.length >= MAX_RUN_DEPTH) {
149457
149364
  return fail("max run depth exceeded");
149458
149365
  }
149459
149366
  let fragment;
@@ -149464,21 +149371,11 @@ async function execRunStep(state3, step, scope) {
149464
149371
  } catch (err) {
149465
149372
  return fail(`could not load fragment "${target}": ${errMsg2(err)}`);
149466
149373
  }
149467
- pushReport(state3, { index, kind: "run", status: "pass", flow: target, ...depthOf(scope) });
149468
- await execSteps(
149469
- state3,
149470
- fragment.steps,
149471
- childScope(scope, { flow: target, runStack: [...scope.runStack, target] })
149472
- );
149374
+ pushReport(state3, { index, kind: "run", status: "pass", flow: target });
149375
+ await execSteps(state3, fragment.steps, target, [...runStack, target]);
149473
149376
  }
149474
- async function execLeafStep(state3, step, index, scope) {
149475
- const base = {
149476
- index,
149477
- kind: step.kind,
149478
- flow: scope.flow,
149479
- target: stepTarget(step),
149480
- ...depthOf(scope)
149481
- };
149377
+ async function execLeafStep(state3, step, index, sourceFlow) {
149378
+ const base = { index, kind: step.kind, flow: sourceFlow, target: stepTarget(step) };
149482
149379
  const { registry: registry2, ctx, device, signal } = state3;
149483
149380
  switch (step.kind) {
149484
149381
  case "echo":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.16.1-next.11",
3
+ "version": "0.16.1-next.3",
4
4
  "description": "MCP server for iOS Simulator and Android Emulator control",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {