@swmansion/argent 0.34.1-next.57 → 0.34.1-next.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.34.1-next.57",
3
+ "version": "0.34.1-next.59",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
6
6
  "license": "Apache-2.0",
@@ -55,4 +55,4 @@ Read `references/e2e.md` before recording or writing a test for a Mac app.
55
55
 
56
56
  ## React Native
57
57
 
58
- For React Native Debug builds on macOS, including Mac Catalyst, start Metro before `boot-device` (see `argent-react-native-app-workflow`). Inspect the UI with `describe`. The JavaScript debugger tools are unavailable for Mac apps.
58
+ For React Native Debug builds on macOS, including Mac Catalyst, start Metro before `boot-device` (see `argent-react-native-app-workflow`). Use `describe` for UI targets. For JavaScript debugging and network capture, follow the Mac app workflow in `argent-metro-debugger`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-metro-debugger
3
- description: Debug a JS runtime via CDP using argent debugger tools. Primary path is React Native via Metro (iOS / Android / Vega); a subset of the tools (debugger-connect, debugger-status, debugger-evaluate, debugger-log-registry) also drive a Chromium (CDP) app's renderer (an Electron app, or any Chromium browser exposing CDP) through the same surface. Use when connecting to the runtime, inspecting React components, reading console logs, or evaluating JavaScript.
3
+ description: Debug JavaScript with Argent in React Native apps on iOS, Android, Vega, and macOS, or in Chromium and Electron over CDP. Use when connecting to a runtime, inspecting React components, reading console logs, or evaluating JavaScript.
4
4
  ---
5
5
 
6
6
  ## 1. Prerequisites
@@ -14,12 +14,14 @@ Physical iPhone: not supported; every `debugger-*` tool rejects `kind: "device"`
14
14
 
15
15
  ## 2. Tools
16
16
 
17
- Pass the same `device_id`, the id from `list-devices`, to every call. With two or more devices on one Metro, `debugger-connect` refuses a serial, or a simulator udid it cannot match to one Metro device by name, and returns a `logicalDeviceId`: use that as `device_id` from then on, and include it in `stop-all-simulator-servers`' `devices` at teardown, or the debugger session outlives yours. `network-capture-start` and `network-capture-stop` take a `udid`, not a `device_id`: always pass them the id from `list-devices`, never a `logicalDeviceId`. On a shared Metro, their JS layer is unavailable until you also pass the device's `logicalDeviceId` in their own `logicalDeviceId` parameter; then read with that id as `device_id`.
17
+ Use the `device_id` from `list-devices` and keep the same ID and Metro port across calls. On shared Metro, if `debugger-connect` cannot match an iOS simulator UDID or Android serial, it lists logical IDs. Choose the requested device's `logicalDeviceId` for subsequent debugger calls. If you later tear down this session, include that ID in `stop-all-simulator-servers`'s `devices`.
18
+
19
+ On iOS and Android, use the `list-devices` ID as `udid` for `network-capture-start` and `network-capture-stop`. If shared Metro requires a logical ID, pass it as `logicalDeviceId`, then use it as `device_id` when reading the JS capture.
18
20
 
19
21
  | Tool | Use for |
20
22
  | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21
23
  | `debugger-status` | Diagnosing the connection. Call it first when anything fails |
22
- | `debugger-connect` | Connecting to the runtime's CDP (Metro on iOS / Android / Vega; the page session on Chromium) |
24
+ | `debugger-connect` | Opening the session and starting console capture |
23
25
  | `debugger-reload-metro` | Reloading the JS bundle of an attached app |
24
26
  | `restart-app` | Relaunching the app when it lost its Metro connection |
25
27
  | `debugger-component-tree` | Component names and testIDs on screen. Find tap targets with `describe` |
@@ -30,6 +32,16 @@ Pass the same `device_id`, the id from `list-devices`, to every call. With two o
30
32
 
31
33
  A component missing from `debugger-component-tree`? `includeSkipped` only adds counts of what was pruned. Use `onScreenOnly: false` for one off screen, or `debugger-inspect-element` at its point for one on screen.
32
34
 
35
+ ### React Native Mac apps
36
+
37
+ 1. Start Metro before launching a Debug Hermes build of react-native-macos 0.76+ or React Native for Mac Catalyst. Launch Mac Catalyst through Argent so it can identify its runtime. If `boot-device` refuses a hardened react-native-macos build, have the user start it from Xcode. JavaScript tools still work. UI inspection and gestures require a build Argent can control.
38
+ 2. Keep `macos-app-<bundle id>` as `device_id`, even on shared Metro. If a call returns `device_mismatch`, check that the Debug bundle loaded from the requested Metro port. The IDs in the error identify other targets.
39
+ 3. Call `view-network-logs` before reproducing a JavaScript request and again after a reload. For native traffic, use `network-capture-start` and read with `native-network-logs`. The two logs can show the same `fetch()` request.
40
+
41
+ Use `describe` for tap targets. The React tools use the root with the most components, which can be in a different window. Before using a point, verify that both tools are looking at the same window. To inspect a tap point from the React tree, multiply its fractions by the width and height in `Screen: WxH`. The resulting points include the title bar. On the old architecture (Paper), native views around the React root can shift those points. Check the returned component against the intended control.
42
+
43
+ If `debugger-reload-metro` fails to reload the Mac app, use `restart-app` for an Argent-controlled build. For a build started from Xcode, restart it there.
44
+
33
45
  ## 3. Rules and recovery
34
46
 
35
47
  1. **`debugger-status` first when something fails.** Only `debugger-status` and `debugger-log-registry` return `status: "not_connected"` with a `guidance`; the other tools throw. Follow the `guidance` once; do not retry in a loop.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-screen-recording
3
- description: Record a video of an iOS simulator, cabled iPhone, or Android emulator/device screen using argent MCP tools. Use when the user asks to record the screen, capture a video of a flow, interaction, or animation, produce a screen recording, or document app behavior as a video clip.
3
+ description: Record a screen video with Argent on an iOS simulator, cabled iPhone, Android emulator or device, or Mac app. Use when the user asks for a screen recording or a video of a flow, interaction, animation, or other app behavior.
4
4
  ---
5
5
 
6
6
  `screen-recording-start` and `screen-recording-stop` carry the options (`timeLimitSeconds`, `trimStatic`, `showTouches`) and the result fields. One recording per device at a time; different devices can record concurrently.
@@ -14,18 +14,19 @@ A forgotten recording keeps capturing until its `timeLimitSeconds` cap fires, ho
14
14
 
15
15
  ## 2. Workflow
16
16
 
17
- 1. Get the device booted and the app into the state the video should open on (`list-devices`, `launch-app`, `argent-device-interact`).
17
+ 1. Find the target with `list-devices`. Use `argent-device-interact` for mobile targets or `argent-macos-app-interact` for Mac apps. Boot the target if needed, launch the app, and navigate to the first screen you want to capture.
18
18
  2. Call `screen-recording-start` with `udid` and a `timeLimitSeconds` slightly above the expected interaction length.
19
19
  3. Set the end-of-recording reminder from §1; this step is not optional.
20
- 4. Drive the interaction (`argent-device-interact`). Prefer `run-sequence` for tight multi-step interactions so tool-call latency does not pad the video.
20
+ 4. Use `run-sequence` for known steps that need no inspection between actions. Use individual calls when the next action depends on what the app shows.
21
21
  5. Call `screen-recording-stop` with the same `udid`. Check `warning` (cap-triggered stop, early encoder exit, dropped frame stream, possibly truncated file) and confirm the file has a sane size before presenting it.
22
22
 
23
23
  **Where the file lands.** A finished recording is saved durably on the **client**, even with a remote `argent link` tool-server: into `<project>/.argent/recordings/` (the nearest ancestor of the client's working directory with a `.git`/`package.json`/`.argent`), or `~/.argent/recordings/` outside a project. Change it with `argent config set recordings.directory <dir>` (`--scope project` for a per-repo choice). Mention the path to the user, and that the file is untracked: add it to `.gitignore` or clean it up if it shouldn't be committed.
24
24
 
25
25
  ## 3. Platform notes and limits
26
26
 
27
- - **Recordable**: iOS simulators (local and remote `remote:`), physical iPhones on a USB cable, Android emulators and physical Android devices. **Unsupported**: iPhones reachable only over Wi-Fi, tvOS simulators, Chromium apps, Vega/Fire TV and HarmonyOS. For a still frame use `screenshot`; for a replayable interaction script use `argent-create-e2e`.
27
+ - **Supported targets.** iOS simulators (local and remote), cabled iPhones, Android emulators and devices, and native Mac apps including Mac Catalyst. Use `screenshot` for a still image or `argent-create-e2e` for a replayable test.
28
28
  - **Physical iPhone**: needs `state: "connected"` with `transportType: "wired"` in `list-devices`. The first recording on a Mac compiles a helper (a few seconds) and macOS asks the user to allow camera access for `ios-screen-stream`; tell the user to click Allow. No touch markers are drawn.
29
+ - **Mac apps.** Restore the window and move it fully onto one display before starting. On `MACOS_APP_LIBRARY_OUTDATED`, run `restart-app` and retry. If the error persists, check that the Argent build includes native Mac recording support. Retrieve the video before quitting, restarting, or disconnecting the app. After a disconnect, check the next stop error for the host path of any saved video. Record video and collect a native profile in separate runs because recording adds CPU load to the app.
29
30
  - **One size per video**: the video keeps the size of the screen at the start; a later size change is letterboxed. On a foldable simulator, start recording on the panel you need at full size.
30
31
  - **Remote (`remote:`) simulators**: the video keeps the screen's portrait orientation, so a device in landscape plays sideways.
31
32
  - **Android**: secure screens (DRM, some password fields) come out black.