peachsim 0.1.2406 → 0.1.2409
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.
- package/cli/agent-note.ts +231 -0
- package/cli/cloud-client.ts +8 -3
- package/cli/cloud-dispatch.ts +1 -1
- package/cli/command-agent.ts +122 -0
- package/cli/commands/agent.ts +29 -26
- package/cli/commands/stream.ts +11 -7
- package/cli/main.ts +16 -2
- package/cli/outbound-endpoints.ts +15 -0
- package/cli/ws-bridge.ts +4 -1
- package/dist-lib/agent-daemon-client.cjs +23 -3
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +205 -62
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +20 -1
- package/dist-lib/cloud-contract.mjs +18 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1630 -1513
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +203 -60
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +394 -102
- package/dist-lib/host/fetch-proxy-handler.cjs +5 -5
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +392 -272
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +5 -5
- package/dist-lib/native-app-identity-project.cjs +3 -3
- package/dist-lib/native-app-identity-project.mjs +3 -3
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +70 -60
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +1199 -821
- package/dist-lib/swift-compile.cjs +197 -55
- package/dist-lib/swift-compile.mjs +197 -55
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +213 -58
- package/dist-lib/vite.cjs +5 -5
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +7 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/skills/peach-setup/SKILL.md +8 -3
- package/src/agent-daemon-client.ts +35 -2
- package/src/agent-prompt.ts +68 -0
- package/src/bridge-contract.ts +4 -0
- package/src/canvas-agent-note-delivery.ts +83 -0
- package/src/cloud-contract.ts +30 -0
- package/src/host/agent-host.ts +128 -18
- package/src/swift-compile.ts +124 -66
- package/src/swift-host.ts +2 -1
- package/src/swift-objc-import.ts +99 -0
- package/src/swift-packages.ts +1 -0
- package/src/swift-shared-sdk.ts +2 -1
- package/src/xcode-header-search.ts +33 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2409 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -4319,7 +4319,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
4319
4319
|
const overlayFiles = readdirSync4(overlay, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => path10.join(entry.parentPath, entry.name)).sort();
|
|
4320
4320
|
const key = JSON.stringify([
|
|
4321
4321
|
// bump the recipe when the transformation changes; bundling changes function text.
|
|
4322
|
-
"
|
|
4322
|
+
"v25",
|
|
4323
4323
|
[...WEAKEN_FOUNDATION_SYMS],
|
|
4324
4324
|
toolchainBin,
|
|
4325
4325
|
sdk,
|
|
@@ -4379,6 +4379,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
|
|
|
4379
4379
|
"objc/NSObject.h",
|
|
4380
4380
|
"ObjectiveC.apinotes",
|
|
4381
4381
|
"net/if.h",
|
|
4382
|
+
"netinet/tcp.h",
|
|
4382
4383
|
"notify.h",
|
|
4383
4384
|
"notify.modulemap",
|
|
4384
4385
|
"module.modulemap",
|
|
@@ -12047,6 +12048,78 @@ function swiftClangImporterFlags(flags) {
|
|
|
12047
12048
|
(flag) => flag !== "-fobjc-arc" && flag !== "-fno-objc-arc" && !/^-std=(?:c(?!\+\+)|gnu(?!\+\+)|iso9899:)/.test(flag)
|
|
12048
12049
|
);
|
|
12049
12050
|
}
|
|
12051
|
+
var CLANG_PATH_OPTIONS = /* @__PURE__ */ new Set([
|
|
12052
|
+
"-I",
|
|
12053
|
+
"-F",
|
|
12054
|
+
"-idirafter",
|
|
12055
|
+
"-iframework",
|
|
12056
|
+
"-iframeworkwithsysroot",
|
|
12057
|
+
"-imacros",
|
|
12058
|
+
"-include",
|
|
12059
|
+
"-iprefix",
|
|
12060
|
+
"-iquote",
|
|
12061
|
+
"-isystem",
|
|
12062
|
+
"-isysroot",
|
|
12063
|
+
"-ivfsoverlay",
|
|
12064
|
+
"-iwithprefix",
|
|
12065
|
+
"-iwithprefixbefore",
|
|
12066
|
+
"--sysroot"
|
|
12067
|
+
]);
|
|
12068
|
+
function compactSwiftClangDefines(flags) {
|
|
12069
|
+
const definitions = /* @__PURE__ */ new Map();
|
|
12070
|
+
const macros = [];
|
|
12071
|
+
for (let index = 0; index < flags.length; index++) {
|
|
12072
|
+
if (flags[index].startsWith("@")) return flags;
|
|
12073
|
+
if (flags[index] !== "-Xcc") continue;
|
|
12074
|
+
const flag = flags[++index];
|
|
12075
|
+
if (flag === void 0 || flags[index - 2] === "-Xfrontend" || flag === "-Xclang" || flag === "-Xpreprocessor" || flag.startsWith("-Wp,") || flag.startsWith("--config") || flag.startsWith("@"))
|
|
12076
|
+
return flags;
|
|
12077
|
+
if (CLANG_PATH_OPTIONS.has(flag) && flags[index + 1] === "-Xcc") {
|
|
12078
|
+
index += 2;
|
|
12079
|
+
continue;
|
|
12080
|
+
}
|
|
12081
|
+
if (!flag.startsWith("-D") && !flag.startsWith("-U")) continue;
|
|
12082
|
+
const name2 = /^-[DU]([A-Za-z_$][\w$]*)(?=[(=]|$)/.exec(flag)?.[1];
|
|
12083
|
+
if (!name2) return flags;
|
|
12084
|
+
const previous = definitions.get(name2);
|
|
12085
|
+
definitions.set(name2, previous === void 0 || previous === flag ? flag : null);
|
|
12086
|
+
macros.push({ index, name: name2, flag });
|
|
12087
|
+
}
|
|
12088
|
+
const seen = /* @__PURE__ */ new Set();
|
|
12089
|
+
const duplicates = /* @__PURE__ */ new Set();
|
|
12090
|
+
for (const { index, name: name2, flag } of macros) {
|
|
12091
|
+
if (definitions.get(name2) !== flag) continue;
|
|
12092
|
+
if (seen.has(name2)) {
|
|
12093
|
+
duplicates.add(index - 1);
|
|
12094
|
+
duplicates.add(index);
|
|
12095
|
+
}
|
|
12096
|
+
seen.add(name2);
|
|
12097
|
+
}
|
|
12098
|
+
return duplicates.size === 0 ? flags : flags.filter((_, index) => !duplicates.has(index));
|
|
12099
|
+
}
|
|
12100
|
+
function compactSwiftClangOverlays(flags, generated) {
|
|
12101
|
+
if (generated.size === 0) return flags;
|
|
12102
|
+
const overlays = /* @__PURE__ */ new Map();
|
|
12103
|
+
const duplicates = /* @__PURE__ */ new Set();
|
|
12104
|
+
for (let index = 0; index < flags.length; index++) {
|
|
12105
|
+
const flag = flags[index];
|
|
12106
|
+
if (flag.startsWith("@")) return flags;
|
|
12107
|
+
if (flag === "-Xcc" && flags[index - 1] === "-Xfrontend") return flags;
|
|
12108
|
+
if (flags[index - 1] === "-Xcc" && (flag.startsWith("--config") || flag === "-Xclang"))
|
|
12109
|
+
return flags;
|
|
12110
|
+
if (!flag.startsWith("-ivfsoverlay") && !flag.startsWith("-vfsoverlay")) continue;
|
|
12111
|
+
if (flag !== "-ivfsoverlay" || flags[index - 1] !== "-Xcc" || flags[index + 1] !== "-Xcc")
|
|
12112
|
+
return flags;
|
|
12113
|
+
const file = flags[index + 2];
|
|
12114
|
+
if (file === void 0 || !generated.has(file)) return flags;
|
|
12115
|
+
const previous = overlays.get(file);
|
|
12116
|
+
if (previous !== void 0)
|
|
12117
|
+
for (let offset = -1; offset < 3; offset++) duplicates.add(previous + offset);
|
|
12118
|
+
overlays.set(file, index);
|
|
12119
|
+
index += 2;
|
|
12120
|
+
}
|
|
12121
|
+
return duplicates.size === 0 ? flags : flags.filter((_, index) => !duplicates.has(index));
|
|
12122
|
+
}
|
|
12050
12123
|
var SWIFT_SUBMODULE_IMPORT = /^[ \t]*(?:@\w+(?:\([^)]*\))?[ \t]+)*import[ \t]+([A-Za-z_]\w*)\.([A-Za-z_]\w*)[ \t]*(?:\/\/.*)?$/gm;
|
|
12051
12124
|
function swiftSubmoduleImports(sources) {
|
|
12052
12125
|
const imports = /* @__PURE__ */ new Map();
|
|
@@ -12586,6 +12659,30 @@ function isSwiftResourceBundles(value) {
|
|
|
12586
12659
|
// src/xcode-header-search.ts
|
|
12587
12660
|
import fs11 from "node:fs";
|
|
12588
12661
|
import path27 from "node:path";
|
|
12662
|
+
function coalescibleHeaderOverlays(files) {
|
|
12663
|
+
const aliases = /* @__PURE__ */ new Map();
|
|
12664
|
+
const key = (file) => file.replace(/[A-Z]/g, (letter) => letter.toLowerCase());
|
|
12665
|
+
const index = (directory, entry) => {
|
|
12666
|
+
const name2 = path27.resolve(directory, entry.name);
|
|
12667
|
+
if (entry.type === "directory")
|
|
12668
|
+
return entry.contents.every((child) => index(name2, child));
|
|
12669
|
+
const source = entry["external-contents"];
|
|
12670
|
+
const previous = aliases.get(key(name2));
|
|
12671
|
+
if (previous !== void 0 && previous !== source) return false;
|
|
12672
|
+
aliases.set(key(name2), source);
|
|
12673
|
+
return true;
|
|
12674
|
+
};
|
|
12675
|
+
for (const file of files) {
|
|
12676
|
+
const overlay = JSON.parse(fs11.readFileSync(file, "utf8"));
|
|
12677
|
+
if (!overlay.roots.every((entry) => index(path27.dirname(file), entry)))
|
|
12678
|
+
return /* @__PURE__ */ new Set();
|
|
12679
|
+
}
|
|
12680
|
+
for (const file of [...files, ...aliases.values()]) {
|
|
12681
|
+
const source = aliases.get(key(path27.normalize(file)));
|
|
12682
|
+
if (source !== void 0 && source !== file) return /* @__PURE__ */ new Set();
|
|
12683
|
+
}
|
|
12684
|
+
return files;
|
|
12685
|
+
}
|
|
12589
12686
|
function headerMap(entries) {
|
|
12590
12687
|
const unique = /* @__PURE__ */ new Map();
|
|
12591
12688
|
for (const entry of entries)
|
|
@@ -13658,6 +13755,15 @@ function swiftTargetDependencies(files, targets, frameworks = OPTIONAL_FRAMEWORK
|
|
|
13658
13755
|
)
|
|
13659
13756
|
);
|
|
13660
13757
|
const names = /* @__PURE__ */ new Set([...frameworks, ...targets.map((target) => target.name)]);
|
|
13758
|
+
const entriesByPrefix = new Map(
|
|
13759
|
+
targets.map(({ path: path29 }) => [path29 === "." ? "" : `${path29}/`, []])
|
|
13760
|
+
);
|
|
13761
|
+
for (const entry of Object.entries(files)) {
|
|
13762
|
+
const [file] = entry;
|
|
13763
|
+
entriesByPrefix.get("")?.push(entry);
|
|
13764
|
+
for (let end = file.indexOf("/"); end !== -1; end = file.indexOf("/", end + 1))
|
|
13765
|
+
entriesByPrefix.get(file.slice(0, end + 1))?.push(entry);
|
|
13766
|
+
}
|
|
13661
13767
|
const siblings = /* @__PURE__ */ new Map();
|
|
13662
13768
|
for (const target of targets) {
|
|
13663
13769
|
const prefix = target.path === "." ? "" : `${target.path}/`;
|
|
@@ -13671,8 +13777,11 @@ function swiftTargetDependencies(files, targets, frameworks = OPTIONAL_FRAMEWORK
|
|
|
13671
13777
|
(dependency) => dependency.kind === "target" && dependency.name !== target.name && names.has(dependency.name) || dependency.kind === "product" && dependency.package === "sootsim-swift" && OPTIONAL_FRAMEWORKS.has(dependency.name) ? [dependency.name] : []
|
|
13672
13778
|
)
|
|
13673
13779
|
);
|
|
13674
|
-
|
|
13675
|
-
|
|
13780
|
+
const nested = target.sources === void 0 ? targets.flatMap(
|
|
13781
|
+
(candidate) => candidate.name !== target.name && candidate.path !== "." && candidate.path.startsWith(prefix) ? [`${candidate.path}/`] : []
|
|
13782
|
+
) : [];
|
|
13783
|
+
for (const [file, contents2] of entriesByPrefix.get(prefix) ?? []) {
|
|
13784
|
+
if (file === "Package.swift") continue;
|
|
13676
13785
|
const relative = file.slice(prefix.length);
|
|
13677
13786
|
if (target.sources !== void 0 && !target.sources.some(
|
|
13678
13787
|
(source) => source === "." || relative === source || relative.startsWith(`${source}/`)
|
|
@@ -13682,10 +13791,7 @@ function swiftTargetDependencies(files, targets, frameworks = OPTIONAL_FRAMEWORK
|
|
|
13682
13791
|
(excluded) => relative === excluded || relative.startsWith(`${excluded}/`)
|
|
13683
13792
|
))
|
|
13684
13793
|
continue;
|
|
13685
|
-
if (
|
|
13686
|
-
(candidate) => candidate.name !== target.name && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
|
|
13687
|
-
))
|
|
13688
|
-
continue;
|
|
13794
|
+
if (nested.some((path29) => file.startsWith(path29))) continue;
|
|
13689
13795
|
const imports = file.endsWith(".swift") ? swiftImportNames(contents2) : SWIFT_NATIVE_SOURCE_EXTENSIONS.some((extension) => file.endsWith(extension)) ? clangImportNames(contents2, ownsHeader) : [];
|
|
13690
13796
|
for (const name2 of imports) {
|
|
13691
13797
|
if (names.has(name2) && name2 !== target.name && !(target.dependencies !== void 0 && localNames.has(name2)))
|
|
@@ -13746,9 +13852,9 @@ var executableLinkFlags = (root) => ` "-Xclang-linker", "-O0",
|
|
|
13746
13852
|
`;
|
|
13747
13853
|
var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...quoted2, "-Wl,--end-lib"] : [];
|
|
13748
13854
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
13749
|
-
var MULTI_MANIFEST_VERSION =
|
|
13855
|
+
var MULTI_MANIFEST_VERSION = 71;
|
|
13750
13856
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
13751
|
-
var compilerSourceDigest = true ? "
|
|
13857
|
+
var compilerSourceDigest = true ? "d287f3ad479477c70004707c1336f37c9baeb81aef1880544a5ca236e088ca16" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
13752
13858
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
13753
13859
|
const hash = createHash14("sha256");
|
|
13754
13860
|
hash.update(`swift-compile
|
|
@@ -13980,7 +14086,9 @@ function emitSwiftPackageManifest(args) {
|
|
|
13980
14086
|
const flags = JSON.parse(literal2.replace(/,\s*]$/, "]")).filter(
|
|
13981
14087
|
(flag, index, all) => !mapsPackageModule(flag) && !(flag === "-Xcc" && mapsPackageModule(all[index + 1] ?? ""))
|
|
13982
14088
|
);
|
|
13983
|
-
const
|
|
14089
|
+
const macros = compactSwiftClangDefines(flags);
|
|
14090
|
+
const compact = args.coalescibleOverlays ? compactSwiftClangOverlays(macros, args.coalescibleOverlays) : macros;
|
|
14091
|
+
const content = compact.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
|
|
13984
14092
|
const digest = createHash14("sha256").update(content).digest("hex");
|
|
13985
14093
|
const file = path28.join(args.root, ".peach-swift-arguments", `${digest}.rsp`);
|
|
13986
14094
|
args.files.set(file, content);
|
|
@@ -14071,7 +14179,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
14071
14179
|
].map((flag) => `, ${JSON.stringify(flag)}`).join("");
|
|
14072
14180
|
const header = args.headerDirectory && (args.nativeHeaderDeclarations?.[target.name] || [...args.native?.values() ?? []].some(
|
|
14073
14181
|
(value) => value.late?.producers.includes(target.name)
|
|
14074
|
-
)) ? `, "-emit-objc-header-path", ${JSON.stringify(path28.join(args.headerDirectory, `${target.name}-Swift
|
|
14182
|
+
)) ? `, "-emit-objc-header-path", ${JSON.stringify(path28.join(args.headerDirectory, `${target.name}-Swift.original.h`))}` : "";
|
|
14075
14183
|
const clangMode = target.cxxInterop ? "" : ', "-Xcc", "-fno-cxx-modules"';
|
|
14076
14184
|
const deployment = `, "-Xfrontend", "-peach-ios-deployment-target", "-Xfrontend", ${JSON.stringify(target.iosDeploymentTarget ?? SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET)}`;
|
|
14077
14185
|
const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation}${interoperability}${defines}${features}${upcoming} .unsafeFlags(${swiftFlagArray(`["-Osize", "-Xfrontend", "-enable-cross-import-overlays"${overlayFlags}${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports}${nativeImportFlags}${objcFlags}${header}${clangMode}${deployment}${upstream}]`)})]`;
|
|
@@ -16719,6 +16827,9 @@ module ${moduleName}.Swift {
|
|
|
16719
16827
|
nativeHeaderDeclarations[module] = [...declared];
|
|
16720
16828
|
}
|
|
16721
16829
|
const nativeFlags = native.size > 0 ? /* @__PURE__ */ new Map() : void 0;
|
|
16830
|
+
const generatedOverlays = new Set(
|
|
16831
|
+
headerSearch.files.filter((file) => file.endsWith(".yaml"))
|
|
16832
|
+
);
|
|
16722
16833
|
if (nativeFlags) {
|
|
16723
16834
|
const toolchainBin = nativeToolchain();
|
|
16724
16835
|
const headers = path28.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "darwin");
|
|
@@ -16739,8 +16850,11 @@ module ${moduleName}.Swift {
|
|
|
16739
16850
|
throw new Error(
|
|
16740
16851
|
target.name + ": missing or unsupported declared iOS deployment target " + JSON.stringify(version2)
|
|
16741
16852
|
);
|
|
16853
|
+
const sdkIntake = objcSdkIntakeFlags(headers, toolchainBin, minimum);
|
|
16854
|
+
const sdkOverlay = sdkIntake.indexOf("-ivfsoverlay");
|
|
16855
|
+
if (sdkOverlay >= 0) generatedOverlays.add(sdkIntake[sdkOverlay + 1]);
|
|
16742
16856
|
const intake = [
|
|
16743
|
-
...
|
|
16857
|
+
...sdkIntake,
|
|
16744
16858
|
"-ivfsoverlay",
|
|
16745
16859
|
headerSearch.files[0],
|
|
16746
16860
|
"-I",
|
|
@@ -16909,6 +17023,7 @@ module ${moduleName}.Swift {
|
|
|
16909
17023
|
sourceSwiftTargets: swiftTargets,
|
|
16910
17024
|
nativeFlags,
|
|
16911
17025
|
nativeImportFlags,
|
|
17026
|
+
coalescibleOverlays: nativeFlags ? coalescibleHeaderOverlays(generatedOverlays) : void 0,
|
|
16912
17027
|
nativeHeaderFlags,
|
|
16913
17028
|
nativeSwiftHeaderMaps,
|
|
16914
17029
|
nativeHeaderDeclarations,
|
|
@@ -18219,6 +18334,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
18219
18334
|
report("compiling and linking Swift modules");
|
|
18220
18335
|
const frameworkInterfaces = /* @__PURE__ */ new Map();
|
|
18221
18336
|
const nativeDeclarations = /* @__PURE__ */ new Map();
|
|
18337
|
+
const nativeHeaders = Object.entries(input.files).filter(([name2]) => name2.endsWith(".h") && !name2.endsWith("-Swift.h")).map(([, source]) => source);
|
|
18222
18338
|
for (const [file, contents2] of Object.entries(input.files)) {
|
|
18223
18339
|
if (!file.endsWith(".modulemap")) continue;
|
|
18224
18340
|
const name2 = moduleMapName(contents2);
|
|
@@ -18306,54 +18422,83 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
18306
18422
|
);
|
|
18307
18423
|
return value;
|
|
18308
18424
|
};
|
|
18309
|
-
|
|
18310
|
-
|
|
18311
|
-
|
|
18312
|
-
|
|
18313
|
-
|
|
18314
|
-
|
|
18315
|
-
|
|
18316
|
-
|
|
18425
|
+
const compileApp = async () => {
|
|
18426
|
+
const stages = [
|
|
18427
|
+
...preparation.headerBuilds,
|
|
18428
|
+
...preparation.nativeProductTarget ? [{ target: preparation.nativeProductTarget, producers: [] }] : []
|
|
18429
|
+
];
|
|
18430
|
+
const checkpoints = path28.join(root, ".build", "peach-product-checkpoints");
|
|
18431
|
+
const recipe = createHash14("sha256").update(hash).update(readFileSync17(path28.join(root, "Package.swift"))).update(JSON.stringify(buildArgs)).digest("hex");
|
|
18432
|
+
for (const { target, producers } of stages) {
|
|
18433
|
+
const receipt = path28.join(
|
|
18434
|
+
checkpoints,
|
|
18435
|
+
createHash14("sha256").update(target).digest("hex")
|
|
18317
18436
|
);
|
|
18318
|
-
|
|
18319
|
-
const
|
|
18437
|
+
const headers = producers.map((producer) => {
|
|
18438
|
+
const stem = path28.join(
|
|
18320
18439
|
root,
|
|
18321
18440
|
".build",
|
|
18322
18441
|
"peach-cxx-headers",
|
|
18323
|
-
`${producer}-Swift
|
|
18442
|
+
`${producer}-Swift`
|
|
18324
18443
|
);
|
|
18325
|
-
|
|
18326
|
-
|
|
18327
|
-
|
|
18328
|
-
|
|
18329
|
-
|
|
18330
|
-
|
|
18331
|
-
|
|
18332
|
-
|
|
18333
|
-
|
|
18334
|
-
|
|
18335
|
-
|
|
18336
|
-
|
|
18337
|
-
generated,
|
|
18338
|
-
Object.entries(input.files).filter(
|
|
18339
|
-
([name2]) => name2.endsWith(".h") && !name2.endsWith("-Swift.h")
|
|
18340
|
-
).map(([, source]) => source)
|
|
18341
|
-
)
|
|
18342
|
-
]),
|
|
18343
|
-
`#import <${producer}/${producer}.h>`
|
|
18344
|
-
)
|
|
18444
|
+
return {
|
|
18445
|
+
producer,
|
|
18446
|
+
original: `${stem}.original.h`,
|
|
18447
|
+
emitted: `${stem}.h`
|
|
18448
|
+
};
|
|
18449
|
+
});
|
|
18450
|
+
const fingerprint = () => {
|
|
18451
|
+
const digest = createHash14("sha256").update(recipe);
|
|
18452
|
+
for (const { emitted } of headers) {
|
|
18453
|
+
if (!existsSync6(emitted)) return;
|
|
18454
|
+
digest.update(
|
|
18455
|
+
createHash14("sha256").update(readFileSync17(emitted)).digest()
|
|
18345
18456
|
);
|
|
18346
18457
|
}
|
|
18347
|
-
|
|
18348
|
-
|
|
18349
|
-
|
|
18458
|
+
return digest.digest("hex");
|
|
18459
|
+
};
|
|
18460
|
+
if (!options.project && existsSync6(receipt) && readFileSync17(receipt, "utf8") === fingerprint())
|
|
18461
|
+
continue;
|
|
18462
|
+
if (!options.project) rmSync7(receipt, { force: true });
|
|
18463
|
+
for (const { producer, original } of headers)
|
|
18464
|
+
if (!existsSync6(original))
|
|
18465
|
+
rmSync7(
|
|
18466
|
+
path28.join(
|
|
18467
|
+
root,
|
|
18468
|
+
".build",
|
|
18469
|
+
WASM_TRIPLE,
|
|
18470
|
+
"release",
|
|
18471
|
+
"Modules",
|
|
18472
|
+
`${swiftTargetModuleName(producer)}.swiftmodule`
|
|
18473
|
+
),
|
|
18474
|
+
{ force: true }
|
|
18475
|
+
);
|
|
18350
18476
|
await runCompiler(
|
|
18351
18477
|
swift,
|
|
18352
|
-
[...buildArgs, "--target",
|
|
18478
|
+
[...buildArgs, "--target", target],
|
|
18353
18479
|
appOptions,
|
|
18354
18480
|
SWIFTPM_PROGRESS,
|
|
18355
18481
|
SWIFTPM_NOISE
|
|
18356
18482
|
);
|
|
18483
|
+
for (const { producer, original, emitted } of headers) {
|
|
18484
|
+
const generated = clangInterfaceHeader(readFileSync17(original, "utf8"));
|
|
18485
|
+
writeBuildFile(
|
|
18486
|
+
emitted,
|
|
18487
|
+
withoutSwiftDeclarations(
|
|
18488
|
+
swiftHeaderWithSuperclassImports(generated, frameworkInterface),
|
|
18489
|
+
/* @__PURE__ */ new Set([
|
|
18490
|
+
...preparation.nativeHeaderDeclarations[producer] ?? [],
|
|
18491
|
+
...nativelyDeclaredFunctions(generated, nativeHeaders)
|
|
18492
|
+
]),
|
|
18493
|
+
`#import <${producer}/${producer}.h>`
|
|
18494
|
+
)
|
|
18495
|
+
);
|
|
18496
|
+
}
|
|
18497
|
+
if (!options.project) {
|
|
18498
|
+
mkdirSync7(checkpoints, { recursive: true });
|
|
18499
|
+
writeFileSync8(`${receipt}.partial`, fingerprint());
|
|
18500
|
+
renameSync2(`${receipt}.partial`, receipt);
|
|
18501
|
+
}
|
|
18357
18502
|
}
|
|
18358
18503
|
await runCompiler(
|
|
18359
18504
|
swift,
|
|
@@ -18362,6 +18507,9 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
18362
18507
|
SWIFTPM_PROGRESS,
|
|
18363
18508
|
SWIFTPM_NOISE
|
|
18364
18509
|
);
|
|
18510
|
+
};
|
|
18511
|
+
try {
|
|
18512
|
+
await compileApp();
|
|
18365
18513
|
} catch (error) {
|
|
18366
18514
|
const output2 = outputOf(error);
|
|
18367
18515
|
const moduleCache = path28.join(
|
|
@@ -18374,13 +18522,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
18374
18522
|
if (output2.includes("was compiled with module cache path") && existsSync6(moduleCache)) {
|
|
18375
18523
|
rmSync7(moduleCache, { recursive: true, force: true });
|
|
18376
18524
|
try {
|
|
18377
|
-
await
|
|
18378
|
-
swift,
|
|
18379
|
-
buildArgs,
|
|
18380
|
-
appOptions,
|
|
18381
|
-
SWIFTPM_PROGRESS,
|
|
18382
|
-
SWIFTPM_NOISE
|
|
18383
|
-
);
|
|
18525
|
+
await compileApp();
|
|
18384
18526
|
} catch (retryError) {
|
|
18385
18527
|
throw new Error(
|
|
18386
18528
|
[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2409 | (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.
|
|
1
|
+
/*! peach v0.1.2409 | (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.
|
|
1
|
+
/*! peach v0.1.2409 | (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;
|
package/dist-lib/swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2409 | (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;
|