@swmansion/argent 0.32.1-next.0 → 0.32.1-next.2

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 (42) hide show
  1. package/dist/cli-cmds.mjs +1 -1
  2. package/dist/installer.mjs +7 -7
  3. package/dist/mcp-server.mjs +1 -1
  4. package/dist/tool-args.generated.d.ts +178 -178
  5. package/dist/tool-server.cjs +1270 -1459
  6. package/package.json +1 -1
  7. package/rules/argent.md +19 -183
  8. package/skills/argent-android-emulator-setup/SKILL.md +5 -13
  9. package/skills/argent-create-e2e/SKILL.md +1 -1
  10. package/skills/argent-create-e2e/references/e2e-yaml.md +12 -17
  11. package/skills/argent-create-e2e/references/live-authoring.md +25 -65
  12. package/skills/argent-create-e2e/references/reliability-and-recovery.md +8 -8
  13. package/skills/argent-device-interact/SKILL.md +65 -367
  14. package/skills/argent-device-interact/references/chromium.md +4 -19
  15. package/skills/argent-device-interact/references/foldables.md +8 -0
  16. package/skills/argent-device-interact/references/harmonyos.md +13 -50
  17. package/skills/argent-ios-device-interact/SKILL.md +0 -1
  18. package/skills/argent-ios-device-setup/SKILL.md +1 -1
  19. package/skills/argent-ios-simulator-setup/SKILL.md +3 -9
  20. package/skills/argent-lens/SKILL.md +20 -75
  21. package/skills/argent-metro-debugger/SKILL.md +35 -101
  22. package/skills/argent-native-profiler/SKILL.md +23 -92
  23. package/skills/argent-qa-e2e/SKILL.md +5 -5
  24. package/skills/argent-react-native-app-workflow/SKILL.md +34 -203
  25. package/skills/argent-react-native-optimization/SKILL.md +10 -26
  26. package/skills/argent-react-native-optimization/references/fix-reference.md +11 -11
  27. package/skills/argent-react-native-optimization/references/lint-rules.md +4 -5
  28. package/skills/argent-react-native-optimization/references/semantic-checklist.md +2 -2
  29. package/skills/argent-react-native-profiler/SKILL.md +46 -110
  30. package/skills/argent-screen-recording/SKILL.md +18 -37
  31. package/skills/argent-screenshot-diff/SKILL.md +8 -52
  32. package/skills/argent-settings-permissions/SKILL.md +15 -117
  33. package/skills/argent-test-ui-flow/SKILL.md +20 -90
  34. package/skills/argent-tv-interact/SKILL.md +9 -34
  35. package/skills/argent-tv-interact/references/vega.md +23 -0
  36. package/agents/argent-environment-inspector.md +0 -107
  37. package/agents/references/quality-control-checklist.md +0 -45
  38. package/skills/argent-device-interact/references/gesture-examples.md +0 -114
  39. package/skills/argent-device-interact/references/secrets.md +0 -23
  40. package/skills/argent-metro-debugger/references/failure-scenarios.md +0 -14
  41. package/skills/argent-metro-debugger/references/source-maps.md +0 -27
  42. package/skills/argent-react-native-profiler/references/diagnostic-tools.md +0 -101
