@erdoai/cli 0.73.0 → 0.74.0

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.
Files changed (2) hide show
  1. package/dist/index.js +18 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3550,8 +3550,9 @@ approvalsCmd.command("list").description("List approval requests, optionally fil
3550
3550
  }
3551
3551
  for (const r of res.requests) {
3552
3552
  const occ = r.occurrence_count && r.occurrence_count > 1 ? ` \xD7${r.occurrence_count}` : "";
3553
+ const verdict = r.execution ? `${r.status}/${executionVerdict(r.execution)}` : r.status;
3553
3554
  console.log(
3554
- `${r.id} ${r.status} ${r.action_key} ${r.action_display} ${r.created_at}${occ}`
3555
+ `${r.id} ${verdict} ${r.action_key} ${r.action_display} ${r.created_at}${occ}`
3555
3556
  );
3556
3557
  }
3557
3558
  } catch (e) {
@@ -3559,6 +3560,18 @@ approvalsCmd.command("list").description("List approval requests, optionally fil
3559
3560
  }
3560
3561
  }
3561
3562
  );
3563
+ function executionVerdict(execution) {
3564
+ switch (execution.state) {
3565
+ case "succeeded":
3566
+ return "landed";
3567
+ case "failed":
3568
+ return execution.total_count > 1 ? `${execution.failed_count} of ${execution.total_count} did not land` : "did not land";
3569
+ case "started":
3570
+ return "in flight";
3571
+ default:
3572
+ return "outcome unconfirmed";
3573
+ }
3574
+ }
3562
3575
  function renderApproval(r) {
3563
3576
  console.log(r.action_headline || r.action_display);
3564
3577
  const facts = [["status", r.status]];
@@ -3577,6 +3590,10 @@ function renderApproval(r) {
3577
3590
  facts.push(["created", r.created_at]);
3578
3591
  if (r.decided_at) facts.push(["decided", r.decided_at]);
3579
3592
  if (r.expires_at) facts.push(["expires", r.expires_at]);
3593
+ if (r.execution) {
3594
+ const reason = r.execution.summary ? ` \u2014 ${r.execution.summary}` : "";
3595
+ facts.push(["outcome", `${executionVerdict(r.execution)}${reason}`]);
3596
+ }
3580
3597
  for (const [label, value] of facts) {
3581
3598
  console.log(` ${label.padEnd(9)} ${value}`);
3582
3599
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.73.0",
3
+ "version": "0.74.0",
4
4
  "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {