@erdoai/cli 0.137.0 → 0.138.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 +20 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1866,6 +1866,7 @@ var ErdoClient = class {
1866
1866
  if (opts.since) params.set("since", opts.since);
1867
1867
  if (opts.limit) params.set("limit", String(opts.limit));
1868
1868
  if (opts.offset) params.set("offset", String(opts.offset));
1869
+ if (opts.lapsed_offset) params.set("lapsed_offset", String(opts.lapsed_offset));
1869
1870
  const qs = params.toString();
1870
1871
  return this.request("GET", `/v1/decisions${qs ? `?${qs}` : ""}`);
1871
1872
  }
@@ -4555,7 +4556,10 @@ var decisionsCmd = program.command("decisions").description(
4555
4556
  "The decision record \u2014 what your organization committed to, whether the change actually happened, and what the evidence said afterwards"
4556
4557
  );
4557
4558
  function decisionLine(d) {
4558
- const parts = [d.slug, d.status];
4559
+ const parts = [d.slug, d.lapsed ? "lapsed" : d.status];
4560
+ if (d.review_by) parts.push(`review_by=${d.review_by}`);
4561
+ if (d.age_seconds !== void 0) parts.push(`age_seconds=${d.age_seconds}`);
4562
+ if (d.exit_condition) parts.push(`exit_condition=${d.exit_condition}`);
4559
4563
  if (d.execution_status) parts.push(d.execution_status);
4560
4564
  parts.push(d.what);
4561
4565
  if (d.outcome_label) {
@@ -4614,7 +4618,11 @@ decisionsCmd.command("list").description("List decisions, newest first").option(
4614
4618
  ).option("--applicability <kind>", "standing | one_shot").option("--outcome <outcome>", "only decisions with a settled effect that came back met | not_met | inconclusive").option(
4615
4619
  "--approval <id>",
4616
4620
  "only the decisions produced by answering this approval (approvals are referenced by id, not slug)"
4617
- ).option("--since <timestamp>", "inclusive RFC3339 lower bound on the latest known decision movement").option("-l, --limit <n>", "max rows (default 50, max 200)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).option("--json", "output raw JSON").action(
4621
+ ).option("--since <timestamp>", "inclusive RFC3339 lower bound on the latest known decision movement").option("-l, --limit <n>", "max rows (default 50, max 200)", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).option(
4622
+ "--lapsed-offset <n>",
4623
+ "pagination offset into lapsed commitments (with --applicability standing; paged separately from --offset)",
4624
+ (v) => parseInt(v, 10)
4625
+ ).option("--json", "output raw JSON").action(
4618
4626
  async (opts) => {
4619
4627
  try {
4620
4628
  const res = await new ErdoClient().listDecisions({
@@ -4630,17 +4638,22 @@ decisionsCmd.command("list").description("List decisions, newest first").option(
4630
4638
  approval_id: opts.approval,
4631
4639
  since: opts.since,
4632
4640
  limit: opts.limit,
4633
- offset: opts.offset
4641
+ offset: opts.offset,
4642
+ lapsed_offset: opts.lapsedOffset
4634
4643
  });
4635
4644
  if (opts.json) {
4636
4645
  print(res);
4637
4646
  return;
4638
4647
  }
4639
- if (!res.decisions.length) {
4648
+ if (!res.decisions.length && !res.lapsed_decisions?.length) {
4640
4649
  console.log("No decisions match. Widen the filters, or check that the work engine is on for this org.");
4641
4650
  return;
4642
4651
  }
4643
4652
  for (const d of res.decisions) console.log(decisionLine(d));
4653
+ if (res.lapsed_decisions?.length) {
4654
+ console.log("Lapsed commitments (no longer current):");
4655
+ for (const d of res.lapsed_decisions) console.log(decisionLine(d));
4656
+ }
4644
4657
  } catch (e) {
4645
4658
  fail(e);
4646
4659
  }
@@ -4649,13 +4662,15 @@ decisionsCmd.command("list").description("List decisions, newest first").option(
4649
4662
  function renderDecision(detail) {
4650
4663
  const d = detail.decision;
4651
4664
  console.log(d.what);
4665
+ const applicability = d.lapsed ? `lapsed on ${d.review_by ?? "its review deadline"} \u2014 no longer current` : d.applicability === "standing" ? "standing (until superseded)" : "one-off authorization";
4652
4666
  const facts = [
4653
4667
  ["status", d.status],
4654
4668
  ["class", d.decision_class],
4655
4669
  ["source", d.source],
4656
- ["applies", d.applicability === "standing" ? "standing (until superseded)" : "one-off authorization"],
4670
+ ["applies", applicability],
4657
4671
  ["decided by", d.decided_by_name ? `${d.decided_by_name} (${d.decider_kind})` : d.decider_kind]
4658
4672
  ];
4673
+ if (d.review_by) facts.push(["review by", d.review_by]);
4659
4674
  if (d.subject_label) facts.push(["subject", d.subject_label]);
4660
4675
  if (d.execution_status) facts.push(["execution", d.execution_status]);
4661
4676
  if (d.outcome_status) facts.push(["outcome", d.outcome_label || d.outcome_status]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.137.0",
3
+ "version": "0.138.0",
4
4
  "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {