@swmansion/argent 0.25.1-next.16 → 0.25.1-next.18

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
@@ -21857,7 +21857,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
21857
21857
  var SESSION_ID2 = randomUUID5();
21858
21858
  function readCliVersion() {
21859
21859
  if (true) {
21860
- return "0.25.1-next.16";
21860
+ return "0.25.1-next.18";
21861
21861
  }
21862
21862
  return "0.0.0";
21863
21863
  }
@@ -16710,7 +16710,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16710
16710
  var SESSION_ID = randomUUID4();
16711
16711
  function readCliVersion() {
16712
16712
  if (true) {
16713
- return "0.25.1-next.16";
16713
+ return "0.25.1-next.18";
16714
16714
  }
16715
16715
  return "0.0.0";
16716
16716
  }
@@ -94704,7 +94704,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
94704
94704
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
94705
94705
  function readCliVersion() {
94706
94706
  if (true) {
94707
- return "0.25.1-next.16";
94707
+ return "0.25.1-next.18";
94708
94708
  }
94709
94709
  return "0.0.0";
94710
94710
  }
@@ -109055,16 +109055,18 @@ async function browserWebSocketUrl(port, signal) {
109055
109055
  }
109056
109056
  return url2;
109057
109057
  }
109058
+ var CDP_HTTP_TIMEOUT_MS = 5e3;
109058
109059
  async function fetchJson(url2, signal) {
109059
109060
  let res;
109060
109061
  try {
109061
- res = await fetch(url2, { signal });
109062
+ res = await fetch(url2, { signal: signal ?? AbortSignal.timeout(CDP_HTTP_TIMEOUT_MS) });
109062
109063
  } catch (err) {
109063
109064
  if (err instanceof Error && err.name === "AbortError") throw err;
109065
+ const timedOut2 = err instanceof Error && err.name === "TimeoutError";
109064
109066
  const code = err.code ?? err.cause?.code;
109065
- const network_failure = code === "ECONNREFUSED" ? "connection_refused" : code === "ECONNRESET" ? "connection_reset" : code === "ETIMEDOUT" || code === "UND_ERR_CONNECT_TIMEOUT" ? "timeout" : "other";
109067
+ const network_failure = timedOut2 ? "timeout" : code === "ECONNREFUSED" ? "connection_refused" : code === "ECONNRESET" ? "connection_reset" : code === "ETIMEDOUT" || code === "UND_ERR_CONNECT_TIMEOUT" ? "timeout" : "other";
109066
109068
  throw new FailureError(
109067
- `Chromium CDP discovery: GET ${url2} could not connect. Is the app running with --remote-debugging-port?`,
109069
+ timedOut2 ? `Chromium CDP discovery: GET ${url2} timed out. Something is holding port ${new URL(url2).port} without answering CDP.` : `Chromium CDP discovery: GET ${url2} could not connect. Is the app running with --remote-debugging-port?`,
109068
109070
  {
109069
109071
  error_code: FAILURE_CODES.CHROMIUM_CDP_UNREACHABLE,
109070
109072
  failure_stage: "chromium_cdp_discovery_connect",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.25.1-next.16",
3
+ "version": "0.25.1-next.18",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",
@@ -15,7 +15,7 @@ Verify with `adb version` and `emulator -list-avds`.
15
15
 
16
16
  1. **Find a ready device** — call `list-devices`. Filter for entries with `platform: "android"`. Ready devices (`state: "device"`) come first. Pick the first `serial` (e.g. `emulator-5554`) unless the user specified one.
17
17
  2. **Boot if needed** — if nothing Android is ready, call `boot-device` with `avdName: <name>` from the same call's `avds` list. The tool transparently picks hot vs cold boot: it probes the AVD's `default_boot` snapshot, restores it under a tight deadline when usable, and falls back to a full cold boot otherwise. Hot path is typically ~30s; cold path takes 2–10 min. On any stage failure the tool kills the emulator process it started so your next call starts from a clean state.
18
- 3. **Metro (for React Native)** — once a device is up, run `adb -s <serial> reverse tcp:8081 tcp:8081` so the device can reach Metro on your host. Repeat if the device restarts. See the `argent-metro-debugger` skill.
18
+ 3. **Metro (for React Native)** — once a device is up, run `adb -s <serial> reverse tcp:8081 tcp:8081` so the device can reach Metro on your host. Repeat if the device restarts.
19
19
 
20
20
  ## 3. Using the device
21
21
 
@@ -5,7 +5,7 @@ description: Debug a JS runtime via CDP using argent debugger tools. Primary pat
5
5
 
6
6
  ## 1. Prerequisites
7
7
 
8
- Physical iPhone: not supported; every `debugger-*` tool rejects `kind: "device"`. Use a simulator.
8
+ Physical iPhone: not supported; every `debugger-*` tool rejects `kind: "device"`.
9
9
 
10
10
  For **React Native (iOS / Android)**: requires **Metro dev server running** (default `localhost:8081`) and **a React Native app connected to Metro** (at least one CDP target). Verify via `debugger-status` — it returns `status: "connected"` or `status: "not_connected"` with a `reason` and `guidance` (it does not fail when the debugger is unreachable).
11
11
 
@@ -15,17 +15,17 @@ For **Chromium (CDP)**: requires a Chromium/CDP app already available — an Ele
15
15
 
16
16
  ### Android: reverse port for Metro
17
17
 
18
- Android emulators and physical devices do not resolve the host's `localhost` by default. Before the RN app can reach Metro, forward port 8081 (or whichever port Metro is on) from the device back to the host:
18
+ Android emulators and physical devices do not resolve the host's `localhost` by default and the RN app fails to reach Metro server. To prevent this issue, forward port 8081 (or whichever port Metro is on) from the device back to the host:
19
19
 
20
20
  ```bash
21
21
  adb -s <serial> reverse tcp:8081 tcp:8081
22
22
  ```
23
23
 
24
- `<serial>` is the Android `serial` from `list-devices`. Once reversed, the app on the device connects to Metro just like an iOS simulator does, and all `debugger-*` / `network-*` / `react-profiler-*` tools work unchanged. If the device restarts or adb drops, re-run the command. A failing Metro connection on Android almost always means `adb reverse` has not been done or has been lost.
24
+ `<serial>` is the Android `serial` from `list-devices`. If the device restarts or adb drops, re-run the command. A failing Metro connection on Android almost always means `adb reverse` has not been done or has been lost.
25
25
 
26
26
  ## 2. Tool Overview
27
27
 
28
- All tools accept `port` (default 8081) AND `device_id` (the iOS Simulator UDID, Android serial, or Vega serial — a.k.a. `logicalDeviceId`, the CDP-reported id that matches the device). Vega's legacy inspector reports no `logicalDeviceId`, so there keep passing the serial. Always make sure you target the correct app on the correct device.
28
+ All tools accept `port` (default 8081) AND `device_id` (the iOS Simulator UDID, Android serial, or Vega serial — a.k.a. `logicalDeviceId`, the CDP-reported id that matches the device). Vega's legacy inspector reports no `logicalDeviceId`, so there keep passing the serial.
29
29
 
30
30
  One Metro port can serve multiple connected devices (e.g. two simulators on `localhost:8081`, or an iOS simulator alongside an Android emulator with `adb reverse` set up). `device_id` pins every debugger/network/profiler call to a specific device so sessions do not collide.
31
31
 
@@ -65,11 +65,9 @@ With two or more devices on one Metro, `debugger-connect` refuses a udid/serial
65
65
  | Best for | Layout overview; finding tap targets; user-defined component hierarchy | Identifying a visible element and tracing it to its source file |
66
66
  | Use when | "What's on screen and where?" | "What component is this and where is it defined?" |
67
67
 
68
- Both can point to source files, but `inspect-element` is purpose-built for source tracing. `component-tree` is for orientation and tap-target discovery.
69
-
70
68
  ### `includeSkipped` guidance
71
69
 
72
- Applies to both `debugger-component-tree` and `debugger-inspect-element`. Set to `true` only when debugging filter behavior — e.g., an expected component is missing from output, or you need to inspect a very specific branch of the tree (not just an overview).
70
+ Set to `true` only when debugging filter behavior — e.g., an expected component is missing from output, or you need to inspect a very specific branch of the tree (not just an overview).
73
71
 
74
72
  > **Warning:** Output can be very large. Always combine with `maxNodes` (component-tree) or `maxItems` (inspect-element) and increase it incrementally (e.g., start at 50, then grow). Do not use `includeSkipped` without a limit on large apps.
75
73
 
@@ -115,8 +113,7 @@ When reading from the log file:
115
113
 
116
114
  - Never `Read` the log file directly. Use `grep` or shell commands with limits using the above file format tips.
117
115
  - Default to `-m 50` unless you need more.
118
- - Use `tail -N` recent entries.
119
- - `clusters[].message` is a truncated, grouped prefix - grep a short fragment of it, not the whole string.
116
+ - `clusters[].message` gives you the exact text which you may look for
120
117
  - Search bracketed text such as `[L:42]` or `[object Object]` with `grep -F`, or escape the brackets (`\[L:42\]`). Unescaped, `[...]` is a character class: `grep '[L:42]'` matches every line in the file.
121
118
 
122
119
  > **If the file is too large** Delegate to an `Explore` subagent with the file path, the format spec above, the specific patterns you need, and Golden Rule 4's untrusted-data caveat.
@@ -1,6 +1,6 @@
1
1
  # Failure Scenarios: Recovery Steps
2
2
 
3
- When a debugger tool fails, use **`debugger-status`** first to diagnose. Note: `debugger-status` and `debugger-log-registry` do **not** fail when the debugger is simply unreachable — they return `{ status: "not_connected", reason, detail, guidance }` (the `detail` field carries the same error text other tools throw). Match the error, `reason`, or situation below and act as specified. Do not retry the same failing tool repeatedly without following the recovery steps.
3
+ When a debugger tool fails, use **`debugger-status`** first to diagnose. Note: `debugger-status` and `debugger-log-registry` do **not** fail when the debugger is simply unreachable — they return `{ status: "not_connected", reason, detail, guidance }` (the `detail` field carries the same error text other tools throw). Do not retry the same failing tool repeatedly without following the recovery steps.
4
4
 
5
5
  | Scenario | Error or situation | What to do |
6
6
  | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -24,4 +24,4 @@ module.exports = function (api) {
24
24
  };
25
25
  ```
26
26
 
27
- After adding the plugin, restart Metro (`npx react-native start --reset-cache` or `npx expo start --clear`) and reload the app. The tool will then automatically pick up `_debugSource` and resolve components to their source files. No extra `npm install` needed — the plugin ships with `babel-preset-expo` and `@babel/preset-env`.
27
+ After adding the plugin, restart Metro (`npx react-native start --reset-cache` or `npx expo start --clear`) and reload the app. No extra `npm install` needed — the plugin ships with `babel-preset-expo` and `@babel/preset-env`.
@@ -19,7 +19,7 @@ description: Control and inspect TV apps via argent — Apple TV (tvOS), Android
19
19
 
20
20
  ## Tools
21
21
 
22
- - `describe {udid}` — focus view: the focused / `[selected]` element + focusable elements with labels and normalized frames. The discovery tool — call before and after navigating. Empty tree → see the per-platform notes.
22
+ - `describe {udid}` — focus view: the focused / `[selected]` element + focusable elements with labels and normalized frames. Call before and after navigating. Empty tree → see the per-platform notes.
23
23
  - `tv-remote {udid, button}` — D-pad / remote. `button` is one key **or a whole path** (run in one call). Keys: `up`/`down`/`left`/`right`, `select`, `back`, `menu`, `home`, `playPause`, plus media keys `rewind`/`fastForward`/`next`/`previous`/`volumeUp`/`volumeDown`/`mute`. Single: `{button:"down"}`; repeat: `{button:"down", repeat:3}`; path: `{button:["up","right","select"]}`.
24
24
  - `keyboard {udid, text}` — type into the focused field (focus it with `tv-remote` first). One call carries `text` or `key`, never both — to type and then press a key, send two `keyboard` steps in one `run-sequence`. Named `key` presses (e.g. `{key:"enter"}`) work on Vega; on Apple TV / Android TV move focus with `tv-remote` instead.
25
25
  - `launch-app` / `restart-app` / `reinstall-app {udid, bundleId}` — `bundleId` from the app manifest. Vega `reinstall-app` takes `appPath` = a `.vpkg`.