rnxsim 0.1.376 → 0.1.377

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 (295) hide show
  1. package/README.md +28 -25
  2. package/cli/app-config.ts +9 -12
  3. package/cli/app-fonts.ts +3 -3
  4. package/cli/app-project.ts +8 -8
  5. package/cli/auth.ts +7 -9
  6. package/cli/bin.ts +16 -31
  7. package/cli/bridge-flow-runner.ts +3 -3
  8. package/cli/browser-backend.ts +44 -0
  9. package/cli/command-contract.ts +221 -0
  10. package/cli/command-registry.ts +291 -0
  11. package/cli/commands/agent-wrapper.ts +2 -2
  12. package/cli/commands/app-fonts.ts +2 -2
  13. package/cli/commands/assert.ts +3 -3
  14. package/cli/commands/auth.ts +1 -1
  15. package/cli/commands/box/cloud-box.ts +1 -1
  16. package/cli/commands/box/plane-share.ts +2 -2
  17. package/cli/commands/box.ts +4 -6
  18. package/cli/commands/compat.ts +1 -1
  19. package/cli/commands/config.ts +2 -2
  20. package/cli/commands/control.ts +29 -29
  21. package/cli/commands/cpu-profile.ts +7 -7
  22. package/cli/commands/daemon-mac-app.ts +7 -7
  23. package/cli/commands/daemon.ts +10 -10
  24. package/cli/commands/debug.ts +11 -11
  25. package/cli/commands/detox.ts +13 -13
  26. package/cli/commands/diagnose.ts +6 -6
  27. package/cli/commands/do-chain.ts +1 -2
  28. package/cli/commands/electron.ts +1 -3
  29. package/cli/commands/film.ts +3 -3
  30. package/cli/commands/flow.ts +43 -43
  31. package/cli/commands/inspect/count.ts +1 -1
  32. package/cli/commands/inspect/describe.ts +1 -1
  33. package/cli/commands/inspect/env.ts +2 -2
  34. package/cli/commands/inspect/get-layout.ts +1 -1
  35. package/cli/commands/inspect/keyboard.ts +1 -1
  36. package/cli/commands/inspect/list.ts +1 -1
  37. package/cli/commands/inspect/memory.ts +1 -1
  38. package/cli/commands/inspect/resolve-target.ts +1 -1
  39. package/cli/commands/inspect/screens.ts +1 -1
  40. package/cli/commands/inspect/tree.ts +1 -1
  41. package/cli/commands/inspect/url.ts +1 -1
  42. package/cli/commands/inspect/wait-event.ts +5 -5
  43. package/cli/commands/inspect.ts +34 -34
  44. package/cli/commands/install-desktop.ts +3 -3
  45. package/cli/commands/login.ts +6 -6
  46. package/cli/commands/maestro-generate.ts +5 -5
  47. package/cli/commands/maestro.ts +5 -5
  48. package/cli/commands/profile.ts +1 -1
  49. package/cli/commands/record.ts +9 -9
  50. package/cli/commands/runtime.ts +18 -18
  51. package/cli/commands/screenshot-command.ts +1 -1
  52. package/cli/commands/screenshot-layers.ts +5 -5
  53. package/cli/commands/screenshot-mode.ts +1 -1
  54. package/cli/commands/screenshot.ts +8 -8
  55. package/cli/commands/screenshots-capture.ts +5 -5
  56. package/cli/commands/serve.ts +3 -3
  57. package/cli/commands/setup.ts +20 -12
  58. package/cli/commands/skills.ts +5 -5
  59. package/cli/commands/slides.ts +1 -1
  60. package/cli/commands/telemetry.ts +1 -1
  61. package/cli/commands/three-mode.ts +1 -1
  62. package/cli/commands/timeline.ts +8 -8
  63. package/cli/commands/upgrade.ts +116 -131
  64. package/cli/commands/upload.ts +12 -12
  65. package/cli/commands/version.ts +7 -7
  66. package/cli/commands/what-happened.ts +9 -9
  67. package/cli/current-sim.ts +3 -3
  68. package/cli/desktop-companion.ts +1 -1
  69. package/cli/drivers/playwright.ts +9 -9
  70. package/cli/drivers/registry.ts +1 -1
  71. package/cli/drivers/types.ts +1 -1
  72. package/cli/flow-file.ts +2 -2
  73. package/cli/flow-session.ts +1 -1
  74. package/cli/help-core.ts +136 -0
  75. package/cli/help.ts +17 -53
  76. package/cli/hints.ts +5 -5
  77. package/cli/inspect-notice-state.ts +1 -1
  78. package/cli/maestro-js.ts +1 -1
  79. package/cli/outbound-endpoints.ts +23 -5
  80. package/cli/parse-args.ts +19 -66
  81. package/cli/recording-access.ts +1 -1
  82. package/cli/registry.ts +1 -0
  83. package/cli/run-registry.ts +1 -1
  84. package/cli/run-rnx-core.ts +148 -0
  85. package/cli/run-rnx.ts +6 -9
  86. package/cli/runtime-notes.ts +3 -3
  87. package/cli/standalone.ts +4 -0
  88. package/cli/ws-bridge.ts +8 -8
  89. package/detox/config-loader.ts +2 -2
  90. package/detox/index.ts +8 -8
  91. package/detox/jest-preset.cjs +1 -1
  92. package/detox/navigation.ts +2 -2
  93. package/dist-lib/agent-daemon-client.cjs +5 -5
  94. package/dist-lib/agent-events.cjs +1 -1
  95. package/dist-lib/agent-identity.cjs +2 -2
  96. package/dist-lib/agent-sessions.cjs +10 -10
  97. package/dist-lib/attached-projects.cjs +6 -6
  98. package/dist-lib/auth/shared-session.cjs +6 -6
  99. package/dist-lib/backend-origin.cjs +1 -1
  100. package/dist-lib/beta.cjs +1 -1
  101. package/dist-lib/beta.mjs +1 -1
  102. package/dist-lib/bridge-constants.cjs +1 -1
  103. package/dist-lib/bridge-contract-input.cjs +1 -1
  104. package/dist-lib/bridge-contract-input.mjs +1 -1
  105. package/dist-lib/bridge-contract.cjs +1 -1
  106. package/dist-lib/bridge-contract.mjs +1 -1
  107. package/dist-lib/cli-constants.cjs +1 -1
  108. package/dist-lib/config.cjs +25 -25
  109. package/dist-lib/detox/index.cjs +9 -9
  110. package/dist-lib/detox/jest-preset.cjs +1 -1
  111. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  112. package/dist-lib/home-paths.cjs +29 -29
  113. package/dist-lib/host/bridge-host.cjs +128 -49
  114. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  115. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  116. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  117. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  118. package/dist-lib/host/websocket-proxy.cjs +1 -1
  119. package/dist-lib/index.cjs +14 -14
  120. package/dist-lib/jump-to-source-babel.cjs +1 -1
  121. package/dist-lib/menu.cjs +1 -1
  122. package/dist-lib/menu.mjs +1 -1
  123. package/dist-lib/metro-production-bundle.cjs +1 -1
  124. package/dist-lib/metro-production-bundle.mjs +1 -1
  125. package/dist-lib/metro.cjs +8 -8
  126. package/dist-lib/profiles.cjs +12 -12
  127. package/dist-lib/public-brand.cjs +1 -1
  128. package/dist-lib/react-native-host-modules.cjs +1 -1
  129. package/dist-lib/react-native-host-modules.mjs +1 -1
  130. package/dist-lib/render-mode.cjs +1 -1
  131. package/dist-lib/scripts/dev-server-scanner.cjs +8 -8
  132. package/dist-lib/sdk.cjs +1 -1
  133. package/dist-lib/sdk.mjs +1 -1
  134. package/dist-lib/skills.cjs +262 -135
  135. package/dist-lib/vite.cjs +9 -9
  136. package/package.json +4 -11
  137. package/scripts/dev-server-scanner.ts +2 -2
  138. package/scripts/optional-demo-registry.ts +1 -1
  139. package/skills/contrast/SKILL.md +3 -3
  140. package/skills/rnx-debug/SKILL.md +1 -1
  141. package/skills/rnx-test/SKILL.md +2 -2
  142. package/src/agent-identity.ts +1 -1
  143. package/src/agent-sessions.ts +7 -5
  144. package/src/cli-version.ts +12 -4
  145. package/src/config.ts +26 -28
  146. package/src/disk-cleanup.ts +11 -11
  147. package/src/home-paths.ts +28 -28
  148. package/src/host/bridge-host.ts +16 -16
  149. package/src/metro-plugin.ts +2 -2
  150. package/src/profiles.ts +2 -2
  151. package/src/runtime-assets.ts +7 -7
  152. package/src/runtime-delivery.ts +13 -13
  153. package/src/screenshots/orchestrate.ts +1 -1
  154. package/src/screenshots/schema.ts +2 -2
  155. package/src/skills/builtin/a11y-review.ts +2 -2
  156. package/src/skills/builtin/compat-check.ts +2 -2
  157. package/src/skills/builtin/maestro-test.ts +2 -2
  158. package/src/skills/builtin/perf-profile.ts +2 -2
  159. package/src/skills/builtin/screenshot-all.ts +2 -2
  160. package/src/skills/builtin/visual-diff.ts +2 -2
  161. package/src/skills/registry.ts +8 -8
  162. package/src/skills/types.ts +1 -1
  163. package/src/vite-plugin-one.ts +3 -3
  164. package/src/vite-plugin.ts +15 -2
  165. package/dist-cli/bin.js +0 -15
  166. package/dist-cli/chunks/agent-H42FCKFF.js +0 -48
  167. package/dist-cli/chunks/agent-wrapper-BBZKTZS6.js +0 -17
  168. package/dist-cli/chunks/app-fonts-43VXIKF4.js +0 -4
  169. package/dist-cli/chunks/assert-IXOLVO5Z.js +0 -49
  170. package/dist-cli/chunks/auth-KFMFB6FU.js +0 -12
  171. package/dist-cli/chunks/beta-5AO3SJB7.js +0 -4
  172. package/dist-cli/chunks/box-ZHM66L6K.js +0 -1730
  173. package/dist-cli/chunks/camera-FNJVFCDQ.js +0 -33
  174. package/dist-cli/chunks/chunk-37MCSPTE.js +0 -71
  175. package/dist-cli/chunks/chunk-3PEMSUAQ.js +0 -30
  176. package/dist-cli/chunks/chunk-4TQ5HOK3.js +0 -7
  177. package/dist-cli/chunks/chunk-5YZYDEMI.js +0 -4
  178. package/dist-cli/chunks/chunk-6CV3R3XD.js +0 -15
  179. package/dist-cli/chunks/chunk-7LGK5XU6.js +0 -4
  180. package/dist-cli/chunks/chunk-7R2TK2NY.js +0 -4
  181. package/dist-cli/chunks/chunk-7VZZQQEE.js +0 -497
  182. package/dist-cli/chunks/chunk-AFOVILIL.js +0 -130
  183. package/dist-cli/chunks/chunk-BEU7CD7E.js +0 -9
  184. package/dist-cli/chunks/chunk-CE4JQJ6Y.js +0 -6
  185. package/dist-cli/chunks/chunk-CIE6CZXL.js +0 -142
  186. package/dist-cli/chunks/chunk-CSJ7L7ZL.js +0 -312
  187. package/dist-cli/chunks/chunk-CWCQP53A.js +0 -27
  188. package/dist-cli/chunks/chunk-DCS5FK5N.js +0 -7
  189. package/dist-cli/chunks/chunk-DEV3E3MV.js +0 -4
  190. package/dist-cli/chunks/chunk-DGJMIVZM.js +0 -5
  191. package/dist-cli/chunks/chunk-DGX3MN65.js +0 -5
  192. package/dist-cli/chunks/chunk-DNPQMTW5.js +0 -4
  193. package/dist-cli/chunks/chunk-DOVBJBVD.js +0 -5
  194. package/dist-cli/chunks/chunk-DPBJ3S3J.js +0 -3
  195. package/dist-cli/chunks/chunk-FVZBGPCU.js +0 -4
  196. package/dist-cli/chunks/chunk-GDKMOIUT.js +0 -4
  197. package/dist-cli/chunks/chunk-GIF2NJCS.js +0 -32
  198. package/dist-cli/chunks/chunk-GZE57ORL.js +0 -4
  199. package/dist-cli/chunks/chunk-H3U56DKI.js +0 -24
  200. package/dist-cli/chunks/chunk-HZLOYAPH.js +0 -4
  201. package/dist-cli/chunks/chunk-J2IKAEU2.js +0 -4
  202. package/dist-cli/chunks/chunk-JXAXYK7W.js +0 -11
  203. package/dist-cli/chunks/chunk-KJE2O2GK.js +0 -4
  204. package/dist-cli/chunks/chunk-KMNVDZZI.js +0 -423
  205. package/dist-cli/chunks/chunk-LC3QRIRB.js +0 -10
  206. package/dist-cli/chunks/chunk-LGFTAQYC.js +0 -4
  207. package/dist-cli/chunks/chunk-LQMUA5IY.js +0 -4
  208. package/dist-cli/chunks/chunk-MFIQTWC5.js +0 -4
  209. package/dist-cli/chunks/chunk-MGALNF2F.js +0 -7
  210. package/dist-cli/chunks/chunk-MLBZZHOY.js +0 -4
  211. package/dist-cli/chunks/chunk-NNRF7GIB.js +0 -107
  212. package/dist-cli/chunks/chunk-NORLYTTO.js +0 -7
  213. package/dist-cli/chunks/chunk-P6KVGV3H.js +0 -14
  214. package/dist-cli/chunks/chunk-PAJTUK33.js +0 -4
  215. package/dist-cli/chunks/chunk-QELIC5XP.js +0 -4
  216. package/dist-cli/chunks/chunk-QRDF33WD.js +0 -11
  217. package/dist-cli/chunks/chunk-R76BA7C7.js +0 -535
  218. package/dist-cli/chunks/chunk-RVEB4CZ2.js +0 -4
  219. package/dist-cli/chunks/chunk-SK4M7NXT.js +0 -5
  220. package/dist-cli/chunks/chunk-SKMG5DD7.js +0 -5
  221. package/dist-cli/chunks/chunk-TEESPOYR.js +0 -4
  222. package/dist-cli/chunks/chunk-TH2UFGVP.js +0 -4
  223. package/dist-cli/chunks/chunk-TLP3T3VO.js +0 -4
  224. package/dist-cli/chunks/chunk-TZUABDIJ.js +0 -38
  225. package/dist-cli/chunks/chunk-UB2W6OQM.js +0 -99
  226. package/dist-cli/chunks/chunk-UYVXALPB.js +0 -506
  227. package/dist-cli/chunks/chunk-VQDYFFIG.js +0 -5
  228. package/dist-cli/chunks/chunk-VWCNJPCJ.js +0 -5
  229. package/dist-cli/chunks/chunk-VZIK4WIS.js +0 -74
  230. package/dist-cli/chunks/chunk-W3FNXAQP.js +0 -4
  231. package/dist-cli/chunks/chunk-XCDNVNP3.js +0 -4
  232. package/dist-cli/chunks/chunk-XSVILA4Z.js +0 -4
  233. package/dist-cli/chunks/chunk-XUTJ7ZWD.js +0 -4
  234. package/dist-cli/chunks/chunk-YTXY3MHW.js +0 -4
  235. package/dist-cli/chunks/chunk-ZF7PVX44.js +0 -28
  236. package/dist-cli/chunks/chunk-ZSSG7OR7.js +0 -4
  237. package/dist-cli/chunks/cleanup-MLOK2OZA.js +0 -25
  238. package/dist-cli/chunks/cli-version-OBNR366V.js +0 -4
  239. package/dist-cli/chunks/compat-SHMFSKU7.js +0 -23
  240. package/dist-cli/chunks/config-TPEAEUJ2.js +0 -13
  241. package/dist-cli/chunks/connect-3LEXWTE5.js +0 -4
  242. package/dist-cli/chunks/control-Z3FWA6BO.js +0 -4
  243. package/dist-cli/chunks/daemon-RSVYSC65.js +0 -4
  244. package/dist-cli/chunks/debug-GUVAK2KR.js +0 -200
  245. package/dist-cli/chunks/desktop-OOP2PTKP.js +0 -31
  246. package/dist-cli/chunks/detox-C2ILVBEC.js +0 -52
  247. package/dist-cli/chunks/device-NXIQQJWR.js +0 -18
  248. package/dist-cli/chunks/diagnose-2JBGYE5L.js +0 -43
  249. package/dist-cli/chunks/disk-cleanup-VURWJYQV.js +0 -4
  250. package/dist-cli/chunks/do-chain-DJ4UQC7A.js +0 -5
  251. package/dist-cli/chunks/drivers-JMA2OIKU.js +0 -4
  252. package/dist-cli/chunks/env-KTNPKEZR.js +0 -4
  253. package/dist-cli/chunks/film-DCPS7EID.js +0 -74
  254. package/dist-cli/chunks/flow-4DZ7B2OA.js +0 -4
  255. package/dist-cli/chunks/help-34CJMQY2.js +0 -4
  256. package/dist-cli/chunks/hidden-runtime-alias-HHT2C7WE.js +0 -4
  257. package/dist-cli/chunks/home-paths-KTPGCPMS.js +0 -4
  258. package/dist-cli/chunks/inspect-JF5WYJRD.js +0 -4
  259. package/dist-cli/chunks/install-desktop-ZIC4CDXI.js +0 -4
  260. package/dist-cli/chunks/login-TTJAOI2Q.js +0 -26
  261. package/dist-cli/chunks/logout-ERAQ6SKW.js +0 -4
  262. package/dist-cli/chunks/maestro-W46QCF77.js +0 -108
  263. package/dist-cli/chunks/maestro-generate-VBLM3MTU.js +0 -36
  264. package/dist-cli/chunks/mode-ZEDZK7R7.js +0 -26
  265. package/dist-cli/chunks/optional-demo-registry-ZUTPSVYQ.js +0 -4
  266. package/dist-cli/chunks/perf-YVT2WXT4.js +0 -48
  267. package/dist-cli/chunks/permissions-L7VVDHFP.js +0 -13
  268. package/dist-cli/chunks/platform-7TJOU2FB.js +0 -6
  269. package/dist-cli/chunks/privacy-57UOTB5J.js +0 -4
  270. package/dist-cli/chunks/record-VXG37P7U.js +0 -72
  271. package/dist-cli/chunks/report-issue-WNNOBZHC.js +0 -29
  272. package/dist-cli/chunks/reset-H5NBFE5U.js +0 -4
  273. package/dist-cli/chunks/resolve-target-57TK5WLE.js +0 -4
  274. package/dist-cli/chunks/runtime-QU2NIF2K.js +0 -4
  275. package/dist-cli/chunks/screenshot-command-AN56TTG7.js +0 -159
  276. package/dist-cli/chunks/screenshot-layers-3W5R7DB2.js +0 -20
  277. package/dist-cli/chunks/screenshots-capture-6AWJY7XZ.js +0 -42
  278. package/dist-cli/chunks/serve-GLYO5Q7J.js +0 -56
  279. package/dist-cli/chunks/setup-UA2HLD7S.js +0 -4
  280. package/dist-cli/chunks/sim-client-5C2RDQQO.js +0 -4
  281. package/dist-cli/chunks/skills-EYXWBRNQ.js +0 -50
  282. package/dist-cli/chunks/state-REJ7W6K3.js +0 -14
  283. package/dist-cli/chunks/storage-CFMDHI3V.js +0 -37
  284. package/dist-cli/chunks/store-XMCUA45G.js +0 -4
  285. package/dist-cli/chunks/telemetry-FBL3NAKB.js +0 -4
  286. package/dist-cli/chunks/timeline-HMCHN5FO.js +0 -24
  287. package/dist-cli/chunks/upgrade-2QSPAA3P.js +0 -7
  288. package/dist-cli/chunks/upload-DUQBKZYV.js +0 -4
  289. package/dist-cli/chunks/version-IOA6QFGB.js +0 -6
  290. package/dist-cli/chunks/web-NCGUYVCJ.js +0 -4
  291. package/dist-cli/chunks/welcome-QYGSQCWQ.js +0 -5
  292. package/dist-cli/chunks/what-happened-YTOUK4LO.js +0 -25
  293. package/dist-cli/chunks/ws-bridge-OF4OZARG.js +0 -4
  294. package/scripts/postinstall.cjs +0 -3
  295. package/scripts/preuninstall.cjs +0 -118
