react-native-ai-debugger 1.0.24 → 1.0.25
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 +63 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -108,9 +108,9 @@ Requires VS Code 1.102+ with Copilot ([docs](https://code.visualstudio.com/docs/
|
|
|
108
108
|
|
|
109
109
|
| Tool | Description |
|
|
110
110
|
| ----------------------- | ------------------------------------------------------------------ |
|
|
111
|
-
| `scan_metro` | Scan for
|
|
112
|
-
| `connect_metro` | Connect to a specific Metro port
|
|
113
|
-
| `get_apps` | List connected
|
|
111
|
+
| `scan_metro` | Scan for Metro servers and auto-connect. **Call this first** to start debugging |
|
|
112
|
+
| `connect_metro` | Connect to a specific Metro port (use when you know the exact port) |
|
|
113
|
+
| `get_apps` | List connected apps. Run `scan_metro` first if none connected |
|
|
114
114
|
| `get_connection_status` | Get detailed connection health, uptime, and recent disconnects |
|
|
115
115
|
| `get_logs` | Retrieve console logs (filtering, truncation, summary, TONL format) |
|
|
116
116
|
| `search_logs` | Search logs for specific text (truncation, TONL format) |
|
|
@@ -133,7 +133,7 @@ Requires VS Code 1.102+ with Copilot ([docs](https://code.visualstudio.com/docs/
|
|
|
133
133
|
| `execute_in_app` | Execute JavaScript code in the connected app and return the result |
|
|
134
134
|
| `list_debug_globals` | Discover available debug objects (Apollo, Redux, Expo Router, etc.) |
|
|
135
135
|
| `inspect_global` | Inspect a global object to see its properties and callable methods |
|
|
136
|
-
| `reload_app` | Reload the app (
|
|
136
|
+
| `reload_app` | Reload the app (auto-connects if needed). Use sparingly - Fast Refresh handles most changes |
|
|
137
137
|
| `get_debug_server` | Get the debug HTTP server URL for browser-based viewing |
|
|
138
138
|
|
|
139
139
|
### Android (ADB)
|
|
@@ -195,6 +195,42 @@ Requires VS Code 1.102+ with Copilot ([docs](https://code.visualstudio.com/docs/
|
|
|
195
195
|
Use get_logs to see recent console output
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
+
### `get_logs` Tool Reference
|
|
199
|
+
|
|
200
|
+
The `get_logs` tool has multiple parameters for controlling output size and format. Here's the complete reference:
|
|
201
|
+
|
|
202
|
+
| Parameter | Type | Default | Description |
|
|
203
|
+
|-----------|------|---------|-------------|
|
|
204
|
+
| `maxLogs` | number | 50 | Maximum number of logs to return |
|
|
205
|
+
| `level` | string | "all" | Filter by level: `all`, `log`, `warn`, `error`, `info`, `debug` |
|
|
206
|
+
| `startFromText` | string | - | Start from the last log containing this text |
|
|
207
|
+
| `maxMessageLength` | number | 500 | Max chars per message (0 = unlimited) |
|
|
208
|
+
| `verbose` | boolean | false | Disable all truncation, return full messages |
|
|
209
|
+
| `format` | string | "text" | Output format: `text` or `tonl` (30-50% smaller) |
|
|
210
|
+
| `summary` | boolean | false | Return counts + last 5 messages only |
|
|
211
|
+
|
|
212
|
+
#### Recommended Usage Patterns
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
# Quick overview (always start here)
|
|
216
|
+
get_logs with summary=true
|
|
217
|
+
|
|
218
|
+
# Recent errors only
|
|
219
|
+
get_logs with level="error" maxLogs=20
|
|
220
|
+
|
|
221
|
+
# Logs since last app reload
|
|
222
|
+
get_logs with startFromText="Running app" maxLogs=100
|
|
223
|
+
|
|
224
|
+
# Full messages for debugging specific issues
|
|
225
|
+
get_logs with maxLogs=10 verbose=true
|
|
226
|
+
|
|
227
|
+
# Token-efficient format for large outputs
|
|
228
|
+
get_logs with format="tonl" maxLogs=100
|
|
229
|
+
|
|
230
|
+
# Compact overview with shorter messages
|
|
231
|
+
get_logs with maxMessageLength=200 maxLogs=50
|
|
232
|
+
```
|
|
233
|
+
|
|
198
234
|
### Filtering Logs
|
|
199
235
|
|
|
200
236
|
```
|
|
@@ -221,17 +257,22 @@ Case-insensitive search across all log messages.
|
|
|
221
257
|
|
|
222
258
|
### Token-Optimized Output
|
|
223
259
|
|
|
224
|
-
The tools include several options to reduce token usage when working with AI assistants
|
|
260
|
+
The tools include several options to reduce token usage when working with AI assistants.
|
|
225
261
|
|
|
226
262
|
#### Summary Mode (Recommended First Step)
|
|
227
263
|
|
|
228
|
-
|
|
264
|
+
**Always start with `summary=true`** - it gives you the full picture in ~10-20 tokens instead of potentially thousands:
|
|
229
265
|
|
|
230
266
|
```
|
|
231
267
|
get_logs with summary=true
|
|
232
268
|
```
|
|
233
269
|
|
|
234
|
-
Returns
|
|
270
|
+
Returns:
|
|
271
|
+
- **Total count** - How many logs are in the buffer
|
|
272
|
+
- **Breakdown by level** - See if there are errors/warnings at a glance
|
|
273
|
+
- **Last 5 messages** - Most recent activity (truncated to 100 chars each)
|
|
274
|
+
|
|
275
|
+
Example output:
|
|
235
276
|
|
|
236
277
|
```
|
|
237
278
|
Total: 847 logs
|
|
@@ -247,6 +288,21 @@ Last 5 messages:
|
|
|
247
288
|
14:32:47 [ERROR] Network request failed...
|
|
248
289
|
```
|
|
249
290
|
|
|
291
|
+
#### Why Summary First?
|
|
292
|
+
|
|
293
|
+
| Approach | Tokens | Use Case |
|
|
294
|
+
|----------|--------|----------|
|
|
295
|
+
| `summary=true` | ~20-50 | Quick health check, see if errors exist |
|
|
296
|
+
| `level="error"` | ~100-500 | Investigate specific errors |
|
|
297
|
+
| `maxLogs=50` (default) | ~500-2000 | General debugging |
|
|
298
|
+
| `verbose=true` | ~2000-10000+ | Deep dive into specific data |
|
|
299
|
+
|
|
300
|
+
**Recommended workflow:**
|
|
301
|
+
1. `summary=true` → See the big picture
|
|
302
|
+
2. `level="error"` or `level="warn"` → Focus on problems
|
|
303
|
+
3. `startFromText="..."` → Get logs since specific event
|
|
304
|
+
4. `verbose=true` with low `maxLogs` → Full details when needed
|
|
305
|
+
|
|
250
306
|
#### Message Truncation
|
|
251
307
|
|
|
252
308
|
Long log messages are truncated by default (500 chars). Adjust as needed:
|