rnxsim 0.1.313 → 0.1.315

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 (297) hide show
  1. package/LICENSE +11 -10
  2. package/README.md +5 -0
  3. package/cli/app-config.ts +65 -0
  4. package/cli/app-fonts.ts +408 -0
  5. package/cli/app-project.ts +231 -0
  6. package/cli/app-splash.ts +185 -0
  7. package/cli/app-state-reset.ts +24 -0
  8. package/cli/auth.ts +155 -0
  9. package/cli/bin.ts +594 -0
  10. package/cli/bridge-diagnostics.ts +226 -0
  11. package/cli/bridge-flow-runner.ts +2830 -0
  12. package/cli/browser-evals.ts +96 -0
  13. package/cli/commands/agent-wrapper.ts +986 -0
  14. package/cli/commands/agent.ts +423 -0
  15. package/cli/commands/app-fonts.ts +98 -0
  16. package/cli/commands/assert.ts +541 -0
  17. package/cli/commands/auth.ts +59 -0
  18. package/cli/commands/camera.ts +266 -0
  19. package/cli/commands/cleanup.ts +169 -0
  20. package/cli/commands/compat.ts +87 -0
  21. package/cli/commands/config.ts +32 -0
  22. package/cli/commands/control.ts +2142 -0
  23. package/cli/commands/cpu-profile.ts +269 -0
  24. package/cli/commands/daemon-mac-app.ts +169 -0
  25. package/cli/commands/daemon.ts +874 -0
  26. package/cli/commands/debug.ts +719 -0
  27. package/cli/commands/desktop.ts +39 -0
  28. package/cli/commands/detect.ts +197 -0
  29. package/cli/commands/detox.ts +385 -0
  30. package/cli/commands/device.ts +133 -0
  31. package/cli/commands/diagnose.ts +589 -0
  32. package/cli/commands/electron.ts +95 -0
  33. package/cli/commands/film.ts +379 -0
  34. package/cli/commands/flow.ts +1124 -0
  35. package/cli/commands/inspect/actions.ts +622 -0
  36. package/cli/commands/inspect/core.ts +2405 -0
  37. package/cli/commands/inspect/count.ts +17 -0
  38. package/cli/commands/inspect/describe.ts +192 -0
  39. package/cli/commands/inspect/env.ts +23 -0
  40. package/cli/commands/inspect/find.ts +171 -0
  41. package/cli/commands/inspect/get-layout.ts +39 -0
  42. package/cli/commands/inspect/keyboard.ts +52 -0
  43. package/cli/commands/inspect/list.ts +58 -0
  44. package/cli/commands/inspect/memory.ts +215 -0
  45. package/cli/commands/inspect/redaction.ts +39 -0
  46. package/cli/commands/inspect/resolve-target.ts +82 -0
  47. package/cli/commands/inspect/screens.ts +78 -0
  48. package/cli/commands/inspect/settle.ts +22 -0
  49. package/cli/commands/inspect/settling.ts +158 -0
  50. package/cli/commands/inspect/shared.ts +353 -0
  51. package/cli/commands/inspect/sleep.ts +14 -0
  52. package/cli/commands/inspect/tree.ts +32 -0
  53. package/cli/commands/inspect/url.ts +17 -0
  54. package/cli/commands/inspect/wait-event.ts +210 -0
  55. package/cli/commands/inspect/wait-idle.ts +24 -0
  56. package/cli/commands/inspect/wait-ready.ts +74 -0
  57. package/cli/commands/inspect/wait-selector.ts +54 -0
  58. package/cli/commands/inspect/wait.ts +31 -0
  59. package/cli/commands/inspect.ts +4519 -0
  60. package/cli/commands/install-desktop.ts +351 -0
  61. package/cli/commands/login.ts +331 -0
  62. package/cli/commands/logout.ts +31 -0
  63. package/cli/commands/maestro-generate.ts +361 -0
  64. package/cli/commands/maestro.ts +453 -0
  65. package/cli/commands/mode.ts +57 -0
  66. package/cli/commands/no-bridge-hint.ts +80 -0
  67. package/cli/commands/perf.ts +66 -0
  68. package/cli/commands/permissions.ts +203 -0
  69. package/cli/commands/profile.ts +108 -0
  70. package/cli/commands/react.ts +353 -0
  71. package/cli/commands/record.ts +1434 -0
  72. package/cli/commands/report-issue.ts +305 -0
  73. package/cli/commands/reset.ts +85 -0
  74. package/cli/commands/runtime.ts +351 -0
  75. package/cli/commands/screenshot-command.ts +106 -0
  76. package/cli/commands/screenshot-layers.ts +143 -0
  77. package/cli/commands/screenshot-mode.ts +37 -0
  78. package/cli/commands/screenshot.ts +488 -0
  79. package/cli/commands/screenshots-capture.ts +607 -0
  80. package/cli/commands/screenshots.ts +127 -0
  81. package/cli/commands/serve.ts +168 -0
  82. package/cli/commands/setup.ts +545 -0
  83. package/cli/commands/shell-boolean-mode.ts +81 -0
  84. package/cli/commands/skills.ts +467 -0
  85. package/cli/commands/slides.ts +361 -0
  86. package/cli/commands/state.ts +87 -0
  87. package/cli/commands/storage.ts +58 -0
  88. package/cli/commands/telemetry.ts +54 -0
  89. package/cli/commands/three-mode.ts +763 -0
  90. package/cli/commands/timeline.ts +122 -0
  91. package/cli/commands/upgrade.ts +208 -0
  92. package/cli/commands/upload.ts +1225 -0
  93. package/cli/commands/version.ts +54 -0
  94. package/cli/commands/what-happened.ts +327 -0
  95. package/cli/current-sim.ts +204 -0
  96. package/cli/desktop-companion.ts +300 -0
  97. package/cli/drivers/electron.ts +70 -0
  98. package/cli/drivers/index.ts +20 -0
  99. package/cli/drivers/playwright-provisioning.ts +180 -0
  100. package/cli/drivers/playwright.ts +698 -0
  101. package/cli/drivers/registry.ts +65 -0
  102. package/cli/drivers/types.ts +102 -0
  103. package/cli/flow-file.ts +142 -0
  104. package/cli/flow-live-status.ts +120 -0
  105. package/cli/flow-session.ts +187 -0
  106. package/cli/help.ts +80 -0
  107. package/cli/hidden-runtime-alias.ts +19 -0
  108. package/cli/hints.ts +216 -0
  109. package/cli/inspect-notice-state.ts +114 -0
  110. package/cli/maestro-js.ts +334 -0
  111. package/cli/open-url.ts +8 -0
  112. package/cli/parent-pid.ts +204 -0
  113. package/cli/parse-args.ts +211 -0
  114. package/cli/prompt.ts +51 -0
  115. package/cli/recording-access.ts +107 -0
  116. package/cli/registry.ts +1 -0
  117. package/cli/resolve-assets.ts +63 -0
  118. package/cli/run-registry.ts +226 -0
  119. package/cli/runtime-notes.ts +66 -0
  120. package/cli/runtime-summary.ts +25 -0
  121. package/cli/setup-repository.ts +187 -0
  122. package/cli/telemetry.ts +187 -0
  123. package/cli/ws-bridge.ts +798 -0
  124. package/dist-cli/bin.js +5 -5
  125. package/dist-cli/chunks/{agent-XZ2KTPCU.js → agent-CBU2WDKV.js} +2 -2
  126. package/dist-cli/chunks/{agent-wrapper-JJYYW2WH.js → agent-wrapper-UNB4R27L.js} +2 -2
  127. package/dist-cli/chunks/{app-fonts-IXRNQG6B.js → app-fonts-YMLRF3JD.js} +2 -2
  128. package/dist-cli/chunks/{assert-54T5SK5F.js → assert-5N6HUCL5.js} +2 -2
  129. package/dist-cli/chunks/{auth-FI5UDI45.js → auth-BHDR3A6G.js} +2 -2
  130. package/dist-cli/chunks/{beta-JV6UKADW.js → beta-LWUVCPYK.js} +2 -2
  131. package/dist-cli/chunks/camera-CNO6B2JZ.js +33 -0
  132. package/dist-cli/chunks/{chunk-ZMJD5GEC.js → chunk-25VCR44B.js} +1 -1
  133. package/dist-cli/chunks/{chunk-WUSWBCWA.js → chunk-26CSIR76.js} +8 -9
  134. package/dist-cli/chunks/{chunk-WINYQ44O.js → chunk-26WMWUH4.js} +1 -1
  135. package/dist-cli/chunks/{chunk-BTWORNNG.js → chunk-2JZ53D4A.js} +1 -1
  136. package/dist-cli/chunks/{chunk-DCEMHR2Y.js → chunk-2POODCTW.js} +2 -2
  137. package/dist-cli/chunks/{chunk-5TEF3ET3.js → chunk-4LTBK3ZN.js} +2 -2
  138. package/dist-cli/chunks/{chunk-NMF2ZMZQ.js → chunk-54MIRTFE.js} +4 -4
  139. package/dist-cli/chunks/{chunk-WEXDAC74.js → chunk-56H6EVO4.js} +2 -2
  140. package/dist-cli/chunks/{chunk-F5ZRSS3C.js → chunk-657SQG4D.js} +1 -1
  141. package/dist-cli/chunks/{chunk-IJ5CAZZC.js → chunk-6ZMRJPKI.js} +1 -1
  142. package/dist-cli/chunks/{chunk-W6K4EFPH.js → chunk-AOGGOC4V.js} +2 -2
  143. package/dist-cli/chunks/chunk-BPCDO7ST.js +15 -0
  144. package/dist-cli/chunks/{chunk-D4FFVGI5.js → chunk-C5O5CTXJ.js} +1 -1
  145. package/dist-cli/chunks/{chunk-RTN5C5RL.js → chunk-CMM64PPR.js} +1 -1
  146. package/dist-cli/chunks/{chunk-BBULZ7CG.js → chunk-D3M36D7O.js} +62 -87
  147. package/dist-cli/chunks/{chunk-5DHC6KHQ.js → chunk-DNCNFZ7V.js} +1 -1
  148. package/dist-cli/chunks/{chunk-YIFT42WN.js → chunk-FNTTIR2P.js} +2 -2
  149. package/dist-cli/chunks/chunk-H362IX2I.js +4 -0
  150. package/dist-cli/chunks/{chunk-IJO63TDP.js → chunk-J6HMTUZH.js} +2 -2
  151. package/dist-cli/chunks/{chunk-RSZWCKNT.js → chunk-JZ6VTZ5B.js} +3 -3
  152. package/dist-cli/chunks/{chunk-MJRLLB4R.js → chunk-KQSJVNFE.js} +4 -4
  153. package/dist-cli/chunks/chunk-L4JZKVCC.js +6 -0
  154. package/dist-cli/chunks/{chunk-VFCMSYZK.js → chunk-LP2BTEJ6.js} +2 -2
  155. package/dist-cli/chunks/{chunk-2YR5BGA5.js → chunk-LT6UC7I3.js} +2 -2
  156. package/dist-cli/chunks/{chunk-OVFJFXUD.js → chunk-MCKQH4AM.js} +2 -2
  157. package/dist-cli/chunks/{chunk-TZFFR3SD.js → chunk-MF7WUHQ3.js} +2 -2
  158. package/dist-cli/chunks/{chunk-46EUUFJ5.js → chunk-MSSY4EEZ.js} +1 -1
  159. package/dist-cli/chunks/{chunk-WMIIKMGK.js → chunk-N5ZCYP5F.js} +2 -2
  160. package/dist-cli/chunks/{chunk-3NV2NCNX.js → chunk-NCKAD3V7.js} +2 -2
  161. package/dist-cli/chunks/{chunk-VNQEB4L7.js → chunk-O2KRHVTU.js} +2 -2
  162. package/dist-cli/chunks/{chunk-OZSSI4WN.js → chunk-OF2HTH25.js} +2 -2
  163. package/dist-cli/chunks/{chunk-GGRX24GF.js → chunk-OXS2IWO2.js} +2 -2
  164. package/dist-cli/chunks/{chunk-WWZIXIRD.js → chunk-PVL7XSPN.js} +1 -1
  165. package/dist-cli/chunks/{chunk-DZS6WPUI.js → chunk-PVPAP3TV.js} +1 -1
  166. package/dist-cli/chunks/{chunk-5YJCOWCH.js → chunk-PXNAZYGV.js} +1 -1
  167. package/dist-cli/chunks/chunk-QR3HTFRB.js +5 -0
  168. package/dist-cli/chunks/{chunk-5TPRP5QT.js → chunk-QR7MWAWE.js} +1 -1
  169. package/dist-cli/chunks/chunk-RJIEZ2NY.js +4 -0
  170. package/dist-cli/chunks/{chunk-UC6U3MML.js → chunk-RVM4EZ4E.js} +2 -2
  171. package/dist-cli/chunks/{chunk-2D2UPBBR.js → chunk-SZKSFMWS.js} +1 -1
  172. package/dist-cli/chunks/{chunk-7GN3LVWB.js → chunk-TEL7G234.js} +2 -2
  173. package/dist-cli/chunks/{chunk-GASE6UBA.js → chunk-U2HNIHBY.js} +1 -1
  174. package/dist-cli/chunks/chunk-UROXJVY3.js +27 -0
  175. package/dist-cli/chunks/{chunk-HI5TFJWN.js → chunk-WM32MGTJ.js} +2 -2
  176. package/dist-cli/chunks/{chunk-VZXWHRUZ.js → chunk-WMZ7NJAO.js} +89 -133
  177. package/dist-cli/chunks/{chunk-XEVZYVIW.js → chunk-WUXCH6WN.js} +10 -9
  178. package/dist-cli/chunks/chunk-XOXGC3EH.js +9 -0
  179. package/dist-cli/chunks/chunk-XSSHENNY.js +4 -0
  180. package/dist-cli/chunks/{chunk-OHAZNXLK.js → chunk-XZ6O67AR.js} +1 -1
  181. package/dist-cli/chunks/{chunk-QKDWYITG.js → chunk-Y2MWQKOS.js} +3 -3
  182. package/dist-cli/chunks/{chunk-YDGQTMQL.js → chunk-YY24QI25.js} +1 -1
  183. package/dist-cli/chunks/{chunk-WF3T4SVI.js → chunk-ZWX6DDIS.js} +2 -2
  184. package/dist-cli/chunks/{cleanup-P27PA6JI.js → cleanup-F3NUJ3SL.js} +2 -2
  185. package/dist-cli/chunks/cli-version-XIW6O3FG.js +4 -0
  186. package/dist-cli/chunks/{compat-ZD65FED3.js → compat-AX2SEPTH.js} +2 -2
  187. package/dist-cli/chunks/{config-XMJRNM2A.js → config-4QQO5JVU.js} +2 -2
  188. package/dist-cli/chunks/{control-KMIQT3QP.js → control-OCKKSOWA.js} +2 -2
  189. package/dist-cli/chunks/daemon-N5VLMYKQ.js +4 -0
  190. package/dist-cli/chunks/{debug-PT4HOP7N.js → debug-T6MWVEVX.js} +5 -5
  191. package/dist-cli/chunks/{desktop-S3FG72AK.js → desktop-NCW7R7CB.js} +3 -3
  192. package/dist-cli/chunks/{detox-B3D4IFCN.js → detox-G6GITO2X.js} +2 -2
  193. package/dist-cli/chunks/{device-XBNDSB2R.js → device-7BTEJCTH.js} +2 -2
  194. package/dist-cli/chunks/{diagnose-HMQXJE5N.js → diagnose-SC5LACE3.js} +2 -2
  195. package/dist-cli/chunks/{disk-cleanup-BLCZ5BSZ.js → disk-cleanup-KK56QQZA.js} +2 -2
  196. package/dist-cli/chunks/drivers-NPGVBWMG.js +4 -0
  197. package/dist-cli/chunks/{film-BJGTBYZB.js → film-WGYEHGIA.js} +3 -3
  198. package/dist-cli/chunks/flow-KQBIBM3N.js +4 -0
  199. package/dist-cli/chunks/help-G7CAKI65.js +4 -0
  200. package/dist-cli/chunks/{hidden-runtime-alias-ANOYADHM.js → hidden-runtime-alias-CWTZWH3L.js} +2 -2
  201. package/dist-cli/chunks/home-paths-EBT4XHAS.js +4 -0
  202. package/dist-cli/chunks/inspect-CCPZXVDU.js +4 -0
  203. package/dist-cli/chunks/install-desktop-NZ3VGTQZ.js +4 -0
  204. package/dist-cli/chunks/{login-FJ737MWG.js → login-GSYOTGVQ.js} +4 -4
  205. package/dist-cli/chunks/{logout-ZCNMMHMY.js → logout-JPRIR7YK.js} +2 -2
  206. package/dist-cli/chunks/{maestro-SZTNKLDF.js → maestro-LXKDNO5M.js} +3 -3
  207. package/dist-cli/chunks/{maestro-generate-DCFAIZ4H.js → maestro-generate-5ZIKOU53.js} +3 -3
  208. package/dist-cli/chunks/{mode-GRMQCRXR.js → mode-N3QHXCES.js} +2 -2
  209. package/dist-cli/chunks/{optional-demo-registry-W36EWFFB.js → optional-demo-registry-XDH6X24N.js} +2 -2
  210. package/dist-cli/chunks/{perf-QYBAAUZG.js → perf-VOPL26FM.js} +2 -2
  211. package/dist-cli/chunks/{permissions-3QCQ6VF4.js → permissions-CZFKM4UD.js} +2 -2
  212. package/dist-cli/chunks/{record-QPPC2S4E.js → record-FODSOGMA.js} +3 -3
  213. package/dist-cli/chunks/{report-issue-7NMFP4HK.js → report-issue-FBPCZKOV.js} +2 -2
  214. package/dist-cli/chunks/reset-3H35GFO3.js +4 -0
  215. package/dist-cli/chunks/runtime-4OVFRXV5.js +4 -0
  216. package/dist-cli/chunks/{screenshot-command-67AECJFB.js → screenshot-command-7S3FYVO7.js} +7 -7
  217. package/dist-cli/chunks/{screenshot-layers-ASWBYPJL.js → screenshot-layers-CDYHPNC3.js} +3 -3
  218. package/dist-cli/chunks/{screenshots-capture-PXA3HFQK.js → screenshots-capture-EBIIY2YU.js} +2 -2
  219. package/dist-cli/chunks/serve-NELNSCZP.js +44 -0
  220. package/dist-cli/chunks/{setup-7DWPMRSB.js → setup-DF5ZDDIV.js} +2 -2
  221. package/dist-cli/chunks/{skills-S3Y22TUA.js → skills-E2QZF6WZ.js} +2 -2
  222. package/dist-cli/chunks/state-MBZDKZ7U.js +14 -0
  223. package/dist-cli/chunks/{storage-XUIMJWAJ.js → storage-J5BMNVXM.js} +6 -6
  224. package/dist-cli/chunks/store-U3DXC7HH.js +4 -0
  225. package/dist-cli/chunks/telemetry-XIPJVT5E.js +4 -0
  226. package/dist-cli/chunks/{timeline-TMPLQPSP.js → timeline-MC6N5BHY.js} +2 -2
  227. package/dist-cli/chunks/{upgrade-7HDSIM7K.js → upgrade-7UTU53DH.js} +2 -2
  228. package/dist-cli/chunks/upload-2M2KOTYI.js +4 -0
  229. package/dist-cli/chunks/version-VNACNYQK.js +6 -0
  230. package/dist-cli/chunks/{web-DG3WBYD3.js → web-MGJ2TUKR.js} +2 -2
  231. package/dist-cli/chunks/{what-happened-XFVUTZR7.js → what-happened-7DLKH3OD.js} +3 -3
  232. package/dist-lib/agent-daemon-client.cjs +1 -1
  233. package/dist-lib/agent-events.cjs +1 -1
  234. package/dist-lib/agent-identity.cjs +1 -1
  235. package/dist-lib/agent-sessions.cjs +1 -1
  236. package/dist-lib/attached-projects.cjs +1 -1
  237. package/dist-lib/auth/shared-session.cjs +1 -1
  238. package/dist-lib/backend-origin.cjs +1 -1
  239. package/dist-lib/beta.cjs +1 -1
  240. package/dist-lib/beta.mjs +1 -1
  241. package/dist-lib/bridge-constants.cjs +1 -1
  242. package/dist-lib/bridge-contract.cjs +20 -0
  243. package/dist-lib/cli-constants.cjs +1 -1
  244. package/dist-lib/config.cjs +1 -1
  245. package/dist-lib/detox/index.cjs +1 -1
  246. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  247. package/dist-lib/home-paths.cjs +67 -28
  248. package/dist-lib/host/bridge-host.cjs +140 -12
  249. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  250. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  251. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  252. package/dist-lib/host/websocket-proxy.cjs +1 -1
  253. package/dist-lib/index.cjs +2815 -40
  254. package/dist-lib/jump-to-source-babel.cjs +1 -1
  255. package/dist-lib/menu.cjs +1 -1
  256. package/dist-lib/menu.mjs +1 -1
  257. package/dist-lib/metro.cjs +1 -1
  258. package/dist-lib/profiles.cjs +1 -1
  259. package/dist-lib/public-brand.cjs +1 -1
  260. package/dist-lib/render-mode.cjs +1 -1
  261. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  262. package/dist-lib/sdk.cjs +2549 -2061
  263. package/dist-lib/sdk.mjs +2543 -2061
  264. package/dist-lib/skills.cjs +480 -280
  265. package/dist-lib/vite.cjs +1 -1
  266. package/package.json +8 -2
  267. package/src/bridge-constants.ts +3 -4
  268. package/src/bridge-contract.ts +251 -0
  269. package/src/connect.ts +83 -0
  270. package/src/disk-cleanup.ts +30 -0
  271. package/src/home-paths.ts +81 -38
  272. package/src/host/bridge-host.ts +134 -6
  273. package/src/index.ts +27 -1
  274. package/src/sdk.ts +8 -0
  275. package/src/sim-client.ts +660 -0
  276. package/dist-cli/chunks/camera-VL73YIKP.js +0 -22
  277. package/dist-cli/chunks/chunk-4NPPOV2N.js +0 -5
  278. package/dist-cli/chunks/chunk-FSUYIVJ6.js +0 -9
  279. package/dist-cli/chunks/chunk-G2WW6L2C.js +0 -23
  280. package/dist-cli/chunks/chunk-KTHV3RUS.js +0 -26
  281. package/dist-cli/chunks/chunk-LF2ZVT7O.js +0 -6
  282. package/dist-cli/chunks/chunk-NFK7T35W.js +0 -4
  283. package/dist-cli/chunks/chunk-TIVZIMMW.js +0 -4
  284. package/dist-cli/chunks/cli-version-WWLPBDQ7.js +0 -4
  285. package/dist-cli/chunks/daemon-G2ME7NLB.js +0 -4
  286. package/dist-cli/chunks/drivers-LDECZGP2.js +0 -4
  287. package/dist-cli/chunks/flow-UEQNVTU7.js +0 -4
  288. package/dist-cli/chunks/help-T5FYSVGB.js +0 -4
  289. package/dist-cli/chunks/home-paths-GT3LFNOR.js +0 -4
  290. package/dist-cli/chunks/inspect-ZA6XF5LD.js +0 -4
  291. package/dist-cli/chunks/install-desktop-TIMUDHPL.js +0 -4
  292. package/dist-cli/chunks/runtime-XOAXMSTU.js +0 -4
  293. package/dist-cli/chunks/serve-BI2NBAXG.js +0 -44
  294. package/dist-cli/chunks/store-JTHEJLAZ.js +0 -4
  295. package/dist-cli/chunks/telemetry-ZYJGD2DB.js +0 -4
  296. package/dist-cli/chunks/upload-GMSZPWM6.js +0 -4
  297. package/dist-cli/chunks/version-HOCHZ37L.js +0 -6
