peachsim 0.1.792 → 0.1.794

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 (84) hide show
  1. package/cli/app-config.ts +3 -7
  2. package/cli/commands/compat.ts +0 -6
  3. package/cli/desktop-companion.ts +3 -0
  4. package/cli/ws-bridge.ts +103 -3
  5. package/dist-lib/agent-daemon-client.cjs +2 -2
  6. package/dist-lib/agent-events.cjs +2 -2
  7. package/dist-lib/agent-identity.cjs +2 -2
  8. package/dist-lib/agent-sessions.cjs +2 -2
  9. package/dist-lib/attached-projects.cjs +2 -2
  10. package/dist-lib/auth/shared-session.cjs +2 -2
  11. package/dist-lib/backend-origin.cjs +2 -2
  12. package/dist-lib/beta.cjs +2 -2
  13. package/dist-lib/beta.mjs +1 -1
  14. package/dist-lib/bridge-constants.cjs +2 -2
  15. package/dist-lib/bridge-contract-input.cjs +2 -2
  16. package/dist-lib/bridge-contract-input.mjs +1 -1
  17. package/dist-lib/bridge-contract.cjs +2 -2
  18. package/dist-lib/bridge-contract.mjs +1 -1
  19. package/dist-lib/bundle-channel.cjs +9071 -0
  20. package/dist-lib/capture-contract.cjs +2 -2
  21. package/dist-lib/capture-contract.mjs +1 -1
  22. package/dist-lib/cli-constants.cjs +2 -2
  23. package/dist-lib/cloud-contract.cjs +2 -2
  24. package/dist-lib/cloud-contract.mjs +1 -1
  25. package/dist-lib/cloud-test-args.cjs +2 -2
  26. package/dist-lib/cloud-test-args.mjs +1 -1
  27. package/dist-lib/cloud.cjs +2 -2
  28. package/dist-lib/cloud.mjs +1 -1
  29. package/dist-lib/config.cjs +2 -2
  30. package/dist-lib/detox/index.cjs +5 -3
  31. package/dist-lib/dev-bundle-resolution.cjs +2 -2
  32. package/dist-lib/expo-swift-bundle.cjs +8419 -0
  33. package/dist-lib/expo-swift-metadata.cjs +91 -0
  34. package/dist-lib/expo-swift-metadata.mjs +63 -0
  35. package/dist-lib/home-paths.cjs +2 -2
  36. package/dist-lib/host/bridge-host.cjs +238 -130
  37. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  38. package/dist-lib/host/fetch-proxy-overrides.cjs +2 -2
  39. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  40. package/dist-lib/host/replacement-module-handler.cjs +2 -2
  41. package/dist-lib/host/websocket-proxy.cjs +2 -2
  42. package/dist-lib/index.cjs +113 -13
  43. package/dist-lib/jump-to-source-babel.cjs +2 -2
  44. package/dist-lib/jump-to-source-native.cjs +2 -2
  45. package/dist-lib/kotlin-host.cjs +2 -2
  46. package/dist-lib/menu.cjs +2 -2
  47. package/dist-lib/menu.mjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.cjs +2 -2
  49. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  50. package/dist-lib/metro-production-bundle.cjs +2 -2
  51. package/dist-lib/metro-production-bundle.mjs +1 -1
  52. package/dist-lib/metro.cjs +110 -12
  53. package/dist-lib/native-app-identity.cjs +2 -2
  54. package/dist-lib/native-app-identity.mjs +1 -1
  55. package/dist-lib/native-firebase-metadata.cjs +2 -2
  56. package/dist-lib/native-firebase-metadata.mjs +1 -1
  57. package/dist-lib/plist.cjs +2 -2
  58. package/dist-lib/plist.mjs +1 -1
  59. package/dist-lib/profiles.cjs +2 -2
  60. package/dist-lib/public-brand.cjs +2 -2
  61. package/dist-lib/react-native-host-modules.cjs +2 -2
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/render-mode.cjs +2 -2
  64. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  65. package/dist-lib/sdk.cjs +2 -2
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +462 -170
  68. package/dist-lib/swift-compile.cjs +105 -5
  69. package/dist-lib/swift-compile.mjs +101 -2
  70. package/dist-lib/swift-package.cjs +2 -2
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +2 -2
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +2 -2
  75. package/dist-lib/swift.cjs +2 -2
  76. package/dist-lib/vite-swift.cjs +64 -8
  77. package/dist-lib/vite.cjs +2 -2
  78. package/package.json +20 -2
  79. package/src/bundle-channel.mjs +251 -0
  80. package/src/expo-swift-bundle.ts +32 -0
  81. package/src/expo-swift-host.ts +152 -128
  82. package/src/expoSwiftContract.ts +88 -0
  83. package/src/swift-compile.ts +111 -1
  84. package/src/swift-host.ts +4 -1
