@swmansion/argent 0.25.2-next.1 → 0.25.2-next.11

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.
Binary file
Binary file
Binary file
Binary file
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.2-next.1";
21875
+ return "0.25.2-next.11";
21876
21876
  }
21877
21877
  return "0.0.0";
21878
21878
  }
@@ -23182,6 +23182,13 @@ function stepIndent(depth) {
23182
23182
  if (typeof depth !== "number" || !Number.isInteger(depth) || depth <= 0) return "";
23183
23183
  return " ".repeat(Math.min(depth, MAX_RENDER_DEPTH));
23184
23184
  }
23185
+ function durationSuffix(ms) {
23186
+ if (typeof ms !== "number" || !Number.isFinite(ms) || ms < 0) return "";
23187
+ const tenths = Math.round(ms / 100);
23188
+ if (tenths < 600) return ` (${(tenths / 10).toFixed(1)}s)`;
23189
+ const seconds = Math.round(ms / 1e3);
23190
+ return ` (${Math.floor(seconds / 60)}m ${seconds % 60}s)`;
23191
+ }
23185
23192
  function printHelp(toStderr = false) {
23186
23193
  const print = toStderr ? console.error : console.log;
23187
23194
  print(`Usage: argent flow <subcommand> [options]
@@ -23305,7 +23312,7 @@ function renderStepLine(s, n2, topFlow) {
23305
23312
  const label = what ? `${s.kind} ${what}` : s.kind;
23306
23313
  const reason = s.reason ? ` \u2014 ${s.reason}` : "";
23307
23314
  const glyph = s.status === "pass" && s.warning ? "\u26A0" : STATUS_GLYPH[s.status];
23308
- return ` ${glyph} ${String(n2).padStart(2)} ${stepIndent(s.depth)}${label}${where}${reason}`;
23315
+ return ` ${glyph} ${String(n2).padStart(2)} ${stepIndent(s.depth)}${label}${where}${durationSuffix(s.durationMs)}${reason}`;
23309
23316
  }
23310
23317
  function renderUnderStepLine(s, n2, text2) {
23311
23318
  return `${" ".repeat(5 + Math.max(2, String(n2).length))}${stepIndent(s.depth)}${text2}`;
@@ -23328,7 +23335,7 @@ function renderSummary(report, opts = {}) {
23328
23335
  const where = opts.withDevice && report.device ? ` (started on ${report.device})` : "";
23329
23336
  const nothingCounted = report.ok && report.passed + report.failed + report.errored + report.skipped === 0;
23330
23337
  const note = nothingCounted ? " (no test steps)" : "";
23331
- return `${report.ok ? "PASS" : "FAIL"}${where} \u2014 ${report.passed} passed, ${report.failed} failed, ${report.errored} errored, ${report.skipped} skipped${warningsNote}${note}`;
23338
+ return `${report.ok ? "PASS" : "FAIL"}${where} \u2014 ${report.passed} passed, ${report.failed} failed, ${report.errored} errored, ${report.skipped} skipped${warningsNote}${note}${durationSuffix(report.durationMs)}`;
23332
23339
  }
23333
23340
  function renderArtifactLines(report) {
23334
23341
  const lines = [];
@@ -23366,8 +23373,8 @@ function renderFailedSteps(report) {
23366
23373
  }
23367
23374
  return lines;
23368
23375
  }
23369
- function renderBatchSummary(counts) {
23370
- return `${counts.failed === 0 ? "PASS" : "FAIL"} \u2014 ${counts.total} flow${counts.total === 1 ? "" : "s"}: ${counts.passed} passed, ${counts.failed} failed, ${counts.skipped} skipped`;
23376
+ function renderBatchSummary(counts, durationMs) {
23377
+ 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)}`;
23371
23378
  }
23372
23379
  var SAFE_ARTIFACT_NAME = FLOW_NAME_PATTERN;
23373
23380
  var SAFE_FLOW_NAME = FLOW_NAME_PATTERN;
@@ -23682,6 +23689,7 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
23682
23689
  const { callTool, baseUrl } = createToolsClient({ paths: options.paths });
23683
23690
  const outputBase = args.output ? path14.resolve(args.output) : void 0;
23684
23691
  const results = [];
23692
+ const batchStartedAt = Date.now();
23685
23693
  let stopped = false;
23686
23694
  for (const [i2, rel] of flows.entries()) {
23687
23695
  if (!args.json) console.log(`[${i2 + 1}/${flows.length}] ${rel}`);
@@ -23737,11 +23745,14 @@ async function runFlowDirectory(dir, args, projectRoot, options) {
23737
23745
  failed: results.filter((r2) => r2.status === "fail").length,
23738
23746
  skipped: results.filter((r2) => r2.status === "skip").length
23739
23747
  };
23748
+ const durationMs = Date.now() - batchStartedAt;
23740
23749
  if (args.json) {
23741
- console.log(JSON.stringify({ ok: counts.failed === 0, ...counts, flows: results }, null, 2));
23750
+ console.log(
23751
+ JSON.stringify({ ok: counts.failed === 0, ...counts, durationMs, flows: results }, null, 2)
23752
+ );
23742
23753
  } else {
23743
23754
  console.log(`
23744
- ${renderBatchSummary(counts)}`);
23755
+ ${renderBatchSummary(counts, durationMs)}`);
23745
23756
  }
23746
23757
  return exitAfterFlush(counts.failed === 0 ? 0 : 1);
23747
23758
  }
@@ -25795,12 +25806,25 @@ function reportError(err, suggest) {
25795
25806
  }
25796
25807
  process.exit(2);
25797
25808
  }
25809
+ function wrapText(text2, indent, width = 80) {
25810
+ const lines = [];
25811
+ let line = "";
25812
+ for (const word of text2.split(/\s+/).filter(Boolean)) {
25813
+ if (line && indent.length + line.length + 1 + word.length > width) {
25814
+ lines.push(indent + line);
25815
+ line = word;
25816
+ } else {
25817
+ line = line ? `${line} ${word}` : word;
25818
+ }
25819
+ }
25820
+ if (line) lines.push(indent + line);
25821
+ return lines;
25822
+ }
25798
25823
  function printUsage() {
25799
- const keys = CONFIG_SCHEMA.map((d) => d.key);
25800
- const maxKey = keys.reduce((m, k) => Math.max(m, k.length), 0);
25801
25824
  const keyLines = CONFIG_SCHEMA.map((d) => {
25802
- const managed = d.manageCommand ? import_picocolors2.default.dim(` [managed by \`${d.manageCommand}\`]`) : "";
25803
- return ` ${d.key.padEnd(maxKey)} ${d.description}${managed}`;
25825
+ const lines = [` ${d.key}`, ...wrapText(d.description, " ")];
25826
+ if (d.manageCommand) lines.push(import_picocolors2.default.dim(` [managed by \`${d.manageCommand}\`]`));
25827
+ return lines.join("\n");
25804
25828
  });
25805
25829
  console.log(`Usage: argent config <command> [options]
25806
25830
 
@@ -25816,7 +25840,7 @@ Commands:
25816
25840
  unset <key> Remove a value at a scope (default global)
25817
25841
 
25818
25842
  Recognized keys:
25819
- ${keyLines.join("\n")}
25843
+ ${keyLines.join("\n\n")}
25820
25844
 
25821
25845
  Run \`argent config <command> --help\` for command-specific help.`);
25822
25846
  }
