peachsim 0.1.1463 → 0.1.1465
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/drivers/playwright-sim-host.ts +10 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +1 -1
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +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/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +191 -78
- 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-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +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/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 +391 -274
- 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 +5 -1
- package/dist-lib/worklet-executable.mjs +5 -1
- package/package.json +1 -1
- package/src/worklet-executable.ts +7 -2
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1465 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -35,6 +35,103 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
35
35
|
));
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
37
|
|
|
38
|
+
// ../../scripts/lib/chromium-admission.ts
|
|
39
|
+
async function acquireChromiumAdmission(deps) {
|
|
40
|
+
const { fs: fs38, os: os14, path: path42, childProcess: childProcess2, label } = deps;
|
|
41
|
+
const dir = path42.join(
|
|
42
|
+
process.platform === "win32" ? os14.tmpdir() : "/tmp",
|
|
43
|
+
"chromium-admission"
|
|
44
|
+
);
|
|
45
|
+
fs38.mkdirSync(dir, { recursive: true });
|
|
46
|
+
const limit = Math.max(2, Math.floor(os14.availableParallelism() / 3));
|
|
47
|
+
const startedAt = Math.round(Date.now() / 1e3 - process.uptime());
|
|
48
|
+
const name2 = `${process.pid}-${startedAt}-${Math.random().toString(36).slice(2, 10)}`;
|
|
49
|
+
const ticket = path42.join(dir, name2);
|
|
50
|
+
fs38.closeSync(fs38.openSync(ticket, "wx"));
|
|
51
|
+
let released = false;
|
|
52
|
+
const release = () => {
|
|
53
|
+
if (released) return;
|
|
54
|
+
released = true;
|
|
55
|
+
process.removeListener("exit", release);
|
|
56
|
+
try {
|
|
57
|
+
fs38.unlinkSync(ticket);
|
|
58
|
+
} catch {
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
process.on("exit", release);
|
|
62
|
+
const verified3 = /* @__PURE__ */ new Map();
|
|
63
|
+
const live = (entry) => {
|
|
64
|
+
const match = /^(\d+)-(\d+)-/.exec(entry);
|
|
65
|
+
if (!match) return false;
|
|
66
|
+
const pid = Number(match[1]);
|
|
67
|
+
try {
|
|
68
|
+
process.kill(pid, 0);
|
|
69
|
+
} catch (err) {
|
|
70
|
+
if (!(err instanceof Error && "code" in err && err.code === "EPERM")) return false;
|
|
71
|
+
}
|
|
72
|
+
const known = verified3.get(entry);
|
|
73
|
+
if (known !== void 0) return known;
|
|
74
|
+
let same = pid === process.pid;
|
|
75
|
+
if (!same) {
|
|
76
|
+
try {
|
|
77
|
+
const started = childProcess2.execFileSync("ps", ["-p", String(pid), "-o", "lstart="], { encoding: "utf8" }).trim();
|
|
78
|
+
same = Math.abs(Date.parse(started) / 1e3 - Number(match[2])) <= 2;
|
|
79
|
+
} catch {
|
|
80
|
+
same = false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
verified3.set(entry, same);
|
|
84
|
+
return same;
|
|
85
|
+
};
|
|
86
|
+
let waited = false;
|
|
87
|
+
while (true) {
|
|
88
|
+
const tickets = [];
|
|
89
|
+
for (const entry of fs38.readdirSync(dir)) {
|
|
90
|
+
if (entry !== name2 && !live(entry)) {
|
|
91
|
+
try {
|
|
92
|
+
fs38.unlinkSync(path42.join(dir, entry));
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
tickets.push({
|
|
99
|
+
entry,
|
|
100
|
+
created: fs38.statSync(path42.join(dir, entry), { bigint: true }).ctimeNs
|
|
101
|
+
});
|
|
102
|
+
} catch {
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
tickets.sort(
|
|
106
|
+
(a, b) => a.created === b.created ? a.entry < b.entry ? -1 : 1 : a.created < b.created ? -1 : 1
|
|
107
|
+
);
|
|
108
|
+
const rank = tickets.findIndex((t) => t.entry === name2);
|
|
109
|
+
if (rank < 0) {
|
|
110
|
+
fs38.closeSync(fs38.openSync(ticket, "wx"));
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (rank < limit) {
|
|
114
|
+
if (waited) process.stderr.write(`[chromium-admission] ${label}: admitted
|
|
115
|
+
`);
|
|
116
|
+
return release;
|
|
117
|
+
}
|
|
118
|
+
if (!waited) {
|
|
119
|
+
const holders = tickets.slice(0, limit).map((t) => t.entry.split("-")[0]);
|
|
120
|
+
process.stderr.write(
|
|
121
|
+
`[chromium-admission] ${label}: ${limit} chromium launches already run on this machine (pids ${holders.join(" ")}), queued ${rank - limit + 1}
|
|
122
|
+
`
|
|
123
|
+
);
|
|
124
|
+
waited = true;
|
|
125
|
+
}
|
|
126
|
+
await new Promise((resolve10) => setTimeout(resolve10, 500));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
var init_chromium_admission = __esm({
|
|
130
|
+
"../../scripts/lib/chromium-admission.ts"() {
|
|
131
|
+
"use strict";
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
38
135
|
// ../../scripts/lib/reap-browser.ts
|
|
39
136
|
function currentRuntime() {
|
|
40
137
|
return { platform: process.platform, env: process.env };
|
|
@@ -318,7 +415,20 @@ function installReaper() {
|
|
|
318
415
|
process.on("exit", reap);
|
|
319
416
|
}
|
|
320
417
|
async function launchReapedScoped(launch2, readIdentity2 = processIdentity) {
|
|
321
|
-
const
|
|
418
|
+
const releaseAdmission = await acquireChromiumAdmission({
|
|
419
|
+
fs,
|
|
420
|
+
os,
|
|
421
|
+
path,
|
|
422
|
+
childProcess,
|
|
423
|
+
label: process.argv.slice(1, 3).join(" ")
|
|
424
|
+
});
|
|
425
|
+
let browser;
|
|
426
|
+
try {
|
|
427
|
+
browser = await launch2();
|
|
428
|
+
} catch (err) {
|
|
429
|
+
releaseAdmission();
|
|
430
|
+
throw err;
|
|
431
|
+
}
|
|
322
432
|
let root = rootChromePid(browser);
|
|
323
433
|
if (root === null) {
|
|
324
434
|
try {
|
|
@@ -341,6 +451,7 @@ async function launchReapedScoped(launch2, readIdentity2 = processIdentity) {
|
|
|
341
451
|
untrackReapPid(tracked);
|
|
342
452
|
}
|
|
343
453
|
mine.clear();
|
|
454
|
+
releaseAdmission();
|
|
344
455
|
});
|
|
345
456
|
}
|
|
346
457
|
const reapNow = () => {
|
|
@@ -349,6 +460,7 @@ async function launchReapedScoped(launch2, readIdentity2 = processIdentity) {
|
|
|
349
460
|
untrackReapPid(tracked);
|
|
350
461
|
}
|
|
351
462
|
mine.clear();
|
|
463
|
+
releaseAdmission();
|
|
352
464
|
};
|
|
353
465
|
return { browser, reapNow };
|
|
354
466
|
}
|
|
@@ -538,11 +650,16 @@ async function launchReapedChrome(launch2, opts = {}, rendererTarget, policy = {
|
|
|
538
650
|
policy.processIdentity
|
|
539
651
|
);
|
|
540
652
|
}
|
|
541
|
-
var import_node_child_process, discoveredChromePids, discoveredChromeProcesses, reapPids, installed, signalShutdownClaimed, PLAYWRIGHT_DISABLED_FEATURES, PLAYWRIGHT_ENABLED_FEATURES, DISABLED_FEATURES;
|
|
653
|
+
var childProcess, import_node_child_process, fs, os, path, discoveredChromePids, discoveredChromeProcesses, reapPids, installed, signalShutdownClaimed, PLAYWRIGHT_DISABLED_FEATURES, PLAYWRIGHT_ENABLED_FEATURES, DISABLED_FEATURES;
|
|
542
654
|
var init_reap_browser = __esm({
|
|
543
655
|
"../../scripts/lib/reap-browser.ts"() {
|
|
544
656
|
"use strict";
|
|
657
|
+
childProcess = __toESM(require("node:child_process"), 1);
|
|
545
658
|
import_node_child_process = require("node:child_process");
|
|
659
|
+
fs = __toESM(require("node:fs"), 1);
|
|
660
|
+
os = __toESM(require("node:os"), 1);
|
|
661
|
+
path = __toESM(require("node:path"), 1);
|
|
662
|
+
init_chromium_admission();
|
|
546
663
|
discoveredChromePids = /* @__PURE__ */ new WeakMap();
|
|
547
664
|
discoveredChromeProcesses = /* @__PURE__ */ new WeakMap();
|
|
548
665
|
reapPids = /* @__PURE__ */ new Map();
|
|
@@ -19141,17 +19258,17 @@ function visit(node, visitor) {
|
|
|
19141
19258
|
} else
|
|
19142
19259
|
visit_(null, node, visitor_, Object.freeze([]));
|
|
19143
19260
|
}
|
|
19144
|
-
function visit_(key2, node, visitor,
|
|
19145
|
-
const ctrl = callVisitor(key2, node, visitor,
|
|
19261
|
+
function visit_(key2, node, visitor, path42) {
|
|
19262
|
+
const ctrl = callVisitor(key2, node, visitor, path42);
|
|
19146
19263
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
19147
|
-
replaceNode(key2,
|
|
19148
|
-
return visit_(key2, ctrl, visitor,
|
|
19264
|
+
replaceNode(key2, path42, ctrl);
|
|
19265
|
+
return visit_(key2, ctrl, visitor, path42);
|
|
19149
19266
|
}
|
|
19150
19267
|
if (typeof ctrl !== "symbol") {
|
|
19151
19268
|
if (isCollection(node)) {
|
|
19152
|
-
|
|
19269
|
+
path42 = Object.freeze(path42.concat(node));
|
|
19153
19270
|
for (let i = 0; i < node.items.length; ++i) {
|
|
19154
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
19271
|
+
const ci = visit_(i, node.items[i], visitor, path42);
|
|
19155
19272
|
if (typeof ci === "number")
|
|
19156
19273
|
i = ci - 1;
|
|
19157
19274
|
else if (ci === BREAK)
|
|
@@ -19162,13 +19279,13 @@ function visit_(key2, node, visitor, path41) {
|
|
|
19162
19279
|
}
|
|
19163
19280
|
}
|
|
19164
19281
|
} else if (isPair(node)) {
|
|
19165
|
-
|
|
19166
|
-
const ck = visit_("key", node.key, visitor,
|
|
19282
|
+
path42 = Object.freeze(path42.concat(node));
|
|
19283
|
+
const ck = visit_("key", node.key, visitor, path42);
|
|
19167
19284
|
if (ck === BREAK)
|
|
19168
19285
|
return BREAK;
|
|
19169
19286
|
else if (ck === REMOVE)
|
|
19170
19287
|
node.key = null;
|
|
19171
|
-
const cv = visit_("value", node.value, visitor,
|
|
19288
|
+
const cv = visit_("value", node.value, visitor, path42);
|
|
19172
19289
|
if (cv === BREAK)
|
|
19173
19290
|
return BREAK;
|
|
19174
19291
|
else if (cv === REMOVE)
|
|
@@ -19186,17 +19303,17 @@ async function visitAsync(node, visitor) {
|
|
|
19186
19303
|
} else
|
|
19187
19304
|
await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
19188
19305
|
}
|
|
19189
|
-
async function visitAsync_(key2, node, visitor,
|
|
19190
|
-
const ctrl = await callVisitor(key2, node, visitor,
|
|
19306
|
+
async function visitAsync_(key2, node, visitor, path42) {
|
|
19307
|
+
const ctrl = await callVisitor(key2, node, visitor, path42);
|
|
19191
19308
|
if (isNode(ctrl) || isPair(ctrl)) {
|
|
19192
|
-
replaceNode(key2,
|
|
19193
|
-
return visitAsync_(key2, ctrl, visitor,
|
|
19309
|
+
replaceNode(key2, path42, ctrl);
|
|
19310
|
+
return visitAsync_(key2, ctrl, visitor, path42);
|
|
19194
19311
|
}
|
|
19195
19312
|
if (typeof ctrl !== "symbol") {
|
|
19196
19313
|
if (isCollection(node)) {
|
|
19197
|
-
|
|
19314
|
+
path42 = Object.freeze(path42.concat(node));
|
|
19198
19315
|
for (let i = 0; i < node.items.length; ++i) {
|
|
19199
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
19316
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path42);
|
|
19200
19317
|
if (typeof ci === "number")
|
|
19201
19318
|
i = ci - 1;
|
|
19202
19319
|
else if (ci === BREAK)
|
|
@@ -19207,13 +19324,13 @@ async function visitAsync_(key2, node, visitor, path41) {
|
|
|
19207
19324
|
}
|
|
19208
19325
|
}
|
|
19209
19326
|
} else if (isPair(node)) {
|
|
19210
|
-
|
|
19211
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
19327
|
+
path42 = Object.freeze(path42.concat(node));
|
|
19328
|
+
const ck = await visitAsync_("key", node.key, visitor, path42);
|
|
19212
19329
|
if (ck === BREAK)
|
|
19213
19330
|
return BREAK;
|
|
19214
19331
|
else if (ck === REMOVE)
|
|
19215
19332
|
node.key = null;
|
|
19216
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
19333
|
+
const cv = await visitAsync_("value", node.value, visitor, path42);
|
|
19217
19334
|
if (cv === BREAK)
|
|
19218
19335
|
return BREAK;
|
|
19219
19336
|
else if (cv === REMOVE)
|
|
@@ -19240,23 +19357,23 @@ function initVisitor(visitor) {
|
|
|
19240
19357
|
}
|
|
19241
19358
|
return visitor;
|
|
19242
19359
|
}
|
|
19243
|
-
function callVisitor(key2, node, visitor,
|
|
19360
|
+
function callVisitor(key2, node, visitor, path42) {
|
|
19244
19361
|
if (typeof visitor === "function")
|
|
19245
|
-
return visitor(key2, node,
|
|
19362
|
+
return visitor(key2, node, path42);
|
|
19246
19363
|
if (isMap(node))
|
|
19247
|
-
return visitor.Map?.(key2, node,
|
|
19364
|
+
return visitor.Map?.(key2, node, path42);
|
|
19248
19365
|
if (isSeq(node))
|
|
19249
|
-
return visitor.Seq?.(key2, node,
|
|
19366
|
+
return visitor.Seq?.(key2, node, path42);
|
|
19250
19367
|
if (isPair(node))
|
|
19251
|
-
return visitor.Pair?.(key2, node,
|
|
19368
|
+
return visitor.Pair?.(key2, node, path42);
|
|
19252
19369
|
if (isScalar(node))
|
|
19253
|
-
return visitor.Scalar?.(key2, node,
|
|
19370
|
+
return visitor.Scalar?.(key2, node, path42);
|
|
19254
19371
|
if (isAlias(node))
|
|
19255
|
-
return visitor.Alias?.(key2, node,
|
|
19372
|
+
return visitor.Alias?.(key2, node, path42);
|
|
19256
19373
|
return void 0;
|
|
19257
19374
|
}
|
|
19258
|
-
function replaceNode(key2,
|
|
19259
|
-
const parent =
|
|
19375
|
+
function replaceNode(key2, path42, node) {
|
|
19376
|
+
const parent = path42[path42.length - 1];
|
|
19260
19377
|
if (isCollection(parent)) {
|
|
19261
19378
|
parent.items[key2] = node;
|
|
19262
19379
|
} else if (isPair(parent)) {
|
|
@@ -19856,10 +19973,10 @@ var init_createNode = __esm({
|
|
|
19856
19973
|
});
|
|
19857
19974
|
|
|
19858
19975
|
// ../../node_modules/yaml/browser/dist/nodes/Collection.js
|
|
19859
|
-
function collectionFromPath(schema4,
|
|
19976
|
+
function collectionFromPath(schema4, path42, value) {
|
|
19860
19977
|
let v = value;
|
|
19861
|
-
for (let i =
|
|
19862
|
-
const k =
|
|
19978
|
+
for (let i = path42.length - 1; i >= 0; --i) {
|
|
19979
|
+
const k = path42[i];
|
|
19863
19980
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
19864
19981
|
const a = [];
|
|
19865
19982
|
a[k] = v;
|
|
@@ -19884,7 +20001,7 @@ var init_Collection = __esm({
|
|
|
19884
20001
|
init_createNode();
|
|
19885
20002
|
init_identity();
|
|
19886
20003
|
init_Node();
|
|
19887
|
-
isEmptyPath = (
|
|
20004
|
+
isEmptyPath = (path42) => path42 == null || typeof path42 === "object" && !!path42[Symbol.iterator]().next().done;
|
|
19888
20005
|
Collection = class extends NodeBase {
|
|
19889
20006
|
constructor(type, schema4) {
|
|
19890
20007
|
super(type);
|
|
@@ -19914,11 +20031,11 @@ var init_Collection = __esm({
|
|
|
19914
20031
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
19915
20032
|
* that already exists in the map.
|
|
19916
20033
|
*/
|
|
19917
|
-
addIn(
|
|
19918
|
-
if (isEmptyPath(
|
|
20034
|
+
addIn(path42, value) {
|
|
20035
|
+
if (isEmptyPath(path42))
|
|
19919
20036
|
this.add(value);
|
|
19920
20037
|
else {
|
|
19921
|
-
const [key2, ...rest] =
|
|
20038
|
+
const [key2, ...rest] = path42;
|
|
19922
20039
|
const node = this.get(key2, true);
|
|
19923
20040
|
if (isCollection(node))
|
|
19924
20041
|
node.addIn(rest, value);
|
|
@@ -19932,8 +20049,8 @@ var init_Collection = __esm({
|
|
|
19932
20049
|
* Removes a value from the collection.
|
|
19933
20050
|
* @returns `true` if the item was found and removed.
|
|
19934
20051
|
*/
|
|
19935
|
-
deleteIn(
|
|
19936
|
-
const [key2, ...rest] =
|
|
20052
|
+
deleteIn(path42) {
|
|
20053
|
+
const [key2, ...rest] = path42;
|
|
19937
20054
|
if (rest.length === 0)
|
|
19938
20055
|
return this.delete(key2);
|
|
19939
20056
|
const node = this.get(key2, true);
|
|
@@ -19947,8 +20064,8 @@ var init_Collection = __esm({
|
|
|
19947
20064
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
19948
20065
|
* `true` (collections are always returned intact).
|
|
19949
20066
|
*/
|
|
19950
|
-
getIn(
|
|
19951
|
-
const [key2, ...rest] =
|
|
20067
|
+
getIn(path42, keepScalar) {
|
|
20068
|
+
const [key2, ...rest] = path42;
|
|
19952
20069
|
const node = this.get(key2, true);
|
|
19953
20070
|
if (rest.length === 0)
|
|
19954
20071
|
return !keepScalar && isScalar(node) ? node.value : node;
|
|
@@ -19966,8 +20083,8 @@ var init_Collection = __esm({
|
|
|
19966
20083
|
/**
|
|
19967
20084
|
* Checks if the collection includes a value with the key `key`.
|
|
19968
20085
|
*/
|
|
19969
|
-
hasIn(
|
|
19970
|
-
const [key2, ...rest] =
|
|
20086
|
+
hasIn(path42) {
|
|
20087
|
+
const [key2, ...rest] = path42;
|
|
19971
20088
|
if (rest.length === 0)
|
|
19972
20089
|
return this.has(key2);
|
|
19973
20090
|
const node = this.get(key2, true);
|
|
@@ -19977,8 +20094,8 @@ var init_Collection = __esm({
|
|
|
19977
20094
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
19978
20095
|
* boolean to add/remove the item from the set.
|
|
19979
20096
|
*/
|
|
19980
|
-
setIn(
|
|
19981
|
-
const [key2, ...rest] =
|
|
20097
|
+
setIn(path42, value) {
|
|
20098
|
+
const [key2, ...rest] = path42;
|
|
19982
20099
|
if (rest.length === 0) {
|
|
19983
20100
|
this.set(key2, value);
|
|
19984
20101
|
} else {
|
|
@@ -22412,9 +22529,9 @@ var init_Document = __esm({
|
|
|
22412
22529
|
this.contents.add(value);
|
|
22413
22530
|
}
|
|
22414
22531
|
/** Adds a value to the document. */
|
|
22415
|
-
addIn(
|
|
22532
|
+
addIn(path42, value) {
|
|
22416
22533
|
if (assertCollection(this.contents))
|
|
22417
|
-
this.contents.addIn(
|
|
22534
|
+
this.contents.addIn(path42, value);
|
|
22418
22535
|
}
|
|
22419
22536
|
/**
|
|
22420
22537
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -22489,14 +22606,14 @@ var init_Document = __esm({
|
|
|
22489
22606
|
* Removes a value from the document.
|
|
22490
22607
|
* @returns `true` if the item was found and removed.
|
|
22491
22608
|
*/
|
|
22492
|
-
deleteIn(
|
|
22493
|
-
if (isEmptyPath(
|
|
22609
|
+
deleteIn(path42) {
|
|
22610
|
+
if (isEmptyPath(path42)) {
|
|
22494
22611
|
if (this.contents == null)
|
|
22495
22612
|
return false;
|
|
22496
22613
|
this.contents = null;
|
|
22497
22614
|
return true;
|
|
22498
22615
|
}
|
|
22499
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
22616
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path42) : false;
|
|
22500
22617
|
}
|
|
22501
22618
|
/**
|
|
22502
22619
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -22511,10 +22628,10 @@ var init_Document = __esm({
|
|
|
22511
22628
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
22512
22629
|
* `true` (collections are always returned intact).
|
|
22513
22630
|
*/
|
|
22514
|
-
getIn(
|
|
22515
|
-
if (isEmptyPath(
|
|
22631
|
+
getIn(path42, keepScalar) {
|
|
22632
|
+
if (isEmptyPath(path42))
|
|
22516
22633
|
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
|
|
22517
|
-
return isCollection(this.contents) ? this.contents.getIn(
|
|
22634
|
+
return isCollection(this.contents) ? this.contents.getIn(path42, keepScalar) : void 0;
|
|
22518
22635
|
}
|
|
22519
22636
|
/**
|
|
22520
22637
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -22525,10 +22642,10 @@ var init_Document = __esm({
|
|
|
22525
22642
|
/**
|
|
22526
22643
|
* Checks if the document includes a value at `path`.
|
|
22527
22644
|
*/
|
|
22528
|
-
hasIn(
|
|
22529
|
-
if (isEmptyPath(
|
|
22645
|
+
hasIn(path42) {
|
|
22646
|
+
if (isEmptyPath(path42))
|
|
22530
22647
|
return this.contents !== void 0;
|
|
22531
|
-
return isCollection(this.contents) ? this.contents.hasIn(
|
|
22648
|
+
return isCollection(this.contents) ? this.contents.hasIn(path42) : false;
|
|
22532
22649
|
}
|
|
22533
22650
|
/**
|
|
22534
22651
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -22545,13 +22662,13 @@ var init_Document = __esm({
|
|
|
22545
22662
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
22546
22663
|
* boolean to add/remove the item from the set.
|
|
22547
22664
|
*/
|
|
22548
|
-
setIn(
|
|
22549
|
-
if (isEmptyPath(
|
|
22665
|
+
setIn(path42, value) {
|
|
22666
|
+
if (isEmptyPath(path42)) {
|
|
22550
22667
|
this.contents = value;
|
|
22551
22668
|
} else if (this.contents == null) {
|
|
22552
|
-
this.contents = collectionFromPath(this.schema, Array.from(
|
|
22669
|
+
this.contents = collectionFromPath(this.schema, Array.from(path42), value);
|
|
22553
22670
|
} else if (assertCollection(this.contents)) {
|
|
22554
|
-
this.contents.setIn(
|
|
22671
|
+
this.contents.setIn(path42, value);
|
|
22555
22672
|
}
|
|
22556
22673
|
}
|
|
22557
22674
|
/**
|
|
@@ -24456,15 +24573,15 @@ function visit2(cst, visitor) {
|
|
|
24456
24573
|
cst = { start: cst.start, value: cst.value };
|
|
24457
24574
|
_visit(Object.freeze([]), cst, visitor);
|
|
24458
24575
|
}
|
|
24459
|
-
function _visit(
|
|
24460
|
-
let ctrl = visitor(item,
|
|
24576
|
+
function _visit(path42, item, visitor) {
|
|
24577
|
+
let ctrl = visitor(item, path42);
|
|
24461
24578
|
if (typeof ctrl === "symbol")
|
|
24462
24579
|
return ctrl;
|
|
24463
24580
|
for (const field of ["key", "value"]) {
|
|
24464
24581
|
const token = item[field];
|
|
24465
24582
|
if (token && "items" in token) {
|
|
24466
24583
|
for (let i = 0; i < token.items.length; ++i) {
|
|
24467
|
-
const ci = _visit(Object.freeze(
|
|
24584
|
+
const ci = _visit(Object.freeze(path42.concat([[field, i]])), token.items[i], visitor);
|
|
24468
24585
|
if (typeof ci === "number")
|
|
24469
24586
|
i = ci - 1;
|
|
24470
24587
|
else if (ci === BREAK2)
|
|
@@ -24475,10 +24592,10 @@ function _visit(path41, item, visitor) {
|
|
|
24475
24592
|
}
|
|
24476
24593
|
}
|
|
24477
24594
|
if (typeof ctrl === "function" && field === "key")
|
|
24478
|
-
ctrl = ctrl(item,
|
|
24595
|
+
ctrl = ctrl(item, path42);
|
|
24479
24596
|
}
|
|
24480
24597
|
}
|
|
24481
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
24598
|
+
return typeof ctrl === "function" ? ctrl(item, path42) : ctrl;
|
|
24482
24599
|
}
|
|
24483
24600
|
var BREAK2, SKIP2, REMOVE2;
|
|
24484
24601
|
var init_cst_visit = __esm({
|
|
@@ -24489,9 +24606,9 @@ var init_cst_visit = __esm({
|
|
|
24489
24606
|
visit2.BREAK = BREAK2;
|
|
24490
24607
|
visit2.SKIP = SKIP2;
|
|
24491
24608
|
visit2.REMOVE = REMOVE2;
|
|
24492
|
-
visit2.itemAtPath = (cst,
|
|
24609
|
+
visit2.itemAtPath = (cst, path42) => {
|
|
24493
24610
|
let item = cst;
|
|
24494
|
-
for (const [field, index] of
|
|
24611
|
+
for (const [field, index] of path42) {
|
|
24495
24612
|
const tok = item?.[field];
|
|
24496
24613
|
if (tok && "items" in tok) {
|
|
24497
24614
|
item = tok.items[index];
|
|
@@ -24500,9 +24617,9 @@ var init_cst_visit = __esm({
|
|
|
24500
24617
|
}
|
|
24501
24618
|
return item;
|
|
24502
24619
|
};
|
|
24503
|
-
visit2.parentCollection = (cst,
|
|
24504
|
-
const parent = visit2.itemAtPath(cst,
|
|
24505
|
-
const field =
|
|
24620
|
+
visit2.parentCollection = (cst, path42) => {
|
|
24621
|
+
const parent = visit2.itemAtPath(cst, path42.slice(0, -1));
|
|
24622
|
+
const field = path42[path42.length - 1][0];
|
|
24506
24623
|
const coll = parent?.[field];
|
|
24507
24624
|
if (coll && "items" in coll)
|
|
24508
24625
|
return coll;
|
|
@@ -25805,14 +25922,14 @@ var init_parser = __esm({
|
|
|
25805
25922
|
case "scalar":
|
|
25806
25923
|
case "single-quoted-scalar":
|
|
25807
25924
|
case "double-quoted-scalar": {
|
|
25808
|
-
const
|
|
25925
|
+
const fs38 = this.flowScalar(this.type);
|
|
25809
25926
|
if (atNextItem || it.value) {
|
|
25810
|
-
map2.items.push({ start, key:
|
|
25927
|
+
map2.items.push({ start, key: fs38, sep: [] });
|
|
25811
25928
|
this.onKeyLine = true;
|
|
25812
25929
|
} else if (it.sep) {
|
|
25813
|
-
this.stack.push(
|
|
25930
|
+
this.stack.push(fs38);
|
|
25814
25931
|
} else {
|
|
25815
|
-
Object.assign(it, { key:
|
|
25932
|
+
Object.assign(it, { key: fs38, sep: [] });
|
|
25816
25933
|
this.onKeyLine = true;
|
|
25817
25934
|
}
|
|
25818
25935
|
return;
|
|
@@ -25940,13 +26057,13 @@ var init_parser = __esm({
|
|
|
25940
26057
|
case "scalar":
|
|
25941
26058
|
case "single-quoted-scalar":
|
|
25942
26059
|
case "double-quoted-scalar": {
|
|
25943
|
-
const
|
|
26060
|
+
const fs38 = this.flowScalar(this.type);
|
|
25944
26061
|
if (!it || it.value)
|
|
25945
|
-
fc.items.push({ start: [], key:
|
|
26062
|
+
fc.items.push({ start: [], key: fs38, sep: [] });
|
|
25946
26063
|
else if (it.sep)
|
|
25947
|
-
this.stack.push(
|
|
26064
|
+
this.stack.push(fs38);
|
|
25948
26065
|
else
|
|
25949
|
-
Object.assign(it, { key:
|
|
26066
|
+
Object.assign(it, { key: fs38, sep: [] });
|
|
25950
26067
|
return;
|
|
25951
26068
|
}
|
|
25952
26069
|
case "flow-map-end":
|
|
@@ -27326,9 +27443,9 @@ function safeChildPlistName(value) {
|
|
|
27326
27443
|
name: file.toLowerCase().endsWith(".plist") ? file : `${file}.plist`
|
|
27327
27444
|
};
|
|
27328
27445
|
}
|
|
27329
|
-
async function readableSettingsBundle(
|
|
27446
|
+
async function readableSettingsBundle(path42) {
|
|
27330
27447
|
try {
|
|
27331
|
-
const root = await (0, import_promises.stat)((0, import_node_path.join)(
|
|
27448
|
+
const root = await (0, import_promises.stat)((0, import_node_path.join)(path42, "Root.plist"));
|
|
27332
27449
|
return root.isFile() && root.size <= MAX_PLIST_BYTES;
|
|
27333
27450
|
} catch {
|
|
27334
27451
|
return false;
|
|
@@ -27373,11 +27490,11 @@ async function settingsBundleFingerprint(bundlePath) {
|
|
|
27373
27490
|
return null;
|
|
27374
27491
|
}
|
|
27375
27492
|
}
|
|
27376
|
-
async function parsePlistRecord(
|
|
27493
|
+
async function parsePlistRecord(path42) {
|
|
27377
27494
|
try {
|
|
27378
|
-
const metadata = await (0, import_promises.stat)(
|
|
27495
|
+
const metadata = await (0, import_promises.stat)(path42);
|
|
27379
27496
|
if (!metadata.isFile() || metadata.size > MAX_PLIST_BYTES) return null;
|
|
27380
|
-
const source = await (0, import_promises.readFile)(
|
|
27497
|
+
const source = await (0, import_promises.readFile)(path42, "utf8");
|
|
27381
27498
|
const parsed = parsePlistSource(source);
|
|
27382
27499
|
return isRecord2(parsed) ? parsed : null;
|
|
27383
27500
|
} catch {
|
|
@@ -27723,7 +27840,7 @@ async function tcpPing(port, timeout = TCP_GATE_MS) {
|
|
|
27723
27840
|
return null;
|
|
27724
27841
|
}
|
|
27725
27842
|
}
|
|
27726
|
-
function httpGet(hostname, port,
|
|
27843
|
+
function httpGet(hostname, port, path42, method = "GET", timeout = TIMEOUT_MS, headers = {}) {
|
|
27727
27844
|
return new Promise((resolve10) => {
|
|
27728
27845
|
let settled = false;
|
|
27729
27846
|
let killing = false;
|
|
@@ -27732,7 +27849,7 @@ function httpGet(hostname, port, path41, method = "GET", timeout = TIMEOUT_MS, h
|
|
|
27732
27849
|
settled = true;
|
|
27733
27850
|
resolve10(value);
|
|
27734
27851
|
};
|
|
27735
|
-
const req = import_http.default.request({ hostname, port, path:
|
|
27852
|
+
const req = import_http.default.request({ hostname, port, path: path42, method, headers }, (res) => {
|
|
27736
27853
|
let body = "";
|
|
27737
27854
|
res.on("data", (c) => body += c.toString());
|
|
27738
27855
|
const contentType = (() => {
|
|
@@ -32542,8 +32659,8 @@ function imagesetFiles(images) {
|
|
|
32542
32659
|
];
|
|
32543
32660
|
}).sort((a, b) => a.scale - b.scale);
|
|
32544
32661
|
}
|
|
32545
|
-
function flatScale(
|
|
32546
|
-
const match = /@([23])x\.[^./]+$/.exec(
|
|
32662
|
+
function flatScale(path42) {
|
|
32663
|
+
const match = /@([23])x\.[^./]+$/.exec(path42);
|
|
32547
32664
|
return match ? Number(match[1]) : 1;
|
|
32548
32665
|
}
|
|
32549
32666
|
function providesNamespace(text3) {
|
|
@@ -32570,8 +32687,8 @@ function catalogEntryName(contentsPath, kind, readText2) {
|
|
|
32570
32687
|
}
|
|
32571
32688
|
return segments.join("/");
|
|
32572
32689
|
}
|
|
32573
|
-
function isFlatResourceImage(
|
|
32574
|
-
return
|
|
32690
|
+
function isFlatResourceImage(path42) {
|
|
32691
|
+
return path42.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path42));
|
|
32575
32692
|
}
|
|
32576
32693
|
function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
32577
32694
|
const table = [];
|
|
@@ -32584,7 +32701,7 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
32584
32701
|
seen.set(bundlePath, names);
|
|
32585
32702
|
return { bundlePath, names };
|
|
32586
32703
|
};
|
|
32587
|
-
const catalogs = paths.filter((
|
|
32704
|
+
const catalogs = paths.filter((path42) => baseOf(path42) === "Contents.json");
|
|
32588
32705
|
for (const contentsPath of catalogs) {
|
|
32589
32706
|
const name2 = catalogEntryName(contentsPath, ".imageset", readText2);
|
|
32590
32707
|
if (name2 === null) continue;
|
|
@@ -32612,13 +32729,13 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
|
|
|
32612
32729
|
bundlePath
|
|
32613
32730
|
});
|
|
32614
32731
|
}
|
|
32615
|
-
for (const
|
|
32616
|
-
if (!isFlatResourceImage(
|
|
32617
|
-
const name2 = baseOf(
|
|
32618
|
-
const { bundlePath, names } = namesFor(
|
|
32732
|
+
for (const path42 of paths) {
|
|
32733
|
+
if (!isFlatResourceImage(path42)) continue;
|
|
32734
|
+
const name2 = baseOf(path42).slice(0, -extOf(path42).length);
|
|
32735
|
+
const { bundlePath, names } = namesFor(path42);
|
|
32619
32736
|
if (name2 === "" || names.has(name2)) continue;
|
|
32620
32737
|
names.add(name2);
|
|
32621
|
-
table.push({ name: name2, file:
|
|
32738
|
+
table.push({ name: name2, file: path42, scale: flatScale(path42), bundlePath });
|
|
32622
32739
|
}
|
|
32623
32740
|
return table;
|
|
32624
32741
|
}
|
|
@@ -32647,7 +32764,7 @@ function colorsetValue(color) {
|
|
|
32647
32764
|
}
|
|
32648
32765
|
function enumerateBundleColors(paths, readText2) {
|
|
32649
32766
|
const table = {};
|
|
32650
|
-
for (const contentsPath of paths.filter((
|
|
32767
|
+
for (const contentsPath of paths.filter((path42) => baseOf(path42) === "Contents.json")) {
|
|
32651
32768
|
const name2 = catalogEntryName(contentsPath, ".colorset", readText2);
|
|
32652
32769
|
if (name2 === null || name2 in table) continue;
|
|
32653
32770
|
let colors;
|
|
@@ -32711,8 +32828,8 @@ function axisExtremes(points) {
|
|
|
32711
32828
|
function pathBounds(d) {
|
|
32712
32829
|
const xs = [];
|
|
32713
32830
|
const ys = [];
|
|
32714
|
-
for (const
|
|
32715
|
-
(0, import_svgpath.default)(
|
|
32831
|
+
for (const path42 of d)
|
|
32832
|
+
(0, import_svgpath.default)(path42).abs().unshort().unarc().iterate((segment, _index, x, y) => {
|
|
32716
32833
|
const [command, ...args] = segment;
|
|
32717
32834
|
if (command === "M" || command === "L") {
|
|
32718
32835
|
xs.push(Number(args[0]));
|
|
@@ -32739,7 +32856,7 @@ function guide(svg, id, axis) {
|
|
|
32739
32856
|
}
|
|
32740
32857
|
function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
32741
32858
|
const table = {};
|
|
32742
|
-
for (const contentsPath of paths.filter((
|
|
32859
|
+
for (const contentsPath of paths.filter((path42) => baseOf(path42) === "Contents.json")) {
|
|
32743
32860
|
const name2 = catalogEntryName(contentsPath, ".symbolset", readText2);
|
|
32744
32861
|
if (name2 === null) continue;
|
|
32745
32862
|
const bundle = bundleForFile(contentsPath);
|
|
@@ -32775,24 +32892,24 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
|
|
|
32775
32892
|
viewBox: "0 0 24 24",
|
|
32776
32893
|
advance,
|
|
32777
32894
|
box: [12 - advance / 2, 12 - tall / 2, advance, tall],
|
|
32778
|
-
layers: d.map((
|
|
32779
|
-
d: (0, import_svgpath.default)(
|
|
32895
|
+
layers: d.map((path42) => ({
|
|
32896
|
+
d: (0, import_svgpath.default)(path42).abs().scale(scale).translate(translateX, translateY).round(3).toString()
|
|
32780
32897
|
}))
|
|
32781
32898
|
};
|
|
32782
32899
|
}
|
|
32783
32900
|
return table;
|
|
32784
32901
|
}
|
|
32785
|
-
function isCopiedResource(
|
|
32786
|
-
if (
|
|
32787
|
-
const ext = extOf(
|
|
32902
|
+
function isCopiedResource(path42) {
|
|
32903
|
+
if (path42.split("/").some((segment) => segment.endsWith(".atlasc"))) return true;
|
|
32904
|
+
const ext = extOf(path42);
|
|
32788
32905
|
if (ext === ".json" || ext === ".xcstrings") return true;
|
|
32789
|
-
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !
|
|
32906
|
+
return !RASTER_EXTENSIONS.has(ext) && !COMPILED_EXTENSIONS.has(ext) && !path42.split("/").some((segment) => NESTED_BUNDLE_DIR.test(segment));
|
|
32790
32907
|
}
|
|
32791
32908
|
function enumerateBundleResources(paths) {
|
|
32792
32909
|
const found = [];
|
|
32793
32910
|
const seen = /* @__PURE__ */ new Set();
|
|
32794
32911
|
const ordered = [...paths].filter(
|
|
32795
|
-
(
|
|
32912
|
+
(path42) => path42.split("/").includes("Resources") && path42.split("/").every((segment) => segment !== "" && segment !== "..") && isCopiedResource(path42)
|
|
32796
32913
|
).sort((a, b) => {
|
|
32797
32914
|
const aDepth = a.split("/").length;
|
|
32798
32915
|
const bDepth = b.split("/").length;
|
|
@@ -34111,10 +34228,10 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34111
34228
|
owners.push(...physical.map(() => current));
|
|
34112
34229
|
};
|
|
34113
34230
|
const scoped = (body) => (symbol, ...rest) => {
|
|
34114
|
-
const
|
|
34115
|
-
if (omit.has(
|
|
34231
|
+
const path42 = pathOf(symbol);
|
|
34232
|
+
if (omit.has(path42)) return void skipped.push({ path: path42, reason: omit.get(path42) });
|
|
34116
34233
|
const previous = current;
|
|
34117
|
-
current =
|
|
34234
|
+
current = path42;
|
|
34118
34235
|
try {
|
|
34119
34236
|
body(symbol, ...rest);
|
|
34120
34237
|
} finally {
|
|
@@ -34134,14 +34251,14 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34134
34251
|
const access = (symbol, openOwner) => symbol.accessLevel === "open" && openOwner ? "open" : "public";
|
|
34135
34252
|
const emitMember = scoped(
|
|
34136
34253
|
(member, indent, context) => {
|
|
34137
|
-
const
|
|
34254
|
+
const path42 = pathOf(member);
|
|
34138
34255
|
if (TYPE_KINDS.has(member.kind.identifier)) {
|
|
34139
34256
|
emitType(member, indent);
|
|
34140
34257
|
return;
|
|
34141
34258
|
}
|
|
34142
34259
|
if (member.kind.identifier === "swift.enum.case") return;
|
|
34143
34260
|
if (!MEMBER_KINDS.has(member.kind.identifier)) {
|
|
34144
|
-
skipped.push({ path:
|
|
34261
|
+
skipped.push({ path: path42, reason: `unhandled ${member.kind.identifier}` });
|
|
34145
34262
|
return;
|
|
34146
34263
|
}
|
|
34147
34264
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(member));
|
|
@@ -34155,12 +34272,12 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34155
34272
|
const final = context.inClass && flags.has("final") ? "final " : "";
|
|
34156
34273
|
const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
|
|
34157
34274
|
let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
|
|
34158
|
-
const override = context.inClass && !options.plain?.has(
|
|
34275
|
+
const override = context.inClass && !options.plain?.has(path42) && (flags.has("override") || overrides.has(member.identifier.precise) || options.forcedOverride?.has(path42) || isObjC(member) && path42.endsWith(".init()")) ? "override " : "";
|
|
34159
34276
|
const head = `${indent}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
|
|
34160
|
-
const measured = behavior.get(
|
|
34161
|
-
if (measured) used.add(
|
|
34277
|
+
const measured = behavior.get(path42);
|
|
34278
|
+
if (measured) used.add(path42);
|
|
34162
34279
|
const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
|
|
34163
|
-
const body = overloadBody ?? measured?.body ?? trap(
|
|
34280
|
+
const body = overloadBody ?? measured?.body ?? trap(path42);
|
|
34164
34281
|
switch (member.kind.identifier) {
|
|
34165
34282
|
case "swift.property":
|
|
34166
34283
|
case "swift.type.property":
|
|
@@ -34181,7 +34298,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34181
34298
|
return;
|
|
34182
34299
|
}
|
|
34183
34300
|
emit(
|
|
34184
|
-
`${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(
|
|
34301
|
+
`${head}${computed} { get${effects} { ${body} }${settable && !effects ? ` ${parsed.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? trap(path42)} }` : ""} }`
|
|
34185
34302
|
);
|
|
34186
34303
|
return;
|
|
34187
34304
|
}
|
|
@@ -34234,7 +34351,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34234
34351
|
};
|
|
34235
34352
|
const emitType = scoped(
|
|
34236
34353
|
(symbol, indent) => {
|
|
34237
|
-
const
|
|
34354
|
+
const path42 = pathOf(symbol);
|
|
34238
34355
|
const id = symbol.identifier.precise;
|
|
34239
34356
|
const inner = `${indent} `;
|
|
34240
34357
|
switch (symbol.kind.identifier) {
|
|
@@ -34246,10 +34363,10 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34246
34363
|
case "swift.class": {
|
|
34247
34364
|
const shape = header(symbol, "class", indent);
|
|
34248
34365
|
if (!shape)
|
|
34249
|
-
return void skipped.push({ path:
|
|
34250
|
-
const parent = options.superclasses?.get(
|
|
34366
|
+
return void skipped.push({ path: path42, reason: `unparsed class ${text(symbol)}` });
|
|
34367
|
+
const parent = options.superclasses?.get(path42) ?? superclass.get(id);
|
|
34251
34368
|
const blocked = classBlocked(id);
|
|
34252
|
-
if (blocked) return void skipped.push({ path:
|
|
34369
|
+
if (blocked) return void skipped.push({ path: path42, reason: blocked });
|
|
34253
34370
|
const ancestors = /* @__PURE__ */ new Set();
|
|
34254
34371
|
for (let at = superId.get(id); at; at = superId.get(at))
|
|
34255
34372
|
for (const name2 of conforms.get(at) ?? []) ancestors.add(name2);
|
|
@@ -34265,9 +34382,9 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34265
34382
|
`${indent}${shape.attrs}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
|
|
34266
34383
|
);
|
|
34267
34384
|
const members = membersOf(id);
|
|
34268
|
-
const extra = options.behavior?.get(
|
|
34385
|
+
const extra = options.behavior?.get(path42)?.members;
|
|
34269
34386
|
if (extra) {
|
|
34270
|
-
used.add(
|
|
34387
|
+
used.add(path42);
|
|
34271
34388
|
emit(`${inner}${extra}`);
|
|
34272
34389
|
}
|
|
34273
34390
|
for (const member of members)
|
|
@@ -34319,13 +34436,13 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34319
34436
|
continue;
|
|
34320
34437
|
have.add(witnessKey(member));
|
|
34321
34438
|
have.add(sideLeaf(member));
|
|
34322
|
-
emitWitness(member, inner,
|
|
34439
|
+
emitWitness(member, inner, path42);
|
|
34323
34440
|
}
|
|
34324
34441
|
}
|
|
34325
34442
|
const coder = members.some((member) => leaf(member) === "init(coder:)");
|
|
34326
34443
|
if (designated && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
|
|
34327
34444
|
emit(
|
|
34328
|
-
`${inner}public required init?(coder: NSCoder) { ${trap(`${
|
|
34445
|
+
`${inner}public required init?(coder: NSCoder) { ${trap(`${path42}.init(coder:)`)} }`
|
|
34329
34446
|
);
|
|
34330
34447
|
emit(`${indent}}`);
|
|
34331
34448
|
return;
|
|
@@ -34333,7 +34450,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34333
34450
|
case "swift.struct": {
|
|
34334
34451
|
const shape = header(symbol, "struct", indent);
|
|
34335
34452
|
if (!shape)
|
|
34336
|
-
return void skipped.push({ path:
|
|
34453
|
+
return void skipped.push({ path: path42, reason: `unparsed struct ${text(symbol)}` });
|
|
34337
34454
|
const members = membersOf(id);
|
|
34338
34455
|
const raw2 = rawType(members);
|
|
34339
34456
|
const list2 = inheritance(id);
|
|
@@ -34365,7 +34482,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34365
34482
|
case "swift.enum": {
|
|
34366
34483
|
const shape = header(symbol, "enum", indent);
|
|
34367
34484
|
if (!shape)
|
|
34368
|
-
return void skipped.push({ path:
|
|
34485
|
+
return void skipped.push({ path: path42, reason: `unparsed enum ${text(symbol)}` });
|
|
34369
34486
|
const members = membersOf(id);
|
|
34370
34487
|
const raw2 = rawType(members);
|
|
34371
34488
|
const cases = members.filter(
|
|
@@ -34374,7 +34491,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34374
34491
|
const missing = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
|
|
34375
34492
|
if (raw2 && isObjC(symbol) && missing.length > 0)
|
|
34376
34493
|
return void skipped.push({
|
|
34377
|
-
path:
|
|
34494
|
+
path: path42,
|
|
34378
34495
|
reason: `no header value for ${missing.map(leaf).join(", ")}`
|
|
34379
34496
|
});
|
|
34380
34497
|
const list2 = inheritance(id, raw2 ?? void 0).filter(
|
|
@@ -34414,7 +34531,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34414
34531
|
const shape = header(symbol, "protocol", indent);
|
|
34415
34532
|
if (!shape)
|
|
34416
34533
|
return void skipped.push({
|
|
34417
|
-
path:
|
|
34534
|
+
path: path42,
|
|
34418
34535
|
reason: `unparsed protocol ${text(symbol)}`
|
|
34419
34536
|
});
|
|
34420
34537
|
const list2 = [...isObjC(symbol) ? ["AnyObject"] : [], ...inheritance(id)];
|
|
@@ -34439,7 +34556,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34439
34556
|
}
|
|
34440
34557
|
emit(`${indent}}`);
|
|
34441
34558
|
if (defaults.length > 0) {
|
|
34442
|
-
emit(`${indent}extension ${
|
|
34559
|
+
emit(`${indent}extension ${path42} {`);
|
|
34443
34560
|
for (const member of defaults) {
|
|
34444
34561
|
const decl = text(member);
|
|
34445
34562
|
if (optional.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
|
|
@@ -34485,7 +34602,7 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34485
34602
|
return init ? /rawValue:\s*([^)]+)\)/.exec(text(init))?.[1]?.trim() ?? null : null;
|
|
34486
34603
|
};
|
|
34487
34604
|
const emitGlobal = scoped((symbol) => {
|
|
34488
|
-
const
|
|
34605
|
+
const path42 = pathOf(symbol);
|
|
34489
34606
|
const kind = symbol.kind.identifier;
|
|
34490
34607
|
if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
|
|
34491
34608
|
const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol));
|
|
@@ -34496,22 +34613,22 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34496
34613
|
if (fix && !/^(?:prefix|infix|postfix)\b/.test(spelled))
|
|
34497
34614
|
spelled = `${fix} ${spelled}`;
|
|
34498
34615
|
}
|
|
34499
|
-
const measured = behavior.get(
|
|
34500
|
-
if (measured) used.add(
|
|
34616
|
+
const measured = behavior.get(path42);
|
|
34617
|
+
if (measured) used.add(path42);
|
|
34501
34618
|
const overloadBody = /\basync\b/.test(spelled) ? measured?.asyncBody : /\bResult</.test(spelled) ? measured?.resultBody : void 0;
|
|
34502
34619
|
emit(
|
|
34503
|
-
`${attrs}public ${spelled} { ${overloadBody ?? measured?.body ?? trap(
|
|
34620
|
+
`${attrs}public ${spelled} { ${overloadBody ?? measured?.body ?? trap(path42)} }`
|
|
34504
34621
|
);
|
|
34505
34622
|
} else if (kind === "swift.var") {
|
|
34506
34623
|
const parsed = splitAccessors(text(symbol).replace(/^let /, "var "));
|
|
34507
|
-
const measured = behavior.get(
|
|
34508
|
-
if (measured) used.add(
|
|
34509
|
-
emit(`public ${parsed.decl} { ${measured?.body ?? trap(
|
|
34510
|
-
} else skipped.push({ path:
|
|
34624
|
+
const measured = behavior.get(path42);
|
|
34625
|
+
if (measured) used.add(path42);
|
|
34626
|
+
emit(`public ${parsed.decl} { ${measured?.body ?? trap(path42)} }`);
|
|
34627
|
+
} else skipped.push({ path: path42, reason: `unhandled top-level ${kind}` });
|
|
34511
34628
|
});
|
|
34512
34629
|
const roots = [...byId.values()].filter((symbol) => !owner.has(symbol.identifier.precise) && !unavailable(symbol)).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
|
|
34513
34630
|
for (const symbol of roots) {
|
|
34514
|
-
const
|
|
34631
|
+
const path42 = pathOf(symbol);
|
|
34515
34632
|
if (TYPE_KINDS.has(symbol.kind.identifier)) emitType(symbol, "");
|
|
34516
34633
|
else emitGlobal(symbol);
|
|
34517
34634
|
}
|
|
@@ -34552,9 +34669,9 @@ function emitSwiftStandin(graphs, options) {
|
|
|
34552
34669
|
...imports.map((name2) => `import ${name2}`),
|
|
34553
34670
|
""
|
|
34554
34671
|
];
|
|
34555
|
-
for (const
|
|
34556
|
-
if (!used.has(
|
|
34557
|
-
skipped.push({ path:
|
|
34672
|
+
for (const path42 of behavior.keys())
|
|
34673
|
+
if (!used.has(path42))
|
|
34674
|
+
skipped.push({ path: path42, reason: "behavior names no emitted declaration" });
|
|
34558
34675
|
return {
|
|
34559
34676
|
source: `${[...banner, ...lines].join("\n")}
|
|
34560
34677
|
`,
|
|
@@ -34641,7 +34758,7 @@ var init_swift_standin_emit = __esm({
|
|
|
34641
34758
|
sideLeaf = (symbol) => `${symbol.kind.identifier.startsWith("swift.type.") ? "type" : "instance"}|leaf|${leaf(symbol)}`;
|
|
34642
34759
|
isObjC = (symbol) => symbol.identifier.precise.startsWith("c:");
|
|
34643
34760
|
synthesizedEquality = (symbol, conforms) => conforms.includes("Hashable") ? ["==(_:_:)", "hash(into:)", "hashValue"].includes(leaf(symbol)) : conforms.includes("Equatable") && leaf(symbol) === "==(_:_:)";
|
|
34644
|
-
trap = (
|
|
34761
|
+
trap = (path42) => `fatalError("${path42} is a binary framework peach cannot run")`;
|
|
34645
34762
|
KEYWORDS = /* @__PURE__ */ new Set([
|
|
34646
34763
|
"Type",
|
|
34647
34764
|
"Protocol",
|
|
@@ -39473,8 +39590,8 @@ function sourceEntryPath() {
|
|
|
39473
39590
|
return null;
|
|
39474
39591
|
}
|
|
39475
39592
|
}
|
|
39476
|
-
function isCliEntry(
|
|
39477
|
-
const name2 = (0, import_node_path23.basename)(
|
|
39593
|
+
function isCliEntry(path42) {
|
|
39594
|
+
const name2 = (0, import_node_path23.basename)(path42);
|
|
39478
39595
|
return name2 === "bin.ts" || name2 === "bin.js";
|
|
39479
39596
|
}
|
|
39480
39597
|
function rnxSelfInvocation() {
|
|
@@ -45668,8 +45785,8 @@ function metroIosAssetDestRelatives(httpServerLocation, filename) {
|
|
|
45668
45785
|
}
|
|
45669
45786
|
const out = [];
|
|
45670
45787
|
for (const dir of dirs) {
|
|
45671
|
-
const
|
|
45672
|
-
if (!out.includes(
|
|
45788
|
+
const path42 = `${dir}/${filename}`;
|
|
45789
|
+
if (!out.includes(path42)) out.push(path42);
|
|
45673
45790
|
}
|
|
45674
45791
|
if (!out.includes(filename)) out.push(filename);
|
|
45675
45792
|
return out;
|
|
@@ -46689,13 +46806,13 @@ function readFactoryStringLiterals(factory) {
|
|
|
46689
46806
|
return literals;
|
|
46690
46807
|
}
|
|
46691
46808
|
function normalizeFingerprintLiteral(literal2) {
|
|
46692
|
-
const
|
|
46809
|
+
const path42 = literal2.replaceAll("\\\\", "/").replaceAll("\\/", "/");
|
|
46693
46810
|
const nodeModulesMarker = "/node_modules/";
|
|
46694
|
-
const nodeModulesIndex =
|
|
46811
|
+
const nodeModulesIndex = path42.lastIndexOf(nodeModulesMarker);
|
|
46695
46812
|
if (nodeModulesIndex >= 0) {
|
|
46696
|
-
return `node_modules/${
|
|
46813
|
+
return `node_modules/${path42.slice(nodeModulesIndex + nodeModulesMarker.length)}`;
|
|
46697
46814
|
}
|
|
46698
|
-
if ((
|
|
46815
|
+
if ((path42.startsWith("/") || /^[A-Za-z]:\//.test(path42) || path42.startsWith("file:/")) && /\.[cm]?[jt]sx?(?::\d+(?::\d+)?)?$/.test(path42)) {
|
|
46699
46816
|
return null;
|
|
46700
46817
|
}
|
|
46701
46818
|
return literal2;
|
|
@@ -46933,10 +47050,10 @@ function templateAssignment(template, embeddings) {
|
|
|
46933
47050
|
if (existingNode !== void 0 && existingNode !== nodeIndex) return null;
|
|
46934
47051
|
nodesByModuleId.set(moduleId, nodeIndex);
|
|
46935
47052
|
const node = template.nodes[nodeIndex];
|
|
46936
|
-
const
|
|
47053
|
+
const path42 = node.landmarkPath ?? `node_modules/${template.packageName}/__rnx_inferred__/${moduleId}.js`;
|
|
46937
47054
|
const existingPath = pathsByModuleId.get(moduleId);
|
|
46938
|
-
if (existingPath !== void 0 && existingPath !==
|
|
46939
|
-
pathsByModuleId.set(moduleId,
|
|
47055
|
+
if (existingPath !== void 0 && existingPath !== path42) return null;
|
|
47056
|
+
pathsByModuleId.set(moduleId, path42);
|
|
46940
47057
|
}
|
|
46941
47058
|
}
|
|
46942
47059
|
return {
|
|
@@ -47098,14 +47215,14 @@ async function inferMetroModuleIdentity(args) {
|
|
|
47098
47215
|
const packageClaims = claimsByPackage.values().next().value;
|
|
47099
47216
|
if (!packageClaims) continue;
|
|
47100
47217
|
const exactClaims = packageClaims.filter((assignment2) => {
|
|
47101
|
-
const
|
|
47102
|
-
return
|
|
47218
|
+
const path42 = assignment2.pathsByModuleId.get(moduleId);
|
|
47219
|
+
return path42 !== void 0 && !path42.includes("/__rnx_inferred__/");
|
|
47103
47220
|
});
|
|
47104
47221
|
const preferredClaims = exactClaims.length > 0 ? exactClaims : packageClaims;
|
|
47105
47222
|
const routes = new Set(
|
|
47106
47223
|
preferredClaims.flatMap((assignment2) => {
|
|
47107
|
-
const
|
|
47108
|
-
return
|
|
47224
|
+
const path42 = assignment2.pathsByModuleId.get(moduleId);
|
|
47225
|
+
return path42 ? [metroFingerprintModuleClaimRoute(assignment2.packageName, path42)] : [];
|
|
47109
47226
|
})
|
|
47110
47227
|
);
|
|
47111
47228
|
if (routes.size !== 1) continue;
|
|
@@ -47461,8 +47578,8 @@ function metadataValue(value, key2) {
|
|
|
47461
47578
|
if (!value || typeof value !== "object") return void 0;
|
|
47462
47579
|
return Object.getOwnPropertyDescriptor(value, key2)?.value;
|
|
47463
47580
|
}
|
|
47464
|
-
function readProjectJson(
|
|
47465
|
-
const text3 = readProjectMetadata(
|
|
47581
|
+
function readProjectJson(path42, files2 = nodeRepoFileReader) {
|
|
47582
|
+
const text3 = readProjectMetadata(path42, files2);
|
|
47466
47583
|
if (text3 === null) return null;
|
|
47467
47584
|
try {
|
|
47468
47585
|
const value = JSON.parse(text3);
|
|
@@ -47498,17 +47615,17 @@ function readNativeProjectRenderer(dir, platform, files2 = nodeRepoFileReader) {
|
|
|
47498
47615
|
declarations.push({ source, enabled: value === "true" });
|
|
47499
47616
|
else throw new Error(`${source}: new architecture setting must be true or false`);
|
|
47500
47617
|
};
|
|
47501
|
-
const json = (
|
|
47502
|
-
const text3 = readProjectMetadata((0, import_node_path33.join)(dir,
|
|
47618
|
+
const json = (path42) => {
|
|
47619
|
+
const text3 = readProjectMetadata((0, import_node_path33.join)(dir, path42), files2);
|
|
47503
47620
|
if (text3 === null) {
|
|
47504
|
-
if (files2.exists((0, import_node_path33.join)(dir,
|
|
47505
|
-
throw new Error(`${
|
|
47621
|
+
if (files2.exists((0, import_node_path33.join)(dir, path42)))
|
|
47622
|
+
throw new Error(`${path42}: unreadable native metadata`);
|
|
47506
47623
|
return void 0;
|
|
47507
47624
|
}
|
|
47508
47625
|
try {
|
|
47509
47626
|
return JSON.parse(text3);
|
|
47510
47627
|
} catch {
|
|
47511
|
-
throw new Error(`${
|
|
47628
|
+
throw new Error(`${path42}: malformed native metadata`);
|
|
47512
47629
|
}
|
|
47513
47630
|
};
|
|
47514
47631
|
const expo = metadataValue(json("app.json"), "expo");
|
|
@@ -51569,11 +51686,11 @@ async function evalInBridge(bridge, code, opts = {}) {
|
|
|
51569
51686
|
if (opts.acquireLock) payload.acquireLock = true;
|
|
51570
51687
|
return bridge.send(payload);
|
|
51571
51688
|
}
|
|
51572
|
-
async function callInBridge(bridge,
|
|
51573
|
-
return bridge.send({ type: "call", path:
|
|
51689
|
+
async function callInBridge(bridge, path42, ...args) {
|
|
51690
|
+
return bridge.send({ type: "call", path: path42, args });
|
|
51574
51691
|
}
|
|
51575
|
-
async function callInBridgeWrite(bridge,
|
|
51576
|
-
return bridge.send({ type: "call", path:
|
|
51692
|
+
async function callInBridgeWrite(bridge, path42, ...args) {
|
|
51693
|
+
return bridge.send({ type: "call", path: path42, args, acquireLock: true });
|
|
51577
51694
|
}
|
|
51578
51695
|
var import_node_fs35, import_node_path36, import_ws2, PEACH_PLACEMENT_ENV, resolvedWorld, BridgeSimLockedError, DisconnectedSimError, BRIDGE_VALUE_FLAGS_TABLE, BRIDGE_VALUE_FLAGS;
|
|
51579
51696
|
var init_ws_bridge = __esm({
|
|
@@ -51710,8 +51827,8 @@ function getDefaultPortForProtocol(protocol) {
|
|
|
51710
51827
|
return protocol === "https:" ? 443 : 80;
|
|
51711
51828
|
}
|
|
51712
51829
|
function isBaseServerUrl(url) {
|
|
51713
|
-
const
|
|
51714
|
-
return (
|
|
51830
|
+
const path42 = url.pathname || "/";
|
|
51831
|
+
return (path42 === "/" || path42 === "") && !url.search && !url.hash;
|
|
51715
51832
|
}
|
|
51716
51833
|
async function resolvePortViaServerScan(port) {
|
|
51717
51834
|
try {
|
|
@@ -55932,12 +56049,12 @@ var init_runtime_diagnostics = __esm({
|
|
|
55932
56049
|
// cli/commands/skills.ts
|
|
55933
56050
|
function getSkillsDir() {
|
|
55934
56051
|
if (typeof __PEACH_BUNDLED_SKILLS__ !== "undefined") {
|
|
55935
|
-
const dir =
|
|
56052
|
+
const dir = path38.join(rnxHomeDir(), "skills", getCliVersion());
|
|
55936
56053
|
for (const [file, body] of Object.entries(__PEACH_BUNDLED_SKILLS__)) {
|
|
55937
|
-
const target =
|
|
55938
|
-
if (
|
|
55939
|
-
|
|
55940
|
-
|
|
56054
|
+
const target = path38.join(dir, file);
|
|
56055
|
+
if (fs33.existsSync(target)) continue;
|
|
56056
|
+
fs33.mkdirSync(path38.dirname(target), { recursive: true });
|
|
56057
|
+
fs33.writeFileSync(target, body);
|
|
55941
56058
|
}
|
|
55942
56059
|
return dir;
|
|
55943
56060
|
}
|
|
@@ -55945,10 +56062,10 @@ function getSkillsDir() {
|
|
|
55945
56062
|
const pkgPath = (0, import_url3.fileURLToPath)(
|
|
55946
56063
|
import_meta3.resolve(`${rnxPublicBrand.packageName}/package.json`)
|
|
55947
56064
|
);
|
|
55948
|
-
return primaryCheckoutPath(
|
|
56065
|
+
return primaryCheckoutPath(path38.join(path38.dirname(pkgPath), "skills"));
|
|
55949
56066
|
} catch {
|
|
55950
|
-
const __dirname =
|
|
55951
|
-
return primaryCheckoutPath(
|
|
56067
|
+
const __dirname = path38.dirname((0, import_url3.fileURLToPath)(__sootsim_import_meta_url));
|
|
56068
|
+
return primaryCheckoutPath(path38.resolve(__dirname, "../../skills"));
|
|
55952
56069
|
}
|
|
55953
56070
|
}
|
|
55954
56071
|
function primaryCheckoutPath(dir) {
|
|
@@ -55971,39 +56088,39 @@ function primaryCheckoutPath(dir) {
|
|
|
55971
56088
|
} catch {
|
|
55972
56089
|
return dir;
|
|
55973
56090
|
}
|
|
55974
|
-
if (
|
|
55975
|
-
const primary =
|
|
55976
|
-
return
|
|
56091
|
+
if (path38.basename(common) !== ".git") return dir;
|
|
56092
|
+
const primary = path38.join(path38.dirname(common), path38.relative(top, dir));
|
|
56093
|
+
return fs33.existsSync(primary) ? primary : dir;
|
|
55977
56094
|
}
|
|
55978
56095
|
function skillsDir() {
|
|
55979
56096
|
skillsDirPath ??= getSkillsDir();
|
|
55980
56097
|
return skillsDirPath;
|
|
55981
56098
|
}
|
|
55982
56099
|
function targetFromHome(envName, fallbackDir) {
|
|
55983
|
-
const home = process.env[envName] ||
|
|
55984
|
-
return
|
|
56100
|
+
const home = process.env[envName] || path38.join(os12.homedir(), fallbackDir);
|
|
56101
|
+
return path38.join(home, "skills");
|
|
55985
56102
|
}
|
|
55986
56103
|
function codexTargets() {
|
|
55987
56104
|
const homes = /* @__PURE__ */ new Map();
|
|
55988
|
-
const userHome = process.env.HOME ||
|
|
55989
|
-
const primaryCodexHome = process.env.CODEX_HOME ||
|
|
55990
|
-
homes.set(
|
|
56105
|
+
const userHome = process.env.HOME || os12.homedir();
|
|
56106
|
+
const primaryCodexHome = process.env.CODEX_HOME || path38.join(userHome, ".codex");
|
|
56107
|
+
homes.set(path38.resolve(primaryCodexHome), "codex");
|
|
55991
56108
|
const tmCodexHomes = process.env.TM_CODEX_HOMES;
|
|
55992
56109
|
if (tmCodexHomes) {
|
|
55993
|
-
for (const h of tmCodexHomes.split(
|
|
56110
|
+
for (const h of tmCodexHomes.split(path38.delimiter)) {
|
|
55994
56111
|
if (h.trim()) {
|
|
55995
|
-
const resolved =
|
|
56112
|
+
const resolved = path38.resolve(h.trim());
|
|
55996
56113
|
if (!homes.has(resolved)) {
|
|
55997
|
-
homes.set(resolved,
|
|
56114
|
+
homes.set(resolved, path38.basename(resolved).replace(/^\./, ""));
|
|
55998
56115
|
}
|
|
55999
56116
|
}
|
|
56000
56117
|
}
|
|
56001
56118
|
}
|
|
56002
|
-
const tmHome = process.env.TM_HOME ||
|
|
56003
|
-
const enginePath =
|
|
56004
|
-
if (
|
|
56119
|
+
const tmHome = process.env.TM_HOME || path38.join(userHome, ".team-machine");
|
|
56120
|
+
const enginePath = path38.join(tmHome, "engine.yaml");
|
|
56121
|
+
if (fs33.existsSync(enginePath)) {
|
|
56005
56122
|
try {
|
|
56006
|
-
const content =
|
|
56123
|
+
const content = fs33.readFileSync(enginePath, "utf8");
|
|
56007
56124
|
let inCodex = false;
|
|
56008
56125
|
let inAccounts = false;
|
|
56009
56126
|
let currentAccount = "";
|
|
@@ -56033,9 +56150,9 @@ function codexTargets() {
|
|
|
56033
56150
|
if (match) {
|
|
56034
56151
|
let homeDir = match[1].trim();
|
|
56035
56152
|
if (homeDir.startsWith("~")) {
|
|
56036
|
-
homeDir =
|
|
56153
|
+
homeDir = path38.join(userHome, homeDir.slice(1));
|
|
56037
56154
|
}
|
|
56038
|
-
const resolved =
|
|
56155
|
+
const resolved = path38.resolve(homeDir);
|
|
56039
56156
|
if (!homes.has(resolved)) {
|
|
56040
56157
|
homes.set(resolved, `codex-${currentAccount}`);
|
|
56041
56158
|
}
|
|
@@ -56046,13 +56163,13 @@ function codexTargets() {
|
|
|
56046
56163
|
}
|
|
56047
56164
|
}
|
|
56048
56165
|
try {
|
|
56049
|
-
for (const entry of
|
|
56166
|
+
for (const entry of fs33.readdirSync(userHome)) {
|
|
56050
56167
|
if (entry.startsWith(".codex-")) {
|
|
56051
|
-
const fullPath =
|
|
56168
|
+
const fullPath = path38.join(userHome, entry);
|
|
56052
56169
|
try {
|
|
56053
|
-
const stat2 =
|
|
56170
|
+
const stat2 = fs33.statSync(fullPath);
|
|
56054
56171
|
if (stat2.isDirectory()) {
|
|
56055
|
-
const resolved =
|
|
56172
|
+
const resolved = path38.resolve(fullPath);
|
|
56056
56173
|
if (!homes.has(resolved)) {
|
|
56057
56174
|
homes.set(resolved, entry.replace(/^\./, ""));
|
|
56058
56175
|
}
|
|
@@ -56067,7 +56184,7 @@ function codexTargets() {
|
|
|
56067
56184
|
for (const [homePath, label] of homes) {
|
|
56068
56185
|
targets.push({
|
|
56069
56186
|
label,
|
|
56070
|
-
dir:
|
|
56187
|
+
dir: path38.join(homePath, "skills")
|
|
56071
56188
|
});
|
|
56072
56189
|
}
|
|
56073
56190
|
return targets;
|
|
@@ -56083,7 +56200,7 @@ function hasInstalledPeachSkills() {
|
|
|
56083
56200
|
(file) => /^([^/]+)\/SKILL\.md$/.exec(file)?.[1] ?? []
|
|
56084
56201
|
) : listSkills().map((skill7) => skill7.name);
|
|
56085
56202
|
return defaultAgentTargets().some(
|
|
56086
|
-
({ dir }) => names.some((name2) =>
|
|
56203
|
+
({ dir }) => names.some((name2) => fs33.existsSync(path38.join(dir, name2, "SKILL.md")))
|
|
56087
56204
|
);
|
|
56088
56205
|
}
|
|
56089
56206
|
function parseSkillFrontmatter(content) {
|
|
@@ -56126,26 +56243,26 @@ function readFrontmatterField(frontmatter, field) {
|
|
|
56126
56243
|
return null;
|
|
56127
56244
|
}
|
|
56128
56245
|
function listSkills() {
|
|
56129
|
-
if (!
|
|
56246
|
+
if (!fs33.existsSync(skillsDir())) return [];
|
|
56130
56247
|
const skills = [];
|
|
56131
|
-
for (const entry of
|
|
56132
|
-
const skillMd =
|
|
56133
|
-
if (!
|
|
56134
|
-
const meta = parseSkillFrontmatter(
|
|
56248
|
+
for (const entry of fs33.readdirSync(skillsDir())) {
|
|
56249
|
+
const skillMd = path38.join(skillsDir(), entry, "SKILL.md");
|
|
56250
|
+
if (!fs33.existsSync(skillMd)) continue;
|
|
56251
|
+
const meta = parseSkillFrontmatter(fs33.readFileSync(skillMd, "utf8"));
|
|
56135
56252
|
if (meta) {
|
|
56136
56253
|
skills.push({ name: entry, description: meta.description });
|
|
56137
56254
|
}
|
|
56138
56255
|
}
|
|
56139
56256
|
return skills.sort((a, b) => a.name.localeCompare(b.name));
|
|
56140
56257
|
}
|
|
56141
|
-
var import_child_process7,
|
|
56258
|
+
var import_child_process7, fs33, os12, path38, import_url3, import_meta3, skillsDirPath;
|
|
56142
56259
|
var init_skills = __esm({
|
|
56143
56260
|
"cli/commands/skills.ts"() {
|
|
56144
56261
|
"use strict";
|
|
56145
56262
|
import_child_process7 = require("child_process");
|
|
56146
|
-
|
|
56147
|
-
|
|
56148
|
-
|
|
56263
|
+
fs33 = __toESM(require("fs"), 1);
|
|
56264
|
+
os12 = __toESM(require("os"), 1);
|
|
56265
|
+
path38 = __toESM(require("path"), 1);
|
|
56149
56266
|
import_url3 = require("url");
|
|
56150
56267
|
init_cli_version();
|
|
56151
56268
|
init_home_paths();
|
|
@@ -60021,16 +60138,16 @@ function readRecentShellAppId(state) {
|
|
|
60021
60138
|
}
|
|
60022
60139
|
function resolveProjectRelativeFlowBase(flowDir) {
|
|
60023
60140
|
if (!flowDir) return process.cwd();
|
|
60024
|
-
return
|
|
60141
|
+
return path40.basename(flowDir) === ".maestro" ? path40.dirname(flowDir) : flowDir;
|
|
60025
60142
|
}
|
|
60026
60143
|
function resolveFlowScreenshotPathWithMode(screenshotDir, name2, opts) {
|
|
60027
60144
|
const normalizedName = name2.endsWith(".png") ? name2 : `${name2}.png`;
|
|
60028
|
-
if (
|
|
60145
|
+
if (path40.isAbsolute(normalizedName)) return normalizedName;
|
|
60029
60146
|
if (opts.mode === "flow" && /[\\/]/.test(normalizedName)) {
|
|
60030
60147
|
const baseDir = normalizedName.startsWith("./") || normalizedName.startsWith("../") ? opts.flowDir ?? process.cwd() : resolveProjectRelativeFlowBase(opts.flowDir);
|
|
60031
|
-
return
|
|
60148
|
+
return path40.resolve(baseDir, normalizedName);
|
|
60032
60149
|
}
|
|
60033
|
-
return
|
|
60150
|
+
return path40.join(screenshotDir, normalizedName);
|
|
60034
60151
|
}
|
|
60035
60152
|
function normalizeFlowScreenshotSpec(step) {
|
|
60036
60153
|
if (typeof step === "string") {
|
|
@@ -60084,12 +60201,12 @@ function normalizeBareStringStep(verb) {
|
|
|
60084
60201
|
function parseFlowSteps(content) {
|
|
60085
60202
|
return parseFlowFile(content).steps;
|
|
60086
60203
|
}
|
|
60087
|
-
var
|
|
60204
|
+
var fs36, path40, 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;
|
|
60088
60205
|
var init_bridge_flow_runner = __esm({
|
|
60089
60206
|
"cli/bridge-flow-runner.ts"() {
|
|
60090
60207
|
"use strict";
|
|
60091
|
-
|
|
60092
|
-
|
|
60208
|
+
fs36 = __toESM(require("fs"), 1);
|
|
60209
|
+
path40 = __toESM(require("path"), 1);
|
|
60093
60210
|
import_devices4 = require("peach-engine/settings/devices");
|
|
60094
60211
|
import_proof_frame = __toESM(require_proof_frame(), 1);
|
|
60095
60212
|
init_flow_timeout_scale();
|
|
@@ -60401,14 +60518,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
60401
60518
|
if (chunks.length === 0) {
|
|
60402
60519
|
throw new Error("recording requested but no video buffer was produced");
|
|
60403
60520
|
}
|
|
60404
|
-
|
|
60521
|
+
fs36.mkdirSync(this.opts.recordingOutputDir, { recursive: true });
|
|
60405
60522
|
const videoMime = stopped.mime || this.opts.recordingFormat || "video/webm";
|
|
60406
60523
|
const extension = videoMime.includes("mp4") ? "mp4" : "webm";
|
|
60407
|
-
const outputPath =
|
|
60524
|
+
const outputPath = path40.join(
|
|
60408
60525
|
this.opts.recordingOutputDir,
|
|
60409
60526
|
`peach-${Date.now()}.${extension}`
|
|
60410
60527
|
);
|
|
60411
|
-
|
|
60528
|
+
fs36.writeFileSync(outputPath, Buffer.concat(chunks));
|
|
60412
60529
|
return outputPath;
|
|
60413
60530
|
}
|
|
60414
60531
|
async waitForRecordingTail(opts) {
|
|
@@ -61029,7 +61146,7 @@ var init_bridge_flow_runner = __esm({
|
|
|
61029
61146
|
flowDir: this.opts.flowDir
|
|
61030
61147
|
}
|
|
61031
61148
|
);
|
|
61032
|
-
|
|
61149
|
+
fs36.mkdirSync(path40.dirname(outputPath), { recursive: true });
|
|
61033
61150
|
const layers = spec.layers ?? this.opts.screenshotLayers;
|
|
61034
61151
|
const screenshotRequest = {
|
|
61035
61152
|
type: "screenshot",
|
|
@@ -61064,11 +61181,11 @@ var init_bridge_flow_runner = __esm({
|
|
|
61064
61181
|
throw new Error("could not read current device model for framed screenshot");
|
|
61065
61182
|
}
|
|
61066
61183
|
const framed = await composeFramedScreenshot(rawBuffer, model);
|
|
61067
|
-
|
|
61184
|
+
fs36.writeFileSync(outputPath, framed);
|
|
61068
61185
|
console.log(`[flow] screenshot: ${outputPath} (frame: ${model})`);
|
|
61069
61186
|
return outputPath;
|
|
61070
61187
|
}
|
|
61071
|
-
|
|
61188
|
+
fs36.writeFileSync(outputPath, rawBuffer);
|
|
61072
61189
|
console.log(`[flow] screenshot: ${outputPath}`);
|
|
61073
61190
|
return outputPath;
|
|
61074
61191
|
}
|
|
@@ -61107,10 +61224,10 @@ var init_bridge_flow_runner = __esm({
|
|
|
61107
61224
|
// + a11y tree + console errors/warnings + failed network requests +
|
|
61108
61225
|
// shell state, all under one directory so post-mortem is one grep away.
|
|
61109
61226
|
async captureFailureBundle(outputDir, context) {
|
|
61110
|
-
|
|
61227
|
+
fs36.mkdirSync(outputDir, { recursive: true });
|
|
61111
61228
|
const write = (name2, content) => {
|
|
61112
61229
|
try {
|
|
61113
|
-
|
|
61230
|
+
fs36.writeFileSync(path40.join(outputDir, name2), content);
|
|
61114
61231
|
} catch {
|
|
61115
61232
|
}
|
|
61116
61233
|
};
|
|
@@ -61707,8 +61824,8 @@ var init_bridge_flow_runner = __esm({
|
|
|
61707
61824
|
runScript(target) {
|
|
61708
61825
|
const spec = typeof target === "string" ? { file: target } : target;
|
|
61709
61826
|
if (!spec.file) throw new Error("runScript requires a file");
|
|
61710
|
-
const scriptPath =
|
|
61711
|
-
const source =
|
|
61827
|
+
const scriptPath = path40.resolve(this.opts.flowDir, spec.file);
|
|
61828
|
+
const source = fs36.readFileSync(scriptPath, "utf8");
|
|
61712
61829
|
this.js.evaluate(source, { env: spec.env });
|
|
61713
61830
|
console.log(`[flow] runScript: ${spec.file} done`);
|
|
61714
61831
|
}
|
|
@@ -62068,14 +62185,14 @@ var init_bridge_flow_runner = __esm({
|
|
|
62068
62185
|
for (const [k, v] of Object.entries(env)) this.js.putEnv(k, v);
|
|
62069
62186
|
}
|
|
62070
62187
|
if (file) {
|
|
62071
|
-
const flowPath =
|
|
62072
|
-
const flowContent =
|
|
62188
|
+
const flowPath = path40.resolve(this.opts.flowDir, file);
|
|
62189
|
+
const flowContent = fs36.readFileSync(flowPath, "utf8");
|
|
62073
62190
|
const { frontmatter } = parseFlowFile(flowContent);
|
|
62074
62191
|
if (frontmatter.env && typeof frontmatter.env === "object") {
|
|
62075
62192
|
this.js.defineVariables(frontmatter.env);
|
|
62076
62193
|
}
|
|
62077
62194
|
const previousDir = this.opts.flowDir;
|
|
62078
|
-
this.opts.flowDir =
|
|
62195
|
+
this.opts.flowDir = path40.dirname(flowPath);
|
|
62079
62196
|
try {
|
|
62080
62197
|
await this.runFlow(parseFlowSteps(flowContent));
|
|
62081
62198
|
} finally {
|
|
@@ -62246,8 +62363,8 @@ __export(registry_exports, {
|
|
|
62246
62363
|
skillRegistry: () => skillRegistry
|
|
62247
62364
|
});
|
|
62248
62365
|
module.exports = __toCommonJS(registry_exports);
|
|
62249
|
-
var
|
|
62250
|
-
var
|
|
62366
|
+
var fs37 = __toESM(require("fs"), 1);
|
|
62367
|
+
var path41 = __toESM(require("path"), 1);
|
|
62251
62368
|
|
|
62252
62369
|
// src/skills/builtin/a11y-review.ts
|
|
62253
62370
|
init_reap_browser();
|
|
@@ -62266,8 +62383,8 @@ var skill = {
|
|
|
62266
62383
|
},
|
|
62267
62384
|
async execute(params, context) {
|
|
62268
62385
|
const { chromium } = await import("playwright");
|
|
62269
|
-
const
|
|
62270
|
-
const
|
|
62386
|
+
const path42 = await import("path");
|
|
62387
|
+
const fs38 = await import("fs");
|
|
62271
62388
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
62272
62389
|
headless: true
|
|
62273
62390
|
});
|
|
@@ -62324,9 +62441,9 @@ var skill = {
|
|
|
62324
62441
|
warnings: issues.filter((i) => i.severity === "warning").length,
|
|
62325
62442
|
tree: typeof tree === "string" ? tree : JSON.stringify(tree)
|
|
62326
62443
|
};
|
|
62327
|
-
const reportPath =
|
|
62328
|
-
|
|
62329
|
-
|
|
62444
|
+
const reportPath = path42.join(context.outputDir, "a11y-report.json");
|
|
62445
|
+
fs38.mkdirSync(path42.dirname(reportPath), { recursive: true });
|
|
62446
|
+
fs38.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
62330
62447
|
return {
|
|
62331
62448
|
success: issues.filter((i) => i.severity === "error").length === 0,
|
|
62332
62449
|
message: `${report.errors} errors, ${report.warnings} warnings across ${report.nodeCount} nodes`,
|
|
@@ -62359,14 +62476,14 @@ var skill2 = {
|
|
|
62359
62476
|
}
|
|
62360
62477
|
},
|
|
62361
62478
|
async execute(params, context) {
|
|
62362
|
-
const
|
|
62363
|
-
const
|
|
62479
|
+
const fs38 = await import("node:fs");
|
|
62480
|
+
const path42 = await import("node:path");
|
|
62364
62481
|
const { COMPAT_RESULT_CAVEAT: COMPAT_RESULT_CAVEAT2, formatPackageStatus: formatPackageStatus2, formatScanCounts: formatScanCounts2, scanDeps: scanDeps2 } = await Promise.resolve().then(() => (init_web(), web_exports));
|
|
62365
|
-
const packagePath =
|
|
62366
|
-
if (!
|
|
62482
|
+
const packagePath = path42.join(context.projectDir, "package.json");
|
|
62483
|
+
if (!fs38.existsSync(packagePath)) {
|
|
62367
62484
|
return { success: false, message: "No package.json found" };
|
|
62368
62485
|
}
|
|
62369
|
-
const parsed = JSON.parse(
|
|
62486
|
+
const parsed = JSON.parse(fs38.readFileSync(packagePath, "utf8"));
|
|
62370
62487
|
if (!parsed || typeof parsed !== "object") {
|
|
62371
62488
|
return { success: false, message: "package.json is not an object" };
|
|
62372
62489
|
}
|
|
@@ -62378,9 +62495,9 @@ var skill2 = {
|
|
|
62378
62495
|
}) : scanDeps2(parsed);
|
|
62379
62496
|
const packageResult = params.packageName ? scan.packages[0] : void 0;
|
|
62380
62497
|
const message = packageResult ? `${params.packageName}: ${formatPackageStatus2(packageResult)}. ${COMPAT_RESULT_CAVEAT2}` : `${formatScanCounts2(scan)}. ${COMPAT_RESULT_CAVEAT2}`;
|
|
62381
|
-
const reportPath =
|
|
62382
|
-
|
|
62383
|
-
|
|
62498
|
+
const reportPath = path42.join(context.outputDir, "compat-report.json");
|
|
62499
|
+
fs38.mkdirSync(path42.dirname(reportPath), { recursive: true });
|
|
62500
|
+
fs38.writeFileSync(reportPath, `${JSON.stringify(scan, null, 2)}
|
|
62384
62501
|
`);
|
|
62385
62502
|
return {
|
|
62386
62503
|
success: true,
|
|
@@ -62422,8 +62539,8 @@ var skill3 = {
|
|
|
62422
62539
|
record: { type: "boolean", description: "Record video of the flow" }
|
|
62423
62540
|
},
|
|
62424
62541
|
async execute(params, context) {
|
|
62425
|
-
const
|
|
62426
|
-
const
|
|
62542
|
+
const fs38 = await import("fs");
|
|
62543
|
+
const path42 = await import("path");
|
|
62427
62544
|
const yaml = await Promise.resolve().then(() => (init_browser(), browser_exports));
|
|
62428
62545
|
const { DEFAULT_SOOTSIM_BRIDGE_PORT: DEFAULT_SOOTSIM_BRIDGE_PORT3 } = await Promise.resolve().then(() => (init_bridge_constants(), bridge_constants_exports));
|
|
62429
62546
|
const { SootSimBridgeHost: SootSimBridgeHost2 } = await Promise.resolve().then(() => (init_bridge_host(), bridge_host_exports));
|
|
@@ -62433,7 +62550,7 @@ var skill3 = {
|
|
|
62433
62550
|
const host2 = new SootSimBridgeHost2({ port: DEFAULT_SOOTSIM_BRIDGE_PORT3 });
|
|
62434
62551
|
host2.start({ silent: true });
|
|
62435
62552
|
try {
|
|
62436
|
-
const flowContent =
|
|
62553
|
+
const flowContent = fs38.readFileSync(params.flowPath, "utf8");
|
|
62437
62554
|
const fmMatch = flowContent.match(/^---\n([\s\S]*?)\n---\n?/);
|
|
62438
62555
|
const stepsBody = fmMatch ? flowContent.slice(fmMatch[0].length) : flowContent;
|
|
62439
62556
|
const steps = yaml.parse(stepsBody);
|
|
@@ -62460,7 +62577,7 @@ var skill3 = {
|
|
|
62460
62577
|
});
|
|
62461
62578
|
const driver = new SootSimBridgeFlowRunner2(bridge, {
|
|
62462
62579
|
screenshotDir: context.outputDir,
|
|
62463
|
-
flowDir:
|
|
62580
|
+
flowDir: path42.dirname(path42.resolve(params.flowPath)),
|
|
62464
62581
|
simId,
|
|
62465
62582
|
recordingOutputDir: params.record ? context.outputDir : void 0
|
|
62466
62583
|
});
|
|
@@ -62482,7 +62599,7 @@ var skill3 = {
|
|
|
62482
62599
|
simId,
|
|
62483
62600
|
videoPath: videoPath || void 0
|
|
62484
62601
|
},
|
|
62485
|
-
artifacts: videoPath ? [{ type: "video", name:
|
|
62602
|
+
artifacts: videoPath ? [{ type: "video", name: path42.basename(videoPath), path: videoPath }] : void 0
|
|
62486
62603
|
};
|
|
62487
62604
|
} finally {
|
|
62488
62605
|
try {
|
|
@@ -62529,8 +62646,8 @@ var skill4 = {
|
|
|
62529
62646
|
},
|
|
62530
62647
|
async execute(params, context) {
|
|
62531
62648
|
const { chromium } = await import("playwright");
|
|
62532
|
-
const
|
|
62533
|
-
const
|
|
62649
|
+
const path42 = await import("path");
|
|
62650
|
+
const fs38 = await import("fs");
|
|
62534
62651
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
62535
62652
|
headless: true
|
|
62536
62653
|
});
|
|
@@ -62558,9 +62675,9 @@ var skill4 = {
|
|
|
62558
62675
|
...profile,
|
|
62559
62676
|
fps: syncCount > 0 ? (syncCount / (duration / 1e3)).toFixed(1) : "0"
|
|
62560
62677
|
};
|
|
62561
|
-
const reportPath =
|
|
62562
|
-
|
|
62563
|
-
|
|
62678
|
+
const reportPath = path42.join(context.outputDir, "perf-report.json");
|
|
62679
|
+
fs38.mkdirSync(path42.dirname(reportPath), { recursive: true });
|
|
62680
|
+
fs38.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
62564
62681
|
return {
|
|
62565
62682
|
success: true,
|
|
62566
62683
|
message: `${report.fps} fps, ${profile.avgSyncMs?.toFixed(1)}ms avg sync, ${nodeCount} nodes`,
|
|
@@ -62593,8 +62710,8 @@ var skill5 = {
|
|
|
62593
62710
|
},
|
|
62594
62711
|
async execute(params, context) {
|
|
62595
62712
|
const { chromium } = await import("playwright");
|
|
62596
|
-
const
|
|
62597
|
-
const
|
|
62713
|
+
const path42 = await import("path");
|
|
62714
|
+
const fs38 = await import("fs");
|
|
62598
62715
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
62599
62716
|
headless: true
|
|
62600
62717
|
});
|
|
@@ -62602,8 +62719,8 @@ var skill5 = {
|
|
|
62602
62719
|
try {
|
|
62603
62720
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
62604
62721
|
await page.waitForTimeout(2e3);
|
|
62605
|
-
const outputPath =
|
|
62606
|
-
|
|
62722
|
+
const outputPath = path42.join(context.outputDir, `${params.name}.png`);
|
|
62723
|
+
fs38.mkdirSync(path42.dirname(outputPath), { recursive: true });
|
|
62607
62724
|
await page.screenshot({ path: outputPath });
|
|
62608
62725
|
return {
|
|
62609
62726
|
success: true,
|
|
@@ -62644,8 +62761,8 @@ var skill6 = {
|
|
|
62644
62761
|
},
|
|
62645
62762
|
async execute(params, context) {
|
|
62646
62763
|
const { chromium } = await import("playwright");
|
|
62647
|
-
const
|
|
62648
|
-
const
|
|
62764
|
+
const path42 = await import("path");
|
|
62765
|
+
const fs38 = await import("fs");
|
|
62649
62766
|
const browser = await launchReapedChrome((options) => chromium.launch(options), {
|
|
62650
62767
|
headless: true
|
|
62651
62768
|
});
|
|
@@ -62653,14 +62770,14 @@ var skill6 = {
|
|
|
62653
62770
|
try {
|
|
62654
62771
|
await page.goto(context.url, { waitUntil: "networkidle" });
|
|
62655
62772
|
await page.waitForTimeout(2e3);
|
|
62656
|
-
const currentPath =
|
|
62657
|
-
|
|
62773
|
+
const currentPath = path42.join(context.outputDir, `${params.name}-current.png`);
|
|
62774
|
+
fs38.mkdirSync(path42.dirname(currentPath), { recursive: true });
|
|
62658
62775
|
await page.screenshot({ path: currentPath });
|
|
62659
62776
|
try {
|
|
62660
62777
|
const { PNG } = await import("pngjs");
|
|
62661
62778
|
const pixelmatch = (await import("pixelmatch")).default;
|
|
62662
|
-
const baseline = PNG.sync.read(
|
|
62663
|
-
const current = PNG.sync.read(
|
|
62779
|
+
const baseline = PNG.sync.read(fs38.readFileSync(params.baseline));
|
|
62780
|
+
const current = PNG.sync.read(fs38.readFileSync(currentPath));
|
|
62664
62781
|
const { width, height } = baseline;
|
|
62665
62782
|
const diff = new PNG({ width, height });
|
|
62666
62783
|
const numDiffPixels = pixelmatch(
|
|
@@ -62671,8 +62788,8 @@ var skill6 = {
|
|
|
62671
62788
|
height,
|
|
62672
62789
|
{ threshold: params.threshold || 0.1 }
|
|
62673
62790
|
);
|
|
62674
|
-
const diffPath =
|
|
62675
|
-
|
|
62791
|
+
const diffPath = path42.join(context.outputDir, `${params.name}-diff.png`);
|
|
62792
|
+
fs38.writeFileSync(diffPath, PNG.sync.write(diff));
|
|
62676
62793
|
const totalPixels = width * height;
|
|
62677
62794
|
const diffPercent = (numDiffPixels / totalPixels * 100).toFixed(2);
|
|
62678
62795
|
return {
|
|
@@ -62736,10 +62853,10 @@ var skillRegistry = {
|
|
|
62736
62853
|
},
|
|
62737
62854
|
// load skills from a project manifest (rnx-skills.json)
|
|
62738
62855
|
async loadFromManifest(projectDir) {
|
|
62739
|
-
const manifestPath =
|
|
62740
|
-
if (!
|
|
62856
|
+
const manifestPath = path41.join(projectDir, "rnx-skills.json");
|
|
62857
|
+
if (!fs37.existsSync(manifestPath)) return;
|
|
62741
62858
|
try {
|
|
62742
|
-
const manifest = JSON.parse(
|
|
62859
|
+
const manifest = JSON.parse(fs37.readFileSync(manifestPath, "utf8"));
|
|
62743
62860
|
if (Array.isArray(manifest.skills)) {
|
|
62744
62861
|
for (const entry of manifest.skills) {
|
|
62745
62862
|
if (typeof entry === "string") {
|
|
@@ -62750,7 +62867,7 @@ var skillRegistry = {
|
|
|
62750
62867
|
}
|
|
62751
62868
|
} else if (entry.file) {
|
|
62752
62869
|
try {
|
|
62753
|
-
const mod = await import(
|
|
62870
|
+
const mod = await import(path41.resolve(projectDir, entry.file));
|
|
62754
62871
|
if (mod.skill) this.register(mod.skill);
|
|
62755
62872
|
} catch {
|
|
62756
62873
|
}
|
|
@@ -62763,10 +62880,10 @@ var skillRegistry = {
|
|
|
62763
62880
|
// auto-discover skills based on project dependencies
|
|
62764
62881
|
suggestSkills(projectDir) {
|
|
62765
62882
|
const suggestions = [];
|
|
62766
|
-
const pkgPath =
|
|
62767
|
-
if (!
|
|
62883
|
+
const pkgPath = path41.join(projectDir, "package.json");
|
|
62884
|
+
if (!fs37.existsSync(pkgPath)) return suggestions;
|
|
62768
62885
|
try {
|
|
62769
|
-
const pkg = JSON.parse(
|
|
62886
|
+
const pkg = JSON.parse(fs37.readFileSync(pkgPath, "utf8"));
|
|
62770
62887
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
62771
62888
|
if (deps["detox"] || deps["maestro"]) {
|
|
62772
62889
|
suggestions.push("maestro-test");
|