peachsim 0.1.2747 → 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 (130) 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 +2 -2
  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 +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +3888 -3879
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-264PERTU.mjs → acorn-VEWLHGUF.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-OS777HDT.mjs → chunk-4QUOVEXG.mjs} +3 -3
  28. package/dist-lib/esm-chunks/{chunk-6A6ESU7M.mjs → chunk-62Z4HAA5.mjs} +16 -15
  29. package/dist-lib/esm-chunks/{chunk-VBVWVPFV.mjs → chunk-6ZVR2CVC.mjs} +1 -1
  30. package/dist-lib/esm-chunks/{chunk-RQYO274I.mjs → chunk-A2EC74CI.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-H5VBNND3.mjs → chunk-BYYBOHZI.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-UX3TKSSG.mjs → chunk-C6IVVMZN.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-SSEYL4BD.mjs → chunk-GWZFPIGW.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-OGKCUDUY.mjs → chunk-HMPLB7MA.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-DKOHFKVO.mjs → chunk-HPANCGMI.mjs} +2 -2
  36. package/dist-lib/esm-chunks/{chunk-BTOHCTM5.mjs → chunk-HRS3DSAZ.mjs} +6 -6
  37. package/dist-lib/esm-chunks/{chunk-LETYBISI.mjs → chunk-I3KV46CL.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-3PIRJQS3.mjs → chunk-IE2LTKEG.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-YL5WAVSA.mjs → chunk-KD3TI7UV.mjs} +4 -4
  40. package/dist-lib/esm-chunks/{chunk-DNPF3SJV.mjs → chunk-KNNMOD5T.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-NGFHBDMP.mjs → chunk-NNVYKFSY.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-SZAKV76H.mjs → chunk-RU7J2QST.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-V5QS3LC7.mjs → chunk-TQACQLZ6.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-VFVDWLZL.mjs → chunk-TW5FZFU7.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-SNIXC3LK.mjs → chunk-U5SZIAIF.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-C4WNCPE7.mjs → chunk-UFQHPARI.mjs} +119 -115
  47. package/dist-lib/esm-chunks/{chunk-R5URHHLY.mjs → chunk-UNOAFCHH.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-AASYNA7O.mjs → chunk-VKYISXKK.mjs} +5 -5
  49. package/dist-lib/esm-chunks/{chunk-2KP4Q4QG.mjs → chunk-WN22FGGA.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-ZGKZH72O.mjs → chunk-XM3QYC5V.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{metro-layout-parser-X53TI6UE.mjs → metro-layout-parser-B74NVOKQ.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-BCWD6FXB.mjs → swift-package-prebuilt-B4QBXBQL.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-PVYYHAOX.mjs → swift-sdk-app-module-5OCMAJPP.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-YU237KAS.mjs → swift-sdk-image-LQKEASAW.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-E6S3PF4W.mjs → swift-sdk-image-producer-ZMYZXL7Z.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +124 -115
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +415 -406
  61. package/dist-lib/host/fetch-proxy-handler.cjs +13 -4
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +1 -1
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +1 -1
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +86 -85
  87. package/dist-lib/public-origins-lib.json +73 -67
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +415 -406
  95. package/dist-lib/swift-compile.cjs +120 -111
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/dist-types/packages/peach-engine/src/engine/native-paint-facts.d.ts +3 -1
  123. package/dist-types/packages/peach-engine/src/engine/paint-value-input.d.ts +7 -0
  124. package/dist-types/packages/peach-engine/src/engine/scene-native-binding.d.ts +1 -1
  125. package/package.json +1 -1
  126. package/src/one-native-controls-package.ts +5 -5
  127. package/src/one-sdk-bundle.ts +1 -1
  128. package/src/swift-compiler-digest.ts +1 -0
  129. package/src/swift-sdk-surface.ts +1 -117
  130. package/src/one-sdk/shard.ts +0 -382
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2747 | (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 ? "1d379c993a4ab46df34e228b947e5bc2f147e380681003e0ecb273b850b268c8" : 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 ? "449a35ec7ad01659287f7f7e946f273628a81be66730c25860e91a2cca5dbe20" : 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 ? "1ee4157c2e2c2a3239f846f3b0a62feac47c4edd5286649948b76434f927ec66" : 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";
@@ -72474,6 +72482,7 @@ var init_swift_sdk_surface = __esm({
72474
72482
  import_node_fs70 = require("node:fs");
72475
72483
  import_node_os12 = __toESM(require("node:os"), 1);
72476
72484
  import_node_path68 = __toESM(require("node:path"), 1);
72485
+ init_swift_source_mask();
72477
72486
  init_admitted_mac_build();
72478
72487
  init_swift_distribution_contract();
72479
72488
  init_swift_package();
@@ -84772,7 +84781,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
84772
84781
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
84773
84782
  MULTI_MANIFEST_VERSION = 76;
84774
84783
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
84775
- compilerSourceDigest = true ? "829c0da5595c8616a9a93acdc6f36f11813464ad7d0a9498a748787c5b901499" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
84784
+ compilerSourceDigest = true ? "9e800b4e5695e0ea16860a945e2ba4dd9efa69f299d64b77b74c6197d9d31df6" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
84776
84785
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
84777
84786
  MODULE_MAP_RESPONSE_FILE_RUN = 16;
84778
84787
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
@@ -144015,9 +144024,285 @@ var init_nativeSourceContract = __esm({
144015
144024
  }
144016
144025
  });
144017
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
+
144018
144303
  // ../peach-globals/build/one-swift-control-source.ts
144019
144304
  function readSchema(one) {
144020
- 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"));
144021
144306
  }
144022
144307
  function payloadRows(schema4, props, prop) {
144023
144308
  const item = /^ReadonlyArray<(\w+)>$/.exec(props[prop]?.type ?? "")?.[1];
@@ -144172,22 +144457,22 @@ function arrayBindings(name3, body) {
144172
144457
  }
144173
144458
  function componentViews(one, selected) {
144174
144459
  const schema4 = readSchema(one);
144175
- 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")];
144176
144461
  const files2 = folders.map((folder) => new Set((0, import_node_fs155.readdirSync)(folder)));
144177
144462
  return schema4.components.flatMap(({ name: name3, props, commands: commands2 = {} }) => {
144178
144463
  if (selected && !selected.includes(name3)) return [];
144179
144464
  const file = `${name3}ComponentView.mm`;
144180
144465
  const folder = folders.find((_, index) => files2[index].has(file));
144181
144466
  if (!folder) return [];
144182
- 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");
144183
144468
  const view = /\b(_\w+) = \[OneNative\w+View new\]/.exec(raw2)?.[1];
144184
144469
  if (!view) return [];
144185
144470
  const source = raw2.replace(new RegExp(`\\b${view}\\b`, "g"), "_nativeView");
144186
- 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) }];
144187
144472
  });
144188
144473
  }
144189
144474
  function swiftGuestControls(one, names, linkedGroups) {
144190
- const watched = [(0, import_node_path157.join)(one, "schema.json")];
144475
+ const watched = [(0, import_node_path158.join)(one, "schema.json")];
144191
144476
  const defines = /* @__PURE__ */ new Set();
144192
144477
  const schema4 = readSchema(one);
144193
144478
  const views = componentViews(one, names);
@@ -144202,7 +144487,7 @@ function swiftGuestControls(one, names, linkedGroups) {
144202
144487
  const arrays = arrayBindings(name3, update);
144203
144488
  const conformance = childMounting(viewClass, source);
144204
144489
  if (conformance) conformances.push(conformance);
144205
- 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");
144206
144491
  const declaration = (0, import_node_fs155.readFileSync)(swift, "utf8");
144207
144492
  watched.push(file, swift);
144208
144493
  const initializer = /public (?:override )?init\(\)/.test(declaration) ? "()" : "(frame: .zero)";
@@ -144297,12 +144582,12 @@ function swiftGuestControls(one, names, linkedGroups) {
144297
144582
  watched
144298
144583
  };
144299
144584
  }
144300
- var import_node_fs155, import_node_path157, payloadTypes, payloadProp;
144585
+ var import_node_fs155, import_node_path158, payloadTypes, payloadProp;
144301
144586
  var init_one_swift_control_source = __esm({
144302
144587
  "../peach-globals/build/one-swift-control-source.ts"() {
144303
144588
  "use strict";
144304
144589
  import_node_fs155 = require("node:fs");
144305
- import_node_path157 = require("node:path");
144590
+ import_node_path158 = require("node:path");
144306
144591
  payloadTypes = {
144307
144592
  boolean: ["Bool", false],
144308
144593
  "boolean[]": ["[Bool]", []],
@@ -144427,7 +144712,7 @@ function swiftUIControls(one, options2) {
144427
144712
  if (glue.guard && (!groupDefines || groupDefines.has(glue.guard))) {
144428
144713
  activeDefines.add(glue.guard);
144429
144714
  }
144430
- 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");
144431
144716
  return { ...glue, header: (0, import_node_fs156.existsSync)(header2) ? header2 : void 0 };
144432
144717
  });
144433
144718
  const activeControls = controls.filter(
@@ -144447,7 +144732,7 @@ function swiftUIControls(one, options2) {
144447
144732
  for (const [, include] of (0, import_node_fs156.readFileSync)(file, "utf8").matchAll(
144448
144733
  /^#(?:include|import) "([^"]+)"/gm
144449
144734
  )) {
144450
- 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);
144451
144736
  if ((0, import_node_fs156.existsSync)(dependency)) headers.add(dependency);
144452
144737
  }
144453
144738
  }
@@ -144469,7 +144754,7 @@ function swiftUIControls(one, options2) {
144469
144754
  '#include "OneNativeSyncBridge.h"',
144470
144755
  ...controls.flatMap(({ header: header2, guard }) => {
144471
144756
  if (!header2) return [];
144472
- 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);
144473
144758
  return guard ? [`#if ${guard}`, include, "#endif"] : [include];
144474
144759
  }),
144475
144760
  "",
@@ -144508,12 +144793,12 @@ function swiftUIControls(one, options2) {
144508
144793
  defines: [...activeDefines]
144509
144794
  };
144510
144795
  }
144511
- var import_node_fs156, import_node_path158, handwritten, boxes;
144796
+ var import_node_fs156, import_node_path159, handwritten, boxes;
144512
144797
  var init_one_swift_ui_controls = __esm({
144513
144798
  "../peach-globals/build/one-swift-ui-controls.ts"() {
144514
144799
  "use strict";
144515
144800
  import_node_fs156 = require("node:fs");
144516
- import_node_path158 = require("node:path");
144801
+ import_node_path159 = require("node:path");
144517
144802
  init_one_swift_control_source();
144518
144803
  handwritten = /* @__PURE__ */ new Set([
144519
144804
  "OneNativeMenu",
@@ -146944,282 +147229,6 @@ const char* peach_one_swift_ui_commands(const char* namePtr, uint32_t nameLen) {
146944
147229
  }
146945
147230
  });
146946
147231
 
146947
- // src/one-sdk/shard.ts
146948
- function unsharded(name3, source) {
146949
- const lineCount = source.split("\n").length;
146950
- return [
146951
- {
146952
- name: name3,
146953
- source,
146954
- originalName: name3,
146955
- lineMap: Array.from({ length: lineCount }, (_, index) => index + 1)
146956
- }
146957
- ];
146958
- }
146959
- function chunkKey2(lines) {
146960
- for (const { text: text7 } of lines) {
146961
- const trimmed = text7.trim();
146962
- if (trimmed !== "" && !trimmed.startsWith("//")) return trimmed;
146963
- }
146964
- return lines.map((item) => item.text).join("\n");
146965
- }
146966
- function stableShardIndex(key2, shardCount) {
146967
- return (0, import_node_crypto93.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
146968
- }
146969
- function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
146970
- if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
146971
- return unsharded(name3, source);
146972
- }
146973
- const masked = swiftCodeMask(source);
146974
- if (/\bfileprivate\b/.test(masked)) return unsharded(name3, source);
146975
- const lines = source.split("\n");
146976
- const maskedLines = masked.split("\n");
146977
- if (lines.length !== maskedLines.length) return unsharded(name3, source);
146978
- const headerLines = [];
146979
- let index = 0;
146980
- let headerIfDepth = 0;
146981
- while (index < lines.length) {
146982
- const text7 = lines[index];
146983
- const trimmed = text7.trim();
146984
- if (trimmed === "" || trimmed.startsWith("// generated ") || trimmed.startsWith("import ")) {
146985
- headerLines.push({ text: text7, line: index + 1 });
146986
- index++;
146987
- continue;
146988
- }
146989
- if (trimmed.startsWith("#if ")) {
146990
- headerIfDepth++;
146991
- headerLines.push({ text: text7, line: index + 1 });
146992
- index++;
146993
- continue;
146994
- }
146995
- if (headerIfDepth > 0 && (trimmed.startsWith("#elseif ") || trimmed === "#else" || trimmed === "#endif")) {
146996
- if (trimmed === "#endif") headerIfDepth--;
146997
- headerLines.push({ text: text7, line: index + 1 });
146998
- index++;
146999
- continue;
147000
- }
147001
- break;
147002
- }
147003
- if (headerIfDepth !== 0) return unsharded(name3, source);
147004
- while (headerLines.length > 0 && headerLines.at(-1).text.trim() === "") {
147005
- headerLines.pop();
147006
- }
147007
- const chunks = [];
147008
- let depth = 0;
147009
- let pending2 = [];
147010
- let hadBrace = false;
147011
- let inImplementation = false;
147012
- let inOpen = false;
147013
- let openDeclarations = 0;
147014
- let activeEnum = null;
147015
- let enumDeclLine = 0;
147016
- let memberLines = [];
147017
- let memberHadBrace = false;
147018
- for (; index < lines.length; index++) {
147019
- const text7 = lines[index];
147020
- const lineNo = index + 1;
147021
- const maskedLine = maskedLines[index];
147022
- if (depth <= 1 && /^\s*#/.test(maskedLine)) return unsharded(name3, source);
147023
- let delta = 0;
147024
- for (let i = 0; i < maskedLine.length; i++) {
147025
- const ch = maskedLine[i];
147026
- if (ch === "{") delta++;
147027
- else if (ch === "}") delta--;
147028
- }
147029
- if (activeEnum === null) {
147030
- if (depth === 0 && !hadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
147031
- return unsharded(name3, source);
147032
- }
147033
- if (depth === 0 && !hadBrace && !inImplementation && text7.startsWith("// implementation ")) {
147034
- inImplementation = true;
147035
- pending2.push({ text: text7, line: lineNo });
147036
- continue;
147037
- }
147038
- if (inImplementation) {
147039
- pending2.push({ text: text7, line: lineNo });
147040
- depth += delta;
147041
- if (depth < 0) return unsharded(name3, source);
147042
- if (depth === 0 && text7 === "// end implementation") {
147043
- chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
147044
- pending2 = [];
147045
- hadBrace = false;
147046
- inImplementation = false;
147047
- }
147048
- continue;
147049
- }
147050
- if (depth === 0 && !hadBrace && !inOpen && text7.startsWith("// open ")) {
147051
- inOpen = true;
147052
- openDeclarations = 0;
147053
- pending2.push({ text: text7, line: lineNo });
147054
- continue;
147055
- }
147056
- if (inOpen) {
147057
- pending2.push({ text: text7, line: lineNo });
147058
- if (delta !== 0 || depth > 0) hadBrace = true;
147059
- depth += delta;
147060
- if (depth < 0) return unsharded(name3, source);
147061
- if (hadBrace && depth === 0) {
147062
- openDeclarations++;
147063
- hadBrace = false;
147064
- if (openDeclarations === 2) {
147065
- chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
147066
- pending2 = [];
147067
- inOpen = false;
147068
- openDeclarations = 0;
147069
- }
147070
- }
147071
- continue;
147072
- }
147073
- const enumMatch = depth === 0 && !hadBrace && pending2.every(
147074
- (item) => item.text.trim() === "" || item.text.trim().startsWith("//")
147075
- ) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
147076
- if (enumMatch && delta === 1) {
147077
- const enumName = enumMatch[1];
147078
- const prefix = pending2.filter((item) => item.text.trim() !== "");
147079
- enumDeclLine = lineNo;
147080
- chunks.push({
147081
- kind: "enumDecl",
147082
- enumName,
147083
- lines: [...prefix, { text: `enum ${enumName} {}`, line: lineNo }]
147084
- });
147085
- pending2 = [];
147086
- activeEnum = enumName;
147087
- depth = 1;
147088
- continue;
147089
- }
147090
- if (depth === 0 && !hadBrace && text7.trim() === "" && pending2.length === 0) {
147091
- continue;
147092
- }
147093
- pending2.push({ text: text7, line: lineNo });
147094
- if (delta !== 0 || depth > 0) hadBrace = true;
147095
- depth += delta;
147096
- if (depth < 0) return unsharded(name3, source);
147097
- if (hadBrace && depth === 0) {
147098
- chunks.push({ kind: "top", key: chunkKey2(pending2), lines: pending2 });
147099
- pending2 = [];
147100
- hadBrace = false;
147101
- }
147102
- } else {
147103
- const nextDepth = depth + delta;
147104
- if (nextDepth < 0) return unsharded(name3, source);
147105
- if (depth === 1 && nextDepth === 0) {
147106
- if (memberHadBrace || maskedLine.trim() !== "}") return unsharded(name3, source);
147107
- if (memberLines.some(
147108
- (item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
147109
- )) {
147110
- chunks.push({
147111
- kind: "enumMember",
147112
- enumName: activeEnum,
147113
- key: chunkKey2(memberLines),
147114
- lines: memberLines
147115
- });
147116
- }
147117
- activeEnum = null;
147118
- depth = 0;
147119
- memberLines = [];
147120
- continue;
147121
- }
147122
- if (depth === 1 && !memberHadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
147123
- return unsharded(name3, source);
147124
- }
147125
- if (depth === 1 && !memberHadBrace && text7.trim() === "") {
147126
- depth = nextDepth;
147127
- continue;
147128
- }
147129
- memberLines.push({ text: text7, line: lineNo });
147130
- if (nextDepth > 1 || delta !== 0) memberHadBrace = true;
147131
- depth = nextDepth;
147132
- if (memberHadBrace && depth === 1 || !memberHadBrace && depth === 1 && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*static\s+let\b/.test(maskedLine)) {
147133
- chunks.push({
147134
- kind: "enumMember",
147135
- enumName: activeEnum,
147136
- key: chunkKey2(memberLines),
147137
- lines: memberLines
147138
- });
147139
- memberLines = [];
147140
- memberHadBrace = false;
147141
- }
147142
- }
147143
- }
147144
- if (depth !== 0 || activeEnum !== null || inImplementation || inOpen || pending2.some(
147145
- (item) => item.text.trim() !== "" && !item.text.trim().startsWith("//")
147146
- ) || chunks.length < shardCount) {
147147
- return unsharded(name3, source);
147148
- }
147149
- const buckets = Array.from({ length: shardCount }, () => []);
147150
- for (const chunk of chunks) {
147151
- if (chunk.kind === "enumDecl") {
147152
- buckets[0].push(chunk);
147153
- } else {
147154
- buckets[stableShardIndex(chunk.key, shardCount)].push(chunk);
147155
- }
147156
- }
147157
- const nonEmpty2 = buckets.map((bucket, index2) => ({ bucket, index: index2 })).filter(({ bucket }) => bucket.length > 0);
147158
- if (nonEmpty2.length < 2) return unsharded(name3, source);
147159
- const stem2 = name3.slice(0, -".swift".length);
147160
- return nonEmpty2.map(({ bucket, index: shardIndex }) => {
147161
- const outLines = [];
147162
- const lineMap = [];
147163
- const pushLine = (text7, origLine) => {
147164
- outLines.push(text7);
147165
- lineMap.push(origLine);
147166
- };
147167
- for (const item of headerLines) pushLine(item.text, item.line);
147168
- pushLine("", 0);
147169
- let openEnum = null;
147170
- let enumBody = [];
147171
- let hasPart = false;
147172
- const startPart = () => {
147173
- if (hasPart) pushLine("", 0);
147174
- hasPart = true;
147175
- };
147176
- const flushEnum = () => {
147177
- if (!openEnum) return;
147178
- startPart();
147179
- pushLine(`extension ${openEnum} {`, enumDeclLine);
147180
- for (let i = 0; i < enumBody.length; i++) {
147181
- if (i > 0) pushLine("", 0);
147182
- for (const item of enumBody[i]) pushLine(item.text, item.line);
147183
- }
147184
- pushLine("}", enumDeclLine);
147185
- openEnum = null;
147186
- enumBody = [];
147187
- };
147188
- for (const chunk of bucket) {
147189
- if (chunk.kind === "enumMember") {
147190
- if (openEnum !== chunk.enumName) {
147191
- flushEnum();
147192
- openEnum = chunk.enumName;
147193
- }
147194
- enumBody.push(chunk.lines);
147195
- } else {
147196
- flushEnum();
147197
- startPart();
147198
- for (const item of chunk.lines) pushLine(item.text, item.line);
147199
- }
147200
- }
147201
- flushEnum();
147202
- pushLine("", 0);
147203
- return {
147204
- name: `${stem2}_${shardIndex}.swift`,
147205
- source: outLines.join("\n"),
147206
- originalName: name3,
147207
- lineMap
147208
- };
147209
- });
147210
- }
147211
- var import_node_crypto93, import_node_path159, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
147212
- var init_shard = __esm({
147213
- "src/one-sdk/shard.ts"() {
147214
- "use strict";
147215
- import_node_crypto93 = require("node:crypto");
147216
- import_node_path159 = __toESM(require("node:path"), 1);
147217
- init_swift_compile();
147218
- ONE_SDK_BINDING_SHARDS = 8;
147219
- ONE_SDK_BINDING_SHARD_MIN_BYTES = 256 * 1024;
147220
- }
147221
- });
147222
-
147223
147232
  // src/one-sdk/source.ts
147224
147233
  var oneSDKModule, oneSDKHost, oneSDKApp, oneSDKTransport;
147225
147234
  var init_source2 = __esm({
@@ -148388,10 +148397,10 @@ var init_one_native_controls_package = __esm({
148388
148397
  import_node_path160 = __toESM(require("node:path"), 1);
148389
148398
  import_node_url8 = require("node:url");
148390
148399
  init_nativeSourceContract();
148400
+ init_one_sdk_shard();
148391
148401
  init_one_swift_control_source();
148392
148402
  init_one_swift_ui_controls();
148393
148403
  init_one_direct_host_source();
148394
- init_shard();
148395
148404
  init_source2();
148396
148405
  init_oneNativeControlsContract2();
148397
148406
  init_swift_compile();
@@ -154712,7 +154721,7 @@ var init_nitro_superset = __esm({
154712
154721
  init_nitroContract();
154713
154722
  init_swift_standin_digest();
154714
154723
  NITRO_SUPERSET_ENTRY_NAME = "superset";
154715
- NITRO_COMPILER_DIGEST = true ? "26243d019e44fc31d5805948a001484c567d4054a533e6b14989dc30afef6bf5" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
154724
+ NITRO_COMPILER_DIGEST = true ? "2bd4530ba3bae000e41dcb8e8c3d99b7cef19a11f4e14afedde939ee1f14828f" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
154716
154725
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
154717
154726
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
154718
154727
  published3 = /* @__PURE__ */ new Map();
@@ -155132,10 +155141,10 @@ var init_one_sdk_bundle = __esm({
155132
155141
  import_node_crypto109 = require("node:crypto");
155133
155142
  import_node_fs179 = __toESM(require("node:fs"), 1);
155134
155143
  import_node_path184 = __toESM(require("node:path"), 1);
155144
+ init_one_sdk_shard();
155135
155145
  init_expo_native_workspace();
155136
155146
  init_nitro_bundle();
155137
155147
  init_one_sdk_preparation();
155138
- init_shard();
155139
155148
  init_source2();
155140
155149
  init_oneSdkContract();
155141
155150
  init_swift_compile();