@@ -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.2-next.1";
16728
+ return "0.25.2-next.11";
16729
16729
  }
16730
16730
  return "0.0.0";
16731
16731
  }
@@ -18542,6 +18542,13 @@ function stepIndent(depth) {
18542
18542
  if (typeof depth !== "number" || !Number.isInteger(depth) || depth <= 0) return "";
18543
18543
  return " ".repeat(Math.min(depth, MAX_RENDER_DEPTH));
18544
18544
  }
18545
+ function durationSuffix(ms) {
18546
+ if (typeof ms !== "number" || !Number.isFinite(ms) || ms < 0) return "";
18547
+ const tenths = Math.round(ms / 100);
18548
+ if (tenths < 600) return ` (${(tenths / 10).toFixed(1)}s)`;
18549
+ const seconds = Math.round(ms / 1e3);
18550
+ return ` (${Math.floor(seconds / 60)}m ${seconds % 60}s)`;
18551
+ }
18545
18552
  function stepLabel(step) {
18546
18553
  if (step.kind === "echo") return step.message ?? "";
18547
18554
  if (step.tool) return step.tool;
@@ -18565,9 +18572,10 @@ async function flowRunToMcpContent(result, ctx) {
18565
18572
  const reason = step.reason ?? step.error;
18566
18573
  const suffix = reason ? ` \u2014 ${reason}` : "";
18567
18574
  const warning = step.warning ? ` \u26A0 ${step.warning}` : "";
18575
+ const timing = step.kind === "echo" ? "" : durationSuffix(step.durationMs);
18568
18576
  blocks.push({
18569
18577
  type: "text",
18570
- text: `[${num}] ${glyph}${stepIndent(step.depth)}${stepLabel(step)}${suffix}${warning}`
18578
+ text: `[${num}] ${glyph}${stepIndent(step.depth)}${stepLabel(step)}${timing}${suffix}${warning}`
18571
18579
  });
18572
18580
  const scriptLog = typeof step.scriptLog === "string" ? step.scriptLog : "";
18573
18581
  const scriptLogTruncated = step.scriptLogTruncated === true;
@@ -18589,7 +18597,7 @@ async function flowRunToMcpContent(result, ctx) {
18589
18597
  const note = result.ok && counted === 0 ? " (no test steps)" : "";
18590
18598
  blocks.push({
18591
18599
  type: "text",
18592
- text: `${result.ok ? "PASS" : "FAIL"} \u2014 ${result.passed ?? 0} passed, ${result.failed ?? 0} failed, ${result.errored ?? 0} errored, ${result.skipped ?? 0} skipped${note}`
18600
+ text: `${result.ok ? "PASS" : "FAIL"} \u2014 ${result.passed ?? 0} passed, ${result.failed ?? 0} failed, ${result.errored ?? 0} errored, ${result.skipped ?? 0} skipped${note}${durationSuffix(result.durationMs)}`
18593
18601
  });
18594
18602
  } else {
18595
18603
  blocks.push({ type: "text", text: `Flow "${result.flow}" complete.` });