@swmansion/argent 0.22.1 → 0.22.2-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/argent-android-devtools-0.1.0.apk +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/tcp/ax-service +0 -0
- package/dist/cli-cmds.mjs +49 -21
- package/dist/installer.mjs +1 -1
- package/dist/tool-server.cjs +801 -2155
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.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 +1 -1
- package/skills/argent-create-flow/references/flow-yaml.md +30 -3
- package/skills/argent-create-flow/references/live-authoring.md +14 -12
- package/skills/argent-create-flow/references/reliability-and-recovery.md +2 -2
- package/skills/argent-device-interact/SKILL.md +3 -1
- package/skills/argent-qa-flows/SKILL.md +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -103,7 +103,7 @@ Scopes can combine and nest, with at most six scope keys. Use strict selectors f
|
|
|
103
103
|
|
|
104
104
|
## Directives
|
|
105
105
|
|
|
106
|
-
Directives stop the flow on failure and skip later steps. `flow-execute` documents their shapes. The available directives are `launch`, `tap`, `long-press`, `type`, `scroll-to`, `pinch`, `rotate`, `await`, `assert`, `wait`, `snapshot`, `run`, `when`, `echo`, and `tool`.
|
|
106
|
+
Directives stop the flow on failure and skip later steps. `flow-execute` documents their shapes. The available directives are `launch`, `tap`, `long-press`, `swipe`, `type`, `scroll-to`, `pinch`, `rotate`, `await`, `assert`, `wait`, `snapshot`, `run`, `when`, `echo`, and `tool`.
|
|
107
107
|
|
|
108
108
|
Use the launch map for cross-platform flows. 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 Vega, and a per-platform key overrides it for that platform. `chromium:` accepts a relative or absolute app path. A launch that declares no id for the run's platform is an error, not a cue to switch platforms. On iOS, 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.
|
|
109
109
|
|
|
@@ -116,9 +116,36 @@ An Android app that needs a non-launcher activity has no `launch:` form. Record
|
|
|
116
116
|
|
|
117
117
|
In a `scroll-to` map, put the selector under `target:`. The map supports `up`, `down`, `left`, and `right` directions. The default is `down`; set it explicitly to reach a target above the viewport or along a horizontal carousel. If the target is already visible, the step is a safe no-op. `tap`, `type`, and `long-press` do not auto-scroll. Add `scroll-to` when the target can be off-screen. Use `within` for a nested scroller.
|
|
118
118
|
|
|
119
|
+
### `swipe`
|
|
120
|
+
|
|
121
|
+
`swipe` is one semantic finger flick where the gesture itself is the action — dismiss a card, page a carousel, open a drawer, pull-to-refresh: `- swipe: left`, `- swipe: { from: Card, direction: left }`, `- swipe: { by: { y: -0.4 } }`.
|
|
122
|
+
|
|
123
|
+
**Never use `swipe` to scroll.** Whenever the goal is "bring X on screen so the next step can act on it", write `scroll-to: <X>` instead: it is goal-seeking (stops exactly when the target appears), momentum-free, and a no-op if the target is already visible.
|
|
124
|
+
|
|
125
|
+
**`direction` is the finger's travel** (the Maestro convention): `swipe: left` flings content leftward and reveals what is to the right, the opposite sense of `scroll-to`'s content direction. Declare exactly one travel:
|
|
126
|
+
|
|
127
|
+
- `direction` - Maestro-compatible screen geometry, with edge-gesture-safe start and end points.
|
|
128
|
+
- `by: { x?, y? }` - signed 0-1 screen fractions, one axis or both for a diagonal.
|
|
129
|
+
- `to: <target>` - an explicit endpoint, selector or point.
|
|
130
|
+
|
|
131
|
+
`from` anchors the start on a selector or `{ x, y }` point. Without it the start is the direction preset, or screen centre for `to` and `by`.
|
|
132
|
+
|
|
133
|
+
All three must clear a 0.03 minimum travel on the combined start-to-end vector; shorter reads as a tap and will be rejected/fail.
|
|
134
|
+
|
|
135
|
+
Anchoring decides how a travel that does not fit is resolved:
|
|
136
|
+
|
|
137
|
+
- `direction` keeps the preset magnitude from where the finger lands (0.8 of the width for `left`/`right`, 0.7 of the height for `down`, 0.4 for `up`), clamped at the screen edge. It fails only when the clamp leaves it under 0.03, so a drawer handle or bottom sheet near the edge still swipes.
|
|
138
|
+
- `by` delivers its exact delta or nothing. With `from`, a delta that runs off-screen fails.
|
|
139
|
+
|
|
140
|
+
Only the direction presets carry OS-edge margins. A resolved `from` point is used verbatim, so use `from` for app-level gestures only and write system-edge gestures such as system back as raw `tool: gesture-swipe` steps.
|
|
141
|
+
|
|
142
|
+
`momentum: false` removes the fling, so the swipe lands where the finger stops. The default `momentum: true` is a natural flick that flings on. `duration` (ms) is the travel time: default 300, minimum 150. A shorter gesture gives the content too few frames to track the travel, so it overshoots and may fling backwards. Every `swipe` then waits for the tree to settle, best effort, so its momentum does not swallow the next step's touch.
|
|
143
|
+
|
|
144
|
+
On Chromium a swipe is a mouse drag (`gesture-drag`), so a `from` on an `<img>`, an `<a href>` or a `draggable="true"` node starts the browser's native drag-and-drop: the page gets `pointerdown` then `pointercancel` and sees no travel. On Vega, `swipe` fails upfront like the other touch directives.
|
|
145
|
+
|
|
119
146
|
`type` presses Enter in a second `keyboard` call unless `submit: false`. A polished focus tap plus one text-only `keyboard` call usually needs `submit: false`. Store external values as `{{secret:NAME}}`. The runner uses the first source that defines the name: environment `ARGENT_SECRET_NAME`; project `.argent/secrets.env`; project `.env.local`, then `.env`; then `~/.argent/secrets.env`. The two `secrets.env` files accept the bare `NAME`, but the shared dotenv files expose only `ARGENT_SECRET_`-prefixed keys, so a bare `NAME=…` in `.env` or `.env.local` stays unresolved. The runner redacts every resolved value, so do not use a placeholder for content a report must show.
|
|
120
147
|
|
|
121
|
-
A **selector-less gesture** — a coordinate `tap`/`long-press`, or a `pinch`/`rotate` with no `on:` — resolves no frame, so a tree source it cannot read does not fail it. It settles best effort, dispatches anyway, and the step **passes carrying a warning** that quotes the source's own error. That green says the gesture was sent, not that it landed: one aimed at a moving element can miss it entirely. Restore the tree source, usually by relaunching the app so the instrumentation loads. Accept the warning only where the app serves no tree at all, and put an explicit `wait:` before a gesture that follows a transition. The first such gesture proves the outage and later ones spend that verdict without paying the settle window again. A tree read that comes back, or a relaunch, retires that verdict — which only makes the next gesture pay a fresh window, and it warns again if the source is still down.
|
|
148
|
+
A **selector-less gesture** — a coordinate `tap`/`long-press`/`swipe`, or a `pinch`/`rotate` with no `on:` — resolves no frame, so a tree source it cannot read does not fail it. It settles best effort, dispatches anyway, and the step **passes carrying a warning** that quotes the source's own error. That green says the gesture was sent, not that it landed: one aimed at a moving element can miss it entirely. Restore the tree source, usually by relaunching the app so the instrumentation loads. Accept the warning only where the app serves no tree at all, and put an explicit `wait:` before a gesture that follows a transition. The first such gesture proves the outage and later ones spend that verdict without paying the settle window again. A tree read that comes back, or a relaunch, retires that verdict — which only makes the next gesture pay a fresh window, and it warns again if the source is still down.
|
|
122
149
|
|
|
123
150
|
## Verification conditions
|
|
124
151
|
|
|
@@ -194,7 +221,7 @@ A `run:` target is a YAML path resolved against the directory of the flow file c
|
|
|
194
221
|
|
|
195
222
|
- iOS and Android can run fragments or e2e flows inline. A nested e2e launch restarts its app.
|
|
196
223
|
- Chromium boots one instance per launch **step**, not one per run. The leading launch — the flow's own, or the one its leading `run:` chain reaches — boots before step 1, unless you pinned the run with an explicit `device`, where it only attaches. Every later launch boots a fresh instance, moves the run onto it, and tears down the instance the run already owned for that app path. Nesting a Chromium e2e flow with its own launch is therefore the supported way to give a sub-scenario its own restart. Chromium rejects `pinch` and `rotate`. Use the app's own zoom or rotate controls.
|
|
197
|
-
- Vega uses `tool: tv-remote` and raw `tool: keyboard`. The touch directives (`tap`, `long-press`, `type`, `scroll-to`, `pinch`, `rotate`) are unsupported. Gate focus and navigation results with `await`.
|
|
224
|
+
- Vega uses `tool: tv-remote` and raw `tool: keyboard`. The touch directives (`tap`, `long-press`, `swipe`, `type`, `scroll-to`, `pinch`, `rotate`) are unsupported. Gate focus and navigation results with `await`.
|
|
198
225
|
|
|
199
226
|
## Snapshots and standalone runs
|
|
200
227
|
|
|
@@ -124,7 +124,8 @@ If characters are lost, restore the field with direct calls. Do not record a dup
|
|
|
124
124
|
Record the required live gesture. During polish:
|
|
125
125
|
|
|
126
126
|
- Convert element-seeking movement to selector-based `scroll-to`.
|
|
127
|
-
-
|
|
127
|
+
- Convert a swipe that is a gesture in its own right - swipe-to-dismiss, paging a carousel, revealing a row action - to `swipe:`, anchoring `from` on the gesture's **subject** (the card being dismissed, the row being revealed), not on whatever content happened to be under the finger.
|
|
128
|
+
- Retain a raw gesture tool only for what `swipe` deliberately doesn't express - an edge swipe (system back), a multi-touch `gesture-custom`, or exotic velocity control.
|
|
128
129
|
|
|
129
130
|
For every retained raw gesture, add an echo and a recorded result check.
|
|
130
131
|
|
|
@@ -160,16 +161,17 @@ Stop immediately. Restore the last valid screen with direct MCP calls, not `flow
|
|
|
160
161
|
|
|
161
162
|
Call `flow-finish-recording`, then read the saved YAML. Apply only meaning-preserving conversions:
|
|
162
163
|
|
|
163
|
-
| Recorded form
|
|
164
|
-
|
|
|
165
|
-
| focus tap + `tool: keyboard`
|
|
166
|
-
| text `keyboard` + `key: enter` `keyboard`
|
|
167
|
-
| `tool: await-ui-element`
|
|
168
|
-
| element-seeking movement
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
| `tool: gesture-
|
|
172
|
-
|
|
|
164
|
+
| Recorded form | Finished form |
|
|
165
|
+
| ------------------------------------------ | ------------------------------------------------------------------ |
|
|
166
|
+
| focus tap + `tool: keyboard` | `type:` |
|
|
167
|
+
| text `keyboard` + `key: enter` `keyboard` | submitted `type:` without Enter in its text |
|
|
168
|
+
| `tool: await-ui-element` | `await:` or `assert:` |
|
|
169
|
+
| element-seeking movement | `scroll-to:` |
|
|
170
|
+
| `tool: gesture-swipe` as the action itself | `swipe:` with `from` on the gesture's subject |
|
|
171
|
+
| coordinate tap or long-press | strict selector after the fallback gate |
|
|
172
|
+
| `tool: gesture-pinch` | selector-based `pinch:` with `scale = endDistance / startDistance` |
|
|
173
|
+
| `tool: gesture-rotate` | selector-based `rotate:` with `by = endAngle - startAngle` |
|
|
174
|
+
| sibling `tool: flow-execute` | recorder-captured `run:` |
|
|
173
175
|
|
|
174
176
|
Copy the recorded `selector:` map when you convert a wait. Do not use the loose bare-string form. Flow YAML accepts `identifier`; rename it to `id` only for style. Convert `textMatch: equals` to `equals:` and other text checks to `contains:`.
|
|
175
177
|
|
|
@@ -179,7 +181,7 @@ Only these unrecorded insertions are allowed, at states observed live:
|
|
|
179
181
|
- `await: { idle: true }` after a navigation identity check.
|
|
180
182
|
- The Chromium launch that packages the live boot.
|
|
181
183
|
|
|
182
|
-
Keep raw forms only when conversion changes behavior. Examples include point-anchored or panning pinch, velocity
|
|
184
|
+
Keep raw forms only when conversion changes behavior. Examples include point-anchored or panning pinch, an edge swipe or one with exotic velocity control, or rotation with a tested start angle, radius, pivot, duration, or speed. Keep screenshots for human evidence. Use `snapshot:` for automated visual comparison. Read [Flow YAML](flow-yaml.md) for syntax.
|
|
183
185
|
|
|
184
186
|
If polish reveals a missing action or structural check, restore its preceding state and record it. Do not add remembered behavior directly to YAML.
|
|
185
187
|
|
|
@@ -60,9 +60,9 @@ Give the flow a `launch:` step as usual. On iOS the launch waits the full devtoo
|
|
|
60
60
|
- Raw `tool: await-ui-element` accessibility checks.
|
|
61
61
|
- Point taps or long-presses derived from `describe`, each named by an echo.
|
|
62
62
|
- A point focus tap plus a raw text-only `keyboard` with `delayMs: 500`, and a second raw `keyboard` with `key: "enter"` to submit.
|
|
63
|
-
- Raw swipes with `
|
|
63
|
+
- Raw swipes with `momentum: false` because `scroll-to` needs the missing flow tree. Momentum-free scrolling keeps later coordinate taps valid. `momentum: false` needs `durationMs` of at least 150 and is rejected below it, so keep the 300 default or raise it.
|
|
64
64
|
|
|
65
|
-
Every point tap
|
|
65
|
+
Every point tap, long-press or coordinate swipe in such a flow passes **carrying a warning** for as long as the app serves no tree: each [selector-less gesture](flow-yaml.md#directives) dispatches unsettled. Nothing here repairs it. Accept the warnings, read each green as "the gesture was sent, not that it landed", and put an explicit `wait:` or a raw `tool: await-ui-element` before a gesture that follows a transition. Raw `tool:` steps take no settle, so they never carry that warning.
|
|
66
66
|
|
|
67
67
|
A recorded wait carries a different warning: it adds about one second and reports that the runner tree is unavailable. That warning is expected too. Keep the wait as a raw `tool:` step.
|
|
68
68
|
|
|
@@ -29,7 +29,7 @@ Use `list-devices` to get a target id. Results are tagged with `platform` (`ios`
|
|
|
29
29
|
|
|
30
30
|
1. **Always refer to tapping_rule** from your argent.md rule before tapping.
|
|
31
31
|
2. Before performing interactions, consider whether they can be **dispatched sequentially** - more on that in `run-sequence`.
|
|
32
|
-
3. **Use `gesture-swipe` for lists/scrolling**, not `gesture-custom`, unless you need non-linear movement. On Chromium use `gesture-scroll` instead — `gesture-swipe` is touch-only. Consider whether you need multiple swipes, if yes - use `run-sequence`.
|
|
32
|
+
3. **Use `gesture-swipe` for lists/scrolling**, not `gesture-custom`, unless you need non-linear movement. On Chromium use `gesture-scroll` instead — `gesture-swipe` is touch-only. Consider whether you need multiple swipes, if yes - use `run-sequence`. Pass `momentum: false` when the swipe should decelerate before ending for a precise movement.
|
|
33
33
|
4. **Tap a text field before typing**, then use `keyboard` to enter text.
|
|
34
34
|
5. **Coordinates are normalized** — always 0.0–1.0, not pixels.
|
|
35
35
|
6. **For app navigation, prefer `describe` first.** It works on any screen without app restart. Do not navigate from screenshots on regular in-app screens unless `describe` failed to expose a reliable target. Use `native-describe-screen` only when you need app-scoped UIKit properties.
|
|
@@ -131,6 +131,8 @@ Before tapping near the bottom of the screen in React Native apps, check that "O
|
|
|
131
131
|
|
|
132
132
|
Swipe **up** (`fromY > toY`) = scroll content **down**. Default duration: 300ms. Optional: `"durationMs": 500` for slower swipe.
|
|
133
133
|
|
|
134
|
+
`"momentum"` defaults to `true` (a natural flinging swipe). Pass `"momentum": false` for a momentum-free swipe: the finger decelerates into the end point, resulting in little to no fling. It needs `durationMs` of at least 150 and is rejected below it.
|
|
135
|
+
|
|
134
136
|
### gesture-pinch — Two-finger pinch
|
|
135
137
|
|
|
136
138
|
```json
|
|
@@ -101,7 +101,7 @@ After the last edit and audit, set the streak to zero:
|
|
|
101
101
|
2. Seed, review, and freeze snapshot baselines. Baseline updates do not count as passes.
|
|
102
102
|
3. Before mobile pass 1, recycle Argent services for this flow's device: two warm passes are correlated evidence, because a fixed timing margin can pass twice simply because environment speed did not change. Scope `stop-all-simulator-servers` to `devices: [<device>]`. Never omit the scope — a bare call is the machine-wide sweep, and step 7 restarts this proof often enough to reap every other agent's devices repeatedly. Use the MCP call for `flow-execute`, or `argent run stop-all-simulator-servers --devices <device>` from the standalone runner's install. The reset must not change app or account data. For Chromium, let the runner boot the declared app and omit `device`. Vega owns no recyclable Argent services, so the teardown is a no-op there and both passes are warm.
|
|
103
103
|
4. Run from the flow's launch and setup without baseline-update mode. Count a pass only when `ok: true` and every acceptance check executed. A false `when:` can skip optional setup only. An errored step does not advance the streak, and the count mixes two kinds — read each reason. One that could not run (an unreadable tree under `idle`, an unresolvable `run:` target) is environment: fix it and rerun. **A failed `launch:` also scores `errored`, and it is a verdict about the app** — an app that no longer installs or starts is the regression this test exists to catch, so report it instead of rerunning.
|
|
104
|
-
5. Resolve every passing-step warning before completion. Also resolve recorded-wait warnings from `flow-finish-recording`. Follow [Live waits and checks](../argent-create-flow/references/live-authoring.md#live-waits-and-checks). For runner warnings, `await: { idle: true }` raises [six different warnings](../argent-create-flow/references/flow-yaml.md#idle-readiness), so read which one it is first. Two say the screen was moving. One says the wait ran out mid-hold and needs a larger `timeout:`. One says the tree stayed empty. One — **settled on the UI tree alone** — says the hierarchy did hold still and only the screenshot pairs were missing, so inspect the capture path rather than the app's rendering. One says the step ended with no evidence either way. Inspect the screen, disclose the cause, and verify that surrounding acceptance checks use stable elements rather than stillness. A [selector-less gesture](../argent-create-flow/references/flow-yaml.md#directives) — a coordinate `tap`/`long-press`, or a `pinch`/`rotate` with no `on:` — warns in a different shape: a tree-source outage left it unsettled, so it dispatched blind and the green says only that the gesture was sent. Restore the tree source, usually by relaunching the app so the instrumentation loads, and rerun. Accepting that warning needs an app that serves no tree, which cannot satisfy this contract anyway.
|
|
104
|
+
5. Resolve every passing-step warning before completion. Also resolve recorded-wait warnings from `flow-finish-recording`. Follow [Live waits and checks](../argent-create-flow/references/live-authoring.md#live-waits-and-checks). For runner warnings, `await: { idle: true }` raises [six different warnings](../argent-create-flow/references/flow-yaml.md#idle-readiness), so read which one it is first. Two say the screen was moving. One says the wait ran out mid-hold and needs a larger `timeout:`. One says the tree stayed empty. One — **settled on the UI tree alone** — says the hierarchy did hold still and only the screenshot pairs were missing, so inspect the capture path rather than the app's rendering. One says the step ended with no evidence either way. Inspect the screen, disclose the cause, and verify that surrounding acceptance checks use stable elements rather than stillness. A [selector-less gesture](../argent-create-flow/references/flow-yaml.md#directives) — a coordinate `tap`/`long-press`/`swipe`, or a `pinch`/`rotate` with no `on:` — warns in a different shape: a tree-source outage left it unsettled, so it dispatched blind and the green says only that the gesture was sent. Restore the tree source, usually by relaunching the app so the instrumentation loads, and rerun. Accepting that warning needs an app that serves no tree, which cannot satisfy this contract anyway.
|
|
105
105
|
6. Run the same YAML again immediately with the same runner. Do not manually reset app or account data.
|
|
106
106
|
7. Reset the streak after any failure, edit, re-recording, baseline update, or state-changing manual recovery. Repair through `argent-create-flow`, audit again, and restart with fresh services.
|
|
107
107
|
|