@@ -0,0 +1,221 @@
1
+ export type RnxBackendKind = 'node' | 'browser'
2
+
3
+ export interface CommandWriter {
4
+ stdout(text: string): void
5
+ stderr(text: string): void
6
+ }
7
+
8
+ export interface SemanticInvocation {
9
+ tool: string
10
+ input: unknown
11
+ success: boolean
12
+ details?: unknown
13
+ }
14
+
15
+ export interface ImageCommandArtifact {
16
+ kind: 'image'
17
+ name: string
18
+ mediaType: string
19
+ data: Uint8Array | string
20
+ runtimeClaim?: unknown
21
+ }
22
+
23
+ export interface FileCommandArtifact {
24
+ kind: 'file'
25
+ path: string
26
+ mediaType?: string
27
+ runtimeClaim?: unknown
28
+ }
29
+
30
+ export interface RuntimeCommandArtifact {
31
+ kind: 'runtime'
32
+ runtimeClaim: unknown
33
+ }
34
+
35
+ export interface UrlCommandArtifact {
36
+ kind: 'url'
37
+ url: string
38
+ label?: string
39
+ runtimeClaim?: unknown
40
+ }
41
+
42
+ export type CommandArtifact =
43
+ | ImageCommandArtifact
44
+ | FileCommandArtifact
45
+ | RuntimeCommandArtifact
46
+ | UrlCommandArtifact
47
+
48
+ export interface CommandExecutionResult {
49
+ exitCode: number
50
+ stdout: string
51
+ stderr: string
52
+ invocations: SemanticInvocation[]
53
+ artifacts: CommandArtifact[]
54
+ }
55
+
56
+ export interface RnxInvocationBase {
57
+ command: string
58
+ args: string[]
59
+ globalFlags: Record<string, string | boolean | number>
60
+ }
61
+
62
+ export interface RnxParsedCommandInput {
63
+ command: string
64
+ args: string[]
65
+ globalFlags: Record<string, string | boolean | number>
66
+ }
67
+
68
+ export interface RnxPreviewInvocation extends RnxInvocationBase {
69
+ family: 'preview'
70
+ command: 'web' | 'ios'
71
+ platform: 'web' | 'ios'
72
+ selection: 'select-or-ensure-existing'
73
+ }
74
+
75
+ export interface RnxRuntimeInvocation extends RnxInvocationBase {
76
+ family: 'runtime'
77
+ }
78
+
79
+ export interface RnxTreeInvocation extends RnxInvocationBase {
80
+ family: 'tree'
81
+ }
82
+
83
+ export interface RnxLayoutInvocation extends RnxInvocationBase {
84
+ family: 'layout'
85
+ }
86
+
87
+ export interface RnxFindInvocation extends RnxInvocationBase {
88
+ family: 'find'
89
+ command: 'find'
90
+ }
91
+
92
+ export interface RnxWaitInvocation extends RnxInvocationBase {
93
+ family: 'wait'
94
+ command: 'wait'
95
+ }
96
+
97
+ export interface RnxActionInvocation extends RnxInvocationBase {
98
+ family: 'action'
99
+ }
100
+
101
+ export interface RnxScreenshotInvocation extends RnxInvocationBase {
102
+ family: 'screenshot'
103
+ command: 'screenshot'
104
+ }
105
+
106
+ export interface RnxLogsInvocation extends RnxInvocationBase {
107
+ family: 'logs'
108
+ }
109
+
110
+ export interface RnxNetworkInvocation extends RnxInvocationBase {
111
+ family: 'network'
112
+ }
113
+
114
+ export interface RnxStorageInvocation extends RnxInvocationBase {
115
+ family: 'storage'
116
+ command: 'storage'
117
+ }
118
+
119
+ export interface RnxHistoryInvocation extends RnxInvocationBase {
120
+ family: 'history'
121
+ command: 'timeline' | 'what-happened'
122
+ }
123
+
124
+ export interface RnxEvidenceInvocation extends RnxInvocationBase {
125
+ family: 'evidence'
126
+ }
127
+
128
+ export type RnxCommandInvocation =
129
+ | RnxPreviewInvocation
130
+ | RnxRuntimeInvocation
131
+ | RnxTreeInvocation
132
+ | RnxLayoutInvocation
133
+ | RnxFindInvocation
134
+ | RnxWaitInvocation
135
+ | RnxActionInvocation
136
+ | RnxScreenshotInvocation
137
+ | RnxLogsInvocation
138
+ | RnxNetworkInvocation
139
+ | RnxStorageInvocation
140
+ | RnxHistoryInvocation
141
+ | RnxEvidenceInvocation
142
+
143
+ export interface RnxExecutionContext {
144
+ writer: CommandWriter
145
+ signal: AbortSignal
146
+ }
147
+
148
+ export interface RnxBackendExecution {
149
+ exitCode: number
150
+ invocations: SemanticInvocation[]
151
+ artifacts: CommandArtifact[]
152
+ }
153
+
154
+ export interface RnxCommandBackend {
155
+ readonly kind: RnxBackendKind
156
+ execute(
157
+ invocation: RnxCommandInvocation,
158
+ context: RnxExecutionContext,
159
+ ): Promise<RnxBackendExecution>
160
+ }
161
+
162
+ export interface RnxBrowserOperations {
163
+ selectPreview(
164
+ invocation: RnxPreviewInvocation,
165
+ context: RnxExecutionContext,
166
+ ): Promise<RnxBackendExecution>
167
+ readRuntime(
168
+ invocation: RnxRuntimeInvocation,
169
+ context: RnxExecutionContext,
170
+ ): Promise<RnxBackendExecution>
171
+ inspectTree(
172
+ invocation: RnxTreeInvocation,
173
+ context: RnxExecutionContext,
174
+ ): Promise<RnxBackendExecution>
175
+ inspectLayout(
176
+ invocation: RnxLayoutInvocation,
177
+ context: RnxExecutionContext,
178
+ ): Promise<RnxBackendExecution>
179
+ find(
180
+ invocation: RnxFindInvocation,
181
+ context: RnxExecutionContext,
182
+ ): Promise<RnxBackendExecution>
183
+ wait(
184
+ invocation: RnxWaitInvocation,
185
+ context: RnxExecutionContext,
186
+ ): Promise<RnxBackendExecution>
187
+ act(
188
+ invocation: RnxActionInvocation,
189
+ context: RnxExecutionContext,
190
+ ): Promise<RnxBackendExecution>
191
+ screenshot(
192
+ invocation: RnxScreenshotInvocation,
193
+ context: RnxExecutionContext,
194
+ ): Promise<RnxBackendExecution>
195
+ readLogs(
196
+ invocation: RnxLogsInvocation,
197
+ context: RnxExecutionContext,
198
+ ): Promise<RnxBackendExecution>
199
+ readNetwork(
200
+ invocation: RnxNetworkInvocation,
201
+ context: RnxExecutionContext,
202
+ ): Promise<RnxBackendExecution>
203
+ accessStorage(
204
+ invocation: RnxStorageInvocation,
205
+ context: RnxExecutionContext,
206
+ ): Promise<RnxBackendExecution>
207
+ readHistory(
208
+ invocation: RnxHistoryInvocation,
209
+ context: RnxExecutionContext,
210
+ ): Promise<RnxBackendExecution>
211
+ collectEvidence(
212
+ invocation: RnxEvidenceInvocation,
213
+ context: RnxExecutionContext,
214
+ ): Promise<RnxBackendExecution>
215
+ }
216
+
217
+ export interface RunRnxCoreOptions {
218
+ backend: RnxCommandBackend
219
+ signal?: AbortSignal
220
+ writer?: CommandWriter
221
+ }
@@ -0,0 +1,291 @@
1
+ import type {
2
+ RnxBackendKind,
3
+ RnxCommandInvocation,
4
+ RnxParsedCommandInput,
5
+ } from './command-contract'
6
+
7
+ export type RnxBrowserCommandFamily = RnxCommandInvocation['family']
8
+
9
+ export interface RnxCommandRegistration {
10
+ name: string
11
+ node: boolean
12
+ browserFamily: RnxBrowserCommandFamily | null
13
+ }
14
+
15
+ export interface RnxCommandAvailability {
16
+ available: boolean
17
+ reason: string | null
18
+ }
19
+
20
+ const NODE_COMMAND_NAMES = [
21
+ 'detox',
22
+ 'maestro',
23
+ 'record',
24
+ 'film',
25
+ 'storage',
26
+ 'permissions',
27
+ 'perf',
28
+ 'screenshot',
29
+ 'state',
30
+ 'reset',
31
+ 'camera',
32
+ 'mode',
33
+ 'debug',
34
+ 'timeline',
35
+ 'what-happened',
36
+ 'shell',
37
+ 'assert',
38
+ 'device',
39
+ 'open',
40
+ 'ios',
41
+ 'android',
42
+ 'box',
43
+ 'list',
44
+ 'use',
45
+ 'claim',
46
+ 'close',
47
+ 'compat',
48
+ 'report-issue',
49
+ 'desktop',
50
+ 'login',
51
+ 'logout',
52
+ 'auth',
53
+ 'setup',
54
+ 'serve',
55
+ 'daemon',
56
+ 'runtime',
57
+ 'upgrade',
58
+ 'version',
59
+ 'skill',
60
+ 'config',
61
+ 'cleanup',
62
+ 'app-fonts',
63
+ 'agent-wrapper',
64
+ 'agent',
65
+ 'describe',
66
+ 'find',
67
+ 'get',
68
+ 'do',
69
+ 'wait',
70
+ 'network',
71
+ 'logs',
72
+ ] satisfies string[]
73
+
74
+ const BROWSER_FAMILIES = new Map<string, RnxBrowserCommandFamily>([
75
+ ['web', 'preview'],
76
+ ['ios', 'preview'],
77
+ ['list', 'runtime'],
78
+ ['use', 'runtime'],
79
+ ['state', 'runtime'],
80
+ ['describe', 'tree'],
81
+ ['find', 'find'],
82
+ ['get', 'runtime'],
83
+ ['wait', 'wait'],
84
+ ['do', 'action'],
85
+ ['shell', 'action'],
86
+ ['reset', 'action'],
87
+ ['screenshot', 'screenshot'],
88
+ ['logs', 'logs'],
89
+ ['network', 'network'],
90
+ ['storage', 'storage'],
91
+ ['timeline', 'history'],
92
+ ['what-happened', 'history'],
93
+ ['assert', 'evidence'],
94
+ ['debug', 'evidence'],
95
+ ['perf', 'evidence'],
96
+ ])
97
+
98
+ const registrations = [
99
+ ...new Set([...NODE_COMMAND_NAMES, 'web']),
100
+ ].map<RnxCommandRegistration>((name) => ({
101
+ name,
102
+ node: name !== 'web',
103
+ browserFamily: BROWSER_FAMILIES.get(name) ?? null,
104
+ }))
105
+
106
+ export const RNX_COMMAND_REGISTRY: readonly RnxCommandRegistration[] = registrations
107
+ export const RNX_COMMAND_NAMES = new Set(registrations.map((entry) => entry.name))
108
+
109
+ // retained for registry drift checks that compare the established node CLI
110
+ // with its generated public docs. browser-only selectors have local help.
111
+ export const RNX_NODE_COMMAND_NAMES = new Set(NODE_COMMAND_NAMES)
112
+
113
+ const VALUE_FLAGS = new Set([
114
+ '--sim',
115
+ '--session',
116
+ '--tab',
117
+ '--port',
118
+ '-p',
119
+ '--timeout',
120
+ '--device',
121
+ '--output',
122
+ '-o',
123
+ '--out',
124
+ '--plan',
125
+ '--level',
126
+ '--filter',
127
+ '--threshold',
128
+ '--limit',
129
+ '--since',
130
+ '--kinds',
131
+ ])
132
+
133
+ const BROWSER_SCREENSHOT_SUBCOMMANDS = new Set(['capture', 'ask', 'appearance', 'motion'])
134
+
135
+ export function getRnxFirstPositional(args: readonly string[]): string | null {
136
+ for (let index = 0; index < args.length; index++) {
137
+ const arg = args[index]
138
+ if (arg.startsWith('-')) {
139
+ if (VALUE_FLAGS.has(arg)) index++
140
+ continue
141
+ }
142
+ return arg
143
+ }
144
+ return null
145
+ }
146
+
147
+ export function getRnxCommandRegistration(name: string): RnxCommandRegistration | null {
148
+ return RNX_COMMAND_REGISTRY.find((entry) => entry.name === name) ?? null
149
+ }
150
+
151
+ export function getRnxCommandAvailability(
152
+ command: string,
153
+ args: readonly string[],
154
+ backend: RnxBackendKind,
155
+ ): RnxCommandAvailability {
156
+ const registration = getRnxCommandRegistration(command)
157
+ if (!registration) {
158
+ return { available: false, reason: `unknown command: ${command}` }
159
+ }
160
+
161
+ if (backend === 'node') {
162
+ return registration.node
163
+ ? { available: true, reason: null }
164
+ : {
165
+ available: false,
166
+ reason:
167
+ 'rnx web is available in the browser backend, where it selects the existing web preview.',
168
+ }
169
+ }
170
+
171
+ if (!registration.browserFamily) {
172
+ return {
173
+ available: false,
174
+ reason: `rnx ${command} is unavailable in the browser backend; it requires the node backend.`,
175
+ }
176
+ }
177
+
178
+ const subcommand = getRnxFirstPositional(args)
179
+ if (command === 'shell' && subcommand && subcommand !== 'appearance') {
180
+ return {
181
+ available: false,
182
+ reason: `rnx shell ${subcommand} is unavailable in the browser backend; Factory exposes no semantic operation for it.`,
183
+ }
184
+ }
185
+ if (
186
+ command === 'shell' &&
187
+ subcommand === 'appearance' &&
188
+ args[1] !== undefined &&
189
+ args[1] !== 'light' &&
190
+ args[1] !== 'dark'
191
+ ) {
192
+ return {
193
+ available: false,
194
+ reason: 'rnx shell appearance supports light or dark in the browser backend.',
195
+ }
196
+ }
197
+ if (command === 'storage' && subcommand === 'profile') {
198
+ return {
199
+ available: false,
200
+ reason:
201
+ 'rnx storage profile is unavailable in the browser backend; use rnx storage clear for the selected preview.',
202
+ }
203
+ }
204
+ const screenshotSubcommand = command === 'screenshot' ? subcommand : null
205
+ if (
206
+ screenshotSubcommand !== null &&
207
+ !BROWSER_SCREENSHOT_SUBCOMMANDS.has(screenshotSubcommand)
208
+ ) {
209
+ return {
210
+ available: false,
211
+ reason: `rnx screenshot ${screenshotSubcommand} is unavailable in the browser backend; it requires the node backend.`,
212
+ }
213
+ }
214
+ if (command === 'timeline' && subcommand === 'dump') {
215
+ return {
216
+ available: false,
217
+ reason:
218
+ 'rnx timeline dump is unavailable in the browser backend because it writes to the host filesystem.',
219
+ }
220
+ }
221
+
222
+ return { available: true, reason: null }
223
+ }
224
+
225
+ export function createRnxCommandInvocation(
226
+ input: RnxParsedCommandInput,
227
+ ): RnxCommandInvocation {
228
+ const common = {
229
+ command: input.command,
230
+ args: [...input.args],
231
+ globalFlags: { ...input.globalFlags },
232
+ }
233
+
234
+ switch (input.command) {
235
+ case 'web':
236
+ return {
237
+ ...common,
238
+ family: 'preview',
239
+ command: 'web',
240
+ platform: 'web',
241
+ selection: 'select-or-ensure-existing',
242
+ }
243
+ case 'ios':
244
+ return {
245
+ ...common,
246
+ family: 'preview',
247
+ command: 'ios',
248
+ platform: 'ios',
249
+ selection: 'select-or-ensure-existing',
250
+ }
251
+ case 'describe':
252
+ return { ...common, family: 'tree' }
253
+ case 'find':
254
+ return { ...common, family: 'find', command: 'find' }
255
+ case 'get': {
256
+ const noun = getRnxFirstPositional(input.args)
257
+ if (noun === 'tree' || noun === 'a11y') return { ...common, family: 'tree' }
258
+ if (noun === 'layout') return { ...common, family: 'layout' }
259
+ if (noun === 'requests') return { ...common, family: 'network' }
260
+ if (noun === 'errors' || noun === 'warnings') return { ...common, family: 'logs' }
261
+ if (noun === 'diagnosis') return { ...common, family: 'evidence' }
262
+ return { ...common, family: 'runtime' }
263
+ }
264
+ case 'wait':
265
+ return { ...common, family: 'wait', command: 'wait' }
266
+ case 'do':
267
+ case 'shell':
268
+ case 'reset':
269
+ case 'permissions':
270
+ case 'camera':
271
+ return { ...common, family: 'action' }
272
+ case 'screenshot':
273
+ return { ...common, family: 'screenshot', command: 'screenshot' }
274
+ case 'logs':
275
+ return { ...common, family: 'logs', command: 'logs' }
276
+ case 'network':
277
+ return { ...common, family: 'network', command: 'network' }
278
+ case 'storage':
279
+ return { ...common, family: 'storage', command: 'storage' }
280
+ case 'timeline':
281
+ return { ...common, family: 'history', command: 'timeline' }
282
+ case 'what-happened':
283
+ return { ...common, family: 'history', command: 'what-happened' }
284
+ case 'assert':
285
+ case 'debug':
286
+ case 'perf':
287
+ return { ...common, family: 'evidence' }
288
+ default:
289
+ return { ...common, family: 'runtime' }
290
+ }
291
+ }
@@ -229,7 +229,7 @@ export async function runAgentWrapper(argv: string[]): Promise<number> {
229
229
  bin: resolvedAgentBin,
230
230
  cwd,
231
231
  env: {
232
- SOOTSIM_CLI_IDENTITY: sessionId,
232
+ RNX_CLI_IDENTITY: sessionId,
233
233
  SOOTSIM_PROJECT_ID: projectId,
234
234
  },
235
235
  })
