peachsim 0.1.2244 → 0.1.2246
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/bridge-flow-runner.ts +7 -6
- package/cli/commands/inspect/settling.ts +2 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- 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 +68 -13
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -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 +3 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +67 -12
- 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 +68 -13
- package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
- 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 +5 -4
- 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 +3 -3
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- 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 +53 -53
- 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 +3 -2
- package/dist-lib/sdk.mjs +3 -2
- package/dist-lib/skills.cjs +77 -20
- package/dist-lib/swift-compile.cjs +65 -10
- package/dist-lib/swift-compile.mjs +65 -10
- 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 +66 -11
- package/dist-lib/vite.cjs +3 -3
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +8 -1
- package/dist-types/packages/peach-engine/src/render-worker/image-pixel-contract.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/resilient-frame-clock.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/swift-guest-image-ledger.ts +74 -7
- package/src/swift-guest-link.ts +3 -1
package/dist-lib/sdk.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2246 | (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;
|
|
@@ -2159,7 +2159,8 @@ async function waitForSootsimIdle({
|
|
|
2159
2159
|
!screenStill && stats.hasPendingReadinessAnimationFrames === true && 'pendingReadinessFrames',
|
|
2160
2160
|
].filter(Boolean).join('+')
|
|
2161
2161
|
// the runtime reports only layout work that can reach the window:
|
|
2162
|
-
// a covered screen or inactive tab committing does not hold it
|
|
2162
|
+
// a covered screen or inactive tab committing does not hold it,
|
|
2163
|
+
// and readiness does not wait on ongoing playback's own layout.
|
|
2163
2164
|
layoutDirty =
|
|
2164
2165
|
stats.layoutDirty === true && stats.renderRequested === true
|
|
2165
2166
|
// a freshly-pushed screen showing a skeleton is layout-stable
|
package/dist-lib/sdk.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2246 | (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);
|
|
@@ -2048,7 +2048,8 @@ async function waitForSootsimIdle({
|
|
|
2048
2048
|
!screenStill && stats.hasPendingReadinessAnimationFrames === true && 'pendingReadinessFrames',
|
|
2049
2049
|
].filter(Boolean).join('+')
|
|
2050
2050
|
// the runtime reports only layout work that can reach the window:
|
|
2051
|
-
// a covered screen or inactive tab committing does not hold it
|
|
2051
|
+
// a covered screen or inactive tab committing does not hold it,
|
|
2052
|
+
// and readiness does not wait on ongoing playback's own layout.
|
|
2052
2053
|
layoutDirty =
|
|
2053
2054
|
stats.layoutDirty === true && stats.renderRequested === true
|
|
2054
2055
|
// a freshly-pushed screen showing a skeleton is layout-stable
|
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2246 | (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;
|
|
@@ -49389,6 +49389,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
49389
49389
|
const types = [];
|
|
49390
49390
|
const functionTypes = [];
|
|
49391
49391
|
const definitions = [];
|
|
49392
|
+
const functionImports = /* @__PURE__ */ new Map();
|
|
49392
49393
|
let usesDlsym = false;
|
|
49393
49394
|
let usesDlerror = false;
|
|
49394
49395
|
const usedSymbols = /* @__PURE__ */ new Set();
|
|
@@ -49458,6 +49459,11 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
49458
49459
|
const isDlsym = instrumentDynamicLookups && module2 === "env" && name3 === "dlsym" && kind === 0;
|
|
49459
49460
|
const isDlerror = instrumentDynamicLookups && module2 === "env" && name3 === "dlerror" && kind === 0;
|
|
49460
49461
|
if (module2 === "env" && names.has(name3)) usedSymbols.add(name3);
|
|
49462
|
+
if (module2 === "env" && kind === 0 && names.has(name3)) {
|
|
49463
|
+
const type = types[functionType2];
|
|
49464
|
+
if (!type) throw new Error(`missing import type for ${name3}`);
|
|
49465
|
+
functionImports.set(name3, type);
|
|
49466
|
+
}
|
|
49461
49467
|
if (isDlsym || isDlerror) {
|
|
49462
49468
|
const type = types[functionType2];
|
|
49463
49469
|
const expected = isDlsym ? "126,126:126" : ":126";
|
|
@@ -49607,6 +49613,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
49607
49613
|
return {
|
|
49608
49614
|
bytes: Buffer.concat(sections2),
|
|
49609
49615
|
definitions,
|
|
49616
|
+
functionImports,
|
|
49610
49617
|
usesDlsym,
|
|
49611
49618
|
usedSymbols: [...usedSymbols]
|
|
49612
49619
|
};
|
|
@@ -49654,7 +49661,13 @@ function createGuestImageLedger(input) {
|
|
|
49654
49661
|
/* @__PURE__ */ new Set()
|
|
49655
49662
|
);
|
|
49656
49663
|
if (rewritten.usesDlsym) callersUsingDlsym.add(image.id);
|
|
49657
|
-
units.push({
|
|
49664
|
+
units.push({
|
|
49665
|
+
image: image.id,
|
|
49666
|
+
object: object6,
|
|
49667
|
+
aliases,
|
|
49668
|
+
usedSymbols: rewritten.usedSymbols,
|
|
49669
|
+
functionImports: rewritten.functionImports
|
|
49670
|
+
});
|
|
49658
49671
|
for (const symbol2 of rewritten.definitions) {
|
|
49659
49672
|
if (symbol2.type && symbol2.type.results.length > 1)
|
|
49660
49673
|
throw new Error(`multiple results for ${symbol2.name}`);
|
|
@@ -49739,9 +49752,33 @@ function createGuestImageLedger(input) {
|
|
|
49739
49752
|
bindings.set(binding.symbol, matches[0].alias);
|
|
49740
49753
|
startup.set(binding.object, bindings);
|
|
49741
49754
|
}
|
|
49742
|
-
const
|
|
49755
|
+
const resultWrappers = /* @__PURE__ */ new Map();
|
|
49756
|
+
const definitionsByAlias = /* @__PURE__ */ new Map();
|
|
49757
|
+
for (const definition2 of definitions) {
|
|
49758
|
+
const previous = definitionsByAlias.get(definition2.alias);
|
|
49759
|
+
if (!previous || previous.weak && !definition2.weak)
|
|
49760
|
+
definitionsByAlias.set(definition2.alias, definition2);
|
|
49761
|
+
}
|
|
49762
|
+
const objects = units.map(({ image, object: object6, aliases, functionImports }) => {
|
|
49743
49763
|
const bindings = new Map(bindingsByImage.get(image));
|
|
49744
49764
|
for (const [name3, alias] of startup.get(object6.path) ?? []) bindings.set(name3, alias);
|
|
49765
|
+
for (const [name3, type] of functionImports) {
|
|
49766
|
+
const alias = bindings.get(name3);
|
|
49767
|
+
const provider = alias === void 0 ? void 0 : definitionsByAlias.get(alias);
|
|
49768
|
+
if (!provider || provider.kind !== "function" || provider.result !== "i32" || type.results.length !== 1 || type.results[0] !== 126 || type.parameters.map(llvmType).join(",") !== provider.parameters.join(","))
|
|
49769
|
+
continue;
|
|
49770
|
+
const key2 = `${image}:${provider.alias}`;
|
|
49771
|
+
let wrapper = resultWrappers.get(key2);
|
|
49772
|
+
if (!wrapper) {
|
|
49773
|
+
wrapper = {
|
|
49774
|
+
symbol: `__peach_integer_result_${image}_${resultWrappers.size}`,
|
|
49775
|
+
image,
|
|
49776
|
+
provider
|
|
49777
|
+
};
|
|
49778
|
+
resultWrappers.set(key2, wrapper);
|
|
49779
|
+
}
|
|
49780
|
+
bindings.set(name3, wrapper.symbol);
|
|
49781
|
+
}
|
|
49745
49782
|
return {
|
|
49746
49783
|
path: object6.path,
|
|
49747
49784
|
instrumentDynamicLookups: object6.instrumentDynamicLookups,
|
|
@@ -49775,13 +49812,26 @@ function createGuestImageLedger(input) {
|
|
|
49775
49812
|
'target triple = "wasm64-unknown-wasip1"',
|
|
49776
49813
|
`@.names = private constant [${nameSize} x i8] c"${nameContents}"`
|
|
49777
49814
|
];
|
|
49778
|
-
|
|
49815
|
+
const declarations = new Map(exported2);
|
|
49816
|
+
for (const { provider } of resultWrappers.values())
|
|
49817
|
+
declarations.set(provider.alias, provider);
|
|
49818
|
+
for (const definition2 of declarations.values()) {
|
|
49779
49819
|
if (definition2.kind === "function")
|
|
49780
49820
|
ir.push(
|
|
49781
49821
|
`declare ${definition2.result} @${definition2.alias}(${definition2.parameters.join(", ")})`
|
|
49782
49822
|
);
|
|
49783
49823
|
else ir.push(`@${definition2.alias} = external global i8`);
|
|
49784
49824
|
}
|
|
49825
|
+
for (const { symbol: symbol2, provider } of resultWrappers.values()) {
|
|
49826
|
+
const parameters = provider.parameters.map((type, index) => `${type} %arg${index}`);
|
|
49827
|
+
ir.push(
|
|
49828
|
+
`define i64 @${symbol2}(${parameters.join(", ")}) {`,
|
|
49829
|
+
` %word = call i32 @${provider.alias}(${parameters.join(", ")})`,
|
|
49830
|
+
" %result = zext i32 %word to i64",
|
|
49831
|
+
" ret i64 %result",
|
|
49832
|
+
"}"
|
|
49833
|
+
);
|
|
49834
|
+
}
|
|
49785
49835
|
ir.push(`@__peach_dyld_symbols = constant [${exported2.size} x { ptr, i32, ptr }] [`);
|
|
49786
49836
|
ir.push(
|
|
49787
49837
|
[...exported2.values()].map(
|
|
@@ -49820,10 +49870,13 @@ function createGuestImageLedger(input) {
|
|
|
49820
49870
|
callers: input.callers,
|
|
49821
49871
|
definitions,
|
|
49822
49872
|
objects,
|
|
49823
|
-
callerWrappers: [
|
|
49824
|
-
|
|
49825
|
-
|
|
49826
|
-
|
|
49873
|
+
callerWrappers: [
|
|
49874
|
+
...[...callersUsingDlsym].map((image) => ({
|
|
49875
|
+
symbol: `__peach_dlsym_caller_${image}`,
|
|
49876
|
+
image
|
|
49877
|
+
})),
|
|
49878
|
+
...[...resultWrappers.values()].map(({ symbol: symbol2, image }) => ({ symbol: symbol2, image }))
|
|
49879
|
+
],
|
|
49827
49880
|
llvmIR: ir.join("\n") + "\n"
|
|
49828
49881
|
};
|
|
49829
49882
|
}
|
|
@@ -51698,7 +51751,9 @@ function linkGuestImages(options) {
|
|
|
51698
51751
|
return { selected: selected2, ledger: ledger2 };
|
|
51699
51752
|
};
|
|
51700
51753
|
let prepared = prepare2(false);
|
|
51701
|
-
const provider = prepared.ledger.callerWrappers.
|
|
51754
|
+
const provider = prepared.ledger.callerWrappers.some(
|
|
51755
|
+
({ symbol: symbol2 }) => symbol2.startsWith("__peach_dlsym_caller_")
|
|
51756
|
+
);
|
|
51702
51757
|
if (provider) prepared = prepare2(true);
|
|
51703
51758
|
const { selected, ledger } = prepared;
|
|
51704
51759
|
const replacements = /* @__PURE__ */ new Map();
|
|
@@ -59362,7 +59417,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
59362
59417
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
59363
59418
|
MULTI_MANIFEST_VERSION = 68;
|
|
59364
59419
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
59365
|
-
compilerSourceDigest = true ? "
|
|
59420
|
+
compilerSourceDigest = true ? "cd22143ba7a25fbe9f28d0187e37d40819453c2914c0808fbb77c738ef7e105d" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
59366
59421
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
59367
59422
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
59368
59423
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -65844,7 +65899,7 @@ var init_swift_standin_digest = __esm({
|
|
|
65844
65899
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
65845
65900
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
65846
65901
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
65847
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
65902
|
+
STANDIN_SOURCE_DIGEST = true ? "ce843ce67154212aa53c70a7c36567dc28c70b6d5f1a3222fe7527693c0eabf8" : standinSourceDigest();
|
|
65848
65903
|
}
|
|
65849
65904
|
});
|
|
65850
65905
|
|
|
@@ -66305,7 +66360,7 @@ var init_package_tree_digest = __esm({
|
|
|
66305
66360
|
|
|
66306
66361
|
// src/expo-native-prebuilt.ts
|
|
66307
66362
|
function expoNativeCompilerDigestValue() {
|
|
66308
|
-
return true ? "
|
|
66363
|
+
return true ? "21a0f833c352239e91173327f31255a272988ee1af2cf4754932134df568d55e" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
66309
66364
|
}
|
|
66310
66365
|
function readSources(value) {
|
|
66311
66366
|
const sources = isRecord(value) ? value.sources : null;
|
|
@@ -87107,7 +87162,7 @@ var init_nitro_superset = __esm({
|
|
|
87107
87162
|
init_nitroContract();
|
|
87108
87163
|
init_swift_standin_digest();
|
|
87109
87164
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
87110
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
87165
|
+
NITRO_COMPILER_DIGEST = true ? "e02b15db160c1ae1d6ce71b0b3c956ffd9adf8db358ab3b3e048483d2a6f3cde" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
87111
87166
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
87112
87167
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
87113
87168
|
published2 = /* @__PURE__ */ new Map();
|
|
@@ -134142,7 +134197,8 @@ async function waitForSootsimIdle({
|
|
|
134142
134197
|
!screenStill && stats.hasPendingReadinessAnimationFrames === true && 'pendingReadinessFrames',
|
|
134143
134198
|
].filter(Boolean).join('+')
|
|
134144
134199
|
// the runtime reports only layout work that can reach the window:
|
|
134145
|
-
// a covered screen or inactive tab committing does not hold it
|
|
134200
|
+
// a covered screen or inactive tab committing does not hold it,
|
|
134201
|
+
// and readiness does not wait on ongoing playback's own layout.
|
|
134146
134202
|
layoutDirty =
|
|
134147
134203
|
stats.layoutDirty === true && stats.renderRequested === true
|
|
134148
134204
|
// a freshly-pushed screen showing a skeleton is layout-stable
|
|
@@ -137133,12 +137189,13 @@ var init_bridge_flow_runner = __esm({
|
|
|
137133
137189
|
}
|
|
137134
137190
|
async setLaunchPermissions(permissions) {
|
|
137135
137191
|
const statuses = maestroLaunchPermissions(permissions);
|
|
137136
|
-
|
|
137137
|
-
|
|
137138
|
-
|
|
137139
|
-
|
|
137140
|
-
|
|
137141
|
-
|
|
137192
|
+
await this.evaluate(`(async () => {
|
|
137193
|
+
const test = globalThis.__sootsimTest
|
|
137194
|
+
const appId = await test.permissionGuestAppId()
|
|
137195
|
+
for (const [kind, status] of ${JSON.stringify([...statuses])}) {
|
|
137196
|
+
await test.permissionSetAppPermission(appId, kind, { status })
|
|
137197
|
+
}
|
|
137198
|
+
})()`);
|
|
137142
137199
|
}
|
|
137143
137200
|
// ios waits up to three seconds for a still screen, then compares native
|
|
137144
137201
|
// hierarchies.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2246 | (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;
|
|
@@ -6820,6 +6820,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
6820
6820
|
const types = [];
|
|
6821
6821
|
const functionTypes = [];
|
|
6822
6822
|
const definitions = [];
|
|
6823
|
+
const functionImports = /* @__PURE__ */ new Map();
|
|
6823
6824
|
let usesDlsym = false;
|
|
6824
6825
|
let usesDlerror = false;
|
|
6825
6826
|
const usedSymbols = /* @__PURE__ */ new Set();
|
|
@@ -6889,6 +6890,11 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
6889
6890
|
const isDlsym = instrumentDynamicLookups && module2 === "env" && name2 === "dlsym" && kind === 0;
|
|
6890
6891
|
const isDlerror = instrumentDynamicLookups && module2 === "env" && name2 === "dlerror" && kind === 0;
|
|
6891
6892
|
if (module2 === "env" && names.has(name2)) usedSymbols.add(name2);
|
|
6893
|
+
if (module2 === "env" && kind === 0 && names.has(name2)) {
|
|
6894
|
+
const type = types[functionType];
|
|
6895
|
+
if (!type) throw new Error(`missing import type for ${name2}`);
|
|
6896
|
+
functionImports.set(name2, type);
|
|
6897
|
+
}
|
|
6892
6898
|
if (isDlsym || isDlerror) {
|
|
6893
6899
|
const type = types[functionType];
|
|
6894
6900
|
const expected = isDlsym ? "126,126:126" : ":126";
|
|
@@ -7038,6 +7044,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
7038
7044
|
return {
|
|
7039
7045
|
bytes: Buffer.concat(sections2),
|
|
7040
7046
|
definitions,
|
|
7047
|
+
functionImports,
|
|
7041
7048
|
usesDlsym,
|
|
7042
7049
|
usedSymbols: [...usedSymbols]
|
|
7043
7050
|
};
|
|
@@ -7085,7 +7092,13 @@ function createGuestImageLedger(input) {
|
|
|
7085
7092
|
/* @__PURE__ */ new Set()
|
|
7086
7093
|
);
|
|
7087
7094
|
if (rewritten.usesDlsym) callersUsingDlsym.add(image.id);
|
|
7088
|
-
units.push({
|
|
7095
|
+
units.push({
|
|
7096
|
+
image: image.id,
|
|
7097
|
+
object: object3,
|
|
7098
|
+
aliases,
|
|
7099
|
+
usedSymbols: rewritten.usedSymbols,
|
|
7100
|
+
functionImports: rewritten.functionImports
|
|
7101
|
+
});
|
|
7089
7102
|
for (const symbol of rewritten.definitions) {
|
|
7090
7103
|
if (symbol.type && symbol.type.results.length > 1)
|
|
7091
7104
|
throw new Error(`multiple results for ${symbol.name}`);
|
|
@@ -7170,9 +7183,33 @@ function createGuestImageLedger(input) {
|
|
|
7170
7183
|
bindings.set(binding.symbol, matches[0].alias);
|
|
7171
7184
|
startup.set(binding.object, bindings);
|
|
7172
7185
|
}
|
|
7173
|
-
const
|
|
7186
|
+
const resultWrappers = /* @__PURE__ */ new Map();
|
|
7187
|
+
const definitionsByAlias = /* @__PURE__ */ new Map();
|
|
7188
|
+
for (const definition of definitions) {
|
|
7189
|
+
const previous = definitionsByAlias.get(definition.alias);
|
|
7190
|
+
if (!previous || previous.weak && !definition.weak)
|
|
7191
|
+
definitionsByAlias.set(definition.alias, definition);
|
|
7192
|
+
}
|
|
7193
|
+
const objects = units.map(({ image, object: object3, aliases, functionImports }) => {
|
|
7174
7194
|
const bindings = new Map(bindingsByImage.get(image));
|
|
7175
7195
|
for (const [name2, alias] of startup.get(object3.path) ?? []) bindings.set(name2, alias);
|
|
7196
|
+
for (const [name2, type] of functionImports) {
|
|
7197
|
+
const alias = bindings.get(name2);
|
|
7198
|
+
const provider = alias === void 0 ? void 0 : definitionsByAlias.get(alias);
|
|
7199
|
+
if (!provider || provider.kind !== "function" || provider.result !== "i32" || type.results.length !== 1 || type.results[0] !== 126 || type.parameters.map(llvmType).join(",") !== provider.parameters.join(","))
|
|
7200
|
+
continue;
|
|
7201
|
+
const key = `${image}:${provider.alias}`;
|
|
7202
|
+
let wrapper = resultWrappers.get(key);
|
|
7203
|
+
if (!wrapper) {
|
|
7204
|
+
wrapper = {
|
|
7205
|
+
symbol: `__peach_integer_result_${image}_${resultWrappers.size}`,
|
|
7206
|
+
image,
|
|
7207
|
+
provider
|
|
7208
|
+
};
|
|
7209
|
+
resultWrappers.set(key, wrapper);
|
|
7210
|
+
}
|
|
7211
|
+
bindings.set(name2, wrapper.symbol);
|
|
7212
|
+
}
|
|
7176
7213
|
return {
|
|
7177
7214
|
path: object3.path,
|
|
7178
7215
|
instrumentDynamicLookups: object3.instrumentDynamicLookups,
|
|
@@ -7206,13 +7243,26 @@ function createGuestImageLedger(input) {
|
|
|
7206
7243
|
'target triple = "wasm64-unknown-wasip1"',
|
|
7207
7244
|
`@.names = private constant [${nameSize} x i8] c"${nameContents}"`
|
|
7208
7245
|
];
|
|
7209
|
-
|
|
7246
|
+
const declarations = new Map(exported);
|
|
7247
|
+
for (const { provider } of resultWrappers.values())
|
|
7248
|
+
declarations.set(provider.alias, provider);
|
|
7249
|
+
for (const definition of declarations.values()) {
|
|
7210
7250
|
if (definition.kind === "function")
|
|
7211
7251
|
ir.push(
|
|
7212
7252
|
`declare ${definition.result} @${definition.alias}(${definition.parameters.join(", ")})`
|
|
7213
7253
|
);
|
|
7214
7254
|
else ir.push(`@${definition.alias} = external global i8`);
|
|
7215
7255
|
}
|
|
7256
|
+
for (const { symbol, provider } of resultWrappers.values()) {
|
|
7257
|
+
const parameters = provider.parameters.map((type, index) => `${type} %arg${index}`);
|
|
7258
|
+
ir.push(
|
|
7259
|
+
`define i64 @${symbol}(${parameters.join(", ")}) {`,
|
|
7260
|
+
` %word = call i32 @${provider.alias}(${parameters.join(", ")})`,
|
|
7261
|
+
" %result = zext i32 %word to i64",
|
|
7262
|
+
" ret i64 %result",
|
|
7263
|
+
"}"
|
|
7264
|
+
);
|
|
7265
|
+
}
|
|
7216
7266
|
ir.push(`@__peach_dyld_symbols = constant [${exported.size} x { ptr, i32, ptr }] [`);
|
|
7217
7267
|
ir.push(
|
|
7218
7268
|
[...exported.values()].map(
|
|
@@ -7251,10 +7301,13 @@ function createGuestImageLedger(input) {
|
|
|
7251
7301
|
callers: input.callers,
|
|
7252
7302
|
definitions,
|
|
7253
7303
|
objects,
|
|
7254
|
-
callerWrappers: [
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7304
|
+
callerWrappers: [
|
|
7305
|
+
...[...callersUsingDlsym].map((image) => ({
|
|
7306
|
+
symbol: `__peach_dlsym_caller_${image}`,
|
|
7307
|
+
image
|
|
7308
|
+
})),
|
|
7309
|
+
...[...resultWrappers.values()].map(({ symbol, image }) => ({ symbol, image }))
|
|
7310
|
+
],
|
|
7258
7311
|
llvmIR: ir.join("\n") + "\n"
|
|
7259
7312
|
};
|
|
7260
7313
|
}
|
|
@@ -9048,7 +9101,9 @@ function linkGuestImages(options) {
|
|
|
9048
9101
|
return { selected: selected2, ledger: ledger2 };
|
|
9049
9102
|
};
|
|
9050
9103
|
let prepared = prepare(false);
|
|
9051
|
-
const provider = prepared.ledger.callerWrappers.
|
|
9104
|
+
const provider = prepared.ledger.callerWrappers.some(
|
|
9105
|
+
({ symbol }) => symbol.startsWith("__peach_dlsym_caller_")
|
|
9106
|
+
);
|
|
9052
9107
|
if (provider) prepared = prepare(true);
|
|
9053
9108
|
const { selected, ledger } = prepared;
|
|
9054
9109
|
const replacements = /* @__PURE__ */ new Map();
|
|
@@ -12989,7 +13044,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
12989
13044
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
12990
13045
|
var MULTI_MANIFEST_VERSION = 68;
|
|
12991
13046
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
12992
|
-
var compilerSourceDigest = true ? "
|
|
13047
|
+
var compilerSourceDigest = true ? "cd22143ba7a25fbe9f28d0187e37d40819453c2914c0808fbb77c738ef7e105d" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
12993
13048
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
12994
13049
|
const hash = (0, import_node_crypto13.createHash)("sha256");
|
|
12995
13050
|
hash.update(`swift-compile
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2246 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/swift-compile.ts
|
|
4
4
|
import {
|
|
@@ -6765,6 +6765,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
6765
6765
|
const types = [];
|
|
6766
6766
|
const functionTypes = [];
|
|
6767
6767
|
const definitions = [];
|
|
6768
|
+
const functionImports = /* @__PURE__ */ new Map();
|
|
6768
6769
|
let usesDlsym = false;
|
|
6769
6770
|
let usesDlerror = false;
|
|
6770
6771
|
const usedSymbols = /* @__PURE__ */ new Set();
|
|
@@ -6834,6 +6835,11 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
6834
6835
|
const isDlsym = instrumentDynamicLookups && module === "env" && name2 === "dlsym" && kind === 0;
|
|
6835
6836
|
const isDlerror = instrumentDynamicLookups && module === "env" && name2 === "dlerror" && kind === 0;
|
|
6836
6837
|
if (module === "env" && names.has(name2)) usedSymbols.add(name2);
|
|
6838
|
+
if (module === "env" && kind === 0 && names.has(name2)) {
|
|
6839
|
+
const type = types[functionType];
|
|
6840
|
+
if (!type) throw new Error(`missing import type for ${name2}`);
|
|
6841
|
+
functionImports.set(name2, type);
|
|
6842
|
+
}
|
|
6837
6843
|
if (isDlsym || isDlerror) {
|
|
6838
6844
|
const type = types[functionType];
|
|
6839
6845
|
const expected = isDlsym ? "126,126:126" : ":126";
|
|
@@ -6983,6 +6989,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
|
|
|
6983
6989
|
return {
|
|
6984
6990
|
bytes: Buffer.concat(sections2),
|
|
6985
6991
|
definitions,
|
|
6992
|
+
functionImports,
|
|
6986
6993
|
usesDlsym,
|
|
6987
6994
|
usedSymbols: [...usedSymbols]
|
|
6988
6995
|
};
|
|
@@ -7030,7 +7037,13 @@ function createGuestImageLedger(input) {
|
|
|
7030
7037
|
/* @__PURE__ */ new Set()
|
|
7031
7038
|
);
|
|
7032
7039
|
if (rewritten.usesDlsym) callersUsingDlsym.add(image.id);
|
|
7033
|
-
units.push({
|
|
7040
|
+
units.push({
|
|
7041
|
+
image: image.id,
|
|
7042
|
+
object: object3,
|
|
7043
|
+
aliases,
|
|
7044
|
+
usedSymbols: rewritten.usedSymbols,
|
|
7045
|
+
functionImports: rewritten.functionImports
|
|
7046
|
+
});
|
|
7034
7047
|
for (const symbol of rewritten.definitions) {
|
|
7035
7048
|
if (symbol.type && symbol.type.results.length > 1)
|
|
7036
7049
|
throw new Error(`multiple results for ${symbol.name}`);
|
|
@@ -7115,9 +7128,33 @@ function createGuestImageLedger(input) {
|
|
|
7115
7128
|
bindings.set(binding.symbol, matches[0].alias);
|
|
7116
7129
|
startup.set(binding.object, bindings);
|
|
7117
7130
|
}
|
|
7118
|
-
const
|
|
7131
|
+
const resultWrappers = /* @__PURE__ */ new Map();
|
|
7132
|
+
const definitionsByAlias = /* @__PURE__ */ new Map();
|
|
7133
|
+
for (const definition of definitions) {
|
|
7134
|
+
const previous = definitionsByAlias.get(definition.alias);
|
|
7135
|
+
if (!previous || previous.weak && !definition.weak)
|
|
7136
|
+
definitionsByAlias.set(definition.alias, definition);
|
|
7137
|
+
}
|
|
7138
|
+
const objects = units.map(({ image, object: object3, aliases, functionImports }) => {
|
|
7119
7139
|
const bindings = new Map(bindingsByImage.get(image));
|
|
7120
7140
|
for (const [name2, alias] of startup.get(object3.path) ?? []) bindings.set(name2, alias);
|
|
7141
|
+
for (const [name2, type] of functionImports) {
|
|
7142
|
+
const alias = bindings.get(name2);
|
|
7143
|
+
const provider = alias === void 0 ? void 0 : definitionsByAlias.get(alias);
|
|
7144
|
+
if (!provider || provider.kind !== "function" || provider.result !== "i32" || type.results.length !== 1 || type.results[0] !== 126 || type.parameters.map(llvmType).join(",") !== provider.parameters.join(","))
|
|
7145
|
+
continue;
|
|
7146
|
+
const key = `${image}:${provider.alias}`;
|
|
7147
|
+
let wrapper = resultWrappers.get(key);
|
|
7148
|
+
if (!wrapper) {
|
|
7149
|
+
wrapper = {
|
|
7150
|
+
symbol: `__peach_integer_result_${image}_${resultWrappers.size}`,
|
|
7151
|
+
image,
|
|
7152
|
+
provider
|
|
7153
|
+
};
|
|
7154
|
+
resultWrappers.set(key, wrapper);
|
|
7155
|
+
}
|
|
7156
|
+
bindings.set(name2, wrapper.symbol);
|
|
7157
|
+
}
|
|
7121
7158
|
return {
|
|
7122
7159
|
path: object3.path,
|
|
7123
7160
|
instrumentDynamicLookups: object3.instrumentDynamicLookups,
|
|
@@ -7151,13 +7188,26 @@ function createGuestImageLedger(input) {
|
|
|
7151
7188
|
'target triple = "wasm64-unknown-wasip1"',
|
|
7152
7189
|
`@.names = private constant [${nameSize} x i8] c"${nameContents}"`
|
|
7153
7190
|
];
|
|
7154
|
-
|
|
7191
|
+
const declarations = new Map(exported);
|
|
7192
|
+
for (const { provider } of resultWrappers.values())
|
|
7193
|
+
declarations.set(provider.alias, provider);
|
|
7194
|
+
for (const definition of declarations.values()) {
|
|
7155
7195
|
if (definition.kind === "function")
|
|
7156
7196
|
ir.push(
|
|
7157
7197
|
`declare ${definition.result} @${definition.alias}(${definition.parameters.join(", ")})`
|
|
7158
7198
|
);
|
|
7159
7199
|
else ir.push(`@${definition.alias} = external global i8`);
|
|
7160
7200
|
}
|
|
7201
|
+
for (const { symbol, provider } of resultWrappers.values()) {
|
|
7202
|
+
const parameters = provider.parameters.map((type, index) => `${type} %arg${index}`);
|
|
7203
|
+
ir.push(
|
|
7204
|
+
`define i64 @${symbol}(${parameters.join(", ")}) {`,
|
|
7205
|
+
` %word = call i32 @${provider.alias}(${parameters.join(", ")})`,
|
|
7206
|
+
" %result = zext i32 %word to i64",
|
|
7207
|
+
" ret i64 %result",
|
|
7208
|
+
"}"
|
|
7209
|
+
);
|
|
7210
|
+
}
|
|
7161
7211
|
ir.push(`@__peach_dyld_symbols = constant [${exported.size} x { ptr, i32, ptr }] [`);
|
|
7162
7212
|
ir.push(
|
|
7163
7213
|
[...exported.values()].map(
|
|
@@ -7196,10 +7246,13 @@ function createGuestImageLedger(input) {
|
|
|
7196
7246
|
callers: input.callers,
|
|
7197
7247
|
definitions,
|
|
7198
7248
|
objects,
|
|
7199
|
-
callerWrappers: [
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7249
|
+
callerWrappers: [
|
|
7250
|
+
...[...callersUsingDlsym].map((image) => ({
|
|
7251
|
+
symbol: `__peach_dlsym_caller_${image}`,
|
|
7252
|
+
image
|
|
7253
|
+
})),
|
|
7254
|
+
...[...resultWrappers.values()].map(({ symbol, image }) => ({ symbol, image }))
|
|
7255
|
+
],
|
|
7203
7256
|
llvmIR: ir.join("\n") + "\n"
|
|
7204
7257
|
};
|
|
7205
7258
|
}
|
|
@@ -8994,7 +9047,9 @@ function linkGuestImages(options) {
|
|
|
8994
9047
|
return { selected: selected2, ledger: ledger2 };
|
|
8995
9048
|
};
|
|
8996
9049
|
let prepared = prepare(false);
|
|
8997
|
-
const provider = prepared.ledger.callerWrappers.
|
|
9050
|
+
const provider = prepared.ledger.callerWrappers.some(
|
|
9051
|
+
({ symbol }) => symbol.startsWith("__peach_dlsym_caller_")
|
|
9052
|
+
);
|
|
8998
9053
|
if (provider) prepared = prepare(true);
|
|
8999
9054
|
const { selected, ledger } = prepared;
|
|
9000
9055
|
const replacements = /* @__PURE__ */ new Map();
|
|
@@ -12967,7 +13022,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
12967
13022
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
12968
13023
|
var MULTI_MANIFEST_VERSION = 68;
|
|
12969
13024
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
12970
|
-
var compilerSourceDigest = true ? "
|
|
13025
|
+
var compilerSourceDigest = true ? "cd22143ba7a25fbe9f28d0187e37d40819453c2914c0808fbb77c738ef7e105d" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
12971
13026
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
12972
13027
|
const hash = createHash13("sha256");
|
|
12973
13028
|
hash.update(`swift-compile
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2246 | (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.2246 | (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.2246 | (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.2246 | (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;
|