@swmansion/argent 0.35.1-next.2 → 0.35.1-next.21

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.
Files changed (52) hide show
  1. package/bin/argent-android-devtools-0.4.0.apk +0 -0
  2. package/bin/darwin/argent-macos-helper +0 -0
  3. package/bin/darwin/ax-service +0 -0
  4. package/bin/darwin/tvos-ax-service +0 -0
  5. package/bin/darwin/tvos-hid-daemon +0 -0
  6. package/bin/network-inspector/network-inspector.jar +0 -0
  7. package/bin/tcp/ax-service +0 -0
  8. package/dist/cli-cmds.mjs +1782 -1642
  9. package/dist/client.js +267 -250
  10. package/dist/fatal-handlers.js +7 -1
  11. package/dist/fatal-handlers.js.map +1 -1
  12. package/dist/installer.mjs +768 -550
  13. package/dist/mcp-server.mjs +1224 -1173
  14. package/dist/tool-args.generated.d.ts +353 -317
  15. package/dist/tool-server.cjs +103309 -101972
  16. package/dylibs/libArgentAudio.dylib +0 -0
  17. package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
  18. package/dylibs/libKeyboardPatch.dylib +0 -0
  19. package/dylibs/libNativeDevtoolsIos.dylib +0 -0
  20. package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
  21. package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
  22. package/dylibs/tcp/argent-audio-feeder +0 -0
  23. package/dylibs/tcp/libArgentAudio.dylib +0 -0
  24. package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
  25. package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
  26. package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
  27. package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
  28. package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
  29. package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
  30. package/package.json +2 -2
  31. package/skills/argent-android-emulator-setup/SKILL.md +2 -2
  32. package/skills/argent-create-e2e/SKILL.md +1 -1
  33. package/skills/argent-create-e2e/references/e2e-yaml.md +23 -2
  34. package/skills/argent-create-e2e/references/live-authoring.md +9 -0
  35. package/skills/argent-device-interact/SKILL.md +21 -94
  36. package/skills/argent-device-interact/references/advanced.md +64 -0
  37. package/skills/argent-ios-device-interact/SKILL.md +1 -1
  38. package/skills/argent-ios-device-setup/SKILL.md +1 -1
  39. package/skills/argent-ios-simulator-setup/SKILL.md +1 -1
  40. package/skills/argent-lens/SKILL.md +1 -1
  41. package/skills/argent-macos-app-interact/SKILL.md +1 -1
  42. package/skills/argent-metro-debugger/SKILL.md +1 -1
  43. package/skills/argent-native-profiler/SKILL.md +1 -1
  44. package/skills/argent-qa-e2e/SKILL.md +1 -1
  45. package/skills/argent-react-native-app-workflow/SKILL.md +1 -1
  46. package/skills/argent-react-native-optimization/SKILL.md +1 -1
  47. package/skills/argent-react-native-profiler/SKILL.md +1 -1
  48. package/skills/argent-screen-recording/SKILL.md +1 -1
  49. package/skills/argent-screenshot-diff/SKILL.md +1 -1
  50. package/skills/argent-settings-permissions/SKILL.md +1 -1
  51. package/skills/argent-test-ui-flow/SKILL.md +1 -1
  52. package/skills/argent-tv-interact/SKILL.md +1 -1
Binary file
Binary file
Binary file
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.35.1-next.2",
3
+ "version": "0.35.1-next.21",
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",
@@ -98,5 +98,5 @@
98
98
  "vitest": "^5.0.5",
99
99
  "yaml": "^2.9.1"
100
100
  },
101
- "gitHead": "0f5f4c7e93d51e328f5231c48e5fa4dc1ae64c36"
101
+ "gitHead": "00b45e21e15b7727839a3b34203d909d2a97c5c9"
102
102
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-android-emulator-setup
3
- description: Set up and connect to an Android emulator using argent MCP tools. Use when starting a new session on Android, booting an emulator, getting a device serial, or before any UI interaction task.
3
+ description: Boot an Android emulator and find its serial with Argent. Use when no Android emulator is running yet or you need to pick and boot one.
4
4
  ---
5
5
 
6
6
  ## 1. Prerequisites
@@ -14,7 +14,7 @@ The Android SDK (platform tools and emulator) and an AVD, created in Android Stu
14
14
 
15
15
  ## 3. Using the device
16
16
 
17
- Pass the Android serial as `udid` to the same interaction tools as on iOS. See `argent-device-interact` for interaction tooling and the Android notes at the bottom of that skill. If a React Native app can't reach Metro, see `argent-metro-debugger` §1.
17
+ Pass the Android serial as `udid` to the same interaction tools as on iOS. See `argent-device-interact` (and its `references/advanced.md` for Android notes). If a React Native app can't reach Metro, see `argent-metro-debugger` §1.
18
18
 
19
19
  ## 4. Notes
20
20
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-create-e2e
3
- description: Create, record, edit, replay, or repair reusable Argent e2e test YAML files. Use when the user asks to record, replay, or run an e2e test or a repeatable device path, set up profiling or an A/B comparison, or invoke the authoring engine behind argent-qa-e2e. Also use before repeating three or more interactions. For one-off UI checks, acceptance-driven regression tests, or screen video, use argent-test-ui-flow, argent-qa-e2e, or argent-screen-recording respectively.
3
+ description: Create, record, edit, replay, or repair reusable Argent e2e test YAML files. Use when the user asks to record, replay, or run an e2e test or repeatable path, set up profiling/A-B comparison, or before repeating 3+ interactions. For one-off UI checks, writing QA regression tests, or screen video, use argent-test-ui-flow, argent-qa-e2e, or argent-screen-recording.
4
4
  ---
