rnxsim 0.1.376 → 0.1.378
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 +28 -25
- package/cli/app-config.ts +9 -12
- package/cli/app-fonts.ts +3 -3
- package/cli/app-project.ts +8 -8
- package/cli/auth.ts +7 -9
- package/cli/bin.ts +16 -31
- package/cli/bridge-flow-runner.ts +3 -3
- package/cli/browser-backend.ts +44 -0
- package/cli/command-contract.ts +221 -0
- package/cli/command-registry.ts +291 -0
- package/cli/commands/agent-wrapper.ts +2 -2
- package/cli/commands/app-fonts.ts +2 -2
- package/cli/commands/assert.ts +3 -3
- package/cli/commands/auth.ts +1 -1
- package/cli/commands/box/cloud-box.ts +1 -1
- package/cli/commands/box/plane-share.ts +2 -2
- package/cli/commands/box.ts +4 -6
- package/cli/commands/compat.ts +1 -1
- package/cli/commands/config.ts +2 -2
- package/cli/commands/control.ts +29 -29
- package/cli/commands/cpu-profile.ts +7 -7
- package/cli/commands/daemon-mac-app.ts +7 -7
- package/cli/commands/daemon.ts +10 -10
- package/cli/commands/debug.ts +11 -11
- package/cli/commands/detox.ts +13 -13
- package/cli/commands/diagnose.ts +6 -6
- package/cli/commands/do-chain.ts +1 -2
- package/cli/commands/electron.ts +1 -3
- package/cli/commands/film.ts +3 -3
- package/cli/commands/flow.ts +43 -43
- package/cli/commands/inspect/count.ts +1 -1
- package/cli/commands/inspect/describe.ts +1 -1
- package/cli/commands/inspect/env.ts +2 -2
- package/cli/commands/inspect/get-layout.ts +1 -1
- package/cli/commands/inspect/keyboard.ts +1 -1
- package/cli/commands/inspect/list.ts +1 -1
- package/cli/commands/inspect/memory.ts +1 -1
- package/cli/commands/inspect/resolve-target.ts +1 -1
- package/cli/commands/inspect/screens.ts +1 -1
- package/cli/commands/inspect/tree.ts +1 -1
- package/cli/commands/inspect/url.ts +1 -1
- package/cli/commands/inspect/wait-event.ts +5 -5
- package/cli/commands/inspect.ts +34 -34
- package/cli/commands/install-desktop.ts +3 -3
- package/cli/commands/login.ts +6 -6
- package/cli/commands/maestro-generate.ts +5 -5
- package/cli/commands/maestro.ts +5 -5
- package/cli/commands/profile.ts +1 -1
- package/cli/commands/record.ts +9 -9
- package/cli/commands/runtime.ts +18 -18
- package/cli/commands/screenshot-command.ts +1 -1
- package/cli/commands/screenshot-layers.ts +5 -5
- package/cli/commands/screenshot-mode.ts +1 -1
- package/cli/commands/screenshot.ts +8 -8
- package/cli/commands/screenshots-capture.ts +5 -5
- package/cli/commands/serve.ts +3 -3
- package/cli/commands/setup.ts +20 -12
- package/cli/commands/skills.ts +5 -5
- package/cli/commands/slides.ts +1 -1
- package/cli/commands/telemetry.ts +1 -1
- package/cli/commands/three-mode.ts +1 -1
- package/cli/commands/timeline.ts +8 -8
- package/cli/commands/upgrade.ts +116 -131
- package/cli/commands/upload.ts +12 -12
- package/cli/commands/version.ts +7 -7
- package/cli/commands/what-happened.ts +9 -9
- package/cli/current-sim.ts +3 -3
- package/cli/desktop-companion.ts +1 -1
- package/cli/drivers/playwright.ts +9 -9
- package/cli/drivers/registry.ts +1 -1
- package/cli/drivers/types.ts +1 -1
- package/cli/flow-file.ts +2 -2
- package/cli/flow-session.ts +1 -1
- package/cli/help-core.ts +136 -0
- package/cli/help.ts +17 -53
- package/cli/hints.ts +5 -5
- package/cli/inspect-notice-state.ts +1 -1
- package/cli/maestro-js.ts +1 -1
- package/cli/outbound-endpoints.ts +23 -5
- package/cli/parse-args.ts +19 -66
- package/cli/recording-access.ts +1 -1
- package/cli/registry.ts +1 -0
- package/cli/run-registry.ts +1 -1
- package/cli/run-rnx-core.ts +148 -0
- package/cli/run-rnx.ts +6 -9
- package/cli/runtime-notes.ts +3 -3
- package/cli/standalone.ts +4 -0
- package/cli/ws-bridge.ts +8 -8
- package/detox/config-loader.ts +2 -2
- package/detox/index.ts +8 -8
- package/detox/jest-preset.cjs +1 -1
- package/detox/navigation.ts +2 -2
- package/dist-lib/agent-daemon-client.cjs +5 -5
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +2 -2
- package/dist-lib/agent-sessions.cjs +10 -10
- package/dist-lib/attached-projects.cjs +6 -6
- package/dist-lib/auth/shared-session.cjs +6 -6
- 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-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +25 -25
- package/dist-lib/detox/index.cjs +73 -31
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +29 -29
- package/dist-lib/host/bridge-host.cjs +128 -49
- 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/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +14 -14
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +8 -8
- package/dist-lib/profiles.cjs +12 -12
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +8 -8
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +329 -160
- package/dist-lib/vite.cjs +9 -9
- package/package.json +4 -11
- package/scripts/dev-server-scanner.ts +2 -2
- package/scripts/optional-demo-registry.ts +1 -1
- package/skills/contrast/SKILL.md +3 -3
- package/skills/rnx-debug/SKILL.md +1 -1
- package/skills/rnx-test/SKILL.md +2 -2
- package/src/agent-identity.ts +1 -1
- package/src/agent-sessions.ts +7 -5
- package/src/cli-version.ts +12 -4
- package/src/config.ts +26 -28
- package/src/disk-cleanup.ts +11 -11
- package/src/home-paths.ts +28 -28
- package/src/host/bridge-host.ts +16 -16
- package/src/metro-plugin.ts +2 -2
- package/src/profiles.ts +2 -2
- package/src/runtime-assets.ts +7 -7
- package/src/runtime-delivery.ts +13 -13
- package/src/screenshots/orchestrate.ts +1 -1
- package/src/screenshots/schema.ts +2 -2
- package/src/skills/builtin/a11y-review.ts +2 -2
- package/src/skills/builtin/compat-check.ts +2 -2
- package/src/skills/builtin/maestro-test.ts +2 -2
- package/src/skills/builtin/perf-profile.ts +2 -2
- package/src/skills/builtin/screenshot-all.ts +2 -2
- package/src/skills/builtin/visual-diff.ts +2 -2
- package/src/skills/registry.ts +8 -8
- package/src/skills/types.ts +1 -1
- package/src/vite-plugin-one.ts +3 -3
- package/src/vite-plugin.ts +15 -2
- package/dist-cli/bin.js +0 -15
- package/dist-cli/chunks/agent-H42FCKFF.js +0 -48
- package/dist-cli/chunks/agent-wrapper-BBZKTZS6.js +0 -17
- package/dist-cli/chunks/app-fonts-43VXIKF4.js +0 -4
- package/dist-cli/chunks/assert-IXOLVO5Z.js +0 -49
- package/dist-cli/chunks/auth-KFMFB6FU.js +0 -12
- package/dist-cli/chunks/beta-5AO3SJB7.js +0 -4
- package/dist-cli/chunks/box-ZHM66L6K.js +0 -1730
- package/dist-cli/chunks/camera-FNJVFCDQ.js +0 -33
- package/dist-cli/chunks/chunk-37MCSPTE.js +0 -71
- package/dist-cli/chunks/chunk-3PEMSUAQ.js +0 -30
- package/dist-cli/chunks/chunk-4TQ5HOK3.js +0 -7
- package/dist-cli/chunks/chunk-5YZYDEMI.js +0 -4
- package/dist-cli/chunks/chunk-6CV3R3XD.js +0 -15
- package/dist-cli/chunks/chunk-7LGK5XU6.js +0 -4
- package/dist-cli/chunks/chunk-7R2TK2NY.js +0 -4
- package/dist-cli/chunks/chunk-7VZZQQEE.js +0 -497
- package/dist-cli/chunks/chunk-AFOVILIL.js +0 -130
- package/dist-cli/chunks/chunk-BEU7CD7E.js +0 -9
- package/dist-cli/chunks/chunk-CE4JQJ6Y.js +0 -6
- package/dist-cli/chunks/chunk-CIE6CZXL.js +0 -142
- package/dist-cli/chunks/chunk-CSJ7L7ZL.js +0 -312
- package/dist-cli/chunks/chunk-CWCQP53A.js +0 -27
- package/dist-cli/chunks/chunk-DCS5FK5N.js +0 -7
- package/dist-cli/chunks/chunk-DEV3E3MV.js +0 -4
- package/dist-cli/chunks/chunk-DGJMIVZM.js +0 -5
- package/dist-cli/chunks/chunk-DGX3MN65.js +0 -5
- package/dist-cli/chunks/chunk-DNPQMTW5.js +0 -4
- package/dist-cli/chunks/chunk-DOVBJBVD.js +0 -5
- package/dist-cli/chunks/chunk-DPBJ3S3J.js +0 -3
- package/dist-cli/chunks/chunk-FVZBGPCU.js +0 -4
- package/dist-cli/chunks/chunk-GDKMOIUT.js +0 -4
- package/dist-cli/chunks/chunk-GIF2NJCS.js +0 -32
- package/dist-cli/chunks/chunk-GZE57ORL.js +0 -4
- package/dist-cli/chunks/chunk-H3U56DKI.js +0 -24
- package/dist-cli/chunks/chunk-HZLOYAPH.js +0 -4
- package/dist-cli/chunks/chunk-J2IKAEU2.js +0 -4
- package/dist-cli/chunks/chunk-JXAXYK7W.js +0 -11
- package/dist-cli/chunks/chunk-KJE2O2GK.js +0 -4
- package/dist-cli/chunks/chunk-KMNVDZZI.js +0 -423
- package/dist-cli/chunks/chunk-LC3QRIRB.js +0 -10
- package/dist-cli/chunks/chunk-LGFTAQYC.js +0 -4
- package/dist-cli/chunks/chunk-LQMUA5IY.js +0 -4
- package/dist-cli/chunks/chunk-MFIQTWC5.js +0 -4
- package/dist-cli/chunks/chunk-MGALNF2F.js +0 -7
- package/dist-cli/chunks/chunk-MLBZZHOY.js +0 -4
- package/dist-cli/chunks/chunk-NNRF7GIB.js +0 -107
- package/dist-cli/chunks/chunk-NORLYTTO.js +0 -7
- package/dist-cli/chunks/chunk-P6KVGV3H.js +0 -14
- package/dist-cli/chunks/chunk-PAJTUK33.js +0 -4
- package/dist-cli/chunks/chunk-QELIC5XP.js +0 -4
- package/dist-cli/chunks/chunk-QRDF33WD.js +0 -11
- package/dist-cli/chunks/chunk-R76BA7C7.js +0 -535
- package/dist-cli/chunks/chunk-RVEB4CZ2.js +0 -4
- package/dist-cli/chunks/chunk-SK4M7NXT.js +0 -5
- package/dist-cli/chunks/chunk-SKMG5DD7.js +0 -5
- package/dist-cli/chunks/chunk-TEESPOYR.js +0 -4
- package/dist-cli/chunks/chunk-TH2UFGVP.js +0 -4
- package/dist-cli/chunks/chunk-TLP3T3VO.js +0 -4
- package/dist-cli/chunks/chunk-TZUABDIJ.js +0 -38
- package/dist-cli/chunks/chunk-UB2W6OQM.js +0 -99
- package/dist-cli/chunks/chunk-UYVXALPB.js +0 -506
- package/dist-cli/chunks/chunk-VQDYFFIG.js +0 -5
- package/dist-cli/chunks/chunk-VWCNJPCJ.js +0 -5
- package/dist-cli/chunks/chunk-VZIK4WIS.js +0 -74
- package/dist-cli/chunks/chunk-W3FNXAQP.js +0 -4
- package/dist-cli/chunks/chunk-XCDNVNP3.js +0 -4
- package/dist-cli/chunks/chunk-XSVILA4Z.js +0 -4
- package/dist-cli/chunks/chunk-XUTJ7ZWD.js +0 -4
- package/dist-cli/chunks/chunk-YTXY3MHW.js +0 -4
- package/dist-cli/chunks/chunk-ZF7PVX44.js +0 -28
- package/dist-cli/chunks/chunk-ZSSG7OR7.js +0 -4
- package/dist-cli/chunks/cleanup-MLOK2OZA.js +0 -25
- package/dist-cli/chunks/cli-version-OBNR366V.js +0 -4
- package/dist-cli/chunks/compat-SHMFSKU7.js +0 -23
- package/dist-cli/chunks/config-TPEAEUJ2.js +0 -13
- package/dist-cli/chunks/connect-3LEXWTE5.js +0 -4
- package/dist-cli/chunks/control-Z3FWA6BO.js +0 -4
- package/dist-cli/chunks/daemon-RSVYSC65.js +0 -4
- package/dist-cli/chunks/debug-GUVAK2KR.js +0 -200
- package/dist-cli/chunks/desktop-OOP2PTKP.js +0 -31
- package/dist-cli/chunks/detox-C2ILVBEC.js +0 -52
- package/dist-cli/chunks/device-NXIQQJWR.js +0 -18
- package/dist-cli/chunks/diagnose-2JBGYE5L.js +0 -43
- package/dist-cli/chunks/disk-cleanup-VURWJYQV.js +0 -4
- package/dist-cli/chunks/do-chain-DJ4UQC7A.js +0 -5
- package/dist-cli/chunks/drivers-JMA2OIKU.js +0 -4
- package/dist-cli/chunks/env-KTNPKEZR.js +0 -4
- package/dist-cli/chunks/film-DCPS7EID.js +0 -74
- package/dist-cli/chunks/flow-4DZ7B2OA.js +0 -4
- package/dist-cli/chunks/help-34CJMQY2.js +0 -4
- package/dist-cli/chunks/hidden-runtime-alias-HHT2C7WE.js +0 -4
- package/dist-cli/chunks/home-paths-KTPGCPMS.js +0 -4
- package/dist-cli/chunks/inspect-JF5WYJRD.js +0 -4
- package/dist-cli/chunks/install-desktop-ZIC4CDXI.js +0 -4
- package/dist-cli/chunks/login-TTJAOI2Q.js +0 -26
- package/dist-cli/chunks/logout-ERAQ6SKW.js +0 -4
- package/dist-cli/chunks/maestro-W46QCF77.js +0 -108
- package/dist-cli/chunks/maestro-generate-VBLM3MTU.js +0 -36
- package/dist-cli/chunks/mode-ZEDZK7R7.js +0 -26
- package/dist-cli/chunks/optional-demo-registry-ZUTPSVYQ.js +0 -4
- package/dist-cli/chunks/perf-YVT2WXT4.js +0 -48
- package/dist-cli/chunks/permissions-L7VVDHFP.js +0 -13
- package/dist-cli/chunks/platform-7TJOU2FB.js +0 -6
- package/dist-cli/chunks/privacy-57UOTB5J.js +0 -4
- package/dist-cli/chunks/record-VXG37P7U.js +0 -72
- package/dist-cli/chunks/report-issue-WNNOBZHC.js +0 -29
- package/dist-cli/chunks/reset-H5NBFE5U.js +0 -4
- package/dist-cli/chunks/resolve-target-57TK5WLE.js +0 -4
- package/dist-cli/chunks/runtime-QU2NIF2K.js +0 -4
- package/dist-cli/chunks/screenshot-command-AN56TTG7.js +0 -159
- package/dist-cli/chunks/screenshot-layers-3W5R7DB2.js +0 -20
- package/dist-cli/chunks/screenshots-capture-6AWJY7XZ.js +0 -42
- package/dist-cli/chunks/serve-GLYO5Q7J.js +0 -56
- package/dist-cli/chunks/setup-UA2HLD7S.js +0 -4
- package/dist-cli/chunks/sim-client-5C2RDQQO.js +0 -4
- package/dist-cli/chunks/skills-EYXWBRNQ.js +0 -50
- package/dist-cli/chunks/state-REJ7W6K3.js +0 -14
- package/dist-cli/chunks/storage-CFMDHI3V.js +0 -37
- package/dist-cli/chunks/store-XMCUA45G.js +0 -4
- package/dist-cli/chunks/telemetry-FBL3NAKB.js +0 -4
- package/dist-cli/chunks/timeline-HMCHN5FO.js +0 -24
- package/dist-cli/chunks/upgrade-2QSPAA3P.js +0 -7
- package/dist-cli/chunks/upload-DUQBKZYV.js +0 -4
- package/dist-cli/chunks/version-IOA6QFGB.js +0 -6
- package/dist-cli/chunks/web-NCGUYVCJ.js +0 -4
- package/dist-cli/chunks/welcome-QYGSQCWQ.js +0 -5
- package/dist-cli/chunks/what-happened-YTOUK4LO.js +0 -25
- package/dist-cli/chunks/ws-bridge-OF4OZARG.js +0 -4
- package/scripts/postinstall.cjs +0 -3
- package/scripts/preuninstall.cjs +0 -118
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (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 b}from"./chunk-DCS5FK5N.js";import{c as h}from"./chunk-TH2UFGVP.js";import{a as P,b as k,c as x,d as v,e as y,h as O,i as A}from"./chunk-BEU7CD7E.js";import{spawn as I,spawnSync as p}from"child_process";import{chmodSync as L,copyFileSync as C,createWriteStream as R,existsSync as g,mkdirSync as S,rmSync as u,statSync as B,unlinkSync as F}from"fs";import{tmpdir as N}from"os";import{dirname as W,join as f,resolve as M}from"path";var D="https://contrast.dev/api/electron-release";function Y(){let n=process.arch;if(process.platform==="darwin"){let t=n==="arm64"?"mac-arm64":"mac-x64",r=`sootsim-latest-${t}.dmg`;return{platform:t,filename:r,url:`${D}/${r}`,install:z}}if(process.platform==="linux"){let t=n==="arm64"?"linux-arm64":"linux-x64",r=`sootsim-latest-${t}.AppImage`;return{platform:t,filename:r,url:`${D}/${r}`,install:H}}if(process.platform==="win32"){let t="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:t,url:`${D}/${t}`,install:K}}return null}async function _({url:n,dest:t,onProgress:r}){let s=await fetch(n,{redirect:"follow"});if(!s.ok)throw new Error(`${s.status} ${s.statusText} (${n})`);let o=s.headers.get("content-length"),a=o?Number(o):null;if(!s.body)throw new Error(`empty response body (${n})`);S(W(t),{recursive:!0});let l=R(t),d=s.body.getReader(),c=0;try{for(;;){let{done:e,value:i}=await d.read();if(e)break;l.write(Buffer.from(i)),c+=i.byteLength,r?.(c,a)}}finally{await new Promise((e,i)=>{l.end(m=>m?i(m):e())})}}function q(n,t){let r=(n/1048576).toFixed(1);if(!t)return` ${r} MB`;let s=Math.min(100,Math.round(n/t*100)),o=(t/(1024*1024)).toFixed(1),a=24,l=Math.round(s/100*a);return` ${P("\u2588".repeat(l))+x("\u2591".repeat(a-l))} ${s}% ${r} / ${o} MB`}async function z(n){let t=p("hdiutil",["attach","-nobrowse","-readonly",n],{encoding:"utf8"});if(t.status!==0)throw new Error(`hdiutil attach failed: ${t.stderr||t.stdout}`.trim());let r=t.stdout.trim().split(`
|
|
5
|
-
`),o=r[r.length-1].split(" ").pop()?.trim();if(!o||!g(o))throw new Error(`could not determine dmg mount point (output: ${t.stdout})`);let a=f(o,"rnx.app");if(!g(a))throw p("hdiutil",["detach","-force",o]),new Error(`rnx.app not found inside ${o}`);let l="/Applications",d=M(process.env.HOME||"","Applications"),c=l;try{let w=f(l,`.sootsim-write-probe-${process.pid}`);p("touch",[w]),g(w)?u(w,{force:!0}):c=d}catch{c=d}c===d&&S(c,{recursive:!0});let e=f(c,"rnx.app"),i=f(c,`.rnx-incoming-${process.pid}.app`);u(i,{recursive:!0,force:!0});let m=p("cp",["-R",a,i]);if(m.status!==0)throw p("hdiutil",["detach","-force",o]),u(i,{recursive:!0,force:!0}),new Error(`copy to ${c} failed: ${m.stderr?.toString()||""}`.trim());let T=p("hdiutil",["detach","-force",o]),$=f(c,`.rnx-previous-${process.pid}.app`);if(g(e)){let w=p("mv",[e,$]);if(w.status!==0)throw u(i,{recursive:!0,force:!0}),new Error(`could not replace ${e}: ${w.stderr?.toString()||""}`.trim())}let E=p("mv",[i,e]);if(E.status!==0)throw g($)&&p("mv",[$,e]),u(i,{recursive:!0,force:!0}),new Error(`could not move into ${e}: ${E.stderr?.toString()||""}`.trim());return u($,{recursive:!0,force:!0}),T.status!==0&&console.warn(` warning: failed to unmount ${o} (${T.stderr?.toString().trim()||"unknown error"})`),p("xattr",["-dr","com.apple.quarantine",e]),e}async function H(n){let t=M(process.env.HOME||"","Applications");S(t,{recursive:!0});let r=f(t,"rnx.AppImage");return g(r)&&u(r,{force:!0}),C(n,r),F(n),L(r,493),r}async function K(n){await new Promise((r,s)=>{let o=I("cmd",["/c","start",'""',"/wait",n],{stdio:"inherit"});o.once("error",s),o.once("exit",a=>{a===0?r():s(new Error(`installer exited with code ${a}`))})});let t=b();if(!t)throw new Error("the installer finished but the rnx application was not registered");return t.path}async function tt(n){(n.includes("--help")||n.includes("-h"))&&(console.log(`
|
|
6
|
-
rnx desktop install
|
|
7
|
-
|
|
8
|
-
Download and install the optional rnx Desktop app.
|
|
9
|
-
The CLI works without it. Choose Desktop when you want a dedicated native window.
|
|
10
|
-
|
|
11
|
-
usage:
|
|
12
|
-
rnx desktop install [options]
|
|
13
|
-
|
|
14
|
-
options:
|
|
15
|
-
-y, --yes skip confirmation and install immediately
|
|
16
|
-
--force reinstall even if the companion is already present
|
|
17
|
-
|
|
18
|
-
examples:
|
|
19
|
-
rnx desktop install
|
|
20
|
-
rnx desktop install --yes
|
|
21
|
-
`),h(0));let t=n.includes("--yes")||n.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,r=n.includes("--force"),s=b();if(s&&!r){console.log(` ${v("\u2713")} Desktop app is already installed at ${s.path}`),console.log(` ${x("Pass --force to reinstall.")}`);return}let o=Y();if(o||(console.error(` ${y("\xD7")} No desktop build is available for ${process.platform}/${process.arch}.`),console.error(" Supported: darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64"),h(1)),console.log(` ${k("Desktop app")}`),console.log(` Platform ${o.platform}`),console.log(` Download ${o.url}`),console.log(),!t){if(!await A("Download and install now?",!0)){console.log(` ${x("Cancelled.")}`);return}console.log()}let a=f(N(),`sootsim-install-${Date.now()}`),l=f(a,o.filename),d=0;process.stdout.write(` Downloading ${o.filename}...
|
|
22
|
-
`);try{await _({url:o.url,dest:l,onProgress:(e,i)=>{let m=Date.now();m-d<100&&e<(i??1/0)||(d=m,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${q(e,i)}`))}})}catch(e){u(a,{recursive:!0,force:!0});let i=e instanceof Error?e.message:String(e);console.error(`
|
|
23
|
-
${y("\xD7")} Download failed: ${i}`),console.error(` The ${o.platform} desktop build may not be published yet, or your`),console.error(" network blocked the request. Check your connection and try again later."),console.error(" The CLI and daemon work without the desktop app. Run `rnx --help`."),h(1)}process.stdout.isTTY&&process.stdout.write(`
|
|
24
|
-
`);let c=B(l).size;console.log(` ${v("\u2713")} Downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log();try{let e=await O("Installing the desktop app",()=>o.install(l));console.log(` Installed at ${e}`),u(a,{recursive:!0,force:!0})}catch(e){console.error(` ${y("\xD7")} Install failed: ${e instanceof Error?e.message:String(e)}`),process.platform==="darwin"?(p("open",[l]),console.error(` Opened ${o.filename} \u2014 drag rnx to Applications to finish.`)):console.error(` Keeping the download at ${l} for manual installation.`),h(1)}console.log(),console.log(` ${k("Ready")}`),console.log(" rnx desktop Launch the desktop app"),console.log(" rnx open <target> Open a demo or bundle in it")}export{tt as a};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (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 r}from"./chunk-AFOVILIL.js";var i=[{title:"Overview",route:"/docs/rnx/cli"},...r.slice().sort((o,t)=>o.order-t.order).map(o=>({title:o.navTitle,route:`/docs/rnx/cli/${o.slug}`}))];
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (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 r}from"./chunk-7LGK5XU6.js";function o(){if(!r())return null;let t=process.env.VITE_POSTHOG_API_KEY||"";if(!t)return null;let e=process.env.CONTRAST_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:t,host:e.replace(/\/+$/,"")}}function i(t,e){return t.trim().slice(0,e)}function s(t){let e=t.kind==="package_incompatibility"?{package_name:i(t.packageName,160),package_version:i(t.packageVersion,80),...t.unsupportedApi?{unsupported_api:i(t.unsupportedApi,160)}:{}}:{error_class:i(t.errorClass,160)};return{event:t.kind,distinct_id:"rnx-cli-diagnostic",properties:e}}var n=[];function a(t){r()&&n.push(t)}function c(t){let e=t instanceof Error?t.constructor.name:typeof t;a({kind:"error_shape",errorClass:e})}async function l(){if(n.length===0)return;let t=o();if(!t){n.length=0;return}let e=n.splice(0,n.length).map(s);try{await fetch(`${t.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:t.apiKey,batch:e}),signal:AbortSignal.timeout(2e3)})}catch{}}export{s as a,a as b,c,l as d};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (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 o}from"./chunk-SKMG5DD7.js";import{c as i}from"./chunk-TH2UFGVP.js";var p=["ghs_","ghp_","gho_","ghu_","github_pat_"];function a(n){return!!(n&&n.length>=20&&p.some(e=>n.startsWith(e)))}function d(){let n=process.env.CONTRAST_INSTALLATION_TOKEN?.trim(),e=process.env.GITHUB_TOKEN?.trim(),t=n||e;if(!a(t))return null;let r=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!r)return null;let[s,u]=r.includes("/")?r.split("/",2):[null,null],l=(process.env.CONTRAST_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),c=(process.env.CONTRAST_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:t,repoId:r,repositoryId:l||null,owner:s||null,repo:u||null,installationId:c||null,source:n?"contrast-runner":"github-actions"}}function I(n){return n.startsWith("sk_rnx_")||n.startsWith("sk_sootsim_")}function g(){for(let n of["RNX_API_KEY","SOOTSIM_API_KEY"]){let e=process.env[n]?.trim();if(e&&I(e))return{secret:e,envName:n}}return null}function _(){let n=g();if(n)return{kind:"api-key",secret:n.secret,source:"env",envName:n.envName};let e=d();if(e)return e;let t=o();return t?.token?{kind:"session",token:t.token,origin:t.origin}:null}function A(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function k(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}function f(n){let e=_();if(e)return{auth:e,header:A(e)};process.stderr.write(`
|
|
5
|
-
rnx ${n} needs to be authenticated.
|
|
6
|
-
|
|
7
|
-
pick one:
|
|
8
|
-
\u2022 run \`rnx login\` to sign in with your GH account
|
|
9
|
-
\u2022 set RNX_API_KEY=sk_rnx_... (recommended for CI)
|
|
10
|
-
|
|
11
|
-
`),i(1)}export{_ as a,A as b,k as c,f as d};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (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 c}from"./chunk-CE4JQJ6Y.js";import{M as u,l}from"./chunk-QRDF33WD.js";import r from"fs";import e from"path";import{fileURLToPath as m}from"url";var s;function p(){if(s!==void 0)return s;let t=e.dirname(m(import.meta.url));for(let n=0;n<12&&t!==e.dirname(t);n++){if(r.existsSync(e.join(t,"packages/sootsim-engine/package.json"))&&r.existsSync(e.join(t,"public/sootsim")))return s=t,t;t=e.dirname(t)}return s=null,null}function d(){if(process.env.SOOTSIM_HOME&&u())return null;let t=p();if(!t)return null;let n=e.join(t,"public/sootsim");return r.existsSync(e.join(n,"index.html"))&&r.existsSync(e.join(n,"engine/index.html"))&&r.existsSync(e.join(n,"engine-tenant/worker.js"))?n:null}function g(){let t=d();if(t)return t;let n=u();if(!n)return null;let o=l(n);return r.existsSync(e.join(o,"index.html"))?o:null}var a=".runtime.localhost";function y(t){let n=t.trim();if(!c(n))throw new Error(`invalid rnx runtime version: ${t}`);let i=Buffer.from(n,"utf8").toString("hex").match(/.{1,60}/g);if(!i)throw new Error(`invalid rnx runtime version: ${t}`);return`${i.join(".")}${a}`}function f(t){return t.toLowerCase().endsWith(a)}function x(t){if(!f(t))return null;let n=t.slice(0,-a.length).split(".");if(n.length===0||n.some(i=>!/^[0-9a-f]{1,60}$/i.test(i)))return null;let o=n.join("");if(o.length%2!==0)return null;try{let i=Buffer.from(o,"hex").toString("utf8");return c(i)?i:null}catch{return null}}function S(t){let n=l(t);return r.existsSync(e.join(n,"index.html"))?n:null}function M(t){if(!f(t))return g();let n=x(t);return n?S(n):null}export{d as a,y as b,f as c,x as d,M as e};
|
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
async function p({bridge:t,simId:a,maxMs:n,pollMs:s=50,stablePolls:o=3,strict:i=!1}){let c=await t.send({type:"evaluate",simId:a,code:`(async () => {
|
|
5
|
-
const start = Date.now()
|
|
6
|
-
const deadline = start + ${Math.max(0,Math.round(n))}
|
|
7
|
-
const pollMs = ${Math.max(1,Math.round(s))}
|
|
8
|
-
const requiredStablePolls = ${Math.max(1,Math.round(o))}
|
|
9
|
-
const strict = ${i?"true":"false"}
|
|
10
|
-
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
11
|
-
|
|
12
|
-
// route-aware settle: a tap that pushes/pops a screen is async \u2014 the
|
|
13
|
-
// old screen still renders for a moment, then the new one mounts and
|
|
14
|
-
// its content loads. a pure layout-hash check reports "idle" on the
|
|
15
|
-
// outgoing screen or on the incoming skeleton, so a driver re-taps
|
|
16
|
-
// and stacks duplicate navigations. drain any in-flight screen
|
|
17
|
-
// transition FIRST, bounded by the overall budget. when no
|
|
18
|
-
// transition is happening this returns in ~80ms (startWindowMs), so
|
|
19
|
-
// a plain button tap barely pays for it.
|
|
20
|
-
try {
|
|
21
|
-
const wfst = window.__sootsimTest?.waitForScreenTransitions
|
|
22
|
-
if (typeof wfst === 'function') {
|
|
23
|
-
const remaining = deadline - Date.now()
|
|
24
|
-
if (remaining > 120) {
|
|
25
|
-
await wfst({
|
|
26
|
-
timeoutMs: Math.min(remaining - 80, 4000),
|
|
27
|
-
settleMs: 64,
|
|
28
|
-
startWindowMs: 80,
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
} catch {}
|
|
33
|
-
|
|
34
|
-
const readSnapshot = async () => {
|
|
35
|
-
let animating = false
|
|
36
|
-
let layoutDirty = false
|
|
37
|
-
let pendingFetches = 0
|
|
38
|
-
let requestTotal = 0
|
|
39
|
-
let requestInFlight = 0
|
|
40
|
-
let renderStatsAvailable = false
|
|
41
|
-
try {
|
|
42
|
-
const stats = await window.__sootsimRenderHost?.queryStats?.()
|
|
43
|
-
if (stats) {
|
|
44
|
-
renderStatsAvailable = true
|
|
45
|
-
animating =
|
|
46
|
-
stats.hasActiveAnims === true ||
|
|
47
|
-
stats.hasActiveNativeAnimations === true ||
|
|
48
|
-
stats.hasPendingAnimationFrames === true
|
|
49
|
-
layoutDirty =
|
|
50
|
-
stats.layoutDirty === true && stats.renderRequested === true
|
|
51
|
-
// a freshly-pushed screen showing a skeleton is layout-stable
|
|
52
|
-
// but not actually settled \u2014 its data/images are still in
|
|
53
|
-
// flight. treat bounded image-loader fetches as not-idle so
|
|
54
|
-
// settle waits for real content, capped by the budget.
|
|
55
|
-
const pf = stats.memory && stats.memory.imageLoader
|
|
56
|
-
? stats.memory.imageLoader.pendingFetches
|
|
57
|
-
: 0
|
|
58
|
-
pendingFetches = typeof pf === 'number' ? pf : 0
|
|
59
|
-
}
|
|
60
|
-
} catch {}
|
|
61
|
-
try {
|
|
62
|
-
const counts = await window.__sootsimTest?.getRequestCounts?.()
|
|
63
|
-
requestTotal = typeof counts?.total === 'number' ? counts.total : 0
|
|
64
|
-
requestInFlight = typeof counts?.inFlight === 'number' ? counts.inFlight : 0
|
|
65
|
-
} catch {}
|
|
66
|
-
const root = window.__sootsimRoot
|
|
67
|
-
const nodes = []
|
|
68
|
-
if (root) {
|
|
69
|
-
const walk = (n) => {
|
|
70
|
-
if (n.layout && n.layout.width > 0) {
|
|
71
|
-
nodes.push(Math.round(n.layout.x) + ',' + Math.round(n.layout.y) + ',' + Math.round(n.layout.width))
|
|
72
|
-
}
|
|
73
|
-
for (const c of n.children || []) walk(c)
|
|
74
|
-
}
|
|
75
|
-
walk(root)
|
|
76
|
-
}
|
|
77
|
-
return { layout: nodes.join(';'), animating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// how long generic background network is allowed to keep us waiting AFTER
|
|
81
|
-
// the screen is otherwise visually settled. apps with continuous traffic
|
|
82
|
-
// (polling, realtime sockets, a tap that fires 20-50 fetches) never reach
|
|
83
|
-
// requestInFlight===0 / a stable requestTotal, so requiring full network
|
|
84
|
-
// quiet burns the ENTIRE budget on every command \u2014 the leading idle that
|
|
85
|
-
// failed PR-preview recordings for network-heavy apps (3pc fight-pulse).
|
|
86
|
-
// layout-stability + the image-loader already prove visible content
|
|
87
|
-
// loaded (a data load changes layout; an image load shows in the loader),
|
|
88
|
-
// so the generic request counters are a courtesy, not a gate: honor them
|
|
89
|
-
// only within this grace once the screen is visually still.
|
|
90
|
-
const networkQuietGraceMs = 1200
|
|
91
|
-
let lastLayout = ''
|
|
92
|
-
let lastRequestTotal = -1
|
|
93
|
-
let stable = 0
|
|
94
|
-
let visuallyStillSince = 0
|
|
95
|
-
while (Date.now() < deadline) {
|
|
96
|
-
const snapshot = await readSnapshot()
|
|
97
|
-
const strictOk =
|
|
98
|
-
!strict ||
|
|
99
|
-
(snapshot.renderStatsAvailable && !snapshot.animating && !snapshot.layoutDirty)
|
|
100
|
-
// visually settled: no animations, no image content loading, layout
|
|
101
|
-
// unchanged since the last poll.
|
|
102
|
-
const visuallyStill =
|
|
103
|
-
strictOk && snapshot.pendingFetches === 0 && snapshot.layout === lastLayout
|
|
104
|
-
// generic network quiet: nothing in flight and no new requests issued.
|
|
105
|
-
const networkQuiet =
|
|
106
|
-
snapshot.requestInFlight === 0 && snapshot.requestTotal === lastRequestTotal
|
|
107
|
-
if (visuallyStill) {
|
|
108
|
-
stable++
|
|
109
|
-
if (visuallyStillSince === 0) visuallyStillSince = Date.now()
|
|
110
|
-
// settle once the screen has held still long enough AND either the
|
|
111
|
-
// network is genuinely quiet OR it has refused to quiet within the
|
|
112
|
-
// grace (continuous background traffic must not block forever).
|
|
113
|
-
if (
|
|
114
|
-
stable >= requiredStablePolls &&
|
|
115
|
-
(networkQuiet || Date.now() - visuallyStillSince >= networkQuietGraceMs)
|
|
116
|
-
) {
|
|
117
|
-
return { settled: true, elapsed: Date.now() - start }
|
|
118
|
-
}
|
|
119
|
-
} else {
|
|
120
|
-
stable = 0
|
|
121
|
-
visuallyStillSince = 0
|
|
122
|
-
}
|
|
123
|
-
lastLayout = snapshot.layout
|
|
124
|
-
lastRequestTotal = snapshot.requestTotal
|
|
125
|
-
await sleep(pollMs)
|
|
126
|
-
}
|
|
127
|
-
return { settled: false, elapsed: Date.now() - start }
|
|
128
|
-
})()`},{timeoutMs:n+1e3}),{elapsed:r,settled:e}=c??{};return{elapsed:typeof r=="number"?r:n,settled:e===!0}}var g=`(() => {
|
|
129
|
-
const spec = window.SootSim?.state?.engineSnapshot?.windowState?.deviceSpec
|
|
130
|
-
return spec && spec.width > 0 && spec.height > 0
|
|
131
|
-
? { width: spec.width, height: spec.height }
|
|
132
|
-
: null
|
|
133
|
-
})()`,m={initialWaitMs:3e3,deadlineMs:5e3,retryWaitMs:700},b={initialWaitMs:1200,deadlineMs:2500,retryWaitMs:700};function T(t,a={}){return{...t?m:b,...a}}function x(t){return!(!t||t.hit===!1||t.ok===!1||t.requestedTargetMatched===!1||t.pointerTapHandled===!1&&!t.keyboardOpened&&!t.isTextInput)}function I(t,a){return{nodeId:t.target?.nodeId??t.match?.nodeId??t.node?.nodeId??null,id:t.target?.id??t.match?.id??t.node?.id??null,testID:t.target?.testID??t.match?.testID??t.node?.testID??null,text:t.target?.text??t.target?.accessibilityLabel??t.match?.text??t.match?.accessibilityLabel??t.node?.text??a??null,type:t.target?.type??t.match?.type??t.node?.type??null}}async function h(t,a){let n=T(!!a.agent,a.timing),s=0,o=null,i=null;try{await p({bridge:t,maxMs:n.initialWaitMs,pollMs:32,stablePolls:2})}catch{}let c=Date.now()+n.deadlineMs,r=null;for(;Date.now()<=c||s===0;){s++;let e=await a.resolve();if(o=e,e?.error==="bridge-not-ready"||e?.ambiguous||e?.nthOutOfRange)return{payload:e,result:null,attempts:s,failure:"special"};if(e&&typeof e.cx=="number"&&typeof e.cy=="number")if(e.offscreen){i={hit:!1,reason:"offscreen",x:e.cx,y:e.cy,screen:e.screen};let d=`${Math.round(e.cx)},${Math.round(e.cy)}`;if(r===d)return{payload:e,result:i,attempts:s,failure:"missed"};r=d}else{r=null;let d=I(e,a.textFallback),l=await t.send({type:"evaluate",code:`(async () => {
|
|
134
|
-
const t = window.__sootsimTest
|
|
135
|
-
if (
|
|
136
|
-
!t ||
|
|
137
|
-
typeof t.inspectAt !== 'function' ||
|
|
138
|
-
typeof t.resolveTapTarget !== 'function'
|
|
139
|
-
) {
|
|
140
|
-
return { error: 'tap-target-inspection-unavailable' }
|
|
141
|
-
}
|
|
142
|
-
const requestedTarget = ${JSON.stringify(d)}
|
|
143
|
-
const inspected = await t.inspectAt(${e.cx}, ${e.cy})
|
|
144
|
-
const resolved =
|
|
145
|
-
inspected && typeof inspected.nodeId === 'number'
|
|
146
|
-
? await t.resolveTapTarget(inspected.nodeId)
|
|
147
|
-
: null
|
|
148
|
-
const node = (resolved && resolved.target) || inspected
|
|
149
|
-
const coordinateTarget = node
|
|
150
|
-
? {
|
|
151
|
-
nodeId: node.nodeId ?? null,
|
|
152
|
-
id: node.id ?? null,
|
|
153
|
-
testID: node.testID ?? null,
|
|
154
|
-
text: node.text ?? node.accessibilityLabel ?? null,
|
|
155
|
-
type: node.type ?? null,
|
|
156
|
-
}
|
|
157
|
-
: null
|
|
158
|
-
const coordinateAncestors = Array.isArray(inspected?.ancestors)
|
|
159
|
-
? inspected.ancestors
|
|
160
|
-
: []
|
|
161
|
-
const ancestorMatchesRequested = coordinateAncestors.some(
|
|
162
|
-
(ancestor) =>
|
|
163
|
-
(typeof requestedTarget.nodeId === 'number' &&
|
|
164
|
-
ancestor?.nodeId === requestedTarget.nodeId) ||
|
|
165
|
-
(requestedTarget.testID &&
|
|
166
|
-
ancestor?.testID === requestedTarget.testID) ||
|
|
167
|
-
(requestedTarget.id && ancestor?.id === requestedTarget.id),
|
|
168
|
-
)
|
|
169
|
-
const requestedTargetMatched =
|
|
170
|
-
coordinateTarget === null
|
|
171
|
-
? false
|
|
172
|
-
: typeof requestedTarget.nodeId === 'number' &&
|
|
173
|
-
typeof coordinateTarget.nodeId === 'number'
|
|
174
|
-
? requestedTarget.nodeId === coordinateTarget.nodeId ||
|
|
175
|
-
ancestorMatchesRequested
|
|
176
|
-
: requestedTarget.testID && coordinateTarget.testID
|
|
177
|
-
? requestedTarget.testID === coordinateTarget.testID
|
|
178
|
-
|| ancestorMatchesRequested
|
|
179
|
-
: requestedTarget.id && coordinateTarget.id
|
|
180
|
-
? requestedTarget.id === coordinateTarget.id
|
|
181
|
-
|| ancestorMatchesRequested
|
|
182
|
-
: ancestorMatchesRequested
|
|
183
|
-
if (!requestedTargetMatched) {
|
|
184
|
-
return {
|
|
185
|
-
requestedTargetMatched,
|
|
186
|
-
requestedTarget,
|
|
187
|
-
coordinateTarget,
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (typeof t.activatePressAt !== 'function') {
|
|
191
|
-
return { error: 'tap-target-activation-unavailable' }
|
|
192
|
-
}
|
|
193
|
-
const activation = await t.activatePressAt(
|
|
194
|
-
${e.cx},
|
|
195
|
-
${e.cy},
|
|
196
|
-
requestedTarget.nodeId,
|
|
197
|
-
)
|
|
198
|
-
if (activation?.ok) {
|
|
199
|
-
window.dispatchEvent(
|
|
200
|
-
new CustomEvent('sootsim:agentAction', {
|
|
201
|
-
detail: {
|
|
202
|
-
type: 'tap',
|
|
203
|
-
x: ${e.cx},
|
|
204
|
-
y: ${e.cy},
|
|
205
|
-
target: requestedTarget,
|
|
206
|
-
},
|
|
207
|
-
}),
|
|
208
|
-
)
|
|
209
|
-
}
|
|
210
|
-
return {
|
|
211
|
-
activation,
|
|
212
|
-
requestedTargetMatched,
|
|
213
|
-
requestedTarget,
|
|
214
|
-
coordinateTarget,
|
|
215
|
-
}
|
|
216
|
-
})()`});if(l?.error)return{payload:e,result:{hit:!1,reason:l.error,requestedTarget:d},attempts:s,failure:"special"};if(l?.requestedTargetMatched===!1)return{payload:e,result:{hit:!1,reason:"target-covered",...l},attempts:s,failure:"missed"};let y=l?.activation?.tap??l?.activation,f=y&&typeof y=="object"?{...y,...l?.activation,...l}:{hit:!!y,...l};if(i=f,x(f))return{payload:e,result:f,attempts:s}}let u=c-Date.now();if(u<=0)break;try{await p({bridge:t,maxMs:Math.min(u,n.retryWaitMs),pollMs:32,stablePolls:2})}catch{await new Promise(d=>setTimeout(d,Math.min(120,u)))}}return{payload:o,result:i,attempts:s,failure:o&&typeof o.cx=="number"?"missed":"not-found"}}async function F(t,a,n,s){return t.send({type:"tap",x:a,y:n,...s?{target:s}:{}})}async function q(t,a,n={}){let s=JSON.stringify(a);return h(t,{agent:n.agent,timing:n.timing,resolve:()=>t.send({type:"evaluate",code:`(async () => {
|
|
217
|
-
const t = window.__sootsimTest
|
|
218
|
-
if (!t) return null
|
|
219
|
-
const n = (await t.findByTestId(${s})) || (await t.findById(${s}))
|
|
220
|
-
if (!n || !n.absolutePosition || !n.layout) return { cx: null }
|
|
221
|
-
const resolved =
|
|
222
|
-
typeof n.nodeId === 'number' && typeof t.resolveTapTarget === 'function'
|
|
223
|
-
? await t.resolveTapTarget(n.nodeId)
|
|
224
|
-
: null
|
|
225
|
-
const target = (resolved && resolved.target) || n
|
|
226
|
-
const cx =
|
|
227
|
-
resolved && typeof resolved.cx === 'number'
|
|
228
|
-
? resolved.cx
|
|
229
|
-
: n.absolutePosition.x + (n.layout.width || 0) / 2
|
|
230
|
-
const cy =
|
|
231
|
-
resolved && typeof resolved.cy === 'number'
|
|
232
|
-
? resolved.cy
|
|
233
|
-
: n.absolutePosition.y + (n.layout.height || 0) / 2
|
|
234
|
-
const scr = ${g}
|
|
235
|
-
const offscreen =
|
|
236
|
-
!!scr && (cx < 0 || cy < 0 || cx > scr.width || cy > scr.height)
|
|
237
|
-
return {
|
|
238
|
-
cx,
|
|
239
|
-
cy,
|
|
240
|
-
...(offscreen ? { offscreen: true, screen: scr } : {}),
|
|
241
|
-
match: {
|
|
242
|
-
nodeId: n.nodeId ?? null,
|
|
243
|
-
id: n.id,
|
|
244
|
-
testID: n.testID,
|
|
245
|
-
text: n.text ?? n.accessibilityLabel ?? null,
|
|
246
|
-
type: n.type,
|
|
247
|
-
},
|
|
248
|
-
target: {
|
|
249
|
-
nodeId: target.nodeId ?? null,
|
|
250
|
-
id: target.id,
|
|
251
|
-
testID: target.testID,
|
|
252
|
-
text:
|
|
253
|
-
target.text ??
|
|
254
|
-
target.accessibilityLabel ??
|
|
255
|
-
n.text ??
|
|
256
|
-
n.accessibilityLabel ??
|
|
257
|
-
null,
|
|
258
|
-
type: target.type,
|
|
259
|
-
},
|
|
260
|
-
strategy: (resolved && resolved.strategy) || 'matched-node',
|
|
261
|
-
}
|
|
262
|
-
})()`})})}async function M(t,a,n={},s={}){let o=JSON.stringify({query:a,exact:!!n.exact,role:n.role??null,within:n.within??null,minX:n.minX??null,maxX:n.maxX??null,minY:n.minY??null,maxY:n.maxY??null,near:n.near??null,nth:n.nth??null,first:!!n.first});return h(t,{agent:s.agent,timing:s.timing,textFallback:a,resolve:()=>t.send({type:"evaluate",code:`(async () => {
|
|
263
|
-
const t = window.__sootsimTest
|
|
264
|
-
if (!t) return { error: 'bridge-not-ready' }
|
|
265
|
-
const F = ${o}
|
|
266
|
-
|
|
267
|
-
const res = await t.queryTextCandidates({
|
|
268
|
-
query: F.query,
|
|
269
|
-
exact: !!F.exact,
|
|
270
|
-
...(F.role ? { role: F.role } : {}),
|
|
271
|
-
})
|
|
272
|
-
|
|
273
|
-
let candidates = res.candidates || []
|
|
274
|
-
|
|
275
|
-
candidates = candidates.filter((c) => {
|
|
276
|
-
const ax = c.info.absolutePosition && c.info.absolutePosition.x
|
|
277
|
-
const ay = c.info.absolutePosition && c.info.absolutePosition.y
|
|
278
|
-
if (F.minX !== null && !(ax >= F.minX)) return false
|
|
279
|
-
if (F.maxX !== null && !(ax <= F.maxX)) return false
|
|
280
|
-
if (F.minY !== null && !(ay >= F.minY)) return false
|
|
281
|
-
if (F.maxY !== null && !(ay <= F.maxY)) return false
|
|
282
|
-
if (F.within && !c.ancestorTestIDs.includes(F.within)) return false
|
|
283
|
-
return true
|
|
284
|
-
})
|
|
285
|
-
|
|
286
|
-
if (F.near) {
|
|
287
|
-
candidates.sort((a, b) => {
|
|
288
|
-
const ax = (a.info.absolutePosition && a.info.absolutePosition.x) || 0
|
|
289
|
-
const ay = (a.info.absolutePosition && a.info.absolutePosition.y) || 0
|
|
290
|
-
const bx = (b.info.absolutePosition && b.info.absolutePosition.x) || 0
|
|
291
|
-
const by = (b.info.absolutePosition && b.info.absolutePosition.y) || 0
|
|
292
|
-
return (
|
|
293
|
-
Math.hypot(ax - F.near.x, ay - F.near.y) -
|
|
294
|
-
Math.hypot(bx - F.near.x, by - F.near.y)
|
|
295
|
-
)
|
|
296
|
-
})
|
|
297
|
-
} else {
|
|
298
|
-
candidates.sort((a, b) => {
|
|
299
|
-
const ay = (a.info.absolutePosition && a.info.absolutePosition.y) || 0
|
|
300
|
-
const by = (b.info.absolutePosition && b.info.absolutePosition.y) || 0
|
|
301
|
-
if (Math.abs(ay - by) > 2) return ay - by
|
|
302
|
-
const ax = (a.info.absolutePosition && a.info.absolutePosition.x) || 0
|
|
303
|
-
const bx = (b.info.absolutePosition && b.info.absolutePosition.x) || 0
|
|
304
|
-
return ax - bx
|
|
305
|
-
})
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
const total = candidates.length
|
|
309
|
-
if (total === 0) return { matched: 0, total: 0 }
|
|
310
|
-
|
|
311
|
-
let idx = 0
|
|
312
|
-
if (F.nth !== null) {
|
|
313
|
-
idx = F.nth < 0 ? total + F.nth : F.nth
|
|
314
|
-
if (idx < 0 || idx >= total) {
|
|
315
|
-
return { matched: 0, total, nthOutOfRange: true, nth: F.nth }
|
|
316
|
-
}
|
|
317
|
-
} else if (total > 1 && !F.first && !F.near) {
|
|
318
|
-
return {
|
|
319
|
-
ambiguous: true,
|
|
320
|
-
total,
|
|
321
|
-
candidates: candidates.slice(0, 10).map((c, i) => ({
|
|
322
|
-
idx: i,
|
|
323
|
-
nodeId: c.info.nodeId,
|
|
324
|
-
type: c.info.type,
|
|
325
|
-
testID: c.info.testID,
|
|
326
|
-
text: (c.info.text || '').slice(0, 60),
|
|
327
|
-
abs: c.info.absolutePosition,
|
|
328
|
-
layout: c.info.layout
|
|
329
|
-
? {
|
|
330
|
-
width: Math.round(c.info.layout.width || 0),
|
|
331
|
-
height: Math.round(c.info.layout.height || 0),
|
|
332
|
-
}
|
|
333
|
-
: null,
|
|
334
|
-
ancestorTestIDs: (c.ancestorTestIDs || []).slice(0, 5),
|
|
335
|
-
})),
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
const picked = candidates[idx]
|
|
340
|
-
const n = picked.info
|
|
341
|
-
if (!n.absolutePosition || !n.layout) return { matched: 0, total }
|
|
342
|
-
|
|
343
|
-
const resolved =
|
|
344
|
-
typeof n.nodeId === 'number' &&
|
|
345
|
-
typeof t.resolveTapTarget === 'function'
|
|
346
|
-
? await t.resolveTapTarget(n.nodeId)
|
|
347
|
-
: null
|
|
348
|
-
const target = (resolved && resolved.target) || n
|
|
349
|
-
const cx =
|
|
350
|
-
resolved && typeof resolved.cx === 'number'
|
|
351
|
-
? resolved.cx
|
|
352
|
-
: n.absolutePosition.x + (n.layout.width || 0) / 2
|
|
353
|
-
const cy =
|
|
354
|
-
resolved && typeof resolved.cy === 'number'
|
|
355
|
-
? resolved.cy
|
|
356
|
-
: n.absolutePosition.y + (n.layout.height || 0) / 2
|
|
357
|
-
const scr = ${g}
|
|
358
|
-
const offscreen =
|
|
359
|
-
!!scr && (cx < 0 || cy < 0 || cx > scr.width || cy > scr.height)
|
|
360
|
-
return {
|
|
361
|
-
cx,
|
|
362
|
-
cy,
|
|
363
|
-
...(offscreen ? { offscreen: true, screen: scr } : {}),
|
|
364
|
-
match: {
|
|
365
|
-
nodeId: n.nodeId ?? null,
|
|
366
|
-
id: n.id,
|
|
367
|
-
testID: n.testID,
|
|
368
|
-
type: n.type,
|
|
369
|
-
},
|
|
370
|
-
target: {
|
|
371
|
-
nodeId: target.nodeId ?? null,
|
|
372
|
-
id: target.id,
|
|
373
|
-
testID: target.testID,
|
|
374
|
-
text:
|
|
375
|
-
target.text ??
|
|
376
|
-
target.accessibilityLabel ??
|
|
377
|
-
n.text ??
|
|
378
|
-
n.accessibilityLabel ??
|
|
379
|
-
null,
|
|
380
|
-
type: target.type,
|
|
381
|
-
},
|
|
382
|
-
strategy: (resolved && resolved.strategy) || 'matched-node',
|
|
383
|
-
total,
|
|
384
|
-
idx,
|
|
385
|
-
}
|
|
386
|
-
})()`})})}async function P(t,a,n={}){let s=JSON.stringify(a);return h(t,{agent:n.agent,timing:n.timing,textFallback:a,resolve:async()=>{let o=await t.send({type:"evaluate",code:`(async () => {
|
|
387
|
-
const t = window.__sootsimTest
|
|
388
|
-
if (!t) return { error: 'bridge-not-ready' }
|
|
389
|
-
const byTestId =
|
|
390
|
-
(await t.findByTestId(${s})) || (await t.findById(${s}))
|
|
391
|
-
if (byTestId && byTestId.absolutePosition && byTestId.layout) {
|
|
392
|
-
return {
|
|
393
|
-
strategy: 'testid',
|
|
394
|
-
node: {
|
|
395
|
-
nodeId: byTestId.nodeId ?? null,
|
|
396
|
-
id: byTestId.id,
|
|
397
|
-
testID: byTestId.testID,
|
|
398
|
-
type: byTestId.type,
|
|
399
|
-
text: byTestId.text,
|
|
400
|
-
absolutePosition: byTestId.absolutePosition,
|
|
401
|
-
layout: byTestId.layout,
|
|
402
|
-
},
|
|
403
|
-
screen: ${g},
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
const byText = await t.findByText(${s})
|
|
407
|
-
if (byText && byText.absolutePosition && byText.layout) {
|
|
408
|
-
return {
|
|
409
|
-
strategy: 'text',
|
|
410
|
-
node: {
|
|
411
|
-
nodeId: byText.nodeId ?? null,
|
|
412
|
-
id: byText.id,
|
|
413
|
-
testID: byText.testID,
|
|
414
|
-
type: byText.type,
|
|
415
|
-
text: byText.text,
|
|
416
|
-
absolutePosition: byText.absolutePosition,
|
|
417
|
-
layout: byText.layout,
|
|
418
|
-
},
|
|
419
|
-
screen: ${g},
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
return { strategy: 'none' }
|
|
423
|
-
})()`});if(!o||!("node"in o))return o;let i=o.node,c=i.absolutePosition.x+i.layout.width/2,r=i.absolutePosition.y+i.layout.height/2,e=o.screen??null,u=!!e&&(c<0||r<0||c>e.width||r>e.height);return{...o,cx:c,cy:r,...u?{offscreen:!0,screen:e}:{},target:{id:i.id,testID:i.testID,text:o.strategy==="text"?a:i.text,type:i.type}}}})}export{p as a,x as b,h as c,F as d,q as e,M as f,P as g};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as d}from"./chunk-MLBZZHOY.js";import{a as s}from"./chunk-VQDYFFIG.js";import{a as f,c}from"./chunk-TEESPOYR.js";import{a as e}from"./chunk-DOVBJBVD.js";import{a as n}from"./chunk-CWCQP53A.js";import{d as m,e as p,f as u}from"./chunk-AFOVILIL.js";import{a}from"./chunk-XSVILA4Z.js";import{a as i}from"./chunk-5YZYDEMI.js";function g(){return`${i.commandName} CLI v${a()} \xB7 ${d().primary}`}function E(){let r=p({bridgePort:7668,defaultShellUrl:n},e()),o=`
|
|
5
|
-
${c}
|
|
6
|
-
`;console.log(`${g()}
|
|
7
|
-
${o}${r}
|
|
8
|
-
`),s("clean-uninstall")}function L(r){let o=m(r,{bridgePort:7668,defaultShellUrl:n},e());return o?(console.log(`${o}
|
|
9
|
-
`),!0):!1}function U(r,o={}){let l=u(r,{bridgePort:7668,defaultShellUrl:n},o);if(!l){console.log(`unknown command: ${r}`);return}console.log(`${l}
|
|
10
|
-
`)}export{E as a,L as b,U as c};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{execFileSync as y}from"node:child_process";import a from"node:fs";import l from"node:path";var d=class extends Error{},g=8192,v=1e4;function P(n,t){if(t===0)return!1;let r;try{r=a.openSync(n,"r");let e=Buffer.alloc(Math.min(g,t)),s=a.readSync(r,e,0,e.length,0);return e.subarray(0,s).includes(0)}catch{return!1}finally{r!==void 0&&a.closeSync(r)}}var f=class{root;entries=new Map;sniffed=new Map;listTimeoutMs;constructor(t,r={}){this.root=l.resolve(t),this.listTimeoutMs=r.listTimeoutMs??v}index(){return this.entries}async refresh(){let t;try{t=y("git",["ls-files","-co","--exclude-standard","-z"],{cwd:this.root,encoding:"utf8",maxBuffer:64*1024*1024,timeout:this.listTimeoutMs,env:process.env})}catch(s){let i=s instanceof Error?s.message:String(s),o=s instanceof Error&&"signal"in s&&s.signal==="SIGTERM";throw new d(o?`git did not list the project's files in ${this.root} within ${this.listTimeoutMs/1e3}s, so the box has no file set to serve. the checkout may be on a stalled filesystem, or this machine may be too loaded to start a subprocess.`:`could not list the project's files with git in ${this.root}: ${i}`)}if(t.length===0)throw new d(`git listed no files in ${this.root}. either git tracks nothing there and nothing untracked is visible to it, or this machine could not read the child process's output.`);let r=new Map,e=new Map;for(let s of t.split("\0")){if(!s)continue;let i;try{i=a.statSync(l.join(this.root,s))}catch{continue}if(!i.isFile())continue;let o=this.sniffed.get(s),c=o&&o.size===i.size&&o.mtimeMs===i.mtimeMs?o.binary:P(l.join(this.root,s),i.size);e.set(s,{size:i.size,mtimeMs:i.mtimeMs,binary:c}),r.set(s,{size:i.size,readOnly:!1,binary:c})}this.entries=r,this.sniffed=e}absolute(t){let r=l.resolve(this.root,t);if(r!==this.root&&!r.startsWith(`${this.root}${l.sep}`))throw new Error(`path escapes the project: ${t}`);return r}async read(t){return a.promises.readFile(this.absolute(t),"utf8")}async readBytes(t){return a.promises.readFile(this.absolute(t))}async write(t,r){let e=this.absolute(t);await a.promises.mkdir(l.dirname(e),{recursive:!0}),await a.promises.writeFile(e,r),this.entries.set(t,{size:r.byteLength,readOnly:!1,binary:r.subarray(0,g).includes(0)})}async delete(t){await a.promises.rm(this.absolute(t),{force:!0}),this.entries.delete(t)}};function u(n){let t="";for(let e=0;e<n.length;e+=32768)t+=String.fromCharCode(...n.subarray(e,e+32768));return btoa(t)}function h(n){let t=atob(n),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function p(n){let t=2166136261,r=16777619;for(let e of[...n.keys()].sort()){let s=n.get(e);if(!s)continue;let i=`${e} ${s.size} ${s.readOnly?1:0}${s.binary?1:0}`;for(let o=0;o<i.length;o++){let c=i.charCodeAt(o);t=Math.imul(t^c,16777619),r=Math.imul(r+c,2246822507)^r>>>13}}return`${(t>>>0).toString(36)}${(r>>>0).toString(36)}-${n.size}`}function m(n){let t=[];for(let[r,e]of n)t.push([r,e.size,(e.readOnly?1:0)|(e.binary?2:0)]);return t}async function w(n,t,r){switch(t){case"plane:index":{await n.refresh();let e=p(n.index());return r.sinceVersion&&r.sinceVersion===e?{result:{version:e,unchanged:!0},version:e}:{result:{version:e,entries:m(n.index())},version:e}}case"plane:read":return{result:{content:await n.read(String(r.path))}};case"plane:read-bytes":return{result:{base64:u(await n.readBytes(String(r.path)))}};case"plane:write":{await n.write(String(r.path),h(String(r.base64??"")));let e=p(n.index());return{result:{version:e},version:e}}case"plane:delete":{await n.delete(String(r.path));let e=p(n.index());return{result:{version:e},version:e}}default:return null}}export{p as a,w as b,d as c,f as d};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
var m={"--help":{type:"boolean",short:"-h"},"--version":{type:"boolean",short:"-V"},"--verbose":{type:"boolean",short:"-v"},"--port":{type:"number",short:"-p"},"--device":{type:"string",short:"-d"},"--theme":{type:"string",short:"-t"},"--headless":{type:"boolean"},"--driver":{type:"string"},"--sim":{type:"string"},"--session":{type:"string"},"--tab":{type:"string"}},p=new Set(["list","describe","find","get","do","wait","network","logs","shell"]),d=new Set(["do","get","wait","shell","debug"]),b=new Set(["detox","maestro","record","film","storage","permissions","perf","screenshot","state","reset","camera","mode","debug","timeline","what-happened","shell","assert","device","open","ios","android","box","list","use","claim","close","compat","report-issue","desktop","login","logout","auth","setup","serve","daemon","runtime","upgrade","version","skill","config","cleanup","app-fonts","agent-wrapper","agent",...p]);function u(c){let n=c.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<n.length;){let o=n[s];if(o==="--"){e.commandArgs.push(...n.slice(s+1));break}let i=Object.entries(m).find(([a,r])=>a===o||r.short===o);if(i){let[a,r]=i,l=a.replace(/^--/,"");if(r.type==="boolean")e.globalFlags[l]=!0,s++;else{let t=n[s+1];if(t===void 0||t.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(r.type==="number"){let g=Number(t);if(Number.isNaN(g)){console.error(` warning: ${o} requires a number, got "${t}"`),s+=2;continue}e.globalFlags[l]=g}else e.globalFlags[l]=t;s+=2}continue}if(!e.command&&!o.startsWith("-")){let a=o.indexOf("-");if(a>0){let r=o.slice(0,a),l=o.slice(a+1);if(d.has(r)&&l.length>0){e.command=r;let t=n.slice(s+1);e.commandArgs=[l,...t[0]==="--"?t.slice(1):t];break}}if(b.has(o)){e.command=o;let r=n.slice(s+1);e.commandArgs=r[0]==="--"?r.slice(1):r;break}e.commandArgs=n.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{p as a,u as b};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (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,b as h,e as f,f as W,g as B}from"./chunk-KMNVDZZI.js";import{b as l}from"./chunk-YTXY3MHW.js";import{b as P}from"./chunk-QELIC5XP.js";import{E as y,G as D,d as T,e as u,h as v,k as I,l as R,o as O,p as $,r as M,s as A,x as N,z as _}from"./chunk-CSJ7L7ZL.js";var o=class extends Error{constructor(e){super(e),this.name=new.target.name}},m=class extends o{},w=class extends o{status;constructor(e){super(`sim not ready: ${O(e)}`),this.status=e}},d=class extends o{outcome;constructor(e,t=null){super(e),this.outcome=t}},b=class extends o{},g=class extends o{result;constructor(e){let t=e.steps.find(n=>!n.ok),s=t?`${t.index} (${t.type})`:String(e.completed),r=t?.error??e.error;super(`perform failed at step ${s}${r?`: ${r}`:""}`),this.result=e}},x=class extends o{result;constructor(e){super(`reset (${e.strategy}) failed${e.error?`: ${e.error}`:""}`),this.result=e}};function U(i){return new Promise(e=>setTimeout(e,i))}function C(i){if(typeof i!="string"||!i.startsWith("data:image/png;base64,"))throw new o(`screenshot bridge returned a non-png payload: ${JSON.stringify(typeof i=="string"?i.slice(0,80):i)}`);let e=i.slice(22),t=atob(e),s=new Uint8Array(t.length);for(let r=0;r<t.length;r++)s[r]=t.charCodeAt(r);return{dataUrl:i,bytes:s}}var J=["bundle","demo","app","open","port","inspectOpen","appFonts","appSplash"];function K(i,e){let t=new URL(i);for(let a of J)t.searchParams.delete(a);let s=t.pathname.replace(/\/+$/,"")||"/",r=s==="/__soot"||s.startsWith("/__soot/")?"/__soot":"",n=String(e).trim();return/^\d+$/.test(n)?t.pathname=`${r}/rn/${n}`:(t.pathname=`${r}/rn`,t.searchParams.set("open",n)),t.toString()}function j(i){return typeof i=="object"&&"text"in i&&typeof i.text=="string"&&!("layout"in i)&&!("absolutePosition"in i)}var k=class{simId;bridge;closed=!1;constructor(e,t,s={}){this.bridge=e,this.simId=t}send(e,t){if(this.closed)return Promise.reject(new m("sim client is closed"));let s=e.simId===void 0?{...e,simId:this.simId}:e;return this.bridge.send(s,t)}listSims(){return this.bridge.listSims()}focusSim(e=this.simId){return this.bridge.focusSim(e)}closeSim(e=this.simId){return this.bridge.closeSim(e)}claim(e=this.simId,t){return this.bridge.claim(e,t)}close(){this.closed||(this.closed=!0,this.bridge.close())}async open(e,t={}){let r=(await this.listSims()).find(c=>c.id===this.simId);if(!r)throw new m(`sim ${this.simId} is no longer connected`);let n=r.url??r.origin;if(!n)throw new m(`sim ${this.simId} reported no URL to derive the shell from`);let a=K(n,e),p=new URL(a);await this.send({type:"evaluate",code:`window.location.href = ${JSON.stringify(a)}`});let L=Date.now()+(t.timeoutMs??3e4);for(;Date.now()<L;){await U(250);try{let{url:c}=await u(this),S=new URL(c);if(S.pathname===p.pathname&&S.searchParams.get("open")===p.searchParams.get("open"))return}catch{}}throw new m(`timed out waiting for sim ${this.simId} to load ${a}`)}openUrl(e){return P(this,e)}async waitReady(e={}){let t=await $(this,e.timeoutMs??2e4,{onProgress:e.onProgress});if(!t.ready)throw new w(t);return t}settle(e={}){return F({bridge:this,maxMs:e.maxMs??3e3,strict:e.strict})}async find(e){return(await this.findAll(e))[0]??null}async findAll(e){let t={testId:e.testId??null,role:e.role??null,type:e.type??null,text:e.text??null,pressable:e.pressable},s=await R(this,t);if(!s)throw new o("find() needs at least one of testId, text, role, type, or pressable");let{result:r}=s;return Array.isArray(r)?r:r?[r]:[]}async tree(e=5){let{tree:t}=await T(this,e);return Array.isArray(t)?t:[]}resolve(e){return this.send({type:"resolve",selector:e})}describe(e={}){return v(this,{describe:!0,verbose:e.verbose??!1,filter:e.filter??"",compact:!e.verbose,hideXy:!1,fullText:!0})}accessibilityTree(){return I(this)}async logs(e={}){return _(await N(this),e)}errors(e=20){return M(this,e)}warnings(e=20){return A(this,e)}keyboard(){return y(this)}shellState(e=0){return D(this,e)}async url(){let{url:e}=await u(this);return e}async screenshot(e={}){let t=await this.send({type:"screenshot",...e.layers?{layers:e.layers}:{},...e.crop?{crop:e.crop}:{}});return C(t)}async tap(e){if(typeof e=="string")return this.throwUnlessTapped(await B(this,e),e);if("testId"in e&&typeof e.testId=="string")return this.throwUnlessTapped(await f(this,e.testId),e.testId);if(j(e)){let{text:r,...n}=e;return this.throwUnlessTapped(await W(this,r,n),r)}if("testID"in e&&typeof e.testID=="string")return this.throwUnlessTapped(await f(this,e.testID),e.testID);let t=this.coordsForTapTarget(e),s=await this.send({type:"tap",x:t.x,y:t.y});if(!h(s))throw new d(`tap at ${t.x},${t.y} missed: ${JSON.stringify(s)}`)}async longPress(e,t={}){let s=await this.resolveCoords(e);if(!(await this.send({type:"longPress",x:s.x,y:s.y,durationMs:t.durationMs??600},{timeoutMs:(t.durationMs??600)+15e3}))?.ok)throw new d(`longPress at ${s.x},${s.y} missed`)}async type(e){await this.requireVisibleKeyboard("type"),await this.send({type:"keyboard",action:"type",text:e})}async press(e){await this.requireVisibleKeyboard("press"),await this.send({type:"keyboard",action:"press",text:e})}async dismissKeyboard(){await this.send({type:"keyboard",action:"dismiss"})}async perform(e,t){let s=[];for(let a of e){if(a.type!=="tapText"){s.push(a);continue}let p=await l(this,{mode:"text",value:a.text});if(!p)throw new d(`perform tapText: no node with text ${JSON.stringify(a.text)}`);s.push({type:"tap",x:p.x,y:p.y,target:{testID:p.testID??void 0,text:p.text??void 0,type:p.type??void 0}})}let r=t?.timeoutMs??3e4,n=await this.send({type:"perform",steps:s,...t?{performOptions:t}:{}},{timeoutMs:r+5e3});if(!n?.ok)throw new g(n);return n}state(e){return this.send({type:"state",...e?{stateOptions:e}:{}})}async reset(e){let t=await this.send({type:"reset",...e?{resetOptions:e}:{}},{timeoutMs:6e4});if(!t?.ok)throw new x(t);return t}throwUnlessTapped(e,t){if(!e.failure&&h(e.result))return;let s=e.failure==="not-found"?"no matching node":e.failure==="missed"?e.result?.reason??"press missed":e.payload?.ambiguous?`ambiguous: ${e.payload.total} matches`:e.result?.reason??e.payload?.error??"tap failed";throw new d(`tap ${JSON.stringify(t)} failed: ${s}`,e)}coordsForTapTarget(e){if(typeof e=="object"&&"x"in e&&"y"in e&&typeof e.x=="number"&&typeof e.y=="number")return{x:e.x,y:e.y};if(typeof e=="object"&&"absolutePosition"in e&&e.absolutePosition&&e.layout)return{x:e.absolutePosition.x+(e.layout.width??0)/2,y:e.absolutePosition.y+(e.layout.height??0)/2};throw new o("tap target needs coordinates, a testId, text, or a node from find()")}async resolveCoords(e){if(typeof e=="string"){let t=await l(this,{mode:"testid",value:e})??await l(this,{mode:"text",value:e});if(!t)throw new d(`no node matching ${JSON.stringify(e)}`);return t}if("testId"in e&&typeof e.testId=="string"){let t=await l(this,{mode:"testid",value:e.testId});if(!t)throw new d(`no node with testID ${JSON.stringify(e.testId)}`);return t}if("text"in e&&typeof e.text=="string"&&!("layout"in e)){let t=await l(this,{mode:"text",value:e.text});if(!t)throw new d(`no node with text ${JSON.stringify(e.text)}`);return t}return this.coordsForTapTarget(e)}async requireVisibleKeyboard(e){let t=Date.now()+1500;for(;;){let s=await y(this);if(!("error"in s)&&s.visible)return;if(Date.now()>=t)throw new b(`${e} requires the iOS keyboard to be visible \u2014 focus an input first (tap a TextInput)`);await U(150)}}};export{o as a,m as b,w as c,d,b as e,g as f,x as g,K as h,k as i};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (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 w}from"./chunk-7R2TK2NY.js";import{f as g}from"./chunk-CE4JQJ6Y.js";import{L as B,T as b,g as S}from"./chunk-QRDF33WD.js";import a from"node:fs";import c from"node:path";var f=1,E=`automatic-cleanup-v${f}.json`,x=`automatic-cleanup-v${f}.lock`,P=360*60*1e3,A=`automatic-cleanup-v${f}.deferred.json`,T=1800*1e3;function v(){let s=c.join(S(),E);try{return JSON.parse(a.readFileSync(s,"utf8")).generation===f}catch{return!1}}function J(s=Date.now()){if(v())return!0;let e=c.join(S(),A);try{let n=JSON.parse(a.readFileSync(e,"utf8"));if(n.generation!==f||typeof n.attemptedAt!="number")return!1;let r=s-n.attemptedAt;return r>=0&&r<T}catch{return!1}}function K(s){if(s<1024)return`${s} B`;let e=["KiB","MiB","GiB","TiB"],n=s/1024,r=e[0];for(let i=1;i<e.length&&n>=1024;i++)n/=1024,r=e[i];return`${n.toFixed(n>=10?1:2)} ${r}`}function p(s){let e;try{e=a.lstatSync(s)}catch{return 0}let n=e.blocks>0?e.blocks*512:e.size;if(!e.isDirectory()||e.isSymbolicLink())return n;let r=n;try{for(let i of a.readdirSync(s))r+=p(c.join(s,i))}catch{}return r}function k(s){for(let e of["SingletonLock","SingletonSocket","lockfile"])try{if(a.lstatSync(c.join(s,e)))return!0}catch{}return!1}function C(s,e){let n;try{n=a.readdirSync(s,{withFileTypes:!0})}catch{return[]}let r=k(e),i=[];for(let t of n){if(!t.isDirectory()||t.isSymbolicLink())continue;let o=c.join(s,t.name);if(w(t.name)){i.push({path:o,bytes:p(o),kind:"browser-cache",state:r?"in-use":"safe",selected:!r,detail:r?"browser profile is open; close it before cleanup":"disposable browser HTTP, bytecode, or GPU cache"});continue}i.push(...C(o,e))}return i}function R(s){let e=c.join(s,"profiles","playwright"),n;try{n=a.readdirSync(e,{withFileTypes:!0})}catch{return[]}return n.flatMap(r=>{if(!r.isDirectory()||r.isSymbolicLink())return[];let i=c.join(e,r.name);return C(i,i)})}function D(s){let e=c.join(s,"electron","userData");return C(e,e)}function U(s,e){let n=c.join(s,"recordings"),r;try{r=a.readdirSync(n,{withFileTypes:!0})}catch{return[]}return r.map(i=>{let t=c.join(n,i.name);return{path:t,bytes:p(t),kind:"recording",state:"aggressive",selected:e,detail:"user-created recording or captured-frame output"}})}function L(s,e){let n=c.join(s,"camera-fixtures"),r;try{r=a.readdirSync(n,{withFileTypes:!0})}catch{return[]}return r.map(i=>{let t=c.join(n,i.name);return{path:t,bytes:p(t),kind:"camera-fixture",state:"aggressive",selected:e,detail:"staged camera fixture video"}})}function F(s){let e=new Set(b()),n=[...e],r=g.planLocalRetention({retainVersions:2,protectVersions:n}),i=g.planLocalRetention({retainVersions:1,protectVersions:n}),t=new Set(r.removeVersions),o=new Set(i.removeVersions),m=new Set([...r.keepVersions,...r.removeVersions,...i.keepVersions,...i.removeVersions]),u=[];for(let l of[...m].sort()){let y=g.product.runtimeDir(l),d="retained",h="retained runtime";e.has(l)&&l!==r.activeVersion?(d="in-use",h="runtime is serving a connected simulator"):t.has(l)?(d="safe",h="inactive runtime outside the two-version rollback window"):o.has(l)?(d="aggressive",h="most recent rollback runtime"):l===r.activeVersion&&(h="active runtime; always protected"),u.push({path:y,bytes:p(y),kind:"runtime-version",state:d,selected:d==="safe"||d==="aggressive"&&s,detail:h})}for(let l of r.removeCacheFiles)u.push({path:l,bytes:p(l),kind:"runtime-archive",state:"safe",selected:!0,detail:"downloaded archive is unnecessary after successful extraction"});return{activeRuntime:r.activeVersion,entries:u}}function I(s={}){let e=s.aggressive===!0,n=S(),r=F(e),i=[...r.entries,...R(n),...D(n),...U(n,e),...L(n,e)].sort((t,o)=>o.bytes-t.bytes||t.path.localeCompare(o.path));return{home:n,activeRuntime:r.activeRuntime,entries:i,reclaimableBytes:i.reduce((t,o)=>t+(o.selected?o.bytes:0),0),protectedBytes:i.reduce((t,o)=>t+(o.selected?0:o.bytes),0),totalBytes:p(n)}}function j(s,e){let n=c.relative(s,e);if(!n||n.startsWith("..")||c.isAbsolute(n))throw new Error(`refusing cleanup target outside the rnx data home: ${e}`)}function O(s={}){let e=I(s),n=s.aggressive===!0?1:2;g.pruneLocalRetention({retainVersions:n,protectVersions:b()});for(let t of e.entries)if(t.selected&&!(t.kind==="runtime-archive"||t.kind==="runtime-version")){if(t.kind==="browser-cache"){let m=c.relative(e.home,t.path).split(c.sep),u=m[0]==="profiles"&&m[1]==="playwright"&&m[2]?c.join(e.home,"profiles","playwright",m[2]):m[0]==="electron"&&m[1]==="userData"?c.join(e.home,"electron","userData"):null;if(u&&k(u)){t.state="in-use",t.selected=!1,t.detail="browser profile opened while cleanup was starting";continue}}j(e.home,t.path),a.rmSync(t.path,{recursive:!0,force:!0})}let r=e.entries.filter(t=>t.selected&&!a.existsSync(t.path)).map(t=>t.path),i=p(e.home);return{...e,removedPaths:r,reclaimedBytes:Math.max(0,e.totalBytes-i),remainingBytes:i}}function H(){B();let s=S(),e=c.join(s,E),n=c.join(s,A),r=c.join(s,x);if(v())return{status:"already-complete",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};let i=null;for(let t=0;t<2&&i===null;t++)try{let o=a.openSync(r,"wx");try{a.writeFileSync(o,`${JSON.stringify({pid:process.pid,startedAt:Date.now()})}
|
|
5
|
-
`,"utf8"),i=o}catch(m){a.closeSync(o);try{a.unlinkSync(r)}catch{}throw m}}catch(o){if((o instanceof Error&&"code"in o?o.code:null)!=="EEXIST")throw o;let u=0,l=0,y=null;try{y=a.lstatSync(r);let d=JSON.parse(a.readFileSync(r,"utf8"));u=typeof d.pid=="number"?d.pid:0,l=typeof d.startedAt=="number"?d.startedAt:0}catch{}if(u>0&&l>0&&Date.now()-l<P)try{return process.kill(u,0),{status:"busy",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0}}catch{}if(!y)continue;try{let d=a.lstatSync(r);if(d.dev!==y.dev||d.ino!==y.ino)return{status:"busy",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};a.unlinkSync(r)}catch{}}if(i===null)return{status:"busy",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};try{if(v())return{status:"already-complete",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};let t=O(),o=t.entries.reduce((u,l)=>u+(l.state==="in-use"?l.bytes:0),0);if(o>0){let u=`${n}.${process.pid}.tmp`;return a.writeFileSync(u,`${JSON.stringify({generation:f,attemptedAt:Date.now(),deferredInUseBytes:o})}
|
|
6
|
-
`,"utf8"),a.renameSync(u,n),{status:"deferred",reclaimedBytes:t.reclaimedBytes,remainingBytes:t.remainingBytes,deferredInUseBytes:o}}let m=`${e}.${process.pid}.tmp`;return a.writeFileSync(m,`${JSON.stringify({generation:f,completedAt:Date.now(),reclaimedBytes:t.reclaimedBytes})}
|
|
7
|
-
`,"utf8"),a.renameSync(m,e),a.rmSync(n,{force:!0}),{status:"complete",reclaimedBytes:t.reclaimedBytes,remainingBytes:t.remainingBytes,deferredInUseBytes:0}}finally{a.closeSync(i);try{a.unlinkSync(r)}catch{}}}export{v as a,J as b,K as c,I as d,O as e,H as f};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.376 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{n}from"./chunk-CWCQP53A.js";import{M as t,j as r}from"./chunk-QRDF33WD.js";function l(){let e=t(),i=r()?n():null;return i?.source==="dev-bridge"?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{l as a};
|