execbro 0.0.1-reserve → 1.10.13

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 (475) hide show
  1. package/LICENSE +32 -0
  2. package/README.md +496 -0
  3. package/build/__tests__/helpers/fake-cdp-server.d.ts +56 -0
  4. package/build/__tests__/helpers/fake-cdp-server.d.ts.map +1 -0
  5. package/build/__tests__/helpers/fake-cdp-server.js +120 -0
  6. package/build/__tests__/helpers/fake-cdp-server.js.map +1 -0
  7. package/build/__tests__/helpers/tap-test-helpers.d.ts +36 -0
  8. package/build/__tests__/helpers/tap-test-helpers.d.ts.map +1 -0
  9. package/build/__tests__/helpers/tap-test-helpers.js +130 -0
  10. package/build/__tests__/helpers/tap-test-helpers.js.map +1 -0
  11. package/build/__tests__/integration/auto-reconnect.test.d.ts +2 -0
  12. package/build/__tests__/integration/auto-reconnect.test.d.ts.map +1 -0
  13. package/build/__tests__/integration/auto-reconnect.test.js +118 -0
  14. package/build/__tests__/integration/auto-reconnect.test.js.map +1 -0
  15. package/build/__tests__/integration/connection-health.test.d.ts +2 -0
  16. package/build/__tests__/integration/connection-health.test.d.ts.map +1 -0
  17. package/build/__tests__/integration/connection-health.test.js +157 -0
  18. package/build/__tests__/integration/connection-health.test.js.map +1 -0
  19. package/build/__tests__/integration/execute-in-app.test.d.ts +2 -0
  20. package/build/__tests__/integration/execute-in-app.test.d.ts.map +1 -0
  21. package/build/__tests__/integration/execute-in-app.test.js +124 -0
  22. package/build/__tests__/integration/execute-in-app.test.js.map +1 -0
  23. package/build/__tests__/integration/per-call-timeout.test.d.ts +2 -0
  24. package/build/__tests__/integration/per-call-timeout.test.d.ts.map +1 -0
  25. package/build/__tests__/integration/per-call-timeout.test.js +103 -0
  26. package/build/__tests__/integration/per-call-timeout.test.js.map +1 -0
  27. package/build/__tests__/integration/tap-strategies.test.d.ts +2 -0
  28. package/build/__tests__/integration/tap-strategies.test.d.ts.map +1 -0
  29. package/build/__tests__/integration/tap-strategies.test.js +330 -0
  30. package/build/__tests__/integration/tap-strategies.test.js.map +1 -0
  31. package/build/__tests__/integration/tools.test.d.ts +2 -0
  32. package/build/__tests__/integration/tools.test.d.ts.map +1 -0
  33. package/build/__tests__/integration/tools.test.js +227 -0
  34. package/build/__tests__/integration/tools.test.js.map +1 -0
  35. package/build/__tests__/setup.d.ts +2 -0
  36. package/build/__tests__/setup.d.ts.map +1 -0
  37. package/build/__tests__/setup.js +15 -0
  38. package/build/__tests__/setup.js.map +1 -0
  39. package/build/__tests__/unit/androidEmulatorAvds.test.d.ts +2 -0
  40. package/build/__tests__/unit/androidEmulatorAvds.test.d.ts.map +1 -0
  41. package/build/__tests__/unit/androidEmulatorAvds.test.js +98 -0
  42. package/build/__tests__/unit/androidEmulatorAvds.test.js.map +1 -0
  43. package/build/__tests__/unit/buildToken.test.d.ts +2 -0
  44. package/build/__tests__/unit/buildToken.test.d.ts.map +1 -0
  45. package/build/__tests__/unit/buildToken.test.js +22 -0
  46. package/build/__tests__/unit/buildToken.test.js.map +1 -0
  47. package/build/__tests__/unit/bundle.test.d.ts +2 -0
  48. package/build/__tests__/unit/bundle.test.d.ts.map +1 -0
  49. package/build/__tests__/unit/bundle.test.js +53 -0
  50. package/build/__tests__/unit/bundle.test.js.map +1 -0
  51. package/build/__tests__/unit/burst.test.d.ts +2 -0
  52. package/build/__tests__/unit/burst.test.d.ts.map +1 -0
  53. package/build/__tests__/unit/burst.test.js +54 -0
  54. package/build/__tests__/unit/burst.test.js.map +1 -0
  55. package/build/__tests__/unit/connection-health.test.d.ts +2 -0
  56. package/build/__tests__/unit/connection-health.test.d.ts.map +1 -0
  57. package/build/__tests__/unit/connection-health.test.js +38 -0
  58. package/build/__tests__/unit/connection-health.test.js.map +1 -0
  59. package/build/__tests__/unit/debugGlobals.test.d.ts +2 -0
  60. package/build/__tests__/unit/debugGlobals.test.d.ts.map +1 -0
  61. package/build/__tests__/unit/debugGlobals.test.js +14 -0
  62. package/build/__tests__/unit/debugGlobals.test.js.map +1 -0
  63. package/build/__tests__/unit/deviceDiscovery.test.d.ts +2 -0
  64. package/build/__tests__/unit/deviceDiscovery.test.d.ts.map +1 -0
  65. package/build/__tests__/unit/deviceDiscovery.test.js +119 -0
  66. package/build/__tests__/unit/deviceDiscovery.test.js.map +1 -0
  67. package/build/__tests__/unit/deviceResolver.test.d.ts +2 -0
  68. package/build/__tests__/unit/deviceResolver.test.d.ts.map +1 -0
  69. package/build/__tests__/unit/deviceResolver.test.js +261 -0
  70. package/build/__tests__/unit/deviceResolver.test.js.map +1 -0
  71. package/build/__tests__/unit/escapeNonAscii.test.d.ts +2 -0
  72. package/build/__tests__/unit/escapeNonAscii.test.d.ts.map +1 -0
  73. package/build/__tests__/unit/escapeNonAscii.test.js +76 -0
  74. package/build/__tests__/unit/escapeNonAscii.test.js.map +1 -0
  75. package/build/__tests__/unit/exec.test.d.ts +2 -0
  76. package/build/__tests__/unit/exec.test.d.ts.map +1 -0
  77. package/build/__tests__/unit/exec.test.js +54 -0
  78. package/build/__tests__/unit/exec.test.js.map +1 -0
  79. package/build/__tests__/unit/executor.test.d.ts +2 -0
  80. package/build/__tests__/unit/executor.test.d.ts.map +1 -0
  81. package/build/__tests__/unit/executor.test.js +220 -0
  82. package/build/__tests__/unit/executor.test.js.map +1 -0
  83. package/build/__tests__/unit/failureArtifact.test.d.ts +2 -0
  84. package/build/__tests__/unit/failureArtifact.test.d.ts.map +1 -0
  85. package/build/__tests__/unit/failureArtifact.test.js +207 -0
  86. package/build/__tests__/unit/failureArtifact.test.js.map +1 -0
  87. package/build/__tests__/unit/fastRefreshRecorder.test.d.ts +2 -0
  88. package/build/__tests__/unit/fastRefreshRecorder.test.d.ts.map +1 -0
  89. package/build/__tests__/unit/fastRefreshRecorder.test.js +68 -0
  90. package/build/__tests__/unit/fastRefreshRecorder.test.js.map +1 -0
  91. package/build/__tests__/unit/fastRefreshTools.test.d.ts +2 -0
  92. package/build/__tests__/unit/fastRefreshTools.test.d.ts.map +1 -0
  93. package/build/__tests__/unit/fastRefreshTools.test.js +112 -0
  94. package/build/__tests__/unit/fastRefreshTools.test.js.map +1 -0
  95. package/build/__tests__/unit/fiberMatch.test.d.ts +2 -0
  96. package/build/__tests__/unit/fiberMatch.test.d.ts.map +1 -0
  97. package/build/__tests__/unit/fiberMatch.test.js +114 -0
  98. package/build/__tests__/unit/fiberMatch.test.js.map +1 -0
  99. package/build/__tests__/unit/fingerprint.test.d.ts +2 -0
  100. package/build/__tests__/unit/fingerprint.test.d.ts.map +1 -0
  101. package/build/__tests__/unit/fingerprint.test.js +99 -0
  102. package/build/__tests__/unit/fingerprint.test.js.map +1 -0
  103. package/build/__tests__/unit/focusedInput.test.d.ts +2 -0
  104. package/build/__tests__/unit/focusedInput.test.d.ts.map +1 -0
  105. package/build/__tests__/unit/focusedInput.test.js +58 -0
  106. package/build/__tests__/unit/focusedInput.test.js.map +1 -0
  107. package/build/__tests__/unit/focusedInputTools.test.d.ts +2 -0
  108. package/build/__tests__/unit/focusedInputTools.test.d.ts.map +1 -0
  109. package/build/__tests__/unit/focusedInputTools.test.js +79 -0
  110. package/build/__tests__/unit/focusedInputTools.test.js.map +1 -0
  111. package/build/__tests__/unit/iconSemantics.test.d.ts +2 -0
  112. package/build/__tests__/unit/iconSemantics.test.d.ts.map +1 -0
  113. package/build/__tests__/unit/iconSemantics.test.js +80 -0
  114. package/build/__tests__/unit/iconSemantics.test.js.map +1 -0
  115. package/build/__tests__/unit/imageBuffer.test.d.ts +2 -0
  116. package/build/__tests__/unit/imageBuffer.test.d.ts.map +1 -0
  117. package/build/__tests__/unit/imageBuffer.test.js +128 -0
  118. package/build/__tests__/unit/imageBuffer.test.js.map +1 -0
  119. package/build/__tests__/unit/logs.test.d.ts +2 -0
  120. package/build/__tests__/unit/logs.test.d.ts.map +1 -0
  121. package/build/__tests__/unit/logs.test.js +90 -0
  122. package/build/__tests__/unit/logs.test.js.map +1 -0
  123. package/build/__tests__/unit/measureComponent.test.d.ts +2 -0
  124. package/build/__tests__/unit/measureComponent.test.d.ts.map +1 -0
  125. package/build/__tests__/unit/measureComponent.test.js +66 -0
  126. package/build/__tests__/unit/measureComponent.test.js.map +1 -0
  127. package/build/__tests__/unit/measureComponentTools.test.d.ts +2 -0
  128. package/build/__tests__/unit/measureComponentTools.test.d.ts.map +1 -0
  129. package/build/__tests__/unit/measureComponentTools.test.js +94 -0
  130. package/build/__tests__/unit/measureComponentTools.test.js.map +1 -0
  131. package/build/__tests__/unit/metro.test.d.ts +2 -0
  132. package/build/__tests__/unit/metro.test.d.ts.map +1 -0
  133. package/build/__tests__/unit/metro.test.js +61 -0
  134. package/build/__tests__/unit/metro.test.js.map +1 -0
  135. package/build/__tests__/unit/network.test.d.ts +2 -0
  136. package/build/__tests__/unit/network.test.d.ts.map +1 -0
  137. package/build/__tests__/unit/network.test.js +102 -0
  138. package/build/__tests__/unit/network.test.js.map +1 -0
  139. package/build/__tests__/unit/networkInterceptor.test.d.ts +2 -0
  140. package/build/__tests__/unit/networkInterceptor.test.d.ts.map +1 -0
  141. package/build/__tests__/unit/networkInterceptor.test.js +104 -0
  142. package/build/__tests__/unit/networkInterceptor.test.js.map +1 -0
  143. package/build/__tests__/unit/probe.test.d.ts +2 -0
  144. package/build/__tests__/unit/probe.test.d.ts.map +1 -0
  145. package/build/__tests__/unit/probe.test.js +62 -0
  146. package/build/__tests__/unit/probe.test.js.map +1 -0
  147. package/build/__tests__/unit/rnGlobalsBootstrap.test.d.ts +2 -0
  148. package/build/__tests__/unit/rnGlobalsBootstrap.test.d.ts.map +1 -0
  149. package/build/__tests__/unit/rnGlobalsBootstrap.test.js +29 -0
  150. package/build/__tests__/unit/rnGlobalsBootstrap.test.js.map +1 -0
  151. package/build/__tests__/unit/screenState.test.d.ts +2 -0
  152. package/build/__tests__/unit/screenState.test.d.ts.map +1 -0
  153. package/build/__tests__/unit/screenState.test.js +384 -0
  154. package/build/__tests__/unit/screenState.test.js.map +1 -0
  155. package/build/__tests__/unit/screenshot-diff.test.d.ts +2 -0
  156. package/build/__tests__/unit/screenshot-diff.test.d.ts.map +1 -0
  157. package/build/__tests__/unit/screenshot-diff.test.js +97 -0
  158. package/build/__tests__/unit/screenshot-diff.test.js.map +1 -0
  159. package/build/__tests__/unit/tap-evidence.test.d.ts +2 -0
  160. package/build/__tests__/unit/tap-evidence.test.d.ts.map +1 -0
  161. package/build/__tests__/unit/tap-evidence.test.js +89 -0
  162. package/build/__tests__/unit/tap-evidence.test.js.map +1 -0
  163. package/build/__tests__/unit/tap.test.d.ts +2 -0
  164. package/build/__tests__/unit/tap.test.d.ts.map +1 -0
  165. package/build/__tests__/unit/tap.test.js +767 -0
  166. package/build/__tests__/unit/tap.test.js.map +1 -0
  167. package/build/__tests__/unit/timeoutClamp.test.d.ts +2 -0
  168. package/build/__tests__/unit/timeoutClamp.test.d.ts.map +1 -0
  169. package/build/__tests__/unit/timeoutClamp.test.js +17 -0
  170. package/build/__tests__/unit/timeoutClamp.test.js.map +1 -0
  171. package/build/__tests__/unit/toolDescriptions.test.d.ts +2 -0
  172. package/build/__tests__/unit/toolDescriptions.test.d.ts.map +1 -0
  173. package/build/__tests__/unit/toolDescriptions.test.js +145 -0
  174. package/build/__tests__/unit/toolDescriptions.test.js.map +1 -0
  175. package/build/__tests__/unit/transportClassify.test.d.ts +2 -0
  176. package/build/__tests__/unit/transportClassify.test.d.ts.map +1 -0
  177. package/build/__tests__/unit/transportClassify.test.js +60 -0
  178. package/build/__tests__/unit/transportClassify.test.js.map +1 -0
  179. package/build/__tests__/unit/verifyAction.test.d.ts +2 -0
  180. package/build/__tests__/unit/verifyAction.test.d.ts.map +1 -0
  181. package/build/__tests__/unit/verifyAction.test.js +26 -0
  182. package/build/__tests__/unit/verifyAction.test.js.map +1 -0
  183. package/build/core/android.d.ts +299 -0
  184. package/build/core/android.d.ts.map +1 -0
  185. package/build/core/android.js +1582 -0
  186. package/build/core/android.js.map +1 -0
  187. package/build/core/appDetection.d.ts +20 -0
  188. package/build/core/appDetection.d.ts.map +1 -0
  189. package/build/core/appDetection.js +167 -0
  190. package/build/core/appDetection.js.map +1 -0
  191. package/build/core/bundle.d.ts +49 -0
  192. package/build/core/bundle.d.ts.map +1 -0
  193. package/build/core/bundle.js +356 -0
  194. package/build/core/bundle.js.map +1 -0
  195. package/build/core/componentSearch.d.ts +41 -0
  196. package/build/core/componentSearch.d.ts.map +1 -0
  197. package/build/core/componentSearch.js +588 -0
  198. package/build/core/componentSearch.js.map +1 -0
  199. package/build/core/componentTree.d.ts +13 -0
  200. package/build/core/componentTree.d.ts.map +1 -0
  201. package/build/core/componentTree.js +275 -0
  202. package/build/core/componentTree.js.map +1 -0
  203. package/build/core/config.d.ts +9 -0
  204. package/build/core/config.d.ts.map +1 -0
  205. package/build/core/config.js +28 -0
  206. package/build/core/config.js.map +1 -0
  207. package/build/core/connection.d.ts +102 -0
  208. package/build/core/connection.d.ts.map +1 -0
  209. package/build/core/connection.js +1710 -0
  210. package/build/core/connection.js.map +1 -0
  211. package/build/core/connectionState.d.ts +122 -0
  212. package/build/core/connectionState.d.ts.map +1 -0
  213. package/build/core/connectionState.js +313 -0
  214. package/build/core/connectionState.js.map +1 -0
  215. package/build/core/debugGlobals.d.ts +6 -0
  216. package/build/core/debugGlobals.d.ts.map +1 -0
  217. package/build/core/debugGlobals.js +370 -0
  218. package/build/core/debugGlobals.js.map +1 -0
  219. package/build/core/deviceDiscovery.d.ts +52 -0
  220. package/build/core/deviceDiscovery.d.ts.map +1 -0
  221. package/build/core/deviceDiscovery.js +74 -0
  222. package/build/core/deviceDiscovery.js.map +1 -0
  223. package/build/core/deviceResolver.d.ts +44 -0
  224. package/build/core/deviceResolver.d.ts.map +1 -0
  225. package/build/core/deviceResolver.js +225 -0
  226. package/build/core/deviceResolver.js.map +1 -0
  227. package/build/core/errorScreenParser.d.ts +30 -0
  228. package/build/core/errorScreenParser.d.ts.map +1 -0
  229. package/build/core/errorScreenParser.js +198 -0
  230. package/build/core/errorScreenParser.js.map +1 -0
  231. package/build/core/errors.d.ts +14 -0
  232. package/build/core/errors.d.ts.map +1 -0
  233. package/build/core/errors.js +17 -0
  234. package/build/core/errors.js.map +1 -0
  235. package/build/core/escapeNonAscii.d.ts +18 -0
  236. package/build/core/escapeNonAscii.d.ts.map +1 -0
  237. package/build/core/escapeNonAscii.js +352 -0
  238. package/build/core/escapeNonAscii.js.map +1 -0
  239. package/build/core/exec.d.ts +22 -0
  240. package/build/core/exec.d.ts.map +1 -0
  241. package/build/core/exec.js +54 -0
  242. package/build/core/exec.js.map +1 -0
  243. package/build/core/executor.d.ts +9 -0
  244. package/build/core/executor.d.ts.map +1 -0
  245. package/build/core/executor.js +12 -0
  246. package/build/core/executor.js.map +1 -0
  247. package/build/core/failureArtifact.d.ts +120 -0
  248. package/build/core/failureArtifact.d.ts.map +1 -0
  249. package/build/core/failureArtifact.js +113 -0
  250. package/build/core/failureArtifact.js.map +1 -0
  251. package/build/core/fastRefreshRecorder.d.ts +23 -0
  252. package/build/core/fastRefreshRecorder.d.ts.map +1 -0
  253. package/build/core/fastRefreshRecorder.js +83 -0
  254. package/build/core/fastRefreshRecorder.js.map +1 -0
  255. package/build/core/fastRefreshTools.d.ts +19 -0
  256. package/build/core/fastRefreshTools.d.ts.map +1 -0
  257. package/build/core/fastRefreshTools.js +71 -0
  258. package/build/core/fastRefreshTools.js.map +1 -0
  259. package/build/core/feedback.d.ts +18 -0
  260. package/build/core/feedback.d.ts.map +1 -0
  261. package/build/core/feedback.js +73 -0
  262. package/build/core/feedback.js.map +1 -0
  263. package/build/core/fiberMatch.d.ts +25 -0
  264. package/build/core/fiberMatch.d.ts.map +1 -0
  265. package/build/core/fiberMatch.js +35 -0
  266. package/build/core/fiberMatch.js.map +1 -0
  267. package/build/core/fingerprint.d.ts +4 -0
  268. package/build/core/fingerprint.d.ts.map +1 -0
  269. package/build/core/fingerprint.js +47 -0
  270. package/build/core/fingerprint.js.map +1 -0
  271. package/build/core/focusedInput.d.ts +27 -0
  272. package/build/core/focusedInput.d.ts.map +1 -0
  273. package/build/core/focusedInput.js +110 -0
  274. package/build/core/focusedInput.js.map +1 -0
  275. package/build/core/focusedInputTools.d.ts +21 -0
  276. package/build/core/focusedInputTools.d.ts.map +1 -0
  277. package/build/core/focusedInputTools.js +51 -0
  278. package/build/core/focusedInputTools.js.map +1 -0
  279. package/build/core/format.d.ts +8 -0
  280. package/build/core/format.d.ts.map +1 -0
  281. package/build/core/format.js +34 -0
  282. package/build/core/format.js.map +1 -0
  283. package/build/core/guides.d.ts +21 -0
  284. package/build/core/guides.d.ts.map +1 -0
  285. package/build/core/guides.js +397 -0
  286. package/build/core/guides.js.map +1 -0
  287. package/build/core/iconSemantics.d.ts +18 -0
  288. package/build/core/iconSemantics.d.ts.map +1 -0
  289. package/build/core/iconSemantics.js +114 -0
  290. package/build/core/iconSemantics.js.map +1 -0
  291. package/build/core/imageBuffer.d.ts +37 -0
  292. package/build/core/imageBuffer.d.ts.map +1 -0
  293. package/build/core/imageBuffer.js +58 -0
  294. package/build/core/imageBuffer.js.map +1 -0
  295. package/build/core/index.d.ts +37 -0
  296. package/build/core/index.d.ts.map +1 -0
  297. package/build/core/index.js +66 -0
  298. package/build/core/index.js.map +1 -0
  299. package/build/core/inspector.d.ts +55 -0
  300. package/build/core/inspector.d.ts.map +1 -0
  301. package/build/core/inspector.js +603 -0
  302. package/build/core/inspector.js.map +1 -0
  303. package/build/core/ios.d.ts +263 -0
  304. package/build/core/ios.d.ts.map +1 -0
  305. package/build/core/ios.js +1705 -0
  306. package/build/core/ios.js.map +1 -0
  307. package/build/core/jsExecute.d.ts +62 -0
  308. package/build/core/jsExecute.d.ts.map +1 -0
  309. package/build/core/jsExecute.js +696 -0
  310. package/build/core/jsExecute.js.map +1 -0
  311. package/build/core/license.d.ts +48 -0
  312. package/build/core/license.d.ts.map +1 -0
  313. package/build/core/license.js +267 -0
  314. package/build/core/license.js.map +1 -0
  315. package/build/core/logbox.d.ts +58 -0
  316. package/build/core/logbox.d.ts.map +1 -0
  317. package/build/core/logbox.js +330 -0
  318. package/build/core/logbox.js.map +1 -0
  319. package/build/core/logs.d.ts +44 -0
  320. package/build/core/logs.d.ts.map +1 -0
  321. package/build/core/logs.js +149 -0
  322. package/build/core/logs.js.map +1 -0
  323. package/build/core/measureComponent.d.ts +19 -0
  324. package/build/core/measureComponent.d.ts.map +1 -0
  325. package/build/core/measureComponent.js +94 -0
  326. package/build/core/measureComponent.js.map +1 -0
  327. package/build/core/measureComponentTools.d.ts +6 -0
  328. package/build/core/measureComponentTools.d.ts.map +1 -0
  329. package/build/core/measureComponentTools.js +43 -0
  330. package/build/core/measureComponentTools.js.map +1 -0
  331. package/build/core/metro.d.ts +31 -0
  332. package/build/core/metro.d.ts.map +1 -0
  333. package/build/core/metro.js +124 -0
  334. package/build/core/metro.js.map +1 -0
  335. package/build/core/nativeOnlyHints.d.ts +14 -0
  336. package/build/core/nativeOnlyHints.d.ts.map +1 -0
  337. package/build/core/nativeOnlyHints.js +58 -0
  338. package/build/core/nativeOnlyHints.js.map +1 -0
  339. package/build/core/network.d.ts +43 -0
  340. package/build/core/network.d.ts.map +1 -0
  341. package/build/core/network.js +217 -0
  342. package/build/core/network.js.map +1 -0
  343. package/build/core/networkInterceptor.d.ts +30 -0
  344. package/build/core/networkInterceptor.d.ts.map +1 -0
  345. package/build/core/networkInterceptor.js +211 -0
  346. package/build/core/networkInterceptor.js.map +1 -0
  347. package/build/core/ocr.d.ts +87 -0
  348. package/build/core/ocr.d.ts.map +1 -0
  349. package/build/core/ocr.js +335 -0
  350. package/build/core/ocr.js.map +1 -0
  351. package/build/core/paths.d.ts +2 -0
  352. package/build/core/paths.d.ts.map +1 -0
  353. package/build/core/paths.js +28 -0
  354. package/build/core/paths.js.map +1 -0
  355. package/build/core/posthog.d.ts +5 -0
  356. package/build/core/posthog.d.ts.map +1 -0
  357. package/build/core/posthog.js +52 -0
  358. package/build/core/posthog.js.map +1 -0
  359. package/build/core/pressables.d.ts +46 -0
  360. package/build/core/pressables.d.ts.map +1 -0
  361. package/build/core/pressables.js +1719 -0
  362. package/build/core/pressables.js.map +1 -0
  363. package/build/core/probe.d.ts +12 -0
  364. package/build/core/probe.d.ts.map +1 -0
  365. package/build/core/probe.js +56 -0
  366. package/build/core/probe.js.map +1 -0
  367. package/build/core/redux.d.ts +22 -0
  368. package/build/core/redux.d.ts.map +1 -0
  369. package/build/core/redux.js +116 -0
  370. package/build/core/redux.js.map +1 -0
  371. package/build/core/register.d.ts +8 -0
  372. package/build/core/register.d.ts.map +1 -0
  373. package/build/core/register.js +202 -0
  374. package/build/core/register.js.map +1 -0
  375. package/build/core/rnGlobalsBootstrap.d.ts +16 -0
  376. package/build/core/rnGlobalsBootstrap.d.ts.map +1 -0
  377. package/build/core/rnGlobalsBootstrap.js +116 -0
  378. package/build/core/rnGlobalsBootstrap.js.map +1 -0
  379. package/build/core/screenLayout.d.ts +53 -0
  380. package/build/core/screenLayout.d.ts.map +1 -0
  381. package/build/core/screenLayout.js +878 -0
  382. package/build/core/screenLayout.js.map +1 -0
  383. package/build/core/screenState.d.ts +166 -0
  384. package/build/core/screenState.d.ts.map +1 -0
  385. package/build/core/screenState.js +1352 -0
  386. package/build/core/screenState.js.map +1 -0
  387. package/build/core/sdkBridge.d.ts +67 -0
  388. package/build/core/sdkBridge.d.ts.map +1 -0
  389. package/build/core/sdkBridge.js +148 -0
  390. package/build/core/sdkBridge.js.map +1 -0
  391. package/build/core/state.d.ts +37 -0
  392. package/build/core/state.d.ts.map +1 -0
  393. package/build/core/state.js +124 -0
  394. package/build/core/state.js.map +1 -0
  395. package/build/core/telemetry.d.ts +50 -0
  396. package/build/core/telemetry.d.ts.map +1 -0
  397. package/build/core/telemetry.js +653 -0
  398. package/build/core/telemetry.js.map +1 -0
  399. package/build/core/toolHelpers.d.ts +24 -0
  400. package/build/core/toolHelpers.d.ts.map +1 -0
  401. package/build/core/toolHelpers.js +118 -0
  402. package/build/core/toolHelpers.js.map +1 -0
  403. package/build/core/types.d.ts +162 -0
  404. package/build/core/types.d.ts.map +1 -0
  405. package/build/core/types.js +2 -0
  406. package/build/core/types.js.map +1 -0
  407. package/build/index.d.ts +4 -0
  408. package/build/index.d.ts.map +1 -0
  409. package/build/index.js +132 -0
  410. package/build/index.js.map +1 -0
  411. package/build/pro/screenshot-diff.d.ts +10 -0
  412. package/build/pro/screenshot-diff.d.ts.map +1 -0
  413. package/build/pro/screenshot-diff.js +38 -0
  414. package/build/pro/screenshot-diff.js.map +1 -0
  415. package/build/pro/tap.d.ts +291 -0
  416. package/build/pro/tap.d.ts.map +1 -0
  417. package/build/pro/tap.js +1839 -0
  418. package/build/pro/tap.js.map +1 -0
  419. package/build/pro/verifyAction.d.ts +50 -0
  420. package/build/pro/verifyAction.d.ts.map +1 -0
  421. package/build/pro/verifyAction.js +285 -0
  422. package/build/pro/verifyAction.js.map +1 -0
  423. package/build/tools/_deviceArg.d.ts +45 -0
  424. package/build/tools/_deviceArg.d.ts.map +1 -0
  425. package/build/tools/_deviceArg.js +58 -0
  426. package/build/tools/_deviceArg.js.map +1 -0
  427. package/build/tools/accountTools.d.ts +46 -0
  428. package/build/tools/accountTools.d.ts.map +1 -0
  429. package/build/tools/accountTools.js +223 -0
  430. package/build/tools/accountTools.js.map +1 -0
  431. package/build/tools/bundleTools.d.ts +3 -0
  432. package/build/tools/bundleTools.d.ts.map +1 -0
  433. package/build/tools/bundleTools.js +375 -0
  434. package/build/tools/bundleTools.js.map +1 -0
  435. package/build/tools/componentTools.d.ts +3 -0
  436. package/build/tools/componentTools.d.ts.map +1 -0
  437. package/build/tools/componentTools.js +746 -0
  438. package/build/tools/componentTools.js.map +1 -0
  439. package/build/tools/connectionTools.d.ts +3 -0
  440. package/build/tools/connectionTools.d.ts.map +1 -0
  441. package/build/tools/connectionTools.js +625 -0
  442. package/build/tools/connectionTools.js.map +1 -0
  443. package/build/tools/deviceTools.d.ts +3 -0
  444. package/build/tools/deviceTools.d.ts.map +1 -0
  445. package/build/tools/deviceTools.js +423 -0
  446. package/build/tools/deviceTools.js.map +1 -0
  447. package/build/tools/executionTools.d.ts +3 -0
  448. package/build/tools/executionTools.d.ts.map +1 -0
  449. package/build/tools/executionTools.js +243 -0
  450. package/build/tools/executionTools.js.map +1 -0
  451. package/build/tools/interactionTools.d.ts +3 -0
  452. package/build/tools/interactionTools.d.ts.map +1 -0
  453. package/build/tools/interactionTools.js +539 -0
  454. package/build/tools/interactionTools.js.map +1 -0
  455. package/build/tools/logTools.d.ts +3 -0
  456. package/build/tools/logTools.d.ts.map +1 -0
  457. package/build/tools/logTools.js +371 -0
  458. package/build/tools/logTools.js.map +1 -0
  459. package/build/tools/metaTools.d.ts +7 -0
  460. package/build/tools/metaTools.d.ts.map +1 -0
  461. package/build/tools/metaTools.js +186 -0
  462. package/build/tools/metaTools.js.map +1 -0
  463. package/build/tools/networkTools.d.ts +3 -0
  464. package/build/tools/networkTools.d.ts.map +1 -0
  465. package/build/tools/networkTools.js +478 -0
  466. package/build/tools/networkTools.js.map +1 -0
  467. package/build/tools/reduxTools.d.ts +3 -0
  468. package/build/tools/reduxTools.d.ts.map +1 -0
  469. package/build/tools/reduxTools.js +83 -0
  470. package/build/tools/reduxTools.js.map +1 -0
  471. package/build/tools/screenshotTools.d.ts +3 -0
  472. package/build/tools/screenshotTools.d.ts.map +1 -0
  473. package/build/tools/screenshotTools.js +703 -0
  474. package/build/tools/screenshotTools.js.map +1 -0
  475. package/package.json +63 -2
