rnxsim 0.1.343 → 0.1.345
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -31
- package/cli/app-fonts.ts +8 -28
- package/cli/app-project.ts +12 -184
- package/cli/app-splash.ts +3 -17
- package/cli/bin.ts +15 -28
- package/cli/commands/control.ts +20 -30
- package/cli/commands/daemon.ts +19 -44
- package/cli/commands/flow.ts +0 -27
- package/cli/commands/install-desktop.ts +2 -16
- package/cli/commands/login.ts +3 -43
- package/cli/commands/logout.ts +0 -7
- package/cli/commands/serve.ts +2 -32
- package/cli/commands/setup.ts +20 -194
- package/cli/commands/telemetry.ts +7 -5
- package/cli/commands/upload.ts +1 -48
- package/cli/commands/welcome.ts +64 -0
- package/cli/outbound-endpoints.ts +586 -0
- package/cli/privacy.ts +53 -0
- package/cli/runtime-notes.ts +2 -2
- package/cli/telemetry.ts +46 -149
- package/dist-cli/bin.js +6 -6
- package/dist-cli/chunks/{agent-RFD32ACU.js → agent-52G55XTO.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-2YLW2HQK.js → agent-wrapper-BOZM43ON.js} +2 -2
- package/dist-cli/chunks/{app-fonts-6OATDF3Y.js → app-fonts-A2L6V5EZ.js} +2 -2
- package/dist-cli/chunks/{assert-PSQICFOY.js → assert-CJKIP4LN.js} +2 -2
- package/dist-cli/chunks/{auth-XWLFKZT7.js → auth-VHHN3TOB.js} +2 -2
- package/dist-cli/chunks/{beta-I6WTVM6C.js → beta-EBDIGV3E.js} +2 -2
- package/dist-cli/chunks/{camera-45HKTLWG.js → camera-5F4KKCQ3.js} +2 -2
- package/dist-cli/chunks/chunk-3DBTS4MC.js +15 -0
- package/dist-cli/chunks/chunk-3N7M5HMJ.js +6 -0
- package/dist-cli/chunks/{chunk-RWYA2USN.js → chunk-4BIPA7MD.js} +1 -1
- package/dist-cli/chunks/chunk-4OKV7T5D.js +4 -0
- package/dist-cli/chunks/{chunk-T4T6DDKM.js → chunk-4ZILDTZX.js} +2 -2
- package/dist-cli/chunks/{chunk-R7X74I3I.js → chunk-5GXRRUOA.js} +26 -26
- package/dist-cli/chunks/chunk-63ASUHOV.js +4 -0
- package/dist-cli/chunks/{chunk-DASP2EKF.js → chunk-7GO2DSYQ.js} +1 -1
- package/dist-cli/chunks/{chunk-HJXIBZ35.js → chunk-7LGINKM6.js} +2 -2
- package/dist-cli/chunks/{chunk-2IPMH24A.js → chunk-7UIIAHVU.js} +2 -2
- package/dist-cli/chunks/{chunk-ES5BHPTS.js → chunk-7V4KPZ7O.js} +2 -2
- package/dist-cli/chunks/{chunk-FCHRGEHA.js → chunk-7YMQRA6L.js} +2 -2
- package/dist-cli/chunks/{chunk-DC7TS573.js → chunk-A2Q76LJV.js} +2 -2
- package/dist-cli/chunks/{chunk-SAUCA7SN.js → chunk-BCQV63BW.js} +45 -45
- package/dist-cli/chunks/{chunk-3FYJ7U3C.js → chunk-BFTDL2GX.js} +17 -17
- package/dist-cli/chunks/chunk-BHKSCNDC.js +4 -0
- package/dist-cli/chunks/{chunk-QPTJNLPT.js → chunk-DGTV3KOW.js} +1 -1
- package/dist-cli/chunks/chunk-DHM3JDCK.js +4 -0
- package/dist-cli/chunks/{chunk-TQRVLK64.js → chunk-DPP2M4AJ.js} +1 -1
- package/dist-cli/chunks/chunk-E2RGSCHT.js +4 -0
- package/dist-cli/chunks/{chunk-TQ5OPG33.js → chunk-EPLVIDPC.js} +1 -1
- package/dist-cli/chunks/{chunk-P3IDK7FR.js → chunk-GKGXULJK.js} +2 -2
- package/dist-cli/chunks/{chunk-34KDMQ6U.js → chunk-HK7YKH6N.js} +2 -2
- package/dist-cli/chunks/{chunk-BJUNXCPO.js → chunk-HXE344V3.js} +1 -1
- package/dist-cli/chunks/{chunk-HJHFC5ZZ.js → chunk-JC33TOAF.js} +1 -1
- package/dist-cli/chunks/{chunk-G3B2RZ47.js → chunk-KA4PJNTE.js} +2 -2
- package/dist-cli/chunks/{chunk-VC4TDPJQ.js → chunk-KH777UAO.js} +3 -3
- package/dist-cli/chunks/{chunk-4PFMDBLB.js → chunk-KRZPFXVN.js} +1 -1
- package/dist-cli/chunks/{chunk-6SLM6URN.js → chunk-KZFJNDH3.js} +1 -1
- package/dist-cli/chunks/{chunk-KLMWLQAO.js → chunk-LAQGSSTT.js} +1 -1
- package/dist-cli/chunks/chunk-LRM2XCEQ.js +11 -0
- package/dist-cli/chunks/{chunk-YKKVDKLE.js → chunk-NUPRHZQW.js} +2 -2
- package/dist-cli/chunks/{chunk-AKV2DGKM.js → chunk-OPHT4DUO.js} +1 -1
- package/dist-cli/chunks/{chunk-KON6XG4Y.js → chunk-P2CGGMU2.js} +2 -2
- package/dist-cli/chunks/{chunk-5FB4EA33.js → chunk-PLB6UVVX.js} +2 -2
- package/dist-cli/chunks/{chunk-FRRHCLG2.js → chunk-PLUWN2V5.js} +1 -1
- package/dist-cli/chunks/{chunk-WDA4QR6U.js → chunk-QNBBKRCA.js} +2 -2
- package/dist-cli/chunks/{chunk-G7S6T5OX.js → chunk-QNRWPAOA.js} +2 -2
- package/dist-cli/chunks/{chunk-2EVBZ37G.js → chunk-R7ZNRGQN.js} +1 -1
- package/dist-cli/chunks/{chunk-TMJGPUWJ.js → chunk-RB4VFUNM.js} +3 -3
- package/dist-cli/chunks/chunk-RT3DXTDP.js +25 -0
- package/dist-cli/chunks/{chunk-OYLIWHDB.js → chunk-RTDHX6CW.js} +2 -2
- package/dist-cli/chunks/{chunk-YLFDA4WW.js → chunk-T7SBFG5I.js} +2 -2
- package/dist-cli/chunks/{chunk-W7EXE22C.js → chunk-TEU5NGUA.js} +2 -2
- package/dist-cli/chunks/chunk-TMRD5MHL.js +99 -0
- package/dist-cli/chunks/{chunk-SU7RE3PV.js → chunk-TOF5TA5X.js} +11 -11
- package/dist-cli/chunks/{chunk-6IVEGYWV.js → chunk-U5YHXQHH.js} +2 -2
- package/dist-cli/chunks/{chunk-BA3HRFJ5.js → chunk-UVOEHIGP.js} +1 -1
- package/dist-cli/chunks/{chunk-SW4DV2TY.js → chunk-VLBN3KRC.js} +1 -1
- package/dist-cli/chunks/{chunk-7WKV6EKX.js → chunk-WPPGU5IK.js} +2 -2
- package/dist-cli/chunks/{chunk-JOE3J46E.js → chunk-WU72KL6Z.js} +2 -2
- package/dist-cli/chunks/chunk-XJBFJGNT.js +4 -0
- package/dist-cli/chunks/{chunk-3CMKNWRL.js → chunk-XXZLK4BY.js} +1 -1
- package/dist-cli/chunks/{chunk-BKMPV6N4.js → chunk-YVSUFVVB.js} +1 -1
- package/dist-cli/chunks/{chunk-RO3WVQPB.js → chunk-ZMTZ5G5H.js} +2 -2
- package/dist-cli/chunks/{cleanup-OU4VKFC3.js → cleanup-MAVZJXVW.js} +2 -2
- package/dist-cli/chunks/cli-version-2B4KRNML.js +4 -0
- package/dist-cli/chunks/{compat-GAEKP67T.js → compat-7AURLGCS.js} +2 -2
- package/dist-cli/chunks/config-TN3Y4J5N.js +13 -0
- package/dist-cli/chunks/{control-VQJURMFD.js → control-EV2ELU5R.js} +2 -2
- package/dist-cli/chunks/daemon-KKDG5MYR.js +4 -0
- package/dist-cli/chunks/{debug-F5N2LO4T.js → debug-JICITUB6.js} +3 -3
- package/dist-cli/chunks/{desktop-I4ILT4BS.js → desktop-4F5HGLLX.js} +3 -3
- package/dist-cli/chunks/{detox-2HMPYSP4.js → detox-ZC7NHLJI.js} +2 -2
- package/dist-cli/chunks/{device-5LWLOB5R.js → device-V57GHRXX.js} +2 -2
- package/dist-cli/chunks/{diagnose-5S4IQPAP.js → diagnose-FF4IWYXC.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-CJSZVJQX.js → disk-cleanup-T277L6ZO.js} +2 -2
- package/dist-cli/chunks/drivers-LCX7S76X.js +4 -0
- package/dist-cli/chunks/{film-HCPU2TDB.js → film-G7ZAPWB7.js} +3 -3
- package/dist-cli/chunks/flow-ONZGGFGD.js +4 -0
- package/dist-cli/chunks/help-DROVDXJM.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-YYUEZQPR.js → hidden-runtime-alias-VSJNNSNI.js} +2 -2
- package/dist-cli/chunks/{home-paths-3FXISM5I.js → home-paths-75HP3HKA.js} +2 -2
- package/dist-cli/chunks/inspect-MDA7ESGQ.js +4 -0
- package/dist-cli/chunks/install-desktop-EIVZHIFA.js +4 -0
- package/dist-cli/chunks/login-ZSIHGHUK.js +26 -0
- package/dist-cli/chunks/logout-Q4DXMI2C.js +4 -0
- package/dist-cli/chunks/{maestro-F5KK4RC4.js → maestro-LE5LCRBL.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-6SUU3Y5I.js → maestro-generate-D3ZIJCRL.js} +3 -3
- package/dist-cli/chunks/{mode-CSWGOJLI.js → mode-BWX6MDPJ.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-Y6VJ4SVV.js → optional-demo-registry-6CVASL3S.js} +2 -2
- package/dist-cli/chunks/{perf-NRWWAJL4.js → perf-NXQZISN6.js} +2 -2
- package/dist-cli/chunks/{permissions-OD62A3DJ.js → permissions-5PD67RRO.js} +2 -2
- package/dist-cli/chunks/privacy-H5KNRNIZ.js +4 -0
- package/dist-cli/chunks/{record-JZT2GM3G.js → record-YJF4KXMR.js} +3 -3
- package/dist-cli/chunks/{report-issue-ZWSNHOPB.js → report-issue-XOL5FQBG.js} +2 -2
- package/dist-cli/chunks/reset-5LZN5P5B.js +4 -0
- package/dist-cli/chunks/runtime-U36VWBH3.js +4 -0
- package/dist-cli/chunks/{screenshot-command-ZGJR7ICY.js → screenshot-command-VRPJXWFS.js} +3 -3
- package/dist-cli/chunks/{screenshot-layers-5AQKOJZK.js → screenshot-layers-QP4WA2F5.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-CPTWK5Y3.js → screenshots-capture-O2IBAVSP.js} +2 -2
- package/dist-cli/chunks/serve-WC6RZNJL.js +118 -0
- package/dist-cli/chunks/setup-A6BIG3KL.js +30 -0
- package/dist-cli/chunks/{skills-NVWRBMEO.js → skills-A7YC6RL5.js} +2 -2
- package/dist-cli/chunks/{state-QGLTKN6K.js → state-IJI5YROJ.js} +2 -2
- package/dist-cli/chunks/{storage-OZMEZ4AV.js → storage-Z2DBO2PQ.js} +4 -4
- package/dist-cli/chunks/store-BYTCKNIC.js +4 -0
- package/dist-cli/chunks/telemetry-JLHFMD7N.js +4 -0
- package/dist-cli/chunks/{timeline-EXLDREY3.js → timeline-N7V2M6QA.js} +2 -2
- package/dist-cli/chunks/{upgrade-4VWXQO6I.js → upgrade-P2NH3BOR.js} +2 -2
- package/dist-cli/chunks/upload-Z2WX5DCD.js +4 -0
- package/dist-cli/chunks/{version-WZM6XCD2.js → version-OUHCSCUS.js} +2 -2
- package/dist-cli/chunks/{web-ZYPEUVWL.js → web-6NRTF3UV.js} +2 -2
- package/dist-cli/chunks/welcome-6RS7PEJW.js +5 -0
- package/dist-cli/chunks/{what-happened-KF2HLWKW.js → what-happened-FUEL3BEF.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +18 -4
- package/dist-lib/home-paths.cjs +145 -11
- package/dist-lib/host/bridge-host.cjs +236 -31
- 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 +71 -4
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +337 -37
- 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 +484 -14
- 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 +25 -2
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +384 -385
- package/dist-lib/vite.cjs +193 -37
- package/package.json +2 -1
- package/scripts/dev-server-scanner.ts +12 -5
- package/skills/rnx-test/SKILL.md +4 -0
- package/src/dev-bundle-resolution.ts +13 -6
- package/src/dev-server-open.ts +197 -0
- package/src/home-paths.ts +168 -15
- package/src/host/bridge-host.ts +2 -2
- package/src/host/replacement-module-handler.ts +68 -2
- package/src/metro-plugin.ts +83 -5
- package/src/native-dev-bundle-url.ts +22 -0
- package/src/vite-plugin-one.ts +42 -28
- package/dist-cli/chunks/chunk-44LRQEU3.js +0 -4
- package/dist-cli/chunks/chunk-4RKTGL63.js +0 -9
- package/dist-cli/chunks/chunk-5SCIDXJD.js +0 -25
- package/dist-cli/chunks/chunk-CUVY4A2A.js +0 -4
- package/dist-cli/chunks/chunk-DPJGB7MP.js +0 -101
- package/dist-cli/chunks/chunk-HD6P3W5R.js +0 -4
- package/dist-cli/chunks/chunk-HFNESSHG.js +0 -15
- package/dist-cli/chunks/chunk-I7HHBFSD.js +0 -4
- package/dist-cli/chunks/chunk-LV2G34IX.js +0 -4
- package/dist-cli/chunks/cli-version-REQOM22G.js +0 -4
- package/dist-cli/chunks/config-QTFXJKD6.js +0 -13
- package/dist-cli/chunks/daemon-ETA375WE.js +0 -4
- package/dist-cli/chunks/drivers-R4YB2XAF.js +0 -4
- package/dist-cli/chunks/flow-3VQL6XZT.js +0 -4
- package/dist-cli/chunks/help-2RYCKZ2G.js +0 -4
- package/dist-cli/chunks/inspect-XDSX5D6D.js +0 -4
- package/dist-cli/chunks/install-desktop-OKVRLL35.js +0 -4
- package/dist-cli/chunks/login-4VCBPAY2.js +0 -28
- package/dist-cli/chunks/logout-WSL5JS5R.js +0 -4
- package/dist-cli/chunks/reset-3C52YQCV.js +0 -4
- package/dist-cli/chunks/runtime-4V2RBUOR.js +0 -4
- package/dist-cli/chunks/serve-ERAZQGCJ.js +0 -118
- package/dist-cli/chunks/setup-UG6PLYIL.js +0 -32
- package/dist-cli/chunks/store-VPBQKKWA.js +0 -4
- package/dist-cli/chunks/telemetry-FRW7OCYZ.js +0 -4
- package/dist-cli/chunks/upload-C6676NST.js +0 -4
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{randomUUID as R}from"node:crypto";import r from"node:fs";import{homedir as O}from"node:os";import o from"node:path";var j="SOOTSIM_HOME",N="active",E="daemon.json",_="dev-bridges",w="config.json",b=3e4;function s(){let e=process.env[j];return e&&e.length>0?o.resolve(e):o.join(O(),".sootsim")}function F(){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 r.realpathSync(t).includes(`${o.sep}packages${o.sep}sootsim${o.sep}`)}catch{return!1}}function I(){return process.env.SOOTSIM_FORCE_DAEMON_INSTALL==="1"?!1:process.env.IS_TAMAGUI_DEV==="1"}function Y(){return F()||I()}function d(){return o.join(s(),"runtimes")}function B(e){return o.join(d(),e)}function h(){return o.join(d(),N)}function v(){return o.join(s(),"electron")}function q(){return o.join(v(),"userData")}function z(e){return o.join(v(),e)}function $(){return o.join(s(),"profiles")}function Q(){return o.join(s(),"camera-fixtures")}function C(){return o.join(s(),"daemon-app")}function M(){return o.join(C(),"SootSim Daemon.app")}function Z(){return o.join(M(),"Contents","MacOS","sootsim-daemon")}function T(){return o.join(s(),"cache")}function a(){return o.join(s(),E)}function f(){return o.join(s(),_)}function D(e){if(!Number.isInteger(e)||e<=0)throw new Error(`invalid development bridge port: ${e}`);return o.join(f(),`${e}.json`)}function y(){return o.join(s(),w)}function S(){try{let e=r.readFileSync(y(),"utf8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function x(e){m();let t=S(),n={...t,...e};e.settings&&typeof e.settings=="object"&&(n.settings={...t.settings&&typeof t.settings=="object"?t.settings:{},...e.settings});let c=`${y()}.tmp`;return r.writeFileSync(c,`${JSON.stringify(n,null,2)}
|
|
5
|
-
`,"utf8"),r.renameSync(c,y()),n}function ee(){let e=S().settings,t=e?.productAnalytics,n=e?.crashReports;return{productAnalytics:typeof t=="boolean"?t:!0,crashReports:typeof n=="boolean"?n:!0,configured:typeof t=="boolean"&&typeof n=="boolean"}}function te(e){x({settings:{productAnalytics:e.productAnalytics,crashReports:e.crashReports}})}function re(){let e=S().anonymousId;if(typeof e=="string"&&e.trim())return e;let t=`anon-cli-${R()}`;return x({anonymousId:t}),t}function l(){return o.join(s(),"runtime-upgraded.json")}function ne(e){m();let t=`${l()}.tmp`;r.writeFileSync(t,`${JSON.stringify(e)}
|
|
6
|
-
`,"utf8"),r.renameSync(t,l())}function oe(){try{let e=r.readFileSync(l(),"utf8");r.unlinkSync(l());let t=JSON.parse(e);return typeof t?.to!="string"||!t.to?null:{from:typeof t.from=="string"?t.from:null,to:t.to,at:typeof t.at=="number"?t.at:0}}catch{return null}}function m(){r.mkdirSync(s(),{recursive:!0}),r.mkdirSync(d(),{recursive:!0}),r.mkdirSync(v(),{recursive:!0}),r.mkdirSync($(),{recursive:!0}),r.mkdirSync(T(),{recursive:!0})}function U(){try{let e=r.readFileSync(h(),"utf8").trim();return e.length>0?e:null}catch{return null}}function ie(e){r.mkdirSync(d(),{recursive:!0}),r.writeFileSync(h(),`${e}
|
|
7
|
-
`,"utf8")}function se(){let e=U();if(!e)return null;let t=B(e);try{if(r.statSync(t).isDirectory())return t}catch{}return null}var p=16*1024;function k(){try{let e=r.openSync(a(),"r");try{let t=Buffer.alloc(p),n=r.readSync(e,t,0,p,0),c=t.subarray(0,n).toString("utf8"),i=JSON.parse(c);return i&&i.schema===1&&typeof i.pid=="number"&&typeof i.bridgePort=="number"&&typeof i.runtimePort=="number"&&typeof i.startedAt=="number"&&typeof i.heartbeatAt=="number"&&(i.servedRuntimes===void 0||Array.isArray(i.servedRuntimes)&&i.servedRuntimes.every(u=>typeof u=="string"))?i:null}finally{r.closeSync(e)}}catch{return null}}function A(e){try{let t=JSON.parse(e);return t&&t.schema===1&&t.source==="vite-dev"&&typeof t.pid=="number"&&typeof t.bridgePort=="number"&&typeof t.runtimePort=="number"&&typeof t.cwd=="string"&&typeof t.startedAt=="number"&&typeof t.heartbeatAt=="number"&&(t.shellPort===void 0||typeof t.shellPort=="number")&&(t.servedRuntimes===void 0||Array.isArray(t.servedRuntimes)&&t.servedRuntimes.every(n=>typeof n=="string"))?t:null}catch{return null}}function J(){let e;try{e=r.readdirSync(f(),{withFileTypes:!0})}catch{return[]}let t=[];for(let n of e)if(!(!n.isFile()||!/^\d+\.json$/.test(n.name)))try{let c=o.join(f(),n.name),i=r.openSync(c,"r");try{let u=Buffer.alloc(p),P=r.readSync(i,u,0,p,0),g=A(u.subarray(0,P).toString("utf8"));g&&n.name===`${g.bridgePort}.json`&&t.push(g)}finally{r.closeSync(i)}}catch{}return t.sort((n,c)=>n.bridgePort-c.bridgePort)}function L(e,t=Date.now()){if(!e||t-e.heartbeatAt>b)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function V(e,t=Date.now()){if(!e||t-e.heartbeatAt>b)return!1;try{return process.kill(e.pid,0),!0}catch{return!1}}function ce(){let e=new Set,t=k();if(L(t)){t.activeRuntime&&e.add(t.activeRuntime);for(let n of t.servedRuntimes??[])e.add(n)}for(let n of J())if(V(n))for(let c of n.servedRuntimes??[])e.add(c);return[...e].sort()}function H(e){m();let t=`${a()}.tmp`;r.writeFileSync(t,`${JSON.stringify(e,null,2)}
|
|
8
|
-
`,"utf8"),r.renameSync(t,a())}function ue(e){r.mkdirSync(f(),{recursive:!0});let t=D(e.bridgePort),n=`${t}.${e.pid}.tmp`;r.writeFileSync(n,`${JSON.stringify(e,null,2)}
|
|
9
|
-
`,"utf8"),r.renameSync(n,t)}function ae(e){m();let t=k();return t&&L(t)&&t.pid!==e.pid?!1:(H(e),!0)}function fe(){try{r.unlinkSync(a())}catch{}}function le(e){try{let t=D(e.bridgePort),n=A(r.readFileSync(t,"utf8"));if(n?.pid!==e.pid||n.startedAt!==e.startedAt)return;r.unlinkSync(t)}catch{}}export{j as a,N as b,E as c,_ as d,w as e,b as f,s as g,F as h,I as i,Y as j,d as k,B as l,h as m,v as n,q as o,z as p,$ as q,Q as r,C as s,M as t,Z as u,T as v,a as w,f as x,D as y,y as z,S as A,x as B,ee as C,te as D,re as E,l as F,ne as G,oe as H,m as I,U as J,ie as K,se as L,k as M,J as N,L as O,V as P,ce as Q,H as R,ue as S,ae as T,fe as U,le as V};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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 k}from"./chunk-TQ5OPG33.js";import{a as $}from"./chunk-HD6P3W5R.js";import{spawn as v,spawnSync as m}from"child_process";import{chmodSync as S,copyFileSync as T,createWriteStream as E,existsSync as w,mkdirSync as y,rmSync as g,statSync as P,unlinkSync as D}from"fs";import{tmpdir as M}from"os";import{dirname as A,join as f,resolve as b}from"path";var h="https://contrast.dev/api/electron-release";function O(){let r=process.arch;if(process.platform==="darwin"){let t=r==="arm64"?"mac-arm64":"mac-x64",e=`sootsim-latest-${t}.dmg`;return{platform:t,filename:e,url:`${h}/${e}`,install:L}}if(process.platform==="linux"){let t=r==="arm64"?"linux-arm64":"linux-x64",e=`sootsim-latest-${t}.AppImage`;return{platform:t,filename:e,url:`${h}/${e}`,install:C}}if(process.platform==="win32"){let t="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:t,url:`${h}/${t}`,install:B}}return null}async function I({url:r,dest:t,onProgress:e}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`${s.status} ${s.statusText} (${r})`);let o=s.headers.get("content-length"),a=o?Number(o):null;if(!s.body)throw new Error(`empty response body (${r})`);y(A(t),{recursive:!0});let i=E(t),d=s.body.getReader(),c=0;try{for(;;){let{done:l,value:p}=await d.read();if(l)break;i.write(Buffer.from(p)),c+=p.byteLength,e?.(c,a)}}finally{await new Promise((l,p)=>{i.end(n=>n?p(n):l())})}}function _(r,t){let e=(r/1048576).toFixed(1);if(!t)return` ${e} MB`;let s=Math.min(100,Math.round(r/t*100)),o=(t/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${e} / ${o} MB`}async function L(r){let t=m("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(t.status!==0)throw new Error(`hdiutil attach failed: ${t.stderr||t.stdout}`.trim());let e=t.stdout.trim().split(`
|
|
5
|
-
`),o=e[e.length-1].split(" ").pop()?.trim();if(!o||!w(o))throw new Error(`could not determine dmg mount point (output: ${t.stdout})`);let a=f(o,"sootsim.app");if(!w(a))throw m("hdiutil",["detach","-force",o]),new Error(`sootsim.app not found inside ${o}`);let i="/Applications",d=b(process.env.HOME||"","Applications"),c=i;try{let u=f(i,`.sootsim-write-probe-${process.pid}`);m("touch",[u]),w(u)?g(u,{force:!0}):c=d}catch{c=d}c===d&&y(c,{recursive:!0});let l=f(c,"sootsim.app");w(l)&&g(l,{recursive:!0,force:!0});let p=m("cp",["-R",a,l]),n=m("hdiutil",["detach","-force",o]);if(p.status!==0)throw new Error(`copy to ${l} failed: ${p.stderr?.toString()||""}`.trim());return n.status!==0&&console.warn(` warning: failed to unmount ${o} (${n.stderr?.toString().trim()||"unknown error"})`),m("xattr",["-dr","com.apple.quarantine",l]),l}async function C(r){let t=b(process.env.HOME||"","Applications");y(t,{recursive:!0});let e=f(t,"sootsim.AppImage");return w(e)&&g(e,{force:!0}),T(r,e),D(r),S(e,493),e}async function B(r){return await new Promise((t,e)=>{let s=v("cmd",["/c","start",'""',"/wait",r],{stdio:"inherit"});s.once("error",e),s.once("exit",o=>{o===0?t():e(new Error(`installer exited with code ${o}`))})}),r}async function q(r){(r.includes("--help")||r.includes("-h"))&&(console.log(`
|
|
6
|
-
rnx desktop install \u2014 download and install the optional desktop GUI
|
|
7
|
-
|
|
8
|
-
the CLI + daemon are the canonical rnx surface; the GUI is optional.
|
|
9
|
-
if you just want to drive a running metro/expo dev server from the
|
|
10
|
-
terminal, you don't need this.
|
|
11
|
-
|
|
12
|
-
usage:
|
|
13
|
-
rnx desktop install [options]
|
|
14
|
-
|
|
15
|
-
options:
|
|
16
|
-
-y, --yes skip confirmation and install immediately
|
|
17
|
-
--force reinstall even if the companion is already present
|
|
18
|
-
|
|
19
|
-
examples:
|
|
20
|
-
rnx desktop install
|
|
21
|
-
rnx desktop install --yes
|
|
22
|
-
`),process.exit(0));let t=r.includes("--yes")||r.includes("-y")||process.env.SOOTSIM_NO_PROMPT==="1"||process.env.CI==="1"||!process.stdin.isTTY,e=r.includes("--force"),s=k();if(s&&!e){console.log(` rnx desktop already installed at: ${s.path}`),console.log(" pass --force to reinstall.");return}let o=O();if(o||(console.error(` no desktop build available for ${process.platform}/${process.arch}.`),console.error(" supported: darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64"),process.exit(1)),console.log(` platform: ${o.platform}`),console.log(` download: ${o.url}`),console.log(),!t){if(!await $("download and install now?",!0)){console.log(" cancelled.");return}console.log()}let a=f(M(),`sootsim-install-${Date.now()}`),i=f(a,o.filename),d=0;process.stdout.write(` downloading ${o.filename}...
|
|
23
|
-
`);try{await I({url:o.url,dest:i,onProgress:(n,u)=>{let x=Date.now();x-d<100&&n<(u??1/0)||(d=x,process.stdout.isTTY&&process.stdout.write(`\r\x1B[2K${_(n,u)}`))}})}catch(n){g(a,{recursive:!0,force:!0});let u=n instanceof Error?n.message:String(n);console.error(`
|
|
24
|
-
download failed: ${u}`),console.error(` the ${o.platform} desktop build may not be published yet, or your`),console.error(" network blocked the request. check your connection and try again later;"),console.error(" the CLI + daemon work without the desktop app (run: rnx --help)."),process.exit(1)}process.stdout.isTTY&&process.stdout.write(`
|
|
25
|
-
`);let c=P(i).size;console.log(` downloaded ${(c/(1024*1024)).toFixed(1)} MB`),console.log(),console.log(" installing...");let{trackCliEvent:l,flushCliTelemetry:p}=await import("./telemetry-FRW7OCYZ.js");try{let n=await o.install(i);l({event:"cli_install_desktop_succeeded",properties:{platform:o.platform,size_bytes:c}}),console.log(` installed: ${n}`)}catch(n){l({event:"cli_install_desktop_failed",properties:{platform:o.platform,error:n instanceof Error?n.message:String(n)}}),await p(),console.error(` install failed: ${n instanceof Error?n.message:String(n)}`),console.error(` keeping download at ${i} for manual install.`),process.exit(1)}finally{g(a,{recursive:!0,force:!0})}console.log(),console.log(" next steps:"),console.log(" rnx desktop launch the desktop app"),console.log(" rnx open <target> open a demo or bundle in it")}export{q as a};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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 k}from"./chunk-LV2G34IX.js";import{createHash as L}from"node:crypto";import D from"node:fs";import{createRequire as E}from"node:module";import x from"node:path";var w=/(^|\/)expo-splash-screen$/,A=/(^|\/)react-native-bootsplash$/;function R(n,e){let r=e.replace(/\/+$/,""),t=n.replace(/^\.\//,"").replace(/^\/+/,"");if(t)return`${r}/assets/${t}`}function d(n,e,r){return r?r(n):R(n,e)}function y(n){if(n==="cover")return"cover";if(n==="contain"||n==="native")return"contain"}function c(n){return typeof n=="string"&&n.length>0?n:void 0}function S(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}function O(n,e,r){if(!n||typeof n!="object")return null;let t=n,o={source:"expo-splash-screen",backgroundColor:c(t.backgroundColor)??"#ffffff"},i=c(t.image);i&&(o.imageUrl=d(i,e,r));let s=S(t.imageWidth);s!=null&&(o.imageWidthPx=s);let l=y(t.resizeMode);l&&(o.resizeMode=l);let a=t.dark;if(a&&typeof a=="object"){let u=a,g=c(u.backgroundColor),f=c(u.image);(g||f)&&(o.dark={},g&&(o.dark.backgroundColor=g),f&&(o.dark.imageUrl=d(f,e,r)))}return o}function v(n,e,r,t){let p=n[e],o=p&&typeof p=="object"?p.splash:void 0,i=n.splash,s=o&&typeof o=="object"?o:i;if(!s||typeof s!="object")return null;let a={source:"expo-legacy",backgroundColor:c(s.backgroundColor)??"#ffffff",imageWidthPx:S(s.imageWidth)??200,resizeMode:y(s.resizeMode)??"contain"},u=c(s.image);u&&(a.imageUrl=d(u,r,t));let g=s.dark;if(g&&typeof g=="object"){let f=g,m=c(f.backgroundColor),h=c(f.image);(m||h)&&(a.dark={},m&&(a.dark.backgroundColor=m),h&&(a.dark.imageUrl=d(h,r,t)))}return a}function j(n,e,r){if(!n||typeof n!="object")return null;let t=n,p=c(t.logo);if(!p)return null;let o={source:"react-native-bootsplash",backgroundColor:c(t.background)??"#fff",imageUrl:d(p,e,r),imageWidthPx:S(t.logoWidth)??100,resizeMode:"contain"},i=c(t.darkBackground),s=c(t.darkLogo);return(i||s)&&(o.dark={},i&&(o.dark.backgroundColor=i),s&&(o.dark.imageUrl=d(s,e,r))),o}function b(n,e,r,t={}){if(!n||typeof n!="object")return null;let p=n,o=p.plugins,i=null,s=null;if(Array.isArray(o))for(let l of o){let a=Array.isArray(l)?l[0]:l;if(typeof a!="string")continue;let u=Array.isArray(l)?l[1]??{}:{};!i&&w.test(a)?i=O(u,r,t.resolveAssetUrl):!s&&A.test(a)&&(s=j(u,r,t.resolveAssetUrl))}return s||i||v(p,e,r,t.resolveAssetUrl)}var C=E(import.meta.url);function I(n){try{let e=new URL(n),r=e.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r))return e.origin}catch{}return null}function z(n){try{return D.statSync(x.join(n,"package.json")).isFile()}catch{return!1}}function K(n){let e=I(n.bundleUrl);if(!e)return null;let r=n.repoDir||process.env.CONTRAST_REPO_DIR,t=r?x.resolve(r):process.cwd();if(!r&&!z(t))return null;let o=k(t,{trustStart:n.exactProjectDir})?.appDir??null;if(!o)return null;let i=(n.platform||process.env.CONTRAST_PLATFORM||"ios").toLowerCase(),s=null;try{let a=C.resolve("@expo/config",{paths:[o,t]}),u=C(a);typeof u.getConfig=="function"&&(s=u.getConfig)}catch{}if(!s)return null;let l;try{let a=s(o,{skipSDKVersionRequirement:!0});a?.exp&&typeof a.exp=="object"&&(l=a.exp)}catch{}return!l||typeof l!="object"?null:b(l,i==="android"?"android":"ios",e)}function X(n){return encodeURIComponent(JSON.stringify(n))}function M(n){if(!n)return null;try{let e=JSON.parse(decodeURIComponent(n));if(!e||typeof e!="object")return null;let r=e;return r.source!=="expo-splash-screen"&&r.source!=="expo-legacy"&&r.source!=="react-native-bootsplash"||typeof r.backgroundColor!="string"?null:e}catch{return null}}function F(n){let e=new Set;return n.imageUrl&&e.add(n.imageUrl),n.dark?.imageUrl&&e.add(n.dark.imageUrl),[...e]}function W(n){let e=(n.split("?")[0].split(".").pop()||"").toLowerCase();return e==="png"?"image/png":e==="jpg"||e==="jpeg"?"image/jpeg":e==="webp"?"image/webp":e==="gif"?"image/gif":e==="svg"?"image/svg+xml":"application/octet-stream"}async function Q(n,e){let r=M(n);if(!r)return[];let t=[],p=new Set;for(let o of F(r)){let i=L("sha256").update(o).digest("hex");if(!p.has(i)){p.add(i);try{let s=await fetch(o);if(!s.ok){e?.onError?.(o,new Error(`${s.status} ${s.statusText}`));continue}let l=new Uint8Array(await s.arrayBuffer());t.push({url:o,urlhash:i,contentType:W(o),bytes:l}),e?.onStaged?.({url:o,byteLength:l.byteLength})}catch(s){e?.onError?.(o,s)}}}return t}import{spawn as T}from"child_process";function U(n,e={}){if(!n)throw new Error("openUrl requires a url");let r=e.platform??process.platform;return r==="darwin"?{command:"open",args:e.background===!1?[n]:["-g",n],via:"system"}:r==="win32"?{command:"cmd",args:["/c","start","",n],via:"system"}:{command:"xdg-open",args:[n],via:"system"}}async function N(n,e,r){return new Promise((t,p)=>{let o=T(n,e,{detached:r,stdio:"ignore"});o.once("error",p),o.once("spawn",()=>{r&&o.unref(),t(o.pid)})})}async function P(n,e={}){let r=U(n,e),t=await N(r.command,r.args,e.detached??!0);return{...r,pid:t,attachUrl:n}}async function $(n,e={}){await P(n,e)}export{K as a,X as b,Q as c,$ as d};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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 K,b as V,c as Le}from"./chunk-HJXIBZ35.js";import{c as Ne,d as Ce}from"./chunk-CUVY4A2A.js";import{k as Fe}from"./chunk-SU7RE3PV.js";import{c as _e,d as E}from"./chunk-I7HHBFSD.js";import{a as Ue}from"./chunk-5FB4EA33.js";import{q as Pe,s as $e,u as B}from"./chunk-G3B2RZ47.js";import{a as Ae}from"./chunk-FRRHCLG2.js";import{createHash as vt}from"crypto";import{readFileSync as M}from"fs";import qe from"path";import{gzipSync as ge,gunzipSync as xt}from"zlib";function Oe(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as ct,constants as dt}from"node:zlib";var pt=9;function ze(e){return ct(e,{params:{[dt.BROTLI_PARAM_QUALITY]:pt}})}function ce(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function ft(e){let t=ce(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function mt(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await ft(l),o++,r?.(o,i)}}))}function gt(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function ht(e){return e.replace(/\/+$/,"")}var W=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function De(e){let t=ht(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=ce(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let T=await o.text().catch(()=>"");throw new W(`init failed: ${o.status} ${T.slice(0,200)}`,o.status,"init",T)}let i=await o.json(),l=gt(i,e.bundleBytes,e.filesByHash,e.extras);await mt(l,e.concurrency??8,e.onPutProgress);let f=ce(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:f.signal})}finally{f.cancel()}if(!c.ok){let T=await c.text().catch(()=>"");throw new W(`finalize failed: ${c.status} ${T.slice(0,200)}`,c.status,"finalize",T)}let h=await c.json();return{init:i,finalize:h}}function yt(e){return e!==null&&typeof e=="object"?e:null}function He(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function de(e){let t=yt(e);return t?t.schemaVersion===1&&He(t.t)!==void 0&&He(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function bt(e,t){let r=[];for(let s of e.split(`
|
|
5
|
-
`)){let o=s.trim();if(o)try{let i=JSON.parse(o);t(i)&&r.push(i)}catch{}}return r}function je(e){return bt(e,de)}import{execSync as wt}from"child_process";function fe(e){try{return wt(e,{stdio:["ignore","pipe","ignore"],timeout:3e3,encoding:"utf8"}).trim()||null}catch{return null}}function pe(e){let t=e?.trim();return!t||!/^\d+$/.test(t)?null:Number(t)}function Mt(){let e=fe("git remote get-url origin");if(!e)return null;let t=e.match(/github\.com[/:]([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/i);return t?{owner:t[1],repo:t[2]}:null}function me(){let e=process.env.GITHUB_ACTIONS==="true",t=process.env.CONTRAST_BRANCH?.trim()||null,r=process.env.CONTRAST_SHA?.trim()||null,s=process.env.CONTRAST_PR_TITLE?.trim()||null,o=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim(),[i,l]=o.includes("/")?o.split("/",2):[null,null];if(e){let h=process.env.GITHUB_REF?.match(/^refs\/pull\/(\d+)\//)?.[1];return{owner:i,repo:l,branch:t||process.env.GITHUB_HEAD_REF?.trim()||process.env.GITHUB_REF_NAME?.trim()||null,commitSha:r||process.env.GITHUB_SHA?.trim()||null,githubUsername:process.env.GITHUB_ACTOR?.trim()||null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER)??pe(h),pullRequestTitle:s,githubRunId:process.env.GITHUB_RUN_ID?.trim()||null,source:"ci"}}let f=t??fe("git rev-parse --abbrev-ref HEAD"),c=i?null:Mt();return{owner:i??c?.owner??null,repo:l??c?.repo??null,branch:f==="HEAD"?null:f,commitSha:r??fe("git rev-parse HEAD"),githubUsername:null,pullRequestNumber:pe(process.env.CONTRAST_PR_NUMBER),pullRequestTitle:s,githubRunId:null,source:"cli"}}function Qt(e){if(e.length===0)return{stepCount:null,failedStepIndex:null};let t=e.find(r=>r.status==="failure");return{stepCount:e.length,failedStepIndex:t?t.stepIndex:null}}function Xt(e){return e.auth?e.uploadedShare?!0:e.auth.kind==="github"||process.env.GITHUB_ACTIONS==="true":!1}async function Zt(e){let t=e.auth??K();if(!t)return null;let r=me(),s=e.owner??(t.kind==="github"?t.owner:null)??r.owner,o=e.repo??(t.kind==="github"?t.repo:null)??r.repo;try{let i=await fetch(`${e.origin.replace(/\/$/,"")}/api/sootsim/test-runs`,{method:"POST",headers:{"content-type":"application/json",authorization:V(t)},body:JSON.stringify({kind:e.kind,source:r.source,name:e.name??void 0,prompt:e.prompt??void 0,summary:e.summary??void 0,status:e.status,failureMessage:e.failureMessage??void 0,previewShareId:e.previewShareId??void 0,owner:s??void 0,repo:o??void 0,branch:r.branch??void 0,commitSha:r.commitSha??void 0,githubUsername:r.githubUsername??void 0,pullRequestNumber:r.pullRequestNumber??void 0,githubRunId:r.githubRunId??void 0,stepCount:e.stepCount??void 0,failedStepIndex:e.failedStepIndex??void 0,durationMs:e.durationMs??void 0,flowYamlSizeBytes:e.flowYamlSizeBytes??void 0})});if(!i.ok){let f=await i.text().catch(()=>"");return console.warn(` warn: run registration failed: /api/sootsim/test-runs ${i.status}${f?`: ${f.slice(0,200)}`:""}`),null}let l=await i.json();return l.run?.id?{id:l.run.id,previewUrl:l.run.previewUrl??null,traceUrl:l.run.traceUrl??null}:(console.warn(" warn: run registration returned no id"),null)}catch(i){return console.warn(` warn: run registration failed: ${i instanceof Error?i.message:String(i)}`),null}}function Rt(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}function kt(e){let t=JSON.parse(M(e,"utf8"));if(!Array.isArray(t))throw new Error("snapshot manifest must be an array");let r=new Set;return t.map((s,o)=>{if(s===null||typeof s!="object")throw new Error(`snapshot manifest entry ${o} must be an object`);let i=Reflect.get(s,"id"),l=Reflect.get(s,"label"),f=Reflect.get(s,"path"),c=Reflect.get(s,"t");if(typeof i!="string"||!i||r.has(i))throw new Error(`snapshot manifest entry ${o} has an invalid or duplicate id`);if(typeof f!="string"||!f)throw new Error(`snapshot manifest entry ${o} has no PNG path`);if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new Error(`snapshot manifest entry ${o} has an invalid capture time`);r.add(i);let h=M(f);return{meta:{id:i,label:typeof l=="string"&&l?l:i,kind:"interaction",t:Math.round(c),contentType:"image/png",sizeBytes:h.byteLength},bytes:h}})}var We=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://contrast.dev",Ye=process.env.SOOTSIM_PREVIEW_ORIGIN||Ae.origin,ye="https://contrast.localhost:3000",Et=2e3;async function Bt(e){if(e)return e;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{let t=await fetch(`${ye}/api/preview/upload/init`,{method:"OPTIONS",signal:AbortSignal.timeout(Et)});if(t.ok||t.status===204||t.status===405)return ye}catch{}return We}function C(e){return e.replace(/\/$/,"")}function It(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function At(e){try{let t=new URL(e).hostname.toLowerCase();return t==="contrast.dev"||t.endsWith(".contrast.dev")}catch{return!1}}function Ut(e,t){return t?C(t):process.env.SOOTSIM_PREVIEW_ORIGIN?C(process.env.SOOTSIM_PREVIEW_ORIGIN):It(e)?C(e):At(e)?C(Ye):C(e)}function _t(){console.log(`
|
|
6
|
-
rnx record upload \u2014 publish the current recorded bundle as a /preview/<id> link
|
|
7
|
-
|
|
8
|
-
usage:
|
|
9
|
-
rnx record upload [--origin <url>] [--public-origin <url>] (--events <path> | --video <path>) [--screenshot <path>] [--owner <org> --repo <repo>] [--sim <sim>] [--open] [--assets-only]
|
|
10
|
-
|
|
11
|
-
options:
|
|
12
|
-
--origin <url> upload target (default: auto)
|
|
13
|
-
prefers ${ye} when available, otherwise
|
|
14
|
-
falls back to ${We}
|
|
15
|
-
override with SOOTSIM_UPLOAD_ORIGIN env var
|
|
16
|
-
--public-origin <url>
|
|
17
|
-
public /preview link origin (default: ${Ye}
|
|
18
|
-
for prod uploads, upload origin for localhost/custom origins).
|
|
19
|
-
override with SOOTSIM_PREVIEW_ORIGIN env var
|
|
20
|
-
--events <path> path to a gzipped events .jsonl.gz file to attach
|
|
21
|
-
required unless --video is present; previews must
|
|
22
|
-
have replay or recording playback data
|
|
23
|
-
--screenshot <path>
|
|
24
|
-
path to a PNG thumbnail to attach to the share
|
|
25
|
-
--snapshot-manifest <path>
|
|
26
|
-
JSON manifest of existing interaction PNGs to attach
|
|
27
|
-
--video <path> path to a mp4/gif flow recording. embedded inline
|
|
28
|
-
in the pr sticky comment served at
|
|
29
|
-
/api/preview/flow-video?id=<share-id>
|
|
30
|
-
--video-duration-ms <ms>
|
|
31
|
-
duration hint for attached flow video
|
|
32
|
-
--timeline-events <path>
|
|
33
|
-
extra trace timeline rows, JSONL or JSONL gz
|
|
34
|
-
--trace-frame-stats <path>
|
|
35
|
-
frame stats JSON returned by the recorder bridge
|
|
36
|
-
--failure-bundle <dir>
|
|
37
|
-
per-failure debug bundle dir written by the flow runner
|
|
38
|
-
(error.json, describe.json, a11y.txt, tree.txt,
|
|
39
|
-
console.json, screenshot.png). uploaded with the share
|
|
40
|
-
so failed CI runs are debuggable from the dashboard
|
|
41
|
-
--owner <org> associate a session upload with a linked org repo
|
|
42
|
-
--repo <repo> repo name for --owner; the signed-in user must belong
|
|
43
|
-
to the local/org team that owns the link
|
|
44
|
-
--billing-kind test_run
|
|
45
|
-
meter this upload as a natural-language test run
|
|
46
|
-
--sim <sim> target a specific sim (see: rnx list)
|
|
47
|
-
--open open the resulting /preview/<id> url in the browser
|
|
48
|
-
--assets-only drop API/JSON/HTML records before upload; keep images,
|
|
49
|
-
fonts, css, js, and binary blobs. live-data demos hit
|
|
50
|
-
the real network at replay time instead of serving
|
|
51
|
-
recorded API snapshots
|
|
52
|
-
-h, --help
|
|
53
|
-
|
|
54
|
-
examples:
|
|
55
|
-
rnx record upload --events ./my-session.jsonl.gz
|
|
56
|
-
rnx record upload --origin https://contrast.localhost:3000 --events ./my-session.jsonl.gz --open
|
|
57
|
-
rnx record upload --video /tmp/sootsim-flow.mp4 --video-duration-ms 12000
|
|
58
|
-
`)}function p(e,t){let r=e.findIndex(o=>o===t);if(r<0)return;let s=e[r+1];return e.splice(r,2),s}function Ge(e,t){let r=e.findIndex(s=>s===t);return r<0?!1:(e.splice(r,1),!0)}function Je(e,t){if(!e)return;let r=Number(e);return(!Number.isFinite(r)||r<=0)&&(console.error(` invalid ${t}: ${e}`),process.exit(1)),Math.round(r)}function Ke(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!!(t.startsWith("image/")||t.startsWith("font/")||t.startsWith("video/")||t.startsWith("audio/")||t.startsWith("model/")||t==="text/css"||t==="application/javascript"||t==="text/javascript"||t==="application/wasm"||t==="application/font-woff"||t==="application/font-woff2"||t==="application/octet-stream"):!1}async function Ve(e){let t=await fetch(e);if(!t.ok)throw new Error(`fetch ${e} -> ${t.status} ${t.statusText}`);return new Uint8Array(await t.arrayBuffer())}function Pt(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function $t(e){try{return new URL(e).searchParams.get("appFonts")||""}catch{return""}}function Ft(e){try{return new URL(e).searchParams.get("appSplash")||""}catch{return""}}function Nt(e){try{let t=new URL(e);return t.searchParams.get("lazy")==="true"?(t.searchParams.set("lazy","false"),t.toString()):e}catch{return e}}async function Ct(e,t){let s=[];for(let o=0;o<t;o+=15e5){let i=Math.min(o+15e5,t),l=await B(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${o}, ${i})`);if(typeof l!="string")return null;s.push(l)}return s.join("")}function Lt(e){return e.recordedDurationMs&&e.recordingStartedAtMs?{since:e.recordingStartedAtMs-1e4,until:e.recordingStartedAtMs+e.recordedDurationMs+5e3,limit:2e3}:{limit:2e3}}function Ot(e){let t=M(e),s=(t[0]===31&&t[1]===139?xt(t):t).toString("utf8");return je(s)}function zt(e){return JSON.parse(M(e,"utf8"))}function Dt(e){if(e===null||typeof e!="object")return[];let t=e,r=typeof t.startedAtEpochMs=="number"&&t.startedAtEpochMs>0?t.startedAtEpochMs:null;if(r===null||!Array.isArray(t.samples))return[];let s=[];for(let o of t.samples){if(!Array.isArray(o)||typeof o[0]!="number")continue;let i=l=>typeof l=="number"&&Number.isFinite(l)?Math.round(l*100)/100:0;s.push({schemaVersion:1,t:r+Math.round(o[0]),seq:s.length+1,context:"tenant",kind:"frame",data:{totalMs:i(o[1]),layoutMs:i(o[2]),renderMs:i(o[3]),copyMs:i(o[4])}})}return s}function Ht(e){if(e===null||typeof e!="object")return e;let{samples:t,...r}=e;return r}function he(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function wn(e,t){(e.includes("--help")||e.includes("-h"))&&(_t(),process.exit(0));let r=[...e],s=await Bt(p(r,"--origin")),o=Ut(s,p(r,"--public-origin")),i=p(r,"--events"),l=p(r,"--screenshot"),f=p(r,"--snapshot-manifest"),c=p(r,"--video"),h=p(r,"--timeline-events"),T=p(r,"--trace-frame-stats"),Y=p(r,"--failure-bundle"),Q=p(r,"--video-duration-ms"),be=Je(p(r,"--recorded-duration-ms"),"--recorded-duration-ms"),we=Je(p(r,"--recording-started-at-ms"),"--recording-started-at-ms"),X=p(r,"--owner"),Z=p(r,"--repo"),D=p(r,"--billing-kind"),Qe=p(r,"--run-scope"),Xe=Ge(r,"--open");(X&&!Z||!X&&Z)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),D&&D!=="test_run"&&(console.error(` invalid --billing-kind: ${D}`),process.exit(1)),!i&&!c&&(console.error(" preview uploads require playback data: pass --events or --video.\n for a normal local preview, use `rnx record --mode combined --open`\n or `rnx maestro test --preview` instead of uploading a bundle-only snapshot."),process.exit(1));let Me=Ge(r,"--assets-only"),Ze=Pe(r,{stripBooleanFlags:[],stripValueFlags:[]}),S=$e(Ze),d,Te=[],v=[],x=h?Ot(h):[],Se=T?zt(T):null;x.push(...Dt(Se));let ve=x.length,ee=null;try{if(d=await B(S,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),d?.bundleUrl){let u=new URL(d.bundleUrl).origin,[m,P]=await Promise.all([B(S,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(u)}) || [])`),B(S,`(async () => {
|
|
59
|
-
const list = window.__sootsimListWorkerFetchRecorder
|
|
60
|
-
return typeof list === 'function'
|
|
61
|
-
? await list(${JSON.stringify(u)})
|
|
62
|
-
: []
|
|
63
|
-
})()`)]);Te=he([...m,...P]).filter(g=>{try{return!new URL(g.url).pathname.startsWith("/api/")}catch{return!0}});let N=await B(S,`(async () => {
|
|
64
|
-
const rec = window.__sootsimPreviewRecorder
|
|
65
|
-
const workerList = window.__sootsimListWorkerFetchRecorder
|
|
66
|
-
return {
|
|
67
|
-
main: rec?.list ? rec.list() : [],
|
|
68
|
-
worker: typeof workerList === 'function' ? await workerList() : [],
|
|
69
|
-
}
|
|
70
|
-
})()`),z=(N?he([...N.main,...N.worker]):[]).filter(g=>{try{return new URL(g.url).origin!==u}catch{return!1}}),k=z.length>0?{count:z.length,totalBytes:z.reduce((g,le)=>g+(le.size||0),0)}:null;if(k&&k.count>0){console.log(` ${k.count} recorded cross-origin responses (${(k.totalBytes/1024).toFixed(1)} KiB)`);let g=await B(S,`(async () => {
|
|
71
|
-
const rec = window.__sootsimPreviewRecorder
|
|
72
|
-
const workerDump = window.__sootsimDumpWorkerFetchRecorder
|
|
73
|
-
const bundleUrl = ${JSON.stringify(d.bundleUrl)}
|
|
74
|
-
const keep = (r) => {
|
|
75
|
-
try {
|
|
76
|
-
const u = new URL(r.url)
|
|
77
|
-
if (u.origin !== ${JSON.stringify(u)}) return true
|
|
78
|
-
// bundle-origin api responses came from the rewritten
|
|
79
|
-
// /__app-api proxy at record time (re-keyed by the
|
|
80
|
-
// recorder's unwrap step). they need bodies attached the
|
|
81
|
-
// same way as cross-origin records \u2014 direct re-fetch from
|
|
82
|
-
// the dev server lacks the bundle's session cookies.
|
|
83
|
-
if (r.url !== bundleUrl && u.pathname.startsWith('/api/')) return true
|
|
84
|
-
return false
|
|
85
|
-
} catch { return false }
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
main: rec?.dump ? rec.dump().filter(keep) : [],
|
|
89
|
-
worker: typeof workerDump === 'function'
|
|
90
|
-
? (await workerDump()).filter(keep)
|
|
91
|
-
: [],
|
|
92
|
-
}
|
|
93
|
-
})()`);if(v=he([...g.main,...g.worker]),Me){let le=v.length;v=v.filter(ue=>Ke(ue.contentType));let lt=k.totalBytes-v.reduce((ue,ut)=>ue+(ut.size||0),0);console.log(` --assets-only: kept ${v.length}/${le} records (dropped ${(lt/1024).toFixed(1)} KiB of API responses)`)}}}d?.transformedBundle&&(ee=await Ct(S,d.transformedBundle.byteLength));let n=await B(S,`(() => {
|
|
94
|
-
const bridge = window.SootSim?.bridges?.timeline ?? window.__sootsimTimeline
|
|
95
|
-
if (!bridge || typeof bridge.recent !== 'function') return null
|
|
96
|
-
return bridge.recent(${JSON.stringify(Lt({recordedDurationMs:be,recordingStartedAtMs:we}))})
|
|
97
|
-
})()`).catch(u=>(console.warn(` warning: failed to capture trace timeline: ${u instanceof Error?u.message:String(u)}`),null)),a=Array.isArray(n?.events)?n.events:[];x=[...x,...a.filter(de)].sort((u,m)=>u.t-m.t||u.seq-m.seq)}finally{S.close()}d||(console.error(" could not read bundle snapshot \u2014 is rnx running and is the bundle loaded?"),process.exit(2)),d.bundleUrl||(console.error(` no ?bundle= URL on the current rnx tab.
|
|
98
|
-
open the app you want to share first (e.g. rnx open 8082), then run upload.`),process.exit(2));let y,te=!1;if(ee!==null)y=new TextEncoder().encode(ee),te=!0,console.log(` using post-transform bundle: ${(y.byteLength/1024).toFixed(1)} KiB`);else{let n=Nt(d.bundleUrl);n!==d.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),y=await Ve(n),console.log(` main bundle: ${(y.byteLength/1024).toFixed(1)} KiB`)}let H=Te.filter(n=>n.url!==d.bundleUrl);Me&&(H=H.filter(n=>Ke(n.contentType))),console.log(` fetching ${H.length} extra files\u2026`);let j=(await Promise.all(H.map(async n=>{try{let a=await Ve(n.url);return{...n,bytes:a}}catch(a){return console.error(` warning: failed to re-fetch ${n.url}: ${a instanceof Error?a.message:a}`),null}}))).filter(n=>!!n),et=j.reduce((n,a)=>n+a.bytes.byteLength,0);console.log(` ${j.length} extra files: ${(et/1024).toFixed(1)} KiB`);let I;i&&(I=M(i)),x.sort((n,a)=>n.t-a.t||n.seq-a.seq);let xe=x.map(n=>JSON.stringify(n)).join(`
|
|
99
|
-
`),ne=ge(xe?`${xe}
|
|
100
|
-
`:"");console.log(` trace timeline: ${x.length} events${ve?` (${ve} from runner sidecars)`:""}`);let b;l&&(b=M(l),console.log(` attaching screenshot: ${(b.byteLength/1024).toFixed(1)} KiB`));let L=f?kt(f):[];L.length>0&&console.log(` attaching ${L.length} interaction snapshots`);let A,U;if(Y){let n=m=>{try{return M(qe.join(Y,m),"utf8")}catch{return null}},a=m=>{let P=n(m);if(P===null)return null;try{return JSON.parse(P)}catch{return P}},u={error:a("error.json"),describe:a("describe.json"),console:a("console.json"),a11y:n("a11y.txt"),tree:n("tree.txt")};Object.values(u).some(m=>m!==null)&&(A=ge(JSON.stringify(u)),console.log(` attaching failure bundle: ${(A.byteLength/1024).toFixed(1)} KiB gz`));try{U=M(qe.join(Y,"screenshot.png"))}catch{}}let R,O,Re;if(c){if(R=M(c),O=c.endsWith(".mp4")?"video/mp4":c.endsWith(".gif")?"image/gif":void 0,O||(console.error(" preview flow videos must be mp4 or gif"),await E(),process.exit(1)),Q){let n=Number(Q);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${Q}`),await E(),process.exit(1)),Re=Math.round(n)}console.log(` attaching flow video: ${(R.byteLength/1024).toFixed(1)} KiB (${O})`)}let $=K(),F=Le($),_=me(),tt=Ue();_e({event:"preview_upload_started",identity:{userId:$?.kind==="session"?tt?.user?.id??null:null,repoId:F?.repoId??null,installationId:F?.installationId??null},properties:{origin:s,hasAuth:!!$,authMode:$?.kind??"none",bundleBytes:y.byteLength,isTransformed:te,extraFiles:j.length,recordedFetches:v.length,hasEvents:!!I,traceTimelineEvents:x.length,hasScreenshot:!!b,hasVideo:!!R}}),$||(console.error(" preview uploads need auth."),console.error(" set RNX_API_KEY=sk_rnx_..., run `rnx login`, or use the Contrast github runner."),await E(),process.exit(1));let nt=V($),rt=(()=>{try{return new URL(d.bundleUrl).origin}catch{return null}})(),q=(n,a,u,m,P,N,Ie,z)=>{let k=Oe(N),g=k?ge(n):n;return{url:a,urlhash:u,method:m,bodyHash:P,requestVaryHash:z,contentType:N,responseHeaders:Ie,bytes:g,encoding:k?"gzip":void 0}},ke=[],re=$t(d.pageHref)||"";if(re){let n=await Fe(re,{onStaged:({url:a,byteLength:u})=>console.log(` staged app font: ${a} (${(u/1024).toFixed(1)} KiB)`),onError:(a,u)=>console.error(` warning: failed to fetch app font ${a}: ${u instanceof Error?u.message:u}`)});for(let a of n)ke.push(q(Buffer.from(a.bytes),a.url,a.urlhash,"GET","-",a.contentType))}let Ee=[],se=Ft(d.pageHref)||"";if(se){let n=await Ne(se,{onStaged:({url:a,byteLength:u})=>console.log(` staged splash image: ${a} (${(u/1024).toFixed(1)} KiB)`),onError:(a,u)=>console.error(` warning: failed to fetch splash image ${a}: ${u instanceof Error?u.message:u}`)});for(let a of n)Ee.push(q(Buffer.from(a.bytes),a.url,a.urlhash,"GET","-",a.contentType))}let oe=[...j.map(n=>q(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...v.map(n=>q(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash)),...ke,...Ee],ie=ze(y),st=vt("sha256").update(y).digest("hex");console.log(` bundle raw=${(y.byteLength/1024).toFixed(1)} KiB br=${(ie.byteLength/1024).toFixed(1)} KiB`);let ot={contentHash:st,bundleSizeBytes:y.byteLength,bundleContentType:Pt(d.bundleUrl),bundleEncoding:"br",bundleMinified:!1,bundleOrigin:rt,runtimeVersion:d.runtimeVersion??void 0,appFonts:re||void 0,appSplash:se||void 0,entry:d.entry,isTransformed:te,deviceSpec:d.deviceSpec,installationId:F?.installationId??void 0,repoId:F?.repoId,owner:X??F?.owner??_.owner??void 0,repo:Z??F?.repo??_.repo??void 0,branch:_.branch??void 0,commitSha:_.commitSha??void 0,githubUsername:_.githubUsername??void 0,pullRequestNumber:_.pullRequestNumber??void 0,pullRequestTitle:_.pullRequestTitle??void 0,billingKind:D==="test_run"?"test_run":void 0,runScope:Qe||void 0,files:oe.map(n=>({url:n.url,urlhash:n.urlhash,method:n.method,bodyHash:n.bodyHash,contentType:n.contentType,responseHeaders:n.responseHeaders,requestVaryHash:n.requestVaryHash,encoding:n.encoding,sizeBytes:n.bytes.byteLength})),events:I?{sizeBytes:I.byteLength}:void 0,timeline:{sizeBytes:ne.byteLength,encoding:"gzip"},traceFrameStats:Ht(Se),recordedDurationMs:be,recordingStartedAtMs:we,failureBundle:A?{sizeBytes:A.byteLength,encoding:"gzip"}:void 0,snapshots:(()=>{let n=[];b&&n.push({id:"landing",label:"Landing",kind:"landing",t:0,contentType:"image/png",sizeBytes:b.byteLength}),U&&n.push({id:"failure",label:"Failure",kind:"failure",contentType:"image/png",sizeBytes:U.byteLength});for(let a of L)n.push(a.meta);return n.length>0?n:void 0})(),flowVideo:R&&O?{sizeBytes:R.byteLength,contentType:O,durationMs:Re}:void 0},Be=new Map;for(let n of oe)Be.set(n.urlhash,n.bytes);let G=new Map;b&&G.set("landing",b),U&&G.set("failure",U);for(let n of L)G.set(n.meta.id,n.bytes);let it=Date.now(),w=ie.byteLength;for(let n of oe)w+=n.bytes.byteLength;I&&(w+=I.byteLength),w+=ne.byteLength,b&&(w+=b.byteLength),U&&(w+=U.byteLength);for(let n of L)w+=n.bytes.byteLength;A&&(w+=A.byteLength),R&&(w+=R.byteLength);let at=`${C(s)}/api/preview/upload/init`;console.log(` init: ${at}`);let J;try{let n=await De({originBase:s,initBody:ot,bundleBytes:ie,filesByHash:Be,extras:{eventsBytes:I,timelineBytes:ne,videoBytes:R,failureBundleBytes:A,snapshotBytes:G},authHeader:nt,concurrency:16});J=n.finalize;let a=1+n.init.files.length+(n.init.events?1:0)+(n.init.timeline?1:0)+n.init.snapshots.length+(n.init.flowVideo?1:0)+(n.init.failureBundle?1:0);console.log(` PUT ${a} objects in ${Date.now()-it}ms (${(w/1024).toFixed(1)} KiB)`)}catch(n){let a=n;a.phase==="init"&&a.status===401&&(console.error(" preview upload requires a valid login."),console.error(" run `rnx login` and retry."),await E(),process.exit(1)),a.status===402&&(console.error(` ${Rt(a.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),await E(),process.exit(1)),console.error(` ${a.message??`${a.phase??"upload"} failed: ${String(n)}`}`),await E(),process.exit(1)}let ae=`${o}${J.url}`;return console.log(`
|
|
101
|
-
stored ${J.filesStored??0} extra files`),console.log(` preview: ${ae}`),Xe&&await Ce(ae),await E(),{previewUrl:ae,shareId:J.id}}export{me as a,Qt as b,Xt as c,Zt as d,Bt as e,Ut as f,wn as g};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{createInterface as e}from"readline";var s=()=>e({input:process.stdin,output:process.stdout});function i(r){return new Promise(n=>{let t=s();t.question(r,o=>{t.close(),n(o.trim())})})}async function l(r,n=!0){let t=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${r} ${t} ${n?"y":"n"} (non-interactive)`),n;let o=await i(` ${r} ${t} `);return o===""?n:o.toLowerCase().startsWith("y")}export{l as a};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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 I,b as me,c as je}from"./chunk-44LRQEU3.js";import{a as He}from"./chunk-OYLIWHDB.js";import{e as ze}from"./chunk-YKKVDKLE.js";import{c as Fe}from"./chunk-G7S6T5OX.js";import{a as Ve,b as qe,d as Ge}from"./chunk-CUVY4A2A.js";import{a as ce,b as L,c as de,d as ue,e as Le,f as Ne,h as We,i as q,j as Ke}from"./chunk-SU7RE3PV.js";import{a as pe}from"./chunk-LV2G34IX.js";import{m as A}from"./chunk-RO3WVQPB.js";import{m as Be,p as Ae}from"./chunk-RWYA2USN.js";import{f as Re}from"./chunk-W7EXE22C.js";import{b as ae,d as Ee}from"./chunk-TMJGPUWJ.js";import{b as Ue,f as _e,g as D,h as $,i as B,k as Te,l as Oe,m as le,o as Me,p as De,q as U,r as P,s as _}from"./chunk-G3B2RZ47.js";import{J as ie,M as se,O as M,Q as Ce,l as oe}from"./chunk-4RKTGL63.js";import{a as re}from"./chunk-FRRHCLG2.js";import{spawn as et,spawnSync as tt}from"node:child_process";import T from"node:fs";import Et from"node:os";import C from"node:path";import{WebSocket as fe}from"ws";function Je(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 $t(e,n){return e?.includes("/one/metro-entry.bundle")?"one":typeof n=="string"&&n?"expo":"unknown"}function Ye(e,n,t){return`${e}//${n}:${t}`}function Pt(e){if(typeof window>"u")return!1;try{let n=new URL(e);return I(n.hostname)&&I(window.location.hostname)&&n.origin!==window.location.origin}catch{return!1}}async function Qe(e,n){let t={...n,cache:n?.cache??"no-store"};return Pt(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function It(e){return e==="https:"?443:80}function kt(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?{bundleUrl:ue(r.bundleUrl),port:e,framework:typeof r.framework=="string"?r.framework:"unknown",projectName:typeof r.projectName=="string"?r.projectName:void 0}:null}catch{return null}}async function Ze(e,n){let t=e.replace(/\/+$/,"");try{if(I(new URL(t).hostname)){let r=await Ct(n);if(r)return r}}catch{}try{let r=await Qe(`${t}/`,{headers:{"expo-platform":"ios"}});if(r.ok){let o=await r.json(),i=o?.extra?.expoClient||o?.extra||{},s=typeof o?.launchAsset?.url=="string"?o.launchAsset.url:void 0;if(s||i.name)return{bundleUrl:ue(s||`${t}${de}`),port:n,framework:$t(s,i.sdkVersion),projectName:i.name}}}catch{}try{let r=await Qe(`${t}/status`);if(r.ok&&(await r.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:n,framework:"metro"}}catch{}return null}async function Rt(e){return Ze(Ye("http:","localhost",e),e)}async function Xe(e){let n=e.trim();if(/^\d+$/.test(n)){let a=parseInt(n,10),l=await Rt(a);if(l)return l;throw Je(`localhost:${a}`)}let t=n.startsWith("http")?n:`http://${n}`,r;try{r=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let o=r.protocol||"http:",i=r.port?parseInt(r.port,10):It(o),s=Ye(o,r.hostname,i);if(kt(r)){let a=await Ze(s,i);if(a)return a;throw Je(s)}return{bundleUrl:r.toString(),port:i,framework:"unknown"}}var Ut=12e4,nt=100,_t=5e3,rt=1e4,Tt={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 y(e){return new Promise(n=>setTimeout(n,e))}function ot(e){let n=process.env[e]?.trim();if(!n)return null;let t=Number(n);return Number.isInteger(t)&&t>0?t:null}function Ot(){let e=ot("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??ot("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Ut;return{timeoutMs:e,hostTimeoutMs:e+_t,intervalMs:nt,attempts:Math.max(1,Math.ceil(e/nt))}}function it(e){return e==="electron"||e==="playwright"}function ge(e,n){return n==="playwright"?e.meta?.sootsimHostDriver==="playwright":e.userAgent?.includes("Electron/")===!0}function Mt(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()}var mt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Dt(e){let n=e.trim();if(!n)throw new Error("expected <url-or-route>");return mt.test(n)||n.startsWith("/")?n:`/${n}`}function Bt(e){return e!==null&&typeof e=="object"}function At(e){let n=e.trim();return n?n.startsWith("/")?!0:mt.test(n)?!/^https?:\/\//i.test(n):!1:!1}async function Lt(e,n=!1){if(await z(e,250))return e;let t=se();if(st(e,n,t),t&&M(t)&&await z(t.bridgePort,500))return t.bridgePort;if(t&&M(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 Nt();let r=Ft(["serve","--quiet","--port",String(e)]),o=null;r.once("exit",(s,a)=>{o=String(s??a??"unknown")}),r.unref();let i=Date.now()+rt;for(;Date.now()<i;){let s=se();if(st(e,n,s),s&&M(s)&&await z(s.bridgePort,250))return console.error(` started local bridge on port ${s.bridgePort}; run \`sootsim setup\` to install the background daemon`),s.bridgePort;if(await z(e,250))return console.error(` started local bridge on port ${e}; run \`sootsim setup\` to install the background daemon`),e;if(o)throw new Error(`rnx bridge exited before becoming ready (exit ${o})`);await y(150)}throw new Error(`rnx bridge did not start within ${Math.round(rt/1e3)}s`)}function st(e,n,t){if(!(!n||!t||!M(t)||t.bridgePort===e))throw new Error(`${re.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 Nt(){let e=ie();if(e&&T.existsSync(oe(e)))return;console.error(" installing rnx engine runtime...");let{runRuntime:n}=await import("./runtime-4V2RBUOR.js");await n(["install"],{})}function Ft(e){let n=process.argv[1];return n&&T.existsSync(n)?et(process.execPath,[n,...e],{detached:!0,stdio:"ignore",env:process.env}):et(re.commandName,e,{detached:!0,stdio:"ignore",env:process.env})}function z(e,n){return new Promise(t=>{let r=new fe(`ws://127.0.0.1:${e}`,{handshakeTimeout:n}),o=!1,i=s=>{o||(o=!0,r.readyState===fe.OPEN?r.close():r.readyState===fe.CONNECTING&&r.terminate(),t(s))};r.once("open",()=>i(!0)),r.on("error",()=>i(!1)),setTimeout(()=>i(!1),n)})}function we(e){try{let n=new URL(e),t=n.pathname.replace(/\/+$/,"")||"/";return n.searchParams.has("open")||n.searchParams.has("port")||n.searchParams.has("bundle")||n.searchParams.has("demo")||n.pathname.includes("/sootsim/index.html")||t==="/sootsim"||n.pathname==="/__soot"||n.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function jt(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 Ht(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 Wt(e){try{let n=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(n)||/^\/build\/.+/.test(n)}catch{return!1}}async function Yn(e){let n=J(e);return(await ve(n)).bundleUrl}function Kt(e){try{let n=new URL(e.startsWith("http")?e:`http://${e}`),t=n.pathname||"/";if(t!=="/"&&t!==""||n.search||n.hash||!I(n.hostname))return null;let r=n.port?Number(n.port):n.protocol==="https:"?443:80;return Number.isFinite(r)&&r>0?r:null}catch{return null}}async function ve(e){let n=J(e),t=/^\d+$/.test(n)?Number(n):Kt(n);if(t&&t>0){let r=await Ne(t);if(r)return{bundleUrl:r.bundleUrl,port:r.port,framework:r.framework,projectName:r.projectName}}return Xe(n)}function Q(e){let n=e.replace(/\/+$/,"")||"/";return n==="/__soot"||n.startsWith("/__soot/")?"/__soot":""}function Vt(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 qt(e,n,t={}){let r=t.resolvedBundle??await ve(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 s=t.hot===void 0?r.bundleUrl:Le(r.bundleUrl,t.hot);return o.searchParams.set("bundle",s),o.toString()}function zt(e){return e.startsWith("~/")?C.join(Et.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function Gt(e){let n={},t={};for(let o=0;o<e.length;o++){if(e[o]==="--replace"){let i=e[o+1];i||(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let s=i.indexOf("=");(s<=0||s===i.length-1)&&(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let a=i.slice(0,s).trim(),l=zt(i.slice(s+1).trim());T.existsSync(l)||(console.error(` rnx open: replacement file not found: ${l}`),process.exit(1)),n[a]={file:l},o++;continue}if(e[o]==="--remap"){let i=e[o+1],s=i?i.indexOf("="):-1;(!i||s<=0||s===i.length-1)&&(console.error(" rnx open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[i.slice(0,s).trim()]=i.slice(s+1).trim(),o++;continue}}let r={};return Object.keys(n).length>0&&(r.modules=n),Object.keys(t).length>0&&(r.network={remap:t}),r.modules||r.network?r:void 0}async function Jt(e){if(e){let n=await q(e.bundleUrl);if(n)return pe(n,{trustStart:!0})}return pe(process.env.CONTRAST_REPO_DIR||process.cwd())}async function Qt(e){if(T.existsSync(C.join(oe(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let n=await Re.install({version:e,setActive:!1,protectVersions:Ce()});console.error(` installed engine runtime ${n.version}`)}function Yt(e,n){let t=n??(me()?void 0:ie()??void 0);if(!t)return e;let r=new URL(e);if(!I(r.hostname)){if(!n)return e;throw new Error(`runtimeVersion ${t} requires a local rnx host; got ${r.origin}`)}return r.hostname=je(t),r.toString()}function ft(){return Te().shellBaseUrl}function Zt(e){return Oe(e)?.shellBaseUrl??Ue(e)??ft()}async function Xt(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r)return e;let o=n?.appDir??await q(r)??void 0,i=We({bundleUrl:r,repoDir:o,exactProjectDir:!!n||!!o});if(i.length===0)return e;let s=await en(i);return s.length===0?e:(t.searchParams.set("appFonts",Ke(s)),t.toString())}catch{return e}}async function en(e){let n=await Promise.all(e.map(async r=>{let o=new AbortController,i=setTimeout(()=>o.abort(),1500);try{let s=await fetch(r.url,{method:"HEAD",signal:o.signal});return s.status>=200&&s.status<400?r:null}catch{return null}finally{clearTimeout(i)}})),t=[];for(let r of n)r!==null&&t.push(r);return t}async function tn(e,n,t={}){if(!e)return new URL(n).toString();if(we(e))return new URL(e).toString();if(jt(e))return Ht(e,n);let r=Tt[e.toLowerCase()];if(r){let o=new URL(n),i=Q(o.pathname);return o.pathname=`${i}${r}`,o.toString()}return pt(e)?qt(e,n,t):Vt(e,n)}async function nn(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r)return e;let o=n?.appDir??await q(r)??void 0,i=Ve({bundleUrl:r,repoDir:o,exactProjectDir:!!n||!!o});return!i||i.imageUrl&&!await rn(i.imageUrl)?e:(t.searchParams.set("appSplash",qe(i)),t.toString())}catch{return e}}async function rn(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 G(e,n=ft(),t={}){let r=await tn(e,n,t),o=await nn(await Xt(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 at(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 on(e,n,t,r={}){let o=new URL(await G(e,n,r));return o.searchParams.set("inspectOpen",t),o.toString()}async function sn(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500,s=r.minNodeCount??10;for(let a=0;a<o;a++){let l=P(e,{commandTimeoutMs:n,simId:t,simIdSource:"flag"});try{let d=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof d=="number"&&d>s)return{bridge:l,count:d}}catch{}l.close(),await y(i)}return null}function an(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 ln(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 Zn(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 ${ln(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=an(t.url);if(i)console.log(` loaded: ${i}`);else if(t.url){let a=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${a}`)}else t.origin&&console.log(` origin: ${t.origin}`);let s=cn(t);s&&console.log(` engine: ${s}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${lt(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${lt(Date.now()-t.lastActiveAt)}`)}}function cn(e){let n=e.url||e.origin||"";if(!n)return null;try{let t=new URL(n).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"Contrast app embedded (:3000)":me()?`dev \u2014 local build (:${t||"?"})`:`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function lt(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 Xn(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500;for(let s=0;s<o;s++){let a=P(e,{commandTimeoutMs:n});try{let d=(await a.listSims()).find(t);if(d)return d}catch{}finally{a.close()}await y(i)}return null}async function dn(e,n,t,r,o={}){let i=o.attempts??30,s=o.intervalMs??500,a=!!r&&Number.isInteger(r)&&r>1,l=()=>a&&r!==void 0&&!be(r);for(let d=0;d<i;d++){if(l())return{kind:"host-exit"};let c=P(e,{commandTimeoutMs:n});try{let g=(await c.listSims()).find(t);if(g)return l()?{kind:"host-exit"}:{kind:"match",sim:g}}catch{}finally{c.close()}if(l())return{kind:"host-exit"};await y(s)}return{kind:"timeout"}}async function un(e,n,t,r={}){let o=r.attempts??20,i=r.intervalMs??250;for(let s=0;s<o;s++){let a=P(e,{commandTimeoutMs:n});try{let d=(await a.listSims()).find(c=>c.id===t);if(!d||d.readyState!=="open")return!0}catch{return!0}finally{a.close()}await y(i)}return!1}function mn(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 pn(e){if(!e.connectAckFile)return!1;try{return T.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
|
|
6
|
-
`,{flag:"w"}),!0}catch{return!1}}function ct(e){if(e.diagnosticLogPath)try{let n=T.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!n){console.error(` ${C.basename(e.diagnosticLogPath)} was empty`);return}let t=n.length>4e3?`\u2026
|
|
7
|
-
${n.slice(-4e3)}`:n;console.error(` ${C.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(n){let t=n instanceof Error?n.message:String(n);console.error(` failed to read ${C.basename(e.diagnosticLogPath)}: ${t}`)}}function be(e){try{return process.kill(e,0),!0}catch(n){return n?.code==="EPERM"}}async function fn(e,n=2500){let t=Date.now()+n;for(;Date.now()<t;){if(!be(e))return!0;await y(100)}return!be(e)}function gn(e){let n=tt("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),t=tt("ps",["eww","-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(n.status!==0||t.status!==0)return!1;let r=(n.stdout||"").trimEnd(),o=(t.stdout||"").trimEnd();return(o.startsWith(r)?o.slice(r.length):o).includes("SOOTSIM_PW_URL=")}async function he(e,n){let t=new Set(n),r=new Set;for(let o of e){if(!t.has(o.id))continue;let i=mn(o);i&&r.add(i)}for(let o of r){if(!gn(o)){console.log(` skipped pid ${o}: not a rnx playwright host (stale sim record)`);continue}try{process.kill(o,"SIGTERM")}catch{}if(await fn(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(s=>s.id===o);if(!i)throw new Error(`no sim connected with id ${o}`);return i}let t=e.find(o=>o.isPrimary&&o.readyState==="open");if(t)return t;let r=e.find(o=>o.readyState==="open");if(r)return r;throw new Error("no sim connected")}function dt(e,n,t){let[r,o]=[e,n.url].map(i=>{if(!i)return i;try{let s=new URL(i);if(s.searchParams.has("sootsimConfig"))return s.searchParams.set("sootsimConfig","[redacted]"),s.toString()}catch{}return i});console.log(` ${t==="current sim"?"loaded":"opened"}: ${r} [${t}]`),console.log(` current sim: ${n.id}`),console.log(JSON.stringify({simId:n.id,url:o},null,2))}async function ut(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 hn(e,n,{stableMs:150,maxMs:400});let o=P(e,{commandTimeoutMs:3e3,simId:n,cliLabel:"open --describe",simIdSource:"flag"});try{let i=null;try{i=await o.send({type:"evaluate",code:Be})}catch{}if(i&&!(i.flag===!0&&!i.loadingText&&Ae(i))){let c=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: ${c} (nodes: ${i.nodes}, targets: ${i.targets})`),console.log(" before interacting, run: rnx wait ready --max-ms 120000")}let a=`(async () => {
|
|
8
|
-
const t = window.__sootsimTest
|
|
9
|
-
const ms = window.SootSim?.bridges?.mainShell
|
|
10
|
-
if (!t) return null
|
|
11
|
-
let shell = null
|
|
12
|
-
try { shell = ms?.getState ? await ms.getState() : null } catch {}
|
|
13
|
-
const tree = await t.dumpTree(12, ${JSON.stringify({describe:!0,verbose:!1,filter:""})})
|
|
14
|
-
return { tree, shell }
|
|
15
|
-
})()`,l=await o.send({type:"evaluate",code:a});if(!l?.tree)return;if(console.log(""),l.shell?.state){let d=[`state=${l.shell.state}`,l.shell.activeApp?`app=${l.shell.activeApp}`:null].filter(Boolean);console.log(` shell: ${d.join(" ")}`)}console.log(l.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 hn(e,n,t){let r=Date.now()+t.maxMs,o="(async () => (await window.__sootsimTest?.getNodeCount?.()) || 0)()",i=P(e,{commandTimeoutMs:2e3,simId:n,simIdSource:"flag"});try{let s=-1,a=0;for(;Date.now()<r;){let l=-1;try{let d=await i.send({type:"evaluate",code:o});typeof d=="number"&&(l=d)}catch{}if(l>=0&&l===s){if(Date.now()-a>=t.stableMs)return}else s=l,a=Date.now();await y(50)}}finally{i.close()}}async function wn(e,n={}){let t=U(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"),process.exit(1));let r;try{r=Dt(t.positional[0]??"")}catch(s){console.error(` rnx open: ${s instanceof Error?s.message:String(s)}`),process.exit(1)}let o=_(t),i=t.simId?` --sim ${t.simId}`:"";try{let s=await o.send({type:"call",path:"SootSim.bridges.test.openDeepLink",args:[r]});if(Bt(s)&&s.ok===!1)throw new Error(typeof s.error=="string"?s.error:"deep-link dispatch failed");console.log(` opened deep link: ${r}`)}catch(s){console.error(` link failed: ${s instanceof Error?s.message:String(s)}`),await A(o,{errorsCommand:`rnx get errors 5${i}`,warningsCommand:`rnx get warnings 5${i}`,requestsCommand:`rnx get requests 5${i}`}),process.exit(1)}finally{o.close()}}async function er(e,n={}){let t=U(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--new","--headless","--headed","--ephemeral","--hot","--no-hmr","--no-describe"],stripValueFlags:["--base-url","--replace","--driver","--profile","--cdp-port","--device","--viewport"]}),r=e.find((p,m)=>e[m-1]==="--profile"),o=e.includes("--ephemeral"),i=e.find((p,m)=>e[m-1]==="--cdp-port"),s=i?Number(i):void 0;i&&(!Number.isFinite(s)||s<=0)&&(console.error(` rnx open: --cdp-port must be a positive port number, got "${i}"`),process.exit(1)),r&&o&&(console.error(" rnx open: --profile cannot be combined with --ephemeral"),process.exit(1));let a=r?Fe(r).id:void 0,l=e.includes("--new")||!!a||o,d=Gt(e);l&&t.simIdSource==="flag"&&(console.error(" rnx open: --new, --profile, and --ephemeral cannot be combined with --sim"),process.exit(1));let c=t.positional[0]||"";if(At(c)){l&&(console.error(" rnx open: deep links target the current app; remove --new, --profile, or --ephemeral"),process.exit(1)),await wn(e,n);return}if(Wt(c)){let p=(()=>{try{return I(new URL(c).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 Ge(c,{background:!1})}catch(m){console.error(` could not launch a browser: ${m instanceof Error?m.message:String(m)}`),console.error(` open it yourself: ${c}`),process.exit(1)}console.log(p?" 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 u=pt(c)?await ve(c):void 0,g=await Jt(u),O=await He(g),N=O?.runtimeVersion,F=ce(ce(O?{...O,runtimeVersion:void 0}:void 0,n.runtimeConfig),d);N&&await Qt(N);let Z=e.find((p,m)=>e[m-1]==="--base-url");if(Z&&!t.explicitPort){let p=le(Z);p&&(t.wsPort=p)}t.wsPort=await Lt(t.wsPort,t.explicitPort);let R=e.find((p,m)=>e[m-1]==="--driver")||"";R&&!it(R)&&(console.error(` unknown driver "${R}" \u2014 run \`rnx list --drivers\``),process.exit(1));let S=it(R)?R:"playwright",ht=Mt(e,S);s&&S!=="playwright"&&(console.error(" rnx open: --cdp-port is only honored by the playwright driver"),process.exit(1));let ye=e.includes("--hot"),Se=e.includes("--no-hmr");ye&&Se&&(console.error(" rnx open: --hot and --no-hmr cannot be combined"),process.exit(1));let wt=ye?!0:Se?!1:R!=="playwright",k=e.find((p,m)=>e[m-1]==="--device");k&&!(k in ae)&&(console.error(` rnx open: unknown device "${k}"`),console.error(` known devices: ${Ee().join(", ")}`),process.exit(1));let X=k?ae[k]:void 0,j=e.find((p,m)=>e[m-1]==="--viewport"),H=j?/^(\d+)x(\d+)$/.exec(j):null;j&&!H&&(console.error(` rnx open: --viewport must be <width>x<height>, got "${j}"`),process.exit(1));let bt=H?{width:Number(H[1]),height:Number(H[2])}:void 0,W={hot:wt,device:k,resolvedBundle:u,project:g},vt=N?`http://localhost:${t.wsPort}/`:Z||Zt(t.wsPort),x=Yt(vt,N),xe=e.includes("--base-url");Me(t.wsPort,x);let yt=D();if(!l){let p=_(t),m=t.simId?` --sim ${t.simId}`:"",ne=!1;try{let f=null,V=null;try{let h=await p.listSims();if(t.simIdSource==="saved")f=h.find(w=>w.id===yt&&w.readyState==="open"&&ge(w,S))??null,f||B();else if(t.simIdSource==="flag"&&(f=Y(h,t.simId),!ge(f,S)))throw new Error(`sim ${f.id} is not managed by the ${S} driver`);if(!f&&t.simIdSource!=="flag"){V=await G(c,L(x,F),W);let w=new URL(V);w.searchParams.delete("inspectOpen"),f=h.find(v=>{if(v.readyState!=="open"||!v.url||!ge(v,S))return!1;try{let ke=new URL(v.url);return ke.searchParams.delete("inspectOpen"),ke.toString()===w.toString()}catch{return!1}})??null}if(!f)if(t.simIdSource!=="flag")ne=!0;else throw new Error("no sim connected");if(!ne&&f){let w=xe||we(c)?x:at(f,x),v=V??await G(c,L(w,F),W);p.send({type:"evaluate",simId:f.id,code:`window.location.href = ${JSON.stringify(v)}`}).catch(()=>{})}}catch(h){console.error(` open failed: ${h instanceof Error?h.message:String(h)}`),await A(p,{errorsCommand:`rnx get errors 5${m}`,warningsCommand:`rnx get warnings 5${m}`,requestsCommand:`rnx get requests 5${m}`}),process.exit(1)}if(!ne&&f){await y(1500);let h=await sn(t.wsPort,t.commandTimeoutMs,f.id);h||(console.error(" timed out waiting for current sim to load target"),process.exit(1)),h.bridge.close(),$(f.id);let w=xe||we(c)?x:at(f,x),v=V??await G(c,L(w,F),W);dt(v,{...f,url:v},"current sim"),await ut(t.wsPort,f.id,e);return}}finally{p.close()}}let St=L(x,F),$e=`cli-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Pe=await on(c,St,$e,W),Ie=_e();Ie||(console.error(" could not resolve a stable owning process; refusing unsupervised sim host"),process.exit(1));let xt=p=>p.url?.includes(`inspectOpen=${$e}`)??!1,E=ze(S);E||(console.error(` unknown driver "${S}" \u2014 run \`rnx list --drivers\``),process.exit(1));let K=Ot(),b=await E.launch({url:Pe,bridgePort:le(x)??t.wsPort,headless:ht,profileId:a,ephemeralProfile:o,cdpPort:s,device:k,ownerPid:Ie,viewport:bt??(X?{width:X.width+120,height:X.height+60}:void 0),connectTimeoutMs:K.hostTimeoutMs});b.launched||(console.error(` ${E.name} driver: ${b.message}`),process.exit(1));let ee=await dn(t.wsPort,t.commandTimeoutMs,xt,b.pid,{attempts:K.attempts,intervalMs:K.intervalMs});if(ee.kind==="host-exit"&&(ct(b),console.error(` ${E.name} host crashed \u2014 sim is no longer attached`),process.exit(1)),ee.kind==="timeout"){if(b.pid)try{process.kill(b.pid,"SIGTERM"),console.error(` closed ${E.name} host process ${b.pid}`)}catch{}ct(b),console.error(` timed out after ${K.timeoutMs}ms waiting for opened sim to connect`),process.exit(1)}let te=ee.sim;$(te.id),pn(b),dt(Pe,te,`${E.name} driver`),await ut(t.wsPort,te.id,e)}async function gt(e,n={}){let t=U(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--force"]}),r=e.includes("--force"),o=_(t),i=t.simId?` --sim ${t.simId}`:"";try{try{let s=await o.listSims(),a=Y(s,t.positional[0]||t.simId);if(a.lockedBy&&a.lockExpiresAt&&a.lockExpiresAt>Date.now()){let l=Math.max(0,Math.round((a.lockExpiresAt-Date.now())/1e3));a.lockedByKind==="user-active"&&(console.error(` refused: ${a.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"),process.exit(1)),r||(console.error(` refused: ${a.id} is leased by ${a.lockedBy} (${l}s)`),console.error(` \`sootsim use ${a.id} --force\` to take it, or \`rnx open --new\` for a fresh sim`),process.exit(1))}await o.focusSim(a.id),$(a.id),console.log(` using: ${a.id}`)}catch(s){console.error(` use failed: ${s instanceof Error?s.message:String(s)}`),await A(o,{errorsCommand:`rnx get errors 5${i}`,warningsCommand:`rnx get warnings 5${i}`,requestsCommand:`rnx get requests 5${i}`}),process.exit(1)}}finally{o.close()}}async function tr(e,n={}){await gt(e,n)}async function nr(e,n={}){await gt(e,n)}async function rr(e,n={}){let t=U(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--force"]}),r=e.includes("--force"),o=_(t);try{try{let i=await o.listSims(),s=Y(i,t.positional[0]||t.simId),a=r&&s.lockedBy&&s.lockedByKind!=="user-active"?s.lockedBy:null,l=await o.claim(s.id,{force:r});$(s.id);let d=Math.max(0,Math.round((l.lockExpiresAt-Date.now())/1e3)),c=l.bootedCount>0?` (booted ${l.bootedCount})`:"";console.log(` claimed: ${l.simId} [${d}s]${c}`),a&&console.log(` took over from: ${a}`)}catch(i){if(i instanceof De){let s=Math.max(0,Math.round(i.lock.expiresInMs/1e3));console.error(` claim failed: locked by ${i.lock.by} for ${s}s more`),console.error(" use --force to take it, or `rnx open --new` for a fresh sim"),process.exit(1)}console.error(` claim failed: ${i instanceof Error?i.message:String(i)}`),process.exit(1)}}finally{o.close()}}async function bn(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 s=[];try{let a=P(n,{commandTimeoutMs:t});try{s=(await a.listSims()).filter(d=>o.has(d.id)&&d.readyState==="open").map(d=>d.id)}finally{a.close()}}catch{s=[]}if(s.length===0)return{closed:[...o],remaining:[]};if(i===39)return{closed:[...o].filter(a=>!s.includes(a)),remaining:s};await y(250)}return{closed:[...o],remaining:[]}}function vn(e,n){let t=e.filter(u=>u.readyState==="open"),r=t.map(u=>u.id),o=n.explicitKeepId?.trim()||"",i=n.savedKeepId?.trim()||"",s=i?t.some(u=>u.id===i):!1,a=i&&!s?i:null,l=null,d=null,c=null;if(n.closeOthers)if(o){let u=t.find(g=>g.id===o);u?l=u.id:d=o}else if(i&&s)l=i;else{let u=t.find(g=>g.isPrimary)??t[0]??null;u&&(l=u.id,i&&!s&&(c=u.id))}return{openIds:r,keepId:l,targets:d?[]:r.filter(u=>u!==l),staleSavedId:a,missingExplicitKeepId:d,fallbackKeepId:c}}async function or(e,n={}){let t=U(e,{port:n.port,commandTimeoutMs:n.timeoutMs,stripBooleanFlags:["--all","--others"]}),r=_(t),o=t.simId?` --sim ${t.simId}`:"",i=e.includes("--all"),s=e.includes("--others");if(i||s){try{let a=await r.listSims(),l=D(),d=t.positional[0]||(t.simIdSource==="flag"?t.simId:void 0),c=vn(a,{closeOthers:s,explicitKeepId:d,savedKeepId:l});if(c.staleSavedId&&B(),c.fallbackKeepId&&($(c.fallbackKeepId),console.log(` saved sim ${c.staleSavedId} is gone \u2014 keeping primary ${c.fallbackKeepId}`)),c.missingExplicitKeepId&&(console.error(` close failed: keep sim ${c.missingExplicitKeepId} is not connected; not closing other sims`),process.exit(1)),c.targets.length===0){console.log(c.keepId?` nothing to close \u2014 only the kept sim ${c.keepId} is connected`:c.staleSavedId?` nothing to close \u2014 no sims connected (cleared stale current sim ${c.staleSavedId})`:" nothing to close \u2014 no sims connected");return}let u=await bn(r,t.wsPort,t.commandTimeoutMs,c.targets);await he(a,c.targets);let g=D();g&&u.closed.includes(g)&&(c.keepId?$(c.keepId):B());let O=` closed ${u.closed.length} sim(s)${c.keepId?` (kept ${c.keepId})`:""}`;console.log(O),u.remaining.length>0&&(console.error(` close failed: still connected: ${u.remaining.join(", ")}`),process.exit(1))}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),process.exit(1)}finally{r.close()}return}try{try{let a=await r.listSims(),l=Y(a,t.positional[0]||t.simId),d=a.find(u=>u.id!==l.id&&u.readyState==="open");await r.closeSim(l.id),await un(t.wsPort,t.commandTimeoutMs,l.id)||(await he(a,[l.id]),console.error(` close failed: ${l.id} is still connected`),process.exit(1)),await he(a,[l.id]),D()===l.id&&(d?$(d.id):B()),console.log(` closed: ${l.id}`)}catch(a){console.error(` close failed: ${a instanceof Error?a.message:String(a)}`),await A(r,{errorsCommand:`rnx get errors 5${o}`,warningsCommand:`rnx get warnings 5${o}`,requestsCommand:`rnx get requests 5${o}`}),process.exit(1)}}finally{r.close()}}export{Ot as a,Dt as b,Lt as c,Yn as d,Yt as e,ft as f,Zt as g,G as h,on as i,an as j,Zn as k,Xn as l,dn as m,mn as n,pn as o,he as p,wn as q,er as r,tr as s,nr as t,rr as u,bn as v,vn as w,or as x};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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-5FB4EA33.js";import{C as l,E as u}from"./chunk-4RKTGL63.js";var c=/^[A-Za-z0-9._:-]{1,160}$/;function T(e){if(!e?.startsWith("TM_SESSION:"))return null;let n=e.slice(11).trim();return c.test(n)?n:null}function p(e){return c.test(e)}function f(){let e=process.env.DO_NOT_TRACK;return e==="1"||e==="true"||!l().productAnalytics}function m(){if(f())return null;let e=process.env.VITE_POSTHOG_API_KEY||"";if(!e)return null;let n=process.env.CONTRAST_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:e,host:n.replace(/\/+$/,"")}}function d(){try{return u()}catch{return"anonymous-cli"}}function S(e){return e?e.userId?e.userId:e.installationId!=null?`install:${e.installationId}`:e.repoId?`repo:${e.repoId}`:e.shareId?`share:${e.shareId}`:d():d()}function h(e){let n=e.identity??{},o=process.env.TM_SESSION,s=o&&p(o)?"team-machine":process.env.CI==="1"||process.env.CI==="true"||process.env.GITHUB_ACTIONS==="true"?"ci":null,t={$lib:"sootsim-cli",source:n.source??"cli",...e.properties,traffic_type:s?"automated":"human",is_automated:s!==null,...s?{automation_source:s}:{}};return n.userId&&(t.userId=n.userId),n.repoId&&(t.repoId=n.repoId),n.installationId!=null&&(t.installationId=String(n.installationId)),n.shareId&&(t.shareId=n.shareId),n.plan&&(t.plan=n.plan),{event:e.event,distinct_id:S(n),properties:t,timestamp:new Date().toISOString()}}var r=[],I=!1;async function i(){if(r.length===0)return;let e=m();if(!e){r.length=0;return}let n=r.splice(0,r.length).map(h);try{await fetch(`${e.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:e.apiKey,batch:n}),signal:AbortSignal.timeout(2e3)})}catch{}}function g(){I||(I=!0,process.on("beforeExit",()=>void i()),process.on("exit",()=>void i()))}function C(e){if(f())return;g();let n=null;try{n=a()?.user?.id??null}catch{n=null}r.push({...e,identity:{source:"cli",userId:n,...e.identity}})}async function E(){await i()}export{T as a,p as b,C as c,E as d};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import g from"node:fs";import f from"node:path";var D=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"],_=["sootsim.config.ts","sootsim.config.js","sootsim.config.mjs","sootsim.config.cjs"],S=new Set(["node_modules","artifacts","dist","build","out","coverage","tmp","public","ios","android","macos","windows","__fixtures__","__tests__","fixtures","fixture","examples","example"]),d=256,y=4;function A(s,r){for(let t of r){let n=f.join(s,t);try{if(g.statSync(n).isFile())return n}catch{}}return null}function m(s){return A(s,D)}function h(s){return A(s,_)}function k(s){try{let r=JSON.parse(g.readFileSync(f.join(s,"package.json"),"utf8"));if(!r||typeof r!="object")return[];let t=Reflect.get(r,"workspaces");if(Array.isArray(t))return t.filter(c=>typeof c=="string");if(!t||typeof t!="object")return[];let n=Reflect.get(t,"packages");return Array.isArray(n)?n.filter(c=>typeof c=="string"):[]}catch{return[]}}function b(s){let r=new Set,t=0,n=!0;for(let c of k(s)){if(t>=d){n=!1;break}if(!c||f.isAbsolute(c))continue;let a=c.split(/[\\/]+/).filter(Boolean);if(a.length===0||a.length>y||a.some(o=>o===".."||o==="**"))continue;let i=[s];for(let o of a){let e=[];for(let l of i){if(t>=d){n=!1;break}if(t++,o==="*"){let p;try{p=g.readdirSync(l,{withFileTypes:!0})}catch{continue}for(let u of p)!u.isDirectory()||u.isSymbolicLink()||u.name.startsWith(".")||S.has(u.name)||e.push(f.join(l,u.name))}else if(!o.includes("*")){let p=f.join(l,o);try{let u=g.lstatSync(p);u.isDirectory()&&!u.isSymbolicLink()&&e.push(p)}catch{}}}i=e,i.length>d&&(i.length=d,n=!1)}for(let o of i)r.add(o)}return{directories:[...r],complete:n}}function j(s){let r=[{dir:s,depth:0}],t=[],n=0,c=0,a=!0;for(;c<r.length&&n<d;){let i=r[c++];if(!i)break;if(n++,i.depth>0&&m(i.dir)&&(t.push(i.dir),t.length>1))return{directories:t,complete:!0};if(i.depth>=y)continue;let o;try{o=g.readdirSync(i.dir,{withFileTypes:!0})}catch{continue}for(let e of o)if(!(!e.isDirectory()||e.isSymbolicLink())&&!(e.name.startsWith(".")||S.has(e.name))){if(r.length>=d){a=!1;break}r.push({dir:f.join(i.dir,e.name),depth:i.depth+1})}}return{directories:t,complete:a&&c===r.length}}function w(s,r={}){let t=f.resolve(s),n=h(t);if(m(t)||r.trustStart&&g.existsSync(t)){let e=n;if(!e&&r.trustStart){let l=f.dirname(t);for(let p=0;p<y&&l!==f.dirname(l)&&(e=h(l),!e);p++)l=f.dirname(l)}return{appDir:t,configPath:e}}let c=b(t),a=c.directories.filter(e=>m(e));if(a.length>1||!c.complete)return null;if(a.length===1){let e=a[0];return{appDir:e,configPath:n??h(e)}}let i=j(t),o=i.directories;if(o.length>1||!i.complete)return null;if(o.length===1){let e=o[0];return{appDir:e,configPath:n??h(e)}}return n?{appDir:t,configPath:n}:null}export{w as a};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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-YLFDA4WW.js";import"./chunk-FRRHCLG2.js";import"./chunk-KLMWLQAO.js";export{a as getCliVersion};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{C as r,D as s,z as t}from"./chunk-4RKTGL63.js";import"./chunk-KLMWLQAO.js";function l(){let e=r();console.log(` product analytics are ${e.productAnalytics?"ON":"OFF"}`),console.log(` config: ${t()}`);let o=process.env.DO_NOT_TRACK;(o==="1"||o==="true")&&console.log(` note: DO_NOT_TRACK=${o} is set \u2014 telemetry is off for this run`)}async function c(e){let o=e.find(n=>!n.startsWith("-"))?.toLowerCase();switch(o){case void 0:case"status":l();return;case"on":s({...r(),productAnalytics:!0}),console.log(" product analytics ON"),console.log(` config: ${t()}`);return;case"off":s({...r(),productAnalytics:!1}),console.log(" product analytics OFF"),console.log(` config: ${t()}`);return;default:console.error(` unknown telemetry action: ${o}`),console.error(" usage: rnx config telemetry [on|off|status]"),process.exit(1)}}function i(){console.log(`
|
|
5
|
-
rnx config \u2014 manage local CLI preferences
|
|
6
|
-
|
|
7
|
-
usage:
|
|
8
|
-
rnx config telemetry [on|off|status]
|
|
9
|
-
|
|
10
|
-
environment:
|
|
11
|
-
SOOTSIM_HINTS=off suppress CLI hints
|
|
12
|
-
SOOTSIM_HINTS=always show every CLI hint every time
|
|
13
|
-
`)}async function d(e){if(e.includes("--help")||e.includes("-h")){i();return}let o=e.find(n=>!n.startsWith("-"));if(o==="telemetry"){let n=e.indexOf(o);await c([...e.slice(0,n),...e.slice(n+1)]);return}console.error(` unknown config command: ${o??"(missing)"}`),i(),process.exit(1)}export{d as runConfig};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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,b,c,d,e,f}from"./chunk-3FYJ7U3C.js";import"./chunk-I7HHBFSD.js";import"./chunk-5FB4EA33.js";import"./chunk-FCHRGEHA.js";import"./chunk-2IPMH24A.js";import"./chunk-JOE3J46E.js";import"./chunk-6IVEGYWV.js";import"./chunk-TMJGPUWJ.js";import"./chunk-G3B2RZ47.js";import"./chunk-6SLM6URN.js";import"./chunk-SW4DV2TY.js";import"./chunk-4RKTGL63.js";import"./chunk-YLFDA4WW.js";import"./chunk-FRRHCLG2.js";import"./chunk-3CMKNWRL.js";import"./chunk-KLMWLQAO.js";export{c as daemonInstall,b as getDaemonServiceStatus,a as runDaemon,e as teardownDaemonService,d as teardownLegacyMacDaemonArtifacts,f as teardownSootsimHome};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import"./chunk-HJHFC5ZZ.js";import{a,b,c,d,e,f,g}from"./chunk-YKKVDKLE.js";import"./chunk-TQ5OPG33.js";import"./chunk-G7S6T5OX.js";import"./chunk-BKMPV6N4.js";import"./chunk-6SLM6URN.js";import"./chunk-4RKTGL63.js";import"./chunk-KLMWLQAO.js";export{c as ALL_DRIVERS,g as buildDriverListRows,a as electronDriver,d as getAllDrivers,e as getDriver,b as playwrightDriver,f as resolveDriver};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c,d,e,f,g,h,i}from"./chunk-R7X74I3I.js";import"./chunk-DASP2EKF.js";import"./chunk-T4T6DDKM.js";import{b as a,c as b}from"./chunk-SAUCA7SN.js";import"./chunk-TQRVLK64.js";import"./chunk-BA3HRFJ5.js";import"./chunk-DC7TS573.js";import"./chunk-HFNESSHG.js";import"./chunk-44LRQEU3.js";import"./chunk-4PFMDBLB.js";import"./chunk-OYLIWHDB.js";import"./chunk-YKKVDKLE.js";import"./chunk-TQ5OPG33.js";import"./chunk-G7S6T5OX.js";import"./chunk-DPJGB7MP.js";import"./chunk-HJXIBZ35.js";import"./chunk-CUVY4A2A.js";import"./chunk-SU7RE3PV.js";import"./chunk-LV2G34IX.js";import"./chunk-ES5BHPTS.js";import"./chunk-RO3WVQPB.js";import"./chunk-RWYA2USN.js";import"./chunk-2EVBZ37G.js";import"./chunk-BJUNXCPO.js";import"./chunk-P3IDK7FR.js";import"./chunk-I7HHBFSD.js";import"./chunk-5FB4EA33.js";import"./chunk-BKMPV6N4.js";import"./chunk-W7EXE22C.js";import"./chunk-JOE3J46E.js";import"./chunk-6IVEGYWV.js";import"./chunk-TMJGPUWJ.js";import"./chunk-G3B2RZ47.js";import"./chunk-6SLM6URN.js";import"./chunk-SW4DV2TY.js";import"./chunk-4RKTGL63.js";import"./chunk-FRRHCLG2.js";import"./chunk-KLMWLQAO.js";export{f as discoverSootsimUrl,c as getLastFlowPreviewUploadResult,d as getLastFlowTraceSteps,h as hoistLeadingSimFlag,a as parseFlowFile,e as resolveAppFrontmatterTarget,g as runFlowPlayback,i as runMaestroAuthoring,b as validateFlowFile};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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,b,c}from"./chunk-FCHRGEHA.js";import"./chunk-2IPMH24A.js";import"./chunk-JOE3J46E.js";import"./chunk-6IVEGYWV.js";import"./chunk-TMJGPUWJ.js";import"./chunk-G3B2RZ47.js";import"./chunk-6SLM6URN.js";import"./chunk-SW4DV2TY.js";import"./chunk-4RKTGL63.js";import"./chunk-YLFDA4WW.js";import"./chunk-FRRHCLG2.js";import"./chunk-3CMKNWRL.js";import"./chunk-KLMWLQAO.js";export{c as printCommandHelp,b as printGroupHelp,a as printHelp};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{i as a,j as b}from"./chunk-SAUCA7SN.js";import"./chunk-TQRVLK64.js";import"./chunk-BA3HRFJ5.js";import"./chunk-DC7TS573.js";import"./chunk-HFNESSHG.js";import"./chunk-44LRQEU3.js";import"./chunk-4PFMDBLB.js";import"./chunk-OYLIWHDB.js";import"./chunk-YKKVDKLE.js";import"./chunk-TQ5OPG33.js";import"./chunk-G7S6T5OX.js";import"./chunk-CUVY4A2A.js";import"./chunk-SU7RE3PV.js";import"./chunk-LV2G34IX.js";import"./chunk-ES5BHPTS.js";import"./chunk-RO3WVQPB.js";import"./chunk-RWYA2USN.js";import"./chunk-2EVBZ37G.js";import"./chunk-BJUNXCPO.js";import"./chunk-P3IDK7FR.js";import"./chunk-BKMPV6N4.js";import"./chunk-W7EXE22C.js";import"./chunk-JOE3J46E.js";import"./chunk-6IVEGYWV.js";import"./chunk-TMJGPUWJ.js";import"./chunk-G3B2RZ47.js";import"./chunk-6SLM6URN.js";import"./chunk-SW4DV2TY.js";import"./chunk-4RKTGL63.js";import"./chunk-FRRHCLG2.js";import"./chunk-KLMWLQAO.js";export{a as printShellPerfReport,b as runInspect};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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-5SCIDXJD.js";import"./chunk-TQ5OPG33.js";import"./chunk-HD6P3W5R.js";import"./chunk-KLMWLQAO.js";export{a as runInstallDesktop};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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 k,d as v}from"./chunk-5FB4EA33.js";import"./chunk-4RKTGL63.js";import{a as b}from"./chunk-FRRHCLG2.js";import"./chunk-KLMWLQAO.js";import{exec as L}from"node:child_process";import{randomBytes as R}from"node:crypto";import P from"node:http";var O=process.env.SOOTSIM_AUTH_ORIGIN||"https://contrast.dev",w="https://contrast.localhost:3000";async function A(r){if(r)return r;if(process.env.SOOTSIM_AUTH_ORIGIN)return process.env.SOOTSIM_AUTH_ORIGIN;if(process.env.SOOTSIM_UPLOAD_ORIGIN)return process.env.SOOTSIM_UPLOAD_ORIGIN;try{if((await fetch(`${w}/api/auth/me`)).ok)return w}catch{}return O}function C(){console.log(`
|
|
5
|
-
rnx login \u2014 sign in so uploads can attach to your account
|
|
6
|
-
|
|
7
|
-
usage:
|
|
8
|
-
rnx login [--origin <url>]
|
|
9
|
-
|
|
10
|
-
options:
|
|
11
|
-
--origin <url> auth host (default: auto)
|
|
12
|
-
prefers ${w} when available, otherwise
|
|
13
|
-
falls back to ${O}
|
|
14
|
-
override with SOOTSIM_AUTH_ORIGIN env var
|
|
15
|
-
-h, --help
|
|
16
|
-
`)}function U(r,e){let t=r.findIndex(m=>m===e);if(t<0)return;let u=r[t+1];return r.splice(t,2),u}function E(r){let e=process.platform==="darwin"?`open "${r}"`:process.platform==="win32"?`start "" "${r}"`:`xdg-open "${r}"`;L(e,t=>{t&&(console.log(" could not open browser automatically."),console.log(` open this URL manually:
|
|
17
|
-
${r}
|
|
18
|
-
`))})}function g(r){return`<!doctype html>
|
|
19
|
-
<html>
|
|
20
|
-
<body style="font-family:system-ui;background:#000;color:#fff;display:flex;align-items:center;justify-content:center;height:100vh;margin:0">
|
|
21
|
-
<div style="max-width:480px;text-align:center">
|
|
22
|
-
<h1 style="font-size:28px;margin:0 0 12px">${b.name}</h1>
|
|
23
|
-
<p style="color:#ccc">${r}</p>
|
|
24
|
-
</div>
|
|
25
|
-
</body>
|
|
26
|
-
</html>`}async function G(r){try{let e=await fetch(`${r.replace(/\/$/,"")}/api/dev-login`,{method:"POST"});if(e.status===403)return{ok:!1,error:"local dev-login unavailable"};if(!e.ok){let u=await e.text().catch(()=>"");return{ok:!1,error:`dev-login ${e.status}: ${u}`}}let t=await e.json();return t.token?{ok:!0,token:t.token,userId:t.user?.id,email:t.email}:{ok:!1,error:"dev-login response missing token"}}catch(e){return{ok:!1,error:e instanceof Error?e.message:"dev-login fetch failed"}}}function M(r){try{let e=new URL(r).hostname.replace(/^\[|\]$/g,"").toLowerCase();return!!(e==="localhost"||/^127(?:\.\d{1,3}){3}$/.test(e)||e==="::1"||e==="0.0.0.0"||e.endsWith(".local")||e.endsWith(".localhost")||e==="host.containers.internal"||e==="host.docker.internal"||e==="host.orb.internal"||e==="host.lima.internal"||e==="fd07:b51a:cc66:f0::fe"||e==="192.168.5.2"||/^192\.168\.(?:64|139)\.1$/.test(e))}catch{return!1}}async function F(r){(r.includes("--help")||r.includes("-h"))&&(C(),process.exit(0));let e=[...r],t=await A(U(e,"--origin"));if(M(t)){console.log(` detected local origin (${t}) \u2014 signing in as dev user`);let n=await G(t);if(n.ok){k({token:n.token,user:n.userId?{id:n.userId,email:n.email}:null,origin:t,source:"cli"});let s=await v(t),d=s?.user?.email||n.email||s?.user?.id||n.userId,{trackCliEvent:a,flushCliTelemetry:f}=await import("./telemetry-FRW7OCYZ.js");a({event:"cli_login_succeeded",identity:{userId:n.userId??s?.user?.id??null},properties:{origin:t,mode:"dev"}}),await f(),console.log(` signed in${d?` as ${d}`:""} (dev)`);return}console.log(` dev-login not available (${n.error}); falling back to browser`)}let u=R(16).toString("hex");{let{trackCliEvent:n,flushCliTelemetry:s}=await import("./telemetry-FRW7OCYZ.js");n({event:"cli_login_started",properties:{origin:t}}),await s()}let m=300*1e3,i=await new Promise(n=>{let s,d=!1,a=c=>{d||(d=!0,clearTimeout(s),n(c),f.close())},f=P.createServer((c,o)=>{try{let l=new URL(c.url||"/","http://127.0.0.1"),S=l.searchParams.get("state"),y=l.searchParams.get("token"),x=l.searchParams.get("email")||void 0,T=l.searchParams.get("userId")||void 0,p=l.searchParams.get("error");if(S!==u){o.statusCode=404,o.end("not found");return}if(o.setHeader("content-type","text/html; charset=utf-8"),p){o.end(g(`sign-in failed: ${p}`)),a({ok:!1,error:p});return}if(!y){o.end(g("missing token. close this tab and retry `rnx login`.")),a({ok:!1,error:"missing token"});return}o.end(g("sign-in complete. you can return to the terminal.")),a({ok:!0,token:y,email:x,userId:T})}catch(l){o.statusCode=500,o.end(g("sign-in callback failed. retry `rnx login`.")),a({ok:!1,error:l instanceof Error?l.message:"callback failed"})}});s=setTimeout(()=>{a({ok:!1,error:"timed out waiting for the browser sign-in (5 minutes). rerun `rnx login` and complete the github authorize screen if it appears."})},m),f.listen(0,"127.0.0.1",()=>{let c=f.address();if(!c||typeof c=="string"){a({ok:!1,error:"failed to bind callback server"});return}let o=new URL(`${t.replace(/\/$/,"")}/auth/sootsim-cli`);o.searchParams.set("state",u),o.searchParams.set("port",String(c.port)),o.searchParams.set("contrast",t),console.log(" opening browser for rnx login..."),console.log(" first time here? github will show an authorize screen. approve it to continue."),console.log(" waiting up to 5 minutes for the browser (ctrl+c to cancel)"),console.log(` if nothing opens, visit:
|
|
27
|
-
${o.toString()}
|
|
28
|
-
`),E(o.toString())})});if(!i.ok){let{trackCliEvent:n,flushCliTelemetry:s}=await import("./telemetry-FRW7OCYZ.js");n({event:"cli_login_failed",properties:{origin:t,error:i.error}}),await s(),console.error(` login failed: ${i.error}`),process.exit(1)}k({token:i.token,user:i.userId?{id:i.userId,email:i.email}:null,origin:t,source:"cli"});let h=await v(t),I=h?.user?.email||i.email||h?.user?.id||i.userId,{trackCliEvent:$,flushCliTelemetry:_}=await import("./telemetry-FRW7OCYZ.js");$({event:"cli_login_succeeded",identity:{userId:i.userId??h?.user?.id??null},properties:{origin:t}}),await _(),console.log(` signed in${I?` as ${I}`:""}`)}export{F as runLogin};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c as r,d as i}from"./chunk-I7HHBFSD.js";import{a as t,c as o}from"./chunk-5FB4EA33.js";import"./chunk-4RKTGL63.js";import"./chunk-KLMWLQAO.js";async function s(){let e=t();if(!e?.token){console.log(" not signed in");return}try{await fetch(`${e.origin.replace(/\/$/,"")}/api/auth/sign-out`,{method:"POST",headers:{authorization:`Bearer ${e.token}`}})}catch{}o(),r({event:"cli_logout",identity:{userId:e.user?.id??null},properties:{origin:e.origin}}),await i(),console.log(" signed out")}export{s as runLogout};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (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-34KDMQ6U.js";import"./chunk-RO3WVQPB.js";import"./chunk-RWYA2USN.js";import"./chunk-G3B2RZ47.js";import"./chunk-6SLM6URN.js";import"./chunk-4RKTGL63.js";import"./chunk-KLMWLQAO.js";export{a as runReset};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.343 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c as a}from"./chunk-VC4TDPJQ.js";import"./chunk-OYLIWHDB.js";import"./chunk-LV2G34IX.js";import"./chunk-W7EXE22C.js";import"./chunk-G3B2RZ47.js";import"./chunk-6SLM6URN.js";import"./chunk-4RKTGL63.js";import"./chunk-FRRHCLG2.js";import"./chunk-KLMWLQAO.js";export{a as runRuntime};
|