peachsim 0.1.2412 → 0.1.2421

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 (140) hide show
  1. package/README.md +1 -1
  2. package/cli/catalog/content.ts +6 -3
  3. package/cli/catalog/meta.ts +63 -17
  4. package/cli/catalog/routes.ts +4 -0
  5. package/cli/cloud-box-artifact.ts +45 -24
  6. package/cli/cloud-client.ts +6 -2
  7. package/cli/command-registry.ts +3 -1
  8. package/cli/commands/control.ts +74 -55
  9. package/cli/commands/desktop.ts +3 -3
  10. package/cli/commands/electron.ts +7 -5
  11. package/cli/commands/kotlin.ts +8 -1
  12. package/cli/commands/platform.ts +5 -7
  13. package/cli/commands/profile.ts +2 -2
  14. package/cli/commands/settings.ts +90 -0
  15. package/cli/commands/shell-url.ts +18 -10
  16. package/cli/commands/swift.ts +3 -1
  17. package/cli/main.ts +6 -0
  18. package/cli/outbound-endpoints.ts +17 -15
  19. package/cli/settings-flags.ts +115 -0
  20. package/dist-lib/agent-daemon-client.cjs +1 -1
  21. package/dist-lib/agent-events.cjs +1 -1
  22. package/dist-lib/attached-projects.cjs +1 -1
  23. package/dist-lib/auth/shared-session.cjs +1 -1
  24. package/dist-lib/backend-origin.cjs +1 -1
  25. package/dist-lib/beta.cjs +1 -1
  26. package/dist-lib/beta.mjs +1 -1
  27. package/dist-lib/bridge-constants.cjs +1 -1
  28. package/dist-lib/bridge-contract-input.cjs +1 -1
  29. package/dist-lib/bridge-contract-input.mjs +1 -1
  30. package/dist-lib/bridge-contract.cjs +1 -1
  31. package/dist-lib/bridge-contract.mjs +1 -1
  32. package/dist-lib/bundle-channel.cjs +3606 -1815
  33. package/dist-lib/capture-contract.cjs +1 -1
  34. package/dist-lib/capture-contract.mjs +1 -1
  35. package/dist-lib/cloud-contract.cjs +1 -1
  36. package/dist-lib/cloud-contract.mjs +1 -1
  37. package/dist-lib/cloud-test-args.cjs +1 -1
  38. package/dist-lib/cloud-test-args.mjs +1 -1
  39. package/dist-lib/cloud.cjs +1 -1
  40. package/dist-lib/cloud.mjs +1 -1
  41. package/dist-lib/config.cjs +3 -7
  42. package/dist-lib/config.mjs +3 -7
  43. package/dist-lib/detox/index.cjs +4 -4
  44. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  45. package/dist-lib/expo-swift-bundle.cjs +17049 -15297
  46. package/dist-lib/expo-swift-metadata.cjs +1 -1
  47. package/dist-lib/expo-swift-metadata.mjs +1 -1
  48. package/dist-lib/home-paths.cjs +1 -1
  49. package/dist-lib/host/bridge-host.cjs +63367 -62445
  50. package/dist-lib/host/fetch-proxy-handler.cjs +1598 -211
  51. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  52. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  53. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  54. package/dist-lib/host/websocket-proxy.cjs +1 -1
  55. package/dist-lib/index.cjs +2704 -1213
  56. package/dist-lib/jump-to-source-babel.cjs +1 -1
  57. package/dist-lib/jump-to-source-native.cjs +1 -1
  58. package/dist-lib/kotlin-host.cjs +972 -246
  59. package/dist-lib/menu.cjs +1 -1
  60. package/dist-lib/menu.mjs +1 -1
  61. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  62. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  63. package/dist-lib/metro-production-bundle.cjs +1 -1
  64. package/dist-lib/metro-production-bundle.mjs +1 -1
  65. package/dist-lib/metro.cjs +1737 -246
  66. package/dist-lib/native-app-identity-project.cjs +35 -203
  67. package/dist-lib/native-app-identity-project.mjs +35 -203
  68. package/dist-lib/native-app-identity.cjs +1 -1
  69. package/dist-lib/native-app-identity.mjs +1 -1
  70. package/dist-lib/native-firebase-metadata.cjs +1 -1
  71. package/dist-lib/native-firebase-metadata.mjs +1 -1
  72. package/dist-lib/pdfium-raster.cjs +1 -1
  73. package/dist-lib/pdfium-raster.mjs +1 -1
  74. package/dist-lib/plist.cjs +1 -1
  75. package/dist-lib/plist.mjs +1 -1
  76. package/dist-lib/profiles.cjs +1 -1
  77. package/dist-lib/public-brand.cjs +1 -1
  78. package/dist-lib/public-origins-lib-esm.json +26 -24
  79. package/dist-lib/public-origins-lib.json +198 -117
  80. package/dist-lib/react-native-host-modules.cjs +1 -1
  81. package/dist-lib/react-native-host-modules.mjs +1 -1
  82. package/dist-lib/reap-browser.cjs +1 -1
  83. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  84. package/dist-lib/sdk.cjs +1 -1
  85. package/dist-lib/sdk.mjs +1 -1
  86. package/dist-lib/skills.cjs +21665 -20508
  87. package/dist-lib/swift-compile.cjs +48 -228
  88. package/dist-lib/swift-compile.mjs +48 -228
  89. package/dist-lib/swift-package.cjs +1 -1
  90. package/dist-lib/swift-package.mjs +1 -1
  91. package/dist-lib/swift-submit.cjs +1 -1
  92. package/dist-lib/swift-submit.mjs +1 -1
  93. package/dist-lib/swift-toolchain.cjs +1 -199
  94. package/dist-lib/swift.cjs +1 -1
  95. package/dist-lib/vite-swift.cjs +126 -247
  96. package/dist-lib/vite.cjs +5240 -3788
  97. package/dist-lib/worklet-executable.cjs +1 -1
  98. package/dist-lib/worklet-executable.mjs +1 -1
  99. package/dist-types/packages/peach-engine/src/config.d.ts +1 -4
  100. package/kotlin/README.md +4 -3
  101. package/kotlin/sdk.tar.gz +0 -0
  102. package/kotlin/toolchain.json +3 -6
  103. package/package.json +1 -1
  104. package/runtime-companion.json +1 -1
  105. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +1 -43
  106. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayerContents.h +55 -0
  107. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap +3 -3
  108. package/sdk/ios/usr/include/ObjectiveC.apinotes +0 -24
  109. package/sdk/ios/usr/include/grp.h +93 -0
  110. package/sdk/ios/usr/include/netinet/tcp.h +299 -0
  111. package/sdk/ios/wasm/include/netinet/tcp.h +6 -0
  112. package/sdk/ios/wasm/include/stdlib.h +1 -0
  113. package/sdk/ios/wasm/include/unistd.h +2 -0
  114. package/skills/contrast/SKILL.md +1 -0
  115. package/skills/peach-setup/SKILL.md +11 -1
  116. package/src/android-bridge-dependencies.ts +1 -1
  117. package/src/app-config.ts +7 -0
  118. package/src/binaryen.lock.json +21 -0
  119. package/src/cocoapods-trunk.ts +52 -0
  120. package/src/config.ts +21 -31
  121. package/src/kotlin-host.ts +1 -1
  122. package/src/kotlin-sdk.ts +7 -7
  123. package/src/kotlin-toolchain.ts +28 -24
  124. package/src/kotlinSdkContract.ts +2 -2
  125. package/src/native-bundles.ts +5 -2
  126. package/src/native-static-libraries.ts +38 -5
  127. package/src/podfile-cocoapods.ts +1473 -0
  128. package/src/podspec-cocoapods.ts +331 -106
  129. package/src/podspec-ruby-stdlib.ts +134 -19
  130. package/src/podspec-ruby.ts +199 -46
  131. package/src/settingsContract.ts +74 -0
  132. package/src/swift-compile.ts +1 -1
  133. package/src/swift-compiler-digest.ts +1 -0
  134. package/src/swift-host.ts +32 -7
  135. package/src/swift-packages.ts +35 -6
  136. package/src/swift-shared-sdk.ts +19 -0
  137. package/src/swift-toolchain.ts +2 -201
  138. package/src/turbo-source.ts +7 -37
  139. package/src/wasm-optimize.ts +4 -27
  140. package/src/xcode-project.ts +6 -1
