rnxsim 0.1.366 → 0.1.368
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 +14 -2
- package/cli/bin.ts +18 -0
- package/cli/bridge-flow-runner.ts +14 -151
- package/cli/commands/assert.ts +1 -1
- package/cli/commands/box/checkout-plane.ts +126 -0
- package/cli/commands/box/rnx-command.ts +68 -0
- package/cli/commands/box.ts +200 -0
- package/cli/commands/control.ts +12 -32
- package/cli/commands/do-chain.ts +412 -0
- package/cli/commands/flow.ts +0 -10
- package/cli/commands/inspect/core.ts +302 -725
- package/cli/commands/inspect/describe.ts +3 -76
- package/cli/commands/inspect/find.ts +3 -6
- package/cli/commands/inspect/get-layout.ts +14 -1
- package/cli/commands/inspect/resolve-target.ts +41 -47
- package/cli/commands/inspect/shared.ts +28 -123
- package/cli/commands/inspect/tree.ts +6 -15
- package/cli/commands/inspect/wait-ready.ts +2 -2
- package/cli/commands/inspect/wait-selector.ts +4 -8
- package/cli/commands/inspect.ts +23 -17
- package/cli/commands/install-desktop.ts +44 -7
- package/cli/commands/maestro-generate.ts +0 -2
- package/cli/commands/platform.ts +68 -0
- package/cli/commands/state.ts +5 -2
- package/cli/outbound-endpoints.ts +6 -1
- package/cli/parse-args.ts +13 -2
- package/cli/ws-bridge.ts +30 -2
- package/detox/index.ts +34 -17
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-SO6IOPRK.js → agent-GXCQMYV4.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-PMYCB2KO.js → agent-wrapper-Y3PQAL6I.js} +2 -2
- package/dist-cli/chunks/{app-fonts-LULQGFY7.js → app-fonts-MDD3W4VN.js} +2 -2
- package/dist-cli/chunks/{assert-WGNCD4ZU.js → assert-BSRQBRH7.js} +3 -3
- package/dist-cli/chunks/{auth-G7CCHH3M.js → auth-SLPHDPCF.js} +2 -2
- package/dist-cli/chunks/{beta-N4LXL5TO.js → beta-R4IZ5SWO.js} +2 -2
- package/dist-cli/chunks/box-2NQYYY3B.js +1709 -0
- package/dist-cli/chunks/{camera-4JHCYBQS.js → camera-ER66WWAX.js} +2 -2
- package/dist-cli/chunks/chunk-2YK5J2D2.js +24 -0
- package/dist-cli/chunks/{chunk-I6KIM6PN.js → chunk-3MPFC3DS.js} +1 -1
- package/dist-cli/chunks/{chunk-77ZHQJZR.js → chunk-3S2J6IVC.js} +2 -2
- package/dist-cli/chunks/chunk-3XMEIZEV.js +4 -0
- package/dist-cli/chunks/chunk-42TLK75A.js +497 -0
- package/dist-cli/chunks/{chunk-OW5XHAA4.js → chunk-4FLQYRGN.js} +1 -1
- package/dist-cli/chunks/{chunk-EFR5DVNP.js → chunk-4VA2ISWX.js} +1 -1
- package/dist-cli/chunks/chunk-57LITN73.js +7 -0
- package/dist-cli/chunks/{chunk-EQK5MJCU.js → chunk-7B22IPSC.js} +2 -2
- package/dist-cli/chunks/{chunk-EGAGZHO6.js → chunk-7V3S2DY2.js} +1 -1
- package/dist-cli/chunks/{chunk-IZKHOM37.js → chunk-AUPJX4KI.js} +1 -1
- package/dist-cli/chunks/{chunk-2S7BKUP2.js → chunk-BWJOLJOK.js} +2 -2
- package/dist-cli/chunks/{chunk-CN6XYYEA.js → chunk-CKNNO6ZG.js} +27 -27
- package/dist-cli/chunks/{chunk-MGDSJZ37.js → chunk-DJSPNOF6.js} +2 -2
- package/dist-cli/chunks/{chunk-YXXKSL6R.js → chunk-E6XYIIJK.js} +1 -1
- package/dist-cli/chunks/{chunk-ONORMKWX.js → chunk-ECXDCED5.js} +2 -2
- package/dist-cli/chunks/chunk-EHA65UVJ.js +5 -0
- package/dist-cli/chunks/chunk-ESVUVW3R.js +32 -0
- package/dist-cli/chunks/{chunk-XJU2QIRY.js → chunk-FDAFSRQE.js} +2 -2
- package/dist-cli/chunks/{chunk-NM2L2QV4.js → chunk-FSPZY4AI.js} +2 -2
- package/dist-cli/chunks/chunk-FVODUDPS.js +4 -0
- package/dist-cli/chunks/{chunk-H23KWIKA.js → chunk-GFWUIGGY.js} +2 -2
- package/dist-cli/chunks/{chunk-CTG7HBCA.js → chunk-GS5VUDCF.js} +1 -1
- package/dist-cli/chunks/{chunk-ORWP2E7R.js → chunk-GXHCJRKE.js} +2 -2
- package/dist-cli/chunks/{chunk-TTASWLKM.js → chunk-HKQXGCQT.js} +1 -1
- package/dist-cli/chunks/{chunk-5OK3LCEJ.js → chunk-IXRVFQMT.js} +2 -2
- package/dist-cli/chunks/{chunk-TIAEYO6I.js → chunk-JFGW75UL.js} +2 -2
- package/dist-cli/chunks/{chunk-RYIMSKDO.js → chunk-JHYXRORU.js} +2 -2
- package/dist-cli/chunks/chunk-LAKWOJ5Y.js +5 -0
- package/dist-cli/chunks/{chunk-GAJQSITE.js → chunk-LPAOOJIW.js} +1 -1
- package/dist-cli/chunks/chunk-M7COA4BE.js +312 -0
- package/dist-cli/chunks/{chunk-6PL2CCGP.js → chunk-MCO7V4VN.js} +2 -2
- package/dist-cli/chunks/{chunk-YGMEDJKJ.js → chunk-MGOAQHMO.js} +2 -2
- package/dist-cli/chunks/chunk-NERY6HGZ.js +4 -0
- package/dist-cli/chunks/chunk-NGWUGNPV.js +4 -0
- package/dist-cli/chunks/{chunk-ZMJ75EDG.js → chunk-NPSPWMBO.js} +2 -2
- package/dist-cli/chunks/{chunk-2UXU53MG.js → chunk-OXCDE3DD.js} +1 -1
- package/dist-cli/chunks/{chunk-ZLVRYXZ7.js → chunk-OZJMWTGA.js} +1 -1
- package/dist-cli/chunks/{chunk-HT6GFZOZ.js → chunk-PNBQBBG5.js} +1 -1
- package/dist-cli/chunks/{chunk-JHXETDVC.js → chunk-Q65KH25G.js} +1 -1
- package/dist-cli/chunks/{chunk-NQFJOCSF.js → chunk-QKOY7UW5.js} +2 -2
- package/dist-cli/chunks/{chunk-5DAIA77C.js → chunk-QMVBWZH2.js} +2 -2
- package/dist-cli/chunks/chunk-RRALQ4WM.js +38 -0
- package/dist-cli/chunks/{chunk-GXAB52K7.js → chunk-SHMLYTNH.js} +2 -2
- package/dist-cli/chunks/chunk-SSUPPM6K.js +130 -0
- package/dist-cli/chunks/chunk-T2MGLXY5.js +27 -0
- package/dist-cli/chunks/{chunk-ZJIS3CTW.js → chunk-T4ZZ26A2.js} +2 -2
- package/dist-cli/chunks/{chunk-YCCCPFWT.js → chunk-TC6DNQL6.js} +2 -2
- package/dist-cli/chunks/chunk-TE645QCO.js +423 -0
- package/dist-cli/chunks/{chunk-UCHW7ZHR.js → chunk-TOE5O6JE.js} +2 -2
- package/dist-cli/chunks/{chunk-N3UC7HIX.js → chunk-TPIPKXJL.js} +1 -1
- package/dist-cli/chunks/chunk-UBH2BWCY.js +4 -0
- package/dist-cli/chunks/{chunk-AFV32WZT.js → chunk-UXROQPIN.js} +3 -3
- package/dist-cli/chunks/{chunk-SA6XVI55.js → chunk-WF2CRNYF.js} +1 -1
- package/dist-cli/chunks/chunk-WFAFAGMG.js +4 -0
- package/dist-cli/chunks/{chunk-A5FXX5PJ.js → chunk-WJQB6AXZ.js} +1 -1
- package/dist-cli/chunks/{chunk-5NMCF5VF.js → chunk-WVVAYLWZ.js} +1 -1
- package/dist-cli/chunks/chunk-WXRDFUR7.js +4 -0
- package/dist-cli/chunks/{chunk-M3BNCF7E.js → chunk-X5MXQB3L.js} +2 -2
- package/dist-cli/chunks/{chunk-LN3RNW6X.js → chunk-YSHJ3LMQ.js} +2 -2
- package/dist-cli/chunks/{chunk-34IQM22N.js → chunk-YYPTSF6W.js} +15 -15
- package/dist-cli/chunks/{cleanup-KRIATKFH.js → cleanup-WHGLBAJ2.js} +2 -2
- package/dist-cli/chunks/cli-version-DMXIXBIM.js +4 -0
- package/dist-cli/chunks/{compat-6PTQ3QEA.js → compat-MGBKGYGQ.js} +2 -2
- package/dist-cli/chunks/{config-ETGDUANO.js → config-TRDOMP4T.js} +2 -2
- package/dist-cli/chunks/connect-N4FV3DDV.js +4 -0
- package/dist-cli/chunks/control-5GRBZVYK.js +4 -0
- package/dist-cli/chunks/daemon-MBT5E3ZC.js +4 -0
- package/dist-cli/chunks/{debug-WIIB6ZKC.js → debug-AHEK43AJ.js} +3 -3
- package/dist-cli/chunks/{desktop-TD7Q5LNB.js → desktop-LDRIXOVV.js} +3 -3
- package/dist-cli/chunks/{detox-7GNR33VM.js → detox-6HAKYISO.js} +2 -2
- package/dist-cli/chunks/{device-QOR3PGUF.js → device-QM3S7OVU.js} +2 -2
- package/dist-cli/chunks/{diagnose-RRCBLP6E.js → diagnose-WDP3CVIX.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-MJUGJPXT.js → disk-cleanup-JRT5MKFW.js} +2 -2
- package/dist-cli/chunks/do-chain-7FDMO56C.js +5 -0
- package/dist-cli/chunks/drivers-AJL2EVXH.js +4 -0
- package/dist-cli/chunks/env-YIBOMB24.js +4 -0
- package/dist-cli/chunks/{film-D7Y64LID.js → film-R3EQADMG.js} +3 -3
- package/dist-cli/chunks/flow-BDAA6BWL.js +4 -0
- package/dist-cli/chunks/help-5EJD6LJF.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-JGURVR2Z.js → hidden-runtime-alias-6M4UERRQ.js} +2 -2
- package/dist-cli/chunks/{home-paths-4ICFIGXO.js → home-paths-QJNOHZJO.js} +2 -2
- package/dist-cli/chunks/inspect-S3LR3R2A.js +4 -0
- package/dist-cli/chunks/install-desktop-GXE6K7BJ.js +4 -0
- package/dist-cli/chunks/{login-RU33QR2G.js → login-ISWDW4WU.js} +2 -2
- package/dist-cli/chunks/{logout-2IUG3Y5J.js → logout-VNJX2IEW.js} +2 -2
- package/dist-cli/chunks/{maestro-2MXTGG7I.js → maestro-SQS2OS2D.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-2PYIFGLR.js → maestro-generate-GWVPISG5.js} +5 -5
- package/dist-cli/chunks/{mode-3DAPG3HF.js → mode-3URDGBZB.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-BWSDJF2Z.js → optional-demo-registry-L3LRBQHG.js} +2 -2
- package/dist-cli/chunks/{perf-2TKPWB4N.js → perf-XLPC4UKR.js} +2 -2
- package/dist-cli/chunks/{permissions-5CSMHYNA.js → permissions-QRHWVMDP.js} +2 -2
- package/dist-cli/chunks/platform-F47URZNB.js +6 -0
- package/dist-cli/chunks/privacy-BF23T67T.js +4 -0
- package/dist-cli/chunks/{record-I2HJCFP3.js → record-2DN3OUE5.js} +3 -3
- package/dist-cli/chunks/{report-issue-A4FZWBOC.js → report-issue-D3BQPSLU.js} +2 -2
- package/dist-cli/chunks/reset-T5CNZ7D3.js +4 -0
- package/dist-cli/chunks/resolve-target-KAAS274S.js +4 -0
- package/dist-cli/chunks/runtime-AQJDBR3X.js +4 -0
- package/dist-cli/chunks/{screenshot-command-UFW5BFHP.js → screenshot-command-RK7IJHVK.js} +3 -3
- package/dist-cli/chunks/{screenshot-layers-5BIAL4YN.js → screenshot-layers-DP2QKSMN.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-EHYS3BV2.js → screenshots-capture-MA7P3FUT.js} +2 -2
- package/dist-cli/chunks/{serve-O4FDM3AC.js → serve-UBXNGLNP.js} +3 -3
- package/dist-cli/chunks/setup-GH7OW4GC.js +4 -0
- package/dist-cli/chunks/sim-client-VTKFEDJX.js +4 -0
- package/dist-cli/chunks/{skills-ZK55SY32.js → skills-HPK25R4B.js} +2 -2
- package/dist-cli/chunks/state-273XJPUE.js +14 -0
- package/dist-cli/chunks/{storage-WP33ISEM.js → storage-RTDFWIY7.js} +2 -2
- package/dist-cli/chunks/store-DLKNNM4L.js +4 -0
- package/dist-cli/chunks/telemetry-7CWDXEOO.js +4 -0
- package/dist-cli/chunks/{timeline-DKGW5S4I.js → timeline-IF2PGK7C.js} +2 -2
- package/dist-cli/chunks/{upgrade-LL7G4B7G.js → upgrade-R74NVHKG.js} +2 -2
- package/dist-cli/chunks/upload-3JFFVCZ4.js +4 -0
- package/dist-cli/chunks/{version-YLWR5G4F.js → version-RTFCYQZ7.js} +2 -2
- package/dist-cli/chunks/{web-QELZ4CP6.js → web-35SSKBRU.js} +2 -2
- package/dist-cli/chunks/welcome-N5V352SE.js +5 -0
- package/dist-cli/chunks/{what-happened-MIOMZWM5.js → what-happened-WXTP6EPR.js} +2 -2
- package/dist-cli/chunks/ws-bridge-JXQUAWFA.js +4 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +336 -0
- package/dist-lib/bridge-contract-input.mjs +303 -0
- package/dist-lib/bridge-contract.cjs +29 -1
- package/dist-lib/bridge-contract.mjs +19 -0
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +32 -18
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +5 -1
- 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 +214 -594
- 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 +1 -1
- package/dist-lib/profiles.cjs +1 -1
- 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 +1 -1
- package/dist-lib/sdk.cjs +273 -657
- package/dist-lib/sdk.mjs +271 -652
- package/dist-lib/skills.cjs +190 -287
- package/dist-lib/vite.cjs +1 -1
- package/package.json +9 -6
- package/skills/contrast/SKILL.md +3 -0
- package/skills/rnx-debug/SKILL.md +8 -0
- package/skills/rnx-test/SKILL.md +21 -0
- package/src/bridge-contract-input.ts +359 -0
- package/src/bridge-contract.ts +121 -1
- package/src/host/bridge-host.ts +7 -12
- package/src/index.ts +7 -0
- package/src/sim-client.ts +12 -3
- package/dist-cli/chunks/chunk-3X6IBUBX.js +0 -38
- package/dist-cli/chunks/chunk-7B37IZBN.js +0 -15
- package/dist-cli/chunks/chunk-DMPF2D24.js +0 -4
- package/dist-cli/chunks/chunk-DW37EVX5.js +0 -767
- package/dist-cli/chunks/chunk-DWFIH7CB.js +0 -32
- package/dist-cli/chunks/chunk-GUI3PDH2.js +0 -27
- package/dist-cli/chunks/chunk-KLF3K6ZZ.js +0 -4
- package/dist-cli/chunks/chunk-M5QCGLXR.js +0 -944
- package/dist-cli/chunks/chunk-M6SKQGAN.js +0 -5
- package/dist-cli/chunks/chunk-NAYLPOC5.js +0 -24
- package/dist-cli/chunks/chunk-VIND4SP3.js +0 -124
- package/dist-cli/chunks/chunk-XXNLYR64.js +0 -5
- package/dist-cli/chunks/chunk-ZFM24DOX.js +0 -4
- package/dist-cli/chunks/cli-version-SYGNHGFR.js +0 -4
- package/dist-cli/chunks/control-RBTNOLQM.js +0 -4
- package/dist-cli/chunks/daemon-N3SC5DK6.js +0 -4
- package/dist-cli/chunks/drivers-W6E3BZH4.js +0 -4
- package/dist-cli/chunks/flow-7QAE2V5Y.js +0 -4
- package/dist-cli/chunks/help-NLD6KWVG.js +0 -4
- package/dist-cli/chunks/inspect-C347BG52.js +0 -4
- package/dist-cli/chunks/install-desktop-YR6TWZYK.js +0 -4
- package/dist-cli/chunks/privacy-PWWC2BXO.js +0 -4
- package/dist-cli/chunks/reset-Y3PBPFYA.js +0 -4
- package/dist-cli/chunks/runtime-IC6NVVGA.js +0 -4
- package/dist-cli/chunks/setup-Y4QGSJBM.js +0 -4
- package/dist-cli/chunks/state-KFLAZNEY.js +0 -14
- package/dist-cli/chunks/store-VEE22CAY.js +0 -4
- package/dist-cli/chunks/telemetry-PZV4BISJ.js +0 -4
- package/dist-cli/chunks/upload-Y4C3YZDK.js +0 -4
- package/dist-cli/chunks/welcome-ZPKA5PZJ.js +0 -5
- package/dist-lib/mcp.cjs +0 -673
- package/dist-lib/mcp.mjs +0 -641
- package/src/mcp.ts +0 -791
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/*! rnx v0.1.368 | (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,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.368 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as c}from"./chunk-
|
|
4
|
+
import{a as c}from"./chunk-PNBQBBG5.js";import{a as f}from"./chunk-3S2J6IVC.js";import{a as i}from"./chunk-WVVAYLWZ.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};
|