@@ -1,114 +0,0 @@
1
- # Gesture Examples
2
-
3
- Detailed sequences and parameters for the gesture tool family. All coordinates, distances, and radii are **normalized 0.0–1.0** (fractions of screen width/height, not pixels); same coordinate space across all gesture tools.
4
-
5
- ## gesture-pinch: Two-finger pinch
6
-
7
- Pinch out (zoom in):
8
-
9
- ```json
10
- { "udid": "<UDID>", "centerX": 0.5, "centerY": 0.5, "startDistance": 0.2, "endDistance": 0.6 }
11
- ```
12
-
13
- Pinch in (zoom out):
14
-
15
- ```json
16
- { "udid": "<UDID>", "centerX": 0.5, "centerY": 0.5, "startDistance": 0.6, "endDistance": 0.2 }
17
- ```
18
-
19
- Vertical pinch (angle = 90):
20
-
21
- ```json
22
- {
23
- "udid": "<UDID>",
24
- "centerX": 0.5,
25
- "centerY": 0.5,
26
- "startDistance": 0.2,
27
- "endDistance": 0.6,
28
- "angle": 90
29
- }
30
- ```
31
-
32
- ## gesture-rotate: Two-finger rotation
33
-
34
- Clockwise 90 degrees:
35
-
36
- ```json
37
- {
38
- "udid": "<UDID>",
39
- "centerX": 0.5,
40
- "centerY": 0.5,
41
- "radius": 0.15,
42
- "startAngle": 0,
43
- "endAngle": 90
44
- }
45
- ```
46
-
47
- Counter-clockwise 45 degrees:
48
-
49
- ```json
50
- {
51
- "udid": "<UDID>",
52
- "centerX": 0.5,
53
- "centerY": 0.5,
54
- "radius": 0.15,
55
- "startAngle": 0,
56
- "endAngle": -45
57
- }
58
- ```
59
-
60
- ## gesture-custom: Custom touch sequences
61
-
62
- ### Long Press (800ms hold)
63
-
64
- ```json
65
- {
66
- "udid": "<UDID>",
67
- "events": [
68
- { "type": "Down", "x": 0.5, "y": 0.5 },
69
- { "type": "Up", "x": 0.5, "y": 0.5, "delayMs": 800 }
70
- ]
71
- }
72
- ```
73
-
74
- ### Pinch Out (zoom in): manual events
75
-
76
- ```json
77
- {
78
- "udid": "<UDID>",
79
- "events": [
80
- { "type": "Down", "x": 0.4, "y": 0.5, "x2": 0.6, "y2": 0.5 },
81
- { "type": "Move", "x": 0.2, "y": 0.5, "x2": 0.8, "y2": 0.5 },
82
- { "type": "Up", "x": 0.2, "y": 0.5, "x2": 0.8, "y2": 0.5 }
83
- ]
84
- }
85
- ```
86
-
87
- ### Pinch Out with interpolation: smooth version
88
-
89
- ```json
90
- {
91
- "udid": "<UDID>",
92
- "events": [
93
- { "type": "Down", "x": 0.4, "y": 0.5, "x2": 0.6, "y2": 0.5 },
94
- { "type": "Up", "x": 0.2, "y": 0.5, "x2": 0.8, "y2": 0.5 }
95
- ],
96
- "interpolate": 15
97
- }
98
- ```
99
-
100
- ### Drag and Drop
101
-
102
- ```json
103
- {
104
- "udid": "<UDID>",
105
- "events": [
106
- { "type": "Down", "x": 0.3, "y": 0.4 },
107
- { "type": "Move", "x": 0.3, "y": 0.4, "delayMs": 500 },
108
- { "type": "Move", "x": 0.7, "y": 0.6 },
109
- { "type": "Up", "x": 0.7, "y": 0.6 }
110
- ]
111
- }
112
- ```
113
-
114
- Add a `delayMs` on the first `Move` to simulate a hold before dragging; this is required for some drag-and-drop implementations that only activate after a sustained press.
@@ -1,23 +0,0 @@
1
- # Typing Secrets
2
-
3
- Where a `{{secret:<NAME>}}` placeholder gets its value, and the rules for using one. See the `keyboard` section of SKILL.md for the placeholder syntax itself.
4
-
5
- ## Where the value comes from
6
-
7
- The placeholder is resolved on the machine running the tool-server, from the first of these that defines the name:
8
-
9
- | # | Source | Which keys it exposes |
10
- | --- | --------------------------------------------- | -------------------------------------------------------------------- |
11
- | 1 | `ARGENT_SECRET_<NAME>` environment variable | prefixed vars only; the CI-native path |
12
- | 2 | `<project>/.argent/secrets.env` | every key (`APP_PASSWORD=…`); gitignore this file |
13
- | 3 | `<project>/.env.local`, then `<project>/.env` | only `ARGENT_SECRET_`-prefixed keys, so app config stays unreachable |
14
- | 4 | `~/.argent/secrets.env` | every key, per-user, works in any project |
15
-
16
- Over `argent link` or `ARGENT_TOOLS_URL` the tool-server can be another machine. With `argent enable forward-secrets` on the client, the client resolves each placeholder of a call with these same sources on its own machine and sends the values with the call; the tool-server's sources resolve only the names the client lacks.
17
-
18
- ## Rules
19
-
20
- - The result echoes the placeholder, never the value. An unknown name fails with the list of available secret _names_ and every source the tool-server looked in, with paths; read that list before asking the user anything. A client that forwards secrets does not add its own sources to it; `argent secrets` on the client lists those. When the failure says the required secret was not provided, the client forwards secrets and has no value for the name, so it belongs on the client's machine.
21
- - The auto-screenshot after the call is skipped so the typed value cannot re-enter your context as pixels. 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. To submit, put the text step and the Enter step in **one `run-sequence`**. The skip covers a whole batch that contains the placeholder, but a second bare `keyboard` call gets its own screenshot of the filled field.
22
- - Nothing outside those sources is reachable; never ask the user to paste a secret value into the conversation. Ask them to put it in a secrets file instead: a file edit applies to the next call, while an exported env var only reaches a tool-server (or, for a forwarded secret, a client) started afterwards.
23
- - The project sources are found by walking up from the tool-server's working directory. If a project file is not being picked up, the failure's source list shows the paths actually consulted; `~/.argent/secrets.env` needs no project and always applies.
@@ -1,14 +0,0 @@
1
- # Failure Scenarios: Recovery Steps
2
-
3
- When a debugger tool fails, use **`debugger-status`** first to diagnose. Note: `debugger-status` and `debugger-log-registry` do **not** fail when the debugger is simply unreachable: they return `{ status: "not_connected", reason, detail, guidance }` (the `detail` field carries the same error text other tools throw). Do not retry the same failing tool repeatedly without following the recovery steps.
4
-
5
- | Scenario | Error or situation | What to do |
6
- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
7
- | **Metro not running** | Error (or `not_connected` `detail`) contains: `Metro at port 8081 is not running (got: ...)` | `debugger-status` / `debugger-log-registry` return `{ status: "not_connected", reason: "metro_not_running", guidance }` here instead of erroring; other debugger tools still throw. **Start Metro yourself** unless the user asked you not to: scan the workspace configuration and run the appropriate command to start Metro in the background (by default `npx react-native start` or `npx expo start`). Wait for Metro to be ready, then retry `debugger-connect` or `debugger-status` once, not in a loop. If you cannot determine the project root, ask the user. A non-Metro server occupying the port lands here too; the `got:` text shows what answered. |
8
- | **No source locations** | `projectRoot` is `""` and source lookups report no file:line | Not a failure. Legacy Metro (RN 0.72 and older, e.g. Vega) sends no `X-React-Native-Project-Root` header, so paths cannot be resolved against a project root. `debugger-evaluate`, console logs and the network inspector work regardless; do not restart Metro to "fix" it. |
9
- | **App not connected** | Error (or `not_connected` `detail`) contains: `Metro at port 8081 has no CDP targets — is a React Native app connected?` | `debugger-status` / `debugger-log-registry` return `{ status: "not_connected", reason: "no_app_connected", guidance }` here instead of erroring; other debugger tools still throw. 1) Confirm the app is running on the device. 2) Use `restart-app` with the app's device id and bundleId to relaunch so it connects to Metro. 3) Wait a few seconds for the bundle to load. 4) Retry `debugger-status` once. Do **not** use `debugger-reload-metro` to fix this; it also requires at least one target. |
10
- | **Wrong device id** | `debugger-status` / `debugger-log-registry` return `reason: "device_mismatch"`, or `debugger-connect` fails with `DEBUGGER_TARGET_DEVICE_MISMATCH` | The `device_id` matches no debugger target on this Metro. Re-target with the `logicalDeviceId` listed in the `detail` / error message, or give the device its own Metro port. Do not retry with the same `device_id`; the result will not change. |
11
- | **Stale connection** | `debugger-status` returns `reason: "stale_connection"` | The cached debugger connection was no longer open; `debugger-status` has already discarded it. Use `restart-app` if the app is not running, then call `debugger-connect`; the next call reconnects fresh. |
12
- | **Reconnecting** | `debugger-status` / `debugger-log-registry` return `reason: "reconnecting"` | A reconnect is in flight: the previous connection was just torn down, or (Chromium) a tab switch is in progress. Transient: wait a moment and retry once. Do **not** restart the app for this. |
13
- | **Runtime unresponsive** | `reason: "runtime_unresponsive"`, or another debugger tool fails with `DEBUGGER_CDP_REQUEST_TIMEOUT` | Follow the `guidance` / error text; it explains the state and the recovery. Each attempt waits out the full CDP timeout, so never retry in a loop. |
14
- | **Was connected, then tool fails** | Any debugger tool fails with a connection or disconnect error after it was working | The app may have crashed or been closed. Use `restart-app` to relaunch the app, then call `debugger-connect` again to pick up the fresh `logicalDeviceId` (may change for booted-fresh simulators), and use that new `device_id` on all subsequent calls. |
@@ -1,27 +0,0 @@
1
- # Source Resolution for `inspect-element`
2
-
3
- `debugger-inspect-element` tries to resolve each component in the hierarchy to its source file and line. It uses a fallback chain:
4
-
5
- 1. **`_debugStack`** (React fiber property): a stack trace string from the bundled code. When available, the tool symbolicates it via Metro's `/symbolicate` endpoint to resolve to the original source file, then reads a code fragment from disk. Set `resolveSourceMaps: false` to skip symbolication and return raw bundled locations instead.
6
- 2. **`_debugSource`** (React fiber property): contains `{ fileName, lineNumber, columnNumber }` pointing directly to the original source file. No symbolication needed. The tool reads the code fragment from disk automatically.
7
- 3. **Neither available**: the tool returns the component hierarchy with `source: null` and `code: null` for all items. The hierarchy (component names) is still useful.
8
-
9
- ## When Source Info Is Missing
10
-
11
- If `debugger-inspect-element` returns all items with `source: null`, the React Native project's Babel configuration does not inject source information into JSX elements. This is common with the **automatic JSX transform** (used by Expo SDK 50+ and React Native 0.73+).
12
-
13
- **To enable source resolution**, inform the user that they can add `@babel/plugin-transform-react-jsx-source` to their project's Babel config. For example, in `babel.config.js`:
14
-
15
- ```js
16
- module.exports = function (api) {
17
- api.cache(true);
18
- return {
19
- presets: ["babel-preset-expo"], // or 'module:@react-native/babel-preset'
20
- plugins: [
21
- "@babel/plugin-transform-react-jsx-source", // enables _debugSource on fibers
22
- ],
23
- };
24
- };
25
- ```
26
-
27
- After adding the plugin, restart Metro (`npx react-native start --reset-cache` or `npx expo start --clear`) and reload the app. No extra `npm install` needed; the plugin ships with `babel-preset-expo` and `@babel/preset-env`.
@@ -1,101 +0,0 @@
1
- # Diagnostic Tools
2
-
3
- These tools can be called independently without starting a profiling session.
4
-
5
- ## Live render stats
6
-
7
- ```json
8
- { "port": 8081, "device_id": "<UDID>", "top_n": 20 }
9
- ```
10
-
11
- Call `react-profiler-renders`. Returns render counts and durations per component, useful for spotting hot components before a full profile.
12
-
13
- ## Component hierarchy
14
-
15
- ```json
16
- { "port": 8081, "device_id": "<UDID>", "max_depth": 10, "filter": "MyComponent" }
17
- ```
18
-
19
- Call `react-profiler-fiber-tree`. Inspect `useMemoCache` presence to confirm React Compiler is active for a given component. If `useMemoCache` is absent, the compiler bailed out for that component; memoization hints are safe to propose.
20
-
21
- ## Console logs
22
-
23
- ```json
24
- { "port": 8081, "device_id": "<UDID>" }
25
- ```
26
-
27
- Call `debugger-log-registry`. When connected (`status: "connected"`) it returns a summary with entry counts by level, message clusters, and the log file path. Use `Grep` on the log file to filter by level or search for specific messages. When the debugger is unreachable it does not fail: it returns `{ status: "not_connected", reason, detail, guidance }` with no log file; follow the `guidance` (do not retry in a loop, and do not try to grep a file in this state).
28
-
29
- ---
30
-
31
- # Post-Analysis Query Tools
32
-
33
- These require a completed profiling session (`react-profiler-stop` + `react-profiler-analyze`).
34
-
35
- ## CPU query
36
-
37
- ```json
38
- { "port": 8081, "device_id": "<UDID>", "mode": "top_functions", "top_n": 15 }
39
- ```
40
-
41
- Call `profiler-cpu-query`. Modes:
42
-
43
- - `top_functions`: global CPU hotspots. Add `time_window_ms: { start, end }` to filter.
44
- - `time_window`: CPU breakdown for a specific time range (e.g. during a slow commit).
45
- - `call_tree`: callers and callees of a specific `function_name`.
46
- - `component_cpu`: aggregate CPU during all commits of a `component_name`.
47
-
48
- > **Component names:** pass the name exactly as the report shows it. The report strips
49
- > `Forget(...)` / `Memo(...)` / `ForwardRef(...)` wrappers and marks them with a
50
- > `[React Compiler]` / `[React.memo] `/ `[forwardRef]` tag; both that displayed name and the
51
- > underlying wrapped name resolve. If a name maps to several distinct fibers the tool lists
52
- > the exact names to retry with rather than merging them; a combined total would not describe
53
- > any real component.
54
-
55
- ## Commit query
56
-
57
- ```json
58
- { "port": 8081, "device_id": "<UDID>", "mode": "by_component", "component_name": "AppNavigator" }
59
- ```
60
-
61
- Call `profiler-commit-query`. Modes:
62
-
63
- - `by_component`: all commits where a component rendered.
64
- - `by_time_range`: commits in a `time_range_ms` window.
65
- - `by_index`: full detail of a single `commit_index`.
66
- - `cascade_tree`: parent-child re-render cascade for a commit.
67
-
68
- ## iOS Instruments query
69
-
70
- ```json
71
- { "device_id": "<UDID>", "mode": "hang_stacks", "hang_index": 0 }
72
- ```
73
-
74
- Call `profiler-stack-query` after `native-profiler-analyze`. Modes:
75
-
76
- - `hang_stacks`: full CPU context during a specific hang.
77
- - `function_callers`: who calls a specific native `function_name`.
78
- - `thread_breakdown`: CPU time split by thread, optionally filtered.
79
- - `leak_stacks`: memory leak details, optionally filtered by `object_type`.
80
-
81
- ## Combined report
82
-
83
- ```json
84
- { "port": 8081, "device_id": "<UDID>" }
85
- ```
86
-
87
- Call `profiler-combined-report` when both React Profiler and iOS Instruments ran in parallel. Automatically correlates iOS hangs with React commits using wall-clock time alignment.
88
-
89
- ## Session reload
90
-
91
- ```json
92
- { "mode": "list" }
93
- ```
94
-
95
- Call `profiler-load`. Modes:
96
-
97
- - `list`: show all saved profiling sessions (React + iOS) in `/tmp/argent-profiler-cwd/`.
98
- - `load_react`: reload a React profiler session by `session_id` + `device_id`. Populates the `port:device_id`-keyed in-memory cache for `profiler-cpu-query` and `profiler-commit-query` (which must be called with the same `device_id` afterward).
99
- - `load_native`: re-parse native profiler XML by `session_id` and `device_id`. Populates session for `profiler-stack-query`.
100
-
101
- Use this to revisit an earlier profiling session without re-profiling. Each `react-profiler-analyze` run saves raw data with a unique timestamp.