rnxsim 0.0.0 → 0.1.312
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +512 -0
- package/detox/colors.ts +54 -0
- package/detox/config-loader.ts +135 -0
- package/detox/element-types.ts +39 -0
- package/detox/expectations.ts +537 -0
- package/detox/gestures.ts +480 -0
- package/detox/index.ts +2118 -0
- package/detox/jest-preset.cjs +51 -0
- package/detox/jest-setup-after-env.cjs +18 -0
- package/detox/matchers.ts +30 -0
- package/detox/motion-change.cjs +109 -0
- package/detox/motion-change.d.cts +35 -0
- package/detox/navigation.ts +43 -0
- package/detox/screenshots/animated-color-test-rest-norngh.png +0 -0
- package/detox/screenshots/color-test-after-drag-norngh.png +0 -0
- package/detox/screenshots/color-test-rest-norngh.png +0 -0
- package/detox/screenshots/theme-blue-toggle.png +0 -0
- package/detox/screenshots/theme-blue.png +0 -0
- package/detox/screenshots/theme-red-toggle.png +0 -0
- package/detox/screenshots/theme-red.png +0 -0
- package/dist-cli/bin.js +15 -0
- package/dist-cli/chunks/agent-NXVDDCFG.js +48 -0
- package/dist-cli/chunks/agent-wrapper-DXJCFKL3.js +17 -0
- package/dist-cli/chunks/app-fonts-W5AJZQJF.js +4 -0
- package/dist-cli/chunks/assert-3LOJEUDT.js +49 -0
- package/dist-cli/chunks/auth-MFTYYPNX.js +12 -0
- package/dist-cli/chunks/beta-GT3NN67B.js +4 -0
- package/dist-cli/chunks/camera-6EAK7CUL.js +22 -0
- package/dist-cli/chunks/chunk-274UD5FD.js +4 -0
- package/dist-cli/chunks/chunk-2SA2VTGP.js +5 -0
- package/dist-cli/chunks/chunk-33FKQH54.js +5 -0
- package/dist-cli/chunks/chunk-37I5AIS7.js +3 -0
- package/dist-cli/chunks/chunk-3D57IBPC.js +4 -0
- package/dist-cli/chunks/chunk-4BXCZHAU.js +4 -0
- package/dist-cli/chunks/chunk-5OX7ANRA.js +5 -0
- package/dist-cli/chunks/chunk-66NF2KNG.js +9 -0
- package/dist-cli/chunks/chunk-6UKJB2VC.js +125 -0
- package/dist-cli/chunks/chunk-7INBNA3U.js +26 -0
- package/dist-cli/chunks/chunk-7VWOSTD5.js +5 -0
- package/dist-cli/chunks/chunk-AY47WKS5.js +23 -0
- package/dist-cli/chunks/chunk-B7KMNHX7.js +4 -0
- package/dist-cli/chunks/chunk-BKNOLP3J.js +4 -0
- package/dist-cli/chunks/chunk-BRIZOR4K.js +28 -0
- package/dist-cli/chunks/chunk-DM6KUAOZ.js +4 -0
- package/dist-cli/chunks/chunk-EUAVBTKU.js +4 -0
- package/dist-cli/chunks/chunk-FTC4M26Q.js +4 -0
- package/dist-cli/chunks/chunk-FWYYCUAZ.js +4 -0
- package/dist-cli/chunks/chunk-G74YIEVS.js +7 -0
- package/dist-cli/chunks/chunk-GZDHEONW.js +507 -0
- package/dist-cli/chunks/chunk-HG7ORJMT.js +5 -0
- package/dist-cli/chunks/chunk-HMDOLCKG.js +15 -0
- package/dist-cli/chunks/chunk-JG6S4RSH.js +4 -0
- package/dist-cli/chunks/chunk-KR5BGMBZ.js +4 -0
- package/dist-cli/chunks/chunk-KZW5WBGU.js +983 -0
- package/dist-cli/chunks/chunk-L24Z3CRS.js +30 -0
- package/dist-cli/chunks/chunk-LDQ7HVCW.js +4 -0
- package/dist-cli/chunks/chunk-MENV7VLD.js +4 -0
- package/dist-cli/chunks/chunk-MNGQ42QE.js +568 -0
- package/dist-cli/chunks/chunk-N6A3SXMR.js +4 -0
- package/dist-cli/chunks/chunk-NLEMQ4PY.js +6 -0
- package/dist-cli/chunks/chunk-NPVGMH2N.js +101 -0
- package/dist-cli/chunks/chunk-OR3XTXEB.js +107 -0
- package/dist-cli/chunks/chunk-PEPUGJVI.js +4 -0
- package/dist-cli/chunks/chunk-Q3RGLERJ.js +142 -0
- package/dist-cli/chunks/chunk-SI3BUTQR.js +4 -0
- package/dist-cli/chunks/chunk-T4FT6CM7.js +4 -0
- package/dist-cli/chunks/chunk-TBMVBI26.js +7 -0
- package/dist-cli/chunks/chunk-TCWQJILS.js +5 -0
- package/dist-cli/chunks/chunk-TGQNQ6XT.js +766 -0
- package/dist-cli/chunks/chunk-TYE3WBSR.js +5 -0
- package/dist-cli/chunks/chunk-U4PN6JOT.js +6 -0
- package/dist-cli/chunks/chunk-VUFRB347.js +4 -0
- package/dist-cli/chunks/chunk-VZBLFMYC.js +10 -0
- package/dist-cli/chunks/chunk-WBT32R6N.js +25 -0
- package/dist-cli/chunks/chunk-XRGEEPJ5.js +38 -0
- package/dist-cli/chunks/chunk-Y2FSZSO7.js +71 -0
- package/dist-cli/chunks/chunk-YRV7HR3P.js +74 -0
- package/dist-cli/chunks/chunk-YZRFF4YA.js +14 -0
- package/dist-cli/chunks/chunk-ZMZTHU7V.js +4 -0
- package/dist-cli/chunks/cleanup-H3GWQB63.js +25 -0
- package/dist-cli/chunks/cli-version-3QPAJ3LC.js +4 -0
- package/dist-cli/chunks/compat-5WG2XJV7.js +20 -0
- package/dist-cli/chunks/config-ANMBVVLL.js +13 -0
- package/dist-cli/chunks/control-NSGNQFJG.js +4 -0
- package/dist-cli/chunks/daemon-JHF4BJ3U.js +4 -0
- package/dist-cli/chunks/debug-CHV2O2KF.js +200 -0
- package/dist-cli/chunks/desktop-FIPIK4CH.js +31 -0
- package/dist-cli/chunks/detox-CVUJP7K6.js +52 -0
- package/dist-cli/chunks/device-6WCUM4W6.js +18 -0
- package/dist-cli/chunks/diagnose-I6EMWEII.js +43 -0
- package/dist-cli/chunks/disk-cleanup-P27CYFTN.js +4 -0
- package/dist-cli/chunks/drivers-HQ6AKZT6.js +4 -0
- package/dist-cli/chunks/film-UOQFFYNF.js +74 -0
- package/dist-cli/chunks/flow-N27MRRNL.js +4 -0
- package/dist-cli/chunks/help-SF6FEGEE.js +4 -0
- package/dist-cli/chunks/hidden-runtime-alias-NJYFSJKZ.js +4 -0
- package/dist-cli/chunks/home-paths-XOV44JEF.js +4 -0
- package/dist-cli/chunks/inspect-CWFRFQTY.js +4 -0
- package/dist-cli/chunks/install-desktop-KLQDNXZQ.js +4 -0
- package/dist-cli/chunks/login-BPFQENCX.js +28 -0
- package/dist-cli/chunks/logout-5A45ZGY7.js +4 -0
- package/dist-cli/chunks/maestro-E4CSDMLM.js +104 -0
- package/dist-cli/chunks/maestro-generate-CKMOJQX2.js +36 -0
- package/dist-cli/chunks/mode-SZYNMIQF.js +26 -0
- package/dist-cli/chunks/optional-demo-registry-FRH4SFVG.js +4 -0
- package/dist-cli/chunks/perf-VXU2XJAX.js +48 -0
- package/dist-cli/chunks/permissions-IRIAOVND.js +13 -0
- package/dist-cli/chunks/record-RY7FPLLH.js +72 -0
- package/dist-cli/chunks/report-issue-KNWXOE53.js +29 -0
- package/dist-cli/chunks/runtime-AR3GJTGK.js +4 -0
- package/dist-cli/chunks/screenshot-command-QLALR6GY.js +159 -0
- package/dist-cli/chunks/screenshot-layers-OQFMFVRL.js +20 -0
- package/dist-cli/chunks/screenshots-capture-6TSRJFGB.js +42 -0
- package/dist-cli/chunks/serve-F54J2NQO.js +44 -0
- package/dist-cli/chunks/setup-7V6UKX4U.js +32 -0
- package/dist-cli/chunks/skills-QQBOSETH.js +50 -0
- package/dist-cli/chunks/storage-TAPMKK5O.js +37 -0
- package/dist-cli/chunks/store-7NX3S43H.js +4 -0
- package/dist-cli/chunks/telemetry-E7BUK6RA.js +4 -0
- package/dist-cli/chunks/timeline-IAM564NA.js +24 -0
- package/dist-cli/chunks/upgrade-CD55QXIX.js +7 -0
- package/dist-cli/chunks/upload-GZ6LIMYM.js +4 -0
- package/dist-cli/chunks/version-3DYJ5AS3.js +6 -0
- package/dist-cli/chunks/web-6NW6YLPI.js +4 -0
- package/dist-cli/chunks/what-happened-CZZDOOVG.js +25 -0
- package/dist-lib/agent-daemon-client.cjs +468 -0
- package/dist-lib/agent-events.cjs +48 -0
- package/dist-lib/agent-identity.cjs +53 -0
- package/dist-lib/agent-sessions.cjs +725 -0
- package/dist-lib/attached-projects.cjs +526 -0
- package/dist-lib/auth/shared-session.cjs +195 -0
- package/dist-lib/backend-origin.cjs +70 -0
- package/dist-lib/beta.cjs +41 -0
- package/dist-lib/beta.mjs +13 -0
- package/dist-lib/bridge-constants.cjs +161 -0
- package/dist-lib/cli-constants.cjs +32 -0
- package/dist-lib/config.cjs +96 -0
- package/dist-lib/detox/index.cjs +2863 -0
- package/dist-lib/detox/jest-preset.cjs +51 -0
- package/dist-lib/dev-bundle-resolution.cjs +223 -0
- package/dist-lib/home-paths.cjs +421 -0
- package/dist-lib/host/bridge-host.cjs +5600 -0
- package/dist-lib/host/fetch-proxy-handler.cjs +373 -0
- package/dist-lib/host/fetch-proxy-overrides.cjs +63 -0
- package/dist-lib/host/fetch-proxy-overrides.mjs +37 -0
- package/dist-lib/host/websocket-proxy.cjs +214 -0
- package/dist-lib/index.cjs +513 -0
- package/dist-lib/jump-to-source-babel.cjs +93 -0
- package/dist-lib/menu.cjs +620 -0
- package/dist-lib/menu.mjs +581 -0
- package/dist-lib/metro.cjs +297 -0
- package/dist-lib/profiles.cjs +246 -0
- package/dist-lib/public-brand.cjs +39 -0
- package/dist-lib/render-mode.cjs +54 -0
- package/dist-lib/scripts/dev-server-scanner.cjs +1034 -0
- package/dist-lib/sdk.cjs +2333 -0
- package/dist-lib/sdk.mjs +2240 -0
- package/dist-lib/skills.cjs +23911 -0
- package/dist-lib/vite.cjs +358 -0
- package/package.json +189 -18
- package/scripts/dev-server-scanner.ts +941 -0
- package/scripts/optional-demo-registry.ts +113 -0
- package/scripts/postinstall.cjs +3 -0
- package/scripts/preuninstall.cjs +118 -0
- package/skills/contrast/SKILL.md +171 -0
- package/skills/rnx-debug/SKILL.md +425 -0
- package/skills/rnx-perf/SKILL.md +295 -0
- package/skills/rnx-setup/SKILL.md +160 -0
- package/skills/rnx-test/SKILL.md +292 -0
- package/skills/rnx-visual/SKILL.md +122 -0
- package/src/agent-daemon-client.ts +410 -0
- package/src/agent-events.ts +71 -0
- package/src/agent-identity.ts +23 -0
- package/src/agent-prompt.ts +71 -0
- package/src/agent-sessions.ts +573 -0
- package/src/attached-projects.ts +539 -0
- package/src/auth/shared-session.ts +204 -0
- package/src/backend-origin.ts +49 -0
- package/src/beta.ts +19 -0
- package/src/bridge-constants.ts +171 -0
- package/src/browser-cache.ts +16 -0
- package/src/cli-constants.ts +1 -0
- package/src/cli-version.ts +32 -0
- package/src/codex-client.ts +215 -0
- package/src/config.ts +134 -0
- package/src/dev-bundle-resolution.ts +236 -0
- package/src/disk-cleanup.ts +466 -0
- package/src/home-paths.ts +552 -0
- package/src/host/agent-host.ts +666 -0
- package/src/host/bridge-host.ts +2626 -0
- package/src/host/fetch-proxy-handler.ts +397 -0
- package/src/host/fetch-proxy-overrides.ts +51 -0
- package/src/host/open-url.ts +89 -0
- package/src/host/websocket-proxy.ts +210 -0
- package/src/index.ts +12 -705
- package/src/jump-to-source-babel.ts +135 -0
- package/src/menu.ts +734 -0
- package/src/metro-plugin.ts +139 -0
- package/src/native-dev-bundle-url.ts +96 -0
- package/src/native-seam-manifest.ts +341 -0
- package/src/plist.ts +27 -0
- package/src/poll-until.ts +92 -0
- package/src/profiles.ts +179 -0
- package/src/public-brand.ts +9 -0
- package/src/render-mode.ts +27 -0
- package/src/runtime-assets.ts +228 -0
- package/src/runtime-delivery.ts +54 -0
- package/src/screenshots/compose.ts +422 -0
- package/src/screenshots/frame-compose.ts +454 -0
- package/src/screenshots/orchestrate.ts +256 -0
- package/src/screenshots/org-deck.ts +91 -0
- package/src/screenshots/registry.ts +58 -0
- package/src/screenshots/schema.ts +364 -0
- package/src/sdk.ts +7 -0
- package/src/settings-bundle.ts +418 -0
- package/src/skills/builtin/a11y-review.ts +132 -0
- package/src/skills/builtin/compat-check.ts +71 -0
- package/src/skills/builtin/maestro-test.ts +121 -0
- package/src/skills/builtin/perf-profile.ts +90 -0
- package/src/skills/builtin/screenshot-all.ts +52 -0
- package/src/skills/builtin/visual-diff.ts +100 -0
- package/src/skills/registry.ts +107 -0
- package/src/skills/types.ts +41 -0
- package/src/team-machine-prompt.ts +73 -0
- package/src/vite-plugin-one.ts +190 -0
- package/src/vite-plugin.ts +1750 -0
- package/src/worklets-babel.ts +134 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// optional, best-effort access to the INTERNAL demo-app registry
|
|
2
|
+
// (`./demo-app-registry.ts`). that file is repo-internal dev tooling: it pins
|
|
3
|
+
// real demo apps to fixed ports (e.g. 3pc on 8081) and is consumed only by
|
|
4
|
+
// `bun run demo` + the in-repo electron/vite discovery paths, which run from
|
|
5
|
+
// the typescript source where the registry is always present.
|
|
6
|
+
//
|
|
7
|
+
// the PUBLISHED `sootsim` npm package must know nothing about those internal
|
|
8
|
+
// apps — shipping the registry once matched a brand-new user's `expo start` on
|
|
9
|
+
// the default port 8081 against the 3pc `one` entry and crashed their metro
|
|
10
|
+
// (repo-agnostic-pipeline violation). so the registry is NOT in the package
|
|
11
|
+
// `files` list, and the `import()` below is resolved to an absolute path at
|
|
12
|
+
// runtime: it finds the source registry in-repo and nothing (empty list) on a
|
|
13
|
+
// published install. no bundler can see through that, so it never inlines.
|
|
14
|
+
//
|
|
15
|
+
// one path, no env toggle: every consumer goes through this loader; whether the
|
|
16
|
+
// registry resolves is purely a function of whether the file exists on disk.
|
|
17
|
+
|
|
18
|
+
import { existsSync } from 'node:fs'
|
|
19
|
+
import { basename, dirname, join } from 'node:path'
|
|
20
|
+
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
21
|
+
|
|
22
|
+
// this module is emitted at three different depths — the source at
|
|
23
|
+
// packages/sootsim/scripts/, the built CLI at packages/sootsim/dist-cli/chunks/,
|
|
24
|
+
// and the electron main bundle at packages/sootsim-engine/dist-electron/ — so a
|
|
25
|
+
// relative './demo-app-registry.ts' is only correct from the source copy. from
|
|
26
|
+
// the other two it points at a file that does not exist, the catch below
|
|
27
|
+
// swallows that, and every demo app then boots with no runtimeConfig at all
|
|
28
|
+
// (mattermost stops on the server-select screen because AutoSelectServerUrl
|
|
29
|
+
// never reaches it). the one description that holds from every emit site is the
|
|
30
|
+
// ancestor that holds the registry at its repo path, which in-repo is the
|
|
31
|
+
// monorepo root.
|
|
32
|
+
const REGISTRY_REPO_PATH = 'packages/sootsim/scripts/demo-app-registry.ts'
|
|
33
|
+
|
|
34
|
+
// the walk must never leave the installed package. `sootsim` publishes this
|
|
35
|
+
// loader's source, so on a published install it runs from
|
|
36
|
+
// node_modules/sootsim/scripts/ (or dist-cli/chunks/) with the consumer's whole
|
|
37
|
+
// filesystem above it — and consumers include this repo's own templates and
|
|
38
|
+
// examples, which install sootsim while sitting inside the monorepo. an
|
|
39
|
+
// unbounded walk from there reaches the real registry and hands a user's
|
|
40
|
+
// `expo start` on port 8081 the internal 3pc entry, which is the exact incident
|
|
41
|
+
// the header describes. a node_modules ancestor means "installed as a
|
|
42
|
+
// dependency", so the search stops there and the registry stays absent.
|
|
43
|
+
const MAX_ANCESTOR_STEPS = 8
|
|
44
|
+
|
|
45
|
+
/** absolute path to the internal registry, or null when this copy is running
|
|
46
|
+
* outside the monorepo (a published install) and must not have one. */
|
|
47
|
+
export function findInternalDemoRegistry(startDir: string): string | null {
|
|
48
|
+
let dir = startDir
|
|
49
|
+
for (let step = 0; step < MAX_ANCESTOR_STEPS; step++) {
|
|
50
|
+
if (basename(dir) === 'node_modules') return null
|
|
51
|
+
const candidate = join(dir, REGISTRY_REPO_PATH)
|
|
52
|
+
if (existsSync(candidate)) return candidate
|
|
53
|
+
const parent = dirname(dir)
|
|
54
|
+
if (parent === dir) return null
|
|
55
|
+
dir = parent
|
|
56
|
+
}
|
|
57
|
+
return null
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface OptionalDemoApp {
|
|
61
|
+
name: string
|
|
62
|
+
label: string
|
|
63
|
+
dir: string
|
|
64
|
+
preferredPort: number
|
|
65
|
+
framework: 'expo' | 'one' | 'rock'
|
|
66
|
+
runtimeConfig?: import('../src/config.ts').SootSimConfig
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
let cached: OptionalDemoApp[] | null = null
|
|
70
|
+
|
|
71
|
+
/** load the internal demo registry if it's present on disk (in-repo only).
|
|
72
|
+
* returns [] on a published install where the registry was not shipped. */
|
|
73
|
+
export async function loadOptionalDemoApps(): Promise<OptionalDemoApp[]> {
|
|
74
|
+
if (cached) return cached
|
|
75
|
+
const registryPath = findInternalDemoRegistry(dirname(fileURLToPath(import.meta.url)))
|
|
76
|
+
if (!registryPath) {
|
|
77
|
+
cached = []
|
|
78
|
+
return cached
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const mod = (await import(/* @vite-ignore */ pathToFileURL(registryPath).href)) as {
|
|
82
|
+
APPS?: OptionalDemoApp[]
|
|
83
|
+
}
|
|
84
|
+
cached = Array.isArray(mod.APPS) ? mod.APPS : []
|
|
85
|
+
} catch {
|
|
86
|
+
cached = []
|
|
87
|
+
}
|
|
88
|
+
return cached
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** synchronous view of the registry — empty until `loadOptionalDemoApps()` has
|
|
92
|
+
* resolved at least once. every caller that builds a result from the registry
|
|
93
|
+
* awaits the load first. */
|
|
94
|
+
export function optionalDemoAppsSync(): OptionalDemoApp[] {
|
|
95
|
+
return cached ?? []
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** replace the registry with a fixed list, and restore it on the returned
|
|
99
|
+
* handle. what the real registry holds depends on which third-party app
|
|
100
|
+
* checkouts and credential files happen to exist on the machine, so a test
|
|
101
|
+
* that reads it asserts on the developer's home directory rather than on the
|
|
102
|
+
* code. it passes on the box that has them and fails everywhere else. */
|
|
103
|
+
export function __withOptionalDemoAppsForTests(apps: OptionalDemoApp[]): {
|
|
104
|
+
restore: () => void
|
|
105
|
+
} {
|
|
106
|
+
const previous = cached
|
|
107
|
+
cached = apps
|
|
108
|
+
return {
|
|
109
|
+
restore: () => {
|
|
110
|
+
cached = previous
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// preuninstall — runs before `npm rm -g sootsim` actually removes the bin.
|
|
3
|
+
//
|
|
4
|
+
// without this hook the user is left with a 79MB ghost: a launchd/systemd
|
|
5
|
+
// service still ENABLED + actively running (with ExecStart pointing at the
|
|
6
|
+
// now-missing binary), ~/.sootsim/ (cache + runtimes + electron + profiles +
|
|
7
|
+
// daemon.json), and the user's first instinct (`sootsim daemon uninstall`)
|
|
8
|
+
// is gone with the package. so we tear it all down here, while the bin still
|
|
9
|
+
// exists.
|
|
10
|
+
//
|
|
11
|
+
// reliability: npm preuninstall hooks are best-effort — they don't fire when
|
|
12
|
+
// the package wasn't installed by npm (yarn/bun/pnpm have their own lifecycle
|
|
13
|
+
// rules), and they don't run as part of `npm cache verify` cleanup or manual
|
|
14
|
+
// dir removal. that's why `sootsim daemon uninstall` is also documented as
|
|
15
|
+
// the manual teardown path.
|
|
16
|
+
//
|
|
17
|
+
// strategy: spawn the bundled bin to run `daemon uninstall` (single source of
|
|
18
|
+
// truth — the same logic the user invokes manually). if that fails for any
|
|
19
|
+
// reason — node version mismatch, the bin already removed by a previous
|
|
20
|
+
// half-completed run, missing $HOME — do a best-effort raw fs cleanup so the
|
|
21
|
+
// machine isn't left in a broken state.
|
|
22
|
+
|
|
23
|
+
const { spawnSync } = require('child_process')
|
|
24
|
+
const fs = require('fs')
|
|
25
|
+
const os = require('os')
|
|
26
|
+
const path = require('path')
|
|
27
|
+
|
|
28
|
+
if (process.env.SOOTSIM_SKIP_PREUNINSTALL === '1') {
|
|
29
|
+
process.exit(0)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// dev / workspace installs (running inside the Contrast monorepo, not in a
|
|
33
|
+
// node_modules tree) — don't tear anything down. the developer is rebuilding
|
|
34
|
+
// the workspace, not actually uninstalling.
|
|
35
|
+
const pkgDir = path.resolve(__dirname, '..')
|
|
36
|
+
if (!pkgDir.includes(`${path.sep}node_modules${path.sep}`)) {
|
|
37
|
+
process.exit(0)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// skipped under sudo for the same reason as postinstall: $HOME would be /root,
|
|
41
|
+
// but the user who needs cleanup is the one who installed sootsim. they can
|
|
42
|
+
// run `sootsim daemon uninstall` themselves before `sudo npm rm -g sootsim`
|
|
43
|
+
// to clean their own home.
|
|
44
|
+
const isRoot = typeof process.getuid === 'function' && process.getuid() === 0
|
|
45
|
+
if (isRoot && process.env.SUDO_USER) {
|
|
46
|
+
console.log(
|
|
47
|
+
'rnx: preuninstall skipped under sudo — run `rnxsim daemon uninstall` ' +
|
|
48
|
+
'as your user first to remove ~/.sootsim and the bridge daemon',
|
|
49
|
+
)
|
|
50
|
+
process.exit(0)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const bin = path.join(pkgDir, 'dist-cli', 'bin.js')
|
|
54
|
+
let unifiedOk = false
|
|
55
|
+
if (fs.existsSync(bin)) {
|
|
56
|
+
const res = spawnSync(process.execPath, [bin, 'daemon', 'uninstall'], {
|
|
57
|
+
stdio: 'inherit',
|
|
58
|
+
timeout: 30_000,
|
|
59
|
+
})
|
|
60
|
+
unifiedOk = res.status === 0
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!unifiedOk) {
|
|
64
|
+
// raw fallback. mirrors teardownDaemonService + teardownSootsimHome from
|
|
65
|
+
// cli/commands/daemon.ts. idempotent: each entry is checked before remove.
|
|
66
|
+
console.log('rnx: bin path failed — running raw cleanup fallback')
|
|
67
|
+
rawCleanup()
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
process.exit(0)
|
|
71
|
+
|
|
72
|
+
function rawCleanup() {
|
|
73
|
+
const home = sootsimHomeDir()
|
|
74
|
+
if (process.platform === 'darwin') {
|
|
75
|
+
safeSpawn('launchctl', ['bootout', `gui/${getuid()}/dev.sootsim.daemon`])
|
|
76
|
+
safeSpawn('launchctl', ['bootout', `gui/${getuid()}/dev.sootsim.server`])
|
|
77
|
+
safeRemove(path.join(os.homedir(), 'Library/LaunchAgents/dev.sootsim.daemon.plist'))
|
|
78
|
+
safeRemove(path.join(os.homedir(), 'Library/LaunchAgents/dev.sootsim.server.plist'))
|
|
79
|
+
safeRemove(path.join(os.homedir(), 'Library/Logs/sootsim'), {
|
|
80
|
+
recursive: true,
|
|
81
|
+
})
|
|
82
|
+
} else if (process.platform === 'linux') {
|
|
83
|
+
safeSpawn('systemctl', ['--user', 'disable', '--now', 'sootsim-daemon'])
|
|
84
|
+
safeSpawn('systemctl', ['--user', 'daemon-reload'])
|
|
85
|
+
safeSpawn('systemctl', ['--user', 'reset-failed', 'sootsim-daemon'])
|
|
86
|
+
safeRemove(path.join(os.homedir(), '.config/systemd/user/sootsim-daemon.service'))
|
|
87
|
+
safeRemove(path.join(os.homedir(), '.local/state/sootsim'), { recursive: true })
|
|
88
|
+
}
|
|
89
|
+
// ~/.sootsim is the same on every platform; honor $SOOTSIM_HOME.
|
|
90
|
+
safeRemove(home, { recursive: true })
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function sootsimHomeDir() {
|
|
94
|
+
const env = process.env.SOOTSIM_HOME
|
|
95
|
+
if (env && env.length > 0) return path.resolve(env)
|
|
96
|
+
return path.join(os.homedir(), '.sootsim')
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function safeRemove(p, opts) {
|
|
100
|
+
try {
|
|
101
|
+
if (fs.existsSync(p)) {
|
|
102
|
+
fs.rmSync(p, { force: true, ...(opts || {}) })
|
|
103
|
+
console.log(` removed ${p}`)
|
|
104
|
+
}
|
|
105
|
+
} catch (err) {
|
|
106
|
+
console.log(` could not remove ${p}: ${err && err.message}`)
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function safeSpawn(cmd, args) {
|
|
111
|
+
try {
|
|
112
|
+
spawnSync(cmd, args, { stdio: 'ignore' })
|
|
113
|
+
} catch {}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function getuid() {
|
|
117
|
+
return typeof process.getuid === 'function' ? process.getuid() : 0
|
|
118
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: contrast
|
|
3
|
+
description: >-
|
|
4
|
+
index of all Contrast and rnx agent skills and CLI commands.
|
|
5
|
+
auto-generated from the CLI info registry — do not edit by hand.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# contrast
|
|
9
|
+
|
|
10
|
+
overview of all available skills and CLI commands in this repo.
|
|
11
|
+
|
|
12
|
+
> this file is auto-generated by `bun scripts/generate-contrast-skill.ts`.
|
|
13
|
+
> to update, edit the source registries and re-run the generator.
|
|
14
|
+
|
|
15
|
+
## rnx CLI commands
|
|
16
|
+
|
|
17
|
+
the `rnxsim` CLI is the operational surface for booting shells, driving
|
|
18
|
+
automation, inspecting the render tree, and managing sims.
|
|
19
|
+
|
|
20
|
+
| command | description |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `rnxsim maestro` | author, generate, and run Maestro YAML flows against rnx |
|
|
23
|
+
| `rnxsim detox` | run existing Detox suites against rnx on headless Chromium |
|
|
24
|
+
| `rnxsim cleanup` | inspect and reclaim local rnx disk usage |
|
|
25
|
+
| `rnxsim record` | capture the live sim as webm/mp4/gif, or sample N png frames (--frames) |
|
|
26
|
+
| `rnxsim film` | record a flow on the flat canvas, replay it on the 3d device stage under a camera cinematic, save a clip |
|
|
27
|
+
| `rnxsim storage` | manage guest app storage and launch profiles |
|
|
28
|
+
| `rnxsim permissions` | inspect and change simulated operating-system permissions |
|
|
29
|
+
| `rnxsim perf` | CPU, React render, shell frame, and scroll-layer profiling |
|
|
30
|
+
| `rnxsim describe` | curated human-readable UI summary (default inspection tool) |
|
|
31
|
+
| `rnxsim find` | locate nodes by text / testID / role / type / predicate |
|
|
32
|
+
| `rnxsim assert` | run any read verb and convert its output into an exit code |
|
|
33
|
+
| `rnxsim screenshot` | capture PNGs and manage App Store screenshot assets |
|
|
34
|
+
| `rnxsim get` | read runtime state (tree, a11y, layout, url, count, errors, …) |
|
|
35
|
+
| `rnxsim do` | drive the app (tap, type, scroll, swipe, key, reload, …) |
|
|
36
|
+
| `rnxsim wait` | block until the runtime reaches a known state |
|
|
37
|
+
| `rnxsim shell` | drive shell state and simulator chrome |
|
|
38
|
+
| `rnxsim mode` | toggle screenshot and 3D display modes |
|
|
39
|
+
| `rnxsim device` | inspect or change the live device preset for a sim |
|
|
40
|
+
| `rnxsim inspect` | query, describe, and drive the running rnx instance |
|
|
41
|
+
| `rnxsim network` | inspect live network traffic from the running rnx worker |
|
|
42
|
+
| `rnxsim logs` | inspect live console output from the running rnx worker |
|
|
43
|
+
| `rnxsim debug` | drive __sootsimDebug: channels, snapshots, and inspectors |
|
|
44
|
+
| `rnxsim what-happened` | show recent semantic events: toasts, keyboards, screens, alerts, fetches, errors |
|
|
45
|
+
| `rnxsim timeline` | control the semantic event timeline (enable opt-in kinds, clear, dump) |
|
|
46
|
+
| `rnxsim open` | load a target into the current sim or open a new one |
|
|
47
|
+
| `rnxsim list` | list connected sims or available launch drivers |
|
|
48
|
+
| `rnxsim use` | select a connected sim |
|
|
49
|
+
| `rnxsim skill` | install and inspect bundled rnx agent skills |
|
|
50
|
+
| `rnxsim claim` | take an exclusive lease on a sim |
|
|
51
|
+
| `rnxsim agent` | attached projects + local agent sessions (codex/claude) |
|
|
52
|
+
| `rnxsim close` | close a connected sim |
|
|
53
|
+
| `rnxsim setup` | check local setup and install the recommended bridge daemon |
|
|
54
|
+
| `rnxsim compat` | check package compatibility |
|
|
55
|
+
| `rnxsim report-issue` | send an explicitly approved compatibility report |
|
|
56
|
+
| `rnxsim desktop` | launch or install the desktop companion |
|
|
57
|
+
| `rnxsim daemon` | manage the optional background bridge service |
|
|
58
|
+
| `rnxsim version` | show the CLI + engine runtime versions you are running |
|
|
59
|
+
| `rnxsim upgrade` | update the rnxsim CLI and engine runtime to the latest |
|
|
60
|
+
| `rnxsim serve` | run the rnx bridge in the foreground |
|
|
61
|
+
| `rnxsim runtime` | manage engine runtimes under ~/.sootsim/runtimes/ |
|
|
62
|
+
| `rnxsim auth` | inspect active CLI auth |
|
|
63
|
+
| `rnxsim login` | sign in for preview uploads |
|
|
64
|
+
| `rnxsim logout` | clear the local desktop auth session |
|
|
65
|
+
| `rnxsim config` | manage local CLI preferences |
|
|
66
|
+
|
|
67
|
+
### runtime verb groups
|
|
68
|
+
|
|
69
|
+
every runtime verb is organized under one of these grouping prefixes.
|
|
70
|
+
run `rnxsim --help` to see the full list under each group.
|
|
71
|
+
|
|
72
|
+
- `rnxsim describe` — summarize the current UI
|
|
73
|
+
- `rnxsim find <...>` — unified finder (bare text, --testid, --role, --type, --pressable, --visible)
|
|
74
|
+
- `rnxsim get <noun>` — read runtime state (tree, a11y, url, count, errors, warnings, requests, globals, layout, node)
|
|
75
|
+
- `rnxsim do <action>` — drive the app (tap, tap-text, tap-id, type, type-into, key, dismiss, scroll, drag, swipe, pinch, reload, shell, sleep, settle, wait)
|
|
76
|
+
- `rnxsim debug <tool>` — instrumentation (state, js, eval, perf, sample-color, enable/disable channels, snapshots, diff, record, recent)
|
|
77
|
+
|
|
78
|
+
### global flags
|
|
79
|
+
|
|
80
|
+
- `-h, --help` — show help
|
|
81
|
+
- `-V, --version` — show version
|
|
82
|
+
- `-v, --verbose` — verbose output
|
|
83
|
+
- `-p, --port <number>` — bridge port, depending on command
|
|
84
|
+
- `-d, --device <model>` — override the simulated device model
|
|
85
|
+
- `-t, --theme <scheme>` — override light, dark, or auto color scheme
|
|
86
|
+
- `--headless` — run browser automation without a visible window where supported
|
|
87
|
+
|
|
88
|
+
## bundled rnx agent skills
|
|
89
|
+
|
|
90
|
+
skills for working with the rnx native preview engine:
|
|
91
|
+
|
|
92
|
+
| skill | description |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `/rnx-debug` | Debug rendering, animation, gesture, performance, and accessibility issues in a React Native app running under rnx. Reach for this whenever an animation looks wrong (janky, stutters, snaps, only updates once, or doesn't move at all), a swipe/transition/gesture misbehaves or feels broken, scrolling drops frames or feels slow, the UI renders the wrong tree/props, or a screen reader can't reach something — and drive the rnxsim CLI debug tooling first, not screenshots or ad-hoc logging. |
|
|
95
|
+
| `/rnx-perf` | Optimize rnx engine and app performance — scroll jank, dropped frames, slow animation, idle CPU, memory growth, and "smooth normally but laggy under load" (video calls, busy machines). Covers measuring on the right thread with the right browser, proving each perf tier actually engages via its counters, a CPU-contention test harness, and the map of existing perf machinery so you improve it instead of reinventing it. For general app debugging load /rnx-debug first. |
|
|
96
|
+
| `/rnx-setup` | Get rnx connected to your React Native app — from `rnxsim setup` to a driveable sim |
|
|
97
|
+
| `/rnx-test` | Run automated tests against your React Native app under rnx with Maestro YAML or Detox/Jest |
|
|
98
|
+
| `/rnx-visual` | Pixel-level rendering comparison between rnx and native iOS — fonts, gradients, shadows, image fidelity |
|
|
99
|
+
|
|
100
|
+
## automatic settling
|
|
101
|
+
|
|
102
|
+
every CLI command already waits at the right moment — **do not wrap
|
|
103
|
+
commands in your own `sleep` or chain `do settle` "just to be safe"**.
|
|
104
|
+
|
|
105
|
+
- **before read commands** (`describe`, `find`, `get`, `tree`, `node`,
|
|
106
|
+
`layout`, `screenshot`, `capture`, `a11y`, `sample-color`, `count`,
|
|
107
|
+
and every gesture — `tap`, `tap-id`, `tap-text`, `type-into`,
|
|
108
|
+
`touch`, `swipe`, `drag`, `scroll`, `pinch`, `long-press`,
|
|
109
|
+
`double-tap`, `gesture`) the CLI waits up to **1800 ms** for any
|
|
110
|
+
in-flight screen transition to actually start, so the tree you read is
|
|
111
|
+
never mid-flip.
|
|
112
|
+
- **after write commands** (`tap`, `tap-text`, `tap-id`, `type`,
|
|
113
|
+
`type-into`, `key`, `key-sequence`, `keycode`, `drag`, `swipe`,
|
|
114
|
+
`long-press`, `touch`, `gesture`, `pinch`, `scroll`, `shell`)
|
|
115
|
+
the CLI polls the layout hash until it is stable for two consecutive
|
|
116
|
+
frames. budget: **400 ms for agents** (`SOOTSIM_AGENT=1`, set by the
|
|
117
|
+
harness), 200 ms for humans.
|
|
118
|
+
|
|
119
|
+
what this means:
|
|
120
|
+
|
|
121
|
+
- `rnxsim do tap-id login` then `rnxsim find "Welcome"` Just Works™.
|
|
122
|
+
- you only need `rnxsim do settle <seconds>` or `rnxsim wait idle
|
|
123
|
+
--max-ms <N>` when the CLI explicitly prints
|
|
124
|
+
`⚠ auto-wait timed out after Nms — next command may see mid-animation
|
|
125
|
+
state`, or when the transition you care about lasts longer than ~400 ms
|
|
126
|
+
(full stack navigation, crossfades, video load).
|
|
127
|
+
- opt-out: `--no-wait` on a single command, `SOOTSIM_NO_AUTO_WAIT=1`
|
|
128
|
+
for a whole lane.
|
|
129
|
+
- if a read keeps racing its write, the fix is **never** a blind `sleep` —
|
|
130
|
+
prefer `wait selector`, `wait ready`, `wait idle`, or a longer
|
|
131
|
+
explicit `do settle`, and investigate whether the app's animation
|
|
132
|
+
completion signal is actually firing.
|
|
133
|
+
|
|
134
|
+
## quick reference
|
|
135
|
+
|
|
136
|
+
### dev workflow
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
bun dev # start everything
|
|
140
|
+
rnxsim dev -- pnpm dev # wrap a bundler
|
|
141
|
+
rnxsim open 8081 # load an app
|
|
142
|
+
rnxsim describe # inspect the UI tree
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### debugging
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
rnxsim get errors 5 # recent console errors
|
|
149
|
+
rnxsim get requests 5 # recent failed requests
|
|
150
|
+
rnxsim debug snapshot before # capture state
|
|
151
|
+
rnxsim debug diff before after # compare snapshots
|
|
152
|
+
rnxsim debug state shell # runtime state dump
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### testing
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
rnxsim maestro test .maestro/ # run Maestro YAML flows
|
|
159
|
+
rnxsim maestro generate "login" # generate and run a Maestro flow
|
|
160
|
+
rnxsim detox # run Detox/Jest suites
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### inspection
|
|
164
|
+
|
|
165
|
+
```sh
|
|
166
|
+
rnxsim describe # visible elements
|
|
167
|
+
rnxsim find "Sign in" # find by text
|
|
168
|
+
rnxsim find --testid loginButton # find by testID
|
|
169
|
+
rnxsim do tap-text "Submit" # tap by text
|
|
170
|
+
rnxsim do type "hello" # type text
|
|
171
|
+
```
|