@swmansion/argent 0.32.1-next.13 → 0.32.1-next.15
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/README.md +1 -1
- package/bin/argent-android-devtools-0.3.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- package/dist/cli-cmds.mjs +36 -3
- package/dist/client.js +32 -0
- package/dist/installer.mjs +31 -2
- package/dist/mcp-server.mjs +54 -11
- package/dist/tool-args.generated.d.ts +76 -42
- package/dist/tool-server.cjs +12094 -8610
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +2 -2
- package/rules/argent.md +1 -1
- package/skills/argent-create-e2e/references/e2e-yaml.md +4 -4
- package/skills/argent-device-interact/SKILL.md +2 -1
- package/skills/argent-macos-app-interact/SKILL.md +44 -0
- package/skills/argent-macos-app-interact/references/e2e.md +6 -0
- package/skills/argent-qa-e2e/SKILL.md +1 -1
- package/skills/argent-react-native-app-workflow/SKILL.md +2 -0
- package/skills/argent-react-native-profiler/SKILL.md +2 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swmansion/argent",
|
|
3
|
-
"version": "0.32.1-next.
|
|
3
|
+
"version": "0.32.1-next.15",
|
|
4
4
|
"mcpName": "io.github.software-mansion/argent",
|
|
5
|
-
"description": "MCP server for iOS Simulator
|
|
5
|
+
"description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
package/rules/argent.md
CHANGED
|
@@ -12,7 +12,7 @@ Argent - general rules:
|
|
|
12
12
|
- Interaction tools return screenshot and element tree automatically.
|
|
13
13
|
- prefer `launch-app` or `open-url` than tapping icons on home screen.
|
|
14
14
|
- If a task can require a saved e2e test, load `argent-create-e2e` (`argent-qa-e2e` for acceptance tests) before the first launch or in-app action; recording is not retroactive.
|
|
15
|
-
- Load the matching `argent-*` skill before React Native build/debug, profiling, a physical phone or a TV.
|
|
15
|
+
- Load the matching `argent-*` skill before React Native build/debug, profiling, a physical phone, a Mac app or a TV.
|
|
16
16
|
- Do not stop simulator servers when a task finishes: the next task reuses them. Call `stop-all-simulator-servers` when the user asks to clean up or ends the session, or when a skill tells you to recycle a device's services, with devices this session used. One tool-server is shared by every other agent, so unscoped call tears down their devices too. Never stop a Metro the user started unless they ask.
|
|
17
17
|
- Use the `await-ui-element` tool to block until the UI settles instead of polling using screenshot.
|
|
18
18
|
- The `argent` CLI manages the toolkit: `argent --help` lists commands, `argent --version` shows the installed version.
|
|
@@ -122,7 +122,7 @@ Directives stop the test on failure and skip later steps. The available directiv
|
|
|
122
122
|
- iOS: unfolded, the UI is landscape. `swipe` and `scroll-to` directions and the reading order stay as the user sees the UI. Coordinates stay in the space of the `describe` frames.
|
|
123
123
|
- iOS: a fold between two angles that are not `closed` or `open` can keep the current panel. The step passes, and the report names the panel. To change panels, fold to `closed` or `open`.
|
|
124
124
|
|
|
125
|
-
Use the launch map for cross-platform tests. A bare launch applies everywhere and becomes an app path on Chromium. The map takes `native:`, `ios:`, `android:`, `vega:`, and `chromium:`. `native:` is one id shared by iOS, Android, and
|
|
125
|
+
Use the launch map for cross-platform tests. A bare launch applies everywhere and becomes an app path on Chromium. The map takes `native:`, `ios:`, `android:`, `vega:`, `macos:`, and `chromium:`. `native:` is one id shared by iOS, Android, Vega, and macOS, and a per-platform key overrides it for that platform. `macos:` takes a Mac app's bundle id. `chromium:` accepts a relative or absolute app path. `ios:` and `macos:` also accept `{ app, args }`; Argent passes `args` to the app at launch. A launch that declares no id for the run's platform is an error, not a cue to switch platforms. A run on a remote simulator uses the `ios:` id, or the `native:` id when the map has no `ios:` key, so no test needs a key for a remote run. On an iOS simulator, a successful launch also pins later tree reads to that app until the next raw `tool:` step, so read [The runner tree is not the discovery tree](#the-runner-tree-is-not-the-discovery-tree) when a read describes the wrong screen.
|
|
126
126
|
|
|
127
127
|
```yaml
|
|
128
128
|
- launch: { native: com.acme.app, chromium: ../../app }
|
|
@@ -230,7 +230,7 @@ Use `when:` only for optional setup or an interstitial that reconverges:
|
|
|
230
230
|
- tap: { text: Got it }
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
The guard accepts one `exists`, `visible`, `hidden`, or `text` condition, or `{ platform: ios|android|chromium|vega }`. 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:`.
|
|
233
|
+
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
234
|
|
|
235
235
|
## Composition and platform limits
|
|
236
236
|
|
|
@@ -258,7 +258,7 @@ Over a link (`argent link` or `ARGENT_TOOLS_URL`, also to 127.0.0.1), `e2e-add-s
|
|
|
258
258
|
|
|
259
259
|
## Snapshots and CLI runs
|
|
260
260
|
|
|
261
|
-
`argent e2e run <name> [--device <id>] [--platform ios|android|chromium|vega|ios-remote] [--update-baselines] [--output <dir>] [--json]` runs without an LLM and exits non-zero on failure.
|
|
261
|
+
`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.
|
|
262
262
|
|
|
263
263
|
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.
|
|
264
264
|
|
|
@@ -266,7 +266,7 @@ Do not use a snapshot as the only proof of navigation, persistence, data, access
|
|
|
266
266
|
|
|
267
267
|
Baselines live beside the test, under `.argent/e2e/__baselines__/<name>/` and are keyed by platform and full-capture geometry; `cropOn` also contributes its selector. A run on a remote simulator uses `ios` in the key, so it uses the same baseline as a local iOS run with the same capture geometry. Seed from a known-good state with `--update-baselines`. A test that a `tool: e2e-execute` step runs keeps its own baselines, and `--update-baselines` updates them too unless the step sets `updateBaselines` itself. A run on a remote simulator with `--update-baselines` rewrites the same baseline file that a local run uses, and its step reason says that a remote simulator wrote it. Inspect every baseline and require user review. Do not commit it yourself. Baseline creation or update is not a test pass. Never update a baseline only to make a diff pass. The default `maxMismatch` is 0.5 percent.
|
|
268
268
|
|
|
269
|
-
Pin `--platform` and `--device` for iOS, Android, or Vega. For Chromium the device class is the window's own pixel size, which the app sets and no launch argument changes: pass `--platform chromium` and omit `--device` so the runner boots the declared app path instead of attaching to a running window of another size. A window sized from host or session state produces a key CI cannot reproduce, and the step fails for a missing baseline. The runner pins mobile status bars during visual runs. `--output <dir>` writes failed snapshots' images and failed steps' screenshots under `<dir>/<name>/` for CI artifact upload.
|
|
269
|
+
Pin `--platform` and `--device` for iOS, Android, or Vega. For Chromium the device class is the window's own pixel size, which the app sets and no launch argument changes: pass `--platform chromium` and omit `--device` so the runner boots the declared app path instead of attaching to a running window of another size. A window sized from host or session state produces a key CI cannot reproduce, and the step fails for a missing baseline. For a Mac app, pass `--platform macos` and omit `--device`; the key holds the window size in points, so a new window size needs new baselines. The runner pins mobile status bars during visual runs. `--output <dir>` writes failed snapshots' images and failed steps' screenshots under `<dir>/<name>/` for CI artifact upload.
|
|
270
270
|
|
|
271
271
|
## YAML safety
|
|
272
272
|
|
|
@@ -9,6 +9,7 @@ Each tool's own description carries its parameters, defaults, return shape and e
|
|
|
9
9
|
|
|
10
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
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.
|
|
12
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`).
|
|
13
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.
|
|
14
15
|
- If you delegate device tasks to sub-agents, make sure they have MCP permissions.
|
|
@@ -30,7 +31,7 @@ Each tool's own description carries its parameters, defaults, return shape and e
|
|
|
30
31
|
| Two-finger rotation | `gesture-rotate` | |
|
|
31
32
|
| Hardware key | `button` | Home, back, power, volume, appSwitch, actionButton |
|
|
32
33
|
| Type text or press a named key | `keyboard` | Every platform; text or one key per call (§6) |
|
|
33
|
-
| Paste text | `paste` | Only where a user would paste (§6). Sim/emu
|
|
34
|
+
| Paste text | `paste` | Only where a user would paste (§6). Sim/emu, Mac app |
|
|
34
35
|
| Rotate device | `rotate` | Orientation changes |
|
|
35
36
|
| Fold device | `fold` | Foldables only: `references/foldables.md` |
|
|
36
37
|
| Shake device | `shake` | Shake handlers (sim/emu only), Undo-typing prompt, RN dev menu |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: argent-macos-app-interact
|
|
3
|
+
description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos) 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").
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`argent-device-interact` still applies for everything not listed here (`run-sequence`, `await-ui-element`, secrets).
|
|
7
|
+
|
|
8
|
+
## Contract
|
|
9
|
+
|
|
10
|
+
- Needs the `macos-apps` flag. When a tool says it is off, tell the user to run the command it names. Do not change the flag yourself.
|
|
11
|
+
- One app is one device. `list-devices` shows only apps argent started that still run, also those of other sessions: never pick one unless the user named that app or this session started it.
|
|
12
|
+
- Start an app with `boot-device {macosAppPath: "<abs path>.app"}`, never with `open` or Xcode. Use `launch-app` only for an app argent already started: with no recorded path it takes whichever copy Spotlight finds.
|
|
13
|
+
- Build the `.app` without starting it: `xcodebuild ... build`, then take the bundle from `BUILT_PRODUCTS_DIR` (`xcodebuild -showBuildSettings`). Xcode Run and `react-native run-macos` start a copy without the argent library: `boot-device` then fails with `already running ... without the argent library`. Retry with `force: true`, but ask the user first when they may have work open in that copy.
|
|
14
|
+
- Never pass `force` when the error names another build path; report it.
|
|
15
|
+
- After a code change: rebuild, then `restart-app`.
|
|
16
|
+
- A start result with a `note` that the app showed no window: taps and screenshots need one. Tell the user, and read the log file it names.
|
|
17
|
+
- On a hardened-runtime refusal, report it to the user. Do not sign files or change code signing.
|
|
18
|
+
- Never activate the app or drive it with `osascript`, `open` or other system tools.
|
|
19
|
+
- At the end: `stop-all-simulator-servers {devices: ["macos-app-<bundle id>"]}` closes argent's connection; the app keeps running.
|
|
20
|
+
|
|
21
|
+
## Per-tool notes
|
|
22
|
+
|
|
23
|
+
- Swipe or drag: `gesture-drag`. Long press: `gesture-drag` with the same start and end point. Scroll: `gesture-scroll`.
|
|
24
|
+
- Zoom or rotate: `gesture-pinch` and `gesture-rotate` fail; use the app's own controls or shortcuts.
|
|
25
|
+
- After a right-click (`gesture-tap` with `button: "right"`), the returned tree lists the menu items; a plain `gesture-tap` on one chooses it (the menu can stay in the tree for a moment while it closes). `keyboard` `escape` closes the menu; `enter` chooses nothing after a right-click, so tap the item.
|
|
26
|
+
- No hover: a tooltip is out of reach.
|
|
27
|
+
- `open-url`: the URL goes to the running app. A custom scheme must be one the app declares; `http` and `https` go to the app, not the browser; a `file:` URL opens that document in the app.
|
|
28
|
+
- A SwiftUI `DisclosureGroup` opens only at its chevron, near the left end of its frame: a tap at the centre passes and does nothing. Tap along the left end in steps of about 0.008 until its `value` changes.
|
|
29
|
+
- `menu-bar` for any menu command. An item listed `[disabled]` cannot be chosen right now: an edit command (Copy, Select All) needs the text field clicked first; while an alert is open only its own commands work, so answer the alert first. When a menu of the app is open, `choose` fails: send `keyboard {key: "escape"}`, then choose again.
|
|
30
|
+
- Open and save panels: never click in the file list, which `describe` cannot read. Use `file-panel`, also for the Delete or Don't Save prompt of an edited new document.
|
|
31
|
+
|
|
32
|
+
## Tree
|
|
33
|
+
|
|
34
|
+
- Identifiers: AppKit accessibility identifier, SwiftUI `.accessibilityIdentifier()`, web `data-testid` (else `id`), React Native `testID` (also on a plain `View` or `Text`).
|
|
35
|
+
- Hint `The Mac is locked` or `fallback walk`: clicks and typing still work, elements can be missing (an open context menu among them), and a `hidden` check cannot pass. Ask the user to unlock when a target is missing.
|
|
36
|
+
- An action that fails or has no effect: a minimized window takes no input. Restore it by choosing it in the Window menu with `menu-bar`; without such an item, ask the user.
|
|
37
|
+
|
|
38
|
+
## E2E tests
|
|
39
|
+
|
|
40
|
+
Read `references/e2e.md` before recording or writing a test for a Mac app.
|
|
41
|
+
|
|
42
|
+
## react-native-macos
|
|
43
|
+
|
|
44
|
+
A Debug build loads JavaScript from Metro: start Metro before `boot-device` (see `argent-react-native-app-workflow`). `debugger-*` and the React profiler do not take a Mac app id: read the screen with `describe`.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# E2E tests on a Mac app
|
|
2
|
+
|
|
3
|
+
- Record the launch as a `restart-app` step, then write it as `launch: { macos: <bundle id> }` (keep `{ app, args }` if the recorder wrote args) so the runner picks the Mac app and starts it. Otherwise run with `--platform macos` or the device id: without them the runner never picks a Mac app.
|
|
4
|
+
- A `swipe` is a mouse drag, a `long-press` a press and hold. `pinch` and `rotate` fail.
|
|
5
|
+
- A right-click is `tap: { on: <selector>, button: right }`.
|
|
6
|
+
- A file panel is a `tool: file-panel` step, a menu command a `tool: menu-bar` step (`args: { action: choose, path: [Edit, Select All] }`). Gate a branch with `when: { platform: macos }`.
|
|
@@ -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, 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. 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.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Create a QA regression e2e test
|
|
@@ -5,6 +5,8 @@ description: Step-by-step workflows for developing or debugging React Native app
|
|
|
5
5
|
|
|
6
6
|
Physical iPhone (`kind: "device"`): Metro debugging and profiling tools reject it. Use a simulator.
|
|
7
7
|
|
|
8
|
+
react-native-macos app: start Metro (§1.2), then follow `argent-macos-app-interact` instead of `run-macos`.
|
|
9
|
+
|
|
8
10
|
## 1. Starting the React Native App
|
|
9
11
|
|
|
10
12
|
### 1.1 Read the project's configuration first
|
|
@@ -13,7 +13,7 @@ Physical iPhone: not supported; `react-profiler-*` reject `kind: "device"`. Prof
|
|
|
13
13
|
|
|
14
14
|
- `react-profiler-start` / `react-profiler-stop`: record CPU samples and React commits around an interaction.
|
|
15
15
|
- `react-profiler-analyze`: turn the recording into a ranked report: hot commits with the JS functions that ran during each.
|
|
16
|
-
- `react-profiler-status`: **only after an interruption** (debugger drop, Metro reload, pause, subagent handoff, any doubt), never otherwise.
|
|
16
|
+
- `react-profiler-status`: **only after an interruption** (debugger drop, Metro reload, pause, subagent handoff, any doubt), never otherwise. After a debugger drop, react-profiler-stop can no longer collect the run; check status before stopping or restarting.
|
|
17
17
|
- `react-profiler-component-source`: source, location and memoization status of a component the report flagged.
|
|
18
18
|
- `react-profiler-renders`: how many instances of each component are mounted in the top 30 levels of the tree, with their last render time; no session needed. It does not count re-renders: record a profile for that.
|
|
19
19
|
- `react-profiler-fiber-tree`: live component hierarchy, no session needed, for tracing a component's ancestry.
|
|
@@ -98,7 +98,7 @@ If the user does not want changes, present the report and suggest the fix withou
|
|
|
98
98
|
|
|
99
99
|
## 4. Caveats
|
|
100
100
|
|
|
101
|
-
- **Dev builds** render ~3x slower than production (the report notes it). Prioritize render counts over durations: counts carry over to production.
|
|
101
|
+
- **Dev builds** render ~3x slower than production (the report notes it). Prioritize render counts over durations: counts carry over to production. Strict Mode can double durations, but not counts.
|
|
102
102
|
- **Live API data** may differ between runs (payload sizes, item counts) and shift render counts and durations independently of your fix. Note when data-dependent components vary.
|
|
103
103
|
- **Run-to-run noise:** variations under ~10-15% in commit duration may be noise; only treat consistent, directional changes as signal.
|
|
104
104
|
- **Profiler overhead:** if the native profile shows `JSLexer`, `JSONEmitter` or Hermes internals dominating the JS thread, that is instrumentation cost, not app work. Discount those entries.
|