5
5
 
6
6
  # Create an Argent e2e test
@@ -231,7 +231,15 @@ Use `when:` only for optional setup or an interstitial that reconverges:
231
231
  - tap: { text: Got it }
232
232
  ```
233
233
 
234
- The guard accepts one `exists`, `visible`, `hidden`, or `text` condition, or `{ platform: ios|android|chromium|vega|macos }`. A run on a remote simulator matches `ios`. UI guards use the short assert grace and reject `timeout`. There is no `else` or per-step `optional`. Put separate behavioral paths in separate tests. Never place a required acceptance check inside `when:`.
234
+ Use a UI condition (`exists`, `visible`, `hidden`, or `text`), an [output check](#pass-values-between-steps), or a platform guard (`{ platform: ios|android|chromium|vega|macos }`). A run on a remote simulator matches `ios`. UI guards use the short assert grace and reject `timeout`. There is no `else` or per-step `optional`. Put separate behavioral paths in separate tests. Never place a required acceptance check inside `when:`.
235
+
236
+ ## Shutdown
237
+
238
+ Put cleanup in `shutdown:` so it runs after `steps` pass or fail. A cancellation skips any remaining cleanup. A run refused before its first step skips shutdown entirely. Independent shutdown entries continue after a failure. Group dependent steps in one `when:` block so the chain stops at its first failure.
239
+
240
+ If setup can stop before writing an output, guard the cleanup with `when: { output: user.id, exists: true }` or supply a fallback the cleanup handles. A `run:` fragment queues its shutdown for the end of the run, most recently loaded first. If the fragment runs more than once, collect IDs in an output list and use `pop()` in its shutdown script. A separate `tool: e2e-execute` run performs its own cleanup.
241
+
242
+ Inspect `shutdownFailed` and the steps marked `shutdown: true` before rerunning. See [Shutdown](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#shutdown).
235
243
 
236
244
  ## Composition and platform limits
237
245
 
@@ -249,12 +257,17 @@ A `run:` target is a YAML path resolved against the directory of the test file c
249
257
  ```yaml
250
258
  - script: { path: ../../scripts/seed-order.mjs }
251
259
  - script: { path: ../../scripts/seed-order.mjs, timeout: 60000 }
