peachsim 0.1.2408 → 0.1.2410
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/cloud-client.ts +8 -3
- package/cli/command-agent.ts +122 -0
- package/cli/ws-bridge.ts +4 -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 +43 -16
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +20 -1
- package/dist-lib/cloud-contract.mjs +18 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1630 -1513
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +41 -14
- 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 +77 -16
- package/dist-lib/host/fetch-proxy-handler.cjs +5 -5
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +425 -280
- 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 +38 -13
- package/dist-lib/native-app-identity-project.cjs +36 -11
- package/dist-lib/native-app-identity-project.mjs +36 -11
- 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 +67 -58
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +871 -729
- package/dist-lib/swift-compile.cjs +4 -3
- package/dist-lib/swift-compile.mjs +4 -3
- 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 +52 -13
- package/dist-lib/vite.cjs +5 -5
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +7 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/bridge-contract.ts +4 -0
- package/src/cloud-contract.ts +30 -0
- package/src/swift-packages.ts +1 -0
- package/src/swift-shared-sdk.ts +2 -1
- package/src/xcode-project.ts +37 -11
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2410 | (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;
|
|
@@ -30376,12 +30376,12 @@ function runtimeVersionHostname(version2) {
|
|
|
30376
30376
|
if (!labels) throw new Error(`invalid Peach runtime version: ${version2}`);
|
|
30377
30377
|
return `${labels.join(".")}${RUNTIME_VERSION_HOSTNAME_SUFFIX}`;
|
|
30378
30378
|
}
|
|
30379
|
-
function isRuntimeVersionHostname(
|
|
30380
|
-
return
|
|
30379
|
+
function isRuntimeVersionHostname(hostname2) {
|
|
30380
|
+
return hostname2.toLowerCase().endsWith(RUNTIME_VERSION_HOSTNAME_SUFFIX);
|
|
30381
30381
|
}
|
|
30382
|
-
function runtimeVersionFromHostname(
|
|
30383
|
-
if (!isRuntimeVersionHostname(
|
|
30384
|
-
const labels =
|
|
30382
|
+
function runtimeVersionFromHostname(hostname2) {
|
|
30383
|
+
if (!isRuntimeVersionHostname(hostname2)) return null;
|
|
30384
|
+
const labels = hostname2.slice(0, -RUNTIME_VERSION_HOSTNAME_SUFFIX.length).split(".");
|
|
30385
30385
|
if (labels.length === 0 || labels.some((label) => !/^[0-9a-f]{1,60}$/i.test(label))) {
|
|
30386
30386
|
return null;
|
|
30387
30387
|
}
|
|
@@ -30399,9 +30399,9 @@ function resolveInstalledRuntimeRoot(version2) {
|
|
|
30399
30399
|
if (!import_fs.default.existsSync(import_path.default.join(dir, "index.html"))) return null;
|
|
30400
30400
|
return dir;
|
|
30401
30401
|
}
|
|
30402
|
-
function resolveRuntimeRootForHostname(
|
|
30403
|
-
if (!isRuntimeVersionHostname(
|
|
30404
|
-
const version2 = runtimeVersionFromHostname(
|
|
30402
|
+
function resolveRuntimeRootForHostname(hostname2) {
|
|
30403
|
+
if (!isRuntimeVersionHostname(hostname2)) return resolveActiveRuntimeRoot();
|
|
30404
|
+
const version2 = runtimeVersionFromHostname(hostname2);
|
|
30405
30405
|
return version2 ? resolveInstalledRuntimeRoot(version2) : null;
|
|
30406
30406
|
}
|
|
30407
30407
|
function sendFileWithRanges(req, res, filePath, total, headers) {
|
|
@@ -31115,8 +31115,8 @@ function swiftNativeTargetsRefusal(value) {
|
|
|
31115
31115
|
const products = field2("productHeaders");
|
|
31116
31116
|
const inputPath = (value2) => typeof value2 === "string" && value2.startsWith(`${SWIFT_NATIVE_INPUT_ROOT}/`) && isSwiftResourcePath(value2.slice(SWIFT_NATIVE_INPUT_ROOT.length + 1));
|
|
31117
31117
|
const deployment = field2("deploymentTarget");
|
|
31118
|
-
const
|
|
31119
|
-
if (typeof
|
|
31118
|
+
const targetName2 = field2("name");
|
|
31119
|
+
if (typeof targetName2 !== "string" || targetName2.length === 0 || targetName2.length > 4096 || targetName2.includes("\0") || targetName2.includes("/") || targetName2.includes("\\") || targetName2 === "." || targetName2 === "..")
|
|
31120
31120
|
return at("name");
|
|
31121
31121
|
if (!(deployment === null || typeof deployment === "string" && /^\d+(?:\.\d+){0,2}$/.test(deployment)))
|
|
31122
31122
|
return at("deploymentTarget");
|
|
@@ -33722,8 +33722,8 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
33722
33722
|
}
|
|
33723
33723
|
return deps;
|
|
33724
33724
|
};
|
|
33725
|
-
const admitTextualIncludes = (root,
|
|
33726
|
-
const prefix = `${targetPath(
|
|
33725
|
+
const admitTextualIncludes = (root, targetName2, targetObj, searchRoots) => {
|
|
33726
|
+
const prefix = `${targetPath(targetName2)}/upstream/`;
|
|
33727
33727
|
const queue2 = Object.keys(result.files).filter((key2) => key2.startsWith(prefix));
|
|
33728
33728
|
const scanned = /* @__PURE__ */ new Set();
|
|
33729
33729
|
const excludes = new Set(targetObj.exclude ?? []);
|
|
@@ -33782,22 +33782,22 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
33782
33782
|
for (const node of allModules) {
|
|
33783
33783
|
const module2 = node.provider;
|
|
33784
33784
|
const config = node.config;
|
|
33785
|
-
const
|
|
33786
|
-
const targetObj = nodeTargets.get(
|
|
33785
|
+
const targetName2 = nitroProviderTarget(module2);
|
|
33786
|
+
const targetObj = nodeTargets.get(targetName2);
|
|
33787
33787
|
const podName = node.podspec.podName ?? config.swiftModule ?? module2.name;
|
|
33788
33788
|
const searchRoots = node.podspec.headerSearchPaths;
|
|
33789
33789
|
for (const dir of searchRoots) searchRootDirs.add(dir);
|
|
33790
|
-
const implementationHeaders = import_node_fs21.default.existsSync(import_node_path17.default.join(module2.root, "cpp")) ? collect(module2.root, "cpp",
|
|
33790
|
+
const implementationHeaders = import_node_fs21.default.existsSync(import_node_path17.default.join(module2.root, "cpp")) ? collect(module2.root, "cpp", targetName2, podName) : /* @__PURE__ */ new Map();
|
|
33791
33791
|
for (const dir of searchRoots.filter(
|
|
33792
33792
|
(dir2) => dir2 !== "cpp" && !dir2.startsWith("cpp/") && dir2 !== "ios" && !dir2.startsWith("ios/") && !searchRoots.some((other) => other !== dir2 && dir2.startsWith(`${other}/`))
|
|
33793
33793
|
)) {
|
|
33794
|
-
collect(module2.root, dir,
|
|
33794
|
+
collect(module2.root, dir, targetName2, podName);
|
|
33795
33795
|
}
|
|
33796
33796
|
if (import_node_fs21.default.existsSync(import_node_path17.default.join(module2.root, "ios"))) {
|
|
33797
33797
|
const iosCollected = collect(
|
|
33798
33798
|
module2.root,
|
|
33799
33799
|
"ios",
|
|
33800
|
-
|
|
33800
|
+
targetName2,
|
|
33801
33801
|
podName,
|
|
33802
33802
|
/* @__PURE__ */ new Set(["Tests"]),
|
|
33803
33803
|
() => true,
|
|
@@ -33805,24 +33805,24 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
33805
33805
|
);
|
|
33806
33806
|
if (config.swiftModule) {
|
|
33807
33807
|
const objcHeaders = [...iosCollected.entries()].filter(
|
|
33808
|
-
([name3, original]) => name3.endsWith(".h") && Object.hasOwn(result.files, `${targetPath(
|
|
33808
|
+
([name3, original]) => name3.endsWith(".h") && Object.hasOwn(result.files, `${targetPath(targetName2)}/include/${name3}`) && /(?:@(?:interface|protocol)\b|\b(?:NS_(?:ENUM|OPTIONS)|FOUNDATION_EXPORT)\b)/.test(
|
|
33809
33809
|
result.files[original] ?? ""
|
|
33810
33810
|
)
|
|
33811
33811
|
).map(([name3]) => name3);
|
|
33812
|
-
if (objcHeaders.length > 0) iosObjcHeadersByTarget.set(
|
|
33812
|
+
if (objcHeaders.length > 0) iosObjcHeadersByTarget.set(targetName2, objcHeaders);
|
|
33813
33813
|
}
|
|
33814
33814
|
}
|
|
33815
|
-
admitTextualIncludes(module2.root,
|
|
33815
|
+
admitTextualIncludes(module2.root, targetName2, targetObj, searchRoots);
|
|
33816
33816
|
const viewsDir = import_node_path17.default.join(module2.root, "nitrogen/generated/shared/c++/views");
|
|
33817
33817
|
const viewHeaders = import_node_fs21.default.existsSync(viewsDir) ? import_node_fs21.default.readdirSync(viewsDir).filter((file) => /\.(?:h|hh|hpp|hxx)$/.test(file)) : [];
|
|
33818
|
-
const upstreamPrefix = `${targetPath(
|
|
33818
|
+
const upstreamPrefix = `${targetPath(targetName2)}/upstream/`;
|
|
33819
33819
|
const needsViews = viewHeaders.length > 0 && Object.entries(result.files).some(
|
|
33820
33820
|
([key2, text6]) => (key2.startsWith(`${upstreamPrefix}cpp/`) || key2.startsWith(`${upstreamPrefix}ios/`)) && viewHeaders.some((header) => text6.includes(header))
|
|
33821
33821
|
);
|
|
33822
33822
|
collect(
|
|
33823
33823
|
module2.root,
|
|
33824
33824
|
"nitrogen/generated/shared/c++",
|
|
33825
|
-
|
|
33825
|
+
targetName2,
|
|
33826
33826
|
podName,
|
|
33827
33827
|
needsViews ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set(["views"])
|
|
33828
33828
|
);
|
|
@@ -33833,7 +33833,7 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
33833
33833
|
`${module2.root}: missing C++ implementation header ${entry.implementation}.hpp`
|
|
33834
33834
|
);
|
|
33835
33835
|
}
|
|
33836
|
-
collect(module2.root, "nitrogen/generated/ios",
|
|
33836
|
+
collect(module2.root, "nitrogen/generated/ios", targetName2, podName);
|
|
33837
33837
|
if (config.swiftModule) {
|
|
33838
33838
|
const companionDeps = collectCompanionPods(node);
|
|
33839
33839
|
const peerModuleDeps = node.peerRoots.flatMap((peerRoot) => {
|
|
@@ -33844,7 +33844,7 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
33844
33844
|
];
|
|
33845
33845
|
});
|
|
33846
33846
|
const packageSwift = target(config.swiftModule, [
|
|
33847
|
-
|
|
33847
|
+
targetName2,
|
|
33848
33848
|
"NitroModules",
|
|
33849
33849
|
.../* @__PURE__ */ new Set([...peerModuleDeps, ...companionDeps])
|
|
33850
33850
|
]);
|
|
@@ -33870,7 +33870,7 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
33870
33870
|
);
|
|
33871
33871
|
add2(
|
|
33872
33872
|
`${targetPath(config.swiftModule)}/PeachNitroExports.swift`,
|
|
33873
|
-
`@_exported import ${
|
|
33873
|
+
`@_exported import ${targetName2}
|
|
33874
33874
|
`
|
|
33875
33875
|
);
|
|
33876
33876
|
}
|
|
@@ -33878,21 +33878,21 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
33878
33878
|
const dependencyHeader = nitroDependencyReader(reactNative.version, reactNative.root);
|
|
33879
33879
|
const admitted = /* @__PURE__ */ new Set();
|
|
33880
33880
|
const dependencyTrees = /* @__PURE__ */ new Set();
|
|
33881
|
-
const scan3 = (
|
|
33881
|
+
const scan3 = (targetName2, text6, includer) => {
|
|
33882
33882
|
for (const [, quote, name3] of text6.matchAll(
|
|
33883
33883
|
/^\s*#\s*include\s*([<"])([^>"\n]+)[>"]/gm
|
|
33884
33884
|
)) {
|
|
33885
33885
|
const relative6 = quote === '"' && includer ? [import_node_path17.default.posix.normalize(import_node_path17.default.posix.join(import_node_path17.default.posix.dirname(includer), name3))] : [];
|
|
33886
|
-
for (const include of [...relative6, name3]) if (admit(
|
|
33886
|
+
for (const include of [...relative6, name3]) if (admit(targetName2, include)) break;
|
|
33887
33887
|
}
|
|
33888
33888
|
};
|
|
33889
|
-
const admit = (
|
|
33890
|
-
const key2 = `${
|
|
33889
|
+
const admit = (targetName2, include) => {
|
|
33890
|
+
const key2 = `${targetName2}\0${include}`;
|
|
33891
33891
|
if (admitted.has(key2)) return true;
|
|
33892
33892
|
const header = dependencyHeader(include);
|
|
33893
33893
|
if (!header) return false;
|
|
33894
33894
|
admitted.add(key2);
|
|
33895
|
-
const original = `${targetPath(
|
|
33895
|
+
const original = `${targetPath(targetName2)}/include/${include}`;
|
|
33896
33896
|
add2(original, header.text);
|
|
33897
33897
|
result.sources.push({
|
|
33898
33898
|
file: original,
|
|
@@ -33900,8 +33900,8 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
33900
33900
|
sha256: header.sha256,
|
|
33901
33901
|
...header.derivation && { derivation: header.derivation }
|
|
33902
33902
|
});
|
|
33903
|
-
scan3(
|
|
33904
|
-
const tree2 = `${
|
|
33903
|
+
scan3(targetName2, header.text, include);
|
|
33904
|
+
const tree2 = `${targetName2}\0${header.name}`;
|
|
33905
33905
|
if (!dependencyTrees.has(tree2)) {
|
|
33906
33906
|
dependencyTrees.add(tree2);
|
|
33907
33907
|
for (const name3 of nitroDependencyIncludes(
|
|
@@ -33909,15 +33909,15 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
33909
33909
|
reactNative.root,
|
|
33910
33910
|
header.name
|
|
33911
33911
|
))
|
|
33912
|
-
admit(
|
|
33912
|
+
admit(targetName2, name3);
|
|
33913
33913
|
}
|
|
33914
33914
|
return true;
|
|
33915
33915
|
};
|
|
33916
33916
|
for (const node of allModules) {
|
|
33917
|
-
const
|
|
33917
|
+
const targetName2 = nitroProviderTarget(node.provider);
|
|
33918
33918
|
for (const [file, text6] of Object.entries(result.files))
|
|
33919
|
-
if (file.startsWith(`${targetPath(
|
|
33920
|
-
scan3(
|
|
33919
|
+
if (file.startsWith(`${targetPath(targetName2)}/upstream/`))
|
|
33920
|
+
scan3(targetName2, text6, null);
|
|
33921
33921
|
}
|
|
33922
33922
|
add2(
|
|
33923
33923
|
`${targetPath(jsiTarget)}/include/module.modulemap`,
|
|
@@ -34030,11 +34030,11 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
34030
34030
|
for (const node of allModules) {
|
|
34031
34031
|
const module2 = node.provider;
|
|
34032
34032
|
const config = node.config;
|
|
34033
|
-
const
|
|
34034
|
-
const iosObjcHeaders = iosObjcHeadersByTarget.get(
|
|
34033
|
+
const targetName2 = nitroProviderTarget(module2);
|
|
34034
|
+
const iosObjcHeaders = iosObjcHeadersByTarget.get(targetName2) ?? [];
|
|
34035
34035
|
if (iosObjcHeaders.length > 0) {
|
|
34036
34036
|
add2(
|
|
34037
|
-
`${targetPath(
|
|
34037
|
+
`${targetPath(targetName2)}/include/PeachPodObjCUmbrella.h`,
|
|
34038
34038
|
[
|
|
34039
34039
|
"#pragma once",
|
|
34040
34040
|
"#ifdef __OBJC__",
|
|
@@ -34052,8 +34052,8 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
34052
34052
|
...iosObjcHeaders.length > 0 ? ['header "PeachPodObjCUmbrella.h"'] : []
|
|
34053
34053
|
];
|
|
34054
34054
|
add2(
|
|
34055
|
-
`${targetPath(
|
|
34056
|
-
`module ${
|
|
34055
|
+
`${targetPath(targetName2)}/include/module.modulemap`,
|
|
34056
|
+
`module ${targetName2} { ${modulemapHeaders.length > 0 ? `${modulemapHeaders.join(" ")} ` : ""}export * }
|
|
34057
34057
|
`
|
|
34058
34058
|
);
|
|
34059
34059
|
if (!node.registered) continue;
|
|
@@ -34066,7 +34066,7 @@ function collectNitroSources(options, nativeSourceKeys, sourceRoot) {
|
|
|
34066
34066
|
extern "C" void ${registration.symbol}();
|
|
34067
34067
|
`);
|
|
34068
34068
|
add2(
|
|
34069
|
-
`${targetPath(
|
|
34069
|
+
`${targetPath(targetName2)}/PeachNitroRegistration.cpp`,
|
|
34070
34070
|
[
|
|
34071
34071
|
'#include "PeachNitroRegistration.hpp"',
|
|
34072
34072
|
"#include <NitroModules/HybridObjectRegistry.hpp>",
|
|
@@ -36464,24 +36464,24 @@ var init_app_config = __esm({
|
|
|
36464
36464
|
});
|
|
36465
36465
|
|
|
36466
36466
|
// src/backend-origin.ts
|
|
36467
|
-
function normalizeHostname(
|
|
36468
|
-
return
|
|
36467
|
+
function normalizeHostname(hostname2) {
|
|
36468
|
+
return hostname2.replace(/^\[|\]$/g, "").toLowerCase();
|
|
36469
36469
|
}
|
|
36470
|
-
function buildLoopbackProbeBaseUrl(protocol,
|
|
36471
|
-
const normalizedHostname = normalizeHostname(
|
|
36470
|
+
function buildLoopbackProbeBaseUrl(protocol, hostname2, port) {
|
|
36471
|
+
const normalizedHostname = normalizeHostname(hostname2);
|
|
36472
36472
|
const urlHost = normalizedHostname.includes(":") ? `[${normalizedHostname}]` : normalizedHostname;
|
|
36473
36473
|
return `${protocol}//${urlHost}:${port}`;
|
|
36474
36474
|
}
|
|
36475
|
-
function isLoopbackHost(
|
|
36476
|
-
const normalized = normalizeHostname(
|
|
36475
|
+
function isLoopbackHost(hostname2) {
|
|
36476
|
+
const normalized = normalizeHostname(hostname2);
|
|
36477
36477
|
return normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "0.0.0.0" || normalized === "::1" || /^127(?:\.\d{1,3}){3}$/.test(normalized);
|
|
36478
36478
|
}
|
|
36479
36479
|
function isTrustedBridgeRequest(headers) {
|
|
36480
36480
|
const origin = headers.origin;
|
|
36481
36481
|
if (origin === void 0) return true;
|
|
36482
36482
|
try {
|
|
36483
|
-
const { hostname, host: host2 } = new NativeURL(String(origin));
|
|
36484
|
-
return isLoopbackHost(
|
|
36483
|
+
const { hostname: hostname2, host: host2 } = new NativeURL(String(origin));
|
|
36484
|
+
return isLoopbackHost(hostname2) || [headers.host, headers[":authority"], headers["x-forwarded-host"]].some(
|
|
36485
36485
|
(value) => typeof value === "string" && value.toLowerCase() === host2
|
|
36486
36486
|
);
|
|
36487
36487
|
} catch {
|
|
@@ -36500,8 +36500,8 @@ function buildBrowserAssetProxyUrl(targetUrl) {
|
|
|
36500
36500
|
const proxyPath = isLoopbackHost(new NativeURL(targetUrl).hostname) ? "/__bundle-proxy" : "/__fetch-proxy";
|
|
36501
36501
|
return `${proxyPath}?url=${encodeURIComponent(targetUrl)}`;
|
|
36502
36502
|
}
|
|
36503
|
-
function isContrastBackendHost(
|
|
36504
|
-
const normalized = normalizeHostname(
|
|
36503
|
+
function isContrastBackendHost(hostname2) {
|
|
36504
|
+
const normalized = normalizeHostname(hostname2);
|
|
36505
36505
|
return isLoopbackHost(normalized) || normalized === "contrast.dev" || normalized.endsWith(".contrast.dev") || normalized === "peachsim.com" || normalized === "www.peachsim.com" || normalized === PEACHSIM_NATIVE_HOST;
|
|
36506
36506
|
}
|
|
36507
36507
|
function resolveContrastBackendOrigin(currentOrigin, search) {
|
|
@@ -37397,14 +37397,14 @@ function canonicalLabel(label, from) {
|
|
|
37397
37397
|
const { repo, pkg } = splitLabel(from);
|
|
37398
37398
|
return `${repo ? `@@${repo}` : ""}//${pkg}:${label.replace(/^:/, "")}`;
|
|
37399
37399
|
}
|
|
37400
|
-
function readBazelAppTarget(buildFile,
|
|
37401
|
-
if (!
|
|
37400
|
+
function readBazelAppTarget(buildFile, targetName2, configurationName, options = {}) {
|
|
37401
|
+
if (!targetName2)
|
|
37402
37402
|
throw new Error(
|
|
37403
37403
|
`${buildFile}: pass --target with the ios_application the bazel package builds`
|
|
37404
37404
|
);
|
|
37405
37405
|
const root = import_node_fs31.default.realpathSync.native(workspaceRoot(import_node_fs31.default.realpathSync.native(buildFile)));
|
|
37406
37406
|
const pkg = import_node_path27.default.relative(root, import_node_path27.default.dirname(import_node_fs31.default.realpathSync.native(buildFile)));
|
|
37407
|
-
const label = `//${pkg.split(import_node_path27.default.sep).join("/")}:${
|
|
37407
|
+
const label = `//${pkg.split(import_node_path27.default.sep).join("/")}:${targetName2}`;
|
|
37408
37408
|
const configuration = configurationName ?? "Debug";
|
|
37409
37409
|
const graph = bazelGraph(root, label, configuration);
|
|
37410
37410
|
const files2 = new BazelFiles(graph, root);
|
|
@@ -37640,7 +37640,7 @@ ${published3.map(
|
|
|
37640
37640
|
const appModule = {
|
|
37641
37641
|
...named,
|
|
37642
37642
|
id: idOf(graph.app),
|
|
37643
|
-
name:
|
|
37643
|
+
name: targetName2,
|
|
37644
37644
|
targetIdentity: graph.app.label,
|
|
37645
37645
|
targetDependencies: [
|
|
37646
37646
|
...new Set(appParts.flatMap(({ module: module2 }) => module2.targetDependencies))
|
|
@@ -37929,7 +37929,7 @@ ${published3.map(
|
|
|
37929
37929
|
{
|
|
37930
37930
|
id: appModule.id,
|
|
37931
37931
|
sourceTarget: appModule.moduleName,
|
|
37932
|
-
productName: `${
|
|
37932
|
+
productName: `${targetName2}.app`,
|
|
37933
37933
|
productType: "com.apple.product-type.application",
|
|
37934
37934
|
installName: null,
|
|
37935
37935
|
buildVersion: { platform: "iphonesimulator", minimumOS, sdk: null },
|
|
@@ -37973,7 +37973,7 @@ ${published3.map(
|
|
|
37973
37973
|
binaryFrameworks,
|
|
37974
37974
|
sdkFrameworks,
|
|
37975
37975
|
packageResolved: [],
|
|
37976
|
-
appTargets: [
|
|
37976
|
+
appTargets: [targetName2],
|
|
37977
37977
|
configuration,
|
|
37978
37978
|
settings: (key2) => key2 === "PRODUCT_MODULE_NAME" ? appModule.moduleName : key2 === "IPHONEOS_DEPLOYMENT_TARGET" ? minimumOS : key2 === "PRODUCT_BUNDLE_IDENTIFIER" ? graph.app.attrs.get("bundle_id")?.value ?? "" : "",
|
|
37979
37979
|
cocoapods: null
|
|
@@ -39240,7 +39240,7 @@ function parseBuildSettings(block2) {
|
|
|
39240
39240
|
}
|
|
39241
39241
|
return settings;
|
|
39242
39242
|
}
|
|
39243
|
-
function appTargetReleaseSettings(pbxproj,
|
|
39243
|
+
function appTargetReleaseSettings(pbxproj, targetName2, infoPlistRelativePath) {
|
|
39244
39244
|
const configurationPattern = /\/\* (Release|Debug) \*\/ = \{/g;
|
|
39245
39245
|
const candidates = [];
|
|
39246
39246
|
let match;
|
|
@@ -39261,7 +39261,7 @@ function appTargetReleaseSettings(pbxproj, targetName, infoPlistRelativePath) {
|
|
|
39261
39261
|
const normalized = plist6.replace(/^"|"$/g, "");
|
|
39262
39262
|
return normalized === infoPlistRelativePath || infoPlistRelativePath.endsWith(`/${normalized}`) || normalized.endsWith(`/${infoPlistRelativePath}`);
|
|
39263
39263
|
};
|
|
39264
|
-
const named = (settings) => resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings) ===
|
|
39264
|
+
const named = (settings) => resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings) === targetName2;
|
|
39265
39265
|
return candidates.find(
|
|
39266
39266
|
(candidate) => candidate.name === "Release" && plistMatch(candidate.settings)
|
|
39267
39267
|
)?.settings ?? candidates.find(
|
|
@@ -39305,31 +39305,31 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
39305
39305
|
applicationTargetNames.add(match[1]);
|
|
39306
39306
|
}
|
|
39307
39307
|
}
|
|
39308
|
-
let
|
|
39308
|
+
let targetName2 = null;
|
|
39309
39309
|
if (iosTarget) {
|
|
39310
39310
|
if (applicationTargetNames.has(iosTarget)) {
|
|
39311
|
-
|
|
39311
|
+
targetName2 = iosTarget;
|
|
39312
39312
|
} else {
|
|
39313
39313
|
return null;
|
|
39314
39314
|
}
|
|
39315
39315
|
} else if (applicationTargetNames.size === 1) {
|
|
39316
|
-
|
|
39316
|
+
targetName2 = [...applicationTargetNames][0];
|
|
39317
39317
|
} else if (applicationTargetNames.size > 1) {
|
|
39318
39318
|
const delegateTargets = Object.keys(files2).filter((path148) => !path148.includes("/Pods/")).map((path148) => path148.match(APP_DELEGATE_PATH_RE)?.[1]).filter(
|
|
39319
39319
|
(name3) => typeof name3 === "string" && applicationTargetNames.has(name3)
|
|
39320
39320
|
);
|
|
39321
39321
|
if (delegateTargets.length === 1) {
|
|
39322
|
-
|
|
39322
|
+
targetName2 = delegateTargets[0];
|
|
39323
39323
|
} else {
|
|
39324
39324
|
return null;
|
|
39325
39325
|
}
|
|
39326
39326
|
} else {
|
|
39327
39327
|
return null;
|
|
39328
39328
|
}
|
|
39329
|
-
const selectedTarget = targets.find((t) => t.name ===
|
|
39329
|
+
const selectedTarget = targets.find((t) => t.name === targetName2);
|
|
39330
39330
|
const settings = {
|
|
39331
|
-
TARGET_NAME:
|
|
39332
|
-
PRODUCT_NAME:
|
|
39331
|
+
TARGET_NAME: targetName2,
|
|
39332
|
+
PRODUCT_NAME: targetName2
|
|
39333
39333
|
};
|
|
39334
39334
|
for (const obj of Object.values(objects)) {
|
|
39335
39335
|
if (isRecord(obj) && obj.isa === "PBXProject" && typeof obj.buildConfigurationList === "string") {
|
|
@@ -39365,8 +39365,8 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
39365
39365
|
} else {
|
|
39366
39366
|
const legacy2 = appTargetReleaseSettings(
|
|
39367
39367
|
pbxproj,
|
|
39368
|
-
|
|
39369
|
-
`${
|
|
39368
|
+
targetName2,
|
|
39369
|
+
`${targetName2}/Info.plist`
|
|
39370
39370
|
);
|
|
39371
39371
|
if (legacy2) Object.assign(settings, legacy2);
|
|
39372
39372
|
}
|
|
@@ -39377,7 +39377,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
39377
39377
|
plist6 = files2[`ios/${normalized}`] ?? files2[normalized] ?? Object.entries(files2).find(([k]) => k.endsWith(`/${normalized}`))?.[1];
|
|
39378
39378
|
}
|
|
39379
39379
|
if (!plist6) {
|
|
39380
|
-
plist6 = files2[`ios/${
|
|
39380
|
+
plist6 = files2[`ios/${targetName2}/Info.plist`] ?? files2[`${targetName2}/Info.plist`] ?? Object.entries(files2).find(([k]) => k.endsWith(`/${targetName2}/Info.plist`))?.[1];
|
|
39381
39381
|
}
|
|
39382
39382
|
if (!plist6) return null;
|
|
39383
39383
|
const bundleIdentifier = identityFieldFrom(
|
|
@@ -39401,7 +39401,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
39401
39401
|
settings,
|
|
39402
39402
|
plistString(plist6, "CFBundleName"),
|
|
39403
39403
|
settings.PRODUCT_NAME
|
|
39404
|
-
) ?? resolvedIdentityField(resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings)) ?? resolvedIdentityField(
|
|
39404
|
+
) ?? resolvedIdentityField(resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings)) ?? resolvedIdentityField(targetName2);
|
|
39405
39405
|
if (!bundleName) return null;
|
|
39406
39406
|
const applicationName = identityFieldFrom(settings, plistString(plist6, "CFBundleDisplayName"), void 0) ?? bundleName;
|
|
39407
39407
|
const dictionary2 = parseInfoPlist(plist6);
|
|
@@ -39567,7 +39567,7 @@ function nativeAppIdentityFromIos(files2, parseInfoPlist, iosTarget, resourceUri
|
|
|
39567
39567
|
}
|
|
39568
39568
|
const rootModuleName = readRootModuleName(
|
|
39569
39569
|
Object.entries(files2).filter(
|
|
39570
|
-
([path148]) => !path148.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path148) || path148.match(APP_DELEGATE_PATH_RE)?.[1] ===
|
|
39570
|
+
([path148]) => !path148.includes("/Pods/") && (/(?:^|\/)(?:ios\/)?AppDelegate\.(?:swift|mm|m)$/.test(path148) || path148.match(APP_DELEGATE_PATH_RE)?.[1] === targetName2)
|
|
39571
39571
|
).map(([, source]) => source)
|
|
39572
39572
|
);
|
|
39573
39573
|
return {
|
|
@@ -40519,7 +40519,7 @@ var swiftCoverageProvenance;
|
|
|
40519
40519
|
var init_provenance = __esm({
|
|
40520
40520
|
"src/swift-coverage/provenance.ts"() {
|
|
40521
40521
|
"use strict";
|
|
40522
|
-
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"a19fe4c5e2efe18bbc3ece544ff2c8be660170d63274cccb0ab58e53083050e4","swift-package.ts":"851417572ca9aff699ad368bdc3ff05309b0256e483d40812b9c0beb869d0a5b","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"dec93d0206df8efbd9f538d1f3e3f6173f6eb022cb9ad6b02271481db7578d77","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"4a775ba92c7b23ce71dd6bb08c188c4bccd6e1ed500cc9fc7850030b945fc8d4","xcode-project.ts":"
|
|
40522
|
+
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"a19fe4c5e2efe18bbc3ece544ff2c8be660170d63274cccb0ab58e53083050e4","swift-package.ts":"851417572ca9aff699ad368bdc3ff05309b0256e483d40812b9c0beb869d0a5b","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"dec93d0206df8efbd9f538d1f3e3f6173f6eb022cb9ad6b02271481db7578d77","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"4a775ba92c7b23ce71dd6bb08c188c4bccd6e1ed500cc9fc7850030b945fc8d4","xcode-project.ts":"b0da81ab133ad067978e174c2f62f5a9655dfe6b5639bc4b884f3137a8136144","xcode-target-members.ts":"2f25aaf5a3aa34395983c75935491c06bd68554c47ff1cb06b49c79499c03db0","xcode-json-project.ts":"41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6","openstep-plist.ts":"74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3"}') : swiftCoverageSourceDigests((0, import_node_path.join)(__sootsim_import_meta_dirname, ".."));
|
|
40523
40523
|
}
|
|
40524
40524
|
});
|
|
40525
40525
|
|
|
@@ -49739,7 +49739,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk2)
|
|
|
49739
49739
|
const overlayFiles = (0, import_node_fs44.readdirSync)(overlay, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path41.default.join(entry.parentPath, entry.name)).sort();
|
|
49740
49740
|
const key2 = JSON.stringify([
|
|
49741
49741
|
// bump the recipe when the transformation changes; bundling changes function text.
|
|
49742
|
-
"
|
|
49742
|
+
"v25",
|
|
49743
49743
|
[...WEAKEN_FOUNDATION_SYMS],
|
|
49744
49744
|
toolchainBin,
|
|
49745
49745
|
sdk2,
|
|
@@ -49799,6 +49799,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk2)
|
|
|
49799
49799
|
"objc/NSObject.h",
|
|
49800
49800
|
"ObjectiveC.apinotes",
|
|
49801
49801
|
"net/if.h",
|
|
49802
|
+
"netinet/tcp.h",
|
|
49802
49803
|
"notify.h",
|
|
49803
49804
|
"notify.modulemap",
|
|
49804
49805
|
"module.modulemap",
|
|
@@ -52280,9 +52281,9 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
52280
52281
|
const sLive = liveSegs.get(obj);
|
|
52281
52282
|
const dLive = liveDataSyms.get(obj);
|
|
52282
52283
|
const tLive = liveTypes.get(obj);
|
|
52283
|
-
const
|
|
52284
|
+
const targetName2 = obj.symNames[r.rs] ?? "";
|
|
52284
52285
|
if (segName === "swift5_type_metadata") {
|
|
52285
|
-
const raw2 =
|
|
52286
|
+
const raw2 = targetName2.startsWith(".Lgot.") ? targetName2.slice(6) : targetName2;
|
|
52286
52287
|
if (raw2.endsWith("Mn")) {
|
|
52287
52288
|
const pref = raw2.slice(0, -2);
|
|
52288
52289
|
if (obj.typePrefixesInObj.has(pref)) return tLive.has(pref);
|
|
@@ -63368,7 +63369,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
63368
63369
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
63369
63370
|
MULTI_MANIFEST_VERSION = 71;
|
|
63370
63371
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
63371
|
-
compilerSourceDigest = true ? "
|
|
63372
|
+
compilerSourceDigest = true ? "d287f3ad479477c70004707c1336f37c9baeb81aef1880544a5ca236e088ca16" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
63372
63373
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
63373
63374
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
63374
63375
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -65324,10 +65325,10 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
65324
65325
|
phases.set(`id:${phaseId}`, phaseId);
|
|
65325
65326
|
}
|
|
65326
65327
|
}
|
|
65327
|
-
const phaseFiles = (reference,
|
|
65328
|
+
const phaseFiles = (reference, targetName2) => {
|
|
65328
65329
|
const value = text5(reference);
|
|
65329
65330
|
if (value === void 0) return null;
|
|
65330
|
-
const key2 = value.startsWith("id:") || !
|
|
65331
|
+
const key2 = value.startsWith("id:") || !targetName2 ? value : `${targetName2}/${value}`;
|
|
65331
65332
|
const phase = objects[phases.get(key2) ?? ""];
|
|
65332
65333
|
return phase && typeof phase === "object" && !Array.isArray(phase) && Array.isArray(phase.files) ? phase.files : null;
|
|
65333
65334
|
};
|
|
@@ -65524,6 +65525,11 @@ function applyOperator(value, operator) {
|
|
|
65524
65525
|
case "identifier":
|
|
65525
65526
|
case "c99extidentifier":
|
|
65526
65527
|
return value.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
65528
|
+
case "standardizepath":
|
|
65529
|
+
if (value === ".") return value;
|
|
65530
|
+
if (import_node_path62.default.posix.isAbsolute(value))
|
|
65531
|
+
return import_node_path62.default.posix.normalize(value).replace(/(?<=.)\/$/, "");
|
|
65532
|
+
return value.split("/").filter((component) => component !== "" && component !== ".").join("/");
|
|
65527
65533
|
}
|
|
65528
65534
|
throw new Error(`unsupported build setting operator :${operator}`);
|
|
65529
65535
|
}
|
|
@@ -65898,14 +65904,34 @@ function compilationConditions(settings) {
|
|
|
65898
65904
|
];
|
|
65899
65905
|
}
|
|
65900
65906
|
function expand(value, lookup4) {
|
|
65901
|
-
|
|
65902
|
-
|
|
65903
|
-
|
|
65904
|
-
|
|
65905
|
-
|
|
65906
|
-
|
|
65907
|
-
|
|
65908
|
-
|
|
65907
|
+
const references = /\$([({]|[A-Za-z_][A-Za-z0-9_]*)/g;
|
|
65908
|
+
let output2 = "";
|
|
65909
|
+
let cursor = 0;
|
|
65910
|
+
for (let match = references.exec(value); match; match = references.exec(value)) {
|
|
65911
|
+
let expression = match[1];
|
|
65912
|
+
let end = references.lastIndex;
|
|
65913
|
+
if (expression === "(" || expression === "{") {
|
|
65914
|
+
const start = end;
|
|
65915
|
+
const delimiters = [expression === "(" ? ")" : "}"];
|
|
65916
|
+
while (end < value.length && delimiters.length > 0) {
|
|
65917
|
+
const character = value[end++];
|
|
65918
|
+
if (character === delimiters.at(-1)) delimiters.pop();
|
|
65919
|
+
else if (character === "$" && (value[end] === "(" || value[end] === "{"))
|
|
65920
|
+
delimiters.push(value[end++] === "(" ? ")" : "}");
|
|
65921
|
+
}
|
|
65922
|
+
if (delimiters.length > 0) continue;
|
|
65923
|
+
expression = expand(value.slice(start, end - 1), lookup4);
|
|
65924
|
+
}
|
|
65925
|
+
const [name3, ...operators] = expression.split(":");
|
|
65926
|
+
if (!name3 || !/^[A-Za-z_][A-Za-z0-9_-]*$/.test(name3)) continue;
|
|
65927
|
+
output2 += value.slice(cursor, match.index);
|
|
65928
|
+
output2 += operators.reduce(
|
|
65929
|
+
(current2, operator) => applyOperator(current2, operator),
|
|
65930
|
+
lookup4(name3)
|
|
65931
|
+
);
|
|
65932
|
+
cursor = references.lastIndex = end;
|
|
65933
|
+
}
|
|
65934
|
+
return output2 + value.slice(cursor);
|
|
65909
65935
|
}
|
|
65910
65936
|
function shellAssetCatalogs(script, settings, projectDir) {
|
|
65911
65937
|
const assigned = /* @__PURE__ */ new Map();
|
|
@@ -65992,7 +66018,7 @@ function fileListEntries(file, absolute) {
|
|
|
65992
66018
|
}
|
|
65993
66019
|
function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
65994
66020
|
const { project: project2, target, id: targetId } = ref;
|
|
65995
|
-
const
|
|
66021
|
+
const targetName2 = str(target.name) ?? targetId;
|
|
65996
66022
|
const sources = /* @__PURE__ */ new Set();
|
|
65997
66023
|
const allSources = /* @__PURE__ */ new Set();
|
|
65998
66024
|
const headers = /* @__PURE__ */ new Set();
|
|
@@ -66065,7 +66091,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
66065
66091
|
for (const { file } of lists)
|
|
66066
66092
|
if (!import_node_fs64.default.existsSync(file))
|
|
66067
66093
|
throw new Error(
|
|
66068
|
-
`${
|
|
66094
|
+
`${targetName2}: Run Script "${script}" missing file list ${file}`
|
|
66069
66095
|
);
|
|
66070
66096
|
const env = {
|
|
66071
66097
|
...process.env,
|
|
@@ -66161,7 +66187,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
66161
66187
|
const output2 = error instanceof Error ? `${error.message}
|
|
66162
66188
|
${"stdout" in error ? String(error.stdout) : ""}${"stderr" in error ? String(error.stderr) : ""}` : String(error);
|
|
66163
66189
|
throw new Error(
|
|
66164
|
-
`${
|
|
66190
|
+
`${targetName2}: Run Script "${script}" failed preparing generated outputs:
|
|
66165
66191
|
${output2}`
|
|
66166
66192
|
);
|
|
66167
66193
|
}
|
|
@@ -66170,7 +66196,7 @@ ${output2}`
|
|
|
66170
66196
|
);
|
|
66171
66197
|
if (missing2.length > 0)
|
|
66172
66198
|
throw new Error(
|
|
66173
|
-
`${
|
|
66199
|
+
`${targetName2}: Run Script "${script}" did not produce ${missing2.join(", ")}`
|
|
66174
66200
|
);
|
|
66175
66201
|
preparedSourcePhases.set(key2, stamp);
|
|
66176
66202
|
preparedXcodePhase(
|
|
@@ -66202,7 +66228,7 @@ ${output2}`
|
|
|
66202
66228
|
if (options.requireSources === false) return;
|
|
66203
66229
|
const script = scriptForOutput.get(import_node_path62.default.normalize(file));
|
|
66204
66230
|
throw new Error(
|
|
66205
|
-
script ? `${
|
|
66231
|
+
script ? `${targetName2}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)` : `${targetName2}: missing source ${file}`
|
|
66206
66232
|
);
|
|
66207
66233
|
}
|
|
66208
66234
|
allSources.add(file);
|
|
@@ -66225,7 +66251,7 @@ ${output2}`
|
|
|
66225
66251
|
);
|
|
66226
66252
|
if (runtimeInterfaceFiles.length > 0)
|
|
66227
66253
|
throw new Error(
|
|
66228
|
-
`${
|
|
66254
|
+
`${targetName2}: Interface Builder compilation requires macOS and Xcode`
|
|
66229
66255
|
);
|
|
66230
66256
|
for (const file of interfaceFiles) resources.delete(file);
|
|
66231
66257
|
interfaceFiles.length = 0;
|
|
@@ -66241,7 +66267,7 @@ ${output2}`
|
|
|
66241
66267
|
import_node_path62.default.basename(file, import_node_path62.default.extname(file)) + extension
|
|
66242
66268
|
);
|
|
66243
66269
|
if (interfaceOutputs.has(output2))
|
|
66244
|
-
throw new Error(`${
|
|
66270
|
+
throw new Error(`${targetName2}: duplicate Interface Builder output ${output2}`);
|
|
66245
66271
|
interfaceOutputs.add(output2);
|
|
66246
66272
|
const args = [
|
|
66247
66273
|
"ibtool",
|
|
@@ -66283,7 +66309,7 @@ ${output2}`
|
|
|
66283
66309
|
);
|
|
66284
66310
|
if (definitions.length > 0 && process.platform !== "darwin")
|
|
66285
66311
|
throw new Error(
|
|
66286
|
-
`${
|
|
66312
|
+
`${targetName2}: intent definition code generation requires macOS and Xcode`
|
|
66287
66313
|
);
|
|
66288
66314
|
for (const definition2 of definitions) {
|
|
66289
66315
|
const configuredLanguage = settings("INTENTS_CODEGEN_LANGUAGE");
|
|
@@ -66568,8 +66594,8 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
66568
66594
|
if (!name3) {
|
|
66569
66595
|
const declared = (project2 ? [project2] : projects2).flatMap(
|
|
66570
66596
|
(candidate) => projectTargets(candidate).flatMap((ref) => {
|
|
66571
|
-
const
|
|
66572
|
-
return
|
|
66597
|
+
const targetName2 = str(ref.target.name);
|
|
66598
|
+
return targetName2 ? [targetName2] : [];
|
|
66573
66599
|
})
|
|
66574
66600
|
);
|
|
66575
66601
|
throw new Error(
|
|
@@ -66671,9 +66697,9 @@ async function resolveXcodeSwiftPackages(input, signal, target, configuration) {
|
|
|
66671
66697
|
);
|
|
66672
66698
|
}
|
|
66673
66699
|
}
|
|
66674
|
-
function readXcodeAppTarget(input,
|
|
66700
|
+
function readXcodeAppTarget(input, targetName2, configurationName, options = {}) {
|
|
66675
66701
|
if (isBazelPackage(input))
|
|
66676
|
-
return readBazelAppTarget(input,
|
|
66702
|
+
return readBazelAppTarget(input, targetName2, configurationName, options);
|
|
66677
66703
|
const xcodeprojOrWorkspace = import_node_fs64.default.realpathSync.native(input);
|
|
66678
66704
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
66679
66705
|
const { listed, projects: projects2, projectAt, cocoapods } = workspaceProjects(
|
|
@@ -66682,18 +66708,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
66682
66708
|
);
|
|
66683
66709
|
const allTargets = projects2.flatMap(projectTargets);
|
|
66684
66710
|
const appTargets = allTargets.filter(
|
|
66685
|
-
(ref) => isIosAppTarget(ref, options) ||
|
|
66711
|
+
(ref) => isIosAppTarget(ref, options) || targetName2 !== void 0 && ref.target.name === targetName2 && ref.target.productType === APP_EXTENSION
|
|
66686
66712
|
);
|
|
66687
66713
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
66688
66714
|
const container = import_node_path62.default.basename(xcodeprojOrWorkspace);
|
|
66689
|
-
const named =
|
|
66715
|
+
const named = targetName2 ? appTargets.filter((ref) => ref.target.name === targetName2) : appTargets;
|
|
66690
66716
|
if (named.length !== 1) {
|
|
66691
66717
|
if (appTargets.length === 0)
|
|
66692
66718
|
throw new Error(
|
|
66693
66719
|
`${container} has no application targets; open a project or workspace that contains one`
|
|
66694
66720
|
);
|
|
66695
66721
|
throw new Error(
|
|
66696
|
-
|
|
66722
|
+
targetName2 && named.length === 0 ? `${container} has no application target ${targetName2}; it has ${appTargetNames.join(", ") || "none"}` : targetName2 ? `${container} has ${named.length} application targets named ${targetName2}; open its .xcodeproj` : `${container} has ${appTargetNames.length} application targets (${appTargetNames.join(", ")}); pass --target`
|
|
66697
66723
|
);
|
|
66698
66724
|
}
|
|
66699
66725
|
const app = named[0];
|
|
@@ -70099,7 +70125,7 @@ var init_swift_standin_digest = __esm({
|
|
|
70099
70125
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
70100
70126
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
70101
70127
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
70102
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
70128
|
+
STANDIN_SOURCE_DIGEST = true ? "33613fe0a59b84be02c11350a1382f0d95184a98af5ca339e388eff115c7ac07" : standinSourceDigest();
|
|
70103
70129
|
}
|
|
70104
70130
|
});
|
|
70105
70131
|
|
|
@@ -70594,7 +70620,7 @@ __export(expo_native_prebuilt_exports, {
|
|
|
70594
70620
|
servedExpoSwift: () => servedExpoSwift
|
|
70595
70621
|
});
|
|
70596
70622
|
function expoNativeCompilerDigestValue() {
|
|
70597
|
-
return true ? "
|
|
70623
|
+
return true ? "3181932dd2ed2c52395d79a508dd2a69be6d6c9cc5505969f5be19dd4f1b4d81" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
70598
70624
|
}
|
|
70599
70625
|
function readSources(value) {
|
|
70600
70626
|
const sources = isRecord(value) ? value.sources : null;
|
|
@@ -71732,6 +71758,7 @@ async function fetchCheckout(checkouts, identity2, pin2, signal) {
|
|
|
71732
71758
|
}
|
|
71733
71759
|
function fetchedCheckout(checkouts, identity2, pin2) {
|
|
71734
71760
|
const dir = import_node_path77.default.join(checkouts, identity2);
|
|
71761
|
+
if (preparedSwiftPin(checkouts, identity2, pin2.location, pin2.revision)) return dir;
|
|
71735
71762
|
const head = import_node_path77.default.join(dir, ".git", "HEAD");
|
|
71736
71763
|
if (!verified.has(checkoutKey(dir, pin2)) || !import_node_fs79.default.existsSync(head) || import_node_fs79.default.readFileSync(head, "utf8").trim() !== pin2.revision)
|
|
71737
71764
|
throw new Error(
|
|
@@ -84776,12 +84803,12 @@ async function collectTurboSources(options) {
|
|
|
84776
84803
|
)
|
|
84777
84804
|
)
|
|
84778
84805
|
);
|
|
84779
|
-
const original = (
|
|
84806
|
+
const original = (targetName2, label, root, relative6, compiled = true) => {
|
|
84780
84807
|
const staged = relative6.replace(
|
|
84781
84808
|
/(^|\/)main(\.(?:c|cc|cpp|cxx|m|mm))$/,
|
|
84782
84809
|
"$1main.library$2"
|
|
84783
84810
|
);
|
|
84784
|
-
const key2 = `${targetPath(
|
|
84811
|
+
const key2 = `${targetPath(targetName2)}/upstream/${label}/${staged}`;
|
|
84785
84812
|
if (UNIT.test(relative6) || OBJC2.test(relative6))
|
|
84786
84813
|
(compiled ? compiledSources : textualSources).add(key2);
|
|
84787
84814
|
if (Object.hasOwn(result.files, key2)) return key2;
|
|
@@ -84790,24 +84817,24 @@ async function collectTurboSources(options) {
|
|
|
84790
84817
|
if (installed2?.flags.length) {
|
|
84791
84818
|
let prefixHeader = null;
|
|
84792
84819
|
if (installed2.prefixHeader) {
|
|
84793
|
-
prefixHeader = `${targetPath(
|
|
84820
|
+
prefixHeader = `${targetPath(targetName2)}/${import_node_path93.default.basename(installed2.prefixHeader)}`;
|
|
84794
84821
|
add2(prefixHeader, import_node_fs96.default.readFileSync(installed2.prefixHeader, "utf8"));
|
|
84795
84822
|
}
|
|
84796
84823
|
result.nativeTargets ??= [];
|
|
84797
|
-
let native = result.nativeTargets.find(({ name: name3 }) => name3 ===
|
|
84824
|
+
let native = result.nativeTargets.find(({ name: name3 }) => name3 === targetName2);
|
|
84798
84825
|
if (!native) {
|
|
84799
84826
|
native = {
|
|
84800
|
-
name:
|
|
84827
|
+
name: targetName2,
|
|
84801
84828
|
deploymentTarget: null,
|
|
84802
84829
|
headers: [],
|
|
84803
|
-
publicHeaders:
|
|
84804
|
-
`${targetPath(
|
|
84830
|
+
publicHeaders: targetName2 === TURBO_CORE_TARGET ? [
|
|
84831
|
+
`${targetPath(targetName2)}/${TURBO_CORE_PUBLIC_HEADERS}/${TURBO_ENTRY_HEADER}`
|
|
84805
84832
|
] : [],
|
|
84806
84833
|
flattensPublicHeaders: false,
|
|
84807
84834
|
bridgingHeader: null,
|
|
84808
84835
|
prefixHeader,
|
|
84809
84836
|
headerSearchPaths: [
|
|
84810
|
-
`${targetPath(
|
|
84837
|
+
`${targetPath(targetName2)}/${targetName2 === TURBO_CORE_TARGET ? TURBO_CORE_PUBLIC_HEADERS : "include"}`
|
|
84811
84838
|
],
|
|
84812
84839
|
userHeaderSearchPaths: [],
|
|
84813
84840
|
frameworkSearchPaths: [],
|
|
@@ -84835,7 +84862,7 @@ async function collectTurboSources(options) {
|
|
|
84835
84862
|
throw new Error(`TurboModule source is not UTF-8: ${disk}`);
|
|
84836
84863
|
add2(key2, text6);
|
|
84837
84864
|
result.sources.push({ file: key2, source: disk, sha256: sha2564(bytes) });
|
|
84838
|
-
pending2.push({ key: key2, targetName, label, root, relative: relative6 });
|
|
84865
|
+
pending2.push({ key: key2, targetName: targetName2, label, root, relative: relative6 });
|
|
84839
84866
|
return key2;
|
|
84840
84867
|
};
|
|
84841
84868
|
const pending2 = [];
|
|
@@ -85190,9 +85217,9 @@ async function collectTurboSources(options) {
|
|
|
85190
85217
|
const unregisteredObjcClasses = /* @__PURE__ */ new Set();
|
|
85191
85218
|
const deferredDepUnits = [];
|
|
85192
85219
|
for (const provider of providers) {
|
|
85193
|
-
const
|
|
85220
|
+
const targetName2 = providerTarget(provider.info.name);
|
|
85194
85221
|
const label = provider.info.name;
|
|
85195
|
-
const providerTargetInput = target(
|
|
85222
|
+
const providerTargetInput = target(targetName2, [
|
|
85196
85223
|
TURBO_CORE_TARGET
|
|
85197
85224
|
]);
|
|
85198
85225
|
result.targets.push(providerTargetInput);
|
|
@@ -85210,11 +85237,11 @@ async function collectTurboSources(options) {
|
|
|
85210
85237
|
if (provider.providerFabric) {
|
|
85211
85238
|
fabric = true;
|
|
85212
85239
|
fabricPackages.add(provider.name);
|
|
85213
|
-
fabricTarget ??= { targetName, label, root: provider.root };
|
|
85240
|
+
fabricTarget ??= { targetName: targetName2, label, root: provider.root };
|
|
85214
85241
|
}
|
|
85215
85242
|
if (pod.installed?.library) {
|
|
85216
85243
|
result.libraries ??= {};
|
|
85217
|
-
result.libraries[
|
|
85244
|
+
result.libraries[targetName2] = import_node_fs96.default.readFileSync(pod.installed.library).toString("base64");
|
|
85218
85245
|
}
|
|
85219
85246
|
const files2 = podFiles(pod).filter((file) => {
|
|
85220
85247
|
if (!provider.reactModulesOnly || HEADER5.test(file)) return true;
|
|
@@ -85227,10 +85254,10 @@ async function collectTurboSources(options) {
|
|
|
85227
85254
|
if (paper.length > 0) {
|
|
85228
85255
|
fabric = true;
|
|
85229
85256
|
paperClasses.push(...paper);
|
|
85230
|
-
paperTarget ??= { targetName, label, root: provider.root };
|
|
85257
|
+
paperTarget ??= { targetName: targetName2, label, root: provider.root };
|
|
85231
85258
|
}
|
|
85232
85259
|
const headers = /* @__PURE__ */ new Map();
|
|
85233
|
-
podHeaders.set(
|
|
85260
|
+
podHeaders.set(targetName2, {
|
|
85234
85261
|
headers,
|
|
85235
85262
|
label,
|
|
85236
85263
|
root,
|
|
@@ -85543,33 +85570,33 @@ async function collectTurboSources(options) {
|
|
|
85543
85570
|
);
|
|
85544
85571
|
if (filtered !== source) {
|
|
85545
85572
|
if (definedFacebookReactComponentNames(filtered).size === 0) continue;
|
|
85546
|
-
const key2 = original(
|
|
85573
|
+
const key2 = original(targetName2, "ReactCodegen", generated, file);
|
|
85547
85574
|
result.files[key2] = filtered;
|
|
85548
85575
|
continue;
|
|
85549
85576
|
}
|
|
85550
85577
|
}
|
|
85551
85578
|
}
|
|
85552
|
-
original(
|
|
85579
|
+
original(targetName2, "ReactCodegen", generated, file);
|
|
85553
85580
|
}
|
|
85554
85581
|
}
|
|
85555
85582
|
}
|
|
85556
|
-
for (const file of sources) original(
|
|
85583
|
+
for (const file of sources) original(targetName2, label, root, file);
|
|
85557
85584
|
for (const unit2 of depUnits) {
|
|
85558
85585
|
if (!unit2.companionHeader) {
|
|
85559
85586
|
result.externalPodSources.push({
|
|
85560
85587
|
moduleName: unit2.moduleName,
|
|
85561
|
-
file: original(
|
|
85588
|
+
file: original(targetName2, unit2.label, unit2.root, unit2.relative)
|
|
85562
85589
|
});
|
|
85563
85590
|
} else {
|
|
85564
|
-
deferredDepUnits.push({ targetName, ...unit2 });
|
|
85591
|
+
deferredDepUnits.push({ targetName: targetName2, ...unit2 });
|
|
85565
85592
|
}
|
|
85566
85593
|
}
|
|
85567
85594
|
const declared = [];
|
|
85568
85595
|
for (const [count, { file, load: load2 }] of loads.entries()) {
|
|
85569
|
-
const symbol2 = `peach_turbo_load_${
|
|
85596
|
+
const symbol2 = `peach_turbo_load_${targetName2}_${count}`;
|
|
85570
85597
|
declared.push(symbol2);
|
|
85571
|
-
result.loads.push({ symbol: symbol2, target:
|
|
85572
|
-
const unit2 = `${targetPath(
|
|
85598
|
+
result.loads.push({ symbol: symbol2, target: targetName2 });
|
|
85599
|
+
const unit2 = `${targetPath(targetName2)}/PeachTurboLoad${count}.cpp`;
|
|
85573
85600
|
add2(
|
|
85574
85601
|
unit2,
|
|
85575
85602
|
[
|
|
@@ -85581,21 +85608,21 @@ async function collectTurboSources(options) {
|
|
|
85581
85608
|
].join("\n")
|
|
85582
85609
|
);
|
|
85583
85610
|
scanText(
|
|
85584
|
-
{ key: unit2, targetName, label, root, relative: file },
|
|
85611
|
+
{ key: unit2, targetName: targetName2, label, root, relative: file },
|
|
85585
85612
|
result.files[unit2]
|
|
85586
85613
|
);
|
|
85587
85614
|
}
|
|
85588
85615
|
add2(
|
|
85589
|
-
`${targetPath(
|
|
85616
|
+
`${targetPath(targetName2)}/include/PeachTurboLoad.hpp`,
|
|
85590
85617
|
`#pragma once
|
|
85591
85618
|
${declared.map((symbol2) => `extern "C" void ${symbol2}();
|
|
85592
85619
|
`).join("")}`
|
|
85593
85620
|
);
|
|
85594
85621
|
add2(
|
|
85595
|
-
`${targetPath(
|
|
85596
|
-
`module ${
|
|
85597
|
-
const source = original(
|
|
85598
|
-
return ` header ${JSON.stringify(import_node_path93.default.posix.relative(`${targetPath(
|
|
85622
|
+
`${targetPath(targetName2)}/include/module.modulemap`,
|
|
85623
|
+
`module ${targetName2} { header "PeachTurboLoad.hpp"${swiftSources.length > 0 || depSwiftPods.length > 0 ? publicHeaders.map((file) => {
|
|
85624
|
+
const source = original(targetName2, label, root, file);
|
|
85625
|
+
return ` header ${JSON.stringify(import_node_path93.default.posix.relative(`${targetPath(targetName2)}/include`, source))}`;
|
|
85599
85626
|
}).join("") : ""} export * }
|
|
85600
85627
|
`
|
|
85601
85628
|
);
|
|
@@ -93563,7 +93590,7 @@ var init_nitro_superset = __esm({
|
|
|
93563
93590
|
init_nitroContract();
|
|
93564
93591
|
init_swift_standin_digest();
|
|
93565
93592
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
93566
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
93593
|
+
NITRO_COMPILER_DIGEST = true ? "792cc1be95fe037998bb176086fe7ea42e4d42e2422e32ce04f5e7603a4b67f7" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
93567
93594
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
93568
93595
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
93569
93596
|
published2 = /* @__PURE__ */ new Map();
|
|
@@ -94255,7 +94282,7 @@ var init_one_sdk_bundle = __esm({
|
|
|
94255
94282
|
var runtime_companion_default;
|
|
94256
94283
|
var init_runtime_companion = __esm({
|
|
94257
94284
|
"runtime-companion.json"() {
|
|
94258
|
-
runtime_companion_default = { abi: 1, sha256: "
|
|
94285
|
+
runtime_companion_default = { abi: 1, sha256: "f0ebf18540275693f13d5f0638e9e6e2afd2b8a2fa10c6d5c1190341feaa430b", file: "node/cli-f0ebf18540275693f13d5f0638e9e6e2afd2b8a2fa10c6d5c1190341feaa430b.cjs" };
|
|
94259
94286
|
}
|
|
94260
94287
|
});
|
|
94261
94288
|
|
|
@@ -95111,9 +95138,9 @@ async function probePortBundle(port, pageOrigin, options = {}) {
|
|
|
95111
95138
|
const unresolved = buildUnresolvedTargetError(`localhost:${port}`);
|
|
95112
95139
|
try {
|
|
95113
95140
|
return await Promise.any(
|
|
95114
|
-
LOOPBACK_PROBE_HOSTNAMES.map(async (
|
|
95141
|
+
LOOPBACK_PROBE_HOSTNAMES.map(async (hostname2) => {
|
|
95115
95142
|
const bundle = await probeBaseUrlBundleDirect(
|
|
95116
|
-
buildLoopbackProbeBaseUrl("http:",
|
|
95143
|
+
buildLoopbackProbeBaseUrl("http:", hostname2, port),
|
|
95117
95144
|
port,
|
|
95118
95145
|
pageOrigin,
|
|
95119
95146
|
options
|
|
@@ -95885,21 +95912,21 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
95885
95912
|
try {
|
|
95886
95913
|
return await Promise.any(
|
|
95887
95914
|
LOOPBACK_PROBE_HOSTNAMES.map(
|
|
95888
|
-
(
|
|
95915
|
+
(hostname2) => new Promise((resolve14, reject) => {
|
|
95889
95916
|
const sock = new import_net.default.Socket();
|
|
95890
95917
|
let settled = false;
|
|
95891
95918
|
const done = (reachable) => {
|
|
95892
95919
|
if (settled) return;
|
|
95893
95920
|
settled = true;
|
|
95894
95921
|
sock.destroy();
|
|
95895
|
-
if (reachable) resolve14(
|
|
95896
|
-
else reject(new Error(`unreachable loopback host ${
|
|
95922
|
+
if (reachable) resolve14(hostname2);
|
|
95923
|
+
else reject(new Error(`unreachable loopback host ${hostname2}`));
|
|
95897
95924
|
};
|
|
95898
95925
|
sock.setTimeout(timeout);
|
|
95899
95926
|
sock.once("connect", () => done(true));
|
|
95900
95927
|
sock.once("timeout", () => done(false));
|
|
95901
95928
|
sock.once("error", () => done(false));
|
|
95902
|
-
sock.connect(port,
|
|
95929
|
+
sock.connect(port, hostname2);
|
|
95903
95930
|
})
|
|
95904
95931
|
)
|
|
95905
95932
|
);
|
|
@@ -95907,7 +95934,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
95907
95934
|
return null;
|
|
95908
95935
|
}
|
|
95909
95936
|
}
|
|
95910
|
-
function httpGet(
|
|
95937
|
+
function httpGet(hostname2, port, path148, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
95911
95938
|
return new Promise((resolve14) => {
|
|
95912
95939
|
let settled = false;
|
|
95913
95940
|
let killing = false;
|
|
@@ -95916,7 +95943,7 @@ function httpGet(hostname, port, path148, method = "GET", timeout = TIMEOUT_MS,
|
|
|
95916
95943
|
settled = true;
|
|
95917
95944
|
resolve14(value);
|
|
95918
95945
|
};
|
|
95919
|
-
const req = import_http.default.request({ hostname, port, path: path148, method, headers }, (res) => {
|
|
95946
|
+
const req = import_http.default.request({ hostname: hostname2, port, path: path148, method, headers }, (res) => {
|
|
95920
95947
|
let body = "";
|
|
95921
95948
|
res.on("data", (c) => body += c.toString());
|
|
95922
95949
|
const contentType2 = (() => {
|
|
@@ -95931,7 +95958,7 @@ function httpGet(hostname, port, path148, method = "GET", timeout = TIMEOUT_MS,
|
|
|
95931
95958
|
statusCode: res.statusCode || 0,
|
|
95932
95959
|
body,
|
|
95933
95960
|
contentType: contentType2,
|
|
95934
|
-
hostname
|
|
95961
|
+
hostname: hostname2
|
|
95935
95962
|
})
|
|
95936
95963
|
);
|
|
95937
95964
|
});
|
|
@@ -95949,16 +95976,16 @@ function httpGet(hostname, port, path148, method = "GET", timeout = TIMEOUT_MS,
|
|
|
95949
95976
|
});
|
|
95950
95977
|
});
|
|
95951
95978
|
}
|
|
95952
|
-
async function probeManifest(
|
|
95979
|
+
async function probeManifest(hostname2, port, timeout) {
|
|
95953
95980
|
let deadline;
|
|
95954
95981
|
try {
|
|
95955
95982
|
return await Promise.race([
|
|
95956
|
-
fetchDevManifest(buildLoopbackProbeBaseUrl("http:",
|
|
95983
|
+
fetchDevManifest(buildLoopbackProbeBaseUrl("http:", hostname2, port)).then(
|
|
95957
95984
|
async (res) => res ? {
|
|
95958
95985
|
statusCode: res.status,
|
|
95959
95986
|
body: await res.text(),
|
|
95960
95987
|
contentType: res.headers.get("content-type") || "",
|
|
95961
|
-
hostname
|
|
95988
|
+
hostname: hostname2
|
|
95962
95989
|
} : null
|
|
95963
95990
|
),
|
|
95964
95991
|
new Promise((resolve14) => {
|
|
@@ -96230,16 +96257,16 @@ function nativeBundleRoot(projectCwd) {
|
|
|
96230
96257
|
}
|
|
96231
96258
|
return "index";
|
|
96232
96259
|
}
|
|
96233
|
-
function makeResult(
|
|
96260
|
+
function makeResult(hostname2, port, framework, owner) {
|
|
96234
96261
|
return {
|
|
96235
96262
|
port,
|
|
96236
96263
|
framework,
|
|
96237
96264
|
bundleUrl: withRuntimeConfig(
|
|
96238
96265
|
port,
|
|
96239
|
-
`${buildLoopbackProbeBaseUrl("http:",
|
|
96266
|
+
`${buildLoopbackProbeBaseUrl("http:", hostname2, port)}/${nativeBundleRoot(owner.cwd)}.bundle?platform=ios&dev=true&hot=true&minify=false`,
|
|
96240
96267
|
owner.cwd
|
|
96241
96268
|
),
|
|
96242
|
-
hmrUrl: `${buildLoopbackProbeBaseUrl("ws:",
|
|
96269
|
+
hmrUrl: `${buildLoopbackProbeBaseUrl("ws:", hostname2, port)}/hot`,
|
|
96243
96270
|
lastSeen: Date.now(),
|
|
96244
96271
|
...owner
|
|
96245
96272
|
};
|
|
@@ -96282,10 +96309,10 @@ function metroAssetPath(rawIcon) {
|
|
|
96282
96309
|
function staticAssetPath(rawIcon) {
|
|
96283
96310
|
return `/${rawIcon.replace(/^\.?\//, "")}`;
|
|
96284
96311
|
}
|
|
96285
|
-
async function resolveLocalIconPath(
|
|
96312
|
+
async function resolveLocalIconPath(hostname2, port, rawIcon) {
|
|
96286
96313
|
const candidates = [metroAssetPath(rawIcon), staticAssetPath(rawIcon)];
|
|
96287
96314
|
for (const candidate of candidates) {
|
|
96288
|
-
const res = await httpGet(
|
|
96315
|
+
const res = await httpGet(hostname2, port, candidate, "HEAD", ENRICH_TIMEOUT_MS);
|
|
96289
96316
|
if (res?.statusCode === 200) {
|
|
96290
96317
|
localIconPathCache.set(port, candidate);
|
|
96291
96318
|
invalidatePortCache(port);
|
|
@@ -96361,8 +96388,8 @@ function ensureLocalIconPathResolved(result) {
|
|
|
96361
96388
|
if (localIconPathCache.has(result.port)) return;
|
|
96362
96389
|
if (localIconProbeInFlight.has(result.port)) return;
|
|
96363
96390
|
localIconProbeInFlight.add(result.port);
|
|
96364
|
-
const
|
|
96365
|
-
void resolveLocalIconPath(
|
|
96391
|
+
const hostname2 = normalizeHostname(new URL(result.bundleUrl).hostname);
|
|
96392
|
+
void resolveLocalIconPath(hostname2, result.port, rawIcon).finally(
|
|
96366
96393
|
() => localIconProbeInFlight.delete(result.port)
|
|
96367
96394
|
);
|
|
96368
96395
|
}
|
|
@@ -96388,14 +96415,14 @@ function enrichWithManifest(result, buildIconProxyUrl) {
|
|
|
96388
96415
|
return result;
|
|
96389
96416
|
}
|
|
96390
96417
|
async function fetchManifestEnrichment(result, buildIconProxyUrl) {
|
|
96391
|
-
const
|
|
96392
|
-
const manifestRes = await probeManifest(
|
|
96418
|
+
const hostname2 = normalizeHostname(new URL(result.bundleUrl).hostname);
|
|
96419
|
+
const manifestRes = await probeManifest(hostname2, result.port, ENRICH_TIMEOUT_MS);
|
|
96393
96420
|
if (!manifestRes || manifestRes.statusCode !== 200) return;
|
|
96394
96421
|
const parsed = applyManifest(
|
|
96395
96422
|
{
|
|
96396
96423
|
port: result.port,
|
|
96397
96424
|
framework: "one",
|
|
96398
|
-
bundleUrl: `${buildLoopbackProbeBaseUrl("http:",
|
|
96425
|
+
bundleUrl: `${buildLoopbackProbeBaseUrl("http:", hostname2, result.port)}/index.bundle`,
|
|
96399
96426
|
lastSeen: 0
|
|
96400
96427
|
},
|
|
96401
96428
|
manifestRes,
|
|
@@ -100873,8 +100900,8 @@ function resolveRedirectUrl(location, from) {
|
|
|
100873
100900
|
if (!location.includes("#")) next.hash = from.hash;
|
|
100874
100901
|
return next;
|
|
100875
100902
|
}
|
|
100876
|
-
function headerOverridesFor(
|
|
100877
|
-
const host2 =
|
|
100903
|
+
function headerOverridesFor(hostname2) {
|
|
100904
|
+
const host2 = hostname2.toLowerCase();
|
|
100878
100905
|
for (const override of HOST_HEADER_OVERRIDES) {
|
|
100879
100906
|
if (host2 === override.hostSuffix || host2.endsWith(`.${override.hostSuffix}`)) {
|
|
100880
100907
|
return override;
|
|
@@ -101203,8 +101230,8 @@ var init_hostname_resolver = __esm({
|
|
|
101203
101230
|
});
|
|
101204
101231
|
|
|
101205
101232
|
// src/host/loopback-ports.ts
|
|
101206
|
-
function projectLoopbackPort(
|
|
101207
|
-
return isLoopbackHost(
|
|
101233
|
+
function projectLoopbackPort(hostname2, port) {
|
|
101234
|
+
return isLoopbackHost(hostname2) ? LOOPBACK_PORTS.get(port) ?? port : port;
|
|
101208
101235
|
}
|
|
101209
101236
|
function projectLoopbackUrl(value) {
|
|
101210
101237
|
if (LOOPBACK_PORTS.size === 0) return value;
|
|
@@ -109053,10 +109080,11 @@ function rnxCloudScopesAllowCommand(scopes, type) {
|
|
|
109053
109080
|
function isRnxCloudSimStatus(value) {
|
|
109054
109081
|
return value === "creating" || value === "open" || value === "hibernated" || value === "deleting" || value === "deleted";
|
|
109055
109082
|
}
|
|
109056
|
-
var RNX_CLOUD_MAX_ARTIFACT_BYTES, RNX_CLOUD_DESIGN_MAX_STORAGE_BYTES, RNX_CLOUD_COMMAND_SCOPES, RNX_CLOUD_COMMAND_TYPES, RNX_CLOUD_COMMAND_TYPE_SET, RNX_CLOUD_TOKEN_SCOPES, RNX_CLOUD_ALL_COMMAND_SCOPES;
|
|
109083
|
+
var AGENT_IDENTITY_MAX_CHARS, RNX_CLOUD_MAX_ARTIFACT_BYTES, RNX_CLOUD_DESIGN_MAX_STORAGE_BYTES, RNX_CLOUD_COMMAND_SCOPES, RNX_CLOUD_COMMAND_TYPES, RNX_CLOUD_COMMAND_TYPE_SET, RNX_CLOUD_TOKEN_SCOPES, RNX_CLOUD_ALL_COMMAND_SCOPES;
|
|
109057
109084
|
var init_cloud_contract = __esm({
|
|
109058
109085
|
"src/cloud-contract.ts"() {
|
|
109059
109086
|
"use strict";
|
|
109087
|
+
AGENT_IDENTITY_MAX_CHARS = 200;
|
|
109060
109088
|
RNX_CLOUD_MAX_ARTIFACT_BYTES = 40761776;
|
|
109061
109089
|
RNX_CLOUD_DESIGN_MAX_STORAGE_BYTES = 1024 * 1024;
|
|
109062
109090
|
RNX_CLOUD_COMMAND_SCOPES = {
|
|
@@ -109283,6 +109311,560 @@ var init_cloud_session = __esm({
|
|
|
109283
109311
|
}
|
|
109284
109312
|
});
|
|
109285
109313
|
|
|
109314
|
+
// ../peach-kit/src/agent-identity.ts
|
|
109315
|
+
function formatLockOwner(owner) {
|
|
109316
|
+
const colon = owner.indexOf(":");
|
|
109317
|
+
if (colon <= 0) return owner.length > 24 ? `${owner.slice(0, 21)}\u2026` : owner;
|
|
109318
|
+
const source = owner.slice(0, colon);
|
|
109319
|
+
const value = owner.slice(colon + 1);
|
|
109320
|
+
if (source === "PEACH_CLI_IDENTITY" && value) return value;
|
|
109321
|
+
const short = value.length > 12 ? `${value.slice(0, 8)}\u2026` : value;
|
|
109322
|
+
if (source === "CLAUDE_CODE_SESSION_ID" || source === "CODEX_THREAD_ID") {
|
|
109323
|
+
return `agent ${short}`;
|
|
109324
|
+
}
|
|
109325
|
+
return `${source} ${short}`;
|
|
109326
|
+
}
|
|
109327
|
+
var init_agent_identity = __esm({
|
|
109328
|
+
"../peach-kit/src/agent-identity.ts"() {
|
|
109329
|
+
"use strict";
|
|
109330
|
+
}
|
|
109331
|
+
});
|
|
109332
|
+
|
|
109333
|
+
// cli/parent-pid.ts
|
|
109334
|
+
function getParentPid(pid) {
|
|
109335
|
+
if (!cached3) cached3 = build();
|
|
109336
|
+
try {
|
|
109337
|
+
return cached3(pid);
|
|
109338
|
+
} catch {
|
|
109339
|
+
return null;
|
|
109340
|
+
}
|
|
109341
|
+
}
|
|
109342
|
+
function getProcessComm(pid) {
|
|
109343
|
+
if (!cachedComm) cachedComm = buildComm();
|
|
109344
|
+
try {
|
|
109345
|
+
return cachedComm(pid);
|
|
109346
|
+
} catch {
|
|
109347
|
+
return null;
|
|
109348
|
+
}
|
|
109349
|
+
}
|
|
109350
|
+
function getProcessPgid(pid) {
|
|
109351
|
+
if (!cachedPgid) cachedPgid = buildPgid();
|
|
109352
|
+
try {
|
|
109353
|
+
return cachedPgid(pid);
|
|
109354
|
+
} catch {
|
|
109355
|
+
return null;
|
|
109356
|
+
}
|
|
109357
|
+
}
|
|
109358
|
+
function buildComm() {
|
|
109359
|
+
if (process.platform === "linux") {
|
|
109360
|
+
return (pid) => {
|
|
109361
|
+
try {
|
|
109362
|
+
return (0, import_fs4.readFileSync)(`/proc/${pid}/comm`, "utf8").trim() || null;
|
|
109363
|
+
} catch {
|
|
109364
|
+
return null;
|
|
109365
|
+
}
|
|
109366
|
+
};
|
|
109367
|
+
}
|
|
109368
|
+
if (process.platform === "darwin") {
|
|
109369
|
+
const ffi = tryBuildDarwinCommFfi();
|
|
109370
|
+
if (ffi) return ffi;
|
|
109371
|
+
return (pid) => readProcessTable2().get(pid)?.comm || null;
|
|
109372
|
+
}
|
|
109373
|
+
return () => null;
|
|
109374
|
+
}
|
|
109375
|
+
function build() {
|
|
109376
|
+
if (process.platform === "linux") return buildLinux();
|
|
109377
|
+
if (process.platform === "darwin") {
|
|
109378
|
+
const ffi = tryBuildDarwinFfi();
|
|
109379
|
+
if (ffi) return ffi;
|
|
109380
|
+
return (pid) => {
|
|
109381
|
+
const ppid = readProcessTable2().get(pid)?.ppid;
|
|
109382
|
+
return ppid !== void 0 && ppid > 0 ? ppid : null;
|
|
109383
|
+
};
|
|
109384
|
+
}
|
|
109385
|
+
return () => null;
|
|
109386
|
+
}
|
|
109387
|
+
function buildPgid() {
|
|
109388
|
+
if (process.platform === "linux") {
|
|
109389
|
+
return (pid) => {
|
|
109390
|
+
try {
|
|
109391
|
+
const raw2 = (0, import_fs4.readFileSync)(`/proc/${pid}/stat`, "utf8");
|
|
109392
|
+
const end = raw2.lastIndexOf(")");
|
|
109393
|
+
if (end < 0) return null;
|
|
109394
|
+
const rest = raw2.slice(end + 1).trim().split(/\s+/);
|
|
109395
|
+
const pgid = Number(rest[2]);
|
|
109396
|
+
return Number.isFinite(pgid) && pgid > 0 ? pgid : null;
|
|
109397
|
+
} catch {
|
|
109398
|
+
return null;
|
|
109399
|
+
}
|
|
109400
|
+
};
|
|
109401
|
+
}
|
|
109402
|
+
if (process.platform === "darwin") {
|
|
109403
|
+
const ffi = tryBuildDarwinPgidFfi();
|
|
109404
|
+
if (ffi) return ffi;
|
|
109405
|
+
return (pid) => {
|
|
109406
|
+
const pgid = readProcessTable2().get(pid)?.pgid;
|
|
109407
|
+
return pgid !== void 0 && pgid > 0 ? pgid : null;
|
|
109408
|
+
};
|
|
109409
|
+
}
|
|
109410
|
+
return () => null;
|
|
109411
|
+
}
|
|
109412
|
+
function readProcessTable2() {
|
|
109413
|
+
const now = Date.now();
|
|
109414
|
+
if (processTable2.readAt && now - processTable2.readAt < PROCESS_TABLE_TTL_MS) {
|
|
109415
|
+
return processTable2.rows;
|
|
109416
|
+
}
|
|
109417
|
+
const rows = /* @__PURE__ */ new Map();
|
|
109418
|
+
try {
|
|
109419
|
+
const out = (0, import_child_process3.execFileSync)("ps", ["-eo", "pid=,ppid=,pgid=,comm="], {
|
|
109420
|
+
encoding: "utf8",
|
|
109421
|
+
timeout: 5e3,
|
|
109422
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
109423
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
109424
|
+
});
|
|
109425
|
+
for (const line of out.split("\n")) {
|
|
109426
|
+
const parsed = line.trim().match(/^(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/);
|
|
109427
|
+
if (!parsed) continue;
|
|
109428
|
+
rows.set(Number(parsed[1]), {
|
|
109429
|
+
ppid: Number(parsed[2]),
|
|
109430
|
+
pgid: Number(parsed[3]),
|
|
109431
|
+
comm: (parsed[4].split("/").at(-1) ?? "").slice(0, PBI_COMM_LEN)
|
|
109432
|
+
});
|
|
109433
|
+
}
|
|
109434
|
+
} catch {
|
|
109435
|
+
}
|
|
109436
|
+
processTable2 = { readAt: now, rows };
|
|
109437
|
+
return rows;
|
|
109438
|
+
}
|
|
109439
|
+
function buildLinux() {
|
|
109440
|
+
return (pid) => {
|
|
109441
|
+
try {
|
|
109442
|
+
const raw2 = (0, import_fs4.readFileSync)(`/proc/${pid}/stat`, "utf8");
|
|
109443
|
+
const end = raw2.lastIndexOf(")");
|
|
109444
|
+
if (end < 0) return null;
|
|
109445
|
+
const rest = raw2.slice(end + 1).trim().split(/\s+/);
|
|
109446
|
+
const ppid = Number(rest[1]);
|
|
109447
|
+
return Number.isFinite(ppid) && ppid > 0 ? ppid : null;
|
|
109448
|
+
} catch {
|
|
109449
|
+
return null;
|
|
109450
|
+
}
|
|
109451
|
+
};
|
|
109452
|
+
}
|
|
109453
|
+
function tryBuildDarwinFfi() {
|
|
109454
|
+
if (!process.versions?.bun) return null;
|
|
109455
|
+
try {
|
|
109456
|
+
const r = (0, import_module.createRequire)(__sootsim_import_meta_url);
|
|
109457
|
+
const { dlopen, FFIType } = r("bun:ffi");
|
|
109458
|
+
const lib = dlopen("/usr/lib/libproc.dylib", {
|
|
109459
|
+
proc_pidinfo: {
|
|
109460
|
+
args: [FFIType.i32, FFIType.i32, FFIType.u64, FFIType.ptr, FFIType.i32],
|
|
109461
|
+
returns: FFIType.i32
|
|
109462
|
+
}
|
|
109463
|
+
});
|
|
109464
|
+
const buf = Buffer.alloc(PROC_BSDINFO_SIZE);
|
|
109465
|
+
return (pid) => {
|
|
109466
|
+
const ret = Number(
|
|
109467
|
+
lib.symbols.proc_pidinfo(pid, PROC_PIDTBSDINFO, 0n, buf, PROC_BSDINFO_SIZE)
|
|
109468
|
+
);
|
|
109469
|
+
if (ret <= 0) return null;
|
|
109470
|
+
const ppid = buf.readUInt32LE(PBI_PPID_OFFSET);
|
|
109471
|
+
return ppid > 0 ? ppid : null;
|
|
109472
|
+
};
|
|
109473
|
+
} catch {
|
|
109474
|
+
return null;
|
|
109475
|
+
}
|
|
109476
|
+
}
|
|
109477
|
+
function tryBuildDarwinCommFfi() {
|
|
109478
|
+
if (!process.versions?.bun) return null;
|
|
109479
|
+
try {
|
|
109480
|
+
const r = (0, import_module.createRequire)(__sootsim_import_meta_url);
|
|
109481
|
+
const { dlopen, FFIType } = r("bun:ffi");
|
|
109482
|
+
const lib = dlopen("/usr/lib/libproc.dylib", {
|
|
109483
|
+
proc_pidinfo: {
|
|
109484
|
+
args: [FFIType.i32, FFIType.i32, FFIType.u64, FFIType.ptr, FFIType.i32],
|
|
109485
|
+
returns: FFIType.i32
|
|
109486
|
+
}
|
|
109487
|
+
});
|
|
109488
|
+
const buf = Buffer.alloc(PROC_BSDINFO_SIZE);
|
|
109489
|
+
return (pid) => {
|
|
109490
|
+
const ret = Number(
|
|
109491
|
+
lib.symbols.proc_pidinfo(pid, PROC_PIDTBSDINFO, 0n, buf, PROC_BSDINFO_SIZE)
|
|
109492
|
+
);
|
|
109493
|
+
if (ret <= 0) return null;
|
|
109494
|
+
const raw2 = buf.subarray(PBI_COMM_OFFSET, PBI_COMM_OFFSET + PBI_COMM_LEN);
|
|
109495
|
+
const end = raw2.indexOf(0);
|
|
109496
|
+
const comm = raw2.subarray(0, end < 0 ? raw2.length : end).toString("utf8");
|
|
109497
|
+
return comm || null;
|
|
109498
|
+
};
|
|
109499
|
+
} catch {
|
|
109500
|
+
return null;
|
|
109501
|
+
}
|
|
109502
|
+
}
|
|
109503
|
+
function tryBuildDarwinPgidFfi() {
|
|
109504
|
+
if (!process.versions?.bun) return null;
|
|
109505
|
+
try {
|
|
109506
|
+
const r = (0, import_module.createRequire)(__sootsim_import_meta_url);
|
|
109507
|
+
const { dlopen, FFIType } = r("bun:ffi");
|
|
109508
|
+
const lib = dlopen("/usr/lib/libproc.dylib", {
|
|
109509
|
+
proc_pidinfo: {
|
|
109510
|
+
args: [FFIType.i32, FFIType.i32, FFIType.u64, FFIType.ptr, FFIType.i32],
|
|
109511
|
+
returns: FFIType.i32
|
|
109512
|
+
}
|
|
109513
|
+
});
|
|
109514
|
+
const buf = Buffer.alloc(PROC_BSDINFO_SIZE);
|
|
109515
|
+
return (pid) => {
|
|
109516
|
+
const ret = Number(
|
|
109517
|
+
lib.symbols.proc_pidinfo(pid, PROC_PIDTBSDINFO, 0n, buf, PROC_BSDINFO_SIZE)
|
|
109518
|
+
);
|
|
109519
|
+
if (ret <= 0) return null;
|
|
109520
|
+
const pgid = buf.readUInt32LE(PBI_PGID_OFFSET);
|
|
109521
|
+
return pgid > 0 ? pgid : null;
|
|
109522
|
+
};
|
|
109523
|
+
} catch {
|
|
109524
|
+
return null;
|
|
109525
|
+
}
|
|
109526
|
+
}
|
|
109527
|
+
var import_child_process3, import_fs4, import_module, cached3, cachedComm, cachedPgid, PROCESS_TABLE_TTL_MS, processTable2, PROC_PIDTBSDINFO, PROC_BSDINFO_SIZE, PBI_PPID_OFFSET, PBI_COMM_OFFSET, PBI_COMM_LEN, PBI_PGID_OFFSET;
|
|
109528
|
+
var init_parent_pid = __esm({
|
|
109529
|
+
"cli/parent-pid.ts"() {
|
|
109530
|
+
"use strict";
|
|
109531
|
+
import_child_process3 = require("child_process");
|
|
109532
|
+
import_fs4 = require("fs");
|
|
109533
|
+
import_module = require("module");
|
|
109534
|
+
cached3 = null;
|
|
109535
|
+
cachedComm = null;
|
|
109536
|
+
cachedPgid = null;
|
|
109537
|
+
PROCESS_TABLE_TTL_MS = 2e3;
|
|
109538
|
+
processTable2 = { readAt: 0, rows: /* @__PURE__ */ new Map() };
|
|
109539
|
+
PROC_PIDTBSDINFO = 3;
|
|
109540
|
+
PROC_BSDINFO_SIZE = 216;
|
|
109541
|
+
PBI_PPID_OFFSET = 16;
|
|
109542
|
+
PBI_COMM_OFFSET = 48;
|
|
109543
|
+
PBI_COMM_LEN = 16;
|
|
109544
|
+
PBI_PGID_OFFSET = 100;
|
|
109545
|
+
}
|
|
109546
|
+
});
|
|
109547
|
+
|
|
109548
|
+
// cli/current-sim.ts
|
|
109549
|
+
function findTopAncestor(start, maxDepth = 20) {
|
|
109550
|
+
let prev = start;
|
|
109551
|
+
let pid = getParentPid(start);
|
|
109552
|
+
if (!pid || pid <= 1) {
|
|
109553
|
+
const comm = getProcessComm(start);
|
|
109554
|
+
if (!comm || start < 1 || IMMORTAL_HOST_COMM_RE.test(comm)) return null;
|
|
109555
|
+
return start > 1 || !INIT_COMM_RE.test(comm) ? start : null;
|
|
109556
|
+
}
|
|
109557
|
+
for (let i = 0; i < maxDepth; i++) {
|
|
109558
|
+
const comm = getProcessComm(pid);
|
|
109559
|
+
if (comm && IMMORTAL_HOST_COMM_RE.test(comm)) return prev;
|
|
109560
|
+
const parent = getParentPid(pid);
|
|
109561
|
+
if (!parent || parent <= 1) {
|
|
109562
|
+
return comm ? pid : prev;
|
|
109563
|
+
}
|
|
109564
|
+
prev = pid;
|
|
109565
|
+
pid = parent;
|
|
109566
|
+
}
|
|
109567
|
+
return pid;
|
|
109568
|
+
}
|
|
109569
|
+
function getCliIdentity() {
|
|
109570
|
+
for (const name3 of IDENTITY_ENV_VARS) {
|
|
109571
|
+
const value = process.env[name3];
|
|
109572
|
+
if (value && value.trim()) {
|
|
109573
|
+
return { key: `${name3}:${value.trim()}`, source: name3, stable: true };
|
|
109574
|
+
}
|
|
109575
|
+
}
|
|
109576
|
+
const topPid = findTopAncestor(process.ppid);
|
|
109577
|
+
if (topPid) {
|
|
109578
|
+
return { key: `gppid-${topPid}`, source: "grand-ppid", stable: true };
|
|
109579
|
+
}
|
|
109580
|
+
return { key: `pid-${process.ppid}`, source: "ppid", stable: false };
|
|
109581
|
+
}
|
|
109582
|
+
function getCliIdentityKey() {
|
|
109583
|
+
return getCliIdentity().key;
|
|
109584
|
+
}
|
|
109585
|
+
function getStableOwnerPid() {
|
|
109586
|
+
return findTopAncestor(process.ppid);
|
|
109587
|
+
}
|
|
109588
|
+
function getOwnerProcessGroupId(owner = getStableOwnerPid()) {
|
|
109589
|
+
if (!owner || owner <= 1) return null;
|
|
109590
|
+
const pgid = getProcessPgid(owner);
|
|
109591
|
+
return pgid !== null && pgid > 1 ? pgid : null;
|
|
109592
|
+
}
|
|
109593
|
+
function getCurrentSimPath() {
|
|
109594
|
+
const envPath = process.env[CURRENT_SIM_PATH_ENV];
|
|
109595
|
+
if (envPath) {
|
|
109596
|
+
return (0, import_path4.resolve)(envPath);
|
|
109597
|
+
}
|
|
109598
|
+
const key2 = getCliIdentityKey();
|
|
109599
|
+
return (0, import_path4.join)((0, import_os.tmpdir)(), `peach-current-sim-${key2}.json`);
|
|
109600
|
+
}
|
|
109601
|
+
function legacyCloudCredentialDirectory(filepath) {
|
|
109602
|
+
return (0, import_path4.join)((0, import_path4.dirname)(filepath), `${(0, import_path4.basename)(filepath)}.credentials`);
|
|
109603
|
+
}
|
|
109604
|
+
function readCurrentTarget() {
|
|
109605
|
+
const filepath = getCurrentSimPath();
|
|
109606
|
+
(0, import_fs5.rmSync)(legacyCloudCredentialDirectory(filepath), { recursive: true, force: true });
|
|
109607
|
+
if (!(0, import_fs5.existsSync)(filepath)) return null;
|
|
109608
|
+
try {
|
|
109609
|
+
const parsed = JSON.parse((0, import_fs5.readFileSync)(filepath, "utf8"));
|
|
109610
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
109611
|
+
(0, import_fs5.rmSync)(filepath, { force: true });
|
|
109612
|
+
return null;
|
|
109613
|
+
}
|
|
109614
|
+
if (Reflect.get(parsed, "pendingOpen") === true) return null;
|
|
109615
|
+
const version2 = Reflect.get(parsed, "version");
|
|
109616
|
+
const plane = Reflect.get(parsed, "plane");
|
|
109617
|
+
const simId = Reflect.get(parsed, "simId");
|
|
109618
|
+
const updatedAt = Reflect.get(parsed, "updatedAt");
|
|
109619
|
+
const rawPort = Reflect.get(parsed, "bridgePort");
|
|
109620
|
+
const bridgePort = typeof rawPort === "number" && Number.isInteger(rawPort) && rawPort > 0 ? rawPort : void 0;
|
|
109621
|
+
if (version2 !== 1 && version2 !== CURRENT_SIM_VERSION || version2 === CURRENT_SIM_VERSION && plane !== "local" || typeof simId !== "string" || !simId.trim() || typeof updatedAt !== "string") {
|
|
109622
|
+
(0, import_fs5.rmSync)(filepath, { force: true });
|
|
109623
|
+
return null;
|
|
109624
|
+
}
|
|
109625
|
+
const target = {
|
|
109626
|
+
version: CURRENT_SIM_VERSION,
|
|
109627
|
+
plane: "local",
|
|
109628
|
+
simId: simId.trim(),
|
|
109629
|
+
...bridgePort === void 0 ? {} : { bridgePort },
|
|
109630
|
+
updatedAt
|
|
109631
|
+
};
|
|
109632
|
+
if (version2 === 1) writeSecureJsonAtomic(filepath, target, { durable: false });
|
|
109633
|
+
return target;
|
|
109634
|
+
} catch {
|
|
109635
|
+
(0, import_fs5.rmSync)(filepath, { force: true });
|
|
109636
|
+
return null;
|
|
109637
|
+
}
|
|
109638
|
+
}
|
|
109639
|
+
function readCurrentSimId() {
|
|
109640
|
+
return readCurrentTarget()?.simId ?? null;
|
|
109641
|
+
}
|
|
109642
|
+
function writeCurrentSim(simId, bridgePort) {
|
|
109643
|
+
const normalized = simId.trim();
|
|
109644
|
+
if (!normalized) return;
|
|
109645
|
+
writeSecureJsonAtomic(
|
|
109646
|
+
getCurrentSimPath(),
|
|
109647
|
+
{
|
|
109648
|
+
version: CURRENT_SIM_VERSION,
|
|
109649
|
+
plane: "local",
|
|
109650
|
+
simId: normalized,
|
|
109651
|
+
...bridgePort === void 0 ? {} : { bridgePort },
|
|
109652
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
109653
|
+
},
|
|
109654
|
+
{ durable: false }
|
|
109655
|
+
);
|
|
109656
|
+
}
|
|
109657
|
+
function saveCurrentSimId(simId, bridgePort) {
|
|
109658
|
+
writeCurrentSim(simId, bridgePort);
|
|
109659
|
+
}
|
|
109660
|
+
function replaceCurrentSimId(simId) {
|
|
109661
|
+
writeCurrentSim(simId, readCurrentTarget()?.bridgePort);
|
|
109662
|
+
}
|
|
109663
|
+
function getAgentIdPath() {
|
|
109664
|
+
return `${getCurrentSimPath()}.agent-id`;
|
|
109665
|
+
}
|
|
109666
|
+
function saveAgentId(agentId) {
|
|
109667
|
+
writeSecureJsonAtomic(getAgentIdPath(), { agentId }, { durable: false });
|
|
109668
|
+
}
|
|
109669
|
+
function readAgentId() {
|
|
109670
|
+
const filepath = getAgentIdPath();
|
|
109671
|
+
if (!(0, import_fs5.existsSync)(filepath)) return void 0;
|
|
109672
|
+
try {
|
|
109673
|
+
const parsed = JSON.parse((0, import_fs5.readFileSync)(filepath, "utf8"));
|
|
109674
|
+
const agentId = parsed !== null && typeof parsed === "object" ? Reflect.get(parsed, "agentId") : void 0;
|
|
109675
|
+
return typeof agentId === "string" && agentId.trim() ? agentId.trim() : void 0;
|
|
109676
|
+
} catch {
|
|
109677
|
+
(0, import_fs5.rmSync)(filepath, { force: true });
|
|
109678
|
+
return void 0;
|
|
109679
|
+
}
|
|
109680
|
+
}
|
|
109681
|
+
function clearCurrentSimId() {
|
|
109682
|
+
(0, import_fs5.rmSync)(getCurrentSimPath(), { force: true });
|
|
109683
|
+
}
|
|
109684
|
+
function markOpenPending() {
|
|
109685
|
+
writeSecureJsonAtomic(
|
|
109686
|
+
getCurrentSimPath(),
|
|
109687
|
+
{
|
|
109688
|
+
version: CURRENT_SIM_VERSION,
|
|
109689
|
+
plane: "local",
|
|
109690
|
+
pendingOpen: true,
|
|
109691
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
109692
|
+
},
|
|
109693
|
+
{ durable: false }
|
|
109694
|
+
);
|
|
109695
|
+
}
|
|
109696
|
+
function assertNoPendingOpen() {
|
|
109697
|
+
if (!isOpenPending()) return;
|
|
109698
|
+
throw new PendingOpenError(
|
|
109699
|
+
"the last `peach open` did not pin a sim, so this command would land on whichever tab is connected. run `peach open` again, `peach use <sim>`, or pass --sim <id>"
|
|
109700
|
+
);
|
|
109701
|
+
}
|
|
109702
|
+
function isOpenPending() {
|
|
109703
|
+
const filepath = getCurrentSimPath();
|
|
109704
|
+
if (!(0, import_fs5.existsSync)(filepath)) return false;
|
|
109705
|
+
try {
|
|
109706
|
+
const parsed = JSON.parse((0, import_fs5.readFileSync)(filepath, "utf8"));
|
|
109707
|
+
return parsed !== null && typeof parsed === "object" && Reflect.get(parsed, "pendingOpen") === true;
|
|
109708
|
+
} catch {
|
|
109709
|
+
return false;
|
|
109710
|
+
}
|
|
109711
|
+
}
|
|
109712
|
+
var import_fs5, import_os, import_path4, CURRENT_SIM_VERSION, CURRENT_SIM_PATH_ENV, IDENTITY_ENV_VARS, IMMORTAL_HOST_COMM_RE, INIT_COMM_RE, readCurrentSim, PendingOpenError;
|
|
109713
|
+
var init_current_sim = __esm({
|
|
109714
|
+
"cli/current-sim.ts"() {
|
|
109715
|
+
"use strict";
|
|
109716
|
+
import_fs5 = require("fs");
|
|
109717
|
+
import_os = require("os");
|
|
109718
|
+
import_path4 = require("path");
|
|
109719
|
+
init_parent_pid();
|
|
109720
|
+
init_secure_file();
|
|
109721
|
+
CURRENT_SIM_VERSION = 2;
|
|
109722
|
+
CURRENT_SIM_PATH_ENV = "PEACH_CLI_CURRENT_SIM_PATH";
|
|
109723
|
+
IDENTITY_ENV_VARS = [
|
|
109724
|
+
"PEACH_CLI_IDENTITY",
|
|
109725
|
+
// explicit override — fastest path, skips all pid lookups
|
|
109726
|
+
"CLAUDE_CODE_SESSION_ID",
|
|
109727
|
+
// claude code, if ever set
|
|
109728
|
+
"CODEX_THREAD_ID",
|
|
109729
|
+
// codex / openai agent thread, stable across tool invocations
|
|
109730
|
+
// a Team Machine session, per agent run. its other runners set no session
|
|
109731
|
+
// variable of their own, and the terminal variables below are inherited from
|
|
109732
|
+
// whatever shell started the daemon, so every such agent would share one key.
|
|
109733
|
+
"TM_SESSION",
|
|
109734
|
+
"TERM_SESSION_ID",
|
|
109735
|
+
// macOS Terminal.app + iTerm2
|
|
109736
|
+
"ITERM_SESSION_ID",
|
|
109737
|
+
// iTerm2 (older variant)
|
|
109738
|
+
"TMUX_PANE",
|
|
109739
|
+
// tmux — stable per pane
|
|
109740
|
+
"STY",
|
|
109741
|
+
// GNU screen session
|
|
109742
|
+
"KITTY_WINDOW_ID",
|
|
109743
|
+
// kitty
|
|
109744
|
+
"WEZTERM_PANE",
|
|
109745
|
+
// wezterm
|
|
109746
|
+
"ALACRITTY_WINDOW_ID",
|
|
109747
|
+
// alacritty
|
|
109748
|
+
"WINDOWID",
|
|
109749
|
+
// X11 terminals
|
|
109750
|
+
"VSCODE_INJECTION"
|
|
109751
|
+
// vscode integrated terminal
|
|
109752
|
+
];
|
|
109753
|
+
IMMORTAL_HOST_COMM_RE = /^(?:tmux|screen)|^tm$/i;
|
|
109754
|
+
INIT_COMM_RE = /^(?:init|systemd|launchd|tini|docker-init|dumb-init|catatonit|s6-svscan|runsvdir)$/i;
|
|
109755
|
+
readCurrentSim = readCurrentTarget;
|
|
109756
|
+
PendingOpenError = class extends Error {
|
|
109757
|
+
};
|
|
109758
|
+
}
|
|
109759
|
+
});
|
|
109760
|
+
|
|
109761
|
+
// cli/command-agent.ts
|
|
109762
|
+
function clip(text6) {
|
|
109763
|
+
return text6.length > AGENT_IDENTITY_MAX_CHARS ? `${text6.slice(0, AGENT_IDENTITY_MAX_CHARS - 1)}\u2026` : text6;
|
|
109764
|
+
}
|
|
109765
|
+
function targetName(target) {
|
|
109766
|
+
const name3 = target?.text?.trim() || target?.testID?.trim() || target?.id?.trim();
|
|
109767
|
+
return name3 ? name3.replace(/\s+/g, " ") : null;
|
|
109768
|
+
}
|
|
109769
|
+
function verb(action, target) {
|
|
109770
|
+
return target ? `${action} ${target}` : action;
|
|
109771
|
+
}
|
|
109772
|
+
function describeStep(step) {
|
|
109773
|
+
switch (step.type) {
|
|
109774
|
+
case "tap":
|
|
109775
|
+
return verb("Tapping", targetName(step.target));
|
|
109776
|
+
case "tapId":
|
|
109777
|
+
return verb("Tapping", step.id);
|
|
109778
|
+
case "doubleTap":
|
|
109779
|
+
return "Double tapping";
|
|
109780
|
+
case "longPress":
|
|
109781
|
+
return verb("Long pressing", targetName(step.target));
|
|
109782
|
+
case "drag":
|
|
109783
|
+
return "Dragging";
|
|
109784
|
+
case "pinch":
|
|
109785
|
+
return "Pinching";
|
|
109786
|
+
case "scroll":
|
|
109787
|
+
return verb("Scrolling", step.id);
|
|
109788
|
+
case "touchDown":
|
|
109789
|
+
case "touchMove":
|
|
109790
|
+
case "touchUp":
|
|
109791
|
+
case "touchCancel":
|
|
109792
|
+
return "Touching the screen";
|
|
109793
|
+
case "type":
|
|
109794
|
+
case "typeInto":
|
|
109795
|
+
case "setElementValue":
|
|
109796
|
+
return "Typing";
|
|
109797
|
+
case "key":
|
|
109798
|
+
case "keyDown":
|
|
109799
|
+
case "keyUp":
|
|
109800
|
+
return "Pressing a key";
|
|
109801
|
+
case "dismissKeyboard":
|
|
109802
|
+
case "toggleKeyboard":
|
|
109803
|
+
return "Using the keyboard";
|
|
109804
|
+
case "openUrl":
|
|
109805
|
+
return "Opening a link";
|
|
109806
|
+
case "setOrientation":
|
|
109807
|
+
return `Rotating to ${step.orientation}`;
|
|
109808
|
+
case "incrementElement":
|
|
109809
|
+
case "decrementElement":
|
|
109810
|
+
return verb("Adjusting", step.id);
|
|
109811
|
+
case "buttonDown":
|
|
109812
|
+
case "buttonUp":
|
|
109813
|
+
case "wait":
|
|
109814
|
+
case "waitFor":
|
|
109815
|
+
case "deviceInfo":
|
|
109816
|
+
case "discoverStoreKitConfig":
|
|
109817
|
+
case "clearStoreKitConfig":
|
|
109818
|
+
return null;
|
|
109819
|
+
}
|
|
109820
|
+
}
|
|
109821
|
+
function describeCommand(command) {
|
|
109822
|
+
switch (command.type) {
|
|
109823
|
+
case "tap":
|
|
109824
|
+
return verb("Tapping", targetName(command.target));
|
|
109825
|
+
case "longPress":
|
|
109826
|
+
return verb("Long pressing", targetName(command.target));
|
|
109827
|
+
case "keyboard":
|
|
109828
|
+
return command.action === "dismiss" ? "Dismissing the keyboard" : command.action === "press" || command.action === "dispatchKey" ? "Pressing a key" : "Typing";
|
|
109829
|
+
case "screenshot":
|
|
109830
|
+
return "Taking a screenshot";
|
|
109831
|
+
case "perform": {
|
|
109832
|
+
const labels = (command.steps ?? []).flatMap((step) => describeStep(step) ?? []);
|
|
109833
|
+
const [first] = labels;
|
|
109834
|
+
if (!first) return null;
|
|
109835
|
+
return labels.length === 1 ? first : `${first}, then ${labels.length - 1} more`;
|
|
109836
|
+
}
|
|
109837
|
+
default:
|
|
109838
|
+
return null;
|
|
109839
|
+
}
|
|
109840
|
+
}
|
|
109841
|
+
function commandAgent(command) {
|
|
109842
|
+
const step = describeCommand(command);
|
|
109843
|
+
if (!step) return void 0;
|
|
109844
|
+
const identity2 = getCliIdentity();
|
|
109845
|
+
if (!identity2.stable) return void 0;
|
|
109846
|
+
const machine = (0, import_os2.hostname)().split(".")[0];
|
|
109847
|
+
if (!machine) return void 0;
|
|
109848
|
+
return {
|
|
109849
|
+
id: clip(identity2.key),
|
|
109850
|
+
name: clip(
|
|
109851
|
+
readAgentId() ?? (process.env.PEACH_AGENT_ID?.trim() || formatLockOwner(identity2.key))
|
|
109852
|
+
),
|
|
109853
|
+
machine: clip(machine),
|
|
109854
|
+
step: clip(step)
|
|
109855
|
+
};
|
|
109856
|
+
}
|
|
109857
|
+
var import_os2;
|
|
109858
|
+
var init_command_agent = __esm({
|
|
109859
|
+
"cli/command-agent.ts"() {
|
|
109860
|
+
"use strict";
|
|
109861
|
+
import_os2 = require("os");
|
|
109862
|
+
init_agent_identity();
|
|
109863
|
+
init_cloud_contract();
|
|
109864
|
+
init_current_sim();
|
|
109865
|
+
}
|
|
109866
|
+
});
|
|
109867
|
+
|
|
109286
109868
|
// ../peach-globals/src/github-workflow-contract.ts
|
|
109287
109869
|
var init_github_workflow_contract = __esm({
|
|
109288
109870
|
"../peach-globals/src/github-workflow-contract.ts"() {
|
|
@@ -109301,7 +109883,7 @@ var init_github_workflow_identity = __esm({
|
|
|
109301
109883
|
// cli/run-registry.ts
|
|
109302
109884
|
function gitOutput(command, cwd) {
|
|
109303
109885
|
try {
|
|
109304
|
-
const out = (0,
|
|
109886
|
+
const out = (0, import_child_process4.execSync)(command, {
|
|
109305
109887
|
cwd,
|
|
109306
109888
|
stdio: ["ignore", "pipe", "ignore"],
|
|
109307
109889
|
timeout: 3e3,
|
|
@@ -109320,11 +109902,11 @@ function resolveCheckoutRepo(cwd) {
|
|
|
109320
109902
|
);
|
|
109321
109903
|
return match ? `${match[1]}/${match[2]}` : null;
|
|
109322
109904
|
}
|
|
109323
|
-
var
|
|
109905
|
+
var import_child_process4;
|
|
109324
109906
|
var init_run_registry = __esm({
|
|
109325
109907
|
"cli/run-registry.ts"() {
|
|
109326
109908
|
"use strict";
|
|
109327
|
-
|
|
109909
|
+
import_child_process4 = require("child_process");
|
|
109328
109910
|
init_auth();
|
|
109329
109911
|
init_github_workflow_identity();
|
|
109330
109912
|
}
|
|
@@ -110500,6 +111082,7 @@ var init_cloud_client = __esm({
|
|
|
110500
111082
|
init_public_brand();
|
|
110501
111083
|
init_auth();
|
|
110502
111084
|
init_cloud_session();
|
|
111085
|
+
init_command_agent();
|
|
110503
111086
|
init_detect();
|
|
110504
111087
|
init_run_registry();
|
|
110505
111088
|
DEFAULT_RNX_CLOUD_ORIGIN = rnxPublicBrand.origin;
|
|
@@ -110544,10 +111127,11 @@ var init_cloud_client = __esm({
|
|
|
110544
111127
|
plane = "cloud";
|
|
110545
111128
|
async send(command, options) {
|
|
110546
111129
|
const timeoutMs = options?.timeoutMs ?? this.explicitTimeoutMs ?? options?.defaultTimeoutMs;
|
|
111130
|
+
const agent = commandAgent(command);
|
|
110547
111131
|
const body = {
|
|
110548
111132
|
id: (0, import_node_crypto73.randomUUID)(),
|
|
110549
111133
|
claimId: this.session.claimId,
|
|
110550
|
-
command: cloudCommand(command)
|
|
111134
|
+
command: cloudCommand(agent ? { ...command, agent } : command)
|
|
110551
111135
|
};
|
|
110552
111136
|
let response;
|
|
110553
111137
|
try {
|
|
@@ -110620,6 +111204,8 @@ var init_cloud_client = __esm({
|
|
|
110620
111204
|
for (const [key2, value] of Object.entries(command)) {
|
|
110621
111205
|
if (key2 !== "id" && key2 !== "simId") payload[key2] = value;
|
|
110622
111206
|
}
|
|
111207
|
+
const agent = commandAgent(command);
|
|
111208
|
+
if (agent) payload.agent = agent;
|
|
110623
111209
|
let response;
|
|
110624
111210
|
try {
|
|
110625
111211
|
response = await fetch(
|
|
@@ -110791,16 +111377,16 @@ function unrefTimer(timer) {
|
|
|
110791
111377
|
timer.unref();
|
|
110792
111378
|
}
|
|
110793
111379
|
}
|
|
110794
|
-
var
|
|
111380
|
+
var import_child_process5, import_crypto2, import_fs6, import_http4, import_os3, import_path5, import_ws2, SOOTSIM_CROSS_ORIGIN_EMBEDDER_POLICY, FORCE_CLOSE_GRACE_MS, FORCE_CLOSE_TERMINATE_MS, MAX_RETAINED_DISCONNECTS, DAEMON_HEARTBEAT_INTERVAL_MS, DEFAULT_RUNTIME_UPDATE_INTERVAL_MS, RUNTIME_UPDATE_INTERVAL_ENV, HTTP_MIME_TYPES, CAMERA_FIXTURE_ROUTE, CAMERA_FIXTURE_NAME_RE, SootSimBridgeHost;
|
|
110795
111381
|
var init_bridge_host = __esm({
|
|
110796
111382
|
"src/host/bridge-host.ts"() {
|
|
110797
111383
|
"use strict";
|
|
110798
|
-
|
|
111384
|
+
import_child_process5 = __toESM(require("child_process"), 1);
|
|
110799
111385
|
import_crypto2 = require("crypto");
|
|
110800
|
-
|
|
111386
|
+
import_fs6 = __toESM(require("fs"), 1);
|
|
110801
111387
|
import_http4 = require("http");
|
|
110802
|
-
|
|
110803
|
-
|
|
111388
|
+
import_os3 = __toESM(require("os"), 1);
|
|
111389
|
+
import_path5 = __toESM(require("path"), 1);
|
|
110804
111390
|
import_ws2 = require("ws");
|
|
110805
111391
|
init_automatic_update_policy();
|
|
110806
111392
|
init_bridge_constants();
|
|
@@ -110968,7 +111554,7 @@ var init_bridge_host = __esm({
|
|
|
110968
111554
|
async startAsync(options) {
|
|
110969
111555
|
if (this.httpServer || this.wss) return this.effectivePort;
|
|
110970
111556
|
const bootRuntimeDir = this.getActiveRuntime().runtimeDir;
|
|
110971
|
-
this.bootstrapping = this.shouldWriteLockfile && (!bootRuntimeDir || !
|
|
111557
|
+
this.bootstrapping = this.shouldWriteLockfile && (!bootRuntimeDir || !import_fs6.default.existsSync(import_path5.default.join(bootRuntimeDir, "index.html")));
|
|
110972
111558
|
for (let attempt = 0; attempt < this.portFallbackCount; attempt++) {
|
|
110973
111559
|
const candidate = this.preferredPort === 0 ? 0 : this.preferredPort + attempt;
|
|
110974
111560
|
try {
|
|
@@ -111657,10 +112243,10 @@ var init_bridge_host = __esm({
|
|
|
111657
112243
|
return;
|
|
111658
112244
|
}
|
|
111659
112245
|
const root = cameraFixturesDir();
|
|
111660
|
-
const filePath =
|
|
112246
|
+
const filePath = import_path5.default.join(root, name3);
|
|
111661
112247
|
let stats;
|
|
111662
112248
|
try {
|
|
111663
|
-
stats =
|
|
112249
|
+
stats = import_fs6.default.lstatSync(filePath);
|
|
111664
112250
|
} catch {
|
|
111665
112251
|
res.writeHead(404, { ...cors, "Content-Type": "text/plain; charset=utf-8" });
|
|
111666
112252
|
res.end("not found");
|
|
@@ -111671,7 +112257,7 @@ var init_bridge_host = __esm({
|
|
|
111671
112257
|
res.end("forbidden");
|
|
111672
112258
|
return;
|
|
111673
112259
|
}
|
|
111674
|
-
const contentType2 = HTTP_MIME_TYPES[
|
|
112260
|
+
const contentType2 = HTTP_MIME_TYPES[import_path5.default.extname(filePath).toLowerCase()] || "application/octet-stream";
|
|
111675
112261
|
sendFileWithRanges(req, res, filePath, stats.size, {
|
|
111676
112262
|
...cors,
|
|
111677
112263
|
"Content-Type": contentType2
|
|
@@ -112115,35 +112701,35 @@ var init_bridge_host = __esm({
|
|
|
112115
112701
|
return;
|
|
112116
112702
|
}
|
|
112117
112703
|
}
|
|
112118
|
-
const resolved =
|
|
112119
|
-
const baseWithSep = baseDir.endsWith(
|
|
112704
|
+
const resolved = import_path5.default.resolve(baseDir, "." + rel);
|
|
112705
|
+
const baseWithSep = baseDir.endsWith(import_path5.default.sep) ? baseDir : baseDir + import_path5.default.sep;
|
|
112120
112706
|
if (!resolved.startsWith(baseWithSep) && resolved !== baseDir) {
|
|
112121
112707
|
res.writeHead(403);
|
|
112122
112708
|
res.end("forbidden");
|
|
112123
112709
|
return;
|
|
112124
112710
|
}
|
|
112125
112711
|
void ensureRuntimePackFor(baseDir, rel).then(
|
|
112126
|
-
() =>
|
|
112712
|
+
() => import_fs6.default.realpath(resolved, (realErr, realResolved) => {
|
|
112127
112713
|
const servePath = realErr ? resolved : realResolved;
|
|
112128
|
-
const servePathWithSep = servePath.endsWith(
|
|
112714
|
+
const servePathWithSep = servePath.endsWith(import_path5.default.sep) ? servePath : servePath + import_path5.default.sep;
|
|
112129
112715
|
if (!realErr) {
|
|
112130
112716
|
const realBaseWithSep = (() => {
|
|
112131
112717
|
try {
|
|
112132
|
-
const rb =
|
|
112133
|
-
return rb.endsWith(
|
|
112718
|
+
const rb = import_fs6.default.realpathSync(baseDir);
|
|
112719
|
+
return rb.endsWith(import_path5.default.sep) ? rb : rb + import_path5.default.sep;
|
|
112134
112720
|
} catch {
|
|
112135
112721
|
return baseWithSep;
|
|
112136
112722
|
}
|
|
112137
112723
|
})();
|
|
112138
|
-
if (!servePathWithSep.startsWith(realBaseWithSep) && servePath +
|
|
112724
|
+
if (!servePathWithSep.startsWith(realBaseWithSep) && servePath + import_path5.default.sep !== realBaseWithSep) {
|
|
112139
112725
|
res.writeHead(403);
|
|
112140
112726
|
res.end("forbidden");
|
|
112141
112727
|
return;
|
|
112142
112728
|
}
|
|
112143
112729
|
}
|
|
112144
|
-
|
|
112730
|
+
import_fs6.default.stat(servePath, (err, stats) => {
|
|
112145
112731
|
if (err || !stats?.isFile()) {
|
|
112146
|
-
const ext2 =
|
|
112732
|
+
const ext2 = import_path5.default.extname(rel).toLowerCase();
|
|
112147
112733
|
if (ext2 && ext2 !== ".html") {
|
|
112148
112734
|
res.writeHead(404);
|
|
112149
112735
|
res.end("not found");
|
|
@@ -112154,8 +112740,8 @@ var init_bridge_host = __esm({
|
|
|
112154
112740
|
res.end("not found");
|
|
112155
112741
|
return;
|
|
112156
112742
|
}
|
|
112157
|
-
const indexPath =
|
|
112158
|
-
|
|
112743
|
+
const indexPath = import_path5.default.join(baseDir, "index.html");
|
|
112744
|
+
import_fs6.default.readFile(indexPath, (err2, data) => {
|
|
112159
112745
|
if (err2) {
|
|
112160
112746
|
res.writeHead(404);
|
|
112161
112747
|
res.end("not found");
|
|
@@ -112175,7 +112761,7 @@ var init_bridge_host = __esm({
|
|
|
112175
112761
|
});
|
|
112176
112762
|
return;
|
|
112177
112763
|
}
|
|
112178
|
-
const ext =
|
|
112764
|
+
const ext = import_path5.default.extname(servePath).toLowerCase();
|
|
112179
112765
|
const contentType2 = HTTP_MIME_TYPES[ext] || "application/octet-stream";
|
|
112180
112766
|
res.writeHead(200, {
|
|
112181
112767
|
"Content-Type": contentType2,
|
|
@@ -112188,7 +112774,7 @@ var init_bridge_host = __esm({
|
|
|
112188
112774
|
return;
|
|
112189
112775
|
}
|
|
112190
112776
|
if (ext === ".html") {
|
|
112191
|
-
|
|
112777
|
+
import_fs6.default.readFile(servePath, (readErr, data) => {
|
|
112192
112778
|
if (readErr) {
|
|
112193
112779
|
try {
|
|
112194
112780
|
res.end();
|
|
@@ -112202,7 +112788,7 @@ var init_bridge_host = __esm({
|
|
|
112202
112788
|
});
|
|
112203
112789
|
return;
|
|
112204
112790
|
}
|
|
112205
|
-
const stream =
|
|
112791
|
+
const stream = import_fs6.default.createReadStream(servePath);
|
|
112206
112792
|
stream.pipe(res);
|
|
112207
112793
|
stream.on("error", () => {
|
|
112208
112794
|
try {
|
|
@@ -112290,7 +112876,7 @@ var init_bridge_host = __esm({
|
|
|
112290
112876
|
chromiumQueueVerified = /* @__PURE__ */ new Map();
|
|
112291
112877
|
chromiumLaunchWaiting() {
|
|
112292
112878
|
const queue2 = readChromiumQueue(
|
|
112293
|
-
{ fs:
|
|
112879
|
+
{ fs: import_fs6.default, os: import_os3.default, path: import_path5.default, childProcess: import_child_process5.default },
|
|
112294
112880
|
this.chromiumQueueVerified
|
|
112295
112881
|
);
|
|
112296
112882
|
const live = new Set(queue2.tickets);
|
|
@@ -112372,7 +112958,7 @@ var init_bridge_host = __esm({
|
|
|
112372
112958
|
const target = `${filePath}${loc}`;
|
|
112373
112959
|
const trySpawn = (cmd, args) => new Promise((resolve14) => {
|
|
112374
112960
|
try {
|
|
112375
|
-
const child = (0,
|
|
112961
|
+
const child = (0, import_child_process5.spawn)(cmd, args, { detached: true, stdio: "ignore" });
|
|
112376
112962
|
let settled = false;
|
|
112377
112963
|
child.on("error", () => {
|
|
112378
112964
|
if (settled) return;
|
|
@@ -112927,434 +113513,6 @@ var init_cli_constants = __esm({
|
|
|
112927
113513
|
}
|
|
112928
113514
|
});
|
|
112929
113515
|
|
|
112930
|
-
// cli/parent-pid.ts
|
|
112931
|
-
function getParentPid(pid) {
|
|
112932
|
-
if (!cached3) cached3 = build();
|
|
112933
|
-
try {
|
|
112934
|
-
return cached3(pid);
|
|
112935
|
-
} catch {
|
|
112936
|
-
return null;
|
|
112937
|
-
}
|
|
112938
|
-
}
|
|
112939
|
-
function getProcessComm(pid) {
|
|
112940
|
-
if (!cachedComm) cachedComm = buildComm();
|
|
112941
|
-
try {
|
|
112942
|
-
return cachedComm(pid);
|
|
112943
|
-
} catch {
|
|
112944
|
-
return null;
|
|
112945
|
-
}
|
|
112946
|
-
}
|
|
112947
|
-
function getProcessPgid(pid) {
|
|
112948
|
-
if (!cachedPgid) cachedPgid = buildPgid();
|
|
112949
|
-
try {
|
|
112950
|
-
return cachedPgid(pid);
|
|
112951
|
-
} catch {
|
|
112952
|
-
return null;
|
|
112953
|
-
}
|
|
112954
|
-
}
|
|
112955
|
-
function buildComm() {
|
|
112956
|
-
if (process.platform === "linux") {
|
|
112957
|
-
return (pid) => {
|
|
112958
|
-
try {
|
|
112959
|
-
return (0, import_fs5.readFileSync)(`/proc/${pid}/comm`, "utf8").trim() || null;
|
|
112960
|
-
} catch {
|
|
112961
|
-
return null;
|
|
112962
|
-
}
|
|
112963
|
-
};
|
|
112964
|
-
}
|
|
112965
|
-
if (process.platform === "darwin") {
|
|
112966
|
-
const ffi = tryBuildDarwinCommFfi();
|
|
112967
|
-
if (ffi) return ffi;
|
|
112968
|
-
return (pid) => readProcessTable2().get(pid)?.comm || null;
|
|
112969
|
-
}
|
|
112970
|
-
return () => null;
|
|
112971
|
-
}
|
|
112972
|
-
function build() {
|
|
112973
|
-
if (process.platform === "linux") return buildLinux();
|
|
112974
|
-
if (process.platform === "darwin") {
|
|
112975
|
-
const ffi = tryBuildDarwinFfi();
|
|
112976
|
-
if (ffi) return ffi;
|
|
112977
|
-
return (pid) => {
|
|
112978
|
-
const ppid = readProcessTable2().get(pid)?.ppid;
|
|
112979
|
-
return ppid !== void 0 && ppid > 0 ? ppid : null;
|
|
112980
|
-
};
|
|
112981
|
-
}
|
|
112982
|
-
return () => null;
|
|
112983
|
-
}
|
|
112984
|
-
function buildPgid() {
|
|
112985
|
-
if (process.platform === "linux") {
|
|
112986
|
-
return (pid) => {
|
|
112987
|
-
try {
|
|
112988
|
-
const raw2 = (0, import_fs5.readFileSync)(`/proc/${pid}/stat`, "utf8");
|
|
112989
|
-
const end = raw2.lastIndexOf(")");
|
|
112990
|
-
if (end < 0) return null;
|
|
112991
|
-
const rest = raw2.slice(end + 1).trim().split(/\s+/);
|
|
112992
|
-
const pgid = Number(rest[2]);
|
|
112993
|
-
return Number.isFinite(pgid) && pgid > 0 ? pgid : null;
|
|
112994
|
-
} catch {
|
|
112995
|
-
return null;
|
|
112996
|
-
}
|
|
112997
|
-
};
|
|
112998
|
-
}
|
|
112999
|
-
if (process.platform === "darwin") {
|
|
113000
|
-
const ffi = tryBuildDarwinPgidFfi();
|
|
113001
|
-
if (ffi) return ffi;
|
|
113002
|
-
return (pid) => {
|
|
113003
|
-
const pgid = readProcessTable2().get(pid)?.pgid;
|
|
113004
|
-
return pgid !== void 0 && pgid > 0 ? pgid : null;
|
|
113005
|
-
};
|
|
113006
|
-
}
|
|
113007
|
-
return () => null;
|
|
113008
|
-
}
|
|
113009
|
-
function readProcessTable2() {
|
|
113010
|
-
const now = Date.now();
|
|
113011
|
-
if (processTable2.readAt && now - processTable2.readAt < PROCESS_TABLE_TTL_MS) {
|
|
113012
|
-
return processTable2.rows;
|
|
113013
|
-
}
|
|
113014
|
-
const rows = /* @__PURE__ */ new Map();
|
|
113015
|
-
try {
|
|
113016
|
-
const out = (0, import_child_process5.execFileSync)("ps", ["-eo", "pid=,ppid=,pgid=,comm="], {
|
|
113017
|
-
encoding: "utf8",
|
|
113018
|
-
timeout: 5e3,
|
|
113019
|
-
maxBuffer: 8 * 1024 * 1024,
|
|
113020
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
113021
|
-
});
|
|
113022
|
-
for (const line of out.split("\n")) {
|
|
113023
|
-
const parsed = line.trim().match(/^(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/);
|
|
113024
|
-
if (!parsed) continue;
|
|
113025
|
-
rows.set(Number(parsed[1]), {
|
|
113026
|
-
ppid: Number(parsed[2]),
|
|
113027
|
-
pgid: Number(parsed[3]),
|
|
113028
|
-
comm: (parsed[4].split("/").at(-1) ?? "").slice(0, PBI_COMM_LEN)
|
|
113029
|
-
});
|
|
113030
|
-
}
|
|
113031
|
-
} catch {
|
|
113032
|
-
}
|
|
113033
|
-
processTable2 = { readAt: now, rows };
|
|
113034
|
-
return rows;
|
|
113035
|
-
}
|
|
113036
|
-
function buildLinux() {
|
|
113037
|
-
return (pid) => {
|
|
113038
|
-
try {
|
|
113039
|
-
const raw2 = (0, import_fs5.readFileSync)(`/proc/${pid}/stat`, "utf8");
|
|
113040
|
-
const end = raw2.lastIndexOf(")");
|
|
113041
|
-
if (end < 0) return null;
|
|
113042
|
-
const rest = raw2.slice(end + 1).trim().split(/\s+/);
|
|
113043
|
-
const ppid = Number(rest[1]);
|
|
113044
|
-
return Number.isFinite(ppid) && ppid > 0 ? ppid : null;
|
|
113045
|
-
} catch {
|
|
113046
|
-
return null;
|
|
113047
|
-
}
|
|
113048
|
-
};
|
|
113049
|
-
}
|
|
113050
|
-
function tryBuildDarwinFfi() {
|
|
113051
|
-
if (!process.versions?.bun) return null;
|
|
113052
|
-
try {
|
|
113053
|
-
const r = (0, import_module.createRequire)(__sootsim_import_meta_url);
|
|
113054
|
-
const { dlopen, FFIType } = r("bun:ffi");
|
|
113055
|
-
const lib = dlopen("/usr/lib/libproc.dylib", {
|
|
113056
|
-
proc_pidinfo: {
|
|
113057
|
-
args: [FFIType.i32, FFIType.i32, FFIType.u64, FFIType.ptr, FFIType.i32],
|
|
113058
|
-
returns: FFIType.i32
|
|
113059
|
-
}
|
|
113060
|
-
});
|
|
113061
|
-
const buf = Buffer.alloc(PROC_BSDINFO_SIZE);
|
|
113062
|
-
return (pid) => {
|
|
113063
|
-
const ret = Number(
|
|
113064
|
-
lib.symbols.proc_pidinfo(pid, PROC_PIDTBSDINFO, 0n, buf, PROC_BSDINFO_SIZE)
|
|
113065
|
-
);
|
|
113066
|
-
if (ret <= 0) return null;
|
|
113067
|
-
const ppid = buf.readUInt32LE(PBI_PPID_OFFSET);
|
|
113068
|
-
return ppid > 0 ? ppid : null;
|
|
113069
|
-
};
|
|
113070
|
-
} catch {
|
|
113071
|
-
return null;
|
|
113072
|
-
}
|
|
113073
|
-
}
|
|
113074
|
-
function tryBuildDarwinCommFfi() {
|
|
113075
|
-
if (!process.versions?.bun) return null;
|
|
113076
|
-
try {
|
|
113077
|
-
const r = (0, import_module.createRequire)(__sootsim_import_meta_url);
|
|
113078
|
-
const { dlopen, FFIType } = r("bun:ffi");
|
|
113079
|
-
const lib = dlopen("/usr/lib/libproc.dylib", {
|
|
113080
|
-
proc_pidinfo: {
|
|
113081
|
-
args: [FFIType.i32, FFIType.i32, FFIType.u64, FFIType.ptr, FFIType.i32],
|
|
113082
|
-
returns: FFIType.i32
|
|
113083
|
-
}
|
|
113084
|
-
});
|
|
113085
|
-
const buf = Buffer.alloc(PROC_BSDINFO_SIZE);
|
|
113086
|
-
return (pid) => {
|
|
113087
|
-
const ret = Number(
|
|
113088
|
-
lib.symbols.proc_pidinfo(pid, PROC_PIDTBSDINFO, 0n, buf, PROC_BSDINFO_SIZE)
|
|
113089
|
-
);
|
|
113090
|
-
if (ret <= 0) return null;
|
|
113091
|
-
const raw2 = buf.subarray(PBI_COMM_OFFSET, PBI_COMM_OFFSET + PBI_COMM_LEN);
|
|
113092
|
-
const end = raw2.indexOf(0);
|
|
113093
|
-
const comm = raw2.subarray(0, end < 0 ? raw2.length : end).toString("utf8");
|
|
113094
|
-
return comm || null;
|
|
113095
|
-
};
|
|
113096
|
-
} catch {
|
|
113097
|
-
return null;
|
|
113098
|
-
}
|
|
113099
|
-
}
|
|
113100
|
-
function tryBuildDarwinPgidFfi() {
|
|
113101
|
-
if (!process.versions?.bun) return null;
|
|
113102
|
-
try {
|
|
113103
|
-
const r = (0, import_module.createRequire)(__sootsim_import_meta_url);
|
|
113104
|
-
const { dlopen, FFIType } = r("bun:ffi");
|
|
113105
|
-
const lib = dlopen("/usr/lib/libproc.dylib", {
|
|
113106
|
-
proc_pidinfo: {
|
|
113107
|
-
args: [FFIType.i32, FFIType.i32, FFIType.u64, FFIType.ptr, FFIType.i32],
|
|
113108
|
-
returns: FFIType.i32
|
|
113109
|
-
}
|
|
113110
|
-
});
|
|
113111
|
-
const buf = Buffer.alloc(PROC_BSDINFO_SIZE);
|
|
113112
|
-
return (pid) => {
|
|
113113
|
-
const ret = Number(
|
|
113114
|
-
lib.symbols.proc_pidinfo(pid, PROC_PIDTBSDINFO, 0n, buf, PROC_BSDINFO_SIZE)
|
|
113115
|
-
);
|
|
113116
|
-
if (ret <= 0) return null;
|
|
113117
|
-
const pgid = buf.readUInt32LE(PBI_PGID_OFFSET);
|
|
113118
|
-
return pgid > 0 ? pgid : null;
|
|
113119
|
-
};
|
|
113120
|
-
} catch {
|
|
113121
|
-
return null;
|
|
113122
|
-
}
|
|
113123
|
-
}
|
|
113124
|
-
var import_child_process5, import_fs5, import_module, cached3, cachedComm, cachedPgid, PROCESS_TABLE_TTL_MS, processTable2, PROC_PIDTBSDINFO, PROC_BSDINFO_SIZE, PBI_PPID_OFFSET, PBI_COMM_OFFSET, PBI_COMM_LEN, PBI_PGID_OFFSET;
|
|
113125
|
-
var init_parent_pid = __esm({
|
|
113126
|
-
"cli/parent-pid.ts"() {
|
|
113127
|
-
"use strict";
|
|
113128
|
-
import_child_process5 = require("child_process");
|
|
113129
|
-
import_fs5 = require("fs");
|
|
113130
|
-
import_module = require("module");
|
|
113131
|
-
cached3 = null;
|
|
113132
|
-
cachedComm = null;
|
|
113133
|
-
cachedPgid = null;
|
|
113134
|
-
PROCESS_TABLE_TTL_MS = 2e3;
|
|
113135
|
-
processTable2 = { readAt: 0, rows: /* @__PURE__ */ new Map() };
|
|
113136
|
-
PROC_PIDTBSDINFO = 3;
|
|
113137
|
-
PROC_BSDINFO_SIZE = 216;
|
|
113138
|
-
PBI_PPID_OFFSET = 16;
|
|
113139
|
-
PBI_COMM_OFFSET = 48;
|
|
113140
|
-
PBI_COMM_LEN = 16;
|
|
113141
|
-
PBI_PGID_OFFSET = 100;
|
|
113142
|
-
}
|
|
113143
|
-
});
|
|
113144
|
-
|
|
113145
|
-
// cli/current-sim.ts
|
|
113146
|
-
function findTopAncestor(start, maxDepth = 20) {
|
|
113147
|
-
let prev = start;
|
|
113148
|
-
let pid = getParentPid(start);
|
|
113149
|
-
if (!pid || pid <= 1) {
|
|
113150
|
-
const comm = getProcessComm(start);
|
|
113151
|
-
if (!comm || start < 1 || IMMORTAL_HOST_COMM_RE.test(comm)) return null;
|
|
113152
|
-
return start > 1 || !INIT_COMM_RE.test(comm) ? start : null;
|
|
113153
|
-
}
|
|
113154
|
-
for (let i = 0; i < maxDepth; i++) {
|
|
113155
|
-
const comm = getProcessComm(pid);
|
|
113156
|
-
if (comm && IMMORTAL_HOST_COMM_RE.test(comm)) return prev;
|
|
113157
|
-
const parent = getParentPid(pid);
|
|
113158
|
-
if (!parent || parent <= 1) {
|
|
113159
|
-
return comm ? pid : prev;
|
|
113160
|
-
}
|
|
113161
|
-
prev = pid;
|
|
113162
|
-
pid = parent;
|
|
113163
|
-
}
|
|
113164
|
-
return pid;
|
|
113165
|
-
}
|
|
113166
|
-
function getCliIdentity() {
|
|
113167
|
-
for (const name3 of IDENTITY_ENV_VARS) {
|
|
113168
|
-
const value = process.env[name3];
|
|
113169
|
-
if (value && value.trim()) {
|
|
113170
|
-
return { key: `${name3}:${value.trim()}`, source: name3, stable: true };
|
|
113171
|
-
}
|
|
113172
|
-
}
|
|
113173
|
-
const topPid = findTopAncestor(process.ppid);
|
|
113174
|
-
if (topPid) {
|
|
113175
|
-
return { key: `gppid-${topPid}`, source: "grand-ppid", stable: true };
|
|
113176
|
-
}
|
|
113177
|
-
return { key: `pid-${process.ppid}`, source: "ppid", stable: false };
|
|
113178
|
-
}
|
|
113179
|
-
function getCliIdentityKey() {
|
|
113180
|
-
return getCliIdentity().key;
|
|
113181
|
-
}
|
|
113182
|
-
function getStableOwnerPid() {
|
|
113183
|
-
return findTopAncestor(process.ppid);
|
|
113184
|
-
}
|
|
113185
|
-
function getOwnerProcessGroupId(owner = getStableOwnerPid()) {
|
|
113186
|
-
if (!owner || owner <= 1) return null;
|
|
113187
|
-
const pgid = getProcessPgid(owner);
|
|
113188
|
-
return pgid !== null && pgid > 1 ? pgid : null;
|
|
113189
|
-
}
|
|
113190
|
-
function getCurrentSimPath() {
|
|
113191
|
-
const envPath = process.env[CURRENT_SIM_PATH_ENV];
|
|
113192
|
-
if (envPath) {
|
|
113193
|
-
return (0, import_path5.resolve)(envPath);
|
|
113194
|
-
}
|
|
113195
|
-
const key2 = getCliIdentityKey();
|
|
113196
|
-
return (0, import_path5.join)((0, import_os2.tmpdir)(), `peach-current-sim-${key2}.json`);
|
|
113197
|
-
}
|
|
113198
|
-
function legacyCloudCredentialDirectory(filepath) {
|
|
113199
|
-
return (0, import_path5.join)((0, import_path5.dirname)(filepath), `${(0, import_path5.basename)(filepath)}.credentials`);
|
|
113200
|
-
}
|
|
113201
|
-
function readCurrentTarget() {
|
|
113202
|
-
const filepath = getCurrentSimPath();
|
|
113203
|
-
(0, import_fs6.rmSync)(legacyCloudCredentialDirectory(filepath), { recursive: true, force: true });
|
|
113204
|
-
if (!(0, import_fs6.existsSync)(filepath)) return null;
|
|
113205
|
-
try {
|
|
113206
|
-
const parsed = JSON.parse((0, import_fs6.readFileSync)(filepath, "utf8"));
|
|
113207
|
-
if (parsed === null || typeof parsed !== "object") {
|
|
113208
|
-
(0, import_fs6.rmSync)(filepath, { force: true });
|
|
113209
|
-
return null;
|
|
113210
|
-
}
|
|
113211
|
-
if (Reflect.get(parsed, "pendingOpen") === true) return null;
|
|
113212
|
-
const version2 = Reflect.get(parsed, "version");
|
|
113213
|
-
const plane = Reflect.get(parsed, "plane");
|
|
113214
|
-
const simId = Reflect.get(parsed, "simId");
|
|
113215
|
-
const updatedAt = Reflect.get(parsed, "updatedAt");
|
|
113216
|
-
const rawPort = Reflect.get(parsed, "bridgePort");
|
|
113217
|
-
const bridgePort = typeof rawPort === "number" && Number.isInteger(rawPort) && rawPort > 0 ? rawPort : void 0;
|
|
113218
|
-
if (version2 !== 1 && version2 !== CURRENT_SIM_VERSION || version2 === CURRENT_SIM_VERSION && plane !== "local" || typeof simId !== "string" || !simId.trim() || typeof updatedAt !== "string") {
|
|
113219
|
-
(0, import_fs6.rmSync)(filepath, { force: true });
|
|
113220
|
-
return null;
|
|
113221
|
-
}
|
|
113222
|
-
const target = {
|
|
113223
|
-
version: CURRENT_SIM_VERSION,
|
|
113224
|
-
plane: "local",
|
|
113225
|
-
simId: simId.trim(),
|
|
113226
|
-
...bridgePort === void 0 ? {} : { bridgePort },
|
|
113227
|
-
updatedAt
|
|
113228
|
-
};
|
|
113229
|
-
if (version2 === 1) writeSecureJsonAtomic(filepath, target, { durable: false });
|
|
113230
|
-
return target;
|
|
113231
|
-
} catch {
|
|
113232
|
-
(0, import_fs6.rmSync)(filepath, { force: true });
|
|
113233
|
-
return null;
|
|
113234
|
-
}
|
|
113235
|
-
}
|
|
113236
|
-
function readCurrentSimId() {
|
|
113237
|
-
return readCurrentTarget()?.simId ?? null;
|
|
113238
|
-
}
|
|
113239
|
-
function writeCurrentSim(simId, bridgePort) {
|
|
113240
|
-
const normalized = simId.trim();
|
|
113241
|
-
if (!normalized) return;
|
|
113242
|
-
writeSecureJsonAtomic(
|
|
113243
|
-
getCurrentSimPath(),
|
|
113244
|
-
{
|
|
113245
|
-
version: CURRENT_SIM_VERSION,
|
|
113246
|
-
plane: "local",
|
|
113247
|
-
simId: normalized,
|
|
113248
|
-
...bridgePort === void 0 ? {} : { bridgePort },
|
|
113249
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
113250
|
-
},
|
|
113251
|
-
{ durable: false }
|
|
113252
|
-
);
|
|
113253
|
-
}
|
|
113254
|
-
function saveCurrentSimId(simId, bridgePort) {
|
|
113255
|
-
writeCurrentSim(simId, bridgePort);
|
|
113256
|
-
}
|
|
113257
|
-
function replaceCurrentSimId(simId) {
|
|
113258
|
-
writeCurrentSim(simId, readCurrentTarget()?.bridgePort);
|
|
113259
|
-
}
|
|
113260
|
-
function getAgentIdPath() {
|
|
113261
|
-
return `${getCurrentSimPath()}.agent-id`;
|
|
113262
|
-
}
|
|
113263
|
-
function saveAgentId(agentId) {
|
|
113264
|
-
writeSecureJsonAtomic(getAgentIdPath(), { agentId }, { durable: false });
|
|
113265
|
-
}
|
|
113266
|
-
function readAgentId() {
|
|
113267
|
-
const filepath = getAgentIdPath();
|
|
113268
|
-
if (!(0, import_fs6.existsSync)(filepath)) return void 0;
|
|
113269
|
-
try {
|
|
113270
|
-
const parsed = JSON.parse((0, import_fs6.readFileSync)(filepath, "utf8"));
|
|
113271
|
-
const agentId = parsed !== null && typeof parsed === "object" ? Reflect.get(parsed, "agentId") : void 0;
|
|
113272
|
-
return typeof agentId === "string" && agentId.trim() ? agentId.trim() : void 0;
|
|
113273
|
-
} catch {
|
|
113274
|
-
(0, import_fs6.rmSync)(filepath, { force: true });
|
|
113275
|
-
return void 0;
|
|
113276
|
-
}
|
|
113277
|
-
}
|
|
113278
|
-
function clearCurrentSimId() {
|
|
113279
|
-
(0, import_fs6.rmSync)(getCurrentSimPath(), { force: true });
|
|
113280
|
-
}
|
|
113281
|
-
function markOpenPending() {
|
|
113282
|
-
writeSecureJsonAtomic(
|
|
113283
|
-
getCurrentSimPath(),
|
|
113284
|
-
{
|
|
113285
|
-
version: CURRENT_SIM_VERSION,
|
|
113286
|
-
plane: "local",
|
|
113287
|
-
pendingOpen: true,
|
|
113288
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
113289
|
-
},
|
|
113290
|
-
{ durable: false }
|
|
113291
|
-
);
|
|
113292
|
-
}
|
|
113293
|
-
function assertNoPendingOpen() {
|
|
113294
|
-
if (!isOpenPending()) return;
|
|
113295
|
-
throw new PendingOpenError(
|
|
113296
|
-
"the last `peach open` did not pin a sim, so this command would land on whichever tab is connected. run `peach open` again, `peach use <sim>`, or pass --sim <id>"
|
|
113297
|
-
);
|
|
113298
|
-
}
|
|
113299
|
-
function isOpenPending() {
|
|
113300
|
-
const filepath = getCurrentSimPath();
|
|
113301
|
-
if (!(0, import_fs6.existsSync)(filepath)) return false;
|
|
113302
|
-
try {
|
|
113303
|
-
const parsed = JSON.parse((0, import_fs6.readFileSync)(filepath, "utf8"));
|
|
113304
|
-
return parsed !== null && typeof parsed === "object" && Reflect.get(parsed, "pendingOpen") === true;
|
|
113305
|
-
} catch {
|
|
113306
|
-
return false;
|
|
113307
|
-
}
|
|
113308
|
-
}
|
|
113309
|
-
var import_fs6, import_os2, import_path5, CURRENT_SIM_VERSION, CURRENT_SIM_PATH_ENV, IDENTITY_ENV_VARS, IMMORTAL_HOST_COMM_RE, INIT_COMM_RE, readCurrentSim, PendingOpenError;
|
|
113310
|
-
var init_current_sim = __esm({
|
|
113311
|
-
"cli/current-sim.ts"() {
|
|
113312
|
-
"use strict";
|
|
113313
|
-
import_fs6 = require("fs");
|
|
113314
|
-
import_os2 = require("os");
|
|
113315
|
-
import_path5 = require("path");
|
|
113316
|
-
init_parent_pid();
|
|
113317
|
-
init_secure_file();
|
|
113318
|
-
CURRENT_SIM_VERSION = 2;
|
|
113319
|
-
CURRENT_SIM_PATH_ENV = "PEACH_CLI_CURRENT_SIM_PATH";
|
|
113320
|
-
IDENTITY_ENV_VARS = [
|
|
113321
|
-
"PEACH_CLI_IDENTITY",
|
|
113322
|
-
// explicit override — fastest path, skips all pid lookups
|
|
113323
|
-
"CLAUDE_CODE_SESSION_ID",
|
|
113324
|
-
// claude code, if ever set
|
|
113325
|
-
"CODEX_THREAD_ID",
|
|
113326
|
-
// codex / openai agent thread, stable across tool invocations
|
|
113327
|
-
// a Team Machine session, per agent run. its other runners set no session
|
|
113328
|
-
// variable of their own, and the terminal variables below are inherited from
|
|
113329
|
-
// whatever shell started the daemon, so every such agent would share one key.
|
|
113330
|
-
"TM_SESSION",
|
|
113331
|
-
"TERM_SESSION_ID",
|
|
113332
|
-
// macOS Terminal.app + iTerm2
|
|
113333
|
-
"ITERM_SESSION_ID",
|
|
113334
|
-
// iTerm2 (older variant)
|
|
113335
|
-
"TMUX_PANE",
|
|
113336
|
-
// tmux — stable per pane
|
|
113337
|
-
"STY",
|
|
113338
|
-
// GNU screen session
|
|
113339
|
-
"KITTY_WINDOW_ID",
|
|
113340
|
-
// kitty
|
|
113341
|
-
"WEZTERM_PANE",
|
|
113342
|
-
// wezterm
|
|
113343
|
-
"ALACRITTY_WINDOW_ID",
|
|
113344
|
-
// alacritty
|
|
113345
|
-
"WINDOWID",
|
|
113346
|
-
// X11 terminals
|
|
113347
|
-
"VSCODE_INJECTION"
|
|
113348
|
-
// vscode integrated terminal
|
|
113349
|
-
];
|
|
113350
|
-
IMMORTAL_HOST_COMM_RE = /^(?:tmux|screen)|^tm$/i;
|
|
113351
|
-
INIT_COMM_RE = /^(?:init|systemd|launchd|tini|docker-init|dumb-init|catatonit|s6-svscan|runsvdir)$/i;
|
|
113352
|
-
readCurrentSim = readCurrentTarget;
|
|
113353
|
-
PendingOpenError = class extends Error {
|
|
113354
|
-
};
|
|
113355
|
-
}
|
|
113356
|
-
});
|
|
113357
|
-
|
|
113358
113516
|
// cli/pause-aware-timeout.ts
|
|
113359
113517
|
function pausedPids() {
|
|
113360
113518
|
try {
|
|
@@ -113884,12 +114042,14 @@ function createBridge(wsPort, opts = {}) {
|
|
|
113884
114042
|
plane: "local",
|
|
113885
114043
|
async send(cmd, callOpts) {
|
|
113886
114044
|
const effectiveTimeoutMs = callOpts?.timeoutMs ?? (opts.explicitTimeout ? commandTimeoutMs : callOpts?.defaultTimeoutMs) ?? commandTimeoutMs;
|
|
114045
|
+
const agent = commandAgent(cmd);
|
|
114046
|
+
const sent = agent ? { ...cmd, agent } : cmd;
|
|
113887
114047
|
const sendOnce = async (defaultSimId, cmdOverride) => {
|
|
113888
114048
|
await ready;
|
|
113889
114049
|
if (terminalError) throw terminalError;
|
|
113890
114050
|
const id = nextId++;
|
|
113891
114051
|
return new Promise((resolve14, reject) => {
|
|
113892
|
-
const payload = { ...cmdOverride ??
|
|
114052
|
+
const payload = { ...cmdOverride ?? sent, id };
|
|
113893
114053
|
if (payload.simId === void 0 && defaultSimId) {
|
|
113894
114054
|
payload.simId = defaultSimId;
|
|
113895
114055
|
}
|
|
@@ -114240,6 +114400,7 @@ var init_ws_bridge = __esm({
|
|
|
114240
114400
|
init_cli_constants();
|
|
114241
114401
|
init_home_paths();
|
|
114242
114402
|
init_cloud_client();
|
|
114403
|
+
init_command_agent();
|
|
114243
114404
|
init_current_sim();
|
|
114244
114405
|
init_pause_aware_timeout();
|
|
114245
114406
|
init_run_rnx();
|
|
@@ -114414,25 +114575,6 @@ var init_src2 = __esm({
|
|
|
114414
114575
|
}
|
|
114415
114576
|
});
|
|
114416
114577
|
|
|
114417
|
-
// ../peach-kit/src/agent-identity.ts
|
|
114418
|
-
function formatLockOwner(owner) {
|
|
114419
|
-
const colon = owner.indexOf(":");
|
|
114420
|
-
if (colon <= 0) return owner.length > 24 ? `${owner.slice(0, 21)}\u2026` : owner;
|
|
114421
|
-
const source = owner.slice(0, colon);
|
|
114422
|
-
const value = owner.slice(colon + 1);
|
|
114423
|
-
if (source === "PEACH_CLI_IDENTITY" && value) return value;
|
|
114424
|
-
const short = value.length > 12 ? `${value.slice(0, 8)}\u2026` : value;
|
|
114425
|
-
if (source === "CLAUDE_CODE_SESSION_ID" || source === "CODEX_THREAD_ID") {
|
|
114426
|
-
return `agent ${short}`;
|
|
114427
|
-
}
|
|
114428
|
-
return `${source} ${short}`;
|
|
114429
|
-
}
|
|
114430
|
-
var init_agent_identity = __esm({
|
|
114431
|
-
"../peach-kit/src/agent-identity.ts"() {
|
|
114432
|
-
"use strict";
|
|
114433
|
-
}
|
|
114434
|
-
});
|
|
114435
|
-
|
|
114436
114578
|
// detox/launch-permissions.ts
|
|
114437
114579
|
function buildPermissionSeedScript(seed) {
|
|
114438
114580
|
const inbox = JSON.stringify(PERMISSION_BOOT_SEED_STORAGE_KEY);
|
|
@@ -116543,7 +116685,7 @@ function macDesktopLaunchHome(bridgePort) {
|
|
|
116543
116685
|
(lock) => lock.bridgePort === bridgePort && isDevBridgeLockfileFresh(lock)
|
|
116544
116686
|
);
|
|
116545
116687
|
const homeKey = (0, import_node_crypto76.createHash)("sha256").update(home).digest("hex");
|
|
116546
|
-
const dir = (0, import_path7.join)((0,
|
|
116688
|
+
const dir = (0, import_path7.join)((0, import_os4.tmpdir)(), "peach-desktop-launch", homeKey, String(bridgePort));
|
|
116547
116689
|
(0, import_fs8.mkdirSync)(dir, { recursive: true });
|
|
116548
116690
|
if ((0, import_fs8.existsSync)(home)) {
|
|
116549
116691
|
for (const name3 of (0, import_fs8.readdirSync)(home)) {
|
|
@@ -116648,14 +116790,14 @@ function buildMacLaunchUrl(url, opts, nativeApp = false) {
|
|
|
116648
116790
|
}
|
|
116649
116791
|
return deepLink.toString();
|
|
116650
116792
|
}
|
|
116651
|
-
var import_child_process6, import_fs8, import_node_crypto76,
|
|
116793
|
+
var import_child_process6, import_fs8, import_node_crypto76, import_os4, import_path7, import_url2, import_meta2, _sootsimRoot;
|
|
116652
116794
|
var init_desktop_companion = __esm({
|
|
116653
116795
|
"cli/desktop-companion.ts"() {
|
|
116654
116796
|
"use strict";
|
|
116655
116797
|
import_child_process6 = require("child_process");
|
|
116656
116798
|
import_fs8 = require("fs");
|
|
116657
116799
|
import_node_crypto76 = require("node:crypto");
|
|
116658
|
-
|
|
116800
|
+
import_os4 = require("os");
|
|
116659
116801
|
import_path7 = require("path");
|
|
116660
116802
|
import_url2 = require("url");
|
|
116661
116803
|
init_desktop_host_delivery();
|
|
@@ -117209,7 +117351,7 @@ async function launch(opts) {
|
|
|
117209
117351
|
}
|
|
117210
117352
|
}
|
|
117211
117353
|
const cdpPort = requestedCdpPort ?? await freePort();
|
|
117212
|
-
const errLog = (0, import_path8.join)((0,
|
|
117354
|
+
const errLog = (0, import_path8.join)((0, import_os5.tmpdir)(), playwrightHostLogName(Date.now(), process.pid));
|
|
117213
117355
|
const connectAckFile = `${errLog}.connected`;
|
|
117214
117356
|
const admittedFile = `${errLog}.admitted`;
|
|
117215
117357
|
const completionFile = `${errLog}.completed`;
|
|
@@ -117279,14 +117421,14 @@ async function launch(opts) {
|
|
|
117279
117421
|
(0, import_fs9.closeSync)(errFd);
|
|
117280
117422
|
}
|
|
117281
117423
|
}
|
|
117282
|
-
var import_child_process7, import_fs9, import_net3,
|
|
117424
|
+
var import_child_process7, import_fs9, import_net3, import_os5, import_path8, playwrightDriver;
|
|
117283
117425
|
var init_playwright = __esm({
|
|
117284
117426
|
"cli/drivers/playwright.ts"() {
|
|
117285
117427
|
"use strict";
|
|
117286
117428
|
import_child_process7 = require("child_process");
|
|
117287
117429
|
import_fs9 = require("fs");
|
|
117288
117430
|
import_net3 = require("net");
|
|
117289
|
-
|
|
117431
|
+
import_os5 = require("os");
|
|
117290
117432
|
import_path8 = require("path");
|
|
117291
117433
|
init_bridge_constants();
|
|
117292
117434
|
init_cli_version();
|
|
@@ -117709,11 +117851,11 @@ function option(flag, description, hidden) {
|
|
|
117709
117851
|
function example(command, description, hidden) {
|
|
117710
117852
|
return hidden ? { command, description, hidden } : { command, description };
|
|
117711
117853
|
}
|
|
117712
|
-
function
|
|
117854
|
+
function verb2(v7, description, usage, examples, notes, extras) {
|
|
117713
117855
|
return { verb: v7, description, usage, examples, notes, ...extras };
|
|
117714
117856
|
}
|
|
117715
|
-
function inspectVerbPathKey(group,
|
|
117716
|
-
return `${group ?? ""}:${
|
|
117857
|
+
function inspectVerbPathKey(group, verb3) {
|
|
117858
|
+
return `${group ?? ""}:${verb3}`;
|
|
117717
117859
|
}
|
|
117718
117860
|
var REDACT_OPTION, cliCommandMetas, cliCommandMetaById, cliCommandMetaByName, cliInspectVerbMetas, cliInspectVerbMetasByVerb, cliInspectVerbMetaByPath, cliInspectVerbMetaByVerb;
|
|
117719
117861
|
var init_meta = __esm({
|
|
@@ -120158,7 +120300,7 @@ var init_meta = __esm({
|
|
|
120158
120300
|
}
|
|
120159
120301
|
}
|
|
120160
120302
|
cliInspectVerbMetas = [
|
|
120161
|
-
|
|
120303
|
+
verb2(
|
|
120162
120304
|
"describe",
|
|
120163
120305
|
"show visible UI elements with type, text, position, size, and style. formats the pruned visible semantic tree.",
|
|
120164
120306
|
[
|
|
@@ -120206,7 +120348,7 @@ var init_meta = __esm({
|
|
|
120206
120348
|
seeAlso: ["tree", "a11y", "find"]
|
|
120207
120349
|
}
|
|
120208
120350
|
),
|
|
120209
|
-
|
|
120351
|
+
verb2(
|
|
120210
120352
|
"find",
|
|
120211
120353
|
"unified finder (text, testid, role, type, pressable, visible, interactive-targets)",
|
|
120212
120354
|
[
|
|
@@ -120261,7 +120403,7 @@ var init_meta = __esm({
|
|
|
120261
120403
|
seeAlso: ["describe", "node", "selector"]
|
|
120262
120404
|
}
|
|
120263
120405
|
),
|
|
120264
|
-
|
|
120406
|
+
verb2(
|
|
120265
120407
|
"count",
|
|
120266
120408
|
"show total node count",
|
|
120267
120409
|
["peach get count [--json]"],
|
|
@@ -120274,7 +120416,7 @@ var init_meta = __esm({
|
|
|
120274
120416
|
options: [option("--json", "emit { nodes: n } for scripts")]
|
|
120275
120417
|
}
|
|
120276
120418
|
),
|
|
120277
|
-
|
|
120419
|
+
verb2(
|
|
120278
120420
|
"layout",
|
|
120279
120421
|
"measure layout: bare for every visible element on the screen (box + radius/padding/fontSize), or with an id for one node",
|
|
120280
120422
|
["peach get layout [id] [--json]"],
|
|
@@ -120298,7 +120440,7 @@ var init_meta = __esm({
|
|
|
120298
120440
|
seeAlso: ["describe", "find", "node"]
|
|
120299
120441
|
}
|
|
120300
120442
|
),
|
|
120301
|
-
|
|
120443
|
+
verb2(
|
|
120302
120444
|
"tree",
|
|
120303
120445
|
"dump the node tree",
|
|
120304
120446
|
["peach get tree [depth] [--json] [--boxes]"],
|
|
@@ -120320,7 +120462,7 @@ var init_meta = __esm({
|
|
|
120320
120462
|
seeAlso: ["describe", "a11y", "node"]
|
|
120321
120463
|
}
|
|
120322
120464
|
),
|
|
120323
|
-
|
|
120465
|
+
verb2(
|
|
120324
120466
|
"a11y",
|
|
120325
120467
|
"dump the accessibility tree with roles and labels",
|
|
120326
120468
|
["peach get a11y [depth]"],
|
|
@@ -120333,7 +120475,7 @@ var init_meta = __esm({
|
|
|
120333
120475
|
seeAlso: ["describe", "tree", "layout"]
|
|
120334
120476
|
}
|
|
120335
120477
|
),
|
|
120336
|
-
|
|
120478
|
+
verb2(
|
|
120337
120479
|
"node",
|
|
120338
120480
|
"resolve testID/id/text to a full node JSON",
|
|
120339
120481
|
["peach get node <matcher>"],
|
|
@@ -120346,7 +120488,7 @@ var init_meta = __esm({
|
|
|
120346
120488
|
seeAlso: ["find", "layout"]
|
|
120347
120489
|
}
|
|
120348
120490
|
),
|
|
120349
|
-
|
|
120491
|
+
verb2(
|
|
120350
120492
|
"tap",
|
|
120351
120493
|
"tap a testID, absolute coordinates, or a node resolved from --testid / --text",
|
|
120352
120494
|
[
|
|
@@ -120370,7 +120512,7 @@ var init_meta = __esm({
|
|
|
120370
120512
|
order: 10
|
|
120371
120513
|
}
|
|
120372
120514
|
),
|
|
120373
|
-
|
|
120515
|
+
verb2(
|
|
120374
120516
|
"double-tap",
|
|
120375
120517
|
"tap the same spot twice with a short gap",
|
|
120376
120518
|
[
|
|
@@ -120392,7 +120534,7 @@ var init_meta = __esm({
|
|
|
120392
120534
|
order: 20
|
|
120393
120535
|
}
|
|
120394
120536
|
),
|
|
120395
|
-
|
|
120537
|
+
verb2(
|
|
120396
120538
|
"tap-text",
|
|
120397
120539
|
"find a node by text content and tap its center",
|
|
120398
120540
|
[
|
|
@@ -120428,7 +120570,7 @@ var init_meta = __esm({
|
|
|
120428
120570
|
order: 30
|
|
120429
120571
|
}
|
|
120430
120572
|
),
|
|
120431
|
-
|
|
120573
|
+
verb2(
|
|
120432
120574
|
"tap-id",
|
|
120433
120575
|
"alias of `tap <testid>` that always reads its argument as a testID, numeric ids included",
|
|
120434
120576
|
["peach do tap-id <id>"],
|
|
@@ -120442,7 +120584,7 @@ var init_meta = __esm({
|
|
|
120442
120584
|
order: 40
|
|
120443
120585
|
}
|
|
120444
120586
|
),
|
|
120445
|
-
|
|
120587
|
+
verb2(
|
|
120446
120588
|
"tap-best",
|
|
120447
120589
|
"tap by query: try testID first, then visible text. one command, two strategies",
|
|
120448
120590
|
["peach do tap-best <query>"],
|
|
@@ -120462,7 +120604,7 @@ var init_meta = __esm({
|
|
|
120462
120604
|
order: 41
|
|
120463
120605
|
}
|
|
120464
120606
|
),
|
|
120465
|
-
|
|
120607
|
+
verb2(
|
|
120466
120608
|
"scan",
|
|
120467
120609
|
"inject a synthetic barcode scan into the active expo-camera scan session",
|
|
120468
120610
|
["peach do scan <text> [--format <web-format>]"],
|
|
@@ -120485,7 +120627,7 @@ var init_meta = __esm({
|
|
|
120485
120627
|
order: 10
|
|
120486
120628
|
}
|
|
120487
120629
|
),
|
|
120488
|
-
|
|
120630
|
+
verb2(
|
|
120489
120631
|
"type",
|
|
120490
120632
|
"type text through the iOS keyboard (requires a focused input)",
|
|
120491
120633
|
["peach do type <text>"],
|
|
@@ -120499,7 +120641,7 @@ var init_meta = __esm({
|
|
|
120499
120641
|
order: 10
|
|
120500
120642
|
}
|
|
120501
120643
|
),
|
|
120502
|
-
|
|
120644
|
+
verb2(
|
|
120503
120645
|
"type-into",
|
|
120504
120646
|
"find an input by testID, tap to focus, then type text",
|
|
120505
120647
|
["peach do type-into <id> <text>"],
|
|
@@ -120513,7 +120655,7 @@ var init_meta = __esm({
|
|
|
120513
120655
|
order: 20
|
|
120514
120656
|
}
|
|
120515
120657
|
),
|
|
120516
|
-
|
|
120658
|
+
verb2(
|
|
120517
120659
|
"key",
|
|
120518
120660
|
"press a special keyboard key",
|
|
120519
120661
|
["peach do key <name>"],
|
|
@@ -120527,7 +120669,7 @@ var init_meta = __esm({
|
|
|
120527
120669
|
order: 30
|
|
120528
120670
|
}
|
|
120529
120671
|
),
|
|
120530
|
-
|
|
120672
|
+
verb2(
|
|
120531
120673
|
"key-sequence",
|
|
120532
120674
|
"press multiple visual keyboard keys in order",
|
|
120533
120675
|
["peach do key-sequence <key> [<key> ...]"],
|
|
@@ -120541,7 +120683,7 @@ var init_meta = __esm({
|
|
|
120541
120683
|
order: 40
|
|
120542
120684
|
}
|
|
120543
120685
|
),
|
|
120544
|
-
|
|
120686
|
+
verb2(
|
|
120545
120687
|
"keycode",
|
|
120546
120688
|
"press DOM-style key codes through the visual keyboard",
|
|
120547
120689
|
["peach do keycode <code> [<code> ...]"],
|
|
@@ -120555,13 +120697,13 @@ var init_meta = __esm({
|
|
|
120555
120697
|
order: 50
|
|
120556
120698
|
}
|
|
120557
120699
|
),
|
|
120558
|
-
|
|
120700
|
+
verb2("dismiss", "dismiss the keyboard", ["peach do dismiss"], void 0, void 0, {
|
|
120559
120701
|
group: "do",
|
|
120560
120702
|
subgroup: "text input",
|
|
120561
120703
|
shortDescription: "dismiss the iOS keyboard",
|
|
120562
120704
|
order: 60
|
|
120563
120705
|
}),
|
|
120564
|
-
|
|
120706
|
+
verb2(
|
|
120565
120707
|
"scroll",
|
|
120566
120708
|
"scroll a scrollview by testID",
|
|
120567
120709
|
["peach do scroll <id> <x> <y>", "peach do scroll --testid <id> <x> <y>"],
|
|
@@ -120578,7 +120720,7 @@ var init_meta = __esm({
|
|
|
120578
120720
|
order: 10
|
|
120579
120721
|
}
|
|
120580
120722
|
),
|
|
120581
|
-
|
|
120723
|
+
verb2(
|
|
120582
120724
|
"drag",
|
|
120583
120725
|
"drag from one point to another using real PointerEvent dispatch",
|
|
120584
120726
|
["peach do drag <x1> <y1> <x2> <y2> [steps] [stepMs]"],
|
|
@@ -120592,7 +120734,7 @@ var init_meta = __esm({
|
|
|
120592
120734
|
order: 20
|
|
120593
120735
|
}
|
|
120594
120736
|
),
|
|
120595
|
-
|
|
120737
|
+
verb2(
|
|
120596
120738
|
"swipe",
|
|
120597
120739
|
"swipe gesture (drag with fewer steps)",
|
|
120598
120740
|
["peach do swipe <x1> <y1> <x2> <y2> [steps] [stepMs]"],
|
|
@@ -120606,7 +120748,7 @@ var init_meta = __esm({
|
|
|
120606
120748
|
order: 30
|
|
120607
120749
|
}
|
|
120608
120750
|
),
|
|
120609
|
-
|
|
120751
|
+
verb2(
|
|
120610
120752
|
"long-press",
|
|
120611
120753
|
"hold a press on a testID or at coordinates",
|
|
120612
120754
|
[
|
|
@@ -120628,7 +120770,7 @@ var init_meta = __esm({
|
|
|
120628
120770
|
order: 40
|
|
120629
120771
|
}
|
|
120630
120772
|
),
|
|
120631
|
-
|
|
120773
|
+
verb2(
|
|
120632
120774
|
"touch",
|
|
120633
120775
|
"low-level touch primitives; a pointer lives within one batch, so chain its phases with --then",
|
|
120634
120776
|
["peach do touch <down|move|up|cancel> <x> <y> [pointerId] --then touch ..."],
|
|
@@ -120646,7 +120788,7 @@ var init_meta = __esm({
|
|
|
120646
120788
|
order: 50
|
|
120647
120789
|
}
|
|
120648
120790
|
),
|
|
120649
|
-
|
|
120791
|
+
verb2(
|
|
120650
120792
|
"gesture",
|
|
120651
120793
|
"preset gestures such as scrolls and edge swipes",
|
|
120652
120794
|
["peach do gesture <preset> [durationMs]"],
|
|
@@ -120668,7 +120810,7 @@ var init_meta = __esm({
|
|
|
120668
120810
|
order: 60
|
|
120669
120811
|
}
|
|
120670
120812
|
),
|
|
120671
|
-
|
|
120813
|
+
verb2(
|
|
120672
120814
|
"pinch",
|
|
120673
120815
|
"two-pointer pinch helper",
|
|
120674
120816
|
["peach do pinch <x1> <y1> <x2> <y2> <x1'> <y1'> <x2'> <y2'> [steps] [stepMs]"],
|
|
@@ -120682,7 +120824,7 @@ var init_meta = __esm({
|
|
|
120682
120824
|
order: 70
|
|
120683
120825
|
}
|
|
120684
120826
|
),
|
|
120685
|
-
|
|
120827
|
+
verb2(
|
|
120686
120828
|
"state",
|
|
120687
120829
|
"dump raw runtime state (shell, worker, keyboard, node, scroll, hit, gesture, ownership)",
|
|
120688
120830
|
[
|
|
@@ -120719,7 +120861,7 @@ var init_meta = __esm({
|
|
|
120719
120861
|
),
|
|
120720
120862
|
// `shell` is a top-level command; its help comes from the CliCommandMeta
|
|
120721
120863
|
// entry above, not a verb meta. see renderCliCommandHelp dispatch.
|
|
120722
|
-
|
|
120864
|
+
verb2(
|
|
120723
120865
|
"js",
|
|
120724
120866
|
"evaluate javascript in the browser context",
|
|
120725
120867
|
["peach debug js <expression> [--tenant]"],
|
|
@@ -120737,7 +120879,7 @@ var init_meta = __esm({
|
|
|
120737
120879
|
seeAlso: ["state"]
|
|
120738
120880
|
}
|
|
120739
120881
|
),
|
|
120740
|
-
|
|
120882
|
+
verb2(
|
|
120741
120883
|
"errors",
|
|
120742
120884
|
"show recent console errors",
|
|
120743
120885
|
["peach get errors [n|clear] [--json]"],
|
|
@@ -120755,7 +120897,7 @@ var init_meta = __esm({
|
|
|
120755
120897
|
seeAlso: ["warnings", "requests", "logs"]
|
|
120756
120898
|
}
|
|
120757
120899
|
),
|
|
120758
|
-
|
|
120900
|
+
verb2(
|
|
120759
120901
|
"warnings",
|
|
120760
120902
|
"show recent console warnings",
|
|
120761
120903
|
["peach get warnings [n] [--json]"],
|
|
@@ -120769,7 +120911,7 @@ var init_meta = __esm({
|
|
|
120769
120911
|
seeAlso: ["errors", "logs"]
|
|
120770
120912
|
}
|
|
120771
120913
|
),
|
|
120772
|
-
|
|
120914
|
+
verb2(
|
|
120773
120915
|
"requests",
|
|
120774
120916
|
"show recent failed network requests",
|
|
120775
120917
|
["peach get requests [n|all n|clear] [--json]"],
|
|
@@ -120787,7 +120929,7 @@ var init_meta = __esm({
|
|
|
120787
120929
|
seeAlso: ["errors", "network"]
|
|
120788
120930
|
}
|
|
120789
120931
|
),
|
|
120790
|
-
|
|
120932
|
+
verb2(
|
|
120791
120933
|
"diagnosis",
|
|
120792
120934
|
'composed "what just went wrong?" report',
|
|
120793
120935
|
["peach get diagnosis [--since <duration>] [--include <csv>] [--json]"],
|
|
@@ -120814,7 +120956,7 @@ var init_meta = __esm({
|
|
|
120814
120956
|
seeAlso: ["errors", "warnings", "requests", "network"]
|
|
120815
120957
|
}
|
|
120816
120958
|
),
|
|
120817
|
-
|
|
120959
|
+
verb2(
|
|
120818
120960
|
"animations",
|
|
120819
120961
|
"list every active animation with id, kind, progress, and current value",
|
|
120820
120962
|
["peach get animations", "peach get animations --json"],
|
|
@@ -120830,7 +120972,7 @@ var init_meta = __esm({
|
|
|
120830
120972
|
seeAlso: ["animation", "stop-animation", "state"]
|
|
120831
120973
|
}
|
|
120832
120974
|
),
|
|
120833
|
-
|
|
120975
|
+
verb2(
|
|
120834
120976
|
"animation",
|
|
120835
120977
|
"full detail for a single active animation by id",
|
|
120836
120978
|
["peach get animation <id>"],
|
|
@@ -120843,7 +120985,7 @@ var init_meta = __esm({
|
|
|
120843
120985
|
seeAlso: ["animations", "stop-animation"]
|
|
120844
120986
|
}
|
|
120845
120987
|
),
|
|
120846
|
-
|
|
120988
|
+
verb2(
|
|
120847
120989
|
"state",
|
|
120848
120990
|
"runtime dashboard: url, active animation counts, diagnostics, shell scene",
|
|
120849
120991
|
["peach get state"],
|
|
@@ -120856,7 +120998,7 @@ var init_meta = __esm({
|
|
|
120856
120998
|
seeAlso: ["animations", "errors", "keyboard"]
|
|
120857
120999
|
}
|
|
120858
121000
|
),
|
|
120859
|
-
|
|
121001
|
+
verb2(
|
|
120860
121002
|
"memory",
|
|
120861
121003
|
"per-worker live object counts (nodes, paragraphs, yoga nodes, pictures, raster images) + image cache + JS heaps; --watch samples over time and reports per-counter slopes",
|
|
120862
121004
|
[
|
|
@@ -120888,7 +121030,7 @@ var init_meta = __esm({
|
|
|
120888
121030
|
seeAlso: ["state", "perf"]
|
|
120889
121031
|
}
|
|
120890
121032
|
),
|
|
120891
|
-
|
|
121033
|
+
verb2(
|
|
120892
121034
|
"stop-animation",
|
|
120893
121035
|
"stop a running animation by id, or stop all active animations",
|
|
120894
121036
|
["peach do stop-animation <id|all>"],
|
|
@@ -120904,7 +121046,7 @@ var init_meta = __esm({
|
|
|
120904
121046
|
seeAlso: ["animations", "animation"]
|
|
120905
121047
|
}
|
|
120906
121048
|
),
|
|
120907
|
-
|
|
121049
|
+
verb2(
|
|
120908
121050
|
"trace",
|
|
120909
121051
|
"opt-in trace recorders: shell animation frames or per-tick animation values",
|
|
120910
121052
|
[
|
|
@@ -120926,7 +121068,7 @@ var init_meta = __esm({
|
|
|
120926
121068
|
seeAlso: ["animations", "animation", "stop-animation"]
|
|
120927
121069
|
}
|
|
120928
121070
|
),
|
|
120929
|
-
|
|
121071
|
+
verb2(
|
|
120930
121072
|
"image-audit",
|
|
120931
121073
|
"for every image the compositor actually drew, how many source pixels it landed on each device pixel",
|
|
120932
121074
|
["peach debug image-audit [--min <ratio>] [--all] [--json]"],
|
|
@@ -120955,7 +121097,7 @@ var init_meta = __esm({
|
|
|
120955
121097
|
seeAlso: ["screenshot", "memory"]
|
|
120956
121098
|
}
|
|
120957
121099
|
),
|
|
120958
|
-
|
|
121100
|
+
verb2(
|
|
120959
121101
|
"snapshot",
|
|
120960
121102
|
"capture a tree snapshot (layout + transform + opacity) for later diffing",
|
|
120961
121103
|
["peach debug snapshot [label]"],
|
|
@@ -120972,7 +121114,7 @@ var init_meta = __esm({
|
|
|
120972
121114
|
seeAlso: ["snapshots", "diff", "state"]
|
|
120973
121115
|
}
|
|
120974
121116
|
),
|
|
120975
|
-
|
|
121117
|
+
verb2(
|
|
120976
121118
|
"snapshots",
|
|
120977
121119
|
"list the labels of every captured tree snapshot",
|
|
120978
121120
|
["peach debug snapshots"],
|
|
@@ -120985,7 +121127,7 @@ var init_meta = __esm({
|
|
|
120985
121127
|
seeAlso: ["snapshot", "diff"]
|
|
120986
121128
|
}
|
|
120987
121129
|
),
|
|
120988
|
-
|
|
121130
|
+
verb2(
|
|
120989
121131
|
"diff",
|
|
120990
121132
|
"compare two captured snapshots: added / removed / changed nodes",
|
|
120991
121133
|
["peach debug diff <labelA> <labelB>"],
|
|
@@ -121003,7 +121145,7 @@ var init_meta = __esm({
|
|
|
121003
121145
|
seeAlso: ["snapshot", "snapshots", "clear-snapshots"]
|
|
121004
121146
|
}
|
|
121005
121147
|
),
|
|
121006
|
-
|
|
121148
|
+
verb2(
|
|
121007
121149
|
"clear-snapshots",
|
|
121008
121150
|
"drop a labeled snapshot (or all snapshots if no label is given)",
|
|
121009
121151
|
["peach debug clear-snapshots [label]"],
|
|
@@ -121019,7 +121161,7 @@ var init_meta = __esm({
|
|
|
121019
121161
|
seeAlso: ["snapshot", "snapshots", "diff"]
|
|
121020
121162
|
}
|
|
121021
121163
|
),
|
|
121022
|
-
|
|
121164
|
+
verb2(
|
|
121023
121165
|
"find",
|
|
121024
121166
|
"dump engine-internal nodes by category (e.g. all Sheet.Frame portals)",
|
|
121025
121167
|
["peach debug find sheets", "peach debug find portals"],
|
|
@@ -121042,7 +121184,7 @@ var init_meta = __esm({
|
|
|
121042
121184
|
seeAlso: ["state", "describe"]
|
|
121043
121185
|
}
|
|
121044
121186
|
),
|
|
121045
|
-
|
|
121187
|
+
verb2(
|
|
121046
121188
|
"record",
|
|
121047
121189
|
"toggle the debug event ring buffer (off / on)",
|
|
121048
121190
|
["peach debug record [on|off]"],
|
|
@@ -121059,7 +121201,7 @@ var init_meta = __esm({
|
|
|
121059
121201
|
seeAlso: ["recent", "clear-events"]
|
|
121060
121202
|
}
|
|
121061
121203
|
),
|
|
121062
|
-
|
|
121204
|
+
verb2(
|
|
121063
121205
|
"recent",
|
|
121064
121206
|
"tail the last N events from the debug ring buffer (optionally filtered by channel)",
|
|
121065
121207
|
[
|
|
@@ -121084,7 +121226,7 @@ var init_meta = __esm({
|
|
|
121084
121226
|
seeAlso: ["record", "clear-events"]
|
|
121085
121227
|
}
|
|
121086
121228
|
),
|
|
121087
|
-
|
|
121229
|
+
verb2(
|
|
121088
121230
|
"clear-events",
|
|
121089
121231
|
"drop everything currently in the debug event ring buffer",
|
|
121090
121232
|
["peach debug clear-events"],
|
|
@@ -121097,7 +121239,7 @@ var init_meta = __esm({
|
|
|
121097
121239
|
seeAlso: ["record", "recent"]
|
|
121098
121240
|
}
|
|
121099
121241
|
),
|
|
121100
|
-
|
|
121242
|
+
verb2(
|
|
121101
121243
|
"sample-color",
|
|
121102
121244
|
"average the canvas color over a pixel or rect; returns hex + rgba",
|
|
121103
121245
|
[
|
|
@@ -121126,7 +121268,7 @@ var init_meta = __esm({
|
|
|
121126
121268
|
seeAlso: ["screenshot"]
|
|
121127
121269
|
}
|
|
121128
121270
|
),
|
|
121129
|
-
|
|
121271
|
+
verb2(
|
|
121130
121272
|
"screenshot",
|
|
121131
121273
|
"capture the canvas (full or a cropped area) as PNG",
|
|
121132
121274
|
[
|
|
@@ -121152,7 +121294,7 @@ var init_meta = __esm({
|
|
|
121152
121294
|
seeAlso: ["sample-color", "record"]
|
|
121153
121295
|
}
|
|
121154
121296
|
),
|
|
121155
|
-
|
|
121297
|
+
verb2(
|
|
121156
121298
|
"url",
|
|
121157
121299
|
"show the current page URL",
|
|
121158
121300
|
["peach get url [--json]"],
|
|
@@ -121165,7 +121307,7 @@ var init_meta = __esm({
|
|
|
121165
121307
|
options: [option("--json", "emit { url } for scripts")]
|
|
121166
121308
|
}
|
|
121167
121309
|
),
|
|
121168
|
-
|
|
121310
|
+
verb2(
|
|
121169
121311
|
"reload",
|
|
121170
121312
|
"reload the page and wait for reconnection",
|
|
121171
121313
|
["peach do reload"],
|
|
@@ -121179,7 +121321,7 @@ var init_meta = __esm({
|
|
|
121179
121321
|
order: 10
|
|
121180
121322
|
}
|
|
121181
121323
|
),
|
|
121182
|
-
|
|
121324
|
+
verb2(
|
|
121183
121325
|
"globals",
|
|
121184
121326
|
"list all __sootsim* globals available in the browser",
|
|
121185
121327
|
["peach get globals"],
|
|
@@ -121191,7 +121333,7 @@ var init_meta = __esm({
|
|
|
121191
121333
|
shortDescription: "list available __sootsim* globals"
|
|
121192
121334
|
}
|
|
121193
121335
|
),
|
|
121194
|
-
|
|
121336
|
+
verb2(
|
|
121195
121337
|
"sleep",
|
|
121196
121338
|
"simple local pause between commands",
|
|
121197
121339
|
["peach do sleep [seconds]"],
|
|
@@ -121205,7 +121347,7 @@ var init_meta = __esm({
|
|
|
121205
121347
|
order: 40
|
|
121206
121348
|
}
|
|
121207
121349
|
),
|
|
121208
|
-
|
|
121350
|
+
verb2(
|
|
121209
121351
|
"wait",
|
|
121210
121352
|
"wait for the current sim to reconnect",
|
|
121211
121353
|
["peach do wait [seconds]"],
|
|
@@ -121219,7 +121361,7 @@ var init_meta = __esm({
|
|
|
121219
121361
|
order: 20
|
|
121220
121362
|
}
|
|
121221
121363
|
),
|
|
121222
|
-
|
|
121364
|
+
verb2(
|
|
121223
121365
|
"settle",
|
|
121224
121366
|
"wait until the visible layout is stable (default max 3s)",
|
|
121225
121367
|
["peach do settle [seconds] [--strict]"],
|
|
@@ -121239,7 +121381,7 @@ var init_meta = __esm({
|
|
|
121239
121381
|
order: 30
|
|
121240
121382
|
}
|
|
121241
121383
|
),
|
|
121242
|
-
|
|
121384
|
+
verb2(
|
|
121243
121385
|
"ready",
|
|
121244
121386
|
"block until the guest app bundle is loaded and painted",
|
|
121245
121387
|
["peach wait ready [--max-ms <ms>] [--painted]"],
|
|
@@ -121266,7 +121408,7 @@ var init_meta = __esm({
|
|
|
121266
121408
|
order: 10
|
|
121267
121409
|
}
|
|
121268
121410
|
),
|
|
121269
|
-
|
|
121411
|
+
verb2(
|
|
121270
121412
|
"idle",
|
|
121271
121413
|
"block until animations, rAF queue, and layout are all settled",
|
|
121272
121414
|
["peach wait idle [--max-ms <ms>] [--strict]"],
|
|
@@ -121283,7 +121425,7 @@ var init_meta = __esm({
|
|
|
121283
121425
|
order: 20
|
|
121284
121426
|
}
|
|
121285
121427
|
),
|
|
121286
|
-
|
|
121428
|
+
verb2(
|
|
121287
121429
|
"selector",
|
|
121288
121430
|
"block until a node with <testid> or --text is visible with non-zero layout (or absent with --gone)",
|
|
121289
121431
|
[
|
|
@@ -121326,7 +121468,7 @@ var init_meta = __esm({
|
|
|
121326
121468
|
order: 30
|
|
121327
121469
|
}
|
|
121328
121470
|
),
|
|
121329
|
-
|
|
121471
|
+
verb2(
|
|
121330
121472
|
"event",
|
|
121331
121473
|
"block until a semantic timeline event of <kind> appears",
|
|
121332
121474
|
[
|
|
@@ -121370,7 +121512,7 @@ var init_meta = __esm({
|
|
|
121370
121512
|
order: 40
|
|
121371
121513
|
}
|
|
121372
121514
|
),
|
|
121373
|
-
|
|
121515
|
+
verb2(
|
|
121374
121516
|
"dispatch",
|
|
121375
121517
|
"dispatch a raw keyboard key (bypasses visual shift state)",
|
|
121376
121518
|
["peach do dispatch <char>"],
|
|
@@ -121384,7 +121526,7 @@ var init_meta = __esm({
|
|
|
121384
121526
|
order: 70
|
|
121385
121527
|
}
|
|
121386
121528
|
),
|
|
121387
|
-
|
|
121529
|
+
verb2(
|
|
121388
121530
|
"keyboard",
|
|
121389
121531
|
"on-screen keyboard state (type, returnKey, autoCap, mode, shift, accessory)",
|
|
121390
121532
|
["peach get keyboard [--json]"],
|
|
@@ -121398,7 +121540,7 @@ var init_meta = __esm({
|
|
|
121398
121540
|
seeAlso: ["type", "dismiss", "state"]
|
|
121399
121541
|
}
|
|
121400
121542
|
),
|
|
121401
|
-
|
|
121543
|
+
verb2(
|
|
121402
121544
|
"screens",
|
|
121403
121545
|
"list the current tenant route, navigation stack, active app, modal stack, and keyboard",
|
|
121404
121546
|
["peach get screens [--json]"],
|
|
@@ -121425,8 +121567,8 @@ var init_meta = __esm({
|
|
|
121425
121567
|
cliInspectVerbMetaByPath.set(inspectVerbPathKey(meta.group, meta.verb), meta);
|
|
121426
121568
|
}
|
|
121427
121569
|
cliInspectVerbMetaByVerb = new Map(
|
|
121428
|
-
Array.from(cliInspectVerbMetasByVerb, ([
|
|
121429
|
-
|
|
121570
|
+
Array.from(cliInspectVerbMetasByVerb, ([verb3, metas]) => [
|
|
121571
|
+
verb3,
|
|
121430
121572
|
metas.find((meta) => !meta.group) ?? metas[0]
|
|
121431
121573
|
])
|
|
121432
121574
|
);
|
|
@@ -121595,10 +121737,10 @@ function realPathOrSelf(p) {
|
|
|
121595
121737
|
}
|
|
121596
121738
|
}
|
|
121597
121739
|
function macPlistPath() {
|
|
121598
|
-
return (0, import_path9.resolve)((0,
|
|
121740
|
+
return (0, import_path9.resolve)((0, import_os6.homedir)(), "Library/LaunchAgents", `${SERVICE_LABEL_MAC}.plist`);
|
|
121599
121741
|
}
|
|
121600
121742
|
function linuxUnitPath() {
|
|
121601
|
-
return (0, import_path9.resolve)((0,
|
|
121743
|
+
return (0, import_path9.resolve)((0, import_os6.homedir)(), ".config/systemd/user", `${SERVICE_NAME_LINUX}.service`);
|
|
121602
121744
|
}
|
|
121603
121745
|
function getDaemonServiceStatus() {
|
|
121604
121746
|
if (shouldSkipPersistentDaemon()) return { supported: false, installed: false };
|
|
@@ -121863,13 +122005,13 @@ async function daemonRestart() {
|
|
|
121863
122005
|
console.error(` unsupported platform: ${process.platform}`);
|
|
121864
122006
|
peachExit(1);
|
|
121865
122007
|
}
|
|
121866
|
-
var import_child_process8, import_fs10,
|
|
122008
|
+
var import_child_process8, import_fs10, import_os6, import_path9, SERVICE_LABEL_MAC, SERVICE_NAME_LINUX, LOG_DIR, LOG_DIR_LINUX, LSOF;
|
|
121867
122009
|
var init_daemon = __esm({
|
|
121868
122010
|
"cli/commands/daemon.ts"() {
|
|
121869
122011
|
"use strict";
|
|
121870
122012
|
import_child_process8 = require("child_process");
|
|
121871
122013
|
import_fs10 = require("fs");
|
|
121872
|
-
|
|
122014
|
+
import_os6 = require("os");
|
|
121873
122015
|
import_path9 = require("path");
|
|
121874
122016
|
init_bridge_constants();
|
|
121875
122017
|
init_desktop_host_delivery();
|
|
@@ -121882,8 +122024,8 @@ var init_daemon = __esm({
|
|
|
121882
122024
|
init_daemon_mac_app();
|
|
121883
122025
|
SERVICE_LABEL_MAC = "dev.sootsim.daemon";
|
|
121884
122026
|
SERVICE_NAME_LINUX = "sootsim-daemon";
|
|
121885
|
-
LOG_DIR = (0, import_path9.resolve)((0,
|
|
121886
|
-
LOG_DIR_LINUX = (0, import_path9.resolve)((0,
|
|
122027
|
+
LOG_DIR = (0, import_path9.resolve)((0, import_os6.homedir)(), "Library/Logs/sootsim");
|
|
122028
|
+
LOG_DIR_LINUX = (0, import_path9.resolve)((0, import_os6.homedir)(), ".local/state/sootsim");
|
|
121887
122029
|
LSOF = process.platform === "darwin" ? "/usr/sbin/lsof" : "lsof";
|
|
121888
122030
|
}
|
|
121889
122031
|
});
|
|
@@ -122087,7 +122229,7 @@ examples:
|
|
|
122087
122229
|
}
|
|
122088
122230
|
console.log();
|
|
122089
122231
|
}
|
|
122090
|
-
const workDir = (0, import_path10.join)((0,
|
|
122232
|
+
const workDir = (0, import_path10.join)((0, import_os7.tmpdir)(), `peach-install-${Date.now()}`);
|
|
122091
122233
|
const downloadPath = (0, import_path10.join)(workDir, target.filename);
|
|
122092
122234
|
let lastDraw = 0;
|
|
122093
122235
|
process.stdout.write(` Downloading ${target.filename}...
|
|
@@ -122187,13 +122329,13 @@ async function installNativeHost(args, force) {
|
|
|
122187
122329
|
console.log(" peach desktop Launch the native desktop host");
|
|
122188
122330
|
console.log(" peach open <target> --driver desktop Open a demo or bundle in it");
|
|
122189
122331
|
}
|
|
122190
|
-
var import_child_process9, import_fs11,
|
|
122332
|
+
var import_child_process9, import_fs11, import_os7, import_path10, DOWNLOAD_BASE;
|
|
122191
122333
|
var init_install_desktop = __esm({
|
|
122192
122334
|
"cli/commands/install-desktop.ts"() {
|
|
122193
122335
|
"use strict";
|
|
122194
122336
|
import_child_process9 = require("child_process");
|
|
122195
122337
|
import_fs11 = require("fs");
|
|
122196
|
-
|
|
122338
|
+
import_os7 = require("os");
|
|
122197
122339
|
import_path10 = require("path");
|
|
122198
122340
|
init_desktop_host_delivery();
|
|
122199
122341
|
init_home_paths();
|
|
@@ -137331,16 +137473,16 @@ async function readKotlinApp(moduleArg, options) {
|
|
|
137331
137473
|
const name3 = element.attributes[`${ANDROID_NS}name`];
|
|
137332
137474
|
if (!name3) throw new Error(`${manifestFile}: <${element.name}> has no android:name`);
|
|
137333
137475
|
if (element.name === "activity") return className2(name3);
|
|
137334
|
-
const
|
|
137476
|
+
const targetName2 = element.attributes[`${ANDROID_NS}targetActivity`];
|
|
137335
137477
|
const activity = activities.find(
|
|
137336
|
-
(candidate) => className2(candidate.attributes[`${ANDROID_NS}name`] ?? "") === className2(
|
|
137478
|
+
(candidate) => className2(candidate.attributes[`${ANDROID_NS}name`] ?? "") === className2(targetName2 ?? "")
|
|
137337
137479
|
);
|
|
137338
|
-
if (!
|
|
137480
|
+
if (!targetName2 || !activity)
|
|
137339
137481
|
throw new Error(
|
|
137340
137482
|
`${manifestFile}: activity-alias ${name3} targets no declared activity`
|
|
137341
137483
|
);
|
|
137342
137484
|
if (!enabled(activity)) return null;
|
|
137343
|
-
return className2(
|
|
137485
|
+
return className2(targetName2);
|
|
137344
137486
|
};
|
|
137345
137487
|
const applicationEnabled = enabled(application);
|
|
137346
137488
|
let chosen;
|
|
@@ -142345,8 +142487,8 @@ function randomInputText(step) {
|
|
|
142345
142487
|
throw new Error("not a random input step");
|
|
142346
142488
|
}
|
|
142347
142489
|
}
|
|
142348
|
-
function normalizeBareStringStep(
|
|
142349
|
-
switch (
|
|
142490
|
+
function normalizeBareStringStep(verb3) {
|
|
142491
|
+
switch (verb3) {
|
|
142350
142492
|
case "back":
|
|
142351
142493
|
return { back: true };
|
|
142352
142494
|
case "hideKeyboard":
|
|
@@ -142373,7 +142515,7 @@ function normalizeBareStringStep(verb2) {
|
|
|
142373
142515
|
case "scrollUp":
|
|
142374
142516
|
return { scroll: { direction: "UP" } };
|
|
142375
142517
|
default:
|
|
142376
|
-
return { [
|
|
142518
|
+
return { [verb3]: true };
|
|
142377
142519
|
}
|
|
142378
142520
|
}
|
|
142379
142521
|
function parseFlowSteps(content) {
|