@letterstory/cli 0.133.0 → 0.134.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.
package/lib/cli.mjs CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  } from "./commands.mjs";
63
63
 
64
64
  // Keep in sync with cli/package.json.
65
- export const VERSION = "0.133.0";
65
+ export const VERSION = "0.134.0";
66
66
 
67
67
  // Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
68
68
  // can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
@@ -449,6 +449,10 @@ Reviewers:
449
449
  automations show <automation-id> --collection <id> What it covers, its queued posts, its next ideas
450
450
  automations ideas --collection <id> The ideas waiting, grouped by the automation that owns each
451
451
  automations suggest --collection <id> What it could add: topics, series formats, signals
452
+ automations starter --collection <id> The first automations, from its evidence, with the
453
+ calls that accept them (steps)
454
+ automations ground --collection <id> Its ground: strengths, near wins and gaps, with the numbers
455
+ automations works --collection <id> What works: each post and automation against its peers
452
456
  automations preview topic|series --collection <id> [--name <name>|--topic <id>] [--brief <text>]
453
457
  What it would write, before adding it
454
458
  automations more --collection <id> New topics it doesn't cover yet
@@ -1,5 +1,5 @@
1
1
  // `automations` — a letterbase's automations (docs/architecture/automations.md): what it writes,
2
- // how often, and why. list / show / ideas / suggest / preview / more / add / set / dismiss / remove, through the same tools the app uses.
2
+ // how often, and why. list / show / ideas / suggest / starter / ground / works / preview / more / add / set / dismiss / remove, through the same tools the app uses.
3
3
  // Same flag/positional/io conventions as posts.mjs — no commander, no color.
4
4
 
5
5
  import { CliError } from "../client.mjs";
@@ -16,6 +16,15 @@ export const ARGS = {
16
16
  suggest_automations: {
17
17
  collection_id: { flag: "collection", required: true },
18
18
  },
19
+ suggest_starter_automations: {
20
+ collection_id: { flag: "collection", required: true },
21
+ },
22
+ get_ground_measures: {
23
+ collection_id: { flag: "collection", required: true },
24
+ },
25
+ get_what_works: {
26
+ collection_id: { flag: "collection", required: true },
27
+ },
19
28
  get_automation: {
20
29
  collection_id: { flag: "collection", required: true },
21
30
  automation_id: { positional: 0, label: "automation-id", required: true },
@@ -61,6 +70,7 @@ export const ARGS = {
61
70
  dismiss_subject: {
62
71
  collection_id: { flag: "collection", required: true },
63
72
  topic_id: { positional: 0, label: "topic-id", required: true },
73
+ reason: { flag: "reason" },
64
74
  },
65
75
  delete_automation: {
66
76
  collection_id: { flag: "collection", required: true },
@@ -81,6 +91,12 @@ export async function cmdAutomations(ctx) {
81
91
  return run(rest, "list_automation_ideas");
82
92
  case "suggest":
83
93
  return run(rest, "suggest_automations");
94
+ case "starter":
95
+ return run(rest, "suggest_starter_automations");
96
+ case "ground":
97
+ return run(rest, "get_ground_measures");
98
+ case "works":
99
+ return run(rest, "get_what_works");
84
100
  case "preview":
85
101
  return run(rest, "preview_automation");
86
102
  case "more":
@@ -97,7 +113,7 @@ export async function cmdAutomations(ctx) {
97
113
  return run(rest, "delete_automation", "Removed.");
98
114
  default:
99
115
  throw new CliError(
100
- `Unknown automations subcommand: ${sub ?? "(none)"}. Try: list, show, ideas, suggest, preview, more, add, set, dismiss, remove`
116
+ `Unknown automations subcommand: ${sub ?? "(none)"}. Try: list, show, ideas, suggest, starter, ground, works, preview, more, add, set, dismiss, remove`
101
117
  );
102
118
  }
103
119
  }
@@ -103,9 +103,11 @@ export async function cmdSuggestions(ctx) {
103
103
  return suggestionsDecide(rest, "dismiss");
104
104
  case "snooze":
105
105
  return suggestionsDecide(rest, "snooze");
106
+ case "undo":
107
+ return suggestionsDecide(rest, "undo");
106
108
  default:
107
109
  throw new CliError(
108
- "Usage: suggestions <list <collection_id>|approve|dismiss|snooze <verdict|proposal> <id>>"
110
+ "Usage: suggestions <list <collection_id>|approve|dismiss|snooze|undo <verdict|proposal> <id>>"
109
111
  );
110
112
  }
111
113
  }
@@ -117,7 +119,9 @@ function formatSuggestionLine(s) {
117
119
  ? `snoozed→${s.snoozed_until.slice(0, 10)}`
118
120
  : `auto→${(s.auto_apply_at ?? "").slice(0, 10)}`
119
121
  : "hold";
120
- return `${s.kind} ${s.id} [${when}] ${s.cluster_name ?? "site"}: ${s.title}`;
122
+ const line = `${s.kind} ${s.id} [${when}] ${s.cluster_name ?? "site"}: ${s.title}`;
123
+ // A change to the automations' week: the week after, and why.
124
+ return s.week ? `${line}\n ${s.week.line}\n ${s.reason ?? ""}` : line;
121
125
  }
122
126
 
123
127
  async function suggestionsList(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.133.0",
3
+ "version": "0.134.0",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",