rnxsim 0.1.346 → 0.1.348
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/cli/commands/welcome.ts +19 -17
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-U6HZUHAQ.js → agent-VOCGVTX2.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-IM2VL6XP.js → agent-wrapper-FJ65K7VP.js} +2 -2
- package/dist-cli/chunks/{app-fonts-LHVTPWCN.js → app-fonts-DUJRSKPV.js} +2 -2
- package/dist-cli/chunks/{assert-UMGCZXWN.js → assert-TWQWK2AW.js} +2 -2
- package/dist-cli/chunks/{auth-PQY57FPY.js → auth-AQ3PDHBU.js} +2 -2
- package/dist-cli/chunks/{beta-3MMNRHL7.js → beta-E5MXYTSU.js} +2 -2
- package/dist-cli/chunks/{camera-UKISEHMH.js → camera-644CQ6CM.js} +2 -2
- package/dist-cli/chunks/{chunk-FSYB2S6Q.js → chunk-2C23SW2O.js} +2 -2
- package/dist-cli/chunks/{chunk-6UW6O575.js → chunk-2W2WZV6U.js} +2 -2
- package/dist-cli/chunks/{chunk-HS2BME6V.js → chunk-32GBZENF.js} +1 -1
- package/dist-cli/chunks/{chunk-6VH3UUYQ.js → chunk-3H3VFCQA.js} +2 -2
- package/dist-cli/chunks/{chunk-6Q6S53R7.js → chunk-4WBCIUI5.js} +1 -1
- package/dist-cli/chunks/{chunk-WAC75WN6.js → chunk-52F4KQTG.js} +2 -2
- package/dist-cli/chunks/{chunk-YM4L2CFB.js → chunk-5AYTVU6P.js} +2 -2
- package/dist-cli/chunks/{chunk-6MUEKKJ4.js → chunk-5C2YOOQB.js} +1 -1
- package/dist-cli/chunks/{chunk-LPXKPZ4B.js → chunk-5UDXV7UU.js} +1 -1
- package/dist-cli/chunks/{chunk-IBNK7SWL.js → chunk-6QUIXWY4.js} +2 -2
- package/dist-cli/chunks/{chunk-IUG4GWQC.js → chunk-7KGKGYKZ.js} +2 -2
- package/dist-cli/chunks/{chunk-LYLK5VRP.js → chunk-7VUV64H6.js} +2 -2
- package/dist-cli/chunks/{chunk-3KPJVR63.js → chunk-BC6P65EO.js} +2 -2
- package/dist-cli/chunks/{chunk-NNXSLD76.js → chunk-BIEQJ66T.js} +2 -2
- package/dist-cli/chunks/{chunk-PPEJMNRO.js → chunk-BNMD7ZGN.js} +2 -2
- package/dist-cli/chunks/{chunk-X2WIEZ7Q.js → chunk-CHLYDXIP.js} +1 -1
- package/dist-cli/chunks/{chunk-L6GWDWGZ.js → chunk-EJ5WTR3A.js} +2 -2
- package/dist-cli/chunks/{chunk-UA54YLWR.js → chunk-EMNRIRDA.js} +3 -3
- package/dist-cli/chunks/{chunk-5WIYZI5H.js → chunk-EOXI7D6H.js} +2 -2
- package/dist-cli/chunks/{chunk-VZ6YFPIN.js → chunk-EZSBYWMS.js} +3 -3
- package/dist-cli/chunks/{chunk-YXDR4CAQ.js → chunk-F5E3GJAF.js} +1 -1
- package/dist-cli/chunks/{chunk-TBVBWJJL.js → chunk-HNYPDSJ6.js} +2 -2
- package/dist-cli/chunks/{chunk-I3GUDHG2.js → chunk-I5KU5FGG.js} +2 -2
- package/dist-cli/chunks/{chunk-7CJNUNQA.js → chunk-ILF4REF4.js} +2 -2
- package/dist-cli/chunks/{chunk-EP6XBKPM.js → chunk-JLWC7UJR.js} +1 -1
- package/dist-cli/chunks/{chunk-K4PZLT2K.js → chunk-JPYL2LYZ.js} +1 -1
- package/dist-cli/chunks/{chunk-LAVDDUQR.js → chunk-JTGES3IH.js} +1 -1
- package/dist-cli/chunks/{chunk-TAQYETRH.js → chunk-JXA2VQXZ.js} +2 -2
- package/dist-cli/chunks/{chunk-6SQCDLTJ.js → chunk-KF6QGGYJ.js} +1 -1
- package/dist-cli/chunks/{chunk-36P343FE.js → chunk-MCKYUOMA.js} +2 -2
- package/dist-cli/chunks/{chunk-6GXUQ3DM.js → chunk-MYOLOVHV.js} +2 -2
- package/dist-cli/chunks/{chunk-JPVXLY7X.js → chunk-NSAUGFN3.js} +1 -1
- package/dist-cli/chunks/{chunk-EYRKIWHE.js → chunk-O7ZWWZA6.js} +2 -2
- package/dist-cli/chunks/{chunk-I4HVFKLM.js → chunk-OKF5M2Z5.js} +2 -2
- package/dist-cli/chunks/{chunk-54Y5IXWQ.js → chunk-PCVP5LMW.js} +2 -2
- package/dist-cli/chunks/{chunk-T4JPZI32.js → chunk-PPURCICX.js} +1 -1
- package/dist-cli/chunks/{chunk-IUIKD2YI.js → chunk-QXH2M3VL.js} +1 -1
- package/dist-cli/chunks/{chunk-EVX6Y7ZM.js → chunk-RGOUICK3.js} +2 -2
- package/dist-cli/chunks/{chunk-CD2LITQX.js → chunk-S7YC23BL.js} +1 -1
- package/dist-cli/chunks/{chunk-UV3TXNMG.js → chunk-SZRLMZHI.js} +1 -1
- package/dist-cli/chunks/{chunk-5KMV7NAJ.js → chunk-TAG7EJME.js} +2 -2
- package/dist-cli/chunks/{chunk-BQDGFR4B.js → chunk-UONC7KUI.js} +2 -2
- package/dist-cli/chunks/{chunk-Y2C3CZVD.js → chunk-UWE33SLE.js} +1 -1
- package/dist-cli/chunks/{chunk-Z6P427WC.js → chunk-V5EMBTTF.js} +2 -2
- package/dist-cli/chunks/{chunk-SEWGXJG6.js → chunk-VARLW54M.js} +3 -3
- package/dist-cli/chunks/{chunk-6XJGGFMD.js → chunk-VEXSD6UX.js} +1 -1
- package/dist-cli/chunks/{chunk-PNH3YBZ4.js → chunk-VP6GLOZV.js} +2 -2
- package/dist-cli/chunks/{chunk-BSIVS2SQ.js → chunk-WC3A7REV.js} +1 -1
- package/dist-cli/chunks/{chunk-ME46FC4L.js → chunk-XFPFJPC3.js} +1 -1
- package/dist-cli/chunks/{chunk-HPCTBEAP.js → chunk-XKXFMGVL.js} +1 -1
- package/dist-cli/chunks/{chunk-KNIKUJPD.js → chunk-XNDTB3MY.js} +1 -1
- package/dist-cli/chunks/{chunk-DGH3D6WS.js → chunk-XSZTWXKO.js} +2 -2
- package/dist-cli/chunks/{chunk-XWTYFWZ3.js → chunk-ZJM65MGO.js} +2 -2
- package/dist-cli/chunks/{chunk-W54SRZ5K.js → chunk-ZP6XJFIZ.js} +2 -2
- package/dist-cli/chunks/{chunk-75LMZXF5.js → chunk-ZYN24EAC.js} +2 -2
- package/dist-cli/chunks/{cleanup-KXPS5VSK.js → cleanup-TUEKM74E.js} +2 -2
- package/dist-cli/chunks/cli-version-G245R6SZ.js +4 -0
- package/dist-cli/chunks/{compat-JWF7N3VO.js → compat-IUPOKLTA.js} +2 -2
- package/dist-cli/chunks/{config-M42VJXNK.js → config-ASM5XAOP.js} +2 -2
- package/dist-cli/chunks/{control-HMZDIS6P.js → control-7MNUENCP.js} +2 -2
- package/dist-cli/chunks/daemon-Z4QQZ3MU.js +4 -0
- package/dist-cli/chunks/{debug-F44GWYMF.js → debug-DHVKEWB4.js} +3 -3
- package/dist-cli/chunks/{desktop-YJMWW6MW.js → desktop-GLLBZHMW.js} +3 -3
- package/dist-cli/chunks/{detox-5B4ASTJO.js → detox-WODZ2EWW.js} +2 -2
- package/dist-cli/chunks/{device-2544YZNY.js → device-X7CS5MQG.js} +2 -2
- package/dist-cli/chunks/{diagnose-LS4245JR.js → diagnose-TYZCBRU3.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-XYL2HQQY.js → disk-cleanup-FPURW754.js} +2 -2
- package/dist-cli/chunks/drivers-3JKGMIIZ.js +4 -0
- package/dist-cli/chunks/{film-LS3TIZRM.js → film-37ZSWJKU.js} +3 -3
- package/dist-cli/chunks/flow-GQFLFIGW.js +4 -0
- package/dist-cli/chunks/help-YTY42PPH.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-HGN2EEQR.js → hidden-runtime-alias-6EFZUXQJ.js} +2 -2
- package/dist-cli/chunks/{home-paths-T3NTXE4U.js → home-paths-WD6TZ6QL.js} +2 -2
- package/dist-cli/chunks/inspect-HELBBLXA.js +4 -0
- package/dist-cli/chunks/install-desktop-2RRZVJNK.js +4 -0
- package/dist-cli/chunks/{login-WVP5H5NQ.js → login-2GWUX4NP.js} +2 -2
- package/dist-cli/chunks/{logout-GXX5OY6X.js → logout-BE7WGD5D.js} +2 -2
- package/dist-cli/chunks/{maestro-MQMGBNOB.js → maestro-O74P2DZG.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-CO355QV2.js → maestro-generate-6JURLX3R.js} +3 -3
- package/dist-cli/chunks/{mode-QFB3M2AA.js → mode-XYUVX7AU.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-UIPVSBHV.js → optional-demo-registry-IC4UQVTB.js} +2 -2
- package/dist-cli/chunks/{perf-TDOSW3LD.js → perf-F5ZZQCBM.js} +2 -2
- package/dist-cli/chunks/{permissions-TEVQLCGJ.js → permissions-7XDTQYJU.js} +2 -2
- package/dist-cli/chunks/privacy-XV5ZHV3E.js +4 -0
- package/dist-cli/chunks/{record-OFEQLSWA.js → record-EEKNNKJT.js} +3 -3
- package/dist-cli/chunks/{report-issue-B2UPOERJ.js → report-issue-56Z3NWRI.js} +2 -2
- package/dist-cli/chunks/reset-B6U3JO4X.js +4 -0
- package/dist-cli/chunks/runtime-PXGXWBEU.js +4 -0
- package/dist-cli/chunks/{screenshot-command-NTLAY7QN.js → screenshot-command-MQ3WIBXC.js} +3 -3
- package/dist-cli/chunks/{screenshot-layers-BBLKNRQU.js → screenshot-layers-6JAJQ3H2.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-6GHIRCTG.js → screenshots-capture-NPW3E2QE.js} +2 -2
- package/dist-cli/chunks/{serve-H6GJ4OHW.js → serve-KRV5HEU6.js} +15 -15
- package/dist-cli/chunks/{setup-6YLKSMWS.js → setup-IY4W4XPM.js} +2 -2
- package/dist-cli/chunks/{skills-FUL7D6C7.js → skills-FLCPBNIS.js} +2 -2
- package/dist-cli/chunks/{state-O2HE7XSR.js → state-E73SW66N.js} +2 -2
- package/dist-cli/chunks/{storage-WIZTF7RN.js → storage-SE6JKPRT.js} +2 -2
- package/dist-cli/chunks/store-S2P72CGA.js +4 -0
- package/dist-cli/chunks/telemetry-SJ6SACTK.js +4 -0
- package/dist-cli/chunks/{timeline-MA4JT7UJ.js → timeline-SRNLNLRI.js} +2 -2
- package/dist-cli/chunks/{upgrade-H5LSDXBH.js → upgrade-6EBXQN2P.js} +2 -2
- package/dist-cli/chunks/upload-FV534V6T.js +4 -0
- package/dist-cli/chunks/{version-4UWEEDVP.js → version-F3LHN6MY.js} +2 -2
- package/dist-cli/chunks/{web-F3LXRN3K.js → web-AIQHG4YK.js} +2 -2
- package/dist-cli/chunks/welcome-746DEM6E.js +5 -0
- package/dist-cli/chunks/{what-happened-6OSNLOAY.js → what-happened-QEZB6FLC.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +2 -4
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +3 -4
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/host/bridge-host.ts +2 -7
- package/dist-cli/chunks/cli-version-LJ6NFLBP.js +0 -4
- package/dist-cli/chunks/daemon-MQ4UYKNQ.js +0 -4
- package/dist-cli/chunks/drivers-P5CRSKH6.js +0 -4
- package/dist-cli/chunks/flow-7V77GXAB.js +0 -4
- package/dist-cli/chunks/help-HRESIFZX.js +0 -4
- package/dist-cli/chunks/inspect-UC44UH4M.js +0 -4
- package/dist-cli/chunks/install-desktop-RDV66JHG.js +0 -4
- package/dist-cli/chunks/privacy-DVHAMHR6.js +0 -4
- package/dist-cli/chunks/reset-XQQYM55B.js +0 -4
- package/dist-cli/chunks/runtime-GN6HITVB.js +0 -4
- package/dist-cli/chunks/store-NJ2MBZC2.js +0 -4
- package/dist-cli/chunks/telemetry-BEC6W5WP.js +0 -4
- package/dist-cli/chunks/upload-Q4DWKIA4.js +0 -4
- package/dist-cli/chunks/welcome-AZBOSIG2.js +0 -5
package/README.md
CHANGED
|
@@ -207,7 +207,8 @@ rnx open /settings # dispatch a React Native deep link into that app
|
|
|
207
207
|
Start Metro, Expo, One, or another supported React Native development server
|
|
208
208
|
the way you normally do, then run `npx rnxsim` from any directory. If one app is
|
|
209
209
|
running, rnx opens it immediately. If several are running, a human terminal gets
|
|
210
|
-
one short choice
|
|
210
|
+
one short choice. CI and agents refuse to guess and print one explicit
|
|
211
|
+
`rnx open <port>` command for each discovered app.
|
|
211
212
|
|
|
212
213
|
The first `rnx open` launches an isolated Chrome for Testing sim. The CLI
|
|
213
214
|
resolves Playwright from the app or CLI install, asks that exact package for
|
|
@@ -345,8 +346,13 @@ module.exports = withRNX(config, { open: { appName: 'My App' } })
|
|
|
345
346
|
The `open` option serves the RNX shell and opens the app in its own named
|
|
346
347
|
Electron window. `open: true` derives the name from `package.json`; use the
|
|
347
348
|
object form when the display name differs. Run `rnx desktop install` once before
|
|
348
|
-
enabling it.
|
|
349
|
-
|
|
349
|
+
enabling it. The macOS desktop download is about 109 MiB and the installed app
|
|
350
|
+
uses about 267 MiB, so the browser remains the recommended first-run path and
|
|
351
|
+
Electron is an opt-in desktop upgrade. The notarized CLI install did not produce
|
|
352
|
+
a Gatekeeper prompt on a clean profile. A Mac that previously ran an unsigned
|
|
353
|
+
development Electron build against the same user-data directory may ask for
|
|
354
|
+
one-time Keychain approval. `SOOTSIM_NO_OPEN=1` keeps the server headless. The
|
|
355
|
+
Metro wrapper also has two independent non-window opt-ins.
|
|
350
356
|
`devServer` serves the RNX shell from the Metro process. `productionBundles`
|
|
351
357
|
lets explicitly marked production bundle requests use the RNX host
|
|
352
358
|
implementations of React and React Native while the rest of the app receives
|
package/cli/commands/welcome.ts
CHANGED
|
@@ -10,19 +10,6 @@ function serverLabel(server: DiscoveredServer): string {
|
|
|
10
10
|
return `${server.projectName?.trim() || server.framework} on :${server.port}`
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
async function chooseServer(
|
|
14
|
-
discovered: DiscoveredServer[],
|
|
15
|
-
): Promise<DiscoveredServer | null> {
|
|
16
|
-
if (discovered.length === 0) return null
|
|
17
|
-
const ordered = [...discovered].sort((a, b) => a.port - b.port)
|
|
18
|
-
if (ordered.length === 1 || !canPromptForPrivacyChoice()) return ordered[0] ?? null
|
|
19
|
-
const selected = await select(
|
|
20
|
-
'which running app should rnx open?',
|
|
21
|
-
ordered.map(serverLabel),
|
|
22
|
-
)
|
|
23
|
-
return ordered[selected] ?? ordered[0] ?? null
|
|
24
|
-
}
|
|
25
|
-
|
|
26
13
|
export async function runWelcome(): Promise<number> {
|
|
27
14
|
const privacy = readPrivacyPreferences()
|
|
28
15
|
console.log('\n welcome to rnx')
|
|
@@ -31,14 +18,29 @@ export async function runWelcome(): Promise<number> {
|
|
|
31
18
|
)
|
|
32
19
|
console.log(' looking for a running React Native app…')
|
|
33
20
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
)
|
|
37
|
-
|
|
21
|
+
const discovered = await scanDevServers({
|
|
22
|
+
excludePorts: [DEFAULT_SOOTSIM_BRIDGE_PORT],
|
|
23
|
+
})
|
|
24
|
+
const ordered = [...discovered].sort((a, b) => a.port - b.port)
|
|
25
|
+
if (ordered.length === 0) {
|
|
38
26
|
console.error(' no running React Native development server found.')
|
|
39
27
|
console.error(' start your app normally, then run `npx rnxsim` again.')
|
|
40
28
|
return 1
|
|
41
29
|
}
|
|
30
|
+
if (ordered.length > 1 && !canPromptForPrivacyChoice()) {
|
|
31
|
+
console.error(' multiple React Native development servers found.')
|
|
32
|
+
for (const server of ordered) {
|
|
33
|
+
console.error(` ${serverLabel(server)}: rnx open ${server.port}`)
|
|
34
|
+
}
|
|
35
|
+
console.error(' choose one explicitly; automated runs do not guess.')
|
|
36
|
+
return 1
|
|
37
|
+
}
|
|
38
|
+
const selectedIndex =
|
|
39
|
+
ordered.length === 1
|
|
40
|
+
? 0
|
|
41
|
+
: await select('which running app should rnx open?', ordered.map(serverLabel))
|
|
42
|
+
const selected = ordered[selectedIndex]
|
|
43
|
+
if (!selected) throw new Error('rnx app selection returned an invalid choice')
|
|
42
44
|
|
|
43
45
|
console.log(` found ${serverLabel(selected)} · opening simulator…`)
|
|
44
46
|
const bridgePort = await runOpenCommand([selected.bundleUrl])
|
package/dist-cli/bin.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! rnx v0.1.
|
|
2
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
3
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
4
4
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
5
|
-
import{a as g,b as f}from"./chunks/chunk-
|
|
5
|
+
import{a as g,b as f}from"./chunks/chunk-S7YC23BL.js";import{a as m}from"./chunks/chunk-4WBCIUI5.js";import"./chunks/chunk-5UDXV7UU.js";function A(a){let t=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(t)||t.startsWith("sim disconnected:")||t.startsWith("bridge never reconnected")||t.startsWith("multiple sims are connected:")||t.startsWith("saved sim ")||t.startsWith("no sim connected with id ")||t.startsWith("could not connect to ws://")||t.startsWith("rnx bridge daemon is not running")||t.startsWith("rnx bridge lockfile is fresh")||t.startsWith("rnx bridge exited before becoming ready")||t.startsWith(`${m.commandName} open: requested bridge port`)||t.startsWith("background daemon setup is unavailable")||t.startsWith("rnx bridge did not start within"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${t}
|
|
6
6
|
`),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
|
|
7
7
|
`):process.stderr.write(`${t}
|
|
8
8
|
`),process.exit(1)}process.on("unhandledRejection",A);process.on("uncaughtException",A);var k=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,S=new Set(["desktop"]);function C(a){!k||!S.has(a)||(process.stderr.write(` ${m.commandName} ${a} isn't available in the standalone binary \u2014
|
|
9
9
|
it needs vite / electron / playwright from a project's node_modules.
|
|
10
10
|
run the npm package instead:
|
|
11
11
|
${m.commandName} ${a}
|
|
12
|
-
`),process.exit(1))}var e=f(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:a}=await import("./chunks/hidden-runtime-alias-
|
|
13
|
-
`)}var h=!1;async function v(){if(!h&&(h=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:a}=await import("./chunks/disk-cleanup-
|
|
12
|
+
`),process.exit(1))}var e=f(process.argv);if(!e.command&&e.commandArgs.length>0){let{resolveHiddenRuntimeAlias:a}=await import("./chunks/hidden-runtime-alias-6EFZUXQJ.js");e=a(e)}var $=e.command==="cleanup"&&e.commandArgs.length===1&&e.commandArgs[0]==="--automatic-worker";if(!$&&!e.help&&!e.version&&e.command!=="config"&&e.command!=="telemetry"){let{ensurePrivacyChoice:a}=await import("./chunks/privacy-XV5ZHV3E.js");await a({prompt:!0})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:a}=await import("./chunks/home-paths-WD6TZ6QL.js"),t=a();t&&process.stderr.write(` ${m.name} engine upgraded to v${t.to}`+(t.from?` (from v${t.from})`:"")+` \xB7 what's new: ${m.origin}/changelog
|
|
13
|
+
`)}var h=!1;async function v(){if(!h&&(h=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{isAutomaticSootsimCleanupComplete:a}=await import("./chunks/disk-cleanup-FPURW754.js");if(a())return;let{spawn:t}=await import("node:child_process"),i=["cleanup","--automatic-worker"],d=process.argv[1],p=k?t(process.execPath,i,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):d?t(process.execPath,[d,...i],{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):t(m.commandName,i,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env});p.once("error",w=>{process.stderr.write(` ${m.name} automatic cleanup will retry on the next run: ${w.message}
|
|
14
14
|
`)}),p.unref()}catch(a){process.stderr.write(` ${m.name} automatic cleanup will retry on the next run: ${a instanceof Error?a.message:String(a)}
|
|
15
|
-
`)}}async function o(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-
|
|
15
|
+
`)}}async function o(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-SJ6SACTK.js");await t(),await v(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-G245R6SZ.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-E5MXYTSU.js"),d=t?` \xB7 ${i}`:"";console.log(`${m.commandName} v${a()}${d}`);let{readActiveRuntime:p}=await import("./chunks/home-paths-WD6TZ6QL.js"),w=p();console.log(w?`runtime v${w}`:"runtime not installed"),await o(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-YTY42PPH.js");a(),await o(0)}var n=e.globalFlags.port,c=e.verbose,u=e.globalFlags.device,l=e.globalFlags.theme,y=e.globalFlags.driver,x=e.globalFlags.headless===!0,b=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,r=b?["--sim",b,...e.commandArgs]:e.commandArgs;if(u||l){let{settingsStore:a}=await import("./chunks/store-S2P72CGA.js"),t={};u&&(t.deviceModel=u),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runWelcome:a}=await import("./chunks/welcome-746DEM6E.js");await o(await a())}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let t=e.commandArgs.find(i=>!i.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(` run \`${m.commandName} --help\` to see the full surface.`),await o(1)}let{printHelp:a}=await import("./chunks/help-YTY42PPH.js");a(),await o(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:i}=await import("./chunks/skills-FLCPBNIS.js");await i(e.commandArgs),await o(0)}if(s==="state"){let{runState:i}=await import("./chunks/state-E73SW66N.js");await o(await i(r,{port:n}))}if(s==="reset"){let{runReset:i}=await import("./chunks/reset-B6U3JO4X.js");await o(await i(r,{port:n}))}let a=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",t=e.commandArgs.find(i=>!i.startsWith("-"));if(!(s==="shell"||s==="perf"))if(a&&!t){let{printGroupHelp:i}=await import("./chunks/help-YTY42PPH.js");i(s)&&await o(0)}else{let{printCommandHelp:i}=await import("./chunks/help-YTY42PPH.js");i(a&&t?t:s,{prefer:a&&t?"verb":"command",group:a&&t?s:void 0}),await o(0)}}C(s);if(g.has(s)){let{runInspect:a}=await import("./chunks/inspect-HELBBLXA.js");await a([s,...r],{port:n,verbose:c})}else switch(s){case"assert":{let{runAssert:a}=await import("./chunks/assert-TWQWK2AW.js");await a(e.commandArgs);break}case"detox":{let{runDetox:a}=await import("./chunks/detox-WODZ2EWW.js");await a(e.commandArgs,{port:n,verbose:c});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-O74P2DZG.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"record":{let{runRecord:a}=await import("./chunks/record-EEKNNKJT.js");await a(r,{port:n,verbose:c});break}case"film":{let{runFilm:a}=await import("./chunks/film-37ZSWJKU.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"storage":{let{runStorage:a}=await import("./chunks/storage-SE6JKPRT.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"state":{let{runState:a}=await import("./chunks/state-E73SW66N.js"),t=await a(r,{port:n});await o(t)}case"reset":{let{runReset:a}=await import("./chunks/reset-B6U3JO4X.js"),t=await a(r,{port:n});await o(t)}case"perf":{let{runPerf:a}=await import("./chunks/perf-F5ZZQCBM.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshotCommand:a}=await import("./chunks/screenshot-command-MQ3WIBXC.js"),t=await a(r,{port:n,verbose:c});await o(typeof t=="number"?t:0)}case"camera":{let{runCamera:a}=await import("./chunks/camera-644CQ6CM.js"),t=await a(r,{port:n});await o(typeof t=="number"?t:0)}case"mode":{let{runMode:a}=await import("./chunks/mode-XYUVX7AU.js");await a(r,{port:n,verbose:c});break}case"permissions":{let{runPermissions:a}=await import("./chunks/permissions-7XDTQYJU.js"),t=await a(r,{port:n,verbose:c});await o(t)}case"debug":{let{runDebug:a}=await import("./chunks/debug-DHVKEWB4.js");await a(r,{port:n,verbose:c});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-SRNLNLRI.js");await a(r,{port:n,verbose:c});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-QEZB6FLC.js");await a(r,{port:n,verbose:c});break}case"open":{let{runOpenCommand:a}=await import("./chunks/control-7MNUENCP.js");await a(r,{port:n});break}case"use":{let{runUseCommand:a}=await import("./chunks/control-7MNUENCP.js");await a(r,{port:n});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-7MNUENCP.js");await a(r,{port:n});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-7MNUENCP.js");await a(r,{port:n});break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-X7CS5MQG.js");await a(r,{port:n});break}case"compat":{let{runCompat:a}=await import("./chunks/compat-IUPOKLTA.js");await a(e.commandArgs);break}case"report-issue":{let{runReportIssue:a}=await import("./chunks/report-issue-56Z3NWRI.js"),t=await a(e.commandArgs);await o(t)}case"desktop":{let{runDesktop:a}=await import("./chunks/desktop-GLLBZHMW.js");await a(e.commandArgs,{port:n,device:u});break}case"login":{let{runLogin:a}=await import("./chunks/login-2GWUX4NP.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-BE7WGD5D.js");await a();break}case"auth":{let{runAuth:a}=await import("./chunks/auth-AQ3PDHBU.js");await a(e.commandArgs);break}case"setup":{let{runSetup:a}=await import("./chunks/setup-IY4W4XPM.js");await a(e.commandArgs);break}case"serve":{let{runServe:a}=await import("./chunks/serve-KRV5HEU6.js");await a(e.commandArgs,{port:n});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-Z4QQZ3MU.js");await a(e.commandArgs,{port:n});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-PXGXWBEU.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-6EBXQN2P.js");await a(e.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-F3LHN6MY.js");await a(e.commandArgs);break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-VOCGVTX2.js"),t=await a(e.commandArgs);await o(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-FJ65K7VP.js"),t=await a(e.commandArgs);await o(t)}case"skill":{let{runSkill:a}=await import("./chunks/skills-FLCPBNIS.js");await a(e.commandArgs);break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-DUJRSKPV.js");await a(e.commandArgs);break}case"config":{let{runConfig:a}=await import("./chunks/config-ASM5XAOP.js");await a(e.commandArgs);break}case"cleanup":{let{runCleanup:a}=await import("./chunks/cleanup-TUEKM74E.js"),t=await a(e.commandArgs);await o(t)}default:console.error(` unknown command: ${s}`),console.error(` run \`${m.commandName} --help\` to see the full surface.`),await o(1)}await v();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as b,b as E,c as A,d as l,e as S,g as x,h as j,j as T,n as I,o as k,p as D,q as g,r as O,s as C}from"./chunk-
|
|
4
|
+
import{a as b,b as E,c as A,d as l,e as S,g as x,h as j,j as T,n as I,o as k,p as D,q as g,r as O,s as C}from"./chunk-ZJM65MGO.js";import"./chunk-XKXFMGVL.js";import{c as $}from"./chunk-TAG7EJME.js";import"./chunk-ZYN24EAC.js";import"./chunk-EOXI7D6H.js";import"./chunk-I5KU5FGG.js";import"./chunk-ILF4REF4.js";import"./chunk-HNYPDSJ6.js";import"./chunk-PPURCICX.js";import"./chunk-F5E3GJAF.js";import{j as y}from"./chunk-JLWC7UJR.js";import"./chunk-RGOUICK3.js";import"./chunk-4WBCIUI5.js";import"./chunk-VEXSD6UX.js";import"./chunk-5UDXV7UU.js";import w from"node:fs";import d from"node:path";import{spawn as _}from"node:child_process";import F from"node:net";import{WebSocket as R}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new R(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to rnx daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async sendClaimedPrompt(e,t){return this.send("agent:send-claimed-prompt",{simId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==R.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function M(n=7668,e=400){return new Promise(t=>{let r=new F.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function B(n={}){let e=n.port??7668;if(await M(e))return{alreadyRunning:!0};if(y())throw new c(`no rnx bridge on port ${e}. run \`rnx setup\` to install the background daemon, or \`rnx serve\` in another shell.`,"DEV_HOST_REFUSED");let{cmd:t,prefixArgs:r}=C(),s=[...r,"serve","--quiet"];e!==7668&&s.push("--port",String(e));let o=_(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await M(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned rnx daemon on port ${e} but it did not come up in time. run \`rnx serve\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await B({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function ge(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return L(),0;case"attach":return await W(t);case"projects":return await J();case"project":return await V(t);case"sessions":return await H(t);case"start":return await G(t);case"prompt":return await q(t);case"watch":return await K(t);case"transcript":return await z(t);case"end":return await Q(t);case"paths":return await Y();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
5
5
|
`),L(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
|
|
6
6
|
`),1;throw r}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function L(){$("agent")}function P(n,e){let t={},r=[];for(let s=0;s<n.length;s++){let o=n[s],i=e[o];i==="value"?(t[o]=n[s+1]??"",s++):i==="bool"?t[o]=!0:r.push(o)}return{flags:t,positional:r}}function U(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function W(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),r=t[0];if(!r)return process.stderr.write(`usage: rnx agent attach <dir> [--name X] [--provider codex|claude]
|
|
7
7
|
`),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{b as M}from"./chunk-
|
|
4
|
+
import{b as M}from"./chunk-XKXFMGVL.js";import"./chunk-5UDXV7UU.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as C,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,f=!1,a=new Promise(s=>{t.on("exit",(o,e)=>{f=!0;let p=new Error(`codex app-server exited (code=${o}, signal=${e??""})`);for(let{reject:y}of r.values())y(p);r.clear(),s({code:o,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let o=s.trim();if(!o)return;let e;try{e=JSON.parse(o)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,y=p!=null?r.get(p):void 0;if(!y)return;r.delete(p),e.error?y.reject(new b(e.error.message,e.error.code,e.error.data)):y.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let y of p)try{y(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let o=m.get("__stderr__");if(o)for(let e of o)try{e({text:s})}catch{}});function n(s){if(!f)try{t.stdin.write(JSON.stringify(s)+`
|
|
5
5
|
`)}catch{}}return{exited:a,on(s,o){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(o),()=>{e?.delete(o)}},request(s,o){if(f)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,y)=>{r.set(e,{resolve:l=>p(l),reject:y,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:o})})},notify(s,o){n({jsonrpc:"2.0",method:s,params:o})},async shutdown(s=1500){if(f)return;try{t.stdin.end()}catch{}let o=setTimeout(()=>{if(!f)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(o)}},kill(s="SIGTERM"){if(!f)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return C(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let f=t[u];f&&(r[f]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: rnx agent-wrapper --session-id <id> --project-id <id>
|
|
6
6
|
--provider codex|claude --cwd <path>
|
|
7
7
|
--prompt-in <fifo> --events-out <fifo>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{o as p}from"./chunk-
|
|
4
|
+
import{o as p}from"./chunk-ZP6XJFIZ.js";import"./chunk-KF6QGGYJ.js";import"./chunk-JTGES3IH.js";import"./chunk-5UDXV7UU.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let r=t.find(i=>i.startsWith(`--${e}=`));return r?r.slice(e.length+3):void 0}async function x(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),r=f(t,"manifest");if((!o||!r)&&(console.error(" usage: rnx app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let i=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of i){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(r))try{let n=JSON.parse(y(r,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(r,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await x(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import"./chunk-
|
|
4
|
+
import"./chunk-5UDXV7UU.js";import{spawn as v}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=v(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
|
|
5
5
|
`).slice(-2).join(" | ").slice(0,200);n({ok:!1,payload:null,reason:`verb exited ${o}${a?`: ${a}`:""}`});return}if(!t.trim()){n({ok:!1,payload:null,reason:"verb produced no output"});return}try{let a=JSON.parse(t);n({ok:!0,payload:a})}catch{n({ok:!1,payload:null,reason:`verb output was not valid json: ${t.slice(0,120)}`})}})})}function y(s,r){let u=r.split(".").filter(e=>e.length>0),n=s;for(let e of u){if(n==null)return{found:!1};if(Array.isArray(n)){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{found:!1};n=n[t];continue}if(typeof n=="object"){let t=n;if(!(e in t))return{found:!1};n=t[e];continue}return{found:!1}}return{found:!0,value:n}}function d(s){return Array.isArray(s)?s.length:s&&typeof s=="object"?Object.keys(s).length:null}async function A(s,r){let{kind:u,args:n}=s;switch(u){case"--exists":return r==null?{ok:!1,reason:"payload is null"}:d(r)===0?{ok:!1,reason:"payload is empty"}:{ok:!0,reason:"exists"};case"--empty":{if(r==null)return{ok:!0,reason:"payload is null"};let e=d(r);return e===0?{ok:!0,reason:"payload is empty"}:{ok:!1,reason:`payload has ${e} item(s)`}}case"--count":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:`payload not countable (${typeof r})`}:{ok:t===e,reason:`count=${t}, want=${e}`}}case"--count-at-least":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t>=e,reason:`count=${t}, want>=${e}`}}case"--count-at-most":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t<=e,reason:`count=${t}, want<=${e}`}}case"--contains":{let e=n[0],t=JSON.stringify(r);return{ok:t.includes(e),reason:t.includes(e)?`contains "${e}"`:`missing "${e}"`}}case"--not-contains":{let e=n[0],t=JSON.stringify(r);return{ok:!t.includes(e),reason:t.includes(e)?`unexpected "${e}"`:`not contains "${e}"`}}case"--matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=e.test(t);return{ok:i,reason:i?`matches /${n[0]}/`:`no match for /${n[0]}/`}}case"--not-matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=!e.test(t);return{ok:i,reason:i?`not matches /${n[0]}/`:`unexpected /${n[0]}/`}}case"--equals":{let e=n[0],t=typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):JSON.stringify(r);return{ok:t===e,reason:`got=${JSON.stringify(t)}, want=${JSON.stringify(e)}`}}case"--has-path":{let e=y(r,n[0]);return{ok:e.found,reason:e.found?`path ${n[0]} present`:`path ${n[0]} missing`}}case"--path-equals":{let[e,t]=n,i=y(r,e);if(!i.found)return{ok:!1,reason:`path ${e} missing`};let o=typeof i.value=="string"||typeof i.value=="number"||typeof i.value=="boolean"?String(i.value):JSON.stringify(i.value);return{ok:o===t,reason:`${e}=${o}, want=${t}`}}case"--jq":{let e=n[0];try{let i=(await O(e,r)).trim();return{ok:i.length>0&&i!=="null"&&i!=="false"&&i!=='""',reason:`jq: ${i.slice(0,120)}`}}catch(t){throw new Error(`jq evaluation failed: ${t.message}`)}}default:return{ok:!1,reason:`unknown predicate ${u}`}}}function O(s,r){return new Promise((u,n)=>{let e=v("jq",[s],{stdio:["pipe","pipe","pipe"]}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",n),e.on("close",o=>{if(o!==0){n(new Error(i.trim()||`jq exited ${o}`));return}u(t)}),e.stdin.end(JSON.stringify(r))})}async function T(s){(s[0]==="--help"||s[0]==="-h"||s.length===0)&&(J(),process.exit(s.length===0?2:0));let r=j(s);"error"in r&&(process.stderr.write(` assert: ${r.error}
|
|
6
6
|
`),process.exit(2));let{verbArgs:u,predicates:n,withinMs:e,negate:t,quiet:i,allowTimeout:o}=r;N(u)||(process.stderr.write(` assert: unknown or non-read verb: ${u.join(" ")}
|
|
7
7
|
supported: ${Array.from(w).sort().join(", ")}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as r}from"./chunk-
|
|
4
|
+
import{a as r}from"./chunk-BC6P65EO.js";import{d as t}from"./chunk-UONC7KUI.js";import"./chunk-JLWC7UJR.js";import"./chunk-5UDXV7UU.js";function i(){console.log(`
|
|
5
5
|
rnx auth \u2014 inspect CLI auth
|
|
6
6
|
|
|
7
7
|
usage:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a,b,c,d}from"./chunk-
|
|
4
|
+
import{a,b,c,d}from"./chunk-VEXSD6UX.js";import"./chunk-5UDXV7UU.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{m as O}from"./chunk-
|
|
4
|
+
import{m as O}from"./chunk-EJ5WTR3A.js";import"./chunk-CHLYDXIP.js";import{q as E,s as F,u as N}from"./chunk-HNYPDSJ6.js";import"./chunk-PPURCICX.js";import{r as S}from"./chunk-JLWC7UJR.js";import"./chunk-5UDXV7UU.js";import{createHash as I,randomUUID as q}from"node:crypto";import{createReadStream as D}from"node:fs";import m from"node:fs/promises";import f from"node:path";var T="/__camera-fixtures/",J=new Set([".m4v",".mov",".mp4",".webm"]);function _(){console.log(`
|
|
5
5
|
rnx camera \u2014 control the simulator camera source
|
|
6
6
|
|
|
7
7
|
usage:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c as V}from"./chunk-
|
|
4
|
+
import{c as V}from"./chunk-TAG7EJME.js";import{M as j,O as M,g as F,j as I,s as U,t as D,u as O}from"./chunk-JLWC7UJR.js";import{a as H}from"./chunk-RGOUICK3.js";import{a as k}from"./chunk-4WBCIUI5.js";import{execFileSync as J,spawnSync as c}from"child_process";import{existsSync as s,mkdirSync as P,readFileSync as ae,realpathSync as le,rmSync as h,writeFileSync as X}from"fs";import{homedir as v}from"os";import{basename as ue,dirname as C,resolve as u,sep as Q}from"path";import{execFileSync as te}from"child_process";import{chmodSync as re,mkdirSync as A,rmSync as oe,writeFileSync as T}from"fs";import{dirname as _}from"path";var ne="dev.sootsim.daemon",Y="SootSim Daemon",G="0.1.36";function q(e,t,r){let n=D(),o=O(),a=_(_(o)),l=_(o),p=`${a}/Resources`;oe(n,{recursive:!0,force:!0}),A(U(),{recursive:!0}),A(l,{recursive:!0}),A(p,{recursive:!0}),T(`${a}/Info.plist`,se()),T(`${a}/PkgInfo`,"APPL????"),T(o,ie(e,t,r)),re(o,493);try{te("codesign",["--force","--sign","-","--deep",n],{stdio:"pipe"})}catch(i){let f=i instanceof Error?i.message:String(i);console.warn(` warning: ad-hoc codesign of ${n} failed: ${f}
|
|
5
5
|
the daemon will still run, but Login Items may show a generic name.`)}return{bundlePath:n,launcherPath:o}}function se(){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
6
6
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
7
7
|
<plist version="1.0">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c as P,k as m,l as S,m as R,n as _,o as v}from"./chunk-
|
|
4
|
+
import{c as P,k as m,l as S,m as R,n as _,o as v}from"./chunk-ILF4REF4.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.348 | (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{createInterface as i}from"readline";var c=()=>i({input:process.stdin,output:process.stdout});function s(o){return new Promise(n=>{let r=c();r.question(o,t=>{r.close(),n(t.trim())})})}async function u(o,n=!0){let r=n?"[Y/n]":"[y/N]";if(!process.stdin.isTTY)return console.log(` ${o} ${r} ${n?"y":"n"} (non-interactive)`),n;let t=await s(` ${o} ${r} `);return t===""?n:t.toLowerCase().startsWith("y")}async function a(o,n){console.log(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (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 s}from"./chunk-
|
|
4
|
+
import{a as s}from"./chunk-32GBZENF.js";import{a as t}from"./chunk-UWE33SLE.js";import{C as o,D as n}from"./chunk-JLWC7UJR.js";function a(){return process.env.CI==="1"||process.env.CI==="true"||process.env.GITHUB_ACTIONS==="true"}function c(){return process.stdin.isTTY===!0&&!a()&&!t()}function l(e=o()){let r=process.env.DO_NOT_TRACK;return r==="1"||r==="true"||!c()?!1:e.configured&&e.productAnalytics}async function P(e){let r=o();if(r.configured)return r;if(!e.prompt||!c())return{productAnalytics:!1,crashReports:!1,configured:!1};let i=await s("Share anonymous package incompatibilities and error classes to improve rnx?",!1);return n({productAnalytics:i,crashReports:!1}),o()}export{c as a,l as b,P as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (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 n=Object.freeze({name:"rnx",packageName:"rnxsim",commandName:"rnx",domain:"rnxsim.com",origin:"https://rnxsim.com"});export{n as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (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 r}from"./chunk-
|
|
4
|
+
import{b as r}from"./chunk-3H3VFCQA.js";function o(){if(!r())return null;let t=process.env.VITE_POSTHOG_API_KEY||"";if(!t)return null;let e=process.env.CONTRAST_POSTHOG_HOST||process.env.VITE_POSTHOG_HOST||"https://us.i.posthog.com";return{apiKey:t,host:e.replace(/\/+$/,"")}}function i(t,e){return t.trim().slice(0,e)}function s(t){let e=t.kind==="package_incompatibility"?{package_name:i(t.packageName,160),package_version:i(t.packageVersion,80),...t.unsupportedApi?{unsupported_api:i(t.unsupportedApi,160)}:{}}:{error_class:i(t.errorClass,160)};return{event:t.kind,distinct_id:"rnx-cli-diagnostic",properties:e}}var n=[];function a(t){r()&&n.push(t)}function c(t){let e=t instanceof Error?t.constructor.name:typeof t;a({kind:"error_shape",errorClass:e})}async function l(){if(n.length===0)return;let t=o();if(!t){n.length=0;return}let e=n.splice(0,n.length).map(s);try{await fetch(`${t.host}/batch/`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({api_key:t.apiKey,batch:e}),signal:AbortSignal.timeout(2e3)})}catch{}}export{s as a,a as b,c,l as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as c}from"./chunk-
|
|
4
|
+
import{a as c}from"./chunk-BNMD7ZGN.js";import{J as u,l}from"./chunk-JLWC7UJR.js";import r from"fs";import e from"path";import{fileURLToPath as m}from"url";var s;function p(){if(s!==void 0)return s;let t=e.dirname(m(import.meta.url));for(let n=0;n<12&&t!==e.dirname(t);n++){if(r.existsSync(e.join(t,"packages/sootsim-engine/package.json"))&&r.existsSync(e.join(t,"public/sootsim")))return s=t,t;t=e.dirname(t)}return s=null,null}function d(){if(process.env.SOOTSIM_HOME&&u())return null;let t=p();if(!t)return null;let n=e.join(t,"public/sootsim");return r.existsSync(e.join(n,"index.html"))&&r.existsSync(e.join(n,"engine/index.html"))&&r.existsSync(e.join(n,"engine-tenant/worker.js"))?n:null}function g(){let t=d();if(t)return t;let n=u();if(!n)return null;let o=l(n);return r.existsSync(e.join(o,"index.html"))?o:null}var a=".runtime.localhost";function y(t){let n=t.trim();if(!c(n))throw new Error(`invalid rnx runtime version: ${t}`);let i=Buffer.from(n,"utf8").toString("hex").match(/.{1,60}/g);if(!i)throw new Error(`invalid rnx runtime version: ${t}`);return`${i.join(".")}${a}`}function f(t){return t.toLowerCase().endsWith(a)}function x(t){if(!f(t))return null;let n=t.slice(0,-a.length).split(".");if(n.length===0||n.some(i=>!/^[0-9a-f]{1,60}$/i.test(i)))return null;let o=n.join("");if(o.length%2!==0)return null;try{let i=Buffer.from(o,"hex").toString("utf8");return c(i)?i:null}catch{return null}}function S(t){let n=l(t);return r.existsSync(e.join(n,"index.html"))?n:null}function M(t){if(!f(t))return g();let n=x(t);return n?S(n):null}export{d as a,y as b,f as c,x as d,M as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
function p(){console.error(" no rnx desktop companion found."),console.error(""),console.error(" install the desktop app:"),console.error(" rnx desktop install"),console.error(""),console.error(" or run setup to install the background daemon:"),console.error(" rnx setup"),console.error("")}function t(r){console.error(""),console.error(` no sim is connected to the rnx bridge on port ${r}.`),console.error(""),console.error(" start your app dev server, then open it in rnx:"),console.error(" npx expo start --localhost --port 8081"),console.error(" rnx open 8081"),console.error(""),console.error(" then inspect the live app:"),console.error(" rnx describe")}async function a(r,n,s){let e=[];try{e=await r.listSims()}catch{}if(console.error(""),e.length===0){t(n);return}console.error(` no sim with id "${s}" is connected to the bridge on port ${n}.`),console.error(""),console.error(" connected sims:");for(let o of e){let i=[o.isPrimary?"primary":null,o.readyState,o.userVisible===!1?"hidden":o.userVisible===!0?"visible":null,o.userFocused?"focused":null].filter(Boolean).join(", ");console.error(` ${o.id} (${i})`)}console.error(""),console.error(" pass a valid --sim id, or run `rnx list` to see all sessions.")}export{p as a,t as b,a as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (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{q as j,s as A,v as K,w as v}from"./chunk-
|
|
4
|
+
import{q as j,s as A,v as K,w as v}from"./chunk-HNYPDSJ6.js";import{createHash as Y}from"node:crypto";import{mkdirSync as L,readFileSync as W,readdirSync as Q,unlinkSync as X,writeFileSync as D}from"node:fs";import{dirname as q,extname as Z,resolve as B}from"node:path";function H(t){let e=t[0]?.toLowerCase()??"toggle";return e!=="on"&&e!=="off"&&e!=="toggle"&&(console.error(` unknown argument: "${e}" (expected on | off | toggle)`),process.exit(1)),e}async function U(t,e,n){let o=j(t,{port:e.port}),i=H(o.positional),u=A({...o,commandTimeoutMs:5e3});try{let a=!!(await K(u,"SootSim.bridges.settings.get"))?.[n.modeKey],m=i==="on"?!0:i==="off"?!1:!a;if(a===m)return console.log(` ${n.displayName}: already ${m?"on":"off"}`),{current:a,target:m,changed:!1};if(!await u.send({type:"evaluate",acquireLock:!0,code:`(async () => {
|
|
5
5
|
const modeKey = ${JSON.stringify(n.modeKey)}
|
|
6
6
|
const target = ${JSON.stringify(m)}
|
|
7
7
|
window.dispatchEvent(new CustomEvent('sootsim:shell-command', {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (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 $}from"./chunk-
|
|
4
|
+
import{a as $}from"./chunk-XFPFJPC3.js";import{a as y}from"./chunk-32GBZENF.js";import{spawn as b,spawnSync as u}from"child_process";import{chmodSync as v,copyFileSync as S,createWriteStream as T,existsSync as f,mkdirSync as x,rmSync as w,statSync as P,unlinkSync as E}from"fs";import{tmpdir as D}from"os";import{dirname as M,join as m,resolve as k}from"path";var h="https://contrast.dev/api/electron-release";function A(){let r=process.arch;if(process.platform==="darwin"){let o=r==="arm64"?"mac-arm64":"mac-x64",t=`sootsim-latest-${o}.dmg`;return{platform:o,filename:t,url:`${h}/${t}`,install:L}}if(process.platform==="linux"){let o=r==="arm64"?"linux-arm64":"linux-x64",t=`sootsim-latest-${o}.AppImage`;return{platform:o,filename:t,url:`${h}/${t}`,install:B}}if(process.platform==="win32"){let o="sootsim-latest-win-x64.exe";return{platform:"win-x64",filename:o,url:`${h}/${o}`,install:C}}return null}async function O({url:r,dest:o,onProgress:t}){let s=await fetch(r,{redirect:"follow"});if(!s.ok)throw new Error(`${s.status} ${s.statusText} (${r})`);let e=s.headers.get("content-length"),a=e?Number(e):null;if(!s.body)throw new Error(`empty response body (${r})`);x(M(o),{recursive:!0});let i=T(o),d=s.body.getReader(),c=0;try{for(;;){let{done:n,value:l}=await d.read();if(n)break;i.write(Buffer.from(l)),c+=l.byteLength,t?.(c,a)}}finally{await new Promise((n,l)=>{i.end(p=>p?l(p):n())})}}function I(r,o){let t=(r/1048576).toFixed(1);if(!o)return` ${t} MB`;let s=Math.min(100,Math.round(r/o*100)),e=(o/(1024*1024)).toFixed(1),a=24,i=Math.round(s/100*a);return` ${"\u2588".repeat(i)+"\u2591".repeat(a-i)} ${s}% ${t} / ${e} MB`}async function L(r){let o=u("hdiutil",["attach","-nobrowse","-readonly",r],{encoding:"utf8"});if(o.status!==0)throw new Error(`hdiutil attach failed: ${o.stderr||o.stdout}`.trim());let t=o.stdout.trim().split(`
|
|
5
5
|
`),e=t[t.length-1].split(" ").pop()?.trim();if(!e||!f(e))throw new Error(`could not determine dmg mount point (output: ${o.stdout})`);let a=m(e,"rnx.app");if(!f(a))throw u("hdiutil",["detach","-force",e]),new Error(`rnx.app not found inside ${e}`);let i="/Applications",d=k(process.env.HOME||"","Applications"),c=i;try{let g=m(i,`.sootsim-write-probe-${process.pid}`);u("touch",[g]),f(g)?w(g,{force:!0}):c=d}catch{c=d}c===d&&x(c,{recursive:!0});let n=m(c,"sootsim.app");f(n)&&w(n,{recursive:!0,force:!0});let l=u("cp",["-R",a,n]),p=u("hdiutil",["detach","-force",e]);if(l.status!==0)throw new Error(`copy to ${n} failed: ${l.stderr?.toString()||""}`.trim());return p.status!==0&&console.warn(` warning: failed to unmount ${e} (${p.stderr?.toString().trim()||"unknown error"})`),u("xattr",["-dr","com.apple.quarantine",n]),n}async function B(r){let o=k(process.env.HOME||"","Applications");x(o,{recursive:!0});let t=m(o,"sootsim.AppImage");return f(t)&&w(t,{force:!0}),S(r,t),E(r),v(t,493),t}async function C(r){return await new Promise((o,t)=>{let s=b("cmd",["/c","start",'""',"/wait",r],{stdio:"inherit"});s.once("error",t),s.once("exit",e=>{e===0?o():t(new Error(`installer exited with code ${e}`))})}),r}async function q(r){(r.includes("--help")||r.includes("-h"))&&(console.log(`
|
|
6
6
|
rnx desktop install \u2014 download and install the optional desktop GUI
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c as ms}from"./chunk-
|
|
4
|
+
import{c as ms}from"./chunk-5UDXV7UU.js";var hs={};ms(hs,{Alias:()=>ee,CST:()=>cs,Composer:()=>be,Document:()=>se,Lexer:()=>Be,LineCounter:()=>De,Pair:()=>v,Parser:()=>we,Scalar:()=>y,Schema:()=>ve,YAMLError:()=>_e,YAMLMap:()=>$,YAMLParseError:()=>R,YAMLSeq:()=>B,YAMLWarning:()=>Pe,isAlias:()=>F,isCollection:()=>L,isDocument:()=>x,isMap:()=>U,isNode:()=>I,isPair:()=>T,isScalar:()=>E,isSeq:()=>V,parse:()=>un,parseAllDocuments:()=>fn,parseDocument:()=>us,stringify:()=>hn,visit:()=>Q,visitAsync:()=>je});var tt=Symbol.for("yaml.alias"),st=Symbol.for("yaml.document"),Y=Symbol.for("yaml.map"),qt=Symbol.for("yaml.pair"),q=Symbol.for("yaml.scalar"),re=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),F=s=>!!s&&typeof s=="object"&&s[K]===tt,x=s=>!!s&&typeof s=="object"&&s[K]===st,U=s=>!!s&&typeof s=="object"&&s[K]===Y,T=s=>!!s&&typeof s=="object"&&s[K]===qt,E=s=>!!s&&typeof s=="object"&&s[K]===q,V=s=>!!s&&typeof s=="object"&&s[K]===re;function L(s){if(s&&typeof s=="object")switch(s[K]){case Y:case re:return!0}return!1}function I(s){if(s&&typeof s=="object")switch(s[K]){case tt:case Y:case q:case re:return!0}return!1}var nt=s=>(E(s)||L(s))&&!!s.anchor;var j=Symbol("break visit"),ds=Symbol("skip children"),z=Symbol("remove node");function Q(s,e){let t=gs(e);x(s)?ke(null,s.contents,t,Object.freeze([s]))===z&&(s.contents=null):ke(null,s,t,Object.freeze([]))}Q.BREAK=j;Q.SKIP=ds;Q.REMOVE=z;function ke(s,e,t,n){let i=ys(s,e,t,n);if(I(i)||T(i))return bs(s,n,i),ke(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=ke(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===z&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=ke("key",e.key,t,n);if(r===j)return j;r===z&&(e.key=null);let o=ke("value",e.value,t,n);if(o===j)return j;o===z&&(e.value=null)}}return i}async function je(s,e){let t=gs(e);x(s)?await Ne(null,s.contents,t,Object.freeze([s]))===z&&(s.contents=null):await Ne(null,s,t,Object.freeze([]))}je.BREAK=j;je.SKIP=ds;je.REMOVE=z;async function Ne(s,e,t,n){let i=await ys(s,e,t,n);if(I(i)||T(i))return bs(s,n,i),Ne(s,i,t,n);if(typeof i!="symbol"){if(L(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await Ne(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===j)return j;o===z&&(e.items.splice(r,1),r-=1)}}}else if(T(e)){n=Object.freeze(n.concat(e));let r=await Ne("key",e.key,t,n);if(r===j)return j;r===z&&(e.key=null);let o=await Ne("value",e.value,t,n);if(o===j)return j;o===z&&(e.value=null)}}return i}function gs(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function ys(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(U(e))return t.Map?.(s,e,n);if(V(e))return t.Seq?.(s,e,n);if(T(e))return t.Pair?.(s,e,n);if(E(e))return t.Scalar?.(s,e,n);if(F(e))return t.Alias?.(s,e,n)}function bs(s,e,t){let n=e[e.length-1];if(L(n))n.items[s]=t;else if(T(n))s==="key"?n.key=t:n.value=t;else if(x(n))n.contents=t;else{let i=F(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}var pn={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},mn=s=>s.replace(/[!,[\]{}]/g,e=>pn[e]),Z=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+mn(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&I(e.contents)){let r={};Q(e.contents,(o,l)=>{I(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
5
5
|
`)}};Z.defaultYaml={explicit:!1,version:"1.2"};Z.defaultTags={"!!":"tag:yaml.org,2002:"};function it(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Rt(s){let e=new Set;return Q(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function Ft(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}function ws(s,e){let t=[],n=new Map,i=null;return{onAnchor:r=>{t.push(r),i??(i=Rt(s));let o=Ft(e,i);return i.add(o),o},setAnchors:()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(E(o.node)||L(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:n}}function fe(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],l=fe(s,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=fe(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=fe(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=fe(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}function M(s,e,t){if(Array.isArray(s))return s.map((n,i)=>M(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!nt(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}var ue=class{constructor(e){Object.defineProperty(this,K,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:r}={}){if(!x(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=M(this,"",o);if(typeof i=="function")for(let{count:a,res:c}of o.anchors.values())i(c,a);return typeof r=="function"?fe(r,{"":l},"",l):l}};var ee=class extends ue{constructor(e){super(tt),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Q(e,{Node:(r,o)=>{(F(o)||nt(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let i;for(let r of n){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:r}=t,o=this.resolve(i,t);if(!o){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=n.get(o);if(l||(M(o,null,t),l=n.get(o)),l?.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=rt(i,o,n)),l.count*l.aliasCount>r)){let a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,t,n){let i=`*${this.source}`;if(e){if(it(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function rt(s,e,t){if(F(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(L(e)){let n=0;for(let i of e.items){let r=rt(s,i,t);r>n&&(n=r)}return n}else if(T(e)){let n=rt(s,e.key,t),i=rt(s,e.value,t);return Math.max(n,i)}return 1}var ot=s=>!s||typeof s!="function"&&typeof s!="object",y=class extends ue{constructor(e){super(q),this.value=e}toJSON(e,t){return t?.keep?this.value:M(this.value,e,t)}toString(){return String(this.value)}};y.BLOCK_FOLDED="BLOCK_FOLDED";y.BLOCK_LITERAL="BLOCK_LITERAL";y.PLAIN="PLAIN";y.QUOTE_DOUBLE="QUOTE_DOUBLE";y.QUOTE_SINGLE="QUOTE_SINGLE";var dn="tag:yaml.org,2002:";function gn(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}function oe(s,e,t){if(x(s)&&(s=s.contents),I(s))return s;if(T(s)){let f=t.schema[Y].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t,a;if(n&&s&&typeof s=="object"){if(a=l.get(s),a)return a.anchor??(a.anchor=i(s)),new ee(a.anchor);a={anchor:null,node:null},l.set(s,a)}e?.startsWith("!!")&&(e=dn+e.slice(2));let c=gn(s,e,o.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new y(s);return a&&(a.node=f),f}c=s instanceof Map?o[Y]:Symbol.iterator in Object(s)?o[re]:o[Y]}r&&(r(c),delete t.onTagObj);let p=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new y(s);return e?p.tag=e:c.default||(p.tag=c.tag),a&&(a.node=p),p}function qe(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=n,n=o}else n=new Map([[r,n]])}return oe(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var Ae=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,Oe=class extends ue{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>I(n)||T(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ae(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(L(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(L(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!0);return i.length===0?!t&&E(r)?r.value:r:L(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!T(t))return!1;let n=t.value;return n==null||e&&E(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return L(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(L(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,qe(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};var Ss=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function J(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var te=(s,e,t)=>s.endsWith(`
|
|
6
6
|
`)?J(t,e):t.includes(`
|
|
7
7
|
`)?`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (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-UONC7KUI.js";var c=["ghs_","ghp_","gho_","ghu_","github_pat_"];function p(n){return!!(n&&n.length>=20&&c.some(e=>n.startsWith(e)))}function a(){let n=process.env.CONTRAST_INSTALLATION_TOKEN?.trim(),e=process.env.GITHUB_TOKEN?.trim(),t=n||e;if(!p(t))return null;let r=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!r)return null;let[o,s]=r.includes("/")?r.split("/",2):[null,null],u=(process.env.CONTRAST_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),l=(process.env.CONTRAST_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:t,repoId:r,repositoryId:u||null,owner:o||null,repo:s||null,installationId:l||null,source:n?"contrast-runner":"github-actions"}}function d(n){return n.startsWith("sk_rnx_")||n.startsWith("sk_sootsim_")}function I(){for(let n of["RNX_API_KEY","SOOTSIM_API_KEY"]){let e=process.env[n]?.trim();if(e&&d(e))return{secret:e,envName:n}}return null}function _(){let n=I();if(n)return{kind:"api-key",secret:n.secret,source:"env",envName:n.envName};let e=a();if(e)return e;let t=i();return t?.token?{kind:"session",token:t.token,origin:t.origin}:null}function A(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function h(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{_ as a,A as b,h as c};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.348 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as q,b as G,c as $e}from"./chunk-
|
|
4
|
+
import{a as q,b as G,c as $e}from"./chunk-BC6P65EO.js";import{c as _e,d as Pe}from"./chunk-O7ZWWZA6.js";import{o as Ue}from"./chunk-ZP6XJFIZ.js";import{q as Ie,s as Ae,u as x}from"./chunk-HNYPDSJ6.js";import{a as Be}from"./chunk-4WBCIUI5.js";import{createHash as bt}from"crypto";import{readFileSync as b}from"fs";import ze from"path";import{gzipSync as fe,gunzipSync as wt}from"zlib";function Ne(e){let t=(e||"").toLowerCase().split(";")[0].trim();return t?!(t.startsWith("image/")||t.startsWith("video/")||t.startsWith("audio/")||t==="font/woff2"||t==="application/font-woff2"||t==="application/zip"||t==="application/gzip"):!0}import{brotliCompressSync as ot,constants as it}from"node:zlib";var at=9;function Fe(e){return ot(e,{params:{[it.BROTLI_PARAM_QUALITY]:at}})}function le(e,t){let r=new AbortController,s=setTimeout(()=>r.abort(new Error(`${t} timed out after ${e/1e3}s`)),e);return{signal:r.signal,cancel:()=>clearTimeout(s)}}async function lt(e){let t=le(12e4,`PUT ${e.url}`),r;try{r=await fetch(e.url,{method:"PUT",headers:{"content-type":e.contentType},body:e.bytes,signal:t.signal})}finally{t.cancel()}if(!r.ok){let s=await r.text().catch(()=>"");throw new Error(`PUT ${e.url} failed ${r.status}: ${s.slice(0,200)}`)}}async function ut(e,t=8,r){let s=0,o=0,i=e.length;await Promise.all(Array.from({length:Math.min(t,i)},async()=>{for(;s<i;){let l=e[s++];await lt(l),o++,r?.(o,i)}}))}function ct(e,t,r,s){let o=[];o.push({url:e.bundle.putUrl,contentType:e.bundle.contentType,bytes:t});for(let i of e.files){let l=r.get(i.urlhash);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}e.events&&s?.eventsBytes&&o.push({url:e.events.putUrl,contentType:e.events.contentType,bytes:s.eventsBytes}),e.timeline&&s?.timelineBytes&&o.push({url:e.timeline.putUrl,contentType:e.timeline.contentType,bytes:s.timelineBytes}),e.flowVideo&&s?.videoBytes&&o.push({url:e.flowVideo.putUrl,contentType:e.flowVideo.contentType,bytes:s.videoBytes}),e.storage&&s?.storageBytes&&o.push({url:e.storage.putUrl,contentType:e.storage.contentType,bytes:s.storageBytes}),e.failureBundle&&s?.failureBundleBytes&&o.push({url:e.failureBundle.putUrl,contentType:e.failureBundle.contentType,bytes:s.failureBundleBytes});for(let i of e.snapshots??[]){let l=s?.snapshotBytes?.get(i.id);l&&o.push({url:i.putUrl,contentType:i.contentType,bytes:l})}return o}function dt(e){return e.replace(/\/+$/,"")}var J=class extends Error{constructor(r,s,o,i=""){super(r);this.status=s;this.phase=o;this.responseText=i;this.name="PresignedUploadError"}};async function Ce(e){let t=dt(e.originBase),r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader),e.adminBypassToken&&(r["x-contrast-admin-upload-bypass"]=e.adminBypassToken);let s=le(3e4,"init"),o;try{o=await fetch(`${t}/api/preview/upload/init`,{method:"POST",headers:r,body:JSON.stringify(e.initBody),signal:s.signal})}finally{s.cancel()}if(!o.ok){let w=await o.text().catch(()=>"");throw new J(`init failed: ${o.status} ${w.slice(0,200)}`,o.status,"init",w)}let i=await o.json(),l=ct(i,e.bundleBytes,e.filesByHash,e.extras);await ut(l,e.concurrency??8,e.onPutProgress);let f=le(3e4,"finalize"),c;try{c=await fetch(`${t}/api/preview/upload/finalize`,{method:"POST",headers:r,body:JSON.stringify({token:i.token}),signal:f.signal})}finally{f.cancel()}if(!c.ok){let w=await c.text().catch(()=>"");throw new J(`finalize failed: ${c.status} ${w.slice(0,200)}`,c.status,"finalize",w)}let h=await c.json();return{init:i,finalize:h}}function pt(e){return e!==null&&typeof e=="object"?e:null}function Le(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ue(e){let t=pt(e);return t?t.schemaVersion===1&&Le(t.t)!==void 0&&Le(t.seq)!==void 0&&typeof t.context=="string"&&typeof t.kind=="string"&&"data"in t:!1}function ft(e,t){let r=[];for(let s of e.split(`
|
|
5
5
|
`)){let o=s.trim();if(o)try{let i=JSON.parse(o);t(i)&&r.push(i)}catch{}}return r}function Oe(e){return ft(e,ue)}import{execSync as mt}from"child_process";function de(e){try{return mt(e,{stdio:["ignore","pipe","ignore"],timeout:3e3,encoding:"utf8"}).trim()||null}catch{return null}}function ce(e){let t=e?.trim();return!t||!/^\d+$/.test(t)?null:Number(t)}function gt(){let e=de("git remote get-url origin");if(!e)return null;let t=e.match(/github\.com[/:]([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/i);return t?{owner:t[1],repo:t[2]}:null}function pe(){let e=process.env.GITHUB_ACTIONS==="true",t=process.env.CONTRAST_BRANCH?.trim()||null,r=process.env.CONTRAST_SHA?.trim()||null,s=process.env.CONTRAST_PR_TITLE?.trim()||null,o=(process.env.CONTRAST_REPO||process.env.GITHUB_REPOSITORY||"").trim(),[i,l]=o.includes("/")?o.split("/",2):[null,null];if(e){let h=process.env.GITHUB_REF?.match(/^refs\/pull\/(\d+)\//)?.[1];return{owner:i,repo:l,branch:t||process.env.GITHUB_HEAD_REF?.trim()||process.env.GITHUB_REF_NAME?.trim()||null,commitSha:r||process.env.GITHUB_SHA?.trim()||null,githubUsername:process.env.GITHUB_ACTOR?.trim()||null,pullRequestNumber:ce(process.env.CONTRAST_PR_NUMBER)??ce(h),pullRequestTitle:s,githubRunId:process.env.GITHUB_RUN_ID?.trim()||null,source:"ci"}}let f=t??de("git rev-parse --abbrev-ref HEAD"),c=i?null:gt();return{owner:i??c?.owner??null,repo:l??c?.repo??null,branch:f==="HEAD"?null:f,commitSha:r??de("git rev-parse HEAD"),githubUsername:null,pullRequestNumber:ce(process.env.CONTRAST_PR_NUMBER),pullRequestTitle:s,githubRunId:null,source:"cli"}}function Gt(e){if(e.length===0)return{stepCount:null,failedStepIndex:null};let t=e.find(r=>r.status==="failure");return{stepCount:e.length,failedStepIndex:t?t.stepIndex:null}}function Jt(e){return e.auth?e.uploadedShare?!0:e.auth.kind==="github"||process.env.GITHUB_ACTIONS==="true":!1}async function Kt(e){let t=e.auth??q();if(!t)return null;let r=pe(),s=e.owner??(t.kind==="github"?t.owner:null)??r.owner,o=e.repo??(t.kind==="github"?t.repo:null)??r.repo;try{let i=await fetch(`${e.origin.replace(/\/$/,"")}/api/sootsim/test-runs`,{method:"POST",headers:{"content-type":"application/json",authorization:G(t)},body:JSON.stringify({kind:e.kind,source:r.source,name:e.name??void 0,prompt:e.prompt??void 0,summary:e.summary??void 0,status:e.status,failureMessage:e.failureMessage??void 0,previewShareId:e.previewShareId??void 0,owner:s??void 0,repo:o??void 0,branch:r.branch??void 0,commitSha:r.commitSha??void 0,githubUsername:r.githubUsername??void 0,pullRequestNumber:r.pullRequestNumber??void 0,githubRunId:r.githubRunId??void 0,stepCount:e.stepCount??void 0,failedStepIndex:e.failedStepIndex??void 0,durationMs:e.durationMs??void 0,flowYamlSizeBytes:e.flowYamlSizeBytes??void 0})});if(!i.ok){let f=await i.text().catch(()=>"");return console.warn(` warn: run registration failed: /api/sootsim/test-runs ${i.status}${f?`: ${f.slice(0,200)}`:""}`),null}let l=await i.json();return l.run?.id?{id:l.run.id,previewUrl:l.run.previewUrl??null,traceUrl:l.run.traceUrl??null}:(console.warn(" warn: run registration returned no id"),null)}catch(i){return console.warn(` warn: run registration failed: ${i instanceof Error?i.message:String(i)}`),null}}function Mt(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t.message=="string"&&t.message?t.message:null}catch{return null}}function Tt(e){let t=JSON.parse(b(e,"utf8"));if(!Array.isArray(t))throw new Error("snapshot manifest must be an array");let r=new Set;return t.map((s,o)=>{if(s===null||typeof s!="object")throw new Error(`snapshot manifest entry ${o} must be an object`);let i=Reflect.get(s,"id"),l=Reflect.get(s,"label"),f=Reflect.get(s,"path"),c=Reflect.get(s,"t");if(typeof i!="string"||!i||r.has(i))throw new Error(`snapshot manifest entry ${o} has an invalid or duplicate id`);if(typeof f!="string"||!f)throw new Error(`snapshot manifest entry ${o} has no PNG path`);if(typeof c!="number"||!Number.isFinite(c)||c<0)throw new Error(`snapshot manifest entry ${o} has an invalid capture time`);r.add(i);let h=b(f);return{meta:{id:i,label:typeof l=="string"&&l?l:i,kind:"interaction",t:Math.round(c),contentType:"image/png",sizeBytes:h.byteLength},bytes:h}})}var Ge=process.env.SOOTSIM_UPLOAD_ORIGIN||"https://contrast.dev",Je=process.env.SOOTSIM_PREVIEW_ORIGIN||Be.origin;async function St(e){return e||(process.env.SOOTSIM_UPLOAD_ORIGIN?process.env.SOOTSIM_UPLOAD_ORIGIN:Ge)}function $(e){return e.replace(/\/$/,"")}function vt(e){try{let r=new URL(e).hostname.replace(/^\[|\]$/g,"").toLowerCase();return r==="localhost"||r.endsWith(".localhost")||r==="0.0.0.0"||r==="::1"||/^127(?:\.\d{1,3}){3}$/.test(r)}catch{return!1}}function xt(e){try{let t=new URL(e).hostname.toLowerCase();return t==="contrast.dev"||t.endsWith(".contrast.dev")}catch{return!1}}function Rt(e,t){return t?$(t):process.env.SOOTSIM_PREVIEW_ORIGIN?$(process.env.SOOTSIM_PREVIEW_ORIGIN):vt(e)?$(e):xt(e)?$(Je):$(e)}function kt(){console.log(`
|
|
6
6
|
rnx record upload \u2014 publish the current recorded bundle as a /preview/<id> link
|
|
7
7
|
|