react-native-ai-debugger 1.6.16 → 1.8.1

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 (160) hide show
  1. package/README.md +8 -1
  2. package/build/__tests__/unit/exec.test.d.ts +2 -0
  3. package/build/__tests__/unit/exec.test.d.ts.map +1 -0
  4. package/build/__tests__/unit/exec.test.js +54 -0
  5. package/build/__tests__/unit/exec.test.js.map +1 -0
  6. package/build/__tests__/unit/focusedInput.test.d.ts +2 -0
  7. package/build/__tests__/unit/focusedInput.test.d.ts.map +1 -0
  8. package/build/__tests__/unit/focusedInput.test.js +58 -0
  9. package/build/__tests__/unit/focusedInput.test.js.map +1 -0
  10. package/build/__tests__/unit/focusedInputTools.test.d.ts +2 -0
  11. package/build/__tests__/unit/focusedInputTools.test.d.ts.map +1 -0
  12. package/build/__tests__/unit/focusedInputTools.test.js +79 -0
  13. package/build/__tests__/unit/focusedInputTools.test.js.map +1 -0
  14. package/build/__tests__/unit/tap.test.js +46 -0
  15. package/build/__tests__/unit/tap.test.js.map +1 -1
  16. package/build/core/android.d.ts +3 -3
  17. package/build/core/android.d.ts.map +1 -1
  18. package/build/core/android.js +21 -14
  19. package/build/core/android.js.map +1 -1
  20. package/build/core/appDetection.d.ts +7 -0
  21. package/build/core/appDetection.d.ts.map +1 -1
  22. package/build/core/appDetection.js +38 -17
  23. package/build/core/appDetection.js.map +1 -1
  24. package/build/core/componentSearch.d.ts +38 -0
  25. package/build/core/componentSearch.d.ts.map +1 -0
  26. package/build/core/componentSearch.js +419 -0
  27. package/build/core/componentSearch.js.map +1 -0
  28. package/build/core/componentTree.d.ts +12 -0
  29. package/build/core/componentTree.d.ts.map +1 -0
  30. package/build/core/componentTree.js +275 -0
  31. package/build/core/componentTree.js.map +1 -0
  32. package/build/core/connection.d.ts +1 -0
  33. package/build/core/connection.d.ts.map +1 -1
  34. package/build/core/connection.js +99 -89
  35. package/build/core/connection.js.map +1 -1
  36. package/build/core/debugGlobals.d.ts +5 -0
  37. package/build/core/debugGlobals.d.ts.map +1 -0
  38. package/build/core/debugGlobals.js +300 -0
  39. package/build/core/debugGlobals.js.map +1 -0
  40. package/build/core/errors.d.ts +14 -0
  41. package/build/core/errors.d.ts.map +1 -0
  42. package/build/core/errors.js +17 -0
  43. package/build/core/errors.js.map +1 -0
  44. package/build/core/exec.d.ts +22 -0
  45. package/build/core/exec.d.ts.map +1 -0
  46. package/build/core/exec.js +54 -0
  47. package/build/core/exec.js.map +1 -0
  48. package/build/core/executor.d.ts +7 -204
  49. package/build/core/executor.d.ts.map +1 -1
  50. package/build/core/executor.js +10 -4103
  51. package/build/core/executor.js.map +1 -1
  52. package/build/core/focusedInput.d.ts +27 -0
  53. package/build/core/focusedInput.d.ts.map +1 -0
  54. package/build/core/focusedInput.js +110 -0
  55. package/build/core/focusedInput.js.map +1 -0
  56. package/build/core/focusedInputTools.d.ts +21 -0
  57. package/build/core/focusedInputTools.d.ts.map +1 -0
  58. package/build/core/focusedInputTools.js +51 -0
  59. package/build/core/focusedInputTools.js.map +1 -0
  60. package/build/core/guides.d.ts.map +1 -1
  61. package/build/core/guides.js +15 -2
  62. package/build/core/guides.js.map +1 -1
  63. package/build/core/index.d.ts +4 -3
  64. package/build/core/index.d.ts.map +1 -1
  65. package/build/core/index.js +4 -3
  66. package/build/core/index.js.map +1 -1
  67. package/build/core/inspector.d.ts +50 -0
  68. package/build/core/inspector.d.ts.map +1 -0
  69. package/build/core/inspector.js +604 -0
  70. package/build/core/inspector.js.map +1 -0
  71. package/build/core/ios.d.ts +8 -0
  72. package/build/core/ios.d.ts.map +1 -1
  73. package/build/core/ios.js +142 -2
  74. package/build/core/ios.js.map +1 -1
  75. package/build/core/jsExecute.d.ts +27 -0
  76. package/build/core/jsExecute.d.ts.map +1 -0
  77. package/build/core/jsExecute.js +453 -0
  78. package/build/core/jsExecute.js.map +1 -0
  79. package/build/core/ocr.d.ts +13 -0
  80. package/build/core/ocr.d.ts.map +1 -1
  81. package/build/core/ocr.js +37 -15
  82. package/build/core/ocr.js.map +1 -1
  83. package/build/core/posthog.d.ts.map +1 -1
  84. package/build/core/posthog.js +7 -1
  85. package/build/core/posthog.js.map +1 -1
  86. package/build/core/pressables.d.ts +44 -0
  87. package/build/core/pressables.d.ts.map +1 -0
  88. package/build/core/pressables.js +1480 -0
  89. package/build/core/pressables.js.map +1 -0
  90. package/build/core/register.d.ts +8 -0
  91. package/build/core/register.d.ts.map +1 -0
  92. package/build/core/register.js +216 -0
  93. package/build/core/register.js.map +1 -0
  94. package/build/core/screenLayout.d.ts +52 -0
  95. package/build/core/screenLayout.d.ts.map +1 -0
  96. package/build/core/screenLayout.js +828 -0
  97. package/build/core/screenLayout.js.map +1 -0
  98. package/build/core/toolHelpers.d.ts +24 -0
  99. package/build/core/toolHelpers.d.ts.map +1 -0
  100. package/build/core/toolHelpers.js +118 -0
  101. package/build/core/toolHelpers.js.map +1 -0
  102. package/build/core/types.d.ts +11 -6
  103. package/build/core/types.d.ts.map +1 -1
  104. package/build/index.d.ts +2 -4
  105. package/build/index.d.ts.map +1 -1
  106. package/build/index.js +37 -4313
  107. package/build/index.js.map +1 -1
  108. package/build/pro/tap.d.ts +51 -5
  109. package/build/pro/tap.d.ts.map +1 -1
  110. package/build/pro/tap.js +457 -54
  111. package/build/pro/tap.js.map +1 -1
  112. package/build/tools/accountTools.d.ts +2 -0
  113. package/build/tools/accountTools.d.ts.map +1 -1
  114. package/build/tools/accountTools.js +5 -0
  115. package/build/tools/accountTools.js.map +1 -1
  116. package/build/tools/bundleTools.d.ts +3 -0
  117. package/build/tools/bundleTools.d.ts.map +1 -0
  118. package/build/tools/bundleTools.js +368 -0
  119. package/build/tools/bundleTools.js.map +1 -0
  120. package/build/tools/componentTools.d.ts +3 -0
  121. package/build/tools/componentTools.d.ts.map +1 -0
  122. package/build/tools/componentTools.js +639 -0
  123. package/build/tools/componentTools.js.map +1 -0
  124. package/build/tools/connectionTools.d.ts +3 -0
  125. package/build/tools/connectionTools.d.ts.map +1 -0
  126. package/build/tools/connectionTools.js +564 -0
  127. package/build/tools/connectionTools.js.map +1 -0
  128. package/build/tools/deviceTools.d.ts +3 -0
  129. package/build/tools/deviceTools.d.ts.map +1 -0
  130. package/build/tools/deviceTools.js +296 -0
  131. package/build/tools/deviceTools.js.map +1 -0
  132. package/build/tools/executionTools.d.ts +3 -0
  133. package/build/tools/executionTools.d.ts.map +1 -0
  134. package/build/tools/executionTools.js +173 -0
  135. package/build/tools/executionTools.js.map +1 -0
  136. package/build/tools/interactionTools.d.ts +3 -0
  137. package/build/tools/interactionTools.d.ts.map +1 -0
  138. package/build/tools/interactionTools.js +414 -0
  139. package/build/tools/interactionTools.js.map +1 -0
  140. package/build/tools/logTools.d.ts +3 -0
  141. package/build/tools/logTools.d.ts.map +1 -0
  142. package/build/tools/logTools.js +371 -0
  143. package/build/tools/logTools.js.map +1 -0
  144. package/build/tools/metaTools.d.ts +7 -0
  145. package/build/tools/metaTools.d.ts.map +1 -0
  146. package/build/tools/metaTools.js +205 -0
  147. package/build/tools/metaTools.js.map +1 -0
  148. package/build/tools/networkTools.d.ts +3 -0
  149. package/build/tools/networkTools.d.ts.map +1 -0
  150. package/build/tools/networkTools.js +478 -0
  151. package/build/tools/networkTools.js.map +1 -0
  152. package/build/tools/reduxTools.d.ts +3 -0
  153. package/build/tools/reduxTools.d.ts.map +1 -0
  154. package/build/tools/reduxTools.js +83 -0
  155. package/build/tools/reduxTools.js.map +1 -0
  156. package/build/tools/screenshotTools.d.ts +3 -0
  157. package/build/tools/screenshotTools.d.ts.map +1 -0
  158. package/build/tools/screenshotTools.js +606 -0
  159. package/build/tools/screenshotTools.js.map +1 -0
  160. package/package.json +1 -1
