rnxsim 0.1.451 → 0.1.453

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 (63) hide show
  1. package/cli/bridge-flow-runner.ts +41 -13
  2. package/cli/cloud-client.ts +10 -0
  3. package/cli/commands/control.ts +52 -7
  4. package/cli/commands/debug.ts +42 -11
  5. package/cli/commands/inspect/core.ts +33 -13
  6. package/cli/commands/inspect/settling.ts +35 -3
  7. package/cli/drivers/playwright.ts +2 -4
  8. package/cli/ws-bridge.ts +72 -5
  9. package/dist-lib/agent-daemon-client.cjs +1 -1
  10. package/dist-lib/agent-events.cjs +1 -1
  11. package/dist-lib/agent-identity.cjs +1 -1
  12. package/dist-lib/agent-sessions.cjs +1 -1
  13. package/dist-lib/attached-projects.cjs +1 -1
  14. package/dist-lib/auth/shared-session.cjs +1 -1
  15. package/dist-lib/backend-origin.cjs +1 -1
  16. package/dist-lib/beta.cjs +1 -1
  17. package/dist-lib/beta.mjs +1 -1
  18. package/dist-lib/bridge-constants.cjs +1 -1
  19. package/dist-lib/bridge-contract-input.cjs +1 -1
  20. package/dist-lib/bridge-contract-input.mjs +1 -1
  21. package/dist-lib/bridge-contract.cjs +1 -1
  22. package/dist-lib/bridge-contract.mjs +1 -1
  23. package/dist-lib/capture-contract.cjs +1 -1
  24. package/dist-lib/capture-contract.mjs +1 -1
  25. package/dist-lib/cli-constants.cjs +1 -1
  26. package/dist-lib/cloud-contract.cjs +1 -1
  27. package/dist-lib/cloud-contract.mjs +1 -1
  28. package/dist-lib/cloud.cjs +1 -1
  29. package/dist-lib/cloud.mjs +1 -1
  30. package/dist-lib/config.cjs +1 -1
  31. package/dist-lib/detox/index.cjs +1 -1
  32. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  33. package/dist-lib/home-paths.cjs +1 -1
  34. package/dist-lib/host/bridge-host.cjs +1 -1
  35. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  37. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  38. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  39. package/dist-lib/host/websocket-proxy.cjs +1 -1
  40. package/dist-lib/index.cjs +89 -8
  41. package/dist-lib/jump-to-source-babel.cjs +1 -1
  42. package/dist-lib/jump-to-source-native.cjs +1 -1
  43. package/dist-lib/menu.cjs +1 -1
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +1 -1
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +1 -1
  50. package/dist-lib/profiles.cjs +1 -1
  51. package/dist-lib/public-brand.cjs +1 -1
  52. package/dist-lib/react-native-host-modules.cjs +1 -1
  53. package/dist-lib/react-native-host-modules.mjs +1 -1
  54. package/dist-lib/render-mode.cjs +1 -1
  55. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  56. package/dist-lib/sdk.cjs +59 -12
  57. package/dist-lib/sdk.mjs +58 -12
  58. package/dist-lib/skills.cjs +2349 -282
  59. package/dist-lib/vite.cjs +1 -1
  60. package/package.json +1 -1
  61. package/src/flow-timeout-scale.ts +15 -0
  62. package/src/playwright-host-log.ts +16 -0
  63. package/src/sim-client.ts +4 -0
