rnxsim 0.1.375 → 0.1.377
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -25
- package/cli/app-config.ts +9 -12
- package/cli/app-fonts.ts +3 -3
- package/cli/app-project.ts +8 -8
- package/cli/auth.ts +7 -9
- package/cli/bin.ts +16 -31
- package/cli/bridge-flow-runner.ts +3 -3
- package/cli/browser-backend.ts +44 -0
- package/cli/command-contract.ts +221 -0
- package/cli/command-registry.ts +291 -0
- package/cli/commands/agent-wrapper.ts +2 -2
- package/cli/commands/app-fonts.ts +2 -2
- package/cli/commands/assert.ts +3 -3
- package/cli/commands/auth.ts +1 -1
- package/cli/commands/box/cloud-box.ts +1 -1
- package/cli/commands/box/plane-share.ts +2 -2
- package/cli/commands/box.ts +4 -6
- package/cli/commands/compat.ts +1 -1
- package/cli/commands/config.ts +2 -2
- package/cli/commands/control.ts +42 -28
- package/cli/commands/cpu-profile.ts +7 -7
- package/cli/commands/daemon-mac-app.ts +7 -7
- package/cli/commands/daemon.ts +10 -10
- package/cli/commands/debug.ts +11 -11
- package/cli/commands/detox.ts +13 -13
- package/cli/commands/diagnose.ts +6 -6
- package/cli/commands/do-chain.ts +1 -2
- package/cli/commands/electron.ts +1 -3
- package/cli/commands/film.ts +3 -3
- package/cli/commands/flow.ts +43 -43
- package/cli/commands/inspect/count.ts +1 -1
- package/cli/commands/inspect/describe.ts +1 -1
- package/cli/commands/inspect/env.ts +2 -2
- package/cli/commands/inspect/get-layout.ts +1 -1
- package/cli/commands/inspect/keyboard.ts +1 -1
- package/cli/commands/inspect/list.ts +1 -1
- package/cli/commands/inspect/memory.ts +1 -1
- package/cli/commands/inspect/resolve-target.ts +1 -1
- package/cli/commands/inspect/screens.ts +1 -1
- package/cli/commands/inspect/tree.ts +1 -1
- package/cli/commands/inspect/url.ts +1 -1
- package/cli/commands/inspect/wait-event.ts +5 -5
- package/cli/commands/inspect.ts +34 -34
- package/cli/commands/install-desktop.ts +3 -3
- package/cli/commands/login.ts +6 -6
- package/cli/commands/maestro-generate.ts +5 -5
- package/cli/commands/maestro.ts +5 -5
- package/cli/commands/profile.ts +1 -1
- package/cli/commands/record.ts +9 -9
- package/cli/commands/runtime.ts +18 -18
- package/cli/commands/screenshot-command.ts +1 -1
- package/cli/commands/screenshot-layers.ts +5 -5
- package/cli/commands/screenshot-mode.ts +1 -1
- package/cli/commands/screenshot.ts +8 -8
- package/cli/commands/screenshots-capture.ts +5 -5
- package/cli/commands/serve.ts +3 -3
- package/cli/commands/setup.ts +20 -12
- package/cli/commands/skills.ts +5 -5
- package/cli/commands/slides.ts +1 -1
- package/cli/commands/telemetry.ts +1 -1
- package/cli/commands/three-mode.ts +1 -1
- package/cli/commands/timeline.ts +8 -8
- package/cli/commands/upgrade.ts +116 -131
- package/cli/commands/upload.ts +12 -12
- package/cli/commands/version.ts +7 -7
- package/cli/commands/what-happened.ts +9 -9
- package/cli/current-sim.ts +3 -3
- package/cli/desktop-companion.ts +1 -1
- package/cli/drivers/playwright.ts +9 -9
- package/cli/drivers/registry.ts +1 -1
- package/cli/drivers/types.ts +1 -1
- package/cli/flow-file.ts +2 -2
- package/cli/flow-session.ts +1 -1
- package/cli/help-core.ts +136 -0
- package/cli/help.ts +17 -53
- package/cli/hints.ts +5 -5
- package/cli/inspect-notice-state.ts +1 -1
- package/cli/maestro-js.ts +1 -1
- package/cli/outbound-endpoints.ts +23 -5
- package/cli/parse-args.ts +19 -66
- package/cli/recording-access.ts +1 -1
- package/cli/registry.ts +1 -0
- package/cli/run-registry.ts +1 -1
- package/cli/run-rnx-core.ts +148 -0
- package/cli/run-rnx.ts +6 -9
- package/cli/runtime-notes.ts +3 -3
- package/cli/standalone.ts +4 -0
- package/cli/ws-bridge.ts +8 -8
- package/detox/config-loader.ts +2 -2
- package/detox/index.ts +8 -8
- package/detox/jest-preset.cjs +1 -1
- package/detox/navigation.ts +2 -2
- package/dist-lib/agent-daemon-client.cjs +5 -5
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +2 -2
- package/dist-lib/agent-sessions.cjs +10 -10
- package/dist-lib/attached-projects.cjs +6 -6
- package/dist-lib/auth/shared-session.cjs +6 -6
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +25 -25
- package/dist-lib/detox/index.cjs +9 -9
- package/dist-lib/detox/jest-preset.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +29 -29
- package/dist-lib/host/bridge-host.cjs +274 -181
- 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 +14 -14
- 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 +8 -8
- package/dist-lib/profiles.cjs +12 -12
- 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 +25 -11
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +470 -322
- package/dist-lib/vite.cjs +9 -9
- package/package.json +4 -11
- package/scripts/dev-server-scanner.ts +25 -7
- package/scripts/optional-demo-registry.ts +1 -1
- package/skills/contrast/SKILL.md +3 -3
- package/skills/rnx-debug/SKILL.md +1 -1
- package/skills/rnx-test/SKILL.md +2 -2
- package/src/agent-identity.ts +1 -1
- package/src/agent-sessions.ts +7 -5
- package/src/cli-version.ts +12 -4
- package/src/config.ts +26 -28
- package/src/disk-cleanup.ts +11 -11
- package/src/home-paths.ts +28 -28
- package/src/host/bridge-host.ts +16 -16
- package/src/metro-plugin.ts +2 -2
- package/src/profiles.ts +2 -2
- package/src/runtime-assets.ts +7 -7
- package/src/runtime-delivery.ts +13 -13
- package/src/screenshots/orchestrate.ts +1 -1
- package/src/screenshots/schema.ts +2 -2
- package/src/skills/builtin/a11y-review.ts +2 -2
- package/src/skills/builtin/compat-check.ts +2 -2
- package/src/skills/builtin/maestro-test.ts +2 -2
- package/src/skills/builtin/perf-profile.ts +2 -2
- package/src/skills/builtin/screenshot-all.ts +2 -2
- package/src/skills/builtin/visual-diff.ts +2 -2
- package/src/skills/registry.ts +8 -8
- package/src/skills/types.ts +1 -1
- package/src/vite-plugin-one.ts +3 -3
- package/src/vite-plugin.ts +15 -2
- package/dist-cli/bin.js +0 -15
- package/dist-cli/chunks/agent-JJN7U6FR.js +0 -48
- package/dist-cli/chunks/agent-wrapper-AVVUJ3WF.js +0 -17
- package/dist-cli/chunks/app-fonts-QJ22CNAZ.js +0 -4
- package/dist-cli/chunks/assert-PZZKIY3K.js +0 -49
- package/dist-cli/chunks/auth-5AVDJO33.js +0 -12
- package/dist-cli/chunks/beta-PFRGP266.js +0 -4
- package/dist-cli/chunks/box-ILC2O7ZO.js +0 -1730
- package/dist-cli/chunks/camera-J3V62PP7.js +0 -33
- package/dist-cli/chunks/chunk-25KRGDZT.js +0 -4
- package/dist-cli/chunks/chunk-2BRBFLWA.js +0 -38
- package/dist-cli/chunks/chunk-2GXNAZHB.js +0 -74
- package/dist-cli/chunks/chunk-2IUMRRYV.js +0 -7
- package/dist-cli/chunks/chunk-4ALPWIMP.js +0 -10
- package/dist-cli/chunks/chunk-4CEZZKRY.js +0 -4
- package/dist-cli/chunks/chunk-4EUKOIAV.js +0 -4
- package/dist-cli/chunks/chunk-4IKE4YUS.js +0 -32
- package/dist-cli/chunks/chunk-4ZXR2M3D.js +0 -4
- package/dist-cli/chunks/chunk-5CGJFU27.js +0 -7
- package/dist-cli/chunks/chunk-5HHWECGT.js +0 -4
- package/dist-cli/chunks/chunk-5PZVYF42.js +0 -312
- package/dist-cli/chunks/chunk-7NCPUZ52.js +0 -27
- package/dist-cli/chunks/chunk-7OSIJCBR.js +0 -107
- package/dist-cli/chunks/chunk-AQ5TMOAI.js +0 -4
- package/dist-cli/chunks/chunk-BQCEI37V.js +0 -5
- package/dist-cli/chunks/chunk-C6B5FOP3.js +0 -4
- package/dist-cli/chunks/chunk-CCMZSHJB.js +0 -71
- package/dist-cli/chunks/chunk-CX7VCKAT.js +0 -14
- package/dist-cli/chunks/chunk-DQUPSAHE.js +0 -4
- package/dist-cli/chunks/chunk-DSD2UBZI.js +0 -4
- package/dist-cli/chunks/chunk-EWPAI4MO.js +0 -7
- package/dist-cli/chunks/chunk-EZXV6U2N.js +0 -497
- package/dist-cli/chunks/chunk-F5F7FIPM.js +0 -6
- package/dist-cli/chunks/chunk-FUTYK55H.js +0 -30
- package/dist-cli/chunks/chunk-FW6AN7I2.js +0 -3
- package/dist-cli/chunks/chunk-FZDRA7Z4.js +0 -4
- package/dist-cli/chunks/chunk-GDLE4NIV.js +0 -4
- package/dist-cli/chunks/chunk-GEX7RVHY.js +0 -5
- package/dist-cli/chunks/chunk-H4MYYOYJ.js +0 -5
- package/dist-cli/chunks/chunk-HEV7BAPE.js +0 -11
- package/dist-cli/chunks/chunk-HNDWYCND.js +0 -506
- package/dist-cli/chunks/chunk-HNPHODBD.js +0 -4
- package/dist-cli/chunks/chunk-HWDVC6YA.js +0 -11
- package/dist-cli/chunks/chunk-JOHJZUGG.js +0 -4
- package/dist-cli/chunks/chunk-JWUDT4QK.js +0 -5
- package/dist-cli/chunks/chunk-K7QQWKGE.js +0 -4
- package/dist-cli/chunks/chunk-LAOKTKT4.js +0 -4
- package/dist-cli/chunks/chunk-LD7I266X.js +0 -24
- package/dist-cli/chunks/chunk-LMHBU5LZ.js +0 -4
- package/dist-cli/chunks/chunk-LSOGXSDV.js +0 -535
- package/dist-cli/chunks/chunk-MP2GPO4T.js +0 -4
- package/dist-cli/chunks/chunk-MXJ2UWRV.js +0 -4
- package/dist-cli/chunks/chunk-OJNKRIZF.js +0 -15
- package/dist-cli/chunks/chunk-PBOWUNXO.js +0 -4
- package/dist-cli/chunks/chunk-PNRJFHX4.js +0 -4
- package/dist-cli/chunks/chunk-QJQOK34O.js +0 -28
- package/dist-cli/chunks/chunk-RLCQLMFF.js +0 -142
- package/dist-cli/chunks/chunk-S65CK3RI.js +0 -9
- package/dist-cli/chunks/chunk-SWBUNMQS.js +0 -4
- package/dist-cli/chunks/chunk-SXBFGGAM.js +0 -4
- package/dist-cli/chunks/chunk-T4ISWS5H.js +0 -4
- package/dist-cli/chunks/chunk-TPPVAA7Z.js +0 -5
- package/dist-cli/chunks/chunk-USM3P74H.js +0 -4
- package/dist-cli/chunks/chunk-V4EJJHF5.js +0 -4
- package/dist-cli/chunks/chunk-V7RGRZOL.js +0 -423
- package/dist-cli/chunks/chunk-XUBV77WH.js +0 -130
- package/dist-cli/chunks/chunk-XYSDYGKC.js +0 -4
- package/dist-cli/chunks/chunk-YNHRSDVG.js +0 -5
- package/dist-cli/chunks/chunk-YX52RJKO.js +0 -4
- package/dist-cli/chunks/chunk-Z5O5H4O7.js +0 -99
- package/dist-cli/chunks/chunk-Z6LOIW46.js +0 -7
- package/dist-cli/chunks/chunk-ZXFVBYJY.js +0 -5
- package/dist-cli/chunks/cleanup-KPUW4SFK.js +0 -25
- package/dist-cli/chunks/cli-version-APGT6GAT.js +0 -4
- package/dist-cli/chunks/compat-XXRFD2TW.js +0 -23
- package/dist-cli/chunks/config-DDMFDQ7F.js +0 -13
- package/dist-cli/chunks/connect-IPG47YXM.js +0 -4
- package/dist-cli/chunks/control-O22Z3UJ5.js +0 -4
- package/dist-cli/chunks/daemon-PADUIMJV.js +0 -4
- package/dist-cli/chunks/debug-MYIP46TM.js +0 -200
- package/dist-cli/chunks/desktop-ENFFBQAA.js +0 -31
- package/dist-cli/chunks/detox-J5WVK6OH.js +0 -52
- package/dist-cli/chunks/device-RAVQVL75.js +0 -18
- package/dist-cli/chunks/diagnose-PJMPXKJY.js +0 -43
- package/dist-cli/chunks/disk-cleanup-YLAY445J.js +0 -4
- package/dist-cli/chunks/do-chain-UBE7GIOU.js +0 -5
- package/dist-cli/chunks/drivers-ZFNX3T5Z.js +0 -4
- package/dist-cli/chunks/env-Y5XJSNRD.js +0 -4
- package/dist-cli/chunks/film-W3V6VURB.js +0 -74
- package/dist-cli/chunks/flow-VMLI7BYM.js +0 -4
- package/dist-cli/chunks/help-PKZCWHJJ.js +0 -4
- package/dist-cli/chunks/hidden-runtime-alias-S5DJ7EDF.js +0 -4
- package/dist-cli/chunks/home-paths-5O4IZPYV.js +0 -4
- package/dist-cli/chunks/inspect-LT4MXK37.js +0 -4
- package/dist-cli/chunks/install-desktop-EXCFMXFS.js +0 -4
- package/dist-cli/chunks/login-V6TZ54ZH.js +0 -26
- package/dist-cli/chunks/logout-SPMLFWYA.js +0 -4
- package/dist-cli/chunks/maestro-5ISTBAZE.js +0 -108
- package/dist-cli/chunks/maestro-generate-WUI64NHR.js +0 -36
- package/dist-cli/chunks/mode-QPNBYXUF.js +0 -26
- package/dist-cli/chunks/optional-demo-registry-CBSYF4CG.js +0 -4
- package/dist-cli/chunks/perf-T6N5PVYV.js +0 -48
- package/dist-cli/chunks/permissions-YZ7RRSZJ.js +0 -13
- package/dist-cli/chunks/platform-XDQAA72X.js +0 -6
- package/dist-cli/chunks/privacy-54FIGXLT.js +0 -4
- package/dist-cli/chunks/record-QGYXRUKP.js +0 -72
- package/dist-cli/chunks/report-issue-VUUTGX7V.js +0 -29
- package/dist-cli/chunks/reset-CGO52KBW.js +0 -4
- package/dist-cli/chunks/resolve-target-NNQCALDM.js +0 -4
- package/dist-cli/chunks/runtime-4EP6YJVL.js +0 -4
- package/dist-cli/chunks/screenshot-command-NZCMSJ4P.js +0 -159
- package/dist-cli/chunks/screenshot-layers-VMTQ6XIU.js +0 -20
- package/dist-cli/chunks/screenshots-capture-K3MWIDBK.js +0 -42
- package/dist-cli/chunks/serve-QJRIB2BV.js +0 -56
- package/dist-cli/chunks/setup-6XXEJQVF.js +0 -4
- package/dist-cli/chunks/sim-client-5YUVL45C.js +0 -4
- package/dist-cli/chunks/skills-T3CS7CXK.js +0 -50
- package/dist-cli/chunks/state-AJC3VK3G.js +0 -14
- package/dist-cli/chunks/storage-KVGZKC3Y.js +0 -37
- package/dist-cli/chunks/store-AWUMOQUH.js +0 -4
- package/dist-cli/chunks/telemetry-W5ZDGWK6.js +0 -4
- package/dist-cli/chunks/timeline-DXDCAZUA.js +0 -24
- package/dist-cli/chunks/upgrade-SRPTJACU.js +0 -7
- package/dist-cli/chunks/upload-ZDV4BFED.js +0 -4
- package/dist-cli/chunks/version-SOLPSBMG.js +0 -6
- package/dist-cli/chunks/web-RT75LD7A.js +0 -4
- package/dist-cli/chunks/welcome-IJ55EC7U.js +0 -5
- package/dist-cli/chunks/what-happened-CEIWJIWK.js +0 -25
- package/dist-cli/chunks/ws-bridge-YK5R3HOI.js +0 -4
- package/scripts/postinstall.cjs +0 -3
- package/scripts/preuninstall.cjs +0 -118
package/src/vite-plugin.ts
CHANGED
|
@@ -748,7 +748,15 @@ const viteBridgeProcesses = (globalThis.__sootsimViteBridgeProcesses ??= new Map
|
|
|
748
748
|
// start WS bridge server for debug CLI connectivity. exported so shell
|
|
749
749
|
// vite can install it standalone (engine builds via `vite build --watch`,
|
|
750
750
|
// which doesn't fire configureServer — the bridge has to run on shell).
|
|
751
|
-
export function wsBridgePlugin(): Plugin {
|
|
751
|
+
export function wsBridgePlugin(options: { ownedBridgePort?: number } = {}): Plugin {
|
|
752
|
+
if (
|
|
753
|
+
options.ownedBridgePort !== undefined &&
|
|
754
|
+
(!Number.isInteger(options.ownedBridgePort) ||
|
|
755
|
+
options.ownedBridgePort <= 0 ||
|
|
756
|
+
options.ownedBridgePort > 65_535)
|
|
757
|
+
) {
|
|
758
|
+
throw new Error(`invalid externally owned bridge port: ${options.ownedBridgePort}`)
|
|
759
|
+
}
|
|
752
760
|
const owner = {}
|
|
753
761
|
// the port the bridge ACTUALLY bound, which is not necessarily the one it
|
|
754
762
|
// asked for: the host scans forward from its preferred port on EADDRINUSE.
|
|
@@ -756,7 +764,12 @@ export function wsBridgePlugin(): Plugin {
|
|
|
756
764
|
// the shell's http port instead, any box where 7668 was already taken sent
|
|
757
765
|
// the page dialing a port nobody listens on, and the only symptom was a
|
|
758
766
|
// websocket console error during boot.
|
|
759
|
-
|
|
767
|
+
// a parent that already owns a bridge supplies its receipt here. the shell
|
|
768
|
+
// publishes that exact port and never starts a competing development bridge.
|
|
769
|
+
let boundPort: Promise<number | null> | null =
|
|
770
|
+
options.ownedBridgePort === undefined
|
|
771
|
+
? null
|
|
772
|
+
: Promise.resolve(options.ownedBridgePort)
|
|
760
773
|
return {
|
|
761
774
|
name: 'sootsim-ws-bridge',
|
|
762
775
|
apply: 'serve',
|
package/dist-cli/bin.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/*! rnx v0.1.375 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
4
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
5
|
-
import{a as g,b as f}from"./chunks/chunk-4CEZZKRY.js";import{a as h}from"./chunks/chunk-T4ISWS5H.js";import{a as m}from"./chunks/chunk-25KRGDZT.js";import"./chunks/chunk-DQUPSAHE.js";function k(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
|
-
`),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
|
|
7
|
-
`):process.stderr.write(`${t}
|
|
8
|
-
`),process.exit(1)}process.on("unhandledRejection",k);process.on("uncaughtException",k);var v=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,C=new Set(["desktop"]);function $(a){!v||!C.has(a)||(process.stderr.write(` ${m.commandName} ${a} isn't available in the standalone binary \u2014
|
|
9
|
-
it needs vite / electron / playwright from a project's node_modules.
|
|
10
|
-
run the npm package instead:
|
|
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-S5DJ7EDF.js");e=a(e)}var _=e.command==="cleanup"&&e.commandArgs.length===1&&e.commandArgs[0]==="--automatic-worker",x=!e.command&&e.commandArgs.length===0;if(!_&&!x&&!e.help&&!e.version&&e.command!=="config"&&e.command!=="setup"&&e.command!=="telemetry"){let{ensurePrivacyChoice:a}=await import("./chunks/privacy-54FIGXLT.js");await a({prompt:!0})}if(e.command!=="serve"&&e.command!=="daemon"){let{consumeRuntimeUpgradeNotice:a}=await import("./chunks/home-paths-5O4IZPYV.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 b=!1;async function S(){if(!b&&(b=!0,!(e.command==="cleanup"||e.command==="serve"||e.command==="agent-wrapper"||e.command==="daemon"&&e.commandArgs[0]==="uninstall")))try{let{shouldSkipAutomaticSootsimCleanup:a}=await import("./chunks/disk-cleanup-YLAY445J.js");if(a())return;let{spawn:t}=await import("node:child_process"),r=["cleanup","--automatic-worker"],d=process.argv[1],p=v?t(process.execPath,r,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):d?t(process.execPath,[d,...r],{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env}):t(m.commandName,r,{detached:!0,stdio:["ignore","ignore","inherit"],env:process.env});p.once("error",w=>{process.stderr.write(` ${m.name} automatic cleanup will retry on the next run: ${w.message}
|
|
14
|
-
`)}),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 n(a){let{flushCliTelemetry:t}=await import("./chunks/telemetry-W5ZDGWK6.js");await t(),await S(),process.exit(a)}if(e.version){let{getCliVersion:a}=await import("./chunks/cli-version-APGT6GAT.js"),{IS_BETA:t,BETA_LABEL:r}=await import("./chunks/beta-PFRGP266.js"),d=t?` \xB7 ${r}`:"";console.log(`${m.commandName} v${a()}${d}`);let{readActiveRuntime:p}=await import("./chunks/home-paths-5O4IZPYV.js"),w=p();console.log(w?`runtime v${w}`:"runtime not installed"),await n(0)}if(e.help&&!e.command){let{printHelp:a}=await import("./chunks/help-PKZCWHJJ.js");a(),await n(0)}var o=e.globalFlags.port,c=e.verbose,u=e.globalFlags.device,l=e.globalFlags.theme,E=e.globalFlags.driver,O=e.globalFlags.headless===!0,A=e.globalFlags.sim??e.globalFlags.session??e.globalFlags.tab,i=A?["--sim",A,...e.commandArgs]:e.commandArgs;if(u||l){let{settingsStore:a}=await import("./chunks/store-AWUMOQUH.js"),t={};u&&(t.deviceModel=u),l&&(t.colorScheme=l),a.apply(t)}if(!e.command&&e.commandArgs.length===0){let{runWelcome:a}=await import("./chunks/welcome-IJ55EC7U.js");await n(await a())}var s=e.command??"";if(!s){if(e.commandArgs.length>0){let t=e.commandArgs.find(r=>!r.startsWith("-"))??e.commandArgs[0];console.error(` unknown command: ${t}`),console.error(` run \`${m.commandName} --help\` to see the full surface.`),await n(1)}let{printHelp:a}=await import("./chunks/help-PKZCWHJJ.js");a(),await n(0)}if(e.help||e.commandArgs.includes("--help")||e.commandArgs.includes("-h")){if(s==="skill"){let{runSkill:r}=await import("./chunks/skills-T3CS7CXK.js");await r(e.commandArgs),await n(0)}if(s==="state"){let{runState:r}=await import("./chunks/state-AJC3VK3G.js");await n(await r(i,{port:o}))}if(s==="reset"){let{runReset:r}=await import("./chunks/reset-CGO52KBW.js");await n(await r(i,{port:o}))}let a=s==="do"||s==="get"||s==="debug"||s==="shell"||s==="perf"||s==="wait",t=e.commandArgs.find(r=>!r.startsWith("-"));if(!(s==="shell"||s==="perf"))if(a&&!t){let{printGroupHelp:r}=await import("./chunks/help-PKZCWHJJ.js");r(s)&&await n(0)}else{let{printCommandHelp:r}=await import("./chunks/help-PKZCWHJJ.js");r(a&&t?t:s,{prefer:a&&t?"verb":"command",group:a&&t?s:void 0}),await n(0)}}$(s);try{if(g.has(s)){if(s==="do"){let{hasDoChain:t,runDoChain:r}=await import("./chunks/do-chain-UBE7GIOU.js");t(i)&&await n(await r(i,{port:o}))}let{runInspect:a}=await import("./chunks/inspect-LT4MXK37.js");await a([s,...i],{port:o,verbose:c})}else switch(s){case"assert":{let{runAssert:a}=await import("./chunks/assert-PZZKIY3K.js");await a(e.commandArgs);break}case"detox":{let{runDetox:a}=await import("./chunks/detox-J5WVK6OH.js");await a(e.commandArgs,{port:o,verbose:c});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-5ISTBAZE.js"),t=await a(i,{port:o,verbose:c});await n(typeof t=="number"?t:0)}case"record":{let{runRecord:a}=await import("./chunks/record-QGYXRUKP.js");await a(i,{port:o,verbose:c});break}case"film":{let{runFilm:a}=await import("./chunks/film-W3V6VURB.js"),t=await a(i,{port:o,verbose:c});await n(typeof t=="number"?t:0)}case"storage":{let{runStorage:a}=await import("./chunks/storage-KVGZKC3Y.js"),t=await a(i,{port:o,verbose:c});await n(typeof t=="number"?t:0)}case"state":{let{runState:a}=await import("./chunks/state-AJC3VK3G.js"),t=await a(i,{port:o});await n(t)}case"reset":{let{runReset:a}=await import("./chunks/reset-CGO52KBW.js"),t=await a(i,{port:o});await n(t)}case"perf":{let{runPerf:a}=await import("./chunks/perf-T6N5PVYV.js"),t=await a(i,{port:o,verbose:c});await n(typeof t=="number"?t:0)}case"screenshot":{let{runScreenshotCommand:a}=await import("./chunks/screenshot-command-NZCMSJ4P.js"),t=await a(i,{port:o,verbose:c});await n(typeof t=="number"?t:0)}case"camera":{let{runCamera:a}=await import("./chunks/camera-J3V62PP7.js"),t=await a(i,{port:o});await n(typeof t=="number"?t:0)}case"mode":{let{runMode:a}=await import("./chunks/mode-QPNBYXUF.js");await a(i,{port:o,verbose:c});break}case"permissions":{let{runPermissions:a}=await import("./chunks/permissions-YZ7RRSZJ.js"),t=await a(i,{port:o,verbose:c});await n(t)}case"debug":{let{runDebug:a}=await import("./chunks/debug-MYIP46TM.js");await a(i,{port:o,verbose:c});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-DXDCAZUA.js");await a(i,{port:o,verbose:c});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-CEIWJIWK.js");await a(i,{port:o,verbose:c});break}case"open":{let{runOpenCommand:a}=await import("./chunks/control-O22Z3UJ5.js");await a(i,{port:o});break}case"ios":case"android":{let{runPlatformCommand:a}=await import("./chunks/platform-XDQAA72X.js"),t=await a(s,i,{port:o});await n(typeof t=="number"?t:0)}case"box":{let{runBox:a}=await import("./chunks/box-ILC2O7ZO.js");await n(await a(i,{port:o,verbose:c}))}case"use":{let{runUseCommand:a}=await import("./chunks/control-O22Z3UJ5.js");await a(i,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-O22Z3UJ5.js");await a(i,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-O22Z3UJ5.js");await a(i,{port:o});break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-RAVQVL75.js");await a(i,{port:o});break}case"compat":{let{runCompat:a}=await import("./chunks/compat-XXRFD2TW.js");await a(e.commandArgs);break}case"report-issue":{let{runReportIssue:a}=await import("./chunks/report-issue-VUUTGX7V.js"),t=await a(e.commandArgs);await n(t)}case"desktop":{let{runDesktop:a}=await import("./chunks/desktop-ENFFBQAA.js");await a(e.commandArgs,{port:o,device:u});break}case"login":{let{runLogin:a}=await import("./chunks/login-V6TZ54ZH.js");await a(e.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-SPMLFWYA.js");await a();break}case"auth":{let{runAuth:a}=await import("./chunks/auth-5AVDJO33.js");await a(e.commandArgs);break}case"setup":{let{runSetup:a}=await import("./chunks/setup-6XXEJQVF.js");await a(e.commandArgs);break}case"serve":{let{runServe:a}=await import("./chunks/serve-QJRIB2BV.js");await a(e.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-PADUIMJV.js");await a(e.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-4EP6YJVL.js");await a(e.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-SRPTJACU.js");await a(e.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-SOLPSBMG.js");await a(e.commandArgs);break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-JJN7U6FR.js"),t=await a(e.commandArgs);await n(t)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-AVVUJ3WF.js"),t=await a(e.commandArgs);await n(t)}case"skill":{let{runSkill:a}=await import("./chunks/skills-T3CS7CXK.js");await a(e.commandArgs);break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-QJ22CNAZ.js");await a(e.commandArgs);break}case"config":{let{runConfig:a}=await import("./chunks/config-DDMFDQ7F.js");await a(e.commandArgs);break}case"cleanup":{let{runCleanup:a}=await import("./chunks/cleanup-KPUW4SFK.js"),t=await a(e.commandArgs);await n(t)}default:console.error(` unknown command: ${s}`),console.error(` run \`${m.commandName} --help\` to see the full surface.`),await n(1)}}catch(a){throw a instanceof h&&await n(a.code),a}await S();
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.375 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as 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-5CGJFU27.js";import"./chunk-GDLE4NIV.js";import{c as $}from"./chunk-4ALPWIMP.js";import"./chunk-HNPHODBD.js";import"./chunk-ZXFVBYJY.js";import"./chunk-AQ5TMOAI.js";import"./chunk-TPPVAA7Z.js";import"./chunk-H4MYYOYJ.js";import"./chunk-7NCPUZ52.js";import"./chunk-GEX7RVHY.js";import"./chunk-XUBV77WH.js";import{j as y}from"./chunk-HWDVC6YA.js";import"./chunk-4EUKOIAV.js";import"./chunk-25KRGDZT.js";import"./chunk-DQUPSAHE.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
|
-
`),L(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
|
|
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
|
-
`),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
|
|
8
|
-
`),1;let o=A({cwd:s,name:e["--name"]||d.basename(s),preferredProvider:U(e["--provider"]),sourceRoots:[s]});return process.stdout.write(`\u2713 attached "${o.name}" (id: ${o.id})
|
|
9
|
-
cwd: ${o.cwd}
|
|
10
|
-
framework: ${o.framework}
|
|
11
|
-
preferred provider: ${o.preferredProvider}
|
|
12
|
-
`),0}async function J(){let n=[...S()].sort((t,r)=>r.updatedAt-t.updatedAt);if(n.length===0)return process.stdout.write("no attached projects yet. try `rnx agent attach <dir>`.\n"),0;let e=`${"ID".padEnd(18)} ${"NAME".padEnd(20)} ${"FRAMEWORK".padEnd(10)} ${"PROVIDER".padEnd(8)} ${"7D COST".padEnd(10)} CWD
|
|
13
|
-
`;process.stdout.write(e);for(let t of n){let r=x(t),s=r>0?`$${r.toFixed(2)}`:"\u2014";process.stdout.write(`${t.id.padEnd(18)} ${p(t.name,20).padEnd(20)} ${t.framework.padEnd(10)} ${t.preferredProvider.padEnd(8)} ${s.padEnd(10)} ${t.cwd}
|
|
14
|
-
`)}return 0}async function V(n){let[e,t]=n;if(e==="show"){if(!t)return process.stderr.write(`usage: rnx agent project show <id>
|
|
15
|
-
`),2;let r=l(t);return r?(process.stdout.write(JSON.stringify(r,null,2)+`
|
|
16
|
-
`),0):(process.stderr.write(`no project with id=${t}
|
|
17
|
-
`),1)}return e==="remove"?t?(j(t),process.stdout.write(`\u2713 removed project ${t}
|
|
18
|
-
`),0):(process.stderr.write(`usage: rnx agent project remove <id>
|
|
19
|
-
`),2):(process.stderr.write(`usage: rnx agent project [show|remove] <id>
|
|
20
|
-
`),2)}async function H(n){let{flags:e}=P(n,{"--project":"value","--all":"bool"}),t=e["--project"]||void 0,r=e["--all"]===!0,s=T(t);if(r||(s=s.filter(i=>i.status!=="ended")),s=s.sort((i,a)=>a.lastSeenAt-i.lastSeenAt),s.length===0)return process.stdout.write(r?`no sessions.
|
|
21
|
-
`:`no active sessions. pass --all to include ended.
|
|
22
|
-
`),0;let o=`${"SESSION".padEnd(26)} ${"PROJECT".padEnd(18)} ${"PROVIDER".padEnd(8)} ${"STATUS".padEnd(16)} ${"ALIVE".padEnd(5)} LAST PROMPT
|
|
23
|
-
`;process.stdout.write(o);for(let i of s){let a=O(i.wrapperPid,i.id)?"yes":"no",m=i.lastPrompt?p(i.lastPrompt,40):"";process.stdout.write(`${N(i.id).padEnd(26)} ${N(i.projectId).padEnd(18)} ${i.provider.padEnd(8)} ${i.status.padEnd(16)} ${a.padEnd(5)} ${m}
|
|
24
|
-
`)}return 0}async function G(n){let{flags:e,positional:t}=P(n,{"--provider":"value","--codex-bin":"value","--claude-bin":"value","--fresh-thread":"bool"}),r=t[0];if(!r)return process.stderr.write(`usage: rnx agent start <projectId> [--provider codex|claude] [--fresh-thread]
|
|
25
|
-
`),2;let s=await v(i=>i.startSession({projectId:r,provider:U(e["--provider"],void 0)||void 0,codexBin:e["--codex-bin"]||void 0,claudeBin:e["--claude-bin"]||void 0,freshThread:e["--fresh-thread"]===!0})),o=l(s.session.projectId);return process.stdout.write(`\u2713 session ${s.session.id} started
|
|
26
|
-
project: ${o.name} (${o.id})
|
|
27
|
-
provider: ${s.session.provider}
|
|
28
|
-
pid: ${s.wrapperPid}
|
|
29
|
-
prompt with: rnx agent prompt ${s.session.id} "<text>"
|
|
30
|
-
watch events: rnx agent watch ${s.session.id}
|
|
31
|
-
`),0}async function q(n){let[e,...t]=n,r=t.join(" ");return!e||!r?(process.stderr.write(`usage: rnx agent prompt <sessionId> "<text>"
|
|
32
|
-
`),2):(await v(s=>s.sendPrompt(e,{text:r})),process.stdout.write(`\u2713 prompt sent to ${e}
|
|
33
|
-
`),0)}async function K(n){let e=n[0];if(!e)return process.stderr.write(`usage: rnx agent watch <sessionId>
|
|
34
|
-
`),2;process.stdout.write(`watching ${e}
|
|
35
|
-
---
|
|
36
|
-
`);let t=await h({clientLabel:"sootsim-agent-watch"}),r,s=new Promise(a=>{r=a}),o=t.onAgentEvent(({sessionId:a,event:m})=>{a===e&&process.stdout.write(X(m)+`
|
|
37
|
-
`)}),i=t.onDisconnect(()=>{process.stderr.write(`
|
|
38
|
-
[rnx] daemon disconnected; exiting watch.
|
|
39
|
-
`),r(1)});try{await t.subscribeEvents(e)}catch(a){throw o(),i(),t.close(),a}return process.on("SIGINT",()=>{o(),i(),t.unsubscribeEvents(e).catch(()=>{}),t.close(),r(130)}),s}function X(n){let e=Z(n.ts);switch(n.type){case"ready":return`[${e}] ready ${n.provider} @ ${n.cwd}`;case"prompt-received":return`[${e}] prompt "${p(n.text,120)}"`;case"turn-started":return`[${e}] turn-started ${n.turnId??""}`;case"turn-message":return`[${e}] turn-message ${n.delta.replace(/\s+$/,"")}`;case"turn-reasoning":return`[${e}] turn-reasoning ${p(n.delta,200)}`;case"tool-call":return`[${e}] tool-call ${n.name}`;case"file-edited":return`[${e}] file-edited ${n.kind.padEnd(6)} ${n.path}`;case"turn-completed":return`[${e}] turn-completed ${n.durationMs}ms files=${n.filesTouched.length}`;case"approval-needed":return`[${e}] approval ${n.kind}`;case"error":return`[${e}] error ${n.message}`;case"exited":return`[${e}] exited code=${n.code}`;case"file-diff-delta":return`[${e}] file-diff-delta ${n.path}`;case"turn-plan":return`[${e}] turn-plan steps=${n.steps.length}`;default:return`[${e}] ${n.type}`}}async function z(n){let e=n[0];if(!e)return process.stderr.write(`usage: rnx agent transcript <sessionId>
|
|
40
|
-
`),2;let t=g(e);return w.existsSync(t)?(process.stdout.write(w.readFileSync(t,"utf8")),0):(process.stderr.write(`transcript not found: ${t}
|
|
41
|
-
`),1)}async function Q(n){let e=n[0];return e?(await v(t=>t.endSession(e)),process.stdout.write(`\u2713 ended session ${e}
|
|
42
|
-
`),0):(process.stderr.write(`usage: rnx agent end <sessionId>
|
|
43
|
-
`),2)}async function Y(){let n=E();return process.stdout.write(`userData: ${n}
|
|
44
|
-
state: ${d.join(n,"attached-projects.json")}
|
|
45
|
-
sessions: ${d.join(n,"sessions")}
|
|
46
|
-
transcripts: ${d.join(n,"transcripts")}
|
|
47
|
-
locks: ${d.join(n,"locks")}
|
|
48
|
-
`),0}function p(n,e){return n.length<=e?n:n.slice(0,e-1)+"\u2026"}function N(n){return n.length>14?`${n.slice(0,14)}\u2026`:n}function Z(n){return new Date(n).toISOString().replace("T"," ").slice(0,19)}var fe={sessionDir:I,promptFifoPath:k,eventsFifoPath:D,transcriptPath:g,parseAgentEventLine:b};export{fe as __internals,ge as runAgentCommand};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.375 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{b as M}from"./chunk-GDLE4NIV.js";import"./chunk-DQUPSAHE.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
|
-
`)}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
|
-
--provider codex|claude --cwd <path>
|
|
7
|
-
--prompt-in <fifo> --events-out <fifo>
|
|
8
|
-
[--transcript <file>]
|
|
9
|
-
[--codex-bin <path>] [--claude-bin <path>]
|
|
10
|
-
`),2;if(t.provider!=="codex"&&t.provider!=="claude")return process.stderr.write(`unknown provider: ${t.provider}
|
|
11
|
-
`),2;let{sessionId:r,projectId:m,cwd:u,promptIn:f,eventsOut:a}=t,c=t.provider;if(!C(a))return process.stderr.write(`events-out FIFO missing: ${a}
|
|
12
|
-
`),3;if(!C(f))return process.stderr.write(`prompt-in FIFO missing: ${f}
|
|
13
|
-
`),3;let n=J(a,R.O_RDWR|R.O_APPEND),s=j(a,{fd:n,flags:"a"});function o(i){let g=JSON.stringify({ts:Date.now(),...i})+`
|
|
14
|
-
`;s.write(g)}let e=null;if(t.transcript)try{await V.mkdir(z.dirname(t.transcript),{recursive:!0}),e=j(t.transcript,{flags:"a"})}catch(i){o({type:"error",message:`transcript open failed: ${i.message}`})}s.on("error",i=>{let g=`[events-out] stream error: ${i.message}
|
|
15
|
-
`;try{e?e.write(g):process.stderr.write(g)}catch{}});let p=await ne(c,c==="codex"?t.codexBin:t.claudeBin);if(!p.ok)return o({type:"error",message:p.message}),await new Promise(i=>setTimeout(i,50)),s.end(),4;let y=p.path,l=null,x=null;if(c==="codex")try{l=W({bin:y,cwd:u,env:{SOOTSIM_CLI_IDENTITY:r,SOOTSIM_PROJECT_ID:m}}),l.on("__stderr__",i=>{let g=i?.text;g&&e?.write(`[codex-stderr] ${g}`)}),l.exited.then(({code:i,signal:g})=>{v||(o({type:"error",message:`codex app-server exited (code=${i}, signal=${g??""})`}),w(5))}),await ce((async()=>{await l.request("initialize",{clientInfo:{name:"sootsim",title:null,version:"0.1.0"},capabilities:null}),x=await ie(l,u,{fresh:t.freshThread===!0})})(),3e4,"codex app-server boot timed out after 30s")}catch(i){let g=i instanceof Error?i.message:String(i);o({type:"error",message:`codex app-server init failed: ${g}`});try{l?.kill()}catch{}return s.end(),4}o({type:"ready",sessionId:r,projectId:m,provider:c,cwd:u});let T=!1,I=null,S=[],{promise:h,resolve:E}=$(),v=!1;function w(i,g=!0){if(!v){v=!0,clearInterval(P);try{I?.kill("SIGTERM")}catch{}try{l?.shutdown(800)}catch{}g&&o({type:"exited",code:i}),s.end(()=>{try{e?.end()}catch{}E(i)}),setTimeout(()=>E(i),1500).unref()}}let _=(()=>{let i=Number(process.env.SOOTSIM_WRAPPER_WATCHDOG_MS);return Number.isFinite(i)&&i>0?i:1e4})(),P=setInterval(()=>{if(v)return;let i=C(a),g=C(f);(!i||!g)&&(process.stderr.write(`[wrapper] session fifos gone (eventsOut=${i} promptIn=${g}), exiting
|
|
16
|
-
`),w(0,i))},_);P.unref(),process.on("SIGTERM",()=>w(143)),process.on("SIGINT",()=>w(130)),process.on("SIGHUP",()=>w(129)),process.on("uncaughtException",i=>{o({type:"error",message:`uncaught: ${i.message}`}),w(1)});let B=c==="codex"&&l?oe({client:l,getThreadId:()=>x,setThreadId:i=>x=i,emit:o,transcript:e,onTurnSettled:()=>{T=!1;let i=S.shift();i&&k(i)}}):de({resolvedBin:y,sessionId:r,projectId:m,claudeSessionUuid:t.claudeSessionUuid??X(),cwd:u,emit:o,transcript:e,setChild:i=>I=i,onTurnSettled:()=>{T=!1;let i=S.shift();i&&k(i)}});async function k(i){T=!0;try{await B(i)}catch(g){o({type:"error",message:`turn failed: ${g.message}`}),T=!1;let A=S.shift();A&&k(A)}}let U=J(f,R.O_RDWR),N=Y("",{fd:U,autoClose:!1});return K.createInterface({input:N,crlfDelay:1/0}).on("line",i=>{let g=M(i);if(!g)return;let A=g.text;if(o({type:"prompt-received",text:g.displayText??A,...g.inspectSummary?{inspectSummary:g.inspectSummary}:{},...g.inspectTrace?{inspectTrace:g.inspectTrace}:{}}),T){S.push(A);return}k(A)}),N.on("error",i=>{o({type:"error",message:`prompt-in read failed: ${i.message}`})}),h}function se(d){return d?.threadId??d?.thread?.id??null}async function ie(d,t,r={}){if(!r.fresh)try{let a=(await d.request("thread/list",{cwd:t,limit:1,archived:!1}))?.threads?.[0]?.id;if(a)try{return await d.request("thread/resume",{threadId:a,persistExtendedHistory:!1,approvalPolicy:O,sandbox:F,serviceTier:D}),a}catch{}}catch{}let m=await d.request("thread/start",{cwd:t,experimentalRawEvents:!1,persistExtendedHistory:!1,approvalPolicy:O,sandbox:F,serviceTier:D}),u=se(m);if(!u)throw new Error("thread/start returned no threadId");return u}function oe(d){let{client:t,emit:r,transcript:m}=d,u=new Map,f=null;return t.on("turn/started",a=>{let n=a?.turn?.id;if(!n)return;f=n;let s=u.get(n)??{started:Date.now(),resolve:()=>{},filesTouched:new Set,pendingEmit:""};u.has(n)||u.set(n,s),r({type:"turn-started",turnId:n})}),t.on("item/agentMessage/delta",a=>{let c=a;c?.delta&&(m?.write(c.delta),r({type:"turn-message",delta:c.delta}))}),t.on("item/reasoning/textDelta",a=>{let c=a;c?.delta&&r({type:"turn-reasoning",delta:c.delta})}),t.on("item/reasoning/summaryTextDelta",a=>{let c=a;c?.delta&&r({type:"turn-reasoning",delta:c.delta})}),t.on("turn/plan/updated",a=>{let c=a;Array.isArray(c?.plan)&&r({type:"turn-plan",steps:c.plan.map((n,s)=>({id:String(s),title:n.step,status:n.status}))})}),t.on("item/started",a=>{let n=a?.item;n&&(n.type==="commandExecution"&&n.command?r({type:"tool-call",name:"commandExecution",args:{command:n.command}}):(n.type==="mcpToolCall"||n.type==="dynamicToolCall")&&r({type:"tool-call",name:n.tool??n.type,args:{}}))}),t.on("item/completed",a=>{let c=a,n=c?.item;if(!n||n.type!=="fileChange"||n.status!=="completed"||!Array.isArray(n.changes))return;let s=c?.turnId,o=s?u.get(s):null;for(let e of n.changes){let p=e.kind?.type,y=p==="add"?"add":p==="delete"?"delete":"modify";r({type:"file-edited",path:e.path,kind:y,diff:e.diff}),o?.filesTouched.add(e.path);let l=e.kind?.move_path;l&&l!==e.path&&o?.filesTouched.add(l)}}),t.on("turn/completed",a=>{let c=a,n=c?.turn?.id;if(!n)return;let s=u.get(n),o=s?Array.from(s.filesTouched):[],e=c.turn?.durationMs??(s?Date.now()-s.started:0);r({type:"turn-completed",turnId:n,filesTouched:o,durationMs:e}),s?.resolve(),u.delete(n)}),t.on("error",a=>{let c=a,n=c?.error?.message??"codex reported an error";r({type:"error",message:n}),c.turnId&&(u.get(c.turnId)?.resolve(),u.delete(c.turnId))}),async function(c){let n=d.getThreadId();if(!n){r({type:"error",message:"no active codex thread"}),d.onTurnSettled();return}let{promise:s,resolve:o}=$(),e=`pending-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;u.set(e,{started:Date.now(),resolve:o,filesTouched:new Set,pendingEmit:""});try{let l=(await t.request("turn/start",{threadId:n,input:[{type:"text",text:c,text_elements:[]}],approvalPolicy:O,sandboxPolicy:Z,serviceTier:D,effort:ee}))?.turn?.id??f;if(l&&l!==e){let x=u.get(e);if(x){u.delete(e);let T=u.get(l);if(T){for(let I of x.filesTouched)T.filesTouched.add(I);T.resolve=x.resolve}else u.set(l,x)}}}catch(y){u.delete(e);let l=y instanceof Error?y.message:String(y);r({type:"error",message:`turn/start failed: ${l}`}),r({type:"turn-completed",filesTouched:[],durationMs:0}),d.onTurnSettled();return}let p=setTimeout(()=>o(),600*1e3).unref();try{await s}finally{clearTimeout(p),d.onTurnSettled()}}}var ae=new Set(["Edit","Write","MultiEdit","NotebookEdit"]);function de(d){return async function(r){let{resolvedBin:m,sessionId:u,projectId:f,claudeSessionUuid:a,cwd:c,emit:n,transcript:s,setChild:o}=d,e=Date.now();n({type:"turn-started"});let p=q(m,["--print","--output-format","stream-json","--verbose","--permission-mode","bypassPermissions","--session-id",a,r],{cwd:c,stdio:["ignore","pipe","pipe"],env:{...process.env,SOOTSIM_CLI_IDENTITY:u,SOOTSIM_PROJECT_ID:f}});o(p);let y=new Set,l=!1;function x(h){let E=h.type;if(E){if(E==="assistant"&&Array.isArray(h.message?.content)){for(let v of h.message.content)if(v.type==="text"&&v.text)s?.write(v.text),n({type:"turn-message",delta:v.text});else if(v.type==="tool_use"&&v.name){n({type:"tool-call",name:v.name,args:v.input??{}});let w=v.input?.file_path??v.input?.path;typeof w=="string"&&ae.has(v.name)&&(y.add(w),n({type:"file-edited",path:w,kind:"modify"}))}}else if(E==="result"){if(l=!0,Array.isArray(h.permission_denials))for(let v of h.permission_denials)n({type:"approval-needed",kind:v.tool_name??"unknown",detail:v.tool_input??null});h.is_error&&typeof h.result=="string"&&n({type:"error",message:h.result}),n({type:"turn-completed",filesTouched:Array.from(y),durationMs:h.duration_ms??Date.now()-e,costUsd:h.is_error?void 0:h.total_cost_usd})}}}let T="";p.stdout?.setEncoding("utf8"),p.stdout?.on("data",h=>{T+=h;let E;for(;(E=T.indexOf(`
|
|
17
|
-
`))>=0;){let v=T.slice(0,E);T=T.slice(E+1);let w=v.trim();if(!w)continue;let _;try{_=JSON.parse(w)}catch{continue}try{x(_)}catch(P){n({type:"error",message:`claude event handler failed: ${P.message}`})}}}),p.stderr?.setEncoding("utf8"),p.stderr?.on("data",h=>{s?.write(`[claude-stderr] ${h}`)}),p.on("error",h=>{n({type:"error",message:`spawn failed: ${h.message}`})});let{promise:I,resolve:S}=$();p.on("exit",h=>{l||(n({type:"turn-completed",filesTouched:Array.from(y),durationMs:Date.now()-e}),h!==0&&h!==null&&n({type:"error",message:`claude exited with code ${h}`})),o(null),S()});try{await I}finally{d.onTurnSettled()}}}function $(){let d;return{promise:new Promise(r=>{d=r}),resolve:d}}function ce(d,t,r){return new Promise((m,u)=>{let f=setTimeout(()=>u(new Error(r)),t);d.then(a=>{clearTimeout(f),m(a)},a=>{clearTimeout(f),u(a instanceof Error?a:new Error(String(a)))})})}export{se as extractCodexThreadId,Ie as runAgentWrapper};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.375 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{p as g}from"./chunk-CX7VCKAT.js";import"./chunk-4ZXR2M3D.js";import"./chunk-MP2GPO4T.js";import{c as f}from"./chunk-T4ISWS5H.js";import"./chunk-DQUPSAHE.js";import{existsSync as d,mkdirSync as y,readFileSync as m,writeFileSync as u}from"node:fs";import{join as w}from"node:path";import{gzipSync as x}from"node:zlib";function l(t,e){let r=t.indexOf(`--${e}`);if(r!==-1&&r+1<t.length)return t[r+1];let s=t.find(i=>i.startsWith(`--${e}=`));return s?s.slice(e.length+3):void 0}async function S(t){let e=l(t,"wire")||"",r=l(t,"out-dir"),s=l(t,"manifest");if((!r||!s)&&(console.error(" usage: rnx app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),f(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}y(r,{recursive:!0});let i=await g(e,{onStaged:({url:n,byteLength:o})=>console.log(` staged app font: ${n} (${(o/1024).toFixed(1)} KiB)`),onError:(n,o)=>console.error(` warning: failed to fetch app font ${n}: ${o instanceof Error?o.message:o}`)}),a=[];for(let n of i){let o=x(n.bytes);u(w(r,n.urlhash),o),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:o.length,rawBytes:n.bytes.byteLength})}let c=[];if(d(s))try{let n=JSON.parse(m(s,"utf8"));Array.isArray(n)&&(c=n)}catch{}let h=new Set(c.map(n=>n.urlhash)),p=[...c,...a.filter(n=>!h.has(n.urlhash))];u(s,JSON.stringify(p)),console.log(`staged ${a.length} app font(s); manifest now has ${p.length} file(s)`)}async function B(t){let e=t[0];if(e==="stage"){await S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),f(1)}export{B as runAppFonts};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.375 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{c}from"./chunk-T4ISWS5H.js";import"./chunk-DQUPSAHE.js";import{spawn as S}from"child_process";var k=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),q=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),P=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),j=new Set(["--path-equals"]);function N(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 l=Number(s[o+1]);if(!Number.isFinite(l)||l<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=l,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(q.has(a)){u.push({kind:a,args:[]});continue}if(P.has(a)){let l=s[o+1];if(l==null)return{error:`${a} requires a value`};u.push({kind:a,args:[l]}),o++;continue}if(j.has(a)){let l=s[o+1],p=s[o+2];if(l==null||p==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[l,p]}),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 R(s){return s[0]==="get"||s[0]==="debug"?k.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:k.has(s[0])?s[0]:null}async function A(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=S(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
|
-
`).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 v(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 g(s){return Array.isArray(s)?s.length:s&&typeof s=="object"?Object.keys(s).length:null}async function O(s,r){let{kind:u,args:n}=s;switch(u){case"--exists":return r==null?{ok:!1,reason:"payload is null"}:g(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=g(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=g(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=g(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=g(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=v(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=v(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 E(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 E(s,r){return new Promise((u,n)=>{let e=S("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 L(s){(s[0]==="--help"||s[0]==="-h"||s.length===0)&&(J(),c(s.length===0?2:0));let r=N(s);"error"in r&&(process.stderr.write(` assert: ${r.error}
|
|
6
|
-
`),c(2));let{verbArgs:u,predicates:n,withinMs:e,negate:t,quiet:i,allowTimeout:o}=r;R(u)||(process.stderr.write(` assert: unknown or non-read verb: ${u.join(" ")}
|
|
7
|
-
supported: ${Array.from(k).sort().join(", ")}
|
|
8
|
-
`),c(2));let l=n.length>0?n:[{kind:"--exists",args:[]}],p=e>0?Date.now()+e:0,d=0,$="",y="";for(;;){d++;let m=await A(u);if(!m.ok){if(y=m.reason||"verb failed",Date.now()<p){await x(150);continue}let f=o?1:125;if(!i){let h=f===1?"fail":"skip";process.stderr.write(` assert: ${h} \u2014 ${y}
|
|
9
|
-
`)}c(f)}let b=!0,w=[];try{for(let f of l){let h=await O(f,m.payload);if(w.push(`${f.kind}: ${h.reason}`),!h.ok){b=!1;break}}}catch(f){i||process.stderr.write(` assert: skip \u2014 ${f.message}
|
|
10
|
-
`),c(125)}if((t?!b:b)&&(i||process.stderr.write(` assert: pass${d>1?` (attempt ${d})`:""} \u2014 ${w.join("; ")}
|
|
11
|
-
`),c(0)),$=w.join("; "),Date.now()<p){await x(150);continue}i||process.stderr.write(` assert: fail${d>1?` after ${d} attempt(s)`:""} \u2014 ${$}
|
|
12
|
-
`),c(1)}}function x(s){return new Promise(r=>setTimeout(r,s))}function J(){process.stdout.write(`
|
|
13
|
-
rnx assert \u2014 run any read verb and convert its output into a bisect-friendly exit code.
|
|
14
|
-
|
|
15
|
-
usage:
|
|
16
|
-
rnx assert <verb> <verb-args...> <assertion-flags...>
|
|
17
|
-
|
|
18
|
-
exit codes:
|
|
19
|
-
0 assertion passed (git bisect: good)
|
|
20
|
-
1 assertion failed (git bisect: bad)
|
|
21
|
-
125 could not evaluate (git bisect: skip \u2014 app not loaded, verb crashed)
|
|
22
|
-
2 misuse (bad flags/verb)
|
|
23
|
-
|
|
24
|
-
assertion flags (AND'd when multiple are given):
|
|
25
|
-
--count <n> result array has exactly n items
|
|
26
|
-
--count-at-least <n> length >= n
|
|
27
|
-
--count-at-most <n> length <= n
|
|
28
|
-
--exists non-null, non-empty (default if no flag given)
|
|
29
|
-
--empty null or zero length
|
|
30
|
-
--contains <str> JSON.stringify(result) contains str (repeatable)
|
|
31
|
-
--not-contains <str> opposite
|
|
32
|
-
--matches <regex> result (stringified) matches regex
|
|
33
|
-
--not-matches <regex> opposite
|
|
34
|
-
--equals <literal> scalar equality
|
|
35
|
-
--has-path <dotted.path> nested path exists
|
|
36
|
-
--path-equals <path> <value> nested path equals value
|
|
37
|
-
--jq <expr> jq expression is truthy (requires jq on PATH)
|
|
38
|
-
--within <ms> retry verb + predicates until pass or deadline
|
|
39
|
-
--allow-timeout treat verb auto-wait timeout as a fail, not a skip
|
|
40
|
-
--negate, ! flip pass/fail (does not flip skip)
|
|
41
|
-
--quiet suppress the one-line pass/fail summary
|
|
42
|
-
|
|
43
|
-
examples:
|
|
44
|
-
rnx assert find --testid set-max-input --count 4
|
|
45
|
-
rnx assert describe --contains "swap-form-header"
|
|
46
|
-
rnx assert get errors --count 0
|
|
47
|
-
rnx assert find --testid submit --exists --within 3000
|
|
48
|
-
rnx assert describe --jq '.tree | contains("swap-form-header")'
|
|
49
|
-
`)}export{L as runAssert};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.375 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a as i}from"./chunk-HEV7BAPE.js";import{d as t}from"./chunk-JWUDT4QK.js";import{c as r}from"./chunk-T4ISWS5H.js";import"./chunk-HWDVC6YA.js";import"./chunk-DQUPSAHE.js";function s(){console.log(`
|
|
5
|
-
rnx auth \u2014 inspect CLI auth
|
|
6
|
-
|
|
7
|
-
usage:
|
|
8
|
-
rnx auth
|
|
9
|
-
|
|
10
|
-
API keys are read from RNX_API_KEY, or SOOTSIM_API_KEY if that is unset.
|
|
11
|
-
Use \`rnx login\` to sign in and \`rnx logout\` to clear the desktop session.
|
|
12
|
-
`)}async function u(){let o=i();if(!o)return console.log(" not signed in"),console.log(" set RNX_API_KEY=sk_rnx_... or run `rnx login`"),1;if(o.kind==="api-key")return console.log(` api key ${o.secret.slice(0,14)}...`),console.log(` source: ${o.envName} env var`),0;if(o.kind==="github")return console.log(` github token (${o.source})`),console.log(` repo: ${o.repoId}`),0;let n=await t(o.origin),e=n?.user;return console.log(` ${e?.email||e?.name||e?.id||"signed in"}`),console.log(` origin: ${n?.origin??o.origin}`),n?.updatedAt&&console.log(` updated: ${n.updatedAt}`),0}async function d(o){if(o.includes("--help")||o.includes("-h")){s();return}let n=o.find(e=>!e.startsWith("-"));if(!n||n==="status"){process.exitCode=await u();return}console.error(` unknown auth command: ${n}`),s(),r(1)}export{d as runAuth};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! rnx v0.1.375 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
-
import { createRequire as __sootsimCreateRequire } from 'node:module'
|
|
3
|
-
var require = __sootsimCreateRequire(import.meta.url)
|
|
4
|
-
import{a,b,c,d}from"./chunk-AQ5TMOAI.js";import"./chunk-DQUPSAHE.js";export{d as BETA_ASK_HEADLINE,b as BETA_LABEL,c as BETA_TAGLINE,a as IS_BETA};
|