peachsim 0.1.2264 → 0.1.2266

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 (93) hide show
  1. package/cli/command-registry.ts +2 -0
  2. package/cli/commands/control.ts +13 -20
  3. package/cli/commands/cpu-profile.ts +139 -0
  4. package/cli/commands/defaults.ts +71 -0
  5. package/cli/main.ts +6 -0
  6. package/cli/outbound-endpoints.ts +0 -4
  7. package/dist-lib/agent-daemon-client.cjs +1 -1
  8. package/dist-lib/agent-events.cjs +1 -1
  9. package/dist-lib/attached-projects.cjs +1 -1
  10. package/dist-lib/auth/shared-session.cjs +1 -1
  11. package/dist-lib/backend-origin.cjs +1 -1
  12. package/dist-lib/beta.cjs +1 -1
  13. package/dist-lib/beta.mjs +1 -1
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.mjs +1 -1
  17. package/dist-lib/bridge-contract.cjs +1 -1
  18. package/dist-lib/bridge-contract.mjs +1 -1
  19. package/dist-lib/bundle-channel.cjs +2 -2
  20. package/dist-lib/capture-contract.cjs +1 -1
  21. package/dist-lib/capture-contract.mjs +1 -1
  22. package/dist-lib/cloud-contract.cjs +1 -1
  23. package/dist-lib/cloud-contract.mjs +1 -1
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +1 -1
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +1 -1
  28. package/dist-lib/config.cjs +1 -1
  29. package/dist-lib/config.mjs +1 -1
  30. package/dist-lib/detox/index.cjs +48 -5
  31. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  32. package/dist-lib/expo-swift-bundle.cjs +1 -1
  33. package/dist-lib/expo-swift-metadata.cjs +1 -1
  34. package/dist-lib/expo-swift-metadata.mjs +1 -1
  35. package/dist-lib/home-paths.cjs +1 -1
  36. package/dist-lib/host/bridge-host.cjs +2 -2
  37. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  38. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  39. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  40. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  41. package/dist-lib/host/websocket-proxy.cjs +1 -1
  42. package/dist-lib/index.cjs +2 -2
  43. package/dist-lib/jump-to-source-babel.cjs +1 -1
  44. package/dist-lib/jump-to-source-native.cjs +1 -1
  45. package/dist-lib/kotlin-host.cjs +1 -1
  46. package/dist-lib/menu.cjs +1 -1
  47. package/dist-lib/menu.mjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  50. package/dist-lib/metro-production-bundle.cjs +1 -1
  51. package/dist-lib/metro-production-bundle.mjs +1 -1
  52. package/dist-lib/metro.cjs +2 -2
  53. package/dist-lib/native-app-identity-project.cjs +1 -1
  54. package/dist-lib/native-app-identity-project.mjs +1 -1
  55. package/dist-lib/native-app-identity.cjs +1 -1
  56. package/dist-lib/native-app-identity.mjs +1 -1
  57. package/dist-lib/native-firebase-metadata.cjs +1 -1
  58. package/dist-lib/native-firebase-metadata.mjs +1 -1
  59. package/dist-lib/pdfium-raster.cjs +1 -1
  60. package/dist-lib/pdfium-raster.mjs +1 -1
  61. package/dist-lib/plist.cjs +1 -1
  62. package/dist-lib/plist.mjs +1 -1
  63. package/dist-lib/profiles.cjs +1 -1
  64. package/dist-lib/public-brand.cjs +1 -1
  65. package/dist-lib/public-origins-lib-esm.json +24 -24
  66. package/dist-lib/public-origins-lib.json +56 -53
  67. package/dist-lib/react-native-host-modules.cjs +1 -1
  68. package/dist-lib/react-native-host-modules.mjs +1 -1
  69. package/dist-lib/reap-browser.cjs +50 -7
  70. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  71. package/dist-lib/sdk.cjs +1 -1
  72. package/dist-lib/sdk.mjs +1 -1
  73. package/dist-lib/skills.cjs +2586 -2510
  74. package/dist-lib/swift-compile.cjs +1 -1
  75. package/dist-lib/swift-compile.mjs +1 -1
  76. package/dist-lib/swift-package.cjs +1 -1
  77. package/dist-lib/swift-package.mjs +1 -1
  78. package/dist-lib/swift-submit.cjs +1 -1
  79. package/dist-lib/swift-submit.mjs +1 -1
  80. package/dist-lib/swift-toolchain.cjs +1 -1
  81. package/dist-lib/swift.cjs +1 -1
  82. package/dist-lib/vite-swift.cjs +1 -1
  83. package/dist-lib/vite.cjs +2 -2
  84. package/dist-lib/worklet-executable.cjs +1 -1
  85. package/dist-lib/worklet-executable.mjs +1 -1
  86. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +4 -0
  87. package/kotlin/sdk.tar.gz +0 -0
  88. package/package.json +1 -1
  89. package/runtime-companion.json +1 -1
  90. package/skills/contrast/SKILL.md +1 -0
  91. package/skills/peach-perf/references/profiling.md +3 -0
  92. package/src/headless-policy.ts +67 -0
  93. package/src/reap-browser.ts +16 -1
@@ -30,6 +30,7 @@ const NODE_COMMAND_NAMES = [
30
30
  'camera',
31
31
  'location',
32
32
  'push',
33
+ 'defaults',
33
34
  'mode',
34
35
  'debug',
35
36
  'timeline',
@@ -301,6 +302,7 @@ export function createRnxCommandInvocation(
301
302
  case 'camera':
302
303
  case 'location':
303
304
  case 'push':
305
+ case 'defaults':
304
306
  return { ...common, family: 'action' }
305
307
  case 'screenshot':
306
308
  return { ...common, family: 'screenshot', command: 'screenshot' }
@@ -33,6 +33,7 @@ import { isDeviceModel, type DeviceModel } from '../../src/device-catalog.ts'
33
33
  import { readProjectDotEnv } from '../../src/dot-env'
34
34
  import { awaitStampedExpoSwiftReady } from '../../src/expo-swift-ready'
35
35
  import { flowTimeoutScale } from '../../src/flow-timeout-scale'
36
+ import { resolveHeadless } from '../../src/headless-policy'
36
37
  import { activatePeachHome } from '../../src/home-activity'
37
38
  import {
38
39
  isDaemonLockfileFresh,
@@ -204,27 +205,19 @@ function simUsesDriver(
204
205
  return sim.userAgent?.includes('Electron/') === true
205
206
  }
206
207
 
207
- // resolve headless for a driver launch. explicit flags always win
208
- // (--headless → true, --headed → false). otherwise: a headed default
209
- // on mac/windows for humans; tm sessions default headless. on linux with no DISPLAY/WAYLAND_DISPLAY there is no
210
- // X server, so the playwright driver auto-flips to headless with a
211
- // single-line note. electron ignores headless mode, so it defaults false.
208
+ // resolve headless for a driver launch through the shared host policy
209
+ // (src/headless-policy.ts): explicit --headless wins; --headed is honored only
210
+ // where the host can show a window; otherwise agents and CI run headless and
211
+ // a person at a desktop gets a window. electron and the native desktop app
212
+ // always present their own window.
212
213
  export function resolveDriverHeadless(args: string[], driverId: string): boolean {
213
214
  if (args.includes('--headless')) return true
214
- if (args.includes('--headed')) return false
215
- if (driverId === 'playwright' && isTeamMachineSession()) return true
216
- if (
217
- driverId === 'playwright' &&
218
- process.platform === 'linux' &&
219
- !process.env.DISPLAY &&
220
- !process.env.WAYLAND_DISPLAY
221
- ) {
222
- console.error(
223
- ' no display detected → running playwright headless (override with --headed)',
224
- )
225
- return true
226
- }
227
- return false
215
+ if (driverId !== 'playwright') return false
216
+ const requested = args.includes('--headed') ? 'headed' : undefined
217
+ const headless = resolveHeadless(requested)
218
+ if (headless && requested === 'headed')
219
+ console.error(' no display or GPU detected → running playwright headless')
220
+ return headless
228
221
  }
229
222
 
230
223
  type BridgeOpenGate = {
@@ -1726,7 +1719,7 @@ async function openSim(
1726
1719
  // headless browser, as do the browser-only --headless and --chromium.
1727
1720
  const defaultDriverId: DriverId =
1728
1721
  isCi() ||
1729
- isTeamMachineSession() ||
1722
+ resolveHeadless(undefined) ||
1730
1723
  args.includes('--headless') ||
1731
1724
  args.includes('--chromium')
1732
1725
  ? 'playwright'
@@ -32,6 +32,7 @@ import { WebSocket } from 'ws'
32
32
  import { getCliVersion } from '../../src/cli-version'
33
33
  import { sleep } from '../../src/sleep'
34
34
  import { IS_STANDALONE } from '../standalone'
35
+ import { createBridgeFromParsed, evalInBridge, parseBridgeCliArgs } from '../ws-bridge'
35
36
 
36
37
  interface ProfileOptions {
37
38
  port?: number
@@ -407,6 +408,140 @@ function readInteractionBarrierState(
407
408
  return { marker, reachedAtEpochMs, releasedBy, releasedAtEpochMs }
408
409
  }
409
410
 
411
+ // the desktop host samples every realm of the connected window (host thread, engine, shell,
412
+ // compositor, tenant, workers) and hands each back as a V8 cpu profile, so no Chrome is needed
413
+ async function runHostCpuProfile(
414
+ args: string[],
415
+ opts: ProfileOptions,
416
+ duration: number,
417
+ ): Promise<number> {
418
+ const parsed = parseBridgeCliArgs(args, {
419
+ port: opts.port,
420
+ commandTimeoutMs: 120_000,
421
+ stripBooleanFlags: ['--host'],
422
+ stripValueFlags: ['--duration', '--sample-interval', '--output', '-o'],
423
+ })
424
+ const sampleIntervalMs = Number(valueOf(args, '--sample-interval') ?? '0.25')
425
+ if (!Number.isFinite(sampleIntervalMs) || sampleIntervalMs <= 0) {
426
+ console.error(' --sample-interval must be a positive number (milliseconds)')
427
+ return 1
428
+ }
429
+ const outputPath = resolve(
430
+ process.cwd(),
431
+ valueOf(args, '--output') ?? valueOf(args, '-o') ?? '/tmp/peach.cpuprofile',
432
+ )
433
+ const bridge = createBridgeFromParsed(parsed)
434
+ try {
435
+ const call = (action: 'start' | 'stop') =>
436
+ evalInBridge<{ error?: string; name: string; profile?: any; url: string }[]>(
437
+ bridge,
438
+ `(async () => {
439
+ const host = globalThis.__peachWorkerHost
440
+ if (typeof host?.cpuProfile !== 'function') throw new Error('this sim has no host cpu profiler: it is not a desktop host window, or its runtime predates it; update the runtime')
441
+ return host.cpuProfile(${JSON.stringify(action)}, ${sampleIntervalMs * 1000})
442
+ })()`,
443
+ )
444
+ const startedRealms = await call('start')
445
+ const windowStartedAtMs = performance.now()
446
+ const windowStartedAtEpochMs = Date.now()
447
+ console.log(
448
+ ` recording ${duration}s across ${startedRealms.length} realm(s) — interact now…`,
449
+ )
450
+ await sleep(duration * 1000)
451
+ const windowEndedAtMs = windowStartedAtMs + duration * 1000
452
+ const stopped = await call('stop')
453
+ const stoppedAtMs = performance.now()
454
+ const targets = stopped.map((realm) => ({
455
+ ...realm,
456
+ role: cpuProfileTargetRole(realm.url, realm.name),
457
+ }))
458
+ const roleLabels = cpuProfileRoleLabels(
459
+ targets.map((target) => ({
460
+ captured: target.profile !== undefined,
461
+ role: target.role,
462
+ })),
463
+ )
464
+ mkdirSync(dirname(outputPath), { recursive: true })
465
+ const manifest = targets.map((target, index) => {
466
+ const role = roleLabels[index]
467
+ const profilePath = target.profile
468
+ ? outputPath.replace(/(\.[^./]+)?$/, `.${role}$1`)
469
+ : null
470
+ if (profilePath) {
471
+ writeFileSync(profilePath, JSON.stringify(target.profile))
472
+ console.log(
473
+ ` ${role} ${target.name}: ${target.profile.samples.length} samples → ${profilePath}`,
474
+ )
475
+ } else {
476
+ console.error(
477
+ ` ${role} ${target.name}: no profile${target.error ? ` — ${target.error}` : ''}`,
478
+ )
479
+ }
480
+ if (opts.verbose && target.profile?.samples.length > 0) {
481
+ for (const fn of topSelfTime(target.profile, 12)) {
482
+ console.log(` ${fn.pct.toFixed(1).padStart(5)}% ${fn.name} ${fn.url}`)
483
+ }
484
+ }
485
+ return {
486
+ role,
487
+ baseRole: target.role,
488
+ type: 'host-realm',
489
+ title: target.name,
490
+ url: target.url,
491
+ ...cpuProfileCoverage(
492
+ windowStartedAtMs,
493
+ stoppedAtMs,
494
+ windowStartedAtMs,
495
+ windowEndedAtMs,
496
+ ),
497
+ samples: target.profile?.samples.length ?? 0,
498
+ profilePath,
499
+ error: target.error ?? null,
500
+ }
501
+ })
502
+ const capturedRoles = new Set(
503
+ manifest
504
+ .filter((target) => target.profilePath !== null)
505
+ .map((target) => target.baseRole),
506
+ )
507
+ const missingRoles = ['shell', 'compositor', 'tenant'].filter(
508
+ (role) => !capturedRoles.has(role),
509
+ )
510
+ const complete = missingRoles.length === 0
511
+ const manifestPath = outputPath.replace(/(\.[^./]+)?$/, '.manifest.json')
512
+ writeFileSync(
513
+ manifestPath,
514
+ JSON.stringify(
515
+ {
516
+ cli: {
517
+ version: getCliVersion(),
518
+ standalone: IS_STANDALONE,
519
+ argv: process.argv.slice(1),
520
+ },
521
+ host: true,
522
+ complete,
523
+ missingRoles,
524
+ requestedDurationMs: duration * 1000,
525
+ captureWindowStartedAt: new Date(windowStartedAtEpochMs).toISOString(),
526
+ captureWindowEndedAt: new Date(
527
+ windowStartedAtEpochMs + duration * 1000,
528
+ ).toISOString(),
529
+ manifest,
530
+ },
531
+ null,
532
+ 2,
533
+ ),
534
+ )
535
+ console.log(` manifest → ${manifestPath}`)
536
+ if (!complete)
537
+ console.error(` incomplete capture — missing ${missingRoles.join(', ')}`)
538
+ console.log(' open in chrome devtools → Performance → Load profile to inspect.')
539
+ return complete ? 0 : 1
540
+ } finally {
541
+ bridge.close()
542
+ }
543
+ }
544
+
410
545
  export async function runCpuProfile(
411
546
  args: string[],
412
547
  opts: ProfileOptions,
@@ -419,6 +554,8 @@ usage:
419
554
  peach perf cpu [options]
420
555
 
421
556
  options:
557
+ --host profile the connected desktop app's realms over the
558
+ bridge, no CDP (the packaged desktop app)
422
559
  --cdp-port <number> Chrome debugging port (default: PEACH_CDP_PORT or 9222)
423
560
  --match <substring> page URL filter (default: /rn/)
424
561
  --duration <seconds> capture duration (default: 5)
@@ -430,6 +567,7 @@ options:
430
567
  examples:
431
568
  peach open 8081 --new --driver playwright --cdp-port 9222
432
569
  peach perf cpu --cdp-port 9222 --match 8081 --duration 5
570
+ peach perf cpu --host --duration 8 -o /tmp/app.cpuprofile
433
571
 
434
572
  Writes a page profile, worker profiles, and a manifest alongside the output.
435
573
  `)
@@ -441,6 +579,7 @@ Writes a page profile, worker profiles, and a manifest alongside the output.
441
579
  console.error(' --duration must be a positive number (seconds)')
442
580
  return 1
443
581
  }
582
+ if (args.includes('--host')) return runHostCpuProfile(args, opts, duration)
444
583
  const sampleInterval = Number(valueOf(args, '--sample-interval') ?? '0.1') // ms
445
584
  const interactionBarrierEnabled = args.includes('--interaction-barrier')
446
585
  const interactionBarrierTimeoutSeconds = Number(
@@ -0,0 +1,71 @@
1
+ import { buildBinaryPlist } from '../../src/plist-bytes'
2
+ import { swiftPreferenceStorageKey } from '../../src/storageSnapshotContract'
3
+ import {
4
+ callInBridgeWrite,
5
+ createBridgeFromParsed,
6
+ parseBridgeCliArgs,
7
+ } from '../ws-bridge'
8
+
9
+ const USAGE =
10
+ 'usage: peach defaults write <suite> <key> (--string <text> | --strings <json-array> | --data <text>) [--sim <id>]'
11
+
12
+ export async function runDefaults(
13
+ args: string[],
14
+ opts: { port?: number } = {},
15
+ ): Promise<number> {
16
+ if (args.includes('--help') || args.includes('-h')) {
17
+ console.log(USAGE)
18
+ return 0
19
+ }
20
+ const parsed = parseBridgeCliArgs(args, {
21
+ port: opts.port,
22
+ stripValueFlags: ['--string', '--strings', '--data'],
23
+ stripBooleanFlags: ['--help', '-h', '--json'],
24
+ })
25
+ const [verb, suite, key] = parsed.positional
26
+ const flag = (name: string) => {
27
+ const index = args.indexOf(name)
28
+ return index === -1 ? undefined : args[index + 1]
29
+ }
30
+ const string = flag('--string')
31
+ const strings = flag('--strings')
32
+ const data = flag('--data')
33
+ if (
34
+ verb !== 'write' ||
35
+ !suite ||
36
+ !key ||
37
+ parsed.positional.length !== 3 ||
38
+ [string, strings, data].filter((value) => value !== undefined).length !== 1
39
+ ) {
40
+ console.error(USAGE)
41
+ return 1
42
+ }
43
+ const bridge = createBridgeFromParsed(parsed)
44
+ try {
45
+ const list: unknown = strings === undefined ? undefined : JSON.parse(strings)
46
+ if (
47
+ list !== undefined &&
48
+ (!Array.isArray(list) || list.some((item) => typeof item !== 'string'))
49
+ )
50
+ throw new Error('--strings must be a JSON array of strings')
51
+ const value = string ?? list ?? Buffer.from(data ?? '', 'utf8')
52
+ // the preferences host stores a one-element binary plist around the value
53
+ const plist = buildBinaryPlist([value]).toString('base64')
54
+ const result = await callInBridgeWrite<{ ok: boolean; error?: string } | null>(
55
+ bridge,
56
+ '__sootsimTest.writeSwiftPreference',
57
+ swiftPreferenceStorageKey(suite, key),
58
+ plist,
59
+ )
60
+ if (!result?.ok) throw new Error(result?.error ?? 'no test bridge')
61
+ console.log(`wrote ${suite} ${key}`)
62
+ return 0
63
+ } catch (error) {
64
+ console.error(
65
+ `defaults failed: ${error instanceof Error ? error.message : String(error)}`,
66
+ )
67
+ return 1
68
+ } finally {
69
+ bridge.close()
70
+ }
71
+ }
package/cli/main.ts CHANGED
@@ -536,6 +536,12 @@ try {
536
536
  await exitWithFlush(code)
537
537
  }
538
538
 
539
+ case 'defaults': {
540
+ const { runDefaults } = await import('./commands/defaults')
541
+ const code = await runDefaults(commandArgsWithSim, { port })
542
+ await exitWithFlush(code)
543
+ }
544
+
539
545
  case 'location': {
540
546
  const { runLocation } = await import('./commands/location')
541
547
  const code = await runLocation(commandArgsWithSim, { port })
@@ -998,10 +998,6 @@ export const DECLARED_OUTBOUND_CALLS: Record<string, OutboundCallDeclaration> =
998
998
  category: 'local_development',
999
999
  count: 1,
1000
1000
  },
1001
- 'packages/peach-engine/src/ios/apps/PhotosApp.tsx :: fetch :: currentImage.uri': {
1002
- category: 'same_origin_runtime',
1003
- count: 1,
1004
- },
1005
1001
  'packages/peach-engine/src/render-worker/audio-host.ts :: fetch :: session.src!': {
1006
1002
  category: 'guest_app_network',
1007
1003
  count: 1,
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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
- /*! peach v0.1.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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;
@@ -66058,7 +66058,7 @@ var import_node_path5 = require("node:path");
66058
66058
  init_src();
66059
66059
 
66060
66060
  // runtime-companion.json
66061
- var runtime_companion_default = { abi: 1, sha256: "9ea841897a63090ddbce1dbf9be3b55664d3630f612f68e9f3035948dc019b3b", file: "node/cli-9ea841897a63090ddbce1dbf9be3b55664d3630f612f68e9f3035948dc019b3b.cjs" };
66061
+ var runtime_companion_default = { abi: 1, sha256: "e93e06ad59ffc08685ad0273fa479b7bcf943306a1e7d39f0116f30238a944c2", file: "node/cli-e93e06ad59ffc08685ad0273fa479b7bcf943306a1e7d39f0116f30238a944c2.cjs" };
66062
66062
 
66063
66063
  // src/cli-runtime.ts
66064
66064
  init_answeredNativePackages();
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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
- /*! peach v0.1.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/cloud-contract.ts
4
4
  var RNX_CLOUD_MAX_ARTIFACT_BYTES = 40761776;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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
- /*! peach v0.1.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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
- /*! peach v0.1.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // ../contrast-runtime-delivery/src/version.ts
4
4
  function isValidRuntimeVersion(value) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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;
@@ -2475,7 +2475,7 @@ function isValidRuntimeVersion(value) {
2475
2475
  }
2476
2476
 
2477
2477
  // runtime-companion.json
2478
- var runtime_companion_default = { abi: 1, sha256: "9ea841897a63090ddbce1dbf9be3b55664d3630f612f68e9f3035948dc019b3b", file: "node/cli-9ea841897a63090ddbce1dbf9be3b55664d3630f612f68e9f3035948dc019b3b.cjs" };
2478
+ var runtime_companion_default = { abi: 1, sha256: "e93e06ad59ffc08685ad0273fa479b7bcf943306a1e7d39f0116f30238a944c2", file: "node/cli-e93e06ad59ffc08685ad0273fa479b7bcf943306a1e7d39f0116f30238a944c2.cjs" };
2479
2479
 
2480
2480
  // src/runtime-assets.ts
2481
2481
  var import_fs = __toESM(require("fs"), 1);
@@ -6415,9 +6415,45 @@ async function acquireChromiumAdmission(deps) {
6415
6415
  }
6416
6416
  }
6417
6417
 
6418
+ // src/headless-policy.ts
6419
+ var import_node_fs7 = require("node:fs");
6420
+ function resolveHeadless(requested, host = currentHeadlessHost()) {
6421
+ if (requested === "headless") return true;
6422
+ if (!host.display || !host.gpu) return true;
6423
+ if (requested === "headed") return false;
6424
+ return Boolean(host.env.TM_SESSION || host.env.CI || host.env.GITHUB_ACTIONS);
6425
+ }
6426
+ function currentHeadlessHost(platform = process.platform, env = process.env) {
6427
+ return {
6428
+ platform,
6429
+ env,
6430
+ display: hostHasDisplay(platform, env),
6431
+ gpu: hostHasGpu(platform)
6432
+ };
6433
+ }
6434
+ function hostHasDisplay(platform, env) {
6435
+ if (platform === "linux") return Boolean(env.DISPLAY || env.WAYLAND_DISPLAY);
6436
+ if (platform === "darwin") return safe(() => (0, import_node_fs7.statSync)("/dev/console").uid !== 0, false);
6437
+ return true;
6438
+ }
6439
+ function hostHasGpu(platform) {
6440
+ if (platform !== "linux") return true;
6441
+ return safe(
6442
+ () => (0, import_node_fs7.readdirSync)("/dev/dri").some((name2) => name2.startsWith("renderD")) || safe(() => (0, import_node_fs7.statSync)("/dev/nvidiactl").isCharacterDevice(), false),
6443
+ false
6444
+ );
6445
+ }
6446
+ function safe(read, fallback) {
6447
+ try {
6448
+ return read();
6449
+ } catch {
6450
+ return fallback;
6451
+ }
6452
+ }
6453
+
6418
6454
  // src/launch-deadline.ts
6419
6455
  var import_node_child_process3 = require("node:child_process");
6420
- var import_node_fs7 = require("node:fs");
6456
+ var import_node_fs8 = require("node:fs");
6421
6457
  var os2 = __toESM(require("node:os"), 1);
6422
6458
  var path4 = __toESM(require("node:path"), 1);
6423
6459
  var LEDGER_PATH2 = path4.join(
@@ -6429,7 +6465,7 @@ var MAX_COUNTED_GAP_MS = TICK_MS2 * 3;
6429
6465
  function heldPids() {
6430
6466
  try {
6431
6467
  const ledger = JSON.parse(
6432
- (0, import_node_fs7.readFileSync)(LEDGER_PATH2, "utf8")
6468
+ (0, import_node_fs8.readFileSync)(LEDGER_PATH2, "utf8")
6433
6469
  );
6434
6470
  return Object.values(ledger).flatMap((procs) => procs.map((proc) => proc.pid));
6435
6471
  } catch {
@@ -6498,6 +6534,12 @@ var installed = false;
6498
6534
  function currentRuntime() {
6499
6535
  return { platform: process.platform, env: process.env };
6500
6536
  }
6537
+ function withHostHeadless(opts, runtime, software) {
6538
+ if (opts.headless !== false) return opts;
6539
+ const host = currentHeadlessHost(runtime.platform, runtime.env);
6540
+ const headless = software || resolveHeadless("headed", host);
6541
+ return headless ? { ...opts, headless: true } : opts;
6542
+ }
6501
6543
  function processCommand(pid) {
6502
6544
  return (0, import_node_child_process4.execFileSync)("/bin/ps", ["-p", String(pid), "-o", "command="], {
6503
6545
  encoding: "utf8"
@@ -6893,6 +6935,7 @@ function mergeFeatureSwitches(args, enabled = []) {
6893
6935
  ];
6894
6936
  }
6895
6937
  function gpuChromeLaunchOptions(opts = {}, runtime = currentRuntime()) {
6938
+ opts = withHostHeadless(opts, runtime, false);
6896
6939
  const callerArgs = Array.isArray(opts.args) ? opts.args : [];
6897
6940
  const unsafe = callerArgs.find(isSoftwareRendererArgument);
6898
6941
  if (unsafe !== void 0) {
@@ -7031,7 +7074,7 @@ function platformChromeLaunch(launch, opts, rendererTarget, policy = {}) {
7031
7074
  };
7032
7075
  }
7033
7076
  function softwareChromeLaunchOptions(opts, runtime = currentRuntime()) {
7034
- opts = withClaimedSignalShutdown(opts);
7077
+ opts = withHostHeadless(withClaimedSignalShutdown(opts), runtime, true);
7035
7078
  if (opts.ignoreDefaultArgs === true) {
7036
7079
  throw new Error(
7037
7080
  "[reap-browser] ignoreDefaultArgs=true bypasses required Chrome launch defaults"
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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.2264 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2266 | (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;