peachsim 0.1.2260 → 0.1.2262

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 (91) hide show
  1. package/cli/app-catalog.ts +72 -15
  2. package/cli/commands/shell-url.ts +11 -3
  3. package/cli/commands/upload.ts +2 -1
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.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/bundle-channel.cjs +387 -296
  17. package/dist-lib/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +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/config.mjs +1 -1
  27. package/dist-lib/detox/index.cjs +2 -2
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/expo-swift-bundle.cjs +2 -2
  30. package/dist-lib/expo-swift-metadata.cjs +1 -1
  31. package/dist-lib/expo-swift-metadata.mjs +1 -1
  32. package/dist-lib/home-paths.cjs +1 -1
  33. package/dist-lib/host/bridge-host.cjs +6 -4
  34. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  35. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  37. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  38. package/dist-lib/host/websocket-proxy.cjs +1 -1
  39. package/dist-lib/index.cjs +2 -2
  40. package/dist-lib/jump-to-source-babel.cjs +1 -1
  41. package/dist-lib/jump-to-source-native.cjs +1 -1
  42. package/dist-lib/kotlin-host.cjs +1 -1
  43. package/dist-lib/menu.cjs +1 -1
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +1 -1
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +2 -2
  50. package/dist-lib/native-app-identity-project.cjs +1 -1
  51. package/dist-lib/native-app-identity-project.mjs +1 -1
  52. package/dist-lib/native-app-identity.cjs +1 -1
  53. package/dist-lib/native-app-identity.mjs +1 -1
  54. package/dist-lib/native-firebase-metadata.cjs +1 -1
  55. package/dist-lib/native-firebase-metadata.mjs +1 -1
  56. package/dist-lib/pdfium-raster.cjs +1 -1
  57. package/dist-lib/pdfium-raster.mjs +1 -1
  58. package/dist-lib/plist.cjs +1 -1
  59. package/dist-lib/plist.mjs +1 -1
  60. package/dist-lib/profiles.cjs +1 -1
  61. package/dist-lib/public-brand.cjs +1 -1
  62. package/dist-lib/public-origins-lib-esm.json +24 -24
  63. package/dist-lib/public-origins-lib.json +53 -53
  64. package/dist-lib/react-native-host-modules.cjs +1 -1
  65. package/dist-lib/react-native-host-modules.mjs +1 -1
  66. package/dist-lib/reap-browser.cjs +1 -1
  67. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  68. package/dist-lib/sdk.cjs +1 -1
  69. package/dist-lib/sdk.mjs +1 -1
  70. package/dist-lib/skills.cjs +159 -109
  71. package/dist-lib/swift-compile.cjs +1 -1
  72. package/dist-lib/swift-compile.mjs +1 -1
  73. package/dist-lib/swift-package.cjs +1 -1
  74. package/dist-lib/swift-package.mjs +1 -1
  75. package/dist-lib/swift-submit.cjs +1 -1
  76. package/dist-lib/swift-submit.mjs +1 -1
  77. package/dist-lib/swift-toolchain.cjs +1 -1
  78. package/dist-lib/swift.cjs +1 -1
  79. package/dist-lib/vite-swift.cjs +1 -1
  80. package/dist-lib/vite.cjs +2 -2
  81. package/dist-lib/worklet-executable.cjs +1 -1
  82. package/dist-lib/worklet-executable.mjs +1 -1
  83. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +2 -1
  84. package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
  85. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +1 -0
  86. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +1 -0
  87. package/kotlin/sdk.tar.gz +0 -0
  88. package/package.json +1 -1
  89. package/runtime-companion.json +1 -1
  90. package/src/bundle-channel.mjs +21 -3
  91. package/src/nitro-source.ts +8 -0
@@ -1,5 +1,9 @@
1
+ import { execFile } from 'node:child_process'
1
2
  import fs from 'node:fs'
3
+ import { createRequire } from 'node:module'
2
4
  import path from 'node:path'
