rnxsim 0.1.355 → 0.1.356
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/bridge-flow-runner.ts +73 -24
- package/cli/commands/maestro.ts +9 -4
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-2MW7ZKUX.js → agent-RHSVLLYV.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-XYQBKV24.js → agent-wrapper-76J2FUFC.js} +2 -2
- package/dist-cli/chunks/{app-fonts-SXIZFMPY.js → app-fonts-NXSVJTJO.js} +2 -2
- package/dist-cli/chunks/{assert-R324GCRG.js → assert-2EYNC3CJ.js} +2 -2
- package/dist-cli/chunks/{auth-INKYLYRZ.js → auth-BPTC5SFR.js} +2 -2
- package/dist-cli/chunks/{beta-BQHBSKA5.js → beta-SSB7KYRA.js} +2 -2
- package/dist-cli/chunks/{camera-UPRFBRPF.js → camera-VVTXBQXD.js} +2 -2
- package/dist-cli/chunks/{chunk-CUXVUSZS.js → chunk-2UIMQVMQ.js} +2 -2
- package/dist-cli/chunks/{chunk-KLVSEUJP.js → chunk-3OCUYKVX.js} +2 -2
- package/dist-cli/chunks/{chunk-EQEEPP5A.js → chunk-3QQFGK3A.js} +2 -2
- package/dist-cli/chunks/{chunk-XZJNPATS.js → chunk-3SYKCLCM.js} +2 -2
- package/dist-cli/chunks/{chunk-NCF3QNJG.js → chunk-4HQXS5PW.js} +2 -2
- package/dist-cli/chunks/{chunk-TADYO7TY.js → chunk-4V6JMAXO.js} +2 -2
- package/dist-cli/chunks/{chunk-QYIT7H6Q.js → chunk-5AF3BFLN.js} +2 -2
- package/dist-cli/chunks/{chunk-6EC3D5IG.js → chunk-5AKKSWL5.js} +1 -1
- package/dist-cli/chunks/{chunk-PYSIEEKP.js → chunk-5DAVGCVR.js} +1 -1
- package/dist-cli/chunks/{chunk-IAVHAWDL.js → chunk-6CGOQKVQ.js} +1 -1
- package/dist-cli/chunks/{chunk-JYQNEVHV.js → chunk-6TGSJGCM.js} +2 -2
- package/dist-cli/chunks/{chunk-FFNFGVGH.js → chunk-6TWYMJCB.js} +2 -2
- package/dist-cli/chunks/{chunk-WUYI4PVY.js → chunk-7E22W7XX.js} +1 -1
- package/dist-cli/chunks/{chunk-LQEC53JM.js → chunk-7EAA32OO.js} +2 -2
- package/dist-cli/chunks/{chunk-ZQF3PK76.js → chunk-A2F5B2AB.js} +2 -2
- package/dist-cli/chunks/{chunk-ZNWLFYZK.js → chunk-AA7PHU2M.js} +2 -2
- package/dist-cli/chunks/{chunk-VWPXXB6U.js → chunk-BMMSSIRU.js} +1 -1
- package/dist-cli/chunks/{chunk-247ZSWTI.js → chunk-BNZHWG6Z.js} +2 -2
- package/dist-cli/chunks/{chunk-VEMZUXVR.js → chunk-BXT37FPN.js} +1 -1
- package/dist-cli/chunks/{chunk-S27I7H2K.js → chunk-BZTXJUGV.js} +1 -1
- package/dist-cli/chunks/{chunk-SJEAA2FW.js → chunk-CK4C6GPT.js} +2 -2
- package/dist-cli/chunks/{chunk-MKHCGQSF.js → chunk-DRHNOXRS.js} +1 -1
- package/dist-cli/chunks/{chunk-23TG7DLH.js → chunk-E5ALNGXA.js} +1 -1
- package/dist-cli/chunks/{chunk-JE6NXNGL.js → chunk-E7DVCUK4.js} +3 -3
- package/dist-cli/chunks/{chunk-2Z2S3C6A.js → chunk-EVQNKPUK.js} +2 -2
- package/dist-cli/chunks/{chunk-EZXNGHZT.js → chunk-FAUFZBRY.js} +2 -2
- package/dist-cli/chunks/chunk-FVKAF4VB.js +535 -0
- package/dist-cli/chunks/{chunk-GWL4KMTK.js → chunk-FWBQKEAA.js} +2 -2
- package/dist-cli/chunks/{chunk-7URIRES5.js → chunk-G2SHGCDI.js} +2 -2
- package/dist-cli/chunks/{chunk-GE7GYFE4.js → chunk-GM6YYN6P.js} +2 -2
- package/dist-cli/chunks/{chunk-FPWDC2DE.js → chunk-I3G6YW6L.js} +1 -1
- package/dist-cli/chunks/{chunk-FDI226G4.js → chunk-IUQL37TT.js} +2 -2
- package/dist-cli/chunks/{chunk-Y5BP72QO.js → chunk-JU3ISZ7X.js} +1 -1
- package/dist-cli/chunks/{chunk-IJGL6T4M.js → chunk-NPH2KUL6.js} +2 -2
- package/dist-cli/chunks/{chunk-XFPGXEKW.js → chunk-NSEPQLZF.js} +1 -1
- package/dist-cli/chunks/{chunk-JP2YS7LC.js → chunk-OUMGSDHQ.js} +1 -1
- package/dist-cli/chunks/{chunk-W3QLC24Z.js → chunk-P5F5PM6C.js} +2 -2
- package/dist-cli/chunks/{chunk-N532KCKW.js → chunk-RBQUFMLX.js} +2 -2
- package/dist-cli/chunks/{chunk-CRE3V3EG.js → chunk-RFSFQUUJ.js} +1 -1
- package/dist-cli/chunks/{chunk-QWJD2CAJ.js → chunk-RQZCBNCD.js} +1 -1
- package/dist-cli/chunks/{chunk-X36BQCH5.js → chunk-SZD4NAQR.js} +2 -2
- package/dist-cli/chunks/{chunk-GFDFVKVW.js → chunk-T33T5MW2.js} +1 -1
- package/dist-cli/chunks/{chunk-LJCBPR7S.js → chunk-TLA6GLYI.js} +2 -2
- package/dist-cli/chunks/{chunk-AY4OA5UI.js → chunk-TV5LN34R.js} +2 -2
- package/dist-cli/chunks/{chunk-S4K3TDYB.js → chunk-UC6Y77PK.js} +2 -2
- package/dist-cli/chunks/{chunk-ZOFRHAGX.js → chunk-UUD5NLLB.js} +1 -1
- package/dist-cli/chunks/{chunk-Y3D3DCQV.js → chunk-VIEN2LIY.js} +2 -2
- package/dist-cli/chunks/{chunk-FF2CEKZF.js → chunk-VSADIZVW.js} +2 -2
- package/dist-cli/chunks/{chunk-6WCDWBG6.js → chunk-VZKPDDYL.js} +2 -2
- package/dist-cli/chunks/{chunk-SEWNI4GS.js → chunk-X2YH3SPS.js} +1 -1
- package/dist-cli/chunks/{chunk-F6S4Z7N7.js → chunk-XJ2LMLUP.js} +1 -1
- package/dist-cli/chunks/{chunk-MCAQZI3R.js → chunk-XMNBS5CX.js} +1 -1
- package/dist-cli/chunks/{chunk-42LIUAHU.js → chunk-XT6FA7AH.js} +2 -2
- package/dist-cli/chunks/chunk-Z6CATT5W.js +4 -0
- package/dist-cli/chunks/{chunk-CK3M7MAL.js → chunk-ZK67ALEG.js} +2 -2
- package/dist-cli/chunks/{chunk-BUOAYILA.js → chunk-ZME75NBJ.js} +4 -4
- package/dist-cli/chunks/{cleanup-5FGGUP6U.js → cleanup-E7TDW64X.js} +2 -2
- package/dist-cli/chunks/cli-version-HUIGZMTX.js +4 -0
- package/dist-cli/chunks/{compat-J4OEALGF.js → compat-ST5BY7FP.js} +2 -2
- package/dist-cli/chunks/{config-MCH2R7WG.js → config-Z5NEHXI7.js} +2 -2
- package/dist-cli/chunks/{control-NPWFRKZS.js → control-JMDFMAHT.js} +2 -2
- package/dist-cli/chunks/daemon-VIL2M7RE.js +4 -0
- package/dist-cli/chunks/{debug-7NHPYUX6.js → debug-DO2G2BA7.js} +3 -3
- package/dist-cli/chunks/{desktop-EIBJC5EU.js → desktop-M3UETMNI.js} +3 -3
- package/dist-cli/chunks/{detox-ZFEQKHDT.js → detox-7JI56JTD.js} +2 -2
- package/dist-cli/chunks/{device-JM7QMQFQ.js → device-YTRCB26J.js} +2 -2
- package/dist-cli/chunks/{diagnose-DCMU2GAD.js → diagnose-BJT3RXDI.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-RPW5MYGM.js → disk-cleanup-HWA4ATEL.js} +2 -2
- package/dist-cli/chunks/drivers-HIKMT3EH.js +4 -0
- package/dist-cli/chunks/{film-NRGBZSC7.js → film-GLGYFHGZ.js} +3 -3
- package/dist-cli/chunks/flow-AJT2OYLT.js +4 -0
- package/dist-cli/chunks/help-DSDQRHN3.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-GSZG7QFD.js → hidden-runtime-alias-A4TMRHFA.js} +2 -2
- package/dist-cli/chunks/{home-paths-OGXLRRTG.js → home-paths-A2ANFZHA.js} +2 -2
- package/dist-cli/chunks/inspect-NXE6LUT6.js +4 -0
- package/dist-cli/chunks/install-desktop-DMTXQF3R.js +4 -0
- package/dist-cli/chunks/{login-A7JSAMON.js → login-OWD44PHN.js} +2 -2
- package/dist-cli/chunks/{logout-EBUWNT63.js → logout-WV5QPIUW.js} +2 -2
- package/dist-cli/chunks/{maestro-OEXXVYMW.js → maestro-AQ342FXT.js} +18 -13
- package/dist-cli/chunks/{maestro-generate-DKH6IUTC.js → maestro-generate-AUTBK5QS.js} +3 -3
- package/dist-cli/chunks/{mode-YKX2UTBX.js → mode-XICLRQZH.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-W4Z54NYF.js → optional-demo-registry-FOXLAYLM.js} +2 -2
- package/dist-cli/chunks/{perf-EJDB2NWH.js → perf-PUT7IITA.js} +2 -2
- package/dist-cli/chunks/{permissions-MXUT3YR6.js → permissions-AHJWQPCL.js} +2 -2
- package/dist-cli/chunks/privacy-AYLEWFZX.js +4 -0
- package/dist-cli/chunks/{record-STFUL6CS.js → record-V4MZ33XI.js} +3 -3
- package/dist-cli/chunks/{report-issue-TE2QTEMZ.js → report-issue-QBB54OJ5.js} +2 -2
- package/dist-cli/chunks/reset-BMGMOHRM.js +4 -0
- package/dist-cli/chunks/runtime-SYUM3ASK.js +4 -0
- package/dist-cli/chunks/{screenshot-command-SRW3HXF7.js → screenshot-command-PK54GDUY.js} +3 -3
- package/dist-cli/chunks/{screenshot-layers-IULR35XJ.js → screenshot-layers-AQZK3GRM.js} +2 -2
- package/dist-cli/chunks/{screenshots-capture-54GFQLXS.js → screenshots-capture-KXQDIF2S.js} +2 -2
- package/dist-cli/chunks/{serve-WJAOT43K.js → serve-YPNVL33J.js} +2 -2
- package/dist-cli/chunks/setup-FM3JVRMY.js +4 -0
- package/dist-cli/chunks/{skills-DW5GLHAT.js → skills-4CBIW5IP.js} +2 -2
- package/dist-cli/chunks/{state-IW4THIPU.js → state-AWM3LRRR.js} +2 -2
- package/dist-cli/chunks/{storage-F4RQZFTZ.js → storage-S2LC3T7Q.js} +2 -2
- package/dist-cli/chunks/store-SZX3GXCL.js +4 -0
- package/dist-cli/chunks/telemetry-ANUHW6KD.js +4 -0
- package/dist-cli/chunks/{timeline-IX3HVS22.js → timeline-4AWI6M2T.js} +2 -2
- package/dist-cli/chunks/{upgrade-T4LWQ2JA.js → upgrade-WSYVILOP.js} +2 -2
- package/dist-cli/chunks/upload-U2KPYBGD.js +4 -0
- package/dist-cli/chunks/{version-MNRMHJ64.js → version-XE4ZTCON.js} +2 -2
- package/dist-cli/chunks/{web-ARKJI3PY.js → web-ZS6L2NLF.js} +2 -2
- package/dist-cli/chunks/welcome-UE273JKY.js +5 -0
- package/dist-cli/chunks/{what-happened-EBK5NZFI.js → what-happened-6AHCKADV.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 +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +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 +82 -54
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/skills/rnx-test/SKILL.md +6 -2
- package/src/bridge-contract.ts +8 -2
- package/dist-cli/chunks/chunk-2GLEESND.js +0 -535
- package/dist-cli/chunks/chunk-UIBR3GXC.js +0 -4
- package/dist-cli/chunks/cli-version-JP47UGY6.js +0 -4
- package/dist-cli/chunks/daemon-M26NJFNC.js +0 -4
- package/dist-cli/chunks/drivers-DW3CQUTK.js +0 -4
- package/dist-cli/chunks/flow-76SLGQCI.js +0 -4
- package/dist-cli/chunks/help-GUYB5XWH.js +0 -4
- package/dist-cli/chunks/inspect-URTBYLXV.js +0 -4
- package/dist-cli/chunks/install-desktop-BINBAGSN.js +0 -4
- package/dist-cli/chunks/privacy-JIJOFIGM.js +0 -4
- package/dist-cli/chunks/reset-LAIGONON.js +0 -4
- package/dist-cli/chunks/runtime-ZS3FBQLG.js +0 -4
- package/dist-cli/chunks/setup-36ACJ5FT.js +0 -4
- package/dist-cli/chunks/store-MTN4TPL6.js +0 -4
- package/dist-cli/chunks/telemetry-CJSVYHLI.js +0 -4
- package/dist-cli/chunks/upload-LHWECFWH.js +0 -4
- package/dist-cli/chunks/welcome-XH657K2V.js +0 -5
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
framesIdentical,
|
|
8
8
|
} from '../detox/proof-frame.cjs'
|
|
9
9
|
import { composeFramedScreenshot } from '../src/screenshots/frame-compose'
|
|
10
|
-
import { resetGuestAppStateEval } from './app-state-reset'
|
|
11
10
|
import {
|
|
12
11
|
READY_NODE_STABLE_MS,
|
|
13
12
|
READY_PROBE_POLL_MS,
|
|
@@ -23,6 +22,10 @@ import { MaestroJsContext, scriptConditionIsTruthy } from './maestro-js'
|
|
|
23
22
|
import { ensureCliRecordingEntitlement } from './recording-access'
|
|
24
23
|
import type { PerformResult, PerformStep, ResetResult } from '../src/bridge-contract'
|
|
25
24
|
import type { WsBridge } from './ws-bridge'
|
|
25
|
+
import type {
|
|
26
|
+
SootSimExternalAppLifecycleOptions,
|
|
27
|
+
SootSimLaunchArguments,
|
|
28
|
+
} from '@sootsim/globals'
|
|
26
29
|
|
|
27
30
|
const DEFAULT_TIMEOUT = 10000
|
|
28
31
|
// hosted-runner previews reach first-render much slower than local dev: the
|
|
@@ -411,6 +414,8 @@ export class SootSimBridgeFlowRunner {
|
|
|
411
414
|
})
|
|
412
415
|
|
|
413
416
|
private firstLaunchDone = false
|
|
417
|
+
private appStopped = false
|
|
418
|
+
private launchArgumentsActive = false
|
|
414
419
|
private profilingEnabled = false
|
|
415
420
|
private recordingEnabled = false
|
|
416
421
|
private recordingAccessChecked = false
|
|
@@ -1967,12 +1972,17 @@ export class SootSimBridgeFlowRunner {
|
|
|
1967
1972
|
await this.refreshSimId()
|
|
1968
1973
|
}
|
|
1969
1974
|
|
|
1970
|
-
private async resetGuestAppData(
|
|
1975
|
+
private async resetGuestAppData(
|
|
1976
|
+
launchOptions?: Pick<
|
|
1977
|
+
SootSimExternalAppLifecycleOptions,
|
|
1978
|
+
'initialUrl' | 'launchArguments'
|
|
1979
|
+
>,
|
|
1980
|
+
) {
|
|
1971
1981
|
const reset: ResetResult = await this.bridge.send(
|
|
1972
1982
|
{
|
|
1973
1983
|
type: 'reset',
|
|
1974
1984
|
simId: this.opts.simId,
|
|
1975
|
-
resetOptions: { strategy: 'data' },
|
|
1985
|
+
resetOptions: { strategy: 'data', ...launchOptions },
|
|
1976
1986
|
},
|
|
1977
1987
|
{ timeoutMs: 120000 },
|
|
1978
1988
|
)
|
|
@@ -1987,14 +1997,16 @@ export class SootSimBridgeFlowRunner {
|
|
|
1987
1997
|
}
|
|
1988
1998
|
}
|
|
1989
1999
|
|
|
1990
|
-
private async
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
2000
|
+
private async reloadGuestAppRuntime(options: SootSimExternalAppLifecycleOptions) {
|
|
2001
|
+
await this.bridge.send(
|
|
2002
|
+
{
|
|
2003
|
+
type: 'call',
|
|
2004
|
+
simId: this.opts.simId,
|
|
2005
|
+
path: 'SootSim.bridges.hotRemount.reloadExternalApp',
|
|
2006
|
+
args: [options],
|
|
2007
|
+
},
|
|
2008
|
+
{ timeoutMs: 120000 },
|
|
1994
2009
|
)
|
|
1995
|
-
if (!reloaded) {
|
|
1996
|
-
throw new Error('guest app soft reload bridge unavailable')
|
|
1997
|
-
}
|
|
1998
2010
|
}
|
|
1999
2011
|
|
|
2000
2012
|
private async rearmCaptureAfterRuntimeReload() {
|
|
@@ -2021,12 +2033,14 @@ export class SootSimBridgeFlowRunner {
|
|
|
2021
2033
|
|
|
2022
2034
|
async launchApp(opts: any) {
|
|
2023
2035
|
await this.refreshSimId()
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2036
|
+
let hasLaunchArguments = false
|
|
2037
|
+
let launchArguments: SootSimLaunchArguments | undefined
|
|
2038
|
+
if (isObjectRecord(opts) && Object.prototype.hasOwnProperty.call(opts, 'arguments')) {
|
|
2039
|
+
if (!isObjectRecord(opts.arguments)) {
|
|
2040
|
+
throw new Error('launchApp.arguments must be a JSON object')
|
|
2041
|
+
}
|
|
2042
|
+
hasLaunchArguments = true
|
|
2043
|
+
launchArguments = opts.arguments
|
|
2030
2044
|
}
|
|
2031
2045
|
const wantsClear = !!(opts && typeof opts === 'object' && opts.clearState)
|
|
2032
2046
|
const wantsResetRuntime = readBooleanKey(opts, 'resetRuntime')
|
|
@@ -2036,7 +2050,15 @@ export class SootSimBridgeFlowRunner {
|
|
|
2036
2050
|
// Maestro's "launch the app" boundary through the shell. Otherwise the
|
|
2037
2051
|
// guest app is already booting from the initial sim open, so just wait.
|
|
2038
2052
|
this.firstLaunchDone = true
|
|
2039
|
-
if (
|
|
2053
|
+
if (hasLaunchArguments) {
|
|
2054
|
+
const launched = await this.launchShellAppFromHomeIfNeeded(opts)
|
|
2055
|
+
if (launched) await this.waitForTree(120000)
|
|
2056
|
+
await this.reloadGuestAppRuntime({
|
|
2057
|
+
launchArguments,
|
|
2058
|
+
initialUrl: null,
|
|
2059
|
+
})
|
|
2060
|
+
await this.waitForTree(120000)
|
|
2061
|
+
} else if (wantsResetRuntime) {
|
|
2040
2062
|
// SootSim benchmark flows need app auth/storage kept warm while the
|
|
2041
2063
|
// guest React runtime starts fresh inside the timed/recorded boundary.
|
|
2042
2064
|
// the reload re-runs the app entry inside the mounted app surface, so
|
|
@@ -2050,7 +2072,14 @@ export class SootSimBridgeFlowRunner {
|
|
|
2050
2072
|
// second readiness wait would only pad the measured reset.
|
|
2051
2073
|
const launched = await this.launchShellAppFromHomeIfNeeded(opts)
|
|
2052
2074
|
if (launched) await this.waitForTree(120000)
|
|
2053
|
-
await this.
|
|
2075
|
+
await this.reloadGuestAppRuntime({})
|
|
2076
|
+
await this.waitForTree(120000)
|
|
2077
|
+
} else if (this.appStopped) {
|
|
2078
|
+
await this.launchShellAppFromHomeIfNeeded(opts)
|
|
2079
|
+
await this.reloadGuestAppRuntime({
|
|
2080
|
+
launchArguments: null,
|
|
2081
|
+
initialUrl: null,
|
|
2082
|
+
})
|
|
2054
2083
|
await this.waitForTree(120000)
|
|
2055
2084
|
} else {
|
|
2056
2085
|
await this.launchShellAppFromHomeIfNeeded(opts)
|
|
@@ -2059,7 +2088,15 @@ export class SootSimBridgeFlowRunner {
|
|
|
2059
2088
|
} else {
|
|
2060
2089
|
this.firstLaunchDone = true
|
|
2061
2090
|
if (wantsClear) {
|
|
2062
|
-
await this.resetGuestAppData(
|
|
2091
|
+
await this.resetGuestAppData({
|
|
2092
|
+
launchArguments: hasLaunchArguments ? launchArguments : null,
|
|
2093
|
+
initialUrl: null,
|
|
2094
|
+
})
|
|
2095
|
+
} else if (hasLaunchArguments || this.launchArgumentsActive || this.appStopped) {
|
|
2096
|
+
await this.reloadGuestAppRuntime({
|
|
2097
|
+
launchArguments: hasLaunchArguments ? launchArguments : null,
|
|
2098
|
+
initialUrl: null,
|
|
2099
|
+
})
|
|
2063
2100
|
} else {
|
|
2064
2101
|
await this.reloadGuestApp()
|
|
2065
2102
|
}
|
|
@@ -2077,6 +2114,9 @@ export class SootSimBridgeFlowRunner {
|
|
|
2077
2114
|
}
|
|
2078
2115
|
}
|
|
2079
2116
|
|
|
2117
|
+
this.appStopped = false
|
|
2118
|
+
this.launchArgumentsActive = hasLaunchArguments
|
|
2119
|
+
|
|
2080
2120
|
if (this.profilingEnabled) {
|
|
2081
2121
|
await this.startProfile()
|
|
2082
2122
|
}
|
|
@@ -2181,12 +2221,10 @@ export class SootSimBridgeFlowRunner {
|
|
|
2181
2221
|
}
|
|
2182
2222
|
|
|
2183
2223
|
// maestro stopApp: tear down the current app runtime without clearing app
|
|
2184
|
-
// data.
|
|
2185
|
-
// nearest equivalent to killing and later re-launching the tenant runtime.
|
|
2186
|
-
// State clearing belongs to clearState / launchApp({ clearState: true }).
|
|
2224
|
+
// data. the next launchApp or openLink creates its replacement worker.
|
|
2187
2225
|
async stopApp() {
|
|
2188
|
-
await this.
|
|
2189
|
-
|
|
2226
|
+
await this.reloadGuestAppRuntime({ relaunch: false })
|
|
2227
|
+
this.appStopped = true
|
|
2190
2228
|
}
|
|
2191
2229
|
|
|
2192
2230
|
// maestro clearState: wipe app-owned storage and relaunch fresh.
|
|
@@ -2258,6 +2296,17 @@ export class SootSimBridgeFlowRunner {
|
|
|
2258
2296
|
async openLink(target: string | { link: string }) {
|
|
2259
2297
|
const link = typeof target === 'string' ? target : target.link
|
|
2260
2298
|
if (!link) throw new Error('openLink: missing link')
|
|
2299
|
+
if (this.appStopped) {
|
|
2300
|
+
await this.reloadGuestAppRuntime({
|
|
2301
|
+
initialUrl: link,
|
|
2302
|
+
launchArguments: null,
|
|
2303
|
+
})
|
|
2304
|
+
await this.waitForTree(120000)
|
|
2305
|
+
this.appStopped = false
|
|
2306
|
+
this.launchArgumentsActive = false
|
|
2307
|
+
this.firstLaunchDone = true
|
|
2308
|
+
return
|
|
2309
|
+
}
|
|
2261
2310
|
const result = await this.callTest<{ ok: boolean; error?: string }>(
|
|
2262
2311
|
'openDeepLink',
|
|
2263
2312
|
link,
|
package/cli/commands/maestro.ts
CHANGED
|
@@ -73,7 +73,7 @@ function printCompatMatrix() {
|
|
|
73
73
|
rnx maestro — compatibility matrix
|
|
74
74
|
|
|
75
75
|
supported verbs:
|
|
76
|
-
launchApp, stopApp, clearState, clearKeychain (warn-only),
|
|
76
|
+
launchApp (including arguments), stopApp, clearState, clearKeychain (warn-only),
|
|
77
77
|
tapOn, tapAtCoords, longPressOn,
|
|
78
78
|
inputText, pressKey, dispatchKey, hideKeyboard, eraseText,
|
|
79
79
|
assertVisible, assertNotVisible, assertTreeContains,
|
|
@@ -92,12 +92,17 @@ workspace mode (directory runs):
|
|
|
92
92
|
config.yaml / config.yml discovery, flows: inclusion globs,
|
|
93
93
|
includeTags / excludeTags against flow frontmatter tags.
|
|
94
94
|
|
|
95
|
+
launch behavior:
|
|
96
|
+
launchApp.arguments: a JSON object available before guest app entry through
|
|
97
|
+
react-native-launch-arguments and NativeModules.SettingsManager.settings.
|
|
98
|
+
stopApp: keeps the guest stopped until launchApp or openLink starts it.
|
|
99
|
+
openLink: cold-starts a stopped guest with the initial URL; a running guest
|
|
100
|
+
receives the URL through React Native Linking.
|
|
101
|
+
|
|
95
102
|
partial:
|
|
96
103
|
clearKeychain — warn-only, rnx has no keychain surface.
|
|
97
104
|
when.platform — rnx reports iOS for this runner.
|
|
98
|
-
openLink
|
|
99
|
-
(react-navigation deep links work); no OS-level Safari fallback.
|
|
100
|
-
launchApp.arguments — ignored; rnx has no native process.
|
|
105
|
+
openLink: app routing works; no OS-level Safari fallback.
|
|
101
106
|
launchApp.resetRuntime — sootsim-only extension for recorded benchmarks:
|
|
102
107
|
keep tenant storage/auth, but soft-reload the guest app inside launchApp.
|
|
103
108
|
takeScreenshot — maestro string form works unchanged; rnx also accepts
|
package/dist-cli/bin.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! rnx v0.1.
|
|
2
|
+
/*! rnx v0.1.356 | (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-T33T5MW2.js";import{a as m}from"./chunks/chunk-5AKKSWL5.js";import"./chunks/chunk-BZTXJUGV.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-A4TMRHFA.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-AYLEWFZX.js");await a({prompt:!0})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:a}=await import("./chunks/home-paths-A2ANFZHA.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-HWA4ATEL.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-ANUHW6KD.js");await t(),await v(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-HUIGZMTX.js"),{IS_BETA:t,BETA_LABEL:i}=await import("./chunks/beta-SSB7KYRA.js"),d=t?` \xB7 ${i}`:"";console.log(`${m.commandName} v${a()}${d}`);let{readActiveRuntime:p}=await import("./chunks/home-paths-A2ANFZHA.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-DSDQRHN3.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-SZX3GXCL.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-UE273JKY.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-DSDQRHN3.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-4CBIW5IP.js");await i(e.commandArgs),await o(0)}if(s==="state"){let{runState:i}=await import("./chunks/state-AWM3LRRR.js");await o(await i(r,{port:n}))}if(s==="reset"){let{runReset:i}=await import("./chunks/reset-BMGMOHRM.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-DSDQRHN3.js");i(s)&&await o(0)}else{let{printCommandHelp:i}=await import("./chunks/help-DSDQRHN3.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-NXE6LUT6.js");await a([s,...r],{port:n,verbose:c})}else switch(s){case"assert":{let{runAssert:a}=await import("./chunks/assert-2EYNC3CJ.js");await a(e.commandArgs);break}case"detox":{let{runDetox:a}=await import("./chunks/detox-7JI56JTD.js");await a(e.commandArgs,{port:n,verbose:c});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-AQ342FXT.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-V4MZ33XI.js");await a(r,{port:n,verbose:c});break}case"film":{let{runFilm:a}=await import("./chunks/film-GLGYFHGZ.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-S2LC3T7Q.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-AWM3LRRR.js"),t=await a(r,{port:n});await o(t)}case"reset":{let{runReset:a}=await import("./chunks/reset-BMGMOHRM.js"),t=await a(r,{port:n});await o(t)}case"perf":{let{runPerf:a}=await import("./chunks/perf-PUT7IITA.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-PK54GDUY.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-VVTXBQXD.js"),t=await a(r,{port:n});await o(typeof t=="number"?t:0)}case"mode":{let{runMode:a}=await import("./chunks/mode-XICLRQZH.js");await a(r,{port:n,verbose:c});break}case"permissions":{let{runPermissions:a}=await import("./chunks/permissions-AHJWQPCL.js"),t=await a(r,{port:n,verbose:c});await o(t)}case"debug":{let{runDebug:a}=await import("./chunks/debug-DO2G2BA7.js");await a(r,{port:n,verbose:c});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-4AWI6M2T.js");await a(r,{port:n,verbose:c});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-6AHCKADV.js");await a(r,{port:n,verbose:c});break}case"open":{let{runOpenCommand:a}=await import("./chunks/control-JMDFMAHT.js");await a(r,{port:n});break}case"use":{let{runUseCommand:a}=await import("./chunks/control-JMDFMAHT.js");await a(r,{port:n});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-JMDFMAHT.js");await a(r,{port:n});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-JMDFMAHT.js");await a(r,{port:n});break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-YTRCB26J.js");await a(r,{port:n});break}case"compat":{let{runCompat:a}=await import("./chunks/compat-ST5BY7FP.js");await a(e.commandArgs);break}case"report-issue":{let{runReportIssue:a}=await import("./chunks/report-issue-QBB54OJ5.js"),t=await a(e.commandArgs);await o(t)}case"desktop":{let{runDesktop:a}=await import("./chunks/desktop-M3UETMNI.js");await a(e.commandArgs,{port:n,device:w});break}case"login":{let{runLogin:a}=await import("./chunks/login-OWD44PHN.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-WV5QPIUW.js");await a();break}case"auth":{let{runAuth:a}=await import("./chunks/auth-BPTC5SFR.js");await a(e.commandArgs);break}case"setup":{let{runSetup:a}=await import("./chunks/setup-FM3JVRMY.js");await a(e.commandArgs);break}case"serve":{let{runServe:a}=await import("./chunks/serve-YPNVL33J.js");await a(e.commandArgs,{port:n});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-VIL2M7RE.js");await a(e.commandArgs,{port:n});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-SYUM3ASK.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-WSYVILOP.js");await a(e.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-XE4ZTCON.js");await a(e.commandArgs);break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-RHSVLLYV.js"),t=await a(e.commandArgs);await o(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-76J2FUFC.js"),t=await a(e.commandArgs);await o(t)}case"skill":{let{runSkill:a}=await import("./chunks/skills-4CBIW5IP.js");await a(e.commandArgs);break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-NXSVJTJO.js");await a(e.commandArgs);break}case"config":{let{runConfig:a}=await import("./chunks/config-Z5NEHXI7.js");await a(e.commandArgs);break}case"cleanup":{let{runCleanup:a}=await import("./chunks/cleanup-E7TDW64X.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.356 | (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-5AF3BFLN.js";import"./chunk-E5ALNGXA.js";import{c as $}from"./chunk-7EAA32OO.js";import"./chunk-ZK67ALEG.js";import"./chunk-SZD4NAQR.js";import"./chunk-AA7PHU2M.js";import"./chunk-VSADIZVW.js";import"./chunk-XT6FA7AH.js";import"./chunk-RQZCBNCD.js";import"./chunk-I3G6YW6L.js";import{j as y}from"./chunk-XJ2LMLUP.js";import"./chunk-FWBQKEAA.js";import"./chunk-5AKKSWL5.js";import"./chunk-6CGOQKVQ.js";import"./chunk-BZTXJUGV.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.356 | (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-E5ALNGXA.js";import"./chunk-BZTXJUGV.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.356 | (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-G2SHGCDI.js";import"./chunk-NSEPQLZF.js";import"./chunk-5DAVGCVR.js";import"./chunk-BZTXJUGV.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.356 | (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-BZTXJUGV.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.356 | (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-CK4C6GPT.js";import{d as t}from"./chunk-TLA6GLYI.js";import"./chunk-XJ2LMLUP.js";import"./chunk-BZTXJUGV.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.356 | (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-6CGOQKVQ.js";import"./chunk-BZTXJUGV.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.356 | (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-6TGSJGCM.js";import"./chunk-BXT37FPN.js";import{q as E,s as F,u as N}from"./chunk-XT6FA7AH.js";import"./chunk-RQZCBNCD.js";import{r as S}from"./chunk-XJ2LMLUP.js";import"./chunk-BZTXJUGV.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,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.356 | (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-5DAVGCVR.js";import{a as f}from"./chunk-NPH2KUL6.js";import{a as i}from"./chunk-5AKKSWL5.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,7 +1,7 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.356 | (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 me,b as We}from"./chunk-EQEEPP5A.js";import{a as Je,b as Qe,d as et}from"./chunk-NCF3QNJG.js";import{a as Le,b as Ae,c as I,d as ce,e as D,f as de,g as Ne,h as ue,i as Fe,j as je,l as Ve,m as ze,n as Ge}from"./chunk-7URIRES5.js";import{m as L}from"./chunk-JYQNEVHV.js";import{m as Ye,p as Ze}from"./chunk-VEMZUXVR.js";import{e as Xe}from"./chunk-AY4OA5UI.js";import{c as He}from"./chunk-TADYO7TY.js";import{a as qe}from"./chunk-CUXVUSZS.js";import{a as Ke}from"./chunk-PYSIEEKP.js";import{b as se,d as Oe}from"./chunk-FF2CEKZF.js";import{b as Te,f as _e,g as B,h as $,i as M,k as Be,l as ae,m as le,o as Me,p as De,q as U,r as P,s as E}from"./chunk-42LIUAHU.js";import{f as Ee}from"./chunk-IJGL6T4M.js";import{a as Ue}from"./chunk-JP2YS7LC.js";import{D as Ce,M as oe,P as ie,R as _,T as Re,l as re}from"./chunk-F6S4Z7N7.js";import{a as ne}from"./chunk-6EC3D5IG.js";import{spawn as st,spawnSync as at}from"node:child_process";import O from"node:fs";import Dt from"node:os";import C from"node:path";import{WebSocket as pe}from"ws";function tt(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function Ut(e,n){return e?.includes("/one/metro-entry.bundle")?"one":typeof n=="string"&&n?"expo":"unknown"}function Et(e,n,t){return`${e}//${n}:${t}`}function Ot(e){if(typeof window>"u")return!1;try{let n=new URL(e);return I(n.hostname)&&I(window.location.hostname)&&n.origin!==window.location.origin}catch{return!1}}async function nt(e,n){let t={...n,cache:n?.cache??"no-store"};return Ot(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Tt(e){return e==="https:"?443:80}function _t(e){let n=e.pathname||"/";return(n==="/"||n==="")&&!e.search&&!e.hash}async function rt(e){try{let n=await fetch("/__server-scan",{cache:"no-store"});if(!n.ok||!(n.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await n.json();if(!Array.isArray(t))return null;let r=t.find(o=>!!o&&typeof o=="object"&&o.port===e&&typeof o.bundleUrl=="string");return r?{bundleUrl:ue(r.bundleUrl),port:e,framework:typeof r.framework=="string"?r.framework:"unknown",projectName:typeof r.projectName=="string"?r.projectName:void 0}:null}catch{return null}}async function ot(e,n){let t=e.replace(/\/+$/,"");try{let r=await nt(`${t}/`,{headers:{"expo-platform":"ios"}});if(r.ok){let o=await r.json(),i=o?.extra?.expoClient||o?.extra||{},s=typeof o?.launchAsset?.url=="string"?o.launchAsset.url:void 0,a=s?Ne(s,t):void 0;if(a||i.name)return{bundleUrl:ue(a||`${t}${de}`),port:n,framework:Ut(a,i.sdkVersion),projectName:i.name}}}catch{}try{let r=await nt(`${t}/status`);if(r.ok&&(await r.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:n,framework:"metro"}}catch{}return null}async function Bt(e,n){try{if(I(new URL(e).hostname)){let t=await rt(n);if(t)return t}}catch{}return ot(e,n)}async function Mt(e){let n=await rt(e);return n||((await Promise.all(Le.map(r=>ot(Ae("http:",r,e),e)))).find(r=>r!==null)??null)}async function it(e){let n=e.trim();if(/^\d+$/.test(n)){let a=parseInt(n,10),l=await Mt(a);if(l)return l;throw tt(`localhost:${a}`)}let t=n.startsWith("http")?n:`http://${n}`,r;try{r=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let o=r.protocol||"http:",i=r.port?parseInt(r.port,10):Tt(o),s=Et(o,r.hostname,i);if(_t(r)){let a=await Bt(s,i);if(a)return a;throw tt(s)}return{bundleUrl:r.toString(),port:i,framework:"unknown"}}var Lt=12e4,lt=100,At=5e3,ct=1e4,Nt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function S(e){return new Promise(n=>setTimeout(n,e))}function dt(e){let n=process.env[e]?.trim();if(!n)return null;let t=Number(n);return Number.isInteger(t)&&t>0?t:null}function Ft(){let e=dt("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??dt("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Lt;return{timeoutMs:e,hostTimeoutMs:e+At,intervalMs:lt,attempts:Math.max(1,Math.ceil(e/lt))}}function ut(e){return e==="electron"||e==="playwright"}function fe(e,n){return n==="playwright"?e.meta?.sootsimHostDriver==="playwright":e.userAgent?.includes("Electron/")===!0}function jt(e,n){return e.includes("--headless")?!0:e.includes("--headed")?!1:n==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function z(e){return e.trim()}var bt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Ht(e){let n=e.trim();if(!n)throw new Error("expected <url-or-route>");return bt.test(n)||n.startsWith("/")?n:`/${n}`}function Wt(e){return e!==null&&typeof e=="object"}function Kt(e){let n=e.trim();return n?n.startsWith("/")?!0:bt.test(n)?!/^https?:\/\//i.test(n):!1:!1}async function qt(e,n=!1){let t=ie();mt(e,n,t);let r=ae(e);if((n||r!==null)&&await ge(e,250))return e;if(t&&_(t)&&await ge(t.bridgePort,500))return t.bridgePort;if(t&&_(t))throw new Error(`rnx bridge lockfile is fresh (port ${t.bridgePort}) but the bridge is not reachable. run \`rnx daemon restart\` or \`rnx daemon uninstall\`.`);await Vt();let o=zt(["serve","--quiet","--port",String(e)]),i=null;o.once("exit",(a,l)=>{i=String(a??l??"unknown")}),o.unref();let s=Date.now()+ct;for(;Date.now()<s;){let a=ie();if(mt(e,n,a),a&&_(a)&&await ge(a.bridgePort,250))return console.error(` Started a local bridge on port ${a.bridgePort}. Run \`rnx daemon install\` to keep it ready between commands.`),a.bridgePort;if(i)throw new Error(`rnx bridge exited before becoming ready (exit ${i})`);await S(150)}throw new Error(`rnx bridge did not start within ${Math.round(ct/1e3)}s`)}function mt(e,n,t){if(!(!n||!t||!_(t)||t.bridgePort===e))throw new Error(`${ne.commandName} open: requested bridge port ${e}, but the active daemon owns port ${t.bridgePort}. explicit --port never selects another bridge; stop that daemon or use an isolated SOOTSIM_HOME.`)}async function Vt(){let e=oe();if(e&&O.existsSync(re(e)))return;console.error(" installing rnx engine runtime...");let{runRuntime:n}=await import("./runtime-ZS3FBQLG.js");await n(["install"],{})}function zt(e){let n=process.argv[1];return n&&O.existsSync(n)?st(process.execPath,[n,...e],{detached:!0,stdio:"ignore",env:process.env}):st(ne.commandName,e,{detached:!0,stdio:"ignore",env:process.env})}function ge(e,n){return new Promise(t=>{let r=new pe(`ws://127.0.0.1:${e}`,{handshakeTimeout:n}),o=!1,i=s=>{o||(o=!0,r.readyState===pe.OPEN?r.close():r.readyState===pe.CONNECTING&&r.terminate(),t(s))};r.once("open",()=>i(!0)),r.on("error",()=>i(!1)),setTimeout(()=>i(!1),n)})}function we(e){try{let n=new URL(e),t=n.pathname.replace(/\/+$/,"")||"/";return n.searchParams.has("open")||n.searchParams.has("port")||n.searchParams.has("bundle")||n.searchParams.has("demo")||n.pathname.includes("/sootsim/index.html")||t==="/sootsim"||n.pathname==="/__soot"||n.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Gt(e){try{let n=new URL(e,"http://sootsim.local");if(n.origin!=="http://sootsim.local")return!1;let t=n.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Jt(e,n){let t=new URL(e,"http://sootsim.local"),r=new URL(n),o=G(r.pathname),i=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return r.pathname=`${o}${i}`,r.search=t.search,r.hash=t.hash,r.toString()}function Qt(e){try{let n=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(n)||/^\/build\/.+/.test(n)}catch{return!1}}async function ir(e){let n=z(e);return(await ve(n)).bundleUrl}function Yt(e){try{let n=new URL(e.startsWith("http")?e:`http://${e}`),t=n.pathname||"/";if(t!=="/"&&t!==""||n.search||n.hash||!I(n.hostname))return null;let r=n.port?Number(n.port):n.protocol==="https:"?443:80;return Number.isFinite(r)&&r>0?r:null}catch{return null}}async function ve(e){let n=z(e),t=/^\d+$/.test(n)?Number(n):Yt(n);if(t&&t>0){let r=await je(t);if(r)return{bundleUrl:r.bundleUrl,port:r.port,framework:r.framework,projectName:r.projectName}}return it(n)}function G(e){let n=e.replace(/\/+$/,"")||"/";return n==="/__soot"||n.startsWith("/__soot/")?"/__soot":""}function Zt(e,n){let t=z(e),r=new URL(n),o=G(r.pathname);return r.pathname=`${o}/rn`,r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),/^\d+$/.test(t)?r.pathname=`${o}/rn/${t}`:(r.pathname=`${o}/rn`,r.searchParams.set("open",t)),r.toString()}function vt(e){let n=z(e);return/^\d+$/.test(n)||/^https?:\/\//i.test(n)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(n)}async function Xt(e,n,t={}){let r=t.resolvedBundle??await ve(e),o=new URL(n),i=G(o.pathname);o.pathname=`${i}/rn`,o.searchParams.delete("open"),o.searchParams.delete("port"),o.searchParams.delete("demo"),o.searchParams.delete("app");let s=t.hot===void 0?r.bundleUrl:Fe(r.bundleUrl,t.hot);return o.searchParams.set("bundle",s),o.toString()}function en(e){return e.startsWith("~/")?C.join(Dt.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function tn(e){let n={},t={};for(let o=0;o<e.length;o++){if(e[o]==="--replace"){let i=e[o+1];i||(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let s=i.indexOf("=");(s<=0||s===i.length-1)&&(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let a=i.slice(0,s).trim(),l=en(i.slice(s+1).trim());O.existsSync(l)||(console.error(` rnx open: replacement file not found: ${l}`),process.exit(1)),n[a]={file:l},o++;continue}if(e[o]==="--remap"){let i=e[o+1],s=i?i.indexOf("="):-1;(!i||s<=0||s===i.length-1)&&(console.error(" rnx open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[i.slice(0,s).trim()]=i.slice(s+1).trim(),o++;continue}}let r={};return Object.keys(n).length>0&&(r.modules=n),Object.keys(t).length>0&&(r.network={remap:t}),r.modules||r.network?r:void 0}async function nn(e){if(!e)return null;let n=await ze(e.bundleUrl);return n?Ke(n):null}async function rn(e){if(O.existsSync(C.join(re(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let n=await Ee.install({version:e,setActive:!1,protectVersions:Re()});console.error(` installed engine runtime ${n.version}`)}function on(e,n){let t=n??(me()?void 0:oe()??void 0);if(!t)return e;let r=new URL(e);if(!I(r.hostname)){if(!n)return e;throw new Error(`runtimeVersion ${t} requires a local rnx host; got ${r.origin}`)}return r.hostname=We(t),r.toString()}function yt(){return Be().shellBaseUrl}function sn(e){return ae(e)?.shellBaseUrl??Te(e)??yt()}async function an(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Ve({bundleUrl:r,projectDir:n.appDir});if(o.length===0)return e;let i=await ln(o);return i.length===0?e:(t.searchParams.set("appFonts",Ge(i)),t.toString())}catch{return e}}async function ln(e){let n=await Promise.all(e.map(async r=>{let o=new AbortController,i=setTimeout(()=>o.abort(),1500);try{let s=await fetch(r.url,{method:"HEAD",signal:o.signal});return s.status>=200&&s.status<400?r:null}catch{return null}finally{clearTimeout(i)}})),t=[];for(let r of n)r!==null&&t.push(r);return t}async function cn(e,n,t={}){if(!e)return new URL(n).toString();if(we(e))return new URL(e).toString();if(Gt(e))return Jt(e,n);let r=Nt[e.toLowerCase()];if(r){let o=new URL(n),i=G(o.pathname);return o.pathname=`${i}${r}`,o.toString()}return vt(e)?Xt(e,n,t):Zt(e,n)}async function dn(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Je({bundleUrl:r,projectDir:n.appDir});return!o||o.imageUrl&&!await un(o.imageUrl)?e:(t.searchParams.set("appSplash",Qe(o)),t.toString())}catch{return e}}async function un(e){let n=new AbortController,t=setTimeout(()=>n.abort(),1500);try{let r=await fetch(e,{method:"HEAD",signal:n.signal});return r.status>=200&&r.status<400}catch{return!1}finally{clearTimeout(t)}}async function V(e,n=yt(),t={}){let r=await cn(e,n,t),o=await dn(await an(r,t.project),t.project);if(!t.device)return o;let i=new URL(o);return i.searchParams.set("device",t.device),i.toString()}function pt(e,n){let t=e?.url||e?.origin||n;try{let r=new URL(t);return r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("inspectOpen"),r.searchParams.delete("appFonts"),r.searchParams.delete("appSplash"),r.toString()}catch{return n}}async function mn(e,n,t,r={}){let o=new URL(await V(e,n,r));return o.searchParams.set("inspectOpen",t),o.toString()}async function pn(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500,s=r.minNodeCount??10;for(let a=0;a<o;a++){let l=P(e,{commandTimeoutMs:n,simId:t,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>s)return{bridge:l,count:c}}catch{}l.close(),await S(i)}return null}function fn(e){if(!e)return null;try{let n=new URL(e);if(n.searchParams.has("bundle")){let t=n.searchParams.get("bundle")||"";try{let r=new URL(t),o=r.pathname.length>36?`...${r.pathname.slice(-36)}`:r.pathname;return`bundle ${r.host}${o}`}catch{return"bundle"}}return n.searchParams.has("port")?`connect :${n.searchParams.get("port")||""}`:n.searchParams.has("open")?`connect ${n.searchParams.get("open")||""}`:n.searchParams.has("demo")?`demo ${n.searchParams.get("demo")||"default"}`:n.pathname.includes("/sootsim/index.html")||n.pathname==="/sootsim/"||n.pathname==="/sootsim"?"embedded rnx":null}catch{return null}}function gn(e){let n=e.indexOf(":");if(n<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,n),r=e.slice(n+1),o=r.length>12?`${r.slice(0,8)}\u2026`:r;return t==="TM_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${o}`:`${t} ${o}`}function sr(e,n){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
4
|
+
import{a as me,b as We}from"./chunk-3QQFGK3A.js";import{a as Je,b as Qe,d as et}from"./chunk-4HQXS5PW.js";import{a as Le,b as Ae,c as I,d as ce,e as D,f as de,g as Ne,h as ue,i as Fe,j as je,l as Ve,m as ze,n as Ge}from"./chunk-G2SHGCDI.js";import{m as L}from"./chunk-6TGSJGCM.js";import{m as Ye,p as Ze}from"./chunk-BXT37FPN.js";import{e as Xe}from"./chunk-TV5LN34R.js";import{c as He}from"./chunk-4V6JMAXO.js";import{a as qe}from"./chunk-2UIMQVMQ.js";import{a as Ke}from"./chunk-5DAVGCVR.js";import{b as se,d as Oe}from"./chunk-VSADIZVW.js";import{b as Te,f as _e,g as B,h as $,i as M,k as Be,l as ae,m as le,o as Me,p as De,q as U,r as P,s as E}from"./chunk-XT6FA7AH.js";import{f as Ee}from"./chunk-NPH2KUL6.js";import{a as Ue}from"./chunk-OUMGSDHQ.js";import{D as Ce,M as oe,P as ie,R as _,T as Re,l as re}from"./chunk-XJ2LMLUP.js";import{a as ne}from"./chunk-5AKKSWL5.js";import{spawn as st,spawnSync as at}from"node:child_process";import O from"node:fs";import Dt from"node:os";import C from"node:path";import{WebSocket as pe}from"ws";function tt(e){return new Error(`could not resolve a native bundle for ${e}. pass an explicit bundle URL or open Connect and choose the app there.`)}function Ut(e,n){return e?.includes("/one/metro-entry.bundle")?"one":typeof n=="string"&&n?"expo":"unknown"}function Et(e,n,t){return`${e}//${n}:${t}`}function Ot(e){if(typeof window>"u")return!1;try{let n=new URL(e);return I(n.hostname)&&I(window.location.hostname)&&n.origin!==window.location.origin}catch{return!1}}async function nt(e,n){let t={...n,cache:n?.cache??"no-store"};return Ot(e)?fetch(`/__fetch-proxy?url=${encodeURIComponent(e)}`,t):fetch(e,t)}function Tt(e){return e==="https:"?443:80}function _t(e){let n=e.pathname||"/";return(n==="/"||n==="")&&!e.search&&!e.hash}async function rt(e){try{let n=await fetch("/__server-scan",{cache:"no-store"});if(!n.ok||!(n.headers.get("content-type")||"").toLowerCase().includes("json"))return null;let t=await n.json();if(!Array.isArray(t))return null;let r=t.find(o=>!!o&&typeof o=="object"&&o.port===e&&typeof o.bundleUrl=="string");return r?{bundleUrl:ue(r.bundleUrl),port:e,framework:typeof r.framework=="string"?r.framework:"unknown",projectName:typeof r.projectName=="string"?r.projectName:void 0}:null}catch{return null}}async function ot(e,n){let t=e.replace(/\/+$/,"");try{let r=await nt(`${t}/`,{headers:{"expo-platform":"ios"}});if(r.ok){let o=await r.json(),i=o?.extra?.expoClient||o?.extra||{},s=typeof o?.launchAsset?.url=="string"?o.launchAsset.url:void 0,a=s?Ne(s,t):void 0;if(a||i.name)return{bundleUrl:ue(a||`${t}${de}`),port:n,framework:Ut(a,i.sdkVersion),projectName:i.name}}}catch{}try{let r=await nt(`${t}/status`);if(r.ok&&(await r.text()).includes("packager-status:running"))return{bundleUrl:`${t}${de}`,port:n,framework:"metro"}}catch{}return null}async function Bt(e,n){try{if(I(new URL(e).hostname)){let t=await rt(n);if(t)return t}}catch{}return ot(e,n)}async function Mt(e){let n=await rt(e);return n||((await Promise.all(Le.map(r=>ot(Ae("http:",r,e),e)))).find(r=>r!==null)??null)}async function it(e){let n=e.trim();if(/^\d+$/.test(n)){let a=parseInt(n,10),l=await Mt(a);if(l)return l;throw tt(`localhost:${a}`)}let t=n.startsWith("http")?n:`http://${n}`,r;try{r=new URL(t)}catch{throw new Error(`could not parse "${e}". pass a dev-server port, a dev-server base URL, or a full bundle URL.`)}let o=r.protocol||"http:",i=r.port?parseInt(r.port,10):Tt(o),s=Et(o,r.hostname,i);if(_t(r)){let a=await Bt(s,i);if(a)return a;throw tt(s)}return{bundleUrl:r.toString(),port:i,framework:"unknown"}}var Lt=12e4,lt=100,At=5e3,ct=1e4,Nt={rn:"/rn",connectrn:"/rn","connect-rn":"/rn",clock:"/app/clock","native-ui":"/app/native-ui",tamagui:"/app/tamagui",settings:"/app/settings",photos:"/app/photos",camera:"/app/camera"};function S(e){return new Promise(n=>setTimeout(n,e))}function dt(e){let n=process.env[e]?.trim();if(!n)return null;let t=Number(n);return Number.isInteger(t)&&t>0?t:null}function Ft(){let e=dt("SOOTSIM_DRIVER_CONNECT_TIMEOUT_MS")??dt("SOOTSIM_PW_CONNECT_TIMEOUT_MS")??Lt;return{timeoutMs:e,hostTimeoutMs:e+At,intervalMs:lt,attempts:Math.max(1,Math.ceil(e/lt))}}function ut(e){return e==="electron"||e==="playwright"}function fe(e,n){return n==="playwright"?e.meta?.sootsimHostDriver==="playwright":e.userAgent?.includes("Electron/")===!0}function jt(e,n){return e.includes("--headless")?!0:e.includes("--headed")?!1:n==="playwright"&&process.platform==="linux"&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY?(console.error(" no display detected \u2192 running playwright headless (override with --headed)"),!0):!1}function z(e){return e.trim()}var bt=/^[A-Za-z][A-Za-z0-9+.-]*:/;function Ht(e){let n=e.trim();if(!n)throw new Error("expected <url-or-route>");return bt.test(n)||n.startsWith("/")?n:`/${n}`}function Wt(e){return e!==null&&typeof e=="object"}function Kt(e){let n=e.trim();return n?n.startsWith("/")?!0:bt.test(n)?!/^https?:\/\//i.test(n):!1:!1}async function qt(e,n=!1){let t=ie();mt(e,n,t);let r=ae(e);if((n||r!==null)&&await ge(e,250))return e;if(t&&_(t)&&await ge(t.bridgePort,500))return t.bridgePort;if(t&&_(t))throw new Error(`rnx bridge lockfile is fresh (port ${t.bridgePort}) but the bridge is not reachable. run \`rnx daemon restart\` or \`rnx daemon uninstall\`.`);await Vt();let o=zt(["serve","--quiet","--port",String(e)]),i=null;o.once("exit",(a,l)=>{i=String(a??l??"unknown")}),o.unref();let s=Date.now()+ct;for(;Date.now()<s;){let a=ie();if(mt(e,n,a),a&&_(a)&&await ge(a.bridgePort,250))return console.error(` Started a local bridge on port ${a.bridgePort}. Run \`rnx daemon install\` to keep it ready between commands.`),a.bridgePort;if(i)throw new Error(`rnx bridge exited before becoming ready (exit ${i})`);await S(150)}throw new Error(`rnx bridge did not start within ${Math.round(ct/1e3)}s`)}function mt(e,n,t){if(!(!n||!t||!_(t)||t.bridgePort===e))throw new Error(`${ne.commandName} open: requested bridge port ${e}, but the active daemon owns port ${t.bridgePort}. explicit --port never selects another bridge; stop that daemon or use an isolated SOOTSIM_HOME.`)}async function Vt(){let e=oe();if(e&&O.existsSync(re(e)))return;console.error(" installing rnx engine runtime...");let{runRuntime:n}=await import("./runtime-SYUM3ASK.js");await n(["install"],{})}function zt(e){let n=process.argv[1];return n&&O.existsSync(n)?st(process.execPath,[n,...e],{detached:!0,stdio:"ignore",env:process.env}):st(ne.commandName,e,{detached:!0,stdio:"ignore",env:process.env})}function ge(e,n){return new Promise(t=>{let r=new pe(`ws://127.0.0.1:${e}`,{handshakeTimeout:n}),o=!1,i=s=>{o||(o=!0,r.readyState===pe.OPEN?r.close():r.readyState===pe.CONNECTING&&r.terminate(),t(s))};r.once("open",()=>i(!0)),r.on("error",()=>i(!1)),setTimeout(()=>i(!1),n)})}function we(e){try{let n=new URL(e),t=n.pathname.replace(/\/+$/,"")||"/";return n.searchParams.has("open")||n.searchParams.has("port")||n.searchParams.has("bundle")||n.searchParams.has("demo")||n.pathname.includes("/sootsim/index.html")||t==="/sootsim"||n.pathname==="/__soot"||n.pathname==="/__soot/"||t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Gt(e){try{let n=new URL(e,"http://sootsim.local");if(n.origin!=="http://sootsim.local")return!1;let t=n.pathname.replace(/\/+$/,"")||"/";return t==="/rn"||/^\/rn\/[^/]+$/i.test(t)||/^\/app\/[^/]+$/i.test(t)||t==="/__soot/rn"||/^\/__soot\/rn\/[^/]+$/i.test(t)||/^\/__soot\/app\/[^/]+$/i.test(t)}catch{return!1}}function Jt(e,n){let t=new URL(e,"http://sootsim.local"),r=new URL(n),o=G(r.pathname),i=t.pathname.startsWith("/__soot/")?t.pathname.slice(7):t.pathname;return r.pathname=`${o}${i}`,r.search=t.search,r.hash=t.hash,r.toString()}function Qt(e){try{let n=new URL(e).pathname.replace(/\/+$/,"")||"/";return/^\/preview\/[^/]+$/.test(n)||/^\/build\/.+/.test(n)}catch{return!1}}async function ir(e){let n=z(e);return(await ve(n)).bundleUrl}function Yt(e){try{let n=new URL(e.startsWith("http")?e:`http://${e}`),t=n.pathname||"/";if(t!=="/"&&t!==""||n.search||n.hash||!I(n.hostname))return null;let r=n.port?Number(n.port):n.protocol==="https:"?443:80;return Number.isFinite(r)&&r>0?r:null}catch{return null}}async function ve(e){let n=z(e),t=/^\d+$/.test(n)?Number(n):Yt(n);if(t&&t>0){let r=await je(t);if(r)return{bundleUrl:r.bundleUrl,port:r.port,framework:r.framework,projectName:r.projectName}}return it(n)}function G(e){let n=e.replace(/\/+$/,"")||"/";return n==="/__soot"||n.startsWith("/__soot/")?"/__soot":""}function Zt(e,n){let t=z(e),r=new URL(n),o=G(r.pathname);return r.pathname=`${o}/rn`,r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),/^\d+$/.test(t)?r.pathname=`${o}/rn/${t}`:(r.pathname=`${o}/rn`,r.searchParams.set("open",t)),r.toString()}function vt(e){let n=z(e);return/^\d+$/.test(n)||/^https?:\/\//i.test(n)?!0:/^(localhost|127\.0\.0\.1|\[::1\]|[^/]+\.localhost):\d+(?:\/.*)?$/i.test(n)}async function Xt(e,n,t={}){let r=t.resolvedBundle??await ve(e),o=new URL(n),i=G(o.pathname);o.pathname=`${i}/rn`,o.searchParams.delete("open"),o.searchParams.delete("port"),o.searchParams.delete("demo"),o.searchParams.delete("app");let s=t.hot===void 0?r.bundleUrl:Fe(r.bundleUrl,t.hot);return o.searchParams.set("bundle",s),o.toString()}function en(e){return e.startsWith("~/")?C.join(Dt.homedir(),e.slice(2)):C.isAbsolute(e)?e:C.resolve(process.cwd(),e)}function tn(e){let n={},t={};for(let o=0;o<e.length;o++){if(e[o]==="--replace"){let i=e[o+1];i||(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let s=i.indexOf("=");(s<=0||s===i.length-1)&&(console.error(" rnx open: --replace expects <module>=<file>"),process.exit(1));let a=i.slice(0,s).trim(),l=en(i.slice(s+1).trim());O.existsSync(l)||(console.error(` rnx open: replacement file not found: ${l}`),process.exit(1)),n[a]={file:l},o++;continue}if(e[o]==="--remap"){let i=e[o+1],s=i?i.indexOf("="):-1;(!i||s<=0||s===i.length-1)&&(console.error(" rnx open: --remap expects <host:port>=<host:port>"),process.exit(1)),t[i.slice(0,s).trim()]=i.slice(s+1).trim(),o++;continue}}let r={};return Object.keys(n).length>0&&(r.modules=n),Object.keys(t).length>0&&(r.network={remap:t}),r.modules||r.network?r:void 0}async function nn(e){if(!e)return null;let n=await ze(e.bundleUrl);return n?Ke(n):null}async function rn(e){if(O.existsSync(C.join(re(e),"index.html")))return;console.error(` installing configured engine runtime ${e}...`);let n=await Ee.install({version:e,setActive:!1,protectVersions:Re()});console.error(` installed engine runtime ${n.version}`)}function on(e,n){let t=n??(me()?void 0:oe()??void 0);if(!t)return e;let r=new URL(e);if(!I(r.hostname)){if(!n)return e;throw new Error(`runtimeVersion ${t} requires a local rnx host; got ${r.origin}`)}return r.hostname=We(t),r.toString()}function yt(){return Be().shellBaseUrl}function sn(e){return ae(e)?.shellBaseUrl??Te(e)??yt()}async function an(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Ve({bundleUrl:r,projectDir:n.appDir});if(o.length===0)return e;let i=await ln(o);return i.length===0?e:(t.searchParams.set("appFonts",Ge(i)),t.toString())}catch{return e}}async function ln(e){let n=await Promise.all(e.map(async r=>{let o=new AbortController,i=setTimeout(()=>o.abort(),1500);try{let s=await fetch(r.url,{method:"HEAD",signal:o.signal});return s.status>=200&&s.status<400?r:null}catch{return null}finally{clearTimeout(i)}})),t=[];for(let r of n)r!==null&&t.push(r);return t}async function cn(e,n,t={}){if(!e)return new URL(n).toString();if(we(e))return new URL(e).toString();if(Gt(e))return Jt(e,n);let r=Nt[e.toLowerCase()];if(r){let o=new URL(n),i=G(o.pathname);return o.pathname=`${i}${r}`,o.toString()}return vt(e)?Xt(e,n,t):Zt(e,n)}async function dn(e,n){try{let t=new URL(e),r=t.searchParams.get("bundle")||"";if(!r||!n)return e;let o=Je({bundleUrl:r,projectDir:n.appDir});return!o||o.imageUrl&&!await un(o.imageUrl)?e:(t.searchParams.set("appSplash",Qe(o)),t.toString())}catch{return e}}async function un(e){let n=new AbortController,t=setTimeout(()=>n.abort(),1500);try{let r=await fetch(e,{method:"HEAD",signal:n.signal});return r.status>=200&&r.status<400}catch{return!1}finally{clearTimeout(t)}}async function V(e,n=yt(),t={}){let r=await cn(e,n,t),o=await dn(await an(r,t.project),t.project);if(!t.device)return o;let i=new URL(o);return i.searchParams.set("device",t.device),i.toString()}function pt(e,n){let t=e?.url||e?.origin||n;try{let r=new URL(t);return r.searchParams.delete("bundle"),r.searchParams.delete("demo"),r.searchParams.delete("app"),r.searchParams.delete("open"),r.searchParams.delete("port"),r.searchParams.delete("inspectOpen"),r.searchParams.delete("appFonts"),r.searchParams.delete("appSplash"),r.toString()}catch{return n}}async function mn(e,n,t,r={}){let o=new URL(await V(e,n,r));return o.searchParams.set("inspectOpen",t),o.toString()}async function pn(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500,s=r.minNodeCount??10;for(let a=0;a<o;a++){let l=P(e,{commandTimeoutMs:n,simId:t,simIdSource:"flag"});try{let c=await l.send({type:"evaluate",code:"(async () => (await window.__sootsimTest?.getNodeCount()) || 0)()"});if(typeof c=="number"&&c>s)return{bridge:l,count:c}}catch{}l.close(),await S(i)}return null}function fn(e){if(!e)return null;try{let n=new URL(e);if(n.searchParams.has("bundle")){let t=n.searchParams.get("bundle")||"";try{let r=new URL(t),o=r.pathname.length>36?`...${r.pathname.slice(-36)}`:r.pathname;return`bundle ${r.host}${o}`}catch{return"bundle"}}return n.searchParams.has("port")?`connect :${n.searchParams.get("port")||""}`:n.searchParams.has("open")?`connect ${n.searchParams.get("open")||""}`:n.searchParams.has("demo")?`demo ${n.searchParams.get("demo")||"default"}`:n.pathname.includes("/sootsim/index.html")||n.pathname==="/sootsim/"||n.pathname==="/sootsim"?"embedded rnx":null}catch{return null}}function gn(e){let n=e.indexOf(":");if(n<=0)return e.length>24?`${e.slice(0,21)}\u2026`:e;let t=e.slice(0,n),r=e.slice(n+1),o=r.length>12?`${r.slice(0,8)}\u2026`:r;return t==="TM_SESSION"||t==="CLAUDE_CODE_SESSION_ID"||t==="CODEX_THREAD_ID"?`agent ${o}`:`${t} ${o}`}function sr(e,n){if(e.length===0){console.log(" no sims connected");return}console.log(` connected sims (${e.length}):
|
|
5
5
|
`);for(let t of e){let r=t.lockedBy&&t.lockExpiresAt?`locked by ${gn(t.lockedBy)} (${Math.max(0,Math.round((t.lockExpiresAt-Date.now())/1e3))}s)`:"",o=[t.isPrimary?"primary":"",t.id===n?"selected":"",t.readyState,t.userVisible===!1?"hidden":t.userVisible===!0?"visible":"",t.attachedCliCount&&t.attachedCliCount>0?"in use":"",t.userFocused?"focused":"",r].filter(Boolean);console.log(` ${t.id}${o.length?` [${o.join(", ")}]`:""}`);let i=fn(t.url);if(i)console.log(` loaded: ${i}`);else if(t.url){let a=t.url.length>96?`${t.url.slice(0,93)}\u2026`:t.url;console.log(` url: ${a}`)}else t.origin&&console.log(` origin: ${t.origin}`);let s=hn(t);s&&console.log(` engine: ${s}`),t.title&&console.log(` title: ${t.title}`),t.visibilityState&&t.visibilityState!=="visible"&&console.log(` visibility: ${t.visibilityState}`),console.log(` connected: ${ft(Date.now()-t.connectedAt)}`),t.lastActiveAt&&t.lastActiveAt>0&&console.log(` last active: ${ft(Date.now()-t.lastActiveAt)}`)}}function hn(e){let n=e.url||e.origin||"";if(!n)return null;try{let t=new URL(n).port;return t==="5173"?"dev \u2014 local source (:5173)":t==="3000"?"Contrast app embedded (:3000)":me()?`dev \u2014 local build (:${t||"?"})`:`runtime \u2014 published engine (:${t||"?"})`}catch{return null}}function ft(e){let n=Math.max(0,Math.round(e/1e3));return n<60?`${n}s ago`:n<3600?`${Math.round(n/60)}m ago`:n<86400?`${Math.round(n/3600)}h ago`:`${Math.round(n/86400)}d ago`}async function ar(e,n,t,r={}){let o=r.attempts??30,i=r.intervalMs??500;for(let s=0;s<o;s++){let a=P(e,{commandTimeoutMs:n});try{let c=(await a.listSims()).find(t);if(c)return c}catch{}finally{a.close()}await S(i)}return null}async function wn(e,n,t,r,o={}){let i=o.attempts??30,s=o.intervalMs??500,a=!!r&&Number.isInteger(r)&&r>1,l=()=>a&&r!==void 0&&!be(r);for(let c=0;c<i;c++){if(l())return{kind:"host-exit"};let u=P(e,{commandTimeoutMs:n});try{let g=(await u.listSims()).find(t);if(g)return l()?{kind:"host-exit"}:{kind:"match",sim:g}}catch{}finally{u.close()}if(l())return{kind:"host-exit"};await S(s)}return{kind:"timeout"}}async function bn(e,n,t,r={}){let o=r.attempts??20,i=r.intervalMs??250;for(let s=0;s<o;s++){let a=P(e,{commandTimeoutMs:n});try{let c=(await a.listSims()).find(u=>u.id===t);if(!c||c.readyState!=="open")return!0}catch{return!0}finally{a.close()}await S(i)}return!1}function vn(e){let n=e.meta;if(!n||n.sootsimHostDriver!=="playwright")return null;let t=Number(n.sootsimHostPid);return!Number.isInteger(t)||t<=1||t===process.pid?null:t}function yn(e){if(!e.connectAckFile)return!1;try{return O.writeFileSync(e.connectAckFile,`${JSON.stringify({connectedAt:Date.now(),pid:e.pid??null})}
|
|
6
6
|
`,{flag:"w"}),!0}catch{return!1}}function gt(e){if(e.diagnosticLogPath)try{let n=O.readFileSync(e.diagnosticLogPath,"utf8").trim();if(!n){console.error(` ${C.basename(e.diagnosticLogPath)} was empty`);return}let t=n.length>4e3?`\u2026
|
|
7
7
|
${n.slice(-4e3)}`:n;console.error(` ${C.basename(e.diagnosticLogPath)}:`),console.error(t)}catch(n){let t=n instanceof Error?n.message:String(n);console.error(` failed to read ${C.basename(e.diagnosticLogPath)}: ${t}`)}}function be(e){try{return process.kill(e,0),!0}catch(n){return n?.code==="EPERM"}}async function Sn(e,n=2500){let t=Date.now()+n;for(;Date.now()<t;){if(!be(e))return!0;await S(100)}return!be(e)}function xn(e){let n=at("ps",["-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}),t=at("ps",["eww","-o","command=","-p",String(e)],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(n.status!==0||t.status!==0)return!1;let r=(n.stdout||"").trimEnd(),o=(t.stdout||"").trimEnd();return(o.startsWith(r)?o.slice(r.length):o).includes("SOOTSIM_PW_URL=")}async function he(e,n){let t=new Set(n),r=new Set;for(let o of e){if(!t.has(o.id))continue;let i=vn(o);i&&r.add(i)}for(let o of r){if(!xn(o)){console.log(` skipped pid ${o}: not a rnx playwright host (stale sim record)`);continue}try{process.kill(o,"SIGTERM")}catch{}if(await Sn(o)){console.log(` closed playwright host process ${o}`);continue}try{process.kill(o,"SIGKILL"),console.log(` force-closed playwright host process ${o}`)}catch{}}}function J(e,n){if(n){let o=n.trim(),i=e.find(s=>s.id===o);if(!i)throw new Error(`no sim connected with id ${o}`);return i}let t=e.find(o=>o.isPrimary&&o.readyState==="open");if(t)return t;let r=e.find(o=>o.readyState==="open");if(r)return r;throw new Error("no sim connected")}function ht(e,n,t,r=!1){let[o,i]=[e,n.url].map(s=>{if(!s)return s;try{let a=new URL(s);if(a.searchParams.has("sootsimConfig"))return a.searchParams.set("sootsimConfig","[redacted]"),a.toString()}catch{}return s});if(r){console.log(` Opened ConnectRN [${t}]`);return}console.log(` ${t==="current sim"?"loaded":"opened"}: ${o} [${t}]`),console.log(` current sim: ${n.id}`),console.log(JSON.stringify({simId:n.id,url:i},null,2))}async function wt(e,n,t){if(t.includes("--no-describe"))return;let r=process.env.SOOTSIM_QUIET_TARGET_NOTICE;process.env.SOOTSIM_QUIET_TARGET_NOTICE="1";try{await $n(e,n,{stableMs:150,maxMs:400});let o=P(e,{commandTimeoutMs:3e3,simId:n,cliLabel:"open --describe",simIdSource:"flag"});try{let i=null;try{i=await o.send({type:"evaluate",code:Ye})}catch{}if(i&&!(i.flag===!0&&!i.loadingText&&Ze(i))){let u=i.loadingText?`still showing "${i.loadingText}"`:i.flag!==!0?"guest ready event has not fired":i.targets<=0?"no visible app content is inspectable yet":"app tree is still stabilizing";console.log(` app still loading: ${u} (nodes: ${i.nodes}, targets: ${i.targets})`),console.log(" before interacting, run: rnx wait ready --max-ms 120000")}let a=`(async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.356 | (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-NPH2KUL6.js";import{M as u,l}from"./chunk-XJ2LMLUP.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.356 | (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-VSADIZVW.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};
|