rnxsim 0.1.368 → 0.1.370
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 +49 -16
- package/cli/commands/compat.ts +93 -4
- package/cli/commands/config.ts +2 -1
- package/cli/commands/control.ts +37 -33
- package/cli/commands/daemon.ts +22 -21
- package/cli/commands/debug.ts +17 -15
- package/cli/commands/detect.ts +11 -7
- 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/recording-access.ts +6 -5
- package/cli/run-rnx.ts +140 -0
- package/dist-cli/bin.js +6 -6
- package/dist-cli/chunks/{agent-GXCQMYV4.js → agent-3R4424LW.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-Y3PQAL6I.js → agent-wrapper-4PPWZWSY.js} +2 -2
- package/dist-cli/chunks/app-fonts-KYXB6CXQ.js +4 -0
- package/dist-cli/chunks/{assert-BSRQBRH7.js → assert-7EZOWGYQ.js} +11 -11
- package/dist-cli/chunks/auth-L7M36H6C.js +12 -0
- package/dist-cli/chunks/{beta-R4IZ5SWO.js → beta-FKAF6YWJ.js} +2 -2
- package/dist-cli/chunks/{box-2NQYYY3B.js → box-5Y5VBMHV.js} +62 -62
- package/dist-cli/chunks/{camera-ER66WWAX.js → camera-XHF2RPFG.js} +2 -2
- package/dist-cli/chunks/{chunk-UBH2BWCY.js → chunk-2FOGXVOK.js} +2 -2
- package/dist-cli/chunks/{chunk-7B22IPSC.js → chunk-3BG6UCQY.js} +2 -2
- package/dist-cli/chunks/{chunk-IXRVFQMT.js → chunk-3SOPYG7S.js} +2 -2
- package/dist-cli/chunks/{chunk-7V3S2DY2.js → chunk-3UXXYJVD.js} +1 -1
- package/dist-cli/chunks/{chunk-3MPFC3DS.js → chunk-5BR33NAZ.js} +1 -1
- package/dist-cli/chunks/{chunk-BWJOLJOK.js → chunk-5RKRVS5A.js} +2 -2
- package/dist-cli/chunks/{chunk-WVVAYLWZ.js → chunk-64JAEJ6N.js} +1 -1
- package/dist-cli/chunks/{chunk-GXHCJRKE.js → chunk-6A6L3VJR.js} +2 -2
- package/dist-cli/chunks/chunk-6GPS7U4X.js +74 -0
- package/dist-cli/chunks/{chunk-JHYXRORU.js → chunk-6S5LJV2O.js} +2 -2
- package/dist-cli/chunks/{chunk-TOE5O6JE.js → chunk-6W4HIWC7.js} +2 -2
- package/dist-cli/chunks/{chunk-ESVUVW3R.js → chunk-72S5FCBY.js} +2 -2
- package/dist-cli/chunks/{chunk-TC6DNQL6.js → chunk-7C7TJYZ3.js} +2 -2
- package/dist-cli/chunks/{chunk-M7COA4BE.js → chunk-AALKIAUZ.js} +1 -1
- package/dist-cli/chunks/{chunk-CKNNO6ZG.js → chunk-ARMXC3C3.js} +25 -25
- package/dist-cli/chunks/chunk-AVJBT5LF.js +4 -0
- package/dist-cli/chunks/chunk-BMIJZNKD.js +28 -0
- package/dist-cli/chunks/{chunk-FSPZY4AI.js → chunk-C7BA5CCM.js} +2 -2
- package/dist-cli/chunks/{chunk-EHA65UVJ.js → chunk-CMVRTZ5G.js} +2 -2
- package/dist-cli/chunks/chunk-D24EOJ4C.js +24 -0
- package/dist-cli/chunks/{chunk-3XMEIZEV.js → chunk-D2GZASRV.js} +1 -1
- package/dist-cli/chunks/{chunk-3S2J6IVC.js → chunk-DHYTRCIP.js} +2 -2
- package/dist-cli/chunks/{chunk-QMVBWZH2.js → chunk-DMHSD6YJ.js} +2 -2
- package/dist-cli/chunks/{chunk-NGWUGNPV.js → chunk-DUXHYPBP.js} +2 -2
- package/dist-cli/chunks/{chunk-4FLQYRGN.js → chunk-DXV37CJN.js} +1 -1
- package/dist-cli/chunks/{chunk-T2MGLXY5.js → chunk-EOIBLKZO.js} +2 -2
- package/dist-cli/chunks/{chunk-PNBQBBG5.js → chunk-EQ3OE2AV.js} +1 -1
- package/dist-cli/chunks/{chunk-WFAFAGMG.js → chunk-EWSWOWXK.js} +2 -2
- package/dist-cli/chunks/{chunk-HKQXGCQT.js → chunk-FA75F34Z.js} +1 -1
- package/dist-cli/chunks/{chunk-NERY6HGZ.js → chunk-FK4JSTZ3.js} +2 -2
- package/dist-cli/chunks/{chunk-NPSPWMBO.js → chunk-GJRLPJQL.js} +2 -2
- package/dist-cli/chunks/{chunk-TPIPKXJL.js → chunk-GRO74J2X.js} +1 -1
- package/dist-cli/chunks/chunk-H5X5FJ63.js +99 -0
- package/dist-cli/chunks/chunk-HEKHLQ3B.js +497 -0
- package/dist-cli/chunks/chunk-HQQTS2CB.js +30 -0
- package/dist-cli/chunks/{chunk-Q65KH25G.js → chunk-I52NT6VG.js} +1 -1
- package/dist-cli/chunks/{chunk-AUPJX4KI.js → chunk-IDLFVRPN.js} +1 -1
- package/dist-cli/chunks/{chunk-LAKWOJ5Y.js → chunk-JZLDHPB7.js} +2 -2
- package/dist-cli/chunks/{chunk-WJQB6AXZ.js → chunk-LIMWG54N.js} +1 -1
- package/dist-cli/chunks/{chunk-TE645QCO.js → chunk-LUOHRBJG.js} +1 -1
- package/dist-cli/chunks/{chunk-DJSPNOF6.js → chunk-LXPHL6FO.js} +2 -2
- package/dist-cli/chunks/{chunk-ECXDCED5.js → chunk-MDCY532E.js} +2 -2
- package/dist-cli/chunks/{chunk-4VA2ISWX.js → chunk-NJMU5BN6.js} +1 -1
- package/dist-cli/chunks/{chunk-RRALQ4WM.js → chunk-NR2V2ONN.js} +2 -2
- package/dist-cli/chunks/{chunk-SHMLYTNH.js → chunk-NTC46LSA.js} +2 -2
- package/dist-cli/chunks/{chunk-X5MXQB3L.js → chunk-O6QLKSAM.js} +10 -10
- package/dist-cli/chunks/{chunk-LPAOOJIW.js → chunk-OJZHECGH.js} +1 -1
- package/dist-cli/chunks/chunk-OTFTMGAL.js +7 -0
- package/dist-cli/chunks/{chunk-QKOY7UW5.js → chunk-PAUEZO6F.js} +2 -2
- package/dist-cli/chunks/{chunk-WXRDFUR7.js → chunk-PIZXOXBL.js} +2 -2
- package/dist-cli/chunks/{chunk-WF2CRNYF.js → chunk-PNOENVMJ.js} +1 -1
- package/dist-cli/chunks/{chunk-FDAFSRQE.js → chunk-Q4MRJ6PO.js} +2 -2
- package/dist-cli/chunks/{chunk-SSUPPM6K.js → chunk-RRX52O37.js} +1 -1
- package/dist-cli/chunks/{chunk-E6XYIIJK.js → chunk-U63T6LIQ.js} +1 -1
- package/dist-cli/chunks/{chunk-OZJMWTGA.js → chunk-UFVAAWGZ.js} +1 -1
- package/dist-cli/chunks/{chunk-GS5VUDCF.js → chunk-VVQCZ42C.js} +1 -1
- package/dist-cli/chunks/{chunk-MCO7V4VN.js → chunk-WFQHT4QD.js} +2 -2
- package/dist-cli/chunks/{chunk-JFGW75UL.js → chunk-WPV4H5S4.js} +2 -2
- package/dist-cli/chunks/{chunk-OXCDE3DD.js → chunk-X6WQ4YWE.js} +1 -1
- package/dist-cli/chunks/{chunk-FVODUDPS.js → chunk-YIZGNT7A.js} +1 -1
- package/dist-cli/chunks/{chunk-MGOAQHMO.js → chunk-Z2VBSNFI.js} +2 -2
- package/dist-cli/chunks/{chunk-GFWUIGGY.js → chunk-Z3DENGXW.js} +2 -2
- package/dist-cli/chunks/{cleanup-WHGLBAJ2.js → cleanup-MXMMJ7JW.js} +2 -2
- package/dist-cli/chunks/cli-version-MLS55UTY.js +4 -0
- package/dist-cli/chunks/compat-E6KE5KDI.js +23 -0
- package/dist-cli/chunks/config-QSLLVZDS.js +13 -0
- package/dist-cli/chunks/{connect-N4FV3DDV.js → connect-QE4VU6GB.js} +2 -2
- package/dist-cli/chunks/control-XD5F6K5T.js +4 -0
- package/dist-cli/chunks/daemon-UN5SE2JO.js +4 -0
- package/dist-cli/chunks/{debug-AHEK43AJ.js → debug-5FG3MBJS.js} +20 -20
- package/dist-cli/chunks/desktop-5EZX7NX5.js +31 -0
- package/dist-cli/chunks/detox-WJGQP5TM.js +52 -0
- package/dist-cli/chunks/device-D7LKCAMS.js +18 -0
- package/dist-cli/chunks/{diagnose-WDP3CVIX.js → diagnose-A3W6ZTGA.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-JRT5MKFW.js → disk-cleanup-BDRHX5ZG.js} +2 -2
- package/dist-cli/chunks/{do-chain-7FDMO56C.js → do-chain-RUJNRPPF.js} +2 -2
- package/dist-cli/chunks/drivers-3NJ5RL6X.js +4 -0
- package/dist-cli/chunks/{env-YIBOMB24.js → env-U67SQVTV.js} +2 -2
- package/dist-cli/chunks/{film-R3EQADMG.js → film-XC6UAQ3V.js} +3 -3
- package/dist-cli/chunks/flow-FHZZD3P6.js +4 -0
- package/dist-cli/chunks/help-BYYDUSXF.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-6M4UERRQ.js → hidden-runtime-alias-7S2TNZXG.js} +2 -2
- package/dist-cli/chunks/{home-paths-QJNOHZJO.js → home-paths-LMO5LB4F.js} +2 -2
- package/dist-cli/chunks/inspect-RQCTWDCC.js +4 -0
- package/dist-cli/chunks/install-desktop-GOWXCQUE.js +4 -0
- package/dist-cli/chunks/login-JIU42S4C.js +26 -0
- package/dist-cli/chunks/{logout-VNJX2IEW.js → logout-JTAWQXZO.js} +2 -2
- package/dist-cli/chunks/{maestro-SQS2OS2D.js → maestro-TYBQYOGB.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-GWVPISG5.js → maestro-generate-YLAGWVKE.js} +3 -3
- package/dist-cli/chunks/mode-DV24ZRZ6.js +26 -0
- package/dist-cli/chunks/{optional-demo-registry-L3LRBQHG.js → optional-demo-registry-JZH66VIM.js} +2 -2
- package/dist-cli/chunks/{perf-XLPC4UKR.js → perf-LXXJ4EAX.js} +2 -2
- package/dist-cli/chunks/{permissions-QRHWVMDP.js → permissions-KAOVZUPW.js} +2 -2
- package/dist-cli/chunks/{platform-F47URZNB.js → platform-KW35446W.js} +3 -3
- package/dist-cli/chunks/privacy-MIFE72CG.js +4 -0
- package/dist-cli/chunks/record-EK3ETFHZ.js +72 -0
- package/dist-cli/chunks/report-issue-NW5PCAZF.js +29 -0
- package/dist-cli/chunks/reset-RZ4O5AFJ.js +4 -0
- package/dist-cli/chunks/resolve-target-7R5BNYMM.js +4 -0
- package/dist-cli/chunks/runtime-MZHLSRS6.js +4 -0
- package/dist-cli/chunks/{screenshot-command-RK7IJHVK.js → screenshot-command-TQSPTFT2.js} +11 -11
- package/dist-cli/chunks/screenshot-layers-IZP3L3AQ.js +20 -0
- package/dist-cli/chunks/screenshots-capture-K7LJOVAE.js +42 -0
- package/dist-cli/chunks/{serve-UBXNGLNP.js → serve-MMX4WXXG.js} +18 -18
- package/dist-cli/chunks/setup-YFP3KEQZ.js +4 -0
- package/dist-cli/chunks/{sim-client-VTKFEDJX.js → sim-client-KLAYIFOC.js} +2 -2
- package/dist-cli/chunks/skills-N4D3POIS.js +50 -0
- package/dist-cli/chunks/{state-273XJPUE.js → state-ES6TFQZF.js} +2 -2
- package/dist-cli/chunks/{storage-RTDFWIY7.js → storage-52DR5V2C.js} +2 -2
- package/dist-cli/chunks/store-HOL45WCI.js +4 -0
- package/dist-cli/chunks/telemetry-BV6OTYPF.js +4 -0
- package/dist-cli/chunks/timeline-NRVNB5JR.js +24 -0
- package/dist-cli/chunks/{upgrade-R74NVHKG.js → upgrade-LNED5YQ2.js} +2 -2
- package/dist-cli/chunks/upload-RXKHFIBU.js +4 -0
- package/dist-cli/chunks/{version-RTFCYQZ7.js → version-VEF2DYGG.js} +2 -2
- package/dist-cli/chunks/{web-35SSKBRU.js → web-CGDE6S73.js} +2 -2
- package/dist-cli/chunks/welcome-FT2AMUWW.js +5 -0
- package/dist-cli/chunks/what-happened-FSIDWL32.js +25 -0
- package/dist-cli/chunks/{ws-bridge-JXQUAWFA.js → ws-bridge-QXFQLRE7.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 +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +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 +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +560 -48
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/react-native-host-modules.ts +1 -0
- package/dist-cli/chunks/app-fonts-MDD3W4VN.js +0 -4
- package/dist-cli/chunks/auth-SLPHDPCF.js +0 -12
- package/dist-cli/chunks/chunk-2YK5J2D2.js +0 -24
- package/dist-cli/chunks/chunk-42TLK75A.js +0 -497
- package/dist-cli/chunks/chunk-57LITN73.js +0 -7
- package/dist-cli/chunks/chunk-T4ZZ26A2.js +0 -28
- package/dist-cli/chunks/chunk-UXROQPIN.js +0 -30
- package/dist-cli/chunks/chunk-YSHJ3LMQ.js +0 -74
- package/dist-cli/chunks/chunk-YYPTSF6W.js +0 -99
- package/dist-cli/chunks/cli-version-DMXIXBIM.js +0 -4
- package/dist-cli/chunks/compat-MGBKGYGQ.js +0 -20
- package/dist-cli/chunks/config-TRDOMP4T.js +0 -13
- package/dist-cli/chunks/control-5GRBZVYK.js +0 -4
- package/dist-cli/chunks/daemon-MBT5E3ZC.js +0 -4
- package/dist-cli/chunks/desktop-LDRIXOVV.js +0 -31
- package/dist-cli/chunks/detox-6HAKYISO.js +0 -52
- package/dist-cli/chunks/device-QM3S7OVU.js +0 -18
- package/dist-cli/chunks/drivers-AJL2EVXH.js +0 -4
- package/dist-cli/chunks/flow-BDAA6BWL.js +0 -4
- package/dist-cli/chunks/help-5EJD6LJF.js +0 -4
- package/dist-cli/chunks/inspect-S3LR3R2A.js +0 -4
- package/dist-cli/chunks/install-desktop-GXE6K7BJ.js +0 -4
- package/dist-cli/chunks/login-ISWDW4WU.js +0 -26
- package/dist-cli/chunks/mode-3URDGBZB.js +0 -26
- package/dist-cli/chunks/privacy-BF23T67T.js +0 -4
- package/dist-cli/chunks/record-2DN3OUE5.js +0 -72
- package/dist-cli/chunks/report-issue-D3BQPSLU.js +0 -29
- package/dist-cli/chunks/reset-T5CNZ7D3.js +0 -4
- package/dist-cli/chunks/resolve-target-KAAS274S.js +0 -4
- package/dist-cli/chunks/runtime-AQJDBR3X.js +0 -4
- package/dist-cli/chunks/screenshot-layers-DP2QKSMN.js +0 -20
- package/dist-cli/chunks/screenshots-capture-MA7P3FUT.js +0 -42
- package/dist-cli/chunks/setup-GH7OW4GC.js +0 -4
- package/dist-cli/chunks/skills-HPK25R4B.js +0 -50
- package/dist-cli/chunks/store-DLKNNM4L.js +0 -4
- package/dist-cli/chunks/telemetry-7CWDXEOO.js +0 -4
- package/dist-cli/chunks/timeline-IF2PGK7C.js +0 -24
- package/dist-cli/chunks/upload-3JFFVCZ4.js +0 -4
- package/dist-cli/chunks/welcome-N5V352SE.js +0 -5
- package/dist-cli/chunks/what-happened-WXTP6EPR.js +0 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var o=/^[A-Za-z][A-Za-z0-9+.-]*:/;function s(e){let t=e.trim();if(!t)throw new Error("expected <url-or-route>");return o.test(t)||t.startsWith("/")?t:`/${t}`}function p(e){let t=e.trim();return t?t.startsWith("/")?!0:o.test(t)?!/^https?:\/\//i.test(t):!1:!1}async function c(e,t){let n=s(t),r=await e.send({type:"call",path:"SootSim.bridges.test.openDeepLink",args:[n]});if(r!==null&&typeof r=="object"&&Reflect.get(r,"ok")===!1){let i=Reflect.get(r,"error");throw new Error(typeof i=="string"?i:"deep-link dispatch failed")}return n}export{p as a,c as b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{L as F,M as j,N as H,k as N,l as U,v as _,z as E}from"./chunk-
|
|
4
|
+
import{L as F,M as j,N as H,k as N,l as U,v as _,z as E}from"./chunk-U63T6LIQ.js";import{a as L}from"./chunk-64JAEJ6N.js";import G from"node:fs";import Z from"node:path";function A(e){return e.length<=100&&/^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(e)}function D(e){try{return G.readdirSync(e.runtimesDir(),{withFileTypes:!0}).filter(c=>c.isDirectory()).map(c=>c.name).sort(k)}catch{return[]}}function M(e,c){return Z.posix.basename(e.tarballPath(c))}function k(e,c){let l=f=>{let v=f.indexOf("-"),V=v>=0?f.slice(0,v):f,T=v>=0?f.slice(v+1):"",$=V.split(".").map(S=>Number.parseInt(S,10));return $.some(S=>!Number.isFinite(S))?[[Number.POSITIVE_INFINITY],f]:[$,T]},[m,u]=l(e),[R,x]=l(c);for(let f=0;f<Math.max(m.length,R.length);f++){let v=m[f]??0,V=R[f]??0;if(v!==V)return v-V}return u===x?0:u?x?u<x?-1:1:-1:1}import{spawn as B}from"node:child_process";import J from"node:crypto";import o from"node:fs";import Y from"node:os";import y from"node:path";import{Readable as q}from"node:stream";import{pipeline as K}from"node:stream/promises";var Q=2;function W(e){function c(){try{let n=JSON.parse(o.readFileSync(e.configFile(),"utf8"));return n&&typeof n=="object"?n:{}}catch{return{}}}function l(n){let t=c();return(n||process.env[e.env.cdnOrigin]||t.cdnOrigin||e.defaultCdnOrigin).replace(/\/+$/,"")}function m(n){let t=c();return n||process.env[e.env.channel]||t.runtimeChannel||"stable"}function u(){if(!e.env.pin)return null;let n=process.env[e.env.pin];if(n&&n.trim())return n.trim();let t=c();return typeof t.runtimeVersion=="string"&&t.runtimeVersion.trim()?t.runtimeVersion.trim():null}function R(n){let t=new URL(`${l(n)}${e.manifestPath}`);return t.searchParams.set("t",String(Date.now())),t.toString()}function x(n,t){return`${l(t)}${e.tarballPath(n)}`}async function f(n){let t=R(n),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function v(n,t={}){let r=m(t.channel),i=t.version||u()||n.channels[r]?.latest;if(!i)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);if(!A(i))throw new Error(`invalid runtime version: ${i}`);let h=n.versions[i];if(!h)throw new Error(`version ${i} not found in manifest; available: ${Object.keys(n.versions).slice(-10).join(", ")||"(none)"}`);return{version:i,channel:r,entry:h}}async function V(n={}){e.ensureHome();let t=l(n.cdnOrigin),r=await f(t),{version:i,channel:h,entry:a}=v(r,n),d=e.runtimeDir(i),g=n.setActive!==!1,O=[i,...n.protectVersions??[]];if(I({protectVersions:O}),!n.force&&o.existsSync(y.join(d,e.installedMarker)))return g&&e.writeActiveRuntime(i),I({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!1,activated:g,manifest:r};let P=a.tarball||x(i,t),b=o.mkdtempSync(y.join(Y.tmpdir(),`${e.id}-runtime-download-`)),w=y.join(b,M(e,i)),p=y.join(y.dirname(d),`.installing-${i}-${process.pid}`);o.rmSync(p,{recursive:!0,force:!0});try{process.stderr.write(`${e.id}: downloading runtime ${i}\u2026
|
|
5
5
|
`),await X(P,w),process.stderr.write(`${e.id}: extracting runtime ${i}\u2026
|
|
6
6
|
`);let s=await ee(w);if(s!==a.sha256)throw new Error(`sha256 mismatch for runtime ${i}: expected ${a.sha256}, actual ${s}`);if(o.mkdirSync(p,{recursive:!0}),await ne(w,p),!o.existsSync(y.join(p,e.installedMarker)))throw new Error(`extracted tarball for runtime ${i} is missing ${e.installedMarker}`);o.rmSync(d,{recursive:!0,force:!0}),o.renameSync(p,d)}catch(s){throw o.rmSync(p,{recursive:!0,force:!0}),s}finally{o.rmSync(b,{recursive:!0,force:!0})}return g&&e.writeActiveRuntime(i),I({protectVersions:O}),{version:i,channel:h,cdnOrigin:t,runtimeDir:d,installed:!0,activated:g,manifest:r}}async function T(n={}){e.ensureHome(),I({protectVersions:n.protectVersions});let t=l(n.cdnOrigin),r=m(n.channel),i=u();if(i){let p=e.readActiveRuntime(),s=o.existsSync(y.join(e.runtimeDir(i),e.installedMarker));if(p===i&&s)return{checked:!0,updated:!1,reason:`runtime is pinned to ${i}`,activeVersion:p,latestVersion:i};let C=await V({version:i,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,reason:`runtime is pinned to ${i}`,activeVersion:i,latestVersion:i,install:C}}let h=await f(t),a=h.channels[r]?.latest;if(!a)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:e.readActiveRuntime()};if(!h.versions[a])return{checked:!0,updated:!1,reason:`manifest is missing version ${a}`,activeVersion:e.readActiveRuntime(),latestVersion:a};let g=e.readActiveRuntime(),O=g?e.runtimeDir(g):null,P=O?o.existsSync(y.join(O,e.installedMarker)):!1;if(!(!g||!P||k(a,g)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:g,latestVersion:a};let w=await V({version:a,channel:r,cdnOrigin:t,setActive:!1,protectVersions:n.protectVersions});return{checked:!0,updated:!0,activeVersion:a,latestVersion:a,install:w}}async function $(n={}){let t=e.readActiveRuntime(),r=u();if(r)return{active:t,latest:r,pinned:r,outdated:t!==r};try{let i=await f(l(n.cdnOrigin)),h=m(n.channel),a=i.channels[h]?.latest??null,d=!!(a&&(!t||k(a,t)>0));return{active:t,latest:a,pinned:null,outdated:d}}catch{return{active:t,latest:null,pinned:null,outdated:!1}}}function S(n={}){e.ensureHome();let t=Math.max(1,Math.floor(n.retainVersions??Q)),r=D(e),i=new Set(r),h=e.readActiveRuntime(),a=u(),d=new Set;for(let s of[h,a,...n.protectVersions??[]])s&&i.has(s)&&d.add(s);for(let s of[...r].reverse()){if(d.size>=t)break;d.add(s)}let g="__RUNTIME_VERSION__",O=M(e,g),P=O.indexOf(g),b=O.slice(0,P),w=O.slice(P+g.length),p=[];if(P>=0)try{p=o.readdirSync(e.cacheDir(),{withFileTypes:!0}).filter(s=>{if(!s.isFile())return!1;let C=s.name.startsWith(b)&&s.name.endsWith(w),z=s.name.startsWith(b)&&s.name.endsWith(`${w}.partial`);return C||z}).map(s=>y.join(e.cacheDir(),s.name)).sort()}catch{}return{activeVersion:h,pinnedVersion:a,keepVersions:r.filter(s=>d.has(s)),removeVersions:r.filter(s=>!d.has(s)),removeCacheFiles:p}}function I(n={}){let t=S(n);for(let r of t.removeVersions)o.rmSync(e.runtimeDir(r),{recursive:!0,force:!0});for(let r of t.removeCacheFiles)o.rmSync(r,{force:!0});return t}return{product:e,resolveCdnOrigin:l,resolveChannel:m,resolvePin:u,manifestUrl:R,tarballUrl:x,fetchManifest:f,resolveVersion:v,install:V,updateToLatest:T,checkUpToDate:$,planLocalRetention:S,pruneLocalRetention:I,listInstalled:()=>D(e)}}async function X(e,c){let l=await fetch(e);if(!l.ok||!l.body)throw new Error(`download failed: ${l.status} ${l.statusText} (${e})`);o.mkdirSync(y.dirname(c),{recursive:!0});let m=`${c}.partial`;try{await K(q.fromWeb(l.body),o.createWriteStream(m)),o.renameSync(m,c)}catch(u){try{o.unlinkSync(m)}catch{}throw u}}function ee(e){return new Promise((c,l)=>{let m=J.createHash("sha256"),u=o.createReadStream(e);u.on("data",R=>m.update(R)),u.on("error",l),u.on("end",()=>c(m.digest("hex")))})}function ne(e,c){return new Promise((l,m)=>{let u=B("tar",["-xzf",e,"-C",c],{stdio:["ignore","inherit","inherit"]});u.on("error",m),u.on("exit",R=>{R===0?l():m(new Error(`tar exited with code ${R}`))})})}var te="https://contrast.dev",ye=`${L.origin}/changelog`,Ve="https://contrast.dev/api/changelog/sootsim",ie={id:"sootsim",defaultCdnOrigin:te,manifestPath:"/runtimes/manifest.json",tarballPath:e=>`/runtimes/sootsim-runtime-${e}.tar.gz`,installedMarker:"index.html",env:{cdnOrigin:"SOOTSIM_CDN_ORIGIN",channel:"SOOTSIM_RUNTIME_CHANNEL"},ensureHome:F,configFile:E,runtimesDir:N,runtimeDir:U,cacheDir:_,readActiveRuntime:j,writeActiveRuntime:H},we=W(ie);export{A as a,k as b,te as c,ye as d,Ve as e,we as f};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as y,c as P}from"./chunk-
|
|
4
|
+
import{a as y,c as P}from"./chunk-PAUEZO6F.js";import{a as f,b as S}from"./chunk-5BR33NAZ.js";import{b}from"./chunk-OJZHECGH.js";import{a as v}from"./chunk-FA75F34Z.js";function M(){let e=f();return e?{available:!0,reason:null,detail:`${e.kind} @ ${e.path}`}:{available:!1,reason:"rnx desktop app not installed (run `rnx desktop install`)"}}async function A(e){let o=f();if(!o)return{launched:!1,message:"rnx desktop app not installed"};try{let r=await S(e.url,o,{device:e.device,profileId:e.profileId,ephemeralProfile:e.ephemeralProfile,ownerPid:e.ownerPid});return r.launched?{launched:!0,message:e.url?`electron launched via ${r.via} \u2192 ${e.url}`:`electron launched via ${r.via}`,target:r.target,attachUrl:e.url}:{launched:!1,message:"desktop companion failed to start"}}catch(r){return{launched:!1,message:`electron launch failed: ${r instanceof Error?r.message:String(r)}`}}}var k={id:"electron",name:"electron",description:"rnx desktop companion app (native window, menu bar)",kind:"native",availability:M,launch:A};import{spawn as B}from"child_process";import{closeSync as F,mkdtempSync as G,openSync as U,readFileSync as q}from"fs";import{tmpdir as T}from"os";import{join as I}from"path";import{spawnSync as O}from"node:child_process";import{existsSync as _,readFileSync as R}from"node:fs";import{createRequire as L}from"node:module";import{dirname as W,join as N}from"node:path";var $=`
|
|
5
5
|
const { existsSync } = require('node:fs');
|
|
6
6
|
const modulePath = process.env.SOOTSIM_PW_MODULE;
|
|
7
7
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{f as c}from"./chunk-
|
|
4
|
+
import{f as c}from"./chunk-AALKIAUZ.js";function m(e,n){let t=e.indexOf("--testid");if(t>=0&&e[t+1])return{mode:"testid",value:e[t+1]};let i=e.indexOf("--test-id");if(i>=0&&e[i+1])return{mode:"testid",value:e[i+1]};let l=e.indexOf("--text");if(l>=0&&e[l+1])return{mode:"text",value:e[l+1]};let r=n?.[1];return r&&!r.startsWith("-")&&!Number.isFinite(Number(r))?{mode:"testid",value:r}:null}async function a(e,n){let t=await e.send({type:"resolve",selector:n.mode==="testid"?{testID:n.value}:{text:n.value}});if(t===null)return null;if(typeof t!="object")throw new Error("resolve returned an invalid result");let i=Reflect.get(t,"match"),l=Reflect.get(t,"target"),r=[i,l],o=Reflect.get(t,"point"),u=o!==null&&typeof o=="object"?Reflect.get(o,"x"):void 0,d=o!==null&&typeof o=="object"?Reflect.get(o,"y"):void 0;if(!c(r)||typeof u!="number"||!Number.isFinite(u)||typeof d!="number"||!Number.isFinite(d))throw new Error("resolve returned an invalid result");let s=r[0];if(!s)throw new Error("resolve returned an invalid result");return{x:u,y:d,testID:s.testID??null,text:s.text??(n.mode==="text"?n.value:s.label),type:s.type}}export{m as a,a as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var c="sootsim-agent-prompt-v1";function r(n){return typeof n=="string"?n.trim():""}function m(n){let e=r(n.text);if(!e)return"";let t=r(n.displayText),s=r(n.inspectSummary),o=r(n.inspectTrace);return!!s||!!o||/[\r\n]/.test(e)||!!t&&t!==e?JSON.stringify({__sootsimAgentPrompt:c,text:e,displayText:t,inspectSummary:s,inspectTrace:o}):e}function u(n){let e=r(n);if(!e)return null;try{let t=JSON.parse(e);if(t.__sootsimAgentPrompt!==c)return{text:e};let s=r(typeof t.text=="string"?t.text:void 0);if(!s)return null;let o=r(typeof t.displayText=="string"?t.displayText:void 0),i=r(typeof t.inspectSummary=="string"?t.inspectSummary:void 0),p=r(typeof t.inspectTrace=="string"?t.inspectTrace:void 0);return{text:s,...o?{displayText:o}:{},...i?{inspectSummary:i}:{},...p?{inspectTrace:p}:{}}}catch{return{text:e}}}export{m as a,u as b};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as w,b as E}from"./chunk-
|
|
4
|
+
import{a as w,b as E}from"./chunk-OJZHECGH.js";import{P as T,Q as F,R as _,S as W,g as $}from"./chunk-U63T6LIQ.js";import ae from"node:fs";import S from"node:path";import{WebSocket as C}from"ws";var ye="http://localhost:7668/";function H(e){if(typeof e=="number")return Number.isInteger(e)&&e>0?e:null;if(typeof e!="string")return null;let t=e.trim();if(!t)return null;let r=Number(t);return Number.isInteger(r)&&r>0?r:null}function z(e){let t=H(e);return t===null?0:t}function V(e={}){let t=H(e.explicitPort);return t!==null?t:7668+z(e.portOffset)}var Q=5173;var Z=2e3;function Te(e){let t=e-7668;return t<0||t>Z?null:`http://localhost:${Q+t}/`}var _e=4001,Oe="sootsim close";var h="http://localhost:5173/";import{existsSync as ee,mkdirSync as te,readFileSync as re,rmSync as B,writeFileSync as ne}from"fs";import{tmpdir as ie}from"os";import{dirname as oe,join as se,resolve as le}from"path";var x=1,G="SOOTSIM_CLI_CURRENT_SIM_PATH",ce=["SOOTSIM_CLI_IDENTITY","TM_SESSION","CLAUDE_CODE_SESSION_ID","CODEX_THREAD_ID","TERM_SESSION_ID","ITERM_SESSION_ID","TMUX_PANE","STY","KITTY_WINDOW_ID","WEZTERM_PANE","ALACRITTY_WINDOW_ID","WINDOWID","VSCODE_INJECTION"],j=/^(?:tmux|screen)|^tm$/i;function q(e,t=20){let r=e,n=w(e);if(!n||n<=1){let o=E(e);return e>1&&o&&!j.test(o)?e:null}for(let o=0;o<t;o++){let s=E(n);if(s&&j.test(s))return r;let u=w(n);if(!u||u<=1)return s?n:r;r=n,n=u}return n}function v(){for(let t of ce){let r=process.env[t];if(r&&r.trim())return{key:`${t}:${r.trim()}`,source:t,stable:!0}}let e=q(process.ppid);return e&&e>1?{key:`gppid-${e}`,source:"grand-ppid",stable:!0}:{key:`pid-${process.ppid}`,source:"ppid",stable:!1}}function de(){return v().key}function ke(){return q(process.ppid)}function R(){if(process.env[G])return le(process.env[G]);let e=de();return se(ie(),`sootsim-current-sim-${e}.json`)}function ue(){let e=R();if(!ee(e))return null;try{let t=JSON.parse(re(e,"utf8"));return t.version!==x||typeof t.simId!="string"||!t.simId.trim()||typeof t.updatedAt!="string"?(B(e,{force:!0}),null):{version:x,simId:t.simId.trim(),updatedAt:t.updatedAt}}catch{return B(e,{force:!0}),null}}function k(){return ue()?.simId||null}function Ce(e){let t=e.trim();if(!t)return;let r=R();te(oe(r),{recursive:!0}),ne(r,JSON.stringify({version:x,simId:t,updatedAt:new Date().toISOString()},null,2)+`
|
|
5
5
|
`)}function J(){B(R(),{force:!0})}var me="RNX_PLACEMENT";function We(){return process.env[me]==="local-box"?"local-box":"host"}function Y(e){return`ws://localhost:${e}`}var L=null;function M(){return F().filter(e=>W(e))}function X(e){let t=S.resolve(e);for(;;){if(ae.existsSync(S.join(t,".git")))return t;let r=S.dirname(t);if(r===t)return null;t=r}}function K(e,t){let r=S.relative(e,t);return r===""||r!==".."&&!r.startsWith(`..${S.sep}`)&&!S.isAbsolute(r)}function fe(){let e=M();if(e.length===0)return null;if(process.env.SOOTSIM_BRIDGE_PORT!==void 0||process.env.PORT_OFFSET!==void 0){let r=V({explicitPort:process.env.SOOTSIM_BRIDGE_PORT,portOffset:process.env.PORT_OFFSET}),n=e.find(o=>o.bridgePort===r);if(n)return n}let t=null;try{t=process.cwd()}catch{}if(t){let r=X(t),n=e.filter(o=>{let s=X(o.cwd);return r&&s?r===s:K(t,o.cwd)||K(o.cwd,t)});if(n.length>0)return n.find(o=>o.bridgePort===7668)??n[0]}return e.find(r=>r.bridgePort===7668)??e[0]}function ge(){let e=$();if(L?.homeDir===e)return L.world;let t=pe();return L={homeDir:e,world:t},t}function pe(){let e=fe();if(e)return{source:"dev-bridge",bridgePort:e.bridgePort,shellBaseUrl:e.shellPort?`http://localhost:${e.shellPort}/`:h};let t=T();return t&&_(t)?{source:"daemon",bridgePort:t.bridgePort,shellBaseUrl:t.runtimePort>0?`http://localhost:${t.runtimePort}/`:h}:{source:"default",bridgePort:7668,shellBaseUrl:h}}function he(e){let t=M().find(n=>n.bridgePort===e);if(t)return{source:"dev-bridge",shellBaseUrl:t.shellPort?`http://localhost:${t.shellPort}/`:h};let r=T();return r&&_(r)&&r.bridgePort===e?{source:"daemon",shellBaseUrl:r.runtimePort>0?`http://localhost:${r.runtimePort}/`:h}:null}function He(e){let t;try{let o=new URL(e);t=o.port?Number(o.port):o.protocol==="https:"?443:80}catch{return null}if(!Number.isFinite(t)||t<=0)return null;let r=M().find(o=>o.shellPort===t||o.runtimePort===t||o.bridgePort===t);if(r)return r.bridgePort;let n=T();return n&&_(n)&&(n.runtimePort===t||n.bridgePort===t)?n.bridgePort:null}function Se(){return ge().bridgePort}function Ve(e,t){let r=he(e),n=r?.source==="dev-bridge"?"dev bridge":r?.source==="daemon"?"daemon bridge":"bridge",o=r?.source==="dev-bridge"?`dev-bridges/${e}.json`:r?.source==="daemon"?"daemon.json":"no lockfile",s=t??r?.shellBaseUrl;process.stderr.write(` \u2192 ${n} :${e} (${s?`shell ${s}, `:""}${o})
|
|
6
6
|
`)}var A=class extends Error{lock;constructor(t,r){super(t),this.name="BridgeSimLockedError",this.lock=r}};function be(e){return e==="flag"?"via --sim":e==="saved"?"saved via `rnx use`":"primary fallback \u2014 no sim pinned"}function Ge(e,t={}){let r=new Set,n=t.port??Se(),o=t.port!==void 0,s=t.commandTimeoutMs??15e3,u,a="none",I=new Set(t.stripBooleanFlags??[]),P=new Set(t.stripValueFlags??[]);for(let l=0;l<e.length;l++){let i=e[l];if(i==="--port"||i==="-p"){r.add(l),o=!0,l+1<e.length&&(r.add(l+1),n=Number(e[l+1])),l++;continue}if(i.startsWith("--port=")){r.add(l),o=!0,n=Number(i.slice(7));continue}if(i==="--timeout"){r.add(l),l+1<e.length&&(r.add(l+1),s=Number(e[l+1])),l++;continue}if(i==="--sim"||i==="--session"||i==="--tab"){r.add(l),l+1<e.length&&(r.add(l+1),u=e[l+1]?.trim()||void 0,a="flag"),l++;continue}let c=i.startsWith("--sim=")?i.slice(6):i.startsWith("--session=")?i.slice(10):i.startsWith("--tab=")?i.slice(6):void 0;if(c!==void 0){r.add(l),u=c.trim()||void 0,a="flag";continue}if(I.has(i)){r.add(l);continue}P.has(i)&&(r.add(l),l+1<e.length&&r.add(l+1),l++)}if(!u){let l=k();l&&(u=l.trim()||void 0,a="saved")}return{positional:e.filter((l,i)=>!r.has(i)),wsPort:n,explicitPort:o,simId:u,simIdSource:a,commandTimeoutMs:s}}function Ie(e,t={}){let r=1,n=t.commandTimeoutMs??15e3,o=new Map,s=new C(Y(e)),u=v(),a=new Promise((i,c)=>{s.on("open",()=>{try{s.send(JSON.stringify({type:"bridge:hello",id:0,cliIdentityKey:u.key,cliIdentitySource:u.source,cliLabel:t.cliLabel}))}catch{}i()}),s.on("error",d=>{let m=d.message?`: ${d.message}`:"";c(new Error(`could not connect to ${Y(e)}${m}`))})});a.catch(()=>{});let I=!1,P=!1;function l(i,c){if(P||process.env.SOOTSIM_QUIET_TARGET_NOTICE==="1"||i.startsWith("bridge:")||i==="focus"||i==="close")return;P=!0;let d=c??"primary",m=be(c?t.simIdSource:"none");process.stderr.write(` \u2192 ${d} (${m})
|
|
7
7
|
`)}return s.on("message",i=>{let c;try{c=JSON.parse(i.toString())}catch{return}if(c.id===0)return;let d=o.get(c.id);d&&(o.delete(c.id),c._otherCliCount>0&&!I&&(I=!0,process.stderr.write(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import i from"node:fs";import r from"node:path";var e=["app.config.js","app.config.ts","app.config.cjs","app.config.mjs","app.json"],p=["sootsim.config.ts","sootsim.config.js","sootsim.config.mjs","sootsim.config.cjs"];function c(n,t){for(let o of t){let s=r.join(n,o);try{if(i.statSync(s).isFile())return s}catch{}}return null}function f(n){return c(n,e)}function l(n){return c(n,p)}function u(n){let t=r.resolve(n);try{if(!i.statSync(t).isDirectory())return null}catch{return null}let o=l(t);return!o&&!f(t)&&!i.existsSync(r.join(t,"package.json"))?null:{appDir:t,configPath:o}}export{u as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{d as P,m,n as S,o as R,p as _,q as v}from"./chunk-
|
|
4
|
+
import{d as P,m,n as S,o as R,p as _,q as v}from"./chunk-CMVRTZ5G.js";var k="sootsim:settings",d=["productAnalytics","crashReports","colorScheme","reduceMotion","boldText","fontSize","largerAccessibilitySizes","a11yMode","a11yDepth","screenshotCanvas","screenshotBackground","screenshotText","screenshotPose","screenshotDynamicSize","alwaysShowLiveWebViews","showFrame","showMenuBar","showRail","solidWindow","ambientGlow","agentProvider"];function p(){if(typeof window>"u")return null;let e=window.sootsimElectron;return e&&typeof e=="object"?e:null}function l(e){let t={};for(let n of d){if(!(n in e))continue;let o=e[n],i=S[n];i.validate&&!i.validate(o)||i.options&&!i.options.includes(o)||(t[n]=o)}return t}function K(e){let t={};for(let n of d)t[n]=e[n];return t}function M(){if(typeof localStorage>"u")return{};try{let e=localStorage.getItem(k);return e?l(JSON.parse(e)):{}}catch{return{}}}function T(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(k,JSON.stringify(e))}catch{}}function x(){let t=p()?.sharedConfig?.settings;return!t||typeof t!="object"?{}:l(t)}function A(e){let t=p();if(t?.writeSharedConfig)try{t.writeSharedConfig({settings:e})}catch{}}async function L(e){let t=p();return t?.writeSharedConfig?(await t.writeSharedConfig({settings:e}),!0):!1}function b(){if(typeof window>"u")return null;let e=window.__sootsimSharedConfig;return e&&typeof e=="object"?e:null}function O(){let e=b()?.settings;return!e||typeof e!="object"?{}:l(e)}function B(e){if(!b())return;let t={settings:e};try{if(globalThis.__sootsimBridgeRequest?.writeSharedConfig?.(t))return}catch{}if(!(typeof fetch>"u"))try{fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0}).catch(()=>{})}catch{}}async function F(e){if(!b()||typeof fetch>"u")return!1;let t=await fetch("/__sootsim/shared-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:e}),keepalive:!0});if(!t.ok)throw new Error(`shared settings reset failed with HTTP ${t.status}`);return await t.text(),!0}function D(){let e=M(),t=O(),n=x();return{...e,...t,...n}}function V(e,t={}){let n=K(e);for(let o of d)t[o]!==void 0&&(n[o]=t[o]);T(n),A(n),B(n)}async function I(e,t={}){let n=K(e);for(let o of d)t[o]!==void 0&&(n[o]=t[o]);T(n),!await L(n)&&await F(n)}function j(e){if(typeof window>"u")return()=>{};let t=r=>{if(!(r.key!==k||r.newValue==null))try{e(l(JSON.parse(r.newValue)))}catch{}};window.addEventListener("storage",t);let n=p(),o;n?.onSharedConfigChanged&&(o=n.onSharedConfigChanged(r=>{let f=r?.settings;!f||typeof f!="object"||e(l(f))}));let a=globalThis.__sootsimBridgeRequest?.subscribeSharedConfig?.(r=>{let f=r?.settings;!f||typeof f!="object"||e(l(f))});return()=>{window.removeEventListener("storage",t),o?.(),a?.()}}var N=_(),q=v(),y=D(),c=new Set,g={};for(let e of d)N[e]!==void 0&&(c.add(e),y[e]!==void 0&&(g[e]=y[e]),delete y[e]);var s={...q,...y},w=[],u=null;function h(){for(let e of w)e()}function E(){h(),V(s,g)}function C(e,t){let n=S[e];return n.validate&&!n.validate(t)||n.options&&!n.options.includes(t)||s[e]===t?!1:(s={...s,[e]:t},e==="deviceModel"&&(u=null),!0)}j(e=>{let t={...s},n=!1;for(let[o,i]of Object.entries(e)){let a=o;if(c.has(a)){g[a]=i;continue}t[a]!==i&&(t[a]=i,n=!0)}n&&(s=t,u=null,h())});var z={get(e){return s[e]},set(e,t){C(e,t)&&E()},setRuntime(e,t){c.has(e)||(c.add(e),d.includes(e)&&(g[e]=s[e])),C(e,t)&&h()},isRuntimeControlled(e){return c.has(e)},getAll(){return s},apply(e){let t=!1,n={...s};for(let[o,i]of Object.entries(e)){if(i===void 0)continue;let a=o,r=S[a];r&&(r.validate&&!r.validate(i)||r.options&&!r.options.includes(i)||n[a]!==i&&(n[a]=i,t=!0))}t&&(s=n,u=null,E())},applyRuntime(e){let t=!1;for(let n of Object.keys(e)){let o=e[n];o!==void 0&&(c.has(n)||(c.add(n),d.includes(n)&&(g[n]=s[n])),C(n,o)&&(t=!0))}t&&h()},reset(){s=v(),u=null,E()},async resetDeviceContent(){let e=m.filter(n=>!c.has(n)).map(n=>[n,R[n]]),t=e.some(([n,o])=>s[n]!==o);s={...s,...Object.fromEntries(e)};for(let n of m)c.has(n)&&(g[n]=R[n]);t&&h(),await I(s,g)},subscribe(e){return w.push(e),()=>{w=w.filter(t=>t!==e)}},getDeviceSpec(){return u||(u=P(s.deviceModel)),u},getA11yMode(){return s.a11yMode},setA11yMode(e){this.set("a11yMode",e)},getInspectMode(){return s.inspectMode},setInspectMode(e){this.set("inspectMode",e)}};export{z as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var a=["Cache","Code Cache","DawnCache","DawnGraphiteCache","DawnWebGPUCache","GPUCache","GrShaderCache","ShaderCache"],r=new Set(a);function s(e){return r.has(e)}export{a,s as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as i}from"./chunk-
|
|
4
|
+
import{a as i}from"./chunk-64JAEJ6N.js";import{spawn as m}from"node:child_process";import c from"node:fs";import t from"node:path";function b(n){let e=t.resolve(n),r=null;for(;;){if(!r&&c.existsSync(t.join(e,"package.json"))&&(r=e),c.existsSync(t.join(e,".git")))return r;let s=t.dirname(e);if(s===e)return null;e=s}}function g(n){let e=t.resolve(n);for(;;){if(c.existsSync(t.join(e,"bun.lock"))||c.existsSync(t.join(e,"bun.lockb")))return"bun";if(c.existsSync(t.join(e,"pnpm-lock.yaml")))return"pnpm";if(c.existsSync(t.join(e,"package-lock.json")))return"npm";let r=t.dirname(e);if(r===e)return"npm";e=r}}function j(n){let e=t.resolve(n.appDir),r=u(t.join(e,"package.json")),s=`${i.commandName} open`,o=r.scripts?.[i.commandName];if(o&&o!==s)throw new Error(`package.json already defines scripts.${i.commandName} as ${JSON.stringify(o)}; resolve that conflict before setup`);let a=g(e),p=[];return r.devDependencies?.[i.packageName]!==n.cliVersion&&p.push(f(a,n.cliVersion)),o!==s&&p.push(S(a)),{appDir:e,packageManager:a,operations:p}}async function w(n,e){for(let r of n.operations)e.dryRun||await y(r,n.appDir,e.json)}function O(n){return n.operations.map(e=>`${e.command} ${e.args.map(l).join(" ")}`)}function u(n){let e;try{e=JSON.parse(c.readFileSync(n,"utf8"))}catch(o){let a=o instanceof Error?o.message:String(o);throw new Error(`could not read ${n}: ${a}`)}if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${n} must contain a JSON object`);let r=d(Reflect.get(e,"scripts")),s=d(Reflect.get(e,"devDependencies"));return{...r?{scripts:r}:{},...s?{devDependencies:s}:{}}}function d(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=Object.entries(n).filter(r=>typeof r[1]=="string");return Object.fromEntries(e)}function f(n,e){let r=`${i.packageName}@${e}`;switch(n){case"bun":return{command:"bun",args:["add","--dev","--exact",r],description:`install ${r} as an exact dev dependency`};case"pnpm":return{command:"pnpm",args:["add","--save-dev","--save-exact",r],description:`install ${r} as an exact dev dependency`};case"npm":return{command:"npm",args:["install","--save-dev","--save-exact",r],description:`install ${r} as an exact dev dependency`}}}function l(n){return/^[a-zA-Z0-9_./@=-]+$/.test(n)?n:JSON.stringify(n)}function y(n,e,r){return new Promise((s,o)=>{let a=m(n.command,n.args,{cwd:e,stdio:r?["ignore",2,"inherit"]:"inherit"});a.once("error",o),a.once("exit",p=>{p===0?s():o(new Error(`${n.command} exited with code ${p??"unknown"}`))})})}function S(n){return{command:n,args:n==="bun"?["pm","pkg","set",`scripts.${i.commandName}=${i.commandName} open`]:["pkg","set",`scripts.${i.commandName}=${i.commandName} open`],description:`add the \`${i.commandName}\` package script`}}export{b as a,j as b,w as c,O as d};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{b as C}from"./chunk-
|
|
4
|
+
import{b as C}from"./chunk-FA75F34Z.js";import{f as h}from"./chunk-DHYTRCIP.js";import{L as B,T as b,g as S}from"./chunk-U63T6LIQ.js";import o from"node:fs";import c from"node:path";var g=1,k=`automatic-cleanup-v${g}.json`,x=`automatic-cleanup-v${g}.lock`,A=360*60*1e3;function w(){let i=c.join(S(),k);try{return JSON.parse(o.readFileSync(i,"utf8")).generation===g}catch{return!1}}function $(i){if(i<1024)return`${i} B`;let e=["KiB","MiB","GiB","TiB"],n=i/1024,r=e[0];for(let s=1;s<e.length&&n>=1024;s++)n/=1024,r=e[s];return`${n.toFixed(n>=10?1:2)} ${r}`}function p(i){let e;try{e=o.lstatSync(i)}catch{return 0}let n=e.blocks>0?e.blocks*512:e.size;if(!e.isDirectory()||e.isSymbolicLink())return n;let r=n;try{for(let s of o.readdirSync(i))r+=p(c.join(i,s))}catch{}return r}function E(i){for(let e of["SingletonLock","SingletonSocket","lockfile"])try{if(o.lstatSync(c.join(i,e)))return!0}catch{}return!1}function v(i,e){let n;try{n=o.readdirSync(i,{withFileTypes:!0})}catch{return[]}let r=E(e),s=[];for(let t of n){if(!t.isDirectory()||t.isSymbolicLink())continue;let a=c.join(i,t.name);if(C(t.name)){s.push({path:a,bytes:p(a),kind:"browser-cache",state:r?"in-use":"safe",selected:!r,detail:r?"browser profile is open; close it before cleanup":"disposable browser HTTP, bytecode, or GPU cache"});continue}s.push(...v(a,e))}return s}function P(i){let e=c.join(i,"profiles","playwright"),n;try{n=o.readdirSync(e,{withFileTypes:!0})}catch{return[]}return n.flatMap(r=>{if(!r.isDirectory()||r.isSymbolicLink())return[];let s=c.join(e,r.name);return v(s,s)})}function L(i){let e=c.join(i,"electron","userData");return v(e,e)}function R(i,e){let n=c.join(i,"recordings"),r;try{r=o.readdirSync(n,{withFileTypes:!0})}catch{return[]}return r.map(s=>{let t=c.join(n,s.name);return{path:t,bytes:p(t),kind:"recording",state:"aggressive",selected:e,detail:"user-created recording or captured-frame output"}})}function T(i,e){let n=c.join(i,"camera-fixtures"),r;try{r=o.readdirSync(n,{withFileTypes:!0})}catch{return[]}return r.map(s=>{let t=c.join(n,s.name);return{path:t,bytes:p(t),kind:"camera-fixture",state:"aggressive",selected:e,detail:"staged camera fixture video"}})}function U(i){let e=new Set(b()),n=[...e],r=h.planLocalRetention({retainVersions:2,protectVersions:n}),s=h.planLocalRetention({retainVersions:1,protectVersions:n}),t=new Set(r.removeVersions),a=new Set(s.removeVersions),l=new Set([...r.keepVersions,...r.removeVersions,...s.keepVersions,...s.removeVersions]),m=[];for(let u of[...l].sort()){let d=h.product.runtimeDir(u),y="retained",f="retained runtime";e.has(u)&&u!==r.activeVersion?(y="in-use",f="runtime is serving a connected simulator"):t.has(u)?(y="safe",f="inactive runtime outside the two-version rollback window"):a.has(u)?(y="aggressive",f="most recent rollback runtime"):u===r.activeVersion&&(f="active runtime; always protected"),m.push({path:d,bytes:p(d),kind:"runtime-version",state:y,selected:y==="safe"||y==="aggressive"&&i,detail:f})}for(let u of r.removeCacheFiles)m.push({path:u,bytes:p(u),kind:"runtime-archive",state:"safe",selected:!0,detail:"downloaded archive is unnecessary after successful extraction"});return{activeRuntime:r.activeVersion,entries:m}}function D(i={}){let e=i.aggressive===!0,n=S(),r=U(e),s=[...r.entries,...P(n),...L(n),...R(n,e),...T(n,e)].sort((t,a)=>a.bytes-t.bytes||t.path.localeCompare(a.path));return{home:n,activeRuntime:r.activeRuntime,entries:s,reclaimableBytes:s.reduce((t,a)=>t+(a.selected?a.bytes:0),0),protectedBytes:s.reduce((t,a)=>t+(a.selected?0:a.bytes),0),totalBytes:p(n)}}function I(i,e){let n=c.relative(i,e);if(!n||n.startsWith("..")||c.isAbsolute(n))throw new Error(`refusing cleanup target outside the rnx data home: ${e}`)}function V(i={}){let e=D(i),n=i.aggressive===!0?1:2;h.pruneLocalRetention({retainVersions:n,protectVersions:b()});for(let t of e.entries)if(t.selected&&!(t.kind==="runtime-archive"||t.kind==="runtime-version")){if(t.kind==="browser-cache"){let l=c.relative(e.home,t.path).split(c.sep),m=l[0]==="profiles"&&l[1]==="playwright"&&l[2]?c.join(e.home,"profiles","playwright",l[2]):l[0]==="electron"&&l[1]==="userData"?c.join(e.home,"electron","userData"):null;if(m&&E(m)){t.state="in-use",t.selected=!1,t.detail="browser profile opened while cleanup was starting";continue}}I(e.home,t.path),o.rmSync(t.path,{recursive:!0,force:!0})}let r=e.entries.filter(t=>t.selected&&!o.existsSync(t.path)).map(t=>t.path),s=p(e.home);return{...e,removedPaths:r,reclaimedBytes:Math.max(0,e.totalBytes-s),remainingBytes:s}}function M(){B();let i=S(),e=c.join(i,k),n=c.join(i,x);if(w())return{status:"already-complete",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};let r=null;for(let s=0;s<2&&r===null;s++)try{let t=o.openSync(n,"wx");try{o.writeFileSync(t,`${JSON.stringify({pid:process.pid,startedAt:Date.now()})}
|
|
5
5
|
`,"utf8"),r=t}catch(a){o.closeSync(t);try{o.unlinkSync(n)}catch{}throw a}}catch(t){if((t instanceof Error&&"code"in t?t.code:null)!=="EEXIST")throw t;let l=0,m=0,u=null;try{u=o.lstatSync(n);let d=JSON.parse(o.readFileSync(n,"utf8"));l=typeof d.pid=="number"?d.pid:0,m=typeof d.startedAt=="number"?d.startedAt:0}catch{}if(l>0&&m>0&&Date.now()-m<A)try{return process.kill(l,0),{status:"busy",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0}}catch{}if(!u)continue;try{let d=o.lstatSync(n);if(d.dev!==u.dev||d.ino!==u.ino)return{status:"busy",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};o.unlinkSync(n)}catch{}}if(r===null)return{status:"busy",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};try{if(w())return{status:"already-complete",reclaimedBytes:0,remainingBytes:0,deferredInUseBytes:0};let s=V(),t=s.entries.reduce((l,m)=>l+(m.state==="in-use"?m.bytes:0),0);if(t>0)return{status:"deferred",reclaimedBytes:s.reclaimedBytes,remainingBytes:s.remainingBytes,deferredInUseBytes:t};let a=`${e}.${process.pid}.tmp`;return o.writeFileSync(a,`${JSON.stringify({generation:g,completedAt:Date.now(),reclaimedBytes:s.reclaimedBytes})}
|
|
6
6
|
`,"utf8"),o.renameSync(a,e),{status:"complete",reclaimedBytes:s.reclaimedBytes,remainingBytes:s.remainingBytes,deferredInUseBytes:0}}finally{o.closeSync(r);try{o.unlinkSync(n)}catch{}}}export{w as a,$ as b,D as c,V as d,M as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.370 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var f="\x1B[0m",p="\x1B[1m",a="\x1B[2m",m="\x1B[38;2;42;95;255m",x="\x1B[38;5;84m",d="\x1B[38;5;203m";function c(n,t){return!process.stdout.isTTY||process.env.NO_COLOR!==void 0?t:`${n}${t}${f}`}function s(n){return c(m,n)}function u(n){return c(p,n)}function i(n){return c(a,n)}function w(n){return c(x,n)}function h(n){return c(d,n)}function v(n){console.log(),console.log(` ${s("\u25E4\u25E2")} ${u("rnx")}`),n&&console.log(` ${i(n)}`)}function y(n,t){console.log(`
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*! rnx v0.1.370 | (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 G,b as J,c as Fe}from"./chunk-NTC46LSA.js";import{c as $e,d as Ne}from"./chunk-6A6L3VJR.js";import{p as _e}from"./chunk-3BG6UCQY.js";import{t as Ue,v as Pe,x}from"./chunk-EOIBLKZO.js";import{c as m}from"./chunk-AVJBT5LF.js";import{a as Ae}from"./chunk-64JAEJ6N.js";import{createHash as Mt}from"crypto";import{readFileSync as w}from"fs";import He from"path";import{gzipSync as ge,gunzipSync as Tt}from"zlib";function Le(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 at,constants as lt}from"node:zlib";var ut=9;function Ce(e){return at(e,{params:{[lt.BROTLI_PARAM_QUALITY]:ut}})}var ue={initMs:3e4,putMs:12e4,finalizeMs:18e4};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 ct(e){let t=ce(ue.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 dt(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 ct(l),o++,r?.(o,i)}}))}function pt(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 ft(e){return e.replace(/\/+$/,"")}var K=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function Oe(e){let t=ft(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(ue.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 M=await o.text().catch(()=>"");throw new K(`init failed: ${o.status} ${M.slice(0,200)}`,o.status,"init",M)}let i=await o.json(),l=pt(i,e.bundleBytes,e.filesByHash,e.extras);await dt(l,e.concurrency??8,e.onPutProgress);let f=ce(ue.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 M=await c.text().catch(()=>"");throw new K(`finalize failed: ${c.status} ${M.slice(0,200)}`,c.status,"finalize",M)}let y=await c.json();return{init:i,finalize:y}}function mt(e){return e!==null&&typeof e=="object"?e:null}function ze(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function de(e){let t=mt(e);return t?t.schemaVersion===1&&ze(t.t)!==void 0&&ze(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function gt(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 De(e){return gt(e,de)}import{execSync as ht}from"child_process";function fe(e){try{return ht(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 yt(){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 y=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(y),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:yt();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 Kt(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 Vt(e){return e.auth?e.uploadedShare?!0:e.auth.kind==="github"||process.env.GITHUB_ACTIONS==="true":!1}async function Wt(e){let t=e.auth??G();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:J(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 St(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 vt(e){let t=JSON.parse(w(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 y=w(f);return{meta:{id:i,label:typeof l=="string"&&l?l:i,kind:"interaction",t:Math.round(c),contentType:"image/png",sizeBytes:y.byteLength},bytes:y}})}var Ke=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://contrast.dev",Ve=process.env.SOOTSIM_PREVIEW_ORIGIN||Ae.origin;async function Rt(e){return e||(process.env.SOOTSIM_UPLOAD_ORIGIN?process.env.SOOTSIM_UPLOAD_ORIGIN:Ke)}function N(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 kt(e){try{let t=new URL(e).hostname.toLowerCase();return t==="contrast.dev"||t.endsWith(".contrast.dev")}catch{return!1}}function Bt(e,t){return t?N(t):process.env.SOOTSIM_PREVIEW_ORIGIN?N(process.env.SOOTSIM_PREVIEW_ORIGIN):xt(e)?N(e):kt(e)?N(Ve):N(e)}function Et(){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: ${Ke})
|
|
13
|
+
override with SOOTSIM_UPLOAD_ORIGIN env var
|
|
14
|
+
--public-origin <url>
|
|
15
|
+
public /preview link origin (default: ${Ve}
|
|
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 je(e,t){let r=e.findIndex(s=>s===t);return r<0?!1:(e.splice(r,1),!0)}function qe(e,t){if(!e)return;let r=Number(e);return(!Number.isFinite(r)||r<=0)&&(console.error(` invalid ${t}: ${e}`),m(1)),Math.round(r)}function Ge(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 Je(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 It(e){return/\.bundle($|\?)/.test(e)||/\.js($|\?)/.test(e)?"application/javascript":/\.zip($|\?)/.test(e)?"application/zip":"application/javascript"}function At(e){try{return new URL(e).searchParams.get("appFonts")||""}catch{return""}}function Ut(e){try{return new URL(e).searchParams.get("appSplash")||""}catch{return""}}function Pt(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 _t(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 Nt(e){let t=w(e),s=(t[0]===31&&t[1]===139?Tt(t):t).toString("utf8");return De(s)}function Ft(e){return JSON.parse(w(e,"utf8"))}function Lt(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 Ct(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 mn(e,t){(e.includes("--help")||e.includes("-h"))&&(Et(),m(0));let r=[...e],s=await Rt(p(r,"--origin")),o=Bt(s,p(r,"--public-origin")),i=p(r,"--events"),l=p(r,"--screenshot"),f=p(r,"--snapshot-manifest"),c=p(r,"--video"),y=p(r,"--timeline-events"),M=p(r,"--trace-frame-stats"),V=p(r,"--failure-bundle"),W=p(r,"--video-duration-ms"),ye=qe(p(r,"--recorded-duration-ms"),"--recorded-duration-ms"),be=qe(p(r,"--recording-started-at-ms"),"--recording-started-at-ms"),Y=p(r,"--owner"),Q=p(r,"--repo"),O=p(r,"--billing-kind"),We=p(r,"--run-scope"),Ye=je(r,"--open");(Y&&!Q||!Y&&Q)&&(console.error(" --owner and --repo must be provided together"),m(1)),O&&O!=="test_run"&&(console.error(` invalid --billing-kind: ${O}`),m(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."),m(1));let we=je(r,"--assets-only"),Qe=Ue(r,{stripBooleanFlags:[],stripValueFlags:[]}),T=Pe(Qe),d,Me=[],k=[],B=y?Nt(y):[],Te=M?Ft(M):null;B.push(...Lt(Te));let Se=B.length,X=null;try{if(d=await x(T,'(typeof window.__sootsimCaptureBundle === "function") ? window.__sootsimCaptureBundle() : null'),d?.bundleUrl){let u=new URL(d.bundleUrl).origin,[g,P]=await Promise.all([x(T,`(window.__sootsimPreviewRecorder?.list?.(${JSON.stringify(u)}) || [])`),x(T,`(async () => {
|
|
57
|
+
const list = window.__sootsimListWorkerFetchRecorder
|
|
58
|
+
return typeof list === 'function'
|
|
59
|
+
? await list(${JSON.stringify(u)})
|
|
60
|
+
: []
|
|
61
|
+
})()`)]);Me=he([...g,...P]).filter(h=>{try{return!new URL(h.url).pathname.startsWith("/api/")}catch{return!0}});let $=await x(T,`(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
|
+
})()`),C=($?he([...$.main,...$.worker]):[]).filter(h=>{try{return new URL(h.url).origin!==u}catch{return!1}}),R=C.length>0?{count:C.length,totalBytes:C.reduce((h,ae)=>h+(ae.size||0),0)}:null;if(R&&R.count>0){console.log(` ${R.count} recorded cross-origin responses (${(R.totalBytes/1024).toFixed(1)} KiB)`);let h=await x(T,`(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(k=he([...h.main,...h.worker]),we){let ae=k.length;k=k.filter(le=>Ge(le.contentType));let ot=R.totalBytes-k.reduce((le,it)=>le+(it.size||0),0);console.log(` --assets-only: kept ${k.length}/${ae} records (dropped ${(ot/1024).toFixed(1)} KiB of API responses)`)}}}d?.transformedBundle&&(X=await _t(T,d.transformedBundle.byteLength));let n=await x(T,`(() => {
|
|
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:ye,recordingStartedAtMs:be}))})
|
|
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:[];B=[...B,...a.filter(de)].sort((u,g)=>u.t-g.t||u.seq-g.seq)}finally{T.close()}d||(console.error(" could not read bundle snapshot \u2014 is rnx running and is the bundle loaded?"),m(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.`),m(2));let S,ve=!1;if(X!==null)S=new TextEncoder().encode(X),ve=!0,console.log(` using post-transform bundle: ${(S.byteLength/1024).toFixed(1)} KiB`);else{let n=Pt(d.bundleUrl);n!==d.bundleUrl&&console.log(" forcing lazy=false for self-contained bundle"),console.log(` capturing: ${n}`),S=await Je(n),console.log(` main bundle: ${(S.byteLength/1024).toFixed(1)} KiB`)}let z=Me.filter(n=>n.url!==d.bundleUrl);we&&(z=z.filter(n=>Ge(n.contentType))),console.log(` fetching ${z.length} extra files\u2026`);let Z=(await Promise.all(z.map(async n=>{try{let a=await Je(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),Xe=Z.reduce((n,a)=>n+a.bytes.byteLength,0);console.log(` ${Z.length} extra files: ${(Xe/1024).toFixed(1)} KiB`);let _;i&&(_=w(i)),B.sort((n,a)=>n.t-a.t||n.seq-a.seq);let Re=B.map(n=>JSON.stringify(n)).join(`
|
|
97
|
+
`),ee=ge(Re?`${Re}
|
|
98
|
+
`:"");console.log(` trace timeline: ${B.length} events${Se?` (${Se} from runner sidecars)`:""}`);let v;l&&(v=w(l),console.log(` attaching screenshot: ${(v.byteLength/1024).toFixed(1)} KiB`));let F=f?vt(f):[];F.length>0&&console.log(` attaching ${F.length} interaction snapshots`);let E,I;if(V){let n=g=>{try{return w(He.join(V,g),"utf8")}catch{return null}},a=g=>{let P=n(g);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(g=>g!==null)&&(E=ge(JSON.stringify(u)),console.log(` attaching failure bundle: ${(E.byteLength/1024).toFixed(1)} KiB gz`));try{I=w(He.join(V,"screenshot.png"))}catch{}}let A,L,xe;if(c){if(A=w(c),L=c.endsWith(".mp4")?"video/mp4":c.endsWith(".gif")?"image/gif":void 0,L||(console.error(" preview flow videos must be mp4 or gif"),m(1)),W){let n=Number(W);(!Number.isFinite(n)||n<=0)&&(console.error(` invalid --video-duration-ms: ${W}`),m(1)),xe=Math.round(n)}console.log(` attaching flow video: ${(A.byteLength/1024).toFixed(1)} KiB (${L})`)}let te=G(),D=Fe(te),U=me();te||(console.error(" preview uploads need auth."),console.error(" set RNX_API_KEY=sk_rnx_..., run `rnx login`, or use the Contrast github runner."),m(1));let Ze=J(te),et=(()=>{try{return new URL(d.bundleUrl).origin}catch{return null}})(),H=(n,a,u,g,P,$,Ie,C)=>{let R=Le($),h=R?ge(n):n;return{url:a,urlhash:u,method:g,bodyHash:P,requestVaryHash:C,contentType:$,responseHeaders:Ie,bytes:h,encoding:R?"gzip":void 0}},ke=[],ne=At(d.pageHref)||"";if(ne){let n=await _e(ne,{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(H(Buffer.from(a.bytes),a.url,a.urlhash,"GET","-",a.contentType))}let Be=[],re=Ut(d.pageHref)||"";if(re){let n=await $e(re,{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)Be.push(H(Buffer.from(a.bytes),a.url,a.urlhash,"GET","-",a.contentType))}let se=[...Z.map(n=>H(n.bytes,n.url,n.urlhash,"GET","-",n.contentType,n.responseHeaders,n.requestVaryHash)),...k.map(n=>H(Buffer.from(n.bodyBase64,"base64"),n.url,n.urlhash,n.method||"GET",n.bodyHash||"-",n.contentType,n.responseHeaders,n.requestVaryHash)),...ke,...Be],oe=Ce(S),tt=Mt("sha256").update(S).digest("hex");console.log(` bundle raw=${(S.byteLength/1024).toFixed(1)} KiB br=${(oe.byteLength/1024).toFixed(1)} KiB`);let nt={contentHash:tt,bundleSizeBytes:S.byteLength,bundleContentType:It(d.bundleUrl),bundleEncoding:"br",bundleMinified:!1,bundleOrigin:et,runtimeVersion:d.runtimeVersion??void 0,appFonts:ne||void 0,appSplash:re||void 0,entry:d.entry,isTransformed:ve,deviceSpec:d.deviceSpec,installationId:D?.installationId??void 0,repoId:D?.repoId,owner:Y??D?.owner??U.owner??void 0,repo:Q??D?.repo??U.repo??void 0,branch:U.branch??void 0,commitSha:U.commitSha??void 0,githubUsername:U.githubUsername??void 0,pullRequestNumber:U.pullRequestNumber??void 0,pullRequestTitle:U.pullRequestTitle??void 0,billingKind:O==="test_run"?"test_run":void 0,runScope:We||void 0,files:se.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:_?{sizeBytes:_.byteLength}:void 0,timeline:{sizeBytes:ee.byteLength,encoding:"gzip"},traceFrameStats:Ct(Te),recordedDurationMs:ye,recordingStartedAtMs:be,failureBundle:E?{sizeBytes:E.byteLength,encoding:"gzip"}:void 0,snapshots:(()=>{let n=[];v&&n.push({id:"landing",label:"Landing",kind:"landing",t:0,contentType:"image/png",sizeBytes:v.byteLength}),I&&n.push({id:"failure",label:"Failure",kind:"failure",contentType:"image/png",sizeBytes:I.byteLength});for(let a of F)n.push(a.meta);return n.length>0?n:void 0})(),flowVideo:A&&L?{sizeBytes:A.byteLength,contentType:L,durationMs:xe}:void 0},Ee=new Map;for(let n of se)Ee.set(n.urlhash,n.bytes);let j=new Map;v&&j.set("landing",v),I&&j.set("failure",I);for(let n of F)j.set(n.meta.id,n.bytes);let rt=Date.now(),b=oe.byteLength;for(let n of se)b+=n.bytes.byteLength;_&&(b+=_.byteLength),b+=ee.byteLength,v&&(b+=v.byteLength),I&&(b+=I.byteLength);for(let n of F)b+=n.bytes.byteLength;E&&(b+=E.byteLength),A&&(b+=A.byteLength);let st=`${N(s)}/api/preview/upload/init`;console.log(` init: ${st}`);let q;try{let n=await Oe({originBase:s,initBody:nt,bundleBytes:oe,filesByHash:Ee,extras:{eventsBytes:_,timelineBytes:ee,videoBytes:A,failureBundleBytes:E,snapshotBytes:j},authHeader:Ze,concurrency:16});q=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()-rt}ms (${(b/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."),m(1)),a.status===402&&(console.error(` ${St(a.responseText)??"preview uploads require Personal, Team, or an active trial \u2014 upgrade from the billing dialog."}`),m(1)),console.error(` ${a.message??`${a.phase??"upload"} failed: ${String(n)}`}`),m(1)}let ie=`${o}${q.url}`;return console.log(`
|
|
99
|
+
stored ${q.filesStored??0} extra files`),console.log(` preview: ${ie}`),Ye&&await Ne(ie),{previewUrl:ie,shareId:q.id}}export{me as a,Kt as b,Vt as c,Wt as d,Rt as e,Bt as f,mn as g};
|