rnxsim 0.1.370 → 0.1.372
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/cli/bin.ts +2 -2
- package/cli/commands/box/checkout-plane.ts +65 -14
- package/cli/commands/box/cloud-box.ts +294 -0
- package/cli/commands/box/plane-share.ts +208 -0
- package/cli/commands/box/rnx-command.ts +2 -2
- package/cli/commands/box/search-command.ts +157 -0
- package/cli/commands/box.ts +269 -13
- package/cli/commands/control.ts +6 -1
- package/cli/outbound-endpoints.ts +37 -1
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-3R4424LW.js → agent-RTAKJ5UM.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-4PPWZWSY.js → agent-wrapper-JWRDI26D.js} +2 -2
- package/dist-cli/chunks/{app-fonts-KYXB6CXQ.js → app-fonts-RKO3N4PB.js} +2 -2
- package/dist-cli/chunks/{assert-7EZOWGYQ.js → assert-Y5LXPWC6.js} +2 -2
- package/dist-cli/chunks/{auth-L7M36H6C.js → auth-4SPTRWTM.js} +2 -2
- package/dist-cli/chunks/{beta-FKAF6YWJ.js → beta-KYS22QPY.js} +2 -2
- package/dist-cli/chunks/{box-5Y5VBMHV.js → box-7CK72ZPF.js} +617 -596
- package/dist-cli/chunks/{camera-XHF2RPFG.js → camera-RUL426MQ.js} +2 -2
- package/dist-cli/chunks/{chunk-EQ3OE2AV.js → chunk-2MA3Q44D.js} +1 -1
- package/dist-cli/chunks/{chunk-DHYTRCIP.js → chunk-2OA2WE7G.js} +2 -2
- package/dist-cli/chunks/{chunk-DMHSD6YJ.js → chunk-3C6LTIDV.js} +2 -2
- package/dist-cli/chunks/{chunk-NR2V2ONN.js → chunk-4UMODU6C.js} +2 -2
- package/dist-cli/chunks/{chunk-Z2VBSNFI.js → chunk-5Q6ZEZFF.js} +1 -1
- package/dist-cli/chunks/{chunk-LUOHRBJG.js → chunk-7FYOZQBM.js} +1 -1
- package/dist-cli/chunks/{chunk-Q4MRJ6PO.js → chunk-BRRWRBW7.js} +2 -2
- package/dist-cli/chunks/chunk-CEQXZ3GA.js +11 -0
- package/dist-cli/chunks/{chunk-DUXHYPBP.js → chunk-CZ2FOZVC.js} +2 -2
- package/dist-cli/chunks/{chunk-CMVRTZ5G.js → chunk-D5AT7UT5.js} +2 -2
- package/dist-cli/chunks/{chunk-D2GZASRV.js → chunk-DQOQQFMP.js} +1 -1
- package/dist-cli/chunks/{chunk-3UXXYJVD.js → chunk-EKSSAC4L.js} +1 -1
- package/dist-cli/chunks/{chunk-5BR33NAZ.js → chunk-EY5OHL2M.js} +1 -1
- package/dist-cli/chunks/{chunk-FK4JSTZ3.js → chunk-FOW2LPM7.js} +2 -2
- package/dist-cli/chunks/{chunk-WFQHT4QD.js → chunk-G5G7PQKO.js} +2 -2
- package/dist-cli/chunks/{chunk-WPV4H5S4.js → chunk-GPYG2L7R.js} +2 -2
- package/dist-cli/chunks/{chunk-3SOPYG7S.js → chunk-H2SKPUSI.js} +2 -2
- package/dist-cli/chunks/{chunk-6A6L3VJR.js → chunk-H567W7JT.js} +2 -2
- package/dist-cli/chunks/{chunk-PAUEZO6F.js → chunk-HDGZAVH3.js} +2 -2
- package/dist-cli/chunks/{chunk-AALKIAUZ.js → chunk-I37LRPZ3.js} +1 -1
- package/dist-cli/chunks/{chunk-JZLDHPB7.js → chunk-I7LRVN5M.js} +2 -2
- package/dist-cli/chunks/{chunk-3BG6UCQY.js → chunk-IX25FFF3.js} +11 -11
- package/dist-cli/chunks/{chunk-72S5FCBY.js → chunk-J2TJRPDB.js} +2 -2
- package/dist-cli/chunks/{chunk-RRX52O37.js → chunk-JPRHJMUJ.js} +1 -1
- package/dist-cli/chunks/{chunk-BMIJZNKD.js → chunk-K4TGUDY4.js} +2 -2
- package/dist-cli/chunks/{chunk-7C7TJYZ3.js → chunk-KSE5XGYU.js} +2 -2
- package/dist-cli/chunks/{chunk-OJZHECGH.js → chunk-KVVNCIJA.js} +1 -1
- package/dist-cli/chunks/{chunk-LXPHL6FO.js → chunk-KWLUOLYQ.js} +2 -2
- package/dist-cli/chunks/{chunk-C7BA5CCM.js → chunk-KXAE64HF.js} +2 -2
- package/dist-cli/chunks/{chunk-EWSWOWXK.js → chunk-L5BEWXQZ.js} +2 -2
- package/dist-cli/chunks/{chunk-D24EOJ4C.js → chunk-LAQKTHRM.js} +2 -2
- package/dist-cli/chunks/{chunk-IDLFVRPN.js → chunk-LWLHVF6Y.js} +1 -1
- package/dist-cli/chunks/{chunk-EOIBLKZO.js → chunk-MKHW3JNL.js} +2 -2
- package/dist-cli/chunks/{chunk-64JAEJ6N.js → chunk-MSM2E74F.js} +1 -1
- package/dist-cli/chunks/{chunk-DXV37CJN.js → chunk-NBEOA72C.js} +1 -1
- package/dist-cli/chunks/{chunk-H5X5FJ63.js → chunk-NLMDMNO6.js} +2 -2
- package/dist-cli/chunks/{chunk-6W4HIWC7.js → chunk-NT43X5LI.js} +2 -2
- package/dist-cli/chunks/{chunk-PNOENVMJ.js → chunk-NWPYM54M.js} +1 -1
- package/dist-cli/chunks/{chunk-O6QLKSAM.js → chunk-OLHHB6LD.js} +2 -2
- package/dist-cli/chunks/{chunk-MDCY532E.js → chunk-P6K6XFWE.js} +2 -2
- package/dist-cli/chunks/{chunk-LIMWG54N.js → chunk-PETP6LVI.js} +1 -1
- package/dist-cli/chunks/{chunk-YIZGNT7A.js → chunk-PKY76S57.js} +1 -1
- package/dist-cli/chunks/chunk-POR7R3TP.js +4 -0
- package/dist-cli/chunks/chunk-PUH6RQBJ.js +7 -0
- package/dist-cli/chunks/{chunk-NJMU5BN6.js → chunk-Q5WPPOFV.js} +1 -1
- package/dist-cli/chunks/{chunk-HQQTS2CB.js → chunk-Q7JSU5DI.js} +3 -3
- package/dist-cli/chunks/{chunk-U63T6LIQ.js → chunk-QA2PTSOC.js} +1 -1
- package/dist-cli/chunks/{chunk-2FOGXVOK.js → chunk-R7HMFLXI.js} +2 -2
- package/dist-cli/chunks/{chunk-FA75F34Z.js → chunk-RXKZJAGY.js} +1 -1
- package/dist-cli/chunks/{chunk-5RKRVS5A.js → chunk-SC7PGULZ.js} +2 -2
- package/dist-cli/chunks/{chunk-UFVAAWGZ.js → chunk-SLTEYNAE.js} +1 -1
- package/dist-cli/chunks/{chunk-6GPS7U4X.js → chunk-SSQCKJQZ.js} +2 -2
- package/dist-cli/chunks/{chunk-ARMXC3C3.js → chunk-SZX6ARJX.js} +3 -3
- package/dist-cli/chunks/{chunk-6S5LJV2O.js → chunk-U3XYGLXG.js} +2 -2
- package/dist-cli/chunks/chunk-UA5WQCBU.js +7 -0
- package/dist-cli/chunks/{chunk-VVQCZ42C.js → chunk-UVKX6FQ4.js} +1 -1
- package/dist-cli/chunks/{chunk-Z3DENGXW.js → chunk-VQQXUXXF.js} +2 -2
- package/dist-cli/chunks/{chunk-I52NT6VG.js → chunk-WR7LRCYW.js} +1 -1
- package/dist-cli/chunks/{chunk-HEKHLQ3B.js → chunk-XA4YU3A4.js} +3 -3
- package/dist-cli/chunks/{chunk-GRO74J2X.js → chunk-YEGWC2OY.js} +1 -1
- package/dist-cli/chunks/{chunk-AVJBT5LF.js → chunk-YWTBN7SD.js} +1 -1
- package/dist-cli/chunks/{chunk-PIZXOXBL.js → chunk-ZRQKEKHX.js} +2 -2
- package/dist-cli/chunks/{chunk-X6WQ4YWE.js → chunk-ZTZTRD5R.js} +1 -1
- package/dist-cli/chunks/{cleanup-MXMMJ7JW.js → cleanup-7ATBNZHC.js} +2 -2
- package/dist-cli/chunks/cli-version-D2IDQO7X.js +4 -0
- package/dist-cli/chunks/{compat-E6KE5KDI.js → compat-4ZC6ZMMA.js} +2 -2
- package/dist-cli/chunks/{config-QSLLVZDS.js → config-EOBODQ32.js} +2 -2
- package/dist-cli/chunks/{connect-QE4VU6GB.js → connect-ZQ72CZ7O.js} +2 -2
- package/dist-cli/chunks/control-FKPKLOE2.js +4 -0
- package/dist-cli/chunks/daemon-WFHWS3JU.js +4 -0
- package/dist-cli/chunks/{debug-5FG3MBJS.js → debug-7Z325GNU.js} +3 -3
- package/dist-cli/chunks/{desktop-5EZX7NX5.js → desktop-CR7ALX7H.js} +3 -3
- package/dist-cli/chunks/{detox-WJGQP5TM.js → detox-RZ37736M.js} +2 -2
- package/dist-cli/chunks/{device-D7LKCAMS.js → device-TA3SQP6K.js} +2 -2
- package/dist-cli/chunks/{diagnose-A3W6ZTGA.js → diagnose-JFKFKR3S.js} +2 -2
- package/dist-cli/chunks/disk-cleanup-HZM7VM4S.js +4 -0
- package/dist-cli/chunks/{do-chain-RUJNRPPF.js → do-chain-MTT65YNX.js} +2 -2
- package/dist-cli/chunks/drivers-BXEXWRVJ.js +4 -0
- package/dist-cli/chunks/{env-U67SQVTV.js → env-SFI24PLS.js} +2 -2
- package/dist-cli/chunks/{film-XC6UAQ3V.js → film-GPHSJLIH.js} +3 -3
- package/dist-cli/chunks/flow-FBCU3TZN.js +4 -0
- package/dist-cli/chunks/help-6MLROWYO.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-7S2TNZXG.js → hidden-runtime-alias-7Z6PYH53.js} +2 -2
- package/dist-cli/chunks/{home-paths-LMO5LB4F.js → home-paths-MEGVA6ET.js} +2 -2
- package/dist-cli/chunks/inspect-EWT5SXBD.js +4 -0
- package/dist-cli/chunks/install-desktop-IFBUH7MH.js +4 -0
- package/dist-cli/chunks/{login-JIU42S4C.js → login-EHUZYRAM.js} +2 -2
- package/dist-cli/chunks/{logout-JTAWQXZO.js → logout-WPGT62N6.js} +2 -2
- package/dist-cli/chunks/{maestro-TYBQYOGB.js → maestro-4HVDLCTI.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-YLAGWVKE.js → maestro-generate-VBS2EZMM.js} +3 -3
- package/dist-cli/chunks/{mode-DV24ZRZ6.js → mode-MGTS4QTF.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-JZH66VIM.js → optional-demo-registry-F3FQT5WT.js} +2 -2
- package/dist-cli/chunks/{perf-LXXJ4EAX.js → perf-47R3OEI7.js} +2 -2
- package/dist-cli/chunks/{permissions-KAOVZUPW.js → permissions-ZOLFZWR2.js} +2 -2
- package/dist-cli/chunks/{platform-KW35446W.js → platform-C4E26ZBZ.js} +3 -3
- package/dist-cli/chunks/privacy-WXGGG4ZI.js +4 -0
- package/dist-cli/chunks/{record-EK3ETFHZ.js → record-OUXWCWUF.js} +3 -3
- package/dist-cli/chunks/{report-issue-NW5PCAZF.js → report-issue-LJJXONXQ.js} +2 -2
- package/dist-cli/chunks/reset-ZZYLPETS.js +4 -0
- package/dist-cli/chunks/resolve-target-MVZZR2JW.js +4 -0
- package/dist-cli/chunks/runtime-DEC5AF3M.js +4 -0
- package/dist-cli/chunks/{screenshot-command-TQSPTFT2.js → screenshot-command-CUHDOS5D.js} +3 -3
- package/dist-cli/chunks/{screenshot-layers-IZP3L3AQ.js → screenshot-layers-DVWQVKT6.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-K7LJOVAE.js → screenshots-capture-GWIUJ3A6.js} +2 -2
- package/dist-cli/chunks/{serve-MMX4WXXG.js → serve-TX5OKGJM.js} +19 -19
- package/dist-cli/chunks/setup-X7LLGW67.js +4 -0
- package/dist-cli/chunks/{sim-client-KLAYIFOC.js → sim-client-W4WZOZ3P.js} +2 -2
- package/dist-cli/chunks/{skills-N4D3POIS.js → skills-TDFQAZ6A.js} +2 -2
- package/dist-cli/chunks/{state-ES6TFQZF.js → state-P2Z25OLQ.js} +2 -2
- package/dist-cli/chunks/{storage-52DR5V2C.js → storage-DWEOFXEB.js} +2 -2
- package/dist-cli/chunks/store-TKBLMYCV.js +4 -0
- package/dist-cli/chunks/telemetry-E3CBKJMD.js +4 -0
- package/dist-cli/chunks/{timeline-NRVNB5JR.js → timeline-55XNA4GX.js} +2 -2
- package/dist-cli/chunks/{upgrade-LNED5YQ2.js → upgrade-3XRCVDVC.js} +2 -2
- package/dist-cli/chunks/upload-QB77GSMQ.js +4 -0
- package/dist-cli/chunks/{version-VEF2DYGG.js → version-WTYGLXBJ.js} +2 -2
- package/dist-cli/chunks/{web-CGDE6S73.js → web-ZWRY3VHM.js} +2 -2
- package/dist-cli/chunks/welcome-7ATM5EGX.js +5 -0
- package/dist-cli/chunks/{what-happened-FSIDWL32.js → what-happened-Q3IGIH4K.js} +2 -2
- package/dist-cli/chunks/{ws-bridge-QXFQLRE7.js → ws-bridge-KCPZSBBX.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-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +69 -34
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +430 -106
- 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 +149 -93
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +679 -307
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/scripts/dev-server-scanner.ts +275 -92
- package/src/dev-bundle-resolution.ts +123 -40
- package/src/disk-cleanup.ts +44 -0
- package/src/host/bridge-host.ts +11 -0
- package/src/host/plane-host.ts +203 -0
- package/dist-cli/chunks/chunk-GJRLPJQL.js +0 -6
- package/dist-cli/chunks/chunk-NTC46LSA.js +0 -4
- package/dist-cli/chunks/chunk-OTFTMGAL.js +0 -7
- package/dist-cli/chunks/cli-version-MLS55UTY.js +0 -4
- package/dist-cli/chunks/control-XD5F6K5T.js +0 -4
- package/dist-cli/chunks/daemon-UN5SE2JO.js +0 -4
- package/dist-cli/chunks/disk-cleanup-BDRHX5ZG.js +0 -4
- package/dist-cli/chunks/drivers-3NJ5RL6X.js +0 -4
- package/dist-cli/chunks/flow-FHZZD3P6.js +0 -4
- package/dist-cli/chunks/help-BYYDUSXF.js +0 -4
- package/dist-cli/chunks/inspect-RQCTWDCC.js +0 -4
- package/dist-cli/chunks/install-desktop-GOWXCQUE.js +0 -4
- package/dist-cli/chunks/privacy-MIFE72CG.js +0 -4
- package/dist-cli/chunks/reset-RZ4O5AFJ.js +0 -4
- package/dist-cli/chunks/resolve-target-7R5BNYMM.js +0 -4
- package/dist-cli/chunks/runtime-MZHLSRS6.js +0 -4
- package/dist-cli/chunks/setup-YFP3KEQZ.js +0 -4
- package/dist-cli/chunks/store-HOL45WCI.js +0 -4
- package/dist-cli/chunks/telemetry-BV6OTYPF.js +0 -4
- package/dist-cli/chunks/upload-RXKHFIBU.js +0 -4
- package/dist-cli/chunks/welcome-FT2AMUWW.js +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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{t as j,v as A,y as U,z as v}from"./chunk-
|
|
4
|
+
import{t as j,v as A,y as U,z as v}from"./chunk-MKHW3JNL.js";import{c as P}from"./chunk-YWTBN7SD.js";import{createHash as Q}from"node:crypto";import{mkdirSync as W,readFileSync as q,readdirSync as X,unlinkSync as Z,writeFileSync as V}from"node:fs";import{dirname as G,extname as ee,resolve as B}from"node:path";function Y(t){let e=t[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),P(1)),e}async function L(t,e,n){let o=j(t,{port:e.port}),i=Y(o.positional),u=A({...o,commandTimeoutMs:5e3});try{let a=!!(await U(u,"SootSim.bridges.settings.get"))?.[n.modeKey],m=i==="on"?!0:i==="off"?!1:!a;if(a===m)return console.log(` ${n.displayName}: already ${m?"on":"off"}`),{current:a,target:m,changed:!1};if(!await u.send({type:"evaluate",acquireLock:!0,code:`(async () => {
|
|
5
5
|
const modeKey = ${JSON.stringify(n.modeKey)}
|
|
6
6
|
const target = ${JSON.stringify(m)}
|
|
7
7
|
window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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 t}from"./chunk-
|
|
4
|
+
import{a as t}from"./chunk-MSM2E74F.js";import{readFileSync as a}from"node:fs";import{fileURLToPath as n}from"node:url";var r=null;function f(){if(r!=null)return r;let o=[()=>n(import.meta.resolve(`${t.packageName}/package.json`)),()=>n(new URL("../package.json",import.meta.url))];for(let i of o)try{let e=JSON.parse(a(i(),"utf8")).version;if(typeof e=="string"&&e)return r=e,r}catch{}return r="0.0.0",r}export{f as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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
|
function t(_){return`(async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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"]),d=new Set(["do","get","wait","shell","debug"]),b=new Set(["detox","maestro","record","film","storage","permissions","perf","screenshot","state","reset","camera","mode","debug","timeline","what-happened","shell","assert","device","open","ios","android","box","list","use","claim","close","compat","report-issue","desktop","login","logout","auth","setup","serve","daemon","runtime","upgrade","version","skill","config","cleanup","app-fonts","agent-wrapper","agent",...p]);function u(c){let n=c.slice(2),e={command:null,commandArgs:[],globalFlags:{},help:!1,version:!1,verbose:!1},s=0;for(;s<n.length;){let o=n[s];if(o==="--"){e.commandArgs.push(...n.slice(s+1));break}let i=Object.entries(m).find(([a,r])=>a===o||r.short===o);if(i){let[a,r]=i,l=a.replace(/^--/,"");if(r.type==="boolean")e.globalFlags[l]=!0,s++;else{let t=n[s+1];if(t===void 0||t.startsWith("-")){console.error(` warning: ${o} requires a value`),s++;continue}if(r.type==="number"){let g=Number(t);if(Number.isNaN(g)){console.error(` warning: ${o} requires a number, got "${t}"`),s+=2;continue}e.globalFlags[l]=g}else e.globalFlags[l]=t;s+=2}continue}if(!e.command&&!o.startsWith("-")){let a=o.indexOf("-");if(a>0){let r=o.slice(0,a),l=o.slice(a+1);if(d.has(r)&&l.length>0){e.command=r;let t=n.slice(s+1);e.commandArgs=[l,...t[0]==="--"?t.slice(1):t];break}}if(b.has(o)){e.command=o;let r=n.slice(s+1);e.commandArgs=r[0]==="--"?r.slice(1):r;break}e.commandArgs=n.slice(s);break}e.commandArgs.push(o),s++}return e.help=!!e.globalFlags.help,e.version=!!e.globalFlags.version,e.verbose=!!e.globalFlags.verbose,e}export{p as a,u as b};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.372 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{execFileSync as y}from"node:child_process";import a from"node:fs";import l from"node:path";var d=class extends Error{},g=8192,v=1e4;function P(n,t){if(t===0)return!1;let r;try{r=a.openSync(n,"r");let e=Buffer.alloc(Math.min(g,t)),s=a.readSync(r,e,0,e.length,0);return e.subarray(0,s).includes(0)}catch{return!1}finally{r!==void 0&&a.closeSync(r)}}var f=class{root;entries=new Map;sniffed=new Map;listTimeoutMs;constructor(t,r={}){this.root=l.resolve(t),this.listTimeoutMs=r.listTimeoutMs??v}index(){return this.entries}async refresh(){let t;try{t=y("git",["ls-files","-co","--exclude-standard","-z"],{cwd:this.root,encoding:"utf8",maxBuffer:64*1024*1024,timeout:this.listTimeoutMs,env:process.env})}catch(s){let i=s instanceof Error?s.message:String(s),o=s instanceof Error&&"signal"in s&&s.signal==="SIGTERM";throw new d(o?`git did not list the project's files in ${this.root} within ${this.listTimeoutMs/1e3}s, so the box has no file set to serve. the checkout may be on a stalled filesystem, or this machine may be too loaded to start a subprocess.`:`could not list the project's files with git in ${this.root}: ${i}`)}if(t.length===0)throw new d(`git listed no files in ${this.root}. either git tracks nothing there and nothing untracked is visible to it, or this machine could not read the child process's output.`);let r=new Map,e=new Map;for(let s of t.split("\0")){if(!s)continue;let i;try{i=a.statSync(l.join(this.root,s))}catch{continue}if(!i.isFile())continue;let o=this.sniffed.get(s),c=o&&o.size===i.size&&o.mtimeMs===i.mtimeMs?o.binary:P(l.join(this.root,s),i.size);e.set(s,{size:i.size,mtimeMs:i.mtimeMs,binary:c}),r.set(s,{size:i.size,readOnly:!1,binary:c})}this.entries=r,this.sniffed=e}absolute(t){let r=l.resolve(this.root,t);if(r!==this.root&&!r.startsWith(`${this.root}${l.sep}`))throw new Error(`path escapes the project: ${t}`);return r}async read(t){return a.promises.readFile(this.absolute(t),"utf8")}async readBytes(t){return a.promises.readFile(this.absolute(t))}async write(t,r){let e=this.absolute(t);await a.promises.mkdir(l.dirname(e),{recursive:!0}),await a.promises.writeFile(e,r),this.entries.set(t,{size:r.byteLength,readOnly:!1,binary:r.subarray(0,g).includes(0)})}async delete(t){await a.promises.rm(this.absolute(t),{force:!0}),this.entries.delete(t)}};function u(n){let t="";for(let e=0;e<n.length;e+=32768)t+=String.fromCharCode(...n.subarray(e,e+32768));return btoa(t)}function h(n){let t=atob(n),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function p(n){let t=2166136261,r=16777619;for(let e of[...n.keys()].sort()){let s=n.get(e);if(!s)continue;let i=`${e} ${s.size} ${s.readOnly?1:0}${s.binary?1:0}`;for(let o=0;o<i.length;o++){let c=i.charCodeAt(o);t=Math.imul(t^c,16777619),r=Math.imul(r+c,2246822507)^r>>>13}}return`${(t>>>0).toString(36)}${(r>>>0).toString(36)}-${n.size}`}function m(n){let t=[];for(let[r,e]of n)t.push([r,e.size,(e.readOnly?1:0)|(e.binary?2:0)]);return t}async function w(n,t,r){switch(t){case"plane:index":{await n.refresh();let e=p(n.index());return r.sinceVersion&&r.sinceVersion===e?{result:{version:e,unchanged:!0},version:e}:{result:{version:e,entries:m(n.index())},version:e}}case"plane:read":return{result:{content:await n.read(String(r.path))}};case"plane:read-bytes":return{result:{base64:u(await n.readBytes(String(r.path)))}};case"plane:write":{await n.write(String(r.path),h(String(r.base64??"")));let e=p(n.index());return{result:{version:e},version:e}}case"plane:delete":{await n.delete(String(r.path));let e=p(n.index());return{result:{version:e},version:e}}default:return null}}export{p as a,w as b,d as c,f as d};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! rnx v0.1.372 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{a as fe,b as Ge}from"./chunk-U3XYGLXG.js";import{e as rt}from"./chunk-3C6LTIDV.js";import{c as Ve}from"./chunk-HDGZAVH3.js";import{a as Ze,b as et,d as ot}from"./chunk-H567W7JT.js";import{a as Ne,c as Fe,d as k,e as de,f as A,g as me,h as He,i as pe,j as je,k as We,m as Qe,n as Ye,o as Xe}from"./chunk-IX25FFF3.js";import{m as L}from"./chunk-4UMODU6C.js";import{a as Ke,b as qe}from"./chunk-DQOQQFMP.js";import{h as tt,p as nt}from"./chunk-I37LRPZ3.js";import{a as Je}from"./chunk-G5G7PQKO.js";import{a as ze}from"./chunk-2MA3Q44D.js";import{b as le,e as Me}from"./chunk-D5AT7UT5.js";import{b as Oe,f as Be,g as B,h as P,i as D,n as De,o as ce,p as ue,r as Ae,s as Le,t as T,u as I,v as E}from"./chunk-MKHW3JNL.js";import{b as G,c as d}from"./chunk-YWTBN7SD.js";import{f as _e}from"./chunk-2OA2WE7G.js";import{a as Ee}from"./chunk-LWLHVF6Y.js";import{D as Re,M as se,P as ae,R as O,T as Te,l as ie}from"./chunk-QA2PTSOC.js";import{a as oe}from"./chunk-MSM2E74F.js";import{spawn as mt,spawnSync as pt}from"node:child_process";import _ from"node:fs";import Kt from"node:os";import U from"node:path";import{WebSocket as ge}from"ws";function it(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 Ot(e,n){return e?.includes("/one/metro-entry.bundle")?"one":typeof n=="string"&&n?"expo":"unknown"}function Bt(e,n,t){return`${e}//${n}:${t}`}function Dt(e){if(typeof window>"u")return!1;try{let n=new URL(e);return k(n.hostname)&&k(window.location.hostname)&&n.origin!==window.location.origin}catch{return!1}}async function lt(e,n){let t={...n,cache:n?.cache??"no-store"};return Dt(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function At(e){return e==="https:"?443:80}function Lt(e){let n=e.pathname||"/";return(n==="/"||n==="")&&!e.search&&!e.hash}async function ct(e){try{let n=await fetch("/__server-scan",{cache:"no-store"});if(!n.ok||!(n.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await n.json();if(!Array.isArray(t))return null;let r=t.find(o=>!!o&&typeof o=="object"&&o.port===e&&typeof o.bundleUrl=="string");return!r||r.bundleUrlProvisional?null:{bundleUrl:pe(r.bundleUrl),port:e,framework:typeof r.framework=="string"?r.framework:"unknown",projectName:typeof r.projectName=="string"?r.projectName:void 0}}catch{return null}}var Nt=5e3,Ft=3e4,Ht=1e3;async function st(e,n){let t,r=lt(`${e}/`,{headers:{"expo-platform":"ios"}}).then(async c=>c.ok?{ok:!0,body:await c.text()}:null,()=>{}),o=await Promise.race([r,new Promise(c=>setTimeout(()=>c("timeout"),Nt).unref?.())]);if(o==="timeout"||o===void 0)return{state:"no-answer"};if(o===null)return{state:"no-manifest"};if(t=o.body,!t.trim())return{state:"no-answer"};let i;try{i=JSON.parse(t)}catch{return{state:"no-manifest"}}let a=i?.extra?.expoClient||i?.extra||{},s=typeof i?.launchAsset?.url=="string"?i.launchAsset.url:void 0,l=s?He(s,e):void 0;return!l&&!a.name?{state:"no-manifest"}:{state:"resolved",bundle:{bundleUrl:pe(l||`${e}${me}`),port:n,framework:Ot(l,a.sdkVersion),projectName:a.name}}}async function at(e){try{let n=await lt(`${e}/status`);return n.ok?(await n.text()).includes("packager-status:running"):!1}catch{return!1}}async function ut(e,n){let t=e.replace(/\/+$/,""),r=await st(t,n),o=!1;if(r.state==="no-answer"){if(o=await at(t),!o)return null;let i=Date.now()+Ft;for(;r.state==="no-answer"&&Date.now()<i;)await new Promise(a=>setTimeout(a,Ht)),r=await st(t,n)}return r.state==="resolved"?r.bundle:r.state==="no-answer"||!o&&!await at(t)?null:{bundleUrl:`${t}${me}`,port:n,framework:"metro"}}async function jt(e,n){try{if(k(new URL(e).hostname)){let t=await ct(n);if(t)return t}}catch{}return ut(e,n)}async function Wt(e){let n=await ct(e);return n||((await Promise.all(Ne.map(r=>ut(Fe("http:",r,e),e)))).find(r=>r!==null)??null)}async function dt(e){let n=e.trim();if(/^\d+$/.test(n)){let s=parseInt(n,10),l=await Wt(s);if(l)return l;throw it(`localhost:${s}`)}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):At(o),a=Bt(o,r.hostname,i);if(Lt(r)){let s=await jt(a,i);if(s)return s;throw it(a)}return{bundleUrl:r.toString(),port:i,framework:"unknown"}}var qt=12e4,ft=100,Vt=5e3,gt=1e4,Gt={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 $(e){return new Promise(n=>setTimeout(n,e))}function ht(e){let n=process.env[e]?.trim();if(!n)return null;let t=Number(n);return Number.isInteger(t)&&t>0?t:null}function zt(){let e=ht("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??ht("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??qt;return{timeoutMs:e,hostTimeoutMs:e+Vt,intervalMs:ft,attempts:Math.max(1,Math.ceil(e/ft))}}function wt(e){return e==="electron"||e==="playwright"}function he(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 J(e){return e.trim()}async function Qt(e,n=!1){let t=ae();bt(e,n,t);let r=ce(e);if((n||r!==null)&&await we(e,250))return e;if(t&&O(t)&&await we(t.bridgePort,500))return t.bridgePort;if(t&&O(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 Yt();let o=Xt(["serve","--quiet","--port",String(e)]),i=null;o.once("exit",(s,l)=>{i=String(s??l??"unknown")}),o.unref();let a=Date.now()+gt;for(;Date.now()<a;){let s=ae();if(bt(e,n,s),s&&O(s)&&await we(s.bridgePort,250))return console.error(` Started a local bridge on port ${s.bridgePort}. Run \`rnx daemon install\` to keep it ready between commands.`),s.bridgePort;if(i)throw new Error(`rnx bridge exited before becoming ready (exit ${i})`);await $(150)}throw new Error(`rnx bridge did not start within ${Math.round(gt/1e3)}s`)}function bt(e,n,t){if(!(!n||!t||!O(t)||t.bridgePort===e))throw new Error(`${oe.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 Yt(){let e=se();if(e&&_.existsSync(ie(e)))return;console.error(" installing rnx engine runtime...");let{runRuntime:n}=await import("./runtime-DEC5AF3M.js");await n(["install"],{})}function Xt(e){let n=process.argv[1];return n&&_.existsSync(n)?mt(process.execPath,[n,...e],{detached:!0,stdio:"ignore",env:process.env}):mt(oe.commandName,e,{detached:!0,stdio:"ignore",env:process.env})}function we(e,n){return new Promise(t=>{let r=new ge(`ws://127.0.0.1:${e}`,{handshakeTimeout:n}),o=!1,i=a=>{o||(o=!0,r.readyState===ge.OPEN?r.close():r.readyState===ge.CONNECTING&&r.terminate(),t(a))};r.once("open",()=>i(!0)),r.on("error",()=>i(!1)),setTimeout(()=>i(!1),n)})}function ve(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 Zt(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 en(e,n){let t=new URL(e,"http://sootsim.local"),r=new URL(n),o=Q(r.pathname),i=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return r.pathname=`${o}${i}`,r.search=t.search,r.hash=t.hash,r.toString()}function tn(e){try{let n=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(n)||/^\/build\/.+/.test(n)}catch{return!1}}async function mr(e){let n=J(e);return(await Se(n)).bundleUrl}function nn(e){try{let n=new URL(e.startsWith("http")?e:`http://${e}`),t=n.pathname||"/";if(t!=="/"&&t!==""||n.search||n.hash||!k(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 Se(e){let n=J(e),t=/^\d+$/.test(n)?Number(n):nn(n);if(t&&t>0){let r=await We(t);if(r&&!r.bundleUrlProvisional)return{bundleUrl:r.bundleUrl,port:r.port,framework:r.framework,projectName:r.projectName}}return dt(n)}function Q(e){let n=e.replace(/\/+$/,"")||"/";return n==="/__soot"||n.startsWith("/__soot/")?"/__soot":""}function rn(e,n){let t=J(e),r=new URL(n),o=Q(r.pathname);return r.pathname=`${o}/rn`,r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),/^\d+$/.test(t)?r.pathname=`${o}/rn/${t}`:(r.pathname=`${o}/rn`,r.searchParams.set("open",t)),r.toString()}function Pt(e){let n=J(e);return/^\d+$/.test(n)||/^https?:\/\//i.test(n)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(n)}async function on(e,n,t={}){let r=t.resolvedBundle??await Se(e),o=new URL(n),i=Q(o.pathname);o.pathname=`${i}/rn`,o.searchParams.delete("open"),o.searchParams.delete("port"),o.searchParams.delete("demo"),o.searchParams.delete("app");let a=t.hot===void 0?r.bundleUrl:je(r.bundleUrl,t.hot);return o.searchParams.set("bundle",a),o.toString()}function sn(e){return e.startsWith("~/")?U.join(Kt.homedir(),e.slice(2)):U.isAbsolute(e)?e:U.resolve(process.cwd(),e)}function an(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>"),d(1));let a=i.indexOf("=");(a<=0||a===i.length-1)&&(console.error(" rnx open: --replace expects <module>=<file>"),d(1));let s=i.slice(0,a).trim(),l=sn(i.slice(a+1).trim());_.existsSync(l)||(console.error(` rnx open: replacement file not found: ${l}`),d(1)),n[s]={file:l},o++;continue}if(e[o]==="--remap"){let i=e[o+1],a=i?i.indexOf("="):-1;(!i||a<=0||a===i.length-1)&&(console.error(" rnx open: --remap expects <host:port>=<host:port>"),d(1)),t[i.slice(0,a).trim()]=i.slice(a+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 ln(e){if(!e)return null;let n=await Ye(e.bundleUrl);return n?ze(n):null}async function cn(e){if(_.existsSync(U.join(ie(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let n=await _e.install({version:e,setActive:!1,protectVersions:Te()});console.error(` installed engine runtime ${n.version}`)}function un(e,n){let t=n??(fe()?void 0:se()??void 0);if(!t)return e;let r=new URL(e);if(!k(r.hostname)){if(!n)return e;throw new Error(`runtimeVersion ${t} requires a local rnx host; got ${r.origin}`)}return r.hostname=Ge(t),r.toString()}function It(){return De().shellBaseUrl}function dn(e){return ce(e)?.shellBaseUrl??Oe(e)??It()}async function mn(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Qe({bundleUrl:r,projectDir:n.appDir});if(o.length===0)return e;let i=await pn(o);return i.length===0?e:(t.searchParams.set("appFonts",Xe(i)),t.toString())}catch{return e}}async function pn(e){let n=await Promise.all(e.map(async r=>{let o=new AbortController,i=setTimeout(()=>o.abort(),1500);try{let a=await fetch(r.url,{method:"HEAD",signal:o.signal});return a.status>=200&&a.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 fn(e,n,t={}){if(!e)return new URL(n).toString();if(ve(e))return new URL(e).toString();if(Zt(e))return en(e,n);let r=Gt[e.toLowerCase()];if(r){let o=new URL(n),i=Q(o.pathname);return o.pathname=`${i}${r}`,o.toString()}return Pt(e)?on(e,n,t):rn(e,n)}async function gn(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Ze({bundleUrl:r,projectDir:n.appDir});return!o||o.imageUrl&&!await hn(o.imageUrl)?e:(t.searchParams.set("appSplash",et(o)),t.toString())}catch{return e}}async function hn(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 z(e,n=It(),t={}){let r=await fn(e,n,t),o=await gn(await mn(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 vt(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 wn(e,n,t,r={}){let o=new URL(await z(e,n,r));return o.searchParams.set("inspectOpen",t),o.toString()}async function bn(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500,a=r.minNodeCount??10;for(let s=0;s<o;s++){let l=I(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>a)return{bridge:l,count:c}}catch{}l.close(),await $(i)}return null}function vn(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 yn(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 pr(e,n){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
5
|
+
`);for(let t of e){let r=t.lockedBy&&t.lockExpiresAt?`locked by ${yn(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=vn(t.url);if(i)console.log(` loaded: ${i}`);else if(t.url){let s=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${s}`)}else t.origin&&console.log(` origin: ${t.origin}`);let a=Sn(t);a&&console.log(` engine: ${a}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${yt(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${yt(Date.now()-t.lastActiveAt)}`)}}function Sn(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)":fe()?`dev \u2014 local build (:${t||"?"})`:`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function yt(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 fr(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500;for(let a=0;a<o;a++){let s=I(e,{commandTimeoutMs:n});try{let c=(await s.listSims()).find(t);if(c)return c}catch{}finally{s.close()}await $(i)}return null}async function $n(e,n,t,r,o={}){let i=o.attempts??30,a=o.intervalMs??500,s=!!r&&Number.isInteger(r)&&r>1,l=()=>s&&r!==void 0&&!ye(r);for(let c=0;c<i;c++){if(l())return{kind:"host-exit"};let m=I(e,{commandTimeoutMs:n});try{let h=(await m.listSims()).find(t);if(h)return l()?{kind:"host-exit"}:{kind:"match",sim:h}}catch{}finally{m.close()}if(l())return{kind:"host-exit"};await $(a)}return{kind:"timeout"}}async function xn(e,n,t,r={}){let o=r.attempts??20,i=r.intervalMs??250;for(let a=0;a<o;a++){let s=I(e,{commandTimeoutMs:n});try{let c=(await s.listSims()).find(m=>m.id===t);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{s.close()}await $(i)}return!1}function Pn(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 In(e){if(!e.connectAckFile)return!1;try{return _.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
|
|
6
|
+
`,{flag:"w"}),!0}catch{return!1}}function St(e){if(e.diagnosticLogPath)try{let n=_.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!n){console.error(` ${U.basename(e.diagnosticLogPath)} was empty`);return}let t=n.length>4e3?`\u2026
|
|
7
|
+
${n.slice(-4e3)}`:n;console.error(` ${U.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(n){let t=n instanceof Error?n.message:String(n);console.error(` failed to read ${U.basename(e.diagnosticLogPath)}: ${t}`)}}function ye(e){try{return process.kill(e,0),!0}catch(n){return n?.code==="EPERM"}}async function kn(e,n=2500){let t=Date.now()+n;for(;Date.now()<t;){if(!ye(e))return!0;await $(100)}return!ye(e)}function Cn(e){let n=pt("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),t=pt("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 be(e,n){let t=new Set(n),r=new Set;for(let o of e){if(!t.has(o.id))continue;let i=Pn(o);i&&r.add(i)}for(let o of r){if(!Cn(o)){console.log(` skipped pid ${o}: not a rnx playwright host (stale sim record)`);continue}try{process.kill(o,"SIGTERM")}catch{}if(await kn(o)){console.log(` closed playwright host process ${o}`);continue}try{process.kill(o,"SIGKILL"),console.log(` force-closed playwright host process ${o}`)}catch{}}}function Y(e,n){if(n){let o=n.trim(),i=e.find(a=>a.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 $t(e,n,t,r=!1){let[o,i]=[e,n.url].map(a=>{if(!a)return a;try{let s=new URL(a);if(s.searchParams.has("sootsimConfig"))return s.searchParams.set("sootsimConfig","[redacted]"),s.toString()}catch{}return a});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 xt(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 Un(e,n,{stableMs:150,maxMs:400});let o=I(e,{commandTimeoutMs:3e3,simId:n,cliLabel:"open --describe",simIdSource:"flag"});try{let i=null;try{i=await nt(o,1)}catch{}if(i&&!i.ready){let s=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: ${s} (nodes: ${i.nodes}, targets: ${i.targets})`),console.log(" before interacting, run: rnx wait ready --max-ms 120000")}let a=await tt(o,{describe:!0,verbose:!1,filter:"",compact:!0,hideXy:!1,maxDepth:12});if(!a?.tree)return;console.log(""),console.log(a.tree)}finally{o.close()}}catch{}finally{r===void 0?delete process.env.SOOTSIM_QUIET_TARGET_NOTICE:process.env.SOOTSIM_QUIET_TARGET_NOTICE=r}}async function Un(e,n,t){let r=Date.now()+t.maxMs,o="(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()",i=I(e,{commandTimeoutMs:2e3,simId:n,simIdSource:"flag"});try{let a=-1,s=0;for(;Date.now()<r;){let l=-1;try{let c=await i.send({type:"evaluate",code:o});typeof c=="number"&&(l=c)}catch{}if(l>=0&&l===a){if(Date.now()-s>=t.stableMs)return}else a=l,s=Date.now();await $(50)}}finally{i.close()}}async function Rn(e,n={}){let t=T(e,{port:n.port,commandTimeoutMs:n.timeoutMs});t.positional.length!==1&&(console.error(" rnx open: expected exactly one <url-or-route>"),console.error(" examples: rnx open /settings | rnx open myapp://settings"),d(1));let r=E(t),o=t.simId?` --sim ${t.simId}`:"";try{let i=await qe(r,t.positional[0]??"");console.log(` opened deep link: ${i}`)}catch(i){console.error(` link failed: ${i instanceof Error?i.message:String(i)}`),await L(r,{errorsCommand:`rnx get errors 5${o}`,warningsCommand:`rnx get warnings 5${o}`,requestsCommand:`rnx get requests 5${o}`}),d(1)}finally{r.close()}}async function gr(e,n={}){let t=T(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--new","--headless","--headed","--ephemeral","--hot","--no-hmr","--no-describe","--quiet"],stripValueFlags:["--base-url","--replace","--driver","--profile","--cdp-port","--device","--viewport"]}),r=e.find((f,p)=>e[p-1]==="--profile"),o=e.includes("--quiet"),i=e.includes("--ephemeral"),a=e.find((f,p)=>e[p-1]==="--cdp-port"),s=a?Number(a):void 0;a&&(!Number.isFinite(s)||s<=0)&&(console.error(` rnx open: --cdp-port must be a positive port number, got "${a}"`),d(1)),r&&i&&(console.error(" rnx open: --profile cannot be combined with --ephemeral"),d(1));let l=r?Ve(r).id:void 0,c=e.includes("--new")||!!l||i,m=an(e);c&&t.simIdSource==="flag"&&(console.error(" rnx open: --new, --profile, and --ephemeral cannot be combined with --sim"),d(1));let u=t.positional[0]||"";if(Ke(u)){c&&(console.error(" rnx open: deep links target the current app; remove --new, --profile, or --ephemeral"),d(1)),await Rn(e,n);return}if(tn(u)){let f=(()=>{try{return k(new URL(u).hostname)}catch{return!1}})();console.log(" that\u2019s an rnx preview/build link \u2014 a full player page, not a driveable sim."),console.log(" opening it in your browser for viewing\u2026");try{await ot(u,{background:!1})}catch(p){console.error(` could not launch a browser: ${p instanceof Error?p.message:String(p)}`),console.error(` open it yourself: ${u}`),d(1)}console.log(f?" to drive it under the CLI, point `rnx open` at the app\u2019s dev port instead (e.g. `rnx open 8081`).":" the CLI can\u2019t drive a remote preview (the engine only attaches to the local bridge from localhost). to drive the app, run it locally and `rnx open <port>`.");return}let h=Pt(u)?await Se(u):void 0,N=await ln(h),X=await Je(N),F=X?.runtimeVersion,H=de(de(X?{...X,runtimeVersion:void 0}:void 0,n.runtimeConfig),m);F&&await cn(F);let Z=e.find((f,p)=>e[p-1]==="--base-url");if(Z&&!t.explicitPort){let f=ue(Z);f&&(t.wsPort=f)}t.wsPort=await Qt(t.wsPort,t.explicitPort);let M=e.find((f,p)=>e[p-1]==="--driver")||"";M&&!wt(M)&&(console.error(` unknown driver "${M}" \u2014 run \`rnx list --drivers\``),d(1));let v=wt(M)?M:process.env.CI==="1"||process.env.CI==="true"||process.env.GITHUB_ACTIONS==="true"||Ee()||!process.stdin.isTTY?"playwright":Re()||"playwright",Ct=Jt(e,v);s&&v!=="playwright"&&(console.error(" rnx open: --cdp-port is only honored by the playwright driver"),d(1));let $e=e.includes("--hot"),xe=e.includes("--no-hmr");$e&&xe&&(console.error(" rnx open: --hot and --no-hmr cannot be combined"),d(1));let Ut=$e?!0:xe?!1:v!=="playwright",C=e.find((f,p)=>e[p-1]==="--device");C&&!(C in le)&&(console.error(` rnx open: unknown device "${C}"`),console.error(` known devices: ${Me().join(", ")}`),d(1));let ee=C?le[C]:void 0,j=e.find((f,p)=>e[p-1]==="--viewport"),W=j?/^(\d+)x(\d+)$/.exec(j):null;j&&!W&&(console.error(` rnx open: --viewport must be <width>x<height>, got "${j}"`),d(1));let Rt=W?{width:Number(W[1]),height:Number(W[2])}:void 0,K={hot:Ut,device:C,resolvedBundle:h,project:N},Tt=F?`http://localhost:${t.wsPort}/`:Z||dn(t.wsPort),x=un(Tt,F),Pe=e.includes("--base-url");Ae(t.wsPort,x);let Et=B();if(!c){let f=E(t),p=t.simId?` --sim ${t.simId}`:"",re=!1;try{let g=null,V=null;try{let w=await f.listSims();if(t.simIdSource==="saved")g=w.find(b=>b.id===Et&&b.readyState==="open"&&he(b,v))??null,g||D();else if(t.simIdSource==="flag"&&(g=Y(w,t.simId),!he(g,v)))throw new Error(`sim ${g.id} is not managed by the ${v} driver`);if(!g&&t.simIdSource!=="flag"){V=await z(u,A(x,H),K);let b=new URL(V);b.searchParams.delete("inspectOpen"),g=w.find(S=>{if(S.readyState!=="open"||!S.url||!he(S,v))return!1;try{let Ue=new URL(S.url);return Ue.searchParams.delete("inspectOpen"),Ue.toString()===b.toString()}catch{return!1}})??null}if(!g)if(t.simIdSource!=="flag")re=!0;else throw new Error("no sim connected");if(!re&&g){let b=Pe||ve(u)?x:vt(g,x),S=V??await z(u,A(b,H),K);f.send({type:"evaluate",simId:g.id,code:`window.location.href = ${JSON.stringify(S)}`}).catch(()=>{})}}catch(w){console.error(` open failed: ${w instanceof Error?w.message:String(w)}`),await L(f,{errorsCommand:`rnx get errors 5${p}`,warningsCommand:`rnx get warnings 5${p}`,requestsCommand:`rnx get requests 5${p}`}),d(1)}if(!re&&g){await $(1500);let w=await bn(t.wsPort,t.commandTimeoutMs,g.id);w||(console.error(" timed out waiting for current sim to load target"),d(1)),w.bridge.close(),P(g.id);let b=Pe||ve(u)?x:vt(g,x),S=V??await z(u,A(b,H),K);return $t(S,{...g,url:S},"current sim",o),await xt(t.wsPort,g.id,e),t.wsPort}}finally{f.close()}}let _t=A(x,H),Ie=`cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,ke=await wn(u,_t,Ie,K),Ce=Be();Ce||(console.error(" could not resolve a stable owning process; refusing unsupervised sim host"),d(1));let Mt=f=>f.url?.includes(`inspectOpen=${Ie}`)??!1,R=rt(v);R||(console.error(` unknown driver "${v}" \u2014 run \`rnx list --drivers\``),d(1));let q=zt(),y=await R.launch({url:ke,bridgePort:ue(x)??t.wsPort,headless:Ct,profileId:l,ephemeralProfile:i,cdpPort:s,device:C,ownerPid:Ce,viewport:Rt??(ee?{width:ee.width+120,height:ee.height+60}:void 0),connectTimeoutMs:q.hostTimeoutMs});y.launched||(console.error(` ${R.name} driver: ${y.message}`),d(1));let te=await $n(t.wsPort,t.commandTimeoutMs,Mt,y.pid,{attempts:q.attempts,intervalMs:q.intervalMs});if(te.kind==="host-exit"&&(St(y),console.error(` ${R.name} host crashed \u2014 sim is no longer attached`),d(1)),te.kind==="timeout"){if(y.pid)try{process.kill(y.pid,"SIGTERM"),console.error(` closed ${R.name} host process ${y.pid}`)}catch{}St(y),console.error(` timed out after ${q.timeoutMs}ms waiting for opened sim to connect`),d(1)}let ne=te.sim;return P(ne.id),In(y),$t(ke,ne,`${R.name} driver`,o),await xt(t.wsPort,ne.id,e),t.wsPort}async function kt(e,n={}){let t=T(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--force"]}),r=e.includes("--force"),o=E(t),i=t.simId?` --sim ${t.simId}`:"";try{try{let a=await o.listSims(),s=Y(a,t.positional[0]||t.simId);if(s.lockedBy&&s.lockExpiresAt&&s.lockExpiresAt>Date.now()){let l=Math.max(0,Math.round((s.lockExpiresAt-Date.now())/1e3));s.lockedByKind==="user-active"&&(console.error(` refused: ${s.id} is locked by the active user (${l}s) \u2014 that's a live human tab`),console.error(" run `rnx open --new` for a fresh investigation sim"),d(1)),r||(console.error(` refused: ${s.id} is leased by ${s.lockedBy} (${l}s)`),console.error(` \`sootsim use ${s.id} --force\` to take it, or \`rnx open --new\` for a fresh sim`),d(1))}await o.focusSim(s.id),P(s.id),console.log(` using: ${s.id}`)}catch(a){G(a),console.error(` use failed: ${a instanceof Error?a.message:String(a)}`),await L(o,{errorsCommand:`rnx get errors 5${i}`,warningsCommand:`rnx get warnings 5${i}`,requestsCommand:`rnx get requests 5${i}`}),d(1)}}finally{o.close()}}async function hr(e,n={}){await kt(e,n)}async function wr(e,n={}){await kt(e,n)}async function br(e,n={}){let t=T(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--force"]}),r=e.includes("--force"),o=E(t);try{try{let i=await o.listSims(),a=Y(i,t.positional[0]||t.simId),s=r&&a.lockedBy&&a.lockedByKind!=="user-active"?a.lockedBy:null,l=await o.claim(a.id,{force:r});P(a.id);let c=Math.max(0,Math.round((l.lockExpiresAt-Date.now())/1e3)),m=l.bootedCount>0?` (booted ${l.bootedCount})`:"";console.log(` claimed: ${l.simId} [${c}s]${m}`),s&&console.log(` took over from: ${s}`)}catch(i){if(i instanceof Le){let a=Math.max(0,Math.round(i.lock.expiresInMs/1e3));console.error(` claim failed: locked by ${i.lock.by} for ${a}s more`),console.error(" use --force to take it, or `rnx open --new` for a fresh sim"),d(1)}console.error(` claim failed: ${i instanceof Error?i.message:String(i)}`),d(1)}}finally{o.close()}}async function Tn(e,n,t,r){if(r.length===0)return{closed:[],remaining:[]};await Promise.all(r.map(i=>e.closeSim(i).catch(()=>{})));let o=new Set(r);for(let i=0;i<40;i++){let a=[];try{let s=I(n,{commandTimeoutMs:t});try{a=(await s.listSims()).filter(c=>o.has(c.id)&&c.readyState==="open").map(c=>c.id)}finally{s.close()}}catch{a=[]}if(a.length===0)return{closed:[...o],remaining:[]};if(i===39)return{closed:[...o].filter(s=>!a.includes(s)),remaining:a};await $(250)}return{closed:[...o],remaining:[]}}function En(e,n){let t=e.filter(u=>u.readyState==="open"),r=t.map(u=>u.id),o=n.explicitKeepId?.trim()||"",i=n.savedKeepId?.trim()||"",a=i?t.some(u=>u.id===i):!1,s=i&&!a?i:null,l=null,c=null,m=null;if(n.closeOthers)if(o){let u=t.find(h=>h.id===o);u?l=u.id:c=o}else if(i&&a)l=i;else{let u=t.find(h=>h.isPrimary)??t[0]??null;u&&(l=u.id,i&&!a&&(m=u.id))}return{openIds:r,keepId:l,targets:c?[]:r.filter(u=>u!==l),staleSavedId:s,missingExplicitKeepId:c,fallbackKeepId:m}}async function vr(e,n={}){let t=T(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--all","--others"]}),r=E(t),o=t.simId?` --sim ${t.simId}`:"",i=e.includes("--all"),a=e.includes("--others");if(i||a){try{let s=await r.listSims(),l=B(),c=t.positional[0]||(t.simIdSource==="flag"?t.simId:void 0),m=En(s,{closeOthers:a,explicitKeepId:c,savedKeepId:l});if(m.staleSavedId&&D(),m.fallbackKeepId&&(P(m.fallbackKeepId),console.log(` saved sim ${m.staleSavedId} is gone \u2014 keeping primary ${m.fallbackKeepId}`)),m.missingExplicitKeepId&&(console.error(` close failed: keep sim ${m.missingExplicitKeepId} is not connected; not closing other sims`),d(1)),m.targets.length===0){console.log(m.keepId?` nothing to close \u2014 only the kept sim ${m.keepId} is connected`:m.staleSavedId?` nothing to close \u2014 no sims connected (cleared stale current sim ${m.staleSavedId})`:" nothing to close \u2014 no sims connected");return}let u=await Tn(r,t.wsPort,t.commandTimeoutMs,m.targets);await be(s,m.targets);let h=B();h&&u.closed.includes(h)&&(m.keepId?P(m.keepId):D());let N=` closed ${u.closed.length} sim(s)${m.keepId?` (kept ${m.keepId})`:""}`;console.log(N),u.remaining.length>0&&(console.error(` close failed: still connected: ${u.remaining.join(", ")}`),d(1))}catch(s){G(s),console.error(` close failed: ${s instanceof Error?s.message:String(s)}`),d(1)}finally{r.close()}return}try{try{let s=await r.listSims(),l=Y(s,t.positional[0]||t.simId),c=s.find(u=>u.id!==l.id&&u.readyState==="open");await r.closeSim(l.id),await xn(t.wsPort,t.commandTimeoutMs,l.id)||(await be(s,[l.id]),console.error(` close failed: ${l.id} is still connected`),d(1)),await be(s,[l.id]),B()===l.id&&(c?P(c.id):D()),console.log(` closed: ${l.id}`)}catch(s){G(s),console.error(` close failed: ${s instanceof Error?s.message:String(s)}`),await L(r,{errorsCommand:`rnx get errors 5${o}`,warningsCommand:`rnx get warnings 5${o}`,requestsCommand:`rnx get requests 5${o}`}),d(1)}}finally{r.close()}}export{zt as a,Qt as b,mr as c,un as d,It as e,dn as f,z as g,wn as h,vn as i,pr as j,fr as k,$n as l,Pn as m,In as n,be as o,Rn as p,gr as q,hr as r,wr as s,br as t,Tn as u,En as v,vr as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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 o=!0,e="public beta",t=e,n="we send anonymous error and dependency data while you use it";export{o as a,e as b,t as c,n as d};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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}from"./chunk-
|
|
4
|
+
import{b}from"./chunk-G5G7PQKO.js";import{q as x}from"./chunk-MKHW3JNL.js";import{c as l}from"./chunk-YWTBN7SD.js";import{b as R,c as w,d as m,e as $,f as u}from"./chunk-2OA2WE7G.js";import{L as h,M as f,N as y,T as v,l as d}from"./chunk-QA2PTSOC.js";import S from"fs";import{WebSocket as L}from"ws";function E(t){if(!t||typeof t!="object")return!1;let e=Reflect.get(t,"sections");return typeof Reflect.get(t,"title")=="string"&&Array.isArray(e)&&e.every(o=>o&&typeof o=="object"&&typeof Reflect.get(o,"title")=="string"&&Array.isArray(Reflect.get(o,"items"))&&Reflect.get(o,"items").every(n=>n&&typeof n=="object"&&typeof Reflect.get(n,"summary")=="string"&&typeof Reflect.get(n,"hash")=="string"))}async function A(t,e=fetch){try{let o=new URL($);o.searchParams.set("version",t);let n=await e(o,{headers:{accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(!n.ok)return null;let r=await n.json();if(!r||typeof r!="object")return null;let i=Reflect.get(r,"entries");return!Array.isArray(i)||!E(i[0])?null:i[0]}catch{return null}}function O(t,e){let o=[`what's new in rnx engine v${t}:`];if(!e||e.sections.length===0)o.push(" release notes are not available yet");else for(let n of e.sections){o.push(` ${n.title}:`);for(let r of n.items)o.push(` \u2022 ${r.summary}`)}return o.push(` full changelog: ${m}`),o.join(`
|
|
5
5
|
`)}async function Y(t,e={}){let[o,...n]=t;if(!o||o==="--help"||o==="-h"){k();return}switch(o){case"install":return _(n,e);case"list":return T(n);case"use":return D(n);case"remove":return G(n);case"which":return U();case"notes":return F(n);default:console.error(` unknown runtime subcommand: ${o}`),k(),l(1)}}function k(){console.log(`
|
|
6
6
|
rnx runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
7
7
|
|
|
@@ -27,4 +27,4 @@ examples:
|
|
|
27
27
|
rnx runtime install --channel beta
|
|
28
28
|
rnx runtime use 1.2.3
|
|
29
29
|
rnx runtime notes
|
|
30
|
-
`)}async function _(t,e){let{version:o,flags:n}=M(t),r=n.channel??e.channel??"stable",i=n.force===!0,a=n.setActive!==!1;h(),console.log("rnx runtime install"),console.log(` cdn: ${u.resolveCdnOrigin()}`);try{let s=await u.install({version:o,channel:r,force:i,setActive:a,protectVersions:v()});return console.log(` version: ${s.version} (channel: ${s.channel})`),s.installed?console.log(` installed ${s.version}`):console.log(` already installed at ${s.runtimeDir}`),a&&await I(s.version),s}catch(s){console.error(` ${N(s)}`),l(1)}}async function I(t){y(t),console.log(` active: ${t}`),await j(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function j(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-
|
|
30
|
+
`)}async function _(t,e){let{version:o,flags:n}=M(t),r=n.channel??e.channel??"stable",i=n.force===!0,a=n.setActive!==!1;h(),console.log("rnx runtime install"),console.log(` cdn: ${u.resolveCdnOrigin()}`);try{let s=await u.install({version:o,channel:r,force:i,setActive:a,protectVersions:v()});return console.log(` version: ${s.version} (channel: ${s.channel})`),s.installed?console.log(` installed ${s.version}`):console.log(` already installed at ${s.runtimeDir}`),a&&await I(s.version),s}catch(s){console.error(` ${N(s)}`),l(1)}}async function I(t){y(t),console.log(` active: ${t}`),await j(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function j(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-MEGVA6ET.js"),n=o();if(!e(n))return!1;let r=x();return new Promise(i=>{let a=!1,s=!1,g=C=>{a||(a=!0,i(C))},c=new L(`ws://127.0.0.1:${r}`,{handshakeTimeout:800}),p=setTimeout(()=>{try{c.close()}catch{}g(s)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:t,id:0})),s=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout(p),g(s)}),c.on("error",()=>{clearTimeout(p),g(!1)})})}async function T(t){h();let e=u.listInstalled(),o=f();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let n of e)console.log(` ${n===o?"*":" "} ${n}`);try{let n=await u.fetchManifest();console.log("available (latest per channel):");for(let[i,a]of Object.entries(n.channels))console.log(` ${i.padEnd(8)} ${a.latest}`);let r=Object.keys(n.versions).sort(R).reverse();if(r.length>1){console.log("hosted versions:");for(let i of r)console.log(` ${i}`)}}catch(n){console.log(`available: (could not fetch manifest: ${N(n)})`)}}async function D(t){let e=t[0];e||(console.error(" usage: rnx runtime use <version>"),l(1));let o=u.listInstalled();o.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${o.join(", ")||"(none)"}`),console.error(` run \`rnx runtime install ${e}\` first`),l(1)),await I(e)}async function G(t){let e=t[0];e||(console.error(" usage: rnx runtime remove <version>"),l(1)),f()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `rnx runtime use <other>` first, or install another version"),l(1)),v().includes(e)&&(console.error(` cannot remove runtime ${e} while a project is using it`),l(1));let n=d(e);if(!S.existsSync(n)){console.error(` ${e} is not installed`);return}S.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function U(){let t=f();if(!t){console.log(" no active runtime");return}console.log(t)}async function F(t){t.length>0&&(console.error(" usage: rnx runtime notes"),l(1));let{config:e}=await b(),o=e?.runtimeVersion??f();if(!o){console.log(" no active runtime"),console.log(` release notes: ${m}`);return}console.log(O(o,await A(o)))}function M(t){let e={},o=[];for(let n=0;n<t.length;n++){let r=t[n];if(r==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(r.startsWith("--channel=")){e.channel=r.slice(10);continue}if(r==="--force"){e.force=!0;continue}if(r==="--set-active=false"||r==="--no-set-active"){e.setActive=!1;continue}o.push(r)}return{version:o[0]??null,flags:e}}function N(t){return t instanceof Error?t.message:String(t)}export{A as a,O as b,Y as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import{randomUUID as x}from"node:crypto";import n from"node:fs";import{homedir as I}from"node:os";import i from"node:path";var $="SOOTSIM_HOME",B="active",M="daemon.json",T="dev-bridges",J="config.json",L=3e4;function s(){let e=process.env[$];return e&&e.length>0?i.resolve(e):i.join(I(),".sootsim")}function U(){if(process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1")return!1;let e=process.env.SOOTSIM_DEV;if(e==="1"||e==="true")return!0;if(e==="0"||e==="false")return!1;let t=process.argv[1];if(!t)return!1;try{return n.realpathSync(t).includes(`${i.sep}packages${i.sep}sootsim${i.sep}`)}catch{return!1}}function V(){return process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1"?!1:process.env.IS_TAMAGUI_DEV==="1"}function ce(){return U()||V()}function v(){return i.join(s(),"runtimes")}function H(e){return i.join(v(),e)}function w(){return i.join(v(),B)}function A(){return i.join(s(),"electron")}function se(){return i.join(A(),"userData")}function ae(e){return i.join(A(),e)}function G(){return i.join(s(),"profiles")}function ue(){return i.join(s(),"camera-fixtures")}function K(){return i.join(s(),"daemon-app")}function X(){return i.join(K(),"SootSim Daemon.app")}function fe(){return i.join(X(),"Contents","MacOS","sootsim-daemon")}function q(){return i.join(s(),"cache")}function m(){return i.join(s(),M)}function y(){return i.join(s(),T)}function O(e){if(!Number.isInteger(e)||e<=0)throw new Error(`invalid development bridge port: ${e}`);return i.join(y(),`${e}.json`)}function b(){return i.join(s(),J)}function p(){try{let e=n.readFileSync(b(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function P(e){h();let t=p(),r={...t,...e};e.settings&&typeof e.settings=="object"&&(r.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let c=`${b()}.tmp`;return n.writeFileSync(c,`${JSON.stringify(r,null,2)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as F,b as h,e as f,f as W,g as B}from"./chunk-
|
|
4
|
+
import{a as F,b as h,e as f,f as W,g as B}from"./chunk-7FYOZQBM.js";import{b as l}from"./chunk-CZ2FOZVC.js";import{b as P}from"./chunk-DQOQQFMP.js";import{E as y,G as D,d as T,e as u,h as v,k as I,l as R,o as O,p as $,r as M,s as A,x as N,z as _}from"./chunk-I37LRPZ3.js";var o=class extends Error{constructor(e){super(e),this.name=new.target.name}},m=class extends o{},w=class extends o{status;constructor(e){super(`sim not ready: ${O(e)}`),this.status=e}},d=class extends o{outcome;constructor(e,t=null){super(e),this.outcome=t}},b=class extends o{},g=class extends o{result;constructor(e){let t=e.steps.find(n=>!n.ok),s=t?`${t.index} (${t.type})`:String(e.completed),r=t?.error??e.error;super(`perform failed at step ${s}${r?`: ${r}`:""}`),this.result=e}},x=class extends o{result;constructor(e){super(`reset (${e.strategy}) failed${e.error?`: ${e.error}`:""}`),this.result=e}};function U(i){return new Promise(e=>setTimeout(e,i))}function C(i){if(typeof i!="string"||!i.startsWith("data:image/png;base64,"))throw new o(`screenshot bridge returned a non-png payload: ${JSON.stringify(typeof i=="string"?i.slice(0,80):i)}`);let e=i.slice(22),t=atob(e),s=new Uint8Array(t.length);for(let r=0;r<t.length;r++)s[r]=t.charCodeAt(r);return{dataUrl:i,bytes:s}}var J=["bundle","demo","app","open","port","inspectOpen","appFonts","appSplash"];function K(i,e){let t=new URL(i);for(let a of J)t.searchParams.delete(a);let s=t.pathname.replace(/\/+$/,"")||"/",r=s==="/__soot"||s.startsWith("/__soot/")?"/__soot":"",n=String(e).trim();return/^\d+$/.test(n)?t.pathname=`${r}/rn/${n}`:(t.pathname=`${r}/rn`,t.searchParams.set("open",n)),t.toString()}function j(i){return typeof i=="object"&&"text"in i&&typeof i.text=="string"&&!("layout"in i)&&!("absolutePosition"in i)}var k=class{simId;bridge;closed=!1;constructor(e,t,s={}){this.bridge=e,this.simId=t}send(e,t){if(this.closed)return Promise.reject(new m("sim client is closed"));let s=e.simId===void 0?{...e,simId:this.simId}:e;return this.bridge.send(s,t)}listSims(){return this.bridge.listSims()}focusSim(e=this.simId){return this.bridge.focusSim(e)}closeSim(e=this.simId){return this.bridge.closeSim(e)}claim(e=this.simId,t){return this.bridge.claim(e,t)}close(){this.closed||(this.closed=!0,this.bridge.close())}async open(e,t={}){let r=(await this.listSims()).find(c=>c.id===this.simId);if(!r)throw new m(`sim ${this.simId} is no longer connected`);let n=r.url??r.origin;if(!n)throw new m(`sim ${this.simId} reported no URL to derive the shell from`);let a=K(n,e),p=new URL(a);await this.send({type:"evaluate",code:`window.location.href = ${JSON.stringify(a)}`});let L=Date.now()+(t.timeoutMs??3e4);for(;Date.now()<L;){await U(250);try{let{url:c}=await u(this),S=new URL(c);if(S.pathname===p.pathname&&S.searchParams.get("open")===p.searchParams.get("open"))return}catch{}}throw new m(`timed out waiting for sim ${this.simId} to load ${a}`)}openUrl(e){return P(this,e)}async waitReady(e={}){let t=await $(this,e.timeoutMs??2e4,{onProgress:e.onProgress});if(!t.ready)throw new w(t);return t}settle(e={}){return F({bridge:this,maxMs:e.maxMs??3e3,strict:e.strict})}async find(e){return(await this.findAll(e))[0]??null}async findAll(e){let t={testId:e.testId??null,role:e.role??null,type:e.type??null,text:e.text??null,pressable:e.pressable},s=await R(this,t);if(!s)throw new o("find() needs at least one of testId, text, role, type, or pressable");let{result:r}=s;return Array.isArray(r)?r:r?[r]:[]}async tree(e=5){let{tree:t}=await T(this,e);return Array.isArray(t)?t:[]}resolve(e){return this.send({type:"resolve",selector:e})}describe(e={}){return v(this,{describe:!0,verbose:e.verbose??!1,filter:e.filter??"",compact:!e.verbose,hideXy:!1,fullText:!0})}accessibilityTree(){return I(this)}async logs(e={}){return _(await N(this),e)}errors(e=20){return M(this,e)}warnings(e=20){return A(this,e)}keyboard(){return y(this)}shellState(e=0){return D(this,e)}async url(){let{url:e}=await u(this);return e}async screenshot(e={}){let t=await this.send({type:"screenshot",...e.layers?{layers:e.layers}:{},...e.crop?{crop:e.crop}:{}});return C(t)}async tap(e){if(typeof e=="string")return this.throwUnlessTapped(await B(this,e),e);if("testId"in e&&typeof e.testId=="string")return this.throwUnlessTapped(await f(this,e.testId),e.testId);if(j(e)){let{text:r,...n}=e;return this.throwUnlessTapped(await W(this,r,n),r)}if("testID"in e&&typeof e.testID=="string")return this.throwUnlessTapped(await f(this,e.testID),e.testID);let t=this.coordsForTapTarget(e),s=await this.send({type:"tap",x:t.x,y:t.y});if(!h(s))throw new d(`tap at ${t.x},${t.y} missed: ${JSON.stringify(s)}`)}async longPress(e,t={}){let s=await this.resolveCoords(e);if(!(await this.send({type:"longPress",x:s.x,y:s.y,durationMs:t.durationMs??600},{timeoutMs:(t.durationMs??600)+15e3}))?.ok)throw new d(`longPress at ${s.x},${s.y} missed`)}async type(e){await this.requireVisibleKeyboard("type"),await this.send({type:"keyboard",action:"type",text:e})}async press(e){await this.requireVisibleKeyboard("press"),await this.send({type:"keyboard",action:"press",text:e})}async dismissKeyboard(){await this.send({type:"keyboard",action:"dismiss"})}async perform(e,t){let s=[];for(let a of e){if(a.type!=="tapText"){s.push(a);continue}let p=await l(this,{mode:"text",value:a.text});if(!p)throw new d(`perform tapText: no node with text ${JSON.stringify(a.text)}`);s.push({type:"tap",x:p.x,y:p.y,target:{testID:p.testID??void 0,text:p.text??void 0,type:p.type??void 0}})}let r=t?.timeoutMs??3e4,n=await this.send({type:"perform",steps:s,...t?{performOptions:t}:{}},{timeoutMs:r+5e3});if(!n?.ok)throw new g(n);return n}state(e){return this.send({type:"state",...e?{stateOptions:e}:{}})}async reset(e){let t=await this.send({type:"reset",...e?{resetOptions:e}:{}},{timeoutMs:6e4});if(!t?.ok)throw new x(t);return t}throwUnlessTapped(e,t){if(!e.failure&&h(e.result))return;let s=e.failure==="not-found"?"no matching node":e.failure==="missed"?e.result?.reason??"press missed":e.payload?.ambiguous?`ambiguous: ${e.payload.total} matches`:e.result?.reason??e.payload?.error??"tap failed";throw new d(`tap ${JSON.stringify(t)} failed: ${s}`,e)}coordsForTapTarget(e){if(typeof e=="object"&&"x"in e&&"y"in e&&typeof e.x=="number"&&typeof e.y=="number")return{x:e.x,y:e.y};if(typeof e=="object"&&"absolutePosition"in e&&e.absolutePosition&&e.layout)return{x:e.absolutePosition.x+(e.layout.width??0)/2,y:e.absolutePosition.y+(e.layout.height??0)/2};throw new o("tap target needs coordinates, a testId, text, or a node from find()")}async resolveCoords(e){if(typeof e=="string"){let t=await l(this,{mode:"testid",value:e})??await l(this,{mode:"text",value:e});if(!t)throw new d(`no node matching ${JSON.stringify(e)}`);return t}if("testId"in e&&typeof e.testId=="string"){let t=await l(this,{mode:"testid",value:e.testId});if(!t)throw new d(`no node with testID ${JSON.stringify(e.testId)}`);return t}if("text"in e&&typeof e.text=="string"&&!("layout"in e)){let t=await l(this,{mode:"text",value:e.text});if(!t)throw new d(`no node with text ${JSON.stringify(e.text)}`);return t}return this.coordsForTapTarget(e)}async requireVisibleKeyboard(e){let t=Date.now()+1500;for(;;){let s=await y(this);if(!("error"in s)&&s.visible)return;if(Date.now()>=t)throw new b(`${e} requires the iOS keyboard to be visible \u2014 focus an input first (tap a TextInput)`);await U(150)}}};export{o as a,m as b,w as c,d,b as e,g as f,x as g,K as h,k as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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 a=["Cache","Code Cache","DawnCache","DawnGraphiteCache","DawnWebGPUCache","GPUCache","GrShaderCache","ShaderCache"],r=new Set(a);function s(e){return r.has(e)}export{a,s as b};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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 d}from"./chunk-
|
|
4
|
+
import{a as d}from"./chunk-ZRQKEKHX.js";import{a as s}from"./chunk-KXAE64HF.js";import{a as f,c}from"./chunk-Q5WPPOFV.js";import{a as e}from"./chunk-I7LRVN5M.js";import{a as n}from"./chunk-MKHW3JNL.js";import{d as m,e as p,f as u}from"./chunk-JPRHJMUJ.js";import{a}from"./chunk-P6K6XFWE.js";import{a as i}from"./chunk-MSM2E74F.js";function g(){return`${i.commandName} CLI v${a()} \xB7 ${d().primary}`}function E(){let r=p({bridgePort:7668,defaultShellUrl:n},e()),o=`
|
|
5
5
|
${c}
|
|
6
6
|
`;console.log(`${g()}
|
|
7
7
|
${o}${r}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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
|
function a(){console.error(" no rnx desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" rnx desktop install"),console.error(""),console.error(" or install the recommended background service:"),console.error(" rnx daemon install"),console.error("")}function t(r){console.error(""),console.error(` no sim is connected to the rnx bridge on port ${r}.`),console.error(""),console.error(" start your app dev server, then open it in rnx:"),console.error(" npx expo start --localhost --port 8081"),console.error(" rnx open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" rnx describe")}async function d(r,n,s){let e=[];try{e=await r.listSims()}catch{}if(console.error(""),e.length===0){t(n);return}console.error(` no sim with id "${s}" is connected to the bridge on port ${n}.`),console.error(""),console.error(" connected sims:");for(let o of e){let i=[o.isPrimary?"primary":null,o.readyState,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":null,o.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${o.id} (${i})`)}console.error(""),console.error(" pass a valid --sim id, or run `rnx list` to see all sessions.")}export{a,t as b,d as c};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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 Y}from"./chunk-
|
|
4
|
+
import{c as Y}from"./chunk-SC7PGULZ.js";import{c as u}from"./chunk-YWTBN7SD.js";import{P as M,R as H,g as U,j as A,s as O,t as L,u as j}from"./chunk-QA2PTSOC.js";import{a as V}from"./chunk-P6K6XFWE.js";import{a as S}from"./chunk-MSM2E74F.js";import{execFileSync as Z,spawnSync as a}from"child_process";import{existsSync as s,mkdirSync as E,readFileSync as le,realpathSync as ue,rmSync as y,writeFileSync as Q}from"fs";import{homedir as w}from"os";import{basename as de,dirname as B,resolve as d,sep as W}from"path";import{execFileSync as re}from"child_process";import{chmodSync as ne,mkdirSync as T,rmSync as oe,writeFileSync as _}from"fs";import{dirname as N}from"path";var se="dev.sootsim.daemon",G="SootSim Daemon",q="0.1.36";function X(e,t,r){let o=L(),n=j(),c=N(N(n)),l=N(n),p=`${c}/Resources`;oe(o,{recursive:!0,force:!0}),T(O(),{recursive:!0}),T(l,{recursive:!0}),T(p,{recursive:!0}),_(`${c}/Info.plist`,ie()),_(`${c}/PkgInfo`,"APPL????"),_(n,ae(e,t,r)),ne(n,493);try{re("codesign",["--force","--sign","-","--deep",o],{stdio:"pipe"})}catch(i){let h=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${o} failed: ${h}
|
|
5
5
|
the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:o,launcherPath:n}}function ie(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
6
6
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
7
7
|
<plist version="1.0">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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 nt}from"./chunk-
|
|
4
|
+
import{a as nt}from"./chunk-ZTZTRD5R.js";import{a as ot}from"./chunk-K4TGUDY4.js";import{a as Se,b as ve,c as et,d as xe,e as Te,f as tt,g as rt}from"./chunk-XA4YU3A4.js";import{a as Qe}from"./chunk-BRRWRBW7.js";import{e as it}from"./chunk-NLMDMNO6.js";import{a as re}from"./chunk-7FYOZQBM.js";import{f as qe,g as Ye,o as ze,q as Xe,u as Ze}from"./chunk-PUH6RQBJ.js";import{l as je}from"./chunk-IX25FFF3.js";import{a as Ke}from"./chunk-EY5OHL2M.js";import{h as Ge,m as Je}from"./chunk-4UMODU6C.js";import{G as ye,o as We,p as Ve}from"./chunk-I37LRPZ3.js";import{b as Ue}from"./chunk-NWPYM54M.js";import{a as Le,b as Ne,d as Ce}from"./chunk-D5AT7UT5.js";import{g as me,h as ge,t as we,u as be,v as He}from"./chunk-MKHW3JNL.js";import{c as E}from"./chunk-YWTBN7SD.js";import{b as kt,d as $t}from"./chunk-WR7LRCYW.js";var dt=kt((fr,lt)=>{"use strict";var J=Object.freeze({channelThreshold:24,contentBandInsetFraction:.08,minimumContentPercent:.005}),Mt=3;function st(i,e){return!i||!e||i.length!==e.length?!1:i.equals(e)}function at(i){if(!i||typeof i!="object"||Array.isArray(i))throw new Error("proof content measurement requires an input object");let{data:e,width:t,height:r}=i;if(!e||typeof e.length!="number"||!Number.isInteger(t)||!Number.isInteger(r)||t<=0||r<=0||e.length!==t*r*4)throw new Error("proof content measurement needs RGBA pixels and dimensions");let n=Math.floor(r*J.contentBandInsetFraction),o=Math.ceil(r*(1-J.contentBandInsetFraction)),s=new Uint32Array(1024*32),a=0;for(let g=n;g<o;g++)for(let f=0;f<t;f++){let v=(g*t+f)*4,P=e[v]>>3<<10|e[v+1]>>3<<5|e[v+2]>>3;s[P]++,a++}let l=0;for(let g=1;g<s.length;g++)s[g]>s[l]&&(l=g);let u={red:((l>>10&31)<<3)+4,green:((l>>5&31)<<3)+4,blue:((l&31)<<3)+4},h=0;for(let g=n;g<o;g++)for(let f=0;f<t;f++){let v=(g*t+f)*4;Math.max(Math.abs(e[v]-u.red),Math.abs(e[v+1]-u.green),Math.abs(e[v+2]-u.blue))>=J.channelThreshold&&h++}let m=h/a*100;return{contentPercent:m,contentPixels:h,dominant:u,passedMinimum:m>=J.minimumContentPercent,totalPixels:a}}function Rt(i,e){if(!e)return{decision:"continue",content:null};let t=at(e);return t.passedMinimum?i&&st(i,e.data)?{decision:"identical",content:t}:{decision:"changed",content:t}:{decision:"insufficient-content",content:t}}lt.exports={PROOF_CONTENT_DEFINITION:J,REQUIRED_IDENTICAL_PROOF_FRAMES:Mt,framesIdentical:st,measureProofFrameContent:at,settleDecision:Rt}});import*as $ from"fs";import{createHash as tr,randomUUID as rr}from"node:crypto";import{tmpdir as Z}from"os";import*as b from"path";import*as I from"fs";import*as S from"path";var X=$t(dt(),1);var Bt="inset 0 0 0 0.5px #000, inset 0 0 0 2px #757575, inset 0 0 0 5px #212121",ut=1;function Lt(i){let e=Ce(i),t=e.scale,r=e.statusBarHeight>0&&!e.dynamicIsland&&e.homeIndicatorHeight===0&&e.cornerRadius===0,n=e.width,o=e.height,s=Le(e),a=r?e.width+58:s.frameWidth,l=r?e.height+111+111:s.frameHeight,u=9.5,h=ut,m=a+u*2,g=l+ut*2,f=u+(r?29:s.screenLeft),v=r?111:s.screenTop,P=r?52:s.frameRadius,U=[{side:e.hardwareButtons.lock.side,top:e.hardwareButtons.lock.top,height:e.hardwareButtons.lock.height,width:e.hardwareButtons.width},{side:e.hardwareButtons.ringToggle.side,top:e.hardwareButtons.ringToggle.top,height:e.hardwareButtons.ringToggle.height,width:e.hardwareButtons.width},{side:e.hardwareButtons.volumeUp.side,top:e.hardwareButtons.volumeUp.top,height:e.hardwareButtons.volumeUp.height,width:e.hardwareButtons.width},{side:e.hardwareButtons.volumeDown.side,top:e.hardwareButtons.volumeDown.top,height:e.hardwareButtons.volumeDown.height,width:e.hardwareButtons.width}];return{model:i,renderScale:t,outerWidth:Math.round(m*t),outerHeight:Math.round(g*t),logicalOuterWidth:m,logicalOuterHeight:g,logicalFrameWidth:a,logicalFrameHeight:l,logicalFrameLeft:u,logicalFrameTop:h,logicalScreenWidth:n,logicalScreenHeight:o,logicalScreenLeft:f,logicalScreenTop:v,logicalScreenRadius:r?0:s.screenRadius,logicalFrameRadius:P,frameBackground:r?"linear-gradient(180deg, #1b1c20 0%, #0f1012 42%, #050608 100%)":"#000000",frameOutline:r?"0 0 0 1px #1f2125":"0 0 0 1px #333",metallicRingShadow:r?null:Bt,buttons:U,legacyHomeButton:r?{top:111+e.height+47/2,left:e.width/2-64/2+29,size:64,ring:1.5}:null,showHomeIndicator:e.homeIndicatorHeight>0,logicalHomeIndicatorStripHeight:e.homeIndicatorHeight}}function Nt(i){let e=i.side==="right",t=e?"inset(-3px -3px -3px 0)":"inset(-3px 0 -3px -3px)";return`
|
|
5
5
|
<div
|
|
6
6
|
aria-hidden="true"
|
|
7
7
|
style="
|
|
@@ -527,7 +527,7 @@ flow extension:
|
|
|
527
527
|
})()`}),console.log(` captured ${O.length} partial replay events`)}catch(d){console.warn(` event recorder stop failed: ${d?.message||String(d)}`)}console.error(`
|
|
528
528
|
x failed: ${p.message}
|
|
529
529
|
`),R&&(console.log(" partial profile:"),gt(R)),A&&console.log(` partial video: ${A}`);try{let d=c.lastFailedStep,y=d?`step-${String(d.index+1).padStart(2,"0")}-${d.kind}`:"unstaged",k=b.join(a,y);await c.captureFailureBundle(k,{error:p,stepIndex:d?.index,stepKind:d?.kind,stepTarget:d?.target}),fe=k,console.log(` failure bundle: ${k}`),console.log(" (contents: screenshot.png, describe.json, a11y.txt, tree.txt, console.json, error.json)")}catch(d){try{let y=b.join(a,"error.png");await c.captureScreenshot(y),console.log(` error screenshot: ${y}`)}catch{}console.log(` (failure bundle capture failed: ${d instanceof Error?d.message:String(d)})`)}await Je(F,{errorsCommand:`sootsim get errors 5${c.simId?` --sim ${c.simId}`:""}`,warningsCommand:`sootsim get warnings 5${c.simId?` --sim ${c.simId}`:""}`,requestsCommand:`sootsim get requests 5${c.simId?` --sim ${c.simId}`:""}`}),V=1}if(await c.liveStatus?.end(V===0?"passed":"failed"),f&&(V===0||A||O))try{let p=await sr(O??[]),d=["--origin",v,"--events",p];P&&d.push("--public-origin",P),A&&d.push("--video",A),W&&d.push("--screenshot",W),A&&N&&Number.isFinite(N)&&(d.push("--video-duration-ms",String(Math.round(N))),d.push("--recorded-duration-ms",String(Math.round(N))));let y=c.getLastRecordingStartedAtMs();y&&Number.isFinite(y)&&d.push("--recording-started-at-ms",String(Math.round(y))),x.wsPort&&d.push("--port",String(x.wsPort)),c.simId&&d.push("--sim",c.simId),U&&d.push("--open"),ke&&d.push("--owner",ke),$e&&d.push("--repo",$e),d.push("--run-scope",bt),j&&d.push("--billing-kind",j),console.log(`
|
|
530
|
-
preparing preview upload\u2026`);let k=c.getFlowTraceSteps();k.length>0&&d.push("--timeline-events",await ar(k));let G=await lr(k,y);G&&d.push("--snapshot-manifest",G),fe&&d.push("--failure-bundle",fe);let _=c.getLastRecordingFrameStats();_&&d.push("--trace-frame-stats",await dr(_));let{runUpload:Pt}=await import("./upload-
|
|
530
|
+
preparing preview upload\u2026`);let k=c.getFlowTraceSteps();k.length>0&&d.push("--timeline-events",await ar(k));let G=await lr(k,y);G&&d.push("--snapshot-manifest",G),fe&&d.push("--failure-bundle",fe);let _=c.getLastRecordingFrameStats();_&&d.push("--trace-frame-stats",await dr(_));let{runUpload:Pt}=await import("./upload-QB77GSMQ.js");Ae=await Pt(d,{})}catch(p){console.error(` preview upload failed: ${p?.message||p}`),V=1}return Pe=c.getFlowTraceSteps(),F.close(),pe?(c.simId&&he.add(c.simId),await or(x.wsPort,x.commandTimeoutMs,[...he])):c.simId&&c.simId!==ee&&ge(c.simId),V}async function or(i,e,t){let r=[...new Set(t.filter(Boolean))];if(r.length===0)return;let n=be(i,{commandTimeoutMs:e});try{let o=await n.listSims(),s=r.filter(l=>o.some(u=>u.id===l&&u.readyState==="open"));if(s.length===0)return;let a=await Ze(n,i,e,s);await ze(o,s),a.closed.length>0&&console.log(` closed flow sim(s): ${a.closed.join(", ")}`),a.remaining.length>0&&console.warn(` warn: flow sim(s) still connected after close: ${a.remaining.join(", ")}`)}catch(o){console.warn(` warn: failed to close flow sim(s): ${o instanceof Error?o.message:String(o)}`)}finally{n.close()}}async function sr(i){let{gzipSync:e}=await import("zlib"),t=i.map(o=>JSON.stringify(o)).join(`
|
|
531
531
|
`)+(i.length?`
|
|
532
532
|
`:""),r=e(Buffer.from(t,"utf8")),n=b.join(Z(),`sootsim-events-${Date.now()}.jsonl.gz`);return $.writeFileSync(n,r),console.log(` events: ${i.length} written to ${n} (${r.length} bytes gz)`),n}async function ar(i){let{gzipSync:e}=await import("zlib"),t=i.map((s,a)=>({schemaVersion:1,t:s.endedAtMs,seq:1e6+a,context:"host",kind:"flow-step",id:`flow-step-${s.stepIndex}`,data:{stepIndex:s.stepIndex,stepNumber:s.stepIndex+1,stepName:s.stepName,...s.targetLabel?{targetLabel:s.targetLabel}:{},status:s.status,durationMs:s.durationMs,startedAtMs:s.startedAtMs,endedAtMs:s.endedAtMs,...s.error?{error:s.error}:{}}})),r=t.map(s=>JSON.stringify(s)).join(`
|
|
533
533
|
`)+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as c}from"./chunk-
|
|
4
|
+
import{a as c}from"./chunk-2OA2WE7G.js";import{M as u,l}from"./chunk-QA2PTSOC.js";import r from"fs";import e from"path";import{fileURLToPath as m}from"url";var s;function p(){if(s!==void 0)return s;let t=e.dirname(m(import.meta.url));for(let n=0;n<12&&t!==e.dirname(t);n++){if(r.existsSync(e.join(t,"packages/sootsim-engine/package.json"))&&r.existsSync(e.join(t,"public/sootsim")))return s=t,t;t=e.dirname(t)}return s=null,null}function d(){if(process.env.SOOTSIM_HOME&&u())return null;let t=p();if(!t)return null;let n=e.join(t,"public/sootsim");return r.existsSync(e.join(n,"index.html"))&&r.existsSync(e.join(n,"engine/index.html"))&&r.existsSync(e.join(n,"engine-tenant/worker.js"))?n:null}function g(){let t=d();if(t)return t;let n=u();if(!n)return null;let o=l(n);return r.existsSync(e.join(o,"index.html"))?o:null}var a=".runtime.localhost";function y(t){let n=t.trim();if(!c(n))throw new Error(`invalid rnx runtime version: ${t}`);let i=Buffer.from(n,"utf8").toString("hex").match(/.{1,60}/g);if(!i)throw new Error(`invalid rnx runtime version: ${t}`);return`${i.join(".")}${a}`}function f(t){return t.toLowerCase().endsWith(a)}function x(t){if(!f(t))return null;let n=t.slice(0,-a.length).split(".");if(n.length===0||n.some(i=>!/^[0-9a-f]{1,60}$/i.test(i)))return null;let o=n.join("");if(o.length%2!==0)return null;try{let i=Buffer.from(o,"hex").toString("utf8");return c(i)?i:null}catch{return null}}function S(t){let n=l(t);return r.existsSync(e.join(n,"index.html"))?n:null}function M(t){if(!f(t))return g();let n=x(t);return n?S(n):null}export{d as a,y as b,f as c,x as d,M as e};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! rnx v0.1.372 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{b as w}from"./chunk-RXKZJAGY.js";import{f as g}from"./chunk-2OA2WE7G.js";import{L as B,T as b,g as S}from"./chunk-QA2PTSOC.js";import a from"node:fs";import c from"node:path";var f=1,E=`automatic-cleanup-v${f}.json`,x=`automatic-cleanup-v${f}.lock`,P=360*60*1e3,A=`automatic-cleanup-v${f}.deferred.json`,T=1800*1e3;function v(){let s=c.join(S(),E);try{return JSON.parse(a.readFileSync(s,"utf8")).generation===f}catch{return!1}}function J(s=Date.now()){if(v())return!0;let e=c.join(S(),A);try{let n=JSON.parse(a.readFileSync(e,"utf8"));if(n.generation!==f||typeof n.attemptedAt!="number")return!1;let r=s-n.attemptedAt;return r>=0&&r<T}catch{return!1}}function K(s){if(s<1024)return`${s} B`;let e=["KiB","MiB","GiB","TiB"],n=s/1024,r=e[0];for(let i=1;i<e.length&&n>=1024;i++)n/=1024,r=e[i];return`${n.toFixed(n>=10?1:2)} ${r}`}function p(s){let e;try{e=a.lstatSync(s)}catch{return 0}let n=e.blocks>0?e.blocks*512:e.size;if(!e.isDirectory()||e.isSymbolicLink())return n;let r=n;try{for(let i of a.readdirSync(s))r+=p(c.join(s,i))}catch{}return r}function k(s){for(let e of["SingletonLock","SingletonSocket","lockfile"])try{if(a.lstatSync(c.join(s,e)))return!0}catch{}return!1}function C(s,e){let n;try{n=a.readdirSync(s,{withFileTypes:!0})}catch{return[]}let r=k(e),i=[];for(let t of n){if(!t.isDirectory()||t.isSymbolicLink())continue;let o=c.join(s,t.name);if(w(t.name)){i.push({path:o,bytes:p(o),kind:"browser-cache",state:r?"in-use":"safe",selected:!r,detail:r?"browser profile is open; close it before cleanup":"disposable browser HTTP, bytecode, or GPU cache"});continue}i.push(...C(o,e))}return i}function R(s){let e=c.join(s,"profiles","playwright"),n;try{n=a.readdirSync(e,{withFileTypes:!0})}catch{return[]}return n.flatMap(r=>{if(!r.isDirectory()||r.isSymbolicLink())return[];let i=c.join(e,r.name);return C(i,i)})}function D(s){let e=c.join(s,"electron","userData");return C(e,e)}function U(s,e){let n=c.join(s,"recordings"),r;try{r=a.readdirSync(n,{withFileTypes:!0})}catch{return[]}return r.map(i=>{let t=c.join(n,i.name);return{path:t,bytes:p(t),kind:"recording",state:"aggressive",selected:e,detail:"user-created recording or captured-frame output"}})}function L(s,e){let n=c.join(s,"camera-fixtures"),r;try{r=a.readdirSync(n,{withFileTypes:!0})}catch{return[]}return r.map(i=>{let t=c.join(n,i.name);return{path:t,bytes:p(t),kind:"camera-fixture",state:"aggressive",selected:e,detail:"staged camera fixture video"}})}function F(s){let e=new Set(b()),n=[...e],r=g.planLocalRetention({retainVersions:2,protectVersions:n}),i=g.planLocalRetention({retainVersions:1,protectVersions:n}),t=new Set(r.removeVersions),o=new Set(i.removeVersions),m=new Set([...r.keepVersions,...r.removeVersions,...i.keepVersions,...i.removeVersions]),u=[];for(let l of[...m].sort()){let y=g.product.runtimeDir(l),d="retained",h="retained runtime";e.has(l)&&l!==r.activeVersion?(d="in-use",h="runtime is serving a connected simulator"):t.has(l)?(d="safe",h="inactive runtime outside the two-version rollback window"):o.has(l)?(d="aggressive",h="most recent rollback runtime"):l===r.activeVersion&&(h="active runtime; always protected"),u.push({path:y,bytes:p(y),kind:"runtime-version",state:d,selected:d==="safe"||d==="aggressive"&&s,detail:h})}for(let l of r.removeCacheFiles)u.push({path:l,bytes:p(l),kind:"runtime-archive",state:"safe",selected:!0,detail:"downloaded archive is unnecessary after successful extraction"});return{activeRuntime:r.activeVersion,entries:u}}function I(s={}){let e=s.aggressive===!0,n=S(),r=F(e),i=[...r.entries,...R(n),...D(n),...U(n,e),...L(n,e)].sort((t,o)=>o.bytes-t.bytes||t.path.localeCompare(o.path));return{home:n,activeRuntime:r.activeRuntime,entries:i,reclaimableBytes:i.reduce((t,o)=>t+(o.selected?o.bytes:0),0),protectedBytes:i.reduce((t,o)=>t+(o.selected?0:o.bytes),0),totalBytes:p(n)}}function j(s,e){let n=c.relative(s,e);if(!n||n.startsWith("..")||c.isAbsolute(n))throw new Error(`refusing cleanup target outside the rnx data home: ${e}`)}function O(s={}){let e=I(s),n=s.aggressive===!0?1:2;g.pruneLocalRetention({retainVersions:n,protectVersions:b()});for(let t of e.entries)if(t.selected&&!(t.kind==="runtime-archive"||t.kind==="runtime-version")){if(t.kind==="browser-cache"){let m=c.relative(e.home,t.path).split(c.sep),u=m[0]==="profiles"&&m[1]==="playwright"&&m[2]?c.join(e.home,"profiles","playwright",m[2]):m[0]==="electron"&&m[1]==="userData"?c.join(e.home,"electron","userData"):null;if(u&&k(u)){t.state="in-use",t.selected=!1,t.detail="browser profile opened while cleanup was starting";continue}}j(e.home,t.path),a.rmSync(t.path,{recursive:!0,force:!0})}let r=e.entries.filter(t=>t.selected&&!a.existsSync(t.path)).map(t=>t.path),i=p(e.home);return{...e,removedPaths:r,reclaimedBytes:Math.max(0,e.totalBytes-i),remainingBytes:i}}function H(){B();let s=S(),e=c.join(s,E),n=c.join(s,A),r=c.join(s,x);if(v())return{status:"already-complete",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};let i=null;for(let t=0;t<2&&i===null;t++)try{let o=a.openSync(r,"wx");try{a.writeFileSync(o,`${JSON.stringify({pid:process.pid,startedAt:Date.now()})}
|
|
5
|
+
`,"utf8"),i=o}catch(m){a.closeSync(o);try{a.unlinkSync(r)}catch{}throw m}}catch(o){if((o instanceof Error&&"code"in o?o.code:null)!=="EEXIST")throw o;let u=0,l=0,y=null;try{y=a.lstatSync(r);let d=JSON.parse(a.readFileSync(r,"utf8"));u=typeof d.pid=="number"?d.pid:0,l=typeof d.startedAt=="number"?d.startedAt:0}catch{}if(u>0&&l>0&&Date.now()-l<P)try{return process.kill(u,0),{status:"busy",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0}}catch{}if(!y)continue;try{let d=a.lstatSync(r);if(d.dev!==y.dev||d.ino!==y.ino)return{status:"busy",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};a.unlinkSync(r)}catch{}}if(i===null)return{status:"busy",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};try{if(v())return{status:"already-complete",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};let t=O(),o=t.entries.reduce((u,l)=>u+(l.state==="in-use"?l.bytes:0),0);if(o>0){let u=`${n}.${process.pid}.tmp`;return a.writeFileSync(u,`${JSON.stringify({generation:f,attemptedAt:Date.now(),deferredInUseBytes:o})}
|
|
6
|
+
`,"utf8"),a.renameSync(u,n),{status:"deferred",reclaimedBytes:t.reclaimedBytes,remainingBytes:t.remainingBytes,deferredInUseBytes:o}}let m=`${e}.${process.pid}.tmp`;return a.writeFileSync(m,`${JSON.stringify({generation:f,completedAt:Date.now(),reclaimedBytes:t.reclaimedBytes})}
|
|
7
|
+
`,"utf8"),a.renameSync(m,e),a.rmSync(n,{force:!0}),{status:"complete",reclaimedBytes:t.reclaimedBytes,remainingBytes:t.remainingBytes,deferredInUseBytes:0}}finally{a.closeSync(i);try{a.unlinkSync(r)}catch{}}}export{v as a,J as b,K as c,I as d,O as e,H as f};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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 N}from"./chunk-DXV37CJN.js";import{o as R}from"./chunk-U63T6LIQ.js";import{a as I}from"./chunk-64JAEJ6N.js";import{a as T}from"./chunk-I52NT6VG.js";function G(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function O(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return G(r)?r:null}catch{return null}}import{randomBytes as q,createHash as X}from"node:crypto";import f from"node:fs";import h from"node:path";var $=null;function B(){if($)return $;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||R()}function y(){return B()}function U(){return h.join(B(),"attached-projects.json")}function _(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return _();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return _()}}function K(e){let t=U();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),K(t),t}function F(e){return X("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function Q(){return`s_${q(10).toString("hex")}`}function Se(e){let t=h.resolve(e.cwd),r=F(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function M(e){return S().attachedProjects.find(t=>t.id===e)??null}function we(){return S().attachedProjects}var V=336*60*60*1e3;function ve(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-V,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Ae(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function xe(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function C(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??Q(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function L(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function z(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function Z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=z(t.agentSessions[c],s,r))}})}function v(e,t){Z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-JZH66VIM.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=F(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as ee,spawnSync as te}from"node:child_process";import{randomUUID as re}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import ne from"node:readline";function b(e){return u.join(y(),"sessions",e)}function J(e){return u.join(b(e),"prompt.in")}function H(e){return u.join(b(e),"events.out")}function se(e){return u.join(y(),"transcripts",`${e}.log`)}function E(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function oe(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ie();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("rnx CLI not found. set SOOTSIM_BIN to the path of the rnx binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ie(){try{let e=ce();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[rnx] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ce(){try{let r=T.resolve(`${I.packageName}/package.json`);return u.dirname(r)}catch{}let e=ae();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name===I.packageName)return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ae(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function de(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!ue(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function ue(e){try{return process.kill(e,0),!0}catch{return!1}}function W(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=te("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function $e(e){let t=M(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return de(t.id,r,async()=>{let n=L(t.id).find(p=>p.provider===r&&p.status!=="ended"&&E(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`rnx agent end <sessionId>\`.`);let o=r==="claude"?re():void 0,s=C({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=J(s.id),d=H(s.id),a=se(s.id);W(c),W(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:Y}=oe(),x=[...Y,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&x.push("--codex-bin",e.codexBin),e.claudeBin&&x.push("--claude-bin",e.claudeBin),e.freshThread&&x.push("--fresh-thread"),o&&x.push("--claude-session-uuid",o);let P=ee(A,x,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});P.unref();let D=e.readyTimeoutMs??6e3,j=await le(d,p=>p.type==="ready"||p.type==="error",D);if(!j||j.type==="error"){if(P.pid)try{process.kill(P.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${D}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:P.pid,status:"idle"}),{session:k(s.id),wrapperPid:P.pid}})}async function _e(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!E(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=J(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=N(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
4
|
+
import{a as N}from"./chunk-NBEOA72C.js";import{o as R}from"./chunk-QA2PTSOC.js";import{a as I}from"./chunk-MSM2E74F.js";import{a as T}from"./chunk-WR7LRCYW.js";function G(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.type=="string"&&typeof t.ts=="number"}function O(e){let t=e.trim();if(!t)return null;try{let r=JSON.parse(t);return G(r)?r:null}catch{return null}}import{randomBytes as q,createHash as X}from"node:crypto";import f from"node:fs";import h from"node:path";var $=null;function B(){if($)return $;let e=process.env.SOOTSIM_USER_DATA_DIR;return e||R()}function y(){return B()}function U(){return h.join(B(),"attached-projects.json")}function _(){return{version:1,attachedProjects:[],previewAttachments:[],agentSessions:[]}}function S(){let e=U(),t;try{t=f.readFileSync(e,"utf8")}catch(r){if(r.code==="ENOENT")return _();throw r}try{let r=JSON.parse(t);if(!r||typeof r!="object")throw new Error("not an object");return{version:1,attachedProjects:Array.isArray(r.attachedProjects)?r.attachedProjects:[],previewAttachments:Array.isArray(r.previewAttachments)?r.previewAttachments:[],agentSessions:Array.isArray(r.agentSessions)?r.agentSessions:[]}}catch(r){let n=`${e}.corrupt-${Date.now()}`;try{f.renameSync(e,n),console.warn(`[sootsim] attached-projects.json was unparseable; quarantined to ${n}. original error: ${r.message}`)}catch{}return _()}}function K(e){let t=U();f.mkdirSync(h.dirname(t),{recursive:!0});let r=`${t}.tmp-${process.pid}-${Date.now()}`,n=f.openSync(r,"w",384);try{f.writeFileSync(n,JSON.stringify(e,null,2)),f.fsyncSync(n)}finally{f.closeSync(n)}f.renameSync(r,t)}function w(e){let t=S();return e(t),K(t),t}function F(e){return X("sha256").update(h.resolve(e)).digest("hex").slice(0,16)}function Q(){return`s_${q(10).toString("hex")}`}function Se(e){let t=h.resolve(e.cwd),r=F(t),n;return w(o=>{let s=o.attachedProjects.find(a=>a.id===r);if(s){let a={...s,...e,id:r,cwd:t,sourceRoots:e.sourceRoots??s.sourceRoots,knownBundleUrls:e.knownBundleUrls??s.knownBundleUrls,pinnedSourceResolutions:e.pinnedSourceResolutions??s.pinnedSourceResolutions,telemetry:e.telemetry??s.telemetry,updatedAt:Date.now(),createdAt:s.createdAt},g=o.attachedProjects.indexOf(s);o.attachedProjects[g]=a,n=a;return}let c=Date.now(),d={id:r,name:e.name??h.basename(t),cwd:t,repoRoot:e.repoRoot,sourceRoots:e.sourceRoots??[t],framework:e.framework??"unknown",bundleId:e.bundleId,knownBundleUrls:e.knownBundleUrls??[],preferredProvider:e.preferredProvider??"codex",preferredTransport:e.preferredTransport??"tmux",editorOpenCommand:e.editorOpenCommand,moshiWebhookToken:e.moshiWebhookToken,pinnedSourceResolutions:e.pinnedSourceResolutions??{},isolateDiscovery:e.isolateDiscovery,git:e.git,telemetry:e.telemetry??{lastOpened:0,runsCompleted:0},createdAt:c,updatedAt:c};o.attachedProjects.push(d),n=d}),n}function M(e){return S().attachedProjects.find(t=>t.id===e)??null}function we(){return S().attachedProjects}var V=336*60*60*1e3;function ve(e,t={}){w(r=>{let n=r.attachedProjects.find(s=>s.id===e);if(!n)return;let o=t.ts??Date.now();if(n.telemetry.runsCompleted=(n.telemetry.runsCompleted??0)+1,typeof t.usd=="number"&&Number.isFinite(t.usd)&&t.usd>=0){let s=n.telemetry.costHistory??[],c=o-V,d=s.filter(a=>a.ts>=c);d.push({ts:o,usd:t.usd}),n.telemetry.costHistory=d}n.updatedAt=o})}function Ae(e,t=Date.now()){let r=t-6048e5,n=e.telemetry.costHistory??[],o=0;for(let s of n)s.ts>=r&&(o+=s.usd);return o}function xe(e){w(t=>{t.attachedProjects=t.attachedProjects.filter(r=>r.id!==e),t.agentSessions=t.agentSessions.filter(r=>r.projectId!==e),t.previewAttachments=t.previewAttachments.filter(r=>r.projectId!==e)})}function C(e){let t;return w(r=>{if(e.id){let c=r.agentSessions.find(d=>d.id===e.id);if(c){let d={...c,...e,lastSeenAt:Date.now()},a=r.agentSessions.indexOf(c);r.agentSessions[a]=d,t=d;return}}let n=r.attachedProjects.find(c=>c.id===e.projectId);if(!n)throw new Error(`upsertSession: no AttachedProject with id=${e.projectId}`);let o=Date.now(),s={id:e.id??Q(),projectId:e.projectId,provider:e.provider,transport:e.transport??n.preferredTransport,cwd:e.cwd??n.cwd,claudeSessionUuid:e.claudeSessionUuid,tmuxSessionName:e.tmuxSessionName,wrapperPid:e.wrapperPid,status:e.status??"idle",needsAttention:e.needsAttention??!1,lastPrompt:e.lastPrompt,lastSummary:e.lastSummary,lastTurnFiles:e.lastTurnFiles,currentlyEditing:e.currentlyEditing,lastSeenAt:o,createdAt:o};r.agentSessions.push(s),t=s}),t}function k(e){return S().agentSessions.find(t=>t.id===e)??null}function L(e){let t=S().agentSessions;return e?t.filter(r=>r.projectId===e):t}function z(e,t,r=Date.now()){return{...e,...t,id:e.id,projectId:e.projectId,createdAt:e.createdAt,lastSeenAt:r}}function Z(e){e.length!==0&&w(t=>{let r=Date.now(),n=new Map(t.agentSessions.map((o,s)=>[o.id,s]));for(let{id:o,patch:s}of e){let c=n.get(o);c!==void 0&&(t.agentSessions[c]=z(t.agentSessions[c],s,r))}})}function v(e,t){Z([{id:e,patch:t}])}async function Pe(){if(S().attachedProjects.length>0)return;let{loadOptionalDemoApps:t}=await import("./optional-demo-registry-F3FQT5WT.js"),r=await t();r.length!==0&&w(n=>{for(let o of r){if(!f.existsSync(o.dir))continue;let s=h.resolve(o.dir),c=F(s);if(n.attachedProjects.some(a=>a.id===c))continue;let d=Date.now();n.attachedProjects.push({id:c,name:o.label,cwd:s,sourceRoots:[s],framework:o.framework,knownBundleUrls:[`http://localhost:${o.preferredPort}/index.bundle`],preferredProvider:"codex",preferredTransport:"tmux",pinnedSourceResolutions:{},telemetry:{lastOpened:0,runsCompleted:0},createdAt:d,updatedAt:d})}})}import{spawn as ee,spawnSync as te}from"node:child_process";import{randomUUID as re}from"node:crypto";import i,{constants as m}from"node:fs";import u from"node:path";import ne from"node:readline";function b(e){return u.join(y(),"sessions",e)}function J(e){return u.join(b(e),"prompt.in")}function H(e){return u.join(b(e),"events.out")}function se(e){return u.join(y(),"transcripts",`${e}.log`)}function E(e,t){if(!e)return!1;try{process.kill(e,0)}catch{return!1}return!(t&&!i.existsSync(b(t)))}function oe(){if(process.env.SOOTSIM_BIN)return{cmd:process.env.SOOTSIM_BIN,prefixArgs:[]};if(process.versions.electron){let n=process.resourcesPath;if(n){let o=[u.join(n,"bin","sootsim"),u.join(n,"bin",`sootsim-${process.platform}-${process.arch}`)];for(let s of o)if(i.existsSync(s))return{cmd:s,prefixArgs:[]}}}let e=ie();if(e)return e;let t=process.argv[0],r=process.argv[1];if(r&&/\.(ts|tsx|mjs|cjs|js)$/.test(r))return{cmd:t,prefixArgs:[r]};if(!r||r.includes("/.bin/"))throw new Error("rnx CLI not found. set SOOTSIM_BIN to the path of the rnx binary, or build the workspace CLI via `bun run --cwd packages/sootsim build:cli`.");return{cmd:t,prefixArgs:[]}}function ie(){try{let e=ce();if(!e)return null;let t=`sootsim-${process.platform}-${process.arch}`,r=u.join(e,"dist-bin",t);if(i.existsSync(r))return{cmd:r,prefixArgs:[]};let n=u.join(e,"dist-cli","bin.js");if(i.existsSync(n)){try{let o=u.join(e,"cli","commands","agent-wrapper.ts");if(i.existsSync(o)){let s=i.statSync(o).mtimeMs;i.statSync(n).mtimeMs<s&&console.warn("[rnx] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with `bun run --cwd packages/sootsim build:cli`.")}}catch{}return{cmd:process.execPath,prefixArgs:[n]}}return null}catch{return null}}function ce(){try{let r=T.resolve(`${I.packageName}/package.json`);return u.dirname(r)}catch{}let e=ae();if(!e)return null;let t=u.dirname(e);for(let r=0;r<8;r++){let n=u.join(t,"package.json");try{if(i.existsSync(n)&&JSON.parse(i.readFileSync(n,"utf8")).name===I.packageName)return t}catch{}let o=u.dirname(t);if(o===t)break;t=o}return null}function ae(){try{let e=import.meta.url;return!e||!e.startsWith("file://")?null:decodeURIComponent(e.slice(7))}catch{return null}}async function de(e,t,r){let n=u.join(y(),"locks");i.mkdirSync(n,{recursive:!0});try{i.chmodSync(n,448)}catch{}let o=u.join(n,`start-${e}-${t}.lock`),s=Date.now()+4e3,c=null;for(;c===null;)try{c=i.openSync(o,m.O_WRONLY|m.O_CREAT|m.O_EXCL,384)}catch(d){if(d.code!=="EEXIST")throw d;try{let a=Number(i.readFileSync(o,"utf8").trim());if(a&&!ue(a)){i.unlinkSync(o);continue}}catch{}if(Date.now()>s)throw new Error(`another start is in progress for project=${e} provider=${t} (lock: ${o})`);await new Promise(a=>setTimeout(a,50))}try{return i.writeFileSync(c,String(process.pid)),await r()}finally{try{i.closeSync(c)}catch{}try{i.unlinkSync(o)}catch{}}}function ue(e){try{return process.kill(e,0),!0}catch{return!1}}function W(e){let t=u.dirname(e);i.mkdirSync(t,{recursive:!0});try{i.chmodSync(t,448)}catch{}if(i.existsSync(e))try{if(i.statSync(e).isFIFO()){try{i.chmodSync(e,384)}catch{}return}i.unlinkSync(e)}catch{i.unlinkSync(e)}let r=te("mkfifo",["-m","600",e]);if(r.status!==0)throw new Error(`mkfifo(${e}) failed: ${r.stderr?.toString().trim()||"unknown error"}`)}var l=class extends Error{code;constructor(t,r){super(r),this.code=t}};async function $e(e){let t=M(e.projectId);if(!t)throw new l("NO_PROJECT",`no project with id=${e.projectId}`);let r=e.provider||t.preferredProvider||"codex";return de(t.id,r,async()=>{let n=L(t.id).find(p=>p.provider===r&&p.status!=="ended"&&E(p.wrapperPid,p.id));if(n)throw new l("ALREADY_RUNNING",`session already running for project=${t.id} provider=${r} (session ${n.id}, pid ${n.wrapperPid}). end it first with \`rnx agent end <sessionId>\`.`);let o=r==="claude"?re():void 0,s=C({projectId:t.id,provider:r,transport:"pty",cwd:t.cwd,status:"idle",claudeSessionUuid:o}),c=J(s.id),d=H(s.id),a=se(s.id);W(c),W(d);let g=u.dirname(a);i.mkdirSync(g,{recursive:!0});try{i.chmodSync(g,448)}catch{}let{cmd:A,prefixArgs:Y}=oe(),x=[...Y,"agent-wrapper","--session-id",s.id,"--project-id",t.id,"--provider",r,"--cwd",t.cwd,"--prompt-in",c,"--events-out",d,"--transcript",a];e.codexBin&&x.push("--codex-bin",e.codexBin),e.claudeBin&&x.push("--claude-bin",e.claudeBin),e.freshThread&&x.push("--fresh-thread"),o&&x.push("--claude-session-uuid",o);let P=ee(A,x,{detached:!0,stdio:"ignore",env:{...process.env,SOOTSIM_USER_DATA_DIR:y()}});P.unref();let D=e.readyTimeoutMs??6e3,j=await le(d,p=>p.type==="ready"||p.type==="error",D);if(!j||j.type==="error"){if(P.pid)try{process.kill(P.pid,"SIGTERM")}catch{}try{i.rmSync(b(s.id),{recursive:!0,force:!0})}catch{}v(s.id,{status:"ended"});let p=j&&j.type==="error"?j.message:`no ready event within ${D}ms`;throw new l("WRAPPER_FAILED",p)}return v(s.id,{wrapperPid:P.pid,status:"idle"}),{session:k(s.id),wrapperPid:P.pid}})}async function _e(e,t){let r=k(e);if(!r)throw new l("NO_SESSION",`no session with id=${e}`);if(!E(r.wrapperPid,e))throw v(e,{status:"ended"}),new l("NOT_ALIVE",`session wrapper is not alive (pid=${r.wrapperPid}). start a new session.`);let n=J(e);if(!i.existsSync(n))throw new l("NO_FIFO",`prompt FIFO missing: ${n}`);let o=i.openSync(n,m.O_WRONLY);try{let s=N(t);if(!s)throw new l("EMPTY_PROMPT","prompt text is empty");i.writeSync(o,s+`
|
|
5
5
|
`)}finally{i.closeSync(o)}v(e,{lastPrompt:t.displayText??t.text,status:"working"})}async function Be(e){let t=k(e);if(!t)throw new l("NO_SESSION",`no session with id=${e}`);if(E(t.wrapperPid,e))try{process.kill(t.wrapperPid,"SIGTERM")}catch{}let r=b(e),n=y();if(r.startsWith(n))try{i.rmSync(r,{recursive:!0,force:!0})}catch{}v(e,{status:"ended",wrapperPid:void 0})}function Ue(e,t){let r=H(e);if(!i.existsSync(r))throw new l("NO_FIFO",`events FIFO missing: ${r}`);let n=i.openSync(r,m.O_RDWR),o=i.createReadStream("",{fd:n,autoClose:!0}),s=ne.createInterface({input:o,crlfDelay:1/0});s.on("line",d=>{let a=O(d);a&&t(a)});let c=!1;return()=>{if(!c){c=!0;try{i.writeSync(n,`
|
|
6
6
|
`)}catch{}try{s.close()}catch{}try{o.destroy()}catch{}}}}async function le(e,t,r){let n=i.openSync(e,m.O_RDWR|m.O_NONBLOCK),o=Buffer.alloc(8192),s="",c=Date.now()+r;try{for(;Date.now()<c;){let d=0;try{d=i.readSync(n,o,0,o.length,null)}catch(a){if(a.code!=="EAGAIN")throw a;d=0}if(d>0){s+=o.subarray(0,d).toString("utf8");let a;for(;(a=s.indexOf(`
|
|
7
7
|
`))>=0;){let g=s.slice(0,a);s=s.slice(a+1);let A=O(g);if(A&&t(A))return A}}else await new Promise(a=>setTimeout(a,30))}return null}finally{i.closeSync(n)}}export{O as a,y as b,Se as c,M as d,we as e,ve as f,Ae as g,xe as h,k as i,L as j,z as k,Z as l,Pe as m,b as n,J as o,H as p,se as q,E as r,oe as s,l as t,$e as u,_e as v,Be as w,Ue as x};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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 g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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 Ht,c as Kt}from"./chunk-
|
|
4
|
+
import{b as Ht,c as Kt}from"./chunk-SLTEYNAE.js";import{a as Jt,b as qt}from"./chunk-PETP6LVI.js";import{a as ce}from"./chunk-BRRWRBW7.js";import{a as ne,b as ye,c as Bt,d as Ct,e as Dt,f as Lt,g as Wt}from"./chunk-7FYOZQBM.js";import{a as he,b as Fe}from"./chunk-CZ2FOZVC.js";import{j as jt}from"./chunk-PUH6RQBJ.js";import{a as Z,b as D,c as C,d as Ie,e as oe,f as G,g as me,h as ge,i as At,j as Pt,k as Me,l as _t}from"./chunk-4UMODU6C.js";import{C as Et,E as Ot,G as ue,H as Rt,N as We,a as Se,b as pt,c as ke,d as ft,e as gt,f as yt,g as ht,h as bt,i as wt,j as $t,k as xt,l as ve,m as Be,n as Ce,o as De,p as St,q as kt,r as fe,s as vt,t as Ne,u as Le,v as Nt,w as It,x as Mt,y as Ft,z as Tt}from"./chunk-I37LRPZ3.js";import{a as X}from"./chunk-KXAE64HF.js";import{e as it,j as at,r as lt,t as ct,v as dt,w as ut,x as mt,y as le}from"./chunk-MKHW3JNL.js";import{a as ot}from"./chunk-PKY76S57.js";import{b as st,c as y}from"./chunk-YWTBN7SD.js";import{c as nt,d as je,f as rt}from"./chunk-JPRHJMUJ.js";import{a as de}from"./chunk-LWLHVF6Y.js";function Je(e){return`(async () => {
|
|
5
5
|
const bridge = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.hotRemount
|
|
6
6
|
if (!bridge || typeof bridge.reloadExternalApp !== 'function') return false
|
|
7
7
|
await bridge.reloadExternalApp({ resetStorage: ${e?"true":"false"} })
|
|
@@ -112,7 +112,7 @@ import{b as Ht,c as Kt}from"./chunk-UFVAAWGZ.js";import{a as Jt,b as qt}from"./c
|
|
|
112
112
|
`),y(0))}let o=["do","get","debug","wait"].map(s=>je(s,S)).filter(s=>s!=null).join(`
|
|
113
113
|
|
|
114
114
|
`);console.log(`${o}
|
|
115
|
-
`),y(0)}let T=u.wsPort,x=u.simId,P=u.simIdSource,O=u.commandTimeoutMs;if(b==="get"&&m==="diagnosis"){let S=l.indexOf("diagnosis"),o=S>=0?[...l.slice(0,S),...l.slice(S+1)]:l,{runDiagnose:s}=await import("./diagnose-
|
|
115
|
+
`),y(0)}let T=u.wsPort,x=u.simId,P=u.simIdSource,O=u.commandTimeoutMs;if(b==="get"&&m==="diagnosis"){let S=l.indexOf("diagnosis"),o=S>=0?[...l.slice(0,S),...l.slice(S+1)]:l,{runDiagnose:s}=await import("./diagnose-JFKFKR3S.js"),n=await s(["recent",...o],t);process.exitCode=n;return}if(b==="do"&&m==="scan"){let{runCamera:S}=await import("./camera-RUL426MQ.js");process.exitCode=await S(l,{port:t.port});return}if(m==="list"&&l.some(S=>S==="--drivers"||S==="-D")){let{buildDriverListRows:S}=await import("./drivers-BXEXWRVJ.js"),o=S();console.log(` available drivers (${o.length}):
|
|
116
116
|
`);let s=Math.max(...o.map(i=>i.id.length),6),n=Math.max(...o.map(i=>i.kind.length),4);for(let i of o){let d=i.available?"\u2713":"\u2717",p=i.id.padEnd(s),f=i.kind.padEnd(n);console.log(` ${d} ${p} ${f} ${i.description}`),i.available&&i.detail?console.log(` ${i.detail}`):!i.available&&i.reason&&console.log(` unavailable: ${i.reason}`)}return}let c=dt(u),j=x||"default",A=new Set(["errors","warnings","requests","js","reload","globals","perf","storage-clear","list","wait","sleep"]),B=200;function H(S){let o=S.replace(/\s+/g," ").trim();if(!o)return"";if(/^<(!doctype html|html|\?xml)|<body[\s>]/i.test(o)){let n=/<title[^>]*>([^<]+)<\/title>/i.exec(S)?.[1]?.trim(),i=/<body[^>]*>([\s\S]*?)<\//i.exec(S)?.[1]?.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,80),d=n||i||"html error page";return`<html ${S.length}B> "${d}" (body elided \u2014 add --json for the full payload)`}return o.length<=B?o:`${o.slice(0,B)}\u2026 (+${o.length-B} more bytes)`}function W(S){let o=S.displayUrl||S.url;return S.status!=null?`${S.method} ${o} -> ${S.status}${S.statusText?` ${S.statusText}`:""}`:S.error?`${S.method} ${o} -> ${S.error}`:`${S.method} ${o}`}async function F(S){let o=de()?400:200;try{let{settled:s,elapsed:n}=await ne({bridge:S,maxMs:o,pollMs:32,stablePolls:2});s||process.stderr.write(` \u26A0 auto-wait timed out after ${n??o}ms \u2014 next command may see mid-animation state. use \`rnx do settle\` for a longer wait.
|
|
117
117
|
`)}catch{}}function _(S,o){if(o.result?.reason==="offscreen"){let{x:s,y:n,screen:i}=o.result;console.error(` tap failed: ${S} resolved to (${Math.round(s)},${Math.round(n)}), outside the ${i?.width}x${i?.height} screen`),console.error(" the node exists but is scrolled out of view \u2014 scroll it on-screen first (rnx do scroll / swipe), then tap.");return}console.error(` tap failed: ${S} stayed visible but did not receive a hittable press after ${o.attempts} attempt${o.attempts===1?"":"s"}`),o.result&&console.error(` last result: ${JSON.stringify(o.result)}`)}async function V(){try{return await c.send({type:"evaluate",code:`(() => ({
|
|
118
118
|
console: ${Ne},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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.372 | (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{AsyncLocalStorage as n}from"node:async_hooks";var t=class extends Error{code;constructor(e){super(`rnx exited with code ${e}`),this.name="RnxExit",this.code=e}},s=new n;function i(r){if(r instanceof t)throw r}function c(r){throw new t(r)}export{t as a,i as b,c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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{n}from"./chunk-
|
|
4
|
+
import{n}from"./chunk-MKHW3JNL.js";import{M as t,j as r}from"./chunk-QA2PTSOC.js";function l(){let e=t(),i=r()?n():null;return i?.source==="dev-bridge"?{primary:`engine dev source (:${i.bridgePort})`,installedRuntime:e?`installed runtime v${e}`:null,isDevBridge:!0}:{primary:e?`runtime v${e}`:"runtime not installed",installedRuntime:null,isDevBridge:!1}}export{l as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.372 | (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{
|
|
4
|
+
import{c as r,d as g,e as f,f as v}from"./chunk-UA5WQCBU.js";import"./chunk-RXKZJAGY.js";import"./chunk-2OA2WE7G.js";import"./chunk-QA2PTSOC.js";import"./chunk-MSM2E74F.js";import"./chunk-WR7LRCYW.js";var $={"browser-cache":"browser caches","camera-fixture":"staged camera fixture videos",recording:"recordings and captured frames","runtime-archive":"downloaded runtime archives","runtime-version":"inactive runtime versions"};function y(s){let i=new Map;for(let o of s){let n=i.get(o.kind)??{bytes:0,count:0};n.bytes+=o.bytes,n.count++,i.set(o.kind,n)}return[...i].sort((o,n)=>n[1].bytes-o[1].bytes).map(([o,n])=>` ${$[o]}: ${r(n.bytes)} (${n.count} ${n.count===1?"item":"items"})`)}function h(){console.log(`
|
|
5
5
|
rnx cleanup \u2014 inspect and reclaim local rnx disk usage
|
|
6
6
|
|
|
7
7
|
usage:
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! rnx v0.1.372 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
+
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
+
import{a}from"./chunk-P6K6XFWE.js";import"./chunk-MSM2E74F.js";import"./chunk-WR7LRCYW.js";export{a as getCliVersion};
|