@swmansion/argent 0.16.1-next.0 → 0.16.1-next.10

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
@@ -6226,6 +6226,7 @@ var FAILURE_CODES = {
6226
6226
  NATIVE_DEVTOOLS_RPC_TIMEOUT: "NATIVE_DEVTOOLS_RPC_TIMEOUT",
6227
6227
  NATIVE_DEVTOOLS_RPC_ERROR: "NATIVE_DEVTOOLS_RPC_ERROR",
6228
6228
  NATIVE_DEVTOOLS_SERVICE_DISPOSED: "NATIVE_DEVTOOLS_SERVICE_DISPOSED",
6229
+ NATIVE_DEVTOOLS_SOCKET_BIND_FAILED: "NATIVE_DEVTOOLS_SOCKET_BIND_FAILED",
6229
6230
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
6230
6231
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
6231
6232
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -8423,6 +8424,11 @@ var STATUS_GLYPH = {
8423
8424
  error: "\u2717",
8424
8425
  skip: "\xB7"
8425
8426
  };
8427
+ var MAX_RENDER_DEPTH = 20;
8428
+ function stepIndent(depth) {
8429
+ if (typeof depth !== "number" || !Number.isInteger(depth) || depth <= 0) return "";
8430
+ return " ".repeat(Math.min(depth, MAX_RENDER_DEPTH));
8431
+ }
8426
8432
  function printHelp() {
8427
8433
  console.log(`Usage: argent flow <subcommand> [options]
8428
8434
 
@@ -8489,13 +8495,25 @@ function parseRunArgs(argv) {
8489
8495
  }
8490
8496
  return out;
8491
8497
  }
8498
+ function renderEchoLine(s) {
8499
+ if (!s.message) return void 0;
8500
+ const indent = stepIndent(s.depth);
8501
+ if (s.status === "skip") {
8502
+ const reason = s.reason ? ` \u2014 ${s.reason}` : "";
8503
+ return ` ${STATUS_GLYPH.skip} ${indent}\u203A ${s.message}${reason}`;
8504
+ }
8505
+ return ` ${indent}\u203A ${s.message}`;
8506
+ }
8492
8507
  function renderStepLine(s, n2, topFlow) {
8493
8508
  const where = s.flow && s.flow !== topFlow ? ` [${s.flow}]` : "";
8494
8509
  const what = s.tool ?? s.target;
8495
8510
  const label = what ? `${s.kind} ${what}` : s.kind;
8496
8511
  const reason = s.reason ? ` \u2014 ${s.reason}` : "";
8497
8512
  const glyph = s.status === "pass" && s.warning ? "\u26A0" : STATUS_GLYPH[s.status];
8498
- return ` ${glyph} ${String(n2).padStart(2)} ${label}${where}${reason}`;
8513
+ return ` ${glyph} ${String(n2).padStart(2)} ${stepIndent(s.depth)}${label}${where}${reason}`;
8514
+ }
8515
+ function renderUnderStepLine(s, n2, text2) {
8516
+ return `${" ".repeat(5 + Math.max(2, String(n2).length))}${stepIndent(s.depth)}${text2}`;
8499
8517
  }
8500
8518
  function renderSummary(report, opts = {}) {
8501
8519
  const warnings = report.steps.filter((s) => s.warning).length;
@@ -8576,15 +8594,16 @@ function renderReport(report) {
8576
8594
  let n2 = 0;
8577
8595
  for (const s of report.steps) {
8578
8596
  if (s.kind === "echo") {
8579
- if (s.message) lines.push(` \u203A ${s.message}`);
8597
+ const line = renderEchoLine(s);
8598
+ if (line) lines.push(line);
8580
8599
  continue;
8581
8600
  }
8582
8601
  n2++;
8583
8602
  lines.push(renderStepLine(s, n2, report.flow));
8584
- if (s.warning) lines.push(` \u26A0 ${s.warning}`);
8603
+ if (s.warning) lines.push(renderUnderStepLine(s, n2, `\u26A0 ${s.warning}`));
8585
8604
  if (s.artifacts && typeof s.artifacts === "object") {
8586
8605
  for (const [k, v] of Object.entries(s.artifacts)) {
8587
- if (typeof v === "string") lines.push(` ${k}: ${v}`);
8606
+ if (typeof v === "string") lines.push(renderUnderStepLine(s, n2, `${k}: ${v}`));
8588
8607
  }
8589
8608
  }
8590
8609
  }
@@ -8653,12 +8672,13 @@ async function flow(argv, options) {
8653
8672
  if (liveSteps === 0) console.log(`Flow "${flowName}"`);
8654
8673
  liveSteps++;
8655
8674
  if (s.kind === "echo") {
8656
- if (s.message) console.log(` \u203A ${s.message}`);
8675
+ const line = renderEchoLine(s);
8676
+ if (line) console.log(line);
8657
8677
  return;
8658
8678
  }
8659
8679
  liveIndex++;
8660
8680
  console.log(renderStepLine(s, liveIndex, flowName));
8661
- if (s.warning) console.log(` \u26A0 ${s.warning}`);
8681
+ if (s.warning) console.log(renderUnderStepLine(s, liveIndex, `\u26A0 ${s.warning}`));
8662
8682
  };
8663
8683
  let report;
8664
8684
  try {
@@ -16120,6 +16120,7 @@ var FAILURE_CODES = {
16120
16120
  NATIVE_DEVTOOLS_RPC_TIMEOUT: "NATIVE_DEVTOOLS_RPC_TIMEOUT",
16121
16121
  NATIVE_DEVTOOLS_RPC_ERROR: "NATIVE_DEVTOOLS_RPC_ERROR",
16122
16122
  NATIVE_DEVTOOLS_SERVICE_DISPOSED: "NATIVE_DEVTOOLS_SERVICE_DISPOSED",
16123
+ NATIVE_DEVTOOLS_SOCKET_BIND_FAILED: "NATIVE_DEVTOOLS_SOCKET_BIND_FAILED",
16123
16124
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
16124
16125
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
16125
16126
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -17652,6 +17652,7 @@ var FAILURE_CODES = {
17652
17652
  NATIVE_DEVTOOLS_RPC_TIMEOUT: "NATIVE_DEVTOOLS_RPC_TIMEOUT",
17653
17653
  NATIVE_DEVTOOLS_RPC_ERROR: "NATIVE_DEVTOOLS_RPC_ERROR",
17654
17654
  NATIVE_DEVTOOLS_SERVICE_DISPOSED: "NATIVE_DEVTOOLS_SERVICE_DISPOSED",
17655
+ NATIVE_DEVTOOLS_SOCKET_BIND_FAILED: "NATIVE_DEVTOOLS_SOCKET_BIND_FAILED",
17655
17656
  NATIVE_TARGET_NO_CONNECTED_APPS: "NATIVE_TARGET_NO_CONNECTED_APPS",
17656
17657
  NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND: "NATIVE_TARGET_SINGLE_APP_NOT_FOREGROUND",
17657
17658
  NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS: "NATIVE_TARGET_MULTIPLE_APPS_AMBIGUOUS",
@@ -18896,6 +18897,11 @@ var STATUS_GLYPH = {
18896
18897
  error: "\u2717",
18897
18898
  skip: "\xB7"
18898
18899
  };
18900
+ var MAX_RENDER_DEPTH = 20;
18901
+ function stepIndent(depth) {
18902
+ if (typeof depth !== "number" || !Number.isInteger(depth) || depth <= 0) return "";
18903
+ return " ".repeat(Math.min(depth, MAX_RENDER_DEPTH));
18904
+ }
18899
18905
  function stepLabel(step) {
18900
18906
  if (step.kind === "echo") return step.message ?? "";
18901
18907
  if (step.kind === "run") return `run ${step.flow ?? ""}`.trim();
@@ -18919,12 +18925,15 @@ async function flowRunToMcpContent(result, ctx) {
18919
18925
  const reason = step.reason ?? step.error;
18920
18926
  const suffix = reason ? ` \u2014 ${reason}` : "";
18921
18927
  const warning = step.warning ? ` \u26A0 ${step.warning}` : "";
18922
- blocks.push({ type: "text", text: `[${num}] ${glyph}${stepLabel(step)}${suffix}${warning}` });
18928
+ blocks.push({
18929
+ type: "text",
18930
+ text: `[${num}] ${glyph}${stepIndent(step.depth)}${stepLabel(step)}${suffix}${warning}`
18931
+ });
18923
18932
  if (step.result !== void 0) {
18924
18933
  blocks.push(...await toMcpContent(step.result, step.outputHint, ctx, step.args));
18925
18934
  }
18926
18935
  if (isRecord(step.artifacts)) {
18927
- blocks.push(...await stepArtifactBlocks(step.artifacts, step.status, ctx));
18936
+ blocks.push(...await stepArtifactBlocks(step.artifacts, step.status, ctx, step.depth));
18928
18937
  }
18929
18938
  }
18930
18939
  if (result.ok !== void 0) {
@@ -18937,7 +18946,7 @@ async function flowRunToMcpContent(result, ctx) {
18937
18946
  }
18938
18947
  return blocks;
18939
18948
  }
18940
- async function stepArtifactBlocks(artifacts, status, ctx) {
18949
+ async function stepArtifactBlocks(artifacts, status, ctx, depth) {
18941
18950
  const failed = status === "fail" || status === "error";
18942
18951
  const entries = [];
18943
18952
  let diffImage;
@@ -18953,7 +18962,8 @@ async function stepArtifactBlocks(artifacts, status, ctx) {
18953
18962
  entries.push([k, v]);
18954
18963
  }
18955
18964
  }
18956
- const blocks = entries.length > 0 ? [{ type: "text", text: entries.map(([k, v]) => ` ${k}: ${v}`).join("\n") }] : [];
18965
+ const indent = stepIndent(depth);
18966
+ const blocks = entries.length > 0 ? [{ type: "text", text: entries.map(([k, v]) => ` ${indent}${k}: ${v}`).join("\n") }] : [];
18957
18967
  if (diffImage) blocks.push(diffImage);
18958
18968
  return blocks;
18959
18969
  }