rnxsim 0.0.0 → 0.1.313

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 (228) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +512 -0
  3. package/detox/colors.ts +54 -0
  4. package/detox/config-loader.ts +135 -0
  5. package/detox/element-types.ts +39 -0
  6. package/detox/expectations.ts +537 -0
  7. package/detox/gestures.ts +480 -0
  8. package/detox/index.ts +2118 -0
  9. package/detox/jest-preset.cjs +51 -0
  10. package/detox/jest-setup-after-env.cjs +18 -0
  11. package/detox/matchers.ts +30 -0
  12. package/detox/motion-change.cjs +109 -0
  13. package/detox/motion-change.d.cts +35 -0
  14. package/detox/navigation.ts +43 -0
  15. package/detox/screenshots/animated-color-test-rest-norngh.png +0 -0
  16. package/detox/screenshots/color-test-after-drag-norngh.png +0 -0
  17. package/detox/screenshots/color-test-rest-norngh.png +0 -0
  18. package/detox/screenshots/theme-blue-toggle.png +0 -0
  19. package/detox/screenshots/theme-blue.png +0 -0
  20. package/detox/screenshots/theme-red-toggle.png +0 -0
  21. package/detox/screenshots/theme-red.png +0 -0
  22. package/dist-cli/bin.js +15 -0
  23. package/dist-cli/chunks/agent-XZ2KTPCU.js +48 -0
  24. package/dist-cli/chunks/agent-wrapper-JJYYW2WH.js +17 -0
  25. package/dist-cli/chunks/app-fonts-IXRNQG6B.js +4 -0
  26. package/dist-cli/chunks/assert-54T5SK5F.js +49 -0
  27. package/dist-cli/chunks/auth-FI5UDI45.js +12 -0
  28. package/dist-cli/chunks/beta-JV6UKADW.js +4 -0
  29. package/dist-cli/chunks/camera-VL73YIKP.js +22 -0
  30. package/dist-cli/chunks/chunk-2D2UPBBR.js +4 -0
  31. package/dist-cli/chunks/chunk-2YR5BGA5.js +5 -0
  32. package/dist-cli/chunks/chunk-3NV2NCNX.js +4 -0
  33. package/dist-cli/chunks/chunk-46EUUFJ5.js +4 -0
  34. package/dist-cli/chunks/chunk-4NPPOV2N.js +5 -0
  35. package/dist-cli/chunks/chunk-5DHC6KHQ.js +7 -0
  36. package/dist-cli/chunks/chunk-5TEF3ET3.js +74 -0
  37. package/dist-cli/chunks/chunk-5TPRP5QT.js +4 -0
  38. package/dist-cli/chunks/chunk-5YJCOWCH.js +4 -0
  39. package/dist-cli/chunks/chunk-7GN3LVWB.js +4 -0
  40. package/dist-cli/chunks/chunk-BBULZ7CG.js +568 -0
  41. package/dist-cli/chunks/chunk-BTWORNNG.js +71 -0
  42. package/dist-cli/chunks/chunk-D4FFVGI5.js +5 -0
  43. package/dist-cli/chunks/chunk-DCEMHR2Y.js +4 -0
  44. package/dist-cli/chunks/chunk-DZS6WPUI.js +4 -0
  45. package/dist-cli/chunks/chunk-F5ZRSS3C.js +3 -0
  46. package/dist-cli/chunks/chunk-FSUYIVJ6.js +9 -0
  47. package/dist-cli/chunks/chunk-G2WW6L2C.js +23 -0
  48. package/dist-cli/chunks/chunk-GASE6UBA.js +4 -0
  49. package/dist-cli/chunks/chunk-GGRX24GF.js +142 -0
  50. package/dist-cli/chunks/chunk-HI5TFJWN.js +5 -0
  51. package/dist-cli/chunks/chunk-IJ5CAZZC.js +5 -0
  52. package/dist-cli/chunks/chunk-IJO63TDP.js +4 -0
  53. package/dist-cli/chunks/chunk-KTHV3RUS.js +26 -0
  54. package/dist-cli/chunks/chunk-LF2ZVT7O.js +6 -0
  55. package/dist-cli/chunks/chunk-MJRLLB4R.js +38 -0
  56. package/dist-cli/chunks/chunk-NFK7T35W.js +4 -0
  57. package/dist-cli/chunks/chunk-NMF2ZMZQ.js +15 -0
  58. package/dist-cli/chunks/chunk-OHAZNXLK.js +4 -0
  59. package/dist-cli/chunks/chunk-OVFJFXUD.js +101 -0
  60. package/dist-cli/chunks/chunk-OZSSI4WN.js +28 -0
  61. package/dist-cli/chunks/chunk-QKDWYITG.js +25 -0
  62. package/dist-cli/chunks/chunk-RSZWCKNT.js +30 -0
  63. package/dist-cli/chunks/chunk-RTN5C5RL.js +4 -0
  64. package/dist-cli/chunks/chunk-TIVZIMMW.js +4 -0
  65. package/dist-cli/chunks/chunk-TZFFR3SD.js +7 -0
  66. package/dist-cli/chunks/chunk-UC6U3MML.js +5 -0
  67. package/dist-cli/chunks/chunk-VFCMSYZK.js +6 -0
  68. package/dist-cli/chunks/chunk-VNQEB4L7.js +5 -0
  69. package/dist-cli/chunks/chunk-VZXWHRUZ.js +983 -0
  70. package/dist-cli/chunks/chunk-W6K4EFPH.js +107 -0
  71. package/dist-cli/chunks/chunk-WEXDAC74.js +4 -0
  72. package/dist-cli/chunks/chunk-WF3T4SVI.js +14 -0
  73. package/dist-cli/chunks/chunk-WINYQ44O.js +4 -0
  74. package/dist-cli/chunks/chunk-WMIIKMGK.js +10 -0
  75. package/dist-cli/chunks/chunk-WUSWBCWA.js +507 -0
  76. package/dist-cli/chunks/chunk-WWZIXIRD.js +4 -0
  77. package/dist-cli/chunks/chunk-XEVZYVIW.js +766 -0
  78. package/dist-cli/chunks/chunk-YDGQTMQL.js +4 -0
  79. package/dist-cli/chunks/chunk-YIFT42WN.js +4 -0
  80. package/dist-cli/chunks/chunk-ZMJD5GEC.js +125 -0
  81. package/dist-cli/chunks/cleanup-P27PA6JI.js +25 -0
  82. package/dist-cli/chunks/cli-version-WWLPBDQ7.js +4 -0
  83. package/dist-cli/chunks/compat-ZD65FED3.js +20 -0
  84. package/dist-cli/chunks/config-XMJRNM2A.js +13 -0
  85. package/dist-cli/chunks/control-KMIQT3QP.js +4 -0
  86. package/dist-cli/chunks/daemon-G2ME7NLB.js +4 -0
  87. package/dist-cli/chunks/debug-PT4HOP7N.js +200 -0
  88. package/dist-cli/chunks/desktop-S3FG72AK.js +31 -0
  89. package/dist-cli/chunks/detox-B3D4IFCN.js +52 -0
  90. package/dist-cli/chunks/device-XBNDSB2R.js +18 -0
  91. package/dist-cli/chunks/diagnose-HMQXJE5N.js +43 -0
  92. package/dist-cli/chunks/disk-cleanup-BLCZ5BSZ.js +4 -0
  93. package/dist-cli/chunks/drivers-LDECZGP2.js +4 -0
  94. package/dist-cli/chunks/film-BJGTBYZB.js +74 -0
  95. package/dist-cli/chunks/flow-UEQNVTU7.js +4 -0
  96. package/dist-cli/chunks/help-T5FYSVGB.js +4 -0
  97. package/dist-cli/chunks/hidden-runtime-alias-ANOYADHM.js +4 -0
  98. package/dist-cli/chunks/home-paths-GT3LFNOR.js +4 -0
  99. package/dist-cli/chunks/inspect-ZA6XF5LD.js +4 -0
  100. package/dist-cli/chunks/install-desktop-TIMUDHPL.js +4 -0
  101. package/dist-cli/chunks/login-FJ737MWG.js +28 -0
  102. package/dist-cli/chunks/logout-ZCNMMHMY.js +4 -0
  103. package/dist-cli/chunks/maestro-SZTNKLDF.js +104 -0
  104. package/dist-cli/chunks/maestro-generate-DCFAIZ4H.js +36 -0
  105. package/dist-cli/chunks/mode-GRMQCRXR.js +26 -0
  106. package/dist-cli/chunks/optional-demo-registry-W36EWFFB.js +4 -0
  107. package/dist-cli/chunks/perf-QYBAAUZG.js +48 -0
  108. package/dist-cli/chunks/permissions-3QCQ6VF4.js +13 -0
  109. package/dist-cli/chunks/record-QPPC2S4E.js +72 -0
  110. package/dist-cli/chunks/report-issue-7NMFP4HK.js +29 -0
  111. package/dist-cli/chunks/runtime-XOAXMSTU.js +4 -0
  112. package/dist-cli/chunks/screenshot-command-67AECJFB.js +159 -0
  113. package/dist-cli/chunks/screenshot-layers-ASWBYPJL.js +20 -0
  114. package/dist-cli/chunks/screenshots-capture-PXA3HFQK.js +42 -0
  115. package/dist-cli/chunks/serve-BI2NBAXG.js +44 -0
  116. package/dist-cli/chunks/setup-7DWPMRSB.js +32 -0
  117. package/dist-cli/chunks/skills-S3Y22TUA.js +50 -0
  118. package/dist-cli/chunks/storage-XUIMJWAJ.js +37 -0
  119. package/dist-cli/chunks/store-JTHEJLAZ.js +4 -0
  120. package/dist-cli/chunks/telemetry-ZYJGD2DB.js +4 -0
  121. package/dist-cli/chunks/timeline-TMPLQPSP.js +24 -0
  122. package/dist-cli/chunks/upgrade-7HDSIM7K.js +7 -0
  123. package/dist-cli/chunks/upload-GMSZPWM6.js +4 -0
  124. package/dist-cli/chunks/version-HOCHZ37L.js +6 -0
  125. package/dist-cli/chunks/web-DG3WBYD3.js +4 -0
  126. package/dist-cli/chunks/what-happened-XFVUTZR7.js +25 -0
  127. package/dist-lib/agent-daemon-client.cjs +468 -0
  128. package/dist-lib/agent-events.cjs +48 -0
  129. package/dist-lib/agent-identity.cjs +53 -0
  130. package/dist-lib/agent-sessions.cjs +725 -0
  131. package/dist-lib/attached-projects.cjs +526 -0
  132. package/dist-lib/auth/shared-session.cjs +195 -0
  133. package/dist-lib/backend-origin.cjs +70 -0
  134. package/dist-lib/beta.cjs +41 -0
  135. package/dist-lib/beta.mjs +13 -0
  136. package/dist-lib/bridge-constants.cjs +161 -0
  137. package/dist-lib/cli-constants.cjs +32 -0
  138. package/dist-lib/config.cjs +96 -0
  139. package/dist-lib/detox/index.cjs +2863 -0
  140. package/dist-lib/detox/jest-preset.cjs +51 -0
  141. package/dist-lib/dev-bundle-resolution.cjs +223 -0
  142. package/dist-lib/home-paths.cjs +421 -0
  143. package/dist-lib/host/bridge-host.cjs +5600 -0
  144. package/dist-lib/host/fetch-proxy-handler.cjs +373 -0
  145. package/dist-lib/host/fetch-proxy-overrides.cjs +63 -0
  146. package/dist-lib/host/fetch-proxy-overrides.mjs +37 -0
  147. package/dist-lib/host/websocket-proxy.cjs +214 -0
  148. package/dist-lib/index.cjs +513 -0
  149. package/dist-lib/jump-to-source-babel.cjs +93 -0
  150. package/dist-lib/menu.cjs +620 -0
  151. package/dist-lib/menu.mjs +581 -0
  152. package/dist-lib/metro.cjs +297 -0
  153. package/dist-lib/profiles.cjs +246 -0
  154. package/dist-lib/public-brand.cjs +39 -0
  155. package/dist-lib/render-mode.cjs +54 -0
  156. package/dist-lib/scripts/dev-server-scanner.cjs +1034 -0
  157. package/dist-lib/sdk.cjs +2333 -0
  158. package/dist-lib/sdk.mjs +2240 -0
  159. package/dist-lib/skills.cjs +23922 -0
  160. package/dist-lib/vite.cjs +358 -0
  161. package/package.json +189 -18
  162. package/scripts/dev-server-scanner.ts +941 -0
  163. package/scripts/optional-demo-registry.ts +113 -0
  164. package/scripts/postinstall.cjs +3 -0
  165. package/scripts/preuninstall.cjs +118 -0
  166. package/skills/contrast/SKILL.md +171 -0
  167. package/skills/rnx-debug/SKILL.md +425 -0
  168. package/skills/rnx-perf/SKILL.md +295 -0
  169. package/skills/rnx-setup/SKILL.md +160 -0
  170. package/skills/rnx-test/SKILL.md +292 -0
  171. package/skills/rnx-visual/SKILL.md +122 -0
  172. package/src/agent-daemon-client.ts +410 -0
  173. package/src/agent-events.ts +71 -0
  174. package/src/agent-identity.ts +23 -0
  175. package/src/agent-prompt.ts +71 -0
  176. package/src/agent-sessions.ts +573 -0
  177. package/src/attached-projects.ts +539 -0
  178. package/src/auth/shared-session.ts +204 -0
  179. package/src/backend-origin.ts +49 -0
  180. package/src/beta.ts +19 -0
  181. package/src/bridge-constants.ts +171 -0
  182. package/src/browser-cache.ts +16 -0
  183. package/src/cli-constants.ts +1 -0
  184. package/src/cli-version.ts +32 -0
  185. package/src/codex-client.ts +215 -0
  186. package/src/config.ts +134 -0
  187. package/src/dev-bundle-resolution.ts +236 -0
  188. package/src/disk-cleanup.ts +466 -0
  189. package/src/home-paths.ts +552 -0
  190. package/src/host/agent-host.ts +666 -0
  191. package/src/host/bridge-host.ts +2626 -0
  192. package/src/host/fetch-proxy-handler.ts +397 -0
  193. package/src/host/fetch-proxy-overrides.ts +51 -0
  194. package/src/host/open-url.ts +89 -0
  195. package/src/host/websocket-proxy.ts +210 -0
  196. package/src/index.ts +12 -705
  197. package/src/jump-to-source-babel.ts +135 -0
  198. package/src/menu.ts +734 -0
  199. package/src/metro-plugin.ts +139 -0
  200. package/src/native-dev-bundle-url.ts +96 -0
  201. package/src/native-seam-manifest.ts +341 -0
  202. package/src/plist.ts +27 -0
  203. package/src/poll-until.ts +92 -0
  204. package/src/profiles.ts +179 -0
  205. package/src/public-brand.ts +9 -0
  206. package/src/render-mode.ts +27 -0
  207. package/src/runtime-assets.ts +228 -0
  208. package/src/runtime-delivery.ts +54 -0
  209. package/src/screenshots/compose.ts +422 -0
  210. package/src/screenshots/frame-compose.ts +454 -0
  211. package/src/screenshots/orchestrate.ts +256 -0
  212. package/src/screenshots/org-deck.ts +91 -0
  213. package/src/screenshots/registry.ts +58 -0
  214. package/src/screenshots/schema.ts +364 -0
  215. package/src/sdk.ts +7 -0
  216. package/src/settings-bundle.ts +418 -0
  217. package/src/skills/builtin/a11y-review.ts +132 -0
  218. package/src/skills/builtin/compat-check.ts +71 -0
  219. package/src/skills/builtin/maestro-test.ts +121 -0
  220. package/src/skills/builtin/perf-profile.ts +90 -0
  221. package/src/skills/builtin/screenshot-all.ts +52 -0
  222. package/src/skills/builtin/visual-diff.ts +100 -0
  223. package/src/skills/registry.ts +107 -0
  224. package/src/skills/types.ts +41 -0
  225. package/src/team-machine-prompt.ts +73 -0
  226. package/src/vite-plugin-one.ts +190 -0
  227. package/src/vite-plugin.ts +1750 -0
  228. package/src/worklets-babel.ts +134 -0