package/dist-lib/sdk.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.451 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.453 | (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;
@@ -35,6 +35,7 @@ __export(sdk_exports, {
35
35
  SimResetError: () => SimResetError,
36
36
  SimTapError: () => SimTapError,
37
37
  buildSimOpenUrl: () => buildSimOpenUrl,
38
+ callDebugBridge: () => callDebugBridge,
38
39
  clearConsole: () => clearConsole,
39
40
  clearLogs: () => clearLogs,
40
41
  clearRequests: () => clearRequests,
@@ -1128,17 +1129,32 @@ async function inspectDebugFind(bridge, target) {
1128
1129
  code: `window.__sootsimTest.debugFind(${JSON.stringify(target)})`
1129
1130
  });
1130
1131
  }
1131
- async function inspectDebugRecent(bridge, channel, limit = 50) {
1132
- const code = channel && channel !== "all" ? `window.__sootsimDebug.recent(${JSON.stringify(channel)}, ${limit})` : `window.__sootsimDebug.recent(undefined, ${limit})`;
1133
- return bridge.send({ type: "evaluate", code });
1134
- }
1135
- async function setDebugChannels(bridge, action, channels) {
1136
- const args = channels.length > 0 ? channels.map((c) => JSON.stringify(c)).join(", ") : action === "disable" ? "'all'" : "";
1132
+ async function callDebugBridge(bridge, expression, host = false) {
1133
+ const code = `globalThis.__sootsimDebug.${expression}`;
1134
+ if (host) return bridge.send({ type: "evaluate", code });
1137
1135
  return bridge.send({
1138
1136
  type: "evaluate",
1139
- code: `window.__sootsimDebug.${action}(${args})`
1137
+ code: `(async () => {
1138
+ const result = await window.__sootsimTest.evalInTenant(${JSON.stringify(code)})
1139
+ if (!result.ok) throw new Error(result.error)
1140
+ return result.value
1141
+ })()`
1140
1142
  });
1141
1143
  }
1144
+ async function inspectDebugRecent(bridge, channel, limit = 50, host = false) {
1145
+ return callDebugBridge(
1146
+ bridge,
1147
+ `recent(${channel && channel !== "all" ? JSON.stringify(channel) : "undefined"}, ${limit})`,
1148
+ host
1149
+ );
1150
+ }
1151
+ async function setDebugChannels(bridge, action, channels, host = false) {
1152
+ const args = channels.length > 0 ? channels.map((c) => JSON.stringify(c)).join(", ") : action === "disable" ? "'all'" : "";
1153
+ const expression = `${action}(${args})`;
1154
+ const active = await callDebugBridge(bridge, expression, true);
1155
+ if (host) return active;
1156
+ return callDebugBridge(bridge, expression);
1157
+ }
1142
1158
  async function inspectMemory(bridge) {
1143
1159
  if (bridge.plane === "cloud") {
1144
1160
  const value = await bridge.send({ type: "memory" });
@@ -1448,8 +1464,19 @@ async function waitForSootsimIdle({
1448
1464
  let lastRequestTotal = -1
1449
1465
  let stable = 0
1450
1466
  let visuallyStillSince = 0
1467
+ // counts across the whole budget: a flag that is true on every poll is a
1468
+ // different bug from one that is true intermittently, and the two need
1469
+ // opposite fixes (engine vs budget).
1470
+ let polls = 0
1471
+ let dirtyPolls = 0
1472
+ let animatingPolls = 0
1473
+ let layoutChangedPolls = 0
1451
1474
  while (Date.now() < deadline) {
1452
1475
  const snapshot = await readSnapshot()
1476
+ polls++
1477
+ if (snapshot.layoutDirty) dirtyPolls++
1478
+ if (snapshot.animating) animatingPolls++
1479
+ if (polls > 1 && snapshot.layout !== lastLayout) layoutChangedPolls++
1453
1480
  const strictOk =
1454
1481
  !strict ||
1455
1482
  (snapshot.renderStatsAvailable && !snapshot.animating && !snapshot.layoutDirty)
@@ -1470,7 +1497,7 @@ async function waitForSootsimIdle({
1470
1497
  stable >= requiredStablePolls &&
1471
1498
  (networkQuiet || Date.now() - visuallyStillSince >= networkQuietGraceMs)
1472
1499
  ) {
1473
- return { settled: true, elapsed: Date.now() - start }
1500
+ return { settled: true, elapsed: Date.now() - start, blockedBy: '' }
1474
1501
  }
1475
1502
  } else {
1476
1503
  stable = 0
@@ -1480,17 +1507,33 @@ async function waitForSootsimIdle({
1480
1507
  lastRequestTotal = snapshot.requestTotal
1481
1508
  await sleep(pollMs)
1482
1509
  }
1483
- return { settled: false, elapsed: Date.now() - start }
1510
+ const last = await readSnapshot()
1511
+ const blockers = []
1512
+ if (strict && !last.renderStatsAvailable) blockers.push('render stats unavailable')
1513
+ if (last.animating) blockers.push('animations still running')
1514
+ if (last.layoutDirty) blockers.push('layout still dirty')
1515
+ if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
1516
+ if (last.layout !== lastLayout) blockers.push('layout still changing')
1517
+ if (last.requestInFlight > 0) blockers.push(last.requestInFlight + ' requests in flight')
1518
+ return {
1519
+ settled: false,
1520
+ elapsed: Date.now() - start,
1521
+ blockedBy:
1522
+ (blockers.length ? blockers.join(', ') : 'unknown') +
1523
+ ' over ' + polls + ' polls (layout changed ' + layoutChangedPolls +
1524
+ 'x, layoutDirty ' + dirtyPolls + 'x, animating ' + animatingPolls + 'x)',
1525
+ }
1484
1526
  })()`
1485
1527
  },
1486
1528
  {
1487
1529
  timeoutMs: maxMs + 1e3
1488
1530
  }
1489
1531
  );
1490
- const { elapsed, settled } = result ?? {};
1532
+ const { elapsed, settled, blockedBy } = result ?? {};
1491
1533
  return {
1492
1534
  elapsed: typeof elapsed === "number" ? elapsed : maxMs,
1493
- settled: settled === true
1535
+ settled: settled === true,
1536
+ blockedBy: typeof blockedBy === "string" ? blockedBy : "unknown"
1494
1537
  };
1495
1538
  }
1496
1539
 
@@ -1985,6 +2028,9 @@ var SimClient = class {
1985
2028
  listSims() {
1986
2029
  return this.bridge.listSims();
1987
2030
  }
2031
+ resolveReloadedSim(retiredSimId) {
2032
+ return this.bridge.resolveReloadedSim(retiredSimId);
2033
+ }
1988
2034
  focusSim(simId = this.simId) {
1989
2035
  return this.bridge.focusSim(simId);
1990
2036
  }
@@ -2336,6 +2382,7 @@ var SimClient = class {
2336
2382
  SimResetError,
2337
2383
  SimTapError,
2338
2384
  buildSimOpenUrl,
2385
+ callDebugBridge,
2339
2386
  clearConsole,
2340
2387
  clearLogs,
2341
2388
  clearRequests,
package/dist-lib/sdk.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.451 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.453 | (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);
@@ -1033,17 +1033,32 @@ async function inspectDebugFind(bridge, target) {
1033
1033
  code: `window.__sootsimTest.debugFind(${JSON.stringify(target)})`
1034
1034
  });
1035
1035
  }
1036
- async function inspectDebugRecent(bridge, channel, limit = 50) {
1037
- const code = channel && channel !== "all" ? `window.__sootsimDebug.recent(${JSON.stringify(channel)}, ${limit})` : `window.__sootsimDebug.recent(undefined, ${limit})`;
1038
- return bridge.send({ type: "evaluate", code });
1039
- }
1040
- async function setDebugChannels(bridge, action, channels) {
1041
- const args = channels.length > 0 ? channels.map((c) => JSON.stringify(c)).join(", ") : action === "disable" ? "'all'" : "";
1036
+ async function callDebugBridge(bridge, expression, host = false) {
1037
+ const code = `globalThis.__sootsimDebug.${expression}`;
1038
+ if (host) return bridge.send({ type: "evaluate", code });
1042
1039
  return bridge.send({
1043
1040
  type: "evaluate",
1044
- code: `window.__sootsimDebug.${action}(${args})`
1041
+ code: `(async () => {
1042
+ const result = await window.__sootsimTest.evalInTenant(${JSON.stringify(code)})
1043
+ if (!result.ok) throw new Error(result.error)
1044
+ return result.value
1045
+ })()`
1045
1046
  });
1046
1047
  }
1048
+ async function inspectDebugRecent(bridge, channel, limit = 50, host = false) {
1049
+ return callDebugBridge(
1050
+ bridge,
1051
+ `recent(${channel && channel !== "all" ? JSON.stringify(channel) : "undefined"}, ${limit})`,
1052
+ host
1053
+ );
1054
+ }
1055
+ async function setDebugChannels(bridge, action, channels, host = false) {
1056
+ const args = channels.length > 0 ? channels.map((c) => JSON.stringify(c)).join(", ") : action === "disable" ? "'all'" : "";
1057
+ const expression = `${action}(${args})`;
1058
+ const active = await callDebugBridge(bridge, expression, true);
1059
+ if (host) return active;
1060
+ return callDebugBridge(bridge, expression);
1061
+ }
1047
1062
  async function inspectMemory(bridge) {
1048
1063
  if (bridge.plane === "cloud") {
1049
1064
  const value = await bridge.send({ type: "memory" });
@@ -1353,8 +1368,19 @@ async function waitForSootsimIdle({
1353
1368
  let lastRequestTotal = -1
1354
1369
  let stable = 0
1355
1370
  let visuallyStillSince = 0
1371
+ // counts across the whole budget: a flag that is true on every poll is a
1372
+ // different bug from one that is true intermittently, and the two need
1373
+ // opposite fixes (engine vs budget).
1374
+ let polls = 0
1375
+ let dirtyPolls = 0
1376
+ let animatingPolls = 0
1377
+ let layoutChangedPolls = 0
1356
1378
  while (Date.now() < deadline) {
1357
1379
  const snapshot = await readSnapshot()
1380
+ polls++
1381
+ if (snapshot.layoutDirty) dirtyPolls++
1382
+ if (snapshot.animating) animatingPolls++
1383
+ if (polls > 1 && snapshot.layout !== lastLayout) layoutChangedPolls++
1358
1384
  const strictOk =
1359
1385
  !strict ||
1360
1386
  (snapshot.renderStatsAvailable && !snapshot.animating && !snapshot.layoutDirty)
@@ -1375,7 +1401,7 @@ async function waitForSootsimIdle({
1375
1401
  stable >= requiredStablePolls &&
1376
1402
  (networkQuiet || Date.now() - visuallyStillSince >= networkQuietGraceMs)
1377
1403
  ) {
1378
- return { settled: true, elapsed: Date.now() - start }
1404
+ return { settled: true, elapsed: Date.now() - start, blockedBy: '' }
1379
1405
  }
1380
1406
  } else {
1381
1407
  stable = 0
@@ -1385,17 +1411,33 @@ async function waitForSootsimIdle({
1385
1411
  lastRequestTotal = snapshot.requestTotal
1386
1412
  await sleep(pollMs)
1387
1413
  }
1388
- return { settled: false, elapsed: Date.now() - start }
1414
+ const last = await readSnapshot()
1415
+ const blockers = []
1416
+ if (strict && !last.renderStatsAvailable) blockers.push('render stats unavailable')
1417
+ if (last.animating) blockers.push('animations still running')
1418
+ if (last.layoutDirty) blockers.push('layout still dirty')
1419
+ if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
1420
+ if (last.layout !== lastLayout) blockers.push('layout still changing')
1421
+ if (last.requestInFlight > 0) blockers.push(last.requestInFlight + ' requests in flight')
1422
+ return {
1423
+ settled: false,
1424
+ elapsed: Date.now() - start,
1425
+ blockedBy:
1426
+ (blockers.length ? blockers.join(', ') : 'unknown') +
1427
+ ' over ' + polls + ' polls (layout changed ' + layoutChangedPolls +
1428
+ 'x, layoutDirty ' + dirtyPolls + 'x, animating ' + animatingPolls + 'x)',
1429
+ }
1389
1430
  })()`
1390
1431
  },
1391
1432
  {
1392
1433
  timeoutMs: maxMs + 1e3
1393
1434
  }
1394
1435
  );
1395
- const { elapsed, settled } = result ?? {};
1436
+ const { elapsed, settled, blockedBy } = result ?? {};
1396
1437
  return {
1397
1438
  elapsed: typeof elapsed === "number" ? elapsed : maxMs,
1398
- settled: settled === true
1439
+ settled: settled === true,
1440
+ blockedBy: typeof blockedBy === "string" ? blockedBy : "unknown"
1399
1441
  };
1400
1442
  }
1401
1443
 
@@ -1890,6 +1932,9 @@ var SimClient = class {
1890
1932
  listSims() {
1891
1933
  return this.bridge.listSims();
1892
1934
  }
1935
+ resolveReloadedSim(retiredSimId) {
1936
+ return this.bridge.resolveReloadedSim(retiredSimId);
1937
+ }
1893
1938
  focusSim(simId = this.simId) {
1894
1939
  return this.bridge.focusSim(simId);
1895
1940
  }
@@ -2240,6 +2285,7 @@ export {
2240
2285
  SimResetError,
2241
2286
  SimTapError,
2242
2287
  buildSimOpenUrl,
2288
+ callDebugBridge,
2243
2289
  clearConsole,
2244
2290
  clearLogs,
2245
2291
  clearRequests,