@letterstory/cli 0.92.0 → 0.93.1

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/lib/cli.mjs CHANGED
@@ -57,7 +57,7 @@ import {
57
57
  } from "./commands.mjs";
58
58
 
59
59
  // Keep in sync with cli/package.json.
60
- export const VERSION = "0.92.0";
60
+ export const VERSION = "0.93.1";
61
61
 
62
62
  // Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
63
63
  // can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
@@ -759,13 +759,9 @@ async function cmdOnboardNext(ctx) {
759
759
  }
760
760
 
761
761
  // `onboard primitives [<domain>]` — what Letterstory would stand up for this company: one
762
- // read of propose_primitive_plan, printed as a table whose last column is the exact
763
- // `call` that sets each item up. Nothing runs; approving an item is running its line.
762
+ // read of propose_primitive_plan, printed item by item with the org-config record each one
763
+ // stands for. Nothing runs; the plan is applied with `org apply`.
764
764
  // A first read crawls the site; `pending` means one is already in flight, so wait and ask.
765
- function shellQuote(json) {
766
- return `'${json.replace(/'/g, "'\\''")}'`;
767
- }
768
-
769
765
  function formatPrimitivePlan(ctx) {
770
766
  return (res) => {
771
767
  if (res.status !== "complete") {
@@ -779,23 +775,24 @@ function formatPrimitivePlan(ctx) {
779
775
  // A part of its parent's setup prints indented under it.
780
776
  const pad = item.parent ? " " : "";
781
777
  const mark = item.status === "exists" ? "running " : "proposed";
782
- lines.push(`${pad}${mark} ${item.title}`);
778
+ lines.push(`${pad}${mark} ${item.title}${item.gates?.length ? ` [${item.gates.join(", ")}]` : ""}`);
783
779
  lines.push(
784
780
  item.status === "exists"
785
781
  ? `${pad} already: ${item.existing.map((e) => e.name).join(", ")}`
786
782
  : `${pad} ${item.detail}`
787
783
  );
788
- if (item.call) {
784
+ if (item.record) {
789
785
  lines.push(
790
- `${pad} ${ctx.bin} call ${item.call.tool} --args ${shellQuote(JSON.stringify(item.call.args))}`
786
+ `${pad} ${item.record.section === "settings" ? "~ settings.defaultKernel" : `+ ${item.record.section} "${item.record.name}"`}`
791
787
  );
792
- for (const [arg, ref] of Object.entries(item.refs ?? {})) {
793
- lines.push(`${pad} with ${arg} = ${ref.field} from ${ref.item}`);
794
- }
795
- if (item.after?.length) lines.push(`${pad} after: ${item.after.join(", ")}`);
796
- if (item.poll) lines.push(`${pad} then poll: ${item.poll.tool}`);
797
788
  }
798
789
  }
790
+ const gates = [...new Set(plan.items.flatMap((i) => (i.record ? (i.gates ?? []) : [])))].sort();
791
+ lines.push("");
792
+ lines.push("The plan is an org-config bundle. Save it and apply it like any other:");
793
+ lines.push(` ${ctx.bin} ${recipeName(ctx)} primitives --json | jq .plan.config > plan.json`);
794
+ lines.push(` ${ctx.bin} org apply plan.json --dry-run${gates.length ? ` --allow ${gates.join(",")}` : ""}`);
795
+ lines.push("Drop a record from plan.json to leave that item out.");
799
796
  return lines.join("\n");
800
797
  };
801
798
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.92.0",
3
+ "version": "0.93.1",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",