peachsim 0.1.2746 → 0.1.2748

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 (141) hide show
  1. package/cli/outbound-endpoints.ts +19 -9
  2. package/dist-lib/agent-daemon-client.cjs +1 -1
  3. package/dist-lib/agent-events.cjs +1 -1
  4. package/dist-lib/attached-projects.cjs +1 -1
  5. package/dist-lib/auth/shared-session.cjs +1 -1
  6. package/dist-lib/backend-origin.cjs +1 -1
  7. package/dist-lib/beta.cjs +1 -1
  8. package/dist-lib/beta.mjs +2 -2
  9. package/dist-lib/bridge-constants.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.cjs +1 -1
  11. package/dist-lib/bridge-contract-input.mjs +5 -5
  12. package/dist-lib/bridge-contract.cjs +1 -1
  13. package/dist-lib/bridge-contract.mjs +3 -3
  14. package/dist-lib/bundle-channel.cjs +3902 -3889
  15. package/dist-lib/capture-contract.cjs +1 -1
  16. package/dist-lib/capture-contract.mjs +3 -3
  17. package/dist-lib/cloud-contract.cjs +1 -1
  18. package/dist-lib/cloud-contract.mjs +3 -3
  19. package/dist-lib/cloud-test-args.cjs +1 -1
  20. package/dist-lib/cloud-test-args.mjs +2 -2
  21. package/dist-lib/cloud.cjs +1 -1
  22. package/dist-lib/cloud.mjs +7 -7
  23. package/dist-lib/config.cjs +1 -1
  24. package/dist-lib/config.mjs +5 -5
  25. package/dist-lib/detox/index.cjs +1 -1
  26. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  27. package/dist-lib/esm-chunks/{acorn-QOTAOF5Z.mjs → acorn-VEWLHGUF.mjs} +3 -3
  28. package/dist-lib/esm-chunks/{chunk-QST2EJ23.mjs → chunk-4QUOVEXG.mjs} +3 -3
  29. package/dist-lib/esm-chunks/{chunk-JBA5MZXI.mjs → chunk-62Z4HAA5.mjs} +16 -15
  30. package/dist-lib/esm-chunks/{chunk-L7AI2APK.mjs → chunk-6ZVR2CVC.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-4NBVXIZE.mjs → chunk-A2EC74CI.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-TMC5X24U.mjs → chunk-BYYBOHZI.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-2WXEOIBB.mjs → chunk-C6IVVMZN.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-3NVVAQSW.mjs → chunk-GWZFPIGW.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-TEIXMLXF.mjs → chunk-HMPLB7MA.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-ZIB7E2UZ.mjs → chunk-HPANCGMI.mjs} +2 -2
  37. package/dist-lib/esm-chunks/{chunk-LJCRY4MG.mjs → chunk-HRS3DSAZ.mjs} +6 -6
  38. package/dist-lib/esm-chunks/{chunk-VU3BUF6L.mjs → chunk-I3KV46CL.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-GT4KPY7G.mjs → chunk-IE2LTKEG.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-ZJOVVIFO.mjs → chunk-KD3TI7UV.mjs} +4 -4
  41. package/dist-lib/esm-chunks/{chunk-5HNCEXGF.mjs → chunk-KNNMOD5T.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-XLZ2P347.mjs → chunk-NNVYKFSY.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-JWQYDDFF.mjs → chunk-RU7J2QST.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-ZQQKJLZG.mjs → chunk-TQACQLZ6.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-BBTAOM4S.mjs → chunk-TW5FZFU7.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-4IWPN4FR.mjs → chunk-U5SZIAIF.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-LCAHUXRX.mjs → chunk-UFQHPARI.mjs} +199 -197
  48. package/dist-lib/esm-chunks/{chunk-RHXTAMFH.mjs → chunk-UNOAFCHH.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{chunk-PGBXZIRW.mjs → chunk-VKYISXKK.mjs} +5 -5
  50. package/dist-lib/esm-chunks/{chunk-HCGHGGZY.mjs → chunk-WN22FGGA.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{chunk-SGCTCFCQ.mjs → chunk-XM3QYC5V.mjs} +1 -1
  52. package/dist-lib/esm-chunks/{metro-layout-parser-4PCWGBJT.mjs → metro-layout-parser-B74NVOKQ.mjs} +3 -3
  53. package/dist-lib/esm-chunks/{swift-package-prebuilt-FVIN2AH2.mjs → swift-package-prebuilt-B4QBXBQL.mjs} +12 -12
  54. package/dist-lib/esm-chunks/{swift-sdk-app-module-YTTAJZSA.mjs → swift-sdk-app-module-5OCMAJPP.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-GHK7ZE4W.mjs → swift-sdk-image-LQKEASAW.mjs} +16 -16
  56. package/dist-lib/esm-chunks/{swift-sdk-image-producer-C7JWU22H.mjs → swift-sdk-image-producer-ZMYZXL7Z.mjs} +8 -7
  57. package/dist-lib/expo-swift-bundle.cjs +143 -130
  58. package/dist-lib/expo-swift-metadata.cjs +1 -1
  59. package/dist-lib/expo-swift-metadata.mjs +7 -7
  60. package/dist-lib/home-paths.cjs +1 -1
  61. package/dist-lib/host/bridge-host.cjs +434 -421
  62. package/dist-lib/host/fetch-proxy-handler.cjs +15 -8
  63. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  64. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  65. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  66. package/dist-lib/host/websocket-proxy.cjs +1 -1
  67. package/dist-lib/index.cjs +1 -1
  68. package/dist-lib/kotlin-host.cjs +1 -1
  69. package/dist-lib/menu.cjs +1 -1
  70. package/dist-lib/menu.mjs +3 -3
  71. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  72. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  73. package/dist-lib/metro-production-bundle.cjs +1 -1
  74. package/dist-lib/metro-production-bundle.mjs +4 -4
  75. package/dist-lib/native-app-identity-project.cjs +1 -1
  76. package/dist-lib/native-app-identity-project.mjs +15 -15
  77. package/dist-lib/native-app-identity.cjs +1 -1
  78. package/dist-lib/native-app-identity.mjs +6 -6
  79. package/dist-lib/native-firebase-metadata.cjs +1 -1
  80. package/dist-lib/native-firebase-metadata.mjs +3 -3
  81. package/dist-lib/pdfium-raster.cjs +1 -1
  82. package/dist-lib/pdfium-raster.mjs +2 -2
  83. package/dist-lib/plist.cjs +1 -1
  84. package/dist-lib/plist.mjs +3 -3
  85. package/dist-lib/profiles.cjs +1 -1
  86. package/dist-lib/public-brand.cjs +1 -1
  87. package/dist-lib/public-origins-lib-esm.json +86 -85
  88. package/dist-lib/public-origins-lib.json +73 -67
  89. package/dist-lib/react-native-host-modules.cjs +1 -1
  90. package/dist-lib/react-native-host-modules.mjs +2 -2
  91. package/dist-lib/reap-browser.cjs +1 -1
  92. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  93. package/dist-lib/sdk.cjs +1 -1
  94. package/dist-lib/sdk.mjs +8 -8
  95. package/dist-lib/skills.cjs +434 -421
  96. package/dist-lib/swift-compile.cjs +124 -115
  97. package/dist-lib/swift-compile.mjs +12 -12
  98. package/dist-lib/swift-package.cjs +1 -1
  99. package/dist-lib/swift-package.mjs +3 -3
  100. package/dist-lib/swift-submit.cjs +1 -1
  101. package/dist-lib/swift-submit.mjs +6 -6
  102. package/dist-lib/swift-svg-raster.cjs +1 -1
  103. package/dist-lib/swift-svg-raster.mjs +2 -2
  104. package/dist-lib/swift-toolchain.cjs +1 -1
  105. package/dist-lib/swift.cjs +1 -1
  106. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  108. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  109. package/dist-lib/vendor/acorn.cjs +1 -1
  110. package/dist-lib/vendor/magic-string.cjs +1 -1
  111. package/dist-lib/vendor/stream-json.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  116. package/dist-lib/vendor/sucrase.cjs +1 -1
  117. package/dist-lib/vendor/terser.cjs +1 -1
  118. package/dist-lib/vendor/valibot.cjs +1 -1
  119. package/dist-lib/vendor/ws.cjs +1 -1
  120. package/dist-lib/vendor/zod.cjs +1 -1
  121. package/dist-lib/worklet-executable.cjs +1 -1
  122. package/dist-lib/worklet-executable.mjs +3 -3
  123. package/dist-types/packages/peach-engine/src/engine/canvaskit/graphite.d.ts +13 -0
  124. package/dist-types/packages/peach-engine/src/engine/native-paint-facts.d.ts +3 -1
  125. package/dist-types/packages/peach-engine/src/engine/paint-value-input.d.ts +7 -0
  126. package/dist-types/packages/peach-engine/src/engine/scene-native-binding.d.ts +2 -2
  127. package/dist-types/packages/peach-engine/src/render-worker/canvaskit-webgpu.d.ts +2 -19
  128. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +2 -1
  129. package/dist-types/packages/peach-engine/src/render-worker/native-hot-ops.d.ts +2 -2
  130. package/package.json +1 -1
  131. package/src/expo-swift-host.ts +4 -0
  132. package/src/one-native-controls-package.ts +5 -5
  133. package/src/one-sdk-bundle.ts +1 -1
  134. package/src/swift-compiler-digest.ts +1 -0
  135. package/src/swift-objc-compile.ts +4 -5
  136. package/src/swift-objc-prebuilt.ts +2 -2
  137. package/src/swift-pdf-raster.ts +2 -2
  138. package/src/swift-sdk-image-producer.ts +2 -1
  139. package/src/swift-sdk-surface.ts +4 -120
  140. package/src/swift-source-pods.ts +3 -3
  141. package/src/one-sdk/shard.ts +0 -382
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2746 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2748 | (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;
@@ -36019,7 +36019,7 @@ var init_swift_objc_sdk_tree = __esm({
36019
36019
 
36020
36020
  // src/swift-compiler-digest.ts
36021
36021
  function swiftArchiveCompilerDigestValue() {
36022
- return true ? "ef102649bb803fa4a669fab0435e2270e6dc7dc45669a03a377d6951f7daa35f" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
36022
+ return true ? "99ae71a024c1f7e48133d193acd1d2f2b0738fcbc5e5291800fd396afb31897b" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
36023
36023
  }
36024
36024
  var import_node_crypto11, import_node_fs27, import_node_path25, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
36025
36025
  var init_swift_compiler_digest = __esm({
@@ -36032,6 +36032,7 @@ var init_swift_compiler_digest = __esm({
36032
36032
  SWIFT_DIGEST_SOURCES = [
36033
36033
  "swift-compile.ts",
36034
36034
  "swift-sdk-surface.ts",
36035
+ "../../peach-globals/build/swift-source-mask.ts",
36035
36036
  "swift-wasm-archive.ts",
36036
36037
  "swift-lexical.ts",
36037
36038
  "swift-header-compiler.ts",
@@ -36164,13 +36165,13 @@ var init_swift_standin_digest = __esm({
36164
36165
  ];
36165
36166
  RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
36166
36167
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
36167
- STANDIN_SOURCE_DIGEST = true ? "5ddae8c784aa92fac8a541b367a4e978b8493c2213b935ba97e6dd92b43ad49c" : standinSourceDigest();
36168
+ STANDIN_SOURCE_DIGEST = true ? "a17a387bf80ef3648c26193901ee6a7cb9abc691b99809c6a8bf9ad4617836af" : standinSourceDigest();
36168
36169
  }
36169
36170
  });
36170
36171
 
36171
36172
  // src/expo-native-compiler-digest.ts
36172
36173
  function expoNativeCompilerDigestValue() {
36173
- return true ? "32128bd460028ed060190bfde6d7773aef3938f8c132b90073f8f8fb3daabe41" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
36174
+ return true ? "3c2822a0dd3afa16e099b22ab6970a7d2276823c6d9aa2d72292a87fd8077fad" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
36174
36175
  }
36175
36176
  var import_node_crypto13;
36176
36177
  var init_expo_native_compiler_digest = __esm({
@@ -71481,6 +71482,122 @@ var init_swift_lexical = __esm({
71481
71482
  }
71482
71483
  });
71483
71484
 
71485
+ // ../peach-globals/build/swift-source-mask.ts
71486
+ function maskSwiftCode(source) {
71487
+ const chars2 = source.split("");
71488
+ const blank = (from, to) => {
71489
+ for (let i = Math.max(0, from); i < Math.min(to, chars2.length); i++)
71490
+ if (chars2[i] !== "\n") chars2[i] = " ";
71491
+ };
71492
+ const hashesAt = (at) => {
71493
+ let end = at;
71494
+ while (source[end] === "#") end++;
71495
+ return end - at;
71496
+ };
71497
+ const scanString = (quote3, hashes) => {
71498
+ const multiline = source.startsWith('"""', quote3);
71499
+ let i = quote3 + (multiline ? 3 : 1);
71500
+ const keep = [];
71501
+ const quoteEnd = (at) => {
71502
+ const mark = multiline ? '"""' : '"';
71503
+ return source.startsWith(mark, at) && source.startsWith("#".repeat(hashes), at + mark.length);
71504
+ };
71505
+ while (i < chars2.length) {
71506
+ if (source[i] === "\\" && source.startsWith("#".repeat(hashes), i + 1)) {
71507
+ const escaped = i + 1 + hashes;
71508
+ if (source[escaped] === "(") {
71509
+ const codeStart = escaped + 1;
71510
+ const codeEnd = scanCode(codeStart, true);
71511
+ keep.push([codeStart, codeEnd]);
71512
+ i = codeEnd + 1;
71513
+ } else {
71514
+ i = escaped + 1;
71515
+ }
71516
+ continue;
71517
+ }
71518
+ if (quoteEnd(i)) {
71519
+ const close2 = i + (multiline ? 3 : 1) + hashes;
71520
+ let cursor = quote3 - hashes;
71521
+ const ranges = [...keep, [close2, close2]];
71522
+ for (const [from, to] of ranges)
71523
+ if (from > cursor) {
71524
+ blank(cursor, from);
71525
+ cursor = to;
71526
+ } else cursor = Math.max(cursor, to);
71527
+ return close2;
71528
+ }
71529
+ i++;
71530
+ }
71531
+ blank(quote3 - hashes, chars2.length);
71532
+ return chars2.length;
71533
+ };
71534
+ const scanCode = (i, nested) => {
71535
+ let parens = 0;
71536
+ while (i < chars2.length) {
71537
+ const char = source[i];
71538
+ if (char === "/" && source[i + 1] === "/") {
71539
+ const end = source.indexOf("\n", i);
71540
+ blank(i, end === -1 ? chars2.length : end);
71541
+ i = end === -1 ? chars2.length : end;
71542
+ continue;
71543
+ }
71544
+ if (char === "/" && source[i + 1] === "*") {
71545
+ let j = i + 2;
71546
+ let depth = 1;
71547
+ while (j < chars2.length && depth > 0) {
71548
+ if (source.startsWith("/*", j)) {
71549
+ depth++;
71550
+ j += 2;
71551
+ } else if (source.startsWith("*/", j)) {
71552
+ depth--;
71553
+ j += 2;
71554
+ } else j++;
71555
+ }
71556
+ blank(i, j);
71557
+ i = j;
71558
+ continue;
71559
+ }
71560
+ if (char === "#") {
71561
+ const hashes = hashesAt(i);
71562
+ const at = i + hashes;
71563
+ if (source[at] === '"') {
71564
+ i = scanString(at, hashes);
71565
+ continue;
71566
+ }
71567
+ if (hashes > 0 && source[at] === "/") {
71568
+ const mark = "#".repeat(hashes);
71569
+ let j = at + 1;
71570
+ while (j < chars2.length && !(source[j] === "/" && source.startsWith(mark, j + 1)))
71571
+ j++;
71572
+ blank(i, Math.min(chars2.length, j + 1 + hashes));
71573
+ i = Math.min(chars2.length, j + 1 + hashes);
71574
+ continue;
71575
+ }
71576
+ i++;
71577
+ continue;
71578
+ }
71579
+ if (char === '"') {
71580
+ i = scanString(i, 0);
71581
+ continue;
71582
+ }
71583
+ if (char === "(") parens++;
71584
+ else if (char === ")") {
71585
+ if (nested && parens === 0) return i;
71586
+ parens--;
71587
+ }
71588
+ i++;
71589
+ }
71590
+ return i;
71591
+ };
71592
+ scanCode(0, false);
71593
+ return chars2.join("");
71594
+ }
71595
+ var init_swift_source_mask = __esm({
71596
+ "../peach-globals/build/swift-source-mask.ts"() {
71597
+ "use strict";
71598
+ }
71599
+ });
71600
+
71484
71601
  // src/swift-sdk-surface.ts
71485
71602
  function swiftBuildJobs() {
71486
71603
  const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
@@ -72168,115 +72285,6 @@ function swiftCodeMask(source) {
72168
72285
  codeMaskChars += source.length;
72169
72286
  return masked;
72170
72287
  }
72171
- function maskSwiftCode(source) {
72172
- const chars2 = source.split("");
72173
- const blank = (from, to) => {
72174
- for (let i = Math.max(0, from); i < Math.min(to, chars2.length); i++)
72175
- if (chars2[i] !== "\n") chars2[i] = " ";
72176
- };
72177
- const hashesAt = (at) => {
72178
- let end = at;
72179
- while (source[end] === "#") end++;
72180
- return end - at;
72181
- };
72182
- const scanString = (quote3, hashes) => {
72183
- const multiline = source.startsWith('"""', quote3);
72184
- let i = quote3 + (multiline ? 3 : 1);
72185
- const keep = [];
72186
- const quoteEnd = (at) => {
72187
- const mark = multiline ? '"""' : '"';
72188
- return source.startsWith(mark, at) && source.startsWith("#".repeat(hashes), at + mark.length);
72189
- };
72190
- while (i < chars2.length) {
72191
- if (source[i] === "\\" && source.startsWith("#".repeat(hashes), i + 1)) {
72192
- const escaped = i + 1 + hashes;
72193
- if (source[escaped] === "(") {
72194
- const codeStart = escaped + 1;
72195
- const codeEnd = scanCode(codeStart, true);
72196
- keep.push([codeStart, codeEnd]);
72197
- i = codeEnd + 1;
72198
- } else {
72199
- i = escaped + 1;
72200
- }
72201
- continue;
72202
- }
72203
- if (quoteEnd(i)) {
72204
- const close2 = i + (multiline ? 3 : 1) + hashes;
72205
- let cursor = quote3 - hashes;
72206
- const ranges = [...keep, [close2, close2]];
72207
- for (const [from, to] of ranges)
72208
- if (from > cursor) {
72209
- blank(cursor, from);
72210
- cursor = to;
72211
- } else cursor = Math.max(cursor, to);
72212
- return close2;
72213
- }
72214
- i++;
72215
- }
72216
- blank(quote3 - hashes, chars2.length);
72217
- return chars2.length;
72218
- };
72219
- const scanCode = (i, nested) => {
72220
- let parens = 0;
72221
- while (i < chars2.length) {
72222
- const char = source[i];
72223
- if (char === "/" && source[i + 1] === "/") {
72224
- const end = source.indexOf("\n", i);
72225
- blank(i, end === -1 ? chars2.length : end);
72226
- i = end === -1 ? chars2.length : end;
72227
- continue;
72228
- }
72229
- if (char === "/" && source[i + 1] === "*") {
72230
- let j = i + 2;
72231
- let depth = 1;
72232
- while (j < chars2.length && depth > 0) {
72233
- if (source.startsWith("/*", j)) {
72234
- depth++;
72235
- j += 2;
72236
- } else if (source.startsWith("*/", j)) {
72237
- depth--;
72238
- j += 2;
72239
- } else j++;
72240
- }
72241
- blank(i, j);
72242
- i = j;
72243
- continue;
72244
- }
72245
- if (char === "#") {
72246
- const hashes = hashesAt(i);
72247
- const at = i + hashes;
72248
- if (source[at] === '"') {
72249
- i = scanString(at, hashes);
72250
- continue;
72251
- }
72252
- if (hashes > 0 && source[at] === "/") {
72253
- const mark = "#".repeat(hashes);
72254
- let j = at + 1;
72255
- while (j < chars2.length && !(source[j] === "/" && source.startsWith(mark, j + 1)))
72256
- j++;
72257
- blank(i, Math.min(chars2.length, j + 1 + hashes));
72258
- i = Math.min(chars2.length, j + 1 + hashes);
72259
- continue;
72260
- }
72261
- i++;
72262
- continue;
72263
- }
72264
- if (char === '"') {
72265
- i = scanString(i, 0);
72266
- continue;
72267
- }
72268
- if (char === "(") parens++;
72269
- else if (char === ")") {
72270
- if (nested && parens === 0) return i;
72271
- parens--;
72272
- }
72273
- i++;
72274
- }
72275
- return i;
72276
- };
72277
- scanCode(0, false);
72278
- return chars2.join("");
72279
- }
72280
72288
  function foundationOwnerOf(name3) {
72281
72289
  if (name3 === "NSKeyValueObservedChange" || name3 === "NSKeyValueObservation")
72282
72290
  return "PeachObjC";
@@ -72461,8 +72469,9 @@ function swiftModuleToolchain(root) {
72461
72469
  }
72462
72470
  function remoteSwiftCheckouts(root) {
72463
72471
  const key2 = (0, import_node_crypto40.createHash)("sha256").update((0, import_node_fs70.realpathSync)(root)).digest("hex").slice(0, 32);
72464
- (0, import_node_fs70.mkdirSync)(cacheDir(), { recursive: true });
72465
- return import_node_path68.default.join((0, import_node_fs70.realpathSync)(cacheDir()), "swift-packages", key2, "checkouts");
72472
+ const cache = swiftCacheDir();
72473
+ (0, import_node_fs70.mkdirSync)(cache, { recursive: true });
72474
+ return import_node_path68.default.join((0, import_node_fs70.realpathSync)(cache), "swift-packages", key2, "checkouts");
72466
72475
  }
72467
72476
  var import_node_child_process34, import_node_crypto40, import_node_fs70, import_node_os12, import_node_path68, distributionManifests, distributionCompileViews, REACH_STAGED_FRAMEWORKS, objcEnumerations, clangDeclarationEnumCache, objcEnumForward, sdkDeclarationOwners, swiftInterfaceDeclarations, linkedModuleDigests, compileSurfaces, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, NON_IOS_MODULES, importNamesCache, sdkPaths, FOUNDATION_IMPLICIT_MODULES, FRAMEWORK_COMPANION_IMPORT, codeMasks, codeMaskChars, CODE_MASK_CACHE_CHARS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, emptyMacroEnvironment, wasmMacroEnvironment, swiftBinaryOnDisk;
72468
72477
  var init_swift_sdk_surface = __esm({
@@ -72473,8 +72482,8 @@ var init_swift_sdk_surface = __esm({
72473
72482
  import_node_fs70 = require("node:fs");
72474
72483
  import_node_os12 = __toESM(require("node:os"), 1);
72475
72484
  import_node_path68 = __toESM(require("node:path"), 1);
72485
+ init_swift_source_mask();
72476
72486
  init_admitted_mac_build();
72477
- init_home_paths();
72478
72487
  init_swift_distribution_contract();
72479
72488
  init_swift_package();
72480
72489
  init_swift_shared_sdk();
@@ -74365,7 +74374,8 @@ async function produceSwiftSdkImage(input) {
74365
74374
  import_node_path72.default.join(directory3, "snapshot"),
74366
74375
  requestFile,
74367
74376
  import_node_path72.default.join(directory3, "delivery"),
74368
- input.frameworkKey
74377
+ input.frameworkKey,
74378
+ process.env.CONTRAST_LAND_CHECK === "1" ? "1" : ""
74369
74379
  ],
74370
74380
  { cwd: repo }
74371
74381
  );
@@ -74453,7 +74463,7 @@ mv "$1.tmp" "$1"
74453
74463
  shift
74454
74464
  export GIT_ALTERNATE_OBJECT_DIRECTORIES="$2/objects"
74455
74465
  set +e
74456
- env -u TM_WINDOW -u TM_WAIT_DEADLINE_MS -u TM_EXEC_OUTER_DEADLINE_MS -u REMOTE_BUILD_DEADLINE -u TM_EXEC_ADMITTED -u LINUX_BUILD_SCOPE -u TM_EXEC_CPU_CORES -u TM_EXEC_LINUX_MEMORY_MAX -u CONTRAST_HEAVY_ADMITTED -u CONTRAST_HEAVY_CPU_CORES tm exec --local --kind build-linux --cores "$1" --timeout 90m --param wait=true --param job-kind=swift-sdk-image --param "source-snapshot=$2" --param "delivery-dir=$4" --param "serial-key=swift-sdk-$5" -- bun scripts/ops/produce-swift-sdk-image.ts "$3" </dev/null
74466
+ env -u TM_WINDOW -u TM_WAIT_DEADLINE_MS -u TM_EXEC_OUTER_DEADLINE_MS -u REMOTE_BUILD_DEADLINE -u TM_EXEC_ADMITTED -u LINUX_BUILD_SCOPE -u TM_EXEC_CPU_CORES -u TM_EXEC_LINUX_MEMORY_MAX -u CONTRAST_HEAVY_ADMITTED -u CONTRAST_HEAVY_CPU_CORES CONTRAST_LAND_CHECK="$6" tm exec --local --kind build-linux --cores "$1" --timeout 90m --param wait=true --param job-kind=swift-sdk-image --param "source-snapshot=$2" --param "delivery-dir=$4" --param "serial-key=swift-sdk-$5" -- bun scripts/ops/produce-swift-sdk-image.ts "$3" </dev/null
74457
74467
  status=$?
74458
74468
  if bun -e 'try { if (JSON.parse(require("node:fs").readFileSync(process.argv[1], "utf8")).released !== true) process.exit(1) } catch { process.exit(1) }' "$4/cleanup.json"; then rm -rf "$2"; fi
74459
74469
  exit "$status"
@@ -78449,9 +78459,9 @@ var init_swift_objc_prebuilt = __esm({
78449
78459
  import_node_path79 = __toESM(require("node:path"), 1);
78450
78460
  init_internal_child_contract();
78451
78461
  init_self_invocation();
78452
- init_home_paths();
78453
78462
  init_native_prebuilt();
78454
78463
  init_swift_objc_prebuilt_catalog();
78464
+ init_swift_toolchain();
78455
78465
  quote2 = (value) => "'" + value.replaceAll("'", "'\\''") + "'";
78456
78466
  }
78457
78467
  });
@@ -84771,7 +84781,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
84771
84781
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
84772
84782
  MULTI_MANIFEST_VERSION = 76;
84773
84783
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
84774
- compilerSourceDigest = true ? "9e43b96f22759d18028120bf151aaa3545b4a68d9cb280a87e81051893e9eb50" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
84784
+ compilerSourceDigest = true ? "9e800b4e5695e0ea16860a945e2ba4dd9efa69f299d64b77b74c6197d9d31df6" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
84775
84785
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
84776
84786
  MODULE_MAP_RESPONSE_FILE_RUN = 16;
84777
84787
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
@@ -112592,7 +112602,7 @@ function cachedBinaryFileDigest(file) {
112592
112602
  const stamp = `${stat2.dev}:${stat2.ino}:${stat2.size}:${stat2.mtimeNs}:${stat2.ctimeNs}`;
112593
112603
  const memory = binaryFileDigests.get(real);
112594
112604
  if (memory?.stamp === stamp) return memory.digest;
112595
- const dir = import_node_path124.default.join(cacheDir(), "swift-binary-digests");
112605
+ const dir = import_node_path124.default.join(swiftCacheDir(), "swift-binary-digests");
112596
112606
  const record6 = import_node_path124.default.join(dir, `${sha256Hex6(real)}.json`);
112597
112607
  if (import_node_fs122.default.existsSync(record6)) {
112598
112608
  const saved = JSON.parse(import_node_fs122.default.readFileSync(record6, "utf8"));
@@ -113186,7 +113196,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
113186
113196
  [...providers].map(([name3, file]) => [name3, digest3(import_node_fs122.default.readFileSync(file))])
113187
113197
  )
113188
113198
  };
113189
- const parent = import_node_path124.default.join(cacheDir(), "swift-xcode-products");
113199
+ const parent = import_node_path124.default.join(swiftCacheDir(), "swift-xcode-products");
113190
113200
  import_node_fs122.default.mkdirSync(parent, { recursive: true });
113191
113201
  const key2 = digest3(JSON.stringify(identity2));
113192
113202
  const work = import_node_path124.default.join(parent, key2);
@@ -113524,7 +113534,7 @@ async function prepareXcodeNativeInputs(app, binaries, moduleRoot, purpose) {
113524
113534
  derivations,
113525
113535
  swiftProducts: products?.receipt
113526
113536
  };
113527
- const parent = import_node_path124.default.join(cacheDir(), "swift-objc-implementations");
113537
+ const parent = import_node_path124.default.join(swiftCacheDir(), "swift-objc-implementations");
113528
113538
  import_node_fs122.default.mkdirSync(parent, { recursive: true });
113529
113539
  const key2 = digest3(JSON.stringify(identity2));
113530
113540
  const work = import_node_path124.default.join(parent, key2);
@@ -113889,7 +113899,6 @@ var init_swift_objc_compile = __esm({
113889
113899
  import_node_fs122 = __toESM(require("node:fs"), 1);
113890
113900
  import_node_path124 = __toESM(require("node:path"), 1);
113891
113901
  init_mapLimit();
113892
- init_home_paths();
113893
113902
  init_is_record();
113894
113903
  init_swift_objc_import();
113895
113904
  init_swift_objc_runtime();
@@ -121676,7 +121685,7 @@ function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageByt
121676
121685
  const rendered = /* @__PURE__ */ new Map();
121677
121686
  const pending2 = /* @__PURE__ */ new Map();
121678
121687
  const renderer = process.platform === "darwin" ? "30774891a9db216d" : "pdfium-1";
121679
- const cache = cacheDir();
121688
+ const cache = swiftCacheDir();
121680
121689
  const cached5 = (sha2565) => import_node_path132.default.join(cache, `swift-pdf-png-${renderer}-${sha2565}.png`);
121681
121690
  let remainingBytes = imageTotalBytes;
121682
121691
  const record6 = ({ file, sha256: sha2565 }, bytes) => {
@@ -121762,7 +121771,7 @@ var init_swift_pdf_raster = __esm({
121762
121771
  import_node_path132 = __toESM(require("node:path"), 1);
121763
121772
  init_internal_child_contract();
121764
121773
  init_self_invocation();
121765
- init_home_paths();
121774
+ init_swift_toolchain();
121766
121775
  RASTER_PDF = `
121767
121776
  ObjC.import('Foundation')
121768
121777
  ObjC.import('CoreGraphics')
@@ -135059,6 +135068,10 @@ function installSwiftInputTrace() {
135059
135068
  import_node_path146.default.join(cacheDir(), "swift-builds"),
135060
135069
  import_node_path146.default.join(swiftCacheDir(), "swift-builds"),
135061
135070
  import_node_path146.default.join(swiftCacheDir(), "swift-sdk-views"),
135071
+ import_node_path146.default.join(swiftCacheDir(), "swift-binary-digests"),
135072
+ import_node_path146.default.join(swiftCacheDir(), "swift-xcode-products"),
135073
+ import_node_path146.default.join(swiftCacheDir(), "swift-objc-implementations"),
135074
+ import_node_path146.default.join(swiftCacheDir(), "swift-header-case"),
135062
135075
  swiftRootLocksDir(),
135063
135076
  import_node_path146.default.join(cacheDir(), "swift-tmp"),
135064
135077
  // content-addressed records whose reads renew their timestamps for expiry.
@@ -144011,9 +144024,285 @@ var init_nativeSourceContract = __esm({
144011
144024
  }
144012
144025
  });
144013
144026
 
144027
+ // ../peach-globals/build/one-sdk-shard.ts
144028
+ function unsharded(name3, source) {
144029
+ const lineCount = source.split("\n").length;
144030
+ return [
144031
+ {
144032
+ name: name3,
144033
+ source,
144034
+ originalName: name3,
144035
+ lineMap: Array.from({ length: lineCount }, (_, index) => index + 1)
144036
+ }
144037
+ ];
144038
+ }
144039
+ function chunkKey2(lines) {
144040
+ for (const { text: text7 } of lines) {
144041
+ const trimmed = text7.trim();
144042
+ if (trimmed !== "" && !trimmed.startsWith("//")) return trimmed;
144043
+ }
144044
+ return lines.map((item) => item.text).join("\n");
144045
+ }
144046
+ function stableShardIndex(key2, shardCount) {
144047
+ return (0, import_node_crypto93.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
144048
+ }
144049
+ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
144050
+ if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
144051
+ return unsharded(name3, source);
144052
+ }
144053
+ const masked = maskSwiftCode(source);
144054
+ if (/\bfileprivate\b/.test(masked)) return unsharded(name3, source);
144055
+ const lines = source.split("\n");
144056
+ const maskedLines = masked.split("\n");
144057
+ if (lines.length !== maskedLines.length) return unsharded(name3, source);
144058
+ const headerLines = [];
144059
+ let index = 0;
144060
+ let headerIfDepth = 0;
144061
+ while (index < lines.length) {
144062
+ const text7 = lines[index];
144063
+ const trimmed = text7.trim();
144064
+ if (trimmed === "" || trimmed.startsWith("// generated ") || trimmed.startsWith("import ")) {
144065
+ headerLines.push({ text: text7, line: index + 1 });
144066
+ index++;
144067
+ continue;
144068
+ }
144069
+ if (trimmed.startsWith("#if ")) {
144070
+ headerIfDepth++;
144071
+ headerLines.push({ text: text7, line: index + 1 });
144072
+ index++;
144073
+ continue;
144074
+ }
144075
+ if (headerIfDepth > 0 && (trimmed.startsWith("#elseif ") || trimmed === "#else" || trimmed === "#endif")) {
144076
+ if (trimmed === "#endif") headerIfDepth--;
144077
+ headerLines.push({ text: text7, line: index + 1 });
144078
+ index++;
144079
+ continue;
144080
+ }
144081
+ break;
144082
+ }
144083
+ if (headerIfDepth !== 0) return unsharded(name3, source);
144084
+ while (headerLines.length > 0 && headerLines.at(-1).text.trim() === "") {
144085
+ headerLines.pop();
144086
+ }
144087
+ const chunks = [];
144088
+ let depth = 0;
144089
+ let pending2 = [];
144090
+ let hadBrace = false;
144091
+ let inImplementation = false;
144092
+ let inOpen = false;
144093
+ let openDeclarations = 0;
144094
+ let activeEnum = null;
144095
+ let enumDeclLine = 0;
144096
+ let memberLines = [];
144097
+ let memberHadBrace = false;
144098
+ for (; index < lines.length; index++) {
144099
+ const text7 = lines[index];
144100
+ const lineNo = index + 1;
144101
+ const maskedLine = maskedLines[index];
144102
+ if (depth <= 1 && /^\s*#/.test(maskedLine)) return unsharded(name3, source);
144103
+ let delta = 0;
144104
+ for (let i = 0; i < maskedLine.length; i++) {
144105
+ const ch = maskedLine[i];
144106
+ if (ch === "{") delta++;
144107
+ else if (ch === "}") delta--;
144108
+ }
144109
+ if (activeEnum === null) {
144110
+ if (depth === 0 && !hadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
144111
+ return unsharded(name3, source);
144112
+ }
144113
+ if (depth === 0 && !hadBrace && !inImplementation && text7.startsWith("// implementation ")) {
144114
+ inImplementation = true;
144115
+ pending2.push({ text: text7, line: lineNo });
144116
+ continue;
144117
+ }
144118
+ if (inImplementation) {
144119
+ pending2.push({ text: text7, line: lineNo });
144120
+ depth += delta;
144121
+ if (depth < 0) return unsharded(name3, source);
144122
+ if (depth === 0 && text7 === "// end implementation") {
144123
+ chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
144124
+ pending2 = [];
144125
+ hadBrace = false;
144126
+ inImplementation = false;
144127
+ }
144128
+ continue;
144129
+ }
144130
+ if (depth === 0 && !hadBrace && !inOpen && text7.startsWith("// open ")) {
144131
+ inOpen = true;
144132
+ openDeclarations = 0;
144133
+ pending2.push({ text: text7, line: lineNo });
144134
+ continue;
144135
+ }
144136
+ if (inOpen) {
144137
+ pending2.push({ text: text7, line: lineNo });
144138
+ if (delta !== 0 || depth > 0) hadBrace = true;
144139
+ depth += delta;
144140
+ if (depth < 0) return unsharded(name3, source);
144141
+ if (hadBrace && depth === 0) {
144142
+ openDeclarations++;
144143
+ hadBrace = false;
144144
+ if (openDeclarations === 2) {
144145
+ chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
144146
+ pending2 = [];
144147
+ inOpen = false;
144148
+ openDeclarations = 0;
144149
+ }
144150
+ }
144151
+ continue;
144152
+ }
144153
+ const enumMatch = depth === 0 && !hadBrace && pending2.every(
144154
+ (item) => item.text.trim() === "" || item.text.trim().startsWith("//")
144155
+ ) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
144156
+ if (enumMatch && delta === 1) {
144157
+ const enumName = enumMatch[1];
144158
+ const prefix = pending2.filter((item) => item.text.trim() !== "");
144159
+ enumDeclLine = lineNo;
144160
+ chunks.push({
144161
+ kind: "enumDecl",
144162
+ enumName,
144163
+ lines: [...prefix, { text: `enum ${enumName} {}`, line: lineNo }]
144164
+ });
144165
+ pending2 = [];
144166
+ activeEnum = enumName;
144167
+ depth = 1;
144168
+ continue;
144169
+ }
144170
+ if (depth === 0 && !hadBrace && text7.trim() === "" && pending2.length === 0) {
144171
+ continue;
144172
+ }
144173
+ pending2.push({ text: text7, line: lineNo });
144174
+ if (delta !== 0 || depth > 0) hadBrace = true;
144175
+ depth += delta;
144176
+ if (depth < 0) return unsharded(name3, source);
144177
+ if (hadBrace && depth === 0) {
144178
+ chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
144179
+ pending2 = [];
144180
+ hadBrace = false;
144181
+ }
144182
+ } else {
144183
+ const nextDepth = depth + delta;
144184
+ if (nextDepth < 0) return unsharded(name3, source);
144185
+ if (depth === 1 && nextDepth === 0) {
144186
+ if (memberHadBrace || maskedLine.trim() !== "}") return unsharded(name3, source);
144187
+ if (memberLines.some(
144188
+ (item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
144189
+ )) {
144190
+ chunks.push({
144191
+ kind: "enumMember",
144192
+ enumName: activeEnum,
144193
+ key: chunkKey2(memberLines),
144194
+ lines: memberLines
144195
+ });
144196
+ }
144197
+ activeEnum = null;
144198
+ depth = 0;
144199
+ memberLines = [];
144200
+ continue;
144201
+ }
144202
+ if (depth === 1 && !memberHadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
144203
+ return unsharded(name3, source);
144204
+ }
144205
+ if (depth === 1 && !memberHadBrace && text7.trim() === "") {
144206
+ depth = nextDepth;
144207
+ continue;
144208
+ }
144209
+ memberLines.push({ text: text7, line: lineNo });
144210
+ if (nextDepth > 1 || delta !== 0) memberHadBrace = true;
144211
+ depth = nextDepth;
144212
+ if (memberHadBrace && depth === 1 || !memberHadBrace && depth === 1 && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*static\s+let\b/.test(maskedLine)) {
144213
+ chunks.push({
144214
+ kind: "enumMember",
144215
+ enumName: activeEnum,
144216
+ key: chunkKey2(memberLines),
144217
+ lines: memberLines
144218
+ });
144219
+ memberLines = [];
144220
+ memberHadBrace = false;
144221
+ }
144222
+ }
144223
+ }
144224
+ if (depth !== 0 || activeEnum !== null || inImplementation || inOpen || pending2.some(
144225
+ (item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
144226
+ ) || chunks.length < shardCount) {
144227
+ return unsharded(name3, source);
144228
+ }
144229
+ const buckets = Array.from({ length: shardCount }, () => []);
144230
+ for (const chunk of chunks) {
144231
+ if (chunk.kind === "enumDecl") {
144232
+ buckets[0].push(chunk);
144233
+ } else {
144234
+ buckets[stableShardIndex(chunk.key, shardCount)].push(chunk);
144235
+ }
144236
+ }
144237
+ const nonEmpty2 = buckets.map((bucket, index2) => ({ bucket, index: index2 })).filter(({ bucket }) => bucket.length > 0);
144238
+ if (nonEmpty2.length < 2) return unsharded(name3, source);
144239
+ const stem2 = name3.slice(0, -".swift".length);
144240
+ return nonEmpty2.map(({ bucket, index: shardIndex }) => {
144241
+ const outLines = [];
144242
+ const lineMap = [];
144243
+ const pushLine = (text7, origLine) => {
144244
+ outLines.push(text7);
144245
+ lineMap.push(origLine);
144246
+ };
144247
+ for (const item of headerLines) pushLine(item.text, item.line);
144248
+ pushLine("", 0);
144249
+ let openEnum = null;
144250
+ let enumBody = [];
144251
+ let hasPart = false;
144252
+ const startPart = () => {
144253
+ if (hasPart) pushLine("", 0);
144254
+ hasPart = true;
144255
+ };
144256
+ const flushEnum = () => {
144257
+ if (!openEnum) return;
144258
+ startPart();
144259
+ pushLine(`extension ${openEnum} {`, enumDeclLine);
144260
+ for (let i = 0; i < enumBody.length; i++) {
144261
+ if (i > 0) pushLine("", 0);
144262
+ for (const item of enumBody[i]) pushLine(item.text, item.line);
144263
+ }
144264
+ pushLine("}", enumDeclLine);
144265
+ openEnum = null;
144266
+ enumBody = [];
144267
+ };
144268
+ for (const chunk of bucket) {
144269
+ if (chunk.kind === "enumMember") {
144270
+ if (openEnum !== chunk.enumName) {
144271
+ flushEnum();
144272
+ openEnum = chunk.enumName;
144273
+ }
144274
+ enumBody.push(chunk.lines);
144275
+ } else {
144276
+ flushEnum();
144277
+ startPart();
144278
+ for (const item of chunk.lines) pushLine(item.text, item.line);
144279
+ }
144280
+ }
144281
+ flushEnum();
144282
+ pushLine("", 0);
144283
+ return {
144284
+ name: `${stem2}_${shardIndex}.swift`,
144285
+ source: outLines.join("\n"),
144286
+ originalName: name3,
144287
+ lineMap
144288
+ };
144289
+ });
144290
+ }
144291
+ var import_node_crypto93, import_node_path157, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
144292
+ var init_one_sdk_shard = __esm({
144293
+ "../peach-globals/build/one-sdk-shard.ts"() {
144294
+ "use strict";
144295
+ import_node_crypto93 = require("node:crypto");
144296
+ import_node_path157 = __toESM(require("node:path"), 1);
144297
+ init_swift_source_mask();
144298
+ ONE_SDK_BINDING_SHARDS = 8;
144299
+ ONE_SDK_BINDING_SHARD_MIN_BYTES = 256 * 1024;
144300
+ }
144301
+ });
144302
+
144014
144303
  // ../peach-globals/build/one-swift-control-source.ts
144015
144304
  function readSchema(one) {
144016
- return JSON.parse((0, import_node_fs155.readFileSync)((0, import_node_path157.join)(one, "schema.json"), "utf8"));
144305
+ return JSON.parse((0, import_node_fs155.readFileSync)((0, import_node_path158.join)(one, "schema.json"), "utf8"));
144017
144306
  }
144018
144307
  function payloadRows(schema4, props, prop) {
144019
144308
  const item = /^ReadonlyArray<(\w+)>$/.exec(props[prop]?.type ?? "")?.[1];
@@ -144168,22 +144457,22 @@ function arrayBindings(name3, body) {
144168
144457
  }
144169
144458
  function componentViews(one, selected) {
144170
144459
  const schema4 = readSchema(one);
144171
- const folders = [(0, import_node_path157.join)(one, "ios/Generated"), (0, import_node_path157.join)(one, "ios")];
144460
+ const folders = [(0, import_node_path158.join)(one, "ios/Generated"), (0, import_node_path158.join)(one, "ios")];
144172
144461
  const files2 = folders.map((folder) => new Set((0, import_node_fs155.readdirSync)(folder)));
144173
144462
  return schema4.components.flatMap(({ name: name3, props, commands: commands2 = {} }) => {
144174
144463
  if (selected && !selected.includes(name3)) return [];
144175
144464
  const file = `${name3}ComponentView.mm`;
144176
144465
  const folder = folders.find((_, index) => files2[index].has(file));
144177
144466
  if (!folder) return [];
144178
- const raw2 = (0, import_node_fs155.readFileSync)((0, import_node_path157.join)(folder, file), "utf8");
144467
+ const raw2 = (0, import_node_fs155.readFileSync)((0, import_node_path158.join)(folder, file), "utf8");
144179
144468
  const view = /\b(_\w+) = \[OneNative\w+View new\]/.exec(raw2)?.[1];
144180
144469
  if (!view) return [];
144181
144470
  const source = raw2.replace(new RegExp(`\\b${view}\\b`, "g"), "_nativeView");
144182
- return [{ name: name3, props, commands: commands2, source, file: (0, import_node_path157.join)(folder, file) }];
144471
+ return [{ name: name3, props, commands: commands2, source, file: (0, import_node_path158.join)(folder, file) }];
144183
144472
  });
144184
144473
  }
144185
144474
  function swiftGuestControls(one, names, linkedGroups) {
144186
- const watched = [(0, import_node_path157.join)(one, "schema.json")];
144475
+ const watched = [(0, import_node_path158.join)(one, "schema.json")];
144187
144476
  const defines = /* @__PURE__ */ new Set();
144188
144477
  const schema4 = readSchema(one);
144189
144478
  const views = componentViews(one, names);
@@ -144198,7 +144487,7 @@ function swiftGuestControls(one, names, linkedGroups) {
144198
144487
  const arrays = arrayBindings(name3, update);
144199
144488
  const conformance = childMounting(viewClass, source);
144200
144489
  if (conformance) conformances.push(conformance);
144201
- const swift = (0, import_node_path157.join)((0, import_node_path157.dirname)(file), viewClass + ".swift");
144490
+ const swift = (0, import_node_path158.join)((0, import_node_path158.dirname)(file), viewClass + ".swift");
144202
144491
  const declaration = (0, import_node_fs155.readFileSync)(swift, "utf8");
144203
144492
  watched.push(file, swift);
144204
144493
  const initializer = /public (?:override )?init\(\)/.test(declaration) ? "()" : "(frame: .zero)";
@@ -144293,12 +144582,12 @@ function swiftGuestControls(one, names, linkedGroups) {
144293
144582
  watched
144294
144583
  };
144295
144584
  }
144296
- var import_node_fs155, import_node_path157, payloadTypes, payloadProp;
144585
+ var import_node_fs155, import_node_path158, payloadTypes, payloadProp;
144297
144586
  var init_one_swift_control_source = __esm({
144298
144587
  "../peach-globals/build/one-swift-control-source.ts"() {
144299
144588
  "use strict";
144300
144589
  import_node_fs155 = require("node:fs");
144301
- import_node_path157 = require("node:path");
144590
+ import_node_path158 = require("node:path");
144302
144591
  payloadTypes = {
144303
144592
  boolean: ["Bool", false],
144304
144593
  "boolean[]": ["[Bool]", []],
@@ -144423,7 +144712,7 @@ function swiftUIControls(one, options2) {
144423
144712
  if (glue.guard && (!groupDefines || groupDefines.has(glue.guard))) {
144424
144713
  activeDefines.add(glue.guard);
144425
144714
  }
144426
- const header2 = (0, import_node_path158.join)(one, "ios", glue.viewClass + ".h");
144715
+ const header2 = (0, import_node_path159.join)(one, "ios", glue.viewClass + ".h");
144427
144716
  return { ...glue, header: (0, import_node_fs156.existsSync)(header2) ? header2 : void 0 };
144428
144717
  });
144429
144718
  const activeControls = controls.filter(
@@ -144443,7 +144732,7 @@ function swiftUIControls(one, options2) {
144443
144732
  for (const [, include] of (0, import_node_fs156.readFileSync)(file, "utf8").matchAll(
144444
144733
  /^#(?:include|import) "([^"]+)"/gm
144445
144734
  )) {
144446
- const dependency = (0, import_node_path158.join)((0, import_node_path158.dirname)(file), include);
144735
+ const dependency = (0, import_node_path159.join)((0, import_node_path159.dirname)(file), include);
144447
144736
  if ((0, import_node_fs156.existsSync)(dependency)) headers.add(dependency);
144448
144737
  }
144449
144738
  }
@@ -144465,7 +144754,7 @@ function swiftUIControls(one, options2) {
144465
144754
  '#include "OneNativeSyncBridge.h"',
144466
144755
  ...controls.flatMap(({ header: header2, guard }) => {
144467
144756
  if (!header2) return [];
144468
- const include = "#import " + JSON.stringify(options2?.basenameImports ? (0, import_node_path158.basename)(header2) : header2);
144757
+ const include = "#import " + JSON.stringify(options2?.basenameImports ? (0, import_node_path159.basename)(header2) : header2);
144469
144758
  return guard ? [`#if ${guard}`, include, "#endif"] : [include];
144470
144759
  }),
144471
144760
  "",
@@ -144504,12 +144793,12 @@ function swiftUIControls(one, options2) {
144504
144793
  defines: [...activeDefines]
144505
144794
  };
144506
144795
  }
144507
- var import_node_fs156, import_node_path158, handwritten, boxes;
144796
+ var import_node_fs156, import_node_path159, handwritten, boxes;
144508
144797
  var init_one_swift_ui_controls = __esm({
144509
144798
  "../peach-globals/build/one-swift-ui-controls.ts"() {
144510
144799
  "use strict";
144511
144800
  import_node_fs156 = require("node:fs");
144512
- import_node_path158 = require("node:path");
144801
+ import_node_path159 = require("node:path");
144513
144802
  init_one_swift_control_source();
144514
144803
  handwritten = /* @__PURE__ */ new Set([
144515
144804
  "OneNativeMenu",
@@ -146940,282 +147229,6 @@ const char* peach_one_swift_ui_commands(const char* namePtr, uint32_t nameLen) {
146940
147229
  }
146941
147230
  });
146942
147231
 
146943
- // src/one-sdk/shard.ts
146944
- function unsharded(name3, source) {
146945
- const lineCount = source.split("\n").length;
146946
- return [
146947
- {
146948
- name: name3,
146949
- source,
146950
- originalName: name3,
146951
- lineMap: Array.from({ length: lineCount }, (_, index) => index + 1)
146952
- }
146953
- ];
146954
- }
146955
- function chunkKey2(lines) {
146956
- for (const { text: text7 } of lines) {
146957
- const trimmed = text7.trim();
146958
- if (trimmed !== "" && !trimmed.startsWith("//")) return trimmed;
146959
- }
146960
- return lines.map((item) => item.text).join("\n");
146961
- }
146962
- function stableShardIndex(key2, shardCount) {
146963
- return (0, import_node_crypto93.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
146964
- }
146965
- function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
146966
- if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
146967
- return unsharded(name3, source);
146968
- }
146969
- const masked = swiftCodeMask(source);
146970
- if (/\bfileprivate\b/.test(masked)) return unsharded(name3, source);
146971
- const lines = source.split("\n");
146972
- const maskedLines = masked.split("\n");
146973
- if (lines.length !== maskedLines.length) return unsharded(name3, source);
146974
- const headerLines = [];
146975
- let index = 0;
146976
- let headerIfDepth = 0;
146977
- while (index < lines.length) {
146978
- const text7 = lines[index];
146979
- const trimmed = text7.trim();
146980
- if (trimmed === "" || trimmed.startsWith("// generated ") || trimmed.startsWith("import ")) {
146981
- headerLines.push({ text: text7, line: index + 1 });
146982
- index++;
146983
- continue;
146984
- }
146985
- if (trimmed.startsWith("#if ")) {
146986
- headerIfDepth++;
146987
- headerLines.push({ text: text7, line: index + 1 });
146988
- index++;
146989
- continue;
146990
- }
146991
- if (headerIfDepth > 0 && (trimmed.startsWith("#elseif ") || trimmed === "#else" || trimmed === "#endif")) {
146992
- if (trimmed === "#endif") headerIfDepth--;
146993
- headerLines.push({ text: text7, line: index + 1 });
146994
- index++;
146995
- continue;
146996
- }
146997
- break;
146998
- }
146999
- if (headerIfDepth !== 0) return unsharded(name3, source);
147000
- while (headerLines.length > 0 && headerLines.at(-1).text.trim() === "") {
147001
- headerLines.pop();
147002
- }
147003
- const chunks = [];
147004
- let depth = 0;
147005
- let pending2 = [];
147006
- let hadBrace = false;
147007
- let inImplementation = false;
147008
- let inOpen = false;
147009
- let openDeclarations = 0;
147010
- let activeEnum = null;
147011
- let enumDeclLine = 0;
147012
- let memberLines = [];
147013
- let memberHadBrace = false;
147014
- for (; index < lines.length; index++) {
147015
- const text7 = lines[index];
147016
- const lineNo = index + 1;
147017
- const maskedLine = maskedLines[index];
147018
- if (depth <= 1 && /^\s*#/.test(maskedLine)) return unsharded(name3, source);
147019
- let delta = 0;
147020
- for (let i = 0; i < maskedLine.length; i++) {
147021
- const ch = maskedLine[i];
147022
- if (ch === "{") delta++;
147023
- else if (ch === "}") delta--;
147024
- }
147025
- if (activeEnum === null) {
147026
- if (depth === 0 && !hadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
147027
- return unsharded(name3, source);
147028
- }
147029
- if (depth === 0 && !hadBrace && !inImplementation && text7.startsWith("// implementation ")) {
147030
- inImplementation = true;
147031
- pending2.push({ text: text7, line: lineNo });
147032
- continue;
147033
- }
147034
- if (inImplementation) {
147035
- pending2.push({ text: text7, line: lineNo });
147036
- depth += delta;
147037
- if (depth < 0) return unsharded(name3, source);
147038
- if (depth === 0 && text7 === "// end implementation") {
147039
- chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
147040
- pending2 = [];
147041
- hadBrace = false;
147042
- inImplementation = false;
147043
- }
147044
- continue;
147045
- }
147046
- if (depth === 0 && !hadBrace && !inOpen && text7.startsWith("// open ")) {
147047
- inOpen = true;
147048
- openDeclarations = 0;
147049
- pending2.push({ text: text7, line: lineNo });
147050
- continue;
147051
- }
147052
- if (inOpen) {
147053
- pending2.push({ text: text7, line: lineNo });
147054
- if (delta !== 0 || depth > 0) hadBrace = true;
147055
- depth += delta;
147056
- if (depth < 0) return unsharded(name3, source);
147057
- if (hadBrace && depth === 0) {
147058
- openDeclarations++;
147059
- hadBrace = false;
147060
- if (openDeclarations === 2) {
147061
- chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
147062
- pending2 = [];
147063
- inOpen = false;
147064
- openDeclarations = 0;
147065
- }
147066
- }
147067
- continue;
147068
- }
147069
- const enumMatch = depth === 0 && !hadBrace && pending2.every(
147070
- (item) => item.text.trim() === "" || item.text.trim().startsWith("//")
147071
- ) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
147072
- if (enumMatch && delta === 1) {
147073
- const enumName = enumMatch[1];
147074
- const prefix = pending2.filter((item) => item.text.trim() !== "");
147075
- enumDeclLine = lineNo;
147076
- chunks.push({
147077
- kind: "enumDecl",
147078
- enumName,
147079
- lines: [...prefix, { text: `enum ${enumName} {}`, line: lineNo }]
147080
- });
147081
- pending2 = [];
147082
- activeEnum = enumName;
147083
- depth = 1;
147084
- continue;
147085
- }
147086
- if (depth === 0 && !hadBrace && text7.trim() === "" && pending2.length === 0) {
147087
- continue;
147088
- }
147089
- pending2.push({ text: text7, line: lineNo });
147090
- if (delta !== 0 || depth > 0) hadBrace = true;
147091
- depth += delta;
147092
- if (depth < 0) return unsharded(name3, source);
147093
- if (hadBrace && depth === 0) {
147094
- chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
147095
- pending2 = [];
147096
- hadBrace = false;
147097
- }
147098
- } else {
147099
- const nextDepth = depth + delta;
147100
- if (nextDepth < 0) return unsharded(name3, source);
147101
- if (depth === 1 && nextDepth === 0) {
147102
- if (memberHadBrace || maskedLine.trim() !== "}") return unsharded(name3, source);
147103
- if (memberLines.some(
147104
- (item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
147105
- )) {
147106
- chunks.push({
147107
- kind: "enumMember",
147108
- enumName: activeEnum,
147109
- key: chunkKey2(memberLines),
147110
- lines: memberLines
147111
- });
147112
- }
147113
- activeEnum = null;
147114
- depth = 0;
147115
- memberLines = [];
147116
- continue;
147117
- }
147118
- if (depth === 1 && !memberHadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
147119
- return unsharded(name3, source);
147120
- }
147121
- if (depth === 1 && !memberHadBrace && text7.trim() === "") {
147122
- depth = nextDepth;
147123
- continue;
147124
- }
147125
- memberLines.push({ text: text7, line: lineNo });
147126
- if (nextDepth > 1 || delta !== 0) memberHadBrace = true;
147127
- depth = nextDepth;
147128
- if (memberHadBrace && depth === 1 || !memberHadBrace && depth === 1 && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*static\s+let\b/.test(maskedLine)) {
147129
- chunks.push({
147130
- kind: "enumMember",
147131
- enumName: activeEnum,
147132
- key: chunkKey2(memberLines),
147133
- lines: memberLines
147134
- });
147135
- memberLines = [];
147136
- memberHadBrace = false;
147137
- }
147138
- }
147139
- }
147140
- if (depth !== 0 || activeEnum !== null || inImplementation || inOpen || pending2.some(
147141
- (item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
147142
- ) || chunks.length < shardCount) {
147143
- return unsharded(name3, source);
147144
- }
147145
- const buckets = Array.from({ length: shardCount }, () => []);
147146
- for (const chunk of chunks) {
147147
- if (chunk.kind === "enumDecl") {
147148
- buckets[0].push(chunk);
147149
- } else {
147150
- buckets[stableShardIndex(chunk.key, shardCount)].push(chunk);
147151
- }
147152
- }
147153
- const nonEmpty2 = buckets.map((bucket, index2) => ({ bucket, index: index2 })).filter(({ bucket }) => bucket.length > 0);
147154
- if (nonEmpty2.length < 2) return unsharded(name3, source);
147155
- const stem2 = name3.slice(0, -".swift".length);
147156
- return nonEmpty2.map(({ bucket, index: shardIndex }) => {
147157
- const outLines = [];
147158
- const lineMap = [];
147159
- const pushLine = (text7, origLine) => {
147160
- outLines.push(text7);
147161
- lineMap.push(origLine);
147162
- };
147163
- for (const item of headerLines) pushLine(item.text, item.line);
147164
- pushLine("", 0);
147165
- let openEnum = null;
147166
- let enumBody = [];
147167
- let hasPart = false;
147168
- const startPart = () => {
147169
- if (hasPart) pushLine("", 0);
147170
- hasPart = true;
147171
- };
147172
- const flushEnum = () => {
147173
- if (!openEnum) return;
147174
- startPart();
147175
- pushLine(`extension ${openEnum} {`, enumDeclLine);
147176
- for (let i = 0; i < enumBody.length; i++) {
147177
- if (i > 0) pushLine("", 0);
147178
- for (const item of enumBody[i]) pushLine(item.text, item.line);
147179
- }
147180
- pushLine("}", enumDeclLine);
147181
- openEnum = null;
147182
- enumBody = [];
147183
- };
147184
- for (const chunk of bucket) {
147185
- if (chunk.kind === "enumMember") {
147186
- if (openEnum !== chunk.enumName) {
147187
- flushEnum();
147188
- openEnum = chunk.enumName;
147189
- }
147190
- enumBody.push(chunk.lines);
147191
- } else {
147192
- flushEnum();
147193
- startPart();
147194
- for (const item of chunk.lines) pushLine(item.text, item.line);
147195
- }
147196
- }
147197
- flushEnum();
147198
- pushLine("", 0);
147199
- return {
147200
- name: `${stem2}_${shardIndex}.swift`,
147201
- source: outLines.join("\n"),
147202
- originalName: name3,
147203
- lineMap
147204
- };
147205
- });
147206
- }
147207
- var import_node_crypto93, import_node_path159, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
147208
- var init_shard = __esm({
147209
- "src/one-sdk/shard.ts"() {
147210
- "use strict";
147211
- import_node_crypto93 = require("node:crypto");
147212
- import_node_path159 = __toESM(require("node:path"), 1);
147213
- init_swift_compile();
147214
- ONE_SDK_BINDING_SHARDS = 8;
147215
- ONE_SDK_BINDING_SHARD_MIN_BYTES = 256 * 1024;
147216
- }
147217
- });
147218
-
147219
147232
  // src/one-sdk/source.ts
147220
147233
  var oneSDKModule, oneSDKHost, oneSDKApp, oneSDKTransport;
147221
147234
  var init_source2 = __esm({
@@ -148384,10 +148397,10 @@ var init_one_native_controls_package = __esm({
148384
148397
  import_node_path160 = __toESM(require("node:path"), 1);
148385
148398
  import_node_url8 = require("node:url");
148386
148399
  init_nativeSourceContract();
148400
+ init_one_sdk_shard();
148387
148401
  init_one_swift_control_source();
148388
148402
  init_one_swift_ui_controls();
148389
148403
  init_one_direct_host_source();
148390
- init_shard();
148391
148404
  init_source2();
148392
148405
  init_oneNativeControlsContract2();
148393
148406
  init_swift_compile();
@@ -153537,7 +153550,7 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
153537
153550
  if (typeof checksum !== "string" || !/^[a-f0-9]{40}$/.test(checksum))
153538
153551
  throw new Error(`${lockFile}: missing checksum for ${root}`);
153539
153552
  const file = import_node_path178.default.join(
153540
- cacheDir(),
153553
+ swiftCacheDir(),
153541
153554
  "swift-source-pods",
153542
153555
  "specifications",
153543
153556
  `${checksum}.json`
@@ -153680,7 +153693,7 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
153680
153693
  Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
153681
153694
  )
153682
153695
  ).digest("hex");
153683
- const work = import_node_path178.default.join(cacheDir(), "swift-source-pods", key2);
153696
+ const work = import_node_path178.default.join(swiftCacheDir(), "swift-source-pods", key2);
153684
153697
  return withSwiftRootLock(work, async () => {
153685
153698
  const ios = import_node_path178.default.join(work, "ios");
153686
153699
  const complete = import_node_path178.default.join(work, "pods-installed");
@@ -153752,12 +153765,12 @@ var init_swift_source_pods = __esm({
153752
153765
  import_node_fs174 = __toESM(require("node:fs"), 1);
153753
153766
  import_node_path178 = __toESM(require("node:path"), 1);
153754
153767
  init_browser();
153755
- init_home_paths();
153756
153768
  init_pod_lockfile();
153757
153769
  init_pods_install();
153758
153770
  init_swift_host();
153759
153771
  init_swift_package();
153760
153772
  init_swift_root_lock();
153773
+ init_swift_toolchain();
153761
153774
  init_xcode_project();
153762
153775
  APP = "PeachPodDependencies";
153763
153776
  record5 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
@@ -154708,7 +154721,7 @@ var init_nitro_superset = __esm({
154708
154721
  init_nitroContract();
154709
154722
  init_swift_standin_digest();
154710
154723
  NITRO_SUPERSET_ENTRY_NAME = "superset";
154711
- NITRO_COMPILER_DIGEST = true ? "bbe658f7e2c352f47d2e139b1ee4adb8b1944071676dd2de1401c6f637eaf9f6" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
154724
+ NITRO_COMPILER_DIGEST = true ? "2bd4530ba3bae000e41dcb8e8c3d99b7cef19a11f4e14afedde939ee1f14828f" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
154712
154725
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
154713
154726
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
154714
154727
  published3 = /* @__PURE__ */ new Map();
@@ -155128,10 +155141,10 @@ var init_one_sdk_bundle = __esm({
155128
155141
  import_node_crypto109 = require("node:crypto");
155129
155142
  import_node_fs179 = __toESM(require("node:fs"), 1);
155130
155143
  import_node_path184 = __toESM(require("node:path"), 1);
155144
+ init_one_sdk_shard();
155131
155145
  init_expo_native_workspace();
155132
155146
  init_nitro_bundle();
155133
155147
  init_one_sdk_preparation();
155134
- init_shard();
155135
155148
  init_source2();
155136
155149
  init_oneSdkContract();
155137
155150
  init_swift_compile();