@swmansion/argent 0.16.1-next.8 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/cli-cmds.mjs CHANGED
@@ -6226,6 +6226,7 @@ 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",
6229
6230
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
6230
6231
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
6231
6232
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -7133,7 +7134,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
7133
7134
  var SESSION_ID2 = randomUUID4();
7134
7135
  function readCliVersion() {
7135
7136
  if (true) {
7136
- return "0.16.0";
7137
+ return "0.16.1";
7137
7138
  }
7138
7139
  return "0.0.0";
7139
7140
  }
@@ -8423,6 +8424,11 @@ var STATUS_GLYPH = {
8423
8424
  error: "\u2717",
8424
8425
  skip: "\xB7"
8425
8426
  };
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
+ }
8426
8432
  function printHelp() {
8427
8433
  console.log(`Usage: argent flow <subcommand> [options]
8428
8434
 
@@ -8491,11 +8497,12 @@ function parseRunArgs(argv) {
8491
8497
  }
8492
8498
  function renderEchoLine(s) {
8493
8499
  if (!s.message) return void 0;
8500
+ const indent = stepIndent(s.depth);
8494
8501
  if (s.status === "skip") {
8495
8502
  const reason = s.reason ? ` \u2014 ${s.reason}` : "";
8496
- return ` ${STATUS_GLYPH.skip} \u203A ${s.message}${reason}`;
8503
+ return ` ${STATUS_GLYPH.skip} ${indent}\u203A ${s.message}${reason}`;
8497
8504
  }
8498
- return ` \u203A ${s.message}`;
8505
+ return ` ${indent}\u203A ${s.message}`;
8499
8506
  }
8500
8507
  function renderStepLine(s, n2, topFlow) {
8501
8508
  const where = s.flow && s.flow !== topFlow ? ` [${s.flow}]` : "";
@@ -8503,7 +8510,10 @@ function renderStepLine(s, n2, topFlow) {
8503
8510
  const label = what ? `${s.kind} ${what}` : s.kind;
8504
8511
  const reason = s.reason ? ` \u2014 ${s.reason}` : "";
8505
8512
  const glyph = s.status === "pass" && s.warning ? "\u26A0" : STATUS_GLYPH[s.status];
8506
- return ` ${glyph} ${String(n2).padStart(2)} ${label}${where}${reason}`;
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}`;
8507
8517
  }
8508
8518
  function renderSummary(report, opts = {}) {
8509
8519
  const warnings = report.steps.filter((s) => s.warning).length;
@@ -8590,10 +8600,10 @@ function renderReport(report) {
8590
8600
  }
8591
8601
  n2++;
8592
8602
  lines.push(renderStepLine(s, n2, report.flow));
8593
- if (s.warning) lines.push(` \u26A0 ${s.warning}`);
8603
+ if (s.warning) lines.push(renderUnderStepLine(s, n2, `\u26A0 ${s.warning}`));
8594
8604
  if (s.artifacts && typeof s.artifacts === "object") {
8595
8605
  for (const [k, v] of Object.entries(s.artifacts)) {
8596
- if (typeof v === "string") lines.push(` ${k}: ${v}`);
8606
+ if (typeof v === "string") lines.push(renderUnderStepLine(s, n2, `${k}: ${v}`));
8597
8607
  }
8598
8608
  }
8599
8609
  }
@@ -8668,7 +8678,7 @@ async function flow(argv, options) {
8668
8678
  }
8669
8679
  liveIndex++;
8670
8680
  console.log(renderStepLine(s, liveIndex, flowName));
8671
- if (s.warning) console.log(` \u26A0 ${s.warning}`);
8681
+ if (s.warning) console.log(renderUnderStepLine(s, liveIndex, `\u26A0 ${s.warning}`));
8672
8682
  };
8673
8683
  let report;
