rnxsim 0.1.364 → 0.1.366
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 +2 -0
- package/cli/bridge-flow-runner.ts +2 -2
- package/cli/commands/control.ts +3 -44
- package/cli/commands/detox.ts +18 -1
- package/cli/commands/flow.ts +2 -1
- package/detox/index.ts +3 -1
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-TPAN64UJ.js → agent-SO6IOPRK.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-GFB3KBNY.js → agent-wrapper-PMYCB2KO.js} +2 -2
- package/dist-cli/chunks/{app-fonts-DF5BO6AK.js → app-fonts-LULQGFY7.js} +2 -2
- package/dist-cli/chunks/{assert-VVKTC5YX.js → assert-WGNCD4ZU.js} +2 -2
- package/dist-cli/chunks/{auth-C7SRVIIX.js → auth-G7CCHH3M.js} +2 -2
- package/dist-cli/chunks/{beta-SZVR5QH2.js → beta-N4LXL5TO.js} +2 -2
- package/dist-cli/chunks/{camera-XKUQHX54.js → camera-4JHCYBQS.js} +2 -2
- package/dist-cli/chunks/{chunk-6TFSPDDE.js → chunk-2S7BKUP2.js} +2 -2
- package/dist-cli/chunks/{chunk-6OZZCDOK.js → chunk-2UXU53MG.js} +1 -1
- package/dist-cli/chunks/{chunk-GISQDTW6.js → chunk-34IQM22N.js} +2 -2
- package/dist-cli/chunks/{chunk-4OK2SZTF.js → chunk-3X6IBUBX.js} +2 -2
- package/dist-cli/chunks/{chunk-KXGBOYTB.js → chunk-5DAIA77C.js} +2 -2
- package/dist-cli/chunks/{chunk-6EALLMLO.js → chunk-5NMCF5VF.js} +1 -1
- package/dist-cli/chunks/{chunk-CDGPG6JU.js → chunk-5OK3LCEJ.js} +2 -2
- package/dist-cli/chunks/{chunk-CAP2EQ4P.js → chunk-6PL2CCGP.js} +2 -2
- package/dist-cli/chunks/{chunk-WKH7T3YK.js → chunk-77ZHQJZR.js} +2 -2
- package/dist-cli/chunks/chunk-7B37IZBN.js +15 -0
- package/dist-cli/chunks/{chunk-QECOXZY3.js → chunk-A5FXX5PJ.js} +1 -1
- package/dist-cli/chunks/{chunk-DSD2TMUC.js → chunk-AFV32WZT.js} +3 -3
- package/dist-cli/chunks/{chunk-VDEE37CY.js → chunk-CN6XYYEA.js} +12 -12
- package/dist-cli/chunks/{chunk-WK3QQTWE.js → chunk-CTG7HBCA.js} +1 -1
- package/dist-cli/chunks/{chunk-XXFZMO4I.js → chunk-DMPF2D24.js} +2 -2
- package/dist-cli/chunks/{chunk-SWIEVEPN.js → chunk-DW37EVX5.js} +1 -1
- package/dist-cli/chunks/{chunk-2UM2IFEM.js → chunk-DWFIH7CB.js} +2 -2
- package/dist-cli/chunks/{chunk-7RZI733Y.js → chunk-EFR5DVNP.js} +1 -1
- package/dist-cli/chunks/{chunk-LWOIQBVX.js → chunk-EGAGZHO6.js} +1 -1
- package/dist-cli/chunks/{chunk-AUHE5LTY.js → chunk-EQK5MJCU.js} +2 -2
- package/dist-cli/chunks/{chunk-T2U4BLWM.js → chunk-GAJQSITE.js} +1 -1
- package/dist-cli/chunks/{chunk-MPWM3TBY.js → chunk-GUI3PDH2.js} +2 -2
- package/dist-cli/chunks/{chunk-5OZJUMUS.js → chunk-GXAB52K7.js} +2 -2
- package/dist-cli/chunks/{chunk-3LSNLOZR.js → chunk-H23KWIKA.js} +2 -2
- package/dist-cli/chunks/{chunk-GJKVFQCF.js → chunk-HT6GFZOZ.js} +1 -1
- package/dist-cli/chunks/{chunk-475BITXX.js → chunk-I6KIM6PN.js} +1 -1
- package/dist-cli/chunks/{chunk-PSUX2SIK.js → chunk-IZKHOM37.js} +1 -1
- package/dist-cli/chunks/{chunk-GCMVAY4M.js → chunk-JHXETDVC.js} +1 -1
- package/dist-cli/chunks/{chunk-MUKHA5UF.js → chunk-KLF3K6ZZ.js} +1 -1
- package/dist-cli/chunks/{chunk-6CQSKBKG.js → chunk-LN3RNW6X.js} +2 -2
- package/dist-cli/chunks/{chunk-26XF67QW.js → chunk-M3BNCF7E.js} +2 -2
- package/dist-cli/chunks/{chunk-XXP4GLLC.js → chunk-M5QCGLXR.js} +3 -3
- package/dist-cli/chunks/{chunk-OXXWSZKI.js → chunk-M6SKQGAN.js} +2 -2
- package/dist-cli/chunks/{chunk-5GO3JI65.js → chunk-MGDSJZ37.js} +2 -2
- package/dist-cli/chunks/{chunk-JF6NYOSI.js → chunk-N3UC7HIX.js} +1 -1
- package/dist-cli/chunks/{chunk-GYC6VTQV.js → chunk-NAYLPOC5.js} +2 -2
- package/dist-cli/chunks/{chunk-BRU5PPUO.js → chunk-NM2L2QV4.js} +2 -2
- package/dist-cli/chunks/{chunk-6TAFS3GK.js → chunk-NQFJOCSF.js} +2 -2
- package/dist-cli/chunks/{chunk-QSGQVEGD.js → chunk-ONORMKWX.js} +2 -2
- package/dist-cli/chunks/{chunk-ONGTUKC3.js → chunk-ORWP2E7R.js} +2 -2
- package/dist-cli/chunks/{chunk-PG2B65PZ.js → chunk-OW5XHAA4.js} +1 -1
- package/dist-cli/chunks/{chunk-GXMNFFJJ.js → chunk-RYIMSKDO.js} +2 -2
- package/dist-cli/chunks/{chunk-2TL6BZCH.js → chunk-SA6XVI55.js} +1 -1
- package/dist-cli/chunks/{chunk-QWRQ7RY6.js → chunk-TIAEYO6I.js} +2 -2
- package/dist-cli/chunks/{chunk-FKAZFE5Z.js → chunk-TTASWLKM.js} +1 -1
- package/dist-cli/chunks/{chunk-X3N2H4A3.js → chunk-UCHW7ZHR.js} +2 -2
- package/dist-cli/chunks/{chunk-UDZI7GEV.js → chunk-VIND4SP3.js} +1 -1
- package/dist-cli/chunks/{chunk-ZOQAPVNV.js → chunk-XJU2QIRY.js} +2 -2
- package/dist-cli/chunks/{chunk-EP5FYRBT.js → chunk-XXNLYR64.js} +3 -3
- package/dist-cli/chunks/{chunk-PTOGXUOE.js → chunk-YCCCPFWT.js} +2 -2
- package/dist-cli/chunks/chunk-YGMEDJKJ.js +4 -0
- package/dist-cli/chunks/{chunk-S7OIWXIZ.js → chunk-YXXKSL6R.js} +1 -1
- package/dist-cli/chunks/{chunk-V7CAEDZT.js → chunk-ZFM24DOX.js} +2 -2
- package/dist-cli/chunks/{chunk-YJTZ77E4.js → chunk-ZJIS3CTW.js} +2 -2
- package/dist-cli/chunks/{chunk-IX2ZY3FI.js → chunk-ZLVRYXZ7.js} +1 -1
- package/dist-cli/chunks/{chunk-ZUKAXCGG.js → chunk-ZMJ75EDG.js} +2 -2
- package/dist-cli/chunks/{cleanup-KSK43W4F.js → cleanup-KRIATKFH.js} +2 -2
- package/dist-cli/chunks/cli-version-SYGNHGFR.js +4 -0
- package/dist-cli/chunks/{compat-ETLIMR6U.js → compat-6PTQ3QEA.js} +2 -2
- package/dist-cli/chunks/{config-GZKHF2OQ.js → config-ETGDUANO.js} +2 -2
- package/dist-cli/chunks/control-RBTNOLQM.js +4 -0
- package/dist-cli/chunks/daemon-N3SC5DK6.js +4 -0
- package/dist-cli/chunks/{debug-TCZOR7EX.js → debug-WIIB6ZKC.js} +3 -3
- package/dist-cli/chunks/{desktop-SXNUOCYY.js → desktop-TD7Q5LNB.js} +3 -3
- package/dist-cli/chunks/detox-7GNR33VM.js +52 -0
- package/dist-cli/chunks/{device-W7U63QOH.js → device-QOR3PGUF.js} +2 -2
- package/dist-cli/chunks/{diagnose-TNZKUJHP.js → diagnose-RRCBLP6E.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-3YIXIS5V.js → disk-cleanup-MJUGJPXT.js} +2 -2
- package/dist-cli/chunks/drivers-W6E3BZH4.js +4 -0
- package/dist-cli/chunks/{film-E4DAHL3T.js → film-D7Y64LID.js} +3 -3
- package/dist-cli/chunks/flow-7QAE2V5Y.js +4 -0
- package/dist-cli/chunks/help-NLD6KWVG.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-JGC3RNJM.js → hidden-runtime-alias-JGURVR2Z.js} +2 -2
- package/dist-cli/chunks/{home-paths-RMAJUXID.js → home-paths-4ICFIGXO.js} +2 -2
- package/dist-cli/chunks/inspect-C347BG52.js +4 -0
- package/dist-cli/chunks/install-desktop-YR6TWZYK.js +4 -0
- package/dist-cli/chunks/{login-AVAHLXIO.js → login-RU33QR2G.js} +2 -2
- package/dist-cli/chunks/{logout-FHY54N66.js → logout-2IUG3Y5J.js} +2 -2
- package/dist-cli/chunks/{maestro-4FOX653X.js → maestro-2MXTGG7I.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-A5VA2C2L.js → maestro-generate-2PYIFGLR.js} +3 -3
- package/dist-cli/chunks/{mode-EEMUPUUN.js → mode-3DAPG3HF.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-OOJVFEEM.js → optional-demo-registry-BWSDJF2Z.js} +2 -2
- package/dist-cli/chunks/{perf-KC3DWW2K.js → perf-2TKPWB4N.js} +2 -2
- package/dist-cli/chunks/{permissions-NYLB3HTV.js → permissions-5CSMHYNA.js} +2 -2
- package/dist-cli/chunks/privacy-PWWC2BXO.js +4 -0
- package/dist-cli/chunks/{record-W4VGQFZO.js → record-I2HJCFP3.js} +3 -3
- package/dist-cli/chunks/{report-issue-OV4TEQA4.js → report-issue-A4FZWBOC.js} +2 -2
- package/dist-cli/chunks/reset-Y3PBPFYA.js +4 -0
- package/dist-cli/chunks/runtime-IC6NVVGA.js +4 -0
- package/dist-cli/chunks/{screenshot-command-E5UQAWDL.js → screenshot-command-UFW5BFHP.js} +3 -3
- package/dist-cli/chunks/{screenshot-layers-FKOOWRTR.js → screenshot-layers-5BIAL4YN.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-75RRIMXV.js → screenshots-capture-EHYS3BV2.js} +2 -2
- package/dist-cli/chunks/{serve-FSKXPWZS.js → serve-O4FDM3AC.js} +2 -2
- package/dist-cli/chunks/setup-Y4QGSJBM.js +4 -0
- package/dist-cli/chunks/{skills-6KOGOICV.js → skills-ZK55SY32.js} +2 -2
- package/dist-cli/chunks/{state-MFXITPJO.js → state-KFLAZNEY.js} +2 -2
- package/dist-cli/chunks/{storage-Y6WMFSON.js → storage-WP33ISEM.js} +2 -2
- package/dist-cli/chunks/store-VEE22CAY.js +4 -0
- package/dist-cli/chunks/telemetry-PZV4BISJ.js +4 -0
- package/dist-cli/chunks/{timeline-ULQSPSUI.js → timeline-DKGW5S4I.js} +2 -2
- package/dist-cli/chunks/{upgrade-TXKMF6QG.js → upgrade-LL7G4B7G.js} +2 -2
- package/dist-cli/chunks/upload-Y4C3YZDK.js +4 -0
- package/dist-cli/chunks/{version-ELQDHWMV.js → version-YLWR5G4F.js} +2 -2
- package/dist-cli/chunks/{web-QDYHKVEF.js → web-QELZ4CP6.js} +2 -2
- package/dist-cli/chunks/welcome-ZPKA5PZJ.js +5 -0
- package/dist-cli/chunks/{what-happened-64IQA6AX.js → what-happened-MIOMZWM5.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 +4 -2
- 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 +31 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/mcp.cjs +673 -0
- package/dist-lib/mcp.mjs +641 -0
- 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 +31 -1
- package/dist-lib/sdk.mjs +31 -1
- package/dist-lib/skills.cjs +67 -53
- package/dist-lib/vite.cjs +1 -1
- package/package.json +7 -1
- package/src/app-url.ts +40 -0
- package/src/mcp.ts +791 -0
- package/src/sim-client.ts +12 -6
- package/dist-cli/chunks/chunk-2FLTYH6I.js +0 -15
- package/dist-cli/chunks/chunk-HFHQUP6D.js +0 -4
- package/dist-cli/chunks/cli-version-VMIKRJJR.js +0 -4
- package/dist-cli/chunks/control-GEI7BBKL.js +0 -4
- package/dist-cli/chunks/daemon-F4J2GDYQ.js +0 -4
- package/dist-cli/chunks/detox-3IE75WQS.js +0 -52
- package/dist-cli/chunks/drivers-EW637BG3.js +0 -4
- package/dist-cli/chunks/flow-FX5GS2R4.js +0 -4
- package/dist-cli/chunks/help-2GRNPHE6.js +0 -4
- package/dist-cli/chunks/inspect-G24KNRYH.js +0 -4
- package/dist-cli/chunks/install-desktop-FHESQL4S.js +0 -4
- package/dist-cli/chunks/privacy-FHOKJ2N7.js +0 -4
- package/dist-cli/chunks/reset-MUWZMMPE.js +0 -4
- package/dist-cli/chunks/runtime-TK4FTIEZ.js +0 -4
- package/dist-cli/chunks/setup-LAKKCS57.js +0 -4
- package/dist-cli/chunks/store-56XZIZGX.js +0 -4
- package/dist-cli/chunks/telemetry-OXQ57PD4.js +0 -4
- package/dist-cli/chunks/upload-S3BWN6EM.js +0 -4
- package/dist-cli/chunks/welcome-ZT56CZ2Z.js +0 -5
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ What this package gives you:
|
|
|
23
23
|
editor
|
|
24
24
|
- `rnxsim/detox` — a drop-in Detox driver + jest preset
|
|
25
25
|
- `rnxsim/sdk` — the inspect/interact verbs as a programmatic API
|
|
26
|
+
- `rnxsim/mcp` — a transport-neutral, injected-sim MCP tool registry
|
|
26
27
|
- `rnxsim/skills` — a registry of Contrast-flavored automation skills
|
|
27
28
|
|
|
28
29
|
Platform status: iOS is the parity baseline. Android is bootstrapped and usable
|
|
@@ -188,6 +189,7 @@ bridge always addresses the **shell worker**, never an undifferentiated sim.
|
|
|
188
189
|
| rnx CLI (bin + dispatcher) | Short-lived terminal entry point. Parses argv, owns the private-by-default one-time choice, lazy-imports one command per run, and routes direct open/runtime/inspection flows. | `cli/bin.ts`, `cli/privacy.ts`, `cli/parse-args.ts`, `cli/help.ts`, `cli/commands/setup.ts`, `cli/commands/control.ts` |
|
|
189
190
|
| WsBridge client | Client side of the CLI→daemon link. Resolves the daemon port from the lockfile, opens a WS to `:7668`, sends JSON commands and awaits `{id,result}`/`{id,error}`. Used by every interactive command. | `cli/ws-bridge.ts`, `src/bridge-constants.ts`, `cli/current-sim.ts` |
|
|
190
191
|
| inspect / SDK command surface | Runtime inspection + interaction verbs (describe, find, do tap, get errors, wait, layout, settle). Re-exported as `rnxsim/sdk` so programmatic callers drive a sim the same way the CLI does. | `cli/commands/inspect/core.ts`, `cli/commands/inspect/actions.ts`, `cli/commands/inspect.ts`, `src/sdk.ts` |
|
|
192
|
+
| per-sim MCP adapter | Strict JSON-schema tools over one injected `SimClient`. The schemas expose no sim selector, and the adapter owns no transport or server lifecycle. | `src/mcp.ts`, `src/sim-client.ts` |
|
|
191
193
|
| Maestro / Detox runners | Drop-in test compatibility. `bridge-flow-runner.ts` runs Maestro YAML and recorded flows over the bridge; `detox/` provides a `by`/`element`/`expect`/`device` driver + jest preset so existing Detox suites run unchanged. | `cli/bridge-flow-runner.ts`, `cli/commands/maestro.ts`, `cli/commands/detox.ts`, `detox/index.ts`, `detox/jest-preset.cjs` |
|
|
192
194
|
| sim drivers | Launch or attach the actual sim page. Playwright owns isolated browser profiles; Electron owns the native desktop surface. The current sim is reused unless `--new`, `--profile`, or `--ephemeral` requests a separate one. | `cli/drivers/index.ts`, `cli/drivers/registry.ts`, `cli/drivers/electron.ts`, `cli/drivers/playwright.ts` |
|
|
193
195
|
| SootSimBridgeHost (serve/daemon) | The bridge process (`rnx serve`, or autostarted as the daemon via launchd/systemd). HTTP+WS hub on `:7668`: relays commands between CLI clients and registered sims; also serves runtime HTTP, `/__server-scan`, and fetch/WS proxies. | `src/host/bridge-host.ts`, `cli/commands/serve.ts`, `cli/commands/daemon.ts`, `src/home-paths.ts` |
|
|
@@ -465,7 +465,7 @@ export class SootSimBridgeFlowRunner {
|
|
|
465
465
|
// tree is back and simId has been rotated. lets preview mode
|
|
466
466
|
// re-start the event recorder, since `window.location.reload()`
|
|
467
467
|
// wipes any listeners the caller installed before the flow ran.
|
|
468
|
-
onAfterLaunch?: () => Promise<void> | void
|
|
468
|
+
onAfterLaunch?: (simId: string | undefined) => Promise<void> | void
|
|
469
469
|
},
|
|
470
470
|
) {}
|
|
471
471
|
|
|
@@ -2103,7 +2103,7 @@ export class SootSimBridgeFlowRunner {
|
|
|
2103
2103
|
await this.waitForTree(120000)
|
|
2104
2104
|
if (this.opts.onAfterLaunch) {
|
|
2105
2105
|
try {
|
|
2106
|
-
await this.opts.onAfterLaunch()
|
|
2106
|
+
await this.opts.onAfterLaunch(this.opts.simId)
|
|
2107
2107
|
} catch (err) {
|
|
2108
2108
|
// don't fail the whole flow if a post-launch hook throws —
|
|
2109
2109
|
// surfaces as a warn at most, the run keeps going.
|
package/cli/commands/control.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from 'sootsim-engine/settings'
|
|
10
10
|
import { WebSocket } from 'ws'
|
|
11
11
|
import { probePort } from '../../scripts/dev-server-scanner'
|
|
12
|
+
import { isAppDeepLinkTarget, openAppUrl } from '../../src/app-url'
|
|
12
13
|
import { isLoopbackHost } from '../../src/backend-origin'
|
|
13
14
|
import { resolveSootsimShellBaseUrlForBridgePort } from '../../src/bridge-constants'
|
|
14
15
|
import {
|
|
@@ -161,31 +162,6 @@ function normalizeKnownTarget(target: string): string {
|
|
|
161
162
|
return target.trim()
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
const DEEP_LINK_SCHEME_RE = /^[A-Za-z][A-Za-z0-9+.-]*:/
|
|
165
|
-
|
|
166
|
-
export function normalizeDeepLinkTarget(target: string): string {
|
|
167
|
-
const trimmed = target.trim()
|
|
168
|
-
if (!trimmed) {
|
|
169
|
-
throw new Error('expected <url-or-route>')
|
|
170
|
-
}
|
|
171
|
-
if (DEEP_LINK_SCHEME_RE.test(trimmed) || trimmed.startsWith('/')) {
|
|
172
|
-
return trimmed
|
|
173
|
-
}
|
|
174
|
-
return `/${trimmed}`
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function isObjectRecord(value: unknown): value is Record<string, unknown> {
|
|
178
|
-
return value !== null && typeof value === 'object'
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function shouldOpenAsDeepLink(target: string): boolean {
|
|
182
|
-
const trimmed = target.trim()
|
|
183
|
-
if (!trimmed) return false
|
|
184
|
-
if (trimmed.startsWith('/')) return true
|
|
185
|
-
if (!DEEP_LINK_SCHEME_RE.test(trimmed)) return false
|
|
186
|
-
return !/^https?:\/\//i.test(trimmed)
|
|
187
|
-
}
|
|
188
|
-
|
|
189
165
|
export async function ensureBridgeForOpen(
|
|
190
166
|
preferredPort: number,
|
|
191
167
|
explicitPort = false,
|
|
@@ -1385,27 +1361,10 @@ export async function runLinkCommand(args: string[], opts: ControlCommandOptions
|
|
|
1385
1361
|
process.exit(1)
|
|
1386
1362
|
}
|
|
1387
1363
|
|
|
1388
|
-
let target: string
|
|
1389
|
-
try {
|
|
1390
|
-
target = normalizeDeepLinkTarget(parsed.positional[0] ?? '')
|
|
1391
|
-
} catch (err) {
|
|
1392
|
-
console.error(` rnx open: ${err instanceof Error ? err.message : String(err)}`)
|
|
1393
|
-
process.exit(1)
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
1364
|
const bridge = createBridgeFromParsed(parsed)
|
|
1397
1365
|
const simHint = parsed.simId ? ` --sim ${parsed.simId}` : ''
|
|
1398
1366
|
try {
|
|
1399
|
-
const
|
|
1400
|
-
type: 'call',
|
|
1401
|
-
path: 'SootSim.bridges.test.openDeepLink',
|
|
1402
|
-
args: [target],
|
|
1403
|
-
})
|
|
1404
|
-
if (isObjectRecord(result) && result.ok === false) {
|
|
1405
|
-
throw new Error(
|
|
1406
|
-
typeof result.error === 'string' ? result.error : 'deep-link dispatch failed',
|
|
1407
|
-
)
|
|
1408
|
-
}
|
|
1367
|
+
const target = await openAppUrl(bridge, parsed.positional[0] ?? '')
|
|
1409
1368
|
console.log(` opened deep link: ${target}`)
|
|
1410
1369
|
} catch (err) {
|
|
1411
1370
|
console.error(` link failed: ${err instanceof Error ? err.message : String(err)}`)
|
|
@@ -1475,7 +1434,7 @@ export async function runOpenCommand(
|
|
|
1475
1434
|
}
|
|
1476
1435
|
const target = parsed.positional[0] || ''
|
|
1477
1436
|
|
|
1478
|
-
if (
|
|
1437
|
+
if (isAppDeepLinkTarget(target)) {
|
|
1479
1438
|
if (openInNewSim) {
|
|
1480
1439
|
console.error(
|
|
1481
1440
|
' rnx open: deep links target the current app; remove --new, --profile, or --ephemeral',
|
package/cli/commands/detox.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { spawn } from 'child_process'
|
|
14
14
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, unlinkSync } from 'fs'
|
|
15
|
+
import { createRequire } from 'module'
|
|
15
16
|
import { tmpdir } from 'os'
|
|
16
17
|
import { dirname, resolve, join, relative } from 'path'
|
|
17
18
|
import { rnxPublicBrand } from '../../src/public-brand'
|
|
@@ -195,7 +196,23 @@ export async function runDetox(args: string[], opts: RunDetoxOpts = {}): Promise
|
|
|
195
196
|
console.log(` port: ${port}${headed ? ' (headed)' : ''}`)
|
|
196
197
|
if (localConfig) console.log(` config: ${localConfig}`)
|
|
197
198
|
|
|
198
|
-
|
|
199
|
+
// proof capture retains several full-resolution frames while jest tears its
|
|
200
|
+
// browser down. node 24.16.0's maglev collector can crash in
|
|
201
|
+
// ClearStaleLeftTrimmedPointerVisitor after every assertion has passed.
|
|
202
|
+
// the conformance lane pins that exact node runtime, so disable only its
|
|
203
|
+
// unstable optimization tier. normal user detox runs keep their own node
|
|
204
|
+
// defaults and still resolve jest through npx.
|
|
205
|
+
const proofCapture =
|
|
206
|
+
process.env.CONFORMANCE_PROOF === '1' || !!process.env.CONFORMANCE_PROOF_DIR
|
|
207
|
+
const command = proofCapture ? 'node' : 'npx'
|
|
208
|
+
const commandArgs = proofCapture
|
|
209
|
+
? [
|
|
210
|
+
'--no-maglev',
|
|
211
|
+
createRequire(join(process.cwd(), 'package.json')).resolve('jest/bin/jest'),
|
|
212
|
+
...jestArgs.slice(1),
|
|
213
|
+
]
|
|
214
|
+
: jestArgs
|
|
215
|
+
const child = spawn(command, commandArgs, {
|
|
199
216
|
cwd: process.cwd(),
|
|
200
217
|
stdio: 'inherit',
|
|
201
218
|
env: {
|
package/cli/commands/flow.ts
CHANGED
|
@@ -494,7 +494,8 @@ flow extension:
|
|
|
494
494
|
requireRecordingEntitlement: preview,
|
|
495
495
|
// re-arm the event recorder after every launchApp-with-reload. the
|
|
496
496
|
// recorder lives in-page state and gets wiped by window.location.reload.
|
|
497
|
-
onAfterLaunch: async () => {
|
|
497
|
+
onAfterLaunch: async (simId) => {
|
|
498
|
+
if (simId) saveCurrentSimId(simId)
|
|
498
499
|
const deviceChanged = await applyFlowFrontmatter()
|
|
499
500
|
if (deviceChanged) await driver.waitForTree(120000)
|
|
500
501
|
if (!preview) return
|
package/detox/index.ts
CHANGED
|
@@ -1166,7 +1166,9 @@ function createSootSimElement(matcher: Matcher): SootSimElement {
|
|
|
1166
1166
|
const node = await findNodeByMatcher(matcher)
|
|
1167
1167
|
if (!node)
|
|
1168
1168
|
throw new Error(`element not found for pinch: ${JSON.stringify(matcher)}`)
|
|
1169
|
-
|
|
1169
|
+
if (!node.nativePinchEnabled) {
|
|
1170
|
+
await waitForSootsimGestureHandler(page, node.nodeId, 'PinchGestureHandler')
|
|
1171
|
+
}
|
|
1170
1172
|
const startSpread = Math.min(
|
|
1171
1173
|
60,
|
|
1172
1174
|
Math.max(12, Math.min(node.layout.width, node.layout.height) * 0.25),
|
package/dist-cli/bin.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! rnx v0.1.
|
|
2
|
+
/*! rnx v0.1.366 | (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-KLF3K6ZZ.js";import{a as m}from"./chunks/chunk-5NMCF5VF.js";import"./chunks/chunk-JHXETDVC.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-JGURVR2Z.js");e=a(e)}var $=e.command==="cleanup"&&e.commandArgs.length===1&&e.commandArgs[0]==="--automatic-worker",_=!e.command&&e.commandArgs.length===0;if(!$&&!_&&!e.help&&!e.version&&e.command!=="config"&&e.command!=="setup"&&e.command!=="telemetry"){let{ensurePrivacyChoice:a}=await import("./chunks/privacy-PWWC2BXO.js");await a({prompt:!0})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:a}=await import("./chunks/home-paths-4ICFIGXO.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-MJUGJPXT.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",u=>{process.stderr.write(` ${m.name} automatic cleanup will retry on the next run: ${u.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-PZV4BISJ.js");await t(),await v(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-SYGNHGFR.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-N4LXL5TO.js"),d=t?` \xB7 ${i}`:"";console.log(`${m.commandName} v${a()}${d}`);let{readActiveRuntime:p}=await import("./chunks/home-paths-4ICFIGXO.js"),u=p();console.log(u?`runtime v${u}`:"runtime not installed"),await o(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-NLD6KWVG.js");a(),await o(0)}var n=e.globalFlags.port,c=e.verbose,w=e.globalFlags.device,l=e.globalFlags.theme,W=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(w||l){let{settingsStore:a}=await import("./chunks/store-VEE22CAY.js"),t={};w&&(t.deviceModel=w),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runWelcome:a}=await import("./chunks/welcome-ZPKA5PZJ.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-NLD6KWVG.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-ZK55SY32.js");await i(e.commandArgs),await o(0)}if(s==="state"){let{runState:i}=await import("./chunks/state-KFLAZNEY.js");await o(await i(r,{port:n}))}if(s==="reset"){let{runReset:i}=await import("./chunks/reset-Y3PBPFYA.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-NLD6KWVG.js");i(s)&&await o(0)}else{let{printCommandHelp:i}=await import("./chunks/help-NLD6KWVG.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-C347BG52.js");await a([s,...r],{port:n,verbose:c})}else switch(s){case"assert":{let{runAssert:a}=await import("./chunks/assert-WGNCD4ZU.js");await a(e.commandArgs);break}case"detox":{let{runDetox:a}=await import("./chunks/detox-7GNR33VM.js");await a(e.commandArgs,{port:n,verbose:c});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-2MXTGG7I.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-I2HJCFP3.js");await a(r,{port:n,verbose:c});break}case"film":{let{runFilm:a}=await import("./chunks/film-D7Y64LID.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-WP33ISEM.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-KFLAZNEY.js"),t=await a(r,{port:n});await o(t)}case"reset":{let{runReset:a}=await import("./chunks/reset-Y3PBPFYA.js"),t=await a(r,{port:n});await o(t)}case"perf":{let{runPerf:a}=await import("./chunks/perf-2TKPWB4N.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-UFW5BFHP.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-4JHCYBQS.js"),t=await a(r,{port:n});await o(typeof t=="number"?t:0)}case"mode":{let{runMode:a}=await import("./chunks/mode-3DAPG3HF.js");await a(r,{port:n,verbose:c});break}case"permissions":{let{runPermissions:a}=await import("./chunks/permissions-5CSMHYNA.js"),t=await a(r,{port:n,verbose:c});await o(t)}case"debug":{let{runDebug:a}=await import("./chunks/debug-WIIB6ZKC.js");await a(r,{port:n,verbose:c});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-DKGW5S4I.js");await a(r,{port:n,verbose:c});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-MIOMZWM5.js");await a(r,{port:n,verbose:c});break}case"open":{let{runOpenCommand:a}=await import("./chunks/control-RBTNOLQM.js");await a(r,{port:n});break}case"use":{let{runUseCommand:a}=await import("./chunks/control-RBTNOLQM.js");await a(r,{port:n});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-RBTNOLQM.js");await a(r,{port:n});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-RBTNOLQM.js");await a(r,{port:n});break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-QOR3PGUF.js");await a(r,{port:n});break}case"compat":{let{runCompat:a}=await import("./chunks/compat-6PTQ3QEA.js");await a(e.commandArgs);break}case"report-issue":{let{runReportIssue:a}=await import("./chunks/report-issue-A4FZWBOC.js"),t=await a(e.commandArgs);await o(t)}case"desktop":{let{runDesktop:a}=await import("./chunks/desktop-TD7Q5LNB.js");await a(e.commandArgs,{port:n,device:w});break}case"login":{let{runLogin:a}=await import("./chunks/login-RU33QR2G.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-2IUG3Y5J.js");await a();break}case"auth":{let{runAuth:a}=await import("./chunks/auth-G7CCHH3M.js");await a(e.commandArgs);break}case"setup":{let{runSetup:a}=await import("./chunks/setup-Y4QGSJBM.js");await a(e.commandArgs);break}case"serve":{let{runServe:a}=await import("./chunks/serve-O4FDM3AC.js");await a(e.commandArgs,{port:n});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-N3SC5DK6.js");await a(e.commandArgs,{port:n});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-IC6NVVGA.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-LL7G4B7G.js");await a(e.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-YLWR5G4F.js");await a(e.commandArgs);break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-SO6IOPRK.js"),t=await a(e.commandArgs);await o(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-PMYCB2KO.js"),t=await a(e.commandArgs);await o(t)}case"skill":{let{runSkill:a}=await import("./chunks/skills-ZK55SY32.js");await a(e.commandArgs);break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-LULQGFY7.js");await a(e.commandArgs);break}case"config":{let{runConfig:a}=await import("./chunks/config-ETGDUANO.js");await a(e.commandArgs);break}case"cleanup":{let{runCleanup:a}=await import("./chunks/cleanup-KRIATKFH.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.366 | (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-H23KWIKA.js";import"./chunk-OW5XHAA4.js";import{c as $}from"./chunk-2S7BKUP2.js";import"./chunk-ZFM24DOX.js";import"./chunk-NM2L2QV4.js";import"./chunk-M6SKQGAN.js";import"./chunk-XXNLYR64.js";import"./chunk-GUI3PDH2.js";import"./chunk-GAJQSITE.js";import"./chunk-VIND4SP3.js";import{j as y}from"./chunk-YXXKSL6R.js";import"./chunk-ONORMKWX.js";import"./chunk-5NMCF5VF.js";import"./chunk-EFR5DVNP.js";import"./chunk-JHXETDVC.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 daemon install\` to enable the faster background service, 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.366 | (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-OW5XHAA4.js";import"./chunk-JHXETDVC.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.366 | (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{p}from"./chunk-
|
|
4
|
+
import{p}from"./chunk-EQK5MJCU.js";import"./chunk-SA6XVI55.js";import"./chunk-HT6GFZOZ.js";import"./chunk-JHXETDVC.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.366 | (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-JHXETDVC.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.366 | (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-GXAB52K7.js";import{d as t}from"./chunk-UCHW7ZHR.js";import"./chunk-YXXKSL6R.js";import"./chunk-JHXETDVC.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.366 | (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-EFR5DVNP.js";import"./chunk-JHXETDVC.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.366 | (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-3X6IBUBX.js";import"./chunk-DW37EVX5.js";import{q as E,s as F,u as N}from"./chunk-GUI3PDH2.js";import"./chunk-GAJQSITE.js";import{r as S}from"./chunk-YXXKSL6R.js";import"./chunk-JHXETDVC.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.366 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as d}from"./chunk-
|
|
4
|
+
import{a as d}from"./chunk-ZFM24DOX.js";import{a as s}from"./chunk-NM2L2QV4.js";import{a as e}from"./chunk-M6SKQGAN.js";import{a as n}from"./chunk-GUI3PDH2.js";import{d as m,e as p,f as u}from"./chunk-VIND4SP3.js";import{a}from"./chunk-ONORMKWX.js";import{a as i}from"./chunk-5NMCF5VF.js";import{a as f,c}from"./chunk-EFR5DVNP.js";function g(){return`${i.commandName} CLI v${a()} \xB7 ${d().primary}`}function E(){let r=p({bridgePort:7668,defaultShellUrl:n},e()),o=`
|
|
5
5
|
${c}
|
|
6
6
|
`;console.log(`${g()}
|
|
7
7
|
${o}${r}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.366 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
4
|
import{execFileSync as S,execSync as x}from"node:child_process";var g=new WeakMap,l=new Set,b=!1;function f(){return{platform:process.platform,env:process.env}}function A(e){return S("/bin/ps",["-p",String(e),"-o","command="],{encoding:"utf8"}).trim()}function w(e=f()){return e.platform==="linux"&&e.env.GITHUB_ACTIONS==="true"&&e.env.RUNNER_OS==="Linux"}function L(e){let r=String(e);return/^--disable-gpu(?:=.*)?$/i.test(r)||/^--enable-unsafe-swiftshader(?:=.*)?$/i.test(r)||/^--use-angle=(?:swiftshader|swiftshader-webgl)$/i.test(r)||/^--use-gl=swiftshader$/i.test(r)}function I(e){return e.match(/(?:^|\s)(--disable-gpu(?:=[^\s]+)?|--enable-unsafe-swiftshader(?:=[^\s]+)?|--use-angle=(?:swiftshader|swiftshader-webgl)|--use-gl=swiftshader)(?=\s|$)/i)?.[1]??null}function k(e){return e==="darwin"?"metal":e==="linux"?"vulkan":"default"}function y(e,r=f()){if(w(r))return;let n=I(e);if(n)throw new Error(`[reap-browser] refused software-rendering Chrome process argument ${n}`);let o=k(r.platform),t=e.split(/\s+/);if(!t.includes(`--use-angle=${o}`)||!t.includes("--enable-gpu"))throw new Error(`[reap-browser] Chrome process did not retain the required ${o} GPU arguments`);if(r.platform==="darwin"&&e.includes("/Applications/Google Chrome.app/"))throw new Error("[reap-browser] refused the user's installed Google Chrome; use Playwright channel chromium")}function E(e){if(!e||typeof e!="object")return[];let n=e.gpu;if(!n||typeof n!="object")return[];let o=n,t=[],a=o.auxAttributes;if(a&&typeof a=="object")for(let s of Object.values(a))typeof s=="string"&&t.push(s);let i=o.devices;if(Array.isArray(i)){for(let s of i)if(!(!s||typeof s!="object"))for(let u of Object.values(s))typeof u=="string"&&t.push(u)}return t}function B(e){if(!e||typeof e!="object")return null;let r=e;if(!Array.isArray(r.processInfo))return null;for(let n of r.processInfo){if(!n||typeof n!="object")continue;let o=n;if(o.type==="browser"&&typeof o.id=="number"&&Number.isInteger(o.id)&&o.id>0)return o.id}return null}function G(e,r=f()){if(w(r))return;let o=E(e).join(" | ");if(!o||/swiftshader|llvmpipe|software rasterizer/i.test(o))throw new Error(`[reap-browser] Chrome reported a software renderer${o?`: ${o}`:""}`);if(r.platform==="darwin"&&!/metal/i.test(o))throw new Error(`[reap-browser] Chrome did not report an ANGLE Metal renderer: ${o}`)}function p(e){if(e&&typeof e=="object"){let n=g.get(e);if(n!==void 0)return n}let r=e;if(r&&typeof r.process=="function")try{let n=r.process();if(n&&typeof n.pid=="number"&&n.pid>0)return n.pid}catch{}if(r&&typeof r.browser=="function")try{let n=r.browser();if(n)return p(n)}catch{}return null}function h(e){let r=[];try{r=x(`pgrep -P ${e} || true`).toString().split(`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.366 | (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-GXAB52K7.js";import{c as _e,d as Pe}from"./chunk-ORWP2E7R.js";import{p as Ue}from"./chunk-EQK5MJCU.js";import{q as Ie,s as Ae,u as x}from"./chunk-GUI3PDH2.js";import{a as Be}from"./chunk-5NMCF5VF.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
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.366 | (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{I,m as E,n as P,p as y,u as F,w as N}from"./chunk-
|
|
4
|
+
import{I,m as E,n as P,p as y,u as F,w as N}from"./chunk-DW37EVX5.js";import{r as h,v as B,w as A}from"./chunk-GUI3PDH2.js";var k={timeoutMs:1800,settleMs:48,startWindowMs:64};function w(e){return new Promise(t=>setTimeout(t,e))}function z(e){return e.includes("--json")}function K(e){process.stdout.write(`${JSON.stringify(e??null,null,2)}
|
|
5
5
|
`)}function Q(e){process.stderr.write(`${e}
|
|
6
6
|
`)}function b(e,t=Date.now()){let r=new Date(e),n=`${S(r.getHours())}:${S(r.getMinutes())}:${S(r.getSeconds())}`,s=t-e;if(s<0)return n;let o=Math.round(s/1e3);return o<60?`${n} +${o}s`:o<3600?`${n} +${Math.round(o/60)}m`:o<86400?`${n} +${Math.round(o/3600)}h`:`${n} +${Math.round(o/86400)}d`}function S(e){return e<10?`0${e}`:String(e)}async function O(e,t,...r){return B(e,`__sootsimTest.${t}`,...r)}async function j(e,t,...r){return A(e,`SootSim.bridges.mainShell.${t}`,...r)}async function X(e,t={}){try{let r=await O(e,"waitForScreenTransitions",k);if(!t.verbose||!r?.started)return;if(r.timedOut){console.log(` screen transition still active after ${r.waitedMs}ms; continuing`);return}r.waitedMs>0&&console.log(` waited ${r.waitedMs}ms for screen transition settle`)}catch{}}async function Z(e,t,r,...n){let s=Date.now()+Math.max(0,r);for(;;)try{return await j(e,t,...n)}catch(o){if(!I(o)||Date.now()>=s)throw o;await w(50)}}async function ee(e,t,r,n={}){let s=n.attempts??30,o=n.intervalMs??500,l=n.minNodeCount??10;for(let i=0;i<s;i++){let u=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{let c=await u.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>l)return{bridge:u,count:c}}catch{}u.close(),await w(o)}return null}async function te(e,t,r,n={}){let s=n.timeoutMs??8e3,o=n.intervalMs??250,l=Date.now()+s;for(;Date.now()<l;){let i=h(e,{commandTimeoutMs:t,simId:r,simIdSource:n.simIdSource});try{return await i.send({type:"evaluate",code:"1"}),i}catch{i.close()}await w(o)}return null}async function ne(e,t={}){let r=t.timeoutMs??1e4,n=t.errorGraceMs??3e3,s=t.pollIntervalMs??200,o=Date.now(),l=o+r,i=-1,u=o,c=null,d=!1,m={ready:!1,source:"timeout",elapsedMs:0,nodes:0,targets:0,liveFrameActive:!1,liveFrameChannels:0,liveFramePublishes:0,flag:void 0,loadingText:"",externalReady:null,externalStatus:"",externalError:"",errors:0};for(;Date.now()<l;){try{let a=await e.send({type:"evaluate",code:E}),g=Date.now()-o,f=Number(a?.nodes)||0,$=Number(a?.targets)||0,C=a?.liveFrameActive===!0,W=Number(a?.liveFrameChannels)||0,q=Number(a?.liveFramePublishes)||0,x=Number(a?.errors)||0,T=a?.flag===!0,p=a?.externalReady,M=typeof a?.loadingText=="string"?a.loadingText.trim():"",D=typeof a?.externalStatus=="string"?a.externalStatus.trim():"",R=typeof a?.externalError=="string"?a.externalError.trim():"",v=typeof a?.externalError=="string"&&R.length>0;if(c=p,d=v,f!==i&&(i=f,u=g),m={ready:!1,source:"timeout",elapsedMs:g,nodes:f,targets:$,liveFrameActive:C,liveFrameChannels:W,liveFramePublishes:q,flag:a?.flag,loadingText:M,externalReady:typeof p=="boolean"?p:null,externalStatus:D,externalError:R,errors:x},T&&p!==!1&&!v&&!M&&y({liveFrameActive:C,nodes:f,targets:$})&&g-u>=P)return{...m,ready:!0,source:"flag"};if(g>=n&&x>0&&!T)return{...m,ready:!1,source:"error-bail"}}catch{}await w(s)}return c!==!1&&!d&&!m.loadingText&&y(m)?{...m,ready:!0,source:"nodes-fallback"}:{...m,ready:!1,source:"timeout",elapsedMs:Date.now()-o}}function H(e){let t=e.displayUrl||e.url;return e.status!=null?`${e.method} ${t} -> ${e.status}${e.statusText?` ${e.statusText}`:""}`:e.error?`${e.method} ${t} -> ${e.error}`:`${e.method} ${t}`}async function _(e,t,...r){return e.send({type:"call",path:`__sootsimTest.${t}`,args:r})}async function L(e,t={}){let r=await e.send({type:"evaluate",code:N});if(!r||typeof r!="object")return;let n=Math.max(0,Number(r.errors)||0),s=Math.max(0,Number(r.warnings)||0);if(n===0&&s===0)return;let o=[];if(n>0&&o.push(`${n} console error${n===1?"":"s"}`),s>0&&o.push(`${s} console warning${s===1?"":"s"}`),console.log(`
|
|
7
7
|
console: ${o.join(", ")}`),t.errorsCommand&&console.log(` inspect: ${t.errorsCommand}`),s>0&&t.warningsCommand&&console.log(` inspect: ${t.warningsCommand}`),!t.includeTail||n===0)return;let l=await F(e,5);if(!(!Array.isArray(l)||l.length===0)){console.log(`
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.366 | (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-NQFJOCSF.js";import{b}from"./chunk-GAJQSITE.js";import{a as f,b as S}from"./chunk-I6KIM6PN.js";import{a as v}from"./chunk-TTASWLKM.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.366 | (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.366 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
3
|
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as t}from"./chunk-
|
|
4
|
+
import{a as t}from"./chunk-IZKHOM37.js";import{i as s}from"./chunk-N3UC7HIX.js";import{F as o,G as n}from"./chunk-YXXKSL6R.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.366 | (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-HT6GFZOZ.js";import{a as f}from"./chunk-77ZHQJZR.js";import{a as i}from"./chunk-5NMCF5VF.js";import{createRequire as p}from"node:module";import s from"node:path";import{createJiti as a}from"jiti";var g=p(import.meta.url);function r(e){return e===void 0||e!==null&&typeof e=="object"&&!Array.isArray(e)}function l(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Reflect.get(e,"runtimeVersion"),o=Reflect.get(e,"network");return(t===void 0||typeof t=="string"&&t===t.trim()&&f(t))&&r(Reflect.get(e,"modules"))&&r(Reflect.get(e,"turboModules"))&&r(Reflect.get(e,"nativeModules"))&&r(Reflect.get(e,"env"))&&r(o)&&r(Reflect.get(e,"settings"))&&r(Reflect.get(e,"initialState"))}function d(e,t){if(!e.modules)return e;let o=s.dirname(t);return{...e,modules:Object.fromEntries(Object.entries(e.modules).map(([m,n])=>[m,n&&typeof n=="object"&&"file"in n?{...n,file:s.resolve(o,n.file)}:n]))}}async function u(e){if(e?.configPath)try{let o=await a(import.meta.url,{interopDefault:!0,alias:{[`${i.packageName}/config`]:g.resolve(`${i.packageName}/config`)}}).import(e.configPath,{default:!0});if(!l(o))throw new Error("the default export must be an rnx config object");return d(o,e.configPath)}catch(t){let o=t instanceof Error?t.message:String(t);throw new Error(`could not load ${e.configPath}: ${o}`)}}async function b(e=process.cwd()){let t=c(e);return{project:t,config:await u(t)}}export{u as a,b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.366 | (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-YXXKSL6R.js";import{a as L}from"./chunk-5NMCF5VF.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};
|