peachsim 0.1.929 → 0.1.931
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 +26 -1
- 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 +1 -1
- 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 +556 -373
- 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/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.931 | (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;
|
|
@@ -4593,6 +4593,8 @@ var init_supported_native_packages = __esm({
|
|
|
4593
4593
|
// seam
|
|
4594
4594
|
"@react-native-picker/picker",
|
|
4595
4595
|
// seam
|
|
4596
|
+
"@react-native-runtimes/state",
|
|
4597
|
+
// seam
|
|
4596
4598
|
"@rive-app/react-native",
|
|
4597
4599
|
// seam
|
|
4598
4600
|
"@rn-org/react-native-shortcuts",
|
|
@@ -16125,8 +16127,8 @@ var init_registry = __esm({
|
|
|
16125
16127
|
{
|
|
16126
16128
|
range: ">=0.1.0-alpha.0",
|
|
16127
16129
|
coverage: 0,
|
|
16128
|
-
note: "
|
|
16129
|
-
missing: "
|
|
16130
|
+
note: "paired native shared-store hydration, reducers, events, persistence, and clear within one runtime; cross-runtime coverage remains unsupported",
|
|
16131
|
+
missing: "authoritative state shared across separate Hermes runtimes, cross-runtime subscriptions, and concurrent updates"
|
|
16130
16132
|
}
|
|
16131
16133
|
]
|
|
16132
16134
|
},
|
|
@@ -19171,17 +19173,17 @@ function visit(node, visitor) {
|
|
|
19171
19173
|
} else
|
|
19172
19174
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
19173
19175
|
}
|
|
19174
|
-
function visit_(key2, node, visitor,
|
|
19175
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
19176
|
+
function visit_(key2, node, visitor, path39) {
|
|
19177
|
+
const ctrl = callVisitor(key2, node, visitor, path39);
|
|
19176
19178
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
19177
|
-
replaceNode(key2,
|
|
19178
|
-
return visit_(key2, ctrl, visitor,
|
|
19179
|
+
replaceNode(key2, path39, ctrl);
|
|
19180
|
+
return visit_(key2, ctrl, visitor, path39);
|
|
19179
19181
|
}
|
|
19180
19182
|
if (typeof ctrl !== "symbol") {
|
|
19181
19183
|
if (isCollection(node)) {
|
|
19182
|
-
|
|
19184
|
+
path39 = Object.freeze(path39.concat(node));
|
|
19183
19185
|
for (let i = 0; i < node.items.length; ++i) {
|
|
19184
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
19186
|
+
const ci = visit_(i, node.items[i], visitor, path39);
|
|
19185
19187
|
if (typeof ci === "number")
|
|
19186
19188
|
i = ci - 1;
|
|
19187
19189
|
else if (ci === BREAK)
|
|
@@ -19192,13 +19194,13 @@ function visit_(key2, node, visitor, path38) {
|
|
|
19192
19194
|
}
|
|
19193
19195
|
}
|
|
19194
19196
|
} else if (isPair(node)) {
|
|
19195
|
-
|
|
19196
|
-
const ck = visit_("key", node.key, visitor,
|
|
19197
|
+
path39 = Object.freeze(path39.concat(node));
|
|
19198
|
+
const ck = visit_("key", node.key, visitor, path39);
|
|
19197
19199
|
if (ck === BREAK)
|
|
19198
19200
|
return BREAK;
|
|
19199
19201
|
else if (ck === REMOVE)
|
|
19200
19202
|
node.key = null;
|
|
19201
|
-
const cv = visit_("value", node.value, visitor,
|
|
19203
|
+
const cv = visit_("value", node.value, visitor, path39);
|
|
19202
19204
|
if (cv === BREAK)
|
|
19203
19205
|
return BREAK;
|
|
19204
19206
|
else if (cv === REMOVE)
|
|
@@ -19216,17 +19218,17 @@ async function visitAsync(node, visitor) {
|
|
|
19216
19218
|
} else
|
|
19217
19219
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
19218
19220
|
}
|
|
19219
|
-
async function visitAsync_(key2, node, visitor,
|
|
19220
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
19221
|
+
async function visitAsync_(key2, node, visitor, path39) {
|
|
19222
|
+
const ctrl = await callVisitor(key2, node, visitor, path39);
|
|
19221
19223
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
19222
|
-
replaceNode(key2,
|
|
19223
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
19224
|
+
replaceNode(key2, path39, ctrl);
|
|
19225
|
+
return visitAsync_(key2, ctrl, visitor, path39);
|
|
19224
19226
|
}
|
|
19225
19227
|
if (typeof ctrl !== "symbol") {
|
|
19226
19228
|
if (isCollection(node)) {
|
|
19227
|
-
|
|
19229
|
+
path39 = Object.freeze(path39.concat(node));
|
|
19228
19230
|
for (let i = 0; i < node.items.length; ++i) {
|
|
19229
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
19231
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path39);
|
|
19230
19232
|
if (typeof ci === "number")
|
|
19231
19233
|
i = ci - 1;
|
|
19232
19234
|
else if (ci === BREAK)
|
|
@@ -19237,13 +19239,13 @@ async function visitAsync_(key2, node, visitor, path38) {
|
|
|
19237
19239
|
}
|
|
19238
19240
|
}
|
|
19239
19241
|
} else if (isPair(node)) {
|
|
19240
|
-
|
|
19241
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
19242
|
+
path39 = Object.freeze(path39.concat(node));
|
|
19243
|
+
const ck = await visitAsync_("key", node.key, visitor, path39);
|
|
19242
19244
|
if (ck === BREAK)
|
|
19243
19245
|
return BREAK;
|
|
19244
19246
|
else if (ck === REMOVE)
|
|
19245
19247
|
node.key = null;
|
|
19246
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
19248
|
+
const cv = await visitAsync_("value", node.value, visitor, path39);
|
|
19247
19249
|
if (cv === BREAK)
|
|
19248
19250
|
return BREAK;
|
|
19249
19251
|
else if (cv === REMOVE)
|
|
@@ -19270,23 +19272,23 @@ function initVisitor(visitor) {
|
|
|
19270
19272
|
}
|
|
19271
19273
|
return visitor;
|
|
19272
19274
|
}
|
|
19273
|
-
function callVisitor(key2, node, visitor,
|
|
19275
|
+
function callVisitor(key2, node, visitor, path39) {
|
|
19274
19276
|
if (typeof visitor === "function")
|
|
19275
|
-
return visitor(key2, node,
|
|
19277
|
+
return visitor(key2, node, path39);
|
|
19276
19278
|
if (isMap(node))
|
|
19277
|
-
return visitor.Map?.(key2, node,
|
|
19279
|
+
return visitor.Map?.(key2, node, path39);
|
|
19278
19280
|
if (isSeq(node))
|
|
19279
|
-
return visitor.Seq?.(key2, node,
|
|
19281
|
+
return visitor.Seq?.(key2, node, path39);
|
|
19280
19282
|
if (isPair(node))
|
|
19281
|
-
return visitor.Pair?.(key2, node,
|
|
19283
|
+
return visitor.Pair?.(key2, node, path39);
|
|
19282
19284
|
if (isScalar(node))
|
|
19283
|
-
return visitor.Scalar?.(key2, node,
|
|
19285
|
+
return visitor.Scalar?.(key2, node, path39);
|
|
19284
19286
|
if (isAlias(node))
|
|
19285
|
-
return visitor.Alias?.(key2, node,
|
|
19287
|
+
return visitor.Alias?.(key2, node, path39);
|
|
19286
19288
|
return void 0;
|
|
19287
19289
|
}
|
|
19288
|
-
function replaceNode(key2,
|
|
19289
|
-
const parent =
|
|
19290
|
+
function replaceNode(key2, path39, node) {
|
|
19291
|
+
const parent = path39[path39.length - 1];
|
|
19290
19292
|
if (isCollection(parent)) {
|
|
19291
19293
|
parent.items[key2] = node;
|
|
19292
19294
|
} else if (isPair(parent)) {
|
|
@@ -19886,10 +19888,10 @@ var init_createNode = __esm({
|
|
|
19886
19888
|
});
|
|
19887
19889
|
|
|
19888
19890
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
19889
|
-
function collectionFromPath(schema4,
|
|
19891
|
+
function collectionFromPath(schema4, path39, value) {
|
|
19890
19892
|
let v = value;
|
|
19891
|
-
for (let i =
|
|
19892
|
-
const k =
|
|
19893
|
+
for (let i = path39.length - 1; i >= 0; --i) {
|
|
19894
|
+
const k = path39[i];
|
|
19893
19895
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
19894
19896
|
const a = [];
|
|
19895
19897
|
a[k] = v;
|
|
@@ -19914,7 +19916,7 @@ var init_Collection = __esm({
|
|
|
19914
19916
|
init_createNode();
|
|
19915
19917
|
init_identity();
|
|
19916
19918
|
init_Node();
|
|
19917
|
-
isEmptyPath = (
|
|
19919
|
+
isEmptyPath = (path39) => path39 == null || typeof path39 === "object" && !!path39[Symbol.iterator]().next().done;
|
|
19918
19920
|
Collection = class extends NodeBase {
|
|
19919
19921
|
constructor(type, schema4) {
|
|
19920
19922
|
super(type);
|
|
@@ -19944,11 +19946,11 @@ var init_Collection = __esm({
|
|
|
19944
19946
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
19945
19947
|
* that already exists in the map.
|
|
19946
19948
|
*/
|
|
19947
|
-
addIn(
|
|
19948
|
-
if (isEmptyPath(
|
|
19949
|
+
addIn(path39, value) {
|
|
19950
|
+
if (isEmptyPath(path39))
|
|
19949
19951
|
this.add(value);
|
|
19950
19952
|
else {
|
|
19951
|
-
const [key2, ...rest] =
|
|
19953
|
+
const [key2, ...rest] = path39;
|
|
19952
19954
|
const node = this.get(key2, true);
|
|
19953
19955
|
if (isCollection(node))
|
|
19954
19956
|
node.addIn(rest, value);
|
|
@@ -19962,8 +19964,8 @@ var init_Collection = __esm({
|
|
|
19962
19964
|
* Removes a value from the collection.
|
|
19963
19965
|
* @returns `true` if the item was found and removed.
|
|
19964
19966
|
*/
|
|
19965
|
-
deleteIn(
|
|
19966
|
-
const [key2, ...rest] =
|
|
19967
|
+
deleteIn(path39) {
|
|
19968
|
+
const [key2, ...rest] = path39;
|
|
19967
19969
|
if (rest.length === 0)
|
|
19968
19970
|
return this.delete(key2);
|
|
19969
19971
|
const node = this.get(key2, true);
|
|
@@ -19977,8 +19979,8 @@ var init_Collection = __esm({
|
|
|
19977
19979
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
19978
19980
|
* `true` (collections are always returned intact).
|
|
19979
19981
|
*/
|
|
19980
|
-
getIn(
|
|
19981
|
-
const [key2, ...rest] =
|
|
19982
|
+
getIn(path39, keepScalar) {
|
|
19983
|
+
const [key2, ...rest] = path39;
|
|
19982
19984
|
const node = this.get(key2, true);
|
|
19983
19985
|
if (rest.length === 0)
|
|
19984
19986
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -19996,8 +19998,8 @@ var init_Collection = __esm({
|
|
|
19996
19998
|
/**
|
|
19997
19999
|
* Checks if the collection includes a value with the key `key`.
|
|
19998
20000
|
*/
|
|
19999
|
-
hasIn(
|
|
20000
|
-
const [key2, ...rest] =
|
|
20001
|
+
hasIn(path39) {
|
|
20002
|
+
const [key2, ...rest] = path39;
|
|
20001
20003
|
if (rest.length === 0)
|
|
20002
20004
|
return this.has(key2);
|
|
20003
20005
|
const node = this.get(key2, true);
|
|
@@ -20007,8 +20009,8 @@ var init_Collection = __esm({
|
|
|
20007
20009
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
20008
20010
|
* boolean to add/remove the item from the set.
|
|
20009
20011
|
*/
|
|
20010
|
-
setIn(
|
|
20011
|
-
const [key2, ...rest] =
|
|
20012
|
+
setIn(path39, value) {
|
|
20013
|
+
const [key2, ...rest] = path39;
|
|
20012
20014
|
if (rest.length === 0) {
|
|
20013
20015
|
this.set(key2, value);
|
|
20014
20016
|
} else {
|
|
@@ -22442,9 +22444,9 @@ var init_Document = __esm({
|
|
|
22442
22444
|
this.contents.add(value);
|
|
22443
22445
|
}
|
|
22444
22446
|
/** Adds a value to the document. */
|
|
22445
|
-
addIn(
|
|
22447
|
+
addIn(path39, value) {
|
|
22446
22448
|
if (assertCollection(this.contents))
|
|
22447
|
-
this.contents.addIn(
|
|
22449
|
+
this.contents.addIn(path39, value);
|
|
22448
22450
|
}
|
|
22449
22451
|
/**
|
|
22450
22452
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -22519,14 +22521,14 @@ var init_Document = __esm({
|
|
|
22519
22521
|
* Removes a value from the document.
|
|
22520
22522
|
* @returns `true` if the item was found and removed.
|
|
22521
22523
|
*/
|
|
22522
|
-
deleteIn(
|
|
22523
|
-
if (isEmptyPath(
|
|
22524
|
+
deleteIn(path39) {
|
|
22525
|
+
if (isEmptyPath(path39)) {
|
|
22524
22526
|
if (this.contents == null)
|
|
22525
22527
|
return false;
|
|
22526
22528
|
this.contents = null;
|
|
22527
22529
|
return true;
|
|
22528
22530
|
}
|
|
22529
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
22531
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path39) : false;
|
|
22530
22532
|
}
|
|
22531
22533
|
/**
|
|
22532
22534
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -22541,10 +22543,10 @@ var init_Document = __esm({
|
|
|
22541
22543
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
22542
22544
|
* `true` (collections are always returned intact).
|
|
22543
22545
|
*/
|
|
22544
|
-
getIn(
|
|
22545
|
-
if (isEmptyPath(
|
|
22546
|
+
getIn(path39, keepScalar) {
|
|
22547
|
+
if (isEmptyPath(path39))
|
|
22546
22548
|
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
|
|
22547
|
-
return isCollection(this.contents) ? this.contents.getIn(
|
|
22549
|
+
return isCollection(this.contents) ? this.contents.getIn(path39, keepScalar) : void 0;
|
|
22548
22550
|
}
|
|
22549
22551
|
/**
|
|
22550
22552
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -22555,10 +22557,10 @@ var init_Document = __esm({
|
|
|
22555
22557
|
/**
|
|
22556
22558
|
* Checks if the document includes a value at `path`.
|
|
22557
22559
|
*/
|
|
22558
|
-
hasIn(
|
|
22559
|
-
if (isEmptyPath(
|
|
22560
|
+
hasIn(path39) {
|
|
22561
|
+
if (isEmptyPath(path39))
|
|
22560
22562
|
return this.contents !== void 0;
|
|
22561
|
-
return isCollection(this.contents) ? this.contents.hasIn(
|
|
22563
|
+
return isCollection(this.contents) ? this.contents.hasIn(path39) : false;
|
|
22562
22564
|
}
|
|
22563
22565
|
/**
|
|
22564
22566
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -22575,13 +22577,13 @@ var init_Document = __esm({
|
|
|
22575
22577
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
22576
22578
|
* boolean to add/remove the item from the set.
|
|
22577
22579
|
*/
|
|
22578
|
-
setIn(
|
|
22579
|
-
if (isEmptyPath(
|
|
22580
|
+
setIn(path39, value) {
|
|
22581
|
+
if (isEmptyPath(path39)) {
|
|
22580
22582
|
this.contents = value;
|
|
22581
22583
|
} else if (this.contents == null) {
|
|
22582
|
-
this.contents = collectionFromPath(this.schema, Array.from(
|
|
22584
|
+
this.contents = collectionFromPath(this.schema, Array.from(path39), value);
|
|
22583
22585
|
} else if (assertCollection(this.contents)) {
|
|
22584
|
-
this.contents.setIn(
|
|
22586
|
+
this.contents.setIn(path39, value);
|
|
22585
22587
|
}
|
|
22586
22588
|
}
|
|
22587
22589
|
/**
|
|
@@ -24486,15 +24488,15 @@ function visit2(cst, visitor) {
|
|
|
24486
24488
|
cst = { start: cst.start, value: cst.value };
|
|
24487
24489
|
_visit(Object.freeze([]), cst, visitor);
|
|
24488
24490
|
}
|
|
24489
|
-
function _visit(
|
|
24490
|
-
let ctrl = visitor(item,
|
|
24491
|
+
function _visit(path39, item, visitor) {
|
|
24492
|
+
let ctrl = visitor(item, path39);
|
|
24491
24493
|
if (typeof ctrl === "symbol")
|
|
24492
24494
|
return ctrl;
|
|
24493
24495
|
for (const field of ["key", "value"]) {
|
|
24494
24496
|
const token = item[field];
|
|
24495
24497
|
if (token && "items" in token) {
|
|
24496
24498
|
for (let i = 0; i < token.items.length; ++i) {
|
|
24497
|
-
const ci = _visit(Object.freeze(
|
|
24499
|
+
const ci = _visit(Object.freeze(path39.concat([[field, i]])), token.items[i], visitor);
|
|
24498
24500
|
if (typeof ci === "number")
|
|
24499
24501
|
i = ci - 1;
|
|
24500
24502
|
else if (ci === BREAK2)
|
|
@@ -24505,10 +24507,10 @@ function _visit(path38, item, visitor) {
|
|
|
24505
24507
|
}
|
|
24506
24508
|
}
|
|
24507
24509
|
if (typeof ctrl === "function" && field === "key")
|
|
24508
|
-
ctrl = ctrl(item,
|
|
24510
|
+
ctrl = ctrl(item, path39);
|
|
24509
24511
|
}
|
|
24510
24512
|
}
|
|
24511
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
24513
|
+
return typeof ctrl === "function" ? ctrl(item, path39) : ctrl;
|
|
24512
24514
|
}
|
|
24513
24515
|
var BREAK2, SKIP2, REMOVE2;
|
|
24514
24516
|
var init_cst_visit = __esm({
|
|
@@ -24519,9 +24521,9 @@ var init_cst_visit = __esm({
|
|
|
24519
24521
|
visit2.BREAK = BREAK2;
|
|
24520
24522
|
visit2.SKIP = SKIP2;
|
|
24521
24523
|
visit2.REMOVE = REMOVE2;
|
|
24522
|
-
visit2.itemAtPath = (cst,
|
|
24524
|
+
visit2.itemAtPath = (cst, path39) => {
|
|
24523
24525
|
let item = cst;
|
|
24524
|
-
for (const [field, index] of
|
|
24526
|
+
for (const [field, index] of path39) {
|
|
24525
24527
|
const tok = item?.[field];
|
|
24526
24528
|
if (tok && "items" in tok) {
|
|
24527
24529
|
item = tok.items[index];
|
|
@@ -24530,9 +24532,9 @@ var init_cst_visit = __esm({
|
|
|
24530
24532
|
}
|
|
24531
24533
|
return item;
|
|
24532
24534
|
};
|
|
24533
|
-
visit2.parentCollection = (cst,
|
|
24534
|
-
const parent = visit2.itemAtPath(cst,
|
|
24535
|
-
const field =
|
|
24535
|
+
visit2.parentCollection = (cst, path39) => {
|
|
24536
|
+
const parent = visit2.itemAtPath(cst, path39.slice(0, -1));
|
|
24537
|
+
const field = path39[path39.length - 1][0];
|
|
24536
24538
|
const coll = parent?.[field];
|
|
24537
24539
|
if (coll && "items" in coll)
|
|
24538
24540
|
return coll;
|
|
@@ -25835,14 +25837,14 @@ var init_parser = __esm({
|
|
|
25835
25837
|
case "scalar":
|
|
25836
25838
|
case "single-quoted-scalar":
|
|
25837
25839
|
case "double-quoted-scalar": {
|
|
25838
|
-
const
|
|
25840
|
+
const fs35 = this.flowScalar(this.type);
|
|
25839
25841
|
if (atNextItem || it.value) {
|
|
25840
|
-
map2.items.push({ start, key:
|
|
25842
|
+
map2.items.push({ start, key: fs35, sep: [] });
|
|
25841
25843
|
this.onKeyLine = true;
|
|
25842
25844
|
} else if (it.sep) {
|
|
25843
|
-
this.stack.push(
|
|
25845
|
+
this.stack.push(fs35);
|
|
25844
25846
|
} else {
|
|
25845
|
-
Object.assign(it, { key:
|
|
25847
|
+
Object.assign(it, { key: fs35, sep: [] });
|
|
25846
25848
|
this.onKeyLine = true;
|
|
25847
25849
|
}
|
|
25848
25850
|
return;
|
|
@@ -25970,13 +25972,13 @@ var init_parser = __esm({
|
|
|
25970
25972
|
case "scalar":
|
|
25971
25973
|
case "single-quoted-scalar":
|
|
25972
25974
|
case "double-quoted-scalar": {
|
|
25973
|
-
const
|
|
25975
|
+
const fs35 = this.flowScalar(this.type);
|
|
25974
25976
|
if (!it || it.value)
|
|
25975
|
-
fc.items.push({ start: [], key:
|
|
25977
|
+
fc.items.push({ start: [], key: fs35, sep: [] });
|
|
25976
25978
|
else if (it.sep)
|
|
25977
|
-
this.stack.push(
|
|
25979
|
+
this.stack.push(fs35);
|
|
25978
25980
|
else
|
|
25979
|
-
Object.assign(it, { key:
|
|
25981
|
+
Object.assign(it, { key: fs35, sep: [] });
|
|
25980
25982
|
return;
|
|
25981
25983
|
}
|
|
25982
25984
|
case "flow-map-end":
|
|
@@ -27347,9 +27349,9 @@ function safeChildPlistName(value) {
|
|
|
27347
27349
|
name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
|
|
27348
27350
|
};
|
|
27349
27351
|
}
|
|
27350
|
-
async function readableSettingsBundle(
|
|
27352
|
+
async function readableSettingsBundle(path39) {
|
|
27351
27353
|
try {
|
|
27352
|
-
const root = await (0, import_promises.stat)((0, import_node_path.join)(
|
|
27354
|
+
const root = await (0, import_promises.stat)((0, import_node_path.join)(path39, "Root.plist"));
|
|
27353
27355
|
return root.isFile() && root.size <= MAX_PLIST_BYTES;
|
|
27354
27356
|
} catch {
|
|
27355
27357
|
return false;
|
|
@@ -27394,11 +27396,11 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
27394
27396
|
return null;
|
|
27395
27397
|
}
|
|
27396
27398
|
}
|
|
27397
|
-
async function parsePlistRecord(
|
|
27399
|
+
async function parsePlistRecord(path39) {
|
|
27398
27400
|
try {
|
|
27399
|
-
const metadata = await (0, import_promises.stat)(
|
|
27401
|
+
const metadata = await (0, import_promises.stat)(path39);
|
|
27400
27402
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
27401
|
-
const source = await (0, import_promises.readFile)(
|
|
27403
|
+
const source = await (0, import_promises.readFile)(path39, "utf8");
|
|
27402
27404
|
const parsed = parsePlistSource(source);
|
|
27403
27405
|
return isRecord2(parsed) ? parsed : null;
|
|
27404
27406
|
} catch {
|
|
@@ -27744,7 +27746,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
27744
27746
|
return null;
|
|
27745
27747
|
}
|
|
27746
27748
|
}
|
|
27747
|
-
function httpGet(hostname, port,
|
|
27749
|
+
function httpGet(hostname, port, path39, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
27748
27750
|
return new Promise((resolve10) => {
|
|
27749
27751
|
let settled = false;
|
|
27750
27752
|
let killing = false;
|
|
@@ -27753,7 +27755,7 @@ function httpGet(hostname, port, path38, method = "GET", timeout = TIMEOUT_MS, h
|
|
|
27753
27755
|
settled = true;
|
|
27754
27756
|
resolve10(value);
|
|
27755
27757
|
};
|
|
27756
|
-
const req = import_http.default.request({ hostname, port, path:
|
|
27758
|
+
const req = import_http.default.request({ hostname, port, path: path39, method, headers }, (res) => {
|
|
27757
27759
|
let body = "";
|
|
27758
27760
|
res.on("data", (c) => body += c.toString());
|
|
27759
27761
|
const contentType = (() => {
|
|
@@ -31881,8 +31883,8 @@ function pickImagesetFile(images) {
|
|
|
31881
31883
|
scale: pick.scale === "2x" ? 2 : pick.scale === "3x" ? 3 : 1
|
|
31882
31884
|
};
|
|
31883
31885
|
}
|
|
31884
|
-
function flatScale(
|
|
31885
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
31886
|
+
function flatScale(path39) {
|
|
31887
|
+
const match = /@([23])x\.[^./]+$/.exec(path39);
|
|
31886
31888
|
return match ? Number(match[1]) : 1;
|
|
31887
31889
|
}
|
|
31888
31890
|
function providesNamespace(text3) {
|
|
@@ -31909,13 +31911,13 @@ function catalogEntryName(contentsPath, kind, readText2) {
|
|
|
31909
31911
|
}
|
|
31910
31912
|
return segments.join("/");
|
|
31911
31913
|
}
|
|
31912
|
-
function isFlatResourceImage(
|
|
31913
|
-
return
|
|
31914
|
+
function isFlatResourceImage(path39) {
|
|
31915
|
+
return path39.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path39));
|
|
31914
31916
|
}
|
|
31915
31917
|
function enumerateBundleImages(paths, readText2) {
|
|
31916
31918
|
const table = [];
|
|
31917
31919
|
const seen = /* @__PURE__ */ new Set();
|
|
31918
|
-
const catalogs = paths.filter((
|
|
31920
|
+
const catalogs = paths.filter((path39) => baseOf(path39) === "Contents.json");
|
|
31919
31921
|
for (const contentsPath of catalogs) {
|
|
31920
31922
|
const name2 = catalogEntryName(contentsPath, ".imageset", readText2);
|
|
31921
31923
|
if (name2 === null || seen.has(name2)) continue;
|
|
@@ -31936,12 +31938,12 @@ function enumerateBundleImages(paths, readText2) {
|
|
|
31936
31938
|
seen.add(name2);
|
|
31937
31939
|
table.push({ name: name2, file: `${dir}/${pick.filename}`, scale: pick.scale });
|
|
31938
31940
|
}
|
|
31939
|
-
for (const
|
|
31940
|
-
if (!isFlatResourceImage(
|
|
31941
|
-
const name2 = baseOf(
|
|
31941
|
+
for (const path39 of paths) {
|
|
31942
|
+
if (!isFlatResourceImage(path39)) continue;
|
|
31943
|
+
const name2 = baseOf(path39).slice(0, -extOf(path39).length);
|
|
31942
31944
|
if (name2 === "" || seen.has(name2)) continue;
|
|
31943
31945
|
seen.add(name2);
|
|
31944
|
-
table.push({ name: name2, file:
|
|
31946
|
+
table.push({ name: name2, file: path39, scale: flatScale(path39) });
|
|
31945
31947
|
}
|
|
31946
31948
|
return table;
|
|
31947
31949
|
}
|
|
@@ -31970,7 +31972,7 @@ function colorsetValue(color) {
|
|
|
31970
31972
|
}
|
|
31971
31973
|
function enumerateBundleColors(paths, readText2) {
|
|
31972
31974
|
const table = {};
|
|
31973
|
-
for (const contentsPath of paths.filter((
|
|
31975
|
+
for (const contentsPath of paths.filter((path39) => baseOf(path39) === "Contents.json")) {
|
|
31974
31976
|
const name2 = catalogEntryName(contentsPath, ".colorset", readText2);
|
|
31975
31977
|
if (name2 === null || name2 in table) continue;
|
|
31976
31978
|
let colors;
|
|
@@ -32034,8 +32036,8 @@ function axisExtremes(points) {
|
|
|
32034
32036
|
function pathBounds(d) {
|
|
32035
32037
|
const xs = [];
|
|
32036
32038
|
const ys = [];
|
|
32037
|
-
for (const
|
|
32038
|
-
(0, import_svgpath.default)(
|
|
32039
|
+
for (const path39 of d)
|
|
32040
|
+
(0, import_svgpath.default)(path39).abs().unshort().unarc().iterate((segment, _index, x, y) => {
|
|
32039
32041
|
const [command, ...args] = segment;
|
|
32040
32042
|
if (command === "M" || command === "L") {
|
|
32041
32043
|
xs.push(Number(args[0]));
|
|
@@ -32062,7 +32064,7 @@ function guide(svg, id, axis) {
|
|
|
32062
32064
|
}
|
|
32063
32065
|
function enumerateBundleSymbols(paths, readText2) {
|
|
32064
32066
|
const table = {};
|
|
32065
|
-
for (const contentsPath of paths.filter((
|
|
32067
|
+
for (const contentsPath of paths.filter((path39) => baseOf(path39) === "Contents.json")) {
|
|
32066
32068
|
const name2 = catalogEntryName(contentsPath, ".symbolset", readText2);
|
|
32067
32069
|
if (name2 === null || name2 in table) continue;
|
|
32068
32070
|
let symbols;
|
|
@@ -32095,8 +32097,8 @@ function enumerateBundleSymbols(paths, readText2) {
|
|
|
32095
32097
|
viewBox: "0 0 24 24",
|
|
32096
32098
|
advance,
|
|
32097
32099
|
box: [12 - advance / 2, 12 - tall / 2, advance, tall],
|
|
32098
|
-
layers: d.map((
|
|
32099
|
-
d: (0, import_svgpath.default)(
|
|
32100
|
+
layers: d.map((path39) => ({
|
|
32101
|
+
d: (0, import_svgpath.default)(path39).abs().scale(scale).translate(translateX, translateY).round(3).toString()
|
|
32100
32102
|
}))
|
|
32101
32103
|
};
|
|
32102
32104
|
}
|
|
@@ -32106,7 +32108,7 @@ function enumerateBundleJson(paths) {
|
|
|
32106
32108
|
const found = [];
|
|
32107
32109
|
const seen = /* @__PURE__ */ new Set();
|
|
32108
32110
|
const ordered = [...paths].filter(
|
|
32109
|
-
(
|
|
32111
|
+
(path39) => path39.split("/").includes("Resources") && path39.split("/").every((segment) => segment !== "" && segment !== "..") && (extOf(path39) === ".json" || extOf(path39) === ".xcstrings")
|
|
32110
32112
|
).sort((a, b) => {
|
|
32111
32113
|
const aDepth = a.split("/").length;
|
|
32112
32114
|
const bDepth = b.split("/").length;
|
|
@@ -33405,10 +33407,10 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33405
33407
|
owners.push(...physical.map(() => current));
|
|
33406
33408
|
};
|
|
33407
33409
|
const scoped = (body) => (symbol, ...rest) => {
|
|
33408
|
-
const
|
|
33409
|
-
if (omit.has(
|
|
33410
|
+
const path39 = pathOf(symbol);
|
|
33411
|
+
if (omit.has(path39)) return void skipped.push({ path: path39, reason: omit.get(path39) });
|
|
33410
33412
|
const previous = current;
|
|
33411
|
-
current =
|
|
33413
|
+
current = path39;
|
|
33412
33414
|
try {
|
|
33413
33415
|
body(symbol, ...rest);
|
|
33414
33416
|
} finally {
|
|
@@ -33428,14 +33430,14 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33428
33430
|
const access = (symbol, openOwner) => symbol.accessLevel === "open" && openOwner ? "open" : "public";
|
|
33429
33431
|
const emitMember = scoped(
|
|
33430
33432
|
(member, indent, context) => {
|
|
33431
|
-
const
|
|
33433
|
+
const path39 = pathOf(member);
|
|
33432
33434
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
33433
33435
|
emitType(member, indent);
|
|
33434
33436
|
return;
|
|
33435
33437
|
}
|
|
33436
33438
|
if (member.kind.identifier === "swift.enum.case") return;
|
|
33437
33439
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
33438
|
-
skipped.push({ path:
|
|
33440
|
+
skipped.push({ path: path39, reason: `unhandled ${member.kind.identifier}` });
|
|
33439
33441
|
return;
|
|
33440
33442
|
}
|
|
33441
33443
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
@@ -33449,12 +33451,12 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33449
33451
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
33450
33452
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
33451
33453
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
33452
|
-
const override = context.inClass && !options.plain?.has(
|
|
33454
|
+
const override = context.inClass && !options.plain?.has(path39) && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path39) || isObjC(member) && path39.endsWith(".init()")) ? "override " : "";
|
|
33453
33455
|
const head = `${indent}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
33454
|
-
const measured = behavior.get(
|
|
33455
|
-
if (measured) used.add(
|
|
33456
|
+
const measured = behavior.get(path39);
|
|
33457
|
+
if (measured) used.add(path39);
|
|
33456
33458
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
33457
|
-
const body = overloadBody ?? measured?.body ?? trap(
|
|
33459
|
+
const body = overloadBody ?? measured?.body ?? trap(path39);
|
|
33458
33460
|
switch (member.kind.identifier) {
|
|
33459
33461
|
case "swift.property":
|
|
33460
33462
|
case "swift.type.property":
|
|
@@ -33475,7 +33477,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33475
33477
|
return;
|
|
33476
33478
|
}
|
|
33477
33479
|
emit(
|
|
33478
|
-
`${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(
|
|
33480
|
+
`${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(path39)} }` : ""} }`
|
|
33479
33481
|
);
|
|
33480
33482
|
return;
|
|
33481
33483
|
}
|
|
@@ -33528,7 +33530,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33528
33530
|
};
|
|
33529
33531
|
const emitType = scoped(
|
|
33530
33532
|
(symbol, indent) => {
|
|
33531
|
-
const
|
|
33533
|
+
const path39 = pathOf(symbol);
|
|
33532
33534
|
const id = symbol.identifier.precise;
|
|
33533
33535
|
const inner = `${indent} `;
|
|
33534
33536
|
switch (symbol.kind.identifier) {
|
|
@@ -33540,10 +33542,10 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33540
33542
|
case "swift.class": {
|
|
33541
33543
|
const shape = header(symbol, "class", indent);
|
|
33542
33544
|
if (!shape)
|
|
33543
|
-
return void skipped.push({ path:
|
|
33544
|
-
const parent = options.superclasses?.get(
|
|
33545
|
+
return void skipped.push({ path: path39, reason: `unparsed class ${text(symbol)}` });
|
|
33546
|
+
const parent = options.superclasses?.get(path39) ?? superclass.get(id);
|
|
33545
33547
|
const blocked = classBlocked(id);
|
|
33546
|
-
if (blocked) return void skipped.push({ path:
|
|
33548
|
+
if (blocked) return void skipped.push({ path: path39, reason: blocked });
|
|
33547
33549
|
const ancestors = /* @__PURE__ */ new Set();
|
|
33548
33550
|
for (let at = superId.get(id); at; at = superId.get(at))
|
|
33549
33551
|
for (const name2 of conforms.get(at) ?? []) ancestors.add(name2);
|
|
@@ -33559,9 +33561,9 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33559
33561
|
`${indent}${shape.attrs}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
33560
33562
|
);
|
|
33561
33563
|
const members = membersOf(id);
|
|
33562
|
-
const extra = options.behavior?.get(
|
|
33564
|
+
const extra = options.behavior?.get(path39)?.members;
|
|
33563
33565
|
if (extra) {
|
|
33564
|
-
used.add(
|
|
33566
|
+
used.add(path39);
|
|
33565
33567
|
emit(`${inner}${extra}`);
|
|
33566
33568
|
}
|
|
33567
33569
|
for (const member of members)
|
|
@@ -33613,13 +33615,13 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33613
33615
|
continue;
|
|
33614
33616
|
have.add(witnessKey(member));
|
|
33615
33617
|
have.add(sideLeaf(member));
|
|
33616
|
-
emitWitness(member, inner,
|
|
33618
|
+
emitWitness(member, inner, path39);
|
|
33617
33619
|
}
|
|
33618
33620
|
}
|
|
33619
33621
|
const coder = members.some((member) => leaf(member) === "init(coder:)");
|
|
33620
33622
|
if (designated && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
33621
33623
|
emit(
|
|
33622
|
-
`${inner}public required init?(coder: NSCoder) { ${trap(`${
|
|
33624
|
+
`${inner}public required init?(coder: NSCoder) { ${trap(`${path39}.init(coder:)`)} }`
|
|
33623
33625
|
);
|
|
33624
33626
|
emit(`${indent}}`);
|
|
33625
33627
|
return;
|
|
@@ -33627,7 +33629,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33627
33629
|
case "swift.struct": {
|
|
33628
33630
|
const shape = header(symbol, "struct", indent);
|
|
33629
33631
|
if (!shape)
|
|
33630
|
-
return void skipped.push({ path:
|
|
33632
|
+
return void skipped.push({ path: path39, reason: `unparsed struct ${text(symbol)}` });
|
|
33631
33633
|
const members = membersOf(id);
|
|
33632
33634
|
const raw2 = rawType(members);
|
|
33633
33635
|
const list2 = inheritance(id);
|
|
@@ -33659,7 +33661,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33659
33661
|
case "swift.enum": {
|
|
33660
33662
|
const shape = header(symbol, "enum", indent);
|
|
33661
33663
|
if (!shape)
|
|
33662
|
-
return void skipped.push({ path:
|
|
33664
|
+
return void skipped.push({ path: path39, reason: `unparsed enum ${text(symbol)}` });
|
|
33663
33665
|
const members = membersOf(id);
|
|
33664
33666
|
const raw2 = rawType(members);
|
|
33665
33667
|
const cases = members.filter(
|
|
@@ -33668,7 +33670,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33668
33670
|
const missing = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
33669
33671
|
if (raw2 && isObjC(symbol) && missing.length > 0)
|
|
33670
33672
|
return void skipped.push({
|
|
33671
|
-
path:
|
|
33673
|
+
path: path39,
|
|
33672
33674
|
reason: `no header value for ${missing.map(leaf).join(", ")}`
|
|
33673
33675
|
});
|
|
33674
33676
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -33708,7 +33710,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33708
33710
|
const shape = header(symbol, "protocol", indent);
|
|
33709
33711
|
if (!shape)
|
|
33710
33712
|
return void skipped.push({
|
|
33711
|
-
path:
|
|
33713
|
+
path: path39,
|
|
33712
33714
|
reason: `unparsed protocol ${text(symbol)}`
|
|
33713
33715
|
});
|
|
33714
33716
|
const list2 = [...isObjC(symbol) ? ["AnyObject"] : [], ...inheritance(id)];
|
|
@@ -33733,7 +33735,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33733
33735
|
}
|
|
33734
33736
|
emit(`${indent}}`);
|
|
33735
33737
|
if (defaults.length > 0) {
|
|
33736
|
-
emit(`${indent}extension ${
|
|
33738
|
+
emit(`${indent}extension ${path39} {`);
|
|
33737
33739
|
for (const member of defaults) {
|
|
33738
33740
|
const decl = text(member);
|
|
33739
33741
|
if (optional.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -33779,7 +33781,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33779
33781
|
return init ? /rawValue:\s*([^)]+)\)/.exec(text(init))?.[1]?.trim() ?? null : null;
|
|
33780
33782
|
};
|
|
33781
33783
|
const emitGlobal = scoped((symbol) => {
|
|
33782
|
-
const
|
|
33784
|
+
const path39 = pathOf(symbol);
|
|
33783
33785
|
const kind = symbol.kind.identifier;
|
|
33784
33786
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
33785
33787
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol));
|
|
@@ -33790,17 +33792,17 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33790
33792
|
if (fix && !/^(?:prefix|infix|postfix)\b/.test(spelled))
|
|
33791
33793
|
spelled = `${fix} ${spelled}`;
|
|
33792
33794
|
}
|
|
33793
|
-
emit(`${attrs}public ${spelled} { ${trap(
|
|
33795
|
+
emit(`${attrs}public ${spelled} { ${trap(path39)} }`);
|
|
33794
33796
|
} else if (kind === "swift.var") {
|
|
33795
33797
|
const parsed = splitAccessors(text(symbol).replace(/^let /, "var "));
|
|
33796
|
-
const measured = behavior.get(
|
|
33797
|
-
if (measured) used.add(
|
|
33798
|
-
emit(`public ${parsed.decl} { ${measured?.body ?? trap(
|
|
33799
|
-
} else skipped.push({ path:
|
|
33798
|
+
const measured = behavior.get(path39);
|
|
33799
|
+
if (measured) used.add(path39);
|
|
33800
|
+
emit(`public ${parsed.decl} { ${measured?.body ?? trap(path39)} }`);
|
|
33801
|
+
} else skipped.push({ path: path39, reason: `unhandled top-level ${kind}` });
|
|
33800
33802
|
});
|
|
33801
33803
|
const roots = [...byId.values()].filter((symbol) => !owner.has(symbol.identifier.precise) && !unavailable(symbol)).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
33802
33804
|
for (const symbol of roots) {
|
|
33803
|
-
const
|
|
33805
|
+
const path39 = pathOf(symbol);
|
|
33804
33806
|
if (TYPE_KINDS.has(symbol.kind.identifier)) emitType(symbol, "");
|
|
33805
33807
|
else emitGlobal(symbol);
|
|
33806
33808
|
}
|
|
@@ -33841,9 +33843,9 @@ function emitSwiftStandin(graphs, options) {
|
|
|
33841
33843
|
...imports.map((name2) => `import ${name2}`),
|
|
33842
33844
|
""
|
|
33843
33845
|
];
|
|
33844
|
-
for (const
|
|
33845
|
-
if (!used.has(
|
|
33846
|
-
skipped.push({ path:
|
|
33846
|
+
for (const path39 of behavior.keys())
|
|
33847
|
+
if (!used.has(path39))
|
|
33848
|
+
skipped.push({ path: path39, reason: "behavior names no emitted declaration" });
|
|
33847
33849
|
return {
|
|
33848
33850
|
source: `${[...banner, ...lines].join("\n")}
|
|
33849
33851
|
`,
|
|
@@ -33929,7 +33931,7 @@ var init_swift_standin_emit = __esm({
|
|
|
33929
33931
|
sideLeaf = (symbol) => `${symbol.kind.identifier.startsWith("swift.type.") ? "type" : "instance"}|leaf|${leaf(symbol)}`;
|
|
33930
33932
|
isObjC = (symbol) => symbol.identifier.precise.startsWith("c:");
|
|
33931
33933
|
synthesizedEquality = (symbol, conforms) => conforms.includes("Hashable") ? ["==(_:_:)", "hash(into:)", "hashValue"].includes(leaf(symbol)) : conforms.includes("Equatable") && leaf(symbol) === "==(_:_:)";
|
|
33932
|
-
trap = (
|
|
33934
|
+
trap = (path39) => `fatalError("${path39} is a binary framework peach cannot run")`;
|
|
33933
33935
|
KEYWORDS = /* @__PURE__ */ new Set([
|
|
33934
33936
|
"Type",
|
|
33935
33937
|
"Protocol",
|
|
@@ -36647,6 +36649,9 @@ function nativeTargets(project) {
|
|
|
36647
36649
|
}
|
|
36648
36650
|
return refs;
|
|
36649
36651
|
}
|
|
36652
|
+
function listXcodeAppTargets(xcodeprojOrWorkspace) {
|
|
36653
|
+
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(nativeTargets).filter((ref) => ref.target.productType === APPLICATION).map((ref) => str(ref.target.name) ?? ref.id);
|
|
36654
|
+
}
|
|
36650
36655
|
function readXcodeAppTarget(input, targetName) {
|
|
36651
36656
|
const xcodeprojOrWorkspace = import_node_fs18.default.realpathSync(input);
|
|
36652
36657
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
@@ -38225,8 +38230,8 @@ function sourceEntryPath() {
|
|
|
38225
38230
|
return null;
|
|
38226
38231
|
}
|
|
38227
38232
|
}
|
|
38228
|
-
function isCliEntry(
|
|
38229
|
-
const name2 = (0, import_node_path22.basename)(
|
|
38233
|
+
function isCliEntry(path39) {
|
|
38234
|
+
const name2 = (0, import_node_path22.basename)(path39);
|
|
38230
38235
|
return name2 === "bin.ts" || name2 === "bin.js";
|
|
38231
38236
|
}
|
|
38232
38237
|
function rnxSelfInvocation() {
|
|
@@ -43141,8 +43146,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
|
|
|
43141
43146
|
}
|
|
43142
43147
|
const out = [];
|
|
43143
43148
|
for (const dir of dirs) {
|
|
43144
|
-
const
|
|
43145
|
-
if (!out.includes(
|
|
43149
|
+
const path39 = `${dir}/${filename}`;
|
|
43150
|
+
if (!out.includes(path39)) out.push(path39);
|
|
43146
43151
|
}
|
|
43147
43152
|
if (!out.includes(filename)) out.push(filename);
|
|
43148
43153
|
return out;
|
|
@@ -44106,13 +44111,13 @@ function readFactoryStringLiterals(factory) {
|
|
|
44106
44111
|
return literals;
|
|
44107
44112
|
}
|
|
44108
44113
|
function normalizeFingerprintLiteral(literal) {
|
|
44109
|
-
const
|
|
44114
|
+
const path39 = literal.replaceAll("\\\\", "/").replaceAll("\\/", "/");
|
|
44110
44115
|
const nodeModulesMarker = "/node_modules/";
|
|
44111
|
-
const nodeModulesIndex =
|
|
44116
|
+
const nodeModulesIndex = path39.lastIndexOf(nodeModulesMarker);
|
|
44112
44117
|
if (nodeModulesIndex >= 0) {
|
|
44113
|
-
return `node_modules/${
|
|
44118
|
+
return `node_modules/${path39.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
|
|
44114
44119
|
}
|
|
44115
|
-
if ((
|
|
44120
|
+
if ((path39.startsWith("/") || /^[A-Za-z]:\//.test(path39) || path39.startsWith("file:/")) && /\.[cm]?[jt]sx?(?::\d+(?::\d+)?)?$/.test(path39)) {
|
|
44116
44121
|
return null;
|
|
44117
44122
|
}
|
|
44118
44123
|
return literal;
|
|
@@ -44350,10 +44355,10 @@ function templateAssignment(template, embeddings) {
|
|
|
44350
44355
|
if (existingNode !== void 0 && existingNode !== nodeIndex) return null;
|
|
44351
44356
|
nodesByModuleId.set(moduleId, nodeIndex);
|
|
44352
44357
|
const node = template.nodes[nodeIndex];
|
|
44353
|
-
const
|
|
44358
|
+
const path39 = node.landmarkPath ?? `node_modules/${template.packageName}/__rnx_inferred__/${moduleId}.js`;
|
|
44354
44359
|
const existingPath = pathsByModuleId.get(moduleId);
|
|
44355
|
-
if (existingPath !== void 0 && existingPath !==
|
|
44356
|
-
pathsByModuleId.set(moduleId,
|
|
44360
|
+
if (existingPath !== void 0 && existingPath !== path39) return null;
|
|
44361
|
+
pathsByModuleId.set(moduleId, path39);
|
|
44357
44362
|
}
|
|
44358
44363
|
}
|
|
44359
44364
|
return {
|
|
@@ -44515,14 +44520,14 @@ async function inferMetroModuleIdentity(args) {
|
|
|
44515
44520
|
const packageClaims = claimsByPackage.values().next().value;
|
|
44516
44521
|
if (!packageClaims) continue;
|
|
44517
44522
|
const exactClaims = packageClaims.filter((assignment2) => {
|
|
44518
|
-
const
|
|
44519
|
-
return
|
|
44523
|
+
const path39 = assignment2.pathsByModuleId.get(moduleId);
|
|
44524
|
+
return path39 !== void 0 && !path39.includes("/__rnx_inferred__/");
|
|
44520
44525
|
});
|
|
44521
44526
|
const preferredClaims = exactClaims.length > 0 ? exactClaims : packageClaims;
|
|
44522
44527
|
const routes = new Set(
|
|
44523
44528
|
preferredClaims.flatMap((assignment2) => {
|
|
44524
|
-
const
|
|
44525
|
-
return
|
|
44529
|
+
const path39 = assignment2.pathsByModuleId.get(moduleId);
|
|
44530
|
+
return path39 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path39)] : [];
|
|
44526
44531
|
})
|
|
44527
44532
|
);
|
|
44528
44533
|
if (routes.size !== 1) continue;
|
|
@@ -44878,8 +44883,8 @@ function metadataValue(value, key2) {
|
|
|
44878
44883
|
if (!value || typeof value !== "object") return void 0;
|
|
44879
44884
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
44880
44885
|
}
|
|
44881
|
-
function readProjectJson(
|
|
44882
|
-
const text3 = readProjectMetadata(
|
|
44886
|
+
function readProjectJson(path39, files2 = nodeRepoFileReader) {
|
|
44887
|
+
const text3 = readProjectMetadata(path39, files2);
|
|
44883
44888
|
if (text3 === null) return null;
|
|
44884
44889
|
try {
|
|
44885
44890
|
const value = JSON.parse(text3);
|
|
@@ -48864,11 +48869,11 @@ async function evalInBridge(bridge, code, opts = {}) {
|
|
|
48864
48869
|
if (opts.acquireLock) payload.acquireLock = true;
|
|
48865
48870
|
return bridge.send(payload);
|
|
48866
48871
|
}
|
|
48867
|
-
async function callInBridge(bridge,
|
|
48868
|
-
return bridge.send({ type: "call", path:
|
|
48872
|
+
async function callInBridge(bridge, path39, ...args) {
|
|
48873
|
+
return bridge.send({ type: "call", path: path39, args });
|
|
48869
48874
|
}
|
|
48870
|
-
async function callInBridgeWrite(bridge,
|
|
48871
|
-
return bridge.send({ type: "call", path:
|
|
48875
|
+
async function callInBridgeWrite(bridge, path39, ...args) {
|
|
48876
|
+
return bridge.send({ type: "call", path: path39, args, acquireLock: true });
|
|
48872
48877
|
}
|
|
48873
48878
|
var import_node_fs32, import_node_path33, import_ws2, PEACH_PLACEMENT_ENV, resolvedWorld, BridgeSimLockedError, DisconnectedSimError, BRIDGE_VALUE_FLAGS_TABLE, BRIDGE_VALUE_FLAGS;
|
|
48874
48879
|
var init_ws_bridge = __esm({
|
|
@@ -49005,8 +49010,8 @@ function getDefaultPortForProtocol(protocol) {
|
|
|
49005
49010
|
return protocol === "https:" ? 443 : 80;
|
|
49006
49011
|
}
|
|
49007
49012
|
function isBaseServerUrl(url) {
|
|
49008
|
-
const
|
|
49009
|
-
return (
|
|
49013
|
+
const path39 = url.pathname || "/";
|
|
49014
|
+
return (path39 === "/" || path39 === "") && !url.search && !url.hash;
|
|
49010
49015
|
}
|
|
49011
49016
|
async function resolvePortViaServerScan(port) {
|
|
49012
49017
|
try {
|
|
@@ -49307,6 +49312,165 @@ var init_flow_timeout_scale = __esm({
|
|
|
49307
49312
|
}
|
|
49308
49313
|
});
|
|
49309
49314
|
|
|
49315
|
+
// src/native-firebase-config.ts
|
|
49316
|
+
function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"]) {
|
|
49317
|
+
const result = {};
|
|
49318
|
+
let config = {};
|
|
49319
|
+
const appJsonPath = import_node_path35.default.join(projectRoot, "app.json");
|
|
49320
|
+
const appJson = import_node_fs34.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs34.default.readFileSync(appJsonPath, "utf8")) : null;
|
|
49321
|
+
const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
|
|
49322
|
+
(value) => isRecord(value) && typeof value.googleServicesFile === "string"
|
|
49323
|
+
));
|
|
49324
|
+
const dynamicExpo = [
|
|
49325
|
+
"app.config.js",
|
|
49326
|
+
"app.config.ts",
|
|
49327
|
+
"app.config.cjs",
|
|
49328
|
+
"app.config.mjs"
|
|
49329
|
+
].some((name2) => import_node_fs34.default.existsSync(import_node_path35.default.join(projectRoot, name2)));
|
|
49330
|
+
if (staticExpo || dynamicExpo) {
|
|
49331
|
+
const require4 = (0, import_node_module2.createRequire)(import_node_path35.default.join(projectRoot, "package.json"));
|
|
49332
|
+
const configModule = require4("@expo/config");
|
|
49333
|
+
if (!isRecord(configModule) || typeof configModule.getConfig !== "function")
|
|
49334
|
+
throw new Error("Expo native configuration is unavailable.");
|
|
49335
|
+
const resolved = Reflect.apply(configModule.getConfig, configModule, [
|
|
49336
|
+
projectRoot,
|
|
49337
|
+
{ skipSDKVersionRequirement: true }
|
|
49338
|
+
]);
|
|
49339
|
+
config = isRecord(resolved) && isRecord(resolved.exp) ? resolved.exp : {};
|
|
49340
|
+
}
|
|
49341
|
+
const ios = config.ios;
|
|
49342
|
+
if (platforms.includes("ios") && (!isRecord(ios) || typeof ios.googleServicesFile !== "string")) {
|
|
49343
|
+
const iosRoot = import_node_path35.default.join(projectRoot, "ios");
|
|
49344
|
+
if (import_node_fs34.default.existsSync(iosRoot)) {
|
|
49345
|
+
const projects2 = import_node_fs34.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
|
|
49346
|
+
if (projects2.length > 1)
|
|
49347
|
+
throw new Error("native Firebase configuration requires a selected Xcode project");
|
|
49348
|
+
if (projects2.length === 1) {
|
|
49349
|
+
const xcodeproj = import_node_path35.default.join(iosRoot, projects2[0].name);
|
|
49350
|
+
const appTargets = listXcodeAppTargets(xcodeproj);
|
|
49351
|
+
if (appTargets.length > 1)
|
|
49352
|
+
throw new Error("native Firebase configuration requires a selected app target");
|
|
49353
|
+
if (appTargets.length === 1) {
|
|
49354
|
+
const app = readXcodeAppTarget(xcodeproj, appTargets[0]);
|
|
49355
|
+
const delegates = app.allSources.filter(
|
|
49356
|
+
(file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path35.default.basename(file))
|
|
49357
|
+
);
|
|
49358
|
+
const defaultConfigured = delegates.some((file) => {
|
|
49359
|
+
const source = import_node_fs34.default.readFileSync(file, "utf8").replace(
|
|
49360
|
+
/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"(?:\\.|[^"\\])*"/g,
|
|
49361
|
+
(token) => token.startsWith('"') ? '""' : token.replace(/[^\n]/g, " ")
|
|
49362
|
+
);
|
|
49363
|
+
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(
|
|
49364
|
+
source
|
|
49365
|
+
);
|
|
49366
|
+
if (!launch2) return false;
|
|
49367
|
+
const body = source.slice(launch2.index + launch2[0].length);
|
|
49368
|
+
const configure = /^\s*(?:FirebaseApp\s*\.\s*configure\s*\(\s*\)|\[FIRApp\s+configure\])/m.exec(
|
|
49369
|
+
body
|
|
49370
|
+
);
|
|
49371
|
+
if (!configure) return false;
|
|
49372
|
+
const before = body.slice(0, configure.index);
|
|
49373
|
+
let depth = 1;
|
|
49374
|
+
for (const token of before) {
|
|
49375
|
+
if (token === "{") depth += 1;
|
|
49376
|
+
if (token === "}") depth -= 1;
|
|
49377
|
+
if (depth === 0) return false;
|
|
49378
|
+
}
|
|
49379
|
+
if (depth !== 1 || /\b(?:return|throw)\b|^\s*#(?:if|elseif|else)/m.test(before))
|
|
49380
|
+
throw new Error(
|
|
49381
|
+
"native Firebase initialization must be unconditional in the app launch method"
|
|
49382
|
+
);
|
|
49383
|
+
return true;
|
|
49384
|
+
});
|
|
49385
|
+
if (defaultConfigured) {
|
|
49386
|
+
const resources = app.resources.filter(
|
|
49387
|
+
(file) => /^GoogleService-Info\.plist$/.test(import_node_path35.default.basename(file))
|
|
49388
|
+
);
|
|
49389
|
+
if (resources.length !== 1)
|
|
49390
|
+
throw new Error(
|
|
49391
|
+
"native Firebase default initialization requires one GoogleService-Info.plist build resource"
|
|
49392
|
+
);
|
|
49393
|
+
config.ios = {
|
|
49394
|
+
googleServicesFile: import_node_path35.default.relative(
|
|
49395
|
+
import_node_fs34.default.realpathSync(projectRoot),
|
|
49396
|
+
resources[0]
|
|
49397
|
+
)
|
|
49398
|
+
};
|
|
49399
|
+
}
|
|
49400
|
+
}
|
|
49401
|
+
}
|
|
49402
|
+
}
|
|
49403
|
+
}
|
|
49404
|
+
for (const platform of platforms) {
|
|
49405
|
+
const native = config[platform];
|
|
49406
|
+
if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
|
|
49407
|
+
try {
|
|
49408
|
+
const source = import_node_fs34.default.readFileSync(
|
|
49409
|
+
import_node_path35.default.resolve(projectRoot, native.googleServicesFile),
|
|
49410
|
+
"utf8"
|
|
49411
|
+
);
|
|
49412
|
+
const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
|
|
49413
|
+
if (!isRecord(parsed)) throw new Error("Invalid Google services file.");
|
|
49414
|
+
if (platform === "ios") {
|
|
49415
|
+
result[platform] = {
|
|
49416
|
+
apiKey: parsed.API_KEY,
|
|
49417
|
+
appId: parsed.GOOGLE_APP_ID,
|
|
49418
|
+
projectId: parsed.PROJECT_ID,
|
|
49419
|
+
databaseURL: parsed.DATABASE_URL,
|
|
49420
|
+
gaTrackingId: parsed.TRACKING_ID,
|
|
49421
|
+
storageBucket: parsed.STORAGE_BUCKET,
|
|
49422
|
+
messagingSenderId: parsed.GCM_SENDER_ID,
|
|
49423
|
+
clientId: parsed.CLIENT_ID,
|
|
49424
|
+
androidClientID: parsed.ANDROID_CLIENT_ID,
|
|
49425
|
+
deepLinkUrlScheme: parsed.REVERSED_CLIENT_ID
|
|
49426
|
+
};
|
|
49427
|
+
} else {
|
|
49428
|
+
const project = isRecord(parsed.project_info) ? parsed.project_info : {};
|
|
49429
|
+
const clients = Array.isArray(parsed.client) ? parsed.client : [];
|
|
49430
|
+
const client = clients.find((value) => {
|
|
49431
|
+
if (!isRecord(value) || !isRecord(value.client_info)) return false;
|
|
49432
|
+
const android = value.client_info.android_client_info;
|
|
49433
|
+
return isRecord(android) && android.package_name === native.package;
|
|
49434
|
+
});
|
|
49435
|
+
if (!isRecord(client) || !isRecord(client.client_info))
|
|
49436
|
+
throw new Error("No Google services client matches the Android package.");
|
|
49437
|
+
const apiKeys = Array.isArray(client.api_key) ? client.api_key : [];
|
|
49438
|
+
const apiKey = apiKeys.find(
|
|
49439
|
+
(value) => isRecord(value) && typeof value.current_key === "string"
|
|
49440
|
+
);
|
|
49441
|
+
const oauthClients = Array.isArray(client.oauth_client) ? client.oauth_client : [];
|
|
49442
|
+
const oauth = oauthClients.find(
|
|
49443
|
+
(value) => isRecord(value) && value.client_type === 3
|
|
49444
|
+
);
|
|
49445
|
+
result[platform] = {
|
|
49446
|
+
apiKey: isRecord(apiKey) ? apiKey.current_key : void 0,
|
|
49447
|
+
appId: client.client_info.mobilesdk_app_id,
|
|
49448
|
+
projectId: project.project_id,
|
|
49449
|
+
databaseURL: project.firebase_url,
|
|
49450
|
+
storageBucket: project.storage_bucket,
|
|
49451
|
+
messagingSenderId: project.project_number,
|
|
49452
|
+
clientId: isRecord(oauth) ? oauth.client_id : void 0
|
|
49453
|
+
};
|
|
49454
|
+
}
|
|
49455
|
+
} catch (error) {
|
|
49456
|
+
result[platform] = { error: error instanceof Error ? error.message : String(error) };
|
|
49457
|
+
}
|
|
49458
|
+
}
|
|
49459
|
+
return result;
|
|
49460
|
+
}
|
|
49461
|
+
var import_node_fs34, import_node_module2, import_node_path35;
|
|
49462
|
+
var init_native_firebase_config = __esm({
|
|
49463
|
+
"src/native-firebase-config.ts"() {
|
|
49464
|
+
"use strict";
|
|
49465
|
+
import_node_fs34 = __toESM(require("node:fs"), 1);
|
|
49466
|
+
import_node_module2 = require("node:module");
|
|
49467
|
+
import_node_path35 = __toESM(require("node:path"), 1);
|
|
49468
|
+
init_is_record();
|
|
49469
|
+
init_plist();
|
|
49470
|
+
init_xcode_project();
|
|
49471
|
+
}
|
|
49472
|
+
});
|
|
49473
|
+
|
|
49310
49474
|
// src/profiles.ts
|
|
49311
49475
|
function normalizeProfileId(input) {
|
|
49312
49476
|
const id = input.trim();
|
|
@@ -49414,59 +49578,59 @@ var init_profiles = __esm({
|
|
|
49414
49578
|
// cli/app-catalog.ts
|
|
49415
49579
|
function listDir(dir) {
|
|
49416
49580
|
try {
|
|
49417
|
-
return
|
|
49581
|
+
return import_node_fs35.default.readdirSync(dir, { withFileTypes: true });
|
|
49418
49582
|
} catch {
|
|
49419
49583
|
return [];
|
|
49420
49584
|
}
|
|
49421
49585
|
}
|
|
49422
49586
|
function readText(file) {
|
|
49423
49587
|
try {
|
|
49424
|
-
return
|
|
49588
|
+
return import_node_fs35.default.readFileSync(file, "utf8");
|
|
49425
49589
|
} catch {
|
|
49426
49590
|
return null;
|
|
49427
49591
|
}
|
|
49428
49592
|
}
|
|
49429
49593
|
function catalogFiles(dir, found) {
|
|
49430
49594
|
for (const entry of listDir(dir)) {
|
|
49431
|
-
const full =
|
|
49595
|
+
const full = import_node_path36.default.join(dir, entry.name);
|
|
49432
49596
|
if (entry.isDirectory()) catalogFiles(full, found);
|
|
49433
49597
|
else if (entry.name === "Contents.json") found.push(full);
|
|
49434
49598
|
}
|
|
49435
49599
|
}
|
|
49436
49600
|
function discoverAppCatalog(appDir) {
|
|
49437
|
-
const iosDir =
|
|
49601
|
+
const iosDir = import_node_path36.default.join(appDir, "ios");
|
|
49438
49602
|
const target = listDir(iosDir).find(
|
|
49439
|
-
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir(
|
|
49603
|
+
(entry) => entry.isDirectory() && entry.name !== "Pods" && listDir(import_node_path36.default.join(iosDir, entry.name)).some(
|
|
49440
49604
|
(file) => /^AppDelegate\.(swift|mm|m)$/.test(file.name)
|
|
49441
49605
|
)
|
|
49442
49606
|
);
|
|
49443
49607
|
if (!target) return null;
|
|
49444
|
-
const targetDir =
|
|
49608
|
+
const targetDir = import_node_path36.default.join(iosDir, target.name);
|
|
49445
49609
|
const files2 = [];
|
|
49446
49610
|
for (const entry of listDir(targetDir)) {
|
|
49447
49611
|
if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
|
|
49448
|
-
catalogFiles(
|
|
49612
|
+
catalogFiles(import_node_path36.default.join(targetDir, entry.name), files2);
|
|
49449
49613
|
}
|
|
49450
49614
|
const relative3 = files2.map(
|
|
49451
|
-
(file) =>
|
|
49615
|
+
(file) => import_node_path36.default.relative(targetDir, file).split(import_node_path36.default.sep).join(import_node_path36.default.posix.sep)
|
|
49452
49616
|
);
|
|
49453
49617
|
const colors = enumerateBundleColors(
|
|
49454
49618
|
relative3,
|
|
49455
|
-
(candidate) => candidate.endsWith("Contents.json") ? readText(
|
|
49619
|
+
(candidate) => candidate.endsWith("Contents.json") ? readText(import_node_path36.default.join(targetDir, candidate)) : null
|
|
49456
49620
|
);
|
|
49457
49621
|
const pbxproj = listDir(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
|
|
49458
|
-
const accentName = readText(
|
|
49622
|
+
const accentName = readText(import_node_path36.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path36.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
|
|
49459
49623
|
ACCENT_BUILD_SETTING
|
|
49460
49624
|
)?.[1] : void 0) ?? null;
|
|
49461
49625
|
if (accentName === null && Object.keys(colors).length === 0) return null;
|
|
49462
49626
|
return { colors, accentName };
|
|
49463
49627
|
}
|
|
49464
|
-
var
|
|
49628
|
+
var import_node_fs35, import_node_path36, ACCENT_BUILD_SETTING, PLIST_ACCENT;
|
|
49465
49629
|
var init_app_catalog = __esm({
|
|
49466
49630
|
"cli/app-catalog.ts"() {
|
|
49467
49631
|
"use strict";
|
|
49468
|
-
|
|
49469
|
-
|
|
49632
|
+
import_node_fs35 = __toESM(require("node:fs"), 1);
|
|
49633
|
+
import_node_path36 = __toESM(require("node:path"), 1);
|
|
49470
49634
|
init_bundleAssets();
|
|
49471
49635
|
ACCENT_BUILD_SETTING = /ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "?([^";]+)"?;/;
|
|
49472
49636
|
PLIST_ACCENT = /<key>NSAccentColorName<\/key>\s*<string>([^<]+)<\/string>/;
|
|
@@ -49476,9 +49640,9 @@ var init_app_catalog = __esm({
|
|
|
49476
49640
|
// cli/app-project.ts
|
|
49477
49641
|
function firstNamedFile(dir, names) {
|
|
49478
49642
|
for (const name2 of names) {
|
|
49479
|
-
const candidate =
|
|
49643
|
+
const candidate = import_node_path37.default.join(dir, name2);
|
|
49480
49644
|
try {
|
|
49481
|
-
if (
|
|
49645
|
+
if (import_node_fs36.default.statSync(candidate).isFile()) return candidate;
|
|
49482
49646
|
} catch {
|
|
49483
49647
|
}
|
|
49484
49648
|
}
|
|
@@ -49491,24 +49655,24 @@ function findRNXAppConfig(dir) {
|
|
|
49491
49655
|
return firstNamedFile(dir, PEACH_APP_CONFIG_NAMES);
|
|
49492
49656
|
}
|
|
49493
49657
|
function resolveAppProject(projectRoot) {
|
|
49494
|
-
const appDir =
|
|
49658
|
+
const appDir = import_node_path37.default.resolve(projectRoot);
|
|
49495
49659
|
try {
|
|
49496
|
-
if (!
|
|
49660
|
+
if (!import_node_fs36.default.statSync(appDir).isDirectory()) return null;
|
|
49497
49661
|
} catch {
|
|
49498
49662
|
return null;
|
|
49499
49663
|
}
|
|
49500
49664
|
const configPath = findRNXAppConfig(appDir);
|
|
49501
|
-
if (!configPath && !findExpoAppConfig(appDir) && !
|
|
49665
|
+
if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs36.default.existsSync(import_node_path37.default.join(appDir, "package.json"))) {
|
|
49502
49666
|
return null;
|
|
49503
49667
|
}
|
|
49504
49668
|
return { appDir, configPath };
|
|
49505
49669
|
}
|
|
49506
|
-
var
|
|
49670
|
+
var import_node_fs36, import_node_path37, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
|
|
49507
49671
|
var init_app_project = __esm({
|
|
49508
49672
|
"cli/app-project.ts"() {
|
|
49509
49673
|
"use strict";
|
|
49510
|
-
|
|
49511
|
-
|
|
49674
|
+
import_node_fs36 = __toESM(require("node:fs"), 1);
|
|
49675
|
+
import_node_path37 = __toESM(require("node:path"), 1);
|
|
49512
49676
|
EXPO_APP_CONFIG_NAMES = [
|
|
49513
49677
|
"app.config.js",
|
|
49514
49678
|
"app.config.ts",
|
|
@@ -49531,12 +49695,12 @@ function resolveFileEntries(entries, configDir) {
|
|
|
49531
49695
|
return Object.fromEntries(
|
|
49532
49696
|
Object.entries(entries).map(([name2, resolution]) => [
|
|
49533
49697
|
name2,
|
|
49534
|
-
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file:
|
|
49698
|
+
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path38.default.resolve(configDir, resolution.file) } : resolution
|
|
49535
49699
|
])
|
|
49536
49700
|
);
|
|
49537
49701
|
}
|
|
49538
49702
|
function resolveConfigReplacementFiles(config, configPath) {
|
|
49539
|
-
const configDir =
|
|
49703
|
+
const configDir = import_node_path38.default.dirname(configPath);
|
|
49540
49704
|
return {
|
|
49541
49705
|
...config,
|
|
49542
49706
|
modules: resolveFileEntries(config.modules, configDir),
|
|
@@ -49571,11 +49735,11 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
|
|
|
49571
49735
|
const project = resolveAppProject(startDir);
|
|
49572
49736
|
return { project, config: await loadRNXAppConfig(project) };
|
|
49573
49737
|
}
|
|
49574
|
-
var
|
|
49738
|
+
var import_node_path38, import_jiti;
|
|
49575
49739
|
var init_app_config = __esm({
|
|
49576
49740
|
"cli/app-config.ts"() {
|
|
49577
49741
|
"use strict";
|
|
49578
|
-
|
|
49742
|
+
import_node_path38 = __toESM(require("node:path"), 1);
|
|
49579
49743
|
import_jiti = require("jiti");
|
|
49580
49744
|
init_config();
|
|
49581
49745
|
init_config();
|
|
@@ -49635,13 +49799,13 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49635
49799
|
scannedFontDirectories++;
|
|
49636
49800
|
let entries;
|
|
49637
49801
|
try {
|
|
49638
|
-
entries =
|
|
49802
|
+
entries = import_node_fs37.default.readdirSync(current.dir, { withFileTypes: true });
|
|
49639
49803
|
} catch {
|
|
49640
49804
|
continue;
|
|
49641
49805
|
}
|
|
49642
49806
|
for (const entry of entries) {
|
|
49643
49807
|
if (entry.isSymbolicLink()) continue;
|
|
49644
|
-
const fullPath =
|
|
49808
|
+
const fullPath = import_node_path39.default.join(current.dir, entry.name);
|
|
49645
49809
|
if (entry.isDirectory()) {
|
|
49646
49810
|
if (current.depth < 4 && pending.length < 64 && !entry.name.startsWith(".")) {
|
|
49647
49811
|
pending.push({ dir: fullPath, depth: current.depth + 1 });
|
|
@@ -49649,15 +49813,15 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49649
49813
|
continue;
|
|
49650
49814
|
}
|
|
49651
49815
|
if (!entry.isFile() || !/\.(ttf|otf|woff|woff2)$/i.test(entry.name)) continue;
|
|
49652
|
-
const relative3 =
|
|
49653
|
-
fontPaths.push(
|
|
49816
|
+
const relative3 = import_node_path39.default.relative(root, fullPath).split(import_node_path39.default.sep).join("/");
|
|
49817
|
+
fontPaths.push(import_node_path39.default.posix.join(metroPathPrefix, relative3));
|
|
49654
49818
|
if (fontPaths.length >= 256) break;
|
|
49655
49819
|
}
|
|
49656
49820
|
}
|
|
49657
49821
|
};
|
|
49658
49822
|
try {
|
|
49659
49823
|
const packageJson = JSON.parse(
|
|
49660
|
-
|
|
49824
|
+
import_node_fs37.default.readFileSync(import_node_path39.default.join(selectedAppDir, "package.json"), "utf8")
|
|
49661
49825
|
);
|
|
49662
49826
|
const dependencyNames = /* @__PURE__ */ new Set();
|
|
49663
49827
|
for (const field of ["dependencies", "devDependencies", "optionalDependencies"]) {
|
|
@@ -49672,32 +49836,32 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49672
49836
|
const config = Reflect.get(packageJson, "reactNativeVectorIcons");
|
|
49673
49837
|
const configuredFontDir = config && typeof config === "object" ? Reflect.get(config, "fontDir") : null;
|
|
49674
49838
|
const configuredDir = typeof configuredFontDir === "string" ? configuredFontDir : "rnvi-fonts";
|
|
49675
|
-
const root =
|
|
49676
|
-
const relativeRoot =
|
|
49677
|
-
if (!relativeRoot.startsWith("..") && !
|
|
49678
|
-
collectFontFiles(root, relativeRoot.split(
|
|
49839
|
+
const root = import_node_path39.default.resolve(selectedAppDir, configuredDir);
|
|
49840
|
+
const relativeRoot = import_node_path39.default.relative(selectedAppDir, root);
|
|
49841
|
+
if (!relativeRoot.startsWith("..") && !import_node_path39.default.isAbsolute(relativeRoot)) {
|
|
49842
|
+
collectFontFiles(root, relativeRoot.split(import_node_path39.default.sep).join("/"));
|
|
49679
49843
|
}
|
|
49680
|
-
const bundleDir =
|
|
49681
|
-
const appRelativeDir = bundleDir.split("/").join(
|
|
49844
|
+
const bundleDir = import_node_path39.default.posix.dirname(opts.bundleUrl ? new URL(opts.bundleUrl).pathname : "/").replace(/^\/+/, "");
|
|
49845
|
+
const appRelativeDir = bundleDir.split("/").join(import_node_path39.default.sep);
|
|
49682
49846
|
const metroRootCandidates = [selectedAppDir];
|
|
49683
|
-
if (bundleDir && selectedAppDir.endsWith(
|
|
49847
|
+
if (bundleDir && selectedAppDir.endsWith(import_node_path39.default.sep + appRelativeDir)) {
|
|
49684
49848
|
metroRootCandidates.push(selectedAppDir.slice(0, -appRelativeDir.length - 1));
|
|
49685
49849
|
}
|
|
49686
|
-
const vectorIconRequire = (0,
|
|
49850
|
+
const vectorIconRequire = (0, import_node_module3.createRequire)(import_node_path39.default.join(selectedAppDir, "package.json"));
|
|
49687
49851
|
for (const dependencyName of vectorIconDependencies) {
|
|
49688
49852
|
try {
|
|
49689
49853
|
const entryPath = vectorIconRequire.resolve(dependencyName);
|
|
49690
|
-
const dependencyPath = dependencyName.split("/").join(
|
|
49691
|
-
const marker = `${
|
|
49854
|
+
const dependencyPath = dependencyName.split("/").join(import_node_path39.default.sep);
|
|
49855
|
+
const marker = `${import_node_path39.default.sep}node_modules${import_node_path39.default.sep}${dependencyPath}${import_node_path39.default.sep}`;
|
|
49692
49856
|
const markerIndex = entryPath.lastIndexOf(marker);
|
|
49693
49857
|
if (markerIndex === -1) continue;
|
|
49694
49858
|
const packageRoot = entryPath.slice(0, markerIndex + marker.length - 1);
|
|
49695
49859
|
const fontsDir = dependencyName === "react-native-vector-icons" ? "Fonts" : "fonts";
|
|
49696
|
-
const fontsRoot =
|
|
49860
|
+
const fontsRoot = import_node_path39.default.join(packageRoot, fontsDir);
|
|
49697
49861
|
for (const metroRoot of metroRootCandidates) {
|
|
49698
49862
|
collectFontFiles(
|
|
49699
49863
|
fontsRoot,
|
|
49700
|
-
|
|
49864
|
+
import_node_path39.default.relative(metroRoot, fontsRoot).split(import_node_path39.default.sep).join("/")
|
|
49701
49865
|
);
|
|
49702
49866
|
}
|
|
49703
49867
|
} catch {
|
|
@@ -49707,37 +49871,37 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49707
49871
|
} catch {
|
|
49708
49872
|
}
|
|
49709
49873
|
try {
|
|
49710
|
-
const configPath =
|
|
49711
|
-
if (
|
|
49712
|
-
const appConfigRequire = (0,
|
|
49874
|
+
const configPath = import_node_path39.default.join(selectedAppDir, "react-native.config.js");
|
|
49875
|
+
if (import_node_fs37.default.statSync(configPath).isFile()) {
|
|
49876
|
+
const appConfigRequire = (0, import_node_module3.createRequire)(import_node_path39.default.join(selectedAppDir, "package.json"));
|
|
49713
49877
|
const rnConfig = appConfigRequire(configPath);
|
|
49714
49878
|
const assets2 = rnConfig && typeof rnConfig === "object" ? Reflect.get(rnConfig, "assets") : null;
|
|
49715
49879
|
if (Array.isArray(assets2)) {
|
|
49716
49880
|
for (const assetDir of assets2) {
|
|
49717
49881
|
if (typeof assetDir !== "string") continue;
|
|
49718
|
-
const root =
|
|
49719
|
-
const relativeRoot =
|
|
49720
|
-
if (relativeRoot.startsWith("..") ||
|
|
49721
|
-
collectFontFiles(root, relativeRoot.split(
|
|
49882
|
+
const root = import_node_path39.default.resolve(selectedAppDir, assetDir);
|
|
49883
|
+
const relativeRoot = import_node_path39.default.relative(selectedAppDir, root);
|
|
49884
|
+
if (relativeRoot.startsWith("..") || import_node_path39.default.isAbsolute(relativeRoot)) continue;
|
|
49885
|
+
collectFontFiles(root, relativeRoot.split(import_node_path39.default.sep).join("/"));
|
|
49722
49886
|
}
|
|
49723
49887
|
}
|
|
49724
49888
|
}
|
|
49725
49889
|
} catch {
|
|
49726
49890
|
}
|
|
49727
49891
|
if (platform === "ios") {
|
|
49728
|
-
const iosDir =
|
|
49892
|
+
const iosDir = import_node_path39.default.join(selectedAppDir, "ios");
|
|
49729
49893
|
try {
|
|
49730
|
-
const targetDirs =
|
|
49894
|
+
const targetDirs = import_node_fs37.default.readdirSync(iosDir, { withFileTypes: true }).filter(
|
|
49731
49895
|
(entry) => entry.isDirectory() && !entry.isSymbolicLink() && entry.name !== "Pods" && entry.name !== "build" && !entry.name.startsWith(".")
|
|
49732
49896
|
).slice(0, 64);
|
|
49733
|
-
const plistPaths = [
|
|
49897
|
+
const plistPaths = [import_node_path39.default.join(iosDir, "Info.plist")];
|
|
49734
49898
|
for (const entry of targetDirs) {
|
|
49735
|
-
plistPaths.push(
|
|
49899
|
+
plistPaths.push(import_node_path39.default.join(iosDir, entry.name, "Info.plist"));
|
|
49736
49900
|
}
|
|
49737
49901
|
for (const plistPath of plistPaths) {
|
|
49738
49902
|
let parsed;
|
|
49739
49903
|
try {
|
|
49740
|
-
parsed = parsePlistSource(
|
|
49904
|
+
parsed = parsePlistSource(import_node_fs37.default.readFileSync(plistPath, "utf8"));
|
|
49741
49905
|
} catch {
|
|
49742
49906
|
continue;
|
|
49743
49907
|
}
|
|
@@ -49747,21 +49911,21 @@ function discoverNativeLinkedAppFontPaths(opts) {
|
|
|
49747
49911
|
for (const declaredFont of declaredFonts) {
|
|
49748
49912
|
if (typeof declaredFont !== "string") continue;
|
|
49749
49913
|
const candidates = [
|
|
49750
|
-
|
|
49751
|
-
|
|
49914
|
+
import_node_path39.default.resolve(import_node_path39.default.dirname(plistPath), declaredFont),
|
|
49915
|
+
import_node_path39.default.resolve(iosDir, declaredFont)
|
|
49752
49916
|
];
|
|
49753
49917
|
const fontPath = candidates.find((candidate) => {
|
|
49754
|
-
const relative3 =
|
|
49755
|
-
if (relative3.startsWith("..") ||
|
|
49918
|
+
const relative3 = import_node_path39.default.relative(selectedAppDir, candidate);
|
|
49919
|
+
if (relative3.startsWith("..") || import_node_path39.default.isAbsolute(relative3)) return false;
|
|
49756
49920
|
try {
|
|
49757
|
-
return
|
|
49921
|
+
return import_node_fs37.default.statSync(candidate).isFile();
|
|
49758
49922
|
} catch {
|
|
49759
49923
|
return false;
|
|
49760
49924
|
}
|
|
49761
49925
|
});
|
|
49762
49926
|
if (!fontPath) continue;
|
|
49763
49927
|
fontPaths.push(
|
|
49764
|
-
|
|
49928
|
+
import_node_path39.default.relative(selectedAppDir, fontPath).split(import_node_path39.default.sep).join("/")
|
|
49765
49929
|
);
|
|
49766
49930
|
}
|
|
49767
49931
|
}
|
|
@@ -49803,19 +49967,19 @@ async function resolveMetroProjectRoot(bundleUrl, opts) {
|
|
|
49803
49967
|
function encodeAppFontsWire(specs) {
|
|
49804
49968
|
return specs.map((spec) => `${encodeURIComponent(spec.url)}::${encodeURIComponent(spec.family)}`).join(",");
|
|
49805
49969
|
}
|
|
49806
|
-
var
|
|
49970
|
+
var import_node_fs37, import_node_module3, import_node_path39, import_config_plugin_fonts, require2;
|
|
49807
49971
|
var init_app_fonts = __esm({
|
|
49808
49972
|
"cli/app-fonts.ts"() {
|
|
49809
49973
|
"use strict";
|
|
49810
|
-
|
|
49811
|
-
|
|
49812
|
-
|
|
49974
|
+
import_node_fs37 = __toESM(require("node:fs"), 1);
|
|
49975
|
+
import_node_module3 = require("node:module");
|
|
49976
|
+
import_node_path39 = __toESM(require("node:path"), 1);
|
|
49813
49977
|
import_config_plugin_fonts = require("peach-engine/engine/config-plugin-fonts");
|
|
49814
49978
|
init_dev_server_scanner();
|
|
49815
49979
|
init_backend_origin();
|
|
49816
49980
|
init_plist();
|
|
49817
49981
|
init_app_project();
|
|
49818
|
-
require2 = (0,
|
|
49982
|
+
require2 = (0, import_node_module3.createRequire)(__sootsim_import_meta_url);
|
|
49819
49983
|
}
|
|
49820
49984
|
});
|
|
49821
49985
|
|
|
@@ -49884,15 +50048,15 @@ function splashImageUrls(spec) {
|
|
|
49884
50048
|
if (spec.dark?.backgroundImageUrl) urls.add(spec.dark.backgroundImageUrl);
|
|
49885
50049
|
return [...urls];
|
|
49886
50050
|
}
|
|
49887
|
-
var
|
|
50051
|
+
var import_node_module4, import_config_plugin_splash, require3;
|
|
49888
50052
|
var init_app_splash = __esm({
|
|
49889
50053
|
"cli/app-splash.ts"() {
|
|
49890
50054
|
"use strict";
|
|
49891
|
-
|
|
50055
|
+
import_node_module4 = require("node:module");
|
|
49892
50056
|
import_config_plugin_splash = require("peach-engine/engine/config-plugin-splash");
|
|
49893
50057
|
init_backend_origin();
|
|
49894
50058
|
init_app_project();
|
|
49895
|
-
require3 = (0,
|
|
50059
|
+
require3 = (0, import_node_module4.createRequire)(__sootsim_import_meta_url);
|
|
49896
50060
|
}
|
|
49897
50061
|
});
|
|
49898
50062
|
|
|
@@ -50749,7 +50913,7 @@ function desktopHostExecutable() {
|
|
|
50749
50913
|
function bundleValue(app, key2) {
|
|
50750
50914
|
const read = (0, import_node_child_process13.spawnSync)(
|
|
50751
50915
|
"plutil",
|
|
50752
|
-
["-extract", key2, "raw", "-o", "-",
|
|
50916
|
+
["-extract", key2, "raw", "-o", "-", import_node_path40.default.join(app, "Contents/Info.plist")],
|
|
50753
50917
|
{ encoding: "utf8" }
|
|
50754
50918
|
);
|
|
50755
50919
|
return read.status === 0 ? read.stdout.trim() : null;
|
|
@@ -50760,8 +50924,8 @@ function isNativeHostBundle(app) {
|
|
|
50760
50924
|
function placedHostVersion() {
|
|
50761
50925
|
if (desktopHostPlatform() === "linux-x64") {
|
|
50762
50926
|
try {
|
|
50763
|
-
const version =
|
|
50764
|
-
return /^\d+\.\d+$/.test(version) &&
|
|
50927
|
+
const version = import_node_fs38.default.readFileSync(import_node_path40.default.join(desktopHostsDir(), "active"), "utf8").trim();
|
|
50928
|
+
return /^\d+\.\d+$/.test(version) && import_node_fs38.default.existsSync(import_node_path40.default.join(desktopHostDir(version), desktopHostExecutable())) ? version : null;
|
|
50765
50929
|
} catch {
|
|
50766
50930
|
return null;
|
|
50767
50931
|
}
|
|
@@ -50777,18 +50941,18 @@ function headlessHostCommand() {
|
|
|
50777
50941
|
if (!version) return null;
|
|
50778
50942
|
const dir = desktopHostDir(version);
|
|
50779
50943
|
return [
|
|
50780
|
-
|
|
50944
|
+
import_node_path40.default.join(dir, "bin/node"),
|
|
50781
50945
|
"--experimental-vm-modules",
|
|
50782
|
-
|
|
50946
|
+
import_node_path40.default.join(dir, "node/host.mjs")
|
|
50783
50947
|
];
|
|
50784
50948
|
}
|
|
50785
|
-
var import_node_child_process13,
|
|
50949
|
+
var import_node_child_process13, import_node_fs38, import_node_path40, MAC_HOST_APP, HOST_BUNDLE_ID;
|
|
50786
50950
|
var init_desktop_host_delivery = __esm({
|
|
50787
50951
|
"src/desktop-host-delivery.ts"() {
|
|
50788
50952
|
"use strict";
|
|
50789
50953
|
import_node_child_process13 = require("node:child_process");
|
|
50790
|
-
|
|
50791
|
-
|
|
50954
|
+
import_node_fs38 = __toESM(require("node:fs"), 1);
|
|
50955
|
+
import_node_path40 = __toESM(require("node:path"), 1);
|
|
50792
50956
|
init_src();
|
|
50793
50957
|
init_home_paths();
|
|
50794
50958
|
MAC_HOST_APP = "/Applications/Peach.app";
|
|
@@ -52336,8 +52500,8 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
|
|
|
52336
52500
|
};
|
|
52337
52501
|
}
|
|
52338
52502
|
const lock = parseLinuxBrowserLibsLock(linux_browser_libs_lock_default);
|
|
52339
|
-
const dir = (0,
|
|
52340
|
-
if (!(0,
|
|
52503
|
+
const dir = (0, import_node_path41.join)(rnxHomeDir(), "linux-libs", `${lock.id}-${arch}`);
|
|
52504
|
+
if (!(0, import_node_fs39.existsSync)((0, import_node_path41.join)(dir, LINUX_BROWSER_LIBS_MARKER))) {
|
|
52341
52505
|
const url = `${DEFAULT_CLI_RELEASE_ORIGIN}/${linuxBrowserLibsKey(lock.id, arch)}`;
|
|
52342
52506
|
process.stderr.write(
|
|
52343
52507
|
`peach: this system lacks ${missing.length} shared libraries ${browser} links; downloading them\u2026
|
|
@@ -52365,7 +52529,7 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
|
|
|
52365
52529
|
};
|
|
52366
52530
|
}
|
|
52367
52531
|
}
|
|
52368
|
-
const libraryPath = [(0,
|
|
52532
|
+
const libraryPath = [(0, import_node_path41.join)(dir, "lib"), (0, import_node_path41.join)(dir, "lib", "nss")].join(":");
|
|
52369
52533
|
const stillMissing = missingLibraries(executablePath, libraryPath);
|
|
52370
52534
|
if (stillMissing.length) {
|
|
52371
52535
|
return {
|
|
@@ -52375,13 +52539,13 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
|
|
|
52375
52539
|
}
|
|
52376
52540
|
return { ok: true, libraryPath };
|
|
52377
52541
|
}
|
|
52378
|
-
var import_node_child_process14,
|
|
52542
|
+
var import_node_child_process14, import_node_fs39, import_node_path41, LINUX_BROWSER_LIBS_ARCHES, LINUX_BROWSER_LIBS_MARKER;
|
|
52379
52543
|
var init_linux_browser_libs = __esm({
|
|
52380
52544
|
"cli/drivers/linux-browser-libs.ts"() {
|
|
52381
52545
|
"use strict";
|
|
52382
52546
|
import_node_child_process14 = require("node:child_process");
|
|
52383
|
-
|
|
52384
|
-
|
|
52547
|
+
import_node_fs39 = require("node:fs");
|
|
52548
|
+
import_node_path41 = require("node:path");
|
|
52385
52549
|
init_src();
|
|
52386
52550
|
init_home_paths();
|
|
52387
52551
|
init_is_record();
|
|
@@ -52400,18 +52564,18 @@ function resolvePlaywright() {
|
|
|
52400
52564
|
roots.push(`${playwrightCoreDir(PINNED_PLAYWRIGHT_CORE.version)}/`);
|
|
52401
52565
|
for (const root of roots) {
|
|
52402
52566
|
try {
|
|
52403
|
-
const requireFromRoot = (0,
|
|
52567
|
+
const requireFromRoot = (0, import_node_module5.createRequire)(root);
|
|
52404
52568
|
for (const spec of ["playwright", "playwright-chromium", "playwright-core"]) {
|
|
52405
52569
|
try {
|
|
52406
52570
|
const modulePath = requireFromRoot.resolve(spec);
|
|
52407
52571
|
const packageJsonPath = requireFromRoot.resolve(`${spec}/package.json`);
|
|
52408
|
-
const parsed = JSON.parse((0,
|
|
52572
|
+
const parsed = JSON.parse((0, import_node_fs40.readFileSync)(packageJsonPath, "utf8"));
|
|
52409
52573
|
if (!isRecord(parsed) || typeof parsed.version !== "string") continue;
|
|
52410
|
-
const corePackagePath = (0,
|
|
52574
|
+
const corePackagePath = (0, import_node_module5.createRequire)(modulePath).resolve(
|
|
52411
52575
|
"playwright-core/package.json"
|
|
52412
52576
|
);
|
|
52413
|
-
const cliPath = (0,
|
|
52414
|
-
if (!(0,
|
|
52577
|
+
const cliPath = (0, import_node_path42.join)((0, import_node_path42.dirname)(corePackagePath), "cli.js");
|
|
52578
|
+
if (!(0, import_node_fs40.existsSync)(cliPath)) continue;
|
|
52415
52579
|
return {
|
|
52416
52580
|
spec,
|
|
52417
52581
|
modulePath,
|
|
@@ -52439,7 +52603,7 @@ async function provisionPlaywright() {
|
|
|
52439
52603
|
await installVerifiedTarball({
|
|
52440
52604
|
url: `https://registry.npmjs.org/playwright-core/-/playwright-core-${version}.tgz`,
|
|
52441
52605
|
digest: { algorithm, encoding: "base64", value: digest },
|
|
52442
|
-
destDir: (0,
|
|
52606
|
+
destDir: (0, import_node_path42.join)(playwrightCoreDir(version), "node_modules", "playwright-core"),
|
|
52443
52607
|
installedMarker: "package.json",
|
|
52444
52608
|
// npm tarballs hold the package under a leading `package/`
|
|
52445
52609
|
stripComponents: 1,
|
|
@@ -52482,7 +52646,7 @@ function probeBrowser(resolved, env) {
|
|
|
52482
52646
|
return {
|
|
52483
52647
|
ok: true,
|
|
52484
52648
|
executablePath: parsed.executablePath,
|
|
52485
|
-
exists: parsed.exists && (0,
|
|
52649
|
+
exists: parsed.exists && (0, import_node_fs40.existsSync)(parsed.executablePath)
|
|
52486
52650
|
};
|
|
52487
52651
|
} catch (error) {
|
|
52488
52652
|
return {
|
|
@@ -52555,7 +52719,7 @@ async function launchProvisionedPlaywright() {
|
|
|
52555
52719
|
const env = { ...process.env };
|
|
52556
52720
|
const browser = await ensurePlaywrightBrowser(resolved, softwareChromeAllowed(), env);
|
|
52557
52721
|
if (!browser.ok) throw new Error(browser.message);
|
|
52558
|
-
const playwright = (0,
|
|
52722
|
+
const playwright = (0, import_node_module5.createRequire)(resolved.modulePath)(
|
|
52559
52723
|
resolved.modulePath
|
|
52560
52724
|
);
|
|
52561
52725
|
const browserEnv = browser.libraryPath ? {
|
|
@@ -52567,14 +52731,14 @@ async function launchProvisionedPlaywright() {
|
|
|
52567
52731
|
{ headless: true }
|
|
52568
52732
|
);
|
|
52569
52733
|
}
|
|
52570
|
-
var import_node_child_process15,
|
|
52734
|
+
var import_node_child_process15, import_node_fs40, import_node_module5, import_node_path42;
|
|
52571
52735
|
var init_playwright_provisioning = __esm({
|
|
52572
52736
|
"cli/drivers/playwright-provisioning.ts"() {
|
|
52573
52737
|
"use strict";
|
|
52574
52738
|
import_node_child_process15 = require("node:child_process");
|
|
52575
|
-
|
|
52576
|
-
|
|
52577
|
-
|
|
52739
|
+
import_node_fs40 = require("node:fs");
|
|
52740
|
+
import_node_module5 = require("node:module");
|
|
52741
|
+
import_node_path42 = require("node:path");
|
|
52578
52742
|
init_src();
|
|
52579
52743
|
init_reap_browser();
|
|
52580
52744
|
init_home_paths();
|
|
@@ -53053,12 +53217,12 @@ var init_runtime_diagnostics = __esm({
|
|
|
53053
53217
|
// cli/commands/skills.ts
|
|
53054
53218
|
function getSkillsDir() {
|
|
53055
53219
|
if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
|
|
53056
|
-
const dir =
|
|
53220
|
+
const dir = path35.join(rnxHomeDir(), "skills", getCliVersion());
|
|
53057
53221
|
for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
|
|
53058
|
-
const target =
|
|
53059
|
-
if (
|
|
53060
|
-
|
|
53061
|
-
|
|
53222
|
+
const target = path35.join(dir, file);
|
|
53223
|
+
if (fs30.existsSync(target)) continue;
|
|
53224
|
+
fs30.mkdirSync(path35.dirname(target), { recursive: true });
|
|
53225
|
+
fs30.writeFileSync(target, body);
|
|
53062
53226
|
}
|
|
53063
53227
|
return dir;
|
|
53064
53228
|
}
|
|
@@ -53066,10 +53230,10 @@ function getSkillsDir() {
|
|
|
53066
53230
|
const pkgPath = (0, import_url3.fileURLToPath)(
|
|
53067
53231
|
import_meta3.resolve(`${rnxPublicBrand.packageName}/package.json`)
|
|
53068
53232
|
);
|
|
53069
|
-
return primaryCheckoutPath(
|
|
53233
|
+
return primaryCheckoutPath(path35.join(path35.dirname(pkgPath), "skills"));
|
|
53070
53234
|
} catch {
|
|
53071
|
-
const __dirname =
|
|
53072
|
-
return primaryCheckoutPath(
|
|
53235
|
+
const __dirname = path35.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
|
|
53236
|
+
return primaryCheckoutPath(path35.resolve(__dirname, "../../skills"));
|
|
53073
53237
|
}
|
|
53074
53238
|
}
|
|
53075
53239
|
function primaryCheckoutPath(dir) {
|
|
@@ -53092,39 +53256,39 @@ function primaryCheckoutPath(dir) {
|
|
|
53092
53256
|
} catch {
|
|
53093
53257
|
return dir;
|
|
53094
53258
|
}
|
|
53095
|
-
if (
|
|
53096
|
-
const primary =
|
|
53097
|
-
return
|
|
53259
|
+
if (path35.basename(common) !== ".git") return dir;
|
|
53260
|
+
const primary = path35.join(path35.dirname(common), path35.relative(top, dir));
|
|
53261
|
+
return fs30.existsSync(primary) ? primary : dir;
|
|
53098
53262
|
}
|
|
53099
53263
|
function skillsDir() {
|
|
53100
53264
|
skillsDirPath ??= getSkillsDir();
|
|
53101
53265
|
return skillsDirPath;
|
|
53102
53266
|
}
|
|
53103
53267
|
function targetFromHome(envName, fallbackDir) {
|
|
53104
|
-
const home = process.env[envName] ||
|
|
53105
|
-
return
|
|
53268
|
+
const home = process.env[envName] || path35.join(os9.homedir(), fallbackDir);
|
|
53269
|
+
return path35.join(home, "skills");
|
|
53106
53270
|
}
|
|
53107
53271
|
function codexTargets() {
|
|
53108
53272
|
const homes = /* @__PURE__ */ new Map();
|
|
53109
53273
|
const userHome = process.env.HOME || os9.homedir();
|
|
53110
|
-
const primaryCodexHome = process.env.CODEX_HOME ||
|
|
53111
|
-
homes.set(
|
|
53274
|
+
const primaryCodexHome = process.env.CODEX_HOME || path35.join(userHome, ".codex");
|
|
53275
|
+
homes.set(path35.resolve(primaryCodexHome), "codex");
|
|
53112
53276
|
const tmCodexHomes = process.env.TM_CODEX_HOMES;
|
|
53113
53277
|
if (tmCodexHomes) {
|
|
53114
|
-
for (const h of tmCodexHomes.split(
|
|
53278
|
+
for (const h of tmCodexHomes.split(path35.delimiter)) {
|
|
53115
53279
|
if (h.trim()) {
|
|
53116
|
-
const resolved =
|
|
53280
|
+
const resolved = path35.resolve(h.trim());
|
|
53117
53281
|
if (!homes.has(resolved)) {
|
|
53118
|
-
homes.set(resolved,
|
|
53282
|
+
homes.set(resolved, path35.basename(resolved).replace(/^\./, ""));
|
|
53119
53283
|
}
|
|
53120
53284
|
}
|
|
53121
53285
|
}
|
|
53122
53286
|
}
|
|
53123
|
-
const tmHome = process.env.TM_HOME ||
|
|
53124
|
-
const enginePath =
|
|
53125
|
-
if (
|
|
53287
|
+
const tmHome = process.env.TM_HOME || path35.join(userHome, ".team-machine");
|
|
53288
|
+
const enginePath = path35.join(tmHome, "engine.yaml");
|
|
53289
|
+
if (fs30.existsSync(enginePath)) {
|
|
53126
53290
|
try {
|
|
53127
|
-
const content =
|
|
53291
|
+
const content = fs30.readFileSync(enginePath, "utf8");
|
|
53128
53292
|
let inCodex = false;
|
|
53129
53293
|
let inAccounts = false;
|
|
53130
53294
|
let currentAccount = "";
|
|
@@ -53154,9 +53318,9 @@ function codexTargets() {
|
|
|
53154
53318
|
if (match) {
|
|
53155
53319
|
let homeDir = match[1].trim();
|
|
53156
53320
|
if (homeDir.startsWith("~")) {
|
|
53157
|
-
homeDir =
|
|
53321
|
+
homeDir = path35.join(userHome, homeDir.slice(1));
|
|
53158
53322
|
}
|
|
53159
|
-
const resolved =
|
|
53323
|
+
const resolved = path35.resolve(homeDir);
|
|
53160
53324
|
if (!homes.has(resolved)) {
|
|
53161
53325
|
homes.set(resolved, `codex-${currentAccount}`);
|
|
53162
53326
|
}
|
|
@@ -53167,13 +53331,13 @@ function codexTargets() {
|
|
|
53167
53331
|
}
|
|
53168
53332
|
}
|
|
53169
53333
|
try {
|
|
53170
|
-
for (const entry of
|
|
53334
|
+
for (const entry of fs30.readdirSync(userHome)) {
|
|
53171
53335
|
if (entry.startsWith(".codex-")) {
|
|
53172
|
-
const fullPath =
|
|
53336
|
+
const fullPath = path35.join(userHome, entry);
|
|
53173
53337
|
try {
|
|
53174
|
-
const stat2 =
|
|
53338
|
+
const stat2 = fs30.statSync(fullPath);
|
|
53175
53339
|
if (stat2.isDirectory()) {
|
|
53176
|
-
const resolved =
|
|
53340
|
+
const resolved = path35.resolve(fullPath);
|
|
53177
53341
|
if (!homes.has(resolved)) {
|
|
53178
53342
|
homes.set(resolved, entry.replace(/^\./, ""));
|
|
53179
53343
|
}
|
|
@@ -53188,7 +53352,7 @@ function codexTargets() {
|
|
|
53188
53352
|
for (const [homePath, label] of homes) {
|
|
53189
53353
|
targets.push({
|
|
53190
53354
|
label,
|
|
53191
|
-
dir:
|
|
53355
|
+
dir: path35.join(homePath, "skills")
|
|
53192
53356
|
});
|
|
53193
53357
|
}
|
|
53194
53358
|
return targets;
|
|
@@ -53204,7 +53368,7 @@ function hasInstalledPeachSkills() {
|
|
|
53204
53368
|
(file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
|
|
53205
53369
|
) : listSkills().map((skill7) => skill7.name);
|
|
53206
53370
|
return defaultAgentTargets().some(
|
|
53207
|
-
({ dir }) => names.some((name2) =>
|
|
53371
|
+
({ dir }) => names.some((name2) => fs30.existsSync(path35.join(dir, name2, "SKILL.md")))
|
|
53208
53372
|
);
|
|
53209
53373
|
}
|
|
53210
53374
|
function parseSkillFrontmatter(content) {
|
|
@@ -53247,26 +53411,26 @@ function readFrontmatterField(frontmatter, field) {
|
|
|
53247
53411
|
return null;
|
|
53248
53412
|
}
|
|
53249
53413
|
function listSkills() {
|
|
53250
|
-
if (!
|
|
53414
|
+
if (!fs30.existsSync(skillsDir())) return [];
|
|
53251
53415
|
const skills = [];
|
|
53252
|
-
for (const entry of
|
|
53253
|
-
const skillMd =
|
|
53254
|
-
if (!
|
|
53255
|
-
const meta = parseSkillFrontmatter(
|
|
53416
|
+
for (const entry of fs30.readdirSync(skillsDir())) {
|
|
53417
|
+
const skillMd = path35.join(skillsDir(), entry, "SKILL.md");
|
|
53418
|
+
if (!fs30.existsSync(skillMd)) continue;
|
|
53419
|
+
const meta = parseSkillFrontmatter(fs30.readFileSync(skillMd, "utf8"));
|
|
53256
53420
|
if (meta) {
|
|
53257
53421
|
skills.push({ name: entry, description: meta.description });
|
|
53258
53422
|
}
|
|
53259
53423
|
}
|
|
53260
53424
|
return skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
53261
53425
|
}
|
|
53262
|
-
var import_child_process7,
|
|
53426
|
+
var import_child_process7, fs30, os9, path35, import_url3, import_meta3, skillsDirPath;
|
|
53263
53427
|
var init_skills = __esm({
|
|
53264
53428
|
"cli/commands/skills.ts"() {
|
|
53265
53429
|
"use strict";
|
|
53266
53430
|
import_child_process7 = require("child_process");
|
|
53267
|
-
|
|
53431
|
+
fs30 = __toESM(require("fs"), 1);
|
|
53268
53432
|
os9 = __toESM(require("os"), 1);
|
|
53269
|
-
|
|
53433
|
+
path35 = __toESM(require("path"), 1);
|
|
53270
53434
|
import_url3 = require("url");
|
|
53271
53435
|
init_cli_version();
|
|
53272
53436
|
init_home_paths();
|
|
@@ -53727,11 +53891,11 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
53727
53891
|
);
|
|
53728
53892
|
}
|
|
53729
53893
|
const { executable, prefixArgs } = rnxSelfInvocation();
|
|
53730
|
-
const bridgeLogPath =
|
|
53894
|
+
const bridgeLogPath = import_node_path43.default.join(
|
|
53731
53895
|
import_node_os11.default.tmpdir(),
|
|
53732
53896
|
`peach-bridge-${Date.now()}-${process.pid}.log`
|
|
53733
53897
|
);
|
|
53734
|
-
const bridgeLogFd =
|
|
53898
|
+
const bridgeLogFd = import_node_fs41.default.openSync(bridgeLogPath, "a");
|
|
53735
53899
|
let child;
|
|
53736
53900
|
try {
|
|
53737
53901
|
child = (0, import_node_child_process16.spawn)(
|
|
@@ -53745,7 +53909,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
53745
53909
|
}
|
|
53746
53910
|
);
|
|
53747
53911
|
} finally {
|
|
53748
|
-
|
|
53912
|
+
import_node_fs41.default.closeSync(bridgeLogFd);
|
|
53749
53913
|
}
|
|
53750
53914
|
if (resources) {
|
|
53751
53915
|
resources.bridge = child;
|
|
@@ -53781,7 +53945,7 @@ async function connectBridgeForOpen(preferredPort, explicitPort, resources, runt
|
|
|
53781
53945
|
await sleep(150);
|
|
53782
53946
|
}
|
|
53783
53947
|
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`;
|
|
53784
|
-
const bridgeLog =
|
|
53948
|
+
const bridgeLog = import_node_fs41.default.readFileSync(bridgeLogPath, "utf8").trim().slice(-2e3);
|
|
53785
53949
|
throw new Error(
|
|
53786
53950
|
`${reason}${bridgeLog ? `
|
|
53787
53951
|
${bridgeLog}` : ""}
|
|
@@ -53804,7 +53968,7 @@ function assertExplicitBridgeLock(preferredPort, explicitPort, lock) {
|
|
|
53804
53968
|
async function ensureRuntimeForOpen() {
|
|
53805
53969
|
if (resolveDevCheckoutRuntimeRoot()) return;
|
|
53806
53970
|
const active = readActiveRuntime();
|
|
53807
|
-
if (active &&
|
|
53971
|
+
if (active && import_node_fs41.default.existsSync(runtimeDir(active))) return;
|
|
53808
53972
|
console.error(" installing peach engine runtime...");
|
|
53809
53973
|
const { runRuntime: runRuntime2 } = await Promise.resolve().then(() => (init_runtime(), runtime_exports));
|
|
53810
53974
|
await runRuntime2(["install"], {});
|
|
@@ -53952,10 +54116,10 @@ async function buildResolvedBundleOpenUrl(target, baseUrl, opts = {}) {
|
|
|
53952
54116
|
}
|
|
53953
54117
|
function normalizeReplacementPath(filePath) {
|
|
53954
54118
|
if (filePath.startsWith("~/")) {
|
|
53955
|
-
return
|
|
54119
|
+
return import_node_path43.default.join(import_node_os11.default.homedir(), filePath.slice(2));
|
|
53956
54120
|
}
|
|
53957
|
-
if (
|
|
53958
|
-
return
|
|
54121
|
+
if (import_node_path43.default.isAbsolute(filePath)) return filePath;
|
|
54122
|
+
return import_node_path43.default.resolve(process.cwd(), filePath);
|
|
53959
54123
|
}
|
|
53960
54124
|
function parseOpenRuntimeConfig(args) {
|
|
53961
54125
|
const modules = {};
|
|
@@ -53974,7 +54138,7 @@ function parseOpenRuntimeConfig(args) {
|
|
|
53974
54138
|
}
|
|
53975
54139
|
const moduleName = raw2.slice(0, eqIndex).trim();
|
|
53976
54140
|
const filePath = normalizeReplacementPath(raw2.slice(eqIndex + 1).trim());
|
|
53977
|
-
if (!
|
|
54141
|
+
if (!import_node_fs41.default.existsSync(filePath)) {
|
|
53978
54142
|
console.error(` peach open: replacement file not found: ${filePath}`);
|
|
53979
54143
|
rnxExit(1);
|
|
53980
54144
|
}
|
|
@@ -54010,7 +54174,7 @@ async function resolveAppProjectForBundleUrl(bundleUrl, projectRoot) {
|
|
|
54010
54174
|
return advertisedRoot ? resolveAppProject(advertisedRoot) : null;
|
|
54011
54175
|
}
|
|
54012
54176
|
async function ensureConfiguredRuntime(version) {
|
|
54013
|
-
if (
|
|
54177
|
+
if (import_node_fs41.default.existsSync(import_node_path43.default.join(runtimeDir(version), "index.html"))) return;
|
|
54014
54178
|
console.error(` installing configured engine runtime ${version}...`);
|
|
54015
54179
|
const result = await rnxRuntime.install({
|
|
54016
54180
|
version,
|
|
@@ -54152,6 +54316,20 @@ async function splashImageReachable(imageUrl) {
|
|
|
54152
54316
|
clearTimeout(timer);
|
|
54153
54317
|
}
|
|
54154
54318
|
}
|
|
54319
|
+
function readProjectNativeFirebaseConfig(project) {
|
|
54320
|
+
if (!project) return null;
|
|
54321
|
+
const require4 = (0, import_node_module6.createRequire)(import_node_path43.default.join(project.appDir, "package.json"));
|
|
54322
|
+
try {
|
|
54323
|
+
require4.resolve("@expo/config");
|
|
54324
|
+
} catch {
|
|
54325
|
+
return null;
|
|
54326
|
+
}
|
|
54327
|
+
try {
|
|
54328
|
+
return readNativeFirebaseConfig(project.appDir);
|
|
54329
|
+
} catch (error) {
|
|
54330
|
+
return { error: error instanceof Error ? error.message : String(error) };
|
|
54331
|
+
}
|
|
54332
|
+
}
|
|
54155
54333
|
function bundleUrlOf(urlStr) {
|
|
54156
54334
|
try {
|
|
54157
54335
|
return new URL(urlStr).searchParams.get("bundle") || void 0;
|
|
@@ -54169,6 +54347,9 @@ async function buildShellUrl(target, baseUrl = resolveDefaultShellBaseUrl(), opt
|
|
|
54169
54347
|
);
|
|
54170
54348
|
const expoStamped = new URL(stamped);
|
|
54171
54349
|
expoStamped.searchParams.delete("nativeFirebase");
|
|
54350
|
+
const nativeFirebase = readProjectNativeFirebaseConfig(project);
|
|
54351
|
+
if (nativeFirebase && expoStamped.searchParams.get("bundle"))
|
|
54352
|
+
expoStamped.searchParams.set("nativeFirebase", JSON.stringify(nativeFirebase));
|
|
54172
54353
|
if (opts.bundleOriginOverride)
|
|
54173
54354
|
expoStamped.searchParams.set("bundleOriginOverride", opts.bundleOriginOverride);
|
|
54174
54355
|
if (opts.hostDriver) expoStamped.searchParams.set("peachHostDriver", opts.hostDriver);
|
|
@@ -54334,7 +54515,7 @@ function playwrightHostPidForSim(sim) {
|
|
|
54334
54515
|
function signalDriverLaunchConnected(result) {
|
|
54335
54516
|
if (!result.connectAckFile) return false;
|
|
54336
54517
|
try {
|
|
54337
|
-
|
|
54518
|
+
import_node_fs41.default.writeFileSync(
|
|
54338
54519
|
result.connectAckFile,
|
|
54339
54520
|
`${JSON.stringify({ connectedAt: Date.now(), pid: result.pid ?? null })}
|
|
54340
54521
|
`,
|
|
@@ -54348,7 +54529,7 @@ function signalDriverLaunchConnected(result) {
|
|
|
54348
54529
|
function readUnservedUrl(result) {
|
|
54349
54530
|
if (!result.diagnosticLogPath) return null;
|
|
54350
54531
|
try {
|
|
54351
|
-
const detail =
|
|
54532
|
+
const detail = import_node_fs41.default.readFileSync(result.diagnosticLogPath, "utf8");
|
|
54352
54533
|
const match = detail.match(/\[unserved\] nothing serves (\S+)/);
|
|
54353
54534
|
return match ? match[1] : null;
|
|
54354
54535
|
} catch {
|
|
@@ -54358,19 +54539,19 @@ function readUnservedUrl(result) {
|
|
|
54358
54539
|
function printDriverDiagnosticLogTail(result) {
|
|
54359
54540
|
if (!result.diagnosticLogPath) return;
|
|
54360
54541
|
try {
|
|
54361
|
-
const detail =
|
|
54542
|
+
const detail = import_node_fs41.default.readFileSync(result.diagnosticLogPath, "utf8").trim();
|
|
54362
54543
|
if (!detail) {
|
|
54363
|
-
console.error(` ${
|
|
54544
|
+
console.error(` ${import_node_path43.default.basename(result.diagnosticLogPath)} was empty`);
|
|
54364
54545
|
return;
|
|
54365
54546
|
}
|
|
54366
54547
|
const shown = detail.length > 4e3 ? `\u2026
|
|
54367
54548
|
${detail.slice(-4e3)}` : detail;
|
|
54368
|
-
console.error(` ${
|
|
54549
|
+
console.error(` ${import_node_path43.default.basename(result.diagnosticLogPath)}:`);
|
|
54369
54550
|
console.error(shown);
|
|
54370
54551
|
} catch (err) {
|
|
54371
54552
|
const message = err instanceof Error ? err.message : String(err);
|
|
54372
54553
|
console.error(
|
|
54373
|
-
` failed to read ${
|
|
54554
|
+
` failed to read ${import_node_path43.default.basename(result.diagnosticLogPath)}: ${message}`
|
|
54374
54555
|
);
|
|
54375
54556
|
}
|
|
54376
54557
|
}
|
|
@@ -55408,14 +55589,15 @@ async function runCloseCommand(args, opts = {}) {
|
|
|
55408
55589
|
bridge.close();
|
|
55409
55590
|
}
|
|
55410
55591
|
}
|
|
55411
|
-
var import_node_child_process16,
|
|
55592
|
+
var import_node_child_process16, import_node_fs41, import_node_module6, import_node_os11, import_node_path43, 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;
|
|
55412
55593
|
var init_control = __esm({
|
|
55413
55594
|
"cli/commands/control.ts"() {
|
|
55414
55595
|
"use strict";
|
|
55415
55596
|
import_node_child_process16 = require("node:child_process");
|
|
55416
|
-
|
|
55597
|
+
import_node_fs41 = __toESM(require("node:fs"), 1);
|
|
55598
|
+
import_node_module6 = require("node:module");
|
|
55417
55599
|
import_node_os11 = __toESM(require("node:os"), 1);
|
|
55418
|
-
|
|
55600
|
+
import_node_path43 = __toESM(require("node:path"), 1);
|
|
55419
55601
|
import_app_catalog_wire = require("peach-engine/engine/app-catalog-wire");
|
|
55420
55602
|
import_devices2 = require("peach-engine/settings/devices");
|
|
55421
55603
|
import_ws4 = require("ws");
|
|
@@ -55429,6 +55611,7 @@ var init_control = __esm({
|
|
|
55429
55611
|
init_flow_timeout_scale();
|
|
55430
55612
|
init_home_paths();
|
|
55431
55613
|
init_native_dev_bundle_url();
|
|
55614
|
+
init_native_firebase_config();
|
|
55432
55615
|
init_profiles();
|
|
55433
55616
|
init_public_brand();
|
|
55434
55617
|
init_runtime_assets();
|
|
@@ -56875,16 +57058,16 @@ function readRecentShellAppId(state) {
|
|
|
56875
57058
|
}
|
|
56876
57059
|
function resolveProjectRelativeFlowBase(flowDir) {
|
|
56877
57060
|
if (!flowDir) return process.cwd();
|
|
56878
|
-
return
|
|
57061
|
+
return path37.basename(flowDir) === ".maestro" ? path37.dirname(flowDir) : flowDir;
|
|
56879
57062
|
}
|
|
56880
57063
|
function resolveFlowScreenshotPathWithMode(screenshotDir, name2, opts) {
|
|
56881
57064
|
const normalizedName = name2.endsWith(".png") ? name2 : `${name2}.png`;
|
|
56882
|
-
if (
|
|
57065
|
+
if (path37.isAbsolute(normalizedName)) return normalizedName;
|
|
56883
57066
|
if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
|
|
56884
57067
|
const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
|
|
56885
|
-
return
|
|
57068
|
+
return path37.resolve(baseDir, normalizedName);
|
|
56886
57069
|
}
|
|
56887
|
-
return
|
|
57070
|
+
return path37.join(screenshotDir, normalizedName);
|
|
56888
57071
|
}
|
|
56889
57072
|
function normalizeFlowScreenshotSpec(step) {
|
|
56890
57073
|
if (typeof step === "string") {
|
|
@@ -56938,12 +57121,12 @@ function normalizeBareStringStep(verb) {
|
|
|
56938
57121
|
function parseFlowSteps(content) {
|
|
56939
57122
|
return parseFlowFile(content).steps;
|
|
56940
57123
|
}
|
|
56941
|
-
var
|
|
57124
|
+
var fs33, path37, 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;
|
|
56942
57125
|
var init_bridge_flow_runner = __esm({
|
|
56943
57126
|
"cli/bridge-flow-runner.ts"() {
|
|
56944
57127
|
"use strict";
|
|
56945
|
-
|
|
56946
|
-
|
|
57128
|
+
fs33 = __toESM(require("fs"), 1);
|
|
57129
|
+
path37 = __toESM(require("path"), 1);
|
|
56947
57130
|
import_devices4 = require("peach-engine/settings/devices");
|
|
56948
57131
|
import_proof_frame = __toESM(require_proof_frame(), 1);
|
|
56949
57132
|
init_flow_timeout_scale();
|
|
@@ -57255,14 +57438,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
57255
57438
|
if (chunks.length === 0) {
|
|
57256
57439
|
throw new Error("recording requested but no video buffer was produced");
|
|
57257
57440
|
}
|
|
57258
|
-
|
|
57441
|
+
fs33.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
|
|
57259
57442
|
const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
|
|
57260
57443
|
const extension = videoMime.includes("mp4") ? "mp4" : "webm";
|
|
57261
|
-
const outputPath =
|
|
57444
|
+
const outputPath = path37.join(
|
|
57262
57445
|
this.opts.recordingOutputDir,
|
|
57263
57446
|
`peach-${Date.now()}.${extension}`
|
|
57264
57447
|
);
|
|
57265
|
-
|
|
57448
|
+
fs33.writeFileSync(outputPath, Buffer.concat(chunks));
|
|
57266
57449
|
return outputPath;
|
|
57267
57450
|
}
|
|
57268
57451
|
async waitForRecordingTail(opts) {
|
|
@@ -57883,7 +58066,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
57883
58066
|
flowDir: this.opts.flowDir
|
|
57884
58067
|
}
|
|
57885
58068
|
);
|
|
57886
|
-
|
|
58069
|
+
fs33.mkdirSync(path37.dirname(outputPath), { recursive: true });
|
|
57887
58070
|
const layers = spec.layers ?? this.opts.screenshotLayers;
|
|
57888
58071
|
const screenshotRequest = {
|
|
57889
58072
|
type: "screenshot",
|
|
@@ -57918,11 +58101,11 @@ var init_bridge_flow_runner = __esm({
|
|
|
57918
58101
|
throw new Error("could not read current device model for framed screenshot");
|
|
57919
58102
|
}
|
|
57920
58103
|
const framed = await composeFramedScreenshot(rawBuffer, model);
|
|
57921
|
-
|
|
58104
|
+
fs33.writeFileSync(outputPath, framed);
|
|
57922
58105
|
console.log(`[flow] screenshot: ${outputPath} (frame: ${model})`);
|
|
57923
58106
|
return outputPath;
|
|
57924
58107
|
}
|
|
57925
|
-
|
|
58108
|
+
fs33.writeFileSync(outputPath, rawBuffer);
|
|
57926
58109
|
console.log(`[flow] screenshot: ${outputPath}`);
|
|
57927
58110
|
return outputPath;
|
|
57928
58111
|
}
|
|
@@ -57944,10 +58127,10 @@ var init_bridge_flow_runner = __esm({
|
|
|
57944
58127
|
// + a11y tree + console errors/warnings + failed network requests +
|
|
57945
58128
|
// shell state, all under one directory so post-mortem is one grep away.
|
|
57946
58129
|
async captureFailureBundle(outputDir, context) {
|
|
57947
|
-
|
|
58130
|
+
fs33.mkdirSync(outputDir, { recursive: true });
|
|
57948
58131
|
const write = (name2, content) => {
|
|
57949
58132
|
try {
|
|
57950
|
-
|
|
58133
|
+
fs33.writeFileSync(path37.join(outputDir, name2), content);
|
|
57951
58134
|
} catch {
|
|
57952
58135
|
}
|
|
57953
58136
|
};
|
|
@@ -58542,8 +58725,8 @@ var init_bridge_flow_runner = __esm({
|
|
|
58542
58725
|
runScript(target) {
|
|
58543
58726
|
const spec = typeof target === "string" ? { file: target } : target;
|
|
58544
58727
|
if (!spec.file) throw new Error("runScript requires a file");
|
|
58545
|
-
const scriptPath =
|
|
58546
|
-
const source =
|
|
58728
|
+
const scriptPath = path37.resolve(this.opts.flowDir, spec.file);
|
|
58729
|
+
const source = fs33.readFileSync(scriptPath, "utf8");
|
|
58547
58730
|
this.js.evaluate(source, { env: spec.env });
|
|
58548
58731
|
console.log(`[flow] runScript: ${spec.file} done`);
|
|
58549
58732
|
}
|
|
@@ -58903,14 +59086,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
58903
59086
|
for (const [k, v] of Object.entries(env)) this.js.putEnv(k, v);
|
|
58904
59087
|
}
|
|
58905
59088
|
if (file) {
|
|
58906
|
-
const flowPath =
|
|
58907
|
-
const flowContent =
|
|
59089
|
+
const flowPath = path37.resolve(this.opts.flowDir, file);
|
|
59090
|
+
const flowContent = fs33.readFileSync(flowPath, "utf8");
|
|
58908
59091
|
const { frontmatter } = parseFlowFile(flowContent);
|
|
58909
59092
|
if (frontmatter.env && typeof frontmatter.env === "object") {
|
|
58910
59093
|
this.js.defineVariables(frontmatter.env);
|
|
58911
59094
|
}
|
|
58912
59095
|
const previousDir = this.opts.flowDir;
|
|
58913
|
-
this.opts.flowDir =
|
|
59096
|
+
this.opts.flowDir = path37.dirname(flowPath);
|
|
58914
59097
|
try {
|
|
58915
59098
|
await this.runFlow(parseFlowSteps(flowContent));
|
|
58916
59099
|
} finally {
|
|
@@ -59081,8 +59264,8 @@ __export(registry_exports, {
|
|
|
59081
59264
|
skillRegistry: () => skillRegistry
|
|
59082
59265
|
});
|
|
59083
59266
|
module.exports = __toCommonJS(registry_exports);
|
|
59084
|
-
var
|
|
59085
|
-
var
|
|
59267
|
+
var fs34 = __toESM(require("fs"), 1);
|
|
59268
|
+
var path38 = __toESM(require("path"), 1);
|
|
59086
59269
|
|
|
59087
59270
|
// src/skills/builtin/a11y-review.ts
|
|
59088
59271
|
init_reap_browser();
|
|
@@ -59101,8 +59284,8 @@ var skill = {
|
|
|
59101
59284
|
},
|
|
59102
59285
|
async execute(params, context) {
|
|
59103
59286
|
const { chromium } = await import("playwright");
|
|
59104
|
-
const
|
|
59105
|
-
const
|
|
59287
|
+
const path39 = await import("path");
|
|
59288
|
+
const fs35 = await import("fs");
|
|
59106
59289
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59107
59290
|
headless: true
|
|
59108
59291
|
});
|
|
@@ -59159,9 +59342,9 @@ var skill = {
|
|
|
59159
59342
|
warnings: issues.filter((i) => i.severity === "warning").length,
|
|
59160
59343
|
tree: typeof tree === "string" ? tree : JSON.stringify(tree)
|
|
59161
59344
|
};
|
|
59162
|
-
const reportPath =
|
|
59163
|
-
|
|
59164
|
-
|
|
59345
|
+
const reportPath = path39.join(context.outputDir, "a11y-report.json");
|
|
59346
|
+
fs35.mkdirSync(path39.dirname(reportPath), { recursive: true });
|
|
59347
|
+
fs35.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
59165
59348
|
return {
|
|
59166
59349
|
success: issues.filter((i) => i.severity === "error").length === 0,
|
|
59167
59350
|
message: `${report.errors} errors, ${report.warnings} warnings across ${report.nodeCount} nodes`,
|
|
@@ -59194,14 +59377,14 @@ var skill2 = {
|
|
|
59194
59377
|
}
|
|
59195
59378
|
},
|
|
59196
59379
|
async execute(params, context) {
|
|
59197
|
-
const
|
|
59198
|
-
const
|
|
59380
|
+
const fs35 = await import("node:fs");
|
|
59381
|
+
const path39 = await import("node:path");
|
|
59199
59382
|
const { COMPAT_RESULT_CAVEAT: COMPAT_RESULT_CAVEAT2, formatPackageStatus: formatPackageStatus2, formatScanCounts: formatScanCounts2, scanDeps: scanDeps2 } = await Promise.resolve().then(() => (init_web(), web_exports));
|
|
59200
|
-
const packagePath =
|
|
59201
|
-
if (!
|
|
59383
|
+
const packagePath = path39.join(context.projectDir, "package.json");
|
|
59384
|
+
if (!fs35.existsSync(packagePath)) {
|
|
59202
59385
|
return { success: false, message: "No package.json found" };
|
|
59203
59386
|
}
|
|
59204
|
-
const parsed = JSON.parse(
|
|
59387
|
+
const parsed = JSON.parse(fs35.readFileSync(packagePath, "utf8"));
|
|
59205
59388
|
if (!parsed || typeof parsed !== "object") {
|
|
59206
59389
|
return { success: false, message: "package.json is not an object" };
|
|
59207
59390
|
}
|
|
@@ -59213,9 +59396,9 @@ var skill2 = {
|
|
|
59213
59396
|
}) : scanDeps2(parsed);
|
|
59214
59397
|
const packageResult = params.packageName ? scan.packages[0] : void 0;
|
|
59215
59398
|
const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan)}. ${COMPAT_RESULT_CAVEAT2}`;
|
|
59216
|
-
const reportPath =
|
|
59217
|
-
|
|
59218
|
-
|
|
59399
|
+
const reportPath = path39.join(context.outputDir, "compat-report.json");
|
|
59400
|
+
fs35.mkdirSync(path39.dirname(reportPath), { recursive: true });
|
|
59401
|
+
fs35.writeFileSync(reportPath, `${JSON.stringify(scan, null, 2)}
|
|
59219
59402
|
`);
|
|
59220
59403
|
return {
|
|
59221
59404
|
success: true,
|
|
@@ -59257,8 +59440,8 @@ var skill3 = {
|
|
|
59257
59440
|
record: { type: "boolean", description: "Record video of the flow" }
|
|
59258
59441
|
},
|
|
59259
59442
|
async execute(params, context) {
|
|
59260
|
-
const
|
|
59261
|
-
const
|
|
59443
|
+
const fs35 = await import("fs");
|
|
59444
|
+
const path39 = await import("path");
|
|
59262
59445
|
const yaml = await Promise.resolve().then(() => (init_browser(), browser_exports));
|
|
59263
59446
|
const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT3 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
|
|
59264
59447
|
const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
|
|
@@ -59268,7 +59451,7 @@ var skill3 = {
|
|
|
59268
59451
|
const host2 = new SootSimBridgeHost2({ port: DEFAULT_SOOTSIM_BRIDGE_PORT3 });
|
|
59269
59452
|
host2.start({ silent: true });
|
|
59270
59453
|
try {
|
|
59271
|
-
const flowContent =
|
|
59454
|
+
const flowContent = fs35.readFileSync(params.flowPath, "utf8");
|
|
59272
59455
|
const fmMatch = flowContent.match(/^---\n([\s\S]*?)\n---\n?/);
|
|
59273
59456
|
const stepsBody = fmMatch ? flowContent.slice(fmMatch[0].length) : flowContent;
|
|
59274
59457
|
const steps = yaml.parse(stepsBody);
|
|
@@ -59295,7 +59478,7 @@ var skill3 = {
|
|
|
59295
59478
|
});
|
|
59296
59479
|
const driver = new SootSimBridgeFlowRunner2(bridge, {
|
|
59297
59480
|
screenshotDir: context.outputDir,
|
|
59298
|
-
flowDir:
|
|
59481
|
+
flowDir: path39.dirname(path39.resolve(params.flowPath)),
|
|
59299
59482
|
simId,
|
|
59300
59483
|
recordingOutputDir: params.record ? context.outputDir : void 0
|
|
59301
59484
|
});
|
|
@@ -59317,7 +59500,7 @@ var skill3 = {
|
|
|
59317
59500
|
simId,
|
|
59318
59501
|
videoPath: videoPath || void 0
|
|
59319
59502
|
},
|
|
59320
|
-
artifacts: videoPath ? [{ type: "video", name:
|
|
59503
|
+
artifacts: videoPath ? [{ type: "video", name: path39.basename(videoPath), path: videoPath }] : void 0
|
|
59321
59504
|
};
|
|
59322
59505
|
} finally {
|
|
59323
59506
|
try {
|
|
@@ -59364,8 +59547,8 @@ var skill4 = {
|
|
|
59364
59547
|
},
|
|
59365
59548
|
async execute(params, context) {
|
|
59366
59549
|
const { chromium } = await import("playwright");
|
|
59367
|
-
const
|
|
59368
|
-
const
|
|
59550
|
+
const path39 = await import("path");
|
|
59551
|
+
const fs35 = await import("fs");
|
|
59369
59552
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59370
59553
|
headless: true
|
|
59371
59554
|
});
|
|
@@ -59393,9 +59576,9 @@ var skill4 = {
|
|
|
59393
59576
|
...profile,
|
|
59394
59577
|
fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
|
|
59395
59578
|
};
|
|
59396
|
-
const reportPath =
|
|
59397
|
-
|
|
59398
|
-
|
|
59579
|
+
const reportPath = path39.join(context.outputDir, "perf-report.json");
|
|
59580
|
+
fs35.mkdirSync(path39.dirname(reportPath), { recursive: true });
|
|
59581
|
+
fs35.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
59399
59582
|
return {
|
|
59400
59583
|
success: true,
|
|
59401
59584
|
message: `${report.fps} fps, ${profile.avgSyncMs?.toFixed(1)}ms avg sync, ${nodeCount} nodes`,
|
|
@@ -59428,8 +59611,8 @@ var skill5 = {
|
|
|
59428
59611
|
},
|
|
59429
59612
|
async execute(params, context) {
|
|
59430
59613
|
const { chromium } = await import("playwright");
|
|
59431
|
-
const
|
|
59432
|
-
const
|
|
59614
|
+
const path39 = await import("path");
|
|
59615
|
+
const fs35 = await import("fs");
|
|
59433
59616
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59434
59617
|
headless: true
|
|
59435
59618
|
});
|
|
@@ -59437,8 +59620,8 @@ var skill5 = {
|
|
|
59437
59620
|
try {
|
|
59438
59621
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
59439
59622
|
await page.waitForTimeout(2e3);
|
|
59440
|
-
const outputPath =
|
|
59441
|
-
|
|
59623
|
+
const outputPath = path39.join(context.outputDir, `${params.name}.png`);
|
|
59624
|
+
fs35.mkdirSync(path39.dirname(outputPath), { recursive: true });
|
|
59442
59625
|
await page.screenshot({ path: outputPath });
|
|
59443
59626
|
return {
|
|
59444
59627
|
success: true,
|
|
@@ -59479,8 +59662,8 @@ var skill6 = {
|
|
|
59479
59662
|
},
|
|
59480
59663
|
async execute(params, context) {
|
|
59481
59664
|
const { chromium } = await import("playwright");
|
|
59482
|
-
const
|
|
59483
|
-
const
|
|
59665
|
+
const path39 = await import("path");
|
|
59666
|
+
const fs35 = await import("fs");
|
|
59484
59667
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
59485
59668
|
headless: true
|
|
59486
59669
|
});
|
|
@@ -59488,14 +59671,14 @@ var skill6 = {
|
|
|
59488
59671
|
try {
|
|
59489
59672
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
59490
59673
|
await page.waitForTimeout(2e3);
|
|
59491
|
-
const currentPath =
|
|
59492
|
-
|
|
59674
|
+
const currentPath = path39.join(context.outputDir, `${params.name}-current.png`);
|
|
59675
|
+
fs35.mkdirSync(path39.dirname(currentPath), { recursive: true });
|
|
59493
59676
|
await page.screenshot({ path: currentPath });
|
|
59494
59677
|
try {
|
|
59495
59678
|
const { PNG } = await import("pngjs");
|
|
59496
59679
|
const pixelmatch = (await import("pixelmatch")).default;
|
|
59497
|
-
const baseline = PNG.sync.read(
|
|
59498
|
-
const current = PNG.sync.read(
|
|
59680
|
+
const baseline = PNG.sync.read(fs35.readFileSync(params.baseline));
|
|
59681
|
+
const current = PNG.sync.read(fs35.readFileSync(currentPath));
|
|
59499
59682
|
const { width, height } = baseline;
|
|
59500
59683
|
const diff = new PNG({ width, height });
|
|
59501
59684
|
const numDiffPixels = pixelmatch(
|
|
@@ -59506,8 +59689,8 @@ var skill6 = {
|
|
|
59506
59689
|
height,
|
|
59507
59690
|
{ threshold: params.threshold || 0.1 }
|
|
59508
59691
|
);
|
|
59509
|
-
const diffPath =
|
|
59510
|
-
|
|
59692
|
+
const diffPath = path39.join(context.outputDir, `${params.name}-diff.png`);
|
|
59693
|
+
fs35.writeFileSync(diffPath, PNG.sync.write(diff));
|
|
59511
59694
|
const totalPixels = width * height;
|
|
59512
59695
|
const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
|
|
59513
59696
|
return {
|
|
@@ -59571,10 +59754,10 @@ var skillRegistry = {
|
|
|
59571
59754
|
},
|
|
59572
59755
|
// load skills from a project manifest (rnx-skills.json)
|
|
59573
59756
|
async loadFromManifest(projectDir) {
|
|
59574
|
-
const manifestPath =
|
|
59575
|
-
if (!
|
|
59757
|
+
const manifestPath = path38.join(projectDir, "rnx-skills.json");
|
|
59758
|
+
if (!fs34.existsSync(manifestPath)) return;
|
|
59576
59759
|
try {
|
|
59577
|
-
const manifest = JSON.parse(
|
|
59760
|
+
const manifest = JSON.parse(fs34.readFileSync(manifestPath, "utf8"));
|
|
59578
59761
|
if (Array.isArray(manifest.skills)) {
|
|
59579
59762
|
for (const entry of manifest.skills) {
|
|
59580
59763
|
if (typeof entry === "string") {
|
|
@@ -59585,7 +59768,7 @@ var skillRegistry = {
|
|
|
59585
59768
|
}
|
|
59586
59769
|
} else if (entry.file) {
|
|
59587
59770
|
try {
|
|
59588
|
-
const mod = await import(
|
|
59771
|
+
const mod = await import(path38.resolve(projectDir, entry.file));
|
|
59589
59772
|
if (mod.skill) this.register(mod.skill);
|
|
59590
59773
|
} catch {
|
|
59591
59774
|
}
|
|
@@ -59598,10 +59781,10 @@ var skillRegistry = {
|
|
|
59598
59781
|
// auto-discover skills based on project dependencies
|
|
59599
59782
|
suggestSkills(projectDir) {
|
|
59600
59783
|
const suggestions = [];
|
|
59601
|
-
const pkgPath =
|
|
59602
|
-
if (!
|
|
59784
|
+
const pkgPath = path38.join(projectDir, "package.json");
|
|
59785
|
+
if (!fs34.existsSync(pkgPath)) return suggestions;
|
|
59603
59786
|
try {
|
|
59604
|
-
const pkg = JSON.parse(
|
|
59787
|
+
const pkg = JSON.parse(fs34.readFileSync(pkgPath, "utf8"));
|
|
59605
59788
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
59606
59789
|
if (deps["detox"] || deps["maestro"]) {
|
|
59607
59790
|
suggestions.push("maestro-test");
|