rnxsim 0.1.496 → 0.1.498

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.
Files changed (54) hide show
  1. package/cli/ws-bridge.ts +44 -26
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/agent-identity.cjs +1 -1
  5. package/dist-lib/agent-sessions.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/capture-contract.cjs +1 -1
  17. package/dist-lib/capture-contract.mjs +1 -1
  18. package/dist-lib/cli-constants.cjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud.cjs +1 -1
  22. package/dist-lib/cloud.mjs +1 -1
  23. package/dist-lib/config.cjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/home-paths.cjs +1 -1
  27. package/dist-lib/host/bridge-host.cjs +1 -1
  28. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  29. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  30. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  31. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  32. package/dist-lib/host/websocket-proxy.cjs +1 -1
  33. package/dist-lib/index.cjs +33 -19
  34. package/dist-lib/jump-to-source-babel.cjs +1 -1
  35. package/dist-lib/jump-to-source-native.cjs +1 -1
  36. package/dist-lib/menu.cjs +1 -1
  37. package/dist-lib/menu.mjs +1 -1
  38. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  39. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  40. package/dist-lib/metro-production-bundle.cjs +1 -1
  41. package/dist-lib/metro-production-bundle.mjs +1 -1
  42. package/dist-lib/metro.cjs +1 -1
  43. package/dist-lib/profiles.cjs +1 -1
  44. package/dist-lib/public-brand.cjs +1 -1
  45. package/dist-lib/react-native-host-modules.cjs +1 -1
  46. package/dist-lib/react-native-host-modules.mjs +1 -1
  47. package/dist-lib/render-mode.cjs +1 -1
  48. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  49. package/dist-lib/sdk.cjs +1 -1
  50. package/dist-lib/sdk.mjs +1 -1
  51. package/dist-lib/skills.cjs +33 -19
  52. package/dist-lib/vite.cjs +1 -1
  53. package/package.json +1 -1
  54. package/src/vite-plugin.ts +22 -4
package/cli/ws-bridge.ts CHANGED
@@ -616,23 +616,26 @@ export function createBridge(wsPort: number, opts: WsBridgeOptions = {}): WsBrid
616
616
 
617
617
  let warnedAboutContention = false
618
618
  let noticedTarget = false
619
- // the browser host behind the current pin, learned while the pinned sim is
620
- // still connected. a reload changes the sim id but not the host.
621
- let pinnedHostPid: number | null = null
622
- let lineageLookupInFlight = false
619
+ // the browser host behind each target, learned while that sim is still
620
+ // connected. a reload changes the sim id but not the host.
621
+ const hostPidBySimId = new Map<string, number>()
622
+ const lineageLookupBySimId = new Map<string, Promise<void>>()
623
623
 
624
624
  // a reload retires the sim id but keeps the browser host, so a successor
625
625
  // sharing that host pid IS the same page lineage rather than a guess. only
626
626
  // an unambiguous match counts; callers fail closed on null.
627
627
  function pickReloadedSuccessor(sims: unknown, retiredSimId: string): string | null {
628
- if (pinnedHostPid === null) return null
628
+ const pinnedHostPid = hostPidBySimId.get(retiredSimId)
629
+ if (pinnedHostPid === undefined) return null
629
630
  const successors = (Array.isArray(sims) ? (sims as BridgeSimInfo[]) : []).filter(
630
631
  (sim) =>
631
632
  sim.id !== retiredSimId &&
632
633
  sim.readyState === 'open' &&
633
634
  sim.meta?.sootsimHostPid === pinnedHostPid,
634
635
  )
635
- return successors.length === 1 ? successors[0].id : null
636
+ if (successors.length !== 1) return null
637
+ hostPidBySimId.set(successors[0].id, pinnedHostPid)
638
+ return successors[0].id
636
639
  }
637
640
 
638
641
  // print a one-line notice on first sim-scoped command so agents/users see
@@ -736,7 +739,7 @@ export function createBridge(wsPort: number, opts: WsBridgeOptions = {}): WsBrid
736
739
  if (payload.simId === undefined && defaultSimId) {
737
740
  payload.simId = defaultSimId
738
741
  }
