peachsim 0.1.823 → 0.1.825
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/drivers/playwright-sim-host.ts +5 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.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 +15 -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 +1 -1
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +1 -1
- 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 +32 -34
- package/dist-lib/host/fetch-proxy-handler.cjs +24 -34
- 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 +33 -3
- package/dist-lib/index.cjs +1 -1
- 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 +1 -1
- 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/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/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.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 +32 -34
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- 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 +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/src/backend-origin.ts +27 -0
- package/src/host/bridge-host.ts +8 -3
- package/src/host/fetch-proxy-handler.ts +20 -37
- package/src/host/fetch-proxy-transport.ts +4 -8
- package/src/host/websocket-proxy.ts +12 -0
|
@@ -455,6 +455,11 @@ const cleanupProfile = () => {
|
|
|
455
455
|
'--enable-unsafe-webgpu',
|
|
456
456
|
);
|
|
457
457
|
opts.ignoreDefaultArgs.push('--enable-unsafe-swiftshader');
|
|
458
|
+
} else if (hostCommand) {
|
|
459
|
+
// the attached desktop host draws every surface on its own device, so the
|
|
460
|
+
// page composites only dom and the frames a capture presents: chromium's
|
|
461
|
+
// software compositor does that without a gpu process emulated on the cpu
|
|
462
|
+
opts.args.push('--disable-gpu');
|
|
458
463
|
} else {
|
|
459
464
|
// the shared software launch owns the webgpu canvas backing and watchdog
|
|
460
465
|
// flags too; an adapter alone does not prove a canvas can present.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -30,6 +30,7 @@ __export(backend_origin_exports, {
|
|
|
30
30
|
isContrastBackendHost: () => isContrastBackendHost,
|
|
31
31
|
isContrastBackendOrigin: () => isContrastBackendOrigin,
|
|
32
32
|
isLoopbackHost: () => isLoopbackHost,
|
|
33
|
+
isTrustedBridgeRequest: () => isTrustedBridgeRequest,
|
|
33
34
|
loopbackOriginOf: () => loopbackOriginOf,
|
|
34
35
|
normalizeHostname: () => normalizeHostname,
|
|
35
36
|
resolveBrowserAssetProxyUrl: () => resolveBrowserAssetProxyUrl,
|
|
@@ -50,6 +51,18 @@ function isLoopbackHost(hostname) {
|
|
|
50
51
|
const normalized = normalizeHostname(hostname);
|
|
51
52
|
return normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "0.0.0.0" || normalized === "::1" || /^127(?:\.\d{1,3}){3}$/.test(normalized);
|
|
52
53
|
}
|
|
54
|
+
function isTrustedBridgeRequest(headers) {
|
|
55
|
+
const origin = headers.origin;
|
|
56
|
+
if (origin === void 0) return true;
|
|
57
|
+
try {
|
|
58
|
+
const { hostname, host } = new URL(String(origin));
|
|
59
|
+
return isLoopbackHost(hostname) || [headers.host, headers[":authority"], headers["x-forwarded-host"]].some(
|
|
60
|
+
(value) => typeof value === "string" && value.toLowerCase() === host
|
|
61
|
+
);
|
|
62
|
+
} catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
53
66
|
function loopbackOriginOf(value) {
|
|
54
67
|
try {
|
|
55
68
|
const url = new URL(value);
|
|
@@ -108,6 +121,7 @@ function resolveContrastBackendOrigin(currentOrigin) {
|
|
|
108
121
|
isContrastBackendHost,
|
|
109
122
|
isContrastBackendOrigin,
|
|
110
123
|
isLoopbackHost,
|
|
124
|
+
isTrustedBridgeRequest,
|
|
111
125
|
loopbackOriginOf,
|
|
112
126
|
normalizeHostname,
|
|
113
127
|
resolveBrowserAssetProxyUrl,
|
package/dist-lib/beta.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/cloud.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/cloud.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
package/dist-lib/config.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/detox/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/home-paths.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -48,6 +48,18 @@ function isLoopbackHost(hostname) {
|
|
|
48
48
|
const normalized = normalizeHostname(hostname);
|
|
49
49
|
return normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "0.0.0.0" || normalized === "::1" || /^127(?:\.\d{1,3}){3}$/.test(normalized);
|
|
50
50
|
}
|
|
51
|
+
function isTrustedBridgeRequest(headers) {
|
|
52
|
+
const origin = headers.origin;
|
|
53
|
+
if (origin === void 0) return true;
|
|
54
|
+
try {
|
|
55
|
+
const { hostname, host: host2 } = new URL(String(origin));
|
|
56
|
+
return isLoopbackHost(hostname) || [headers.host, headers[":authority"], headers["x-forwarded-host"]].some(
|
|
57
|
+
(value) => typeof value === "string" && value.toLowerCase() === host2
|
|
58
|
+
);
|
|
59
|
+
} catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
51
63
|
function buildBrowserAssetProxyUrl(targetUrl) {
|
|
52
64
|
const proxyPath = isLoopbackHost(new URL(targetUrl).hostname) ? "/__bundle-proxy" : "/__fetch-proxy";
|
|
53
65
|
return `${proxyPath}?url=${encodeURIComponent(targetUrl)}`;
|
|
@@ -19587,6 +19599,13 @@ function buildAppApiProxyHeaders(reqHeaders, targetUrl) {
|
|
|
19587
19599
|
}
|
|
19588
19600
|
return headers;
|
|
19589
19601
|
}
|
|
19602
|
+
function rejectUntrustedBridgeOrigin(req, res) {
|
|
19603
|
+
if (isTrustedBridgeRequest(req.headers)) return false;
|
|
19604
|
+
res.statusCode = 403;
|
|
19605
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
19606
|
+
res.end(`peach bridge: origin ${req.headers.origin} may not use this bridge`);
|
|
19607
|
+
return true;
|
|
19608
|
+
}
|
|
19590
19609
|
function isFetchProxyRequestUrl(rawUrl) {
|
|
19591
19610
|
return rawUrl?.startsWith("/__fetch-proxy?") || rawUrl?.startsWith("/__proxy?") || false;
|
|
19592
19611
|
}
|
|
@@ -19726,35 +19745,6 @@ async function handleFetchProxyRequest(req, res) {
|
|
|
19726
19745
|
else req.socket.destroy();
|
|
19727
19746
|
}
|
|
19728
19747
|
}
|
|
19729
|
-
async function handleBundleProxyRequest(req, res) {
|
|
19730
|
-
const params = new URLSearchParams((req.url || "").split("?")[1] || "");
|
|
19731
|
-
const target = params.get("url");
|
|
19732
|
-
if (!target) {
|
|
19733
|
-
applyFetchProxyCors(req, res);
|
|
19734
|
-
res.statusCode = 400;
|
|
19735
|
-
res.setHeader("Content-Type", "text/plain");
|
|
19736
|
-
res.end("bundle-proxy: missing url query param");
|
|
19737
|
-
return;
|
|
19738
|
-
}
|
|
19739
|
-
let targetUrl;
|
|
19740
|
-
try {
|
|
19741
|
-
targetUrl = new URL(target);
|
|
19742
|
-
} catch {
|
|
19743
|
-
applyFetchProxyCors(req, res);
|
|
19744
|
-
res.statusCode = 400;
|
|
19745
|
-
res.setHeader("Content-Type", "text/plain");
|
|
19746
|
-
res.end("bundle-proxy: invalid url");
|
|
19747
|
-
return;
|
|
19748
|
-
}
|
|
19749
|
-
if (!isLoopbackHost(targetUrl.hostname)) {
|
|
19750
|
-
applyFetchProxyCors(req, res);
|
|
19751
|
-
res.statusCode = 403;
|
|
19752
|
-
res.setHeader("Content-Type", "text/plain");
|
|
19753
|
-
res.end("bundle-proxy: only loopback targets allowed");
|
|
19754
|
-
return;
|
|
19755
|
-
}
|
|
19756
|
-
await handleFetchProxyRequest(req, res);
|
|
19757
|
-
}
|
|
19758
19748
|
function handleAppApiRequest(req, res) {
|
|
19759
19749
|
const reqUrl = req.url || "";
|
|
19760
19750
|
let targetPath = "";
|
|
@@ -19857,15 +19847,15 @@ ${privateKey.toString("base64").match(/.{1,64}/g)?.join("\n")}
|
|
|
19857
19847
|
settings: { maxConcurrentStreams: 256 }
|
|
19858
19848
|
},
|
|
19859
19849
|
(req, res) => {
|
|
19850
|
+
if (rejectUntrustedBridgeOrigin(req, res)) return;
|
|
19860
19851
|
res.setHeader("Cross-Origin-Resource-Policy", "cross-origin");
|
|
19861
19852
|
res.setHeader("Timing-Allow-Origin", "*");
|
|
19862
|
-
|
|
19863
|
-
if (!handler) {
|
|
19853
|
+
if (!isBundleProxyRequestUrl(req.url) && !isFetchProxyRequestUrl(req.url)) {
|
|
19864
19854
|
res.writeHead(404);
|
|
19865
19855
|
res.end();
|
|
19866
19856
|
return;
|
|
19867
19857
|
}
|
|
19868
|
-
void
|
|
19858
|
+
void handleFetchProxyRequest(req, res).catch(() => res.destroy());
|
|
19869
19859
|
}
|
|
19870
19860
|
);
|
|
19871
19861
|
server.on("session", (session) => {
|
|
@@ -20835,6 +20825,7 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
20835
20825
|
var import_crypto = require("crypto");
|
|
20836
20826
|
var import_http3 = require("http");
|
|
20837
20827
|
var import_https2 = require("https");
|
|
20828
|
+
init_backend_origin();
|
|
20838
20829
|
var WEBSOCKET_PROXY_PATH = "/__websocket-proxy";
|
|
20839
20830
|
var WEBSOCKET_PROXY_HANDSHAKE_TIMEOUT_MS = 1e4;
|
|
20840
20831
|
var WEBSOCKET_PROTOCOL_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
@@ -20867,6 +20858,11 @@ ${message}`
|
|
|
20867
20858
|
}
|
|
20868
20859
|
socket.destroy();
|
|
20869
20860
|
}
|
|
20861
|
+
function rejectUntrustedBridgeUpgrade(req, socket) {
|
|
20862
|
+
if (isTrustedBridgeRequest(req.headers)) return false;
|
|
20863
|
+
rejectUpgrade(socket, 403, "forbidden bridge origin");
|
|
20864
|
+
return true;
|
|
20865
|
+
}
|
|
20870
20866
|
function hasHeaderToken(value, token) {
|
|
20871
20867
|
return (value || "").split(",").some((part) => part.trim().toLowerCase() === token);
|
|
20872
20868
|
}
|
|
@@ -21341,6 +21337,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
21341
21337
|
this.wss = new import_ws.WebSocketServer({ noServer: true });
|
|
21342
21338
|
this.wireWebSocketServer();
|
|
21343
21339
|
server.on("upgrade", (req, socket, head) => {
|
|
21340
|
+
if (rejectUntrustedBridgeUpgrade(req, socket)) return;
|
|
21344
21341
|
if (handleWebSocketProxyUpgrade(req, socket, head)) return;
|
|
21345
21342
|
this.wss?.handleUpgrade(req, socket, head, (ws) => {
|
|
21346
21343
|
this.wss?.emit("connection", ws, req);
|
|
@@ -22111,6 +22108,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
22111
22108
|
* non-upgrade routes that don't match serve index.html (SPA behavior) so
|
|
22112
22109
|
* electron's webContents can navigate freely inside the runtime. */
|
|
22113
22110
|
handleHttpRequest(req, res) {
|
|
22111
|
+
if (rejectUntrustedBridgeOrigin(req, res)) return;
|
|
22114
22112
|
if (req.url === "/__peach/fetch-transport") {
|
|
22115
22113
|
res.writeHead(200, {
|
|
22116
22114
|
"Content-Type": "application/json",
|
|
@@ -22291,7 +22289,7 @@ var SootSimBridgeHost = class _SootSimBridgeHost {
|
|
|
22291
22289
|
return;
|
|
22292
22290
|
}
|
|
22293
22291
|
if (url.pathname === "/__bundle-proxy") {
|
|
22294
|
-
void
|
|
22292
|
+
void handleFetchProxyRequest(req, res);
|
|
22295
22293
|
return;
|
|
22296
22294
|
}
|
|
22297
22295
|
if (url.pathname === "/__server-scan") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -35,11 +35,11 @@ __export(fetch_proxy_handler_exports, {
|
|
|
35
35
|
buildAppApiProxyHeaders: () => buildAppApiProxyHeaders,
|
|
36
36
|
buildFetchProxyHeaders: () => buildFetchProxyHeaders,
|
|
37
37
|
handleAppApiRequest: () => handleAppApiRequest,
|
|
38
|
-
handleBundleProxyRequest: () => handleBundleProxyRequest,
|
|
39
38
|
handleFetchProxyRequest: () => handleFetchProxyRequest,
|
|
40
39
|
isAppApiRequestUrl: () => isAppApiRequestUrl,
|
|
41
40
|
isBundleProxyRequestUrl: () => isBundleProxyRequestUrl,
|
|
42
|
-
isFetchProxyRequestUrl: () => isFetchProxyRequestUrl
|
|
41
|
+
isFetchProxyRequestUrl: () => isFetchProxyRequestUrl,
|
|
42
|
+
rejectUntrustedBridgeOrigin: () => rejectUntrustedBridgeOrigin
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(fetch_proxy_handler_exports);
|
|
45
45
|
var import_http = __toESM(require("http"), 1);
|
|
@@ -55,6 +55,18 @@ function isLoopbackHost(hostname) {
|
|
|
55
55
|
const normalized = normalizeHostname(hostname);
|
|
56
56
|
return normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "0.0.0.0" || normalized === "::1" || /^127(?:\.\d{1,3}){3}$/.test(normalized);
|
|
57
57
|
}
|
|
58
|
+
function isTrustedBridgeRequest(headers) {
|
|
59
|
+
const origin = headers.origin;
|
|
60
|
+
if (origin === void 0) return true;
|
|
61
|
+
try {
|
|
62
|
+
const { hostname, host } = new URL(String(origin));
|
|
63
|
+
return isLoopbackHost(hostname) || [headers.host, headers[":authority"], headers["x-forwarded-host"]].some(
|
|
64
|
+
(value) => typeof value === "string" && value.toLowerCase() === host
|
|
65
|
+
);
|
|
66
|
+
} catch {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
58
70
|
|
|
59
71
|
// src/host/fetch-proxy-overrides.ts
|
|
60
72
|
var FETCH_PROXY_NATIVE_USER_AGENT_HEADER = "x-sootsim-native-user-agent";
|
|
@@ -217,6 +229,13 @@ function buildAppApiProxyHeaders(reqHeaders, targetUrl) {
|
|
|
217
229
|
}
|
|
218
230
|
return headers;
|
|
219
231
|
}
|
|
232
|
+
function rejectUntrustedBridgeOrigin(req, res) {
|
|
233
|
+
if (isTrustedBridgeRequest(req.headers)) return false;
|
|
234
|
+
res.statusCode = 403;
|
|
235
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
236
|
+
res.end(`peach bridge: origin ${req.headers.origin} may not use this bridge`);
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
220
239
|
function isFetchProxyRequestUrl(rawUrl) {
|
|
221
240
|
return rawUrl?.startsWith("/__fetch-proxy?") || rawUrl?.startsWith("/__proxy?") || false;
|
|
222
241
|
}
|
|
@@ -356,35 +375,6 @@ async function handleFetchProxyRequest(req, res) {
|
|
|
356
375
|
else req.socket.destroy();
|
|
357
376
|
}
|
|
358
377
|
}
|
|
359
|
-
async function handleBundleProxyRequest(req, res) {
|
|
360
|
-
const params = new URLSearchParams((req.url || "").split("?")[1] || "");
|
|
361
|
-
const target = params.get("url");
|
|
362
|
-
if (!target) {
|
|
363
|
-
applyFetchProxyCors(req, res);
|
|
364
|
-
res.statusCode = 400;
|
|
365
|
-
res.setHeader("Content-Type", "text/plain");
|
|
366
|
-
res.end("bundle-proxy: missing url query param");
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
let targetUrl;
|
|
370
|
-
try {
|
|
371
|
-
targetUrl = new URL(target);
|
|
372
|
-
} catch {
|
|
373
|
-
applyFetchProxyCors(req, res);
|
|
374
|
-
res.statusCode = 400;
|
|
375
|
-
res.setHeader("Content-Type", "text/plain");
|
|
376
|
-
res.end("bundle-proxy: invalid url");
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
if (!isLoopbackHost(targetUrl.hostname)) {
|
|
380
|
-
applyFetchProxyCors(req, res);
|
|
381
|
-
res.statusCode = 403;
|
|
382
|
-
res.setHeader("Content-Type", "text/plain");
|
|
383
|
-
res.end("bundle-proxy: only loopback targets allowed");
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
await handleFetchProxyRequest(req, res);
|
|
387
|
-
}
|
|
388
378
|
function handleAppApiRequest(req, res) {
|
|
389
379
|
const reqUrl = req.url || "";
|
|
390
380
|
let targetPath = "";
|
|
@@ -457,9 +447,9 @@ function handleAppApiRequest(req, res) {
|
|
|
457
447
|
buildAppApiProxyHeaders,
|
|
458
448
|
buildFetchProxyHeaders,
|
|
459
449
|
handleAppApiRequest,
|
|
460
|
-
handleBundleProxyRequest,
|
|
461
450
|
handleFetchProxyRequest,
|
|
462
451
|
isAppApiRequestUrl,
|
|
463
452
|
isBundleProxyRequestUrl,
|
|
464
|
-
isFetchProxyRequestUrl
|
|
453
|
+
isFetchProxyRequestUrl,
|
|
454
|
+
rejectUntrustedBridgeOrigin
|
|
465
455
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -25,12 +25,36 @@ __export(websocket_proxy_exports, {
|
|
|
25
25
|
WEBSOCKET_PROXY_HANDSHAKE_TIMEOUT_MS: () => WEBSOCKET_PROXY_HANDSHAKE_TIMEOUT_MS,
|
|
26
26
|
WEBSOCKET_PROXY_PATH: () => WEBSOCKET_PROXY_PATH,
|
|
27
27
|
handleWebSocketProxyUpgrade: () => handleWebSocketProxyUpgrade,
|
|
28
|
-
isWebSocketProxyRequestUrl: () => isWebSocketProxyRequestUrl
|
|
28
|
+
isWebSocketProxyRequestUrl: () => isWebSocketProxyRequestUrl,
|
|
29
|
+
rejectUntrustedBridgeUpgrade: () => rejectUntrustedBridgeUpgrade
|
|
29
30
|
});
|
|
30
31
|
module.exports = __toCommonJS(websocket_proxy_exports);
|
|
31
32
|
var import_crypto = require("crypto");
|
|
32
33
|
var import_http = require("http");
|
|
33
34
|
var import_https = require("https");
|
|
35
|
+
|
|
36
|
+
// src/backend-origin.ts
|
|
37
|
+
function normalizeHostname(hostname) {
|
|
38
|
+
return hostname.replace(/^\[|\]$/g, "").toLowerCase();
|
|
39
|
+
}
|
|
40
|
+
function isLoopbackHost(hostname) {
|
|
41
|
+
const normalized = normalizeHostname(hostname);
|
|
42
|
+
return normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "0.0.0.0" || normalized === "::1" || /^127(?:\.\d{1,3}){3}$/.test(normalized);
|
|
43
|
+
}
|
|
44
|
+
function isTrustedBridgeRequest(headers) {
|
|
45
|
+
const origin = headers.origin;
|
|
46
|
+
if (origin === void 0) return true;
|
|
47
|
+
try {
|
|
48
|
+
const { hostname, host } = new URL(String(origin));
|
|
49
|
+
return isLoopbackHost(hostname) || [headers.host, headers[":authority"], headers["x-forwarded-host"]].some(
|
|
50
|
+
(value) => typeof value === "string" && value.toLowerCase() === host
|
|
51
|
+
);
|
|
52
|
+
} catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/host/websocket-proxy.ts
|
|
34
58
|
var WEBSOCKET_PROXY_PATH = "/__websocket-proxy";
|
|
35
59
|
var WEBSOCKET_PROXY_HANDSHAKE_TIMEOUT_MS = 1e4;
|
|
36
60
|
var WEBSOCKET_PROTOCOL_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
@@ -63,6 +87,11 @@ ${message}`
|
|
|
63
87
|
}
|
|
64
88
|
socket.destroy();
|
|
65
89
|
}
|
|
90
|
+
function rejectUntrustedBridgeUpgrade(req, socket) {
|
|
91
|
+
if (isTrustedBridgeRequest(req.headers)) return false;
|
|
92
|
+
rejectUpgrade(socket, 403, "forbidden bridge origin");
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
66
95
|
function hasHeaderToken(value, token) {
|
|
67
96
|
return (value || "").split(",").some((part) => part.trim().toLowerCase() === token);
|
|
68
97
|
}
|
|
@@ -294,5 +323,6 @@ function handleWebSocketProxyUpgrade(req, socket, head, forwardOrigin = true) {
|
|
|
294
323
|
WEBSOCKET_PROXY_HANDSHAKE_TIMEOUT_MS,
|
|
295
324
|
WEBSOCKET_PROXY_PATH,
|
|
296
325
|
handleWebSocketProxyUpgrade,
|
|
297
|
-
isWebSocketProxyRequestUrl
|
|
326
|
+
isWebSocketProxyRequestUrl,
|
|
327
|
+
rejectUntrustedBridgeUpgrade
|
|
298
328
|
});
|
package/dist-lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/kotlin-host.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/dist-lib/menu.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.825 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|