peachsim 0.1.1653 → 0.1.1654

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 (110) hide show
  1. package/cli/app-stubs.ts +97 -14
  2. package/cli/bridge-diagnostics.ts +10 -7
  3. package/cli/cloud-client.ts +11 -2
  4. package/cli/commands/doctor.ts +20 -10
  5. package/cli/commands/inspect/core.ts +2 -1
  6. package/cli/commands/inspect/shared.ts +2 -0
  7. package/cli/commands/inspect.ts +11 -2
  8. package/cli/output-redaction.ts +22 -6
  9. package/cli/pause-aware-timeout.ts +24 -10
  10. package/cli/ws-bridge.ts +17 -1
  11. package/dist-lib/agent-daemon-client.cjs +1 -1
  12. package/dist-lib/agent-events.cjs +1 -1
  13. package/dist-lib/attached-projects.cjs +1 -1
  14. package/dist-lib/auth/shared-session.cjs +1 -1
  15. package/dist-lib/backend-origin.cjs +1 -1
  16. package/dist-lib/beta.cjs +1 -1
  17. package/dist-lib/beta.mjs +1 -1
  18. package/dist-lib/bridge-constants.cjs +1 -1
  19. package/dist-lib/bridge-contract-input.cjs +1 -1
  20. package/dist-lib/bridge-contract-input.mjs +1 -1
  21. package/dist-lib/bridge-contract.cjs +1 -1
  22. package/dist-lib/bridge-contract.mjs +1 -1
  23. package/dist-lib/bundle-channel.cjs +42 -50
  24. package/dist-lib/capture-contract.cjs +1 -1
  25. package/dist-lib/capture-contract.mjs +1 -1
  26. package/dist-lib/cloud-contract.cjs +1 -1
  27. package/dist-lib/cloud-contract.mjs +1 -1
  28. package/dist-lib/cloud-test-args.cjs +1 -1
  29. package/dist-lib/cloud-test-args.mjs +1 -1
  30. package/dist-lib/cloud.cjs +1 -1
  31. package/dist-lib/cloud.mjs +1 -1
  32. package/dist-lib/config.cjs +1 -1
  33. package/dist-lib/config.mjs +1 -1
  34. package/dist-lib/detox/index.cjs +47 -12
  35. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  36. package/dist-lib/expo-swift-bundle.cjs +41 -49
  37. package/dist-lib/expo-swift-metadata.cjs +1 -1
  38. package/dist-lib/expo-swift-metadata.mjs +1 -1
  39. package/dist-lib/home-paths.cjs +1 -1
  40. package/dist-lib/host/bridge-host.cjs +70 -52
  41. package/dist-lib/host/fetch-proxy-handler.cjs +176 -31
  42. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  43. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  44. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  45. package/dist-lib/host/websocket-proxy.cjs +1 -1
  46. package/dist-lib/index.cjs +633 -373
  47. package/dist-lib/jump-to-source-babel.cjs +1 -1
  48. package/dist-lib/jump-to-source-native.cjs +1 -1
  49. package/dist-lib/kotlin-host.cjs +1 -1
  50. package/dist-lib/menu.cjs +1 -1
  51. package/dist-lib/menu.mjs +1 -1
  52. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  53. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  54. package/dist-lib/metro-production-bundle.cjs +1 -1
  55. package/dist-lib/metro-production-bundle.mjs +1 -1
  56. package/dist-lib/metro.cjs +62 -14
  57. package/dist-lib/native-app-identity-project.cjs +1 -1
  58. package/dist-lib/native-app-identity-project.mjs +1 -1
  59. package/dist-lib/native-app-identity.cjs +1 -1
  60. package/dist-lib/native-app-identity.mjs +1 -1
  61. package/dist-lib/native-firebase-metadata.cjs +1 -1
  62. package/dist-lib/native-firebase-metadata.mjs +1 -1
  63. package/dist-lib/plist.cjs +1 -1
  64. package/dist-lib/plist.mjs +1 -1
  65. package/dist-lib/profiles.cjs +1 -1
  66. package/dist-lib/public-brand.cjs +1 -1
  67. package/dist-lib/public-origins-lib-esm.json +23 -23
  68. package/dist-lib/public-origins-lib.json +62 -54
  69. package/dist-lib/react-native-host-modules.cjs +1 -1
  70. package/dist-lib/react-native-host-modules.mjs +1 -1
  71. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  72. package/dist-lib/sdk.cjs +2 -2
  73. package/dist-lib/sdk.mjs +2 -2
  74. package/dist-lib/skills.cjs +284 -185
  75. package/dist-lib/swift-compile.cjs +23 -3
  76. package/dist-lib/swift-compile.mjs +22 -3
  77. package/dist-lib/swift-package.cjs +1 -1
  78. package/dist-lib/swift-package.mjs +1 -1
  79. package/dist-lib/swift-submit.cjs +1 -1
  80. package/dist-lib/swift-submit.mjs +1 -1
  81. package/dist-lib/swift-toolchain.cjs +1 -1
  82. package/dist-lib/swift.cjs +1 -1
  83. package/dist-lib/vite-swift.cjs +41 -49
  84. package/dist-lib/vite.cjs +385 -200
  85. package/dist-lib/worklet-executable.cjs +1 -1
  86. package/dist-lib/worklet-executable.mjs +1 -1
  87. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +1 -0
  88. package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +10 -7
  89. package/dist-types/packages/peach-engine/src/capture/browser-composite.d.ts +10 -0
  90. package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
  91. package/dist-types/packages/peach-engine/src/engine/node.d.ts +3 -1
  92. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
  93. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +23 -0
  94. package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -1
  95. package/dist-types/packages/peach-engine/src/engine/visible-frame.d.ts +1 -0
  96. package/dist-types/packages/peach-engine/src/observability/types.d.ts +1 -0
  97. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +38 -0
  98. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +5 -0
  99. package/package.json +5 -1
  100. package/runtime-companion.json +1 -1
  101. package/src/bridge-contract.ts +2 -0
  102. package/src/bundleGlobalFooter.ts +9 -0
  103. package/src/host/fetch-proxy-handler.ts +37 -0
  104. package/src/sfSymbolMetricsContract.ts +268 -0
  105. package/src/swift-compile.ts +16 -1
  106. package/src/swift-distribution.lock.json +20 -46
  107. package/src/swift-objc-metadata.ts +21 -7
  108. package/src/swift-objc-sdk.ts +13 -0
  109. package/src/vite-plugin-one.ts +161 -16
  110. package/src/host/lease-owner.test.ts +0 -49
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
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;
@@ -9903,9 +9903,11 @@ ${prefix}${json}${suffix}`;
9903
9903
  const identity = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
9904
9904
  return identity < 0 ? source + footer : source.slice(0, identity) + footer + source.slice(identity);
9905
9905
  }
9906
+ var ROLLDOWN_INVENTORY_HEADER;
9906
9907
  var init_bundleGlobalFooter = __esm({
9907
9908
  "src/bundleGlobalFooter.ts"() {
9908
9909
  "use strict";
9910
+ ROLLDOWN_INVENTORY_HEADER = "X-Peach-Rolldown-Inventory";
9909
9911
  }
9910
9912
  });
9911
9913
 
@@ -10026,7 +10028,7 @@ var init_runtime_assets = __esm({
10026
10028
  var runtime_companion_default;
10027
10029
  var init_runtime_companion = __esm({
10028
10030
  "runtime-companion.json"() {
10029
- runtime_companion_default = { abi: 1, sha256: "d58f0fedc3c0065faaafcf578781567b6cdac88e5c062a8354111d37fdf3c465", file: "node/cli-d58f0fedc3c0065faaafcf578781567b6cdac88e5c062a8354111d37fdf3c465.cjs" };
10031
+ runtime_companion_default = { abi: 1, sha256: "a1b49c57129dd06888a9cdfbb05051be3626e8233980236705a3efd52b651623", file: "node/cli-a1b49c57129dd06888a9cdfbb05051be3626e8233980236705a3efd52b651623.cjs" };
10030
10032
  }
10031
10033
  });
10032
10034
 
@@ -13599,9 +13601,12 @@ async function buildRnxCloudArtifact(bundle, options = {}) {
13599
13601
  if (getCliRuntime().preview_bundle_layout.isRolldownBundle(bundle)) {
13600
13602
  if (mode !== "production")
13601
13603
  throw new Error("peach Cloud One artifacts require a production bundle");
13604
+ const { attachRolldownBundleInventory, stripRolldownBundleInventoryFooter } = getCliRuntime().rolldown_bundle_inventory;
13602
13605
  const { readRolldownProductionInput } = getCliRuntime().rolldown_production_fingerprint;
13603
- code = (0, import_metro_production_bundle.detachRNXMetroSourceMapUrl)(bundle).source;
13604
- modules = (await readRolldownProductionInput(code)).modules.length;
13606
+ const raw2 = (0, import_metro_production_bundle.detachRNXMetroSourceMapUrl)(bundle).source;
13607
+ const annotated = await attachRolldownBundleInventory(raw2);
13608
+ modules = (await readRolldownProductionInput(annotated)).modules.length;
13609
+ code = stripRolldownBundleInventoryFooter(annotated);
13605
13610
  } else {
13606
13611
  const hostVersionEvidence = readHostVersionEvidence(bundle);
13607
13612
  const autolinked = detachAndroidAutolinkingFooter(bundle);
@@ -30802,6 +30807,19 @@ __attribute__((swift_bridge("Swift.String")))
30802
30807
  - (void)appendFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
30803
30808
  + (NSMutableString *)stringWithCapacity:(NSUInteger)capacity;
30804
30809
  @end
30810
+ NS_SWIFT_UNAVAILABLE("Use String or NSString instead.")
30811
+ @interface NSSimpleCString : NSString {
30812
+ @package
30813
+ char *bytes;
30814
+ int numBytes;
30815
+ #if __LP64__
30816
+ int _unused;
30817
+ #endif
30818
+ }
30819
+ @end
30820
+ NS_SWIFT_UNAVAILABLE("Use String or NSString instead.")
30821
+ @interface NSConstantString : NSSimpleCString
30822
+ @end
30805
30823
  @interface NSAttributedString : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
30806
30824
  @property (readonly, copy) NSString *string;
30807
30825
  @end
@@ -33773,6 +33791,11 @@ var SWIFTPM_NOISE = /^(?:\[\d+\/\d+\] |Building for production\.\.\.$|warning: '
33773
33791
  var BUILD_JOBS = String(
33774
33792
  Math.min(4, Math.max(1, Math.floor(import_node_os5.default.availableParallelism() / 2)))
33775
33793
  );
33794
+ var SWIFT_BUILDER_TRANSPORT_MARGIN_MS = 3e5;
33795
+ var SWIFT_BUILDER_DEFAULT_COMPILE_MS = 18e5;
33796
+ function swiftBuilderHopTimeoutMs(compileTimeoutMs) {
33797
+ return (compileTimeoutMs ?? SWIFT_BUILDER_DEFAULT_COMPILE_MS) + SWIFT_BUILDER_TRANSPORT_MARGIN_MS;
33798
+ }
33776
33799
  function swiftDistributionAt(root) {
33777
33800
  const file = import_node_path11.default.join(root, SWIFT_DISTRIBUTION_MANIFEST);
33778
33801
  if (!(0, import_node_fs12.existsSync)(file)) return null;
@@ -34161,7 +34184,7 @@ var EXECUTABLE_LINK_FLAGS = ` "-Xclang-linker", "-O0",
34161
34184
  `;
34162
34185
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
34163
34186
  var MULTI_MANIFEST_VERSION = 39;
34164
- var compilerSourceDigest = true ? "f4eb526a3d0d01972f3bb179b60c2b10df37c90e90ad1717a3b4946374cdb248" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
34187
+ var compilerSourceDigest = true ? "bcd59db8ba588a1eb76c6f08e64f5b5b6acda2e913adef5edd85345fef2c0cc7" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
34165
34188
  function swiftArtifactHash(input, release, moduleRoot) {
34166
34189
  const hash2 = (0, import_node_crypto9.createHash)("sha256");
34167
34190
  hash2.update(`swift-compile
@@ -39227,7 +39250,7 @@ function compileSwiftProjectUnit(input, options) {
39227
39250
  ],
39228
39251
  {
39229
39252
  cwd: repo,
39230
- timeout: options.timeoutMs,
39253
+ timeout: options.timeoutMs === void 0 ? void 0 : swiftBuilderHopTimeoutMs(options.timeoutMs),
39231
39254
  maxBuffer: 64 * 1024 * 1024,
39232
39255
  signal: options.signal
39233
39256
  },
@@ -41323,12 +41346,12 @@ init_home_paths();
41323
41346
 
41324
41347
  // src/swift-distribution.lock.json
41325
41348
  var swift_distribution_lock_default = {
41326
- id: "e3bdd3d8fa4f9993",
41349
+ id: "ca4dfda0ca14bc49",
41327
41350
  release: "swift-6.4.0-RELEASE-custom-0d775d32d7c74eae",
41328
41351
  wasmSdkId: "swift-6.4.0-RELEASE_wasm-peach-f02bd198",
41329
41352
  wasmSdkUrl: "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-f02bd198.artifactbundle.tar.gz",
41330
41353
  wasmSdkChecksum: "1e19ea768fd4e821aae34b8966c4ddcee45615c4b3cf018979b061aee2fb5504",
41331
- source: "5791eeff9ca9c054514aeb4a6599e1de8e1e4711",
41354
+ source: "33e8641403dd73a7ce0ca902007e3a36407e1f0b",
41332
41355
  targets: [
41333
41356
  "ImagePlayground",
41334
41357
  "QuickLookThumbnailing",
@@ -41373,6 +41396,7 @@ var swift_distribution_lock_default = {
41373
41396
  "PeachObjCRuntime",
41374
41397
  "PeachObjC",
41375
41398
  "UIUtilities",
41399
+ "UIKitEnums",
41376
41400
  "UIKitCore",
41377
41401
  "PeachICU",
41378
41402
  "PeachCMark",
@@ -41488,33 +41512,14 @@ var swift_distribution_lock_default = {
41488
41512
  "PeachBox2D"
41489
41513
  ],
41490
41514
  systemEnvironment: {
41491
- scenePhase: [
41492
- "string:active",
41493
- "string:inactive",
41494
- "string:background"
41495
- ],
41496
- deviceModel: [
41497
- "string"
41498
- ],
41499
- systemName: [
41500
- "string"
41501
- ],
41502
- systemVersion: [
41503
- "string"
41504
- ],
41505
- colorScheme: [
41506
- "string:light",
41507
- "string:dark"
41508
- ],
41509
- semanticColors: [
41510
- "object"
41511
- ],
41512
- imageAssets: [
41513
- "object"
41514
- ],
41515
- locale: [
41516
- "string"
41517
- ],
41515
+ scenePhase: ["string:active", "string:inactive", "string:background"],
41516
+ deviceModel: ["string"],
41517
+ systemName: ["string"],
41518
+ systemVersion: ["string"],
41519
+ colorScheme: ["string:light", "string:dark"],
41520
+ semanticColors: ["object"],
41521
+ imageAssets: ["object"],
41522
+ locale: ["string"],
41518
41523
  dynamicTypeSize: [
41519
41524
  "string:xSmall",
41520
41525
  "string:small",
@@ -41529,30 +41534,22 @@ var swift_distribution_lock_default = {
41529
41534
  "string:accessibility4",
41530
41535
  "string:accessibility5"
41531
41536
  ],
41532
- horizontalSizeClass: [
41533
- "string:compact",
41534
- "string:regular"
41535
- ],
41536
- verticalSizeClass: [
41537
- "string:compact",
41538
- "string:regular"
41539
- ],
41540
- accessibilityReduceMotion: [
41541
- "bool"
41542
- ]
41537
+ horizontalSizeClass: ["string:compact", "string:regular"],
41538
+ verticalSizeClass: ["string:compact", "string:regular"],
41539
+ accessibilityReduceMotion: ["bool"]
41543
41540
  },
41544
41541
  hosts: {
41545
41542
  "darwin-arm64": {
41546
- sha256: "278cf5301795dd1e9f0f044bdb4e079b45ab4eb72a6e72331b06916115e34902",
41547
- size: 71532233
41543
+ sha256: "8679052c4c2b21ad748a8db40cdbc0c91ab14a29fc06bbed777efb57030c01fa",
41544
+ size: 70963039
41548
41545
  },
41549
41546
  "linux-x64": {
41550
- sha256: "920c6fe08ba45930880fee133a3cb85b310d713a4d60404f29d03555d3df879c",
41551
- size: 71538725
41547
+ sha256: "a1719d844e2f45e8c9a2ccb9dbe7857978918639a3933c225a328d84cae235cf",
41548
+ size: 70968746
41552
41549
  },
41553
41550
  "linux-arm64": {
41554
- sha256: "d3a3421e0c80cc698869bc39dd538d42b0e053db02526d3f5f22acf8e7c6dca9",
41555
- size: 71536749
41551
+ sha256: "3da8f2c920e65c633b5310c778b4a5c54b0f5f8278d58fd109f3db4310794c04",
41552
+ size: 70967077
41556
41553
  }
41557
41554
  }
41558
41555
  };
@@ -50506,6 +50503,8 @@ var import_https = __toESM(require("https"), 1);
50506
50503
  var import_node_http2 = require("node:http2");
50507
50504
  var import_promises5 = require("stream/promises");
50508
50505
  init_backend_origin();
50506
+ init_bundleGlobalFooter();
50507
+ init_cli_runtime();
50509
50508
  init_packageVersionsContract();
50510
50509
 
50511
50510
  // src/host/dev-server-package-versions.ts
@@ -53834,6 +53833,10 @@ async function handleFetchProxyRequest(req, res) {
53834
53833
  if (packageVersions)
53835
53834
  res.setHeader(PACKAGE_VERSIONS_HEADER, JSON.stringify(packageVersions));
53836
53835
  }
53836
+ if (isBundleProxyRequestUrl(req.url) && req.method === "GET" && upstream.statusCode === 200 && upstreamUrl.pathname.endsWith(".bundle") && upstream.headers["x-peach-rolldown-inventory"] !== "1") {
53837
+ res.setHeader(ROLLDOWN_INVENTORY_HEADER, "1");
53838
+ res.removeHeader("content-length");
53839
+ }
53837
53840
  applyFetchProxyCors(req, res);
53838
53841
  if (setCookies.length > 0)
53839
53842
  res.setHeader("x-sootsim-set-cookie", setCookies.join(", "));
@@ -53997,6 +54000,21 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
53997
54000
  if (redirects > 0) res.setHeader(FETCH_PROXY_RESPONSE_URL_HEADER, targetUrl.href);
53998
54001
  await route.respond(proxyRes, hopCookies);
53999
54002
  res.statusCode = status;
54003
+ if (isBundleProxyRequestUrl(req.url) && method === "GET" && status === 200 && targetUrl.pathname.endsWith(".bundle") && proxyRes.headers["x-peach-rolldown-inventory"] !== "1") {
54004
+ const chunks = [];
54005
+ for await (const chunk of proxyRes) {
54006
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
54007
+ }
54008
+ const payload = Buffer.concat(chunks).toString("utf8");
54009
+ const contentType2 = typeof proxyRes.headers["content-type"] === "string" ? proxyRes.headers["content-type"] : void 0;
54010
+ const annotated = await getCliRuntime().rolldown_bundle_inventory.attachRolldownBundleHttpPayload(
54011
+ payload,
54012
+ contentType2
54013
+ );
54014
+ res.removeHeader("content-length");
54015
+ res.end(Buffer.from(annotated, "utf8"));
54016
+ return;
54017
+ }
54000
54018
  await (0, import_promises5.pipeline)(proxyRes, res);
54001
54019
  };
54002
54020
  let body;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
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;
@@ -76,16 +76,142 @@ function loopbackOriginOf(value) {
76
76
  }
77
77
  }
78
78
 
79
+ // src/bundleGlobalFooter.ts
80
+ var ROLLDOWN_INVENTORY_HEADER = "X-Peach-Rolldown-Inventory";
81
+
82
+ // src/cli-runtime.ts
83
+ var import_node_crypto = require("node:crypto");
84
+ var import_node_fs2 = require("node:fs");
85
+ var import_node_module = require("node:module");
86
+ var import_node_path2 = require("node:path");
87
+
88
+ // runtime-companion.json
89
+ var runtime_companion_default = { abi: 1, sha256: "a1b49c57129dd06888a9cdfbb05051be3626e8233980236705a3efd52b651623", file: "node/cli-a1b49c57129dd06888a9cdfbb05051be3626e8233980236705a3efd52b651623.cjs" };
90
+
91
+ // src/runtime-assets.ts
92
+ var import_fs = __toESM(require("fs"), 1);
93
+ var import_path = __toESM(require("path"), 1);
94
+ var import_url = require("url");
95
+
96
+ // src/home-paths.ts
97
+ var import_node_fs = __toESM(require("node:fs"), 1);
98
+ var import_node_os = require("node:os");
99
+ var import_node_path = __toESM(require("node:path"), 1);
100
+ var PEACH_HOME_ENV = "PEACH_HOME";
101
+ var ACTIVE_RUNTIME_FILE = "active";
102
+ function rnxHomeDir() {
103
+ const override = process.env[PEACH_HOME_ENV];
104
+ if (override && override.length > 0) return import_node_path.default.resolve(override);
105
+ return import_node_path.default.join((0, import_node_os.homedir)(), ".peach");
106
+ }
107
+ function runtimesDir() {
108
+ return import_node_path.default.join(rnxHomeDir(), "runtimes");
109
+ }
110
+ function runtimeDir(version) {
111
+ return import_node_path.default.join(runtimesDir(), version);
112
+ }
113
+ function activeRuntimeFile() {
114
+ return import_node_path.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
115
+ }
116
+ function readActiveRuntime() {
117
+ try {
118
+ const value = import_node_fs.default.readFileSync(activeRuntimeFile(), "utf8").trim();
119
+ return value.length > 0 ? value : null;
120
+ } catch {
121
+ return null;
122
+ }
123
+ }
124
+ var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
125
+
126
+ // src/runtime-assets.ts
127
+ var _monorepoRootCache;
128
+ function findMonorepoRoot() {
129
+ if (_monorepoRootCache !== void 0) return _monorepoRootCache;
130
+ let dir = import_path.default.dirname((0, import_url.fileURLToPath)(__sootsim_import_meta_url));
131
+ for (let i = 0; i < 12 && dir !== import_path.default.dirname(dir); i++) {
132
+ if (import_fs.default.existsSync(import_path.default.join(dir, "packages/peach-engine/package.json")) && import_fs.default.existsSync(import_path.default.join(dir, "public/sootsim"))) {
133
+ _monorepoRootCache = dir;
134
+ return dir;
135
+ }
136
+ dir = import_path.default.dirname(dir);
137
+ }
138
+ _monorepoRootCache = null;
139
+ return null;
140
+ }
141
+ function resolveDevCheckoutRuntimeAssetRoot() {
142
+ if (process.env.PEACH_HOME && readActiveRuntime()) return null;
143
+ const root = findMonorepoRoot();
144
+ if (!root) return null;
145
+ return import_path.default.join(root, "public/sootsim");
146
+ }
147
+ function resolveDevCheckoutRuntimeRoot() {
148
+ const devBuild = resolveDevCheckoutRuntimeAssetRoot();
149
+ if (!devBuild) return null;
150
+ if (import_fs.default.existsSync(import_path.default.join(devBuild, "index.html")) && import_fs.default.existsSync(import_path.default.join(devBuild, "engine/index.html")) && import_fs.default.existsSync(import_path.default.join(devBuild, "engine-tenant/worker.js")) && import_fs.default.existsSync(import_path.default.join(devBuild, "engine-tenant/worker.prod.js"))) {
151
+ return devBuild;
152
+ }
153
+ return null;
154
+ }
155
+ function resolveActiveRuntimeRoot() {
156
+ const devRoot = resolveDevCheckoutRuntimeRoot();
157
+ if (devRoot) return devRoot;
158
+ const active = readActiveRuntime();
159
+ if (!active) return null;
160
+ const dir = runtimeDir(active);
161
+ if (!import_fs.default.existsSync(import_path.default.join(dir, "index.html"))) return null;
162
+ return dir;
163
+ }
164
+
165
+ // src/cli-runtime.ts
166
+ var CLI_COMPANION_ABI = 1;
167
+ function cliCompanionPath() {
168
+ return `node/cli-${runtime_companion_default.sha256}.cjs`;
169
+ }
170
+ function verifyCliCompanion(root) {
171
+ const file = (0, import_node_path2.join)(root, cliCompanionPath());
172
+ let bytes;
173
+ try {
174
+ bytes = (0, import_node_fs2.readFileSync)(file);
175
+ } catch (cause) {
176
+ throw new Error(
177
+ "Peach runtime is missing the companion required by this CLI; run `peach runtime install`",
178
+ { cause }
179
+ );
180
+ }
181
+ const hash = (0, import_node_crypto.createHash)("sha256").update(bytes).digest("hex");
182
+ if (hash !== runtime_companion_default.sha256) {
183
+ throw new Error(
184
+ "Peach runtime companion does not match this CLI; run `peach runtime install`"
185
+ );
186
+ }
187
+ }
188
+ var loaded;
189
+ function getCliRuntime() {
190
+ if (loaded) return loaded.runtime;
191
+ const root = resolveDevCheckoutRuntimeAssetRoot() ?? resolveActiveRuntimeRoot();
192
+ if (!root) throw new Error("No Peach runtime installed; run `peach runtime install`");
193
+ verifyCliCompanion(root);
194
+ const require2 = (0, import_node_module.createRequire)(__sootsim_import_meta_url);
195
+ const runtime = require2((0, import_node_path2.join)(root, cliCompanionPath()));
196
+ if (runtime.cliCompanionAbi !== CLI_COMPANION_ABI) {
197
+ throw new Error(
198
+ "Incompatible Peach runtime companion ABI; run `peach runtime install`"
199
+ );
200
+ }
201
+ loaded = { root, runtime };
202
+ return runtime;
203
+ }
204
+
79
205
  // src/packageVersionsContract.ts
80
206
  var PACKAGE_VERSIONS_HEADER = "X-Peach-Package-Versions";
81
207
 
82
208
  // src/host/dev-server-package-versions.ts
83
- var import_fs2 = __toESM(require("fs"), 1);
84
- var import_path2 = __toESM(require("path"), 1);
209
+ var import_fs3 = __toESM(require("fs"), 1);
210
+ var import_path3 = __toESM(require("path"), 1);
85
211
 
86
212
  // src/installed-package-versions.ts
87
- var import_fs = __toESM(require("fs"), 1);
88
- var import_path = __toESM(require("path"), 1);
213
+ var import_fs2 = __toESM(require("fs"), 1);
214
+ var import_path2 = __toESM(require("path"), 1);
89
215
 
90
216
  // ../peach-compat/src/lazy-stub-patterns.ts
91
217
  var LAZY_STUB_PATTERNS = [
@@ -2973,13 +3099,13 @@ function isMissing(error) {
2973
3099
  }
2974
3100
  async function answerAsync(step) {
2975
3101
  if (step.op === "exists")
2976
- return import_fs.default.promises.access(step.path).then(
3102
+ return import_fs2.default.promises.access(step.path).then(
2977
3103
  () => true,
2978
3104
  () => false
2979
3105
  );
2980
- if (step.op === "realpath") return import_fs.default.promises.realpath(step.path);
3106
+ if (step.op === "realpath") return import_fs2.default.promises.realpath(step.path);
2981
3107
  try {
2982
- return parseManifest(await import_fs.default.promises.readFile(step.path, "utf8"));
3108
+ return parseManifest(await import_fs2.default.promises.readFile(step.path, "utf8"));
2983
3109
  } catch (error) {
2984
3110
  if (isMissing(error)) return null;
2985
3111
  throw error;
@@ -2996,25 +3122,25 @@ function createInstalledPackageReader() {
2996
3122
  const manifests = /* @__PURE__ */ new Map();
2997
3123
  return function* readInstalledPackage(fromDir, name) {
2998
3124
  for (let dir = fromDir; ; ) {
2999
- if (import_path.default.basename(dir) !== "node_modules") {
3000
- const modules = import_path.default.join(dir, "node_modules");
3125
+ if (import_path2.default.basename(dir) !== "node_modules") {
3126
+ const modules = import_path2.default.join(dir, "node_modules");
3001
3127
  let present = hasModules.get(dir);
3002
3128
  if (present === void 0) {
3003
3129
  present = yield* exists(modules);
3004
3130
  hasModules.set(dir, present);
3005
3131
  }
3006
3132
  if (present) {
3007
- const root = import_path.default.join(modules, name);
3133
+ const root = import_path2.default.join(modules, name);
3008
3134
  let installed = manifests.get(root);
3009
3135
  if (installed === void 0) {
3010
- const manifest = yield* readManifest(import_path.default.join(root, "package.json"));
3136
+ const manifest = yield* readManifest(import_path2.default.join(root, "package.json"));
3011
3137
  installed = manifest ? { root, manifest } : null;
3012
3138
  manifests.set(root, installed);
3013
3139
  }
3014
3140
  if (installed) return installed;
3015
3141
  }
3016
3142
  }
3017
- const parent = import_path.default.dirname(dir);
3143
+ const parent = import_path2.default.dirname(dir);
3018
3144
  if (parent === dir) return null;
3019
3145
  dir = parent;
3020
3146
  }
@@ -3042,7 +3168,7 @@ function* nativePackageVersionsWalk(projectRoot) {
3042
3168
  const name = extractPackageFromPath(`node_modules/${specifier}`);
3043
3169
  if (name) nativeNames.add(name);
3044
3170
  }
3045
- const manifest = yield* readManifest(import_path.default.join(appRoot, "package.json"));
3171
+ const manifest = yield* readManifest(import_path2.default.join(appRoot, "package.json"));
3046
3172
  if (!manifest) throw new Error("app package.json must contain an object");
3047
3173
  const readInstalledPackage = createInstalledPackageReader();
3048
3174
  const pending = [{ root: appRoot, manifest }];
@@ -3080,9 +3206,9 @@ function readInstalledNativePackageVersionsAsync(projectRoot) {
3080
3206
  // scripts/dev-server-scanner.ts
3081
3207
  var import_child_process = require("child_process");
3082
3208
  var import_promises = require("fs/promises");
3083
- var import_node_fs = require("node:fs");
3084
- var import_node_os = require("node:os");
3085
- var import_node_path = require("node:path");
3209
+ var import_node_fs3 = require("node:fs");
3210
+ var import_node_os2 = require("node:os");
3211
+ var import_node_path3 = require("node:path");
3086
3212
 
3087
3213
  // src/expo-manifest-body.ts
3088
3214
  function parseExpoManifestBody(body) {
@@ -3103,8 +3229,8 @@ var MANIFEST_PROBE_TIMEOUT_MS = 3e4;
3103
3229
  var import_plist = __toESM(require("plist"), 1);
3104
3230
 
3105
3231
  // scripts/dev-server-scanner.ts
3106
- var LISTENER_LOCK_PATH = (0, import_node_path.join)((0, import_node_os.tmpdir)(), "peach-listener-scan.lock");
3107
- var LISTENER_RESULT_PATH = (0, import_node_path.join)((0, import_node_os.tmpdir)(), "peach-listener-scan.result");
3232
+ var LISTENER_LOCK_PATH = (0, import_node_path3.join)((0, import_node_os2.tmpdir)(), "peach-listener-scan.lock");
3233
+ var LISTENER_RESULT_PATH = (0, import_node_path3.join)((0, import_node_os2.tmpdir)(), "peach-listener-scan.result");
3108
3234
  var LISTENER_LOCK_STALE_MS = 25e3;
3109
3235
  var LISTENER_LOCK_WAIT_MS = 8e3;
3110
3236
  function sleep(ms) {
@@ -3122,8 +3248,8 @@ function pidIsAlive(pid) {
3122
3248
  }
3123
3249
  function readLockOwner() {
3124
3250
  try {
3125
- const raw = (0, import_node_fs.readFileSync)(LISTENER_LOCK_PATH, "utf8");
3126
- const mtimeMs = (0, import_node_fs.statSync)(LISTENER_LOCK_PATH).mtimeMs;
3251
+ const raw = (0, import_node_fs3.readFileSync)(LISTENER_LOCK_PATH, "utf8");
3252
+ const mtimeMs = (0, import_node_fs3.statSync)(LISTENER_LOCK_PATH).mtimeMs;
3127
3253
  const pid = Number(raw.split("-")[0]);
3128
3254
  return { raw, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
3129
3255
  } catch {
@@ -3136,15 +3262,15 @@ function lockIsAbandoned(owner) {
3136
3262
  }
3137
3263
  function clearLock(raw) {
3138
3264
  try {
3139
- if ((0, import_node_fs.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
3140
- (0, import_node_fs.unlinkSync)(LISTENER_LOCK_PATH);
3265
+ if ((0, import_node_fs3.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
3266
+ (0, import_node_fs3.unlinkSync)(LISTENER_LOCK_PATH);
3141
3267
  } catch {
3142
3268
  }
3143
3269
  }
3144
3270
  function readResult() {
3145
3271
  try {
3146
3272
  const parsed = JSON.parse(
3147
- (0, import_node_fs.readFileSync)(LISTENER_RESULT_PATH, "utf8")
3273
+ (0, import_node_fs3.readFileSync)(LISTENER_RESULT_PATH, "utf8")
3148
3274
  );
3149
3275
  if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
3150
3276
  return null;
@@ -3155,8 +3281,8 @@ function readResult() {
3155
3281
  }
3156
3282
  function publishResult(payload) {
3157
3283
  const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
3158
- (0, import_node_fs.writeFileSync)(tmp, JSON.stringify(payload));
3159
- (0, import_node_fs.renameSync)(tmp, LISTENER_RESULT_PATH);
3284
+ (0, import_node_fs3.writeFileSync)(tmp, JSON.stringify(payload));
3285
+ (0, import_node_fs3.renameSync)(tmp, LISTENER_RESULT_PATH);
3160
3286
  }
3161
3287
  function throwPublished(payload) {
3162
3288
  throw Object.assign(new Error(payload.message || "listener scan failed"), {
@@ -3199,7 +3325,7 @@ async function withListenerLock(key, body) {
3199
3325
  for (; ; ) {
3200
3326
  let fd = null;
3201
3327
  try {
3202
- fd = (0, import_node_fs.openSync)(LISTENER_LOCK_PATH, "wx");
3328
+ fd = (0, import_node_fs3.openSync)(LISTENER_LOCK_PATH, "wx");
3203
3329
  } catch (error) {
3204
3330
  const code = error instanceof Error && "code" in error ? error.code : "";
3205
3331
  if (code !== "EEXIST") throw error;
@@ -3208,7 +3334,7 @@ async function withListenerLock(key, body) {
3208
3334
  if (owner) clearLock(owner.raw);
3209
3335
  else {
3210
3336
  try {
3211
- (0, import_node_fs.unlinkSync)(LISTENER_LOCK_PATH);
3337
+ (0, import_node_fs3.unlinkSync)(LISTENER_LOCK_PATH);
3212
3338
  } catch {
3213
3339
  }
3214
3340
  }
@@ -3224,7 +3350,7 @@ async function withListenerLock(key, body) {
3224
3350
  }
3225
3351
  if (fd === null) continue;
3226
3352
  try {
3227
- (0, import_node_fs.writeSync)(fd, token);
3353
+ (0, import_node_fs3.writeSync)(fd, token);
3228
3354
  try {
3229
3355
  const value = await body();
3230
3356
  publishResult({ token, key, ok: true, value });
@@ -3241,7 +3367,7 @@ async function withListenerLock(key, body) {
3241
3367
  }
3242
3368
  } finally {
3243
3369
  try {
3244
- (0, import_node_fs.closeSync)(fd);
3370
+ (0, import_node_fs3.closeSync)(fd);
3245
3371
  } catch {
3246
3372
  }
3247
3373
  clearLock(token);
@@ -3589,7 +3715,7 @@ async function readDevServerPackageVersions(bundleUrl) {
3589
3715
  const projectRoot = await resolveMetroProjectRoot(bundleUrl.href);
3590
3716
  if (!projectRoot) return null;
3591
3717
  try {
3592
- await import_fs2.default.promises.access(import_path2.default.join(projectRoot, "package.json"));
3718
+ await import_fs3.default.promises.access(import_path3.default.join(projectRoot, "package.json"));
3593
3719
  } catch {
3594
3720
  return null;
3595
3721
  }
@@ -3857,6 +3983,10 @@ async function handleFetchProxyRequest(req, res) {
3857
3983
  if (packageVersions)
3858
3984
  res.setHeader(PACKAGE_VERSIONS_HEADER, JSON.stringify(packageVersions));
3859
3985
  }
3986
+ if (isBundleProxyRequestUrl(req.url) && req.method === "GET" && upstream.statusCode === 200 && upstreamUrl.pathname.endsWith(".bundle") && upstream.headers["x-peach-rolldown-inventory"] !== "1") {
3987
+ res.setHeader(ROLLDOWN_INVENTORY_HEADER, "1");
3988
+ res.removeHeader("content-length");
3989
+ }
3860
3990
  applyFetchProxyCors(req, res);
3861
3991
  if (setCookies.length > 0)
3862
3992
  res.setHeader("x-sootsim-set-cookie", setCookies.join(", "));
@@ -4020,6 +4150,21 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
4020
4150
  if (redirects > 0) res.setHeader(FETCH_PROXY_RESPONSE_URL_HEADER, targetUrl.href);
4021
4151
  await route.respond(proxyRes, hopCookies);
4022
4152
  res.statusCode = status;
4153
+ if (isBundleProxyRequestUrl(req.url) && method === "GET" && status === 200 && targetUrl.pathname.endsWith(".bundle") && proxyRes.headers["x-peach-rolldown-inventory"] !== "1") {
4154
+ const chunks = [];
4155
+ for await (const chunk of proxyRes) {
4156
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
4157
+ }
4158
+ const payload = Buffer.concat(chunks).toString("utf8");
4159
+ const contentType = typeof proxyRes.headers["content-type"] === "string" ? proxyRes.headers["content-type"] : void 0;
4160
+ const annotated = await getCliRuntime().rolldown_bundle_inventory.attachRolldownBundleHttpPayload(
4161
+ payload,
4162
+ contentType
4163
+ );
4164
+ res.removeHeader("content-length");
4165
+ res.end(Buffer.from(annotated, "utf8"));
4166
+ return;
4167
+ }
4023
4168
  await (0, import_promises2.pipeline)(proxyRes, res);
4024
4169
  };
4025
4170
  let body;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/host/fetch-proxy-overrides.ts
4
4
  var FETCH_PROXY_NATIVE_USER_AGENT_HEADER = "x-sootsim-native-user-agent";
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1653 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
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;