5
+ import { pathToFileURL } from 'node:url'
6
+ import { promisify } from 'node:util'
3
7
  import {
4
8
  enumerateBundleColors,
5
9
  enumerateBundleImages,
@@ -13,9 +17,11 @@ import { stageHostFile } from '../src/host/staged-host-files'
13
17
  import {
14
18
  ONE_NATIVE_APP_CATALOG_ROUTE,
15
19
  parseOneNativeAppCatalog,
20
+ readOneNativeAppCatalog,
16
21
  } from '../src/one-native-app-catalog'
17
22
  import { findExpoAppConfig } from './app-project'
18
23
  import type { AppCatalog } from '#peach-cli-contract/engine/app-catalog-wire'
24
+ import type { OneNativeAppCatalog } from '../src/one-native-app-catalog'
19
25
 
20
26
  // the xcode build setting actool turns into the built Info.plist's
21
27
  // NSAccentColorName when the source plist does not name one itself
@@ -147,9 +153,28 @@ export async function discoverAppCatalog(
147
153
  )
148
154
  }
149
155
 
150
- // a One app with no ios/ on disk: its dev server reports what its native.app
151
- // declares for the catalog `one prebuild` writes, the AccentColor and the
152
- // declared asset catalog folder, read the way a prebuilt app's catalogs are.
156
+ // a One app with no ios/ on disk: what its native.app declares for the catalog
157
+ // `one prebuild` writes, the AccentColor and the declared asset catalog folder,
158
+ // read the way a prebuilt app's catalogs are.
159
+ export function oneDeclaredAppCatalog(
160
+ declared: OneNativeAppCatalog,
161
+ assetOrigin: string,
162
+ ): AppCatalog | null {
163
+ const { accentColor, assetCatalog } = declared
164
+ const accentName = accentColor ? 'AccentColor' : null
165
+ const files: string[] = []
166
+ if (assetCatalog) catalogFiles(assetCatalog, files)
167
+ const catalog = readAssetCatalog(
168
+ files,
169
+ readText,
170
+ (file) => stageHostFile(file, assetOrigin),
171
+ accentName,
172
+ )
173
+ if (catalog && accentColor) catalog.colors.AccentColor = accentColor
174
+ return catalog
175
+ }
176
+
177
+ // a running dev server reports the declaration from its evaluated config
153
178
  export async function discoverOneNativeAppCatalog(
154
179
  metroOrigin: string,
155
180
  assetOrigin: string,
@@ -163,17 +188,49 @@ export async function discoverOneNativeAppCatalog(
163
188
  )
164
189
  return null
165
190
  const declared = parseOneNativeAppCatalog(await response.json().catch(() => null))
166
- if (!declared) return null
167
- const { accentColor, assetCatalog } = declared
168
- const accentName = accentColor ? 'AccentColor' : null
169
- const files: string[] = []
170
- if (assetCatalog) catalogFiles(assetCatalog, files)
171
- const catalog = readAssetCatalog(
172
- files,
173
- readText,
174
- (file) => stageHostFile(file, assetOrigin),
175
- accentName,
191
+ return declared ? oneDeclaredAppCatalog(declared, assetOrigin) : null
192
+ }
193
+
194
+ export async function discoverProjectOneNativeAppCatalog(
195
+ projectRoot: string,
196
+ assetOrigin: string,
197
+ ): Promise<AppCatalog | null> {
198
+ const declared = await readProjectOneNativeAppCatalog(projectRoot, process.env, 'node')
199
+ return declared ? oneDeclaredAppCatalog(declared, assetOrigin) : null
200
+ }
201
+
202
+ // a production bundle has no dev server: evaluate the app's vite config with
203
+ // One's own loader, the one `one prebuild` reads native.app through.
204
+ export async function readProjectOneNativeAppCatalog(
205
+ projectRoot: string,
206
+ env: NodeJS.ProcessEnv,
207
+ runtimeExecutable: string,
208
+ ): Promise<OneNativeAppCatalog | null> {
209
+ let onePackage: string
210
+ try {
211
+ onePackage = createRequire(path.join(projectRoot, 'package.json')).resolve(
212
+ 'one/package.json',
213
+ )
214
+ } catch {
215
+ return null
216
+ }
217
+ const loader = pathToFileURL(
218
+ path.join(path.dirname(onePackage), 'dist/esm/vite/loadConfig.mjs'),
219
+ ).href
220
+ const { stdout } = await promisify(execFile)(
221
+ runtimeExecutable,
222
+ [
223
+ '--input-type=module',
224
+ '-e',
225
+ `const { loadUserOneOptions } = await import(process.argv[1])
226
+ const { oneOptions } = await loadUserOneOptions('build', true)
227
+ const app = typeof oneOptions?.native === 'object' ? oneOptions.native.app : undefined
228
+ process.stdout.write('\\n' + JSON.stringify({ app }) + '\\n')
229
+ process.exit(0)`,
230
+ loader,
231
+ ],
232
+ { cwd: projectRoot, env, maxBuffer: 64 * 1024 * 1024 },
176
233
  )
177
- if (catalog && accentColor) catalog.colors.AccentColor = accentColor
178
- return catalog
234
+ const json = stdout.split('\n').findLast((line) => line.startsWith('{"app"'))
235
+ return readOneNativeAppCatalog(json ? JSON.parse(json) : null, projectRoot)
179
236
  }
@@ -52,7 +52,11 @@ import {
52
52
  } from '../../src/simulator-route'
53
53
  import { sleep } from '../../src/sleep'
54
54
  import { stageAppBundleResources } from '../app-bundle-resources'
55
- import { discoverAppCatalog, discoverOneNativeAppCatalog } from '../app-catalog'
55
+ import {
56
+ discoverAppCatalog,
57
+ discoverOneNativeAppCatalog,
58
+ discoverProjectOneNativeAppCatalog,
59
+ } from '../app-catalog'
56
60
  import { discoverNativeLinkedAppFonts } from '../app-fonts'
57
61
  import {
58
62
  findExpoAppConfig,
@@ -467,10 +471,14 @@ async function stampAppCatalog(
467
471
  ): Promise<string> {
468
472
  const url = new URL(urlStr)
469
473
  const metroOrigin = loopbackOriginOf(url.searchParams.get('bundle') ?? '')
470
- if (!metroOrigin || !project) return urlStr
474
+ if (!project) return urlStr
475
+ // a prebuilt bundle has no dev server to ask: read the declaration from the
476
+ // project's One config
471
477
  const catalog =
472
478
  (await discoverAppCatalog(project.appDir, assetOrigin)) ??
473
- (await discoverOneNativeAppCatalog(metroOrigin, assetOrigin))
479
+ (metroOrigin
480
+ ? await discoverOneNativeAppCatalog(metroOrigin, assetOrigin)
481
+ : await discoverProjectOneNativeAppCatalog(project.appDir, assetOrigin))
474
482
  if (!catalog) return urlStr
475
483
  url.searchParams.set(
476
484
  'appCatalog',
@@ -1286,8 +1286,9 @@ export async function runUpload(
1286
1286
  (result.init.flowVideo ? 1 : 0) +
1287
1287
  (result.init.sceneStream ? 1 : 0) +
1288
1288
  (result.init.failureBundle ? 1 : 0)
1289
+ const { initMs, putMs, finalizeMs, finalizeServerTiming } = result.timing
1289
1290
  console.log(
1290
- ` PUT ${totalObjects} objects in ${Date.now() - putT0}ms (${(putBytes / 1024).toFixed(1)} KiB)`,
1291
+ ` uploaded ${totalObjects} objects in ${Date.now() - putT0}ms (${(putBytes / 1024).toFixed(1)} KiB): init ${initMs}ms, PUT ${putMs}ms, finalize ${finalizeMs}ms${finalizeServerTiming ? ` [${finalizeServerTiming}]` : ''}`,
1291
1292
  )
1292
1293
  } catch (err: unknown) {
1293
1294
  const e = err as {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (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.2260 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2262 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var REFUSED_PERFORM_STEP_TYPES = [