8674
8684
  try {
@@ -16120,6 +16120,7 @@ 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",
16123
16124
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
16124
16125
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
16125
16126
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -17027,7 +17028,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
17027
17028
  var SESSION_ID = randomUUID3();
17028
17029
  function readCliVersion() {
17029
17030
  if (true) {
17030
- return "0.16.0";
17031
+ return "0.16.1";
17031
17032
  }
17032
17033
  return "0.0.0";
17033
17034
  }
@@ -17652,6 +17652,7 @@ 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",
17655
17656
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
17656
17657
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
17657
17658
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -18896,6 +18897,11 @@ var STATUS_GLYPH = {
18896
18897
  error: "\u2717",
18897
18898
  skip: "\xB7"
18898
18899
  };
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
+ }
18899
18905
  function stepLabel(step) {
18900
18906
  if (step.kind === "echo") return step.message ?? "";
18901
18907
  if (step.kind === "run") return `run ${step.flow ?? ""}`.trim();
@@ -18919,12 +18925,15 @@ async function flowRunToMcpContent(result, ctx) {
18919
18925
  const reason = step.reason ?? step.error;
18920
18926
  const suffix = reason ? ` \u2014 ${reason}` : "";
18921
18927
  const warning = step.warning ? ` \u26A0 ${step.warning}` : "";
18922
- blocks.push({ type: "text", text: `[${num}] ${glyph}${stepLabel(step)}${suffix}${warning}` });
18928
+ blocks.push({
18929
+ type: "text",
18930
+ text: `[${num}] ${glyph}${stepIndent(step.depth)}${stepLabel(step)}${suffix}${warning}`
18931
+ });
18923
18932
  if (step.result !== void 0) {
18924
18933
  blocks.push(...await toMcpContent(step.result, step.outputHint, ctx, step.args));
18925
18934
  }
18926
18935
  if (isRecord(step.artifacts)) {
18927
- blocks.push(...await stepArtifactBlocks(step.artifacts, step.status, ctx));
18936
+ blocks.push(...await stepArtifactBlocks(step.artifacts, step.status, ctx, step.depth));
18928
18937
  }
18929
18938
  }
18930
18939
  if (result.ok !== void 0) {
@@ -18937,7 +18946,7 @@ async function flowRunToMcpContent(result, ctx) {
18937
18946
  }
18938
18947
  return blocks;
18939
18948
  }
18940
- async function stepArtifactBlocks(artifacts, status, ctx) {
18949
+ async function stepArtifactBlocks(artifacts, status, ctx, depth) {
18941
18950
  const failed = status === "fail" || status === "error";
18942
18951
  const entries = [];
18943
18952
  let diffImage;
@@ -18953,7 +18962,8 @@ async function stepArtifactBlocks(artifacts, status, ctx) {
18953
18962
  entries.push([k, v]);
18954
18963
  }
18955
18964
  }
18956
- const blocks = entries.length > 0 ? [{ type: "text", text: entries.map(([k, v]) => ` ${k}: ${v}`).join("\n") }] : [];
18965
+ const indent = stepIndent(depth);
18966
+ const blocks = entries.length > 0 ? [{ type: "text", text: entries.map(([k, v]) => ` ${indent}${k}: ${v}`).join("\n") }] : [];
18957
18967
  if (diffImage) blocks.push(diffImage);
18958
18968
  return blocks;
18959
18969
  }
@@ -293,6 +293,7 @@ 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",
296
297
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
297
298
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
298
299
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -104399,7 +104400,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
104399
104400
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
104400
104401
  function readCliVersion() {
104401
104402
  if (true) {
104402
- return "0.16.0";
104403
+ return "0.16.1";
104403
104404
  }
104404
104405
  return "0.0.0";
104405
104406
  }
@@ -104704,22 +104705,46 @@ function requireDylibIn(dir, name) {
104704
104705
  }
104705
104706
  return p;
104706
104707
  }
