rnxsim 0.1.375 → 0.1.376

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 (193) hide show
  1. package/cli/commands/control.ts +18 -4
  2. package/dist-cli/bin.js +5 -5
  3. package/dist-cli/chunks/{agent-JJN7U6FR.js → agent-H42FCKFF.js} +2 -2
  4. package/dist-cli/chunks/{agent-wrapper-AVVUJ3WF.js → agent-wrapper-BBZKTZS6.js} +2 -2
  5. package/dist-cli/chunks/{app-fonts-QJ22CNAZ.js → app-fonts-43VXIKF4.js} +2 -2
  6. package/dist-cli/chunks/{assert-PZZKIY3K.js → assert-IXOLVO5Z.js} +2 -2
  7. package/dist-cli/chunks/{auth-5AVDJO33.js → auth-KFMFB6FU.js} +2 -2
  8. package/dist-cli/chunks/{beta-PFRGP266.js → beta-5AO3SJB7.js} +2 -2
  9. package/dist-cli/chunks/{box-ILC2O7ZO.js → box-ZHM66L6K.js} +44 -44
  10. package/dist-cli/chunks/{camera-J3V62PP7.js → camera-FNJVFCDQ.js} +2 -2
  11. package/dist-cli/chunks/{chunk-CCMZSHJB.js → chunk-37MCSPTE.js} +1 -1
  12. package/dist-cli/chunks/{chunk-FUTYK55H.js → chunk-3PEMSUAQ.js} +3 -3
  13. package/dist-cli/chunks/chunk-4TQ5HOK3.js +7 -0
  14. package/dist-cli/chunks/{chunk-25KRGDZT.js → chunk-5YZYDEMI.js} +1 -1
  15. package/dist-cli/chunks/{chunk-OJNKRIZF.js → chunk-6CV3R3XD.js} +2 -2
  16. package/dist-cli/chunks/{chunk-5HHWECGT.js → chunk-7LGK5XU6.js} +2 -2
  17. package/dist-cli/chunks/{chunk-K7QQWKGE.js → chunk-7R2TK2NY.js} +1 -1
  18. package/dist-cli/chunks/{chunk-EZXV6U2N.js → chunk-7VZZQQEE.js} +3 -3
  19. package/dist-cli/chunks/{chunk-XUBV77WH.js → chunk-AFOVILIL.js} +1 -1
  20. package/dist-cli/chunks/{chunk-S65CK3RI.js → chunk-BEU7CD7E.js} +1 -1
  21. package/dist-cli/chunks/{chunk-F5F7FIPM.js → chunk-CE4JQJ6Y.js} +2 -2
  22. package/dist-cli/chunks/{chunk-RLCQLMFF.js → chunk-CIE6CZXL.js} +2 -2
  23. package/dist-cli/chunks/{chunk-5PZVYF42.js → chunk-CSJ7L7ZL.js} +1 -1
  24. package/dist-cli/chunks/{chunk-7NCPUZ52.js → chunk-CWCQP53A.js} +2 -2
  25. package/dist-cli/chunks/{chunk-Z6LOIW46.js → chunk-DCS5FK5N.js} +1 -1
  26. package/dist-cli/chunks/{chunk-MXJ2UWRV.js → chunk-DEV3E3MV.js} +1 -1
  27. package/dist-cli/chunks/{chunk-H4MYYOYJ.js → chunk-DGJMIVZM.js} +2 -2
  28. package/dist-cli/chunks/{chunk-GEX7RVHY.js → chunk-DGX3MN65.js} +1 -1
  29. package/dist-cli/chunks/{chunk-FZDRA7Z4.js → chunk-DNPQMTW5.js} +2 -2
  30. package/dist-cli/chunks/{chunk-TPPVAA7Z.js → chunk-DOVBJBVD.js} +2 -2
  31. package/dist-cli/chunks/{chunk-FW6AN7I2.js → chunk-DPBJ3S3J.js} +1 -1
  32. package/dist-cli/chunks/{chunk-PBOWUNXO.js → chunk-FVZBGPCU.js} +2 -2
  33. package/dist-cli/chunks/{chunk-PNRJFHX4.js → chunk-GDKMOIUT.js} +1 -1
  34. package/dist-cli/chunks/{chunk-4IKE4YUS.js → chunk-GIF2NJCS.js} +2 -2
  35. package/dist-cli/chunks/{chunk-MP2GPO4T.js → chunk-GZE57ORL.js} +1 -1
  36. package/dist-cli/chunks/{chunk-LD7I266X.js → chunk-H3U56DKI.js} +2 -2
  37. package/dist-cli/chunks/{chunk-JOHJZUGG.js → chunk-HZLOYAPH.js} +2 -2
  38. package/dist-cli/chunks/{chunk-DSD2UBZI.js → chunk-J2IKAEU2.js} +2 -2
  39. package/dist-cli/chunks/{chunk-HEV7BAPE.js → chunk-JXAXYK7W.js} +2 -2
  40. package/dist-cli/chunks/{chunk-XYSDYGKC.js → chunk-KJE2O2GK.js} +2 -2
  41. package/dist-cli/chunks/{chunk-V7RGRZOL.js → chunk-KMNVDZZI.js} +1 -1
  42. package/dist-cli/chunks/{chunk-4ALPWIMP.js → chunk-LC3QRIRB.js} +2 -2
  43. package/dist-cli/chunks/{chunk-SXBFGGAM.js → chunk-LGFTAQYC.js} +1 -1
  44. package/dist-cli/chunks/{chunk-4CEZZKRY.js → chunk-LQMUA5IY.js} +1 -1
  45. package/dist-cli/chunks/{chunk-LAOKTKT4.js → chunk-MFIQTWC5.js} +2 -2
  46. package/dist-cli/chunks/{chunk-2IUMRRYV.js → chunk-MGALNF2F.js} +2 -2
  47. package/dist-cli/chunks/{chunk-HNPHODBD.js → chunk-MLBZZHOY.js} +2 -2
  48. package/dist-cli/chunks/{chunk-7OSIJCBR.js → chunk-NNRF7GIB.js} +2 -2
  49. package/dist-cli/chunks/{chunk-5CGJFU27.js → chunk-NORLYTTO.js} +2 -2
  50. package/dist-cli/chunks/{chunk-CX7VCKAT.js → chunk-P6KVGV3H.js} +11 -11
  51. package/dist-cli/chunks/chunk-PAJTUK33.js +4 -0
  52. package/dist-cli/chunks/{chunk-C6B5FOP3.js → chunk-QELIC5XP.js} +1 -1
  53. package/dist-cli/chunks/{chunk-HWDVC6YA.js → chunk-QRDF33WD.js} +1 -1
  54. package/dist-cli/chunks/{chunk-LSOGXSDV.js → chunk-R76BA7C7.js} +3 -3
  55. package/dist-cli/chunks/{chunk-SWBUNMQS.js → chunk-RVEB4CZ2.js} +2 -2
  56. package/dist-cli/chunks/{chunk-BQCEI37V.js → chunk-SK4M7NXT.js} +1 -1
  57. package/dist-cli/chunks/{chunk-JWUDT4QK.js → chunk-SKMG5DD7.js} +2 -2
  58. package/dist-cli/chunks/{chunk-AQ5TMOAI.js → chunk-TEESPOYR.js} +1 -1
  59. package/dist-cli/chunks/{chunk-T4ISWS5H.js → chunk-TH2UFGVP.js} +1 -1
  60. package/dist-cli/chunks/{chunk-4ZXR2M3D.js → chunk-TLP3T3VO.js} +1 -1
  61. package/dist-cli/chunks/{chunk-2BRBFLWA.js → chunk-TZUABDIJ.js} +2 -2
  62. package/dist-cli/chunks/{chunk-Z5O5H4O7.js → chunk-UB2W6OQM.js} +2 -2
  63. package/dist-cli/chunks/{chunk-HNDWYCND.js → chunk-UYVXALPB.js} +2 -2
  64. package/dist-cli/chunks/{chunk-ZXFVBYJY.js → chunk-VQDYFFIG.js} +2 -2
  65. package/dist-cli/chunks/{chunk-YNHRSDVG.js → chunk-VWCNJPCJ.js} +2 -2
  66. package/dist-cli/chunks/{chunk-2GXNAZHB.js → chunk-VZIK4WIS.js} +2 -2
  67. package/dist-cli/chunks/{chunk-LMHBU5LZ.js → chunk-W3FNXAQP.js} +1 -1
  68. package/dist-cli/chunks/{chunk-GDLE4NIV.js → chunk-XCDNVNP3.js} +1 -1
  69. package/dist-cli/chunks/{chunk-4EUKOIAV.js → chunk-XSVILA4Z.js} +2 -2
  70. package/dist-cli/chunks/{chunk-USM3P74H.js → chunk-XUTJ7ZWD.js} +2 -2
  71. package/dist-cli/chunks/{chunk-YX52RJKO.js → chunk-YTXY3MHW.js} +2 -2
  72. package/dist-cli/chunks/{chunk-QJQOK34O.js → chunk-ZF7PVX44.js} +2 -2
  73. package/dist-cli/chunks/{chunk-DQUPSAHE.js → chunk-ZSSG7OR7.js} +1 -1
  74. package/dist-cli/chunks/{cleanup-KPUW4SFK.js → cleanup-MLOK2OZA.js} +2 -2
  75. package/dist-cli/chunks/cli-version-OBNR366V.js +4 -0
  76. package/dist-cli/chunks/{compat-XXRFD2TW.js → compat-SHMFSKU7.js} +2 -2
  77. package/dist-cli/chunks/{config-DDMFDQ7F.js → config-TPEAEUJ2.js} +2 -2
  78. package/dist-cli/chunks/{connect-IPG47YXM.js → connect-3LEXWTE5.js} +2 -2
  79. package/dist-cli/chunks/control-Z3FWA6BO.js +4 -0
  80. package/dist-cli/chunks/daemon-RSVYSC65.js +4 -0
  81. package/dist-cli/chunks/{debug-MYIP46TM.js → debug-GUVAK2KR.js} +3 -3
  82. package/dist-cli/chunks/{desktop-ENFFBQAA.js → desktop-OOP2PTKP.js} +3 -3
  83. package/dist-cli/chunks/{detox-J5WVK6OH.js → detox-C2ILVBEC.js} +2 -2
  84. package/dist-cli/chunks/{device-RAVQVL75.js → device-NXIQQJWR.js} +2 -2
  85. package/dist-cli/chunks/{diagnose-PJMPXKJY.js → diagnose-2JBGYE5L.js} +2 -2
  86. package/dist-cli/chunks/{disk-cleanup-YLAY445J.js → disk-cleanup-VURWJYQV.js} +2 -2
  87. package/dist-cli/chunks/{do-chain-UBE7GIOU.js → do-chain-DJ4UQC7A.js} +2 -2
  88. package/dist-cli/chunks/drivers-JMA2OIKU.js +4 -0
  89. package/dist-cli/chunks/{env-Y5XJSNRD.js → env-KTNPKEZR.js} +2 -2
  90. package/dist-cli/chunks/{film-W3V6VURB.js → film-DCPS7EID.js} +3 -3
  91. package/dist-cli/chunks/flow-4DZ7B2OA.js +4 -0
  92. package/dist-cli/chunks/help-34CJMQY2.js +4 -0
  93. package/dist-cli/chunks/{hidden-runtime-alias-S5DJ7EDF.js → hidden-runtime-alias-HHT2C7WE.js} +2 -2
  94. package/dist-cli/chunks/{home-paths-5O4IZPYV.js → home-paths-KTPGCPMS.js} +2 -2
  95. package/dist-cli/chunks/inspect-JF5WYJRD.js +4 -0
  96. package/dist-cli/chunks/install-desktop-ZIC4CDXI.js +4 -0
  97. package/dist-cli/chunks/{login-V6TZ54ZH.js → login-TTJAOI2Q.js} +2 -2
  98. package/dist-cli/chunks/{logout-SPMLFWYA.js → logout-ERAQ6SKW.js} +2 -2
  99. package/dist-cli/chunks/{maestro-5ISTBAZE.js → maestro-W46QCF77.js} +3 -3
  100. package/dist-cli/chunks/{maestro-generate-WUI64NHR.js → maestro-generate-VBLM3MTU.js} +3 -3
  101. package/dist-cli/chunks/{mode-QPNBYXUF.js → mode-ZEDZK7R7.js} +2 -2
  102. package/dist-cli/chunks/{optional-demo-registry-CBSYF4CG.js → optional-demo-registry-ZUTPSVYQ.js} +2 -2
  103. package/dist-cli/chunks/{perf-T6N5PVYV.js → perf-YVT2WXT4.js} +2 -2
  104. package/dist-cli/chunks/{permissions-YZ7RRSZJ.js → permissions-L7VVDHFP.js} +2 -2
  105. package/dist-cli/chunks/{platform-XDQAA72X.js → platform-7TJOU2FB.js} +3 -3
  106. package/dist-cli/chunks/privacy-57UOTB5J.js +4 -0
  107. package/dist-cli/chunks/{record-QGYXRUKP.js → record-VXG37P7U.js} +3 -3
  108. package/dist-cli/chunks/{report-issue-VUUTGX7V.js → report-issue-WNNOBZHC.js} +2 -2
  109. package/dist-cli/chunks/reset-H5NBFE5U.js +4 -0
  110. package/dist-cli/chunks/resolve-target-57TK5WLE.js +4 -0
  111. package/dist-cli/chunks/runtime-QU2NIF2K.js +4 -0
  112. package/dist-cli/chunks/{screenshot-command-NZCMSJ4P.js → screenshot-command-AN56TTG7.js} +3 -3
  113. package/dist-cli/chunks/{screenshot-layers-VMTQ6XIU.js → screenshot-layers-3W5R7DB2.js} +2 -2
  114. package/dist-cli/chunks/{screenshots-capture-K3MWIDBK.js → screenshots-capture-6AWJY7XZ.js} +2 -2
  115. package/dist-cli/chunks/{serve-QJRIB2BV.js → serve-GLYO5Q7J.js} +2 -2
  116. package/dist-cli/chunks/setup-UA2HLD7S.js +4 -0
  117. package/dist-cli/chunks/{sim-client-5YUVL45C.js → sim-client-5C2RDQQO.js} +2 -2
  118. package/dist-cli/chunks/{skills-T3CS7CXK.js → skills-EYXWBRNQ.js} +2 -2
  119. package/dist-cli/chunks/{state-AJC3VK3G.js → state-REJ7W6K3.js} +2 -2
  120. package/dist-cli/chunks/{storage-KVGZKC3Y.js → storage-CFMDHI3V.js} +2 -2
  121. package/dist-cli/chunks/store-XMCUA45G.js +4 -0
  122. package/dist-cli/chunks/telemetry-FBL3NAKB.js +4 -0
  123. package/dist-cli/chunks/{timeline-DXDCAZUA.js → timeline-HMCHN5FO.js} +2 -2
  124. package/dist-cli/chunks/{upgrade-SRPTJACU.js → upgrade-2QSPAA3P.js} +2 -2
  125. package/dist-cli/chunks/upload-DUQBKZYV.js +4 -0
  126. package/dist-cli/chunks/{version-SOLPSBMG.js → version-IOA6QFGB.js} +2 -2
  127. package/dist-cli/chunks/{web-RT75LD7A.js → web-NCGUYVCJ.js} +2 -2
  128. package/dist-cli/chunks/welcome-QYGSQCWQ.js +5 -0
  129. package/dist-cli/chunks/{what-happened-CEIWJIWK.js → what-happened-YTOUK4LO.js} +2 -2
  130. package/dist-cli/chunks/{ws-bridge-YK5R3HOI.js → ws-bridge-OF4OZARG.js} +2 -2
  131. package/dist-lib/agent-daemon-client.cjs +1 -1
  132. package/dist-lib/agent-events.cjs +1 -1
  133. package/dist-lib/agent-identity.cjs +1 -1
  134. package/dist-lib/agent-sessions.cjs +1 -1
  135. package/dist-lib/attached-projects.cjs +1 -1
  136. package/dist-lib/auth/shared-session.cjs +1 -1
  137. package/dist-lib/backend-origin.cjs +1 -1
  138. package/dist-lib/beta.cjs +1 -1
  139. package/dist-lib/beta.mjs +1 -1
  140. package/dist-lib/bridge-constants.cjs +1 -1
  141. package/dist-lib/bridge-contract-input.cjs +1 -1
  142. package/dist-lib/bridge-contract-input.mjs +1 -1
  143. package/dist-lib/bridge-contract.cjs +1 -1
  144. package/dist-lib/bridge-contract.mjs +1 -1
  145. package/dist-lib/cli-constants.cjs +1 -1
  146. package/dist-lib/config.cjs +1 -1
  147. package/dist-lib/detox/index.cjs +1 -1
  148. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  149. package/dist-lib/home-paths.cjs +1 -1
  150. package/dist-lib/host/bridge-host.cjs +148 -134
  151. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  152. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  153. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  154. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  155. package/dist-lib/host/websocket-proxy.cjs +1 -1
  156. package/dist-lib/index.cjs +1 -1
  157. package/dist-lib/jump-to-source-babel.cjs +1 -1
  158. package/dist-lib/menu.cjs +1 -1
  159. package/dist-lib/menu.mjs +1 -1
  160. package/dist-lib/metro-production-bundle.cjs +1 -1
  161. package/dist-lib/metro-production-bundle.mjs +1 -1
  162. package/dist-lib/metro.cjs +1 -1
  163. package/dist-lib/profiles.cjs +1 -1
  164. package/dist-lib/public-brand.cjs +1 -1
  165. package/dist-lib/react-native-host-modules.cjs +1 -1
  166. package/dist-lib/react-native-host-modules.mjs +1 -1
  167. package/dist-lib/render-mode.cjs +1 -1
  168. package/dist-lib/scripts/dev-server-scanner.cjs +18 -4
  169. package/dist-lib/sdk.cjs +1 -1
  170. package/dist-lib/sdk.mjs +1 -1
  171. package/dist-lib/skills.cjs +217 -196
  172. package/dist-lib/vite.cjs +1 -1
  173. package/package.json +1 -1
  174. package/scripts/dev-server-scanner.ts +23 -5
  175. package/dist-cli/chunks/chunk-EWPAI4MO.js +0 -7
  176. package/dist-cli/chunks/chunk-V4EJJHF5.js +0 -4
  177. package/dist-cli/chunks/cli-version-APGT6GAT.js +0 -4
  178. package/dist-cli/chunks/control-O22Z3UJ5.js +0 -4
  179. package/dist-cli/chunks/daemon-PADUIMJV.js +0 -4
  180. package/dist-cli/chunks/drivers-ZFNX3T5Z.js +0 -4
  181. package/dist-cli/chunks/flow-VMLI7BYM.js +0 -4
  182. package/dist-cli/chunks/help-PKZCWHJJ.js +0 -4
  183. package/dist-cli/chunks/inspect-LT4MXK37.js +0 -4
  184. package/dist-cli/chunks/install-desktop-EXCFMXFS.js +0 -4
  185. package/dist-cli/chunks/privacy-54FIGXLT.js +0 -4
  186. package/dist-cli/chunks/reset-CGO52KBW.js +0 -4
  187. package/dist-cli/chunks/resolve-target-NNQCALDM.js +0 -4
  188. package/dist-cli/chunks/runtime-4EP6YJVL.js +0 -4
  189. package/dist-cli/chunks/setup-6XXEJQVF.js +0 -4
  190. package/dist-cli/chunks/store-AWUMOQUH.js +0 -4
  191. package/dist-cli/chunks/telemetry-W5ZDGWK6.js +0 -4
  192. package/dist-cli/chunks/upload-ZDV4BFED.js +0 -4
  193. package/dist-cli/chunks/welcome-IJ55EC7U.js +0 -5
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.375 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.376 | (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;
@@ -113,6 +113,7 @@ var import_child_process = require("child_process");
113
113
  var import_promises2 = require("fs/promises");
114
114
  var import_http = __toESM(require("http"), 1);
115
115
  var import_net = __toESM(require("net"), 1);
116
+ var import_node_fs2 = require("node:fs");
116
117
  var import_node_path3 = require("node:path");
117
118
 
118
119
  // src/backend-origin.ts
@@ -802,9 +803,22 @@ function makeResult(hostname, port, framework, owner) {
802
803
  };
803
804
  }
