peachsim 0.1.2431 → 0.1.2433

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 (96) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +1 -1
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +91 -75
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +2 -2
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +54 -17
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +91 -75
  31. package/dist-lib/host/fetch-proxy-handler.cjs +5 -4
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +5 -4
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +36 -57
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +5 -4
  47. package/dist-lib/native-app-identity-project.cjs +2 -2
  48. package/dist-lib/native-app-identity-project.mjs +2 -2
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +53 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +95 -80
  68. package/dist-lib/swift-compile.cjs +16 -10
  69. package/dist-lib/swift-compile.mjs +16 -10
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +52 -16
  77. package/dist-lib/vite.cjs +5 -4
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/dist-types/packages/peach-engine/src/engine/image-loader-canvaskit.d.ts +3 -0
  81. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +2 -0
  82. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +3 -2
  83. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -1
  84. package/dist-types/packages/peach-globals/src/cameraInputBridgeContract.d.ts +26 -0
  85. package/dist-types/packages/peach-globals/src/globalsContract.d.ts +2 -0
  86. package/dist-types/packages/peach-globals/src/index.d.ts +1 -0
  87. package/kotlin/README.md +3 -1
  88. package/kotlin/sdk.tar.gz +0 -0
  89. package/package.json +1 -1
  90. package/runtime-companion.json +1 -1
  91. package/src/java-module-abi.ts +11 -28
  92. package/src/kotlin-host.ts +13 -32
  93. package/src/kotlin-toolchain.ts +25 -0
  94. package/src/swift-guest-source-plan.ts +25 -9
  95. package/src/swift-host.ts +28 -5
  96. package/src/swift-xcframework.ts +24 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2431 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2433 | (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;
@@ -13558,6 +13558,17 @@ function swiftPackageLinkage(target) {
13558
13558
  throw new Error(`conflicting SwiftPM library linkage for ${target.id}`);
13559
13559
  return linkage;
13560
13560
  }
13561
+ function linkEdges(targets, id) {
13562
+ const target = targets.get(id);
13563
+ if (!target) throw new Error(`unknown source target ${id}`);
13564
+ return target.dependencies.flatMap((edge) => {
13565
+ if (edge.attributes.length)
13566
+ throw new Error(`unsupported link attributes for ${id} -> ${edge.target}`);
13567
+ const dependency = targets.get(edge.target);
13568
+ if (!dependency) throw new Error(`unknown source target ${edge.target}`);
13569
+ return dependency.productType.startsWith("swiftpm.library.") && swiftPackageLinkage(dependency) === "static" ? linkEdges(targets, edge.target) : [edge];
13570
+ });
13571
+ }
13561
13572
  function guestSourceImages(graph) {
13562
13573
  const targets = new Map(graph.targets.map((target) => [target.id, target]));
13563
13574
  const entry = targets.get(graph.entry);
@@ -13581,17 +13592,14 @@ function guestSourceImages(graph) {
13581
13592
  ownership.set(id, image.id);
13582
13593
  image.members.push(id);
13583
13594
  active.add(id);
13584
- for (const edge of target.dependencies) {
13585
- if (edge.attributes.length)
13586
- throw new Error(`unsupported link attributes for ${id} -> ${edge.target}`);
13595
+ for (const edge of linkEdges(targets, id)) {
13587
13596
  const dependency = targets.get(edge.target);
13588
- if (!dependency) throw new Error(`unknown source target ${edge.target}`);
13589
13597
  const type = dependency.productType;
13590
13598
  let dynamic;
13591
13599
  if (type.startsWith("swiftpm.target.")) {
13592
13600
  if (type !== "swiftpm.target.regular" && type !== "swiftpm.target.binary" && type !== "swiftpm.target.system")
13593
13601
  throw new Error(`unsupported SwiftPM target ${edge.target}`);
13594
- dynamic = false;
13602
+ dynamic = type === "swiftpm.target.binary" && dependency.machOType === "mh_dylib";
13595
13603
  } else if (type.startsWith("swiftpm.library.")) {
13596
13604
  dynamic = swiftPackageLinkage(dependency) === "dynamic";
13597
13605
  } else if (type === "com.apple.product-type.library.static") {
@@ -13726,9 +13734,7 @@ function planGuestSourceLink(graph, images, callers, artifacts, symbols) {
13726
13734
  (flag) => /(?:^|,)-(?:weak|reexport|upward|lazy)(?:[_-]|$)/.test(flag)
13727
13735
  ))
13728
13736
  throw new Error(`unsupported special link flag for ${id}`);
13729
- for (const edge of target.dependencies) {
13730
- if (edge.attributes.length)
13731
- throw new Error(`unsupported link attributes for ${id} -> ${edge.target}`);
13737
+ for (const edge of linkEdges(targets, id)) {
13732
13738
  const dependencyImage = ownerByTarget.get(edge.target);
13733
13739
  if (dependencyImage === void 0)
13734
13740
  throw new Error(`linked target ${edge.target} has no guest image`);
@@ -18996,7 +19002,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
18996
19002
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
18997
19003
  var MULTI_MANIFEST_VERSION = 72;
18998
19004
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
18999
- var compilerSourceDigest = true ? "da253e49615973dfc65a40000574546cbf7dc4c9d44a36295773bd33442d8c1d" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
19005
+ var compilerSourceDigest = true ? "cdc5ec2138bb4a158f783cf86ed87144cd455551e18374805c743783ac04aa46" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
19000
19006
  function swiftArtifactHash(input, release, moduleRoot) {
19001
19007
  const hash = (0, import_node_crypto15.createHash)("sha256");
19002
19008
  hash.update(`swift-compile
@@ -34874,7 +34880,7 @@ function sourceClosureDigest(srcDir, entrypoints, excludedFiles) {
34874
34880
  return hash.digest("hex");
34875
34881
  }
34876
34882
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
34877
- var STANDIN_SOURCE_DIGEST = true ? "3475ca483b1e5005a2c76ec887310c0d0f44c91ea427496b33acbb5bf6188684" : standinSourceDigest();
34883
+ var STANDIN_SOURCE_DIGEST = true ? "edbd6d6714a42d5d22c4d8b74e605e5c897358beb450af3e5605c81299e68531" : standinSourceDigest();
34878
34884
 
34879
34885
  // src/swift-standins.ts
34880
34886
  var import_node_child_process32 = require("node:child_process");
@@ -35049,6 +35055,28 @@ function simulatorNativeLibrary(dir) {
35049
35055
  if (matches.length !== 1) throw new Error(`${dir}: ambiguous simulator library`);
35050
35056
  return matches[0];
35051
35057
  }
35058
+ function isDynamicLibrary(file) {
35059
+ const fd = import_node_fs47.default.openSync(file, "r");
35060
+ try {
35061
+ const read = (offset) => {
35062
+ const bytes = Buffer.alloc(16);
35063
+ import_node_fs47.default.readSync(fd, bytes, 0, 16, offset);
35064
+ return bytes;
35065
+ };
35066
+ let header = read(0);
35067
+ const universal = header.readUInt32BE(0);
35068
+ if (universal === 3405691582 || universal === 3405691583) {
35069
+ const arch = read(8);
35070
+ header = read(
35071
+ universal === 3405691582 ? arch.readUInt32BE(8) : Number(arch.readBigUInt64BE(8))
35072
+ );
35073
+ }
35074
+ const magic = header.readUInt32LE(0);
35075
+ return (magic === 4277009103 || magic === 4277009102) && header.readUInt32LE(12) === 6;
35076
+ } finally {
35077
+ import_node_fs47.default.closeSync(fd);
35078
+ }
35079
+ }
35052
35080
 
35053
35081
  // src/native-static-libraries.ts
35054
35082
  var NATIVE_STATIC_LIBRARY_RECIPES = [
@@ -40658,6 +40686,7 @@ async function swiftPackages(entry, app) {
40658
40686
  packages,
40659
40687
  binaries: packages.binaries,
40660
40688
  standins: [],
40689
+ dynamicFrameworks: /* @__PURE__ */ new Map(),
40661
40690
  projectGaps: /* @__PURE__ */ new Map()
40662
40691
  };
40663
40692
  entry.packages = cached;
@@ -40737,6 +40766,14 @@ async function swiftPackages(entry, app) {
40737
40766
  for (const target of new Set(built2.standins.map((standin) => standin.target)))
40738
40767
  console.error(`Peach: target ${target} was replaced with a stand-in`);
40739
40768
  cached.standins = built2.standins;
40769
+ const stoodIn = new Set(built2.standins.map((standin) => standin.target));
40770
+ cached.dynamicFrameworks = new Map(
40771
+ cxxArtifacts.flatMap((binary) => {
40772
+ if (!stoodIn.has(binary.target)) return [];
40773
+ const native = simulatorNativeLibrary(swiftBinaryFramework(binary).dir);
40774
+ return native?.kind === "framework" && isDynamicLibrary(native.file) ? [[binary.target, native.name]] : [];
40775
+ })
40776
+ );
40740
40777
  cached.projectGaps = new Map(
40741
40778
  vendored.flatMap(({ target }) => {
40742
40779
  const gap = built2.gaps.get(target);
@@ -40800,10 +40837,7 @@ async function buildXcodeLayout(root) {
40800
40837
  nativeModules: registered.nativeModules
40801
40838
  }
40802
40839
  );
40803
- const { packages, standins, projectGaps, binaries } = await swiftPackages(
40804
- registered,
40805
- appTarget
40806
- );
40840
+ const { packages, standins, dynamicFrameworks, projectGaps, binaries } = await swiftPackages(registered, appTarget);
40807
40841
  const sourceFrameworks = new Map(
40808
40842
  packages.sourceFrameworks.map(
40809
40843
  ({
@@ -41407,7 +41441,8 @@ async function buildXcodeLayout(root) {
41407
41441
  (owner) => owner.module === original.moduleName
41408
41442
  )?.products ?? [] : [];
41409
41443
  const packageTarget = target.productType.startsWith("swiftpm.");
41410
- const packageFramework = target.productType === "swiftpm.library.dynamic" ? target.productName : null;
41444
+ const binaryFramework = target.productType === "swiftpm.target.binary" ? dynamicFrameworks.get(target.productName) ?? null : null;
41445
+ const packageFramework = target.productType === "swiftpm.library.dynamic" ? target.productName : binaryFramework;
41411
41446
  const buildVersion = {
41412
41447
  platform: packageTarget ? applicationBuildVersion.platform : target.buildVersion.platform,
41413
41448
  minimumOS: target.buildVersion.minimumOS ?? (packageTarget ? applicationBuildVersion.minimumOS : null),
@@ -41422,6 +41457,7 @@ async function buildXcodeLayout(root) {
41422
41457
  id: relative2(target.id),
41423
41458
  productName: packageFramework === null ? target.productName : `${packageFramework}.framework`,
41424
41459
  installName: packageFramework === null ? target.installName : `@rpath/${packageFramework}.framework/${packageFramework}`,
41460
+ machOType: binaryFramework === null ? target.machOType : "mh_dylib",
41425
41461
  sourceTarget: target.sourceTarget === null ? first ?? null : original ? frameworkNames.get(original) ?? original.moduleName : target.sourceTarget,
41426
41462
  buildVersion,
41427
41463
  dependencies: [
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2431 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2433 | (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;
@@ -4005,7 +4005,7 @@ var require_lib = __commonJS({
4005
4005
  var runtime_companion_default;
4006
4006
  var init_runtime_companion = __esm({
4007
4007
  "runtime-companion.json"() {
4008
- runtime_companion_default = { abi: 1, sha256: "c3e71b5eaf9166fc3fdc4333c354332e1ff41e1a6c71b6814afebe7c7d14bf9b", file: "node/cli-c3e71b5eaf9166fc3fdc4333c354332e1ff41e1a6c71b6814afebe7c7d14bf9b.cjs" };
4008
+ runtime_companion_default = { abi: 1, sha256: "2d42441f509451bf1c660a06ac087056d0cc7d96ca43aead02f6fd91f5e4e367", file: "node/cli-2d42441f509451bf1c660a06ac087056d0cc7d96ca43aead02f6fd91f5e4e367.cjs" };
4009
4009
  }
4010
4010
  });
4011
4011
 
@@ -4392,7 +4392,7 @@ var STANDIN_SOURCE_DIGEST;
4392
4392
  var init_swift_standin_digest = __esm({
4393
4393
  "src/swift-standin-digest.ts"() {
4394
4394
  "use strict";
4395
- STANDIN_SOURCE_DIGEST = true ? "3475ca483b1e5005a2c76ec887310c0d0f44c91ea427496b33acbb5bf6188684" : standinSourceDigest();
4395
+ STANDIN_SOURCE_DIGEST = true ? "edbd6d6714a42d5d22c4d8b74e605e5c897358beb450af3e5605c81299e68531" : standinSourceDigest();
4396
4396
  }
4397
4397
  });
4398
4398
 
@@ -5822,7 +5822,7 @@ var init_swift_compile = __esm({
5822
5822
  FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
5823
5823
  (module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
5824
5824
  ).join("");
5825
- compilerSourceDigest = true ? "da253e49615973dfc65a40000574546cbf7dc4c9d44a36295773bd33442d8c1d" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
5825
+ compilerSourceDigest = true ? "cdc5ec2138bb4a158f783cf86ed87144cd455551e18374805c743783ac04aa46" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
5826
5826
  C_WORDS = new Set(
5827
5827
  "auto bool break case char const continue default do double else enum extern false float for goto if inline int long register restrict return short signed sizeof static struct switch true typedef union unsigned void volatile while YES NO NULL nil Nil id self super instancetype".split(
5828
5828
  " "
@@ -6504,6 +6504,7 @@ var init_swift_host = __esm({
6504
6504
  init_swift_standins();
6505
6505
  init_swift_submit();
6506
6506
  init_swift_toolchain();
6507
+ init_swift_xcframework();
6507
6508
  init_swiftContract();
6508
6509
  init_swiftContract();
6509
6510
  init_xcode_project();
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2431 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2433 | (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.2431 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2433 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __typeError = (msg) => {
4
4
  throw TypeError(msg);
@@ -0,0 +1,3 @@
1
+ import type { CanvasKitRenderingApi as CanvasKit } from './canvaskit-api.d.ts';
2
+ export declare function setImageLoaderCanvasKit(ck: CanvasKit | null): void;
3
+ export declare function getImageLoaderCanvasKit(): CanvasKit | null;
@@ -1,5 +1,6 @@
1
1
  import { type MetroAssetPathRecord } from '../metro-asset-path.d.ts';
2
2
  import { type ImageFrameSource } from '../render-worker/image-pixel-contract.d.ts';
3
+ import { getImageLoaderCanvasKit } from './image-loader-canvaskit.d.ts';
3
4
  import type { ImageLifecycleEvent } from '../render-worker/image-lifecycle-event.d.ts';
4
5
  import type { DecodedImagePixels, ImagePixelDecodeSize } from '../render-worker/image-pixel-contract.d.ts';
5
6
  import type { CanvasKitRenderingApi as CanvasKit } from './canvaskit-api.d.ts';
@@ -363,3 +364,4 @@ export declare function readImagePrefetchRequest(uri: string, exactCacheKey: str
363
364
  export declare function prefetchImage(uri: string, requestId?: number, exactCacheKey?: string, headers?: Record<string, string>, paintNode?: SootSimNode, nativeUserAgent?: string | null): Promise<boolean>;
364
365
  export declare function clearImageCache(uri: string): void;
365
366
  export declare function touchPaintedImages(native: SceneNativeBinding, ctx: RenderContext, base?: number): void;
367
+ export { getImageLoaderCanvasKit };
@@ -1,7 +1,7 @@
1
1
  export declare const DISPLAY_SERVER_VERSION = 26;
2
2
  export declare const DISPLAY_SERVER_MAJOR = 2;
3
- export declare const DISPLAY_SERVER_MINOR = 36;
4
- export declare const DISPLAY_SERVER_SUBPROTOCOL = "rnx.display-server.v2.wire26.minor36";
3
+ export declare const DISPLAY_SERVER_MINOR = 37;
4
+ export declare const DISPLAY_SERVER_SUBPROTOCOL = "rnx.display-server.v2.wire26.minor37";
5
5
  export declare const DISPLAY_SERVER_TOKEN_SUBPROTOCOL_PREFIX = "rnx.sim-token.";
6
6
  export declare const RNX_CLOUD_DISPLAY_GRANT_TTL_MS: number;
7
7
  export declare const RNX_CLOUD_DISPLAY_CLOSE: {
@@ -37,6 +37,7 @@ export declare const DISPLAY_SERVER_LIMITS: {
37
37
  readonly maxNativeAnimMirrorBytes: 262144;
38
38
  readonly maxNativeAnimMirrorDepth: 64;
39
39
  readonly maxDiagnosticsBytes: 1048576;
40
+ readonly maxCameraInputBytes: 1048576;
40
41
  };
41
42
  export type DisplayServerAppearance = 'light' | 'dark';
42
43
  export interface RemotePeerIdentity {
@@ -32,7 +32,7 @@ import type { WorkerStorageSyncMessage } from './worker-storage.d.ts';
32
32
  import type { WorkletPeerEpoch } from './worklet-runtime.d.ts';
33
33
  import type { UiRpcMailboxes } from './worklet-sab.d.ts';
34
34
  import type { WorkletMessage } from './worklet-wire.d.ts';
35
- import type { SootSimLocationFix } from '../../../peach-globals/src/index.d.ts';
35
+ import type { SootSimCameraInputPayload, SootSimCameraInputState, SootSimLocationFix } from '../../../peach-globals/src/index.d.ts';
36
36
  import type { SootsimBootMark } from '../../../peach-globals/src/index.d.ts';
37
37
  import type { PeachPageServingAuthority, SootSimAccessibilityInput } from '../../../peach-globals/src/index.d.ts';
38
38
  import type { SootSimAgentActionDetail, SootSimLaunchArguments } from '../../../peach-globals/src/index.d.ts';
@@ -199,6 +199,9 @@ export type HostToWorker = {
199
199
  } | {
200
200
  type: 'setSimulatedLocation';
201
201
  location: SootSimLocationFix | null;
202
+ } | {
203
+ type: 'setCameraInput';
204
+ input: SootSimCameraInputPayload;
202
205
  } | {
203
206
  type: 'dispatchWindowEvent';
204
207
  eventType: ForwardedWindowEventType;
@@ -744,6 +747,9 @@ export type WorkerToHost = {
744
747
  } | {
745
748
  type: 'remoteDeviceLocation';
746
749
  location: SootSimLocationFix | null;
750
+ } | {
751
+ type: 'remoteDeviceCamera';
752
+ state: SootSimCameraInputState;
747
753
  } | {
748
754
  type: 'replayDevice';
749
755
  posture: DevicePosture | null;
@@ -0,0 +1,26 @@
1
+ export type SootSimCameraInputMode = 'off' | 'test-pattern' | 'photo' | 'video' | 'webcam';
2
+ export type SootSimCameraInputMimeType = 'image/jpeg' | 'image/png' | 'image/webp';
3
+ export interface SootSimCameraInputState {
4
+ mode: SootSimCameraInputMode;
5
+ label?: string;
6
+ }
7
+ export interface SootSimCameraInputFrame {
8
+ mode: 'photo' | 'video' | 'webcam';
9
+ label?: string;
10
+ mimeType: SootSimCameraInputMimeType;
11
+ bytes: Uint8Array;
12
+ width: number;
13
+ height: number;
14
+ }
15
+ export type SootSimCameraInputPayload = {
16
+ mode: 'off';
17
+ } | {
18
+ mode: 'test-pattern';
19
+ } | SootSimCameraInputFrame;
20
+ export interface SootSimCameraInputBridge {
21
+ get(): SootSimCameraInputState;
22
+ setTestPattern(): SootSimCameraInputState;
23
+ setFrame(frame: SootSimCameraInputFrame): SootSimCameraInputState;
24
+ clear(): SootSimCameraInputState;
25
+ subscribe(listener: (state: SootSimCameraInputState) => void): () => void;
26
+ }
@@ -3,6 +3,7 @@ import type { SootSimAndroidDateTimePickerBridge } from './androidDateTimePicker
3
3
  import type { SootSimHotRemountBridge } from './appLifecycleBridgeContract.d.ts';
4
4
  import type { SootSimAudioRecorderBridge, SootSimMediaSessionBridge } from './audioBridgeContract.d.ts';
5
5
  import type { SootSimCameraBridge } from './cameraBridgeContract.d.ts';
6
+ import type { SootSimCameraInputBridge } from './cameraInputBridgeContract.d.ts';
6
7
  import type { SootSimCaptureOptions } from './captureBridgeContract.d.ts';
7
8
  import type { SootSimClipboardBridge } from './clipboardBridgeContract.d.ts';
8
9
  import type { SootSimLiveCompositeBridge, SootSimVideoStreamBridge, SootSimAuxCompositorStats } from './compositorBridgeContract.d.ts';
@@ -118,6 +119,7 @@ export interface SootSimBridges {
118
119
  portalManager: SootSimPortalManager | null;
119
120
  settings: SootSimSettingsBridge | null;
120
121
  location: SootSimLocationBridge | null;
122
+ cameraInput: SootSimCameraInputBridge | null;
121
123
  windowScale: SootSimWindowScaleBridge | null;
122
124
  electron: SootSimElectronBridge | null;
123
125
  shellHost: SootSimShellHostBridge | null;
@@ -40,6 +40,7 @@ export type { LockstepFramePosition, PointerDeliveryTarget, PointerDeliveryPendi
40
40
  export type { SootSimLaunchArguments, SootSimExternalAppLifecycleOptions, SootSimStorageResetStrategy, SootSimExternalAppResetOptions, SootSimExternalAppResetResult, SootSimExternalAppStorageClearOptions, SootSimWebStorageName, SootSimHotRemountBridge, } from './appLifecycleBridgeContract.d.ts';
41
41
  export { PEACH_FINAL_LAUNCH_GLOBAL } from './appLifecycleBridgeContract.d.ts';
42
42
  export type { SootSimSettingsBridge } from './settingsBridgeContract.d.ts';
43
+ export type { SootSimCameraInputMode, SootSimCameraInputMimeType, SootSimCameraInputState, SootSimCameraInputFrame, SootSimCameraInputPayload, SootSimCameraInputBridge, } from './cameraInputBridgeContract.d.ts';
43
44
  export type { SootSimLocationFix, SootSimLocationResult, SootSimLocationBridge, } from './locationBridgeContract.d.ts';
44
45
  export { SOOTSIM_CAPTURE_IMAGE_QUALITY, sootsimCaptureIsFlat, } from './captureBridgeContract.d.ts';
45
46
  export type { SootSimCaptureFilter, SootSimCaptureOptions } from './captureBridgeContract.d.ts';
package/kotlin/README.md CHANGED
@@ -42,7 +42,9 @@ traffic in `scripts/debug/peach-swift-lazy-network.sh`.
42
42
  - `CompilerSources/`: the native member compiler plugin and JVM service
43
43
  registration. Release producers compile it to `plugin.jar`; clients load that
44
44
  jar without compiling or receiving plugin source. `ToolSources/` builds
45
- `tools.jar` for the existing Expo type scan and ViewModel ABI scan.
45
+ `tools.jar` for the Expo type scan, ViewModel ABI scan, and Java bindings.
46
+ The host runs those tools directly on the configured JVM with the compiler
47
+ and standard library jars from the pinned archive.
46
48
  `JniPlatformSources/` and `JniSources/` supply platform declarations and the
47
49
  native invocation runtime. Incoming JNI lookup retains stable IDs, private
48
50
  and virtual calls, constructors and backing fields. Native static companion
package/kotlin/sdk.tar.gz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.2431",
3
+ "version": "0.1.2433",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1 +1 @@
1
- {"abi":1,"sha256":"c3e71b5eaf9166fc3fdc4333c354332e1ff41e1a6c71b6814afebe7c7d14bf9b","file":"node/cli-c3e71b5eaf9166fc3fdc4333c354332e1ff41e1a6c71b6814afebe7c7d14bf9b.cjs"}
1
+ {"abi":1,"sha256":"2d42441f509451bf1c660a06ac087056d0cc7d96ca43aead02f6fd91f5e4e367","file":"node/cli-2d42441f509451bf1c660a06ac087056d0cc7d96ca43aead02f6fd91f5e4e367.cjs"}
@@ -5,7 +5,7 @@ import path from 'node:path'
5
5
  import { promisify } from 'node:util'
6
6
  import { readBridgeMethod } from './android-bridge-packages'
7
7
  import { isRecord } from './is-record'
8
- import { kotlinHome } from './kotlin-toolchain'
8
+ import { kotlinHome, runKotlinTool } from './kotlin-toolchain'
9
9
  import type { JavaModuleSpec, JavaModuleSpecs } from './javaAbiContract'
10
10
  import type { KotlinToolchainInstallation } from './kotlinSdkContract'
11
11
 
@@ -31,19 +31,11 @@ export async function readJavaModuleSpecs(
31
31
  fs.writeFileSync(target, bytes)
32
32
  origins.set(target, file)
33
33
  }
34
- const { stdout } = await run(
35
- path.join(toolchain.javaHome, 'bin', 'java'),
36
- [
37
- '-cp',
38
- [
39
- path.join(sdkRoot, 'tools.jar'),
40
- path.resolve(path.dirname(toolchain.kotlinc), '../lib/kotlin-compiler.jar'),
41
- path.resolve(path.dirname(toolchain.kotlinc), '../lib/kotlin-stdlib.jar'),
42
- ].join(path.delimiter),
43
- 'dev.peach.tools.javaabi.JavaModuleSpecsKt',
44
- ...origins.keys(),
45
- ],
46
- { maxBuffer: 16 * 1024 * 1024 },
34
+ const stdout = await runKotlinTool(
35
+ toolchain,
36
+ sdkRoot,
37
+ 'dev.peach.tools.javaabi.JavaModuleSpecsKt',
38
+ [...origins.keys()],
47
39
  ).catch((cause: unknown) => {
48
40
  if (!isRecord(cause) || typeof cause.stderr !== 'string') throw cause
49
41
  let diagnostic = cause.stderr
@@ -134,20 +126,11 @@ export async function compileJavaModuleAbi(input: {
134
126
  { maxBuffer: 16 * 1024 * 1024 },
135
127
  )
136
128
  const library = path.join(directory, 'java-abi.klib')
137
- await run(
138
- path.join(toolchain.javaHome, 'bin', 'java'),
139
- [
140
- '-cp',
141
- [
142
- path.join(sdkRoot, 'tools.jar'),
143
- path.resolve(path.dirname(toolchain.kotlinc), '../lib/kotlin-compiler.jar'),
144
- path.resolve(path.dirname(toolchain.kotlinc), '../lib/kotlin-stdlib.jar'),
145
- ].join(path.delimiter),
146
- 'dev.peach.tools.platform.JavaPlatformTypesKt',
147
- path.join(directory, `${name}.klib`),
148
- library,
149
- ],
150
- { maxBuffer: 16 * 1024 * 1024 },
129
+ await runKotlinTool(
130
+ toolchain,
131
+ sdkRoot,
132
+ 'dev.peach.tools.platform.JavaPlatformTypesKt',
133
+ [path.join(directory, `${name}.klib`), library],
151
134
  )
152
135
  return library
153
136
  }
@@ -30,6 +30,7 @@ import { kotlinInstanceSource } from './kotlin-instance-source'
30
30
  import { installKotlinSdkArchive } from './kotlin-sdk'
31
31
  import {
32
32
  ensureToolchain,
33
+ runKotlinTool,
33
34
  fetchVerified,
34
35
  kotlinHome,
35
36
  readToolchain,
@@ -404,26 +405,12 @@ async function scanSources<T>(
404
405
  const key = digest.digest('hex')
405
406
  let scan = toolScans.get(key)
406
407
  if (!scan) {
407
- scan = (async () => {
408
- const { kotlinc } = await ensureToolchain(toolchain)
409
- const { stdout } = await run(
410
- path.join(path.dirname(kotlinc), 'kotlin'),
411
- [
412
- '-cp',
413
- [
414
- path.resolve(path.dirname(kotlinc), '../lib/kotlin-compiler.jar'),
415
- path.join(sdk.root, 'tools.jar'),
416
- ].join(path.delimiter),
417
- tool,
418
- ...files,
419
- ],
420
- { maxBuffer: 16 * 1024 * 1024 },
421
- )
422
- return stdout
423
- })().catch((error: unknown) => {
424
- toolScans.delete(key)
425
- throw error
426
- })
408
+ scan = ensureToolchain(toolchain)
409
+ .then((ready) => runKotlinTool(ready, sdk.root, tool, files))
410
+ .catch((error: unknown) => {
411
+ toolScans.delete(key)
412
+ throw error
413
+ })
427
414
  toolScans.set(key, scan)
428
415
  }
429
416
  return parse(await scan)
@@ -1415,18 +1402,12 @@ async function compileKotlin(
1415
1402
  )
1416
1403
  ) {
1417
1404
  await compileKlib(path.join(work, 'abi'))
1418
- const { stdout } = await run(
1419
- path.join(path.dirname(kotlinc), 'kotlin'),
1420
- [
1421
- '-cp',
1422
- [
1423
- path.resolve(path.dirname(kotlinc), '../lib/kotlin-compiler.jar'),
1424
- path.join(sdk.root, 'tools.jar'),
1425
- ].join(path.delimiter),
1426
- viewModels.toolClass,
1427
- path.join(work, 'abi'),
1428
- ],
1429
- { maxBuffer: 64 * 1024 * 1024 },
1405
+ const stdout = await runKotlinTool(
1406
+ ready,
1407
+ sdk.root,
1408
+ viewModels.toolClass,
1409
+ [path.join(work, 'abi')],
1410
+ 64 * 1024 * 1024,
1430
1411
  )
1431
1412
  fs.writeFileSync(
1432
1413
  path.join(generatedDir, viewModels.file),
@@ -14,6 +14,31 @@ import type {
14
14
 
15
15
  const run = promisify(execFile)
16
16
 
17
+ export async function runKotlinTool(
18
+ toolchain: KotlinToolchainInstallation,
19
+ sdkRoot: string,
20
+ tool: string,
21
+ args: string[],
22
+ maxBuffer = 16 * 1024 * 1024,
23
+ ): Promise<string> {
24
+ const lib = path.resolve(path.dirname(toolchain.kotlinc), '../lib')
25
+ const { stdout } = await run(
26
+ path.join(toolchain.javaHome, 'bin', 'java'),
27
+ [
28
+ '-cp',
29
+ [
30
+ path.join(sdkRoot, 'tools.jar'),
31
+ path.join(lib, 'kotlin-compiler.jar'),
32
+ path.join(lib, 'kotlin-stdlib.jar'),
33
+ ].join(path.delimiter),
34
+ tool,
35
+ ...args,
36
+ ],
37
+ { maxBuffer },
38
+ )
39
+ return stdout
40
+ }
41
+
17
42
  export function readToolchain(moduleRoot: string): KotlinToolchain {
18
43
  const parsed: unknown = JSON.parse(
19
44
  fs.readFileSync(path.join(moduleRoot, 'toolchain.json'), 'utf8'),
@@ -34,6 +34,26 @@ function swiftPackageLinkage(
34
34
  return linkage
35
35
  }
36
36
 
37
+ // a static SwiftPM product holds no code of its own: each client links the
38
+ // product's targets, so the product groups link edges and joins no image.
39
+ function linkEdges(
40
+ targets: ReadonlyMap<string, SwiftSourceLinkGraph['targets'][number]>,
41
+ id: string,
42
+ ): SwiftSourceLinkGraph['targets'][number]['dependencies'] {
43
+ const target = targets.get(id)
44
+ if (!target) throw new Error(`unknown source target ${id}`)
45
+ return target.dependencies.flatMap((edge) => {
46
+ if (edge.attributes.length)
47
+ throw new Error(`unsupported link attributes for ${id} -> ${edge.target}`)
48
+ const dependency = targets.get(edge.target)
49
+ if (!dependency) throw new Error(`unknown source target ${edge.target}`)
50
+ return dependency.productType.startsWith('swiftpm.library.') &&
51
+ swiftPackageLinkage(dependency) === 'static'
52
+ ? linkEdges(targets, edge.target)
53
+ : [edge]
54
+ })
55
+ }
56
+
37
57
  /** Build image membership from resolved source products and their direct links. */
38
58
  export function guestSourceImages(graph: SwiftSourceLinkGraph): GuestSourceImage[] {
39
59
  const targets = new Map(graph.targets.map((target) => [target.id, target]))
@@ -63,11 +83,8 @@ export function guestSourceImages(graph: SwiftSourceLinkGraph): GuestSourceImage
63
83
  ownership.set(id, image.id)
64
84
  image.members.push(id)
65
85
  active.add(id)
66
- for (const edge of target.dependencies) {
67
- if (edge.attributes.length)
68
- throw new Error(`unsupported link attributes for ${id} -> ${edge.target}`)
69
- const dependency = targets.get(edge.target)
70
- if (!dependency) throw new Error(`unknown source target ${edge.target}`)
86
+ for (const edge of linkEdges(targets, id)) {
87
+ const dependency = targets.get(edge.target)!
71
88
  const type = dependency.productType
72
89
  let dynamic: boolean
73
90
  if (type.startsWith('swiftpm.target.')) {
@@ -77,7 +94,8 @@ export function guestSourceImages(graph: SwiftSourceLinkGraph): GuestSourceImage
77
94
  type !== 'swiftpm.target.system'
78
95
  )
79
96
  throw new Error(`unsupported SwiftPM target ${edge.target}`)
80
- dynamic = false
97
+ // a binary target's dynamic framework is its own image
98
+ dynamic = type === 'swiftpm.target.binary' && dependency.machOType === 'mh_dylib'
81
99
  } else if (type.startsWith('swiftpm.library.')) {
82
100
  dynamic = swiftPackageLinkage(dependency) === 'dynamic'
83
101
  } else if (type === 'com.apple.product-type.library.static') {
@@ -251,9 +269,7 @@ export function planGuestSourceLink(
251
269
  )
252
270
  )
253
271
  throw new Error(`unsupported special link flag for ${id}`)
254
- for (const edge of target.dependencies) {
255
- if (edge.attributes.length)
256
- throw new Error(`unsupported link attributes for ${id} -> ${edge.target}`)
272
+ for (const edge of linkEdges(targets, id)) {
257
273
  const dependencyImage = ownerByTarget.get(edge.target)
258
274
  if (dependencyImage === undefined)
259
275
  throw new Error(`linked target ${edge.target} has no guest image`)