@swmansion/argent 0.35.1-next.32 → 0.35.1-next.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-cmds.mjs +240 -239
- package/dist/client.js +42 -41
- package/dist/installer.mjs +242 -241
- package/dist/mcp-server.mjs +47 -46
- package/dist/tool-server.cjs +398 -394
- package/package.json +2 -2
package/dist/tool-server.cjs
CHANGED
|
@@ -1091,7 +1091,9 @@ function getAdditionalIosDeviceSets(options = {}) {
|
|
|
1091
1091
|
isHomeDir(projectRoot, options) ? home : projectRoot,
|
|
1092
1092
|
home
|
|
1093
1093
|
);
|
|
1094
|
-
|
|
1094
|
+
const radon = path5.resolve(home, RADON_IDE_IOS_DEVICE_SET);
|
|
1095
|
+
const detected = fs5.existsSync(radon) ? [radon] : [];
|
|
1096
|
+
return Array.from(/* @__PURE__ */ new Set([...global2, ...project, ...detected]));
|
|
1095
1097
|
}
|
|
1096
1098
|
function resolveDeviceSetEntries(entries, baseDir, home) {
|
|
1097
1099
|
if (!entries || entries.length === 0) return [];
|
|
@@ -1101,10 +1103,11 @@ function resolveDeviceSetEntries(entries, baseDir, home) {
|
|
|
1101
1103
|
return path5.resolve(baseDir, entry);
|
|
1102
1104
|
});
|
|
1103
1105
|
}
|
|
1104
|
-
var path5, UnknownConfigKeyError, ANDROID_SDK_ROOT_KEY, ANDROID_ADB_SERVER_PORT_KEY, AUTO_UPDATE_ENABLED_KEY, IOS_ADDITIONAL_DEVICE_SETS_KEY;
|
|
1106
|
+
var fs5, path5, UnknownConfigKeyError, ANDROID_SDK_ROOT_KEY, ANDROID_ADB_SERVER_PORT_KEY, AUTO_UPDATE_ENABLED_KEY, IOS_ADDITIONAL_DEVICE_SETS_KEY, RADON_IDE_IOS_DEVICE_SET;
|
|
1105
1107
|
var init_config_access = __esm({
|
|
1106
1108
|
"../configuration-core/src/config-access.ts"() {
|
|
1107
1109
|
"use strict";
|
|
1110
|
+
fs5 = __toESM(require("node:fs"), 1);
|
|
1108
1111
|
path5 = __toESM(require("node:path"), 1);
|
|
1109
1112
|
init_flags();
|
|
1110
1113
|
init_paths();
|
|
@@ -1123,6 +1126,7 @@ var init_config_access = __esm({
|
|
|
1123
1126
|
ANDROID_ADB_SERVER_PORT_KEY = "android.adbServerPort";
|
|
1124
1127
|
AUTO_UPDATE_ENABLED_KEY = "autoUpdate.enabled";
|
|
1125
1128
|
IOS_ADDITIONAL_DEVICE_SETS_KEY = "ios.additionalDeviceSets";
|
|
1129
|
+
RADON_IDE_IOS_DEVICE_SET = "Library/Caches/com.swmansion.radon-ide/Devices/iOS";
|
|
1126
1130
|
}
|
|
1127
1131
|
});
|
|
1128
1132
|
|
|
@@ -1352,7 +1356,7 @@ function e2eFileCandidates(projectRoot, name) {
|
|
|
1352
1356
|
return e2eDirsFor(projectRoot).map((dir) => path6.join(dir, `${name}.yaml`));
|
|
1353
1357
|
}
|
|
1354
1358
|
async function exists(file2) {
|
|
1355
|
-
return
|
|
1359
|
+
return fs6.stat(file2).then(
|
|
1356
1360
|
() => true,
|
|
1357
1361
|
() => false
|
|
1358
1362
|
);
|
|
@@ -1394,11 +1398,11 @@ function e2eRunFallbackDirs(anchorDir, target) {
|
|
|
1394
1398
|
const anchor2 = path6.resolve(anchorDir);
|
|
1395
1399
|
return e2eDirsFor(project).filter((dir) => path6.resolve(dir) !== anchor2);
|
|
1396
1400
|
}
|
|
1397
|
-
var
|
|
1401
|
+
var fs6, path6, E2E_DIR, LEGACY_E2E_DIRS, E2E_DIRS, E2E_DIR_NAMES;
|
|
1398
1402
|
var init_e2e_dirs = __esm({
|
|
1399
1403
|
"../registry/src/e2e-dirs.ts"() {
|
|
1400
1404
|
"use strict";
|
|
1401
|
-
|
|
1405
|
+
fs6 = __toESM(require("node:fs/promises"));
|
|
1402
1406
|
path6 = __toESM(require("node:path"));
|
|
1403
1407
|
E2E_DIR = path6.join(".argent", "e2e");
|
|
1404
1408
|
LEGACY_E2E_DIRS = Object.freeze([path6.join(".argent", "flows")]);
|
|
@@ -1467,10 +1471,10 @@ var init_tool_ids = __esm({
|
|
|
1467
1471
|
// ../registry/src/flow-file-refs.ts
|
|
1468
1472
|
async function canonicalFlowPath(p) {
|
|
1469
1473
|
try {
|
|
1470
|
-
return await
|
|
1474
|
+
return await fs7.realpath(p);
|
|
1471
1475
|
} catch {
|
|
1472
1476
|
try {
|
|
1473
|
-
return path7.join(await
|
|
1477
|
+
return path7.join(await fs7.realpath(path7.dirname(p)), path7.basename(p));
|
|
1474
1478
|
} catch {
|
|
1475
1479
|
return p;
|
|
1476
1480
|
}
|
|
@@ -1492,7 +1496,7 @@ function flowMemberKey(anchorDir, target) {
|
|
|
1492
1496
|
return `${anchorDir}\0${target}`;
|
|
1493
1497
|
}
|
|
1494
1498
|
async function classifyOnDiskSpelling(dir, base, addressable = FLOW_FILE_NAME_PATTERN) {
|
|
1495
|
-
const entries = await
|
|
1499
|
+
const entries = await fs7.readdir(dir).catch(() => null);
|
|
1496
1500
|
if (entries === null || entries.includes(base)) return { state: "listed" };
|
|
1497
1501
|
const actual = entries.find((entry) => entry.toLowerCase() === base.toLowerCase());
|
|
1498
1502
|
if (actual === void 0) return { state: "absent" };
|
|
@@ -1530,11 +1534,11 @@ function nestedFlowTarget(args) {
|
|
|
1530
1534
|
function isResolvedAbsolute(value) {
|
|
1531
1535
|
return typeof value === "string" && path7.isAbsolute(value) && !value.split(/[\\/]+/).includes("..");
|
|
1532
1536
|
}
|
|
1533
|
-
var
|
|
1537
|
+
var fs7, path7, MAX_RUN_DEPTH;
|
|
1534
1538
|
var init_flow_file_refs = __esm({
|
|
1535
1539
|
"../registry/src/flow-file-refs.ts"() {
|
|
1536
1540
|
"use strict";
|
|
1537
|
-
|
|
1541
|
+
fs7 = __toESM(require("node:fs/promises"));
|
|
1538
1542
|
path7 = __toESM(require("node:path"));
|
|
1539
1543
|
init_file_inputs();
|
|
1540
1544
|
init_e2e_dirs();
|
|
@@ -43202,7 +43206,7 @@ var require_view = __commonJS({
|
|
|
43202
43206
|
"use strict";
|
|
43203
43207
|
var debug = require_src()("express:view");
|
|
43204
43208
|
var path76 = require("node:path");
|
|
43205
|
-
var
|
|
43209
|
+
var fs92 = require("node:fs");
|
|
43206
43210
|
var dirname28 = path76.dirname;
|
|
43207
43211
|
var basename24 = path76.basename;
|
|
43208
43212
|
var extname7 = path76.extname;
|
|
@@ -43282,7 +43286,7 @@ var require_view = __commonJS({
|
|
|
43282
43286
|
function tryStat(path77) {
|
|
43283
43287
|
debug('stat "%s"', path77);
|
|
43284
43288
|
try {
|
|
43285
|
-
return
|
|
43289
|
+
return fs92.statSync(path77);
|
|
43286
43290
|
} catch (e) {
|
|
43287
43291
|
return void 0;
|
|
43288
43292
|
}
|
|
@@ -47203,7 +47207,7 @@ var require_send = __commonJS({
|
|
|
47203
47207
|
var escapeHtml = require_escape_html();
|
|
47204
47208
|
var etag = require_etag();
|
|
47205
47209
|
var fresh = require_fresh();
|
|
47206
|
-
var
|
|
47210
|
+
var fs92 = require("fs");
|
|
47207
47211
|
var mime = require_mime_types();
|
|
47208
47212
|
var ms3 = require_ms();
|
|
47209
47213
|
var onFinished = require_on_finished();
|
|
@@ -47485,7 +47489,7 @@ var require_send = __commonJS({
|
|
|
47485
47489
|
var i = 0;
|
|
47486
47490
|
var self2 = this;
|
|
47487
47491
|
debug('stat "%s"', path77);
|
|
47488
|
-
|
|
47492
|
+
fs92.stat(path77, function onstat(err, stat12) {
|
|
47489
47493
|
var pathEndsWithSep = path77[path77.length - 1] === sep12;
|
|
47490
47494
|
if (err && err.code === "ENOENT" && !extname7(path77) && !pathEndsWithSep) {
|
|
47491
47495
|
return next(err);
|
|
@@ -47502,7 +47506,7 @@ var require_send = __commonJS({
|
|
|
47502
47506
|
}
|
|
47503
47507
|
var p = path77 + "." + self2._extensions[i++];
|
|
47504
47508
|
debug('stat "%s"', p);
|
|
47505
|
-
|
|
47509
|
+
fs92.stat(p, function(err2, stat12) {
|
|
47506
47510
|
if (err2) return next(err2);
|
|
47507
47511
|
if (stat12.isDirectory()) return next();
|
|
47508
47512
|
self2.emit("file", p, stat12);
|
|
@@ -47520,7 +47524,7 @@ var require_send = __commonJS({
|
|
|
47520
47524
|
}
|
|
47521
47525
|
var p = join80(path77, self2._index[i]);
|
|
47522
47526
|
debug('stat "%s"', p);
|
|
47523
|
-
|
|
47527
|
+
fs92.stat(p, function(err2, stat12) {
|
|
47524
47528
|
if (err2) return next(err2);
|
|
47525
47529
|
if (stat12.isDirectory()) return next();
|
|
47526
47530
|
self2.emit("file", p, stat12);
|
|
@@ -47532,7 +47536,7 @@ var require_send = __commonJS({
|
|
|
47532
47536
|
SendStream.prototype.stream = function stream(path77, options) {
|
|
47533
47537
|
var self2 = this;
|
|
47534
47538
|
var res = this.res;
|
|
47535
|
-
var stream2 =
|
|
47539
|
+
var stream2 = fs92.createReadStream(path77, options);
|
|
47536
47540
|
this.emit("stream", stream2);
|
|
47537
47541
|
stream2.pipe(res);
|
|
47538
47542
|
function cleanup() {
|
|
@@ -57660,14 +57664,14 @@ var require_parser = __commonJS({
|
|
|
57660
57664
|
case "scalar":
|
|
57661
57665
|
case "single-quoted-scalar":
|
|
57662
57666
|
case "double-quoted-scalar": {
|
|
57663
|
-
const
|
|
57667
|
+
const fs92 = this.flowScalar(this.type);
|
|
57664
57668
|
if (atNextItem || it.value) {
|
|
57665
|
-
map2.items.push({ start: start2, key:
|
|
57669
|
+
map2.items.push({ start: start2, key: fs92, sep: [] });
|
|
57666
57670
|
this.onKeyLine = true;
|
|
57667
57671
|
} else if (it.sep) {
|
|
57668
|
-
this.stack.push(
|
|
57672
|
+
this.stack.push(fs92);
|
|
57669
57673
|
} else {
|
|
57670
|
-
Object.assign(it, { key:
|
|
57674
|
+
Object.assign(it, { key: fs92, sep: [] });
|
|
57671
57675
|
this.onKeyLine = true;
|
|
57672
57676
|
}
|
|
57673
57677
|
return;
|
|
@@ -57795,13 +57799,13 @@ var require_parser = __commonJS({
|
|
|
57795
57799
|
case "scalar":
|
|
57796
57800
|
case "single-quoted-scalar":
|
|
57797
57801
|
case "double-quoted-scalar": {
|
|
57798
|
-
const
|
|
57802
|
+
const fs92 = this.flowScalar(this.type);
|
|
57799
57803
|
if (!it || it.value)
|
|
57800
|
-
fc.items.push({ start: [], key:
|
|
57804
|
+
fc.items.push({ start: [], key: fs92, sep: [] });
|
|
57801
57805
|
else if (it.sep)
|
|
57802
|
-
this.stack.push(
|
|
57806
|
+
this.stack.push(fs92);
|
|
57803
57807
|
else
|
|
57804
|
-
Object.assign(it, { key:
|
|
57808
|
+
Object.assign(it, { key: fs92, sep: [] });
|
|
57805
57809
|
return;
|
|
57806
57810
|
}
|
|
57807
57811
|
case "flow-map-end":
|
|
@@ -58477,7 +58481,7 @@ function warnOnce(key2, message) {
|
|
|
58477
58481
|
function readProviderFile(file2) {
|
|
58478
58482
|
let raw;
|
|
58479
58483
|
try {
|
|
58480
|
-
raw =
|
|
58484
|
+
raw = fs17.readFileSync(file2, "utf8");
|
|
58481
58485
|
} catch {
|
|
58482
58486
|
return void 0;
|
|
58483
58487
|
}
|
|
@@ -58527,7 +58531,7 @@ function discoverProviders() {
|
|
|
58527
58531
|
function descriptorFiles() {
|
|
58528
58532
|
const directory = providersDirectory();
|
|
58529
58533
|
try {
|
|
58530
|
-
return
|
|
58534
|
+
return fs17.readdirSync(directory).filter((name) => name.endsWith(".json")).sort().map((name) => path17.join(directory, name));
|
|
58531
58535
|
} catch {
|
|
58532
58536
|
return [];
|
|
58533
58537
|
}
|
|
@@ -58588,11 +58592,11 @@ function readProviderDevices(record2, classify) {
|
|
|
58588
58592
|
}
|
|
58589
58593
|
return out;
|
|
58590
58594
|
}
|
|
58591
|
-
var
|
|
58595
|
+
var fs17, os2, path17, DISABLE_ENV, OVERRIDE_ENV, warnedOnce;
|
|
58592
58596
|
var init_read = __esm({
|
|
58593
58597
|
"../device-providers/src/read.ts"() {
|
|
58594
58598
|
"use strict";
|
|
58595
|
-
|
|
58599
|
+
fs17 = __toESM(require("node:fs"));
|
|
58596
58600
|
os2 = __toESM(require("node:os"));
|
|
58597
58601
|
path17 = __toESM(require("node:path"));
|
|
58598
58602
|
init_contract();
|
|
@@ -58636,9 +58640,9 @@ function trackedMacosAppsFile() {
|
|
|
58636
58640
|
}
|
|
58637
58641
|
function trackedRecords() {
|
|
58638
58642
|
const file2 = trackedMacosAppsFile();
|
|
58639
|
-
const { ino, mtimeMs, size } =
|
|
58643
|
+
const { ino, mtimeMs, size } = fs18.statSync(file2);
|
|
58640
58644
|
if (parsed?.file !== file2 || parsed.ino !== ino || parsed.mtimeMs !== mtimeMs || parsed.size !== size) {
|
|
58641
|
-
const records = JSON.parse(
|
|
58645
|
+
const records = JSON.parse(fs18.readFileSync(file2, "utf8"));
|
|
58642
58646
|
const catalyst = /* @__PURE__ */ new Set();
|
|
58643
58647
|
const vendorIds = /* @__PURE__ */ new Map();
|
|
58644
58648
|
for (const record2 of Array.isArray(records) ? records : []) {
|
|
@@ -58669,11 +58673,11 @@ function trackedMacosAppVendorId(bundleId) {
|
|
|
58669
58673
|
return void 0;
|
|
58670
58674
|
}
|
|
58671
58675
|
}
|
|
58672
|
-
var
|
|
58676
|
+
var fs18, path18, parsed;
|
|
58673
58677
|
var init_macos_app_kind = __esm({
|
|
58674
58678
|
"../tool-server/src/utils/macos-app-kind.ts"() {
|
|
58675
58679
|
"use strict";
|
|
58676
|
-
|
|
58680
|
+
fs18 = __toESM(require("node:fs"));
|
|
58677
58681
|
path18 = __toESM(require("node:path"));
|
|
58678
58682
|
init_src();
|
|
58679
58683
|
parsed = null;
|
|
@@ -65604,7 +65608,7 @@ var require_safe_json_stringify = __commonJS({
|
|
|
65604
65608
|
// ../../node_modules/ncp/lib/ncp.js
|
|
65605
65609
|
var require_ncp = __commonJS({
|
|
65606
65610
|
"../../node_modules/ncp/lib/ncp.js"(exports2, module2) {
|
|
65607
|
-
var
|
|
65611
|
+
var fs92 = require("fs");
|
|
65608
65612
|
var path76 = require("path");
|
|
65609
65613
|
module2.exports = ncp;
|
|
65610
65614
|
ncp.ncp = ncp;
|
|
@@ -65633,7 +65637,7 @@ var require_ncp = __commonJS({
|
|
|
65633
65637
|
return getStats(source2);
|
|
65634
65638
|
}
|
|
65635
65639
|
function getStats(source2) {
|
|
65636
|
-
var stat12 = dereference ?
|
|
65640
|
+
var stat12 = dereference ? fs92.stat : fs92.lstat;
|
|
65637
65641
|
if (running >= limit) {
|
|
65638
65642
|
return setImmediate(function() {
|
|
65639
65643
|
getStats(source2);
|
|
@@ -65673,7 +65677,7 @@ var require_ncp = __commonJS({
|
|
|
65673
65677
|
});
|
|
65674
65678
|
}
|
|
65675
65679
|
if (modified) {
|
|
65676
|
-
var stat12 = dereference ?
|
|
65680
|
+
var stat12 = dereference ? fs92.stat : fs92.lstat;
|
|
65677
65681
|
stat12(target, function(err, stats) {
|
|
65678
65682
|
if (file2.mtime.getTime() > stats.mtime.getTime())
|
|
65679
65683
|
copyFile(file2, target);
|
|
@@ -65685,7 +65689,7 @@ var require_ncp = __commonJS({
|
|
|
65685
65689
|
});
|
|
65686
65690
|
}
|
|
65687
65691
|
function copyFile(file2, target) {
|
|
65688
|
-
var readStream =
|
|
65692
|
+
var readStream = fs92.createReadStream(file2.name), writeStream = fs92.createWriteStream(target, { mode: file2.mode });
|
|
65689
65693
|
readStream.on("error", onError);
|
|
65690
65694
|
writeStream.on("error", onError);
|
|
65691
65695
|
if (transform2) {
|
|
@@ -65697,13 +65701,13 @@ var require_ncp = __commonJS({
|
|
|
65697
65701
|
}
|
|
65698
65702
|
writeStream.once("finish", function() {
|
|
65699
65703
|
if (modified) {
|
|
65700
|
-
|
|
65704
|
+
fs92.utimesSync(target, file2.atime, file2.mtime);
|
|
65701
65705
|
cb();
|
|
65702
65706
|
} else cb();
|
|
65703
65707
|
});
|
|
65704
65708
|
}
|
|
65705
65709
|
function rmFile(file2, done) {
|
|
65706
|
-
|
|
65710
|
+
fs92.unlink(file2, function(err) {
|
|
65707
65711
|
if (err) {
|
|
65708
65712
|
return onError(err);
|
|
65709
65713
|
}
|
|
@@ -65720,7 +65724,7 @@ var require_ncp = __commonJS({
|
|
|
65720
65724
|
});
|
|
65721
65725
|
}
|
|
65722
65726
|
function mkDir(dir, target) {
|
|
65723
|
-
|
|
65727
|
+
fs92.mkdir(target, dir.mode, function(err) {
|
|
65724
65728
|
if (err) {
|
|
65725
65729
|
return onError(err);
|
|
65726
65730
|
}
|
|
@@ -65728,7 +65732,7 @@ var require_ncp = __commonJS({
|
|
|
65728
65732
|
});
|
|
65729
65733
|
}
|
|
65730
65734
|
function copyDir(dir) {
|
|
65731
|
-
|
|
65735
|
+
fs92.readdir(dir, function(err, items) {
|
|
65732
65736
|
if (err) {
|
|
65733
65737
|
return onError(err);
|
|
65734
65738
|
}
|
|
@@ -65740,7 +65744,7 @@ var require_ncp = __commonJS({
|
|
|
65740
65744
|
}
|
|
65741
65745
|
function onLink(link) {
|
|
65742
65746
|
var target = link.replace(currentPath, targetPath);
|
|
65743
|
-
|
|
65747
|
+
fs92.readlink(link, function(err, resolvedPath2) {
|
|
65744
65748
|
if (err) {
|
|
65745
65749
|
return onError(err);
|
|
65746
65750
|
}
|
|
@@ -65755,7 +65759,7 @@ var require_ncp = __commonJS({
|
|
|
65755
65759
|
if (writable) {
|
|
65756
65760
|
return makeLink(resolvedPath2, target);
|
|
65757
65761
|
}
|
|
65758
|
-
|
|
65762
|
+
fs92.readlink(target, function(err, targetDest) {
|
|
65759
65763
|
if (err) {
|
|
65760
65764
|
return onError(err);
|
|
65761
65765
|
}
|
|
@@ -65772,7 +65776,7 @@ var require_ncp = __commonJS({
|
|
|
65772
65776
|
});
|
|
65773
65777
|
}
|
|
65774
65778
|
function makeLink(linkPath, target) {
|
|
65775
|
-
|
|
65779
|
+
fs92.symlink(linkPath, target, function(err) {
|
|
65776
65780
|
if (err) {
|
|
65777
65781
|
return onError(err);
|
|
65778
65782
|
}
|
|
@@ -65780,7 +65784,7 @@ var require_ncp = __commonJS({
|
|
|
65780
65784
|
});
|
|
65781
65785
|
}
|
|
65782
65786
|
function isWritable2(path77, done) {
|
|
65783
|
-
|
|
65787
|
+
fs92.lstat(path77, function(err) {
|
|
65784
65788
|
if (err) {
|
|
65785
65789
|
if (err.code === "ENOENT") return done(true);
|
|
65786
65790
|
return done(false);
|
|
@@ -65792,7 +65796,7 @@ var require_ncp = __commonJS({
|
|
|
65792
65796
|
if (options.stopOnError) {
|
|
65793
65797
|
return cback(err);
|
|
65794
65798
|
} else if (!errs && options.errs) {
|
|
65795
|
-
errs =
|
|
65799
|
+
errs = fs92.createWriteStream(options.errs);
|
|
65796
65800
|
} else if (!errs) {
|
|
65797
65801
|
errs = [];
|
|
65798
65802
|
}
|
|
@@ -66921,7 +66925,7 @@ var require_sync = __commonJS({
|
|
|
66921
66925
|
"../../node_modules/glob/sync.js"(exports2, module2) {
|
|
66922
66926
|
module2.exports = globSync;
|
|
66923
66927
|
globSync.GlobSync = GlobSync;
|
|
66924
|
-
var
|
|
66928
|
+
var fs92 = require("fs");
|
|
66925
66929
|
var minimatch = require_minimatch();
|
|
66926
66930
|
var Minimatch = minimatch.Minimatch;
|
|
66927
66931
|
var Glob = require_glob().Glob;
|
|
@@ -66966,7 +66970,7 @@ var require_sync = __commonJS({
|
|
|
66966
66970
|
for (var p in matchset) {
|
|
66967
66971
|
try {
|
|
66968
66972
|
p = self2._makeAbs(p);
|
|
66969
|
-
var real =
|
|
66973
|
+
var real = fs92.realpathSync(p, self2.realpathCache);
|
|
66970
66974
|
set2[real] = true;
|
|
66971
66975
|
} catch (er) {
|
|
66972
66976
|
if (er.syscall === "stat")
|
|
@@ -67093,7 +67097,7 @@ var require_sync = __commonJS({
|
|
|
67093
67097
|
var lstat;
|
|
67094
67098
|
var stat12;
|
|
67095
67099
|
try {
|
|
67096
|
-
lstat =
|
|
67100
|
+
lstat = fs92.lstatSync(abs);
|
|
67097
67101
|
} catch (er) {
|
|
67098
67102
|
return null;
|
|
67099
67103
|
}
|
|
@@ -67117,7 +67121,7 @@ var require_sync = __commonJS({
|
|
|
67117
67121
|
return c;
|
|
67118
67122
|
}
|
|
67119
67123
|
try {
|
|
67120
|
-
return this._readdirEntries(abs,
|
|
67124
|
+
return this._readdirEntries(abs, fs92.readdirSync(abs));
|
|
67121
67125
|
} catch (er) {
|
|
67122
67126
|
this._readdirError(abs, er);
|
|
67123
67127
|
return null;
|
|
@@ -67221,13 +67225,13 @@ var require_sync = __commonJS({
|
|
|
67221
67225
|
if (!stat12) {
|
|
67222
67226
|
var lstat;
|
|
67223
67227
|
try {
|
|
67224
|
-
lstat =
|
|
67228
|
+
lstat = fs92.lstatSync(abs);
|
|
67225
67229
|
} catch (er) {
|
|
67226
67230
|
return false;
|
|
67227
67231
|
}
|
|
67228
67232
|
if (lstat.isSymbolicLink()) {
|
|
67229
67233
|
try {
|
|
67230
|
-
stat12 =
|
|
67234
|
+
stat12 = fs92.statSync(abs);
|
|
67231
67235
|
} catch (er) {
|
|
67232
67236
|
stat12 = lstat;
|
|
67233
67237
|
}
|
|
@@ -67301,7 +67305,7 @@ var require_inflight = __commonJS({
|
|
|
67301
67305
|
var require_glob = __commonJS({
|
|
67302
67306
|
"../../node_modules/glob/glob.js"(exports2, module2) {
|
|
67303
67307
|
module2.exports = glob;
|
|
67304
|
-
var
|
|
67308
|
+
var fs92 = require("fs");
|
|
67305
67309
|
var minimatch = require_minimatch();
|
|
67306
67310
|
var Minimatch = minimatch.Minimatch;
|
|
67307
67311
|
var inherits = require_inherits();
|
|
@@ -67438,7 +67442,7 @@ var require_glob = __commonJS({
|
|
|
67438
67442
|
var set2 = this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
67439
67443
|
found.forEach(function(p, i) {
|
|
67440
67444
|
p = self2._makeAbs(p);
|
|
67441
|
-
|
|
67445
|
+
fs92.realpath(p, self2.realpathCache, function(er, real) {
|
|
67442
67446
|
if (!er)
|
|
67443
67447
|
set2[real] = true;
|
|
67444
67448
|
else if (er.syscall === "stat")
|
|
@@ -67633,7 +67637,7 @@ var require_glob = __commonJS({
|
|
|
67633
67637
|
var self2 = this;
|
|
67634
67638
|
var lstatcb = inflight(lstatkey, lstatcb_);
|
|
67635
67639
|
if (lstatcb)
|
|
67636
|
-
|
|
67640
|
+
fs92.lstat(abs, lstatcb);
|
|
67637
67641
|
function lstatcb_(er, lstat) {
|
|
67638
67642
|
if (er)
|
|
67639
67643
|
return cb();
|
|
@@ -67662,7 +67666,7 @@ var require_glob = __commonJS({
|
|
|
67662
67666
|
return cb(null, c);
|
|
67663
67667
|
}
|
|
67664
67668
|
var self2 = this;
|
|
67665
|
-
|
|
67669
|
+
fs92.readdir(abs, readdirCb(this, abs, cb));
|
|
67666
67670
|
};
|
|
67667
67671
|
function readdirCb(self2, abs, cb) {
|
|
67668
67672
|
return function(er, entries) {
|
|
@@ -67800,10 +67804,10 @@ var require_glob = __commonJS({
|
|
|
67800
67804
|
var self2 = this;
|
|
67801
67805
|
var statcb = inflight("stat\0" + abs, lstatcb_);
|
|
67802
67806
|
if (statcb)
|
|
67803
|
-
|
|
67807
|
+
fs92.lstat(abs, statcb);
|
|
67804
67808
|
function lstatcb_(er, lstat) {
|
|
67805
67809
|
if (lstat && lstat.isSymbolicLink()) {
|
|
67806
|
-
return
|
|
67810
|
+
return fs92.stat(abs, function(er2, stat13) {
|
|
67807
67811
|
if (er2)
|
|
67808
67812
|
self2._stat2(f, abs, null, lstat, cb);
|
|
67809
67813
|
else
|
|
@@ -67839,7 +67843,7 @@ var require_rimraf = __commonJS({
|
|
|
67839
67843
|
rimraf.sync = rimrafSync;
|
|
67840
67844
|
var assert2 = require("assert");
|
|
67841
67845
|
var path76 = require("path");
|
|
67842
|
-
var
|
|
67846
|
+
var fs92 = require("fs");
|
|
67843
67847
|
var glob = require_glob();
|
|
67844
67848
|
var globOpts = {
|
|
67845
67849
|
nosort: true,
|
|
@@ -67859,9 +67863,9 @@ var require_rimraf = __commonJS({
|
|
|
67859
67863
|
"readdir"
|
|
67860
67864
|
];
|
|
67861
67865
|
methods.forEach(function(m) {
|
|
67862
|
-
options[m] = options[m] ||
|
|
67866
|
+
options[m] = options[m] || fs92[m];
|
|
67863
67867
|
m = m + "Sync";
|
|
67864
|
-
options[m] = options[m] ||
|
|
67868
|
+
options[m] = options[m] || fs92[m];
|
|
67865
67869
|
});
|
|
67866
67870
|
options.maxBusyTries = options.maxBusyTries || 3;
|
|
67867
67871
|
options.emfileWait = options.emfileWait || 1e3;
|
|
@@ -67883,7 +67887,7 @@ var require_rimraf = __commonJS({
|
|
|
67883
67887
|
var n = 0;
|
|
67884
67888
|
if (options.disableGlob || !glob.hasMagic(p))
|
|
67885
67889
|
return afterGlob(null, [p]);
|
|
67886
|
-
|
|
67890
|
+
fs92.lstat(p, function(er, stat12) {
|
|
67887
67891
|
if (!er)
|
|
67888
67892
|
return afterGlob(null, [p]);
|
|
67889
67893
|
glob(p, globOpts, afterGlob);
|
|
@@ -68040,7 +68044,7 @@ var require_rimraf = __commonJS({
|
|
|
68040
68044
|
results = [p];
|
|
68041
68045
|
} else {
|
|
68042
68046
|
try {
|
|
68043
|
-
|
|
68047
|
+
fs92.lstatSync(p);
|
|
68044
68048
|
results = [p];
|
|
68045
68049
|
} catch (er) {
|
|
68046
68050
|
results = glob.sync(p, globOpts);
|
|
@@ -68103,7 +68107,7 @@ var require_rimraf = __commonJS({
|
|
|
68103
68107
|
var require_mkdirp = __commonJS({
|
|
68104
68108
|
"../../node_modules/mkdirp/index.js"(exports2, module2) {
|
|
68105
68109
|
var path76 = require("path");
|
|
68106
|
-
var
|
|
68110
|
+
var fs92 = require("fs");
|
|
68107
68111
|
var _0777 = parseInt("0777", 8);
|
|
68108
68112
|
module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
|
|
68109
68113
|
function mkdirP(p, opts, f, made) {
|
|
@@ -68114,7 +68118,7 @@ var require_mkdirp = __commonJS({
|
|
|
68114
68118
|
opts = { mode: opts };
|
|
68115
68119
|
}
|
|
68116
68120
|
var mode = opts.mode;
|
|
68117
|
-
var xfs = opts.fs ||
|
|
68121
|
+
var xfs = opts.fs || fs92;
|
|
68118
68122
|
if (mode === void 0) {
|
|
68119
68123
|
mode = _0777;
|
|
68120
68124
|
}
|
|
@@ -68153,7 +68157,7 @@ var require_mkdirp = __commonJS({
|
|
|
68153
68157
|
opts = { mode: opts };
|
|
68154
68158
|
}
|
|
68155
68159
|
var mode = opts.mode;
|
|
68156
|
-
var xfs = opts.fs ||
|
|
68160
|
+
var xfs = opts.fs || fs92;
|
|
68157
68161
|
if (mode === void 0) {
|
|
68158
68162
|
mode = _0777;
|
|
68159
68163
|
}
|
|
@@ -68190,7 +68194,7 @@ var require_mkdirp = __commonJS({
|
|
|
68190
68194
|
// ../../node_modules/mv/index.js
|
|
68191
68195
|
var require_mv = __commonJS({
|
|
68192
68196
|
"../../node_modules/mv/index.js"(exports2, module2) {
|
|
68193
|
-
var
|
|
68197
|
+
var fs92 = require("fs");
|
|
68194
68198
|
var ncp = require_ncp().ncp;
|
|
68195
68199
|
var path76 = require("path");
|
|
68196
68200
|
var rimraf = require_rimraf();
|
|
@@ -68217,13 +68221,13 @@ var require_mv = __commonJS({
|
|
|
68217
68221
|
}
|
|
68218
68222
|
function doRename() {
|
|
68219
68223
|
if (clobber) {
|
|
68220
|
-
|
|
68224
|
+
fs92.rename(source, dest, function(err) {
|
|
68221
68225
|
if (!err) return cb();
|
|
68222
68226
|
if (err.code !== "EXDEV") return cb(err);
|
|
68223
68227
|
moveFileAcrossDevice(source, dest, clobber, limit, cb);
|
|
68224
68228
|
});
|
|
68225
68229
|
} else {
|
|
68226
|
-
|
|
68230
|
+
fs92.link(source, dest, function(err) {
|
|
68227
68231
|
if (err) {
|
|
68228
68232
|
if (err.code === "EXDEV") {
|
|
68229
68233
|
moveFileAcrossDevice(source, dest, clobber, limit, cb);
|
|
@@ -68236,15 +68240,15 @@ var require_mv = __commonJS({
|
|
|
68236
68240
|
cb(err);
|
|
68237
68241
|
return;
|
|
68238
68242
|
}
|
|
68239
|
-
|
|
68243
|
+
fs92.unlink(source, cb);
|
|
68240
68244
|
});
|
|
68241
68245
|
}
|
|
68242
68246
|
}
|
|
68243
68247
|
}
|
|
68244
68248
|
function moveFileAcrossDevice(source, dest, clobber, limit, cb) {
|
|
68245
68249
|
var outFlags = clobber ? "w" : "wx";
|
|
68246
|
-
var ins =
|
|
68247
|
-
var outs =
|
|
68250
|
+
var ins = fs92.createReadStream(source);
|
|
68251
|
+
var outs = fs92.createWriteStream(dest, { flags: outFlags });
|
|
68248
68252
|
ins.on("error", function(err) {
|
|
68249
68253
|
ins.destroy();
|
|
68250
68254
|
outs.destroy();
|
|
@@ -68264,7 +68268,7 @@ var require_mv = __commonJS({
|
|
|
68264
68268
|
outs.once("close", onClose);
|
|
68265
68269
|
ins.pipe(outs);
|
|
68266
68270
|
function onClose() {
|
|
68267
|
-
|
|
68271
|
+
fs92.unlink(source, cb);
|
|
68268
68272
|
}
|
|
68269
68273
|
}
|
|
68270
68274
|
function moveDirAcrossDevice(source, dest, clobber, limit, cb) {
|
|
@@ -68319,7 +68323,7 @@ var require_bunyan = __commonJS({
|
|
|
68319
68323
|
throw new Error("unknown runtime environment");
|
|
68320
68324
|
}
|
|
68321
68325
|
var os22;
|
|
68322
|
-
var
|
|
68326
|
+
var fs92;
|
|
68323
68327
|
var dtrace;
|
|
68324
68328
|
if (runtimeEnv === "browser") {
|
|
68325
68329
|
os22 = {
|
|
@@ -68327,11 +68331,11 @@ var require_bunyan = __commonJS({
|
|
|
68327
68331
|
return window.location.host;
|
|
68328
68332
|
}
|
|
68329
68333
|
};
|
|
68330
|
-
|
|
68334
|
+
fs92 = {};
|
|
68331
68335
|
dtrace = null;
|
|
68332
68336
|
} else {
|
|
68333
68337
|
os22 = require("os");
|
|
68334
|
-
|
|
68338
|
+
fs92 = require("fs");
|
|
68335
68339
|
try {
|
|
68336
68340
|
dtrace = require("dtrace-provider");
|
|
68337
68341
|
} catch (e) {
|
|
@@ -68711,7 +68715,7 @@ var require_bunyan = __commonJS({
|
|
|
68711
68715
|
s.reemitErrorEvents = true;
|
|
68712
68716
|
}
|
|
68713
68717
|
if (!s.stream) {
|
|
68714
|
-
s.stream =
|
|
68718
|
+
s.stream = fs92.createWriteStream(
|
|
68715
68719
|
s.path,
|
|
68716
68720
|
{ flags: "a", encoding: "utf8" }
|
|
68717
68721
|
);
|
|
@@ -68781,7 +68785,7 @@ var require_bunyan = __commonJS({
|
|
|
68781
68785
|
s.stream.destroySoon();
|
|
68782
68786
|
delete s.stream;
|
|
68783
68787
|
}
|
|
68784
|
-
s.stream =
|
|
68788
|
+
s.stream = fs92.createWriteStream(
|
|
68785
68789
|
s.path,
|
|
68786
68790
|
{ flags: "a", encoding: "utf8" }
|
|
68787
68791
|
);
|
|
@@ -69123,7 +69127,7 @@ var require_bunyan = __commonJS({
|
|
|
69123
69127
|
}
|
|
69124
69128
|
var lastModified = null;
|
|
69125
69129
|
try {
|
|
69126
|
-
var fileInfo =
|
|
69130
|
+
var fileInfo = fs92.statSync(this.path);
|
|
69127
69131
|
lastModified = fileInfo.mtime.getTime();
|
|
69128
69132
|
} catch (err) {
|
|
69129
69133
|
}
|
|
@@ -69134,7 +69138,7 @@ var require_bunyan = __commonJS({
|
|
|
69134
69138
|
rotateAfterOpen = true;
|
|
69135
69139
|
}
|
|
69136
69140
|
}
|
|
69137
|
-
this.stream =
|
|
69141
|
+
this.stream = fs92.createWriteStream(
|
|
69138
69142
|
this.path,
|
|
69139
69143
|
{ flags: "a", encoding: "utf8" }
|
|
69140
69144
|
);
|
|
@@ -69301,7 +69305,7 @@ var require_bunyan = __commonJS({
|
|
|
69301
69305
|
}
|
|
69302
69306
|
n -= 1;
|
|
69303
69307
|
self2._debug(" rm %s", toDel);
|
|
69304
|
-
|
|
69308
|
+
fs92.unlink(toDel, function(delErr) {
|
|
69305
69309
|
moves();
|
|
69306
69310
|
});
|
|
69307
69311
|
}
|
|
@@ -69315,7 +69319,7 @@ var require_bunyan = __commonJS({
|
|
|
69315
69319
|
before += "." + String(n - 1);
|
|
69316
69320
|
}
|
|
69317
69321
|
n -= 1;
|
|
69318
|
-
|
|
69322
|
+
fs92.exists(before, function(exists3) {
|
|
69319
69323
|
if (!exists3) {
|
|
69320
69324
|
moves();
|
|
69321
69325
|
} else {
|
|
@@ -69333,7 +69337,7 @@ var require_bunyan = __commonJS({
|
|
|
69333
69337
|
}
|
|
69334
69338
|
function finish() {
|
|
69335
69339
|
self2._debug(" open %s", self2.path);
|
|
69336
|
-
self2.stream =
|
|
69340
|
+
self2.stream = fs92.createWriteStream(
|
|
69337
69341
|
self2.path,
|
|
69338
69342
|
{ flags: "a", encoding: "utf8" }
|
|
69339
69343
|
);
|
|
@@ -71848,7 +71852,7 @@ function getSharedConfigurationFromEnvironment(signalIdentifier) {
|
|
|
71848
71852
|
init_esm();
|
|
71849
71853
|
|
|
71850
71854
|
// ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-env-configuration.js
|
|
71851
|
-
var
|
|
71855
|
+
var fs8 = __toESM(require("fs"));
|
|
71852
71856
|
var path8 = __toESM(require("path"));
|
|
71853
71857
|
init_esm();
|
|
71854
71858
|
function getStaticHeadersFromEnv(signalIdentifier) {
|
|
@@ -71909,7 +71913,7 @@ function readFileFromEnv(signalSpecificEnvVar, nonSignalSpecificEnvVar, warningM
|
|
|
71909
71913
|
const filePath = signalSpecificPath ?? nonSignalSpecificPath;
|
|
71910
71914
|
if (filePath != null) {
|
|
71911
71915
|
try {
|
|
71912
|
-
return
|
|
71916
|
+
return fs8.readFileSync(path8.resolve(process.cwd(), filePath));
|
|
71913
71917
|
} catch {
|
|
71914
71918
|
diag2.warn(warningMessage);
|
|
71915
71919
|
return void 0;
|
|
@@ -71995,7 +71999,7 @@ var OTLPLogExporter = class extends OTLPExporterBase {
|
|
|
71995
71999
|
init_esm();
|
|
71996
72000
|
|
|
71997
72001
|
// ../telemetry/src/debug.ts
|
|
71998
|
-
var
|
|
72002
|
+
var fs9 = __toESM(require("node:fs"));
|
|
71999
72003
|
|
|
72000
72004
|
// ../telemetry/src/paths.ts
|
|
72001
72005
|
var path9 = __toESM(require("node:path"));
|
|
@@ -72034,8 +72038,8 @@ function emitDebugPayload(payload) {
|
|
|
72034
72038
|
} catch {
|
|
72035
72039
|
}
|
|
72036
72040
|
try {
|
|
72037
|
-
|
|
72038
|
-
|
|
72041
|
+
fs9.mkdirSync(argentHomeDir(), { recursive: true });
|
|
72042
|
+
fs9.appendFileSync(debugLogPath(), line + "\n");
|
|
72039
72043
|
} catch {
|
|
72040
72044
|
}
|
|
72041
72045
|
}
|
|
@@ -72978,7 +72982,7 @@ function isCi(env = process.env) {
|
|
|
72978
72982
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
72979
72983
|
function readCliVersion() {
|
|
72980
72984
|
if (true) {
|
|
72981
|
-
return "0.35.1-next.
|
|
72985
|
+
return "0.35.1-next.34";
|
|
72982
72986
|
}
|
|
72983
72987
|
return "0.0.0";
|
|
72984
72988
|
}
|
|
@@ -73011,7 +73015,7 @@ function getBaseProps(runtime) {
|
|
|
73011
73015
|
|
|
73012
73016
|
// ../telemetry/src/identity.ts
|
|
73013
73017
|
var crypto2 = __toESM(require("node:crypto"));
|
|
73014
|
-
var
|
|
73018
|
+
var fs10 = __toESM(require("node:fs"));
|
|
73015
73019
|
var path10 = __toESM(require("node:path"));
|
|
73016
73020
|
var FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;
|
|
73017
73021
|
var cached2 = null;
|
|
@@ -73126,17 +73130,17 @@ function resolveFingerprintOnce(resolveFingerprint) {
|
|
|
73126
73130
|
function isCorruptIdFile(filePath) {
|
|
73127
73131
|
let isRegularFile;
|
|
73128
73132
|
try {
|
|
73129
|
-
isRegularFile =
|
|
73133
|
+
isRegularFile = fs10.lstatSync(filePath).isFile();
|
|
73130
73134
|
} catch {
|
|
73131
73135
|
return false;
|
|
73132
73136
|
}
|
|
73133
73137
|
return isRegularFile && tryReadId(filePath) === null;
|
|
73134
73138
|
}
|
|
73135
73139
|
function writeIdFileAtomic(finalPath, id) {
|
|
73136
|
-
|
|
73140
|
+
fs10.mkdirSync(argentHomeDir(), { recursive: true });
|
|
73137
73141
|
let occupant;
|
|
73138
73142
|
try {
|
|
73139
|
-
occupant =
|
|
73143
|
+
occupant = fs10.lstatSync(finalPath);
|
|
73140
73144
|
} catch (err) {
|
|
73141
73145
|
if (err.code !== "ENOENT") throw err;
|
|
73142
73146
|
}
|
|
@@ -73147,24 +73151,24 @@ function writeIdFileAtomic(finalPath, id) {
|
|
|
73147
73151
|
argentHomeDir(),
|
|
73148
73152
|
`.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
|
|
73149
73153
|
);
|
|
73150
|
-
const fd =
|
|
73154
|
+
const fd = fs10.openSync(tmpPath, "wx", 384);
|
|
73151
73155
|
try {
|
|
73152
73156
|
try {
|
|
73153
|
-
|
|
73154
|
-
|
|
73157
|
+
fs10.writeSync(fd, id);
|
|
73158
|
+
fs10.fsyncSync(fd);
|
|
73155
73159
|
} finally {
|
|
73156
|
-
|
|
73160
|
+
fs10.closeSync(fd);
|
|
73157
73161
|
}
|
|
73158
|
-
|
|
73162
|
+
fs10.renameSync(tmpPath, finalPath);
|
|
73159
73163
|
} finally {
|
|
73160
73164
|
try {
|
|
73161
|
-
|
|
73165
|
+
fs10.unlinkSync(tmpPath);
|
|
73162
73166
|
} catch {
|
|
73163
73167
|
}
|
|
73164
73168
|
}
|
|
73165
73169
|
}
|
|
73166
73170
|
function mintRandomId(finalPath) {
|
|
73167
|
-
|
|
73171
|
+
fs10.mkdirSync(argentHomeDir(), { recursive: true });
|
|
73168
73172
|
let value = crypto2.randomUUID();
|
|
73169
73173
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
73170
73174
|
const tmpPath = path10.join(
|
|
@@ -73173,19 +73177,19 @@ function mintRandomId(finalPath) {
|
|
|
73173
73177
|
);
|
|
73174
73178
|
let fd;
|
|
73175
73179
|
try {
|
|
73176
|
-
fd =
|
|
73180
|
+
fd = fs10.openSync(tmpPath, "wx", 384);
|
|
73177
73181
|
} catch (err) {
|
|
73178
73182
|
if (err.code === "EEXIST") continue;
|
|
73179
73183
|
throw err;
|
|
73180
73184
|
}
|
|
73181
73185
|
try {
|
|
73182
73186
|
try {
|
|
73183
|
-
|
|
73184
|
-
|
|
73187
|
+
fs10.writeSync(fd, value);
|
|
73188
|
+
fs10.fsyncSync(fd);
|
|
73185
73189
|
} finally {
|
|
73186
|
-
|
|
73190
|
+
fs10.closeSync(fd);
|
|
73187
73191
|
}
|
|
73188
|
-
|
|
73192
|
+
fs10.linkSync(tmpPath, finalPath);
|
|
73189
73193
|
cached2 = { path: finalPath, id: value };
|
|
73190
73194
|
return value;
|
|
73191
73195
|
} catch (err) {
|
|
@@ -73204,7 +73208,7 @@ function mintRandomId(finalPath) {
|
|
|
73204
73208
|
throw err;
|
|
73205
73209
|
} finally {
|
|
73206
73210
|
try {
|
|
73207
|
-
|
|
73211
|
+
fs10.unlinkSync(tmpPath);
|
|
73208
73212
|
} catch {
|
|
73209
73213
|
}
|
|
73210
73214
|
}
|
|
@@ -73217,7 +73221,7 @@ function claimCorruptOccupant(finalPath) {
|
|
|
73217
73221
|
`.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
|
|
73218
73222
|
);
|
|
73219
73223
|
try {
|
|
73220
|
-
|
|
73224
|
+
fs10.renameSync(finalPath, claimed);
|
|
73221
73225
|
} catch {
|
|
73222
73226
|
return null;
|
|
73223
73227
|
}
|
|
@@ -73226,7 +73230,7 @@ function claimCorruptOccupant(finalPath) {
|
|
|
73226
73230
|
grabbed = tryReadId(claimed);
|
|
73227
73231
|
} finally {
|
|
73228
73232
|
try {
|
|
73229
|
-
|
|
73233
|
+
fs10.unlinkSync(claimed);
|
|
73230
73234
|
} catch {
|
|
73231
73235
|
}
|
|
73232
73236
|
}
|
|
@@ -73235,9 +73239,9 @@ function claimCorruptOccupant(finalPath) {
|
|
|
73235
73239
|
function tryReadId(filePath) {
|
|
73236
73240
|
let raw;
|
|
73237
73241
|
try {
|
|
73238
|
-
const stats =
|
|
73242
|
+
const stats = fs10.lstatSync(filePath);
|
|
73239
73243
|
if (!stats.isFile()) return null;
|
|
73240
|
-
raw =
|
|
73244
|
+
raw = fs10.readFileSync(filePath, "utf8");
|
|
73241
73245
|
} catch (err) {
|
|
73242
73246
|
if (err.code === "ENOENT") return null;
|
|
73243
73247
|
return null;
|
|
@@ -73252,7 +73256,7 @@ var import_node_child_process = require("node:child_process");
|
|
|
73252
73256
|
|
|
73253
73257
|
// ../native-devtools-ios/src/index.ts
|
|
73254
73258
|
var path11 = __toESM(require("node:path"));
|
|
73255
|
-
var
|
|
73259
|
+
var fs11 = __toESM(require("node:fs"));
|
|
73256
73260
|
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path11.join(__dirname, "..", "dylibs");
|
|
73257
73261
|
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path11.join(__dirname, "..", "bin");
|
|
73258
73262
|
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path11.join(DYLIB_DIR, "tcp");
|
|
@@ -73266,14 +73270,14 @@ function requireDarwin(what) {
|
|
|
73266
73270
|
}
|
|
73267
73271
|
function requireDylibIn(dir, name) {
|
|
73268
73272
|
const p = path11.join(dir, name);
|
|
73269
|
-
if (!
|
|
73273
|
+
if (!fs11.existsSync(p)) {
|
|
73270
73274
|
throw new Error(`Native devtools dylib not found: ${p}`);
|
|
73271
73275
|
}
|
|
73272
73276
|
return p;
|
|
73273
73277
|
}
|
|
73274
73278
|
function requireTcpArtifact(dir, name, kind, envVar) {
|
|
73275
73279
|
const p = path11.join(dir, name);
|
|
73276
|
-
if (!
|
|
73280
|
+
if (!fs11.existsSync(p)) {
|
|
73277
73281
|
throw new Error(
|
|
73278
73282
|
`TCP-transport ${kind} not found: ${p}. This ${kind} is required to drive an ios-remote (sim-remote) device over the QUIC tunnel. It ships in the argent package under bin/tcp/ and dylibs/tcp/ (platform-neutral); if you are running a local build, produce it with \`bun run build:ios-binaries:tcp\`. To point the lookup at a directory that already contains it, set ${envVar}=<dir>.`
|
|
73279
73283
|
);
|
|
@@ -73357,9 +73361,9 @@ function tcpBinDir() {
|
|
|
73357
73361
|
function simulatorServerBinaryPath() {
|
|
73358
73362
|
const binaryName = simulatorServerBinaryName();
|
|
73359
73363
|
const p = path11.join(platformBinDir(), binaryName);
|
|
73360
|
-
if (!
|
|
73364
|
+
if (!fs11.existsSync(p)) {
|
|
73361
73365
|
const flat = path11.join(BIN_DIR, binaryName);
|
|
73362
|
-
const migrationHint =
|
|
73366
|
+
const migrationHint = fs11.existsSync(flat) ? ` Found a binary at the old flat path ${flat}; move it to ${p} or update ARGENT_SIMULATOR_SERVER_DIR to point at the parent of the platform subdirectory.` : "";
|
|
73363
73367
|
throw new Error(
|
|
73364
73368
|
`simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
|
|
73365
73369
|
);
|
|
@@ -73367,14 +73371,14 @@ function simulatorServerBinaryPath() {
|
|
|
73367
73371
|
return p;
|
|
73368
73372
|
}
|
|
73369
73373
|
function simulatorServerRunDir() {
|
|
73370
|
-
if (
|
|
73374
|
+
if (fs11.existsSync(path11.join(BIN_DIR, "resources", "android"))) {
|
|
73371
73375
|
return BIN_DIR;
|
|
73372
73376
|
}
|
|
73373
73377
|
return platformBinDir();
|
|
73374
73378
|
}
|
|
73375
73379
|
function requireBinIn(dir, name) {
|
|
73376
73380
|
const p = path11.join(dir, name);
|
|
73377
|
-
if (!
|
|
73381
|
+
if (!fs11.existsSync(p)) {
|
|
73378
73382
|
throw new Error(`${name} binary not found: ${p}`);
|
|
73379
73383
|
}
|
|
73380
73384
|
return p;
|
|
@@ -73400,7 +73404,7 @@ function macosArtifacts() {
|
|
|
73400
73404
|
library: path11.join(DYLIB_DIR, "macos", "libNativeDevtoolsMacos.dylib"),
|
|
73401
73405
|
helper: path11.join(BIN_DIR, "darwin", "argent-macos-helper")
|
|
73402
73406
|
};
|
|
73403
|
-
const missing = Object.values(files).filter((p) => !
|
|
73407
|
+
const missing = Object.values(files).filter((p) => !fs11.existsSync(p));
|
|
73404
73408
|
if (missing.length > 0) {
|
|
73405
73409
|
throw new Error(
|
|
73406
73410
|
`macOS app artifact not found: ${missing.join(", ")}. They ship in the argent package under dylibs/macos/ and bin/darwin/; ARGENT_NATIVE_DEVTOOLS_DIR and ARGENT_SIMULATOR_SERVER_DIR point the lookup at a local build.`
|
|
@@ -73481,7 +73485,7 @@ function resolveHostFingerprintAsync() {
|
|
|
73481
73485
|
}
|
|
73482
73486
|
|
|
73483
73487
|
// ../telemetry/src/consent.ts
|
|
73484
|
-
var
|
|
73488
|
+
var fs12 = __toESM(require("node:fs"));
|
|
73485
73489
|
var path12 = __toESM(require("node:path"));
|
|
73486
73490
|
init_src();
|
|
73487
73491
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -73490,7 +73494,7 @@ function readConfigOverrideAt(filePath) {
|
|
|
73490
73494
|
const miss = { mtimeMs: null, fingerprint: null, enabledOverride: null };
|
|
73491
73495
|
let stats;
|
|
73492
73496
|
try {
|
|
73493
|
-
stats =
|
|
73497
|
+
stats = fs12.lstatSync(filePath);
|
|
73494
73498
|
} catch {
|
|
73495
73499
|
cache.set(filePath, miss);
|
|
73496
73500
|
return null;
|
|
@@ -73507,7 +73511,7 @@ function readConfigOverrideAt(filePath) {
|
|
|
73507
73511
|
}
|
|
73508
73512
|
let parsedEnabled = null;
|
|
73509
73513
|
try {
|
|
73510
|
-
const raw =
|
|
73514
|
+
const raw = fs12.readFileSync(filePath, "utf8");
|
|
73511
73515
|
const json2 = JSON.parse(raw);
|
|
73512
73516
|
if (json2 && typeof json2 === "object") {
|
|
73513
73517
|
const t = json2.telemetry;
|
|
@@ -74784,7 +74788,7 @@ init_command_on_path();
|
|
|
74784
74788
|
init_src2();
|
|
74785
74789
|
|
|
74786
74790
|
// ../tool-server/src/utils/xcode-first-launch.ts
|
|
74787
|
-
var
|
|
74791
|
+
var fs13 = __toESM(require("node:fs"));
|
|
74788
74792
|
var path13 = __toESM(require("node:path"));
|
|
74789
74793
|
var import_node_child_process8 = require("node:child_process");
|
|
74790
74794
|
var WRAPPER_DEVICES = {
|
|
@@ -74822,9 +74826,9 @@ function activeDeveloperDir() {
|
|
|
74822
74826
|
let dir = process.env.DEVELOPER_DIR || null;
|
|
74823
74827
|
if (!dir) {
|
|
74824
74828
|
try {
|
|
74825
|
-
dir =
|
|
74829
|
+
dir = fs13.readlinkSync(locations.selectLink);
|
|
74826
74830
|
} catch {
|
|
74827
|
-
dir =
|
|
74831
|
+
dir = fs13.existsSync(locations.defaultDeveloperDir) ? locations.defaultDeveloperDir : null;
|
|
74828
74832
|
}
|
|
74829
74833
|
}
|
|
74830
74834
|
if (!dir) return null;
|
|
@@ -74836,7 +74840,7 @@ function activeDeveloperDir() {
|
|
|
74836
74840
|
}
|
|
74837
74841
|
function isDirectory(file2) {
|
|
74838
74842
|
try {
|
|
74839
|
-
return
|
|
74843
|
+
return fs13.statSync(file2).isDirectory();
|
|
74840
74844
|
} catch {
|
|
74841
74845
|
return false;
|
|
74842
74846
|
}
|
|
@@ -74847,7 +74851,7 @@ var DIFFERENT_RULE = /\[\[ "\$\{EXPECTED_VERSION\}" != "\$\{CURRENT_VERSION\}" \
|
|
|
74847
74851
|
function parseWrapper(file2) {
|
|
74848
74852
|
let text;
|
|
74849
74853
|
try {
|
|
74850
|
-
text =
|
|
74854
|
+
text = fs13.readFileSync(file2, "utf8");
|
|
74851
74855
|
} catch {
|
|
74852
74856
|
return null;
|
|
74853
74857
|
}
|
|
@@ -74860,7 +74864,7 @@ function parseWrapper(file2) {
|
|
|
74860
74864
|
function readBundleVersion(plistPath) {
|
|
74861
74865
|
let data;
|
|
74862
74866
|
try {
|
|
74863
|
-
data =
|
|
74867
|
+
data = fs13.readFileSync(plistPath);
|
|
74864
74868
|
} catch (err) {
|
|
74865
74869
|
return err.code === "ENOENT" ? "missing" : null;
|
|
74866
74870
|
}
|
|
@@ -75182,7 +75186,7 @@ function startUpdateChecker(options = {}) {
|
|
|
75182
75186
|
|
|
75183
75187
|
// ../tool-server/src/tools/system/update-argent.ts
|
|
75184
75188
|
var import_node_child_process9 = require("node:child_process");
|
|
75185
|
-
var
|
|
75189
|
+
var fs16 = __toESM(require("node:fs"));
|
|
75186
75190
|
var path16 = __toESM(require("node:path"));
|
|
75187
75191
|
init_zod();
|
|
75188
75192
|
|
|
@@ -75235,7 +75239,7 @@ function buildScreenRecordingNote(recordings2, nowMs) {
|
|
|
75235
75239
|
|
|
75236
75240
|
// ../tool-server/src/tools/flows/flow-utils.ts
|
|
75237
75241
|
var path15 = __toESM(require("node:path"));
|
|
75238
|
-
var
|
|
75242
|
+
var fs15 = __toESM(require("node:fs/promises"));
|
|
75239
75243
|
var import_node_fs7 = require("node:fs");
|
|
75240
75244
|
var import_node_util6 = require("node:util");
|
|
75241
75245
|
init_src();
|
|
@@ -78522,8 +78526,8 @@ function scrubTempPath(err, tmpPath, filePath) {
|
|
|
78522
78526
|
return scrubbed;
|
|
78523
78527
|
}
|
|
78524
78528
|
async function canonicalFlowTarget(filePath) {
|
|
78525
|
-
const dir = await
|
|
78526
|
-
const real = await
|
|
78529
|
+
const dir = await fs15.realpath(path15.dirname(filePath)).catch(() => path15.dirname(filePath));
|
|
78530
|
+
const real = await fs15.realpath(filePath).catch(() => null);
|
|
78527
78531
|
if (real !== null) return { dir, target: real };
|
|
78528
78532
|
return { dir, target: await followDanglingLink(path15.join(dir, path15.basename(filePath))) };
|
|
78529
78533
|
}
|
|
@@ -78534,25 +78538,25 @@ var MAX_DANGLING_LINK_HOPS = 32;
|
|
|
78534
78538
|
async function followDanglingLink(linkPath) {
|
|
78535
78539
|
let current = linkPath;
|
|
78536
78540
|
for (let hop = 0; hop < MAX_DANGLING_LINK_HOPS; hop++) {
|
|
78537
|
-
const target = await
|
|
78541
|
+
const target = await fs15.readlink(current).catch(() => null);
|
|
78538
78542
|
if (target === null) return current;
|
|
78539
78543
|
const resolved = path15.resolve(path15.dirname(current), target);
|
|
78540
|
-
const real = await
|
|
78544
|
+
const real = await fs15.realpath(resolved).catch(() => null);
|
|
78541
78545
|
if (real !== null) return real;
|
|
78542
|
-
const targetDir = await
|
|
78546
|
+
const targetDir = await fs15.realpath(path15.dirname(resolved)).catch(() => path15.dirname(resolved));
|
|
78543
78547
|
current = path15.join(targetDir, path15.basename(resolved));
|
|
78544
78548
|
}
|
|
78545
78549
|
return current;
|
|
78546
78550
|
}
|
|
78547
78551
|
async function isWritable(filePath) {
|
|
78548
|
-
return
|
|
78552
|
+
return fs15.access(filePath, import_node_fs7.constants.W_OK).then(
|
|
78549
78553
|
() => true,
|
|
78550
78554
|
() => false
|
|
78551
78555
|
);
|
|
78552
78556
|
}
|
|
78553
78557
|
async function writeFlowFile(filePath, content) {
|
|
78554
78558
|
const { dir: resolvedDir, target } = await canonicalFlowTarget(filePath);
|
|
78555
|
-
const previousMode = await
|
|
78559
|
+
const previousMode = await fs15.stat(target).then(
|
|
78556
78560
|
(s) => s.mode & 4095,
|
|
78557
78561
|
() => null
|
|
78558
78562
|
);
|
|
@@ -78572,11 +78576,11 @@ async function writeFlowFile(filePath, content) {
|
|
|
78572
78576
|
`.argent-e2e-${process.pid}-${++flowWriteSeq}.tmp`
|
|
78573
78577
|
);
|
|
78574
78578
|
try {
|
|
78575
|
-
await
|
|
78576
|
-
if (previousMode !== null) await
|
|
78577
|
-
await
|
|
78579
|
+
await fs15.writeFile(tmpPath, content, "utf8");
|
|
78580
|
+
if (previousMode !== null) await fs15.chmod(tmpPath, previousMode);
|
|
78581
|
+
await fs15.rename(tmpPath, target);
|
|
78578
78582
|
} catch (err) {
|
|
78579
|
-
await
|
|
78583
|
+
await fs15.rm(tmpPath, { force: true }).catch(() => {
|
|
78580
78584
|
});
|
|
78581
78585
|
const errno = err instanceof Error ? err : void 0;
|
|
78582
78586
|
const code = typeof errno?.code === "string" ? errno.code : void 0;
|
|
@@ -78612,7 +78616,7 @@ function mkdirFailureHint(code, dir) {
|
|
|
78612
78616
|
async function writeNewFlowFile(filePath, content) {
|
|
78613
78617
|
const dir = path15.dirname(filePath);
|
|
78614
78618
|
try {
|
|
78615
|
-
await
|
|
78619
|
+
await fs15.mkdir(dir, { recursive: true });
|
|
78616
78620
|
} catch (err) {
|
|
78617
78621
|
const code = err instanceof Error ? err.code : void 0;
|
|
78618
78622
|
throw new FailureError(
|
|
@@ -78630,7 +78634,7 @@ async function writeNewFlowFile(filePath, content) {
|
|
|
78630
78634
|
}
|
|
78631
78635
|
async function countStepsOnDisk(filePath, block = "steps") {
|
|
78632
78636
|
try {
|
|
78633
|
-
const flow = parseFlow(await
|
|
78637
|
+
const flow = parseFlow(await fs15.readFile(filePath, "utf8"));
|
|
78634
78638
|
const shutdown2 = flow.shutdown?.length ?? 0;
|
|
78635
78639
|
return block === "steps" ? flow.steps.length : block === "shutdown" ? shutdown2 : flow.steps.length + shutdown2;
|
|
78636
78640
|
} catch {
|
|
@@ -78662,7 +78666,7 @@ async function setRecordingEnv(session, changes) {
|
|
|
78662
78666
|
}
|
|
78663
78667
|
session.lastTouchedSeq = touch();
|
|
78664
78668
|
if (session.persist === "host") {
|
|
78665
|
-
const flow2 = apply(parseFlow(await
|
|
78669
|
+
const flow2 = apply(parseFlow(await fs15.readFile(session.filePath, "utf8")));
|
|
78666
78670
|
validateFlow(flow2);
|
|
78667
78671
|
const updated = serializeFlow(flow2);
|
|
78668
78672
|
await writeFlowFile(session.filePath, updated);
|
|
@@ -78677,7 +78681,7 @@ async function setRecordingEnv(session, changes) {
|
|
|
78677
78681
|
});
|
|
78678
78682
|
}
|
|
78679
78683
|
async function appendStep(filePath, step, block) {
|
|
78680
|
-
const content = await
|
|
78684
|
+
const content = await fs15.readFile(filePath, "utf8");
|
|
78681
78685
|
const flow = parseFlow(content);
|
|
78682
78686
|
(block === "shutdown" ? flow.shutdown ??= [] : flow.steps).push(step);
|
|
78683
78687
|
validateFlow(flow);
|
|
@@ -78886,7 +78890,7 @@ function recordedCount(flow, block) {
|
|
|
78886
78890
|
function resolveCliEntry() {
|
|
78887
78891
|
try {
|
|
78888
78892
|
const entry = path16.join(__dirname, "cli.js");
|
|
78889
|
-
return
|
|
78893
|
+
return fs16.existsSync(entry) ? entry : null;
|
|
78890
78894
|
} catch {
|
|
78891
78895
|
return null;
|
|
78892
78896
|
}
|
|
@@ -78900,14 +78904,14 @@ function classifyRunningInstall() {
|
|
|
78900
78904
|
}
|
|
78901
78905
|
let runningRoot;
|
|
78902
78906
|
try {
|
|
78903
|
-
runningRoot =
|
|
78907
|
+
runningRoot = fs16.realpathSync(path16.dirname(__dirname));
|
|
78904
78908
|
} catch {
|
|
78905
78909
|
return { kind: "global", projectRoot: null };
|
|
78906
78910
|
}
|
|
78907
78911
|
let dir = process.cwd();
|
|
78908
78912
|
while (true) {
|
|
78909
78913
|
try {
|
|
78910
|
-
const nmReal =
|
|
78914
|
+
const nmReal = fs16.realpathSync(path16.join(dir, "node_modules"));
|
|
78911
78915
|
if (runningRoot === nmReal || runningRoot.startsWith(nmReal + path16.sep)) {
|
|
78912
78916
|
return { kind: "local", projectRoot: dir };
|
|
78913
78917
|
}
|
|
@@ -78922,14 +78926,14 @@ function classifyRunningInstall() {
|
|
|
78922
78926
|
function findDeclaringProjectRoot(startDir) {
|
|
78923
78927
|
let dir;
|
|
78924
78928
|
try {
|
|
78925
|
-
dir =
|
|
78929
|
+
dir = fs16.realpathSync(startDir);
|
|
78926
78930
|
} catch {
|
|
78927
78931
|
return null;
|
|
78928
78932
|
}
|
|
78929
78933
|
while (true) {
|
|
78930
|
-
if (
|
|
78934
|
+
if (fs16.existsSync(path16.join(dir, ".argent", "install.json"))) return dir;
|
|
78931
78935
|
try {
|
|
78932
|
-
const manifest = JSON.parse(
|
|
78936
|
+
const manifest = JSON.parse(fs16.readFileSync(path16.join(dir, "package.json"), "utf8"));
|
|
78933
78937
|
if (manifest.devDependencies?.[PACKAGE_NAME2] || manifest.dependencies?.[PACKAGE_NAME2] || manifest.optionalDependencies?.[PACKAGE_NAME2]) {
|
|
78934
78938
|
return dir;
|
|
78935
78939
|
}
|
|
@@ -79042,7 +79046,7 @@ var updateArgentTool = {
|
|
|
79042
79046
|
let projectRoot = null;
|
|
79043
79047
|
let effectiveTarget = resolved;
|
|
79044
79048
|
if (resolved === "local" || resolved === "both") {
|
|
79045
|
-
const recordedRoot = running.projectRoot &&
|
|
79049
|
+
const recordedRoot = running.projectRoot && fs16.existsSync(running.projectRoot) ? running.projectRoot : null;
|
|
79046
79050
|
projectRoot = recordedRoot ?? (running.kind === "local" ? findDeclaringProjectRoot(process.cwd()) : null);
|
|
79047
79051
|
if (!projectRoot) {
|
|
79048
79052
|
if (resolved === "local") {
|
|
@@ -79081,7 +79085,7 @@ var updateArgentTool = {
|
|
|
79081
79085
|
if (targetsOnlyRunningInstall && installableVersion) {
|
|
79082
79086
|
updateArgs.push("--version", installableVersion);
|
|
79083
79087
|
}
|
|
79084
|
-
const spawnRoot = projectRoot ?? (running.projectRoot &&
|
|
79088
|
+
const spawnRoot = projectRoot ?? (running.projectRoot && fs16.existsSync(running.projectRoot) ? running.projectRoot : null);
|
|
79085
79089
|
if (spawnRoot) updateArgs.push("--project-root", spawnRoot);
|
|
79086
79090
|
scheduleUpdater(updateArgs, resolveCliEntry());
|
|
79087
79091
|
const targetLabel3 = effectiveTarget === "both" ? "global and project-local installs" : `${effectiveTarget} install`;
|
|
@@ -79275,7 +79279,7 @@ var SIMCTL_SPAWN_TIMEOUT_MS = 1e4;
|
|
|
79275
79279
|
var SIMCTL_KILL_SIGNAL = "SIGKILL";
|
|
79276
79280
|
|
|
79277
79281
|
// ../tool-server/src/utils/ios-device-sets.ts
|
|
79278
|
-
var
|
|
79282
|
+
var fs19 = __toESM(require("node:fs"));
|
|
79279
79283
|
var import_node_child_process11 = require("node:child_process");
|
|
79280
79284
|
var import_node_util8 = require("node:util");
|
|
79281
79285
|
init_src2();
|
|
@@ -79294,7 +79298,7 @@ function rememberDeviceSet(udid, deviceSet) {
|
|
|
79294
79298
|
deviceSetByUdid.set(udid, deviceSet);
|
|
79295
79299
|
}
|
|
79296
79300
|
async function setContainsUdid(deviceSet, udid) {
|
|
79297
|
-
if (deviceSet && !
|
|
79301
|
+
if (deviceSet && !fs19.existsSync(deviceSet)) return false;
|
|
79298
79302
|
try {
|
|
79299
79303
|
const { stdout } = await execFileAsync7(
|
|
79300
79304
|
"xcrun",
|
|
@@ -79703,7 +79707,7 @@ async function setAccessibilityPrefsPreBoot(udid, { isTvOs }) {
|
|
|
79703
79707
|
}
|
|
79704
79708
|
|
|
79705
79709
|
// ../tool-server/src/utils/ios-devices.ts
|
|
79706
|
-
var
|
|
79710
|
+
var fs20 = __toESM(require("node:fs"));
|
|
79707
79711
|
var path20 = __toESM(require("node:path"));
|
|
79708
79712
|
var import_node_child_process13 = require("node:child_process");
|
|
79709
79713
|
var import_node_util10 = require("node:util");
|
|
@@ -79719,7 +79723,7 @@ function simulatorRuntimeKind(runtimeId) {
|
|
|
79719
79723
|
return runtimeId.includes("iOS") ? "mobile" : void 0;
|
|
79720
79724
|
}
|
|
79721
79725
|
async function listDeviceSetSimulators(deviceSet) {
|
|
79722
|
-
if (deviceSet && !
|
|
79726
|
+
if (deviceSet && !fs20.existsSync(deviceSet)) return { simulators: [], timedOut: false };
|
|
79723
79727
|
try {
|
|
79724
79728
|
const { stdout } = await execFileAsync9(
|
|
79725
79729
|
"xcrun",
|
|
@@ -79838,7 +79842,7 @@ async function deviceTypeBundlePath(identifier) {
|
|
|
79838
79842
|
}
|
|
79839
79843
|
async function countIntegratedDisplays(bundlePath) {
|
|
79840
79844
|
const plist = path20.join(bundlePath, "Contents", "Resources", "capabilities.plist");
|
|
79841
|
-
if (!
|
|
79845
|
+
if (!fs20.existsSync(plist)) return 0;
|
|
79842
79846
|
try {
|
|
79843
79847
|
const { stdout } = await execFileAsync9(
|
|
79844
79848
|
"plutil",
|
|
@@ -98452,7 +98456,7 @@ function captureOnDemandDropped(deviceId, endpoint) {
|
|
|
98452
98456
|
|
|
98453
98457
|
// ../tool-server/src/utils/foldable.ts
|
|
98454
98458
|
var import_node_child_process15 = require("node:child_process");
|
|
98455
|
-
var
|
|
98459
|
+
var fs21 = __toESM(require("node:fs"));
|
|
98456
98460
|
var import_node_util12 = require("node:util");
|
|
98457
98461
|
init_external_devices();
|
|
98458
98462
|
var execFileAsync11 = (0, import_node_util12.promisify)(import_node_child_process15.execFile);
|
|
@@ -98531,7 +98535,7 @@ async function readCoreDeviceDisplays(udid) {
|
|
|
98531
98535
|
const args = ["device", "info", "displays", "--device", nativeUdid, "--json-output", "-"];
|
|
98532
98536
|
const dir = await developerDir();
|
|
98533
98537
|
const env = dir ? { ...process.env, DEVELOPER_DIR: dir } : process.env;
|
|
98534
|
-
const [bin, argv] =
|
|
98538
|
+
const [bin, argv] = fs21.existsSync(DEVICECTL_BIN) ? [DEVICECTL_BIN, args] : ["xcrun", ["devicectl", ...args]];
|
|
98535
98539
|
if (bin === "xcrun" && xcodeFirstLaunchPending("devicectl")) {
|
|
98536
98540
|
return {
|
|
98537
98541
|
displays: null,
|
|
@@ -98875,7 +98879,7 @@ function uiScreenSize(size, orientation) {
|
|
|
98875
98879
|
}
|
|
98876
98880
|
|
|
98877
98881
|
// ../tool-server/src/utils/simulator-client.ts
|
|
98878
|
-
var
|
|
98882
|
+
var fs22 = __toESM(require("node:fs/promises"));
|
|
98879
98883
|
var path21 = __toESM(require("node:path"));
|
|
98880
98884
|
var os4 = __toESM(require("node:os"));
|
|
98881
98885
|
var import_node_crypto6 = require("node:crypto");
|
|
@@ -99421,9 +99425,9 @@ function routeViaTransport(transport, cmd) {
|
|
|
99421
99425
|
function createMoqTransport(moq, options) {
|
|
99422
99426
|
const screenshotDir = path21.join(os4.tmpdir(), "argent-remote-screenshots");
|
|
99423
99427
|
const writeScreenshotToDisk = async (bytes) => {
|
|
99424
|
-
await
|
|
99428
|
+
await fs22.mkdir(screenshotDir, { recursive: true });
|
|
99425
99429
|
const file2 = path21.join(screenshotDir, `${(0, import_node_crypto6.randomUUID)()}.png`);
|
|
99426
|
-
await
|
|
99430
|
+
await fs22.writeFile(file2, bytes);
|
|
99427
99431
|
return { url: (0, import_node_url.pathToFileURL)(file2).toString(), path: file2 };
|
|
99428
99432
|
};
|
|
99429
99433
|
return {
|
|
@@ -99461,11 +99465,11 @@ function createMoqTransport(moq, options) {
|
|
|
99461
99465
|
init_external_devices();
|
|
99462
99466
|
|
|
99463
99467
|
// ../tool-server/src/utils/simulator-watcher.ts
|
|
99464
|
-
var
|
|
99468
|
+
var fs27 = __toESM(require("node:fs"));
|
|
99465
99469
|
|
|
99466
99470
|
// ../tool-server/src/blueprints/native-devtools.ts
|
|
99467
99471
|
var net = __toESM(require("node:net"));
|
|
99468
|
-
var
|
|
99472
|
+
var fs26 = __toESM(require("node:fs"));
|
|
99469
99473
|
var os5 = __toESM(require("node:os"));
|
|
99470
99474
|
var path24 = __toESM(require("node:path"));
|
|
99471
99475
|
|
|
@@ -99752,17 +99756,17 @@ function asString2(value) {
|
|
|
99752
99756
|
// ../tool-server/src/utils/ios-host.ts
|
|
99753
99757
|
var import_node_child_process16 = require("node:child_process");
|
|
99754
99758
|
var import_node_events = require("node:events");
|
|
99755
|
-
var
|
|
99759
|
+
var fs25 = __toESM(require("node:fs"));
|
|
99756
99760
|
var path23 = __toESM(require("node:path"));
|
|
99757
99761
|
var import_node_util13 = require("node:util");
|
|
99758
99762
|
init_src();
|
|
99759
99763
|
|
|
99760
99764
|
// ../tool-server/src/utils/ios-audio-leftovers.ts
|
|
99761
|
-
var
|
|
99765
|
+
var fs24 = __toESM(require("node:fs"));
|
|
99762
99766
|
var path22 = __toESM(require("node:path"));
|
|
99763
99767
|
|
|
99764
99768
|
// ../tool-server/src/utils/ios-audio-rings.ts
|
|
99765
|
-
var
|
|
99769
|
+
var fs23 = __toESM(require("node:fs"));
|
|
99766
99770
|
init_src2();
|
|
99767
99771
|
var RING_HDR = 128;
|
|
99768
99772
|
var IN_MAGIC = 1229410881;
|
|
@@ -99775,20 +99779,20 @@ var FLOAT_SUBFORMAT = "0300000000001000800000aa00389b71";
|
|
|
99775
99779
|
function putU32(fd, pos, value) {
|
|
99776
99780
|
const b = Buffer.alloc(4);
|
|
99777
99781
|
b.writeUInt32LE(value >>> 0);
|
|
99778
|
-
|
|
99782
|
+
fs23.writeSync(fd, b, 0, 4, pos);
|
|
99779
99783
|
}
|
|
99780
99784
|
function createRing(ringPath, header, dataBytes) {
|
|
99781
|
-
const fd =
|
|
99785
|
+
const fd = fs23.openSync(ringPath, "w+", 384);
|
|
99782
99786
|
const hdr = Buffer.alloc(RING_HDR);
|
|
99783
99787
|
header.forEach((v, i) => hdr.writeUInt32LE(v >>> 0, i * 4));
|
|
99784
|
-
|
|
99785
|
-
|
|
99788
|
+
fs23.writeSync(fd, hdr, 0, RING_HDR, 0);
|
|
99789
|
+
fs23.writeSync(fd, Buffer.alloc(dataBytes), 0, dataBytes, RING_HDR);
|
|
99786
99790
|
return fd;
|
|
99787
99791
|
}
|
|
99788
99792
|
function readClipInfo(fd) {
|
|
99789
99793
|
const head = Buffer.alloc(16384);
|
|
99790
|
-
const read =
|
|
99791
|
-
const size =
|
|
99794
|
+
const read = fs23.readSync(fd, head, 0, head.length, 0);
|
|
99795
|
+
const size = fs23.fstatSync(fd).size;
|
|
99792
99796
|
const bad = (why) => new FailureError(`The converted clip is not mono float32 WAV (${why}).`, {
|
|
99793
99797
|
error_code: FAILURE_CODES.AUDIO_CLIP_CONVERSION_FAILED,
|
|
99794
99798
|
failure_stage: "audio_clip_conversion",
|
|
@@ -99817,7 +99821,7 @@ function readClipInfo(fd) {
|
|
|
99817
99821
|
throw bad("no data chunk");
|
|
99818
99822
|
}
|
|
99819
99823
|
function closeSource(source) {
|
|
99820
|
-
if (source.kind === "clip")
|
|
99824
|
+
if (source.kind === "clip") fs23.closeSync(source.fd);
|
|
99821
99825
|
}
|
|
99822
99826
|
var InputFeeder = class {
|
|
99823
99827
|
constructor(ringPath, source) {
|
|
@@ -99869,7 +99873,7 @@ var InputFeeder = class {
|
|
|
99869
99873
|
this.running = false;
|
|
99870
99874
|
if (this.timer) clearInterval(this.timer);
|
|
99871
99875
|
closeSource(this.source);
|
|
99872
|
-
|
|
99876
|
+
fs23.closeSync(this.fd);
|
|
99873
99877
|
}
|
|
99874
99878
|
step() {
|
|
99875
99879
|
const { readFrame, requestGen } = this.readGuest();
|
|
@@ -99889,13 +99893,13 @@ var InputFeeder = class {
|
|
|
99889
99893
|
this.produce(n);
|
|
99890
99894
|
const start2 = this.writeFrame & RING_CAP - 1;
|
|
99891
99895
|
const first = Math.min(n, RING_CAP - start2);
|
|
99892
|
-
|
|
99893
|
-
if (n > first)
|
|
99896
|
+
fs23.writeSync(this.fd, this.bytes, 0, first * 4, RING_HDR + start2 * 4);
|
|
99897
|
+
if (n > first) fs23.writeSync(this.fd, this.bytes, first * 4, (n - first) * 4, RING_HDR);
|
|
99894
99898
|
this.writeFrame = this.writeFrame + n >>> 0;
|
|
99895
99899
|
putU32(this.fd, 16, this.writeFrame);
|
|
99896
99900
|
}
|
|
99897
99901
|
readGuest() {
|
|
99898
|
-
|
|
99902
|
+
fs23.readSync(this.fd, this.guest, 0, 12, 64);
|
|
99899
99903
|
return { readFrame: this.guest.readUInt32LE(0), requestGen: this.guest.readUInt32LE(4) };
|
|
99900
99904
|
}
|
|
99901
99905
|
/** The source starts again from its beginning, with its full play count, at the next frame written. */
|
|
@@ -99930,7 +99934,7 @@ var InputFeeder = class {
|
|
|
99930
99934
|
this.clipPos = 0;
|
|
99931
99935
|
}
|
|
99932
99936
|
const take2 = Math.min(s.info.frames - this.clipPos, n - off);
|
|
99933
|
-
const got =
|
|
99937
|
+
const got = fs23.readSync(
|
|
99934
99938
|
s.fd,
|
|
99935
99939
|
this.bytes,
|
|
99936
99940
|
off * 4,
|
|
@@ -99950,13 +99954,13 @@ var InputFeeder = class {
|
|
|
99950
99954
|
};
|
|
99951
99955
|
function readInCursors(ringPath) {
|
|
99952
99956
|
try {
|
|
99953
|
-
const fd =
|
|
99957
|
+
const fd = fs23.openSync(ringPath, "r");
|
|
99954
99958
|
try {
|
|
99955
99959
|
const b = Buffer.alloc(RING_HDR);
|
|
99956
|
-
if (
|
|
99960
|
+
if (fs23.readSync(fd, b, 0, RING_HDR, 0) < 68 || b.readUInt32LE(0) !== IN_MAGIC) return null;
|
|
99957
99961
|
return { write: b.readUInt32LE(16), read: b.readUInt32LE(64) };
|
|
99958
99962
|
} finally {
|
|
99959
|
-
|
|
99963
|
+
fs23.closeSync(fd);
|
|
99960
99964
|
}
|
|
99961
99965
|
} catch {
|
|
99962
99966
|
return null;
|
|
@@ -99989,20 +99993,20 @@ async function abandoned(text) {
|
|
|
99989
99993
|
const owner = Number(field(text, "host"));
|
|
99990
99994
|
if (owner > 0) return !processAlive(owner);
|
|
99991
99995
|
const ring = field(text, "ring");
|
|
99992
|
-
if (!ring || !
|
|
99996
|
+
if (!ring || !fs24.existsSync(ring)) return true;
|
|
99993
99997
|
return feederGone(ring);
|
|
99994
99998
|
}
|
|
99995
99999
|
async function clearAudioLeftovers(dir) {
|
|
99996
100000
|
let names;
|
|
99997
100001
|
try {
|
|
99998
|
-
names =
|
|
100002
|
+
names = fs24.readdirSync(dir);
|
|
99999
100003
|
} catch {
|
|
100000
100004
|
return;
|
|
100001
100005
|
}
|
|
100002
100006
|
let liveUnmarkedInput = false;
|
|
100003
100007
|
const read = (file2) => {
|
|
100004
100008
|
try {
|
|
100005
|
-
return
|
|
100009
|
+
return fs24.readFileSync(file2, "utf8");
|
|
100006
100010
|
} catch {
|
|
100007
100011
|
return null;
|
|
100008
100012
|
}
|
|
@@ -100017,10 +100021,10 @@ async function clearAudioLeftovers(dir) {
|
|
|
100017
100021
|
continue;
|
|
100018
100022
|
}
|
|
100019
100023
|
if (read(file2) !== text) continue;
|
|
100020
|
-
|
|
100024
|
+
fs24.rmSync(file2, { force: true });
|
|
100021
100025
|
const ring = field(text, "ring");
|
|
100022
100026
|
if (ring && path22.dirname(ring) === dir && /^in-/.test(path22.basename(ring))) {
|
|
100023
|
-
|
|
100027
|
+
fs24.rmSync(ring, { force: true });
|
|
100024
100028
|
}
|
|
100025
100029
|
}
|
|
100026
100030
|
for (const name of names) {
|
|
@@ -100029,13 +100033,13 @@ async function clearAudioLeftovers(dir) {
|
|
|
100029
100033
|
const text = read(file2);
|
|
100030
100034
|
if (text === null) continue;
|
|
100031
100035
|
const pid = Number(field(text, "pid"));
|
|
100032
|
-
if (pid > 0 && !processAlive(pid) && read(file2) === text)
|
|
100036
|
+
if (pid > 0 && !processAlive(pid) && read(file2) === text) fs24.rmSync(file2, { force: true });
|
|
100033
100037
|
}
|
|
100034
100038
|
for (const name of names) {
|
|
100035
100039
|
const owner = /^(?:in|clip)-(\d+)-/.exec(name);
|
|
100036
100040
|
const unmarked = !owner && /^(?:in|clip)-/.test(name) && !liveUnmarkedInput;
|
|
100037
100041
|
if (owner && !processAlive(Number(owner[1])) || unmarked) {
|
|
100038
|
-
|
|
100042
|
+
fs24.rmSync(path22.join(dir, name), { force: true });
|
|
100039
100043
|
}
|
|
100040
100044
|
}
|
|
100041
100045
|
}
|
|
@@ -100073,7 +100077,7 @@ function shouldPreserveDyldInsertLibrariesEntry(entry, bootstrapPath) {
|
|
|
100073
100077
|
if (entry.startsWith("@")) {
|
|
100074
100078
|
return true;
|
|
100075
100079
|
}
|
|
100076
|
-
return
|
|
100080
|
+
return fs25.existsSync(entry);
|
|
100077
100081
|
}
|
|
100078
100082
|
function audioDir(udid) {
|
|
100079
100083
|
return `/tmp/argent-audio-${udid}`;
|
|
@@ -100192,7 +100196,7 @@ async function setupNativeDevtoolsEnvLocal(udid, endpoint) {
|
|
|
100192
100196
|
}
|
|
100193
100197
|
if (audioDylib) {
|
|
100194
100198
|
try {
|
|
100195
|
-
|
|
100199
|
+
fs25.mkdirSync(audioDir(nativeId), { recursive: true, mode: 448 });
|
|
100196
100200
|
await execFileAsync12(
|
|
100197
100201
|
"xcrun",
|
|
100198
100202
|
[
|
|
@@ -101005,7 +101009,7 @@ function bindNativeDevtoolsUnixSocket(server, socketPath) {
|
|
|
101005
101009
|
if ((err.code === "EADDRINUSE" || err.code === "EEXIST") && !retried) {
|
|
101006
101010
|
retried = true;
|
|
101007
101011
|
try {
|
|
101008
|
-
|
|
101012
|
+
fs26.unlinkSync(socketPath);
|
|
101009
101013
|
} catch {
|
|
101010
101014
|
}
|
|
101011
101015
|
server.listen(socketPath);
|
|
@@ -101317,9 +101321,9 @@ var nativeDevtoolsBlueprint = {
|
|
|
101317
101321
|
Math.trunc(amount("uploadThroughput"))
|
|
101318
101322
|
]);
|
|
101319
101323
|
};
|
|
101320
|
-
const readOwnedKeys = (bundleId) =>
|
|
101324
|
+
const readOwnedKeys = (bundleId) => fs26.existsSync(ownedThrottlePath(bundleId)) ? fs26.readFileSync(ownedThrottlePath(bundleId), "utf8").split("\n") : [];
|
|
101321
101325
|
const recordOwnedKeys = (bundleId, keys) => {
|
|
101322
|
-
if (lentSocketPath)
|
|
101326
|
+
if (lentSocketPath) fs26.writeFileSync(ownedThrottlePath(bundleId), keys.join("\n"));
|
|
101323
101327
|
};
|
|
101324
101328
|
const applyThrottle = async (bundleId, throttle) => {
|
|
101325
101329
|
await noteProviderCapture(bundleId);
|
|
@@ -101335,11 +101339,11 @@ var nativeDevtoolsBlueprint = {
|
|
|
101335
101339
|
await sendCdpRpc(bundleId, "NativeDevtoolsIos.configure", { bypassPorts: [] });
|
|
101336
101340
|
await sendCdpRpc(bundleId, keepsCapture(bundleId) ? "Network.enable" : "Network.disable");
|
|
101337
101341
|
providerCapture.delete(bundleId);
|
|
101338
|
-
|
|
101342
|
+
fs26.rmSync(ownedThrottlePath(bundleId), { force: true });
|
|
101339
101343
|
};
|
|
101340
101344
|
const isEmulating = (state3) => state3?.offline === true || ["latency", "downloadThroughput", "uploadThroughput"].some((key2) => Number(state3?.[key2]) > 0);
|
|
101341
101345
|
const clearLeftoverThrottle = async (bundleId) => {
|
|
101342
|
-
if (!lentSocketPath || !
|
|
101346
|
+
if (!lentSocketPath || !fs26.existsSync(ownedThrottlePath(bundleId))) return;
|
|
101343
101347
|
const method = "NativeDevtoolsIos.getConditions";
|
|
101344
101348
|
const state3 = await sendCdpRpc(bundleId, method).catch((err) => {
|
|
101345
101349
|
if (err instanceof Error && err.message.endsWith(`Unsupported method: ${method}`))
|
|
@@ -101347,7 +101351,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
101347
101351
|
throw err;
|
|
101348
101352
|
});
|
|
101349
101353
|
if (!isEmulating(state3) || !readOwnedKeys(bundleId).includes(conditionsKey(state3))) {
|
|
101350
|
-
|
|
101354
|
+
fs26.rmSync(ownedThrottlePath(bundleId), { force: true });
|
|
101351
101355
|
return;
|
|
101352
101356
|
}
|
|
101353
101357
|
providerCapture.set(bundleId, true);
|
|
@@ -101431,7 +101435,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
101431
101435
|
};
|
|
101432
101436
|
if (transport === "unix" && !lentSocketPath) {
|
|
101433
101437
|
try {
|
|
101434
|
-
|
|
101438
|
+
fs26.unlinkSync(socketPath);
|
|
101435
101439
|
} catch {
|
|
101436
101440
|
}
|
|
101437
101441
|
}
|
|
@@ -101859,7 +101863,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
101859
101863
|
server?.close();
|
|
101860
101864
|
if (transport === "unix" && !lentSocketPath) {
|
|
101861
101865
|
try {
|
|
101862
|
-
|
|
101866
|
+
fs26.unlinkSync(socketPath);
|
|
101863
101867
|
} catch {
|
|
101864
101868
|
}
|
|
101865
101869
|
}
|
|
@@ -102016,7 +102020,7 @@ async function getBootedUdidsInSet(deviceSet, signal) {
|
|
|
102016
102020
|
async function getBootedUdids(signal) {
|
|
102017
102021
|
const sets = [
|
|
102018
102022
|
null,
|
|
102019
|
-
...configuredAdditionalDeviceSets().filter((p) =>
|
|
102023
|
+
...configuredAdditionalDeviceSets().filter((p) => fs27.existsSync(p))
|
|
102020
102024
|
];
|
|
102021
102025
|
const perSet = await Promise.allSettled(sets.map((set2) => getBootedUdidsInSet(set2, signal)));
|
|
102022
102026
|
const failures = perSet.flatMap((r) => r.status === "rejected" ? [r.reason] : []);
|
|
@@ -102881,7 +102885,7 @@ function adbCommandPrefix(env) {
|
|
|
102881
102885
|
// ../tool-server/src/utils/ios-device/devicectl.ts
|
|
102882
102886
|
var import_node_child_process21 = require("node:child_process");
|
|
102883
102887
|
var import_node_util16 = require("node:util");
|
|
102884
|
-
var
|
|
102888
|
+
var fs28 = __toESM(require("node:fs/promises"));
|
|
102885
102889
|
var os6 = __toESM(require("node:os"));
|
|
102886
102890
|
var path25 = __toESM(require("node:path"));
|
|
102887
102891
|
var import_node_crypto8 = require("node:crypto");
|
|
@@ -102945,7 +102949,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
102945
102949
|
let json2 = null;
|
|
102946
102950
|
if (jsonPath) {
|
|
102947
102951
|
try {
|
|
102948
|
-
json2 = JSON.parse(await
|
|
102952
|
+
json2 = JSON.parse(await fs28.readFile(jsonPath, "utf8"));
|
|
102949
102953
|
} catch {
|
|
102950
102954
|
json2 = null;
|
|
102951
102955
|
}
|
|
@@ -102957,7 +102961,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
102957
102961
|
let errorJson = null;
|
|
102958
102962
|
if (jsonPath) {
|
|
102959
102963
|
try {
|
|
102960
|
-
errorJson = JSON.parse(await
|
|
102964
|
+
errorJson = JSON.parse(await fs28.readFile(jsonPath, "utf8"));
|
|
102961
102965
|
} catch {
|
|
102962
102966
|
errorJson = null;
|
|
102963
102967
|
}
|
|
@@ -102976,7 +102980,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
102976
102980
|
}
|
|
102977
102981
|
);
|
|
102978
102982
|
} finally {
|
|
102979
|
-
if (jsonPath) await
|
|
102983
|
+
if (jsonPath) await fs28.rm(jsonPath, { force: true }).catch(() => {
|
|
102980
102984
|
});
|
|
102981
102985
|
}
|
|
102982
102986
|
}
|
|
@@ -103217,7 +103221,7 @@ init_harmony_flag();
|
|
|
103217
103221
|
// ../tool-server/src/utils/macos-apps.ts
|
|
103218
103222
|
var import_node_child_process22 = require("node:child_process");
|
|
103219
103223
|
var import_node_crypto9 = require("node:crypto");
|
|
103220
|
-
var
|
|
103224
|
+
var fs29 = __toESM(require("node:fs"));
|
|
103221
103225
|
var os7 = __toESM(require("node:os"));
|
|
103222
103226
|
var path26 = __toESM(require("node:path"));
|
|
103223
103227
|
var import_node_util17 = require("node:util");
|
|
@@ -103269,34 +103273,34 @@ function macosAppLogPath(bundleId) {
|
|
|
103269
103273
|
var BOOTSTRAP_NAME = "libArgentInjectionBootstrap.dylib";
|
|
103270
103274
|
var LIBRARY_NAME = "libNativeDevtoolsMacos.dylib";
|
|
103271
103275
|
function stageMacosLibraries(bootstrapPath, libraryPath, teamId) {
|
|
103272
|
-
const bootstrap =
|
|
103273
|
-
const library =
|
|
103276
|
+
const bootstrap = fs29.readFileSync(bootstrapPath);
|
|
103277
|
+
const library = fs29.readFileSync(libraryPath);
|
|
103274
103278
|
const hash2 = libraryHash(bootstrap, library);
|
|
103275
103279
|
const name = teamId ? `${hash2}-${teamId}` : hash2;
|
|
103276
103280
|
const libRoot = path26.join(macosArgentDir(), "lib");
|
|
103277
103281
|
const target = path26.join(libRoot, name);
|
|
103278
103282
|
const staged = path26.join(target, BOOTSTRAP_NAME);
|
|
103279
|
-
const isComplete = () =>
|
|
103280
|
-
|
|
103281
|
-
|
|
103283
|
+
const isComplete = () => fs29.existsSync(staged) && fs29.existsSync(path26.join(target, LIBRARY_NAME));
|
|
103284
|
+
fs29.mkdirSync(libRoot, { recursive: true, mode: 448 });
|
|
103285
|
+
fs29.chmodSync(macosArgentDir(), 448);
|
|
103282
103286
|
void removeUnusedLibraries(libRoot, hash2);
|
|
103283
103287
|
const source = JSON.stringify([path26.resolve(bootstrapPath), path26.resolve(libraryPath)]);
|
|
103284
103288
|
if (isComplete()) {
|
|
103285
103289
|
recordLibrarySource(target, source);
|
|
103286
103290
|
return staged;
|
|
103287
103291
|
}
|
|
103288
|
-
if (
|
|
103289
|
-
|
|
103292
|
+
if (fs29.existsSync(target)) {
|
|
103293
|
+
fs29.renameSync(target, path26.join(libRoot, `.damaged-${name}-${process.pid}-${Date.now()}`));
|
|
103290
103294
|
}
|
|
103291
|
-
const temp =
|
|
103295
|
+
const temp = fs29.mkdtempSync(path26.join(libRoot, `.tmp-${name}-`));
|
|
103292
103296
|
try {
|
|
103293
|
-
|
|
103294
|
-
|
|
103295
|
-
|
|
103297
|
+
fs29.writeFileSync(path26.join(temp, BOOTSTRAP_NAME), bootstrap, { mode: 493 });
|
|
103298
|
+
fs29.writeFileSync(path26.join(temp, LIBRARY_NAME), library, { mode: 493 });
|
|
103299
|
+
fs29.writeFileSync(path26.join(temp, SOURCES_NAME), `${source}
|
|
103296
103300
|
`, { mode: 384 });
|
|
103297
|
-
|
|
103301
|
+
fs29.renameSync(temp, target);
|
|
103298
103302
|
} catch (err) {
|
|
103299
|
-
|
|
103303
|
+
fs29.rmSync(temp, { recursive: true, force: true });
|
|
103300
103304
|
throw err;
|
|
103301
103305
|
}
|
|
103302
103306
|
return staged;
|
|
@@ -103308,8 +103312,8 @@ function libraryHash(bootstrap, library) {
|
|
|
103308
103312
|
function recordLibrarySource(dir, source) {
|
|
103309
103313
|
const file2 = path26.join(dir, SOURCES_NAME);
|
|
103310
103314
|
try {
|
|
103311
|
-
const known =
|
|
103312
|
-
if (!known.includes(source))
|
|
103315
|
+
const known = fs29.existsSync(file2) ? fs29.readFileSync(file2, "utf8").split("\n") : [];
|
|
103316
|
+
if (!known.includes(source)) fs29.appendFileSync(file2, `${source}
|
|
103313
103317
|
`, { mode: 384 });
|
|
103314
103318
|
} catch {
|
|
103315
103319
|
}
|
|
@@ -103323,7 +103327,7 @@ function inPrivacyProtectedFolder(file2) {
|
|
|
103323
103327
|
async function librarySourceInstalled(dir, name) {
|
|
103324
103328
|
let lines;
|
|
103325
103329
|
try {
|
|
103326
|
-
lines = (await
|
|
103330
|
+
lines = (await fs29.promises.readFile(path26.join(dir, SOURCES_NAME), "utf8")).split("\n");
|
|
103327
103331
|
} catch {
|
|
103328
103332
|
return false;
|
|
103329
103333
|
}
|
|
@@ -103338,7 +103342,7 @@ async function librarySourceInstalled(dir, name) {
|
|
|
103338
103342
|
if (files.some((file2) => inPrivacyProtectedFolder(String(file2)))) return true;
|
|
103339
103343
|
try {
|
|
103340
103344
|
const [bootstrap, library] = await Promise.all(
|
|
103341
|
-
files.map((file2) =>
|
|
103345
|
+
files.map((file2) => fs29.promises.readFile(String(file2)))
|
|
103342
103346
|
);
|
|
103343
103347
|
if (name.startsWith(libraryHash(bootstrap, library))) return true;
|
|
103344
103348
|
} catch (err) {
|
|
@@ -103349,7 +103353,7 @@ async function librarySourceInstalled(dir, name) {
|
|
|
103349
103353
|
}
|
|
103350
103354
|
async function removeUnusedLibraries(libRoot, keep) {
|
|
103351
103355
|
try {
|
|
103352
|
-
const root =
|
|
103356
|
+
const root = fs29.realpathSync(libRoot);
|
|
103353
103357
|
let open5;
|
|
103354
103358
|
try {
|
|
103355
103359
|
({ stdout: open5 } = await execFileAsync16("lsof", ["-Fn", "+D", root], {
|
|
@@ -103364,11 +103368,11 @@ async function removeUnusedLibraries(libRoot, keep) {
|
|
|
103364
103368
|
const used = new Set(
|
|
103365
103369
|
open5.split("\n").filter((line) => line.startsWith(`n${root}/`)).map((line) => line.slice(root.length + 2).split("/")[0])
|
|
103366
103370
|
);
|
|
103367
|
-
for (const name of
|
|
103371
|
+
for (const name of fs29.readdirSync(root)) {
|
|
103368
103372
|
if (name.startsWith(keep) || used.has(name)) continue;
|
|
103369
103373
|
const dir = path26.join(root, name);
|
|
103370
103374
|
if (!name.startsWith(".") && await librarySourceInstalled(dir, name)) continue;
|
|
103371
|
-
|
|
103375
|
+
fs29.rmSync(dir, { recursive: true, force: true });
|
|
103372
103376
|
}
|
|
103373
103377
|
} catch {
|
|
103374
103378
|
}
|
|
@@ -103446,7 +103450,7 @@ function isTrackedMacosApp(value) {
|
|
|
103446
103450
|
function readTrackedApps() {
|
|
103447
103451
|
let raw;
|
|
103448
103452
|
try {
|
|
103449
|
-
raw = JSON.parse(
|
|
103453
|
+
raw = JSON.parse(fs29.readFileSync(trackedMacosAppsFile(), "utf8"));
|
|
103450
103454
|
} catch {
|
|
103451
103455
|
return [];
|
|
103452
103456
|
}
|
|
@@ -103455,10 +103459,10 @@ function readTrackedApps() {
|
|
|
103455
103459
|
function recordTrackedMacosApp(app) {
|
|
103456
103460
|
const file2 = trackedMacosAppsFile();
|
|
103457
103461
|
const others = readTrackedApps().filter((a) => a.bundleId !== app.bundleId);
|
|
103458
|
-
|
|
103462
|
+
fs29.mkdirSync(path26.dirname(file2), { recursive: true });
|
|
103459
103463
|
const tmp = `${file2}.${process.pid}.tmp`;
|
|
103460
|
-
|
|
103461
|
-
|
|
103464
|
+
fs29.writeFileSync(tmp, JSON.stringify([...others, app], null, 2) + "\n");
|
|
103465
|
+
fs29.renameSync(tmp, file2);
|
|
103462
103466
|
}
|
|
103463
103467
|
function getTrackedMacosApp(bundleId) {
|
|
103464
103468
|
return readTrackedApps().find((a) => a.bundleId === bundleId);
|
|
@@ -103534,7 +103538,7 @@ async function findRunningCopies(bundleId, executable, skipPid) {
|
|
|
103534
103538
|
if (!command.endsWith(suffix)) continue;
|
|
103535
103539
|
let resolved;
|
|
103536
103540
|
try {
|
|
103537
|
-
resolved =
|
|
103541
|
+
resolved = fs29.realpathSync(command);
|
|
103538
103542
|
} catch {
|
|
103539
103543
|
continue;
|
|
103540
103544
|
}
|
|
@@ -103559,7 +103563,7 @@ async function gitWorktreeOf(dir) {
|
|
|
103559
103563
|
);
|
|
103560
103564
|
const [top, common] = stdout.trim().split("\n");
|
|
103561
103565
|
if (!top || !common) return null;
|
|
103562
|
-
return { top:
|
|
103566
|
+
return { top: fs29.realpathSync(top), common: fs29.realpathSync(common) };
|
|
103563
103567
|
} catch {
|
|
103564
103568
|
return null;
|
|
103565
103569
|
}
|
|
@@ -103579,7 +103583,7 @@ var CHROMIUM_BROWSER_FRAMEWORK = /\b(chrome|chromium|edge|brave|vivaldi|opera)\b
|
|
|
103579
103583
|
function chromiumKind(appPath) {
|
|
103580
103584
|
let frameworks;
|
|
103581
103585
|
try {
|
|
103582
|
-
frameworks =
|
|
103586
|
+
frameworks = fs29.readdirSync(path26.join(appPath, "Contents", "Frameworks"));
|
|
103583
103587
|
} catch {
|
|
103584
103588
|
return void 0;
|
|
103585
103589
|
}
|
|
@@ -103596,10 +103600,10 @@ var MAX_LOAD_COMMANDS_BYTES = 1024 * 1024;
|
|
|
103596
103600
|
function isCatalystExecutable(executable) {
|
|
103597
103601
|
let fd;
|
|
103598
103602
|
try {
|
|
103599
|
-
fd =
|
|
103603
|
+
fd = fs29.openSync(executable, "r");
|
|
103600
103604
|
const read = (length, position) => {
|
|
103601
103605
|
const buffer = Buffer.alloc(length);
|
|
103602
|
-
return buffer.subarray(0,
|
|
103606
|
+
return buffer.subarray(0, fs29.readSync(fd, buffer, 0, length, position));
|
|
103603
103607
|
};
|
|
103604
103608
|
const header = read(8, 0);
|
|
103605
103609
|
if (header.length < 8) return false;
|
|
@@ -103616,7 +103620,7 @@ function isCatalystExecutable(executable) {
|
|
|
103616
103620
|
} catch {
|
|
103617
103621
|
return false;
|
|
103618
103622
|
} finally {
|
|
103619
|
-
if (fd !== void 0)
|
|
103623
|
+
if (fd !== void 0) fs29.closeSync(fd);
|
|
103620
103624
|
}
|
|
103621
103625
|
}
|
|
103622
103626
|
function isCatalystSlice(read, offset) {
|
|
@@ -103669,7 +103673,7 @@ function parseCodesignDisplay(output2) {
|
|
|
103669
103673
|
}
|
|
103670
103674
|
function isIosAppWrapper(dir) {
|
|
103671
103675
|
try {
|
|
103672
|
-
return
|
|
103676
|
+
return fs29.statSync(path26.join(dir, "Wrapper")).isDirectory() && fs29.lstatSync(path26.join(dir, "WrappedBundle")).isSymbolicLink();
|
|
103673
103677
|
} catch {
|
|
103674
103678
|
return false;
|
|
103675
103679
|
}
|
|
@@ -103710,7 +103714,7 @@ async function inspectMacosApp(appPath) {
|
|
|
103710
103714
|
const badBundle = (message) => invalid3(message, FAILURE_CODES.MACOS_APP_BUNDLE_INVALID);
|
|
103711
103715
|
let resolved;
|
|
103712
103716
|
try {
|
|
103713
|
-
resolved =
|
|
103717
|
+
resolved = fs29.realpathSync(path26.resolve(appPath));
|
|
103714
103718
|
} catch {
|
|
103715
103719
|
throw invalid3(
|
|
103716
103720
|
`No app bundle at ${appPath}.`,
|
|
@@ -103719,7 +103723,7 @@ async function inspectMacosApp(appPath) {
|
|
|
103719
103723
|
);
|
|
103720
103724
|
}
|
|
103721
103725
|
const plist = path26.join(resolved, "Contents", "Info.plist");
|
|
103722
|
-
if (!
|
|
103726
|
+
if (!fs29.statSync(resolved).isDirectory() || !fs29.existsSync(plist)) {
|
|
103723
103727
|
if (isIosAppWrapper(resolved)) {
|
|
103724
103728
|
throw invalid3(
|
|
103725
103729
|
`${appPath} is an iPad or iPhone app that runs on the Mac ("Designed for iPad"). macOS does not let argent load its library into such an app, so argent cannot drive it. Build the app's Mac Catalyst target and boot that, or test the app on an iOS simulator.`,
|
|
@@ -103749,7 +103753,7 @@ async function inspectMacosApp(appPath) {
|
|
|
103749
103753
|
throw badBundle(`${plist} has no usable CFBundleExecutable.`);
|
|
103750
103754
|
}
|
|
103751
103755
|
const executable = path26.join(resolved, "Contents", "MacOS", executableName);
|
|
103752
|
-
if (!
|
|
103756
|
+
if (!fs29.existsSync(executable)) {
|
|
103753
103757
|
throw badBundle(`The executable ${executable} named by ${plist} does not exist.`);
|
|
103754
103758
|
}
|
|
103755
103759
|
const signature = await readCodeSignature(resolved) ?? parseCodesignDisplay(null);
|
|
@@ -103815,7 +103819,7 @@ async function findMacosAppByBundleId(bundleId) {
|
|
|
103815
103819
|
if (!executable) continue;
|
|
103816
103820
|
let mtimeMs;
|
|
103817
103821
|
try {
|
|
103818
|
-
mtimeMs =
|
|
103822
|
+
mtimeMs = fs29.statSync(path26.join(contents, "MacOS", executable)).mtimeMs;
|
|
103819
103823
|
} catch {
|
|
103820
103824
|
continue;
|
|
103821
103825
|
}
|
|
@@ -103844,7 +103848,7 @@ async function issueSandboxExtension(filePath, opts = {}) {
|
|
|
103844
103848
|
}
|
|
103845
103849
|
|
|
103846
103850
|
// ../tool-server/src/utils/chromium-discovery.ts
|
|
103847
|
-
var
|
|
103851
|
+
var fs32 = __toESM(require("node:fs"));
|
|
103848
103852
|
var path29 = __toESM(require("node:path"));
|
|
103849
103853
|
init_src2();
|
|
103850
103854
|
init_device_info();
|
|
@@ -103856,7 +103860,7 @@ init_src2();
|
|
|
103856
103860
|
init_src2();
|
|
103857
103861
|
|
|
103858
103862
|
// ../tool-server/src/chromium-server/cdp-session.ts
|
|
103859
|
-
var
|
|
103863
|
+
var fs30 = __toESM(require("node:fs"));
|
|
103860
103864
|
var os9 = __toESM(require("node:os"));
|
|
103861
103865
|
var path27 = __toESM(require("node:path"));
|
|
103862
103866
|
init_src2();
|
|
@@ -104666,7 +104670,7 @@ async function primePageSession(cdp) {
|
|
|
104666
104670
|
}
|
|
104667
104671
|
function mediaDir() {
|
|
104668
104672
|
const dir = path27.join(os9.tmpdir(), "argent-chromium-media");
|
|
104669
|
-
|
|
104673
|
+
fs30.mkdirSync(dir, { recursive: true });
|
|
104670
104674
|
return dir;
|
|
104671
104675
|
}
|
|
104672
104676
|
|
|
@@ -105100,7 +105104,7 @@ var ScreencastManager = class {
|
|
|
105100
105104
|
};
|
|
105101
105105
|
|
|
105102
105106
|
// ../tool-server/src/chromium-server/screenshot.ts
|
|
105103
|
-
var
|
|
105107
|
+
var fs31 = __toESM(require("node:fs"));
|
|
105104
105108
|
var path28 = __toESM(require("node:path"));
|
|
105105
105109
|
init_src2();
|
|
105106
105110
|
var sharpCache;
|
|
@@ -105189,7 +105193,7 @@ async function captureScreenshot(ctx, opts = {}) {
|
|
|
105189
105193
|
const stem = opts.id ?? `${Date.now()}-${process.pid}`;
|
|
105190
105194
|
const safeDeviceId = ctx.deviceId.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
105191
105195
|
const filePath = path28.join(mediaDir(), `argent-screenshot-${safeDeviceId}-${stem}.png`);
|
|
105192
|
-
|
|
105196
|
+
fs31.writeFileSync(filePath, bytes);
|
|
105193
105197
|
return {
|
|
105194
105198
|
url: `file://${filePath}`,
|
|
105195
105199
|
path: filePath,
|
|
@@ -105206,7 +105210,7 @@ function readPngSize(buf) {
|
|
|
105206
105210
|
}
|
|
105207
105211
|
async function copyScreenshotToClipboard(ctx, opts = {}) {
|
|
105208
105212
|
const shot = await captureScreenshot(ctx, { rotation: opts.rotation });
|
|
105209
|
-
const bytes =
|
|
105213
|
+
const bytes = fs31.readFileSync(shot.path);
|
|
105210
105214
|
const b64 = bytes.toString("base64");
|
|
105211
105215
|
const script = `(async () => {
|
|
105212
105216
|
const b64 = "${b64}";
|
|
@@ -105875,7 +105879,7 @@ function portsFilePath() {
|
|
|
105875
105879
|
}
|
|
105876
105880
|
function loadPersistedPorts() {
|
|
105877
105881
|
try {
|
|
105878
|
-
const raw = JSON.parse(
|
|
105882
|
+
const raw = JSON.parse(fs32.readFileSync(portsFilePath(), "utf8"));
|
|
105879
105883
|
if (!Array.isArray(raw)) return [];
|
|
105880
105884
|
return raw.filter((p) => typeof p === "number" && p > 0 && p <= 65535);
|
|
105881
105885
|
} catch {
|
|
@@ -105887,8 +105891,8 @@ function persistPorts(mutate) {
|
|
|
105887
105891
|
const file2 = portsFilePath();
|
|
105888
105892
|
const merged = new Set(loadPersistedPorts());
|
|
105889
105893
|
mutate(merged);
|
|
105890
|
-
|
|
105891
|
-
|
|
105894
|
+
fs32.mkdirSync(path29.dirname(file2), { recursive: true });
|
|
105895
|
+
fs32.writeFileSync(file2, JSON.stringify(Array.from(merged)));
|
|
105892
105896
|
} catch {
|
|
105893
105897
|
}
|
|
105894
105898
|
}
|
|
@@ -106986,7 +106990,7 @@ init_src2();
|
|
|
106986
106990
|
|
|
106987
106991
|
// ../tool-server/src/blueprints/ax-service.ts
|
|
106988
106992
|
var net3 = __toESM(require("node:net"));
|
|
106989
|
-
var
|
|
106993
|
+
var fs33 = __toESM(require("node:fs"));
|
|
106990
106994
|
init_src2();
|
|
106991
106995
|
init_external_devices();
|
|
106992
106996
|
|
|
@@ -107065,7 +107069,7 @@ function startListener(endpoint, onConnection) {
|
|
|
107065
107069
|
return new Promise((resolve24, reject) => {
|
|
107066
107070
|
if (endpoint.transport === "unix") {
|
|
107067
107071
|
try {
|
|
107068
|
-
|
|
107072
|
+
fs33.unlinkSync(endpoint.socketPath);
|
|
107069
107073
|
} catch {
|
|
107070
107074
|
}
|
|
107071
107075
|
}
|
|
@@ -107382,7 +107386,7 @@ var axServiceBlueprint = {
|
|
|
107382
107386
|
server.close();
|
|
107383
107387
|
if (endpoint.transport === "unix") {
|
|
107384
107388
|
try {
|
|
107385
|
-
|
|
107389
|
+
fs33.unlinkSync(endpoint.socketPath);
|
|
107386
107390
|
} catch {
|
|
107387
107391
|
}
|
|
107388
107392
|
}
|
|
@@ -107613,7 +107617,7 @@ var axServiceBlueprint = {
|
|
|
107613
107617
|
server.close();
|
|
107614
107618
|
if (endpoint.transport === "unix") {
|
|
107615
107619
|
try {
|
|
107616
|
-
|
|
107620
|
+
fs33.unlinkSync(endpoint.socketPath);
|
|
107617
107621
|
} catch {
|
|
107618
107622
|
}
|
|
107619
107623
|
}
|
|
@@ -108587,7 +108591,7 @@ init_src2();
|
|
|
108587
108591
|
|
|
108588
108592
|
// ../native-devtools-android/src/index.ts
|
|
108589
108593
|
var path31 = __toESM(require("node:path"));
|
|
108590
|
-
var
|
|
108594
|
+
var fs34 = __toESM(require("node:fs"));
|
|
108591
108595
|
|
|
108592
108596
|
// ../native-devtools-android/src/errors.ts
|
|
108593
108597
|
function buildMessage(kind, details) {
|
|
@@ -109177,13 +109181,13 @@ var cachedManifest = null;
|
|
|
109177
109181
|
function helperManifest() {
|
|
109178
109182
|
if (cachedManifest) return cachedManifest;
|
|
109179
109183
|
const manifestPath = path31.join(__dirname, "..", "assets", "manifest.json");
|
|
109180
|
-
cachedManifest = JSON.parse(
|
|
109184
|
+
cachedManifest = JSON.parse(fs34.readFileSync(manifestPath, "utf-8"));
|
|
109181
109185
|
return cachedManifest;
|
|
109182
109186
|
}
|
|
109183
109187
|
function bundledHelperApkPath() {
|
|
109184
109188
|
const manifest = helperManifest();
|
|
109185
109189
|
const apk = path31.join(binDir(), `argent-android-devtools-${manifest.versionName}.apk`);
|
|
109186
|
-
if (!
|
|
109190
|
+
if (!fs34.existsSync(apk)) {
|
|
109187
109191
|
throw new Error(
|
|
109188
109192
|
`Bundled Android devtools helper APK not found at ${apk}. Run \`bash packages/native-devtools-android/scripts/build.sh\` to build it.`
|
|
109189
109193
|
);
|
|
@@ -114143,7 +114147,7 @@ init_device_info();
|
|
|
114143
114147
|
|
|
114144
114148
|
// ../tool-server/src/blueprints/tv-control.ts
|
|
114145
114149
|
var net5 = __toESM(require("node:net"));
|
|
114146
|
-
var
|
|
114150
|
+
var fs36 = __toESM(require("node:fs"));
|
|
114147
114151
|
var import_node_child_process26 = require("node:child_process");
|
|
114148
114152
|
init_src2();
|
|
114149
114153
|
init_capability();
|
|
@@ -114253,7 +114257,7 @@ async function waitForSocket(socketPath, proc, timeoutMs) {
|
|
|
114253
114257
|
if (exited !== void 0) {
|
|
114254
114258
|
throw new Error(`tv daemon exited with code ${exited} before its socket was ready`);
|
|
114255
114259
|
}
|
|
114256
|
-
if (
|
|
114260
|
+
if (fs36.existsSync(socketPath)) {
|
|
114257
114261
|
const ok = await new Promise((resolve24) => {
|
|
114258
114262
|
const s = net5.createConnection(socketPath);
|
|
114259
114263
|
s.on("connect", () => {
|
|
@@ -114357,7 +114361,7 @@ var tvControlBlueprint = {
|
|
|
114357
114361
|
await reapDaemons(axSock);
|
|
114358
114362
|
for (const p of [axSock, hidSock]) {
|
|
114359
114363
|
try {
|
|
114360
|
-
|
|
114364
|
+
fs36.unlinkSync(p);
|
|
114361
114365
|
} catch {
|
|
114362
114366
|
}
|
|
114363
114367
|
}
|
|
@@ -114373,7 +114377,7 @@ var tvControlBlueprint = {
|
|
|
114373
114377
|
}
|
|
114374
114378
|
axExited = false;
|
|
114375
114379
|
try {
|
|
114376
|
-
|
|
114380
|
+
fs36.unlinkSync(axSock);
|
|
114377
114381
|
} catch {
|
|
114378
114382
|
}
|
|
114379
114383
|
await reapDaemons(axSock);
|
|
@@ -114398,7 +114402,7 @@ var tvControlBlueprint = {
|
|
|
114398
114402
|
axProc.kill("SIGKILL");
|
|
114399
114403
|
}
|
|
114400
114404
|
try {
|
|
114401
|
-
|
|
114405
|
+
fs36.unlinkSync(axSock);
|
|
114402
114406
|
} catch {
|
|
114403
114407
|
}
|
|
114404
114408
|
}
|
|
@@ -114480,7 +114484,7 @@ var tvControlBlueprint = {
|
|
|
114480
114484
|
await reapDaemons(axSock);
|
|
114481
114485
|
for (const p of [axSock, hidSock]) {
|
|
114482
114486
|
try {
|
|
114483
|
-
|
|
114487
|
+
fs36.unlinkSync(p);
|
|
114484
114488
|
} catch {
|
|
114485
114489
|
}
|
|
114486
114490
|
}
|
|
@@ -115003,7 +115007,7 @@ function reserveLaunchMeasurement(udid) {
|
|
|
115003
115007
|
var import_node_child_process28 = require("node:child_process");
|
|
115004
115008
|
var import_node_util20 = require("node:util");
|
|
115005
115009
|
var import_node_crypto10 = require("node:crypto");
|
|
115006
|
-
var
|
|
115010
|
+
var fs38 = __toESM(require("node:fs"));
|
|
115007
115011
|
var fsp = __toESM(require("node:fs/promises"));
|
|
115008
115012
|
var path34 = __toESM(require("node:path"));
|
|
115009
115013
|
init_src2();
|
|
@@ -115135,7 +115139,7 @@ function resolveRunnerProjectPath() {
|
|
|
115135
115139
|
return override;
|
|
115136
115140
|
}
|
|
115137
115141
|
const candidate = path34.resolve(__dirname, PROJECT_SUFFIX);
|
|
115138
|
-
if (
|
|
115142
|
+
if (fs38.existsSync(candidate)) {
|
|
115139
115143
|
return candidate;
|
|
115140
115144
|
}
|
|
115141
115145
|
throw withFailureSignal(
|
|
@@ -115212,10 +115216,10 @@ function runnerProductsDir(derivedDataPath) {
|
|
|
115212
115216
|
}
|
|
115213
115217
|
function findBaseXctestrun(derivedDataPath) {
|
|
115214
115218
|
const productsDir = runnerProductsDir(derivedDataPath);
|
|
115215
|
-
if (!
|
|
115219
|
+
if (!fs38.existsSync(productsDir)) {
|
|
115216
115220
|
return null;
|
|
115217
115221
|
}
|
|
115218
|
-
const candidates =
|
|
115222
|
+
const candidates = fs38.readdirSync(productsDir).filter((name) => {
|
|
115219
115223
|
return name.endsWith(".xctestrun") && name.includes("iphoneos");
|
|
115220
115224
|
});
|
|
115221
115225
|
if (candidates.length === 0) {
|
|
@@ -115397,7 +115401,7 @@ ${xcodebuildFailureSummary(output2)}`,
|
|
|
115397
115401
|
// ../tool-server/src/utils/ios-device/runner-launch.ts
|
|
115398
115402
|
var import_node_child_process29 = require("node:child_process");
|
|
115399
115403
|
var import_node_events2 = require("node:events");
|
|
115400
|
-
var
|
|
115404
|
+
var fs39 = __toESM(require("node:fs"));
|
|
115401
115405
|
var fsp2 = __toESM(require("node:fs/promises"));
|
|
115402
115406
|
var path35 = __toESM(require("node:path"));
|
|
115403
115407
|
var import_node_util21 = require("node:util");
|
|
@@ -115445,7 +115449,7 @@ async function launchRunner(opts) {
|
|
|
115445
115449
|
const resultBundlePath = path35.join(resultsDir, `argent-${deviceTag}.xcresult`);
|
|
115446
115450
|
await fsp2.rm(resultBundlePath, { recursive: true, force: true });
|
|
115447
115451
|
await disableRunnerAttachments(opts.xctestrunPath);
|
|
115448
|
-
const logFd =
|
|
115452
|
+
const logFd = fs39.openSync(logPath, "w");
|
|
115449
115453
|
const child = (0, import_node_child_process29.spawn)(
|
|
115450
115454
|
"xcodebuild",
|
|
115451
115455
|
[
|
|
@@ -115482,7 +115486,7 @@ async function launchRunner(opts) {
|
|
|
115482
115486
|
}
|
|
115483
115487
|
);
|
|
115484
115488
|
child.unref();
|
|
115485
|
-
|
|
115489
|
+
fs39.closeSync(logFd);
|
|
115486
115490
|
try {
|
|
115487
115491
|
await (0, import_node_events2.once)(child, "spawn");
|
|
115488
115492
|
} catch (error63) {
|
|
@@ -115583,7 +115587,7 @@ async function killStaleRunnersForDevice(udid, listProcesses = listProcessTable)
|
|
|
115583
115587
|
}
|
|
115584
115588
|
|
|
115585
115589
|
// ../tool-server/src/blueprints/ios-device-runner.ts
|
|
115586
|
-
var
|
|
115590
|
+
var fs41 = __toESM(require("node:fs/promises"));
|
|
115587
115591
|
|
|
115588
115592
|
// ../tool-server/src/utils/ios-device/runner-route.ts
|
|
115589
115593
|
var import_node_net3 = __toESM(require("node:net"));
|
|
@@ -115971,7 +115975,7 @@ function defaultSendViaUsbmux(udid, port, body, deadline) {
|
|
|
115971
115975
|
// ../tool-server/src/utils/ios-device/runner-crash.ts
|
|
115972
115976
|
var import_node_child_process31 = require("node:child_process");
|
|
115973
115977
|
var import_node_util23 = require("node:util");
|
|
115974
|
-
var
|
|
115978
|
+
var fs40 = __toESM(require("node:fs/promises"));
|
|
115975
115979
|
var execFileAsync22 = (0, import_node_util23.promisify)(import_node_child_process31.execFile);
|
|
115976
115980
|
var XCRESULTTOOL_TIMEOUT_MS = 15e3;
|
|
115977
115981
|
var XCRESULTTOOL_MAX_JSON_BYTES = 32 * 1024 * 1024;
|
|
@@ -115991,7 +115995,7 @@ function extractCrashFailureText(summary) {
|
|
|
115991
115995
|
}
|
|
115992
115996
|
async function readRunnerCrashSummary(resultBundlePath) {
|
|
115993
115997
|
try {
|
|
115994
|
-
await
|
|
115998
|
+
await fs40.access(resultBundlePath);
|
|
115995
115999
|
const { stdout } = await execFileAsync22(
|
|
115996
116000
|
"xcrun",
|
|
115997
116001
|
["xcresulttool", "get", "test-results", "summary", "--path", resultBundlePath],
|
|
@@ -116364,7 +116368,7 @@ async function startRunner(udid, artifact, tunnelAddress) {
|
|
|
116364
116368
|
launched.child.once("exit", reserveInteractionRunner(udid));
|
|
116365
116369
|
}
|
|
116366
116370
|
killRunnerProcess(launched.child);
|
|
116367
|
-
const logText = await
|
|
116371
|
+
const logText = await fs41.readFile(launched.logPath, "utf8").catch(() => "");
|
|
116368
116372
|
throw Object.assign(
|
|
116369
116373
|
withFailureSignal(
|
|
116370
116374
|
new Error(
|
|
@@ -121907,7 +121911,7 @@ init_src2();
|
|
|
121907
121911
|
var import_node_child_process32 = require("node:child_process");
|
|
121908
121912
|
var import_node_crypto12 = require("node:crypto");
|
|
121909
121913
|
var import_node_events5 = require("node:events");
|
|
121910
|
-
var
|
|
121914
|
+
var fs42 = __toESM(require("node:fs"));
|
|
121911
121915
|
var net8 = __toESM(require("node:net"));
|
|
121912
121916
|
var os11 = __toESM(require("node:os"));
|
|
121913
121917
|
var path37 = __toESM(require("node:path"));
|
|
@@ -122148,7 +122152,7 @@ async function stopProcesses(pids, executable, group) {
|
|
|
122148
122152
|
}
|
|
122149
122153
|
function readLogTail(logPath) {
|
|
122150
122154
|
try {
|
|
122151
|
-
const lines =
|
|
122155
|
+
const lines = fs42.readFileSync(logPath, "utf8").trimEnd().split("\n");
|
|
122152
122156
|
const tail = lines.slice(-20).join("\n").trim();
|
|
122153
122157
|
return tail ? `
|
|
122154
122158
|
Last lines of ${logPath}:
|
|
@@ -122853,7 +122857,7 @@ function createMacosAppApi(bundleId) {
|
|
|
122853
122857
|
"not_found"
|
|
122854
122858
|
);
|
|
122855
122859
|
}
|
|
122856
|
-
if (!opts.appPath && tracked && !
|
|
122860
|
+
if (!opts.appPath && tracked && !fs42.existsSync(appPath)) {
|
|
122857
122861
|
throw macosFailure(
|
|
122858
122862
|
`argent last started ${bundleId} from ${appPath}, which no longer exists. Pass the .app path to boot-device as macosAppPath.`,
|
|
122859
122863
|
FAILURE_CODES.MACOS_APP_PATH_INVALID,
|
|
@@ -122931,9 +122935,9 @@ function createMacosAppApi(bundleId) {
|
|
|
122931
122935
|
}
|
|
122932
122936
|
const listen3 = macosListenSocket(bundleId, info.sandboxed);
|
|
122933
122937
|
const logPath = macosAppLogPath(bundleId);
|
|
122934
|
-
|
|
122935
|
-
if (listen3 && !info.sandboxed)
|
|
122936
|
-
|
|
122938
|
+
fs42.mkdirSync(path37.dirname(logPath), { recursive: true, mode: 448 });
|
|
122939
|
+
if (listen3 && !info.sandboxed) fs42.rmSync(listen3.path, { force: true });
|
|
122940
|
+
fs42.writeFileSync(logPath, "");
|
|
122937
122941
|
const args = opts.args ?? (opts.noLastArgs ? void 0 : tracked?.args) ?? [];
|
|
122938
122942
|
const helper = (0, import_node_child_process32.spawn)(
|
|
122939
122943
|
artifacts.helper,
|
|
@@ -124521,7 +124525,7 @@ var SourceMapsRegistry = class {
|
|
|
124521
124525
|
};
|
|
124522
124526
|
|
|
124523
124527
|
// ../tool-server/src/utils/debugger/log-file-writer.ts
|
|
124524
|
-
var
|
|
124528
|
+
var fs43 = __toESM(require("node:fs"));
|
|
124525
124529
|
var path38 = __toESM(require("node:path"));
|
|
124526
124530
|
init_src();
|
|
124527
124531
|
var MAX_ENTRIES = 5e4;
|
|
@@ -124550,7 +124554,7 @@ var LogFileWriter = class {
|
|
|
124550
124554
|
const timestamp = lastTimestamp = Math.max(Date.now(), lastTimestamp + 1);
|
|
124551
124555
|
const dir = path38.join(argentHomeDir(), "tmp");
|
|
124552
124556
|
try {
|
|
124553
|
-
|
|
124557
|
+
fs43.mkdirSync(dir, { recursive: true });
|
|
124554
124558
|
} catch {
|
|
124555
124559
|
}
|
|
124556
124560
|
pruneStaleLogs(dir);
|
|
@@ -124560,7 +124564,7 @@ var LogFileWriter = class {
|
|
|
124560
124564
|
}
|
|
124561
124565
|
open() {
|
|
124562
124566
|
try {
|
|
124563
|
-
this.fd =
|
|
124567
|
+
this.fd = fs43.openSync(this.filePath, "w");
|
|
124564
124568
|
this.ready = true;
|
|
124565
124569
|
} catch {
|
|
124566
124570
|
}
|
|
@@ -124586,7 +124590,7 @@ var LogFileWriter = class {
|
|
|
124586
124590
|
try {
|
|
124587
124591
|
const bytes = Buffer.from(this.midLine ? `
|
|
124588
124592
|
${line}` : line);
|
|
124589
|
-
const written =
|
|
124593
|
+
const written = fs43.writeSync(this.fd, bytes, 0, bytes.length, this.bytesWritten);
|
|
124590
124594
|
if (written === bytes.length) {
|
|
124591
124595
|
this.bytesWritten += written;
|
|
124592
124596
|
this.midLine = false;
|
|
@@ -124638,7 +124642,7 @@ ${line}` : line);
|
|
|
124638
124642
|
/** A torn line past " | " would parse as a whole entry with its message cut. */
|
|
124639
124643
|
dropTornLine(fd, bytes, written) {
|
|
124640
124644
|
try {
|
|
124641
|
-
|
|
124645
|
+
fs43.ftruncateSync(fd, this.bytesWritten);
|
|
124642
124646
|
} catch {
|
|
124643
124647
|
this.bytesWritten += written;
|
|
124644
124648
|
if (written > 0) this.midLine = bytes[written - 1] !== 10;
|
|
@@ -124652,7 +124656,7 @@ ${line}` : line);
|
|
|
124652
124656
|
return this.fileEntryCount;
|
|
124653
124657
|
}
|
|
124654
124658
|
hasFile() {
|
|
124655
|
-
return
|
|
124659
|
+
return fs43.existsSync(this.filePath);
|
|
124656
124660
|
}
|
|
124657
124661
|
getStats() {
|
|
124658
124662
|
return {
|
|
@@ -124677,7 +124681,7 @@ ${line}` : line);
|
|
|
124677
124681
|
readAll() {
|
|
124678
124682
|
if (this.closed || !this.ready) return [];
|
|
124679
124683
|
try {
|
|
124680
|
-
const content =
|
|
124684
|
+
const content = fs43.readFileSync(this.filePath, "utf-8");
|
|
124681
124685
|
return content.split("\n").filter((line) => line.length > 0).map(parseFlatLine).filter((entry) => entry !== null);
|
|
124682
124686
|
} catch {
|
|
124683
124687
|
return [];
|
|
@@ -124699,7 +124703,7 @@ ${line}` : line);
|
|
|
124699
124703
|
liveLogFiles.delete(this.filePath);
|
|
124700
124704
|
if (this.fd !== null) {
|
|
124701
124705
|
try {
|
|
124702
|
-
|
|
124706
|
+
fs43.closeSync(this.fd);
|
|
124703
124707
|
} catch {
|
|
124704
124708
|
}
|
|
124705
124709
|
this.fd = null;
|
|
@@ -124707,13 +124711,13 @@ ${line}` : line);
|
|
|
124707
124711
|
if (keepFile) {
|
|
124708
124712
|
try {
|
|
124709
124713
|
const now = /* @__PURE__ */ new Date();
|
|
124710
|
-
|
|
124714
|
+
fs43.utimesSync(this.filePath, now, now);
|
|
124711
124715
|
} catch {
|
|
124712
124716
|
}
|
|
124713
124717
|
return;
|
|
124714
124718
|
}
|
|
124715
124719
|
try {
|
|
124716
|
-
|
|
124720
|
+
fs43.unlinkSync(this.filePath);
|
|
124717
124721
|
} catch {
|
|
124718
124722
|
}
|
|
124719
124723
|
}
|
|
@@ -124722,7 +124726,7 @@ function pruneStaleLogs(dir) {
|
|
|
124722
124726
|
const cutoff = Date.now() - STALE_LOG_MS;
|
|
124723
124727
|
let names;
|
|
124724
124728
|
try {
|
|
124725
|
-
names =
|
|
124729
|
+
names = fs43.readdirSync(dir);
|
|
124726
124730
|
} catch {
|
|
124727
124731
|
return;
|
|
124728
124732
|
}
|
|
@@ -124732,7 +124736,7 @@ function pruneStaleLogs(dir) {
|
|
|
124732
124736
|
const file2 = path38.join(dir, name);
|
|
124733
124737
|
if (pid === process.pid ? liveLogFiles.has(file2) : isAlive(pid)) continue;
|
|
124734
124738
|
try {
|
|
124735
|
-
if (
|
|
124739
|
+
if (fs43.statSync(file2).mtimeMs < cutoff) fs43.unlinkSync(file2);
|
|
124736
124740
|
} catch {
|
|
124737
124741
|
}
|
|
124738
124742
|
}
|
|
@@ -125259,14 +125263,14 @@ function directCallFailure(tool, result) {
|
|
|
125259
125263
|
|
|
125260
125264
|
// ../tool-server/src/utils/argent-home-id.ts
|
|
125261
125265
|
var import_node_crypto13 = require("node:crypto");
|
|
125262
|
-
var
|
|
125266
|
+
var fs44 = __toESM(require("node:fs"));
|
|
125263
125267
|
var path39 = __toESM(require("node:path"));
|
|
125264
125268
|
init_src();
|
|
125265
125269
|
var ARGENT_HOME_HEADER = "x-argent-home";
|
|
125266
125270
|
function canonicalDir(dir) {
|
|
125267
125271
|
const resolved = path39.resolve(dir);
|
|
125268
125272
|
const parent = path39.dirname(resolved);
|
|
125269
|
-
if (
|
|
125273
|
+
if (fs44.existsSync(resolved) || parent === resolved) return canonicalPath(resolved);
|
|
125270
125274
|
return path39.join(canonicalDir(parent), path39.basename(resolved));
|
|
125271
125275
|
}
|
|
125272
125276
|
function argentHomeId(dir = argentHomeDir()) {
|
|
@@ -126279,7 +126283,7 @@ init_src();
|
|
|
126279
126283
|
|
|
126280
126284
|
// ../tool-server/src/blueprints/android-network-inspector.ts
|
|
126281
126285
|
var import_node_crypto15 = require("node:crypto");
|
|
126282
|
-
var
|
|
126286
|
+
var fs45 = __toESM(require("node:fs"));
|
|
126283
126287
|
var net9 = __toESM(require("node:net"));
|
|
126284
126288
|
var path40 = __toESM(require("node:path"));
|
|
126285
126289
|
init_src2();
|
|
@@ -128053,11 +128057,11 @@ function parseCapture(value) {
|
|
|
128053
128057
|
function agentFiles() {
|
|
128054
128058
|
const dir = path40.join(binDir(), "network-inspector");
|
|
128055
128059
|
const jar = path40.join(dir, JAR_NAME);
|
|
128056
|
-
if (!
|
|
128060
|
+
if (!fs45.existsSync(jar)) return null;
|
|
128057
128061
|
const lib = {};
|
|
128058
128062
|
for (const abi of AGENT_ABIS) {
|
|
128059
128063
|
const file2 = path40.join(dir, abi, AGENT_LIB_NAME);
|
|
128060
|
-
if (
|
|
128064
|
+
if (fs45.existsSync(file2)) lib[abi] = file2;
|
|
128061
128065
|
}
|
|
128062
128066
|
return Object.keys(lib).length > 0 ? { jar, lib } : null;
|
|
128063
128067
|
}
|
|
@@ -130298,7 +130302,7 @@ async function runtimeRunsOn(cdp, deviceId) {
|
|
|
130298
130302
|
}
|
|
130299
130303
|
|
|
130300
130304
|
// ../tool-server/src/utils/debugger/source-resolver.ts
|
|
130301
|
-
var
|
|
130305
|
+
var fs46 = __toESM(require("node:fs/promises"));
|
|
130302
130306
|
var path41 = __toESM(require("node:path"));
|
|
130303
130307
|
|
|
130304
130308
|
// ../../node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js
|
|
@@ -130469,11 +130473,11 @@ function createSourceResolver(port, projectRoot) {
|
|
|
130469
130473
|
if (!projectRoot) return null;
|
|
130470
130474
|
try {
|
|
130471
130475
|
const absPath = path41.isAbsolute(location.file) ? path41.resolve(location.file) : path41.resolve(projectRoot, location.file);
|
|
130472
|
-
const realRoot = await
|
|
130473
|
-
const realPath = await
|
|
130476
|
+
const realRoot = await fs46.realpath(projectRoot);
|
|
130477
|
+
const realPath = await fs46.realpath(absPath);
|
|
130474
130478
|
if (!isInsideProject(realPath, realRoot)) return null;
|
|
130475
130479
|
if (!hasAllowedExtension(realPath)) return null;
|
|
130476
|
-
const content = await
|
|
130480
|
+
const content = await fs46.readFile(realPath, "utf-8");
|
|
130477
130481
|
const lines = content.split("\n");
|
|
130478
130482
|
const start2 = Math.max(0, location.line - 1 - contextLines);
|
|
130479
130483
|
const end = Math.min(lines.length, location.line + contextLines);
|
|
@@ -133419,7 +133423,7 @@ async function readParentPids() {
|
|
|
133419
133423
|
}
|
|
133420
133424
|
|
|
133421
133425
|
// ../tool-server/src/utils/linux-preflight.ts
|
|
133422
|
-
var
|
|
133426
|
+
var fs48 = __toESM(require("node:fs"));
|
|
133423
133427
|
var import_node_os11 = require("node:os");
|
|
133424
133428
|
var import_node_path18 = require("node:path");
|
|
133425
133429
|
var import_ini2 = __toESM(require_ini());
|
|
@@ -133436,7 +133440,7 @@ function linuxBootDiagnostics(avdName) {
|
|
|
133436
133440
|
}
|
|
133437
133441
|
function checkKvm() {
|
|
133438
133442
|
try {
|
|
133439
|
-
|
|
133443
|
+
fs48.accessSync("/dev/kvm", fs48.constants.R_OK | fs48.constants.W_OK);
|
|
133440
133444
|
return null;
|
|
133441
133445
|
} catch (err) {
|
|
133442
133446
|
const code = err.code;
|
|
@@ -133452,7 +133456,7 @@ function checkAvdSizing(avdName) {
|
|
|
133452
133456
|
const configPath = (0, import_node_path18.join)((0, import_node_os11.homedir)(), ".android", "avd", `${avdName}.avd`, "config.ini");
|
|
133453
133457
|
let content;
|
|
133454
133458
|
try {
|
|
133455
|
-
content =
|
|
133459
|
+
content = fs48.readFileSync(configPath, "utf8");
|
|
133456
133460
|
} catch {
|
|
133457
133461
|
return null;
|
|
133458
133462
|
}
|
|
@@ -133599,7 +133603,7 @@ init_harmony_flag();
|
|
|
133599
133603
|
|
|
133600
133604
|
// ../tool-server/src/tools/devices/boot-electron.ts
|
|
133601
133605
|
var import_node_child_process36 = require("node:child_process");
|
|
133602
|
-
var
|
|
133606
|
+
var fs50 = __toESM(require("node:fs"));
|
|
133603
133607
|
var path44 = __toESM(require("node:path"));
|
|
133604
133608
|
init_src2();
|
|
133605
133609
|
init_device_info();
|
|
@@ -133642,7 +133646,7 @@ var DEFAULT_READY_TIMEOUT_MS = 3e4;
|
|
|
133642
133646
|
var BOOT_CONFIRM_WINDOW_MS = 300;
|
|
133643
133647
|
function resolveLauncher(appPath) {
|
|
133644
133648
|
const abs = path44.resolve(appPath);
|
|
133645
|
-
if (!
|
|
133649
|
+
if (!fs50.existsSync(abs)) {
|
|
133646
133650
|
throw new FailureError(`Electron boot: path does not exist: ${abs}`, {
|
|
133647
133651
|
error_code: FAILURE_CODES.CHROMIUM_ELECTRON_APP_PATH_INVALID,
|
|
133648
133652
|
failure_stage: "electron_app_path_missing",
|
|
@@ -133650,11 +133654,11 @@ function resolveLauncher(appPath) {
|
|
|
133650
133654
|
error_kind: "validation"
|
|
133651
133655
|
});
|
|
133652
133656
|
}
|
|
133653
|
-
const stat12 =
|
|
133657
|
+
const stat12 = fs50.statSync(abs);
|
|
133654
133658
|
if (stat12.isDirectory()) {
|
|
133655
133659
|
if (abs.endsWith(".app")) {
|
|
133656
133660
|
const macOsDir = path44.join(abs, "Contents", "MacOS");
|
|
133657
|
-
if (!
|
|
133661
|
+
if (!fs50.existsSync(macOsDir)) {
|
|
133658
133662
|
throw new FailureError(
|
|
133659
133663
|
`Electron boot: ${abs} is a .app bundle but has no Contents/MacOS. Pass the inner binary directly, or use the project directory of an unpackaged app.`,
|
|
133660
133664
|
{
|
|
@@ -133665,7 +133669,7 @@ function resolveLauncher(appPath) {
|
|
|
133665
133669
|
}
|
|
133666
133670
|
);
|
|
133667
133671
|
}
|
|
133668
|
-
const entries =
|
|
133672
|
+
const entries = fs50.readdirSync(macOsDir).filter((name) => !name.startsWith("."));
|
|
133669
133673
|
if (entries.length === 0) {
|
|
133670
133674
|
throw new FailureError(`Electron boot: ${macOsDir} is empty.`, {
|
|
133671
133675
|
error_code: FAILURE_CODES.CHROMIUM_ELECTRON_APP_PATH_INVALID,
|
|
@@ -133679,7 +133683,7 @@ function resolveLauncher(appPath) {
|
|
|
133679
133683
|
return { command: path44.join(macOsDir, exec), args: [] };
|
|
133680
133684
|
}
|
|
133681
133685
|
const localBin = path44.join(abs, "node_modules", ".bin", "electron");
|
|
133682
|
-
if (
|
|
133686
|
+
if (fs50.existsSync(localBin)) {
|
|
133683
133687
|
return { command: localBin, args: [abs] };
|
|
133684
133688
|
}
|
|
133685
133689
|
return { command: "electron", args: [abs] };
|
|
@@ -138078,7 +138082,7 @@ async function captureHarmonyScreenshotPng(opts) {
|
|
|
138078
138082
|
|
|
138079
138083
|
// ../tool-server/src/tools/screenshot/index.ts
|
|
138080
138084
|
init_capability();
|
|
138081
|
-
var
|
|
138085
|
+
var fs52 = __toESM(require("node:fs/promises"));
|
|
138082
138086
|
var execFileAsync35 = (0, import_node_util36.promisify)(import_node_child_process46.execFile);
|
|
138083
138087
|
var capability9 = {
|
|
138084
138088
|
apple: { simulator: true, device: true },
|
|
@@ -138096,7 +138100,7 @@ async function iosPhysicalScreenshot(registry2, device, scale) {
|
|
|
138096
138100
|
);
|
|
138097
138101
|
const ref = iosDeviceRunnerRef(device);
|
|
138098
138102
|
const runner = await registry2.resolveService(ref.urn, ref.options);
|
|
138099
|
-
await
|
|
138103
|
+
await fs52.writeFile(file2, await captureRunnerScreenshotPng(runner, RUNNER_COMMAND_TIMEOUT_MS));
|
|
138100
138104
|
await downscalePngInPlace(file2, scale);
|
|
138101
138105
|
return file2;
|
|
138102
138106
|
}
|
|
@@ -138136,7 +138140,7 @@ async function tvScreenshot(udid, scale, signal) {
|
|
|
138136
138140
|
} catch {
|
|
138137
138141
|
await capture(file2);
|
|
138138
138142
|
} finally {
|
|
138139
|
-
await
|
|
138143
|
+
await fs52.rm(jpeg, { force: true });
|
|
138140
138144
|
}
|
|
138141
138145
|
return file2;
|
|
138142
138146
|
}
|
|
@@ -138245,7 +138249,7 @@ Use when you need a baseline image or the screen state after a delay (interactio
|
|
|
138245
138249
|
`argent-macos-screenshot-${process.hrtime.bigint()}.png`
|
|
138246
138250
|
);
|
|
138247
138251
|
const png = await macosScreenshotPng(app, { scale: params.scale });
|
|
138248
|
-
await
|
|
138252
|
+
await fs52.writeFile(file2, params.scale === void 0 ? fitMacosDefaultSize(png) : png);
|
|
138249
138253
|
return registerHostCapture(ctx, params, file2, "Mac app");
|
|
138250
138254
|
}
|
|
138251
138255
|
if (isIosPhysicalDevice(device)) {
|
|
@@ -156895,7 +156899,7 @@ init_src2();
|
|
|
156895
156899
|
var import_node_child_process49 = require("node:child_process");
|
|
156896
156900
|
var import_node_util39 = require("node:util");
|
|
156897
156901
|
var import_promises20 = require("node:timers/promises");
|
|
156898
|
-
var
|
|
156902
|
+
var fs66 = __toESM(require("node:fs"));
|
|
156899
156903
|
var fsp4 = __toESM(require("node:fs/promises"));
|
|
156900
156904
|
var path54 = __toESM(require("node:path"));
|
|
156901
156905
|
init_src();
|
|
@@ -157001,7 +157005,7 @@ async function runLogged(command, args, options) {
|
|
|
157001
157005
|
options.signal?.throwIfAborted();
|
|
157002
157006
|
await fsp4.mkdir(path54.dirname(options.logPath), { recursive: true });
|
|
157003
157007
|
options.signal?.throwIfAborted();
|
|
157004
|
-
const log =
|
|
157008
|
+
const log = fs66.createWriteStream(options.logPath);
|
|
157005
157009
|
const child = (0, import_node_child_process49.spawn)(command, args, {
|
|
157006
157010
|
cwd: options.cwd,
|
|
157007
157011
|
env: options.env ?? process.env,
|
|
@@ -158184,7 +158188,7 @@ init_zod();
|
|
|
158184
158188
|
|
|
158185
158189
|
// ../tool-server/src/utils/ios-audio.ts
|
|
158186
158190
|
var import_node_child_process52 = require("node:child_process");
|
|
158187
|
-
var
|
|
158191
|
+
var fs67 = __toESM(require("node:fs"));
|
|
158188
158192
|
var path57 = __toESM(require("node:path"));
|
|
158189
158193
|
var import_node_crypto22 = require("node:crypto");
|
|
158190
158194
|
var import_node_util42 = require("node:util");
|
|
@@ -158205,12 +158209,12 @@ function createAudioSession(udid) {
|
|
|
158205
158209
|
}
|
|
158206
158210
|
function writeAtomic(file2, text) {
|
|
158207
158211
|
const tmp = path57.join(path57.dirname(file2), `.${path57.basename(file2)}.${process.pid}.tmp`);
|
|
158208
|
-
|
|
158209
|
-
|
|
158212
|
+
fs67.writeFileSync(tmp, text);
|
|
158213
|
+
fs67.renameSync(tmp, file2);
|
|
158210
158214
|
}
|
|
158211
158215
|
async function ensureAudioEnv(session) {
|
|
158212
158216
|
const { dir } = session;
|
|
158213
|
-
|
|
158217
|
+
fs67.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
158214
158218
|
if (session.envVerified) return;
|
|
158215
158219
|
const dylib = requireAudioDylib();
|
|
158216
158220
|
const { nativeId, prefix } = await simctlTargetForUdid(session.udid, {
|
|
@@ -158300,7 +158304,7 @@ function parseAppStatus(text) {
|
|
|
158300
158304
|
function readAppStatus(session, bundleId) {
|
|
158301
158305
|
let text;
|
|
158302
158306
|
try {
|
|
158303
|
-
text =
|
|
158307
|
+
text = fs67.readFileSync(path57.join(session.dir, `st.${bundleId}`), "utf8");
|
|
158304
158308
|
} catch {
|
|
158305
158309
|
return null;
|
|
158306
158310
|
}
|
|
@@ -158316,7 +158320,7 @@ function decideHookState(status, pidAlive, runningPid) {
|
|
|
158316
158320
|
async function readAppHook(session, bundleId) {
|
|
158317
158321
|
let text;
|
|
158318
158322
|
try {
|
|
158319
|
-
text =
|
|
158323
|
+
text = fs67.readFileSync(path57.join(session.dir, `st.${bundleId}`), "utf8");
|
|
158320
158324
|
} catch {
|
|
158321
158325
|
return { state: "none", status: null };
|
|
158322
158326
|
}
|
|
@@ -158330,14 +158334,14 @@ async function readAppHook(session, bundleId) {
|
|
|
158330
158334
|
function listLiveApps(session) {
|
|
158331
158335
|
let names;
|
|
158332
158336
|
try {
|
|
158333
|
-
names =
|
|
158337
|
+
names = fs67.readdirSync(session.dir);
|
|
158334
158338
|
} catch {
|
|
158335
158339
|
return [];
|
|
158336
158340
|
}
|
|
158337
158341
|
return names.filter((name) => name.startsWith("st.") && !name.endsWith(".tmp")).map((name) => name.slice(3)).filter((bundleId) => readAppStatus(session, bundleId) !== null);
|
|
158338
158342
|
}
|
|
158339
158343
|
async function convertClip(inputPath, outputPath2) {
|
|
158340
|
-
if (!
|
|
158344
|
+
if (!fs67.existsSync(inputPath)) {
|
|
158341
158345
|
throw new InvalidToolInputError(`Audio file not found: ${inputPath}`);
|
|
158342
158346
|
}
|
|
158343
158347
|
try {
|
|
@@ -158360,13 +158364,13 @@ async function convertClip(inputPath, outputPath2) {
|
|
|
158360
158364
|
}
|
|
158361
158365
|
}
|
|
158362
158366
|
function removeFiles(dir, prefix, keep) {
|
|
158363
|
-
for (const name of
|
|
158364
|
-
if (name.startsWith(prefix) && name !== keep)
|
|
158367
|
+
for (const name of fs67.readdirSync(dir)) {
|
|
158368
|
+
if (name.startsWith(prefix) && name !== keep) fs67.rmSync(path57.join(dir, name), { force: true });
|
|
158365
158369
|
}
|
|
158366
158370
|
}
|
|
158367
158371
|
async function setAudioInput(session, source) {
|
|
158368
158372
|
const { dir } = session;
|
|
158369
|
-
|
|
158373
|
+
fs67.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
158370
158374
|
let feederSource;
|
|
158371
158375
|
let clipName;
|
|
158372
158376
|
let durationMs;
|
|
@@ -158376,7 +158380,7 @@ async function setAudioInput(session, source) {
|
|
|
158376
158380
|
clipName = `clip-${process.pid}-${Date.now()}.wav`;
|
|
158377
158381
|
const clipPath = path57.join(dir, clipName);
|
|
158378
158382
|
await convertClip(source.path, clipPath);
|
|
158379
|
-
const fd =
|
|
158383
|
+
const fd = fs67.openSync(clipPath, "r");
|
|
158380
158384
|
try {
|
|
158381
158385
|
const info = readClipInfo(fd);
|
|
158382
158386
|
if (info.frames > MAX_CLIP_SECONDS * STREAM_RATE) {
|
|
@@ -158387,13 +158391,13 @@ async function setAudioInput(session, source) {
|
|
|
158387
158391
|
feederSource = { kind: "clip", fd, info, plays: source.plays };
|
|
158388
158392
|
durationMs = Math.round(info.frames * 1e3 / STREAM_RATE);
|
|
158389
158393
|
} catch (err) {
|
|
158390
|
-
|
|
158391
|
-
|
|
158394
|
+
fs67.closeSync(fd);
|
|
158395
|
+
fs67.rmSync(clipPath, { force: true });
|
|
158392
158396
|
throw err;
|
|
158393
158397
|
}
|
|
158394
158398
|
}
|
|
158395
158399
|
let feeder = session.feeder;
|
|
158396
|
-
if (feeder?.running && !
|
|
158400
|
+
if (feeder?.running && !fs67.existsSync(feeder.ringPath)) {
|
|
158397
158401
|
feeder.stop();
|
|
158398
158402
|
feeder = null;
|
|
158399
158403
|
}
|
|
@@ -158412,7 +158416,7 @@ async function setAudioInput(session, source) {
|
|
|
158412
158416
|
const control = `source=stream
|
|
158413
158417
|
ring=${feeder.ringPath}
|
|
158414
158418
|
${OWNER_LINE}`;
|
|
158415
|
-
if (!
|
|
158419
|
+
if (!fs67.existsSync(inputFile) || fs67.readFileSync(inputFile, "utf8") !== control) {
|
|
158416
158420
|
writeAtomic(inputFile, control);
|
|
158417
158421
|
}
|
|
158418
158422
|
removeFiles(dir, `clip-${process.pid}-`, clipName);
|
|
@@ -158422,15 +158426,15 @@ function clearAudioInput(session, ownedOnly = false) {
|
|
|
158422
158426
|
const { dir } = session;
|
|
158423
158427
|
session.feeder?.stop();
|
|
158424
158428
|
session.feeder = null;
|
|
158425
|
-
if (!
|
|
158429
|
+
if (!fs67.existsSync(dir)) return;
|
|
158426
158430
|
const inputFile = path57.join(dir, "input");
|
|
158427
|
-
if (!ownedOnly || ownsInput(inputFile))
|
|
158431
|
+
if (!ownedOnly || ownsInput(inputFile)) fs67.rmSync(inputFile, { force: true });
|
|
158428
158432
|
removeFiles(dir, `clip-${process.pid}-`);
|
|
158429
158433
|
removeFiles(dir, `in-${process.pid}-`);
|
|
158430
158434
|
}
|
|
158431
158435
|
function ownsInput(inputFile) {
|
|
158432
158436
|
try {
|
|
158433
|
-
return
|
|
158437
|
+
return fs67.readFileSync(inputFile, "utf8").split("\n").includes(OWNER_LINE.trim());
|
|
158434
158438
|
} catch {
|
|
158435
158439
|
return false;
|
|
158436
158440
|
}
|
|
@@ -158452,7 +158456,7 @@ function releaseAudio(session) {
|
|
|
158452
158456
|
}
|
|
158453
158457
|
|
|
158454
158458
|
// ../tool-server/src/utils/ios-audio-remote.ts
|
|
158455
|
-
var
|
|
158459
|
+
var fs68 = __toESM(require("node:fs"));
|
|
158456
158460
|
var net12 = __toESM(require("node:net"));
|
|
158457
158461
|
var path58 = __toESM(require("node:path"));
|
|
158458
158462
|
var import_node_crypto23 = require("node:crypto");
|
|
@@ -158698,12 +158702,12 @@ async function setRemoteAudioInput(session, source) {
|
|
|
158698
158702
|
}
|
|
158699
158703
|
let bytes;
|
|
158700
158704
|
try {
|
|
158701
|
-
if (
|
|
158705
|
+
if (fs68.statSync(source.path).size > MAX_FILE_BYTES) {
|
|
158702
158706
|
throw new InvalidToolInputError(
|
|
158703
158707
|
`${source.path} is larger than ${MAX_FILE_BYTES / 1024 / 1024} MB.`
|
|
158704
158708
|
);
|
|
158705
158709
|
}
|
|
158706
|
-
bytes =
|
|
158710
|
+
bytes = fs68.readFileSync(source.path);
|
|
158707
158711
|
} catch (err) {
|
|
158708
158712
|
if (err instanceof InvalidToolInputError) throw err;
|
|
158709
158713
|
throw new InvalidToolInputError(`Audio file not found: ${source.path}`);
|
|
@@ -163549,14 +163553,14 @@ init_src2();
|
|
|
163549
163553
|
init_capability();
|
|
163550
163554
|
|
|
163551
163555
|
// ../tool-server/src/tools/flows/flow-script-step.ts
|
|
163552
|
-
var
|
|
163556
|
+
var fs79 = __toESM(require("node:fs/promises"));
|
|
163553
163557
|
var path64 = __toESM(require("node:path"));
|
|
163554
163558
|
var import_node_url4 = require("node:url");
|
|
163555
163559
|
init_src2();
|
|
163556
163560
|
|
|
163557
163561
|
// ../tool-server/src/tools/flows/script/flow-script-executor.ts
|
|
163558
163562
|
var import_node_child_process54 = require("node:child_process");
|
|
163559
|
-
var
|
|
163563
|
+
var fs78 = __toESM(require("node:fs"));
|
|
163560
163564
|
var os16 = __toESM(require("node:os"));
|
|
163561
163565
|
var path63 = __toESM(require("node:path"));
|
|
163562
163566
|
var import_node_string_decoder = require("node:string_decoder");
|
|
@@ -164322,7 +164326,7 @@ function describeDirectoryProblem(candidate) {
|
|
|
164322
164326
|
}
|
|
164323
164327
|
if (candidate.split(/[\\/]+/).includes("..")) return 'contains a ".." segment';
|
|
164324
164328
|
try {
|
|
164325
|
-
return
|
|
164329
|
+
return fs78.statSync(candidate).isDirectory() ? null : "is not a directory";
|
|
164326
164330
|
} catch {
|
|
164327
164331
|
return "does not exist";
|
|
164328
164332
|
}
|
|
@@ -164347,7 +164351,7 @@ function encodeRequestOutput(output2) {
|
|
|
164347
164351
|
}
|
|
164348
164352
|
function realPathOrSelf(candidate) {
|
|
164349
164353
|
try {
|
|
164350
|
-
return
|
|
164354
|
+
return fs78.realpathSync(candidate);
|
|
164351
164355
|
} catch {
|
|
164352
164356
|
return candidate;
|
|
164353
164357
|
}
|
|
@@ -164356,7 +164360,7 @@ var TYPELESS_PACKAGE_WARNING_FLAG = "--disable-warning=MODULE_TYPELESS_PACKAGE_J
|
|
|
164356
164360
|
function resolveRunnerPath(runnerDir) {
|
|
164357
164361
|
const dir = runnerDir ?? __dirname;
|
|
164358
164362
|
const runner = path63.join(dir, RUNNER_FILE);
|
|
164359
|
-
if (!
|
|
164363
|
+
if (!fs78.existsSync(runner)) {
|
|
164360
164364
|
throw new ScriptSetupError(
|
|
164361
164365
|
"spawn",
|
|
164362
164366
|
`The script runner is missing from this installation (looked for ${runner}).`
|
|
@@ -164984,7 +164988,7 @@ function scriptRan(result) {
|
|
|
164984
164988
|
}
|
|
164985
164989
|
async function scriptFileProblem(canonical) {
|
|
164986
164990
|
try {
|
|
164987
|
-
const stat12 = await
|
|
164991
|
+
const stat12 = await fs79.stat(canonical);
|
|
164988
164992
|
return stat12.isFile() ? null : "is not a file";
|
|
164989
164993
|
} catch (err) {
|
|
164990
164994
|
const code = err.code;
|
|
@@ -165136,7 +165140,7 @@ Returns \`{ message, e2eTestFile, savedTo, restarted?, discardedSteps?, fragment
|
|
|
165136
165140
|
|
|
165137
165141
|
// ../tool-server/src/tools/flows/flow-add-step.ts
|
|
165138
165142
|
init_zod();
|
|
165139
|
-
var
|
|
165143
|
+
var fs82 = __toESM(require("node:fs/promises"));
|
|
165140
165144
|
var path68 = __toESM(require("node:path"));
|
|
165141
165145
|
init_src2();
|
|
165142
165146
|
|
|
@@ -165942,7 +165946,7 @@ function supportsFlowTree(platform) {
|
|
|
165942
165946
|
}
|
|
165943
165947
|
|
|
165944
165948
|
// ../tool-server/src/tools/flows/flow-pixels.ts
|
|
165945
|
-
var
|
|
165949
|
+
var fs80 = __toESM(require("node:fs/promises"));
|
|
165946
165950
|
var os17 = __toESM(require("node:os"));
|
|
165947
165951
|
var path65 = __toESM(require("node:path"));
|
|
165948
165952
|
var import_pngjs5 = __toESM(require_png());
|
|
@@ -166035,7 +166039,7 @@ async function captureIosDeviceFile(env, budgetMs) {
|
|
|
166035
166039
|
os17.tmpdir(),
|
|
166036
166040
|
`argent-ios-device-settle-${env.device.id.slice(0, 8)}-${process.hrtime.bigint()}.png`
|
|
166037
166041
|
);
|
|
166038
|
-
await
|
|
166042
|
+
await fs80.writeFile(file2, png);
|
|
166039
166043
|
await downscalePngInPlace(file2, CAPTURE_SCALE, captureAbortSignal(env, budgetMs));
|
|
166040
166044
|
return file2;
|
|
166041
166045
|
}
|
|
@@ -166049,9 +166053,9 @@ async function capturePng(env, budgetMs) {
|
|
|
166049
166053
|
}
|
|
166050
166054
|
const { path: file2, warning } = await captureFile(env, budgetMs);
|
|
166051
166055
|
try {
|
|
166052
|
-
return { png: await
|
|
166056
|
+
return { png: await fs80.readFile(file2), ...warning !== void 0 ? { warning } : {} };
|
|
166053
166057
|
} finally {
|
|
166054
|
-
await
|
|
166058
|
+
await fs80.rm(file2, { force: true }).catch(() => {
|
|
166055
166059
|
});
|
|
166056
166060
|
}
|
|
166057
166061
|
}
|
|
@@ -167241,7 +167245,7 @@ var path67 = __toESM(require("node:path"));
|
|
|
167241
167245
|
init_src2();
|
|
167242
167246
|
|
|
167243
167247
|
// ../tool-server/src/tools/flows/project-access.ts
|
|
167244
|
-
var
|
|
167248
|
+
var fs81 = __toESM(require("node:fs/promises"));
|
|
167245
167249
|
var path66 = __toESM(require("node:path"));
|
|
167246
167250
|
init_src2();
|
|
167247
167251
|
async function resolveRunTarget(project, anchorDir, target) {
|
|
@@ -167252,7 +167256,7 @@ async function resolveRunTarget(project, anchorDir, target) {
|
|
|
167252
167256
|
const other = await project.resolveFlowFile(dir, target);
|
|
167253
167257
|
if (other.spelling.state === "absent") continue;
|
|
167254
167258
|
if (other.spelling.state === "case_folded") return { ...other, anchorDir: dir };
|
|
167255
|
-
const found = project.mode === "host" ? await
|
|
167259
|
+
const found = project.mode === "host" ? await fs81.stat(other.canonical).then(
|
|
167256
167260
|
() => true,
|
|
167257
167261
|
() => false
|
|
167258
167262
|
) : await other.read() !== null;
|
|
@@ -167309,7 +167313,7 @@ var HostProjectAccess = class {
|
|
|
167309
167313
|
spelling,
|
|
167310
167314
|
read: async () => {
|
|
167311
167315
|
try {
|
|
167312
|
-
return await
|
|
167316
|
+
return await fs81.readFile(canonical, "utf8");
|
|
167313
167317
|
} catch (err) {
|
|
167314
167318
|
if (!isEnoent(err)) throw err;
|
|
167315
167319
|
return null;
|
|
@@ -167319,19 +167323,19 @@ var HostProjectAccess = class {
|
|
|
167319
167323
|
}
|
|
167320
167324
|
async readFile(filePath) {
|
|
167321
167325
|
try {
|
|
167322
|
-
return await
|
|
167326
|
+
return await fs81.readFile(filePath);
|
|
167323
167327
|
} catch (err) {
|
|
167324
167328
|
if (!isNothingThere(err)) throw err;
|
|
167325
167329
|
return null;
|
|
167326
167330
|
}
|
|
167327
167331
|
}
|
|
167328
167332
|
async writeBaseline(filePath, bytes) {
|
|
167329
|
-
const replaced = await
|
|
167333
|
+
const replaced = await fs81.access(filePath).then(
|
|
167330
167334
|
() => true,
|
|
167331
167335
|
() => false
|
|
167332
167336
|
);
|
|
167333
|
-
await
|
|
167334
|
-
await
|
|
167337
|
+
await fs81.mkdir(path66.dirname(filePath), { recursive: true });
|
|
167338
|
+
await fs81.writeFile(filePath, bytes);
|
|
167335
167339
|
return { replaced };
|
|
167336
167340
|
}
|
|
167337
167341
|
};
|
|
@@ -167421,7 +167425,7 @@ var ClientProjectAccess = class {
|
|
|
167421
167425
|
const member = this.file(filePath);
|
|
167422
167426
|
if (member === void 0 || member.state === "missing") return null;
|
|
167423
167427
|
if (member.state === "present" && member.hostPath !== void 0) {
|
|
167424
|
-
return
|
|
167428
|
+
return fs81.readFile(member.hostPath);
|
|
167425
167429
|
}
|
|
167426
167430
|
throw clientRefusal(
|
|
167427
167431
|
filePath,
|
|
@@ -168171,7 +168175,7 @@ async function captureTapSelector(registry2, session, udid, point, block) {
|
|
|
168171
168175
|
async function activeFlowState(session, block) {
|
|
168172
168176
|
if (session.persist === "host") {
|
|
168173
168177
|
try {
|
|
168174
|
-
adoptRecordedFile(session, parseFlow(await
|
|
168178
|
+
adoptRecordedFile(session, parseFlow(await fs82.readFile(session.filePath, "utf8")));
|
|
168175
168179
|
} catch (err) {
|
|
168176
168180
|
return {
|
|
168177
168181
|
stepCount: recordedCount(session.flow, block),
|
|
@@ -168839,7 +168843,7 @@ Returns the updated env map with secret placeholders intact, plus savedTo. If th
|
|
|
168839
168843
|
init_zod();
|
|
168840
168844
|
var nodePath = __toESM(require("node:path"));
|
|
168841
168845
|
init_src2();
|
|
168842
|
-
var
|
|
168846
|
+
var fs83 = __toESM(require("node:fs/promises"));
|
|
168843
168847
|
init_capability();
|
|
168844
168848
|
init_device_info();
|
|
168845
168849
|
var OUTPUT_RENDER_LIMIT_BYTES = 64 * 1024;
|
|
@@ -168853,7 +168857,7 @@ async function recordedStepCount(session, block) {
|
|
|
168853
168857
|
}
|
|
168854
168858
|
async function recordedFileEnv(session) {
|
|
168855
168859
|
try {
|
|
168856
|
-
return parseFlow(await
|
|
168860
|
+
return parseFlow(await fs83.readFile(session.filePath, "utf8")).env;
|
|
168857
168861
|
} catch (err) {
|
|
168858
168862
|
throw wrapFailure(
|
|
168859
168863
|
err,
|
|
@@ -169026,7 +169030,7 @@ Returns \`{ status, reason?, outputJson?, stepCount, recorded? }\`. A failed scr
|
|
|
169026
169030
|
|
|
169027
169031
|
// ../tool-server/src/tools/flows/flow-finish-recording.ts
|
|
169028
169032
|
init_zod();
|
|
169029
|
-
var
|
|
169033
|
+
var fs84 = __toESM(require("node:fs/promises"));
|
|
169030
169034
|
function attachStepWarnings(summary, warnings) {
|
|
169031
169035
|
if (warnings.size === 0) return summary;
|
|
169032
169036
|
return summary.flatMap((line, i) => {
|
|
@@ -169109,7 +169113,7 @@ Returns \`{ message, path, steps, shutdownSteps?, fragmentShutdown?, summary, e2
|
|
|
169109
169113
|
flowFile2 = serializeFlow(session.flow);
|
|
169110
169114
|
savedTo2 = clientFileDirective(filePath2, flowFile2);
|
|
169111
169115
|
} else {
|
|
169112
|
-
flowFile2 = await
|
|
169116
|
+
flowFile2 = await fs84.readFile(filePath2, "utf8");
|
|
169113
169117
|
savedTo2 = filePath2;
|
|
169114
169118
|
}
|
|
169115
169119
|
const flow2 = parseFlow(flowFile2);
|
|
@@ -169160,7 +169164,7 @@ Returns \`{ message, path, steps, shutdownSteps?, fragmentShutdown?, summary, e2
|
|
|
169160
169164
|
|
|
169161
169165
|
// ../tool-server/src/tools/flows/flow-run.ts
|
|
169162
169166
|
init_zod();
|
|
169163
|
-
var
|
|
169167
|
+
var fs87 = __toESM(require("node:fs/promises"));
|
|
169164
169168
|
var path71 = __toESM(require("node:path"));
|
|
169165
169169
|
init_src2();
|
|
169166
169170
|
|
|
@@ -169229,7 +169233,7 @@ init_capability();
|
|
|
169229
169233
|
|
|
169230
169234
|
// ../tool-server/src/tools/flows/flow-visual.ts
|
|
169231
169235
|
var import_node_crypto24 = require("node:crypto");
|
|
169232
|
-
var
|
|
169236
|
+
var fs86 = __toESM(require("node:fs/promises"));
|
|
169233
169237
|
var os18 = __toESM(require("node:os"));
|
|
169234
169238
|
var path70 = __toESM(require("node:path"));
|
|
169235
169239
|
var import_pngjs7 = __toESM(require_png());
|
|
@@ -171274,7 +171278,7 @@ function roundToOne(value) {
|
|
|
171274
171278
|
// ../tool-server/src/tools/flows/flow-visual.ts
|
|
171275
171279
|
var DEFAULT_MAX_MISMATCH = 0.5;
|
|
171276
171280
|
async function pngDimensions(file2) {
|
|
171277
|
-
const fh = await
|
|
171281
|
+
const fh = await fs86.open(file2, "r");
|
|
171278
171282
|
try {
|
|
171279
171283
|
const buf = Buffer.alloc(24);
|
|
171280
171284
|
await fh.read(buf, 0, 24, 0);
|
|
@@ -171306,12 +171310,12 @@ function baselineDir(flowsDir, flowName) {
|
|
|
171306
171310
|
async function cleanupDiffDir(dir, keep) {
|
|
171307
171311
|
try {
|
|
171308
171312
|
if (!keep) {
|
|
171309
|
-
await
|
|
171313
|
+
await fs86.rm(dir, { recursive: true, force: true });
|
|
171310
171314
|
return;
|
|
171311
171315
|
}
|
|
171312
|
-
for (const entry of await
|
|
171316
|
+
for (const entry of await fs86.readdir(dir)) {
|
|
171313
171317
|
const entryPath = path70.join(dir, entry);
|
|
171314
|
-
if (entryPath !== keep) await
|
|
171318
|
+
if (entryPath !== keep) await fs86.rm(entryPath, { recursive: true, force: true });
|
|
171315
171319
|
}
|
|
171316
171320
|
} catch {
|
|
171317
171321
|
}
|
|
@@ -171322,7 +171326,7 @@ function namingClientBaseline(err, copy, clientPath) {
|
|
|
171322
171326
|
return new FailureError(err.message.split(copy).join(clientPath), signal);
|
|
171323
171327
|
}
|
|
171324
171328
|
async function cropPngFile(src, dest, frame2) {
|
|
171325
|
-
const png = import_pngjs7.PNG.sync.read(await
|
|
171329
|
+
const png = import_pngjs7.PNG.sync.read(await fs86.readFile(src));
|
|
171326
171330
|
const left = Math.max(0, Math.round(frame2.x * png.width));
|
|
171327
171331
|
const top = Math.max(0, Math.round(frame2.y * png.height));
|
|
171328
171332
|
const right = Math.min(png.width, Math.round((frame2.x + frame2.width) * png.width));
|
|
@@ -171332,7 +171336,7 @@ async function cropPngFile(src, dest, frame2) {
|
|
|
171332
171336
|
if (w < 1 || h < 1) return null;
|
|
171333
171337
|
const out = new import_pngjs7.PNG({ width: w, height: h });
|
|
171334
171338
|
import_pngjs7.PNG.bitblt(png, out, left, top, w, h, 0, 0);
|
|
171335
|
-
await
|
|
171339
|
+
await fs86.writeFile(dest, import_pngjs7.PNG.sync.write(out));
|
|
171336
171340
|
return { w, h };
|
|
171337
171341
|
}
|
|
171338
171342
|
async function warmSnapshotCapture(registry2, device) {
|
|
@@ -171407,9 +171411,9 @@ async function runSnapshot(env, opts) {
|
|
|
171407
171411
|
let keepBaselineCopy = false;
|
|
171408
171412
|
const hostBaseline = async (bytes) => {
|
|
171409
171413
|
if (opts.clientFlowPath === void 0) return baselinePath;
|
|
171410
|
-
baselineCopyDir = await
|
|
171414
|
+
baselineCopyDir = await fs86.mkdtemp(path70.join(os18.tmpdir(), "argent-e2e-baseline-"));
|
|
171411
171415
|
const copy = path70.join(baselineCopyDir, key2);
|
|
171412
|
-
await
|
|
171416
|
+
await fs86.writeFile(copy, bytes);
|
|
171413
171417
|
return copy;
|
|
171414
171418
|
};
|
|
171415
171419
|
const baselineArtifact = (hostPath) => {
|
|
@@ -171418,7 +171422,7 @@ async function runSnapshot(env, opts) {
|
|
|
171418
171422
|
};
|
|
171419
171423
|
try {
|
|
171420
171424
|
if (cropFrame !== void 0) {
|
|
171421
|
-
cropDir = await
|
|
171425
|
+
cropDir = await fs86.mkdtemp(path70.join(os18.tmpdir(), "argent-e2e-crop-"));
|
|
171422
171426
|
const croppedPath = path70.join(cropDir, key2);
|
|
171423
171427
|
const cropped = await cropPngFile(shot.image.hostPath, croppedPath, cropFrame);
|
|
171424
171428
|
if (cropped === null) {
|
|
@@ -171436,7 +171440,7 @@ async function runSnapshot(env, opts) {
|
|
|
171436
171440
|
if (opts.updateBaselines) {
|
|
171437
171441
|
const { replaced } = await opts.project.writeBaseline(
|
|
171438
171442
|
baselinePath,
|
|
171439
|
-
await
|
|
171443
|
+
await fs86.readFile(currentPath)
|
|
171440
171444
|
);
|
|
171441
171445
|
const source = env.device.platform === "ios-remote" ? " from a remote simulator" : "";
|
|
171442
171446
|
if (opts.clientFlowPath !== void 0) {
|
|
@@ -171476,7 +171480,7 @@ async function runSnapshot(env, opts) {
|
|
|
171476
171480
|
const legacyPath = baselineFor(legacyKey);
|
|
171477
171481
|
const legacy = await readBaseline(legacyPath);
|
|
171478
171482
|
if (legacy !== null) {
|
|
171479
|
-
cropDir ??= await
|
|
171483
|
+
cropDir ??= await fs86.mkdtemp(path70.join(os18.tmpdir(), "argent-e2e-crop-"));
|
|
171480
171484
|
const turnedPath = path70.join(cropDir, `native-${legacyKey}`);
|
|
171481
171485
|
await turnPngToNative(currentPath, turnedPath, sideways);
|
|
171482
171486
|
currentPath = turnedPath;
|
|
@@ -171538,7 +171542,7 @@ async function runSnapshot(env, opts) {
|
|
|
171538
171542
|
baseline: await baselineArtifact(localBaseline),
|
|
171539
171543
|
current: await currentArtifact()
|
|
171540
171544
|
};
|
|
171541
|
-
outputDir = await
|
|
171545
|
+
outputDir = await fs86.mkdtemp(path70.join(os18.tmpdir(), "argent-e2e-diff-"));
|
|
171542
171546
|
const contextDiffPath = path70.join(outputDir, `${snapshotKey}-diff.png`);
|
|
171543
171547
|
if (await writeContextDiff(result, contextDiffPath)) {
|
|
171544
171548
|
artifacts.diff = await store.register({
|
|
@@ -171571,7 +171575,7 @@ async function sidewaysOrientation(env) {
|
|
|
171571
171575
|
return orientation === "landscapeLeft" || orientation === "landscapeRight" ? orientation : void 0;
|
|
171572
171576
|
}
|
|
171573
171577
|
async function turnPngToNative(src, dest, orientation) {
|
|
171574
|
-
const upright = import_pngjs7.PNG.sync.read(await
|
|
171578
|
+
const upright = import_pngjs7.PNG.sync.read(await fs86.readFile(src));
|
|
171575
171579
|
const native = new import_pngjs7.PNG({ width: upright.height, height: upright.width });
|
|
171576
171580
|
for (let y = 0; y < native.height; y++) {
|
|
171577
171581
|
for (let x = 0; x < native.width; x++) {
|
|
@@ -171589,7 +171593,7 @@ async function turnPngToNative(src, dest, orientation) {
|
|
|
171589
171593
|
);
|
|
171590
171594
|
}
|
|
171591
171595
|
}
|
|
171592
|
-
await
|
|
171596
|
+
await fs86.writeFile(dest, import_pngjs7.PNG.sync.write(native));
|
|
171593
171597
|
}
|
|
171594
171598
|
|
|
171595
171599
|
// ../tool-server/src/utils/status-bar.ts
|
|
@@ -172267,7 +172271,7 @@ Over a link (\`argent link\` / \`ARGENT_TOOLS_URL\`), the client uploads the tes
|
|
|
172267
172271
|
const project = clientProject ?? new HostProjectAccess();
|
|
172268
172272
|
const canonicalPath2 = await canonicalFlowPath(filePath);
|
|
172269
172273
|
const flowsDir = path71.dirname(canonicalPath2);
|
|
172270
|
-
const flow = parseFlow(await
|
|
172274
|
+
const flow = parseFlow(await fs87.readFile(canonicalPath2, "utf8"));
|
|
172271
172275
|
if (viaUpload) {
|
|
172272
172276
|
assertUploadSelfContained(
|
|
172273
172277
|
registry2,
|
|
@@ -172606,7 +172610,7 @@ function launchTargetPlatform(launch, platform) {
|
|
|
172606
172610
|
async function resolveAppPath(specPath, flowDir) {
|
|
172607
172611
|
const lexical = path71.resolve(flowDir, specPath);
|
|
172608
172612
|
try {
|
|
172609
|
-
return await
|
|
172613
|
+
return await fs87.realpath(lexical);
|
|
172610
172614
|
} catch {
|
|
172611
172615
|
return lexical;
|
|
172612
172616
|
}
|
|
@@ -173458,7 +173462,7 @@ async function resolveFlowSource(params, fileInput, flowPathInput) {
|
|
|
173458
173462
|
|
|
173459
173463
|
// ../tool-server/src/tools/flows/flow-read-prerequisite.ts
|
|
173460
173464
|
init_zod();
|
|
173461
|
-
var
|
|
173465
|
+
var fs88 = __toESM(require("node:fs/promises"));
|
|
173462
173466
|
init_src2();
|
|
173463
173467
|
var fileInputs6 = [
|
|
173464
173468
|
{
|
|
@@ -173530,7 +173534,7 @@ Address the e2e test exactly as you will address it in e2e-execute: name or e2e_
|
|
|
173530
173534
|
ctx?.fileInputs?.e2e_test_file,
|
|
173531
173535
|
ctx?.fileInputs?.e2e_test_path
|
|
173532
173536
|
);
|
|
173533
|
-
const flow = parseFlow(await
|
|
173537
|
+
const flow = parseFlow(await fs88.readFile(filePath, "utf8"));
|
|
173534
173538
|
return {
|
|
173535
173539
|
e2eTest: flowName,
|
|
173536
173540
|
flow: flowName,
|
|
@@ -174775,7 +174779,7 @@ Returns { value } for one key, { entries, count } for all keys, and { set } / {
|
|
|
174775
174779
|
};
|
|
174776
174780
|
|
|
174777
174781
|
// ../tool-server/src/tools/file-panel/index.ts
|
|
174778
|
-
var
|
|
174782
|
+
var fs90 = __toESM(require("node:fs/promises"));
|
|
174779
174783
|
var os20 = __toESM(require("node:os"));
|
|
174780
174784
|
var path73 = __toESM(require("node:path"));
|
|
174781
174785
|
init_zod();
|
|
@@ -174810,7 +174814,7 @@ function requestedPaths(params, action) {
|
|
|
174810
174814
|
}
|
|
174811
174815
|
async function statOrNull(p) {
|
|
174812
174816
|
try {
|
|
174813
|
-
return await
|
|
174817
|
+
return await fs90.stat(p);
|
|
174814
174818
|
} catch {
|
|
174815
174819
|
return null;
|
|
174816
174820
|
}
|
|
@@ -174850,7 +174854,7 @@ async function sandboxTokens2(app, paths) {
|
|
|
174850
174854
|
if (!tracked?.sandboxed) return {};
|
|
174851
174855
|
const resolved = await Promise.all(
|
|
174852
174856
|
paths.map(
|
|
174853
|
-
(p) =>
|
|
174857
|
+
(p) => fs90.realpath(p).catch(async () => path73.join(await fs90.realpath(path73.dirname(p)), path73.basename(p)))
|
|
174854
174858
|
)
|
|
174855
174859
|
);
|
|
174856
174860
|
const tokens = [];
|
|
@@ -175325,7 +175329,7 @@ function probeArgentToolServer(host, port, timeoutMs = 500) {
|
|
|
175325
175329
|
|
|
175326
175330
|
// ../tool-server/src/utils/preview-window.ts
|
|
175327
175331
|
var import_node_child_process58 = require("node:child_process");
|
|
175328
|
-
var
|
|
175332
|
+
var fs91 = __toESM(require("node:fs"));
|
|
175329
175333
|
var os21 = __toESM(require("node:os"));
|
|
175330
175334
|
var path74 = __toESM(require("node:path"));
|
|
175331
175335
|
function ensureLensAppBundle(electronBin) {
|
|
@@ -175342,18 +175346,18 @@ function ensureLensAppBundle(electronBin) {
|
|
|
175342
175346
|
);
|
|
175343
175347
|
const wrapperExec = path74.join(wrapperContents, "MacOS", "Electron");
|
|
175344
175348
|
try {
|
|
175345
|
-
if (
|
|
175349
|
+
if (fs91.realpathSync(wrapperExec) === fs91.realpathSync(electronBin)) return wrapperExec;
|
|
175346
175350
|
} catch {
|
|
175347
175351
|
}
|
|
175348
|
-
|
|
175349
|
-
|
|
175350
|
-
|
|
175351
|
-
|
|
175352
|
-
|
|
175352
|
+
fs91.rmSync(path74.dirname(wrapperContents), { recursive: true, force: true });
|
|
175353
|
+
fs91.mkdirSync(path74.join(wrapperContents, "MacOS"), { recursive: true });
|
|
175354
|
+
fs91.symlinkSync(path74.join(realContents, "Frameworks"), path74.join(wrapperContents, "Frameworks"));
|
|
175355
|
+
fs91.symlinkSync(path74.join(realContents, "Resources"), path74.join(wrapperContents, "Resources"));
|
|
175356
|
+
fs91.symlinkSync(electronBin, wrapperExec);
|
|
175353
175357
|
const pkgInfo = path74.join(realContents, "PkgInfo");
|
|
175354
|
-
if (
|
|
175358
|
+
if (fs91.existsSync(pkgInfo)) fs91.copyFileSync(pkgInfo, path74.join(wrapperContents, "PkgInfo"));
|
|
175355
175359
|
const plist = path74.join(wrapperContents, "Info.plist");
|
|
175356
|
-
|
|
175360
|
+
fs91.copyFileSync(path74.join(realContents, "Info.plist"), plist);
|
|
175357
175361
|
const setPlist = (entry, value) => {
|
|
175358
175362
|
try {
|
|
175359
175363
|
(0, import_node_child_process58.execFileSync)("/usr/libexec/PlistBuddy", ["-c", `Set :${entry} ${value}`, plist]);
|
|
@@ -175395,7 +175399,7 @@ function createPreviewWindowManager(opts = {}) {
|
|
|
175395
175399
|
const resolveMainScript = () => {
|
|
175396
175400
|
if (opts.mainScript) return opts.mainScript;
|
|
175397
175401
|
const bundled = path74.join(__dirname, "preview-window", "main.cjs");
|
|
175398
|
-
if (
|
|
175402
|
+
if (fs91.existsSync(bundled)) return bundled;
|
|
175399
175403
|
return require.resolve("@argent/preview-window/dist/main.js");
|
|
175400
175404
|
};
|
|
175401
175405
|
const isAlive2 = (c) => c !== null && c.exitCode === null && !c.killed;
|