@swmansion/argent 0.24.1-next.5 → 0.24.1-next.6

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 CHANGED
@@ -2230,6 +2230,7 @@ import { basename as basename2, extname } from "node:path";
2230
2230
  var FLOW_NAME_CHARSET = "[A-Za-z0-9_-]+";
2231
2231
  var FLOW_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}$`);
2232
2232
  var FLOW_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.yaml$`);
2233
+ var SCRIPT_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.mjs$`);
2233
2234
 
2234
2235
  // ../registry/src/failure-codes.ts
2235
2236
  var FAILURE_CODES = {
@@ -21836,7 +21837,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
21836
21837
  var SESSION_ID2 = randomUUID5();
21837
21838
  function readCliVersion() {
21838
21839
  if (true) {
21839
- return "0.24.1-next.5";
21840
+ return "0.24.1-next.6";
21840
21841
  }
21841
21842
  return "0.0.0";
21842
21843
  }
@@ -23171,13 +23172,14 @@ chromium (a lone \`{ chromium: ... }\` target, or --platform chromium); a
23171
23172
  multi-platform launch auto-detects a device instead. Pass --device to attach to
23172
23173
  a running instance.
23173
23174
 
23174
- A directory run prints each flow's failing steps and warnings, then its outcome,
23175
- then a final flow summary; --recursive walks subdirectories too (dot-directories
23176
- and node_modules are skipped). A flow that fails its steps keeps the batch
23177
- running, as does one the server rejects up front \u2014 an invalid file, or a device
23178
- it cannot resolve. A transport failure, a rejection the server does not mark as
23179
- validation, or a reply that is not a report stops the batch and counts the
23180
- remaining flows skipped.
23175
+ A directory run prints only the steps that need attention (each failure, each
23176
+ warning, and each script step's output), then its outcome, then a final flow
23177
+ summary; --recursive walks subdirectories too (dot-directories and node_modules
23178
+ are skipped). A flow that fails its steps keeps the batch running, as does one
23179
+ the server rejects up front \u2014 an invalid file, or a device it cannot resolve. A
23180
+ transport failure, a rejection the server does not mark as validation, or a
23181
+ reply that is not a report stops the batch and counts the remaining flows
23182
+ skipped.
23181
23183
 
23182
23184
  Runs require the auto-started local tool server;
23183
23185
  ARGENT_TOOLS_URL and \`argent link\` routing are not supported.
@@ -23273,6 +23275,18 @@ function renderStepLine(s, n2, topFlow) {
23273
23275
  function renderUnderStepLine(s, n2, text2) {
23274
23276
  return `${" ".repeat(5 + Math.max(2, String(n2).length))}${stepIndent(s.depth)}${text2}`;
23275
23277
  }
23278
+ function renderScriptLogLines(s, n2) {
23279
+ const log2 = typeof s.scriptLog === "string" ? s.scriptLog : "";
23280
+ const lines = [];
23281
+ if (log2) {
23282
+ const body = log2.endsWith("\n") ? log2.slice(0, -1) : log2;
23283
+ for (const line of body.split("\n")) lines.push(renderUnderStepLine(s, n2, `\u2502 ${line}`));
23284
+ }
23285
+ if (s.scriptLogTruncated === true) {
23286
+ lines.push(renderUnderStepLine(s, n2, "\u2502 \u2026 output truncated"));
23287
+ }
23288
+ return lines;
23289
+ }
23276
23290
  function renderSummary(report, opts = {}) {
23277
23291
  const warnings = report.steps.filter((s) => s.warning).length;
23278
23292
  const warningsNote = warnings ? `, ${warnings} warning${warnings === 1 ? "" : "s"}` : "";
@@ -23301,9 +23315,14 @@ function renderFailedSteps(report) {
23301
23315
  for (const s of report.steps) {
23302
23316
  if (s.kind === "echo") continue;
23303
23317
  n2++;
23304
- if (s.status !== "fail" && s.status !== "error" && !s.warning) continue;
23318
+ const scriptLog = renderScriptLogLines(s, n2);
23319
+ const scriptNote = s.kind === "script" && Boolean(s.reason);
23320
+ if (s.status !== "fail" && s.status !== "error" && !s.warning && !scriptNote && scriptLog.length === 0) {
23321
+ continue;
23322
+ }
23305
23323
  lines.push(renderStepLine(s, n2, report.flow));
23306
23324
  if (s.warning) lines.push(renderUnderStepLine(s, n2, `\u26A0 ${s.warning}`));
23325
+ lines.push(...scriptLog);
23307
23326
  if (s.artifacts && typeof s.artifacts === "object") {
23308
23327
  for (const [k, v] of Object.entries(s.artifacts)) {
23309
23328
  if (typeof v === "string") lines.push(renderUnderStepLine(s, n2, `${k}: ${v}`));
@@ -23470,6 +23489,7 @@ function renderReport(report) {
23470
23489
  n2++;
23471
23490
  lines.push(renderStepLine(s, n2, report.flow));
23472
23491
  if (s.warning) lines.push(renderUnderStepLine(s, n2, `\u26A0 ${s.warning}`));
23492
+ lines.push(...renderScriptLogLines(s, n2));
23473
23493
  if (s.artifacts && typeof s.artifacts === "object") {
23474
23494
  for (const [k, v] of Object.entries(s.artifacts)) {
23475
23495
  if (typeof v === "string") lines.push(renderUnderStepLine(s, n2, `${k}: ${v}`));
@@ -23870,6 +23890,7 @@ ${recovery}`,
23870
23890
  liveIndex++;
