peachsim 0.1.661 → 0.1.662

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 (75) hide show
  1. package/cli/commands/inspect/wait-ready.ts +10 -1
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/agent-identity.cjs +1 -1
  5. package/dist-lib/agent-sessions.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/capture-contract.cjs +1 -1
  17. package/dist-lib/capture-contract.mjs +1 -1
  18. package/dist-lib/cli-constants.cjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +1 -1
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +1 -1
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/detox/index.cjs +1 -1
  27. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  28. package/dist-lib/home-paths.cjs +1 -1
  29. package/dist-lib/host/bridge-host.cjs +1 -1
  30. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  31. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  32. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  33. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  34. package/dist-lib/host/websocket-proxy.cjs +1 -1
  35. package/dist-lib/index.cjs +1 -1
  36. package/dist-lib/jump-to-source-babel.cjs +1 -1
  37. package/dist-lib/jump-to-source-native.cjs +1 -1
  38. package/dist-lib/kotlin-host.cjs +191 -60
  39. package/dist-lib/menu.cjs +1 -1
  40. package/dist-lib/menu.mjs +1 -1
  41. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  43. package/dist-lib/metro-production-bundle.cjs +1 -1
  44. package/dist-lib/metro-production-bundle.mjs +1 -1
  45. package/dist-lib/metro.cjs +1 -1
  46. package/dist-lib/native-app-identity.cjs +1 -1
  47. package/dist-lib/native-app-identity.mjs +1 -1
  48. package/dist-lib/plist.cjs +1 -1
  49. package/dist-lib/plist.mjs +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 +1 -1
  57. package/dist-lib/sdk.mjs +1 -1
  58. package/dist-lib/skills.cjs +1 -1
  59. package/dist-lib/swift-compile.cjs +1 -1
  60. package/dist-lib/swift-compile.mjs +1 -1
  61. package/dist-lib/swift-package.cjs +1 -1
  62. package/dist-lib/swift-package.mjs +1 -1
  63. package/dist-lib/swift-submit.cjs +1 -1
  64. package/dist-lib/swift-submit.mjs +1 -1
  65. package/dist-lib/swift.cjs +1 -1
  66. package/dist-lib/vite-swift.cjs +1 -1
  67. package/dist-lib/vite.cjs +1 -1
  68. package/kotlin/AppSources/androidx/activity/ActivityViewModelLazy.kt +21 -0
  69. package/kotlin/AppSources/androidx/activity/ComponentActivity.kt +5 -3
  70. package/kotlin/AppSources/androidx/lifecycle/AndroidViewModel.kt +10 -0
  71. package/kotlin/AppSources/dev/peach/app/PeachApp.kt +8 -0
  72. package/kotlin/tools/abi-classes.main.kts +41 -0
  73. package/package.json +1 -1
  74. package/src/kotlin-host.ts +91 -10
  75. package/src/kotlin-view-models.ts +133 -0
@@ -65,8 +65,17 @@ export async function runWaitReadySubcommand(opts: {
65
65
  )
66
66
  rnxExit(1)
67
67
  }
68
+ // the app keeps mounting while it settles, so report the settled tree,
69
+ // not the first one that counted as ready.
70
+ const settled = await inspectWaitReady(bridge, 1_000)
71
+ if (!settled.ready) {
72
+ console.error(
73
+ ` ⚠ wait ready: the app stopped being ready while it settled — ${waitReadyReason(settled)} (nodes: ${settled.nodes}, targets: ${settled.targets}, errors: ${settled.errors})`,
74
+ )
75
+ rnxExit(1)
76
+ }
68
77
  console.log(
69
- ` ready in ${elapsedMs + idle.elapsed}ms: ${nodes} nodes, ${targets} targets${liveFrameActive ? `, ${liveFrameChannels} live surfaces` : ''}`,
78
+ ` ready in ${elapsedMs + idle.elapsed}ms: ${settled.nodes} nodes, ${settled.targets} targets${settled.liveFrameActive ? `, ${settled.liveFrameChannels} live surfaces` : ''}`,
70
79
  )