260
+ - script: { path: ../../scripts/seed-order.mjs, env: { API_TOKEN: "{{secret:API_TOKEN}}" } }
252
261
  ```
253
262
 
254
263
  Use the map form shown above. A bare `script: scripts/seed.mjs` is invalid.
255
264
 
256
265
  `path` is relative to the test file that contains the step. Use an `.mjs` or `.js` file, or an `.mts` or `.ts` file for TypeScript, and match the file name's letter case. `timeout` is in milliseconds, as in `e2e-add-script`.
257
266
 
267
+ Use top-level `env` for script defaults, step `env` for one script, and `--env NAME=value` or `e2e-execute.env` for run overrides. The last layer to set a name wins. A `run:` fragment fills missing defaults. Pass overrides explicitly to a separate `tool: e2e-execute` run.
268
+
269
+ Quote non-string YAML scalars, such as `PORT: "8080"`. Use `{{secret:NAME}}` for credentials and keep credentials out of logs. If a secret is missing, check the secret sources for the run's project root. See [Environment values](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#environment-values) for the value rules and redaction limits.
270
+
258
271
  `.mjs` and `.mts` are always ES modules. `.js` and `.ts` take their module type from the project's `package.json` `type` field; with no `type`, Node reads a file with `import`, `export` or top-level `await` as an ES module, and each other file as CommonJS. So prefer `.mjs` or `.mts` for a new script and use `.js` or `.ts` for a script the project already has. `.cjs` and `.cts` are invalid: under `"type": "module"`, use `import` in the script, not `require`.
259
272
 
260
273
  Node runs `.mts` and `.ts` by removing the types, and it does not read `tsconfig.json`. In an `.mts` or `.ts` script:
@@ -267,9 +280,17 @@ If the reason says that the Node.js of the tool-server cannot run TypeScript, us
267
280
 
268
281
  Over a link (`argent link` or `ARGENT_TOOLS_URL`, also to 127.0.0.1), `e2e-add-script` refuses the call, and a replay rejects a test with a `script:` step. Record and replay a test with a script without a link.
269
282
 
283
+ ### Pass values between steps
284
+
285
+ Save JSON data to the global `output`, for example `output.user = { id: "user-7" }`. Record scripts one at a time so each starts with the previous output. Inspect `e2e-add-script.outputJson` before writing a reference. A `run:` fragment shares output. For a separate `tool: e2e-execute` run, pass inputs through `env`.
286
+
287
+ Quote references in YAML, such as `"{{output:user.id}}"`. Use dotted keys and indexes (`items.0.id`). If a script may be skipped, guard the use with an output check or provide a literal fallback, such as `"{{output:user.id ?? guest}}"`. For a required check, use `assert: { output: user.id, exists: true }`.
288
+
289
+ Use references in selectors, typed text, equality or contains checks, tool arguments, and script-step environment values. A whole-value tool argument keeps its JSON type. Return a string when the tool expects text. Keep secret placeholders in the YAML. See [Script output](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#script-output) for supported fields and fallback syntax.
290
+
270
291
  ## Snapshots and CLI runs
271
292
 
272
- `argent e2e run <name> [--device <id>] [--platform ios|android|chromium|vega|macos|ios-remote] [--update-baselines] [--output <dir>] [--json]` runs without an LLM and exits non-zero on failure.
293
+ `argent e2e run <name> [--device <id>] [--platform ios|android|chromium|vega|macos|ios-remote] [--update-baselines] [--env NAME=value] [--output <dir>] [--json]` runs without an LLM and exits non-zero on failure.
273
294
 
274
295
  A screenshot is human evidence. A `snapshot:` is executable visual verification. A missing baseline or excessive mismatch fails. A `cropOn` size change also fails. Use snapshots for color, layout, size, spacing, typography, clipping, overflow, images, icons, or stable component appearance. Use full screen for global changes and `cropOn` for one component.
275
296
 
@@ -35,6 +35,15 @@ Obey these lifecycle rules:
35
35
  3. If a call says the recording is inactive, do not restart under that name. The completed take can still be on disk. Copy it aside or record under a fresh name.
36
36
  4. Read `recorded` after each call. The recorder does not always store the tool call you made, and that line is where a rewrite shows up. The recorder still appends `await-ui-element` and `await-network-request` steps that return `success: false`. Check the warning before continuing. To see the whole file mid-recording, read it at `savedTo`. A `null` `savedTo` means only the write on your side failed: the step is still in the recording, the next step rewrites the whole file, and `e2e-finish-recording` returns `e2eTestFile` regardless.
37
37
  5. Edit or reorder the YAML only after `e2e-finish-recording`.
38
+ 6. Set script defaults with `e2e-start-recording.env` or call `e2e-set-env` directly before recording the script. Use `e2e-add-script.env` for values specific to one step. The tool runs the script immediately. If a secret is missing, check the project’s secret sources before retrying.
39
+
40
+ ## Record cleanup after the main steps
41
+
42
+ Pass `shutdown: true` to `e2e-add-step` or `e2e-add-script` for cleanup. Use the same flag on `e2e-add-echo` to label it. Actions and scripts run during the call. Check the `recorded` line for the `shutdown` prefix and read any wait warning before continuing.
43
+
44
+ A fragment recorded as `run:` in the main list usually defers cleanup until the first shutdown action or script, or until `e2e-finish-recording`. Read `fragmentShutdown` and the call message before assuming cleanup passed. If the call was cancelled, finish the recording or retry the shutdown call to run queued cleanup.
45
+
46
+ For an uploaded fragment or one that starts its own Chromium app, read the message for cleanup that ran immediately. If later steps need the state it removed, record the fragment's main steps individually and its cleanup with `shutdown: true`. Replace those steps after `e2e-finish-recording`. See [Shutdown](e2e-yaml.md#shutdown) for replay order.
38
47
 
39
48
  ## Start in the correct order
40
49
 
@@ -1,103 +1,30 @@
1
1
  ---
2
2
  name: argent-device-interact
3
- description: Interact with an iOS simulator or iPhone, Android emulator or phone, or Chromium (CDP) app using argent MCP tools. Use when tapping UI elements, performing gestures, scrolling/swiping, typing text, pressing hardware buttons, launching apps, opening URLs, taking screenshots, waiting for an element to appear or disappear, or checking visible app state after interactions. Not for TV targets.
3
+ description: Drive iOS, Android, or Chromium apps with Argent MCP tools. Use when tapping, swiping, typing, launching apps, waiting for UI, or taking screenshots (not for TV targets).
4
4
  ---
5
5
 
6
- Each tool's own description carries its parameters, defaults, return shape and examples. This skill covers choosing between tools and the gotchas those descriptions don't state.
6
+ Each tool's description carries its parameters, defaults, and return shape. This skill covers routing and gotchas those descriptions don't state.
7
7
 
8
- ## 1. Before You Start
8
+ ## Target Routing
9
9
 
10
- - Get a target id from `list-devices`; if none is ready, `boot-device` one. Full setup flow: `argent-ios-simulator-setup` / `argent-ios-device-setup` / `argent-android-emulator-setup`. The same tool names drive iOS, Android and Chromium; each takes the `udid` from `list-devices`.
11
- - Physical iPhone (`kind: "device"`): read `argent-ios-device-interact` first. Only the tools it lists exist there, and `describe` sees only the app `launch-app` registered.
12
- - Mac app (`platform: "macos"`): read `argent-macos-app-interact` first.
13
- - Read the matching reference before driving these targets: `references/chromium.md` for a `chromium` target, `references/harmonyos.md` for a `harmony` target, `references/foldables.md` for a device `list-devices` marks `foldable: true` (or before calling `fold`).
14
- - Load a deferred tool's schema with ToolSearch before its first call (e.g. `gesture-pinch`, `gesture-rotate`, `gesture-custom`); without it, numbers go out as strings and fail validation.
15
- - If you delegate device tasks to sub-agents, make sure they have MCP permissions.
10
+ - Get a `udid` from `list-devices` (or `boot-device` if none is ready). Full setup: `argent-ios-simulator-setup` / `argent-ios-device-setup` / `argent-android-emulator-setup`.
11
+ - Before driving a specialized target, read the matching instructions below:
12
+ - Physical iPhone (`kind: "device"`): `argent-ios-device-setup` and `argent-ios-device-interact`
13
+ - Mac app (`platform: "macos"`): `argent-macos-app-interact`
14
+ - TV (`runtimeKind: "tv"` or `platform: "vega"`): `argent-tv-interact`
15
+ - Chromium / HarmonyOS / foldables (`foldable: true`): `references/chromium.md`, `references/harmonyos.md`, `references/foldables.md`
16
+ - Load any deferred tool's schema (e.g. `gesture-custom`, `gesture-pinch`, `gesture-rotate`) before its first call so numbers don't serialize as strings.
17
+ - If delegating device tasks to sub-agents, ensure they have MCP permissions.
16
18
 
17
- ## 2. Choosing the Right Tool
19
+ ## Core Rules
18
20
 
19
- | Action | Tool | Notes |
20
- | ------------------------------ | -------------------- | -------------------------------------------------------------- |
21
- | Several known steps | `run-sequence` | One call, one screenshot at the end (§5) |
22
- | Open an app | `launch-app` | **Never tap home-screen icons** |
23
- | Restart an app | `restart-app` | Clean in-memory state |
24
- | Open URL / deep link | `open-url` | Web pages, deep links, URL schemes |
25
- | Tap | `gesture-tap` | Buttons, links, checkboxes |
26
- | Scroll / swipe | `gesture-swipe` | Touch targets; not Chromium |
27
- | Scroll (Chromium) | `gesture-scroll` | Mouse wheel |
28
- | Drag (Chromium) | `gesture-drag` | Sliders, drag-and-drop, text selection |
29
- | Long press, drag & drop | `gesture-custom` | Also any other non-linear touch sequence |
30
- | Pinch / zoom | `gesture-pinch` | |
31
- | Two-finger rotation | `gesture-rotate` | |
32
- | Hardware key | `button` | Home, back, power, volume, appSwitch, actionButton |
33
- | Type text or press a named key | `keyboard` | Every platform; text or one key per call (§6) |
34
- | Paste text | `paste` | Only where a user would paste (§6). Sim/emu, Mac app |
35
- | Rotate device | `rotate` | Orientation changes |
36
- | Fold device | `fold` | Foldables only: `references/foldables.md` |
37
- | Shake device | `shake` | Shake handlers (sim/emu only), Undo-typing prompt, RN dev menu |
38
- | Slow or offline network | `network-conditions` | iOS simulator app, Android emulator, or Chromium tab |
39
- | Wait for UI | `await-ui-element` | Block until an element is visible/hidden/exists/contains text |
40
- | Wait for idle | `await-screen-idle` | Block until a non-empty tree holds for `minStableMs` (§4) |
21
+ - **Open apps directly:** use `launch-app` or `open-url`, never tap home-screen icons. Use `restart-app` for clean in-memory state.
22
+ - **Use the returned element tree:** interaction tools already attach a downscaled screenshot and `--- Elements after action (describe) ---` with normalized `[0,1]` tap frames. Call `describe` only when no fresh tree covers the current screen. Never derive routine tap coordinates from pixels.
23
+ - **Tree & screenshot IDs:** full trees/screenshots carry a `Tree id` / `Screenshot id`. When unchanged or slightly changed, a later result references that id (unchanged note or `-`/`+` diff); call `describe` or `screenshot` if that earlier result isn't in context. An identical tree does not mean the action did nothing.
24
+ - **Batch known steps:** use `run-sequence` when multiple consecutive steps are known ahead of time (scroll sweeps, type + enter, form fill + submit).
25
+ - **Text entry:** tap the field first (`keyboard` with no focus is a silent no-op). `keyboard` takes either `text` or `key`, not both. Keep `keyboard` as default; reserve `paste` for real paste flows (OTP, long tokens). Use `{{secret:<NAME>}}` placeholders for credentials and navigate/submit before capturing non-secure fields.
26
+ - **Wait server-side:** never poll `screenshot` or `describe` in a loop. Use `await-ui-element`, or use `await-screen-idle` before tapping moving UI.
27
+ - **Dialogs:** `describe` exposes simulator/emulator system & permission dialogs; prefer answering the app's dialog over `settings-permissions`.
28
+ - **Screenshots:** keep the default downscaled capture for UI checks; do not pass `scale: 1.0` as a tapping/readability aid.
41
29
 
42
- After a network test, call `network-conditions` with the same target and omit the conditions to reset. On Android, this brings an offline emulator back online. If an Argent crash leaves an emulator's proxy active, reset before retrying.
43
-
44
- ## 3. Finding Tap Targets
45
-
46
- After an action moves you to a different screen, or whenever you don't know an element's coordinates, discover before tapping. Interaction results already carry the element tree (`--- Elements after action (describe) ---`): use it, and call a discovery tool only when no fresh tree covers the current screen. Each full tree has a `Tree id`, and each full screenshot has a `Screenshot id`. When the tree or screenshot matches an earlier one (or only a few tree lines changed), the result names that id in place of repeating it (an unchanged note, or `-` gone / `+` new lines against it): refer back to the named result, and call `describe` or `screenshot` if it is not in your context. An identical tree does not mean the action did nothing.
47
-
48
- | Need | Tool |
49
- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
50
- | Any screen: app, system dialog, Home screen | `describe` |
51
- | UIKit properties of a view (iOS simulator) | `native-find-views` (needs `bundleId` and a class, id, label, tag or `nativeID` to match) |
52
- | What sits at a known raw point (iOS simulator) | `native-view-at-point` (the visually deepest view; `hitTest: true` for the view that receives touch) |
53
- | Final visual fallback | `screenshot`, only when the tools above cannot expose the control. Do not derive routine in-app navigation targets from pixels |
54
-
55
- If `describe` returns an empty tree, follow its `hint`; with no hint, the screen is blank, loading or unlabeled: check the attached screenshot and retry once content has loaded.
56
-
57
- For a React Native testID or component name that `describe` does not show, use `debugger-component-tree`; take tap points from `describe`.
58
-
59
- **React Native:** LogBox toasts sit over the bottom of the screen and catch taps meant for what is under them. Argent hides them when a `debugger-*` tool connects and after `debugger-reload-metro`; after `restart-app`, call a `debugger-*` tool again. After any other reload they come back: close each by tapping the right end of its `describe` frame (the X), not its middle.
60
-
61
- **System and permission dialogs:** on a simulator or emulator, `describe` returns a visible dialog's buttons with tap coordinates; keep using it for in-app modals too. Fall back to `screenshot` only if it does not expose the controls: then tap one obvious button (`Allow`, `OK`, `Don't Allow`, `Not Now`, `Continue`) at a time, check the returned screenshot, and go back to `describe` once the dialog is gone.
62
-
63
- > **Prefer the dialog over the Settings tool.** When the app triggers its own permission prompt, answering it is the real user path. Use `settings-permissions` only when you can't make the change through the app: set a permission _before_ the app asks, re-enable one the user denied (iOS won't re-prompt), or reset it so the prompt reappears. See `argent-settings-permissions`.
64
-
65
- ## 4. Waiting: `await-ui-element` and `await-screen-idle`
66
-
67
- **Never poll `screenshot`/`describe` in a loop to wait for something.** `await-ui-element` blocks server-side on the same tree `describe` reads. It has no bare-timer mode; for a plain pause, use your own harness sleep. Its description covers conditions, selector matching and defaults. What it does not tell you:
68
-
69
- - A `hidden` check that succeeds **immediately** may be a false pass: its `note` then says the selector never matched anything. Treat that as a failed check and fix the selector; it does not mean "the element went away".
70
- - The synthetic `ROOT` container `describe` prints is never matched, so a `role` like `AXGroup`/`html` won't trivially "match the screen".
71
- - To disambiguate a loose selector, pin `role` to a text role like `StaticText`; that skips a same-named button.
72
-
73
- `await-screen-idle` is for live diagnosis after a launch or navigation, before a raw tap on an element that may still be moving. Continue only when `settled: true`, and pair it with an `await-ui-element` for the destination: stillness does not identify a screen, and the tool can return during a presentation-layer animation. Do not record it in an e2e test; tests use `await: { idle: true }`, which also compares pixels.
74
-
75
- ## 5. Action Sequencing with `run-sequence`
76
-
77
- Use `run-sequence` when every step is known in advance; if a step depends on what the previous one shows, use separate calls. Its description lists the allowed tools and their arguments. Typical batches:
78
-
79
- - "scroll to bottom", "scroll until X": 3-5 swipes
80
- - "clear and retype a field": triple-tap to select all, then type the new value
81
- - typing then submitting: a `keyboard` text step, then a `keyboard` `enter` step (one call cannot carry both)
82
- - "submit form": fill every field, then tap submit
83
- - "go back to X": a known tap path
84
-
85
- Use `await-ui-element` to gate a step on a screen transition. To gate on a request, start capture before the sequence and put `await-network-request` after the triggering action. A failed step, including a wait with `success: false`, stops the sequence and returns partial results.
86
-
87
- ## 6. Text Entry and Secrets
88
-
89
- - Tap the field first. Typing or pasting with no focused field is a silent no-op.
90
- - `paste` is **not** a faster `keyboard`. `keyboard` types the way a user types and stays the default for every text entry. Use `paste` only where a real user would paste: a 2FA / OTP code from another app, a long link or token, or testing how the app handles pasted input. That it can carry text `keyboard` can't type on a platform (multi-line text, non-ASCII on Android) is not a reason on its own.
91
- - **Credentials:** type them as a `{{secret:<NAME>}}` placeholder in `text` (`keyboard`, `paste`, `run-sequence` keyboard steps, e2e `type` steps), never as plaintext, and never ask the user for the value. Do **not** `describe` or `screenshot` a non-secure field you just filled with a secret: submit or navigate away first, then verify the resulting screen.
92
-
93
- ## 7. Screenshots
94
-
95
- Interaction tools already attach a screenshot. Call `screenshot` for the initial state, for a baseline before you change visible UI, to check state after a delay, or when the attached capture shows a transitional or loading frame.
96
-
97
- Keep the default downscaled capture for UI context and state checks; do not use `scale: 1.0` as a readability or tapping aid. Full resolution is only for saving baseline/current PNGs for comparison (`scale: 1.0` with `includeImageInContext: false`); for visual regression checks use the `argent-screenshot-diff` skill.
98
-
99
- If `screenshot` times out, restart the device transport with `stop-simulator-server`.
100
-
101
- ## 8. Android notes
102
-
103
- - **First-launch permission prompts**: `reinstall-app` on Android installs with `-g`, so runtime permissions are pre-granted on first launch.
30
+ Read `references/advanced.md` when you need: the full tool table, `network-conditions` reset, React Native LogBox dismissal, an empty `describe` tree or a `screenshot` timeout, `await-ui-element`/`await-screen-idle` edge cases, `run-sequence` gating, `paste`/secrets rules, or Android `reinstall-app` notes.
@@ -0,0 +1,64 @@
1
+ # Advanced Interaction Notes
2
+
3
+ ## Tool Reference
4
+
5
+ | Action | Tool | Notes |
6
+ | --------------------------- | ---------------------------------------- | ----------------------------------------------------------------------- |
7
+ | Several known steps | `run-sequence` | One call, one screenshot at the end |
8
+ | Open / restart app | `launch-app` / `restart-app` | Never tap home-screen icons; `restart-app` clears in-memory state |
9
+ | Open URL / deep link | `open-url` | Web pages, deep links, URL schemes |
10
+ | Tap / swipe | `gesture-tap` / `gesture-swipe` | Touch targets; not Chromium for swipe |
11
+ | Scroll / drag (Chromium) | `gesture-scroll` / `gesture-drag` | Mouse wheel; sliders, drag-and-drop, text selection |
12
+ | Long press, drag & drop | `gesture-custom` | Also any non-linear touch sequence |
13
+ | Pinch / rotate gesture | `gesture-pinch` / `gesture-rotate` | Two-finger gestures |
14
+ | Hardware key / rotate | `button` / `rotate` | Home, back, power, volume, appSwitch, actionButton; orientation changes |
15
+ | Shake device | `shake` | Shake handlers (sim/emu only), Undo-typing prompt, RN dev menu |
16
+ | Fold device | `fold` | Foldables only (`references/foldables.md`) |
17
+ | Type text / press named key | `keyboard` | Every platform; text or one key per call |
18
+ | Paste text | `paste` | Only where a user would paste; sim/emu, Mac app |
19
+ | Slow or offline network | `network-conditions` | iOS sim app, Android emu, or Chromium tab |
20
+ | Wait for UI / idle | `await-ui-element` / `await-screen-idle` | Server-side waits |
21
+
22
+ ## Network Conditions Recovery
23
+
24
+ After a network test, call `network-conditions` with the same target and omit the conditions to reset. On Android, this brings an offline emulator back online. If an Argent crash leaves an emulator's proxy active, reset before retrying.
25
+
26
+ ## Discovery & React Native LogBox
27
+
28
+ - **UIKit view lookup (iOS simulator):** `native-find-views` (needs `bundleId` and a class, id, label, tag, or `nativeID`) and `native-view-at-point` (visually deepest view; `hitTest: true` for touch target).
29
+ - **React Native component names / testIDs:** `debugger-component-tree` when `describe` omits them; still take tap points from `describe`.
30
+ - **React Native LogBox toasts:** sit over the bottom of the screen and catch taps meant for what is under them. Argent hides them when a `debugger-*` tool connects and after `debugger-reload-metro`; after `restart-app`, call a `debugger-*` tool again. After any other reload they come back: close each by tapping the right end of its `describe` frame (the X), not its middle.
31
+ - **Empty `describe` tree:** follow its `hint` if present. If there's no hint, the screen is blank, loading, or unlabeled. Check the attached screenshot and retry once content loads.
32
+ - **System / permission dialogs:** on a simulator or emulator, `describe` returns visible dialog buttons with tap coordinates (and in-app modals too). Fall back to `screenshot` only if `describe` omits them. Tap one obvious button (`Allow`, `OK`, `Don't Allow`, `Not Now`, `Continue`) at a time, check the screenshot, and return to `describe` once dismissed. Prefer answering the app's own dialog over `settings-permissions`. Use `settings-permissions` only to pre-authorize, re-enable a denied permission (iOS won't re-prompt), or reset prompts. See `argent-settings-permissions`.
33
+
34
+ ## Waiting: `await-ui-element` and `await-screen-idle`
35
+
36
+ - `await-ui-element` blocks server-side on the same tree `describe` reads. It has no bare-timer mode; for a plain pause, use your own harness sleep.
37
+ - The synthetic `ROOT` container `describe` prints is never matched, so a `role` like `AXGroup`/`html` won't trivially match the screen.
38
+ - To disambiguate a loose selector, pin `role` to a text role like `StaticText` to skip a same-named button.
39
+ - `await-screen-idle` is for live diagnosis after a launch or navigation before a raw tap on a moving element. Continue only when `settled: true`, and pair it with `await-ui-element` for the destination: stillness does not identify a screen, and the tool can return during a presentation-layer animation. Do not record it in an e2e test; tests use `await: { idle: true }`, which also compares pixels.
40
+
41
+ ## Action Sequencing with `run-sequence`
42
+
43
+ Use `run-sequence` when every step is known in advance; if a step depends on what the previous one shows, use separate calls. Typical batches:
44
+
45
+ - Scroll to bottom / until X: 3–5 swipes
46
+ - Clear and retype a field: triple-tap to select all, then type
47
+ - Type then submit: a `keyboard` text step, then a `keyboard` `enter` step
48
+ - Submit form: fill every field, then tap submit
49
+ - Known tap path: e.g. navigating back through screens
50
+
51
+ Use `await-ui-element` to gate a step on a screen transition. To gate on an HTTP request, start capture before the sequence and put `await-network-request` after the triggering action. A failed step (including a wait with `success: false`) stops the sequence with partial results.
52
+
53
+ ## Text Entry, Paste & Secrets
54
+
55
+ - Tap the field first; typing or pasting with no focused field is a silent no-op.
56
+ - `paste` is **not** a faster `keyboard`. Keep `keyboard` as the default; use `paste` only where a real user would paste (OTP/2FA codes, long links/tokens, or testing paste handling). Platform text limitations alone are not a reason to switch to `paste`.
57
+ - **Credentials:** pass `{{secret:<NAME>}}` placeholders in `text` (`keyboard`, `paste`, `run-sequence` keyboard steps, e2e `type` steps), never plaintext, and never ask the user for the value. Do **not** `describe` or `screenshot` a non-secure field you just filled with a secret: submit or navigate away first, then verify the resulting screen.
58
+
59
+ ## Screenshots & Android Notes
60
+
61
+ - Call `screenshot` for initial state, baselines before visible UI changes, state after a delay, or when an attached capture shows a transitional/loading frame.
62
+ - Keep the default downscaled capture for routine checks; reserve `scale: 1.0` (with `includeImageInContext: false`) for saving baselines/currents for `argent-screenshot-diff`.
63
+ - If `screenshot` times out, restart the device transport with `stop-simulator-server`.
64
+ - **Android first-launch permissions:** `reinstall-app` on Android installs with `-g`, pre-granting runtime permissions on first launch.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-ios-device-interact
3
- description: Drive a physical iPhone through argent. Use when a physical iPhone is involved (a list-devices iOS entry with kind "device") and ONLY then; never for a simulator. For connection, trust, or signing problems read argent-ios-device-setup.
3
+ description: Drive a physical iPhone with Argent. Use when targeting a physical iPhone (list-devices kind "device") and ONLY then, never a simulator. For setup/signing, use `argent-ios-device-setup`.
4
4
  ---
5
5
 
6
6
  # Physical iPhone interaction
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-ios-device-setup
3
- description: Set up a physical iPhone over USB or a connected CoreDevice tunnel for argent. Use when a physical iPhone is involved (a list-devices iOS entry with kind "device") and ONLY then; never for a simulator.
3
+ description: Set up a physical iPhone over USB or CoreDevice tunnel for Argent. Use when a physical iPhone is involved (kind "device") and ONLY then; never for a simulator.
4
4
  ---
5
5
 
6
6
  # Physical iPhone setup
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-ios-simulator-setup
3
- description: Set up and connect to an iOS simulator using argent MCP tools. Use when starting a new session, booting an iOS simulator, getting an iOS UDID, or before any iOS simulator interaction task.
3
+ description: Boot an iOS simulator and find its UDID with Argent. Use when no simulator is booted yet or you need to pick and boot one.
4
4
  ---
5
5
 
6
6
  ## 1. Setup Steps
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-lens
3
- description: Propose multiple visual design variants for on-screen elements and let the human pick in the Argent Lens window. Use when the user asks for design alternatives / options / A-B choices for a screen or component, or any time you have produced more than one candidate look for an element and want a human decision before committing.
3
+ description: Propose visual design variants for on-screen elements so the user can pick in Argent Lens. Use when presenting UI design alternatives or A/B choices.
4
4
  ---
5
5
 
6
6
  > **Prerequisite: feature flag.** This workflow is gated behind the `argent-lens` flag (off by default). Run `argent enable argent-lens` once before using it. If `propose_variant` comes back not-found, the flag is off; enable it and retry.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-macos-app-interact
3
- description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos, Mac Catalyst) through argent. Use when a list-devices entry has platform "macos", or the user names a Mac app, a macOS app or a native desktop app. Never for an iOS simulator, an iPhone, or an Electron or Chromium app (platform "chromium").
3
+ description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos, Catalyst) with Argent. Use when targeting platform "macos" or a native macOS app, never iOS or Electron/Chromium.
4
4
  ---
5
5
 
6
6
  `argent-device-interact` still applies for everything not listed here (`run-sequence`, `await-ui-element`, secrets).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-metro-debugger
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, evaluating JavaScript, or inspecting and checking an app's HTTP requests.
3
+ description: Debug JS with Argent in React Native (iOS, Android, Vega, macOS) or Chromium/Electron (CDP). Use when reading console logs, inspecting React trees, evaluating JS, or checking HTTP requests.
4
4
  ---
5
5
 
6
6
  ## 1. Prerequisites
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-native-profiler
3
- description: Diagnose native CPU hotspots, UI hangs, memory issues, and iOS app launch time. Use Instruments (xctrace) on iOS simulators, iPhones (launch time only) and Mac apps, or Perfetto on Android. Use when diagnosing native-level performance issues.
3
+ description: Profile native CPU hotspots, UI hangs, memory, and iOS launch time via Instruments (iOS/Mac) or Perfetto (Android). Use when diagnosing native performance issues.
4
4
  ---
5
5
 
6
6
  ## 1. Tools and platforms
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-qa-e2e
3
- description: Write repeatable QA regression e2e tests from test cases, tickets, or acceptance criteria. Use when the user asks to write, automate, or generate an e2e test or preserve an automated regression scenario, with deterministic setup, stable targets, executable structural or visual evidence, and two consecutive full passes. For one-off UI checks or replayable paths without acceptance criteria, use argent-test-ui-flow or argent-create-e2e. Supports iOS, Android, Chromium, Mac apps, and Vega (Fire TV), where recorded tv-remote steps replace touch directives. Apple TV and Android TV are unsupported; use argent-tv-interact there and report the limitation.
3
+ description: Write repeatable QA regression e2e tests from test cases, tickets, or acceptance criteria (iOS, Android, Chromium, Mac apps, Vega; not Apple TV/Android TV). Use when the user asks to write, automate, or generate an e2e test or preserve a regression scenario. For one-off checks or replayable paths without criteria, use argent-test-ui-flow or argent-create-e2e.
4
4
  ---
5
5
 
6
6
  # Create a QA regression e2e test
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-react-native-app-workflow
3
- description: Step-by-step workflows for developing or debugging React Native apps on iOS simulator or Android emulator. Use when starting the app, debugging Metro, fixing builds, diagnosing runtime errors, or running tests.
3
+ description: Develop and debug React Native apps on iOS simulator or Android emulator. Use when starting the app, debugging Metro, fixing builds, diagnosing runtime errors, or running tests.
4
4
  ---
