peachsim 0.1.926 → 0.1.928
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/commands/control.ts +4 -26
- package/cli/commands/detect.ts +80 -63
- package/cli/commands/nodeRepoFileReader.ts +22 -0
- package/cli/commands/repoFileReaderContract.ts +8 -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 +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 +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 +42 -21
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- 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 +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 +413 -573
- 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/vite-plugin.ts +1 -1
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.928 | (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;
|
|
@@ -19125,17 +19125,17 @@ function visit(node, visitor) {
|
|
|
19125
19125
|
} else
|
|
19126
19126
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
19127
19127
|
}
|
|
19128
|
-
function visit_(key2, node, visitor,
|
|
19129
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
19128
|
+
function visit_(key2, node, visitor, path38) {
|
|
19129
|
+
const ctrl = callVisitor(key2, node, visitor, path38);
|
|
19130
19130
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
19131
|
-
replaceNode(key2,
|
|
19132
|
-
return visit_(key2, ctrl, visitor,
|
|
19131
|
+
replaceNode(key2, path38, ctrl);
|
|
19132
|
+
return visit_(key2, ctrl, visitor, path38);
|
|
19133
19133
|
}
|
|
19134
19134
|
if (typeof ctrl !== "symbol") {
|
|
19135
19135
|
if (isCollection(node)) {
|
|
19136
|
-
|
|
19136
|
+
path38 = Object.freeze(path38.concat(node));
|
|
19137
19137
|
for (let i = 0; i < node.items.length; ++i) {
|
|
19138
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
19138
|
+
const ci = visit_(i, node.items[i], visitor, path38);
|
|
19139
19139
|
if (typeof ci === "number")
|
|
19140
19140
|
i = ci - 1;
|
|
19141
19141
|
else if (ci === BREAK)
|
|
@@ -19146,13 +19146,13 @@ function visit_(key2, node, visitor, path39) {
|
|
|
19146
19146
|
}
|
|
19147
19147
|
}
|
|
19148
19148
|
} else if (isPair(node)) {
|
|
19149
|
-
|
|
19150
|
-
const ck = visit_("key", node.key, visitor,
|
|
19149
|
+
path38 = Object.freeze(path38.concat(node));
|
|
19150
|
+
const ck = visit_("key", node.key, visitor, path38);
|
|
19151
19151
|
if (ck === BREAK)
|
|
19152
19152
|
return BREAK;
|
|
19153
19153
|
else if (ck === REMOVE)
|
|
19154
19154
|
node.key = null;
|
|
19155
|
-
const cv = visit_("value", node.value, visitor,
|
|
19155
|
+
const cv = visit_("value", node.value, visitor, path38);
|
|
19156
19156
|
if (cv === BREAK)
|
|
19157
19157
|
return BREAK;
|
|
19158
19158
|
else if (cv === REMOVE)
|
|
@@ -19170,17 +19170,17 @@ async function visitAsync(node, visitor) {
|
|
|
19170
19170
|
} else
|
|
19171
19171
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
19172
19172
|
}
|
|
19173
|
-
async function visitAsync_(key2, node, visitor,
|
|
19174
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
19173
|
+
async function visitAsync_(key2, node, visitor, path38) {
|
|
19174
|
+
const ctrl = await callVisitor(key2, node, visitor, path38);
|
|
19175
19175
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
19176
|
-
replaceNode(key2,
|
|
19177
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
19176
|
+
replaceNode(key2, path38, ctrl);
|
|
19177
|
+
return visitAsync_(key2, ctrl, visitor, path38);
|
|
19178
19178
|
}
|
|
19179
19179
|
if (typeof ctrl !== "symbol") {
|
|
19180
19180
|
if (isCollection(node)) {
|
|
19181
|
-
|
|
19181
|
+
path38 = Object.freeze(path38.concat(node));
|
|
19182
19182
|
for (let i = 0; i < node.items.length; ++i) {
|
|
19183
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
19183
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path38);
|
|
19184
19184
|
if (typeof ci === "number")
|
|
19185
19185
|
i = ci - 1;
|
|
19186
19186
|
else if (ci === BREAK)
|
|
@@ -19191,13 +19191,13 @@ async function visitAsync_(key2, node, visitor, path39) {
|
|
|
19191
19191
|
}
|
|
19192
19192
|
}
|
|
19193
19193
|
} else if (isPair(node)) {
|
|
19194
|
-
|
|
19195
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
19194
|
+
path38 = Object.freeze(path38.concat(node));
|
|
19195
|
+
const ck = await visitAsync_("key", node.key, visitor, path38);
|
|
19196
19196
|
if (ck === BREAK)
|
|
19197
19197
|
return BREAK;
|
|
19198
19198
|
else if (ck === REMOVE)
|
|
19199
19199
|
node.key = null;
|
|
19200
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
19200
|
+
const cv = await visitAsync_("value", node.value, visitor, path38);
|
|
19201
19201
|
if (cv === BREAK)
|
|
19202
19202
|
return BREAK;
|
|
19203
19203
|
else if (cv === REMOVE)
|
|
@@ -19224,23 +19224,23 @@ function initVisitor(visitor) {
|
|
|
19224
19224
|
}
|
|
19225
19225
|
return visitor;
|
|
19226
19226
|
}
|
|
19227
|
-
function callVisitor(key2, node, visitor,
|
|
19227
|
+
function callVisitor(key2, node, visitor, path38) {
|
|
19228
19228
|
if (typeof visitor === "function")
|
|
19229
|
-
return visitor(key2, node,
|
|
19229
|
+
return visitor(key2, node, path38);
|
|
19230
19230
|
if (isMap(node))
|
|
19231
|
-
return visitor.Map?.(key2, node,
|
|
19231
|
+
return visitor.Map?.(key2, node, path38);
|
|
19232
19232
|
if (isSeq(node))
|
|
19233
|
-
return visitor.Seq?.(key2, node,
|
|
19233
|
+
return visitor.Seq?.(key2, node, path38);
|
|
19234
19234
|
if (isPair(node))
|
|
19235
|
-
return visitor.Pair?.(key2, node,
|
|
19235
|
+
return visitor.Pair?.(key2, node, path38);
|
|
19236
19236
|
if (isScalar(node))
|
|
19237
|
-
return visitor.Scalar?.(key2, node,
|
|
19237
|
+
return visitor.Scalar?.(key2, node, path38);
|
|
19238
19238
|
if (isAlias(node))
|
|
19239
|
-
return visitor.Alias?.(key2, node,
|
|
19239
|
+
return visitor.Alias?.(key2, node, path38);
|
|
19240
19240
|
return void 0;
|
|
19241
19241
|
}
|
|
19242
|
-
function replaceNode(key2,
|
|
19243
|
-
const parent =
|
|
19242
|
+
function replaceNode(key2, path38, node) {
|
|
19243
|
+
const parent = path38[path38.length - 1];
|
|
19244
19244
|
if (isCollection(parent)) {
|
|
19245
19245
|
parent.items[key2] = node;
|
|
19246
19246
|
} else if (isPair(parent)) {
|
|
@@ -19840,10 +19840,10 @@ var init_createNode = __esm({
|
|
|
19840
19840
|
});
|
|
19841
19841
|
|
|
19842
19842
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
19843
|
-
function collectionFromPath(schema4,
|
|
19843
|
+
function collectionFromPath(schema4, path38, value) {
|
|
19844
19844
|
let v = value;
|
|
19845
|
-
for (let i =
|
|
19846
|
-
const k =
|
|
19845
|
+
for (let i = path38.length - 1; i >= 0; --i) {
|
|
19846
|
+
const k = path38[i];
|
|
19847
19847
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
19848
19848
|
const a = [];
|
|
19849
19849
|
a[k] = v;
|
|
@@ -19868,7 +19868,7 @@ var init_Collection = __esm({
|
|
|
19868
19868
|
init_createNode();
|
|
19869
19869
|
init_identity();
|
|
19870
19870
|
init_Node();
|
|
19871
|
-
isEmptyPath = (
|
|
19871
|
+
isEmptyPath = (path38) => path38 == null || typeof path38 === "object" && !!path38[Symbol.iterator]().next().done;
|
|
19872
19872
|
Collection = class extends NodeBase {
|
|
19873
19873
|
constructor(type, schema4) {
|
|
19874
19874
|
super(type);
|
|
@@ -19898,11 +19898,11 @@ var init_Collection = __esm({
|
|
|
19898
19898
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
19899
19899
|
* that already exists in the map.
|
|
19900
19900
|
*/
|
|
19901
|
-
addIn(
|
|
19902
|
-
if (isEmptyPath(
|
|
19901
|
+
addIn(path38, value) {
|
|
19902
|
+
if (isEmptyPath(path38))
|
|
19903
19903
|
this.add(value);
|
|
19904
19904
|
else {
|
|
19905
|
-
const [key2, ...rest] =
|
|
19905
|
+
const [key2, ...rest] = path38;
|
|
19906
19906
|
const node = this.get(key2, true);
|
|
19907
19907
|
if (isCollection(node))
|
|
19908
19908
|
node.addIn(rest, value);
|
|
@@ -19916,8 +19916,8 @@ var init_Collection = __esm({
|
|
|
19916
19916
|
* Removes a value from the collection.
|
|
19917
19917
|
* @returns `true` if the item was found and removed.
|
|
19918
19918
|
*/
|
|
19919
|
-
deleteIn(
|
|
19920
|
-
const [key2, ...rest] =
|
|
19919
|
+
deleteIn(path38) {
|
|
19920
|
+
const [key2, ...rest] = path38;
|
|
19921
19921
|
if (rest.length === 0)
|
|
19922
19922
|
return this.delete(key2);
|
|
19923
19923
|
const node = this.get(key2, true);
|
|
@@ -19931,8 +19931,8 @@ var init_Collection = __esm({
|
|
|
19931
19931
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
19932
19932
|
* `true` (collections are always returned intact).
|
|
19933
19933
|
*/
|
|
19934
|
-
getIn(
|
|
19935
|
-
const [key2, ...rest] =
|
|
19934
|
+
getIn(path38, keepScalar) {
|
|
19935
|
+
const [key2, ...rest] = path38;
|
|
19936
19936
|
const node = this.get(key2, true);
|
|
19937
19937
|
if (rest.length === 0)
|
|
19938
19938
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -19950,8 +19950,8 @@ var init_Collection = __esm({
|
|
|
19950
19950
|
/**
|
|
19951
19951
|
* Checks if the collection includes a value with the key `key`.
|
|
19952
19952
|
*/
|
|
19953
|
-
hasIn(
|
|
19954
|
-
const [key2, ...rest] =
|
|
19953
|
+
hasIn(path38) {
|
|
19954
|
+
const [key2, ...rest] = path38;
|
|
19955
19955
|
if (rest.length === 0)
|
|
19956
19956
|
return this.has(key2);
|
|
19957
19957
|
const node = this.get(key2, true);
|
|
@@ -19961,8 +19961,8 @@ var init_Collection = __esm({
|
|
|
19961
19961
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
19962
19962
|
* boolean to add/remove the item from the set.
|
|
19963
19963
|
*/
|
|
19964
|
-
setIn(
|
|
19965
|
-
const [key2, ...rest] =
|
|
19964
|
+
setIn(path38, value) {
|
|
19965
|
+
const [key2, ...rest] = path38;
|
|
19966
19966
|
if (rest.length === 0) {
|
|
19967
19967
|
this.set(key2, value);
|
|
19968
19968
|
} else {
|
|
@@ -22396,9 +22396,9 @@ var init_Document = __esm({
|
|
|
22396
22396
|
this.contents.add(value);
|
|
22397
22397
|
}
|
|
22398
22398
|
/** Adds a value to the document. */
|
|
22399
|
-
addIn(
|
|
22399
|
+
addIn(path38, value) {
|
|
22400
22400
|
if (assertCollection(this.contents))
|
|
22401
|
-
this.contents.addIn(
|
|
22401
|
+
this.contents.addIn(path38, value);
|
|
22402
22402
|
}
|
|
22403
22403
|
/**
|
|
22404
22404
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -22473,14 +22473,14 @@ var init_Document = __esm({
|
|
|
22473
22473
|
* Removes a value from the document.
|
|
22474
22474
|
* @returns `true` if the item was found and removed.
|
|
22475
22475
|
*/
|
|
22476
|
-
deleteIn(
|
|
22477
|
-
if (isEmptyPath(
|
|
22476
|
+
deleteIn(path38) {
|
|
22477
|
+
if (isEmptyPath(path38)) {
|
|
22478
22478
|
if (this.contents == null)
|
|
22479
22479
|
return false;
|
|
22480
22480
|
this.contents = null;
|
|
22481
22481
|
return true;
|
|
22482
22482
|
}
|
|
22483
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
22483
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path38) : false;
|
|
22484
22484
|
}
|
|
22485
22485
|
/**
|
|
22486
22486
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -22495,10 +22495,10 @@ var init_Document = __esm({
|
|
|
22495
22495
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
22496
22496
|
* `true` (collections are always returned intact).
|
|
22497
22497
|
*/
|
|
22498
|
-
getIn(
|
|
22499
|
-
if (isEmptyPath(
|
|
22498
|
+
getIn(path38, keepScalar) {
|
|
22499
|
+
if (isEmptyPath(path38))
|
|
22500
22500
|
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
|
|
22501
|
-
return isCollection(this.contents) ? this.contents.getIn(
|
|
22501
|
+
return isCollection(this.contents) ? this.contents.getIn(path38, keepScalar) : void 0;
|
|
22502
22502
|
}
|
|
22503
22503
|
/**
|
|
22504
22504
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -22509,10 +22509,10 @@ var init_Document = __esm({
|
|
|
22509
22509
|
/**
|
|
22510
22510
|
* Checks if the document includes a value at `path`.
|
|
22511
22511
|
*/
|
|
22512
|
-
hasIn(
|
|
22513
|
-
if (isEmptyPath(
|
|
22512
|
+
hasIn(path38) {
|
|
22513
|
+
if (isEmptyPath(path38))
|
|
22514
22514
|
return this.contents !== void 0;
|
|
22515
|
-
return isCollection(this.contents) ? this.contents.hasIn(
|
|
22515
|
+
return isCollection(this.contents) ? this.contents.hasIn(path38) : false;
|
|
22516
22516
|
}
|
|
22517
22517
|
/**
|
|
22518
22518
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -22529,13 +22529,13 @@ var init_Document = __esm({
|
|
|
22529
22529
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
22530
22530
|
* boolean to add/remove the item from the set.
|
|
22531
22531
|
*/
|
|
22532
|
-
setIn(
|
|
22533
|
-
if (isEmptyPath(
|
|
22532
|
+
setIn(path38, value) {
|
|
22533
|
+
if (isEmptyPath(path38)) {
|
|
22534
22534
|
this.contents = value;
|
|
22535
22535
|
} else if (this.contents == null) {
|
|
22536
|
-
this.contents = collectionFromPath(this.schema, Array.from(
|
|
22536
|
+
this.contents = collectionFromPath(this.schema, Array.from(path38), value);
|
|
22537
22537
|
} else if (assertCollection(this.contents)) {
|
|
22538
|
-
this.contents.setIn(
|
|
22538
|
+
this.contents.setIn(path38, value);
|
|
22539
22539
|
}
|
|
22540
22540
|
}
|
|
22541
22541
|
/**
|
|
@@ -24440,15 +24440,15 @@ function visit2(cst, visitor) {
|
|
|
24440
24440
|
cst = { start: cst.start, value: cst.value };
|
|
24441
24441
|
_visit(Object.freeze([]), cst, visitor);
|
|
24442
24442
|
}
|
|
24443
|
-
function _visit(
|
|
24444
|
-
let ctrl = visitor(item,
|
|
24443
|
+
function _visit(path38, item, visitor) {
|
|
24444
|
+
let ctrl = visitor(item, path38);
|
|
24445
24445
|
if (typeof ctrl === "symbol")
|
|
24446
24446
|
return ctrl;
|
|
24447
24447
|
for (const field of ["key", "value"]) {
|
|
24448
24448
|
const token = item[field];
|
|
24449
24449
|
if (token && "items" in token) {
|
|
24450
24450
|
for (let i = 0; i < token.items.length; ++i) {
|
|
24451
|
-
const ci = _visit(Object.freeze(
|
|
24451
|
+
const ci = _visit(Object.freeze(path38.concat([[field, i]])), token.items[i], visitor);
|
|
24452
24452
|
if (typeof ci === "number")
|
|
24453
24453
|
i = ci - 1;
|
|
24454
24454
|
else if (ci === BREAK2)
|
|
@@ -24459,10 +24459,10 @@ function _visit(path39, item, visitor) {
|
|
|
24459
24459
|
}
|
|
24460
24460
|
}
|
|
24461
24461
|
if (typeof ctrl === "function" && field === "key")
|
|
24462
|
-
ctrl = ctrl(item,
|
|
24462
|
+
ctrl = ctrl(item, path38);
|
|
24463
24463
|
}
|
|
24464
24464
|
}
|
|
24465
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
24465
|
+
return typeof ctrl === "function" ? ctrl(item, path38) : ctrl;
|
|
24466
24466
|
}
|
|
24467
24467
|
var BREAK2, SKIP2, REMOVE2;
|
|
24468
24468
|
var init_cst_visit = __esm({
|
|
@@ -24473,9 +24473,9 @@ var init_cst_visit = __esm({
|
|
|
24473
24473
|
visit2.BREAK = BREAK2;
|
|
24474
24474
|
visit2.SKIP = SKIP2;
|
|
24475
24475
|
visit2.REMOVE = REMOVE2;
|
|
24476
|
-
visit2.itemAtPath = (cst,
|
|
24476
|
+
visit2.itemAtPath = (cst, path38) => {
|
|
24477
24477
|
let item = cst;
|
|
24478
|
-
for (const [field, index] of
|
|
24478
|
+
for (const [field, index] of path38) {
|
|
24479
24479
|
const tok = item?.[field];
|
|
24480
24480
|
if (tok && "items" in tok) {
|
|
24481
24481
|
item = tok.items[index];
|
|
@@ -24484,9 +24484,9 @@ var init_cst_visit = __esm({
|
|
|
24484
24484
|
}
|
|
24485
24485
|
return item;
|
|
24486
24486
|
};
|
|
24487
|
-
visit2.parentCollection = (cst,
|
|
24488
|
-
const parent = visit2.itemAtPath(cst,
|
|
24489
|
-
const field =
|
|
24487
|
+
visit2.parentCollection = (cst, path38) => {
|
|
24488
|
+
const parent = visit2.itemAtPath(cst, path38.slice(0, -1));
|
|
24489
|
+
const field = path38[path38.length - 1][0];
|
|
24490
24490
|
const coll = parent?.[field];
|
|
24491
24491
|
if (coll && "items" in coll)
|
|
24492
24492
|
return coll;
|
|
@@ -25789,14 +25789,14 @@ var init_parser = __esm({
|
|
|
25789
25789
|
case "scalar":
|
|
25790
25790
|
case "single-quoted-scalar":
|
|
25791
25791
|
case "double-quoted-scalar": {
|
|
25792
|
-
const
|
|
25792
|
+
const fs34 = this.flowScalar(this.type);
|
|
25793
25793
|
if (atNextItem || it.value) {
|
|
25794
|
-
map2.items.push({ start, key:
|
|
25794
|
+
map2.items.push({ start, key: fs34, sep: [] });
|
|
25795
25795
|
this.onKeyLine = true;
|
|
25796
25796
|
} else if (it.sep) {
|
|
25797
|
-
this.stack.push(
|
|
25797
|
+
this.stack.push(fs34);
|
|
25798
25798
|
} else {
|
|
25799
|
-
Object.assign(it, { key:
|
|
25799
|
+
Object.assign(it, { key: fs34, sep: [] });
|
|
25800
25800
|
this.onKeyLine = true;
|
|
25801
25801
|
}
|
|
25802
25802
|
return;
|
|
@@ -25924,13 +25924,13 @@ var init_parser = __esm({
|
|
|
25924
25924
|
case "scalar":
|
|
25925
25925
|
case "single-quoted-scalar":
|
|
25926
25926
|
case "double-quoted-scalar": {
|
|
25927
|
-
const
|
|
25927
|
+
const fs34 = this.flowScalar(this.type);
|
|
25928
25928
|
if (!it || it.value)
|
|
25929
|
-
fc.items.push({ start: [], key:
|
|
25929
|
+
fc.items.push({ start: [], key: fs34, sep: [] });
|
|
25930
25930
|
else if (it.sep)
|
|
25931
|
-
this.stack.push(
|
|
25931
|
+
this.stack.push(fs34);
|
|
25932
25932
|
else
|
|
25933
|
-
Object.assign(it, { key:
|
|
25933
|
+
Object.assign(it, { key: fs34, sep: [] });
|
|
25934
25934
|
return;
|
|
25935
25935
|
}
|
|
25936
25936
|
case "flow-map-end":
|
|
@@ -27301,9 +27301,9 @@ function safeChildPlistName(value) {
|
|
|
27301
27301
|
name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
|
|
27302
27302
|
};
|
|
27303
27303
|
}
|
|
27304
|
-
async function readableSettingsBundle(
|
|
27304
|
+
async function readableSettingsBundle(path38) {
|
|
27305
27305
|
try {
|
|
27306
|
-
const root = await (0, import_promises.stat)((0, import_node_path.join)(
|
|
27306
|
+
const root = await (0, import_promises.stat)((0, import_node_path.join)(path38, "Root.plist"));
|
|
27307
27307
|
return root.isFile() && root.size <= MAX_PLIST_BYTES;
|
|
27308
27308
|
} catch {
|
|
27309
27309
|
return false;
|
|
@@ -27348,11 +27348,11 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
27348
27348
|
return null;
|
|
27349
27349
|
}
|
|
27350
27350
|
}
|
|
27351
|
-
async function parsePlistRecord(
|
|
27351
|
+
async function parsePlistRecord(path38) {
|
|
27352
27352
|
try {
|
|
27353
|
-
const metadata = await (0, import_promises.stat)(
|
|
27353
|
+
const metadata = await (0, import_promises.stat)(path38);
|
|
27354
27354
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
27355
|
-
const source = await (0, import_promises.readFile)(
|
|
27355
|
+
const source = await (0, import_promises.readFile)(path38, "utf8");
|
|
27356
27356
|
const parsed = parsePlistSource(source);
|
|
27357
27357
|
return isRecord2(parsed) ? parsed : null;
|
|
27358
27358
|
} catch {
|
|
@@ -27698,7 +27698,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
27698
27698
|
return null;
|
|
27699
27699
|
}
|
|
27700
27700
|
}
|
|
27701
|
-
function httpGet(hostname, port,
|
|
27701
|
+
function httpGet(hostname, port, path38, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
27702
27702
|
return new Promise((resolve10) => {
|
|
27703
27703
|
let settled = false;
|
|
27704
27704
|
let killing = false;
|
|
@@ -27707,7 +27707,7 @@ function httpGet(hostname, port, path39, method = "GET", timeout = TIMEOUT_MS, h
|
|
|
27707
27707
|
settled = true;
|
|
27708
27708
|
resolve10(value);
|
|
27709
27709
|
};
|
|
27710
|
-
const req = import_http.default.request({ hostname, port, path:
|
|
27710
|
+
const req = import_http.default.request({ hostname, port, path: path38, method, headers }, (res) => {
|
|
27711
27711
|
let body = "";
|
|
27712
27712
|
res.on("data", (c) => body += c.toString());
|
|
27713
27713
|
const contentType = (() => {
|
|
@@ -31835,8 +31835,8 @@ function pickImagesetFile(images) {
|
|
|
31835
31835
|
scale: pick.scale === "2x" ? 2 : pick.scale === "3x" ? 3 : 1
|
|
31836
31836
|
};
|
|
31837
31837
|
}
|
|
31838
|
-
function flatScale(
|
|
31839
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
31838
|
+
function flatScale(path38) {
|
|
31839
|
+
const match = /@([23])x\.[^./]+$/.exec(path38);
|
|
31840
31840
|
return match ? Number(match[1]) : 1;
|
|
31841
31841
|
}
|
|
31842
31842
|
function providesNamespace(text3) {
|
|
@@ -31863,13 +31863,13 @@ function catalogEntryName(contentsPath, kind, readText2) {
|
|
|
31863
31863
|
}
|
|
31864
31864
|
return segments.join("/");
|
|
31865
31865
|
}
|
|
31866
|
-
function isFlatResourceImage(
|
|
31867
|
-
return
|
|
31866
|
+
function isFlatResourceImage(path38) {
|
|
31867
|
+
return path38.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path38));
|
|
31868
31868
|
}
|
|
31869
31869
|
function enumerateBundleImages(paths, readText2) {
|
|
31870
31870
|
const table = [];
|
|
31871
31871
|
const seen = /* @__PURE__ */ new Set();
|
|
31872
|
-
const catalogs = paths.filter((
|
|
31872
|
+
const catalogs = paths.filter((path38) => baseOf(path38) === "Contents.json");
|
|
31873
31873
|
for (const contentsPath of catalogs) {
|
|
31874
31874
|
const name2 = catalogEntryName(contentsPath, ".imageset", readText2);
|
|
31875
31875
|
if (name2 === null || seen.has(name2)) continue;
|
|
@@ -31890,12 +31890,12 @@ function enumerateBundleImages(paths, readText2) {
|
|
|
31890
31890
|
seen.add(name2);
|
|
31891
31891
|
table.push({ name: name2, file: `${dir}/${pick.filename}`, scale: pick.scale });
|
|
31892
31892
|
}
|
|
31893
|
-
for (const
|
|
31894
|
-
if (!isFlatResourceImage(
|
|
31895
|
-
const name2 = baseOf(
|
|
31893
|
+
for (const path38 of paths) {
|
|
31894
|
+
if (!isFlatResourceImage(path38)) continue;
|
|
31895
|
+
const name2 = baseOf(path38).slice(0, -extOf(path38).length);
|
|
31896
31896
|
if (name2 === "" || seen.has(name2)) continue;
|
|
31897
31897
|
seen.add(name2);
|
|
31898
|
-
table.push({ name: name2, file:
|
|
31898
|
+
table.push({ name: name2, file: path38, scale: flatScale(path38) });
|
|
31899
31899
|
}
|
|
31900
31900
|
return table;
|
|
31901
31901
|
}
|
|
@@ -31924,7 +31924,7 @@ function colorsetValue(color) {
|
|
|
31924
31924
|
}
|
|
31925
31925
|
function enumerateBundleColors(paths, readText2) {
|
|
31926
31926
|
const table = {};
|
|
31927
|
-
for (const contentsPath of paths.filter((
|
|
31927
|
+
for (const contentsPath of paths.filter((path38) => baseOf(path38) === "Contents.json")) {
|
|
31928
31928
|
const name2 = catalogEntryName(contentsPath, ".colorset", readText2);
|
|
31929
31929
|
if (name2 === null || name2 in table) continue;
|
|
31930
31930
|
let colors;
|
|
@@ -31988,8 +31988,8 @@ function axisExtremes(points) {
|
|
|
31988
31988
|
function pathBounds(d) {
|
|
31989
31989
|
const xs = [];
|
|
31990
31990
|
const ys = [];
|
|
31991
|
-
for (const
|
|
31992
|
-
(0, import_svgpath.default)(
|
|
31991
|
+
for (const path38 of d)
|
|
31992
|
+
(0, import_svgpath.default)(path38).abs().unshort().unarc().iterate((segment, _index, x, y) => {
|
|
31993
31993
|
const [command, ...args] = segment;
|
|
31994
31994
|
if (command === "M" || command === "L") {
|
|
31995
31995
|
xs.push(Number(args[0]));
|
|
@@ -32016,7 +32016,7 @@ function guide(svg, id, axis) {
|
|
|
32016
32016
|
}
|
|
32017
32017
|
function enumerateBundleSymbols(paths, readText2) {
|
|
32018
32018
|
const table = {};
|
|
32019
|
-
for (const contentsPath of paths.filter((
|
|
32019
|
+
for (const contentsPath of paths.filter((path38) => baseOf(path38) === "Contents.json")) {
|
|
32020
32020
|
const name2 = catalogEntryName(contentsPath, ".symbolset", readText2);
|
|
32021
32021
|
if (name2 === null || name2 in table) continue;
|
|
32022
32022
|
let symbols;
|
|
@@ -32049,8 +32049,8 @@ function enumerateBundleSymbols(paths, readText2) {
|
|
|
32049
32049
|
viewBox: "0 0 24 24",
|
|
32050
32050
|
advance,
|
|
32051
32051
|
box: [12 - advance / 2, 12 - tall / 2, advance, tall],
|
|
32052
|
-
layers: d.map((
|
|
32053
|
-
d: (0, import_svgpath.default)(
|
|
32052
|
+
layers: d.map((path38) => ({
|
|
32053
|
+
d: (0, import_svgpath.default)(path38).abs().scale(scale).translate(translateX, translateY).round(3).toString()
|
|
32054
32054
|
}))
|
|
32055
32055
|
};
|
|
32056
32056
|
}
|
|
@@ -32060,7 +32060,7 @@ function enumerateBundleJson(paths) {
|
|
|
32060
32060
|
const found = [];
|
|
32061
32061
|
const seen = /* @__PURE__ */ new Set();
|
|
32062
32062
|
const ordered = [...paths].filter(
|
|
32063
|
-
(
|
|
32063
|
+
(path38) => path38.split("/").includes("Resources") && path38.split("/").every((segment) => segment !== "" && segment !== "..") && (extOf(path38) === ".json" || extOf(path38) === ".xcstrings")
|
|
32064
32064
|
).sort((a, b) => {
|
|
32065
32065
|
const aDepth = a.split("/").length;
|
|
32066
32066
|
const bDepth = b.split("/").length;
|
|
@@ -33359,10 +33359,10 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33359
33359
|
owners.push(...physical.map(() => current));
|
|
33360
33360
|
};
|
|
33361
33361
|
const scoped = (body) => (symbol, ...rest) => {
|
|
33362
|
-
const
|
|
33363
|
-
if (omit.has(
|
|
33362
|
+
const path38 = pathOf(symbol);
|
|
33363
|
+
if (omit.has(path38)) return void skipped.push({ path: path38, reason: omit.get(path38) });
|
|
33364
33364
|
const previous = current;
|
|
33365
|
-
current =
|
|
33365
|
+
current = path38;
|
|
33366
33366
|
try {
|
|
33367
33367
|
body(symbol, ...rest);
|
|
33368
33368
|
} finally {
|
|
@@ -33382,14 +33382,14 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33382
33382
|
const access = (symbol, openOwner) => symbol.accessLevel === "open" && openOwner ? "open" : "public";
|
|
33383
33383
|
const emitMember = scoped(
|
|
33384
33384
|
(member, indent, context) => {
|
|
33385
|
-
const
|
|
33385
|
+
const path38 = pathOf(member);
|
|
33386
33386
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
33387
33387
|
emitType(member, indent);
|
|
33388
33388
|
return;
|
|
33389
33389
|
}
|
|
33390
33390
|
if (member.kind.identifier === "swift.enum.case") return;
|
|
33391
33391
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
33392
|
-
skipped.push({ path:
|
|
33392
|
+
skipped.push({ path: path38, reason: `unhandled ${member.kind.identifier}` });
|
|
33393
33393
|
return;
|
|
33394
33394
|
}
|
|
33395
33395
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
@@ -33403,12 +33403,12 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33403
33403
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
33404
33404
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
33405
33405
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
33406
|
-
const override = context.inClass && !options.plain?.has(
|
|
33406
|
+
const override = context.inClass && !options.plain?.has(path38) && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path38) || isObjC(member) && path38.endsWith(".init()")) ? "override " : "";
|
|
33407
33407
|
const head = `${indent}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
33408
|
-
const measured = behavior.get(
|
|
33409
|
-
if (measured) used.add(
|
|
33408
|
+
const measured = behavior.get(path38);
|
|
33409
|
+
if (measured) used.add(path38);
|
|
33410
33410
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
33411
|
-
const body = overloadBody ?? measured?.body ?? trap(
|
|
33411
|
+
const body = overloadBody ?? measured?.body ?? trap(path38);
|
|
33412
33412
|
switch (member.kind.identifier) {
|
|
33413
33413
|
case "swift.property":
|
|
33414
33414
|
case "swift.type.property":
|
|
@@ -33429,7 +33429,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33429
33429
|
return;
|
|
33430
33430
|
}
|
|
33431
33431
|
emit(
|
|
33432
|
-
`${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(
|
|
33432
|
+
`${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(path38)} }` : ""} }`
|
|
33433
33433
|
);
|
|
33434
33434
|
return;
|
|
33435
33435
|
}
|
|
@@ -33482,7 +33482,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33482
33482
|
};
|
|
33483
33483
|
const emitType = scoped(
|
|
33484
33484
|
(symbol, indent) => {
|
|
33485
|
-
const
|
|
33485
|
+
const path38 = pathOf(symbol);
|
|
33486
33486
|
const id = symbol.identifier.precise;
|
|
33487
33487
|
const inner = `${indent} `;
|
|
33488
33488
|
switch (symbol.kind.identifier) {
|
|
@@ -33494,10 +33494,10 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33494
33494
|
case "swift.class": {
|
|
33495
33495
|
const shape = header(symbol, "class", indent);
|
|
33496
33496
|
if (!shape)
|
|
33497
|
-
return void skipped.push({ path:
|
|
33498
|
-
const parent = options.superclasses?.get(
|
|
33497
|
+
return void skipped.push({ path: path38, reason: `unparsed class ${text(symbol)}` });
|
|
33498
|
+
const parent = options.superclasses?.get(path38) ?? superclass.get(id);
|
|
33499
33499
|
const blocked = classBlocked(id);
|
|
33500
|
-
if (blocked) return void skipped.push({ path:
|
|
33500
|
+
if (blocked) return void skipped.push({ path: path38, reason: blocked });
|
|
33501
33501
|
const ancestors = /* @__PURE__ */ new Set();
|
|
33502
33502
|
for (let at = superId.get(id); at; at = superId.get(at))
|
|
33503
33503
|
for (const name2 of conforms.get(at) ?? []) ancestors.add(name2);
|
|
@@ -33513,9 +33513,9 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33513
33513
|
`${indent}${shape.attrs}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
33514
33514
|
);
|
|
33515
33515
|
const members = membersOf(id);
|
|
33516
|
-
const extra = options.behavior?.get(
|
|
33516
|
+
const extra = options.behavior?.get(path38)?.members;
|
|
33517
33517
|
if (extra) {
|
|
33518
|
-
used.add(
|
|
33518
|
+
used.add(path38);
|
|
33519
33519
|
emit(`${inner}${extra}`);
|
|
33520
33520
|
}
|
|
33521
33521
|
for (const member of members)
|
|
@@ -33567,13 +33567,13 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33567
33567
|
continue;
|
|
33568
33568
|
have.add(witnessKey(member));
|
|
33569
33569
|
have.add(sideLeaf(member));
|
|
33570
|
-
emitWitness(member, inner,
|
|
33570
|
+
emitWitness(member, inner, path38);
|
|
33571
33571
|
}
|
|
33572
33572
|
}
|
|
33573
33573
|
const coder = members.some((member) => leaf(member) === "init(coder:)");
|
|
33574
33574
|
if (designated && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
33575
33575
|
emit(
|
|
33576
|
-
`${inner}public required init?(coder: NSCoder) { ${trap(`${
|
|
33576
|
+
`${inner}public required init?(coder: NSCoder) { ${trap(`${path38}.init(coder:)`)} }`
|
|
33577
33577
|
);
|
|
33578
33578
|
emit(`${indent}}`);
|
|
33579
33579
|
return;
|
|
@@ -33581,7 +33581,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33581
33581
|
case "swift.struct": {
|
|
33582
33582
|
const shape = header(symbol, "struct", indent);
|
|
33583
33583
|
if (!shape)
|
|
33584
|
-
return void skipped.push({ path:
|
|
33584
|
+
return void skipped.push({ path: path38, reason: `unparsed struct ${text(symbol)}` });
|
|
33585
33585
|
const members = membersOf(id);
|
|
33586
33586
|
const raw2 = rawType(members);
|
|
33587
33587
|
const list2 = inheritance(id);
|
|
@@ -33613,7 +33613,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33613
33613
|
case "swift.enum": {
|
|
33614
33614
|
const shape = header(symbol, "enum", indent);
|
|
33615
33615
|
if (!shape)
|
|
33616
|
-
return void skipped.push({ path:
|
|
33616
|
+
return void skipped.push({ path: path38, reason: `unparsed enum ${text(symbol)}` });
|
|
33617
33617
|
const members = membersOf(id);
|
|
33618
33618
|
const raw2 = rawType(members);
|
|
33619
33619
|
const cases = members.filter(
|
|
@@ -33622,7 +33622,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33622
33622
|
const missing = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
33623
33623
|
if (raw2 && isObjC(symbol) && missing.length > 0)
|
|
33624
33624
|
return void skipped.push({
|
|
33625
|
-
path:
|
|
33625
|
+
path: path38,
|
|
33626
33626
|
reason: `no header value for ${missing.map(leaf).join(", ")}`
|
|
33627
33627
|
});
|
|
33628
33628
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -33662,7 +33662,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33662
33662
|
const shape = header(symbol, "protocol", indent);
|
|
33663
33663
|
if (!shape)
|
|
33664
33664
|
return void skipped.push({
|
|
33665
|
-
path:
|
|
33665
|
+
path: path38,
|
|
33666
33666
|
reason: `unparsed protocol ${text(symbol)}`
|
|
33667
33667
|
});
|
|
33668
33668
|
const list2 = [...isObjC(symbol) ? ["AnyObject"] : [], ...inheritance(id)];
|
|
@@ -33687,7 +33687,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33687
33687
|
}
|
|
33688
33688
|
emit(`${indent}}`);
|
|
33689
33689
|
if (defaults.length > 0) {
|
|
33690
|
-
emit(`${indent}extension ${
|
|
33690
|
+
emit(`${indent}extension ${path38} {`);
|
|
33691
33691
|
for (const member of defaults) {
|
|
33692
33692
|
const decl = text(member);
|
|
33693
33693
|
if (optional.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -33733,7 +33733,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33733
33733
|
return init ? /rawValue:\s*([^)]+)\)/.exec(text(init))?.[1]?.trim() ?? null : null;
|
|
33734
33734
|
};
|
|
33735
33735
|
const emitGlobal = scoped((symbol) => {
|
|
33736
|
-
const
|
|
33736
|
+
const path38 = pathOf(symbol);
|
|
33737
33737
|
const kind = symbol.kind.identifier;
|
|
33738
33738
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
33739
33739
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol));
|
|
@@ -33744,17 +33744,17 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33744
33744
|
if (fix && !/^(?:prefix|infix|postfix)\b/.test(spelled))
|
|
33745
33745
|
spelled = `${fix} ${spelled}`;
|
|
33746
33746
|
}
|
|
33747
|
-
emit(`${attrs}public ${spelled} { ${trap(
|
|
33747
|
+
emit(`${attrs}public ${spelled} { ${trap(path38)} }`);
|
|
33748
33748
|
} else if (kind === "swift.var") {
|
|
33749
33749
|
const parsed = splitAccessors(text(symbol).replace(/^let /, "var "));
|
|
33750
|
-
const measured = behavior.get(
|
|
33751
|
-
if (measured) used.add(
|
|
33752
|
-
emit(`public ${parsed.decl} { ${measured?.body ?? trap(
|
|
33753
|
-
} else skipped.push({ path:
|
|
33750
|
+
const measured = behavior.get(path38);
|
|
33751
|
+
if (measured) used.add(path38);
|
|
33752
|
+
emit(`public ${parsed.decl} { ${measured?.body ?? trap(path38)} }`);
|
|
33753
|
+
} else skipped.push({ path: path38, reason: `unhandled top-level ${kind}` });
|
|
33754
33754
|
});
|
|
33755
33755
|
const roots = [...byId.values()].filter((symbol) => !owner.has(symbol.identifier.precise) && !unavailable(symbol)).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
33756
33756
|
for (const symbol of roots) {
|
|
33757
|
-
const
|
|
33757
|
+
const path38 = pathOf(symbol);
|
|
33758
33758
|
if (TYPE_KINDS.has(symbol.kind.identifier)) emitType(symbol, "");
|
|
33759
33759
|
else emitGlobal(symbol);
|
|
33760
33760
|
}
|
|
@@ -33795,9 +33795,9 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33795
33795
|
...imports.map((name2) => `import ${name2}`),
|
|
33796
33796
|
""
|
|
33797
33797
|
];
|
|
33798
|
-
for (const
|
|
33799
|
-
if (!used.has(
|
|
33800
|
-
skipped.push({ path:
|
|
33798
|
+
for (const path38 of behavior.keys())
|
|
33799
|
+
if (!used.has(path38))
|
|
33800
|
+
skipped.push({ path: path38, reason: "behavior names no emitted declaration" });
|
|
33801
33801
|
return {
|
|
33802
33802
|
source: `${[...banner, ...lines].join("\n")}
|
|
33803
33803
|
`,
|
|
@@ -33883,7 +33883,7 @@ var init_swift_standin_emit = __esm({
|
|
|
33883
33883
|
sideLeaf = (symbol) => `${symbol.kind.identifier.startsWith("swift.type.") ? "type" : "instance"}|leaf|${leaf(symbol)}`;
|
|
33884
33884
|
isObjC = (symbol) => symbol.identifier.precise.startsWith("c:");
|
|
33885
33885
|
synthesizedEquality = (symbol, conforms) => conforms.includes("Hashable") ? ["==(_:_:)", "hash(into:)", "hashValue"].includes(leaf(symbol)) : conforms.includes("Equatable") && leaf(symbol) === "==(_:_:)";
|
|
33886
|
-
trap = (
|
|
33886
|
+
trap = (path38) => `fatalError("${path38} is a binary framework peach cannot run")`;
|
|
33887
33887
|
KEYWORDS = /* @__PURE__ */ new Set([
|
|
33888
33888
|
"Type",
|
|
33889
33889
|
"Protocol",
|
|
@@ -36601,9 +36601,6 @@ function nativeTargets(project) {
|
|
|
36601
36601
|
}
|
|
36602
36602
|
return refs;
|
|
36603
36603
|
}
|
|
36604
|
-
function listXcodeAppTargets(xcodeprojOrWorkspace) {
|
|
36605
|
-
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(nativeTargets).filter((ref) => ref.target.productType === APPLICATION).map((ref) => str(ref.target.name) ?? ref.id);
|
|
36606
|
-
}
|
|
36607
36604
|
function readXcodeAppTarget(input, targetName) {
|
|
36608
36605
|
const xcodeprojOrWorkspace = import_node_fs18.default.realpathSync(input);
|
|
36609
36606
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
@@ -38182,8 +38179,8 @@ function sourceEntryPath() {
|
|
|
38182
38179
|
return null;
|
|
38183
38180
|
}
|
|
38184
38181
|
}
|
|
38185
|
-
function isCliEntry(
|
|
38186
|
-
const name2 = (0, import_node_path22.basename)(
|
|
38182
|
+
function isCliEntry(path38) {
|
|
38183
|
+
const name2 = (0, import_node_path22.basename)(path38);
|
|
38187
38184
|
return name2 === "bin.ts" || name2 === "bin.js";
|
|
38188
38185
|
}
|
|
38189
38186
|
function rnxSelfInvocation() {
|
|
@@ -43098,8 +43095,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
|
|
|
43098
43095
|
}
|
|
43099
43096
|
const out = [];
|
|
43100
43097
|
for (const dir of dirs) {
|
|
43101
|
-
const
|
|
43102
|
-
if (!out.includes(
|
|
43098
|
+
const path38 = `${dir}/${filename}`;
|
|
43099
|
+
if (!out.includes(path38)) out.push(path38);
|
|
43103
43100
|
}
|
|
43104
43101
|
if (!out.includes(filename)) out.push(filename);
|
|
43105
43102
|
return out;
|
|
@@ -44063,13 +44060,13 @@ function readFactoryStringLiterals(factory) {
|
|
|
44063
44060
|
return literals;
|
|
44064
44061
|
}
|
|
44065
44062
|
function normalizeFingerprintLiteral(literal) {
|
|
44066
|
-
const
|
|
44063
|
+
const path38 = literal.replaceAll("\\\\", "/").replaceAll("\\/", "/");
|
|
44067
44064
|
const nodeModulesMarker = "/node_modules/";
|
|
44068
|
-
const nodeModulesIndex =
|
|
44065
|
+
const nodeModulesIndex = path38.lastIndexOf(nodeModulesMarker);
|
|
44069
44066
|
if (nodeModulesIndex >= 0) {
|
|
44070
|
-
return `node_modules/${
|
|
44067
|
+
return `node_modules/${path38.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
|
|
44071
44068
|
}
|
|
44072
|
-
if ((
|
|
44069
|
+
if ((path38.startsWith("/") || /^[A-Za-z]:\//.test(path38) || path38.startsWith("file:/")) && /\.[cm]?[jt]sx?(?::\d+(?::\d+)?)?$/.test(path38)) {
|
|
44073
44070
|
return null;
|
|
44074
44071
|
}
|
|
44075
44072
|
return literal;
|
|
@@ -44307,10 +44304,10 @@ function templateAssignment(template, embeddings) {
|
|
|
44307
44304
|
if (existingNode !== void 0 && existingNode !== nodeIndex) return null;
|
|
44308
44305
|
nodesByModuleId.set(moduleId, nodeIndex);
|
|
44309
44306
|
const node = template.nodes[nodeIndex];
|
|
44310
|
-
const
|
|
44307
|
+
const path38 = node.landmarkPath ?? `node_modules/${template.packageName}/__rnx_inferred__/${moduleId}.js`;
|
|
44311
44308
|
const existingPath = pathsByModuleId.get(moduleId);
|
|
44312
|
-
if (existingPath !== void 0 && existingPath !==
|
|
44313
|
-
pathsByModuleId.set(moduleId,
|
|
44309
|
+
if (existingPath !== void 0 && existingPath !== path38) return null;
|
|
44310
|
+
pathsByModuleId.set(moduleId, path38);
|
|
44314
44311
|
}
|
|
44315
44312
|
}
|
|
44316
44313
|
return {
|
|
@@ -44472,14 +44469,14 @@ async function inferMetroModuleIdentity(args) {
|
|
|
44472
44469
|
const packageClaims = claimsByPackage.values().next().value;
|
|
44473
44470
|
if (!packageClaims) continue;
|
|
44474
44471
|
const exactClaims = packageClaims.filter((assignment2) => {
|
|
44475
|
-
const
|
|
44476
|
-
return
|
|
44472
|
+
const path38 = assignment2.pathsByModuleId.get(moduleId);
|
|
44473
|
+
return path38 !== void 0 && !path38.includes("/__rnx_inferred__/");
|
|
44477
44474
|
});
|
|
44478
44475
|
const preferredClaims = exactClaims.length > 0 ? exactClaims : packageClaims;
|
|
44479
44476
|
const routes = new Set(
|
|
44480
44477
|
preferredClaims.flatMap((assignment2) => {
|
|
44481
|
-
const
|
|
44482
|
-
return
|
|
44478
|
+
const path38 = assignment2.pathsByModuleId.get(moduleId);
|
|
44479
|
+
return path38 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path38)] : [];
|
|
44483
44480
|
})
|
|
44484
44481
|
);
|
|
44485
44482
|
if (routes.size !== 1) continue;
|
|
@@ -44766,6 +44763,33 @@ var init_cloud_session = __esm({
|
|
|
44766
44763
|
}
|
|
44767
44764
|
});
|
|
44768
44765
|
|
|
44766
|
+
// cli/commands/nodeRepoFileReader.ts
|
|
44767
|
+
var import_node_fs29, nodeRepoFileReader;
|
|
44768
|
+
var init_nodeRepoFileReader = __esm({
|
|
44769
|
+
"cli/commands/nodeRepoFileReader.ts"() {
|
|
44770
|
+
"use strict";
|
|
44771
|
+
import_node_fs29 = require("node:fs");
|
|
44772
|
+
nodeRepoFileReader = {
|
|
44773
|
+
exists: import_node_fs29.existsSync,
|
|
44774
|
+
readText: (filePath) => (0, import_node_fs29.readFileSync)(filePath, "utf8"),
|
|
44775
|
+
entries: (directory) => (0, import_node_fs29.readdirSync)(directory, { withFileTypes: true }).map((entry) => ({
|
|
44776
|
+
name: entry.name,
|
|
44777
|
+
directory: entry.isDirectory()
|
|
44778
|
+
})),
|
|
44779
|
+
isDirectory: (filePath) => (0, import_node_fs29.statSync)(filePath).isDirectory(),
|
|
44780
|
+
readMetadata(filePath) {
|
|
44781
|
+
try {
|
|
44782
|
+
const info = (0, import_node_fs29.lstatSync)(filePath);
|
|
44783
|
+
if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
|
|
44784
|
+
return (0, import_node_fs29.readFileSync)(filePath, "utf8");
|
|
44785
|
+
} catch {
|
|
44786
|
+
return null;
|
|
44787
|
+
}
|
|
44788
|
+
}
|
|
44789
|
+
};
|
|
44790
|
+
}
|
|
44791
|
+
});
|
|
44792
|
+
|
|
44769
44793
|
// cli/commands/detect.ts
|
|
44770
44794
|
function detectFramework2(deps) {
|
|
44771
44795
|
if (deps.one) return "one";
|
|
@@ -44773,14 +44797,14 @@ function detectFramework2(deps) {
|
|
|
44773
44797
|
if (deps["react-native"]) return "bare";
|
|
44774
44798
|
return "unknown";
|
|
44775
44799
|
}
|
|
44776
|
-
function detectProject(dir) {
|
|
44800
|
+
function detectProject(dir, files2 = nodeRepoFileReader) {
|
|
44777
44801
|
const pkgPath = (0, import_node_path30.join)(dir, "package.json");
|
|
44778
|
-
if (!
|
|
44779
|
-
const pkg = readProjectManifest(dir);
|
|
44802
|
+
if (!files2.exists(pkgPath)) return null;
|
|
44803
|
+
const pkg = readProjectManifest(dir, files2);
|
|
44780
44804
|
if (!pkg) return null;
|
|
44781
44805
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
44782
44806
|
const devCommand = metadataValue(
|
|
44783
|
-
metadataValue(readProjectJson(pkgPath), "scripts"),
|
|
44807
|
+
metadataValue(readProjectJson(pkgPath, files2), "scripts"),
|
|
44784
44808
|
"dev"
|
|
44785
44809
|
);
|
|
44786
44810
|
const framework = detectFramework2(deps);
|
|
@@ -44793,29 +44817,23 @@ function detectProject(dir) {
|
|
|
44793
44817
|
// apps write .cjs as often as .js, and missing one reads as "this project
|
|
44794
44818
|
// has no bundler config" and sends the user to create a second one.
|
|
44795
44819
|
hasViteConfig: CONFIG_EXTENSIONS.some(
|
|
44796
|
-
(ext) =>
|
|
44820
|
+
(ext) => files2.exists((0, import_node_path30.join)(dir, `vite.config.${ext}`))
|
|
44797
44821
|
),
|
|
44798
44822
|
hasMetroConfig: CONFIG_EXTENSIONS.some(
|
|
44799
|
-
(ext) =>
|
|
44823
|
+
(ext) => files2.exists((0, import_node_path30.join)(dir, `metro.config.${ext}`))
|
|
44800
44824
|
),
|
|
44801
44825
|
devCommand: typeof devCommand === "string" ? devCommand : null
|
|
44802
44826
|
};
|
|
44803
44827
|
}
|
|
44804
|
-
function readProjectMetadata(
|
|
44805
|
-
|
|
44806
|
-
const info = (0, import_node_fs29.lstatSync)(path39);
|
|
44807
|
-
if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
|
|
44808
|
-
return (0, import_node_fs29.readFileSync)(path39, "utf8");
|
|
44809
|
-
} catch {
|
|
44810
|
-
return null;
|
|
44811
|
-
}
|
|
44828
|
+
function readProjectMetadata(filePath, files2 = nodeRepoFileReader) {
|
|
44829
|
+
return files2.readMetadata(filePath);
|
|
44812
44830
|
}
|
|
44813
44831
|
function metadataValue(value, key2) {
|
|
44814
44832
|
if (!value || typeof value !== "object") return void 0;
|
|
44815
44833
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
44816
44834
|
}
|
|
44817
|
-
function readProjectJson(
|
|
44818
|
-
const text3 = readProjectMetadata(
|
|
44835
|
+
function readProjectJson(path38, files2 = nodeRepoFileReader) {
|
|
44836
|
+
const text3 = readProjectMetadata(path38, files2);
|
|
44819
44837
|
if (text3 === null) return null;
|
|
44820
44838
|
try {
|
|
44821
44839
|
const value = JSON.parse(text3);
|
|
@@ -44824,8 +44842,8 @@ function readProjectJson(path39) {
|
|
|
44824
44842
|
return null;
|
|
44825
44843
|
}
|
|
44826
44844
|
}
|
|
44827
|
-
function readProjectManifest(dir) {
|
|
44828
|
-
const parsed = readProjectJson((0, import_node_path30.join)(dir, "package.json"));
|
|
44845
|
+
function readProjectManifest(dir, files2 = nodeRepoFileReader) {
|
|
44846
|
+
const parsed = readProjectJson((0, import_node_path30.join)(dir, "package.json"), files2);
|
|
44829
44847
|
if (!parsed || typeof parsed !== "object") return null;
|
|
44830
44848
|
const record2 = (value) => {
|
|
44831
44849
|
if (!value || typeof value !== "object") return {};
|
|
@@ -44842,14 +44860,14 @@ function readProjectManifest(dir) {
|
|
|
44842
44860
|
devDependencies: record2(metadataValue(parsed, "devDependencies"))
|
|
44843
44861
|
};
|
|
44844
44862
|
}
|
|
44845
|
-
var
|
|
44863
|
+
var import_node_path30, import_json52, CONFIG_EXTENSIONS;
|
|
44846
44864
|
var init_detect = __esm({
|
|
44847
44865
|
"cli/commands/detect.ts"() {
|
|
44848
44866
|
"use strict";
|
|
44849
|
-
import_node_fs29 = require("node:fs");
|
|
44850
44867
|
import_node_path30 = require("node:path");
|
|
44851
44868
|
import_json52 = __toESM(require_lib(), 1);
|
|
44852
44869
|
init_browser();
|
|
44870
|
+
init_nodeRepoFileReader();
|
|
44853
44871
|
CONFIG_EXTENSIONS = ["ts", "js", "cjs", "mjs", "mts", "cts"];
|
|
44854
44872
|
}
|
|
44855
44873
|
});
|
|
@@ -48800,11 +48818,11 @@ async function evalInBridge(bridge, code, opts = {}) {
|
|
|
48800
48818
|
if (opts.acquireLock) payload.acquireLock = true;
|
|
48801
48819
|
return bridge.send(payload);
|
|
48802
48820
|
}
|
|
48803
|
-
async function callInBridge(bridge,
|
|
48804
|
-
return bridge.send({ type: "call", path:
|
|
48821
|
+
async function callInBridge(bridge, path38, ...args) {
|
|
48822
|
+
return bridge.send({ type: "call", path: path38, args });
|
|
48805
48823
|
}
|
|
48806
|
-
async function callInBridgeWrite(bridge,
|
|
48807
|
-
return bridge.send({ type: "call", path:
|
|
48824
|
+
async function callInBridgeWrite(bridge, path38, ...args) {
|
|
48825
|
+
return bridge.send({ type: "call", path: path38, args, acquireLock: true });
|
|
48808
48826
|
}
|
|
48809
48827
|
var import_node_fs32, import_node_path33, import_ws2, PEACH_PLACEMENT_ENV, resolvedWorld, BridgeSimLockedError, DisconnectedSimError, BRIDGE_VALUE_FLAGS_TABLE, BRIDGE_VALUE_FLAGS;
|
|
48810
48828
|
var init_ws_bridge = __esm({
|
|
@@ -48941,8 +48959,8 @@ function getDefaultPortForProtocol(protocol) {
|
|
|
48941
48959
|
return protocol === "https:" ? 443 : 80;
|
|
48942
48960
|
}
|
|
48943
48961
|
function isBaseServerUrl(url) {
|
|
48944
|
-
const
|
|
48945
|
-
return (
|
|
48962
|
+
const path38 = url.pathname || "/";
|
|
48963
|
+
return (path38 === "/" || path38 === "") && !url.search && !url.hash;
|
|
48946
48964
|
}
|
|
48947
48965
|
async function resolvePortViaServerScan(port) {
|
|
48948
48966
|
try {
|
|
@@ -49243,165 +49261,6 @@ var init_flow_timeout_scale = __esm({
|
|
|
49243
49261
|
}
|
|
49244
49262
|
});
|
|
49245
49263
|
|
|
49246
|
-
// src/native-firebase-config.ts
|
|
49247
|
-
function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
|
|
49248
|
-
const result = {};
|
|
49249
|
-
let config = {};
|
|
49250
|
-
const appJsonPath = import_node_path35.default.join(projectRoot, "app.json");
|
|
49251
|
-
const appJson = import_node_fs34.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs34.default.readFileSync(appJsonPath, "utf8")) : null;
|
|
49252
|
-
const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
|
|
49253
|
-
(value) => isRecord(value) && typeof value.googleServicesFile === "string"
|
|
49254
|
-
));
|
|
49255
|
-
const dynamicExpo = [
|
|
49256
|
-
"app.config.js",
|
|
49257
|
-
"app.config.ts",
|
|
49258
|
-
"app.config.cjs",
|
|
49259
|
-
"app.config.mjs"
|
|
49260
|
-
].some((name2) => import_node_fs34.default.existsSync(import_node_path35.default.join(projectRoot, name2)));
|
|
49261
|
-
if (staticExpo || dynamicExpo) {
|
|
49262
|
-
const require4 = (0, import_node_module2.createRequire)(import_node_path35.default.join(projectRoot, "package.json"));
|
|
49263
|
-
const configModule = require4("@expo/config");
|
|
49264
|
-
if (!isRecord(configModule) || typeof configModule.getConfig !== "function")
|
|
49265
|
-
throw new Error("Expo native configuration is unavailable.");
|
|
49266
|
-
const resolved = Reflect.apply(configModule.getConfig, configModule, [
|
|
49267
|
-
projectRoot,
|
|
49268
|
-
{ skipSDKVersionRequirement: true }
|
|
49269
|
-
]);
|
|
49270
|
-
config = isRecord(resolved) && isRecord(resolved.exp) ? resolved.exp : {};
|
|
49271
|
-
}
|
|
49272
|
-
const ios = config.ios;
|
|
49273
|
-
if (platforms.includes("ios") && (!isRecord(ios) || typeof ios.googleServicesFile !== "string")) {
|
|
49274
|
-
const iosRoot = import_node_path35.default.join(projectRoot, "ios");
|
|
49275
|
-
if (import_node_fs34.default.existsSync(iosRoot)) {
|
|
49276
|
-
const projects2 = import_node_fs34.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
|
|
49277
|
-
if (projects2.length > 1)
|
|
49278
|
-
throw new Error("native Firebase configuration requires a selected Xcode project");
|
|
49279
|
-
if (projects2.length === 1) {
|
|
49280
|
-
const xcodeproj = import_node_path35.default.join(iosRoot, projects2[0].name);
|
|
49281
|
-
const appTargets = listXcodeAppTargets(xcodeproj);
|
|
49282
|
-
if (appTargets.length > 1)
|
|
49283
|
-
throw new Error("native Firebase configuration requires a selected app target");
|
|
49284
|
-
if (appTargets.length === 1) {
|
|
49285
|
-
const app = readXcodeAppTarget(xcodeproj, appTargets[0]);
|
|
49286
|
-
const delegates = app.allSources.filter(
|
|
49287
|
-
(file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path35.default.basename(file))
|
|
49288
|
-
);
|
|
49289
|
-
const defaultConfigured = delegates.some((file) => {
|
|
49290
|
-
const source = import_node_fs34.default.readFileSync(file, "utf8").replace(
|
|
49291
|
-
/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"(?:\\.|[^"\\])*"/g,
|
|
49292
|
-
(token) => token.startsWith('"') ? '""' : token.replace(/[^\n]/g, " ")
|
|
49293
|
-
);
|
|
49294
|
-
const launch2 = /(?:\bfunc\s+application\s*\([\s\S]*?didFinishLaunchingWithOptions[\s\S]*?\)\s*->\s*Bool|^-\s*\(BOOL\)\s*application\s*:[\s\S]*?didFinishLaunchingWithOptions[^\{]*)\s*\{/m.exec(
|
|
49295
|
-
source
|
|
49296
|
-
);
|
|
49297
|
-
if (!launch2) return false;
|
|
49298
|
-
const body = source.slice(launch2.index + launch2[0].length);
|
|
49299
|
-
const configure = /^\s*(?:FirebaseApp\s*\.\s*configure\s*\(\s*\)|\[FIRApp\s+configure\])/m.exec(
|
|
49300
|
-
body
|
|
49301
|
-
);
|
|
49302
|
-
if (!configure) return false;
|
|
49303
|
-
const before = body.slice(0, configure.index);
|
|
49304
|
-
let depth = 1;
|
|
49305
|
-
for (const token of before) {
|
|
49306
|
-
if (token === "{") depth += 1;
|
|
49307
|
-
if (token === "}") depth -= 1;
|
|
49308
|
-
if (depth === 0) return false;
|
|
49309
|
-
}
|
|
49310
|
-
if (depth !== 1 || /\b(?:return|throw)\b|^\s*#(?:if|elseif|else)/m.test(before))
|
|
49311
|
-
throw new Error(
|
|
49312
|
-
"native Firebase initialization must be unconditional in the app launch method"
|
|
49313
|
-
);
|
|
49314
|
-
return true;
|
|
49315
|
-
});
|
|
49316
|
-
if (defaultConfigured) {
|
|
49317
|
-
const resources = app.resources.filter(
|
|
49318
|
-
(file) => /^GoogleService-Info\.plist$/.test(import_node_path35.default.basename(file))
|
|
49319
|
-
);
|
|
49320
|
-
if (resources.length !== 1)
|
|
49321
|
-
throw new Error(
|
|
49322
|
-
"native Firebase default initialization requires one GoogleService-Info.plist build resource"
|
|
49323
|
-
);
|
|
49324
|
-
config.ios = {
|
|
49325
|
-
googleServicesFile: import_node_path35.default.relative(
|
|
49326
|
-
import_node_fs34.default.realpathSync(projectRoot),
|
|
49327
|
-
resources[0]
|
|
49328
|
-
)
|
|
49329
|
-
};
|
|
49330
|
-
}
|
|
49331
|
-
}
|
|
49332
|
-
}
|
|
49333
|
-
}
|
|
49334
|
-
}
|
|
49335
|
-
for (const platform of platforms) {
|
|
49336
|
-
const native = config[platform];
|
|
49337
|
-
if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
|
|
49338
|
-
try {
|
|
49339
|
-
const source = import_node_fs34.default.readFileSync(
|
|
49340
|
-
import_node_path35.default.resolve(projectRoot, native.googleServicesFile),
|
|
49341
|
-
"utf8"
|
|
49342
|
-
);
|
|
49343
|
-
const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
|
|
49344
|
-
if (!isRecord(parsed)) throw new Error("Invalid Google services file.");
|
|
49345
|
-
if (platform === "ios") {
|
|
49346
|
-
result[platform] = {
|
|
49347
|
-
apiKey: parsed.API_KEY,
|
|
49348
|
-
appId: parsed.GOOGLE_APP_ID,
|
|
49349
|
-
projectId: parsed.PROJECT_ID,
|
|
49350
|
-
databaseURL: parsed.DATABASE_URL,
|
|
49351
|
-
gaTrackingId: parsed.TRACKING_ID,
|
|
49352
|
-
storageBucket: parsed.STORAGE_BUCKET,
|
|
49353
|
-
messagingSenderId: parsed.GCM_SENDER_ID,
|
|
49354
|
-
clientId: parsed.CLIENT_ID,
|
|
49355
|
-
androidClientID: parsed.ANDROID_CLIENT_ID,
|
|
49356
|
-
deepLinkUrlScheme: parsed.REVERSED_CLIENT_ID
|
|
49357
|
-
};
|
|
49358
|
-
} else {
|
|
49359
|
-
const project = isRecord(parsed.project_info) ? parsed.project_info : {};
|
|
49360
|
-
const clients = Array.isArray(parsed.client) ? parsed.client : [];
|
|
49361
|
-
const client = clients.find((value) => {
|
|
49362
|
-
if (!isRecord(value) || !isRecord(value.client_info)) return false;
|
|
49363
|
-
const android = value.client_info.android_client_info;
|
|
49364
|
-
return isRecord(android) && android.package_name === native.package;
|
|
49365
|
-
});
|
|
49366
|
-
if (!isRecord(client) || !isRecord(client.client_info))
|
|
49367
|
-
throw new Error("No Google services client matches the Android package.");
|
|
49368
|
-
const apiKeys = Array.isArray(client.api_key) ? client.api_key : [];
|
|
49369
|
-
const apiKey = apiKeys.find(
|
|
49370
|
-
(value) => isRecord(value) && typeof value.current_key === "string"
|
|
49371
|
-
);
|
|
49372
|
-
const oauthClients = Array.isArray(client.oauth_client) ? client.oauth_client : [];
|
|
49373
|
-
const oauth = oauthClients.find(
|
|
49374
|
-
(value) => isRecord(value) && value.client_type === 3
|
|
49375
|
-
);
|
|
49376
|
-
result[platform] = {
|
|
49377
|
-
apiKey: isRecord(apiKey) ? apiKey.current_key : void 0,
|
|
49378
|
-
appId: client.client_info.mobilesdk_app_id,
|
|
49379
|
-
projectId: project.project_id,
|
|
49380
|
-
databaseURL: project.firebase_url,
|
|
49381
|
-
storageBucket: project.storage_bucket,
|
|
49382
|
-
messagingSenderId: project.project_number,
|
|
49383
|
-
clientId: isRecord(oauth) ? oauth.client_id : void 0
|
|
49384
|
-
};
|
|
49385
|
-
}
|
|
49386
|
-
} catch (error) {
|
|
49387
|
-
result[platform] = { error: error instanceof Error ? error.message : String(error) };
|
|
49388
|
-
}
|
|
49389
|
-
}
|
|
49390
|
-
return result;
|
|
49391
|
-
}
|
|
49392
|
-
var import_node_fs34, import_node_module2, import_node_path35;
|
|
49393
|
-
var init_native_firebase_config = __esm({
|
|
49394
|
-
"src/native-firebase-config.ts"() {
|
|
49395
|
-
"use strict";
|
|
49396
|
-
import_node_fs34 = __toESM(require("node:fs"), 1);
|
|
49397
|
-
import_node_module2 = require("node:module");
|
|
49398
|
-
import_node_path35 = __toESM(require("node:path"), 1);
|
|
49399
|
-
init_is_record();
|
|
49400
|
-
init_plist();
|
|
49401
|
-
init_xcode_project();
|
|
49402
|
-
}
|
|
49403
|
-
});
|
|
49404
|
-
|
|
49405
49264
|
// src/profiles.ts
|
|
49406
49265
|
function normalizeProfileId(input) {
|
|
49407
49266
|
const id = input.trim();
|
|
@@ -49509,59 +49368,59 @@ var init_profiles = __esm({
|
|
|
49509
49368
|
// cli/app-catalog.ts
|
|
49510
49369
|
function listDir(dir) {
|
|
49511
49370
|
try {
|
|
49512
|
-
return
|
|
49371
|
+
return import_node_fs34.default.readdirSync(dir, { withFileTypes: true });
|
|
49513
49372
|
} catch {
|
|
49514
49373
|
return [];
|
|
49515
49374
|
}
|
|
49516
49375
|
}
|
|
49517
49376
|
function readText(file) {
|
|
49518
49377
|
try {
|
|
49519
|
-
return
|
|
49378
|
+
return import_node_fs34.default.readFileSync(file, "utf8");
|
|
49520
49379
|
} catch {
|
|
49521
49380
|
return null;
|
|
49522
49381
|
}
|
|
49523
49382
|
}
|
|
49524
49383
|
function catalogFiles(dir, found) {
|
|
49525
49384
|
for (const entry of listDir(dir)) {
|
|
49526
|
-
const full =
|
|
49385
|
+
const full = import_node_path35.default.join(dir, entry.name);
|
|
49527
49386
|
if (entry.isDirectory()) catalogFiles(full, found);
|
|
49528
49387
|
else if (entry.name === "Contents.json") found.push(full);
|
|
49529
49388
|
}
|
|
49530
49389
|
}
|
|
49531
49390
|
function discoverAppCatalog(appDir) {
|
|
49532
|
-
const iosDir =
|
|
49391
|
+
const iosDir = import_node_path35.default.join(appDir, "ios");
|
|
49533
49392
|
const target = listDir(iosDir).find(
|
|
49534
|
-
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir(
|
|
49393
|
+
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir(import_node_path35.default.join(iosDir, entry.name)).some(
|
|
49535
49394
|
(file) => /^AppDelegate\.(swift|mm|m)$/.test(file.name)
|
|
49536
49395
|
)
|
|
49537
49396
|
);
|
|
49538
49397
|
if (!target) return null;
|
|
49539
|
-
const targetDir =
|
|
49398
|
+
const targetDir = import_node_path35.default.join(iosDir, target.name);
|
|
49540
49399
|
const files2 = [];
|
|
49541
49400
|
for (const entry of listDir(targetDir)) {
|
|
49542
49401
|
if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
|
|
49543
|
-
catalogFiles(
|
|
49402
|
+
catalogFiles(import_node_path35.default.join(targetDir, entry.name), files2);
|
|
49544
49403
|
}
|
|
49545
49404
|
const relative3 = files2.map(
|
|
49546
|
-
(file) =>
|
|
49405
|
+
(file) => import_node_path35.default.relative(targetDir, file).split(import_node_path35.default.sep).join(import_node_path35.default.posix.sep)
|
|
49547
49406
|
);
|
|
49548
49407
|
const colors = enumerateBundleColors(
|
|
49549
49408
|
relative3,
|
|
49550
|
-
(candidate) => candidate.endsWith("Contents.json") ? readText(
|
|
49409
|
+
(candidate) => candidate.endsWith("Contents.json") ? readText(import_node_path35.default.join(targetDir, candidate)) : null
|
|
49551
49410
|
);
|
|
49552
49411
|
const pbxproj = listDir(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
|
|
49553
|
-
const accentName = readText(
|
|
49412
|
+
const accentName = readText(import_node_path35.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path35.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
|
|
49554
49413
|
ACCENT_BUILD_SETTING
|
|
49555
49414
|
)?.[1] : void 0) ?? null;
|
|
49556
49415
|
if (accentName === null && Object.keys(colors).length === 0) return null;
|
|
49557
49416
|
return { colors, accentName };
|
|
49558
49417
|
}
|
|
49559
|
-
var
|
|
49418
|
+
var import_node_fs34, import_node_path35, ACCENT_BUILD_SETTING, PLIST_ACCENT;
|
|
49560
49419
|
var init_app_catalog = __esm({
|
|
49561
49420
|
"cli/app-catalog.ts"() {
|
|
49562
49421
|
"use strict";
|
|
49563
|
-
|
|
49564
|
-
|
|
49422
|
+
import_node_fs34 = __toESM(require("node:fs"), 1);
|
|
49423
|
+
import_node_path35 = __toESM(require("node:path"), 1);
|
|
49565
49424
|
init_bundleAssets();
|
|
49566
49425
|
ACCENT_BUILD_SETTING = /ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "?([^";]+)"?;/;
|
|
49567
49426
|
PLIST_ACCENT = /<key>NSAccentColorName<\/key>\s*<string>([^<]+)<\/string>/;
|
|
@@ -49571,9 +49430,9 @@ var init_app_catalog = __esm({
|
|
|
49571
49430
|
// cli/app-project.ts
|
|
49572
49431
|
function firstNamedFile(dir, names) {
|
|
49573
49432
|
for (const name2 of names) {
|
|
49574
|
-
const candidate =
|
|
49433
|
+
const candidate = import_node_path36.default.join(dir, name2);
|
|
49575
49434
|
try {
|
|
49576
|
-
if (
|
|
49435
|
+
if (import_node_fs35.default.statSync(candidate).isFile()) return candidate;
|
|
49577
49436
|
} catch {
|
|
49578
49437
|
}
|
|
49579
49438
|
}
|
|
@@ -49586,24 +49445,24 @@ function findRNXAppConfig(dir) {
|
|
|
49586
49445
|
return firstNamedFile(dir, PEACH_APP_CONFIG_NAMES);
|
|
49587
49446
|
}
|
|
49588
49447
|
function resolveAppProject(projectRoot) {
|
|
49589
|
-
const appDir =
|
|
49448
|
+
const appDir = import_node_path36.default.resolve(projectRoot);
|
|
49590
49449
|
try {
|
|
49591
|
-
if (!
|
|
49450
|
+
if (!import_node_fs35.default.statSync(appDir).isDirectory()) return null;
|
|
49592
49451
|
} catch {
|
|
49593
49452
|
return null;
|
|
49594
49453
|
}
|
|
49595
49454
|
const configPath = findRNXAppConfig(appDir);
|
|
49596
|
-
if (!configPath && !findExpoAppConfig(appDir) && !
|
|
49455
|
+
if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs35.default.existsSync(import_node_path36.default.join(appDir, "package.json"))) {
|
|
49597
49456
|
return null;
|
|
49598
49457
|
}
|
|
49599
49458
|
return { appDir, configPath };
|
|
49600
49459
|
}
|
|
49601
|
-
var
|
|
49460
|
+
var import_node_fs35, import_node_path36, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
|
|
49602
49461
|
var init_app_project = __esm({
|
|
49603
49462
|
"cli/app-project.ts"() {
|
|
49604
49463
|
"use strict";
|
|
49605
|
-
|
|
49606
|
-
|
|
49464
|
+
import_node_fs35 = __toESM(require("node:fs"), 1);
|
|
49465
|
+
import_node_path36 = __toESM(require("node:path"), 1);
|
|
49607
49466
|
EXPO_APP_CONFIG_NAMES = [
|
|
49608
49467
|
"app.config.js",
|
|
49609
49468
|
"app.config.ts",
|
|
@@ -49626,12 +49485,12 @@ function resolveFileEntries(entries, configDir) {
|
|
|
49626
49485
|
return Object.fromEntries(
|
|
49627
49486
|
Object.entries(entries).map(([name2, resolution]) => [
|
|
49628
49487
|
name2,
|
|
49629
|
-
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file:
|
|
49488
|
+
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path37.default.resolve(configDir, resolution.file) } : resolution
|
|
49630
49489
|
])
|
|
49631
49490
|
);
|
|
49632
49491
|
}
|
|
49633
49492
|
function resolveConfigReplacementFiles(config, configPath) {
|
|
49634
|
-
const configDir =
|
|
49493
|
+
const configDir = import_node_path37.default.dirname(configPath);
|
|
49635
49494
|
return {
|
|
49636
49495
|
...config,
|
|
49637
49496
|
modules: resolveFileEntries(config.modules, configDir),
|
|
@@ -49666,11 +49525,11 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
|
|
|
49666
49525
|
const project = resolveAppProject(startDir);
|
|
49667
49526
|
return { project, config: await loadRNXAppConfig(project) };
|
|
49668
49527
|
}
|
|
49669
|
-
var
|
|
49528
|
+
var import_node_path37, import_jiti;
|
|
49670
49529
|
var init_app_config = __esm({
|
|
49671
49530
|
"cli/app-config.ts"() {
|
|
49672
49531
|
"use strict";
|
|
49673
|
-
|
|
49532
|
+
import_node_path37 = __toESM(require("node:path"), 1);
|
|
49674
49533
|
import_jiti = require("jiti");
|
|
49675
49534
|
init_config();
|
|
49676
49535
|
init_config();
|
|
@@ -49730,13 +49589,13 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49730
49589
|
scannedFontDirectories++;
|
|
49731
49590
|
let entries;
|
|
49732
49591
|
try {
|
|
49733
|
-
entries =
|
|
49592
|
+
entries = import_node_fs36.default.readdirSync(current.dir, { withFileTypes: true });
|
|
49734
49593
|
} catch {
|
|
49735
49594
|
continue;
|
|
49736
49595
|
}
|
|
49737
49596
|
for (const entry of entries) {
|
|
49738
49597
|
if (entry.isSymbolicLink()) continue;
|
|
49739
|
-
const fullPath =
|
|
49598
|
+
const fullPath = import_node_path38.default.join(current.dir, entry.name);
|
|
49740
49599
|
if (entry.isDirectory()) {
|
|
49741
49600
|
if (current.depth < 4 && pending.length < 64 && !entry.name.startsWith(".")) {
|
|
49742
49601
|
pending.push({ dir: fullPath, depth: current.depth + 1 });
|
|
@@ -49744,15 +49603,15 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49744
49603
|
continue;
|
|
49745
49604
|
}
|
|
49746
49605
|
if (!entry.isFile() || !/\.(ttf|otf|woff|woff2)$/i.test(entry.name)) continue;
|
|
49747
|
-
const relative3 =
|
|
49748
|
-
fontPaths.push(
|
|
49606
|
+
const relative3 = import_node_path38.default.relative(root, fullPath).split(import_node_path38.default.sep).join("/");
|
|
49607
|
+
fontPaths.push(import_node_path38.default.posix.join(metroPathPrefix, relative3));
|
|
49749
49608
|
if (fontPaths.length >= 256) break;
|
|
49750
49609
|
}
|
|
49751
49610
|
}
|
|
49752
49611
|
};
|
|
49753
49612
|
try {
|
|
49754
49613
|
const packageJson = JSON.parse(
|
|
49755
|
-
|
|
49614
|
+
import_node_fs36.default.readFileSync(import_node_path38.default.join(selectedAppDir, "package.json"), "utf8")
|
|
49756
49615
|
);
|
|
49757
49616
|
const dependencyNames = /* @__PURE__ */ new Set();
|
|
49758
49617
|
for (const field of ["dependencies", "devDependencies", "optionalDependencies"]) {
|
|
@@ -49767,32 +49626,32 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49767
49626
|
const config = Reflect.get(packageJson, "reactNativeVectorIcons");
|
|
49768
49627
|
const configuredFontDir = config && typeof config === "object" ? Reflect.get(config, "fontDir") : null;
|
|
49769
49628
|
const configuredDir = typeof configuredFontDir === "string" ? configuredFontDir : "rnvi-fonts";
|
|
49770
|
-
const root =
|
|
49771
|
-
const relativeRoot =
|
|
49772
|
-
if (!relativeRoot.startsWith("..") && !
|
|
49773
|
-
collectFontFiles(root, relativeRoot.split(
|
|
49629
|
+
const root = import_node_path38.default.resolve(selectedAppDir, configuredDir);
|
|
49630
|
+
const relativeRoot = import_node_path38.default.relative(selectedAppDir, root);
|
|
49631
|
+
if (!relativeRoot.startsWith("..") && !import_node_path38.default.isAbsolute(relativeRoot)) {
|
|
49632
|
+
collectFontFiles(root, relativeRoot.split(import_node_path38.default.sep).join("/"));
|
|
49774
49633
|
}
|
|
49775
|
-
const bundleDir =
|
|
49776
|
-
const appRelativeDir = bundleDir.split("/").join(
|
|
49634
|
+
const bundleDir = import_node_path38.default.posix.dirname(opts.bundleUrl ? new URL(opts.bundleUrl).pathname : "/").replace(/^\/+/, "");
|
|
49635
|
+
const appRelativeDir = bundleDir.split("/").join(import_node_path38.default.sep);
|
|
49777
49636
|
const metroRootCandidates = [selectedAppDir];
|
|
49778
|
-
if (bundleDir && selectedAppDir.endsWith(
|
|
49637
|
+
if (bundleDir && selectedAppDir.endsWith(import_node_path38.default.sep + appRelativeDir)) {
|
|
49779
49638
|
metroRootCandidates.push(selectedAppDir.slice(0, -appRelativeDir.length - 1));
|
|
49780
49639
|
}
|
|
49781
|
-
const vectorIconRequire = (0,
|
|
49640
|
+
const vectorIconRequire = (0, import_node_module2.createRequire)(import_node_path38.default.join(selectedAppDir, "package.json"));
|
|
49782
49641
|
for (const dependencyName of vectorIconDependencies) {
|
|
49783
49642
|
try {
|
|
49784
49643
|
const entryPath = vectorIconRequire.resolve(dependencyName);
|
|
49785
|
-
const dependencyPath = dependencyName.split("/").join(
|
|
49786
|
-
const marker = `${
|
|
49644
|
+
const dependencyPath = dependencyName.split("/").join(import_node_path38.default.sep);
|
|
49645
|
+
const marker = `${import_node_path38.default.sep}node_modules${import_node_path38.default.sep}${dependencyPath}${import_node_path38.default.sep}`;
|
|
49787
49646
|
const markerIndex = entryPath.lastIndexOf(marker);
|
|
49788
49647
|
if (markerIndex === -1) continue;
|
|
49789
49648
|
const packageRoot = entryPath.slice(0, markerIndex + marker.length - 1);
|
|
49790
49649
|
const fontsDir = dependencyName === "react-native-vector-icons" ? "Fonts" : "fonts";
|
|
49791
|
-
const fontsRoot =
|
|
49650
|
+
const fontsRoot = import_node_path38.default.join(packageRoot, fontsDir);
|
|
49792
49651
|
for (const metroRoot of metroRootCandidates) {
|
|
49793
49652
|
collectFontFiles(
|
|
49794
49653
|
fontsRoot,
|
|
49795
|
-
|
|
49654
|
+
import_node_path38.default.relative(metroRoot, fontsRoot).split(import_node_path38.default.sep).join("/")
|
|
49796
49655
|
);
|
|
49797
49656
|
}
|
|
49798
49657
|
} catch {
|
|
@@ -49802,37 +49661,37 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49802
49661
|
} catch {
|
|
49803
49662
|
}
|
|
49804
49663
|
try {
|
|
49805
|
-
const configPath =
|
|
49806
|
-
if (
|
|
49807
|
-
const appConfigRequire = (0,
|
|
49664
|
+
const configPath = import_node_path38.default.join(selectedAppDir, "react-native.config.js");
|
|
49665
|
+
if (import_node_fs36.default.statSync(configPath).isFile()) {
|
|
49666
|
+
const appConfigRequire = (0, import_node_module2.createRequire)(import_node_path38.default.join(selectedAppDir, "package.json"));
|
|
49808
49667
|
const rnConfig = appConfigRequire(configPath);
|
|
49809
49668
|
const assets2 = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
|
|
49810
49669
|
if (Array.isArray(assets2)) {
|
|
49811
49670
|
for (const assetDir of assets2) {
|
|
49812
49671
|
if (typeof assetDir !== "string") continue;
|
|
49813
|
-
const root =
|
|
49814
|
-
const relativeRoot =
|
|
49815
|
-
if (relativeRoot.startsWith("..") ||
|
|
49816
|
-
collectFontFiles(root, relativeRoot.split(
|
|
49672
|
+
const root = import_node_path38.default.resolve(selectedAppDir, assetDir);
|
|
49673
|
+
const relativeRoot = import_node_path38.default.relative(selectedAppDir, root);
|
|
49674
|
+
if (relativeRoot.startsWith("..") || import_node_path38.default.isAbsolute(relativeRoot)) continue;
|
|
49675
|
+
collectFontFiles(root, relativeRoot.split(import_node_path38.default.sep).join("/"));
|
|
49817
49676
|
}
|
|
49818
49677
|
}
|
|
49819
49678
|
}
|
|
49820
49679
|
} catch {
|
|
49821
49680
|
}
|
|
49822
49681
|
if (platform === "ios") {
|
|
49823
|
-
const iosDir =
|
|
49682
|
+
const iosDir = import_node_path38.default.join(selectedAppDir, "ios");
|
|
49824
49683
|
try {
|
|
49825
|
-
const targetDirs =
|
|
49684
|
+
const targetDirs = import_node_fs36.default.readdirSync(iosDir, { withFileTypes: true }).filter(
|
|
49826
49685
|
(entry) => entry.isDirectory() && !entry.isSymbolicLink() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
|
|
49827
49686
|
).slice(0, 64);
|
|
49828
|
-
const plistPaths = [
|
|
49687
|
+
const plistPaths = [import_node_path38.default.join(iosDir, "Info.plist")];
|
|
49829
49688
|
for (const entry of targetDirs) {
|
|
49830
|
-
plistPaths.push(
|
|
49689
|
+
plistPaths.push(import_node_path38.default.join(iosDir, entry.name, "Info.plist"));
|
|
49831
49690
|
}
|
|
49832
49691
|
for (const plistPath of plistPaths) {
|
|
49833
49692
|
let parsed;
|
|
49834
49693
|
try {
|
|
49835
|
-
parsed = parsePlistSource(
|
|
49694
|
+
parsed = parsePlistSource(import_node_fs36.default.readFileSync(plistPath, "utf8"));
|
|
49836
49695
|
} catch {
|
|
49837
49696
|
continue;
|
|
49838
49697
|
}
|
|
@@ -49842,21 +49701,21 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49842
49701
|
for (const declaredFont of declaredFonts) {
|
|
49843
49702
|
if (typeof declaredFont !== "string") continue;
|
|
49844
49703
|
const candidates = [
|
|
49845
|
-
|
|
49846
|
-
|
|
49704
|
+
import_node_path38.default.resolve(import_node_path38.default.dirname(plistPath), declaredFont),
|
|
49705
|
+
import_node_path38.default.resolve(iosDir, declaredFont)
|
|
49847
49706
|
];
|
|
49848
49707
|
const fontPath = candidates.find((candidate) => {
|
|
49849
|
-
const relative3 =
|
|
49850
|
-
if (relative3.startsWith("..") ||
|
|
49708
|
+
const relative3 = import_node_path38.default.relative(selectedAppDir, candidate);
|
|
49709
|
+
if (relative3.startsWith("..") || import_node_path38.default.isAbsolute(relative3)) return false;
|
|
49851
49710
|
try {
|
|
49852
|
-
return
|
|
49711
|
+
return import_node_fs36.default.statSync(candidate).isFile();
|
|
49853
49712
|
} catch {
|
|
49854
49713
|
return false;
|
|
49855
49714
|
}
|
|
49856
49715
|
});
|
|
49857
49716
|
if (!fontPath) continue;
|
|
49858
49717
|
fontPaths.push(
|
|
49859
|
-
|
|
49718
|
+
import_node_path38.default.relative(selectedAppDir, fontPath).split(import_node_path38.default.sep).join("/")
|
|
49860
49719
|
);
|
|
49861
49720
|
}
|
|
49862
49721
|
}
|
|
@@ -49898,19 +49757,19 @@ async function resolveMetroProjectRoot(bundleUrl, opts) {
|
|
|
49898
49757
|
function encodeAppFontsWire(specs) {
|
|
49899
49758
|
return specs.map((spec) => `${encodeURIComponent(spec.url)}::${encodeURIComponent(spec.family)}`).join(",");
|
|
49900
49759
|
}
|
|
49901
|
-
var
|
|
49760
|
+
var import_node_fs36, import_node_module2, import_node_path38, import_config_plugin_fonts, require2;
|
|
49902
49761
|
var init_app_fonts = __esm({
|
|
49903
49762
|
"cli/app-fonts.ts"() {
|
|
49904
49763
|
"use strict";
|
|
49905
|
-
|
|
49906
|
-
|
|
49907
|
-
|
|
49764
|
+
import_node_fs36 = __toESM(require("node:fs"), 1);
|
|
49765
|
+
import_node_module2 = require("node:module");
|
|
49766
|
+
import_node_path38 = __toESM(require("node:path"), 1);
|
|
49908
49767
|
import_config_plugin_fonts = require("peach-engine/engine/config-plugin-fonts");
|
|
49909
49768
|
init_dev_server_scanner();
|
|
49910
49769
|
init_backend_origin();
|
|
49911
49770
|
init_plist();
|
|
49912
49771
|
init_app_project();
|
|
49913
|
-
require2 = (0,
|
|
49772
|
+
require2 = (0, import_node_module2.createRequire)(__sootsim_import_meta_url);
|
|
49914
49773
|
}
|
|
49915
49774
|
});
|
|
49916
49775
|
|
|
@@ -49979,15 +49838,15 @@ function splashImageUrls(spec) {
|
|
|
49979
49838
|
if (spec.dark?.backgroundImageUrl) urls.add(spec.dark.backgroundImageUrl);
|
|
49980
49839
|
return [...urls];
|
|
49981
49840
|
}
|
|
49982
|
-
var
|
|
49841
|
+
var import_node_module3, import_config_plugin_splash, require3;
|
|
49983
49842
|
var init_app_splash = __esm({
|
|
49984
49843
|
"cli/app-splash.ts"() {
|
|
49985
49844
|
"use strict";
|
|
49986
|
-
|
|
49845
|
+
import_node_module3 = require("node:module");
|
|
49987
49846
|
import_config_plugin_splash = require("peach-engine/engine/config-plugin-splash");
|
|
49988
49847
|
init_backend_origin();
|
|
49989
49848
|
init_app_project();
|
|
49990
|
-
require3 = (0,
|
|
49849
|
+
require3 = (0, import_node_module3.createRequire)(__sootsim_import_meta_url);
|
|
49991
49850
|
}
|
|
49992
49851
|
});
|
|
49993
49852
|
|
|
@@ -50844,7 +50703,7 @@ function desktopHostExecutable() {
|
|
|
50844
50703
|
function bundleValue(app, key2) {
|
|
50845
50704
|
const read = (0, import_node_child_process13.spawnSync)(
|
|
50846
50705
|
"plutil",
|
|
50847
|
-
["-extract", key2, "raw", "-o", "-",
|
|
50706
|
+
["-extract", key2, "raw", "-o", "-", import_node_path39.default.join(app, "Contents/Info.plist")],
|
|
50848
50707
|
{ encoding: "utf8" }
|
|
50849
50708
|
);
|
|
50850
50709
|
return read.status === 0 ? read.stdout.trim() : null;
|
|
@@ -50855,8 +50714,8 @@ function isNativeHostBundle(app) {
|
|
|
50855
50714
|
function placedHostVersion() {
|
|
50856
50715
|
if (desktopHostPlatform() === "linux-x64") {
|
|
50857
50716
|
try {
|
|
50858
|
-
const version =
|
|
50859
|
-
return /^\d+\.\d+$/.test(version) &&
|
|
50717
|
+
const version = import_node_fs37.default.readFileSync(import_node_path39.default.join(desktopHostsDir(), "active"), "utf8").trim();
|
|
50718
|
+
return /^\d+\.\d+$/.test(version) && import_node_fs37.default.existsSync(import_node_path39.default.join(desktopHostDir(version), desktopHostExecutable())) ? version : null;
|
|
50860
50719
|
} catch {
|
|
50861
50720
|
return null;
|
|
50862
50721
|
}
|
|
@@ -50872,18 +50731,18 @@ function headlessHostCommand() {
|
|
|
50872
50731
|
if (!version) return null;
|
|
50873
50732
|
const dir = desktopHostDir(version);
|
|
50874
50733
|
return [
|
|
50875
|
-
|
|
50734
|
+
import_node_path39.default.join(dir, "bin/node"),
|
|
50876
50735
|
"--experimental-vm-modules",
|
|
50877
|
-
|
|
50736
|
+
import_node_path39.default.join(dir, "node/host.mjs")
|
|
50878
50737
|
];
|
|
50879
50738
|
}
|
|
50880
|
-
var import_node_child_process13,
|
|
50739
|
+
var import_node_child_process13, import_node_fs37, import_node_path39, MAC_HOST_APP, HOST_BUNDLE_ID;
|
|
50881
50740
|
var init_desktop_host_delivery = __esm({
|
|
50882
50741
|
"src/desktop-host-delivery.ts"() {
|
|
50883
50742
|
"use strict";
|
|
50884
50743
|
import_node_child_process13 = require("node:child_process");
|
|
50885
|
-
|
|
50886
|
-
|
|
50744
|
+
import_node_fs37 = __toESM(require("node:fs"), 1);
|
|
50745
|
+
import_node_path39 = __toESM(require("node:path"), 1);
|
|
50887
50746
|
init_src();
|
|
50888
50747
|
init_home_paths();
|
|
50889
50748
|
MAC_HOST_APP = "/Applications/Peach.app";
|
|
@@ -52431,8 +52290,8 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
|
|
|
52431
52290
|
};
|
|
52432
52291
|
}
|
|
52433
52292
|
const lock = parseLinuxBrowserLibsLock(linux_browser_libs_lock_default);
|
|
52434
|
-
const dir = (0,
|
|
52435
|
-
if (!(0,
|
|
52293
|
+
const dir = (0, import_node_path40.join)(rnxHomeDir(), "linux-libs", `${lock.id}-${arch}`);
|
|
52294
|
+
if (!(0, import_node_fs38.existsSync)((0, import_node_path40.join)(dir, LINUX_BROWSER_LIBS_MARKER))) {
|
|
52436
52295
|
const url = `${DEFAULT_CLI_RELEASE_ORIGIN}/${linuxBrowserLibsKey(lock.id, arch)}`;
|
|
52437
52296
|
process.stderr.write(
|
|
52438
52297
|
`peach: this system lacks ${missing.length} shared libraries ${browser} links; downloading them\u2026
|
|
@@ -52460,7 +52319,7 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
|
|
|
52460
52319
|
};
|
|
52461
52320
|
}
|
|
52462
52321
|
}
|
|
52463
|
-
const libraryPath = [(0,
|
|
52322
|
+
const libraryPath = [(0, import_node_path40.join)(dir, "lib"), (0, import_node_path40.join)(dir, "lib", "nss")].join(":");
|
|
52464
52323
|
const stillMissing = missingLibraries(executablePath, libraryPath);
|
|
52465
52324
|
if (stillMissing.length) {
|
|
52466
52325
|
return {
|
|
@@ -52470,13 +52329,13 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
|
|
|
52470
52329
|
}
|
|
52471
52330
|
return { ok: true, libraryPath };
|
|
52472
52331
|
}
|
|
52473
|
-
var import_node_child_process14,
|
|
52332
|
+
var import_node_child_process14, import_node_fs38, import_node_path40, LINUX_BROWSER_LIBS_ARCHES, LINUX_BROWSER_LIBS_MARKER;
|
|
52474
52333
|
var init_linux_browser_libs = __esm({
|
|
52475
52334
|
"cli/drivers/linux-browser-libs.ts"() {
|
|
52476
52335
|
"use strict";
|
|
52477
52336
|
import_node_child_process14 = require("node:child_process");
|
|
52478
|
-
|
|
52479
|
-
|
|
52337
|
+
import_node_fs38 = require("node:fs");
|
|
52338
|
+
import_node_path40 = require("node:path");
|
|
52480
52339
|
init_src();
|
|
52481
52340
|
init_home_paths();
|
|
52482
52341
|
init_is_record();
|
|
@@ -52495,18 +52354,18 @@ function resolvePlaywright() {
|
|
|
52495
52354
|
roots.push(`${playwrightCoreDir(PINNED_PLAYWRIGHT_CORE.version)}/`);
|
|
52496
52355
|
for (const root of roots) {
|
|
52497
52356
|
try {
|
|
52498
|
-
const requireFromRoot = (0,
|
|
52357
|
+
const requireFromRoot = (0, import_node_module4.createRequire)(root);
|
|
52499
52358
|
for (const spec of ["playwright", "playwright-chromium", "playwright-core"]) {
|
|
52500
52359
|
try {
|
|
52501
52360
|
const modulePath = requireFromRoot.resolve(spec);
|
|
52502
52361
|
const packageJsonPath = requireFromRoot.resolve(`${spec}/package.json`);
|
|
52503
|
-
const parsed = JSON.parse((0,
|
|
52362
|
+
const parsed = JSON.parse((0, import_node_fs39.readFileSync)(packageJsonPath, "utf8"));
|
|
52504
52363
|
if (!isRecord(parsed) || typeof parsed.version !== "string") continue;
|
|
52505
|
-
const corePackagePath = (0,
|
|
52364
|
+
const corePackagePath = (0, import_node_module4.createRequire)(modulePath).resolve(
|
|
52506
52365
|
"playwright-core/package.json"
|
|
52507
52366
|
);
|
|
52508
|
-
const cliPath = (0,
|
|
52509
|
-
if (!(0,
|
|
52367
|
+
const cliPath = (0, import_node_path41.join)((0, import_node_path41.dirname)(corePackagePath), "cli.js");
|
|
52368
|
+
if (!(0, import_node_fs39.existsSync)(cliPath)) continue;
|
|
52510
52369
|
return {
|
|
52511
52370
|
spec,
|
|
52512
52371
|
modulePath,
|
|
@@ -52534,7 +52393,7 @@ async function provisionPlaywright() {
|
|
|
52534
52393
|
await installVerifiedTarball({
|
|
52535
52394
|
url: `https://registry.npmjs.org/playwright-core/-/playwright-core-${version}.tgz`,
|
|
52536
52395
|
digest: { algorithm, encoding: "base64", value: digest },
|
|
52537
|
-
destDir: (0,
|
|
52396
|
+
destDir: (0, import_node_path41.join)(playwrightCoreDir(version), "node_modules", "playwright-core"),
|
|
52538
52397
|
installedMarker: "package.json",
|
|
52539
52398
|
// npm tarballs hold the package under a leading `package/`
|
|
52540
52399
|
stripComponents: 1,
|
|
@@ -52577,7 +52436,7 @@ function probeBrowser(resolved, env) {
|
|
|
52577
52436
|
return {
|
|
52578
52437
|
ok: true,
|
|
52579
52438
|
executablePath: parsed.executablePath,
|
|
52580
|
-
exists: parsed.exists && (0,
|
|
52439
|
+
exists: parsed.exists && (0, import_node_fs39.existsSync)(parsed.executablePath)
|
|
52581
52440
|
};
|
|
52582
52441
|
} catch (error) {
|
|
52583
52442
|
return {
|
|
@@ -52650,7 +52509,7 @@ async function launchProvisionedPlaywright() {
|
|
|
52650
52509
|
const env = { ...process.env };
|
|
52651
52510
|
const browser = await ensurePlaywrightBrowser(resolved, softwareChromeAllowed(), env);
|
|
52652
52511
|
if (!browser.ok) throw new Error(browser.message);
|
|
52653
|
-
const playwright = (0,
|
|
52512
|
+
const playwright = (0, import_node_module4.createRequire)(resolved.modulePath)(
|
|
52654
52513
|
resolved.modulePath
|
|
52655
52514
|
);
|
|
52656
52515
|
const browserEnv = browser.libraryPath ? {
|
|
@@ -52662,14 +52521,14 @@ async function launchProvisionedPlaywright() {
|
|
|
52662
52521
|
{ headless: true }
|
|
52663
52522
|
);
|
|
52664
52523
|
}
|
|
52665
|
-
var import_node_child_process15,
|
|
52524
|
+
var import_node_child_process15, import_node_fs39, import_node_module4, import_node_path41;
|
|
52666
52525
|
var init_playwright_provisioning = __esm({
|
|
52667
52526
|
"cli/drivers/playwright-provisioning.ts"() {
|
|
52668
52527
|
"use strict";
|
|
52669
52528
|
import_node_child_process15 = require("node:child_process");
|
|
52670
|
-
|
|
52671
|
-
|
|
52672
|
-
|
|
52529
|
+
import_node_fs39 = require("node:fs");
|
|
52530
|
+
import_node_module4 = require("node:module");
|
|
52531
|
+
import_node_path41 = require("node:path");
|
|
52673
52532
|
init_src();
|
|
52674
52533
|
init_reap_browser();
|
|
52675
52534
|
init_home_paths();
|
|
@@ -53148,12 +53007,12 @@ var init_runtime_diagnostics = __esm({
|
|
|
53148
53007
|
// cli/commands/skills.ts
|
|
53149
53008
|
function getSkillsDir() {
|
|
53150
53009
|
if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
|
|
53151
|
-
const dir =
|
|
53010
|
+
const dir = path34.join(rnxHomeDir(), "skills", getCliVersion());
|
|
53152
53011
|
for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
|
|
53153
|
-
const target =
|
|
53154
|
-
if (
|
|
53155
|
-
|
|
53156
|
-
|
|
53012
|
+
const target = path34.join(dir, file);
|
|
53013
|
+
if (fs29.existsSync(target)) continue;
|
|
53014
|
+
fs29.mkdirSync(path34.dirname(target), { recursive: true });
|
|
53015
|
+
fs29.writeFileSync(target, body);
|
|
53157
53016
|
}
|
|
53158
53017
|
return dir;
|
|
53159
53018
|
}
|
|
@@ -53161,10 +53020,10 @@ function getSkillsDir() {
|
|
|
53161
53020
|
const pkgPath = (0, import_url3.fileURLToPath)(
|
|
53162
53021
|
import_meta3.resolve(`${rnxPublicBrand.packageName}/package.json`)
|
|
53163
53022
|
);
|
|
53164
|
-
return primaryCheckoutPath(
|
|
53023
|
+
return primaryCheckoutPath(path34.join(path34.dirname(pkgPath), "skills"));
|
|
53165
53024
|
} catch {
|
|
53166
|
-
const __dirname =
|
|
53167
|
-
return primaryCheckoutPath(
|
|
53025
|
+
const __dirname = path34.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
|
|
53026
|
+
return primaryCheckoutPath(path34.resolve(__dirname, "../../skills"));
|
|
53168
53027
|
}
|
|
53169
53028
|
}
|
|
53170
53029
|
function primaryCheckoutPath(dir) {
|
|
@@ -53187,39 +53046,39 @@ function primaryCheckoutPath(dir) {
|
|
|
53187
53046
|
} catch {
|
|
53188
53047
|
return dir;
|
|
53189
53048
|
}
|
|
53190
|
-
if (
|
|
53191
|
-
const primary =
|
|
53192
|
-
return
|
|
53049
|
+
if (path34.basename(common) !== ".git") return dir;
|
|
53050
|
+
const primary = path34.join(path34.dirname(common), path34.relative(top, dir));
|
|
53051
|
+
return fs29.existsSync(primary) ? primary : dir;
|
|
53193
53052
|
}
|
|
53194
53053
|
function skillsDir() {
|
|
53195
53054
|
skillsDirPath ??= getSkillsDir();
|
|
53196
53055
|
return skillsDirPath;
|
|
53197
53056
|
}
|
|
53198
53057
|
function targetFromHome(envName, fallbackDir) {
|
|
53199
|
-
const home = process.env[envName] ||
|
|
53200
|
-
return
|
|
53058
|
+
const home = process.env[envName] || path34.join(os9.homedir(), fallbackDir);
|
|
53059
|
+
return path34.join(home, "skills");
|
|
53201
53060
|
}
|
|
53202
53061
|
function codexTargets() {
|
|
53203
53062
|
const homes = /* @__PURE__ */ new Map();
|
|
53204
53063
|
const userHome = process.env.HOME || os9.homedir();
|
|
53205
|
-
const primaryCodexHome = process.env.CODEX_HOME ||
|
|
53206
|
-
homes.set(
|
|
53064
|
+
const primaryCodexHome = process.env.CODEX_HOME || path34.join(userHome, ".codex");
|
|
53065
|
+
homes.set(path34.resolve(primaryCodexHome), "codex");
|
|
53207
53066
|
const tmCodexHomes = process.env.TM_CODEX_HOMES;
|
|
53208
53067
|
if (tmCodexHomes) {
|
|
53209
|
-
for (const h of tmCodexHomes.split(
|
|
53068
|
+
for (const h of tmCodexHomes.split(path34.delimiter)) {
|
|
53210
53069
|
if (h.trim()) {
|
|
53211
|
-
const resolved =
|
|
53070
|
+
const resolved = path34.resolve(h.trim());
|
|
53212
53071
|
if (!homes.has(resolved)) {
|
|
53213
|
-
homes.set(resolved,
|
|
53072
|
+
homes.set(resolved, path34.basename(resolved).replace(/^\./, ""));
|
|
53214
53073
|
}
|
|
53215
53074
|
}
|
|
53216
53075
|
}
|
|
53217
53076
|
}
|
|
53218
|
-
const tmHome = process.env.TM_HOME ||
|
|
53219
|
-
const enginePath =
|
|
53220
|
-
if (
|
|
53077
|
+
const tmHome = process.env.TM_HOME || path34.join(userHome, ".team-machine");
|
|
53078
|
+
const enginePath = path34.join(tmHome, "engine.yaml");
|
|
53079
|
+
if (fs29.existsSync(enginePath)) {
|
|
53221
53080
|
try {
|
|
53222
|
-
const content =
|
|
53081
|
+
const content = fs29.readFileSync(enginePath, "utf8");
|
|
53223
53082
|
let inCodex = false;
|
|
53224
53083
|
let inAccounts = false;
|
|
53225
53084
|
let currentAccount = "";
|
|
@@ -53249,9 +53108,9 @@ function codexTargets() {
|
|
|
53249
53108
|
if (match) {
|
|
53250
53109
|
let homeDir = match[1].trim();
|
|
53251
53110
|
if (homeDir.startsWith("~")) {
|
|
53252
|
-
homeDir =
|
|
53111
|
+
homeDir = path34.join(userHome, homeDir.slice(1));
|
|
53253
53112
|
}
|
|
53254
|
-
const resolved =
|
|
53113
|
+
const resolved = path34.resolve(homeDir);
|
|
53255
53114
|
if (!homes.has(resolved)) {
|
|
53256
53115
|
homes.set(resolved, `codex-${currentAccount}`);
|
|
53257
53116
|
}
|
|
@@ -53262,13 +53121,13 @@ function codexTargets() {
|
|
|
53262
53121
|
}
|
|
53263
53122
|
}
|
|
53264
53123
|
try {
|
|
53265
|
-
for (const entry of
|
|
53124
|
+
for (const entry of fs29.readdirSync(userHome)) {
|
|
53266
53125
|
if (entry.startsWith(".codex-")) {
|
|
53267
|
-
const fullPath =
|
|
53126
|
+
const fullPath = path34.join(userHome, entry);
|
|
53268
53127
|
try {
|
|
53269
|
-
const stat2 =
|
|
53128
|
+
const stat2 = fs29.statSync(fullPath);
|
|
53270
53129
|
if (stat2.isDirectory()) {
|
|
53271
|
-
const resolved =
|
|
53130
|
+
const resolved = path34.resolve(fullPath);
|
|
53272
53131
|
if (!homes.has(resolved)) {
|
|
53273
53132
|
homes.set(resolved, entry.replace(/^\./, ""));
|
|
53274
53133
|
}
|
|
@@ -53283,7 +53142,7 @@ function codexTargets() {
|
|
|
53283
53142
|
for (const [homePath, label] of homes) {
|
|
53284
53143
|
targets.push({
|
|
53285
53144
|
label,
|
|
53286
|
-
dir:
|
|
53145
|
+
dir: path34.join(homePath, "skills")
|
|
53287
53146
|
});
|
|
53288
53147
|
}
|
|
53289
53148
|
return targets;
|
|
@@ -53299,7 +53158,7 @@ function hasInstalledPeachSkills() {
|
|
|
53299
53158
|
(file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
|
|
53300
53159
|
) : listSkills().map((skill7) => skill7.name);
|
|
53301
53160
|
return defaultAgentTargets().some(
|
|
53302
|
-
({ dir }) => names.some((name2) =>
|
|
53161
|
+
({ dir }) => names.some((name2) => fs29.existsSync(path34.join(dir, name2, "SKILL.md")))
|
|
53303
53162
|
);
|
|
53304
53163
|
}
|
|
53305
53164
|
function parseSkillFrontmatter(content) {
|
|
@@ -53342,26 +53201,26 @@ function readFrontmatterField(frontmatter, field) {
|
|
|
53342
53201
|
return null;
|
|
53343
53202
|
}
|
|
53344
53203
|
function listSkills() {
|
|
53345
|
-
if (!
|
|
53204
|
+
if (!fs29.existsSync(skillsDir())) return [];
|
|
53346
53205
|
const skills = [];
|
|
53347
|
-
for (const entry of
|
|
53348
|
-
const skillMd =
|
|
53349
|
-
if (!
|
|
53350
|
-
const meta = parseSkillFrontmatter(
|
|
53206
|
+
for (const entry of fs29.readdirSync(skillsDir())) {
|
|
53207
|
+
const skillMd = path34.join(skillsDir(), entry, "SKILL.md");
|
|
53208
|
+
if (!fs29.existsSync(skillMd)) continue;
|
|
53209
|
+
const meta = parseSkillFrontmatter(fs29.readFileSync(skillMd, "utf8"));
|
|
53351
53210
|
if (meta) {
|
|
53352
53211
|
skills.push({ name: entry, description: meta.description });
|
|
53353
53212
|
}
|
|
53354
53213
|
}
|
|
53355
53214
|
return skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
53356
53215
|
}
|
|
53357
|
-
var import_child_process7,
|
|
53216
|
+
var import_child_process7, fs29, os9, path34, import_url3, import_meta3, skillsDirPath;
|
|
53358
53217
|
var init_skills = __esm({
|
|
53359
53218
|
"cli/commands/skills.ts"() {
|
|
53360
53219
|
"use strict";
|
|
53361
53220
|
import_child_process7 = require("child_process");
|
|
53362
|
-
|
|
53221
|
+
fs29 = __toESM(require("fs"), 1);
|
|
53363
53222
|
os9 = __toESM(require("os"), 1);
|
|
53364
|
-
|
|
53223
|
+
path34 = __toESM(require("path"), 1);
|
|
53365
53224
|
import_url3 = require("url");
|
|
53366
53225
|
init_cli_version();
|
|
53367
53226
|
init_home_paths();
|
|
@@ -53822,11 +53681,11 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
53822
53681
|
);
|
|
53823
53682
|
}
|
|
53824
53683
|
const { executable, prefixArgs } = rnxSelfInvocation();
|
|
53825
|
-
const bridgeLogPath =
|
|
53684
|
+
const bridgeLogPath = import_node_path42.default.join(
|
|
53826
53685
|
import_node_os11.default.tmpdir(),
|
|
53827
53686
|
`peach-bridge-${Date.now()}-${process.pid}.log`
|
|
53828
53687
|
);
|
|
53829
|
-
const bridgeLogFd =
|
|
53688
|
+
const bridgeLogFd = import_node_fs40.default.openSync(bridgeLogPath, "a");
|
|
53830
53689
|
let child;
|
|
53831
53690
|
try {
|
|
53832
53691
|
child = (0, import_node_child_process16.spawn)(
|
|
@@ -53840,7 +53699,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
53840
53699
|
}
|
|
53841
53700
|
);
|
|
53842
53701
|
} finally {
|
|
53843
|
-
|
|
53702
|
+
import_node_fs40.default.closeSync(bridgeLogFd);
|
|
53844
53703
|
}
|
|
53845
53704
|
if (resources) {
|
|
53846
53705
|
resources.bridge = child;
|
|
@@ -53876,7 +53735,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
53876
53735
|
await sleep(150);
|
|
53877
53736
|
}
|
|
53878
53737
|
const reason = childExit ? `peach bridge exited before becoming ready (exit ${childExit})` : `peach bridge did not start within ${Math.round(OPEN_BRIDGE_SPAWN_TIMEOUT_MS / 1e3)}s`;
|
|
53879
|
-
const bridgeLog =
|
|
53738
|
+
const bridgeLog = import_node_fs40.default.readFileSync(bridgeLogPath, "utf8").trim().slice(-2e3);
|
|
53880
53739
|
throw new Error(
|
|
53881
53740
|
`${reason}${bridgeLog ? `
|
|
53882
53741
|
${bridgeLog}` : ""}
|
|
@@ -53899,7 +53758,7 @@ function assertExplicitBridgeLock(preferredPort, explicitPort, lock) {
|
|
|
53899
53758
|
async function ensureRuntimeForOpen() {
|
|
53900
53759
|
if (resolveDevCheckoutRuntimeRoot()) return;
|
|
53901
53760
|
const active = readActiveRuntime();
|
|
53902
|
-
if (active &&
|
|
53761
|
+
if (active && import_node_fs40.default.existsSync(runtimeDir(active))) return;
|
|
53903
53762
|
console.error(" installing peach engine runtime...");
|
|
53904
53763
|
const { runRuntime: runRuntime2 } = await Promise.resolve().then(() => (init_runtime(), runtime_exports));
|
|
53905
53764
|
await runRuntime2(["install"], {});
|
|
@@ -54047,10 +53906,10 @@ async function buildResolvedBundleOpenUrl(target, baseUrl, opts = {}) {
|
|
|
54047
53906
|
}
|
|
54048
53907
|
function normalizeReplacementPath(filePath) {
|
|
54049
53908
|
if (filePath.startsWith("~/")) {
|
|
54050
|
-
return
|
|
53909
|
+
return import_node_path42.default.join(import_node_os11.default.homedir(), filePath.slice(2));
|
|
54051
53910
|
}
|
|
54052
|
-
if (
|
|
54053
|
-
return
|
|
53911
|
+
if (import_node_path42.default.isAbsolute(filePath)) return filePath;
|
|
53912
|
+
return import_node_path42.default.resolve(process.cwd(), filePath);
|
|
54054
53913
|
}
|
|
54055
53914
|
function parseOpenRuntimeConfig(args) {
|
|
54056
53915
|
const modules = {};
|
|
@@ -54069,7 +53928,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
54069
53928
|
}
|
|
54070
53929
|
const moduleName = raw2.slice(0, eqIndex).trim();
|
|
54071
53930
|
const filePath = normalizeReplacementPath(raw2.slice(eqIndex + 1).trim());
|
|
54072
|
-
if (!
|
|
53931
|
+
if (!import_node_fs40.default.existsSync(filePath)) {
|
|
54073
53932
|
console.error(` peach open: replacement file not found: ${filePath}`);
|
|
54074
53933
|
rnxExit(1);
|
|
54075
53934
|
}
|
|
@@ -54105,7 +53964,7 @@ async function resolveAppProjectForBundleUrl(bundleUrl, projectRoot) {
|
|
|
54105
53964
|
return advertisedRoot ? resolveAppProject(advertisedRoot) : null;
|
|
54106
53965
|
}
|
|
54107
53966
|
async function ensureConfiguredRuntime(version) {
|
|
54108
|
-
if (
|
|
53967
|
+
if (import_node_fs40.default.existsSync(import_node_path42.default.join(runtimeDir(version), "index.html"))) return;
|
|
54109
53968
|
console.error(` installing configured engine runtime ${version}...`);
|
|
54110
53969
|
const result = await rnxRuntime.install({
|
|
54111
53970
|
version,
|
|
@@ -54223,22 +54082,6 @@ async function stampAppSplash(urlStr, project) {
|
|
|
54223
54082
|
return urlStr;
|
|
54224
54083
|
}
|
|
54225
54084
|
}
|
|
54226
|
-
function stampNativeFirebaseConfig(urlStr, project) {
|
|
54227
|
-
const url = new URL(urlStr);
|
|
54228
|
-
if (!url.searchParams.get("bundle") || !project) return urlStr;
|
|
54229
|
-
try {
|
|
54230
|
-
url.searchParams.set(
|
|
54231
|
-
"nativeFirebase",
|
|
54232
|
-
JSON.stringify(readNativeFirebaseConfig(project.appDir))
|
|
54233
|
-
);
|
|
54234
|
-
} catch (error) {
|
|
54235
|
-
url.searchParams.set(
|
|
54236
|
-
"nativeFirebase",
|
|
54237
|
-
JSON.stringify({ error: error instanceof Error ? error.message : String(error) })
|
|
54238
|
-
);
|
|
54239
|
-
}
|
|
54240
|
-
return url.toString();
|
|
54241
|
-
}
|
|
54242
54085
|
function stampAppCatalog(urlStr, project) {
|
|
54243
54086
|
try {
|
|
54244
54087
|
const url = new URL(urlStr);
|
|
@@ -54274,14 +54117,12 @@ async function buildShellUrl(target, baseUrl = resolveDefaultShellBaseUrl(), opt
|
|
|
54274
54117
|
const resolved = await resolveShellUrl(target, baseUrl, opts);
|
|
54275
54118
|
const project = opts.project ?? await resolveAppProjectForBundleUrl(bundleUrlOf(resolved));
|
|
54276
54119
|
const expoRoot = project?.appDir ?? null;
|
|
54277
|
-
const stamped =
|
|
54278
|
-
|
|
54279
|
-
await stampAppSplash(await stampAppFonts(resolved, project), project),
|
|
54280
|
-
project
|
|
54281
|
-
),
|
|
54120
|
+
const stamped = stampAppCatalog(
|
|
54121
|
+
await stampAppSplash(await stampAppFonts(resolved, project), project),
|
|
54282
54122
|
project
|
|
54283
54123
|
);
|
|
54284
54124
|
const expoStamped = new URL(stamped);
|
|
54125
|
+
expoStamped.searchParams.delete("nativeFirebase");
|
|
54285
54126
|
if (opts.bundleOriginOverride)
|
|
54286
54127
|
expoStamped.searchParams.set("bundleOriginOverride", opts.bundleOriginOverride);
|
|
54287
54128
|
if (opts.hostDriver) expoStamped.searchParams.set("peachHostDriver", opts.hostDriver);
|
|
@@ -54447,7 +54288,7 @@ function playwrightHostPidForSim(sim) {
|
|
|
54447
54288
|
function signalDriverLaunchConnected(result) {
|
|
54448
54289
|
if (!result.connectAckFile) return false;
|
|
54449
54290
|
try {
|
|
54450
|
-
|
|
54291
|
+
import_node_fs40.default.writeFileSync(
|
|
54451
54292
|
result.connectAckFile,
|
|
54452
54293
|
`${JSON.stringify({ connectedAt: Date.now(), pid: result.pid ?? null })}
|
|
54453
54294
|
`,
|
|
@@ -54461,7 +54302,7 @@ function signalDriverLaunchConnected(result) {
|
|
|
54461
54302
|
function readUnservedUrl(result) {
|
|
54462
54303
|
if (!result.diagnosticLogPath) return null;
|
|
54463
54304
|
try {
|
|
54464
|
-
const detail =
|
|
54305
|
+
const detail = import_node_fs40.default.readFileSync(result.diagnosticLogPath, "utf8");
|
|
54465
54306
|
const match = detail.match(/\[unserved\] nothing serves (\S+)/);
|
|
54466
54307
|
return match ? match[1] : null;
|
|
54467
54308
|
} catch {
|
|
@@ -54471,19 +54312,19 @@ function readUnservedUrl(result) {
|
|
|
54471
54312
|
function printDriverDiagnosticLogTail(result) {
|
|
54472
54313
|
if (!result.diagnosticLogPath) return;
|
|
54473
54314
|
try {
|
|
54474
|
-
const detail =
|
|
54315
|
+
const detail = import_node_fs40.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
|
|
54475
54316
|
if (!detail) {
|
|
54476
|
-
console.error(` ${
|
|
54317
|
+
console.error(` ${import_node_path42.default.basename(result.diagnosticLogPath)} was empty`);
|
|
54477
54318
|
return;
|
|
54478
54319
|
}
|
|
54479
54320
|
const shown = detail.length > 4e3 ? `\u2026
|
|
54480
54321
|
${detail.slice(-4e3)}` : detail;
|
|
54481
|
-
console.error(` ${
|
|
54322
|
+
console.error(` ${import_node_path42.default.basename(result.diagnosticLogPath)}:`);
|
|
54482
54323
|
console.error(shown);
|
|
54483
54324
|
} catch (err) {
|
|
54484
54325
|
const message = err instanceof Error ? err.message : String(err);
|
|
54485
54326
|
console.error(
|
|
54486
|
-
` failed to read ${
|
|
54327
|
+
` failed to read ${import_node_path42.default.basename(result.diagnosticLogPath)}: ${message}`
|
|
54487
54328
|
);
|
|
54488
54329
|
}
|
|
54489
54330
|
}
|
|
@@ -55521,14 +55362,14 @@ async function runCloseCommand(args, opts = {}) {
|
|
|
55521
55362
|
bridge.close();
|
|
55522
55363
|
}
|
|
55523
55364
|
}
|
|
55524
|
-
var import_node_child_process16,
|
|
55365
|
+
var import_node_child_process16, import_node_fs40, import_node_os11, import_node_path42, import_app_catalog_wire, import_devices2, import_ws4, DEFAULT_DRIVER_CONNECT_TIMEOUT_MS, DRIVER_CONNECT_INTERVAL_MS, DRIVER_CONNECT_HOST_GRACE_MS, OPEN_BRIDGE_SPAWN_TIMEOUT_MS, OPEN_BRIDGE_RUNTIME_TIMEOUT_MS, SHELL_APPS, DEV_BUNDLE_RESOLVE_ATTEMPTS, DEV_BUNDLE_RESOLVE_INTERVAL_MS;
|
|
55525
55366
|
var init_control = __esm({
|
|
55526
55367
|
"cli/commands/control.ts"() {
|
|
55527
55368
|
"use strict";
|
|
55528
55369
|
import_node_child_process16 = require("node:child_process");
|
|
55529
|
-
|
|
55370
|
+
import_node_fs40 = __toESM(require("node:fs"), 1);
|
|
55530
55371
|
import_node_os11 = __toESM(require("node:os"), 1);
|
|
55531
|
-
|
|
55372
|
+
import_node_path42 = __toESM(require("node:path"), 1);
|
|
55532
55373
|
import_app_catalog_wire = require("peach-engine/engine/app-catalog-wire");
|
|
55533
55374
|
import_devices2 = require("peach-engine/settings/devices");
|
|
55534
55375
|
import_ws4 = require("ws");
|
|
@@ -55542,7 +55383,6 @@ var init_control = __esm({
|
|
|
55542
55383
|
init_flow_timeout_scale();
|
|
55543
55384
|
init_home_paths();
|
|
55544
55385
|
init_native_dev_bundle_url();
|
|
55545
|
-
init_native_firebase_config();
|
|
55546
55386
|
init_profiles();
|
|
55547
55387
|
init_public_brand();
|
|
55548
55388
|
init_runtime_assets();
|
|
@@ -56989,16 +56829,16 @@ function readRecentShellAppId(state) {
|
|
|
56989
56829
|
}
|
|
56990
56830
|
function resolveProjectRelativeFlowBase(flowDir) {
|
|
56991
56831
|
if (!flowDir) return process.cwd();
|
|
56992
|
-
return
|
|
56832
|
+
return path36.basename(flowDir) === ".maestro" ? path36.dirname(flowDir) : flowDir;
|
|
56993
56833
|
}
|
|
56994
56834
|
function resolveFlowScreenshotPathWithMode(screenshotDir, name2, opts) {
|
|
56995
56835
|
const normalizedName = name2.endsWith(".png") ? name2 : `${name2}.png`;
|
|
56996
|
-
if (
|
|
56836
|
+
if (path36.isAbsolute(normalizedName)) return normalizedName;
|
|
56997
56837
|
if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
|
|
56998
56838
|
const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
|
|
56999
|
-
return
|
|
56839
|
+
return path36.resolve(baseDir, normalizedName);
|
|
57000
56840
|
}
|
|
57001
|
-
return
|
|
56841
|
+
return path36.join(screenshotDir, normalizedName);
|
|
57002
56842
|
}
|
|
57003
56843
|
function normalizeFlowScreenshotSpec(step) {
|
|
57004
56844
|
if (typeof step === "string") {
|
|
@@ -57052,12 +56892,12 @@ function normalizeBareStringStep(verb) {
|
|
|
57052
56892
|
function parseFlowSteps(content) {
|
|
57053
56893
|
return parseFlowFile(content).steps;
|
|
57054
56894
|
}
|
|
57055
|
-
var
|
|
56895
|
+
var fs32, path36, import_devices4, import_proof_frame, DEFAULT_TIMEOUT, ASSERTION_LOOKUP_MS, FLOW_TIMEOUT_SCALE, scaledTimeout, MAESTRO_SELECTOR_KEYS, UNSUPPORTED_SELECTOR_KEYS, ACCESSIBILITY_SELECTOR_KEYS, ACCESSIBILITY_TRAIT_FILTERS, MAESTRO_PERMISSION_KINDS, MAESTRO_PERMISSION_STATUS, SootSimBridgeFlowRunner;
|
|
57056
56896
|
var init_bridge_flow_runner = __esm({
|
|
57057
56897
|
"cli/bridge-flow-runner.ts"() {
|
|
57058
56898
|
"use strict";
|
|
57059
|
-
|
|
57060
|
-
|
|
56899
|
+
fs32 = __toESM(require("fs"), 1);
|
|
56900
|
+
path36 = __toESM(require("path"), 1);
|
|
57061
56901
|
import_devices4 = require("peach-engine/settings/devices");
|
|
57062
56902
|
import_proof_frame = __toESM(require_proof_frame(), 1);
|
|
57063
56903
|
init_flow_timeout_scale();
|
|
@@ -57369,14 +57209,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
57369
57209
|
if (chunks.length === 0) {
|
|
57370
57210
|
throw new Error("recording requested but no video buffer was produced");
|
|
57371
57211
|
}
|
|
57372
|
-
|
|
57212
|
+
fs32.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
|
|
57373
57213
|
const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
|
|
57374
57214
|
const extension = videoMime.includes("mp4") ? "mp4" : "webm";
|
|
57375
|
-
const outputPath =
|
|
57215
|
+
const outputPath = path36.join(
|
|
57376
57216
|
this.opts.recordingOutputDir,
|
|
57377
57217
|
`peach-${Date.now()}.${extension}`
|
|
57378
57218
|
);
|
|
57379
|
-
|
|
57219
|
+
fs32.writeFileSync(outputPath, Buffer.concat(chunks));
|
|
57380
57220
|
return outputPath;
|
|
57381
57221
|
}
|
|
57382
57222
|
async waitForRecordingTail(opts) {
|
|
@@ -57997,7 +57837,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
57997
57837
|
flowDir: this.opts.flowDir
|
|
57998
57838
|
}
|
|
57999
57839
|
);
|
|
58000
|
-
|
|
57840
|
+
fs32.mkdirSync(path36.dirname(outputPath), { recursive: true });
|
|
58001
57841
|
const layers = spec.layers ?? this.opts.screenshotLayers;
|
|
58002
57842
|
const screenshotRequest = {
|
|
58003
57843
|
type: "screenshot",
|
|
@@ -58032,11 +57872,11 @@ var init_bridge_flow_runner = __esm({
|
|
|
58032
57872
|
throw new Error("could not read current device model for framed screenshot");
|
|
58033
57873
|
}
|
|
58034
57874
|
const framed = await composeFramedScreenshot(rawBuffer, model);
|
|
58035
|
-
|
|
57875
|
+
fs32.writeFileSync(outputPath, framed);
|
|
58036
57876
|
console.log(`[flow] screenshot: ${outputPath} (frame: ${model})`);
|
|
58037
57877
|
return outputPath;
|
|
58038
57878
|
}
|
|
58039
|
-
|
|
57879
|
+
fs32.writeFileSync(outputPath, rawBuffer);
|
|
58040
57880
|
console.log(`[flow] screenshot: ${outputPath}`);
|
|
58041
57881
|
return outputPath;
|
|
58042
57882
|
}
|
|
@@ -58058,10 +57898,10 @@ var init_bridge_flow_runner = __esm({
|
|
|
58058
57898
|
// + a11y tree + console errors/warnings + failed network requests +
|
|
58059
57899
|
// shell state, all under one directory so post-mortem is one grep away.
|
|
58060
57900
|
async captureFailureBundle(outputDir, context) {
|
|
58061
|
-
|
|
57901
|
+
fs32.mkdirSync(outputDir, { recursive: true });
|
|
58062
57902
|
const write = (name2, content) => {
|
|
58063
57903
|
try {
|
|
58064
|
-
|
|
57904
|
+
fs32.writeFileSync(path36.join(outputDir, name2), content);
|
|
58065
57905
|
} catch {
|
|
58066
57906
|
}
|
|
58067
57907
|
};
|
|
@@ -58656,8 +58496,8 @@ var init_bridge_flow_runner = __esm({
|
|
|
58656
58496
|
runScript(target) {
|
|
58657
58497
|
const spec = typeof target === "string" ? { file: target } : target;
|
|
58658
58498
|
if (!spec.file) throw new Error("runScript requires a file");
|
|
58659
|
-
const scriptPath =
|
|
58660
|
-
const source =
|
|
58499
|
+
const scriptPath = path36.resolve(this.opts.flowDir, spec.file);
|
|
58500
|
+
const source = fs32.readFileSync(scriptPath, "utf8");
|
|
58661
58501
|
this.js.evaluate(source, { env: spec.env });
|
|
58662
58502
|
console.log(`[flow] runScript: ${spec.file} done`);
|
|
58663
58503
|
}
|
|
@@ -59017,14 +58857,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
59017
58857
|
for (const [k, v] of Object.entries(env)) this.js.putEnv(k, v);
|
|
59018
58858
|
}
|
|
59019
58859
|
if (file) {
|
|
59020
|
-
const flowPath =
|
|
59021
|
-
const flowContent =
|
|
58860
|
+
const flowPath = path36.resolve(this.opts.flowDir, file);
|
|
58861
|
+
const flowContent = fs32.readFileSync(flowPath, "utf8");
|
|
59022
58862
|
const { frontmatter } = parseFlowFile(flowContent);
|
|
59023
58863
|
if (frontmatter.env && typeof frontmatter.env === "object") {
|
|
59024
58864
|
this.js.defineVariables(frontmatter.env);
|
|
59025
58865
|
}
|
|
59026
58866
|
const previousDir = this.opts.flowDir;
|
|
59027
|
-
this.opts.flowDir =
|
|
58867
|
+
this.opts.flowDir = path36.dirname(flowPath);
|
|
59028
58868
|
try {
|
|
59029
58869
|
await this.runFlow(parseFlowSteps(flowContent));
|
|
59030
58870
|
} finally {
|
|
@@ -59195,8 +59035,8 @@ __export(registry_exports, {
|
|
|
59195
59035
|
skillRegistry: () => skillRegistry
|
|
59196
59036
|
});
|
|
59197
59037
|
module.exports = __toCommonJS(registry_exports);
|
|
59198
|
-
var
|
|
59199
|
-
var
|
|
59038
|
+
var fs33 = __toESM(require("fs"), 1);
|
|
59039
|
+
var path37 = __toESM(require("path"), 1);
|
|
59200
59040
|
|
|
59201
59041
|
// src/skills/builtin/a11y-review.ts
|
|
59202
59042
|
init_reap_browser();
|
|
@@ -59215,8 +59055,8 @@ var skill = {
|
|
|
59215
59055
|
},
|
|
59216
59056
|
async execute(params, context) {
|
|
59217
59057
|
const { chromium } = await import("playwright");
|
|
59218
|
-
const
|
|
59219
|
-
const
|
|
59058
|
+
const path38 = await import("path");
|
|
59059
|
+
const fs34 = await import("fs");
|
|
59220
59060
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59221
59061
|
headless: true
|
|
59222
59062
|
});
|
|
@@ -59273,9 +59113,9 @@ var skill = {
|
|
|
59273
59113
|
warnings: issues.filter((i) => i.severity === "warning").length,
|
|
59274
59114
|
tree: typeof tree === "string" ? tree : JSON.stringify(tree)
|
|
59275
59115
|
};
|
|
59276
|
-
const reportPath =
|
|
59277
|
-
|
|
59278
|
-
|
|
59116
|
+
const reportPath = path38.join(context.outputDir, "a11y-report.json");
|
|
59117
|
+
fs34.mkdirSync(path38.dirname(reportPath), { recursive: true });
|
|
59118
|
+
fs34.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
59279
59119
|
return {
|
|
59280
59120
|
success: issues.filter((i) => i.severity === "error").length === 0,
|
|
59281
59121
|
message: `${report.errors} errors, ${report.warnings} warnings across ${report.nodeCount} nodes`,
|
|
@@ -59308,14 +59148,14 @@ var skill2 = {
|
|
|
59308
59148
|
}
|
|
59309
59149
|
},
|
|
59310
59150
|
async execute(params, context) {
|
|
59311
|
-
const
|
|
59312
|
-
const
|
|
59151
|
+
const fs34 = await import("node:fs");
|
|
59152
|
+
const path38 = await import("node:path");
|
|
59313
59153
|
const { COMPAT_RESULT_CAVEAT: COMPAT_RESULT_CAVEAT2, formatPackageStatus: formatPackageStatus2, formatScanCounts: formatScanCounts2, scanDeps: scanDeps2 } = await Promise.resolve().then(() => (init_web(), web_exports));
|
|
59314
|
-
const packagePath =
|
|
59315
|
-
if (!
|
|
59154
|
+
const packagePath = path38.join(context.projectDir, "package.json");
|
|
59155
|
+
if (!fs34.existsSync(packagePath)) {
|
|
59316
59156
|
return { success: false, message: "No package.json found" };
|
|
59317
59157
|
}
|
|
59318
|
-
const parsed = JSON.parse(
|
|
59158
|
+
const parsed = JSON.parse(fs34.readFileSync(packagePath, "utf8"));
|
|
59319
59159
|
if (!parsed || typeof parsed !== "object") {
|
|
59320
59160
|
return { success: false, message: "package.json is not an object" };
|
|
59321
59161
|
}
|
|
@@ -59327,9 +59167,9 @@ var skill2 = {
|
|
|
59327
59167
|
}) : scanDeps2(parsed);
|
|
59328
59168
|
const packageResult = params.packageName ? scan.packages[0] : void 0;
|
|
59329
59169
|
const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan)}. ${COMPAT_RESULT_CAVEAT2}`;
|
|
59330
|
-
const reportPath =
|
|
59331
|
-
|
|
59332
|
-
|
|
59170
|
+
const reportPath = path38.join(context.outputDir, "compat-report.json");
|
|
59171
|
+
fs34.mkdirSync(path38.dirname(reportPath), { recursive: true });
|
|
59172
|
+
fs34.writeFileSync(reportPath, `${JSON.stringify(scan, null, 2)}
|
|
59333
59173
|
`);
|
|
59334
59174
|
return {
|
|
59335
59175
|
success: true,
|
|
@@ -59371,8 +59211,8 @@ var skill3 = {
|
|
|
59371
59211
|
record: { type: "boolean", description: "Record video of the flow" }
|
|
59372
59212
|
},
|
|
59373
59213
|
async execute(params, context) {
|
|
59374
|
-
const
|
|
59375
|
-
const
|
|
59214
|
+
const fs34 = await import("fs");
|
|
59215
|
+
const path38 = await import("path");
|
|
59376
59216
|
const yaml = await Promise.resolve().then(() => (init_browser(), browser_exports));
|
|
59377
59217
|
const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT3 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
|
|
59378
59218
|
const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
|
|
@@ -59382,7 +59222,7 @@ var skill3 = {
|
|
|
59382
59222
|
const host2 = new SootSimBridgeHost2({ port: DEFAULT_SOOTSIM_BRIDGE_PORT3 });
|
|
59383
59223
|
host2.start({ silent: true });
|
|
59384
59224
|
try {
|
|
59385
|
-
const flowContent =
|
|
59225
|
+
const flowContent = fs34.readFileSync(params.flowPath, "utf8");
|
|
59386
59226
|
const fmMatch = flowContent.match(/^---\n([\s\S]*?)\n---\n?/);
|
|
59387
59227
|
const stepsBody = fmMatch ? flowContent.slice(fmMatch[0].length) : flowContent;
|
|
59388
59228
|
const steps = yaml.parse(stepsBody);
|
|
@@ -59409,7 +59249,7 @@ var skill3 = {
|
|
|
59409
59249
|
});
|
|
59410
59250
|
const driver = new SootSimBridgeFlowRunner2(bridge, {
|
|
59411
59251
|
screenshotDir: context.outputDir,
|
|
59412
|
-
flowDir:
|
|
59252
|
+
flowDir: path38.dirname(path38.resolve(params.flowPath)),
|
|
59413
59253
|
simId,
|
|
59414
59254
|
recordingOutputDir: params.record ? context.outputDir : void 0
|
|
59415
59255
|
});
|
|
@@ -59431,7 +59271,7 @@ var skill3 = {
|
|
|
59431
59271
|
simId,
|
|
59432
59272
|
videoPath: videoPath || void 0
|
|
59433
59273
|
},
|
|
59434
|
-
artifacts: videoPath ? [{ type: "video", name:
|
|
59274
|
+
artifacts: videoPath ? [{ type: "video", name: path38.basename(videoPath), path: videoPath }] : void 0
|
|
59435
59275
|
};
|
|
59436
59276
|
} finally {
|
|
59437
59277
|
try {
|
|
@@ -59478,8 +59318,8 @@ var skill4 = {
|
|
|
59478
59318
|
},
|
|
59479
59319
|
async execute(params, context) {
|
|
59480
59320
|
const { chromium } = await import("playwright");
|
|
59481
|
-
const
|
|
59482
|
-
const
|
|
59321
|
+
const path38 = await import("path");
|
|
59322
|
+
const fs34 = await import("fs");
|
|
59483
59323
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59484
59324
|
headless: true
|
|
59485
59325
|
});
|
|
@@ -59507,9 +59347,9 @@ var skill4 = {
|
|
|
59507
59347
|
...profile,
|
|
59508
59348
|
fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
|
|
59509
59349
|
};
|
|
59510
|
-
const reportPath =
|
|
59511
|
-
|
|
59512
|
-
|
|
59350
|
+
const reportPath = path38.join(context.outputDir, "perf-report.json");
|
|
59351
|
+
fs34.mkdirSync(path38.dirname(reportPath), { recursive: true });
|
|
59352
|
+
fs34.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
59513
59353
|
return {
|
|
59514
59354
|
success: true,
|
|
59515
59355
|
message: `${report.fps} fps, ${profile.avgSyncMs?.toFixed(1)}ms avg sync, ${nodeCount} nodes`,
|
|
@@ -59542,8 +59382,8 @@ var skill5 = {
|
|
|
59542
59382
|
},
|
|
59543
59383
|
async execute(params, context) {
|
|
59544
59384
|
const { chromium } = await import("playwright");
|
|
59545
|
-
const
|
|
59546
|
-
const
|
|
59385
|
+
const path38 = await import("path");
|
|
59386
|
+
const fs34 = await import("fs");
|
|
59547
59387
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59548
59388
|
headless: true
|
|
59549
59389
|
});
|
|
@@ -59551,8 +59391,8 @@ var skill5 = {
|
|
|
59551
59391
|
try {
|
|
59552
59392
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
59553
59393
|
await page.waitForTimeout(2e3);
|
|
59554
|
-
const outputPath =
|
|
59555
|
-
|
|
59394
|
+
const outputPath = path38.join(context.outputDir, `${params.name}.png`);
|
|
59395
|
+
fs34.mkdirSync(path38.dirname(outputPath), { recursive: true });
|
|
59556
59396
|
await page.screenshot({ path: outputPath });
|
|
59557
59397
|
return {
|
|
59558
59398
|
success: true,
|
|
@@ -59593,8 +59433,8 @@ var skill6 = {
|
|
|
59593
59433
|
},
|
|
59594
59434
|
async execute(params, context) {
|
|
59595
59435
|
const { chromium } = await import("playwright");
|
|
59596
|
-
const
|
|
59597
|
-
const
|
|
59436
|
+
const path38 = await import("path");
|
|
59437
|
+
const fs34 = await import("fs");
|
|
59598
59438
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59599
59439
|
headless: true
|
|
59600
59440
|
});
|
|
@@ -59602,14 +59442,14 @@ var skill6 = {
|
|
|
59602
59442
|
try {
|
|
59603
59443
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
59604
59444
|
await page.waitForTimeout(2e3);
|
|
59605
|
-
const currentPath =
|
|
59606
|
-
|
|
59445
|
+
const currentPath = path38.join(context.outputDir, `${params.name}-current.png`);
|
|
59446
|
+
fs34.mkdirSync(path38.dirname(currentPath), { recursive: true });
|
|
59607
59447
|
await page.screenshot({ path: currentPath });
|
|
59608
59448
|
try {
|
|
59609
59449
|
const { PNG } = await import("pngjs");
|
|
59610
59450
|
const pixelmatch = (await import("pixelmatch")).default;
|
|
59611
|
-
const baseline = PNG.sync.read(
|
|
59612
|
-
const current = PNG.sync.read(
|
|
59451
|
+
const baseline = PNG.sync.read(fs34.readFileSync(params.baseline));
|
|
59452
|
+
const current = PNG.sync.read(fs34.readFileSync(currentPath));
|
|
59613
59453
|
const { width, height } = baseline;
|
|
59614
59454
|
const diff = new PNG({ width, height });
|
|
59615
59455
|
const numDiffPixels = pixelmatch(
|
|
@@ -59620,8 +59460,8 @@ var skill6 = {
|
|
|
59620
59460
|
height,
|
|
59621
59461
|
{ threshold: params.threshold || 0.1 }
|
|
59622
59462
|
);
|
|
59623
|
-
const diffPath =
|
|
59624
|
-
|
|
59463
|
+
const diffPath = path38.join(context.outputDir, `${params.name}-diff.png`);
|
|
59464
|
+
fs34.writeFileSync(diffPath, PNG.sync.write(diff));
|
|
59625
59465
|
const totalPixels = width * height;
|
|
59626
59466
|
const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
|
|
59627
59467
|
return {
|
|
@@ -59685,10 +59525,10 @@ var skillRegistry = {
|
|
|
59685
59525
|
},
|
|
59686
59526
|
// load skills from a project manifest (rnx-skills.json)
|
|
59687
59527
|
async loadFromManifest(projectDir) {
|
|
59688
|
-
const manifestPath =
|
|
59689
|
-
if (!
|
|
59528
|
+
const manifestPath = path37.join(projectDir, "rnx-skills.json");
|
|
59529
|
+
if (!fs33.existsSync(manifestPath)) return;
|
|
59690
59530
|
try {
|
|
59691
|
-
const manifest = JSON.parse(
|
|
59531
|
+
const manifest = JSON.parse(fs33.readFileSync(manifestPath, "utf8"));
|
|
59692
59532
|
if (Array.isArray(manifest.skills)) {
|
|
59693
59533
|
for (const entry of manifest.skills) {
|
|
59694
59534
|
if (typeof entry === "string") {
|
|
@@ -59699,7 +59539,7 @@ var skillRegistry = {
|
|
|
59699
59539
|
}
|
|
59700
59540
|
} else if (entry.file) {
|
|
59701
59541
|
try {
|
|
59702
|
-
const mod = await import(
|
|
59542
|
+
const mod = await import(path37.resolve(projectDir, entry.file));
|
|
59703
59543
|
if (mod.skill) this.register(mod.skill);
|
|
59704
59544
|
} catch {
|
|
59705
59545
|
}
|
|
@@ -59712,10 +59552,10 @@ var skillRegistry = {
|
|
|
59712
59552
|
// auto-discover skills based on project dependencies
|
|
59713
59553
|
suggestSkills(projectDir) {
|
|
59714
59554
|
const suggestions = [];
|
|
59715
|
-
const pkgPath =
|
|
59716
|
-
if (!
|
|
59555
|
+
const pkgPath = path37.join(projectDir, "package.json");
|
|
59556
|
+
if (!fs33.existsSync(pkgPath)) return suggestions;
|
|
59717
59557
|
try {
|
|
59718
|
-
const pkg = JSON.parse(
|
|
59558
|
+
const pkg = JSON.parse(fs33.readFileSync(pkgPath, "utf8"));
|
|
59719
59559
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
59720
59560
|
if (deps["detox"] || deps["maestro"]) {
|
|
59721
59561
|
suggestions.push("maestro-test");
|