@swmansion/argent 0.34.1-next.30 → 0.34.1-next.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-cmds.mjs +215 -151
- package/dist/client.js +149 -81
- package/dist/flow-script-runner.mjs +1 -0
- package/dist/installer.mjs +118 -112
- package/dist/mcp-server.mjs +189 -120
- package/dist/tool-args.generated.d.ts +3 -3
- package/dist/tool-server.cjs +280 -168
- package/package.json +1 -1
package/dist/tool-server.cjs
CHANGED
|
@@ -1253,10 +1253,13 @@ function toolStepFiles(specs, args) {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
return files;
|
|
1255
1255
|
}
|
|
1256
|
+
function isUnexpandedPath(p) {
|
|
1257
|
+
return UNEXPANDED_PATH.test(p);
|
|
1258
|
+
}
|
|
1256
1259
|
function isClientFileArgument({ spec, path: path72 }) {
|
|
1257
1260
|
return spec.kind === "file" && spec.path === `\${${spec.target}}` && path72.startsWith("/") && hasToolFileExtension(path72);
|
|
1258
1261
|
}
|
|
1259
|
-
var FILE_INPUT_MARKER, FLOW_NAME_CHARSET, FLOW_NAME_PATTERN, FLOW_FILE_NAME_PATTERN, SCRIPT_FILE_EXTENSIONS, SCRIPT_FILE_NAME_PATTERN, CLIENT_FILE_MARKER, TOOL_FILE_EXTENSIONS;
|
|
1262
|
+
var FILE_INPUT_MARKER, FLOW_NAME_CHARSET, FLOW_NAME_PATTERN, FLOW_FILE_NAME_PATTERN, SCRIPT_FILE_EXTENSIONS, SCRIPT_FILE_NAME_PATTERN, CLIENT_FILE_MARKER, TOOL_FILE_EXTENSIONS, UNEXPANDED_PATH;
|
|
1260
1263
|
var init_file_inputs = __esm({
|
|
1261
1264
|
"../registry/src/file-inputs.ts"() {
|
|
1262
1265
|
"use strict";
|
|
@@ -1281,6 +1284,17 @@ var init_file_inputs = __esm({
|
|
|
1281
1284
|
".aiff",
|
|
1282
1285
|
".flac"
|
|
1283
1286
|
];
|
|
1287
|
+
UNEXPANDED_PATH = /^~|\$[A-Za-z0-9_{(]|`|%[A-Za-z_][A-Za-z0-9_]*%|^[A-Za-z][A-Za-z0-9+.-]+:/;
|
|
1288
|
+
}
|
|
1289
|
+
});
|
|
1290
|
+
|
|
1291
|
+
// ../registry/src/flow-platforms.ts
|
|
1292
|
+
var LAUNCH_PLATFORMS, SELECTABLE_PLATFORMS;
|
|
1293
|
+
var init_flow_platforms = __esm({
|
|
1294
|
+
"../registry/src/flow-platforms.ts"() {
|
|
1295
|
+
"use strict";
|
|
1296
|
+
LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
|
|
1297
|
+
SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
1284
1298
|
}
|
|
1285
1299
|
});
|
|
1286
1300
|
|
|
@@ -1424,6 +1438,9 @@ function completeRunExtension(value) {
|
|
|
1424
1438
|
const candidate = `${value}.yaml`;
|
|
1425
1439
|
return FLOW_FILE_NAME_PATTERN.test(path6.posix.basename(candidate)) ? candidate : value;
|
|
1426
1440
|
}
|
|
1441
|
+
function flowYamlSource(content) {
|
|
1442
|
+
return content.replace(/^\s+/, (lead) => lead.replace(/[^\n]/g, "")).trimEnd();
|
|
1443
|
+
}
|
|
1427
1444
|
function baselineKeyFor(canonicalPath2, flowName) {
|
|
1428
1445
|
const stem = path6.basename(canonicalPath2, ".yaml");
|
|
1429
1446
|
return FLOW_NAME_PATTERN.test(stem) ? stem : flowName;
|
|
@@ -1711,6 +1728,8 @@ var init_failure_codes = __esm({
|
|
|
1711
1728
|
DEBUGGER_TARGET_DEVICE_MISMATCH: "DEBUGGER_TARGET_DEVICE_MISMATCH",
|
|
1712
1729
|
DEBUGGER_EVALUATE_EXPRESSION_THREW: "DEBUGGER_EVALUATE_EXPRESSION_THREW",
|
|
1713
1730
|
DEBUGGER_RELOAD_FAILED: "DEBUGGER_RELOAD_FAILED",
|
|
1731
|
+
// e2e-add-step refused a debugger-* call that answered `not_connected`.
|
|
1732
|
+
DEBUGGER_NOT_CONNECTED: "DEBUGGER_NOT_CONNECTED",
|
|
1714
1733
|
JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED: "JS_RUNTIME_CONSOLE_SERVER_BIND_FAILED",
|
|
1715
1734
|
JS_RUNTIME_PAYLOAD_INVALID: "JS_RUNTIME_PAYLOAD_INVALID",
|
|
1716
1735
|
JS_RUNTIME_PAYLOAD_DEVICE_MISSING: "JS_RUNTIME_PAYLOAD_DEVICE_MISSING",
|
|
@@ -23056,6 +23075,7 @@ var init_src2 = __esm({
|
|
|
23056
23075
|
init_types();
|
|
23057
23076
|
init_artifacts();
|
|
23058
23077
|
init_file_inputs();
|
|
23078
|
+
init_flow_platforms();
|
|
23059
23079
|
init_flow_file_refs();
|
|
23060
23080
|
init_e2e_dirs();
|
|
23061
23081
|
init_urn();
|
|
@@ -43198,13 +43218,13 @@ var require_view = __commonJS({
|
|
|
43198
43218
|
View.prototype.resolve = function resolve22(dir, file2) {
|
|
43199
43219
|
var ext = this.ext;
|
|
43200
43220
|
var path73 = join75(dir, file2);
|
|
43201
|
-
var
|
|
43202
|
-
if (
|
|
43221
|
+
var stat12 = tryStat(path73);
|
|
43222
|
+
if (stat12 && stat12.isFile()) {
|
|
43203
43223
|
return path73;
|
|
43204
43224
|
}
|
|
43205
43225
|
path73 = join75(dir, basename22(file2, ext), "index" + ext);
|
|
43206
|
-
|
|
43207
|
-
if (
|
|
43226
|
+
stat12 = tryStat(path73);
|
|
43227
|
+
if (stat12 && stat12.isFile()) {
|
|
43208
43228
|
return path73;
|
|
43209
43229
|
}
|
|
43210
43230
|
};
|
|
@@ -43392,9 +43412,9 @@ var require_etag = __commonJS({
|
|
|
43392
43412
|
}
|
|
43393
43413
|
return obj && typeof obj === "object" && "ctime" in obj && toString.call(obj.ctime) === "[object Date]" && "mtime" in obj && toString.call(obj.mtime) === "[object Date]" && "ino" in obj && typeof obj.ino === "number" && "size" in obj && typeof obj.size === "number";
|
|
43394
43414
|
}
|
|
43395
|
-
function stattag(
|
|
43396
|
-
var mtime =
|
|
43397
|
-
var size =
|
|
43415
|
+
function stattag(stat12) {
|
|
43416
|
+
var mtime = stat12.mtime.getTime().toString(16);
|
|
43417
|
+
var size = stat12.size.toString(16);
|
|
43398
43418
|
return '"' + size + "-" + mtime + '"';
|
|
43399
43419
|
}
|
|
43400
43420
|
}
|
|
@@ -75860,8 +75880,8 @@ var require_send = __commonJS({
|
|
|
75860
75880
|
this.sendFile(path73);
|
|
75861
75881
|
return res;
|
|
75862
75882
|
};
|
|
75863
|
-
SendStream.prototype.send = function send2(path73,
|
|
75864
|
-
var len =
|
|
75883
|
+
SendStream.prototype.send = function send2(path73, stat12) {
|
|
75884
|
+
var len = stat12.size;
|
|
75865
75885
|
var options = this.options;
|
|
75866
75886
|
var opts = {};
|
|
75867
75887
|
var res = this.res;
|
|
@@ -75873,7 +75893,7 @@ var require_send = __commonJS({
|
|
|
75873
75893
|
return;
|
|
75874
75894
|
}
|
|
75875
75895
|
debug('pipe "%s"', path73);
|
|
75876
|
-
this.setHeader(path73,
|
|
75896
|
+
this.setHeader(path73, stat12);
|
|
75877
75897
|
this.type(path73);
|
|
75878
75898
|
if (this.isConditionalGET()) {
|
|
75879
75899
|
if (this.isPreconditionFailure()) {
|
|
@@ -75929,16 +75949,16 @@ var require_send = __commonJS({
|
|
|
75929
75949
|
var i = 0;
|
|
75930
75950
|
var self2 = this;
|
|
75931
75951
|
debug('stat "%s"', path73);
|
|
75932
|
-
fs86.stat(path73, function onstat(err,
|
|
75952
|
+
fs86.stat(path73, function onstat(err, stat12) {
|
|
75933
75953
|
var pathEndsWithSep = path73[path73.length - 1] === sep11;
|
|
75934
75954
|
if (err && err.code === "ENOENT" && !extname7(path73) && !pathEndsWithSep) {
|
|
75935
75955
|
return next(err);
|
|
75936
75956
|
}
|
|
75937
75957
|
if (err) return self2.onStatError(err);
|
|
75938
|
-
if (
|
|
75958
|
+
if (stat12.isDirectory()) return self2.redirect(path73);
|
|
75939
75959
|
if (pathEndsWithSep) return self2.error(404);
|
|
75940
|
-
self2.emit("file", path73,
|
|
75941
|
-
self2.send(path73,
|
|
75960
|
+
self2.emit("file", path73, stat12);
|
|
75961
|
+
self2.send(path73, stat12);
|
|
75942
75962
|
});
|
|
75943
75963
|
function next(err) {
|
|
75944
75964
|
if (self2._extensions.length <= i) {
|
|
@@ -75946,11 +75966,11 @@ var require_send = __commonJS({
|
|
|
75946
75966
|
}
|
|
75947
75967
|
var p = path73 + "." + self2._extensions[i++];
|
|
75948
75968
|
debug('stat "%s"', p);
|
|
75949
|
-
fs86.stat(p, function(err2,
|
|
75969
|
+
fs86.stat(p, function(err2, stat12) {
|
|
75950
75970
|
if (err2) return next(err2);
|
|
75951
|
-
if (
|
|
75952
|
-
self2.emit("file", p,
|
|
75953
|
-
self2.send(p,
|
|
75971
|
+
if (stat12.isDirectory()) return next();
|
|
75972
|
+
self2.emit("file", p, stat12);
|
|
75973
|
+
self2.send(p, stat12);
|
|
75954
75974
|
});
|
|
75955
75975
|
}
|
|
75956
75976
|
};
|
|
@@ -75964,11 +75984,11 @@ var require_send = __commonJS({
|
|
|
75964
75984
|
}
|
|
75965
75985
|
var p = join75(path73, self2._index[i]);
|
|
75966
75986
|
debug('stat "%s"', p);
|
|
75967
|
-
fs86.stat(p, function(err2,
|
|
75987
|
+
fs86.stat(p, function(err2, stat12) {
|
|
75968
75988
|
if (err2) return next(err2);
|
|
75969
|
-
if (
|
|
75970
|
-
self2.emit("file", p,
|
|
75971
|
-
self2.send(p,
|
|
75989
|
+
if (stat12.isDirectory()) return next();
|
|
75990
|
+
self2.emit("file", p, stat12);
|
|
75991
|
+
self2.send(p, stat12);
|
|
75972
75992
|
});
|
|
75973
75993
|
}
|
|
75974
75994
|
next();
|
|
@@ -75999,9 +76019,9 @@ var require_send = __commonJS({
|
|
|
75999
76019
|
debug("content-type %s", type2);
|
|
76000
76020
|
res.setHeader("Content-Type", type2);
|
|
76001
76021
|
};
|
|
76002
|
-
SendStream.prototype.setHeader = function setHeader(path73,
|
|
76022
|
+
SendStream.prototype.setHeader = function setHeader(path73, stat12) {
|
|
76003
76023
|
var res = this.res;
|
|
76004
|
-
this.emit("headers", res, path73,
|
|
76024
|
+
this.emit("headers", res, path73, stat12);
|
|
76005
76025
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
76006
76026
|
debug("accept ranges");
|
|
76007
76027
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -76015,12 +76035,12 @@ var require_send = __commonJS({
|
|
|
76015
76035
|
res.setHeader("Cache-Control", cacheControl);
|
|
76016
76036
|
}
|
|
76017
76037
|
if (this._lastModified && !res.getHeader("Last-Modified")) {
|
|
76018
|
-
var modified =
|
|
76038
|
+
var modified = stat12.mtime.toUTCString();
|
|
76019
76039
|
debug("modified %s", modified);
|
|
76020
76040
|
res.setHeader("Last-Modified", modified);
|
|
76021
76041
|
}
|
|
76022
76042
|
if (this._etag && !res.getHeader("ETag")) {
|
|
76023
|
-
var val = etag(
|
|
76043
|
+
var val = etag(stat12);
|
|
76024
76044
|
debug("etag %s", val);
|
|
76025
76045
|
res.setHeader("ETag", val);
|
|
76026
76046
|
}
|
|
@@ -84508,14 +84528,14 @@ async function isFoldableAvd(avdName) {
|
|
|
84508
84528
|
}
|
|
84509
84529
|
}
|
|
84510
84530
|
async function hasDefaultBootSnapshot(avdName) {
|
|
84511
|
-
const { stat:
|
|
84531
|
+
const { stat: stat12 } = await import("node:fs/promises");
|
|
84512
84532
|
const avdPath = await resolveAvdPath(avdName);
|
|
84513
84533
|
if (!avdPath) return false;
|
|
84514
84534
|
const snapshotPath = `${avdPath}/snapshots/default_boot`;
|
|
84515
84535
|
try {
|
|
84516
84536
|
const [metaStat, ramStat] = await Promise.all([
|
|
84517
|
-
|
|
84518
|
-
|
|
84537
|
+
stat12(`${snapshotPath}/snapshot.pb`),
|
|
84538
|
+
stat12(`${snapshotPath}/ram.bin`)
|
|
84519
84539
|
]);
|
|
84520
84540
|
if (!metaStat.isFile()) return false;
|
|
84521
84541
|
if (!ramStat.isFile() || ramStat.size === 0) return false;
|
|
@@ -86744,14 +86764,14 @@ var require_ncp = __commonJS({
|
|
|
86744
86764
|
return getStats(source2);
|
|
86745
86765
|
}
|
|
86746
86766
|
function getStats(source2) {
|
|
86747
|
-
var
|
|
86767
|
+
var stat12 = dereference ? fs86.stat : fs86.lstat;
|
|
86748
86768
|
if (running >= limit) {
|
|
86749
86769
|
return setImmediate(function() {
|
|
86750
86770
|
getStats(source2);
|
|
86751
86771
|
});
|
|
86752
86772
|
}
|
|
86753
86773
|
running++;
|
|
86754
|
-
|
|
86774
|
+
stat12(source2, function(err, stats) {
|
|
86755
86775
|
var item = {};
|
|
86756
86776
|
if (err) {
|
|
86757
86777
|
return onError(err);
|
|
@@ -86784,8 +86804,8 @@ var require_ncp = __commonJS({
|
|
|
86784
86804
|
});
|
|
86785
86805
|
}
|
|
86786
86806
|
if (modified) {
|
|
86787
|
-
var
|
|
86788
|
-
|
|
86807
|
+
var stat12 = dereference ? fs86.stat : fs86.lstat;
|
|
86808
|
+
stat12(target, function(err, stats) {
|
|
86789
86809
|
if (file2.mtime.getTime() > stats.mtime.getTime())
|
|
86790
86810
|
copyFile(file2, target);
|
|
86791
86811
|
else return cb();
|
|
@@ -87828,16 +87848,16 @@ var require_path_is_absolute = __commonJS({
|
|
|
87828
87848
|
function posix7(path72) {
|
|
87829
87849
|
return path72.charAt(0) === "/";
|
|
87830
87850
|
}
|
|
87831
|
-
function
|
|
87851
|
+
function win324(path72) {
|
|
87832
87852
|
var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
|
|
87833
87853
|
var result = splitDeviceRe.exec(path72);
|
|
87834
87854
|
var device = result[1] || "";
|
|
87835
87855
|
var isUnc = Boolean(device && device.charAt(1) !== ":");
|
|
87836
87856
|
return Boolean(result[2] || isUnc);
|
|
87837
87857
|
}
|
|
87838
|
-
module2.exports = process.platform === "win32" ?
|
|
87858
|
+
module2.exports = process.platform === "win32" ? win324 : posix7;
|
|
87839
87859
|
module2.exports.posix = posix7;
|
|
87840
|
-
module2.exports.win32 =
|
|
87860
|
+
module2.exports.win32 = win324;
|
|
87841
87861
|
}
|
|
87842
87862
|
});
|
|
87843
87863
|
|
|
@@ -87858,7 +87878,7 @@ var require_common2 = __commonJS({
|
|
|
87858
87878
|
}
|
|
87859
87879
|
var path72 = require("path");
|
|
87860
87880
|
var minimatch = require_minimatch();
|
|
87861
|
-
var
|
|
87881
|
+
var isAbsolute15 = require_path_is_absolute();
|
|
87862
87882
|
var Minimatch = minimatch.Minimatch;
|
|
87863
87883
|
function alphasorti(a, b) {
|
|
87864
87884
|
return a.toLowerCase().localeCompare(b.toLowerCase());
|
|
@@ -88001,7 +88021,7 @@ var require_common2 = __commonJS({
|
|
|
88001
88021
|
var abs = f;
|
|
88002
88022
|
if (f.charAt(0) === "/") {
|
|
88003
88023
|
abs = path72.join(self2.root, f);
|
|
88004
|
-
} else if (
|
|
88024
|
+
} else if (isAbsolute15(f) || f === "") {
|
|
88005
88025
|
abs = f;
|
|
88006
88026
|
} else if (self2.changedCwd) {
|
|
88007
88027
|
abs = path72.resolve(self2.cwd, f);
|
|
@@ -88039,7 +88059,7 @@ var require_sync = __commonJS({
|
|
|
88039
88059
|
var util = require("util");
|
|
88040
88060
|
var path72 = require("path");
|
|
88041
88061
|
var assert2 = require("assert");
|
|
88042
|
-
var
|
|
88062
|
+
var isAbsolute15 = require_path_is_absolute();
|
|
88043
88063
|
var common = require_common2();
|
|
88044
88064
|
var alphasort = common.alphasort;
|
|
88045
88065
|
var alphasorti = common.alphasorti;
|
|
@@ -88113,8 +88133,8 @@ var require_sync = __commonJS({
|
|
|
88113
88133
|
var read;
|
|
88114
88134
|
if (prefix === null)
|
|
88115
88135
|
read = ".";
|
|
88116
|
-
else if (
|
|
88117
|
-
if (!prefix || !
|
|
88136
|
+
else if (isAbsolute15(prefix) || isAbsolute15(pattern.join("/"))) {
|
|
88137
|
+
if (!prefix || !isAbsolute15(prefix))
|
|
88118
88138
|
prefix = "/" + prefix;
|
|
88119
88139
|
read = prefix;
|
|
88120
88140
|
} else
|
|
@@ -88202,7 +88222,7 @@ var require_sync = __commonJS({
|
|
|
88202
88222
|
return this._readdir(abs, false);
|
|
88203
88223
|
var entries;
|
|
88204
88224
|
var lstat;
|
|
88205
|
-
var
|
|
88225
|
+
var stat12;
|
|
88206
88226
|
try {
|
|
88207
88227
|
lstat = fs86.lstatSync(abs);
|
|
88208
88228
|
} catch (er) {
|
|
@@ -88299,7 +88319,7 @@ var require_sync = __commonJS({
|
|
|
88299
88319
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
88300
88320
|
if (!exists3)
|
|
88301
88321
|
return;
|
|
88302
|
-
if (prefix &&
|
|
88322
|
+
if (prefix && isAbsolute15(prefix) && !this.nomount) {
|
|
88303
88323
|
var trail = /[\/\\]$/.test(prefix);
|
|
88304
88324
|
if (prefix.charAt(0) === "/") {
|
|
88305
88325
|
prefix = path72.join(this.root, prefix);
|
|
@@ -88328,8 +88348,8 @@ var require_sync = __commonJS({
|
|
|
88328
88348
|
return false;
|
|
88329
88349
|
}
|
|
88330
88350
|
var exists3;
|
|
88331
|
-
var
|
|
88332
|
-
if (!
|
|
88351
|
+
var stat12 = this.statCache[abs];
|
|
88352
|
+
if (!stat12) {
|
|
88333
88353
|
var lstat;
|
|
88334
88354
|
try {
|
|
88335
88355
|
lstat = fs86.lstatSync(abs);
|
|
@@ -88338,16 +88358,16 @@ var require_sync = __commonJS({
|
|
|
88338
88358
|
}
|
|
88339
88359
|
if (lstat.isSymbolicLink()) {
|
|
88340
88360
|
try {
|
|
88341
|
-
|
|
88361
|
+
stat12 = fs86.statSync(abs);
|
|
88342
88362
|
} catch (er) {
|
|
88343
|
-
|
|
88363
|
+
stat12 = lstat;
|
|
88344
88364
|
}
|
|
88345
88365
|
} else {
|
|
88346
|
-
|
|
88366
|
+
stat12 = lstat;
|
|
88347
88367
|
}
|
|
88348
88368
|
}
|
|
88349
|
-
this.statCache[abs] =
|
|
88350
|
-
var c =
|
|
88369
|
+
this.statCache[abs] = stat12;
|
|
88370
|
+
var c = stat12.isDirectory() ? "DIR" : "FILE";
|
|
88351
88371
|
this.cache[abs] = this.cache[abs] || c;
|
|
88352
88372
|
if (needDir && c !== "DIR")
|
|
88353
88373
|
return false;
|
|
@@ -88419,7 +88439,7 @@ var require_glob = __commonJS({
|
|
|
88419
88439
|
var EE = require("events").EventEmitter;
|
|
88420
88440
|
var path72 = require("path");
|
|
88421
88441
|
var assert2 = require("assert");
|
|
88422
|
-
var
|
|
88442
|
+
var isAbsolute15 = require_path_is_absolute();
|
|
88423
88443
|
var globSync = require_sync();
|
|
88424
88444
|
var common = require_common2();
|
|
88425
88445
|
var alphasort = common.alphasort;
|
|
@@ -88633,8 +88653,8 @@ var require_glob = __commonJS({
|
|
|
88633
88653
|
var read;
|
|
88634
88654
|
if (prefix === null)
|
|
88635
88655
|
read = ".";
|
|
88636
|
-
else if (
|
|
88637
|
-
if (!prefix || !
|
|
88656
|
+
else if (isAbsolute15(prefix) || isAbsolute15(pattern.join("/"))) {
|
|
88657
|
+
if (!prefix || !isAbsolute15(prefix))
|
|
88638
88658
|
prefix = "/" + prefix;
|
|
88639
88659
|
read = prefix;
|
|
88640
88660
|
} else
|
|
@@ -88866,7 +88886,7 @@ var require_glob = __commonJS({
|
|
|
88866
88886
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
88867
88887
|
if (!exists3)
|
|
88868
88888
|
return cb();
|
|
88869
|
-
if (prefix &&
|
|
88889
|
+
if (prefix && isAbsolute15(prefix) && !this.nomount) {
|
|
88870
88890
|
var trail = /[\/\\]$/.test(prefix);
|
|
88871
88891
|
if (prefix.charAt(0) === "/") {
|
|
88872
88892
|
prefix = path72.join(this.root, prefix);
|
|
@@ -88896,16 +88916,16 @@ var require_glob = __commonJS({
|
|
|
88896
88916
|
return cb();
|
|
88897
88917
|
}
|
|
88898
88918
|
var exists3;
|
|
88899
|
-
var
|
|
88900
|
-
if (
|
|
88901
|
-
if (
|
|
88902
|
-
return cb(null,
|
|
88919
|
+
var stat12 = this.statCache[abs];
|
|
88920
|
+
if (stat12 !== void 0) {
|
|
88921
|
+
if (stat12 === false)
|
|
88922
|
+
return cb(null, stat12);
|
|
88903
88923
|
else {
|
|
88904
|
-
var type =
|
|
88924
|
+
var type = stat12.isDirectory() ? "DIR" : "FILE";
|
|
88905
88925
|
if (needDir && type === "FILE")
|
|
88906
88926
|
return cb();
|
|
88907
88927
|
else
|
|
88908
|
-
return cb(null, type,
|
|
88928
|
+
return cb(null, type, stat12);
|
|
88909
88929
|
}
|
|
88910
88930
|
}
|
|
88911
88931
|
var self2 = this;
|
|
@@ -88914,31 +88934,31 @@ var require_glob = __commonJS({
|
|
|
88914
88934
|
fs86.lstat(abs, statcb);
|
|
88915
88935
|
function lstatcb_(er, lstat) {
|
|
88916
88936
|
if (lstat && lstat.isSymbolicLink()) {
|
|
88917
|
-
return fs86.stat(abs, function(er2,
|
|
88937
|
+
return fs86.stat(abs, function(er2, stat13) {
|
|
88918
88938
|
if (er2)
|
|
88919
88939
|
self2._stat2(f, abs, null, lstat, cb);
|
|
88920
88940
|
else
|
|
88921
|
-
self2._stat2(f, abs, er2,
|
|
88941
|
+
self2._stat2(f, abs, er2, stat13, cb);
|
|
88922
88942
|
});
|
|
88923
88943
|
} else {
|
|
88924
88944
|
self2._stat2(f, abs, er, lstat, cb);
|
|
88925
88945
|
}
|
|
88926
88946
|
}
|
|
88927
88947
|
};
|
|
88928
|
-
Glob.prototype._stat2 = function(f, abs, er,
|
|
88948
|
+
Glob.prototype._stat2 = function(f, abs, er, stat12, cb) {
|
|
88929
88949
|
if (er) {
|
|
88930
88950
|
this.statCache[abs] = false;
|
|
88931
88951
|
return cb();
|
|
88932
88952
|
}
|
|
88933
88953
|
var needDir = f.slice(-1) === "/";
|
|
88934
|
-
this.statCache[abs] =
|
|
88935
|
-
if (abs.slice(-1) === "/" && !
|
|
88936
|
-
return cb(null, false,
|
|
88937
|
-
var c =
|
|
88954
|
+
this.statCache[abs] = stat12;
|
|
88955
|
+
if (abs.slice(-1) === "/" && !stat12.isDirectory())
|
|
88956
|
+
return cb(null, false, stat12);
|
|
88957
|
+
var c = stat12.isDirectory() ? "DIR" : "FILE";
|
|
88938
88958
|
this.cache[abs] = this.cache[abs] || c;
|
|
88939
88959
|
if (needDir && c !== "DIR")
|
|
88940
88960
|
return cb();
|
|
88941
|
-
return cb(null, c,
|
|
88961
|
+
return cb(null, c, stat12);
|
|
88942
88962
|
};
|
|
88943
88963
|
}
|
|
88944
88964
|
});
|
|
@@ -88994,7 +89014,7 @@ var require_rimraf = __commonJS({
|
|
|
88994
89014
|
var n = 0;
|
|
88995
89015
|
if (options.disableGlob || !glob.hasMagic(p))
|
|
88996
89016
|
return afterGlob(null, [p]);
|
|
88997
|
-
fs86.lstat(p, function(er,
|
|
89017
|
+
fs86.lstat(p, function(er, stat12) {
|
|
88998
89018
|
if (!er)
|
|
88999
89019
|
return afterGlob(null, [p]);
|
|
89000
89020
|
glob(p, globOpts, afterGlob);
|
|
@@ -89251,8 +89271,8 @@ var require_mkdirp = __commonJS({
|
|
|
89251
89271
|
// there already. If so, then hooray! If not, then something
|
|
89252
89272
|
// is borked.
|
|
89253
89273
|
default:
|
|
89254
|
-
xfs.stat(p, function(er2,
|
|
89255
|
-
if (er2 || !
|
|
89274
|
+
xfs.stat(p, function(er2, stat12) {
|
|
89275
|
+
if (er2 || !stat12.isDirectory()) cb(er, made);
|
|
89256
89276
|
else cb(null, made);
|
|
89257
89277
|
});
|
|
89258
89278
|
break;
|
|
@@ -89283,13 +89303,13 @@ var require_mkdirp = __commonJS({
|
|
|
89283
89303
|
// there already. If so, then hooray! If not, then something
|
|
89284
89304
|
// is borked.
|
|
89285
89305
|
default:
|
|
89286
|
-
var
|
|
89306
|
+
var stat12;
|
|
89287
89307
|
try {
|
|
89288
|
-
|
|
89308
|
+
stat12 = xfs.statSync(p);
|
|
89289
89309
|
} catch (err1) {
|
|
89290
89310
|
throw err0;
|
|
89291
89311
|
}
|
|
89292
|
-
if (!
|
|
89312
|
+
if (!stat12.isDirectory()) throw err0;
|
|
89293
89313
|
break;
|
|
89294
89314
|
}
|
|
89295
89315
|
}
|
|
@@ -101420,7 +101440,7 @@ function isCi(env = process.env) {
|
|
|
101420
101440
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
101421
101441
|
function readCliVersion() {
|
|
101422
101442
|
if (true) {
|
|
101423
|
-
return "0.34.1-next.
|
|
101443
|
+
return "0.34.1-next.32";
|
|
101424
101444
|
}
|
|
101425
101445
|
return "0.0.0";
|
|
101426
101446
|
}
|
|
@@ -133605,6 +133625,12 @@ async function resolveMembers(members2, tempDirs, lookupUpload) {
|
|
|
133605
133625
|
}
|
|
133606
133626
|
return out;
|
|
133607
133627
|
}
|
|
133628
|
+
function unexpandedPathError(wire) {
|
|
133629
|
+
if ((0, import_node_path13.isAbsolute)(wire.path) || import_node_path13.win32.isAbsolute(wire.path)) return void 0;
|
|
133630
|
+
return new FileInputError(
|
|
133631
|
+
`Path "${wire.path}" is not an absolute path. ` + (isUnexpandedPath(wire.path) ? `Nothing expands "~", variables, commands or URLs in a file argument, ` : `The tool-server resolves a relative path against its own working directory, `) + `so pass the file's absolute path.`
|
|
133632
|
+
);
|
|
133633
|
+
}
|
|
133608
133634
|
async function resolveOne(spec, wire, tempDirs, lookupUpload) {
|
|
133609
133635
|
const probe4 = await probeHostPath(wire, spec.kind);
|
|
133610
133636
|
const meta3 = {
|
|
@@ -133626,8 +133652,8 @@ async function resolveOne(spec, wire, tempDirs, lookupUpload) {
|
|
|
133626
133652
|
if (meta3.presentOnHost) {
|
|
133627
133653
|
return { value: wire.path, meta: meta3 };
|
|
133628
133654
|
}
|
|
133629
|
-
throw new FileInputError(
|
|
133630
|
-
`Path "${wire.path}"
|
|
133655
|
+
throw unexpandedPathError(wire) ?? new FileInputError(
|
|
133656
|
+
wire.size == null ? `Path "${wire.path}" was not found. The client sent no file for it, and the tool-server host has none at that path. If the file is on the client, update argent there: versions before 0.16 do not send it.` : `Path "${wire.path}" no longer matches the file the client read: its size or modification time changed, and the client uploaded none. If a build is still writing it, call again once the build finishes.`
|
|
133631
133657
|
);
|
|
133632
133658
|
}
|
|
133633
133659
|
if (spec.kind === "file" && typeof wire.content === "string") {
|
|
@@ -133648,6 +133674,8 @@ async function resolveOne(spec, wire, tempDirs, lookupUpload) {
|
|
|
133648
133674
|
if (meta3.presentOnHost) {
|
|
133649
133675
|
return { value: wire.path, meta: meta3 };
|
|
133650
133676
|
}
|
|
133677
|
+
const unexpanded = unexpandedPathError(wire);
|
|
133678
|
+
if (unexpanded) throw unexpanded;
|
|
133651
133679
|
if (spec.kind === "directory") {
|
|
133652
133680
|
throw new FileInputError(
|
|
133653
133681
|
`Directory "${wire.path}" does not exist on the tool-server host. This tool reads a directory tree from the tool-server's filesystem, which cannot be uploaded with the call \u2014 when the tool-server runs on a different machine, pass a path that exists on that machine (e.g. the server-side checkout of the project).`
|
|
@@ -145655,14 +145683,17 @@ var RUN_SEQUENCE_TOOL_ID = "run-sequence";
|
|
|
145655
145683
|
function isRecord2(value) {
|
|
145656
145684
|
return typeof value === "object" && value !== null;
|
|
145657
145685
|
}
|
|
145686
|
+
function reasonText(value) {
|
|
145687
|
+
const text = typeof value === "string" ? value.trim() : "";
|
|
145688
|
+
return text || "no reason given";
|
|
145689
|
+
}
|
|
145658
145690
|
function firstFailingStep(steps) {
|
|
145659
145691
|
if (!Array.isArray(steps)) return void 0;
|
|
145660
145692
|
for (const entry of steps) {
|
|
145661
145693
|
if (!isRecord2(entry)) continue;
|
|
145662
145694
|
if (entry.status !== "fail" && entry.status !== "error") continue;
|
|
145663
145695
|
const what = typeof entry.tool === "string" ? entry.tool : typeof entry.kind === "string" ? entry.kind : "step";
|
|
145664
|
-
|
|
145665
|
-
return `${what}: ${why}`;
|
|
145696
|
+
return `${what}: ${reasonText(entry.reason)}`;
|
|
145666
145697
|
}
|
|
145667
145698
|
return void 0;
|
|
145668
145699
|
}
|
|
@@ -145699,7 +145730,7 @@ function runSequenceOutcome(result) {
|
|
|
145699
145730
|
const tool = typeof failed3.tool === "string" ? failed3.tool : "step";
|
|
145700
145731
|
return {
|
|
145701
145732
|
status: "fail",
|
|
145702
|
-
reason: `run-sequence stopped at ${tool} after ${count(result.completed)} of ${count(result.total)} steps: ${
|
|
145733
|
+
reason: `run-sequence stopped at ${tool} after ${count(result.completed)} of ${count(result.total)} steps: ${reasonText(failed3.error)}`
|
|
145703
145734
|
};
|
|
145704
145735
|
}
|
|
145705
145736
|
const total = count(result.total);
|
|
@@ -152122,8 +152153,8 @@ function resolveLauncher(appPath) {
|
|
|
152122
152153
|
error_kind: "validation"
|
|
152123
152154
|
});
|
|
152124
152155
|
}
|
|
152125
|
-
const
|
|
152126
|
-
if (
|
|
152156
|
+
const stat12 = fs45.statSync(abs);
|
|
152157
|
+
if (stat12.isDirectory()) {
|
|
152127
152158
|
if (abs.endsWith(".app")) {
|
|
152128
152159
|
const macOsDir = path38.join(abs, "Contents", "MacOS");
|
|
152129
152160
|
if (!fs45.existsSync(macOsDir)) {
|
|
@@ -159820,9 +159851,11 @@ async function invokeSubTool(registry2, ctx, toolId, args, extra) {
|
|
|
159820
159851
|
const signal = ctx?.signal;
|
|
159821
159852
|
const recordChildInvocation = ctx?.recordChildInvocation;
|
|
159822
159853
|
const flowStack = extra?.flowStack ?? ctx?.flowStack;
|
|
159854
|
+
const flowSecret = extra?.flowSecret ?? ctx?.flowSecret;
|
|
159823
159855
|
const forwarded = {
|
|
159824
159856
|
...extra?.fileInputs ? { fileInputs: extra.fileInputs } : {},
|
|
159825
159857
|
...flowStack ? { flowStack } : {},
|
|
159858
|
+
...flowSecret ? { flowSecret } : {},
|
|
159826
159859
|
...ctx?.clientSecrets ? { clientSecrets: ctx.clientSecrets } : {}
|
|
159827
159860
|
};
|
|
159828
159861
|
if (!recordChildInvocation) {
|
|
@@ -161847,7 +161880,9 @@ var zodSchema38 = external_exports.object({
|
|
|
161847
161880
|
device_id: external_exports.string().describe(
|
|
161848
161881
|
"Device id from list-devices (iOS simulator UDID or Android serial), the same id used with debugger-connect."
|
|
161849
161882
|
),
|
|
161850
|
-
|
|
161883
|
+
// `.default` covers only an omitted param, and `z.coerce.number()` reads null as 0, so
|
|
161884
|
+
// null would return the oldest page. Agents send null for "not set": read it as "latest".
|
|
161885
|
+
pageIndex: external_exports.union([external_exports.coerce.number().int().nonnegative(), external_exports.literal("latest")]).nullable().default("latest").transform((value) => value ?? "latest").describe(
|
|
161851
161886
|
'Page index (0-based) or "latest" for the most recent page. Each page contains up to 50 entries.'
|
|
161852
161887
|
)
|
|
161853
161888
|
});
|
|
@@ -176368,7 +176403,8 @@ var zodSchema60 = external_exports.object({
|
|
|
176368
176403
|
mode: external_exports.enum(["by_component", "by_time_range", "by_index", "cascade_tree", "render_counts"]).describe("Query mode; see Modes in the tool description."),
|
|
176369
176404
|
component_name: external_exports.string().optional().describe("Component name; optional for render_counts, which it narrows to one component"),
|
|
176370
176405
|
time_range_ms: timeRangeSchema.optional().describe("Time range in ms since profiling started, the clock this tool prints"),
|
|
176371
|
-
|
|
176406
|
+
// Without `.nullable()`, `z.coerce.number()` reads null as commit 0.
|
|
176407
|
+
commit_index: external_exports.coerce.number().int().nullable().transform((value) => value ?? void 0).optional().describe("Commit index"),
|
|
176372
176408
|
top_n: external_exports.coerce.number().int().positive().optional().describe(
|
|
176373
176409
|
"Max results to return. Defaults to 20 for by_component / by_time_range, which count commits, and render_counts, which counts components. by_index counts individual fibers and returns all of them unless this is set; a small cap there can show less than the analyze report it is meant to expand on."
|
|
176374
176410
|
)
|
|
@@ -177179,7 +177215,8 @@ var zodSchema62 = external_exports.object({
|
|
|
177179
177215
|
"Target device id from `list-devices` (iOS UDID<flag:macos-apps>, Mac app id</flag:macos-apps> or Android serial)."
|
|
177180
177216
|
),
|
|
177181
177217
|
mode: external_exports.enum(["hang_stacks", "function_callers", "thread_breakdown", "leak_stacks"]).describe("Query mode; see Modes in the tool description."),
|
|
177182
|
-
|
|
177218
|
+
// Without `.nullable()`, `z.coerce.number()` reads null as hang 0.
|
|
177219
|
+
hang_index: external_exports.coerce.number().int().nullable().transform((value) => value ?? void 0).optional().describe("0-based index into the hang list"),
|
|
177183
177220
|
function_name: external_exports.string().optional().describe("Native function name"),
|
|
177184
177221
|
thread: external_exports.string().optional().describe(
|
|
177185
177222
|
'Thread filter. thread_breakdown: case-insensitive substring match. function_callers: exact raw thread name (e.g. ".blueskyweb.app"), or "main" for the UI thread; omit to search ALL threads (each result is tagged with its thread). Run thread_breakdown first to see the exact raw names.'
|
|
@@ -178459,6 +178496,7 @@ var stopMetroTool = {
|
|
|
178459
178496
|
|
|
178460
178497
|
// ../tool-server/src/tools/flows/flow-start-recording.ts
|
|
178461
178498
|
init_zod();
|
|
178499
|
+
init_src2();
|
|
178462
178500
|
|
|
178463
178501
|
// ../tool-server/src/tools/flows/flow-utils.ts
|
|
178464
178502
|
var path57 = __toESM(require("node:path"));
|
|
@@ -178628,6 +178666,9 @@ function flowsDirFor(root) {
|
|
|
178628
178666
|
var E2E_FILE_TEMPLATES = E2E_DIRS.map(
|
|
178629
178667
|
(dir) => `\${project_root}/${dir.split(path57.sep).join("/")}/\${name}.yaml`
|
|
178630
178668
|
);
|
|
178669
|
+
var PROJECT_ROOT_INPUT = [
|
|
178670
|
+
{ target: "project_root", path: "${project_root}", kind: "probe" }
|
|
178671
|
+
];
|
|
178631
178672
|
function getFlowsDir(projectRoot) {
|
|
178632
178673
|
assertValidProjectRoot(projectRoot);
|
|
178633
178674
|
return flowsDirFor(projectRoot);
|
|
@@ -178965,7 +179006,7 @@ function describeTextExpectation(expectedText, textMatch, verbForm = "mode") {
|
|
|
178965
179006
|
case "equals":
|
|
178966
179007
|
return `${verbForm === "infinitive" ? "equal" : mode} ${JSON.stringify(expected)}`;
|
|
178967
179008
|
case "matches":
|
|
178968
|
-
return `${verbForm === "infinitive" ? "match" : mode} /${expected}/`;
|
|
179009
|
+
return `${verbForm === "infinitive" ? "match" : mode} /${escapeInline(expected)}/`;
|
|
178969
179010
|
}
|
|
178970
179011
|
}
|
|
178971
179012
|
function textWaitToYaml(selector, expectedText, textMatch) {
|
|
@@ -179293,7 +179334,7 @@ function validatePattern(raw, pattern, where) {
|
|
|
179293
179334
|
} catch (err) {
|
|
179294
179335
|
badEntry(
|
|
179295
179336
|
raw,
|
|
179296
|
-
`${where} \`matches\` is not a valid regular expression: ${err instanceof Error ? err.message : String(err)}`
|
|
179337
|
+
`${where} \`matches\` is not a valid regular expression: ${escapeInline(err instanceof Error ? err.message : String(err))}`
|
|
179297
179338
|
);
|
|
179298
179339
|
}
|
|
179299
179340
|
}
|
|
@@ -179606,11 +179647,9 @@ function isIdleCondition(raw, kind) {
|
|
|
179606
179647
|
}
|
|
179607
179648
|
return true;
|
|
179608
179649
|
}
|
|
179609
|
-
var LAUNCH_PLATFORMS = ["ios", "android", "chromium", "vega", "macos"];
|
|
179610
179650
|
function namedLaunchPlatforms() {
|
|
179611
179651
|
return LAUNCH_PLATFORMS.filter((p) => p !== "macos" || isFlagOffered(MACOS_APPS_FLAG));
|
|
179612
179652
|
}
|
|
179613
|
-
var SELECTABLE_PLATFORMS = [...LAUNCH_PLATFORMS, "ios-remote"];
|
|
179614
179653
|
function authoringPlatform(platform) {
|
|
179615
179654
|
return platform === "ios-remote" ? "ios" : platform;
|
|
179616
179655
|
}
|
|
@@ -180615,7 +180654,7 @@ function parseFlow(content) {
|
|
|
180615
180654
|
}
|
|
180616
180655
|
let parsed2;
|
|
180617
180656
|
try {
|
|
180618
|
-
parsed2 = (0, import_yaml.parse)(
|
|
180657
|
+
parsed2 = (0, import_yaml.parse)(flowYamlSource(content));
|
|
180619
180658
|
} catch (err) {
|
|
180620
180659
|
throw new FailureError(
|
|
180621
180660
|
`Invalid e2e test file: ${err instanceof Error ? err.message : String(err)}`,
|
|
@@ -182776,18 +182815,21 @@ async function waitForCondition(env, step, timeoutMs) {
|
|
|
182776
182815
|
if (env.signal?.aborted) return ABORTED_OUTCOME;
|
|
182777
182816
|
try {
|
|
182778
182817
|
const data = await readFlowTree(env);
|
|
182779
|
-
|
|
182780
|
-
lastData = data;
|
|
182818
|
+
const matches2 = flowFindAll(data.tree, step.selector);
|
|
182781
182819
|
fetchError = void 0;
|
|
182782
|
-
everMatched ||=
|
|
182820
|
+
everMatched ||= matches2.length > 0;
|
|
182783
182821
|
const blind = isBlindRead(data, everMatched, step.condition);
|
|
182784
|
-
if (!blind)
|
|
182822
|
+
if (!blind) {
|
|
182823
|
+
lastMatches = matches2;
|
|
182824
|
+
lastData = data;
|
|
182825
|
+
lastTrustedReadAt = Date.now();
|
|
182826
|
+
}
|
|
182785
182827
|
lastReadTrusted = !blind;
|
|
182786
182828
|
fallbackHint = blind && step.condition === "hidden" && data.source === "macos-fallback" ? data.hint : void 0;
|
|
182787
182829
|
if (!blind && evaluateCondition(
|
|
182788
182830
|
step.condition,
|
|
182789
182831
|
step.expectedText,
|
|
182790
|
-
|
|
182832
|
+
matches2,
|
|
182791
182833
|
step.textMatch,
|
|
182792
182834
|
env.device.platform === "macos"
|
|
182793
182835
|
)) {
|
|
@@ -183088,6 +183130,7 @@ function assertReason(condition, selector, expectedText, textMatch, matches2, ma
|
|
|
183088
183130
|
}
|
|
183089
183131
|
|
|
183090
183132
|
// ../tool-server/src/tools/flows/flow-tool-inputs.ts
|
|
183133
|
+
var import_promises20 = require("node:fs/promises");
|
|
183091
183134
|
var path60 = __toESM(require("node:path"));
|
|
183092
183135
|
init_src2();
|
|
183093
183136
|
|
|
@@ -183325,12 +183368,15 @@ var UPLOAD_STAGE_BY_KIND = {
|
|
|
183325
183368
|
recording: "flow_upload_recording_tool"
|
|
183326
183369
|
};
|
|
183327
183370
|
function nestedFlowRef(args) {
|
|
183328
|
-
if (typeof args.name === "string") return ` (name: ${args.name})`;
|
|
183329
|
-
if (typeof args.e2e_test_path === "string")
|
|
183371
|
+
if (typeof args.name === "string") return ` (name: ${escapeInline(args.name)})`;
|
|
183372
|
+
if (typeof args.e2e_test_path === "string")
|
|
183373
|
+
return ` (e2e_test_path: ${escapeInline(args.e2e_test_path)})`;
|
|
183330
183374
|
return "";
|
|
183331
183375
|
}
|
|
183332
183376
|
function toolStepFilePaths(registry2, tool, args) {
|
|
183333
|
-
return toolStepFiles(registry2.getTool(tool)?.fileInputs, args)
|
|
183377
|
+
return toolStepFiles(registry2.getTool(tool)?.fileInputs, args).filter(
|
|
183378
|
+
({ spec }) => spec.kind !== "probe" || spec.target !== "project_root"
|
|
183379
|
+
);
|
|
183334
183380
|
}
|
|
183335
183381
|
function isFileArgument({ spec }) {
|
|
183336
183382
|
return spec.kind === "file" && spec.path === `\${${spec.target}}`;
|
|
@@ -183359,7 +183405,7 @@ function toolStepUploadIssue(registry2, tool, args, withFiles) {
|
|
|
183359
183405
|
}
|
|
183360
183406
|
return {
|
|
183361
183407
|
kind: "toolFile",
|
|
183362
|
-
line: `tool: ${tool} (${refused.map((file2) => file2.path).join(", ")})`,
|
|
183408
|
+
line: `tool: ${tool} (${refused.map((file2) => escapeInline(file2.path)).join(", ")})`,
|
|
183363
183409
|
fixes: [...fixes]
|
|
183364
183410
|
};
|
|
183365
183411
|
}
|
|
@@ -183387,22 +183433,23 @@ async function prepareToolStepInputs(registry2, project, toolId, args) {
|
|
|
183387
183433
|
if (project instanceof ClientProjectAccess && canonicalToolId(toolId) === "e2e-execute") {
|
|
183388
183434
|
return prepareNestedFlow(registry2, project, toolId, args);
|
|
183389
183435
|
}
|
|
183390
|
-
const files =
|
|
183436
|
+
const files = toolStepFilePaths(registry2, toolId, args).filter(
|
|
183391
183437
|
({ spec }) => spec.unwrapWhenSet === void 0 || args[spec.unwrapWhenSet] === void 0
|
|
183392
|
-
)
|
|
183438
|
+
);
|
|
183439
|
+
if (project.mode === "host") return prepareHostFileArguments(toolId, files, args);
|
|
183393
183440
|
if (files.length === 0) return { args, cleanup: async () => {
|
|
183394
183441
|
} };
|
|
183395
183442
|
const wrapped = { ...args };
|
|
183396
183443
|
for (const file2 of files) {
|
|
183397
183444
|
if (!isClientFileArgument(file2)) {
|
|
183398
183445
|
throw new FileInputError(
|
|
183399
|
-
`"${file2.path}" (argument ${file2.spec.target} of ${toolId}) cannot be read from the client`
|
|
183446
|
+
`"${escapeInline(file2.path)}" (argument ${file2.spec.target} of ${toolId}) cannot be read from the client`
|
|
183400
183447
|
);
|
|
183401
183448
|
}
|
|
183402
183449
|
const bytes = await project.readFile(file2.path);
|
|
183403
183450
|
if (bytes === null) {
|
|
183404
183451
|
throw new FileInputError(
|
|
183405
|
-
`the client has no file at "${file2.path}" (argument ${file2.spec.target} of ${toolId})`
|
|
183452
|
+
`the client has no file at "${escapeInline(file2.path)}" (argument ${file2.spec.target} of ${toolId})`
|
|
183406
183453
|
);
|
|
183407
183454
|
}
|
|
183408
183455
|
const wire = {
|
|
@@ -183420,6 +183467,40 @@ async function prepareToolStepInputs(registry2, project, toolId, args) {
|
|
|
183420
183467
|
cleanup: resolved.cleanup
|
|
183421
183468
|
};
|
|
183422
183469
|
}
|
|
183470
|
+
async function prepareHostFileArguments(toolId, files, args) {
|
|
183471
|
+
const fileArgs = files.filter(isFileArgument);
|
|
183472
|
+
if (fileArgs.length === 0) return { args, cleanup: async () => {
|
|
183473
|
+
} };
|
|
183474
|
+
const wrapped = { ...args };
|
|
183475
|
+
for (const file2 of fileArgs) {
|
|
183476
|
+
const where = `"${escapeInline(file2.path)}" (argument ${file2.spec.target} of ${toolId})`;
|
|
183477
|
+
let st;
|
|
183478
|
+
try {
|
|
183479
|
+
st = await (0, import_promises20.stat)(file2.path);
|
|
183480
|
+
} catch (err) {
|
|
183481
|
+
const code = err.code;
|
|
183482
|
+
if (code !== "ENOENT" && code !== "ENOTDIR") {
|
|
183483
|
+
throw new FileInputError(`cannot read ${where}: ${escapeInline(String(code ?? err))}`);
|
|
183484
|
+
}
|
|
183485
|
+
const relative9 = path60.isAbsolute(file2.path) || path60.win32.isAbsolute(file2.path) ? "" : isUnexpandedPath(file2.path) ? `; nothing expands "~", variables, commands or URLs in a file argument, so pass the file's absolute path` : `; a relative path is looked up in the tool server's working directory, not the e2e test's, so pass the file's absolute path`;
|
|
183486
|
+
throw new FileInputError(`there is no file at ${where}${relative9}`);
|
|
183487
|
+
}
|
|
183488
|
+
if (!st.isFile()) throw new FileInputError(`${where} is not a file`);
|
|
183489
|
+
const wire = {
|
|
183490
|
+
[FILE_INPUT_MARKER]: true,
|
|
183491
|
+
path: file2.path,
|
|
183492
|
+
size: st.size,
|
|
183493
|
+
mtimeMs: st.mtimeMs
|
|
183494
|
+
};
|
|
183495
|
+
wrapped[file2.spec.target] = wire;
|
|
183496
|
+
}
|
|
183497
|
+
const resolved = await resolveFileInputs({ fileInputs: fileArgs.map((f) => f.spec) }, wrapped);
|
|
183498
|
+
return {
|
|
183499
|
+
args: resolved.args,
|
|
183500
|
+
...resolved.fileInputs ? { fileInputs: resolved.fileInputs } : {},
|
|
183501
|
+
cleanup: resolved.cleanup
|
|
183502
|
+
};
|
|
183503
|
+
}
|
|
183423
183504
|
async function prepareNestedFlow(registry2, project, toolId, args) {
|
|
183424
183505
|
const target = nestedFlowTarget(args);
|
|
183425
183506
|
if (target?.kind !== "name") return { args, cleanup: async () => {
|
|
@@ -183466,7 +183547,7 @@ function yamlSelectorLabel(sel) {
|
|
|
183466
183547
|
function yamlTextConditionLabel(sel, expectedText, textMatch) {
|
|
183467
183548
|
const selector = yamlSelectorLabel(sel);
|
|
183468
183549
|
const expected = expectedText ?? "";
|
|
183469
|
-
return textMatch === "matches" ? `text ${selector} matches /${expected}/` : textMatch === "equals" ? `text ${selector} == ${JSON.stringify(expected)}` : `text ${selector} contains ${JSON.stringify(expected)}`;
|
|
183550
|
+
return textMatch === "matches" ? `text ${selector} matches /${escapeInline(expected)}/` : textMatch === "equals" ? `text ${selector} == ${JSON.stringify(expected)}` : `text ${selector} contains ${JSON.stringify(expected)}`;
|
|
183470
183551
|
}
|
|
183471
183552
|
function foldLabel(step) {
|
|
183472
183553
|
return step.posture ?? `${step.angle}\xB0`;
|
|
@@ -183563,27 +183644,27 @@ var UI_CONDITION_STEP = {
|
|
|
183563
183644
|
};
|
|
183564
183645
|
var FLOW_STEP_DEFINITIONS = {
|
|
183565
183646
|
"tool": {
|
|
183566
|
-
summary: (step) => `${step.name} ${renderToolArgs(step.args)}${delayLabel(step)}`,
|
|
183647
|
+
summary: (step) => `${escapeInline(String(step.name))} ${renderToolArgs(step.args)}${delayLabel(step)}`,
|
|
183567
183648
|
// Carries its subject in a report field of its own (`tool`) that renderers
|
|
183568
183649
|
// print in the target's place.
|
|
183569
183650
|
target: () => void 0
|
|
183570
183651
|
},
|
|
183571
183652
|
"echo": {
|
|
183572
|
-
summary: (step) => step.message,
|
|
183653
|
+
summary: (step) => escapeInline(step.message),
|
|
183573
183654
|
// As for `tool`, but the field is `message`.
|
|
183574
183655
|
target: () => void 0
|
|
183575
183656
|
},
|
|
183576
183657
|
"launch": {
|
|
183577
|
-
summary: (step) => typeof step.app === "string" ? step.app : JSON.stringify(step.app),
|
|
183658
|
+
summary: (step) => typeof step.app === "string" ? escapeInline(step.app) : JSON.stringify(step.app),
|
|
183578
183659
|
// A launch's app id may be per-platform (`appIdForPlatform`), and a step
|
|
183579
183660
|
// alone does not know the run device.
|
|
183580
183661
|
target: () => void 0
|
|
183581
183662
|
},
|
|
183582
183663
|
"run": {
|
|
183583
|
-
summary: (step) => step.flow,
|
|
183584
|
-
// The as-written path, so a report line shows
|
|
183585
|
-
// references (`run ../shared/login.yaml`), not just the attribution stem.
|
|
183586
|
-
target: (step) => step.flow
|
|
183664
|
+
summary: (step) => escapeInline(step.flow),
|
|
183665
|
+
// The as-written path (control characters escaped), so a report line shows
|
|
183666
|
+
// what the flow references (`run ../shared/login.yaml`), not just the attribution stem.
|
|
183667
|
+
target: (step) => escapeInline(step.flow)
|
|
183587
183668
|
},
|
|
183588
183669
|
"when": {
|
|
183589
183670
|
summary: (step) => {
|
|
@@ -183661,8 +183742,8 @@ var FLOW_STEP_DEFINITIONS = {
|
|
|
183661
183742
|
// author would open. `timeout` rides the summary alone: it changes what
|
|
183662
183743
|
// replays, the way tap's `times` does, while a report target names only
|
|
183663
183744
|
// what the step acts on.
|
|
183664
|
-
summary: (step) => `${step.path}${step.timeout !== void 0 ? ` (timeout ${step.timeout}ms)` : ""}`,
|
|
183665
|
-
target: (step) => step.path
|
|
183745
|
+
summary: (step) => `${escapeInline(step.path)}${step.timeout !== void 0 ? ` (timeout ${step.timeout}ms)` : ""}`,
|
|
183746
|
+
target: (step) => escapeInline(step.path)
|
|
183666
183747
|
},
|
|
183667
183748
|
"snapshot": {
|
|
183668
183749
|
// `name` interpolates raw on both surfaces. It becomes a baseline filename,
|
|
@@ -184045,7 +184126,7 @@ async function rewriteSiblingFlowPath(session, args, project, linked) {
|
|
|
184045
184126
|
const flowPath = args.e2e_test_path;
|
|
184046
184127
|
if (typeof flowPath !== "string" || args.name !== void 0) return;
|
|
184047
184128
|
const invalid3 = (detail) => new FailureError(
|
|
184048
|
-
`Cannot record an e2e-execute of e2e_test_path "${flowPath}": ${detail}.
|
|
184129
|
+
`Cannot record an e2e-execute of e2e_test_path "${flowPath}": ${detail}. The recorder keeps an e2e_test_path only as the name it equals \u2014 pass name + project_root for an e2e test saved beside the recording, or add a \`run: <relative path>.yaml\` step to the e2e test YAML by hand for a cross-directory target.`,
|
|
184049
184130
|
{
|
|
184050
184131
|
error_code: FAILURE_CODES.FLOW_FILE_INVALID,
|
|
184051
184132
|
failure_stage: "flow_add_step_flow_path",
|
|
@@ -184070,7 +184151,7 @@ async function rewriteSiblingFlowPath(session, args, project, linked) {
|
|
|
184070
184151
|
const otherDirs = e2eRunFallbackDirs(flowsDir, path61.basename(flowPath));
|
|
184071
184152
|
if (path61.resolve(flowDir) !== path61.resolve(flowsDir) && !otherDirs.some((dir) => path61.resolve(dir) === path61.resolve(flowDir))) {
|
|
184072
184153
|
throw invalid3(
|
|
184073
|
-
`it is not in the recording's e2e test directory ("${flowsDir}") or the project's other e2e test directory
|
|
184154
|
+
`it is not in the recording's e2e test directory ("${flowsDir}") or the project's other e2e test directory` + (path61.isAbsolute(flowPath) ? "" : `, as the tool server resolves a relative path against its own cwd ("${process.cwd()}"), not the calling agent's - pass the absolute path`)
|
|
184074
184155
|
);
|
|
184075
184156
|
}
|
|
184076
184157
|
const stem = bareExtension ? "" : path61.basename(flowPath, ".yaml");
|
|
@@ -184354,6 +184435,18 @@ Returns { message, stepCount, recorded, savedTo }; \`recorded\`, not the status,
|
|
|
184354
184435
|
}
|
|
184355
184436
|
);
|
|
184356
184437
|
}
|
|
184438
|
+
if (isDebuggerNotConnectedResult(params.command, toolResult)) {
|
|
184439
|
+
const note = toolResult.note;
|
|
184440
|
+
throw new FailureError(
|
|
184441
|
+
`${params.command}: debugger not connected (${toolResult.reason}) - nothing was recorded. ${toolResult.detail} ${toolResult.guidance}${typeof note === "string" ? ` ${note}` : ""}`,
|
|
184442
|
+
{
|
|
184443
|
+
error_code: FAILURE_CODES.DEBUGGER_NOT_CONNECTED,
|
|
184444
|
+
failure_stage: "flow_add_step_debugger_not_connected",
|
|
184445
|
+
failure_area: "tool_server",
|
|
184446
|
+
error_kind: "not_found"
|
|
184447
|
+
}
|
|
184448
|
+
);
|
|
184449
|
+
}
|
|
184357
184450
|
let waitWarning;
|
|
184358
184451
|
if (command === AWAIT_UI_ELEMENT_TOOL_ID) {
|
|
184359
184452
|
if (isUnmetUiWaitResult(params.command, toolResult)) {
|
|
@@ -184472,6 +184565,7 @@ var flowInsertEchoTool = {
|
|
|
184472
184565
|
Use when you want to annotate a recorded e2e test with a human-readable label or checkpoint message.
|
|
184473
184566
|
Returns { message, stepCount, savedTo }. Fails if that e2e test has no recording in progress.`,
|
|
184474
184567
|
zodSchema: zodSchema70,
|
|
184568
|
+
fileInputs: PROJECT_ROOT_INPUT,
|
|
184475
184569
|
aliases: ["flow-add-echo"],
|
|
184476
184570
|
interaction: {
|
|
184477
184571
|
// Name the flow: recordings are concurrent, so an unqualified message is ambiguous.
|
|
@@ -185868,8 +185962,8 @@ function scriptRan(result) {
|
|
|
185868
185962
|
}
|
|
185869
185963
|
async function scriptFileProblem(canonical) {
|
|
185870
185964
|
try {
|
|
185871
|
-
const
|
|
185872
|
-
return
|
|
185965
|
+
const stat12 = await fs76.stat(canonical);
|
|
185966
|
+
return stat12.isFile() ? null : "is not a file";
|
|
185873
185967
|
} catch (err) {
|
|
185874
185968
|
const code = err.code;
|
|
185875
185969
|
return code === "ENOENT" || code === "ENOTDIR" ? "does not exist" : `cannot be read: ${errMsg4(err)}`;
|
|
@@ -185958,6 +186052,7 @@ var flowAddScriptTool = {
|
|
|
185958
186052
|
id: "e2e-add-script",
|
|
185959
186053
|
description: `Run a local JavaScript (.mjs, .js) or TypeScript (.mts, .ts) file and record it as a \`script:\` step in an active e2e test. Use when the user requests a local script in the e2e test, and only then. Call it at the point in the recording where the script must run. Returns \`status\`, \`reason\` and \`stepCount\`. A failed script is not recorded. Check \`reason\` and the affected state before you retry. Over a link (argent link or ARGENT_TOOLS_URL), the tool refuses the call: record such an e2e test with no link.`,
|
|
185960
186054
|
zodSchema: zodSchema71,
|
|
186055
|
+
fileInputs: PROJECT_ROOT_INPUT,
|
|
185961
186056
|
aliases: ["flow-add-script"],
|
|
185962
186057
|
interaction: {
|
|
185963
186058
|
startedMsg: ({ params }) => `Running script for e2e test ${params.name}`,
|
|
@@ -186112,6 +186207,7 @@ var flowFinishRecordingTool = {
|
|
|
186112
186207
|
A warning e2e-add-step raised on a recorded \`await-ui-element\` is repeated in \`summary\` as a \`warning:\` line right below its step, and \`message\` counts them by kind. Read them before you convert a wait to \`await:\`/\`assert:\` or replay the e2e test.
|
|
186113
186208
|
You can still edit the .yaml file directly afterwards to remove or reorder steps.`,
|
|
186114
186209
|
zodSchema: zodSchema72,
|
|
186210
|
+
fileInputs: PROJECT_ROOT_INPUT,
|
|
186115
186211
|
aliases: ["flow-finish-recording"],
|
|
186116
186212
|
interaction: {
|
|
186117
186213
|
// Name the flow: other recordings stay live, so an unqualified message would
|
|
@@ -186243,7 +186339,7 @@ init_src2();
|
|
|
186243
186339
|
init_device_info();
|
|
186244
186340
|
|
|
186245
186341
|
// ../tool-server/src/tools/screenshot-diff/screenshot-diff.ts
|
|
186246
|
-
var
|
|
186342
|
+
var import_promises21 = __toESM(require("fs/promises"));
|
|
186247
186343
|
var import_path8 = __toESM(require("path"));
|
|
186248
186344
|
var import_pngjs6 = __toESM(require_png());
|
|
186249
186345
|
init_src2();
|
|
@@ -187988,7 +188084,7 @@ async function writeDiffArtifacts(params) {
|
|
|
187988
188084
|
}
|
|
187989
188085
|
async function decodePngFile(filePath) {
|
|
187990
188086
|
try {
|
|
187991
|
-
const buffer = await
|
|
188087
|
+
const buffer = await import_promises21.default.readFile(filePath);
|
|
187992
188088
|
const png = import_pngjs6.PNG.sync.read(buffer);
|
|
187993
188089
|
return {
|
|
187994
188090
|
width: png.width,
|
|
@@ -188043,8 +188139,8 @@ function luminanceFromOffset(data, offset) {
|
|
|
188043
188139
|
return 0.2126 * data[offset] + 0.7152 * data[offset + 1] + 0.0722 * data[offset + 2];
|
|
188044
188140
|
}
|
|
188045
188141
|
async function writePngFile(filePath, png) {
|
|
188046
|
-
await
|
|
188047
|
-
await
|
|
188142
|
+
await import_promises21.default.mkdir(import_path8.default.dirname(filePath), { recursive: true });
|
|
188143
|
+
await import_promises21.default.writeFile(filePath, import_pngjs6.PNG.sync.write(png));
|
|
188048
188144
|
}
|
|
188049
188145
|
function downscalePng(source, scale) {
|
|
188050
188146
|
const resized = resizeDecodedPng(
|
|
@@ -188730,7 +188826,8 @@ var fileInputs5 = [
|
|
|
188730
188826
|
kind: "file",
|
|
188731
188827
|
skipWhenSet: "e2e_test_path",
|
|
188732
188828
|
collect: "flow"
|
|
188733
|
-
}
|
|
188829
|
+
},
|
|
188830
|
+
...PROJECT_ROOT_INPUT
|
|
188734
188831
|
];
|
|
188735
188832
|
var FLOW_STARTING_TOOLS = /* @__PURE__ */ new Set(["e2e-execute", "e2e-add-step"]);
|
|
188736
188833
|
function nestedRunArgs(state3, tool, args) {
|
|
@@ -189125,9 +189222,10 @@ async function findUnrunnableScript(steps) {
|
|
|
189125
189222
|
}
|
|
189126
189223
|
async function fragmentLoadRefusal(registry2, fragment, target) {
|
|
189127
189224
|
const retiredArg = findRetiredToolArg(registry2, fragment.steps);
|
|
189128
|
-
|
|
189225
|
+
const shown = escapeInline(target);
|
|
189226
|
+
if (retiredArg) return `fragment "${shown}" ${retiredArgReason(retiredArg)}`;
|
|
189129
189227
|
const unrunnableScript = await findUnrunnableScript(fragment.steps);
|
|
189130
|
-
return unrunnableScript ? `fragment "${
|
|
189228
|
+
return unrunnableScript ? `fragment "${shown}" cannot run. ${unrunnableScript}` : void 0;
|
|
189131
189229
|
}
|
|
189132
189230
|
function assertUploadSelfContained(registry2, flow, closure, origin = {
|
|
189133
189231
|
subject: "This e2e test",
|
|
@@ -189145,7 +189243,10 @@ function assertUploadSelfContained(registry2, flow, closure, origin = {
|
|
|
189145
189243
|
seen.add(key2);
|
|
189146
189244
|
const member = entry.kind === "run" ? closure.project.runMember(anchorDir, target) : closure.project.savedTestMember(entry.paths);
|
|
189147
189245
|
if (member?.state === "refused") {
|
|
189148
|
-
offending.push({
|
|
189246
|
+
offending.push({
|
|
189247
|
+
kind: entry.kind,
|
|
189248
|
+
line: `${entry.line} (${escapeInline(String(member.error))})`
|
|
189249
|
+
});
|
|
189149
189250
|
} else if (member?.state === "present" && member.canonical !== void 0 && file2.hop + 1 < MAX_RUN_DEPTH) {
|
|
189150
189251
|
let next;
|
|
189151
189252
|
try {
|
|
@@ -189156,7 +189257,7 @@ function assertUploadSelfContained(registry2, flow, closure, origin = {
|
|
|
189156
189257
|
queue.push({
|
|
189157
189258
|
flow: next,
|
|
189158
189259
|
canonical: member.canonical,
|
|
189159
|
-
within: ` in ${member.canonical}`,
|
|
189260
|
+
within: ` in ${escapeInline(member.canonical)}`,
|
|
189160
189261
|
hop: file2.hop + 1
|
|
189161
189262
|
});
|
|
189162
189263
|
}
|
|
@@ -189164,11 +189265,14 @@ function assertUploadSelfContained(registry2, flow, closure, origin = {
|
|
|
189164
189265
|
for (let file2 = queue.shift(); file2 !== void 0; file2 = queue.shift()) {
|
|
189165
189266
|
for (const { step, where } of walkSteps(file2.flow.steps, file2.within)) {
|
|
189166
189267
|
if (step.kind === "run") {
|
|
189167
|
-
const line = `${where}: run: ${step.flow}`;
|
|
189268
|
+
const line = `${where}: run: ${escapeInline(step.flow)}`;
|
|
189168
189269
|
if (!closure) offending.push({ kind: "run", line });
|
|
189169
189270
|
else follow(file2, path66.dirname(file2.canonical), step.flow, { kind: "run", line });
|
|
189170
189271
|
} else if (step.kind === "script") {
|
|
189171
|
-
offending.push({
|
|
189272
|
+
offending.push({
|
|
189273
|
+
kind: "script",
|
|
189274
|
+
line: `${where}: script: { path: ${escapeInline(step.path)} }`
|
|
189275
|
+
});
|
|
189172
189276
|
} else if (step.kind === "snapshot") {
|
|
189173
189277
|
if (closure) continue;
|
|
189174
189278
|
offending.push({ kind: "snapshot", line: `${where}: snapshot: ${step.name}` });
|
|
@@ -189419,6 +189523,7 @@ Without a link, every step kind runs.`,
|
|
|
189419
189523
|
...resolved.booted ? { hoistedBootMs: Date.now() - resolveStartedAt } : {},
|
|
189420
189524
|
chromiumLaunched: false,
|
|
189421
189525
|
snapshotApps: /* @__PURE__ */ new Map(),
|
|
189526
|
+
secret: ctx?.flowSecret ?? {},
|
|
189422
189527
|
projectRoot: params.project_root,
|
|
189423
189528
|
scriptLogBudget: createScriptLogBudget(),
|
|
189424
189529
|
networkCaptureNoted: /* @__PURE__ */ new Map(),
|
|
@@ -189683,7 +189788,7 @@ function runDisplayFor(target, rootDisplay) {
|
|
|
189683
189788
|
const stem = runTargetName(target);
|
|
189684
189789
|
if (stem !== rootDisplay) return stem;
|
|
189685
189790
|
const spelled = target.slice(0, -".yaml".length);
|
|
189686
|
-
return spelled === stem ? `./${stem}` : spelled;
|
|
189791
|
+
return spelled === stem ? `./${stem}` : escapeInline(spelled);
|
|
189687
189792
|
}
|
|
189688
189793
|
function stepFlow(step, scope) {
|
|
189689
189794
|
return step.kind === "run" ? runDisplayName(step.flow, scope) : scopeFlow(scope);
|
|
@@ -189712,7 +189817,7 @@ async function execSteps(state3, steps, scope) {
|
|
|
189712
189817
|
...stopReason ? { reason: stopReason } : {},
|
|
189713
189818
|
// Carry the echo's message so a skipped narration renders as a skip
|
|
189714
189819
|
// line rather than vanishing — matching reportBlockSkipped.
|
|
189715
|
-
...step.kind === "echo" ? { message: step.message } : {}
|
|
189820
|
+
...step.kind === "echo" ? { message: escapeInline(step.message) } : {}
|
|
189716
189821
|
});
|
|
189717
189822
|
const inner = blockSteps(step);
|
|
189718
189823
|
if (inner) reportBlockSkipped(state3, inner, childScope(scope), stopReason);
|
|
@@ -189743,7 +189848,7 @@ async function execSteps(state3, steps, scope) {
|
|
|
189743
189848
|
e2eTest: stepFlow(step, scope),
|
|
189744
189849
|
target: stepTarget(step),
|
|
189745
189850
|
...depthOf(scope),
|
|
189746
|
-
...step.kind === "echo" ? { message: step.message } : {}
|
|
189851
|
+
...step.kind === "echo" ? { message: escapeInline(step.message) } : {}
|
|
189747
189852
|
});
|
|
189748
189853
|
const inner = blockSteps(step);
|
|
189749
189854
|
if (inner) reportBlockSkipped(state3, inner, childScope(scope), "run aborted");
|
|
@@ -189762,7 +189867,7 @@ async function execSteps(state3, steps, scope) {
|
|
|
189762
189867
|
startedAt -= state3.hoistedBootMs;
|
|
189763
189868
|
state3.hoistedBootMs = void 0;
|
|
189764
189869
|
}
|
|
189765
|
-
if (JSON.stringify(step).includes(SECRET_PLACEHOLDER_MARKER)) state3.
|
|
189870
|
+
if (JSON.stringify(step).includes(SECRET_PLACEHOLDER_MARKER)) state3.secret.typed = true;
|
|
189766
189871
|
const report = await inCoordinateSpace(
|
|
189767
189872
|
scope.legacyPoints && step.kind === "tool" ? "native" : "upright",
|
|
189768
189873
|
() => execLeafStep(state3, step, index, scope)
|
|
@@ -189777,7 +189882,7 @@ async function execSteps(state3, steps, scope) {
|
|
|
189777
189882
|
}
|
|
189778
189883
|
}
|
|
189779
189884
|
async function captureFailureScreen(state3) {
|
|
189780
|
-
if (!state3.device || state3.signal?.aborted || state3.
|
|
189885
|
+
if (!state3.device || state3.signal?.aborted || state3.secret.typed) return void 0;
|
|
189781
189886
|
try {
|
|
189782
189887
|
const shot = await invokeOnDevice(deviceEnv(state3), "screenshot", {
|
|
189783
189888
|
scale: 1,
|
|
@@ -189798,7 +189903,7 @@ function reportBlockSkipped(state3, steps, scope, reason2) {
|
|
|
189798
189903
|
e2eTest: stepFlow(step, scope),
|
|
189799
189904
|
target: stepTarget(step),
|
|
189800
189905
|
...depthOf(scope),
|
|
189801
|
-
...step.kind === "echo" ? { message: step.message } : {}
|
|
189906
|
+
...step.kind === "echo" ? { message: escapeInline(step.message) } : {}
|
|
189802
189907
|
});
|
|
189803
189908
|
const inner = blockSteps(step);
|
|
189804
189909
|
if (inner) reportBlockSkipped(state3, inner, childScope(scope), reason2);
|
|
@@ -189874,6 +189979,7 @@ async function execWhenStep(state3, step, scope) {
|
|
|
189874
189979
|
async function execRunStep(state3, step, scope) {
|
|
189875
189980
|
const index = state3.reports.length;
|
|
189876
189981
|
const target = step.flow;
|
|
189982
|
+
const shown = escapeInline(target);
|
|
189877
189983
|
const display = runDisplayName(target, scope);
|
|
189878
189984
|
const startedAt = Date.now();
|
|
189879
189985
|
const fail = (reason2) => {
|
|
@@ -189882,7 +189988,7 @@ async function execRunStep(state3, step, scope) {
|
|
|
189882
189988
|
kind: "run",
|
|
189883
189989
|
status: "error",
|
|
189884
189990
|
e2eTest: display,
|
|
189885
|
-
target,
|
|
189991
|
+
target: stepTarget(step),
|
|
189886
189992
|
reason: reason2,
|
|
189887
189993
|
...depthOf(scope),
|
|
189888
189994
|
durationMs: Date.now() - startedAt
|
|
@@ -189893,7 +189999,7 @@ async function execRunStep(state3, step, scope) {
|
|
|
189893
189999
|
try {
|
|
189894
190000
|
hop = await resolveRunTarget(state3.project, scopeFlowDir(scope), target);
|
|
189895
190001
|
} catch (err) {
|
|
189896
|
-
return fail(`could not load fragment "${
|
|
190002
|
+
return fail(`could not load fragment "${shown}": ${escapeInline(errMsg5(err))}`);
|
|
189897
190003
|
}
|
|
189898
190004
|
const { canonical, spelling } = hop;
|
|
189899
190005
|
if (scope.runStack.some((entry) => entry.canonical === canonical)) {
|
|
@@ -189906,28 +190012,33 @@ async function execRunStep(state3, step, scope) {
|
|
|
189906
190012
|
}
|
|
189907
190013
|
const suppliedBase = path66.posix.basename(target);
|
|
189908
190014
|
if (spelling.state === "case_folded") {
|
|
189909
|
-
const recovery = spelling.addressable ? `reference it as "${target.slice(0, target.length - suppliedBase.length)}${spelling.actual}"` : `rename "${spelling.actual}" to "${suppliedBase}" to compose it \u2014 e2e test files must be lowercase .yaml`;
|
|
190015
|
+
const recovery = spelling.addressable ? `reference it as "${escapeInline(target.slice(0, target.length - suppliedBase.length))}${spelling.actual}"` : `rename "${spelling.actual}" to "${suppliedBase}" to compose it \u2014 e2e test files must be lowercase .yaml`;
|
|
190016
|
+
return fail(
|
|
190017
|
+
`mis-cased fragment reference "${shown}": no directory entry is named "${suppliedBase}" (this filesystem matched it case-insensitively to "${spelling.actual}"), so the fragment name keying its step reports is one nothing on disk carries and a case-sensitive checkout could not find the file at all \u2014 ${recovery}`
|
|
190018
|
+
);
|
|
190019
|
+
}
|
|
190020
|
+
let text;
|
|
190021
|
+
try {
|
|
190022
|
+
text = await hop.read();
|
|
190023
|
+
} catch (err) {
|
|
190024
|
+
return fail(`could not load fragment "${shown}": ${escapeInline(errMsg5(err))}`);
|
|
190025
|
+
}
|
|
190026
|
+
if (text === null) {
|
|
189910
190027
|
return fail(
|
|
189911
|
-
`
|
|
190028
|
+
`could not load fragment "${shown}": ENOENT: no such file or directory, open '${escapeInline(canonical)}'`
|
|
189912
190029
|
);
|
|
189913
190030
|
}
|
|
189914
190031
|
let fragment;
|
|
189915
190032
|
try {
|
|
189916
|
-
const text = await hop.read();
|
|
189917
|
-
if (text === null) {
|
|
189918
|
-
return fail(
|
|
189919
|
-
`could not load fragment "${target}": ENOENT: no such file or directory, open '${canonical}'`
|
|
189920
|
-
);
|
|
189921
|
-
}
|
|
189922
190033
|
fragment = parseFlow(text);
|
|
189923
190034
|
} catch (err) {
|
|
189924
|
-
return fail(`could not load fragment "${
|
|
190035
|
+
return fail(`could not load fragment "${shown}": ${errMsg5(err)}`);
|
|
189925
190036
|
}
|
|
189926
190037
|
const refusal = await fragmentLoadRefusal(state3.registry, fragment, target);
|
|
189927
190038
|
if (refusal !== void 0) return fail(refusal);
|
|
189928
190039
|
if (state3.device) {
|
|
189929
190040
|
try {
|
|
189930
|
-
await assertDeviceMeetsRequires(state3.device, fragment.requires, `Fragment "${
|
|
190041
|
+
await assertDeviceMeetsRequires(state3.device, fragment.requires, `Fragment "${shown}"`);
|
|
189931
190042
|
} catch (err) {
|
|
189932
190043
|
return fail(errMsg5(err));
|
|
189933
190044
|
}
|
|
@@ -189937,7 +190048,7 @@ async function execRunStep(state3, step, scope) {
|
|
|
189937
190048
|
kind: "run",
|
|
189938
190049
|
status: "pass",
|
|
189939
190050
|
e2eTest: display,
|
|
189940
|
-
target,
|
|
190051
|
+
target: stepTarget(step),
|
|
189941
190052
|
...depthOf(scope),
|
|
189942
190053
|
durationMs: Date.now() - startedAt
|
|
189943
190054
|
});
|
|
@@ -190001,7 +190112,7 @@ async function execLeafStep(state3, step, index, scope) {
|
|
|
190001
190112
|
const { registry: registry2, ctx, device, signal } = state3;
|
|
190002
190113
|
switch (step.kind) {
|
|
190003
190114
|
case "echo":
|
|
190004
|
-
return { ...base, status: "pass", message: step.message };
|
|
190115
|
+
return { ...base, status: "pass", message: escapeInline(step.message) };
|
|
190005
190116
|
case "launch": {
|
|
190006
190117
|
const r = await runLaunch(state3, step.app);
|
|
190007
190118
|
if (r.aborted) return { ...base, status: "skip", reason: r.reason };
|
|
@@ -190125,7 +190236,7 @@ async function execLeafStep(state3, step, index, scope) {
|
|
|
190125
190236
|
...prepared.fileInputs ? { fileInputs: prepared.fileInputs } : {},
|
|
190126
190237
|
// The two tools that can start a nested run continue this run's
|
|
190127
190238
|
// stack, so a flow that runs itself stops at the cycle guard.
|
|
190128
|
-
...FLOW_STARTING_TOOLS.has(canonicalToolId(step.name)) ? { flowStack: scope.runStack } : {}
|
|
190239
|
+
...FLOW_STARTING_TOOLS.has(canonicalToolId(step.name)) ? { flowStack: scope.runStack, flowSecret: state3.secret } : {}
|
|
190129
190240
|
});
|
|
190130
190241
|
const verdict = toolResultVerdict(step.name, result);
|
|
190131
190242
|
if (verdict) {
|
|
@@ -190218,7 +190329,7 @@ function assertFlowPathShape(flowPath) {
|
|
|
190218
190329
|
}
|
|
190219
190330
|
if (flowPath.split(/[\\/]+/).includes("..")) {
|
|
190220
190331
|
throw new FailureError(
|
|
190221
|
-
`Invalid e2e_test_path "${flowPath}": e2e test paths must not contain ".." segments \u2014 a ".." after a symlinked directory can name a different file than the spelling suggests
|
|
190332
|
+
`Invalid e2e_test_path "${flowPath}": e2e test paths must not contain ".." segments \u2014 a ".." after a symlinked directory can name a different file than the spelling suggests. Pass the fully resolved absolute path to the e2e test's YAML.`,
|
|
190222
190333
|
{
|
|
190223
190334
|
error_code: FAILURE_CODES.FLOW_FILE_INVALID,
|
|
190224
190335
|
failure_stage: "flow_path_dotdot",
|
|
@@ -190342,7 +190453,8 @@ var fileInputs6 = [
|
|
|
190342
190453
|
paths: E2E_FILE_TEMPLATES,
|
|
190343
190454
|
kind: "file",
|
|
190344
190455
|
skipWhenSet: "e2e_test_path"
|
|
190345
|
-
}
|
|
190456
|
+
},
|
|
190457
|
+
...PROJECT_ROOT_INPUT
|
|
190346
190458
|
];
|
|
190347
190459
|
var zodSchema74 = external_exports.object({
|
|
190348
190460
|
name: external_exports.string().optional().describe(
|
|
@@ -190411,13 +190523,13 @@ Address the e2e test exactly as you will address it in e2e-execute: name or e2e_
|
|
|
190411
190523
|
init_zod();
|
|
190412
190524
|
|
|
190413
190525
|
// ../tool-server/src/utils/workspace-reader.ts
|
|
190414
|
-
var
|
|
190526
|
+
var import_promises22 = require("node:fs/promises");
|
|
190415
190527
|
var import_node_path30 = require("node:path");
|
|
190416
190528
|
var import_node_child_process54 = require("node:child_process");
|
|
190417
190529
|
var import_dotenv2 = __toESM(require_dist());
|
|
190418
190530
|
async function exists2(path72) {
|
|
190419
190531
|
try {
|
|
190420
|
-
await (0,
|
|
190532
|
+
await (0, import_promises22.access)(path72);
|
|
190421
190533
|
return true;
|
|
190422
190534
|
} catch {
|
|
190423
190535
|
return false;
|
|
@@ -190425,7 +190537,7 @@ async function exists2(path72) {
|
|
|
190425
190537
|
}
|
|
190426
190538
|
async function isDirectory2(path72) {
|
|
190427
190539
|
try {
|
|
190428
|
-
const s = await (0,
|
|
190540
|
+
const s = await (0, import_promises22.stat)(path72);
|
|
190429
190541
|
return s.isDirectory();
|
|
190430
190542
|
} catch {
|
|
190431
190543
|
return false;
|
|
@@ -190433,7 +190545,7 @@ async function isDirectory2(path72) {
|
|
|
190433
190545
|
}
|
|
190434
190546
|
async function readJsonFile(path72) {
|
|
190435
190547
|
try {
|
|
190436
|
-
const raw = await (0,
|
|
190548
|
+
const raw = await (0, import_promises22.readFile)(path72, "utf-8");
|
|
190437
190549
|
return JSON.parse(raw);
|
|
190438
190550
|
} catch {
|
|
190439
190551
|
return null;
|
|
@@ -190441,14 +190553,14 @@ async function readJsonFile(path72) {
|
|
|
190441
190553
|
}
|
|
190442
190554
|
async function readTextFile(path72) {
|
|
190443
190555
|
try {
|
|
190444
|
-
return await (0,
|
|
190556
|
+
return await (0, import_promises22.readFile)(path72, "utf-8");
|
|
190445
190557
|
} catch {
|
|
190446
190558
|
return null;
|
|
190447
190559
|
}
|
|
190448
190560
|
}
|
|
190449
190561
|
async function listDir(path72) {
|
|
190450
190562
|
try {
|
|
190451
|
-
const entries = await (0,
|
|
190563
|
+
const entries = await (0, import_promises22.readdir)(path72);
|
|
190452
190564
|
return entries;
|
|
190453
190565
|
} catch {
|
|
190454
190566
|
return null;
|
|
@@ -190948,7 +191060,7 @@ var dismissUpdateTool = {
|
|
|
190948
191060
|
|
|
190949
191061
|
// ../tool-server/src/tools/screenshot-diff/index.ts
|
|
190950
191062
|
var import_node_crypto20 = __toESM(require("node:crypto"));
|
|
190951
|
-
var
|
|
191063
|
+
var import_promises23 = __toESM(require("fs/promises"));
|
|
190952
191064
|
var import_node_os17 = __toESM(require("node:os"));
|
|
190953
191065
|
var import_path9 = __toESM(require("path"));
|
|
190954
191066
|
init_zod();
|
|
@@ -191093,7 +191205,7 @@ async function resolveOutputDir(params, options) {
|
|
|
191093
191205
|
}
|
|
191094
191206
|
if (params.outputDir) {
|
|
191095
191207
|
try {
|
|
191096
|
-
await
|
|
191208
|
+
await import_promises23.default.mkdir(params.outputDir);
|
|
191097
191209
|
return params.outputDir;
|
|
191098
191210
|
} catch (err) {
|
|
191099
191211
|
if (err.code === "EEXIST") return params.outputDir;
|
|
@@ -191104,7 +191216,7 @@ async function resolveOutputDir(params, options) {
|
|
|
191104
191216
|
"argent-screenshot-diff",
|
|
191105
191217
|
import_node_crypto20.default.randomBytes(6).toString("hex")
|
|
191106
191218
|
);
|
|
191107
|
-
await
|
|
191219
|
+
await import_promises23.default.mkdir(dir, { recursive: true });
|
|
191108
191220
|
return dir;
|
|
191109
191221
|
}
|
|
191110
191222
|
async function resolveInputPaths(services, params, outputDir, options, captureScreenshot2, peekFor) {
|
|
@@ -191209,8 +191321,8 @@ async function captureIosDeviceLiveInput(params) {
|
|
|
191209
191321
|
async function writeLivePng(outputDir, name, png) {
|
|
191210
191322
|
const suffix = import_node_crypto20.default.randomBytes(4).toString("hex");
|
|
191211
191323
|
const destination = import_path9.default.join(outputDir, `${name}-${suffix}.live.png`);
|
|
191212
|
-
await
|
|
191213
|
-
await
|
|
191324
|
+
await import_promises23.default.mkdir(outputDir, { recursive: true });
|
|
191325
|
+
await import_promises23.default.writeFile(destination, png);
|
|
191214
191326
|
return destination;
|
|
191215
191327
|
}
|
|
191216
191328
|
async function captureHarmonyLiveInput(params) {
|
|
@@ -191228,10 +191340,10 @@ async function captureHarmonyLiveInput(params) {
|
|
|
191228
191340
|
const suffix = import_node_crypto20.default.randomBytes(4).toString("hex");
|
|
191229
191341
|
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
191230
191342
|
try {
|
|
191231
|
-
await
|
|
191232
|
-
await
|
|
191343
|
+
await import_promises23.default.mkdir(params.outputDir, { recursive: true });
|
|
191344
|
+
await import_promises23.default.copyFile(captured, destination);
|
|
191233
191345
|
} finally {
|
|
191234
|
-
await
|
|
191346
|
+
await import_promises23.default.rm(captured, { force: true }).catch(() => {
|
|
191235
191347
|
});
|
|
191236
191348
|
}
|
|
191237
191349
|
return destination;
|
|
@@ -191263,8 +191375,8 @@ async function captureLiveInput(params) {
|
|
|
191263
191375
|
}
|
|
191264
191376
|
const suffix = import_node_crypto20.default.randomBytes(4).toString("hex");
|
|
191265
191377
|
const destination = import_path9.default.join(params.outputDir, `${params.name}-${suffix}.live.png`);
|
|
191266
|
-
await
|
|
191267
|
-
await
|
|
191378
|
+
await import_promises23.default.mkdir(params.outputDir, { recursive: true });
|
|
191379
|
+
await import_promises23.default.copyFile(capture.path, destination);
|
|
191268
191380
|
const warning = [panel?.warning, capture.note].filter((w) => w !== void 0).join(" ");
|
|
191269
191381
|
return { path: destination, ...warning ? { warning } : {} };
|
|
191270
191382
|
}
|