You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: connection health tracking and wait command (#27)
* feat: add connection health tracking
Track connect, disconnect, and reconnect events with timestamps in
DevToolsBridge. Show last connection event in status output and a
contextual hint when get-tree returns empty after a disconnect.
* feat: add wait command
Add wait --connected and wait --component <name> to block until
a condition is met. Uses long-poll over IPC with onStateChange
listener. Supports --timeout (default 30s), exits non-zero on timeout.
* fix: gate reconnect on 0→1 transition and validate --component arg
Reconnect events now only fire when going from zero connected apps
to one within the reconnect window, avoiding false reconnect events
in multi-app sessions. Also use typeof check for --component flag
to reject missing argument before the IPC call.
* fix: validate numeric CLI flags with parseNumericFlag helper
Extract a shared parseNumericFlag() that validates parseInt results
and exits with a clear error on non-numeric input. Replaces inline
parseInt calls for --port, --depth, --timeout, and --limit flags.
Copy file name to clipboardExpand all lines: packages/agent-react-devtools/skills/react-devtools/SKILL.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ CLI that connects to a running React or React Native app via the React DevTools
10
10
11
11
## Core Workflow
12
12
13
-
1.**Ensure connection** — check `agent-react-devtools status`. If the daemon is not running, start it with `agent-react-devtools start`.
13
+
1.**Ensure connection** — check `agent-react-devtools status`. If the daemon is not running, start it with `agent-react-devtools start`. Use `agent-react-devtools wait --connected` to block until a React app connects.
14
14
2.**Inspect** — get the component tree, search for components, inspect props/state/hooks.
15
15
3.**Profile** — start profiling, trigger the interaction (or ask the user to), stop profiling, analyze results.
16
16
4.**Act** — use the data to fix the bug, optimize performance, or explain what's happening.
@@ -22,7 +22,9 @@ CLI that connects to a running React or React Native app via the React DevTools
22
22
```bash
23
23
agent-react-devtools start # Start daemon (auto-starts on first command)
24
24
agent-react-devtools stop # Stop daemon
25
-
agent-react-devtools status # Check connection: port, connected apps, component count
25
+
agent-react-devtools status # Check connection, component count, last event
26
+
agent-react-devtools wait --connected # Block until a React app connects
27
+
agent-react-devtools wait --component App # Block until a component appears
Use this after triggering a page reload or HMR update to avoid querying empty state.
108
+
98
109
### Diagnose slow interactions
99
110
100
111
```bash
@@ -135,7 +146,7 @@ agent-react-devtools status # Should show 1 connected app
135
146
136
147
## Important Rules
137
148
138
-
-**Labels reset** when the app reloads or components unmount/remount. Always re-check with `get tree` or `find` after a page reload.
149
+
-**Labels reset** when the app reloads or components unmount/remount. After a reload, use `wait --connected` then re-check with `get tree` or `find`.
139
150
-**`status` first** — if status shows 0 connected apps, the React app is not connected. The user may need to run `npx agent-react-devtools init` in their project first.
140
151
-**Headed browser required** — if using `agent-browser`, always use `--headed` mode. Headless Chromium does not properly load the devtools connect script.
141
152
-**Profile while interacting** — profiling only captures renders that happen between `profile start` and `profile stop`. Make sure the relevant interaction happens during that window.
Block until a component with the given display name appears in the tree. Uses exact name matching. Useful after a reload to wait for a specific part of the UI to render. Default timeout: 30s. Exits non-zero on timeout.
0 commit comments