peachsim 0.1.2207 → 0.1.2209

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 (147) hide show
  1. package/cli/bridge-diagnostics.ts +4 -4
  2. package/cli/bridge-flow-runner.ts +33 -33
  3. package/cli/browser-evals.ts +2 -2
  4. package/cli/commands/control.ts +1 -1
  5. package/cli/commands/cpu-profile.ts +5 -4
  6. package/cli/commands/debug.ts +3 -3
  7. package/cli/commands/diagnose.ts +2 -2
  8. package/cli/commands/flow.ts +7 -7
  9. package/cli/commands/inspect/core.ts +22 -22
  10. package/cli/commands/inspect/get-node.ts +2 -2
  11. package/cli/commands/inspect/shared.ts +2 -2
  12. package/cli/commands/inspect/wait-event.ts +1 -1
  13. package/cli/commands/inspect.ts +33 -33
  14. package/cli/commands/record-three.ts +17 -17
  15. package/cli/commands/record.ts +44 -40
  16. package/cli/commands/shell-boolean-mode.ts +1 -1
  17. package/cli/commands/slides.ts +5 -3
  18. package/cli/commands/three-mode.ts +3 -3
  19. package/cli/commands/upload.ts +8 -8
  20. package/cli/drivers/types.ts +1 -1
  21. package/cli/runtime-diagnostics.ts +2 -2
  22. package/cli/scene-video.ts +5 -3
  23. package/cli/send-to-box.ts +1 -1
  24. package/cli/ws-bridge.ts +3 -3
  25. package/dist-lib/agent-daemon-client.cjs +1 -1
  26. package/dist-lib/agent-events.cjs +1 -1
  27. package/dist-lib/attached-projects.cjs +1 -1
  28. package/dist-lib/auth/shared-session.cjs +1 -1
  29. package/dist-lib/backend-origin.cjs +1 -1
  30. package/dist-lib/beta.cjs +1 -1
  31. package/dist-lib/beta.mjs +1 -1
  32. package/dist-lib/bridge-constants.cjs +1 -1
  33. package/dist-lib/bridge-contract-input.cjs +1 -1
  34. package/dist-lib/bridge-contract-input.mjs +1 -1
  35. package/dist-lib/bridge-contract.cjs +1 -1
  36. package/dist-lib/bridge-contract.mjs +1 -1
  37. package/dist-lib/bundle-channel.cjs +448 -22
  38. package/dist-lib/capture-contract.cjs +1 -1
  39. package/dist-lib/capture-contract.mjs +1 -1
  40. package/dist-lib/cloud-contract.cjs +1 -1
  41. package/dist-lib/cloud-contract.mjs +1 -1
  42. package/dist-lib/cloud-test-args.cjs +1 -1
  43. package/dist-lib/cloud-test-args.mjs +1 -1
  44. package/dist-lib/cloud.cjs +1 -1
  45. package/dist-lib/cloud.mjs +1 -1
  46. package/dist-lib/config.cjs +1 -1
  47. package/dist-lib/config.mjs +1 -1
  48. package/dist-lib/detox/index.cjs +4 -4
  49. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  50. package/dist-lib/expo-swift-bundle.cjs +436 -16
  51. package/dist-lib/expo-swift-metadata.cjs +1 -1
  52. package/dist-lib/expo-swift-metadata.mjs +1 -1
  53. package/dist-lib/home-paths.cjs +1 -1
  54. package/dist-lib/host/bridge-host.cjs +449 -23
  55. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  56. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  57. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  58. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  59. package/dist-lib/host/websocket-proxy.cjs +1 -1
  60. package/dist-lib/index.cjs +10 -10
  61. package/dist-lib/jump-to-source-babel.cjs +1 -1
  62. package/dist-lib/jump-to-source-native.cjs +1 -1
  63. package/dist-lib/kotlin-host.cjs +7 -1
  64. package/dist-lib/menu.cjs +1 -1
  65. package/dist-lib/menu.mjs +1 -1
  66. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  67. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  68. package/dist-lib/metro-production-bundle.cjs +1 -1
  69. package/dist-lib/metro-production-bundle.mjs +1 -1
  70. package/dist-lib/metro.cjs +4 -4
  71. package/dist-lib/native-app-identity-project.cjs +2 -2
  72. package/dist-lib/native-app-identity-project.mjs +2 -2
  73. package/dist-lib/native-app-identity.cjs +1 -1
  74. package/dist-lib/native-app-identity.mjs +1 -1
  75. package/dist-lib/native-firebase-metadata.cjs +1 -1
  76. package/dist-lib/native-firebase-metadata.mjs +1 -1
  77. package/dist-lib/pdfium-raster.cjs +1 -1
  78. package/dist-lib/pdfium-raster.mjs +1 -1
  79. package/dist-lib/plist.cjs +1 -1
  80. package/dist-lib/plist.mjs +1 -1
  81. package/dist-lib/profiles.cjs +1 -1
  82. package/dist-lib/public-brand.cjs +1 -1
  83. package/dist-lib/public-origins-lib-esm.json +24 -24
  84. package/dist-lib/public-origins-lib.json +59 -53
  85. package/dist-lib/react-native-host-modules.cjs +1 -1
  86. package/dist-lib/react-native-host-modules.mjs +1 -1
  87. package/dist-lib/reap-browser.cjs +1 -1
  88. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  89. package/dist-lib/sdk.cjs +23 -23
  90. package/dist-lib/sdk.mjs +23 -23
  91. package/dist-lib/skills.cjs +5176 -75
  92. package/dist-lib/swift-compile.cjs +98 -6
  93. package/dist-lib/swift-compile.mjs +98 -6
  94. package/dist-lib/swift-package.cjs +1 -1
  95. package/dist-lib/swift-package.mjs +1 -1
  96. package/dist-lib/swift-submit.cjs +1 -1
  97. package/dist-lib/swift-submit.mjs +1 -1
  98. package/dist-lib/swift-toolchain.cjs +1 -1
  99. package/dist-lib/swift.cjs +1 -1
  100. package/dist-lib/vite-swift.cjs +351 -13
  101. package/dist-lib/vite.cjs +4 -4
  102. package/dist-lib/worklet-executable.cjs +1 -1
  103. package/dist-lib/worklet-executable.mjs +1 -1
  104. package/dist-types/packages/peach-engine/src/engine/animated.d.ts +2 -1
  105. package/dist-types/packages/peach-engine/src/engine/animation-graph.d.ts +1 -0
  106. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -1
  107. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +6 -0
  108. package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
  109. package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
  110. package/dist-types/packages/peach-engine/src/render-worker/canvaskit-webgpu.d.ts +8 -0
  111. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +3 -0
  112. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +14 -0
  113. package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/render-tree.d.ts +18 -0
  114. package/dist-types/packages/peach-engine/src/settings/store.d.ts +1 -0
  115. package/kotlin/sdk.tar.gz +0 -0
  116. package/package.json +1 -1
  117. package/runtime-companion.json +1 -1
  118. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSCompoundPredicate.h +1 -1
  119. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSExpression.h +1 -1
  120. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSISO8601DateFormatter.h +1 -1
  121. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSMeasurementFormatter.h +1 -1
  122. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +27 -0
  123. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +24 -0
  124. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +9 -0
  125. package/sdk/ios/System/Library/Frameworks/Intents.framework/Modules/module.modulemap +5 -0
  126. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFeedbackGenerator.h +1 -1
  127. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIImpactFeedbackGenerator.h +1 -1
  128. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UINibLoading.h +1 -1
  129. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UINotificationFeedbackGenerator.h +1 -1
  130. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISelectionFeedbackGenerator.h +1 -1
  131. package/sdk/ios/usr/include/ObjectiveC.apinotes +7 -0
  132. package/src/android-theme.ts +136 -2
  133. package/src/expo-swift-host.ts +90 -1
  134. package/src/generated/android-framework-text.json +4566 -0
  135. package/src/generated/android-framework-themes.json +11 -0
  136. package/src/kotlin-app.ts +24 -4
  137. package/src/kotlin-host.ts +9 -0
  138. package/src/nitro-adapter.lock.json +246 -246
  139. package/src/nitro-superset.lock.json +4 -4
  140. package/src/swift-compile.ts +120 -2
  141. package/src/swift-distribution.lock.json +8 -8
  142. package/src/swift-objc-standin.ts +9 -2
  143. package/src/swift-shared-sdk.ts +2 -1
  144. package/src/swift-standin-builtin-behavior.ts +248 -0
  145. package/src/swift-standin-emit.ts +2 -0
  146. package/src/swift-standins.ts +17 -5
  147. package/src/turbo-runtime.lock.json +17 -17