@@ -27,6 +27,7 @@ import {
27
27
  writeDevBridgeLockfile,
28
28
  writeRuntimeUpgradeNotice,
29
29
  writeSharedConfig,
30
+ cameraFixturesDir,
30
31
  sootsimHomeDir,
31
32
  type DaemonLockfile,
32
33
  type DevBridgeLockfile,
@@ -173,7 +174,14 @@ interface BridgeCliLease {
173
174
  // `call` used to acquire a lease too, but most call paths are queries
174
175
  // (`__sootsimTest.findByTestId`, state reads, etc.). the CLI opts write
175
176
  // calls into lease acquisition via msg.acquireLock=true.
176
- const WRITE_COMMAND_TYPES = new Set(['tap', 'keyboard'])
177
+ const WRITE_COMMAND_TYPES = new Set([
178
+ 'tap',
179
+ 'keyboard',
180
+ 'longPress',
181
+ 'perform',
182
+ 'reset',
183
+ 'camera',
184
+ ])
177
185
 
178
186
  // how long a `close` waits for the sim page to tear itself down before the
179
187
  // host disconnects the sim socket. the close code is part of the protocol:
@@ -227,10 +235,11 @@ export interface BridgeHostOptions {
227
235
  * anything embedded should leave it off to avoid clobbering a real
228
236
  * daemon's lockfile. defaults to false. */
229
237
  writeLockfile?: boolean
230
- /** when true, write ~/.sootsim/dev-bridge.json on successful bind + update
231
- * it on a heartbeat interval + remove it on close. the Vite dev shell sets
232
- * this so local CLI commands prefer the live source bridge over a standalone
233
- * daemon or stale default-port listener. */
238
+ /** when true, write an owner-scoped record under ~/.sootsim/dev-bridges on
239
+ * successful bind, update it on a heartbeat interval, and remove only that
240
+ * record on close. the Vite dev shell sets this so local CLI commands can
241
+ * address every live source bridge without concurrent worktrees replacing
242
+ * one shared pointer. */
234
243
  writeDevLockfile?: boolean
235
244
  /** resolve the http port of the vite shell dev server that hosts this
236
245
  * bridge (e.g. 5173). called on every dev-lockfile write so the port
@@ -291,8 +300,21 @@ const HTTP_MIME_TYPES: Record<string, string> = {
291
300
  '.woff2': 'font/woff2',
292
301
  '.map': 'application/json',
293
302
  '.txt': 'text/plain; charset=utf-8',
303
+ '.mp4': 'video/mp4',
304
+ '.m4v': 'video/mp4',
305
+ '.webm': 'video/webm',
306
+ '.mov': 'video/quicktime',
294
307
  }
295
308
 
309
+ // `rnxsim camera play` stages a video under ~/.sootsim/camera-fixtures and the
310
+ // simulator plays it as the camera feed. the route below serves that one
311
+ // directory, addressed by basename only.
312
+ const CAMERA_FIXTURE_ROUTE = '/__camera-fixtures/'
313
+ // no slashes, no dots leading a segment, no traversal to express. a name that
314
+ // does not match is rejected rather than normalized, so there is nothing to
315
+ // get the normalization wrong about.
316
+ const CAMERA_FIXTURE_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/
317
+
296
318
  /** inject host-provided globals into the served runtime html:
297
319
  * - `window.__sootsimSharedConfig` — parsed `~/.sootsim/config.json`,
298
320
  * read during engine settingsStore module init (see
@@ -1259,6 +1281,96 @@ export class SootSimBridgeHost {
1259
1281
  return this.inflightScan
1260
1282
  }
1261
1283
 
1284
+ // serves one staged camera fixture. addressed by basename inside
1285
+ // ~/.sootsim/camera-fixtures, never by a caller-supplied path, so there is
1286
+ // no traversal surface to defend: a name that is not a plain basename is
1287
+ // rejected outright. range support is not optional here — chrome asks for
1288
+ // byte ranges on media and cannot seek or loop a fixture without it.
1289
+ private handleCameraFixture(name: string, req: IncomingMessage, res: ServerResponse) {
1290
+ const method = (req.method || 'GET').toUpperCase()
1291
+ const cors = {
1292
+ 'Access-Control-Allow-Origin': '*',
1293
+ 'Cache-Control': 'no-store',
1294
+ }
1295
+ if (method === 'OPTIONS') {
1296
+ res.writeHead(204, {
1297
+ ...cors,
1298
+ 'Access-Control-Allow-Methods': 'GET, HEAD, OPTIONS',
1299
+ 'Access-Control-Allow-Headers': 'range',
1300
+ })
1301
+ res.end()
1302
+ return
1303
+ }
1304
+ if (method !== 'GET' && method !== 'HEAD') {
1305
+ res.writeHead(405, cors)
1306
+ res.end()
1307
+ return
1308
+ }
1309
+ if (!CAMERA_FIXTURE_NAME_RE.test(name)) {
1310
+ res.writeHead(400, { ...cors, 'Content-Type': 'text/plain; charset=utf-8' })
1311
+ res.end('bad fixture name')
1312
+ return
1313
+ }
1314
+
1315
+ const root = cameraFixturesDir()
1316
+ const filePath = path.join(root, name)
1317
+ let stats: fs.Stats
1318
+ try {
1319
+ // a symlink dropped into the fixtures dir is the one way out of it.
1320
+ // lstat rather than stat so a link is refused instead of followed.
1321
+ stats = fs.lstatSync(filePath)
1322
+ } catch {
1323
+ res.writeHead(404, { ...cors, 'Content-Type': 'text/plain; charset=utf-8' })
1324
+ res.end('not found')
1325
+ return
1326
+ }
1327
+ if (!stats.isFile()) {
1328
+ res.writeHead(403, { ...cors, 'Content-Type': 'text/plain; charset=utf-8' })
1329
+ res.end('forbidden')
1330
+ return
1331
+ }
1332
+
1333
+ const contentType =
1334
+ HTTP_MIME_TYPES[path.extname(filePath).toLowerCase()] || 'application/octet-stream'
1335
+ const total = stats.size
1336
+ const range = /^bytes=(\d*)-(\d*)$/.exec(req.headers.range || '')
1337
+ if (range) {
1338
+ const [, startRaw, endRaw] = range
1339
+ const start = startRaw ? Number(startRaw) : 0
1340
+ const end = endRaw ? Math.min(Number(endRaw), total - 1) : total - 1
1341
+ if (!Number.isFinite(start) || start > end || start >= total) {
1342
+ res.writeHead(416, { ...cors, 'Content-Range': `bytes */${total}` })
1343
+ res.end()
1344
+ return
1345
+ }
1346
+ res.writeHead(206, {
1347
+ ...cors,
1348
+ 'Content-Type': contentType,
1349
+ 'Content-Range': `bytes ${start}-${end}/${total}`,
1350
+ 'Accept-Ranges': 'bytes',
1351
+ 'Content-Length': String(end - start + 1),
1352
+ })
1353
+ if (method === 'HEAD') {
1354
+ res.end()
1355
+ return
1356
+ }
1357
+ fs.createReadStream(filePath, { start, end }).pipe(res)
1358
+ return
1359
+ }
1360
+
1361
+ res.writeHead(200, {
1362
+ ...cors,
1363
+ 'Content-Type': contentType,
1364
+ 'Accept-Ranges': 'bytes',
1365
+ 'Content-Length': String(total),
1366
+ })
1367
+ if (method === 'HEAD') {
1368
+ res.end()
1369
+ return
1370
+ }
1371
+ fs.createReadStream(filePath).pipe(res)
1372
+ }
1373
+
1262
1374
  private handleServerScan(res: ServerResponse) {
1263
1375
  const sendJson = (body: DiscoveredServer[]) => {
1264
1376
  res.writeHead(200, {
@@ -1522,6 +1634,18 @@ export class SootSimBridgeHost {
1522
1634
  return
1523
1635
  }
1524
1636
 
1637
+ // /__camera-fixtures/<name> — the staged video behind `rnxsim camera play`.
1638
+ // the shell page is a different origin from this daemon (vite dev on 5173,
1639
+ // daemon on 7668+), and the camera pipeline draws the <video> to a canvas
1640
+ // and reads it back, so this needs real CORS or the canvas taints and
1641
+ // createImageBitmap throws. it sits above the read-only guard below
1642
+ // because it answers its own OPTIONS preflight with the CORS headers that
1643
+ // guard's bare 405 would omit.
1644
+ if (url.pathname.startsWith(CAMERA_FIXTURE_ROUTE)) {
1645
+ this.handleCameraFixture(url.pathname.slice(CAMERA_FIXTURE_ROUTE.length), req, res)
1646
+ return
1647
+ }
1648
+
1525
1649
  // every other daemon route is read-only unless its owning proxy handled
1526
1650
  // the mutation above.
1527
1651
  if (method !== 'GET' && method !== 'HEAD') {
@@ -2101,7 +2225,11 @@ export class SootSimBridgeHost {
2101
2225
  }
2102
2226
  if (this.shouldWriteDevLockfile) {
2103
2227
  try {
2104
- removeDevBridgeLockfile()
2228
+ removeDevBridgeLockfile({
2229
+ bridgePort: this.effectivePort,
2230
+ pid: process.pid,
2231
+ startedAt: this.startedAt,
2232
+ })
2105
2233
  } catch {}
2106
2234
  }
2107
2235
  this.effectivePort = 0
package/src/index.ts CHANGED
@@ -1,8 +1,34 @@
1
- // sootsim public package — CLI + framework integrations.
1
+ // sootsim public package — SDK client, CLI + framework integrations.
2
2
  //
3
3
  // the bridge client and plugins live here. the canvas rendering engine lives
4
4
  // in the private `sootsim-engine` workspace package.
5
5
 
6
+ export { connect, type ConnectOptions } from './connect'
7
+ export {
8
+ SimClient,
9
+ SimClientError,
10
+ SimConnectError,
11
+ SimKeyboardError,
12
+ SimPerformError,
13
+ SimReadyTimeoutError,
14
+ SimResetError,
15
+ SimTapError,
16
+ type SimClientOptions,
17
+ type SimFindOptions,
18
+ type SimPerformStep,
19
+ type SimScreenshot,
20
+ type SimTapTarget,
21
+ } from './sim-client'
22
+ export type {
23
+ PerformOptions,
24
+ PerformResult,
25
+ PerformStep,
26
+ ResetOptions,
27
+ ResetResult,
28
+ SimStateOptions,
29
+ SimStateResult,
30
+ } from './bridge-contract'
31
+
6
32
  export { sootsimPlugin } from './vite-plugin-one'
7
33
  export { default as metroPlugin } from './metro-plugin'
8
34
  export { default as jumpToSourceBabelPlugin } from './jump-to-source-babel'
package/src/sdk.ts CHANGED
@@ -1,3 +1,11 @@
1
+ // rnxsim/sdk — the scriptable sim-driving surface.
2
+ //
3
+ // exports the SimClient class plus the transport-agnostic inspect verbs it is
4
+ // built from. this entry MUST stay browser-safe (Contrast's in-browser agent
5
+ // imports it against an in-process preview bridge), so the node-only ws
6
+ // `connect()` lives on the ROOT `rnxsim` entry, not here.
7
+
8
+ export * from './sim-client'
1
9
  export * from '../cli/commands/inspect/core'
2
10
  export * from '../cli/commands/inspect/actions'
3
11
  export { waitForSootsimIdle } from '../cli/commands/inspect/settling'