@swmansion/argent 0.34.1-next.7 → 0.34.1-next.70
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/LICENSE +1 -0
- package/README.md +1 -1
- package/assets/argent.tracecfg.pbtxt +7 -1
- package/assets/ios-screen-stream/Info.plist +12 -0
- package/assets/ios-screen-stream/ios-screen-stream.swift +321 -0
- package/assets/trace-processor/engine_bundle.node.js +2074 -11121
- package/assets/trace-processor/trace_processor.wasm +0 -0
- package/bin/argent-android-devtools-0.4.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/simulator-server +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/linux/simulator-server +0 -0
- package/bin/linux-arm64/simulator-server +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- package/bin/win32/simulator-server.exe +0 -0
- package/dist/cli-cmds.mjs +1259 -616
- package/dist/client.js +381 -180
- package/dist/flow-script-runner.mjs +1 -0
- package/dist/installer-help.js +4 -0
- package/dist/installer-help.js.map +1 -1
- package/dist/installer.mjs +1248 -898
- package/dist/ios-device-runner/ArgentRunner/ArgentRunner.xcodeproj/xcshareddata/xcschemes/ArgentRunner.xcscheme +1 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentLaunchPerformanceTests.swift +21 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession+Commands.swift +9 -3
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession.swift +3 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/RunnerHTTPServer.swift +21 -9
- package/dist/mcp-server.mjs +2675 -715
- package/dist/preview-ui/index.html +28 -2
- package/dist/tool-args.generated.d.ts +101 -33
- package/dist/tool-server.cjs +15873 -6272
- package/dylibs/libArgentAudio.dylib +0 -0
- 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 +1 -1
- package/rules/argent.md +6 -23
- package/skills/argent-android-emulator-setup/SKILL.md +4 -4
- package/skills/argent-create-e2e/SKILL.md +3 -0
- package/skills/argent-create-e2e/references/e2e-yaml.md +20 -2
- package/skills/argent-create-e2e/references/live-authoring.md +12 -1
- package/skills/argent-device-interact/SKILL.md +22 -21
- package/skills/argent-device-interact/references/foldables.md +22 -0
- package/skills/argent-ios-device-interact/SKILL.md +3 -3
- package/skills/argent-ios-device-setup/SKILL.md +4 -2
- package/skills/argent-macos-app-interact/SKILL.md +15 -5
- package/skills/argent-macos-app-interact/references/e2e.md +1 -1
- package/skills/argent-metro-debugger/SKILL.md +26 -14
- package/skills/argent-native-profiler/SKILL.md +14 -2
- package/skills/argent-qa-e2e/SKILL.md +1 -1
- package/skills/argent-react-native-app-workflow/SKILL.md +2 -2
- package/skills/argent-react-native-optimization/SKILL.md +10 -1
- package/skills/argent-react-native-optimization/references/fix-reference.md +10 -10
- package/skills/argent-react-native-profiler/SKILL.md +4 -3
- package/skills/argent-screen-recording/SKILL.md +6 -4
- package/skills/argent-screenshot-diff/SKILL.md +1 -1
- package/skills/argent-test-ui-flow/SKILL.md +1 -1
- package/skills/argent-tv-interact/SKILL.md +3 -3
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Match profiler findings and semantic sweep results to concrete fixes. With React Compiler active, skip the first three rows for the components it compiles; keep them for components it skips (`compilationMode: "annotation"`, `"use no memo"`, a `sources` filter).
|
|
4
4
|
|
|
5
|
-
| Finding | Fix
|
|
6
|
-
| -------------------------------------------- |
|
|
7
|
-
| Re-renders with same props | `React.memo(Comp)`
|
|
8
|
-
| Expensive recomputation / unstable callbacks | `useMemo(fn, [deps])` / `useCallback(fn, [deps])`
|
|
9
|
-
| Inline objects/arrays in JSX | `StyleSheet.create()` / module-level const
|
|
10
|
-
| List jank | `removeClippedSubviews`, `maxToRenderPerBatch`, `windowSize`, `getItemLayout`
|
|
11
|
-
| JS-thread animation jank | `useNativeDriver: true` or `react-native-reanimated`
|
|
12
|
-
| Heavy work during transitions | `requestIdleCallback()`
|
|
13
|
-
| Slow startup | Defer heavy imports (lazy `require()`)
|
|
14
|
-
| Redundant, heavy, or n+1 network calls | `view-network-logs` → `view-network-request-details`
|
|
5
|
+
| Finding | Fix | Detail |
|
|
6
|
+
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
|
7
|
+
| Re-renders with same props | `React.memo(Comp)` | Only where the props really are equal between renders |
|
|
8
|
+
| Expensive recomputation / unstable callbacks | `useMemo(fn, [deps])` / `useCallback(fn, [deps])` | `useCallback` must pair with `React.memo` on child; alone it has no effect |
|
|
9
|
+
| Inline objects/arrays in JSX | `StyleSheet.create()` / module-level const | New reference every render breaks shallow equality |
|
|
10
|
+
| List jank | `removeClippedSubviews`, `maxToRenderPerBatch`, `windowSize`, `getItemLayout` | Or migrate to `@shopify/flash-list` (v2 needs the New Architecture) |
|
|
11
|
+
| JS-thread animation jank | `useNativeDriver: true` or `react-native-reanimated` | `useNativeDriver` can't animate layout props (width, height, margins, …) |
|
|
12
|
+
| Heavy work during transitions | `requestIdleCallback()` | Runs the work when the JS thread is idle; `InteractionManager` is deprecated |
|
|
13
|
+
| Slow startup | Defer heavy imports (lazy `require()`) | Check inline requires in the Metro config (on in bare RN, off in Expo) |
|
|
14
|
+
| Redundant, heavy, or n+1 network calls | `network-capture-start` (iOS and Android), repeat the action, then `view-network-logs` → `view-network-request-details`. Before the next profile, call `network-capture-stop`, then `restart-app` | Batch, debounce, or cache at the data layer |
|
|
@@ -7,9 +7,10 @@ This skill is complementary to `argent-react-native-optimization`, not a replace
|
|
|
7
7
|
|
|
8
8
|
Physical iPhone: not supported; `react-profiler-*` reject `kind: "device"`. Profile on a simulator.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`react-profiler-start`
|
|
10
|
+
Mac profiling supports react-native-macos 0.76 or later and React Native built for Mac Catalyst.
|
|
11
|
+
Start Metro, then use `argent-macos-app-interact` to launch a Debug build with Hermes. In
|
|
12
|
+
`react-profiler-start`, pass `id` from the app's `list-devices` entry as `device_id`. Use the same ID
|
|
13
|
+
and Metro port throughout the session.
|
|
13
14
|
If Metro cannot find the runtime, make sure the app is running, wait for its bundle to load, and
|
|
14
15
|
check the port (8081 by default). Retry with the same app ID, even if Metro lists other devices.
|
|
15
16
|
If the retry fails, report the error.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: argent-screen-recording
|
|
3
|
-
description: Record a video
|
|
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,17 +14,19 @@ A forgotten recording keeps capturing until its `timeLimitSeconds` cap fires, ho
|
|
|
14
14
|
|
|
15
15
|
## 2. Workflow
|
|
16
16
|
|
|
17
|
-
1.
|
|
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.
|
|
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
|
-
- **
|
|
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
|
+
- **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.
|
|
28
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.
|
|
29
31
|
- **Remote (`remote:`) simulators**: the video keeps the screen's portrait orientation, so a device in landscape plays sideways.
|
|
30
32
|
- **Android**: secure screens (DRM, some password fields) come out black.
|
|
@@ -19,7 +19,7 @@ Do not use screenshot diffing for tap-coordinate discovery. Use `describe` to fi
|
|
|
19
19
|
## 3. Deterministic Flow
|
|
20
20
|
|
|
21
21
|
1. Navigate to the known-good state. Capture the baseline before the relevant interaction or before editing whenever feasible.
|
|
22
|
-
2. Save a baseline PNG with `screenshot` using `scale: 1.0` and `includeImageInContext: false`, so the full-size image stays out of context; keep the returned `path`. Use normal downscaled screenshots for everything else.
|
|
22
|
+
2. Save a baseline PNG with `screenshot` using `scale: 1.0` and `includeImageInContext: false`, so the full-size image stays out of context; keep the returned `path`. Use normal downscaled screenshots for everything else. Images of different sizes return `dimension_mismatch` and are not compared, so keep one baseline per device model.
|
|
23
23
|
3. Perform the interaction, apply the code change and navigate to the state under test, after the app reloads or rebuilds.
|
|
24
24
|
4. Call `screenshot-diff` with that `baselinePath`, `captureCurrent: true`, `udid`, and `outputDir`. If both images are already saved, pass `currentPath` instead of `captureCurrent`.
|
|
25
25
|
5. Inspect the summary and artifact paths, then combine the diff with normal visual inspection and any structural/runtime evidence needed for the assertion.
|
|
@@ -20,7 +20,7 @@ For implementation tasks that modify visible UI, this workflow also serves as a
|
|
|
20
20
|
4. **Verify**: check the returned screenshot. If it shows a loading/transitional state, block with `await-ui-element` (expected element `visible`, or a spinner `hidden`) rather than a guessed delay (its result carries the new screenshot and element tree), but only with a selector you can trust (`text`/`identifier`/`role`) that the screen is known to have or that you saw in a prior `describe`; a guessed one just times out. Otherwise use a short fixed wait. Pick evidence by what's being asserted:
|
|
21
21
|
- **Visual** (layout, spacing, color, typography, image/icon rendering, clipping, overflow, text rendering): prefer `screenshot-diff` against the step 1 baseline: it surfaces pixel-visible changes the auto-screenshot might miss. Fall back to inspecting the auto-screenshot only when a stable baseline isn't available.
|
|
22
22
|
- **Structural** (navigation state, element existence, accessibility labels/values, selection, hierarchy, route): verify with `describe` or `debugger-component-tree`.
|
|
23
|
-
- **Runtime / log / network** (console errors, API calls, persistence, timing): verify with `view-network-logs
|
|
23
|
+
- **Runtime / log / network** (console errors, API calls, persistence, timing): verify with `view-network-logs` (on iOS and Android, call `network-capture-start` before the action whose requests you check, and `network-capture-stop` when you have them), `debugger-log-registry`, `debugger-evaluate`, or targeted tests. A `not_connected` result from the debugger tools is not evidence about the app: follow its `guidance`, then re-verify.
|
|
24
24
|
- **Mixed**: collect evidence for each relevant class.
|
|
25
25
|
- Report the combined verdict: expected behavior, observed behavior, evidence used, and any blocker for requested visual diffing.
|
|
26
26
|
5. **Repeat** for each step in the flow.
|
|
@@ -8,7 +8,7 @@ description: Control and inspect TV apps via argent, Apple TV (tvOS), Android TV
|
|
|
8
8
|
## Critical
|
|
9
9
|
|
|
10
10
|
- A TV is **focus-driven, not touch-driven.** Drive every interaction with `describe` + `tv-remote` + `keyboard`; never use `gesture-*` / coordinate taps; they don't apply on any TV platform.
|
|
11
|
-
- **Always
|
|
11
|
+
- **Always read the focus view before navigating** (`describe`, or the tree the last action returned) to find the live cursor and your target; never guess focus from a screenshot. The cursor is the focused element; on **Vega** the toolkit often leaves `focused` false and marks the highlighted item `[selected]`, so treat `[selected]` as the cursor when nothing reports `[focused]`.
|
|
12
12
|
- Pass the `udid` from `list-devices`: an Apple TV simulator UDID or an Android TV / Vega `serial`. Dispatch is automatic from the id; the same tools drive all three.
|
|
13
13
|
- **E2E tests: Vega only.** Apple TV and Android TV have no e2e support (a `tap:` can pass without doing anything): report that limitation.
|
|
14
14
|
- **Fire TV (Vega)** (`platform: "vega"` in `list-devices`): read `references/vega.md` before driving it. It covers booting and stopping the VVD, Fast Refresh, and debugging the JS runtime.
|
|
@@ -16,8 +16,8 @@ description: Control and inspect TV apps via argent, Apple TV (tvOS), Android TV
|
|
|
16
16
|
## The navigation loop
|
|
17
17
|
|
|
18
18
|
1. `describe`: find the cursor and your target.
|
|
19
|
-
2. `tv-remote`: move focus toward the target. Prefer **one** call with a path ending in `select`, e.g. `{button:["down","right","select"]}`; count rows/columns from the list order.
|
|
20
|
-
3. `describe`
|
|
19
|
+
2. `tv-remote`: move focus toward the target. Prefer **one** call with a path ending in `select`, e.g. `{button:["down","right","select"]}`; on Vega, count rows/columns from the frames to build the path. The Apple TV / Android TV focus view is a flat list with no positions: count from the list order, and read the grid's shape from the screenshot.
|
|
20
|
+
3. Read where focus landed from the focus view returned under `--- Elements after action (describe) ---`; call `describe` only when that section is missing. To wait for focus to land on Apple TV, `await-ui-element {condition:"exists", selector:{text:"X", role:"focused"}}`. On a miss, repeat.
|
|
21
21
|
|
|
22
22
|
## Tools
|
|
23
23
|
|