rnxsim 0.1.334 → 0.1.336
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/README.md +104 -76
- package/cli/auth.ts +2 -2
- package/cli/bin.ts +7 -3
- package/cli/bridge-flow-runner.ts +2 -2
- package/cli/commands/agent-wrapper.ts +1 -1
- package/cli/commands/agent.ts +12 -12
- package/cli/commands/app-fonts.ts +1 -1
- package/cli/commands/assert.ts +7 -7
- package/cli/commands/auth.ts +4 -4
- package/cli/commands/camera.ts +13 -13
- package/cli/commands/cleanup.ts +6 -6
- package/cli/commands/compat.ts +4 -4
- package/cli/commands/config.ts +2 -2
- package/cli/commands/control.ts +37 -43
- package/cli/commands/cpu-profile.ts +2 -2
- package/cli/commands/daemon-mac-app.ts +2 -2
- package/cli/commands/daemon.ts +12 -12
- package/cli/commands/debug.ts +22 -22
- package/cli/commands/desktop.ts +3 -3
- package/cli/commands/detox.ts +17 -17
- package/cli/commands/device.ts +9 -9
- package/cli/commands/diagnose.ts +11 -11
- package/cli/commands/electron.ts +7 -7
- package/cli/commands/film.ts +6 -6
- package/cli/commands/inspect/core.ts +6 -7
- package/cli/commands/inspect/find.ts +2 -2
- package/cli/commands/inspect.ts +36 -36
- package/cli/commands/install-desktop.ts +8 -8
- package/cli/commands/login.ts +6 -6
- package/cli/commands/maestro-generate.ts +2 -2
- package/cli/commands/maestro.ts +23 -23
- package/cli/commands/mode.ts +4 -4
- package/cli/commands/no-bridge-hint.ts +9 -9
- package/cli/commands/perf.ts +11 -11
- package/cli/commands/permissions.ts +5 -5
- package/cli/commands/profile.ts +11 -11
- package/cli/commands/react.ts +15 -15
- package/cli/commands/record.ts +15 -15
- package/cli/commands/report-issue.ts +2 -2
- package/cli/commands/reset.ts +2 -2
- package/cli/commands/runtime.ts +18 -18
- package/cli/commands/screenshot-mode.ts +5 -5
- package/cli/commands/screenshot.ts +12 -12
- package/cli/commands/screenshots-capture.ts +7 -7
- package/cli/commands/screenshots.ts +6 -6
- package/cli/commands/serve.ts +6 -6
- package/cli/commands/setup.ts +13 -15
- package/cli/commands/skills.ts +14 -14
- package/cli/commands/slides.ts +19 -23
- package/cli/commands/state.ts +2 -2
- package/cli/commands/storage.ts +3 -3
- package/cli/commands/telemetry.ts +1 -1
- package/cli/commands/three-mode.ts +16 -16
- package/cli/commands/timeline.ts +4 -4
- package/cli/commands/upgrade.ts +1 -1
- package/cli/commands/upload.ts +11 -11
- package/cli/commands/version.ts +3 -5
- package/cli/commands/what-happened.ts +11 -11
- package/cli/drivers/electron.ts +3 -3
- package/cli/hints.ts +8 -8
- package/cli/recording-access.ts +1 -1
- package/cli/ws-bridge.ts +5 -5
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-XB27DMQ6.js → agent-PZLF36FY.js} +14 -14
- package/dist-cli/chunks/{agent-wrapper-B3HNORTW.js → agent-wrapper-6TA43SJ2.js} +3 -3
- package/dist-cli/chunks/app-fonts-MTZTCJUY.js +4 -0
- package/dist-cli/chunks/{assert-6CUEOSSO.js → assert-2CVO2TYX.js} +12 -12
- package/dist-cli/chunks/auth-LKXFRFOT.js +12 -0
- package/dist-cli/chunks/{beta-H5SAI4RD.js → beta-OATC5IPA.js} +2 -2
- package/dist-cli/chunks/camera-VX65VO5N.js +33 -0
- package/dist-cli/chunks/{chunk-R3JUSXCG.js → chunk-262YA5CJ.js} +2 -2
- package/dist-cli/chunks/{chunk-2W7J4B3D.js → chunk-2J4OBR7W.js} +18 -18
- package/dist-cli/chunks/{chunk-GO7WTRY4.js → chunk-2PFDFGOG.js} +1 -1
- package/dist-cli/chunks/{chunk-BH3NYOFU.js → chunk-2Q6S7X5O.js} +4 -4
- package/dist-cli/chunks/{chunk-JZFZ7NGF.js → chunk-2VOFUIKQ.js} +9 -9
- package/dist-cli/chunks/chunk-3QCSDI3B.js +5 -0
- package/dist-cli/chunks/{chunk-IZITFEO5.js → chunk-4532OPNZ.js} +3 -3
- package/dist-cli/chunks/{chunk-S5Q2TACY.js → chunk-5YCVNKD7.js} +23 -23
- package/dist-cli/chunks/{chunk-R5KHC7VZ.js → chunk-6ALTVOXE.js} +6 -6
- package/dist-cli/chunks/chunk-6TN3YWA6.js +124 -0
- package/dist-cli/chunks/{chunk-KSJTW5ZW.js → chunk-7FHAHI5V.js} +2 -2
- package/dist-cli/chunks/{chunk-TKTAVBKB.js → chunk-7PMNRG53.js} +4 -4
- package/dist-cli/chunks/{chunk-752UYKC6.js → chunk-ARFQOYRO.js} +1 -1
- package/dist-cli/chunks/chunk-BHXQ7MUW.js +5 -0
- package/dist-cli/chunks/{chunk-HMZS7LD4.js → chunk-BIZE6NBI.js} +1 -1
- package/dist-cli/chunks/{chunk-INV6BZQY.js → chunk-BOZARB6P.js} +2 -2
- package/dist-cli/chunks/chunk-BVGUTE2T.js +74 -0
- package/dist-cli/chunks/{chunk-K2NYE3XT.js → chunk-BYOFHYKS.js} +1 -1
- package/dist-cli/chunks/{chunk-TLAYQHXB.js → chunk-DMD24WAG.js} +1 -1
- package/dist-cli/chunks/{chunk-PSVQUW3M.js → chunk-EAPHUH2R.js} +2 -2
- package/dist-cli/chunks/{chunk-ELFSL6AX.js → chunk-FMWEQNK2.js} +2 -2
- package/dist-cli/chunks/{chunk-OJJUPWLY.js → chunk-FWGDP2J4.js} +2 -2
- package/dist-cli/chunks/{chunk-VCBH7RDB.js → chunk-G3FVXFPF.js} +2 -2
- package/dist-cli/chunks/{chunk-U5JW25P3.js → chunk-GI3GZ54J.js} +1 -1
- package/dist-cli/chunks/{chunk-AH7KCTAP.js → chunk-HDHHEWEA.js} +2 -2
- package/dist-cli/chunks/{chunk-G2UNJ4TN.js → chunk-JIWE66VU.js} +1 -1
- package/dist-cli/chunks/{chunk-7HXPSUI6.js → chunk-KDRDDPNN.js} +1 -1
- package/dist-cli/chunks/{chunk-ANO5CHPQ.js → chunk-KPL344LX.js} +2 -2
- package/dist-cli/chunks/{chunk-3OGSYYLZ.js → chunk-M2OWBYUG.js} +1 -1
- package/dist-cli/chunks/{chunk-7D2P57SZ.js → chunk-M2XGXP7G.js} +1 -1
- package/dist-cli/chunks/{chunk-KV653SVK.js → chunk-MARPC3GM.js} +2 -2
- package/dist-cli/chunks/{chunk-ZYWOBHVL.js → chunk-MQES3MTN.js} +2 -2
- package/dist-cli/chunks/{chunk-ZVBWTXV6.js → chunk-NDLRQH7U.js} +5 -5
- package/dist-cli/chunks/{chunk-DECDURI3.js → chunk-NJMBQLAU.js} +2 -2
- package/dist-cli/chunks/{chunk-X6LGVNYE.js → chunk-NL2HXO7U.js} +1 -1
- package/dist-cli/chunks/{chunk-XCI6HRMH.js → chunk-NVPZLIMW.js} +1 -1
- package/dist-cli/chunks/{chunk-CYXIDSTO.js → chunk-NWVH2X7F.js} +2 -2
- package/dist-cli/chunks/{chunk-PFOKFWHU.js → chunk-OUAYBJ4G.js} +2 -2
- package/dist-cli/chunks/{chunk-WJJYIBVW.js → chunk-OXRDTNVL.js} +2 -2
- package/dist-cli/chunks/{chunk-Q2KHHFU3.js → chunk-QIVOOERS.js} +2 -2
- package/dist-cli/chunks/{chunk-WXUWD5JK.js → chunk-RZ2PXHA7.js} +11 -11
- package/dist-cli/chunks/{chunk-32AHRTE2.js → chunk-S33NCWJV.js} +2 -2
- package/dist-cli/chunks/{chunk-YX7RESF2.js → chunk-STMCT3G3.js} +2 -2
- package/dist-cli/chunks/{chunk-25BPBDWK.js → chunk-SV6NVD7P.js} +1 -1
- package/dist-cli/chunks/{chunk-62GN45A4.js → chunk-TA4GBBGC.js} +2 -2
- package/dist-cli/chunks/{chunk-MCX66YUZ.js → chunk-TV457FWW.js} +2 -2
- package/dist-cli/chunks/chunk-UB3JHBDW.js +4 -0
- package/dist-cli/chunks/{chunk-CLJ5KDZQ.js → chunk-UU2KMAIA.js} +1 -1
- package/dist-cli/chunks/chunk-UZCNKUSS.js +15 -0
- package/dist-cli/chunks/{chunk-R7XQX7CV.js → chunk-V4OZDPTA.js} +1 -1
- package/dist-cli/chunks/{chunk-UBZ7VUVM.js → chunk-WBTT5WIO.js} +1 -1
- package/dist-cli/chunks/chunk-YYBC6VB2.js +30 -0
- package/dist-cli/chunks/{chunk-PPTUVZET.js → chunk-ZI6YQKD6.js} +2 -2
- package/dist-cli/chunks/{cleanup-L5RZFZHK.js → cleanup-ZC5OVBIM.js} +10 -10
- package/dist-cli/chunks/cli-version-NOYHDN6P.js +4 -0
- package/dist-cli/chunks/{compat-6UV3RZBK.js → compat-BS2E7XDD.js} +9 -9
- package/dist-cli/chunks/{config-PCDG3T44.js → config-VDCDUYMZ.js} +5 -5
- package/dist-cli/chunks/{control-3F5UWGSP.js → control-IKS3CUP4.js} +2 -2
- package/dist-cli/chunks/daemon-MM3C4O2B.js +4 -0
- package/dist-cli/chunks/{debug-U3AW3DE7.js → debug-BKMZ5SRR.js} +17 -17
- package/dist-cli/chunks/desktop-FZQHSNF7.js +31 -0
- package/dist-cli/chunks/detox-52AM3DKY.js +52 -0
- package/dist-cli/chunks/{device-Z7QIRPK3.js → device-7FL5Y542.js} +11 -11
- package/dist-cli/chunks/{diagnose-XTLKRGK4.js → diagnose-YT4BKJ7I.js} +12 -12
- package/dist-cli/chunks/{disk-cleanup-EGA7FHY2.js → disk-cleanup-O6ICYLAC.js} +2 -2
- package/dist-cli/chunks/drivers-YY3YRD2L.js +4 -0
- package/dist-cli/chunks/{film-VCD3LX7E.js → film-7YBOFSOZ.js} +9 -9
- package/dist-cli/chunks/flow-I4PVS52A.js +4 -0
- package/dist-cli/chunks/help-35ESSWJH.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-WIG4O25J.js → hidden-runtime-alias-M3UFKZB6.js} +2 -2
- package/dist-cli/chunks/{home-paths-35K3WNLQ.js → home-paths-VW7G7LVZ.js} +2 -2
- package/dist-cli/chunks/inspect-PCJ6C2BN.js +4 -0
- package/dist-cli/chunks/install-desktop-NGQWMGQO.js +4 -0
- package/dist-cli/chunks/{login-JMQOKJS4.js → login-5VAHTGHC.js} +6 -6
- package/dist-cli/chunks/{logout-SBZ42HSW.js → logout-CXZFNMYF.js} +2 -2
- package/dist-cli/chunks/{maestro-3ZOPLMLN.js → maestro-THMBR6L3.js} +25 -25
- package/dist-cli/chunks/{maestro-generate-UZ75KHE6.js → maestro-generate-R73J53KE.js} +3 -3
- package/dist-cli/chunks/mode-5RJYFW76.js +26 -0
- package/dist-cli/chunks/{optional-demo-registry-B5RN64RF.js → optional-demo-registry-U7SCVX5U.js} +2 -2
- package/dist-cli/chunks/{perf-HDAR6QCJ.js → perf-AW6LG6FW.js} +28 -28
- package/dist-cli/chunks/permissions-6JWNMXYT.js +13 -0
- package/dist-cli/chunks/record-LLPM3BJT.js +72 -0
- package/dist-cli/chunks/{report-issue-45ECETI7.js → report-issue-YO2NAMJS.js} +4 -4
- package/dist-cli/chunks/reset-5LDPRL3W.js +4 -0
- package/dist-cli/chunks/runtime-IAICY2UL.js +4 -0
- package/dist-cli/chunks/{screenshot-command-ZTTTH5DS.js → screenshot-command-X7ECU2SK.js} +34 -34
- package/dist-cli/chunks/{screenshot-layers-NBYY3W7W.js → screenshot-layers-E7GLIOHG.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-EPPIKH5Q.js → screenshots-capture-TKR2YV6U.js} +11 -11
- package/dist-cli/chunks/{serve-4I2GY23Q.js → serve-HFNYO3YS.js} +16 -16
- package/dist-cli/chunks/setup-2HQHROP3.js +32 -0
- package/dist-cli/chunks/{skills-FBQ52ZMO.js → skills-PFCCKOPW.js} +16 -16
- package/dist-cli/chunks/{state-LQEZWXEX.js → state-NOCC6IGB.js} +5 -5
- package/dist-cli/chunks/storage-4SYN4ZWP.js +37 -0
- package/dist-cli/chunks/store-7QDSVAZ4.js +4 -0
- package/dist-cli/chunks/telemetry-LGTXJEJC.js +4 -0
- package/dist-cli/chunks/{timeline-3AIKN2SF.js → timeline-E2SFUV76.js} +6 -6
- package/dist-cli/chunks/{upgrade-HYPCBXGF.js → upgrade-KD76JQCK.js} +2 -2
- package/dist-cli/chunks/upload-FI2TS5S7.js +4 -0
- package/dist-cli/chunks/version-B23A4BFH.js +6 -0
- package/dist-cli/chunks/{web-Q6TI7YFH.js → web-6OAWYV5Z.js} +2 -2
- package/dist-cli/chunks/{what-happened-4PNRFBVS.js → what-happened-IYXUFM72.js} +16 -16
- package/dist-lib/agent-daemon-client.cjs +5 -5
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +4 -4
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +7 -7
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +248 -98
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +2 -2
- package/dist-lib/menu.mjs +2 -2
- package/dist-lib/metro-host-modules/react-dom.js +6 -0
- package/dist-lib/metro-host-modules/react-native-web.js +6 -0
- package/dist-lib/metro-host-modules/react-native.js +6 -0
- package/dist-lib/metro-host-modules/react.js +6 -0
- package/dist-lib/metro-host-modules/react__jsx-dev-runtime.js +6 -0
- package/dist-lib/metro-host-modules/react__jsx-runtime.js +6 -0
- package/dist-lib/metro-production-bundle.cjs +72 -0
- package/dist-lib/metro-production-bundle.mjs +44 -0
- package/dist-lib/metro.cjs +152 -8
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +2 -2
- package/dist-lib/react-native-host-modules.cjs +50 -0
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +6 -7
- package/dist-lib/sdk.mjs +6 -7
- package/dist-lib/skills.cjs +71 -77
- package/dist-lib/vite.cjs +104 -85
- package/package.json +15 -2
- package/scripts/preuninstall.cjs +1 -1
- package/skills/contrast/SKILL.md +67 -75
- package/skills/rnx-debug/SKILL.md +84 -84
- package/skills/rnx-perf/SKILL.md +8 -8
- package/skills/rnx-setup/SKILL.md +54 -54
- package/skills/rnx-test/SKILL.md +35 -35
- package/skills/rnx-visual/SKILL.md +18 -18
- package/src/agent-daemon-client.ts +2 -2
- package/src/agent-sessions.ts +2 -2
- package/src/connect.ts +6 -6
- package/src/disk-cleanup.ts +1 -1
- package/src/home-paths.ts +1 -1
- package/src/host/bridge-host.ts +6 -6
- package/src/index.ts +1 -1
- package/src/metro-host-modules/react-dom.js +6 -0
- package/src/metro-host-modules/react-native-web.js +6 -0
- package/src/metro-host-modules/react-native.js +6 -0
- package/src/metro-host-modules/react.js +6 -0
- package/src/metro-host-modules/react__jsx-dev-runtime.js +6 -0
- package/src/metro-host-modules/react__jsx-runtime.js +6 -0
- package/src/metro-plugin.ts +249 -10
- package/src/metro-production-bundle.ts +51 -0
- package/src/public-brand.ts +1 -1
- package/src/react-native-host-modules.ts +25 -0
- package/src/runtime-assets.ts +1 -1
- package/src/sim-client.ts +1 -1
- package/src/vite-plugin-one.ts +171 -145
- package/dist-cli/chunks/app-fonts-R3Z7ZW4A.js +0 -4
- package/dist-cli/chunks/auth-LAGALWLO.js +0 -12
- package/dist-cli/chunks/camera-QN6WUAYK.js +0 -33
- package/dist-cli/chunks/chunk-2A4XQAO5.js +0 -5
- package/dist-cli/chunks/chunk-CFRBWE4I.js +0 -124
- package/dist-cli/chunks/chunk-FSS73GUP.js +0 -4
- package/dist-cli/chunks/chunk-KKLCABLJ.js +0 -15
- package/dist-cli/chunks/chunk-L4JC72JR.js +0 -5
- package/dist-cli/chunks/chunk-LGO27KAL.js +0 -30
- package/dist-cli/chunks/chunk-ZS3IA2TO.js +0 -74
- package/dist-cli/chunks/cli-version-YLZLS2WD.js +0 -4
- package/dist-cli/chunks/daemon-7KWRXNTD.js +0 -4
- package/dist-cli/chunks/desktop-NXZL7FFL.js +0 -31
- package/dist-cli/chunks/detox-ZVCZR6RI.js +0 -52
- package/dist-cli/chunks/drivers-NCRG3DPA.js +0 -4
- package/dist-cli/chunks/flow-XTAZ54NO.js +0 -4
- package/dist-cli/chunks/help-HXJS23VT.js +0 -4
- package/dist-cli/chunks/inspect-FGQNWT3J.js +0 -4
- package/dist-cli/chunks/install-desktop-PRZH7KML.js +0 -4
- package/dist-cli/chunks/mode-PUJBFJV2.js +0 -26
- package/dist-cli/chunks/permissions-FG2BLOZH.js +0 -13
- package/dist-cli/chunks/record-2733FYSQ.js +0 -72
- package/dist-cli/chunks/reset-7RTBJQT7.js +0 -4
- package/dist-cli/chunks/runtime-FWAZCY6A.js +0 -4
- package/dist-cli/chunks/setup-FAQDSB56.js +0 -32
- package/dist-cli/chunks/storage-6CRLZNEX.js +0 -37
- package/dist-cli/chunks/store-PNV6NRDU.js +0 -4
- package/dist-cli/chunks/telemetry-ZS6SFANV.js +0 -4
- package/dist-cli/chunks/upload-EMRR47KT.js +0 -4
- package/dist-cli/chunks/version-P4NCNAW7.js +0 -6
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*! rnx v0.1.336 | (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 I,b as me,c as je}from"./chunk-TV457FWW.js";import{a as He}from"./chunk-S33NCWJV.js";import{e as ze}from"./chunk-ZI6YQKD6.js";import{c as Fe}from"./chunk-HDHHEWEA.js";import{a as Ve,b as qe,d as Ge}from"./chunk-NJMBQLAU.js";import{a as ce,b as L,c as de,d as ue,e as Le,f as Ne,h as We,i as q,j as Ke}from"./chunk-MARPC3GM.js";import{a as pe}from"./chunk-DMD24WAG.js";import{m as A}from"./chunk-G3FVXFPF.js";import{m as Be,p as Ae}from"./chunk-7PMNRG53.js";import{f as Re}from"./chunk-FMWEQNK2.js";import{b as ae,d as Ee}from"./chunk-BHXQ7MUW.js";import{b as Ue,f as _e,g as D,h as $,i as B,k as Te,l as Oe,m as le,o as Me,p as De,q as U,r as P,s as _}from"./chunk-6ALTVOXE.js";import{J as ie,M as se,O as M,Q as Ce,l as oe}from"./chunk-V4OZDPTA.js";import{a as re}from"./chunk-QIVOOERS.js";import{spawn as et,spawnSync as tt}from"node:child_process";import T from"node:fs";import Et from"node:os";import C from"node:path";import{WebSocket as fe}from"ws";function Je(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function $t(e,n){return e?.includes("/one/metro-entry.bundle")?"one":typeof n=="string"&&n?"expo":"unknown"}function Ye(e,n,t){return`${e}//${n}:${t}`}function Pt(e){if(typeof window>"u")return!1;try{let n=new URL(e);return I(n.hostname)&&I(window.location.hostname)&&n.origin!==window.location.origin}catch{return!1}}async function Qe(e,n){let t={...n,cache:n?.cache??"no-store"};return Pt(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function It(e){return e==="https:"?443:80}function kt(e){let n=e.pathname||"/";return(n==="/"||n==="")&&!e.search&&!e.hash}async function Ct(e){try{let n=await fetch("/__server-scan",{cache:"no-store"});if(!n.ok||!(n.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await n.json();if(!Array.isArray(t))return null;let r=t.find(o=>!!o&&typeof o=="object"&&o.port===e&&typeof o.bundleUrl=="string");return r?{bundleUrl:ue(r.bundleUrl),port:e,framework:typeof r.framework=="string"?r.framework:"unknown",projectName:typeof r.projectName=="string"?r.projectName:void 0}:null}catch{return null}}async function Ze(e,n){let t=e.replace(/\/+$/,"");try{if(I(new URL(t).hostname)){let r=await Ct(n);if(r)return r}}catch{}try{let r=await Qe(`${t}/`,{headers:{"expo-platform":"ios"}});if(r.ok){let o=await r.json(),i=o?.extra?.expoClient||o?.extra||{},s=typeof o?.launchAsset?.url=="string"?o.launchAsset.url:void 0;if(s||i.name)return{bundleUrl:ue(s||`${t}${de}`),port:n,framework:$t(s,i.sdkVersion),projectName:i.name}}}catch{}try{let r=await Qe(`${t}/status`);if(r.ok&&(await r.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:n,framework:"metro"}}catch{}return null}async function Rt(e){return Ze(Ye("http:","localhost",e),e)}async function Xe(e){let n=e.trim();if(/^\d+$/.test(n)){let a=parseInt(n,10),l=await Rt(a);if(l)return l;throw Je(`localhost:${a}`)}let t=n.startsWith("http")?n:`http://${n}`,r;try{r=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let o=r.protocol||"http:",i=r.port?parseInt(r.port,10):It(o),s=Ye(o,r.hostname,i);if(kt(r)){let a=await Ze(s,i);if(a)return a;throw Je(s)}return{bundleUrl:r.toString(),port:i,framework:"unknown"}}var Ut=12e4,nt=100,_t=5e3,rt=1e4,Tt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function y(e){return new Promise(n=>setTimeout(n,e))}function ot(e){let n=process.env[e]?.trim();if(!n)return null;let t=Number(n);return Number.isInteger(t)&&t>0?t:null}function Ot(){let e=ot("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??ot("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Ut;return{timeoutMs:e,hostTimeoutMs:e+_t,intervalMs:nt,attempts:Math.max(1,Math.ceil(e/nt))}}function it(e){return e==="electron"||e==="playwright"}function ge(e,n){return n==="playwright"?e.meta?.sootsimHostDriver==="playwright":e.userAgent?.includes("Electron/")===!0}function Mt(e,n){return e.includes("--headless")?!0:e.includes("--headed")?!1:n==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function J(e){return e.trim()}var mt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Dt(e){let n=e.trim();if(!n)throw new Error("expected <url-or-route>");return mt.test(n)||n.startsWith("/")?n:`/${n}`}function Bt(e){return e!==null&&typeof e=="object"}function At(e){let n=e.trim();return n?n.startsWith("/")?!0:mt.test(n)?!/^https?:\/\//i.test(n):!1:!1}async function Lt(e,n=!1){if(await z(e,250))return e;let t=se();if(st(e,n,t),t&&M(t)&&await z(t.bridgePort,500))return t.bridgePort;if(t&&M(t))throw new Error(`rnx bridge lockfile is fresh (port ${t.bridgePort}) but the bridge is not reachable. run \`rnx daemon restart\` or \`rnx daemon uninstall\`.`);await Nt();let r=Ft(["serve","--quiet","--port",String(e)]),o=null;r.once("exit",(s,a)=>{o=String(s??a??"unknown")}),r.unref();let i=Date.now()+rt;for(;Date.now()<i;){let s=se();if(st(e,n,s),s&&M(s)&&await z(s.bridgePort,250))return console.error(` started local bridge on port ${s.bridgePort}; run \`sootsim setup\` to install the background daemon`),s.bridgePort;if(await z(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(o)throw new Error(`rnx bridge exited before becoming ready (exit ${o})`);await y(150)}throw new Error(`rnx bridge did not start within ${Math.round(rt/1e3)}s`)}function st(e,n,t){if(!(!n||!t||!M(t)||t.bridgePort===e))throw new Error(`${re.commandName} open: requested bridge port ${e}, but the active daemon owns port ${t.bridgePort}. explicit --port never selects another bridge; stop that daemon or use an isolated SOOTSIM_HOME.`)}async function Nt(){let e=ie();if(e&&T.existsSync(oe(e)))return;console.error(" installing rnx engine runtime...");let{runRuntime:n}=await import("./runtime-IAICY2UL.js");await n(["install"],{})}function Ft(e){let n=process.argv[1];return n&&T.existsSync(n)?et(process.execPath,[n,...e],{detached:!0,stdio:"ignore",env:process.env}):et(re.commandName,e,{detached:!0,stdio:"ignore",env:process.env})}function z(e,n){return new Promise(t=>{let r=new fe(`ws://127.0.0.1:${e}`,{handshakeTimeout:n}),o=!1,i=s=>{o||(o=!0,r.readyState===fe.OPEN?r.close():r.readyState===fe.CONNECTING&&r.terminate(),t(s))};r.once("open",()=>i(!0)),r.on("error",()=>i(!1)),setTimeout(()=>i(!1),n)})}function we(e){try{let n=new URL(e),t=n.pathname.replace(/\/+$/,"")||"/";return n.searchParams.has("open")||n.searchParams.has("port")||n.searchParams.has("bundle")||n.searchParams.has("demo")||n.pathname.includes("/sootsim/index.html")||t==="/sootsim"||n.pathname==="/__soot"||n.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function jt(e){try{let n=new URL(e,"http://sootsim.local");if(n.origin!=="http://sootsim.local")return!1;let t=n.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Ht(e,n){let t=new URL(e,"http://sootsim.local"),r=new URL(n),o=Q(r.pathname),i=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return r.pathname=`${o}${i}`,r.search=t.search,r.hash=t.hash,r.toString()}function Wt(e){try{let n=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(n)||/^\/build\/.+/.test(n)}catch{return!1}}async function Yn(e){let n=J(e);return(await ve(n)).bundleUrl}function Kt(e){try{let n=new URL(e.startsWith("http")?e:`http://${e}`),t=n.pathname||"/";if(t!=="/"&&t!==""||n.search||n.hash||!I(n.hostname))return null;let r=n.port?Number(n.port):n.protocol==="https:"?443:80;return Number.isFinite(r)&&r>0?r:null}catch{return null}}async function ve(e){let n=J(e),t=/^\d+$/.test(n)?Number(n):Kt(n);if(t&&t>0){let r=await Ne(t);if(r)return{bundleUrl:r.bundleUrl,port:r.port,framework:r.framework,projectName:r.projectName}}return Xe(n)}function Q(e){let n=e.replace(/\/+$/,"")||"/";return n==="/__soot"||n.startsWith("/__soot/")?"/__soot":""}function Vt(e,n){let t=J(e),r=new URL(n),o=Q(r.pathname);return r.pathname=`${o}/rn`,r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),/^\d+$/.test(t)?r.pathname=`${o}/rn/${t}`:(r.pathname=`${o}/rn`,r.searchParams.set("open",t)),r.toString()}function pt(e){let n=J(e);return/^\d+$/.test(n)||/^https?:\/\//i.test(n)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(n)}async function qt(e,n,t={}){let r=t.resolvedBundle??await ve(e),o=new URL(n),i=Q(o.pathname);o.pathname=`${i}/rn`,o.searchParams.delete("open"),o.searchParams.delete("port"),o.searchParams.delete("demo"),o.searchParams.delete("app");let s=t.hot===void 0?r.bundleUrl:Le(r.bundleUrl,t.hot);return o.searchParams.set("bundle",s),o.toString()}function zt(e){return e.startsWith("~/")?C.join(Et.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function Gt(e){let n={},t={};for(let o=0;o<e.length;o++){if(e[o]==="--replace"){let i=e[o+1];i||(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let s=i.indexOf("=");(s<=0||s===i.length-1)&&(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let a=i.slice(0,s).trim(),l=zt(i.slice(s+1).trim());T.existsSync(l)||(console.error(` rnx open: replacement file not found: ${l}`),process.exit(1)),n[a]={file:l},o++;continue}if(e[o]==="--remap"){let i=e[o+1],s=i?i.indexOf("="):-1;(!i||s<=0||s===i.length-1)&&(console.error(" rnx open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[i.slice(0,s).trim()]=i.slice(s+1).trim(),o++;continue}}let r={};return Object.keys(n).length>0&&(r.modules=n),Object.keys(t).length>0&&(r.network={remap:t}),r.modules||r.network?r:void 0}async function Jt(e){if(e){let n=await q(e.bundleUrl);if(n)return pe(n,{trustStart:!0})}return pe(process.env.CONTRAST_REPO_DIR||process.cwd())}async function Qt(e){if(T.existsSync(C.join(oe(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let n=await Re.install({version:e,setActive:!1,protectVersions:Ce()});console.error(` installed engine runtime ${n.version}`)}function Yt(e,n){let t=n??(me()?void 0:ie()??void 0);if(!t)return e;let r=new URL(e);if(!I(r.hostname)){if(!n)return e;throw new Error(`runtimeVersion ${t} requires a local rnx host; got ${r.origin}`)}return r.hostname=je(t),r.toString()}function ft(){return Te().shellBaseUrl}function Zt(e){return Oe(e)?.shellBaseUrl??Ue(e)??ft()}async function Xt(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r)return e;let o=n?.appDir??await q(r)??void 0,i=We({bundleUrl:r,repoDir:o,exactProjectDir:!!n||!!o});if(i.length===0)return e;let s=await en(i);return s.length===0?e:(t.searchParams.set("appFonts",Ke(s)),t.toString())}catch{return e}}async function en(e){let n=await Promise.all(e.map(async r=>{let o=new AbortController,i=setTimeout(()=>o.abort(),1500);try{let s=await fetch(r.url,{method:"HEAD",signal:o.signal});return s.status>=200&&s.status<400?r:null}catch{return null}finally{clearTimeout(i)}})),t=[];for(let r of n)r!==null&&t.push(r);return t}async function tn(e,n,t={}){if(!e)return new URL(n).toString();if(we(e))return new URL(e).toString();if(jt(e))return Ht(e,n);let r=Tt[e.toLowerCase()];if(r){let o=new URL(n),i=Q(o.pathname);return o.pathname=`${i}${r}`,o.toString()}return pt(e)?qt(e,n,t):Vt(e,n)}async function nn(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r)return e;let o=n?.appDir??await q(r)??void 0,i=Ve({bundleUrl:r,repoDir:o,exactProjectDir:!!n||!!o});return!i||i.imageUrl&&!await rn(i.imageUrl)?e:(t.searchParams.set("appSplash",qe(i)),t.toString())}catch{return e}}async function rn(e){let n=new AbortController,t=setTimeout(()=>n.abort(),1500);try{let r=await fetch(e,{method:"HEAD",signal:n.signal});return r.status>=200&&r.status<400}catch{return!1}finally{clearTimeout(t)}}async function G(e,n=ft(),t={}){let r=await tn(e,n,t),o=await nn(await Xt(r,t.project),t.project);if(!t.device)return o;let i=new URL(o);return i.searchParams.set("device",t.device),i.toString()}function at(e,n){let t=e?.url||e?.origin||n;try{let r=new URL(t);return r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("inspectOpen"),r.searchParams.delete("appFonts"),r.searchParams.delete("appSplash"),r.toString()}catch{return n}}async function on(e,n,t,r={}){let o=new URL(await G(e,n,r));return o.searchParams.set("inspectOpen",t),o.toString()}async function sn(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500,s=r.minNodeCount??10;for(let a=0;a<o;a++){let l=P(e,{commandTimeoutMs:n,simId:t,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>s)return{bridge:l,count:d}}catch{}l.close(),await y(i)}return null}function an(e){if(!e)return null;try{let n=new URL(e);if(n.searchParams.has("bundle")){let t=n.searchParams.get("bundle")||"";try{let r=new URL(t),o=r.pathname.length>36?`...${r.pathname.slice(-36)}`:r.pathname;return`bundle ${r.host}${o}`}catch{return"bundle"}}return n.searchParams.has("port")?`connect :${n.searchParams.get("port")||""}`:n.searchParams.has("open")?`connect ${n.searchParams.get("open")||""}`:n.searchParams.has("demo")?`demo ${n.searchParams.get("demo")||"default"}`:n.pathname.includes("/sootsim/index.html")||n.pathname==="/sootsim/"||n.pathname==="/sootsim"?"embedded rnx":null}catch{return null}}function ln(e){let n=e.indexOf(":");if(n<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,n),r=e.slice(n+1),o=r.length>12?`${r.slice(0,8)}\u2026`:r;return t==="TM_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${o}`:`${t} ${o}`}function Zn(e,n){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
5
|
+
`);for(let t of e){let r=t.lockedBy&&t.lockExpiresAt?`locked by ${ln(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",o=[t.isPrimary?"primary":"",t.id===n?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",r].filter(Boolean);console.log(` ${t.id}${o.length?` [${o.join(", ")}]`:""}`);let i=an(t.url);if(i)console.log(` loaded: ${i}`);else if(t.url){let a=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${a}`)}else t.origin&&console.log(` origin: ${t.origin}`);let s=cn(t);s&&console.log(` engine: ${s}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${lt(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${lt(Date.now()-t.lastActiveAt)}`)}}function cn(e){let n=e.url||e.origin||"";if(!n)return null;try{let t=new URL(n).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"Contrast app embedded (:3000)":me()?`dev \u2014 local build (:${t||"?"})`:`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function lt(e){let n=Math.max(0,Math.round(e/1e3));return n<60?`${n}s ago`:n<3600?`${Math.round(n/60)}m ago`:n<86400?`${Math.round(n/3600)}h ago`:`${Math.round(n/86400)}d ago`}async function Xn(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500;for(let s=0;s<o;s++){let a=P(e,{commandTimeoutMs:n});try{let d=(await a.listSims()).find(t);if(d)return d}catch{}finally{a.close()}await y(i)}return null}async function dn(e,n,t,r,o={}){let i=o.attempts??30,s=o.intervalMs??500,a=!!r&&Number.isInteger(r)&&r>1,l=()=>a&&r!==void 0&&!be(r);for(let d=0;d<i;d++){if(l())return{kind:"host-exit"};let c=P(e,{commandTimeoutMs:n});try{let g=(await c.listSims()).find(t);if(g)return l()?{kind:"host-exit"}:{kind:"match",sim:g}}catch{}finally{c.close()}if(l())return{kind:"host-exit"};await y(s)}return{kind:"timeout"}}async function un(e,n,t,r={}){let o=r.attempts??20,i=r.intervalMs??250;for(let s=0;s<o;s++){let a=P(e,{commandTimeoutMs:n});try{let d=(await a.listSims()).find(c=>c.id===t);if(!d||d.readyState!=="open")return!0}catch{return!0}finally{a.close()}await y(i)}return!1}function mn(e){let n=e.meta;if(!n||n.sootsimHostDriver!=="playwright")return null;let t=Number(n.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function pn(e){if(!e.connectAckFile)return!1;try{return T.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
|
|
6
|
+
`,{flag:"w"}),!0}catch{return!1}}function ct(e){if(e.diagnosticLogPath)try{let n=T.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!n){console.error(` ${C.basename(e.diagnosticLogPath)} was empty`);return}let t=n.length>4e3?`\u2026
|
|
7
|
+
${n.slice(-4e3)}`:n;console.error(` ${C.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(n){let t=n instanceof Error?n.message:String(n);console.error(` failed to read ${C.basename(e.diagnosticLogPath)}: ${t}`)}}function be(e){try{return process.kill(e,0),!0}catch(n){return n?.code==="EPERM"}}async function fn(e,n=2500){let t=Date.now()+n;for(;Date.now()<t;){if(!be(e))return!0;await y(100)}return!be(e)}function gn(e){let n=tt("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),t=tt("ps",["eww","-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(n.status!==0||t.status!==0)return!1;let r=(n.stdout||"").trimEnd(),o=(t.stdout||"").trimEnd();return(o.startsWith(r)?o.slice(r.length):o).includes("SOOTSIM_PW_URL=")}async function he(e,n){let t=new Set(n),r=new Set;for(let o of e){if(!t.has(o.id))continue;let i=mn(o);i&&r.add(i)}for(let o of r){if(!gn(o)){console.log(` skipped pid ${o}: not a rnx playwright host (stale sim record)`);continue}try{process.kill(o,"SIGTERM")}catch{}if(await fn(o)){console.log(` closed playwright host process ${o}`);continue}try{process.kill(o,"SIGKILL"),console.log(` force-closed playwright host process ${o}`)}catch{}}}function Y(e,n){if(n){let o=n.trim(),i=e.find(s=>s.id===o);if(!i)throw new Error(`no sim connected with id ${o}`);return i}let t=e.find(o=>o.isPrimary&&o.readyState==="open");if(t)return t;let r=e.find(o=>o.readyState==="open");if(r)return r;throw new Error("no sim connected")}function dt(e,n,t){let[r,o]=[e,n.url].map(i=>{if(!i)return i;try{let s=new URL(i);if(s.searchParams.has("sootsimConfig"))return s.searchParams.set("sootsimConfig","[redacted]"),s.toString()}catch{}return i});console.log(` ${t==="current sim"?"loaded":"opened"}: ${r} [${t}]`),console.log(` current sim: ${n.id}`),console.log(JSON.stringify({simId:n.id,url:o},null,2))}async function ut(e,n,t){if(t.includes("--no-describe"))return;let r=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await hn(e,n,{stableMs:150,maxMs:400});let o=P(e,{commandTimeoutMs:3e3,simId:n,cliLabel:"open --describe",simIdSource:"flag"});try{let i=null;try{i=await o.send({type:"evaluate",code:Be})}catch{}if(i&&!(i.flag===!0&&!i.loadingText&&Ae(i))){let c=i.loadingText?`still showing "${i.loadingText}"`:i.flag!==!0?"guest ready event has not fired":i.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${c} (nodes: ${i.nodes}, targets: ${i.targets})`),console.log(" before interacting, run: rnx wait ready --max-ms 120000")}let a=`(async () => {
|
|
8
|
+
const t = window.__sootsimTest
|
|
9
|
+
const ms = window.SootSim?.bridges?.mainShell
|
|
10
|
+
if (!t) return null
|
|
11
|
+
let shell = null
|
|
12
|
+
try { shell = ms?.getState ? await ms.getState() : null } catch {}
|
|
13
|
+
const tree = await t.dumpTree(12, ${JSON.stringify({describe:!0,verbose:!1,filter:""})})
|
|
14
|
+
return { tree, shell }
|
|
15
|
+
})()`,l=await o.send({type:"evaluate",code:a});if(!l?.tree)return;if(console.log(""),l.shell?.state){let d=[`state=${l.shell.state}`,l.shell.activeApp?`app=${l.shell.activeApp}`:null].filter(Boolean);console.log(` shell: ${d.join(" ")}`)}console.log(l.tree)}finally{o.close()}}catch{}finally{r===void 0?delete process.env.SOOTSIM_QUIET_TARGET_NOTICE:process.env.SOOTSIM_QUIET_TARGET_NOTICE=r}}async function hn(e,n,t){let r=Date.now()+t.maxMs,o="(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()",i=P(e,{commandTimeoutMs:2e3,simId:n,simIdSource:"flag"});try{let s=-1,a=0;for(;Date.now()<r;){let l=-1;try{let d=await i.send({type:"evaluate",code:o});typeof d=="number"&&(l=d)}catch{}if(l>=0&&l===s){if(Date.now()-a>=t.stableMs)return}else s=l,a=Date.now();await y(50)}}finally{i.close()}}async function wn(e,n={}){let t=U(e,{port:n.port,commandTimeoutMs:n.timeoutMs});t.positional.length!==1&&(console.error(" rnx open: expected exactly one <url-or-route>"),console.error(" examples: rnx open /settings | rnx open myapp://settings"),process.exit(1));let r;try{r=Dt(t.positional[0]??"")}catch(s){console.error(` rnx open: ${s instanceof Error?s.message:String(s)}`),process.exit(1)}let o=_(t),i=t.simId?` --sim ${t.simId}`:"";try{let s=await o.send({type:"call",path:"SootSim.bridges.test.openDeepLink",args:[r]});if(Bt(s)&&s.ok===!1)throw new Error(typeof s.error=="string"?s.error:"deep-link dispatch failed");console.log(` opened deep link: ${r}`)}catch(s){console.error(` link failed: ${s instanceof Error?s.message:String(s)}`),await A(o,{errorsCommand:`rnx get errors 5${i}`,warningsCommand:`rnx get warnings 5${i}`,requestsCommand:`rnx get requests 5${i}`}),process.exit(1)}finally{o.close()}}async function er(e,n={}){let t=U(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--new","--headless","--headed","--ephemeral","--hot","--no-hmr","--no-describe"],stripValueFlags:["--base-url","--replace","--driver","--profile","--cdp-port","--device","--viewport"]}),r=e.find((p,m)=>e[m-1]==="--profile"),o=e.includes("--ephemeral"),i=e.find((p,m)=>e[m-1]==="--cdp-port"),s=i?Number(i):void 0;i&&(!Number.isFinite(s)||s<=0)&&(console.error(` rnx open: --cdp-port must be a positive port number, got "${i}"`),process.exit(1)),r&&o&&(console.error(" rnx open: --profile cannot be combined with --ephemeral"),process.exit(1));let a=r?Fe(r).id:void 0,l=e.includes("--new")||!!a||o,d=Gt(e);l&&t.simIdSource==="flag"&&(console.error(" rnx open: --new, --profile, and --ephemeral cannot be combined with --sim"),process.exit(1));let c=t.positional[0]||"";if(At(c)){l&&(console.error(" rnx open: deep links target the current app; remove --new, --profile, or --ephemeral"),process.exit(1)),await wn(e,n);return}if(Wt(c)){let p=(()=>{try{return I(new URL(c).hostname)}catch{return!1}})();console.log(" that\u2019s an rnx preview/build link \u2014 a full player page, not a driveable sim."),console.log(" opening it in your browser for viewing\u2026");try{await Ge(c,{background:!1})}catch(m){console.error(` could not launch a browser: ${m instanceof Error?m.message:String(m)}`),console.error(` open it yourself: ${c}`),process.exit(1)}console.log(p?" to drive it under the CLI, point `rnx open` at the app\u2019s dev port instead (e.g. `rnx open 8081`).":" the CLI can\u2019t drive a remote preview (the engine only attaches to the local bridge from localhost). to drive the app, run it locally and `rnx open <port>`.");return}let u=pt(c)?await ve(c):void 0,g=await Jt(u),O=await He(g),N=O?.runtimeVersion,F=ce(ce(O?{...O,runtimeVersion:void 0}:void 0,n.runtimeConfig),d);N&&await Qt(N);let Z=e.find((p,m)=>e[m-1]==="--base-url");if(Z&&!t.explicitPort){let p=le(Z);p&&(t.wsPort=p)}t.wsPort=await Lt(t.wsPort,t.explicitPort);let R=e.find((p,m)=>e[m-1]==="--driver")||"";R&&!it(R)&&(console.error(` unknown driver "${R}" \u2014 run \`rnx list --drivers\``),process.exit(1));let S=it(R)?R:"playwright",ht=Mt(e,S);s&&S!=="playwright"&&(console.error(" rnx open: --cdp-port is only honored by the playwright driver"),process.exit(1));let ye=e.includes("--hot"),Se=e.includes("--no-hmr");ye&&Se&&(console.error(" rnx open: --hot and --no-hmr cannot be combined"),process.exit(1));let wt=ye?!0:Se?!1:R!=="playwright",k=e.find((p,m)=>e[m-1]==="--device");k&&!(k in ae)&&(console.error(` rnx open: unknown device "${k}"`),console.error(` known devices: ${Ee().join(", ")}`),process.exit(1));let X=k?ae[k]:void 0,j=e.find((p,m)=>e[m-1]==="--viewport"),H=j?/^(\d+)x(\d+)$/.exec(j):null;j&&!H&&(console.error(` rnx open: --viewport must be <width>x<height>, got "${j}"`),process.exit(1));let bt=H?{width:Number(H[1]),height:Number(H[2])}:void 0,W={hot:wt,device:k,resolvedBundle:u,project:g},vt=N?`http://localhost:${t.wsPort}/`:Z||Zt(t.wsPort),x=Yt(vt,N),xe=e.includes("--base-url");Me(t.wsPort,x);let yt=D();if(!l){let p=_(t),m=t.simId?` --sim ${t.simId}`:"",ne=!1;try{let f=null,V=null;try{let h=await p.listSims();if(t.simIdSource==="saved")f=h.find(w=>w.id===yt&&w.readyState==="open"&&ge(w,S))??null,f||B();else if(t.simIdSource==="flag"&&(f=Y(h,t.simId),!ge(f,S)))throw new Error(`sim ${f.id} is not managed by the ${S} driver`);if(!f&&t.simIdSource!=="flag"){V=await G(c,L(x,F),W);let w=new URL(V);w.searchParams.delete("inspectOpen"),f=h.find(v=>{if(v.readyState!=="open"||!v.url||!ge(v,S))return!1;try{let ke=new URL(v.url);return ke.searchParams.delete("inspectOpen"),ke.toString()===w.toString()}catch{return!1}})??null}if(!f)if(t.simIdSource!=="flag")ne=!0;else throw new Error("no sim connected");if(!ne&&f){let w=xe||we(c)?x:at(f,x),v=V??await G(c,L(w,F),W);p.send({type:"evaluate",simId:f.id,code:`window.location.href = ${JSON.stringify(v)}`}).catch(()=>{})}}catch(h){console.error(` open failed: ${h instanceof Error?h.message:String(h)}`),await A(p,{errorsCommand:`rnx get errors 5${m}`,warningsCommand:`rnx get warnings 5${m}`,requestsCommand:`rnx get requests 5${m}`}),process.exit(1)}if(!ne&&f){await y(1500);let h=await sn(t.wsPort,t.commandTimeoutMs,f.id);h||(console.error(" timed out waiting for current sim to load target"),process.exit(1)),h.bridge.close(),$(f.id);let w=xe||we(c)?x:at(f,x),v=V??await G(c,L(w,F),W);dt(v,{...f,url:v},"current sim"),await ut(t.wsPort,f.id,e);return}}finally{p.close()}}let St=L(x,F),$e=`cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Pe=await on(c,St,$e,W),Ie=_e();Ie||(console.error(" could not resolve a stable owning process; refusing unsupervised sim host"),process.exit(1));let xt=p=>p.url?.includes(`inspectOpen=${$e}`)??!1,E=ze(S);E||(console.error(` unknown driver "${S}" \u2014 run \`rnx list --drivers\``),process.exit(1));let K=Ot(),b=await E.launch({url:Pe,bridgePort:le(x)??t.wsPort,headless:ht,profileId:a,ephemeralProfile:o,cdpPort:s,device:k,ownerPid:Ie,viewport:bt??(X?{width:X.width+120,height:X.height+60}:void 0),connectTimeoutMs:K.hostTimeoutMs});b.launched||(console.error(` ${E.name} driver: ${b.message}`),process.exit(1));let ee=await dn(t.wsPort,t.commandTimeoutMs,xt,b.pid,{attempts:K.attempts,intervalMs:K.intervalMs});if(ee.kind==="host-exit"&&(ct(b),console.error(` ${E.name} host crashed \u2014 sim is no longer attached`),process.exit(1)),ee.kind==="timeout"){if(b.pid)try{process.kill(b.pid,"SIGTERM"),console.error(` closed ${E.name} host process ${b.pid}`)}catch{}ct(b),console.error(` timed out after ${K.timeoutMs}ms waiting for opened sim to connect`),process.exit(1)}let te=ee.sim;$(te.id),pn(b),dt(Pe,te,`${E.name} driver`),await ut(t.wsPort,te.id,e)}async function gt(e,n={}){let t=U(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--force"]}),r=e.includes("--force"),o=_(t),i=t.simId?` --sim ${t.simId}`:"";try{try{let s=await o.listSims(),a=Y(s,t.positional[0]||t.simId);if(a.lockedBy&&a.lockExpiresAt&&a.lockExpiresAt>Date.now()){let l=Math.max(0,Math.round((a.lockExpiresAt-Date.now())/1e3));a.lockedByKind==="user-active"&&(console.error(` refused: ${a.id} is locked by the active user (${l}s) \u2014 that's a live human tab`),console.error(" run `rnx open --new` for a fresh investigation sim"),process.exit(1)),r||(console.error(` refused: ${a.id} is leased by ${a.lockedBy} (${l}s)`),console.error(` \`sootsim use ${a.id} --force\` to take it, or \`rnx open --new\` for a fresh sim`),process.exit(1))}await o.focusSim(a.id),$(a.id),console.log(` using: ${a.id}`)}catch(s){console.error(` use failed: ${s instanceof Error?s.message:String(s)}`),await A(o,{errorsCommand:`rnx get errors 5${i}`,warningsCommand:`rnx get warnings 5${i}`,requestsCommand:`rnx get requests 5${i}`}),process.exit(1)}}finally{o.close()}}async function tr(e,n={}){await gt(e,n)}async function nr(e,n={}){await gt(e,n)}async function rr(e,n={}){let t=U(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--force"]}),r=e.includes("--force"),o=_(t);try{try{let i=await o.listSims(),s=Y(i,t.positional[0]||t.simId),a=r&&s.lockedBy&&s.lockedByKind!=="user-active"?s.lockedBy:null,l=await o.claim(s.id,{force:r});$(s.id);let d=Math.max(0,Math.round((l.lockExpiresAt-Date.now())/1e3)),c=l.bootedCount>0?` (booted ${l.bootedCount})`:"";console.log(` claimed: ${l.simId} [${d}s]${c}`),a&&console.log(` took over from: ${a}`)}catch(i){if(i instanceof De){let s=Math.max(0,Math.round(i.lock.expiresInMs/1e3));console.error(` claim failed: locked by ${i.lock.by} for ${s}s more`),console.error(" use --force to take it, or `rnx open --new` for a fresh sim"),process.exit(1)}console.error(` claim failed: ${i instanceof Error?i.message:String(i)}`),process.exit(1)}}finally{o.close()}}async function bn(e,n,t,r){if(r.length===0)return{closed:[],remaining:[]};await Promise.all(r.map(i=>e.closeSim(i).catch(()=>{})));let o=new Set(r);for(let i=0;i<40;i++){let s=[];try{let a=P(n,{commandTimeoutMs:t});try{s=(await a.listSims()).filter(d=>o.has(d.id)&&d.readyState==="open").map(d=>d.id)}finally{a.close()}}catch{s=[]}if(s.length===0)return{closed:[...o],remaining:[]};if(i===39)return{closed:[...o].filter(a=>!s.includes(a)),remaining:s};await y(250)}return{closed:[...o],remaining:[]}}function vn(e,n){let t=e.filter(u=>u.readyState==="open"),r=t.map(u=>u.id),o=n.explicitKeepId?.trim()||"",i=n.savedKeepId?.trim()||"",s=i?t.some(u=>u.id===i):!1,a=i&&!s?i:null,l=null,d=null,c=null;if(n.closeOthers)if(o){let u=t.find(g=>g.id===o);u?l=u.id:d=o}else if(i&&s)l=i;else{let u=t.find(g=>g.isPrimary)??t[0]??null;u&&(l=u.id,i&&!s&&(c=u.id))}return{openIds:r,keepId:l,targets:d?[]:r.filter(u=>u!==l),staleSavedId:a,missingExplicitKeepId:d,fallbackKeepId:c}}async function or(e,n={}){let t=U(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--all","--others"]}),r=_(t),o=t.simId?` --sim ${t.simId}`:"",i=e.includes("--all"),s=e.includes("--others");if(i||s){try{let a=await r.listSims(),l=D(),d=t.positional[0]||(t.simIdSource==="flag"?t.simId:void 0),c=vn(a,{closeOthers:s,explicitKeepId:d,savedKeepId:l});if(c.staleSavedId&&B(),c.fallbackKeepId&&($(c.fallbackKeepId),console.log(` saved sim ${c.staleSavedId} is gone \u2014 keeping primary ${c.fallbackKeepId}`)),c.missingExplicitKeepId&&(console.error(` close failed: keep sim ${c.missingExplicitKeepId} is not connected; not closing other sims`),process.exit(1)),c.targets.length===0){console.log(c.keepId?` nothing to close \u2014 only the kept sim ${c.keepId} is connected`:c.staleSavedId?` nothing to close \u2014 no sims connected (cleared stale current sim ${c.staleSavedId})`:" nothing to close \u2014 no sims connected");return}let u=await bn(r,t.wsPort,t.commandTimeoutMs,c.targets);await he(a,c.targets);let g=D();g&&u.closed.includes(g)&&(c.keepId?$(c.keepId):B());let O=` closed ${u.closed.length} sim(s)${c.keepId?` (kept ${c.keepId})`:""}`;console.log(O),u.remaining.length>0&&(console.error(` close failed: still connected: ${u.remaining.join(", ")}`),process.exit(1))}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),process.exit(1)}finally{r.close()}return}try{try{let a=await r.listSims(),l=Y(a,t.positional[0]||t.simId),d=a.find(u=>u.id!==l.id&&u.readyState==="open");await r.closeSim(l.id),await un(t.wsPort,t.commandTimeoutMs,l.id)||(await he(a,[l.id]),console.error(` close failed: ${l.id} is still connected`),process.exit(1)),await he(a,[l.id]),D()===l.id&&(d?$(d.id):B()),console.log(` closed: ${l.id}`)}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),await A(r,{errorsCommand:`rnx get errors 5${o}`,warningsCommand:`rnx get warnings 5${o}`,requestsCommand:`rnx get requests 5${o}`}),process.exit(1)}}finally{r.close()}}export{Ot as a,Dt as b,Lt as c,Yn as d,Yt as e,ft as f,Zt as g,G as h,on as i,an as j,Zn as k,Xn as l,dn as m,mn as n,pn as o,he as p,wn as q,er as r,tr as s,nr as t,rr as u,bn as v,vn as w,or as x};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.336 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import{randomUUID as R}from"node:crypto";import r from"node:fs";import{homedir as O}from"node:os";import o from"node:path";var j="SOOTSIM_HOME",N="active",E="daemon.json",_="dev-bridges",w="config.json",b=3e4;function s(){let e=process.env[j];return e&&e.length>0?o.resolve(e):o.join(O(),".sootsim")}function F(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let t=process.argv[1];if(!t)return!1;try{return r.realpathSync(t).includes(`${o.sep}packages${o.sep}sootsim${o.sep}`)}catch{return!1}}function I(){return process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1"?!1:process.env.IS_TAMAGUI_DEV==="1"}function Y(){return F()||I()}function d(){return o.join(s(),"runtimes")}function B(e){return o.join(d(),e)}function h(){return o.join(d(),N)}function v(){return o.join(s(),"electron")}function q(){return o.join(v(),"userData")}function z(e){return o.join(v(),e)}function $(){return o.join(s(),"profiles")}function Q(){return o.join(s(),"camera-fixtures")}function C(){return o.join(s(),"daemon-app")}function M(){return o.join(C(),"SootSim Daemon.app")}function Z(){return o.join(M(),"Contents","MacOS","sootsim-daemon")}function T(){return o.join(s(),"cache")}function a(){return o.join(s(),E)}function f(){return o.join(s(),_)}function D(e){if(!Number.isInteger(e)||e<=0)throw new Error(`invalid development bridge port: ${e}`);return o.join(f(),`${e}.json`)}function y(){return o.join(s(),w)}function S(){try{let e=r.readFileSync(y(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function x(e){m();let t=S(),n={...t,...e};e.settings&&typeof e.settings=="object"&&(n.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let c=`${y()}.tmp`;return r.writeFileSync(c,`${JSON.stringify(n,null,2)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.336 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import{createInterface as e}from"readline";var s=()=>e({input:process.stdin,output:process.stdout});function i(r){return new Promise(n=>{let t=s();t.question(r,o=>{t.close(),n(o.trim())})})}async function l(r,n=!0){let t=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${r} ${t} ${n?"y":"n"} (non-interactive)`),n;let o=await i(` ${r} ${t} `);return o===""?n:o.toLowerCase().startsWith("y")}export{l as a};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*! rnx v0.1.336 | (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 $}from"./chunk-S33NCWJV.js";import{b as y,c as R,d as f,e as w,f as a}from"./chunk-FMWEQNK2.js";import{n as x}from"./chunk-6ALTVOXE.js";import{I as g,J as u,K as d,Q as h,l as p}from"./chunk-V4OZDPTA.js";import O from"fs";import{WebSocket as E}from"ws";function C(t){if(!t||typeof t!="object")return!1;let e=Reflect.get(t,"sections");return typeof Reflect.get(t,"title")=="string"&&Array.isArray(e)&&e.every(o=>o&&typeof o=="object"&&typeof Reflect.get(o,"title")=="string"&&Array.isArray(Reflect.get(o,"items"))&&Reflect.get(o,"items").every(n=>n&&typeof n=="object"&&typeof Reflect.get(n,"summary")=="string"&&typeof Reflect.get(n,"hash")=="string"))}async function b(t,e=fetch){try{let o=new URL(w);o.searchParams.set("version",t);let n=await e(o,{headers:{accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(!n.ok)return null;let s=await n.json();if(!s||typeof s!="object")return null;let i=Reflect.get(s,"entries");return!Array.isArray(i)||!C(i[0])?null:i[0]}catch{return null}}function A(t,e){let o=[`what's new in rnx engine v${t}:`];if(!e||e.sections.length===0)o.push(" release notes are not available yet");else for(let n of e.sections){o.push(` ${n.title}:`);for(let s of n.items)o.push(` \u2022 ${s.summary}`)}return o.push(` full changelog: ${f}`),o.join(`
|
|
5
|
+
`)}async function Q(t,e={}){let[o,...n]=t;if(!o||o==="--help"||o==="-h"){S();return}switch(o){case"install":return L(n,e);case"list":return j(n);case"use":return T(n);case"remove":return D(n);case"which":return G();case"notes":return U(n);default:console.error(` unknown runtime subcommand: ${o}`),S(),process.exit(1)}}function S(){console.log(`
|
|
6
|
+
rnx runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
7
|
+
|
|
8
|
+
usage:
|
|
9
|
+
rnx runtime install [version] install a version (default: channel latest)
|
|
10
|
+
rnx runtime list show installed + available versions
|
|
11
|
+
rnx runtime use <version> switch active runtime
|
|
12
|
+
rnx runtime remove <version> delete an installed runtime
|
|
13
|
+
rnx runtime which print active runtime version
|
|
14
|
+
rnx runtime notes print repo or default engine release notes
|
|
15
|
+
|
|
16
|
+
flags:
|
|
17
|
+
--channel <name> channel to resolve 'latest' from (default: stable)
|
|
18
|
+
--force reinstall even if the version is already on disk
|
|
19
|
+
--set-active=false do not switch active runtime after install
|
|
20
|
+
|
|
21
|
+
environment:
|
|
22
|
+
SOOTSIM_CDN_ORIGIN override the CDN base URL (default: ${R})
|
|
23
|
+
|
|
24
|
+
examples:
|
|
25
|
+
rnx runtime install
|
|
26
|
+
rnx runtime install 1.2.3
|
|
27
|
+
rnx runtime install --channel beta
|
|
28
|
+
rnx runtime use 1.2.3
|
|
29
|
+
rnx runtime notes
|
|
30
|
+
`)}async function L(t,e){let{version:o,flags:n}=F(t),s=n.channel??e.channel??"stable",i=n.force===!0,l=n.setActive!==!1;g(),console.log("rnx runtime install"),console.log(` cdn: ${a.resolveCdnOrigin()}`);try{let r=await a.install({version:o,channel:s,force:i,setActive:l,protectVersions:h()});return console.log(` version: ${r.version} (channel: ${r.channel})`),r.installed?console.log(` installed ${r.version}`):console.log(` already installed at ${r.runtimeDir}`),l&&await k(r.version),r}catch(r){console.error(` ${I(r)}`),process.exit(1)}}async function k(t){d(t),console.log(` active: ${t}`),await _(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function _(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-VW7G7LVZ.js"),n=o();if(!e(n))return!1;let s=x();return new Promise(i=>{let l=!1,r=!1,m=N=>{l||(l=!0,i(N))},c=new E(`ws://127.0.0.1:${s}`,{handshakeTimeout:800}),v=setTimeout(()=>{try{c.close()}catch{}m(r)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:t,id:0})),r=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout(v),m(r)}),c.on("error",()=>{clearTimeout(v),m(!1)})})}async function j(t){g();let e=a.listInstalled(),o=u();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let n of e)console.log(` ${n===o?"*":" "} ${n}`);try{let n=await a.fetchManifest();console.log("available (latest per channel):");for(let[i,l]of Object.entries(n.channels))console.log(` ${i.padEnd(8)} ${l.latest}`);let s=Object.keys(n.versions).sort(y).reverse();if(s.length>1){console.log("hosted versions:");for(let i of s)console.log(` ${i}`)}}catch(n){console.log(`available: (could not fetch manifest: ${I(n)})`)}}async function T(t){let e=t[0];e||(console.error(" usage: rnx runtime use <version>"),process.exit(1));let o=a.listInstalled();o.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${o.join(", ")||"(none)"}`),console.error(` run \`rnx runtime install ${e}\` first`),process.exit(1)),await k(e)}async function D(t){let e=t[0];e||(console.error(" usage: rnx runtime remove <version>"),process.exit(1)),u()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `rnx runtime use <other>` first, or install another version"),process.exit(1)),h().includes(e)&&(console.error(` cannot remove runtime ${e} while a project is using it`),process.exit(1));let n=p(e);if(!O.existsSync(n)){console.error(` ${e} is not installed`);return}O.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function G(){let t=u();if(!t){console.log(" no active runtime");return}console.log(t)}async function U(t){t.length>0&&(console.error(" usage: rnx runtime notes"),process.exit(1));let{config:e}=await $(),o=e?.runtimeVersion??u();if(!o){console.log(" no active runtime"),console.log(` release notes: ${f}`);return}console.log(A(o,await b(o)))}function F(t){let e={},o=[];for(let n=0;n<t.length;n++){let s=t[n];if(s==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(s.startsWith("--channel=")){e.channel=s.slice(10);continue}if(s==="--force"){e.force=!0;continue}if(s==="--set-active=false"||s==="--no-set-active"){e.setActive=!1;continue}o.push(s)}return{version:o[0]??null,flags:e}}function I(t){return t instanceof Error?t.message:String(t)}export{b as a,A as b,Q as c};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.336 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as f,b as S}from"./chunk-
|
|
4
|
+
import{a as f,b as S}from"./chunk-BYOFHYKS.js";import{a as y,c as P}from"./chunk-HDHHEWEA.js";import{a as v}from"./chunk-KDRDDPNN.js";import{b}from"./chunk-ARFQOYRO.js";function M(){let e=f();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"rnx desktop app not installed (run `rnx desktop install`)"}}async function A(e){let o=f();if(!o)return{launched:!1,message:"rnx desktop app not installed"};try{let r=await S(e.url,o,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile,ownerPid:e.ownerPid});return r.launched?{launched:!0,message:e.url?`electron launched via ${r.via} \u2192 ${e.url}`:`electron launched via ${r.via}`,target:r.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(r){return{launched:!1,message:`electron launch failed: ${r instanceof Error?r.message:String(r)}`}}}var k={id:"electron",name:"electron",description:"rnx desktop companion app (native window, menu bar)",kind:"native",availability:M,launch:A};import{spawn as B}from"child_process";import{closeSync as F,mkdtempSync as G,openSync as U,readFileSync as q}from"fs";import{tmpdir as T}from"os";import{join as I}from"path";import{spawnSync as O}from"node:child_process";import{existsSync as _,readFileSync as R}from"node:fs";import{createRequire as L}from"node:module";import{dirname as W,join as N}from"node:path";var $=`
|
|
5
5
|
const { existsSync } = require('node:fs');
|
|
6
6
|
const modulePath = process.env.SOOTSIM_PW_MODULE;
|
|
7
7
|
try {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.336 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{b as
|
|
5
|
-
|
|
4
|
+
import{b as r,c as g,d as f,e as v}from"./chunk-FWGDP2J4.js";import"./chunk-KDRDDPNN.js";import"./chunk-FMWEQNK2.js";import"./chunk-V4OZDPTA.js";import"./chunk-QIVOOERS.js";import"./chunk-GI3GZ54J.js";var $={"browser-cache":"browser caches","camera-fixture":"staged camera fixture videos",recording:"recordings and captured frames","runtime-archive":"downloaded runtime archives","runtime-version":"inactive runtime versions"};function y(s){let i=new Map;for(let o of s){let n=i.get(o.kind)??{bytes:0,count:0};n.bytes+=o.bytes,n.count++,i.set(o.kind,n)}return[...i].sort((o,n)=>n[1].bytes-o[1].bytes).map(([o,n])=>` ${$[o]}: ${r(n.bytes)} (${n.count} ${n.count===1?"item":"items"})`)}function h(){console.log(`
|
|
5
|
+
rnx cleanup \u2014 inspect and reclaim local rnx disk usage
|
|
6
6
|
|
|
7
7
|
usage:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
rnx cleanup
|
|
9
|
+
rnx cleanup --apply
|
|
10
|
+
rnx cleanup --aggressive
|
|
11
|
+
rnx cleanup --apply --aggressive
|
|
12
12
|
|
|
13
13
|
The default is a read-only preview. --apply removes downloaded runtime archives,
|
|
14
14
|
old runtimes outside a two-version rollback window, and disposable browser
|
|
@@ -18,8 +18,8 @@ app storage.
|
|
|
18
18
|
|
|
19
19
|
--aggressive additionally removes the rollback runtime plus user-created
|
|
20
20
|
recordings and captured frames. It still preserves the active runtime and app storage.
|
|
21
|
-
`)}async function S(
|
|
21
|
+
`)}async function S(s){if(s.length===1&&s[0]==="--automatic-worker")try{let e=v();return e.status==="complete"?process.stderr.write(e.reclaimedBytes>0?` rnx automatic cleanup reclaimed ${r(e.reclaimedBytes)}; active runtimes and app data were kept.
|
|
22
22
|
`:` rnx automatic cleanup found no obsolete local data.
|
|
23
|
-
`):e.status==="deferred"&&process.stderr.write(` rnx automatic cleanup reclaimed ${
|
|
23
|
+
`):e.status==="deferred"&&process.stderr.write(` rnx automatic cleanup reclaimed ${r(e.reclaimedBytes)}; ${r(e.deferredInUseBytes)} is in use and will be retried on a later run.
|
|
24
24
|
`),0}catch(e){return process.stderr.write(` rnx automatic cleanup will retry on the next run: ${e instanceof Error?e.message:String(e)}
|
|
25
|
-
`),0}if(
|
|
25
|
+
`),0}if(s.includes("--help")||s.includes("-h"))return h(),0;let i=new Set(["--aggressive","--apply"]),o=s.find(e=>!i.has(e));if(o)return console.error(` cleanup: unknown option ${o}`),h(),1;let n=s.includes("--aggressive"),l=s.includes("--apply"),t=g({aggressive:n}),c=t.entries.filter(e=>e.selected).filter(e=>e.state==="safe"),u=t.entries.filter(e=>e.state==="aggressive"&&e.selected),d=t.entries.filter(e=>e.state==="in-use"),m=d.filter(e=>e.kind==="browser-cache"),w=d.filter(e=>e.kind==="runtime-version"),p=t.entries.find(e=>e.kind==="runtime-version"&&e.state==="aggressive");console.log(` rnx data home: ${t.home}`),console.log(` current size: ${r(t.totalBytes)}`),console.log(` active runtime: ${t.activeRuntime??"(none installed)"}`),console.log(""),console.log(l?" safe items selected for removal:":" safe to reclaim:");for(let e of y(c))console.log(e);if(c.length===0&&console.log(" nothing"),u.length>0){console.log(""),console.log(" aggressive additions:");for(let e of y(u))console.log(e)}console.log(""),console.log(" protected:"),t.activeRuntime&&console.log(` active runtime ${t.activeRuntime} (in use)`);for(let e of w)console.log(` running daemon runtime ${e.path}`);if(p&&!n&&console.log(` rollback runtime ${p.path}`),console.log(" cookies, localStorage, IndexedDB, service workers, and profile data"),n||console.log(" recordings and captured frames (use --aggressive to remove)"),m.length>0&&console.log(` ${r(m.reduce((e,b)=>e+b.bytes,0))} of browser cache is open; close rnx and rerun cleanup`),console.log(""),console.log(` reclaimable now: ${r(t.reclaimableBytes)}`),!l)return console.log(` preview only \u2014 run \`rnx cleanup --apply${n?" --aggressive":""}\` to remove these items`),0;let a=f({aggressive:n});return console.log(` removed ${a.removedPaths.length} ${a.removedPaths.length===1?"item":"items"}; reclaimed ${r(a.reclaimedBytes)}`),console.log(` remaining rnx data: ${r(a.remainingBytes)}`),0}export{S as runCleanup};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.336 | (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-EAPHUH2R.js";import"./chunk-QIVOOERS.js";import"./chunk-GI3GZ54J.js";export{a as getCliVersion};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.336 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{d as
|
|
5
|
-
|
|
4
|
+
import{d as a,g as i,i as d,j as r}from"./chunk-UU2KMAIA.js";import"./chunk-GI3GZ54J.js";import{existsSync as m,readFileSync as k}from"node:fs";import{resolve as f}from"node:path";async function P(e){if(e.includes("--help")||e.includes("-h")){console.log(`
|
|
5
|
+
rnx compat \u2014 check package compatibility
|
|
6
6
|
|
|
7
7
|
usage:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
rnx compat [package-name]
|
|
9
|
+
rnx compat --json
|
|
10
|
+
rnx compat --brief
|
|
11
11
|
|
|
12
12
|
flags:
|
|
13
13
|
--json machine-readable output
|
|
14
14
|
--brief one-line summary
|
|
15
15
|
--app <dir> target directory (default: cwd)
|
|
16
|
-
`);return}let n=e.indexOf("--app"),o=n>=0&&e[n+1]?f(e[n+1]):process.cwd(),l=e.find((s,g)=>!s.startsWith("-")&&(n<0||g!==n+1)),c=y(o);if(!c){console.error(` no package.json found in ${o}`),process.exitCode=1;return}let t=l?x(c,l):
|
|
17
|
-
rnx compatibility report`),console.log(` ${
|
|
16
|
+
`);return}let n=e.indexOf("--app"),o=n>=0&&e[n+1]?f(e[n+1]):process.cwd(),l=e.find((s,g)=>!s.startsWith("-")&&(n<0||g!==n+1)),c=y(o);if(!c){console.error(` no package.json found in ${o}`),process.exitCode=1;return}let t=l?x(c,l):a(c);if(e.includes("--json")){console.log(JSON.stringify(t,null,2));return}if(e.includes("--brief")){console.log(` ${i(t)}`),console.log(` ${r}`);return}console.log(`
|
|
17
|
+
rnx compatibility report`),console.log(` ${i(t)}
|
|
18
18
|
`);for(let s of d(t))console.log(` ${s}`);let p=t.packages.filter(s=>s.status==="full").length;p>0&&console.log(` supported: ${p} packages`);let u=t.packages.filter(s=>s.status==="not-relevant").length;u>0&&console.log(` not relevant at runtime: ${u} packages`),t.packages.length===0&&console.log(" no React Native ecosystem packages detected"),console.log(`
|
|
19
19
|
${r}
|
|
20
|
-
`)}function y(e){let n=f(e,"package.json");if(!m(n))return null;let o=JSON.parse(k(n,"utf8"));return o&&typeof o=="object"?o:null}function x(e,n){let o=e.dependencies?.[n]??e.devDependencies?.[n]??"*";return
|
|
20
|
+
`)}function y(e){let n=f(e,"package.json");if(!m(n))return null;let o=JSON.parse(k(n,"utf8"));return o&&typeof o=="object"?o:null}function x(e,n){let o=e.dependencies?.[n]??e.devDependencies?.[n]??"*";return a({dependencies:{[n]:o}})}export{P as runCompat};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.336 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{C as
|
|
5
|
-
|
|
4
|
+
import{C as r,D as s,z as t}from"./chunk-V4OZDPTA.js";import"./chunk-GI3GZ54J.js";function l(){let e=r();console.log(` product analytics are ${e.productAnalytics?"ON":"OFF"}`),console.log(` config: ${t()}`);let o=process.env.DO_NOT_TRACK;(o==="1"||o==="true")&&console.log(` note: DO_NOT_TRACK=${o} is set \u2014 telemetry is off for this run`)}async function c(e){let o=e.find(n=>!n.startsWith("-"))?.toLowerCase();switch(o){case void 0:case"status":l();return;case"on":s({...r(),productAnalytics:!0}),console.log(" product analytics ON"),console.log(` config: ${t()}`);return;case"off":s({...r(),productAnalytics:!1}),console.log(" product analytics OFF"),console.log(` config: ${t()}`);return;default:console.error(` unknown telemetry action: ${o}`),console.error(" usage: rnx config telemetry [on|off|status]"),process.exit(1)}}function i(){console.log(`
|
|
5
|
+
rnx config \u2014 manage local CLI preferences
|
|
6
6
|
|
|
7
7
|
usage:
|
|
8
|
-
|
|
8
|
+
rnx config telemetry [on|off|status]
|
|
9
9
|
|
|
10
10
|
environment:
|
|
11
11
|
SOOTSIM_HINTS=off suppress CLI hints
|
|
12
12
|
SOOTSIM_HINTS=always show every CLI hint every time
|
|
13
|
-
`)}async function d(e){if(e.includes("--help")||e.includes("-h")){
|
|
13
|
+
`)}async function d(e){if(e.includes("--help")||e.includes("-h")){i();return}let o=e.find(n=>!n.startsWith("-"));if(o==="telemetry"){let n=e.indexOf(o);await c([...e.slice(0,n),...e.slice(n+1)]);return}console.error(` unknown config command: ${o??"(missing)"}`),i(),process.exit(1)}export{d as runConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.336 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
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,u,v,w,x}from"./chunk-
|
|
4
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}from"./chunk-UZCNKUSS.js";import"./chunk-TV457FWW.js";import"./chunk-M2XGXP7G.js";import"./chunk-S33NCWJV.js";import"./chunk-ZI6YQKD6.js";import"./chunk-BYOFHYKS.js";import"./chunk-HDHHEWEA.js";import"./chunk-NJMBQLAU.js";import"./chunk-MARPC3GM.js";import"./chunk-DMD24WAG.js";import"./chunk-262YA5CJ.js";import"./chunk-G3FVXFPF.js";import"./chunk-7PMNRG53.js";import"./chunk-NVPZLIMW.js";import"./chunk-KDRDDPNN.js";import"./chunk-FMWEQNK2.js";import"./chunk-BOZARB6P.js";import"./chunk-BHXQ7MUW.js";import"./chunk-6ALTVOXE.js";import"./chunk-ARFQOYRO.js";import"./chunk-V4OZDPTA.js";import"./chunk-QIVOOERS.js";import"./chunk-GI3GZ54J.js";export{e as applyRuntimeGenerationOrigin,i as buildOpenUrl,h as buildShellUrl,v as closeSimsBulk,c as ensureBridgeForOpen,b as normalizeDeepLinkTarget,w as planBulkCloseTargets,n as playwrightHostPidForSim,k as printConnectedSims,d as resolveBundleTarget,f as resolveDefaultShellBaseUrl,a as resolveDriverConnectWaitOptions,g as resolveShellBaseUrlForBridgePort,u as runClaimCommand,x as runCloseCommand,t as runFocusCommand,q as runLinkCommand,r as runOpenCommand,s as runUseCommand,o as signalDriverLaunchConnected,j as summarizeSimUrl,p as terminatePlaywrightHostsForSims,l as waitForSimMatch,m as waitForSimMatchOrHostExit};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.336 | (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}from"./chunk-BVGUTE2T.js";import"./chunk-MQES3MTN.js";import"./chunk-7FHAHI5V.js";import"./chunk-TA4GBBGC.js";import"./chunk-KPL344LX.js";import"./chunk-3QCSDI3B.js";import"./chunk-BOZARB6P.js";import"./chunk-BHXQ7MUW.js";import"./chunk-6ALTVOXE.js";import"./chunk-ARFQOYRO.js";import"./chunk-6TN3YWA6.js";import"./chunk-V4OZDPTA.js";import"./chunk-EAPHUH2R.js";import"./chunk-QIVOOERS.js";import"./chunk-2PFDFGOG.js";import"./chunk-GI3GZ54J.js";export{c as daemonInstall,b as getDaemonServiceStatus,a as runDaemon,e as teardownDaemonService,d as teardownLegacyMacDaemonArtifacts,f as teardownSootsimHome};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.336 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{f as b,m as C}from"./chunk-
|
|
5
|
-
|
|
4
|
+
import{f as b,m as C}from"./chunk-G3FVXFPF.js";import{L as N,M as D,N as O,O as T,P as k}from"./chunk-7PMNRG53.js";import{q as A,s as _,u as S}from"./chunk-6ALTVOXE.js";import"./chunk-ARFQOYRO.js";import"./chunk-V4OZDPTA.js";import"./chunk-GI3GZ54J.js";var B=["portals","sheets","layout","onlayout","animated","render","touch","yoga","all"],F="__sootsimShellAnimationTrace",q="__sootsimDebugAnimation";function R(){console.log(`
|
|
5
|
+
rnx debug \u2014 drive __sootsimDebug from the terminal
|
|
6
6
|
|
|
7
7
|
usage:
|
|
8
|
-
|
|
8
|
+
rnx debug <subcommand> [args]
|
|
9
9
|
|
|
10
10
|
subcommands:
|
|
11
11
|
enable <channels> turn on one or more debug channels
|
|
@@ -67,16 +67,16 @@ options:
|
|
|
67
67
|
--json compact JSON output for pipelines
|
|
68
68
|
|
|
69
69
|
examples:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
rnx debug enable sheets,portals
|
|
71
|
+
rnx debug snapshot before
|
|
72
|
+
rnx debug snapshot after
|
|
73
|
+
rnx debug diff before after
|
|
74
|
+
rnx debug image-audit per-image source pixels per device pixel
|
|
75
|
+
rnx debug find sheets | jq '.[] | select(.translateY != null)'
|
|
76
|
+
rnx debug trace shell on 240
|
|
77
|
+
rnx debug trace shell 120
|
|
78
|
+
rnx debug trace anim on 3 240
|
|
79
|
+
rnx debug trace anim 3 60
|
|
80
80
|
`)}function I(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 $(t,a=240){let d=Number.isFinite(a)&&a>0?Math.max(1,Math.round(a)):240,m=JSON.stringify(F),f=JSON.stringify(q);return t==="on"?`(() => {
|
|
81
81
|
const root = window
|
|
82
82
|
const store = root[${m}] || (root[${m}] = {
|
|
@@ -181,8 +181,8 @@ examples:
|
|
|
181
181
|
} : null,
|
|
182
182
|
samples,
|
|
183
183
|
}
|
|
184
|
-
})()`}async function u(t,a){return S(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 f=t.rows.filter(c=>c.shortfall!==null).filter(c=>c.shortfall<d);if(console.log(` ${t.rows.length} images drawn (${t.draws} draws), ${f.length} below ${d} of what their source could deliver`),console.log(` sampling: mipmapped ${t.samplingCounts.mipmapped} \xB7 cubic ${t.samplingCounts.cubic} \xB7 repeat ${t.samplingCounts.repeat} \xB7 none ${t.samplingCounts.none}`),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 x=`${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)} ${x} ${r} ${w} ${y} ${c.dpr.toFixed(1)} ${V(c)}`)}}async function X(t,a){let d=A(t,{port:a.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),m=d.positional;(!m[0]||t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let c=d.wsPort,x=d.simId,r=!t.includes("--json"),w=x?` --sim ${x}`:"",y=m[0],l=m.slice(1);if(new Set(["state","js","perf","memory","sample-color"]).has(y)){let{runInspect:e}=await import("./inspect-
|
|
185
|
-
known: ${B.join(", ")}`),process.exit(1));let s=await k(o,"enable",e);console.log(i({active:s},r));break}case"disable":{let e=I(l[0]),s=await k(o,"disable",e);console.log(i({active:s},r));break}case"toggle":{let e=l[0];e||(console.error(" usage:
|
|
184
|
+
})()`}async function u(t,a){return S(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 f=t.rows.filter(c=>c.shortfall!==null).filter(c=>c.shortfall<d);if(console.log(` ${t.rows.length} images drawn (${t.draws} draws), ${f.length} below ${d} of what their source could deliver`),console.log(` sampling: mipmapped ${t.samplingCounts.mipmapped} \xB7 cubic ${t.samplingCounts.cubic} \xB7 repeat ${t.samplingCounts.repeat} \xB7 none ${t.samplingCounts.none}`),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 x=`${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)} ${x} ${r} ${w} ${y} ${c.dpr.toFixed(1)} ${V(c)}`)}}async function X(t,a){let d=A(t,{port:a.port,stripBooleanFlags:["--pretty","--json","--help","-h"]}),m=d.positional;(!m[0]||t.includes("--help")||t.includes("-h"))&&(R(),process.exit(0));let c=d.wsPort,x=d.simId,r=!t.includes("--json"),w=x?` --sim ${x}`:"",y=m[0],l=m.slice(1);if(new Set(["state","js","perf","memory","sample-color"]).has(y)){let{runInspect:e}=await import("./inspect-PCJ6C2BN.js");await e(["debug",...t],{port:a.port,verbose:a.verbose});return}let o=_(d);try{switch(y){case"enable":{let e=I(l[0]);e.length===0&&(console.error(` usage: rnx debug enable <channel[,channel,...]>
|
|
185
|
+
known: ${B.join(", ")}`),process.exit(1));let s=await k(o,"enable",e);console.log(i({active:s},r));break}case"disable":{let e=I(l[0]),s=await k(o,"disable",e);console.log(i({active:s},r));break}case"toggle":{let e=l[0];e||(console.error(" usage: rnx 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 N(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 D(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: rnx debug diff <labelA> <labelB>"),process.exit(1));let n=`(() => {
|
|
186
186
|
const d = window.__sootsimDebug.diff(${JSON.stringify(e)}, ${JSON.stringify(s)});
|
|
187
187
|
if (!d) return null;
|
|
188
188
|
return {
|
|
@@ -197,4 +197,4 @@ examples:
|
|
|
197
197
|
while it records, paint boundaries rebuild and raster blits are
|
|
198
198
|
bypassed, so every image on screen should reach the draw path.
|
|
199
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 O(o,e);console.log(i(s,r))}else console.error(" usage:
|
|
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 O(o,e);console.log(i(s,r))}else console.error(" usage: rnx 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: rnx debug trace anim <on|off|status|clear|<id>> [id|limit]"),process.exit(1)),n==="on"){let p=l[2]??"all",h=l[3]?Number(l[3]):void 0,v=p==="all"?"all":Number(p);v!=="all"&&!Number.isFinite(v)&&(console.error(` invalid target: ${p}`),process.exit(1)),await b(o,"enableAnimationTrace",v,h);let j=await b(o,"listAnimationTraces");console.log(i({enabled:v,traces:j},r));break}if(n==="off"){let p=l[2]??"all",h=p==="all"?"all":Number(p);h!=="all"&&!Number.isFinite(h)&&(console.error(` invalid target: ${p}`),process.exit(1)),await b(o,"disableAnimationTrace",h),console.log(i({disabled:h},r));break}if(n==="status"||n==="clear"){n==="clear"&&await b(o,"disableAnimationTrace","all");let p=await b(o,"listAnimationTraces");console.log(i({traces:p},r));break}let g=Number(n);Number.isFinite(g)||(console.error(` invalid id: ${n}`),process.exit(1));let L=l[2]?Number(l[2]):void 0,H=await b(o,"getAnimationTrace",g,L);console.log(i({id:g,samples:H},r));break}if(e!=="shell"&&(console.error(" usage: rnx 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,$("on",n));console.log(i(g,r));break}if(s==="off"){let n=await u(o,$("off"));console.log(i(n,r));break}if(s==="clear"){let n=await u(o,$("clear"));console.log(i(n,r));break}if(s==="status"){let n=await u(o,$("status"));console.log(i(n,r));break}console.error(" usage: rnx 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 T(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}`),R(),process.exit(1)}}catch(e){console.error(` debug failed: ${e.message}`),await C(o,{errorsCommand:`rnx get errors 5${w}`,warningsCommand:`rnx get warnings 5${w}`,requestsCommand:`rnx get requests 5${w}`}),process.exit(1)}finally{o.close()}}export{X as runDebug};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! rnx v0.1.336 | (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 f}from"./chunk-2VOFUIKQ.js";import"./chunk-JIWE66VU.js";import{a as d}from"./chunk-UB3JHBDW.js";import{h as u}from"./chunk-UZCNKUSS.js";import"./chunk-TV457FWW.js";import"./chunk-M2XGXP7G.js";import"./chunk-S33NCWJV.js";import{a}from"./chunk-ZI6YQKD6.js";import{a as p}from"./chunk-BYOFHYKS.js";import{c}from"./chunk-HDHHEWEA.js";import"./chunk-NJMBQLAU.js";import"./chunk-MARPC3GM.js";import"./chunk-DMD24WAG.js";import"./chunk-262YA5CJ.js";import{a as l}from"./chunk-WBTT5WIO.js";import"./chunk-G3FVXFPF.js";import"./chunk-7PMNRG53.js";import"./chunk-NVPZLIMW.js";import"./chunk-KDRDDPNN.js";import"./chunk-FMWEQNK2.js";import"./chunk-BOZARB6P.js";import"./chunk-BHXQ7MUW.js";import"./chunk-6ALTVOXE.js";import"./chunk-ARFQOYRO.js";import"./chunk-V4OZDPTA.js";import"./chunk-QIVOOERS.js";import"./chunk-GI3GZ54J.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?u(String(o)):void 0}async function m(e,t){(e.includes("--help")||e.includes("-h"))&&(console.log(`
|
|
5
|
+
rnx desktop \u2014 launch the desktop companion
|
|
6
|
+
|
|
7
|
+
usage:
|
|
8
|
+
rnx 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
|
+
rnx desktop
|
|
17
|
+
rnx desktop --port 5173
|
|
18
|
+
rnx 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(" rnx desktop: --profile cannot be combined with --ephemeral"),process.exit(1));let h=o?c(o).id:void 0,r=p();if(!r){if(d(),process.stdin.isTTY&&process.env.CI!=="1"&&process.env.SOOTSIM_NO_PROMPT!=="1"&&await l("run rnx desktop install now?",!0)){console.log();let{runInstallDesktop:s}=await import("./install-desktop-NGQWMGQO.js");await s(["--yes"]),r=p()}r||process.exit(1)}console.log(` launching ${r.path}`);let x=await v(e,t),i=await a.launch({url:x,device:t.device,profileId:h,ephemeralProfile:n});i.launched||(console.error(` ${i.message}`),process.exit(1)),console.log(` ${i.message}`)}function w(){console.log(`
|
|
20
|
+
rnx desktop \u2014 launch or install the desktop companion
|
|
21
|
+
|
|
22
|
+
usage:
|
|
23
|
+
rnx desktop [options]
|
|
24
|
+
rnx 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 f([...e.slice(0,n),...e.slice(n+1)]);return}await m(e,t)}export{T as runDesktop};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*! rnx v0.1.336 | (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 N}from"./chunk-2Q6S7X5O.js";import"./chunk-SV6NVD7P.js";import"./chunk-4532OPNZ.js";import"./chunk-2J4OBR7W.js";import"./chunk-UB3JHBDW.js";import"./chunk-NL2HXO7U.js";import"./chunk-OXRDTNVL.js";import"./chunk-UZCNKUSS.js";import"./chunk-TV457FWW.js";import"./chunk-M2XGXP7G.js";import"./chunk-S33NCWJV.js";import"./chunk-ZI6YQKD6.js";import"./chunk-BYOFHYKS.js";import"./chunk-HDHHEWEA.js";import{c as F,d as $,e as E}from"./chunk-RZ2PXHA7.js";import{a as M}from"./chunk-OUAYBJ4G.js";import"./chunk-NJMBQLAU.js";import"./chunk-MARPC3GM.js";import"./chunk-DMD24WAG.js";import"./chunk-262YA5CJ.js";import"./chunk-G3FVXFPF.js";import"./chunk-7PMNRG53.js";import"./chunk-NVPZLIMW.js";import"./chunk-BIZE6NBI.js";import"./chunk-STMCT3G3.js";import"./chunk-MQES3MTN.js";import"./chunk-7FHAHI5V.js";import"./chunk-KDRDDPNN.js";import"./chunk-FMWEQNK2.js";import"./chunk-3QCSDI3B.js";import"./chunk-BOZARB6P.js";import"./chunk-BHXQ7MUW.js";import"./chunk-6ALTVOXE.js";import"./chunk-ARFQOYRO.js";import"./chunk-6TN3YWA6.js";import"./chunk-V4OZDPTA.js";import{a as R}from"./chunk-QIVOOERS.js";import"./chunk-GI3GZ54J.js";import{spawn as G}from"child_process";import{existsSync as g,mkdirSync as B,readFileSync as C,writeFileSync as y,unlinkSync as U}from"fs";import{tmpdir as k}from"os";import{dirname as q,resolve as a,join as J,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
|
+
rnx detox \u2014 run detox-style tests against an rnx shell
|
|
6
|
+
|
|
7
|
+
usage:
|
|
8
|
+
rnx detox [testFiles...] run all tests under e2e/, test/e2e/, or detox/
|
|
9
|
+
rnx detox --config <path> use a specific jest config
|
|
10
|
+
rnx detox init scaffold sootsim-detox.config.cjs + sample test
|
|
11
|
+
rnx detox --watch jest watch mode
|
|
12
|
+
rnx detox --headed keep the rnx shell window visible
|
|
13
|
+
rnx detox -t <pattern> pass a jest --testNamePattern
|
|
14
|
+
rnx detox --no-launch skip auto-launching an rnx shell
|
|
15
|
+
|
|
16
|
+
rnx 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,o={}){if((t.includes("--help")||t.includes("-h"))&&(console.log(z),process.exit(0)),t[0]==="init")return Y();let i=e=>{let s=t.indexOf(e);return s>=0?t[s+1]:void 0},n=e=>t.includes(e),u=n("--watch"),f=n("--headed"),d=n("--no-launch"),T=i("--config"),m=o.port||Number(process.env.SOOTSIM_PORT)||5173,A=t.filter((e,s)=>{if(e.startsWith("--")||e==="-t"||e==="-h")return!1;let r=t[s-1];return!(r==="--config"||r==="-t"||r==="--testNamePattern"||r==="--grep"||r==="--maxWorkers"||r==="--shard")}),L=t.flatMap((e,s)=>e==="--runInBand"||e.startsWith("--maxWorkers=")||e.startsWith("--shard=")?[e]:(e==="--maxWorkers"||e==="--shard")&&t[s+1]?[e,t[s+1]]:[]),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 s=a(process.cwd(),e);if(g(s)){c=s;break}}c||(console.error(` error: no detox tests found. expected one of: ${O.join(", ")}
|
|
19
|
+
run 'rnx detox init' to scaffold a starter suite.`),process.exit(1)),d||await X(m);let l=["jest"],x=T||Q(["sootsim-detox.config.cjs","jest.config.cjs","jest.config.js"]),p=null;if(x)l.push("--config",a(process.cwd(),x));else{let e=a(V(),"jest-preset.cjs");p=J(k(),`sootsim-detox-${process.pid}.config.cjs`);let s={rootDir:c,roots:["<rootDir>"],testMatch:["<rootDir>/**/*.test.ts","<rootDir>/**/*.test.js"]};y(p,`module.exports = { ...require(${JSON.stringify(e)}), ...${JSON.stringify(s)} }
|
|
20
|
+
`),l.push("--config",p)}u&&l.push("--watch");let I=i("-t")||i("--testNamePattern")||i("--grep");I&&l.push("-t",I);let j=M(),b=!u&&F({uploadedShare:!1,auth:j}),h=process.env.SOOTSIM_JEST_OUTPUT_FILE||null;process.env.SOOTSIM_JEST_JSON==="1"&&l.push("--json"),process.env.SOOTSIM_JEST_OUTPUT_FILE?l.push("--outputFile",process.env.SOOTSIM_JEST_OUTPUT_FILE):b&&(h=J(k(),`sootsim-detox-results-${process.pid}.json`),l.push("--json","--outputFile",h)),l.push(...L),l.push(...A),console.log(" rnx detox"),console.log(` test dir: ${c}`),console.log(` port: ${m}${f?" (headed)":""}`),x&&console.log(` config: ${x}`);let S=G("npx",l,{cwd:process.cwd(),stdio:"inherit",env:{...process.env,SOOTSIM_TEST_DIR:c,SOOTSIM_PORT:String(m),SOOTSIM_HEADED:f?"1":"",SOOTSIM_URL:process.env.SOOTSIM_URL||`http://localhost:${m}`}}),v=e=>()=>{S.kill(e)},_=v("SIGTERM"),D=v("SIGINT");process.on("SIGTERM",_),process.on("SIGINT",D);let W=Date.now(),w=await new Promise((e,s)=>{S.once("error",s),S.once("exit",(r,P)=>{if(P){console.error(` error: jest terminated by ${P}`),e(1);return}e(r??1)})});if(process.off("SIGTERM",_),process.off("SIGINT",D),p)try{U(p)}catch{}if(b){let e=h?K(h):null,s=await E(),r=await $({origin:s,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()-W,auth:j});r&&console.log(` run: ${r.id}`)}process.exit(w)}function K(t){try{let o=JSON.parse(C(t,"utf8")),i=null,n=null,u=0;for(let f of o.testResults??[])for(let d of f.testResults??[]){if(n==null&&d.status==="failed"){n=u;let T=d.failureMessages?.[0]?.split(`
|
|
21
|
+
`)[0];i=[d.fullName,T].filter(Boolean).join(": ")||null}u+=1}return typeof o.numTotalTests!="number"?null:{numTotalTests:o.numTotalTests,numPassedTests:o.numPassedTests??0,firstFailure:i,firstFailedIndex:n}}catch{return null}finally{if(!process.env.SOOTSIM_JEST_OUTPUT_FILE)try{U(t)}catch{}}}function Q(t){for(let o of t)if(g(a(process.cwd(),o)))return o;return null}async function X(t){await N()||console.warn(` warn: no rnx shell reachable on :${t}. start your app, then run \`rnx open <app-port>\`
|
|
22
|
+
or pass --no-launch if you're managing the shell yourself.`)}function Y(){let t=process.cwd(),o=a(t,"sootsim-detox.config.cjs");g(o)?console.log(` skip: ${o} already exists`):(y(o,`// rnx 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 ${o}`));let i=a(t,"e2e"),n=a(i,"example.test.ts");g(n)?console.log(` skip: ${n} already exists`):(B(i,{recursive:!0}),y(n,`// sample rnx 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(" rnx detox # run the sample"),console.log(" rnx detox --watch"),process.exit(0)}export{ae as runDetox};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.336 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import"./chunk-
|
|
5
|
-
|
|
4
|
+
import"./chunk-M2XGXP7G.js";import"./chunk-262YA5CJ.js";import"./chunk-BOZARB6P.js";import{b as c,c as s,d as m}from"./chunk-BHXQ7MUW.js";import{q as d,s as l,v as a}from"./chunk-6ALTVOXE.js";import"./chunk-ARFQOYRO.js";import"./chunk-V4OZDPTA.js";import"./chunk-GI3GZ54J.js";function h(){console.log(`
|
|
5
|
+
rnx device \u2014 inspect or change the live device preset for a sim
|
|
6
6
|
|
|
7
7
|
usage:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
rnx device
|
|
9
|
+
rnx device get
|
|
10
|
+
rnx device set <model> [--sim <id>]
|
|
11
|
+
rnx device list
|
|
12
12
|
|
|
13
13
|
examples:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
rnx device
|
|
15
|
+
rnx device set iphone-14
|
|
16
|
+
rnx device set iphone-16-pro-max --sim a7
|
|
17
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
|
|
18
|
+
`);for(let i of m())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 `rnx device list` to see valid models"),process.exit(1));let e=d(n,{port:t.port}),p=l(e);try{let g=await a(p,"SootSim.bridges.settings.set","deviceModel",i),r=s(i);console.log(` ${g?"set":"kept"} device: ${i} (${r.width}x${r.height} pt, ${r.width*r.scale}x${r.height*r.scale} px)${g?" \u2014 reloading sim":""}`)}finally{p.close()}return}h(),console.error(` unknown subcommand: ${o}`),process.exit(1)}export{$ as runDeviceCommand};
|