5
5
 
6
6
  Physical iPhone (`kind: "device"`): Metro debugging and profiling tools reject it. Use a simulator. Exception: measure and profile app launch on the iPhone with `native-profiler-launch-analysis` (`argent-native-profiler` §4).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-react-native-optimization
3
- description: Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup / TTI (including iOS launch time). Delegates to argent-react-native-profiler for measurement.
3
+ description: Entry-point for React Native performance optimization; profiles first via `argent-react-native-profiler`. Use when the app feels slow, fixing re-renders or jank, or improving startup/TTI.
4
4
  ---
5
5
 
6
6
  ## Rules
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-react-native-profiler
3
- description: Profile a React Native Hermes app to measure re-render and CPU performance using argent profiler tools. Use when optimizing for performance, measuring before/after a fix, spotting slow components, diagnosing re-renders, checking CPU hotspots, or producing a ranked issue report.
3
+ description: Profile a React Native Hermes app for JS re-renders and CPU hotspots via Argent profiler tools. Use when measuring before/after performance, diagnosing re-renders, or finding CPU hotspots.
4
4
  ---
5
5
 
6
6
  This skill is complementary to `argent-react-native-optimization`, not a replacement for it.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-screen-recording
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.
3
+ description: Record a screen video with Argent on iOS, Android, or Mac apps. Use when asked to capture a video clip of a flow, interaction, or animation.
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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-screenshot-diff
3
- description: Compare saved or live app screenshots with the argent screenshot-diff tool. Use when testing visual regressions, before/after UI comparisons, screenshot diff checks, visible layout, spacing, color, typography, clipping, overflow, text rendering, or image/icon rendering changes.
3
+ description: Compare saved or live app screenshots via `screenshot-diff`. Use when checking visual regressions, before/after UI diffs, layout, typography, or rendering changes.
4
4
  ---
