@swmansion/argent 0.35.1-next.80 → 0.35.1-next.81
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/bin/argent-android-devtools-0.4.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- package/dist/cli-cmds.mjs +345 -307
- package/dist/client.js +121 -88
- package/dist/installer.mjs +306 -271
- package/dist/mcp-server.mjs +196 -163
- package/dist/tool-server.cjs +609 -580
- package/dylibs/libArgentAudio.dylib +0 -0
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
- package/dylibs/tcp/argent-audio-feeder +0 -0
- package/dylibs/tcp/libArgentAudio.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +2 -2
package/dist/tool-server.cjs
CHANGED
|
@@ -66,6 +66,49 @@ var init_home = __esm({
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
// ../configuration-core/src/write-file.ts
|
|
70
|
+
function writeFileAtomicSync(file2, data, mode = 438) {
|
|
71
|
+
const tmp = `${file2}.${(0, import_node_crypto.randomBytes)(8).toString("hex")}.tmp`;
|
|
72
|
+
try {
|
|
73
|
+
fs.writeFileSync(tmp, data, { flag: "wx", mode });
|
|
74
|
+
fs.renameSync(tmp, file2);
|
|
75
|
+
} catch (err) {
|
|
76
|
+
fs.rmSync(tmp, { force: true });
|
|
77
|
+
if (err.code !== "EBUSY" || !writeOwnFileInPlace(file2, data, mode)) {
|
|
78
|
+
throw err;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function writeOwnFileInPlace(file2, data, mode) {
|
|
83
|
+
const uid = process.getuid?.();
|
|
84
|
+
if (uid === void 0) return false;
|
|
85
|
+
let fd;
|
|
86
|
+
try {
|
|
87
|
+
fd = fs.openSync(file2, IN_PLACE_FLAGS);
|
|
88
|
+
} catch {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
const stat11 = fs.fstatSync(fd);
|
|
93
|
+
if (!stat11.isFile() || stat11.uid !== uid && uid !== 0) return false;
|
|
94
|
+
fs.fchmodSync(fd, stat11.mode & mode & 511);
|
|
95
|
+
fs.ftruncateSync(fd);
|
|
96
|
+
fs.writeFileSync(fd, data);
|
|
97
|
+
return true;
|
|
98
|
+
} finally {
|
|
99
|
+
fs.closeSync(fd);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
var fs, import_node_crypto, IN_PLACE_FLAGS;
|
|
103
|
+
var init_write_file = __esm({
|
|
104
|
+
"../configuration-core/src/write-file.ts"() {
|
|
105
|
+
"use strict";
|
|
106
|
+
fs = __toESM(require("node:fs"), 1);
|
|
107
|
+
import_node_crypto = require("node:crypto");
|
|
108
|
+
IN_PLACE_FLAGS = fs.constants.O_WRONLY | fs.constants.O_NOFOLLOW | fs.constants.O_NONBLOCK;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
69
112
|
// ../configuration-core/src/flags.ts
|
|
70
113
|
function getFlagDefinition(name, registry2 = FLAG_REGISTRY) {
|
|
71
114
|
return registry2.find((def) => def.name === name);
|
|
@@ -74,7 +117,7 @@ function findProjectRoot(startDir) {
|
|
|
74
117
|
let current = path2.resolve(startDir);
|
|
75
118
|
while (true) {
|
|
76
119
|
for (const marker of PROJECT_MARKERS) {
|
|
77
|
-
if (
|
|
120
|
+
if (fs2.existsSync(path2.join(current, marker))) return current;
|
|
78
121
|
}
|
|
79
122
|
const parent = path2.dirname(current);
|
|
80
123
|
if (parent === current) return null;
|
|
@@ -94,7 +137,7 @@ function getFlagsPath(scope, options = {}) {
|
|
|
94
137
|
function readFlagsFile(filePath) {
|
|
95
138
|
let raw;
|
|
96
139
|
try {
|
|
97
|
-
raw =
|
|
140
|
+
raw = fs2.readFileSync(filePath, "utf8");
|
|
98
141
|
} catch {
|
|
99
142
|
return {};
|
|
100
143
|
}
|
|
@@ -129,13 +172,14 @@ function isFeatureEnabled(name, options = {}, registry2 = FLAG_REGISTRY) {
|
|
|
129
172
|
default: getFlagDefinition(name, registry2)?.defaultEnabled ?? false
|
|
130
173
|
});
|
|
131
174
|
}
|
|
132
|
-
var
|
|
175
|
+
var fs2, path2, FLAG_REGISTRY, PROJECT_MARKERS;
|
|
133
176
|
var init_flags = __esm({
|
|
134
177
|
"../configuration-core/src/flags.ts"() {
|
|
135
178
|
"use strict";
|
|
136
|
-
|
|
179
|
+
fs2 = __toESM(require("node:fs"), 1);
|
|
137
180
|
path2 = __toESM(require("node:path"), 1);
|
|
138
181
|
init_home();
|
|
182
|
+
init_write_file();
|
|
139
183
|
FLAG_REGISTRY = [
|
|
140
184
|
{
|
|
141
185
|
name: "disable-auto-screenshot",
|
|
@@ -204,7 +248,7 @@ function isHomeDir(dir, options = {}) {
|
|
|
204
248
|
}
|
|
205
249
|
function canonicalPath(p) {
|
|
206
250
|
try {
|
|
207
|
-
return
|
|
251
|
+
return fs3.realpathSync.native(p);
|
|
208
252
|
} catch {
|
|
209
253
|
return path3.resolve(p);
|
|
210
254
|
}
|
|
@@ -217,11 +261,11 @@ function configDir(scope = "global", options = {}) {
|
|
|
217
261
|
function configFilePath(scope = "global", options = {}) {
|
|
218
262
|
return path3.join(configDir(scope, options), "config.json");
|
|
219
263
|
}
|
|
220
|
-
var
|
|
264
|
+
var fs3, path3;
|
|
221
265
|
var init_paths = __esm({
|
|
222
266
|
"../configuration-core/src/paths.ts"() {
|
|
223
267
|
"use strict";
|
|
224
|
-
|
|
268
|
+
fs3 = __toESM(require("node:fs"), 1);
|
|
225
269
|
path3 = __toESM(require("node:path"), 1);
|
|
226
270
|
init_flags();
|
|
227
271
|
init_home();
|
|
@@ -232,7 +276,7 @@ var init_paths = __esm({
|
|
|
232
276
|
// ../configuration-core/src/config.ts
|
|
233
277
|
function readConfigObject(scope = "global", options = {}) {
|
|
234
278
|
try {
|
|
235
|
-
const raw =
|
|
279
|
+
const raw = fs4.readFileSync(configFilePath(scope, options), "utf8");
|
|
236
280
|
const json2 = JSON.parse(raw);
|
|
237
281
|
if (json2 && typeof json2 === "object" && !Array.isArray(json2)) {
|
|
238
282
|
return json2;
|
|
@@ -265,11 +309,11 @@ function getAtPath(obj, dottedKey) {
|
|
|
265
309
|
}
|
|
266
310
|
return cur;
|
|
267
311
|
}
|
|
268
|
-
var
|
|
312
|
+
var fs4, FORBIDDEN_SEGMENTS;
|
|
269
313
|
var init_config = __esm({
|
|
270
314
|
"../configuration-core/src/config.ts"() {
|
|
271
315
|
"use strict";
|
|
272
|
-
|
|
316
|
+
fs4 = __toESM(require("node:fs"), 1);
|
|
273
317
|
init_paths();
|
|
274
318
|
FORBIDDEN_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
275
319
|
}
|
|
@@ -700,10 +744,10 @@ function fileSource(filePath, exposure) {
|
|
|
700
744
|
names: [],
|
|
701
745
|
values: /* @__PURE__ */ new Map()
|
|
702
746
|
};
|
|
703
|
-
if (!
|
|
747
|
+
if (!fs5.statSync(filePath, { throwIfNoEntry: false })) return absent;
|
|
704
748
|
let content;
|
|
705
749
|
try {
|
|
706
|
-
content =
|
|
750
|
+
content = fs5.readFileSync(filePath, "utf8");
|
|
707
751
|
} catch {
|
|
708
752
|
return absent;
|
|
709
753
|
}
|
|
@@ -713,7 +757,7 @@ function secretsFileSource(filePath) {
|
|
|
713
757
|
const resolved = path4.resolve(filePath);
|
|
714
758
|
let content;
|
|
715
759
|
try {
|
|
716
|
-
content =
|
|
760
|
+
content = fs5.readFileSync(resolved, "utf8");
|
|
717
761
|
} catch (err) {
|
|
718
762
|
const code = err.code;
|
|
719
763
|
const reason2 = code === "ENOENT" ? "no such file" : code === "EISDIR" ? "it is a directory" : code === "EACCES" ? "permission denied" : err instanceof Error ? err.message : String(err);
|
|
@@ -874,11 +918,11 @@ function callerSecretPlacementAdvice(name) {
|
|
|
874
918
|
function clientSecretPlacementAdvice(name) {
|
|
875
919
|
return `To make it available, ask the user to add \`${name}=\u2026\` to ${SECRETS_FILE_NAME} in the Argent home on the client's machine (\`~/.argent\` unless ARGENT_HOME_DIR moves it), to \`.argent/${SECRETS_FILE_NAME}\` in the project the client runs in, or to export ${SECRET_ENV_PREFIX}${name} before the client starts; \`argent secrets\` there lists the sources the client reads. Without \`forward-secrets\` on, the client sends only the file \`argent e2e run --secrets-file\` names, so add \`${SECRET_ENV_PREFIX}${name}=\u2026\` there. Never ask the user for the secret value itself.`;
|
|
876
920
|
}
|
|
877
|
-
var
|
|
921
|
+
var fs5, path4, import_dotenv, SECRET_ENV_PREFIX, SECRETS_FILE_NAME, SHARED_ENV_FILES, SECRET_NAME_RE, SUMMARY_KINDS, SECRET_PLACEHOLDER_RE, REDUNDANT_PREFIX_RE;
|
|
878
922
|
var init_secrets = __esm({
|
|
879
923
|
"../configuration-core/src/secrets.ts"() {
|
|
880
924
|
"use strict";
|
|
881
|
-
|
|
925
|
+
fs5 = __toESM(require("node:fs"), 1);
|
|
882
926
|
path4 = __toESM(require("node:path"), 1);
|
|
883
927
|
import_dotenv = __toESM(require_dist(), 1);
|
|
884
928
|
init_flags();
|
|
@@ -1150,7 +1194,7 @@ function getAdditionalIosDeviceSets(options = {}) {
|
|
|
1150
1194
|
home
|
|
1151
1195
|
);
|
|
1152
1196
|
const radon = path5.resolve(home, RADON_IDE_IOS_DEVICE_SET);
|
|
1153
|
-
const detected =
|
|
1197
|
+
const detected = fs6.existsSync(radon) ? [radon] : [];
|
|
1154
1198
|
return Array.from(/* @__PURE__ */ new Set([...global2, ...project, ...detected]));
|
|
1155
1199
|
}
|
|
1156
1200
|
function resolveDeviceSetEntries(entries, baseDir, home) {
|
|
@@ -1161,11 +1205,11 @@ function resolveDeviceSetEntries(entries, baseDir, home) {
|
|
|
1161
1205
|
return path5.resolve(baseDir, entry);
|
|
1162
1206
|
});
|
|
1163
1207
|
}
|
|
1164
|
-
var
|
|
1208
|
+
var fs6, 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;
|
|
1165
1209
|
var init_config_access = __esm({
|
|
1166
1210
|
"../configuration-core/src/config-access.ts"() {
|
|
1167
1211
|
"use strict";
|
|
1168
|
-
|
|
1212
|
+
fs6 = __toESM(require("node:fs"), 1);
|
|
1169
1213
|
path5 = __toESM(require("node:path"), 1);
|
|
1170
1214
|
init_flags();
|
|
1171
1215
|
init_paths();
|
|
@@ -1235,8 +1279,8 @@ function untrusted(dir) {
|
|
|
1235
1279
|
let stat11;
|
|
1236
1280
|
let parent;
|
|
1237
1281
|
try {
|
|
1238
|
-
stat11 =
|
|
1239
|
-
parent =
|
|
1282
|
+
stat11 = fs7.lstatSync(dir);
|
|
1283
|
+
parent = fs7.statSync(path6.dirname(dir));
|
|
1240
1284
|
} catch {
|
|
1241
1285
|
return "it cannot be read";
|
|
1242
1286
|
}
|
|
@@ -1250,9 +1294,9 @@ function untrusted(dir) {
|
|
|
1250
1294
|
}
|
|
1251
1295
|
function prepareCloudAndroidMarkersDir() {
|
|
1252
1296
|
const dir = cloudAndroidMarkersDir();
|
|
1253
|
-
|
|
1297
|
+
fs7.mkdirSync(path6.dirname(dir), { recursive: true, mode: 448 });
|
|
1254
1298
|
try {
|
|
1255
|
-
|
|
1299
|
+
fs7.mkdirSync(dir, { mode: 448 });
|
|
1256
1300
|
} catch (err) {
|
|
1257
1301
|
if (err.code !== "EEXIST") throw err;
|
|
1258
1302
|
}
|
|
@@ -1273,14 +1317,14 @@ function cloudAndroidMarkerFile(serial, dir = cloudAndroidMarkersDir()) {
|
|
|
1273
1317
|
}
|
|
1274
1318
|
function readCloudAndroidMarker(file2) {
|
|
1275
1319
|
try {
|
|
1276
|
-
const raw = JSON.parse(
|
|
1320
|
+
const raw = JSON.parse(fs7.readFileSync(file2, "utf8"));
|
|
1277
1321
|
if (typeof raw.pid !== "number" || typeof raw.lease !== "string") return null;
|
|
1278
1322
|
if (typeof raw.serial !== "string") return null;
|
|
1279
1323
|
return {
|
|
1280
1324
|
serial: raw.serial,
|
|
1281
1325
|
pid: raw.pid,
|
|
1282
1326
|
lease: raw.lease,
|
|
1283
|
-
refreshedAt:
|
|
1327
|
+
refreshedAt: fs7.statSync(file2).mtimeMs
|
|
1284
1328
|
};
|
|
1285
1329
|
} catch {
|
|
1286
1330
|
return null;
|
|
@@ -1290,7 +1334,7 @@ function readCloudAndroidMarkers(dir = trustedCloudAndroidMarkersDir()) {
|
|
|
1290
1334
|
if (!dir) return [];
|
|
1291
1335
|
let names;
|
|
1292
1336
|
try {
|
|
1293
|
-
names =
|
|
1337
|
+
names = fs7.readdirSync(dir);
|
|
1294
1338
|
} catch {
|
|
1295
1339
|
return [];
|
|
1296
1340
|
}
|
|
@@ -1313,11 +1357,11 @@ function cloudAndroidLeaseHolders(dir = trustedCloudAndroidMarkersDir()) {
|
|
|
1313
1357
|
readCloudAndroidMarkers(dir).filter((marker) => isLiveCloudAndroidMarker(marker, now)).map((marker) => marker.pid)
|
|
1314
1358
|
);
|
|
1315
1359
|
}
|
|
1316
|
-
var
|
|
1360
|
+
var fs7, os2, path6, CLOUD_URL_ENV, CLOUD_API_KEY_ENV, markersDirOverride, UnsafeCloudAndroidMarkersError, CLOUD_ANDROID_MARKER_TTL_MS;
|
|
1317
1361
|
var init_cloud_android = __esm({
|
|
1318
1362
|
"../configuration-core/src/cloud-android.ts"() {
|
|
1319
1363
|
"use strict";
|
|
1320
|
-
|
|
1364
|
+
fs7 = __toESM(require("node:fs"), 1);
|
|
1321
1365
|
os2 = __toESM(require("node:os"), 1);
|
|
1322
1366
|
path6 = __toESM(require("node:path"), 1);
|
|
1323
1367
|
CLOUD_URL_ENV = "ARGENT_CLOUD_URL";
|
|
@@ -1336,6 +1380,7 @@ var init_src = __esm({
|
|
|
1336
1380
|
"use strict";
|
|
1337
1381
|
init_flags();
|
|
1338
1382
|
init_paths();
|
|
1383
|
+
init_write_file();
|
|
1339
1384
|
init_config();
|
|
1340
1385
|
init_whats_new();
|
|
1341
1386
|
init_secrets();
|
|
@@ -1402,12 +1447,12 @@ var init_types = __esm({
|
|
|
1402
1447
|
function inferMimeType(filePath) {
|
|
1403
1448
|
return MIME_BY_EXT[(0, import_node_path2.extname)(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
1404
1449
|
}
|
|
1405
|
-
var import_promises,
|
|
1450
|
+
var import_promises, import_node_crypto2, import_node_path2, ARTIFACT_MARKER, MIME_BY_EXT, ArtifactStore;
|
|
1406
1451
|
var init_artifacts = __esm({
|
|
1407
1452
|
"../registry/src/artifacts.ts"() {
|
|
1408
1453
|
"use strict";
|
|
1409
1454
|
import_promises = require("node:fs/promises");
|
|
1410
|
-
|
|
1455
|
+
import_node_crypto2 = require("node:crypto");
|
|
1411
1456
|
import_node_path2 = require("node:path");
|
|
1412
1457
|
ARTIFACT_MARKER = "__argentArtifact";
|
|
1413
1458
|
MIME_BY_EXT = {
|
|
@@ -1440,7 +1485,7 @@ var init_artifacts = __esm({
|
|
|
1440
1485
|
if (st.isDirectory()) isDirectory3 = true;
|
|
1441
1486
|
} catch {
|
|
1442
1487
|
}
|
|
1443
|
-
const id = (0,
|
|
1488
|
+
const id = (0, import_node_crypto2.randomUUID)();
|
|
1444
1489
|
this.entries.set(id, { path: hostPath, kind, filename, mimeType, size, isDirectory: isDirectory3 });
|
|
1445
1490
|
const handle = {
|
|
1446
1491
|
[ARTIFACT_MARKER]: true,
|
|
@@ -1558,7 +1603,7 @@ function e2eFileCandidates(projectRoot, name) {
|
|
|
1558
1603
|
return e2eDirsFor(projectRoot).map((dir) => path7.join(dir, `${name}.yaml`));
|
|
1559
1604
|
}
|
|
1560
1605
|
async function exists(file2) {
|
|
1561
|
-
return
|
|
1606
|
+
return fs8.stat(file2).then(
|
|
1562
1607
|
() => true,
|
|
1563
1608
|
() => false
|
|
1564
1609
|
);
|
|
@@ -1600,11 +1645,11 @@ function e2eRunFallbackDirs(anchorDir, target) {
|
|
|
1600
1645
|
const anchor2 = path7.resolve(anchorDir);
|
|
1601
1646
|
return e2eDirsFor(project).filter((dir) => path7.resolve(dir) !== anchor2);
|
|
1602
1647
|
}
|
|
1603
|
-
var
|
|
1648
|
+
var fs8, path7, E2E_DIR, LEGACY_E2E_DIRS, E2E_DIRS, E2E_DIR_NAMES;
|
|
1604
1649
|
var init_e2e_dirs = __esm({
|
|
1605
1650
|
"../registry/src/e2e-dirs.ts"() {
|
|
1606
1651
|
"use strict";
|
|
1607
|
-
|
|
1652
|
+
fs8 = __toESM(require("node:fs/promises"));
|
|
1608
1653
|
path7 = __toESM(require("node:path"));
|
|
1609
1654
|
E2E_DIR = path7.join(".argent", "e2e");
|
|
1610
1655
|
LEGACY_E2E_DIRS = Object.freeze([path7.join(".argent", "flows")]);
|
|
@@ -1673,10 +1718,10 @@ var init_tool_ids = __esm({
|
|
|
1673
1718
|
// ../registry/src/flow-file-refs.ts
|
|
1674
1719
|
async function canonicalFlowPath(p) {
|
|
1675
1720
|
try {
|
|
1676
|
-
return await
|
|
1721
|
+
return await fs9.realpath(p);
|
|
1677
1722
|
} catch {
|
|
1678
1723
|
try {
|
|
1679
|
-
return path8.join(await
|
|
1724
|
+
return path8.join(await fs9.realpath(path8.dirname(p)), path8.basename(p));
|
|
1680
1725
|
} catch {
|
|
1681
1726
|
return p;
|
|
1682
1727
|
}
|
|
@@ -1698,7 +1743,7 @@ function flowMemberKey(anchorDir, target) {
|
|
|
1698
1743
|
return `${anchorDir}\0${target}`;
|
|
1699
1744
|
}
|
|
1700
1745
|
async function classifyOnDiskSpelling(dir, base, addressable = FLOW_FILE_NAME_PATTERN) {
|
|
1701
|
-
const entries = await
|
|
1746
|
+
const entries = await fs9.readdir(dir).catch(() => null);
|
|
1702
1747
|
if (entries === null || entries.includes(base)) return { state: "listed" };
|
|
1703
1748
|
const actual = entries.find((entry) => entry.toLowerCase() === base.toLowerCase());
|
|
1704
1749
|
if (actual === void 0) return { state: "absent" };
|
|
@@ -1736,11 +1781,11 @@ function nestedFlowTarget(args) {
|
|
|
1736
1781
|
function isResolvedAbsolute(value) {
|
|
1737
1782
|
return typeof value === "string" && path8.isAbsolute(value) && !value.split(/[\\/]+/).includes("..");
|
|
1738
1783
|
}
|
|
1739
|
-
var
|
|
1784
|
+
var fs9, path8, MAX_RUN_DEPTH;
|
|
1740
1785
|
var init_flow_file_refs = __esm({
|
|
1741
1786
|
"../registry/src/flow-file-refs.ts"() {
|
|
1742
1787
|
"use strict";
|
|
1743
|
-
|
|
1788
|
+
fs9 = __toESM(require("node:fs/promises"));
|
|
1744
1789
|
path8 = __toESM(require("node:path"));
|
|
1745
1790
|
init_file_inputs();
|
|
1746
1791
|
init_e2e_dirs();
|
|
@@ -22924,7 +22969,7 @@ function formatInteractionMessage(format, fallback) {
|
|
|
22924
22969
|
return fallback;
|
|
22925
22970
|
}
|
|
22926
22971
|
}
|
|
22927
|
-
var
|
|
22972
|
+
var import_node_crypto3, import_node_async_hooks, resolvedDuringInvocation, Registry, MAX_UNION_ALTERNATIVES;
|
|
22928
22973
|
var init_registry = __esm({
|
|
22929
22974
|
"../registry/src/registry.ts"() {
|
|
22930
22975
|
"use strict";
|
|
@@ -22936,7 +22981,7 @@ var init_registry = __esm({
|
|
|
22936
22981
|
init_tool_ids();
|
|
22937
22982
|
init_urn();
|
|
22938
22983
|
init_zod_to_json_schema();
|
|
22939
|
-
|
|
22984
|
+
import_node_crypto3 = require("node:crypto");
|
|
22940
22985
|
import_node_async_hooks = require("node:async_hooks");
|
|
22941
22986
|
resolvedDuringInvocation = new import_node_async_hooks.AsyncLocalStorage();
|
|
22942
22987
|
Registry = class {
|
|
@@ -23014,7 +23059,7 @@ var init_registry = __esm({
|
|
|
23014
23059
|
throw new ToolNotFoundError(id);
|
|
23015
23060
|
}
|
|
23016
23061
|
const startTime = performance.now();
|
|
23017
|
-
const toolInvocationId = options?.toolInvocationId ?? (0,
|
|
23062
|
+
const toolInvocationId = options?.toolInvocationId ?? (0, import_node_crypto3.randomUUID)();
|
|
23018
23063
|
let effectiveParams = params;
|
|
23019
23064
|
const startedMsg = formatInteractionMessage(
|
|
23020
23065
|
() => definition.interaction?.startedMsg?.({ params: effectiveParams }),
|
|
@@ -43464,7 +43509,7 @@ var require_view = __commonJS({
|
|
|
43464
43509
|
"use strict";
|
|
43465
43510
|
var debug = require_src()("express:view");
|
|
43466
43511
|
var path78 = require("node:path");
|
|
43467
|
-
var
|
|
43512
|
+
var fs96 = require("node:fs");
|
|
43468
43513
|
var dirname30 = path78.dirname;
|
|
43469
43514
|
var basename25 = path78.basename;
|
|
43470
43515
|
var extname7 = path78.extname;
|
|
@@ -43544,7 +43589,7 @@ var require_view = __commonJS({
|
|
|
43544
43589
|
function tryStat(path79) {
|
|
43545
43590
|
debug('stat "%s"', path79);
|
|
43546
43591
|
try {
|
|
43547
|
-
return
|
|
43592
|
+
return fs96.statSync(path79);
|
|
43548
43593
|
} catch (e) {
|
|
43549
43594
|
return void 0;
|
|
43550
43595
|
}
|
|
@@ -47465,7 +47510,7 @@ var require_send = __commonJS({
|
|
|
47465
47510
|
var escapeHtml = require_escape_html();
|
|
47466
47511
|
var etag = require_etag();
|
|
47467
47512
|
var fresh = require_fresh();
|
|
47468
|
-
var
|
|
47513
|
+
var fs96 = require("fs");
|
|
47469
47514
|
var mime = require_mime_types();
|
|
47470
47515
|
var ms3 = require_ms();
|
|
47471
47516
|
var onFinished = require_on_finished();
|
|
@@ -47747,7 +47792,7 @@ var require_send = __commonJS({
|
|
|
47747
47792
|
var i = 0;
|
|
47748
47793
|
var self2 = this;
|
|
47749
47794
|
debug('stat "%s"', path79);
|
|
47750
|
-
|
|
47795
|
+
fs96.stat(path79, function onstat(err, stat11) {
|
|
47751
47796
|
var pathEndsWithSep = path79[path79.length - 1] === sep12;
|
|
47752
47797
|
if (err && err.code === "ENOENT" && !extname7(path79) && !pathEndsWithSep) {
|
|
47753
47798
|
return next(err);
|
|
@@ -47764,7 +47809,7 @@ var require_send = __commonJS({
|
|
|
47764
47809
|
}
|
|
47765
47810
|
var p = path79 + "." + self2._extensions[i++];
|
|
47766
47811
|
debug('stat "%s"', p);
|
|
47767
|
-
|
|
47812
|
+
fs96.stat(p, function(err2, stat11) {
|
|
47768
47813
|
if (err2) return next(err2);
|
|
47769
47814
|
if (stat11.isDirectory()) return next();
|
|
47770
47815
|
self2.emit("file", p, stat11);
|
|
@@ -47782,7 +47827,7 @@ var require_send = __commonJS({
|
|
|
47782
47827
|
}
|
|
47783
47828
|
var p = join84(path79, self2._index[i]);
|
|
47784
47829
|
debug('stat "%s"', p);
|
|
47785
|
-
|
|
47830
|
+
fs96.stat(p, function(err2, stat11) {
|
|
47786
47831
|
if (err2) return next(err2);
|
|
47787
47832
|
if (stat11.isDirectory()) return next();
|
|
47788
47833
|
self2.emit("file", p, stat11);
|
|
@@ -47794,7 +47839,7 @@ var require_send = __commonJS({
|
|
|
47794
47839
|
SendStream.prototype.stream = function stream(path79, options) {
|
|
47795
47840
|
var self2 = this;
|
|
47796
47841
|
var res = this.res;
|
|
47797
|
-
var stream2 =
|
|
47842
|
+
var stream2 = fs96.createReadStream(path79, options);
|
|
47798
47843
|
this.emit("stream", stream2);
|
|
47799
47844
|
stream2.pipe(res);
|
|
47800
47845
|
function cleanup() {
|
|
@@ -49614,10 +49659,10 @@ var require_truncate = __commonJS({
|
|
|
49614
49659
|
"../../node_modules/semver/functions/truncate.js"(exports2, module2) {
|
|
49615
49660
|
"use strict";
|
|
49616
49661
|
var parse5 = require_parse2();
|
|
49617
|
-
var
|
|
49662
|
+
var constants4 = require_constants();
|
|
49618
49663
|
var SemVer = require_semver();
|
|
49619
49664
|
var truncate = (version3, truncation, options) => {
|
|
49620
|
-
if (!
|
|
49665
|
+
if (!constants4.RELEASE_TYPES.includes(truncation)) {
|
|
49621
49666
|
return null;
|
|
49622
49667
|
}
|
|
49623
49668
|
const clonedVersion = cloneInputVersion(version3, options);
|
|
@@ -50666,7 +50711,7 @@ var require_semver2 = __commonJS({
|
|
|
50666
50711
|
"../../node_modules/semver/index.js"(exports2, module2) {
|
|
50667
50712
|
"use strict";
|
|
50668
50713
|
var internalRe = require_re();
|
|
50669
|
-
var
|
|
50714
|
+
var constants4 = require_constants();
|
|
50670
50715
|
var SemVer = require_semver();
|
|
50671
50716
|
var identifiers = require_identifiers();
|
|
50672
50717
|
var parse5 = require_parse2();
|
|
@@ -50750,8 +50795,8 @@ var require_semver2 = __commonJS({
|
|
|
50750
50795
|
re: internalRe.re,
|
|
50751
50796
|
src: internalRe.src,
|
|
50752
50797
|
tokens: internalRe.t,
|
|
50753
|
-
SEMVER_SPEC_VERSION:
|
|
50754
|
-
RELEASE_TYPES:
|
|
50798
|
+
SEMVER_SPEC_VERSION: constants4.SEMVER_SPEC_VERSION,
|
|
50799
|
+
RELEASE_TYPES: constants4.RELEASE_TYPES,
|
|
50755
50800
|
compareIdentifiers: identifiers.compareIdentifiers,
|
|
50756
50801
|
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
50757
50802
|
};
|
|
@@ -51059,7 +51104,7 @@ function allMarkers() {
|
|
|
51059
51104
|
let mtimeMs;
|
|
51060
51105
|
try {
|
|
51061
51106
|
if (!dir) throw new Error("no trusted markers directory");
|
|
51062
|
-
mtimeMs =
|
|
51107
|
+
mtimeMs = fs17.statSync(dir).mtimeMs;
|
|
51063
51108
|
} catch {
|
|
51064
51109
|
markers = null;
|
|
51065
51110
|
return /* @__PURE__ */ new Map();
|
|
@@ -51074,15 +51119,15 @@ function allMarkers() {
|
|
|
51074
51119
|
function registerCloudAndroidSerial(serial, lease) {
|
|
51075
51120
|
const dir = prepareCloudAndroidMarkersDir();
|
|
51076
51121
|
const file2 = cloudAndroidMarkerFile(serial, dir);
|
|
51077
|
-
const tmp = `${file2}.${(0,
|
|
51122
|
+
const tmp = `${file2}.${(0, import_node_crypto6.randomBytes)(8).toString("hex")}.tmp`;
|
|
51078
51123
|
try {
|
|
51079
|
-
|
|
51124
|
+
fs17.writeFileSync(tmp, JSON.stringify({ serial, pid: process.pid, lease }), {
|
|
51080
51125
|
flag: "wx",
|
|
51081
51126
|
mode: 384
|
|
51082
51127
|
});
|
|
51083
|
-
|
|
51128
|
+
fs17.renameSync(tmp, file2);
|
|
51084
51129
|
} catch (err) {
|
|
51085
|
-
|
|
51130
|
+
fs17.rmSync(tmp, { force: true });
|
|
51086
51131
|
throw err;
|
|
51087
51132
|
}
|
|
51088
51133
|
}
|
|
@@ -51095,7 +51140,7 @@ function refreshCloudAndroidSerial(serial, lease) {
|
|
|
51095
51140
|
}
|
|
51096
51141
|
const now = /* @__PURE__ */ new Date();
|
|
51097
51142
|
try {
|
|
51098
|
-
|
|
51143
|
+
fs17.utimesSync(file2, now, now);
|
|
51099
51144
|
} catch {
|
|
51100
51145
|
}
|
|
51101
51146
|
}
|
|
@@ -51104,7 +51149,7 @@ function unregisterCloudAndroidSerial(serial, lease) {
|
|
|
51104
51149
|
const marker = readCloudAndroidMarker(file2);
|
|
51105
51150
|
if (!marker || marker.pid !== process.pid || marker.lease !== lease) return;
|
|
51106
51151
|
try {
|
|
51107
|
-
|
|
51152
|
+
fs17.unlinkSync(file2);
|
|
51108
51153
|
} catch {
|
|
51109
51154
|
}
|
|
51110
51155
|
}
|
|
@@ -51117,7 +51162,7 @@ function forgetOrphanedCloudAndroidSerial(serial) {
|
|
|
51117
51162
|
const marker = readCloudAndroidMarker(file2);
|
|
51118
51163
|
if (!marker || marker.pid === process.pid || isLiveCloudAndroidMarker(marker)) return;
|
|
51119
51164
|
try {
|
|
51120
|
-
|
|
51165
|
+
fs17.unlinkSync(file2);
|
|
51121
51166
|
} catch {
|
|
51122
51167
|
}
|
|
51123
51168
|
}
|
|
@@ -51132,12 +51177,12 @@ function isForeignCloudAndroidSerial(id) {
|
|
|
51132
51177
|
const marker = all.get(serial);
|
|
51133
51178
|
return marker !== void 0 && foreign(marker);
|
|
51134
51179
|
}
|
|
51135
|
-
var
|
|
51180
|
+
var fs17, import_node_crypto6, CLOUD_URL_ENV2, CLOUD_API_KEY_ENV2, captured, markers, LOOPBACK_HOST;
|
|
51136
51181
|
var init_config2 = __esm({
|
|
51137
51182
|
"../tool-server/src/utils/cloud-android/config.ts"() {
|
|
51138
51183
|
"use strict";
|
|
51139
|
-
|
|
51140
|
-
|
|
51184
|
+
fs17 = __toESM(require("node:fs"));
|
|
51185
|
+
import_node_crypto6 = require("node:crypto");
|
|
51141
51186
|
init_src();
|
|
51142
51187
|
CLOUD_URL_ENV2 = "ARGENT_CLOUD_URL";
|
|
51143
51188
|
CLOUD_API_KEY_ENV2 = "ARGENT_CLOUD_API_KEY";
|
|
@@ -51574,7 +51619,7 @@ function warnOnce(key2, message) {
|
|
|
51574
51619
|
function readProviderFile(file2) {
|
|
51575
51620
|
let raw;
|
|
51576
51621
|
try {
|
|
51577
|
-
raw =
|
|
51622
|
+
raw = fs18.readFileSync(file2, "utf8");
|
|
51578
51623
|
} catch {
|
|
51579
51624
|
return void 0;
|
|
51580
51625
|
}
|
|
@@ -51624,7 +51669,7 @@ function discoverProviders() {
|
|
|
51624
51669
|
function descriptorFiles() {
|
|
51625
51670
|
const directory = providersDirectory();
|
|
51626
51671
|
try {
|
|
51627
|
-
return
|
|
51672
|
+
return fs18.readdirSync(directory).filter((name) => name.endsWith(".json")).sort().map((name) => path16.join(directory, name));
|
|
51628
51673
|
} catch {
|
|
51629
51674
|
return [];
|
|
51630
51675
|
}
|
|
@@ -51685,11 +51730,11 @@ function readProviderDevices(record2, classify) {
|
|
|
51685
51730
|
}
|
|
51686
51731
|
return out;
|
|
51687
51732
|
}
|
|
51688
|
-
var
|
|
51733
|
+
var fs18, os3, path16, DISABLE_ENV, OVERRIDE_ENV, warnedOnce;
|
|
51689
51734
|
var init_read = __esm({
|
|
51690
51735
|
"../device-providers/src/read.ts"() {
|
|
51691
51736
|
"use strict";
|
|
51692
|
-
|
|
51737
|
+
fs18 = __toESM(require("node:fs"));
|
|
51693
51738
|
os3 = __toESM(require("node:os"));
|
|
51694
51739
|
path16 = __toESM(require("node:path"));
|
|
51695
51740
|
init_contract();
|
|
@@ -51886,9 +51931,9 @@ function trackedMacosAppsFile() {
|
|
|
51886
51931
|
}
|
|
51887
51932
|
function trackedRecords() {
|
|
51888
51933
|
const file2 = trackedMacosAppsFile();
|
|
51889
|
-
const { ino, mtimeMs, size } =
|
|
51934
|
+
const { ino, mtimeMs, size } = fs19.statSync(file2);
|
|
51890
51935
|
if (parsed?.file !== file2 || parsed.ino !== ino || parsed.mtimeMs !== mtimeMs || parsed.size !== size) {
|
|
51891
|
-
const records = JSON.parse(
|
|
51936
|
+
const records = JSON.parse(fs19.readFileSync(file2, "utf8"));
|
|
51892
51937
|
const catalyst = /* @__PURE__ */ new Set();
|
|
51893
51938
|
const vendorIds = /* @__PURE__ */ new Map();
|
|
51894
51939
|
for (const record2 of Array.isArray(records) ? records : []) {
|
|
@@ -51919,11 +51964,11 @@ function trackedMacosAppVendorId(bundleId) {
|
|
|
51919
51964
|
return void 0;
|
|
51920
51965
|
}
|
|
51921
51966
|
}
|
|
51922
|
-
var
|
|
51967
|
+
var fs19, path17, parsed;
|
|
51923
51968
|
var init_macos_app_kind = __esm({
|
|
51924
51969
|
"../tool-server/src/utils/macos-app-kind.ts"() {
|
|
51925
51970
|
"use strict";
|
|
51926
|
-
|
|
51971
|
+
fs19 = __toESM(require("node:fs"));
|
|
51927
51972
|
path17 = __toESM(require("node:path"));
|
|
51928
51973
|
init_src();
|
|
51929
51974
|
parsed = null;
|
|
@@ -59682,14 +59727,14 @@ var require_parser = __commonJS({
|
|
|
59682
59727
|
case "scalar":
|
|
59683
59728
|
case "single-quoted-scalar":
|
|
59684
59729
|
case "double-quoted-scalar": {
|
|
59685
|
-
const
|
|
59730
|
+
const fs96 = this.flowScalar(this.type);
|
|
59686
59731
|
if (atNextItem || it.value) {
|
|
59687
|
-
map2.items.push({ start: start2, key:
|
|
59732
|
+
map2.items.push({ start: start2, key: fs96, sep: [] });
|
|
59688
59733
|
this.onKeyLine = true;
|
|
59689
59734
|
} else if (it.sep) {
|
|
59690
|
-
this.stack.push(
|
|
59735
|
+
this.stack.push(fs96);
|
|
59691
59736
|
} else {
|
|
59692
|
-
Object.assign(it, { key:
|
|
59737
|
+
Object.assign(it, { key: fs96, sep: [] });
|
|
59693
59738
|
this.onKeyLine = true;
|
|
59694
59739
|
}
|
|
59695
59740
|
return;
|
|
@@ -59817,13 +59862,13 @@ var require_parser = __commonJS({
|
|
|
59817
59862
|
case "scalar":
|
|
59818
59863
|
case "single-quoted-scalar":
|
|
59819
59864
|
case "double-quoted-scalar": {
|
|
59820
|
-
const
|
|
59865
|
+
const fs96 = this.flowScalar(this.type);
|
|
59821
59866
|
if (!it || it.value)
|
|
59822
|
-
fc.items.push({ start: [], key:
|
|
59867
|
+
fc.items.push({ start: [], key: fs96, sep: [] });
|
|
59823
59868
|
else if (it.sep)
|
|
59824
|
-
this.stack.push(
|
|
59869
|
+
this.stack.push(fs96);
|
|
59825
59870
|
else
|
|
59826
|
-
Object.assign(it, { key:
|
|
59871
|
+
Object.assign(it, { key: fs96, sep: [] });
|
|
59827
59872
|
return;
|
|
59828
59873
|
}
|
|
59829
59874
|
case "flow-map-end":
|
|
@@ -62370,7 +62415,7 @@ var require_websocket = __commonJS({
|
|
|
62370
62415
|
var http8 = require("http");
|
|
62371
62416
|
var net14 = require("net");
|
|
62372
62417
|
var tls = require("tls");
|
|
62373
|
-
var { randomBytes:
|
|
62418
|
+
var { randomBytes: randomBytes6, createHash: createHash12 } = require("crypto");
|
|
62374
62419
|
var { Duplex: Duplex2, Readable: Readable2 } = require("stream");
|
|
62375
62420
|
var { URL: URL2 } = require("url");
|
|
62376
62421
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -62921,7 +62966,7 @@ var require_websocket = __commonJS({
|
|
|
62921
62966
|
}
|
|
62922
62967
|
}
|
|
62923
62968
|
const defaultPort = isSecure2 ? 443 : 80;
|
|
62924
|
-
const key2 =
|
|
62969
|
+
const key2 = randomBytes6(16).toString("base64");
|
|
62925
62970
|
const request4 = isSecure2 ? https2.request : http8.request;
|
|
62926
62971
|
const protocolSet = /* @__PURE__ */ new Set();
|
|
62927
62972
|
let perMessageDeflate;
|
|
@@ -64329,7 +64374,7 @@ var require_crc = __commonJS({
|
|
|
64329
64374
|
var require_parser2 = __commonJS({
|
|
64330
64375
|
"../../node_modules/pngjs/lib/parser.js"(exports2, module2) {
|
|
64331
64376
|
"use strict";
|
|
64332
|
-
var
|
|
64377
|
+
var constants4 = require_constants3();
|
|
64333
64378
|
var CrcCalculator = require_crc();
|
|
64334
64379
|
var Parser2 = module2.exports = function(options, dependencies) {
|
|
64335
64380
|
this._options = options;
|
|
@@ -64340,12 +64385,12 @@ var require_parser2 = __commonJS({
|
|
|
64340
64385
|
this._palette = [];
|
|
64341
64386
|
this._colorType = 0;
|
|
64342
64387
|
this._chunks = {};
|
|
64343
|
-
this._chunks[
|
|
64344
|
-
this._chunks[
|
|
64345
|
-
this._chunks[
|
|
64346
|
-
this._chunks[
|
|
64347
|
-
this._chunks[
|
|
64348
|
-
this._chunks[
|
|
64388
|
+
this._chunks[constants4.TYPE_IHDR] = this._handleIHDR.bind(this);
|
|
64389
|
+
this._chunks[constants4.TYPE_IEND] = this._handleIEND.bind(this);
|
|
64390
|
+
this._chunks[constants4.TYPE_IDAT] = this._handleIDAT.bind(this);
|
|
64391
|
+
this._chunks[constants4.TYPE_PLTE] = this._handlePLTE.bind(this);
|
|
64392
|
+
this._chunks[constants4.TYPE_tRNS] = this._handleTRNS.bind(this);
|
|
64393
|
+
this._chunks[constants4.TYPE_gAMA] = this._handleGAMA.bind(this);
|
|
64349
64394
|
this.read = dependencies.read;
|
|
64350
64395
|
this.error = dependencies.error;
|
|
64351
64396
|
this.metadata = dependencies.metadata;
|
|
@@ -64360,10 +64405,10 @@ var require_parser2 = __commonJS({
|
|
|
64360
64405
|
};
|
|
64361
64406
|
};
|
|
64362
64407
|
Parser2.prototype.start = function() {
|
|
64363
|
-
this.read(
|
|
64408
|
+
this.read(constants4.PNG_SIGNATURE.length, this._parseSignature.bind(this));
|
|
64364
64409
|
};
|
|
64365
64410
|
Parser2.prototype._parseSignature = function(data) {
|
|
64366
|
-
let signature =
|
|
64411
|
+
let signature = constants4.PNG_SIGNATURE;
|
|
64367
64412
|
for (let i = 0; i < signature.length; i++) {
|
|
64368
64413
|
if (data[i] !== signature[i]) {
|
|
64369
64414
|
this.error(new Error("Invalid file signature"));
|
|
@@ -64380,7 +64425,7 @@ var require_parser2 = __commonJS({
|
|
|
64380
64425
|
name += String.fromCharCode(data[i]);
|
|
64381
64426
|
}
|
|
64382
64427
|
let ancillary = Boolean(data[4] & 32);
|
|
64383
|
-
if (!this._hasIHDR && type !==
|
|
64428
|
+
if (!this._hasIHDR && type !== constants4.TYPE_IHDR) {
|
|
64384
64429
|
this.error(new Error("Expected IHDR on beggining"));
|
|
64385
64430
|
return;
|
|
64386
64431
|
}
|
|
@@ -64428,7 +64473,7 @@ var require_parser2 = __commonJS({
|
|
|
64428
64473
|
this.error(new Error("Unsupported bit depth " + depth));
|
|
64429
64474
|
return;
|
|
64430
64475
|
}
|
|
64431
|
-
if (!(colorType in
|
|
64476
|
+
if (!(colorType in constants4.COLORTYPE_TO_BPP_MAP)) {
|
|
64432
64477
|
this.error(new Error("Unsupported color type"));
|
|
64433
64478
|
return;
|
|
64434
64479
|
}
|
|
@@ -64445,16 +64490,16 @@ var require_parser2 = __commonJS({
|
|
|
64445
64490
|
return;
|
|
64446
64491
|
}
|
|
64447
64492
|
this._colorType = colorType;
|
|
64448
|
-
let bpp =
|
|
64493
|
+
let bpp = constants4.COLORTYPE_TO_BPP_MAP[this._colorType];
|
|
64449
64494
|
this._hasIHDR = true;
|
|
64450
64495
|
this.metadata({
|
|
64451
64496
|
width,
|
|
64452
64497
|
height,
|
|
64453
64498
|
depth,
|
|
64454
64499
|
interlace: Boolean(interlace),
|
|
64455
|
-
palette: Boolean(colorType &
|
|
64456
|
-
color: Boolean(colorType &
|
|
64457
|
-
alpha: Boolean(colorType &
|
|
64500
|
+
palette: Boolean(colorType & constants4.COLORTYPE_PALETTE),
|
|
64501
|
+
color: Boolean(colorType & constants4.COLORTYPE_COLOR),
|
|
64502
|
+
alpha: Boolean(colorType & constants4.COLORTYPE_ALPHA),
|
|
64458
64503
|
bpp,
|
|
64459
64504
|
colorType
|
|
64460
64505
|
});
|
|
@@ -64478,7 +64523,7 @@ var require_parser2 = __commonJS({
|
|
|
64478
64523
|
};
|
|
64479
64524
|
Parser2.prototype._parseTRNS = function(data) {
|
|
64480
64525
|
this._crc.write(data);
|
|
64481
|
-
if (this._colorType ===
|
|
64526
|
+
if (this._colorType === constants4.COLORTYPE_PALETTE_COLOR) {
|
|
64482
64527
|
if (this._palette.length === 0) {
|
|
64483
64528
|
this.error(new Error("Transparency chunk must be after palette"));
|
|
64484
64529
|
return;
|
|
@@ -64492,10 +64537,10 @@ var require_parser2 = __commonJS({
|
|
|
64492
64537
|
}
|
|
64493
64538
|
this.palette(this._palette);
|
|
64494
64539
|
}
|
|
64495
|
-
if (this._colorType ===
|
|
64540
|
+
if (this._colorType === constants4.COLORTYPE_GRAYSCALE) {
|
|
64496
64541
|
this.transColor([data.readUInt16BE(0)]);
|
|
64497
64542
|
}
|
|
64498
|
-
if (this._colorType ===
|
|
64543
|
+
if (this._colorType === constants4.COLORTYPE_COLOR) {
|
|
64499
64544
|
this.transColor([
|
|
64500
64545
|
data.readUInt16BE(0),
|
|
64501
64546
|
data.readUInt16BE(2),
|
|
@@ -64509,7 +64554,7 @@ var require_parser2 = __commonJS({
|
|
|
64509
64554
|
};
|
|
64510
64555
|
Parser2.prototype._parseGAMA = function(data) {
|
|
64511
64556
|
this._crc.write(data);
|
|
64512
|
-
this.gamma(data.readUInt32BE(0) /
|
|
64557
|
+
this.gamma(data.readUInt32BE(0) / constants4.GAMMA_DIVISION);
|
|
64513
64558
|
this._handleChunkEnd();
|
|
64514
64559
|
};
|
|
64515
64560
|
Parser2.prototype._handleIDAT = function(length) {
|
|
@@ -64521,7 +64566,7 @@ var require_parser2 = __commonJS({
|
|
|
64521
64566
|
};
|
|
64522
64567
|
Parser2.prototype._parseIDAT = function(length, data) {
|
|
64523
64568
|
this._crc.write(data);
|
|
64524
|
-
if (this._colorType ===
|
|
64569
|
+
if (this._colorType === constants4.COLORTYPE_PALETTE_COLOR && this._palette.length === 0) {
|
|
64525
64570
|
throw new Error("Expected palette not found");
|
|
64526
64571
|
}
|
|
64527
64572
|
this.inflateData(data);
|
|
@@ -65009,9 +65054,9 @@ var require_parser_async = __commonJS({
|
|
|
65009
65054
|
var require_bitpacker = __commonJS({
|
|
65010
65055
|
"../../node_modules/pngjs/lib/bitpacker.js"(exports2, module2) {
|
|
65011
65056
|
"use strict";
|
|
65012
|
-
var
|
|
65057
|
+
var constants4 = require_constants3();
|
|
65013
65058
|
module2.exports = function(dataIn, width, height, options) {
|
|
65014
|
-
let outHasAlpha = [
|
|
65059
|
+
let outHasAlpha = [constants4.COLORTYPE_COLOR_ALPHA, constants4.COLORTYPE_ALPHA].indexOf(
|
|
65015
65060
|
options.colorType
|
|
65016
65061
|
) !== -1;
|
|
65017
65062
|
if (options.colorType === options.inputColorType) {
|
|
@@ -65031,11 +65076,11 @@ var require_bitpacker = __commonJS({
|
|
|
65031
65076
|
}
|
|
65032
65077
|
let data = options.bitDepth !== 16 ? dataIn : new Uint16Array(dataIn.buffer);
|
|
65033
65078
|
let maxValue = 255;
|
|
65034
|
-
let inBpp =
|
|
65079
|
+
let inBpp = constants4.COLORTYPE_TO_BPP_MAP[options.inputColorType];
|
|
65035
65080
|
if (inBpp === 4 && !options.inputHasAlpha) {
|
|
65036
65081
|
inBpp = 3;
|
|
65037
65082
|
}
|
|
65038
|
-
let outBpp =
|
|
65083
|
+
let outBpp = constants4.COLORTYPE_TO_BPP_MAP[options.colorType];
|
|
65039
65084
|
if (options.bitDepth === 16) {
|
|
65040
65085
|
maxValue = 65535;
|
|
65041
65086
|
outBpp *= 2;
|
|
@@ -65059,24 +65104,24 @@ var require_bitpacker = __commonJS({
|
|
|
65059
65104
|
let blue;
|
|
65060
65105
|
let alpha = maxValue;
|
|
65061
65106
|
switch (options.inputColorType) {
|
|
65062
|
-
case
|
|
65107
|
+
case constants4.COLORTYPE_COLOR_ALPHA:
|
|
65063
65108
|
alpha = data[inIndex + 3];
|
|
65064
65109
|
red = data[inIndex];
|
|
65065
65110
|
green = data[inIndex + 1];
|
|
65066
65111
|
blue = data[inIndex + 2];
|
|
65067
65112
|
break;
|
|
65068
|
-
case
|
|
65113
|
+
case constants4.COLORTYPE_COLOR:
|
|
65069
65114
|
red = data[inIndex];
|
|
65070
65115
|
green = data[inIndex + 1];
|
|
65071
65116
|
blue = data[inIndex + 2];
|
|
65072
65117
|
break;
|
|
65073
|
-
case
|
|
65118
|
+
case constants4.COLORTYPE_ALPHA:
|
|
65074
65119
|
alpha = data[inIndex + 1];
|
|
65075
65120
|
red = data[inIndex];
|
|
65076
65121
|
green = red;
|
|
65077
65122
|
blue = red;
|
|
65078
65123
|
break;
|
|
65079
|
-
case
|
|
65124
|
+
case constants4.COLORTYPE_GRAYSCALE:
|
|
65080
65125
|
red = data[inIndex];
|
|
65081
65126
|
green = red;
|
|
65082
65127
|
blue = red;
|
|
@@ -65109,8 +65154,8 @@ var require_bitpacker = __commonJS({
|
|
|
65109
65154
|
for (let x = 0; x < width; x++) {
|
|
65110
65155
|
let rgba = getRGBA(data, inIndex);
|
|
65111
65156
|
switch (options.colorType) {
|
|
65112
|
-
case
|
|
65113
|
-
case
|
|
65157
|
+
case constants4.COLORTYPE_COLOR_ALPHA:
|
|
65158
|
+
case constants4.COLORTYPE_COLOR:
|
|
65114
65159
|
if (options.bitDepth === 8) {
|
|
65115
65160
|
outData[outIndex] = rgba.red;
|
|
65116
65161
|
outData[outIndex + 1] = rgba.green;
|
|
@@ -65127,8 +65172,8 @@ var require_bitpacker = __commonJS({
|
|
|
65127
65172
|
}
|
|
65128
65173
|
}
|
|
65129
65174
|
break;
|
|
65130
|
-
case
|
|
65131
|
-
case
|
|
65175
|
+
case constants4.COLORTYPE_ALPHA:
|
|
65176
|
+
case constants4.COLORTYPE_GRAYSCALE: {
|
|
65132
65177
|
let grayscale = (rgba.red + rgba.green + rgba.blue) / 3;
|
|
65133
65178
|
if (options.bitDepth === 8) {
|
|
65134
65179
|
outData[outIndex] = grayscale;
|
|
@@ -65301,7 +65346,7 @@ var require_filter_pack = __commonJS({
|
|
|
65301
65346
|
var require_packer = __commonJS({
|
|
65302
65347
|
"../../node_modules/pngjs/lib/packer.js"(exports2, module2) {
|
|
65303
65348
|
"use strict";
|
|
65304
|
-
var
|
|
65349
|
+
var constants4 = require_constants3();
|
|
65305
65350
|
var CrcStream = require_crc();
|
|
65306
65351
|
var bitPacker = require_bitpacker();
|
|
65307
65352
|
var filter = require_filter_pack();
|
|
@@ -65314,23 +65359,23 @@ var require_packer = __commonJS({
|
|
|
65314
65359
|
options.inputHasAlpha = options.inputHasAlpha != null ? options.inputHasAlpha : true;
|
|
65315
65360
|
options.deflateFactory = options.deflateFactory || zlib4.createDeflate;
|
|
65316
65361
|
options.bitDepth = options.bitDepth || 8;
|
|
65317
|
-
options.colorType = typeof options.colorType === "number" ? options.colorType :
|
|
65318
|
-
options.inputColorType = typeof options.inputColorType === "number" ? options.inputColorType :
|
|
65362
|
+
options.colorType = typeof options.colorType === "number" ? options.colorType : constants4.COLORTYPE_COLOR_ALPHA;
|
|
65363
|
+
options.inputColorType = typeof options.inputColorType === "number" ? options.inputColorType : constants4.COLORTYPE_COLOR_ALPHA;
|
|
65319
65364
|
if ([
|
|
65320
|
-
|
|
65321
|
-
|
|
65322
|
-
|
|
65323
|
-
|
|
65365
|
+
constants4.COLORTYPE_GRAYSCALE,
|
|
65366
|
+
constants4.COLORTYPE_COLOR,
|
|
65367
|
+
constants4.COLORTYPE_COLOR_ALPHA,
|
|
65368
|
+
constants4.COLORTYPE_ALPHA
|
|
65324
65369
|
].indexOf(options.colorType) === -1) {
|
|
65325
65370
|
throw new Error(
|
|
65326
65371
|
"option color type:" + options.colorType + " is not supported at present"
|
|
65327
65372
|
);
|
|
65328
65373
|
}
|
|
65329
65374
|
if ([
|
|
65330
|
-
|
|
65331
|
-
|
|
65332
|
-
|
|
65333
|
-
|
|
65375
|
+
constants4.COLORTYPE_GRAYSCALE,
|
|
65376
|
+
constants4.COLORTYPE_COLOR,
|
|
65377
|
+
constants4.COLORTYPE_COLOR_ALPHA,
|
|
65378
|
+
constants4.COLORTYPE_ALPHA
|
|
65334
65379
|
].indexOf(options.inputColorType) === -1) {
|
|
65335
65380
|
throw new Error(
|
|
65336
65381
|
"option input color type:" + options.inputColorType + " is not supported at present"
|
|
@@ -65354,7 +65399,7 @@ var require_packer = __commonJS({
|
|
|
65354
65399
|
};
|
|
65355
65400
|
Packer.prototype.filterData = function(data, width, height) {
|
|
65356
65401
|
let packedData = bitPacker(data, width, height, this._options);
|
|
65357
|
-
let bpp =
|
|
65402
|
+
let bpp = constants4.COLORTYPE_TO_BPP_MAP[this._options.colorType];
|
|
65358
65403
|
let filteredData = filter(packedData, width, height, this._options, bpp);
|
|
65359
65404
|
return filteredData;
|
|
65360
65405
|
};
|
|
@@ -65374,8 +65419,8 @@ var require_packer = __commonJS({
|
|
|
65374
65419
|
};
|
|
65375
65420
|
Packer.prototype.packGAMA = function(gamma) {
|
|
65376
65421
|
let buf = Buffer.alloc(4);
|
|
65377
|
-
buf.writeUInt32BE(Math.floor(gamma *
|
|
65378
|
-
return this._packChunk(
|
|
65422
|
+
buf.writeUInt32BE(Math.floor(gamma * constants4.GAMMA_DIVISION), 0);
|
|
65423
|
+
return this._packChunk(constants4.TYPE_gAMA, buf);
|
|
65379
65424
|
};
|
|
65380
65425
|
Packer.prototype.packIHDR = function(width, height) {
|
|
65381
65426
|
let buf = Buffer.alloc(13);
|
|
@@ -65386,13 +65431,13 @@ var require_packer = __commonJS({
|
|
|
65386
65431
|
buf[10] = 0;
|
|
65387
65432
|
buf[11] = 0;
|
|
65388
65433
|
buf[12] = 0;
|
|
65389
|
-
return this._packChunk(
|
|
65434
|
+
return this._packChunk(constants4.TYPE_IHDR, buf);
|
|
65390
65435
|
};
|
|
65391
65436
|
Packer.prototype.packIDAT = function(data) {
|
|
65392
|
-
return this._packChunk(
|
|
65437
|
+
return this._packChunk(constants4.TYPE_IDAT, data);
|
|
65393
65438
|
};
|
|
65394
65439
|
Packer.prototype.packIEND = function() {
|
|
65395
|
-
return this._packChunk(
|
|
65440
|
+
return this._packChunk(constants4.TYPE_IEND, null);
|
|
65396
65441
|
};
|
|
65397
65442
|
}
|
|
65398
65443
|
});
|
|
@@ -65403,7 +65448,7 @@ var require_packer_async = __commonJS({
|
|
|
65403
65448
|
"use strict";
|
|
65404
65449
|
var util = require("util");
|
|
65405
65450
|
var Stream2 = require("stream");
|
|
65406
|
-
var
|
|
65451
|
+
var constants4 = require_constants3();
|
|
65407
65452
|
var Packer = require_packer();
|
|
65408
65453
|
var PackerAsync = module2.exports = function(opt) {
|
|
65409
65454
|
Stream2.call(this);
|
|
@@ -65414,7 +65459,7 @@ var require_packer_async = __commonJS({
|
|
|
65414
65459
|
};
|
|
65415
65460
|
util.inherits(PackerAsync, Stream2);
|
|
65416
65461
|
PackerAsync.prototype.pack = function(data, width, height, gamma) {
|
|
65417
|
-
this.emit("data", Buffer.from(
|
|
65462
|
+
this.emit("data", Buffer.from(constants4.PNG_SIGNATURE));
|
|
65418
65463
|
this.emit("data", this._packer.packIHDR(width, height));
|
|
65419
65464
|
if (gamma) {
|
|
65420
65465
|
this.emit("data", this._packer.packGAMA(gamma));
|
|
@@ -65742,7 +65787,7 @@ var require_packer_sync = __commonJS({
|
|
|
65742
65787
|
if (!zlib4.deflateSync) {
|
|
65743
65788
|
hasSyncZlib = false;
|
|
65744
65789
|
}
|
|
65745
|
-
var
|
|
65790
|
+
var constants4 = require_constants3();
|
|
65746
65791
|
var Packer = require_packer();
|
|
65747
65792
|
module2.exports = function(metaData, opt) {
|
|
65748
65793
|
if (!hasSyncZlib) {
|
|
@@ -65753,7 +65798,7 @@ var require_packer_sync = __commonJS({
|
|
|
65753
65798
|
let options = opt || {};
|
|
65754
65799
|
let packer = new Packer(options);
|
|
65755
65800
|
let chunks = [];
|
|
65756
|
-
chunks.push(Buffer.from(
|
|
65801
|
+
chunks.push(Buffer.from(constants4.PNG_SIGNATURE));
|
|
65757
65802
|
chunks.push(packer.packIHDR(metaData.width, metaData.height));
|
|
65758
65803
|
if (metaData.gamma) {
|
|
65759
65804
|
chunks.push(packer.packGAMA(metaData.gamma));
|
|
@@ -65991,7 +66036,7 @@ var require_safe_json_stringify = __commonJS({
|
|
|
65991
66036
|
// ../../node_modules/ncp/lib/ncp.js
|
|
65992
66037
|
var require_ncp = __commonJS({
|
|
65993
66038
|
"../../node_modules/ncp/lib/ncp.js"(exports2, module2) {
|
|
65994
|
-
var
|
|
66039
|
+
var fs96 = require("fs");
|
|
65995
66040
|
var path78 = require("path");
|
|
65996
66041
|
module2.exports = ncp;
|
|
65997
66042
|
ncp.ncp = ncp;
|
|
@@ -66020,7 +66065,7 @@ var require_ncp = __commonJS({
|
|
|
66020
66065
|
return getStats(source2);
|
|
66021
66066
|
}
|
|
66022
66067
|
function getStats(source2) {
|
|
66023
|
-
var stat11 = dereference ?
|
|
66068
|
+
var stat11 = dereference ? fs96.stat : fs96.lstat;
|
|
66024
66069
|
if (running >= limit) {
|
|
66025
66070
|
return setImmediate(function() {
|
|
66026
66071
|
getStats(source2);
|
|
@@ -66060,7 +66105,7 @@ var require_ncp = __commonJS({
|
|
|
66060
66105
|
});
|
|
66061
66106
|
}
|
|
66062
66107
|
if (modified) {
|
|
66063
|
-
var stat11 = dereference ?
|
|
66108
|
+
var stat11 = dereference ? fs96.stat : fs96.lstat;
|
|
66064
66109
|
stat11(target, function(err, stats) {
|
|
66065
66110
|
if (file2.mtime.getTime() > stats.mtime.getTime())
|
|
66066
66111
|
copyFile(file2, target);
|
|
@@ -66072,7 +66117,7 @@ var require_ncp = __commonJS({
|
|
|
66072
66117
|
});
|
|
66073
66118
|
}
|
|
66074
66119
|
function copyFile(file2, target) {
|
|
66075
|
-
var readStream =
|
|
66120
|
+
var readStream = fs96.createReadStream(file2.name), writeStream = fs96.createWriteStream(target, { mode: file2.mode });
|
|
66076
66121
|
readStream.on("error", onError);
|
|
66077
66122
|
writeStream.on("error", onError);
|
|
66078
66123
|
if (transform2) {
|
|
@@ -66084,13 +66129,13 @@ var require_ncp = __commonJS({
|
|
|
66084
66129
|
}
|
|
66085
66130
|
writeStream.once("finish", function() {
|
|
66086
66131
|
if (modified) {
|
|
66087
|
-
|
|
66132
|
+
fs96.utimesSync(target, file2.atime, file2.mtime);
|
|
66088
66133
|
cb();
|
|
66089
66134
|
} else cb();
|
|
66090
66135
|
});
|
|
66091
66136
|
}
|
|
66092
66137
|
function rmFile(file2, done) {
|
|
66093
|
-
|
|
66138
|
+
fs96.unlink(file2, function(err) {
|
|
66094
66139
|
if (err) {
|
|
66095
66140
|
return onError(err);
|
|
66096
66141
|
}
|
|
@@ -66107,7 +66152,7 @@ var require_ncp = __commonJS({
|
|
|
66107
66152
|
});
|
|
66108
66153
|
}
|
|
66109
66154
|
function mkDir(dir, target) {
|
|
66110
|
-
|
|
66155
|
+
fs96.mkdir(target, dir.mode, function(err) {
|
|
66111
66156
|
if (err) {
|
|
66112
66157
|
return onError(err);
|
|
66113
66158
|
}
|
|
@@ -66115,7 +66160,7 @@ var require_ncp = __commonJS({
|
|
|
66115
66160
|
});
|
|
66116
66161
|
}
|
|
66117
66162
|
function copyDir(dir) {
|
|
66118
|
-
|
|
66163
|
+
fs96.readdir(dir, function(err, items) {
|
|
66119
66164
|
if (err) {
|
|
66120
66165
|
return onError(err);
|
|
66121
66166
|
}
|
|
@@ -66127,7 +66172,7 @@ var require_ncp = __commonJS({
|
|
|
66127
66172
|
}
|
|
66128
66173
|
function onLink(link) {
|
|
66129
66174
|
var target = link.replace(currentPath, targetPath);
|
|
66130
|
-
|
|
66175
|
+
fs96.readlink(link, function(err, resolvedPath2) {
|
|
66131
66176
|
if (err) {
|
|
66132
66177
|
return onError(err);
|
|
66133
66178
|
}
|
|
@@ -66142,7 +66187,7 @@ var require_ncp = __commonJS({
|
|
|
66142
66187
|
if (writable) {
|
|
66143
66188
|
return makeLink(resolvedPath2, target);
|
|
66144
66189
|
}
|
|
66145
|
-
|
|
66190
|
+
fs96.readlink(target, function(err, targetDest) {
|
|
66146
66191
|
if (err) {
|
|
66147
66192
|
return onError(err);
|
|
66148
66193
|
}
|
|
@@ -66159,7 +66204,7 @@ var require_ncp = __commonJS({
|
|
|
66159
66204
|
});
|
|
66160
66205
|
}
|
|
66161
66206
|
function makeLink(linkPath, target) {
|
|
66162
|
-
|
|
66207
|
+
fs96.symlink(linkPath, target, function(err) {
|
|
66163
66208
|
if (err) {
|
|
66164
66209
|
return onError(err);
|
|
66165
66210
|
}
|
|
@@ -66167,7 +66212,7 @@ var require_ncp = __commonJS({
|
|
|
66167
66212
|
});
|
|
66168
66213
|
}
|
|
66169
66214
|
function isWritable2(path79, done) {
|
|
66170
|
-
|
|
66215
|
+
fs96.lstat(path79, function(err) {
|
|
66171
66216
|
if (err) {
|
|
66172
66217
|
if (err.code === "ENOENT") return done(true);
|
|
66173
66218
|
return done(false);
|
|
@@ -66179,7 +66224,7 @@ var require_ncp = __commonJS({
|
|
|
66179
66224
|
if (options.stopOnError) {
|
|
66180
66225
|
return cback(err);
|
|
66181
66226
|
} else if (!errs && options.errs) {
|
|
66182
|
-
errs =
|
|
66227
|
+
errs = fs96.createWriteStream(options.errs);
|
|
66183
66228
|
} else if (!errs) {
|
|
66184
66229
|
errs = [];
|
|
66185
66230
|
}
|
|
@@ -67308,7 +67353,7 @@ var require_sync = __commonJS({
|
|
|
67308
67353
|
"../../node_modules/glob/sync.js"(exports2, module2) {
|
|
67309
67354
|
module2.exports = globSync;
|
|
67310
67355
|
globSync.GlobSync = GlobSync;
|
|
67311
|
-
var
|
|
67356
|
+
var fs96 = require("fs");
|
|
67312
67357
|
var minimatch = require_minimatch();
|
|
67313
67358
|
var Minimatch = minimatch.Minimatch;
|
|
67314
67359
|
var Glob = require_glob().Glob;
|
|
@@ -67353,7 +67398,7 @@ var require_sync = __commonJS({
|
|
|
67353
67398
|
for (var p in matchset) {
|
|
67354
67399
|
try {
|
|
67355
67400
|
p = self2._makeAbs(p);
|
|
67356
|
-
var real =
|
|
67401
|
+
var real = fs96.realpathSync(p, self2.realpathCache);
|
|
67357
67402
|
set2[real] = true;
|
|
67358
67403
|
} catch (er) {
|
|
67359
67404
|
if (er.syscall === "stat")
|
|
@@ -67480,7 +67525,7 @@ var require_sync = __commonJS({
|
|
|
67480
67525
|
var lstat;
|
|
67481
67526
|
var stat11;
|
|
67482
67527
|
try {
|
|
67483
|
-
lstat =
|
|
67528
|
+
lstat = fs96.lstatSync(abs);
|
|
67484
67529
|
} catch (er) {
|
|
67485
67530
|
return null;
|
|
67486
67531
|
}
|
|
@@ -67504,7 +67549,7 @@ var require_sync = __commonJS({
|
|
|
67504
67549
|
return c;
|
|
67505
67550
|
}
|
|
67506
67551
|
try {
|
|
67507
|
-
return this._readdirEntries(abs,
|
|
67552
|
+
return this._readdirEntries(abs, fs96.readdirSync(abs));
|
|
67508
67553
|
} catch (er) {
|
|
67509
67554
|
this._readdirError(abs, er);
|
|
67510
67555
|
return null;
|
|
@@ -67608,13 +67653,13 @@ var require_sync = __commonJS({
|
|
|
67608
67653
|
if (!stat11) {
|
|
67609
67654
|
var lstat;
|
|
67610
67655
|
try {
|
|
67611
|
-
lstat =
|
|
67656
|
+
lstat = fs96.lstatSync(abs);
|
|
67612
67657
|
} catch (er) {
|
|
67613
67658
|
return false;
|
|
67614
67659
|
}
|
|
67615
67660
|
if (lstat.isSymbolicLink()) {
|
|
67616
67661
|
try {
|
|
67617
|
-
stat11 =
|
|
67662
|
+
stat11 = fs96.statSync(abs);
|
|
67618
67663
|
} catch (er) {
|
|
67619
67664
|
stat11 = lstat;
|
|
67620
67665
|
}
|
|
@@ -67688,7 +67733,7 @@ var require_inflight = __commonJS({
|
|
|
67688
67733
|
var require_glob = __commonJS({
|
|
67689
67734
|
"../../node_modules/glob/glob.js"(exports2, module2) {
|
|
67690
67735
|
module2.exports = glob;
|
|
67691
|
-
var
|
|
67736
|
+
var fs96 = require("fs");
|
|
67692
67737
|
var minimatch = require_minimatch();
|
|
67693
67738
|
var Minimatch = minimatch.Minimatch;
|
|
67694
67739
|
var inherits = require_inherits();
|
|
@@ -67825,7 +67870,7 @@ var require_glob = __commonJS({
|
|
|
67825
67870
|
var set2 = this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
67826
67871
|
found.forEach(function(p, i) {
|
|
67827
67872
|
p = self2._makeAbs(p);
|
|
67828
|
-
|
|
67873
|
+
fs96.realpath(p, self2.realpathCache, function(er, real) {
|
|
67829
67874
|
if (!er)
|
|
67830
67875
|
set2[real] = true;
|
|
67831
67876
|
else if (er.syscall === "stat")
|
|
@@ -68020,7 +68065,7 @@ var require_glob = __commonJS({
|
|
|
68020
68065
|
var self2 = this;
|
|
68021
68066
|
var lstatcb = inflight(lstatkey, lstatcb_);
|
|
68022
68067
|
if (lstatcb)
|
|
68023
|
-
|
|
68068
|
+
fs96.lstat(abs, lstatcb);
|
|
68024
68069
|
function lstatcb_(er, lstat) {
|
|
68025
68070
|
if (er)
|
|
68026
68071
|
return cb();
|
|
@@ -68049,7 +68094,7 @@ var require_glob = __commonJS({
|
|
|
68049
68094
|
return cb(null, c);
|
|
68050
68095
|
}
|
|
68051
68096
|
var self2 = this;
|
|
68052
|
-
|
|
68097
|
+
fs96.readdir(abs, readdirCb(this, abs, cb));
|
|
68053
68098
|
};
|
|
68054
68099
|
function readdirCb(self2, abs, cb) {
|
|
68055
68100
|
return function(er, entries) {
|
|
@@ -68187,10 +68232,10 @@ var require_glob = __commonJS({
|
|
|
68187
68232
|
var self2 = this;
|
|
68188
68233
|
var statcb = inflight("stat\0" + abs, lstatcb_);
|
|
68189
68234
|
if (statcb)
|
|
68190
|
-
|
|
68235
|
+
fs96.lstat(abs, statcb);
|
|
68191
68236
|
function lstatcb_(er, lstat) {
|
|
68192
68237
|
if (lstat && lstat.isSymbolicLink()) {
|
|
68193
|
-
return
|
|
68238
|
+
return fs96.stat(abs, function(er2, stat12) {
|
|
68194
68239
|
if (er2)
|
|
68195
68240
|
self2._stat2(f, abs, null, lstat, cb);
|
|
68196
68241
|
else
|
|
@@ -68226,7 +68271,7 @@ var require_rimraf = __commonJS({
|
|
|
68226
68271
|
rimraf.sync = rimrafSync;
|
|
68227
68272
|
var assert2 = require("assert");
|
|
68228
68273
|
var path78 = require("path");
|
|
68229
|
-
var
|
|
68274
|
+
var fs96 = require("fs");
|
|
68230
68275
|
var glob = require_glob();
|
|
68231
68276
|
var globOpts = {
|
|
68232
68277
|
nosort: true,
|
|
@@ -68246,9 +68291,9 @@ var require_rimraf = __commonJS({
|
|
|
68246
68291
|
"readdir"
|
|
68247
68292
|
];
|
|
68248
68293
|
methods.forEach(function(m) {
|
|
68249
|
-
options[m] = options[m] ||
|
|
68294
|
+
options[m] = options[m] || fs96[m];
|
|
68250
68295
|
m = m + "Sync";
|
|
68251
|
-
options[m] = options[m] ||
|
|
68296
|
+
options[m] = options[m] || fs96[m];
|
|
68252
68297
|
});
|
|
68253
68298
|
options.maxBusyTries = options.maxBusyTries || 3;
|
|
68254
68299
|
options.emfileWait = options.emfileWait || 1e3;
|
|
@@ -68270,7 +68315,7 @@ var require_rimraf = __commonJS({
|
|
|
68270
68315
|
var n = 0;
|
|
68271
68316
|
if (options.disableGlob || !glob.hasMagic(p))
|
|
68272
68317
|
return afterGlob(null, [p]);
|
|
68273
|
-
|
|
68318
|
+
fs96.lstat(p, function(er, stat11) {
|
|
68274
68319
|
if (!er)
|
|
68275
68320
|
return afterGlob(null, [p]);
|
|
68276
68321
|
glob(p, globOpts, afterGlob);
|
|
@@ -68427,7 +68472,7 @@ var require_rimraf = __commonJS({
|
|
|
68427
68472
|
results = [p];
|
|
68428
68473
|
} else {
|
|
68429
68474
|
try {
|
|
68430
|
-
|
|
68475
|
+
fs96.lstatSync(p);
|
|
68431
68476
|
results = [p];
|
|
68432
68477
|
} catch (er) {
|
|
68433
68478
|
results = glob.sync(p, globOpts);
|
|
@@ -68490,7 +68535,7 @@ var require_rimraf = __commonJS({
|
|
|
68490
68535
|
var require_mkdirp = __commonJS({
|
|
68491
68536
|
"../../node_modules/mkdirp/index.js"(exports2, module2) {
|
|
68492
68537
|
var path78 = require("path");
|
|
68493
|
-
var
|
|
68538
|
+
var fs96 = require("fs");
|
|
68494
68539
|
var _0777 = parseInt("0777", 8);
|
|
68495
68540
|
module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
|
|
68496
68541
|
function mkdirP(p, opts, f, made) {
|
|
@@ -68501,7 +68546,7 @@ var require_mkdirp = __commonJS({
|
|
|
68501
68546
|
opts = { mode: opts };
|
|
68502
68547
|
}
|
|
68503
68548
|
var mode = opts.mode;
|
|
68504
|
-
var xfs = opts.fs ||
|
|
68549
|
+
var xfs = opts.fs || fs96;
|
|
68505
68550
|
if (mode === void 0) {
|
|
68506
68551
|
mode = _0777;
|
|
68507
68552
|
}
|
|
@@ -68540,7 +68585,7 @@ var require_mkdirp = __commonJS({
|
|
|
68540
68585
|
opts = { mode: opts };
|
|
68541
68586
|
}
|
|
68542
68587
|
var mode = opts.mode;
|
|
68543
|
-
var xfs = opts.fs ||
|
|
68588
|
+
var xfs = opts.fs || fs96;
|
|
68544
68589
|
if (mode === void 0) {
|
|
68545
68590
|
mode = _0777;
|
|
68546
68591
|
}
|
|
@@ -68577,7 +68622,7 @@ var require_mkdirp = __commonJS({
|
|
|
68577
68622
|
// ../../node_modules/mv/index.js
|
|
68578
68623
|
var require_mv = __commonJS({
|
|
68579
68624
|
"../../node_modules/mv/index.js"(exports2, module2) {
|
|
68580
|
-
var
|
|
68625
|
+
var fs96 = require("fs");
|
|
68581
68626
|
var ncp = require_ncp().ncp;
|
|
68582
68627
|
var path78 = require("path");
|
|
68583
68628
|
var rimraf = require_rimraf();
|
|
@@ -68604,13 +68649,13 @@ var require_mv = __commonJS({
|
|
|
68604
68649
|
}
|
|
68605
68650
|
function doRename() {
|
|
68606
68651
|
if (clobber) {
|
|
68607
|
-
|
|
68652
|
+
fs96.rename(source, dest, function(err) {
|
|
68608
68653
|
if (!err) return cb();
|
|
68609
68654
|
if (err.code !== "EXDEV") return cb(err);
|
|
68610
68655
|
moveFileAcrossDevice(source, dest, clobber, limit, cb);
|
|
68611
68656
|
});
|
|
68612
68657
|
} else {
|
|
68613
|
-
|
|
68658
|
+
fs96.link(source, dest, function(err) {
|
|
68614
68659
|
if (err) {
|
|
68615
68660
|
if (err.code === "EXDEV") {
|
|
68616
68661
|
moveFileAcrossDevice(source, dest, clobber, limit, cb);
|
|
@@ -68623,15 +68668,15 @@ var require_mv = __commonJS({
|
|
|
68623
68668
|
cb(err);
|
|
68624
68669
|
return;
|
|
68625
68670
|
}
|
|
68626
|
-
|
|
68671
|
+
fs96.unlink(source, cb);
|
|
68627
68672
|
});
|
|
68628
68673
|
}
|
|
68629
68674
|
}
|
|
68630
68675
|
}
|
|
68631
68676
|
function moveFileAcrossDevice(source, dest, clobber, limit, cb) {
|
|
68632
68677
|
var outFlags = clobber ? "w" : "wx";
|
|
68633
|
-
var ins =
|
|
68634
|
-
var outs =
|
|
68678
|
+
var ins = fs96.createReadStream(source);
|
|
68679
|
+
var outs = fs96.createWriteStream(dest, { flags: outFlags });
|
|
68635
68680
|
ins.on("error", function(err) {
|
|
68636
68681
|
ins.destroy();
|
|
68637
68682
|
outs.destroy();
|
|
@@ -68651,7 +68696,7 @@ var require_mv = __commonJS({
|
|
|
68651
68696
|
outs.once("close", onClose);
|
|
68652
68697
|
ins.pipe(outs);
|
|
68653
68698
|
function onClose() {
|
|
68654
|
-
|
|
68699
|
+
fs96.unlink(source, cb);
|
|
68655
68700
|
}
|
|
68656
68701
|
}
|
|
68657
68702
|
function moveDirAcrossDevice(source, dest, clobber, limit, cb) {
|
|
@@ -68706,7 +68751,7 @@ var require_bunyan = __commonJS({
|
|
|
68706
68751
|
throw new Error("unknown runtime environment");
|
|
68707
68752
|
}
|
|
68708
68753
|
var os23;
|
|
68709
|
-
var
|
|
68754
|
+
var fs96;
|
|
68710
68755
|
var dtrace;
|
|
68711
68756
|
if (runtimeEnv === "browser") {
|
|
68712
68757
|
os23 = {
|
|
@@ -68714,11 +68759,11 @@ var require_bunyan = __commonJS({
|
|
|
68714
68759
|
return window.location.host;
|
|
68715
68760
|
}
|
|
68716
68761
|
};
|
|
68717
|
-
|
|
68762
|
+
fs96 = {};
|
|
68718
68763
|
dtrace = null;
|
|
68719
68764
|
} else {
|
|
68720
68765
|
os23 = require("os");
|
|
68721
|
-
|
|
68766
|
+
fs96 = require("fs");
|
|
68722
68767
|
try {
|
|
68723
68768
|
dtrace = require("dtrace-provider");
|
|
68724
68769
|
} catch (e) {
|
|
@@ -69098,7 +69143,7 @@ var require_bunyan = __commonJS({
|
|
|
69098
69143
|
s.reemitErrorEvents = true;
|
|
69099
69144
|
}
|
|
69100
69145
|
if (!s.stream) {
|
|
69101
|
-
s.stream =
|
|
69146
|
+
s.stream = fs96.createWriteStream(
|
|
69102
69147
|
s.path,
|
|
69103
69148
|
{ flags: "a", encoding: "utf8" }
|
|
69104
69149
|
);
|
|
@@ -69168,7 +69213,7 @@ var require_bunyan = __commonJS({
|
|
|
69168
69213
|
s.stream.destroySoon();
|
|
69169
69214
|
delete s.stream;
|
|
69170
69215
|
}
|
|
69171
|
-
s.stream =
|
|
69216
|
+
s.stream = fs96.createWriteStream(
|
|
69172
69217
|
s.path,
|
|
69173
69218
|
{ flags: "a", encoding: "utf8" }
|
|
69174
69219
|
);
|
|
@@ -69510,7 +69555,7 @@ var require_bunyan = __commonJS({
|
|
|
69510
69555
|
}
|
|
69511
69556
|
var lastModified = null;
|
|
69512
69557
|
try {
|
|
69513
|
-
var fileInfo =
|
|
69558
|
+
var fileInfo = fs96.statSync(this.path);
|
|
69514
69559
|
lastModified = fileInfo.mtime.getTime();
|
|
69515
69560
|
} catch (err) {
|
|
69516
69561
|
}
|
|
@@ -69521,7 +69566,7 @@ var require_bunyan = __commonJS({
|
|
|
69521
69566
|
rotateAfterOpen = true;
|
|
69522
69567
|
}
|
|
69523
69568
|
}
|
|
69524
|
-
this.stream =
|
|
69569
|
+
this.stream = fs96.createWriteStream(
|
|
69525
69570
|
this.path,
|
|
69526
69571
|
{ flags: "a", encoding: "utf8" }
|
|
69527
69572
|
);
|
|
@@ -69688,7 +69733,7 @@ var require_bunyan = __commonJS({
|
|
|
69688
69733
|
}
|
|
69689
69734
|
n -= 1;
|
|
69690
69735
|
self2._debug(" rm %s", toDel);
|
|
69691
|
-
|
|
69736
|
+
fs96.unlink(toDel, function(delErr) {
|
|
69692
69737
|
moves();
|
|
69693
69738
|
});
|
|
69694
69739
|
}
|
|
@@ -69702,7 +69747,7 @@ var require_bunyan = __commonJS({
|
|
|
69702
69747
|
before += "." + String(n - 1);
|
|
69703
69748
|
}
|
|
69704
69749
|
n -= 1;
|
|
69705
|
-
|
|
69750
|
+
fs96.exists(before, function(exists3) {
|
|
69706
69751
|
if (!exists3) {
|
|
69707
69752
|
moves();
|
|
69708
69753
|
} else {
|
|
@@ -69720,7 +69765,7 @@ var require_bunyan = __commonJS({
|
|
|
69720
69765
|
}
|
|
69721
69766
|
function finish() {
|
|
69722
69767
|
self2._debug(" open %s", self2.path);
|
|
69723
|
-
self2.stream =
|
|
69768
|
+
self2.stream = fs96.createWriteStream(
|
|
69724
69769
|
self2.path,
|
|
69725
69770
|
{ flags: "a", encoding: "utf8" }
|
|
69726
69771
|
);
|
|
@@ -72235,7 +72280,7 @@ function getSharedConfigurationFromEnvironment(signalIdentifier) {
|
|
|
72235
72280
|
init_esm();
|
|
72236
72281
|
|
|
72237
72282
|
// ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-env-configuration.js
|
|
72238
|
-
var
|
|
72283
|
+
var fs10 = __toESM(require("fs"));
|
|
72239
72284
|
var path9 = __toESM(require("path"));
|
|
72240
72285
|
init_esm();
|
|
72241
72286
|
function getStaticHeadersFromEnv(signalIdentifier) {
|
|
@@ -72296,7 +72341,7 @@ function readFileFromEnv(signalSpecificEnvVar, nonSignalSpecificEnvVar, warningM
|
|
|
72296
72341
|
const filePath = signalSpecificPath ?? nonSignalSpecificPath;
|
|
72297
72342
|
if (filePath != null) {
|
|
72298
72343
|
try {
|
|
72299
|
-
return
|
|
72344
|
+
return fs10.readFileSync(path9.resolve(process.cwd(), filePath));
|
|
72300
72345
|
} catch {
|
|
72301
72346
|
diag2.warn(warningMessage);
|
|
72302
72347
|
return void 0;
|
|
@@ -72382,7 +72427,7 @@ var OTLPLogExporter = class extends OTLPExporterBase {
|
|
|
72382
72427
|
init_esm();
|
|
72383
72428
|
|
|
72384
72429
|
// ../telemetry/src/debug.ts
|
|
72385
|
-
var
|
|
72430
|
+
var fs11 = __toESM(require("node:fs"));
|
|
72386
72431
|
|
|
72387
72432
|
// ../telemetry/src/paths.ts
|
|
72388
72433
|
var path10 = __toESM(require("node:path"));
|
|
@@ -72421,8 +72466,8 @@ function emitDebugPayload(payload) {
|
|
|
72421
72466
|
} catch {
|
|
72422
72467
|
}
|
|
72423
72468
|
try {
|
|
72424
|
-
|
|
72425
|
-
|
|
72469
|
+
fs11.mkdirSync(argentHomeDir(), { recursive: true });
|
|
72470
|
+
fs11.appendFileSync(debugLogPath(), line + "\n");
|
|
72426
72471
|
} catch {
|
|
72427
72472
|
}
|
|
72428
72473
|
}
|
|
@@ -72909,7 +72954,7 @@ function sanitize(event2, raw) {
|
|
|
72909
72954
|
}
|
|
72910
72955
|
|
|
72911
72956
|
// ../telemetry/src/base-props.ts
|
|
72912
|
-
var
|
|
72957
|
+
var import_node_crypto4 = require("node:crypto");
|
|
72913
72958
|
|
|
72914
72959
|
// ../telemetry/src/cloud-agent-detect.ts
|
|
72915
72960
|
var import_node_fs = require("node:fs");
|
|
@@ -73362,10 +73407,10 @@ function isCi(env = process.env) {
|
|
|
73362
73407
|
}
|
|
73363
73408
|
|
|
73364
73409
|
// ../telemetry/src/base-props.ts
|
|
73365
|
-
var SESSION_ID = (0,
|
|
73410
|
+
var SESSION_ID = (0, import_node_crypto4.randomUUID)();
|
|
73366
73411
|
function readCliVersion() {
|
|
73367
73412
|
if (true) {
|
|
73368
|
-
return "0.35.1-next.
|
|
73413
|
+
return "0.35.1-next.81";
|
|
73369
73414
|
}
|
|
73370
73415
|
return "0.0.0";
|
|
73371
73416
|
}
|
|
@@ -73398,7 +73443,7 @@ function getBaseProps(runtime) {
|
|
|
73398
73443
|
|
|
73399
73444
|
// ../telemetry/src/identity.ts
|
|
73400
73445
|
var crypto2 = __toESM(require("node:crypto"));
|
|
73401
|
-
var
|
|
73446
|
+
var fs12 = __toESM(require("node:fs"));
|
|
73402
73447
|
var path11 = __toESM(require("node:path"));
|
|
73403
73448
|
var FINGERPRINT_PATTERN = /^[0-9a-f]{64}$/;
|
|
73404
73449
|
var cached2 = null;
|
|
@@ -73513,17 +73558,17 @@ function resolveFingerprintOnce(resolveFingerprint) {
|
|
|
73513
73558
|
function isCorruptIdFile(filePath) {
|
|
73514
73559
|
let isRegularFile;
|
|
73515
73560
|
try {
|
|
73516
|
-
isRegularFile =
|
|
73561
|
+
isRegularFile = fs12.lstatSync(filePath).isFile();
|
|
73517
73562
|
} catch {
|
|
73518
73563
|
return false;
|
|
73519
73564
|
}
|
|
73520
73565
|
return isRegularFile && tryReadId(filePath) === null;
|
|
73521
73566
|
}
|
|
73522
73567
|
function writeIdFileAtomic(finalPath, id) {
|
|
73523
|
-
|
|
73568
|
+
fs12.mkdirSync(argentHomeDir(), { recursive: true });
|
|
73524
73569
|
let occupant;
|
|
73525
73570
|
try {
|
|
73526
|
-
occupant =
|
|
73571
|
+
occupant = fs12.lstatSync(finalPath);
|
|
73527
73572
|
} catch (err) {
|
|
73528
73573
|
if (err.code !== "ENOENT") throw err;
|
|
73529
73574
|
}
|
|
@@ -73534,24 +73579,24 @@ function writeIdFileAtomic(finalPath, id) {
|
|
|
73534
73579
|
argentHomeDir(),
|
|
73535
73580
|
`.telemetry-id.tmp.${process.pid}.${crypto2.randomUUID()}`
|
|
73536
73581
|
);
|
|
73537
|
-
const fd =
|
|
73582
|
+
const fd = fs12.openSync(tmpPath, "wx", 384);
|
|
73538
73583
|
try {
|
|
73539
73584
|
try {
|
|
73540
|
-
|
|
73541
|
-
|
|
73585
|
+
fs12.writeSync(fd, id);
|
|
73586
|
+
fs12.fsyncSync(fd);
|
|
73542
73587
|
} finally {
|
|
73543
|
-
|
|
73588
|
+
fs12.closeSync(fd);
|
|
73544
73589
|
}
|
|
73545
|
-
|
|
73590
|
+
fs12.renameSync(tmpPath, finalPath);
|
|
73546
73591
|
} finally {
|
|
73547
73592
|
try {
|
|
73548
|
-
|
|
73593
|
+
fs12.unlinkSync(tmpPath);
|
|
73549
73594
|
} catch {
|
|
73550
73595
|
}
|
|
73551
73596
|
}
|
|
73552
73597
|
}
|
|
73553
73598
|
function mintRandomId(finalPath) {
|
|
73554
|
-
|
|
73599
|
+
fs12.mkdirSync(argentHomeDir(), { recursive: true });
|
|
73555
73600
|
let value = crypto2.randomUUID();
|
|
73556
73601
|
for (let attempt = 0; attempt < 3; attempt++) {
|
|
73557
73602
|
const tmpPath = path11.join(
|
|
@@ -73560,19 +73605,19 @@ function mintRandomId(finalPath) {
|
|
|
73560
73605
|
);
|
|
73561
73606
|
let fd;
|
|
73562
73607
|
try {
|
|
73563
|
-
fd =
|
|
73608
|
+
fd = fs12.openSync(tmpPath, "wx", 384);
|
|
73564
73609
|
} catch (err) {
|
|
73565
73610
|
if (err.code === "EEXIST") continue;
|
|
73566
73611
|
throw err;
|
|
73567
73612
|
}
|
|
73568
73613
|
try {
|
|
73569
73614
|
try {
|
|
73570
|
-
|
|
73571
|
-
|
|
73615
|
+
fs12.writeSync(fd, value);
|
|
73616
|
+
fs12.fsyncSync(fd);
|
|
73572
73617
|
} finally {
|
|
73573
|
-
|
|
73618
|
+
fs12.closeSync(fd);
|
|
73574
73619
|
}
|
|
73575
|
-
|
|
73620
|
+
fs12.linkSync(tmpPath, finalPath);
|
|
73576
73621
|
cached2 = { path: finalPath, id: value };
|
|
73577
73622
|
return value;
|
|
73578
73623
|
} catch (err) {
|
|
@@ -73591,7 +73636,7 @@ function mintRandomId(finalPath) {
|
|
|
73591
73636
|
throw err;
|
|
73592
73637
|
} finally {
|
|
73593
73638
|
try {
|
|
73594
|
-
|
|
73639
|
+
fs12.unlinkSync(tmpPath);
|
|
73595
73640
|
} catch {
|
|
73596
73641
|
}
|
|
73597
73642
|
}
|
|
@@ -73604,7 +73649,7 @@ function claimCorruptOccupant(finalPath) {
|
|
|
73604
73649
|
`.telemetry-id.corrupt.${process.pid}.${crypto2.randomUUID()}`
|
|
73605
73650
|
);
|
|
73606
73651
|
try {
|
|
73607
|
-
|
|
73652
|
+
fs12.renameSync(finalPath, claimed);
|
|
73608
73653
|
} catch {
|
|
73609
73654
|
return null;
|
|
73610
73655
|
}
|
|
@@ -73613,7 +73658,7 @@ function claimCorruptOccupant(finalPath) {
|
|
|
73613
73658
|
grabbed = tryReadId(claimed);
|
|
73614
73659
|
} finally {
|
|
73615
73660
|
try {
|
|
73616
|
-
|
|
73661
|
+
fs12.unlinkSync(claimed);
|
|
73617
73662
|
} catch {
|
|
73618
73663
|
}
|
|
73619
73664
|
}
|
|
@@ -73622,9 +73667,9 @@ function claimCorruptOccupant(finalPath) {
|
|
|
73622
73667
|
function tryReadId(filePath) {
|
|
73623
73668
|
let raw;
|
|
73624
73669
|
try {
|
|
73625
|
-
const stats =
|
|
73670
|
+
const stats = fs12.lstatSync(filePath);
|
|
73626
73671
|
if (!stats.isFile()) return null;
|
|
73627
|
-
raw =
|
|
73672
|
+
raw = fs12.readFileSync(filePath, "utf8");
|
|
73628
73673
|
} catch (err) {
|
|
73629
73674
|
if (err.code === "ENOENT") return null;
|
|
73630
73675
|
return null;
|
|
@@ -73639,7 +73684,7 @@ var import_node_child_process = require("node:child_process");
|
|
|
73639
73684
|
|
|
73640
73685
|
// ../native-devtools-ios/src/index.ts
|
|
73641
73686
|
var path12 = __toESM(require("node:path"));
|
|
73642
|
-
var
|
|
73687
|
+
var fs13 = __toESM(require("node:fs"));
|
|
73643
73688
|
var DYLIB_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_DIR ?? path12.join(__dirname, "..", "dylibs");
|
|
73644
73689
|
var BIN_DIR = process.env.ARGENT_SIMULATOR_SERVER_DIR ?? path12.join(__dirname, "..", "bin");
|
|
73645
73690
|
var DYLIB_TCP_DIR = process.env.ARGENT_NATIVE_DEVTOOLS_TCP_DIR ?? path12.join(DYLIB_DIR, "tcp");
|
|
@@ -73653,14 +73698,14 @@ function requireDarwin(what) {
|
|
|
73653
73698
|
}
|
|
73654
73699
|
function requireDylibIn(dir, name) {
|
|
73655
73700
|
const p = path12.join(dir, name);
|
|
73656
|
-
if (!
|
|
73701
|
+
if (!fs13.existsSync(p)) {
|
|
73657
73702
|
throw new Error(`Native devtools dylib not found: ${p}`);
|
|
73658
73703
|
}
|
|
73659
73704
|
return p;
|
|
73660
73705
|
}
|
|
73661
73706
|
function requireTcpArtifact(dir, name, kind, envVar) {
|
|
73662
73707
|
const p = path12.join(dir, name);
|
|
73663
|
-
if (!
|
|
73708
|
+
if (!fs13.existsSync(p)) {
|
|
73664
73709
|
throw new Error(
|
|
73665
73710
|
`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>.`
|
|
73666
73711
|
);
|
|
@@ -73744,9 +73789,9 @@ function tcpBinDir() {
|
|
|
73744
73789
|
function simulatorServerBinaryPath() {
|
|
73745
73790
|
const binaryName = simulatorServerBinaryName();
|
|
73746
73791
|
const p = path12.join(platformBinDir(), binaryName);
|
|
73747
|
-
if (!
|
|
73792
|
+
if (!fs13.existsSync(p)) {
|
|
73748
73793
|
const flat = path12.join(BIN_DIR, binaryName);
|
|
73749
|
-
const migrationHint =
|
|
73794
|
+
const migrationHint = fs13.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.` : "";
|
|
73750
73795
|
throw new Error(
|
|
73751
73796
|
`simulator-server binary not found for platform "${hostPlatformKey()}" at ${p}. Supported hosts today: darwin, linux (x86_64 and arm64), win32.${migrationHint}`
|
|
73752
73797
|
);
|
|
@@ -73754,14 +73799,14 @@ function simulatorServerBinaryPath() {
|
|
|
73754
73799
|
return p;
|
|
73755
73800
|
}
|
|
73756
73801
|
function simulatorServerRunDir() {
|
|
73757
|
-
if (
|
|
73802
|
+
if (fs13.existsSync(path12.join(BIN_DIR, "resources", "android"))) {
|
|
73758
73803
|
return BIN_DIR;
|
|
73759
73804
|
}
|
|
73760
73805
|
return platformBinDir();
|
|
73761
73806
|
}
|
|
73762
73807
|
function requireBinIn(dir, name) {
|
|
73763
73808
|
const p = path12.join(dir, name);
|
|
73764
|
-
if (!
|
|
73809
|
+
if (!fs13.existsSync(p)) {
|
|
73765
73810
|
throw new Error(`${name} binary not found: ${p}`);
|
|
73766
73811
|
}
|
|
73767
73812
|
return p;
|
|
@@ -73787,7 +73832,7 @@ function macosArtifacts() {
|
|
|
73787
73832
|
library: path12.join(DYLIB_DIR, "macos", "libNativeDevtoolsMacos.dylib"),
|
|
73788
73833
|
helper: path12.join(BIN_DIR, "darwin", "argent-macos-helper")
|
|
73789
73834
|
};
|
|
73790
|
-
const missing = Object.values(files).filter((p) => !
|
|
73835
|
+
const missing = Object.values(files).filter((p) => !fs13.existsSync(p));
|
|
73791
73836
|
if (missing.length > 0) {
|
|
73792
73837
|
throw new Error(
|
|
73793
73838
|
`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.`
|
|
@@ -73868,7 +73913,7 @@ function resolveHostFingerprintAsync() {
|
|
|
73868
73913
|
}
|
|
73869
73914
|
|
|
73870
73915
|
// ../telemetry/src/consent.ts
|
|
73871
|
-
var
|
|
73916
|
+
var fs14 = __toESM(require("node:fs"));
|
|
73872
73917
|
var path13 = __toESM(require("node:path"));
|
|
73873
73918
|
init_src();
|
|
73874
73919
|
var cache = /* @__PURE__ */ new Map();
|
|
@@ -73877,7 +73922,7 @@ function readConfigOverrideAt(filePath) {
|
|
|
73877
73922
|
const miss = { mtimeMs: null, fingerprint: null, enabledOverride: null };
|
|
73878
73923
|
let stats;
|
|
73879
73924
|
try {
|
|
73880
|
-
stats =
|
|
73925
|
+
stats = fs14.lstatSync(filePath);
|
|
73881
73926
|
} catch {
|
|
73882
73927
|
cache.set(filePath, miss);
|
|
73883
73928
|
return null;
|
|
@@ -73894,7 +73939,7 @@ function readConfigOverrideAt(filePath) {
|
|
|
73894
73939
|
}
|
|
73895
73940
|
let parsedEnabled = null;
|
|
73896
73941
|
try {
|
|
73897
|
-
const raw =
|
|
73942
|
+
const raw = fs14.readFileSync(filePath, "utf8");
|
|
73898
73943
|
const json2 = JSON.parse(raw);
|
|
73899
73944
|
if (json2 && typeof json2 === "object") {
|
|
73900
73945
|
const t = json2.telemetry;
|
|
@@ -74064,7 +74109,7 @@ function attachRegistryTelemetry(registry2) {
|
|
|
74064
74109
|
}
|
|
74065
74110
|
|
|
74066
74111
|
// ../telemetry/src/crash-diagnostics.ts
|
|
74067
|
-
var
|
|
74112
|
+
var import_node_crypto5 = require("node:crypto");
|
|
74068
74113
|
var MAX_FRAMES = 8;
|
|
74069
74114
|
var FRAME_RE = /^\s*at\s+(?:(.*?)\s+\()?(.+?):(\d+):(\d+)\)?\s*$/;
|
|
74070
74115
|
function deidentifyPath(file2) {
|
|
@@ -74101,7 +74146,7 @@ function fingerprintStack(err) {
|
|
|
74101
74146
|
if (frames.length >= MAX_FRAMES) break;
|
|
74102
74147
|
}
|
|
74103
74148
|
if (frames.length === 0) return void 0;
|
|
74104
|
-
return (0,
|
|
74149
|
+
return (0, import_node_crypto5.createHash)("sha256").update(frames.join("\n")).digest("hex").slice(0, 16);
|
|
74105
74150
|
}
|
|
74106
74151
|
function safe(fn) {
|
|
74107
74152
|
try {
|
|
@@ -74231,7 +74276,7 @@ var import_promises16 = require("node:fs/promises");
|
|
|
74231
74276
|
var import_node_os12 = require("node:os");
|
|
74232
74277
|
var import_node_path17 = require("node:path");
|
|
74233
74278
|
init_src();
|
|
74234
|
-
var
|
|
74279
|
+
var import_node_crypto17 = require("node:crypto");
|
|
74235
74280
|
|
|
74236
74281
|
// ../archive/src/index.ts
|
|
74237
74282
|
var import_node_child_process2 = require("node:child_process");
|
|
@@ -75253,7 +75298,7 @@ async function argentCloudVersion() {
|
|
|
75253
75298
|
init_src2();
|
|
75254
75299
|
|
|
75255
75300
|
// ../tool-server/src/utils/xcode-first-launch.ts
|
|
75256
|
-
var
|
|
75301
|
+
var fs15 = __toESM(require("node:fs"));
|
|
75257
75302
|
var path14 = __toESM(require("node:path"));
|
|
75258
75303
|
var import_node_child_process9 = require("node:child_process");
|
|
75259
75304
|
var WRAPPER_DEVICES = {
|
|
@@ -75291,9 +75336,9 @@ function activeDeveloperDir() {
|
|
|
75291
75336
|
let dir = process.env.DEVELOPER_DIR || null;
|
|
75292
75337
|
if (!dir) {
|
|
75293
75338
|
try {
|
|
75294
|
-
dir =
|
|
75339
|
+
dir = fs15.readlinkSync(locations.selectLink);
|
|
75295
75340
|
} catch {
|
|
75296
|
-
dir =
|
|
75341
|
+
dir = fs15.existsSync(locations.defaultDeveloperDir) ? locations.defaultDeveloperDir : null;
|
|
75297
75342
|
}
|
|
75298
75343
|
}
|
|
75299
75344
|
if (!dir) return null;
|
|
@@ -75305,7 +75350,7 @@ function activeDeveloperDir() {
|
|
|
75305
75350
|
}
|
|
75306
75351
|
function isDirectory(file2) {
|
|
75307
75352
|
try {
|
|
75308
|
-
return
|
|
75353
|
+
return fs15.statSync(file2).isDirectory();
|
|
75309
75354
|
} catch {
|
|
75310
75355
|
return false;
|
|
75311
75356
|
}
|
|
@@ -75316,7 +75361,7 @@ var DIFFERENT_RULE = /\[\[ "\$\{EXPECTED_VERSION\}" != "\$\{CURRENT_VERSION\}" \
|
|
|
75316
75361
|
function parseWrapper(file2) {
|
|
75317
75362
|
let text;
|
|
75318
75363
|
try {
|
|
75319
|
-
text =
|
|
75364
|
+
text = fs15.readFileSync(file2, "utf8");
|
|
75320
75365
|
} catch {
|
|
75321
75366
|
return null;
|
|
75322
75367
|
}
|
|
@@ -75329,7 +75374,7 @@ function parseWrapper(file2) {
|
|
|
75329
75374
|
function readBundleVersion(plistPath) {
|
|
75330
75375
|
let data;
|
|
75331
75376
|
try {
|
|
75332
|
-
data =
|
|
75377
|
+
data = fs15.readFileSync(plistPath);
|
|
75333
75378
|
} catch (err) {
|
|
75334
75379
|
return err.code === "ENOENT" ? "missing" : null;
|
|
75335
75380
|
}
|
|
@@ -75552,14 +75597,7 @@ function loadSuppressUntil() {
|
|
|
75552
75597
|
function persistSuppressUntil(value) {
|
|
75553
75598
|
const filePath = getSuppressionFilePath();
|
|
75554
75599
|
import_node_fs7.default.mkdirSync(import_node_path10.default.dirname(filePath), { recursive: true });
|
|
75555
|
-
|
|
75556
|
-
try {
|
|
75557
|
-
import_node_fs7.default.writeFileSync(tempPath, JSON.stringify({ suppressUntil: value }));
|
|
75558
|
-
import_node_fs7.default.renameSync(tempPath, filePath);
|
|
75559
|
-
} catch (error63) {
|
|
75560
|
-
import_node_fs7.default.rmSync(tempPath, { force: true });
|
|
75561
|
-
throw error63;
|
|
75562
|
-
}
|
|
75600
|
+
writeFileAtomicSync(filePath, JSON.stringify({ suppressUntil: value }));
|
|
75563
75601
|
}
|
|
75564
75602
|
var state2 = {
|
|
75565
75603
|
updateAvailable: false,
|
|
@@ -75654,7 +75692,7 @@ function startUpdateChecker(options = {}) {
|
|
|
75654
75692
|
|
|
75655
75693
|
// ../tool-server/src/tools/system/update-argent.ts
|
|
75656
75694
|
var import_node_child_process11 = require("node:child_process");
|
|
75657
|
-
var
|
|
75695
|
+
var fs21 = __toESM(require("node:fs"));
|
|
75658
75696
|
var path19 = __toESM(require("node:path"));
|
|
75659
75697
|
init_zod();
|
|
75660
75698
|
|
|
@@ -75835,7 +75873,7 @@ async function withKeyedLock(locks2, key2, fn) {
|
|
|
75835
75873
|
}
|
|
75836
75874
|
|
|
75837
75875
|
// ../tool-server/src/utils/cloud-android/access.ts
|
|
75838
|
-
var
|
|
75876
|
+
var import_node_crypto7 = require("node:crypto");
|
|
75839
75877
|
init_config2();
|
|
75840
75878
|
|
|
75841
75879
|
// ../tool-server/src/utils/cloud-android/router.ts
|
|
@@ -76020,7 +76058,7 @@ var MAX_CACHED = 32;
|
|
|
76020
76058
|
var cache4 = /* @__PURE__ */ new Map();
|
|
76021
76059
|
var inFlight = /* @__PURE__ */ new Map();
|
|
76022
76060
|
function cloudAndroidConfigKey(config2) {
|
|
76023
|
-
return `${config2.baseUrl}\0${(0,
|
|
76061
|
+
return `${config2.baseUrl}\0${(0, import_node_crypto7.createHash)("sha256").update(config2.apiKey).digest("hex")}`;
|
|
76024
76062
|
}
|
|
76025
76063
|
async function check3(config2, budgetMs) {
|
|
76026
76064
|
const deadline = Date.now() + budgetMs;
|
|
@@ -76979,7 +77017,7 @@ function buildScreenRecordingNote(recordings2, nowMs) {
|
|
|
76979
77017
|
|
|
76980
77018
|
// ../tool-server/src/tools/flows/flow-utils.ts
|
|
76981
77019
|
var path18 = __toESM(require("node:path"));
|
|
76982
|
-
var
|
|
77020
|
+
var fs20 = __toESM(require("node:fs/promises"));
|
|
76983
77021
|
var import_node_fs8 = require("node:fs");
|
|
76984
77022
|
var import_node_util8 = require("node:util");
|
|
76985
77023
|
init_src();
|
|
@@ -78150,7 +78188,7 @@ async function hostFileArgumentStat(toolId, target, filePath) {
|
|
|
78150
78188
|
const where = `"${escapeInline(filePath)}" (argument ${target} of ${toolId})`;
|
|
78151
78189
|
let st;
|
|
78152
78190
|
try {
|
|
78153
|
-
st = await
|
|
78191
|
+
st = await fs20.stat(filePath);
|
|
78154
78192
|
} catch (err) {
|
|
78155
78193
|
const code = err.code;
|
|
78156
78194
|
if (code !== "ENOENT" && code !== "ENOTDIR") {
|
|
@@ -80517,8 +80555,8 @@ function scrubTempPath(err, tmpPath, filePath) {
|
|
|
80517
80555
|
return scrubbed;
|
|
80518
80556
|
}
|
|
80519
80557
|
async function canonicalFlowTarget(filePath) {
|
|
80520
|
-
const dir = await
|
|
80521
|
-
const real = await
|
|
80558
|
+
const dir = await fs20.realpath(path18.dirname(filePath)).catch(() => path18.dirname(filePath));
|
|
80559
|
+
const real = await fs20.realpath(filePath).catch(() => null);
|
|
80522
80560
|
if (real !== null) return { dir, target: real };
|
|
80523
80561
|
return { dir, target: await followDanglingLink(path18.join(dir, path18.basename(filePath))) };
|
|
80524
80562
|
}
|
|
@@ -80529,25 +80567,25 @@ var MAX_DANGLING_LINK_HOPS = 32;
|
|
|
80529
80567
|
async function followDanglingLink(linkPath) {
|
|
80530
80568
|
let current = linkPath;
|
|
80531
80569
|
for (let hop = 0; hop < MAX_DANGLING_LINK_HOPS; hop++) {
|
|
80532
|
-
const target = await
|
|
80570
|
+
const target = await fs20.readlink(current).catch(() => null);
|
|
80533
80571
|
if (target === null) return current;
|
|
80534
80572
|
const resolved = path18.resolve(path18.dirname(current), target);
|
|
80535
|
-
const real = await
|
|
80573
|
+
const real = await fs20.realpath(resolved).catch(() => null);
|
|
80536
80574
|
if (real !== null) return real;
|
|
80537
|
-
const targetDir = await
|
|
80575
|
+
const targetDir = await fs20.realpath(path18.dirname(resolved)).catch(() => path18.dirname(resolved));
|
|
80538
80576
|
current = path18.join(targetDir, path18.basename(resolved));
|
|
80539
80577
|
}
|
|
80540
80578
|
return current;
|
|
80541
80579
|
}
|
|
80542
80580
|
async function isWritable(filePath) {
|
|
80543
|
-
return
|
|
80581
|
+
return fs20.access(filePath, import_node_fs8.constants.W_OK).then(
|
|
80544
80582
|
() => true,
|
|
80545
80583
|
() => false
|
|
80546
80584
|
);
|
|
80547
80585
|
}
|
|
80548
80586
|
async function writeFlowFile(filePath, content) {
|
|
80549
80587
|
const { dir: resolvedDir, target } = await canonicalFlowTarget(filePath);
|
|
80550
|
-
const previousMode = await
|
|
80588
|
+
const previousMode = await fs20.stat(target).then(
|
|
80551
80589
|
(s) => s.mode & 4095,
|
|
80552
80590
|
() => null
|
|
80553
80591
|
);
|
|
@@ -80567,11 +80605,11 @@ async function writeFlowFile(filePath, content) {
|
|
|
80567
80605
|
`.argent-e2e-${process.pid}-${++flowWriteSeq}.tmp`
|
|
80568
80606
|
);
|
|
80569
80607
|
try {
|
|
80570
|
-
await
|
|
80571
|
-
if (previousMode !== null) await
|
|
80572
|
-
await
|
|
80608
|
+
await fs20.writeFile(tmpPath, content, "utf8");
|
|
80609
|
+
if (previousMode !== null) await fs20.chmod(tmpPath, previousMode);
|
|
80610
|
+
await fs20.rename(tmpPath, target);
|
|
80573
80611
|
} catch (err) {
|
|
80574
|
-
await
|
|
80612
|
+
await fs20.rm(tmpPath, { force: true }).catch(() => {
|
|
80575
80613
|
});
|
|
80576
80614
|
const errno = err instanceof Error ? err : void 0;
|
|
80577
80615
|
const code = typeof errno?.code === "string" ? errno.code : void 0;
|
|
@@ -80607,7 +80645,7 @@ function mkdirFailureHint(code, dir) {
|
|
|
80607
80645
|
async function writeNewFlowFile(filePath, content) {
|
|
80608
80646
|
const dir = path18.dirname(filePath);
|
|
80609
80647
|
try {
|
|
80610
|
-
await
|
|
80648
|
+
await fs20.mkdir(dir, { recursive: true });
|
|
80611
80649
|
} catch (err) {
|
|
80612
80650
|
const code = err instanceof Error ? err.code : void 0;
|
|
80613
80651
|
throw new FailureError(
|
|
@@ -80625,7 +80663,7 @@ async function writeNewFlowFile(filePath, content) {
|
|
|
80625
80663
|
}
|
|
80626
80664
|
async function countStepsOnDisk(filePath, block = "steps") {
|
|
80627
80665
|
try {
|
|
80628
|
-
const flow = parseFlow(await
|
|
80666
|
+
const flow = parseFlow(await fs20.readFile(filePath, "utf8"));
|
|
80629
80667
|
const shutdown3 = flow.shutdown?.length ?? 0;
|
|
80630
80668
|
return block === "steps" ? flow.steps.length : block === "shutdown" ? shutdown3 : flow.steps.length + shutdown3;
|
|
80631
80669
|
} catch {
|
|
@@ -80657,7 +80695,7 @@ async function setRecordingVars(session, changes) {
|
|
|
80657
80695
|
}
|
|
80658
80696
|
session.lastTouchedSeq = touch();
|
|
80659
80697
|
if (session.persist === "host") {
|
|
80660
|
-
const flow2 = apply(parseFlow(await
|
|
80698
|
+
const flow2 = apply(parseFlow(await fs20.readFile(session.filePath, "utf8")));
|
|
80661
80699
|
validateFlow(flow2);
|
|
80662
80700
|
const updated = serializeFlow(flow2);
|
|
80663
80701
|
await writeFlowFile(session.filePath, updated);
|
|
@@ -80672,7 +80710,7 @@ async function setRecordingVars(session, changes) {
|
|
|
80672
80710
|
});
|
|
80673
80711
|
}
|
|
80674
80712
|
async function appendStep(filePath, step, block) {
|
|
80675
|
-
const content = await
|
|
80713
|
+
const content = await fs20.readFile(filePath, "utf8");
|
|
80676
80714
|
const flow = parseFlow(content);
|
|
80677
80715
|
(block === "shutdown" ? flow.shutdown ??= [] : flow.steps).push(step);
|
|
80678
80716
|
validateFlow(flow);
|
|
@@ -80881,7 +80919,7 @@ function recordedCount(flow, block) {
|
|
|
80881
80919
|
function resolveCliEntry() {
|
|
80882
80920
|
try {
|
|
80883
80921
|
const entry = path19.join(__dirname, "cli.js");
|
|
80884
|
-
return
|
|
80922
|
+
return fs21.existsSync(entry) ? entry : null;
|
|
80885
80923
|
} catch {
|
|
80886
80924
|
return null;
|
|
80887
80925
|
}
|
|
@@ -80895,14 +80933,14 @@ function classifyRunningInstall() {
|
|
|
80895
80933
|
}
|
|
80896
80934
|
let runningRoot;
|
|
80897
80935
|
try {
|
|
80898
|
-
runningRoot =
|
|
80936
|
+
runningRoot = fs21.realpathSync(path19.dirname(__dirname));
|
|
80899
80937
|
} catch {
|
|
80900
80938
|
return { kind: "global", projectRoot: null };
|
|
80901
80939
|
}
|
|
80902
80940
|
let dir = process.cwd();
|
|
80903
80941
|
while (true) {
|
|
80904
80942
|
try {
|
|
80905
|
-
const nmReal =
|
|
80943
|
+
const nmReal = fs21.realpathSync(path19.join(dir, "node_modules"));
|
|
80906
80944
|
if (runningRoot === nmReal || runningRoot.startsWith(nmReal + path19.sep)) {
|
|
80907
80945
|
return { kind: "local", projectRoot: dir };
|
|
80908
80946
|
}
|
|
@@ -80917,14 +80955,14 @@ function classifyRunningInstall() {
|
|
|
80917
80955
|
function findDeclaringProjectRoot(startDir) {
|
|
80918
80956
|
let dir;
|
|
80919
80957
|
try {
|
|
80920
|
-
dir =
|
|
80958
|
+
dir = fs21.realpathSync(startDir);
|
|
80921
80959
|
} catch {
|
|
80922
80960
|
return null;
|
|
80923
80961
|
}
|
|
80924
80962
|
while (true) {
|
|
80925
|
-
if (
|
|
80963
|
+
if (fs21.existsSync(path19.join(dir, ".argent", "install.json"))) return dir;
|
|
80926
80964
|
try {
|
|
80927
|
-
const manifest = JSON.parse(
|
|
80965
|
+
const manifest = JSON.parse(fs21.readFileSync(path19.join(dir, "package.json"), "utf8"));
|
|
80928
80966
|
if (manifest.devDependencies?.[PACKAGE_NAME2] || manifest.dependencies?.[PACKAGE_NAME2] || manifest.optionalDependencies?.[PACKAGE_NAME2]) {
|
|
80929
80967
|
return dir;
|
|
80930
80968
|
}
|
|
@@ -81037,7 +81075,7 @@ var updateArgentTool = {
|
|
|
81037
81075
|
let projectRoot = null;
|
|
81038
81076
|
let effectiveTarget = resolved;
|
|
81039
81077
|
if (resolved === "local" || resolved === "both") {
|
|
81040
|
-
const recordedRoot = running.projectRoot &&
|
|
81078
|
+
const recordedRoot = running.projectRoot && fs21.existsSync(running.projectRoot) ? running.projectRoot : null;
|
|
81041
81079
|
projectRoot = recordedRoot ?? (running.kind === "local" ? findDeclaringProjectRoot(process.cwd()) : null);
|
|
81042
81080
|
if (!projectRoot) {
|
|
81043
81081
|
if (resolved === "local") {
|
|
@@ -81076,7 +81114,7 @@ var updateArgentTool = {
|
|
|
81076
81114
|
if (targetsOnlyRunningInstall && installableVersion) {
|
|
81077
81115
|
updateArgs.push("--version", installableVersion);
|
|
81078
81116
|
}
|
|
81079
|
-
const spawnRoot = projectRoot ?? (running.projectRoot &&
|
|
81117
|
+
const spawnRoot = projectRoot ?? (running.projectRoot && fs21.existsSync(running.projectRoot) ? running.projectRoot : null);
|
|
81080
81118
|
if (spawnRoot) updateArgs.push("--project-root", spawnRoot);
|
|
81081
81119
|
scheduleUpdater(updateArgs, resolveCliEntry());
|
|
81082
81120
|
const targetLabel3 = effectiveTarget === "both" ? "global and project-local installs" : `${effectiveTarget} install`;
|
|
@@ -81107,7 +81145,7 @@ This reminder comes from Argent itself. It will not repeat for the next 30 minut
|
|
|
81107
81145
|
// ../tool-server/src/utils/ios-device/team-detect.ts
|
|
81108
81146
|
var import_node_child_process12 = require("node:child_process");
|
|
81109
81147
|
var import_node_util9 = require("node:util");
|
|
81110
|
-
var
|
|
81148
|
+
var import_node_crypto8 = require("node:crypto");
|
|
81111
81149
|
var execFileAsync8 = (0, import_node_util9.promisify)(import_node_child_process12.execFile);
|
|
81112
81150
|
var SIGNING_CERT_COMMON_NAMES = ["Apple Development", "iPhone Developer"];
|
|
81113
81151
|
var SECURITY_TIMEOUT_MS = 15e3;
|
|
@@ -81142,7 +81180,7 @@ function parseSigningTeams(pem) {
|
|
|
81142
81180
|
for (const block of pem.match(PEM_BLOCK_RE) ?? []) {
|
|
81143
81181
|
let cert;
|
|
81144
81182
|
try {
|
|
81145
|
-
cert = new
|
|
81183
|
+
cert = new import_node_crypto8.X509Certificate(block);
|
|
81146
81184
|
} catch {
|
|
81147
81185
|
continue;
|
|
81148
81186
|
}
|
|
@@ -81270,7 +81308,7 @@ var SIMCTL_SPAWN_TIMEOUT_MS = 1e4;
|
|
|
81270
81308
|
var SIMCTL_KILL_SIGNAL = "SIGKILL";
|
|
81271
81309
|
|
|
81272
81310
|
// ../tool-server/src/utils/ios-device-sets.ts
|
|
81273
|
-
var
|
|
81311
|
+
var fs22 = __toESM(require("node:fs"));
|
|
81274
81312
|
var import_node_child_process13 = require("node:child_process");
|
|
81275
81313
|
var import_node_util10 = require("node:util");
|
|
81276
81314
|
init_src2();
|
|
@@ -81289,7 +81327,7 @@ function rememberDeviceSet(udid, deviceSet) {
|
|
|
81289
81327
|
deviceSetByUdid.set(udid, deviceSet);
|
|
81290
81328
|
}
|
|
81291
81329
|
async function setContainsUdid(deviceSet, udid) {
|
|
81292
|
-
if (deviceSet && !
|
|
81330
|
+
if (deviceSet && !fs22.existsSync(deviceSet)) return false;
|
|
81293
81331
|
try {
|
|
81294
81332
|
const { stdout } = await execFileAsync9(
|
|
81295
81333
|
"xcrun",
|
|
@@ -81698,7 +81736,7 @@ async function setAccessibilityPrefsPreBoot(udid, { isTvOs }) {
|
|
|
81698
81736
|
}
|
|
81699
81737
|
|
|
81700
81738
|
// ../tool-server/src/utils/ios-devices.ts
|
|
81701
|
-
var
|
|
81739
|
+
var fs23 = __toESM(require("node:fs"));
|
|
81702
81740
|
var path21 = __toESM(require("node:path"));
|
|
81703
81741
|
var import_node_child_process15 = require("node:child_process");
|
|
81704
81742
|
var import_node_util12 = require("node:util");
|
|
@@ -81714,7 +81752,7 @@ function simulatorRuntimeKind(runtimeId) {
|
|
|
81714
81752
|
return runtimeId.includes("iOS") ? "mobile" : void 0;
|
|
81715
81753
|
}
|
|
81716
81754
|
async function listDeviceSetSimulators(deviceSet) {
|
|
81717
|
-
if (deviceSet && !
|
|
81755
|
+
if (deviceSet && !fs23.existsSync(deviceSet)) return { simulators: [], timedOut: false };
|
|
81718
81756
|
try {
|
|
81719
81757
|
const { stdout } = await execFileAsync11(
|
|
81720
81758
|
"xcrun",
|
|
@@ -81841,7 +81879,7 @@ async function deviceTypeBundlePath(identifier) {
|
|
|
81841
81879
|
}
|
|
81842
81880
|
async function countIntegratedDisplays(bundlePath) {
|
|
81843
81881
|
const plist = path21.join(bundlePath, "Contents", "Resources", "capabilities.plist");
|
|
81844
|
-
if (!
|
|
81882
|
+
if (!fs23.existsSync(plist)) return 0;
|
|
81845
81883
|
try {
|
|
81846
81884
|
const { stdout } = await execFileAsync11(
|
|
81847
81885
|
"plutil",
|
|
@@ -100565,7 +100603,7 @@ async function discardHeldTouch(deviceId, owner) {
|
|
|
100565
100603
|
|
|
100566
100604
|
// ../tool-server/src/utils/foldable.ts
|
|
100567
100605
|
var import_node_child_process17 = require("node:child_process");
|
|
100568
|
-
var
|
|
100606
|
+
var fs24 = __toESM(require("node:fs"));
|
|
100569
100607
|
var import_node_util14 = require("node:util");
|
|
100570
100608
|
init_external_devices();
|
|
100571
100609
|
var execFileAsync13 = (0, import_node_util14.promisify)(import_node_child_process17.execFile);
|
|
@@ -100644,7 +100682,7 @@ async function readCoreDeviceDisplays(udid) {
|
|
|
100644
100682
|
const args = ["device", "info", "displays", "--device", nativeUdid, "--json-output", "-"];
|
|
100645
100683
|
const dir = await developerDir();
|
|
100646
100684
|
const env = dir ? { ...process.env, DEVELOPER_DIR: dir } : process.env;
|
|
100647
|
-
const [bin, argv] =
|
|
100685
|
+
const [bin, argv] = fs24.existsSync(DEVICECTL_BIN) ? [DEVICECTL_BIN, args] : ["xcrun", ["devicectl", ...args]];
|
|
100648
100686
|
if (bin === "xcrun" && xcodeFirstLaunchPending("devicectl")) {
|
|
100649
100687
|
return {
|
|
100650
100688
|
displays: null,
|
|
@@ -100988,10 +101026,10 @@ function uiScreenSize(size, orientation) {
|
|
|
100988
101026
|
}
|
|
100989
101027
|
|
|
100990
101028
|
// ../tool-server/src/utils/simulator-client.ts
|
|
100991
|
-
var
|
|
101029
|
+
var fs25 = __toESM(require("node:fs/promises"));
|
|
100992
101030
|
var path22 = __toESM(require("node:path"));
|
|
100993
101031
|
var os5 = __toESM(require("node:os"));
|
|
100994
|
-
var
|
|
101032
|
+
var import_node_crypto9 = require("node:crypto");
|
|
100995
101033
|
var import_node_url = require("node:url");
|
|
100996
101034
|
var DEFAULT_SCREENSHOT_SCALE = 0.25;
|
|
100997
101035
|
var TV_DEFAULT_LONG_SIDE = 576;
|
|
@@ -101560,9 +101598,9 @@ function routeViaTransport(transport, cmd) {
|
|
|
101560
101598
|
function createMoqTransport(moq, options) {
|
|
101561
101599
|
const screenshotDir = path22.join(os5.tmpdir(), "argent-remote-screenshots");
|
|
101562
101600
|
const writeScreenshotToDisk = async (bytes) => {
|
|
101563
|
-
await
|
|
101564
|
-
const file2 = path22.join(screenshotDir, `${(0,
|
|
101565
|
-
await
|
|
101601
|
+
await fs25.mkdir(screenshotDir, { recursive: true });
|
|
101602
|
+
const file2 = path22.join(screenshotDir, `${(0, import_node_crypto9.randomUUID)()}.png`);
|
|
101603
|
+
await fs25.writeFile(file2, bytes);
|
|
101566
101604
|
return { url: (0, import_node_url.pathToFileURL)(file2).toString(), path: file2 };
|
|
101567
101605
|
};
|
|
101568
101606
|
return {
|
|
@@ -101600,12 +101638,12 @@ function createMoqTransport(moq, options) {
|
|
|
101600
101638
|
init_external_devices();
|
|
101601
101639
|
|
|
101602
101640
|
// ../tool-server/src/utils/simulator-watcher.ts
|
|
101603
|
-
var
|
|
101641
|
+
var fs30 = __toESM(require("node:fs"));
|
|
101604
101642
|
init_src2();
|
|
101605
101643
|
|
|
101606
101644
|
// ../tool-server/src/blueprints/native-devtools.ts
|
|
101607
101645
|
var net3 = __toESM(require("node:net"));
|
|
101608
|
-
var
|
|
101646
|
+
var fs29 = __toESM(require("node:fs"));
|
|
101609
101647
|
var os6 = __toESM(require("node:os"));
|
|
101610
101648
|
var path25 = __toESM(require("node:path"));
|
|
101611
101649
|
|
|
@@ -101916,17 +101954,17 @@ function asString2(value) {
|
|
|
101916
101954
|
// ../tool-server/src/utils/ios-host.ts
|
|
101917
101955
|
var import_node_child_process18 = require("node:child_process");
|
|
101918
101956
|
var import_node_events = require("node:events");
|
|
101919
|
-
var
|
|
101957
|
+
var fs28 = __toESM(require("node:fs"));
|
|
101920
101958
|
var path24 = __toESM(require("node:path"));
|
|
101921
101959
|
var import_node_util15 = require("node:util");
|
|
101922
101960
|
init_src();
|
|
101923
101961
|
|
|
101924
101962
|
// ../tool-server/src/utils/ios-audio-leftovers.ts
|
|
101925
|
-
var
|
|
101963
|
+
var fs27 = __toESM(require("node:fs"));
|
|
101926
101964
|
var path23 = __toESM(require("node:path"));
|
|
101927
101965
|
|
|
101928
101966
|
// ../tool-server/src/utils/ios-audio-rings.ts
|
|
101929
|
-
var
|
|
101967
|
+
var fs26 = __toESM(require("node:fs"));
|
|
101930
101968
|
init_src2();
|
|
101931
101969
|
var RING_HDR = 128;
|
|
101932
101970
|
var IN_MAGIC = 1229410881;
|
|
@@ -101939,20 +101977,20 @@ var FLOAT_SUBFORMAT = "0300000000001000800000aa00389b71";
|
|
|
101939
101977
|
function putU32(fd, pos, value) {
|
|
101940
101978
|
const b = Buffer.alloc(4);
|
|
101941
101979
|
b.writeUInt32LE(value >>> 0);
|
|
101942
|
-
|
|
101980
|
+
fs26.writeSync(fd, b, 0, 4, pos);
|
|
101943
101981
|
}
|
|
101944
101982
|
function createRing(ringPath, header, dataBytes) {
|
|
101945
|
-
const fd =
|
|
101983
|
+
const fd = fs26.openSync(ringPath, "w+", 384);
|
|
101946
101984
|
const hdr = Buffer.alloc(RING_HDR);
|
|
101947
101985
|
header.forEach((v, i) => hdr.writeUInt32LE(v >>> 0, i * 4));
|
|
101948
|
-
|
|
101949
|
-
|
|
101986
|
+
fs26.writeSync(fd, hdr, 0, RING_HDR, 0);
|
|
101987
|
+
fs26.writeSync(fd, Buffer.alloc(dataBytes), 0, dataBytes, RING_HDR);
|
|
101950
101988
|
return fd;
|
|
101951
101989
|
}
|
|
101952
101990
|
function readClipInfo(fd) {
|
|
101953
101991
|
const head = Buffer.alloc(16384);
|
|
101954
|
-
const read =
|
|
101955
|
-
const size =
|
|
101992
|
+
const read = fs26.readSync(fd, head, 0, head.length, 0);
|
|
101993
|
+
const size = fs26.fstatSync(fd).size;
|
|
101956
101994
|
const bad = (why) => new FailureError(`The converted clip is not mono float32 WAV (${why}).`, {
|
|
101957
101995
|
error_code: FAILURE_CODES.AUDIO_CLIP_CONVERSION_FAILED,
|
|
101958
101996
|
failure_stage: "audio_clip_conversion",
|
|
@@ -101981,7 +102019,7 @@ function readClipInfo(fd) {
|
|
|
101981
102019
|
throw bad("no data chunk");
|
|
101982
102020
|
}
|
|
101983
102021
|
function closeSource(source) {
|
|
101984
|
-
if (source.kind === "clip")
|
|
102022
|
+
if (source.kind === "clip") fs26.closeSync(source.fd);
|
|
101985
102023
|
}
|
|
101986
102024
|
var InputFeeder = class {
|
|
101987
102025
|
constructor(ringPath, source) {
|
|
@@ -102033,7 +102071,7 @@ var InputFeeder = class {
|
|
|
102033
102071
|
this.running = false;
|
|
102034
102072
|
if (this.timer) clearInterval(this.timer);
|
|
102035
102073
|
closeSource(this.source);
|
|
102036
|
-
|
|
102074
|
+
fs26.closeSync(this.fd);
|
|
102037
102075
|
}
|
|
102038
102076
|
step() {
|
|
102039
102077
|
const { readFrame, requestGen } = this.readGuest();
|
|
@@ -102053,13 +102091,13 @@ var InputFeeder = class {
|
|
|
102053
102091
|
this.produce(n);
|
|
102054
102092
|
const start2 = this.writeFrame & RING_CAP - 1;
|
|
102055
102093
|
const first = Math.min(n, RING_CAP - start2);
|
|
102056
|
-
|
|
102057
|
-
if (n > first)
|
|
102094
|
+
fs26.writeSync(this.fd, this.bytes, 0, first * 4, RING_HDR + start2 * 4);
|
|
102095
|
+
if (n > first) fs26.writeSync(this.fd, this.bytes, first * 4, (n - first) * 4, RING_HDR);
|
|
102058
102096
|
this.writeFrame = this.writeFrame + n >>> 0;
|
|
102059
102097
|
putU32(this.fd, 16, this.writeFrame);
|
|
102060
102098
|
}
|
|
102061
102099
|
readGuest() {
|
|
102062
|
-
|
|
102100
|
+
fs26.readSync(this.fd, this.guest, 0, 12, 64);
|
|
102063
102101
|
return { readFrame: this.guest.readUInt32LE(0), requestGen: this.guest.readUInt32LE(4) };
|
|
102064
102102
|
}
|
|
102065
102103
|
/** The source starts again from its beginning, with its full play count, at the next frame written. */
|
|
@@ -102094,7 +102132,7 @@ var InputFeeder = class {
|
|
|
102094
102132
|
this.clipPos = 0;
|
|
102095
102133
|
}
|
|
102096
102134
|
const take2 = Math.min(s.info.frames - this.clipPos, n - off);
|
|
102097
|
-
const got =
|
|
102135
|
+
const got = fs26.readSync(
|
|
102098
102136
|
s.fd,
|
|
102099
102137
|
this.bytes,
|
|
102100
102138
|
off * 4,
|
|
@@ -102114,13 +102152,13 @@ var InputFeeder = class {
|
|
|
102114
102152
|
};
|
|
102115
102153
|
function readInCursors(ringPath) {
|
|
102116
102154
|
try {
|
|
102117
|
-
const fd =
|
|
102155
|
+
const fd = fs26.openSync(ringPath, "r");
|
|
102118
102156
|
try {
|
|
102119
102157
|
const b = Buffer.alloc(RING_HDR);
|
|
102120
|
-
if (
|
|
102158
|
+
if (fs26.readSync(fd, b, 0, RING_HDR, 0) < 68 || b.readUInt32LE(0) !== IN_MAGIC) return null;
|
|
102121
102159
|
return { write: b.readUInt32LE(16), read: b.readUInt32LE(64) };
|
|
102122
102160
|
} finally {
|
|
102123
|
-
|
|
102161
|
+
fs26.closeSync(fd);
|
|
102124
102162
|
}
|
|
102125
102163
|
} catch {
|
|
102126
102164
|
return null;
|
|
@@ -102153,20 +102191,20 @@ async function abandoned(text) {
|
|
|
102153
102191
|
const owner = Number(field(text, "host"));
|
|
102154
102192
|
if (owner > 0) return !processAlive(owner);
|
|
102155
102193
|
const ring = field(text, "ring");
|
|
102156
|
-
if (!ring || !
|
|
102194
|
+
if (!ring || !fs27.existsSync(ring)) return true;
|
|
102157
102195
|
return feederGone(ring);
|
|
102158
102196
|
}
|
|
102159
102197
|
async function clearAudioLeftovers(dir) {
|
|
102160
102198
|
let names;
|
|
102161
102199
|
try {
|
|
102162
|
-
names =
|
|
102200
|
+
names = fs27.readdirSync(dir);
|
|
102163
102201
|
} catch {
|
|
102164
102202
|
return;
|
|
102165
102203
|
}
|
|
102166
102204
|
let liveUnmarkedInput = false;
|
|
102167
102205
|
const read = (file2) => {
|
|
102168
102206
|
try {
|
|
102169
|
-
return
|
|
102207
|
+
return fs27.readFileSync(file2, "utf8");
|
|
102170
102208
|
} catch {
|
|
102171
102209
|
return null;
|
|
102172
102210
|
}
|
|
@@ -102181,10 +102219,10 @@ async function clearAudioLeftovers(dir) {
|
|
|
102181
102219
|
continue;
|
|
102182
102220
|
}
|
|
102183
102221
|
if (read(file2) !== text) continue;
|
|
102184
|
-
|
|
102222
|
+
fs27.rmSync(file2, { force: true });
|
|
102185
102223
|
const ring = field(text, "ring");
|
|
102186
102224
|
if (ring && path23.dirname(ring) === dir && /^in-/.test(path23.basename(ring))) {
|
|
102187
|
-
|
|
102225
|
+
fs27.rmSync(ring, { force: true });
|
|
102188
102226
|
}
|
|
102189
102227
|
}
|
|
102190
102228
|
for (const name of names) {
|
|
@@ -102193,13 +102231,13 @@ async function clearAudioLeftovers(dir) {
|
|
|
102193
102231
|
const text = read(file2);
|
|
102194
102232
|
if (text === null) continue;
|
|
102195
102233
|
const pid = Number(field(text, "pid"));
|
|
102196
|
-
if (pid > 0 && !processAlive(pid) && read(file2) === text)
|
|
102234
|
+
if (pid > 0 && !processAlive(pid) && read(file2) === text) fs27.rmSync(file2, { force: true });
|
|
102197
102235
|
}
|
|
102198
102236
|
for (const name of names) {
|
|
102199
102237
|
const owner = /^(?:in|clip)-(\d+)-/.exec(name);
|
|
102200
102238
|
const unmarked = !owner && /^(?:in|clip)-/.test(name) && !liveUnmarkedInput;
|
|
102201
102239
|
if (owner && !processAlive(Number(owner[1])) || unmarked) {
|
|
102202
|
-
|
|
102240
|
+
fs27.rmSync(path23.join(dir, name), { force: true });
|
|
102203
102241
|
}
|
|
102204
102242
|
}
|
|
102205
102243
|
}
|
|
@@ -102237,7 +102275,7 @@ function shouldPreserveDyldInsertLibrariesEntry(entry, bootstrapPath) {
|
|
|
102237
102275
|
if (entry.startsWith("@")) {
|
|
102238
102276
|
return true;
|
|
102239
102277
|
}
|
|
102240
|
-
return
|
|
102278
|
+
return fs28.existsSync(entry);
|
|
102241
102279
|
}
|
|
102242
102280
|
function audioDir(udid) {
|
|
102243
102281
|
return `/tmp/argent-audio-${udid}`;
|
|
@@ -102353,7 +102391,7 @@ function setEndpointEnv(endpoint, launchctl) {
|
|
|
102353
102391
|
}
|
|
102354
102392
|
async function setAudioDirEnv(nativeId, launchctl) {
|
|
102355
102393
|
try {
|
|
102356
|
-
|
|
102394
|
+
fs28.mkdirSync(audioDir(nativeId), { recursive: true, mode: 448 });
|
|
102357
102395
|
await launchctl(["setenv", "ARGENT_AUDIO_DIR", audioDir(nativeId)]);
|
|
102358
102396
|
} catch (err) {
|
|
102359
102397
|
process.stderr.write(`[ios-host] audio setup failed for ${nativeId}: ${String(err)}
|
|
@@ -102606,10 +102644,10 @@ async function enableAppAccessibilityBeforeLaunch(device) {
|
|
|
102606
102644
|
}
|
|
102607
102645
|
|
|
102608
102646
|
// ../tool-server/src/blueprints/ios-network-records.ts
|
|
102609
|
-
var
|
|
102647
|
+
var import_node_crypto10 = require("node:crypto");
|
|
102610
102648
|
var import_node_http2 = require("node:http");
|
|
102611
102649
|
init_src2();
|
|
102612
|
-
var RUN_TAG = (0,
|
|
102650
|
+
var RUN_TAG = (0, import_node_crypto10.randomBytes)(2).toString("hex");
|
|
102613
102651
|
var IOS_NATIVE_REQUEST_ID = /^ios-[0-9a-f]{4}-\d+$/;
|
|
102614
102652
|
var MACOS_NATIVE_REQUEST_ID = /^macos-[0-9a-f]{4}-\d+$/;
|
|
102615
102653
|
var nextRecordNumber = 1;
|
|
@@ -103199,7 +103237,7 @@ function bindNativeDevtoolsUnixSocket(server, socketPath) {
|
|
|
103199
103237
|
if ((err.code === "EADDRINUSE" || err.code === "EEXIST") && !retried) {
|
|
103200
103238
|
retried = true;
|
|
103201
103239
|
try {
|
|
103202
|
-
|
|
103240
|
+
fs29.unlinkSync(socketPath);
|
|
103203
103241
|
} catch {
|
|
103204
103242
|
}
|
|
103205
103243
|
server.listen(socketPath);
|
|
@@ -103533,9 +103571,9 @@ var nativeDevtoolsBlueprint = {
|
|
|
103533
103571
|
Math.trunc(amount("uploadThroughput"))
|
|
103534
103572
|
]);
|
|
103535
103573
|
};
|
|
103536
|
-
const readOwnedKeys = (bundleId) =>
|
|
103574
|
+
const readOwnedKeys = (bundleId) => fs29.existsSync(ownedThrottlePath(bundleId)) ? fs29.readFileSync(ownedThrottlePath(bundleId), "utf8").split("\n") : [];
|
|
103537
103575
|
const recordOwnedKeys = (bundleId, keys) => {
|
|
103538
|
-
if (lentSocketPath)
|
|
103576
|
+
if (lentSocketPath) fs29.writeFileSync(ownedThrottlePath(bundleId), keys.join("\n"));
|
|
103539
103577
|
};
|
|
103540
103578
|
const applyThrottle = async (bundleId, throttle) => {
|
|
103541
103579
|
await noteProviderCapture(bundleId);
|
|
@@ -103551,11 +103589,11 @@ var nativeDevtoolsBlueprint = {
|
|
|
103551
103589
|
await sendCdpRpc(bundleId, "NativeDevtoolsIos.configure", { bypassPorts: [] });
|
|
103552
103590
|
await sendCdpRpc(bundleId, keepsCapture(bundleId) ? "Network.enable" : "Network.disable");
|
|
103553
103591
|
providerCapture.delete(bundleId);
|
|
103554
|
-
|
|
103592
|
+
fs29.rmSync(ownedThrottlePath(bundleId), { force: true });
|
|
103555
103593
|
};
|
|
103556
103594
|
const isEmulating = (state3) => state3?.offline === true || ["latency", "downloadThroughput", "uploadThroughput"].some((key2) => Number(state3?.[key2]) > 0);
|
|
103557
103595
|
const clearLeftoverThrottle = async (bundleId) => {
|
|
103558
|
-
if (!lentSocketPath || !
|
|
103596
|
+
if (!lentSocketPath || !fs29.existsSync(ownedThrottlePath(bundleId))) return;
|
|
103559
103597
|
const method = "NativeDevtoolsIos.getConditions";
|
|
103560
103598
|
const state3 = await sendCdpRpc(bundleId, method).catch((err) => {
|
|
103561
103599
|
if (err instanceof Error && err.message.endsWith(`Unsupported method: ${method}`))
|
|
@@ -103563,7 +103601,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
103563
103601
|
throw err;
|
|
103564
103602
|
});
|
|
103565
103603
|
if (!isEmulating(state3) || !readOwnedKeys(bundleId).includes(conditionsKey(state3))) {
|
|
103566
|
-
|
|
103604
|
+
fs29.rmSync(ownedThrottlePath(bundleId), { force: true });
|
|
103567
103605
|
return;
|
|
103568
103606
|
}
|
|
103569
103607
|
providerCapture.set(bundleId, true);
|
|
@@ -103647,7 +103685,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
103647
103685
|
};
|
|
103648
103686
|
if (transport === "unix" && !lentSocketPath) {
|
|
103649
103687
|
try {
|
|
103650
|
-
|
|
103688
|
+
fs29.unlinkSync(socketPath);
|
|
103651
103689
|
} catch {
|
|
103652
103690
|
}
|
|
103653
103691
|
}
|
|
@@ -104114,7 +104152,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
104114
104152
|
server?.close();
|
|
104115
104153
|
if (transport === "unix" && !lentSocketPath) {
|
|
104116
104154
|
try {
|
|
104117
|
-
|
|
104155
|
+
fs29.unlinkSync(socketPath);
|
|
104118
104156
|
} catch {
|
|
104119
104157
|
}
|
|
104120
104158
|
}
|
|
@@ -104277,7 +104315,7 @@ async function getBootedUdidsInSet(deviceSet, signal) {
|
|
|
104277
104315
|
async function getBootedUdids(signal) {
|
|
104278
104316
|
const sets = [
|
|
104279
104317
|
null,
|
|
104280
|
-
...configuredAdditionalDeviceSets().filter((p) =>
|
|
104318
|
+
...configuredAdditionalDeviceSets().filter((p) => fs30.existsSync(p))
|
|
104281
104319
|
];
|
|
104282
104320
|
const perSet = await Promise.allSettled(sets.map((set2) => getBootedUdidsInSet(set2, signal)));
|
|
104283
104321
|
const failures = perSet.flatMap((r) => r.status === "rejected" ? [r.reason] : []);
|
|
@@ -105165,10 +105203,10 @@ init_adb();
|
|
|
105165
105203
|
// ../tool-server/src/utils/ios-device/devicectl.ts
|
|
105166
105204
|
var import_node_child_process22 = require("node:child_process");
|
|
105167
105205
|
var import_node_util17 = require("node:util");
|
|
105168
|
-
var
|
|
105206
|
+
var fs31 = __toESM(require("node:fs/promises"));
|
|
105169
105207
|
var os7 = __toESM(require("node:os"));
|
|
105170
105208
|
var path26 = __toESM(require("node:path"));
|
|
105171
|
-
var
|
|
105209
|
+
var import_node_crypto11 = require("node:crypto");
|
|
105172
105210
|
var import_node_net = require("node:net");
|
|
105173
105211
|
init_src2();
|
|
105174
105212
|
var execFileAsync16 = (0, import_node_util17.promisify)(import_node_child_process22.execFile);
|
|
@@ -105217,7 +105255,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105217
105255
|
let jsonPath = null;
|
|
105218
105256
|
const argv = ["devicectl", ...args];
|
|
105219
105257
|
if (opts.json) {
|
|
105220
|
-
jsonPath = path26.join(os7.tmpdir(), `argent-devicectl-${process.pid}-${(0,
|
|
105258
|
+
jsonPath = path26.join(os7.tmpdir(), `argent-devicectl-${process.pid}-${(0, import_node_crypto11.randomUUID)()}.json`);
|
|
105221
105259
|
argv.push("--json-output", jsonPath);
|
|
105222
105260
|
}
|
|
105223
105261
|
try {
|
|
@@ -105229,7 +105267,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105229
105267
|
let json2 = null;
|
|
105230
105268
|
if (jsonPath) {
|
|
105231
105269
|
try {
|
|
105232
|
-
json2 = JSON.parse(await
|
|
105270
|
+
json2 = JSON.parse(await fs31.readFile(jsonPath, "utf8"));
|
|
105233
105271
|
} catch {
|
|
105234
105272
|
json2 = null;
|
|
105235
105273
|
}
|
|
@@ -105241,7 +105279,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105241
105279
|
let errorJson = null;
|
|
105242
105280
|
if (jsonPath) {
|
|
105243
105281
|
try {
|
|
105244
|
-
errorJson = JSON.parse(await
|
|
105282
|
+
errorJson = JSON.parse(await fs31.readFile(jsonPath, "utf8"));
|
|
105245
105283
|
} catch {
|
|
105246
105284
|
errorJson = null;
|
|
105247
105285
|
}
|
|
@@ -105260,7 +105298,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105260
105298
|
}
|
|
105261
105299
|
);
|
|
105262
105300
|
} finally {
|
|
105263
|
-
if (jsonPath) await
|
|
105301
|
+
if (jsonPath) await fs31.rm(jsonPath, { force: true }).catch(() => {
|
|
105264
105302
|
});
|
|
105265
105303
|
}
|
|
105266
105304
|
}
|
|
@@ -105500,8 +105538,8 @@ init_harmony_flag();
|
|
|
105500
105538
|
|
|
105501
105539
|
// ../tool-server/src/utils/macos-apps.ts
|
|
105502
105540
|
var import_node_child_process23 = require("node:child_process");
|
|
105503
|
-
var
|
|
105504
|
-
var
|
|
105541
|
+
var import_node_crypto13 = require("node:crypto");
|
|
105542
|
+
var fs33 = __toESM(require("node:fs"));
|
|
105505
105543
|
var os8 = __toESM(require("node:os"));
|
|
105506
105544
|
var path28 = __toESM(require("node:path"));
|
|
105507
105545
|
var import_node_util18 = require("node:util");
|
|
@@ -105513,8 +105551,8 @@ init_macos_app_kind();
|
|
|
105513
105551
|
init_src();
|
|
105514
105552
|
|
|
105515
105553
|
// ../tool-server/src/utils/argent-home-id.ts
|
|
105516
|
-
var
|
|
105517
|
-
var
|
|
105554
|
+
var import_node_crypto12 = require("node:crypto");
|
|
105555
|
+
var fs32 = __toESM(require("node:fs"));
|
|
105518
105556
|
var import_node_os6 = require("node:os");
|
|
105519
105557
|
var path27 = __toESM(require("node:path"));
|
|
105520
105558
|
init_src();
|
|
@@ -105522,11 +105560,11 @@ var ARGENT_HOME_HEADER = "x-argent-home";
|
|
|
105522
105560
|
function canonicalDir(dir) {
|
|
105523
105561
|
const resolved = path27.resolve(dir);
|
|
105524
105562
|
const parent = path27.dirname(resolved);
|
|
105525
|
-
if (
|
|
105563
|
+
if (fs32.existsSync(resolved) || parent === resolved) return canonicalPath(resolved);
|
|
105526
105564
|
return path27.join(canonicalDir(parent), path27.basename(resolved));
|
|
105527
105565
|
}
|
|
105528
105566
|
function argentHomeId(dir = argentHomeDir()) {
|
|
105529
|
-
return (0,
|
|
105567
|
+
return (0, import_node_crypto12.createHash)("sha256").update(canonicalDir(dir)).digest("hex").slice(0, 12);
|
|
105530
105568
|
}
|
|
105531
105569
|
function peerArgentHomeId(header) {
|
|
105532
105570
|
if (typeof header === "string" && header) return header;
|
|
@@ -105599,13 +105637,13 @@ function macosSocketDir() {
|
|
|
105599
105637
|
var BOOTSTRAP_NAME = "libArgentInjectionBootstrap.dylib";
|
|
105600
105638
|
var LIBRARY_NAME = "libNativeDevtoolsMacos.dylib";
|
|
105601
105639
|
function stageMacosLibraries(bootstrapPath, libraryPath, teamId) {
|
|
105602
|
-
const bootstrap =
|
|
105603
|
-
const library =
|
|
105640
|
+
const bootstrap = fs33.readFileSync(bootstrapPath);
|
|
105641
|
+
const library = fs33.readFileSync(libraryPath);
|
|
105604
105642
|
const hash2 = libraryHash(bootstrap, library);
|
|
105605
105643
|
const name = teamId ? `${hash2}-${teamId}` : hash2;
|
|
105606
105644
|
const libRoot = macosLibraryRoot();
|
|
105607
105645
|
const targets = STAGED_NAME_SUFFIXES.map((suffix) => path28.join(libRoot, name + suffix));
|
|
105608
|
-
|
|
105646
|
+
fs33.mkdirSync(libRoot, { recursive: true, mode: 448 });
|
|
105609
105647
|
void removeUnusedLibraries(libRoot, hash2);
|
|
105610
105648
|
void removeUnusedLibraries(path28.join(argentHomeDir(), "macos", "lib"), void 0, hash2);
|
|
105611
105649
|
const source = JSON.stringify([path28.resolve(bootstrapPath), path28.resolve(libraryPath)]);
|
|
@@ -105615,28 +105653,28 @@ function stageMacosLibraries(bootstrapPath, libraryPath, teamId) {
|
|
|
105615
105653
|
};
|
|
105616
105654
|
const complete = targets.find(isCompleteCopy);
|
|
105617
105655
|
if (complete) return reuse2(complete);
|
|
105618
|
-
const temp =
|
|
105656
|
+
const temp = fs33.mkdtempSync(path28.join(libRoot, `.tmp-${name}-`));
|
|
105619
105657
|
try {
|
|
105620
|
-
|
|
105621
|
-
|
|
105622
|
-
|
|
105658
|
+
fs33.writeFileSync(path28.join(temp, BOOTSTRAP_NAME), bootstrap, { mode: 493 });
|
|
105659
|
+
fs33.writeFileSync(path28.join(temp, LIBRARY_NAME), library, { mode: 493 });
|
|
105660
|
+
fs33.writeFileSync(path28.join(temp, SOURCES_NAME), `${source}
|
|
105623
105661
|
`, { mode: 384 });
|
|
105624
105662
|
for (const target of targets) {
|
|
105625
105663
|
if (tryRename(temp, target)) return path28.join(target, BOOTSTRAP_NAME);
|
|
105626
105664
|
if (isCompleteCopy(target)) return reuse2(target);
|
|
105627
105665
|
}
|
|
105628
105666
|
} finally {
|
|
105629
|
-
|
|
105667
|
+
fs33.rmSync(temp, { recursive: true, force: true });
|
|
105630
105668
|
}
|
|
105631
105669
|
throw new Error(`${targets.join(", ")} hold incomplete copies of the library`);
|
|
105632
105670
|
}
|
|
105633
105671
|
var STAGED_NAME_SUFFIXES = ["", ".2", ".3"];
|
|
105634
105672
|
function isCompleteCopy(dir) {
|
|
105635
|
-
return
|
|
105673
|
+
return fs33.existsSync(path28.join(dir, BOOTSTRAP_NAME)) && fs33.existsSync(path28.join(dir, LIBRARY_NAME));
|
|
105636
105674
|
}
|
|
105637
105675
|
function tryRename(from2, to) {
|
|
105638
105676
|
try {
|
|
105639
|
-
|
|
105677
|
+
fs33.renameSync(from2, to);
|
|
105640
105678
|
return true;
|
|
105641
105679
|
} catch {
|
|
105642
105680
|
return false;
|
|
@@ -105644,13 +105682,13 @@ function tryRename(from2, to) {
|
|
|
105644
105682
|
}
|
|
105645
105683
|
var SOURCES_NAME = "sources";
|
|
105646
105684
|
function libraryHash(bootstrap, library) {
|
|
105647
|
-
return (0,
|
|
105685
|
+
return (0, import_node_crypto13.createHash)("sha256").update(`${bootstrap.length}:`).update(bootstrap).update(`${library.length}:`).update(library).digest("hex").slice(0, 16);
|
|
105648
105686
|
}
|
|
105649
105687
|
function recordLibrarySource(dir, source) {
|
|
105650
105688
|
const file2 = path28.join(dir, SOURCES_NAME);
|
|
105651
105689
|
try {
|
|
105652
|
-
const known =
|
|
105653
|
-
if (!known.includes(source))
|
|
105690
|
+
const known = fs33.existsSync(file2) ? fs33.readFileSync(file2, "utf8").split("\n") : [];
|
|
105691
|
+
if (!known.includes(source)) fs33.appendFileSync(file2, `${source}
|
|
105654
105692
|
`, { mode: 384 });
|
|
105655
105693
|
} catch {
|
|
105656
105694
|
}
|
|
@@ -105664,7 +105702,7 @@ function inPrivacyProtectedFolder(file2) {
|
|
|
105664
105702
|
async function librarySourceInstalled(dir, name) {
|
|
105665
105703
|
let lines;
|
|
105666
105704
|
try {
|
|
105667
|
-
lines = (await
|
|
105705
|
+
lines = (await fs33.promises.readFile(path28.join(dir, SOURCES_NAME), "utf8")).split("\n");
|
|
105668
105706
|
} catch {
|
|
105669
105707
|
return false;
|
|
105670
105708
|
}
|
|
@@ -105679,7 +105717,7 @@ async function librarySourceInstalled(dir, name) {
|
|
|
105679
105717
|
if (files.some((file2) => inPrivacyProtectedFolder(String(file2)))) return true;
|
|
105680
105718
|
try {
|
|
105681
105719
|
const [bootstrap, library] = await Promise.all(
|
|
105682
|
-
files.map((file2) =>
|
|
105720
|
+
files.map((file2) => fs33.promises.readFile(String(file2)))
|
|
105683
105721
|
);
|
|
105684
105722
|
if (name.startsWith(libraryHash(bootstrap, library))) return true;
|
|
105685
105723
|
} catch (err) {
|
|
@@ -105690,7 +105728,7 @@ async function librarySourceInstalled(dir, name) {
|
|
|
105690
105728
|
}
|
|
105691
105729
|
async function removeUnusedLibraries(libRoot, keep, superseded) {
|
|
105692
105730
|
try {
|
|
105693
|
-
const root =
|
|
105731
|
+
const root = fs33.realpathSync(libRoot);
|
|
105694
105732
|
let open5;
|
|
105695
105733
|
try {
|
|
105696
105734
|
({ stdout: open5 } = await execFileAsync17("lsof", ["-Fn", "+D", root], {
|
|
@@ -105705,7 +105743,7 @@ async function removeUnusedLibraries(libRoot, keep, superseded) {
|
|
|
105705
105743
|
const used = new Set(
|
|
105706
105744
|
open5.split("\n").filter((line) => line.startsWith(`n${root}/`)).map((line) => line.slice(root.length + 2).split("/")[0])
|
|
105707
105745
|
);
|
|
105708
|
-
for (const name of
|
|
105746
|
+
for (const name of fs33.readdirSync(root)) {
|
|
105709
105747
|
const dir = path28.join(root, name);
|
|
105710
105748
|
const current = keep !== void 0 && name.startsWith(keep);
|
|
105711
105749
|
if (used.has(name) || current && isCompleteCopy(dir)) continue;
|
|
@@ -105715,14 +105753,14 @@ async function removeUnusedLibraries(libRoot, keep, superseded) {
|
|
|
105715
105753
|
if (!current && !temporary && !restaged && await librarySourceInstalled(dir, name)) {
|
|
105716
105754
|
continue;
|
|
105717
105755
|
}
|
|
105718
|
-
|
|
105756
|
+
fs33.rmSync(dir, { recursive: true, force: true });
|
|
105719
105757
|
}
|
|
105720
105758
|
} catch {
|
|
105721
105759
|
}
|
|
105722
105760
|
}
|
|
105723
105761
|
var STAGING_TEMP_MAX_AGE_MS = 10 * 6e4;
|
|
105724
105762
|
function isRecent(dir) {
|
|
105725
|
-
return Date.now() -
|
|
105763
|
+
return Date.now() - fs33.lstatSync(dir).mtimeMs < STAGING_TEMP_MAX_AGE_MS;
|
|
105726
105764
|
}
|
|
105727
105765
|
var EXPORTED_RELEASE_NOTE = "An exported or notarized Release build with the hardened runtime cannot be driven without extra entitlements.";
|
|
105728
105766
|
async function signatureTeam(file2) {
|
|
@@ -105778,14 +105816,14 @@ function macosListenSocket(bundleId, sandboxed) {
|
|
|
105778
105816
|
if (!dir) return null;
|
|
105779
105817
|
const named = path28.join(dir, `${bundleId}.sock`);
|
|
105780
105818
|
if (fitsSocketPath(named)) return { env: named, path: named };
|
|
105781
|
-
const hash2 = (0,
|
|
105819
|
+
const hash2 = (0, import_node_crypto13.createHash)("sha256").update(bundleId).digest("hex").slice(0, 16);
|
|
105782
105820
|
const hashed = path28.join(dir, `${hash2}.sock`);
|
|
105783
105821
|
return fitsSocketPath(hashed) ? { env: hashed, path: hashed } : null;
|
|
105784
105822
|
}
|
|
105785
105823
|
function prepareSocketDir(socketPath) {
|
|
105786
105824
|
const dir = path28.dirname(socketPath);
|
|
105787
|
-
|
|
105788
|
-
const stat11 =
|
|
105825
|
+
fs33.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
105826
|
+
const stat11 = fs33.lstatSync(dir);
|
|
105789
105827
|
if (!stat11.isDirectory() || stat11.uid !== process.getuid?.() || (stat11.mode & 63) !== 0) {
|
|
105790
105828
|
throw macosFailure(
|
|
105791
105829
|
`${dir} belongs to another user or others can open it, so argent cannot keep the app's socket private there.`,
|
|
@@ -105812,7 +105850,7 @@ function isTrackedMacosApp(value) {
|
|
|
105812
105850
|
function readTrackedApps() {
|
|
105813
105851
|
let raw;
|
|
105814
105852
|
try {
|
|
105815
|
-
raw = JSON.parse(
|
|
105853
|
+
raw = JSON.parse(fs33.readFileSync(trackedMacosAppsFile(), "utf8"));
|
|
105816
105854
|
} catch {
|
|
105817
105855
|
return [];
|
|
105818
105856
|
}
|
|
@@ -105821,10 +105859,8 @@ function readTrackedApps() {
|
|
|
105821
105859
|
function recordTrackedMacosApp(app) {
|
|
105822
105860
|
const file2 = trackedMacosAppsFile();
|
|
105823
105861
|
const others = readTrackedApps().filter((a) => a.bundleId !== app.bundleId);
|
|
105824
|
-
|
|
105825
|
-
|
|
105826
|
-
fs32.writeFileSync(tmp, JSON.stringify([...others, app], null, 2) + "\n");
|
|
105827
|
-
fs32.renameSync(tmp, file2);
|
|
105862
|
+
fs33.mkdirSync(path28.dirname(file2), { recursive: true });
|
|
105863
|
+
writeFileAtomicSync(file2, JSON.stringify([...others, app], null, 2) + "\n");
|
|
105828
105864
|
}
|
|
105829
105865
|
function getTrackedMacosApp(bundleId) {
|
|
105830
105866
|
return readTrackedApps().find((a) => a.bundleId === bundleId);
|
|
@@ -105900,7 +105936,7 @@ async function findRunningCopies(bundleId, executable, skipPid) {
|
|
|
105900
105936
|
if (!command2.endsWith(suffix)) continue;
|
|
105901
105937
|
let resolved;
|
|
105902
105938
|
try {
|
|
105903
|
-
resolved =
|
|
105939
|
+
resolved = fs33.realpathSync(command2);
|
|
105904
105940
|
} catch {
|
|
105905
105941
|
continue;
|
|
105906
105942
|
}
|
|
@@ -105925,7 +105961,7 @@ async function gitWorktreeOf(dir) {
|
|
|
105925
105961
|
);
|
|
105926
105962
|
const [top, common] = stdout.trim().split("\n");
|
|
105927
105963
|
if (!top || !common) return null;
|
|
105928
|
-
return { top:
|
|
105964
|
+
return { top: fs33.realpathSync(top), common: fs33.realpathSync(common) };
|
|
105929
105965
|
} catch {
|
|
105930
105966
|
return null;
|
|
105931
105967
|
}
|
|
@@ -105945,7 +105981,7 @@ var CHROMIUM_BROWSER_FRAMEWORK = /\b(chrome|chromium|edge|brave|vivaldi|opera)\b
|
|
|
105945
105981
|
function chromiumKind(appPath) {
|
|
105946
105982
|
let frameworks;
|
|
105947
105983
|
try {
|
|
105948
|
-
frameworks =
|
|
105984
|
+
frameworks = fs33.readdirSync(path28.join(appPath, "Contents", "Frameworks"));
|
|
105949
105985
|
} catch {
|
|
105950
105986
|
return void 0;
|
|
105951
105987
|
}
|
|
@@ -105962,10 +105998,10 @@ var MAX_LOAD_COMMANDS_BYTES = 1024 * 1024;
|
|
|
105962
105998
|
function isCatalystExecutable(executable) {
|
|
105963
105999
|
let fd;
|
|
105964
106000
|
try {
|
|
105965
|
-
fd =
|
|
106001
|
+
fd = fs33.openSync(executable, "r");
|
|
105966
106002
|
const read = (length, position) => {
|
|
105967
106003
|
const buffer = Buffer.alloc(length);
|
|
105968
|
-
return buffer.subarray(0,
|
|
106004
|
+
return buffer.subarray(0, fs33.readSync(fd, buffer, 0, length, position));
|
|
105969
106005
|
};
|
|
105970
106006
|
const header = read(8, 0);
|
|
105971
106007
|
if (header.length < 8) return false;
|
|
@@ -105982,7 +106018,7 @@ function isCatalystExecutable(executable) {
|
|
|
105982
106018
|
} catch {
|
|
105983
106019
|
return false;
|
|
105984
106020
|
} finally {
|
|
105985
|
-
if (fd !== void 0)
|
|
106021
|
+
if (fd !== void 0) fs33.closeSync(fd);
|
|
105986
106022
|
}
|
|
105987
106023
|
}
|
|
105988
106024
|
function isCatalystSlice(read, offset) {
|
|
@@ -106035,7 +106071,7 @@ function parseCodesignDisplay(output2) {
|
|
|
106035
106071
|
}
|
|
106036
106072
|
function isIosAppWrapper(dir) {
|
|
106037
106073
|
try {
|
|
106038
|
-
return
|
|
106074
|
+
return fs33.statSync(path28.join(dir, "Wrapper")).isDirectory() && fs33.lstatSync(path28.join(dir, "WrappedBundle")).isSymbolicLink();
|
|
106039
106075
|
} catch {
|
|
106040
106076
|
return false;
|
|
106041
106077
|
}
|
|
@@ -106076,7 +106112,7 @@ async function inspectMacosApp(appPath) {
|
|
|
106076
106112
|
const badBundle = (message) => invalid3(message, FAILURE_CODES.MACOS_APP_BUNDLE_INVALID);
|
|
106077
106113
|
let resolved;
|
|
106078
106114
|
try {
|
|
106079
|
-
resolved =
|
|
106115
|
+
resolved = fs33.realpathSync(path28.resolve(appPath));
|
|
106080
106116
|
} catch {
|
|
106081
106117
|
throw invalid3(
|
|
106082
106118
|
`No app bundle at ${appPath}.`,
|
|
@@ -106085,7 +106121,7 @@ async function inspectMacosApp(appPath) {
|
|
|
106085
106121
|
);
|
|
106086
106122
|
}
|
|
106087
106123
|
const plist = path28.join(resolved, "Contents", "Info.plist");
|
|
106088
|
-
if (!
|
|
106124
|
+
if (!fs33.statSync(resolved).isDirectory() || !fs33.existsSync(plist)) {
|
|
106089
106125
|
if (isIosAppWrapper(resolved)) {
|
|
106090
106126
|
throw invalid3(
|
|
106091
106127
|
`${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.`,
|
|
@@ -106115,7 +106151,7 @@ async function inspectMacosApp(appPath) {
|
|
|
106115
106151
|
throw badBundle(`${plist} has no usable CFBundleExecutable.`);
|
|
106116
106152
|
}
|
|
106117
106153
|
const executable = path28.join(resolved, "Contents", "MacOS", executableName);
|
|
106118
|
-
if (!
|
|
106154
|
+
if (!fs33.existsSync(executable)) {
|
|
106119
106155
|
throw badBundle(`The executable ${executable} named by ${plist} does not exist.`);
|
|
106120
106156
|
}
|
|
106121
106157
|
const signature = await readCodeSignature(resolved) ?? parseCodesignDisplay(null);
|
|
@@ -106181,7 +106217,7 @@ async function findMacosAppByBundleId(bundleId) {
|
|
|
106181
106217
|
if (!executable) continue;
|
|
106182
106218
|
let mtimeMs;
|
|
106183
106219
|
try {
|
|
106184
|
-
mtimeMs =
|
|
106220
|
+
mtimeMs = fs33.statSync(path28.join(contents, "MacOS", executable)).mtimeMs;
|
|
106185
106221
|
} catch {
|
|
106186
106222
|
continue;
|
|
106187
106223
|
}
|
|
@@ -106210,7 +106246,7 @@ async function issueSandboxExtension(filePath, opts = {}) {
|
|
|
106210
106246
|
}
|
|
106211
106247
|
|
|
106212
106248
|
// ../tool-server/src/utils/chromium-discovery.ts
|
|
106213
|
-
var
|
|
106249
|
+
var fs36 = __toESM(require("node:fs"));
|
|
106214
106250
|
var path31 = __toESM(require("node:path"));
|
|
106215
106251
|
init_src2();
|
|
106216
106252
|
init_device_info();
|
|
@@ -106222,7 +106258,7 @@ init_src2();
|
|
|
106222
106258
|
init_src2();
|
|
106223
106259
|
|
|
106224
106260
|
// ../tool-server/src/chromium-server/cdp-session.ts
|
|
106225
|
-
var
|
|
106261
|
+
var fs34 = __toESM(require("node:fs"));
|
|
106226
106262
|
var os10 = __toESM(require("node:os"));
|
|
106227
106263
|
var path29 = __toESM(require("node:path"));
|
|
106228
106264
|
init_src2();
|
|
@@ -107060,7 +107096,7 @@ async function primePageSession(cdp) {
|
|
|
107060
107096
|
}
|
|
107061
107097
|
function mediaDir() {
|
|
107062
107098
|
const dir = path29.join(os10.tmpdir(), "argent-chromium-media");
|
|
107063
|
-
|
|
107099
|
+
fs34.mkdirSync(dir, { recursive: true });
|
|
107064
107100
|
return dir;
|
|
107065
107101
|
}
|
|
107066
107102
|
|
|
@@ -107494,7 +107530,7 @@ var ScreencastManager = class {
|
|
|
107494
107530
|
};
|
|
107495
107531
|
|
|
107496
107532
|
// ../tool-server/src/chromium-server/screenshot.ts
|
|
107497
|
-
var
|
|
107533
|
+
var fs35 = __toESM(require("node:fs"));
|
|
107498
107534
|
var path30 = __toESM(require("node:path"));
|
|
107499
107535
|
init_src2();
|
|
107500
107536
|
var sharpCache;
|
|
@@ -107583,7 +107619,7 @@ async function captureScreenshot(ctx, opts = {}) {
|
|
|
107583
107619
|
const stem = opts.id ?? `${Date.now()}-${process.pid}`;
|
|
107584
107620
|
const safeDeviceId = ctx.deviceId.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
107585
107621
|
const filePath = path30.join(mediaDir(), `argent-screenshot-${safeDeviceId}-${stem}.png`);
|
|
107586
|
-
|
|
107622
|
+
fs35.writeFileSync(filePath, bytes);
|
|
107587
107623
|
return {
|
|
107588
107624
|
url: `file://${filePath}`,
|
|
107589
107625
|
path: filePath,
|
|
@@ -107600,7 +107636,7 @@ function readPngSize(buf) {
|
|
|
107600
107636
|
}
|
|
107601
107637
|
async function copyScreenshotToClipboard(ctx, opts = {}) {
|
|
107602
107638
|
const shot = await captureScreenshot(ctx, { rotation: opts.rotation });
|
|
107603
|
-
const bytes =
|
|
107639
|
+
const bytes = fs35.readFileSync(shot.path);
|
|
107604
107640
|
const b64 = bytes.toString("base64");
|
|
107605
107641
|
const script = `(async () => {
|
|
107606
107642
|
const b64 = "${b64}";
|
|
@@ -108311,7 +108347,7 @@ function portsFilePath() {
|
|
|
108311
108347
|
}
|
|
108312
108348
|
function loadPersistedPorts() {
|
|
108313
108349
|
try {
|
|
108314
|
-
const raw = JSON.parse(
|
|
108350
|
+
const raw = JSON.parse(fs36.readFileSync(portsFilePath(), "utf8"));
|
|
108315
108351
|
if (!Array.isArray(raw)) return [];
|
|
108316
108352
|
return raw.filter((p) => typeof p === "number" && p > 0 && p <= 65535);
|
|
108317
108353
|
} catch {
|
|
@@ -108323,8 +108359,8 @@ function persistPorts(mutate) {
|
|
|
108323
108359
|
const file2 = portsFilePath();
|
|
108324
108360
|
const merged = new Set(loadPersistedPorts());
|
|
108325
108361
|
mutate(merged);
|
|
108326
|
-
|
|
108327
|
-
|
|
108362
|
+
fs36.mkdirSync(path31.dirname(file2), { recursive: true });
|
|
108363
|
+
fs36.writeFileSync(file2, JSON.stringify(Array.from(merged)));
|
|
108328
108364
|
} catch {
|
|
108329
108365
|
}
|
|
108330
108366
|
}
|
|
@@ -109467,7 +109503,7 @@ init_src2();
|
|
|
109467
109503
|
|
|
109468
109504
|
// ../tool-server/src/blueprints/ax-service.ts
|
|
109469
109505
|
var net4 = __toESM(require("node:net"));
|
|
109470
|
-
var
|
|
109506
|
+
var fs37 = __toESM(require("node:fs"));
|
|
109471
109507
|
init_src2();
|
|
109472
109508
|
init_external_devices();
|
|
109473
109509
|
|
|
@@ -109546,7 +109582,7 @@ function startListener(endpoint, onConnection) {
|
|
|
109546
109582
|
return new Promise((resolve24, reject) => {
|
|
109547
109583
|
if (endpoint.transport === "unix") {
|
|
109548
109584
|
try {
|
|
109549
|
-
|
|
109585
|
+
fs37.unlinkSync(endpoint.socketPath);
|
|
109550
109586
|
} catch {
|
|
109551
109587
|
}
|
|
109552
109588
|
}
|
|
@@ -109863,7 +109899,7 @@ var axServiceBlueprint = {
|
|
|
109863
109899
|
server.close();
|
|
109864
109900
|
if (endpoint.transport === "unix") {
|
|
109865
109901
|
try {
|
|
109866
|
-
|
|
109902
|
+
fs37.unlinkSync(endpoint.socketPath);
|
|
109867
109903
|
} catch {
|
|
109868
109904
|
}
|
|
109869
109905
|
}
|
|
@@ -110094,7 +110130,7 @@ var axServiceBlueprint = {
|
|
|
110094
110130
|
server.close();
|
|
110095
110131
|
if (endpoint.transport === "unix") {
|
|
110096
110132
|
try {
|
|
110097
|
-
|
|
110133
|
+
fs37.unlinkSync(endpoint.socketPath);
|
|
110098
110134
|
} catch {
|
|
110099
110135
|
}
|
|
110100
110136
|
}
|
|
@@ -111068,7 +111104,7 @@ init_src2();
|
|
|
111068
111104
|
|
|
111069
111105
|
// ../native-devtools-android/src/index.ts
|
|
111070
111106
|
var path33 = __toESM(require("node:path"));
|
|
111071
|
-
var
|
|
111107
|
+
var fs38 = __toESM(require("node:fs"));
|
|
111072
111108
|
|
|
111073
111109
|
// ../native-devtools-android/src/errors.ts
|
|
111074
111110
|
function buildMessage(kind, details) {
|
|
@@ -111658,13 +111694,13 @@ var cachedManifest = null;
|
|
|
111658
111694
|
function helperManifest() {
|
|
111659
111695
|
if (cachedManifest) return cachedManifest;
|
|
111660
111696
|
const manifestPath = path33.join(__dirname, "..", "assets", "manifest.json");
|
|
111661
|
-
cachedManifest = JSON.parse(
|
|
111697
|
+
cachedManifest = JSON.parse(fs38.readFileSync(manifestPath, "utf-8"));
|
|
111662
111698
|
return cachedManifest;
|
|
111663
111699
|
}
|
|
111664
111700
|
function bundledHelperApkPath() {
|
|
111665
111701
|
const manifest = helperManifest();
|
|
111666
111702
|
const apk = path33.join(binDir(), `argent-android-devtools-${manifest.versionName}.apk`);
|
|
111667
|
-
if (!
|
|
111703
|
+
if (!fs38.existsSync(apk)) {
|
|
111668
111704
|
throw new Error(
|
|
111669
111705
|
`Bundled Android devtools helper APK not found at ${apk}. Run \`bash packages/native-devtools-android/scripts/build.sh\` to build it.`
|
|
111670
111706
|
);
|
|
@@ -116670,7 +116706,7 @@ init_device_info();
|
|
|
116670
116706
|
|
|
116671
116707
|
// ../tool-server/src/blueprints/tv-control.ts
|
|
116672
116708
|
var net6 = __toESM(require("node:net"));
|
|
116673
|
-
var
|
|
116709
|
+
var fs40 = __toESM(require("node:fs"));
|
|
116674
116710
|
var import_node_child_process27 = require("node:child_process");
|
|
116675
116711
|
init_src2();
|
|
116676
116712
|
init_capability();
|
|
@@ -116968,7 +117004,7 @@ async function waitForSocket(socketPath, proc, timeoutMs) {
|
|
|
116968
117004
|
if (exited !== void 0) {
|
|
116969
117005
|
throw new Error(`tv daemon exited with code ${exited} before its socket was ready`);
|
|
116970
117006
|
}
|
|
116971
|
-
if (
|
|
117007
|
+
if (fs40.existsSync(socketPath)) {
|
|
116972
117008
|
const ok = await new Promise((resolve24) => {
|
|
116973
117009
|
const s = net6.createConnection(socketPath);
|
|
116974
117010
|
s.on("connect", () => {
|
|
@@ -117072,7 +117108,7 @@ var tvControlBlueprint = {
|
|
|
117072
117108
|
await reapDaemons(axSock);
|
|
117073
117109
|
for (const p of [axSock, hidSock]) {
|
|
117074
117110
|
try {
|
|
117075
|
-
|
|
117111
|
+
fs40.unlinkSync(p);
|
|
117076
117112
|
} catch {
|
|
117077
117113
|
}
|
|
117078
117114
|
}
|
|
@@ -117088,7 +117124,7 @@ var tvControlBlueprint = {
|
|
|
117088
117124
|
}
|
|
117089
117125
|
axExited = false;
|
|
117090
117126
|
try {
|
|
117091
|
-
|
|
117127
|
+
fs40.unlinkSync(axSock);
|
|
117092
117128
|
} catch {
|
|
117093
117129
|
}
|
|
117094
117130
|
await reapDaemons(axSock);
|
|
@@ -117113,7 +117149,7 @@ var tvControlBlueprint = {
|
|
|
117113
117149
|
axProc.kill("SIGKILL");
|
|
117114
117150
|
}
|
|
117115
117151
|
try {
|
|
117116
|
-
|
|
117152
|
+
fs40.unlinkSync(axSock);
|
|
117117
117153
|
} catch {
|
|
117118
117154
|
}
|
|
117119
117155
|
}
|
|
@@ -117220,7 +117256,7 @@ var tvControlBlueprint = {
|
|
|
117220
117256
|
await reapDaemons(axSock);
|
|
117221
117257
|
for (const p of [axSock, hidSock]) {
|
|
117222
117258
|
try {
|
|
117223
|
-
|
|
117259
|
+
fs40.unlinkSync(p);
|
|
117224
117260
|
} catch {
|
|
117225
117261
|
}
|
|
117226
117262
|
}
|
|
@@ -117742,8 +117778,8 @@ function reserveLaunchMeasurement(udid) {
|
|
|
117742
117778
|
// ../tool-server/src/utils/ios-device/runner-artifact.ts
|
|
117743
117779
|
var import_node_child_process29 = require("node:child_process");
|
|
117744
117780
|
var import_node_util21 = require("node:util");
|
|
117745
|
-
var
|
|
117746
|
-
var
|
|
117781
|
+
var import_node_crypto14 = require("node:crypto");
|
|
117782
|
+
var fs42 = __toESM(require("node:fs"));
|
|
117747
117783
|
var fsp = __toESM(require("node:fs/promises"));
|
|
117748
117784
|
var path36 = __toESM(require("node:path"));
|
|
117749
117785
|
init_src2();
|
|
@@ -117875,7 +117911,7 @@ function resolveRunnerProjectPath() {
|
|
|
117875
117911
|
return override;
|
|
117876
117912
|
}
|
|
117877
117913
|
const candidate = path36.resolve(__dirname, PROJECT_SUFFIX);
|
|
117878
|
-
if (
|
|
117914
|
+
if (fs42.existsSync(candidate)) {
|
|
117879
117915
|
return candidate;
|
|
117880
117916
|
}
|
|
117881
117917
|
throw withFailureSignal(
|
|
@@ -117901,7 +117937,7 @@ var FINGERPRINT_NOISE = /* @__PURE__ */ new Set([
|
|
|
117901
117937
|
]);
|
|
117902
117938
|
async function fingerprintRunnerSources(projectPath) {
|
|
117903
117939
|
const root = path36.dirname(projectPath);
|
|
117904
|
-
const hash2 = (0,
|
|
117940
|
+
const hash2 = (0, import_node_crypto14.createHash)("sha256");
|
|
117905
117941
|
const walk = async (dir) => {
|
|
117906
117942
|
const entries = (await fsp.readdir(dir, { withFileTypes: true })).sort(
|
|
117907
117943
|
(a, b) => a.name.localeCompare(b.name)
|
|
@@ -117952,10 +117988,10 @@ function runnerProductsDir(derivedDataPath) {
|
|
|
117952
117988
|
}
|
|
117953
117989
|
function findBaseXctestrun(derivedDataPath) {
|
|
117954
117990
|
const productsDir = runnerProductsDir(derivedDataPath);
|
|
117955
|
-
if (!
|
|
117991
|
+
if (!fs42.existsSync(productsDir)) {
|
|
117956
117992
|
return null;
|
|
117957
117993
|
}
|
|
117958
|
-
const candidates =
|
|
117994
|
+
const candidates = fs42.readdirSync(productsDir).filter((name) => {
|
|
117959
117995
|
return name.endsWith(".xctestrun") && name.includes("iphoneos");
|
|
117960
117996
|
});
|
|
117961
117997
|
if (candidates.length === 0) {
|
|
@@ -118010,7 +118046,7 @@ function runnerBuildLocationArgs(derivedDataPath) {
|
|
|
118010
118046
|
];
|
|
118011
118047
|
}
|
|
118012
118048
|
function computeRunnerCacheKey(sourcesHash, xcodeVersion2, staticArgs) {
|
|
118013
|
-
return (0,
|
|
118049
|
+
return (0, import_node_crypto14.createHash)("sha256").update([sourcesHash, xcodeVersion2, ...staticArgs].join("\n")).digest("hex").slice(0, 16);
|
|
118014
118050
|
}
|
|
118015
118051
|
function isProfileMissingDeviceFailure(logText) {
|
|
118016
118052
|
return logText.includes("0xe8008012") || /doesn't include the currently selected device/i.test(logText) || /provisioning profile cannot be installed on this device/i.test(logText) || /team has no devices/i.test(logText);
|
|
@@ -118137,7 +118173,7 @@ ${xcodebuildFailureSummary(output2)}`,
|
|
|
118137
118173
|
// ../tool-server/src/utils/ios-device/runner-launch.ts
|
|
118138
118174
|
var import_node_child_process30 = require("node:child_process");
|
|
118139
118175
|
var import_node_events2 = require("node:events");
|
|
118140
|
-
var
|
|
118176
|
+
var fs43 = __toESM(require("node:fs"));
|
|
118141
118177
|
var fsp2 = __toESM(require("node:fs/promises"));
|
|
118142
118178
|
var path37 = __toESM(require("node:path"));
|
|
118143
118179
|
var import_node_util22 = require("node:util");
|
|
@@ -118185,7 +118221,7 @@ async function launchRunner(opts) {
|
|
|
118185
118221
|
const resultBundlePath = path37.join(resultsDir, `argent-${deviceTag}.xcresult`);
|
|
118186
118222
|
await fsp2.rm(resultBundlePath, { recursive: true, force: true });
|
|
118187
118223
|
await disableRunnerAttachments(opts.xctestrunPath);
|
|
118188
|
-
const logFd =
|
|
118224
|
+
const logFd = fs43.openSync(logPath, "w");
|
|
118189
118225
|
const child = (0, import_node_child_process30.spawn)(
|
|
118190
118226
|
"xcodebuild",
|
|
118191
118227
|
[
|
|
@@ -118222,7 +118258,7 @@ async function launchRunner(opts) {
|
|
|
118222
118258
|
}
|
|
118223
118259
|
);
|
|
118224
118260
|
child.unref();
|
|
118225
|
-
|
|
118261
|
+
fs43.closeSync(logFd);
|
|
118226
118262
|
try {
|
|
118227
118263
|
await (0, import_node_events2.once)(child, "spawn");
|
|
118228
118264
|
} catch (error63) {
|
|
@@ -118323,7 +118359,7 @@ async function killStaleRunnersForDevice(udid, listProcesses = listProcessTable)
|
|
|
118323
118359
|
}
|
|
118324
118360
|
|
|
118325
118361
|
// ../tool-server/src/blueprints/ios-device-runner.ts
|
|
118326
|
-
var
|
|
118362
|
+
var fs45 = __toESM(require("node:fs/promises"));
|
|
118327
118363
|
|
|
118328
118364
|
// ../tool-server/src/utils/ios-device/runner-route.ts
|
|
118329
118365
|
var import_node_net3 = __toESM(require("node:net"));
|
|
@@ -118711,7 +118747,7 @@ function defaultSendViaUsbmux(udid, port, body, deadline) {
|
|
|
118711
118747
|
// ../tool-server/src/utils/ios-device/runner-crash.ts
|
|
118712
118748
|
var import_node_child_process32 = require("node:child_process");
|
|
118713
118749
|
var import_node_util24 = require("node:util");
|
|
118714
|
-
var
|
|
118750
|
+
var fs44 = __toESM(require("node:fs/promises"));
|
|
118715
118751
|
var execFileAsync23 = (0, import_node_util24.promisify)(import_node_child_process32.execFile);
|
|
118716
118752
|
var XCRESULTTOOL_TIMEOUT_MS = 15e3;
|
|
118717
118753
|
var XCRESULTTOOL_MAX_JSON_BYTES = 32 * 1024 * 1024;
|
|
@@ -118731,7 +118767,7 @@ function extractCrashFailureText(summary) {
|
|
|
118731
118767
|
}
|
|
118732
118768
|
async function readRunnerCrashSummary(resultBundlePath) {
|
|
118733
118769
|
try {
|
|
118734
|
-
await
|
|
118770
|
+
await fs44.access(resultBundlePath);
|
|
118735
118771
|
const { stdout } = await execFileAsync23(
|
|
118736
118772
|
"xcrun",
|
|
118737
118773
|
["xcresulttool", "get", "test-results", "summary", "--path", resultBundlePath],
|
|
@@ -118744,7 +118780,7 @@ async function readRunnerCrashSummary(resultBundlePath) {
|
|
|
118744
118780
|
}
|
|
118745
118781
|
|
|
118746
118782
|
// ../tool-server/src/utils/ios-device/runner-client.ts
|
|
118747
|
-
var
|
|
118783
|
+
var import_node_crypto15 = require("node:crypto");
|
|
118748
118784
|
init_src2();
|
|
118749
118785
|
var RUNNER_COMMAND_TIMEOUT_MS = 45e3;
|
|
118750
118786
|
var RUNNER_STATUS_RECOVERY_TIMEOUT_MS = 3e3;
|
|
@@ -118957,7 +118993,7 @@ function withCommandId(command2) {
|
|
|
118957
118993
|
if (command2.command === "status" || typeof command2.commandId === "string") {
|
|
118958
118994
|
return command2;
|
|
118959
118995
|
}
|
|
118960
|
-
return { ...command2, commandId: `argent-${(0,
|
|
118996
|
+
return { ...command2, commandId: `argent-${(0, import_node_crypto15.randomUUID)()}` };
|
|
118961
118997
|
}
|
|
118962
118998
|
function unwrapEnvelope(response, udid) {
|
|
118963
118999
|
const envelope = asEnvelope(response);
|
|
@@ -119104,7 +119140,7 @@ async function startRunner(udid, artifact, tunnelAddress) {
|
|
|
119104
119140
|
launched.child.once("exit", reserveInteractionRunner(udid));
|
|
119105
119141
|
}
|
|
119106
119142
|
killRunnerProcess(launched.child);
|
|
119107
|
-
const logText = await
|
|
119143
|
+
const logText = await fs45.readFile(launched.logPath, "utf8").catch(() => "");
|
|
119108
119144
|
throw Object.assign(
|
|
119109
119145
|
withFailureSignal(
|
|
119110
119146
|
new Error(
|
|
@@ -124645,9 +124681,9 @@ init_src2();
|
|
|
124645
124681
|
|
|
124646
124682
|
// ../tool-server/src/blueprints/macos-app.ts
|
|
124647
124683
|
var import_node_child_process33 = require("node:child_process");
|
|
124648
|
-
var
|
|
124684
|
+
var import_node_crypto16 = require("node:crypto");
|
|
124649
124685
|
var import_node_events5 = require("node:events");
|
|
124650
|
-
var
|
|
124686
|
+
var fs46 = __toESM(require("node:fs"));
|
|
124651
124687
|
var net9 = __toESM(require("node:net"));
|
|
124652
124688
|
var os12 = __toESM(require("node:os"));
|
|
124653
124689
|
var path39 = __toESM(require("node:path"));
|
|
@@ -124888,7 +124924,7 @@ async function stopProcesses(pids, executable, group) {
|
|
|
124888
124924
|
}
|
|
124889
124925
|
function readLogTail(logPath) {
|
|
124890
124926
|
try {
|
|
124891
|
-
const lines =
|
|
124927
|
+
const lines = fs46.readFileSync(logPath, "utf8").trimEnd().split("\n");
|
|
124892
124928
|
const tail = lines.slice(-20).join("\n").trim();
|
|
124893
124929
|
return tail ? `
|
|
124894
124930
|
Last lines of ${logPath}:
|
|
@@ -124932,7 +124968,7 @@ function closedByArgentError(bundleId, method) {
|
|
|
124932
124968
|
"unknown"
|
|
124933
124969
|
);
|
|
124934
124970
|
}
|
|
124935
|
-
var nextCdpWireId = (0,
|
|
124971
|
+
var nextCdpWireId = (0, import_node_crypto16.randomInt)(2 ** 47);
|
|
124936
124972
|
var LibraryChannel = class {
|
|
124937
124973
|
/**
|
|
124938
124974
|
* @param expectedPid the app's pid when known; a launch learns it from the helper after the spawn.
|
|
@@ -125593,7 +125629,7 @@ function createMacosAppApi(bundleId) {
|
|
|
125593
125629
|
"not_found"
|
|
125594
125630
|
);
|
|
125595
125631
|
}
|
|
125596
|
-
if (!opts.appPath && tracked && !
|
|
125632
|
+
if (!opts.appPath && tracked && !fs46.existsSync(appPath)) {
|
|
125597
125633
|
throw macosFailure(
|
|
125598
125634
|
`argent last started ${bundleId} from ${appPath}, which no longer exists. Pass the .app path to boot-device as macosAppPath.`,
|
|
125599
125635
|
FAILURE_CODES.MACOS_APP_PATH_INVALID,
|
|
@@ -125655,7 +125691,7 @@ function createMacosAppApi(bundleId) {
|
|
|
125655
125691
|
const bootstrapPath = await stageLibraryFor(info, artifacts);
|
|
125656
125692
|
const listen4 = macosListenSocket(bundleId, info.sandboxed);
|
|
125657
125693
|
const logPath = macosAppLogPath(bundleId);
|
|
125658
|
-
|
|
125694
|
+
fs46.mkdirSync(path39.dirname(logPath), { recursive: true, mode: 448 });
|
|
125659
125695
|
if (listen4 && !info.sandboxed) prepareSocketDir(listen4.path);
|
|
125660
125696
|
const forceQuit = own2 ? await terminate(own2) : void 0;
|
|
125661
125697
|
let tookOver;
|
|
@@ -125673,8 +125709,8 @@ function createMacosAppApi(bundleId) {
|
|
|
125673
125709
|
tookOver = `argent quit the copy of ${bundleId} that ran without the argent library (pid ${signalled.join(", ")}) and started the app with the library. Unsaved changes in that copy are lost.`;
|
|
125674
125710
|
}
|
|
125675
125711
|
}
|
|
125676
|
-
if (listen4 && !info.sandboxed)
|
|
125677
|
-
|
|
125712
|
+
if (listen4 && !info.sandboxed) fs46.rmSync(listen4.path, { force: true });
|
|
125713
|
+
fs46.writeFileSync(logPath, "");
|
|
125678
125714
|
const args = opts.args ?? (opts.noLastArgs ? void 0 : tracked?.args) ?? [];
|
|
125679
125715
|
const helper = (0, import_node_child_process33.spawn)(
|
|
125680
125716
|
artifacts.helper,
|
|
@@ -127337,7 +127373,7 @@ var SourceMapsRegistry = class {
|
|
|
127337
127373
|
};
|
|
127338
127374
|
|
|
127339
127375
|
// ../tool-server/src/utils/debugger/log-file-writer.ts
|
|
127340
|
-
var
|
|
127376
|
+
var fs47 = __toESM(require("node:fs"));
|
|
127341
127377
|
var path40 = __toESM(require("node:path"));
|
|
127342
127378
|
init_src();
|
|
127343
127379
|
var MAX_ENTRIES = 5e4;
|
|
@@ -127366,7 +127402,7 @@ var LogFileWriter = class {
|
|
|
127366
127402
|
const timestamp = lastTimestamp = Math.max(Date.now(), lastTimestamp + 1);
|
|
127367
127403
|
const dir = path40.join(argentHomeDir(), "tmp");
|
|
127368
127404
|
try {
|
|
127369
|
-
|
|
127405
|
+
fs47.mkdirSync(dir, { recursive: true });
|
|
127370
127406
|
} catch {
|
|
127371
127407
|
}
|
|
127372
127408
|
pruneStaleLogs(dir);
|
|
@@ -127376,7 +127412,7 @@ var LogFileWriter = class {
|
|
|
127376
127412
|
}
|
|
127377
127413
|
open() {
|
|
127378
127414
|
try {
|
|
127379
|
-
this.fd =
|
|
127415
|
+
this.fd = fs47.openSync(this.filePath, "w");
|
|
127380
127416
|
this.ready = true;
|
|
127381
127417
|
} catch {
|
|
127382
127418
|
}
|
|
@@ -127402,7 +127438,7 @@ var LogFileWriter = class {
|
|
|
127402
127438
|
try {
|
|
127403
127439
|
const bytes = Buffer.from(this.midLine ? `
|
|
127404
127440
|
${line}` : line);
|
|
127405
|
-
const written =
|
|
127441
|
+
const written = fs47.writeSync(this.fd, bytes, 0, bytes.length, this.bytesWritten);
|
|
127406
127442
|
if (written === bytes.length) {
|
|
127407
127443
|
this.bytesWritten += written;
|
|
127408
127444
|
this.midLine = false;
|
|
@@ -127454,7 +127490,7 @@ ${line}` : line);
|
|
|
127454
127490
|
/** A torn line past " | " would parse as a whole entry with its message cut. */
|
|
127455
127491
|
dropTornLine(fd, bytes, written) {
|
|
127456
127492
|
try {
|
|
127457
|
-
|
|
127493
|
+
fs47.ftruncateSync(fd, this.bytesWritten);
|
|
127458
127494
|
} catch {
|
|
127459
127495
|
this.bytesWritten += written;
|
|
127460
127496
|
if (written > 0) this.midLine = bytes[written - 1] !== 10;
|
|
@@ -127468,7 +127504,7 @@ ${line}` : line);
|
|
|
127468
127504
|
return this.fileEntryCount;
|
|
127469
127505
|
}
|
|
127470
127506
|
hasFile() {
|
|
127471
|
-
return
|
|
127507
|
+
return fs47.existsSync(this.filePath);
|
|
127472
127508
|
}
|
|
127473
127509
|
getStats() {
|
|
127474
127510
|
return {
|
|
@@ -127493,7 +127529,7 @@ ${line}` : line);
|
|
|
127493
127529
|
readAll() {
|
|
127494
127530
|
if (this.closed || !this.ready) return [];
|
|
127495
127531
|
try {
|
|
127496
|
-
const content =
|
|
127532
|
+
const content = fs47.readFileSync(this.filePath, "utf-8");
|
|
127497
127533
|
return content.split("\n").filter((line) => line.length > 0).map(parseFlatLine).filter((entry) => entry !== null);
|
|
127498
127534
|
} catch {
|
|
127499
127535
|
return [];
|
|
@@ -127515,7 +127551,7 @@ ${line}` : line);
|
|
|
127515
127551
|
liveLogFiles.delete(this.filePath);
|
|
127516
127552
|
if (this.fd !== null) {
|
|
127517
127553
|
try {
|
|
127518
|
-
|
|
127554
|
+
fs47.closeSync(this.fd);
|
|
127519
127555
|
} catch {
|
|
127520
127556
|
}
|
|
127521
127557
|
this.fd = null;
|
|
@@ -127523,13 +127559,13 @@ ${line}` : line);
|
|
|
127523
127559
|
if (keepFile) {
|
|
127524
127560
|
try {
|
|
127525
127561
|
const now = /* @__PURE__ */ new Date();
|
|
127526
|
-
|
|
127562
|
+
fs47.utimesSync(this.filePath, now, now);
|
|
127527
127563
|
} catch {
|
|
127528
127564
|
}
|
|
127529
127565
|
return;
|
|
127530
127566
|
}
|
|
127531
127567
|
try {
|
|
127532
|
-
|
|
127568
|
+
fs47.unlinkSync(this.filePath);
|
|
127533
127569
|
} catch {
|
|
127534
127570
|
}
|
|
127535
127571
|
}
|
|
@@ -127538,7 +127574,7 @@ function pruneStaleLogs(dir) {
|
|
|
127538
127574
|
const cutoff = Date.now() - STALE_LOG_MS;
|
|
127539
127575
|
let names;
|
|
127540
127576
|
try {
|
|
127541
|
-
names =
|
|
127577
|
+
names = fs47.readdirSync(dir);
|
|
127542
127578
|
} catch {
|
|
127543
127579
|
return;
|
|
127544
127580
|
}
|
|
@@ -127548,7 +127584,7 @@ function pruneStaleLogs(dir) {
|
|
|
127548
127584
|
const file2 = path40.join(dir, name);
|
|
127549
127585
|
if (pid === process.pid ? liveLogFiles.has(file2) : isAlive(pid)) continue;
|
|
127550
127586
|
try {
|
|
127551
|
-
if (
|
|
127587
|
+
if (fs47.statSync(file2).mtimeMs < cutoff) fs47.unlinkSync(file2);
|
|
127552
127588
|
} catch {
|
|
127553
127589
|
}
|
|
127554
127590
|
}
|
|
@@ -128574,7 +128610,7 @@ function createHttpApp(registry2, options) {
|
|
|
128574
128610
|
});
|
|
128575
128611
|
return;
|
|
128576
128612
|
}
|
|
128577
|
-
const id = (0,
|
|
128613
|
+
const id = (0, import_node_crypto17.randomUUID)();
|
|
128578
128614
|
const tarPath = (0, import_node_path17.join)((0, import_node_os12.tmpdir)(), `argent-upload-${id}.tar.gz`);
|
|
128579
128615
|
const ws = (0, import_node_fs14.createWriteStream)(tarPath);
|
|
128580
128616
|
let received2 = 0;
|
|
@@ -128591,7 +128627,7 @@ function createHttpApp(registry2, options) {
|
|
|
128591
128627
|
});
|
|
128592
128628
|
if (!res.headersSent) res.status(status).json({ error: message });
|
|
128593
128629
|
};
|
|
128594
|
-
const digest = (0,
|
|
128630
|
+
const digest = (0, import_node_crypto17.createHash)("sha256");
|
|
128595
128631
|
req.on("data", (chunk) => {
|
|
128596
128632
|
if (released) return;
|
|
128597
128633
|
received2 += chunk.length;
|
|
@@ -128890,7 +128926,7 @@ function createHttpApp(registry2, options) {
|
|
|
128890
128926
|
});
|
|
128891
128927
|
const keepAlive = def.longRunning && options?.idleTimeoutMs && options.idleTimeoutMs > 0 ? setInterval(() => idleTimer.touch(), Math.max(1e3, IDLE_CHECK_INTERVAL_MS / 2)) : null;
|
|
128892
128928
|
if (keepAlive) keepAlive.unref?.();
|
|
128893
|
-
const toolInvocationId = (0,
|
|
128929
|
+
const toolInvocationId = (0, import_node_crypto17.randomUUID)();
|
|
128894
128930
|
let releaseInvocationMeta;
|
|
128895
128931
|
let recordChildInvocation;
|
|
128896
128932
|
const recordInvocation = options?.recordInvocation;
|
|
@@ -129235,8 +129271,8 @@ init_src2();
|
|
|
129235
129271
|
init_src();
|
|
129236
129272
|
|
|
129237
129273
|
// ../tool-server/src/blueprints/android-network-inspector.ts
|
|
129238
|
-
var
|
|
129239
|
-
var
|
|
129274
|
+
var import_node_crypto18 = require("node:crypto");
|
|
129275
|
+
var fs48 = __toESM(require("node:fs"));
|
|
129240
129276
|
var net10 = __toESM(require("node:net"));
|
|
129241
129277
|
var path41 = __toESM(require("node:path"));
|
|
129242
129278
|
init_src2();
|
|
@@ -129442,7 +129478,7 @@ var NOT_RECONNECTED_NOTE = "the agent's connection dropped, and it did not recon
|
|
|
129442
129478
|
var STOPPED_NOTE = "capture stopped by network-capture-stop; network-capture-start turns it on again";
|
|
129443
129479
|
var AWAY_AT_STOP = "the agent's connection was down at the stop, so it did not get Network.disable; it gets it when it connects again, and argent records none of the app's new requests meanwhile";
|
|
129444
129480
|
var LOGGED_DETAIL_EVENTS = /* @__PURE__ */ new Set(["interceptor_installed", "interceptor_failed"]);
|
|
129445
|
-
var RUN_TAG2 = (0,
|
|
129481
|
+
var RUN_TAG2 = (0, import_node_crypto18.randomBytes)(2).toString("hex");
|
|
129446
129482
|
var ANDROID_NATIVE_REQUEST_ID = /^android-[0-9a-f]{4}-\d+$/;
|
|
129447
129483
|
var liveInspectors = /* @__PURE__ */ new Map();
|
|
129448
129484
|
var nextRecordNumber2 = 1;
|
|
@@ -129552,7 +129588,7 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
129552
129588
|
process.stderr.write(`[${tag3}] ${line}
|
|
129553
129589
|
`);
|
|
129554
129590
|
};
|
|
129555
|
-
const secret = (0,
|
|
129591
|
+
const secret = (0, import_node_crypto18.randomBytes)(32).toString("hex");
|
|
129556
129592
|
let metroPort2 = initialMetroPort;
|
|
129557
129593
|
let disposed = false;
|
|
129558
129594
|
let live = false;
|
|
@@ -129781,7 +129817,7 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
129781
129817
|
}
|
|
129782
129818
|
async function bindDevicePort() {
|
|
129783
129819
|
for (let attempt = 0; attempt < DEVICE_PORT_ATTEMPTS; attempt++) {
|
|
129784
|
-
const port = DEVICE_PORT_MIN + (0,
|
|
129820
|
+
const port = DEVICE_PORT_MIN + (0, import_node_crypto18.randomInt)(DEVICE_PORT_SPAN);
|
|
129785
129821
|
try {
|
|
129786
129822
|
await adbReverse(serial, port, hostPort, { timeoutMs: 1e4, noRebind: true });
|
|
129787
129823
|
} catch (err) {
|
|
@@ -130039,7 +130075,7 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
130039
130075
|
return;
|
|
130040
130076
|
}
|
|
130041
130077
|
agentNonce = payload.nonce;
|
|
130042
|
-
serverNonce = (0,
|
|
130078
|
+
serverNonce = (0, import_node_crypto18.randomBytes)(16).toString("hex");
|
|
130043
130079
|
writeNdjsonFrame(socket, {
|
|
130044
130080
|
type: "Control",
|
|
130045
130081
|
payload: {
|
|
@@ -130926,14 +130962,14 @@ function readHandshake(payload) {
|
|
|
130926
130962
|
}
|
|
130927
130963
|
function proofMatches(proof, expected) {
|
|
130928
130964
|
if (!isHex2(proof, 64)) return false;
|
|
130929
|
-
return (0,
|
|
130965
|
+
return (0, import_node_crypto18.timingSafeEqual)(Buffer.from(proof, "hex"), Buffer.from(expected, "hex"));
|
|
130930
130966
|
}
|
|
130931
130967
|
function handshakeProof(secret, parts2) {
|
|
130932
|
-
return (0,
|
|
130968
|
+
return (0, import_node_crypto18.createHmac)("sha256", Buffer.from(secret, "ascii")).update(parts2.join("\n"), "utf8").digest("hex");
|
|
130933
130969
|
}
|
|
130934
130970
|
function sessionKeys(agentNonce, serverNonce, secret) {
|
|
130935
|
-
const prk = (0,
|
|
130936
|
-
const expand = (info) => (0,
|
|
130971
|
+
const prk = (0, import_node_crypto18.createHmac)("sha256", Buffer.from(agentNonce + serverNonce, "ascii")).update(Buffer.from(secret, "ascii")).digest();
|
|
130972
|
+
const expand = (info) => (0, import_node_crypto18.createHmac)("sha256", prk).update(Buffer.concat([Buffer.from(info, "ascii"), Buffer.of(1)])).digest();
|
|
130937
130973
|
return {
|
|
130938
130974
|
agent: expand("argent-nwi agent to server"),
|
|
130939
130975
|
server: expand("argent-nwi server to agent")
|
|
@@ -130945,7 +130981,7 @@ function frameIv(counter) {
|
|
|
130945
130981
|
return iv;
|
|
130946
130982
|
}
|
|
130947
130983
|
function sealFrame(key2, counter, frame2) {
|
|
130948
|
-
const cipher = (0,
|
|
130984
|
+
const cipher = (0, import_node_crypto18.createCipheriv)("aes-256-gcm", key2, frameIv(counter), {
|
|
130949
130985
|
authTagLength: GCM_TAG_BYTES
|
|
130950
130986
|
});
|
|
130951
130987
|
return Buffer.concat([
|
|
@@ -130963,7 +130999,7 @@ function openFrame(key2, counter, sealed) {
|
|
|
130963
130999
|
}
|
|
130964
131000
|
let plaintext;
|
|
130965
131001
|
try {
|
|
130966
|
-
const decipher = (0,
|
|
131002
|
+
const decipher = (0, import_node_crypto18.createDecipheriv)("aes-256-gcm", key2, frameIv(counter), {
|
|
130967
131003
|
authTagLength: GCM_TAG_BYTES
|
|
130968
131004
|
});
|
|
130969
131005
|
decipher.setAuthTag(bytes.subarray(bytes.length - GCM_TAG_BYTES));
|
|
@@ -131004,11 +131040,11 @@ function parseCapture(value) {
|
|
|
131004
131040
|
function agentFiles() {
|
|
131005
131041
|
const dir = path41.join(binDir(), "network-inspector");
|
|
131006
131042
|
const jar = path41.join(dir, JAR_NAME);
|
|
131007
|
-
if (!
|
|
131043
|
+
if (!fs48.existsSync(jar)) return null;
|
|
131008
131044
|
const lib = {};
|
|
131009
131045
|
for (const abi of AGENT_ABIS) {
|
|
131010
131046
|
const file2 = path41.join(dir, abi, AGENT_LIB_NAME);
|
|
131011
|
-
if (
|
|
131047
|
+
if (fs48.existsSync(file2)) lib[abi] = file2;
|
|
131012
131048
|
}
|
|
131013
131049
|
return Object.keys(lib).length > 0 ? { jar, lib } : null;
|
|
131014
131050
|
}
|
|
@@ -132847,7 +132883,7 @@ init_device_info();
|
|
|
132847
132883
|
init_external_devices();
|
|
132848
132884
|
|
|
132849
132885
|
// ../tool-server/src/utils/debugger/target-selection.ts
|
|
132850
|
-
var
|
|
132886
|
+
var import_node_crypto19 = require("node:crypto");
|
|
132851
132887
|
init_src2();
|
|
132852
132888
|
init_device_info();
|
|
132853
132889
|
init_macos_app_kind();
|
|
@@ -132869,7 +132905,7 @@ function macosAppBundleIdOf(target) {
|
|
|
132869
132905
|
const vendorIds = trackedMacosAppKind(bundleId) === "catalyst" ? catalystVendorId ? [catalystVendorId] : [] : [""];
|
|
132870
132906
|
for (const vendorId of vendorIds) {
|
|
132871
132907
|
for (const mode of ["fusebox", "legacy"]) {
|
|
132872
|
-
const id = (0,
|
|
132908
|
+
const id = (0, import_node_crypto19.createHash)("sha256").update(`apple-${vendorId}-${bundleId}-${mode}`).digest("hex").slice(0, 40);
|
|
132873
132909
|
if (id === logicalId) return bundleId;
|
|
132874
132910
|
}
|
|
132875
132911
|
}
|
|
@@ -133013,7 +133049,7 @@ init_device_info();
|
|
|
133013
133049
|
init_external_devices();
|
|
133014
133050
|
|
|
133015
133051
|
// ../tool-server/src/utils/debugger/runtime-device.ts
|
|
133016
|
-
var
|
|
133052
|
+
var import_node_crypto20 = require("node:crypto");
|
|
133017
133053
|
var import_node_child_process34 = require("node:child_process");
|
|
133018
133054
|
var import_node_util25 = require("node:util");
|
|
133019
133055
|
init_adb();
|
|
@@ -133026,7 +133062,7 @@ async function findRuntimeDevices(cdp, {
|
|
|
133026
133062
|
awaitSerials = [],
|
|
133027
133063
|
waitSerials = []
|
|
133028
133064
|
} = {}) {
|
|
133029
|
-
const marker = `argent-device-probe:${(0,
|
|
133065
|
+
const marker = `argent-device-probe:${(0, import_node_crypto20.randomUUID)()}`;
|
|
133030
133066
|
const logged = await cdp.evaluate(
|
|
133031
133067
|
`(function () {
|
|
133032
133068
|
if (typeof nativeLoggingHook !== "function") return false;
|
|
@@ -133234,7 +133270,7 @@ async function runtimeRunsOn(cdp, deviceId) {
|
|
|
133234
133270
|
}
|
|
133235
133271
|
|
|
133236
133272
|
// ../tool-server/src/utils/debugger/source-resolver.ts
|
|
133237
|
-
var
|
|
133273
|
+
var fs49 = __toESM(require("node:fs/promises"));
|
|
133238
133274
|
var path42 = __toESM(require("node:path"));
|
|
133239
133275
|
|
|
133240
133276
|
// ../../node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js
|
|
@@ -133405,11 +133441,11 @@ function createSourceResolver(port, projectRoot) {
|
|
|
133405
133441
|
if (!projectRoot) return null;
|
|
133406
133442
|
try {
|
|
133407
133443
|
const absPath = path42.isAbsolute(location.file) ? path42.resolve(location.file) : path42.resolve(projectRoot, location.file);
|
|
133408
|
-
const realRoot = await
|
|
133409
|
-
const realPath = await
|
|
133444
|
+
const realRoot = await fs49.realpath(projectRoot);
|
|
133445
|
+
const realPath = await fs49.realpath(absPath);
|
|
133410
133446
|
if (!isInsideProject(realPath, realRoot)) return null;
|
|
133411
133447
|
if (!hasAllowedExtension(realPath)) return null;
|
|
133412
|
-
const content = await
|
|
133448
|
+
const content = await fs49.readFile(realPath, "utf-8");
|
|
133413
133449
|
const lines = content.split("\n");
|
|
133414
133450
|
const start2 = Math.max(0, location.line - 1 - contextLines);
|
|
133415
133451
|
const end = Math.min(lines.length, location.line + contextLines);
|
|
@@ -133798,7 +133834,7 @@ var jsRuntimeDebuggerBlueprint = {
|
|
|
133798
133834
|
init_src2();
|
|
133799
133835
|
|
|
133800
133836
|
// ../tool-server/src/utils/debugger/scripts/network-interceptor.ts
|
|
133801
|
-
var
|
|
133837
|
+
var import_node_crypto21 = require("node:crypto");
|
|
133802
133838
|
var import_node_os13 = require("node:os");
|
|
133803
133839
|
init_src3();
|
|
133804
133840
|
var BINARY_BODY_TYPES = /^(image\/(?!svg)|audio\/|video\/|font\/|application\/(octet-stream|pdf|zip|gzip|wasm|x-protobuf)$)/;
|
|
@@ -134878,7 +134914,7 @@ var NETWORK_CAPTURE_MARK_SCRIPT = `(function() {
|
|
|
134878
134914
|
var g = globalThis;
|
|
134879
134915
|
return typeof g.__argent_network_mark === 'function' ? g.__argent_network_mark() : JSON.stringify({ install: null });
|
|
134880
134916
|
})()`;
|
|
134881
|
-
var HOLDER = JSON.stringify((0,
|
|
134917
|
+
var HOLDER = JSON.stringify((0, import_node_crypto21.randomUUID)());
|
|
134882
134918
|
function holderRecord(capturing2) {
|
|
134883
134919
|
return JSON.stringify({ capturing: capturing2, pid: process.pid, host: (0, import_node_os13.hostname)() });
|
|
134884
134920
|
}
|
|
@@ -136379,7 +136415,7 @@ async function readParentPids() {
|
|
|
136379
136415
|
}
|
|
136380
136416
|
|
|
136381
136417
|
// ../tool-server/src/utils/linux-preflight.ts
|
|
136382
|
-
var
|
|
136418
|
+
var fs51 = __toESM(require("node:fs"));
|
|
136383
136419
|
var import_node_os14 = require("node:os");
|
|
136384
136420
|
var import_node_path20 = require("node:path");
|
|
136385
136421
|
var import_ini2 = __toESM(require_ini());
|
|
@@ -136396,7 +136432,7 @@ function linuxBootDiagnostics(avdName) {
|
|
|
136396
136432
|
}
|
|
136397
136433
|
function checkKvm() {
|
|
136398
136434
|
try {
|
|
136399
|
-
|
|
136435
|
+
fs51.accessSync("/dev/kvm", fs51.constants.R_OK | fs51.constants.W_OK);
|
|
136400
136436
|
return null;
|
|
136401
136437
|
} catch (err) {
|
|
136402
136438
|
const code = err.code;
|
|
@@ -136412,7 +136448,7 @@ function checkAvdSizing(avdName) {
|
|
|
136412
136448
|
const configPath = (0, import_node_path20.join)((0, import_node_os14.homedir)(), ".android", "avd", `${avdName}.avd`, "config.ini");
|
|
136413
136449
|
let content;
|
|
136414
136450
|
try {
|
|
136415
|
-
content =
|
|
136451
|
+
content = fs51.readFileSync(configPath, "utf8");
|
|
136416
136452
|
} catch {
|
|
136417
136453
|
return null;
|
|
136418
136454
|
}
|
|
@@ -136467,14 +136503,7 @@ function loadVerdicts() {
|
|
|
136467
136503
|
function persistVerdict(key2, verdict) {
|
|
136468
136504
|
const filePath = verdictFilePath();
|
|
136469
136505
|
import_node_fs19.default.mkdirSync(import_node_path21.default.dirname(filePath), { recursive: true });
|
|
136470
|
-
|
|
136471
|
-
try {
|
|
136472
|
-
import_node_fs19.default.writeFileSync(tmpPath, JSON.stringify({ ...loadVerdicts(), [key2]: verdict }, null, 2));
|
|
136473
|
-
import_node_fs19.default.renameSync(tmpPath, filePath);
|
|
136474
|
-
} catch (err) {
|
|
136475
|
-
import_node_fs19.default.rmSync(tmpPath, { force: true });
|
|
136476
|
-
throw err;
|
|
136477
|
-
}
|
|
136506
|
+
writeFileAtomicSync(filePath, JSON.stringify({ ...loadVerdicts(), [key2]: verdict }, null, 2));
|
|
136478
136507
|
}
|
|
136479
136508
|
async function bundleVersion(infoPlist) {
|
|
136480
136509
|
const { stdout } = await execFileAsync26(
|
|
@@ -136559,7 +136588,7 @@ init_harmony_flag();
|
|
|
136559
136588
|
|
|
136560
136589
|
// ../tool-server/src/tools/devices/boot-electron.ts
|
|
136561
136590
|
var import_node_child_process37 = require("node:child_process");
|
|
136562
|
-
var
|
|
136591
|
+
var fs53 = __toESM(require("node:fs"));
|
|
136563
136592
|
var path45 = __toESM(require("node:path"));
|
|
136564
136593
|
init_src2();
|
|
136565
136594
|
init_device_info();
|
|
@@ -136602,7 +136631,7 @@ var DEFAULT_READY_TIMEOUT_MS = 3e4;
|
|
|
136602
136631
|
var BOOT_CONFIRM_WINDOW_MS = 300;
|
|
136603
136632
|
function resolveLauncher(appPath) {
|
|
136604
136633
|
const abs = path45.resolve(appPath);
|
|
136605
|
-
if (!
|
|
136634
|
+
if (!fs53.existsSync(abs)) {
|
|
136606
136635
|
throw new FailureError(`Electron boot: path does not exist: ${abs}`, {
|
|
136607
136636
|
error_code: FAILURE_CODES.CHROMIUM_ELECTRON_APP_PATH_INVALID,
|
|
136608
136637
|
failure_stage: "electron_app_path_missing",
|
|
@@ -136610,11 +136639,11 @@ function resolveLauncher(appPath) {
|
|
|
136610
136639
|
error_kind: "validation"
|
|
136611
136640
|
});
|
|
136612
136641
|
}
|
|
136613
|
-
const stat11 =
|
|
136642
|
+
const stat11 = fs53.statSync(abs);
|
|
136614
136643
|
if (stat11.isDirectory()) {
|
|
136615
136644
|
if (abs.endsWith(".app")) {
|
|
136616
136645
|
const macOsDir = path45.join(abs, "Contents", "MacOS");
|
|
136617
|
-
if (!
|
|
136646
|
+
if (!fs53.existsSync(macOsDir)) {
|
|
136618
136647
|
throw new FailureError(
|
|
136619
136648
|
`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.`,
|
|
136620
136649
|
{
|
|
@@ -136625,7 +136654,7 @@ function resolveLauncher(appPath) {
|
|
|
136625
136654
|
}
|
|
136626
136655
|
);
|
|
136627
136656
|
}
|
|
136628
|
-
const entries =
|
|
136657
|
+
const entries = fs53.readdirSync(macOsDir).filter((name) => !name.startsWith("."));
|
|
136629
136658
|
if (entries.length === 0) {
|
|
136630
136659
|
throw new FailureError(`Electron boot: ${macOsDir} is empty.`, {
|
|
136631
136660
|
error_code: FAILURE_CODES.CHROMIUM_ELECTRON_APP_PATH_INVALID,
|
|
@@ -136639,7 +136668,7 @@ function resolveLauncher(appPath) {
|
|
|
136639
136668
|
return { command: path45.join(macOsDir, exec), args: [] };
|
|
136640
136669
|
}
|
|
136641
136670
|
const localBin = path45.join(abs, "node_modules", ".bin", "electron");
|
|
136642
|
-
if (
|
|
136671
|
+
if (fs53.existsSync(localBin)) {
|
|
136643
136672
|
return { command: localBin, args: [abs] };
|
|
136644
136673
|
}
|
|
136645
136674
|
return { command: "electron", args: [abs] };
|
|
@@ -141071,7 +141100,7 @@ async function captureHarmonyScreenshotPng(opts) {
|
|
|
141071
141100
|
|
|
141072
141101
|
// ../tool-server/src/tools/screenshot/index.ts
|
|
141073
141102
|
init_capability();
|
|
141074
|
-
var
|
|
141103
|
+
var fs55 = __toESM(require("node:fs/promises"));
|
|
141075
141104
|
var execFileAsync36 = (0, import_node_util37.promisify)(import_node_child_process47.execFile);
|
|
141076
141105
|
var capability9 = {
|
|
141077
141106
|
apple: { simulator: true, device: true },
|
|
@@ -141089,7 +141118,7 @@ async function iosPhysicalScreenshot(registry2, device, scale) {
|
|
|
141089
141118
|
);
|
|
141090
141119
|
const ref = iosDeviceRunnerRef(device);
|
|
141091
141120
|
const runner = await registry2.resolveService(ref.urn, ref.options);
|
|
141092
|
-
await
|
|
141121
|
+
await fs55.writeFile(file2, await captureRunnerScreenshotPng(runner, RUNNER_COMMAND_TIMEOUT_MS));
|
|
141093
141122
|
await downscalePngInPlace(file2, scale);
|
|
141094
141123
|
return file2;
|
|
141095
141124
|
}
|
|
@@ -141129,7 +141158,7 @@ async function tvScreenshot(udid, scale, signal) {
|
|
|
141129
141158
|
} catch {
|
|
141130
141159
|
await capture(file2);
|
|
141131
141160
|
} finally {
|
|
141132
|
-
await
|
|
141161
|
+
await fs55.rm(jpeg, { force: true });
|
|
141133
141162
|
}
|
|
141134
141163
|
return file2;
|
|
141135
141164
|
}
|
|
@@ -141238,7 +141267,7 @@ Use when you need a baseline image or the screen state after a delay (interactio
|
|
|
141238
141267
|
`argent-macos-screenshot-${process.hrtime.bigint()}.png`
|
|
141239
141268
|
);
|
|
141240
141269
|
const png = await macosScreenshotPng(app, { scale: params.scale });
|
|
141241
|
-
await
|
|
141270
|
+
await fs55.writeFile(file2, params.scale === void 0 ? fitMacosDefaultSize(png) : png);
|
|
141242
141271
|
return registerHostCapture(ctx, params, file2, "Mac app");
|
|
141243
141272
|
}
|
|
141244
141273
|
if (isIosPhysicalDevice(device)) {
|
|
@@ -145925,7 +145954,7 @@ async function queryChromiumTree(registry2, device) {
|
|
|
145925
145954
|
}
|
|
145926
145955
|
|
|
145927
145956
|
// ../tool-server/src/utils/sub-invoke.ts
|
|
145928
|
-
var
|
|
145957
|
+
var import_node_crypto22 = require("node:crypto");
|
|
145929
145958
|
init_src2();
|
|
145930
145959
|
async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
145931
145960
|
const signal = ctx?.signal;
|
|
@@ -145942,7 +145971,7 @@ async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
|
145942
145971
|
if (!recordChildInvocation) {
|
|
145943
145972
|
return signal || Object.keys(forwarded).length > 0 ? registry2.invokeTool(toolId, args, { ...signal ? { signal } : {}, ...forwarded }) : registry2.invokeTool(toolId, args);
|
|
145944
145973
|
}
|
|
145945
|
-
const toolInvocationId = (0,
|
|
145974
|
+
const toolInvocationId = (0, import_node_crypto22.randomUUID)();
|
|
145946
145975
|
const release3 = recordChildInvocation(toolInvocationId, args);
|
|
145947
145976
|
try {
|
|
145948
145977
|
return await registry2.invokeTool(toolId, args, {
|
|
@@ -160608,14 +160637,14 @@ var import_node_child_process51 = require("node:child_process");
|
|
|
160608
160637
|
var import_node_util41 = require("node:util");
|
|
160609
160638
|
var fsp5 = __toESM(require("node:fs/promises"));
|
|
160610
160639
|
var path56 = __toESM(require("node:path"));
|
|
160611
|
-
var
|
|
160640
|
+
var import_node_crypto23 = require("node:crypto");
|
|
160612
160641
|
init_src2();
|
|
160613
160642
|
|
|
160614
160643
|
// ../tool-server/src/utils/ios-launch-time/workflow.ts
|
|
160615
160644
|
var import_node_child_process50 = require("node:child_process");
|
|
160616
160645
|
var import_node_util40 = require("node:util");
|
|
160617
160646
|
var import_promises23 = require("node:timers/promises");
|
|
160618
|
-
var
|
|
160647
|
+
var fs69 = __toESM(require("node:fs"));
|
|
160619
160648
|
var fsp4 = __toESM(require("node:fs/promises"));
|
|
160620
160649
|
var path55 = __toESM(require("node:path"));
|
|
160621
160650
|
init_src();
|
|
@@ -160721,7 +160750,7 @@ async function runLogged(command2, args, options) {
|
|
|
160721
160750
|
options.signal?.throwIfAborted();
|
|
160722
160751
|
await fsp4.mkdir(path55.dirname(options.logPath), { recursive: true });
|
|
160723
160752
|
options.signal?.throwIfAborted();
|
|
160724
|
-
const log2 =
|
|
160753
|
+
const log2 = fs69.createWriteStream(options.logPath);
|
|
160725
160754
|
const child = (0, import_node_child_process50.spawn)(command2, args, {
|
|
160726
160755
|
cwd: options.cwd,
|
|
160727
160756
|
env: options.env ?? process.env,
|
|
@@ -161191,7 +161220,7 @@ async function measurePreparedLaunch(context2, ctx) {
|
|
|
161191
161220
|
const runnerSigning = context2.simulator ? null : await resolveRunnerSigningConfig(context2.deviceId);
|
|
161192
161221
|
const runnerBundleId = runnerSigning?.appBundleId ?? "com.argent.runner.tsimulator";
|
|
161193
161222
|
const testBundleId = runnerSigning?.testBundleId ?? `${runnerBundleId}.uitests`;
|
|
161194
|
-
const runnerBuildKey = (0,
|
|
161223
|
+
const runnerBuildKey = (0, import_node_crypto23.createHash)("sha256").update(
|
|
161195
161224
|
[
|
|
161196
161225
|
// Builds for two simulators, or two iPhones, are the same build.
|
|
161197
161226
|
context2.simulator ? "iOS Simulator" : "iOS",
|
|
@@ -161330,7 +161359,7 @@ async function measurePreparedLaunch(context2, ctx) {
|
|
|
161330
161359
|
|
|
161331
161360
|
// ../tool-server/src/tools/profiler/native-profiler/launch-analysis/profile.ts
|
|
161332
161361
|
var import_node_child_process52 = require("node:child_process");
|
|
161333
|
-
var
|
|
161362
|
+
var import_node_crypto24 = require("node:crypto");
|
|
161334
161363
|
var import_node_util42 = require("node:util");
|
|
161335
161364
|
var fsp6 = __toESM(require("node:fs/promises"));
|
|
161336
161365
|
var path57 = __toESM(require("node:path"));
|
|
@@ -161578,7 +161607,7 @@ var TABLE_XPATH = (schema) => `/trace-toc/run[@number="1"]/data/table[@schema="$
|
|
|
161578
161607
|
async function writeProfilerSession(xml) {
|
|
161579
161608
|
const debugDir = await getDebugDir();
|
|
161580
161609
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:]/g, "").replace("T", "-").slice(0, 15);
|
|
161581
|
-
const sessionId = `${timestamp}-launch-${(0,
|
|
161610
|
+
const sessionId = `${timestamp}-launch-${(0, import_node_crypto24.randomUUID)()}`;
|
|
161582
161611
|
const cpuXmlPath = path57.join(debugDir, `native-profiler-${sessionId}_raw_cpu.xml`);
|
|
161583
161612
|
await fsp6.writeFile(cpuXmlPath, xml, { flag: "wx" });
|
|
161584
161613
|
return { sessionId, cpuXmlPath };
|
|
@@ -161904,9 +161933,9 @@ init_zod();
|
|
|
161904
161933
|
|
|
161905
161934
|
// ../tool-server/src/utils/ios-audio.ts
|
|
161906
161935
|
var import_node_child_process53 = require("node:child_process");
|
|
161907
|
-
var
|
|
161936
|
+
var fs70 = __toESM(require("node:fs"));
|
|
161908
161937
|
var path58 = __toESM(require("node:path"));
|
|
161909
|
-
var
|
|
161938
|
+
var import_node_crypto25 = require("node:crypto");
|
|
161910
161939
|
var import_node_util43 = require("node:util");
|
|
161911
161940
|
init_src2();
|
|
161912
161941
|
init_capability();
|
|
@@ -161925,12 +161954,12 @@ function createAudioSession(udid) {
|
|
|
161925
161954
|
}
|
|
161926
161955
|
function writeAtomic(file2, text) {
|
|
161927
161956
|
const tmp = path58.join(path58.dirname(file2), `.${path58.basename(file2)}.${process.pid}.tmp`);
|
|
161928
|
-
|
|
161929
|
-
|
|
161957
|
+
fs70.writeFileSync(tmp, text);
|
|
161958
|
+
fs70.renameSync(tmp, file2);
|
|
161930
161959
|
}
|
|
161931
161960
|
async function ensureAudioEnv(session) {
|
|
161932
161961
|
const { dir } = session;
|
|
161933
|
-
|
|
161962
|
+
fs70.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
161934
161963
|
if (session.envVerified) return;
|
|
161935
161964
|
const dylib = requireAudioDylib();
|
|
161936
161965
|
const { nativeId, prefix } = await simctlTargetForUdid(session.udid, {
|
|
@@ -162020,7 +162049,7 @@ function parseAppStatus(text) {
|
|
|
162020
162049
|
function readAppStatus(session, bundleId) {
|
|
162021
162050
|
let text;
|
|
162022
162051
|
try {
|
|
162023
|
-
text =
|
|
162052
|
+
text = fs70.readFileSync(path58.join(session.dir, `st.${bundleId}`), "utf8");
|
|
162024
162053
|
} catch {
|
|
162025
162054
|
return null;
|
|
162026
162055
|
}
|
|
@@ -162036,7 +162065,7 @@ function decideHookState(status, pidAlive2, runningPid) {
|
|
|
162036
162065
|
async function readAppHook(session, bundleId) {
|
|
162037
162066
|
let text;
|
|
162038
162067
|
try {
|
|
162039
|
-
text =
|
|
162068
|
+
text = fs70.readFileSync(path58.join(session.dir, `st.${bundleId}`), "utf8");
|
|
162040
162069
|
} catch {
|
|
162041
162070
|
return { state: "none", status: null };
|
|
162042
162071
|
}
|
|
@@ -162050,14 +162079,14 @@ async function readAppHook(session, bundleId) {
|
|
|
162050
162079
|
function listLiveApps(session) {
|
|
162051
162080
|
let names;
|
|
162052
162081
|
try {
|
|
162053
|
-
names =
|
|
162082
|
+
names = fs70.readdirSync(session.dir);
|
|
162054
162083
|
} catch {
|
|
162055
162084
|
return [];
|
|
162056
162085
|
}
|
|
162057
162086
|
return names.filter((name) => name.startsWith("st.") && !name.endsWith(".tmp")).map((name) => name.slice(3)).filter((bundleId) => readAppStatus(session, bundleId) !== null);
|
|
162058
162087
|
}
|
|
162059
162088
|
async function convertClip(inputPath, outputPath2) {
|
|
162060
|
-
if (!
|
|
162089
|
+
if (!fs70.existsSync(inputPath)) {
|
|
162061
162090
|
throw new InvalidToolInputError(`Audio file not found: ${inputPath}`);
|
|
162062
162091
|
}
|
|
162063
162092
|
try {
|
|
@@ -162080,13 +162109,13 @@ async function convertClip(inputPath, outputPath2) {
|
|
|
162080
162109
|
}
|
|
162081
162110
|
}
|
|
162082
162111
|
function removeFiles(dir, prefix, keep) {
|
|
162083
|
-
for (const name of
|
|
162084
|
-
if (name.startsWith(prefix) && name !== keep)
|
|
162112
|
+
for (const name of fs70.readdirSync(dir)) {
|
|
162113
|
+
if (name.startsWith(prefix) && name !== keep) fs70.rmSync(path58.join(dir, name), { force: true });
|
|
162085
162114
|
}
|
|
162086
162115
|
}
|
|
162087
162116
|
async function setAudioInput(session, source) {
|
|
162088
162117
|
const { dir } = session;
|
|
162089
|
-
|
|
162118
|
+
fs70.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
162090
162119
|
let feederSource;
|
|
162091
162120
|
let clipName;
|
|
162092
162121
|
let durationMs;
|
|
@@ -162096,7 +162125,7 @@ async function setAudioInput(session, source) {
|
|
|
162096
162125
|
clipName = `clip-${process.pid}-${Date.now()}.wav`;
|
|
162097
162126
|
const clipPath = path58.join(dir, clipName);
|
|
162098
162127
|
await convertClip(source.path, clipPath);
|
|
162099
|
-
const fd =
|
|
162128
|
+
const fd = fs70.openSync(clipPath, "r");
|
|
162100
162129
|
try {
|
|
162101
162130
|
const info = readClipInfo(fd);
|
|
162102
162131
|
if (info.frames > MAX_CLIP_SECONDS * STREAM_RATE) {
|
|
@@ -162107,13 +162136,13 @@ async function setAudioInput(session, source) {
|
|
|
162107
162136
|
feederSource = { kind: "clip", fd, info, plays: source.plays };
|
|
162108
162137
|
durationMs = Math.round(info.frames * 1e3 / STREAM_RATE);
|
|
162109
162138
|
} catch (err) {
|
|
162110
|
-
|
|
162111
|
-
|
|
162139
|
+
fs70.closeSync(fd);
|
|
162140
|
+
fs70.rmSync(clipPath, { force: true });
|
|
162112
162141
|
throw err;
|
|
162113
162142
|
}
|
|
162114
162143
|
}
|
|
162115
162144
|
let feeder = session.feeder;
|
|
162116
|
-
if (feeder?.running && !
|
|
162145
|
+
if (feeder?.running && !fs70.existsSync(feeder.ringPath)) {
|
|
162117
162146
|
feeder.stop();
|
|
162118
162147
|
feeder = null;
|
|
162119
162148
|
}
|
|
@@ -162122,7 +162151,7 @@ async function setAudioInput(session, source) {
|
|
|
162122
162151
|
} else {
|
|
162123
162152
|
removeFiles(dir, `in-${process.pid}-`);
|
|
162124
162153
|
feeder = new InputFeeder(
|
|
162125
|
-
path58.join(dir, `in-${process.pid}-${(0,
|
|
162154
|
+
path58.join(dir, `in-${process.pid}-${(0, import_node_crypto25.randomUUID)().slice(0, 8)}.ring`),
|
|
162126
162155
|
feederSource
|
|
162127
162156
|
);
|
|
162128
162157
|
feeder.start();
|
|
@@ -162132,7 +162161,7 @@ async function setAudioInput(session, source) {
|
|
|
162132
162161
|
const control = `source=stream
|
|
162133
162162
|
ring=${feeder.ringPath}
|
|
162134
162163
|
${OWNER_LINE}`;
|
|
162135
|
-
if (!
|
|
162164
|
+
if (!fs70.existsSync(inputFile) || fs70.readFileSync(inputFile, "utf8") !== control) {
|
|
162136
162165
|
writeAtomic(inputFile, control);
|
|
162137
162166
|
}
|
|
162138
162167
|
removeFiles(dir, `clip-${process.pid}-`, clipName);
|
|
@@ -162142,15 +162171,15 @@ function clearAudioInput(session, ownedOnly = false) {
|
|
|
162142
162171
|
const { dir } = session;
|
|
162143
162172
|
session.feeder?.stop();
|
|
162144
162173
|
session.feeder = null;
|
|
162145
|
-
if (!
|
|
162174
|
+
if (!fs70.existsSync(dir)) return;
|
|
162146
162175
|
const inputFile = path58.join(dir, "input");
|
|
162147
|
-
if (!ownedOnly || ownsInput(inputFile))
|
|
162176
|
+
if (!ownedOnly || ownsInput(inputFile)) fs70.rmSync(inputFile, { force: true });
|
|
162148
162177
|
removeFiles(dir, `clip-${process.pid}-`);
|
|
162149
162178
|
removeFiles(dir, `in-${process.pid}-`);
|
|
162150
162179
|
}
|
|
162151
162180
|
function ownsInput(inputFile) {
|
|
162152
162181
|
try {
|
|
162153
|
-
return
|
|
162182
|
+
return fs70.readFileSync(inputFile, "utf8").split("\n").includes(OWNER_LINE.trim());
|
|
162154
162183
|
} catch {
|
|
162155
162184
|
return false;
|
|
162156
162185
|
}
|
|
@@ -162172,10 +162201,10 @@ function releaseAudio(session) {
|
|
|
162172
162201
|
}
|
|
162173
162202
|
|
|
162174
162203
|
// ../tool-server/src/utils/ios-audio-remote.ts
|
|
162175
|
-
var
|
|
162204
|
+
var fs71 = __toESM(require("node:fs"));
|
|
162176
162205
|
var net13 = __toESM(require("node:net"));
|
|
162177
162206
|
var path59 = __toESM(require("node:path"));
|
|
162178
|
-
var
|
|
162207
|
+
var import_node_crypto26 = require("node:crypto");
|
|
162179
162208
|
init_src2();
|
|
162180
162209
|
init_device_info();
|
|
162181
162210
|
init_capability();
|
|
@@ -162348,7 +162377,7 @@ async function startFeeder(session) {
|
|
|
162348
162377
|
const stale = session.link;
|
|
162349
162378
|
session.link = null;
|
|
162350
162379
|
await stale?.close();
|
|
162351
|
-
const token = (0,
|
|
162380
|
+
const token = (0, import_node_crypto26.randomBytes)(12).toString("hex");
|
|
162352
162381
|
const server = net13.createServer();
|
|
162353
162382
|
await new Promise((resolve24, reject) => {
|
|
162354
162383
|
server.once("error", reject);
|
|
@@ -162418,12 +162447,12 @@ async function setRemoteAudioInput(session, source) {
|
|
|
162418
162447
|
}
|
|
162419
162448
|
let bytes;
|
|
162420
162449
|
try {
|
|
162421
|
-
if (
|
|
162450
|
+
if (fs71.statSync(source.path).size > MAX_FILE_BYTES) {
|
|
162422
162451
|
throw new InvalidToolInputError(
|
|
162423
162452
|
`${source.path} is larger than ${MAX_FILE_BYTES / 1024 / 1024} MB.`
|
|
162424
162453
|
);
|
|
162425
162454
|
}
|
|
162426
|
-
bytes =
|
|
162455
|
+
bytes = fs71.readFileSync(source.path);
|
|
162427
162456
|
} catch (err) {
|
|
162428
162457
|
if (err instanceof InvalidToolInputError) throw err;
|
|
162429
162458
|
throw new InvalidToolInputError(`Audio file not found: ${source.path}`);
|
|
@@ -167270,14 +167299,14 @@ init_src2();
|
|
|
167270
167299
|
init_capability();
|
|
167271
167300
|
|
|
167272
167301
|
// ../tool-server/src/tools/flows/flow-script-step.ts
|
|
167273
|
-
var
|
|
167302
|
+
var fs82 = __toESM(require("node:fs/promises"));
|
|
167274
167303
|
var path65 = __toESM(require("node:path"));
|
|
167275
167304
|
var import_node_url4 = require("node:url");
|
|
167276
167305
|
init_src2();
|
|
167277
167306
|
|
|
167278
167307
|
// ../tool-server/src/tools/flows/script/flow-script-executor.ts
|
|
167279
167308
|
var import_node_child_process55 = require("node:child_process");
|
|
167280
|
-
var
|
|
167309
|
+
var fs81 = __toESM(require("node:fs"));
|
|
167281
167310
|
var os17 = __toESM(require("node:os"));
|
|
167282
167311
|
var path64 = __toESM(require("node:path"));
|
|
167283
167312
|
var import_node_string_decoder = require("node:string_decoder");
|
|
@@ -168043,7 +168072,7 @@ function describeDirectoryProblem(candidate) {
|
|
|
168043
168072
|
}
|
|
168044
168073
|
if (candidate.split(/[\\/]+/).includes("..")) return 'contains a ".." segment';
|
|
168045
168074
|
try {
|
|
168046
|
-
return
|
|
168075
|
+
return fs81.statSync(candidate).isDirectory() ? null : "is not a directory";
|
|
168047
168076
|
} catch {
|
|
168048
168077
|
return "does not exist";
|
|
168049
168078
|
}
|
|
@@ -168068,7 +168097,7 @@ function encodeRequestOutput(output2) {
|
|
|
168068
168097
|
}
|
|
168069
168098
|
function realPathOrSelf(candidate) {
|
|
168070
168099
|
try {
|
|
168071
|
-
return
|
|
168100
|
+
return fs81.realpathSync(candidate);
|
|
168072
168101
|
} catch {
|
|
168073
168102
|
return candidate;
|
|
168074
168103
|
}
|
|
@@ -168077,7 +168106,7 @@ var TYPELESS_PACKAGE_WARNING_FLAG = "--disable-warning=MODULE_TYPELESS_PACKAGE_J
|
|
|
168077
168106
|
function resolveRunnerPath(runnerDir) {
|
|
168078
168107
|
const dir = runnerDir ?? __dirname;
|
|
168079
168108
|
const runner = path64.join(dir, RUNNER_FILE);
|
|
168080
|
-
if (!
|
|
168109
|
+
if (!fs81.existsSync(runner)) {
|
|
168081
168110
|
throw new ScriptSetupError(
|
|
168082
168111
|
"spawn",
|
|
168083
168112
|
`The script runner is missing from this installation (looked for ${runner}).`
|
|
@@ -168725,7 +168754,7 @@ function scriptRan(result) {
|
|
|
168725
168754
|
}
|
|
168726
168755
|
async function scriptFileProblem(canonical) {
|
|
168727
168756
|
try {
|
|
168728
|
-
const stat11 = await
|
|
168757
|
+
const stat11 = await fs82.stat(canonical);
|
|
168729
168758
|
return stat11.isFile() ? null : "is not a file";
|
|
168730
168759
|
} catch (err) {
|
|
168731
168760
|
const code = err.code;
|
|
@@ -168879,7 +168908,7 @@ Returns \`{ message, e2eTestFile, savedTo, restarted?, discardedSteps?, fragment
|
|
|
168879
168908
|
|
|
168880
168909
|
// ../tool-server/src/tools/flows/flow-add-step.ts
|
|
168881
168910
|
init_zod();
|
|
168882
|
-
var
|
|
168911
|
+
var fs85 = __toESM(require("node:fs/promises"));
|
|
168883
168912
|
var path69 = __toESM(require("node:path"));
|
|
168884
168913
|
init_src2();
|
|
168885
168914
|
|
|
@@ -169696,7 +169725,7 @@ function supportsFlowTree(platform) {
|
|
|
169696
169725
|
}
|
|
169697
169726
|
|
|
169698
169727
|
// ../tool-server/src/tools/flows/flow-pixels.ts
|
|
169699
|
-
var
|
|
169728
|
+
var fs83 = __toESM(require("node:fs/promises"));
|
|
169700
169729
|
var os18 = __toESM(require("node:os"));
|
|
169701
169730
|
var path66 = __toESM(require("node:path"));
|
|
169702
169731
|
var import_pngjs5 = __toESM(require_png());
|
|
@@ -169789,7 +169818,7 @@ async function captureIosDeviceFile(env, budgetMs) {
|
|
|
169789
169818
|
os18.tmpdir(),
|
|
169790
169819
|
`argent-ios-device-settle-${env.device.id.slice(0, 8)}-${process.hrtime.bigint()}.png`
|
|
169791
169820
|
);
|
|
169792
|
-
await
|
|
169821
|
+
await fs83.writeFile(file2, png);
|
|
169793
169822
|
await downscalePngInPlace(file2, CAPTURE_SCALE, captureAbortSignal(env, budgetMs));
|
|
169794
169823
|
return file2;
|
|
169795
169824
|
}
|
|
@@ -169803,9 +169832,9 @@ async function capturePng(env, budgetMs) {
|
|
|
169803
169832
|
}
|
|
169804
169833
|
const { path: file2, warning } = await captureFile(env, budgetMs);
|
|
169805
169834
|
try {
|
|
169806
|
-
return { png: await
|
|
169835
|
+
return { png: await fs83.readFile(file2), ...warning !== void 0 ? { warning } : {} };
|
|
169807
169836
|
} finally {
|
|
169808
|
-
await
|
|
169837
|
+
await fs83.rm(file2, { force: true }).catch(() => {
|
|
169809
169838
|
});
|
|
169810
169839
|
}
|
|
169811
169840
|
}
|
|
@@ -170994,7 +171023,7 @@ var path68 = __toESM(require("node:path"));
|
|
|
170994
171023
|
init_src2();
|
|
170995
171024
|
|
|
170996
171025
|
// ../tool-server/src/tools/flows/project-access.ts
|
|
170997
|
-
var
|
|
171026
|
+
var fs84 = __toESM(require("node:fs/promises"));
|
|
170998
171027
|
var path67 = __toESM(require("node:path"));
|
|
170999
171028
|
init_src2();
|
|
171000
171029
|
async function resolveRunTarget(project, anchorDir, target) {
|
|
@@ -171005,7 +171034,7 @@ async function resolveRunTarget(project, anchorDir, target) {
|
|
|
171005
171034
|
const other = await project.resolveFlowFile(dir, target);
|
|
171006
171035
|
if (other.spelling.state === "absent") continue;
|
|
171007
171036
|
if (other.spelling.state === "case_folded") return { ...other, anchorDir: dir };
|
|
171008
|
-
const found = project.mode === "host" ? await
|
|
171037
|
+
const found = project.mode === "host" ? await fs84.stat(other.canonical).then(
|
|
171009
171038
|
() => true,
|
|
171010
171039
|
() => false
|
|
171011
171040
|
) : await other.read() !== null;
|
|
@@ -171062,7 +171091,7 @@ var HostProjectAccess = class {
|
|
|
171062
171091
|
spelling,
|
|
171063
171092
|
read: async () => {
|
|
171064
171093
|
try {
|
|
171065
|
-
return await
|
|
171094
|
+
return await fs84.readFile(canonical, "utf8");
|
|
171066
171095
|
} catch (err) {
|
|
171067
171096
|
if (!isEnoent(err)) throw err;
|
|
171068
171097
|
return null;
|
|
@@ -171072,19 +171101,19 @@ var HostProjectAccess = class {
|
|
|
171072
171101
|
}
|
|
171073
171102
|
async readFile(filePath) {
|
|
171074
171103
|
try {
|
|
171075
|
-
return await
|
|
171104
|
+
return await fs84.readFile(filePath);
|
|
171076
171105
|
} catch (err) {
|
|
171077
171106
|
if (!isNothingThere(err)) throw err;
|
|
171078
171107
|
return null;
|
|
171079
171108
|
}
|
|
171080
171109
|
}
|
|
171081
171110
|
async writeBaseline(filePath, bytes) {
|
|
171082
|
-
const replaced = await
|
|
171111
|
+
const replaced = await fs84.access(filePath).then(
|
|
171083
171112
|
() => true,
|
|
171084
171113
|
() => false
|
|
171085
171114
|
);
|
|
171086
|
-
await
|
|
171087
|
-
await
|
|
171115
|
+
await fs84.mkdir(path67.dirname(filePath), { recursive: true });
|
|
171116
|
+
await fs84.writeFile(filePath, bytes);
|
|
171088
171117
|
return { replaced };
|
|
171089
171118
|
}
|
|
171090
171119
|
};
|
|
@@ -171174,7 +171203,7 @@ var ClientProjectAccess = class {
|
|
|
171174
171203
|
const member = this.file(filePath);
|
|
171175
171204
|
if (member === void 0 || member.state === "missing") return null;
|
|
171176
171205
|
if (member.state === "present" && member.hostPath !== void 0) {
|
|
171177
|
-
return
|
|
171206
|
+
return fs84.readFile(member.hostPath);
|
|
171178
171207
|
}
|
|
171179
171208
|
throw clientRefusal(
|
|
171180
171209
|
filePath,
|
|
@@ -171915,7 +171944,7 @@ async function captureTapSelector(registry2, session, udid, point, block) {
|
|
|
171915
171944
|
async function activeFlowState(session, block) {
|
|
171916
171945
|
if (session.persist === "host") {
|
|
171917
171946
|
try {
|
|
171918
|
-
adoptRecordedFile(session, parseFlow(await
|
|
171947
|
+
adoptRecordedFile(session, parseFlow(await fs85.readFile(session.filePath, "utf8")));
|
|
171919
171948
|
} catch (err) {
|
|
171920
171949
|
return {
|
|
171921
171950
|
stepCount: recordedCount(session.flow, block),
|
|
@@ -172592,7 +172621,7 @@ var flowSetVarsTool = {
|
|
|
172592
172621
|
init_zod();
|
|
172593
172622
|
var nodePath = __toESM(require("node:path"));
|
|
172594
172623
|
init_src2();
|
|
172595
|
-
var
|
|
172624
|
+
var fs86 = __toESM(require("node:fs/promises"));
|
|
172596
172625
|
init_capability();
|
|
172597
172626
|
init_device_info();
|
|
172598
172627
|
var OUTPUT_RENDER_LIMIT_BYTES = 64 * 1024;
|
|
@@ -172606,7 +172635,7 @@ async function recordedStepCount(session, block) {
|
|
|
172606
172635
|
}
|
|
172607
172636
|
async function recordedFileVars(session) {
|
|
172608
172637
|
try {
|
|
172609
|
-
return parseFlow(await
|
|
172638
|
+
return parseFlow(await fs86.readFile(session.filePath, "utf8")).vars;
|
|
172610
172639
|
} catch (err) {
|
|
172611
172640
|
throw wrapFailure(
|
|
172612
172641
|
err,
|
|
@@ -172781,7 +172810,7 @@ Returns \`{ status, reason?, outputJson?, stepCount, recorded? }\`. A failed scr
|
|
|
172781
172810
|
|
|
172782
172811
|
// ../tool-server/src/tools/flows/flow-finish-recording.ts
|
|
172783
172812
|
init_zod();
|
|
172784
|
-
var
|
|
172813
|
+
var fs87 = __toESM(require("node:fs/promises"));
|
|
172785
172814
|
function attachStepWarnings(summary, warnings) {
|
|
172786
172815
|
if (warnings.size === 0) return summary;
|
|
172787
172816
|
return summary.flatMap((line, i) => {
|
|
@@ -172864,7 +172893,7 @@ Returns \`{ message, path, steps, shutdownSteps?, fragmentShutdown?, summary, e2
|
|
|
172864
172893
|
flowFile2 = serializeFlow(session.flow);
|
|
172865
172894
|
savedTo2 = clientFileDirective(filePath2, flowFile2);
|
|
172866
172895
|
} else {
|
|
172867
|
-
flowFile2 = await
|
|
172896
|
+
flowFile2 = await fs87.readFile(filePath2, "utf8");
|
|
172868
172897
|
savedTo2 = filePath2;
|
|
172869
172898
|
}
|
|
172870
172899
|
const flow2 = parseFlow(flowFile2);
|
|
@@ -172915,12 +172944,12 @@ Returns \`{ message, path, steps, shutdownSteps?, fragmentShutdown?, summary, e2
|
|
|
172915
172944
|
|
|
172916
172945
|
// ../tool-server/src/tools/flows/flow-run.ts
|
|
172917
172946
|
init_zod();
|
|
172918
|
-
var
|
|
172947
|
+
var fs91 = __toESM(require("node:fs/promises"));
|
|
172919
172948
|
var path73 = __toESM(require("node:path"));
|
|
172920
172949
|
init_src2();
|
|
172921
172950
|
|
|
172922
172951
|
// ../tool-server/src/tools/flows/flow-preflight.ts
|
|
172923
|
-
var
|
|
172952
|
+
var fs88 = __toESM(require("node:fs/promises"));
|
|
172924
172953
|
var path70 = __toESM(require("node:path"));
|
|
172925
172954
|
init_src2();
|
|
172926
172955
|
function* walkSteps(steps, within3 = "", levels = [], label = "step") {
|
|
@@ -173368,7 +173397,7 @@ async function readNestedTest(project, target, toolName) {
|
|
|
173368
173397
|
}
|
|
173369
173398
|
const canonical = await canonicalFlowPath(filePath);
|
|
173370
173399
|
try {
|
|
173371
|
-
return { canonical, flowName, text: await
|
|
173400
|
+
return { canonical, flowName, text: await fs88.readFile(canonical, "utf8") };
|
|
173372
173401
|
} catch (err) {
|
|
173373
173402
|
return { refusal: errMsg5(err) };
|
|
173374
173403
|
}
|
|
@@ -173455,8 +173484,8 @@ init_device_info();
|
|
|
173455
173484
|
init_capability();
|
|
173456
173485
|
|
|
173457
173486
|
// ../tool-server/src/tools/flows/flow-visual.ts
|
|
173458
|
-
var
|
|
173459
|
-
var
|
|
173487
|
+
var import_node_crypto27 = require("node:crypto");
|
|
173488
|
+
var fs90 = __toESM(require("node:fs/promises"));
|
|
173460
173489
|
var os19 = __toESM(require("node:os"));
|
|
173461
173490
|
var path72 = __toESM(require("node:path"));
|
|
173462
173491
|
var import_pngjs7 = __toESM(require_png());
|
|
@@ -175501,7 +175530,7 @@ function roundToOne(value) {
|
|
|
175501
175530
|
// ../tool-server/src/tools/flows/flow-visual.ts
|
|
175502
175531
|
var DEFAULT_MAX_MISMATCH = 0.5;
|
|
175503
175532
|
async function pngDimensions(file2) {
|
|
175504
|
-
const fh = await
|
|
175533
|
+
const fh = await fs90.open(file2, "r");
|
|
175505
175534
|
try {
|
|
175506
175535
|
const buf = Buffer.alloc(24);
|
|
175507
175536
|
await fh.read(buf, 0, 24, 0);
|
|
@@ -175533,12 +175562,12 @@ function baselineDir(flowsDir, flowName) {
|
|
|
175533
175562
|
async function cleanupDiffDir(dir, keep) {
|
|
175534
175563
|
try {
|
|
175535
175564
|
if (!keep) {
|
|
175536
|
-
await
|
|
175565
|
+
await fs90.rm(dir, { recursive: true, force: true });
|
|
175537
175566
|
return;
|
|
175538
175567
|
}
|
|
175539
|
-
for (const entry of await
|
|
175568
|
+
for (const entry of await fs90.readdir(dir)) {
|
|
175540
175569
|
const entryPath = path72.join(dir, entry);
|
|
175541
|
-
if (entryPath !== keep) await
|
|
175570
|
+
if (entryPath !== keep) await fs90.rm(entryPath, { recursive: true, force: true });
|
|
175542
175571
|
}
|
|
175543
175572
|
} catch {
|
|
175544
175573
|
}
|
|
@@ -175549,7 +175578,7 @@ function namingClientBaseline(err, copy, clientPath) {
|
|
|
175549
175578
|
return new FailureError(err.message.split(copy).join(clientPath), signal);
|
|
175550
175579
|
}
|
|
175551
175580
|
async function cropPngFile(src, dest, frame2) {
|
|
175552
|
-
const png = import_pngjs7.PNG.sync.read(await
|
|
175581
|
+
const png = import_pngjs7.PNG.sync.read(await fs90.readFile(src));
|
|
175553
175582
|
const left = Math.max(0, Math.round(frame2.x * png.width));
|
|
175554
175583
|
const top = Math.max(0, Math.round(frame2.y * png.height));
|
|
175555
175584
|
const right = Math.min(png.width, Math.round((frame2.x + frame2.width) * png.width));
|
|
@@ -175559,7 +175588,7 @@ async function cropPngFile(src, dest, frame2) {
|
|
|
175559
175588
|
if (w < 1 || h < 1) return null;
|
|
175560
175589
|
const out = new import_pngjs7.PNG({ width: w, height: h });
|
|
175561
175590
|
import_pngjs7.PNG.bitblt(png, out, left, top, w, h, 0, 0);
|
|
175562
|
-
await
|
|
175591
|
+
await fs90.writeFile(dest, import_pngjs7.PNG.sync.write(out));
|
|
175563
175592
|
return { w, h };
|
|
175564
175593
|
}
|
|
175565
175594
|
async function warmSnapshotCapture(registry2, device) {
|
|
@@ -175601,7 +175630,7 @@ async function runSnapshot(env, opts) {
|
|
|
175601
175630
|
});
|
|
175602
175631
|
let captureWarned = shot.warning !== void 0 ? { warning: shot.warning } : {};
|
|
175603
175632
|
const { w, h } = await pngDimensions(shot.image.hostPath);
|
|
175604
|
-
const cropSuffix = opts.cropOn === void 0 ? "" : `-crop-${(0,
|
|
175633
|
+
const cropSuffix = opts.cropOn === void 0 ? "" : `-crop-${(0, import_node_crypto27.createHash)("sha256").update(cropIdentity(opts.cropOn)).digest("hex").slice(0, 8)}`;
|
|
175605
175634
|
const keyFor = (width, height) => `${opts.name}__${authoringPlatform(env.device.platform)}-${width}x${height}${cropSuffix}`;
|
|
175606
175635
|
const baselineFor = (file2) => opts.clientFlowPath === void 0 ? path72.join(baselineDir(opts.flowsDir, opts.flowName), file2) : clientBaselinePath(opts.clientFlowPath, opts.flowName, file2);
|
|
175607
175636
|
const snapshotKey = keyFor(w, h);
|
|
@@ -175634,9 +175663,9 @@ async function runSnapshot(env, opts) {
|
|
|
175634
175663
|
let keepBaselineCopy = false;
|
|
175635
175664
|
const hostBaseline = async (bytes) => {
|
|
175636
175665
|
if (opts.clientFlowPath === void 0) return baselinePath;
|
|
175637
|
-
baselineCopyDir = await
|
|
175666
|
+
baselineCopyDir = await fs90.mkdtemp(path72.join(os19.tmpdir(), "argent-e2e-baseline-"));
|
|
175638
175667
|
const copy = path72.join(baselineCopyDir, key2);
|
|
175639
|
-
await
|
|
175668
|
+
await fs90.writeFile(copy, bytes);
|
|
175640
175669
|
return copy;
|
|
175641
175670
|
};
|
|
175642
175671
|
const baselineArtifact = (hostPath) => {
|
|
@@ -175645,7 +175674,7 @@ async function runSnapshot(env, opts) {
|
|
|
175645
175674
|
};
|
|
175646
175675
|
try {
|
|
175647
175676
|
if (cropFrame !== void 0) {
|
|
175648
|
-
cropDir = await
|
|
175677
|
+
cropDir = await fs90.mkdtemp(path72.join(os19.tmpdir(), "argent-e2e-crop-"));
|
|
175649
175678
|
const croppedPath = path72.join(cropDir, key2);
|
|
175650
175679
|
const cropped = await cropPngFile(shot.image.hostPath, croppedPath, cropFrame);
|
|
175651
175680
|
if (cropped === null) {
|
|
@@ -175663,7 +175692,7 @@ async function runSnapshot(env, opts) {
|
|
|
175663
175692
|
if (opts.updateBaselines) {
|
|
175664
175693
|
const { replaced } = await opts.project.writeBaseline(
|
|
175665
175694
|
baselinePath,
|
|
175666
|
-
await
|
|
175695
|
+
await fs90.readFile(currentPath)
|
|
175667
175696
|
);
|
|
175668
175697
|
const source = env.device.platform === "ios-remote" ? " from a remote simulator" : "";
|
|
175669
175698
|
if (opts.clientFlowPath !== void 0) {
|
|
@@ -175703,7 +175732,7 @@ async function runSnapshot(env, opts) {
|
|
|
175703
175732
|
const legacyPath = baselineFor(legacyKey);
|
|
175704
175733
|
const legacy = await readBaseline(legacyPath);
|
|
175705
175734
|
if (legacy !== null) {
|
|
175706
|
-
cropDir ??= await
|
|
175735
|
+
cropDir ??= await fs90.mkdtemp(path72.join(os19.tmpdir(), "argent-e2e-crop-"));
|
|
175707
175736
|
const turnedPath = path72.join(cropDir, `native-${legacyKey}`);
|
|
175708
175737
|
await turnPngToNative(currentPath, turnedPath, sideways);
|
|
175709
175738
|
currentPath = turnedPath;
|
|
@@ -175765,7 +175794,7 @@ async function runSnapshot(env, opts) {
|
|
|
175765
175794
|
baseline: await baselineArtifact(localBaseline),
|
|
175766
175795
|
current: await currentArtifact()
|
|
175767
175796
|
};
|
|
175768
|
-
outputDir = await
|
|
175797
|
+
outputDir = await fs90.mkdtemp(path72.join(os19.tmpdir(), "argent-e2e-diff-"));
|
|
175769
175798
|
const contextDiffPath = path72.join(outputDir, `${snapshotKey}-diff.png`);
|
|
175770
175799
|
if (await writeContextDiff(result, contextDiffPath)) {
|
|
175771
175800
|
artifacts.diff = await store.register({
|
|
@@ -175798,7 +175827,7 @@ async function sidewaysOrientation(env) {
|
|
|
175798
175827
|
return orientation === "landscapeLeft" || orientation === "landscapeRight" ? orientation : void 0;
|
|
175799
175828
|
}
|
|
175800
175829
|
async function turnPngToNative(src, dest, orientation) {
|
|
175801
|
-
const upright = import_pngjs7.PNG.sync.read(await
|
|
175830
|
+
const upright = import_pngjs7.PNG.sync.read(await fs90.readFile(src));
|
|
175802
175831
|
const native = new import_pngjs7.PNG({ width: upright.height, height: upright.width });
|
|
175803
175832
|
for (let y = 0; y < native.height; y++) {
|
|
175804
175833
|
for (let x = 0; x < native.width; x++) {
|
|
@@ -175816,7 +175845,7 @@ async function turnPngToNative(src, dest, orientation) {
|
|
|
175816
175845
|
);
|
|
175817
175846
|
}
|
|
175818
175847
|
}
|
|
175819
|
-
await
|
|
175848
|
+
await fs90.writeFile(dest, import_pngjs7.PNG.sync.write(native));
|
|
175820
175849
|
}
|
|
175821
175850
|
|
|
175822
175851
|
// ../tool-server/src/utils/status-bar.ts
|
|
@@ -176681,7 +176710,7 @@ async function readRootTest(params, ctx) {
|
|
|
176681
176710
|
return {
|
|
176682
176711
|
...source,
|
|
176683
176712
|
canonicalPath: canonicalPath2,
|
|
176684
|
-
text: await
|
|
176713
|
+
text: await fs91.readFile(canonicalPath2, "utf8"),
|
|
176685
176714
|
...client2 && { client: client2 },
|
|
176686
176715
|
project: client2?.project ?? new HostProjectAccess()
|
|
176687
176716
|
};
|
|
@@ -176736,7 +176765,7 @@ function launchTargetPlatform(launch, platform) {
|
|
|
176736
176765
|
async function resolveAppPath(specPath, flowDir) {
|
|
176737
176766
|
const lexical = path73.resolve(flowDir, specPath);
|
|
176738
176767
|
try {
|
|
176739
|
-
return await
|
|
176768
|
+
return await fs91.realpath(lexical);
|
|
176740
176769
|
} catch {
|
|
176741
176770
|
return lexical;
|
|
176742
176771
|
}
|
|
@@ -177625,7 +177654,7 @@ Pass exactly one e2e test source: name (under project_root) or e2e_test_path.`,
|
|
|
177625
177654
|
|
|
177626
177655
|
// ../tool-server/src/tools/flows/flow-read-prerequisite.ts
|
|
177627
177656
|
init_zod();
|
|
177628
|
-
var
|
|
177657
|
+
var fs92 = __toESM(require("node:fs/promises"));
|
|
177629
177658
|
init_src2();
|
|
177630
177659
|
var fileInputs5 = [
|
|
177631
177660
|
{
|
|
@@ -177697,7 +177726,7 @@ Address the e2e test exactly as you will address it in e2e-execute: name or e2e_
|
|
|
177697
177726
|
ctx?.fileInputs?.e2e_test_file,
|
|
177698
177727
|
ctx?.fileInputs?.e2e_test_path
|
|
177699
177728
|
);
|
|
177700
|
-
const flow = parseFlow(await
|
|
177729
|
+
const flow = parseFlow(await fs92.readFile(filePath, "utf8"));
|
|
177701
177730
|
return {
|
|
177702
177731
|
e2eTest: flowName,
|
|
177703
177732
|
flow: flowName,
|
|
@@ -178085,7 +178114,7 @@ var dismissUpdateTool = {
|
|
|
178085
178114
|
};
|
|
178086
178115
|
|
|
178087
178116
|
// ../tool-server/src/tools/screenshot-diff/index.ts
|
|
178088
|
-
var
|
|
178117
|
+
var import_node_crypto28 = __toESM(require("node:crypto"));
|
|
178089
178118
|
var import_promises26 = __toESM(require("fs/promises"));
|
|
178090
178119
|
var import_node_os19 = __toESM(require("node:os"));
|
|
178091
178120
|
var import_path9 = __toESM(require("path"));
|
|
@@ -178229,7 +178258,7 @@ async function resolveOutputDir(params, options) {
|
|
|
178229
178258
|
const dir = import_path9.default.join(
|
|
178230
178259
|
import_node_os19.default.tmpdir(),
|
|
178231
178260
|
"argent-screenshot-diff",
|
|
178232
|
-
|
|
178261
|
+
import_node_crypto28.default.randomBytes(6).toString("hex")
|
|
178233
178262
|
);
|
|
178234
178263
|
await import_promises26.default.mkdir(dir, { recursive: true });
|
|
178235
178264
|
return dir;
|
|
@@ -178334,7 +178363,7 @@ async function captureIosDeviceLiveInput(params) {
|
|
|
178334
178363
|
return writeLivePng(params.outputDir, params.name, png);
|
|
178335
178364
|
}
|
|
178336
178365
|
async function writeLivePng(outputDir, name, png) {
|
|
178337
|
-
const suffix =
|
|
178366
|
+
const suffix = import_node_crypto28.default.randomBytes(4).toString("hex");
|
|
178338
178367
|
const destination = import_path9.default.join(outputDir, `${name}-${suffix}.live.png`);
|
|
178339
178368
|
await import_promises26.default.mkdir(outputDir, { recursive: true });
|
|
178340
178369
|
await import_promises26.default.writeFile(destination, png);
|
|
@@ -178352,7 +178381,7 @@ async function captureHarmonyLiveInput(params) {
|
|
|
178352
178381
|
}
|
|
178353
178382
|
await ensureDep("hdc");
|
|
178354
178383
|
const captured2 = await captureHarmonyScreenshotPng({ connectKey: params.connectKey, scale: 1 });
|
|
178355
|
-
const suffix =
|
|
178384
|
+
const suffix = import_node_crypto28.default.randomBytes(4).toString("hex");
|
|
178356
178385
|
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
178357
178386
|
try {
|
|
178358
178387
|
await import_promises26.default.mkdir(params.outputDir, { recursive: true });
|
|
@@ -178375,7 +178404,7 @@ async function captureLiveInput(params) {
|
|
|
178375
178404
|
captureScreenshot2,
|
|
178376
178405
|
params.peekFor?.(params.device)
|
|
178377
178406
|
);
|
|
178378
|
-
const suffix =
|
|
178407
|
+
const suffix = import_node_crypto28.default.randomBytes(4).toString("hex");
|
|
178379
178408
|
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
178380
178409
|
await import_promises26.default.mkdir(params.outputDir, { recursive: true });
|
|
178381
178410
|
await import_promises26.default.copyFile(capture.path, destination);
|
|
@@ -178948,7 +178977,7 @@ Returns { value } for one key, { entries, count } for all keys, and { set } / {
|
|
|
178948
178977
|
};
|
|
178949
178978
|
|
|
178950
178979
|
// ../tool-server/src/tools/file-panel/index.ts
|
|
178951
|
-
var
|
|
178980
|
+
var fs94 = __toESM(require("node:fs/promises"));
|
|
178952
178981
|
var os21 = __toESM(require("node:os"));
|
|
178953
178982
|
var path75 = __toESM(require("node:path"));
|
|
178954
178983
|
init_zod();
|
|
@@ -178983,7 +179012,7 @@ function requestedPaths(params, action) {
|
|
|
178983
179012
|
}
|
|
178984
179013
|
async function statOrNull(p) {
|
|
178985
179014
|
try {
|
|
178986
|
-
return await
|
|
179015
|
+
return await fs94.stat(p);
|
|
178987
179016
|
} catch {
|
|
178988
179017
|
return null;
|
|
178989
179018
|
}
|
|
@@ -179023,7 +179052,7 @@ async function sandboxTokens2(app, paths) {
|
|
|
179023
179052
|
if (!tracked?.sandboxed) return {};
|
|
179024
179053
|
const resolved = await Promise.all(
|
|
179025
179054
|
paths.map(
|
|
179026
|
-
(p) =>
|
|
179055
|
+
(p) => fs94.realpath(p).catch(async () => path75.join(await fs94.realpath(path75.dirname(p)), path75.basename(p)))
|
|
179027
179056
|
)
|
|
179028
179057
|
);
|
|
179029
179058
|
const tokens = [];
|
|
@@ -179500,7 +179529,7 @@ function probeArgentToolServer(host, port, timeoutMs = 500) {
|
|
|
179500
179529
|
|
|
179501
179530
|
// ../tool-server/src/utils/preview-window.ts
|
|
179502
179531
|
var import_node_child_process59 = require("node:child_process");
|
|
179503
|
-
var
|
|
179532
|
+
var fs95 = __toESM(require("node:fs"));
|
|
179504
179533
|
var os22 = __toESM(require("node:os"));
|
|
179505
179534
|
var path76 = __toESM(require("node:path"));
|
|
179506
179535
|
function ensureLensAppBundle(electronBin) {
|
|
@@ -179517,18 +179546,18 @@ function ensureLensAppBundle(electronBin) {
|
|
|
179517
179546
|
);
|
|
179518
179547
|
const wrapperExec = path76.join(wrapperContents, "MacOS", "Electron");
|
|
179519
179548
|
try {
|
|
179520
|
-
if (
|
|
179549
|
+
if (fs95.realpathSync(wrapperExec) === fs95.realpathSync(electronBin)) return wrapperExec;
|
|
179521
179550
|
} catch {
|
|
179522
179551
|
}
|
|
179523
|
-
|
|
179524
|
-
|
|
179525
|
-
|
|
179526
|
-
|
|
179527
|
-
|
|
179552
|
+
fs95.rmSync(path76.dirname(wrapperContents), { recursive: true, force: true });
|
|
179553
|
+
fs95.mkdirSync(path76.join(wrapperContents, "MacOS"), { recursive: true });
|
|
179554
|
+
fs95.symlinkSync(path76.join(realContents, "Frameworks"), path76.join(wrapperContents, "Frameworks"));
|
|
179555
|
+
fs95.symlinkSync(path76.join(realContents, "Resources"), path76.join(wrapperContents, "Resources"));
|
|
179556
|
+
fs95.symlinkSync(electronBin, wrapperExec);
|
|
179528
179557
|
const pkgInfo = path76.join(realContents, "PkgInfo");
|
|
179529
|
-
if (
|
|
179558
|
+
if (fs95.existsSync(pkgInfo)) fs95.copyFileSync(pkgInfo, path76.join(wrapperContents, "PkgInfo"));
|
|
179530
179559
|
const plist = path76.join(wrapperContents, "Info.plist");
|
|
179531
|
-
|
|
179560
|
+
fs95.copyFileSync(path76.join(realContents, "Info.plist"), plist);
|
|
179532
179561
|
const setPlist = (entry, value) => {
|
|
179533
179562
|
try {
|
|
179534
179563
|
(0, import_node_child_process59.execFileSync)("/usr/libexec/PlistBuddy", ["-c", `Set :${entry} ${value}`, plist]);
|
|
@@ -179570,7 +179599,7 @@ function createPreviewWindowManager(opts = {}) {
|
|
|
179570
179599
|
const resolveMainScript = () => {
|
|
179571
179600
|
if (opts.mainScript) return opts.mainScript;
|
|
179572
179601
|
const bundled = path76.join(__dirname, "preview-window", "main.cjs");
|
|
179573
|
-
if (
|
|
179602
|
+
if (fs95.existsSync(bundled)) return bundled;
|
|
179574
179603
|
return require.resolve("@argent/preview-window/dist/main.js");
|
|
179575
179604
|
};
|
|
179576
179605
|
const isAlive2 = (c) => c !== null && c.exitCode === null && !c.killed;
|