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,312 +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
|
-
function X(t,e){let n=["--max-ms","--maxMs","--maxms","--max_ms"];for(let r of n){let s=t.indexOf(r);if(s>=0&&t[s+1]){let o=Number(t[s+1]);if(Number.isFinite(o))return Math.max(100,o)}}return e}var P=new Set(["tap","double-tap","tap-text","tap-id","long-press","touch"]);function _(t){return typeof t=="string"&&P.has(t)}async function A(t){return await t.send({type:"evaluate",code:"window.__sootsimEngineState?.inspectActive === true"})===!0}async function G(t,e){if(!_(e))return!1;try{return await A(t)}catch{return!1}}async function V(t){let e=await t.send({type:"query",query:{kind:"count"}});return{nodes:b(e)?e.total:0}}async function Z(t,e=5){let n=await t.send({type:"query",query:{kind:"tree",depth:e}}),r=b(n)?n.nodes:[];return{depth:e,tree:r}}async function ee(t){let e=await t.send({type:"evaluate",code:"window.location.href"});return{url:typeof e=="string"?e:""}}function C(t){return t!==null&&typeof t=="object"&&[Reflect.get(t,"x"),Reflect.get(t,"y"),Reflect.get(t,"width"),Reflect.get(t,"height")].every(e=>typeof e=="number"?Number.isFinite(e):!1)}function I(t){return Array.isArray(t)?t.every(e=>{if(e===null||typeof e!="object"||!Number.isInteger(Reflect.get(e,"nodeId"))||typeof Reflect.get(e,"type")!="string"||!C(Reflect.get(e,"geometry")))return!1;for(let s of["testID","text","role","label"]){let o=Reflect.get(e,s);if(o!==void 0&&typeof o!="string")return!1}let n=Reflect.get(e,"pressable");if(n!==void 0&&n!==!0)return!1;let r=Reflect.get(e,"children");return r===void 0||I(r)}):!1}function b(t){let e=t!==null&&typeof t=="object"?Reflect.get(t,"total"):void 0;return t!==null&&typeof t=="object"&&typeof e=="number"&&Number.isInteger(e)&&e>=0&&I(Reflect.get(t,"nodes"))}function N(t){let e=t.replace(/[.+^$(){}|[\]\\]/g,"\\$&");return new RegExp(`^${e.replace(/\*/g,".*").replace(/\?/g,".")}$`,"i")}function F(t,e={}){let n=e.filter?.toLowerCase()??"",r=e.testIdLike?N(e.testIdLike):null,s=e.onlyGlob?N(e.onlyGlob):null,o=[],i=(a,y)=>{let p=[a.role,a.label,a.text,a.testID].filter(d=>typeof d=="string").join(" ");if((!n||p.toLowerCase().includes(n))&&(!r||r.test(a.testID??""))&&(!s||s.test(p))){let d=[a.role?`[${a.role}]`:a.pressable?"[tap]":`<${a.type}>`];if(a.text){let g=e.fullText||a.text.length<=50?a.text:`${a.text.slice(0,49).trimEnd()}\u2026`;d.push(JSON.stringify(g))}if(a.testID&&d.push(`#${a.testID}`),a.label&&a.label!==a.text&&d.push(`label=${JSON.stringify(a.label)}`),!e.hideXy){let g=a.geometry;d.push(`@(${Math.round(g.x)},${Math.round(g.y)}) ${Math.round(g.width)}x${Math.round(g.height)}`)}a.pressable&&d.push("(tap)"),o.push(`${" ".repeat(y+1)}${d.join(" ")}`)}for(let d of a.children??[])i(d,y+1)},u=t;if(e.subtreeRoot){let a=[...t],y;for(;a.length>0&&!y;){let p=a.shift();p&&(p.testID===e.subtreeRoot?y=p:a.push(...p.children??[]))}if(!y)return`__SUBTREE_NOT_FOUND__:${e.subtreeRoot}`;u=[y]}for(let a of u)i(a,0);return o.join(`
|
|
5
|
-
`)}async function te(t,e){let n=e.maxDepth??12,r=await t.send({type:"query",query:{kind:"tree",depth:n}});return b(r)?{tree:F(r.nodes,e),nodeCount:r.total}:{}}function W(t){let e=t.fontSize>=18||t.fontSize>=14&&(t.fontWeight??400)>=700?3:4.5,{normal:n,background:r}=t;if(n.width<=0||n.height<=0||n.width!==r.width||n.height!==r.height)return{ratio:null,required:e,reason:"capture dimensions do not match"};let s=Math.max(0,Math.floor(t.box.x)),o=Math.max(0,Math.floor(t.box.y)),i=Math.min(n.width,Math.ceil(t.box.x+t.box.w)),u=Math.min(n.height,Math.ceil(t.box.y+t.box.h));if(i<=s||u<=o)return{ratio:null,required:e,reason:"text is outside the captured frame"};let a=l=>{let c=l/255;return c<=.04045?c/12.92:Math.pow((c+.055)/1.055,2.4)},y=(l,c)=>{let m=.2126*a(l[0])+.7152*a(l[1])+.0722*a(l[2]),x=.2126*a(c[0])+.7152*a(c[1])+.0722*a(c[2]);return(Math.max(m,x)+.05)/(Math.min(m,x)+.05)},p=l=>`#${l.slice(0,3).map(c=>Math.round(c).toString(16).padStart(2,"0")).join("")}`,R=(i-s)*(u-o),d=Math.max(1,Math.floor(Math.sqrt(R/12e3))),g=(l,c)=>(c*n.width+l)*4,$=l=>Math.max(Math.abs(n.data[l]-r.data[l]),Math.abs(n.data[l+1]-r.data[l+1]),Math.abs(n.data[l+2]-r.data[l+2])),S=0,w=null,f=null;for(let l=o;l<u;l+=d)for(let c=s;c<i;c+=d){let m=g(c,l);if(r.data[m+3]<250)continue;let x=[r.data[m],r.data[m+1],r.data[m+2]];f??=x;let M=$(m);M<=S||(S=M,w=[n.data[m],n.data[m+1],n.data[m+2]])}let h=1/0,v=null,k=null,E=(l,c)=>{let m=y(l,c);m>=h||(h=m,v=l,k=c)};if(S>=2&&w)for(let l=o;l<u;l+=d)for(let c=s;c<i;c+=d){let m=g(c,l);r.data[m+3]<250||$(m)<2||E(w,[r.data[m],r.data[m+1],r.data[m+2]])}else f&&E(f,f);return!v||!k||!Number.isFinite(h)?{ratio:null,required:e,reason:"could not isolate opaque rendered text pixels"}:{ratio:Math.round(h*100)/100,required:e,foreground:p(v),background:p(k)}}function O(t={}){let e=t.styling===!0,n=t.filter?.trim().toLowerCase()??"";return`(async () => {
|
|
6
|
-
const t = window.__sootsimTest
|
|
7
|
-
if (!t || typeof t.listInspectable !== 'function') return []
|
|
8
|
-
const list = await t.listInspectable({})
|
|
9
|
-
if (!Array.isArray(list)) return []
|
|
10
|
-
const includeStyle = ${JSON.stringify(e)}
|
|
11
|
-
const scoreContrast = ${W.toString()}
|
|
12
|
-
// narrows by ELEMENT, not by style field: fewer rows, full detail on each.
|
|
13
|
-
const filter = ${JSON.stringify(n)}
|
|
14
|
-
const matchesFilter = (n, text) => {
|
|
15
|
-
if (!filter) return true
|
|
16
|
-
const fields = [text, n.testID || n.testId, n.accessibilityRole || n.role, n.type]
|
|
17
|
-
return fields.some((f) => typeof f === 'string' && f.toLowerCase().includes(filter))
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const num = (v) => (typeof v === 'number' && Number.isFinite(v) ? v : 0)
|
|
21
|
-
const round = (v) => Math.round(num(v))
|
|
22
|
-
|
|
23
|
-
// borderRadius can be authored as a string ("12px") or split per-corner;
|
|
24
|
-
// prefer the uniform borderRadius, else the largest corner radius present.
|
|
25
|
-
const radiusOf = (style) => {
|
|
26
|
-
if (!style) return 0
|
|
27
|
-
const keys = ['borderRadius','borderTopLeftRadius','borderTopRightRadius','borderBottomLeftRadius','borderBottomRightRadius']
|
|
28
|
-
let max = 0
|
|
29
|
-
for (const k of keys) {
|
|
30
|
-
const raw = style[k]
|
|
31
|
-
const n = typeof raw === 'number' ? raw : (typeof raw === 'string' ? parseFloat(raw) : NaN)
|
|
32
|
-
if (Number.isFinite(n)) max = Math.max(max, n)
|
|
33
|
-
}
|
|
34
|
-
return Math.round(max)
|
|
35
|
-
}
|
|
36
|
-
const fontSizeOf = (style) => {
|
|
37
|
-
if (!style) return 0
|
|
38
|
-
const raw = style.fontSize
|
|
39
|
-
const n = typeof raw === 'number' ? raw : (typeof raw === 'string' ? parseFloat(raw) : NaN)
|
|
40
|
-
return Number.isFinite(n) ? Math.round(n) : 0
|
|
41
|
-
}
|
|
42
|
-
// styling extractors \u2014 omit boring defaults so the agent only sees notable
|
|
43
|
-
// styling (low opacity, struck text, clipping, a real border/color).
|
|
44
|
-
const colorStr = (v) => {
|
|
45
|
-
if (v == null) return undefined
|
|
46
|
-
const s = String(v).split(' ').join('')
|
|
47
|
-
return s && s !== 'transparent' && s !== 'rgba(0,0,0,0)' ? s : undefined
|
|
48
|
-
}
|
|
49
|
-
const opacityOf = (style) => {
|
|
50
|
-
const o = style && style.opacity
|
|
51
|
-
const n = typeof o === 'number' ? o : (typeof o === 'string' ? parseFloat(o) : NaN)
|
|
52
|
-
return Number.isFinite(n) && n < 1 ? Math.round(n * 100) / 100 : undefined
|
|
53
|
-
}
|
|
54
|
-
const weightOf = (style) => {
|
|
55
|
-
const w = style && style.fontWeight
|
|
56
|
-
const n = w === 'bold' ? 700 : (typeof w === 'number' ? w : (typeof w === 'string' ? parseInt(w, 10) : NaN))
|
|
57
|
-
return Number.isFinite(n) && n >= 600 ? n : undefined
|
|
58
|
-
}
|
|
59
|
-
const decoOf = (style) => {
|
|
60
|
-
const d = style && (style.textDecorationLine || style.textDecoration)
|
|
61
|
-
return d && d !== 'none' && d !== 'normal' ? String(d).split(' ')[0] : undefined
|
|
62
|
-
}
|
|
63
|
-
const overflowOf = (style) => (style && style.overflow === 'hidden' ? 'hidden' : undefined)
|
|
64
|
-
const borderWOf = (style) => {
|
|
65
|
-
if (!style) return undefined
|
|
66
|
-
const keys = ['borderWidth','borderTopWidth','borderBottomWidth','borderLeftWidth','borderRightWidth']
|
|
67
|
-
let max = 0
|
|
68
|
-
for (const k of keys) {
|
|
69
|
-
const r = style[k]
|
|
70
|
-
const n = typeof r === 'number' ? r : (typeof r === 'string' ? parseFloat(r) : NaN)
|
|
71
|
-
if (Number.isFinite(n)) max = Math.max(max, n)
|
|
72
|
-
}
|
|
73
|
-
return max > 0 ? Math.round(max) : undefined
|
|
74
|
-
}
|
|
75
|
-
// only meaningful alongside a real border width, so it is resolved by the
|
|
76
|
-
// caller below rather than on its own.
|
|
77
|
-
const borderColorOf = (style) => {
|
|
78
|
-
if (!style) return undefined
|
|
79
|
-
const keys = ['borderColor','borderTopColor','borderBottomColor','borderLeftColor','borderRightColor']
|
|
80
|
-
for (const k of keys) {
|
|
81
|
-
const c = colorStr(style[k])
|
|
82
|
-
if (c) return c
|
|
83
|
-
}
|
|
84
|
-
return undefined
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const isVisible = (n) => {
|
|
88
|
-
const layout = n && n.layout
|
|
89
|
-
if (!layout || layout.width <= 0 || layout.height <= 0) return false
|
|
90
|
-
const abs = (n && (n.absolute || n.absolutePosition)) || null
|
|
91
|
-
if (!abs) return true
|
|
92
|
-
const device = (n && n.device) || {}
|
|
93
|
-
const screenW = Number(device.width) || window.innerWidth || 0
|
|
94
|
-
const screenH = Number(device.height) || window.innerHeight || 0
|
|
95
|
-
if (!screenW || !screenH) return true
|
|
96
|
-
return abs.x + layout.width > 0 && abs.y + layout.height > 0 && abs.x < screenW && abs.y < screenH
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const elements = list.filter(isVisible).filter((n) => {
|
|
100
|
-
const t = typeof n.text === 'string' && n.text.trim() ? n.text.trim() : undefined
|
|
101
|
-
return matchesFilter(n, t)
|
|
102
|
-
}).map((n) => {
|
|
103
|
-
const layout = n.layout || { x: 0, y: 0, width: 0, height: 0 }
|
|
104
|
-
const abs = n.absolute || n.absolutePosition || { x: layout.x, y: layout.y }
|
|
105
|
-
const text = typeof n.text === 'string' && n.text.trim() ? n.text.trim() : undefined
|
|
106
|
-
const base = {
|
|
107
|
-
...(typeof n.nodeId === 'number'
|
|
108
|
-
? {
|
|
109
|
-
nodeId: n.nodeId,
|
|
110
|
-
ancestorIds: Array.isArray(n.ancestors)
|
|
111
|
-
? n.ancestors.map((ancestor) => ancestor && ancestor.nodeId).filter((id) => typeof id === 'number')
|
|
112
|
-
: [],
|
|
113
|
-
}
|
|
114
|
-
: {}),
|
|
115
|
-
testID: n.testID || n.testId || undefined,
|
|
116
|
-
role: n.accessibilityRole || n.role || undefined,
|
|
117
|
-
type: typeof n.type === 'string' ? n.type : 'node',
|
|
118
|
-
text,
|
|
119
|
-
box: { x: round(abs.x), y: round(abs.y), w: round(layout.width), h: round(layout.height) },
|
|
120
|
-
}
|
|
121
|
-
if (!includeStyle) return base
|
|
122
|
-
// computedStyle has the resolved values; style is the curated subset \u2014
|
|
123
|
-
// fall back across both so radius/fontSize survive either shape.
|
|
124
|
-
const style = Object.assign({}, n.style || {}, n.computedStyle || {})
|
|
125
|
-
const pad = (n.boxModel && n.boxModel.padding) || {}
|
|
126
|
-
const borderWidth = borderWOf(style)
|
|
127
|
-
return {
|
|
128
|
-
...base,
|
|
129
|
-
borderRadius: radiusOf(style),
|
|
130
|
-
padding: { t: round(pad.top), r: round(pad.right), b: round(pad.bottom), l: round(pad.left) },
|
|
131
|
-
fontSize: text ? (fontSizeOf(style) || 14) : 0,
|
|
132
|
-
color: text ? colorStr(style.color) : undefined,
|
|
133
|
-
bg: colorStr(style.backgroundColor),
|
|
134
|
-
opacity: opacityOf(style),
|
|
135
|
-
fontWeight: weightOf(style),
|
|
136
|
-
textDecoration: decoOf(style),
|
|
137
|
-
overflow: overflowOf(style),
|
|
138
|
-
borderWidth,
|
|
139
|
-
borderColor: borderWidth ? borderColorOf(style) : undefined,
|
|
140
|
-
}
|
|
141
|
-
})
|
|
142
|
-
const textElements = elements.filter((element) => element.text && element.fontSize > 0)
|
|
143
|
-
if (!includeStyle || textElements.length === 0) return elements
|
|
144
|
-
|
|
145
|
-
const screenshot = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.screenshot
|
|
146
|
-
if (typeof screenshot !== 'function') {
|
|
147
|
-
throw new Error('styled native layout requires the rnx capture bridge')
|
|
148
|
-
}
|
|
149
|
-
const device = list.find((node) => node && node.device)?.device || {}
|
|
150
|
-
const width = Math.round(Number(device.width) || window.innerWidth || 0)
|
|
151
|
-
const height = Math.round(Number(device.height) || window.innerHeight || 0)
|
|
152
|
-
if (!width || !height) throw new Error('native layout has no capture dimensions')
|
|
153
|
-
const capture = async (suppressText) => {
|
|
154
|
-
const dataUrl = await screenshot({
|
|
155
|
-
format: 'png',
|
|
156
|
-
outputWidth: width,
|
|
157
|
-
outputHeight: height,
|
|
158
|
-
...(suppressText ? { suppressText: true } : {}),
|
|
159
|
-
})
|
|
160
|
-
const image = await new Promise((resolve, reject) => {
|
|
161
|
-
const next = new Image()
|
|
162
|
-
next.onload = () => resolve(next)
|
|
163
|
-
next.onerror = () => reject(new Error('could not decode native layout pixels'))
|
|
164
|
-
next.src = dataUrl
|
|
165
|
-
})
|
|
166
|
-
const canvas = document.createElement('canvas')
|
|
167
|
-
canvas.width = image.naturalWidth
|
|
168
|
-
canvas.height = image.naturalHeight
|
|
169
|
-
const context = canvas.getContext('2d', { willReadFrequently: true })
|
|
170
|
-
if (!context) throw new Error('could not read native layout pixels')
|
|
171
|
-
context.drawImage(image, 0, 0)
|
|
172
|
-
return context.getImageData(0, 0, canvas.width, canvas.height)
|
|
173
|
-
}
|
|
174
|
-
const normal = await capture(false)
|
|
175
|
-
const background = await capture(true)
|
|
176
|
-
for (const element of textElements) {
|
|
177
|
-
element.contrast = scoreContrast({
|
|
178
|
-
normal,
|
|
179
|
-
background,
|
|
180
|
-
box: element.box,
|
|
181
|
-
fontSize: element.fontSize,
|
|
182
|
-
fontWeight: element.fontWeight,
|
|
183
|
-
})
|
|
184
|
-
}
|
|
185
|
-
return elements
|
|
186
|
-
})()`}var re=O();async function ne(t,e={}){if(!e.styling){let r=await t.send({type:"query",query:{kind:"find",selector:{visible:!0}}});if(!b(r))return[];let s=e.filter?.trim().toLowerCase()??"";return r.nodes.filter(o=>s?[o.text,o.testID,o.role,o.type].some(i=>typeof i=="string"&&i.toLowerCase().includes(s)):!0).map(o=>({nodeId:o.nodeId,...o.testID?{testID:o.testID}:{},...o.role?{role:o.role}:{},type:o.type,...o.text?{text:o.text}:{},box:{x:Math.round(o.geometry.x),y:Math.round(o.geometry.y),w:Math.round(o.geometry.width),h:Math.round(o.geometry.height)}}))}let n=await t.send({type:"evaluate",code:O(e)});return Array.isArray(n)?n:[]}function oe(t,e){return t.length===0?" no visible elements found":t.map(r=>{let o=[r.testID?`#${r.testID}`:r.selector?r.selector:r.role?`[${r.role}]`:`<${r.type}>`,`@(${r.box.x},${r.box.y})`,`${r.box.w}x${r.box.h}`];r.borderRadius!==void 0&&r.borderRadius>0&&o.push(`radius:${r.borderRadius}`);let i=r.padding;if(i&&(i.t||i.r||i.b||i.l)){let u=i.t===i.r&&i.r===i.b&&i.b===i.l;o.push(u?`pad:${i.t}`:`pad:${i.t},${i.r},${i.b},${i.l}`)}if(r.fontSize!==void 0&&r.fontSize>0&&o.push(`font:${r.fontSize}`),e?.styling){if(r.fontWeight&&o.push(`weight:${r.fontWeight}`),r.color&&o.push(`color:${r.color}`),r.bg&&o.push(`bg:${r.bg}`),r.contrast){let u=r.contrast.ratio==null?`?/${r.contrast.required}`:`${r.contrast.ratio}/${r.contrast.required}${r.contrast.ratio<r.contrast.required?" FAIL":""}`;o.push(`contrast:${u}`),r.contrast.background&&o.push(`on:${r.contrast.background}`)}r.opacity!=null&&o.push(`opacity:${r.opacity}`),r.textDecoration&&o.push(`deco:${r.textDecoration}`),r.overflow&&o.push(`overflow:${r.overflow}`),r.borderWidth&&o.push(r.borderColor?`border:${r.borderWidth}/${r.borderColor}`:`border:${r.borderWidth}`)}if(r.text){let u=r.text.length>40?`${r.text.slice(0,39)}\u2026`:r.text;o.push(`"${u}"`)}return` ${o.join(" ")}`}).join(`
|
|
187
|
-
`)}async function se(t){let e=await t.send({type:"query",query:{kind:"find",selector:{visible:!0}}});return b(e)?e.nodes.flatMap(n=>!n.role&&!n.label&&!n.text&&!n.pressable?[]:[{role:n.role??(n.pressable?"button":n.type==="text"?"statictext":"none"),label:n.label??n.text??null,hint:null,state:null,testID:n.testID??null,position:{x:Math.round(n.geometry.x),y:Math.round(n.geometry.y)},size:{w:Math.round(n.geometry.width),h:Math.round(n.geometry.height)}}]):[]}function B(t){return t.testId?{mode:"testid",selector:{testID:t.testId}}:t.role?{mode:"role",selector:{role:t.role}}:t.type?{mode:"type",selector:{type:t.type}}:t.pressable?{mode:"pressable",selector:{pressable:!0}}:t.interactive?{mode:"interactive-targets",selector:{pressable:!0}}:t.visible?{mode:"visible",selector:{visible:!0}}:t.text?{mode:"text",selector:{text:t.text}}:null}async function ie(t,e){let n=B(e);if(!n)return null;let r=await t.send({type:"query",query:{kind:"find",selector:n.selector}});if(!b(r))return{mode:n.mode,result:[]};let s=r.nodes.map(i=>({type:i.type,nodeId:i.nodeId,...i.testID?{testID:i.testID}:{},...i.text?{text:i.text}:{},...i.pressable?{pressable:!0}:{},...i.role?{accessibilityRole:i.role}:{},...i.label?{accessibilityLabel:i.label}:{},absolutePosition:{x:i.geometry.x,y:i.geometry.y},layout:{width:i.geometry.width,height:i.geometry.height}})),o=n.mode==="testid"||n.mode==="text"?s[0]??null:s;return{mode:n.mode,result:o}}function ae(t){return[...t].sort((e,n)=>T(n)-T(e))}function T(t){let e=0;t.testID&&(e+=100),typeof t.text=="string"&&t.text.trim().length>0&&(e+=60),typeof t.accessibilityLabel=="string"&&t.accessibilityLabel.trim().length>0&&(e+=30),t.accessibilityRole&&(e+=15);let n=t.layout?.width??0,r=t.layout?.height??0,s=n*r;return s>=400&&s<=6e4?e+=25:s>6e4&&(e-=20),(t.absolutePosition?.y??0)<0&&(e-=30),e}function le(t){if(t.testID)return`rnx do tap-id ${L(t.testID)}`;let e=typeof t.text=="string"?t.text.trim():"";if(e.length>0&&e.length<=80)return`rnx do tap-text ${L(e)}`;let n=Math.round(((t.absolutePosition?.x??0)+(t.layout?.width??0)/2)*10)/10,r=Math.round(((t.absolutePosition?.y??0)+(t.layout?.height??0)/2)*10)/10;return`rnx do tap ${n} ${r}`}function L(t){return/^[A-Za-z0-9_./@:-]+$/.test(t)?t:`'${t.replace(/'/g,"'\\''")}'`}function ue(t){if(t.bridgeError)return`sim unreachable: ${t.bridgeError} \u2014 the target tab is closed or no sim is connected (check \`rnx list\`, reopen with \`rnx open\`)`;let e=t.externalError?`guest app errored: ${t.externalError}`:t.loadingText?`still showing "${t.loadingText}"`:t.externalReady===!1?"guest app is still loading":t.flag!==!0&&t.targets>0?"native content is rendered but the ready signal has not settled":t.flag!==!0?"guest app has not emitted sootsim:externalAppReady":t.targets<=0?"ready flag emitted but no visible app content is inspectable yet":"node tree is still changing";return!t.externalError&&t.suppressedEntryError?`${e} (suppressed entry error: ${t.suppressedEntryError})`:e}async function ce(t,e=2e4,n={}){let r=Date.now(),s;try{s=await t.send({type:"waitFor",waitForOptions:{condition:{type:"ready"},timeoutMs:e}},{timeoutMs:e+1e3})}catch(u){let a=u instanceof Error?u.message:String(u);if(a.startsWith("multiple sims are connected:")||a.startsWith("saved sim "))throw u;s={matched:!1,elapsedMs:Date.now()-r,polls:0,error:a}}let o=s.probe,i={ready:s.matched,elapsedMs:s.elapsedMs,nodes:o?.nodes??0,targets:o?.targets??0,liveFrameActive:o?.liveFrameActive??!1,liveFrameChannels:o?.liveFrameChannels??0,liveFramePublishes:o?.liveFramePublishes??0,flag:o?.flag,loadingText:o?.loadingText??"",externalReady:o?.externalReady??null,externalStatus:o?.externalStatus??"",externalError:o?.externalError??"",suppressedEntryError:o?.suppressedEntryError??"",errors:o?.errors??0,bridgeError:s.error??""};return!i.ready&&n.onProgress&&n.onProgress(i),i}async function me(t,e,n=5e3,r={}){let s=r.gone===!0,o=await t.send({type:"waitFor",waitForOptions:{condition:{type:s?"absent":"present",testID:e},timeoutMs:n}},{timeoutMs:n+1e3});if(o?.error)throw new Error(o.error);if(o?.node&&!I([o.node]))throw new Error("waitFor returned an invalid semantic node");return{found:o?.matched===!0,...o?.node?{node:o.node}:{},elapsed:o?.elapsedMs??n}}function D(t,e){return`(() => {
|
|
188
|
-
const out = []
|
|
189
|
-
const seen = new Set()
|
|
190
|
-
const norm = (s) => (typeof s === 'string' ? s : (() => { try { return JSON.stringify(s) } catch { return String(s) } })())
|
|
191
|
-
const key = (ts, args) => Math.round((ts || 0) / 250) + '|' + (Array.isArray(args) ? args.map(norm).join(' ') : norm(args))
|
|
192
|
-
const push = (e) => {
|
|
193
|
-
if (!e) return
|
|
194
|
-
const ts = typeof e.timestamp === 'number' ? e.timestamp : (typeof e.ts === 'number' ? e.ts : 0)
|
|
195
|
-
const k = key(ts, e.args)
|
|
196
|
-
if (seen.has(k)) return
|
|
197
|
-
seen.add(k)
|
|
198
|
-
out.push({ timestamp: ts, args: Array.isArray(e.args) ? e.args : [e.args], stack: e.stack || undefined, source: e.source || undefined })
|
|
199
|
-
}
|
|
200
|
-
// page-realm ws-bridge buffer first (richest stacks for page-origin errors)
|
|
201
|
-
try { for (const e of (window.__sootsimConsole?.${t==="error"?"getErrors":"getWarnings"}(${e}) || [])) push(e) } catch {}
|
|
202
|
-
// engine observability store \u2014 the always-on render-worker / forwarded path
|
|
203
|
-
try {
|
|
204
|
-
const obs = window.__sootsimObservability
|
|
205
|
-
const snap = obs && obs.logs && typeof obs.logs.getSnapshot === 'function' ? obs.logs.getSnapshot() : []
|
|
206
|
-
for (const e of snap) if (e && e.level === ${JSON.stringify(t)}) push(e)
|
|
207
|
-
} catch {}
|
|
208
|
-
return out.sort((a, b) => (a.timestamp || 0) - (b.timestamp || 0)).slice(-${e})
|
|
209
|
-
})()`}async function de(t,e=20){let n=await t.send({type:"evaluate",code:D("error",e)});return Array.isArray(n)?n:[]}async function pe(t,e=20){let n=await t.send({type:"evaluate",code:D("warn",e)});return Array.isArray(n)?n:[]}var ye=`(() => {
|
|
210
|
-
const norm = (s) => (typeof s === 'string' ? s : (() => { try { return JSON.stringify(s) } catch { return String(s) } })())
|
|
211
|
-
const key = (lvl, ts, args) => lvl + '|' + Math.round((ts || 0) / 250) + '|' + (Array.isArray(args) ? args.map(norm).join(' ') : norm(args))
|
|
212
|
-
const seen = new Set()
|
|
213
|
-
let errors = 0
|
|
214
|
-
let warnings = 0
|
|
215
|
-
const add = (lvl, ts, args) => {
|
|
216
|
-
if (lvl !== 'error' && lvl !== 'warn') return
|
|
217
|
-
const k = key(lvl, ts, args)
|
|
218
|
-
if (seen.has(k)) return
|
|
219
|
-
seen.add(k)
|
|
220
|
-
if (lvl === 'error') errors++
|
|
221
|
-
else warnings++
|
|
222
|
-
}
|
|
223
|
-
try {
|
|
224
|
-
const c = window.__sootsimConsole
|
|
225
|
-
for (const e of (c?.getErrors?.(200) || [])) add('error', e?.timestamp ?? e?.ts, e?.args)
|
|
226
|
-
for (const e of (c?.getWarnings?.(200) || [])) add('warn', e?.timestamp ?? e?.ts, e?.args)
|
|
227
|
-
} catch {}
|
|
228
|
-
try {
|
|
229
|
-
const obs = window.__sootsimObservability
|
|
230
|
-
const snap = obs && obs.logs && typeof obs.logs.getSnapshot === 'function' ? obs.logs.getSnapshot() : []
|
|
231
|
-
for (const e of snap) if (e) add(e.level, e.ts, e.args)
|
|
232
|
-
} catch {}
|
|
233
|
-
return { errors, warnings, total: errors + warnings }
|
|
234
|
-
})()`;async function ge(t){await t.send({type:"evaluate",code:'window.__sootsimConsole?.clear(); window.__sootsimObservability?.logs?.clear?.(); "cleared"'})}async function be(t,e={}){let n=e.limit??20,r=e.failed===!1?"getRequests":"getFailedRequests",s=await t.send({type:"call",path:`__sootsimTest.${r}`,args:[n]});return Array.isArray(s)?s:[]}async function fe(t){await t.send({type:"call",path:"__sootsimTest.clearRequests",args:[]})}async function he(t){let e=await t.send({type:"evaluate",code:`(() => {
|
|
235
|
-
const obs = window.__sootsimObservability;
|
|
236
|
-
if (!obs) return { ok: false };
|
|
237
|
-
return { ok: true, entries: obs.logs.getSnapshot() };
|
|
238
|
-
})()`});return!e||!e.ok?[]:e.entries??[]}async function xe(t){await t.send({type:"evaluate",code:'window.__sootsimObservability?.logs.clear(); "cleared"'})}function H(t,e){if(t.source===e.source||t.level!==e.level||Math.abs(t.ts-e.ts)>1e3||t.args.length!==e.args.length)return!1;let n=new Set([t.source,e.source]);return!n.has("sootsim-worker")||!n.has("render-worker")&&!n.has("forwarded-render-worker")?!1:t.args.every((r,s)=>r===e.args[s])}function Se(t,e={}){let n=[];for(let r of t)n.some(s=>H(s,r))||n.push(r);if(e.showInternal||(n=n.filter(r=>{let s=r.args[0];return!(typeof s=="string"&&s.startsWith("[rnx]"))})),e.level&&(n=n.filter(r=>e.level.has(r.level))),e.filter){let r=e.filter.toLowerCase();n=n.filter(s=>s.args.join(" ").toLowerCase().includes(r))}return n}async function we(t,e){return await t.send({type:"call",path:"SootSim.bridges.timeline.summary",args:[e]})}async function j(t,e){return await t.send({type:"call",path:"SootSim.bridges.timeline.recent",args:[e]})}async function ve(t){let e;try{e=(await j(t,{kinds:["alert","actionsheet"],limit:80})).events}catch{return[]}let n=new Map;for(let o of e)n.set(o.kind,o);let r=[],s=(o,i)=>{let u=n.get(o);if(!u||!u.data||typeof u.data!="object")return;let a=u.data;a.phase==="show"&&r.push({label:i,title:typeof a.title=="string"?a.title:null})};return s("alert","Alert"),s("actionsheet","ActionSheet"),r}async function ke(t,e,n){await t.send({type:"call",path:"SootSim.bridges.timeline.cursorAdvance",args:[e,n]})}async function Ie(t){return await t.send({type:"evaluate",code:`(() => {
|
|
239
|
-
const kb = window.__sootsimKeyboard
|
|
240
|
-
if (!kb || typeof kb.getLayout !== 'function') {
|
|
241
|
-
return { error: 'keyboard bridge getLayout() not available' }
|
|
242
|
-
}
|
|
243
|
-
return kb.getLayout()
|
|
244
|
-
})()`})??{error:"keyboard bridge returned no result"}}function z(t){let e=t instanceof Error?t.message:String(t);return e.includes("call target not found: SootSim.bridges.mainShell")||e.includes("test bridge unavailable before app-in-worker boot")}async function q(t,e=0){let n=Date.now()+Math.max(0,e);for(;;)try{return await t.send({type:"call",path:"SootSim.bridges.mainShell.getState",args:[]})}catch(r){if(!z(r)||Date.now()>=n)throw r;await new Promise(s=>setTimeout(s,50))}}async function Re(t){let e=await t.send({type:"evaluate",code:`(async () => {
|
|
245
|
-
const test = window.__sootsimTest
|
|
246
|
-
const kb = window.__sootsimKeyboard
|
|
247
|
-
const navSnap =
|
|
248
|
-
test && typeof test.getNavigationSnapshot === 'function'
|
|
249
|
-
? await test.getNavigationSnapshot()
|
|
250
|
-
: null
|
|
251
|
-
const route =
|
|
252
|
-
test && typeof test.getRouteInfo === 'function'
|
|
253
|
-
? await test.getRouteInfo()
|
|
254
|
-
: null
|
|
255
|
-
const keyboard =
|
|
256
|
-
kb && typeof kb.getLayout === 'function'
|
|
257
|
-
? (() => {
|
|
258
|
-
const layout = kb.getLayout()
|
|
259
|
-
return layout ? {
|
|
260
|
-
visible: layout.visible,
|
|
261
|
-
mode: layout.mode,
|
|
262
|
-
spec: layout.spec
|
|
263
|
-
? {
|
|
264
|
-
keyboardType: layout.spec.keyboardType,
|
|
265
|
-
returnKeyType: layout.spec.returnKeyType,
|
|
266
|
-
}
|
|
267
|
-
: null,
|
|
268
|
-
} : null
|
|
269
|
-
})()
|
|
270
|
-
: null
|
|
271
|
-
return { nav: navSnap, route, keyboard }
|
|
272
|
-
})()`});return{shell:await q(t,500).catch(()=>null),nav:e?.nav??null,route:e?.route??null,keyboard:e?.keyboard??null}}async function $e(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.status()"})}async function Ee(t){return t.send({type:"evaluate",code:"window.__sootsimDebug.flags()"})}async function Me(t,e){return t.send({type:"evaluate",code:`window.__sootsimTest.debugFind(${JSON.stringify(e)})`})}async function Ne(t,e,n=50){let r=e&&e!=="all"?`window.__sootsimDebug.recent(${JSON.stringify(e)}, ${n})`:`window.__sootsimDebug.recent(undefined, ${n})`;return t.send({type:"evaluate",code:r})}async function Te(t,e,n){let r=n.length>0?n.map(s=>JSON.stringify(s)).join(", "):e==="disable"?"'all'":"";return t.send({type:"evaluate",code:`window.__sootsimDebug.${e}(${r})`})}async function Le(t){return await t.send({type:"evaluate",code:`(async () => {
|
|
273
|
-
const host = window.__sootsimRenderHost
|
|
274
|
-
const stats = host?.queryStats ? await host.queryStats() : null
|
|
275
|
-
const shellRaw = window.__sootsimShellMemory
|
|
276
|
-
? await window.__sootsimShellMemory()
|
|
277
|
-
: null
|
|
278
|
-
const shell = shellRaw && !shellRaw.error ? shellRaw : null
|
|
279
|
-
// the compositor paints home + app:one + app:two, so every app-surface
|
|
280
|
-
// picture and raster image is counted here and nowhere else.
|
|
281
|
-
let compositor = null
|
|
282
|
-
try {
|
|
283
|
-
const cs = await window.__sootsimCompositor?.getStats?.(false, true)
|
|
284
|
-
compositor = cs?.memory ?? null
|
|
285
|
-
} catch {}
|
|
286
|
-
const normalize = (m) =>
|
|
287
|
-
m
|
|
288
|
-
? {
|
|
289
|
-
nodesRegistered: m.nodesRegistered ?? null,
|
|
290
|
-
nodesDetached: m.nodesDetached ?? null,
|
|
291
|
-
detachedTypes: m.detachedTypes ?? null,
|
|
292
|
-
objects: m.objects ?? null,
|
|
293
|
-
activeNativeAnimations: m.activeNativeAnimations ?? null,
|
|
294
|
-
imageLoader: m.imageLoader ?? null,
|
|
295
|
-
workerHeap: m.workerHeap ?? null,
|
|
296
|
-
wasmHeapBytes: m.wasmHeapBytes ?? null,
|
|
297
|
-
}
|
|
298
|
-
: null
|
|
299
|
-
const hostMem = performance.memory
|
|
300
|
-
? {
|
|
301
|
-
usedJSHeapSize: performance.memory.usedJSHeapSize,
|
|
302
|
-
totalJSHeapSize: performance.memory.totalJSHeapSize,
|
|
303
|
-
jsHeapSizeLimit: performance.memory.jsHeapSizeLimit,
|
|
304
|
-
}
|
|
305
|
-
: null
|
|
306
|
-
return {
|
|
307
|
-
tenant: normalize(stats?.memory),
|
|
308
|
-
shell: normalize(shell),
|
|
309
|
-
compositor: normalize(compositor),
|
|
310
|
-
hostHeap: hostMem,
|
|
311
|
-
}
|
|
312
|
-
})()`})??{tenant:null,shell:null,compositor:null,hostHeap:null}}function Oe(t){if(t.total===0)return"nothing recorded";let e=[],n=["error","warning","console","fetch","toast","alert","actionsheet","picker","notification","screen","route","keyboard","app-launch","shell","scroll","gesture","text-input","react-commit","animation","reanimated"],r=new Set;for(let s of n){let o=t.byKind[s];o&&(e.push(`${o} ${s}${o===1?"":"s"}`),r.add(s))}for(let[s,o]of Object.entries(t.byKind))!r.has(s)&&o&&e.push(`${o} ${s}${o===1?"":"s"}`);return e.join(" \xB7 ")}var De=new Set(["react-commit","layout","scroll"]);function K(t,e){if(e===null)return new Date(t).toLocaleTimeString();let n=(t-e)/1e3;return`${n>=0?"+":""}${n.toFixed(2)}s`}function Y(t,e){switch(t){case"app-launch":return e.phase==="launch"?`launch ${e.appName??e.toAppId??""}`:`dismiss ${e.appName??e.fromAppId??""} \u2192 ${e.toAppId??""}`;case"toast":return`"${e.text??""}"${e.durationMs?` (${e.durationMs}ms)`:""}`;case"keyboard":return`${e.phase??"?"}${e.heightPx?` h=${e.heightPx}`:""}${e.mode?` ${e.mode}`:""}`;case"screen":return`${e.phase??"?"} ${e.name??e.activeName??""}`;case"flow-step":return`${e.status??"?"} ${e.stepName??"step"}${e.durationMs?` ${e.durationMs}ms`:""}`;case"route":return`${e.phase??"?"} ${e.path??e.pathname??""}`;case"alert":case"actionsheet":case"picker":return`${e.phase??"?"} ${e.title??e.message??""}`;case"notification":return`${e.title??""}${e.body?` \u2014 ${e.body}`:""}`;case"fetch":return`${e.method??"GET"} ${e.url??""}${e.status?` -> ${e.status}`:""}`;case"console":case"console-log":return`${e.level??"log"}: ${(e.message??"").toString().slice(0,120)}`;case"shell":return`${e.event??e.type??e.phase??""}`;case"scroll":return`${e.phase??"?"} ${e.target??""}`;case"gesture":return`${e.phase??"?"} ${e.type??""}`;case"text-input":return`${e.phase??"?"}${e.value!==void 0?` "${String(e.value).slice(0,40)}"`:""}`;case"layout":return`${e.kind??"?"} ${e.testID??e.type??""}${e.skipped?` skipped:${e.reason??"unknown"}`:""}`;case"react-commit":{let n=e.slowest;return`${e.fiberCount??"?"} fibers ${e.durationMs??"?"}ms${n?.displayName?` \xB7 ${n.displayName} ${n.durationMs??"?"}ms`:""}`}case"frame":return`${e.totalMs??"?"}ms${e.renderMs?` \xB7 render ${e.renderMs}ms`:""}${e.layoutMs?` \xB7 layout ${e.layoutMs}ms`:""}${e.copyMs?` \xB7 copy ${e.copyMs}ms`:""}`;case"reanimated":case"animation":return`${e.kind??""} ${e.target??""}${e.durationMs?` ${e.durationMs}ms`:""}`}return""}function Pe(t,e){let n=K(t.t,e).padStart(8),r=t.context.padEnd(6),s=`[${t.kind}]`.padEnd(15),o=t.data,i=o&&typeof o=="object"?Y(t.kind,o):"";return` ${n} ${r} ${s} ${i}`}export{X as a,G as b,V as c,Z as d,ee as e,I as f,F as g,te as h,ne as i,oe as j,se as k,ie as l,ae as m,le as n,ue as o,ce as p,me as q,de as r,pe as s,ye as t,ge as u,be as v,fe as w,he as x,xe as y,Se as z,we as A,j as B,ve as C,ke as D,Ie as E,z as F,q as G,Re as H,$e as I,Ee as J,Me as K,Ne as L,Te as M,Le as N,Oe as O,De as P,Pe as Q};
|
|
@@ -1,27 +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 w,b as E}from"./chunk-DGX3MN65.js";import{P as _,Q as F,R as T,S as W,g as $}from"./chunk-QRDF33WD.js";import ae from"node:fs";import S from"node:path";import{WebSocket as C}from"ws";var ye="http://localhost:7668/";function H(e){if(typeof e=="number")return Number.isInteger(e)&&e>0?e:null;if(typeof e!="string")return null;let r=e.trim();if(!r)return null;let t=Number(r);return Number.isInteger(t)&&t>0?t:null}function z(e){let r=H(e);return r===null?0:r}function V(e={}){let r=H(e.explicitPort);return r!==null?r:7668+z(e.portOffset)}var Q=5173;var Z=2e3;function _e(e){let r=e-7668;return r<0||r>Z?null:`http://localhost:${Q+r}/`}var Te=4001,Oe="sootsim close";var h="http://localhost:5173/";import{existsSync as ee,mkdirSync as re,readFileSync as te,rmSync as B,writeFileSync as ne}from"fs";import{tmpdir as ie}from"os";import{dirname as oe,join as se,resolve as le}from"path";var x=1,G="SOOTSIM_CLI_CURRENT_SIM_PATH",ce=["SOOTSIM_CLI_IDENTITY","TM_SESSION","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"],j=/^(?:tmux|screen)|^tm$/i;function q(e,r=20){let t=e,n=w(e);if(!n||n<=1){let i=E(e);return e>1&&i&&!j.test(i)?e:null}for(let i=0;i<r;i++){let s=E(n);if(s&&j.test(s))return t;let u=w(n);if(!u||u<=1)return s?n:t;t=n,n=u}return n}function v(){for(let r of ce){let t=process.env[r];if(t&&t.trim())return{key:`${r}:${t.trim()}`,source:r,stable:!0}}let e=q(process.ppid);return e&&e>1?{key:`gppid-${e}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function de(){return v().key}function Re(){return q(process.ppid)}function k(){if(process.env[G])return le(process.env[G]);let e=de();return se(ie(),`sootsim-current-sim-${e}.json`)}function ue(){let e=k();if(!ee(e))return null;try{let r=JSON.parse(te(e,"utf8"));return r.version!==x||typeof r.simId!="string"||!r.simId.trim()||typeof r.updatedAt!="string"?(B(e,{force:!0}),null):{version:x,simId:r.simId.trim(),updatedAt:r.updatedAt}}catch{return B(e,{force:!0}),null}}function R(){return ue()?.simId||null}function Ce(e){let r=e.trim();if(!r)return;let t=k();re(oe(t),{recursive:!0}),ne(t,JSON.stringify({version:x,simId:r,updatedAt:new Date().toISOString()},null,2)+`
|
|
5
|
-
`)}function J(){B(k(),{force:!0})}var me="RNX_PLACEMENT";function We(){return process.env[me]==="local-box"?"local-box":"host"}function Y(e){return`ws://localhost:${e}`}var L=null;function M(){return F().filter(e=>W(e))}function X(e){let r=S.resolve(e);for(;;){if(ae.existsSync(S.join(r,".git")))return r;let t=S.dirname(r);if(t===r)return null;r=t}}function K(e,r){let t=S.relative(e,r);return t===""||t!==".."&&!t.startsWith(`..${S.sep}`)&&!S.isAbsolute(t)}function fe(){let e=M();if(e.length===0)return null;if(process.env.SOOTSIM_BRIDGE_PORT!==void 0||process.env.PORT_OFFSET!==void 0){let t=V({explicitPort:process.env.SOOTSIM_BRIDGE_PORT,portOffset:process.env.PORT_OFFSET}),n=e.find(i=>i.bridgePort===t);if(n)return n}let r=null;try{r=process.cwd()}catch{}if(r){let t=X(r),n=e.filter(i=>{let s=X(i.cwd);return t&&s?t===s:K(r,i.cwd)||K(i.cwd,r)});if(n.length>0)return n.find(i=>i.bridgePort===7668)??n[0]}return e.find(t=>t.bridgePort===7668)??e[0]}function ge(){let e=$();if(L?.homeDir===e)return L.world;let r=pe();return L={homeDir:e,world:r},r}function pe(){let e=fe();if(e)return{source:"dev-bridge",bridgePort:e.bridgePort,shellBaseUrl:e.shellPort?`http://localhost:${e.shellPort}/`:h};let r=_();return r&&T(r)?{source:"daemon",bridgePort:r.bridgePort,shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:h}:{source:"default",bridgePort:7668,shellBaseUrl:h}}function he(e){let r=M().find(n=>n.bridgePort===e);if(r)return{source:"dev-bridge",shellBaseUrl:r.shellPort?`http://localhost:${r.shellPort}/`:h};let t=_();return t&&T(t)&&t.bridgePort===e?{source:"daemon",shellBaseUrl:t.runtimePort>0?`http://localhost:${t.runtimePort}/`:h}:null}function He(e){let r;try{let i=new URL(e);r=i.port?Number(i.port):i.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(r)||r<=0)return null;let t=M().find(i=>i.shellPort===r||i.runtimePort===r||i.bridgePort===r);if(t)return t.bridgePort;let n=_();return n&&T(n)&&(n.runtimePort===r||n.bridgePort===r)?n.bridgePort:null}function Se(){return ge().bridgePort}function Ve(e,r){let t=he(e),n=t?.source==="dev-bridge"?"dev bridge":t?.source==="daemon"?"daemon bridge":"bridge",i=t?.source==="dev-bridge"?`dev-bridges/${e}.json`:t?.source==="daemon"?"daemon.json":"no lockfile",s=r??t?.shellBaseUrl;process.stderr.write(` \u2192 ${n} :${e} (${s?`shell ${s}, `:""}${i})
|
|
6
|
-
`)}var A=class extends Error{lock;constructor(r,t){super(r),this.name="BridgeSimLockedError",this.lock=t}};function be(e){return e==="flag"?"via --sim":e==="saved"?"saved via `rnx use`":"primary fallback \u2014 no sim pinned"}function Ge(e,r={}){let t=new Set,n=r.port??Se(),i=r.port!==void 0,s=r.commandTimeoutMs??15e3,u,a="none",I=new Set(r.stripBooleanFlags??[]),P=new Set(r.stripValueFlags??[]);for(let l=0;l<e.length;l++){let o=e[l];if(o==="--port"||o==="-p"){t.add(l),i=!0,l+1<e.length&&(t.add(l+1),n=Number(e[l+1])),l++;continue}if(o.startsWith("--port=")){t.add(l),i=!0,n=Number(o.slice(7));continue}if(o==="--timeout"){t.add(l),l+1<e.length&&(t.add(l+1),s=Number(e[l+1])),l++;continue}if(o==="--sim"||o==="--session"||o==="--tab"){t.add(l),l+1<e.length&&(t.add(l+1),u=e[l+1]?.trim()||void 0,a="flag"),l++;continue}let c=o.startsWith("--sim=")?o.slice(6):o.startsWith("--session=")?o.slice(10):o.startsWith("--tab=")?o.slice(6):void 0;if(c!==void 0){t.add(l),u=c.trim()||void 0,a="flag";continue}if(I.has(o)){t.add(l);continue}P.has(o)&&(t.add(l),l+1<e.length&&t.add(l+1),l++)}if(!u){let l=R();l&&(u=l.trim()||void 0,a="saved")}return{positional:e.filter((l,o)=>!t.has(o)),wsPort:n,explicitPort:i,simId:u,simIdSource:a,commandTimeoutMs:s}}function Ie(e,r={}){let t=1,n=r.commandTimeoutMs??15e3,i=new Map,s=new C(Y(e)),u=v(),a=new Promise((o,c)=>{s.on("open",()=>{try{s.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:u.key,cliIdentitySource:u.source,cliLabel:r.cliLabel}))}catch{}o()}),s.on("error",d=>{let m=d.message?`: ${d.message}`:"";c(new Error(`could not connect to ${Y(e)}${m}`))})});a.catch(()=>{});let I=!1,P=!1;function l(o,c){if(P||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||o.startsWith("bridge:")||o==="focus"||o==="close")return;P=!0;let d=c??"primary",m=be(c?r.simIdSource:"none");process.stderr.write(` \u2192 ${d} (${m})
|
|
7
|
-
`)}return s.on("message",o=>{let c;try{c=JSON.parse(o.toString())}catch{return}if(c.id===0)return;let d=i.get(c.id);d&&(i.delete(c.id),c._otherCliCount>0&&!I&&(I=!0,process.stderr.write(`
|
|
8
|
-
\u26A0 ${c._otherCliCount} other CLI identity/identities are driving this sim
|
|
9
|
-
taps, scrolls, and keyboard input from multiple agents will collide on
|
|
10
|
-
the same screen state (this is not a bridge throughput limit).
|
|
11
|
-
use \`rnx open --new\` for an isolated sim per agent.
|
|
12
|
-
|
|
13
|
-
`)),c.error?c._locked?d.reject(new A(c.error,c._locked)):d.reject(new Error(c.error)):d.resolve(c.result))}),s.on("close",(o,c)=>{let d=c?.toString()||"connection closed";for(let[m,p]of i)i.delete(m),p.reject(new Error(`sim disconnected: ${d} (code ${o})`))}),{async send(o,c){let d=c?.timeoutMs??n,m=async f=>{await a;let g=t++;return new Promise((b,U)=>{let N=setTimeout(()=>{i.delete(g),U(new Error(`command timed out after ${Math.round(d/1e3)}s`))},d);i.set(g,{resolve:O=>{clearTimeout(N),b(O)},reject:O=>{clearTimeout(N),U(O)}});let y={...o,id:g};y.simId===void 0&&f&&(y.simId=f),l(o.type??"",y.simId),s.send(JSON.stringify(y))})},p=r.simIdSource==="flag"?r.simId:R()??r.simId;try{return await m(p)}catch(f){let g=f instanceof Error?f.message:String(f),b=`no sim connected with id ${p}`;throw r.simIdSource!=="flag"&&p&&o.simId===void 0&&(g===b||g.startsWith(`${b};`))?(J(),new Error(`saved sim ${p} is gone${g.slice(b.length)}; run \`rnx list\` and \`rnx use <sim>\`, or open a fresh sim`)):f}},async listSims(){let o=await this.send({type:"bridge:list-sims"});return Array.isArray(o)?o:[]},async focusSim(o){return this.send({type:"focus",simId:o})},async closeSim(o){return this.send({type:"close",simId:o})},async claim(o,c={}){return await this.send({type:"bridge:claim",simId:o,force:c.force===!0})},close(){try{s.readyState===C.OPEN&&s.send(JSON.stringify({type:"bridge:bye",id:0}))}catch{}s.close(),setTimeout(()=>{s.readyState!==C.CLOSED&&s.terminate()},250).unref()}}}function je(e){return Ie(e.wsPort,{commandTimeoutMs:e.commandTimeoutMs,simId:e.simId,simIdSource:e.simIdSource})}function Pe(e,r){let t=e.filter(s=>s.readyState==="open"&&s.id!==r),n=t.find(s=>s.userFocused)??t.find(s=>s.userVisible===!0&&s.isPrimary)??t.find(s=>s.userVisible===!0)??t.find(s=>s.isPrimary);if(!n)return null;let i=[n.isPrimary?"primary":null,n.userVisible===!1?"hidden":n.userVisible===!0?"visible":null,n.userFocused?"focused":null].filter(Boolean);return`${n.id}${i.length?` [${i.join(", ")}]`:""}`}async function qe(e){try{let r=await e.send({type:"evaluate",code:`(() => ({
|
|
14
|
-
hidden: document.hidden,
|
|
15
|
-
visibilityState: document.visibilityState,
|
|
16
|
-
hasFocus: typeof document.hasFocus === 'function' ? document.hasFocus() : null,
|
|
17
|
-
simId: window.__sootsimBridge?.id ?? window.SootSim?.state?.simId ?? null,
|
|
18
|
-
url: location.href
|
|
19
|
-
}))()`}),t=typeof r=="object"&&r!==null?r:{hidden:r===!0};if(t.hidden===!0===!0){let i=null;try{i=Pe(await e.listSims(),t.simId)}catch{}return process.stderr.write(`
|
|
20
|
-
\u26A0 target sim${t.simId?` ${t.simId}`:""} is hidden (document.hidden = true)
|
|
21
|
-
`+(t.visibilityState?` visibility: ${t.visibilityState}
|
|
22
|
-
`:"")+` animations and rAF callbacks are throttled \u2014 coordinates may be wrong
|
|
23
|
-
and launch/transition animations will not complete.
|
|
24
|
-
`+(i?` another open sim looks usable: ${i}; target it with --sim.
|
|
25
|
-
`:" run `rnx list` to find the visible sim and target it with --sim.\n")+` page-level window.focus() cannot unhide a browser tab.
|
|
26
|
-
|
|
27
|
-
`),{hidden:!0,warned:!0,simId:t.simId}}return{hidden:!1,warned:!1,simId:t.simId}}catch{return{hidden:!1,warned:!1}}}async function Je(e,r,t={}){let n={type:"evaluate",code:r};return t.acquireLock&&(n.acquireLock=!0),e.send(n)}async function Ye(e,r,...t){return e.send({type:"call",path:r,args:t})}async function Xe(e,r,...t){return e.send({type:"call",path:r,args:t,acquireLock:!0})}export{ye as a,_e as b,Te as c,Oe as d,de as e,Re as f,R as g,Ce as h,J as i,h as j,me as k,We as l,Y as m,ge as n,he as o,He as p,Se as q,Ve as r,A as s,Ge as t,Ie as u,je as v,qe as w,Je as x,Ye as y,Xe as z};
|
|
@@ -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{execFileSync as m,spawn as g}from"child_process";import{existsSync as s,readdirSync as x}from"fs";import{dirname as h,join as c,resolve as a}from"path";import{fileURLToPath as w}from"url";var l;function p(){if(l!==void 0)return l;try{l=h(w(import.meta.resolve("sootsim-engine/package.json")))}catch{l=null}return l}var k="dev.sootsim.simulator";function v(){let e=p();if(!e)return null;let n=c(e,"dist-electron/main.cjs");if(!s(n))return null;let i=P(e);return i?{path:i,platform:process.platform,kind:"dev-electron",engineDir:e}:null}function I(){let e=p();return e?s(c(e,"src-electron/main.ts")):!1}function P(e){let n=e;for(let i=0;i<6;i++){let r=c(n,"node_modules/.bin/electron");if(s(r))return r;let t=h(n);if(t===n)break;n=t}return null}function b(){let e=p(),i=["/Applications/rnx.app",a(process.env.HOME||"","Applications/rnx.app"),...e?[a(e,"app/rnx.app")]:[]].find(r=>s(r));if(i)return{path:i,platform:"darwin",kind:"mac-app"};try{let r=m("mdfind",[`kMDItemCFBundleIdentifier == "${k}"`],{encoding:"utf8",timeout:3e3}).trim();if(r)return{path:r.split(`
|
|
5
|
-
`)[0],platform:"darwin",kind:"mac-app"}}catch{}return null}function f(e){if(!s(e))return null;let n=x(e).filter(i=>i.startsWith("rnx")&&i.endsWith(".AppImage")).sort().reverse()[0];return n?c(e,n):null}function C(){let e=p(),i=[a(process.env.HOME||"","Applications/rnx.AppImage"),a(process.env.HOME||"",".local/bin/rnx.AppImage"),"/opt/rnx/rnx.AppImage","/opt/rnx/rnx",...e?[a(e,"app/rnx.AppImage"),a(e,"release/linux-unpacked/rnx")]:[]].find(t=>s(t));if(i)return{path:i,platform:"linux",kind:i.endsWith(".AppImage")?"linux-appimage":"linux-binary"};let r=e?f(a(e,"app"))||f(a(e,"release")):null;return r?{path:r,platform:"linux",kind:"linux-appimage"}:null}function D(){for(let e of["HKCU","HKLM"])try{let n=m("reg",["query",`${e}\\Software\\Classes\\rnx\\shell\\open\\command`,"/ve"],{encoding:"utf8",timeout:3e3}),i=/"([^"\r\n]+\.exe)"/i.exec(n)?.[1];if(i&&s(i))return{path:i,platform:"win32",kind:"win-exe"}}catch{}return null}function A(){let e=v();if(e)return e;if(I()){let n=p(),i=c(n,"dist-electron/main.cjs");return s(i)?console.error(` no node_modules/.bin/electron found near ${n}. run \`bun install\`.`):console.error(` dist-electron/main.cjs missing in ${n}.
|
|
6
|
-
run: bun run --cwd packages/sootsim-engine build:electron-main
|
|
7
|
-
(or keep it fresh with: bun run watch:sootsim:electron-main)`),null}return process.platform==="darwin"?b():process.platform==="linux"?C():process.platform==="win32"?D():null}async function d(e,n,i={}){let r=i.inheritStdio?["ignore","inherit","inherit"]:"ignore";await new Promise((t,o)=>{let u=g(e,n,{detached:!0,stdio:r});u.once("error",o),u.once("spawn",()=>{u.unref(),t()})})}async function R(e,n=A(),i={}){if(!n)return{launched:!1};let r=[];if(i.device&&r.push(`--device=${i.device}`),i.profileId&&r.push(`--profile=${i.profileId}`),i.ephemeralProfile&&r.push("--ephemeral-profile"),i.ownerPid&&i.ownerPid>1&&r.push(`--owner-pid=${i.ownerPid}`),n.kind==="mac-app"){let o=["-g","-a",n.path];return e&&o.push(S(e,i)),r.length>0&&o.push("--args",...r),await d("open",o),{launched:!0,via:"mac-app",target:n.path}}if(n.kind==="dev-electron"){let o=["--no-sandbox",n.engineDir||p()];return e&&o.push(e),r.length>0&&o.push(...r),await d(n.path,o,{inheritStdio:!0}),{launched:!0,via:"dev-electron",target:n.path}}let t=[];return e&&t.push(e),r.length>0&&t.push(...r),await d(n.path,t),{launched:!0,via:n.kind,target:n.path}}function S(e,n){if(!n.profileId&&!n.ephemeralProfile&&!n.ownerPid)return e;let i=new URL("rnx://dev");return i.searchParams.set("url",e),n.profileId&&i.searchParams.set("profile",n.profileId),n.ephemeralProfile&&i.searchParams.set("ephemeral","1"),n.ownerPid&&n.ownerPid>1&&i.searchParams.set("ownerPid",String(n.ownerPid)),i.toString()}export{A as a,R 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
|
-
function a(){console.error(" no rnx desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" rnx desktop install"),console.error(""),console.error(" or install the recommended background service:"),console.error(" rnx daemon install"),console.error("")}function t(r){console.error(""),console.error(` no sim is connected to the rnx bridge on port ${r}.`),console.error(""),console.error(" start your app dev server, then open it in rnx:"),console.error(" npx expo start --localhost --port 8081"),console.error(" rnx open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" rnx describe")}async function d(r,n,s){let e=[];try{e=await r.listSims()}catch{}if(console.error(""),e.length===0){t(n);return}console.error(` no sim with id "${s}" is connected to the bridge on port ${n}.`),console.error(""),console.error(" connected sims:");for(let o of e){let i=[o.isPrimary?"primary":null,o.readyState,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":null,o.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${o.id} (${i})`)}console.error(""),console.error(" pass a valid --sim id, or run `rnx list` to see all sessions.")}export{a,t as b,d as c};
|
|
@@ -1,5 +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
|
-
function i(t,o,a,c){return{width:3,ringToggle:{side:"left",top:t[0],height:t[1]},volumeUp:{side:"left",top:o[0],height:o[1]},volumeDown:{side:"left",top:a[0],height:a[1]},lock:{side:"right",top:c[0],height:c[1]}}}var N={width:2.5,lock:{side:"right",top:188.7,height:68.1},ringToggle:{side:"left",top:113.2,height:36},volumeUp:{side:"left",top:188.2,height:68.1},volumeDown:{side:"left",top:269,height:68.1}},S={width:3,lock:{side:"right",top:671/2.625,height:163/2.625},ringToggle:{side:"left",top:-1e3,height:0},volumeUp:{side:"right",top:971/2.625,height:165/2.625},volumeDown:{side:"right",top:1136/2.625,height:166/2.625}},O={width:3,lock:{side:"right",top:248,height:72},ringToggle:{side:"left",top:-1e3,height:0},volumeUp:{side:"right",top:144,height:62},volumeDown:{side:"right",top:216,height:62}},s=24,d="17",u=37,R=1080/2.625,D=2400/2.625,p=132/2.625;function r(t){return{top:t,right:t,bottom:t,left:t}}function _(t){let o=(t.frameInsets.top+t.frameInsets.right+t.frameInsets.bottom+t.frameInsets.left)/4,a=Math.max(Math.abs(t.frameInsets.top-o),Math.abs(t.frameInsets.right-o),Math.abs(t.frameInsets.bottom-o),Math.abs(t.frameInsets.left-o));return{frameRadius:t.cornerRadius+o,frameRadiusApproximationError:a,screenRadius:t.cornerRadius}}function H(t){return{..._(t),frameHeight:t.frameInsets.top+t.height+t.frameInsets.bottom,frameWidth:t.frameInsets.left+t.width+t.frameInsets.right,screenBottomInset:t.frameInsets.bottom,screenLeft:t.frameInsets.left,screenRightInset:t.frameInsets.right,screenTop:t.frameInsets.top}}function n(t){return{...t,platform:"ios",navigationBarHeight:0,navigationBarMode:t.homeIndicatorHeight>0?"gesture":"none",displayCutout:{top:t.dynamicIsland?t.statusBarHeight:0,bottom:0,left:0,right:0},cameraCutout:null,osVersion:t.iosVersion,androidApiLevel:null,systemName:"iOS",manufacturer:"Apple",brand:"Apple",modelName:t.name}}var v={"canvas-workspace":n({name:"Canvas Workspace",width:1440,height:900,scale:1,statusBarHeight:0,homeIndicatorHeight:0,cornerRadius:0,continuousCornerRadius:0,frameInsets:r(16),dynamicIsland:null,safeAreaInsets:{top:0,bottom:0,left:0,right:0},iosVersion:"26.4",physicalPPI:110,hardwareButtons:i([185.8,41.7],[258.2,67.6],[344,67.6],[281.5,106.9]),experimental:!0}),"iphone-se":n({name:"iPhone SE",width:375,height:667,scale:2,statusBarHeight:20,homeIndicatorHeight:0,cornerRadius:0,continuousCornerRadius:0,frameInsets:r(28.7),dynamicIsland:null,safeAreaInsets:{top:20,bottom:0,left:0,right:0},iosVersion:"15.8",physicalPPI:326,hardwareButtons:N}),"iphone-14":n({name:"iPhone 14",width:390,height:844,scale:3,statusBarHeight:47,homeIndicatorHeight:34,cornerRadius:46.2,continuousCornerRadius:67.462,frameInsets:r(19.5),dynamicIsland:null,safeAreaInsets:{top:47,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:i([141.7,29.7],[205.9,69.6],[289.5,69.6],[228.9,114.5])}),"iphone-15":n({name:"iPhone 15",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:73.402,frameInsets:r(18.2),dynamicIsland:{width:126,height:37.3,top:14.1},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:i([171.7,32],[235.8,65.3],[320.5,65.3],[280.6,105.2])}),"iphone-15-plus":n({name:"iPhone 15 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:74.654,frameInsets:r(17.3),dynamicIsland:{width:126,height:37.3,top:11.4},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"17.6",physicalPPI:460,hardwareButtons:i([172.1,33],[236.1,66.6],[321.2,66.6],[281,106.8])}),"iphone-15-pro":n({name:"iPhone 15 Pro",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:73.402,frameInsets:r(15.3),dynamicIsland:{width:126,height:38,top:13.4},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-15-pro-max":n({name:"iPhone 15 Pro Max",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:74.654,frameInsets:r(15.3),dynamicIsland:{width:126,height:38,top:13.3},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"18.2",physicalPPI:460,hardwareButtons:i([173.3,32.2],[253.4,61.7],[343.3,61.7],[268.5,98.5])}),"iphone-16":n({name:"iPhone 16",width:393,height:852,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:73.402,frameInsets:r(15.3),dynamicIsland:{width:126,height:37.3,top:11},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-16-plus":n({name:"iPhone 16 Plus",width:430,height:932,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:53.9,continuousCornerRadius:74.654,frameInsets:r(15.3),dynamicIsland:{width:126,height:37.3,top:11.4},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([173.3,32.2],[253.4,61.7],[343.3,61.7],[268.5,98.5])}),"iphone-16-pro":n({name:"iPhone 16 Pro",width:402,height:874,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:61,continuousCornerRadius:84.661,frameInsets:r(15.3),dynamicIsland:{width:126,height:38,top:13.5},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-16-pro-max":n({name:"iPhone 16 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:61.3,continuousCornerRadius:85.163,frameInsets:r(15.4),dynamicIsland:{width:126,height:38,top:14},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([178.8,32.2],[266.8,61.8],[352.7,61.8],[292.2,98.3])}),"iphone-17":n({name:"iPhone 17",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:61,continuousCornerRadius:84.661,frameInsets:r(15.3),dynamicIsland:{width:126,height:37.3,top:14},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-17-air":n({name:"iPhone Air",width:420,height:912,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:64.6,continuousCornerRadius:88.313,frameInsets:r(10.7),dynamicIsland:{width:126,height:38,top:20},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([178.8,32.2],[266.8,61.8],[352.7,61.8],[292.2,98.3])}),"iphone-17-pro":n({name:"iPhone 17 Pro",width:402,height:874,scale:3,statusBarHeight:59,homeIndicatorHeight:34,cornerRadius:61,continuousCornerRadius:84.661,frameInsets:r(15.3),dynamicIsland:{width:126,height:38,top:14},safeAreaInsets:{top:59,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([159.1,31.5],[220.1,61.9],[299,61.9],[260.8,98.9])}),"iphone-17-pro-max":n({name:"iPhone 17 Pro Max",width:440,height:956,scale:3,statusBarHeight:62,homeIndicatorHeight:34,cornerRadius:61.3,continuousCornerRadius:85.163,frameInsets:r(15.4),dynamicIsland:{width:126,height:38,top:14},safeAreaInsets:{top:62,bottom:34,left:0,right:0},iosVersion:"26.4",physicalPPI:460,hardwareButtons:i([178.8,32.2],[266.8,61.8],[352.7,61.8],[292.2,98.3])}),"pixel-8":{platform:"android",name:"Pixel 8",width:R,height:D,scale:2.625,statusBarHeight:p,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:p,bottom:0,left:0,right:0},cornerRadius:39,continuousCornerRadius:39,frameInsets:{top:55/2.625,right:50/2.625,bottom:58/2.625,left:49/2.625},dynamicIsland:null,cameraCutout:{diameter:72.5/2.625},safeAreaInsets:{top:p,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:S},"pixel-8-three-button":{platform:"android",name:"Pixel 8 (3-button)",width:R,height:D,scale:2.625,statusBarHeight:p,homeIndicatorHeight:0,navigationBarHeight:48,navigationBarMode:"three-button",displayCutout:{top:p,bottom:0,left:0,right:0},cornerRadius:39,continuousCornerRadius:39,frameInsets:{top:55/2.625,right:50/2.625,bottom:58/2.625,left:49/2.625},dynamicIsland:null,cameraCutout:{diameter:72.5/2.625},safeAreaInsets:{top:p,bottom:48,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 8",physicalPPI:428,hardwareButtons:S},"pixel-9-pro-xl":{platform:"android",name:"Pixel 9 Pro XL",width:448,height:997,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:41,continuousCornerRadius:41,frameInsets:r(12),dynamicIsland:null,cameraCutout:{diameter:24},safeAreaInsets:{top:40,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 9 Pro XL",physicalPPI:486,hardwareButtons:S},"pixel-10":{platform:"android",name:"Pixel 10",width:360,height:808,scale:3,statusBarHeight:40,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:40,bottom:0,left:0,right:0},cornerRadius:40,continuousCornerRadius:40,frameInsets:r(18),dynamicIsland:null,cameraCutout:{diameter:26},safeAreaInsets:{top:40,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Google",brand:"google",modelName:"Pixel 10",physicalPPI:422,hardwareButtons:S},"galaxy-s24":{platform:"android",name:"Galaxy S24",width:360,height:780,scale:3,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:36,continuousCornerRadius:36,frameInsets:r(8),dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S921B",physicalPPI:416,hardwareButtons:O},"galaxy-s24-ultra":{platform:"android",name:"Galaxy S24 Ultra",width:384,height:832,scale:3.75,statusBarHeight:36,homeIndicatorHeight:0,navigationBarHeight:s,navigationBarMode:"gesture",displayCutout:{top:36,bottom:0,left:0,right:0},cornerRadius:24,continuousCornerRadius:24,frameInsets:r(9),dynamicIsland:null,cameraCutout:{diameter:18},safeAreaInsets:{top:36,bottom:s,left:0,right:0},osVersion:d,iosVersion:"",androidApiLevel:u,systemName:"Android",manufacturer:"Samsung",brand:"samsung",modelName:"SM-S928B",physicalPPI:505,hardwareButtons:O}},P="iphone-17-pro",j={ios:P,android:"pixel-10"};function L(t){return v[t]}function A(){return Object.keys(v)}function W(){return A().filter(t=>!v[t].experimental)}function K(t){return L(t).platform}var F="rnx",$=Object.freeze({name:F,packageName:"rnxsim",commandName:"rnx",domain:"rnxsim.com",origin:"https://rnxsim.com"});var k=["off","soft","full"];function B(t){return t==="off"||t==="soft"||t==="full"}var w={"iphone-6-9":{name:"iphone-6-9",label:'iPhone 6.7"',width:1284,height:2778,store:"apple"},"iphone-6-1":{name:"iphone-6-1",label:'iPhone 6.5"',width:1242,height:2688,store:"apple"},"android-phone":{name:"android-phone",label:"Google Play phone",width:1080,height:1920,store:"google"},"android-tablet-7":{name:"android-tablet-7",label:'Google Play 7" tablet',width:1200,height:1920,store:"google"},"android-tablet-10":{name:"android-tablet-10",label:'Google Play 10" tablet',width:1600,height:2560,store:"google"}},I={dark:{type:"gradient",direction:180,glow:"#4caeff",stops:[{offset:0,color:"#111827"},{offset:40,color:"#101725"},{offset:100,color:"#06080d"}]},cyan:{type:"gradient",direction:180,glow:"#25c3ec",stops:[{offset:0,color:"#1b465c"},{offset:32,color:"#122336"},{offset:100,color:"#05070b"}]},gold:{type:"gradient",direction:180,glow:"#ffc25a",stops:[{offset:0,color:"#3b2f1a"},{offset:34,color:"#18140d"},{offset:100,color:"#050505"}]},red:{type:"gradient",direction:180,glow:"#ff6178",stops:[{offset:0,color:"#3e1018"},{offset:35,color:"#17080c"},{offset:100,color:"#050405"}]}},Z={color:"#25c3ec",blur:120,spread:52,opacity:.34},Q="iphone-17-pro";var V=[{name:"white",value:"#ffffff"},{name:"gray-light",value:"#d1d5db"},{name:"gray",value:"#6b7280"},{name:"gray-dark",value:"#3b4350"},{name:"slate",value:"#2a3644"},{name:"black",value:"#000000"},{name:"cyan",value:"#25c3ec"},{name:"blue",value:"#3f7cff"},{name:"teal",value:"#1fc7b4"},{name:"green",value:"#42c95d"},{name:"lime",value:"#92d21b"},{name:"gold",value:"#f5c518"},{name:"orange",value:"#ff912e"},{name:"coral",value:"#ff6f5b"},{name:"red",value:"#ff4f6f"},{name:"berry",value:"#d054ff"},{name:"magenta",value:"#ff4eb8"}],M=Object.fromEntries(V.map(t=>[t.name,t.value]));function J(t){return M[t]??M.gray}function ee(t){return Object.prototype.hasOwnProperty.call(w,t)?w[t]:null}function z(t){return{type:t.type,color:t.color,direction:t.direction,glow:t.glow,stops:t.stops?.map(o=>({...o}))}}function te(t){return Object.prototype.hasOwnProperty.call(I,t)?z(I[t]):null}var G=[.823,.882,.941,1,1.118,1.235,1.353,1.786,2.143,2.643,3.143,3.571];function e(t,o){return Object.freeze({fontSize:t,lineHeight:o})}var re=Object.freeze({xs:Object.freeze({largeTitle:e(31,44.408775),title1:e(25,37.128102),title2:e(19,27.816685),title3:e(17,23.807109),headline:e(14,20.161577),body:e(14,20.161577),callout:e(13,18.942243),subheadline:e(12,16.720313),footnote:e(12,16.986979),caption1:e(11,15.564453),caption2:e(11,16.126953)}),s:Object.freeze({largeTitle:e(32,45.797256),title1:e(26,38.556756),title2:e(20,29.22433),title3:e(18,25.160469),headline:e(15,21.536754),body:e(15,21.536754),callout:e(14,20.326079),subheadline:e(13,18.213672),footnote:e(12,16.986979),caption1:e(11,15.564453),caption2:e(11,16.126953)}),m:Object.freeze({largeTitle:e(33,47.185737),title1:e(27,39.985409),title2:e(21,30.631975),title3:e(19,26.513828),headline:e(16,22.911932),body:e(16,22.911932),callout:e(15,21.709914),subheadline:e(14,19.557031),footnote:e(12,16.986979),caption1:e(11,15.564453),caption2:e(11,16.126953)}),l:Object.freeze({largeTitle:e(34,48.574219),title1:e(28,41.414063),title2:e(22,32.253906),title3:e(20,27.867187),headline:e(17,24.287109),body:e(17,24.287109),callout:e(16,23.09375),subheadline:e(15,20.900391),footnote:e(13,18.513672),caption1:e(12,17.320313),caption2:e(11,16.126953)}),xl:Object.freeze({largeTitle:e(36,51.351181),title1:e(30,44.271369),title2:e(24,35.069196),title3:e(22,30.733906),headline:e(19,27.037464),body:e(19,27.037464),callout:e(18,25.861421),subheadline:e(17,23.587109),footnote:e(15,21.233724),caption1:e(14,20.269531),caption2:e(13,19.667518)}),xxl:Object.freeze({largeTitle:e(38,54.323266),title1:e(32,47.128676),title2:e(26,37.884487),title3:e(24,33.440625),headline:e(21,29.78782),body:e(21,29.78782),callout:e(20,28.629092),subheadline:e(19,26.273828),footnote:e(17,23.953776),caption1:e(16,23.03125),caption2:e(15,22.515775)}),xxxl:Object.freeze({largeTitle:e(40,57.100229),title1:e(34,50.221278),title2:e(28,40.699777),title3:e(26,36.147344),headline:e(23,32.719993),body:e(23,32.719993),callout:e(22,31.58724),subheadline:e(21,28.960547),footnote:e(19,26.673828),caption1:e(18,25.792969),caption2:e(17,25.364032)}),ax1:Object.freeze({largeTitle:e(44,62.654154),title1:e(38,56.171186),title2:e(34,49.359933),title3:e(31,43.074141),headline:e(28,39.595881),body:e(28,39.595881),callout:e(26,37.122582),subheadline:e(25,34.483984),footnote:e(23,32.280599),caption1:e(22,31.316406),caption2:e(20,29.636418)}),ax2:Object.freeze({largeTitle:e(48,68.403201),title1:e(43,63.314453),title2:e(39,56.612444),title3:e(37,51.194297),headline:e(33,46.653587),body:e(33,46.653587),callout:e(32,45.616071),subheadline:e(30,41.200781),footnote:e(27,37.720703),caption1:e(26,37.027344),caption2:e(24,35.332933)}),ax3:Object.freeze({largeTitle:e(52,73.957127),title1:e(48,70.693015),title2:e(44,63.65067),title3:e(43,59.474453),headline:e(40,56.461648),body:e(40,56.461648),callout:e(38,54.109561),subheadline:e(36,49.410937),footnote:e(33,46.047526),caption1:e(32,45.5),caption2:e(29,42.684345)}),ax4:Object.freeze({largeTitle:e(56,79.706174),title1:e(53,77.600988),title2:e(50,72.310826),title3:e(49,67.754609),headline:e(47,65.360618),body:e(47,66.269709),callout:e(44,62.412574),subheadline:e(42,57.621094),footnote:e(38,53.014323),caption1:e(37,52.404297),caption2:e(34,50.035757)}),ax5:Object.freeze({largeTitle:e(60,85.260099),title1:e(58,85.214844),title2:e(56,80.970982),title3:e(55,76.034766),headline:e(53,74.520774),body:e(53,74.520774),callout:e(51,72.2899),subheadline:e(49,67.174609),footnote:e(44,61.174479),caption1:e(43,60.876953),caption2:e(40,58.811298)})});function E(t){return G.some(o=>Object.is(o,t))}var ce=["colorScheme","reduceMotion","boldText","fontSize","largerAccessibilitySizes"],l={deviceModel:{type:"enum",default:P,description:"device model to simulate",cliFlag:"device",cliFlagShort:"d",options:A(),group:"device"},orientation:{type:"enum",default:"portrait",description:"screen orientation",cliFlag:"orientation",options:["portrait","landscape"],group:"device"},colorScheme:{type:"enum",default:"auto",description:"color scheme (auto follows system preference)",cliFlag:"theme",cliFlagShort:"t",options:["light","dark","auto"],group:"appearance"},reduceMotion:{type:"boolean",default:!1,description:"reduce motion",group:"appearance"},boldText:{type:"boolean",default:!1,description:"bold text",group:"appearance"},fontSize:{type:"number",default:1,description:"font size multiplier (1.0 = default)",group:"appearance",validate:t=>t>=.5&&t<=4},largerAccessibilitySizes:{type:"boolean",default:!1,description:"show accessibility categories in the dynamic type size picker",group:"appearance"},networkCondition:{type:"enum",default:"wifi",description:"simulated network condition",cliFlag:"network",options:["wifi","lte","fast-3g","slow-3g","offline"],group:"network"},language:{type:"string",default:"en",description:"language code (ISO 639-1)",cliFlag:"language",group:"locale"},region:{type:"string",default:"US",description:"region code (ISO 3166-1)",cliFlag:"region",group:"locale"},renderDensity:{type:"number",default:0,description:"render density override in device pixels per point for high-resolution capture (0 = destination display capped at device native)",group:"simulator",validate:t=>t===0||t>=1&&t<=9},showTouches:{type:"boolean",default:!1,description:"show touch indicators",group:"simulator"},showFrame:{type:"boolean",default:!0,description:"show device frame",cliFlag:"frame",group:"simulator"},showMenuBar:{type:"boolean",default:!0,description:"keep the menu bar visible instead of revealing it at the top edge",group:"simulator"},showRail:{type:"boolean",default:!0,description:"keep the rail visible instead of revealing it on hover",group:"simulator"},solidWindow:{type:"boolean",default:!1,description:"desktop app: always use the solid, freely-resizable window instead of the device-shaped transparent one (3d mode uses it regardless)",group:"simulator"},ambientGlow:{type:"enum",default:"off",description:"bleed the app's own edge colors outward behind the device, like bias lighting behind a TV (off, soft, full)",options:k,cliFlag:"ambient-glow",group:"simulator"},screenshotMode:{type:"boolean",default:!1,description:"show screenshot composition mode in the browser shell",group:"simulator"},screenshotCanvasEditing:{type:"boolean",default:!1,description:"experimental figma-style slide editing: draggable copy block, drop-in image layers (owner review pending)",group:"simulator"},threeMode:{type:"boolean",default:!1,description:"show the experimental 3d device stage in the browser shell",group:"simulator"},threeRecordingEditor:{type:"boolean",default:!1,description:"dock the 3d recording editor in the 3d stage (toggled from its rail)",group:"simulator"},screenshotCanvas:{type:"enum",default:"iphone-6-9",description:"target app-store canvas preset for screenshot mode",options:Object.keys(w),group:"simulator"},screenshotBackground:{type:"enum",default:"dark",description:"background preset rendered inside the screenshot canvas",options:Object.keys(I),group:"simulator"},screenshotText:{type:"enum",default:"bold-top",description:"text layout preset for the screenshot canvas",options:["bold-top","editorial-left","minimal-bottom","none"],group:"simulator"},screenshotPose:{type:"enum",default:"straight",description:"device pose preset inside the screenshot canvas",options:["straight","tilted-left","tilted-right","cut-bottom","cut-top"],group:"simulator"},screenshotDynamicSize:{type:"boolean",default:!1,description:"let the screenshot canvas rect fit available space (off = pin to exact preset pixels)",group:"simulator"},showStatusBar:{type:"boolean",default:!0,description:"show status bar",group:"simulator"},showHomeIndicator:{type:"boolean",default:!0,description:"show home indicator",group:"simulator"},alwaysShowLiveWebViews:{type:"boolean",default:!1,description:"always render WebViews as live browser views",group:"simulator"},a11yMode:{type:"enum",default:"delayed",description:"accessibility tree sync mode (off, delayed=100ms, active=30ms)",options:["off","delayed","active"],group:"simulator"},a11yDepth:{type:"enum",default:"deep",description:"accessibility tree structure depth (shallow or deep)",options:["shallow","deep"],group:"simulator"},inspectMode:{type:"boolean",default:!1,description:"inspect mode",group:"simulator"},productAnalytics:{type:"boolean",default:!1,description:"send bounded product usage analytics",group:"privacy"},crashReports:{type:"boolean",default:!1,description:"send anonymous crash reports",group:"privacy"},agentProvider:{type:"enum",default:"codex",description:"ai agent used by the sootsim agent prompt bar",options:["codex","claude"],group:"agent"}},de={colorScheme:l.colorScheme.default,reduceMotion:l.reduceMotion.default,boldText:l.boldText.default,fontSize:l.fontSize.default,largerAccessibilitySizes:l.largerAccessibilitySizes.default};function U(){if(typeof window>"u")return{};let t={};try{let o=new URLSearchParams(window.location.search),a=o.get("device");a&&l.deviceModel.options?.includes(a)&&(t.deviceModel=a);let c=o.get("orientation");(c==="portrait"||c==="landscape")&&(t.orientation=c),o.get("ssMode")==="1"&&(t.screenshotMode=!0),o.get("filmStage")==="1"&&(t.threeMode=!0,a||(t.deviceModel="iphone-17-air"));let h=Number(o.get("renderDensity"));Number.isFinite(h)&&h>=1&&h<=9&&(t.renderDensity=h),o.get("ssEdit")==="1"&&(t.screenshotCanvasEditing=!0);let x=o.get("colorScheme")??o.get("theme");x&&l.colorScheme.options?.includes(x)&&(t.colorScheme=x);let m=o.get("reduceMotion");m==="1"||m==="true"?t.reduceMotion=!0:(m==="0"||m==="false")&&(t.reduceMotion=!1);let g=o.get("boldText");g==="1"||g==="true"?t.boldText=!0:(g==="0"||g==="false")&&(t.boldText=!1);let C=Number(o.get("fontSize"));Number.isFinite(C)&&E(C)&&(t.fontSize=C);let f=o.get("largerAccessibilitySizes");f==="1"||f==="true"?t.largerAccessibilitySizes=!0:(f==="0"||f==="false")&&(t.largerAccessibilitySizes=!1);let b=o.get("alwaysShowLiveWebViews");b==="1"||b==="true"?t.alwaysShowLiveWebViews=!0:(b==="0"||b==="false")&&(t.alwaysShowLiveWebViews=!1);let y=o.get("showFrame");y==="1"||y==="true"?t.showFrame=!0:(y==="0"||y==="false")&&(t.showFrame=!1);let T=o.get("ambientGlow");B(T)&&(t.ambientGlow=T)}catch{}return t}function ue(){let t={};for(let[o,a]of Object.entries(l))t[o]=a.default;return Object.assign(t,U()),t}export{H as a,v as b,j as c,L as d,W as e,K as f,Z as g,Q as h,J as i,ee as j,z as k,te as l,ce as m,l as n,de as o,U as p,ue as q};
|
|
5
|
-
/*! rnx v0.1.376 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,5 +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 P}from"child_process";import{readFileSync as a}from"fs";import{createRequire as d}from"module";var s=null,p=null;function k(r){s||(s=w());try{return s(r)}catch{return null}}function x(r){p||(p=_());try{return p(r)}catch{return null}}function _(){if(process.platform==="linux")return r=>{try{return a(`/proc/${r}/comm`,"utf8").trim()||null}catch{return null}};if(process.platform==="darwin"){let r=B();return r||(t=>b().get(t)?.comm||null)}return()=>null}function w(){let r=Number(process.env.PPID);if(Number.isFinite(r)&&r>1&&r!==process.ppid)return()=>r;if(process.platform==="linux")return C();if(process.platform==="darwin"){let t=h();return t||(n=>{let o=b().get(n)?.ppid;return o!==void 0&&o>0?o:null})}return()=>null}var L=2e3,i={readAt:0,rows:new Map};function b(){let r=Date.now();if(i.readAt&&r-i.readAt<L)return i.rows;let t=new Map;try{let n=P("ps",["-eo","pid=,ppid=,comm="],{encoding:"utf8",timeout:5e3,maxBuffer:8388608,stdio:["ignore","pipe","ignore"]});for(let o of n.split(`
|
|
5
|
-
`)){let e=o.trim().match(/^(\d+)\s+(\d+)\s+(.*)$/);e&&t.set(Number(e[1]),{ppid:Number(e[2]),comm:(e[3].split("/").at(-1)??"").slice(0,g)})}}catch{}return i={readAt:r,rows:t},t}function C(){return r=>{try{let t=a(`/proc/${r}/stat`,"utf8"),n=t.lastIndexOf(")");if(n<0)return null;let o=t.slice(n+1).trim().split(/\s+/),e=Number(o[1]);return Number.isFinite(e)&&e>0?e:null}catch{return null}}}var y=3,l=216,I=16,f=48,g=16;function h(){if(!process.versions?.bun)return null;try{let r=d(import.meta.url),{dlopen:t,FFIType:n}=r("bun:ffi"),o=t("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[n.i32,n.i32,n.u64,n.ptr,n.i32],returns:n.i32}}),e=Buffer.alloc(l);return c=>{if(Number(o.symbols.proc_pidinfo(c,y,0n,e,l))<=0)return null;let u=e.readUInt32LE(I);return u>0?u:null}}catch{return null}}function B(){if(!process.versions?.bun)return null;try{let r=d(import.meta.url),{dlopen:t,FFIType:n}=r("bun:ffi"),o=t("/usr/lib/libproc.dylib",{proc_pidinfo:{args:[n.i32,n.i32,n.u64,n.ptr,n.i32],returns:n.i32}}),e=Buffer.alloc(l);return c=>{if(Number(o.symbols.proc_pidinfo(c,y,0n,e,l))<=0)return null;let u=e.subarray(f,f+g),m=u.indexOf(0);return u.subarray(0,m<0?u.length:m).toString("utf8")||null}}catch{return null}}export{k as a,x 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{d as P,m,n as S,o as R,p as _,q as v}from"./chunk-DGJMIVZM.js";var k="sootsim:settings",d=["productAnalytics","crashReports","colorScheme","reduceMotion","boldText","fontSize","largerAccessibilitySizes","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","alwaysShowLiveWebViews","showFrame","showMenuBar","showRail","solidWindow","ambientGlow","agentProvider"];function p(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function l(e){let t={};for(let n of d){if(!(n in e))continue;let o=e[n],i=S[n];i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||(t[n]=o)}return t}function K(e){let t={};for(let n of d)t[n]=e[n];return t}function M(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(k);return e?l(JSON.parse(e)):{}}catch{return{}}}function T(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(k,JSON.stringify(e))}catch{}}function x(){let t=p()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:l(t)}function A(e){let t=p();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:e})}catch{}}async function L(e){let t=p();return t?.writeSharedConfig?(await t.writeSharedConfig({settings:e}),!0):!1}function b(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function O(){let e=b()?.settings;return!e||typeof e!="object"?{}:l(e)}function B(e){if(!b())return;let t={settings:e};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}async function F(e){if(!b()||typeof fetch>"u")return!1;let t=await fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:e}),keepalive:!0});if(!t.ok)throw new Error(`shared settings reset failed with HTTP ${t.status}`);return await t.text(),!0}function D(){let e=M(),t=O(),n=x();return{...e,...t,...n}}function V(e,t={}){let n=K(e);for(let o of d)t[o]!==void 0&&(n[o]=t[o]);T(n),A(n),B(n)}async function I(e,t={}){let n=K(e);for(let o of d)t[o]!==void 0&&(n[o]=t[o]);T(n),!await L(n)&&await F(n)}function j(e){if(typeof window>"u")return()=>{};let t=r=>{if(!(r.key!==k||r.newValue==null))try{e(l(JSON.parse(r.newValue)))}catch{}};window.addEventListener("storage",t);let n=p(),o;n?.onSharedConfigChanged&&(o=n.onSharedConfigChanged(r=>{let f=r?.settings;!f||typeof f!="object"||e(l(f))}));let a=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(r=>{let f=r?.settings;!f||typeof f!="object"||e(l(f))});return()=>{window.removeEventListener("storage",t),o?.(),a?.()}}var N=_(),q=v(),y=D(),c=new Set,g={};for(let e of d)N[e]!==void 0&&(c.add(e),y[e]!==void 0&&(g[e]=y[e]),delete y[e]);var s={...q,...y},w=[],u=null;function h(){for(let e of w)e()}function E(){h(),V(s,g)}function C(e,t){let n=S[e];return n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]===t?!1:(s={...s,[e]:t},e==="deviceModel"&&(u=null),!0)}j(e=>{let t={...s},n=!1;for(let[o,i]of Object.entries(e)){let a=o;if(c.has(a)){g[a]=i;continue}t[a]!==i&&(t[a]=i,n=!0)}n&&(s=t,u=null,h())});var z={get(e){return s[e]},set(e,t){C(e,t)&&E()},setRuntime(e,t){c.has(e)||(c.add(e),d.includes(e)&&(g[e]=s[e])),C(e,t)&&h()},isRuntimeControlled(e){return c.has(e)},getAll(){return s},apply(e){let t=!1,n={...s};for(let[o,i]of Object.entries(e)){if(i===void 0)continue;let a=o,r=S[a];r&&(r.validate&&!r.validate(i)||r.options&&!r.options.includes(i)||n[a]!==i&&(n[a]=i,t=!0))}t&&(s=n,u=null,E())},applyRuntime(e){let t=!1;for(let n of Object.keys(e)){let o=e[n];o!==void 0&&(c.has(n)||(c.add(n),d.includes(n)&&(g[n]=s[n])),C(n,o)&&(t=!0))}t&&h()},reset(){s=v(),u=null,E()},async resetDeviceContent(){let e=m.filter(n=>!c.has(n)).map(n=>[n,R[n]]),t=e.some(([n,o])=>s[n]!==o);s={...s,...Object.fromEntries(e)};for(let n of m)c.has(n)&&(g[n]=R[n]);t&&h(),await I(s,g)},subscribe(e){return w.push(e),()=>{w=w.filter(t=>t!==e)}},getDeviceSpec(){return u||(u=P(s.deviceModel)),u},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{z as a};
|
|
@@ -1,5 +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-DGJMIVZM.js";var i=[];for(let[t,e]of Object.entries(n))e.cliFlag&&i.push({name:`--${e.cliFlag}`,short:e.cliFlagShort?`-${e.cliFlagShort}`:void 0,key:t,type:e.type==="enum"?"string":e.type,description:e.description,options:e.options,default:e.default});var a=i;function g(){let t=[];for(let e of a){let s=e.short?`${e.short}, ${e.name}`:` ${e.name}`,o=e.options?` [${e.options.join("|")}]`:"",r=e.default!==void 0?` (default: ${e.default})`:"";t.push(` ${s.padEnd(24)}${e.description}${o}${r}`)}return t.join(`
|
|
5
|
-
`)}export{g 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 c}from"./chunk-GZE57ORL.js";import{a as f}from"./chunk-CE4JQJ6Y.js";import{a as i}from"./chunk-5YZYDEMI.js";import{createRequire as p}from"node:module";import s from"node:path";import{createJiti as a}from"jiti";var g=p(import.meta.url);function r(e){return e===void 0||e!==null&&typeof e=="object"&&!Array.isArray(e)}function l(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Reflect.get(e,"runtimeVersion"),o=Reflect.get(e,"network");return(t===void 0||typeof t=="string"&&t===t.trim()&&f(t))&&r(Reflect.get(e,"modules"))&&r(Reflect.get(e,"turboModules"))&&r(Reflect.get(e,"nativeModules"))&&r(Reflect.get(e,"env"))&&r(o)&&r(Reflect.get(e,"settings"))&&r(Reflect.get(e,"initialState"))}function d(e,t){if(!e.modules)return e;let o=s.dirname(t);return{...e,modules:Object.fromEntries(Object.entries(e.modules).map(([m,n])=>[m,n&&typeof n=="object"&&"file"in n?{...n,file:s.resolve(o,n.file)}:n]))}}async function u(e){if(e?.configPath)try{let o=await a(import.meta.url,{interopDefault:!0,alias:{[`${i.packageName}/config`]:g.resolve(`${i.packageName}/config`)}}).import(e.configPath,{default:!0});if(!l(o))throw new Error("the default export must be an rnx config object");return d(o,e.configPath)}catch(t){let o=t instanceof Error?t.message:String(t);throw new Error(`could not load ${e.configPath}: ${o}`)}}async function b(e=process.cwd()){let t=c(e);return{project:t,config:await u(t)}}export{u as a,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
|
-
var t=Object.freeze({id:"ios",displayName:"iOS",isIOS:!0,isAndroid:!1,select:e=>e.ios}),r=Object.freeze({id:"android",displayName:"Android",isIOS:!1,isAndroid:!0,select:e=>e.android}),i=Object.freeze({ios:t,android:r});
|
|
@@ -1,32 +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 G,b as V,c as W,d as v}from"./chunk-RVEB4CZ2.js";import{a as L}from"./chunk-H3U56DKI.js";import{r as F}from"./chunk-4TQ5HOK3.js";import{a as M}from"./chunk-DCS5FK5N.js";import{b as Y,c as g}from"./chunk-VZIK4WIS.js";import{f as c}from"./chunk-CE4JQJ6Y.js";import{c as B}from"./chunk-J2IKAEU2.js";import{a as p,b as C,c as y,d as h,f as E,g as a,h as w,i as f,j as N}from"./chunk-BEU7CD7E.js";import{a as A}from"./chunk-W3FNXAQP.js";import{D as O,E as j,F as $,G as T,M as I,l as P}from"./chunk-QRDF33WD.js";import{a as q}from"./chunk-XSVILA4Z.js";import J from"node:os";import K from"node:path";async function Pe(e,n={}){if(e.includes("--help")||e.includes("-h")){ue();return}let r=ee(e),o=n.launchConnectRN??(!r.ci&&!r.yes&&!r.json&&!r.dryRun&&process.stdin.isTTY);try{ce(r);let t=G(r.appDir),i=Y(),z=$(),R=await te(r,i);!R&&!i.installed&&!r.json&&console.log(` ${y("Enable it later with")} ${p("rnx daemon install")}`);let u=await oe(r),Q=r.json?await c.fetchManifest():await w("Checking the rnx runtime",()=>c.fetchManifest()),l=c.resolveVersion(Q,{channel:"stable"}).version,b=q();if(b==="0.0.0")throw new Error("could not resolve the installed rnx CLI version");let S=!1;if(!r.dryRun){let d=I(),x=()=>c.install({version:l,channel:"stable",setActive:!0,protectVersions:d?[d]:[]});S=(r.json?await x():await w(`Preparing runtime ${l}`,x)).installed}let D=i.installed;R&&!i.installed&&!r.dryRun&&(r.json?await g({port:7668,force:!1}):(console.log(`
|
|
5
|
-
${p("\u25C6")} ${C("Enabling the background service")}`),await g({port:7668,force:!1})),D=!0),u==="electron"&&!r.dryRun&&!M()&&await L(["--yes"]),o&&(console.log(`
|
|
6
|
-
${p("\u25C6")} Opening ConnectRN`),await F(["ConnectRN","--driver",u,"--no-describe","--quiet"]));let X=await ie(r,z),Z=!1,s=t?V({appDir:t,cliVersion:b}):null,m=await se(r,s);if(m&&s){if(!r.json)for(let d of v(s))console.log(` ${y(r.dryRun?"Would run":"Running")} ${d}`);await W(s,{dryRun:r.dryRun,json:r.json})}r.dryRun||(T({productAnalytics:X,crashReports:Z}),j(u));let k={runtimeVersion:l,serviceInstalled:D,repositoryPrepared:m,simulatorDriver:u};return r.json?console.log(JSON.stringify({...k,runtimeInstalled:S,dryRun:r.dryRun,cache:ae(l),repositoryOperations:m&&s?v(s):[]},null,2)):console.log(`
|
|
7
|
-
${h("\u2713")} ${o?"ConnectRN is open. ":""}rnx is ready.`),k}catch(t){throw B(t),t}}function ee(e){let n=e.indexOf("--app"),r=n>=0?e[n+1]:void 0;if(n>=0&&(!r||r.startsWith("-")))throw new Error("--app requires a directory");return{appDir:K.resolve(r??process.cwd()),ci:e.includes("--ci")||A(),dryRun:e.includes("--dry-run"),json:e.includes("--json"),yes:e.includes("--yes")||e.includes("-y"),service:H(e,"--service","--no-service"),repository:H(e,"--repo","--no-repo"),productAnalytics:ne(e,"--analytics"),simulatorDriver:re(e)}}function re(e){let n=e.includes("--desktop"),r=e.includes("--browser");if(n&&r)throw new Error("--desktop and --browser cannot be used together");if(n)return"electron";if(r)return"playwright"}function H(e,n,r){if(e.includes(n)&&e.includes(r))throw new Error(`${n} and ${r} cannot be used together`);if(e.includes(n))return!0;if(e.includes(r))return!1}function ne(e,n){let r=e.find(i=>i.startsWith(`${n}=`)),o=e.indexOf(n),t=r?.slice(n.length+1)??(o>=0?e[o+1]:void 0);if(t!==void 0){if(t==="on"||t==="yes"||t==="true")return!0;if(t==="off"||t==="no"||t==="false")return!1;throw new Error(`${n} must be on or off`)}}async function te(e,n){if(e.ci){if(e.service===!0)throw new Error("--ci cannot install a machine service");return!1}return n.supported?n.installed&&e.service===void 0?(e.json||console.log(` ${h("\u2713")} Background service is ready`),!0):e.service!==void 0?e.service:e.yes?!0:(U(e,"--service or --no-service"),a("Background service",["Keeps the local bridge and runtime ready between commands.","Agent inspection, interaction, and test commands start much faster."]),f("Enable the background service?",!0)):(e.json||a("Background service",["The persistent service is currently available on macOS and Linux.","rnx will start the bridge when needed on this platform."]),!1)}async function oe(e){if(e.simulatorDriver)return e.simulatorDriver;let n=O();if(n)return n;if(e.ci||e.yes)return"playwright";U(e,"--desktop or --browser");let r=process.platform==="darwin"?"Desktop downloads a DMG and installs rnx.app.":process.platform==="win32"?"Desktop downloads and runs the rnx installer.":"Desktop downloads the matching rnx AppImage.",o=process.platform==="darwin"?"Desktop app Installs rnx.app from a DMG":process.platform==="win32"?"Desktop app Runs the rnx installer":"Desktop app Installs the matching AppImage";return a("Simulator window",["Browser opens immediately in an isolated Chrome window.",r,"The Desktop app opens in a dedicated native window."]),await N("Where should rnx open?",["Browser (recommended) No additional download",o])===0?"playwright":"electron"}async function ie(e,n){return e.productAnalytics!==void 0?e.productAnalytics:n.configured?n.productAnalytics:e.yes||e.ci||!process.stdin.isTTY?!1:(a("Private by default",["Diagnostics stay off unless you opt in.","Reports can contain package compatibility or an error class.","They never contain your code or app data."]),f("Share bounded diagnostics to improve rnx?",!1))}async function se(e,n){if(!n){if(e.repository===!0)throw new Error("--repo requires a package.json inside a Git repository");return!1}return n.operations.length===0?!0:e.repository!==void 0?e.repository:e.yes||e.ci||!process.stdin.isTTY?!1:(a("Share rnx with your team",["rnx already works here with no project setup.","This only adds an exact rnxsim dev dependency and an rnx script for teammates."]),f(`Add rnx to ${K.basename(n.appDir)}?`,!1))}function U(e,n){if(!(process.stdin.isTTY&&!e.ci))throw new Error(`non-interactive setup requires ${n}, or --yes to accept defaults`)}function ae(e){let n=J.platform(),r=J.arch();return{path:P(e),key:`sootsim-runtime-${n}-${r}-${e}`,inputs:{platform:n,arch:r,runtimeVersion:e}}}function ce(e){e.json||E("Run any React Native app in a local simulator. No project setup required.")}function ue(){console.log(`
|
|
8
|
-
rnx setup - configure optional local conveniences
|
|
9
|
-
|
|
10
|
-
rnx works without project setup. This command can enable the faster background
|
|
11
|
-
service, choose Browser or Desktop, configure private diagnostics, and optionally
|
|
12
|
-
add an exact rnxsim dependency plus an rnx script for teammates.
|
|
13
|
-
|
|
14
|
-
usage:
|
|
15
|
-
rnx setup
|
|
16
|
-
rnx setup --yes
|
|
17
|
-
rnx setup --ci --yes --json
|
|
18
|
-
rnx setup --dry-run --yes
|
|
19
|
-
|
|
20
|
-
choices:
|
|
21
|
-
--service | --no-service
|
|
22
|
-
--desktop | --browser
|
|
23
|
-
--analytics on|off
|
|
24
|
-
--repo | --no-repo
|
|
25
|
-
|
|
26
|
-
automation:
|
|
27
|
-
--yes accept recommended machine defaults; diagnostics and repo changes stay off
|
|
28
|
-
--ci never prompt or install a background service
|
|
29
|
-
--json emit runtime and cache metadata as JSON
|
|
30
|
-
--dry-run show choices and repository operations without changing anything
|
|
31
|
-
--app DIR inspect DIR for an optional repository installation
|
|
32
|
-
`)}export{Pe 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 i from"node:fs";import r from"node:path";var e=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"],p=["sootsim.config.ts","sootsim.config.js","sootsim.config.mjs","sootsim.config.cjs"];function c(n,t){for(let o of t){let s=r.join(n,o);try{if(i.statSync(s).isFile())return s}catch{}}return null}function f(n){return c(n,e)}function l(n){return c(n,p)}function u(n){let t=r.resolve(n);try{if(!i.statSync(t).isDirectory())return null}catch{return null}let o=l(t);return!o&&!f(t)&&!i.existsSync(r.join(t,"package.json"))?null:{appDir:t,configPath:o}}export{u as a};
|