rnxsim 0.1.353 → 0.1.354
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/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-YTAX6OQQ.js → agent-FB7RPXO6.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-2QSUXMNK.js → agent-wrapper-LFU3XEIG.js} +2 -2
- package/dist-cli/chunks/{app-fonts-4EVHPXVG.js → app-fonts-FK6SETRG.js} +2 -2
- package/dist-cli/chunks/{assert-IXMSQLVY.js → assert-3KQYZDDK.js} +2 -2
- package/dist-cli/chunks/{auth-6QFWU2T5.js → auth-RFE3J27C.js} +2 -2
- package/dist-cli/chunks/{beta-27I5WWRE.js → beta-XVY4WOYH.js} +2 -2
- package/dist-cli/chunks/{camera-4HFUBXPM.js → camera-JROBX5GM.js} +2 -2
- package/dist-cli/chunks/{chunk-7V5O6I4Q.js → chunk-24DA3Y2Z.js} +1 -1
- package/dist-cli/chunks/{chunk-LMFAIAA5.js → chunk-37S36DFW.js} +1 -1
- package/dist-cli/chunks/{chunk-DSBUGNC5.js → chunk-3QLERZYJ.js} +2 -2
- package/dist-cli/chunks/{chunk-YQJOM55S.js → chunk-3RW6W3ZO.js} +1 -1
- package/dist-cli/chunks/{chunk-T2ZZSSCP.js → chunk-4AQCDL24.js} +2 -2
- package/dist-cli/chunks/{chunk-IX7W5BXL.js → chunk-4OS3SXPZ.js} +2 -2
- package/dist-cli/chunks/{chunk-UNBVUOIC.js → chunk-766UIGCS.js} +2 -2
- package/dist-cli/chunks/{chunk-57YZEJ6J.js → chunk-77CBLMD4.js} +1 -1
- package/dist-cli/chunks/{chunk-6JBOKETZ.js → chunk-7WANPS3W.js} +2 -2
- package/dist-cli/chunks/{chunk-HZTWQZUD.js → chunk-ATQPDEED.js} +2 -2
- package/dist-cli/chunks/{chunk-MA5E6HJR.js → chunk-B7OMSJXC.js} +2 -2
- package/dist-cli/chunks/{chunk-R4KBCGXX.js → chunk-BAWV2UEF.js} +3 -3
- package/dist-cli/chunks/{chunk-TX2T5KPQ.js → chunk-BNXXNT3I.js} +2 -2
- package/dist-cli/chunks/{chunk-JVVO63QH.js → chunk-CKKDXTKV.js} +1 -1
- package/dist-cli/chunks/{chunk-WU25RTIX.js → chunk-CUK6Y2RR.js} +2 -2
- package/dist-cli/chunks/{chunk-3IWR7KHR.js → chunk-ENPWD62S.js} +2 -2
- package/dist-cli/chunks/{chunk-ZXHAAVTH.js → chunk-EWPX6LEN.js} +2 -2
- package/dist-cli/chunks/{chunk-YYYWU6LL.js → chunk-FEHHM2LV.js} +3 -3
- package/dist-cli/chunks/{chunk-LAFKQUT7.js → chunk-FPH4TYZO.js} +3 -3
- package/dist-cli/chunks/{chunk-PNQ33FJB.js → chunk-GNKXRXND.js} +2 -2
- package/dist-cli/chunks/{chunk-CYS3D7RG.js → chunk-GYGDIT5V.js} +2 -2
- package/dist-cli/chunks/{chunk-4NPZ5FO2.js → chunk-HIYCRDUP.js} +2 -2
- package/dist-cli/chunks/{chunk-HWMBTYJX.js → chunk-HUU7ZUQK.js} +2 -2
- package/dist-cli/chunks/{chunk-5DLBRZAG.js → chunk-IGV4KCCM.js} +2 -2
- package/dist-cli/chunks/{chunk-7SKQRS74.js → chunk-IICFLREN.js} +1 -1
- package/dist-cli/chunks/{chunk-RMOSWLWG.js → chunk-IUL2WUWW.js} +2 -2
- package/dist-cli/chunks/{chunk-ELBDKQK2.js → chunk-JJOHJNUQ.js} +2 -2
- package/dist-cli/chunks/{chunk-HVLZYUGF.js → chunk-JT435OOM.js} +2 -2
- package/dist-cli/chunks/{chunk-3XDGLCNP.js → chunk-JT4IMNCO.js} +2 -2
- package/dist-cli/chunks/{chunk-WTGQUQ32.js → chunk-JWXAXCC6.js} +2 -2
- package/dist-cli/chunks/{chunk-3UXMNDMH.js → chunk-JXNR2KAB.js} +2 -2
- package/dist-cli/chunks/{chunk-VLI54BKH.js → chunk-LC77IVGY.js} +2 -2
- package/dist-cli/chunks/{chunk-V7X543SB.js → chunk-LCPZNPIB.js} +1 -1
- package/dist-cli/chunks/{chunk-WKQ6W74M.js → chunk-LETVUC6M.js} +1 -1
- package/dist-cli/chunks/{chunk-WV3TKN7D.js → chunk-LRVL5MAX.js} +1 -1
- package/dist-cli/chunks/{chunk-ZJ4O636U.js → chunk-MIK6LMG4.js} +1 -1
- package/dist-cli/chunks/{chunk-KIQVNLVD.js → chunk-N3CE6AZP.js} +2 -2
- package/dist-cli/chunks/{chunk-6NE5Z6KG.js → chunk-OKFSCCFC.js} +1 -1
- package/dist-cli/chunks/{chunk-BK5TJXUU.js → chunk-P4GCLNFM.js} +2 -2
- package/dist-cli/chunks/{chunk-ZF53H457.js → chunk-PHIYWV44.js} +2 -2
- package/dist-cli/chunks/{chunk-RRX5RZI2.js → chunk-QQNNY43R.js} +1 -1
- package/dist-cli/chunks/{chunk-ZYGWIVW4.js → chunk-QRYTCPNO.js} +2 -2
- package/dist-cli/chunks/{chunk-XVLYLZOM.js → chunk-SLD2EMLZ.js} +2 -2
- package/dist-cli/chunks/{chunk-GAYCF2O5.js → chunk-THFM2CFT.js} +1 -1
- package/dist-cli/chunks/{chunk-ECIDT6F5.js → chunk-TJRKLRNP.js} +1 -1
- package/dist-cli/chunks/{chunk-CMQIFA4L.js → chunk-UAYXEP74.js} +1 -1
- package/dist-cli/chunks/{chunk-PBTG4UCS.js → chunk-UI2IFVHB.js} +1 -1
- package/dist-cli/chunks/{chunk-OEU2MEZQ.js → chunk-UVIWE3LD.js} +1 -1
- package/dist-cli/chunks/{chunk-UQBXA3AK.js → chunk-UX6D4X6B.js} +2 -2
- package/dist-cli/chunks/{chunk-VZDW2U64.js → chunk-X2DJK3TB.js} +2 -2
- package/dist-cli/chunks/{chunk-KZLGVYCX.js → chunk-Y4GUWO3X.js} +1 -1
- package/dist-cli/chunks/{chunk-37J74ASV.js → chunk-YATZ7U4S.js} +1 -1
- package/dist-cli/chunks/{chunk-7FUSVOMH.js → chunk-YIUIFZAE.js} +2 -2
- package/dist-cli/chunks/{chunk-4PV6QASJ.js → chunk-YXBNGSG6.js} +1 -1
- package/dist-cli/chunks/{chunk-UEILOAPW.js → chunk-ZJUFI3R7.js} +1 -1
- package/dist-cli/chunks/{chunk-4IXIONDR.js → chunk-ZNABCRWX.js} +2 -2
- package/dist-cli/chunks/{cleanup-ULH3BHAE.js → cleanup-F74ISXJC.js} +2 -2
- package/dist-cli/chunks/cli-version-VSDCFXXN.js +4 -0
- package/dist-cli/chunks/{compat-ONN5DOHB.js → compat-C3RGYGXL.js} +2 -2
- package/dist-cli/chunks/{config-OPZU73MX.js → config-CDY2RB7Q.js} +2 -2
- package/dist-cli/chunks/{control-WNYEAI4K.js → control-J35HAFZA.js} +2 -2
- package/dist-cli/chunks/daemon-DLLEODJY.js +4 -0
- package/dist-cli/chunks/{debug-GNI3HDAK.js → debug-3P2DUTUQ.js} +3 -3
- package/dist-cli/chunks/{desktop-DF65PDJG.js → desktop-XIXW34VW.js} +3 -3
- package/dist-cli/chunks/{detox-N267KW2Y.js → detox-KAKTJ4P4.js} +2 -2
- package/dist-cli/chunks/{device-RFU44PE3.js → device-4MAWLZMR.js} +2 -2
- package/dist-cli/chunks/{diagnose-XR2JIGDE.js → diagnose-A3R7HUYA.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-DPY6TYXA.js → disk-cleanup-5R7JYCO6.js} +2 -2
- package/dist-cli/chunks/drivers-BB3BRKDS.js +4 -0
- package/dist-cli/chunks/{film-NQQZPZ2W.js → film-GY5U752Q.js} +3 -3
- package/dist-cli/chunks/flow-ALMSRBVL.js +4 -0
- package/dist-cli/chunks/help-3ZL7MRUX.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-APCBIXJ6.js → hidden-runtime-alias-HSGN3GN4.js} +2 -2
- package/dist-cli/chunks/{home-paths-27GY5EPD.js → home-paths-BIUN4CBO.js} +2 -2
- package/dist-cli/chunks/inspect-RCU7XVAO.js +4 -0
- package/dist-cli/chunks/install-desktop-LYVKLTCU.js +4 -0
- package/dist-cli/chunks/{login-6KIO5FR4.js → login-WKNMS4GG.js} +2 -2
- package/dist-cli/chunks/{logout-WMCYGTYA.js → logout-6UFUOESK.js} +2 -2
- package/dist-cli/chunks/{maestro-7QLOUZIE.js → maestro-SJGV7B3W.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-QIGCQANR.js → maestro-generate-PMF2LLKX.js} +3 -3
- package/dist-cli/chunks/{mode-3H662MUJ.js → mode-MN7LZCLB.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-FQV54ASP.js → optional-demo-registry-HFA27YSP.js} +2 -2
- package/dist-cli/chunks/{perf-KC6LOGFD.js → perf-XGANSJT3.js} +2 -2
- package/dist-cli/chunks/{permissions-UGVHA3L6.js → permissions-25UWEJKW.js} +2 -2
- package/dist-cli/chunks/privacy-SIDMP5EF.js +4 -0
- package/dist-cli/chunks/{record-V72Q363I.js → record-MA3AI752.js} +3 -3
- package/dist-cli/chunks/{report-issue-MILOOCMG.js → report-issue-4DTESWE2.js} +2 -2
- package/dist-cli/chunks/reset-GPHG5XN3.js +4 -0
- package/dist-cli/chunks/runtime-VOEIOODA.js +4 -0
- package/dist-cli/chunks/{screenshot-command-FYMZF5AF.js → screenshot-command-JUXMWXS5.js} +3 -3
- package/dist-cli/chunks/{screenshot-layers-OXLW6GEJ.js → screenshot-layers-DJF2E4PE.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-N3LKTUKB.js → screenshots-capture-UGZU5GOW.js} +2 -2
- package/dist-cli/chunks/{serve-USDREK3N.js → serve-H7GNKJSM.js} +2 -2
- package/dist-cli/chunks/setup-G2WYLPM6.js +4 -0
- package/dist-cli/chunks/{skills-3MIZF3DS.js → skills-4JGPOSFE.js} +2 -2
- package/dist-cli/chunks/{state-MCFLWQHV.js → state-DEAQFKVP.js} +2 -2
- package/dist-cli/chunks/{storage-KXNS5WEC.js → storage-Y6F5NTGH.js} +2 -2
- package/dist-cli/chunks/store-3EQT7VU6.js +4 -0
- package/dist-cli/chunks/telemetry-FANCQHKG.js +4 -0
- package/dist-cli/chunks/{timeline-QJ3USMSX.js → timeline-HOHYYDOC.js} +2 -2
- package/dist-cli/chunks/{upgrade-LXFD4DFX.js → upgrade-QF5YHLSG.js} +2 -2
- package/dist-cli/chunks/upload-QKJHFAX7.js +4 -0
- package/dist-cli/chunks/{version-D5DLNPHP.js → version-PDCKYJLB.js} +2 -2
- package/dist-cli/chunks/{web-FRFNTTZ4.js → web-C5EUAFFW.js} +2 -2
- package/dist-cli/chunks/welcome-3CQ2GE4F.js +5 -0
- package/dist-cli/chunks/{what-happened-FJ6GRQAS.js → what-happened-L56ZFIMJ.js} +2 -2
- 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.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -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 +1 -1
- 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 +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/dist-cli/chunks/cli-version-I2E56I4W.js +0 -4
- package/dist-cli/chunks/daemon-5J6V2GLG.js +0 -4
- package/dist-cli/chunks/drivers-OIZC544W.js +0 -4
- package/dist-cli/chunks/flow-3NHEHRF4.js +0 -4
- package/dist-cli/chunks/help-VACWNWEH.js +0 -4
- package/dist-cli/chunks/inspect-2JELKZ5A.js +0 -4
- package/dist-cli/chunks/install-desktop-4R7UTGQU.js +0 -4
- package/dist-cli/chunks/privacy-E6KH2DRJ.js +0 -4
- package/dist-cli/chunks/reset-LEL5ZGFN.js +0 -4
- package/dist-cli/chunks/runtime-RT2OTIQC.js +0 -4
- package/dist-cli/chunks/setup-QC7W7NCL.js +0 -4
- package/dist-cli/chunks/store-GL6DFPJL.js +0 -4
- package/dist-cli/chunks/telemetry-OOW5FMZQ.js +0 -4
- package/dist-cli/chunks/upload-EUEO4D5N.js +0 -4
- package/dist-cli/chunks/welcome-YYYGS5WD.js +0 -5
package/dist-cli/bin.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! rnx v0.1.
|
|
2
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
3
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
4
4
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
5
|
-
import{a as g,b as f}from"./chunks/chunk-
|
|
5
|
+
import{a as g,b as f}from"./chunks/chunk-37S36DFW.js";import{a as m}from"./chunks/chunk-UI2IFVHB.js";import"./chunks/chunk-QQNNY43R.js";function A(a){let t=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(t)||t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("multiple sims are connected:")||t.startsWith("saved sim ")||t.startsWith("no sim connected with id ")||t.startsWith("could not connect to ws://")||t.startsWith("rnx bridge daemon is not running")||t.startsWith("rnx bridge lockfile is fresh")||t.startsWith("rnx bridge exited before becoming ready")||t.startsWith(`${m.commandName} open: requested bridge port`)||t.startsWith("background daemon setup is unavailable")||t.startsWith("rnx bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${t}
|
|
6
6
|
`),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
|
|
7
7
|
`):process.stderr.write(`${t}
|
|
8
8
|
`),process.exit(1)}process.on("unhandledRejection",A);process.on("uncaughtException",A);var k=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,S=new Set(["desktop"]);function C(a){!k||!S.has(a)||(process.stderr.write(` ${m.commandName} ${a} isn't available in the standalone binary \u2014
|
|
9
9
|
it needs vite / electron / playwright from a project's node_modules.
|
|
10
10
|
run the npm package instead:
|
|
11
11
|
${m.commandName} ${a}
|
|
12
|
-
`),process.exit(1))}var e=f(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:a}=await import("./chunks/hidden-runtime-alias-
|
|
13
|
-
`)}var h=!1;async function v(){if(!h&&(h=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:a}=await import("./chunks/disk-cleanup-
|
|
12
|
+
`),process.exit(1))}var e=f(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:a}=await import("./chunks/hidden-runtime-alias-HSGN3GN4.js");e=a(e)}var $=e.command==="cleanup"&&e.commandArgs.length===1&&e.commandArgs[0]==="--automatic-worker",_=!e.command&&e.commandArgs.length===0;if(!$&&!_&&!e.help&&!e.version&&e.command!=="config"&&e.command!=="setup"&&e.command!=="telemetry"){let{ensurePrivacyChoice:a}=await import("./chunks/privacy-SIDMP5EF.js");await a({prompt:!0})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:a}=await import("./chunks/home-paths-BIUN4CBO.js"),t=a();t&&process.stderr.write(` ${m.name} engine upgraded to v${t.to}`+(t.from?` (from v${t.from})`:"")+` \xB7 what's new: ${m.origin}/changelog
|
|
13
|
+
`)}var h=!1;async function v(){if(!h&&(h=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:a}=await import("./chunks/disk-cleanup-5R7JYCO6.js");if(a())return;let{spawn:t}=await import("node:child_process"),i=["cleanup","--automatic-worker"],d=process.argv[1],p=k?t(process.execPath,i,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):d?t(process.execPath,[d,...i],{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):t(m.commandName,i,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env});p.once("error",u=>{process.stderr.write(` ${m.name} automatic cleanup will retry on the next run: ${u.message}
|
|
14
14
|
`)}),p.unref()}catch(a){process.stderr.write(` ${m.name} automatic cleanup will retry on the next run: ${a instanceof Error?a.message:String(a)}
|
|
15
|
-
`)}}async function o(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-
|
|
15
|
+
`)}}async function o(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-FANCQHKG.js");await t(),await v(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-VSDCFXXN.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-XVY4WOYH.js"),d=t?` \xB7 ${i}`:"";console.log(`${m.commandName} v${a()}${d}`);let{readActiveRuntime:p}=await import("./chunks/home-paths-BIUN4CBO.js"),u=p();console.log(u?`runtime v${u}`:"runtime not installed"),await o(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-3ZL7MRUX.js");a(),await o(0)}var n=e.globalFlags.port,c=e.verbose,w=e.globalFlags.device,l=e.globalFlags.theme,W=e.globalFlags.driver,x=e.globalFlags.headless===!0,b=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,r=b?["--sim",b,...e.commandArgs]:e.commandArgs;if(w||l){let{settingsStore:a}=await import("./chunks/store-3EQT7VU6.js"),t={};w&&(t.deviceModel=w),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runWelcome:a}=await import("./chunks/welcome-3CQ2GE4F.js");await o(await a())}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let t=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(` run \`${m.commandName} --help\` to see the full surface.`),await o(1)}let{printHelp:a}=await import("./chunks/help-3ZL7MRUX.js");a(),await o(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:i}=await import("./chunks/skills-4JGPOSFE.js");await i(e.commandArgs),await o(0)}if(s==="state"){let{runState:i}=await import("./chunks/state-DEAQFKVP.js");await o(await i(r,{port:n}))}if(s==="reset"){let{runReset:i}=await import("./chunks/reset-GPHG5XN3.js");await o(await i(r,{port:n}))}let a=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",t=e.commandArgs.find(i=>!i.startsWith("-"));if(!(s==="shell"||s==="perf"))if(a&&!t){let{printGroupHelp:i}=await import("./chunks/help-3ZL7MRUX.js");i(s)&&await o(0)}else{let{printCommandHelp:i}=await import("./chunks/help-3ZL7MRUX.js");i(a&&t?t:s,{prefer:a&&t?"verb":"command",group:a&&t?s:void 0}),await o(0)}}C(s);if(g.has(s)){let{runInspect:a}=await import("./chunks/inspect-RCU7XVAO.js");await a([s,...r],{port:n,verbose:c})}else switch(s){case"assert":{let{runAssert:a}=await import("./chunks/assert-3KQYZDDK.js");await a(e.commandArgs);break}case"detox":{let{runDetox:a}=await import("./chunks/detox-KAKTJ4P4.js");await a(e.commandArgs,{port:n,verbose:c});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-SJGV7B3W.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"record":{let{runRecord:a}=await import("./chunks/record-MA3AI752.js");await a(r,{port:n,verbose:c});break}case"film":{let{runFilm:a}=await import("./chunks/film-GY5U752Q.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"storage":{let{runStorage:a}=await import("./chunks/storage-Y6F5NTGH.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"state":{let{runState:a}=await import("./chunks/state-DEAQFKVP.js"),t=await a(r,{port:n});await o(t)}case"reset":{let{runReset:a}=await import("./chunks/reset-GPHG5XN3.js"),t=await a(r,{port:n});await o(t)}case"perf":{let{runPerf:a}=await import("./chunks/perf-XGANSJT3.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshotCommand:a}=await import("./chunks/screenshot-command-JUXMWXS5.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"camera":{let{runCamera:a}=await import("./chunks/camera-JROBX5GM.js"),t=await a(r,{port:n});await o(typeof t=="number"?t:0)}case"mode":{let{runMode:a}=await import("./chunks/mode-MN7LZCLB.js");await a(r,{port:n,verbose:c});break}case"permissions":{let{runPermissions:a}=await import("./chunks/permissions-25UWEJKW.js"),t=await a(r,{port:n,verbose:c});await o(t)}case"debug":{let{runDebug:a}=await import("./chunks/debug-3P2DUTUQ.js");await a(r,{port:n,verbose:c});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-HOHYYDOC.js");await a(r,{port:n,verbose:c});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-L56ZFIMJ.js");await a(r,{port:n,verbose:c});break}case"open":{let{runOpenCommand:a}=await import("./chunks/control-J35HAFZA.js");await a(r,{port:n});break}case"use":{let{runUseCommand:a}=await import("./chunks/control-J35HAFZA.js");await a(r,{port:n});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-J35HAFZA.js");await a(r,{port:n});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-J35HAFZA.js");await a(r,{port:n});break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-4MAWLZMR.js");await a(r,{port:n});break}case"compat":{let{runCompat:a}=await import("./chunks/compat-C3RGYGXL.js");await a(e.commandArgs);break}case"report-issue":{let{runReportIssue:a}=await import("./chunks/report-issue-4DTESWE2.js"),t=await a(e.commandArgs);await o(t)}case"desktop":{let{runDesktop:a}=await import("./chunks/desktop-XIXW34VW.js");await a(e.commandArgs,{port:n,device:w});break}case"login":{let{runLogin:a}=await import("./chunks/login-WKNMS4GG.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-6UFUOESK.js");await a();break}case"auth":{let{runAuth:a}=await import("./chunks/auth-RFE3J27C.js");await a(e.commandArgs);break}case"setup":{let{runSetup:a}=await import("./chunks/setup-G2WYLPM6.js");await a(e.commandArgs);break}case"serve":{let{runServe:a}=await import("./chunks/serve-H7GNKJSM.js");await a(e.commandArgs,{port:n});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-DLLEODJY.js");await a(e.commandArgs,{port:n});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-VOEIOODA.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-QF5YHLSG.js");await a(e.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-PDCKYJLB.js");await a(e.commandArgs);break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-FB7RPXO6.js"),t=await a(e.commandArgs);await o(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-LFU3XEIG.js"),t=await a(e.commandArgs);await o(t)}case"skill":{let{runSkill:a}=await import("./chunks/skills-4JGPOSFE.js");await a(e.commandArgs);break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-FK6SETRG.js");await a(e.commandArgs);break}case"config":{let{runConfig:a}=await import("./chunks/config-CDY2RB7Q.js");await a(e.commandArgs);break}case"cleanup":{let{runCleanup:a}=await import("./chunks/cleanup-F74ISXJC.js"),t=await a(e.commandArgs);await o(t)}default:console.error(` unknown command: ${s}`),console.error(` run \`${m.commandName} --help\` to see the full surface.`),await o(1)}await v();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (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 b,b as E,c as A,d as l,e as S,g as x,h as j,j as T,n as I,o as k,p as D,q as g,r as O,s as C}from"./chunk-
|
|
4
|
+
import{a as b,b as E,c as A,d as l,e as S,g as x,h as j,j as T,n as I,o as k,p as D,q as g,r as O,s as C}from"./chunk-SLD2EMLZ.js";import"./chunk-MIK6LMG4.js";import{c as $}from"./chunk-CUK6Y2RR.js";import"./chunk-N3CE6AZP.js";import"./chunk-LC77IVGY.js";import"./chunk-HUU7ZUQK.js";import"./chunk-X2DJK3TB.js";import"./chunk-JJOHJNUQ.js";import"./chunk-TJRKLRNP.js";import"./chunk-UVIWE3LD.js";import{j as y}from"./chunk-LETVUC6M.js";import"./chunk-JWXAXCC6.js";import"./chunk-UI2IFVHB.js";import"./chunk-CKKDXTKV.js";import"./chunk-QQNNY43R.js";import w from"node:fs";import d from"node:path";import{spawn as _}from"node:child_process";import F from"node:net";import{WebSocket as R}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new R(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to rnx daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async sendClaimedPrompt(e,t){return this.send("agent:send-claimed-prompt",{simId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==R.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function M(n=7668,e=400){return new Promise(t=>{let r=new F.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function B(n={}){let e=n.port??7668;if(await M(e))return{alreadyRunning:!0};if(y())throw new c(`no rnx bridge on port ${e}. run \`rnx daemon install\` to enable the faster background service, or \`rnx serve\` in another shell.`,"DEV_HOST_REFUSED");let{cmd:t,prefixArgs:r}=C(),s=[...r,"serve","--quiet"];e!==7668&&s.push("--port",String(e));let o=_(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await M(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned rnx daemon on port ${e} but it did not come up in time. run \`rnx serve\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await B({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function ge(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return L(),0;case"attach":return await W(t);case"projects":return await J();case"project":return await V(t);case"sessions":return await H(t);case"start":return await G(t);case"prompt":return await q(t);case"watch":return await K(t);case"transcript":return await z(t);case"end":return await Q(t);case"paths":return await Y();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
5
5
|
`),L(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
|
|
6
6
|
`),1;throw r}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function L(){$("agent")}function P(n,e){let t={},r=[];for(let s=0;s<n.length;s++){let o=n[s],i=e[o];i==="value"?(t[o]=n[s+1]??"",s++):i==="bool"?t[o]=!0:r.push(o)}return{flags:t,positional:r}}function U(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function W(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),r=t[0];if(!r)return process.stderr.write(`usage: rnx agent attach <dir> [--name X] [--provider codex|claude]
|
|
7
7
|
`),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{b as M}from"./chunk-
|
|
4
|
+
import{b as M}from"./chunk-MIK6LMG4.js";import"./chunk-QQNNY43R.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as C,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,f=!1,a=new Promise(s=>{t.on("exit",(o,e)=>{f=!0;let p=new Error(`codex app-server exited (code=${o}, signal=${e??""})`);for(let{reject:y}of r.values())y(p);r.clear(),s({code:o,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let o=s.trim();if(!o)return;let e;try{e=JSON.parse(o)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,y=p!=null?r.get(p):void 0;if(!y)return;r.delete(p),e.error?y.reject(new b(e.error.message,e.error.code,e.error.data)):y.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let y of p)try{y(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let o=m.get("__stderr__");if(o)for(let e of o)try{e({text:s})}catch{}});function n(s){if(!f)try{t.stdin.write(JSON.stringify(s)+`
|
|
5
5
|
`)}catch{}}return{exited:a,on(s,o){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(o),()=>{e?.delete(o)}},request(s,o){if(f)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,y)=>{r.set(e,{resolve:l=>p(l),reject:y,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:o})})},notify(s,o){n({jsonrpc:"2.0",method:s,params:o})},async shutdown(s=1500){if(f)return;try{t.stdin.end()}catch{}let o=setTimeout(()=>{if(!f)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(o)}},kill(s="SIGTERM"){if(!f)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return C(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let f=t[u];f&&(r[f]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: rnx agent-wrapper --session-id <id> --project-id <id>
|
|
6
6
|
--provider codex|claude --cwd <path>
|
|
7
7
|
--prompt-in <fifo> --events-out <fifo>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (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{o as p}from"./chunk-
|
|
4
|
+
import{o as p}from"./chunk-IGV4KCCM.js";import"./chunk-77CBLMD4.js";import"./chunk-THFM2CFT.js";import"./chunk-QQNNY43R.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let r=t.find(i=>i.startsWith(`--${e}=`));return r?r.slice(e.length+3):void 0}async function x(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),r=f(t,"manifest");if((!o||!r)&&(console.error(" usage: rnx app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let i=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of i){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(r))try{let n=JSON.parse(y(r,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(r,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await x(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import"./chunk-
|
|
4
|
+
import"./chunk-QQNNY43R.js";import{spawn as v}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=v(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
|
|
5
5
|
`).slice(-2).join(" | ").slice(0,200);n({ok:!1,payload:null,reason:`verb exited ${o}${a?`: ${a}`:""}`});return}if(!t.trim()){n({ok:!1,payload:null,reason:"verb produced no output"});return}try{let a=JSON.parse(t);n({ok:!0,payload:a})}catch{n({ok:!1,payload:null,reason:`verb output was not valid json: ${t.slice(0,120)}`})}})})}function y(s,r){let u=r.split(".").filter(e=>e.length>0),n=s;for(let e of u){if(n==null)return{found:!1};if(Array.isArray(n)){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{found:!1};n=n[t];continue}if(typeof n=="object"){let t=n;if(!(e in t))return{found:!1};n=t[e];continue}return{found:!1}}return{found:!0,value:n}}function d(s){return Array.isArray(s)?s.length:s&&typeof s=="object"?Object.keys(s).length:null}async function A(s,r){let{kind:u,args:n}=s;switch(u){case"--exists":return r==null?{ok:!1,reason:"payload is null"}:d(r)===0?{ok:!1,reason:"payload is empty"}:{ok:!0,reason:"exists"};case"--empty":{if(r==null)return{ok:!0,reason:"payload is null"};let e=d(r);return e===0?{ok:!0,reason:"payload is empty"}:{ok:!1,reason:`payload has ${e} item(s)`}}case"--count":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:`payload not countable (${typeof r})`}:{ok:t===e,reason:`count=${t}, want=${e}`}}case"--count-at-least":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t>=e,reason:`count=${t}, want>=${e}`}}case"--count-at-most":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t<=e,reason:`count=${t}, want<=${e}`}}case"--contains":{let e=n[0],t=JSON.stringify(r);return{ok:t.includes(e),reason:t.includes(e)?`contains "${e}"`:`missing "${e}"`}}case"--not-contains":{let e=n[0],t=JSON.stringify(r);return{ok:!t.includes(e),reason:t.includes(e)?`unexpected "${e}"`:`not contains "${e}"`}}case"--matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=e.test(t);return{ok:i,reason:i?`matches /${n[0]}/`:`no match for /${n[0]}/`}}case"--not-matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=!e.test(t);return{ok:i,reason:i?`not matches /${n[0]}/`:`unexpected /${n[0]}/`}}case"--equals":{let e=n[0],t=typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):JSON.stringify(r);return{ok:t===e,reason:`got=${JSON.stringify(t)}, want=${JSON.stringify(e)}`}}case"--has-path":{let e=y(r,n[0]);return{ok:e.found,reason:e.found?`path ${n[0]} present`:`path ${n[0]} missing`}}case"--path-equals":{let[e,t]=n,i=y(r,e);if(!i.found)return{ok:!1,reason:`path ${e} missing`};let o=typeof i.value=="string"||typeof i.value=="number"||typeof i.value=="boolean"?String(i.value):JSON.stringify(i.value);return{ok:o===t,reason:`${e}=${o}, want=${t}`}}case"--jq":{let e=n[0];try{let i=(await O(e,r)).trim();return{ok:i.length>0&&i!=="null"&&i!=="false"&&i!=='""',reason:`jq: ${i.slice(0,120)}`}}catch(t){throw new Error(`jq evaluation failed: ${t.message}`)}}default:return{ok:!1,reason:`unknown predicate ${u}`}}}function O(s,r){return new Promise((u,n)=>{let e=v("jq",[s],{stdio:["pipe","pipe","pipe"]}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",n),e.on("close",o=>{if(o!==0){n(new Error(i.trim()||`jq exited ${o}`));return}u(t)}),e.stdin.end(JSON.stringify(r))})}async function T(s){(s[0]==="--help"||s[0]==="-h"||s.length===0)&&(J(),process.exit(s.length===0?2:0));let r=j(s);"error"in r&&(process.stderr.write(` assert: ${r.error}
|
|
6
6
|
`),process.exit(2));let{verbArgs:u,predicates:n,withinMs:e,negate:t,quiet:i,allowTimeout:o}=r;N(u)||(process.stderr.write(` assert: unknown or non-read verb: ${u.join(" ")}
|
|
7
7
|
supported: ${Array.from(w).sort().join(", ")}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (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 r}from"./chunk-
|
|
4
|
+
import{a as r}from"./chunk-ENPWD62S.js";import{d as t}from"./chunk-4AQCDL24.js";import"./chunk-LETVUC6M.js";import"./chunk-QQNNY43R.js";function i(){console.log(`
|
|
5
5
|
rnx auth \u2014 inspect CLI auth
|
|
6
6
|
|
|
7
7
|
usage:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a,b,c,d}from"./chunk-
|
|
4
|
+
import{a,b,c,d}from"./chunk-CKKDXTKV.js";import"./chunk-QQNNY43R.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (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{m as O}from"./chunk-
|
|
4
|
+
import{m as O}from"./chunk-766UIGCS.js";import"./chunk-UAYXEP74.js";import{q as E,s as F,u as N}from"./chunk-JJOHJNUQ.js";import"./chunk-TJRKLRNP.js";import{r as S}from"./chunk-LETVUC6M.js";import"./chunk-QQNNY43R.js";import{createHash as I,randomUUID as q}from"node:crypto";import{createReadStream as D}from"node:fs";import m from"node:fs/promises";import f from"node:path";var T="/__camera-fixtures/",J=new Set([".m4v",".mov",".mp4",".webm"]);function _(){console.log(`
|
|
5
5
|
rnx camera \u2014 control the simulator camera source
|
|
6
6
|
|
|
7
7
|
usage:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var f="\x1B[0m",p="\x1B[1m",a="\x1B[2m",m="\x1B[38;2;42;95;255m",x="\x1B[38;5;84m",d="\x1B[38;5;203m";function c(n,t){return!process.stdout.isTTY||process.env.NO_COLOR!==void 0?t:`${n}${t}${f}`}function s(n){return c(m,n)}function u(n){return c(p,n)}function i(n){return c(a,n)}function w(n){return c(x,n)}function h(n){return c(d,n)}function v(n){console.log(),console.log(` ${s("\u25E4\u25E2")} ${u("rnx")}`),n&&console.log(` ${i(n)}`)}function y(n,t){console.log(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var m={"--help":{type:"boolean",short:"-h"},"--version":{type:"boolean",short:"-V"},"--verbose":{type:"boolean",short:"-v"},"--port":{type:"number",short:"-p"},"--device":{type:"string",short:"-d"},"--theme":{type:"string",short:"-t"},"--headless":{type:"boolean"},"--driver":{type:"string"},"--sim":{type:"string"},"--session":{type:"string"},"--tab":{type:"string"}},p=new Set(["list","describe","find","get","do","wait","network","logs","shell"]),b=new Set(["do","get","wait","shell","debug"]),d=new Set(["detox","maestro","record","film","storage","permissions","perf","screenshot","state","reset","camera","mode","debug","timeline","what-happened","shell","assert","device","open","list","use","claim","close","compat","report-issue","desktop","login","logout","auth","setup","serve","daemon","runtime","upgrade","version","skill","config","cleanup","app-fonts","agent-wrapper","agent",...p]);function u(c){let n=c.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<n.length;){let o=n[s];if(o==="--"){e.commandArgs.push(...n.slice(s+1));break}let i=Object.entries(m).find(([a,r])=>a===o||r.short===o);if(i){let[a,r]=i,l=a.replace(/^--/,"");if(r.type==="boolean")e.globalFlags[l]=!0,s++;else{let t=n[s+1];if(t===void 0||t.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(r.type==="number"){let g=Number(t);if(Number.isNaN(g)){console.error(` warning: ${o} requires a number, got "${t}"`),s+=2;continue}e.globalFlags[l]=g}else e.globalFlags[l]=t;s+=2}continue}if(!e.command&&!o.startsWith("-")){let a=o.indexOf("-");if(a>0){let r=o.slice(0,a),l=o.slice(a+1);if(b.has(r)&&l.length>0){e.command=r;let t=n.slice(s+1);e.commandArgs=[l,...t[0]==="--"?t.slice(1):t];break}}if(d.has(o)){e.command=o;let r=n.slice(s+1);e.commandArgs=r[0]==="--"?r.slice(1):r;break}e.commandArgs=n.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{p as a,u as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c as P,k as m,l as S,m as R,n as _,o as v}from"./chunk-
|
|
4
|
+
import{c as P,k as m,l as S,m as R,n as _,o as v}from"./chunk-X2DJK3TB.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,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import{execFileSync as S,execSync as x}from"node:child_process";var g=new WeakMap,l=new Set,b=!1;function f(){return{platform:process.platform,env:process.env}}function A(e){return S("/bin/ps",["-p",String(e),"-o","command="],{encoding:"utf8"}).trim()}function w(e=f()){return e.platform==="linux"&&e.env.GITHUB_ACTIONS==="true"&&e.env.RUNNER_OS==="Linux"}function L(e){let r=String(e);return/^--disable-gpu(?:=.*)?$/i.test(r)||/^--enable-unsafe-swiftshader(?:=.*)?$/i.test(r)||/^--use-angle=(?:swiftshader|swiftshader-webgl)$/i.test(r)||/^--use-gl=swiftshader$/i.test(r)}function I(e){return e.match(/(?:^|\s)(--disable-gpu(?:=[^\s]+)?|--enable-unsafe-swiftshader(?:=[^\s]+)?|--use-angle=(?:swiftshader|swiftshader-webgl)|--use-gl=swiftshader)(?=\s|$)/i)?.[1]??null}function k(e){return e==="darwin"?"metal":e==="linux"?"vulkan":"default"}function y(e,r=f()){if(w(r))return;let n=I(e);if(n)throw new Error(`[reap-browser] refused software-rendering Chrome process argument ${n}`);let o=k(r.platform),t=e.split(/\s+/);if(!t.includes(`--use-angle=${o}`)||!t.includes("--enable-gpu"))throw new Error(`[reap-browser] Chrome process did not retain the required ${o} GPU arguments`);if(r.platform==="darwin"&&e.includes("/Applications/Google Chrome.app/"))throw new Error("[reap-browser] refused the user's installed Google Chrome; use Playwright channel chromium")}function E(e){if(!e||typeof e!="object")return[];let n=e.gpu;if(!n||typeof n!="object")return[];let o=n,t=[],a=o.auxAttributes;if(a&&typeof a=="object")for(let s of Object.values(a))typeof s=="string"&&t.push(s);let i=o.devices;if(Array.isArray(i)){for(let s of i)if(!(!s||typeof s!="object"))for(let u of Object.values(s))typeof u=="string"&&t.push(u)}return t}function B(e){if(!e||typeof e!="object")return null;let r=e;if(!Array.isArray(r.processInfo))return null;for(let n of r.processInfo){if(!n||typeof n!="object")continue;let o=n;if(o.type==="browser"&&typeof o.id=="number"&&Number.isInteger(o.id)&&o.id>0)return o.id}return null}function G(e,r=f()){if(w(r))return;let o=E(e).join(" | ");if(!o||/swiftshader|llvmpipe|software rasterizer/i.test(o))throw new Error(`[reap-browser] Chrome reported a software renderer${o?`: ${o}`:""}`);if(r.platform==="darwin"&&!/metal/i.test(o))throw new Error(`[reap-browser] Chrome did not report an ANGLE Metal renderer: ${o}`)}function p(e){if(e&&typeof e=="object"){let n=g.get(e);if(n!==void 0)return n}let r=e;if(r&&typeof r.process=="function")try{let n=r.process();if(n&&typeof n.pid=="number"&&n.pid>0)return n.pid}catch{}if(r&&typeof r.browser=="function")try{let n=r.browser();if(n)return p(n)}catch{}return null}function h(e){let r=[];try{r=x(`pgrep -P ${e} || true`).toString().split(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (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{o as d}from"./chunk-
|
|
4
|
+
import{o as d}from"./chunk-LETVUC6M.js";import{chmodSync as S,existsSync as f,mkdirSync as A,readFileSync as k,rmSync as o,writeFileSync as y}from"node:fs";import{dirname as c,join as D,resolve as m}from"node:path";var s=1,p="SOOTSIM_SHARED_AUTH_FILE",u="https://contrast.dev";function w(){let t=process.env[p];return t?.trim()?c(m(t)):d()}function a(){let t=process.env[p];return t?.trim()?m(t):D(w(),"desktop-auth.json")}function g(t){if(!t||typeof t!="object")return null;let e=t;return typeof e.id!="string"||!e.id.trim()?null:{id:e.id.trim(),name:typeof e.name=="string"?e.name:void 0,email:typeof e.email=="string"?e.email:void 0,image:typeof e.image=="string"?e.image:void 0,githubUsername:typeof e.githubUsername=="string"?e.githubUsername:void 0,isAdmin:e.isAdmin===!0,teams:Array.isArray(e.teams)?e.teams.map(r=>{if(!r||typeof r!="object")return null;let n=r;return typeof n.id!="string"||typeof n.name!="string"?null:{id:n.id,name:n.name,role:n.role==="owner"?"owner":"member",githubOrg:typeof n.githubOrg=="string"?n.githubOrg:null}}).filter(r=>!!r):void 0}}function v(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==s||typeof e.token!="string"||!e.token.trim())return null;let r=typeof e.origin=="string"&&e.origin.trim()?e.origin.trim():u,n=e.source==="cli"||e.source==="electron"||e.source==="browser"||e.source==="unknown"?e.source:"unknown",i=typeof e.updatedAt=="string"&&e.updatedAt?e.updatedAt:new Date().toISOString(),h=typeof e.validatedAt=="string"&&e.validatedAt?e.validatedAt:void 0;return{version:s,token:e.token.trim(),user:g(e.user),origin:r,source:n,updatedAt:i,validatedAt:h}}function b(){let t=a();if(!f(t))return null;try{let e=JSON.parse(k(t,"utf8")),r=v(e);return r||(o(t,{force:!0}),null)}catch{return o(t,{force:!0}),null}}function O(t){let e=a();A(c(e),{recursive:!0});let r={version:s,token:t.token.trim(),user:t.user?g(t.user):null,origin:t.origin?.trim()||u,source:t.source,updatedAt:t.updatedAt||new Date().toISOString(),validatedAt:t.validatedAt};y(e,JSON.stringify(r,null,2)+`
|
|
5
5
|
`);try{S(e,384)}catch{}return r}function l(){o(a(),{force:!0})}async function E(t){let e=b();if(!e?.token)return null;let r=t||e.origin||u;try{let n=await fetch(`${r.replace(/\/$/,"")}/api/auth/me`,{headers:{authorization:`Bearer ${e.token}`}});if(n.status===401)return l(),null;if(!n.ok)return e;let i=await n.json();return i.user?.id?O({token:e.token,user:i.user,origin:r,source:e.source,validatedAt:new Date().toISOString()}):(l(),null)}catch{return e}}export{b as a,O as b,l as c,E as d};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (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{L as F,M as j,N as H,k as N,l as U,v as _,z as E}from"./chunk-
|
|
4
|
+
import{L as F,M as j,N as H,k as N,l as U,v as _,z as E}from"./chunk-LETVUC6M.js";import{a as L}from"./chunk-UI2IFVHB.js";import G from"node:fs";import Z from"node:path";function A(e){return e.length<=100&&/^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(e)}function D(e){try{return G.readdirSync(e.runtimesDir(),{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort(k)}catch{return[]}}function M(e,c){return Z.posix.basename(e.tarballPath(c))}function k(e,c){let l=f=>{let v=f.indexOf("-"),V=v>=0?f.slice(0,v):f,T=v>=0?f.slice(v+1):"",$=V.split(".").map(S=>Number.parseInt(S,10));return $.some(S=>!Number.isFinite(S))?[[Number.POSITIVE_INFINITY],f]:[$,T]},[m,u]=l(e),[R,x]=l(c);for(let f=0;f<Math.max(m.length,R.length);f++){let v=m[f]??0,V=R[f]??0;if(v!==V)return v-V}return u===x?0:u?x?u<x?-1:1:-1:1}import{spawn as B}from"node:child_process";import J from"node:crypto";import o from"node:fs";import Y from"node:os";import y from"node:path";import{Readable as q}from"node:stream";import{pipeline as K}from"node:stream/promises";var Q=2;function W(e){function c(){try{let n=JSON.parse(o.readFileSync(e.configFile(),"utf8"));return n&&typeof n=="object"?n:{}}catch{return{}}}function l(n){let t=c();return(n||process.env[e.env.cdnOrigin]||t.cdnOrigin||e.defaultCdnOrigin).replace(/\/+$/,"")}function m(n){let t=c();return n||process.env[e.env.channel]||t.runtimeChannel||"stable"}function u(){if(!e.env.pin)return null;let n=process.env[e.env.pin];if(n&&n.trim())return n.trim();let t=c();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function R(n){let t=new URL(`${l(n)}${e.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function x(n,t){return`${l(t)}${e.tarballPath(n)}`}async function f(n){let t=R(n),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function v(n,t={}){let r=m(t.channel),i=t.version||u()||n.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);if(!A(i))throw new Error(`invalid runtime version: ${i}`);let h=n.versions[i];if(!h)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(n.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:h}}async function V(n={}){e.ensureHome();let t=l(n.cdnOrigin),r=await f(t),{version:i,channel:h,entry:a}=v(r,n),d=e.runtimeDir(i),g=n.setActive!==!1,O=[i,...n.protectVersions??[]];if(I({protectVersions:O}),!n.force&&o.existsSync(y.join(d,e.installedMarker)))return g&&e.writeActiveRuntime(i),I({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!1,activated:g,manifest:r};let P=a.tarball||x(i,t),b=o.mkdtempSync(y.join(Y.tmpdir(),`${e.id}-runtime-download-`)),w=y.join(b,M(e,i)),p=y.join(y.dirname(d),`.installing-${i}-${process.pid}`);o.rmSync(p,{recursive:!0,force:!0});try{process.stderr.write(`${e.id}: downloading runtime ${i}\u2026
|
|
5
5
|
`),await X(P,w),process.stderr.write(`${e.id}: extracting runtime ${i}\u2026
|
|
6
6
|
`);let s=await ee(w);if(s!==a.sha256)throw new Error(`sha256 mismatch for runtime ${i}: expected ${a.sha256}, actual ${s}`);if(o.mkdirSync(p,{recursive:!0}),await ne(w,p),!o.existsSync(y.join(p,e.installedMarker)))throw new Error(`extracted tarball for runtime ${i} is missing ${e.installedMarker}`);o.rmSync(d,{recursive:!0,force:!0}),o.renameSync(p,d)}catch(s){throw o.rmSync(p,{recursive:!0,force:!0}),s}finally{o.rmSync(b,{recursive:!0,force:!0})}return g&&e.writeActiveRuntime(i),I({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!0,activated:g,manifest:r}}async function T(n={}){e.ensureHome(),I({protectVersions:n.protectVersions});let t=l(n.cdnOrigin),r=m(n.channel),i=u();if(i){let p=e.readActiveRuntime(),s=o.existsSync(y.join(e.runtimeDir(i),e.installedMarker));if(p===i&&s)return{checked:!0,updated:!1,reason:`runtime is pinned to ${i}`,activeVersion:p,latestVersion:i};let C=await V({version:i,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,reason:`runtime is pinned to ${i}`,activeVersion:i,latestVersion:i,install:C}}let h=await f(t),a=h.channels[r]?.latest;if(!a)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:e.readActiveRuntime()};if(!h.versions[a])return{checked:!0,updated:!1,reason:`manifest is missing version ${a}`,activeVersion:e.readActiveRuntime(),latestVersion:a};let g=e.readActiveRuntime(),O=g?e.runtimeDir(g):null,P=O?o.existsSync(y.join(O,e.installedMarker)):!1;if(!(!g||!P||k(a,g)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:g,latestVersion:a};let w=await V({version:a,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,activeVersion:a,latestVersion:a,install:w}}async function $(n={}){let t=e.readActiveRuntime(),r=u();if(r)return{active:t,latest:r,pinned:r,outdated:t!==r};try{let i=await f(l(n.cdnOrigin)),h=m(n.channel),a=i.channels[h]?.latest??null,d=!!(a&&(!t||k(a,t)>0));return{active:t,latest:a,pinned:null,outdated:d}}catch{return{active:t,latest:null,pinned:null,outdated:!1}}}function S(n={}){e.ensureHome();let t=Math.max(1,Math.floor(n.retainVersions??Q)),r=D(e),i=new Set(r),h=e.readActiveRuntime(),a=u(),d=new Set;for(let s of[h,a,...n.protectVersions??[]])s&&i.has(s)&&d.add(s);for(let s of[...r].reverse()){if(d.size>=t)break;d.add(s)}let g="__RUNTIME_VERSION__",O=M(e,g),P=O.indexOf(g),b=O.slice(0,P),w=O.slice(P+g.length),p=[];if(P>=0)try{p=o.readdirSync(e.cacheDir(),{withFileTypes:!0}).filter(s=>{if(!s.isFile())return!1;let C=s.name.startsWith(b)&&s.name.endsWith(w),z=s.name.startsWith(b)&&s.name.endsWith(`${w}.partial`);return C||z}).map(s=>y.join(e.cacheDir(),s.name)).sort()}catch{}return{activeVersion:h,pinnedVersion:a,keepVersions:r.filter(s=>d.has(s)),removeVersions:r.filter(s=>!d.has(s)),removeCacheFiles:p}}function I(n={}){let t=S(n);for(let r of t.removeVersions)o.rmSync(e.runtimeDir(r),{recursive:!0,force:!0});for(let r of t.removeCacheFiles)o.rmSync(r,{force:!0});return t}return{product:e,resolveCdnOrigin:l,resolveChannel:m,resolvePin:u,manifestUrl:R,tarballUrl:x,fetchManifest:f,resolveVersion:v,install:V,updateToLatest:T,checkUpToDate:$,planLocalRetention:S,pruneLocalRetention:I,listInstalled:()=>D(e)}}async function X(e,c){let l=await fetch(e);if(!l.ok||!l.body)throw new Error(`download failed: ${l.status} ${l.statusText} (${e})`);o.mkdirSync(y.dirname(c),{recursive:!0});let m=`${c}.partial`;try{await K(q.fromWeb(l.body),o.createWriteStream(m)),o.renameSync(m,c)}catch(u){try{o.unlinkSync(m)}catch{}throw u}}function ee(e){return new Promise((c,l)=>{let m=J.createHash("sha256"),u=o.createReadStream(e);u.on("data",R=>m.update(R)),u.on("error",l),u.on("end",()=>c(m.digest("hex")))})}function ne(e,c){return new Promise((l,m)=>{let u=B("tar",["-xzf",e,"-C",c],{stdio:["ignore","inherit","inherit"]});u.on("error",m),u.on("exit",R=>{R===0?l():m(new Error(`tar exited with code ${R}`))})})}var te="https://contrast.dev",ye=`${L.origin}/changelog`,Ve="https://contrast.dev/api/changelog/sootsim",ie={id:"sootsim",defaultCdnOrigin:te,manifestPath:"/runtimes/manifest.json",tarballPath:e=>`/runtimes/sootsim-runtime-${e}.tar.gz`,installedMarker:"index.html",env:{cdnOrigin:"SOOTSIM_CDN_ORIGIN",channel:"SOOTSIM_RUNTIME_CHANNEL"},ensureHome:F,configFile:E,runtimesDir:N,runtimeDir:U,cacheDir:_,readActiveRuntime:j,writeActiveRuntime:H},we=W(ie);export{A as a,k as b,te as c,ye as d,Ve as e,we as f};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (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{I,m as E,n as P,p as y,u as F,w as N}from"./chunk-
|
|
4
|
+
import{I,m as E,n as P,p as y,u as F,w as N}from"./chunk-UAYXEP74.js";import{r as h,v as B,w as A}from"./chunk-JJOHJNUQ.js";var k={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function z(e){return e.includes("--json")}function K(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
5
5
|
`)}function Q(e){process.stderr.write(`${e}
|
|
6
6
|
`)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function O(e,t,...r){return B(e,`__sootsimTest.${t}`,...r)}async function j(e,t,...r){return A(e,`SootSim.bridges.mainShell.${t}`,...r)}async function X(e,t={}){try{let r=await O(e,"waitForScreenTransitions",k);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function Z(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await j(e,t,...n)}catch(o){if(!I(o)||Date.now()>=s)throw o;await w(50)}}async function ee(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let i=0;i<s;i++){let u=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function te(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let i=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await i.send({type:"evaluate",code:"1"}),i}catch{i.close()}await w(o)}return null}async function ne(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,i=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,liveFrameActive:!1,liveFrameChannels:0,liveFramePublishes:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let a=await e.send({type:"evaluate",code:E}),g=Date.now()-o,f=Number(a?.nodes)||0,$=Number(a?.targets)||0,C=a?.liveFrameActive===!0,W=Number(a?.liveFrameChannels)||0,q=Number(a?.liveFramePublishes)||0,x=Number(a?.errors)||0,T=a?.flag===!0,p=a?.externalReady,M=typeof a?.loadingText=="string"?a.loadingText.trim():"",D=typeof a?.externalStatus=="string"?a.externalStatus.trim():"",R=typeof a?.externalError=="string"?a.externalError.trim():"",v=typeof a?.externalError=="string"&&R.length>0;if(c=p,d=v,f!==i&&(i=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,liveFrameActive:C,liveFrameChannels:W,liveFramePublishes:q,flag:a?.flag,loadingText:M,externalReady:typeof p=="boolean"?p:null,externalStatus:D,externalError:R,errors:x},T&&p!==!1&&!v&&!M&&y({liveFrameActive:C,nodes:f,targets:$})&&g-u>=P)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!T)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&y(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function H(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function L(e,t={}){let r=await e.send({type:"evaluate",code:N});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
7
7
|
console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await F(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import{existsSync as s}from"node:fs";import{basename as a,dirname as p,join as l}from"node:path";import{fileURLToPath as m,pathToFileURL as c}from"node:url";var u="packages/sootsim/scripts/demo-app-registry.ts",f=8;function A(o){let r=o;for(let e=0;e<f;e++){if(a(r)==="node_modules")return null;let n=l(r,u);if(s(n))return n;let i=p(r);if(i===r)return null;r=i}return null}var t=null;async function S(){if(t)return t;let o=A(p(m(import.meta.url)));if(!o)return t=[],t;try{let r=await import(c(o).href);t=Array.isArray(r.APPS)?r.APPS:[]}catch{t=[]}return t}function D(){return t??[]}function O(o){let r=t;return t=o,{restore:()=>{t=r}}}export{A as a,S as b,D as c,O as d};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (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 q,b as G,c as $e}from"./chunk-
|
|
4
|
+
import{a as q,b as G,c as $e}from"./chunk-ENPWD62S.js";import{c as _e,d as Pe}from"./chunk-BNXXNT3I.js";import{o as Ue}from"./chunk-IGV4KCCM.js";import{q as Ie,s as Ae,u as x}from"./chunk-JJOHJNUQ.js";import{a as Be}from"./chunk-UI2IFVHB.js";import{createHash as bt}from"crypto";import{readFileSync as b}from"fs";import ze from"path";import{gzipSync as fe,gunzipSync as wt}from"zlib";function Ne(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as ot,constants as it}from"node:zlib";var at=9;function Fe(e){return ot(e,{params:{[it.BROTLI_PARAM_QUALITY]:at}})}function le(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function lt(e){let t=le(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function ut(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await lt(l),o++,r?.(o,i)}}))}function ct(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function dt(e){return e.replace(/\/+$/,"")}var J=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function Ce(e){let t=dt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=le(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let w=await o.text().catch(()=>"");throw new J(`init failed: ${o.status} ${w.slice(0,200)}`,o.status,"init",w)}let i=await o.json(),l=ct(i,e.bundleBytes,e.filesByHash,e.extras);await ut(l,e.concurrency??8,e.onPutProgress);let f=le(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:f.signal})}finally{f.cancel()}if(!c.ok){let w=await c.text().catch(()=>"");throw new J(`finalize failed: ${c.status} ${w.slice(0,200)}`,c.status,"finalize",w)}let h=await c.json();return{init:i,finalize:h}}function pt(e){return e!==null&&typeof e=="object"?e:null}function Le(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ue(e){let t=pt(e);return t?t.schemaVersion===1&&Le(t.t)!==void 0&&Le(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function ft(e,t){let r=[];for(let s of e.split(`
|
|
5
5
|
`)){let o=s.trim();if(o)try{let i=JSON.parse(o);t(i)&&r.push(i)}catch{}}return r}function Oe(e){return ft(e,ue)}import{execSync as mt}from"child_process";function de(e){try{return mt(e,{stdio:["ignore","pipe","ignore"],timeout:3e3,encoding:"utf8"}).trim()||null}catch{return null}}function ce(e){let t=e?.trim();return!t||!/^\d+$/.test(t)?null:Number(t)}function gt(){let e=de("git remote get-url origin");if(!e)return null;let t=e.match(/github\.com[/:]([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/i);return t?{owner:t[1],repo:t[2]}:null}function pe(){let e=process.env.GITHUB_ACTIONS==="true",t=process.env.CONTRAST_BRANCH?.trim()||null,r=process.env.CONTRAST_SHA?.trim()||null,s=process.env.CONTRAST_PR_TITLE?.trim()||null,o=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim(),[i,l]=o.includes("/")?o.split("/",2):[null,null];if(e){let h=process.env.GITHUB_REF?.match(/^refs\/pull\/(\d+)\//)?.[1];return{owner:i,repo:l,branch:t||process.env.GITHUB_HEAD_REF?.trim()||process.env.GITHUB_REF_NAME?.trim()||null,commitSha:r||process.env.GITHUB_SHA?.trim()||null,githubUsername:process.env.GITHUB_ACTOR?.trim()||null,pullRequestNumber:ce(process.env.CONTRAST_PR_NUMBER)??ce(h),pullRequestTitle:s,githubRunId:process.env.GITHUB_RUN_ID?.trim()||null,source:"ci"}}let f=t??de("git rev-parse --abbrev-ref HEAD"),c=i?null:gt();return{owner:i??c?.owner??null,repo:l??c?.repo??null,branch:f==="HEAD"?null:f,commitSha:r??de("git rev-parse HEAD"),githubUsername:null,pullRequestNumber:ce(process.env.CONTRAST_PR_NUMBER),pullRequestTitle:s,githubRunId:null,source:"cli"}}function Gt(e){if(e.length===0)return{stepCount:null,failedStepIndex:null};let t=e.find(r=>r.status==="failure");return{stepCount:e.length,failedStepIndex:t?t.stepIndex:null}}function Jt(e){return e.auth?e.uploadedShare?!0:e.auth.kind==="github"||process.env.GITHUB_ACTIONS==="true":!1}async function Kt(e){let t=e.auth??q();if(!t)return null;let r=pe(),s=e.owner??(t.kind==="github"?t.owner:null)??r.owner,o=e.repo??(t.kind==="github"?t.repo:null)??r.repo;try{let i=await fetch(`${e.origin.replace(/\/$/,"")}/api/sootsim/test-runs`,{method:"POST",headers:{"content-type":"application/json",authorization:G(t)},body:JSON.stringify({kind:e.kind,source:r.source,name:e.name??void 0,prompt:e.prompt??void 0,summary:e.summary??void 0,status:e.status,failureMessage:e.failureMessage??void 0,previewShareId:e.previewShareId??void 0,owner:s??void 0,repo:o??void 0,branch:r.branch??void 0,commitSha:r.commitSha??void 0,githubUsername:r.githubUsername??void 0,pullRequestNumber:r.pullRequestNumber??void 0,githubRunId:r.githubRunId??void 0,stepCount:e.stepCount??void 0,failedStepIndex:e.failedStepIndex??void 0,durationMs:e.durationMs??void 0,flowYamlSizeBytes:e.flowYamlSizeBytes??void 0})});if(!i.ok){let f=await i.text().catch(()=>"");return console.warn(` warn: run registration failed: /api/sootsim/test-runs ${i.status}${f?`: ${f.slice(0,200)}`:""}`),null}let l=await i.json();return l.run?.id?{id:l.run.id,previewUrl:l.run.previewUrl??null,traceUrl:l.run.traceUrl??null}:(console.warn(" warn: run registration returned no id"),null)}catch(i){return console.warn(` warn: run registration failed: ${i instanceof Error?i.message:String(i)}`),null}}function Mt(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}function Tt(e){let t=JSON.parse(b(e,"utf8"));if(!Array.isArray(t))throw new Error("snapshot manifest must be an array");let r=new Set;return t.map((s,o)=>{if(s===null||typeof s!="object")throw new Error(`snapshot manifest entry ${o} must be an object`);let i=Reflect.get(s,"id"),l=Reflect.get(s,"label"),f=Reflect.get(s,"path"),c=Reflect.get(s,"t");if(typeof i!="string"||!i||r.has(i))throw new Error(`snapshot manifest entry ${o} has an invalid or duplicate id`);if(typeof f!="string"||!f)throw new Error(`snapshot manifest entry ${o} has no PNG path`);if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new Error(`snapshot manifest entry ${o} has an invalid capture time`);r.add(i);let h=b(f);return{meta:{id:i,label:typeof l=="string"&&l?l:i,kind:"interaction",t:Math.round(c),contentType:"image/png",sizeBytes:h.byteLength},bytes:h}})}var Ge=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://contrast.dev",Je=process.env.SOOTSIM_PREVIEW_ORIGIN||Be.origin;async function St(e){return e||(process.env.SOOTSIM_UPLOAD_ORIGIN?process.env.SOOTSIM_UPLOAD_ORIGIN:Ge)}function $(e){return e.replace(/\/$/,"")}function vt(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function xt(e){try{let t=new URL(e).hostname.toLowerCase();return t==="contrast.dev"||t.endsWith(".contrast.dev")}catch{return!1}}function Rt(e,t){return t?$(t):process.env.SOOTSIM_PREVIEW_ORIGIN?$(process.env.SOOTSIM_PREVIEW_ORIGIN):vt(e)?$(e):xt(e)?$(Je):$(e)}function kt(){console.log(`
|
|
6
6
|
rnx record upload \u2014 publish the current recorded bundle as a /preview/<id> link
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c as ms}from"./chunk-
|
|
4
|
+
import{c as ms}from"./chunk-QQNNY43R.js";var hs={};ms(hs,{Alias:()=>ee,CST:()=>cs,Composer:()=>be,Document:()=>se,Lexer:()=>Be,LineCounter:()=>De,Pair:()=>v,Parser:()=>we,Scalar:()=>y,Schema:()=>ve,YAMLError:()=>_e,YAMLMap:()=>$,YAMLParseError:()=>R,YAMLSeq:()=>B,YAMLWarning:()=>Pe,isAlias:()=>F,isCollection:()=>L,isDocument:()=>x,isMap:()=>U,isNode:()=>I,isPair:()=>T,isScalar:()=>E,isSeq:()=>V,parse:()=>un,parseAllDocuments:()=>fn,parseDocument:()=>us,stringify:()=>hn,visit:()=>Q,visitAsync:()=>je});var tt=Symbol.for("yaml.alias"),st=Symbol.for("yaml.document"),Y=Symbol.for("yaml.map"),qt=Symbol.for("yaml.pair"),q=Symbol.for("yaml.scalar"),re=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),F=s=>!!s&&typeof s=="object"&&s[K]===tt,x=s=>!!s&&typeof s=="object"&&s[K]===st,U=s=>!!s&&typeof s=="object"&&s[K]===Y,T=s=>!!s&&typeof s=="object"&&s[K]===qt,E=s=>!!s&&typeof s=="object"&&s[K]===q,V=s=>!!s&&typeof s=="object"&&s[K]===re;function L(s){if(s&&typeof s=="object")switch(s[K]){case Y:case re:return!0}return!1}function I(s){if(s&&typeof s=="object")switch(s[K]){case tt:case Y:case q:case re:return!0}return!1}var nt=s=>(E(s)||L(s))&&!!s.anchor;var j=Symbol("break visit"),ds=Symbol("skip children"),z=Symbol("remove node");function Q(s,e){let t=gs(e);x(s)?ke(null,s.contents,t,Object.freeze([s]))===z&&(s.contents=null):ke(null,s,t,Object.freeze([]))}Q.BREAK=j;Q.SKIP=ds;Q.REMOVE=z;function ke(s,e,t,n){let i=ys(s,e,t,n);if(I(i)||T(i))return bs(s,n,i),ke(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=ke(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===z&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=ke("key",e.key,t,n);if(r===j)return j;r===z&&(e.key=null);let o=ke("value",e.value,t,n);if(o===j)return j;o===z&&(e.value=null)}}return i}async function je(s,e){let t=gs(e);x(s)?await Ne(null,s.contents,t,Object.freeze([s]))===z&&(s.contents=null):await Ne(null,s,t,Object.freeze([]))}je.BREAK=j;je.SKIP=ds;je.REMOVE=z;async function Ne(s,e,t,n){let i=await ys(s,e,t,n);if(I(i)||T(i))return bs(s,n,i),Ne(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await Ne(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===z&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=await Ne("key",e.key,t,n);if(r===j)return j;r===z&&(e.key=null);let o=await Ne("value",e.value,t,n);if(o===j)return j;o===z&&(e.value=null)}}return i}function gs(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function ys(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(U(e))return t.Map?.(s,e,n);if(V(e))return t.Seq?.(s,e,n);if(T(e))return t.Pair?.(s,e,n);if(E(e))return t.Scalar?.(s,e,n);if(F(e))return t.Alias?.(s,e,n)}function bs(s,e,t){let n=e[e.length-1];if(L(n))n.items[s]=t;else if(T(n))s==="key"?n.key=t:n.value=t;else if(x(n))n.contents=t;else{let i=F(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}var pn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},mn=s=>s.replace(/[!,[\]{}]/g,e=>pn[e]),Z=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+mn(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&I(e.contents)){let r={};Q(e.contents,(o,l)=>{I(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
5
5
|
`)}};Z.defaultYaml={explicit:!1,version:"1.2"};Z.defaultTags={"!!":"tag:yaml.org,2002:"};function it(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Rt(s){let e=new Set;return Q(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Ft(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function ws(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Rt(s));let o=Ft(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(E(o.node)||L(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:n}}function fe(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],l=fe(s,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=fe(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=fe(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=fe(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}function M(s,e,t){if(Array.isArray(s))return s.map((n,i)=>M(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!nt(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}var ue=class{constructor(e){Object.defineProperty(this,K,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!x(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=M(this,"",o);if(typeof i=="function")for(let{count:a,res:c}of o.anchors.values())i(c,a);return typeof r=="function"?fe(r,{"":l},"",l):l}};var ee=class extends ue{constructor(e){super(tt),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Q(e,{Node:(r,o)=>{(F(o)||nt(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=n.get(o);if(l||(M(o,null,t),l=n.get(o)),l?.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=rt(i,o,n)),l.count*l.aliasCount>r)){let a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(it(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function rt(s,e,t){if(F(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(L(e)){let n=0;for(let i of e.items){let r=rt(s,i,t);r>n&&(n=r)}return n}else if(T(e)){let n=rt(s,e.key,t),i=rt(s,e.value,t);return Math.max(n,i)}return 1}var ot=s=>!s||typeof s!="function"&&typeof s!="object",y=class extends ue{constructor(e){super(q),this.value=e}toJSON(e,t){return t?.keep?this.value:M(this.value,e,t)}toString(){return String(this.value)}};y.BLOCK_FOLDED="BLOCK_FOLDED";y.BLOCK_LITERAL="BLOCK_LITERAL";y.PLAIN="PLAIN";y.QUOTE_DOUBLE="QUOTE_DOUBLE";y.QUOTE_SINGLE="QUOTE_SINGLE";var dn="tag:yaml.org,2002:";function gn(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function oe(s,e,t){if(x(s)&&(s=s.contents),I(s))return s;if(T(s)){let f=t.schema[Y].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t,a;if(n&&s&&typeof s=="object"){if(a=l.get(s),a)return a.anchor??(a.anchor=i(s)),new ee(a.anchor);a={anchor:null,node:null},l.set(s,a)}e?.startsWith("!!")&&(e=dn+e.slice(2));let c=gn(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new y(s);return a&&(a.node=f),f}c=s instanceof Map?o[Y]:Symbol.iterator in Object(s)?o[re]:o[Y]}r&&(r(c),delete t.onTagObj);let p=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new y(s);return e?p.tag=e:c.default||(p.tag=c.tag),a&&(a.node=p),p}function qe(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return oe(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Ae=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,Oe=class extends ue{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>I(n)||T(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ae(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(L(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(L(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&E(r)?r.value:r:L(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!T(t))return!1;let n=t.value;return n==null||e&&E(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return L(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(L(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};var Ss=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function J(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var te=(s,e,t)=>s.endsWith(`
|
|
6
6
|
`)?J(t,e):t.includes(`
|
|
7
7
|
`)?`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.354 | (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 me,b as We}from"./chunk-4IXIONDR.js";import{a as Je,b as Qe,d as et}from"./chunk-TX2T5KPQ.js";import{a as Le,b as Ae,c as I,d as ce,e as D,f as de,g as Ne,h as ue,i as Fe,j as je,l as Ve,m as ze,n as Ge}from"./chunk-5DLBRZAG.js";import{m as L}from"./chunk-UNBVUOIC.js";import{m as Ye,p as Ze}from"./chunk-CMQIFA4L.js";import{e as Xe}from"./chunk-HVLZYUGF.js";import{c as He}from"./chunk-BK5TJXUU.js";import{a as qe}from"./chunk-7FUSVOMH.js";import{a as Ke}from"./chunk-GAYCF2O5.js";import{b as se,d as Oe}from"./chunk-VZDW2U64.js";import{b as Te,f as _e,g as B,h as $,i as M,k as Be,l as ae,m as le,o as Me,p as De,q as U,r as P,s as E}from"./chunk-ELBDKQK2.js";import{f as Ee}from"./chunk-IX7W5BXL.js";import{a as Ue}from"./chunk-6NE5Z6KG.js";import{D as Ce,M as oe,P as ie,R as _,T as Re,l as re}from"./chunk-WKQ6W74M.js";import{a as ne}from"./chunk-PBTG4UCS.js";import{spawn as st,spawnSync as at}from"node:child_process";import O from"node:fs";import Dt from"node:os";import C from"node:path";import{WebSocket as pe}from"ws";function tt(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function Ut(e,n){return e?.includes("/one/metro-entry.bundle")?"one":typeof n=="string"&&n?"expo":"unknown"}function Et(e,n,t){return`${e}//${n}:${t}`}function Ot(e){if(typeof window>"u")return!1;try{let n=new URL(e);return I(n.hostname)&&I(window.location.hostname)&&n.origin!==window.location.origin}catch{return!1}}async function nt(e,n){let t={...n,cache:n?.cache??"no-store"};return Ot(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Tt(e){return e==="https:"?443:80}function _t(e){let n=e.pathname||"/";return(n==="/"||n==="")&&!e.search&&!e.hash}async function rt(e){try{let n=await fetch("/__server-scan",{cache:"no-store"});if(!n.ok||!(n.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await n.json();if(!Array.isArray(t))return null;let r=t.find(o=>!!o&&typeof o=="object"&&o.port===e&&typeof o.bundleUrl=="string");return r?{bundleUrl:ue(r.bundleUrl),port:e,framework:typeof r.framework=="string"?r.framework:"unknown",projectName:typeof r.projectName=="string"?r.projectName:void 0}:null}catch{return null}}async function ot(e,n){let t=e.replace(/\/+$/,"");try{let r=await nt(`${t}/`,{headers:{"expo-platform":"ios"}});if(r.ok){let o=await r.json(),i=o?.extra?.expoClient||o?.extra||{},s=typeof o?.launchAsset?.url=="string"?o.launchAsset.url:void 0,a=s?Ne(s,t):void 0;if(a||i.name)return{bundleUrl:ue(a||`${t}${de}`),port:n,framework:Ut(a,i.sdkVersion),projectName:i.name}}}catch{}try{let r=await nt(`${t}/status`);if(r.ok&&(await r.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:n,framework:"metro"}}catch{}return null}async function Bt(e,n){try{if(I(new URL(e).hostname)){let t=await rt(n);if(t)return t}}catch{}return ot(e,n)}async function Mt(e){let n=await rt(e);return n||((await Promise.all(Le.map(r=>ot(Ae("http:",r,e),e)))).find(r=>r!==null)??null)}async function it(e){let n=e.trim();if(/^\d+$/.test(n)){let a=parseInt(n,10),l=await Mt(a);if(l)return l;throw tt(`localhost:${a}`)}let t=n.startsWith("http")?n:`http://${n}`,r;try{r=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let o=r.protocol||"http:",i=r.port?parseInt(r.port,10):Tt(o),s=Et(o,r.hostname,i);if(_t(r)){let a=await Bt(s,i);if(a)return a;throw tt(s)}return{bundleUrl:r.toString(),port:i,framework:"unknown"}}var Lt=12e4,lt=100,At=5e3,ct=1e4,Nt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function S(e){return new Promise(n=>setTimeout(n,e))}function dt(e){let n=process.env[e]?.trim();if(!n)return null;let t=Number(n);return Number.isInteger(t)&&t>0?t:null}function Ft(){let e=dt("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??dt("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Lt;return{timeoutMs:e,hostTimeoutMs:e+At,intervalMs:lt,attempts:Math.max(1,Math.ceil(e/lt))}}function ut(e){return e==="electron"||e==="playwright"}function fe(e,n){return n==="playwright"?e.meta?.sootsimHostDriver==="playwright":e.userAgent?.includes("Electron/")===!0}function jt(e,n){return e.includes("--headless")?!0:e.includes("--headed")?!1:n==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function z(e){return e.trim()}var bt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Ht(e){let n=e.trim();if(!n)throw new Error("expected <url-or-route>");return bt.test(n)||n.startsWith("/")?n:`/${n}`}function Wt(e){return e!==null&&typeof e=="object"}function Kt(e){let n=e.trim();return n?n.startsWith("/")?!0:bt.test(n)?!/^https?:\/\//i.test(n):!1:!1}async function qt(e,n=!1){let t=ie();mt(e,n,t);let r=ae(e);if((n||r!==null)&&await ge(e,250))return e;if(t&&_(t)&&await ge(t.bridgePort,500))return t.bridgePort;if(t&&_(t))throw new Error(`rnx bridge lockfile is fresh (port ${t.bridgePort}) but the bridge is not reachable. run \`rnx daemon restart\` or \`rnx daemon uninstall\`.`);await Vt();let o=zt(["serve","--quiet","--port",String(e)]),i=null;o.once("exit",(a,l)=>{i=String(a??l??"unknown")}),o.unref();let s=Date.now()+ct;for(;Date.now()<s;){let a=ie();if(mt(e,n,a),a&&_(a)&&await ge(a.bridgePort,250))return console.error(` Started a local bridge on port ${a.bridgePort}. Run \`rnx daemon install\` to keep it ready between commands.`),a.bridgePort;if(i)throw new Error(`rnx bridge exited before becoming ready (exit ${i})`);await S(150)}throw new Error(`rnx bridge did not start within ${Math.round(ct/1e3)}s`)}function mt(e,n,t){if(!(!n||!t||!_(t)||t.bridgePort===e))throw new Error(`${ne.commandName} open: requested bridge port ${e}, but the active daemon owns port ${t.bridgePort}. explicit --port never selects another bridge; stop that daemon or use an isolated SOOTSIM_HOME.`)}async function Vt(){let e=oe();if(e&&O.existsSync(re(e)))return;console.error(" installing rnx engine runtime...");let{runRuntime:n}=await import("./runtime-RT2OTIQC.js");await n(["install"],{})}function zt(e){let n=process.argv[1];return n&&O.existsSync(n)?st(process.execPath,[n,...e],{detached:!0,stdio:"ignore",env:process.env}):st(ne.commandName,e,{detached:!0,stdio:"ignore",env:process.env})}function ge(e,n){return new Promise(t=>{let r=new pe(`ws://127.0.0.1:${e}`,{handshakeTimeout:n}),o=!1,i=s=>{o||(o=!0,r.readyState===pe.OPEN?r.close():r.readyState===pe.CONNECTING&&r.terminate(),t(s))};r.once("open",()=>i(!0)),r.on("error",()=>i(!1)),setTimeout(()=>i(!1),n)})}function we(e){try{let n=new URL(e),t=n.pathname.replace(/\/+$/,"")||"/";return n.searchParams.has("open")||n.searchParams.has("port")||n.searchParams.has("bundle")||n.searchParams.has("demo")||n.pathname.includes("/sootsim/index.html")||t==="/sootsim"||n.pathname==="/__soot"||n.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Gt(e){try{let n=new URL(e,"http://sootsim.local");if(n.origin!=="http://sootsim.local")return!1;let t=n.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Jt(e,n){let t=new URL(e,"http://sootsim.local"),r=new URL(n),o=G(r.pathname),i=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return r.pathname=`${o}${i}`,r.search=t.search,r.hash=t.hash,r.toString()}function Qt(e){try{let n=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(n)||/^\/build\/.+/.test(n)}catch{return!1}}async function ir(e){let n=z(e);return(await ve(n)).bundleUrl}function Yt(e){try{let n=new URL(e.startsWith("http")?e:`http://${e}`),t=n.pathname||"/";if(t!=="/"&&t!==""||n.search||n.hash||!I(n.hostname))return null;let r=n.port?Number(n.port):n.protocol==="https:"?443:80;return Number.isFinite(r)&&r>0?r:null}catch{return null}}async function ve(e){let n=z(e),t=/^\d+$/.test(n)?Number(n):Yt(n);if(t&&t>0){let r=await je(t);if(r)return{bundleUrl:r.bundleUrl,port:r.port,framework:r.framework,projectName:r.projectName}}return it(n)}function G(e){let n=e.replace(/\/+$/,"")||"/";return n==="/__soot"||n.startsWith("/__soot/")?"/__soot":""}function Zt(e,n){let t=z(e),r=new URL(n),o=G(r.pathname);return r.pathname=`${o}/rn`,r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),/^\d+$/.test(t)?r.pathname=`${o}/rn/${t}`:(r.pathname=`${o}/rn`,r.searchParams.set("open",t)),r.toString()}function vt(e){let n=z(e);return/^\d+$/.test(n)||/^https?:\/\//i.test(n)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(n)}async function Xt(e,n,t={}){let r=t.resolvedBundle??await ve(e),o=new URL(n),i=G(o.pathname);o.pathname=`${i}/rn`,o.searchParams.delete("open"),o.searchParams.delete("port"),o.searchParams.delete("demo"),o.searchParams.delete("app");let s=t.hot===void 0?r.bundleUrl:Fe(r.bundleUrl,t.hot);return o.searchParams.set("bundle",s),o.toString()}function en(e){return e.startsWith("~/")?C.join(Dt.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function tn(e){let n={},t={};for(let o=0;o<e.length;o++){if(e[o]==="--replace"){let i=e[o+1];i||(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let s=i.indexOf("=");(s<=0||s===i.length-1)&&(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let a=i.slice(0,s).trim(),l=en(i.slice(s+1).trim());O.existsSync(l)||(console.error(` rnx open: replacement file not found: ${l}`),process.exit(1)),n[a]={file:l},o++;continue}if(e[o]==="--remap"){let i=e[o+1],s=i?i.indexOf("="):-1;(!i||s<=0||s===i.length-1)&&(console.error(" rnx open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[i.slice(0,s).trim()]=i.slice(s+1).trim(),o++;continue}}let r={};return Object.keys(n).length>0&&(r.modules=n),Object.keys(t).length>0&&(r.network={remap:t}),r.modules||r.network?r:void 0}async function nn(e){if(!e)return null;let n=await ze(e.bundleUrl);return n?Ke(n):null}async function rn(e){if(O.existsSync(C.join(re(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let n=await Ee.install({version:e,setActive:!1,protectVersions:Re()});console.error(` installed engine runtime ${n.version}`)}function on(e,n){let t=n??(me()?void 0:oe()??void 0);if(!t)return e;let r=new URL(e);if(!I(r.hostname)){if(!n)return e;throw new Error(`runtimeVersion ${t} requires a local rnx host; got ${r.origin}`)}return r.hostname=We(t),r.toString()}function yt(){return Be().shellBaseUrl}function sn(e){return ae(e)?.shellBaseUrl??Te(e)??yt()}async function an(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Ve({bundleUrl:r,projectDir:n.appDir});if(o.length===0)return e;let i=await ln(o);return i.length===0?e:(t.searchParams.set("appFonts",Ge(i)),t.toString())}catch{return e}}async function ln(e){let n=await Promise.all(e.map(async r=>{let o=new AbortController,i=setTimeout(()=>o.abort(),1500);try{let s=await fetch(r.url,{method:"HEAD",signal:o.signal});return s.status>=200&&s.status<400?r:null}catch{return null}finally{clearTimeout(i)}})),t=[];for(let r of n)r!==null&&t.push(r);return t}async function cn(e,n,t={}){if(!e)return new URL(n).toString();if(we(e))return new URL(e).toString();if(Gt(e))return Jt(e,n);let r=Nt[e.toLowerCase()];if(r){let o=new URL(n),i=G(o.pathname);return o.pathname=`${i}${r}`,o.toString()}return vt(e)?Xt(e,n,t):Zt(e,n)}async function dn(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Je({bundleUrl:r,projectDir:n.appDir});return!o||o.imageUrl&&!await un(o.imageUrl)?e:(t.searchParams.set("appSplash",Qe(o)),t.toString())}catch{return e}}async function un(e){let n=new AbortController,t=setTimeout(()=>n.abort(),1500);try{let r=await fetch(e,{method:"HEAD",signal:n.signal});return r.status>=200&&r.status<400}catch{return!1}finally{clearTimeout(t)}}async function V(e,n=yt(),t={}){let r=await cn(e,n,t),o=await dn(await an(r,t.project),t.project);if(!t.device)return o;let i=new URL(o);return i.searchParams.set("device",t.device),i.toString()}function pt(e,n){let t=e?.url||e?.origin||n;try{let r=new URL(t);return r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("inspectOpen"),r.searchParams.delete("appFonts"),r.searchParams.delete("appSplash"),r.toString()}catch{return n}}async function mn(e,n,t,r={}){let o=new URL(await V(e,n,r));return o.searchParams.set("inspectOpen",t),o.toString()}async function pn(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500,s=r.minNodeCount??10;for(let a=0;a<o;a++){let l=P(e,{commandTimeoutMs:n,simId:t,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>s)return{bridge:l,count:c}}catch{}l.close(),await S(i)}return null}function fn(e){if(!e)return null;try{let n=new URL(e);if(n.searchParams.has("bundle")){let t=n.searchParams.get("bundle")||"";try{let r=new URL(t),o=r.pathname.length>36?`...${r.pathname.slice(-36)}`:r.pathname;return`bundle ${r.host}${o}`}catch{return"bundle"}}return n.searchParams.has("port")?`connect :${n.searchParams.get("port")||""}`:n.searchParams.has("open")?`connect ${n.searchParams.get("open")||""}`:n.searchParams.has("demo")?`demo ${n.searchParams.get("demo")||"default"}`:n.pathname.includes("/sootsim/index.html")||n.pathname==="/sootsim/"||n.pathname==="/sootsim"?"embedded rnx":null}catch{return null}}function gn(e){let n=e.indexOf(":");if(n<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,n),r=e.slice(n+1),o=r.length>12?`${r.slice(0,8)}\u2026`:r;return t==="TM_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${o}`:`${t} ${o}`}function sr(e,n){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
4
|
+
import{a as me,b as We}from"./chunk-ZNABCRWX.js";import{a as Je,b as Qe,d as et}from"./chunk-BNXXNT3I.js";import{a as Le,b as Ae,c as I,d as ce,e as D,f as de,g as Ne,h as ue,i as Fe,j as je,l as Ve,m as ze,n as Ge}from"./chunk-IGV4KCCM.js";import{m as L}from"./chunk-766UIGCS.js";import{m as Ye,p as Ze}from"./chunk-UAYXEP74.js";import{e as Xe}from"./chunk-JT435OOM.js";import{c as He}from"./chunk-P4GCLNFM.js";import{a as qe}from"./chunk-YIUIFZAE.js";import{a as Ke}from"./chunk-THFM2CFT.js";import{b as se,d as Oe}from"./chunk-X2DJK3TB.js";import{b as Te,f as _e,g as B,h as $,i as M,k as Be,l as ae,m as le,o as Me,p as De,q as U,r as P,s as E}from"./chunk-JJOHJNUQ.js";import{f as Ee}from"./chunk-4OS3SXPZ.js";import{a as Ue}from"./chunk-OKFSCCFC.js";import{D as Ce,M as oe,P as ie,R as _,T as Re,l as re}from"./chunk-LETVUC6M.js";import{a as ne}from"./chunk-UI2IFVHB.js";import{spawn as st,spawnSync as at}from"node:child_process";import O from"node:fs";import Dt from"node:os";import C from"node:path";import{WebSocket as pe}from"ws";function tt(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function Ut(e,n){return e?.includes("/one/metro-entry.bundle")?"one":typeof n=="string"&&n?"expo":"unknown"}function Et(e,n,t){return`${e}//${n}:${t}`}function Ot(e){if(typeof window>"u")return!1;try{let n=new URL(e);return I(n.hostname)&&I(window.location.hostname)&&n.origin!==window.location.origin}catch{return!1}}async function nt(e,n){let t={...n,cache:n?.cache??"no-store"};return Ot(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Tt(e){return e==="https:"?443:80}function _t(e){let n=e.pathname||"/";return(n==="/"||n==="")&&!e.search&&!e.hash}async function rt(e){try{let n=await fetch("/__server-scan",{cache:"no-store"});if(!n.ok||!(n.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await n.json();if(!Array.isArray(t))return null;let r=t.find(o=>!!o&&typeof o=="object"&&o.port===e&&typeof o.bundleUrl=="string");return r?{bundleUrl:ue(r.bundleUrl),port:e,framework:typeof r.framework=="string"?r.framework:"unknown",projectName:typeof r.projectName=="string"?r.projectName:void 0}:null}catch{return null}}async function ot(e,n){let t=e.replace(/\/+$/,"");try{let r=await nt(`${t}/`,{headers:{"expo-platform":"ios"}});if(r.ok){let o=await r.json(),i=o?.extra?.expoClient||o?.extra||{},s=typeof o?.launchAsset?.url=="string"?o.launchAsset.url:void 0,a=s?Ne(s,t):void 0;if(a||i.name)return{bundleUrl:ue(a||`${t}${de}`),port:n,framework:Ut(a,i.sdkVersion),projectName:i.name}}}catch{}try{let r=await nt(`${t}/status`);if(r.ok&&(await r.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:n,framework:"metro"}}catch{}return null}async function Bt(e,n){try{if(I(new URL(e).hostname)){let t=await rt(n);if(t)return t}}catch{}return ot(e,n)}async function Mt(e){let n=await rt(e);return n||((await Promise.all(Le.map(r=>ot(Ae("http:",r,e),e)))).find(r=>r!==null)??null)}async function it(e){let n=e.trim();if(/^\d+$/.test(n)){let a=parseInt(n,10),l=await Mt(a);if(l)return l;throw tt(`localhost:${a}`)}let t=n.startsWith("http")?n:`http://${n}`,r;try{r=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let o=r.protocol||"http:",i=r.port?parseInt(r.port,10):Tt(o),s=Et(o,r.hostname,i);if(_t(r)){let a=await Bt(s,i);if(a)return a;throw tt(s)}return{bundleUrl:r.toString(),port:i,framework:"unknown"}}var Lt=12e4,lt=100,At=5e3,ct=1e4,Nt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function S(e){return new Promise(n=>setTimeout(n,e))}function dt(e){let n=process.env[e]?.trim();if(!n)return null;let t=Number(n);return Number.isInteger(t)&&t>0?t:null}function Ft(){let e=dt("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??dt("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Lt;return{timeoutMs:e,hostTimeoutMs:e+At,intervalMs:lt,attempts:Math.max(1,Math.ceil(e/lt))}}function ut(e){return e==="electron"||e==="playwright"}function fe(e,n){return n==="playwright"?e.meta?.sootsimHostDriver==="playwright":e.userAgent?.includes("Electron/")===!0}function jt(e,n){return e.includes("--headless")?!0:e.includes("--headed")?!1:n==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function z(e){return e.trim()}var bt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Ht(e){let n=e.trim();if(!n)throw new Error("expected <url-or-route>");return bt.test(n)||n.startsWith("/")?n:`/${n}`}function Wt(e){return e!==null&&typeof e=="object"}function Kt(e){let n=e.trim();return n?n.startsWith("/")?!0:bt.test(n)?!/^https?:\/\//i.test(n):!1:!1}async function qt(e,n=!1){let t=ie();mt(e,n,t);let r=ae(e);if((n||r!==null)&&await ge(e,250))return e;if(t&&_(t)&&await ge(t.bridgePort,500))return t.bridgePort;if(t&&_(t))throw new Error(`rnx bridge lockfile is fresh (port ${t.bridgePort}) but the bridge is not reachable. run \`rnx daemon restart\` or \`rnx daemon uninstall\`.`);await Vt();let o=zt(["serve","--quiet","--port",String(e)]),i=null;o.once("exit",(a,l)=>{i=String(a??l??"unknown")}),o.unref();let s=Date.now()+ct;for(;Date.now()<s;){let a=ie();if(mt(e,n,a),a&&_(a)&&await ge(a.bridgePort,250))return console.error(` Started a local bridge on port ${a.bridgePort}. Run \`rnx daemon install\` to keep it ready between commands.`),a.bridgePort;if(i)throw new Error(`rnx bridge exited before becoming ready (exit ${i})`);await S(150)}throw new Error(`rnx bridge did not start within ${Math.round(ct/1e3)}s`)}function mt(e,n,t){if(!(!n||!t||!_(t)||t.bridgePort===e))throw new Error(`${ne.commandName} open: requested bridge port ${e}, but the active daemon owns port ${t.bridgePort}. explicit --port never selects another bridge; stop that daemon or use an isolated SOOTSIM_HOME.`)}async function Vt(){let e=oe();if(e&&O.existsSync(re(e)))return;console.error(" installing rnx engine runtime...");let{runRuntime:n}=await import("./runtime-VOEIOODA.js");await n(["install"],{})}function zt(e){let n=process.argv[1];return n&&O.existsSync(n)?st(process.execPath,[n,...e],{detached:!0,stdio:"ignore",env:process.env}):st(ne.commandName,e,{detached:!0,stdio:"ignore",env:process.env})}function ge(e,n){return new Promise(t=>{let r=new pe(`ws://127.0.0.1:${e}`,{handshakeTimeout:n}),o=!1,i=s=>{o||(o=!0,r.readyState===pe.OPEN?r.close():r.readyState===pe.CONNECTING&&r.terminate(),t(s))};r.once("open",()=>i(!0)),r.on("error",()=>i(!1)),setTimeout(()=>i(!1),n)})}function we(e){try{let n=new URL(e),t=n.pathname.replace(/\/+$/,"")||"/";return n.searchParams.has("open")||n.searchParams.has("port")||n.searchParams.has("bundle")||n.searchParams.has("demo")||n.pathname.includes("/sootsim/index.html")||t==="/sootsim"||n.pathname==="/__soot"||n.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Gt(e){try{let n=new URL(e,"http://sootsim.local");if(n.origin!=="http://sootsim.local")return!1;let t=n.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Jt(e,n){let t=new URL(e,"http://sootsim.local"),r=new URL(n),o=G(r.pathname),i=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return r.pathname=`${o}${i}`,r.search=t.search,r.hash=t.hash,r.toString()}function Qt(e){try{let n=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(n)||/^\/build\/.+/.test(n)}catch{return!1}}async function ir(e){let n=z(e);return(await ve(n)).bundleUrl}function Yt(e){try{let n=new URL(e.startsWith("http")?e:`http://${e}`),t=n.pathname||"/";if(t!=="/"&&t!==""||n.search||n.hash||!I(n.hostname))return null;let r=n.port?Number(n.port):n.protocol==="https:"?443:80;return Number.isFinite(r)&&r>0?r:null}catch{return null}}async function ve(e){let n=z(e),t=/^\d+$/.test(n)?Number(n):Yt(n);if(t&&t>0){let r=await je(t);if(r)return{bundleUrl:r.bundleUrl,port:r.port,framework:r.framework,projectName:r.projectName}}return it(n)}function G(e){let n=e.replace(/\/+$/,"")||"/";return n==="/__soot"||n.startsWith("/__soot/")?"/__soot":""}function Zt(e,n){let t=z(e),r=new URL(n),o=G(r.pathname);return r.pathname=`${o}/rn`,r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),/^\d+$/.test(t)?r.pathname=`${o}/rn/${t}`:(r.pathname=`${o}/rn`,r.searchParams.set("open",t)),r.toString()}function vt(e){let n=z(e);return/^\d+$/.test(n)||/^https?:\/\//i.test(n)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(n)}async function Xt(e,n,t={}){let r=t.resolvedBundle??await ve(e),o=new URL(n),i=G(o.pathname);o.pathname=`${i}/rn`,o.searchParams.delete("open"),o.searchParams.delete("port"),o.searchParams.delete("demo"),o.searchParams.delete("app");let s=t.hot===void 0?r.bundleUrl:Fe(r.bundleUrl,t.hot);return o.searchParams.set("bundle",s),o.toString()}function en(e){return e.startsWith("~/")?C.join(Dt.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function tn(e){let n={},t={};for(let o=0;o<e.length;o++){if(e[o]==="--replace"){let i=e[o+1];i||(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let s=i.indexOf("=");(s<=0||s===i.length-1)&&(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let a=i.slice(0,s).trim(),l=en(i.slice(s+1).trim());O.existsSync(l)||(console.error(` rnx open: replacement file not found: ${l}`),process.exit(1)),n[a]={file:l},o++;continue}if(e[o]==="--remap"){let i=e[o+1],s=i?i.indexOf("="):-1;(!i||s<=0||s===i.length-1)&&(console.error(" rnx open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[i.slice(0,s).trim()]=i.slice(s+1).trim(),o++;continue}}let r={};return Object.keys(n).length>0&&(r.modules=n),Object.keys(t).length>0&&(r.network={remap:t}),r.modules||r.network?r:void 0}async function nn(e){if(!e)return null;let n=await ze(e.bundleUrl);return n?Ke(n):null}async function rn(e){if(O.existsSync(C.join(re(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let n=await Ee.install({version:e,setActive:!1,protectVersions:Re()});console.error(` installed engine runtime ${n.version}`)}function on(e,n){let t=n??(me()?void 0:oe()??void 0);if(!t)return e;let r=new URL(e);if(!I(r.hostname)){if(!n)return e;throw new Error(`runtimeVersion ${t} requires a local rnx host; got ${r.origin}`)}return r.hostname=We(t),r.toString()}function yt(){return Be().shellBaseUrl}function sn(e){return ae(e)?.shellBaseUrl??Te(e)??yt()}async function an(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Ve({bundleUrl:r,projectDir:n.appDir});if(o.length===0)return e;let i=await ln(o);return i.length===0?e:(t.searchParams.set("appFonts",Ge(i)),t.toString())}catch{return e}}async function ln(e){let n=await Promise.all(e.map(async r=>{let o=new AbortController,i=setTimeout(()=>o.abort(),1500);try{let s=await fetch(r.url,{method:"HEAD",signal:o.signal});return s.status>=200&&s.status<400?r:null}catch{return null}finally{clearTimeout(i)}})),t=[];for(let r of n)r!==null&&t.push(r);return t}async function cn(e,n,t={}){if(!e)return new URL(n).toString();if(we(e))return new URL(e).toString();if(Gt(e))return Jt(e,n);let r=Nt[e.toLowerCase()];if(r){let o=new URL(n),i=G(o.pathname);return o.pathname=`${i}${r}`,o.toString()}return vt(e)?Xt(e,n,t):Zt(e,n)}async function dn(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Je({bundleUrl:r,projectDir:n.appDir});return!o||o.imageUrl&&!await un(o.imageUrl)?e:(t.searchParams.set("appSplash",Qe(o)),t.toString())}catch{return e}}async function un(e){let n=new AbortController,t=setTimeout(()=>n.abort(),1500);try{let r=await fetch(e,{method:"HEAD",signal:n.signal});return r.status>=200&&r.status<400}catch{return!1}finally{clearTimeout(t)}}async function V(e,n=yt(),t={}){let r=await cn(e,n,t),o=await dn(await an(r,t.project),t.project);if(!t.device)return o;let i=new URL(o);return i.searchParams.set("device",t.device),i.toString()}function pt(e,n){let t=e?.url||e?.origin||n;try{let r=new URL(t);return r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("inspectOpen"),r.searchParams.delete("appFonts"),r.searchParams.delete("appSplash"),r.toString()}catch{return n}}async function mn(e,n,t,r={}){let o=new URL(await V(e,n,r));return o.searchParams.set("inspectOpen",t),o.toString()}async function pn(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500,s=r.minNodeCount??10;for(let a=0;a<o;a++){let l=P(e,{commandTimeoutMs:n,simId:t,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>s)return{bridge:l,count:c}}catch{}l.close(),await S(i)}return null}function fn(e){if(!e)return null;try{let n=new URL(e);if(n.searchParams.has("bundle")){let t=n.searchParams.get("bundle")||"";try{let r=new URL(t),o=r.pathname.length>36?`...${r.pathname.slice(-36)}`:r.pathname;return`bundle ${r.host}${o}`}catch{return"bundle"}}return n.searchParams.has("port")?`connect :${n.searchParams.get("port")||""}`:n.searchParams.has("open")?`connect ${n.searchParams.get("open")||""}`:n.searchParams.has("demo")?`demo ${n.searchParams.get("demo")||"default"}`:n.pathname.includes("/sootsim/index.html")||n.pathname==="/sootsim/"||n.pathname==="/sootsim"?"embedded rnx":null}catch{return null}}function gn(e){let n=e.indexOf(":");if(n<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,n),r=e.slice(n+1),o=r.length>12?`${r.slice(0,8)}\u2026`:r;return t==="TM_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${o}`:`${t} ${o}`}function sr(e,n){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
5
5
|
`);for(let t of e){let r=t.lockedBy&&t.lockExpiresAt?`locked by ${gn(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",o=[t.isPrimary?"primary":"",t.id===n?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",r].filter(Boolean);console.log(` ${t.id}${o.length?` [${o.join(", ")}]`:""}`);let i=fn(t.url);if(i)console.log(` loaded: ${i}`);else if(t.url){let a=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${a}`)}else t.origin&&console.log(` origin: ${t.origin}`);let s=hn(t);s&&console.log(` engine: ${s}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${ft(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${ft(Date.now()-t.lastActiveAt)}`)}}function hn(e){let n=e.url||e.origin||"";if(!n)return null;try{let t=new URL(n).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"Contrast app embedded (:3000)":me()?`dev \u2014 local build (:${t||"?"})`:`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function ft(e){let n=Math.max(0,Math.round(e/1e3));return n<60?`${n}s ago`:n<3600?`${Math.round(n/60)}m ago`:n<86400?`${Math.round(n/3600)}h ago`:`${Math.round(n/86400)}d ago`}async function ar(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500;for(let s=0;s<o;s++){let a=P(e,{commandTimeoutMs:n});try{let c=(await a.listSims()).find(t);if(c)return c}catch{}finally{a.close()}await S(i)}return null}async function wn(e,n,t,r,o={}){let i=o.attempts??30,s=o.intervalMs??500,a=!!r&&Number.isInteger(r)&&r>1,l=()=>a&&r!==void 0&&!be(r);for(let c=0;c<i;c++){if(l())return{kind:"host-exit"};let u=P(e,{commandTimeoutMs:n});try{let g=(await u.listSims()).find(t);if(g)return l()?{kind:"host-exit"}:{kind:"match",sim:g}}catch{}finally{u.close()}if(l())return{kind:"host-exit"};await S(s)}return{kind:"timeout"}}async function bn(e,n,t,r={}){let o=r.attempts??20,i=r.intervalMs??250;for(let s=0;s<o;s++){let a=P(e,{commandTimeoutMs:n});try{let c=(await a.listSims()).find(u=>u.id===t);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{a.close()}await S(i)}return!1}function vn(e){let n=e.meta;if(!n||n.sootsimHostDriver!=="playwright")return null;let t=Number(n.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function yn(e){if(!e.connectAckFile)return!1;try{return O.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
|
|
6
6
|
`,{flag:"w"}),!0}catch{return!1}}function gt(e){if(e.diagnosticLogPath)try{let n=O.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!n){console.error(` ${C.basename(e.diagnosticLogPath)} was empty`);return}let t=n.length>4e3?`\u2026
|
|
7
7
|
${n.slice(-4e3)}`:n;console.error(` ${C.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(n){let t=n instanceof Error?n.message:String(n);console.error(` failed to read ${C.basename(e.diagnosticLogPath)}: ${t}`)}}function be(e){try{return process.kill(e,0),!0}catch(n){return n?.code==="EPERM"}}async function Sn(e,n=2500){let t=Date.now()+n;for(;Date.now()<t;){if(!be(e))return!0;await S(100)}return!be(e)}function xn(e){let n=at("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),t=at("ps",["eww","-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(n.status!==0||t.status!==0)return!1;let r=(n.stdout||"").trimEnd(),o=(t.stdout||"").trimEnd();return(o.startsWith(r)?o.slice(r.length):o).includes("SOOTSIM_PW_URL=")}async function he(e,n){let t=new Set(n),r=new Set;for(let o of e){if(!t.has(o.id))continue;let i=vn(o);i&&r.add(i)}for(let o of r){if(!xn(o)){console.log(` skipped pid ${o}: not a rnx playwright host (stale sim record)`);continue}try{process.kill(o,"SIGTERM")}catch{}if(await Sn(o)){console.log(` closed playwright host process ${o}`);continue}try{process.kill(o,"SIGKILL"),console.log(` force-closed playwright host process ${o}`)}catch{}}}function J(e,n){if(n){let o=n.trim(),i=e.find(s=>s.id===o);if(!i)throw new Error(`no sim connected with id ${o}`);return i}let t=e.find(o=>o.isPrimary&&o.readyState==="open");if(t)return t;let r=e.find(o=>o.readyState==="open");if(r)return r;throw new Error("no sim connected")}function ht(e,n,t,r=!1){let[o,i]=[e,n.url].map(s=>{if(!s)return s;try{let a=new URL(s);if(a.searchParams.has("sootsimConfig"))return a.searchParams.set("sootsimConfig","[redacted]"),a.toString()}catch{}return s});if(r){console.log(` Opened ConnectRN [${t}]`);return}console.log(` ${t==="current sim"?"loaded":"opened"}: ${o} [${t}]`),console.log(` current sim: ${n.id}`),console.log(JSON.stringify({simId:n.id,url:i},null,2))}async function wt(e,n,t){if(t.includes("--no-describe"))return;let r=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await $n(e,n,{stableMs:150,maxMs:400});let o=P(e,{commandTimeoutMs:3e3,simId:n,cliLabel:"open --describe",simIdSource:"flag"});try{let i=null;try{i=await o.send({type:"evaluate",code:Ye})}catch{}if(i&&!(i.flag===!0&&!i.loadingText&&Ze(i))){let u=i.loadingText?`still showing "${i.loadingText}"`:i.flag!==!0?"guest ready event has not fired":i.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${u} (nodes: ${i.nodes}, targets: ${i.targets})`),console.log(" before interacting, run: rnx wait ready --max-ms 120000")}let a=`(async () => {
|