23871
23891
  console.log(renderStepLine(s, liveIndex, flowName));
23872
23892
  if (s.warning) console.log(renderUnderStepLine(s, liveIndex, `\u26A0 ${s.warning}`));
23893
+ for (const line of renderScriptLogLines(s, liveIndex)) console.log(line);
23873
23894
  };
23874
23895
  let report;
23875
23896
  try {
@@ -15582,6 +15582,7 @@ import { basename, extname } from "node:path";
15582
15582
  var FLOW_NAME_CHARSET = "[A-Za-z0-9_-]+";
15583
15583
  var FLOW_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}$`);
15584
15584
  var FLOW_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.yaml$`);
15585
+ var SCRIPT_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.mjs$`);
15585
15586
 
15586
15587
  // ../registry/src/failure-codes.ts
15587
15588
  var FAILURE_CODES = {
@@ -16689,7 +16690,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16689
16690
  var SESSION_ID = randomUUID4();
16690
16691
  function readCliVersion() {
16691
16692
  if (true) {
16692
- return "0.24.1-next.5";
16693
+ return "0.24.1-next.6";
16693
16694
  }
16694
16695
  return "0.0.0";
16695
16696
  }
@@ -16410,6 +16410,7 @@ import { basename as basename2, extname } from "node:path";
16410
16410
  var FLOW_NAME_CHARSET = "[A-Za-z0-9_-]+";
16411
16411
  var FLOW_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}$`);
16412
16412
  var FLOW_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.yaml$`);
16413
+ var SCRIPT_FILE_NAME_PATTERN = new RegExp(`^${FLOW_NAME_CHARSET}\\.mjs$`);
16413
16414
 
16414
16415
  // ../registry/src/failure-codes.ts
16415
16416
  var FAILURE_CODES = {
@@ -18553,6 +18554,14 @@ async function flowRunToMcpContent(result, ctx) {
18553
18554
  type: "text",
18554
18555
  text: `[${num}] ${glyph}${stepIndent(step.depth)}${stepLabel(step)}${suffix}${warning}`
18555
18556
  });
18557
+ const scriptLog = typeof step.scriptLog === "string" ? step.scriptLog : "";
18558
+ const scriptLogTruncated = step.scriptLogTruncated === true;
18559
+ if (scriptLog || scriptLogTruncated) {
18560
+ const parts = [`${stepIndent(step.depth)}script output:`];
18561
+ if (scriptLog) parts.push(scriptLog.endsWith("\n") ? scriptLog.slice(0, -1) : scriptLog);
18562
+ if (scriptLogTruncated) parts.push("\u2026 output truncated");
18563
+ blocks.push({ type: "text", text: parts.join("\n") });
18564
+ }
18556
18565
  if (step.result !== void 0) {
18557
18566
  blocks.push(...await toMcpContent(step.result, step.outputHint, ctx, step.args));
18558
18567
  }