peachsim 0.1.2406 → 0.1.2409
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/agent-note.ts +231 -0
- package/cli/cloud-client.ts +8 -3
- package/cli/cloud-dispatch.ts +1 -1
- package/cli/command-agent.ts +122 -0
- package/cli/commands/agent.ts +29 -26
- package/cli/commands/stream.ts +11 -7
- package/cli/main.ts +16 -2
- package/cli/outbound-endpoints.ts +15 -0
- package/cli/ws-bridge.ts +4 -1
- package/dist-lib/agent-daemon-client.cjs +23 -3
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +205 -62
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +20 -1
- package/dist-lib/cloud-contract.mjs +18 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1630 -1513
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +203 -60
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +394 -102
- package/dist-lib/host/fetch-proxy-handler.cjs +5 -5
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +392 -272
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +5 -5
- package/dist-lib/native-app-identity-project.cjs +3 -3
- package/dist-lib/native-app-identity-project.mjs +3 -3
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +70 -60
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +1199 -821
- package/dist-lib/swift-compile.cjs +197 -55
- package/dist-lib/swift-compile.mjs +197 -55
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +213 -58
- package/dist-lib/vite.cjs +5 -5
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/replayBridgeContract.d.ts +7 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/skills/peach-setup/SKILL.md +8 -3
- package/src/agent-daemon-client.ts +35 -2
- package/src/agent-prompt.ts +68 -0
- package/src/bridge-contract.ts +4 -0
- package/src/canvas-agent-note-delivery.ts +83 -0
- package/src/cloud-contract.ts +30 -0
- package/src/host/agent-host.ts +128 -18
- package/src/swift-compile.ts +124 -66
- package/src/swift-host.ts +2 -1
- package/src/swift-objc-import.ts +99 -0
- package/src/swift-packages.ts +1 -0
- package/src/swift-shared-sdk.ts +2 -1
- package/src/xcode-header-search.ts +33 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2409 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
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;
|
|
@@ -16525,7 +16525,7 @@ var swiftCoverageProvenance;
|
|
|
16525
16525
|
var init_provenance = __esm({
|
|
16526
16526
|
"src/swift-coverage/provenance.ts"() {
|
|
16527
16527
|
"use strict";
|
|
16528
|
-
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":"
|
|
16528
|
+
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":"092e07d3f9154f5aaf9f7c668f16c933c3ac5d8c57e5c32df0222ae6f785eaf7","xcode-target-members.ts":"2f25aaf5a3aa34395983c75935491c06bd68554c47ff1cb06b49c79499c03db0","xcode-json-project.ts":"41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6","openstep-plist.ts":"74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3"}') : swiftCoverageSourceDigests((0, import_node_path.join)(__sootsim_import_meta_dirname, ".."));
|
|
16529
16529
|
}
|
|
16530
16530
|
});
|
|
16531
16531
|
|
|
@@ -25745,7 +25745,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk2)
|
|
|
25745
25745
|
const overlayFiles = (0, import_node_fs42.readdirSync)(overlay, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path41.default.join(entry.parentPath, entry.name)).sort();
|
|
25746
25746
|
const key2 = JSON.stringify([
|
|
25747
25747
|
// bump the recipe when the transformation changes; bundling changes function text.
|
|
25748
|
-
"
|
|
25748
|
+
"v25",
|
|
25749
25749
|
[...WEAKEN_FOUNDATION_SYMS],
|
|
25750
25750
|
toolchainBin,
|
|
25751
25751
|
sdk2,
|
|
@@ -25805,6 +25805,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk2)
|
|
|
25805
25805
|
"objc/NSObject.h",
|
|
25806
25806
|
"ObjectiveC.apinotes",
|
|
25807
25807
|
"net/if.h",
|
|
25808
|
+
"netinet/tcp.h",
|
|
25808
25809
|
"notify.h",
|
|
25809
25810
|
"notify.modulemap",
|
|
25810
25811
|
"module.modulemap",
|
|
@@ -33459,6 +33460,61 @@ function swiftClangImporterFlags(flags) {
|
|
|
33459
33460
|
(flag) => flag !== "-fobjc-arc" && flag !== "-fno-objc-arc" && !/^-std=(?:c(?!\+\+)|gnu(?!\+\+)|iso9899:)/.test(flag)
|
|
33460
33461
|
);
|
|
33461
33462
|
}
|
|
33463
|
+
function compactSwiftClangDefines(flags) {
|
|
33464
|
+
const definitions = /* @__PURE__ */ new Map();
|
|
33465
|
+
const macros = [];
|
|
33466
|
+
for (let index = 0; index < flags.length; index++) {
|
|
33467
|
+
if (flags[index].startsWith("@")) return flags;
|
|
33468
|
+
if (flags[index] !== "-Xcc") continue;
|
|
33469
|
+
const flag = flags[++index];
|
|
33470
|
+
if (flag === void 0 || flags[index - 2] === "-Xfrontend" || flag === "-Xclang" || flag === "-Xpreprocessor" || flag.startsWith("-Wp,") || flag.startsWith("--config") || flag.startsWith("@"))
|
|
33471
|
+
return flags;
|
|
33472
|
+
if (CLANG_PATH_OPTIONS.has(flag) && flags[index + 1] === "-Xcc") {
|
|
33473
|
+
index += 2;
|
|
33474
|
+
continue;
|
|
33475
|
+
}
|
|
33476
|
+
if (!flag.startsWith("-D") && !flag.startsWith("-U")) continue;
|
|
33477
|
+
const name3 = /^-[DU]([A-Za-z_$][\w$]*)(?=[(=]|$)/.exec(flag)?.[1];
|
|
33478
|
+
if (!name3) return flags;
|
|
33479
|
+
const previous = definitions.get(name3);
|
|
33480
|
+
definitions.set(name3, previous === void 0 || previous === flag ? flag : null);
|
|
33481
|
+
macros.push({ index, name: name3, flag });
|
|
33482
|
+
}
|
|
33483
|
+
const seen = /* @__PURE__ */ new Set();
|
|
33484
|
+
const duplicates = /* @__PURE__ */ new Set();
|
|
33485
|
+
for (const { index, name: name3, flag } of macros) {
|
|
33486
|
+
if (definitions.get(name3) !== flag) continue;
|
|
33487
|
+
if (seen.has(name3)) {
|
|
33488
|
+
duplicates.add(index - 1);
|
|
33489
|
+
duplicates.add(index);
|
|
33490
|
+
}
|
|
33491
|
+
seen.add(name3);
|
|
33492
|
+
}
|
|
33493
|
+
return duplicates.size === 0 ? flags : flags.filter((_, index) => !duplicates.has(index));
|
|
33494
|
+
}
|
|
33495
|
+
function compactSwiftClangOverlays(flags, generated) {
|
|
33496
|
+
if (generated.size === 0) return flags;
|
|
33497
|
+
const overlays = /* @__PURE__ */ new Map();
|
|
33498
|
+
const duplicates = /* @__PURE__ */ new Set();
|
|
33499
|
+
for (let index = 0; index < flags.length; index++) {
|
|
33500
|
+
const flag = flags[index];
|
|
33501
|
+
if (flag.startsWith("@")) return flags;
|
|
33502
|
+
if (flag === "-Xcc" && flags[index - 1] === "-Xfrontend") return flags;
|
|
33503
|
+
if (flags[index - 1] === "-Xcc" && (flag.startsWith("--config") || flag === "-Xclang"))
|
|
33504
|
+
return flags;
|
|
33505
|
+
if (!flag.startsWith("-ivfsoverlay") && !flag.startsWith("-vfsoverlay")) continue;
|
|
33506
|
+
if (flag !== "-ivfsoverlay" || flags[index - 1] !== "-Xcc" || flags[index + 1] !== "-Xcc")
|
|
33507
|
+
return flags;
|
|
33508
|
+
const file = flags[index + 2];
|
|
33509
|
+
if (file === void 0 || !generated.has(file)) return flags;
|
|
33510
|
+
const previous = overlays.get(file);
|
|
33511
|
+
if (previous !== void 0)
|
|
33512
|
+
for (let offset = -1; offset < 3; offset++) duplicates.add(previous + offset);
|
|
33513
|
+
overlays.set(file, index);
|
|
33514
|
+
index += 2;
|
|
33515
|
+
}
|
|
33516
|
+
return duplicates.size === 0 ? flags : flags.filter((_, index) => !duplicates.has(index));
|
|
33517
|
+
}
|
|
33462
33518
|
function swiftSubmoduleImports(sources) {
|
|
33463
33519
|
const imports2 = /* @__PURE__ */ new Map();
|
|
33464
33520
|
for (const source of sources)
|
|
@@ -33483,7 +33539,7 @@ function swiftObjCModuleMap(module2, headers, submodules = /* @__PURE__ */ new S
|
|
|
33483
33539
|
""
|
|
33484
33540
|
].join("\n");
|
|
33485
33541
|
}
|
|
33486
|
-
var SWIFT_OBJC_INTEROP_FLAGS, SWIFT_SUBMODULE_IMPORT;
|
|
33542
|
+
var SWIFT_OBJC_INTEROP_FLAGS, CLANG_PATH_OPTIONS, SWIFT_SUBMODULE_IMPORT;
|
|
33487
33543
|
var init_swift_objc_import = __esm({
|
|
33488
33544
|
"src/swift-objc-import.ts"() {
|
|
33489
33545
|
"use strict";
|
|
@@ -33497,6 +33553,23 @@ var init_swift_objc_import = __esm({
|
|
|
33497
33553
|
"-Xcc",
|
|
33498
33554
|
"-fblocks"
|
|
33499
33555
|
];
|
|
33556
|
+
CLANG_PATH_OPTIONS = /* @__PURE__ */ new Set([
|
|
33557
|
+
"-I",
|
|
33558
|
+
"-F",
|
|
33559
|
+
"-idirafter",
|
|
33560
|
+
"-iframework",
|
|
33561
|
+
"-iframeworkwithsysroot",
|
|
33562
|
+
"-imacros",
|
|
33563
|
+
"-include",
|
|
33564
|
+
"-iprefix",
|
|
33565
|
+
"-iquote",
|
|
33566
|
+
"-isystem",
|
|
33567
|
+
"-isysroot",
|
|
33568
|
+
"-ivfsoverlay",
|
|
33569
|
+
"-iwithprefix",
|
|
33570
|
+
"-iwithprefixbefore",
|
|
33571
|
+
"--sysroot"
|
|
33572
|
+
]);
|
|
33500
33573
|
SWIFT_SUBMODULE_IMPORT = /^[ \t]*(?:@\w+(?:\([^)]*\))?[ \t]+)*import[ \t]+([A-Za-z_]\w*)\.([A-Za-z_]\w*)[ \t]*(?:\/\/.*)?$/gm;
|
|
33501
33574
|
}
|
|
33502
33575
|
});
|
|
@@ -33866,6 +33939,30 @@ var init_swift_uniform_type_constants = __esm({
|
|
|
33866
33939
|
});
|
|
33867
33940
|
|
|
33868
33941
|
// src/xcode-header-search.ts
|
|
33942
|
+
function coalescibleHeaderOverlays(files2) {
|
|
33943
|
+
const aliases = /* @__PURE__ */ new Map();
|
|
33944
|
+
const key2 = (file) => file.replace(/[A-Z]/g, (letter) => letter.toLowerCase());
|
|
33945
|
+
const index = (directory2, entry) => {
|
|
33946
|
+
const name3 = import_node_path56.default.resolve(directory2, entry.name);
|
|
33947
|
+
if (entry.type === "directory")
|
|
33948
|
+
return entry.contents.every((child) => index(name3, child));
|
|
33949
|
+
const source = entry["external-contents"];
|
|
33950
|
+
const previous = aliases.get(key2(name3));
|
|
33951
|
+
if (previous !== void 0 && previous !== source) return false;
|
|
33952
|
+
aliases.set(key2(name3), source);
|
|
33953
|
+
return true;
|
|
33954
|
+
};
|
|
33955
|
+
for (const file of files2) {
|
|
33956
|
+
const overlay = JSON.parse(import_node_fs57.default.readFileSync(file, "utf8"));
|
|
33957
|
+
if (!overlay.roots.every((entry) => index(import_node_path56.default.dirname(file), entry)))
|
|
33958
|
+
return /* @__PURE__ */ new Set();
|
|
33959
|
+
}
|
|
33960
|
+
for (const file of [...files2, ...aliases.values()]) {
|
|
33961
|
+
const source = aliases.get(key2(import_node_path56.default.normalize(file)));
|
|
33962
|
+
if (source !== void 0 && source !== file) return /* @__PURE__ */ new Set();
|
|
33963
|
+
}
|
|
33964
|
+
return files2;
|
|
33965
|
+
}
|
|
33869
33966
|
function headerMap(entries) {
|
|
33870
33967
|
const unique = /* @__PURE__ */ new Map();
|
|
33871
33968
|
for (const entry of entries)
|
|
@@ -34790,6 +34887,15 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
|
|
|
34790
34887
|
)
|
|
34791
34888
|
);
|
|
34792
34889
|
const names = /* @__PURE__ */ new Set([...frameworks, ...targets.map((target) => target.name)]);
|
|
34890
|
+
const entriesByPrefix = new Map(
|
|
34891
|
+
targets.map(({ path: path118 }) => [path118 === "." ? "" : `${path118}/`, []])
|
|
34892
|
+
);
|
|
34893
|
+
for (const entry of Object.entries(files2)) {
|
|
34894
|
+
const [file] = entry;
|
|
34895
|
+
entriesByPrefix.get("")?.push(entry);
|
|
34896
|
+
for (let end = file.indexOf("/"); end !== -1; end = file.indexOf("/", end + 1))
|
|
34897
|
+
entriesByPrefix.get(file.slice(0, end + 1))?.push(entry);
|
|
34898
|
+
}
|
|
34793
34899
|
const siblings = /* @__PURE__ */ new Map();
|
|
34794
34900
|
for (const target of targets) {
|
|
34795
34901
|
const prefix = target.path === "." ? "" : `${target.path}/`;
|
|
@@ -34803,8 +34909,11 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
|
|
|
34803
34909
|
(dependency) => dependency.kind === "target" && dependency.name !== target.name && names.has(dependency.name) || dependency.kind === "product" && dependency.package === "sootsim-swift" && OPTIONAL_FRAMEWORKS.has(dependency.name) ? [dependency.name] : []
|
|
34804
34910
|
)
|
|
34805
34911
|
);
|
|
34806
|
-
|
|
34807
|
-
|
|
34912
|
+
const nested = target.sources === void 0 ? targets.flatMap(
|
|
34913
|
+
(candidate) => candidate.name !== target.name && candidate.path !== "." && candidate.path.startsWith(prefix) ? [`${candidate.path}/`] : []
|
|
34914
|
+
) : [];
|
|
34915
|
+
for (const [file, contents2] of entriesByPrefix.get(prefix) ?? []) {
|
|
34916
|
+
if (file === "Package.swift") continue;
|
|
34808
34917
|
const relative4 = file.slice(prefix.length);
|
|
34809
34918
|
if (target.sources !== void 0 && !target.sources.some(
|
|
34810
34919
|
(source) => source === "." || relative4 === source || relative4.startsWith(`${source}/`)
|
|
@@ -34814,10 +34923,7 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
|
|
|
34814
34923
|
(excluded) => relative4 === excluded || relative4.startsWith(`${excluded}/`)
|
|
34815
34924
|
))
|
|
34816
34925
|
continue;
|
|
34817
|
-
if (
|
|
34818
|
-
(candidate) => candidate.name !== target.name && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
|
|
34819
|
-
))
|
|
34820
|
-
continue;
|
|
34926
|
+
if (nested.some((path118) => file.startsWith(path118))) continue;
|
|
34821
34927
|
const imports2 = file.endsWith(".swift") ? swiftImportNames(contents2) : SWIFT_NATIVE_SOURCE_EXTENSIONS.some((extension) => file.endsWith(extension)) ? clangImportNames(contents2, ownsHeader) : [];
|
|
34822
34928
|
for (const name3 of imports2) {
|
|
34823
34929
|
if (names.has(name3) && name3 !== target.name && !(target.dependencies !== void 0 && localNames.has(name3)))
|
|
@@ -35062,7 +35168,9 @@ function emitSwiftPackageManifest(args) {
|
|
|
35062
35168
|
const flags = JSON.parse(literal4.replace(/,\s*]$/, "]")).filter(
|
|
35063
35169
|
(flag, index, all) => !mapsPackageModule(flag) && !(flag === "-Xcc" && mapsPackageModule(all[index + 1] ?? ""))
|
|
35064
35170
|
);
|
|
35065
|
-
const
|
|
35171
|
+
const macros = compactSwiftClangDefines(flags);
|
|
35172
|
+
const compact = args.coalescibleOverlays ? compactSwiftClangOverlays(macros, args.coalescibleOverlays) : macros;
|
|
35173
|
+
const content = compact.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
|
|
35066
35174
|
const digest3 = (0, import_node_crypto26.createHash)("sha256").update(content).digest("hex");
|
|
35067
35175
|
const file = import_node_path57.default.join(args.root, ".peach-swift-arguments", `${digest3}.rsp`);
|
|
35068
35176
|
args.files.set(file, content);
|
|
@@ -35153,7 +35261,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
35153
35261
|
].map((flag) => `, ${JSON.stringify(flag)}`).join("");
|
|
35154
35262
|
const header = args.headerDirectory && (args.nativeHeaderDeclarations?.[target.name] || [...args.native?.values() ?? []].some(
|
|
35155
35263
|
(value) => value.late?.producers.includes(target.name)
|
|
35156
|
-
)) ? `, "-emit-objc-header-path", ${JSON.stringify(import_node_path57.default.join(args.headerDirectory, `${target.name}-Swift
|
|
35264
|
+
)) ? `, "-emit-objc-header-path", ${JSON.stringify(import_node_path57.default.join(args.headerDirectory, `${target.name}-Swift.original.h`))}` : "";
|
|
35157
35265
|
const clangMode = target.cxxInterop ? "" : ', "-Xcc", "-fno-cxx-modules"';
|
|
35158
35266
|
const deployment = `, "-Xfrontend", "-peach-ios-deployment-target", "-Xfrontend", ${JSON.stringify(target.iosDeploymentTarget ?? SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET)}`;
|
|
35159
35267
|
const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation}${interoperability}${defines}${features}${upcoming} .unsafeFlags(${swiftFlagArray(`["-Osize", "-Xfrontend", "-enable-cross-import-overlays"${overlayFlags}${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports2}${nativeImportFlags}${objcFlags}${header}${clangMode}${deployment}${upstream}]`)})]`;
|
|
@@ -37244,6 +37352,9 @@ module ${moduleName2}.Swift {
|
|
|
37244
37352
|
nativeHeaderDeclarations[module2] = [...declared];
|
|
37245
37353
|
}
|
|
37246
37354
|
const nativeFlags = native.size > 0 ? /* @__PURE__ */ new Map() : void 0;
|
|
37355
|
+
const generatedOverlays = new Set(
|
|
37356
|
+
headerSearch.files.filter((file) => file.endsWith(".yaml"))
|
|
37357
|
+
);
|
|
37247
37358
|
if (nativeFlags) {
|
|
37248
37359
|
const toolchainBin = nativeToolchain();
|
|
37249
37360
|
const headers = import_node_path57.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "darwin");
|
|
@@ -37264,8 +37375,11 @@ module ${moduleName2}.Swift {
|
|
|
37264
37375
|
throw new Error(
|
|
37265
37376
|
target.name + ": missing or unsupported declared iOS deployment target " + JSON.stringify(version2)
|
|
37266
37377
|
);
|
|
37378
|
+
const sdkIntake = objcSdkIntakeFlags(headers, toolchainBin, minimum);
|
|
37379
|
+
const sdkOverlay = sdkIntake.indexOf("-ivfsoverlay");
|
|
37380
|
+
if (sdkOverlay >= 0) generatedOverlays.add(sdkIntake[sdkOverlay + 1]);
|
|
37267
37381
|
const intake = [
|
|
37268
|
-
...
|
|
37382
|
+
...sdkIntake,
|
|
37269
37383
|
"-ivfsoverlay",
|
|
37270
37384
|
headerSearch.files[0],
|
|
37271
37385
|
"-I",
|
|
@@ -37434,6 +37548,7 @@ module ${moduleName2}.Swift {
|
|
|
37434
37548
|
sourceSwiftTargets: swiftTargets,
|
|
37435
37549
|
nativeFlags,
|
|
37436
37550
|
nativeImportFlags,
|
|
37551
|
+
coalescibleOverlays: nativeFlags ? coalescibleHeaderOverlays(generatedOverlays) : void 0,
|
|
37437
37552
|
nativeHeaderFlags,
|
|
37438
37553
|
nativeSwiftHeaderMaps,
|
|
37439
37554
|
nativeHeaderDeclarations,
|
|
@@ -38732,6 +38847,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
38732
38847
|
report("compiling and linking Swift modules");
|
|
38733
38848
|
const frameworkInterfaces = /* @__PURE__ */ new Map();
|
|
38734
38849
|
const nativeDeclarations = /* @__PURE__ */ new Map();
|
|
38850
|
+
const nativeHeaders = Object.entries(input.files).filter(([name3]) => name3.endsWith(".h") && !name3.endsWith("-Swift.h")).map(([, source]) => source);
|
|
38735
38851
|
for (const [file, contents2] of Object.entries(input.files)) {
|
|
38736
38852
|
if (!file.endsWith(".modulemap")) continue;
|
|
38737
38853
|
const name3 = moduleMapName(contents2);
|
|
@@ -38819,54 +38935,83 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
38819
38935
|
);
|
|
38820
38936
|
return value;
|
|
38821
38937
|
};
|
|
38822
|
-
|
|
38823
|
-
|
|
38824
|
-
|
|
38825
|
-
|
|
38826
|
-
|
|
38827
|
-
|
|
38828
|
-
|
|
38829
|
-
|
|
38938
|
+
const compileApp = async () => {
|
|
38939
|
+
const stages = [
|
|
38940
|
+
...preparation.headerBuilds,
|
|
38941
|
+
...preparation.nativeProductTarget ? [{ target: preparation.nativeProductTarget, producers: [] }] : []
|
|
38942
|
+
];
|
|
38943
|
+
const checkpoints = import_node_path57.default.join(root, ".build", "peach-product-checkpoints");
|
|
38944
|
+
const recipe2 = (0, import_node_crypto26.createHash)("sha256").update(hash).update((0, import_node_fs58.readFileSync)(import_node_path57.default.join(root, "Package.swift"))).update(JSON.stringify(buildArgs)).digest("hex");
|
|
38945
|
+
for (const { target, producers } of stages) {
|
|
38946
|
+
const receipt = import_node_path57.default.join(
|
|
38947
|
+
checkpoints,
|
|
38948
|
+
(0, import_node_crypto26.createHash)("sha256").update(target).digest("hex")
|
|
38830
38949
|
);
|
|
38831
|
-
|
|
38832
|
-
const
|
|
38950
|
+
const headers = producers.map((producer) => {
|
|
38951
|
+
const stem = import_node_path57.default.join(
|
|
38833
38952
|
root,
|
|
38834
38953
|
".build",
|
|
38835
38954
|
"peach-cxx-headers",
|
|
38836
|
-
`${producer}-Swift
|
|
38955
|
+
`${producer}-Swift`
|
|
38837
38956
|
);
|
|
38838
|
-
|
|
38839
|
-
|
|
38840
|
-
|
|
38841
|
-
|
|
38842
|
-
|
|
38843
|
-
|
|
38844
|
-
|
|
38845
|
-
|
|
38846
|
-
|
|
38847
|
-
|
|
38848
|
-
|
|
38849
|
-
|
|
38850
|
-
generated,
|
|
38851
|
-
Object.entries(input.files).filter(
|
|
38852
|
-
([name3]) => name3.endsWith(".h") && !name3.endsWith("-Swift.h")
|
|
38853
|
-
).map(([, source]) => source)
|
|
38854
|
-
)
|
|
38855
|
-
]),
|
|
38856
|
-
`#import <${producer}/${producer}.h>`
|
|
38857
|
-
)
|
|
38957
|
+
return {
|
|
38958
|
+
producer,
|
|
38959
|
+
original: `${stem}.original.h`,
|
|
38960
|
+
emitted: `${stem}.h`
|
|
38961
|
+
};
|
|
38962
|
+
});
|
|
38963
|
+
const fingerprint = () => {
|
|
38964
|
+
const digest3 = (0, import_node_crypto26.createHash)("sha256").update(recipe2);
|
|
38965
|
+
for (const { emitted } of headers) {
|
|
38966
|
+
if (!(0, import_node_fs58.existsSync)(emitted)) return;
|
|
38967
|
+
digest3.update(
|
|
38968
|
+
(0, import_node_crypto26.createHash)("sha256").update((0, import_node_fs58.readFileSync)(emitted)).digest()
|
|
38858
38969
|
);
|
|
38859
38970
|
}
|
|
38860
|
-
|
|
38861
|
-
|
|
38862
|
-
|
|
38971
|
+
return digest3.digest("hex");
|
|
38972
|
+
};
|
|
38973
|
+
if (!options.project && (0, import_node_fs58.existsSync)(receipt) && (0, import_node_fs58.readFileSync)(receipt, "utf8") === fingerprint())
|
|
38974
|
+
continue;
|
|
38975
|
+
if (!options.project) (0, import_node_fs58.rmSync)(receipt, { force: true });
|
|
38976
|
+
for (const { producer, original } of headers)
|
|
38977
|
+
if (!(0, import_node_fs58.existsSync)(original))
|
|
38978
|
+
(0, import_node_fs58.rmSync)(
|
|
38979
|
+
import_node_path57.default.join(
|
|
38980
|
+
root,
|
|
38981
|
+
".build",
|
|
38982
|
+
WASM_TRIPLE,
|
|
38983
|
+
"release",
|
|
38984
|
+
"Modules",
|
|
38985
|
+
`${swiftTargetModuleName(producer)}.swiftmodule`
|
|
38986
|
+
),
|
|
38987
|
+
{ force: true }
|
|
38988
|
+
);
|
|
38863
38989
|
await runCompiler(
|
|
38864
38990
|
swift,
|
|
38865
|
-
[...buildArgs, "--target",
|
|
38991
|
+
[...buildArgs, "--target", target],
|
|
38866
38992
|
appOptions,
|
|
38867
38993
|
SWIFTPM_PROGRESS,
|
|
38868
38994
|
SWIFTPM_NOISE
|
|
38869
38995
|
);
|
|
38996
|
+
for (const { producer, original, emitted } of headers) {
|
|
38997
|
+
const generated = clangInterfaceHeader((0, import_node_fs58.readFileSync)(original, "utf8"));
|
|
38998
|
+
writeBuildFile(
|
|
38999
|
+
emitted,
|
|
39000
|
+
withoutSwiftDeclarations(
|
|
39001
|
+
swiftHeaderWithSuperclassImports(generated, frameworkInterface),
|
|
39002
|
+
/* @__PURE__ */ new Set([
|
|
39003
|
+
...preparation.nativeHeaderDeclarations[producer] ?? [],
|
|
39004
|
+
...nativelyDeclaredFunctions(generated, nativeHeaders)
|
|
39005
|
+
]),
|
|
39006
|
+
`#import <${producer}/${producer}.h>`
|
|
39007
|
+
)
|
|
39008
|
+
);
|
|
39009
|
+
}
|
|
39010
|
+
if (!options.project) {
|
|
39011
|
+
(0, import_node_fs58.mkdirSync)(checkpoints, { recursive: true });
|
|
39012
|
+
(0, import_node_fs58.writeFileSync)(`${receipt}.partial`, fingerprint());
|
|
39013
|
+
(0, import_node_fs58.renameSync)(`${receipt}.partial`, receipt);
|
|
39014
|
+
}
|
|
38870
39015
|
}
|
|
38871
39016
|
await runCompiler(
|
|
38872
39017
|
swift,
|
|
@@ -38875,6 +39020,9 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
38875
39020
|
SWIFTPM_PROGRESS,
|
|
38876
39021
|
SWIFTPM_NOISE
|
|
38877
39022
|
);
|
|
39023
|
+
};
|
|
39024
|
+
try {
|
|
39025
|
+
await compileApp();
|
|
38878
39026
|
} catch (error) {
|
|
38879
39027
|
const output3 = outputOf(error);
|
|
38880
39028
|
const moduleCache = import_node_path57.default.join(
|
|
@@ -38887,13 +39035,7 @@ function compileSwiftProjectOnce(input, options) {
|
|
|
38887
39035
|
if (output3.includes("was compiled with module cache path") && (0, import_node_fs58.existsSync)(moduleCache)) {
|
|
38888
39036
|
(0, import_node_fs58.rmSync)(moduleCache, { recursive: true, force: true });
|
|
38889
39037
|
try {
|
|
38890
|
-
await
|
|
38891
|
-
swift,
|
|
38892
|
-
buildArgs,
|
|
38893
|
-
appOptions,
|
|
38894
|
-
SWIFTPM_PROGRESS,
|
|
38895
|
-
SWIFTPM_NOISE
|
|
38896
|
-
);
|
|
39038
|
+
await compileApp();
|
|
38897
39039
|
} catch (retryError) {
|
|
38898
39040
|
throw new Error(
|
|
38899
39041
|
[
|
|
@@ -39224,9 +39366,9 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
39224
39366
|
`;
|
|
39225
39367
|
darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...quoted2, "-Wl,--end-lib"] : [];
|
|
39226
39368
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
39227
|
-
MULTI_MANIFEST_VERSION =
|
|
39369
|
+
MULTI_MANIFEST_VERSION = 71;
|
|
39228
39370
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
39229
|
-
compilerSourceDigest = true ? "
|
|
39371
|
+
compilerSourceDigest = true ? "d287f3ad479477c70004707c1336f37c9baeb81aef1880544a5ca236e088ca16" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
39230
39372
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
39231
39373
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
39232
39374
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -43815,7 +43957,7 @@ var init_swift_standin_digest = __esm({
|
|
|
43815
43957
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
43816
43958
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
43817
43959
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
43818
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
43960
|
+
STANDIN_SOURCE_DIGEST = true ? "f2b2c9a5d56b4cc06d8934ce5600587dcf7893acdf17158203975d997dbd387e" : standinSourceDigest();
|
|
43819
43961
|
}
|
|
43820
43962
|
});
|
|
43821
43963
|
|
|
@@ -44980,6 +45122,7 @@ async function fetchCheckout(checkouts, identity2, pin2, signal) {
|
|
|
44980
45122
|
}
|
|
44981
45123
|
function fetchedCheckout(checkouts, identity2, pin2) {
|
|
44982
45124
|
const dir = import_node_path77.default.join(checkouts, identity2);
|
|
45125
|
+
if (preparedSwiftPin(checkouts, identity2, pin2.location, pin2.revision)) return dir;
|
|
44983
45126
|
const head = import_node_path77.default.join(dir, ".git", "HEAD");
|
|
44984
45127
|
if (!verified.has(checkoutKey(dir, pin2)) || !import_node_fs77.default.existsSync(head) || import_node_fs77.default.readFileSync(head, "utf8").trim() !== pin2.revision)
|
|
44985
45128
|
throw new Error(
|
|
@@ -53499,7 +53642,7 @@ async function swiftPackages(entry, app) {
|
|
|
53499
53642
|
] : []
|
|
53500
53643
|
);
|
|
53501
53644
|
let reached = [...cached3.binaries.filter((binary2) => binary2.reached), ...vendored];
|
|
53502
|
-
const standinArtifact = (binary2) => binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0;
|
|
53645
|
+
const standinArtifact = (binary2) => !binary2.rustCrate && (binary2.publicHeaders === void 0 || binary2.unloweredSources !== void 0);
|
|
53503
53646
|
const artifacts = reached.filter(standinArtifact);
|
|
53504
53647
|
if (entry.moduleRoot && entry.provided && artifacts.length > 0) {
|
|
53505
53648
|
const { provided } = entry;
|
|
@@ -61881,7 +62024,7 @@ var init_nitro_superset = __esm({
|
|
|
61881
62024
|
init_nitroContract();
|
|
61882
62025
|
init_swift_standin_digest();
|
|
61883
62026
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
61884
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
62027
|
+
NITRO_COMPILER_DIGEST = true ? "69eced6dbfe31f0e81808ff7cd7eb781e3ed61b284e528afaa6cf96ac2d2b871" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
61885
62028
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
61886
62029
|
nitroSupersetKey = (inputs) => nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST });
|
|
61887
62030
|
published2 = /* @__PURE__ */ new Map();
|
|
@@ -61902,7 +62045,7 @@ var init_nitro_superset = __esm({
|
|
|
61902
62045
|
var runtime_companion_default;
|
|
61903
62046
|
var init_runtime_companion = __esm({
|
|
61904
62047
|
"runtime-companion.json"() {
|
|
61905
|
-
runtime_companion_default = { abi: 1, sha256: "
|
|
62048
|
+
runtime_companion_default = { abi: 1, sha256: "f0ebf18540275693f13d5f0638e9e6e2afd2b8a2fa10c6d5c1190341feaa430b", file: "node/cli-f0ebf18540275693f13d5f0638e9e6e2afd2b8a2fa10c6d5c1190341feaa430b.cjs" };
|
|
61906
62049
|
}
|
|
61907
62050
|
});
|
|
61908
62051
|
|
|
@@ -67729,6 +67872,39 @@ var init_cloud_session = __esm({
|
|
|
67729
67872
|
}
|
|
67730
67873
|
});
|
|
67731
67874
|
|
|
67875
|
+
// ../peach-kit/src/agent-identity.ts
|
|
67876
|
+
var init_agent_identity = __esm({
|
|
67877
|
+
"../peach-kit/src/agent-identity.ts"() {
|
|
67878
|
+
"use strict";
|
|
67879
|
+
}
|
|
67880
|
+
});
|
|
67881
|
+
|
|
67882
|
+
// cli/parent-pid.ts
|
|
67883
|
+
var init_parent_pid = __esm({
|
|
67884
|
+
"cli/parent-pid.ts"() {
|
|
67885
|
+
"use strict";
|
|
67886
|
+
}
|
|
67887
|
+
});
|
|
67888
|
+
|
|
67889
|
+
// cli/current-sim.ts
|
|
67890
|
+
var init_current_sim = __esm({
|
|
67891
|
+
"cli/current-sim.ts"() {
|
|
67892
|
+
"use strict";
|
|
67893
|
+
init_parent_pid();
|
|
67894
|
+
init_secure_file();
|
|
67895
|
+
}
|
|
67896
|
+
});
|
|
67897
|
+
|
|
67898
|
+
// cli/command-agent.ts
|
|
67899
|
+
var init_command_agent = __esm({
|
|
67900
|
+
"cli/command-agent.ts"() {
|
|
67901
|
+
"use strict";
|
|
67902
|
+
init_agent_identity();
|
|
67903
|
+
init_cloud_contract();
|
|
67904
|
+
init_current_sim();
|
|
67905
|
+
}
|
|
67906
|
+
});
|
|
67907
|
+
|
|
67732
67908
|
// ../peach-globals/src/github-workflow-contract.ts
|
|
67733
67909
|
var init_github_workflow_contract = __esm({
|
|
67734
67910
|
"../peach-globals/src/github-workflow-contract.ts"() {
|
|
@@ -68386,6 +68562,7 @@ var init_cloud_client = __esm({
|
|
|
68386
68562
|
init_public_brand();
|
|
68387
68563
|
init_auth();
|
|
68388
68564
|
init_cloud_session();
|
|
68565
|
+
init_command_agent();
|
|
68389
68566
|
init_detect();
|
|
68390
68567
|
init_run_registry();
|
|
68391
68568
|
DEFAULT_RNX_CLOUD_ORIGIN = rnxPublicBrand.origin;
|
|
@@ -72027,7 +72204,7 @@ init_swift_native_pin();
|
|
|
72027
72204
|
init_xcode_project();
|
|
72028
72205
|
var EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
72029
72206
|
function expoNativeCompilerDigestValue() {
|
|
72030
|
-
return true ? "
|
|
72207
|
+
return true ? "07e205f69ed280a405ff8ed7b8e6259e8752f107f8768d265a02d97d85bafdee" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
72031
72208
|
}
|
|
72032
72209
|
var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
72033
72210
|
function readSources(value) {
|
|
@@ -79254,6 +79431,57 @@ async function scanDevServers(opts = {}) {
|
|
|
79254
79431
|
return results.filter((r) => !isSootSimSelfServer(r)).sort((a, b) => a.port - b.port);
|
|
79255
79432
|
}
|
|
79256
79433
|
|
|
79434
|
+
// src/agent-prompt.ts
|
|
79435
|
+
var MAX_NOTE_CROP_LENGTH = 2 * 1024 * 1024;
|
|
79436
|
+
var CANVAS_AGENT_ID_MAX_CHARS = 200;
|
|
79437
|
+
var MAX_CANVAS_AGENT_NOTE_BODY_BYTES = MAX_NOTE_CROP_LENGTH + 256 * 1024;
|
|
79438
|
+
var AGENT_NOTE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
79439
|
+
var AGENT_NOTE_QUEUE_LIMIT = 16;
|
|
79440
|
+
function readCanvasAgentId(value) {
|
|
79441
|
+
return typeof value === "string" && value.length <= CANVAS_AGENT_ID_MAX_CHARS ? value.trim() || void 0 : void 0;
|
|
79442
|
+
}
|
|
79443
|
+
function readCanvasAgentNote(value) {
|
|
79444
|
+
if (!value || typeof value !== "object") return null;
|
|
79445
|
+
const agentId = readCanvasAgentId(Reflect.get(value, "agentId"));
|
|
79446
|
+
const text6 = Reflect.get(value, "text");
|
|
79447
|
+
const inspectSummary = Reflect.get(value, "inspectSummary");
|
|
79448
|
+
const inspectTrace = Reflect.get(value, "inspectTrace");
|
|
79449
|
+
const crop = Reflect.get(value, "crop");
|
|
79450
|
+
if (!agentId || typeof text6 !== "string" || !text6.trim() || text6.length > 8192 || typeof inspectSummary !== "string" || !inspectSummary.trim() || inspectSummary.length > 8192 || inspectTrace !== void 0 && (typeof inspectTrace !== "string" || inspectTrace.length > 32768) || typeof crop !== "string" || crop.length > MAX_NOTE_CROP_LENGTH || !/^data:image\/(?:webp|png);base64,[A-Za-z0-9+/]+={0,2}$/.test(crop))
|
|
79451
|
+
return null;
|
|
79452
|
+
return { agentId, text: text6.trim(), inspectSummary, inspectTrace, crop };
|
|
79453
|
+
}
|
|
79454
|
+
function createCanvasAgentInspectMessage(simId, { agentId, text: text6, inspectSummary, inspectTrace, crop }) {
|
|
79455
|
+
return {
|
|
79456
|
+
id: `inspect-${globalThis.crypto.randomUUID()}`,
|
|
79457
|
+
simId,
|
|
79458
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
79459
|
+
recipientId: agentId,
|
|
79460
|
+
prompt: { text: text6, inspectSummary, inspectTrace },
|
|
79461
|
+
crop
|
|
79462
|
+
};
|
|
79463
|
+
}
|
|
79464
|
+
var ENVELOPE_MARKER = "sootsim-agent-prompt-v1";
|
|
79465
|
+
function cleanPromptText(value) {
|
|
79466
|
+
return typeof value === "string" ? value.trim() : "";
|
|
79467
|
+
}
|
|
79468
|
+
function encodeAgentPromptEnvelope(input) {
|
|
79469
|
+
const text6 = cleanPromptText(input.text);
|
|
79470
|
+
if (!text6) return "";
|
|
79471
|
+
const displayText = cleanPromptText(input.displayText);
|
|
79472
|
+
const inspectSummary = cleanPromptText(input.inspectSummary);
|
|
79473
|
+
const inspectTrace = cleanPromptText(input.inspectTrace);
|
|
79474
|
+
const needsEnvelope = !!inspectSummary || !!inspectTrace || /[\r\n]/.test(text6) || !!displayText && displayText !== text6;
|
|
79475
|
+
if (!needsEnvelope) return text6;
|
|
79476
|
+
return JSON.stringify({
|
|
79477
|
+
__sootsimAgentPrompt: ENVELOPE_MARKER,
|
|
79478
|
+
text: text6,
|
|
79479
|
+
displayText,
|
|
79480
|
+
inspectSummary,
|
|
79481
|
+
inspectTrace
|
|
79482
|
+
});
|
|
79483
|
+
}
|
|
79484
|
+
|
|
79257
79485
|
// src/agent-sessions.ts
|
|
79258
79486
|
var import_node_child_process54 = require("node:child_process");
|
|
79259
79487
|
var import_node_crypto61 = require("node:crypto");
|
|
@@ -79280,28 +79508,6 @@ function parseAgentEventLine(line) {
|
|
|
79280
79508
|
}
|
|
79281
79509
|
}
|
|
79282
79510
|
|
|
79283
|
-
// src/agent-prompt.ts
|
|
79284
|
-
var ENVELOPE_MARKER = "sootsim-agent-prompt-v1";
|
|
79285
|
-
function cleanPromptText(value) {
|
|
79286
|
-
return typeof value === "string" ? value.trim() : "";
|
|
79287
|
-
}
|
|
79288
|
-
function encodeAgentPromptEnvelope(input) {
|
|
79289
|
-
const text6 = cleanPromptText(input.text);
|
|
79290
|
-
if (!text6) return "";
|
|
79291
|
-
const displayText = cleanPromptText(input.displayText);
|
|
79292
|
-
const inspectSummary = cleanPromptText(input.inspectSummary);
|
|
79293
|
-
const inspectTrace = cleanPromptText(input.inspectTrace);
|
|
79294
|
-
const needsEnvelope = !!inspectSummary || !!inspectTrace || /[\r\n]/.test(text6) || !!displayText && displayText !== text6;
|
|
79295
|
-
if (!needsEnvelope) return text6;
|
|
79296
|
-
return JSON.stringify({
|
|
79297
|
-
__sootsimAgentPrompt: ENVELOPE_MARKER,
|
|
79298
|
-
text: text6,
|
|
79299
|
-
displayText,
|
|
79300
|
-
inspectSummary,
|
|
79301
|
-
inspectTrace
|
|
79302
|
-
});
|
|
79303
|
-
}
|
|
79304
|
-
|
|
79305
79511
|
// src/attached-projects.ts
|
|
79306
79512
|
var import_node_crypto60 = require("node:crypto");
|
|
79307
79513
|
var import_node_fs110 = __toESM(require("node:fs"), 1);
|
|
@@ -80024,6 +80230,7 @@ var AgentHost = class {
|
|
|
80024
80230
|
allSockets = /* @__PURE__ */ new Set();
|
|
80025
80231
|
inspectQueues = /* @__PURE__ */ new Map();
|
|
80026
80232
|
inspectListeners = /* @__PURE__ */ new Map();
|
|
80233
|
+
takenNotes = /* @__PURE__ */ new Map();
|
|
80027
80234
|
// agent wrappers also emit prompt-received from the FIFO reader, but the
|
|
80028
80235
|
// shell/daemon already knows the user-facing display text when send-prompt
|
|
80029
80236
|
// is accepted. emit the friendly prompt immediately and suppress the raw
|
|
@@ -80122,6 +80329,7 @@ var AgentHost = class {
|
|
|
80122
80329
|
}
|
|
80123
80330
|
this.inspectListeners.clear();
|
|
80124
80331
|
this.inspectQueues.clear();
|
|
80332
|
+
this.takenNotes.clear();
|
|
80125
80333
|
this.allSockets.clear();
|
|
80126
80334
|
}
|
|
80127
80335
|
// --- dispatch ---
|
|
@@ -80141,7 +80349,49 @@ var AgentHost = class {
|
|
|
80141
80349
|
case "agent:start-session":
|
|
80142
80350
|
return this.doStartSession(msg.input ?? {});
|
|
80143
80351
|
case "agent:listen-inspect":
|
|
80144
|
-
return this.listenForInspect(
|
|
80352
|
+
return this.listenForInspect(
|
|
80353
|
+
ws,
|
|
80354
|
+
this.requireSimId(msg, type),
|
|
80355
|
+
readCanvasAgentId(msg.recipientId)
|
|
80356
|
+
);
|
|
80357
|
+
case "agent:cancel-listen-inspect": {
|
|
80358
|
+
const simId = this.requireSimId(msg, type);
|
|
80359
|
+
const listeners = this.inspectListeners.get(simId) ?? [];
|
|
80360
|
+
const index = listeners.findIndex((listener2) => listener2.socket === ws);
|
|
80361
|
+
if (index < 0) return false;
|
|
80362
|
+
const [listener] = listeners.splice(index, 1);
|
|
80363
|
+
if (!listeners.length) this.inspectListeners.delete(simId);
|
|
80364
|
+
listener?.reject(new AgentSessionError("CANCELED", "inspect listener canceled"));
|
|
80365
|
+
return true;
|
|
80366
|
+
}
|
|
80367
|
+
case "agent:take-inspect-message": {
|
|
80368
|
+
const recipientId = readCanvasAgentId(msg.recipientId);
|
|
80369
|
+
return recipientId ? this.takeInspectMessage(this.requireSimId(msg, type), recipientId, true) : null;
|
|
80370
|
+
}
|
|
80371
|
+
case "agent:send-canvas-note": {
|
|
80372
|
+
const simId = this.requireSimId(msg, type);
|
|
80373
|
+
const note = readCanvasAgentNote(msg.note);
|
|
80374
|
+
if (!note) throw new AgentSessionError("INVALID_NOTE", "invalid canvas note");
|
|
80375
|
+
if (this.inspectQueue(simId).filter((message2) => message2.recipientId).length >= AGENT_NOTE_QUEUE_LIMIT) {
|
|
80376
|
+
throw new AgentSessionError(
|
|
80377
|
+
"INBOX_FULL",
|
|
80378
|
+
"the simulator has too many pending notes"
|
|
80379
|
+
);
|
|
80380
|
+
}
|
|
80381
|
+
const message = createCanvasAgentInspectMessage(simId, note);
|
|
80382
|
+
this.enqueueInspectMessage(message);
|
|
80383
|
+
return { id: message.id };
|
|
80384
|
+
}
|
|
80385
|
+
case "agent:canvas-note-status": {
|
|
80386
|
+
const simId = this.requireSimId(msg, type);
|
|
80387
|
+
this.pruneTakenNotes();
|
|
80388
|
+
const pending = this.inspectQueue(simId).some(
|
|
80389
|
+
(message) => message.id === msg.messageId
|
|
80390
|
+
);
|
|
80391
|
+
return {
|
|
80392
|
+
status: pending ? "pending" : this.takenNotes.get(msg.messageId)?.simId === simId ? "taken" : "missing"
|
|
80393
|
+
};
|
|
80394
|
+
}
|
|
80145
80395
|
case "agent:get-inspect-listener-status": {
|
|
80146
80396
|
const simId = this.requireSimId(msg, type);
|
|
80147
80397
|
return { simId, listening: (this.inspectListeners.get(simId)?.length ?? 0) > 0 };
|
|
@@ -80187,19 +80437,52 @@ var AgentHost = class {
|
|
|
80187
80437
|
if (!simId) throw new AgentSessionError("NO_SIM", `${type} requires simId`);
|
|
80188
80438
|
return simId;
|
|
80189
80439
|
}
|
|
80190
|
-
listenForInspect(socket, simId) {
|
|
80191
|
-
const
|
|
80192
|
-
|
|
80193
|
-
if (queued && queue) {
|
|
80194
|
-
if (queue.length === 0) this.inspectQueues.delete(simId);
|
|
80195
|
-
return Promise.resolve(queued);
|
|
80196
|
-
}
|
|
80440
|
+
listenForInspect(socket, simId, recipientId) {
|
|
80441
|
+
const queued = this.takeInspectMessage(simId, recipientId, false);
|
|
80442
|
+
if (queued) return Promise.resolve(queued);
|
|
80197
80443
|
return new Promise((resolve7, reject) => {
|
|
80198
80444
|
const listeners = this.inspectListeners.get(simId) ?? [];
|
|
80199
|
-
listeners.push({ socket, resolve: resolve7, reject });
|
|
80445
|
+
listeners.push({ socket, recipientId, resolve: resolve7, reject });
|
|
80200
80446
|
this.inspectListeners.set(simId, listeners);
|
|
80201
80447
|
});
|
|
80202
80448
|
}
|
|
80449
|
+
pruneTakenNotes() {
|
|
80450
|
+
const now = Date.now();
|
|
80451
|
+
for (const [id, receipt] of this.takenNotes) {
|
|
80452
|
+
if (receipt.expiresAt <= now) this.takenNotes.delete(id);
|
|
80453
|
+
}
|
|
80454
|
+
}
|
|
80455
|
+
markInspectMessageTaken(message) {
|
|
80456
|
+
if (!message.recipientId) return;
|
|
80457
|
+
this.pruneTakenNotes();
|
|
80458
|
+
this.takenNotes.set(message.id, {
|
|
80459
|
+
simId: message.simId,
|
|
80460
|
+
expiresAt: Date.now() + AGENT_NOTE_TTL_MS
|
|
80461
|
+
});
|
|
80462
|
+
}
|
|
80463
|
+
inspectQueue(simId) {
|
|
80464
|
+
const queue = this.inspectQueues.get(simId);
|
|
80465
|
+
if (!queue) return [];
|
|
80466
|
+
const cutoff = Date.now() - AGENT_NOTE_TTL_MS;
|
|
80467
|
+
const pending = queue.filter(
|
|
80468
|
+
(message) => !message.recipientId || Date.parse(message.createdAt) > cutoff
|
|
80469
|
+
);
|
|
80470
|
+
if (pending.length) this.inspectQueues.set(simId, pending);
|
|
80471
|
+
else this.inspectQueues.delete(simId);
|
|
80472
|
+
return pending;
|
|
80473
|
+
}
|
|
80474
|
+
takeInspectMessage(simId, recipientId, notesOnly = false) {
|
|
80475
|
+
const queue = this.inspectQueue(simId);
|
|
80476
|
+
const index = queue.findIndex(
|
|
80477
|
+
(message2) => message2.recipientId ? message2.recipientId === recipientId : !notesOnly
|
|
80478
|
+
);
|
|
80479
|
+
if (index < 0) return null;
|
|
80480
|
+
const [message] = queue.splice(index, 1);
|
|
80481
|
+
if (!queue.length) this.inspectQueues.delete(simId);
|
|
80482
|
+
if (!message) return null;
|
|
80483
|
+
this.markInspectMessageTaken(message);
|
|
80484
|
+
return message;
|
|
80485
|
+
}
|
|
80203
80486
|
sendInspectMessage(simId, prompt) {
|
|
80204
80487
|
if (!prompt.text.trim()) {
|
|
80205
80488
|
throw new AgentSessionError("EMPTY_PROMPT", "inspect message cannot be empty");
|
|
@@ -80210,17 +80493,26 @@ var AgentHost = class {
|
|
|
80210
80493
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
80211
80494
|
prompt
|
|
80212
80495
|
};
|
|
80213
|
-
const
|
|
80214
|
-
|
|
80215
|
-
|
|
80216
|
-
|
|
80217
|
-
|
|
80218
|
-
|
|
80219
|
-
|
|
80220
|
-
|
|
80496
|
+
const queued = this.enqueueInspectMessage(message);
|
|
80497
|
+
return { ok: true, queued, messageId: message.id };
|
|
80498
|
+
}
|
|
80499
|
+
enqueueInspectMessage(message) {
|
|
80500
|
+
const { simId, recipientId } = message;
|
|
80501
|
+
const listeners = this.inspectListeners.get(simId) ?? [];
|
|
80502
|
+
const index = listeners.findIndex(
|
|
80503
|
+
(listener) => !recipientId || listener.recipientId === recipientId
|
|
80504
|
+
);
|
|
80505
|
+
if (index >= 0) {
|
|
80506
|
+
const [listener] = listeners.splice(index, 1);
|
|
80507
|
+
if (!listeners.length) this.inspectListeners.delete(simId);
|
|
80508
|
+
this.markInspectMessageTaken(message);
|
|
80509
|
+
listener?.resolve(message);
|
|
80510
|
+
return false;
|
|
80511
|
+
}
|
|
80512
|
+
const queue = this.inspectQueue(simId);
|
|
80221
80513
|
queue.push(message);
|
|
80222
80514
|
this.inspectQueues.set(simId, queue);
|
|
80223
|
-
return
|
|
80515
|
+
return true;
|
|
80224
80516
|
}
|
|
80225
80517
|
async doStartSession(input) {
|
|
80226
80518
|
const project2 = findProjectById(input.projectId);
|