package/cli/app-config.ts CHANGED
@@ -1,12 +1,10 @@
1
- import { createRequire } from 'node:module'
2
1
  import path from 'node:path'
3
2
  import { createJiti } from 'jiti'
3
+ import * as peachConfigModule from '../src/config'
4
4
  import { isPeachConfig, type PeachConfig } from '../src/config'
5
5
  import { rnxPublicBrand } from '../src/public-brand'
6
6
  import { resolveAppProject, type ResolvedAppProject } from './app-project'
7
7
 
8
- const require = createRequire(import.meta.url)
9
-
10
8
  // `{ file }` entries are relative to the config file; the engine loads them by
11
9
  // absolute path from the runtime's replacement-module endpoint.
12
10
  function resolveFileEntries<T>(
@@ -51,10 +49,8 @@ export async function loadRNXAppConfig(
51
49
  // metro serializes repeatedly in one process; edits must reload the config.
52
50
  moduleCache: false,
53
51
  tryNative: false,
54
- alias: {
55
- [`${rnxPublicBrand.packageName}/config`]: require.resolve(
56
- `${rnxPublicBrand.packageName}/config`,
57
- ),
52
+ virtualModules: {
53
+ [`${rnxPublicBrand.packageName}/config`]: peachConfigModule,
58
54
  },
59
55
  })
60
56
  const loaded: unknown = await jiti.import(project.configPath, { default: true })
@@ -117,12 +117,6 @@ function report(args: string[], result: ScanResult, local: LocalNative[] | null)
117
117
  console.log(`\n peach compatibility report`)
118
118
  console.log(` ${formatScanCounts(result)}\n`)
119
119
  for (const line of formatDetailedScanLines(result)) console.log(` ${line}`)
120
- const supported = result.packages.filter((item) => item.status === 'full').length
121
- if (supported > 0) console.log(` supported: ${supported} packages`)
122
- const notRelevant = result.packages.filter(
123
- (item) => item.status === 'not-relevant',
124
- ).length
125
- if (notRelevant > 0) console.log(` not relevant at runtime: ${notRelevant} packages`)
126
120
  if (result.packages.length === 0) {
127
121
  console.log(` no React Native ecosystem packages detected`)
128
122
  }
@@ -366,6 +366,9 @@ export async function launchDesktopCompanion(
366
366
  // the personal home screen belongs to launches from Spotlight or the Dock;
367
367
  // every CLI launch gets the plain one
368
368
  if (nativeApp) extraArgs.push('--no-personal-home')
369
+ // a CLI launch builds its windows from its own args: skip appkit's restore of a prior
370
+ // crashed session, whose reopen alert blocks boot, without clearing the saved state
371
+ if (nativeApp) extraArgs.push('-ApplePersistenceIgnoreState', 'YES')
369
372
  const openArgs: string[] = ['-g', '-a', install.path]
370
373
  if (url) openArgs.push(buildMacLaunchUrl(url, opts, nativeApp))
371
374
  else if (
package/cli/ws-bridge.ts CHANGED
@@ -362,6 +362,7 @@ interface WsResponse {
362
362
  }
363
363
 
364
364
  interface WsBridgeOptions {
365
+ connectTimeoutMs?: number
365
366
  commandTimeoutMs?: number
366
367
  simId?: string
367
368
  cliLabel?: string
@@ -567,7 +568,9 @@ export function createBridge(wsPort: number, opts: WsBridgeOptions = {}): WsBrid
567
568
  { resolve: (v: any) => void; reject: (e: Error) => void }
568
569
  >()
569
570
 
570
- const ws = new WebSocket(bridgeWsUrl(wsPort))
571
+ const ws = new WebSocket(bridgeWsUrl(wsPort), {
572
+ handshakeTimeout: opts.connectTimeoutMs,
573
+ })
571
574
  // always key the lease on the stable agent/terminal identity, never on the
572
575
  // target simId. keying off `sim:<id>` conflated "which sim" with "who is
573
576
  // driving it": a single agent's identity then flipped between its stable key
@@ -905,11 +908,108 @@ export interface BridgeTransportOption {
905
908
  export function createBridgeFromParsed(parsed: ParsedBridgeCliArgs): WsBridge {
906
909
  const cloudBridge = createCloudBridgeForParsed(parsed)
907
910
  if (cloudBridge) return cloudBridge
908
- return createBridge(parsed.wsPort, {
911
+ const options = {
909
912
  commandTimeoutMs: parsed.commandTimeoutMs,
910
913
  simId: parsed.simId,
911
914
  simIdSource: parsed.simIdSource,
912
- })
915
+ }
916
+ if (!parsed.simId || parsed.simIdSource !== 'flag') {
917
+ return createBridge(parsed.wsPort, options)
918
+ }
919
+
920
+ // keep the synchronous transport API while resolving ownership before any
921
+ // command reaches a sim. discovery runs once per invocation, in parallel.
922
+ let selected: Promise<WsBridge> | undefined
923
+ let closed = false
924
+ const getBridge = () => {
925
+ selected ??= resolveBridgePortForSim(parsed).then((port) => {
926
+ if (closed) throw new Error('bridge closed during sim world resolution')
927
+ parsed.wsPort = port
928
+ printBridgeWorldNotice(port)
929
+ return createBridge(port, options)
930
+ })
931
+ return selected
932
+ }
933
+ return {
934
+ plane: 'local',
935
+ async send(cmd, opts) {
936
+ return (await getBridge()).send(cmd, opts)
937
+ },
938
+ async listSims() {
939
+ return (await getBridge()).listSims()
940
+ },
941
+ async resolveReloadedSim(id) {
942
+ return (await getBridge()).resolveReloadedSim(id)
943
+ },
944
+ async focusSim(id) {
945
+ return (await getBridge()).focusSim(id)
946
+ },
947
+ async closeSim(id) {
948
+ return (await getBridge()).closeSim(id)
949
+ },
950
+ async claim(id, opts) {
951
+ return (await getBridge()).claim(id, opts)
952
+ },
953
+ close() {
954
+ closed = true
955
+ void selected?.then(
956
+ (bridge) => bridge.close(),
957
+ () => {},
958
+ )
959
+ },
960
+ }
961
+ }
962
+
963
+ async function resolveBridgePortForSim(parsed: ParsedBridgeCliArgs): Promise<number> {
964
+ const worlds = liveDevBridgeLockfiles().map((lock) => ({
965
+ port: lock.bridgePort,
966
+ record: `dev-bridges/${lock.bridgePort}.json`,
967
+ }))
968
+ const daemon = readDaemonLockfile()
969
+ if (daemon && isDaemonLockfileFresh(daemon)) {
970
+ worlds.push({ port: daemon.bridgePort, record: 'daemon.json' })
971
+ }
972
+ const checked = await Promise.all(
973
+ worlds.map(async (world) => {
974
+ const probe = createBridge(world.port, {
975
+ connectTimeoutMs: 2000,
976
+ commandTimeoutMs: 2000,
977
+ })
978
+ try {
979
+ const sims = await probe.listSims()
980
+ return {
981
+ ...world,
982
+ ownsSim: sims.some(
983
+ (sim) => sim.id === parsed.simId && sim.readyState === 'open',
984
+ ),
985
+ }
986
+ } catch (error) {
987
+ return {
988
+ ...world,
989
+ ownsSim: false,
990
+ error: error instanceof Error ? error.message : String(error),
991
+ }
992
+ } finally {
993
+ probe.close()
994
+ }
995
+ }),
996
+ )
997
+ const owner = checked.find((world) => world.ownsSim)
998
+ if (!owner) {
999
+ const names = checked.map(
1000
+ (world) =>
1001
+ `${world.record} (bridge :${world.port}${'error' in world ? `, ${world.error}` : ''})`,
1002
+ )
1003
+ throw new Error(
1004
+ `no live peach world holds sim ${parsed.simId}; worlds checked: ${names.join(', ') || 'none (no fresh dev-bridge or daemon lockfiles)'}`,
1005
+ )
1006
+ }
1007
+ if (parsed.explicitPort && parsed.wsPort !== owner.port) {
1008
+ throw new Error(
1009
+ `--sim ${parsed.simId} belongs to bridge port ${owner.port}, but --port ${parsed.wsPort} names another world`,
1010
+ )
1011
+ }
1012
+ return owner.port
913
1013
  }
914
1014
 
915
1015
  interface SimHealthProbe {
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
package/dist-lib/beta.cjs CHANGED
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/beta.ts
4
4
  var IS_BETA = true;
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.794 | (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,5 +1,5 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
- let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.792 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.794 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var REFUSED_PERFORM_STEP_TYPES = [