peachsim 0.1.659 → 0.1.661

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 (96) hide show
  1. package/README.md +10 -15
  2. package/cli/cli-update.ts +53 -21
  3. package/cli/commands/compat.ts +6 -2
  4. package/cli/commands/control.ts +12 -3
  5. package/cli/commands/inspect.ts +16 -14
  6. package/cli/commands/upgrade.ts +4 -2
  7. package/cli/current-sim.ts +4 -0
  8. package/cli/drivers/linux-browser-libs.lock.json +1088 -0
  9. package/cli/drivers/linux-browser-libs.ts +182 -0
  10. package/cli/drivers/playwright-provisioning.ts +20 -98
  11. package/cli/drivers/playwright-sim-host.ts +9 -0
  12. package/cli/drivers/playwright.ts +2 -1
  13. package/dist-lib/agent-daemon-client.cjs +1 -1
  14. package/dist-lib/agent-events.cjs +1 -1
  15. package/dist-lib/agent-identity.cjs +1 -1
  16. package/dist-lib/agent-sessions.cjs +1 -1
  17. package/dist-lib/attached-projects.cjs +1 -1
  18. package/dist-lib/auth/shared-session.cjs +1 -1
  19. package/dist-lib/backend-origin.cjs +18 -1
  20. package/dist-lib/beta.cjs +1 -1
  21. package/dist-lib/beta.mjs +1 -1
  22. package/dist-lib/bridge-constants.cjs +1 -1
  23. package/dist-lib/bridge-contract-input.cjs +1 -1
  24. package/dist-lib/bridge-contract-input.mjs +1 -1
  25. package/dist-lib/bridge-contract.cjs +1 -1
  26. package/dist-lib/bridge-contract.mjs +1 -1
  27. package/dist-lib/capture-contract.cjs +1 -1
  28. package/dist-lib/capture-contract.mjs +1 -1
  29. package/dist-lib/cli-constants.cjs +1 -1
  30. package/dist-lib/cloud-contract.cjs +1 -1
  31. package/dist-lib/cloud-contract.mjs +1 -1
  32. package/dist-lib/cloud-test-args.cjs +1 -1
  33. package/dist-lib/cloud-test-args.mjs +1 -1
  34. package/dist-lib/cloud.cjs +1 -1
  35. package/dist-lib/cloud.mjs +1 -1
  36. package/dist-lib/config.cjs +1 -1
  37. package/dist-lib/detox/index.cjs +1 -1
  38. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  39. package/dist-lib/home-paths.cjs +1 -1
  40. package/dist-lib/host/bridge-host.cjs +45 -41
  41. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  42. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  43. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  44. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  45. package/dist-lib/host/websocket-proxy.cjs +1 -1
  46. package/dist-lib/index.cjs +5 -1
  47. package/dist-lib/jump-to-source-babel.cjs +1 -1
  48. package/dist-lib/jump-to-source-native.cjs +1 -1
  49. package/dist-lib/kotlin-host.cjs +8 -3
  50. package/dist-lib/menu.cjs +1 -1
  51. package/dist-lib/menu.mjs +1 -1
  52. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  53. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  54. package/dist-lib/metro-production-bundle.cjs +1 -1
  55. package/dist-lib/metro-production-bundle.mjs +1 -1
  56. package/dist-lib/metro.cjs +1 -1
  57. package/dist-lib/native-app-identity.cjs +1 -1
  58. package/dist-lib/native-app-identity.mjs +1 -1
  59. package/dist-lib/plist.cjs +1 -1
  60. package/dist-lib/plist.mjs +1 -1
  61. package/dist-lib/profiles.cjs +1 -1
  62. package/dist-lib/public-brand.cjs +1 -1
  63. package/dist-lib/react-native-host-modules.cjs +1 -1
  64. package/dist-lib/react-native-host-modules.mjs +1 -1
  65. package/dist-lib/render-mode.cjs +1 -1
  66. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  67. package/dist-lib/sdk.cjs +1 -1
  68. package/dist-lib/sdk.mjs +1 -1
  69. package/dist-lib/skills.cjs +1339 -180
  70. package/dist-lib/swift-compile.cjs +1 -1
  71. package/dist-lib/swift-compile.mjs +1 -1
  72. package/dist-lib/swift-package.cjs +1 -1
  73. package/dist-lib/swift-package.mjs +1 -1
  74. package/dist-lib/swift-submit.cjs +1 -1
  75. package/dist-lib/swift-submit.mjs +1 -1
  76. package/dist-lib/swift.cjs +1 -1
  77. package/dist-lib/vite-swift.cjs +1 -1
  78. package/dist-lib/vite.cjs +1 -1
  79. package/kotlin/AppSources/android/app/Activity.kt +48 -3
  80. package/kotlin/AppSources/android/app/Application.kt +4 -0
  81. package/kotlin/AppSources/android/content/res/Configuration.kt +4 -0
  82. package/kotlin/AppSources/android/content/res/Resources.kt +3 -1
  83. package/kotlin/AppSources/android/view/Window.kt +15 -9
  84. package/kotlin/AppSources/androidx/activity/ComponentActivity.kt +36 -3
  85. package/kotlin/AppSources/dev/peach/app/PeachApp.kt +233 -86
  86. package/kotlin/ComposeSources/PeachComposeHost.kt +15 -3
  87. package/kotlin/fork/README.md +1 -0
  88. package/kotlin/fork/compose-worker-globals.patch +26 -0
  89. package/kotlin/fork/fork.json +1 -1
  90. package/kotlin/toolchain.json +3 -3
  91. package/package.json +2 -1
  92. package/src/android-theme.ts +14 -0
  93. package/src/backend-origin.ts +25 -0
  94. package/src/host/bridge-host.ts +24 -37
  95. package/src/kotlin-app.ts +29 -4
  96. package/src/kotlin-host.ts +7 -2
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.659 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.661 | (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.659 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/swift-compile.ts
4
4
  import { execFile as execFile2 } from "node:child_process";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.659 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.661 | (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.659 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/swift-package.ts
4
4
  function isSwiftManifestFile(file) {
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.659 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.661 | (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.659 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.661 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/swift-submit.ts
4
4
  var SWIFT_COMPILE_PATH = "/api/swift-compile";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.659 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.661 | (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.659 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.661 | (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;
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.659 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.661 | (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;
@@ -3,6 +3,7 @@ package android.app
3
3
  import android.content.ComponentName
4
4
  import android.content.ContextWrapper
5
5
  import android.content.Intent
6
+ import android.content.res.Configuration
6
7
  import android.os.Bundle
7
8
  import android.util.SuperNotCalledException
8
9
  import android.view.View
@@ -28,11 +29,28 @@ open class Activity : ContextWrapper() {
28
29
  // still names the alias
29
30
  val componentName: ComponentName get() = checkNotNull(attachedComponent)
30
31
 
31
- internal fun attach(application: Application, component: ComponentName, intent: Intent, window: Window) {
32
+ // what the activity this one replaces returned from
33
+ // onRetainNonConfigurationInstance, across a configuration relaunch
34
+ var lastNonConfigurationInstance: Any? = null
35
+ private set
36
+
37
+ // true from the start of a configuration relaunch until this instance is
38
+ // destroyed, so its owners keep what the next instance takes over
39
+ var isChangingConfigurations = false
40
+ internal set
41
+
42
+ internal fun attach(
43
+ application: Application,
44
+ component: ComponentName,
45
+ intent: Intent,
46
+ window: Window,
47
+ lastNonConfigurationInstance: Any?,
48
+ ) {
32
49
  attachedApplication = application
33
50
  attachedComponent = component
34
51
  attachedIntent = intent
35
52
  attachedWindow = window
53
+ this.lastNonConfigurationInstance = lastNonConfigurationInstance
36
54
  }
37
55
 
38
56
  open fun setContentView(view: View) {
@@ -52,9 +70,18 @@ open class Activity : ContextWrapper() {
52
70
  protected open fun onStop() { called = true }
53
71
  protected open fun onRestart() { called = true }
54
72
 
55
- // Activity's own save writes the window's view hierarchy state; the decor
56
- // window here holds no view state of its own
73
+ protected open fun onDestroy() { called = true }
74
+
75
+ // a configuration change the manifest's configChanges lets it handle
76
+ // itself, without a relaunch
77
+ open fun onConfigurationChanged(newConfig: Configuration) { called = true }
78
+
79
+ // Activity's own save and restore carry the window's view hierarchy state;
80
+ // the decor window here holds no view state of its own
57
81
  protected open fun onSaveInstanceState(outState: Bundle) {}
82
+ protected open fun onRestoreInstanceState(savedInstanceState: Bundle) {}
83
+
84
+ open fun onRetainNonConfigurationInstance(): Any? = null
58
85
 
59
86
  // a back the window's callbacks left: the activity asks the task manager,
60
87
  // which moves a root launcher task to the back rather than finishing it
@@ -72,6 +99,7 @@ open class Activity : ContextWrapper() {
72
99
  internal open fun dispatchActivityPostResumed() {}
73
100
  internal open fun dispatchActivityPrePaused() {}
74
101
  internal open fun dispatchActivityPreStopped() {}
102
+ internal open fun dispatchActivityPreDestroyed() {}
75
103
 
76
104
  private fun require(method: String, call: () -> Unit) {
77
105
  called = false
@@ -112,6 +140,23 @@ open class Activity : ContextWrapper() {
112
140
  onSaveInstanceState(outState)
113
141
  }
114
142
 
143
+ // ActivityThread restores after onStart, only with saved state
144
+ internal fun performRestoreInstanceState(savedInstanceState: Bundle) {
145
+ onRestoreInstanceState(savedInstanceState)
146
+ }
147
+
148
+ // ActivityThread collects what the next instance keeps before onDestroy
149
+ internal fun retainNonConfigurationInstances(): Any? = onRetainNonConfigurationInstance()
150
+
151
+ internal fun performDestroy() {
152
+ dispatchActivityPreDestroyed()
153
+ require("onDestroy") { onDestroy() }
154
+ }
155
+
156
+ internal fun performConfigurationChanged(newConfig: Configuration) {
157
+ require("onConfigurationChanged") { onConfigurationChanged(newConfig) }
158
+ }
159
+
115
160
  // ActivityThread brings a stopped activity back with onRestart, then
116
161
  // onStart; one that never stopped has nothing to restart
117
162
  internal fun performRestart() {
@@ -1,7 +1,11 @@
1
1
  package android.app
2
2
 
3
3
  import android.content.ContextWrapper
4
+ import android.content.res.Configuration
4
5
 
5
6
  open class Application : ContextWrapper() {
6
7
  open fun onCreate() {}
8
+
9
+ // the process's configuration changed, before any activity relaunches
10
+ open fun onConfigurationChanged(newConfig: Configuration) {}
7
11
  }
@@ -5,6 +5,10 @@ package android.content.res
5
5
  class Configuration {
6
6
  var uiMode: Int = UI_MODE_TYPE_NORMAL or UI_MODE_NIGHT_NO
7
7
 
8
+ fun setTo(other: Configuration) {
9
+ uiMode = other.uiMode
10
+ }
11
+
8
12
  companion object {
9
13
  const val UI_MODE_TYPE_MASK = 0x0f
10
14
  const val UI_MODE_TYPE_NORMAL = 0x01
@@ -3,5 +3,7 @@ package android.content.res
3
3
  class Resources internal constructor(val configuration: Configuration)
4
4
 
5
5
  // the app process's resources, set once the device configuration is known at
6
- // cold start; every context in the process reads the same configuration
6
+ // cold start; every context in the process reads the same configuration, which
7
+ // a configuration change updates in place, as ResourcesManager does, so a
8
+ // Resources or Configuration an app holds reads the new values
7
9
  internal lateinit var processResources: Resources
@@ -13,6 +13,7 @@ import org.json.JSONObject
13
13
  internal class WindowTheme(
14
14
  val edgeToEdgeEnforced: Boolean,
15
15
  val statusBarColor: Int,
16
+ val navigationBarColor: Int,
16
17
  val statusBarContrastEnforced: Boolean,
17
18
  val navigationBarContrastEnforced: Boolean,
18
19
  val lightStatusBar: Boolean,
@@ -62,15 +63,17 @@ class Window internal constructor(
62
63
  fun getStatusBarColor(): Int = statusBarColor
63
64
  fun setStatusBarColor(color: Int) { statusBarColor = color }
64
65
 
65
- // the theme's navigation bar color resolves through device configuration
66
- // peach kotlin does not model, so it reads only once the app sets it; an
67
- // enforced edge to edge window reports transparent
68
- private var navigationBar: Int? = null
66
+ // the theme's navigation bar color as PhoneWindow resolved it; an enforced
67
+ // edge to edge window reports and draws transparent
68
+ private var navigationBar = theme.navigationBarColor
69
69
 
70
70
  var navigationBarColor: Int
71
- get() = if (edgeToEdgeEnforced) Color.TRANSPARENT
72
- else checkNotNull(navigationBar) { "the theme's navigation bar color is not modeled; read it after setting it" }
73
- set(color) { navigationBar = color }
71
+ get() = if (edgeToEdgeEnforced) Color.TRANSPARENT else navigationBar
72
+ set(color) {
73
+ if (color == navigationBar) return
74
+ navigationBar = color
75
+ host.windowChanged()
76
+ }
74
77
 
75
78
  fun getNavigationBarColor(): Int = navigationBarColor
76
79
  fun setNavigationBarColor(color: Int) { navigationBarColor = color }
@@ -113,11 +116,14 @@ class Window internal constructor(
113
116
  return SCRIM_LIGHT
114
117
  }
115
118
 
116
- // what the decor draws for this window: its inset policy and its status
117
- // bar color as unsigned ARGB
119
+ // what the decor draws for this window: its inset policy and its bar
120
+ // colors as unsigned ARGB. gesture navigation draws no contrast scrim
121
+ // behind a transparent navigation bar, as the oracle's edge to edge
122
+ // captures show
118
123
  internal fun describe(): JSONObject = JSONObject()
119
124
  .put("decorFitsSystemWindows", fits)
120
125
  .put("statusBarColor", drawnStatusBarColor().toLong() and 0xffffffffL)
126
+ .put("navigationBarColor", navigationBarColor.toLong() and 0xffffffffL)
121
127
 
122
128
  // Activity.setContentView(View) fills the content parent
123
129
  internal fun setContentView(view: View, params: ViewGroup.LayoutParams) {
@@ -29,8 +29,24 @@ open class ComponentActivity : Activity(), LifecycleOwner, ViewModelStoreOwner,
29
29
  private val lifecycleRegistry = LifecycleRegistry(this)
30
30
  private val savedStateRegistryController = SavedStateRegistryController.create(this)
31
31
 
32
+ // the last instance's store after a configuration relaunch, else a new one
33
+ private var _viewModelStore: ViewModelStore? = null
34
+
35
+ private class NonConfigurationInstances(val custom: Any?, val viewModelStore: ViewModelStore?)
36
+
32
37
  override val lifecycle: Lifecycle get() = lifecycleRegistry
33
- override val viewModelStore: ViewModelStore = ViewModelStore()
38
+ override val viewModelStore: ViewModelStore
39
+ get() {
40
+ ensureViewModelStore()
41
+ return checkNotNull(_viewModelStore)
42
+ }
43
+
44
+ private fun ensureViewModelStore() {
45
+ if (_viewModelStore == null) {
46
+ _viewModelStore = (lastNonConfigurationInstance as? NonConfigurationInstances)?.viewModelStore
47
+ ?: ViewModelStore()
48
+ }
49
+ }
34
50
  override val savedStateRegistry: SavedStateRegistry get() = savedStateRegistryController.savedStateRegistry
35
51
  override val defaultViewModelProviderFactory = SavedStateViewModelFactory()
36
52
  override val defaultViewModelCreationExtras: CreationExtras
@@ -41,17 +57,33 @@ open class ComponentActivity : Activity(), LifecycleOwner, ViewModelStoreOwner,
41
57
 
42
58
  init {
43
59
  lifecycleRegistry.addObserver(LifecycleEventObserver { _, event ->
44
- if (event == Lifecycle.Event.ON_DESTROY) viewModelStore.clear()
60
+ if (event == Lifecycle.Event.ON_DESTROY && !isChangingConfigurations) viewModelStore.clear()
45
61
  })
46
62
  savedStateRegistryController.performAttach()
47
63
  enableSavedStateHandles()
48
64
  }
49
65
 
50
66
  override fun onCreate(savedInstanceState: Bundle?) {
51
- savedStateRegistryController.performRestore(null)
67
+ savedStateRegistryController.performRestore(savedInstanceState?.state)
52
68
  super.onCreate(savedInstanceState)
53
69
  }
54
70
 
71
+ @Suppress("DEPRECATION")
72
+ final override fun onRetainNonConfigurationInstance(): Any? {
73
+ val custom = onRetainCustomNonConfigurationInstance()
74
+ val viewModelStore = _viewModelStore
75
+ ?: (lastNonConfigurationInstance as? NonConfigurationInstances)?.viewModelStore
76
+ if (viewModelStore == null && custom == null) return null
77
+ return NonConfigurationInstances(custom, viewModelStore)
78
+ }
79
+
80
+ @Deprecated("Use a ViewModel to store non config state.")
81
+ open fun onRetainCustomNonConfigurationInstance(): Any? = null
82
+
83
+ @Deprecated("Use a ViewModel to store non config state.")
84
+ open val lastCustomNonConfigurationInstance: Any?
85
+ get() = (lastNonConfigurationInstance as? NonConfigurationInstances)?.custom
86
+
55
87
  override fun onSaveInstanceState(outState: Bundle) {
56
88
  lifecycleRegistry.currentState = Lifecycle.State.CREATED
57
89
  super.onSaveInstanceState(outState)
@@ -73,4 +105,5 @@ open class ComponentActivity : Activity(), LifecycleOwner, ViewModelStoreOwner,
73
105
  override fun dispatchActivityPostResumed() = lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME)
74
106
  override fun dispatchActivityPrePaused() = lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_PAUSE)
75
107
  override fun dispatchActivityPreStopped() = lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_STOP)
108
+ override fun dispatchActivityPreDestroyed() = lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY)
76
109
  }