@swmansion/argent 0.35.1-next.34 → 0.35.1-next.35
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 +248 -113
- package/dist/installer.mjs +1 -1
- package/dist/mcp-server.mjs +1 -1
- package/dist/tool-args.generated.d.ts +10 -0
- package/dist/tool-server.cjs +1648 -1194
- package/package.json +2 -2
- package/skills/argent-create-e2e/SKILL.md +1 -0
package/dist/cli-cmds.mjs
CHANGED
|
@@ -24002,8 +24002,8 @@ var error43 = () => {
|
|
|
24002
24002
|
case "not_multiple_of":
|
|
24003
24003
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
24004
24004
|
case "unrecognized_keys": {
|
|
24005
|
-
const
|
|
24006
|
-
return `Chave${
|
|
24005
|
+
const plural4 = issue2.keys.length > 1 ? "s" : "";
|
|
24006
|
+
return `Chave${plural4} inv\xE1lida${plural4}: ${joinValues(issue2.keys, ", ")}`;
|
|
24007
24007
|
}
|
|
24008
24008
|
case "invalid_key":
|
|
24009
24009
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -24147,8 +24147,8 @@ var error44 = () => {
|
|
|
24147
24147
|
case "not_multiple_of":
|
|
24148
24148
|
return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${issue2.divisor}`;
|
|
24149
24149
|
case "unrecognized_keys": {
|
|
24150
|
-
const
|
|
24151
|
-
return `Chave${
|
|
24150
|
+
const plural4 = issue2.keys.length > 1 ? "s" : "";
|
|
24151
|
+
return `Chave${plural4} inv\xE1lida${plural4}: ${joinValues(issue2.keys, ", ")}`;
|
|
24152
24152
|
}
|
|
24153
24153
|
case "invalid_key":
|
|
24154
24154
|
return `Entrada inv\xE1lida n${translateOriginWithArticle(issue2.origin, "definite")}`;
|
|
@@ -38596,7 +38596,7 @@ function isCi(env = process.env) {
|
|
|
38596
38596
|
var SESSION_ID2 = randomUUID5();
|
|
38597
38597
|
function readCliVersion() {
|
|
38598
38598
|
if (true) {
|
|
38599
|
-
return "0.35.1-next.
|
|
38599
|
+
return "0.35.1-next.35";
|
|
38600
38600
|
}
|
|
38601
38601
|
return "0.0.0";
|
|
38602
38602
|
}
|
|
@@ -39887,6 +39887,19 @@ Subcommands:
|
|
|
39887
39887
|
path and an optional warning and suite per entry,
|
|
39888
39888
|
plus name, legacy and shadowedBy when no dir is
|
|
39889
39889
|
given
|
|
39890
|
+
check <test|test.yaml> [--json]
|
|
39891
|
+
Check an e2e test without a device and without
|
|
39892
|
+
running a step: parse it, apply the checks \`run\`
|
|
39893
|
+
makes before the first step, and check tool names,
|
|
39894
|
+
tool arguments and script files, also in the run:
|
|
39895
|
+
fragments and e2e-execute tests its steps reach.
|
|
39896
|
+
Reports every step that does not parse; a file
|
|
39897
|
+
with such a step gets no other check.
|
|
39898
|
+
Prints each problem on stderr and exits 1 when it
|
|
39899
|
+
finds one.
|
|
39900
|
+
--json prints { "ok", "e2eTests": [...] } instead,
|
|
39901
|
+
with path, ok and problems (file, at, code,
|
|
39902
|
+
message) per test
|
|
39890
39903
|
|
|
39891
39904
|
Options (run):
|
|
39892
39905
|
--device <id> Device id to run against (auto-detected when omitted)
|
|
@@ -39920,6 +39933,7 @@ Examples:
|
|
|
39920
39933
|
argent e2e run ~/shared-e2e/checkout.yaml --device <UDID> --update-baselines
|
|
39921
39934
|
argent e2e run .argent/e2e --recursive
|
|
39922
39935
|
argent e2e run checkout --env API_URL=https://staging.example.com
|
|
39936
|
+
argent e2e check checkout
|
|
39923
39937
|
`);
|
|
39924
39938
|
}
|
|
39925
39939
|
var RUN_OPTIONS = {
|
|
@@ -39938,6 +39952,9 @@ var LIST_OPTIONS = {
|
|
|
39938
39952
|
json: { kind: "boolean" },
|
|
39939
39953
|
recursive: { kind: "boolean", alias: "r" }
|
|
39940
39954
|
};
|
|
39955
|
+
var CHECK_OPTIONS = {
|
|
39956
|
+
json: { kind: "boolean" }
|
|
39957
|
+
};
|
|
39941
39958
|
function parseRunArgs(argv) {
|
|
39942
39959
|
let parsed;
|
|
39943
39960
|
try {
|
|
@@ -40373,7 +40390,7 @@ async function resolveFlowRef(ref, projectRoot) {
|
|
|
40373
40390
|
...picked.shadowed === void 0 ? {} : { shadowed: path20.relative(projectRoot, picked.shadowed) }
|
|
40374
40391
|
};
|
|
40375
40392
|
}
|
|
40376
|
-
async function savedFlowHint(projectRoot, missingPath) {
|
|
40393
|
+
async function savedFlowHint(sub, projectRoot, missingPath) {
|
|
40377
40394
|
const dirs = E2E_DIRS.map((rel) => ({ rel, abs: path20.resolve(projectRoot, rel) }));
|
|
40378
40395
|
for (const { abs } of dirs) {
|
|
40379
40396
|
const within = path20.relative(abs, missingPath);
|
|
@@ -40389,10 +40406,107 @@ async function savedFlowHint(projectRoot, missingPath) {
|
|
|
40389
40406
|
if (!SAFE_FLOW_NAME.test(name)) return "";
|
|
40390
40407
|
if (!await isRunnableFlowFile(path20.join(abs, actual))) return "";
|
|
40391
40408
|
return `
|
|
40392
|
-
An e2e test named "${name}" is saved under ${rel} \u2014 did you mean: argent e2e
|
|
40409
|
+
An e2e test named "${name}" is saved under ${rel} \u2014 did you mean: argent e2e ${sub} ${name}`;
|
|
40393
40410
|
}
|
|
40394
40411
|
return "";
|
|
40395
40412
|
}
|
|
40413
|
+
async function resolveE2eTarget(sub, ref, { suppliedPath, fromName }, projectRoot, recursive2) {
|
|
40414
|
+
const refuse = (message) => ({ kind: "refused", message });
|
|
40415
|
+
if (suppliedPath.split(/[\\/]+/).includes("..")) {
|
|
40416
|
+
let recovery = "Pass the fully resolved path to the e2e test's YAML.";
|
|
40417
|
+
const suppliedBase2 = path20.basename(suppliedPath);
|
|
40418
|
+
if (suppliedBase2 !== ".." && suppliedBase2 !== ".") {
|
|
40419
|
+
try {
|
|
40420
|
+
const resolved = path20.join(await fsp2.realpath(path20.dirname(suppliedPath)), suppliedBase2);
|
|
40421
|
+
await fsp2.stat(resolved);
|
|
40422
|
+
recovery = `Did you mean: argent e2e ${sub} ${shellQuoteArg(resolved)}`;
|
|
40423
|
+
} catch {
|
|
40424
|
+
}
|
|
40425
|
+
}
|
|
40426
|
+
return refuse(
|
|
40427
|
+
`E2E test path must not contain ".." segments \u2014 they are collapsed without following symlinks, so the path can name a different file than the one your shell opens: ${suppliedPath}
|
|
40428
|
+
` + recovery
|
|
40429
|
+
);
|
|
40430
|
+
}
|
|
40431
|
+
const resolvedPath = path20.resolve(projectRoot, suppliedPath);
|
|
40432
|
+
let isDirectory = false;
|
|
40433
|
+
try {
|
|
40434
|
+
isDirectory = (await fsp2.stat(resolvedPath)).isDirectory();
|
|
40435
|
+
} catch {
|
|
40436
|
+
if (recursive2 && !fromName) {
|
|
40437
|
+
return refuse(`E2E test directory not found: ${resolvedPath}`);
|
|
40438
|
+
}
|
|
40439
|
+
}
|
|
40440
|
+
if (isDirectory) return { kind: "directory", path: resolvedPath };
|
|
40441
|
+
if (recursive2) {
|
|
40442
|
+
return refuse(
|
|
40443
|
+
fromName ? `e2e ${sub} --recursive requires a directory path; "${ref}" is a saved test's name, which always addresses the single file ${suppliedPath}.` : `e2e ${sub} --recursive requires a directory path: ${suppliedPath}`
|
|
40444
|
+
);
|
|
40445
|
+
}
|
|
40446
|
+
const separatorTrimmedPath = suppliedPath.replace(/[\\/]+$/, "");
|
|
40447
|
+
if (separatorTrimmedPath !== suppliedPath && separatorTrimmedPath !== "") {
|
|
40448
|
+
const hint = SAFE_FLOW_NAME.test(separatorTrimmedPath) ? `.${path20.sep}${separatorTrimmedPath}` : separatorTrimmedPath;
|
|
40449
|
+
return refuse(
|
|
40450
|
+
`E2E test path must not end in a path separator \u2014 the separator claims a directory, which the kernel would refuse to open as a file, so the CLI would ${sub} a file this string does not name: ${suppliedPath}
|
|
40451
|
+
Did you mean: argent e2e ${sub} ${shellQuoteArg(hint)}`
|
|
40452
|
+
);
|
|
40453
|
+
}
|
|
40454
|
+
if (path20.extname(suppliedPath) !== ".yaml") {
|
|
40455
|
+
const looksLikeName = !suppliedPath.includes("/") && !suppliedPath.includes("\\") && path20.extname(suppliedPath) === "";
|
|
40456
|
+
if (path20.basename(suppliedPath).toLowerCase() === ".yaml") {
|
|
40457
|
+
return refuse(
|
|
40458
|
+
`E2E test filename must have a non-empty name containing only letters, numbers, "_", or "-": ${suppliedPath}`
|
|
40459
|
+
);
|
|
40460
|
+
}
|
|
40461
|
+
if (looksLikeName) {
|
|
40462
|
+
return refuse(
|
|
40463
|
+
`E2E test name must contain only letters, numbers, "_", or "-": ${suppliedPath}
|
|
40464
|
+
Names ${sub} \`${E2E_DIRS.map((dir) => `${dir}/<name>.yaml`).join("` or `")}\`; pass a path ending in .yaml to ${sub} an e2e test file kept elsewhere.`
|
|
40465
|
+
);
|
|
40466
|
+
}
|
|
40467
|
+
if (path20.extname(suppliedPath).toLowerCase() === ".yaml") {
|
|
40468
|
+
return refuse(
|
|
40469
|
+
`E2E test extension must be lowercase .yaml, not ${path20.extname(suppliedPath)}: ${suppliedPath}`
|
|
40470
|
+
);
|
|
40471
|
+
}
|
|
40472
|
+
return refuse(`E2E test path must end in .yaml: ${suppliedPath}`);
|
|
40473
|
+
}
|
|
40474
|
+
const flowName = path20.basename(suppliedPath, ".yaml");
|
|
40475
|
+
if (!SAFE_FLOW_NAME.test(flowName)) {
|
|
40476
|
+
return refuse(
|
|
40477
|
+
`E2E test filename must have a non-empty name containing only letters, numbers, "_", or "-": ${suppliedPath}`
|
|
40478
|
+
);
|
|
40479
|
+
}
|
|
40480
|
+
const flowPath = resolvedPath;
|
|
40481
|
+
try {
|
|
40482
|
+
const stat7 = await fsp2.stat(flowPath);
|
|
40483
|
+
if (!stat7.isFile()) {
|
|
40484
|
+
return refuse(`E2E test path is not a file: ${flowPath}`);
|
|
40485
|
+
}
|
|
40486
|
+
await fsp2.access(flowPath, fsConstants2.R_OK);
|
|
40487
|
+
} catch (err) {
|
|
40488
|
+
const code = err.code;
|
|
40489
|
+
const detail = code === "ENOENT" ? "E2E test file not found" : "Could not read e2e test file";
|
|
40490
|
+
let recovery = "";
|
|
40491
|
+
if (code === "ENOENT") {
|
|
40492
|
+
recovery = fromName ? `
|
|
40493
|
+
No e2e test named "${ref}" is saved in ${E2E_DIRS.join(" or ")} \u2014 run \`argent e2e list\` to see the saved tests.` : await savedFlowHint(sub, projectRoot, flowPath);
|
|
40494
|
+
}
|
|
40495
|
+
return refuse(`${detail}: ${flowPath}${recovery}`);
|
|
40496
|
+
}
|
|
40497
|
+
const suppliedBase = path20.basename(flowPath);
|
|
40498
|
+
const siblings = await fsp2.readdir(path20.dirname(flowPath)).catch(() => null);
|
|
40499
|
+
if (siblings !== null && !siblings.includes(suppliedBase)) {
|
|
40500
|
+
const actual = siblings.find((name) => name.toLowerCase() === suppliedBase.toLowerCase());
|
|
40501
|
+
const actualRunnable = actual !== void 0 && path20.extname(actual) === ".yaml" && SAFE_FLOW_NAME.test(path20.basename(actual, ".yaml"));
|
|
40502
|
+
const recovery = actualRunnable ? fromName ? `Did you mean: argent e2e ${sub} ${path20.basename(actual, ".yaml")}` : `Did you mean: argent e2e ${sub} ${shellQuoteArg(path20.join(path20.dirname(suppliedPath), actual))}` : actual !== void 0 ? `Rename ${actual} to ${suppliedBase} to ${sub} it \u2014 e2e test files must be lowercase .yaml.` : "Pass the e2e test file's name exactly as it appears on disk.";
|
|
40503
|
+
return refuse(
|
|
40504
|
+
`E2E test path must name the file as it appears on disk \u2014 this filesystem matched ${JSON.stringify(suppliedBase)} case-insensitively${actual !== void 0 ? ` to ${JSON.stringify(actual)}` : ""}, so the test name (which keys the report, __baselines__/, and --output) would be one no file carries: ${suppliedPath}
|
|
40505
|
+
${recovery}`
|
|
40506
|
+
);
|
|
40507
|
+
}
|
|
40508
|
+
return { kind: "file", path: flowPath, name: flowName };
|
|
40509
|
+
}
|
|
40396
40510
|
async function collectFlowFiles(dir, recursive2) {
|
|
40397
40511
|
const found = [];
|
|
40398
40512
|
const manifests = [];
|
|
@@ -40547,6 +40661,15 @@ function unwrittenBaselines(report) {
|
|
|
40547
40661
|
return typeof file2 === "string" && typeof error63 === "string" ? [`${file2}: ${error63}`] : [];
|
|
40548
40662
|
});
|
|
40549
40663
|
}
|
|
40664
|
+
var CHECK_TOOL_ID = "e2e-check";
|
|
40665
|
+
function positionText(at) {
|
|
40666
|
+
return at.map(({ step, shutdown: shutdown2, ...holds }) => {
|
|
40667
|
+
const position = `${shutdown2 === true ? "shutdown step" : "step"} ${step}`;
|
|
40668
|
+
const [kind, value] = Object.entries(holds)[0] ?? [];
|
|
40669
|
+
if (kind === void 0) return position;
|
|
40670
|
+
return `${position} > ${kind}${value === true ? "" : `: ${value}`}`;
|
|
40671
|
+
}).join(": ");
|
|
40672
|
+
}
|
|
40550
40673
|
var INVALID_SUITE_SIGNAL = {
|
|
40551
40674
|
error_code: FAILURE_CODES.FLOW_FILE_INVALID,
|
|
40552
40675
|
error_kind: "validation"
|
|
@@ -40723,6 +40846,108 @@ ${renderBatchSummary(counts, durationMs)}`);
|
|
|
40723
40846
|
}
|
|
40724
40847
|
return exitAfterFlush(unreachable || noneRan ? 2 : counts.failed === 0 ? 0 : 1);
|
|
40725
40848
|
}
|
|
40849
|
+
function plural2(count, noun) {
|
|
40850
|
+
return `${count} ${noun}${count === 1 ? "" : "s"}`;
|
|
40851
|
+
}
|
|
40852
|
+
async function e2eCheck(argv, options) {
|
|
40853
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
40854
|
+
await printHelp();
|
|
40855
|
+
return;
|
|
40856
|
+
}
|
|
40857
|
+
let ref;
|
|
40858
|
+
let json2;
|
|
40859
|
+
try {
|
|
40860
|
+
const parsed = parseCommandArgs(argv, CHECK_OPTIONS);
|
|
40861
|
+
if (parsed.positionals.length > 1) {
|
|
40862
|
+
throw new UsageError(
|
|
40863
|
+
`unexpected argument ${JSON.stringify(parsed.positionals[1])}; e2e check takes one e2e test name or YAML file path`
|
|
40864
|
+
);
|
|
40865
|
+
}
|
|
40866
|
+
if (!parsed.positionals[0]) {
|
|
40867
|
+
throw new UsageError(
|
|
40868
|
+
"argent e2e check <test|test.yaml> requires an e2e test name or a YAML file path."
|
|
40869
|
+
);
|
|
40870
|
+
}
|
|
40871
|
+
ref = parsed.positionals[0];
|
|
40872
|
+
json2 = parsed.options.json === true;
|
|
40873
|
+
} catch (err) {
|
|
40874
|
+
if (!(err instanceof UsageError)) throw err;
|
|
40875
|
+
console.error(
|
|
40876
|
+
argv.some((tok) => tok === "--json" || tok.startsWith("--json=")) ? JSON.stringify(errorRecord(err.message)) : `Error: ${err.message}
|
|
40877
|
+
Run \`argent e2e --help\`.`
|
|
40878
|
+
);
|
|
40879
|
+
return exitAfterFlush(2);
|
|
40880
|
+
}
|
|
40881
|
+
const fail = (message, err = message) => {
|
|
40882
|
+
console.error(json2 ? JSON.stringify(errorRecord(err, message)) : message);
|
|
40883
|
+
return exitAfterFlush(2);
|
|
40884
|
+
};
|
|
40885
|
+
const projectRoot = process.cwd();
|
|
40886
|
+
const { suppliedPath, fromName, shadowed } = await resolveFlowRef(ref, projectRoot);
|
|
40887
|
+
if (shadowed !== void 0) printWarnings([e2eShadowWarning(suppliedPath, shadowed)], json2);
|
|
40888
|
+
const target = await resolveE2eTarget(
|
|
40889
|
+
"check",
|
|
40890
|
+
ref,
|
|
40891
|
+
{ suppliedPath, fromName },
|
|
40892
|
+
projectRoot,
|
|
40893
|
+
false
|
|
40894
|
+
);
|
|
40895
|
+
if (target.kind === "refused") return fail(target.message);
|
|
40896
|
+
if (target.kind === "directory") {
|
|
40897
|
+
return fail(
|
|
40898
|
+
`e2e check takes an e2e test name or a YAML file path, not a directory: ${suppliedPath}`
|
|
40899
|
+
);
|
|
40900
|
+
}
|
|
40901
|
+
const client2 = createToolsClient({ paths: options.paths });
|
|
40902
|
+
const toolError = async (err) => {
|
|
40903
|
+
const unreachable = await toolServerUnreachable(err);
|
|
40904
|
+
if (unreachable) return fail(unreachable.message, unreachable);
|
|
40905
|
+
return fail(err instanceof Error ? err.message : String(err), err);
|
|
40906
|
+
};
|
|
40907
|
+
try {
|
|
40908
|
+
if (await client2.fetchTool(CHECK_TOOL_ID) === null) {
|
|
40909
|
+
return fail(
|
|
40910
|
+
`The tool-server has no ${CHECK_TOOL_ID} tool, because it runs an older Argent version. Restart the local tool-server, or update Argent on the linked one.`
|
|
40911
|
+
);
|
|
40912
|
+
}
|
|
40913
|
+
} catch (err) {
|
|
40914
|
+
return toolError(err);
|
|
40915
|
+
}
|
|
40916
|
+
let problems;
|
|
40917
|
+
try {
|
|
40918
|
+
const resp = await client2.callTool(CHECK_TOOL_ID, {
|
|
40919
|
+
e2e_test_path: target.path,
|
|
40920
|
+
project_root: projectRoot
|
|
40921
|
+
});
|
|
40922
|
+
const found = resp.data.problems;
|
|
40923
|
+
problems = found.map((problem) => ({ file: suppliedPath, ...problem }));
|
|
40924
|
+
} catch (err) {
|
|
40925
|
+
if (!(err instanceof ToolInvocationError) || err.errorKind !== "validation") {
|
|
40926
|
+
return toolError(err);
|
|
40927
|
+
}
|
|
40928
|
+
problems = [
|
|
40929
|
+
{
|
|
40930
|
+
file: suppliedPath,
|
|
40931
|
+
...err.errorCode !== void 0 && { code: err.errorCode },
|
|
40932
|
+
message: err.message.replace(/^\[Tool:[^\]]+\] /, "")
|
|
40933
|
+
}
|
|
40934
|
+
];
|
|
40935
|
+
}
|
|
40936
|
+
if (json2) {
|
|
40937
|
+
const ok = problems.length === 0;
|
|
40938
|
+
console.log(JSON.stringify({ ok, e2eTests: [{ path: suppliedPath, ok, problems }] }, null, 2));
|
|
40939
|
+
} else {
|
|
40940
|
+
for (const problem of problems) {
|
|
40941
|
+
console.error(
|
|
40942
|
+
`${problem.file}: ${problem.at === void 0 ? "" : `${positionText(problem.at)}: `}${problem.message}`
|
|
40943
|
+
);
|
|
40944
|
+
}
|
|
40945
|
+
console.log(
|
|
40946
|
+
problems.length === 0 ? "OK: no problems in 1 e2e test" : `${plural2(problems.length, "error")} in 1 of 1 e2e test`
|
|
40947
|
+
);
|
|
40948
|
+
}
|
|
40949
|
+
return exitAfterFlush(problems.length === 0 ? 0 : 1);
|
|
40950
|
+
}
|
|
40726
40951
|
async function e2e(argv, options) {
|
|
40727
40952
|
const [sub, ...rest] = argv;
|
|
40728
40953
|
if (!sub || sub === "--help" || sub === "-h") {
|
|
@@ -40887,6 +41112,7 @@ Pass the fully resolved path to the directory.`
|
|
|
40887
41112
|
}
|
|
40888
41113
|
return;
|
|
40889
41114
|
}
|
|
41115
|
+
if (sub === "check") return e2eCheck(rest, options);
|
|
40890
41116
|
if (sub !== "run") {
|
|
40891
41117
|
console.error(`Unknown e2e subcommand "${sub}". Run \`argent e2e --help\`.`);
|
|
40892
41118
|
return exitAfterFlush(2);
|
|
@@ -40931,112 +41157,21 @@ Pass the fully resolved path to the directory.`
|
|
|
40931
41157
|
if (shadowed !== void 0) {
|
|
40932
41158
|
printWarnings([e2eShadowWarning(suppliedPath, shadowed)], args.json);
|
|
40933
41159
|
}
|
|
40934
|
-
|
|
40935
|
-
|
|
40936
|
-
|
|
40937
|
-
|
|
40938
|
-
|
|
40939
|
-
|
|
40940
|
-
|
|
40941
|
-
|
|
40942
|
-
|
|
40943
|
-
}
|
|
40944
|
-
}
|
|
40945
|
-
return fail(
|
|
40946
|
-
`E2E test path must not contain ".." segments \u2014 they are collapsed without following symlinks, so the path can name a different file than the one your shell opens: ${suppliedPath}
|
|
40947
|
-
` + recovery,
|
|
40948
|
-
2
|
|
40949
|
-
);
|
|
40950
|
-
}
|
|
40951
|
-
const resolvedPath = path20.resolve(projectRoot, suppliedPath);
|
|
40952
|
-
let isDirectory = false;
|
|
40953
|
-
try {
|
|
40954
|
-
isDirectory = (await fsp2.stat(resolvedPath)).isDirectory();
|
|
40955
|
-
} catch {
|
|
40956
|
-
if (args.recursive && !fromName) {
|
|
40957
|
-
return fail(`E2E test directory not found: ${resolvedPath}`, 2);
|
|
40958
|
-
}
|
|
40959
|
-
}
|
|
40960
|
-
if (isDirectory) {
|
|
41160
|
+
const target = await resolveE2eTarget(
|
|
41161
|
+
"run",
|
|
41162
|
+
args.flowRef,
|
|
41163
|
+
{ suppliedPath, fromName },
|
|
41164
|
+
projectRoot,
|
|
41165
|
+
args.recursive
|
|
41166
|
+
);
|
|
41167
|
+
if (target.kind === "refused") return fail(target.message, 2);
|
|
41168
|
+
if (target.kind === "directory") {
|
|
40961
41169
|
if (args.jsonStream) {
|
|
40962
41170
|
return fail("--json-stream supports a single e2e test; directory runs are not supported.", 2);
|
|
40963
41171
|
}
|
|
40964
|
-
return runFlowDirectory(
|
|
40965
|
-
}
|
|
40966
|
-
if (args.recursive) {
|
|
40967
|
-
return fail(
|
|
40968
|
-
fromName ? `e2e run --recursive requires a directory path; "${args.flowRef}" is a saved test's name, which always addresses the single file ${suppliedPath}.` : `e2e run --recursive requires a directory path: ${suppliedPath}`,
|
|
40969
|
-
2
|
|
40970
|
-
);
|
|
40971
|
-
}
|
|
40972
|
-
const separatorTrimmedPath = suppliedPath.replace(/[\\/]+$/, "");
|
|
40973
|
-
if (separatorTrimmedPath !== suppliedPath && separatorTrimmedPath !== "") {
|
|
40974
|
-
const hint = SAFE_FLOW_NAME.test(separatorTrimmedPath) ? `.${path20.sep}${separatorTrimmedPath}` : separatorTrimmedPath;
|
|
40975
|
-
return fail(
|
|
40976
|
-
`E2E test path must not end in a path separator \u2014 the separator claims a directory, which the kernel would refuse to open as a file, so the CLI would run a file this string does not name: ${suppliedPath}
|
|
40977
|
-
Did you mean: argent e2e run ${shellQuoteArg(hint)}`,
|
|
40978
|
-
2
|
|
40979
|
-
);
|
|
40980
|
-
}
|
|
40981
|
-
if (path20.extname(suppliedPath) !== ".yaml") {
|
|
40982
|
-
const looksLikeName = !suppliedPath.includes("/") && !suppliedPath.includes("\\") && path20.extname(suppliedPath) === "";
|
|
40983
|
-
if (path20.basename(suppliedPath).toLowerCase() === ".yaml") {
|
|
40984
|
-
return fail(
|
|
40985
|
-
`E2E test filename must have a non-empty name containing only letters, numbers, "_", or "-": ${suppliedPath}`,
|
|
40986
|
-
2
|
|
40987
|
-
);
|
|
40988
|
-
}
|
|
40989
|
-
if (looksLikeName) {
|
|
40990
|
-
return fail(
|
|
40991
|
-
`E2E test name must contain only letters, numbers, "_", or "-": ${suppliedPath}
|
|
40992
|
-
Names run \`${E2E_DIRS.map((dir) => `${dir}/<name>.yaml`).join("` or `")}\`; pass a path ending in .yaml to run an e2e test file kept elsewhere.`,
|
|
40993
|
-
2
|
|
40994
|
-
);
|
|
40995
|
-
}
|
|
40996
|
-
if (path20.extname(suppliedPath).toLowerCase() === ".yaml") {
|
|
40997
|
-
return fail(
|
|
40998
|
-
`E2E test extension must be lowercase .yaml, not ${path20.extname(suppliedPath)}: ${suppliedPath}`,
|
|
40999
|
-
2
|
|
41000
|
-
);
|
|
41001
|
-
}
|
|
41002
|
-
return fail(`E2E test path must end in .yaml: ${suppliedPath}`, 2);
|
|
41003
|
-
}
|
|
41004
|
-
const flowName = path20.basename(suppliedPath, ".yaml");
|
|
41005
|
-
if (!SAFE_FLOW_NAME.test(flowName)) {
|
|
41006
|
-
return fail(
|
|
41007
|
-
`E2E test filename must have a non-empty name containing only letters, numbers, "_", or "-": ${suppliedPath}`,
|
|
41008
|
-
2
|
|
41009
|
-
);
|
|
41010
|
-
}
|
|
41011
|
-
const flowPath = resolvedPath;
|
|
41012
|
-
try {
|
|
41013
|
-
const stat7 = await fsp2.stat(flowPath);
|
|
41014
|
-
if (!stat7.isFile()) {
|
|
41015
|
-
return fail(`E2E test path is not a file: ${flowPath}`, 2);
|
|
41016
|
-
}
|
|
41017
|
-
await fsp2.access(flowPath, fsConstants2.R_OK);
|
|
41018
|
-
} catch (err) {
|
|
41019
|
-
const code = err.code;
|
|
41020
|
-
const detail = code === "ENOENT" ? "E2E test file not found" : "Could not read e2e test file";
|
|
41021
|
-
let recovery = "";
|
|
41022
|
-
if (code === "ENOENT") {
|
|
41023
|
-
recovery = fromName ? `
|
|
41024
|
-
No e2e test named "${args.flowRef}" is saved in ${E2E_DIRS.join(" or ")} \u2014 run \`argent e2e list\` to see the saved tests.` : await savedFlowHint(projectRoot, flowPath);
|
|
41025
|
-
}
|
|
41026
|
-
return fail(`${detail}: ${flowPath}${recovery}`, 2);
|
|
41027
|
-
}
|
|
41028
|
-
const suppliedBase = path20.basename(flowPath);
|
|
41029
|
-
const siblings = await fsp2.readdir(path20.dirname(flowPath)).catch(() => null);
|
|
41030
|
-
if (siblings !== null && !siblings.includes(suppliedBase)) {
|
|
41031
|
-
const actual = siblings.find((name) => name.toLowerCase() === suppliedBase.toLowerCase());
|
|
41032
|
-
const actualRunnable = actual !== void 0 && path20.extname(actual) === ".yaml" && SAFE_FLOW_NAME.test(path20.basename(actual, ".yaml"));
|
|
41033
|
-
const recovery = actualRunnable ? fromName ? `Did you mean: argent e2e run ${path20.basename(actual, ".yaml")}` : `Did you mean: argent e2e run ${shellQuoteArg(path20.join(path20.dirname(suppliedPath), actual))}` : actual !== void 0 ? `Rename ${actual} to ${suppliedBase} to run it \u2014 e2e test files must be lowercase .yaml.` : "Pass the e2e test file's name exactly as it appears on disk.";
|
|
41034
|
-
return fail(
|
|
41035
|
-
`E2E test path must name the file as it appears on disk \u2014 this filesystem matched ${JSON.stringify(suppliedBase)} case-insensitively${actual !== void 0 ? ` to ${JSON.stringify(actual)}` : ""}, so the test name (which keys the report, __baselines__/, and --output) would be one no file carries: ${suppliedPath}
|
|
41036
|
-
${recovery}`,
|
|
41037
|
-
2
|
|
41038
|
-
);
|
|
41172
|
+
return runFlowDirectory(target.path, args, projectRoot, options);
|
|
41039
41173
|
}
|
|
41174
|
+
const { path: flowPath, name: flowName } = target;
|
|
41040
41175
|
const { callTool, baseUrl } = runToolsClient(args, options);
|
|
41041
41176
|
const payload = buildRunPayload(flowPath, projectRoot, args);
|
|
41042
41177
|
let liveSteps = 0;
|
|
@@ -51232,15 +51367,15 @@ function allChecks(report) {
|
|
|
51232
51367
|
function countStatus(report, status2) {
|
|
51233
51368
|
return allChecks(report).filter((c2) => c2.status === status2).length;
|
|
51234
51369
|
}
|
|
51235
|
-
function
|
|
51370
|
+
function plural3(n3, word) {
|
|
51236
51371
|
return `${n3} ${word}${n3 === 1 ? "" : "s"}`;
|
|
51237
51372
|
}
|
|
51238
51373
|
function failureSummary(failed) {
|
|
51239
51374
|
const errors = failed.filter((c2) => c2.status === "error").length;
|
|
51240
51375
|
const warnings = failed.length - errors;
|
|
51241
51376
|
const parts = [];
|
|
51242
|
-
if (errors > 0) parts.push(`${
|
|
51243
|
-
if (warnings > 0) parts.push(
|
|
51377
|
+
if (errors > 0) parts.push(`${plural3(errors, "check")} failed`);
|
|
51378
|
+
if (warnings > 0) parts.push(plural3(warnings, "warning"));
|
|
51244
51379
|
return parts.join(" and ");
|
|
51245
51380
|
}
|
|
51246
51381
|
function isFailed(c2) {
|
|
@@ -51278,7 +51413,7 @@ function renderDoctorReport(report, verbose = false) {
|
|
|
51278
51413
|
const passedCount = scored.length - failed.length;
|
|
51279
51414
|
const passedDetails = verbose ? passedList(report) : [];
|
|
51280
51415
|
if (failed.length === 0) {
|
|
51281
|
-
const summary = import_picocolors8.default.green(`\u2714 All ${
|
|
51416
|
+
const summary = import_picocolors8.default.green(`\u2714 All ${plural3(passedCount, "check")} passed. Argent looks good.`);
|
|
51282
51417
|
return [header(report), summary, ...passedDetails].join("\n");
|
|
51283
51418
|
}
|
|
51284
51419
|
const lines = [
|
package/dist/installer.mjs
CHANGED
|
@@ -17118,7 +17118,7 @@ function isCi(env = process.env) {
|
|
|
17118
17118
|
var SESSION_ID = randomUUID4();
|
|
17119
17119
|
function readCliVersion() {
|
|
17120
17120
|
if (true) {
|
|
17121
|
-
return "0.35.1-next.
|
|
17121
|
+
return "0.35.1-next.35";
|
|
17122
17122
|
}
|
|
17123
17123
|
return "0.0.0";
|
|
17124
17124
|
}
|
package/dist/mcp-server.mjs
CHANGED
|
@@ -38155,7 +38155,7 @@ async function startMcpServer(options) {
|
|
|
38155
38155
|
const autoDescribeOn = autoDescribeEnabled();
|
|
38156
38156
|
const whatsNewOn = whatsNewEnabled();
|
|
38157
38157
|
const installedVersion = getInstalledVersion();
|
|
38158
|
-
const highlightsVersion = true ? "0.35.1-next.
|
|
38158
|
+
const highlightsVersion = true ? "0.35.1-next.35" : installedVersion;
|
|
38159
38159
|
const captureTimeoutMs = options.captureTimeoutMs ?? CAPTURE_TIMEOUT_MS;
|
|
38160
38160
|
const trees = createTreeMemory();
|
|
38161
38161
|
const screenshots = createScreenshotMemory();
|
|
@@ -284,6 +284,16 @@ export interface ArgentToolArgs {
|
|
|
284
284
|
/** Save the call in the shutdown list. Pending fragment cleanup runs before the call. stepCount counts shutdown entries. */
|
|
285
285
|
shutdown?: boolean;
|
|
286
286
|
};
|
|
287
|
+
"e2e-check": {
|
|
288
|
+
/** Name of a saved e2e test to check from `<project_root>/.argent/e2e`, or `.argent/flows` when it is not there. */
|
|
289
|
+
name?: string;
|
|
290
|
+
/** Absolute path to the calling agent's project root: the cwd it is working in. */
|
|
291
|
+
project_root: string;
|
|
292
|
+
/** Path to the e2e test .yaml as readable by the tool-server. Internal: the argent client derives it from project_root and name automatically; leave unset. */
|
|
293
|
+
e2e_test_file?: string;
|
|
294
|
+
/** Absolute path to an e2e test .yaml on the client. */
|
|
295
|
+
e2e_test_path?: string;
|
|
296
|
+
};
|
|
287
297
|
"e2e-execute": {
|
|
288
298
|
/** Saved e2e test name in `<project_root>/.argent/e2e/` (or `.argent/flows/`). */
|
|
289
299
|
name?: string;
|