@@ -0,0 +1,358 @@
1
+ /*! rnx v0.1.313 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
+ "use strict";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
+
32
+ // src/vite-plugin-one.ts
33
+ var vite_plugin_one_exports = {};
34
+ __export(vite_plugin_one_exports, {
35
+ default: () => vite_plugin_one_default,
36
+ sootsimPlugin: () => sootsimPlugin
37
+ });
38
+ module.exports = __toCommonJS(vite_plugin_one_exports);
39
+ var import_fs2 = __toESM(require("fs"), 1);
40
+ var import_path2 = __toESM(require("path"), 1);
41
+
42
+ // src/bridge-constants.ts
43
+ var DEFAULT_SOOTSIM_BRIDGE_PORT = 7668;
44
+ var DEFAULT_SOOTSIM_BRIDGE_URL = `http://localhost:${DEFAULT_SOOTSIM_BRIDGE_PORT}/`;
45
+
46
+ // src/home-paths.ts
47
+ var import_node_fs = __toESM(require("node:fs"), 1);
48
+ var import_node_os = require("node:os");
49
+ var import_node_path = __toESM(require("node:path"), 1);
50
+ var SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
51
+ var ACTIVE_RUNTIME_FILE = "active";
52
+ var DAEMON_LOCKFILE = "daemon.json";
53
+ var DAEMON_HEARTBEAT_STALE_MS = 3e4;
54
+ function sootsimHomeDir() {
55
+ const override = process.env[SOOTSIM_HOME_ENV];
56
+ if (override && override.length > 0) return import_node_path.default.resolve(override);
57
+ return import_node_path.default.join((0, import_node_os.homedir)(), ".sootsim");
58
+ }
59
+ function runtimesDir() {
60
+ return import_node_path.default.join(sootsimHomeDir(), "runtimes");
61
+ }
62
+ function runtimeDir(version) {
63
+ return import_node_path.default.join(runtimesDir(), version);
64
+ }
65
+ function activeRuntimeFile() {
66
+ return import_node_path.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
67
+ }
68
+ function daemonLockfilePath() {
69
+ return import_node_path.default.join(sootsimHomeDir(), DAEMON_LOCKFILE);
70
+ }
71
+ function readActiveRuntime() {
72
+ try {
73
+ const value = import_node_fs.default.readFileSync(activeRuntimeFile(), "utf8").trim();
74
+ return value.length > 0 ? value : null;
75
+ } catch {
76
+ return null;
77
+ }
78
+ }
79
+ var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
80
+ function readDaemonLockfile() {
81
+ try {
82
+ const fd = import_node_fs.default.openSync(daemonLockfilePath(), "r");
83
+ try {
84
+ const buf = Buffer.alloc(DAEMON_LOCKFILE_MAX_BYTES);
85
+ const bytesRead = import_node_fs.default.readSync(fd, buf, 0, DAEMON_LOCKFILE_MAX_BYTES, 0);
86
+ const raw = buf.subarray(0, bytesRead).toString("utf8");
87
+ const parsed = JSON.parse(raw);
88
+ 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"))) {
89
+ return parsed;
90
+ }
91
+ return null;
92
+ } finally {
93
+ import_node_fs.default.closeSync(fd);
94
+ }
95
+ } catch {
96
+ return null;
97
+ }
98
+ }
99
+ function isDaemonLockfileFresh(lock, now = Date.now()) {
100
+ if (!lock) return false;
101
+ if (now - lock.heartbeatAt > DAEMON_HEARTBEAT_STALE_MS) return false;
102
+ try {
103
+ process.kill(lock.pid, 0);
104
+ return true;
105
+ } catch {
106
+ return false;
107
+ }
108
+ }
109
+
110
+ // src/runtime-assets.ts
111
+ var import_fs = __toESM(require("fs"), 1);
112
+ var import_path = __toESM(require("path"), 1);
113
+ var import_url = require("url");
114
+
115
+ // ../contrast-runtime-delivery/src/product.ts
116
+ function isValidRuntimeVersion(value) {
117
+ return value.length <= 100 && /^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(value);
118
+ }
119
+
120
+ // src/runtime-assets.ts
121
+ var SOOTSIM_RUNTIME_MISSING_MESSAGE = "[rnx] no engine runtime installed \u2014 run `rnxsim setup`, or `rnxsim runtime install`";
122
+ var _monorepoRootCache;
123
+ function findMonorepoRoot() {
124
+ if (_monorepoRootCache !== void 0) return _monorepoRootCache;
125
+ let dir = import_path.default.dirname((0, import_url.fileURLToPath)(__sootsim_import_meta_url));
126
+ for (let i = 0; i < 12 && dir !== import_path.default.dirname(dir); i++) {
127
+ if (import_fs.default.existsSync(import_path.default.join(dir, "packages/sootsim-engine/package.json")) && import_fs.default.existsSync(import_path.default.join(dir, "public/sootsim"))) {
128
+ _monorepoRootCache = dir;
129
+ return dir;
130
+ }
131
+ dir = import_path.default.dirname(dir);
132
+ }
133
+ _monorepoRootCache = null;
134
+ return null;
135
+ }
136
+ function resolveDevCheckoutRuntimeRoot() {
137
+ if (process.env.SOOTSIM_HOME && readActiveRuntime()) return null;
138
+ const root = findMonorepoRoot();
139
+ if (!root) return null;
140
+ const devBuild = import_path.default.join(root, "public/sootsim");
141
+ if (import_fs.default.existsSync(import_path.default.join(devBuild, "index.html")) && import_fs.default.existsSync(import_path.default.join(devBuild, "engine/index.html")) && import_fs.default.existsSync(import_path.default.join(devBuild, "engine-tenant/worker.js"))) {
142
+ return devBuild;
143
+ }
144
+ return null;
145
+ }
146
+ var MIME_TYPES = {
147
+ ".js": "application/javascript",
148
+ ".mjs": "application/javascript",
149
+ ".css": "text/css",
150
+ ".html": "text/html",
151
+ ".wasm": "application/wasm",
152
+ ".json": "application/json",
153
+ ".jpg": "image/jpeg",
154
+ ".jpeg": "image/jpeg",
155
+ ".png": "image/png",
156
+ ".svg": "image/svg+xml",
157
+ ".webp": "image/webp",
158
+ ".glb": "model/gltf-binary",
159
+ ".ttf": "font/ttf",
160
+ ".otf": "font/otf",
161
+ ".woff": "font/woff",
162
+ ".woff2": "font/woff2",
163
+ ".mp3": "audio/mpeg",
164
+ ".wav": "audio/wav"
165
+ };
166
+ var ROOT_RUNTIME_PATHS = [
167
+ "/assets/",
168
+ "/engine/",
169
+ "/engine-tenant/",
170
+ "/photos/",
171
+ "/three-mode/",
172
+ "/fonts/",
173
+ "/icons/",
174
+ "/sounds/",
175
+ "/spike/",
176
+ "/test-wallpaper.jpg",
177
+ "/preview-sw.js",
178
+ "/sootsim.svg"
179
+ ];
180
+ function resolveActiveRuntimeRoot() {
181
+ const devRoot = resolveDevCheckoutRuntimeRoot();
182
+ if (devRoot) return devRoot;
183
+ const active = readActiveRuntime();
184
+ if (!active) return null;
185
+ const dir = runtimeDir(active);
186
+ if (!import_fs.default.existsSync(import_path.default.join(dir, "index.html"))) return null;
187
+ return dir;
188
+ }
189
+ var RUNTIME_VERSION_HOSTNAME_SUFFIX = ".runtime.localhost";
190
+ function isRuntimeVersionHostname(hostname) {
191
+ return hostname.toLowerCase().endsWith(RUNTIME_VERSION_HOSTNAME_SUFFIX);
192
+ }
193
+ function runtimeVersionFromHostname(hostname) {
194
+ if (!isRuntimeVersionHostname(hostname)) return null;
195
+ const labels = hostname.slice(0, -RUNTIME_VERSION_HOSTNAME_SUFFIX.length).split(".");
196
+ if (labels.length === 0 || labels.some((label) => !/^[0-9a-f]{1,60}$/i.test(label))) {
197
+ return null;
198
+ }
199
+ const encoded = labels.join("");
200
+ if (encoded.length % 2 !== 0) return null;
201
+ try {
202
+ const version = Buffer.from(encoded, "hex").toString("utf8");
203
+ return isValidRuntimeVersion(version) ? version : null;
204
+ } catch {
205
+ return null;
206
+ }
207
+ }
208
+ function resolveInstalledRuntimeRoot(version) {
209
+ const dir = runtimeDir(version);
210
+ if (!import_fs.default.existsSync(import_path.default.join(dir, "index.html"))) return null;
211
+ return dir;
212
+ }
213
+ function resolveRuntimeRootForHostname(hostname) {
214
+ if (!isRuntimeVersionHostname(hostname)) return resolveActiveRuntimeRoot();
215
+ const version = runtimeVersionFromHostname(hostname);
216
+ return version ? resolveInstalledRuntimeRoot(version) : null;
217
+ }
218
+ function resolveRuntimeRootForRequestHost(host) {
219
+ if (!host) return resolveActiveRuntimeRoot();
220
+ try {
221
+ return resolveRuntimeRootForHostname(new URL(`http://${host}`).hostname);
222
+ } catch {
223
+ return null;
224
+ }
225
+ }
226
+ function isRootRuntimeAssetPath(pathname) {
227
+ return ROOT_RUNTIME_PATHS.some((p) => pathname === p || pathname.startsWith(p));
228
+ }
229
+ function resolveRuntimeFilePath(runtimeRoot, pathname) {
230
+ if (!pathname.startsWith("/")) return null;
231
+ if (pathname.includes("\0") || pathname.includes("\\")) return null;
232
+ for (const segment of pathname.split("/")) {
233
+ if (segment === "..") return null;
234
+ }
235
+ const fullPath = import_path.default.resolve(runtimeRoot, pathname.replace(/^\/+/, ""));
236
+ const rootWithSep = runtimeRoot.endsWith(import_path.default.sep) ? runtimeRoot : runtimeRoot + import_path.default.sep;
237
+ if (!fullPath.startsWith(rootWithSep) && fullPath !== runtimeRoot) return null;
238
+ if (!import_fs.default.existsSync(fullPath) || !import_fs.default.statSync(fullPath).isFile()) return null;
239
+ return fullPath;
240
+ }
241
+ function serveRuntimeFile(req, res, fullPath) {
242
+ const ext = import_path.default.extname(fullPath);
243
+ const stat = import_fs.default.statSync(fullPath);
244
+ const lastModified = stat.mtime.toUTCString();
245
+ res.setHeader("content-type", MIME_TYPES[ext] || "application/octet-stream");
246
+ res.setHeader("cache-control", "no-cache");
247
+ res.setHeader("last-modified", lastModified);
248
+ if (req?.headers?.["if-modified-since"] === lastModified) {
249
+ res.statusCode = 304;
250
+ res.end();
251
+ return;
252
+ }
253
+ import_fs.default.createReadStream(fullPath).pipe(res);
254
+ }
255
+
256
+ // src/vite-plugin-one.ts
257
+ function sootsimPlugin(options = {}) {
258
+ if (options.enabled === false) return [];
259
+ const prefix = options.prefix || "/__soot";
260
+ return [
261
+ {
262
+ name: "sootsim-one",
263
+ configureServer(server) {
264
+ const bundleUrl = options.bundleUrl || "/node_modules/one/metro-entry.bundle?platform=ios&dev=true&minify=false";
265
+ const buildShellHtml = (runtimeRoot) => {
266
+ const html = import_fs2.default.readFileSync(import_path2.default.join(runtimeRoot, "index.html"), "utf8");
267
+ const lock = readDaemonLockfile();
268
+ const bridgePort = lock && isDaemonLockfileFresh(lock) && lock.bridgePort > 0 ? lock.bridgePort : DEFAULT_SOOTSIM_BRIDGE_PORT;
269
+ const inject = `<script>(function(){var u=new URL(location.href);if(!u.searchParams.has('bundle'))u.searchParams.set('bundle',${JSON.stringify(bundleUrl)});window.__sootsimBridgePort=${bridgePort};history.replaceState(null,'','${prefix}/'+u.search)})()</script>`;
270
+ return html.replace("</head>", inject + "</head>");
271
+ };
272
+ server.middlewares.use((req, res, next) => {
273
+ const origWriteHead = res.writeHead.bind(res);
274
+ res.writeHead = function(statusCode, ...args) {
275
+ const setCookie = res.getHeader("set-cookie");
276
+ if (setCookie) {
277
+ const value = Array.isArray(setCookie) ? setCookie.join(", ") : String(setCookie);
278
+ res.setHeader("x-sootsim-set-cookie", value);
279
+ res.setHeader("access-control-expose-headers", "x-sootsim-set-cookie");
280
+ }
281
+ return origWriteHead(
282
+ statusCode,
283
+ ...args
284
+ );
285
+ };
286
+ next();
287
+ });
288
+ server.middlewares.use((req, res, next) => {
289
+ if ((req.url || "").split("?")[0] !== "/__server-scan") return next();
290
+ const scanPort = server.config.server.port || 8081;
291
+ const absoluteBundleUrl = bundleUrl.startsWith("http") ? bundleUrl : `http://localhost:${scanPort}${bundleUrl}`;
292
+ res.setHeader("content-type", "application/json");
293
+ res.end(
294
+ JSON.stringify([
295
+ {
296
+ port: scanPort,
297
+ framework: "one",
298
+ bundleUrl: absoluteBundleUrl,
299
+ lastSeen: Date.now()
300
+ }
301
+ ])
302
+ );
303
+ });
304
+ server.middlewares.use((req, res, next) => {
305
+ const url = req.url || "";
306
+ const pathname = url.split("?")[0];
307
+ const runtimeRoot = resolveRuntimeRootForRequestHost(req.headers.host);
308
+ if (!runtimeRoot) {
309
+ if (pathname === prefix || pathname === prefix + "/" || pathname.startsWith(prefix + "/")) {
310
+ res.statusCode = 500;
311
+ res.end(SOOTSIM_RUNTIME_MISSING_MESSAGE);
312
+ return;
313
+ }
314
+ next();
315
+ return;
316
+ }
317
+ if (isRootRuntimeAssetPath(pathname)) {
318
+ const fullPath = resolveRuntimeFilePath(runtimeRoot, pathname);
319
+ if (fullPath) {
320
+ serveRuntimeFile(req, res, fullPath);
321
+ return;
322
+ }
323
+ }
324
+ if (pathname === prefix || pathname === prefix + "/") {
325
+ res.setHeader("content-type", "text/html");
326
+ res.end(buildShellHtml(runtimeRoot));
327
+ return;
328
+ }
329
+ if (pathname.startsWith(prefix + "/")) {
330
+ const fullPath = resolveRuntimeFilePath(
331
+ runtimeRoot,
332
+ pathname.slice(prefix.length)
333
+ );
334
+ if (fullPath) {
335
+ serveRuntimeFile(req, res, fullPath);
336
+ return;
337
+ }
338
+ const ext = import_path2.default.extname(pathname);
339
+ if (!ext) {
340
+ res.setHeader("content-type", "text/html");
341
+ res.end(buildShellHtml(runtimeRoot));
342
+ return;
343
+ }
344
+ }
345
+ next();
346
+ });
347
+ const port = server.config.server.port || 8081;
348
+ const sootsimUrl = `http://localhost:${port}${prefix}/`;
349
+ console.log(`[rnx] serving at ${sootsimUrl}`);
350
+ }
351
+ }
352
+ ];
353
+ }
354
+ var vite_plugin_one_default = sootsimPlugin;
355
+ // Annotate the CommonJS export names for ESM import in node:
356
+ 0 && (module.exports = {
357
+ sootsimPlugin
358
+ });
package/package.json CHANGED
@@ -1,29 +1,200 @@
1
1
  {
2
2
  "name": "rnxsim",
3
- "version": "0.0.0",
4
- "description": "Cloudflare D1 (and any sqlite-shaped store) adapter for better-auth — no kysely, no drizzle",
3
+ "version": "0.1.313",
4
+ "description": "rnxsim CLI, Vite and Metro plugins, and agent skills for driving React Native apps in the browser.",
5
+ "author": "Tamagui LLC",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/sootbean/soot.git",
10
+ "directory": "packages/sootsim"
11
+ },
5
12
  "type": "module",
6
- "main": "./src/index.ts",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
7
16
  "types": "./src/index.ts",
8
17
  "exports": {
9
- ".": "./src/index.ts"
18
+ ".": {
19
+ "types": "./src/index.ts",
20
+ "source": "./src/index.ts",
21
+ "default": "./dist-lib/index.cjs"
22
+ },
23
+ "./config": {
24
+ "types": "./src/config.ts",
25
+ "source": "./src/config.ts",
26
+ "default": "./dist-lib/config.cjs"
27
+ },
28
+ "./auth/shared-session": {
29
+ "source": "./src/auth/shared-session.ts",
30
+ "default": "./dist-lib/auth/shared-session.cjs"
31
+ },
32
+ "./vite": {
33
+ "source": "./src/vite-plugin-one.ts",
34
+ "default": "./dist-lib/vite.cjs"
35
+ },
36
+ "./metro": {
37
+ "source": "./src/metro-plugin.ts",
38
+ "default": "./dist-lib/metro.cjs"
39
+ },
40
+ "./jump-to-source-babel": {
41
+ "source": "./src/jump-to-source-babel.ts",
42
+ "default": "./dist-lib/jump-to-source-babel.cjs"
43
+ },
44
+ "./menu": {
45
+ "source": "./src/menu.ts",
46
+ "bun": "./src/menu.ts",
47
+ "import": "./dist-lib/menu.mjs",
48
+ "default": "./dist-lib/menu.cjs"
49
+ },
50
+ "./skills": {
51
+ "source": "./src/skills/registry.ts",
52
+ "default": "./dist-lib/skills.cjs"
53
+ },
54
+ "./sdk": {
55
+ "source": "./src/sdk.ts",
56
+ "bun": "./src/sdk.ts",
57
+ "import": "./dist-lib/sdk.mjs",
58
+ "default": "./dist-lib/sdk.cjs"
59
+ },
60
+ "./beta": {
61
+ "source": "./src/beta.ts",
62
+ "import": "./dist-lib/beta.mjs",
63
+ "default": "./dist-lib/beta.cjs"
64
+ },
65
+ "./agent-events": {
66
+ "source": "./src/agent-events.ts",
67
+ "default": "./dist-lib/agent-events.cjs"
68
+ },
69
+ "./agent-sessions": {
70
+ "source": "./src/agent-sessions.ts",
71
+ "default": "./dist-lib/agent-sessions.cjs"
72
+ },
73
+ "./agent-daemon-client": {
74
+ "source": "./src/agent-daemon-client.ts",
75
+ "default": "./dist-lib/agent-daemon-client.cjs"
76
+ },
77
+ "./agent-identity": {
78
+ "source": "./src/agent-identity.ts",
79
+ "bun": "./src/agent-identity.ts",
80
+ "import": "./src/agent-identity.ts",
81
+ "default": "./dist-lib/agent-identity.cjs"
82
+ },
83
+ "./attached-projects": {
84
+ "source": "./src/attached-projects.ts",
85
+ "default": "./dist-lib/attached-projects.cjs"
86
+ },
87
+ "./backend-origin": {
88
+ "source": "./src/backend-origin.ts",
89
+ "default": "./dist-lib/backend-origin.cjs"
90
+ },
91
+ "./bridge-constants": {
92
+ "source": "./src/bridge-constants.ts",
93
+ "default": "./dist-lib/bridge-constants.cjs"
94
+ },
95
+ "./cli-constants": {
96
+ "source": "./src/cli-constants.ts",
97
+ "default": "./dist-lib/cli-constants.cjs"
98
+ },
99
+ "./public-brand": {
100
+ "types": "./src/public-brand.ts",
101
+ "source": "./src/public-brand.ts",
102
+ "default": "./dist-lib/public-brand.cjs"
103
+ },
104
+ "./home-paths": {
105
+ "source": "./src/home-paths.ts",
106
+ "default": "./dist-lib/home-paths.cjs"
107
+ },
108
+ "./profiles": {
109
+ "source": "./src/profiles.ts",
110
+ "default": "./dist-lib/profiles.cjs"
111
+ },
112
+ "./dev-bundle-resolution": {
113
+ "source": "./src/dev-bundle-resolution.ts",
114
+ "default": "./dist-lib/dev-bundle-resolution.cjs"
115
+ },
116
+ "./render-mode": {
117
+ "source": "./src/render-mode.ts",
118
+ "default": "./dist-lib/render-mode.cjs"
119
+ },
120
+ "./host/bridge-host": {
121
+ "source": "./src/host/bridge-host.ts",
122
+ "default": "./dist-lib/host/bridge-host.cjs"
123
+ },
124
+ "./host/fetch-proxy-handler": {
125
+ "source": "./src/host/fetch-proxy-handler.ts",
126
+ "default": "./dist-lib/host/fetch-proxy-handler.cjs"
127
+ },
128
+ "./host/fetch-proxy-overrides": {
129
+ "source": "./src/host/fetch-proxy-overrides.ts",
130
+ "import": "./dist-lib/host/fetch-proxy-overrides.mjs",
131
+ "default": "./dist-lib/host/fetch-proxy-overrides.cjs"
132
+ },
133
+ "./host/websocket-proxy": {
134
+ "source": "./src/host/websocket-proxy.ts",
135
+ "default": "./dist-lib/host/websocket-proxy.cjs"
136
+ },
137
+ "./scripts/dev-server-scanner": {
138
+ "source": "./scripts/dev-server-scanner.ts",
139
+ "default": "./dist-lib/scripts/dev-server-scanner.cjs"
140
+ },
141
+ "./detox": {
142
+ "source": "./detox/index.ts",
143
+ "default": "./dist-lib/detox/index.cjs"
144
+ },
145
+ "./detox/jest-preset": {
146
+ "source": "./detox/jest-preset.cjs",
147
+ "default": "./dist-lib/detox/jest-preset.cjs"
148
+ },
149
+ "./package.json": "./package.json"
150
+ },
151
+ "bin": {
152
+ "rnxsim": "dist-cli/bin.js"
10
153
  },
11
154
  "files": [
12
- "src",
13
- "README.md"
14
- ],
15
- "keywords": [
16
- "better-auth",
17
- "auth",
18
- "adapter",
19
- "cloudflare",
20
- "d1",
21
- "sqlite",
22
- "workers"
155
+ "dist-cli/",
156
+ "dist-lib/",
157
+ "src/",
158
+ "skills/",
159
+ "scripts/dev-server-scanner.ts",
160
+ "scripts/optional-demo-registry.ts",
161
+ "detox/",
162
+ "scripts/postinstall.cjs",
163
+ "scripts/preuninstall.cjs",
164
+ "README.md",
165
+ "LICENSE"
23
166
  ],
24
- "license": "MIT",
167
+ "scripts": {
168
+ "build": "bun scripts/build-cli.ts",
169
+ "build:cli": "bun scripts/build-cli.ts",
170
+ "build:cli-binary": "bun scripts/build-cli-binary.ts",
171
+ "pack:smoke": "bun scripts/pack-smoke.ts",
172
+ "postinstall": "node ./scripts/postinstall.cjs",
173
+ "preuninstall": "node ./scripts/preuninstall.cjs"
174
+ },
175
+ "dependencies": {
176
+ "@expo/plist": "^0.5.4",
177
+ "jiti": "2.7.0",
178
+ "ws": "^8.18.0"
179
+ },
25
180
  "peerDependencies": {
26
- "@better-auth/core": "1.6.30",
27
- "better-auth": "1.6.30"
181
+ "vite": ">=8.0.14"
182
+ },
183
+ "peerDependenciesMeta": {
184
+ "vite": {
185
+ "optional": true
186
+ }
187
+ },
188
+ "devDependencies": {
189
+ "@contrast/runtime-delivery": "workspace:*",
190
+ "@sootsim/compat": "workspace:*",
191
+ "@sootsim/globals": "workspace:*",
192
+ "@sootsim/skills": "workspace:*",
193
+ "@types/ws": "^8.5.13",
194
+ "esbuild": "^0.25.0",
195
+ "sootsim-engine": "workspace:*",
196
+ "typescript": "^5.7.0",
197
+ "vite": "^8.2.2",
198
+ "yaml": "^2.8.3"
28
199
  }
29
200
  }