804
805
  function withRuntimeConfig(port, bundleUrl, projectCwd) {
805
- const knownApp = projectCwd ? optionalDemoAppsSync().find(
806
- (app) => app.preferredPort === port && (0, import_node_path3.resolve)(app.dir) === (0, import_node_path3.resolve)(projectCwd)
807
- ) : void 0;
806
+ let physicalProjectCwd;
807
+ if (projectCwd) {
808
+ try {
809
+ physicalProjectCwd = (0, import_node_fs2.realpathSync)((0, import_node_path3.resolve)(projectCwd));
810
+ } catch {
811
+ }
812
+ }
813
+ const knownApps = physicalProjectCwd ? optionalDemoAppsSync().filter((app) => {
814
+ try {
815
+ return (0, import_node_fs2.realpathSync)((0, import_node_path3.resolve)(app.dir)) === physicalProjectCwd;
816
+ } catch {
817
+ return false;
818
+ }
819
+ }) : [];
820
+ const exactKnownApps = knownApps.filter((app) => app.preferredPort === port);
821
+ const knownApp = exactKnownApps.length === 1 ? exactKnownApps[0] : exactKnownApps.length === 0 && knownApps.length === 1 ? knownApps[0] : void 0;
808
822
  const configured = knownApp?.runtimeConfig ? applySootSimConfigToUrl(bundleUrl, knownApp.runtimeConfig) : bundleUrl;
809
823
  return normalizeNativeDevBundleUrl(configured);
810
824
  }
