rnxsim 0.1.369 → 0.1.371
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/auth.ts +2 -1
- package/cli/bin.ts +283 -273
- package/cli/commands/app-fonts.ts +3 -2
- package/cli/commands/assert.ts +8 -7
- package/cli/commands/auth.ts +2 -1
- package/cli/commands/box/checkout-plane.ts +109 -29
- package/cli/commands/box/cloud-box.ts +294 -0
- package/cli/commands/box/plane-share.ts +208 -0
- package/cli/commands/box/rnx-command.ts +2 -2
- package/cli/commands/box/search-command.ts +157 -0
- package/cli/commands/box.ts +269 -13
- package/cli/commands/config.ts +2 -1
- package/cli/commands/control.ts +43 -34
- package/cli/commands/daemon.ts +22 -21
- package/cli/commands/debug.ts +17 -15
- package/cli/commands/detox.ts +5 -4
- package/cli/commands/device.ts +6 -5
- package/cli/commands/electron.ts +6 -5
- package/cli/commands/flow.ts +12 -11
- package/cli/commands/inspect/find.ts +2 -1
- package/cli/commands/inspect/keyboard.ts +2 -1
- package/cli/commands/inspect/sleep.ts +2 -1
- package/cli/commands/inspect/wait-event.ts +4 -3
- package/cli/commands/inspect/wait-idle.ts +2 -1
- package/cli/commands/inspect/wait-ready.ts +3 -2
- package/cli/commands/inspect/wait-selector.ts +4 -3
- package/cli/commands/inspect/wait.ts +2 -1
- package/cli/commands/inspect.ts +82 -80
- package/cli/commands/install-desktop.ts +5 -4
- package/cli/commands/login.ts +3 -2
- package/cli/commands/mode.ts +2 -1
- package/cli/commands/record.ts +38 -37
- package/cli/commands/runtime.ts +9 -8
- package/cli/commands/screenshot-layers.ts +4 -3
- package/cli/commands/screenshot-mode.ts +2 -1
- package/cli/commands/screenshot.ts +8 -7
- package/cli/commands/screenshots-capture.ts +2 -1
- package/cli/commands/serve.ts +5 -4
- package/cli/commands/shell-boolean-mode.ts +2 -1
- package/cli/commands/skills.ts +11 -10
- package/cli/commands/telemetry.ts +2 -1
- package/cli/commands/three-mode.ts +2 -1
- package/cli/commands/timeline.ts +4 -3
- package/cli/commands/upload.ts +14 -13
- package/cli/commands/what-happened.ts +2 -1
- package/cli/outbound-endpoints.ts +37 -1
- package/cli/recording-access.ts +6 -5
- package/cli/run-rnx.ts +140 -0
- package/dist-cli/bin.js +6 -6
- package/dist-cli/chunks/{agent-OUUFWDLF.js → agent-W2D2V7WF.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-7BE7DR4R.js → agent-wrapper-GVNM2Z4S.js} +2 -2
- package/dist-cli/chunks/app-fonts-J6R4TTXD.js +4 -0
- package/dist-cli/chunks/{assert-I3CMRNS7.js → assert-YN6U4ZTB.js} +11 -11
- package/dist-cli/chunks/auth-XGYZAK2P.js +12 -0
- package/dist-cli/chunks/{beta-BHSKY4K4.js → beta-WRDMHHWJ.js} +2 -2
- package/dist-cli/chunks/{box-3CVWXVTT.js → box-ML5TFUQW.js} +617 -596
- package/dist-cli/chunks/{camera-MNK73TYV.js → camera-OBEI4FZA.js} +2 -2
- package/dist-cli/chunks/{chunk-JXARZBWS.js → chunk-2FIT64GR.js} +1 -1
- package/dist-cli/chunks/{chunk-RYGQ6LZN.js → chunk-2LH4DYPM.js} +2 -2
- package/dist-cli/chunks/chunk-2QW3JH6T.js +99 -0
- package/dist-cli/chunks/{chunk-2APXX4RN.js → chunk-2W4YBCPX.js} +2 -2
- package/dist-cli/chunks/{chunk-X3PEDNLV.js → chunk-42YOIDLR.js} +2 -2
- package/dist-cli/chunks/{chunk-6BMM6OCW.js → chunk-47MSXLWK.js} +2 -2
- package/dist-cli/chunks/chunk-4OLUFHEZ.js +74 -0
- package/dist-cli/chunks/{chunk-WUR4FXWT.js → chunk-5PPVVGLH.js} +25 -25
- package/dist-cli/chunks/{chunk-AKJYEX54.js → chunk-6AZKZ5AJ.js} +2 -2
- package/dist-cli/chunks/{chunk-2PVVIPQS.js → chunk-6FPXLSBJ.js} +1 -1
- package/dist-cli/chunks/{chunk-CCI3DZKE.js → chunk-763GBI7G.js} +2 -2
- package/dist-cli/chunks/{chunk-CZ2HCNRK.js → chunk-7ASCDKA3.js} +1 -1
- package/dist-cli/chunks/{chunk-ZNNE5MAV.js → chunk-7Q4WHJDH.js} +1 -1
- package/dist-cli/chunks/{chunk-IYPMULI7.js → chunk-7TWD4P6J.js} +2 -2
- package/dist-cli/chunks/{chunk-45X3D6CI.js → chunk-7YB46LGI.js} +1 -1
- package/dist-cli/chunks/{chunk-3454VMHD.js → chunk-ADJSGO55.js} +2 -2
- package/dist-cli/chunks/{chunk-F4OTMARL.js → chunk-AGZZWLEL.js} +2 -2
- package/dist-cli/chunks/{chunk-UDXQCEJU.js → chunk-AVIH3TAZ.js} +11 -11
- package/dist-cli/chunks/{chunk-DCPDMF27.js → chunk-B26ZJUQA.js} +2 -2
- package/dist-cli/chunks/{chunk-D6MGELKZ.js → chunk-BNS5LNEU.js} +1 -1
- package/dist-cli/chunks/{chunk-FHRG772G.js → chunk-CJQXP4XM.js} +1 -1
- package/dist-cli/chunks/{chunk-OROUEG22.js → chunk-DP6RGTNN.js} +2 -2
- package/dist-cli/chunks/{chunk-V7I4CTAX.js → chunk-DYFOLOYL.js} +2 -2
- package/dist-cli/chunks/chunk-ERBGQEJ5.js +4 -0
- package/dist-cli/chunks/{chunk-H2GB2PLY.js → chunk-ESWSXF55.js} +2 -2
- package/dist-cli/chunks/{chunk-FGGESBWD.js → chunk-FLNGSIBL.js} +2 -2
- package/dist-cli/chunks/{chunk-4SCVGBOX.js → chunk-GQGS7TRK.js} +1 -1
- package/dist-cli/chunks/{chunk-WGE2P25F.js → chunk-H4DU457S.js} +1 -1
- package/dist-cli/chunks/{chunk-TBK5UXW2.js → chunk-HFY35VAG.js} +2 -2
- package/dist-cli/chunks/{chunk-JLOOLA47.js → chunk-HV3WOWQM.js} +1 -1
- package/dist-cli/chunks/{chunk-RV76U3EI.js → chunk-HZ365EMS.js} +10 -10
- package/dist-cli/chunks/chunk-IPNDXGVA.js +11 -0
- package/dist-cli/chunks/{chunk-TAC4CEIX.js → chunk-IX7Z6ZVJ.js} +2 -2
- package/dist-cli/chunks/{chunk-UQJY6O72.js → chunk-IYU2EOIU.js} +1 -1
- package/dist-cli/chunks/chunk-J6A5W2DI.js +30 -0
- package/dist-cli/chunks/chunk-JKRMBNPO.js +28 -0
- package/dist-cli/chunks/{chunk-VGJLCFSC.js → chunk-JUTLQ3GX.js} +1 -1
- package/dist-cli/chunks/{chunk-5QFJFASW.js → chunk-KHGXEU4L.js} +1 -1
- package/dist-cli/chunks/{chunk-A56GQVNF.js → chunk-KL34TRNW.js} +1 -1
- package/dist-cli/chunks/chunk-LFANRLWK.js +7 -0
- package/dist-cli/chunks/{chunk-NPVEBXU3.js → chunk-MOIQZVRU.js} +2 -2
- package/dist-cli/chunks/chunk-MW4E5EED.js +497 -0
- package/dist-cli/chunks/{chunk-AJJCYLBC.js → chunk-N3LAMTGS.js} +2 -2
- package/dist-cli/chunks/{chunk-QE5MC4V3.js → chunk-NQ4CI2VI.js} +1 -1
- package/dist-cli/chunks/{chunk-6F3WOWFC.js → chunk-OF3U4SZO.js} +2 -2
- package/dist-cli/chunks/{chunk-DKSZZABN.js → chunk-OF5OBB67.js} +1 -1
- package/dist-cli/chunks/{chunk-MXWME7ET.js → chunk-OQPZOEEP.js} +1 -1
- package/dist-cli/chunks/{chunk-SSBZA5VZ.js → chunk-OWDJQWJ7.js} +1 -1
- package/dist-cli/chunks/{chunk-YLNSLMQM.js → chunk-PTWMX4AA.js} +2 -2
- package/dist-cli/chunks/{chunk-TTUZ5MCK.js → chunk-RYJTPZCX.js} +1 -1
- package/dist-cli/chunks/{chunk-A72MIIJI.js → chunk-S3AH2O67.js} +1 -1
- package/dist-cli/chunks/{chunk-ZW6JXEVX.js → chunk-SH2HXHR2.js} +2 -2
- package/dist-cli/chunks/{chunk-EKAEEWC2.js → chunk-SHLJYXIN.js} +1 -1
- package/dist-cli/chunks/{chunk-4G4VCT2M.js → chunk-TL22EBF5.js} +2 -2
- package/dist-cli/chunks/{chunk-LU3AHE6T.js → chunk-TWNLRDIH.js} +2 -2
- package/dist-cli/chunks/{chunk-B5NW4TT3.js → chunk-UHYAY3RU.js} +2 -2
- package/dist-cli/chunks/{chunk-N5KDDGV6.js → chunk-UPMR6Y5P.js} +2 -2
- package/dist-cli/chunks/chunk-VEFSHPSU.js +24 -0
- package/dist-cli/chunks/{chunk-YPBDPVLR.js → chunk-WCB5XPCH.js} +2 -2
- package/dist-cli/chunks/{chunk-USHV3QFZ.js → chunk-WHZE63R2.js} +2 -2
- package/dist-cli/chunks/{chunk-ZEF57HQO.js → chunk-WLRIPAGJ.js} +1 -1
- package/dist-cli/chunks/{chunk-FBMNYSSW.js → chunk-Y7SKGRAV.js} +1 -1
- package/dist-cli/chunks/chunk-Z6CQDU74.js +4 -0
- package/dist-cli/chunks/{cleanup-H4XFRMZV.js → cleanup-PTJBMC34.js} +2 -2
- package/dist-cli/chunks/cli-version-6ZBD6GKP.js +4 -0
- package/dist-cli/chunks/{compat-NKGYERLN.js → compat-FJ2HWRAG.js} +2 -2
- package/dist-cli/chunks/config-PYGH7JPN.js +13 -0
- package/dist-cli/chunks/{connect-WWWAVVCF.js → connect-AJV4PZA4.js} +2 -2
- package/dist-cli/chunks/control-667PAYX4.js +4 -0
- package/dist-cli/chunks/daemon-EIBOHZYQ.js +4 -0
- package/dist-cli/chunks/{debug-RO6GLDIM.js → debug-XF2XUDHN.js} +20 -20
- package/dist-cli/chunks/desktop-HEZYNFYW.js +31 -0
- package/dist-cli/chunks/detox-JCFZJRNE.js +52 -0
- package/dist-cli/chunks/device-KGUVZHFW.js +18 -0
- package/dist-cli/chunks/{diagnose-HDRTUPDO.js → diagnose-KVJQ3TOI.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-QP2NYN43.js → disk-cleanup-7HQXJFUX.js} +2 -2
- package/dist-cli/chunks/{do-chain-6LP6SV5J.js → do-chain-3FYJNA2N.js} +2 -2
- package/dist-cli/chunks/drivers-5S6M5TJB.js +4 -0
- package/dist-cli/chunks/{env-4XD5D2G6.js → env-BX6S2SOM.js} +2 -2
- package/dist-cli/chunks/{film-I5SIXLS5.js → film-2WZUVYFA.js} +3 -3
- package/dist-cli/chunks/flow-6BZSWNHG.js +4 -0
- package/dist-cli/chunks/help-OGJBD4NP.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-LJV2S4M2.js → hidden-runtime-alias-PGF55OFH.js} +2 -2
- package/dist-cli/chunks/{home-paths-RFI2QRC3.js → home-paths-EGRMTSGE.js} +2 -2
- package/dist-cli/chunks/inspect-MZVDGAN4.js +4 -0
- package/dist-cli/chunks/install-desktop-QB76DNZF.js +4 -0
- package/dist-cli/chunks/login-HRFPYPZ3.js +26 -0
- package/dist-cli/chunks/{logout-DKXZZ6HU.js → logout-LRH5HZGP.js} +2 -2
- package/dist-cli/chunks/{maestro-WKGVVWRA.js → maestro-S53T4PPE.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-KCK6RK2C.js → maestro-generate-YKIVKOB3.js} +3 -3
- package/dist-cli/chunks/mode-47JKNUNS.js +26 -0
- package/dist-cli/chunks/{optional-demo-registry-EUSKBIPP.js → optional-demo-registry-ARZSPS5Y.js} +2 -2
- package/dist-cli/chunks/{perf-IMZMA5MT.js → perf-J73OKB4T.js} +2 -2
- package/dist-cli/chunks/{permissions-SLWXTLH6.js → permissions-L3FPI56H.js} +2 -2
- package/dist-cli/chunks/{platform-HQ735LAE.js → platform-YAROAHRM.js} +3 -3
- package/dist-cli/chunks/privacy-JZQCXHKN.js +4 -0
- package/dist-cli/chunks/record-QAQMGYOO.js +72 -0
- package/dist-cli/chunks/report-issue-4FVZCAFQ.js +29 -0
- package/dist-cli/chunks/reset-NYFUFZCG.js +4 -0
- package/dist-cli/chunks/resolve-target-SP22ZGFZ.js +4 -0
- package/dist-cli/chunks/runtime-WTS2QMXZ.js +4 -0
- package/dist-cli/chunks/{screenshot-command-HAJB5FHK.js → screenshot-command-Q5MGGEWY.js} +11 -11
- package/dist-cli/chunks/screenshot-layers-4JW7DRL7.js +20 -0
- package/dist-cli/chunks/screenshots-capture-X5PMO44E.js +42 -0
- package/dist-cli/chunks/{serve-TM46TKFW.js → serve-3JWJ45J3.js} +20 -20
- package/dist-cli/chunks/setup-USPDJESI.js +4 -0
- package/dist-cli/chunks/{sim-client-LQUZSO45.js → sim-client-RL6DGOJE.js} +2 -2
- package/dist-cli/chunks/skills-QNO6GDJB.js +50 -0
- package/dist-cli/chunks/{state-RUVM4Z4S.js → state-OGUCSUC3.js} +2 -2
- package/dist-cli/chunks/{storage-GQ33UTYN.js → storage-TG7KFQZ3.js} +2 -2
- package/dist-cli/chunks/store-ZYMQW2LN.js +4 -0
- package/dist-cli/chunks/telemetry-7CSLUUIW.js +4 -0
- package/dist-cli/chunks/timeline-R4G5P335.js +24 -0
- package/dist-cli/chunks/{upgrade-AZDZLUIT.js → upgrade-RDTXJ6O3.js} +2 -2
- package/dist-cli/chunks/upload-PLF2DPMS.js +4 -0
- package/dist-cli/chunks/{version-N3ALB75G.js → version-GU2NUZDS.js} +2 -2
- package/dist-cli/chunks/{web-XPHFZATA.js → web-7PUVG3GE.js} +2 -2
- package/dist-cli/chunks/welcome-4GGUV7FY.js +5 -0
- package/dist-cli/chunks/what-happened-OHAAX6F6.js +25 -0
- package/dist-cli/chunks/{ws-bridge-RUXOYOU6.js → ws-bridge-Z3O35MNF.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +69 -34
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +430 -106
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +2 -1
- package/dist-lib/react-native-host-modules.mjs +2 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +149 -93
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +757 -353
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/scripts/dev-server-scanner.ts +275 -92
- package/src/dev-bundle-resolution.ts +123 -40
- package/src/host/bridge-host.ts +11 -0
- package/src/host/plane-host.ts +203 -0
- package/src/react-native-host-modules.ts +1 -0
- package/dist-cli/chunks/app-fonts-66V7TL26.js +0 -4
- package/dist-cli/chunks/auth-3FMWUVJH.js +0 -12
- package/dist-cli/chunks/chunk-3NLB5LCN.js +0 -28
- package/dist-cli/chunks/chunk-5RWUFIZW.js +0 -24
- package/dist-cli/chunks/chunk-COXCR6UU.js +0 -7
- package/dist-cli/chunks/chunk-JH5KE2OI.js +0 -4
- package/dist-cli/chunks/chunk-ROISJKH3.js +0 -99
- package/dist-cli/chunks/chunk-SUHAD6N2.js +0 -30
- package/dist-cli/chunks/chunk-TIB3CTRX.js +0 -497
- package/dist-cli/chunks/chunk-YFZLDFZK.js +0 -74
- package/dist-cli/chunks/cli-version-MJWLDXBW.js +0 -4
- package/dist-cli/chunks/config-WK7467KI.js +0 -13
- package/dist-cli/chunks/control-ESI7IZNN.js +0 -4
- package/dist-cli/chunks/daemon-UCLO27YP.js +0 -4
- package/dist-cli/chunks/desktop-FF34Z5X4.js +0 -31
- package/dist-cli/chunks/detox-Q3CWY5UX.js +0 -52
- package/dist-cli/chunks/device-WN4ZWLES.js +0 -18
- package/dist-cli/chunks/drivers-OR2JPAXD.js +0 -4
- package/dist-cli/chunks/flow-4GWW5DYT.js +0 -4
- package/dist-cli/chunks/help-MIIWOT3C.js +0 -4
- package/dist-cli/chunks/inspect-3ZGNJENJ.js +0 -4
- package/dist-cli/chunks/install-desktop-BYOJVTLS.js +0 -4
- package/dist-cli/chunks/login-GNIFSAFE.js +0 -26
- package/dist-cli/chunks/mode-YVMX7OJY.js +0 -26
- package/dist-cli/chunks/privacy-EDC7PF7G.js +0 -4
- package/dist-cli/chunks/record-N4KTTVDI.js +0 -72
- package/dist-cli/chunks/report-issue-PP752HAD.js +0 -29
- package/dist-cli/chunks/reset-DRMKGVP4.js +0 -4
- package/dist-cli/chunks/resolve-target-7WWI32R3.js +0 -4
- package/dist-cli/chunks/runtime-EKJV2ZVI.js +0 -4
- package/dist-cli/chunks/screenshot-layers-GOCJVM2G.js +0 -20
- package/dist-cli/chunks/screenshots-capture-YYJLYA3V.js +0 -42
- package/dist-cli/chunks/setup-FVPVIYE4.js +0 -4
- package/dist-cli/chunks/skills-V5TE57FN.js +0 -50
- package/dist-cli/chunks/store-IKNBDDKM.js +0 -4
- package/dist-cli/chunks/telemetry-2ZVU6WLK.js +0 -4
- package/dist-cli/chunks/timeline-LP7DMJYT.js +0 -24
- package/dist-cli/chunks/upload-DFQK2Q7X.js +0 -4
- package/dist-cli/chunks/welcome-2NFYLWLJ.js +0 -5
- package/dist-cli/chunks/what-happened-EJ5PHKT7.js +0 -25
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.369 | (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 q,b as G,c as Ne}from"./chunk-JH5KE2OI.js";import{c as _e,d as $e}from"./chunk-AKJYEX54.js";import{p as Pe}from"./chunk-UDXQCEJU.js";import{t as Ae,v as Ue,x}from"./chunk-H2GB2PLY.js";import{a as Ie}from"./chunk-MXWME7ET.js";import{createHash as wt}from"crypto";import{readFileSync as b}from"fs";import De from"path";import{gzipSync as me,gunzipSync as Mt}from"zlib";function Fe(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 it,constants as at}from"node:zlib";var lt=9;function Le(e){return it(e,{params:{[at.BROTLI_PARAM_QUALITY]:lt}})}var le={initMs:3e4,putMs:12e4,finalizeMs:18e4};function ue(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 ut(e){let t=ue(le.putMs,`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 ct(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 ut(l),o++,r?.(o,i)}}))}function dt(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 pt(e){return e.replace(/\/+$/,"")}var J=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function Ce(e){let t=pt(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=ue(le.initMs,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let w=await o.text().catch(()=>"");throw new J(`init failed: ${o.status} ${w.slice(0,200)}`,o.status,"init",w)}let i=await o.json(),l=dt(i,e.bundleBytes,e.filesByHash,e.extras);await ct(l,e.concurrency??8,e.onPutProgress);let f=ue(le.finalizeMs,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:f.signal})}finally{f.cancel()}if(!c.ok){let w=await c.text().catch(()=>"");throw new J(`finalize failed: ${c.status} ${w.slice(0,200)}`,c.status,"finalize",w)}let h=await c.json();return{init:i,finalize:h}}function ft(e){return e!==null&&typeof e=="object"?e:null}function Oe(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ce(e){let t=ft(e);return t?t.schemaVersion===1&&Oe(t.t)!==void 0&&Oe(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function mt(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 ze(e){return mt(e,ce)}import{execSync as gt}from"child_process";function pe(e){try{return gt(e,{stdio:["ignore","pipe","ignore"],timeout:3e3,encoding:"utf8"}).trim()||null}catch{return null}}function de(e){let t=e?.trim();return!t||!/^\d+$/.test(t)?null:Number(t)}function ht(){let e=pe("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 fe(){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:de(process.env.CONTRAST_PR_NUMBER)??de(h),pullRequestTitle:s,githubRunId:process.env.GITHUB_RUN_ID?.trim()||null,source:"ci"}}let f=t??pe("git rev-parse --abbrev-ref HEAD"),c=i?null:ht();return{owner:i??c?.owner??null,repo:l??c?.repo??null,branch:f==="HEAD"?null:f,commitSha:r??pe("git rev-parse HEAD"),githubUsername:null,pullRequestNumber:de(process.env.CONTRAST_PR_NUMBER),pullRequestTitle:s,githubRunId:null,source:"cli"}}function Jt(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 Kt(e){return e.auth?e.uploadedShare?!0:e.auth.kind==="github"||process.env.GITHUB_ACTIONS==="true":!1}async function Vt(e){let t=e.auth??q();if(!t)return null;let r=fe(),s=e.owner??(t.kind==="github"?t.owner:null)??r.owner,o=e.repo??(t.kind==="github"?t.repo:null)??r.repo;try{let i=await fetch(`${e.origin.replace(/\/$/,"")}/api/sootsim/test-runs`,{method:"POST",headers:{"content-type":"application/json",authorization:G(t)},body:JSON.stringify({kind:e.kind,source:r.source,name:e.name??void 0,prompt:e.prompt??void 0,summary:e.summary??void 0,status:e.status,failureMessage:e.failureMessage??void 0,previewShareId:e.previewShareId??void 0,owner:s??void 0,repo:o??void 0,branch:r.branch??void 0,commitSha:r.commitSha??void 0,githubUsername:r.githubUsername??void 0,pullRequestNumber:r.pullRequestNumber??void 0,githubRunId:r.githubRunId??void 0,stepCount:e.stepCount??void 0,failedStepIndex:e.failedStepIndex??void 0,durationMs:e.durationMs??void 0,flowYamlSizeBytes:e.flowYamlSizeBytes??void 0})});if(!i.ok){let f=await i.text().catch(()=>"");return console.warn(` warn: run registration failed: /api/sootsim/test-runs ${i.status}${f?`: ${f.slice(0,200)}`:""}`),null}let l=await i.json();return l.run?.id?{id:l.run.id,previewUrl:l.run.previewUrl??null,traceUrl:l.run.traceUrl??null}:(console.warn(" warn: run registration returned no id"),null)}catch(i){return console.warn(` warn: run registration failed: ${i instanceof Error?i.message:String(i)}`),null}}function Tt(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 St(e){let t=JSON.parse(b(e,"utf8"));if(!Array.isArray(t))throw new Error("snapshot manifest must be an array");let r=new Set;return t.map((s,o)=>{if(s===null||typeof s!="object")throw new Error(`snapshot manifest entry ${o} must be an object`);let i=Reflect.get(s,"id"),l=Reflect.get(s,"label"),f=Reflect.get(s,"path"),c=Reflect.get(s,"t");if(typeof i!="string"||!i||r.has(i))throw new Error(`snapshot manifest entry ${o} has an invalid or duplicate id`);if(typeof f!="string"||!f)throw new Error(`snapshot manifest entry ${o} has no PNG path`);if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new Error(`snapshot manifest entry ${o} has an invalid capture time`);r.add(i);let h=b(f);return{meta:{id:i,label:typeof l=="string"&&l?l:i,kind:"interaction",t:Math.round(c),contentType:"image/png",sizeBytes:h.byteLength},bytes:h}})}var Je=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://contrast.dev",Ke=process.env.SOOTSIM_PREVIEW_ORIGIN||Ie.origin;async function vt(e){return e||(process.env.SOOTSIM_UPLOAD_ORIGIN?process.env.SOOTSIM_UPLOAD_ORIGIN:Je)}function $(e){return e.replace(/\/$/,"")}function xt(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 Rt(e){try{let t=new URL(e).hostname.toLowerCase();return t==="contrast.dev"||t.endsWith(".contrast.dev")}catch{return!1}}function kt(e,t){return t?$(t):process.env.SOOTSIM_PREVIEW_ORIGIN?$(process.env.SOOTSIM_PREVIEW_ORIGIN):xt(e)?$(e):Rt(e)?$(Ke):$(e)}function Bt(){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: ${Je})
|
|
13
|
-
override with SOOTSIM_UPLOAD_ORIGIN env var
|
|
14
|
-
--public-origin <url>
|
|
15
|
-
public /preview link origin (default: ${Ke}
|
|
16
|
-
for prod uploads, upload origin for localhost/custom origins).
|
|
17
|
-
override with SOOTSIM_PREVIEW_ORIGIN env var
|
|
18
|
-
--events <path> path to a gzipped events .jsonl.gz file to attach
|
|
19
|
-
required unless --video is present; previews must
|
|
20
|
-
have replay or recording playback data
|
|
21
|
-
--screenshot <path>
|
|
22
|
-
path to a PNG thumbnail to attach to the share
|
|
23
|
-
--snapshot-manifest <path>
|
|
24
|
-
JSON manifest of existing interaction PNGs to attach
|
|
25
|
-
--video <path> path to a mp4/gif flow recording. embedded inline
|
|
26
|
-
in the pr sticky comment served at
|
|
27
|
-
/api/preview/flow-video?id=<share-id>
|
|
28
|
-
--video-duration-ms <ms>
|
|
29
|
-
duration hint for attached flow video
|
|
30
|
-
--timeline-events <path>
|
|
31
|
-
extra trace timeline rows, JSONL or JSONL gz
|
|
32
|
-
--trace-frame-stats <path>
|
|
33
|
-
frame stats JSON returned by the recorder bridge
|
|
34
|
-
--failure-bundle <dir>
|
|
35
|
-
per-failure debug bundle dir written by the flow runner
|
|
36
|
-
(error.json, describe.json, a11y.txt, tree.txt,
|
|
37
|
-
console.json, screenshot.png). uploaded with the share
|
|
38
|
-
so failed CI runs are debuggable from the dashboard
|
|
39
|
-
--owner <org> associate a session upload with a linked org repo
|
|
40
|
-
--repo <repo> repo name for --owner; the signed-in user must belong
|
|
41
|
-
to the local/org team that owns the link
|
|
42
|
-
--billing-kind test_run
|
|
43
|
-
meter this upload as a natural-language test run
|
|
44
|
-
--sim <sim> target a specific sim (see: rnx list)
|
|
45
|
-
--open open the resulting /preview/<id> url in the browser
|
|
46
|
-
--assets-only drop API/JSON/HTML records before upload; keep images,
|
|
47
|
-
fonts, css, js, and binary blobs. live-data demos hit
|
|
48
|
-
the real network at replay time instead of serving
|
|
49
|
-
recorded API snapshots
|
|
50
|
-
-h, --help
|
|
51
|
-
|
|
52
|
-
examples:
|
|
53
|
-
rnx record upload --events ./my-session.jsonl.gz
|
|
54
|
-
rnx record upload --origin https://contrast.localhost:3000 --events ./my-session.jsonl.gz --open
|
|
55
|
-
rnx record upload --video /tmp/sootsim-flow.mp4 --video-duration-ms 12000
|
|
56
|
-
`)}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 He(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 qe(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 Ge(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 Et(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function It(e){try{return new URL(e).searchParams.get("appFonts")||""}catch{return""}}function At(e){try{return new URL(e).searchParams.get("appSplash")||""}catch{return""}}function Ut(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 Pt(e,t){let s=[];for(let o=0;o<t;o+=15e5){let i=Math.min(o+15e5,t),l=await x(e,`(window.__sootsimLastTransformedBundle?.text || "").slice(${o}, ${i})`);if(typeof l!="string")return null;s.push(l)}return s.join("")}function _t(e){return e.recordedDurationMs&&e.recordingStartedAtMs?{since:e.recordingStartedAtMs-1e4,until:e.recordingStartedAtMs+e.recordedDurationMs+5e3,limit:2e3}:{limit:2e3}}function $t(e){let t=b(e),s=(t[0]===31&&t[1]===139?Mt(t):t).toString("utf8");return ze(s)}function Nt(e){return JSON.parse(b(e,"utf8"))}function Ft(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 Lt(e){if(e===null||typeof e!="object")return e;let{samples:t,...r}=e;return r}function ge(e){let t=new Map;for(let r of e)t.set(r.urlhash||r.url,r);return Array.from(t.values())}async function pn(e,t){(e.includes("--help")||e.includes("-h"))&&(Bt(),process.exit(0));let r=[...e],s=await vt(p(r,"--origin")),o=kt(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"),w=p(r,"--trace-frame-stats"),K=p(r,"--failure-bundle"),V=p(r,"--video-duration-ms"),he=je(p(r,"--recorded-duration-ms"),"--recorded-duration-ms"),ye=je(p(r,"--recording-started-at-ms"),"--recording-started-at-ms"),W=p(r,"--owner"),Y=p(r,"--repo"),C=p(r,"--billing-kind"),Ve=p(r,"--run-scope"),We=He(r,"--open");(W&&!Y||!W&&Y)&&(console.error(" --owner and --repo must be provided together"),process.exit(1)),C&&C!=="test_run"&&(console.error(` invalid --billing-kind: ${C}`),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 be=He(r,"--assets-only"),Ye=Ae(r,{stripBooleanFlags:[],stripValueFlags:[]}),M=Ue(Ye),d,we=[],R=[],k=h?$t(h):[],Me=w?Nt(w):null;k.push(...Ft(Me));let Te=k.length,Q=null;try{if(d=await x(M,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),d?.bundleUrl){let u=new URL(d.bundleUrl).origin,[m,U]=await Promise.all([x(M,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(u)}) || [])`),x(M,`(async () => {
|
|
57
|
-
const list = window.__sootsimListWorkerFetchRecorder
|
|
58
|
-
return typeof list === 'function'
|
|
59
|
-
? await list(${JSON.stringify(u)})
|
|
60
|
-
: []
|
|
61
|
-
})()`)]);we=ge([...m,...U]).filter(g=>{try{return!new URL(g.url).pathname.startsWith("/api/")}catch{return!0}});let _=await x(M,`(async () => {
|
|
62
|
-
const rec = window.__sootsimPreviewRecorder
|
|
63
|
-
const workerList = window.__sootsimListWorkerFetchRecorder
|
|
64
|
-
return {
|
|
65
|
-
main: rec?.list ? rec.list() : [],
|
|
66
|
-
worker: typeof workerList === 'function' ? await workerList() : [],
|
|
67
|
-
}
|
|
68
|
-
})()`),L=(_?ge([..._.main,..._.worker]):[]).filter(g=>{try{return new URL(g.url).origin!==u}catch{return!1}}),v=L.length>0?{count:L.length,totalBytes:L.reduce((g,ie)=>g+(ie.size||0),0)}:null;if(v&&v.count>0){console.log(` ${v.count} recorded cross-origin responses (${(v.totalBytes/1024).toFixed(1)} KiB)`);let g=await x(M,`(async () => {
|
|
69
|
-
const rec = window.__sootsimPreviewRecorder
|
|
70
|
-
const workerDump = window.__sootsimDumpWorkerFetchRecorder
|
|
71
|
-
const bundleUrl = ${JSON.stringify(d.bundleUrl)}
|
|
72
|
-
const keep = (r) => {
|
|
73
|
-
try {
|
|
74
|
-
const u = new URL(r.url)
|
|
75
|
-
if (u.origin !== ${JSON.stringify(u)}) return true
|
|
76
|
-
// bundle-origin api responses came from the rewritten
|
|
77
|
-
// /__app-api proxy at record time (re-keyed by the
|
|
78
|
-
// recorder's unwrap step). they need bodies attached the
|
|
79
|
-
// same way as cross-origin records \u2014 direct re-fetch from
|
|
80
|
-
// the dev server lacks the bundle's session cookies.
|
|
81
|
-
if (r.url !== bundleUrl && u.pathname.startsWith('/api/')) return true
|
|
82
|
-
return false
|
|
83
|
-
} catch { return false }
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
main: rec?.dump ? rec.dump().filter(keep) : [],
|
|
87
|
-
worker: typeof workerDump === 'function'
|
|
88
|
-
? (await workerDump()).filter(keep)
|
|
89
|
-
: [],
|
|
90
|
-
}
|
|
91
|
-
})()`);if(R=ge([...g.main,...g.worker]),be){let ie=R.length;R=R.filter(ae=>qe(ae.contentType));let st=v.totalBytes-R.reduce((ae,ot)=>ae+(ot.size||0),0);console.log(` --assets-only: kept ${R.length}/${ie} records (dropped ${(st/1024).toFixed(1)} KiB of API responses)`)}}}d?.transformedBundle&&(Q=await Pt(M,d.transformedBundle.byteLength));let n=await x(M,`(() => {
|
|
92
|
-
const bridge = window.SootSim?.bridges?.timeline ?? window.__sootsimTimeline
|
|
93
|
-
if (!bridge || typeof bridge.recent !== 'function') return null
|
|
94
|
-
return bridge.recent(${JSON.stringify(_t({recordedDurationMs:he,recordingStartedAtMs:ye}))})
|
|
95
|
-
})()`).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:[];k=[...k,...a.filter(ce)].sort((u,m)=>u.t-m.t||u.seq-m.seq)}finally{M.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.
|
|
96
|
-
open the app you want to share first (e.g. rnx open 8082), then run upload.`),process.exit(2));let T,Se=!1;if(Q!==null)T=new TextEncoder().encode(Q),Se=!0,console.log(` using post-transform bundle: ${(T.byteLength/1024).toFixed(1)} KiB`);else{let n=Ut(d.bundleUrl);n!==d.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),T=await Ge(n),console.log(` main bundle: ${(T.byteLength/1024).toFixed(1)} KiB`)}let O=we.filter(n=>n.url!==d.bundleUrl);be&&(O=O.filter(n=>qe(n.contentType))),console.log(` fetching ${O.length} extra files\u2026`);let X=(await Promise.all(O.map(async n=>{try{let a=await Ge(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),Qe=X.reduce((n,a)=>n+a.bytes.byteLength,0);console.log(` ${X.length} extra files: ${(Qe/1024).toFixed(1)} KiB`);let P;i&&(P=b(i)),k.sort((n,a)=>n.t-a.t||n.seq-a.seq);let ve=k.map(n=>JSON.stringify(n)).join(`
|
|
97
|
-
`),Z=me(ve?`${ve}
|
|
98
|
-
`:"");console.log(` trace timeline: ${k.length} events${Te?` (${Te} from runner sidecars)`:""}`);let S;l&&(S=b(l),console.log(` attaching screenshot: ${(S.byteLength/1024).toFixed(1)} KiB`));let N=f?St(f):[];N.length>0&&console.log(` attaching ${N.length} interaction snapshots`);let B,E;if(K){let n=m=>{try{return b(De.join(K,m),"utf8")}catch{return null}},a=m=>{let U=n(m);if(U===null)return null;try{return JSON.parse(U)}catch{return U}},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)&&(B=me(JSON.stringify(u)),console.log(` attaching failure bundle: ${(B.byteLength/1024).toFixed(1)} KiB gz`));try{E=b(De.join(K,"screenshot.png"))}catch{}}let I,F,xe;if(c){if(I=b(c),F=c.endsWith(".mp4")?"video/mp4":c.endsWith(".gif")?"image/gif":void 0,F||(console.error(" preview flow videos must be mp4 or gif"),process.exit(1)),V){let n=Number(V);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${V}`),process.exit(1)),xe=Math.round(n)}console.log(` attaching flow video: ${(I.byteLength/1024).toFixed(1)} KiB (${F})`)}let ee=q(),z=Ne(ee),A=fe();ee||(console.error(" preview uploads need auth."),console.error(" set RNX_API_KEY=sk_rnx_..., run `rnx login`, or use the Contrast github runner."),process.exit(1));let Xe=G(ee),Ze=(()=>{try{return new URL(d.bundleUrl).origin}catch{return null}})(),D=(n,a,u,m,U,_,Ee,L)=>{let v=Fe(_),g=v?me(n):n;return{url:a,urlhash:u,method:m,bodyHash:U,requestVaryHash:L,contentType:_,responseHeaders:Ee,bytes:g,encoding:v?"gzip":void 0}},Re=[],te=It(d.pageHref)||"";if(te){let n=await Pe(te,{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)Re.push(D(Buffer.from(a.bytes),a.url,a.urlhash,"GET","-",a.contentType))}let ke=[],ne=At(d.pageHref)||"";if(ne){let n=await _e(ne,{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)ke.push(D(Buffer.from(a.bytes),a.url,a.urlhash,"GET","-",a.contentType))}let re=[...X.map(n=>D(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...R.map(n=>D(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash)),...Re,...ke],se=Le(T),et=wt("sha256").update(T).digest("hex");console.log(` bundle raw=${(T.byteLength/1024).toFixed(1)} KiB br=${(se.byteLength/1024).toFixed(1)} KiB`);let tt={contentHash:et,bundleSizeBytes:T.byteLength,bundleContentType:Et(d.bundleUrl),bundleEncoding:"br",bundleMinified:!1,bundleOrigin:Ze,runtimeVersion:d.runtimeVersion??void 0,appFonts:te||void 0,appSplash:ne||void 0,entry:d.entry,isTransformed:Se,deviceSpec:d.deviceSpec,installationId:z?.installationId??void 0,repoId:z?.repoId,owner:W??z?.owner??A.owner??void 0,repo:Y??z?.repo??A.repo??void 0,branch:A.branch??void 0,commitSha:A.commitSha??void 0,githubUsername:A.githubUsername??void 0,pullRequestNumber:A.pullRequestNumber??void 0,pullRequestTitle:A.pullRequestTitle??void 0,billingKind:C==="test_run"?"test_run":void 0,runScope:Ve||void 0,files:re.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:P?{sizeBytes:P.byteLength}:void 0,timeline:{sizeBytes:Z.byteLength,encoding:"gzip"},traceFrameStats:Lt(Me),recordedDurationMs:he,recordingStartedAtMs:ye,failureBundle:B?{sizeBytes:B.byteLength,encoding:"gzip"}:void 0,snapshots:(()=>{let n=[];S&&n.push({id:"landing",label:"Landing",kind:"landing",t:0,contentType:"image/png",sizeBytes:S.byteLength}),E&&n.push({id:"failure",label:"Failure",kind:"failure",contentType:"image/png",sizeBytes:E.byteLength});for(let a of N)n.push(a.meta);return n.length>0?n:void 0})(),flowVideo:I&&F?{sizeBytes:I.byteLength,contentType:F,durationMs:xe}:void 0},Be=new Map;for(let n of re)Be.set(n.urlhash,n.bytes);let H=new Map;S&&H.set("landing",S),E&&H.set("failure",E);for(let n of N)H.set(n.meta.id,n.bytes);let nt=Date.now(),y=se.byteLength;for(let n of re)y+=n.bytes.byteLength;P&&(y+=P.byteLength),y+=Z.byteLength,S&&(y+=S.byteLength),E&&(y+=E.byteLength);for(let n of N)y+=n.bytes.byteLength;B&&(y+=B.byteLength),I&&(y+=I.byteLength);let rt=`${$(s)}/api/preview/upload/init`;console.log(` init: ${rt}`);let j;try{let n=await Ce({originBase:s,initBody:tt,bundleBytes:se,filesByHash:Be,extras:{eventsBytes:P,timelineBytes:Z,videoBytes:I,failureBundleBytes:B,snapshotBytes:H},authHeader:Xe,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()-nt}ms (${(y/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."),process.exit(1)),a.status===402&&(console.error(` ${Tt(a.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),process.exit(1)),console.error(` ${a.message??`${a.phase??"upload"} failed: ${String(n)}`}`),process.exit(1)}let oe=`${o}${j.url}`;return console.log(`
|
|
99
|
-
stored ${j.filesStored??0} extra files`),console.log(` preview: ${oe}`),We&&await $e(oe),{previewUrl:oe,shareId:j.id}}export{fe as a,Jt as b,Kt as c,Vt as d,vt as e,kt as f,pn as g};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.369 | (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 $}from"./chunk-USHV3QFZ.js";import{q as x}from"./chunk-H2GB2PLY.js";import{b as y,c as R,d as f,e as w,f as a}from"./chunk-IYPMULI7.js";import{L as g,M as u,N as d,T as h,l as p}from"./chunk-FBMNYSSW.js";import O from"fs";import{WebSocket as E}from"ws";function C(t){if(!t||typeof t!="object")return!1;let e=Reflect.get(t,"sections");return typeof Reflect.get(t,"title")=="string"&&Array.isArray(e)&&e.every(o=>o&&typeof o=="object"&&typeof Reflect.get(o,"title")=="string"&&Array.isArray(Reflect.get(o,"items"))&&Reflect.get(o,"items").every(n=>n&&typeof n=="object"&&typeof Reflect.get(n,"summary")=="string"&&typeof Reflect.get(n,"hash")=="string"))}async function b(t,e=fetch){try{let o=new URL(w);o.searchParams.set("version",t);let n=await e(o,{headers:{accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(!n.ok)return null;let s=await n.json();if(!s||typeof s!="object")return null;let i=Reflect.get(s,"entries");return!Array.isArray(i)||!C(i[0])?null:i[0]}catch{return null}}function A(t,e){let o=[`what's new in rnx engine v${t}:`];if(!e||e.sections.length===0)o.push(" release notes are not available yet");else for(let n of e.sections){o.push(` ${n.title}:`);for(let s of n.items)o.push(` \u2022 ${s.summary}`)}return o.push(` full changelog: ${f}`),o.join(`
|
|
5
|
-
`)}async function Q(t,e={}){let[o,...n]=t;if(!o||o==="--help"||o==="-h"){S();return}switch(o){case"install":return L(n,e);case"list":return j(n);case"use":return T(n);case"remove":return D(n);case"which":return G();case"notes":return U(n);default:console.error(` unknown runtime subcommand: ${o}`),S(),process.exit(1)}}function S(){console.log(`
|
|
6
|
-
rnx runtime \u2014 manage engine runtimes under ~/.sootsim/runtimes/
|
|
7
|
-
|
|
8
|
-
usage:
|
|
9
|
-
rnx runtime install [version] install a version (default: channel latest)
|
|
10
|
-
rnx runtime list show installed + available versions
|
|
11
|
-
rnx runtime use <version> switch active runtime
|
|
12
|
-
rnx runtime remove <version> delete an installed runtime
|
|
13
|
-
rnx runtime which print active runtime version
|
|
14
|
-
rnx runtime notes print repo or default engine release notes
|
|
15
|
-
|
|
16
|
-
flags:
|
|
17
|
-
--channel <name> channel to resolve 'latest' from (default: stable)
|
|
18
|
-
--force reinstall even if the version is already on disk
|
|
19
|
-
--set-active=false do not switch active runtime after install
|
|
20
|
-
|
|
21
|
-
environment:
|
|
22
|
-
SOOTSIM_CDN_ORIGIN override the CDN base URL (default: ${R})
|
|
23
|
-
|
|
24
|
-
examples:
|
|
25
|
-
rnx runtime install
|
|
26
|
-
rnx runtime install 1.2.3
|
|
27
|
-
rnx runtime install --channel beta
|
|
28
|
-
rnx runtime use 1.2.3
|
|
29
|
-
rnx runtime notes
|
|
30
|
-
`)}async function L(t,e){let{version:o,flags:n}=F(t),s=n.channel??e.channel??"stable",i=n.force===!0,l=n.setActive!==!1;g(),console.log("rnx runtime install"),console.log(` cdn: ${a.resolveCdnOrigin()}`);try{let r=await a.install({version:o,channel:s,force:i,setActive:l,protectVersions:h()});return console.log(` version: ${r.version} (channel: ${r.channel})`),r.installed?console.log(` installed ${r.version}`):console.log(` already installed at ${r.runtimeDir}`),l&&await k(r.version),r}catch(r){console.error(` ${I(r)}`),process.exit(1)}}async function k(t){d(t),console.log(` active: ${t}`),await _(t)||console.log(` (no daemon running \u2014 next sootsim/electron launch will pick up ${t})`)}async function _(t){let{isDaemonLockfileFresh:e,readDaemonLockfile:o}=await import("./home-paths-RFI2QRC3.js"),n=o();if(!e(n))return!1;let s=x();return new Promise(i=>{let l=!1,r=!1,m=N=>{l||(l=!0,i(N))},c=new E(`ws://127.0.0.1:${s}`,{handshakeTimeout:800}),v=setTimeout(()=>{try{c.close()}catch{}m(r)},1500);c.on("open",()=>{try{c.send(JSON.stringify({type:"runtime:use",version:t,id:0})),r=!0}catch{}setTimeout(()=>{try{c.close()}catch{}},100)}),c.on("close",()=>{clearTimeout(v),m(r)}),c.on("error",()=>{clearTimeout(v),m(!1)})})}async function j(t){g();let e=a.listInstalled(),o=u();if(console.log("installed:"),e.length===0)console.log(" (none)");else for(let n of e)console.log(` ${n===o?"*":" "} ${n}`);try{let n=await a.fetchManifest();console.log("available (latest per channel):");for(let[i,l]of Object.entries(n.channels))console.log(` ${i.padEnd(8)} ${l.latest}`);let s=Object.keys(n.versions).sort(y).reverse();if(s.length>1){console.log("hosted versions:");for(let i of s)console.log(` ${i}`)}}catch(n){console.log(`available: (could not fetch manifest: ${I(n)})`)}}async function T(t){let e=t[0];e||(console.error(" usage: rnx runtime use <version>"),process.exit(1));let o=a.listInstalled();o.includes(e)||(console.error(` version ${e} is not installed`),console.error(` installed: ${o.join(", ")||"(none)"}`),console.error(` run \`rnx runtime install ${e}\` first`),process.exit(1)),await k(e)}async function D(t){let e=t[0];e||(console.error(" usage: rnx runtime remove <version>"),process.exit(1)),u()===e&&(console.error(` cannot remove active runtime ${e}`),console.error(" switch with `rnx runtime use <other>` first, or install another version"),process.exit(1)),h().includes(e)&&(console.error(` cannot remove runtime ${e} while a project is using it`),process.exit(1));let n=p(e);if(!O.existsSync(n)){console.error(` ${e} is not installed`);return}O.rmSync(n,{recursive:!0,force:!0}),console.log(` removed ${e}`)}async function G(){let t=u();if(!t){console.log(" no active runtime");return}console.log(t)}async function U(t){t.length>0&&(console.error(" usage: rnx runtime notes"),process.exit(1));let{config:e}=await $(),o=e?.runtimeVersion??u();if(!o){console.log(" no active runtime"),console.log(` release notes: ${f}`);return}console.log(A(o,await b(o)))}function F(t){let e={},o=[];for(let n=0;n<t.length;n++){let s=t[n];if(s==="--channel"&&n+1<t.length){e.channel=t[n+1],n++;continue}if(s.startsWith("--channel=")){e.channel=s.slice(10);continue}if(s==="--force"){e.force=!0;continue}if(s==="--set-active=false"||s==="--no-set-active"){e.setActive=!1;continue}o.push(s)}return{version:o[0]??null,flags:e}}function I(t){return t instanceof Error?t.message:String(t)}export{b as a,A as b,Q as c};
|