@@ -49,24 +49,26 @@ usage:
49
49
 
50
50
  options:
51
51
  --port <number> connect to running dev server on this port
52
- --profile <id> launch with an isolated persistent storage profile
53
- --ephemeral launch with a temporary isolated storage profile
52
+ --storage-profile <id> launch with an isolated persistent storage profile
53
+ --ephemeral launch with a temporary isolated storage profile
54
54
  --electron launch Electron on Windows; native app on Mac and Linux
55
55
  --native launch the native desktop host (peach desktop install --native)
56
56
 
57
57
  examples:
58
58
  peach desktop
59
59
  peach desktop --port 5173
60
- peach desktop --profile qa
60
+ peach desktop --storage-profile qa
61
61
  peach desktop --native
62
62
  `)
63
63
  peachExit(0)
64
64
  }
65
65
 
66
- const profileArg = args.find((_, i) => args[i - 1] === '--profile')
66
+ const profileArg = args.find((_, i) => args[i - 1] === '--storage-profile')
67
67
  const ephemeralProfile = args.includes('--ephemeral')
68
68
  if (profileArg && ephemeralProfile) {
69
- console.error(' peach desktop: --profile cannot be combined with --ephemeral')
69
+ console.error(
70
+ ' peach desktop: --storage-profile cannot be combined with --ephemeral',
71
+ )
70
72
  peachExit(1)
71
73
  }
72
74
  const profileId = profileArg ? ensureProfile(profileArg).id : undefined
@@ -16,6 +16,7 @@ import {
16
16
  type KotlinHostDiscovery,
17
17
  } from '../../src/kotlinDiscoveryContract'
18
18
  import { PeachExit } from '../run-rnx'
19
+ import { SETTINGS_VALUE_FLAGS } from '../settings-flags'
19
20
  import { runOpenCommand, type OpenCommandResources } from './control'
20
21
  import {
21
22
  closeGuestResources,
@@ -44,7 +45,13 @@ export async function runKotlin(
44
45
  let openPreview = true
45
46
  let activity: string | undefined
46
47
  let variant: string | undefined
47
- const valueFlags = new Set(['--driver', '--profile', '--cdp-port', '--base-url'])
48
+ const valueFlags = new Set([
49
+ '--driver',
50
+ '--storage-profile',
51
+ '--cdp-port',
52
+ '--base-url',
53
+ ...SETTINGS_VALUE_FLAGS,
54
+ ])
48
55
  const booleanFlags = new Set([
49
56
  '--headless',
50
57
  '--headed',
@@ -21,6 +21,7 @@ import { rnxPublicBrand } from '../../src/public-brand'
21
21
  import { UnsupportedRemoteHostError } from '../cloud-client'
22
22
  import { resolveCheckoutRepo } from '../run-registry'
23
23
  import { rethrowIfExit } from '../run-rnx'
24
+ import { SETTINGS_VALUE_FLAGS } from '../settings-flags'
24
25
  import type { CloudBoxSession, CloudSession } from '../cloud-session'
25
26
 
26
27
  const PLATFORM_LABEL: Record<RuntimePlatform, string> = {
@@ -265,11 +266,12 @@ export async function runPlatformCommand(
265
266
  '--base-url',
266
267
  '--replace',
267
268
  '--driver',
268
- '--profile',
269
+ '--storage-profile',
269
270
  '--cdp-port',
270
271
  '--device',
271
272
  '--viewport',
272
273
  '--remap',
274
+ ...SETTINGS_VALUE_FLAGS,
273
275
  ],
274
276
  }).positional.find((value) => value.startsWith('-'))
275
277
  if (leftover) {
@@ -473,7 +475,6 @@ async function runRemoteBox(
473
475
  box,
474
476
  { cloudBoxConnectUrl, ensureCloudBoxBrowser, readCloudBoxSession },
475
477
  { authHeaderOrExit, cloudAccountIdOrExit },
476
- { buildRemoteProjectBundle },
477
478
  {
478
479
  createCloudBoxSession,
479
480
  publishCloudSession,
@@ -488,7 +489,6 @@ async function runRemoteBox(
488
489
  import('./box'),
489
490
  import('peach-cloud-box/client'),
490
491
  import('../auth'),
491
- import('../remote-project-bundle'),
492
492
  import('../cloud-session'),
493
493
  import('../cloud-box-artifact.ts'),
494
494
  import('@peach/box/client'),
@@ -547,12 +547,10 @@ async function runRemoteBox(
547
547
  let artifact: Awaited<ReturnType<typeof produceCloudBoxArtifact>>
548
548
  try {
549
549
  artifact = await produceCloudBoxArtifact(
550
- projectDir && buildDir
551
- ? await buildRemoteProjectBundle(projectDir, platform, buildDir)
552
- : input.bundlePath,
550
+ projectDir && buildDir ? { projectDir, buildDir } : input.bundlePath,
553
551
  platform,
554
552
  {
555
- assetsDirectory: buildDir || input.assetsDirectory,
553
+ assetsDirectory: input.assetsDirectory,
556
554
  nativeProjectDir,
557
555
  ...(input.watch ? { assetServer: new URL(input.bundlePath) } : {}),
558
556
  },
@@ -30,8 +30,8 @@ cannot honor profiles and will fail clearly if a profile is requested.
30
30
  examples:
31
31
  peach storage profile list
32
32
  peach storage profile create qa
33
- peach open 8081 --profile qa
34
- peach open 8081 --profile qa --driver playwright
33
+ peach open 8081 --storage-profile qa
34
+ peach open 8081 --storage-profile qa --driver playwright
35
35
  peach storage profile clear qa
36
36
  peach storage profile delete qa
37
37
  `)
@@ -0,0 +1,90 @@
1
+ import { loadRNXAppConfig } from '../../src/app-config'
2
+ import {
3
+ formatSettingText,
4
+ PROFILE_SETTING_KEYS,
5
+ type SettingsProfile,
6
+ } from '../../src/settingsContract'
7
+ import { resolveAppProject } from '../app-project'
8
+ import { peachExit } from '../run-rnx'
9
+ import {
10
+ readSettingsArgs,
11
+ resolveSettings,
12
+ SETTINGS_VALUE_FLAGS,
13
+ } from '../settings-flags'
14
+ import {
15
+ callInBridge,
16
+ callInBridgeWrite,
17
+ createBridgeFromParsed,
18
+ parseBridgeCliArgs,
19
+ } from '../ws-bridge'
20
+
21
+ export async function runSettingsCommand(
22
+ args: string[],
23
+ opts: { port?: number } = {},
24
+ ): Promise<void> {
25
+ const parsed = parseBridgeCliArgs(args, {
26
+ port: opts.port,
27
+ stripValueFlags: [...SETTINGS_VALUE_FLAGS, '--project-root'],
28
+ stripBooleanFlags: ['--json'],
29
+ })
30
+ const unknown = parsed.positional[0]
31
+ if (unknown !== undefined) {
32
+ console.error(` peach settings: unknown argument "${unknown}"`)
33
+ peachExit(1)
34
+ }
35
+ let patch: SettingsProfile = {}
36
+ try {
37
+ const settingsArgs = readSettingsArgs(args)
38
+ const projectRoot = args.find((_, i) => args[i - 1] === '--project-root')
39
+ patch = resolveSettings(
40
+ settingsArgs,
41
+ settingsArgs.profile === undefined
42
+ ? undefined
43
+ : await loadRNXAppConfig(resolveAppProject(projectRoot ?? process.cwd())),
44
+ )
45
+ } catch (error) {
46
+ console.error(
47
+ ` peach settings: ${error instanceof Error ? error.message : String(error)}`,
48
+ )
49
+ peachExit(1)
50
+ }
51
+
52
+ const bridge = createBridgeFromParsed(parsed)
53
+ try {
54
+ const changing = Object.keys(patch).length > 0
55
+ const settings = changing
56
+ ? await callInBridgeWrite<Record<string, unknown> | null>(
57
+ bridge,
58
+ 'SootSim.bridges.settings.apply',
59
+ patch,
60
+ )
61
+ : await callInBridge<Record<string, unknown> | null>(
62
+ bridge,
63
+ 'SootSim.bridges.settings.get',
64
+ )
65
+ if (!settings) throw new Error('the sim answered no settings')
66
+ const shown = PROFILE_SETTING_KEYS.filter(
67
+ (key) => !changing || Object.hasOwn(patch, key),
68
+ )
69
+ if (args.includes('--json')) {
70
+ console.log(
71
+ JSON.stringify(Object.fromEntries(shown.map((key) => [key, settings[key]]))),
72
+ )
73
+ return
74
+ }
75
+ const width = Math.max(...shown.map((key) => key.length))
76
+ for (const key of shown) {
77
+ const value = settings[key]
78
+ const text =
79
+ typeof value === 'boolean' ? (value ? 'on' : 'off') : formatSettingText(value)
80
+ console.log(` ${key.padEnd(width)} ${text}`)
81
+ }
82
+ } catch (error) {
83
+ console.error(
84
+ ` peach settings: ${error instanceof Error ? error.message : String(error)}`,
85
+ )
86
+ peachExit(1)
87
+ } finally {
88
+ bridge.close()
89
+ }
90
+ }
@@ -47,6 +47,11 @@ import {
47
47
  readNativeFirebaseConfig,
48
48
  resolveExpoConfigModule,
49
49
  } from '../../src/native-firebase-config'