@@ -1141,7 +1155,7 @@ var SOOTSIM_BRIDGE_SIM_CLOSE_CODE = 4001;
1141
1155
  var SOOTSIM_BRIDGE_SIM_CLOSE_REASON = "sootsim close";
1142
1156
 
1143
1157
  // src/cli-version.ts
1144
- var import_node_fs2 = require("node:fs");
1158
+ var import_node_fs3 = require("node:fs");
1145
1159
  var import_node_url2 = require("node:url");
1146
1160
 
1147
1161
  // src/public-brand.ts
@@ -1165,7 +1179,7 @@ function getCliVersion() {
1165
1179
  ];
1166
1180
  for (const resolve2 of candidates) {
1167
1181
  try {
1168
- const version = JSON.parse((0, import_node_fs2.readFileSync)(resolve2(), "utf8")).version;
1182
+ const version = JSON.parse((0, import_node_fs3.readFileSync)(resolve2(), "utf8")).version;
1169
1183
  if (typeof version === "string" && version) {
1170
1184
  cached2 = version;
1171
1185
  return cached2;
@@ -1179,7 +1193,7 @@ function getCliVersion() {
1179
1193
 
1180
1194
  // src/home-paths.ts
1181
1195
  var import_node_crypto = require("node:crypto");
1182
- var import_node_fs3 = __toESM(require("node:fs"), 1);
1196
+ var import_node_fs4 = __toESM(require("node:fs"), 1);
1183
1197
  var import_node_os = require("node:os");
1184
1198
  var import_node_path4 = __toESM(require("node:path"), 1);
1185
1199
  var SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
@@ -1201,7 +1215,7 @@ function isSootsimDevCheckout() {
1201
1215
  const argv1 = process.argv[1];
1202
1216
  if (!argv1) return false;
1203
1217
  try {
1204
- const real = import_node_fs3.default.realpathSync(argv1);
1218
+ const real = import_node_fs4.default.realpathSync(argv1);
1205
1219
  return real.includes(`${import_node_path4.default.sep}packages${import_node_path4.default.sep}sootsim${import_node_path4.default.sep}`);
1206
1220
  } catch {
1207
1221
  return false;
@@ -1248,7 +1262,7 @@ function configFilePath() {
1248
1262
  }
1249
1263
  function readSharedConfig() {
1250
1264
  try {
1251
- const raw = import_node_fs3.default.readFileSync(configFilePath(), "utf8");
1265
+ const raw = import_node_fs4.default.readFileSync(configFilePath(), "utf8");
1252
1266
  const parsed = JSON.parse(raw);
1253
1267
  return parsed && typeof parsed === "object" ? parsed : {};
1254
1268
  } catch {
@@ -1266,9 +1280,9 @@ function writeSharedConfig(patch) {
1266
1280
  };
1267
1281
  }
1268
1282
  const tmp = `${configFilePath()}.tmp`;
1269
- import_node_fs3.default.writeFileSync(tmp, `${JSON.stringify(next, null, 2)}
1283
+ import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(next, null, 2)}
1270
1284
  `, "utf8");
1271
- import_node_fs3.default.renameSync(tmp, configFilePath());
1285
+ import_node_fs4.default.renameSync(tmp, configFilePath());
1272
1286
  return next;
1273
1287
  }
1274
1288
  function runtimeUpgradeNoticePath() {
@@ -1277,28 +1291,28 @@ function runtimeUpgradeNoticePath() {
1277
1291
  function writeRuntimeUpgradeNotice(notice) {
1278
1292
  ensureSootsimHome();
1279
1293
  const tmp = `${runtimeUpgradeNoticePath()}.tmp`;
1280
- import_node_fs3.default.writeFileSync(tmp, `${JSON.stringify(notice)}
1294
+ import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(notice)}
1281
1295
  `, "utf8");
1282
- import_node_fs3.default.renameSync(tmp, runtimeUpgradeNoticePath());
1296
+ import_node_fs4.default.renameSync(tmp, runtimeUpgradeNoticePath());
1283
1297
  }
1284
1298
  function ensureSootsimHome() {
1285
- import_node_fs3.default.mkdirSync(sootsimHomeDir(), { recursive: true });
1286
- import_node_fs3.default.mkdirSync(runtimesDir(), { recursive: true });
1287
- import_node_fs3.default.mkdirSync(electronDir(), { recursive: true });
1288
- import_node_fs3.default.mkdirSync(profilesDir(), { recursive: true });
1289
- import_node_fs3.default.mkdirSync(cacheDir(), { recursive: true });
1299
+ import_node_fs4.default.mkdirSync(sootsimHomeDir(), { recursive: true });
1300
+ import_node_fs4.default.mkdirSync(runtimesDir(), { recursive: true });
1301
+ import_node_fs4.default.mkdirSync(electronDir(), { recursive: true });
1302
+ import_node_fs4.default.mkdirSync(profilesDir(), { recursive: true });
1303
+ import_node_fs4.default.mkdirSync(cacheDir(), { recursive: true });
1290
1304
  }
1291
1305
  function readActiveRuntime() {
1292
1306
  try {
1293
- const value = import_node_fs3.default.readFileSync(activeRuntimeFile(), "utf8").trim();
1307
+ const value = import_node_fs4.default.readFileSync(activeRuntimeFile(), "utf8").trim();
1294
1308
  return value.length > 0 ? value : null;
1295
1309
  } catch {
1296
1310
  return null;
1297
1311
  }
1298
1312
  }
1299
1313
  function writeActiveRuntime(version) {
1300
- import_node_fs3.default.mkdirSync(runtimesDir(), { recursive: true });
1301
- import_node_fs3.default.writeFileSync(activeRuntimeFile(), `${version}
1314
+ import_node_fs4.default.mkdirSync(runtimesDir(), { recursive: true });
1315
+ import_node_fs4.default.writeFileSync(activeRuntimeFile(), `${version}
1302
1316
  `, "utf8");
1303
1317
  }
1304
1318
  function activeRuntimeDir() {
@@ -1306,7 +1320,7 @@ function activeRuntimeDir() {
1306
1320
  if (!version) return null;
1307
1321
  const dir = runtimeDir(version);
1308
1322
  try {
1309
- if (import_node_fs3.default.statSync(dir).isDirectory()) return dir;
1323
+ if (import_node_fs4.default.statSync(dir).isDirectory()) return dir;
1310
1324
  } catch {
1311
1325
  }
1312
1326
  return null;
@@ -1315,10 +1329,10 @@ var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
1315
1329
  var DAEMON_CLAIM_STALE_MS = 3e4;
1316
1330
  function readDaemonLockfile() {
1317
1331
  try {
1318
- const fd = import_node_fs3.default.openSync(daemonLockfilePath(), "r");
1332
+ const fd = import_node_fs4.default.openSync(daemonLockfilePath(), "r");
1319
1333
  try {
1320
1334
  const buf = Buffer.alloc(DAEMON_LOCKFILE_MAX_BYTES);
1321
- const bytesRead = import_node_fs3.default.readSync(fd, buf, 0, DAEMON_LOCKFILE_MAX_BYTES, 0);
1335
+ const bytesRead = import_node_fs4.default.readSync(fd, buf, 0, DAEMON_LOCKFILE_MAX_BYTES, 0);
1322
1336
  const raw = buf.subarray(0, bytesRead).toString("utf8");
1323
1337
  const parsed = JSON.parse(raw);
1324
1338
  if (parsed && parsed.schema === 1 && typeof parsed.pid === "number" && typeof parsed.bridgePort === "number" && typeof parsed.runtimePort === "number" && typeof parsed.startedAt === "number" && typeof parsed.heartbeatAt === "number" && (parsed.servedRuntimes === void 0 || Array.isArray(parsed.servedRuntimes) && parsed.servedRuntimes.every((version) => typeof version === "string"))) {
@@ -1326,7 +1340,7 @@ function readDaemonLockfile() {
1326
1340
  }
1327
1341
  return null;
1328
1342
  } finally {
1329
- import_node_fs3.default.closeSync(fd);
1343
+ import_node_fs4.default.closeSync(fd);
1330
1344
  }
1331
1345
  } catch {
1332
1346
  return null;
@@ -1365,28 +1379,28 @@ function writeDaemonLockfile(data) {
1365
1379
  throw new Error("refusing to overwrite another rnx daemon lockfile");
1366
1380
  }
1367
1381
  const tmp = `${lockfilePath}.${data.pid}.${(0, import_node_crypto.randomUUID)()}.tmp`;
1368
- import_node_fs3.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
1382
+ import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
1369
1383
  `, "utf8");
1370
1384
  try {
1371
1385
  const current = readDaemonLockfile();
1372
1386
  if (!current || !sameDaemonOwner(current, data)) {
1373
1387
  throw new Error("rnx daemon lock ownership changed during heartbeat");
1374
1388
  }
1375
- import_node_fs3.default.renameSync(tmp, lockfilePath);
1389
+ import_node_fs4.default.renameSync(tmp, lockfilePath);
1376
1390
  } finally {
1377
1391
  try {
1378
- import_node_fs3.default.unlinkSync(tmp);
1392
+ import_node_fs4.default.unlinkSync(tmp);
1379
1393
  } catch {
1380
1394
  }
1381
1395
  }
1382
1396
  }
1383
1397
  function writeDevBridgeLockfile(data) {
1384
- import_node_fs3.default.mkdirSync(devBridgesDir(), { recursive: true });
1398
+ import_node_fs4.default.mkdirSync(devBridgesDir(), { recursive: true });
1385
1399
  const lockfilePath = devBridgeLockfilePath(data.bridgePort);
1386
1400
  const tmp = `${lockfilePath}.${data.pid}.tmp`;
1387
- import_node_fs3.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
1401
+ import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
1388
1402
  `, "utf8");
1389
- import_node_fs3.default.renameSync(tmp, lockfilePath);
1403
+ import_node_fs4.default.renameSync(tmp, lockfilePath);
1390
1404
  }
1391
1405
  function sameDaemonOwner(left, right) {
1392
1406
  return left.pid === right.pid && left.startedAt === right.startedAt;
@@ -1397,17 +1411,17 @@ function isAlreadyExists(error) {
1397
1411
  function createDaemonLockfileExclusive(data) {
1398
1412
  const lockfilePath = daemonLockfilePath();
1399
1413
  const tmp = `${lockfilePath}.${data.pid}.${(0, import_node_crypto.randomUUID)()}.claim`;
1400
- import_node_fs3.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
1414
+ import_node_fs4.default.writeFileSync(tmp, `${JSON.stringify(data, null, 2)}
1401
1415
  `, "utf8");
1402
1416
  try {
1403
- import_node_fs3.default.linkSync(tmp, lockfilePath);
1417
+ import_node_fs4.default.linkSync(tmp, lockfilePath);
1404
1418
  return true;
1405
1419
  } catch (error) {
1406
1420
  if (isAlreadyExists(error)) return false;
1407
1421
  throw error;
1408
1422
  } finally {
1409
1423
  try {
1410
- import_node_fs3.default.unlinkSync(tmp);
1424
+ import_node_fs4.default.unlinkSync(tmp);
1411
1425
  } catch {
1412
1426
  }
1413
1427
  }
@@ -1431,7 +1445,7 @@ function parseDaemonClaim(raw) {
1431
1445
  }
1432
1446
  function readDaemonClaim() {
1433
1447
  try {
1434
- return parseDaemonClaim(import_node_fs3.default.readFileSync(daemonClaimPath(), "utf8"));
1448
+ return parseDaemonClaim(import_node_fs4.default.readFileSync(daemonClaimPath(), "utf8"));
1435
1449
  } catch {
1436
1450
  return null;
1437
1451
  }
@@ -1455,7 +1469,7 @@ function acquireDaemonClaim(data) {
1455
1469
  `;
1456
1470
  for (let attempt = 0; attempt < 8; attempt++) {
1457
1471
  try {
1458
- import_node_fs3.default.writeFileSync(daemonClaimPath(), serialized, { encoding: "utf8", flag: "wx" });
1472
+ import_node_fs4.default.writeFileSync(daemonClaimPath(), serialized, { encoding: "utf8", flag: "wx" });
1459
1473
  return true;
1460
1474
  } catch (error) {
1461
1475
  if (!isAlreadyExists(error)) throw error;
@@ -1465,11 +1479,11 @@ function acquireDaemonClaim(data) {
1465
1479
  if (existing && isDaemonClaimFresh(existing)) return false;
1466
1480
  let before;
1467
1481
  try {
1468
- before = import_node_fs3.default.readFileSync(daemonClaimPath(), "utf8");
1482
+ before = import_node_fs4.default.readFileSync(daemonClaimPath(), "utf8");
1469
1483
  const latest = parseDaemonClaim(before);
1470
1484
  if (latest && isDaemonClaimFresh(latest)) return false;
1471
- if (import_node_fs3.default.readFileSync(daemonClaimPath(), "utf8") !== before) continue;
1472
- import_node_fs3.default.unlinkSync(daemonClaimPath());
1485
+ if (import_node_fs4.default.readFileSync(daemonClaimPath(), "utf8") !== before) continue;
1486
+ import_node_fs4.default.unlinkSync(daemonClaimPath());
1473
1487
  } catch {
1474
1488
  }
1475
1489
  }
@@ -1479,7 +1493,7 @@ function releaseDaemonClaim(owner) {
1479
1493
  try {
1480
1494
  const claim = readDaemonClaim();
1481
1495
  if (!claim || !sameDaemonOwner(claim, owner)) return;
1482
- import_node_fs3.default.unlinkSync(daemonClaimPath());
1496
+ import_node_fs4.default.unlinkSync(daemonClaimPath());
1483
1497
  } catch {
1484
1498
  }
1485
1499
  }
@@ -1498,7 +1512,7 @@ function claimDaemonLockfile(data) {
1498
1512
  if (!latest || !sameDaemonOwner(latest, existing)) return false;
1499
1513
  if (isDaemonLockfileFresh(latest)) return false;
1500
1514
  try {
1501
- import_node_fs3.default.unlinkSync(daemonLockfilePath());
1515
+ import_node_fs4.default.unlinkSync(daemonLockfilePath());
1502
1516
  } catch {
1503
1517
  return false;
1504
1518
  }
@@ -1512,16 +1526,16 @@ function removeDaemonLockfile(owner) {
1512
1526
  try {
1513
1527
  const lockfile = readDaemonLockfile();
1514
1528
  if (!lockfile || !sameDaemonOwner(lockfile, owner)) return;
1515
- import_node_fs3.default.unlinkSync(daemonLockfilePath());
1529
+ import_node_fs4.default.unlinkSync(daemonLockfilePath());
1516
1530
  } catch {
1517
1531
  }
1518
1532
  }
1519
1533
  function removeDevBridgeLockfile(owner) {
1520
1534
  try {
1521
1535
  const lockfilePath = devBridgeLockfilePath(owner.bridgePort);
1522
- const lockfile = parseDevBridgeLockfile(import_node_fs3.default.readFileSync(lockfilePath, "utf8"));
1536
+ const lockfile = parseDevBridgeLockfile(import_node_fs4.default.readFileSync(lockfilePath, "utf8"));
1523
1537
  if (lockfile?.pid !== owner.pid || lockfile.startedAt !== owner.startedAt) return;
1524
- import_node_fs3.default.unlinkSync(lockfilePath);
1538
+ import_node_fs4.default.unlinkSync(lockfilePath);
1525
1539
  } catch {
1526
1540
  }
1527
1541
  }
@@ -1534,21 +1548,21 @@ var import_url = require("url");
1534
1548
  // ../contrast-runtime-delivery/src/index.ts
1535
1549
  var import_node_child_process = require("node:child_process");
1536
1550
  var import_node_crypto2 = __toESM(require("node:crypto"), 1);
1537
- var import_node_fs5 = __toESM(require("node:fs"), 1);
1551
+ var import_node_fs6 = __toESM(require("node:fs"), 1);
1538
1552
  var import_node_os2 = __toESM(require("node:os"), 1);
1539
1553
  var import_node_path6 = __toESM(require("node:path"), 1);
1540
1554
  var import_node_stream = require("node:stream");
1541
1555
  var import_promises3 = require("node:stream/promises");
1542
1556
 
1543
1557
  // ../contrast-runtime-delivery/src/product.ts
1544
- var import_node_fs4 = __toESM(require("node:fs"), 1);
1558
+ var import_node_fs5 = __toESM(require("node:fs"), 1);
1545
1559
  var import_node_path5 = __toESM(require("node:path"), 1);
1546
1560
  function isValidRuntimeVersion(value) {
1547
1561
  return value.length <= 100 && /^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(value);
1548
1562
  }
1549
1563
  function listInstalledRuntimes(product) {
1550
1564
  try {
1551
- return import_node_fs4.default.readdirSync(product.runtimesDir(), { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort(compareSemver);
1565
+ return import_node_fs5.default.readdirSync(product.runtimesDir(), { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort(compareSemver);
1552
1566
  } catch {
1553
1567
  return [];
1554
1568
  }
@@ -1584,7 +1598,7 @@ function createRuntimeDelivery(product) {
1584
1598
  function readConfig() {
1585
1599
  try {
1586
1600
  const parsed = JSON.parse(
1587
- import_node_fs5.default.readFileSync(product.configFile(), "utf8")
1601
+ import_node_fs6.default.readFileSync(product.configFile(), "utf8")
1588
1602
  );
1589
1603
  return parsed && typeof parsed === "object" ? parsed : {};
1590
1604
  } catch {
@@ -1657,7 +1671,7 @@ function createRuntimeDelivery(product) {
1657
1671
  const setActive = opts.setActive !== false;
1658
1672
  const protectVersions = [version, ...opts.protectVersions ?? []];
1659
1673
  pruneLocalRetention({ protectVersions });
1660
- if (!opts.force && import_node_fs5.default.existsSync(import_node_path6.default.join(destDir, product.installedMarker))) {
1674
+ if (!opts.force && import_node_fs6.default.existsSync(import_node_path6.default.join(destDir, product.installedMarker))) {
1661
1675
  if (setActive) product.writeActiveRuntime(version);
1662
1676
  pruneLocalRetention({ protectVersions });
1663
1677
  return {
@@ -1671,7 +1685,7 @@ function createRuntimeDelivery(product) {
1671
1685
  };
1672
1686
  }
1673
1687
  const tarUrl = entry.tarball || tarballUrl(version, cdnOrigin);
1674
- const downloadDir = import_node_fs5.default.mkdtempSync(
1688
+ const downloadDir = import_node_fs6.default.mkdtempSync(
1675
1689
  import_node_path6.default.join(import_node_os2.default.tmpdir(), `${product.id}-runtime-download-`)
1676
1690
  );
1677
1691
  const runtimeArchivePath = import_node_path6.default.join(
@@ -1682,7 +1696,7 @@ function createRuntimeDelivery(product) {
1682
1696
  import_node_path6.default.dirname(destDir),
1683
1697
  `.installing-${version}-${process.pid}`
1684
1698
  );
1685
- import_node_fs5.default.rmSync(tmpDir, { recursive: true, force: true });
1699
+ import_node_fs6.default.rmSync(tmpDir, { recursive: true, force: true });
1686
1700
  try {
1687
1701
  process.stderr.write(`${product.id}: downloading runtime ${version}\u2026
1688
1702
  `);
@@ -1695,20 +1709,20 @@ function createRuntimeDelivery(product) {
1695
1709
  `sha256 mismatch for runtime ${version}: expected ${entry.sha256}, actual ${actualSha}`
1696
1710
  );
1697
1711
  }
1698
- import_node_fs5.default.mkdirSync(tmpDir, { recursive: true });
1712
+ import_node_fs6.default.mkdirSync(tmpDir, { recursive: true });
1699
1713
  await extractTarball(runtimeArchivePath, tmpDir);
1700
- if (!import_node_fs5.default.existsSync(import_node_path6.default.join(tmpDir, product.installedMarker))) {
1714
+ if (!import_node_fs6.default.existsSync(import_node_path6.default.join(tmpDir, product.installedMarker))) {
1701
1715
  throw new Error(
1702
1716
  `extracted tarball for runtime ${version} is missing ${product.installedMarker}`
1703
1717
  );
1704
1718
  }
1705
- import_node_fs5.default.rmSync(destDir, { recursive: true, force: true });
1706
- import_node_fs5.default.renameSync(tmpDir, destDir);
1719
+ import_node_fs6.default.rmSync(destDir, { recursive: true, force: true });
1720
+ import_node_fs6.default.renameSync(tmpDir, destDir);
1707
1721
  } catch (err) {
1708
- import_node_fs5.default.rmSync(tmpDir, { recursive: true, force: true });
1722
+ import_node_fs6.default.rmSync(tmpDir, { recursive: true, force: true });
1709
1723
  throw err;
1710
1724
  } finally {
1711
- import_node_fs5.default.rmSync(downloadDir, { recursive: true, force: true });
1725
+ import_node_fs6.default.rmSync(downloadDir, { recursive: true, force: true });
1712
1726
  }
1713
1727
  if (setActive) product.writeActiveRuntime(version);
1714
1728
  pruneLocalRetention({ protectVersions });
@@ -1730,7 +1744,7 @@ function createRuntimeDelivery(product) {
1730
1744
  const pin = resolvePin();
1731
1745
  if (pin) {
1732
1746
  const activeVersion2 = product.readActiveRuntime();
1733
- const pinInstalled = import_node_fs5.default.existsSync(
1747
+ const pinInstalled = import_node_fs6.default.existsSync(
1734
1748
  import_node_path6.default.join(product.runtimeDir(pin), product.installedMarker)
1735
1749
  );
1736
1750
  if (activeVersion2 === pin && pinInstalled) {
@@ -1780,7 +1794,7 @@ function createRuntimeDelivery(product) {
1780
1794
  }
1781
1795
  const activeVersion = product.readActiveRuntime();
1782
1796
  const activeDir = activeVersion ? product.runtimeDir(activeVersion) : null;
1783
- const activeInstalled = activeDir ? import_node_fs5.default.existsSync(import_node_path6.default.join(activeDir, product.installedMarker)) : false;
1797
+ const activeInstalled = activeDir ? import_node_fs6.default.existsSync(import_node_path6.default.join(activeDir, product.installedMarker)) : false;
1784
1798
  const shouldInstall = !activeVersion || !activeInstalled || compareSemver(latestVersion, activeVersion) > 0;
1785
1799
  if (!shouldInstall) {
1786
1800
  return {
@@ -1855,7 +1869,7 @@ function createRuntimeDelivery(product) {
1855
1869
  let removeCacheFiles = [];
1856
1870
  if (markerOffset >= 0) {
1857
1871
  try {
1858
- removeCacheFiles = import_node_fs5.default.readdirSync(product.cacheDir(), { withFileTypes: true }).filter((entry) => {
1872
+ removeCacheFiles = import_node_fs6.default.readdirSync(product.cacheDir(), { withFileTypes: true }).filter((entry) => {
1859
1873
  if (!entry.isFile()) return false;
1860
1874
  const complete = entry.name.startsWith(cachePrefix) && entry.name.endsWith(cacheSuffix);
1861
1875
  const partial = entry.name.startsWith(cachePrefix) && entry.name.endsWith(`${cacheSuffix}.partial`);
@@ -1875,10 +1889,10 @@ function createRuntimeDelivery(product) {
1875
1889
  function pruneLocalRetention(opts = {}) {
1876
1890
  const plan = planLocalRetention(opts);
1877
1891
  for (const version of plan.removeVersions) {
1878
- import_node_fs5.default.rmSync(product.runtimeDir(version), { recursive: true, force: true });
1892
+ import_node_fs6.default.rmSync(product.runtimeDir(version), { recursive: true, force: true });
1879
1893
  }
1880
1894
  for (const cacheFile of plan.removeCacheFiles) {
1881
- import_node_fs5.default.rmSync(cacheFile, { force: true });
1895
+ import_node_fs6.default.rmSync(cacheFile, { force: true });
1882
1896
  }
1883
1897
  return plan;
1884
1898
  }
@@ -1904,17 +1918,17 @@ async function downloadToFile(url, destPath) {
1904
1918
  if (!res.ok || !res.body) {
1905
1919
  throw new Error(`download failed: ${res.status} ${res.statusText} (${url})`);
1906
1920
  }
1907
- import_node_fs5.default.mkdirSync(import_node_path6.default.dirname(destPath), { recursive: true });
1921
+ import_node_fs6.default.mkdirSync(import_node_path6.default.dirname(destPath), { recursive: true });
1908
1922
  const tmp = `${destPath}.partial`;
1909
1923
  try {
1910
1924
  await (0, import_promises3.pipeline)(
1911
1925
  import_node_stream.Readable.fromWeb(res.body),
1912
- import_node_fs5.default.createWriteStream(tmp)
1926
+ import_node_fs6.default.createWriteStream(tmp)
1913
1927
  );
1914
- import_node_fs5.default.renameSync(tmp, destPath);
1928
+ import_node_fs6.default.renameSync(tmp, destPath);
1915
1929
  } catch (err) {
1916
1930
  try {
1917
- import_node_fs5.default.unlinkSync(tmp);
1931
+ import_node_fs6.default.unlinkSync(tmp);
1918
1932
  } catch {
1919
1933
  }
1920
1934
  throw err;
@@ -1923,7 +1937,7 @@ async function downloadToFile(url, destPath) {
1923
1937
  function sha256File(filePath) {
1924
1938
  return new Promise((resolve2, reject) => {
1925
1939
  const hash = import_node_crypto2.default.createHash("sha256");
1926
- const stream = import_node_fs5.default.createReadStream(filePath);
1940
+ const stream = import_node_fs6.default.createReadStream(filePath);
1927
1941
  stream.on("data", (chunk) => hash.update(chunk));
1928
1942
  stream.on("error", reject);
1929
1943
  stream.on("end", () => resolve2(hash.digest("hex")));
@@ -2033,13 +2047,13 @@ var SOOTSIM_RUNTIME_PRODUCT = {
2033
2047
  var sootsimRuntime = createRuntimeDelivery(SOOTSIM_RUNTIME_PRODUCT);
2034
2048
 
2035
2049
  // src/host/agent-host.ts
2036
- var import_node_fs8 = __toESM(require("node:fs"), 1);
2050
+ var import_node_fs9 = __toESM(require("node:fs"), 1);
2037
2051
  var import_node_path9 = __toESM(require("node:path"), 1);
2038
2052
 
2039
2053
  // src/agent-sessions.ts
2040
2054
  var import_node_child_process2 = require("node:child_process");
2041
2055
  var import_node_crypto4 = require("node:crypto");
2042
- var import_node_fs7 = __toESM(require("node:fs"), 1);
2056
+ var import_node_fs8 = __toESM(require("node:fs"), 1);
2043
2057
  var import_node_path8 = __toESM(require("node:path"), 1);
2044
2058
  var import_node_readline = __toESM(require("node:readline"), 1);
2045
2059
 
@@ -2084,7 +2098,7 @@ function encodeAgentPromptEnvelope(input) {
2084
2098
 
2085
2099
  // src/attached-projects.ts
2086
2100
  var import_node_crypto3 = require("node:crypto");
2087
- var import_node_fs6 = __toESM(require("node:fs"), 1);
2101
+ var import_node_fs7 = __toESM(require("node:fs"), 1);
2088
2102
  var import_node_path7 = __toESM(require("node:path"), 1);
2089
2103
  var overrideDir = null;
2090
2104
  function userDataDir() {
@@ -2111,7 +2125,7 @@ function loadStore() {
2111
2125
  const file = storeFile();
2112
2126
  let raw;
2113
2127
  try {
2114
- raw = import_node_fs6.default.readFileSync(file, "utf8");
2128
+ raw = import_node_fs7.default.readFileSync(file, "utf8");
2115
2129
  } catch (err) {
2116
2130
  if (err.code === "ENOENT") return cloneEmpty();
2117
2131
  throw err;
@@ -2128,7 +2142,7 @@ function loadStore() {
2128
2142
  } catch (err) {
2129
2143
  const quarantine = `${file}.corrupt-${Date.now()}`;
2130
2144
  try {
2131
- import_node_fs6.default.renameSync(file, quarantine);
2145
+ import_node_fs7.default.renameSync(file, quarantine);
2132
2146
  console.warn(
2133
2147
  `[sootsim] attached-projects.json was unparseable; quarantined to ${quarantine}. original error: ${err.message}`
2134
2148
  );
@@ -2139,16 +2153,16 @@ function loadStore() {
2139
2153
  }
2140
2154
  function writeStore(store) {
2141
2155
  const file = storeFile();
2142
- import_node_fs6.default.mkdirSync(import_node_path7.default.dirname(file), { recursive: true });
2156
+ import_node_fs7.default.mkdirSync(import_node_path7.default.dirname(file), { recursive: true });
2143
2157
  const tmp = `${file}.tmp-${process.pid}-${Date.now()}`;
2144
- const fd = import_node_fs6.default.openSync(tmp, "w", 384);
2158
+ const fd = import_node_fs7.default.openSync(tmp, "w", 384);
2145
2159
  try {
2146
- import_node_fs6.default.writeFileSync(fd, JSON.stringify(store, null, 2));
2147
- import_node_fs6.default.fsyncSync(fd);
2160
+ import_node_fs7.default.writeFileSync(fd, JSON.stringify(store, null, 2));
2161
+ import_node_fs7.default.fsyncSync(fd);
2148
2162
  } finally {
2149
- import_node_fs6.default.closeSync(fd);
2163
+ import_node_fs7.default.closeSync(fd);
2150
2164
  }
2151
- import_node_fs6.default.renameSync(tmp, file);
2165
+ import_node_fs7.default.renameSync(tmp, file);
2152
2166
  }
2153
2167
  function mutateStore(fn) {
2154
2168
  const store = loadStore();
@@ -2335,7 +2349,7 @@ async function seedFromDemoAppRegistry() {
2335
2349
  if (apps.length === 0) return;
2336
2350
  mutateStore((store) => {
2337
2351
  for (const app of apps) {
2338
- if (!import_node_fs6.default.existsSync(app.dir)) continue;
2352
+ if (!import_node_fs7.default.existsSync(app.dir)) continue;
2339
2353
  const cwd = import_node_path7.default.resolve(app.dir);
2340
2354
  const id = projectIdForCwd(cwd);
2341
2355
  if (store.attachedProjects.some((p) => p.id === id)) continue;
@@ -2379,7 +2393,7 @@ function pidIsAlive(pid, sessionId) {
2379
2393
  return false;
2380
2394
  }
2381
2395
  if (sessionId) {
2382
- if (!import_node_fs7.default.existsSync(sessionDir(sessionId))) return false;
2396
+ if (!import_node_fs8.default.existsSync(sessionDir(sessionId))) return false;
2383
2397
  }
2384
2398
  return true;
2385
2399
  }
@@ -2395,7 +2409,7 @@ function resolveSootsimInvocation() {
2395
2409
  import_node_path8.default.join(resourcesPath, "bin", `sootsim-${process.platform}-${process.arch}`)
2396
2410
  ];
2397
2411
  for (const c of candidates) {
2398
- if (import_node_fs7.default.existsSync(c)) return { cmd: c, prefixArgs: [] };
2412
+ if (import_node_fs8.default.existsSync(c)) return { cmd: c, prefixArgs: [] };
2399
2413
  }
2400
2414
  }
2401
2415
  }
@@ -2419,14 +2433,14 @@ function tryWorkspaceSootsim() {
2419
2433
  if (!sootsimDir) return null;
2420
2434
  const binaryName = `sootsim-${process.platform}-${process.arch}`;
2421
2435
  const distBinary = import_node_path8.default.join(sootsimDir, "dist-bin", binaryName);
2422
- if (import_node_fs7.default.existsSync(distBinary)) return { cmd: distBinary, prefixArgs: [] };
2436
+ if (import_node_fs8.default.existsSync(distBinary)) return { cmd: distBinary, prefixArgs: [] };
2423
2437
  const distBin = import_node_path8.default.join(sootsimDir, "dist-cli", "bin.js");
2424
- if (import_node_fs7.default.existsSync(distBin)) {
2438
+ if (import_node_fs8.default.existsSync(distBin)) {
2425
2439
  try {
2426
2440
  const src = import_node_path8.default.join(sootsimDir, "cli", "commands", "agent-wrapper.ts");
2427
- if (import_node_fs7.default.existsSync(src)) {
2428
- const srcMtime = import_node_fs7.default.statSync(src).mtimeMs;
2429
- const buildMtime = import_node_fs7.default.statSync(distBin).mtimeMs;
2441
+ if (import_node_fs8.default.existsSync(src)) {
2442
+ const srcMtime = import_node_fs8.default.statSync(src).mtimeMs;
2443
+ const buildMtime = import_node_fs8.default.statSync(distBin).mtimeMs;
2430
2444
  if (buildMtime < srcMtime) {
2431
2445
  console.warn(
2432
2446
  `[rnx] dist-cli/bin.js is older than agent-wrapper.ts \u2014 rebuild with \`bun run --cwd packages/sootsim build:cli\`.`
@@ -2454,8 +2468,8 @@ function resolveSootsimPackageDir() {
2454
2468
  for (let i = 0; i < 8; i++) {
2455
2469
  const pkg = import_node_path8.default.join(cur, "package.json");
2456
2470
  try {
2457
- if (import_node_fs7.default.existsSync(pkg)) {
2458
- const parsed = JSON.parse(import_node_fs7.default.readFileSync(pkg, "utf8"));
2471
+ if (import_node_fs8.default.existsSync(pkg)) {
2472
+ const parsed = JSON.parse(import_node_fs8.default.readFileSync(pkg, "utf8"));
2459
2473
  if (parsed.name === rnxPublicBrand.packageName) return cur;
2460
2474
  }
2461
2475
  } catch {
@@ -2477,9 +2491,9 @@ function fileFromImportMeta() {
2477
2491
  }
2478
2492
  async function withStartLock(projectId, provider, fn) {
2479
2493
  const lockDir = import_node_path8.default.join(getUserDataDir(), "locks");
2480
- import_node_fs7.default.mkdirSync(lockDir, { recursive: true });
2494
+ import_node_fs8.default.mkdirSync(lockDir, { recursive: true });
2481
2495
  try {
2482
- import_node_fs7.default.chmodSync(lockDir, 448);
2496
+ import_node_fs8.default.chmodSync(lockDir, 448);
2483
2497
  } catch {
2484
2498
  }
2485
2499
  const lockPath = import_node_path8.default.join(lockDir, `start-${projectId}-${provider}.lock`);
@@ -2487,17 +2501,17 @@ async function withStartLock(projectId, provider, fn) {
2487
2501
  let fd = null;
2488
2502
  while (fd === null) {
2489
2503
  try {
2490
- fd = import_node_fs7.default.openSync(
2504
+ fd = import_node_fs8.default.openSync(
2491
2505
  lockPath,
2492
- import_node_fs7.constants.O_WRONLY | import_node_fs7.constants.O_CREAT | import_node_fs7.constants.O_EXCL,
2506
+ import_node_fs8.constants.O_WRONLY | import_node_fs8.constants.O_CREAT | import_node_fs8.constants.O_EXCL,
2493
2507
  384
2494
2508
  );
2495
2509
  } catch (err) {
2496
2510
  if (err.code !== "EEXIST") throw err;
2497
2511
  try {
2498
- const stale = Number(import_node_fs7.default.readFileSync(lockPath, "utf8").trim());
2512
+ const stale = Number(import_node_fs8.default.readFileSync(lockPath, "utf8").trim());
2499
2513
  if (stale && !isProcessAlive(stale)) {
2500
- import_node_fs7.default.unlinkSync(lockPath);
2514
+ import_node_fs8.default.unlinkSync(lockPath);
2501
2515
  continue;
2502
2516
  }
2503
2517
  } catch {
@@ -2511,15 +2525,15 @@ async function withStartLock(projectId, provider, fn) {
2511
2525
  }
2512
2526
  }
2513
2527
  try {
2514
- import_node_fs7.default.writeFileSync(fd, String(process.pid));
2528
+ import_node_fs8.default.writeFileSync(fd, String(process.pid));
2515
2529
  return await fn();
2516
2530
  } finally {
2517
2531
  try {
2518
- import_node_fs7.default.closeSync(fd);
2532
+ import_node_fs8.default.closeSync(fd);
2519
2533
  } catch {
2520
2534
  }
2521
2535
  try {
2522
- import_node_fs7.default.unlinkSync(lockPath);
2536
+ import_node_fs8.default.unlinkSync(lockPath);
2523
2537
  } catch {
2524
2538
  }
2525
2539
  }
@@ -2534,24 +2548,24 @@ function isProcessAlive(pid) {
2534
2548
  }
2535
2549
  function mkfifoSync(p) {
2536
2550
  const parent = import_node_path8.default.dirname(p);
2537
- import_node_fs7.default.mkdirSync(parent, { recursive: true });
2551
+ import_node_fs8.default.mkdirSync(parent, { recursive: true });
2538
2552
  try {
2539
- import_node_fs7.default.chmodSync(parent, 448);
2553
+ import_node_fs8.default.chmodSync(parent, 448);
2540
2554
  } catch {
2541
2555
  }
2542
- if (import_node_fs7.default.existsSync(p)) {
2556
+ if (import_node_fs8.default.existsSync(p)) {
2543
2557
  try {
2544
- const stat2 = import_node_fs7.default.statSync(p);
2558
+ const stat2 = import_node_fs8.default.statSync(p);
2545
2559
  if (stat2.isFIFO()) {
2546
2560
  try {
2547
- import_node_fs7.default.chmodSync(p, 384);
2561
+ import_node_fs8.default.chmodSync(p, 384);
2548
2562
  } catch {
2549
2563
  }
2550
2564
  return;
2551
2565
  }
2552
- import_node_fs7.default.unlinkSync(p);
2566
+ import_node_fs8.default.unlinkSync(p);
2553
2567
  } catch {
2554
- import_node_fs7.default.unlinkSync(p);
2568
+ import_node_fs8.default.unlinkSync(p);
2555
2569
  }
2556
2570
  }
2557
2571
  const result = (0, import_node_child_process2.spawnSync)("mkfifo", ["-m", "600", p]);
@@ -2599,9 +2613,9 @@ async function startSession(opts) {
2599
2613
  mkfifoSync(promptIn);
2600
2614
  mkfifoSync(eventsOut);
2601
2615
  const transcriptDir = import_node_path8.default.dirname(transcript);
2602
- import_node_fs7.default.mkdirSync(transcriptDir, { recursive: true });
2616
+ import_node_fs8.default.mkdirSync(transcriptDir, { recursive: true });
2603
2617
  try {
2604
- import_node_fs7.default.chmodSync(transcriptDir, 448);
2618
+ import_node_fs8.default.chmodSync(transcriptDir, 448);
2605
2619
  } catch {
2606
2620
  }
2607
2621
  const { cmd, prefixArgs } = resolveSootsimInvocation();
@@ -2652,7 +2666,7 @@ async function startSession(opts) {
2652
2666
  }
2653
2667
  }
2654
2668
  try {
2655
- import_node_fs7.default.rmSync(sessionDir(session.id), { recursive: true, force: true });
2669
+ import_node_fs8.default.rmSync(sessionDir(session.id), { recursive: true, force: true });
2656
2670
  } catch {
2657
2671
  }
2658
2672
  updateSessionStatus(session.id, { status: "ended" });
@@ -2680,18 +2694,18 @@ async function sendPrompt(sessionId, prompt) {
2680
2694
  );
2681
2695
  }
2682
2696
  const fifo = promptFifoPath(sessionId);
2683
- if (!import_node_fs7.default.existsSync(fifo)) {
2697
+ if (!import_node_fs8.default.existsSync(fifo)) {
2684
2698
  throw new AgentSessionError("NO_FIFO", `prompt FIFO missing: ${fifo}`);
2685
2699
  }
2686
- const fd = import_node_fs7.default.openSync(fifo, import_node_fs7.constants.O_WRONLY);
2700
+ const fd = import_node_fs8.default.openSync(fifo, import_node_fs8.constants.O_WRONLY);
2687
2701
  try {
2688
2702
  const wireText = encodeAgentPromptEnvelope(prompt);
2689
2703
  if (!wireText) {
2690
2704
  throw new AgentSessionError("EMPTY_PROMPT", "prompt text is empty");
2691
2705
  }
2692
- import_node_fs7.default.writeSync(fd, wireText + "\n");
2706
+ import_node_fs8.default.writeSync(fd, wireText + "\n");
2693
2707
  } finally {
2694
- import_node_fs7.default.closeSync(fd);
2708
+ import_node_fs8.default.closeSync(fd);
2695
2709
  }
2696
2710
  updateSessionStatus(sessionId, {
2697
2711
  lastPrompt: prompt.displayText ?? prompt.text,
@@ -2713,7 +2727,7 @@ async function endSession(sessionId) {
2713
2727
  const base = getUserDataDir();
2714
2728
  if (dir.startsWith(base)) {
2715
2729
  try {
2716
- import_node_fs7.default.rmSync(dir, { recursive: true, force: true });
2730
+ import_node_fs8.default.rmSync(dir, { recursive: true, force: true });
2717
2731
  } catch {
2718
2732
  }
2719
2733
  }
@@ -2721,11 +2735,11 @@ async function endSession(sessionId) {
2721
2735
  }
2722
2736
  function subscribeEvents(sessionId, onEvent) {
2723
2737
  const fifo = eventsFifoPath(sessionId);
2724
- if (!import_node_fs7.default.existsSync(fifo)) {
2738
+ if (!import_node_fs8.default.existsSync(fifo)) {
2725
2739
  throw new AgentSessionError("NO_FIFO", `events FIFO missing: ${fifo}`);
2726
2740
  }
2727
- const fd = import_node_fs7.default.openSync(fifo, import_node_fs7.constants.O_RDWR);
2728
- const stream = import_node_fs7.default.createReadStream("", { fd, autoClose: true });
2741
+ const fd = import_node_fs8.default.openSync(fifo, import_node_fs8.constants.O_RDWR);
2742
+ const stream = import_node_fs8.default.createReadStream("", { fd, autoClose: true });
2729
2743
  const rl = import_node_readline.default.createInterface({ input: stream, crlfDelay: Infinity });
2730
2744
  rl.on("line", (line) => {
2731
2745
  const event = parseAgentEventLine(line);
@@ -2736,7 +2750,7 @@ function subscribeEvents(sessionId, onEvent) {
2736
2750
  if (closed) return;
2737
2751
  closed = true;
2738
2752
  try {
2739
- import_node_fs7.default.writeSync(fd, "\n");
2753
+ import_node_fs8.default.writeSync(fd, "\n");
2740
2754
  } catch {
2741
2755
  }
2742
2756
  try {
@@ -2750,7 +2764,7 @@ function subscribeEvents(sessionId, onEvent) {
2750
2764
  };
2751
2765
  }
2752
2766
  async function waitForFirstEvent(fifo, predicate, timeoutMs) {
2753
- const fd = import_node_fs7.default.openSync(fifo, import_node_fs7.constants.O_RDWR | import_node_fs7.constants.O_NONBLOCK);
2767
+ const fd = import_node_fs8.default.openSync(fifo, import_node_fs8.constants.O_RDWR | import_node_fs8.constants.O_NONBLOCK);
2754
2768
  const buf = Buffer.alloc(8192);
2755
2769
  let leftover = "";
2756
2770
  const deadline = Date.now() + timeoutMs;
@@ -2758,7 +2772,7 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
2758
2772
  while (Date.now() < deadline) {
2759
2773
  let n = 0;
2760
2774
  try {
2761
- n = import_node_fs7.default.readSync(fd, buf, 0, buf.length, null);
2775
+ n = import_node_fs8.default.readSync(fd, buf, 0, buf.length, null);
2762
2776
  } catch (err) {
2763
2777
  if (err.code !== "EAGAIN") throw err;
2764
2778
  n = 0;
@@ -2778,7 +2792,7 @@ async function waitForFirstEvent(fifo, predicate, timeoutMs) {
2778
2792
  }
2779
2793
  return null;
2780
2794
  } finally {
2781
- import_node_fs7.default.closeSync(fd);
2795
+ import_node_fs8.default.closeSync(fd);
2782
2796
  }
2783
2797
  }
2784
2798
 
@@ -3067,10 +3081,10 @@ var AgentHost = class {
3067
3081
  }
3068
3082
  getTranscript(sessionId) {
3069
3083
  const p = transcriptPath(sessionId);
3070
- if (!import_node_fs8.default.existsSync(p)) {
3084
+ if (!import_node_fs9.default.existsSync(p)) {
3071
3085
  return { error: "transcript not found", code: "NO_TRANSCRIPT" };
3072
3086
  }
3073
- return import_node_fs8.default.readFileSync(p, "utf8");
3087
+ return import_node_fs9.default.readFileSync(p, "utf8");
3074
3088
  }
3075
3089
  getPaths() {
3076
3090
  const dir = getUserDataDir();
@@ -3766,13 +3780,13 @@ async function openUrl(url, options = {}) {
3766
3780
  }
3767
3781
 
3768
3782
  // src/host/plane-host.ts
3769
- var import_node_fs10 = __toESM(require("node:fs"), 1);
3783
+ var import_node_fs11 = __toESM(require("node:fs"), 1);
3770
3784
  var import_node_path11 = __toESM(require("node:path"), 1);
3771
3785
  var import_plane = require("@contrast/harness/plane");
3772
3786
 
3773
3787
  // cli/commands/box/checkout-plane.ts
3774
3788
  var import_node_child_process4 = require("node:child_process");
3775
- var import_node_fs9 = __toESM(require("node:fs"), 1);
3789
+ var import_node_fs10 = __toESM(require("node:fs"), 1);
3776
3790
  var import_node_path10 = __toESM(require("node:path"), 1);
3777
3791
  var CheckoutRequiresGitError = class extends Error {
3778
3792
  };
@@ -3782,14 +3796,14 @@ function looksBinary(filePath, size) {
3782
3796
  if (size === 0) return false;
3783
3797
  let fd;
3784
3798
  try {
3785
- fd = import_node_fs9.default.openSync(filePath, "r");
3799
+ fd = import_node_fs10.default.openSync(filePath, "r");
3786
3800
  const buffer = Buffer.alloc(Math.min(BINARY_SNIFF_BYTES, size));
3787
- const read = import_node_fs9.default.readSync(fd, buffer, 0, buffer.length, 0);
3801
+ const read = import_node_fs10.default.readSync(fd, buffer, 0, buffer.length, 0);
3788
3802
  return buffer.subarray(0, read).includes(0);
3789
3803
  } catch {
3790
3804
  return false;
3791
3805
  } finally {
3792
- if (fd !== void 0) import_node_fs9.default.closeSync(fd);
3806
+ if (fd !== void 0) import_node_fs10.default.closeSync(fd);
3793
3807
  }
3794
3808
  }
3795
3809
  var CheckoutFilePlane = class {
@@ -3839,7 +3853,7 @@ var CheckoutFilePlane = class {
3839
3853
  if (!relative) continue;
3840
3854
  let stat2;
3841
3855
  try {
3842
- stat2 = import_node_fs9.default.statSync(import_node_path10.default.join(this.root, relative));
3856
+ stat2 = import_node_fs10.default.statSync(import_node_path10.default.join(this.root, relative));
3843
3857
  } catch {
3844
3858
  continue;
3845
3859
  }
@@ -3866,15 +3880,15 @@ var CheckoutFilePlane = class {
3866
3880
  return resolved;
3867
3881
  }
3868
3882
  async read(planePath) {
3869
- return import_node_fs9.default.promises.readFile(this.absolute(planePath), "utf8");
3883
+ return import_node_fs10.default.promises.readFile(this.absolute(planePath), "utf8");
3870
3884
  }
3871
3885
  async readBytes(planePath) {
3872
- return import_node_fs9.default.promises.readFile(this.absolute(planePath));
3886
+ return import_node_fs10.default.promises.readFile(this.absolute(planePath));
3873
3887
  }
3874
3888
  async write(planePath, content) {
3875
3889
  const absolute = this.absolute(planePath);
3876
- await import_node_fs9.default.promises.mkdir(import_node_path10.default.dirname(absolute), { recursive: true });
3877
- await import_node_fs9.default.promises.writeFile(absolute, content);
3890
+ await import_node_fs10.default.promises.mkdir(import_node_path10.default.dirname(absolute), { recursive: true });
3891
+ await import_node_fs10.default.promises.writeFile(absolute, content);
3878
3892
  this.entries.set(planePath, {
3879
3893
  size: content.byteLength,
3880
3894
  readOnly: false,
@@ -3883,7 +3897,7 @@ var CheckoutFilePlane = class {
3883
3897
  });
3884
3898
  }
3885
3899
  async delete(planePath) {
3886
- await import_node_fs9.default.promises.rm(this.absolute(planePath), { force: true });
3900
+ await import_node_fs10.default.promises.rm(this.absolute(planePath), { force: true });
3887
3901
  this.entries.delete(planePath);
3888
3902
  }
3889
3903
  };
@@ -4012,11 +4026,11 @@ var PlaneHost = class {
4012
4026
  const resolved = import_node_path11.default.resolve(root);
4013
4027
  let real;
4014
4028
  try {
4015
- real = import_node_fs10.default.realpathSync(resolved);
4029
+ real = import_node_fs11.default.realpathSync(resolved);
4016
4030
  } catch {
4017
4031
  throw new Error(`no such directory: ${resolved}`);
4018
4032
  }
4019
- if (!import_node_fs10.default.statSync(real).isDirectory()) throw new Error(`not a directory: ${real}`);
4033
+ if (!import_node_fs11.default.statSync(real).isDirectory()) throw new Error(`not a directory: ${real}`);
4020
4034
  return real;
4021
4035
  }
4022
4036
  respond(ws, id, result) {