@@ -827,7 +827,7 @@ function buildClaudeTurnRunner(deps: ClaudeTurnDeps): TurnRunner {
827
827
  stdio: ['ignore', 'pipe', 'pipe'],
828
828
  env: {
829
829
  ...process.env,
830
- SOOTSIM_CLI_IDENTITY: sessionId,
830
+ RNX_CLI_IDENTITY: sessionId,
831
831
  SOOTSIM_PROJECT_ID: projectId,
832
832
  },
833
833
  },
@@ -1,4 +1,4 @@
1
- // sootsim app-fonts stage — fetch the config-plugin fonts declared on an
1
+ // rnx app-fonts stage — fetch the config-plugin fonts declared on an
2
2
  // engine `?appFonts=` wire, gzip them, and merge asset descriptors into a
3
3
  // build's asset manifest.
4
4
  //
@@ -9,7 +9,7 @@
9
9
  // after the asset capture; the descriptors land in the same manifest the
10
10
  // upload step already PUTs, keyed by sha256(url) so the rendered build resolves
11
11
  // each font through /api/preview/share/fetch?url=<fontUrl> identically to the
12
- // preview path (`sootsim record upload`). both pipelines share fetchAppFontFiles.
12
+ // preview path (`rnx record upload`). both pipelines share fetchAppFontFiles.
13
13
 
