@swmansion/argent 0.35.1-next.80 → 0.35.1-next.82
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 +665 -626
- 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,14 +101638,47 @@ function createMoqTransport(moq, options) {
|
|
|
101600
101638
|
init_external_devices();
|
|
101601
101639
|
|
|
101602
101640
|
// ../tool-server/src/utils/simulator-watcher.ts
|
|
101603
|
-
var
|
|
101641
|
+
var fs31 = __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 fs30 = __toESM(require("node:fs"));
|
|
101609
101647
|
var os6 = __toESM(require("node:os"));
|
|
101610
|
-
var
|
|
101648
|
+
var path26 = __toESM(require("node:path"));
|
|
101649
|
+
|
|
101650
|
+
// ../tool-server/src/utils/argent-home-id.ts
|
|
101651
|
+
var import_node_crypto10 = require("node:crypto");
|
|
101652
|
+
var fs26 = __toESM(require("node:fs"));
|
|
101653
|
+
var import_node_os6 = require("node:os");
|
|
101654
|
+
var path23 = __toESM(require("node:path"));
|
|
101655
|
+
init_src();
|
|
101656
|
+
var ARGENT_HOME_HEADER = "x-argent-home";
|
|
101657
|
+
function canonicalDir(dir) {
|
|
101658
|
+
const resolved = path23.resolve(dir);
|
|
101659
|
+
const parent = path23.dirname(resolved);
|
|
101660
|
+
if (fs26.existsSync(resolved) || parent === resolved) return canonicalPath(resolved);
|
|
101661
|
+
return path23.join(canonicalDir(parent), path23.basename(resolved));
|
|
101662
|
+
}
|
|
101663
|
+
function argentHomeId(dir = argentHomeDir()) {
|
|
101664
|
+
return (0, import_node_crypto10.createHash)("sha256").update(canonicalDir(dir)).digest("hex").slice(0, 12);
|
|
101665
|
+
}
|
|
101666
|
+
function peerArgentHomeId(header) {
|
|
101667
|
+
if (typeof header === "string" && header) return header;
|
|
101668
|
+
return argentHomeId(path23.join(resolveHomeDir(), ".argent"));
|
|
101669
|
+
}
|
|
101670
|
+
var LOOPBACK_ADDRESSES = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "::ffff:127.0.0.1"]);
|
|
101671
|
+
function isOwnAddress(address) {
|
|
101672
|
+
const ip = address.replace(/^::ffff:(?=\d+\.\d+\.\d+\.\d+$)/, "");
|
|
101673
|
+
return Object.values((0, import_node_os6.networkInterfaces)()).some(
|
|
101674
|
+
(list) => list?.some((a) => (a.family === "IPv4" || a.scopeid === 0) && a.address === ip)
|
|
101675
|
+
);
|
|
101676
|
+
}
|
|
101677
|
+
function isLocalConnection(socket) {
|
|
101678
|
+
const remote = socket.remoteAddress;
|
|
101679
|
+
if (remote === void 0) return false;
|
|
101680
|
+
return LOOPBACK_ADDRESSES.has(remote) || remote === socket.localAddress || isOwnAddress(remote);
|
|
101681
|
+
}
|
|
101611
101682
|
|
|
101612
101683
|
// ../tool-server/src/utils/ndjson-socket.ts
|
|
101613
101684
|
init_src2();
|
|
@@ -101916,17 +101987,17 @@ function asString2(value) {
|
|
|
101916
101987
|
// ../tool-server/src/utils/ios-host.ts
|
|
101917
101988
|
var import_node_child_process18 = require("node:child_process");
|
|
101918
101989
|
var import_node_events = require("node:events");
|
|
101919
|
-
var
|
|
101920
|
-
var
|
|
101990
|
+
var fs29 = __toESM(require("node:fs"));
|
|
101991
|
+
var path25 = __toESM(require("node:path"));
|
|
101921
101992
|
var import_node_util15 = require("node:util");
|
|
101922
101993
|
init_src();
|
|
101923
101994
|
|
|
101924
101995
|
// ../tool-server/src/utils/ios-audio-leftovers.ts
|
|
101925
|
-
var
|
|
101926
|
-
var
|
|
101996
|
+
var fs28 = __toESM(require("node:fs"));
|
|
101997
|
+
var path24 = __toESM(require("node:path"));
|
|
101927
101998
|
|
|
101928
101999
|
// ../tool-server/src/utils/ios-audio-rings.ts
|
|
101929
|
-
var
|
|
102000
|
+
var fs27 = __toESM(require("node:fs"));
|
|
101930
102001
|
init_src2();
|
|
101931
102002
|
var RING_HDR = 128;
|
|
101932
102003
|
var IN_MAGIC = 1229410881;
|
|
@@ -101939,20 +102010,20 @@ var FLOAT_SUBFORMAT = "0300000000001000800000aa00389b71";
|
|
|
101939
102010
|
function putU32(fd, pos, value) {
|
|
101940
102011
|
const b = Buffer.alloc(4);
|
|
101941
102012
|
b.writeUInt32LE(value >>> 0);
|
|
101942
|
-
|
|
102013
|
+
fs27.writeSync(fd, b, 0, 4, pos);
|
|
101943
102014
|
}
|
|
101944
102015
|
function createRing(ringPath, header, dataBytes) {
|
|
101945
|
-
const fd =
|
|
102016
|
+
const fd = fs27.openSync(ringPath, "w+", 384);
|
|
101946
102017
|
const hdr = Buffer.alloc(RING_HDR);
|
|
101947
102018
|
header.forEach((v, i) => hdr.writeUInt32LE(v >>> 0, i * 4));
|
|
101948
|
-
|
|
101949
|
-
|
|
102019
|
+
fs27.writeSync(fd, hdr, 0, RING_HDR, 0);
|
|
102020
|
+
fs27.writeSync(fd, Buffer.alloc(dataBytes), 0, dataBytes, RING_HDR);
|
|
101950
102021
|
return fd;
|
|
101951
102022
|
}
|
|
101952
102023
|
function readClipInfo(fd) {
|
|
101953
102024
|
const head = Buffer.alloc(16384);
|
|
101954
|
-
const read =
|
|
101955
|
-
const size =
|
|
102025
|
+
const read = fs27.readSync(fd, head, 0, head.length, 0);
|
|
102026
|
+
const size = fs27.fstatSync(fd).size;
|
|
101956
102027
|
const bad = (why) => new FailureError(`The converted clip is not mono float32 WAV (${why}).`, {
|
|
101957
102028
|
error_code: FAILURE_CODES.AUDIO_CLIP_CONVERSION_FAILED,
|
|
101958
102029
|
failure_stage: "audio_clip_conversion",
|
|
@@ -101981,7 +102052,7 @@ function readClipInfo(fd) {
|
|
|
101981
102052
|
throw bad("no data chunk");
|
|
101982
102053
|
}
|
|
101983
102054
|
function closeSource(source) {
|
|
101984
|
-
if (source.kind === "clip")
|
|
102055
|
+
if (source.kind === "clip") fs27.closeSync(source.fd);
|
|
101985
102056
|
}
|
|
101986
102057
|
var InputFeeder = class {
|
|
101987
102058
|
constructor(ringPath, source) {
|
|
@@ -102033,7 +102104,7 @@ var InputFeeder = class {
|
|
|
102033
102104
|
this.running = false;
|
|
102034
102105
|
if (this.timer) clearInterval(this.timer);
|
|
102035
102106
|
closeSource(this.source);
|
|
102036
|
-
|
|
102107
|
+
fs27.closeSync(this.fd);
|
|
102037
102108
|
}
|
|
102038
102109
|
step() {
|
|
102039
102110
|
const { readFrame, requestGen } = this.readGuest();
|
|
@@ -102053,13 +102124,13 @@ var InputFeeder = class {
|
|
|
102053
102124
|
this.produce(n);
|
|
102054
102125
|
const start2 = this.writeFrame & RING_CAP - 1;
|
|
102055
102126
|
const first = Math.min(n, RING_CAP - start2);
|
|
102056
|
-
|
|
102057
|
-
if (n > first)
|
|
102127
|
+
fs27.writeSync(this.fd, this.bytes, 0, first * 4, RING_HDR + start2 * 4);
|
|
102128
|
+
if (n > first) fs27.writeSync(this.fd, this.bytes, first * 4, (n - first) * 4, RING_HDR);
|
|
102058
102129
|
this.writeFrame = this.writeFrame + n >>> 0;
|
|
102059
102130
|
putU32(this.fd, 16, this.writeFrame);
|
|
102060
102131
|
}
|
|
102061
102132
|
readGuest() {
|
|
102062
|
-
|
|
102133
|
+
fs27.readSync(this.fd, this.guest, 0, 12, 64);
|
|
102063
102134
|
return { readFrame: this.guest.readUInt32LE(0), requestGen: this.guest.readUInt32LE(4) };
|
|
102064
102135
|
}
|
|
102065
102136
|
/** The source starts again from its beginning, with its full play count, at the next frame written. */
|
|
@@ -102094,7 +102165,7 @@ var InputFeeder = class {
|
|
|
102094
102165
|
this.clipPos = 0;
|
|
102095
102166
|
}
|
|
102096
102167
|
const take2 = Math.min(s.info.frames - this.clipPos, n - off);
|
|
102097
|
-
const got =
|
|
102168
|
+
const got = fs27.readSync(
|
|
102098
102169
|
s.fd,
|
|
102099
102170
|
this.bytes,
|
|
102100
102171
|
off * 4,
|
|
@@ -102114,13 +102185,13 @@ var InputFeeder = class {
|
|
|
102114
102185
|
};
|
|
102115
102186
|
function readInCursors(ringPath) {
|
|
102116
102187
|
try {
|
|
102117
|
-
const fd =
|
|
102188
|
+
const fd = fs27.openSync(ringPath, "r");
|
|
102118
102189
|
try {
|
|
102119
102190
|
const b = Buffer.alloc(RING_HDR);
|
|
102120
|
-
if (
|
|
102191
|
+
if (fs27.readSync(fd, b, 0, RING_HDR, 0) < 68 || b.readUInt32LE(0) !== IN_MAGIC) return null;
|
|
102121
102192
|
return { write: b.readUInt32LE(16), read: b.readUInt32LE(64) };
|
|
102122
102193
|
} finally {
|
|
102123
|
-
|
|
102194
|
+
fs27.closeSync(fd);
|
|
102124
102195
|
}
|
|
102125
102196
|
} catch {
|
|
102126
102197
|
return null;
|
|
@@ -102153,27 +102224,27 @@ async function abandoned(text) {
|
|
|
102153
102224
|
const owner = Number(field(text, "host"));
|
|
102154
102225
|
if (owner > 0) return !processAlive(owner);
|
|
102155
102226
|
const ring = field(text, "ring");
|
|
102156
|
-
if (!ring || !
|
|
102227
|
+
if (!ring || !fs28.existsSync(ring)) return true;
|
|
102157
102228
|
return feederGone(ring);
|
|
102158
102229
|
}
|
|
102159
102230
|
async function clearAudioLeftovers(dir) {
|
|
102160
102231
|
let names;
|
|
102161
102232
|
try {
|
|
102162
|
-
names =
|
|
102233
|
+
names = fs28.readdirSync(dir);
|
|
102163
102234
|
} catch {
|
|
102164
102235
|
return;
|
|
102165
102236
|
}
|
|
102166
102237
|
let liveUnmarkedInput = false;
|
|
102167
102238
|
const read = (file2) => {
|
|
102168
102239
|
try {
|
|
102169
|
-
return
|
|
102240
|
+
return fs28.readFileSync(file2, "utf8");
|
|
102170
102241
|
} catch {
|
|
102171
102242
|
return null;
|
|
102172
102243
|
}
|
|
102173
102244
|
};
|
|
102174
102245
|
for (const name of names) {
|
|
102175
102246
|
if (name !== "input") continue;
|
|
102176
|
-
const file2 =
|
|
102247
|
+
const file2 = path24.join(dir, name);
|
|
102177
102248
|
const text = read(file2);
|
|
102178
102249
|
if (text === null) continue;
|
|
102179
102250
|
if (!await abandoned(text)) {
|
|
@@ -102181,25 +102252,25 @@ async function clearAudioLeftovers(dir) {
|
|
|
102181
102252
|
continue;
|
|
102182
102253
|
}
|
|
102183
102254
|
if (read(file2) !== text) continue;
|
|
102184
|
-
|
|
102255
|
+
fs28.rmSync(file2, { force: true });
|
|
102185
102256
|
const ring = field(text, "ring");
|
|
102186
|
-
if (ring &&
|
|
102187
|
-
|
|
102257
|
+
if (ring && path24.dirname(ring) === dir && /^in-/.test(path24.basename(ring))) {
|
|
102258
|
+
fs28.rmSync(ring, { force: true });
|
|
102188
102259
|
}
|
|
102189
102260
|
}
|
|
102190
102261
|
for (const name of names) {
|
|
102191
102262
|
if (!name.startsWith("st.")) continue;
|
|
102192
|
-
const file2 =
|
|
102263
|
+
const file2 = path24.join(dir, name);
|
|
102193
102264
|
const text = read(file2);
|
|
102194
102265
|
if (text === null) continue;
|
|
102195
102266
|
const pid = Number(field(text, "pid"));
|
|
102196
|
-
if (pid > 0 && !processAlive(pid) && read(file2) === text)
|
|
102267
|
+
if (pid > 0 && !processAlive(pid) && read(file2) === text) fs28.rmSync(file2, { force: true });
|
|
102197
102268
|
}
|
|
102198
102269
|
for (const name of names) {
|
|
102199
102270
|
const owner = /^(?:in|clip)-(\d+)-/.exec(name);
|
|
102200
102271
|
const unmarked = !owner && /^(?:in|clip)-/.test(name) && !liveUnmarkedInput;
|
|
102201
102272
|
if (owner && !processAlive(Number(owner[1])) || unmarked) {
|
|
102202
|
-
|
|
102273
|
+
fs28.rmSync(path24.join(dir, name), { force: true });
|
|
102203
102274
|
}
|
|
102204
102275
|
}
|
|
102205
102276
|
}
|
|
@@ -102231,13 +102302,13 @@ function shouldPreserveDyldInsertLibrariesEntry(entry, bootstrapPath) {
|
|
|
102231
102302
|
if (entry === bootstrapPath) {
|
|
102232
102303
|
return false;
|
|
102233
102304
|
}
|
|
102234
|
-
if (ARGENT_BOOTSTRAP_DYLIB_BASENAMES.has(
|
|
102305
|
+
if (ARGENT_BOOTSTRAP_DYLIB_BASENAMES.has(path25.basename(entry))) {
|
|
102235
102306
|
return false;
|
|
102236
102307
|
}
|
|
102237
102308
|
if (entry.startsWith("@")) {
|
|
102238
102309
|
return true;
|
|
102239
102310
|
}
|
|
102240
|
-
return
|
|
102311
|
+
return fs29.existsSync(entry);
|
|
102241
102312
|
}
|
|
102242
102313
|
function audioDir(udid) {
|
|
102243
102314
|
return `/tmp/argent-audio-${udid}`;
|
|
@@ -102264,14 +102335,14 @@ function buildDyldInsertLibraries(currentValue, bootstrapPath) {
|
|
|
102264
102335
|
}
|
|
102265
102336
|
function withdrawDyldInsertLibraries(currentValue, bootstrapPath) {
|
|
102266
102337
|
const preserved = preservedDyldInsertLibraries(currentValue, bootstrapPath).filter(
|
|
102267
|
-
(entry) =>
|
|
102338
|
+
(entry) => path25.basename(entry) !== AUDIO_DYLIB_BASENAME
|
|
102268
102339
|
);
|
|
102269
102340
|
return preserved.length === 0 ? null : preserved.join(":");
|
|
102270
102341
|
}
|
|
102271
102342
|
function appendDyldInsertLibrary(currentValue, dylibPath) {
|
|
102272
|
-
const name =
|
|
102343
|
+
const name = path25.basename(dylibPath);
|
|
102273
102344
|
const kept = splitDyldInsertLibraries(currentValue).filter(
|
|
102274
|
-
(entry) => entry !== dylibPath &&
|
|
102345
|
+
(entry) => entry !== dylibPath && path25.basename(entry) !== name
|
|
102275
102346
|
);
|
|
102276
102347
|
return [...kept, dylibPath].join(":");
|
|
102277
102348
|
}
|
|
@@ -102353,7 +102424,7 @@ function setEndpointEnv(endpoint, launchctl) {
|
|
|
102353
102424
|
}
|
|
102354
102425
|
async function setAudioDirEnv(nativeId, launchctl) {
|
|
102355
102426
|
try {
|
|
102356
|
-
|
|
102427
|
+
fs29.mkdirSync(audioDir(nativeId), { recursive: true, mode: 448 });
|
|
102357
102428
|
await launchctl(["setenv", "ARGENT_AUDIO_DIR", audioDir(nativeId)]);
|
|
102358
102429
|
} catch (err) {
|
|
102359
102430
|
process.stderr.write(`[ios-host] audio setup failed for ${nativeId}: ${String(err)}
|
|
@@ -102606,10 +102677,10 @@ async function enableAppAccessibilityBeforeLaunch(device) {
|
|
|
102606
102677
|
}
|
|
102607
102678
|
|
|
102608
102679
|
// ../tool-server/src/blueprints/ios-network-records.ts
|
|
102609
|
-
var
|
|
102680
|
+
var import_node_crypto11 = require("node:crypto");
|
|
102610
102681
|
var import_node_http2 = require("node:http");
|
|
102611
102682
|
init_src2();
|
|
102612
|
-
var RUN_TAG = (0,
|
|
102683
|
+
var RUN_TAG = (0, import_node_crypto11.randomBytes)(2).toString("hex");
|
|
102613
102684
|
var IOS_NATIVE_REQUEST_ID = /^ios-[0-9a-f]{4}-\d+$/;
|
|
102614
102685
|
var MACOS_NATIVE_REQUEST_ID = /^macos-[0-9a-f]{4}-\d+$/;
|
|
102615
102686
|
var nextRecordNumber = 1;
|
|
@@ -103186,7 +103257,11 @@ function handshakeCount(value) {
|
|
|
103186
103257
|
return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : void 0;
|
|
103187
103258
|
}
|
|
103188
103259
|
function getNativeDevtoolsSocketPath(udid) {
|
|
103189
|
-
return `/tmp/argent-nd-${udid.slice(0, 8)}.sock`;
|
|
103260
|
+
return `/tmp/argent-nd-${udid.slice(0, 8)}-${argentHomeId()}.sock`;
|
|
103261
|
+
}
|
|
103262
|
+
function nativeDevtoolsLaunchEnv(api) {
|
|
103263
|
+
if (!api) return process.env;
|
|
103264
|
+
return { ...process.env, SIMCTL_CHILD_NATIVE_DEVTOOLS_IOS_CDP_SOCKET: api.socketPath };
|
|
103190
103265
|
}
|
|
103191
103266
|
function bindNativeDevtoolsUnixSocket(server, socketPath) {
|
|
103192
103267
|
return new Promise((resolve24, reject) => {
|
|
@@ -103199,7 +103274,7 @@ function bindNativeDevtoolsUnixSocket(server, socketPath) {
|
|
|
103199
103274
|
if ((err.code === "EADDRINUSE" || err.code === "EEXIST") && !retried) {
|
|
103200
103275
|
retried = true;
|
|
103201
103276
|
try {
|
|
103202
|
-
|
|
103277
|
+
fs30.unlinkSync(socketPath);
|
|
103203
103278
|
} catch {
|
|
103204
103279
|
}
|
|
103205
103280
|
server.listen(socketPath);
|
|
@@ -103520,7 +103595,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
103520
103595
|
providerCapture.set(bundleId, await readCaptureEnabled(bundleId));
|
|
103521
103596
|
};
|
|
103522
103597
|
const keepsCapture = (bundleId) => lentSocketPath ? providerCapture.get(bundleId) === true : activatedBundleIds.has(bundleId);
|
|
103523
|
-
const ownedThrottlePath = (bundleId) =>
|
|
103598
|
+
const ownedThrottlePath = (bundleId) => path26.join(
|
|
103524
103599
|
os6.tmpdir(),
|
|
103525
103600
|
`argent-throttle-${encodeURIComponent(deviceKeyOf(udid))}-${encodeURIComponent(bundleId)}`
|
|
103526
103601
|
);
|
|
@@ -103533,9 +103608,9 @@ var nativeDevtoolsBlueprint = {
|
|
|
103533
103608
|
Math.trunc(amount("uploadThroughput"))
|
|
103534
103609
|
]);
|
|
103535
103610
|
};
|
|
103536
|
-
const readOwnedKeys = (bundleId) =>
|
|
103611
|
+
const readOwnedKeys = (bundleId) => fs30.existsSync(ownedThrottlePath(bundleId)) ? fs30.readFileSync(ownedThrottlePath(bundleId), "utf8").split("\n") : [];
|
|
103537
103612
|
const recordOwnedKeys = (bundleId, keys) => {
|
|
103538
|
-
if (lentSocketPath)
|
|
103613
|
+
if (lentSocketPath) fs30.writeFileSync(ownedThrottlePath(bundleId), keys.join("\n"));
|
|
103539
103614
|
};
|
|
103540
103615
|
const applyThrottle = async (bundleId, throttle) => {
|
|
103541
103616
|
await noteProviderCapture(bundleId);
|
|
@@ -103551,11 +103626,11 @@ var nativeDevtoolsBlueprint = {
|
|
|
103551
103626
|
await sendCdpRpc(bundleId, "NativeDevtoolsIos.configure", { bypassPorts: [] });
|
|
103552
103627
|
await sendCdpRpc(bundleId, keepsCapture(bundleId) ? "Network.enable" : "Network.disable");
|
|
103553
103628
|
providerCapture.delete(bundleId);
|
|
103554
|
-
|
|
103629
|
+
fs30.rmSync(ownedThrottlePath(bundleId), { force: true });
|
|
103555
103630
|
};
|
|
103556
103631
|
const isEmulating = (state3) => state3?.offline === true || ["latency", "downloadThroughput", "uploadThroughput"].some((key2) => Number(state3?.[key2]) > 0);
|
|
103557
103632
|
const clearLeftoverThrottle = async (bundleId) => {
|
|
103558
|
-
if (!lentSocketPath || !
|
|
103633
|
+
if (!lentSocketPath || !fs30.existsSync(ownedThrottlePath(bundleId))) return;
|
|
103559
103634
|
const method = "NativeDevtoolsIos.getConditions";
|
|
103560
103635
|
const state3 = await sendCdpRpc(bundleId, method).catch((err) => {
|
|
103561
103636
|
if (err instanceof Error && err.message.endsWith(`Unsupported method: ${method}`))
|
|
@@ -103563,7 +103638,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
103563
103638
|
throw err;
|
|
103564
103639
|
});
|
|
103565
103640
|
if (!isEmulating(state3) || !readOwnedKeys(bundleId).includes(conditionsKey(state3))) {
|
|
103566
|
-
|
|
103641
|
+
fs30.rmSync(ownedThrottlePath(bundleId), { force: true });
|
|
103567
103642
|
return;
|
|
103568
103643
|
}
|
|
103569
103644
|
providerCapture.set(bundleId, true);
|
|
@@ -103647,7 +103722,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
103647
103722
|
};
|
|
103648
103723
|
if (transport === "unix" && !lentSocketPath) {
|
|
103649
103724
|
try {
|
|
103650
|
-
|
|
103725
|
+
fs30.unlinkSync(socketPath);
|
|
103651
103726
|
} catch {
|
|
103652
103727
|
}
|
|
103653
103728
|
}
|
|
@@ -104114,7 +104189,7 @@ var nativeDevtoolsBlueprint = {
|
|
|
104114
104189
|
server?.close();
|
|
104115
104190
|
if (transport === "unix" && !lentSocketPath) {
|
|
104116
104191
|
try {
|
|
104117
|
-
|
|
104192
|
+
fs30.unlinkSync(socketPath);
|
|
104118
104193
|
} catch {
|
|
104119
104194
|
}
|
|
104120
104195
|
}
|
|
@@ -104277,7 +104352,7 @@ async function getBootedUdidsInSet(deviceSet, signal) {
|
|
|
104277
104352
|
async function getBootedUdids(signal) {
|
|
104278
104353
|
const sets = [
|
|
104279
104354
|
null,
|
|
104280
|
-
...configuredAdditionalDeviceSets().filter((p) =>
|
|
104355
|
+
...configuredAdditionalDeviceSets().filter((p) => fs31.existsSync(p))
|
|
104281
104356
|
];
|
|
104282
104357
|
const perSet = await Promise.allSettled(sets.map((set2) => getBootedUdidsInSet(set2, signal)));
|
|
104283
104358
|
const failures = perSet.flatMap((r) => r.status === "rejected" ? [r.reason] : []);
|
|
@@ -105165,10 +105240,10 @@ init_adb();
|
|
|
105165
105240
|
// ../tool-server/src/utils/ios-device/devicectl.ts
|
|
105166
105241
|
var import_node_child_process22 = require("node:child_process");
|
|
105167
105242
|
var import_node_util17 = require("node:util");
|
|
105168
|
-
var
|
|
105243
|
+
var fs32 = __toESM(require("node:fs/promises"));
|
|
105169
105244
|
var os7 = __toESM(require("node:os"));
|
|
105170
|
-
var
|
|
105171
|
-
var
|
|
105245
|
+
var path27 = __toESM(require("node:path"));
|
|
105246
|
+
var import_node_crypto12 = require("node:crypto");
|
|
105172
105247
|
var import_node_net = require("node:net");
|
|
105173
105248
|
init_src2();
|
|
105174
105249
|
var execFileAsync16 = (0, import_node_util17.promisify)(import_node_child_process22.execFile);
|
|
@@ -105217,7 +105292,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105217
105292
|
let jsonPath = null;
|
|
105218
105293
|
const argv = ["devicectl", ...args];
|
|
105219
105294
|
if (opts.json) {
|
|
105220
|
-
jsonPath =
|
|
105295
|
+
jsonPath = path27.join(os7.tmpdir(), `argent-devicectl-${process.pid}-${(0, import_node_crypto12.randomUUID)()}.json`);
|
|
105221
105296
|
argv.push("--json-output", jsonPath);
|
|
105222
105297
|
}
|
|
105223
105298
|
try {
|
|
@@ -105229,7 +105304,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105229
105304
|
let json2 = null;
|
|
105230
105305
|
if (jsonPath) {
|
|
105231
105306
|
try {
|
|
105232
|
-
json2 = JSON.parse(await
|
|
105307
|
+
json2 = JSON.parse(await fs32.readFile(jsonPath, "utf8"));
|
|
105233
105308
|
} catch {
|
|
105234
105309
|
json2 = null;
|
|
105235
105310
|
}
|
|
@@ -105241,7 +105316,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105241
105316
|
let errorJson = null;
|
|
105242
105317
|
if (jsonPath) {
|
|
105243
105318
|
try {
|
|
105244
|
-
errorJson = JSON.parse(await
|
|
105319
|
+
errorJson = JSON.parse(await fs32.readFile(jsonPath, "utf8"));
|
|
105245
105320
|
} catch {
|
|
105246
105321
|
errorJson = null;
|
|
105247
105322
|
}
|
|
@@ -105260,7 +105335,7 @@ async function runDevicectl(args, action, opts = {}) {
|
|
|
105260
105335
|
}
|
|
105261
105336
|
);
|
|
105262
105337
|
} finally {
|
|
105263
|
-
if (jsonPath) await
|
|
105338
|
+
if (jsonPath) await fs32.rm(jsonPath, { force: true }).catch(() => {
|
|
105264
105339
|
});
|
|
105265
105340
|
}
|
|
105266
105341
|
}
|
|
@@ -105500,8 +105575,8 @@ init_harmony_flag();
|
|
|
105500
105575
|
|
|
105501
105576
|
// ../tool-server/src/utils/macos-apps.ts
|
|
105502
105577
|
var import_node_child_process23 = require("node:child_process");
|
|
105503
|
-
var
|
|
105504
|
-
var
|
|
105578
|
+
var import_node_crypto13 = require("node:crypto");
|
|
105579
|
+
var fs33 = __toESM(require("node:fs"));
|
|
105505
105580
|
var os8 = __toESM(require("node:os"));
|
|
105506
105581
|
var path28 = __toESM(require("node:path"));
|
|
105507
105582
|
var import_node_util18 = require("node:util");
|
|
@@ -105511,41 +105586,6 @@ init_capability();
|
|
|
105511
105586
|
init_device_info();
|
|
105512
105587
|
init_macos_app_kind();
|
|
105513
105588
|
init_src();
|
|
105514
|
-
|
|
105515
|
-
// ../tool-server/src/utils/argent-home-id.ts
|
|
105516
|
-
var import_node_crypto11 = require("node:crypto");
|
|
105517
|
-
var fs31 = __toESM(require("node:fs"));
|
|
105518
|
-
var import_node_os6 = require("node:os");
|
|
105519
|
-
var path27 = __toESM(require("node:path"));
|
|
105520
|
-
init_src();
|
|
105521
|
-
var ARGENT_HOME_HEADER = "x-argent-home";
|
|
105522
|
-
function canonicalDir(dir) {
|
|
105523
|
-
const resolved = path27.resolve(dir);
|
|
105524
|
-
const parent = path27.dirname(resolved);
|
|
105525
|
-
if (fs31.existsSync(resolved) || parent === resolved) return canonicalPath(resolved);
|
|
105526
|
-
return path27.join(canonicalDir(parent), path27.basename(resolved));
|
|
105527
|
-
}
|
|
105528
|
-
function argentHomeId(dir = argentHomeDir()) {
|
|
105529
|
-
return (0, import_node_crypto11.createHash)("sha256").update(canonicalDir(dir)).digest("hex").slice(0, 12);
|
|
105530
|
-
}
|
|
105531
|
-
function peerArgentHomeId(header) {
|
|
105532
|
-
if (typeof header === "string" && header) return header;
|
|
105533
|
-
return argentHomeId(path27.join(resolveHomeDir(), ".argent"));
|
|
105534
|
-
}
|
|
105535
|
-
var LOOPBACK_ADDRESSES = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "::ffff:127.0.0.1"]);
|
|
105536
|
-
function isOwnAddress(address) {
|
|
105537
|
-
const ip = address.replace(/^::ffff:(?=\d+\.\d+\.\d+\.\d+$)/, "");
|
|
105538
|
-
return Object.values((0, import_node_os6.networkInterfaces)()).some(
|
|
105539
|
-
(list) => list?.some((a) => (a.family === "IPv4" || a.scopeid === 0) && a.address === ip)
|
|
105540
|
-
);
|
|
105541
|
-
}
|
|
105542
|
-
function isLocalConnection(socket) {
|
|
105543
|
-
const remote = socket.remoteAddress;
|
|
105544
|
-
if (remote === void 0) return false;
|
|
105545
|
-
return LOOPBACK_ADDRESSES.has(remote) || remote === socket.localAddress || isOwnAddress(remote);
|
|
105546
|
-
}
|
|
105547
|
-
|
|
105548
|
-
// ../tool-server/src/utils/macos-apps.ts
|
|
105549
105589
|
var execFileAsync17 = (0, import_node_util18.promisify)(import_node_child_process23.execFile);
|
|
105550
105590
|
function isMacosAppsEnabled() {
|
|
105551
105591
|
return isFeatureEnabled(MACOS_APPS_FLAG);
|
|
@@ -105599,13 +105639,13 @@ function macosSocketDir() {
|
|
|
105599
105639
|
var BOOTSTRAP_NAME = "libArgentInjectionBootstrap.dylib";
|
|
105600
105640
|
var LIBRARY_NAME = "libNativeDevtoolsMacos.dylib";
|
|
105601
105641
|
function stageMacosLibraries(bootstrapPath, libraryPath, teamId) {
|
|
105602
|
-
const bootstrap =
|
|
105603
|
-
const library =
|
|
105642
|
+
const bootstrap = fs33.readFileSync(bootstrapPath);
|
|
105643
|
+
const library = fs33.readFileSync(libraryPath);
|
|
105604
105644
|
const hash2 = libraryHash(bootstrap, library);
|
|
105605
105645
|
const name = teamId ? `${hash2}-${teamId}` : hash2;
|
|
105606
105646
|
const libRoot = macosLibraryRoot();
|
|
105607
105647
|
const targets = STAGED_NAME_SUFFIXES.map((suffix) => path28.join(libRoot, name + suffix));
|
|
105608
|
-
|
|
105648
|
+
fs33.mkdirSync(libRoot, { recursive: true, mode: 448 });
|
|
105609
105649
|
void removeUnusedLibraries(libRoot, hash2);
|
|
105610
105650
|
void removeUnusedLibraries(path28.join(argentHomeDir(), "macos", "lib"), void 0, hash2);
|
|
105611
105651
|
const source = JSON.stringify([path28.resolve(bootstrapPath), path28.resolve(libraryPath)]);
|
|
@@ -105615,28 +105655,28 @@ function stageMacosLibraries(bootstrapPath, libraryPath, teamId) {
|
|
|
105615
105655
|
};
|
|
105616
105656
|
const complete = targets.find(isCompleteCopy);
|
|
105617
105657
|
if (complete) return reuse2(complete);
|
|
105618
|
-
const temp =
|
|
105658
|
+
const temp = fs33.mkdtempSync(path28.join(libRoot, `.tmp-${name}-`));
|
|
105619
105659
|
try {
|
|
105620
|
-
|
|
105621
|
-
|
|
105622
|
-
|
|
105660
|
+
fs33.writeFileSync(path28.join(temp, BOOTSTRAP_NAME), bootstrap, { mode: 493 });
|
|
105661
|
+
fs33.writeFileSync(path28.join(temp, LIBRARY_NAME), library, { mode: 493 });
|
|
105662
|
+
fs33.writeFileSync(path28.join(temp, SOURCES_NAME), `${source}
|
|
105623
105663
|
`, { mode: 384 });
|
|
105624
105664
|
for (const target of targets) {
|
|
105625
105665
|
if (tryRename(temp, target)) return path28.join(target, BOOTSTRAP_NAME);
|
|
105626
105666
|
if (isCompleteCopy(target)) return reuse2(target);
|
|
105627
105667
|
}
|
|
105628
105668
|
} finally {
|
|
105629
|
-
|
|
105669
|
+
fs33.rmSync(temp, { recursive: true, force: true });
|
|
105630
105670
|
}
|
|
105631
105671
|
throw new Error(`${targets.join(", ")} hold incomplete copies of the library`);
|
|
105632
105672
|
}
|
|
105633
105673
|
var STAGED_NAME_SUFFIXES = ["", ".2", ".3"];
|
|
105634
105674
|
function isCompleteCopy(dir) {
|
|
105635
|
-
return
|
|
105675
|
+
return fs33.existsSync(path28.join(dir, BOOTSTRAP_NAME)) && fs33.existsSync(path28.join(dir, LIBRARY_NAME));
|
|
105636
105676
|
}
|
|
105637
105677
|
function tryRename(from2, to) {
|
|
105638
105678
|
try {
|
|
105639
|
-
|
|
105679
|
+
fs33.renameSync(from2, to);
|
|
105640
105680
|
return true;
|
|
105641
105681
|
} catch {
|
|
105642
105682
|
return false;
|
|
@@ -105644,13 +105684,13 @@ function tryRename(from2, to) {
|
|
|
105644
105684
|
}
|
|
105645
105685
|
var SOURCES_NAME = "sources";
|
|
105646
105686
|
function libraryHash(bootstrap, library) {
|
|
105647
|
-
return (0,
|
|
105687
|
+
return (0, import_node_crypto13.createHash)("sha256").update(`${bootstrap.length}:`).update(bootstrap).update(`${library.length}:`).update(library).digest("hex").slice(0, 16);
|
|
105648
105688
|
}
|
|
105649
105689
|
function recordLibrarySource(dir, source) {
|
|
105650
105690
|
const file2 = path28.join(dir, SOURCES_NAME);
|
|
105651
105691
|
try {
|
|
105652
|
-
const known =
|
|
105653
|
-
if (!known.includes(source))
|
|
105692
|
+
const known = fs33.existsSync(file2) ? fs33.readFileSync(file2, "utf8").split("\n") : [];
|
|
105693
|
+
if (!known.includes(source)) fs33.appendFileSync(file2, `${source}
|
|
105654
105694
|
`, { mode: 384 });
|
|
105655
105695
|
} catch {
|
|
105656
105696
|
}
|
|
@@ -105664,7 +105704,7 @@ function inPrivacyProtectedFolder(file2) {
|
|
|
105664
105704
|
async function librarySourceInstalled(dir, name) {
|
|
105665
105705
|
let lines;
|
|
105666
105706
|
try {
|
|
105667
|
-
lines = (await
|
|
105707
|
+
lines = (await fs33.promises.readFile(path28.join(dir, SOURCES_NAME), "utf8")).split("\n");
|
|
105668
105708
|
} catch {
|
|
105669
105709
|
return false;
|
|
105670
105710
|
}
|
|
@@ -105679,7 +105719,7 @@ async function librarySourceInstalled(dir, name) {
|
|
|
105679
105719
|
if (files.some((file2) => inPrivacyProtectedFolder(String(file2)))) return true;
|
|
105680
105720
|
try {
|
|
105681
105721
|
const [bootstrap, library] = await Promise.all(
|
|
105682
|
-
files.map((file2) =>
|
|
105722
|
+
files.map((file2) => fs33.promises.readFile(String(file2)))
|
|
105683
105723
|
);
|
|
105684
105724
|
if (name.startsWith(libraryHash(bootstrap, library))) return true;
|
|
105685
105725
|
} catch (err) {
|
|
@@ -105690,7 +105730,7 @@ async function librarySourceInstalled(dir, name) {
|
|
|
105690
105730
|
}
|
|
105691
105731
|
async function removeUnusedLibraries(libRoot, keep, superseded) {
|
|
105692
105732
|
try {
|
|
105693
|
-
const root =
|
|
105733
|
+
const root = fs33.realpathSync(libRoot);
|
|
105694
105734
|
let open5;
|
|
105695
105735
|
try {
|
|
105696
105736
|
({ stdout: open5 } = await execFileAsync17("lsof", ["-Fn", "+D", root], {
|
|
@@ -105705,7 +105745,7 @@ async function removeUnusedLibraries(libRoot, keep, superseded) {
|
|
|
105705
105745
|
const used = new Set(
|
|
105706
105746
|
open5.split("\n").filter((line) => line.startsWith(`n${root}/`)).map((line) => line.slice(root.length + 2).split("/")[0])
|
|
105707
105747
|
);
|
|
105708
|
-
for (const name of
|
|
105748
|
+
for (const name of fs33.readdirSync(root)) {
|
|
105709
105749
|
const dir = path28.join(root, name);
|
|
105710
105750
|
const current = keep !== void 0 && name.startsWith(keep);
|
|
105711
105751
|
if (used.has(name) || current && isCompleteCopy(dir)) continue;
|
|
@@ -105715,14 +105755,14 @@ async function removeUnusedLibraries(libRoot, keep, superseded) {
|
|
|
105715
105755
|
if (!current && !temporary && !restaged && await librarySourceInstalled(dir, name)) {
|
|
105716
105756
|
continue;
|
|
105717
105757
|
}
|
|
105718
|
-
|
|
105758
|
+
fs33.rmSync(dir, { recursive: true, force: true });
|
|
105719
105759
|
}
|
|
105720
105760
|
} catch {
|
|
105721
105761
|
}
|
|
105722
105762
|
}
|
|
105723
105763
|
var STAGING_TEMP_MAX_AGE_MS = 10 * 6e4;
|
|
105724
105764
|
function isRecent(dir) {
|
|
105725
|
-
return Date.now() -
|
|
105765
|
+
return Date.now() - fs33.lstatSync(dir).mtimeMs < STAGING_TEMP_MAX_AGE_MS;
|
|
105726
105766
|
}
|
|
105727
105767
|
var EXPORTED_RELEASE_NOTE = "An exported or notarized Release build with the hardened runtime cannot be driven without extra entitlements.";
|
|
105728
105768
|
async function signatureTeam(file2) {
|
|
@@ -105778,14 +105818,14 @@ function macosListenSocket(bundleId, sandboxed) {
|
|
|
105778
105818
|
if (!dir) return null;
|
|
105779
105819
|
const named = path28.join(dir, `${bundleId}.sock`);
|
|
105780
105820
|
if (fitsSocketPath(named)) return { env: named, path: named };
|
|
105781
|
-
const hash2 = (0,
|
|
105821
|
+
const hash2 = (0, import_node_crypto13.createHash)("sha256").update(bundleId).digest("hex").slice(0, 16);
|
|
105782
105822
|
const hashed = path28.join(dir, `${hash2}.sock`);
|
|
105783
105823
|
return fitsSocketPath(hashed) ? { env: hashed, path: hashed } : null;
|
|
105784
105824
|
}
|
|
105785
105825
|
function prepareSocketDir(socketPath) {
|
|
105786
105826
|
const dir = path28.dirname(socketPath);
|
|
105787
|
-
|
|
105788
|
-
const stat11 =
|
|
105827
|
+
fs33.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
105828
|
+
const stat11 = fs33.lstatSync(dir);
|
|
105789
105829
|
if (!stat11.isDirectory() || stat11.uid !== process.getuid?.() || (stat11.mode & 63) !== 0) {
|
|
105790
105830
|
throw macosFailure(
|
|
105791
105831
|
`${dir} belongs to another user or others can open it, so argent cannot keep the app's socket private there.`,
|
|
@@ -105812,7 +105852,7 @@ function isTrackedMacosApp(value) {
|
|
|
105812
105852
|
function readTrackedApps() {
|
|
105813
105853
|
let raw;
|
|
105814
105854
|
try {
|
|
105815
|
-
raw = JSON.parse(
|
|
105855
|
+
raw = JSON.parse(fs33.readFileSync(trackedMacosAppsFile(), "utf8"));
|
|
105816
105856
|
} catch {
|
|
105817
105857
|
return [];
|
|
105818
105858
|
}
|
|
@@ -105821,10 +105861,8 @@ function readTrackedApps() {
|
|
|
105821
105861
|
function recordTrackedMacosApp(app) {
|
|
105822
105862
|
const file2 = trackedMacosAppsFile();
|
|
105823
105863
|
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);
|
|
105864
|
+
fs33.mkdirSync(path28.dirname(file2), { recursive: true });
|
|
105865
|
+
writeFileAtomicSync(file2, JSON.stringify([...others, app], null, 2) + "\n");
|
|
105828
105866
|
}
|
|
105829
105867
|
function getTrackedMacosApp(bundleId) {
|
|
105830
105868
|
return readTrackedApps().find((a) => a.bundleId === bundleId);
|
|
@@ -105900,7 +105938,7 @@ async function findRunningCopies(bundleId, executable, skipPid) {
|
|
|
105900
105938
|
if (!command2.endsWith(suffix)) continue;
|
|
105901
105939
|
let resolved;
|
|
105902
105940
|
try {
|
|
105903
|
-
resolved =
|
|
105941
|
+
resolved = fs33.realpathSync(command2);
|
|
105904
105942
|
} catch {
|
|
105905
105943
|
continue;
|
|
105906
105944
|
}
|
|
@@ -105925,7 +105963,7 @@ async function gitWorktreeOf(dir) {
|
|
|
105925
105963
|
);
|
|
105926
105964
|
const [top, common] = stdout.trim().split("\n");
|
|
105927
105965
|
if (!top || !common) return null;
|
|
105928
|
-
return { top:
|
|
105966
|
+
return { top: fs33.realpathSync(top), common: fs33.realpathSync(common) };
|
|
105929
105967
|
} catch {
|
|
105930
105968
|
return null;
|
|
105931
105969
|
}
|
|
@@ -105945,7 +105983,7 @@ var CHROMIUM_BROWSER_FRAMEWORK = /\b(chrome|chromium|edge|brave|vivaldi|opera)\b
|
|
|
105945
105983
|
function chromiumKind(appPath) {
|
|
105946
105984
|
let frameworks;
|
|
105947
105985
|
try {
|
|
105948
|
-
frameworks =
|
|
105986
|
+
frameworks = fs33.readdirSync(path28.join(appPath, "Contents", "Frameworks"));
|
|
105949
105987
|
} catch {
|
|
105950
105988
|
return void 0;
|
|
105951
105989
|
}
|
|
@@ -105962,10 +106000,10 @@ var MAX_LOAD_COMMANDS_BYTES = 1024 * 1024;
|
|
|
105962
106000
|
function isCatalystExecutable(executable) {
|
|
105963
106001
|
let fd;
|
|
105964
106002
|
try {
|
|
105965
|
-
fd =
|
|
106003
|
+
fd = fs33.openSync(executable, "r");
|
|
105966
106004
|
const read = (length, position) => {
|
|
105967
106005
|
const buffer = Buffer.alloc(length);
|
|
105968
|
-
return buffer.subarray(0,
|
|
106006
|
+
return buffer.subarray(0, fs33.readSync(fd, buffer, 0, length, position));
|
|
105969
106007
|
};
|
|
105970
106008
|
const header = read(8, 0);
|
|
105971
106009
|
if (header.length < 8) return false;
|
|
@@ -105982,7 +106020,7 @@ function isCatalystExecutable(executable) {
|
|
|
105982
106020
|
} catch {
|
|
105983
106021
|
return false;
|
|
105984
106022
|
} finally {
|
|
105985
|
-
if (fd !== void 0)
|
|
106023
|
+
if (fd !== void 0) fs33.closeSync(fd);
|
|
105986
106024
|
}
|
|
105987
106025
|
}
|
|
105988
106026
|
function isCatalystSlice(read, offset) {
|
|
@@ -106035,7 +106073,7 @@ function parseCodesignDisplay(output2) {
|
|
|
106035
106073
|
}
|
|
106036
106074
|
function isIosAppWrapper(dir) {
|
|
106037
106075
|
try {
|
|
106038
|
-
return
|
|
106076
|
+
return fs33.statSync(path28.join(dir, "Wrapper")).isDirectory() && fs33.lstatSync(path28.join(dir, "WrappedBundle")).isSymbolicLink();
|
|
106039
106077
|
} catch {
|
|
106040
106078
|
return false;
|
|
106041
106079
|
}
|
|
@@ -106076,7 +106114,7 @@ async function inspectMacosApp(appPath) {
|
|
|
106076
106114
|
const badBundle = (message) => invalid3(message, FAILURE_CODES.MACOS_APP_BUNDLE_INVALID);
|
|
106077
106115
|
let resolved;
|
|
106078
106116
|
try {
|
|
106079
|
-
resolved =
|
|
106117
|
+
resolved = fs33.realpathSync(path28.resolve(appPath));
|
|
106080
106118
|
} catch {
|
|
106081
106119
|
throw invalid3(
|
|
106082
106120
|
`No app bundle at ${appPath}.`,
|
|
@@ -106085,7 +106123,7 @@ async function inspectMacosApp(appPath) {
|
|
|
106085
106123
|
);
|
|
106086
106124
|
}
|
|
106087
106125
|
const plist = path28.join(resolved, "Contents", "Info.plist");
|
|
106088
|
-
if (!
|
|
106126
|
+
if (!fs33.statSync(resolved).isDirectory() || !fs33.existsSync(plist)) {
|
|
106089
106127
|
if (isIosAppWrapper(resolved)) {
|
|
106090
106128
|
throw invalid3(
|
|
106091
106129
|
`${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 +106153,7 @@ async function inspectMacosApp(appPath) {
|
|
|
106115
106153
|
throw badBundle(`${plist} has no usable CFBundleExecutable.`);
|
|
106116
106154
|
}
|
|
106117
106155
|
const executable = path28.join(resolved, "Contents", "MacOS", executableName);
|
|
106118
|
-
if (!
|
|
106156
|
+
if (!fs33.existsSync(executable)) {
|
|
106119
106157
|
throw badBundle(`The executable ${executable} named by ${plist} does not exist.`);
|
|
106120
106158
|
}
|
|
106121
106159
|
const signature = await readCodeSignature(resolved) ?? parseCodesignDisplay(null);
|
|
@@ -106181,7 +106219,7 @@ async function findMacosAppByBundleId(bundleId) {
|
|
|
106181
106219
|
if (!executable) continue;
|
|
106182
106220
|
let mtimeMs;
|
|
106183
106221
|
try {
|
|
106184
|
-
mtimeMs =
|
|
106222
|
+
mtimeMs = fs33.statSync(path28.join(contents, "MacOS", executable)).mtimeMs;
|
|
106185
106223
|
} catch {
|
|
106186
106224
|
continue;
|
|
106187
106225
|
}
|
|
@@ -106210,7 +106248,7 @@ async function issueSandboxExtension(filePath, opts = {}) {
|
|
|
106210
106248
|
}
|
|
106211
106249
|
|
|
106212
106250
|
// ../tool-server/src/utils/chromium-discovery.ts
|
|
106213
|
-
var
|
|
106251
|
+
var fs36 = __toESM(require("node:fs"));
|
|
106214
106252
|
var path31 = __toESM(require("node:path"));
|
|
106215
106253
|
init_src2();
|
|
106216
106254
|
init_device_info();
|
|
@@ -106222,7 +106260,7 @@ init_src2();
|
|
|
106222
106260
|
init_src2();
|
|
106223
106261
|
|
|
106224
106262
|
// ../tool-server/src/chromium-server/cdp-session.ts
|
|
106225
|
-
var
|
|
106263
|
+
var fs34 = __toESM(require("node:fs"));
|
|
106226
106264
|
var os10 = __toESM(require("node:os"));
|
|
106227
106265
|
var path29 = __toESM(require("node:path"));
|
|
106228
106266
|
init_src2();
|
|
@@ -107060,7 +107098,7 @@ async function primePageSession(cdp) {
|
|
|
107060
107098
|
}
|
|
107061
107099
|
function mediaDir() {
|
|
107062
107100
|
const dir = path29.join(os10.tmpdir(), "argent-chromium-media");
|
|
107063
|
-
|
|
107101
|
+
fs34.mkdirSync(dir, { recursive: true });
|
|
107064
107102
|
return dir;
|
|
107065
107103
|
}
|
|
107066
107104
|
|
|
@@ -107494,7 +107532,7 @@ var ScreencastManager = class {
|
|
|
107494
107532
|
};
|
|
107495
107533
|
|
|
107496
107534
|
// ../tool-server/src/chromium-server/screenshot.ts
|
|
107497
|
-
var
|
|
107535
|
+
var fs35 = __toESM(require("node:fs"));
|
|
107498
107536
|
var path30 = __toESM(require("node:path"));
|
|
107499
107537
|
init_src2();
|
|
107500
107538
|
var sharpCache;
|
|
@@ -107583,7 +107621,7 @@ async function captureScreenshot(ctx, opts = {}) {
|
|
|
107583
107621
|
const stem = opts.id ?? `${Date.now()}-${process.pid}`;
|
|
107584
107622
|
const safeDeviceId = ctx.deviceId.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
107585
107623
|
const filePath = path30.join(mediaDir(), `argent-screenshot-${safeDeviceId}-${stem}.png`);
|
|
107586
|
-
|
|
107624
|
+
fs35.writeFileSync(filePath, bytes);
|
|
107587
107625
|
return {
|
|
107588
107626
|
url: `file://${filePath}`,
|
|
107589
107627
|
path: filePath,
|
|
@@ -107600,7 +107638,7 @@ function readPngSize(buf) {
|
|
|
107600
107638
|
}
|
|
107601
107639
|
async function copyScreenshotToClipboard(ctx, opts = {}) {
|
|
107602
107640
|
const shot = await captureScreenshot(ctx, { rotation: opts.rotation });
|
|
107603
|
-
const bytes =
|
|
107641
|
+
const bytes = fs35.readFileSync(shot.path);
|
|
107604
107642
|
const b64 = bytes.toString("base64");
|
|
107605
107643
|
const script = `(async () => {
|
|
107606
107644
|
const b64 = "${b64}";
|
|
@@ -108311,7 +108349,7 @@ function portsFilePath() {
|
|
|
108311
108349
|
}
|
|
108312
108350
|
function loadPersistedPorts() {
|
|
108313
108351
|
try {
|
|
108314
|
-
const raw = JSON.parse(
|
|
108352
|
+
const raw = JSON.parse(fs36.readFileSync(portsFilePath(), "utf8"));
|
|
108315
108353
|
if (!Array.isArray(raw)) return [];
|
|
108316
108354
|
return raw.filter((p) => typeof p === "number" && p > 0 && p <= 65535);
|
|
108317
108355
|
} catch {
|
|
@@ -108323,8 +108361,8 @@ function persistPorts(mutate) {
|
|
|
108323
108361
|
const file2 = portsFilePath();
|
|
108324
108362
|
const merged = new Set(loadPersistedPorts());
|
|
108325
108363
|
mutate(merged);
|
|
108326
|
-
|
|
108327
|
-
|
|
108364
|
+
fs36.mkdirSync(path31.dirname(file2), { recursive: true });
|
|
108365
|
+
fs36.writeFileSync(file2, JSON.stringify(Array.from(merged)));
|
|
108328
108366
|
} catch {
|
|
108329
108367
|
}
|
|
108330
108368
|
}
|
|
@@ -109467,7 +109505,7 @@ init_src2();
|
|
|
109467
109505
|
|
|
109468
109506
|
// ../tool-server/src/blueprints/ax-service.ts
|
|
109469
109507
|
var net4 = __toESM(require("node:net"));
|
|
109470
|
-
var
|
|
109508
|
+
var fs37 = __toESM(require("node:fs"));
|
|
109471
109509
|
init_src2();
|
|
109472
109510
|
init_external_devices();
|
|
109473
109511
|
|
|
@@ -109546,7 +109584,7 @@ function startListener(endpoint, onConnection) {
|
|
|
109546
109584
|
return new Promise((resolve24, reject) => {
|
|
109547
109585
|
if (endpoint.transport === "unix") {
|
|
109548
109586
|
try {
|
|
109549
|
-
|
|
109587
|
+
fs37.unlinkSync(endpoint.socketPath);
|
|
109550
109588
|
} catch {
|
|
109551
109589
|
}
|
|
109552
109590
|
}
|
|
@@ -109863,7 +109901,7 @@ var axServiceBlueprint = {
|
|
|
109863
109901
|
server.close();
|
|
109864
109902
|
if (endpoint.transport === "unix") {
|
|
109865
109903
|
try {
|
|
109866
|
-
|
|
109904
|
+
fs37.unlinkSync(endpoint.socketPath);
|
|
109867
109905
|
} catch {
|
|
109868
109906
|
}
|
|
109869
109907
|
}
|
|
@@ -110094,7 +110132,7 @@ var axServiceBlueprint = {
|
|
|
110094
110132
|
server.close();
|
|
110095
110133
|
if (endpoint.transport === "unix") {
|
|
110096
110134
|
try {
|
|
110097
|
-
|
|
110135
|
+
fs37.unlinkSync(endpoint.socketPath);
|
|
110098
110136
|
} catch {
|
|
110099
110137
|
}
|
|
110100
110138
|
}
|
|
@@ -111068,7 +111106,7 @@ init_src2();
|
|
|
111068
111106
|
|
|
111069
111107
|
// ../native-devtools-android/src/index.ts
|
|
111070
111108
|
var path33 = __toESM(require("node:path"));
|
|
111071
|
-
var
|
|
111109
|
+
var fs38 = __toESM(require("node:fs"));
|
|
111072
111110
|
|
|
111073
111111
|
// ../native-devtools-android/src/errors.ts
|
|
111074
111112
|
function buildMessage(kind, details) {
|
|
@@ -111658,13 +111696,13 @@ var cachedManifest = null;
|
|
|
111658
111696
|
function helperManifest() {
|
|
111659
111697
|
if (cachedManifest) return cachedManifest;
|
|
111660
111698
|
const manifestPath = path33.join(__dirname, "..", "assets", "manifest.json");
|
|
111661
|
-
cachedManifest = JSON.parse(
|
|
111699
|
+
cachedManifest = JSON.parse(fs38.readFileSync(manifestPath, "utf-8"));
|
|
111662
111700
|
return cachedManifest;
|
|
111663
111701
|
}
|
|
111664
111702
|
function bundledHelperApkPath() {
|
|
111665
111703
|
const manifest = helperManifest();
|
|
111666
111704
|
const apk = path33.join(binDir(), `argent-android-devtools-${manifest.versionName}.apk`);
|
|
111667
|
-
if (!
|
|
111705
|
+
if (!fs38.existsSync(apk)) {
|
|
111668
111706
|
throw new Error(
|
|
111669
111707
|
`Bundled Android devtools helper APK not found at ${apk}. Run \`bash packages/native-devtools-android/scripts/build.sh\` to build it.`
|
|
111670
111708
|
);
|
|
@@ -116670,7 +116708,7 @@ init_device_info();
|
|
|
116670
116708
|
|
|
116671
116709
|
// ../tool-server/src/blueprints/tv-control.ts
|
|
116672
116710
|
var net6 = __toESM(require("node:net"));
|
|
116673
|
-
var
|
|
116711
|
+
var fs40 = __toESM(require("node:fs"));
|
|
116674
116712
|
var import_node_child_process27 = require("node:child_process");
|
|
116675
116713
|
init_src2();
|
|
116676
116714
|
init_capability();
|
|
@@ -116968,7 +117006,7 @@ async function waitForSocket(socketPath, proc, timeoutMs) {
|
|
|
116968
117006
|
if (exited !== void 0) {
|
|
116969
117007
|
throw new Error(`tv daemon exited with code ${exited} before its socket was ready`);
|
|
116970
117008
|
}
|
|
116971
|
-
if (
|
|
117009
|
+
if (fs40.existsSync(socketPath)) {
|
|
116972
117010
|
const ok = await new Promise((resolve24) => {
|
|
116973
117011
|
const s = net6.createConnection(socketPath);
|
|
116974
117012
|
s.on("connect", () => {
|
|
@@ -117072,7 +117110,7 @@ var tvControlBlueprint = {
|
|
|
117072
117110
|
await reapDaemons(axSock);
|
|
117073
117111
|
for (const p of [axSock, hidSock]) {
|
|
117074
117112
|
try {
|
|
117075
|
-
|
|
117113
|
+
fs40.unlinkSync(p);
|
|
117076
117114
|
} catch {
|
|
117077
117115
|
}
|
|
117078
117116
|
}
|
|
@@ -117088,7 +117126,7 @@ var tvControlBlueprint = {
|
|
|
117088
117126
|
}
|
|
117089
117127
|
axExited = false;
|
|
117090
117128
|
try {
|
|
117091
|
-
|
|
117129
|
+
fs40.unlinkSync(axSock);
|
|
117092
117130
|
} catch {
|
|
117093
117131
|
}
|
|
117094
117132
|
await reapDaemons(axSock);
|
|
@@ -117113,7 +117151,7 @@ var tvControlBlueprint = {
|
|
|
117113
117151
|
axProc.kill("SIGKILL");
|
|
117114
117152
|
}
|
|
117115
117153
|
try {
|
|
117116
|
-
|
|
117154
|
+
fs40.unlinkSync(axSock);
|
|
117117
117155
|
} catch {
|
|
117118
117156
|
}
|
|
117119
117157
|
}
|
|
@@ -117220,7 +117258,7 @@ var tvControlBlueprint = {
|
|
|
117220
117258
|
await reapDaemons(axSock);
|
|
117221
117259
|
for (const p of [axSock, hidSock]) {
|
|
117222
117260
|
try {
|
|
117223
|
-
|
|
117261
|
+
fs40.unlinkSync(p);
|
|
117224
117262
|
} catch {
|
|
117225
117263
|
}
|
|
117226
117264
|
}
|
|
@@ -117742,8 +117780,8 @@ function reserveLaunchMeasurement(udid) {
|
|
|
117742
117780
|
// ../tool-server/src/utils/ios-device/runner-artifact.ts
|
|
117743
117781
|
var import_node_child_process29 = require("node:child_process");
|
|
117744
117782
|
var import_node_util21 = require("node:util");
|
|
117745
|
-
var
|
|
117746
|
-
var
|
|
117783
|
+
var import_node_crypto14 = require("node:crypto");
|
|
117784
|
+
var fs42 = __toESM(require("node:fs"));
|
|
117747
117785
|
var fsp = __toESM(require("node:fs/promises"));
|
|
117748
117786
|
var path36 = __toESM(require("node:path"));
|
|
117749
117787
|
init_src2();
|
|
@@ -117875,7 +117913,7 @@ function resolveRunnerProjectPath() {
|
|
|
117875
117913
|
return override;
|
|
117876
117914
|
}
|
|
117877
117915
|
const candidate = path36.resolve(__dirname, PROJECT_SUFFIX);
|
|
117878
|
-
if (
|
|
117916
|
+
if (fs42.existsSync(candidate)) {
|
|
117879
117917
|
return candidate;
|
|
117880
117918
|
}
|
|
117881
117919
|
throw withFailureSignal(
|
|
@@ -117901,7 +117939,7 @@ var FINGERPRINT_NOISE = /* @__PURE__ */ new Set([
|
|
|
117901
117939
|
]);
|
|
117902
117940
|
async function fingerprintRunnerSources(projectPath) {
|
|
117903
117941
|
const root = path36.dirname(projectPath);
|
|
117904
|
-
const hash2 = (0,
|
|
117942
|
+
const hash2 = (0, import_node_crypto14.createHash)("sha256");
|
|
117905
117943
|
const walk = async (dir) => {
|
|
117906
117944
|
const entries = (await fsp.readdir(dir, { withFileTypes: true })).sort(
|
|
117907
117945
|
(a, b) => a.name.localeCompare(b.name)
|
|
@@ -117952,10 +117990,10 @@ function runnerProductsDir(derivedDataPath) {
|
|
|
117952
117990
|
}
|
|
117953
117991
|
function findBaseXctestrun(derivedDataPath) {
|
|
117954
117992
|
const productsDir = runnerProductsDir(derivedDataPath);
|
|
117955
|
-
if (!
|
|
117993
|
+
if (!fs42.existsSync(productsDir)) {
|
|
117956
117994
|
return null;
|
|
117957
117995
|
}
|
|
117958
|
-
const candidates =
|
|
117996
|
+
const candidates = fs42.readdirSync(productsDir).filter((name) => {
|
|
117959
117997
|
return name.endsWith(".xctestrun") && name.includes("iphoneos");
|
|
117960
117998
|
});
|
|
117961
117999
|
if (candidates.length === 0) {
|
|
@@ -118010,7 +118048,7 @@ function runnerBuildLocationArgs(derivedDataPath) {
|
|
|
118010
118048
|
];
|
|
118011
118049
|
}
|
|
118012
118050
|
function computeRunnerCacheKey(sourcesHash, xcodeVersion2, staticArgs) {
|
|
118013
|
-
return (0,
|
|
118051
|
+
return (0, import_node_crypto14.createHash)("sha256").update([sourcesHash, xcodeVersion2, ...staticArgs].join("\n")).digest("hex").slice(0, 16);
|
|
118014
118052
|
}
|
|
118015
118053
|
function isProfileMissingDeviceFailure(logText) {
|
|
118016
118054
|
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 +118175,7 @@ ${xcodebuildFailureSummary(output2)}`,
|
|
|
118137
118175
|
// ../tool-server/src/utils/ios-device/runner-launch.ts
|
|
118138
118176
|
var import_node_child_process30 = require("node:child_process");
|
|
118139
118177
|
var import_node_events2 = require("node:events");
|
|
118140
|
-
var
|
|
118178
|
+
var fs43 = __toESM(require("node:fs"));
|
|
118141
118179
|
var fsp2 = __toESM(require("node:fs/promises"));
|
|
118142
118180
|
var path37 = __toESM(require("node:path"));
|
|
118143
118181
|
var import_node_util22 = require("node:util");
|
|
@@ -118185,7 +118223,7 @@ async function launchRunner(opts) {
|
|
|
118185
118223
|
const resultBundlePath = path37.join(resultsDir, `argent-${deviceTag}.xcresult`);
|
|
118186
118224
|
await fsp2.rm(resultBundlePath, { recursive: true, force: true });
|
|
118187
118225
|
await disableRunnerAttachments(opts.xctestrunPath);
|
|
118188
|
-
const logFd =
|
|
118226
|
+
const logFd = fs43.openSync(logPath, "w");
|
|
118189
118227
|
const child = (0, import_node_child_process30.spawn)(
|
|
118190
118228
|
"xcodebuild",
|
|
118191
118229
|
[
|
|
@@ -118222,7 +118260,7 @@ async function launchRunner(opts) {
|
|
|
118222
118260
|
}
|
|
118223
118261
|
);
|
|
118224
118262
|
child.unref();
|
|
118225
|
-
|
|
118263
|
+
fs43.closeSync(logFd);
|
|
118226
118264
|
try {
|
|
118227
118265
|
await (0, import_node_events2.once)(child, "spawn");
|
|
118228
118266
|
} catch (error63) {
|
|
@@ -118323,7 +118361,7 @@ async function killStaleRunnersForDevice(udid, listProcesses = listProcessTable)
|
|
|
118323
118361
|
}
|
|
118324
118362
|
|
|
118325
118363
|
// ../tool-server/src/blueprints/ios-device-runner.ts
|
|
118326
|
-
var
|
|
118364
|
+
var fs45 = __toESM(require("node:fs/promises"));
|
|
118327
118365
|
|
|
118328
118366
|
// ../tool-server/src/utils/ios-device/runner-route.ts
|
|
118329
118367
|
var import_node_net3 = __toESM(require("node:net"));
|
|
@@ -118711,7 +118749,7 @@ function defaultSendViaUsbmux(udid, port, body, deadline) {
|
|
|
118711
118749
|
// ../tool-server/src/utils/ios-device/runner-crash.ts
|
|
118712
118750
|
var import_node_child_process32 = require("node:child_process");
|
|
118713
118751
|
var import_node_util24 = require("node:util");
|
|
118714
|
-
var
|
|
118752
|
+
var fs44 = __toESM(require("node:fs/promises"));
|
|
118715
118753
|
var execFileAsync23 = (0, import_node_util24.promisify)(import_node_child_process32.execFile);
|
|
118716
118754
|
var XCRESULTTOOL_TIMEOUT_MS = 15e3;
|
|
118717
118755
|
var XCRESULTTOOL_MAX_JSON_BYTES = 32 * 1024 * 1024;
|
|
@@ -118731,7 +118769,7 @@ function extractCrashFailureText(summary) {
|
|
|
118731
118769
|
}
|
|
118732
118770
|
async function readRunnerCrashSummary(resultBundlePath) {
|
|
118733
118771
|
try {
|
|
118734
|
-
await
|
|
118772
|
+
await fs44.access(resultBundlePath);
|
|
118735
118773
|
const { stdout } = await execFileAsync23(
|
|
118736
118774
|
"xcrun",
|
|
118737
118775
|
["xcresulttool", "get", "test-results", "summary", "--path", resultBundlePath],
|
|
@@ -118744,7 +118782,7 @@ async function readRunnerCrashSummary(resultBundlePath) {
|
|
|
118744
118782
|
}
|
|
118745
118783
|
|
|
118746
118784
|
// ../tool-server/src/utils/ios-device/runner-client.ts
|
|
118747
|
-
var
|
|
118785
|
+
var import_node_crypto15 = require("node:crypto");
|
|
118748
118786
|
init_src2();
|
|
118749
118787
|
var RUNNER_COMMAND_TIMEOUT_MS = 45e3;
|
|
118750
118788
|
var RUNNER_STATUS_RECOVERY_TIMEOUT_MS = 3e3;
|
|
@@ -118957,7 +118995,7 @@ function withCommandId(command2) {
|
|
|
118957
118995
|
if (command2.command === "status" || typeof command2.commandId === "string") {
|
|
118958
118996
|
return command2;
|
|
118959
118997
|
}
|
|
118960
|
-
return { ...command2, commandId: `argent-${(0,
|
|
118998
|
+
return { ...command2, commandId: `argent-${(0, import_node_crypto15.randomUUID)()}` };
|
|
118961
118999
|
}
|
|
118962
119000
|
function unwrapEnvelope(response, udid) {
|
|
118963
119001
|
const envelope = asEnvelope(response);
|
|
@@ -119104,7 +119142,7 @@ async function startRunner(udid, artifact, tunnelAddress) {
|
|
|
119104
119142
|
launched.child.once("exit", reserveInteractionRunner(udid));
|
|
119105
119143
|
}
|
|
119106
119144
|
killRunnerProcess(launched.child);
|
|
119107
|
-
const logText = await
|
|
119145
|
+
const logText = await fs45.readFile(launched.logPath, "utf8").catch(() => "");
|
|
119108
119146
|
throw Object.assign(
|
|
119109
119147
|
withFailureSignal(
|
|
119110
119148
|
new Error(
|
|
@@ -124645,9 +124683,9 @@ init_src2();
|
|
|
124645
124683
|
|
|
124646
124684
|
// ../tool-server/src/blueprints/macos-app.ts
|
|
124647
124685
|
var import_node_child_process33 = require("node:child_process");
|
|
124648
|
-
var
|
|
124686
|
+
var import_node_crypto16 = require("node:crypto");
|
|
124649
124687
|
var import_node_events5 = require("node:events");
|
|
124650
|
-
var
|
|
124688
|
+
var fs46 = __toESM(require("node:fs"));
|
|
124651
124689
|
var net9 = __toESM(require("node:net"));
|
|
124652
124690
|
var os12 = __toESM(require("node:os"));
|
|
124653
124691
|
var path39 = __toESM(require("node:path"));
|
|
@@ -124888,7 +124926,7 @@ async function stopProcesses(pids, executable, group) {
|
|
|
124888
124926
|
}
|
|
124889
124927
|
function readLogTail(logPath) {
|
|
124890
124928
|
try {
|
|
124891
|
-
const lines =
|
|
124929
|
+
const lines = fs46.readFileSync(logPath, "utf8").trimEnd().split("\n");
|
|
124892
124930
|
const tail = lines.slice(-20).join("\n").trim();
|
|
124893
124931
|
return tail ? `
|
|
124894
124932
|
Last lines of ${logPath}:
|
|
@@ -124932,7 +124970,7 @@ function closedByArgentError(bundleId, method) {
|
|
|
124932
124970
|
"unknown"
|
|
124933
124971
|
);
|
|
124934
124972
|
}
|
|
124935
|
-
var nextCdpWireId = (0,
|
|
124973
|
+
var nextCdpWireId = (0, import_node_crypto16.randomInt)(2 ** 47);
|
|
124936
124974
|
var LibraryChannel = class {
|
|
124937
124975
|
/**
|
|
124938
124976
|
* @param expectedPid the app's pid when known; a launch learns it from the helper after the spawn.
|
|
@@ -125593,7 +125631,7 @@ function createMacosAppApi(bundleId) {
|
|
|
125593
125631
|
"not_found"
|
|
125594
125632
|
);
|
|
125595
125633
|
}
|
|
125596
|
-
if (!opts.appPath && tracked && !
|
|
125634
|
+
if (!opts.appPath && tracked && !fs46.existsSync(appPath)) {
|
|
125597
125635
|
throw macosFailure(
|
|
125598
125636
|
`argent last started ${bundleId} from ${appPath}, which no longer exists. Pass the .app path to boot-device as macosAppPath.`,
|
|
125599
125637
|
FAILURE_CODES.MACOS_APP_PATH_INVALID,
|
|
@@ -125655,7 +125693,7 @@ function createMacosAppApi(bundleId) {
|
|
|
125655
125693
|
const bootstrapPath = await stageLibraryFor(info, artifacts);
|
|
125656
125694
|
const listen4 = macosListenSocket(bundleId, info.sandboxed);
|
|
125657
125695
|
const logPath = macosAppLogPath(bundleId);
|
|
125658
|
-
|
|
125696
|
+
fs46.mkdirSync(path39.dirname(logPath), { recursive: true, mode: 448 });
|
|
125659
125697
|
if (listen4 && !info.sandboxed) prepareSocketDir(listen4.path);
|
|
125660
125698
|
const forceQuit = own2 ? await terminate(own2) : void 0;
|
|
125661
125699
|
let tookOver;
|
|
@@ -125673,8 +125711,8 @@ function createMacosAppApi(bundleId) {
|
|
|
125673
125711
|
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
125712
|
}
|
|
125675
125713
|
}
|
|
125676
|
-
if (listen4 && !info.sandboxed)
|
|
125677
|
-
|
|
125714
|
+
if (listen4 && !info.sandboxed) fs46.rmSync(listen4.path, { force: true });
|
|
125715
|
+
fs46.writeFileSync(logPath, "");
|
|
125678
125716
|
const args = opts.args ?? (opts.noLastArgs ? void 0 : tracked?.args) ?? [];
|
|
125679
125717
|
const helper = (0, import_node_child_process33.spawn)(
|
|
125680
125718
|
artifacts.helper,
|
|
@@ -127337,7 +127375,7 @@ var SourceMapsRegistry = class {
|
|
|
127337
127375
|
};
|
|
127338
127376
|
|
|
127339
127377
|
// ../tool-server/src/utils/debugger/log-file-writer.ts
|
|
127340
|
-
var
|
|
127378
|
+
var fs47 = __toESM(require("node:fs"));
|
|
127341
127379
|
var path40 = __toESM(require("node:path"));
|
|
127342
127380
|
init_src();
|
|
127343
127381
|
var MAX_ENTRIES = 5e4;
|
|
@@ -127366,7 +127404,7 @@ var LogFileWriter = class {
|
|
|
127366
127404
|
const timestamp = lastTimestamp = Math.max(Date.now(), lastTimestamp + 1);
|
|
127367
127405
|
const dir = path40.join(argentHomeDir(), "tmp");
|
|
127368
127406
|
try {
|
|
127369
|
-
|
|
127407
|
+
fs47.mkdirSync(dir, { recursive: true });
|
|
127370
127408
|
} catch {
|
|
127371
127409
|
}
|
|
127372
127410
|
pruneStaleLogs(dir);
|
|
@@ -127376,7 +127414,7 @@ var LogFileWriter = class {
|
|
|
127376
127414
|
}
|
|
127377
127415
|
open() {
|
|
127378
127416
|
try {
|
|
127379
|
-
this.fd =
|
|
127417
|
+
this.fd = fs47.openSync(this.filePath, "w");
|
|
127380
127418
|
this.ready = true;
|
|
127381
127419
|
} catch {
|
|
127382
127420
|
}
|
|
@@ -127402,7 +127440,7 @@ var LogFileWriter = class {
|
|
|
127402
127440
|
try {
|
|
127403
127441
|
const bytes = Buffer.from(this.midLine ? `
|
|
127404
127442
|
${line}` : line);
|
|
127405
|
-
const written =
|
|
127443
|
+
const written = fs47.writeSync(this.fd, bytes, 0, bytes.length, this.bytesWritten);
|
|
127406
127444
|
if (written === bytes.length) {
|
|
127407
127445
|
this.bytesWritten += written;
|
|
127408
127446
|
this.midLine = false;
|
|
@@ -127454,7 +127492,7 @@ ${line}` : line);
|
|
|
127454
127492
|
/** A torn line past " | " would parse as a whole entry with its message cut. */
|
|
127455
127493
|
dropTornLine(fd, bytes, written) {
|
|
127456
127494
|
try {
|
|
127457
|
-
|
|
127495
|
+
fs47.ftruncateSync(fd, this.bytesWritten);
|
|
127458
127496
|
} catch {
|
|
127459
127497
|
this.bytesWritten += written;
|
|
127460
127498
|
if (written > 0) this.midLine = bytes[written - 1] !== 10;
|
|
@@ -127468,7 +127506,7 @@ ${line}` : line);
|
|
|
127468
127506
|
return this.fileEntryCount;
|
|
127469
127507
|
}
|
|
127470
127508
|
hasFile() {
|
|
127471
|
-
return
|
|
127509
|
+
return fs47.existsSync(this.filePath);
|
|
127472
127510
|
}
|
|
127473
127511
|
getStats() {
|
|
127474
127512
|
return {
|
|
@@ -127493,7 +127531,7 @@ ${line}` : line);
|
|
|
127493
127531
|
readAll() {
|
|
127494
127532
|
if (this.closed || !this.ready) return [];
|
|
127495
127533
|
try {
|
|
127496
|
-
const content =
|
|
127534
|
+
const content = fs47.readFileSync(this.filePath, "utf-8");
|
|
127497
127535
|
return content.split("\n").filter((line) => line.length > 0).map(parseFlatLine).filter((entry) => entry !== null);
|
|
127498
127536
|
} catch {
|
|
127499
127537
|
return [];
|
|
@@ -127515,7 +127553,7 @@ ${line}` : line);
|
|
|
127515
127553
|
liveLogFiles.delete(this.filePath);
|
|
127516
127554
|
if (this.fd !== null) {
|
|
127517
127555
|
try {
|
|
127518
|
-
|
|
127556
|
+
fs47.closeSync(this.fd);
|
|
127519
127557
|
} catch {
|
|
127520
127558
|
}
|
|
127521
127559
|
this.fd = null;
|
|
@@ -127523,13 +127561,13 @@ ${line}` : line);
|
|
|
127523
127561
|
if (keepFile) {
|
|
127524
127562
|
try {
|
|
127525
127563
|
const now = /* @__PURE__ */ new Date();
|
|
127526
|
-
|
|
127564
|
+
fs47.utimesSync(this.filePath, now, now);
|
|
127527
127565
|
} catch {
|
|
127528
127566
|
}
|
|
127529
127567
|
return;
|
|
127530
127568
|
}
|
|
127531
127569
|
try {
|
|
127532
|
-
|
|
127570
|
+
fs47.unlinkSync(this.filePath);
|
|
127533
127571
|
} catch {
|
|
127534
127572
|
}
|
|
127535
127573
|
}
|
|
@@ -127538,7 +127576,7 @@ function pruneStaleLogs(dir) {
|
|
|
127538
127576
|
const cutoff = Date.now() - STALE_LOG_MS;
|
|
127539
127577
|
let names;
|
|
127540
127578
|
try {
|
|
127541
|
-
names =
|
|
127579
|
+
names = fs47.readdirSync(dir);
|
|
127542
127580
|
} catch {
|
|
127543
127581
|
return;
|
|
127544
127582
|
}
|
|
@@ -127548,7 +127586,7 @@ function pruneStaleLogs(dir) {
|
|
|
127548
127586
|
const file2 = path40.join(dir, name);
|
|
127549
127587
|
if (pid === process.pid ? liveLogFiles.has(file2) : isAlive(pid)) continue;
|
|
127550
127588
|
try {
|
|
127551
|
-
if (
|
|
127589
|
+
if (fs47.statSync(file2).mtimeMs < cutoff) fs47.unlinkSync(file2);
|
|
127552
127590
|
} catch {
|
|
127553
127591
|
}
|
|
127554
127592
|
}
|
|
@@ -128574,7 +128612,7 @@ function createHttpApp(registry2, options) {
|
|
|
128574
128612
|
});
|
|
128575
128613
|
return;
|
|
128576
128614
|
}
|
|
128577
|
-
const id = (0,
|
|
128615
|
+
const id = (0, import_node_crypto17.randomUUID)();
|
|
128578
128616
|
const tarPath = (0, import_node_path17.join)((0, import_node_os12.tmpdir)(), `argent-upload-${id}.tar.gz`);
|
|
128579
128617
|
const ws = (0, import_node_fs14.createWriteStream)(tarPath);
|
|
128580
128618
|
let received2 = 0;
|
|
@@ -128591,7 +128629,7 @@ function createHttpApp(registry2, options) {
|
|
|
128591
128629
|
});
|
|
128592
128630
|
if (!res.headersSent) res.status(status).json({ error: message });
|
|
128593
128631
|
};
|
|
128594
|
-
const digest = (0,
|
|
128632
|
+
const digest = (0, import_node_crypto17.createHash)("sha256");
|
|
128595
128633
|
req.on("data", (chunk) => {
|
|
128596
128634
|
if (released) return;
|
|
128597
128635
|
received2 += chunk.length;
|
|
@@ -128890,7 +128928,7 @@ function createHttpApp(registry2, options) {
|
|
|
128890
128928
|
});
|
|
128891
128929
|
const keepAlive = def.longRunning && options?.idleTimeoutMs && options.idleTimeoutMs > 0 ? setInterval(() => idleTimer.touch(), Math.max(1e3, IDLE_CHECK_INTERVAL_MS / 2)) : null;
|
|
128892
128930
|
if (keepAlive) keepAlive.unref?.();
|
|
128893
|
-
const toolInvocationId = (0,
|
|
128931
|
+
const toolInvocationId = (0, import_node_crypto17.randomUUID)();
|
|
128894
128932
|
let releaseInvocationMeta;
|
|
128895
128933
|
let recordChildInvocation;
|
|
128896
128934
|
const recordInvocation = options?.recordInvocation;
|
|
@@ -129235,8 +129273,8 @@ init_src2();
|
|
|
129235
129273
|
init_src();
|
|
129236
129274
|
|
|
129237
129275
|
// ../tool-server/src/blueprints/android-network-inspector.ts
|
|
129238
|
-
var
|
|
129239
|
-
var
|
|
129276
|
+
var import_node_crypto18 = require("node:crypto");
|
|
129277
|
+
var fs48 = __toESM(require("node:fs"));
|
|
129240
129278
|
var net10 = __toESM(require("node:net"));
|
|
129241
129279
|
var path41 = __toESM(require("node:path"));
|
|
129242
129280
|
init_src2();
|
|
@@ -129442,7 +129480,7 @@ var NOT_RECONNECTED_NOTE = "the agent's connection dropped, and it did not recon
|
|
|
129442
129480
|
var STOPPED_NOTE = "capture stopped by network-capture-stop; network-capture-start turns it on again";
|
|
129443
129481
|
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
129482
|
var LOGGED_DETAIL_EVENTS = /* @__PURE__ */ new Set(["interceptor_installed", "interceptor_failed"]);
|
|
129445
|
-
var RUN_TAG2 = (0,
|
|
129483
|
+
var RUN_TAG2 = (0, import_node_crypto18.randomBytes)(2).toString("hex");
|
|
129446
129484
|
var ANDROID_NATIVE_REQUEST_ID = /^android-[0-9a-f]{4}-\d+$/;
|
|
129447
129485
|
var liveInspectors = /* @__PURE__ */ new Map();
|
|
129448
129486
|
var nextRecordNumber2 = 1;
|
|
@@ -129552,7 +129590,7 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
129552
129590
|
process.stderr.write(`[${tag3}] ${line}
|
|
129553
129591
|
`);
|
|
129554
129592
|
};
|
|
129555
|
-
const secret = (0,
|
|
129593
|
+
const secret = (0, import_node_crypto18.randomBytes)(32).toString("hex");
|
|
129556
129594
|
let metroPort2 = initialMetroPort;
|
|
129557
129595
|
let disposed = false;
|
|
129558
129596
|
let live = false;
|
|
@@ -129781,7 +129819,7 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
129781
129819
|
}
|
|
129782
129820
|
async function bindDevicePort() {
|
|
129783
129821
|
for (let attempt = 0; attempt < DEVICE_PORT_ATTEMPTS; attempt++) {
|
|
129784
|
-
const port = DEVICE_PORT_MIN + (0,
|
|
129822
|
+
const port = DEVICE_PORT_MIN + (0, import_node_crypto18.randomInt)(DEVICE_PORT_SPAN);
|
|
129785
129823
|
try {
|
|
129786
129824
|
await adbReverse(serial, port, hostPort, { timeoutMs: 1e4, noRebind: true });
|
|
129787
129825
|
} catch (err) {
|
|
@@ -130039,7 +130077,7 @@ function createInspector(serial, packageName, initialMetroPort) {
|
|
|
130039
130077
|
return;
|
|
130040
130078
|
}
|
|
130041
130079
|
agentNonce = payload.nonce;
|
|
130042
|
-
serverNonce = (0,
|
|
130080
|
+
serverNonce = (0, import_node_crypto18.randomBytes)(16).toString("hex");
|
|
130043
130081
|
writeNdjsonFrame(socket, {
|
|
130044
130082
|
type: "Control",
|
|
130045
130083
|
payload: {
|
|
@@ -130926,14 +130964,14 @@ function readHandshake(payload) {
|
|
|
130926
130964
|
}
|
|
130927
130965
|
function proofMatches(proof, expected) {
|
|
130928
130966
|
if (!isHex2(proof, 64)) return false;
|
|
130929
|
-
return (0,
|
|
130967
|
+
return (0, import_node_crypto18.timingSafeEqual)(Buffer.from(proof, "hex"), Buffer.from(expected, "hex"));
|
|
130930
130968
|
}
|
|
130931
130969
|
function handshakeProof(secret, parts2) {
|
|
130932
|
-
return (0,
|
|
130970
|
+
return (0, import_node_crypto18.createHmac)("sha256", Buffer.from(secret, "ascii")).update(parts2.join("\n"), "utf8").digest("hex");
|
|
130933
130971
|
}
|
|
130934
130972
|
function sessionKeys(agentNonce, serverNonce, secret) {
|
|
130935
|
-
const prk = (0,
|
|
130936
|
-
const expand = (info) => (0,
|
|
130973
|
+
const prk = (0, import_node_crypto18.createHmac)("sha256", Buffer.from(agentNonce + serverNonce, "ascii")).update(Buffer.from(secret, "ascii")).digest();
|
|
130974
|
+
const expand = (info) => (0, import_node_crypto18.createHmac)("sha256", prk).update(Buffer.concat([Buffer.from(info, "ascii"), Buffer.of(1)])).digest();
|
|
130937
130975
|
return {
|
|
130938
130976
|
agent: expand("argent-nwi agent to server"),
|
|
130939
130977
|
server: expand("argent-nwi server to agent")
|
|
@@ -130945,7 +130983,7 @@ function frameIv(counter) {
|
|
|
130945
130983
|
return iv;
|
|
130946
130984
|
}
|
|
130947
130985
|
function sealFrame(key2, counter, frame2) {
|
|
130948
|
-
const cipher = (0,
|
|
130986
|
+
const cipher = (0, import_node_crypto18.createCipheriv)("aes-256-gcm", key2, frameIv(counter), {
|
|
130949
130987
|
authTagLength: GCM_TAG_BYTES
|
|
130950
130988
|
});
|
|
130951
130989
|
return Buffer.concat([
|
|
@@ -130963,7 +131001,7 @@ function openFrame(key2, counter, sealed) {
|
|
|
130963
131001
|
}
|
|
130964
131002
|
let plaintext;
|
|
130965
131003
|
try {
|
|
130966
|
-
const decipher = (0,
|
|
131004
|
+
const decipher = (0, import_node_crypto18.createDecipheriv)("aes-256-gcm", key2, frameIv(counter), {
|
|
130967
131005
|
authTagLength: GCM_TAG_BYTES
|
|
130968
131006
|
});
|
|
130969
131007
|
decipher.setAuthTag(bytes.subarray(bytes.length - GCM_TAG_BYTES));
|
|
@@ -131004,11 +131042,11 @@ function parseCapture(value) {
|
|
|
131004
131042
|
function agentFiles() {
|
|
131005
131043
|
const dir = path41.join(binDir(), "network-inspector");
|
|
131006
131044
|
const jar = path41.join(dir, JAR_NAME);
|
|
131007
|
-
if (!
|
|
131045
|
+
if (!fs48.existsSync(jar)) return null;
|
|
131008
131046
|
const lib = {};
|
|
131009
131047
|
for (const abi of AGENT_ABIS) {
|
|
131010
131048
|
const file2 = path41.join(dir, abi, AGENT_LIB_NAME);
|
|
131011
|
-
if (
|
|
131049
|
+
if (fs48.existsSync(file2)) lib[abi] = file2;
|
|
131012
131050
|
}
|
|
131013
131051
|
return Object.keys(lib).length > 0 ? { jar, lib } : null;
|
|
131014
131052
|
}
|
|
@@ -132847,7 +132885,7 @@ init_device_info();
|
|
|
132847
132885
|
init_external_devices();
|
|
132848
132886
|
|
|
132849
132887
|
// ../tool-server/src/utils/debugger/target-selection.ts
|
|
132850
|
-
var
|
|
132888
|
+
var import_node_crypto19 = require("node:crypto");
|
|
132851
132889
|
init_src2();
|
|
132852
132890
|
init_device_info();
|
|
132853
132891
|
init_macos_app_kind();
|
|
@@ -132869,7 +132907,7 @@ function macosAppBundleIdOf(target) {
|
|
|
132869
132907
|
const vendorIds = trackedMacosAppKind(bundleId) === "catalyst" ? catalystVendorId ? [catalystVendorId] : [] : [""];
|
|
132870
132908
|
for (const vendorId of vendorIds) {
|
|
132871
132909
|
for (const mode of ["fusebox", "legacy"]) {
|
|
132872
|
-
const id = (0,
|
|
132910
|
+
const id = (0, import_node_crypto19.createHash)("sha256").update(`apple-${vendorId}-${bundleId}-${mode}`).digest("hex").slice(0, 40);
|
|
132873
132911
|
if (id === logicalId) return bundleId;
|
|
132874
132912
|
}
|
|
132875
132913
|
}
|
|
@@ -133013,7 +133051,7 @@ init_device_info();
|
|
|
133013
133051
|
init_external_devices();
|
|
133014
133052
|
|
|
133015
133053
|
// ../tool-server/src/utils/debugger/runtime-device.ts
|
|
133016
|
-
var
|
|
133054
|
+
var import_node_crypto20 = require("node:crypto");
|
|
133017
133055
|
var import_node_child_process34 = require("node:child_process");
|
|
133018
133056
|
var import_node_util25 = require("node:util");
|
|
133019
133057
|
init_adb();
|
|
@@ -133026,7 +133064,7 @@ async function findRuntimeDevices(cdp, {
|
|
|
133026
133064
|
awaitSerials = [],
|
|
133027
133065
|
waitSerials = []
|
|
133028
133066
|
} = {}) {
|
|
133029
|
-
const marker = `argent-device-probe:${(0,
|
|
133067
|
+
const marker = `argent-device-probe:${(0, import_node_crypto20.randomUUID)()}`;
|
|
133030
133068
|
const logged = await cdp.evaluate(
|
|
133031
133069
|
`(function () {
|
|
133032
133070
|
if (typeof nativeLoggingHook !== "function") return false;
|
|
@@ -133234,7 +133272,7 @@ async function runtimeRunsOn(cdp, deviceId) {
|
|
|
133234
133272
|
}
|
|
133235
133273
|
|
|
133236
133274
|
// ../tool-server/src/utils/debugger/source-resolver.ts
|
|
133237
|
-
var
|
|
133275
|
+
var fs49 = __toESM(require("node:fs/promises"));
|
|
133238
133276
|
var path42 = __toESM(require("node:path"));
|
|
133239
133277
|
|
|
133240
133278
|
// ../../node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js
|
|
@@ -133405,11 +133443,11 @@ function createSourceResolver(port, projectRoot) {
|
|
|
133405
133443
|
if (!projectRoot) return null;
|
|
133406
133444
|
try {
|
|
133407
133445
|
const absPath = path42.isAbsolute(location.file) ? path42.resolve(location.file) : path42.resolve(projectRoot, location.file);
|
|
133408
|
-
const realRoot = await
|
|
133409
|
-
const realPath = await
|
|
133446
|
+
const realRoot = await fs49.realpath(projectRoot);
|
|
133447
|
+
const realPath = await fs49.realpath(absPath);
|
|
133410
133448
|
if (!isInsideProject(realPath, realRoot)) return null;
|
|
133411
133449
|
if (!hasAllowedExtension(realPath)) return null;
|
|
133412
|
-
const content = await
|
|
133450
|
+
const content = await fs49.readFile(realPath, "utf-8");
|
|
133413
133451
|
const lines = content.split("\n");
|
|
133414
133452
|
const start2 = Math.max(0, location.line - 1 - contextLines);
|
|
133415
133453
|
const end = Math.min(lines.length, location.line + contextLines);
|
|
@@ -133798,7 +133836,7 @@ var jsRuntimeDebuggerBlueprint = {
|
|
|
133798
133836
|
init_src2();
|
|
133799
133837
|
|
|
133800
133838
|
// ../tool-server/src/utils/debugger/scripts/network-interceptor.ts
|
|
133801
|
-
var
|
|
133839
|
+
var import_node_crypto21 = require("node:crypto");
|
|
133802
133840
|
var import_node_os13 = require("node:os");
|
|
133803
133841
|
init_src3();
|
|
133804
133842
|
var BINARY_BODY_TYPES = /^(image\/(?!svg)|audio\/|video\/|font\/|application\/(octet-stream|pdf|zip|gzip|wasm|x-protobuf)$)/;
|
|
@@ -134878,7 +134916,7 @@ var NETWORK_CAPTURE_MARK_SCRIPT = `(function() {
|
|
|
134878
134916
|
var g = globalThis;
|
|
134879
134917
|
return typeof g.__argent_network_mark === 'function' ? g.__argent_network_mark() : JSON.stringify({ install: null });
|
|
134880
134918
|
})()`;
|
|
134881
|
-
var HOLDER = JSON.stringify((0,
|
|
134919
|
+
var HOLDER = JSON.stringify((0, import_node_crypto21.randomUUID)());
|
|
134882
134920
|
function holderRecord(capturing2) {
|
|
134883
134921
|
return JSON.stringify({ capturing: capturing2, pid: process.pid, host: (0, import_node_os13.hostname)() });
|
|
134884
134922
|
}
|
|
@@ -136379,7 +136417,7 @@ async function readParentPids() {
|
|
|
136379
136417
|
}
|
|
136380
136418
|
|
|
136381
136419
|
// ../tool-server/src/utils/linux-preflight.ts
|
|
136382
|
-
var
|
|
136420
|
+
var fs51 = __toESM(require("node:fs"));
|
|
136383
136421
|
var import_node_os14 = require("node:os");
|
|
136384
136422
|
var import_node_path20 = require("node:path");
|
|
136385
136423
|
var import_ini2 = __toESM(require_ini());
|
|
@@ -136396,7 +136434,7 @@ function linuxBootDiagnostics(avdName) {
|
|
|
136396
136434
|
}
|
|
136397
136435
|
function checkKvm() {
|
|
136398
136436
|
try {
|
|
136399
|
-
|
|
136437
|
+
fs51.accessSync("/dev/kvm", fs51.constants.R_OK | fs51.constants.W_OK);
|
|
136400
136438
|
return null;
|
|
136401
136439
|
} catch (err) {
|
|
136402
136440
|
const code = err.code;
|
|
@@ -136412,7 +136450,7 @@ function checkAvdSizing(avdName) {
|
|
|
136412
136450
|
const configPath = (0, import_node_path20.join)((0, import_node_os14.homedir)(), ".android", "avd", `${avdName}.avd`, "config.ini");
|
|
136413
136451
|
let content;
|
|
136414
136452
|
try {
|
|
136415
|
-
content =
|
|
136453
|
+
content = fs51.readFileSync(configPath, "utf8");
|
|
136416
136454
|
} catch {
|
|
136417
136455
|
return null;
|
|
136418
136456
|
}
|
|
@@ -136467,14 +136505,7 @@ function loadVerdicts() {
|
|
|
136467
136505
|
function persistVerdict(key2, verdict) {
|
|
136468
136506
|
const filePath = verdictFilePath();
|
|
136469
136507
|
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
|
-
}
|
|
136508
|
+
writeFileAtomicSync(filePath, JSON.stringify({ ...loadVerdicts(), [key2]: verdict }, null, 2));
|
|
136478
136509
|
}
|
|
136479
136510
|
async function bundleVersion(infoPlist) {
|
|
136480
136511
|
const { stdout } = await execFileAsync26(
|
|
@@ -136559,7 +136590,7 @@ init_harmony_flag();
|
|
|
136559
136590
|
|
|
136560
136591
|
// ../tool-server/src/tools/devices/boot-electron.ts
|
|
136561
136592
|
var import_node_child_process37 = require("node:child_process");
|
|
136562
|
-
var
|
|
136593
|
+
var fs53 = __toESM(require("node:fs"));
|
|
136563
136594
|
var path45 = __toESM(require("node:path"));
|
|
136564
136595
|
init_src2();
|
|
136565
136596
|
init_device_info();
|
|
@@ -136602,7 +136633,7 @@ var DEFAULT_READY_TIMEOUT_MS = 3e4;
|
|
|
136602
136633
|
var BOOT_CONFIRM_WINDOW_MS = 300;
|
|
136603
136634
|
function resolveLauncher(appPath) {
|
|
136604
136635
|
const abs = path45.resolve(appPath);
|
|
136605
|
-
if (!
|
|
136636
|
+
if (!fs53.existsSync(abs)) {
|
|
136606
136637
|
throw new FailureError(`Electron boot: path does not exist: ${abs}`, {
|
|
136607
136638
|
error_code: FAILURE_CODES.CHROMIUM_ELECTRON_APP_PATH_INVALID,
|
|
136608
136639
|
failure_stage: "electron_app_path_missing",
|
|
@@ -136610,11 +136641,11 @@ function resolveLauncher(appPath) {
|
|
|
136610
136641
|
error_kind: "validation"
|
|
136611
136642
|
});
|
|
136612
136643
|
}
|
|
136613
|
-
const stat11 =
|
|
136644
|
+
const stat11 = fs53.statSync(abs);
|
|
136614
136645
|
if (stat11.isDirectory()) {
|
|
136615
136646
|
if (abs.endsWith(".app")) {
|
|
136616
136647
|
const macOsDir = path45.join(abs, "Contents", "MacOS");
|
|
136617
|
-
if (!
|
|
136648
|
+
if (!fs53.existsSync(macOsDir)) {
|
|
136618
136649
|
throw new FailureError(
|
|
136619
136650
|
`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
136651
|
{
|
|
@@ -136625,7 +136656,7 @@ function resolveLauncher(appPath) {
|
|
|
136625
136656
|
}
|
|
136626
136657
|
);
|
|
136627
136658
|
}
|
|
136628
|
-
const entries =
|
|
136659
|
+
const entries = fs53.readdirSync(macOsDir).filter((name) => !name.startsWith("."));
|
|
136629
136660
|
if (entries.length === 0) {
|
|
136630
136661
|
throw new FailureError(`Electron boot: ${macOsDir} is empty.`, {
|
|
136631
136662
|
error_code: FAILURE_CODES.CHROMIUM_ELECTRON_APP_PATH_INVALID,
|
|
@@ -136639,7 +136670,7 @@ function resolveLauncher(appPath) {
|
|
|
136639
136670
|
return { command: path45.join(macOsDir, exec), args: [] };
|
|
136640
136671
|
}
|
|
136641
136672
|
const localBin = path45.join(abs, "node_modules", ".bin", "electron");
|
|
136642
|
-
if (
|
|
136673
|
+
if (fs53.existsSync(localBin)) {
|
|
136643
136674
|
return { command: localBin, args: [abs] };
|
|
136644
136675
|
}
|
|
136645
136676
|
return { command: "electron", args: [abs] };
|
|
@@ -138855,7 +138886,11 @@ function makeIosImpl(registry2) {
|
|
|
138855
138886
|
params.bundleId,
|
|
138856
138887
|
...params.launchArgs ?? []
|
|
138857
138888
|
]),
|
|
138858
|
-
{
|
|
138889
|
+
{
|
|
138890
|
+
timeout: 3e4,
|
|
138891
|
+
killSignal: SIMCTL_KILL_SIGNAL,
|
|
138892
|
+
env: nativeDevtoolsLaunchEnv(nativeDevtools)
|
|
138893
|
+
}
|
|
138859
138894
|
);
|
|
138860
138895
|
} catch (err) {
|
|
138861
138896
|
if (err instanceof XcodeFirstLaunchPendingError) throw err;
|
|
@@ -139401,7 +139436,11 @@ function makeIosImpl2(registry2) {
|
|
|
139401
139436
|
await execFileAsync29(
|
|
139402
139437
|
"xcrun",
|
|
139403
139438
|
await simctlArgsForUdid(udid, ["launch", udid, bundleId, ...params.launchArgs ?? []]),
|
|
139404
|
-
{
|
|
139439
|
+
{
|
|
139440
|
+
timeout: 3e4,
|
|
139441
|
+
killSignal: SIMCTL_KILL_SIGNAL,
|
|
139442
|
+
env: nativeDevtoolsLaunchEnv(nativeDevtools)
|
|
139443
|
+
}
|
|
139405
139444
|
);
|
|
139406
139445
|
} catch (err) {
|
|
139407
139446
|
if (err instanceof XcodeFirstLaunchPendingError) throw err;
|
|
@@ -141071,7 +141110,7 @@ async function captureHarmonyScreenshotPng(opts) {
|
|
|
141071
141110
|
|
|
141072
141111
|
// ../tool-server/src/tools/screenshot/index.ts
|
|
141073
141112
|
init_capability();
|
|
141074
|
-
var
|
|
141113
|
+
var fs55 = __toESM(require("node:fs/promises"));
|
|
141075
141114
|
var execFileAsync36 = (0, import_node_util37.promisify)(import_node_child_process47.execFile);
|
|
141076
141115
|
var capability9 = {
|
|
141077
141116
|
apple: { simulator: true, device: true },
|
|
@@ -141089,7 +141128,7 @@ async function iosPhysicalScreenshot(registry2, device, scale) {
|
|
|
141089
141128
|
);
|
|
141090
141129
|
const ref = iosDeviceRunnerRef(device);
|
|
141091
141130
|
const runner = await registry2.resolveService(ref.urn, ref.options);
|
|
141092
|
-
await
|
|
141131
|
+
await fs55.writeFile(file2, await captureRunnerScreenshotPng(runner, RUNNER_COMMAND_TIMEOUT_MS));
|
|
141093
141132
|
await downscalePngInPlace(file2, scale);
|
|
141094
141133
|
return file2;
|
|
141095
141134
|
}
|
|
@@ -141129,7 +141168,7 @@ async function tvScreenshot(udid, scale, signal) {
|
|
|
141129
141168
|
} catch {
|
|
141130
141169
|
await capture(file2);
|
|
141131
141170
|
} finally {
|
|
141132
|
-
await
|
|
141171
|
+
await fs55.rm(jpeg, { force: true });
|
|
141133
141172
|
}
|
|
141134
141173
|
return file2;
|
|
141135
141174
|
}
|
|
@@ -141238,7 +141277,7 @@ Use when you need a baseline image or the screen state after a delay (interactio
|
|
|
141238
141277
|
`argent-macos-screenshot-${process.hrtime.bigint()}.png`
|
|
141239
141278
|
);
|
|
141240
141279
|
const png = await macosScreenshotPng(app, { scale: params.scale });
|
|
141241
|
-
await
|
|
141280
|
+
await fs55.writeFile(file2, params.scale === void 0 ? fitMacosDefaultSize(png) : png);
|
|
141242
141281
|
return registerHostCapture(ctx, params, file2, "Mac app");
|
|
141243
141282
|
}
|
|
141244
141283
|
if (isIosPhysicalDevice(device)) {
|
|
@@ -145925,7 +145964,7 @@ async function queryChromiumTree(registry2, device) {
|
|
|
145925
145964
|
}
|
|
145926
145965
|
|
|
145927
145966
|
// ../tool-server/src/utils/sub-invoke.ts
|
|
145928
|
-
var
|
|
145967
|
+
var import_node_crypto22 = require("node:crypto");
|
|
145929
145968
|
init_src2();
|
|
145930
145969
|
async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
145931
145970
|
const signal = ctx?.signal;
|
|
@@ -145942,7 +145981,7 @@ async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
|
145942
145981
|
if (!recordChildInvocation) {
|
|
145943
145982
|
return signal || Object.keys(forwarded).length > 0 ? registry2.invokeTool(toolId, args, { ...signal ? { signal } : {}, ...forwarded }) : registry2.invokeTool(toolId, args);
|
|
145944
145983
|
}
|
|
145945
|
-
const toolInvocationId = (0,
|
|
145984
|
+
const toolInvocationId = (0, import_node_crypto22.randomUUID)();
|
|
145946
145985
|
const release3 = recordChildInvocation(toolInvocationId, args);
|
|
145947
145986
|
try {
|
|
145948
145987
|
return await registry2.invokeTool(toolId, args, {
|
|
@@ -160608,14 +160647,14 @@ var import_node_child_process51 = require("node:child_process");
|
|
|
160608
160647
|
var import_node_util41 = require("node:util");
|
|
160609
160648
|
var fsp5 = __toESM(require("node:fs/promises"));
|
|
160610
160649
|
var path56 = __toESM(require("node:path"));
|
|
160611
|
-
var
|
|
160650
|
+
var import_node_crypto23 = require("node:crypto");
|
|
160612
160651
|
init_src2();
|
|
160613
160652
|
|
|
160614
160653
|
// ../tool-server/src/utils/ios-launch-time/workflow.ts
|
|
160615
160654
|
var import_node_child_process50 = require("node:child_process");
|
|
160616
160655
|
var import_node_util40 = require("node:util");
|
|
160617
160656
|
var import_promises23 = require("node:timers/promises");
|
|
160618
|
-
var
|
|
160657
|
+
var fs69 = __toESM(require("node:fs"));
|
|
160619
160658
|
var fsp4 = __toESM(require("node:fs/promises"));
|
|
160620
160659
|
var path55 = __toESM(require("node:path"));
|
|
160621
160660
|
init_src();
|
|
@@ -160721,7 +160760,7 @@ async function runLogged(command2, args, options) {
|
|
|
160721
160760
|
options.signal?.throwIfAborted();
|
|
160722
160761
|
await fsp4.mkdir(path55.dirname(options.logPath), { recursive: true });
|
|
160723
160762
|
options.signal?.throwIfAborted();
|
|
160724
|
-
const log2 =
|
|
160763
|
+
const log2 = fs69.createWriteStream(options.logPath);
|
|
160725
160764
|
const child = (0, import_node_child_process50.spawn)(command2, args, {
|
|
160726
160765
|
cwd: options.cwd,
|
|
160727
160766
|
env: options.env ?? process.env,
|
|
@@ -161191,7 +161230,7 @@ async function measurePreparedLaunch(context2, ctx) {
|
|
|
161191
161230
|
const runnerSigning = context2.simulator ? null : await resolveRunnerSigningConfig(context2.deviceId);
|
|
161192
161231
|
const runnerBundleId = runnerSigning?.appBundleId ?? "com.argent.runner.tsimulator";
|
|
161193
161232
|
const testBundleId = runnerSigning?.testBundleId ?? `${runnerBundleId}.uitests`;
|
|
161194
|
-
const runnerBuildKey = (0,
|
|
161233
|
+
const runnerBuildKey = (0, import_node_crypto23.createHash)("sha256").update(
|
|
161195
161234
|
[
|
|
161196
161235
|
// Builds for two simulators, or two iPhones, are the same build.
|
|
161197
161236
|
context2.simulator ? "iOS Simulator" : "iOS",
|
|
@@ -161330,7 +161369,7 @@ async function measurePreparedLaunch(context2, ctx) {
|
|
|
161330
161369
|
|
|
161331
161370
|
// ../tool-server/src/tools/profiler/native-profiler/launch-analysis/profile.ts
|
|
161332
161371
|
var import_node_child_process52 = require("node:child_process");
|
|
161333
|
-
var
|
|
161372
|
+
var import_node_crypto24 = require("node:crypto");
|
|
161334
161373
|
var import_node_util42 = require("node:util");
|
|
161335
161374
|
var fsp6 = __toESM(require("node:fs/promises"));
|
|
161336
161375
|
var path57 = __toESM(require("node:path"));
|
|
@@ -161578,7 +161617,7 @@ var TABLE_XPATH = (schema) => `/trace-toc/run[@number="1"]/data/table[@schema="$
|
|
|
161578
161617
|
async function writeProfilerSession(xml) {
|
|
161579
161618
|
const debugDir = await getDebugDir();
|
|
161580
161619
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:]/g, "").replace("T", "-").slice(0, 15);
|
|
161581
|
-
const sessionId = `${timestamp}-launch-${(0,
|
|
161620
|
+
const sessionId = `${timestamp}-launch-${(0, import_node_crypto24.randomUUID)()}`;
|
|
161582
161621
|
const cpuXmlPath = path57.join(debugDir, `native-profiler-${sessionId}_raw_cpu.xml`);
|
|
161583
161622
|
await fsp6.writeFile(cpuXmlPath, xml, { flag: "wx" });
|
|
161584
161623
|
return { sessionId, cpuXmlPath };
|
|
@@ -161904,9 +161943,9 @@ init_zod();
|
|
|
161904
161943
|
|
|
161905
161944
|
// ../tool-server/src/utils/ios-audio.ts
|
|
161906
161945
|
var import_node_child_process53 = require("node:child_process");
|
|
161907
|
-
var
|
|
161946
|
+
var fs70 = __toESM(require("node:fs"));
|
|
161908
161947
|
var path58 = __toESM(require("node:path"));
|
|
161909
|
-
var
|
|
161948
|
+
var import_node_crypto25 = require("node:crypto");
|
|
161910
161949
|
var import_node_util43 = require("node:util");
|
|
161911
161950
|
init_src2();
|
|
161912
161951
|
init_capability();
|
|
@@ -161925,12 +161964,12 @@ function createAudioSession(udid) {
|
|
|
161925
161964
|
}
|
|
161926
161965
|
function writeAtomic(file2, text) {
|
|
161927
161966
|
const tmp = path58.join(path58.dirname(file2), `.${path58.basename(file2)}.${process.pid}.tmp`);
|
|
161928
|
-
|
|
161929
|
-
|
|
161967
|
+
fs70.writeFileSync(tmp, text);
|
|
161968
|
+
fs70.renameSync(tmp, file2);
|
|
161930
161969
|
}
|
|
161931
161970
|
async function ensureAudioEnv(session) {
|
|
161932
161971
|
const { dir } = session;
|
|
161933
|
-
|
|
161972
|
+
fs70.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
161934
161973
|
if (session.envVerified) return;
|
|
161935
161974
|
const dylib = requireAudioDylib();
|
|
161936
161975
|
const { nativeId, prefix } = await simctlTargetForUdid(session.udid, {
|
|
@@ -162020,7 +162059,7 @@ function parseAppStatus(text) {
|
|
|
162020
162059
|
function readAppStatus(session, bundleId) {
|
|
162021
162060
|
let text;
|
|
162022
162061
|
try {
|
|
162023
|
-
text =
|
|
162062
|
+
text = fs70.readFileSync(path58.join(session.dir, `st.${bundleId}`), "utf8");
|
|
162024
162063
|
} catch {
|
|
162025
162064
|
return null;
|
|
162026
162065
|
}
|
|
@@ -162036,7 +162075,7 @@ function decideHookState(status, pidAlive2, runningPid) {
|
|
|
162036
162075
|
async function readAppHook(session, bundleId) {
|
|
162037
162076
|
let text;
|
|
162038
162077
|
try {
|
|
162039
|
-
text =
|
|
162078
|
+
text = fs70.readFileSync(path58.join(session.dir, `st.${bundleId}`), "utf8");
|
|
162040
162079
|
} catch {
|
|
162041
162080
|
return { state: "none", status: null };
|
|
162042
162081
|
}
|
|
@@ -162050,14 +162089,14 @@ async function readAppHook(session, bundleId) {
|
|
|
162050
162089
|
function listLiveApps(session) {
|
|
162051
162090
|
let names;
|
|
162052
162091
|
try {
|
|
162053
|
-
names =
|
|
162092
|
+
names = fs70.readdirSync(session.dir);
|
|
162054
162093
|
} catch {
|
|
162055
162094
|
return [];
|
|
162056
162095
|
}
|
|
162057
162096
|
return names.filter((name) => name.startsWith("st.") && !name.endsWith(".tmp")).map((name) => name.slice(3)).filter((bundleId) => readAppStatus(session, bundleId) !== null);
|
|
162058
162097
|
}
|
|
162059
162098
|
async function convertClip(inputPath, outputPath2) {
|
|
162060
|
-
if (!
|
|
162099
|
+
if (!fs70.existsSync(inputPath)) {
|
|
162061
162100
|
throw new InvalidToolInputError(`Audio file not found: ${inputPath}`);
|
|
162062
162101
|
}
|
|
162063
162102
|
try {
|
|
@@ -162080,13 +162119,13 @@ async function convertClip(inputPath, outputPath2) {
|
|
|
162080
162119
|
}
|
|
162081
162120
|
}
|
|
162082
162121
|
function removeFiles(dir, prefix, keep) {
|
|
162083
|
-
for (const name of
|
|
162084
|
-
if (name.startsWith(prefix) && name !== keep)
|
|
162122
|
+
for (const name of fs70.readdirSync(dir)) {
|
|
162123
|
+
if (name.startsWith(prefix) && name !== keep) fs70.rmSync(path58.join(dir, name), { force: true });
|
|
162085
162124
|
}
|
|
162086
162125
|
}
|
|
162087
162126
|
async function setAudioInput(session, source) {
|
|
162088
162127
|
const { dir } = session;
|
|
162089
|
-
|
|
162128
|
+
fs70.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
162090
162129
|
let feederSource;
|
|
162091
162130
|
let clipName;
|
|
162092
162131
|
let durationMs;
|
|
@@ -162096,7 +162135,7 @@ async function setAudioInput(session, source) {
|
|
|
162096
162135
|
clipName = `clip-${process.pid}-${Date.now()}.wav`;
|
|
162097
162136
|
const clipPath = path58.join(dir, clipName);
|
|
162098
162137
|
await convertClip(source.path, clipPath);
|
|
162099
|
-
const fd =
|
|
162138
|
+
const fd = fs70.openSync(clipPath, "r");
|
|
162100
162139
|
try {
|
|
162101
162140
|
const info = readClipInfo(fd);
|
|
162102
162141
|
if (info.frames > MAX_CLIP_SECONDS * STREAM_RATE) {
|
|
@@ -162107,13 +162146,13 @@ async function setAudioInput(session, source) {
|
|
|
162107
162146
|
feederSource = { kind: "clip", fd, info, plays: source.plays };
|
|
162108
162147
|
durationMs = Math.round(info.frames * 1e3 / STREAM_RATE);
|
|
162109
162148
|
} catch (err) {
|
|
162110
|
-
|
|
162111
|
-
|
|
162149
|
+
fs70.closeSync(fd);
|
|
162150
|
+
fs70.rmSync(clipPath, { force: true });
|
|
162112
162151
|
throw err;
|
|
162113
162152
|
}
|
|
162114
162153
|
}
|
|
162115
162154
|
let feeder = session.feeder;
|
|
162116
|
-
if (feeder?.running && !
|
|
162155
|
+
if (feeder?.running && !fs70.existsSync(feeder.ringPath)) {
|
|
162117
162156
|
feeder.stop();
|
|
162118
162157
|
feeder = null;
|
|
162119
162158
|
}
|
|
@@ -162122,7 +162161,7 @@ async function setAudioInput(session, source) {
|
|
|
162122
162161
|
} else {
|
|
162123
162162
|
removeFiles(dir, `in-${process.pid}-`);
|
|
162124
162163
|
feeder = new InputFeeder(
|
|
162125
|
-
path58.join(dir, `in-${process.pid}-${(0,
|
|
162164
|
+
path58.join(dir, `in-${process.pid}-${(0, import_node_crypto25.randomUUID)().slice(0, 8)}.ring`),
|
|
162126
162165
|
feederSource
|
|
162127
162166
|
);
|
|
162128
162167
|
feeder.start();
|
|
@@ -162132,7 +162171,7 @@ async function setAudioInput(session, source) {
|
|
|
162132
162171
|
const control = `source=stream
|
|
162133
162172
|
ring=${feeder.ringPath}
|
|
162134
162173
|
${OWNER_LINE}`;
|
|
162135
|
-
if (!
|
|
162174
|
+
if (!fs70.existsSync(inputFile) || fs70.readFileSync(inputFile, "utf8") !== control) {
|
|
162136
162175
|
writeAtomic(inputFile, control);
|
|
162137
162176
|
}
|
|
162138
162177
|
removeFiles(dir, `clip-${process.pid}-`, clipName);
|
|
@@ -162142,15 +162181,15 @@ function clearAudioInput(session, ownedOnly = false) {
|
|
|
162142
162181
|
const { dir } = session;
|
|
162143
162182
|
session.feeder?.stop();
|
|
162144
162183
|
session.feeder = null;
|
|
162145
|
-
if (!
|
|
162184
|
+
if (!fs70.existsSync(dir)) return;
|
|
162146
162185
|
const inputFile = path58.join(dir, "input");
|
|
162147
|
-
if (!ownedOnly || ownsInput(inputFile))
|
|
162186
|
+
if (!ownedOnly || ownsInput(inputFile)) fs70.rmSync(inputFile, { force: true });
|
|
162148
162187
|
removeFiles(dir, `clip-${process.pid}-`);
|
|
162149
162188
|
removeFiles(dir, `in-${process.pid}-`);
|
|
162150
162189
|
}
|
|
162151
162190
|
function ownsInput(inputFile) {
|
|
162152
162191
|
try {
|
|
162153
|
-
return
|
|
162192
|
+
return fs70.readFileSync(inputFile, "utf8").split("\n").includes(OWNER_LINE.trim());
|
|
162154
162193
|
} catch {
|
|
162155
162194
|
return false;
|
|
162156
162195
|
}
|
|
@@ -162172,10 +162211,10 @@ function releaseAudio(session) {
|
|
|
162172
162211
|
}
|
|
162173
162212
|
|
|
162174
162213
|
// ../tool-server/src/utils/ios-audio-remote.ts
|
|
162175
|
-
var
|
|
162214
|
+
var fs71 = __toESM(require("node:fs"));
|
|
162176
162215
|
var net13 = __toESM(require("node:net"));
|
|
162177
162216
|
var path59 = __toESM(require("node:path"));
|
|
162178
|
-
var
|
|
162217
|
+
var import_node_crypto26 = require("node:crypto");
|
|
162179
162218
|
init_src2();
|
|
162180
162219
|
init_device_info();
|
|
162181
162220
|
init_capability();
|
|
@@ -162348,7 +162387,7 @@ async function startFeeder(session) {
|
|
|
162348
162387
|
const stale = session.link;
|
|
162349
162388
|
session.link = null;
|
|
162350
162389
|
await stale?.close();
|
|
162351
|
-
const token = (0,
|
|
162390
|
+
const token = (0, import_node_crypto26.randomBytes)(12).toString("hex");
|
|
162352
162391
|
const server = net13.createServer();
|
|
162353
162392
|
await new Promise((resolve24, reject) => {
|
|
162354
162393
|
server.once("error", reject);
|
|
@@ -162418,12 +162457,12 @@ async function setRemoteAudioInput(session, source) {
|
|
|
162418
162457
|
}
|
|
162419
162458
|
let bytes;
|
|
162420
162459
|
try {
|
|
162421
|
-
if (
|
|
162460
|
+
if (fs71.statSync(source.path).size > MAX_FILE_BYTES) {
|
|
162422
162461
|
throw new InvalidToolInputError(
|
|
162423
162462
|
`${source.path} is larger than ${MAX_FILE_BYTES / 1024 / 1024} MB.`
|
|
162424
162463
|
);
|
|
162425
162464
|
}
|
|
162426
|
-
bytes =
|
|
162465
|
+
bytes = fs71.readFileSync(source.path);
|
|
162427
162466
|
} catch (err) {
|
|
162428
162467
|
if (err instanceof InvalidToolInputError) throw err;
|
|
162429
162468
|
throw new InvalidToolInputError(`Audio file not found: ${source.path}`);
|
|
@@ -167270,14 +167309,14 @@ init_src2();
|
|
|
167270
167309
|
init_capability();
|
|
167271
167310
|
|
|
167272
167311
|
// ../tool-server/src/tools/flows/flow-script-step.ts
|
|
167273
|
-
var
|
|
167312
|
+
var fs82 = __toESM(require("node:fs/promises"));
|
|
167274
167313
|
var path65 = __toESM(require("node:path"));
|
|
167275
167314
|
var import_node_url4 = require("node:url");
|
|
167276
167315
|
init_src2();
|
|
167277
167316
|
|
|
167278
167317
|
// ../tool-server/src/tools/flows/script/flow-script-executor.ts
|
|
167279
167318
|
var import_node_child_process55 = require("node:child_process");
|
|
167280
|
-
var
|
|
167319
|
+
var fs81 = __toESM(require("node:fs"));
|
|
167281
167320
|
var os17 = __toESM(require("node:os"));
|
|
167282
167321
|
var path64 = __toESM(require("node:path"));
|
|
167283
167322
|
var import_node_string_decoder = require("node:string_decoder");
|
|
@@ -168043,7 +168082,7 @@ function describeDirectoryProblem(candidate) {
|
|
|
168043
168082
|
}
|
|
168044
168083
|
if (candidate.split(/[\\/]+/).includes("..")) return 'contains a ".." segment';
|
|
168045
168084
|
try {
|
|
168046
|
-
return
|
|
168085
|
+
return fs81.statSync(candidate).isDirectory() ? null : "is not a directory";
|
|
168047
168086
|
} catch {
|
|
168048
168087
|
return "does not exist";
|
|
168049
168088
|
}
|
|
@@ -168068,7 +168107,7 @@ function encodeRequestOutput(output2) {
|
|
|
168068
168107
|
}
|
|
168069
168108
|
function realPathOrSelf(candidate) {
|
|
168070
168109
|
try {
|
|
168071
|
-
return
|
|
168110
|
+
return fs81.realpathSync(candidate);
|
|
168072
168111
|
} catch {
|
|
168073
168112
|
return candidate;
|
|
168074
168113
|
}
|
|
@@ -168077,7 +168116,7 @@ var TYPELESS_PACKAGE_WARNING_FLAG = "--disable-warning=MODULE_TYPELESS_PACKAGE_J
|
|
|
168077
168116
|
function resolveRunnerPath(runnerDir) {
|
|
168078
168117
|
const dir = runnerDir ?? __dirname;
|
|
168079
168118
|
const runner = path64.join(dir, RUNNER_FILE);
|
|
168080
|
-
if (!
|
|
168119
|
+
if (!fs81.existsSync(runner)) {
|
|
168081
168120
|
throw new ScriptSetupError(
|
|
168082
168121
|
"spawn",
|
|
168083
168122
|
`The script runner is missing from this installation (looked for ${runner}).`
|
|
@@ -168725,7 +168764,7 @@ function scriptRan(result) {
|
|
|
168725
168764
|
}
|
|
168726
168765
|
async function scriptFileProblem(canonical) {
|
|
168727
168766
|
try {
|
|
168728
|
-
const stat11 = await
|
|
168767
|
+
const stat11 = await fs82.stat(canonical);
|
|
168729
168768
|
return stat11.isFile() ? null : "is not a file";
|
|
168730
168769
|
} catch (err) {
|
|
168731
168770
|
const code = err.code;
|
|
@@ -168879,7 +168918,7 @@ Returns \`{ message, e2eTestFile, savedTo, restarted?, discardedSteps?, fragment
|
|
|
168879
168918
|
|
|
168880
168919
|
// ../tool-server/src/tools/flows/flow-add-step.ts
|
|
168881
168920
|
init_zod();
|
|
168882
|
-
var
|
|
168921
|
+
var fs85 = __toESM(require("node:fs/promises"));
|
|
168883
168922
|
var path69 = __toESM(require("node:path"));
|
|
168884
168923
|
init_src2();
|
|
168885
168924
|
|
|
@@ -169696,7 +169735,7 @@ function supportsFlowTree(platform) {
|
|
|
169696
169735
|
}
|
|
169697
169736
|
|
|
169698
169737
|
// ../tool-server/src/tools/flows/flow-pixels.ts
|
|
169699
|
-
var
|
|
169738
|
+
var fs83 = __toESM(require("node:fs/promises"));
|
|
169700
169739
|
var os18 = __toESM(require("node:os"));
|
|
169701
169740
|
var path66 = __toESM(require("node:path"));
|
|
169702
169741
|
var import_pngjs5 = __toESM(require_png());
|
|
@@ -169789,7 +169828,7 @@ async function captureIosDeviceFile(env, budgetMs) {
|
|
|
169789
169828
|
os18.tmpdir(),
|
|
169790
169829
|
`argent-ios-device-settle-${env.device.id.slice(0, 8)}-${process.hrtime.bigint()}.png`
|
|
169791
169830
|
);
|
|
169792
|
-
await
|
|
169831
|
+
await fs83.writeFile(file2, png);
|
|
169793
169832
|
await downscalePngInPlace(file2, CAPTURE_SCALE, captureAbortSignal(env, budgetMs));
|
|
169794
169833
|
return file2;
|
|
169795
169834
|
}
|
|
@@ -169803,9 +169842,9 @@ async function capturePng(env, budgetMs) {
|
|
|
169803
169842
|
}
|
|
169804
169843
|
const { path: file2, warning } = await captureFile(env, budgetMs);
|
|
169805
169844
|
try {
|
|
169806
|
-
return { png: await
|
|
169845
|
+
return { png: await fs83.readFile(file2), ...warning !== void 0 ? { warning } : {} };
|
|
169807
169846
|
} finally {
|
|
169808
|
-
await
|
|
169847
|
+
await fs83.rm(file2, { force: true }).catch(() => {
|
|
169809
169848
|
});
|
|
169810
169849
|
}
|
|
169811
169850
|
}
|
|
@@ -170994,7 +171033,7 @@ var path68 = __toESM(require("node:path"));
|
|
|
170994
171033
|
init_src2();
|
|
170995
171034
|
|
|
170996
171035
|
// ../tool-server/src/tools/flows/project-access.ts
|
|
170997
|
-
var
|
|
171036
|
+
var fs84 = __toESM(require("node:fs/promises"));
|
|
170998
171037
|
var path67 = __toESM(require("node:path"));
|
|
170999
171038
|
init_src2();
|
|
171000
171039
|
async function resolveRunTarget(project, anchorDir, target) {
|
|
@@ -171005,7 +171044,7 @@ async function resolveRunTarget(project, anchorDir, target) {
|
|
|
171005
171044
|
const other = await project.resolveFlowFile(dir, target);
|
|
171006
171045
|
if (other.spelling.state === "absent") continue;
|
|
171007
171046
|
if (other.spelling.state === "case_folded") return { ...other, anchorDir: dir };
|
|
171008
|
-
const found = project.mode === "host" ? await
|
|
171047
|
+
const found = project.mode === "host" ? await fs84.stat(other.canonical).then(
|
|
171009
171048
|
() => true,
|
|
171010
171049
|
() => false
|
|
171011
171050
|
) : await other.read() !== null;
|
|
@@ -171062,7 +171101,7 @@ var HostProjectAccess = class {
|
|
|
171062
171101
|
spelling,
|
|
171063
171102
|
read: async () => {
|
|
171064
171103
|
try {
|
|
171065
|
-
return await
|
|
171104
|
+
return await fs84.readFile(canonical, "utf8");
|
|
171066
171105
|
} catch (err) {
|
|
171067
171106
|
if (!isEnoent(err)) throw err;
|
|
171068
171107
|
return null;
|
|
@@ -171072,19 +171111,19 @@ var HostProjectAccess = class {
|
|
|
171072
171111
|
}
|
|
171073
171112
|
async readFile(filePath) {
|
|
171074
171113
|
try {
|
|
171075
|
-
return await
|
|
171114
|
+
return await fs84.readFile(filePath);
|
|
171076
171115
|
} catch (err) {
|
|
171077
171116
|
if (!isNothingThere(err)) throw err;
|
|
171078
171117
|
return null;
|
|
171079
171118
|
}
|
|
171080
171119
|
}
|
|
171081
171120
|
async writeBaseline(filePath, bytes) {
|
|
171082
|
-
const replaced = await
|
|
171121
|
+
const replaced = await fs84.access(filePath).then(
|
|
171083
171122
|
() => true,
|
|
171084
171123
|
() => false
|
|
171085
171124
|
);
|
|
171086
|
-
await
|
|
171087
|
-
await
|
|
171125
|
+
await fs84.mkdir(path67.dirname(filePath), { recursive: true });
|
|
171126
|
+
await fs84.writeFile(filePath, bytes);
|
|
171088
171127
|
return { replaced };
|
|
171089
171128
|
}
|
|
171090
171129
|
};
|
|
@@ -171174,7 +171213,7 @@ var ClientProjectAccess = class {
|
|
|
171174
171213
|
const member = this.file(filePath);
|
|
171175
171214
|
if (member === void 0 || member.state === "missing") return null;
|
|
171176
171215
|
if (member.state === "present" && member.hostPath !== void 0) {
|
|
171177
|
-
return
|
|
171216
|
+
return fs84.readFile(member.hostPath);
|
|
171178
171217
|
}
|
|
171179
171218
|
throw clientRefusal(
|
|
171180
171219
|
filePath,
|
|
@@ -171915,7 +171954,7 @@ async function captureTapSelector(registry2, session, udid, point, block) {
|
|
|
171915
171954
|
async function activeFlowState(session, block) {
|
|
171916
171955
|
if (session.persist === "host") {
|
|
171917
171956
|
try {
|
|
171918
|
-
adoptRecordedFile(session, parseFlow(await
|
|
171957
|
+
adoptRecordedFile(session, parseFlow(await fs85.readFile(session.filePath, "utf8")));
|
|
171919
171958
|
} catch (err) {
|
|
171920
171959
|
return {
|
|
171921
171960
|
stepCount: recordedCount(session.flow, block),
|
|
@@ -172592,7 +172631,7 @@ var flowSetVarsTool = {
|
|
|
172592
172631
|
init_zod();
|
|
172593
172632
|
var nodePath = __toESM(require("node:path"));
|
|
172594
172633
|
init_src2();
|
|
172595
|
-
var
|
|
172634
|
+
var fs86 = __toESM(require("node:fs/promises"));
|
|
172596
172635
|
init_capability();
|
|
172597
172636
|
init_device_info();
|
|
172598
172637
|
var OUTPUT_RENDER_LIMIT_BYTES = 64 * 1024;
|
|
@@ -172606,7 +172645,7 @@ async function recordedStepCount(session, block) {
|
|
|
172606
172645
|
}
|
|
172607
172646
|
async function recordedFileVars(session) {
|
|
172608
172647
|
try {
|
|
172609
|
-
return parseFlow(await
|
|
172648
|
+
return parseFlow(await fs86.readFile(session.filePath, "utf8")).vars;
|
|
172610
172649
|
} catch (err) {
|
|
172611
172650
|
throw wrapFailure(
|
|
172612
172651
|
err,
|
|
@@ -172781,7 +172820,7 @@ Returns \`{ status, reason?, outputJson?, stepCount, recorded? }\`. A failed scr
|
|
|
172781
172820
|
|
|
172782
172821
|
// ../tool-server/src/tools/flows/flow-finish-recording.ts
|
|
172783
172822
|
init_zod();
|
|
172784
|
-
var
|
|
172823
|
+
var fs87 = __toESM(require("node:fs/promises"));
|
|
172785
172824
|
function attachStepWarnings(summary, warnings) {
|
|
172786
172825
|
if (warnings.size === 0) return summary;
|
|
172787
172826
|
return summary.flatMap((line, i) => {
|
|
@@ -172864,7 +172903,7 @@ Returns \`{ message, path, steps, shutdownSteps?, fragmentShutdown?, summary, e2
|
|
|
172864
172903
|
flowFile2 = serializeFlow(session.flow);
|
|
172865
172904
|
savedTo2 = clientFileDirective(filePath2, flowFile2);
|
|
172866
172905
|
} else {
|
|
172867
|
-
flowFile2 = await
|
|
172906
|
+
flowFile2 = await fs87.readFile(filePath2, "utf8");
|
|
172868
172907
|
savedTo2 = filePath2;
|
|
172869
172908
|
}
|
|
172870
172909
|
const flow2 = parseFlow(flowFile2);
|
|
@@ -172915,12 +172954,12 @@ Returns \`{ message, path, steps, shutdownSteps?, fragmentShutdown?, summary, e2
|
|
|
172915
172954
|
|
|
172916
172955
|
// ../tool-server/src/tools/flows/flow-run.ts
|
|
172917
172956
|
init_zod();
|
|
172918
|
-
var
|
|
172957
|
+
var fs91 = __toESM(require("node:fs/promises"));
|
|
172919
172958
|
var path73 = __toESM(require("node:path"));
|
|
172920
172959
|
init_src2();
|
|
172921
172960
|
|
|
172922
172961
|
// ../tool-server/src/tools/flows/flow-preflight.ts
|
|
172923
|
-
var
|
|
172962
|
+
var fs88 = __toESM(require("node:fs/promises"));
|
|
172924
172963
|
var path70 = __toESM(require("node:path"));
|
|
172925
172964
|
init_src2();
|
|
172926
172965
|
function* walkSteps(steps, within3 = "", levels = [], label = "step") {
|
|
@@ -173368,7 +173407,7 @@ async function readNestedTest(project, target, toolName) {
|
|
|
173368
173407
|
}
|
|
173369
173408
|
const canonical = await canonicalFlowPath(filePath);
|
|
173370
173409
|
try {
|
|
173371
|
-
return { canonical, flowName, text: await
|
|
173410
|
+
return { canonical, flowName, text: await fs88.readFile(canonical, "utf8") };
|
|
173372
173411
|
} catch (err) {
|
|
173373
173412
|
return { refusal: errMsg5(err) };
|
|
173374
173413
|
}
|
|
@@ -173455,8 +173494,8 @@ init_device_info();
|
|
|
173455
173494
|
init_capability();
|
|
173456
173495
|
|
|
173457
173496
|
// ../tool-server/src/tools/flows/flow-visual.ts
|
|
173458
|
-
var
|
|
173459
|
-
var
|
|
173497
|
+
var import_node_crypto27 = require("node:crypto");
|
|
173498
|
+
var fs90 = __toESM(require("node:fs/promises"));
|
|
173460
173499
|
var os19 = __toESM(require("node:os"));
|
|
173461
173500
|
var path72 = __toESM(require("node:path"));
|
|
173462
173501
|
var import_pngjs7 = __toESM(require_png());
|
|
@@ -175501,7 +175540,7 @@ function roundToOne(value) {
|
|
|
175501
175540
|
// ../tool-server/src/tools/flows/flow-visual.ts
|
|
175502
175541
|
var DEFAULT_MAX_MISMATCH = 0.5;
|
|
175503
175542
|
async function pngDimensions(file2) {
|
|
175504
|
-
const fh = await
|
|
175543
|
+
const fh = await fs90.open(file2, "r");
|
|
175505
175544
|
try {
|
|
175506
175545
|
const buf = Buffer.alloc(24);
|
|
175507
175546
|
await fh.read(buf, 0, 24, 0);
|
|
@@ -175533,12 +175572,12 @@ function baselineDir(flowsDir, flowName) {
|
|
|
175533
175572
|
async function cleanupDiffDir(dir, keep) {
|
|
175534
175573
|
try {
|
|
175535
175574
|
if (!keep) {
|
|
175536
|
-
await
|
|
175575
|
+
await fs90.rm(dir, { recursive: true, force: true });
|
|
175537
175576
|
return;
|
|
175538
175577
|
}
|
|
175539
|
-
for (const entry of await
|
|
175578
|
+
for (const entry of await fs90.readdir(dir)) {
|
|
175540
175579
|
const entryPath = path72.join(dir, entry);
|
|
175541
|
-
if (entryPath !== keep) await
|
|
175580
|
+
if (entryPath !== keep) await fs90.rm(entryPath, { recursive: true, force: true });
|
|
175542
175581
|
}
|
|
175543
175582
|
} catch {
|
|
175544
175583
|
}
|
|
@@ -175549,7 +175588,7 @@ function namingClientBaseline(err, copy, clientPath) {
|
|
|
175549
175588
|
return new FailureError(err.message.split(copy).join(clientPath), signal);
|
|
175550
175589
|
}
|
|
175551
175590
|
async function cropPngFile(src, dest, frame2) {
|
|
175552
|
-
const png = import_pngjs7.PNG.sync.read(await
|
|
175591
|
+
const png = import_pngjs7.PNG.sync.read(await fs90.readFile(src));
|
|
175553
175592
|
const left = Math.max(0, Math.round(frame2.x * png.width));
|
|
175554
175593
|
const top = Math.max(0, Math.round(frame2.y * png.height));
|
|
175555
175594
|
const right = Math.min(png.width, Math.round((frame2.x + frame2.width) * png.width));
|
|
@@ -175559,7 +175598,7 @@ async function cropPngFile(src, dest, frame2) {
|
|
|
175559
175598
|
if (w < 1 || h < 1) return null;
|
|
175560
175599
|
const out = new import_pngjs7.PNG({ width: w, height: h });
|
|
175561
175600
|
import_pngjs7.PNG.bitblt(png, out, left, top, w, h, 0, 0);
|
|
175562
|
-
await
|
|
175601
|
+
await fs90.writeFile(dest, import_pngjs7.PNG.sync.write(out));
|
|
175563
175602
|
return { w, h };
|
|
175564
175603
|
}
|
|
175565
175604
|
async function warmSnapshotCapture(registry2, device) {
|
|
@@ -175601,7 +175640,7 @@ async function runSnapshot(env, opts) {
|
|
|
175601
175640
|
});
|
|
175602
175641
|
let captureWarned = shot.warning !== void 0 ? { warning: shot.warning } : {};
|
|
175603
175642
|
const { w, h } = await pngDimensions(shot.image.hostPath);
|
|
175604
|
-
const cropSuffix = opts.cropOn === void 0 ? "" : `-crop-${(0,
|
|
175643
|
+
const cropSuffix = opts.cropOn === void 0 ? "" : `-crop-${(0, import_node_crypto27.createHash)("sha256").update(cropIdentity(opts.cropOn)).digest("hex").slice(0, 8)}`;
|
|
175605
175644
|
const keyFor = (width, height) => `${opts.name}__${authoringPlatform(env.device.platform)}-${width}x${height}${cropSuffix}`;
|
|
175606
175645
|
const baselineFor = (file2) => opts.clientFlowPath === void 0 ? path72.join(baselineDir(opts.flowsDir, opts.flowName), file2) : clientBaselinePath(opts.clientFlowPath, opts.flowName, file2);
|
|
175607
175646
|
const snapshotKey = keyFor(w, h);
|
|
@@ -175634,9 +175673,9 @@ async function runSnapshot(env, opts) {
|
|
|
175634
175673
|
let keepBaselineCopy = false;
|
|
175635
175674
|
const hostBaseline = async (bytes) => {
|
|
175636
175675
|
if (opts.clientFlowPath === void 0) return baselinePath;
|
|
175637
|
-
baselineCopyDir = await
|
|
175676
|
+
baselineCopyDir = await fs90.mkdtemp(path72.join(os19.tmpdir(), "argent-e2e-baseline-"));
|
|
175638
175677
|
const copy = path72.join(baselineCopyDir, key2);
|
|
175639
|
-
await
|
|
175678
|
+
await fs90.writeFile(copy, bytes);
|
|
175640
175679
|
return copy;
|
|
175641
175680
|
};
|
|
175642
175681
|
const baselineArtifact = (hostPath) => {
|
|
@@ -175645,7 +175684,7 @@ async function runSnapshot(env, opts) {
|
|
|
175645
175684
|
};
|
|
175646
175685
|
try {
|
|
175647
175686
|
if (cropFrame !== void 0) {
|
|
175648
|
-
cropDir = await
|
|
175687
|
+
cropDir = await fs90.mkdtemp(path72.join(os19.tmpdir(), "argent-e2e-crop-"));
|
|
175649
175688
|
const croppedPath = path72.join(cropDir, key2);
|
|
175650
175689
|
const cropped = await cropPngFile(shot.image.hostPath, croppedPath, cropFrame);
|
|
175651
175690
|
if (cropped === null) {
|
|
@@ -175663,7 +175702,7 @@ async function runSnapshot(env, opts) {
|
|
|
175663
175702
|
if (opts.updateBaselines) {
|
|
175664
175703
|
const { replaced } = await opts.project.writeBaseline(
|
|
175665
175704
|
baselinePath,
|
|
175666
|
-
await
|
|
175705
|
+
await fs90.readFile(currentPath)
|
|
175667
175706
|
);
|
|
175668
175707
|
const source = env.device.platform === "ios-remote" ? " from a remote simulator" : "";
|
|
175669
175708
|
if (opts.clientFlowPath !== void 0) {
|
|
@@ -175703,7 +175742,7 @@ async function runSnapshot(env, opts) {
|
|
|
175703
175742
|
const legacyPath = baselineFor(legacyKey);
|
|
175704
175743
|
const legacy = await readBaseline(legacyPath);
|
|
175705
175744
|
if (legacy !== null) {
|
|
175706
|
-
cropDir ??= await
|
|
175745
|
+
cropDir ??= await fs90.mkdtemp(path72.join(os19.tmpdir(), "argent-e2e-crop-"));
|
|
175707
175746
|
const turnedPath = path72.join(cropDir, `native-${legacyKey}`);
|
|
175708
175747
|
await turnPngToNative(currentPath, turnedPath, sideways);
|
|
175709
175748
|
currentPath = turnedPath;
|
|
@@ -175765,7 +175804,7 @@ async function runSnapshot(env, opts) {
|
|
|
175765
175804
|
baseline: await baselineArtifact(localBaseline),
|
|
175766
175805
|
current: await currentArtifact()
|
|
175767
175806
|
};
|
|
175768
|
-
outputDir = await
|
|
175807
|
+
outputDir = await fs90.mkdtemp(path72.join(os19.tmpdir(), "argent-e2e-diff-"));
|
|
175769
175808
|
const contextDiffPath = path72.join(outputDir, `${snapshotKey}-diff.png`);
|
|
175770
175809
|
if (await writeContextDiff(result, contextDiffPath)) {
|
|
175771
175810
|
artifacts.diff = await store.register({
|
|
@@ -175798,7 +175837,7 @@ async function sidewaysOrientation(env) {
|
|
|
175798
175837
|
return orientation === "landscapeLeft" || orientation === "landscapeRight" ? orientation : void 0;
|
|
175799
175838
|
}
|
|
175800
175839
|
async function turnPngToNative(src, dest, orientation) {
|
|
175801
|
-
const upright = import_pngjs7.PNG.sync.read(await
|
|
175840
|
+
const upright = import_pngjs7.PNG.sync.read(await fs90.readFile(src));
|
|
175802
175841
|
const native = new import_pngjs7.PNG({ width: upright.height, height: upright.width });
|
|
175803
175842
|
for (let y = 0; y < native.height; y++) {
|
|
175804
175843
|
for (let x = 0; x < native.width; x++) {
|
|
@@ -175816,7 +175855,7 @@ async function turnPngToNative(src, dest, orientation) {
|
|
|
175816
175855
|
);
|
|
175817
175856
|
}
|
|
175818
175857
|
}
|
|
175819
|
-
await
|
|
175858
|
+
await fs90.writeFile(dest, import_pngjs7.PNG.sync.write(native));
|
|
175820
175859
|
}
|
|
175821
175860
|
|
|
175822
175861
|
// ../tool-server/src/utils/status-bar.ts
|
|
@@ -176681,7 +176720,7 @@ async function readRootTest(params, ctx) {
|
|
|
176681
176720
|
return {
|
|
176682
176721
|
...source,
|
|
176683
176722
|
canonicalPath: canonicalPath2,
|
|
176684
|
-
text: await
|
|
176723
|
+
text: await fs91.readFile(canonicalPath2, "utf8"),
|
|
176685
176724
|
...client2 && { client: client2 },
|
|
176686
176725
|
project: client2?.project ?? new HostProjectAccess()
|
|
176687
176726
|
};
|
|
@@ -176736,7 +176775,7 @@ function launchTargetPlatform(launch, platform) {
|
|
|
176736
176775
|
async function resolveAppPath(specPath, flowDir) {
|
|
176737
176776
|
const lexical = path73.resolve(flowDir, specPath);
|
|
176738
176777
|
try {
|
|
176739
|
-
return await
|
|
176778
|
+
return await fs91.realpath(lexical);
|
|
176740
176779
|
} catch {
|
|
176741
176780
|
return lexical;
|
|
176742
176781
|
}
|
|
@@ -177625,7 +177664,7 @@ Pass exactly one e2e test source: name (under project_root) or e2e_test_path.`,
|
|
|
177625
177664
|
|
|
177626
177665
|
// ../tool-server/src/tools/flows/flow-read-prerequisite.ts
|
|
177627
177666
|
init_zod();
|
|
177628
|
-
var
|
|
177667
|
+
var fs92 = __toESM(require("node:fs/promises"));
|
|
177629
177668
|
init_src2();
|
|
177630
177669
|
var fileInputs5 = [
|
|
177631
177670
|
{
|
|
@@ -177697,7 +177736,7 @@ Address the e2e test exactly as you will address it in e2e-execute: name or e2e_
|
|
|
177697
177736
|
ctx?.fileInputs?.e2e_test_file,
|
|
177698
177737
|
ctx?.fileInputs?.e2e_test_path
|
|
177699
177738
|
);
|
|
177700
|
-
const flow = parseFlow(await
|
|
177739
|
+
const flow = parseFlow(await fs92.readFile(filePath, "utf8"));
|
|
177701
177740
|
return {
|
|
177702
177741
|
e2eTest: flowName,
|
|
177703
177742
|
flow: flowName,
|
|
@@ -178085,7 +178124,7 @@ var dismissUpdateTool = {
|
|
|
178085
178124
|
};
|
|
178086
178125
|
|
|
178087
178126
|
// ../tool-server/src/tools/screenshot-diff/index.ts
|
|
178088
|
-
var
|
|
178127
|
+
var import_node_crypto28 = __toESM(require("node:crypto"));
|
|
178089
178128
|
var import_promises26 = __toESM(require("fs/promises"));
|
|
178090
178129
|
var import_node_os19 = __toESM(require("node:os"));
|
|
178091
178130
|
var import_path9 = __toESM(require("path"));
|
|
@@ -178229,7 +178268,7 @@ async function resolveOutputDir(params, options) {
|
|
|
178229
178268
|
const dir = import_path9.default.join(
|
|
178230
178269
|
import_node_os19.default.tmpdir(),
|
|
178231
178270
|
"argent-screenshot-diff",
|
|
178232
|
-
|
|
178271
|
+
import_node_crypto28.default.randomBytes(6).toString("hex")
|
|
178233
178272
|
);
|
|
178234
178273
|
await import_promises26.default.mkdir(dir, { recursive: true });
|
|
178235
178274
|
return dir;
|
|
@@ -178334,7 +178373,7 @@ async function captureIosDeviceLiveInput(params) {
|
|
|
178334
178373
|
return writeLivePng(params.outputDir, params.name, png);
|
|
178335
178374
|
}
|
|
178336
178375
|
async function writeLivePng(outputDir, name, png) {
|
|
178337
|
-
const suffix =
|
|
178376
|
+
const suffix = import_node_crypto28.default.randomBytes(4).toString("hex");
|
|
178338
178377
|
const destination = import_path9.default.join(outputDir, `${name}-${suffix}.live.png`);
|
|
178339
178378
|
await import_promises26.default.mkdir(outputDir, { recursive: true });
|
|
178340
178379
|
await import_promises26.default.writeFile(destination, png);
|
|
@@ -178352,7 +178391,7 @@ async function captureHarmonyLiveInput(params) {
|
|
|
178352
178391
|
}
|
|
178353
178392
|
await ensureDep("hdc");
|
|
178354
178393
|
const captured2 = await captureHarmonyScreenshotPng({ connectKey: params.connectKey, scale: 1 });
|
|
178355
|
-
const suffix =
|
|
178394
|
+
const suffix = import_node_crypto28.default.randomBytes(4).toString("hex");
|
|
178356
178395
|
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
178357
178396
|
try {
|
|
178358
178397
|
await import_promises26.default.mkdir(params.outputDir, { recursive: true });
|
|
@@ -178375,7 +178414,7 @@ async function captureLiveInput(params) {
|
|
|
178375
178414
|
captureScreenshot2,
|
|
178376
178415
|
params.peekFor?.(params.device)
|
|
178377
178416
|
);
|
|
178378
|
-
const suffix =
|
|
178417
|
+
const suffix = import_node_crypto28.default.randomBytes(4).toString("hex");
|
|
178379
178418
|
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
178380
178419
|
await import_promises26.default.mkdir(params.outputDir, { recursive: true });
|
|
178381
178420
|
await import_promises26.default.copyFile(capture.path, destination);
|
|
@@ -178948,7 +178987,7 @@ Returns { value } for one key, { entries, count } for all keys, and { set } / {
|
|
|
178948
178987
|
};
|
|
178949
178988
|
|
|
178950
178989
|
// ../tool-server/src/tools/file-panel/index.ts
|
|
178951
|
-
var
|
|
178990
|
+
var fs94 = __toESM(require("node:fs/promises"));
|
|
178952
178991
|
var os21 = __toESM(require("node:os"));
|
|
178953
178992
|
var path75 = __toESM(require("node:path"));
|
|
178954
178993
|
init_zod();
|
|
@@ -178983,7 +179022,7 @@ function requestedPaths(params, action) {
|
|
|
178983
179022
|
}
|
|
178984
179023
|
async function statOrNull(p) {
|
|
178985
179024
|
try {
|
|
178986
|
-
return await
|
|
179025
|
+
return await fs94.stat(p);
|
|
178987
179026
|
} catch {
|
|
178988
179027
|
return null;
|
|
178989
179028
|
}
|
|
@@ -179023,7 +179062,7 @@ async function sandboxTokens2(app, paths) {
|
|
|
179023
179062
|
if (!tracked?.sandboxed) return {};
|
|
179024
179063
|
const resolved = await Promise.all(
|
|
179025
179064
|
paths.map(
|
|
179026
|
-
(p) =>
|
|
179065
|
+
(p) => fs94.realpath(p).catch(async () => path75.join(await fs94.realpath(path75.dirname(p)), path75.basename(p)))
|
|
179027
179066
|
)
|
|
179028
179067
|
);
|
|
179029
179068
|
const tokens = [];
|
|
@@ -179500,7 +179539,7 @@ function probeArgentToolServer(host, port, timeoutMs = 500) {
|
|
|
179500
179539
|
|
|
179501
179540
|
// ../tool-server/src/utils/preview-window.ts
|
|
179502
179541
|
var import_node_child_process59 = require("node:child_process");
|
|
179503
|
-
var
|
|
179542
|
+
var fs95 = __toESM(require("node:fs"));
|
|
179504
179543
|
var os22 = __toESM(require("node:os"));
|
|
179505
179544
|
var path76 = __toESM(require("node:path"));
|
|
179506
179545
|
function ensureLensAppBundle(electronBin) {
|
|
@@ -179517,18 +179556,18 @@ function ensureLensAppBundle(electronBin) {
|
|
|
179517
179556
|
);
|
|
179518
179557
|
const wrapperExec = path76.join(wrapperContents, "MacOS", "Electron");
|
|
179519
179558
|
try {
|
|
179520
|
-
if (
|
|
179559
|
+
if (fs95.realpathSync(wrapperExec) === fs95.realpathSync(electronBin)) return wrapperExec;
|
|
179521
179560
|
} catch {
|
|
179522
179561
|
}
|
|
179523
|
-
|
|
179524
|
-
|
|
179525
|
-
|
|
179526
|
-
|
|
179527
|
-
|
|
179562
|
+
fs95.rmSync(path76.dirname(wrapperContents), { recursive: true, force: true });
|
|
179563
|
+
fs95.mkdirSync(path76.join(wrapperContents, "MacOS"), { recursive: true });
|
|
179564
|
+
fs95.symlinkSync(path76.join(realContents, "Frameworks"), path76.join(wrapperContents, "Frameworks"));
|
|
179565
|
+
fs95.symlinkSync(path76.join(realContents, "Resources"), path76.join(wrapperContents, "Resources"));
|
|
179566
|
+
fs95.symlinkSync(electronBin, wrapperExec);
|
|
179528
179567
|
const pkgInfo = path76.join(realContents, "PkgInfo");
|
|
179529
|
-
if (
|
|
179568
|
+
if (fs95.existsSync(pkgInfo)) fs95.copyFileSync(pkgInfo, path76.join(wrapperContents, "PkgInfo"));
|
|
179530
179569
|
const plist = path76.join(wrapperContents, "Info.plist");
|
|
179531
|
-
|
|
179570
|
+
fs95.copyFileSync(path76.join(realContents, "Info.plist"), plist);
|
|
179532
179571
|
const setPlist = (entry, value) => {
|
|
179533
179572
|
try {
|
|
179534
179573
|
(0, import_node_child_process59.execFileSync)("/usr/libexec/PlistBuddy", ["-c", `Set :${entry} ${value}`, plist]);
|
|
@@ -179570,7 +179609,7 @@ function createPreviewWindowManager(opts = {}) {
|
|
|
179570
179609
|
const resolveMainScript = () => {
|
|
179571
179610
|
if (opts.mainScript) return opts.mainScript;
|
|
179572
179611
|
const bundled = path76.join(__dirname, "preview-window", "main.cjs");
|
|
179573
|
-
if (
|
|
179612
|
+
if (fs95.existsSync(bundled)) return bundled;
|
|
179574
179613
|
return require.resolve("@argent/preview-window/dist/main.js");
|
|
179575
179614
|
};
|
|
179576
179615
|
const isAlive2 = (c) => c !== null && c.exitCode === null && !c.killed;
|