@@ -0,0 +1,606 @@
1
+ import { z } from "zod";
2
+ import { registerToolWithTelemetry } from "../core/register.js";
3
+ import { iosScreenshot, androidScreenshot, detectLogBox, formatLogBoxWarning, recognizeText, inferIOSDevicePixelRatio, getPressableElements, imageBuffer, getActiveOrBootedSimulatorUdid, connectedApps, getConnectedAppBySimulatorUdid, getConnectedAppByAndroidDeviceId, iosDescribeAll, detectIOSSystemOverlay, formatIOSSystemOverlayWarning, androidGetStatusBarHeight, androidGetDensity, } from "../core/index.js";
4
+ export function registerScreenshotTools(server) {
5
+ // Tool: iOS screenshot
6
+ registerToolWithTelemetry(server, "ios_screenshot", {
7
+ description: "Take a screenshot from an iOS simulator. Returns the image plus two lists: (1) pressable elements — the tappable components on screen with ready-to-use pixel tap coordinates, testIDs, and labels; (2) screen layout — all visible React components for context. Prefer tap(text=\"...\") when text is exact and unique; otherwise use tap(x, y) with coordinates from the pressables list — this is the most reliable way to tap icons or visually-identified elements. Use component names from the layout for inspect_component/find_components.\n" +
8
+ "PURPOSE: Snapshot what the user sees on iOS AND get tap-ready pressables + a structured component map in one call.\n" +
9
+ "WHEN TO USE: Any visual verification, before/after comparison, or as the starting point for tapping UI by coordinates.\n" +
10
+ "WORKFLOW: ios_screenshot -> pick element from pressables -> tap(x, y) or tap(testID=...) -> ios_screenshot to verify.\n" +
11
+ "LIMITATIONS: Requires a booted iOS simulator (simctl). For physical devices or system dialogs without RN, combine with tap(..., native=true).\n" +
12
+ "GOOD: ios_screenshot()\n" +
13
+ "BAD: ios_screenshot({ udid: \"guess\" }) with a made-up UDID — run list_ios_simulators first.\n" +
14
+ "SEE ALSO: call get_usage_guide(topic=\"interact\") for the full device-interaction playbook.",
15
+ inputSchema: {
16
+ outputPath: z
17
+ .string()
18
+ .optional()
19
+ .describe("Optional path to save the screenshot. If not provided, saves to temp directory."),
20
+ udid: z
21
+ .string()
22
+ .optional()
23
+ .describe("Optional simulator UDID (from list_ios_simulators). Uses booted simulator if not specified.")
24
+ }
25
+ }, async ({ outputPath, udid }) => {
26
+ const result = await iosScreenshot(outputPath, udid);
27
+ if (!result.success) {
28
+ return {
29
+ content: [
30
+ {
31
+ type: "text",
32
+ text: `Error: ${result.error}`
33
+ }
34
+ ],
35
+ isError: true
36
+ };
37
+ }
38
+ // Include image data if available
39
+ if (result.data) {
40
+ // Build info text with coordinate guidance for iOS
41
+ const pixelWidth = result.originalWidth || 0;
42
+ const pixelHeight = result.originalHeight || 0;
43
+ // Resolve the RN app running on THIS simulator so enrichment pulls
44
+ // fiber/layout data from the right app (not the first-connected one,
45
+ // which may belong to a different simulator).
46
+ const resolvedUdid = udid || (await getActiveOrBootedSimulatorUdid());
47
+ const targetApp = resolvedUdid ? getConnectedAppBySimulatorUdid(resolvedUdid) : null;
48
+ const targetDeviceName = targetApp?.deviceInfo.deviceName;
49
+ // Store screenshot metadata on the matching app (not an arbitrary one)
50
+ if (targetApp) {
51
+ targetApp.lastScreenshot = {
52
+ originalWidth: pixelWidth,
53
+ originalHeight: pixelHeight,
54
+ scaleFactor: result.scaleFactor || 1,
55
+ };
56
+ }
57
+ // Try to get actual screen dimensions and safe area from accessibility tree
58
+ let pointWidth = 0;
59
+ let pointHeight = 0;
60
+ let scaleFactor = 3; // Default to 3x for modern iPhones
61
+ let safeAreaTop = 59; // Default safe area offset
62
+ try {
63
+ const describeResult = await iosDescribeAll(udid);
64
+ if (describeResult.success && describeResult.elements && describeResult.elements.length > 0) {
65
+ // First element is typically the Application with full screen frame
66
+ const rootElement = describeResult.elements[0];
67
+ // Try parsed frame first, then parse AXFrame string
68
+ if (rootElement.frame) {
69
+ pointWidth = Math.round(rootElement.frame.width);
70
+ pointHeight = Math.round(rootElement.frame.height);
71
+ // The frame.y of the root element indicates where content starts (after status bar)
72
+ if (rootElement.frame.y > 0) {
73
+ safeAreaTop = Math.round(rootElement.frame.y);
74
+ }
75
+ }
76
+ else if (rootElement.AXFrame) {
77
+ // Parse format: "{{x, y}, {width, height}}"
78
+ const match = rootElement.AXFrame.match(/\{\{([\d.]+),\s*([\d.]+)\},\s*\{([\d.]+),\s*([\d.]+)\}\}/);
79
+ if (match) {
80
+ const frameY = parseFloat(match[2]);
81
+ pointWidth = Math.round(parseFloat(match[3]));
82
+ pointHeight = Math.round(parseFloat(match[4]));
83
+ if (frameY > 0) {
84
+ safeAreaTop = Math.round(frameY);
85
+ }
86
+ }
87
+ }
88
+ // Calculate actual scale factor
89
+ if (pointWidth > 0) {
90
+ scaleFactor = Math.round(pixelWidth / pointWidth);
91
+ }
92
+ }
93
+ }
94
+ catch {
95
+ // Fallback: use 3x scale for modern devices
96
+ }
97
+ // Fallback if we couldn't get dimensions
98
+ if (pointWidth === 0) {
99
+ pointWidth = Math.round(pixelWidth / scaleFactor);
100
+ pointHeight = Math.round(pixelHeight / scaleFactor);
101
+ }
102
+ const safeAreaOffsetPixels = safeAreaTop * scaleFactor;
103
+ // The Screen Layout tree was previously appended here but produced huge noisy
104
+ // output (nested Svg/G/Path duplicates). Agents should use get_screen_layout
105
+ // explicitly when they need the tree. The Pressable elements block below is
106
+ // the signal most consumers actually want.
107
+ let pressablesText = null;
108
+ // Enrich with pressable elements. With targetApp present we use the
109
+ // fiber path (most accurate). Without targetApp, getPressableElements
110
+ // falls back to iOS accessibility tree (E1) when we pass platform.
111
+ try {
112
+ const pressables = await getPressableElements({
113
+ device: targetDeviceName,
114
+ platform: "ios",
115
+ udid: resolvedUdid ?? undefined
116
+ });
117
+ if (pressables.success && pressables.parsedElements && pressables.parsedElements.length > 0) {
118
+ const screenshotScale = result.scaleFactor || 1;
119
+ pressablesText = pressables.parsedElements.map((el) => {
120
+ // See enrichScreenshotWithLayout: shift y when fiber reports the element
121
+ // inside the safe-area band (a react-native-screens modal artifact).
122
+ let centerYPoints = el.center.y;
123
+ if (safeAreaTop > 0 && centerYPoints < safeAreaTop) {
124
+ centerYPoints += safeAreaTop;
125
+ }
126
+ const px = Math.round((el.center.x * scaleFactor) / screenshotScale);
127
+ const py = Math.round((centerYPoints * scaleFactor) / screenshotScale);
128
+ const label = el.accessibilityLabel || el.text || el.testID || (el.intent ? `${el.intent} icon` : el.component);
129
+ const idPart = el.testID ? ` testID="${el.testID}"` : "";
130
+ const kindPart = el.isInput ? " [input]" : "";
131
+ const wrapPart = el.isWrapper ? " [wrapper — skip]" : "";
132
+ const nearPart = !el.text && !el.accessibilityLabel && el.nearbyText ? ` near "${el.nearbyText}"` : "";
133
+ return ` (${px}, ${py}) ${el.component}: "${label}"${nearPart}${idPart}${kindPart}${wrapPart}`;
134
+ }).join("\n");
135
+ }
136
+ }
137
+ catch {
138
+ // Non-fatal: screenshot works without pressables enrichment
139
+ }
140
+ let infoText = `Screenshot captured (${pixelWidth}x${pixelHeight} pixels)`;
141
+ infoText += `\n📱 iOS screen: ${pointWidth}x${pointHeight} points (${scaleFactor}x scale)`;
142
+ infoText += `\n📐 tap() handles pixel-to-point conversion automatically — pass pixel coords from this image directly`;
143
+ infoText += `\n⚠️ Status bar + safe area: ${safeAreaTop} points (${safeAreaOffsetPixels} pixels) from top`;
144
+ if (result.scaleFactor && result.scaleFactor > 1) {
145
+ infoText += `\n🖼️ Image was scaled down to fit API limits (scale: ${result.scaleFactor.toFixed(3)})`;
146
+ }
147
+ if (pressablesText) {
148
+ infoText += `\n\n🎯 Pressable elements (ready-to-tap, coordinates in screenshot pixels):`;
149
+ infoText += `\n${pressablesText}`;
150
+ infoText += `\n\n💡 Next steps:`;
151
+ infoText += `\n • tap(text="Button Label") — when text is exact and unique`;
152
+ infoText += `\n • tap(testID="id") or tap(component="Name") — when you know the identifier`;
153
+ infoText += `\n • tap(x=<px>, y=<px>) — use coordinates from the pressable elements list above (reliable for icons and ambiguous elements)`;
154
+ infoText += `\n • get_screen_layout — full component tree when you need more than pressables`;
155
+ }
156
+ else {
157
+ if (!targetApp && connectedApps.size > 0) {
158
+ infoText += `\n\nℹ️ Pressable enrichment skipped: no RN app is connected to simulator ${resolvedUdid}.`;
159
+ infoText += ` ${connectedApps.size} other app(s) are connected on different device(s) — their fiber data was intentionally not used to avoid mismatched output.`;
160
+ }
161
+ infoText += `\n\n💡 Next steps:`;
162
+ infoText += `\n • tap(text="Button Label") — tap element by visible text`;
163
+ infoText += `\n • tap(x=<px>, y=<px>) — tap at coordinates from this screenshot`;
164
+ infoText += `\n • get_screen_layout — get full UI tree with real on-screen positions`;
165
+ }
166
+ // Check for LogBox overlay — only on the matching RN app; skip otherwise
167
+ // to avoid surfacing warnings from a different simulator's app.
168
+ if (targetApp) {
169
+ try {
170
+ const logBoxState = await detectLogBox(targetDeviceName);
171
+ if (logBoxState && logBoxState.total > 0) {
172
+ infoText += formatLogBoxWarning(logBoxState);
173
+ }
174
+ }
175
+ catch {
176
+ // Non-fatal: LogBox detection failure should not break screenshot
177
+ }
178
+ }
179
+ // I1 (2026-05-16): detect native iOS system overlays (auth sheets, alerts,
180
+ // permission dialogs) that sit on top of the RN app. The pressables list
181
+ // reflects the RN screen underneath; without this warning the agent will
182
+ // happily tap inert RN buttons and loop. Runs whether or not there's a
183
+ // matching RN app — the overlay belongs to the simulator, not the app.
184
+ try {
185
+ const overlay = await detectIOSSystemOverlay(resolvedUdid ?? undefined);
186
+ if (overlay) {
187
+ infoText += formatIOSSystemOverlayWarning(overlay);
188
+ }
189
+ }
190
+ catch {
191
+ // Non-fatal: overlay detection failure should not break screenshot
192
+ }
193
+ imageBuffer.add({
194
+ id: `ios-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
195
+ image: result.data,
196
+ timestamp: Date.now(),
197
+ source: "ios_screenshot",
198
+ metadata: {
199
+ width: result.originalWidth || 0,
200
+ height: result.originalHeight || 0,
201
+ scaleFactor: result.scaleFactor || 1,
202
+ platform: "ios",
203
+ },
204
+ });
205
+ return {
206
+ content: [
207
+ {
208
+ type: "text",
209
+ text: infoText
210
+ },
211
+ {
212
+ type: "image",
213
+ data: result.data.toString("base64"),
214
+ mimeType: "image/jpeg"
215
+ }
216
+ ]
217
+ };
218
+ }
219
+ return {
220
+ content: [
221
+ {
222
+ type: "text",
223
+ text: `Screenshot saved to: ${result.result}`
224
+ }
225
+ ]
226
+ };
227
+ });
228
+ // Tool: Android screenshot
229
+ registerToolWithTelemetry(server, "android_screenshot", {
230
+ description: "Take a screenshot from an Android device/emulator. Returns the image plus two lists: (1) pressable elements — the tappable components on screen with ready-to-use pixel tap coordinates, testIDs, and labels; (2) screen layout — all visible React components for context. Prefer tap(text=\"...\") when text is exact and unique; otherwise use tap(x, y) with coordinates from the pressables list — this is the most reliable way to tap icons or visually-identified elements. Use component names from the layout for inspect_component/find_components.\n" +
231
+ "PURPOSE: Snapshot what the user sees on Android AND get tap-ready pressables + a structured component map in one call.\n" +
232
+ "WHEN TO USE: Any visual verification, before/after comparison, or as the starting point for tapping UI by coordinates on Android.\n" +
233
+ "WORKFLOW: android_screenshot -> pick element from pressables -> tap(x, y) or tap(testID=...) -> android_screenshot to verify.\n" +
234
+ "LIMITATIONS: Requires adb in PATH and a running device/emulator. For non-RN surfaces (system dialogs, permission prompts), combine with tap(..., native=true).\n" +
235
+ "GOOD: android_screenshot()\n" +
236
+ "BAD: android_screenshot({ deviceId: \"guess\" }) with a made-up serial — run list_android_devices first.\n" +
237
+ "SEE ALSO: call get_usage_guide(topic=\"interact\") for the full device-interaction playbook.",
238
+ inputSchema: {
239
+ outputPath: z
240
+ .string()
241
+ .optional()
242
+ .describe("Optional path to save the screenshot. If not provided, saves to temp directory."),
243
+ deviceId: z
244
+ .string()
245
+ .optional()
246
+ .describe("Optional device ID (from list_android_devices). Uses first available device if not specified.")
247
+ }
248
+ }, async ({ outputPath, deviceId }) => {
249
+ const result = await androidScreenshot(outputPath, deviceId);
250
+ if (!result.success) {
251
+ return {
252
+ content: [
253
+ {
254
+ type: "text",
255
+ text: `Error: ${result.error}`
256
+ }
257
+ ],
258
+ isError: true
259
+ };
260
+ }
261
+ // Include image data if available
262
+ if (result.data) {
263
+ // Build info text with coordinate conversion guidance
264
+ const pixelWidth = result.originalWidth || 0;
265
+ const pixelHeight = result.originalHeight || 0;
266
+ // Resolve the RN app running on THIS Android device so enrichment
267
+ // pulls data from the right app (not whichever app is "first").
268
+ const targetApp = getConnectedAppByAndroidDeviceId(deviceId);
269
+ const targetDeviceName = targetApp?.deviceInfo.deviceName;
270
+ // Store screenshot metadata on the matching app (not an arbitrary one)
271
+ if (targetApp) {
272
+ targetApp.lastScreenshot = {
273
+ originalWidth: pixelWidth,
274
+ originalHeight: pixelHeight,
275
+ scaleFactor: result.scaleFactor || 1,
276
+ };
277
+ }
278
+ let infoText = `Screenshot captured (${pixelWidth}x${pixelHeight} pixels)`;
279
+ // Get status bar height for coordinate guidance
280
+ let statusBarPixels = 63; // Default fallback
281
+ let statusBarDp = 24;
282
+ let densityDpi = 440; // Common default
283
+ try {
284
+ const statusBarResult = await androidGetStatusBarHeight(deviceId);
285
+ if (statusBarResult.success && statusBarResult.heightPixels) {
286
+ statusBarPixels = statusBarResult.heightPixels;
287
+ statusBarDp = statusBarResult.heightDp || 24;
288
+ }
289
+ const densityResult = await androidGetDensity(deviceId);
290
+ if (densityResult.success && densityResult.density) {
291
+ densityDpi = densityResult.density;
292
+ }
293
+ }
294
+ catch {
295
+ // Use defaults
296
+ }
297
+ // Enrich with screen layout data (component names + tap coordinates).
298
+ // On Bridgeless/Fabric Android (the only target architecture we support;
299
+ // legacy arch is <5% of users and not a priority), both code paths that
300
+ // feed this enrichment return DEVICE PIXELS:
301
+ // - fiber path: React's measureInWindow on Fabric returns native pixels.
302
+ // - a11y fallback: uiautomator's bounds are already device pixels.
303
+ // The earlier formula multiplied by densityDpi/160 on the (incorrect)
304
+ // assumption that fiber returned DP — inflating every coordinate by
305
+ // ~2.6× on a 420dpi emulator and producing numbers like (1170, 4054)
306
+ // for a button visually sitting near (445, 1370) in the JPEG. Drop the
307
+ // density factor; only the scaleFactor downscale is needed.
308
+ let pressablesText = null;
309
+ // Screen Layout tree previously appended here was dropped — it was noisy
310
+ // (nested Svg/G/Path duplicates). Use get_screen_layout when the tree is needed.
311
+ // Enrich with pressable elements. With targetApp present we use the
312
+ // fiber path (most accurate). Without targetApp, getPressableElements
313
+ // falls back to the Android accessibility (uiautomator) tree (E1).
314
+ try {
315
+ const pressables = await getPressableElements({ device: targetDeviceName, platform: "android" });
316
+ if (pressables.success && pressables.parsedElements && pressables.parsedElements.length > 0) {
317
+ const screenshotScale = result.scaleFactor || 1;
318
+ pressablesText = pressables.parsedElements.map((el) => {
319
+ const px = Math.round(el.center.x / screenshotScale);
320
+ const py = Math.round(el.center.y / screenshotScale);
321
+ const label = el.accessibilityLabel || el.text || el.testID || (el.intent ? `${el.intent} icon` : el.component);
322
+ const idPart = el.testID ? ` testID="${el.testID}"` : "";
323
+ const kindPart = el.isInput ? " [input]" : "";
324
+ const wrapPart = el.isWrapper ? " [wrapper — skip]" : "";
325
+ const nearPart = !el.text && !el.accessibilityLabel && el.nearbyText ? ` near "${el.nearbyText}"` : "";
326
+ return ` (${px}, ${py}) ${el.component}: "${label}"${nearPart}${idPart}${kindPart}${wrapPart}`;
327
+ }).join("\n");
328
+ }
329
+ }
330
+ catch {
331
+ // Non-fatal: screenshot works without pressables enrichment
332
+ }
333
+ infoText += `\n📱 Android uses PIXELS for all coordinates`;
334
+ if (result.scaleFactor && result.scaleFactor > 1) {
335
+ infoText += `\n🖼️ Image was scaled down to fit API limits (scale: ${result.scaleFactor.toFixed(3)})`;
336
+ infoText += `\n📐 tap() handles coordinate conversion automatically — pass pixel coords from this image directly`;
337
+ }
338
+ else {
339
+ infoText += `\n📐 Screenshot coords = tap coords (no conversion needed)`;
340
+ }
341
+ infoText += `\n⚠️ Status bar: ${statusBarPixels}px (${statusBarDp}dp) from top - app content starts below this`;
342
+ infoText += `\n📊 Display density: ${densityDpi}dpi`;
343
+ if (pressablesText) {
344
+ infoText += `\n\n🎯 Pressable elements (ready-to-tap, coordinates in screenshot pixels):`;
345
+ infoText += `\n${pressablesText}`;
346
+ infoText += `\n\n💡 Next steps:`;
347
+ infoText += `\n • tap(text="Button Label") — when text is exact and unique`;
348
+ infoText += `\n • tap(testID="id") or tap(component="Name") — when you know the identifier`;
349
+ infoText += `\n • tap(x=<px>, y=<px>) — use coordinates from the pressable elements list above (reliable for icons and ambiguous elements)`;
350
+ infoText += `\n • get_screen_layout — full component tree when you need more than pressables`;
351
+ }
352
+ else {
353
+ if (!targetApp && connectedApps.size > 0) {
354
+ infoText += `\n\nℹ️ Pressable enrichment skipped: no RN app is connected to device ${deviceId ?? "(default)"}.`;
355
+ infoText += ` ${connectedApps.size} other app(s) are connected on different device(s) — their fiber data was intentionally not used to avoid mismatched output.`;
356
+ }
357
+ infoText += `\n\n💡 Next steps:`;
358
+ infoText += `\n • tap(text="Button Label") — tap element by visible text`;
359
+ infoText += `\n • tap(x=<px>, y=<px>) — tap at coordinates from this screenshot`;
360
+ infoText += `\n • get_screen_layout — get full UI tree with real on-screen positions`;
361
+ }
362
+ // Check for LogBox overlay — only on the matching RN app; skip otherwise
363
+ // to avoid surfacing warnings from a different device's app.
364
+ if (targetApp) {
365
+ try {
366
+ const logBoxState = await detectLogBox(targetDeviceName);
367
+ if (logBoxState && logBoxState.total > 0) {
368
+ infoText += formatLogBoxWarning(logBoxState);
369
+ }
370
+ }
371
+ catch {
372
+ // Non-fatal: LogBox detection failure should not break screenshot
373
+ }
374
+ }
375
+ imageBuffer.add({
376
+ id: `android-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
377
+ image: result.data,
378
+ timestamp: Date.now(),
379
+ source: "android_screenshot",
380
+ metadata: {
381
+ width: result.originalWidth || 0,
382
+ height: result.originalHeight || 0,
383
+ scaleFactor: result.scaleFactor || 1,
384
+ platform: "android",
385
+ },
386
+ });
387
+ return {
388
+ content: [
389
+ {
390
+ type: "text",
391
+ text: infoText
392
+ },
393
+ {
394
+ type: "image",
395
+ data: result.data.toString("base64"),
396
+ mimeType: "image/jpeg"
397
+ }
398
+ ]
399
+ };
400
+ }
401
+ return {
402
+ content: [
403
+ {
404
+ type: "text",
405
+ text: `Screenshot saved to: ${result.result}`
406
+ }
407
+ ]
408
+ };
409
+ });
410
+ // Tool: Get images from shared image buffer
411
+ registerToolWithTelemetry(server, "get_images", {
412
+ description: "Access the shared image buffer containing screenshots from all tools (ios_screenshot, android_screenshot, ocr_screenshot, tap verification). Returns metadata only by default — use id or groupId+frameIndex to retrieve actual image data. Tap burst verification stores frame groups here when burst=true is used.\n" +
413
+ "PURPOSE: Retrieve prior screenshots — especially tap burst frames — without re-taking them, for visual diffing or reviewing transient UI states.\n" +
414
+ "WHEN TO USE: After tap(burst=true) reports transientChangeDetected, or to compare before/after frames without another screenshot round-trip.\n" +
415
+ "WORKFLOW: tap(burst=true) -> note verification.burstGroupId -> get_images(groupId, frameIndex=N) to inspect individual frames.\n" +
416
+ "LIMITATIONS: Circular buffer (50 entries) — old images are evicted. Metadata is cheap; fetching image data is not — request specific ids, not bulk.\n" +
417
+ "GOOD: get_images({ list: true }); get_images({ groupId: \"burst-abc\", frameIndex: 2 })\n" +
418
+ "BAD: get_images() with no filter when buffer is full — floods context. Use list:true or last:N first.\n" +
419
+ "SEE ALSO: call get_usage_guide(topic=\"interact\") for the full interaction playbook.",
420
+ inputSchema: {
421
+ list: z.boolean().optional().describe("List all entries and groups (metadata only, no image data)"),
422
+ id: z.string().optional().describe("Retrieve a specific image by ID (returns image data)"),
423
+ groupId: z.string().optional().describe("List frames in a group (metadata only), or combine with frameIndex to retrieve a specific frame"),
424
+ frameIndex: z.coerce.number().optional().describe("Retrieve a specific frame from a group (requires groupId)"),
425
+ last: z.coerce.number().optional().describe("Return the N most recent entries (metadata only)"),
426
+ source: z.string().optional().describe("Filter entries by source"),
427
+ clear: z.boolean().optional().describe("Clear the buffer")
428
+ }
429
+ }, async ({ id, groupId, frameIndex, last, source, clear }) => {
430
+ if (clear) {
431
+ const count = imageBuffer.clear();
432
+ return {
433
+ content: [{ type: "text", text: `Cleared ${count} images from buffer.` }]
434
+ };
435
+ }
436
+ if (id) {
437
+ const entry = imageBuffer.getById(id);
438
+ if (!entry) {
439
+ return {
440
+ content: [{ type: "text", text: `No image found with id "${id}".` }],
441
+ isError: true
442
+ };
443
+ }
444
+ const { image, ...meta } = entry;
445
+ return {
446
+ content: [
447
+ { type: "text", text: JSON.stringify(meta, null, 2) },
448
+ { type: "image", data: image.toString("base64"), mimeType: "image/png" }
449
+ ]
450
+ };
451
+ }
452
+ if (groupId !== undefined && frameIndex !== undefined) {
453
+ const entry = imageBuffer.getByGroupFrame(groupId, frameIndex);
454
+ if (!entry) {
455
+ return {
456
+ content: [{ type: "text", text: `No frame ${frameIndex} found in group "${groupId}".` }],
457
+ isError: true
458
+ };
459
+ }
460
+ const { image, ...meta } = entry;
461
+ return {
462
+ content: [
463
+ { type: "text", text: JSON.stringify(meta, null, 2) },
464
+ { type: "image", data: image.toString("base64"), mimeType: "image/png" }
465
+ ]
466
+ };
467
+ }
468
+ const entries = imageBuffer.listEntries({ source, groupId, last });
469
+ const groups = imageBuffer.listGroups();
470
+ return {
471
+ content: [
472
+ {
473
+ type: "text",
474
+ text: JSON.stringify({ entries, groups, total: imageBuffer.size }, null, 2)
475
+ }
476
+ ]
477
+ };
478
+ });
479
+ // Tool: OCR Screenshot - Extract text with coordinates from screenshot
480
+ registerToolWithTelemetry(server, "ocr_screenshot", {
481
+ description: "RECOMMENDED: Use this tool FIRST when you need to find and tap UI elements. Takes a screenshot and extracts all visible text with tap-ready coordinates using OCR. " +
482
+ "ADVANTAGES over accessibility trees: (1) Works on ANY visible text regardless of accessibility labels, (2) Returns ready-to-use tapX/tapY coordinates - no conversion needed, (3) Faster than parsing accessibility hierarchies, (4) Works consistently across iOS and Android. " +
483
+ "USE THIS FOR: Finding buttons, labels, menu items, tab bars, or any text you need to tap. Simply find the text in the results and use its tapX/tapY with the tap command.\n" +
484
+ "PURPOSE: Visually locate text on screen and return coordinates safe to pass straight into tap.\n" +
485
+ "WHEN TO USE: Non-RN surfaces, third-party WebViews, accessibility-poor screens, or when fiber/testID strategies have failed.\n" +
486
+ "WORKFLOW: ocr_screenshot(platform=\"ios\") -> scan results for the label -> tap(x=tapX, y=tapY) -> ios_screenshot to verify.\n" +
487
+ "LIMITATIONS: OCR accuracy degrades on very small or stylized text; icons with no label won't appear — use tap(component=...) instead.\n" +
488
+ "GOOD: ocr_screenshot({ platform: \"ios\" })\n" +
489
+ "BAD: ocr_screenshot used just to view the screen — plain ios_screenshot / android_screenshot is cheaper when you don't need OCR text.\n" +
490
+ "SEE ALSO: call get_usage_guide(topic=\"interact\") for the full device-interaction playbook.",
491
+ inputSchema: {
492
+ platform: z.enum(["ios", "android"]).describe("Platform to capture screenshot from"),
493
+ deviceId: z
494
+ .string()
495
+ .optional()
496
+ .describe("Optional device ID (Android) or UDID (iOS). Uses first available device if not specified.")
497
+ }
498
+ }, async ({ platform, deviceId }) => {
499
+ try {
500
+ // Take screenshot
501
+ const screenshotResult = platform === "android"
502
+ ? await androidScreenshot(undefined, deviceId)
503
+ : await iosScreenshot(undefined, deviceId);
504
+ if (!screenshotResult.success || !screenshotResult.data) {
505
+ return {
506
+ content: [
507
+ {
508
+ type: "text",
509
+ text: `Screenshot failed: ${screenshotResult.error || "No image data"}`
510
+ }
511
+ ],
512
+ isError: true
513
+ };
514
+ }
515
+ // Calculate device pixel ratio for iOS
516
+ const devicePixelRatio = platform === "ios" && screenshotResult.originalWidth && screenshotResult.originalHeight
517
+ ? inferIOSDevicePixelRatio(screenshotResult.originalWidth, screenshotResult.originalHeight)
518
+ : 1;
519
+ // Run OCR on the screenshot
520
+ const scaleFactor = screenshotResult.scaleFactor || 1;
521
+ const ocrResult = await recognizeText(screenshotResult.data, {
522
+ scaleFactor,
523
+ platform,
524
+ devicePixelRatio
525
+ });
526
+ if (!ocrResult.success) {
527
+ return {
528
+ content: [
529
+ {
530
+ type: "text",
531
+ text: `OCR failed: no text recognized`
532
+ }
533
+ ],
534
+ isError: true
535
+ };
536
+ }
537
+ // Format results for MCP tool output
538
+ const elements = ocrResult.words
539
+ .filter((w) => w.confidence > 50 && w.text.trim().length > 0)
540
+ .map((w) => ({
541
+ text: w.text,
542
+ confidence: Math.round(w.confidence),
543
+ tapX: w.tapCenter.x,
544
+ tapY: w.tapCenter.y
545
+ }));
546
+ const result = {
547
+ platform,
548
+ engine: ocrResult.engine || "unknown",
549
+ processingTimeMs: ocrResult.processingTimeMs,
550
+ fullText: ocrResult.fullText?.trim() || "",
551
+ confidence: Math.round(ocrResult.confidence || 0),
552
+ elementCount: elements.length,
553
+ elements,
554
+ note: "tapX/tapY are in device pixels — pass directly to tap(x, y) for automatic platform conversion"
555
+ };
556
+ // Check for LogBox overlay (uses default CDP device — native deviceId cannot be mapped to CDP device name)
557
+ try {
558
+ const logBoxState = await detectLogBox();
559
+ if (logBoxState && logBoxState.total > 0) {
560
+ result.logBoxWarning = formatLogBoxWarning(logBoxState).trim();
561
+ }
562
+ }
563
+ catch {
564
+ // Non-fatal: LogBox detection failure should not break OCR
565
+ }
566
+ // Store screenshot in image buffer
567
+ try {
568
+ imageBuffer.add({
569
+ id: `ocr-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
570
+ image: screenshotResult.data,
571
+ timestamp: Date.now(),
572
+ source: "ocr_screenshot",
573
+ metadata: {
574
+ width: screenshotResult.originalWidth || 0,
575
+ height: screenshotResult.originalHeight || 0,
576
+ scaleFactor,
577
+ platform,
578
+ },
579
+ });
580
+ }
581
+ catch {
582
+ // Non-fatal: image buffer write failure should not break OCR response
583
+ }
584
+ return {
585
+ content: [
586
+ {
587
+ type: "text",
588
+ text: JSON.stringify(result, null, 2)
589
+ }
590
+ ]
591
+ };
592
+ }
593
+ catch (error) {
594
+ return {
595
+ content: [
596
+ {
597
+ type: "text",
598
+ text: `OCR failed: ${error instanceof Error ? error.message : String(error)}`
599
+ }
600
+ ],
601
+ isError: true
602
+ };
603
+ }
604
+ });
605
+ }
606
+ //# sourceMappingURL=screenshotTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshotTools.js","sourceRoot":"","sources":["../../src/tools/screenshotTools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACH,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,mB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C1E,CAAC;YAED,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACxC;iBACJ;aACJ,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE;oBACL;wBACI,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,eAAe,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAChF;iBACJ;gBACD,OAAO,EAAE,IAAI;aAChB,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ai-debugger",
3
- "version": "1.6.16",
3
+ "version": "1.8.1",
4
4
  "description": "ExecBro — MCP server giving AI agents eyes and hands into React Native apps. Logs, REPL, state inspection, tap, screenshot.",
5
5
  "type": "module",
6
6
  "main": "build/index.js",