739
- maybeNoticeTarget(cmd.type ?? '', payload.simId)
742
+ maybeNoticeTarget(payload.type ?? '', payload.simId)
740
743
  ws.send(JSON.stringify(payload))
741
744
  })
742
745
  }
@@ -750,27 +753,42 @@ export function createBridge(wsPort: number, opts: WsBridgeOptions = {}): WsBrid
750
753
  // fail-closed saved-sim-gone path below when the pin file is cleared.
751
754
  const sentSimId =
752
755
  opts.simIdSource === 'flag' ? opts.simId : (readCurrentSimId() ?? opts.simId)
756
+ const targetedSimId =
757
+ typeof cmd.simId === 'string' && cmd.simId ? cmd.simId : sentSimId
753
758
  try {
754
- const result = await sendOnce(sentSimId)
755
- // the guest re-registers under a NEW sim id whenever its page reloads,
756
- // so remember which browser host is behind the pin while it still
757
- // exists. that lineage is what lets the fail-closed path below follow
758
- // the reload without ever guessing at an unrelated sim.
759
- if (sentSimId && pinnedHostPid === null && !lineageLookupInFlight) {
760
- lineageLookupInFlight = true
761
- void sendOnce(undefined, { type: 'bridge:list-sims' })
762
- .then((sims) => {
763
- if (!Array.isArray(sims)) return
764
- const pinned = (sims as BridgeSimInfo[]).find((sim) => sim.id === sentSimId)
765
- const hostPid = pinned?.meta?.sootsimHostPid
766
- if (typeof hostPid === 'number') pinnedHostPid = hostPid
767
- })
768
- .catch(() => {})
769
- .finally(() => {
770
- lineageLookupInFlight = false
771
- })
759
+ // a command can itself reload the page and retire its sim id. capture
760
+ // the browser-host lineage before dispatch, while the target still
761
+ // exists, so the caller can follow the replacement without guessing.
762
+ if (
763
+ targetedSimId &&
764
+ cmd.type !== 'bridge:list-sims' &&
765
+ !hostPidBySimId.has(targetedSimId)
766
+ ) {
767
+ let lookup = lineageLookupBySimId.get(targetedSimId)
768
+ if (!lookup) {
769
+ lookup = (async () => {
770
+ try {
771
+ const sims = await sendOnce(undefined, { type: 'bridge:list-sims' })
772
+ if (!Array.isArray(sims)) return
773
+ const targeted = (sims as BridgeSimInfo[]).find(
774
+ (sim) => sim.id === targetedSimId,
775
+ )
776
+ const hostPid = targeted?.meta?.sootsimHostPid
777
+ if (typeof hostPid === 'number') {
778
+ hostPidBySimId.set(targetedSimId, hostPid)
779
+ }
780
+ } catch {
781
+ // lineage enables fail-closed reload following, but a failed
782
+ // observation must not replace the caller's command failure.
783
+ } finally {
784
+ lineageLookupBySimId.delete(targetedSimId)
785
+ }
786
+ })()
787
+ lineageLookupBySimId.set(targetedSimId, lookup)
788
+ }
789
+ await lookup
772
790
  }
773
- return result
791
+ return await sendOnce(sentSimId)
774
792
  } catch (error) {
775
793
  const message = error instanceof Error ? error.message : String(error)
776
794
  const missingSimMessage = `no sim connected with id ${sentSimId}`
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/beta.ts
4
4
  var IS_BETA = true;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var SIM_LONG_PRESS_MAX_MS = 5e3;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var SIM_LONG_PRESS_DEFAULT_MS = 500;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/capture-contract.ts
4
4
  var RNX_SCREEN_CAPTURE_VERSION = 1;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-contract.ts
4
4
  var RNX_CLOUD_MAX_ARTIFACT_BYTES = 20 * 1024 * 1024;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/host/fetch-proxy-overrides.ts
4
4
  var FETCH_PROXY_BROWSER_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1063,14 +1063,17 @@ function createBridge(wsPort, opts = {}) {
1063
1063
  });
1064
1064
  let warnedAboutContention = false;
1065
1065
  let noticedTarget = false;
1066
- let pinnedHostPid = null;
1067
- let lineageLookupInFlight = false;
1066
+ const hostPidBySimId = /* @__PURE__ */ new Map();
1067
+ const lineageLookupBySimId = /* @__PURE__ */ new Map();
1068
1068
  function pickReloadedSuccessor(sims, retiredSimId) {
1069
- if (pinnedHostPid === null) return null;
1069
+ const pinnedHostPid = hostPidBySimId.get(retiredSimId);
1070
+ if (pinnedHostPid === void 0) return null;
1070
1071
  const successors = (Array.isArray(sims) ? sims : []).filter(
1071
1072
  (sim) => sim.id !== retiredSimId && sim.readyState === "open" && sim.meta?.sootsimHostPid === pinnedHostPid
1072
1073
  );
1073
- return successors.length === 1 ? successors[0].id : null;
1074
+ if (successors.length !== 1) return null;
1075
+ hostPidBySimId.set(successors[0].id, pinnedHostPid);
1076
+ return successors[0].id;
1074
1077
  }
1075
1078
  function maybeNoticeTarget(cmdType, simId) {
1076
1079
  if (noticedTarget) return;
@@ -1153,26 +1156,37 @@ function createBridge(wsPort, opts = {}) {
1153
1156
  if (payload.simId === void 0 && defaultSimId) {
1154
1157
  payload.simId = defaultSimId;
1155
1158
  }
1156
- maybeNoticeTarget(cmd.type ?? "", payload.simId);
1159
+ maybeNoticeTarget(payload.type ?? "", payload.simId);
1157
1160
  ws.send(JSON.stringify(payload));
1158
1161
  });
1159
1162
  };
