@swmansion/argent 0.25.3-next.2 → 0.25.3-next.3
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 +69 -22
- package/dist/installer.mjs +1 -1
- package/dist/tool-server.cjs +1 -1
- package/package.json +1 -1
package/dist/cli-cmds.mjs
CHANGED
|
@@ -21872,7 +21872,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
21872
21872
|
var SESSION_ID2 = randomUUID5();
|
|
21873
21873
|
function readCliVersion() {
|
|
21874
21874
|
if (true) {
|
|
21875
|
-
return "0.25.3-next.
|
|
21875
|
+
return "0.25.3-next.3";
|
|
21876
21876
|
}
|
|
21877
21877
|
return "0.0.0";
|
|
21878
21878
|
}
|
|
@@ -23214,13 +23214,14 @@ multi-platform launch auto-detects a device instead. Pass --device to attach to
|
|
|
23214
23214
|
a running instance.
|
|
23215
23215
|
|
|
23216
23216
|
A directory run prints only the steps that need attention (each failure, each
|
|
23217
|
-
warning, and each script step's output), then its outcome
|
|
23218
|
-
|
|
23219
|
-
|
|
23220
|
-
|
|
23221
|
-
|
|
23222
|
-
|
|
23223
|
-
|
|
23217
|
+
warning, and each script step's output), then its outcome. After the last flow
|
|
23218
|
+
it lists every failed flow with its reason and a command that re-runs that flow
|
|
23219
|
+
alone, then a final flow summary; --recursive walks subdirectories too
|
|
23220
|
+
(dot-directories and node_modules are skipped). A flow that fails its steps
|
|
23221
|
+
keeps the batch running, as does one the server rejects up front \u2014 an invalid
|
|
23222
|
+
file, or a device it cannot resolve. A transport failure, a rejection the server
|
|
23223
|
+
does not mark as validation, or a reply that is not a report stops the batch and
|
|
23224
|
+
counts the remaining flows skipped.
|
|
23224
23225
|
|
|
23225
23226
|
Runs require the auto-started local tool server;
|
|
23226
23227
|
ARGENT_TOOLS_URL and \`argent link\` routing are not supported.
|
|
@@ -23306,13 +23307,15 @@ function renderEchoLine(s) {
|
|
|
23306
23307
|
}
|
|
23307
23308
|
return ` ${indent}\u203A ${s.message}`;
|
|
23308
23309
|
}
|
|
23309
|
-
function
|
|
23310
|
+
function stepLabel(s, topFlow) {
|
|
23310
23311
|
const where = s.flow && s.flow !== topFlow ? ` [${s.flow}]` : "";
|
|
23311
23312
|
const what = s.tool ?? s.target;
|
|
23312
|
-
|
|
23313
|
+
return `${what ? `${s.kind} ${what}` : s.kind}${where}`;
|
|
23314
|
+
}
|
|
23315
|
+
function renderStepLine(s, n2, topFlow) {
|
|
23313
23316
|
const reason = s.reason ? ` \u2014 ${s.reason}` : "";
|
|
23314
23317
|
const glyph = s.status === "pass" && s.warning ? "\u26A0" : STATUS_GLYPH[s.status];
|
|
23315
|
-
return ` ${glyph} ${String(n2).padStart(2)} ${stepIndent(s.depth)}${
|
|
23318
|
+
return ` ${glyph} ${String(n2).padStart(2)} ${stepIndent(s.depth)}${stepLabel(s, topFlow)}${durationSuffix(s.durationMs)}${reason}`;
|
|
23316
23319
|
}
|
|
23317
23320
|
function renderUnderStepLine(s, n2, text2) {
|
|
23318
23321
|
return `${" ".repeat(5 + Math.max(2, String(n2).length))}${stepIndent(s.depth)}${text2}`;
|
|
@@ -23376,6 +23379,35 @@ function renderFailedSteps(report) {
|
|
|
23376
23379
|
function renderBatchSummary(counts, durationMs) {
|
|
23377
23380
|
return `${counts.failed === 0 ? "PASS" : "FAIL"} \u2014 ${counts.total} flow${counts.total === 1 ? "" : "s"}: ${counts.passed} passed, ${counts.failed} failed, ${counts.skipped} skipped${durationSuffix(durationMs)}`;
|
|
23378
23381
|
}
|
|
23382
|
+
function summarizeFailure(report) {
|
|
23383
|
+
let n2 = 0;
|
|
23384
|
+
for (const s of report.steps) {
|
|
23385
|
+
if (s.kind === "echo") continue;
|
|
23386
|
+
n2++;
|
|
23387
|
+
if (s.status === "fail" || s.status === "error") {
|
|
23388
|
+
const detail = s.reason ? String(s.reason) : void 0;
|
|
23389
|
+
return { headline: `step ${n2} ${stepLabel(s, report.flow)}`, detail };
|
|
23390
|
+
}
|
|
23391
|
+
}
|
|
23392
|
+
return { headline: "failed with no failing step" };
|
|
23393
|
+
}
|
|
23394
|
+
function renderFailedFlow(f) {
|
|
23395
|
+
const lines = [` ${STATUS_GLYPH.fail} ${f.path ? `${f.path} \u203A ` : ""}${f.headline}`];
|
|
23396
|
+
for (const line of f.detail?.split("\n") ?? []) if (line) lines.push(` ${line}`);
|
|
23397
|
+
if (f.rerun) lines.push(` re-run: ${f.rerun}`);
|
|
23398
|
+
return lines;
|
|
23399
|
+
}
|
|
23400
|
+
function renderSingleFailure(report) {
|
|
23401
|
+
return report.ok ? [] : ["", ...renderFailedFlow(summarizeFailure(report))];
|
|
23402
|
+
}
|
|
23403
|
+
function renderFailedFlows(failed) {
|
|
23404
|
+
if (failed.length === 0) return [];
|
|
23405
|
+
return [
|
|
23406
|
+
"",
|
|
23407
|
+
`Failed flows (${failed.length})`,
|
|
23408
|
+
...failed.flatMap((f) => ["", ...renderFailedFlow(f)])
|
|
23409
|
+
];
|
|
23410
|
+
}
|
|
23379
23411
|
var SAFE_ARTIFACT_NAME = FLOW_NAME_PATTERN;
|
|
23380
23412
|
var SAFE_FLOW_NAME = FLOW_NAME_PATTERN;
|
|
23381
23413
|
var FLOWS_DIR = path14.join(".argent", "flows");
|
|
@@ -23384,6 +23416,17 @@ function shellQuoteArg(arg) {
|
|
|
23384
23416
|
if (SHELL_SAFE_ARG.test(arg)) return arg;
|
|
23385
23417
|
return `'${arg.replaceAll("'", "'\\''")}'`;
|
|
23386
23418
|
}
|
|
23419
|
+
function rerunCommand(flowPath, rel, projectRoot, args) {
|
|
23420
|
+
const pathArg = (p) => shellQuoteArg(p.startsWith("-") ? `.${path14.sep}${p}` : p);
|
|
23421
|
+
const fromCwd = path14.relative(projectRoot, flowPath);
|
|
23422
|
+
const shown = path14.isAbsolute(fromCwd) || fromCwd.split(/[\\/]+/).includes("..") ? flowPath : fromCwd;
|
|
23423
|
+
const parts = ["argent flow run", pathArg(shown)];
|
|
23424
|
+
if (args.device) parts.push("--device", shellQuoteArg(args.device));
|
|
23425
|
+
if (args.platform) parts.push("--platform", shellQuoteArg(args.platform));
|
|
23426
|
+
if (args.updateBaselines) parts.push("--update-baselines");
|
|
23427
|
+
if (args.output) parts.push("--output", pathArg(path14.join(args.output, path14.dirname(rel))));
|
|
23428
|
+
return parts.join(" ");
|
|
23429
|
+
}
|
|
23387
23430
|
var EXPORT_SOURCE_MARKER = ".argent-flow-source";
|
|
23388
23431
|
var MARKER_READ_RETRIES = 4;
|
|
23389
23432
|
var MARKER_READ_DELAY_MS = 5;
|
|
@@ -23541,6 +23584,7 @@ function renderReport(report) {
|
|
|
23541
23584
|
}
|
|
23542
23585
|
}
|
|
23543
23586
|
}
|
|
23587
|
+
lines.push(...renderSingleFailure(report));
|
|
23544
23588
|
lines.push(`
|
|
23545
23589
|
${renderSummary(report)}`);
|
|
23546
23590
|
return lines.join("\n");
|
|
@@ -23689,6 +23733,7 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
23689
23733
|
const { callTool, baseUrl } = createToolsClient({ paths: options.paths });
|
|
23690
23734
|
const outputBase = args.output ? path14.resolve(args.output) : void 0;
|
|
23691
23735
|
const results = [];
|
|
23736
|
+
const failures = [];
|
|
23692
23737
|
const batchStartedAt = Date.now();
|
|
23693
23738
|
let stopped = false;
|
|
23694
23739
|
for (const [i2, rel] of flows.entries()) {
|
|
@@ -23698,42 +23743,42 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
23698
23743
|
if (!args.json) console.log(` ${STATUS_GLYPH.skip} not run (batch stopped)`);
|
|
23699
23744
|
continue;
|
|
23700
23745
|
}
|
|
23746
|
+
const flowPath = path14.join(dir, rel);
|
|
23747
|
+
const rerun = rerunCommand(flowPath, rel, projectRoot, args);
|
|
23701
23748
|
let report;
|
|
23702
23749
|
try {
|
|
23703
|
-
const resp = await callTool(
|
|
23704
|
-
"flow-execute",
|
|
23705
|
-
buildRunPayload(path14.join(dir, rel), projectRoot, args)
|
|
23706
|
-
);
|
|
23750
|
+
const resp = await callTool("flow-execute", buildRunPayload(flowPath, projectRoot, args));
|
|
23707
23751
|
if (isFlowReport(resp.data)) report = resp.data;
|
|
23708
23752
|
} catch (err) {
|
|
23709
23753
|
const message = err instanceof Error ? err.message : String(err);
|
|
23710
23754
|
const toolErr = err instanceof ToolInvocationError ? err : void 0;
|
|
23711
23755
|
const rejectedThisFlowOnly = toolErr?.errorKind === "validation";
|
|
23712
|
-
|
|
23713
|
-
|
|
23714
|
-
` ${STATUS_GLYPH.error} ` + (rejectedThisFlowOnly ? rejectionVerdict(toolErr?.errorCode) : "did not finish (run error)")
|
|
23715
|
-
);
|
|
23716
|
-
}
|
|
23756
|
+
const verdict = rejectedThisFlowOnly ? rejectionVerdict(toolErr?.errorCode) : "did not finish (run error)";
|
|
23757
|
+
if (!args.json) console.log(` ${STATUS_GLYPH.error} ${verdict}`);
|
|
23717
23758
|
console.error(message);
|
|
23718
23759
|
results.push({ path: rel, status: "fail", error: message, ...failureSignal2(err) });
|
|
23760
|
+
failures.push({ path: rel, headline: verdict, detail: message, rerun });
|
|
23719
23761
|
if (!rejectedThisFlowOnly) stopped = true;
|
|
23720
23762
|
continue;
|
|
23721
23763
|
}
|
|
23722
23764
|
if (!report) {
|
|
23723
23765
|
const message = `"${rel}" did not produce a run report.`;
|
|
23724
|
-
|
|
23766
|
+
const verdict = "did not finish (no run report)";
|
|
23767
|
+
if (!args.json) console.log(` ${STATUS_GLYPH.error} ${verdict}`);
|
|
23725
23768
|
console.error(message);
|
|
23726
23769
|
results.push({ path: rel, status: "fail", error: message });
|
|
23770
|
+
failures.push({ path: rel, headline: verdict, detail: message, rerun });
|
|
23727
23771
|
stopped = true;
|
|
23728
23772
|
continue;
|
|
23729
23773
|
}
|
|
23730
23774
|
await exportAndResolveArtifacts(
|
|
23731
23775
|
report,
|
|
23732
23776
|
outputBase ? path14.join(outputBase, path14.dirname(rel)) : void 0,
|
|
23733
|
-
|
|
23777
|
+
flowPath,
|
|
23734
23778
|
baseUrl
|
|
23735
23779
|
);
|
|
23736
23780
|
results.push({ path: rel, status: report.ok ? "pass" : "fail", report });
|
|
23781
|
+
if (!report.ok) failures.push({ path: rel, ...summarizeFailure(report), rerun });
|
|
23737
23782
|
if (!args.json) {
|
|
23738
23783
|
for (const line of renderFailedSteps(report)) console.log(line);
|
|
23739
23784
|
console.log(` ${renderSummary(report, { withDevice: true })}`);
|
|
@@ -23751,6 +23796,7 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
|
|
|
23751
23796
|
JSON.stringify({ ok: counts.failed === 0, ...counts, durationMs, flows: results }, null, 2)
|
|
23752
23797
|
);
|
|
23753
23798
|
} else {
|
|
23799
|
+
for (const line of renderFailedFlows(failures)) console.log(line);
|
|
23754
23800
|
console.log(`
|
|
23755
23801
|
${renderBatchSummary(counts, durationMs)}`);
|
|
23756
23802
|
}
|
|
@@ -23983,6 +24029,7 @@ ${recovery}`,
|
|
|
23983
24029
|
} else if (liveSteps > 0) {
|
|
23984
24030
|
if (report.executionPrerequisite) console.log(` assumes: ${report.executionPrerequisite}`);
|
|
23985
24031
|
for (const line of renderArtifactLines(report)) console.log(line);
|
|
24032
|
+
for (const line of renderSingleFailure(report)) console.log(line);
|
|
23986
24033
|
console.log(`
|
|
23987
24034
|
${renderSummary(report, { withDevice: true })}`);
|
|
23988
24035
|
} else {
|
package/dist/installer.mjs
CHANGED
|
@@ -16725,7 +16725,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
16725
16725
|
var SESSION_ID = randomUUID4();
|
|
16726
16726
|
function readCliVersion() {
|
|
16727
16727
|
if (true) {
|
|
16728
|
-
return "0.25.3-next.
|
|
16728
|
+
return "0.25.3-next.3";
|
|
16729
16729
|
}
|
|
16730
16730
|
return "0.0.0";
|
|
16731
16731
|
}
|
package/dist/tool-server.cjs
CHANGED
|
@@ -94804,7 +94804,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
|
|
|
94804
94804
|
var SESSION_ID = (0, import_node_crypto3.randomUUID)();
|
|
94805
94805
|
function readCliVersion() {
|
|
94806
94806
|
if (true) {
|
|
94807
|
-
return "0.25.3-next.
|
|
94807
|
+
return "0.25.3-next.3";
|
|
94808
94808
|
}
|
|
94809
94809
|
return "0.0.0";
|
|
94810
94810
|
}
|
package/package.json
CHANGED