5
5
 
6
6
  ## 1. Role
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-settings-permissions
3
- description: Grant, deny, or reset an app's runtime permissions (camera, microphone, photos, contacts, notifications, calendar, location, location-always, media-library, motion, reminders) on an iOS simulator or Android device using the argent `settings-permissions` tool - without navigating the system Settings UI. Use when the permission cannot be changed through the app itself - and only then, pre-authorize before the app asks, deny up front, re-enable a permission the user already denied, or reset so the prompt reappears. If the app can flip it - via an in-app toggle or the system permission dialog the app triggers - interact with the app instead.
3
+ description: Grant, deny, or reset app runtime permissions out-of-band on an iOS simulator or Android device via `settings-permissions`. Use when the app's own dialog or toggle cannot change the permission.
4
4
  ---
5
5
 
6
6
  `settings-permissions` edits the platform's permission store directly (the iOS simulator's TCC database, Android's runtime permissions over adb). It is a **test-setup / out-of-band** tool, not a general permissions toggle: the default way to change a permission is still through the app. The tool's description covers the supported permissions per platform, the parameters, the result (`applied` / `skipped`) and the per-platform requirements.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-test-ui-flow
3
- description: Autonomously test an app UI (iOS or Android) by running interact-screenshot-verify loops using argent MCP tools. Use when testing UI flows, verifying login works, testing navigation, running UI test scenarios, manual QA steps, visible UI changes, or visual behavior.
3
+ description: Autonomously verify one-off mobile UI flows (iOS/Android) with interact-screenshot-verify loops. Use when testing navigation, login, manual QA steps, or visible UI changes.
4
4
  ---
5
5
 
6
6
  ## Before testing
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: argent-tv-interact
3
- description: Control and inspect TV apps via argent, Apple TV (tvOS), Android TV (leanback), and Amazon Fire TV (Vega). Boot the target, read focus, navigate with the D-pad remote, type, screenshot, and on Vega debug the JS runtime (evaluate, console logs, network inspector). Use when a task targets a TV (runtimeKind "tv", or platform "vega"), or mentions Apple TV / tvOS / Android TV / leanback / Vega / Fire TV / VVD.
3
+ description: Control Apple TV (tvOS), Android TV (leanback), and Fire TV (Vega) via Argent (D-pad remote, focus tree, Vega JS debugging). Use when targeting runtimeKind "tv", platform "vega", or a TV app.
4
4
  ---
5
5
 
6
6
  # Argent TV (Apple TV + Android TV + Fire TV)