1160
1163
  const sentSimId = opts.simIdSource === "flag" ? opts.simId : readCurrentSimId() ?? opts.simId;
1164
+ const targetedSimId = typeof cmd.simId === "string" && cmd.simId ? cmd.simId : sentSimId;
1161
1165
  try {
1162
- const result = await sendOnce(sentSimId);
1163
- if (sentSimId && pinnedHostPid === null && !lineageLookupInFlight) {
1164
- lineageLookupInFlight = true;
1165
- void sendOnce(void 0, { type: "bridge:list-sims" }).then((sims) => {
1166
- if (!Array.isArray(sims)) return;
1167
- const pinned = sims.find((sim) => sim.id === sentSimId);
1168
- const hostPid = pinned?.meta?.sootsimHostPid;
1169
- if (typeof hostPid === "number") pinnedHostPid = hostPid;
1170
- }).catch(() => {
1171
- }).finally(() => {
1172
- lineageLookupInFlight = false;
1173
- });
1166
+ if (targetedSimId && cmd.type !== "bridge:list-sims" && !hostPidBySimId.has(targetedSimId)) {
1167
+ let lookup = lineageLookupBySimId.get(targetedSimId);
1168
+ if (!lookup) {
1169
+ lookup = (async () => {
1170
+ try {
1171
+ const sims = await sendOnce(void 0, { type: "bridge:list-sims" });
1172
+ if (!Array.isArray(sims)) return;
1173
+ const targeted = sims.find(
1174
+ (sim) => sim.id === targetedSimId
1175
+ );
1176
+ const hostPid = targeted?.meta?.sootsimHostPid;
1177
+ if (typeof hostPid === "number") {
1178
+ hostPidBySimId.set(targetedSimId, hostPid);
1179
+ }
1180
+ } catch {
1181
+ } finally {
1182
+ lineageLookupBySimId.delete(targetedSimId);
1183
+ }
1184
+ })();
1185
+ lineageLookupBySimId.set(targetedSimId, lookup);
1186
+ }
1187
+ await lookup;
1174
1188
  }
1175
- return result;
1189
+ return await sendOnce(sentSimId);
1176
1190
  } catch (error) {
1177
1191
  const message = error instanceof Error ? error.message : String(error);
1178
1192
  const missingSimMessage = `no sim connected with id ${sentSimId}`;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
package/dist-lib/menu.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/menu.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/public-brand.ts
4
4
  var name = "rnx";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/metro-fingerprint-registry.ts
4
4
  var RNX_METRO_FINGERPRINT_SCHEMA_VERSION = 2;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/metro-production-bundle.ts
4
4
  var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/react-native-host-modules.ts
4
4
  var REACT_NATIVE_PASSTHROUGH_SPECIFIERS = [
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
package/dist-lib/sdk.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/sdk.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -31101,14 +31101,17 @@ function createBridge(wsPort, opts = {}) {
31101
31101
  });
31102
31102
  let warnedAboutContention = false;
31103
31103
  let noticedTarget = false;
31104
- let pinnedHostPid = null;
31105
- let lineageLookupInFlight = false;
31104
+ const hostPidBySimId = /* @__PURE__ */ new Map();
31105
+ const lineageLookupBySimId = /* @__PURE__ */ new Map();
31106
31106
  function pickReloadedSuccessor(sims, retiredSimId) {
31107
- if (pinnedHostPid === null) return null;
31107
+ const pinnedHostPid = hostPidBySimId.get(retiredSimId);
31108
+ if (pinnedHostPid === void 0) return null;
31108
31109
  const successors = (Array.isArray(sims) ? sims : []).filter(
31109
31110
  (sim) => sim.id !== retiredSimId && sim.readyState === "open" && sim.meta?.sootsimHostPid === pinnedHostPid
31110
31111
  );
31111
- return successors.length === 1 ? successors[0].id : null;
31112
+ if (successors.length !== 1) return null;
31113
+ hostPidBySimId.set(successors[0].id, pinnedHostPid);
31114
+ return successors[0].id;
31112
31115
  }
31113
31116
  function maybeNoticeTarget(cmdType, simId) {
31114
31117
  if (noticedTarget) return;
@@ -31191,26 +31194,37 @@ function createBridge(wsPort, opts = {}) {
31191
31194
  if (payload.simId === void 0 && defaultSimId) {
31192
31195
  payload.simId = defaultSimId;
31193
31196
  }
31194
- maybeNoticeTarget(cmd.type ?? "", payload.simId);
31197
+ maybeNoticeTarget(payload.type ?? "", payload.simId);
31195
31198
  ws.send(JSON.stringify(payload));
31196
31199
  });
31197
31200
  };
31198
31201
  const sentSimId = opts.simIdSource === "flag" ? opts.simId : readCurrentSimId() ?? opts.simId;
31202
+ const targetedSimId = typeof cmd.simId === "string" && cmd.simId ? cmd.simId : sentSimId;
31199
31203
  try {
31200
- const result = await sendOnce(sentSimId);
31201
- if (sentSimId && pinnedHostPid === null && !lineageLookupInFlight) {
31202
- lineageLookupInFlight = true;
31203
- void sendOnce(void 0, { type: "bridge:list-sims" }).then((sims) => {
31204
- if (!Array.isArray(sims)) return;
31205
- const pinned = sims.find((sim) => sim.id === sentSimId);
31206
- const hostPid = pinned?.meta?.sootsimHostPid;
31207
- if (typeof hostPid === "number") pinnedHostPid = hostPid;
31208
- }).catch(() => {
31209
- }).finally(() => {
31210
- lineageLookupInFlight = false;
31211
- });
31204
+ if (targetedSimId && cmd.type !== "bridge:list-sims" && !hostPidBySimId.has(targetedSimId)) {
31205
+ let lookup = lineageLookupBySimId.get(targetedSimId);
31206
+ if (!lookup) {
31207
+ lookup = (async () => {
31208
+ try {
31209
+ const sims = await sendOnce(void 0, { type: "bridge:list-sims" });
31210
+ if (!Array.isArray(sims)) return;
31211
+ const targeted = sims.find(
31212
+ (sim) => sim.id === targetedSimId
31213
+ );
31214
+ const hostPid = targeted?.meta?.sootsimHostPid;
31215
+ if (typeof hostPid === "number") {
31216
+ hostPidBySimId.set(targetedSimId, hostPid);
31217
+ }
31218
+ } catch {
31219
+ } finally {
31220
+ lineageLookupBySimId.delete(targetedSimId);
31221
+ }
31222
+ })();
31223
+ lineageLookupBySimId.set(targetedSimId, lookup);
31224
+ }
31225
+ await lookup;
31212
31226
  }
31213
- return result;
31227
+ return await sendOnce(sentSimId);
31214
31228
  } catch (error) {
31215
31229
  const message = error instanceof Error ? error.message : String(error);
31216
31230
  const missingSimMessage = `no sim connected with id ${sentSimId}`;
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.496 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.498 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rnxsim",
3
- "version": "0.1.496",
3
+ "version": "0.1.498",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for rnx.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -469,12 +469,30 @@ function rnghUpstreamInternalResolvePlugin(): Plugin {
469
469
  // workletsBabelTransform populates `__closure` on user-code worklets so
470
470
  // useAnimatedStyle/useDerivedValue/etc. subscribe correctly inside the
471
471
  // worker. matching is content-driven today, so the predicate is `() => true`.
472
+ export function recordingPluginWorkerRedirect(): Plugin {
473
+ const workerTarget = path.resolve(
474
+ workspaceRoot,
475
+ 'packages/rnx-plugin-recording/src/worker.ts',
476
+ )
477
+ return {
478
+ name: 'sootsim-recording-plugin-worker-redirect',
479
+ enforce: 'pre',
480
+ resolveId(source) {
481
+ if (source === '@rnx/plugin-recording') {
482
+ return workerTarget
483
+ }
484
+ return null
485
+ },
486
+ }
487
+ }
488
+
472
489
  export function engineShellWorkerPlugins(): Plugin[] {
473
490
  return [
474
491
  workerReactBridgePlugin(),
475
492
  fixJsxRuntimeExports(),
476
493
  flowStripTransform(),
477
494
  nodeModulesJsxTransform(),
495
+ recordingPluginWorkerRedirect(),
478
496
  reanimatedNativeSeamRedirect(),
479
497
  manifestNativeSeamRedirect(),
480
498
  keyboardControllerBindingsRedirect(),
@@ -501,8 +519,8 @@ export function engineShellWorkerPlugins(): Plugin[] {
501
519
  export type WorkerBootClosure = {
502
520
  // substring of the worker entry module id this applies to
503
521
  entry: string
504
- // byte cap on the rendered worker file; raise it in the same change that
505
- // adds worker code, never silently
522
+ // byte cap on the rendered worker file; fix excess boot dependencies and
523
+ // unneeded inclusions rather than raising the cap
506
524
  maxBytes: number
507
525
  }
508
526
 
@@ -515,7 +533,7 @@ const ENGINE_WORKER_BOOT_CLOSURES: WorkerBootClosure[] = [
515
533
  // when adding font work here, or both caps take the parser again.
516
534
  // gesture handler 3's upstream hook surface moved the measured closure to
517
535
  // 3,446,531 bytes. the vector catalog lookup and PUA overlay add 675 bytes.
518
- { entry: 'src/render-worker/shell-worker-entry.ts', maxBytes: 3_460_000 },
536
+ { entry: 'src/render-worker/shell-worker-entry.ts', maxBytes: 3_451_000 },
519
537
  { entry: 'src/render-worker/compositor-worker-entry.ts', maxBytes: 1_080_000 },
520
538
  { entry: 'src/render-worker/compositor-worker-ganesh-entry.ts', maxBytes: 1_820_000 },
521
539
  ]
@@ -547,7 +565,7 @@ export function workerBootChunkPlugin(closures: WorkerBootClosure[]): Plugin {
547
565
  const bytes = Buffer.byteLength(chunks[0].code)
548
566
  if (bytes > closure.maxBytes) {
549
567
  this.error(
550
- `worker ${closure.entry}: ${chunks[0].fileName} is ${bytes} bytes, over the ${closure.maxBytes} byte cap; raise the cap in the same change that grows the worker`,
568
+ `worker ${closure.entry}: ${chunks[0].fileName} is ${bytes} bytes, over the ${closure.maxBytes} byte cap; eliminate excess boot dependencies rather than raising the cap`,
551
569
  )
552
570
  }
553
571
  },