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,200 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{f as p,m as R}from"./chunk-XRGEEPJ5.js";import{L as A,M as _,N as S,O as N,P as $}from"./chunk-TGQNQ6XT.js";import{h as D,j as O,l as T}from"./chunk-7INBNA3U.js";import"./chunk-33FKQH54.js";import"./chunk-7VWOSTD5.js";import"./chunk-66NF2KNG.js";import"./chunk-MENV7VLD.js";var F=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],L="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function I(){console.log(`
|
|
5
|
+
rnxsim debug \u2014 drive __sootsimDebug from the terminal
|
|
6
|
+
|
|
7
|
+
usage:
|
|
8
|
+
rnxsim debug <subcommand> [args]
|
|
9
|
+
|
|
10
|
+
subcommands:
|
|
11
|
+
enable <channels> turn on one or more debug channels
|
|
12
|
+
channels: ${F.slice(0,-1).join(", ")}
|
|
13
|
+
or 'all' for every channel
|
|
14
|
+
disable <channels> turn off one or more debug channels (or 'all')
|
|
15
|
+
toggle <channel> flip a single channel
|
|
16
|
+
status list currently-enabled channels
|
|
17
|
+
channels list every known channel name
|
|
18
|
+
flags print the full DEBUG flag object
|
|
19
|
+
|
|
20
|
+
state <kind> ... dump raw runtime state (diagnostic \u2014 not a getter)
|
|
21
|
+
kinds: shell, worker, keyboard, node <id>,
|
|
22
|
+
scroll <id>, scroll-hit <x> <y>,
|
|
23
|
+
hit <x> <y>, gesture <x> <y>
|
|
24
|
+
|
|
25
|
+
js <code> execute javascript in the running app. SootSim
|
|
26
|
+
is the canonical state object \u2014 reach into its
|
|
27
|
+
bridges / state / chrome / debug slots directly.
|
|
28
|
+
e.g. SootSim.bridges.test.findByText("Sign in")
|
|
29
|
+
eval <code> alias for js
|
|
30
|
+
perf <sub> shell frame profiling: start, stop, transition
|
|
31
|
+
memory [--watch [s]] per-worker object counts + heaps; --watch samples
|
|
32
|
+
every --interval seconds and reports slopes
|
|
33
|
+
sample-color <...> sample averaged color from canvas (same flags as
|
|
34
|
+
screenshot)
|
|
35
|
+
|
|
36
|
+
snapshot [label] capture a tree snapshot (layout + transform + opacity)
|
|
37
|
+
snapshots list taken snapshot labels
|
|
38
|
+
diff <a> <b> compare two snapshots by label
|
|
39
|
+
clear-snapshots [label] drop a snapshot (or all if no label given)
|
|
40
|
+
|
|
41
|
+
image-audit for every image the compositor actually drew, the
|
|
42
|
+
source pixels it landed on each device pixel. a row
|
|
43
|
+
whose shortfall is well under 1.0 is an image the
|
|
44
|
+
pipeline under-resolved; 0.5 is half resolution.
|
|
45
|
+
flags: --min <ratio> (default 0.98), --all, --json
|
|
46
|
+
exits 1 when any image is under the ratio, and 2 when
|
|
47
|
+
the audit observed no image draws at all
|
|
48
|
+
|
|
49
|
+
find sheets dump Sheet.Frame-shaped nodes currently in the tree
|
|
50
|
+
find portals dump portal-host / portal-view nodes
|
|
51
|
+
find boundaries dump live paint boundaries (+ why scroll rows were
|
|
52
|
+
rejected from the auto-retained raster tier)
|
|
53
|
+
|
|
54
|
+
trace shell [cmd] opt-in shell animation trace
|
|
55
|
+
cmds: on [limit], off, status, clear, [recentLimit]
|
|
56
|
+
trace anim <sub> opt-in per-tick animation value trace
|
|
57
|
+
subs: on <id|all> [limit], off [id|all],
|
|
58
|
+
status, clear, <id> [limit]
|
|
59
|
+
record [on|off] toggle event ring buffer recording
|
|
60
|
+
recent [channel] [n] last N events (default 50), optionally filtered
|
|
61
|
+
clear-events clear the event ring buffer
|
|
62
|
+
|
|
63
|
+
options:
|
|
64
|
+
--port <port> WS bridge port (default: ${7668})
|
|
65
|
+
--sim <sim> target a specific connected sim
|
|
66
|
+
--pretty format JSON output for humans (default)
|
|
67
|
+
--json compact JSON output for pipelines
|
|
68
|
+
|
|
69
|
+
examples:
|
|
70
|
+
rnxsim debug enable sheets,portals
|
|
71
|
+
rnxsim debug snapshot before
|
|
72
|
+
rnxsim debug snapshot after
|
|
73
|
+
rnxsim debug diff before after
|
|
74
|
+
rnxsim debug image-audit per-image source pixels per device pixel
|
|
75
|
+
rnxsim debug find sheets | jq '.[] | select(.translateY != null)'
|
|
76
|
+
rnxsim debug trace shell on 240
|
|
77
|
+
rnxsim debug trace shell 120
|
|
78
|
+
rnxsim debug trace anim on 3 240
|
|
79
|
+
rnxsim debug trace anim 3 60
|
|
80
|
+
`)}function C(t){return t?t.split(",").map(a=>a.trim()).filter(Boolean):[]}function i(t,a){return t===void 0?"":JSON.stringify(t,null,a?2:0)}function k(t,a=240){let d=Number.isFinite(a)&&a>0?Math.max(1,Math.round(a)):240,m=JSON.stringify(L),h=JSON.stringify(q);return t==="on"?`(() => {
|
|
81
|
+
const root = window
|
|
82
|
+
const store = root[${m}] || (root[${m}] = {
|
|
83
|
+
enabled: false,
|
|
84
|
+
limit: ${d},
|
|
85
|
+
seq: 0,
|
|
86
|
+
samples: [],
|
|
87
|
+
prevHook: undefined,
|
|
88
|
+
hook: undefined,
|
|
89
|
+
})
|
|
90
|
+
store.limit = ${d}
|
|
91
|
+
store.enabled = true
|
|
92
|
+
const currentHook = root[${h}]
|
|
93
|
+
if (store.hook !== currentHook) {
|
|
94
|
+
store.prevHook = typeof currentHook === 'function' ? currentHook : undefined
|
|
95
|
+
}
|
|
96
|
+
if (typeof store.hook !== 'function') {
|
|
97
|
+
store.hook = (sample) => {
|
|
98
|
+
const target = root[${m}]
|
|
99
|
+
if (!target || target.enabled !== true) return
|
|
100
|
+
const samples = Array.isArray(target.samples) ? target.samples : (target.samples = [])
|
|
101
|
+
target.seq = typeof target.seq === 'number' ? target.seq + 1 : 1
|
|
102
|
+
samples.push({ seq: target.seq, ...sample })
|
|
103
|
+
if (samples.length > target.limit) {
|
|
104
|
+
samples.splice(0, samples.length - target.limit)
|
|
105
|
+
}
|
|
106
|
+
if (typeof target.prevHook === 'function') {
|
|
107
|
+
try {
|
|
108
|
+
target.prevHook(sample)
|
|
109
|
+
} catch {}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
root[${h}] = store.hook
|
|
114
|
+
return {
|
|
115
|
+
enabled: true,
|
|
116
|
+
limit: store.limit,
|
|
117
|
+
count: Array.isArray(store.samples) ? store.samples.length : 0,
|
|
118
|
+
}
|
|
119
|
+
})()`:t==="off"?`(() => {
|
|
120
|
+
const root = window
|
|
121
|
+
const store = root[${m}]
|
|
122
|
+
if (!store) return { enabled: false, limit: 0, count: 0 }
|
|
123
|
+
store.enabled = false
|
|
124
|
+
if (root[${h}] === store.hook) {
|
|
125
|
+
root[${h}] = typeof store.prevHook === 'function' ? store.prevHook : undefined
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
enabled: false,
|
|
129
|
+
limit: typeof store.limit === 'number' ? store.limit : 0,
|
|
130
|
+
count: Array.isArray(store.samples) ? store.samples.length : 0,
|
|
131
|
+
}
|
|
132
|
+
})()`:t==="clear"?`(() => {
|
|
133
|
+
const store = window[${m}]
|
|
134
|
+
if (!store) return { cleared: true, count: 0 }
|
|
135
|
+
store.samples = []
|
|
136
|
+
store.seq = 0
|
|
137
|
+
return {
|
|
138
|
+
cleared: true,
|
|
139
|
+
enabled: store.enabled === true,
|
|
140
|
+
limit: typeof store.limit === 'number' ? store.limit : 0,
|
|
141
|
+
count: 0,
|
|
142
|
+
}
|
|
143
|
+
})()`:`(() => {
|
|
144
|
+
const store = window[${m}]
|
|
145
|
+
return {
|
|
146
|
+
enabled: !!store?.enabled,
|
|
147
|
+
limit: typeof store?.limit === 'number' ? store.limit : 0,
|
|
148
|
+
count: Array.isArray(store?.samples) ? store.samples.length : 0,
|
|
149
|
+
}
|
|
150
|
+
})()`}function P(t=50){let a=Number.isFinite(t)&&t>0?Math.max(1,Math.round(t)):50;return`(() => {
|
|
151
|
+
const store = window[${JSON.stringify(L)}]
|
|
152
|
+
const all = Array.isArray(store?.samples) ? store.samples : []
|
|
153
|
+
const samples = all.slice(-${a})
|
|
154
|
+
const first = samples[0] ?? null
|
|
155
|
+
const last = samples[samples.length - 1] ?? null
|
|
156
|
+
const uniquePhases = [...new Set(samples.map((sample) => sample?.phase).filter(Boolean))]
|
|
157
|
+
const metricRange = (key) => {
|
|
158
|
+
const values = samples
|
|
159
|
+
.map((sample) => (typeof sample?.[key] === 'number' ? sample[key] : null))
|
|
160
|
+
.filter((value) => value != null)
|
|
161
|
+
if (values.length === 0) return null
|
|
162
|
+
return {
|
|
163
|
+
min: Math.min(...values),
|
|
164
|
+
max: Math.max(...values),
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
enabled: !!store?.enabled,
|
|
169
|
+
limit: typeof store?.limit === 'number' ? store.limit : 0,
|
|
170
|
+
count: samples.length,
|
|
171
|
+
total: all.length,
|
|
172
|
+
summary: first && last ? {
|
|
173
|
+
durationMs: last.ts - first.ts,
|
|
174
|
+
phases: uniquePhases,
|
|
175
|
+
start: first,
|
|
176
|
+
end: last,
|
|
177
|
+
zoomLevel: metricRange('zoomLevel'),
|
|
178
|
+
horizontalZoom: metricRange('horizontalZoom'),
|
|
179
|
+
launchProgress: metricRange('launchProgress'),
|
|
180
|
+
dismissOffsetY: metricRange('dismissOffsetY'),
|
|
181
|
+
} : null,
|
|
182
|
+
samples,
|
|
183
|
+
}
|
|
184
|
+
})()`}async function u(t,a){return T(t,a)}function z(t,a){let d=t.indexOf(a);if(d<0)return null;let m=Number(t[d+1]);return Number.isFinite(m)?m:null}async function J(t){await u(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'enable').then(() => 'enabled')"),await t.send({type:"screenshot"});let d=(await u(t,"window.__sootsimCompositor.getStats(false, false, undefined, 'disable').then((s) => ({ imageAudit: s.imageAudit }))"))?.imageAudit;if(!d)throw new Error("compositor returned no image audit");return d}function E(t){return t===null?" - ":t.toFixed(3).padStart(6)}function V(t){let a=t.sourceUri??t.testID??`node ${t.nodeId}`;return a.length<=58?a:`...${a.slice(-55)}`}function W(t,a,d){let h=t.rows.filter(c=>c.shortfall!==null).filter(c=>c.shortfall<d);if(console.log(` ${t.rows.length} images drawn (${t.draws} draws), ${h.length} below ${d} of what their source could deliver`),a.length===0){console.log(" every image delivered its source resolution");return}console.log(""),console.log(" short eff decoded source needed(dev) dest(pt) dpr image");for(let c of a){let v=`${c.decoded.width}x${c.decoded.height}`.padEnd(11),r=(c.vector?"vector":c.intrinsic?`${c.intrinsic.width}x${c.intrinsic.height}`:"?").padEnd(11),w=`${Math.round(c.needed.width)}x${Math.round(c.needed.height)}`.padEnd(12),y=`${Math.round(c.destination.width)}x${Math.round(c.destination.height)}`.padEnd(9);console.log(` ${E(c.shortfall)} ${E(c.effective.width)} ${v} ${r} ${w} ${y} ${c.dpr.toFixed(1)} ${V(c)}`)}}async function X(t,a){let d=D(t,{port:a.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),m=d.positional;(!m[0]||t.includes("--help")||t.includes("-h"))&&(I(),process.exit(0));let c=d.wsPort,v=d.simId,r=!t.includes("--json"),w=v?` --sim ${v}`:"",y=m[0],l=m.slice(1);if(new Set(["state","js","eval","perf","memory","sample-color"]).has(y)){let{runInspect:e}=await import("./inspect-CWFRFQTY.js");await e(["debug",...t],{port:a.port,verbose:a.verbose});return}let o=O(d);try{switch(y){case"enable":{let e=C(l[0]);e.length===0&&(console.error(` usage: rnxsim debug enable <channel[,channel,...]>
|
|
185
|
+
known: ${F.join(", ")}`),process.exit(1));let s=await $(o,"enable",e);console.log(i({active:s},r));break}case"disable":{let e=C(l[0]),s=await $(o,"disable",e);console.log(i({active:s},r));break}case"toggle":{let e=l[0];e||(console.error(" usage: rnxsim debug toggle <channel>"),process.exit(1));let s=await u(o,`window.__sootsimDebug.toggle(${JSON.stringify(e)})`);console.log(i({[e]:s},r));break}case"status":{let e=await A(o);console.log(i(e,r));break}case"channels":{let e=await u(o,"window.__sootsimDebug.channels()");console.log(i(e,r));break}case"flags":{let e=await _(o);console.log(i(e,r));break}case"snapshot":{let e=l[0],s=e?`window.__sootsimDebug.snapshot(${JSON.stringify(e)})`:"window.__sootsimDebug.snapshot()",n=await u(o,`(() => { const s = ${s}; if (!s) return null; return { label: s.label, at: s.at, size: s.nodes.size }; })()`);console.log(i(n,r));break}case"snapshots":{let e=await u(o,"window.__sootsimDebug.snapshots()");console.log(i(e,r));break}case"diff":{let e=l[0],s=l[1];(!e||!s)&&(console.error(" usage: rnxsim debug diff <labelA> <labelB>"),process.exit(1));let n=`(() => {
|
|
186
|
+
const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(s)});
|
|
187
|
+
if (!d) return null;
|
|
188
|
+
return {
|
|
189
|
+
a: d.a,
|
|
190
|
+
b: d.b,
|
|
191
|
+
counts: { added: d.added.length, removed: d.removed.length, changed: d.changed.length },
|
|
192
|
+
added: d.added,
|
|
193
|
+
removed: d.removed,
|
|
194
|
+
changed: d.changed,
|
|
195
|
+
};
|
|
196
|
+
})()`,g=await u(o,n);console.log(i(g,r));break}case"clear-snapshots":{let e=l[0],s=e?`window.__sootsimDebug.clearSnapshots(${JSON.stringify(e)})`:"window.__sootsimDebug.clearSnapshots()";await u(o,s),console.log(i({cleared:e||"all"},r));break}case"image-audit":{let e=z(t,"--min")??.98,s=await J(o);s.draws===0&&(console.error(` the audit recorded zero image draws, so an empty result proves nothing.
|
|
197
|
+
while it records, paint boundaries rebuild and raster blits are
|
|
198
|
+
bypassed, so every image on screen should reach the draw path.
|
|
199
|
+
zero draws means either nothing on screen is an image, or the audit
|
|
200
|
+
is not attached to the surface that paints.`),process.exit(2));let n=s.rows.filter(g=>g.shortfall!==null&&g.shortfall<e);r?W(s,t.includes("--all")?s.rows:n,e):console.log(i({...s,minimum:e,under:n.length},!1)),n.length>0&&process.exit(1);break}case"find":{let e=l[0];if(e==="sheets"||e==="portals"||e==="boundaries"){let s=await S(o,e);console.log(i(s,r))}else console.error(" usage: rnxsim debug find <sheets|portals|boundaries>"),process.exit(1);break}case"trace":{let e=l[0],s=l[1];if(e==="anim"){let n=l[1];if((!n||n==="--help"||n==="-h")&&(console.error(" usage: rnxsim debug trace anim <on|off|status|clear|<id>> [id|limit]"),process.exit(1)),n==="on"){let f=l[2]??"all",b=l[3]?Number(l[3]):void 0,x=f==="all"?"all":Number(f);x!=="all"&&!Number.isFinite(x)&&(console.error(` invalid target: ${f}`),process.exit(1)),await p(o,"enableAnimationTrace",x,b);let j=await p(o,"listAnimationTraces");console.log(i({enabled:x,traces:j},r));break}if(n==="off"){let f=l[2]??"all",b=f==="all"?"all":Number(f);b!=="all"&&!Number.isFinite(b)&&(console.error(` invalid target: ${f}`),process.exit(1)),await p(o,"disableAnimationTrace",b),console.log(i({disabled:b},r));break}if(n==="status"||n==="clear"){n==="clear"&&await p(o,"disableAnimationTrace","all");let f=await p(o,"listAnimationTraces");console.log(i({traces:f},r));break}let g=Number(n);Number.isFinite(g)||(console.error(` invalid id: ${n}`),process.exit(1));let B=l[2]?Number(l[2]):void 0,H=await p(o,"getAnimationTrace",g,B);console.log(i({id:g,samples:H},r));break}if(e!=="shell"&&(console.error(" usage: rnxsim debug trace <shell|anim> [args]"),process.exit(1)),!s||/^[0-9]+$/.test(s)){let n=s?Number(s):50,g=await u(o,P(n));console.log(i(g,r));break}if(s==="on"){let n=l[2]?Number(l[2]):240,g=await u(o,k("on",n));console.log(i(g,r));break}if(s==="off"){let n=await u(o,k("off"));console.log(i(n,r));break}if(s==="clear"){let n=await u(o,k("clear"));console.log(i(n,r));break}if(s==="status"){let n=await u(o,k("status"));console.log(i(n,r));break}console.error(" usage: rnxsim debug trace shell [on [limit]|off|status|clear|recentLimit]"),process.exit(1)}case"record":{let e=l[0],n=await u(o,`window.__sootsimDebug.record(${e==="on"?"true":e==="off"?"false":"undefined"})`);console.log(i({recording:n},r));break}case"recent":{let e=l[0],s=l[1]?Number(l[1]):50,n=await N(o,e,s);console.log(i(n,r));break}case"clear-events":{await u(o,"window.__sootsimDebug.clearEvents()"),console.log(i({cleared:!0},r));break}default:console.error(` unknown subcommand: ${y}`),I(),process.exit(1)}}catch(e){console.error(` debug failed: ${e.message}`),await R(o,{errorsCommand:`rnxsim get errors 5${w}`,warningsCommand:`rnxsim get warnings 5${w}`,requestsCommand:`rnxsim get requests 5${w}`}),process.exit(1)}finally{o.close()}}export{X as runDebug};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{a as d}from"./chunk-WBT32R6N.js";import"./chunk-37I5AIS7.js";import{a as u}from"./chunk-LDQ7HVCW.js";import{a as l}from"./chunk-VUFRB347.js";import{h as m}from"./chunk-HMDOLCKG.js";import"./chunk-SI3BUTQR.js";import"./chunk-274UD5FD.js";import"./chunk-XRGEEPJ5.js";import"./chunk-TGQNQ6XT.js";import{b as c,f as a}from"./chunk-GZDHEONW.js";import{a as p}from"./chunk-G74YIEVS.js";import"./chunk-T4FT6CM7.js";import"./chunk-YZRFF4YA.js";import"./chunk-4BXCZHAU.js";import"./chunk-FWYYCUAZ.js";import"./chunk-AY47WKS5.js";import"./chunk-3D57IBPC.js";import"./chunk-7INBNA3U.js";import"./chunk-B7KMNHX7.js";import"./chunk-U4PN6JOT.js";import"./chunk-TYE3WBSR.js";import"./chunk-5OX7ANRA.js";import"./chunk-33FKQH54.js";import"./chunk-7VWOSTD5.js";import"./chunk-66NF2KNG.js";import"./chunk-ZMZTHU7V.js";import"./chunk-MENV7VLD.js";function k(e){let t=e.indexOf("--port");if(t<0)return;let o=e[t+1],n=o?Number(o):Number.NaN;return(!Number.isInteger(n)||n<=0)&&(console.error(` invalid --port value: ${o||"(missing)"}`),process.exit(1)),n}async function v(e,t){let o=k(e)??t.port;return o?m(String(o)):void 0}async function f(e,t){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
5
|
+
rnxsim desktop \u2014 launch the desktop companion
|
|
6
|
+
|
|
7
|
+
usage:
|
|
8
|
+
rnxsim desktop [options]
|
|
9
|
+
|
|
10
|
+
options:
|
|
11
|
+
--port <number> connect to running dev server on this port
|
|
12
|
+
--profile <id> launch with an isolated persistent storage profile
|
|
13
|
+
--ephemeral launch with a temporary isolated storage profile
|
|
14
|
+
|
|
15
|
+
examples:
|
|
16
|
+
rnxsim desktop
|
|
17
|
+
rnxsim desktop --port 5173
|
|
18
|
+
rnxsim desktop --profile qa
|
|
19
|
+
`),process.exit(0));let o=e.find((g,s)=>e[s-1]==="--profile"),n=e.includes("--ephemeral");o&&n&&(console.error(" rnxsim desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let h=o?c(o).id:void 0,i=p();if(!i){if(u(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await l("run rnxsim desktop install now?",!0)){console.log();let{runInstallDesktop:s}=await import("./install-desktop-KLQDNXZQ.js");await s(["--yes"]),i=p()}i||process.exit(1)}console.log(` launching ${i.path}`);let x=await v(e,t),r=await a.launch({url:x,device:t.device,profileId:h,ephemeralProfile:n});r.launched||(console.error(` ${r.message}`),process.exit(1)),console.log(` ${r.message}`)}function w(){console.log(`
|
|
20
|
+
rnxsim desktop \u2014 launch or install the desktop companion
|
|
21
|
+
|
|
22
|
+
usage:
|
|
23
|
+
rnxsim desktop [options]
|
|
24
|
+
rnxsim desktop install [options]
|
|
25
|
+
|
|
26
|
+
options:
|
|
27
|
+
--port <number> connect to a running dev server on this port
|
|
28
|
+
--profile <id> launch with an isolated persistent storage profile
|
|
29
|
+
--ephemeral launch with a temporary isolated storage profile
|
|
30
|
+
-y, --yes install without prompting
|
|
31
|
+
`)}async function T(e,t){if(e.includes("--help")||e.includes("-h")){w();return}let o=e.find(n=>!n.startsWith("-"));if(o==="install"){let n=e.indexOf(o);await d([...e.slice(0,n),...e.slice(n+1)]);return}await f(e,t)}export{T as runDesktop};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{e as N}from"./chunk-MNGQ42QE.js";import"./chunk-BRIZOR4K.js";import"./chunk-2SA2VTGP.js";import"./chunk-KZW5WBGU.js";import"./chunk-LDQ7HVCW.js";import"./chunk-Q3RGLERJ.js";import"./chunk-Y2FSZSO7.js";import{c as M,d as $,e as E}from"./chunk-NPVGMH2N.js";import{a as F}from"./chunk-BKNOLP3J.js";import"./chunk-HMDOLCKG.js";import"./chunk-SI3BUTQR.js";import"./chunk-274UD5FD.js";import"./chunk-XRGEEPJ5.js";import"./chunk-TGQNQ6XT.js";import"./chunk-GZDHEONW.js";import"./chunk-G74YIEVS.js";import"./chunk-T4FT6CM7.js";import"./chunk-YZRFF4YA.js";import"./chunk-4BXCZHAU.js";import"./chunk-FWYYCUAZ.js";import"./chunk-AY47WKS5.js";import"./chunk-3D57IBPC.js";import"./chunk-7INBNA3U.js";import"./chunk-PEPUGJVI.js";import"./chunk-N6A3SXMR.js";import"./chunk-TCWQJILS.js";import"./chunk-B7KMNHX7.js";import"./chunk-U4PN6JOT.js";import"./chunk-HG7ORJMT.js";import"./chunk-TYE3WBSR.js";import"./chunk-5OX7ANRA.js";import"./chunk-33FKQH54.js";import"./chunk-7VWOSTD5.js";import"./chunk-6UKJB2VC.js";import"./chunk-66NF2KNG.js";import{a as R}from"./chunk-ZMZTHU7V.js";import"./chunk-MENV7VLD.js";import{spawn as B}from"child_process";import{existsSync as g,mkdirSync as W,readFileSync as C,writeFileSync as y,unlinkSync as k}from"fs";import{tmpdir as J}from"os";import{dirname as q,resolve as a,join as U,relative as H}from"path";function V(){try{let t=import.meta.resolve(`${R.packageName}/detox`);return q(t.startsWith("file://")?t.slice(7):t)}catch{return a(import.meta.dirname,"..","..","detox")}}var z=`
|
|
5
|
+
rnxsim detox \u2014 run detox-style tests against an rnx shell
|
|
6
|
+
|
|
7
|
+
usage:
|
|
8
|
+
rnxsim detox [testFiles...] run all tests under e2e/, test/e2e/, or detox/
|
|
9
|
+
rnxsim detox --config <path> use a specific jest config
|
|
10
|
+
rnxsim detox init scaffold sootsim-detox.config.cjs + sample test
|
|
11
|
+
rnxsim detox --watch jest watch mode
|
|
12
|
+
rnxsim detox --headed keep the rnx shell window visible
|
|
13
|
+
rnxsim detox -t <pattern> pass a jest --testNamePattern
|
|
14
|
+
rnxsim detox --no-launch skip auto-launching an rnx shell
|
|
15
|
+
|
|
16
|
+
rnxsim detox auto-launches an rnx shell if none is running on the
|
|
17
|
+
expected port. disable with --no-launch if you're managing the shell yourself.
|
|
18
|
+
`;async function ae(t,s={}){if((t.includes("--help")||t.includes("-h"))&&(console.log(z),process.exit(0)),t[0]==="init")return Y();let r=e=>{let o=t.indexOf(e);return o>=0?t[o+1]:void 0},n=e=>t.includes(e),u=n("--watch"),m=n("--headed"),d=n("--no-launch"),T=r("--config"),f=s.port||Number(process.env.SOOTSIM_PORT)||5173,A=t.filter((e,o)=>{if(e.startsWith("--")||e==="-t"||e==="-h")return!1;let l=t[o-1];return!(l==="--config"||l==="-t"||l==="--testNamePattern"||l==="--grep")}),L=t.filter(e=>e==="--runInBand"||e.startsWith("--maxWorkers=")),O=["e2e","test/e2e","detox"],c=process.env.SOOTSIM_TEST_DIR?a(process.cwd(),process.env.SOOTSIM_TEST_DIR):null;if(!c)for(let e of O){let o=a(process.cwd(),e);if(g(o)){c=o;break}}c||(console.error(` error: no detox tests found. expected one of: ${O.join(", ")}
|
|
19
|
+
run 'rnxsim detox init' to scaffold a starter suite.`),process.exit(1)),d||await X(f);let i=["jest"],x=T||Q(["sootsim-detox.config.cjs","jest.config.cjs","jest.config.js"]),p=null;if(x)i.push("--config",a(process.cwd(),x));else{let e=a(V(),"jest-preset.cjs");p=U(J(),`sootsim-detox-${process.pid}.config.cjs`);let o={rootDir:c,roots:["<rootDir>"],testMatch:["<rootDir>/**/*.test.ts","<rootDir>/**/*.test.js"]};y(p,`module.exports = { ...require(${JSON.stringify(e)}), ...${JSON.stringify(o)} }
|
|
20
|
+
`),i.push("--config",p)}u&&i.push("--watch");let I=r("-t")||r("--testNamePattern")||r("--grep");I&&i.push("-t",I);let j=F(),b=!u&&M({uploadedShare:!1,auth:j}),h=process.env.SOOTSIM_JEST_OUTPUT_FILE||null;process.env.SOOTSIM_JEST_JSON==="1"&&i.push("--json"),process.env.SOOTSIM_JEST_OUTPUT_FILE?i.push("--outputFile",process.env.SOOTSIM_JEST_OUTPUT_FILE):b&&(h=U(J(),`sootsim-detox-results-${process.pid}.json`),i.push("--json","--outputFile",h)),i.push(...L),i.push(...A),console.log(" rnxsim detox"),console.log(` test dir: ${c}`),console.log(` port: ${f}${m?" (headed)":""}`),x&&console.log(` config: ${x}`);let S=B("npx",i,{cwd:process.cwd(),stdio:"inherit",env:{...process.env,SOOTSIM_TEST_DIR:c,SOOTSIM_PORT:String(f),SOOTSIM_HEADED:m?"1":"",SOOTSIM_URL:process.env.SOOTSIM_URL||`http://localhost:${f}`}}),v=e=>()=>{S.kill(e)},_=v("SIGTERM"),D=v("SIGINT");process.on("SIGTERM",_),process.on("SIGINT",D);let G=Date.now(),w=await new Promise((e,o)=>{S.once("error",o),S.once("exit",(l,P)=>{if(P){console.error(` error: jest terminated by ${P}`),e(1);return}e(l??1)})});if(process.off("SIGTERM",_),process.off("SIGINT",D),p)try{k(p)}catch{}if(b){let e=h?K(h):null,o=await E(),l=await $({origin:o,kind:"detox",name:H(process.cwd(),c)||"e2e",status:w===0?"passed":"failed",summary:e?`${e.numPassedTests}/${e.numTotalTests} tests passed`:null,failureMessage:w===0?null:e?.firstFailure??null,stepCount:e?.numTotalTests??null,failedStepIndex:e?.firstFailedIndex??null,durationMs:Date.now()-G,auth:j});l&&console.log(` run: ${l.id}`)}process.exit(w)}function K(t){try{let s=JSON.parse(C(t,"utf8")),r=null,n=null,u=0;for(let m of s.testResults??[])for(let d of m.testResults??[]){if(n==null&&d.status==="failed"){n=u;let T=d.failureMessages?.[0]?.split(`
|
|
21
|
+
`)[0];r=[d.fullName,T].filter(Boolean).join(": ")||null}u+=1}return typeof s.numTotalTests!="number"?null:{numTotalTests:s.numTotalTests,numPassedTests:s.numPassedTests??0,firstFailure:r,firstFailedIndex:n}}catch{return null}finally{if(!process.env.SOOTSIM_JEST_OUTPUT_FILE)try{k(t)}catch{}}}function Q(t){for(let s of t)if(g(a(process.cwd(),s)))return s;return null}async function X(t){await N()||console.warn(` warn: no rnx shell reachable on :${t}. start your app, then run \`rnxsim open <app-port>\`
|
|
22
|
+
or pass --no-launch if you're managing the shell yourself.`)}function Y(){let t=process.cwd(),s=a(t,"sootsim-detox.config.cjs");g(s)?console.log(` skip: ${s} already exists`):(y(s,`// rnxsim detox jest config.
|
|
23
|
+
// extends the sootsim preset, which rewrites \`import ... from 'detox'\`
|
|
24
|
+
// to the sootsim driver and keeps your jest transforms intact.
|
|
25
|
+
|
|
26
|
+
/** @type {import('@jest/types').Config.InitialOptions} */
|
|
27
|
+
module.exports = {
|
|
28
|
+
preset: 'rnxsim/detox/jest-preset',
|
|
29
|
+
rootDir: __dirname,
|
|
30
|
+
testMatch: ['<rootDir>/e2e/**/*.test.ts', '<rootDir>/e2e/**/*.test.js'],
|
|
31
|
+
}
|
|
32
|
+
`),console.log(` created ${s}`));let r=a(t,"e2e"),n=a(r,"example.test.ts");g(n)?console.log(` skip: ${n} already exists`):(W(r,{recursive:!0}),y(n,`// sample rnxsim detox test. resolve \`detox\` via the jest preset in
|
|
33
|
+
// sootsim-detox.config.cjs \u2014 no extra imports required.
|
|
34
|
+
|
|
35
|
+
import { by, device, element, expect, waitFor } from 'detox'
|
|
36
|
+
|
|
37
|
+
describe('example', () => {
|
|
38
|
+
beforeAll(async () => {
|
|
39
|
+
await device.launchApp()
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it('shows the welcome text', async () => {
|
|
43
|
+
await waitFor(element(by.text('Welcome'))).toBeVisible().withTimeout(5000)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('taps a button by id', async () => {
|
|
47
|
+
await element(by.id('start-button')).tap()
|
|
48
|
+
await expect(element(by.id('home-screen'))).toBeVisible()
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
`),console.log(` created ${n}`)),console.log(`
|
|
52
|
+
next:`),console.log(" rnxsim detox # run the sample"),console.log(" rnxsim detox --watch"),process.exit(0)}export{ae as runDetox};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import"./chunk-274UD5FD.js";import"./chunk-4BXCZHAU.js";import{h as d,j as l,m as a}from"./chunk-7INBNA3U.js";import"./chunk-TYE3WBSR.js";import{b as c,c as s,d as g}from"./chunk-5OX7ANRA.js";import"./chunk-33FKQH54.js";import"./chunk-7VWOSTD5.js";import"./chunk-66NF2KNG.js";import"./chunk-MENV7VLD.js";function h(){console.log(`
|
|
5
|
+
rnxsim device \u2014 inspect or change the live device preset for a sim
|
|
6
|
+
|
|
7
|
+
usage:
|
|
8
|
+
rnxsim device
|
|
9
|
+
rnxsim device get
|
|
10
|
+
rnxsim device set <model> [--sim <id>]
|
|
11
|
+
rnxsim device list
|
|
12
|
+
|
|
13
|
+
examples:
|
|
14
|
+
rnxsim device
|
|
15
|
+
rnxsim device set iphone-14
|
|
16
|
+
rnxsim device set iphone-16-pro-max --sim a7
|
|
17
|
+
`)}function v(n){let t=s(n);console.log(` ${n.padEnd(14)} ${String(t.width).padStart(4)}x${String(t.height).padEnd(4)} pt ${String(t.width*t.scale).padStart(4)}x${String(t.height*t.scale).padEnd(4)} px ${t.name}`)}async function u(n){let t=l(n);try{let o=await a(t,"SootSim.bridges.settings.get")??{deviceModel:null},i=typeof o.deviceModel=="string"?o.deviceModel:null;if(!i||!(i in c))return null;let e=s(i);return{model:i,width:e.width,height:e.height,scale:e.scale,name:e.name}}finally{t.close()}}async function $(n,t){(n.includes("--help")||n.includes("-h"))&&(h(),process.exit(0));let o=n[0];if(!o||o==="get"){let i=d(n,{port:t.port}),e=await u(i);e||(console.error(" error: could not read current device from the target sim"),process.exit(1)),console.log(` ${e.model} ${e.width}x${e.height} pt ${e.width*e.scale}x${e.height*e.scale} px ${e.name}`);return}if(o==="list"){console.log(` available devices:
|
|
18
|
+
`);for(let i of g())v(i);return}if(o==="set"){let i=n[1];i||(console.error(" error: device set expects a model"),process.exit(1)),i in c||(console.error(` error: unknown device "${i}"`),console.error(" run `rnxsim device list` to see valid models"),process.exit(1));let e=d(n,{port:t.port}),m=l(e);try{let p=await a(m,"SootSim.bridges.settings.set","deviceModel",i),r=s(i);console.log(` ${p?"set":"kept"} device: ${i} (${r.width}x${r.height} pt, ${r.width*r.scale}x${r.height*r.scale} px)${p?" \u2014 reloading sim":""}`)}finally{m.close()}return}h(),console.error(` unknown subcommand: ${o}`),process.exit(1)}export{$ as runDeviceCommand};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{h as E,j as x,m as b}from"./chunk-7INBNA3U.js";import{f as v}from"./chunk-33FKQH54.js";import"./chunk-7VWOSTD5.js";import"./chunk-66NF2KNG.js";import"./chunk-MENV7VLD.js";function j(e){return e.ts??e.t??0}function W(e){return typeof e.message=="string"&&e.message.length>0?e.message:Array.isArray(e.args)?e.args.map(r=>typeof r=="string"?r:JSON.stringify(r)).join(" "):""}var B=new Set(["timeline","network","react","console","screen"]);function P(){console.log(`
|
|
5
|
+
rnxsim get diagnosis \u2014 compact "what just went wrong?" report
|
|
6
|
+
|
|
7
|
+
usage:
|
|
8
|
+
rnxsim get diagnosis [--since <duration>] [--include <csv>] [--json]
|
|
9
|
+
|
|
10
|
+
options:
|
|
11
|
+
--since <d> absolute window for timeline + network (e.g. 90s, 2m, 500ms; default 90s)
|
|
12
|
+
--include <csv> comma-separated dimensions: timeline, network, react, console, screen
|
|
13
|
+
(default: all)
|
|
14
|
+
--slow-threshold <n> network slow-request threshold in ms (default 1000)
|
|
15
|
+
--limit <n> rows to print per react table (default 8)
|
|
16
|
+
--json emit a single structured JSON document
|
|
17
|
+
|
|
18
|
+
the diagnose report runs every dimension in parallel against the same
|
|
19
|
+
sim and returns a grouped summary. use \`rnxsim what-happened\`
|
|
20
|
+
for chronological events, \`rnxsim network\` for full request inspection,
|
|
21
|
+
\`rnxsim perf react summary\` for the React tables on their own.
|
|
22
|
+
|
|
23
|
+
examples:
|
|
24
|
+
rnxsim get diagnosis
|
|
25
|
+
rnxsim get diagnosis --since 30s --include network,react
|
|
26
|
+
rnxsim get diagnosis --json > /tmp/diagnosis.json
|
|
27
|
+
`)}function A(e,r){if(!e)return r;let o=/^(\d+(?:\.\d+)?)(ms|s|m)?$/.exec(e.trim());if(!o)return r;let s=Number(o[1]),t=o[2]??"ms";return t==="s"?s*1e3:t==="m"?s*6e4:s}function D(e){if(!e)return B;let r=new Set;for(let o of e.split(",")){let s=o.trim().toLowerCase();s&&r.add(s)}return r}function k(e,r){let o=e.indexOf(r);if(o>=0&&o+1<e.length)return e[o+1];let s=`${r}=`;return e.find(t=>t.startsWith(s))?.slice(s.length)}function R(e,r,o){let s=k(e,r);if(s===void 0)return o;let t=Number(s);return Number.isFinite(t)&&t>0?Math.round(t):o}async function O(e,r){let o={limit:500,since:Date.now()-r},t=(await b(e,"SootSim.bridges.timeline.recent",o)).events??[],i={},c=[],d=[],p=[];for(let u of t){i[u.kind]=(i[u.kind]??0)+1;let l=u.data,m=l&&typeof l=="object"?l.level:void 0;u.kind==="console"&&(m==="error"||m==="warn")&&c.push(u),(u.kind==="alert"||u.kind==="actionsheet"||u.kind==="picker")&&d.push(u),(u.kind==="screen"||u.kind==="route")&&p.push(u)}return{events:t,byKind:i,total:t.length,errors:c,alerts:d,screens:p}}async function L(e,r,o){let s=await e.send({type:"evaluate",code:`(() => {
|
|
28
|
+
const obs = window.__sootsimObservability;
|
|
29
|
+
if (!obs) return { ok: false };
|
|
30
|
+
return { ok: true, entries: obs.network.getSnapshot() };
|
|
31
|
+
})()`});if(!s||!s.ok)return{error:"observability bridge not installed"};let t=s.entries??[],i=Date.now()-r,c=t.filter(l=>(l.startTs??l.startedAt??0)>=i),d=c.filter(l=>!!l.error||l.status!=null&&l.status>=400),p=c.filter(l=>l.durationMs!=null&&l.durationMs>=o).sort((l,m)=>(m.durationMs??0)-(l.durationMs??0)),u=c.filter(l=>l.durationMs==null).length;return{total:c.length,failed:d,slow:p,inFlight:u,slowThresholdMs:o}}async function C(e,r){let[o,s]=await Promise.all([b(e,"SootSim.bridges.reactProfile.slow",{limit:r}),b(e,"SootSim.bridges.reactProfile.rerenders",{limit:r})]);return{commits:o.commits??s.commits??0,slow:o.rows??[],rerenders:s.rows??[],durationWarning:o.durationWarning,error:o.error??s.error}}async function _(e,r){let o=await e.send({type:"evaluate",code:`(() => {
|
|
32
|
+
const obs = window.__sootsimObservability;
|
|
33
|
+
if (!obs) return { ok: false };
|
|
34
|
+
return { ok: true, entries: obs.logs.getSnapshot() };
|
|
35
|
+
})()`});if(!o||!o.ok)return{error:"observability bridge not installed"};let s=Date.now()-r,i=(o.entries??[]).filter(c=>j(c)>=s&&(c.level==="error"||c.level==="warn"));return{entries:i.slice(-20),total:i.length}}function T(e){let r=e.error?"err":e.status!=null?String(e.status):"...",o=(e.method??"GET").padEnd(6),s=e.durationMs!=null?`${e.durationMs.toFixed(0)}ms`:"...",t=e.displayUrl??e.url,i=t.length>96?`${t.slice(0,92)}\u2026`:t;return` ${r.padStart(3)} ${o} ${s.padStart(7)} ${i} (${e.id})`}function N(e,r){let o=((e.t-r)/1e3).toFixed(2),s=e.t>=r?"-":"+",t=e.data,i="";if(t&&typeof t=="object"){let c=(t.message??"").toString().slice(0,120),d=(t.title??t.name??t.path??t.url??"").toString();i=[(t.phase??"").toString(),d,c].filter(Boolean).join(" \xB7 ")}return` -${o.padStart(5)}s [${e.kind}] ${i}`}function M(e,r,o){if(r.length===0)return`${o}(no rows)`;let s=e.map((i,c)=>Math.max(i.length,...r.map(d=>d[c]?.length??0))),t=i=>i.map((c,d)=>c.padEnd(s[d])).join(" ").trimEnd();return[t(e),t(e.map(i=>"-".repeat(i.length))),...r.map(t)].map(i=>`${o}${i}`).join(`
|
|
36
|
+
`)}async function J(e,r){if(e.includes("--help")||e.includes("-h"))return P(),0;let o=E(e,{port:r.port,stripBooleanFlags:["--json","--help","-h"],stripValueFlags:["--since","--include","--limit","--slow-threshold"]}),s=o.positional[0]??"recent";if(s!=="recent")return console.error(` unknown subcommand: ${s}`),console.error(" did you mean: rnxsim get diagnosis ?"),1;let t=A(k(e,"--since"),9e4),i=D(k(e,"--include")),c=R(e,"--limit",8),d=R(e,"--slow-threshold",1e3),p=e.includes("--json"),u=x(o);try{let l=[],m=[];(i.has("timeline")||i.has("screen")||i.has("alert"))&&(m.push("timeline"),l.push(O(u,t))),(i.has("network")||i.has("fetch"))&&(m.push("network"),l.push(L(u,t,d))),i.has("react")&&(m.push("react"),l.push(C(u,c))),i.has("console")&&(m.push("console"),l.push(_(u,t)));let $=await u.send({type:"evaluate",code:"globalThis.__sootsimEngineBuild ?? null"}).then(n=>typeof n=="string"?n:null).catch(()=>null),F=await Promise.all(l),w={};for(let n=0;n<m.length;n++)w[m[n]]=F[n];if(p)return console.log(JSON.stringify({generatedAt:Date.now(),engineBuild:$,sinceMs:t,include:Array.from(i),slices:w},null,2)),0;let S=Date.now();if(console.log(` diagnose recent (last ${(t/1e3).toFixed(0)}s, include: ${Array.from(i).sort().join(",")}):`),console.log(` engine build: ${$??"unknown (no build stamp \u2014 likely a stale or pre-F20-5 engine)"}`),w.timeline){let n=w.timeline;console.log(`
|
|
37
|
+
timeline \u2014 ${n.total} event(s) in window`);let f=Object.entries(n.byKind).sort((a,g)=>g[1]-a[1]).map(([a,g])=>`${g} ${a}`).join(" \xB7 ");if(f&&console.log(` summary: ${f}`),n.screens.length){let g=n.screens[n.screens.length-1].data,h=g?g.name??g.activeName??g.path??"?":"?";console.log(` last screen: ${String(h)}`)}if(n.alerts.length){console.log(` alerts (${n.alerts.length}):`);for(let a of n.alerts.slice(-5))console.log(N(a,S))}if(n.errors.length){console.log(` console errors/warns from timeline (${n.errors.length}):`);for(let a of n.errors.slice(-5))console.log(N(a,S))}}if(w.network){let n=w.network;if("error"in n)console.log(`
|
|
38
|
+
network \u2014 ${n.error}`);else{if(console.log(`
|
|
39
|
+
network \u2014 ${n.total} request(s), ${n.failed.length} failed, ${n.slow.length} slow (>${n.slowThresholdMs}ms), ${n.inFlight} in-flight`),n.failed.length){console.log(" failed:");for(let f of n.failed.slice(-8))console.log(T(f))}if(n.slow.length){console.log(" slowest:");for(let f of n.slow.slice(0,5))console.log(T(f))}}}if(w.react){let n=w.react;console.log(`
|
|
40
|
+
react \u2014 ${n.commits} commit(s)`),n.error&&console.log(` warning: ${n.error}`),n.durationWarning&&console.log(` warning: ${n.durationWarning}`),n.slow.length>0&&n.slow.every(a=>a.totalMs<=0&&a.slowestMs<=0)&&!n.durationWarning&&console.log(" warning: every commit reports actualDuration=0ms \u2014 bundle has React profiler timer disabled"),n.slow.length&&(console.log(" slowest:"),console.log(M(["component","total","commits","slowest"],n.slow.slice(0,c).map(a=>[a.displayName,`${a.totalMs.toFixed(2)}ms`,String(a.commitCount),`${a.slowestMs.toFixed(2)}ms`])," "))),n.rerenders.length&&(console.log(" most rerenders:"),console.log(M(["component","renders","top causes"],n.rerenders.slice(0,c).map(a=>{let g=Object.entries(a.causes??{}).filter(([,h])=>h>0).sort((h,y)=>y[1]-h[1]).slice(0,3).map(([h,y])=>`${h}:${y}`).join(", ");return[a.displayName,String(a.renders??a.count??0),g||"-"]})," ")))}if(w.console){let n=w.console;if("error"in n)console.log(`
|
|
41
|
+
console \u2014 ${n.error}`);else{console.log(`
|
|
42
|
+
console errors/warns \u2014 ${n.total} in window`);for(let f of n.entries.slice(-8)){let a=((j(f)-S)/1e3).toFixed(2),g=W(f).slice(0,160);console.log(` -${a.padStart(5)}s [${f.level}] ${g}`)}}}return v()&&console.log(`
|
|
43
|
+
next: rnxsim what-happened (cursor advances) \xB7 rnxsim network get <id> \xB7 rnxsim perf react why <fiber-id>`),0}catch(l){let m=l instanceof Error?l.message:String(l);return/no sim connected/i.test(m)?console.error(" no sim connected \u2014 open one first: rnxsim open <metroPort>"):console.error(` diagnose failed: ${m}`),1}finally{u.close()}}export{J as runDiagnose};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{a,b,c,d,e}from"./chunk-NLEMQ4PY.js";import"./chunk-B7KMNHX7.js";import"./chunk-U4PN6JOT.js";import"./chunk-66NF2KNG.js";import"./chunk-ZMZTHU7V.js";import"./chunk-MENV7VLD.js";export{e as applyAutomaticSootsimCleanup,d as applySootsimCleanup,b as formatSootsimBytes,a as isAutomaticSootsimCleanupComplete,c as planSootsimCleanup};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import"./chunk-37I5AIS7.js";import{f as a,g as b,h as c,i as d,j as e,k as f,l as g}from"./chunk-GZDHEONW.js";import"./chunk-G74YIEVS.js";import"./chunk-B7KMNHX7.js";import"./chunk-7VWOSTD5.js";import"./chunk-66NF2KNG.js";import"./chunk-MENV7VLD.js";export{c as ALL_DRIVERS,g as buildDriverListRows,a as electronDriver,d as getAllDrivers,e as getDriver,b as playwrightDriver,f as resolveDriver};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{c as R,d as L}from"./chunk-OR3XTXEB.js";import{h as x,j as A,n as b}from"./chunk-7INBNA3U.js";import"./chunk-33FKQH54.js";import"./chunk-7VWOSTD5.js";import"./chunk-66NF2KNG.js";import"./chunk-MENV7VLD.js";import{spawnSync as T}from"node:child_process";import{existsSync as V,mkdirSync as W,unlinkSync as N,writeFileSync as E}from"node:fs";import{homedir as j}from"node:os";import{dirname as q,extname as H,join as K,resolve as I}from"node:path";var n=e=>new Promise(a=>setTimeout(a,e)),X=["--out","--fps","--script","--slow"],J=["--keep-three"],Q=["--background","--gradient","--gradient-angle","--colorway","--environment","--env-shape","--env-spread","--env-size","--env-color","--env-glow","--env-plastic","--room","--focus","--focus-amount","--focus-range"],Y=12e4,Z=16e6;function c(e,a){let s=e.indexOf(a);return s>=0?e[s+1]:void 0}async function r(e,a,s=3e4){return await e.send({type:"evaluate",code:a},{timeoutMs:s})}async function ae(e,a){if(e.length===0||e.includes("--help")||e.includes("-h"))return console.log(`
|
|
5
|
+
rnxsim film \u2014 record a flow flat, replay it on the 3d stage, save a clip
|
|
6
|
+
|
|
7
|
+
usage:
|
|
8
|
+
rnxsim film <flow.yaml> [options]
|
|
9
|
+
|
|
10
|
+
how it works:
|
|
11
|
+
1. the flow runs at full speed on the flat canvas while the engine
|
|
12
|
+
recording store captures the device screen
|
|
13
|
+
2. 3d mode + the recording editor come up and play that capture back on
|
|
14
|
+
the phone screen while a camera script animates
|
|
15
|
+
3. the WebGL stage canvas is recorded and saved
|
|
16
|
+
|
|
17
|
+
options:
|
|
18
|
+
--out <path> output file (.webm, or .mp4 when ffmpeg is
|
|
19
|
+
installed). default: ~/Desktop/sootsim-films/<flow>.webm
|
|
20
|
+
--script <id> camera script to animate during playback
|
|
21
|
+
(default: hero-arc)
|
|
22
|
+
--fps <n> stage capture framerate (default: 30)
|
|
23
|
+
--slow <ms> per-step delay forwarded to the flow runner
|
|
24
|
+
--keep-three leave 3d mode + the recording editor on afterwards
|
|
25
|
+
--sim <id> target a specific connected sim
|
|
26
|
+
|
|
27
|
+
stage decor (same flags as \`rnxsim mode three configure\`):
|
|
28
|
+
--background <id> \xB7 --gradient <stops> \xB7 --gradient-angle <deg>
|
|
29
|
+
--colorway <id> \xB7 --room on|off \xB7 --focus on|off \xB7 --focus-amount <id>
|
|
30
|
+
--focus-range <id> \xB7 --environment on|off \xB7 --env-shape/spread/size/color
|
|
31
|
+
--env-glow on|off \xB7 --env-plastic on|off
|
|
32
|
+
|
|
33
|
+
examples:
|
|
34
|
+
rnxsim film flows/feed-scroll.yaml
|
|
35
|
+
rnxsim film flows/swap.yaml --script hero-arc --background gradient-tide --out ~/Desktop/swap-3d.mp4
|
|
36
|
+
rnxsim film flows/login.yaml --colorway deep-blue --environment on --env-shape pane --room on
|
|
37
|
+
`),0;let s=e.find(d=>!d.startsWith("--")&&/\.ya?ml$/.test(d));if(!s||!V(I(s)))return console.error(` film: flow file not found: ${s??"(none given)"}`),1;let P=Number.parseInt(c(e,"--fps")??"30",10),h=c(e,"--script")??"hero-arc",z=e.includes("--keep-three"),v=s.replace(/^.*\//,"").replace(/\.ya?ml$/,""),O=c(e,"--out"),l=I(O??K(j(),"Desktop","sootsim-films",`${v}.webm`)),S=H(l).toLowerCase()===".mp4";if(S&&T("ffmpeg",["-version"]).status!==0)return console.error(" film: --out ends in .mp4 but ffmpeg is not installed"),console.error(" install ffmpeg or use a .webm output path"),1;let C=x(e,{port:a.port,stripValueFlags:[...X,...Q],stripBooleanFlags:J}),t=A({...C,commandTimeoutMs:6e4});try{let d=await r(t,`(() => { const s = window.SootSim?.bridges?.settings?.get?.() || {}
|
|
38
|
+
return { threeMode: s.threeMode === true, editor: s.threeRecordingEditor === true } })()`);if(console.log(` film: recording flow ${v} on the flat canvas`),!await r(t,"(async () => !!(await window.SootSim?.bridges?.startRecording?.('video', undefined, { skipEntitlement: true })))()"))return console.error(" film: engine recording store did not start (is @sootsim/plugin-recording installed?)"),1;let D=Date.now();await n(500);let{runFlowPlayback:G}=await import("./flow-N27MRRNL.js"),m=[s],y=c(e,"--sim");y&&m.push("--sim",y);let k=c(e,"--slow");k&&m.push("--slow",k);let f=await G(m);await n(400);let u=Math.min(Date.now()-D,Y);if(await r(t,"window.SootSim?.bridges?.stopRecording?.()"),f!==0)return console.error(` film: flow failed (exit ${f}) \u2014 not filming a broken take`),f;let F=!1;for(let o=0;o<50;o++){await n(400);let i=await r(t,`(() => { const s = window.SootSim?.bridges?.getRecordingState?.()
|
|
39
|
+
return { state: s?.state, hasBlob: !!s?.lastVideoBlob } })()`);if(i?.state==="idle"&&i.hasBlob){F=!0;break}}if(!F)return console.error(" film: flow recording never produced a video blob"),1;console.log(` film: flow captured (${(u/1e3).toFixed(1)}s)`),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeMode', true)"),await R(t),await n(1400),await r(t,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', true)");let _=!1;for(let o=0;o<60;o++)if(await n(250),await r(t,`(() => { const rs = window.SootSim?.replayStore
|
|
40
|
+
return rs?.value?.preview?.surface === 'video' && !!rs?.value?.preview?.flowVideoUrl })()`)){_=!0;break}if(!_)return console.error(" film: recording editor did not seed the replay store"),1;let p=L(e);delete p.script,p.resetPose=!0,await b(t,"SootSim.bridges.threeMode.configure",p),await n(2400),console.log(` film: filming the 3d stage (script: ${h})`);let M=await r(t,`(() => {
|
|
41
|
+
const c = window.SootSim?.bridges?.threeMode?.getCanvas?.()
|
|
42
|
+
if (!c || !c.captureStream) return { ok: false, error: 'no stage canvas' }
|
|
43
|
+
let mime = 'video/webm;codecs=vp9'
|
|
44
|
+
if (!('MediaRecorder' in window) || !MediaRecorder.isTypeSupported(mime)) mime = 'video/webm'
|
|
45
|
+
const stream = c.captureStream(${P})
|
|
46
|
+
const mr = new MediaRecorder(stream, { mimeType: mime, videoBitsPerSecond: ${Z} })
|
|
47
|
+
const st = { mr, chunks: [], b64: null }
|
|
48
|
+
mr.ondataavailable = (e) => { if (e.data && e.data.size) st.chunks.push(e.data) }
|
|
49
|
+
mr.onstop = () => {
|
|
50
|
+
const blob = new Blob(st.chunks, { type: 'video/webm' })
|
|
51
|
+
const fr = new FileReader()
|
|
52
|
+
fr.onload = () => { st.b64 = String(fr.result).split(',')[1] || '' }
|
|
53
|
+
fr.readAsDataURL(blob)
|
|
54
|
+
}
|
|
55
|
+
window.__sootsimFilm = st
|
|
56
|
+
mr.start(200)
|
|
57
|
+
return { ok: true }
|
|
58
|
+
})()`);if(!M?.ok)return console.error(` film: stage capture failed: ${M?.error??"unknown"}`),1;await r(t,`((dur) => {
|
|
59
|
+
const rs = window.SootSim?.replayStore
|
|
60
|
+
if (!rs) return false
|
|
61
|
+
const probed = rs.value?.playback?.durationMs
|
|
62
|
+
const total = probed && probed > 500 ? probed : dur
|
|
63
|
+
const start = performance.now()
|
|
64
|
+
const tick = () => {
|
|
65
|
+
const t = performance.now() - start
|
|
66
|
+
rs.emit({ ...rs.value, playback: { ...rs.value.playback, playing: true, scrubbing: false, currentTimeMs: Math.min(t, total) } })
|
|
67
|
+
if (t < total) requestAnimationFrame(tick)
|
|
68
|
+
}
|
|
69
|
+
requestAnimationFrame(tick)
|
|
70
|
+
return true
|
|
71
|
+
})(${u})`),await b(t,"SootSim.bridges.threeMode.configure",{script:{id:h,progress:1,animate:!0,slow:!0}}),await n(u+700),await r(t,"(() => { const s = window.__sootsimFilm; if (s?.mr?.state === 'recording') s.mr.stop(); return true })()");let w=0;for(let o=0;o<60;o++){await n(500);let i=await r(t,"(() => { const s = window.__sootsimFilm; return { ready: !!(s && s.b64), size: s && s.b64 ? s.b64.length : 0 } })()");if(i?.ready&&i.size>0){w=i.size;break}}if(!w)return console.error(" film: stage recording never finished encoding"),1;let B=24e5,$="";for(let o=0;o<w;o+=B){let i=await r(t,`(() => ({ data: window.__sootsimFilm.b64.substr(${o}, ${B}) }))()`);$+=i.data}await r(t,"(() => { try { delete window.__sootsimFilm } catch {} return true })()");let g=Buffer.from($,"base64");if(W(q(l),{recursive:!0}),S){let o=`${l}.tmp.webm`;E(o,g);let i=T("ffmpeg",["-y","-i",o,"-c:v","libx264","-vf","scale=trunc(iw/2)*2:trunc(ih/2)*2","-pix_fmt","yuv420p","-movflags","+faststart",l],{stdio:["ignore","ignore","pipe"]});if(i.status!==0){let U=String(i.stderr??"").split(`
|
|
72
|
+
`).filter(Boolean).slice(-4).join(`
|
|
73
|
+
`);return console.error(` film: ffmpeg transcode failed:
|
|
74
|
+
${U}`),console.error(` film: source kept at ${o}`),1}N(o)}else E(l,g);return z||(d?.editor||await r(t,"window.SootSim?.bridges?.settings?.set?.('threeRecordingEditor', false)"),d?.threeMode||await r(t,"window.SootSim?.bridges?.settings?.set?.('threeMode', false)")),console.log(` film: saved ${l} (${(g.length/1e6).toFixed(1)}MB source)`),0}finally{t.close()}}export{ae as runFilm};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{c,d,e,f,g,h}from"./chunk-MNGQ42QE.js";import"./chunk-BRIZOR4K.js";import"./chunk-2SA2VTGP.js";import{b as a,c as b}from"./chunk-KZW5WBGU.js";import"./chunk-LDQ7HVCW.js";import"./chunk-Q3RGLERJ.js";import"./chunk-Y2FSZSO7.js";import"./chunk-NPVGMH2N.js";import"./chunk-BKNOLP3J.js";import"./chunk-HMDOLCKG.js";import"./chunk-SI3BUTQR.js";import"./chunk-274UD5FD.js";import"./chunk-XRGEEPJ5.js";import"./chunk-TGQNQ6XT.js";import"./chunk-GZDHEONW.js";import"./chunk-G74YIEVS.js";import"./chunk-T4FT6CM7.js";import"./chunk-YZRFF4YA.js";import"./chunk-4BXCZHAU.js";import"./chunk-FWYYCUAZ.js";import"./chunk-AY47WKS5.js";import"./chunk-3D57IBPC.js";import"./chunk-7INBNA3U.js";import"./chunk-PEPUGJVI.js";import"./chunk-N6A3SXMR.js";import"./chunk-TCWQJILS.js";import"./chunk-B7KMNHX7.js";import"./chunk-U4PN6JOT.js";import"./chunk-HG7ORJMT.js";import"./chunk-TYE3WBSR.js";import"./chunk-5OX7ANRA.js";import"./chunk-33FKQH54.js";import"./chunk-7VWOSTD5.js";import"./chunk-6UKJB2VC.js";import"./chunk-66NF2KNG.js";import"./chunk-ZMZTHU7V.js";import"./chunk-MENV7VLD.js";export{e as discoverSootsimUrl,c as getLastFlowPreviewUploadResult,d as getLastFlowTraceSteps,g as hoistLeadingSimFlag,a as parseFlowFile,f as runFlowPlayback,h as runMaestroAuthoring,b as validateFlowFile};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{a,b,c}from"./chunk-VZBLFMYC.js";import"./chunk-KR5BGMBZ.js";import"./chunk-HG7ORJMT.js";import"./chunk-TYE3WBSR.js";import"./chunk-5OX7ANRA.js";import"./chunk-33FKQH54.js";import"./chunk-7VWOSTD5.js";import"./chunk-6UKJB2VC.js";import"./chunk-66NF2KNG.js";import"./chunk-EUAVBTKU.js";import"./chunk-ZMZTHU7V.js";import"./chunk-FTC4M26Q.js";import"./chunk-MENV7VLD.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{a as e,b as s}from"./chunk-6UKJB2VC.js";import"./chunk-MENV7VLD.js";var n=[{title:"Overview",route:"/docs/rnx/cli"},...e.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/rnx/cli/${o.slug}`}))];var i=["do","get"];function g(o){if(o.command)return o;let t=o.commandArgs.find(r=>!r.startsWith("-"));if(!t)return o;for(let r of i)if(s(r,t))return{...o,command:r};return o}export{g as resolveHiddenRuntimeAlias};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-66NF2KNG.js";import"./chunk-MENV7VLD.js";export{b as ACTIVE_RUNTIME_FILE,e as CONFIG_FILE,f as DAEMON_HEARTBEAT_STALE_MS,c as DAEMON_LOCKFILE,d as DEV_BRIDGE_LOCKFILE,a as SOOTSIM_HOME_ENV,J as activeRuntimeDir,m as activeRuntimeFile,u as cacheDir,R as claimDaemonLockfile,x as configFilePath,F as consumeRuntimeUpgradeNotice,s as daemonAppBundlePath,r as daemonAppDir,t as daemonAppLauncherPath,v as daemonLockfilePath,w as devBridgeLockfilePath,n as electronDir,o as electronUserDataDir,p as electronVersionDir,G as ensureSootsimHome,M as isDaemonLockfileFresh,N as isDevBridgeLockfileFresh,i as isDevWorkstation,h as isSootsimDevCheckout,q as profilesDir,H as readActiveRuntime,K as readDaemonLockfile,L as readDevBridgeLockfile,O as readLiveRuntimeVersions,C as readOrCreateAnonymousId,A as readPrivacyPreferences,y as readSharedConfig,S as removeDaemonLockfile,T as removeDevBridgeLockfile,l as runtimeDir,D as runtimeUpgradeNoticePath,k as runtimesDir,j as shouldSkipPersistentDaemon,g as sootsimHomeDir,I as writeActiveRuntime,P as writeDaemonLockfile,Q as writeDevBridgeLockfile,B as writePrivacyPreferences,E as writeRuntimeUpgradeNotice,z as writeSharedConfig};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{i as a,j as b}from"./chunk-KZW5WBGU.js";import"./chunk-LDQ7HVCW.js";import"./chunk-Q3RGLERJ.js";import"./chunk-Y2FSZSO7.js";import"./chunk-HMDOLCKG.js";import"./chunk-SI3BUTQR.js";import"./chunk-274UD5FD.js";import"./chunk-XRGEEPJ5.js";import"./chunk-TGQNQ6XT.js";import"./chunk-GZDHEONW.js";import"./chunk-G74YIEVS.js";import"./chunk-T4FT6CM7.js";import"./chunk-YZRFF4YA.js";import"./chunk-4BXCZHAU.js";import"./chunk-FWYYCUAZ.js";import"./chunk-AY47WKS5.js";import"./chunk-3D57IBPC.js";import"./chunk-7INBNA3U.js";import"./chunk-PEPUGJVI.js";import"./chunk-B7KMNHX7.js";import"./chunk-U4PN6JOT.js";import"./chunk-HG7ORJMT.js";import"./chunk-TYE3WBSR.js";import"./chunk-5OX7ANRA.js";import"./chunk-33FKQH54.js";import"./chunk-7VWOSTD5.js";import"./chunk-6UKJB2VC.js";import"./chunk-66NF2KNG.js";import"./chunk-ZMZTHU7V.js";import"./chunk-MENV7VLD.js";export{a as printShellPerfReport,b as runInspect};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{a}from"./chunk-WBT32R6N.js";import"./chunk-VUFRB347.js";import"./chunk-G74YIEVS.js";import"./chunk-MENV7VLD.js";export{a as runInstallDesktop};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{b as k,d as v}from"./chunk-TCWQJILS.js";import"./chunk-66NF2KNG.js";import{a as b}from"./chunk-ZMZTHU7V.js";import"./chunk-MENV7VLD.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import P from"node:http";var O=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="https://contrast.localhost:3000";async function A(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return O}function C(){console.log(`
|
|
5
|
+
rnxsim login \u2014 sign in so uploads can attach to your account
|
|
6
|
+
|
|
7
|
+
usage:
|
|
8
|
+
rnxsim login [--origin <url>]
|
|
9
|
+
|
|
10
|
+
options:
|
|
11
|
+
--origin <url> auth host (default: auto)
|
|
12
|
+
prefers ${w} when available, otherwise
|
|
13
|
+
falls back to ${O}
|
|
14
|
+
override with SOOTSIM_AUTH_ORIGIN env var
|
|
15
|
+
-h, --help
|
|
16
|
+
`)}function U(r,e){let t=r.findIndex(m=>m===e);if(t<0)return;let u=r[t+1];return r.splice(t,2),u}function E(r){let e=process.platform==="darwin"?`open "${r}"`:process.platform==="win32"?`start "" "${r}"`:`xdg-open "${r}"`;L(e,t=>{t&&(console.log(" could not open browser automatically."),console.log(` open this URL manually:
|
|
17
|
+
${r}
|
|
18
|
+
`))})}function g(r){return`<!doctype html>
|
|
19
|
+
<html>
|
|
20
|
+
<body style="font-family:system-ui;background:#000;color:#fff;display:flex;align-items:center;justify-content:center;height:100vh;margin:0">
|
|
21
|
+
<div style="max-width:480px;text-align:center">
|
|
22
|
+
<h1 style="font-size:28px;margin:0 0 12px">${b.name}</h1>
|
|
23
|
+
<p style="color:#ccc">${r}</p>
|
|
24
|
+
</div>
|
|
25
|
+
</body>
|
|
26
|
+
</html>`}async function G(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function M(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function F(r){(r.includes("--help")||r.includes("-h"))&&(C(),process.exit(0));let e=[...r],t=await A(U(e,"--origin"));if(M(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let n=await G(t);if(n.ok){k({token:n.token,user:n.userId?{id:n.userId,email:n.email}:null,origin:t,source:"cli"});let s=await v(t),d=s?.user?.email||n.email||s?.user?.id||n.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-E7BUK6RA.js");a({event:"cli_login_succeeded",identity:{userId:n.userId??s?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${n.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:n,flushCliTelemetry:s}=await import("./telemetry-E7BUK6RA.js");n({event:"cli_login_started",properties:{origin:t}}),await s()}let m=300*1e3,i=await new Promise(n=>{let s,d=!1,a=c=>{d||(d=!0,clearTimeout(s),n(c),f.close())},f=P.createServer((c,o)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),S=l.searchParams.get("state"),y=l.searchParams.get("token"),x=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(S!==u){o.statusCode=404,o.end("not found");return}if(o.setHeader("content-type","text/html; charset=utf-8"),p){o.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){o.end(g("missing token. close this tab and retry `rnxsim login`.")),a({ok:!1,error:"missing token"});return}o.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:x,userId:T})}catch(l){o.statusCode=500,o.end(g("sign-in callback failed. retry `rnxsim login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});s=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `rnxsim login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let o=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);o.searchParams.set("state",u),o.searchParams.set("port",String(c.port)),o.searchParams.set("contrast",t),console.log(" opening browser for rnxsim login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
|
|
27
|
+
${o.toString()}
|
|
28
|
+
`),E(o.toString())})});if(!i.ok){let{trackCliEvent:n,flushCliTelemetry:s}=await import("./telemetry-E7BUK6RA.js");n({event:"cli_login_failed",properties:{origin:t,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}k({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||i.email||h?.user?.id||i.userId,{trackCliEvent:$,flushCliTelemetry:_}=await import("./telemetry-E7BUK6RA.js");$({event:"cli_login_succeeded",identity:{userId:i.userId??h?.user?.id??null},properties:{origin:t}}),await _(),console.log(` signed in${I?` as ${I}`:""}`)}export{F as runLogin};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.312 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{c as r,d as i}from"./chunk-N6A3SXMR.js";import{a as t,c as o}from"./chunk-TCWQJILS.js";import"./chunk-66NF2KNG.js";import"./chunk-MENV7VLD.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
|