peachsim 0.1.2528 → 0.1.2530
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 +62 -115
- package/cli/commands/flow.ts +72 -29
- package/cli/commands/inspect/settling.ts +17 -0
- package/cli/commands/test.ts +19 -14
- 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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +12 -9
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +16 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-XCLML2QI.mjs → acorn-YVRVG3K7.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-ZTLF52SH.mjs → chunk-2WH6I726.mjs} +12 -12
- package/dist-lib/esm-chunks/{chunk-QLN4PL2B.mjs → chunk-3V3QWLVG.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-V6ZGGSRX.mjs → chunk-6PHCBORD.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-W42SUW36.mjs → chunk-AFCI2JQL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YXALRIKU.mjs → chunk-B5YOIP4V.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2RYVAXP7.mjs → chunk-BACARNR4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JC4USRP6.mjs → chunk-EQRX3NE2.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-PTEP7NR5.mjs → chunk-FRV2MWLR.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-PQHFJQ36.mjs → chunk-GUIH6C3J.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-W6YW6CIA.mjs → chunk-IYR5Q33V.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QWWCXLPI.mjs → chunk-NBOGCAWQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YAUEK3DM.mjs → chunk-QQ3SVDCR.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HBJSPSXY.mjs → chunk-VSH5P6JS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WM5Y3PCV.mjs → chunk-WM26AFHQ.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-3Z2XYMKR.mjs → chunk-X3MXQKQ3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-KWEGJS22.mjs → chunk-XY5OJABO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SFON4YYW.mjs → chunk-Y2NPAJV3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6HN3M5HU.mjs → chunk-YO6WUDWP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UI27RY3A.mjs → chunk-YOIJ4H4H.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IW655T4F.mjs → chunk-ZKAF7FRZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7EUYLPZR.mjs → chunk-ZNYML6R7.mjs} +4 -4
- package/dist-lib/esm-chunks/{metro-layout-parser-JCGEX4NM.mjs → metro-layout-parser-MZ26V7TP.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-SHFZEOJF.mjs → swift-package-prebuilt-SK54BG3Y.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-5HDWRT2F.mjs → swift-sdk-app-module-4EUT66BB.mjs} +13 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-N5ELFWMH.mjs → swift-sdk-image-2Y4Q3HYS.mjs} +13 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-25DMYDZW.mjs → swift-sdk-image-producer-KQC2JCMQ.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +11 -8
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +140 -106
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +16 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +15 -15
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +79 -79
- package/dist-lib/public-origins-lib.json +71 -69
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +16 -1
- package/dist-lib/sdk.mjs +22 -7
- package/dist-lib/skills.cjs +252 -222
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +10 -10
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +5 -5
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/smol-toml.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/dist-types/packages/peach-engine/src/engine/nativeScrollContract.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/swift-distribution.lock.json +5 -0
- package/src/swift-startup-split.ts +66 -61
- package/src/turbo-source.ts +7 -4
- package/src/wasm-lazy-split.ts +46 -24
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2530 | (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;
|
|
@@ -35508,13 +35508,13 @@ var init_swift_standin_digest = __esm({
|
|
|
35508
35508
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
35509
35509
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
35510
35510
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
35511
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
35511
|
+
STANDIN_SOURCE_DIGEST = true ? "3883edfb29d2c6c02053cf80f32a9f325a44c203f3c988419ca5920a3dcbca8e" : standinSourceDigest();
|
|
35512
35512
|
}
|
|
35513
35513
|
});
|
|
35514
35514
|
|
|
35515
35515
|
// src/expo-native-compiler-digest.ts
|
|
35516
35516
|
function expoNativeCompilerDigestValue() {
|
|
35517
|
-
return true ? "
|
|
35517
|
+
return true ? "b22fea800cc7cd0234dc86833d4d3fb630afaf2ed9d8b426cb7b1f33097a1a92" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
35518
35518
|
}
|
|
35519
35519
|
var import_node_crypto12;
|
|
35520
35520
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -119902,19 +119902,23 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
|
|
|
119902
119902
|
(0, import_node_fs130.writeFileSync)(slotFile, slots.join("\n") + "\n");
|
|
119903
119903
|
const tableTool = (0, import_node_path130.join)((0, import_node_path130.dirname)(binaryen), "wasm-table-guard");
|
|
119904
119904
|
let primaryTable;
|
|
119905
|
-
const guard = async (file, lazy) => {
|
|
119905
|
+
const guard = async (file, lazy, env2) => {
|
|
119906
119906
|
const guarded = file.replace(/\.wasm$/, ".guarded.wasm");
|
|
119907
119907
|
let tableMinimum = 0;
|
|
119908
119908
|
if (primaryTable && !hasFunctionTable((0, import_node_fs130.readFileSync)(file))) (0, import_node_fs130.copyFileSync)(file, guarded);
|
|
119909
119909
|
else {
|
|
119910
|
-
const { stdout } = await run11(
|
|
119911
|
-
|
|
119912
|
-
|
|
119913
|
-
|
|
119914
|
-
|
|
119915
|
-
|
|
119916
|
-
|
|
119917
|
-
|
|
119910
|
+
const { stdout } = await run11(
|
|
119911
|
+
tableTool,
|
|
119912
|
+
[
|
|
119913
|
+
file,
|
|
119914
|
+
guarded,
|
|
119915
|
+
named ? "1" : "0",
|
|
119916
|
+
shared ? "1" : "0",
|
|
119917
|
+
slotFile,
|
|
119918
|
+
...adapted ? ["adapted"] : []
|
|
119919
|
+
],
|
|
119920
|
+
{ env: env2 }
|
|
119921
|
+
);
|
|
119918
119922
|
const layout2 = JSON.parse(stdout);
|
|
119919
119923
|
if (typeof layout2 !== "object" || layout2 === null || !("tableMinimum" in layout2) || typeof layout2.tableMinimum !== "number" || !Number.isInteger(layout2.tableMinimum) || layout2.tableMinimum < 0)
|
|
119920
119924
|
throw new Error("native table tool emitted an invalid split table minimum");
|
|
@@ -119949,22 +119953,33 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
|
|
|
119949
119953
|
if (!primaryLazy.has(lazy)) members2.push(lazy);
|
|
119950
119954
|
lazyByGroup.set(group2, members2);
|
|
119951
119955
|
}
|
|
119952
|
-
const
|
|
119953
|
-
const dyldGroups = [];
|
|
119954
|
-
for (const [id, slots2] of slotsByPart.entries()) {
|
|
119956
|
+
const parts = slotsByPart.flatMap((slots2, id) => {
|
|
119955
119957
|
const lazy = lazyByGroup.get(id);
|
|
119956
|
-
|
|
119957
|
-
|
|
119958
|
-
|
|
119959
|
-
|
|
119960
|
-
|
|
119961
|
-
|
|
119962
|
-
|
|
119963
|
-
|
|
119964
|
-
|
|
119965
|
-
|
|
119966
|
-
|
|
119967
|
-
|
|
119958
|
+
return slots2.length || lazy ? [{ id, slots: slots2, lazy }] : [];
|
|
119959
|
+
});
|
|
119960
|
+
if (!parts.length) return { primary: describePart(input), sides: [] };
|
|
119961
|
+
const admitted = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
119962
|
+
const requested = Number(process.env.BINARYEN_CORES);
|
|
119963
|
+
const jobs = Math.min(
|
|
119964
|
+
8,
|
|
119965
|
+
(0, import_node_os26.availableParallelism)(),
|
|
119966
|
+
Number.isInteger(admitted) && admitted > 0 ? admitted : 8,
|
|
119967
|
+
Number.isInteger(requested) && requested > 0 ? requested : 8
|
|
119968
|
+
);
|
|
119969
|
+
const env = jobs > 1 ? { ...process.env, BINARYEN_CORES: "1" } : void 0;
|
|
119970
|
+
const sides = await mapLimit(
|
|
119971
|
+
parts,
|
|
119972
|
+
jobs,
|
|
119973
|
+
async ({ id, slots: slots2, lazy }) => {
|
|
119974
|
+
const part = await guard((0, import_node_path130.join)(directory2, `side-${id}.wasm`), lazy, env);
|
|
119975
|
+
const bytes2 = (0, import_node_fs130.readFileSync)(part.file);
|
|
119976
|
+
assertWasmCodeOnly(bytes2);
|
|
119977
|
+
return { ...part, slots: slots2, sha256: (0, import_node_crypto77.createHash)("sha256").update(bytes2).digest("hex") };
|
|
119978
|
+
}
|
|
119979
|
+
);
|
|
119980
|
+
const dyldGroups = parts.flatMap(
|
|
119981
|
+
({ lazy }, part) => lazy ? [{ first: lazy[0], part }] : []
|
|
119982
|
+
);
|
|
119968
119983
|
return {
|
|
119969
119984
|
primary,
|
|
119970
119985
|
sides,
|
|
@@ -120027,17 +120042,20 @@ function describePart(file) {
|
|
|
120027
120042
|
);
|
|
120028
120043
|
return { file, functions, byteLength: bytes.byteLength };
|
|
120029
120044
|
}
|
|
120030
|
-
var import_node_child_process64, import_node_crypto77, import_node_fs130, import_node_path130, import_node_util14, run11, MAX_MODULE_FUNCTIONS, MAX_START_FUNCTIONS, SIDE_FUNCTIONS, SIDE_CODE_BYTES, FEATURES2, featuresOf;
|
|
120045
|
+
var import_node_child_process64, import_node_crypto77, import_node_fs130, import_node_os26, import_node_path130, import_node_util14, run11, MAX_MODULE_FUNCTIONS, MAX_START_FUNCTIONS, SIDE_FUNCTIONS, SIDE_CODE_BYTES, FEATURES2, featuresOf;
|
|
120031
120046
|
var init_wasm_lazy_split = __esm({
|
|
120032
120047
|
"src/wasm-lazy-split.ts"() {
|
|
120033
120048
|
"use strict";
|
|
120034
120049
|
import_node_child_process64 = require("node:child_process");
|
|
120035
120050
|
import_node_crypto77 = require("node:crypto");
|
|
120036
120051
|
import_node_fs130 = require("node:fs");
|
|
120052
|
+
import_node_os26 = require("node:os");
|
|
120037
120053
|
import_node_path130 = require("node:path");
|
|
120038
120054
|
import_node_util14 = require("node:util");
|
|
120055
|
+
init_mapLimit();
|
|
120039
120056
|
init_nativeDyldTableContract();
|
|
120040
120057
|
init_nativeWasmContract();
|
|
120058
|
+
init_admitted_mac_build();
|
|
120041
120059
|
init_swift_guest_dyld_functions();
|
|
120042
120060
|
init_swift_sdk_image_wasm();
|
|
120043
120061
|
init_wasm_features();
|
|
@@ -120131,7 +120149,7 @@ async function splitSwiftApp(bytes, launch2) {
|
|
|
120131
120149
|
const environment = launch2.environment.length ? `-${digest2(Buffer.from(JSON.stringify(launch2.environment)))}` : "";
|
|
120132
120150
|
const guest = launch2.guest ? `-${digest2(Buffer.from(launch2.guest.source))}` : "";
|
|
120133
120151
|
const args = launch2.arguments?.length ? `-argv-${digest2(Buffer.from(JSON.stringify(launch2.arguments)))}` : "";
|
|
120134
|
-
const cache = (0, import_node_path131.join)(parent, `startup-
|
|
120152
|
+
const cache = (0, import_node_path131.join)(parent, `startup-v8-${platform}${environment}${guest}${args}`);
|
|
120135
120153
|
return readSwiftStartupImage(cache) ?? await withStartupWork(bytes, async (work) => {
|
|
120136
120154
|
const profile = (0, import_node_path131.join)(work.directory, "startup.profile");
|
|
120137
120155
|
await profileStartup(work, launch2, "url", profile);
|
|
@@ -120139,7 +120157,7 @@ async function splitSwiftApp(bytes, launch2) {
|
|
|
120139
120157
|
});
|
|
120140
120158
|
}
|
|
120141
120159
|
async function splitSwiftSdkImage(bytes, directory2, launch2, app) {
|
|
120142
|
-
const profiles2 = (0, import_node_path131.join)(directory2, `profiles-
|
|
120160
|
+
const profiles2 = (0, import_node_path131.join)(directory2, `profiles-v3-${platform}`);
|
|
120143
120161
|
const prefix = `${app}-`;
|
|
120144
120162
|
const own2 = (0, import_node_path131.join)(profiles2, `${prefix}${launch2.artifactHash}.profile`);
|
|
120145
120163
|
const names = () => (0, import_node_fs131.readdirSync)(profiles2).filter((name3) => !name3.startsWith(".") && name3.endsWith(".profile")).sort();
|
|
@@ -120149,7 +120167,7 @@ async function splitSwiftSdkImage(bytes, directory2, launch2, app) {
|
|
|
120149
120167
|
for (const file of files2) hash.update(file);
|
|
120150
120168
|
const cache = (0, import_node_path131.join)(
|
|
120151
120169
|
directory2,
|
|
120152
|
-
`startup-
|
|
120170
|
+
`startup-v10-${platform}-${hash.digest("hex").slice(0, 16)}`
|
|
120153
120171
|
);
|
|
120154
120172
|
return { files: files2, cache };
|
|
120155
120173
|
};
|
|
@@ -120192,7 +120210,7 @@ async function splitSwiftSdkImage(bytes, directory2, launch2, app) {
|
|
|
120192
120210
|
}
|
|
120193
120211
|
async function withStartupWork(bytes, run18) {
|
|
120194
120212
|
const binaryen = await installWasmOpt();
|
|
120195
|
-
const directory2 = (0, import_node_fs131.mkdtempSync)((0, import_node_path131.join)((0,
|
|
120213
|
+
const directory2 = (0, import_node_fs131.mkdtempSync)((0, import_node_path131.join)((0, import_node_os27.tmpdir)(), "peach-swift-startup-"));
|
|
120196
120214
|
try {
|
|
120197
120215
|
const original = (0, import_node_path131.join)(directory2, "full.wasm");
|
|
120198
120216
|
(0, import_node_fs131.writeFileSync)(original, makeWasmFunctionNamesSingleLine(bytes));
|
|
@@ -120203,22 +120221,15 @@ async function withStartupWork(bytes, run18) {
|
|
|
120203
120221
|
}
|
|
120204
120222
|
async function profileStartup(work, launch2, role, output) {
|
|
120205
120223
|
const instrumented = (0, import_node_path131.join)(work.directory, "instrumented.wasm");
|
|
120206
|
-
const firstPaint = (0, import_node_path131.join)(work.directory, "first-paint.profile");
|
|
120207
|
-
const afterPaint = (0, import_node_path131.join)(work.directory, "after-paint.profile");
|
|
120208
120224
|
const functionCount = await instrumentNativeWasm(
|
|
120209
120225
|
work.original,
|
|
120210
120226
|
instrumented,
|
|
120211
120227
|
work.binaryen
|
|
120212
120228
|
);
|
|
120213
120229
|
(0, import_node_fs131.writeFileSync)(
|
|
120214
|
-
|
|
120215
|
-
await
|
|
120216
|
-
);
|
|
120217
|
-
(0, import_node_fs131.writeFileSync)(
|
|
120218
|
-
afterPaint,
|
|
120219
|
-
await recordStartup(launch2, instrumented, functionCount, postPaintProfileMs, role)
|
|
120230
|
+
output,
|
|
120231
|
+
await bootSwiftPreview(launch2, { instrumented, functionCount, role })
|
|
120220
120232
|
);
|
|
120221
|
-
await mergeNativeWasmProfiles(work.binaryen, [firstPaint, afterPaint], output);
|
|
120222
120233
|
}
|
|
120223
120234
|
async function storeStartupSplit(work, profile, parent, cache, partCodeBytes) {
|
|
120224
120235
|
const split = await splitNativeWasm(
|
|
@@ -120272,9 +120283,6 @@ async function storeStartupSplit(work, profile, parent, cache, partCodeBytes) {
|
|
|
120272
120283
|
}
|
|
120273
120284
|
return result;
|
|
120274
120285
|
}
|
|
120275
|
-
function recordStartup(launch2, instrumented, functionCount, afterPaintMs, role) {
|
|
120276
|
-
return bootSwiftPreview(launch2, { instrumented, functionCount, afterPaintMs, role });
|
|
120277
|
-
}
|
|
120278
120286
|
async function bootSwiftPreview(launch2, profile) {
|
|
120279
120287
|
const browser = await launchProvisionedPlaywright({
|
|
120280
120288
|
chromiumSandbox: true,
|
|
@@ -120285,11 +120293,17 @@ async function bootSwiftPreview(launch2, profile) {
|
|
|
120285
120293
|
}
|
|
120286
120294
|
});
|
|
120287
120295
|
const profileLength = profile ? 8 + 4 * profile.functionCount : 0;
|
|
120288
|
-
let
|
|
120289
|
-
|
|
120296
|
+
let capture = Promise.withResolvers();
|
|
120297
|
+
let receive = (_bytes) => {
|
|
120298
|
+
};
|
|
120299
|
+
const requestCapture = () => {
|
|
120300
|
+
const { promise, resolve: resolve15 } = Promise.withResolvers();
|
|
120290
120301
|
receive = resolve15;
|
|
120291
|
-
|
|
120292
|
-
|
|
120302
|
+
const asked = capture;
|
|
120303
|
+
capture = Promise.withResolvers();
|
|
120304
|
+
asked.resolve(true);
|
|
120305
|
+
return promise;
|
|
120306
|
+
};
|
|
120293
120307
|
const guest = launch2.guest ?? { packageName, source: swiftGuestBundle(packageName) };
|
|
120294
120308
|
const metadataPath = SWIFT_PACKAGE_PATH + encodeURIComponent(guest.packageName);
|
|
120295
120309
|
const server = (0, import_node_http3.createServer)(async (request, response) => {
|
|
@@ -120299,8 +120313,8 @@ async function bootSwiftPreview(launch2, profile) {
|
|
|
120299
120313
|
const { pathname } = url;
|
|
120300
120314
|
setRuntimeIsolationHeaders(response);
|
|
120301
120315
|
if (profile && pathname === NATIVE_PROFILE_ENDPOINT && request.method === "GET") {
|
|
120302
|
-
await
|
|
120303
|
-
response.writeHead(204, { "cache-control": "no-store" }).end();
|
|
120316
|
+
const again = await capture.promise;
|
|
120317
|
+
response.writeHead(again ? 204 : 410, { "cache-control": "no-store" }).end();
|
|
120304
120318
|
return;
|
|
120305
120319
|
}
|
|
120306
120320
|
if (profile && pathname === NATIVE_PROFILE_ENDPOINT && request.method === "POST") {
|
|
@@ -120390,41 +120404,58 @@ async function bootSwiftPreview(launch2, profile) {
|
|
|
120390
120404
|
return false;
|
|
120391
120405
|
}
|
|
120392
120406
|
);
|
|
120393
|
-
if (!
|
|
120394
|
-
|
|
120395
|
-
|
|
120396
|
-
[
|
|
120397
|
-
|
|
120398
|
-
|
|
120399
|
-
|
|
120400
|
-
|
|
120401
|
-
|
|
120402
|
-
|
|
120403
|
-
|
|
120404
|
-
|
|
120405
|
-
|
|
120406
|
-
|
|
120407
|
-
|
|
120408
|
-
|
|
120409
|
-
|
|
120410
|
-
|
|
120411
|
-
|
|
120412
|
-
|
|
120413
|
-
|
|
120414
|
-
|
|
120415
|
-
)
|
|
120416
|
-
|
|
120417
|
-
|
|
120418
|
-
|
|
120419
|
-
|
|
120420
|
-
}
|
|
120407
|
+
if (!painted)
|
|
120408
|
+
throw new Error(
|
|
120409
|
+
[
|
|
120410
|
+
launchErrors.find((error) => error.startsWith("SwiftCrash:"))?.split("\n")[0] ?? "app did not paint",
|
|
120411
|
+
...launchErrors
|
|
120412
|
+
].join("\n")
|
|
120413
|
+
);
|
|
120414
|
+
if (!profile) return;
|
|
120415
|
+
const collect = async () => {
|
|
120416
|
+
let deadline;
|
|
120417
|
+
try {
|
|
120418
|
+
return await Promise.race([
|
|
120419
|
+
requestCapture(),
|
|
120420
|
+
new Promise((_, reject) => {
|
|
120421
|
+
deadline = setTimeout(
|
|
120422
|
+
() => reject(
|
|
120423
|
+
new Error(
|
|
120424
|
+
["app reached no startup profile", ...launchErrors].join("\n")
|
|
120425
|
+
)
|
|
120426
|
+
),
|
|
120427
|
+
5e3
|
|
120428
|
+
);
|
|
120429
|
+
})
|
|
120430
|
+
]);
|
|
120431
|
+
} finally {
|
|
120432
|
+
clearTimeout(deadline);
|
|
120433
|
+
}
|
|
120434
|
+
};
|
|
120435
|
+
const ran = (bytes) => {
|
|
120436
|
+
let count = 0;
|
|
120437
|
+
for (let offset = 8; offset < bytes.length; offset += 4)
|
|
120438
|
+
if (bytes.readUInt32LE(offset)) count++;
|
|
120439
|
+
return count;
|
|
120440
|
+
};
|
|
120441
|
+
const window2 = Date.now() + profileWindowMs;
|
|
120442
|
+
let captured = await collect();
|
|
120443
|
+
for (let count = ran(captured); Date.now() < window2; ) {
|
|
120444
|
+
await page.waitForTimeout(profileQuietMs);
|
|
120445
|
+
const next = await collect();
|
|
120446
|
+
const nextCount = ran(next);
|
|
120447
|
+
captured = next;
|
|
120448
|
+
if (nextCount === count) break;
|
|
120449
|
+
count = nextCount;
|
|
120450
|
+
}
|
|
120451
|
+
return captured;
|
|
120421
120452
|
} finally {
|
|
120422
|
-
|
|
120453
|
+
capture.resolve(false);
|
|
120423
120454
|
await browser.close();
|
|
120424
120455
|
server.close();
|
|
120425
120456
|
}
|
|
120426
120457
|
}
|
|
120427
|
-
var import_node_crypto78, import_node_fs131, import_node_http3, import_node_https2,
|
|
120458
|
+
var import_node_crypto78, import_node_fs131, import_node_http3, import_node_https2, import_node_os27, import_node_path131, packageName, guestPath, appPath, profileWindowMs, profileQuietMs, digest2, partDigest, platform;
|
|
120428
120459
|
var init_swift_startup_split = __esm({
|
|
120429
120460
|
"src/swift-startup-split.ts"() {
|
|
120430
120461
|
"use strict";
|
|
@@ -120432,7 +120463,7 @@ var init_swift_startup_split = __esm({
|
|
|
120432
120463
|
import_node_fs131 = require("node:fs");
|
|
120433
120464
|
import_node_http3 = require("node:http");
|
|
120434
120465
|
import_node_https2 = require("node:https");
|
|
120435
|
-
|
|
120466
|
+
import_node_os27 = require("node:os");
|
|
120436
120467
|
import_node_path131 = require("node:path");
|
|
120437
120468
|
init_simulator_route2();
|
|
120438
120469
|
init_nativeWasmContract();
|
|
@@ -120452,7 +120483,7 @@ var init_swift_startup_split = __esm({
|
|
|
120452
120483
|
guestPath = "/__peach/swift-guest.js";
|
|
120453
120484
|
appPath = "/__peach/swift/startup.wasm";
|
|
120454
120485
|
profileWindowMs = 3e4;
|
|
120455
|
-
|
|
120486
|
+
profileQuietMs = 2e3;
|
|
120456
120487
|
digest2 = (bytes) => (0, import_node_crypto78.createHash)("sha256").update(bytes).digest("hex");
|
|
120457
120488
|
partDigest = /^[a-f0-9]{64}$/;
|
|
120458
120489
|
platform = `${process.platform}-${process.arch}`;
|
|
@@ -122144,7 +122175,7 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs2, resourceBundles) {
|
|
|
122144
122175
|
}
|
|
122145
122176
|
}
|
|
122146
122177
|
if (xcode?.app.postBundleScripts.length) {
|
|
122147
|
-
const dir = import_node_fs132.default.mkdtempSync(import_node_path132.default.join(
|
|
122178
|
+
const dir = import_node_fs132.default.mkdtempSync(import_node_path132.default.join(import_node_os28.default.tmpdir(), "peach-xcode-bundle-"));
|
|
122148
122179
|
const wrapper = import_node_path132.default.basename(xcode.app.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")) || `${xcode.app.name}.app`;
|
|
122149
122180
|
const bundle = import_node_path132.default.join(dir, wrapper);
|
|
122150
122181
|
try {
|
|
@@ -123569,7 +123600,7 @@ function disposeSwiftProject(packagePath, signal) {
|
|
|
123569
123600
|
xcodeProjects().delete(packagePath);
|
|
123570
123601
|
sourceEntries().delete(packagePath);
|
|
123571
123602
|
}
|
|
123572
|
-
var import_node_async_hooks2, import_node_child_process65, import_node_crypto79, import_node_fs132,
|
|
123603
|
+
var import_node_async_hooks2, import_node_child_process65, import_node_crypto79, import_node_fs132, import_node_os28, import_node_path132, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, startupImages, swiftArtifactDigests, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS, sdkStartups, sdkStartupParts, sdkStartupPlans, sdkPieces2, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
|
|
123573
123604
|
var init_swift_host = __esm({
|
|
123574
123605
|
"src/swift-host.ts"() {
|
|
123575
123606
|
"use strict";
|
|
@@ -123577,7 +123608,7 @@ var init_swift_host = __esm({
|
|
|
123577
123608
|
import_node_child_process65 = require("node:child_process");
|
|
123578
123609
|
import_node_crypto79 = require("node:crypto");
|
|
123579
123610
|
import_node_fs132 = __toESM(require("node:fs"), 1);
|
|
123580
|
-
|
|
123611
|
+
import_node_os28 = __toESM(require("node:os"), 1);
|
|
123581
123612
|
import_node_path132 = __toESM(require("node:path"), 1);
|
|
123582
123613
|
init_pngHeader();
|
|
123583
123614
|
init_nativeSdkBindingContract();
|
|
@@ -126768,7 +126799,7 @@ ${moduleProviders ? `- (id<RCTModuleProvider>)getModuleProvider:(const char *)na
|
|
|
126768
126799
|
// an app's Fabric component views, which its own Fabric host defines. the
|
|
126769
126800
|
// bridge proxy and module decorator are what RCTInstance gives the renderer's
|
|
126770
126801
|
// context container, where the legacy view manager interop reads them
|
|
126771
|
-
void peachInstallFabricViews(facebook::jsi::Runtime &runtime, std::shared_ptr<facebook::react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator) __attribute__((weak));
|
|
126802
|
+
void peachInstallFabricViews(facebook::jsi::Runtime &runtime, std::shared_ptr<facebook::react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator, id imageLoader) __attribute__((weak));
|
|
126772
126803
|
void peachTeardownFabricViews() __attribute__((weak));
|
|
126773
126804
|
|
|
126774
126805
|
// UIKitCore: the key window and root view controller an app delegate makes at launch
|
|
@@ -126873,7 +126904,9 @@ ${bridgeProxy ? ` // as RCTInstance does: the proxy modules reach as their brid
|
|
|
126873
126904
|
}];
|
|
126874
126905
|
[decorator.moduleRegistry setTurboModuleRegistry:manager];
|
|
126875
126906
|
[manager installJSBindings:runtime];
|
|
126876
|
-
if (peachInstallFabricViews)
|
|
126907
|
+
if (peachInstallFabricViews) {
|
|
126908
|
+
peachInstallFabricViews(runtime, invoker, ${bridgeProxy ? "bridgeProxy" : "nil"}, decorator, [manager moduleForName:"RCTImageLoader"]);
|
|
126909
|
+
}
|
|
126877
126910
|
}
|
|
126878
126911
|
|
|
126879
126912
|
// the screenshot the device took, as UIKit posts it to every observer in the
|
|
@@ -127667,13 +127700,14 @@ static void peachEventDispatcherDispatchEvent(id self, SEL _cmd, id<RCTEvent> ev
|
|
|
127667
127700
|
react::convertIdToFollyDynamic(body));
|
|
127668
127701
|
}
|
|
127669
127702
|
@end
|
|
127670
|
-
` : ""}void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator) {
|
|
127703
|
+
` : ""}void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator, id imageLoader) {
|
|
127671
127704
|
fabricInvoker = std::move(invoker);
|
|
127672
127705
|
fabricComponents = [PeachFabricComponents new];
|
|
127673
127706
|
RCTComponentViewFactory *factory = [RCTComponentViewFactory currentComponentViewFactory];
|
|
127674
127707
|
factory.thirdPartyFabricComponentsProvider = fabricComponents;
|
|
127675
127708
|
fabricRegistry = [RCTComponentViewRegistry new];
|
|
127676
127709
|
fabricContext = std::make_shared<react::ContextContainer>();
|
|
127710
|
+
fabricContext->insert("RCTImageLoader", react::wrapManagedObject(imageLoader));
|
|
127677
127711
|
fabricScheduler = std::make_shared<react::RuntimeScheduler>(
|
|
127678
127712
|
[](std::function<void(jsi::Runtime &)> &&work) { fabricInvoker->invokeAsync(std::move(work)); });
|
|
127679
127713
|
fabricContext->insert(react::RuntimeSchedulerKey, std::weak_ptr<react::RuntimeScheduler>(fabricScheduler));
|
|
@@ -128463,6 +128497,7 @@ class JsCallInvoker final : public react::CallInvoker {
|
|
|
128463
128497
|
#include <react/renderer/core/StateUpdate.h>
|
|
128464
128498
|
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
|
128465
128499
|
#include <react/utils/ContextContainer.h>
|
|
128500
|
+
#include <react/utils/ManagedObjectWrapper.h>
|
|
128466
128501
|
#include <algorithm>
|
|
128467
128502
|
#include <array>
|
|
128468
128503
|
#include <cmath>
|
|
@@ -128497,7 +128532,6 @@ using namespace facebook;
|
|
|
128497
128532
|
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
128498
128533
|
#include <react/renderer/core/ShadowNodeFragment.h>
|
|
128499
128534
|
#include <react/utils/FollyConvert.h>
|
|
128500
|
-
#include <react/utils/ManagedObjectWrapper.h>
|
|
128501
128535
|
#include <cmath>
|
|
128502
128536
|
#include <cstdio>
|
|
128503
128537
|
#include <mutex>
|
|
@@ -129208,7 +129242,7 @@ function retainInstalledReactNativeDeclarations(snapshot, options2, skipped) {
|
|
|
129208
129242
|
async function prepareTurboCompileInput(options2) {
|
|
129209
129243
|
await prepareTurboSourceDependencies(options2.reactNativeRoot);
|
|
129210
129244
|
const key2 = (0, import_node_crypto82.createHash)("sha256").update(options2.providers.map(({ root }) => import_node_fs137.default.realpathSync(root)).join("\0")).update("\0").update(import_node_fs137.default.realpathSync(options2.moduleRoot)).digest("hex");
|
|
129211
|
-
const scratch2 = import_node_path137.default.join(
|
|
129245
|
+
const scratch2 = import_node_path137.default.join(import_node_os29.default.tmpdir(), "peach-turbo-swift", key2);
|
|
129212
129246
|
import_node_fs137.default.mkdirSync(scratch2, { recursive: true });
|
|
129213
129247
|
const codegenDir = import_node_fs137.default.mkdtempSync(import_node_path137.default.join(scratch2, "codegen-"));
|
|
129214
129248
|
const collection = await collectTurboSources({
|
|
@@ -129408,14 +129442,14 @@ async function compileTurboModule(options2) {
|
|
|
129408
129442
|
collection
|
|
129409
129443
|
};
|
|
129410
129444
|
}
|
|
129411
|
-
var import_node_crypto82, import_node_fs137, import_node_module18,
|
|
129445
|
+
var import_node_crypto82, import_node_fs137, import_node_module18, import_node_os29, import_node_path137;
|
|
129412
129446
|
var init_turbo_compile = __esm({
|
|
129413
129447
|
"src/turbo-compile.ts"() {
|
|
129414
129448
|
"use strict";
|
|
129415
129449
|
import_node_crypto82 = require("node:crypto");
|
|
129416
129450
|
import_node_fs137 = __toESM(require("node:fs"), 1);
|
|
129417
129451
|
import_node_module18 = require("node:module");
|
|
129418
|
-
|
|
129452
|
+
import_node_os29 = __toESM(require("node:os"), 1);
|
|
129419
129453
|
import_node_path137 = __toESM(require("node:path"), 1);
|
|
129420
129454
|
init_native_app_identity_project();
|
|
129421
129455
|
init_nitro_adapter();
|
|
@@ -129765,7 +129799,7 @@ var init_react_native_core = __esm({
|
|
|
129765
129799
|
init_swift_distribution();
|
|
129766
129800
|
init_swift_package();
|
|
129767
129801
|
init_swiftContract();
|
|
129768
|
-
recipe = true ? "
|
|
129802
|
+
recipe = true ? "b82a829c3491cbd76f8e400906349226a7ee455970ef249f9c41adc87541e84b" : reactNativeCoreDigest2(__sootsim_import_meta_dirname);
|
|
129769
129803
|
strings4 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
129770
129804
|
building = /* @__PURE__ */ new Map();
|
|
129771
129805
|
}
|
|
@@ -131607,7 +131641,7 @@ function expoUnitAppPaths(unit2) {
|
|
|
131607
131641
|
});
|
|
131608
131642
|
}
|
|
131609
131643
|
function expoSwiftPackage(appKey, name3) {
|
|
131610
|
-
return import_node_path141.default.join(
|
|
131644
|
+
return import_node_path141.default.join(import_node_os30.default.tmpdir(), "peach-expo-swift", appKey, `p${process.pid}`, name3);
|
|
131611
131645
|
}
|
|
131612
131646
|
function failureRecordPath(packagePath) {
|
|
131613
131647
|
const app = import_node_path141.default.dirname(import_node_path141.default.dirname(packagePath));
|
|
@@ -132387,7 +132421,7 @@ ${diagnostics}`}`
|
|
|
132387
132421
|
}
|
|
132388
132422
|
return true;
|
|
132389
132423
|
}
|
|
132390
|
-
var import_node_async_hooks3, import_node_child_process69, import_node_crypto85, import_node_fs141, import_node_module20,
|
|
132424
|
+
var import_node_async_hooks3, import_node_child_process69, import_node_crypto85, import_node_fs141, import_node_module20, import_node_os30, import_node_path141, import_node_url7, import_node_util17, run13, scriptEnv, EXPO_SWIFT_ROUTE, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
|
|
132391
132425
|
var init_expo_swift_host = __esm({
|
|
132392
132426
|
"src/expo-swift-host.ts"() {
|
|
132393
132427
|
"use strict";
|
|
@@ -132396,7 +132430,7 @@ var init_expo_swift_host = __esm({
|
|
|
132396
132430
|
import_node_crypto85 = require("node:crypto");
|
|
132397
132431
|
import_node_fs141 = __toESM(require("node:fs"), 1);
|
|
132398
132432
|
import_node_module20 = require("node:module");
|
|
132399
|
-
|
|
132433
|
+
import_node_os30 = __toESM(require("node:os"), 1);
|
|
132400
132434
|
import_node_path141 = __toESM(require("node:path"), 1);
|
|
132401
132435
|
import_node_url7 = require("node:url");
|
|
132402
132436
|
import_node_util17 = require("node:util");
|
|
@@ -132473,13 +132507,13 @@ function expoPodsBundleInputs(podKeys, oneSDK = false) {
|
|
|
132473
132507
|
)
|
|
132474
132508
|
};
|
|
132475
132509
|
}
|
|
132476
|
-
var import_node_child_process70, import_node_fs142,
|
|
132510
|
+
var import_node_child_process70, import_node_fs142, import_node_os31, import_node_path142, v9, sliceTargetSchema, resourceBundleSchema, sliceManifestSchema, expoAppBundleEntryUrl;
|
|
132477
132511
|
var init_native_package_slice = __esm({
|
|
132478
132512
|
"src/native-package-slice.ts"() {
|
|
132479
132513
|
"use strict";
|
|
132480
132514
|
import_node_child_process70 = require("node:child_process");
|
|
132481
132515
|
import_node_fs142 = __toESM(require("node:fs"), 1);
|
|
132482
|
-
|
|
132516
|
+
import_node_os31 = __toESM(require("node:os"), 1);
|
|
132483
132517
|
import_node_path142 = __toESM(require("node:path"), 1);
|
|
132484
132518
|
v9 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
132485
132519
|
init_expo_swift_host();
|
|
@@ -137406,7 +137440,7 @@ async function oneWidgetPackage(appRoot) {
|
|
|
137406
137440
|
].join("\n")
|
|
137407
137441
|
);
|
|
137408
137442
|
const packagePath = import_node_path152.default.join(
|
|
137409
|
-
|
|
137443
|
+
import_node_os32.default.tmpdir(),
|
|
137410
137444
|
"peach-one-widgets",
|
|
137411
137445
|
(0, import_node_crypto89.createHash)("sha256").update(root).digest("hex"),
|
|
137412
137446
|
ONE_WIDGET_PACKAGE
|
|
@@ -137422,13 +137456,13 @@ async function oneWidgetPackage(appRoot) {
|
|
|
137422
137456
|
widget
|
|
137423
137457
|
};
|
|
137424
137458
|
}
|
|
137425
|
-
var import_node_crypto89, import_node_fs152,
|
|
137459
|
+
var import_node_crypto89, import_node_fs152, import_node_os32, import_node_path152;
|
|
137426
137460
|
var init_one_widget_package = __esm({
|
|
137427
137461
|
"src/one-widget-package.ts"() {
|
|
137428
137462
|
"use strict";
|
|
137429
137463
|
import_node_crypto89 = require("node:crypto");
|
|
137430
137464
|
import_node_fs152 = __toESM(require("node:fs"), 1);
|
|
137431
|
-
|
|
137465
|
+
import_node_os32 = __toESM(require("node:os"), 1);
|
|
137432
137466
|
import_node_path152 = __toESM(require("node:path"), 1);
|
|
137433
137467
|
init_one_widget_metadata();
|
|
137434
137468
|
init_swift_compile();
|
|
@@ -141195,7 +141229,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
141195
141229
|
);
|
|
141196
141230
|
if (reactProviders.length > 0 || usesReactHeaders) {
|
|
141197
141231
|
const nitroReactCodegenDir = import_node_fs164.default.mkdtempSync(
|
|
141198
|
-
import_node_path165.default.join(
|
|
141232
|
+
import_node_path165.default.join(import_node_os33.default.tmpdir(), "peach-nitro-react-")
|
|
141199
141233
|
);
|
|
141200
141234
|
let support;
|
|
141201
141235
|
try {
|
|
@@ -141287,7 +141321,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
141287
141321
|
const key2 = (0, import_node_crypto98.createHash)("sha256").update(
|
|
141288
141322
|
collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
|
|
141289
141323
|
).update("\0").update(import_node_fs164.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
|
|
141290
|
-
const packagePath = import_node_path165.default.join(
|
|
141324
|
+
const packagePath = import_node_path165.default.join(import_node_os33.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
|
|
141291
141325
|
const sharedLibrary = [...nativeLibraries.values()].find(
|
|
141292
141326
|
(pod) => pod.sharedLibrary
|
|
141293
141327
|
)?.sharedLibrary;
|
|
@@ -141341,13 +141375,13 @@ function nitrogenGeneratedSources(podDirectory) {
|
|
|
141341
141375
|
...sources(import_node_path165.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
|
|
141342
141376
|
];
|
|
141343
141377
|
}
|
|
141344
|
-
var import_node_crypto98, import_node_fs164,
|
|
141378
|
+
var import_node_crypto98, import_node_fs164, import_node_os33, import_node_path165, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
|
|
141345
141379
|
var init_nitro_compile = __esm({
|
|
141346
141380
|
"src/nitro-compile.ts"() {
|
|
141347
141381
|
"use strict";
|
|
141348
141382
|
import_node_crypto98 = require("node:crypto");
|
|
141349
141383
|
import_node_fs164 = __toESM(require("node:fs"), 1);
|
|
141350
|
-
|
|
141384
|
+
import_node_os33 = __toESM(require("node:os"), 1);
|
|
141351
141385
|
import_node_path165 = __toESM(require("node:path"), 1);
|
|
141352
141386
|
init_answeredNativePackages();
|
|
141353
141387
|
init_installed_native_libraries();
|
|
@@ -141564,7 +141598,7 @@ var init_nitro_superset = __esm({
|
|
|
141564
141598
|
init_nitroContract();
|
|
141565
141599
|
init_swift_standin_digest();
|
|
141566
141600
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
141567
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
141601
|
+
NITRO_COMPILER_DIGEST = true ? "30bd6a257c3a19ad41e33874df22ff116d6881f600a2f9b9db7c725c66395266" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
141568
141602
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
141569
141603
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
141570
141604
|
published3 = /* @__PURE__ */ new Map();
|
|
@@ -150292,16 +150326,16 @@ function setPauseAwareTimeout(fn, budgetMs, hostPid) {
|
|
|
150292
150326
|
schedule();
|
|
150293
150327
|
};
|
|
150294
150328
|
}
|
|
150295
|
-
var import_node_child_process77, import_node_fs178,
|
|
150329
|
+
var import_node_child_process77, import_node_fs178, import_node_os34, import_node_path181, LEDGER_PATH2, TICK_MS2, timers, poll, pollDueAt;
|
|
150296
150330
|
var init_pause_aware_timeout = __esm({
|
|
150297
150331
|
"cli/pause-aware-timeout.ts"() {
|
|
150298
150332
|
"use strict";
|
|
150299
150333
|
import_node_child_process77 = require("node:child_process");
|
|
150300
150334
|
import_node_fs178 = require("node:fs");
|
|
150301
|
-
|
|
150335
|
+
import_node_os34 = __toESM(require("node:os"), 1);
|
|
150302
150336
|
import_node_path181 = __toESM(require("node:path"), 1);
|
|
150303
150337
|
LEDGER_PATH2 = import_node_path181.default.join(
|
|
150304
|
-
process.env.TM_HOME || import_node_path181.default.join(
|
|
150338
|
+
process.env.TM_HOME || import_node_path181.default.join(import_node_os34.default.homedir(), ".team-machine"),
|
|
150305
150339
|
"governor-pauses.json"
|
|
150306
150340
|
);
|
|
150307
150341
|
TICK_MS2 = 500;
|
|
@@ -151298,12 +151332,11 @@ var init_maestro_selector = __esm({
|
|
|
151298
151332
|
});
|
|
151299
151333
|
|
|
151300
151334
|
// ../peach-globals/src/appLifecycleBridgeContract.ts
|
|
151301
|
-
var PEACH_FINAL_LAUNCH_GLOBAL
|
|
151335
|
+
var PEACH_FINAL_LAUNCH_GLOBAL;
|
|
151302
151336
|
var init_appLifecycleBridgeContract = __esm({
|
|
151303
151337
|
"../peach-globals/src/appLifecycleBridgeContract.ts"() {
|
|
151304
151338
|
"use strict";
|
|
151305
151339
|
PEACH_FINAL_LAUNCH_GLOBAL = "__peachFinalLaunch";
|
|
151306
|
-
PEACH_RELOAD_APP_BRIDGE_PATH = "SootSim.bridges.hotRemount.reloadExternalApp";
|
|
151307
151340
|
}
|
|
151308
151341
|
});
|
|
151309
151342
|
|
|
@@ -154289,7 +154322,7 @@ var init_crash_fingerprint = __esm({
|
|
|
154289
154322
|
// cli/telemetry.ts
|
|
154290
154323
|
function sanitizeDiagnosticMessage(value) {
|
|
154291
154324
|
const firstLine = value.slice(0, 2048).split(/[\r\n\u2028\u2029]/, 1)[0] ?? "";
|
|
154292
|
-
return firstLine.split((0,
|
|
154325
|
+
return firstLine.split((0, import_node_os35.homedir)()).join("<home>").replace(
|
|
154293
154326
|
/<package:(?:@[\w.-]+\/)?[\w.-]+>|(?:https?:\/\/|file:\/\/|[A-Za-z]:[\\/]|<home>[\\/]|\/|\.{1,2}[\\/]|\b[\w.-]+[\\/])(?:[^\s"'<>]|\s(?=[^"'<>]*[\\/]))+/g,
|
|
154294
154327
|
(location) => {
|
|
154295
154328
|
if (location.startsWith("<package:")) return location;
|
|
@@ -154321,13 +154354,13 @@ function trackCliDiagnostic(diagnostic) {
|
|
|
154321
154354
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
154322
154355
|
});
|
|
154323
154356
|
}
|
|
154324
|
-
var import_node_crypto109, import_node_fs183,
|
|
154357
|
+
var import_node_crypto109, import_node_fs183, import_node_os35, observedRuntimeVersion, queue, CRASH_REPORT_EVERY_MS;
|
|
154325
154358
|
var init_telemetry = __esm({
|
|
154326
154359
|
"cli/telemetry.ts"() {
|
|
154327
154360
|
"use strict";
|
|
154328
154361
|
import_node_crypto109 = require("node:crypto");
|
|
154329
154362
|
import_node_fs183 = require("node:fs");
|
|
154330
|
-
|
|
154363
|
+
import_node_os35 = require("node:os");
|
|
154331
154364
|
init_event_identity();
|
|
154332
154365
|
init_cli_version();
|
|
154333
154366
|
init_crash_fingerprint();
|
|
@@ -160803,7 +160836,7 @@ function stageBuiltBundleManifest(bundleUrl, config) {
|
|
|
160803
160836
|
const bundle = new URL(bundleUrl);
|
|
160804
160837
|
if (!isStagedHostFileRequest(bundle.pathname) || Object.keys(config).length === 0)
|
|
160805
160838
|
return null;
|
|
160806
|
-
const directory2 = import_node_fs189.default.mkdtempSync(import_node_path190.default.join(
|
|
160839
|
+
const directory2 = import_node_fs189.default.mkdtempSync(import_node_path190.default.join(import_node_os36.default.tmpdir(), "peach-app-manifest-"));
|
|
160807
160840
|
try {
|
|
160808
160841
|
const file = import_node_path190.default.join(directory2, "manifest.json");
|
|
160809
160842
|
import_node_fs189.default.writeFileSync(file, JSON.stringify({ extra: { expoClient: config } }));
|
|
@@ -161072,12 +161105,12 @@ function applyShellLaunchOptions(url, opts) {
|
|
|
161072
161105
|
for (const entry of opts.args ?? []) url.searchParams.append("arg", entry);
|
|
161073
161106
|
return url;
|
|
161074
161107
|
}
|
|
161075
|
-
var import_node_fs189,
|
|
161108
|
+
var import_node_fs189, import_node_os36, import_node_path190, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS, startedExpoConfigReads;
|
|
161076
161109
|
var init_shell_url = __esm({
|
|
161077
161110
|
"cli/commands/shell-url.ts"() {
|
|
161078
161111
|
"use strict";
|
|
161079
161112
|
import_node_fs189 = __toESM(require("node:fs"), 1);
|
|
161080
|
-
|
|
161113
|
+
import_node_os36 = __toESM(require("node:os"), 1);
|
|
161081
161114
|
import_node_path190 = __toESM(require("node:path"), 1);
|
|
161082
161115
|
init_androidAutolinkingContract();
|
|
161083
161116
|
init_androidRootModuleContract();
|
|
@@ -174552,7 +174585,7 @@ function repositories(body, where) {
|
|
|
174552
174585
|
if (name3 === "google") roots.push("https://dl.google.com/dl/android/maven2");
|
|
174553
174586
|
else if (name3 === "mavenCentral") roots.push("https://repo1.maven.org/maven2");
|
|
174554
174587
|
else if (name3 === "mavenLocal")
|
|
174555
|
-
roots.push(import_node_path198.default.join(
|
|
174588
|
+
roots.push(import_node_path198.default.join(import_node_os37.default.homedir(), ".m2", "repository"));
|
|
174556
174589
|
else {
|
|
174557
174590
|
const declared = direct ?? /["']([^"']+)["']/.exec(block2 ?? "")?.[1];
|
|
174558
174591
|
if (!declared)
|
|
@@ -174659,7 +174692,7 @@ function extract(bytes, where) {
|
|
|
174659
174692
|
const cached5 = pending.get(key2);
|
|
174660
174693
|
if (cached5) return cached5;
|
|
174661
174694
|
const request = (async () => {
|
|
174662
|
-
const dest = import_node_path198.default.join(
|
|
174695
|
+
const dest = import_node_path198.default.join(import_node_os37.default.tmpdir(), "peach-maven-sources", key2);
|
|
174663
174696
|
const marker = import_node_path198.default.join(dest, ".complete");
|
|
174664
174697
|
if (!import_node_fs197.default.existsSync(marker)) {
|
|
174665
174698
|
const sources = zipSources(bytes, where);
|
|
@@ -174766,13 +174799,13 @@ async function kotlinSources2(bytes, where) {
|
|
|
174766
174799
|
if (kotlin.length === 0) throw new Error(`${where}: sources jar has no Kotlin`);
|
|
174767
174800
|
return kotlin;
|
|
174768
174801
|
}
|
|
174769
|
-
var import_node_crypto116, import_node_fs197,
|
|
174802
|
+
var import_node_crypto116, import_node_fs197, import_node_os37, import_node_path198, import_node_zlib12, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
|
|
174770
174803
|
var init_kotlin_maven_sources = __esm({
|
|
174771
174804
|
"src/kotlin-maven-sources.ts"() {
|
|
174772
174805
|
"use strict";
|
|
174773
174806
|
import_node_crypto116 = require("node:crypto");
|
|
174774
174807
|
import_node_fs197 = __toESM(require("node:fs"), 1);
|
|
174775
|
-
|
|
174808
|
+
import_node_os37 = __toESM(require("node:os"), 1);
|
|
174776
174809
|
import_node_path198 = __toESM(require("node:path"), 1);
|
|
174777
174810
|
import_node_zlib12 = require("node:zlib");
|
|
174778
174811
|
pending = /* @__PURE__ */ new Map();
|
|
@@ -176536,7 +176569,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
176536
176569
|
}
|
|
176537
176570
|
const { executable, prefixArgs } = rnxSelfInvocation();
|
|
176538
176571
|
const bridgeLogPath = import_node_path204.default.join(
|
|
176539
|
-
|
|
176572
|
+
import_node_os38.default.tmpdir(),
|
|
176540
176573
|
`peach-bridge-${Date.now()}-${process.pid}.log`
|
|
176541
176574
|
);
|
|
176542
176575
|
const bridgeLogFd = import_node_fs203.default.openSync(bridgeLogPath, "a");
|
|
@@ -176721,8 +176754,8 @@ function unreachableBridgeMessage(port, handshake, timeoutMs) {
|
|
|
176721
176754
|
return `peach open: requested bridge port ${port} is held by another program, not a peach bridge. stop it or pass a free port with --port <port>.`;
|
|
176722
176755
|
}
|
|
176723
176756
|
if (handshake === "timeout") {
|
|
176724
|
-
const cores = Math.max(1,
|
|
176725
|
-
const load2 =
|
|
176757
|
+
const cores = Math.max(1, import_node_os38.default.cpus().length);
|
|
176758
|
+
const load2 = import_node_os38.default.loadavg()[0];
|
|
176726
176759
|
if (load2 >= cores) {
|
|
176727
176760
|
return `peach open: requested bridge port ${port} did not finish its handshake within ${timeoutMs / 1e3}s while load average was ${load2.toFixed(1)} on ${cores} cores.`;
|
|
176728
176761
|
}
|
|
@@ -176798,7 +176831,7 @@ async function stagePrebuiltBundle(file, bridgePort, prepareSource) {
|
|
|
176798
176831
|
}
|
|
176799
176832
|
function normalizeReplacementPath(filePath) {
|
|
176800
176833
|
if (filePath.startsWith("~/")) {
|
|
176801
|
-
return import_node_path204.default.join(
|
|
176834
|
+
return import_node_path204.default.join(import_node_os38.default.homedir(), filePath.slice(2));
|
|
176802
176835
|
}
|
|
176803
176836
|
if (import_node_path204.default.isAbsolute(filePath)) return filePath;
|
|
176804
176837
|
return import_node_path204.default.resolve(process.cwd(), filePath);
|
|
@@ -178100,7 +178133,7 @@ async function openSim(args, opts) {
|
|
|
178100
178133
|
});
|
|
178101
178134
|
const attached = await bridge.listSims().then((sims) => sims.find((sim) => sim.id === match.id)?.readyState ?? "gone").catch(() => "unknown");
|
|
178102
178135
|
console.error(
|
|
178103
|
-
` sim ${match.id} bridge state: ${attached}; host load ${
|
|
178136
|
+
` sim ${match.id} bridge state: ${attached}; host load ${import_node_os38.default.loadavg()[0].toFixed(1)} on ${import_node_os38.default.cpus().length} cpus (a loaded host slows a cold first bundle past the budget; a sim that is open but never answers has a blocked page)`
|
|
178104
178137
|
);
|
|
178105
178138
|
await printBridgeFailureDiagnostics(bridge, {
|
|
178106
178139
|
errorsCommand: `peach get errors 5${hint}`,
|
|
@@ -178453,7 +178486,7 @@ async function runCloseCommand(args, opts = {}) {
|
|
|
178453
178486
|
bridge.close();
|
|
178454
178487
|
}
|
|
178455
178488
|
}
|
|
178456
|
-
var import_node_child_process79, import_node_fs203, import_node_http7, import_node_https3, import_node_net,
|
|
178489
|
+
var import_node_child_process79, import_node_fs203, import_node_http7, import_node_https3, import_node_net, import_node_os38, import_node_path204, import_ws8, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, OPEN_BRIDGE_RUNTIME_TIMEOUT_MS, OPEN_BRIDGE_HEALTH_TIMEOUT_MS, OPEN_BRIDGE_SILENCE_MS, LIVE_BRIDGE_HANDSHAKE_TIMEOUT_MS;
|
|
178457
178490
|
var init_control = __esm({
|
|
178458
178491
|
"cli/commands/control.ts"() {
|
|
178459
178492
|
"use strict";
|
|
@@ -178462,7 +178495,7 @@ var init_control = __esm({
|
|
|
178462
178495
|
import_node_http7 = __toESM(require("node:http"), 1);
|
|
178463
178496
|
import_node_https3 = __toESM(require("node:https"), 1);
|
|
178464
178497
|
import_node_net = __toESM(require("node:net"), 1);
|
|
178465
|
-
|
|
178498
|
+
import_node_os38 = __toESM(require("node:os"), 1);
|
|
178466
178499
|
import_node_path204 = __toESM(require("node:path"), 1);
|
|
178467
178500
|
init_src();
|
|
178468
178501
|
init_src2();
|
|
@@ -178821,6 +178854,14 @@ var init_frame_compose = __esm({
|
|
|
178821
178854
|
}
|
|
178822
178855
|
});
|
|
178823
178856
|
|
|
178857
|
+
// cli/commands/inspect/resolve-target.ts
|
|
178858
|
+
var init_resolve_target = __esm({
|
|
178859
|
+
"cli/commands/inspect/resolve-target.ts"() {
|
|
178860
|
+
"use strict";
|
|
178861
|
+
init_core();
|
|
178862
|
+
}
|
|
178863
|
+
});
|
|
178864
|
+
|
|
178824
178865
|
// cli/maestro-accessibility.ts
|
|
178825
178866
|
function accessibilityBounds(node) {
|
|
178826
178867
|
const left = Math.trunc(node.frame.x);
|
|
@@ -178972,6 +179013,21 @@ async function waitForSootsimIdle({
|
|
|
178972
179013
|
transitionTimeoutMs = 4e3,
|
|
178973
179014
|
stillSince = null
|
|
178974
179015
|
}) {
|
|
179016
|
+
if (bridge.plane === "cloud") {
|
|
179017
|
+
const started = Date.now();
|
|
179018
|
+
try {
|
|
179019
|
+
await bridge.send({
|
|
179020
|
+
type: "settle",
|
|
179021
|
+
simId,
|
|
179022
|
+
maxFrames: Math.min(600, Math.max(4, Math.ceil(maxMs / 16)))
|
|
179023
|
+
});
|
|
179024
|
+
return { elapsed: Date.now() - started, settled: true, blockedBy: "" };
|
|
179025
|
+
} catch (error) {
|
|
179026
|
+
if (!(error instanceof Error) || !error.message.includes("did not settle"))
|
|
179027
|
+
throw error;
|
|
179028
|
+
return { elapsed: Date.now() - started, settled: false, blockedBy: error.message };
|
|
179029
|
+
}
|
|
179030
|
+
}
|
|
178975
179031
|
let result;
|
|
178976
179032
|
const observationStartedAt = Date.now();
|
|
178977
179033
|
try {
|
|
@@ -179635,6 +179691,26 @@ var init_settling = __esm({
|
|
|
179635
179691
|
}
|
|
179636
179692
|
});
|
|
179637
179693
|
|
|
179694
|
+
// cli/commands/inspect/actions.ts
|
|
179695
|
+
function isTapSuccess(result) {
|
|
179696
|
+
if (!result || result.hit === false || result.ok === false) return false;
|
|
179697
|
+
if (result.handled === false) return false;
|
|
179698
|
+
if (result.hit !== true && result.handled !== true) return false;
|
|
179699
|
+
if (result.requestedTargetMatched === false) return false;
|
|
179700
|
+
if (result.pointerTapHandled === false && !(result.hit === true && result.requestedTargetMatched === true) && !result.keyboardOpened && !result.isTextInput) {
|
|
179701
|
+
return false;
|
|
179702
|
+
}
|
|
179703
|
+
return true;
|
|
179704
|
+
}
|
|
179705
|
+
var init_actions = __esm({
|
|
179706
|
+
"cli/commands/inspect/actions.ts"() {
|
|
179707
|
+
"use strict";
|
|
179708
|
+
init_core();
|
|
179709
|
+
init_resolve_target();
|
|
179710
|
+
init_settling();
|
|
179711
|
+
}
|
|
179712
|
+
});
|
|
179713
|
+
|
|
179638
179714
|
// cli/commands/permissions.ts
|
|
179639
179715
|
var PERMISSION_KINDS;
|
|
179640
179716
|
var init_permissions = __esm({
|
|
@@ -180339,13 +180415,13 @@ var init_bridge_flow_runner = __esm({
|
|
|
180339
180415
|
fs146 = __toESM(require("fs"), 1);
|
|
180340
180416
|
path185 = __toESM(require("path"), 1);
|
|
180341
180417
|
init_src2();
|
|
180342
|
-
init_src2();
|
|
180343
180418
|
import_frame_identity = __toESM(require_frame_identity(), 1);
|
|
180344
180419
|
init_device_catalog();
|
|
180345
180420
|
init_flow_timeout_scale();
|
|
180346
180421
|
init_frame_compose();
|
|
180347
180422
|
init_sleep();
|
|
180348
180423
|
init_storageSnapshotContract();
|
|
180424
|
+
init_actions();
|
|
180349
180425
|
init_core();
|
|
180350
180426
|
init_settling();
|
|
180351
180427
|
init_shared();
|
|
@@ -180532,15 +180608,13 @@ var init_bridge_flow_runner = __esm({
|
|
|
180532
180608
|
args
|
|
180533
180609
|
});
|
|
180534
180610
|
}
|
|
180611
|
+
async query(query) {
|
|
180612
|
+
return this.bridge.send({ type: "query", simId: this.opts.simId, query });
|
|
180613
|
+
}
|
|
180535
180614
|
async screenBounds() {
|
|
180536
|
-
const
|
|
180537
|
-
|
|
180538
|
-
|
|
180539
|
-
const window2 = snapshot?.window;
|
|
180540
|
-
if (!window2 || typeof window2 !== "object" || !("width" in window2) || !("height" in window2) || typeof window2.width !== "number" || typeof window2.height !== "number" || !Number.isFinite(window2.width) || !Number.isFinite(window2.height) || window2.width <= 0 || window2.height <= 0) {
|
|
180541
|
-
throw new Error("live screen dimensions are unavailable");
|
|
180542
|
-
}
|
|
180543
|
-
return { x: 0, y: 0, width: window2.width, height: window2.height };
|
|
180615
|
+
const { screen } = await this.query({ kind: "screen" });
|
|
180616
|
+
if (!screen) throw new Error("live screen dimensions are unavailable");
|
|
180617
|
+
return { x: 0, y: 0, width: screen.width, height: screen.height };
|
|
180544
180618
|
}
|
|
180545
180619
|
// ordered input batch executed inside the page in one round-trip; the
|
|
180546
180620
|
// engine emits agent-cursor actions for every step natively.
|
|
@@ -180796,11 +180870,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
180796
180870
|
return this.findElementScoped(opts, preferHittable);
|
|
180797
180871
|
}
|
|
180798
180872
|
async captureAccessibilityTree() {
|
|
180799
|
-
const tree2 = await this.
|
|
180800
|
-
const test = globalThis.__sootsimTest
|
|
180801
|
-
if (!test || typeof test.captureAccessibilityTree !== 'function') throw new Error('engine accessibility snapshot is unavailable')
|
|
180802
|
-
return await test.captureAccessibilityTree()
|
|
180803
|
-
})()`);
|
|
180873
|
+
const tree2 = (await this.query({ kind: "accessibility" })).accessibility;
|
|
180804
180874
|
if (!isPeachAccessibilityTree(tree2))
|
|
180805
180875
|
throw new Error("engine returned an invalid accessibility snapshot");
|
|
180806
180876
|
return tree2;
|
|
@@ -180996,51 +181066,30 @@ var init_bridge_flow_runner = __esm({
|
|
|
180996
181066
|
}
|
|
180997
181067
|
async preferHittableCandidate(candidates) {
|
|
180998
181068
|
if (candidates.length < 2) return candidates[0] ?? null;
|
|
180999
|
-
const
|
|
181000
|
-
|
|
181001
|
-
|
|
181002
|
-
|
|
181003
|
-
|
|
181004
|
-
|
|
181005
|
-
|
|
181006
|
-
|
|
181007
|
-
|
|
181008
|
-
|
|
181009
|
-
|
|
181010
|
-
|
|
181011
|
-
|
|
181012
|
-
})()`);
|
|
181013
|
-
return candidates[index] ?? candidates[0] ?? null;
|
|
181069
|
+
for (const candidate of candidates) {
|
|
181070
|
+
if (typeof candidate.nodeId !== "number") continue;
|
|
181071
|
+
const resolved = await this.resolveTapTarget(candidate.nodeId);
|
|
181072
|
+
if (!resolved) continue;
|
|
181073
|
+
const { hit } = await this.query({
|
|
181074
|
+
kind: "hitTest",
|
|
181075
|
+
x: resolved.cx,
|
|
181076
|
+
y: resolved.cy,
|
|
181077
|
+
nodeId: resolved.target.nodeId
|
|
181078
|
+
});
|
|
181079
|
+
if (hit?.requestedTargetMatched === true) return candidate;
|
|
181080
|
+
}
|
|
181081
|
+
return candidates[0] ?? null;
|
|
181014
181082
|
}
|
|
181015
181083
|
async resolveTapTarget(nodeId) {
|
|
181016
|
-
return this.
|
|
181017
|
-
const test = globalThis.__sootsimTest
|
|
181018
|
-
if (!test?.resolveTapTarget) return null
|
|
181019
|
-
return await test.resolveTapTarget(${nodeId})
|
|
181020
|
-
})()`);
|
|
181084
|
+
return (await this.query({ kind: "tapTarget", nodeId })).tapTarget ?? null;
|
|
181021
181085
|
}
|
|
181022
181086
|
async activatePressTarget(opts, nodeId, x, y) {
|
|
181023
|
-
const
|
|
181024
|
-
|
|
181025
|
-
|
|
181026
|
-
|
|
181027
|
-
|
|
181028
|
-
|
|
181029
|
-
if (resolved && Number.isFinite(resolved.cx) && Number.isFinite(resolved.cy)) {
|
|
181030
|
-
point = { x: resolved.cx, y: resolved.cy }
|
|
181031
|
-
}
|
|
181032
|
-
const direct = await test.activatePressAt(point.x, point.y, ${nodeId})
|
|
181033
|
-
if (direct?.ok) {
|
|
181034
|
-
globalThis.dispatchEvent(
|
|
181035
|
-
new CustomEvent('sootsim:agentAction', {
|
|
181036
|
-
detail: { type: 'tap', x: point.x, y: point.y, target: ${JSON.stringify(
|
|
181037
|
-
replayTarget
|
|
181038
|
-
)} },
|
|
181039
|
-
}),
|
|
181040
|
-
)
|
|
181041
|
-
}
|
|
181042
|
-
return direct || null
|
|
181043
|
-
})()`);
|
|
181087
|
+
const target = opts.id ? { id: opts.id, testID: opts.id, text: null } : { id: null, testID: null, text: opts.text ?? null };
|
|
181088
|
+
const resolved = await this.resolveTapTarget(nodeId);
|
|
181089
|
+
const point = resolved && Number.isFinite(resolved.cx) && Number.isFinite(resolved.cy) ? { x: resolved.cx, y: resolved.cy } : { x, y };
|
|
181090
|
+
return (await this.perform([
|
|
181091
|
+
{ type: "activatePress", x: point.x, y: point.y, nodeId, target }
|
|
181092
|
+
])).steps[0];
|
|
181044
181093
|
}
|
|
181045
181094
|
async tap(x, y, target) {
|
|
181046
181095
|
return await this.bridge.send({
|
|
@@ -181064,10 +181113,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
181064
181113
|
// the engine's inspect geometry revision: equal readings bracket a span in
|
|
181065
181114
|
// which no tree, layout, scroll or prop write could move any element.
|
|
181066
181115
|
async geometryRevision() {
|
|
181067
|
-
|
|
181068
|
-
`(async () => globalThis.__sootsimTest?.getGeometryRevision?.())()`
|
|
181069
|
-
);
|
|
181070
|
-
return typeof revision === "string" ? revision : null;
|
|
181116
|
+
return (await this.query({ kind: "geometryRevision" })).revision ?? null;
|
|
181071
181117
|
}
|
|
181072
181118
|
async waitForElement(opts, timeoutMs = 5e3, preferHittable = false) {
|
|
181073
181119
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -181174,7 +181220,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
181174
181220
|
}
|
|
181175
181221
|
if (hit?.requestedTargetMatched === false)
|
|
181176
181222
|
throw new Error(`tapOn refused: ${JSON.stringify(hit)}`);
|
|
181177
|
-
if (hit
|
|
181223
|
+
if (isTapSuccess(hit)) {
|
|
181178
181224
|
await repeatTaps(tappedAtMs, () => this.tap(cx, cy, replayTarget));
|
|
181179
181225
|
await this.waitForAppToSettle();
|
|
181180
181226
|
if (!current2.isTextInput) return;
|
|
@@ -181277,12 +181323,9 @@ var init_bridge_flow_runner = __esm({
|
|
|
181277
181323
|
"inputText: no focused TextInput; tap the input and wait for focus before typing"
|
|
181278
181324
|
);
|
|
181279
181325
|
}
|
|
181280
|
-
await this.
|
|
181281
|
-
|
|
181282
|
-
|
|
181283
|
-
action: "type",
|
|
181284
|
-
text: text7
|
|
181285
|
-
});
|
|
181326
|
+
const typed = await this.perform([{ type: "type", text: text7 }]);
|
|
181327
|
+
if (!typed.ok)
|
|
181328
|
+
throw new Error(`inputText failed: ${typed.steps[0]?.error ?? "not typed"}`);
|
|
181286
181329
|
await sleep2(200);
|
|
181287
181330
|
}
|
|
181288
181331
|
async editText(command) {
|
|
@@ -181321,7 +181364,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
181321
181364
|
const deadline = Date.now() + timeoutMs;
|
|
181322
181365
|
do {
|
|
181323
181366
|
try {
|
|
181324
|
-
const focused = await this.
|
|
181367
|
+
const { focused } = await this.query({ kind: "focus" });
|
|
181325
181368
|
if (focused && this.focusedTextInputMatches(focused, expected)) return true;
|
|
181326
181369
|
} catch {
|
|
181327
181370
|
}
|
|
@@ -181330,12 +181373,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
181330
181373
|
return false;
|
|
181331
181374
|
}
|
|
181332
181375
|
async pressKey(name3) {
|
|
181333
|
-
await this.
|
|
181334
|
-
type: "keyboard",
|
|
181335
|
-
simId: this.opts.simId,
|
|
181336
|
-
action: "press",
|
|
181337
|
-
text: name3
|
|
181338
|
-
});
|
|
181376
|
+
await this.perform([{ type: "key", key: name3 }]);
|
|
181339
181377
|
await sleep2(120);
|
|
181340
181378
|
}
|
|
181341
181379
|
async dispatchKey(ch) {
|
|
@@ -181387,12 +181425,12 @@ var init_bridge_flow_runner = __esm({
|
|
|
181387
181425
|
await this.waitForAppToSettle();
|
|
181388
181426
|
}
|
|
181389
181427
|
async isKeyboardVisible() {
|
|
181390
|
-
const
|
|
181391
|
-
|
|
181392
|
-
|
|
181393
|
-
|
|
181394
|
-
|
|
181395
|
-
return visible === true;
|
|
181428
|
+
const state = await this.bridge.send({
|
|
181429
|
+
type: "state",
|
|
181430
|
+
simId: this.opts.simId,
|
|
181431
|
+
stateOptions: { screenshot: false, tree: false, errors: false }
|
|
181432
|
+
});
|
|
181433
|
+
return state.keyboard?.visible === true;
|
|
181396
181434
|
}
|
|
181397
181435
|
async eraseText(count) {
|
|
181398
181436
|
const steps = Array.from({ length: Math.max(0, Math.ceil(count)) }, () => ({
|
|
@@ -181475,15 +181513,12 @@ var init_bridge_flow_runner = __esm({
|
|
|
181475
181513
|
return outputPath2;
|
|
181476
181514
|
}
|
|
181477
181515
|
async readCurrentDeviceModel() {
|
|
181478
|
-
const
|
|
181479
|
-
|
|
181480
|
-
|
|
181481
|
-
|
|
181482
|
-
|
|
181483
|
-
|
|
181484
|
-
const model = settings && typeof settings.deviceModel === "string" ? settings.deviceModel : null;
|
|
181485
|
-
if (!model || !(model in devices)) return null;
|
|
181486
|
-
return model;
|
|
181516
|
+
const info = (await this.perform([{ type: "deviceInfo" }])).steps[0]?.value;
|
|
181517
|
+
if (typeof info !== "object" || info === null || !("model" in info)) return null;
|
|
181518
|
+
for (const model of listDeviceModels()) {
|
|
181519
|
+
if (devices[model].name === info.model) return model;
|
|
181520
|
+
}
|
|
181521
|
+
return null;
|
|
181487
181522
|
}
|
|
181488
181523
|
// the app's console errors and warnings plus failed requests, captured by
|
|
181489
181524
|
// peach's native-globals hook and request recorder (same shape as
|
|
@@ -181872,12 +181907,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
181872
181907
|
}
|
|
181873
181908
|
async reloadGuestAppRuntime(options2) {
|
|
181874
181909
|
await this.bridge.send(
|
|
181875
|
-
{
|
|
181876
|
-
type: "call",
|
|
181877
|
-
simId: this.opts.simId,
|
|
181878
|
-
path: PEACH_RELOAD_APP_BRIDGE_PATH,
|
|
181879
|
-
args: [options2]
|
|
181880
|
-
},
|
|
181910
|
+
{ type: "relaunch", simId: this.opts.simId, relaunchOptions: options2 },
|
|
181881
181911
|
{ timeoutMs: 12e4 }
|
|
181882
181912
|
);
|
|
181883
181913
|
}
|