peachsim 0.1.822 → 0.1.824
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/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 +169 -44
- 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 +169 -44
- 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 +200 -77
- 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 +200 -77
- package/dist-lib/swift-compile.cjs +169 -44
- package/dist-lib/swift-compile.mjs +169 -44
- 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 +169 -44
- 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
- package/src/swift-compile.ts +183 -48
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.824 | (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;
|
|
@@ -26504,6 +26504,18 @@ function isLoopbackHost(hostname) {
|
|
|
26504
26504
|
const normalized = normalizeHostname(hostname);
|
|
26505
26505
|
return normalized === "localhost" || normalized.endsWith(".localhost") || normalized === "0.0.0.0" || normalized === "::1" || /^127(?:\.\d{1,3}){3}$/.test(normalized);
|
|
26506
26506
|
}
|
|
26507
|
+
function isTrustedBridgeRequest(headers) {
|
|
26508
|
+
const origin = headers.origin;
|
|
26509
|
+
if (origin === void 0) return true;
|
|
26510
|
+
try {
|
|
26511
|
+
const { hostname, host: host2 } = new URL(String(origin));
|
|
26512
|
+
return isLoopbackHost(hostname) || [headers.host, headers[":authority"], headers["x-forwarded-host"]].some(
|
|
26513
|
+
(value) => typeof value === "string" && value.toLowerCase() === host2
|
|
26514
|
+
);
|
|
26515
|
+
} catch {
|
|
26516
|
+
return false;
|
|
26517
|
+
}
|
|
26518
|
+
}
|
|
26507
26519
|
function loopbackOriginOf(value) {
|
|
26508
26520
|
try {
|
|
26509
26521
|
const url = new URL(value);
|
|
@@ -30022,10 +30034,25 @@ function tableProtocolConformances(sources) {
|
|
|
30022
30034
|
for (const source of sources) {
|
|
30023
30035
|
const code = swiftCodeMask(source);
|
|
30024
30036
|
for (const owner of code.matchAll(
|
|
30025
|
-
/\b(?:class|extension)\s+([A-Za-z_]\w*)
|
|
30037
|
+
/\b(?:class|extension|protocol)\s+(?!(?:func|var)\b)([A-Za-z_]\w*)([^{}]*)\{/g
|
|
30026
30038
|
)) {
|
|
30039
|
+
const header = owner[2];
|
|
30040
|
+
let depth = 0;
|
|
30041
|
+
let colon = -1;
|
|
30042
|
+
for (let at = 0; at < header.length; at++) {
|
|
30043
|
+
if (header[at] === "<") depth++;
|
|
30044
|
+
else if (header[at] === ">") depth--;
|
|
30045
|
+
else if (header[at] === ":" && depth === 0) {
|
|
30046
|
+
colon = at;
|
|
30047
|
+
break;
|
|
30048
|
+
}
|
|
30049
|
+
}
|
|
30050
|
+
if (colon === -1) continue;
|
|
30027
30051
|
const inherited = parents.get(owner[1]) ?? /* @__PURE__ */ new Set();
|
|
30028
|
-
for (const type of
|
|
30052
|
+
for (const type of splitTopLevel(header.slice(colon + 1).split(/\bwhere\b/)[0])) {
|
|
30053
|
+
const name2 = /^\s*(?:[A-Za-z_]\w*\.)*([A-Za-z_]\w*)/.exec(type)?.[1];
|
|
30054
|
+
if (name2 && !type.includes("<")) inherited.add(name2);
|
|
30055
|
+
}
|
|
30029
30056
|
parents.set(owner[1], inherited);
|
|
30030
30057
|
}
|
|
30031
30058
|
}
|
|
@@ -30049,47 +30076,148 @@ function tableProtocolConformances(sources) {
|
|
|
30049
30076
|
function lowerTableProtocolMethods(source, conformances) {
|
|
30050
30077
|
const code = swiftCodeMask(source);
|
|
30051
30078
|
const dataSource = {
|
|
30052
|
-
numberOfRowsInSection:
|
|
30053
|
-
|
|
30054
|
-
|
|
30055
|
-
|
|
30056
|
-
|
|
30057
|
-
|
|
30079
|
+
numberOfRowsInSection: [
|
|
30080
|
+
"tableView:numberOfRowsInSection:",
|
|
30081
|
+
"_:UITableView,numberOfRowsInSection:Int->Int"
|
|
30082
|
+
],
|
|
30083
|
+
cellForRowAt: [
|
|
30084
|
+
"tableView:cellForRowAtIndexPath:",
|
|
30085
|
+
"_:UITableView,cellForRowAt:IndexPath->UITableViewCell"
|
|
30086
|
+
],
|
|
30087
|
+
titleForHeaderInSection: [
|
|
30088
|
+
"tableView:titleForHeaderInSection:",
|
|
30089
|
+
"_:UITableView,titleForHeaderInSection:Int->String?"
|
|
30090
|
+
],
|
|
30091
|
+
titleForFooterInSection: [
|
|
30092
|
+
"tableView:titleForFooterInSection:",
|
|
30093
|
+
"_:UITableView,titleForFooterInSection:Int->String?"
|
|
30094
|
+
],
|
|
30095
|
+
canEditRowAt: [
|
|
30096
|
+
"tableView:canEditRowAtIndexPath:",
|
|
30097
|
+
"_:UITableView,canEditRowAt:IndexPath->Bool"
|
|
30098
|
+
],
|
|
30099
|
+
commit: [
|
|
30100
|
+
"tableView:commitEditingStyle:forRowAtIndexPath:",
|
|
30101
|
+
"_:UITableView,commit:UITableViewCell.EditingStyle,forRowAt:IndexPath->Void"
|
|
30102
|
+
]
|
|
30058
30103
|
};
|
|
30059
30104
|
const delegate = {
|
|
30060
|
-
willDisplay:
|
|
30061
|
-
|
|
30062
|
-
|
|
30063
|
-
|
|
30064
|
-
|
|
30065
|
-
|
|
30066
|
-
|
|
30067
|
-
|
|
30068
|
-
|
|
30069
|
-
|
|
30070
|
-
|
|
30071
|
-
|
|
30072
|
-
|
|
30073
|
-
|
|
30074
|
-
|
|
30075
|
-
|
|
30076
|
-
|
|
30077
|
-
|
|
30078
|
-
|
|
30079
|
-
|
|
30080
|
-
|
|
30081
|
-
|
|
30082
|
-
|
|
30083
|
-
|
|
30084
|
-
|
|
30085
|
-
|
|
30086
|
-
|
|
30105
|
+
willDisplay: [
|
|
30106
|
+
"tableView:willDisplayCell:forRowAtIndexPath:",
|
|
30107
|
+
"_:UITableView,willDisplay:UITableViewCell,forRowAt:IndexPath->Void"
|
|
30108
|
+
],
|
|
30109
|
+
didEndDisplaying: [
|
|
30110
|
+
"tableView:didEndDisplayingCell:forRowAtIndexPath:",
|
|
30111
|
+
"_:UITableView,didEndDisplaying:UITableViewCell,forRowAt:IndexPath->Void"
|
|
30112
|
+
],
|
|
30113
|
+
heightForRowAt: [
|
|
30114
|
+
"tableView:heightForRowAtIndexPath:",
|
|
30115
|
+
"_:UITableView,heightForRowAt:IndexPath->CGFloat"
|
|
30116
|
+
],
|
|
30117
|
+
estimatedHeightForRowAt: [
|
|
30118
|
+
"tableView:estimatedHeightForRowAtIndexPath:",
|
|
30119
|
+
"_:UITableView,estimatedHeightForRowAt:IndexPath->CGFloat"
|
|
30120
|
+
],
|
|
30121
|
+
heightForHeaderInSection: [
|
|
30122
|
+
"tableView:heightForHeaderInSection:",
|
|
30123
|
+
"_:UITableView,heightForHeaderInSection:Int->CGFloat"
|
|
30124
|
+
],
|
|
30125
|
+
heightForFooterInSection: [
|
|
30126
|
+
"tableView:heightForFooterInSection:",
|
|
30127
|
+
"_:UITableView,heightForFooterInSection:Int->CGFloat"
|
|
30128
|
+
],
|
|
30129
|
+
estimatedHeightForHeaderInSection: [
|
|
30130
|
+
"tableView:estimatedHeightForHeaderInSection:",
|
|
30131
|
+
"_:UITableView,estimatedHeightForHeaderInSection:Int->CGFloat"
|
|
30132
|
+
],
|
|
30133
|
+
estimatedHeightForFooterInSection: [
|
|
30134
|
+
"tableView:estimatedHeightForFooterInSection:",
|
|
30135
|
+
"_:UITableView,estimatedHeightForFooterInSection:Int->CGFloat"
|
|
30136
|
+
],
|
|
30137
|
+
viewForHeaderInSection: [
|
|
30138
|
+
"tableView:viewForHeaderInSection:",
|
|
30139
|
+
"_:UITableView,viewForHeaderInSection:Int->UIView?"
|
|
30140
|
+
],
|
|
30141
|
+
viewForFooterInSection: [
|
|
30142
|
+
"tableView:viewForFooterInSection:",
|
|
30143
|
+
"_:UITableView,viewForFooterInSection:Int->UIView?"
|
|
30144
|
+
],
|
|
30145
|
+
willDisplayHeaderView: [
|
|
30146
|
+
"tableView:willDisplayHeaderView:forSection:",
|
|
30147
|
+
"_:UITableView,willDisplayHeaderView:UIView,forSection:Int->Void"
|
|
30148
|
+
],
|
|
30149
|
+
willDisplayFooterView: [
|
|
30150
|
+
"tableView:willDisplayFooterView:forSection:",
|
|
30151
|
+
"_:UITableView,willDisplayFooterView:UIView,forSection:Int->Void"
|
|
30152
|
+
],
|
|
30153
|
+
didEndDisplayingHeaderView: [
|
|
30154
|
+
"tableView:didEndDisplayingHeaderView:forSection:",
|
|
30155
|
+
"_:UITableView,didEndDisplayingHeaderView:UIView,forSection:Int->Void"
|
|
30156
|
+
],
|
|
30157
|
+
didEndDisplayingFooterView: [
|
|
30158
|
+
"tableView:didEndDisplayingFooterView:forSection:",
|
|
30159
|
+
"_:UITableView,didEndDisplayingFooterView:UIView,forSection:Int->Void"
|
|
30160
|
+
],
|
|
30161
|
+
shouldHighlightRowAt: [
|
|
30162
|
+
"tableView:shouldHighlightRowAtIndexPath:",
|
|
30163
|
+
"_:UITableView,shouldHighlightRowAt:IndexPath->Bool"
|
|
30164
|
+
],
|
|
30165
|
+
didHighlightRowAt: [
|
|
30166
|
+
"tableView:didHighlightRowAtIndexPath:",
|
|
30167
|
+
"_:UITableView,didHighlightRowAt:IndexPath->Void"
|
|
30168
|
+
],
|
|
30169
|
+
didUnhighlightRowAt: [
|
|
30170
|
+
"tableView:didUnhighlightRowAtIndexPath:",
|
|
30171
|
+
"_:UITableView,didUnhighlightRowAt:IndexPath->Void"
|
|
30172
|
+
],
|
|
30173
|
+
willSelectRowAt: [
|
|
30174
|
+
"tableView:willSelectRowAtIndexPath:",
|
|
30175
|
+
"_:UITableView,willSelectRowAt:IndexPath->IndexPath?"
|
|
30176
|
+
],
|
|
30177
|
+
willDeselectRowAt: [
|
|
30178
|
+
"tableView:willDeselectRowAtIndexPath:",
|
|
30179
|
+
"_:UITableView,willDeselectRowAt:IndexPath->IndexPath?"
|
|
30180
|
+
],
|
|
30181
|
+
didSelectRowAt: [
|
|
30182
|
+
"tableView:didSelectRowAtIndexPath:",
|
|
30183
|
+
"_:UITableView,didSelectRowAt:IndexPath->Void"
|
|
30184
|
+
],
|
|
30185
|
+
didDeselectRowAt: [
|
|
30186
|
+
"tableView:didDeselectRowAtIndexPath:",
|
|
30187
|
+
"_:UITableView,didDeselectRowAt:IndexPath->Void"
|
|
30188
|
+
],
|
|
30189
|
+
accessoryButtonTappedForRowWith: [
|
|
30190
|
+
"tableView:accessoryButtonTappedForRowWithIndexPath:",
|
|
30191
|
+
"_:UITableView,accessoryButtonTappedForRowWith:IndexPath->Void"
|
|
30192
|
+
],
|
|
30193
|
+
editingStyleForRowAt: [
|
|
30194
|
+
"tableView:editingStyleForRowAtIndexPath:",
|
|
30195
|
+
"_:UITableView,editingStyleForRowAt:IndexPath->UITableViewCell.EditingStyle"
|
|
30196
|
+
],
|
|
30197
|
+
leadingSwipeActionsConfigurationForRowAt: [
|
|
30198
|
+
"tableView:leadingSwipeActionsConfigurationForRowAtIndexPath:",
|
|
30199
|
+
"_:UITableView,leadingSwipeActionsConfigurationForRowAt:IndexPath->UISwipeActionsConfiguration?"
|
|
30200
|
+
],
|
|
30201
|
+
trailingSwipeActionsConfigurationForRowAt: [
|
|
30202
|
+
"tableView:trailingSwipeActionsConfigurationForRowAtIndexPath:",
|
|
30203
|
+
"_:UITableView,trailingSwipeActionsConfigurationForRowAt:IndexPath->UISwipeActionsConfiguration?"
|
|
30204
|
+
],
|
|
30205
|
+
willBeginEditingRowAt: [
|
|
30206
|
+
"tableView:willBeginEditingRowAtIndexPath:",
|
|
30207
|
+
"_:UITableView,willBeginEditingRowAt:IndexPath->Void"
|
|
30208
|
+
],
|
|
30209
|
+
didEndEditingRowAt: [
|
|
30210
|
+
"tableView:didEndEditingRowAtIndexPath:",
|
|
30211
|
+
"_:UITableView,didEndEditingRowAt:IndexPath?->Void"
|
|
30212
|
+
]
|
|
30087
30213
|
};
|
|
30088
30214
|
const braces = [...code.matchAll(/[{}]/g)].map((match) => match.index);
|
|
30089
30215
|
const edits = [];
|
|
30090
30216
|
for (const owner of code.matchAll(/\b(?:class|extension)\s+([A-Za-z_]\w*)[^{}]*\{/g)) {
|
|
30091
30217
|
const conforms = conformances.get(owner[1]);
|
|
30092
30218
|
if (!conforms) continue;
|
|
30219
|
+
if (/^\s*</.test(owner[0].slice(owner[0].indexOf(owner[1]) + owner[1].length)))
|
|
30220
|
+
continue;
|
|
30093
30221
|
const selectors = {
|
|
30094
30222
|
...conforms.has("UITableViewDataSource") ? dataSource : {},
|
|
30095
30223
|
...conforms.has("UITableViewDelegate") ? delegate : {}
|
|
@@ -30113,15 +30241,24 @@ function lowerTableProtocolMethods(source, conformances) {
|
|
|
30113
30241
|
if (/\b(?:override|static|class)\b|@(?:objc|ObjC|IBAction)\b/.test(attributes))
|
|
30114
30242
|
continue;
|
|
30115
30243
|
let selector;
|
|
30116
|
-
|
|
30244
|
+
const method = /^func\s+(tableView|numberOfSections)\s*\(([^()]*)\)\s*(?:->\s*([\w.?!]+|\(\s*\)))?\s*$/.exec(
|
|
30117
30245
|
signature
|
|
30118
|
-
)
|
|
30119
|
-
|
|
30120
|
-
|
|
30121
|
-
|
|
30122
|
-
|
|
30123
|
-
);
|
|
30124
|
-
|
|
30246
|
+
);
|
|
30247
|
+
if (method) {
|
|
30248
|
+
const parameters = splitTopLevel(method[2]).map((parameter) => {
|
|
30249
|
+
const match = /^(?:(\w+)\s+)?(\w+)\s*:\s*([\w.?]+)\s*$/.exec(parameter);
|
|
30250
|
+
return match ? `${match[1] ?? match[2]}:${match[3]}` : "";
|
|
30251
|
+
}).join(",").replace(/\b(?:UIKit|UIKitCore|Foundation|CoreGraphics|Swift)\./g, "");
|
|
30252
|
+
const result2 = (method[3] ?? "Void").replace(/\(\s*\)/, "Void").replaceAll("!", "?").replace(/\b(?:UIKit|UIKitCore|Foundation|CoreGraphics|Swift)\./g, "");
|
|
30253
|
+
if (method[1] === "numberOfSections") {
|
|
30254
|
+
if (conforms.has("UITableViewDataSource") && parameters === "in:UITableView" && result2 === "Int")
|
|
30255
|
+
selector = "numberOfSectionsInTableView:";
|
|
30256
|
+
} else {
|
|
30257
|
+
const label = /^_:UITableView,(\w+):/.exec(parameters)?.[1];
|
|
30258
|
+
const requirement = label ? selectors[label] : void 0;
|
|
30259
|
+
if (requirement && `${parameters}->${result2}` === requirement[1])
|
|
30260
|
+
selector = requirement[0];
|
|
30261
|
+
}
|
|
30125
30262
|
}
|
|
30126
30263
|
if (selector)
|
|
30127
30264
|
edits.push([
|
|
@@ -39424,6 +39561,13 @@ function buildAppApiProxyHeaders(reqHeaders, targetUrl) {
|
|
|
39424
39561
|
}
|
|
39425
39562
|
return headers;
|
|
39426
39563
|
}
|
|
39564
|
+
function rejectUntrustedBridgeOrigin(req, res) {
|
|
39565
|
+
if (isTrustedBridgeRequest(req.headers)) return false;
|
|
39566
|
+
res.statusCode = 403;
|
|
39567
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
39568
|
+
res.end(`peach bridge: origin ${req.headers.origin} may not use this bridge`);
|
|
39569
|
+
return true;
|
|
39570
|
+
}
|
|
39427
39571
|
function isFetchProxyRequestUrl(rawUrl) {
|
|
39428
39572
|
return rawUrl?.startsWith("/__fetch-proxy?") || rawUrl?.startsWith("/__proxy?") || false;
|
|
39429
39573
|
}
|
|
@@ -39563,35 +39707,6 @@ async function handleFetchProxyRequest(req, res) {
|
|
|
39563
39707
|
else req.socket.destroy();
|
|
39564
39708
|
}
|
|
39565
39709
|
}
|
|
39566
|
-
async function handleBundleProxyRequest(req, res) {
|
|
39567
|
-
const params = new URLSearchParams((req.url || "").split("?")[1] || "");
|
|
39568
|
-
const target = params.get("url");
|
|
39569
|
-
if (!target) {
|
|
39570
|
-
applyFetchProxyCors(req, res);
|
|
39571
|
-
res.statusCode = 400;
|
|
39572
|
-
res.setHeader("Content-Type", "text/plain");
|
|
39573
|
-
res.end("bundle-proxy: missing url query param");
|
|
39574
|
-
return;
|
|
39575
|
-
}
|
|
39576
|
-
let targetUrl;
|
|
39577
|
-
try {
|
|
39578
|
-
targetUrl = new URL(target);
|
|
39579
|
-
} catch {
|
|
39580
|
-
applyFetchProxyCors(req, res);
|
|
39581
|
-
res.statusCode = 400;
|
|
39582
|
-
res.setHeader("Content-Type", "text/plain");
|
|
39583
|
-
res.end("bundle-proxy: invalid url");
|
|
39584
|
-
return;
|
|
39585
|
-
}
|
|
39586
|
-
if (!isLoopbackHost(targetUrl.hostname)) {
|
|
39587
|
-
applyFetchProxyCors(req, res);
|
|
39588
|
-
res.statusCode = 403;
|
|
39589
|
-
res.setHeader("Content-Type", "text/plain");
|
|
39590
|
-
res.end("bundle-proxy: only loopback targets allowed");
|
|
39591
|
-
return;
|
|
39592
|
-
}
|
|
39593
|
-
await handleFetchProxyRequest(req, res);
|
|
39594
|
-
}
|
|
39595
39710
|
function handleAppApiRequest(req, res) {
|
|
39596
39711
|
const reqUrl = req.url || "";
|
|
39597
39712
|
let targetPath = "";
|
|
@@ -39717,15 +39832,15 @@ ${privateKey.toString("base64").match(/.{1,64}/g)?.join("\n")}
|
|
|
39717
39832
|
settings: { maxConcurrentStreams: 256 }
|
|
39718
39833
|
},
|
|
39719
39834
|
(req, res) => {
|
|
39835
|
+
if (rejectUntrustedBridgeOrigin(req, res)) return;
|
|
39720
39836
|
res.setHeader("Cross-Origin-Resource-Policy", "cross-origin");
|
|
39721
39837
|
res.setHeader("Timing-Allow-Origin", "*");
|
|
39722
|
-
|
|
39723
|
-
if (!handler) {
|
|
39838
|
+
if (!isBundleProxyRequestUrl(req.url) && !isFetchProxyRequestUrl(req.url)) {
|
|
39724
39839
|
res.writeHead(404);
|
|
39725
39840
|
res.end();
|
|
39726
39841
|
return;
|
|
39727
39842
|
}
|
|
39728
|
-
void
|
|
39843
|
+
void handleFetchProxyRequest(req, res).catch(() => res.destroy());
|
|
39729
39844
|
}
|
|
39730
39845
|
);
|
|
39731
39846
|
server.on("session", (session) => {
|
|
@@ -40806,6 +40921,11 @@ ${message}`
|
|
|
40806
40921
|
}
|
|
40807
40922
|
socket.destroy();
|
|
40808
40923
|
}
|
|
40924
|
+
function rejectUntrustedBridgeUpgrade(req, socket) {
|
|
40925
|
+
if (isTrustedBridgeRequest(req.headers)) return false;
|
|
40926
|
+
rejectUpgrade(socket, 403, "forbidden bridge origin");
|
|
40927
|
+
return true;
|
|
40928
|
+
}
|
|
40809
40929
|
function hasHeaderToken(value, token) {
|
|
40810
40930
|
return (value || "").split(",").some((part) => part.trim().toLowerCase() === token);
|
|
40811
40931
|
}
|
|
@@ -41039,6 +41159,7 @@ var init_websocket_proxy = __esm({
|
|
|
41039
41159
|
import_crypto = require("crypto");
|
|
41040
41160
|
import_http3 = require("http");
|
|
41041
41161
|
import_https2 = require("https");
|
|
41162
|
+
init_backend_origin();
|
|
41042
41163
|
WEBSOCKET_PROXY_PATH = "/__websocket-proxy";
|
|
41043
41164
|
WEBSOCKET_PROXY_HANDSHAKE_TIMEOUT_MS = 1e4;
|
|
41044
41165
|
WEBSOCKET_PROTOCOL_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
@@ -45648,6 +45769,7 @@ var init_bridge_host = __esm({
|
|
|
45648
45769
|
this.wss = new import_ws.WebSocketServer({ noServer: true });
|
|
45649
45770
|
this.wireWebSocketServer();
|
|
45650
45771
|
server.on("upgrade", (req, socket, head) => {
|
|
45772
|
+
if (rejectUntrustedBridgeUpgrade(req, socket)) return;
|
|
45651
45773
|
if (handleWebSocketProxyUpgrade(req, socket, head)) return;
|
|
45652
45774
|
this.wss?.handleUpgrade(req, socket, head, (ws) => {
|
|
45653
45775
|
this.wss?.emit("connection", ws, req);
|
|
@@ -46418,6 +46540,7 @@ var init_bridge_host = __esm({
|
|
|
46418
46540
|
* non-upgrade routes that don't match serve index.html (SPA behavior) so
|
|
46419
46541
|
* electron's webContents can navigate freely inside the runtime. */
|
|
46420
46542
|
handleHttpRequest(req, res) {
|
|
46543
|
+
if (rejectUntrustedBridgeOrigin(req, res)) return;
|
|
46421
46544
|
if (req.url === "/__peach/fetch-transport") {
|
|
46422
46545
|
res.writeHead(200, {
|
|
46423
46546
|
"Content-Type": "application/json",
|
|
@@ -46598,7 +46721,7 @@ var init_bridge_host = __esm({
|
|
|
46598
46721
|
return;
|
|
46599
46722
|
}
|
|
46600
46723
|
if (url.pathname === "/__bundle-proxy") {
|
|
46601
|
-
void
|
|
46724
|
+
void handleFetchProxyRequest(req, res);
|
|
46602
46725
|
return;
|
|
46603
46726
|
}
|
|
46604
46727
|
if (url.pathname === "/__server-scan") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.824 | (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;
|
|
@@ -1253,10 +1253,25 @@ function tableProtocolConformances(sources) {
|
|
|
1253
1253
|
for (const source of sources) {
|
|
1254
1254
|
const code = swiftCodeMask(source);
|
|
1255
1255
|
for (const owner of code.matchAll(
|
|
1256
|
-
/\b(?:class|extension)\s+([A-Za-z_]\w*)
|
|
1256
|
+
/\b(?:class|extension|protocol)\s+(?!(?:func|var)\b)([A-Za-z_]\w*)([^{}]*)\{/g
|
|
1257
1257
|
)) {
|
|
1258
|
+
const header = owner[2];
|
|
1259
|
+
let depth = 0;
|
|
1260
|
+
let colon = -1;
|
|
1261
|
+
for (let at = 0; at < header.length; at++) {
|
|
1262
|
+
if (header[at] === "<") depth++;
|
|
1263
|
+
else if (header[at] === ">") depth--;
|
|
1264
|
+
else if (header[at] === ":" && depth === 0) {
|
|
1265
|
+
colon = at;
|
|
1266
|
+
break;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
if (colon === -1) continue;
|
|
1258
1270
|
const inherited = parents.get(owner[1]) ?? /* @__PURE__ */ new Set();
|
|
1259
|
-
for (const type of
|
|
1271
|
+
for (const type of splitTopLevel(header.slice(colon + 1).split(/\bwhere\b/)[0])) {
|
|
1272
|
+
const name = /^\s*(?:[A-Za-z_]\w*\.)*([A-Za-z_]\w*)/.exec(type)?.[1];
|
|
1273
|
+
if (name && !type.includes("<")) inherited.add(name);
|
|
1274
|
+
}
|
|
1260
1275
|
parents.set(owner[1], inherited);
|
|
1261
1276
|
}
|
|
1262
1277
|
}
|
|
@@ -1280,47 +1295,148 @@ function tableProtocolConformances(sources) {
|
|
|
1280
1295
|
function lowerTableProtocolMethods(source, conformances) {
|
|
1281
1296
|
const code = swiftCodeMask(source);
|
|
1282
1297
|
const dataSource = {
|
|
1283
|
-
numberOfRowsInSection:
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1298
|
+
numberOfRowsInSection: [
|
|
1299
|
+
"tableView:numberOfRowsInSection:",
|
|
1300
|
+
"_:UITableView,numberOfRowsInSection:Int->Int"
|
|
1301
|
+
],
|
|
1302
|
+
cellForRowAt: [
|
|
1303
|
+
"tableView:cellForRowAtIndexPath:",
|
|
1304
|
+
"_:UITableView,cellForRowAt:IndexPath->UITableViewCell"
|
|
1305
|
+
],
|
|
1306
|
+
titleForHeaderInSection: [
|
|
1307
|
+
"tableView:titleForHeaderInSection:",
|
|
1308
|
+
"_:UITableView,titleForHeaderInSection:Int->String?"
|
|
1309
|
+
],
|
|
1310
|
+
titleForFooterInSection: [
|
|
1311
|
+
"tableView:titleForFooterInSection:",
|
|
1312
|
+
"_:UITableView,titleForFooterInSection:Int->String?"
|
|
1313
|
+
],
|
|
1314
|
+
canEditRowAt: [
|
|
1315
|
+
"tableView:canEditRowAtIndexPath:",
|
|
1316
|
+
"_:UITableView,canEditRowAt:IndexPath->Bool"
|
|
1317
|
+
],
|
|
1318
|
+
commit: [
|
|
1319
|
+
"tableView:commitEditingStyle:forRowAtIndexPath:",
|
|
1320
|
+
"_:UITableView,commit:UITableViewCell.EditingStyle,forRowAt:IndexPath->Void"
|
|
1321
|
+
]
|
|
1289
1322
|
};
|
|
1290
1323
|
const delegate = {
|
|
1291
|
-
willDisplay:
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1324
|
+
willDisplay: [
|
|
1325
|
+
"tableView:willDisplayCell:forRowAtIndexPath:",
|
|
1326
|
+
"_:UITableView,willDisplay:UITableViewCell,forRowAt:IndexPath->Void"
|
|
1327
|
+
],
|
|
1328
|
+
didEndDisplaying: [
|
|
1329
|
+
"tableView:didEndDisplayingCell:forRowAtIndexPath:",
|
|
1330
|
+
"_:UITableView,didEndDisplaying:UITableViewCell,forRowAt:IndexPath->Void"
|
|
1331
|
+
],
|
|
1332
|
+
heightForRowAt: [
|
|
1333
|
+
"tableView:heightForRowAtIndexPath:",
|
|
1334
|
+
"_:UITableView,heightForRowAt:IndexPath->CGFloat"
|
|
1335
|
+
],
|
|
1336
|
+
estimatedHeightForRowAt: [
|
|
1337
|
+
"tableView:estimatedHeightForRowAtIndexPath:",
|
|
1338
|
+
"_:UITableView,estimatedHeightForRowAt:IndexPath->CGFloat"
|
|
1339
|
+
],
|
|
1340
|
+
heightForHeaderInSection: [
|
|
1341
|
+
"tableView:heightForHeaderInSection:",
|
|
1342
|
+
"_:UITableView,heightForHeaderInSection:Int->CGFloat"
|
|
1343
|
+
],
|
|
1344
|
+
heightForFooterInSection: [
|
|
1345
|
+
"tableView:heightForFooterInSection:",
|
|
1346
|
+
"_:UITableView,heightForFooterInSection:Int->CGFloat"
|
|
1347
|
+
],
|
|
1348
|
+
estimatedHeightForHeaderInSection: [
|
|
1349
|
+
"tableView:estimatedHeightForHeaderInSection:",
|
|
1350
|
+
"_:UITableView,estimatedHeightForHeaderInSection:Int->CGFloat"
|
|
1351
|
+
],
|
|
1352
|
+
estimatedHeightForFooterInSection: [
|
|
1353
|
+
"tableView:estimatedHeightForFooterInSection:",
|
|
1354
|
+
"_:UITableView,estimatedHeightForFooterInSection:Int->CGFloat"
|
|
1355
|
+
],
|
|
1356
|
+
viewForHeaderInSection: [
|
|
1357
|
+
"tableView:viewForHeaderInSection:",
|
|
1358
|
+
"_:UITableView,viewForHeaderInSection:Int->UIView?"
|
|
1359
|
+
],
|
|
1360
|
+
viewForFooterInSection: [
|
|
1361
|
+
"tableView:viewForFooterInSection:",
|
|
1362
|
+
"_:UITableView,viewForFooterInSection:Int->UIView?"
|
|
1363
|
+
],
|
|
1364
|
+
willDisplayHeaderView: [
|
|
1365
|
+
"tableView:willDisplayHeaderView:forSection:",
|
|
1366
|
+
"_:UITableView,willDisplayHeaderView:UIView,forSection:Int->Void"
|
|
1367
|
+
],
|
|
1368
|
+
willDisplayFooterView: [
|
|
1369
|
+
"tableView:willDisplayFooterView:forSection:",
|
|
1370
|
+
"_:UITableView,willDisplayFooterView:UIView,forSection:Int->Void"
|
|
1371
|
+
],
|
|
1372
|
+
didEndDisplayingHeaderView: [
|
|
1373
|
+
"tableView:didEndDisplayingHeaderView:forSection:",
|
|
1374
|
+
"_:UITableView,didEndDisplayingHeaderView:UIView,forSection:Int->Void"
|
|
1375
|
+
],
|
|
1376
|
+
didEndDisplayingFooterView: [
|
|
1377
|
+
"tableView:didEndDisplayingFooterView:forSection:",
|
|
1378
|
+
"_:UITableView,didEndDisplayingFooterView:UIView,forSection:Int->Void"
|
|
1379
|
+
],
|
|
1380
|
+
shouldHighlightRowAt: [
|
|
1381
|
+
"tableView:shouldHighlightRowAtIndexPath:",
|
|
1382
|
+
"_:UITableView,shouldHighlightRowAt:IndexPath->Bool"
|
|
1383
|
+
],
|
|
1384
|
+
didHighlightRowAt: [
|
|
1385
|
+
"tableView:didHighlightRowAtIndexPath:",
|
|
1386
|
+
"_:UITableView,didHighlightRowAt:IndexPath->Void"
|
|
1387
|
+
],
|
|
1388
|
+
didUnhighlightRowAt: [
|
|
1389
|
+
"tableView:didUnhighlightRowAtIndexPath:",
|
|
1390
|
+
"_:UITableView,didUnhighlightRowAt:IndexPath->Void"
|
|
1391
|
+
],
|
|
1392
|
+
willSelectRowAt: [
|
|
1393
|
+
"tableView:willSelectRowAtIndexPath:",
|
|
1394
|
+
"_:UITableView,willSelectRowAt:IndexPath->IndexPath?"
|
|
1395
|
+
],
|
|
1396
|
+
willDeselectRowAt: [
|
|
1397
|
+
"tableView:willDeselectRowAtIndexPath:",
|
|
1398
|
+
"_:UITableView,willDeselectRowAt:IndexPath->IndexPath?"
|
|
1399
|
+
],
|
|
1400
|
+
didSelectRowAt: [
|
|
1401
|
+
"tableView:didSelectRowAtIndexPath:",
|
|
1402
|
+
"_:UITableView,didSelectRowAt:IndexPath->Void"
|
|
1403
|
+
],
|
|
1404
|
+
didDeselectRowAt: [
|
|
1405
|
+
"tableView:didDeselectRowAtIndexPath:",
|
|
1406
|
+
"_:UITableView,didDeselectRowAt:IndexPath->Void"
|
|
1407
|
+
],
|
|
1408
|
+
accessoryButtonTappedForRowWith: [
|
|
1409
|
+
"tableView:accessoryButtonTappedForRowWithIndexPath:",
|
|
1410
|
+
"_:UITableView,accessoryButtonTappedForRowWith:IndexPath->Void"
|
|
1411
|
+
],
|
|
1412
|
+
editingStyleForRowAt: [
|
|
1413
|
+
"tableView:editingStyleForRowAtIndexPath:",
|
|
1414
|
+
"_:UITableView,editingStyleForRowAt:IndexPath->UITableViewCell.EditingStyle"
|
|
1415
|
+
],
|
|
1416
|
+
leadingSwipeActionsConfigurationForRowAt: [
|
|
1417
|
+
"tableView:leadingSwipeActionsConfigurationForRowAtIndexPath:",
|
|
1418
|
+
"_:UITableView,leadingSwipeActionsConfigurationForRowAt:IndexPath->UISwipeActionsConfiguration?"
|
|
1419
|
+
],
|
|
1420
|
+
trailingSwipeActionsConfigurationForRowAt: [
|
|
1421
|
+
"tableView:trailingSwipeActionsConfigurationForRowAtIndexPath:",
|
|
1422
|
+
"_:UITableView,trailingSwipeActionsConfigurationForRowAt:IndexPath->UISwipeActionsConfiguration?"
|
|
1423
|
+
],
|
|
1424
|
+
willBeginEditingRowAt: [
|
|
1425
|
+
"tableView:willBeginEditingRowAtIndexPath:",
|
|
1426
|
+
"_:UITableView,willBeginEditingRowAt:IndexPath->Void"
|
|
1427
|
+
],
|
|
1428
|
+
didEndEditingRowAt: [
|
|
1429
|
+
"tableView:didEndEditingRowAtIndexPath:",
|
|
1430
|
+
"_:UITableView,didEndEditingRowAt:IndexPath?->Void"
|
|
1431
|
+
]
|
|
1318
1432
|
};
|
|
1319
1433
|
const braces = [...code.matchAll(/[{}]/g)].map((match) => match.index);
|
|
1320
1434
|
const edits = [];
|
|
1321
1435
|
for (const owner of code.matchAll(/\b(?:class|extension)\s+([A-Za-z_]\w*)[^{}]*\{/g)) {
|
|
1322
1436
|
const conforms = conformances.get(owner[1]);
|
|
1323
1437
|
if (!conforms) continue;
|
|
1438
|
+
if (/^\s*</.test(owner[0].slice(owner[0].indexOf(owner[1]) + owner[1].length)))
|
|
1439
|
+
continue;
|
|
1324
1440
|
const selectors = {
|
|
1325
1441
|
...conforms.has("UITableViewDataSource") ? dataSource : {},
|
|
1326
1442
|
...conforms.has("UITableViewDelegate") ? delegate : {}
|
|
@@ -1344,15 +1460,24 @@ function lowerTableProtocolMethods(source, conformances) {
|
|
|
1344
1460
|
if (/\b(?:override|static|class)\b|@(?:objc|ObjC|IBAction)\b/.test(attributes))
|
|
1345
1461
|
continue;
|
|
1346
1462
|
let selector;
|
|
1347
|
-
|
|
1463
|
+
const method = /^func\s+(tableView|numberOfSections)\s*\(([^()]*)\)\s*(?:->\s*([\w.?!]+|\(\s*\)))?\s*$/.exec(
|
|
1348
1464
|
signature
|
|
1349
|
-
)
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
);
|
|
1355
|
-
|
|
1465
|
+
);
|
|
1466
|
+
if (method) {
|
|
1467
|
+
const parameters = splitTopLevel(method[2]).map((parameter) => {
|
|
1468
|
+
const match = /^(?:(\w+)\s+)?(\w+)\s*:\s*([\w.?]+)\s*$/.exec(parameter);
|
|
1469
|
+
return match ? `${match[1] ?? match[2]}:${match[3]}` : "";
|
|
1470
|
+
}).join(",").replace(/\b(?:UIKit|UIKitCore|Foundation|CoreGraphics|Swift)\./g, "");
|
|
1471
|
+
const result2 = (method[3] ?? "Void").replace(/\(\s*\)/, "Void").replaceAll("!", "?").replace(/\b(?:UIKit|UIKitCore|Foundation|CoreGraphics|Swift)\./g, "");
|
|
1472
|
+
if (method[1] === "numberOfSections") {
|
|
1473
|
+
if (conforms.has("UITableViewDataSource") && parameters === "in:UITableView" && result2 === "Int")
|
|
1474
|
+
selector = "numberOfSectionsInTableView:";
|
|
1475
|
+
} else {
|
|
1476
|
+
const label = /^_:UITableView,(\w+):/.exec(parameters)?.[1];
|
|
1477
|
+
const requirement = label ? selectors[label] : void 0;
|
|
1478
|
+
if (requirement && `${parameters}->${result2}` === requirement[1])
|
|
1479
|
+
selector = requirement[0];
|
|
1480
|
+
}
|
|
1356
1481
|
}
|
|
1357
1482
|
if (selector)
|
|
1358
1483
|
edits.push([
|