peachsim 0.1.1620 → 0.1.1635

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 (185) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +45 -6
  3. package/cli/app-config.ts +4 -1
  4. package/cli/app-fonts.ts +39 -18
  5. package/cli/app-stubs.ts +224 -9
  6. package/cli/bridge-flow-runner.ts +248 -156
  7. package/cli/cloud-client.ts +68 -57
  8. package/cli/command-registry.ts +1 -0
  9. package/cli/commands/box/search-command.ts +3 -2
  10. package/cli/commands/box.ts +10 -29
  11. package/cli/commands/control.ts +391 -92
  12. package/cli/commands/doctor.ts +17 -184
  13. package/cli/commands/flow.ts +79 -11
  14. package/cli/commands/inspect/core.ts +10 -5
  15. package/cli/commands/inspect/settling.ts +71 -22
  16. package/cli/commands/inspect/wait-ready.ts +12 -0
  17. package/cli/commands/inspect.ts +26 -3
  18. package/cli/commands/install-desktop.ts +1 -0
  19. package/cli/commands/maestro-compare.ts +105 -67
  20. package/cli/commands/maestro.ts +9 -1
  21. package/cli/commands/platform.ts +71 -36
  22. package/cli/commands/record.ts +21 -1
  23. package/cli/commands/screenshot.ts +23 -1
  24. package/cli/commands/serve.ts +7 -2
  25. package/cli/commands/setup.ts +19 -42
  26. package/cli/commands/swift.ts +5 -0
  27. package/cli/commands/upload.ts +51 -8
  28. package/cli/desktop-companion.ts +102 -17
  29. package/cli/dev-build-freshness.ts +37 -2
  30. package/cli/drivers/desktop.ts +14 -1
  31. package/cli/drivers/playwright-sim-host.ts +44 -8
  32. package/cli/drivers/playwright.ts +9 -8
  33. package/cli/drivers/types.ts +5 -0
  34. package/cli/maestro-accessibility.ts +53 -0
  35. package/cli/maestro-compare.ts +108 -12
  36. package/cli/main.ts +2 -1
  37. package/cli/outbound-endpoints.ts +35 -6
  38. package/cli/parent-pid.ts +0 -9
  39. package/cli/pause-aware-timeout.ts +102 -0
  40. package/cli/remote-simulators.ts +112 -0
  41. package/cli/remoteSimulatorContract.ts +21 -0
  42. package/cli/scene-video.ts +89 -0
  43. package/cli/ws-bridge.ts +23 -14
  44. package/detox/attempt-events.cjs +4 -0
  45. package/detox/expectations.ts +5 -1
  46. package/detox/index.ts +241 -181
  47. package/detox/motion-change.cjs +73 -0
  48. package/detox/motion-change.d.cts +21 -0
  49. package/detox/navigation-lifecycle.ts +22 -4
  50. package/dist-lib/agent-daemon-client.cjs +3 -2
  51. package/dist-lib/agent-events.cjs +1 -1
  52. package/dist-lib/attached-projects.cjs +1 -1
  53. package/dist-lib/auth/shared-session.cjs +3 -2
  54. package/dist-lib/backend-origin.cjs +1 -1
  55. package/dist-lib/beta.cjs +1 -1
  56. package/dist-lib/beta.mjs +1 -1
  57. package/dist-lib/bridge-constants.cjs +13 -1
  58. package/dist-lib/bridge-contract-input.cjs +1 -1
  59. package/dist-lib/bridge-contract-input.mjs +1 -1
  60. package/dist-lib/bridge-contract.cjs +14 -8
  61. package/dist-lib/bridge-contract.mjs +13 -7
  62. package/dist-lib/bundle-channel.cjs +10480 -7962
  63. package/dist-lib/capture-contract.cjs +1 -1
  64. package/dist-lib/capture-contract.mjs +1 -1
  65. package/dist-lib/cloud-contract.cjs +1 -1
  66. package/dist-lib/cloud-contract.mjs +1 -1
  67. package/dist-lib/cloud-test-args.cjs +1 -1
  68. package/dist-lib/cloud-test-args.mjs +1 -1
  69. package/dist-lib/cloud.cjs +3 -2
  70. package/dist-lib/cloud.mjs +3 -2
  71. package/dist-lib/config.cjs +10 -6
  72. package/dist-lib/config.mjs +10 -6
  73. package/dist-lib/detox/index.cjs +1854 -966
  74. package/dist-lib/dev-bundle-resolution.cjs +64 -24
  75. package/dist-lib/expo-swift-bundle.cjs +8715 -6271
  76. package/dist-lib/expo-swift-metadata.cjs +7 -4
  77. package/dist-lib/expo-swift-metadata.mjs +7 -4
  78. package/dist-lib/home-paths.cjs +32 -3
  79. package/dist-lib/host/bridge-host.cjs +10135 -7060
  80. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  81. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  82. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  83. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  84. package/dist-lib/host/websocket-proxy.cjs +1 -1
  85. package/dist-lib/index.cjs +1843 -408
  86. package/dist-lib/jump-to-source-babel.cjs +1 -1
  87. package/dist-lib/jump-to-source-native.cjs +1 -1
  88. package/dist-lib/kotlin-host.cjs +1 -1
  89. package/dist-lib/menu.cjs +3 -2
  90. package/dist-lib/menu.mjs +3 -2
  91. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  92. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  93. package/dist-lib/metro-production-bundle.cjs +5 -4
  94. package/dist-lib/metro-production-bundle.mjs +5 -4
  95. package/dist-lib/metro.cjs +1182 -418
  96. package/dist-lib/native-app-identity-project.cjs +782 -23
  97. package/dist-lib/native-app-identity-project.mjs +781 -23
  98. package/dist-lib/native-app-identity.cjs +276 -9
  99. package/dist-lib/native-app-identity.mjs +273 -8
  100. package/dist-lib/native-firebase-metadata.cjs +5 -4
  101. package/dist-lib/native-firebase-metadata.mjs +5 -4
  102. package/dist-lib/plist.cjs +1 -1
  103. package/dist-lib/plist.mjs +1 -1
  104. package/dist-lib/profiles.cjs +1 -1
  105. package/dist-lib/public-brand.cjs +3 -2
  106. package/dist-lib/react-native-host-modules.cjs +8 -1
  107. package/dist-lib/react-native-host-modules.mjs +8 -1
  108. package/dist-lib/scripts/dev-server-scanner.cjs +106 -28
  109. package/dist-lib/sdk.cjs +115 -34
  110. package/dist-lib/sdk.mjs +115 -33
  111. package/dist-lib/skills.cjs +15274 -9904
  112. package/dist-lib/swift-compile.cjs +1165 -173
  113. package/dist-lib/swift-compile.mjs +1212 -203
  114. package/dist-lib/swift-package.cjs +12 -3
  115. package/dist-lib/swift-package.mjs +12 -3
  116. package/dist-lib/swift-submit.cjs +7 -1
  117. package/dist-lib/swift-submit.mjs +5 -1
  118. package/dist-lib/swift-toolchain.cjs +133 -18
  119. package/dist-lib/swift.cjs +1 -1
  120. package/dist-lib/vite-swift.cjs +2648 -862
  121. package/dist-lib/vite.cjs +70 -14
  122. package/dist-lib/worklet-executable.cjs +25 -2
  123. package/dist-lib/worklet-executable.mjs +25 -2
  124. package/kotlin/AppSources/dev/peach/app/PeachDrawable.kt +21 -14
  125. package/kotlin/Sources/androidx/annotation/DrawableRes.kt +14 -0
  126. package/package.json +2 -2
  127. package/scripts/dev-server-scanner.ts +35 -14
  128. package/skills/peach-perf/SKILL.md +11 -5
  129. package/skills/peach-setup/SKILL.md +16 -19
  130. package/src/admitted-mac-build.ts +34 -8
  131. package/src/android-app-identity.ts +146 -0
  132. package/src/android-autolinking.ts +75 -0
  133. package/src/android-string-value.ts +36 -0
  134. package/src/android-strings.ts +5 -36
  135. package/src/androidAutolinkingContract.ts +40 -0
  136. package/src/bridge-constants.ts +11 -0
  137. package/src/bridge-contract.ts +22 -34
  138. package/src/bundleGlobalFooter.ts +26 -7
  139. package/src/codex-client.ts +3 -2
  140. package/src/config.ts +15 -0
  141. package/src/desktop-host-delivery.ts +5 -1
  142. package/src/dev-bundle-resolution.ts +60 -26
  143. package/src/expo-kotlin-host.ts +6 -36
  144. package/src/expo-manifest-body.ts +13 -0
  145. package/src/expo-swift-bundle.ts +17 -12
  146. package/src/expo-swift-host.ts +640 -192
  147. package/src/expo-swift-ready.ts +78 -0
  148. package/src/expoSwiftContract.ts +19 -0
  149. package/src/home-paths.ts +48 -2
  150. package/src/host/bridge-host.ts +12 -57
  151. package/src/host/staged-host-files.ts +29 -2
  152. package/src/installed-package-versions.ts +54 -14
  153. package/src/launchMetadataContract.ts +24 -0
  154. package/src/metro-plugin.ts +37 -42
  155. package/src/native-app-identity-project.ts +142 -5
  156. package/src/native-app-identity.ts +176 -11
  157. package/src/native-firebase-config.ts +209 -13
  158. package/src/nitro-compile.ts +2 -5
  159. package/src/nitro-source.ts +147 -63
  160. package/src/process-group.ts +114 -61
  161. package/src/process-output.ts +0 -9
  162. package/src/public-brand.ts +1 -0
  163. package/src/react-native-bridge-modules.ts +416 -0
  164. package/src/react-native-host-modules.ts +7 -0
  165. package/src/sim-client.ts +6 -4
  166. package/src/swift-binary-modules.ts +2 -2
  167. package/src/swift-compile.ts +1007 -108
  168. package/src/swift-compiler-digest.ts +14 -0
  169. package/src/swift-distribution.lock.json +40 -12
  170. package/src/swift-distribution.ts +61 -9
  171. package/src/swift-host.ts +149 -56
  172. package/src/swift-icu.ts +14 -6
  173. package/src/swift-objc-sdk.ts +133 -10
  174. package/src/swift-objc-standin.ts +38 -3
  175. package/src/swift-package-manifest.ts +21 -6
  176. package/src/swift-package.ts +15 -1
  177. package/src/swift-packages.ts +119 -60
  178. package/src/swift-standin-emit.ts +57 -9
  179. package/src/swift-standins.ts +185 -25
  180. package/src/swift-submit.ts +10 -0
  181. package/src/swift-toolchain.ts +149 -23
  182. package/src/vite-plugin.ts +20 -20
  183. package/src/worklet-executable.ts +30 -3
  184. package/src/worklets-babel.ts +35 -14
  185. package/src/xcode-project.ts +10 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1620 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1635 | (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;
@@ -24,6 +24,7 @@ var dev_bundle_resolution_exports = {};
24
24
  __export(dev_bundle_resolution_exports, {
25
25
  DEFAULT_TEST_DRIVE_PORT: () => DEFAULT_TEST_DRIVE_PORT,
26
26
  MANIFEST_PROBE_TIMEOUT_MS: () => MANIFEST_PROBE_TIMEOUT_MS,
27
+ fetchDevManifest: () => fetchDevManifest,
27
28
  inferManifestFramework: () => inferManifestFramework,
28
29
  probePortBundle: () => probePortBundle,
29
30
  resolveConnectionInput: () => resolveConnectionInput
@@ -45,6 +46,18 @@ function isLoopbackHost(hostname) {
45
46
  return normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "0.0.0.0" || normalized === "::1" || /^127(?:\.\d{1,3}){3}$/.test(normalized);
46
47
  }
47
48
 
49
+ // src/expo-manifest-body.ts
50
+ function parseExpoManifestBody(body) {
51
+ const opening = /^(--[^\r\n]+)\r?\n/.exec(body);
52
+ if (!opening) return JSON.parse(body);
53
+ for (const part of body.split(opening[1])) {
54
+ const headerEnd = part.search(/\r?\n\r?\n/);
55
+ if (headerEnd < 0 || !/\bname="manifest"/.test(part.slice(0, headerEnd))) continue;
56
+ return JSON.parse(part.slice(headerEnd).trim());
57
+ }
58
+ throw new Error("Expo manifest response has no manifest part");
59
+ }
60
+
48
61
  // src/native-dev-bundle-url.ts
49
62
  var METRO_BUNDLE_PATH = "/index.bundle?platform=ios&dev=true&hot=true&minify=false";
50
63
  function isAbsoluteHttpUrl(url) {
@@ -160,40 +173,54 @@ async function resolvePortViaServerScan(port) {
160
173
  }
161
174
  }
162
175
  var MANIFEST_PROBE_TIMEOUT_MS = 3e4;
163
- async function probeExpoManifest(normalizedBaseUrl, port) {
164
- let body;
176
+ var manifestRequests = /* @__PURE__ */ new Map();
177
+ async function fetchDevManifest(baseUrl) {
178
+ const normalizedBaseUrl = baseUrl.replace(/\/+$/, "");
179
+ const existing = manifestRequests.get(normalizedBaseUrl);
180
+ if (existing) return (await existing)?.clone();
165
181
  const pending = fetchDevProbe(`${normalizedBaseUrl}/`, {
166
182
  headers: { "expo-platform": "ios" }
167
- }).then(async (res) => ({
168
- status: res.status,
169
- contentType: res.headers.get("content-type") || "",
170
- body: await res.text()
171
- })).catch(() => void 0);
183
+ }).then(async (res) => {
184
+ const body = await res.arrayBuffer();
185
+ return new Response(body.byteLength ? body : null, {
186
+ status: res.status,
187
+ headers: res.headers
188
+ });
189
+ }).catch(() => void 0);
172
190
  let probeDeadline;
173
- const answered = await Promise.race([
191
+ const request = Promise.race([
174
192
  pending,
175
193
  new Promise((resolve) => {
176
194
  probeDeadline = setTimeout(() => resolve("timeout"), MANIFEST_PROBE_TIMEOUT_MS);
177
195
  })
178
- ]);
179
- clearTimeout(probeDeadline);
180
- if (answered === "timeout")
181
- throw new Error(
182
- `Metro manifest request timed out after ${MANIFEST_PROBE_TIMEOUT_MS / 1e3}s: ${normalizedBaseUrl}/. Wait for the dev server to finish starting or check its manifest endpoint.`
183
- );
196
+ ]).then((answered) => {
197
+ if (answered === "timeout")
198
+ throw new Error(
199
+ `Metro manifest request timed out after ${MANIFEST_PROBE_TIMEOUT_MS / 1e3}s: ${normalizedBaseUrl}/. Wait for the dev server to finish starting or check its manifest endpoint.`
200
+ );
201
+ return answered;
202
+ }).finally(() => {
203
+ clearTimeout(probeDeadline);
204
+ manifestRequests.delete(normalizedBaseUrl);
205
+ });
206
+ manifestRequests.set(normalizedBaseUrl, request);
207
+ return (await request)?.clone();
208
+ }
209
+ async function probeExpoManifest(normalizedBaseUrl, port) {
210
+ const answered = await fetchDevManifest(normalizedBaseUrl);
184
211
  if (answered === void 0) return { state: "no-answer" };
185
212
  if (answered.status === 404 || answered.status === 405) return { state: "no-manifest" };
186
213
  if (answered.status < 200 || answered.status >= 300)
187
214
  throw new Error(
188
215
  `Metro manifest request failed: HTTP ${answered.status} at ${normalizedBaseUrl}/`
189
216
  );
190
- body = answered.body;
217
+ const body = await answered.text();
191
218
  if (!body.trim()) return { state: "no-answer" };
192
219
  let manifest;
193
220
  try {
194
- manifest = JSON.parse(body);
221
+ manifest = parseExpoManifestBody(body);
195
222
  } catch {
196
- if (answered.contentType.includes("json"))
223
+ if (answered.headers.get("content-type")?.includes("json"))
197
224
  throw new Error(`Metro returned invalid manifest JSON at ${normalizedBaseUrl}/`);
198
225
  return { state: "no-manifest" };
199
226
  }
@@ -257,12 +284,24 @@ async function probeBaseUrlBundle(baseUrl, port) {
257
284
  async function probePortBundle(port) {
258
285
  const viaScan = await resolvePortViaServerScan(port);
259
286
  if (viaScan) return viaScan;
260
- const candidates = await Promise.all(
261
- LOOPBACK_PROBE_HOSTNAMES.map(
262
- (hostname) => probeBaseUrlBundleDirect(buildLoopbackProbeBaseUrl("http:", hostname, port), port)
263
- )
264
- );
265
- return candidates.find((candidate) => candidate !== null) ?? null;
287
+ const unresolved = buildUnresolvedTargetError(`localhost:${port}`);
288
+ try {
289
+ return await Promise.any(
290
+ LOOPBACK_PROBE_HOSTNAMES.map(async (hostname) => {
291
+ const bundle = await probeBaseUrlBundleDirect(
292
+ buildLoopbackProbeBaseUrl("http:", hostname, port),
293
+ port
294
+ );
295
+ if (!bundle) throw unresolved;
296
+ return bundle;
297
+ })
298
+ );
299
+ } catch (error) {
300
+ if (!(error instanceof AggregateError)) throw error;
301
+ const failure = error.errors.find((candidate) => candidate !== unresolved);
302
+ if (failure !== void 0) throw failure;
303
+ return null;
304
+ }
266
305
  }
267
306
  async function resolveConnectionInput(input) {
268
307
  const trimmed = input.trim();
@@ -295,6 +334,7 @@ async function resolveConnectionInput(input) {
295
334
  0 && (module.exports = {
296
335
  DEFAULT_TEST_DRIVE_PORT,
297
336
  MANIFEST_PROBE_TIMEOUT_MS,
337
+ fetchDevManifest,
298
338
  inferManifestFramework,
299
339
  probePortBundle,
300
340
  resolveConnectionInput