14
14
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
15
15
  import { join } from 'node:path'
@@ -1,4 +1,4 @@
1
- // `sootsim assert <verb> <verb-args...> <assertion-flags...>`
1
+ // `rnx assert <verb> <verb-args...> <assertion-flags...>`
2
2
  //
3
3
  // thin wrapper that runs any read verb with --json forced on, captures the
4
4
  // JSON payload, and converts predicate flags into a bisect-friendly exit
@@ -17,7 +17,7 @@ import { spawn } from 'child_process'
17
17
  import { rnxExit } from '../run-rnx'
18
18
 
19
19
  // READ_VERBS lists every command whose stdout we know is valid JSON under
20
- // --json. keeping this explicit means `sootsim assert tap 100 200` fails
20
+ // --json. keeping this explicit means `rnx assert tap 100 200` fails
21
21
  // fast with a clear message instead of silently running a write verb and
22
22
  // trying to parse " tapped 100,200" as JSON.
23
23
  const READ_VERBS = new Set([
@@ -46,7 +46,7 @@ const READ_VERBS = new Set([
46
46
 
47
47
  // assertion flags that assert recognizes. everything else is passed through
48
48
  // to the inner verb untouched. keeping this as a set (rather than positional
49
- // parsing) means `sootsim assert find --testid X --count 4` reads naturally.
49
+ // parsing) means `rnx assert find --testid X --count 4` reads naturally.
50
50
  const BOOL_ASSERT_FLAGS = new Set([
51
51
  '--exists',
52
52
  '--empty',
@@ -9,7 +9,7 @@ rnx auth — inspect CLI auth
9
9
  usage:
10
10
  rnx auth
11
11
 
12
- API keys are read from RNX_API_KEY, or SOOTSIM_API_KEY if that is unset.
12
+ API keys are read from RNX_API_KEY.
13
13
  Use \`rnx login\` to sign in and \`rnx logout\` to clear the desktop session.
14
14
  `)
15
15
  }
@@ -11,7 +11,7 @@
11
11
  // exist, and pointing at a URL that answers nothing would advertise a
12
12
  // capability that always fails.
13
13
 
14
- import WebSocket from 'ws'
14
+ import { WebSocket } from 'ws'
15
15
  import type { CheckoutFilePlane } from './checkout-plane'
16
16
  import type { HarnessShellResult } from '@contrast/harness/shell'
17
17
 
@@ -17,10 +17,10 @@
17
17
  // resolveBridgeWorld reports source 'default' and hands back
18
18
  // DEFAULT_SOOTSIM_BRIDGE_PORT, which on a machine running a real daemon is
19
19
  // that daemon. registering there would attach a test's or a benchmark's box to
20
- // another session's daemon, which is exactly what a private SOOTSIM_HOME
20
+ // another session's daemon, which is exactly what a private RNX_HOME
21
21
  // exists to prevent. so a guessed port is refused by name.
22
22
 
23
- import WebSocket from 'ws'
23
+ import { WebSocket } from 'ws'
24
24
  import { bridgeWsUrl, resolveBridgeWorld } from '../../ws-bridge'
25
25
 
26
26
  const REGISTER_TIMEOUT_MS = 1500
@@ -313,12 +313,10 @@ async function runLocalBox(opts: BoxCommandOptions): Promise<number> {
313
313
 
314
314
  const shell = createHarnessShell({
315
315
  projectFs: new HarnessProjectFs(plane),
316
- commands: [
317
- createRnxCommand({ root, shellCwd: () => shell.cwd }),
318
- // overrides just-bash's JavaScript rg, which reads every file body
319
- // through the plane. see search-command.ts for the numbers.
320
- createSearchCommand({ root }),
321
- ],
316
+ commands: [createRnxCommand({ root, shellCwd: () => shell.cwd })],
317
+ // just-bash's JavaScript rg reads every file body through the plane.
318
+ // see search-command.ts for the numbers.
319
+ builtInCommandOverrides: [createSearchCommand({ root })],
322
320
  })
323
321
 
324
322
  const relative = path.relative(root, process.cwd())
@@ -1,4 +1,4 @@
1
- // sootsim compat — scan dependencies with the shared compatibility engine.
1
+ // rnx compat — scan dependencies with the shared compatibility engine.
2
2
 
3
3
  import { existsSync, readFileSync } from 'node:fs'
4
4
  import { dirname, join, relative, resolve } from 'node:path'
@@ -9,8 +9,8 @@ usage:
9
9
  rnx config telemetry [on|off|status]
10
10
 
11
11
  environment:
12
- SOOTSIM_HINTS=off suppress CLI hints
13
- SOOTSIM_HINTS=always show every CLI hint every time
12
+ RNX_HINTS=off suppress CLI hints
13
+ RNX_HINTS=always show every CLI hint every time
14
14
  `)
15
15
  }
16
16