@@ -0,0 +1,588 @@
1
+ import { executeInApp, delay } from "./jsExecute.js";
2
+ import { formatSummaryToTonl } from "./screenLayout.js";
3
+ function formatFoundComponentsToTonl(components) {
4
+ const lines = ["#found{component,path,depth,key,layout}"];
5
+ for (const c of components) {
6
+ const layout = c.layout
7
+ ? Object.entries(c.layout)
8
+ .map(([k, v]) => `${k}:${v}`)
9
+ .join(";")
10
+ : "";
11
+ lines.push(`${c.component}|${c.path}|${c.depth}|${c.key || ""}|${layout}`);
12
+ }
13
+ return lines.join("\n");
14
+ }
15
+ /**
16
+ * Get the React component tree from the running app.
17
+ * This traverses the fiber tree to extract component hierarchy with names.
18
+ */
19
+ /**
20
+ * Get layout data for visible components on the current screen.
21
+ * Uses measureInWindow to get actual screen positions and filters
22
+ * to only components within the viewport.
23
+ *
24
+ * Two-step approach (same as inspectAtPoint):
25
+ * Step 1: Walk fiber tree, dispatch measureInWindow on host components
26
+ * Step 2: After 300ms, read measurements, filter by viewport, build results
27
+ */
28
+ /**
29
+ * Inspect a specific component by name, returning its props, state, and layout.
30
+ */
31
+ export async function inspectComponent(componentName, options = {}) {
32
+ const { index = 0, includeState = true, includeChildren = false, childrenDepth = 1, includeStyle = false, shortPath = true, simplifyHooks = true, device, timeoutMs } = options;
33
+ const escapedName = componentName.replace(/'/g, "\\'");
34
+ const expression = `
35
+ (function() {
36
+ const hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
37
+ if (!hook) return { error: 'React DevTools hook not found.' };
38
+
39
+ let roots = [];
40
+ if (hook.getFiberRoots) {
41
+ roots = [...(hook.getFiberRoots(1) || [])];
42
+ }
43
+ if (roots.length === 0 && hook.renderers) {
44
+ for (const [id] of hook.renderers) {
45
+ const r = hook.getFiberRoots ? [...(hook.getFiberRoots(id) || [])] : [];
46
+ if (r.length > 0) { roots = r; break; }
47
+ }
48
+ }
49
+ if (roots.length === 0) return { error: 'No fiber roots found.' };
50
+
51
+ const targetName = '${escapedName}';
52
+ const targetIndex = ${index};
53
+ const includeState = ${includeState};
54
+ const includeChildren = ${includeChildren};
55
+ const childrenDepth = ${childrenDepth};
56
+ const includeStyle = ${includeStyle};
57
+ const shortPath = ${shortPath};
58
+ const simplifyHooks = ${simplifyHooks};
59
+ const pathSegments = 3;
60
+
61
+ function getComponentName(fiber) {
62
+ if (!fiber || !fiber.type) return null;
63
+ if (typeof fiber.type === 'string') return fiber.type;
64
+ return fiber.type.displayName || fiber.type.name || null;
65
+ }
66
+
67
+ function formatPath(pathArray) {
68
+ if (!shortPath || pathArray.length <= pathSegments) {
69
+ return pathArray.join(' > ');
70
+ }
71
+ return '... > ' + pathArray.slice(-pathSegments).join(' > ');
72
+ }
73
+
74
+ function extractStyles(style) {
75
+ try {
76
+ if (!style) return null;
77
+ const merged = Array.isArray(style)
78
+ ? Object.assign({}, ...style.filter(Boolean).map(s => {
79
+ try { return typeof s === 'object' ? s : {}; }
80
+ catch { return {}; }
81
+ }))
82
+ : (typeof style === 'object' ? style : {});
83
+ return Object.keys(merged).length > 0 ? merged : null;
84
+ } catch { return { _note: '[Contains animated styles]' }; }
85
+ }
86
+
87
+ function serializeValue(val, depth = 0) {
88
+ if (depth > 3) return '[Max depth]';
89
+ if (val === null) return null;
90
+ if (val === undefined) return undefined;
91
+ if (typeof val === 'function') return '[Function]';
92
+ if (typeof val !== 'object') return val;
93
+ if (Array.isArray(val)) {
94
+ if (val.length > 10) return '[Array(' + val.length + ')]';
95
+ return val.map(v => serializeValue(v, depth + 1));
96
+ }
97
+ // Object
98
+ const keys = Object.keys(val);
99
+ if (keys.length > 20) return '[Object(' + keys.length + ' keys)]';
100
+ const result = {};
101
+ for (const k of keys) {
102
+ try {
103
+ result[k] = serializeValue(val[k], depth + 1);
104
+ } catch {
105
+ result[k] = '[Animated Value]';
106
+ }
107
+ }
108
+ return result;
109
+ }
110
+
111
+ const resolveRNStyle = (hook && hook.resolveRNStyle) || null;
112
+
113
+ function flattenStyleProp(style) {
114
+ if (style == null || style === false || style === true) return null;
115
+ if (typeof style === 'number') {
116
+ if (resolveRNStyle) {
117
+ try {
118
+ const resolved = resolveRNStyle(style);
119
+ return resolved ? flattenStyleProp(resolved) : null;
120
+ } catch { return null; }
121
+ }
122
+ return null;
123
+ }
124
+ if (Array.isArray(style)) {
125
+ const out = {};
126
+ for (const item of style) {
127
+ const flat = flattenStyleProp(item);
128
+ if (flat && typeof flat === 'object') Object.assign(out, flat);
129
+ }
130
+ return Object.keys(out).length ? out : null;
131
+ }
132
+ if (typeof style === 'object') return style;
133
+ return null;
134
+ }
135
+
136
+ function sanitizeStyleObject(s) {
137
+ if (!s || typeof s !== 'object') return null;
138
+ const out = {};
139
+ for (const k of Object.keys(s)) {
140
+ const v = s[k];
141
+ if (v === undefined) continue;
142
+ if (v === null) { out[k] = null; continue; }
143
+ const t = typeof v;
144
+ if (t === 'function') { out[k] = '[Function]'; continue; }
145
+ if (t === 'object') {
146
+ try { JSON.stringify(v); out[k] = v; }
147
+ catch { out[k] = String(v); }
148
+ continue;
149
+ }
150
+ out[k] = v;
151
+ }
152
+ return Object.keys(out).length ? out : null;
153
+ }
154
+
155
+ function getResolvedStyle(fiber) {
156
+ try {
157
+ const raw = fiber && fiber.memoizedProps && fiber.memoizedProps.style;
158
+ if (raw == null) return null;
159
+ return sanitizeStyleObject(flattenStyleProp(raw));
160
+ } catch { return null; }
161
+ }
162
+
163
+ function getChildTree(fiber, depth) {
164
+ if (!fiber || depth <= 0) return null;
165
+ const children = [];
166
+ let child = fiber?.child;
167
+ while (child && children.length < 30) {
168
+ const name = getComponentName(child);
169
+ if (name) {
170
+ const style = includeStyle ? getResolvedStyle(child) : null;
171
+ if (depth === 1) {
172
+ if (includeStyle) {
173
+ const entry = { component: name };
174
+ if (style) entry.style = style;
175
+ children.push(entry);
176
+ } else {
177
+ children.push(name);
178
+ }
179
+ } else {
180
+ const nestedChildren = getChildTree(child, depth - 1);
181
+ if (includeStyle) {
182
+ const entry = { component: name };
183
+ if (style) entry.style = style;
184
+ if (nestedChildren) entry.children = nestedChildren;
185
+ children.push(entry);
186
+ } else {
187
+ children.push(nestedChildren ? { component: name, children: nestedChildren } : name);
188
+ }
189
+ }
190
+ }
191
+ child = child.sibling;
192
+ }
193
+ return children.length > 0 ? children : null;
194
+ }
195
+
196
+ const matches = [];
197
+
198
+ function findComponent(fiber, path) {
199
+ if (!fiber) return;
200
+
201
+ const name = getComponentName(fiber);
202
+ if (name === targetName) {
203
+ matches.push({ fiber, path: [...path, name] });
204
+ }
205
+
206
+ let child = fiber.child;
207
+ while (child) {
208
+ const childName = getComponentName(child);
209
+ findComponent(child, childName ? [...path, childName] : path);
210
+ child = child.sibling;
211
+ }
212
+ }
213
+
214
+ findComponent(roots[0].current, []);
215
+
216
+ if (matches.length === 0) {
217
+ return { error: 'Component "' + targetName + '" not found in the component tree.' };
218
+ }
219
+
220
+ if (targetIndex >= matches.length) {
221
+ return { error: 'Component "' + targetName + '" found ' + matches.length + ' times, but index ' + targetIndex + ' requested.' };
222
+ }
223
+
224
+ const { fiber, path } = matches[targetIndex];
225
+
226
+ const result = {
227
+ component: targetName,
228
+ path: formatPath(path),
229
+ instancesFound: matches.length,
230
+ instanceIndex: targetIndex
231
+ };
232
+
233
+ // Props (excluding children)
234
+ if (fiber.memoizedProps) {
235
+ const props = {};
236
+ for (const key of Object.keys(fiber.memoizedProps)) {
237
+ if (key === 'children') continue;
238
+ try {
239
+ props[key] = serializeValue(fiber.memoizedProps[key]);
240
+ } catch {
241
+ props[key] = '[Animated Value]';
242
+ }
243
+ }
244
+ result.props = props;
245
+ }
246
+
247
+ // Style separately for clarity
248
+ try {
249
+ if (fiber.memoizedProps?.style) {
250
+ result.style = extractStyles(fiber.memoizedProps.style);
251
+ }
252
+ } catch {
253
+ result.style = { _note: '[Contains animated styles]' };
254
+ }
255
+
256
+ // State (for hooks, this is a linked list)
257
+ if (includeState && fiber.memoizedState) {
258
+ // Simplified hook value serialization
259
+ function serializeHookValue(val, depth = 0) {
260
+ try {
261
+ if (depth > 2) return '[...]';
262
+ if (val === null || val === undefined) return val;
263
+ if (typeof val === 'function') return '[Function]';
264
+ if (typeof val !== 'object') return val;
265
+ // Skip React internal structures (effects, refs with destroy/create)
266
+ if (val.create && val.destroy !== undefined) return '[Effect]';
267
+ if (val.inst && val.deps) return '[Effect]';
268
+ if (val.current !== undefined && Object.keys(val).length === 1) {
269
+ // Ref object - just show current value
270
+ return { current: serializeHookValue(val.current, depth + 1) };
271
+ }
272
+ if (Array.isArray(val)) {
273
+ if (val.length > 5) return '[Array(' + val.length + ')]';
274
+ return val.slice(0, 5).map(v => serializeHookValue(v, depth + 1));
275
+ }
276
+ const keys = Object.keys(val);
277
+ if (keys.length > 10) return '[Object(' + keys.length + ' keys)]';
278
+ const result = {};
279
+ for (const k of keys.slice(0, 10)) {
280
+ try {
281
+ result[k] = serializeHookValue(val[k], depth + 1);
282
+ } catch {
283
+ result[k] = '[Animated Value]';
284
+ }
285
+ }
286
+ return result;
287
+ } catch { return '[Animated Value]'; }
288
+ }
289
+
290
+ // For function components with hooks
291
+ const states = [];
292
+ let state = fiber.memoizedState;
293
+ let hookIndex = 0;
294
+ while (state && hookIndex < 20) {
295
+ if (state.memoizedState !== undefined) {
296
+ const hookVal = simplifyHooks
297
+ ? serializeHookValue(state.memoizedState)
298
+ : serializeValue(state.memoizedState);
299
+ // Skip effect hooks in simplified mode
300
+ if (!simplifyHooks || (hookVal !== '[Effect]' && hookVal !== undefined)) {
301
+ states.push({
302
+ hookIndex,
303
+ value: hookVal
304
+ });
305
+ }
306
+ }
307
+ state = state.next;
308
+ hookIndex++;
309
+ }
310
+ if (states.length > 0) result.hooks = states;
311
+
312
+ // For class components, memoizedState is the state object directly
313
+ if (states.length === 0 && typeof fiber.memoizedState === 'object') {
314
+ result.state = serializeValue(fiber.memoizedState);
315
+ }
316
+ }
317
+
318
+ // Children tree (depth controlled by childrenDepth)
319
+ if (includeChildren) {
320
+ result.children = getChildTree(fiber, childrenDepth);
321
+ }
322
+
323
+ // Scroll introspection — dispatch measurements for ScrollView-like fibers.
324
+ // A second roundtrip in TypeScript reads globalThis.__scrollMeasure to
325
+ // compute layout vs content size and an isScrollable verdict.
326
+ const isScrollable = (
327
+ targetName === 'ScrollView' ||
328
+ targetName === 'FlatList' ||
329
+ targetName === 'SectionList' ||
330
+ targetName.indexOf('ScrollView') !== -1 ||
331
+ (fiber.memoizedProps && typeof fiber.memoizedProps.onScroll === 'function')
332
+ );
333
+ if (isScrollable) {
334
+ function findFirstHost(f, d) {
335
+ if (!f || d > 10) return null;
336
+ if (typeof f.type === 'string' && f.stateNode) return f;
337
+ let c = f.child;
338
+ while (c) {
339
+ const h = findFirstHost(c, d + 1);
340
+ if (h) return h;
341
+ c = c.sibling;
342
+ }
343
+ return null;
344
+ }
345
+ function getMeasurable(f) {
346
+ const sn = f.stateNode;
347
+ if (!sn) return null;
348
+ if (typeof sn.measureInWindow === 'function') return sn;
349
+ if (sn.canonical && sn.canonical.publicInstance &&
350
+ typeof sn.canonical.publicInstance.measureInWindow === 'function') {
351
+ return sn.canonical.publicInstance;
352
+ }
353
+ return null;
354
+ }
355
+ const scrollHost = findFirstHost(fiber, 0);
356
+ const contentHost = scrollHost && scrollHost.child ? findFirstHost(scrollHost.child, 0) : null;
357
+ const sm = scrollHost ? getMeasurable(scrollHost) : null;
358
+ const cm = contentHost ? getMeasurable(contentHost) : null;
359
+ if (sm && cm) {
360
+ globalThis.__scrollMeasure = { layout: null, content: null };
361
+ try { sm.measureInWindow(function(x, y, w, h) { globalThis.__scrollMeasure.layout = { x: x, y: y, width: w, height: h }; }); } catch(e) {}
362
+ try { cm.measureInWindow(function(x, y, w, h) { globalThis.__scrollMeasure.content = { x: x, y: y, width: w, height: h }; }); } catch(e) {}
363
+ result.__scrollPending = true;
364
+ }
365
+ const sp = fiber.memoizedProps || {};
366
+ result.scroll = {
367
+ scrollEnabled: sp.scrollEnabled !== false,
368
+ horizontal: !!sp.horizontal,
369
+ bounces: sp.bounces
370
+ };
371
+ }
372
+
373
+ return result;
374
+ })()
375
+ `;
376
+ const firstResult = await executeInApp(expression, false, { timeoutMs: timeoutMs ?? 5000, originatingToolName: "inspect_component" }, device);
377
+ if (!firstResult.success || !firstResult.result)
378
+ return firstResult;
379
+ // Parse and check for pending scroll measurement
380
+ let parsed;
381
+ try {
382
+ parsed = JSON.parse(firstResult.result);
383
+ }
384
+ catch {
385
+ return firstResult;
386
+ }
387
+ if (!parsed.__scrollPending)
388
+ return firstResult;
389
+ delete parsed.__scrollPending;
390
+ await delay(120);
391
+ const resolveScrollExpr = `
392
+ (function() {
393
+ const m = globalThis.__scrollMeasure;
394
+ globalThis.__scrollMeasure = null;
395
+ if (!m || !m.layout || !m.content) return { error: 'no_measurement' };
396
+ const horizontal = ${JSON.stringify(parsed.scroll && parsed.scroll.horizontal === true)};
397
+ const layoutWidth = m.layout.width;
398
+ const layoutHeight = m.layout.height;
399
+ const contentWidth = m.content.width;
400
+ const contentHeight = m.content.height;
401
+ const contentOffsetX = m.layout.x - m.content.x;
402
+ const contentOffsetY = m.layout.y - m.content.y;
403
+ const overflowAxis = horizontal ? contentWidth - layoutWidth : contentHeight - layoutHeight;
404
+ const offsetAxis = horizontal ? contentOffsetX : contentOffsetY;
405
+ const isScrollable = overflowAxis > 1;
406
+ const isAtTop = horizontal ? Math.abs(contentOffsetX) < 1 : Math.abs(contentOffsetY) < 1;
407
+ const isAtBottom = !isScrollable || (offsetAxis >= overflowAxis - 1);
408
+ return {
409
+ layoutWidth: Math.round(layoutWidth * 100) / 100,
410
+ layoutHeight: Math.round(layoutHeight * 100) / 100,
411
+ contentWidth: Math.round(contentWidth * 100) / 100,
412
+ contentHeight: Math.round(contentHeight * 100) / 100,
413
+ contentOffset: { x: Math.round(contentOffsetX * 100) / 100, y: Math.round(contentOffsetY * 100) / 100 },
414
+ isScrollable: isScrollable,
415
+ isAtTop: isAtTop,
416
+ isAtBottom: isAtBottom
417
+ };
418
+ })()
419
+ `;
420
+ const scrollResult = await executeInApp(resolveScrollExpr, false, { timeoutMs: 3000, originatingToolName: "inspect_component" }, device);
421
+ if (scrollResult.success && scrollResult.result) {
422
+ try {
423
+ const scrollData = JSON.parse(scrollResult.result);
424
+ if (!scrollData.error) {
425
+ parsed.scroll = { ...parsed.scroll, ...scrollData };
426
+ }
427
+ }
428
+ catch { /* keep partial scroll info */ }
429
+ }
430
+ return { ...firstResult, result: JSON.stringify(parsed, null, 2) };
431
+ }
432
+ /**
433
+ * Find all components matching a name pattern and return summary info.
434
+ */
435
+ export async function findComponents(pattern, options = {}) {
436
+ const { maxResults = 20, includeLayout = false, shortPath = true, summary = false, format = "tonl", device, timeoutMs } = options;
437
+ const escapedPattern = pattern.replace(/'/g, "\\'").replace(/\\/g, "\\\\");
438
+ const expression = `
439
+ (function() {
440
+ const hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;
441
+ if (!hook) return { error: 'React DevTools hook not found.' };
442
+
443
+ let roots = [];
444
+ if (hook.getFiberRoots) {
445
+ roots = [...(hook.getFiberRoots(1) || [])];
446
+ }
447
+ if (roots.length === 0 && hook.renderers) {
448
+ for (const [id] of hook.renderers) {
449
+ const r = hook.getFiberRoots ? [...(hook.getFiberRoots(id) || [])] : [];
450
+ if (r.length > 0) { roots = r; break; }
451
+ }
452
+ }
453
+ if (roots.length === 0) return { error: 'No fiber roots found.' };
454
+
455
+ const pattern = '${escapedPattern}';
456
+ const regex = new RegExp(pattern, 'i');
457
+ const maxResults = ${maxResults};
458
+ const includeLayout = ${includeLayout};
459
+ const shortPath = ${shortPath};
460
+ const summaryMode = ${summary};
461
+ const pathSegments = 3;
462
+
463
+ function getComponentName(fiber) {
464
+ if (!fiber || !fiber.type) return null;
465
+ if (typeof fiber.type === 'string') return fiber.type;
466
+ return fiber.type.displayName || fiber.type.name || null;
467
+ }
468
+
469
+ function formatPath(pathArray) {
470
+ if (!shortPath || pathArray.length <= pathSegments) {
471
+ return pathArray.join(' > ');
472
+ }
473
+ return '... > ' + pathArray.slice(-pathSegments).join(' > ');
474
+ }
475
+
476
+ function extractLayoutStyles(style) {
477
+ try {
478
+ if (!style) return null;
479
+ const merged = Array.isArray(style)
480
+ ? Object.assign({}, ...style.filter(Boolean).map(s => {
481
+ try { return typeof s === 'object' ? s : {}; }
482
+ catch { return {}; }
483
+ }))
484
+ : (typeof style === 'object' ? style : {});
485
+
486
+ const layout = {};
487
+ const keys = ['padding', 'paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight',
488
+ 'paddingHorizontal', 'paddingVertical', 'margin', 'marginTop', 'marginBottom',
489
+ 'marginLeft', 'marginRight', 'marginHorizontal', 'marginVertical',
490
+ 'width', 'height', 'flex', 'flexDirection', 'justifyContent', 'alignItems'];
491
+ for (const k of keys) {
492
+ if (merged[k] !== undefined) layout[k] = merged[k];
493
+ }
494
+ return Object.keys(layout).length > 0 ? layout : null;
495
+ } catch { return null; }
496
+ }
497
+
498
+ const results = [];
499
+
500
+ function search(fiber, path, depth) {
501
+ if (!fiber || results.length >= maxResults) return;
502
+
503
+ try {
504
+ var name = getComponentName(fiber);
505
+ if (name && regex.test(name)) {
506
+ var entry = {
507
+ component: name,
508
+ path: formatPath(path),
509
+ depth
510
+ };
511
+
512
+ if (fiber.memoizedProps && fiber.memoizedProps.testID) entry.testID = fiber.memoizedProps.testID;
513
+ if (fiber.key) entry.key = fiber.key;
514
+
515
+ if (includeLayout && fiber.memoizedProps && fiber.memoizedProps.style) {
516
+ try {
517
+ var layout = extractLayoutStyles(fiber.memoizedProps.style);
518
+ if (layout) entry.layout = layout;
519
+ } catch(e) {}
520
+ }
521
+
522
+ results.push(entry);
523
+ }
524
+
525
+ var child = fiber.child;
526
+ while (child && results.length < maxResults) {
527
+ var childName = getComponentName(child);
528
+ search(child, childName ? path.concat([childName]) : path, depth + 1);
529
+ child = child.sibling;
530
+ }
531
+ } catch(e) {
532
+ try {
533
+ var child = fiber.child;
534
+ while (child && results.length < maxResults) {
535
+ search(child, path, depth + 1);
536
+ child = child.sibling;
537
+ }
538
+ } catch(e2) {}
539
+ }
540
+ }
541
+
542
+ search(roots[0].current, [], 0);
543
+
544
+ if (summaryMode) {
545
+ const counts = {};
546
+ for (const r of results) {
547
+ counts[r.component] = (counts[r.component] || 0) + 1;
548
+ }
549
+ const sorted = Object.entries(counts)
550
+ .sort((a, b) => b[1] - a[1])
551
+ .map(([name, count]) => ({ component: name, count }));
552
+ return {
553
+ pattern,
554
+ totalMatches: results.length,
555
+ uniqueComponents: sorted.length,
556
+ components: sorted
557
+ };
558
+ }
559
+
560
+ return {
561
+ pattern,
562
+ found: results.length,
563
+ components: results
564
+ };
565
+ })()
566
+ `;
567
+ const result = await executeInApp(expression, false, { timeoutMs: timeoutMs ?? 5000, originatingToolName: "find_components" }, device);
568
+ if (format === "tonl" && result.success && result.result) {
569
+ try {
570
+ const parsed = JSON.parse(result.result);
571
+ if (parsed.components) {
572
+ if (parsed.totalMatches !== undefined) {
573
+ const tonl = formatSummaryToTonl(parsed.components, parsed.totalMatches);
574
+ return { success: true, result: `pattern: ${parsed.pattern}\n${tonl}` };
575
+ }
576
+ else {
577
+ const tonl = formatFoundComponentsToTonl(parsed.components);
578
+ return { success: true, result: `pattern: ${parsed.pattern}\nfound: ${parsed.found}\n${tonl}` };
579
+ }
580
+ }
581
+ }
582
+ catch {
583
+ // If parsing fails, return original result
584
+ }
585
+ }
586
+ return result;
587
+ }
588
+ //# sourceMappingURL=componentSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentSearch.js","sourceRoot":"","sources":["../../src/core/componentSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAexD,SAAS,2BAA2B,CAAC,UAA4B;IAC7D,MAAM,KAAK,GAAa,CAAC,yCAAyC,CAAC,CAAC;IACpE,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM;YACnB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;iBACnB,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;iBAC5B,IAAI,CAAC,GAAG,CAAC;YAChB,CAAC,CAAC,EAAE,CAAC;QACT,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,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AAC,YAAY,CAAC,CAAC;oBACzE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,MAAM,CAAC,OAAO,KAAK,IAAI,EAAE,EAAE,CAAC;gBAC5E,CAAC;qBAAM,CAAC;oBACJ,MAAM,IAAI,GAAG,2BAA2B,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;oBAC5D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,MAAM,CAAC,OAAO,YAAY,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,EAAE,CAAC;gBACpG,CAAC;YACL,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACL,2CAA2C;QAC/C,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { ExecutionResult } from "./types.js";
2
+ export declare function getComponentTree(options?: {
3
+ maxDepth?: number;
4
+ includeProps?: boolean;
5
+ includeStyles?: boolean;
6
+ hideInternals?: boolean;
7
+ format?: "json" | "tonl";
8
+ structureOnly?: boolean;
9
+ focusedOnly?: boolean;
10
+ device?: string;
11
+ timeoutMs?: number;
12
+ }): Promise<ExecutionResult>;
13
+ //# sourceMappingURL=componentTree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentTree.d.ts","sourceRoot":"","sources":["../../src/core/componentTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA4DlD,wBAAsB,gBAAgB,CAClC,OAAO,GAAE;IACL,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACjB,GACP,OAAO,CAAC,eAAe,CAAC,CAwP1B"}