104708
+ function requireTcpArtifact(dir, name, kind, envVar) {
104709
+ const p = path5.join(dir, name);
104710
+ if (!fs3.existsSync(p)) {
104711
+ throw new Error(
104712
+ `TCP-transport ${kind} not found: ${p}. This ${kind} is required to drive an ios-remote (sim-remote) device over the QUIC tunnel. It ships in the argent package under bin/tcp/ and dylibs/tcp/ (platform-neutral); if you are running a local build, produce it with \`npm run build:ios-binaries:tcp\`. To point the lookup at a directory that already contains it, set ${envVar}=<dir>.`
104713
+ );
104714
+ }
104715
+ return p;
104716
+ }
104707
104717
  var bootstrapDylibPath = () => {
104708
104718
  requireDarwin("bootstrapDylibPath");
104709
104719
  return requireDylibIn(DYLIB_DIR, "libArgentInjectionBootstrap.dylib");
104710
104720
  };
104711
104721
  var bootstrapDylibPathTcp = () => {
104712
- return requireDylibIn(DYLIB_TCP_DIR, "libArgentInjectionBootstrap.dylib");
104722
+ return requireTcpArtifact(
104723
+ DYLIB_TCP_DIR,
104724
+ "libArgentInjectionBootstrap.dylib",
104725
+ "dylib",
104726
+ "ARGENT_NATIVE_DEVTOOLS_TCP_DIR"
104727
+ );
104713
104728
  };
104714
104729
  var bootstrapDylibPathTvos = () => {
104715
104730
  requireDarwin("bootstrapDylibPathTvos");
104716
104731
  return requireDylibIn(DYLIB_TVOS_DIR, "libArgentInjectionBootstrap.dylib");
104717
104732
  };
104718
104733
  var nativeDevtoolsDylibPathTcp = () => {
104719
- return requireDylibIn(DYLIB_TCP_DIR, "libNativeDevtoolsIos.dylib");
104734
+ return requireTcpArtifact(
104735
+ DYLIB_TCP_DIR,
104736
+ "libNativeDevtoolsIos.dylib",
104737
+ "dylib",
104738
+ "ARGENT_NATIVE_DEVTOOLS_TCP_DIR"
104739
+ );
104720
104740
  };
104721
104741
  var keyboardPatchDylibPathTcp = () => {
104722
- return requireDylibIn(DYLIB_TCP_DIR, "libKeyboardPatch.dylib");
104742
+ return requireTcpArtifact(
104743
+ DYLIB_TCP_DIR,
104744
+ "libKeyboardPatch.dylib",
104745
+ "dylib",
104746
+ "ARGENT_NATIVE_DEVTOOLS_TCP_DIR"
104747
+ );
104723
104748
  };
