react-native-ai-debugger 1.0.24 → 1.0.26

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 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 running Metro servers and auto-connect |
112
- | `connect_metro` | Connect to a specific Metro port |
113
- | `get_apps` | List connected React Native apps |
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 (like pressing 'r' in Metro or shaking the device) |
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
- Get a quick overview before fetching full logs:
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 count by level + last 5 messages:
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:
@@ -3,4 +3,46 @@ export declare function executeInApp(expression: string, awaitPromise?: boolean,
3
3
  export declare function listDebugGlobals(): Promise<ExecutionResult>;
4
4
  export declare function inspectGlobal(objectName: string): Promise<ExecutionResult>;
5
5
  export declare function reloadApp(): Promise<ExecutionResult>;
6
+ /**
7
+ * Get the React component tree from the running app.
8
+ * This traverses the fiber tree to extract component hierarchy with names.
9
+ */
10
+ export declare function getComponentTree(options?: {
11
+ maxDepth?: number;
12
+ includeProps?: boolean;
13
+ includeStyles?: boolean;
14
+ hideInternals?: boolean;
15
+ format?: 'json' | 'tonl';
16
+ }): Promise<ExecutionResult>;
17
+ /**
18
+ * Get layout styles for all components on the current screen.
19
+ * Useful for verifying layout without screenshots.
20
+ */
21
+ export declare function getScreenLayout(options?: {
22
+ maxDepth?: number;
23
+ componentsOnly?: boolean;
24
+ shortPath?: boolean;
25
+ summary?: boolean;
26
+ format?: 'json' | 'tonl';
27
+ }): Promise<ExecutionResult>;
28
+ /**
29
+ * Inspect a specific component by name, returning its props, state, and layout.
30
+ */
31
+ export declare function inspectComponent(componentName: string, options?: {
32
+ index?: number;
33
+ includeState?: boolean;
34
+ includeChildren?: boolean;
35
+ shortPath?: boolean;
36
+ simplifyHooks?: boolean;
37
+ }): Promise<ExecutionResult>;
38
+ /**
39
+ * Find all components matching a name pattern and return summary info.
40
+ */
41
+ export declare function findComponents(pattern: string, options?: {
42
+ maxResults?: number;
43
+ includeLayout?: boolean;
44
+ shortPath?: boolean;
45
+ summary?: boolean;
46
+ format?: 'json' | 'tonl';
47
+ }): Promise<ExecutionResult>;
6
48
  //# sourceMappingURL=executor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/core/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA8N7D,wBAAsB,YAAY,CAC9B,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,OAAc,EAC5B,OAAO,GAAE,cAAmB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAoF1B;AAGD,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,eAAe,CAAC,CAkBjE;AAGD,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAsBhF;AAGD,wBAAsB,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC,CA0H1D"}
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/core/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA8N7D,wBAAsB,YAAY,CAC9B,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,OAAc,EAC5B,OAAO,GAAE,cAAmB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAoF1B;AAGD,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,eAAe,CAAC,CAkBjE;AAGD,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAsBhF;AAGD,wBAAsB,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC,CA0H1D;AAkGD;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,GAAE;IA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