@swmansion/argent 0.16.1-next.9 → 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
  }
@@ -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",
@@ -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) => {
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.9",
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": {