package/dist-lib/sdk.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2207 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2209 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -192,7 +192,7 @@ function isInspectPickCommand(subcommand) {
192
192
  async function isInspectModeActive(bridge) {
193
193
  const active = await bridge.send({
194
194
  type: "evaluate",
195
- code: "window.__sootsimEngineState?.inspectActive === true"
195
+ code: "globalThis.__sootsimEngineState?.inspectActive === true"
196
196
  });
197
197
  return active === true;
198
198
  }
@@ -441,7 +441,7 @@ function layoutGetNativeEval(opts = {}) {
441
441
  const includeStyle = opts.styling === true;
442
442
  const filter = opts.filter?.trim().toLowerCase() ?? "";
443
443
  return `(async () => {
444
- const t = window.__sootsimTest
444
+ const t = globalThis.__sootsimTest
445
445
  if (!t || typeof t.listInspectable !== 'function') return []
446
446
  const list = await t.listInspectable({})
447
447
  if (!Array.isArray(list)) return []
@@ -605,7 +605,7 @@ function layoutGetNativeEval(opts = {}) {
605
605
  const textElements = elements.filter((element) => element.text && element.fontSize > 0)
606
606
  if (!includeStyle || textElements.length === 0) return elements
607
607
 
608
- const screenshot = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.screenshot
608
+ const screenshot = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.screenshot
609
609
  if (typeof screenshot !== 'function') {
610
610
  throw new Error('styled native layout requires the peach capture bridge')
611
611
  }
@@ -1183,10 +1183,10 @@ function consoleEntriesEval(level, limit) {
1183
1183
  out.push({ timestamp: ts, args: Array.isArray(e.args) ? e.args : [e.args], stack: e.stack || undefined, source: e.source || undefined })
1184
1184
  }
1185
1185
  // page-realm ws-bridge buffer first (richest stacks for page-origin errors)
1186
- try { for (const e of (window.__sootsimConsole?.${getter}(${limit}) || [])) push(e) } catch {}
1186
+ try { for (const e of (globalThis.__sootsimConsole?.${getter}(${limit}) || [])) push(e) } catch {}
1187
1187
  // engine observability store \u2014 the always-on render-worker / forwarded path
1188
1188
  try {
1189
- const obs = window.__sootsimObservability
1189
+ const obs = globalThis.__sootsimObservability
1190
1190
  const snap = obs && obs.logs && typeof obs.logs.getSnapshot === 'function' ? obs.logs.getSnapshot() : []
1191
1191
  for (const e of snap) if (e && e.level === ${JSON.stringify(level)}) push(e)
1192
1192
  } catch {}
@@ -1222,12 +1222,12 @@ var MERGED_CONSOLE_COUNT_EVAL = `(() => {
1222
1222
  else warnings++
1223
1223
  }
1224
1224
  try {
1225
- const c = window.__sootsimConsole
1225
+ const c = globalThis.__sootsimConsole
1226
1226
  for (const e of (c?.getErrors?.(200) || [])) add('error', e?.timestamp ?? e?.ts, e?.args)
1227
1227
  for (const e of (c?.getWarnings?.(200) || [])) add('warn', e?.timestamp ?? e?.ts, e?.args)
1228
1228
  } catch {}
1229
1229
  try {
1230
- const obs = window.__sootsimObservability
1230
+ const obs = globalThis.__sootsimObservability
1231
1231
  const snap = obs && obs.logs && typeof obs.logs.getSnapshot === 'function' ? obs.logs.getSnapshot() : []
1232
1232
  for (const e of snap) if (e) add(e.level, e.ts, e.args)
1233
1233
  } catch {}
@@ -1236,7 +1236,7 @@ var MERGED_CONSOLE_COUNT_EVAL = `(() => {
1236
1236
  async function clearConsole(bridge) {
1237
1237
  await bridge.send({
1238
1238
  type: "evaluate",
1239
- code: 'window.__sootsimConsole?.clear(); window.__sootsimObservability?.logs?.clear?.(); "cleared"'
1239
+ code: 'globalThis.__sootsimConsole?.clear(); globalThis.__sootsimObservability?.logs?.clear?.(); "cleared"'
1240
1240
  });
1241
1241
  }
1242
1242
  async function inspectRequests(bridge, opts = {}) {
@@ -1303,7 +1303,7 @@ async function inspectLogs(bridge) {
1303
1303
  const res = await bridge.send({
1304
1304
  type: "evaluate",
1305
1305
  code: `(() => {
1306
- const obs = window.__sootsimObservability;
1306
+ const obs = globalThis.__sootsimObservability;
1307
1307
  if (!obs) return { ok: false };
1308
1308
  return { ok: true, entries: obs.logs.getSnapshot() };
1309
1309
  })()`
@@ -1314,7 +1314,7 @@ async function inspectLogs(bridge) {
1314
1314
  async function clearLogs(bridge) {
1315
1315
  await bridge.send({
1316
1316
  type: "evaluate",
1317
- code: 'window.__sootsimObservability?.logs.clear(); "cleared"'
1317
+ code: 'globalThis.__sootsimObservability?.logs.clear(); "cleared"'
1318
1318
  });
1319
1319
  }
1320
1320
  function isForwardedWorkerLogTwin(a, b) {
@@ -1400,7 +1400,7 @@ async function inspectKeyboard(bridge) {
1400
1400
  const result = await bridge.send({
1401
1401
  type: "evaluate",
1402
1402
  code: `(() => {
1403
- const kb = window.__sootsimKeyboard
1403
+ const kb = globalThis.__sootsimKeyboard
1404
1404
  if (!kb || typeof kb.getLayout !== 'function') {
1405
1405
  return { error: 'keyboard bridge getLayout() not available' }
1406
1406
  }
@@ -1432,8 +1432,8 @@ async function inspectScreens(bridge) {
1432
1432
  const payload = await bridge.send({
1433
1433
  type: "evaluate",
1434
1434
  code: `(async () => {
1435
- const test = window.__sootsimTest
1436
- const kb = window.__sootsimKeyboard
1435
+ const test = globalThis.__sootsimTest
1436
+ const kb = globalThis.__sootsimKeyboard
1437
1437
  const navSnap =
1438
1438
  test && typeof test.getNavigationSnapshot === 'function'
1439
1439
  ? await test.getNavigationSnapshot()
@@ -1476,7 +1476,7 @@ async function inspectDebugStatus(bridge, host = false) {
1476
1476
  if (bridge.plane === "cloud" && !host) {
1477
1477
  return (await inspectCloudDiagnostics(bridge)).channels;
1478
1478
  }
1479
- return bridge.send({ type: "evaluate", code: "window.__sootsimDebug.status()" });
1479
+ return bridge.send({ type: "evaluate", code: "globalThis.__sootsimDebug.status()" });
1480
1480
  }
1481
1481
  async function inspectDebugFlags(bridge, host = false) {
1482
1482
  if (bridge.plane === "cloud" && !host) {
@@ -1485,13 +1485,13 @@ async function inspectDebugFlags(bridge, host = false) {
1485
1485
  availableChannels.map((channel) => [channel, channels.includes(channel)])
1486
1486
  );
1487
1487
  }
1488
- return bridge.send({ type: "evaluate", code: "window.__sootsimDebug.flags()" });
1488
+ return bridge.send({ type: "evaluate", code: "globalThis.__sootsimDebug.flags()" });
1489
1489
  }
1490
1490
  async function inspectDebugChannels(bridge, host = false) {
1491
1491
  if (bridge.plane === "cloud" && !host) {
1492
1492
  return (await inspectCloudDiagnostics(bridge)).availableChannels;
1493
1493
  }
1494
- return bridge.send({ type: "evaluate", code: "window.__sootsimDebug.channels()" });
1494
+ return bridge.send({ type: "evaluate", code: "globalThis.__sootsimDebug.channels()" });
1495
1495
  }
1496
1496
  async function inspectDebugFind(bridge, target, host = false) {
1497
1497
  if (bridge.plane === "cloud" && !host) {
@@ -1499,7 +1499,7 @@ async function inspectDebugFind(bridge, target, host = false) {
1499
1499
  }
1500
1500
  return bridge.send({
1501
1501
  type: "evaluate",
1502
- code: `window.__sootsimTest.debugFind(${JSON.stringify(target)})`
1502
+ code: `globalThis.__sootsimTest.debugFind(${JSON.stringify(target)})`
1503
1503
  });
1504
1504
  }
1505
1505
  async function callDebugBridge(bridge, expression, host = false, project) {
@@ -1509,7 +1509,7 @@ async function callDebugBridge(bridge, expression, host = false, project) {
1509
1509
  return bridge.send({
1510
1510
  type: "evaluate",
1511
1511
  code: `(async () => {
1512
- const result = await window.__sootsimTest.evalInTenant(${JSON.stringify(code)})
1512
+ const result = await globalThis.__sootsimTest.evalInTenant(${JSON.stringify(code)})
1513
1513
  if (!result.ok) throw new Error(result.error)
1514
1514
  return result.value
1515
1515
  })()`
@@ -1582,17 +1582,17 @@ async function inspectMemory(bridge) {
1582
1582
  const result = await bridge.send({
1583
1583
  type: "evaluate",
1584
1584
  code: `(async () => {
1585
- const host = window.__sootsimRenderHost
1585
+ const host = globalThis.__sootsimRenderHost
1586
1586
  const stats = host?.queryStats ? await host.queryStats() : null
1587
- const shellRaw = window.__sootsimShellMemory
1588
- ? await window.__sootsimShellMemory()
1587
+ const shellRaw = globalThis.__sootsimShellMemory
1588
+ ? await globalThis.__sootsimShellMemory()
1589
1589
  : null
1590
1590
  const shell = shellRaw && !shellRaw.error ? shellRaw : null
1591
1591
  // the compositor paints home + app:one + app:two, so every app-surface
1592
1592
  // picture and raster image is counted here and nowhere else.
1593
1593
  let compositor = null
1594
1594
  try {
1595
- const cs = await window.__sootsimCompositor?.getStats?.(false, true)
1595
+ const cs = await globalThis.__sootsimCompositor?.getStats?.(false, true)
1596
1596
  compositor = cs?.memory ?? null
1597
1597
  } catch {}
1598
1598
  const normalize = (m) =>
package/dist-lib/sdk.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2207 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2209 | (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);
@@ -79,7 +79,7 @@ function isInspectPickCommand(subcommand) {
79
79
  async function isInspectModeActive(bridge) {
80
80
  const active = await bridge.send({
81
81
  type: "evaluate",
82
- code: "window.__sootsimEngineState?.inspectActive === true"
82
+ code: "globalThis.__sootsimEngineState?.inspectActive === true"
83
83
  });
84
84
  return active === true;
85
85
  }
@@ -328,7 +328,7 @@ function layoutGetNativeEval(opts = {}) {
328
328
  const includeStyle = opts.styling === true;
329
329
  const filter = opts.filter?.trim().toLowerCase() ?? "";
330
330
  return `(async () => {
331
- const t = window.__sootsimTest
331
+ const t = globalThis.__sootsimTest
332
332
  if (!t || typeof t.listInspectable !== 'function') return []
333
333
  const list = await t.listInspectable({})
334
334
  if (!Array.isArray(list)) return []
@@ -492,7 +492,7 @@ function layoutGetNativeEval(opts = {}) {
492
492
  const textElements = elements.filter((element) => element.text && element.fontSize > 0)
493
493
  if (!includeStyle || textElements.length === 0) return elements
494
494
 
495
- const screenshot = window.SootSim && window.SootSim.bridges && window.SootSim.bridges.screenshot
495
+ const screenshot = globalThis.SootSim && globalThis.SootSim.bridges && globalThis.SootSim.bridges.screenshot
496
496
  if (typeof screenshot !== 'function') {
497
497
  throw new Error('styled native layout requires the peach capture bridge')
498
498
  }
@@ -1070,10 +1070,10 @@ function consoleEntriesEval(level, limit) {
1070
1070
  out.push({ timestamp: ts, args: Array.isArray(e.args) ? e.args : [e.args], stack: e.stack || undefined, source: e.source || undefined })
1071
1071
  }
1072
1072
  // page-realm ws-bridge buffer first (richest stacks for page-origin errors)
1073
- try { for (const e of (window.__sootsimConsole?.${getter}(${limit}) || [])) push(e) } catch {}
1073
+ try { for (const e of (globalThis.__sootsimConsole?.${getter}(${limit}) || [])) push(e) } catch {}
1074
1074
  // engine observability store \u2014 the always-on render-worker / forwarded path
1075
1075
  try {
1076
- const obs = window.__sootsimObservability
1076
+ const obs = globalThis.__sootsimObservability
1077
1077
  const snap = obs && obs.logs && typeof obs.logs.getSnapshot === 'function' ? obs.logs.getSnapshot() : []
1078
1078
  for (const e of snap) if (e && e.level === ${JSON.stringify(level)}) push(e)
1079
1079
  } catch {}
@@ -1109,12 +1109,12 @@ var MERGED_CONSOLE_COUNT_EVAL = `(() => {
1109
1109
  else warnings++
1110
1110
  }
1111
1111
  try {
1112
- const c = window.__sootsimConsole
1112
+ const c = globalThis.__sootsimConsole
1113
1113
  for (const e of (c?.getErrors?.(200) || [])) add('error', e?.timestamp ?? e?.ts, e?.args)
1114
1114
  for (const e of (c?.getWarnings?.(200) || [])) add('warn', e?.timestamp ?? e?.ts, e?.args)
1115
1115
  } catch {}
1116
1116
  try {
1117
- const obs = window.__sootsimObservability
1117
+ const obs = globalThis.__sootsimObservability
1118
1118
  const snap = obs && obs.logs && typeof obs.logs.getSnapshot === 'function' ? obs.logs.getSnapshot() : []
1119
1119
  for (const e of snap) if (e) add(e.level, e.ts, e.args)
1120
1120
  } catch {}
@@ -1123,7 +1123,7 @@ var MERGED_CONSOLE_COUNT_EVAL = `(() => {
1123
1123
  async function clearConsole(bridge) {
1124
1124
  await bridge.send({
1125
1125
  type: "evaluate",
1126
- code: 'window.__sootsimConsole?.clear(); window.__sootsimObservability?.logs?.clear?.(); "cleared"'
1126
+ code: 'globalThis.__sootsimConsole?.clear(); globalThis.__sootsimObservability?.logs?.clear?.(); "cleared"'
1127
1127
  });
1128
1128
  }
1129
1129
  async function inspectRequests(bridge, opts = {}) {
@@ -1190,7 +1190,7 @@ async function inspectLogs(bridge) {
1190
1190
  const res = await bridge.send({
1191
1191
  type: "evaluate",
1192
1192
  code: `(() => {
1193
- const obs = window.__sootsimObservability;
1193
+ const obs = globalThis.__sootsimObservability;
1194
1194
  if (!obs) return { ok: false };
1195
1195
  return { ok: true, entries: obs.logs.getSnapshot() };
1196
1196
  })()`
@@ -1201,7 +1201,7 @@ async function inspectLogs(bridge) {
1201
1201
  async function clearLogs(bridge) {
1202
1202
  await bridge.send({
1203
1203
  type: "evaluate",
1204
- code: 'window.__sootsimObservability?.logs.clear(); "cleared"'
1204
+ code: 'globalThis.__sootsimObservability?.logs.clear(); "cleared"'
1205
1205
  });
1206
1206
  }
1207
1207
  function isForwardedWorkerLogTwin(a, b) {
@@ -1287,7 +1287,7 @@ async function inspectKeyboard(bridge) {
1287
1287
  const result = await bridge.send({
1288
1288
  type: "evaluate",
1289
1289
  code: `(() => {
1290
- const kb = window.__sootsimKeyboard
1290
+ const kb = globalThis.__sootsimKeyboard
1291
1291
  if (!kb || typeof kb.getLayout !== 'function') {
1292
1292
  return { error: 'keyboard bridge getLayout() not available' }
1293
1293
  }
@@ -1319,8 +1319,8 @@ async function inspectScreens(bridge) {
1319
1319
  const payload = await bridge.send({
1320
1320
  type: "evaluate",
1321
1321
  code: `(async () => {
1322
- const test = window.__sootsimTest
1323
- const kb = window.__sootsimKeyboard
1322
+ const test = globalThis.__sootsimTest
1323
+ const kb = globalThis.__sootsimKeyboard
1324
1324
  const navSnap =
1325
1325
  test && typeof test.getNavigationSnapshot === 'function'
1326
1326
  ? await test.getNavigationSnapshot()
@@ -1363,7 +1363,7 @@ async function inspectDebugStatus(bridge, host = false) {
1363
1363
  if (bridge.plane === "cloud" && !host) {
1364
1364
  return (await inspectCloudDiagnostics(bridge)).channels;
1365
1365
  }
1366
- return bridge.send({ type: "evaluate", code: "window.__sootsimDebug.status()" });
1366
+ return bridge.send({ type: "evaluate", code: "globalThis.__sootsimDebug.status()" });
1367
1367
  }
1368
1368
  async function inspectDebugFlags(bridge, host = false) {
1369
1369
  if (bridge.plane === "cloud" && !host) {
@@ -1372,13 +1372,13 @@ async function inspectDebugFlags(bridge, host = false) {
1372
1372
  availableChannels.map((channel) => [channel, channels.includes(channel)])
1373
1373
  );
1374
1374
  }
1375
- return bridge.send({ type: "evaluate", code: "window.__sootsimDebug.flags()" });
1375
+ return bridge.send({ type: "evaluate", code: "globalThis.__sootsimDebug.flags()" });
1376
1376
  }
1377
1377
  async function inspectDebugChannels(bridge, host = false) {
1378
1378
  if (bridge.plane === "cloud" && !host) {
1379
1379
  return (await inspectCloudDiagnostics(bridge)).availableChannels;
1380
1380
  }
1381
- return bridge.send({ type: "evaluate", code: "window.__sootsimDebug.channels()" });
1381
+ return bridge.send({ type: "evaluate", code: "globalThis.__sootsimDebug.channels()" });
1382
1382
  }
1383
1383
  async function inspectDebugFind(bridge, target, host = false) {
1384
1384
  if (bridge.plane === "cloud" && !host) {
@@ -1386,7 +1386,7 @@ async function inspectDebugFind(bridge, target, host = false) {
1386
1386
  }
1387
1387
  return bridge.send({
1388
1388
  type: "evaluate",
1389
- code: `window.__sootsimTest.debugFind(${JSON.stringify(target)})`
1389
+ code: `globalThis.__sootsimTest.debugFind(${JSON.stringify(target)})`
1390
1390
  });
1391
1391
  }
1392
1392
  async function callDebugBridge(bridge, expression, host = false, project) {
@@ -1396,7 +1396,7 @@ async function callDebugBridge(bridge, expression, host = false, project) {
1396
1396
  return bridge.send({
1397
1397
  type: "evaluate",
1398
1398
  code: `(async () => {
1399
- const result = await window.__sootsimTest.evalInTenant(${JSON.stringify(code)})
1399
+ const result = await globalThis.__sootsimTest.evalInTenant(${JSON.stringify(code)})
1400
1400
  if (!result.ok) throw new Error(result.error)
1401
1401
  return result.value
1402
1402
  })()`
@@ -1469,17 +1469,17 @@ async function inspectMemory(bridge) {
1469
1469
  const result = await bridge.send({
1470
1470
  type: "evaluate",
1471
1471
  code: `(async () => {
1472
- const host = window.__sootsimRenderHost
1472
+ const host = globalThis.__sootsimRenderHost
1473
1473
  const stats = host?.queryStats ? await host.queryStats() : null
1474
- const shellRaw = window.__sootsimShellMemory
1475
- ? await window.__sootsimShellMemory()
1474
+ const shellRaw = globalThis.__sootsimShellMemory
1475
+ ? await globalThis.__sootsimShellMemory()
1476
1476
  : null
1477
1477
  const shell = shellRaw && !shellRaw.error ? shellRaw : null
1478
1478
  // the compositor paints home + app:one + app:two, so every app-surface
1479
1479
  // picture and raster image is counted here and nowhere else.
1480
1480
  let compositor = null
1481
1481
  try {
1482
- const cs = await window.__sootsimCompositor?.getStats?.(false, true)
1482
+ const cs = await globalThis.__sootsimCompositor?.getStats?.(false, true)
1483
1483
  compositor = cs?.memory ?? null
1484
1484
  } catch {}
1485
1485
  const normalize = (m) =>