104724
104749
  function tcpInjectionDylibs() {
104725
104750
  return [
@@ -104737,8 +104762,8 @@ function hostPlatformKey() {
104737
104762
  function platformBinDir() {
104738
104763
  return path5.join(BIN_DIR, hostPlatformKey());
104739
104764
  }
104740
- function platformTcpBinDir() {
104741
- return process.env.ARGENT_SIMULATOR_SERVER_TCP_DIR ?? path5.join(platformBinDir(), "tcp");
104765
+ function tcpBinDir() {
104766
+ return process.env.ARGENT_SIMULATOR_SERVER_TCP_DIR ?? path5.join(BIN_DIR, "tcp");
104742
104767
  }
104743
104768
  function simulatorServerBinaryPath() {
104744
104769
  const p = path5.join(platformBinDir(), "simulator-server");
@@ -104766,7 +104791,7 @@ function axServiceBinaryPath() {
104766
104791
  return requireBinIn(platformBinDir(), "ax-service");
104767
104792
  }
104768
104793
  function axServiceBinaryPathTcp() {
104769
- return requireBinIn(platformTcpBinDir(), "ax-service");
104794
+ return requireTcpArtifact(tcpBinDir(), "ax-service", "binary", "ARGENT_SIMULATOR_SERVER_TCP_DIR");
104770
104795
  }
104771
104796
  function tvosAxServiceBinaryPath() {
104772
104797
  requireDarwin("tvos-ax-service");
@@ -105776,7 +105801,7 @@ var import_node_path4 = __toESM(require("node:path"));
105776
105801
  var import_semver = __toESM(require_semver2());
105777
105802
 
105778
105803
  // ../tool-server/package.json
105779
- var version3 = "0.16.0";
105804
+ var version3 = "0.16.1";
105780
105805
 
105781
105806
  // ../tool-server/src/utils/update-checker.ts
105782
105807
  var import_update_core = __toESM(require_dist4());
@@ -106143,6 +106168,7 @@ async function simctlSpawn(udid, opts) {
106143
106168
  const cmd = ["spawn", stripRemotePrefix(udid)];
106144
106169
  if (opts.binPath) cmd.push("--bin", opts.binPath);
106145
106170
  if (opts.detach) cmd.push("--detach");
106171
+ cmd.push("--json");
106146
106172
  const args = opts.args ?? [];
106147
106173
  if (args.length > 0) cmd.push("--", ...args);
106148
106174
  const { stdout } = await run(cmd, { timeoutMs: 6e4 });
@@ -116810,6 +116836,43 @@ function nativeDevtoolsRef(device, { transport = "unix" } = {}) {
116810
116836
  function getNativeDevtoolsSocketPath(udid) {
116811
116837
  return `/tmp/argent-nd-${udid.slice(0, 8)}.sock`;
116812
116838
  }
116839
+ function bindNativeDevtoolsUnixSocket(server, socketPath) {
116840
+ return new Promise((resolve7, reject) => {
116841
+ let retried = false;
116842
+ const onListening = () => {
116843
+ server.off("error", onError);
116844
+ resolve7();
116845
+ };
116846
+ const onError = (err) => {
116847
+ if ((err.code === "EADDRINUSE" || err.code === "EEXIST") && !retried) {
116848
+ retried = true;
116849
+ try {
116850
+ fs13.unlinkSync(socketPath);
116851
+ } catch {
116852
+ }
116853
+ server.listen(socketPath);
116854
+ return;
116855
+ }
116856
+ server.off("listening", onListening);
116857
+ server.off("error", onError);
116858
+ server.close();
116859
+ reject(
116860
+ new FailureError(
116861
+ `native-devtools failed to bind unix socket ${socketPath}: ${err.code ?? err.message}`,
116862
+ {
116863
+ error_code: FAILURE_CODES.NATIVE_DEVTOOLS_SOCKET_BIND_FAILED,
116864
+ failure_stage: "native_devtools_socket_bind",
116865
+ failure_area: "tool_server",
116866
+ error_kind: "network"
116867
+ }
116868
+ )
116869
+ );
116870
+ };
116871
+ server.on("error", onError);
116872
+ server.once("listening", onListening);
116873
+ server.listen(socketPath);
116874
+ });
116875
+ }
116813
116876
  var nativeDevtoolsBlueprint = {
116814
116877
  namespace: NATIVE_DEVTOOLS_NAMESPACE,
116815
116878
  getURN(device) {
@@ -117020,7 +117083,7 @@ var nativeDevtoolsBlueprint = {
117020
117083
  });
117021
117084
  await host.startProxy(udid, endpoint.port);
117022
117085
  } else {
117023
- server.listen(socketPath);
117086
+ await bindNativeDevtoolsUnixSocket(server, socketPath);
117024
117087
  }
117025
117088
  await ensureEnvReady().catch(() => {
117026
117089
  });
@@ -117385,6 +117448,10 @@ function adaptAXDescribeToDescribeResult(response) {
117385
117448
 
117386
117449
  // ../tool-server/src/tools/describe/platforms/ios/index.ts
117387
117450
  var DEGRADED_HINT = "This simulator was not booted through argent \u2014 system dialogs and native modals may not appear. You MUST call boot-device with force=true now to restart the simulator and apply full accessibility settings before continuing.";
117451
+ function tcpArtifactHint(err) {
117452
+ const message = err instanceof Error ? err.message : typeof err === "string" ? err : "";
117453
+ return /TCP-transport (?:binary|dylib) not found/.test(message) ? message : void 0;
117454
+ }
117388
117455
  var TVOS_HINT = "This is an Apple TV (tvOS) simulator, which the iOS accessibility service does not support. Use the `describe` tool to read the focused and focusable elements, `tv-remote` (up/down/left/right/select/back/menu/home) to move focus, and `keyboard` to type. See the argent-tv-interact skill.";
117389
117456
  var NON_INJECTABLE_HINT = "This is an Apple system app (com.apple.*), which cannot load argent's native-devtools instrumentation \u2014 the native view hierarchy is unavailable and restarting the app will NOT help. Take a `screenshot` to see the screen and interact by coordinate. " + NON_INJECTABLE_NATIVE_WARNING;
117390
117457
  function emptyTree() {
@@ -117408,9 +117475,9 @@ async function describeIos(registry2, device, params, options = {}) {
117408
117475
  const response = await axApi.describe();
117409
117476
  tree = adaptAXDescribeToDescribeResult(response);
117410
117477
  hint = axApi.degraded ? DEGRADED_HINT : void 0;
117411
- } catch {
117478
+ } catch (err) {
117412
117479
  tree = emptyTree();
117413
- hint = DEGRADED_HINT;
117480
+ hint = tcpArtifactHint(err) ?? DEGRADED_HINT;
117414
117481
  }
117415
117482
  if (tree.children.length > 0) {
117416
117483
  return { tree, source: "ax-service", hint };
@@ -125750,6 +125817,14 @@ init_zod();
125750
125817
  var import_node_child_process24 = require("node:child_process");
125751
125818
  var import_node_util18 = require("node:util");
125752
125819
  init_src();
125820
+
125821
+ // ../tool-server/src/tools/open-url/deep-link-note.ts
125822
+ function httpDeepLinkNote(url2) {
125823
+ if (!/^https?:/i.test(url2)) return void 0;
125824
+ 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.";
125825
+ }
125826
+
125827
+ // ../tool-server/src/tools/open-url/platforms/ios.ts
125753
125828
  var execFileAsync18 = (0, import_node_util18.promisify)(import_node_child_process24.execFile);
125754
125829
  var iosImpl3 = {
125755
125830
  requires: ["xcrun"],
@@ -125769,7 +125844,7 @@ var iosImpl3 = {
125769
125844
  { cause: err instanceof Error ? err : new Error(String(err)) }
125770
125845
  );
125771
125846
  }
125772
- return { opened: true, url: params.url };
125847
+ return { opened: true, url: params.url, note: httpDeepLinkNote(params.url) };
125773
125848
  }
125774
125849
  };
125775
125850
 
@@ -125793,7 +125868,7 @@ var androidImpl5 = {
125793
125868
  error_kind: "subprocess"
125794
125869
  });
125795
125870
  }
125796
- return { opened: true, url: params.url };
125871
+ return { opened: true, url: params.url, note: httpDeepLinkNote(params.url) };
125797
125872
  }
125798
125873
  };
125799
125874
 
@@ -125802,7 +125877,7 @@ var iosRemoteImpl5 = {
125802
125877
  requires: ["sim-remote"],
125803
125878
  handler: async (_services, params) => {
125804
125879
  await simctlOpenUrl(params.udid, params.url);
125805
- return { opened: true, url: params.url };
125880
+ return { opened: true, url: params.url, note: httpDeepLinkNote(params.url) };
125806
125881
  }
125807
125882
  };
125808
125883
 
@@ -125833,7 +125908,8 @@ var openUrlTool = {
125833
125908
  description: `Open a URL or URL scheme on the device.
125834
125909
  Use to navigate to a web page or deep-link into an app. On Chromium, this navigates the primary renderer to the given URL.
125835
125910
  Cross-platform schemes: https://, tel:, mailto:. iOS also: messages://, settings://, maps://. Android also: geo:, plus any app-specific deep link.
125836
- Returns { opened, url }. Fails if no app is registered to handle the URI (iOS/Android) or the renderer rejects the navigation (Chromium).`,
125911
+ 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.
125912
+ 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).`,
125837
125913
  zodSchema: zodSchema14,
125838
125914
  capability: capability6,
125839
125915
  services: (params) => {
@@ -149132,7 +149208,11 @@ returns a notice with the prerequisite instead of running.`,
149132
149208
  };
149133
149209
  let aborted2;
149134
149210
  try {
149135
- await execSteps(state3, flow.steps, params.name, [params.name]);
149211
+ await execSteps(state3, flow.steps, {
149212
+ flow: params.name,
149213
+ runStack: [params.name],
149214
+ depth: 0
149215
+ });
149136
149216
  } finally {
149137
149217
  aborted2 = state3.signal?.aborted === true;
149138
149218
  if (state3.pinned) await restoreStatusBar(device);
@@ -149267,7 +149347,13 @@ function stepTarget(step) {
149267
149347
  return void 0;
149268
149348
  }
149269
149349
  }
149270
- async function execSteps(state3, steps, sourceFlow, runStack) {
149350
+ function childScope(scope, overrides = {}) {
149351
+ return { ...scope, ...overrides, depth: scope.depth + 1 };
149352
+ }
149353
+ function depthOf(scope) {
149354
+ return scope.depth ? { depth: scope.depth } : {};
149355
+ }
149356
+ async function execSteps(state3, steps, scope) {
149271
149357
  for (const step of steps) {
149272
149358
  const index = state3.reports.length;
149273
149359
  if (state3.stopped) {
@@ -149275,13 +149361,14 @@ async function execSteps(state3, steps, sourceFlow, runStack) {
149275
149361
  index,
149276
149362
  kind: step.kind,
149277
149363
  status: "skip",
149278
- flow: sourceFlow,
149364
+ flow: scope.flow,
149279
149365
  target: stepTarget(step),
149366
+ ...depthOf(scope),
149280
149367
  // Carry the echo's message so a skipped narration renders as a skip
149281
149368
  // line rather than vanishing — matching reportBlockSkipped.
149282
149369
  ...step.kind === "echo" ? { message: step.message } : {}
149283
149370
  });
149284
- if (step.kind === "when") reportBlockSkipped(state3, step.steps, sourceFlow);
149371
+ if (step.kind === "when") reportBlockSkipped(state3, step.steps, childScope(scope));
149285
149372
  continue;
149286
149373
  }
149287
149374
  if (state3.signal?.aborted) {
@@ -149291,22 +149378,25 @@ async function execSteps(state3, steps, sourceFlow, runStack) {
149291
149378
  kind: step.kind,
149292
149379
  status: "skip",
149293
149380
  reason: "run aborted",
149294
- flow: sourceFlow,
149381
+ flow: scope.flow,
149295
149382
  target: stepTarget(step),
149383
+ ...depthOf(scope),
149296
149384
  ...step.kind === "echo" ? { message: step.message } : {}
149297
149385
  });
149298
- if (step.kind === "when") reportBlockSkipped(state3, step.steps, sourceFlow, "run aborted");
149386
+ if (step.kind === "when") {
149387
+ reportBlockSkipped(state3, step.steps, childScope(scope), "run aborted");
149388
+ }
149299
149389
  continue;
149300
149390
  }
149301
149391
  if (step.kind === "run") {
149302
- await execRunStep(state3, step, runStack);
149392
+ await execRunStep(state3, step, scope);
149303
149393
  continue;
149304
149394
  }
149305
149395
  if (step.kind === "when") {
149306
- await execWhenStep(state3, step, sourceFlow, runStack);
149396
+ await execWhenStep(state3, step, scope);
149307
149397
  continue;
149308
149398
  }
149309
- const report = await execLeafStep(state3, step, index, sourceFlow);
149399
+ const report = await execLeafStep(state3, step, index, scope);
149310
149400
  pushReport(state3, report);
149311
149401
  if (report.status === "fail" || report.status === "error") state3.stopped = true;
149312
149402
  }
@@ -149315,7 +149405,7 @@ function describeWhenCondition(cond) {
149315
149405
  if (cond.kind === "platform") return `platform ${cond.platform}`;
149316
149406
  return conditionLabel(cond, describeSelector);
149317
149407
  }
149318
- function reportBlockSkipped(state3, steps, sourceFlow, reason) {
149408
+ function reportBlockSkipped(state3, steps, scope, reason) {
149319
149409
  for (const step of steps) {
149320
149410
  pushReport(state3, {
149321
149411
  index: state3.reports.length,
@@ -149325,17 +149415,20 @@ function reportBlockSkipped(state3, steps, sourceFlow, reason) {
149325
149415
  // A `run:` line is attributed to the fragment it names, matching the
149326
149416
  // executed marker in execRunStep; everything else belongs to the
149327
149417
  // enclosing flow.
149328
- flow: step.kind === "run" ? step.flow : sourceFlow,
149418
+ flow: step.kind === "run" ? step.flow : scope.flow,
149329
149419
  target: stepTarget(step),
149420
+ ...depthOf(scope),
149330
149421
  ...step.kind === "echo" ? { message: step.message } : {}
149331
149422
  });
149332
- if (step.kind === "when") reportBlockSkipped(state3, step.steps, sourceFlow, reason);
149423
+ if (step.kind === "when") reportBlockSkipped(state3, step.steps, childScope(scope), reason);
149333
149424
  }
149334
149425
  }
149335
- async function execWhenStep(state3, step, sourceFlow, runStack) {
149426
+ async function execWhenStep(state3, step, scope) {
149336
149427
  const index = state3.reports.length;
149337
149428
  const label = describeWhenCondition(step.condition);
149338
149429
  const target = stepTarget(step);
149430
+ const marker = { index, kind: "when", flow: scope.flow, target, ...depthOf(scope) };
149431
+ const inner = childScope(scope);
149339
149432
  let met;
149340
149433
  if (step.condition.kind === "platform") {
149341
149434
  const platform = state3.device.platform === "ios-remote" ? "ios" : state3.device.platform;
@@ -149343,28 +149436,18 @@ async function execWhenStep(state3, step, sourceFlow, runStack) {
149343
149436
  } else {
149344
149437
  const probe3 = await probeWhenCondition(state3, step.condition);
149345
149438
  if (probe3.aborted) {
149346
- pushReport(state3, {
149347
- index,
149348
- kind: "when",
149349
- status: "skip",
149350
- reason: "run aborted",
149351
- flow: sourceFlow,
149352
- target
149353
- });
149354
- reportBlockSkipped(state3, step.steps, sourceFlow, "run aborted");
149439
+ pushReport(state3, { ...marker, status: "skip", reason: "run aborted" });
149440
+ reportBlockSkipped(state3, step.steps, inner, "run aborted");
149355
149441
  return;
149356
149442
  }
149357
149443
  if (!probe3.ok && probe3.indeterminate) {
149358
149444
  pushReport(state3, {
149359
- index,
149360
- kind: "when",
149445
+ ...marker,
149361
149446
  status: "error",
149362
- reason: `could not evaluate when guard (${label}): ${probe3.reason}`,
149363
- flow: sourceFlow,
149364
- target
149447
+ reason: `could not evaluate when guard (${label}): ${probe3.reason}`
149365
149448
  });
149366
149449
  state3.stopped = true;
149367
- reportBlockSkipped(state3, step.steps, sourceFlow, "when guard errored");
149450
+ reportBlockSkipped(state3, step.steps, inner, "when guard errored");
149368
149451
  return;
149369
149452
  }
149370
149453
  met = probe3.ok;
@@ -149372,37 +149455,34 @@ async function execWhenStep(state3, step, sourceFlow, runStack) {
149372
149455
  if (!met) {
149373
149456
  const n = step.steps.length;
149374
149457
  pushReport(state3, {
149375
- index,
149376
- kind: "when",
149458
+ ...marker,
149377
149459
  status: "skip",
149378
- reason: `condition not met (${label}) \u2014 block skipped (${n} step${n === 1 ? "" : "s"})`,
149379
- flow: sourceFlow,
149380
- target
149460
+ reason: `condition not met (${label}) \u2014 block skipped (${n} step${n === 1 ? "" : "s"})`
149381
149461
  });
149382
- reportBlockSkipped(state3, step.steps, sourceFlow, "when block skipped");
149462
+ reportBlockSkipped(state3, step.steps, inner, "when block skipped");
149383
149463
  return;
149384
149464
  }
149385
- pushReport(state3, {
149386
- index,
149387
- kind: "when",
149388
- status: "pass",
149389
- reason: `condition met (${label})`,
149390
- flow: sourceFlow,
149391
- target
149392
- });
149393
- await execSteps(state3, step.steps, sourceFlow, runStack);
149465
+ pushReport(state3, { ...marker, status: "pass", reason: `condition met (${label})` });
149466
+ await execSteps(state3, step.steps, inner);
149394
149467
  }
149395
- async function execRunStep(state3, step, runStack) {
149468
+ async function execRunStep(state3, step, scope) {
149396
149469
  const index = state3.reports.length;
149397
149470
  const target = step.flow;
149398
149471
  const fail = (reason) => {
149399
- pushReport(state3, { index, kind: "run", status: "error", flow: target, reason });
149472
+ pushReport(state3, {
149473
+ index,
149474
+ kind: "run",
149475
+ status: "error",
149476
+ flow: target,
149477
+ reason,
149478
+ ...depthOf(scope)
149479
+ });
149400
149480
  state3.stopped = true;
149401
149481
  };
149402
- if (runStack.includes(target)) {
149403
- return fail(`cyclic flow reference: ${[...runStack, target].join(" \u2192 ")}`);
149482
+ if (scope.runStack.includes(target)) {
149483
+ return fail(`cyclic flow reference: ${[...scope.runStack, target].join(" \u2192 ")}`);
149404
149484
  }
149405
- if (runStack.length >= MAX_RUN_DEPTH) {
149485
+ if (scope.runStack.length >= MAX_RUN_DEPTH) {
149406
149486
  return fail("max run depth exceeded");
149407
149487
  }
149408
149488
  let fragment;
@@ -149413,11 +149493,21 @@ async function execRunStep(state3, step, runStack) {
149413
149493
  } catch (err) {
149414
149494
  return fail(`could not load fragment "${target}": ${errMsg2(err)}`);
149415
149495
  }
149416
- pushReport(state3, { index, kind: "run", status: "pass", flow: target });
149417
- await execSteps(state3, fragment.steps, target, [...runStack, target]);
149496
+ pushReport(state3, { index, kind: "run", status: "pass", flow: target, ...depthOf(scope) });
149497
+ await execSteps(
149498
+ state3,
149499
+ fragment.steps,
149500
+ childScope(scope, { flow: target, runStack: [...scope.runStack, target] })
149501
+ );
149418
149502
  }
149419
- async function execLeafStep(state3, step, index, sourceFlow) {
149420
- const base = { index, kind: step.kind, flow: sourceFlow, target: stepTarget(step) };
149503
+ async function execLeafStep(state3, step, index, scope) {
149504
+ const base = {
149505
+ index,
149506
+ kind: step.kind,
149507
+ flow: scope.flow,
149508
+ target: stepTarget(step),
149509
+ ...depthOf(scope)
149510
+ };
149421
149511
  const { registry: registry2, ctx, device, signal } = state3;
149422
149512
  switch (step.kind) {
149423
149513
  case "echo":
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.16.1-next.8",
3
+ "version": "0.16.1",
4
4
  "description": "MCP server for iOS Simulator and Android Emulator control",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {