peachsim 0.1.1967 → 0.1.1968

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 (83) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +1 -1
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +58 -12
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +56 -10
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +57 -11
  31. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +2 -2
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +2 -2
  47. package/dist-lib/native-app-identity-project.cjs +2 -2
  48. package/dist-lib/native-app-identity-project.mjs +2 -2
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/pdfium-raster.cjs +1 -1
  54. package/dist-lib/pdfium-raster.mjs +1 -1
  55. package/dist-lib/plist.cjs +1 -1
  56. package/dist-lib/plist.mjs +1 -1
  57. package/dist-lib/profiles.cjs +1 -1
  58. package/dist-lib/public-brand.cjs +1 -1
  59. package/dist-lib/public-origins-lib-esm.json +24 -24
  60. package/dist-lib/public-origins-lib.json +53 -53
  61. package/dist-lib/react-native-host-modules.cjs +1 -1
  62. package/dist-lib/react-native-host-modules.mjs +1 -1
  63. package/dist-lib/reap-browser.cjs +1 -1
  64. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  65. package/dist-lib/sdk.cjs +1 -1
  66. package/dist-lib/sdk.mjs +1 -1
  67. package/dist-lib/skills.cjs +58 -12
  68. package/dist-lib/swift-compile.cjs +2 -2
  69. package/dist-lib/swift-compile.mjs +2 -2
  70. package/dist-lib/swift-package.cjs +1 -1
  71. package/dist-lib/swift-package.mjs +1 -1
  72. package/dist-lib/swift-submit.cjs +1 -1
  73. package/dist-lib/swift-submit.mjs +1 -1
  74. package/dist-lib/swift-toolchain.cjs +1 -1
  75. package/dist-lib/swift.cjs +1 -1
  76. package/dist-lib/vite-swift.cjs +55 -9
  77. package/dist-lib/vite.cjs +1 -1
  78. package/dist-lib/worklet-executable.cjs +1 -1
  79. package/dist-lib/worklet-executable.mjs +1 -1
  80. package/package.json +1 -1
  81. package/src/swift-objc-standin.ts +53 -3
  82. package/src/swift-standin-emit.ts +4 -1
  83. package/src/swift-standins.ts +7 -1
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-compile.ts
4
4
  import {
@@ -12359,7 +12359,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
12359
12359
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
12360
12360
  var MULTI_MANIFEST_VERSION = 66;
12361
12361
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
12362
- var compilerSourceDigest = true ? "2e5698309de758f9fcfd857f44c8fe794ab3ef36f7b28f6a042e4326bbc8113a" : swiftCompilerSourceDigest(import.meta.dirname);
12362
+ var compilerSourceDigest = true ? "4c6d0c445f1c9d7fab6a4d2bbd910ec116536acc8d1aa621f70c74c10dd9faba" : swiftCompilerSourceDigest(import.meta.dirname);
12363
12363
  function swiftArtifactHash(input, release, moduleRoot) {
12364
12364
  const hash = createHash13("sha256");
12365
12365
  hash.update(`swift-compile
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/swift-package.ts
4
4
  function swiftManifestSettings(target) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/is-record.ts
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (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;
@@ -6288,7 +6288,10 @@ function emitSwiftStandin(sourceGraphs, options) {
6288
6288
  const parts = fallback.split(".");
6289
6289
  const module2 = parts[0] === "SwiftUICore" ? "SwiftUI" : parts[0];
6290
6290
  const unqualified = parts.slice(1).join(".") || parts[0];
6291
- const name3 = family.has(parts[0]) && parts[0] !== "SwiftUICore" ? parts.join(".") : unqualified;
6291
+ const name3 = parts.length > 1 && family.has(parts[0]) && parts[0] !== "SwiftUICore" ? (
6292
+ // a module selector reaches past a class named like its module
6293
+ `${parts[0]}::${unqualified}`
6294
+ ) : unqualified;
6292
6295
  return { name: name3, module: module2, local: false };
6293
6296
  };
6294
6297
  const nsObject = nameOf("c:objc(cs)NSObject", "ObjectiveC.NSObject").name;
@@ -7315,6 +7318,15 @@ function stripDefaults(decl) {
7315
7318
  }
7316
7319
 
7317
7320
  // src/swift-objc-standin.ts
7321
+ var REFINED_CONSTANT_TYPES = /* @__PURE__ */ new Map([
7322
+ ["NSInteger", "Int"],
7323
+ ["NSUInteger", "UInt"],
7324
+ ["NSTimeInterval", "TimeInterval"],
7325
+ ["double", "Double"],
7326
+ ["CGFloat", "CGFloat"],
7327
+ ["BOOL", "Bool"],
7328
+ ["NSString*", "String"]
7329
+ ]);
7318
7330
  var NATIVE_GRAPH_SDK_VERSION = "27.1";
7319
7331
  var WASI_EMULATION = [
7320
7332
  "_WASI_EMULATED_SIGNAL",
@@ -7613,9 +7625,13 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
7613
7625
  import_node_fs7.default.mkdirSync(import_node_path7.default.join(frameworks, `${surface.module}.framework`, "Modules"), {
7614
7626
  recursive: true
7615
7627
  });
7616
- import_node_fs7.default.copyFileSync(
7617
- surface.modulemap,
7618
- import_node_path7.default.join(frameworks, `${surface.module}.framework`, "Modules", "module.modulemap")
7628
+ const modulemap = import_node_fs7.default.readFileSync(surface.modulemap, "utf8");
7629
+ import_node_fs7.default.writeFileSync(
7630
+ import_node_path7.default.join(frameworks, `${surface.module}.framework`, "Modules", "module.modulemap"),
7631
+ surface.interface ? modulemap.replace(
7632
+ new RegExp(`\\n\\s*module\\s+${surface.module}\\.Swift\\s*\\{[^}]*\\}`),
7633
+ ""
7634
+ ) : modulemap
7619
7635
  );
7620
7636
  if (surface.interface) {
7621
7637
  const from = import_node_path7.default.dirname(surface.interface);
@@ -7631,7 +7647,7 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
7631
7647
  interfaceCopies.push(import_node_path7.default.join(to, name3));
7632
7648
  import_node_fs7.default.writeFileSync(
7633
7649
  import_node_path7.default.join(to, name3),
7634
- import_node_fs7.default.readFileSync(import_node_path7.default.join(from, name3), "utf8").replace(/\bCoreFoundation\.(?=CG)/g, "CoreGraphics.").replace(/\bCoreFoundation\.(?=\w)/g, "Foundation.").replace(
7650
+ import_node_fs7.default.readFileSync(import_node_path7.default.join(from, name3), "utf8").replace(/\bCoreFoundation\.(?=CG)/g, "CoreGraphics.").replace(/\bCoreFoundation\.(?=\w)/g, "Foundation.").replace(/\bDarwin\.OSStatus\b/g, "Swift.Int32").replace(
7635
7651
  /\bFoundation\.Data\.(?=Base64(?:En|De)codingOptions\b)/g,
7636
7652
  "Foundation.NSData."
7637
7653
  )
@@ -7985,6 +8001,30 @@ function objcView(surface, toolchainBin, stdlib, cacheDir5, work, original, vend
7985
8001
  inherit(pairs[Number(match[1])].superclass[0], "s:s8SendableP");
7986
8002
  }
7987
8003
  }
8004
+ const refined = [...originals.values()].flatMap(
8005
+ (text5) => [
8006
+ ...text5.matchAll(
8007
+ /\b(?:FOUNDATION_EXTERN|FOUNDATION_EXPORT|extern)\s+([\w\s*]+?)\s+const\s+(\w+)\s+NS_REFINED_FOR_SWIFT\s*;/g
8008
+ )
8009
+ ].flatMap(([, ctype, name3]) => {
8010
+ const type = REFINED_CONSTANT_TYPES.get(ctype.replace(/\s+/g, ""));
8011
+ if (!type) return [];
8012
+ return [
8013
+ {
8014
+ kind: { identifier: "swift.var" },
8015
+ identifier: { precise: `c:@${name3}` },
8016
+ pathComponents: [`__${name3}`],
8017
+ declarationFragments: [
8018
+ { kind: "keyword", spelling: "let" },
8019
+ { kind: "text", spelling: ` __${name3}: ${type}` }
8020
+ ],
8021
+ accessLevel: "public"
8022
+ }
8023
+ ];
8024
+ })
8025
+ );
8026
+ if (refined.length > 0)
8027
+ graphs.push({ module: { name: surface.module }, symbols: refined, relationships: [] });
7988
8028
  const imports2 = /* @__PURE__ */ new Set(["Foundation", "UIKit"]);
7989
8029
  for (const text5 of originals.values())
7990
8030
  for (const name3 of clangImportNames(text5)) imports2.add(name3);
@@ -16744,7 +16784,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
16744
16784
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
16745
16785
  var MULTI_MANIFEST_VERSION = 66;
16746
16786
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
16747
- var compilerSourceDigest = true ? "2e5698309de758f9fcfd857f44c8fe794ab3ef36f7b28f6a042e4326bbc8113a" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
16787
+ var compilerSourceDigest = true ? "4c6d0c445f1c9d7fab6a4d2bbd910ec116536acc8d1aa621f70c74c10dd9faba" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
16748
16788
  function swiftArtifactHash(input, release, moduleRoot) {
16749
16789
  const hash = (0, import_node_crypto13.createHash)("sha256");
16750
16790
  hash.update(`swift-compile
@@ -29698,7 +29738,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
29698
29738
  return hash.digest("hex");
29699
29739
  }
29700
29740
  var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
29701
- var STANDIN_SOURCE_DIGEST = true ? "af579d23be157d779601d4f3373566fac852d588d01fe54fa87ad7cd82139fd8" : standinSourceDigest();
29741
+ var STANDIN_SOURCE_DIGEST = true ? "01e0eae770cafd2bbd23d98a22897ab31ada19f5a273a8f25da7c88aa3086c09" : standinSourceDigest();
29702
29742
 
29703
29743
  // src/swift-standins.ts
29704
29744
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -31195,7 +31235,13 @@ function mixedStandin(surface, binary, toolchain, work, behavior, frameworkDirs,
31195
31235
  }))