71
80
  return
72
81
  }
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/beta.ts
4
4
  var IS_BETA = true;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var SIM_LONG_PRESS_MAX_MS = 5e3;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var REFUSED_PERFORM_STEP_TYPES = [
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/capture-contract.ts
4
4
  var RNX_SCREEN_CAPTURE_VERSION = 1;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-contract.ts
4
4
  var RNX_CLOUD_MAX_ARTIFACT_BYTES = 20 * 1024 * 1024;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-test-args.ts
4
4
  var CLOUD_TEST_ARGS_MAX_COUNT = 32;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/host/fetch-proxy-overrides.ts
4
4
  var FETCH_PROXY_BROWSER_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (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;
@@ -65,6 +65,81 @@ function isRecord(value) {
65
65
  return typeof value === "object" && value !== null && !Array.isArray(value);
66
66
  }
67
67
 
68
+ // src/kotlin-view-models.ts
69
+ var VIEW_MODEL = "androidx.lifecycle.ViewModel";
70
+ var ANDROID_VIEW_MODEL = "androidx.lifecycle.AndroidViewModel";
71
+ var APPLICATION = "android.app.Application";
72
+ var HANDLE = "androidx.lifecycle.SavedStateHandle";
73
+ function strings(value) {
74
+ if (!Array.isArray(value) || !value.every((item) => typeof item === "string"))
75
+ throw new Error("abi-classes printed an invalid list");
76
+ return value;
77
+ }
78
+ function readAbiClasses(output) {
79
+ return output.split("\n").filter((line) => line.startsWith("{")).map((line) => {
80
+ const row = JSON.parse(line);
81
+ if (!isRecord(row) || typeof row.name !== "string" || typeof row.kind !== "string" || typeof row.modality !== "string" || typeof row.inner !== "boolean" || typeof row.generic !== "boolean" || !Array.isArray(row.constructors))
82
+ throw new Error(`abi-classes printed an invalid class: ${line}`);
83
+ return {
84
+ name: row.name,
85
+ kind: row.kind,
86
+ modality: row.modality,
87
+ inner: row.inner,
88
+ generic: row.generic,
89
+ supers: strings(row.supers),
90
+ constructors: row.constructors.map((constructor) => {
91
+ if (!isRecord(constructor) || typeof constructor.defaulted !== "boolean")
92
+ throw new Error(`abi-classes printed an invalid constructor: ${line}`);
93
+ return {
94
+ parameters: strings(constructor.parameters),
95
+ defaulted: constructor.defaulted
96
+ };
97
+ })
98
+ };
99
+ });
100
+ }
101
+ function matching(row, signature) {
102
+ for (const { parameters } of row.constructors) {
103
+ if (parameters.join() === signature.join()) return "match";
104
+ if (parameters.length === signature.length && signature.every((type) => parameters.includes(type)))
105
+ return "misordered";
106
+ }
107
+ return null;
108
+ }
109
+ function signatureOf(row, android) {
110
+ const handled = matching(row, android ? [APPLICATION, HANDLE] : [HANDLE]);
111
+ if (handled === "misordered") return "misordered";
112
+ if (handled) return android ? "application-handle" : "handle";
113
+ if (android)
114
+ return row.constructors.some(({ parameters }) => parameters.join() === APPLICATION) ? "application" : null;
115
+ return row.constructors.some(
116
+ ({ parameters, defaulted }) => parameters.length === 0 || defaulted
117
+ ) ? "none" : null;
118
+ }
119
+ function viewModelClasses(rows) {
120
+ const byName = new Map(rows.map((row) => [row.name, row]));
121
+ const base = (row, seen) => {
122
+ for (const name of row.supers) {
123
+ if (name === VIEW_MODEL || name === ANDROID_VIEW_MODEL) return name;
124
+ const parent = byName.get(name);
125
+ if (parent && !seen.has(name)) {
126
+ seen.add(name);
127
+ const found = base(parent, seen);
128
+ if (found) return found;
129
+ }
130
+ }
131
+ return null;
132
+ };
133
+ return rows.flatMap((row) => {
134
+ if (row.kind !== "CLASS" || row.inner || row.generic) return [];
135
+ if (row.modality === "ABSTRACT" || row.modality === "SEALED") return [];
136
+ const root = base(row, /* @__PURE__ */ new Set());
137
+ if (!root) return [];
138
+ const signature = signatureOf(row, root === ANDROID_VIEW_MODEL);
139
+ return signature ? [{ name: row.name, signature }] : [];
140
+ });
141
+ }
142
+
68
143
  // src/kotlin-host.ts
69
144
  var run = (0, import_node_util.promisify)(import_node_child_process.execFile);
70
145
  var KOTLIN_ARTIFACT_PREFIX = "/__peach/kotlin-artifact/";
@@ -236,7 +311,7 @@ function entrySource(ids) {
236
311
  ""
237
312
  ].join("\n");
238
313
  }
239
- var BUILD_FORMAT = 7;
314
+ var BUILD_FORMAT = 8;
240
315
  var builds = /* @__PURE__ */ new Map();
241
316
  function buildsDir() {
242
317
  return import_node_path2.default.join(kotlinHome(), "builds");
@@ -283,45 +358,68 @@ function viewsSource(viewIds) {
283
358
  "}"
284
359
  ].join("\n");
285
360
  }
361
+ function viewModelInitializer({ name, signature }) {
362
+ const call = (args) => ` addInitializer(${name}::class) { ${name}(${args}) }`;
363
+ switch (signature) {
364
+ case "none":
365
+ return call("");
366
+ case "handle":
367
+ return call("createSavedStateHandle()");
368
+ case "application":
369
+ return call("dev.peach.app.peachApplication()");
370
+ case "application-handle":
371
+ return call("dev.peach.app.peachApplication(), createSavedStateHandle()");
372
+ case "misordered":
373
+ return ` addInitializer(${name}::class) { throw UnsupportedOperationException(${JSON.stringify(
374
+ `Class ${name.split(".").pop()} must have parameters in the proper order: [class android.app.Application, class androidx.lifecycle.SavedStateHandle]`
375
+ )}) }`;
376
+ }
377
+ }
286
378
  async function kotlinAppArtifact(app, moduleRoot, origin) {
287
379
  const toolchain = readToolchain(moduleRoot);
288
380
  const kotlinString = (value) => JSON.stringify(value).replaceAll("$", "\\$");
381
+ const appEntry = (viewModels) => [
382
+ "@file:OptIn(kotlin.js.ExperimentalJsExport::class)",
383
+ "",
384
+ "import androidx.lifecycle.createSavedStateHandle",
385
+ "",
386
+ "@JsExport",
387
+ "fun peachAppMount(density: Float, fontScale: Float, locale: String, backend: String, stencilBits: Int,",
388
+ " regular: String, medium: String, bold: String, insets: String, night: Boolean,",
389
+ " invalidate: (Boolean) -> Unit): String = dev.peach.app.peachStartApp(",
390
+ " dev.peach.app.PeachAppSpec(",
391
+ ` android.content.ComponentName(${kotlinString(app.packageName)}, ${kotlinString(app.launcher.name)}),`,
392
+ ` android.content.ComponentName(${kotlinString(app.packageName)}, ${kotlinString(app.launcher.targetClass)}),`,
393
+ " android.view.WindowTheme(",
394
+ ` ${app.window.edgeToEdgeEnforced}, 0x${app.window.statusBarColor.toString(16).padStart(8, "0")}.toInt(),`,
395
+ ` 0x${app.window.navigationBarColor.toString(16).padStart(8, "0")}.toInt(),`,
396
+ ` ${app.window.statusBarContrastEnforced}, ${app.window.navigationBarContrastEnforced},`,
397
+ ` ${app.window.lightStatusBar}, ${app.window.lightNavigationBar},`,
398
+ " ),",
399
+ ` { ${app.applicationClass ?? "android.app.Application"}() },`,
400
+ ` { ${app.launcher.targetClass}() },`,
401
+ ` ${app.handlesUiMode},`,
402
+ " androidx.lifecycle.viewmodel.viewModelFactory {",
403
+ ...viewModels.map(viewModelInitializer),
404
+ " },",
405
+ " ),",
406
+ " density, fontScale, locale, backend, stencilBits, regular, medium, bold, insets, night, invalidate,",
407
+ ")",
408
+ "",
409
+ "@JsExport",
410
+ `fun peachAppBack(): Boolean = dev.peach.app.peachAppBack(${app.predictiveBack})`,
411
+ "",
412
+ "@JsExport",
413
+ "fun peachAppTask(foreground: Boolean) = dev.peach.app.peachAppTask(foreground)",
414
+ "",
415
+ "@JsExport",
416
+ "fun peachAppNight(night: Boolean) = dev.peach.app.peachAppNight(night)",
417
+ ""
418
+ ].join("\n");
289
419
  const generated = {
290
420
  "PeachEntry.kt": entrySource([]),
291
421
  "PeachViews.kt": viewsSource([]),
292
- "PeachAppEntry.kt": [
293
- "@file:OptIn(kotlin.js.ExperimentalJsExport::class)",
294
- "",
295
- "@JsExport",
296
- "fun peachAppMount(density: Float, fontScale: Float, locale: String, backend: String, stencilBits: Int,",
297
- " regular: String, medium: String, bold: String, insets: String, night: Boolean,",
298
- " invalidate: (Boolean) -> Unit): String = dev.peach.app.peachStartApp(",
299
- " dev.peach.app.PeachAppSpec(",
300
- ` android.content.ComponentName(${kotlinString(app.packageName)}, ${kotlinString(app.launcher.name)}),`,
301
- ` android.content.ComponentName(${kotlinString(app.packageName)}, ${kotlinString(app.launcher.targetClass)}),`,
302
- " android.view.WindowTheme(",
303
- ` ${app.window.edgeToEdgeEnforced}, 0x${app.window.statusBarColor.toString(16).padStart(8, "0")}.toInt(),`,
304
- ` 0x${app.window.navigationBarColor.toString(16).padStart(8, "0")}.toInt(),`,
305
- ` ${app.window.statusBarContrastEnforced}, ${app.window.navigationBarContrastEnforced},`,
306
- ` ${app.window.lightStatusBar}, ${app.window.lightNavigationBar},`,
307
- " ),",
308
- ` { ${app.applicationClass ?? "android.app.Application"}() },`,
309
- ` { ${app.launcher.targetClass}() },`,
310
- ` ${app.handlesUiMode},`,
311
- " ),",
312
- " density, fontScale, locale, backend, stencilBits, regular, medium, bold, insets, night, invalidate,",
313
- ")",
314
- "",
315
- "@JsExport",
316
- `fun peachAppBack(): Boolean = dev.peach.app.peachAppBack(${app.predictiveBack})`,
317
- "",
318
- "@JsExport",
319
- "fun peachAppTask(foreground: Boolean) = dev.peach.app.peachAppTask(foreground)",
320
- "",
321
- "@JsExport",
322
- "fun peachAppNight(night: Boolean) = dev.peach.app.peachAppNight(night)",
323
- ""
324
- ].join("\n")
422
+ "PeachAppEntry.kt": appEntry([])
325
423
  };
326
424
  const shims = [
327
425
  ...kotlinSources(import_node_path2.default.join(moduleRoot, "Sources")),
@@ -336,13 +434,27 @@ async function kotlinAppArtifact(app, moduleRoot, origin) {
336
434
  sources: app.sources,
337
435
  generated,
338
436
  shims,
339
- usesCompose: true
437
+ usesCompose: true,
438
+ viewModels: {
439
+ file: "PeachAppEntry.kt",
440
+ render: appEntry,
441
+ script: import_node_path2.default.join(moduleRoot, "tools/abi-classes.main.kts")
442
+ }
340
443
  },
341
444
  origin
342
445
  );
343
446
  }
344
447
  async function compileKotlin(input, origin) {
345
- const { root, toolchain, language, sources, generated, shims, usesCompose } = input;
448
+ const {
449
+ root,
450
+ toolchain,
451
+ language,
452
+ sources,
453
+ generated,
454
+ shims,
455
+ usesCompose,
456
+ viewModels
457
+ } = input;
346
458
  const digest = (0, import_node_crypto.createHash)("sha256");
347
459
  digest.update(JSON.stringify({ format: BUILD_FORMAT, toolchain, language }));
348
460
  for (const file of [...shims, ...sources])
@@ -388,30 +500,49 @@ async function compileKotlin(input, origin) {
388
500
  "-libraries",
389
501
  libraries.join(import_node_path2.default.delimiter)
390
502
  ];
503
+ const compileKlib = (outputDir) => run(
504
+ kotlinc,
505
+ [
506
+ ...common,
507
+ ...usesCompose ? [
508
+ `-Xplugin=${import_node_path2.default.resolve(import_node_path2.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
509
+ ] : [],
510
+ "-language-version",
511
+ language,
512
+ "-api-version",
513
+ language,
514
+ "-nowarn",
515
+ "-nopack",
516
+ "-ir-output-dir",
517
+ outputDir,
518
+ "-ir-output-name",
519
+ "app",
520
+ ...shims,
521
+ ...sources,
522
+ ...Object.keys(generated).map((name) => import_node_path2.default.join(generatedDir, name))
523
+ ],
524
+ { maxBuffer: 16 * 1024 * 1024 }
525
+ );
391
526
  try {
392
- await run(
393
- kotlinc,
394
- [
395
- ...common,
396
- ...usesCompose ? [
397
- `-Xplugin=${import_node_path2.default.resolve(import_node_path2.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
398
- ] : [],
399
- "-language-version",
400
- language,
401
- "-api-version",
402
- language,
403
- "-nowarn",
404
- "-nopack",
405
- "-ir-output-dir",
406
- import_node_path2.default.join(work, "klib"),
407
- "-ir-output-name",
408
- "app",
409
- ...shims,
410
- ...sources,
411
- ...Object.keys(generated).map((name) => import_node_path2.default.join(generatedDir, name))
412
- ],
413
- { maxBuffer: 16 * 1024 * 1024 }
414
- );
527
+ if (viewModels && sources.some((file) => import_node_fs.default.readFileSync(file, "utf8").includes("ViewModel"))) {
528
+ await compileKlib(import_node_path2.default.join(work, "abi"));
529
+ const { stdout } = await run(
530
+ import_node_path2.default.join(import_node_path2.default.dirname(kotlinc), "kotlinc"),
531
+ [
532
+ "-cp",
533
+ import_node_path2.default.resolve(import_node_path2.default.dirname(kotlinc), "../lib/kotlin-compiler.jar"),
534
+ "-script",
535
+ viewModels.script,
536
+ import_node_path2.default.join(work, "abi")
537
+ ],
538
+ { maxBuffer: 64 * 1024 * 1024 }
539
+ );
540
+ import_node_fs.default.writeFileSync(
541
+ import_node_path2.default.join(generatedDir, viewModels.file),
542
+ viewModels.render(viewModelClasses(readAbiClasses(stdout)))
543
+ );
544
+ }
545
+ await compileKlib(import_node_path2.default.join(work, "klib"));
415
546
  await run(
416
547
  kotlinc,
417
548
  [
package/dist-lib/menu.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/menu.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/public-brand.ts
4
4
  var name = "Peach";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/metro-production-bundle.ts
4
4
  var RNXSIM_METRO_MODULE_PATHS_PREFIX = "globalThis.__sootsimModulePaths=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.662 | (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;