50
+ import {
51
+ formatSettingText,
52
+ PROFILE_SETTING_KEYS,
53
+ type SettingsProfile,
54
+ } from '../../src/settingsContract'
50
55
  import {
51
56
  PEACH_SIMULATOR_SHELL_FILE,
52
57
  isPeachSimulatorDocumentPath,
@@ -561,10 +566,6 @@ export interface BuildShellUrlOptions {
561
566
  // renders at the device's native scale, so a native-parity capture is not
562
567
  // left at the interactive medium default of 2.
563
568
  renderResolution?: string
564
- // the keyboard's QuickType lane stamped as ?predictiveText=, which the
565
- // shell pins at boot over the persisted setting. a native oracle captured
566
- // by a test driver has it off, so a capture compared against one does too.
567
- predictiveText?: boolean
568
569
  // interface orientation (portrait|landscape) stamped as ?orientation=,
569
570
  // which the shell reads at boot over the device's default: an open duo
570
571
  // boots landscape unless this asks for it upright.
@@ -576,9 +577,11 @@ export interface BuildShellUrlOptions {
576
577
  // shell pins at boot over the device profile's own version. an oracle on a
577
578
  // newer os than the profile compares only when the sim runs that os era.
578
579
  osVersion?: string
579
- // appearance scheme (light|dark|auto) stamped as ?theme=, which the shell
580
- // reads at boot over the persisted scheme. set by `peach open -t/--theme`.
581
- theme?: string
580
+ // device settings (appearance, dynamic type, contrast, locale, the
581
+ // keyboard's QuickType lane) stamped one param per key, which the shell
582
+ // reads at boot over the persisted values. set by `peach open --profile`
583
+ // and the setting flags; a new set replaces the one a reused sim carries.
584
+ settings?: SettingsProfile
582
585
  // the xcode application target whose version, bundle id and display name
583
586
  // the app reads, for a project with several. set by `peach open --ios-target`.
584
587
  iosTarget?: string
@@ -1005,14 +1008,19 @@ function applyShellLaunchOptions(url: URL, opts: BuildShellUrlOptions): URL {
1005
1008
  if (opts.renderResolution)
1006
1009
  url.searchParams.set('renderResolution', opts.renderResolution)
1007
1010
  if (opts.orientation) url.searchParams.set('orientation', opts.orientation)
1008
- if (opts.predictiveText !== undefined)
1009
- url.searchParams.set('predictiveText', opts.predictiveText ? '1' : '0')
1010
1011
  if (opts.windowSize) {
1011
1012
  url.searchParams.set('dynamicWidth', String(opts.windowSize.width))
1012
1013
  url.searchParams.set('dynamicHeight', String(opts.windowSize.height))
1013
1014
  }
1014
1015
  if (opts.osVersion) url.searchParams.set('osVersion', opts.osVersion)
1015
- if (opts.theme) url.searchParams.set('theme', opts.theme)
1016
+ if (opts.settings && Object.keys(opts.settings).length > 0) {
1017
+ url.searchParams.delete('theme')
1018
+ for (const key of PROFILE_SETTING_KEYS) {
1019
+ const value = opts.settings[key]
1020
+ if (value === undefined) url.searchParams.delete(key)
1021
+ else url.searchParams.set(key, formatSettingText(value))
1022
+ }
1023
+ }
1016
1024
  if (opts.proof) url.searchParams.set('proof', '1')
1017
1025
  if (opts.ephemeral) url.searchParams.set('ephemeral', '1')
1018
1026
  if (runsUnattended()) url.searchParams.set('defaultSettings', '1')
@@ -14,6 +14,7 @@ import { authHeaderValue, resolveCliAuth } from '../auth'
14
14
  import { validateDeviceOption } from '../device-option'
15
15
  import { prepareSwiftInput, resolveNativeInput } from '../native-input'
16
16
  import { PeachExit } from '../run-rnx'
17
+ import { SETTINGS_VALUE_FLAGS } from '../settings-flags'
17
18
  import { runOpenCommand, type OpenCommandResources } from './control'
18
19
  import {
19
20
  closeGuestResources,
@@ -42,10 +43,11 @@ export async function runSwift(
42
43
  const valueFlags = new Set([
43
44
  '--device',
44
45
  '--driver',
45
- '--profile',
46
+ '--storage-profile',
46
47
  '--cdp-port',
47
48
  '--os-version',
48
49
  '--base-url',
50
+ ...SETTINGS_VALUE_FLAGS,
49
51
  ])
50
52
  const booleanFlags = new Set([
51
53
  '--headless',
package/cli/main.ts CHANGED
@@ -725,6 +725,12 @@ try {
725
725
  break
726
726
  }
727
727
 
728
+ case 'settings': {
729
+ const { runSettingsCommand } = await import('./commands/settings')
730
+ await runSettingsCommand(commandArgsWithSim, { port })
731
+ break
732
+ }
733
+
728
734
  case 'doctor': {
729
735
  const { runDoctor } = await import('./commands/doctor')
730
736
  process.exitCode = await runDoctor(parsed.commandArgs, { port })
@@ -199,10 +199,10 @@ export const OUTBOUND_ENDPOINTS: Record<string, OutboundEndpointDeclaration> = {
199
199
  },
200
200
  swift_source_pods: {
201
201
  category: 'explicit-user-action',
202
- destination: 'https://cdn.cocoapods.org/Specs/ checksum-pinned trunk JSON podspecs',
202
+ destination: 'https://cdn.cocoapods.org/ version shard lists and trunk JSON podspecs',
203
203
  preConsent: false,
204
204
  payload:
205
- 'pod names and locked versions only, when building a Nitro app with missing source pod imports',
205
+ 'pod names and versions only, when building an app whose native packages depend on trunk pods',
206
206
  },
207
207
  swift_compile: {
208
208
  category: 'explicit-user-action',
@@ -238,7 +238,7 @@ export const OUTBOUND_ENDPOINTS: Record<string, OutboundEndpointDeclaration> = {
238
238
  kotlin_toolchain_download: {
239
239
  category: 'explicit-user-action',
240
240
  destination:
241
- 'the pinned downloads in packages/peachsim/kotlin/toolchain.json (dl.google.com, github.com, repo1.maven.org, registry.npmjs.org, r2.rnxsim.com)',
241
+ 'the pinned downloads in packages/peachsim/kotlin/toolchain.json (dl.google.com, repo1.maven.org, registry.npmjs.org, r2.rnxsim.com)',
242
242
  preConsent: false,
243
243
  payload:
244
244
  'HTTP GET of a pinned, sha256-checked toolchain file; fires only when the user builds a Kotlin app and the file is not cached',
@@ -276,12 +276,18 @@ export const OUTBOUND_ENDPOINTS: Record<string, OutboundEndpointDeclaration> = {
276
276
  },
277
277
  wasm_optimizer_download: {
278
278
  category: 'explicit-user-action',
279
- destination:
280
- 'https://github.com/WebAssembly/binaryen/releases/download/ pinned release archive',
279
+ destination: 'https://r2.rnxsim.com/peach/binaryen/ pinned Binaryen release archive',
281
280
  preConsent: false,
282
281
  payload:
283
282
  'HTTP GET of the pinned, sha256-checked Binaryen archive when peach links a native Swift module and no wasm-opt binary is installed or cached; platform and architecture only, with no source or project data',
284
283
  },
284
+ wasm_optimizer_publish: {
285
+ category: 'release-delivery',
286
+ destination: 'WebAssembly/binaryen on GitHub and the Peach artifact bucket',
287
+ preConsent: false,
288
+ payload:
289
+ 'HTTP GET of pinned Binaryen release archives and license, and upload of repacked public archives when the maintainer runs the publish script',
290
+ },
285
291
  nitro_published_headers: {
286
292
  category: 'explicit-user-action',
287
293
  destination:
@@ -483,6 +489,8 @@ export const DECLARED_OUTBOUND_CALLS: Record<string, OutboundCallDeclaration> =
483
489
  category: 'swift_compile',
484
490
  count: 1,
485
491
  },
492
+ 'packages/peachsim/scripts/repack-binaryen.ts :: fetch :: `https://raw.githubusercontent.com/WebAssembly/binaryen/version_${version}/LICENSE`':
493
+ { category: 'wasm_optimizer_publish', count: 1 },
486
494
  'packages/peachsim/src/swift-source-pods.ts :: fetch :: `https://api.github.com/repos/CocoaPods/Specs/commits?path=${specPath}&per_page=100`':
487
495
  {
488
496
  category: 'swift_source_pods',
@@ -498,16 +506,10 @@ export const DECLARED_OUTBOUND_CALLS: Record<string, OutboundCallDeclaration> =
498
506
  category: 'swift_source_pods',
499
507
  count: 1,
500
508
  },
501
- "packages/peachsim/src/turbo-source.ts :: fetch :: `https://cdn.cocoapods.org/all_pods_versions_${shard.join('_')}.txt`":
502
- {
503
- category: 'swift_source_pods',
504
- count: 1,
505
- },
506
- "packages/peachsim/src/turbo-source.ts :: fetch :: `https://cdn.cocoapods.org/Specs/${shard.join('/')}/${name}/${version}/${name}.podspec.json`":
507
- {
508
- category: 'swift_source_pods',
509
- count: 1,
510
- },
509
+ 'packages/peachsim/src/cocoapods-trunk.ts :: fetch :: url': {
510
+ category: 'swift_source_pods',
511
+ count: 1,
512
+ },
511
513
  'packages/peachsim/src/turbo-source.ts :: fetch :: archiveUrl': {
512
514
  category: 'swift_source_pods',
513
515
  count: 1,
@@ -0,0 +1,115 @@
1
+ import {
2
+ describeSettingValues,
3
+ formatSettingText,
4
+ isValidProfileValue,
5
+ parseSettingText,
6
+ PROFILE_SETTING_KEYS,
7
+ type ProfileSettingKey,
8
+ type SettingsProfile,
9
+ settingsSchema,
10
+ } from '../src/settingsContract'
11
+ import type { PeachConfig } from '../src/config'
12
+
13
+ // colorScheme keeps the --theme spelling every other command uses
14
+ export function settingFlag(key: ProfileSettingKey): string {
15
+ if (key === 'colorScheme') return '--theme'
16
+ return `--${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`
17
+ }
18
+
19
+ const FLAG_KEYS = new Map<string, ProfileSettingKey>([
20
+ ...PROFILE_SETTING_KEYS.map((key): [string, ProfileSettingKey] => [
21
+ settingFlag(key),
22
+ key,
23
+ ]),
24
+ ['-t', 'colorScheme'],
25
+ ])
26
+
27
+ export const SETTING_FLAGS: readonly string[] = [...FLAG_KEYS.keys()]
28
+
29
+ // every value flag a command taking settings strips from its positionals
30
+ export const SETTINGS_VALUE_FLAGS: readonly string[] = ['--profile', ...SETTING_FLAGS]
31
+
32
+ export function isSettingsArg(arg: string): boolean {
33
+ return FLAG_KEYS.has(arg) || arg === '--profile'
34
+ }
35
+
36
+ function valuePlaceholder(key: ProfileSettingKey): string {
37
+ const def = settingsSchema[key]
38
+ if (def.type === 'boolean') return 'on|off'
39
+ if (def.options) return def.options.join('|')
40
+ if (def.type === 'string-array') return 'tag,tag'
41
+ return def.type === 'number' ? 'number' : 'code'
42
+ }
43
+
44
+ export function settingsFlagHelp(): { flag: string; description: string }[] {
45
+ return PROFILE_SETTING_KEYS.map((key) => ({
46
+ flag: `${settingFlag(key)} <${valuePlaceholder(key)}>`,
47
+ description: settingsSchema[key].description,
48
+ }))
49
+ }
50
+
51
+ export interface SettingsArgs {
52
+ profile?: string
53
+ flags: SettingsProfile
54
+ }
55
+
56
+ // reads --profile <name> and the one-off setting flags; a value is checked
57
+ // here so a bad flag fails before anything launches
58
+ export function readSettingsArgs(args: readonly string[]): SettingsArgs {
59
+ const flags: Record<string, unknown> = {}
60
+ let profile: string | undefined
61
+ for (let index = 0; index < args.length; index++) {
62
+ const arg = args[index]
63
+ if (arg === '--') break
64
+ if (arg !== '--profile' && !FLAG_KEYS.has(arg)) continue
65
+ const text = args[++index]
66
+ if (text === undefined) throw new Error(`${arg} expects a value`)
67
+ if (arg === '--profile') {
68
+ profile = text
69
+ continue
70
+ }
71
+ const key = FLAG_KEYS.get(arg)
72
+ if (!key) continue
73
+ const value = parseSettingText(key, text)
74
+ if (!isValidProfileValue(key, value))
75
+ throw new Error(`${arg} must be ${describeSettingValues(key)}, got "${text}"`)
76
+ flags[key] = value
77
+ }
78
+ return { profile, flags }
79
+ }
80
+
81
+ // the named profile from peach.config.ts with the flags over it
82
+ export function resolveSettings(
83
+ { profile, flags }: SettingsArgs,
84
+ config: PeachConfig | undefined,
85
+ ): SettingsProfile {
86
+ if (profile === undefined) return flags
87
+ if (!config?.profiles)
88
+ throw new Error(
89
+ `no profiles in the app's peach.config.ts to apply "${profile}" from; add them under profiles, or pass --project-root <app directory> when the app is elsewhere`,
90
+ )
91
+ const profiles = config.profiles
92
+ const named = Object.hasOwn(profiles, profile) ? profiles[profile] : undefined
93
+ if (!named) {
94
+ const names = Object.keys(profiles)
95
+ throw new Error(
96
+ `no profile "${profile}" in peach.config.ts${names.length ? ` (it has ${names.join(', ')})` : ''}. a profile is a set of device settings under profiles; isolated storage is --storage-profile`,
97
+ )
98
+ }
99
+ return { ...named, ...flags }
100
+ }
101
+
102
+ // the settings as flags, for an open that hands its arguments to another open
103
+ export function settingsToArgs(settings: SettingsProfile): string[] {
104
+ return PROFILE_SETTING_KEYS.flatMap((key) =>
105
+ settings[key] === undefined
106
+ ? []
107
+ : [settingFlag(key), formatSettingText(settings[key])],
108
+ )
109
+ }
110
+
111
+ export function withoutSettingsArgs(args: readonly string[]): string[] {
112
+ return args.filter(
113
+ (arg, index) => !isSettingsArg(arg) && !isSettingsArg(args[index - 1] ?? ''),
114
+ )
115
+ }
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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 __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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 __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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 __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2412 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2421 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var REFUSED_PERFORM_STEP_TYPES = [