31196
31236
  };
31197
31237
  });
31198
- const imports2 = [.../* @__PURE__ */ new Set([...swiftImportNames(interfaceText), ...owners])].filter(
31238
+ const imports2 = [
31239
+ .../* @__PURE__ */ new Set([
31240
+ ...swiftImportNames(interfaceText),
31241
+ ...view.imports.filter((name3) => !STANDIN_IMPORTS.includes(name3)),
31242
+ ...owners
31243
+ ])
31244
+ ].filter(
31199
31245
  (module2) => module2 !== surface.module && (provided.has(module2) || siblings.has(module2))
31200
31246
  );
31201
31247
  return graphStandin(
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (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;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1967 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1968 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.1967",
3
+ "version": "0.1.1968",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -22,7 +22,11 @@ import { isRecord } from './is-record'
22
22
  import { swiftObjCPlatformFlags } from './swift-objc-platform'
23
23
  import { IOS_SDK_HEADERS, IOS_SDK_OVERLAYS, IOS_SDK_TARGET } from './swift-objc-sdk'
24
24
  import { clangImportNames, moduleMapTokens } from './swift-package'
25
- import { objcProtocolsInSwiftSignatures, type SymbolGraph } from './swift-standin-emit'
25
+ import {
26
+ objcProtocolsInSwiftSignatures,
27
+ type GraphSymbol,
28
+ type SymbolGraph,
29
+ } from './swift-standin-emit'
26
30
  import { swiftEnvironment, withoutCoreDump } from './swift-toolchain'
27
31
 
28
32
  /** a module map and the headers it reaches: a framework's, or a library
@@ -53,6 +57,16 @@ export interface ObjcView {
53
57
  imports: string[]
54
58
  }
55
59
 
60
+ const REFINED_CONSTANT_TYPES = new Map([
61
+ ['NSInteger', 'Int'],
62
+ ['NSUInteger', 'UInt'],
63
+ ['NSTimeInterval', 'TimeInterval'],
64
+ ['double', 'Double'],
65
+ ['CGFloat', 'CGFloat'],
66
+ ['BOOL', 'Bool'],
67
+ ['NSString*', 'String'],
68
+ ])
69
+
56
70
  export const NATIVE_GRAPH_SDK_VERSION = '27.1'
57
71
 
58
72
  /** the installed libc's emulated surfaces: its signal.h is an #error without them,
@@ -487,9 +501,17 @@ export function objcView(
487
501
  fs.mkdirSync(path.join(frameworks, `${surface.module}.framework`, 'Modules'), {
488
502
  recursive: true,
489
503
  })
490
- fs.copyFileSync(
491
- surface.modulemap,
504
+ // the swift overlay owns what the generated -Swift.h header re-imports
505
+ // under swift_name, so a mixed framework's intake map drops that submodule
506
+ const modulemap = fs.readFileSync(surface.modulemap, 'utf8')
507
+ fs.writeFileSync(
492
508
  path.join(frameworks, `${surface.module}.framework`, 'Modules', 'module.modulemap'),
509
+ surface.interface
510
+ ? modulemap.replace(
511
+ new RegExp(`\\n\\s*module\\s+${surface.module}\\.Swift\\s*\\{[^}]*\\}`),
512
+ '',
513
+ )
514
+ : modulemap,
493
515
  )
494
516
  // a mixed framework's swift overlay loads over the same learned headers.
495
517
  // the intake reads CoreFoundation's headers textually, so a type the
@@ -513,6 +535,8 @@ export function objcView(
513
535
  .readFileSync(path.join(from, name), 'utf8')
514
536
  .replace(/\bCoreFoundation\.(?=CG)/g, 'CoreGraphics.')
515
537
  .replace(/\bCoreFoundation\.(?=\w)/g, 'Foundation.')
538
+ // the intake has no Darwin module; OSStatus is its Int32
539
+ .replace(/\bDarwin\.OSStatus\b/g, 'Swift.Int32')
516
540
  // Data's base64 option sets live in the swift overlay; the
517
541
  // intake only has their NSData spelling, which Data aliases.
518
542
  .replace(
@@ -927,6 +951,32 @@ export function objcView(
927
951
  inherit(pairs[Number(match[1])]!.superclass[0], 's:s8SendableP')
928
952
  }
929
953
  }
954
+ // a refined extern constant imports under a double-underscore name, which the symbol
955
+ // graph hides, while a swift interface still names it in a default argument.
956
+ const refined: GraphSymbol[] = [...originals.values()].flatMap((text) =>
957
+ [
958
+ ...text.matchAll(
959
+ /\b(?:FOUNDATION_EXTERN|FOUNDATION_EXPORT|extern)\s+([\w\s*]+?)\s+const\s+(\w+)\s+NS_REFINED_FOR_SWIFT\s*;/g,
960
+ ),
961
+ ].flatMap(([, ctype, name]) => {
962
+ const type = REFINED_CONSTANT_TYPES.get(ctype!.replace(/\s+/g, ''))
963
+ if (!type) return []
964
+ return [
965
+ {
966
+ kind: { identifier: 'swift.var' },
967
+ identifier: { precise: `c:@${name}` },
968
+ pathComponents: [`__${name}`],
969
+ declarationFragments: [
970
+ { kind: 'keyword', spelling: 'let' },
971
+ { kind: 'text', spelling: ` __${name}: ${type}` },
972
+ ],
973
+ accessLevel: 'public',
974
+ } satisfies GraphSymbol,
975
+ ]
976
+ }),
977
+ )
978
+ if (refined.length > 0)
979
+ graphs.push({ module: { name: surface.module }, symbols: refined, relationships: [] })
930
980
  const imports = new Set<string>(['Foundation', 'UIKit'])
931
981
  for (const text of originals.values())
932
982
  for (const name of clangImportNames(text)) imports.add(name)
@@ -723,7 +723,10 @@ export function emitSwiftStandin(
723
723
  const module = parts[0] === 'SwiftUICore' ? 'SwiftUI' : parts[0]!
724
724
  const unqualified = parts.slice(1).join('.') || parts[0]!
725
725
  const name =
726
- family.has(parts[0]!) && parts[0] !== 'SwiftUICore' ? parts.join('.') : unqualified
726
+ parts.length > 1 && family.has(parts[0]!) && parts[0] !== 'SwiftUICore'
727
+ ? // a module selector reaches past a class named like its module
728
+ `${parts[0]}::${unqualified}`
729
+ : unqualified
727
730
  return { name, module, local: false }
728
731
  }
729
732
  const nsObject = nameOf('c:objc(cs)NSObject', 'ObjectiveC.NSObject')!.name
@@ -1247,7 +1247,13 @@ function mixedStandin(
1247
1247
  })),
1248
1248
  }
1249
1249
  })
1250
- const imports = [...new Set([...swiftImportNames(interfaceText), ...owners])].filter(
1250
+ const imports = [
1251
+ ...new Set([
1252
+ ...swiftImportNames(interfaceText),
1253
+ ...view.imports.filter((name) => !STANDIN_IMPORTS.includes(name)),
1254
+ ...owners,
1255
+ ]),
1256
+ ].filter(
1251
1257
  (module) =>
1252
1258
  module !== surface.module && (provided.has(module) || siblings.has(module)),
1253
1259
  )