@letterstory/cli 0.176.19 → 0.176.20

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
@@ -81,7 +81,7 @@ import {
81
81
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
82
82
 
83
83
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
84
- export const VERSION = "0.176.19";
84
+ export const VERSION = "0.176.20";
85
85
 
86
86
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
87
87
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -120,6 +120,8 @@ export const BOOLEAN_FLAGS = new Set([
120
120
  "again",
121
121
  // build list: only Build's Archived tab (--open, already listed, is its Open tab).
122
122
  "archived",
123
+ // plan pending --queued: only the rows a person queued for later.
124
+ "queued",
123
125
  // ask --web: read the web in the Plan's fit for a recipe the facts can't decide (off by default).
124
126
  "web",
125
127
  "notify-slack",
@@ -1649,6 +1651,11 @@ Insights:
1649
1651
  them; each pick waits --veto-hours for a veto. Settings shown when none given.
1650
1652
  plan pending [--site host] What Auto-Plan picked and is waiting to build
1651
1653
  plan veto <proposal-id> Veto one: it is never built
1654
+ plan later <action-id> [--outcome geo|…] [--site host] Queue a Plan row for later: Auto-Plan starts it once it's ready
1655
+ plan later remove <queued-id> Take a queued row back off
1656
+ plan strategies [--site host] [--archived] The goals typed on the Plan, each a strategy
1657
+ plan strategy add "<words…>" [--site host] Keep a goal in your words as a strategy
1658
+ plan strategy archive <strategy-id> [--restore] Put one away (its card leaves the Plan), or bring it back
1652
1659
  insights summary [--period …] [--part <block>]... Measure Overview: AI named/cited rates, share of voice, search, targets
1653
1660
  insights reads [--period …] [--site all|own|phantoms|<key>]... [--path <path>] [--engine <operator>]
1654
1661
  Measure → Reads: AI engines and people reading your sites, counted one way
@@ -2,6 +2,7 @@
2
2
  // this account do next. The same answer as the console's Plan, Build and Fix tabs and Slack.
3
3
  // ask → each list's head: what's broken, what to build
4
4
  // ask --outcome geo|seo|… → the plan for that outcome (the Plan tab's box)
5
+ // ask --strategy <id> → a typed strategy's next actions (plan strategies)
5
6
  // ask --lens fix | --lens build → what's broken (most pressing first) | what to build
6
7
  // ask "<words…>" → in your own words; what nothing does comes back as unmet
7
8
  // ask "<words…>" --found "<…>" → with what you read outside the account for them (a case study)
@@ -12,6 +13,8 @@ import { argsFromFlags, flagStr, printResult, refuseUnknownFlags } from "./share
12
13
  export const ARGS = {
13
14
  ask_letterpress: {
14
15
  outcome: "outcome",
16
+ // --strategy <id>: a typed strategy's next actions (plan strategies), the same door as its words.
17
+ strategy_id: "strategy",
15
18
  lens: "lens",
16
19
  words: { value: (flags, positionals) => flagStr(flags.words) ?? (positionals.join(" ").trim() || undefined) },
17
20
  // --found: what was read outside the account for the words (a case study, a competitor), as findings.
@@ -24,10 +27,10 @@ export const ARGS = {
24
27
 
25
28
  export async function cmdAsk(ctx) {
26
29
  const { client, flags, io } = ctx;
27
- refuseUnknownFlags(ctx, {}, ["outcome", "lens", "words", "found", "site", "refresh"]);
30
+ refuseUnknownFlags(ctx, {}, ["outcome", "strategy", "lens", "words", "found", "site", "refresh"]);
28
31
  const args = argsFromFlags(ARGS.ask_letterpress, flags, ctx.positionals, {});
29
- if ([args.outcome, args.lens, args.words].filter(Boolean).length > 1)
30
- throw new CliError("One ask at a time: --outcome, --lens fix|build, or your words.");
32
+ if ([args.outcome, args.strategy_id, args.lens, args.words].filter(Boolean).length > 1)
33
+ throw new CliError("One ask at a time: --outcome, --strategy <id>, --lens fix|build, or your words.");
31
34
  const result = await client.callTool("ask_letterpress", args);
32
35
  printResult(io, flags, result, (r) => {
33
36
  const lines = [r.message];
@@ -5,6 +5,11 @@
5
5
  // [--aggression low|medium|high|xhigh] [--slack-channel <C…>|none] → set_auto_plan
6
6
  // plan pending → list_auto_plan_proposals (status pending)
7
7
  // plan veto <proposal-id> → veto_auto_plan_proposal
8
+ // plan later <action-id> [--outcome geo|…] → queue_plan_action (Auto-Plan starts it once it's ready)
9
+ // plan later remove <queued-id> → unqueue_plan_action
10
+ // plan strategies [--archived] → list_plan_strategies (the goals typed on the Plan)
11
+ // plan strategy add "<words…>" → create_plan_strategy
12
+ // plan strategy archive <strategy-id> → archive_plan_strategy (--restore brings it back)
8
13
 
9
14
  import { CliError } from "../client.mjs";
10
15
  import { argsFromFlags, flagStr, printResult, refuseUnknownFlags } from "./shared.mjs";
@@ -48,10 +53,26 @@ export const ARGS = {
48
53
  },
49
54
  list_auto_plan_proposals: {
50
55
  domain: "site",
51
- status: { flag: "status", enum: ["pending", "vetoed", "started", "failed"] },
56
+ status: { flag: "status", enum: ["pending", "vetoed", "started", "failed", "done"] },
57
+ queued: { flag: "queued", type: "bool" },
52
58
  limit: { flag: "limit", type: "num" },
53
59
  },
60
+ queue_plan_action: {
61
+ domain: "site",
62
+ action_id: { positional: 0, required: true, label: "action-id" },
63
+ outcome: "outcome",
64
+ },
65
+ unqueue_plan_action: { id: { positional: 0, required: true, label: "queued-id" } },
54
66
  veto_auto_plan_proposal: { id: { positional: 0, required: true, label: "proposal-id" } },
67
+ list_plan_strategies: { domain: "site", archived: { flag: "archived", type: "bool" } },
68
+ create_plan_strategy: {
69
+ domain: "site",
70
+ words: { value: (flags, positionals) => flagStr(flags.words) ?? (positionals.join(" ").trim() || undefined) },
71
+ },
72
+ archive_plan_strategy: {
73
+ id: { positional: 0, required: true, label: "strategy-id" },
74
+ archived: { value: (flags) => (flags.restore ? false : undefined) },
75
+ },
55
76
  };
56
77
 
57
78
  const SETTING_FLAGS = ["veto-hours", "auto-merge", "aggression", "slack-channel"];
@@ -70,8 +91,23 @@ export async function cmdPlan(ctx) {
70
91
  printResult(io, flags, result, (r) => r.message);
71
92
  return 0;
72
93
  }
94
+ if (sub === "later" && rest[0] === "remove") {
95
+ refuseUnknownFlags(ctx, {}, []);
96
+ const result = await client.callTool(
97
+ "unqueue_plan_action",
98
+ argsFromFlags(ARGS.unqueue_plan_action, flags, rest.slice(1))
99
+ );
100
+ printResult(io, flags, result, (r) => r.message);
101
+ return 0;
102
+ }
103
+ if (sub === "later") {
104
+ refuseUnknownFlags(ctx, {}, ["site", "outcome"]);
105
+ const result = await client.callTool("queue_plan_action", argsFromFlags(ARGS.queue_plan_action, flags, rest));
106
+ printResult(io, flags, result, (r) => r.message);
107
+ return 0;
108
+ }
73
109
  if (sub === "pending" || sub === "proposals") {
74
- refuseUnknownFlags(ctx, {}, ["site", "status", "limit"]);
110
+ refuseUnknownFlags(ctx, {}, ["site", "status", "queued", "limit"]);
75
111
  const args = argsFromFlags(ARGS.list_auto_plan_proposals, flags, rest);
76
112
  const result = await client.callTool("list_auto_plan_proposals", {
77
113
  ...(sub === "pending" ? { status: "pending" } : {}),
@@ -79,7 +115,16 @@ export async function cmdPlan(ctx) {
79
115
  });
80
116
  printResult(io, flags, result, (r) =>
81
117
  r.proposals.length
82
- ? r.proposals.map((p) => ` ${p.status.padEnd(8)} ${p.title} (builds ${p.due_at}) ${p.id}`).join("\n")
118
+ ? r.proposals
119
+ .map(
120
+ (p) =>
121
+ ` ${p.status.padEnd(8)} ${p.title} ${
122
+ p.queued_by
123
+ ? `(later${p.waits_on ? `, waits on ${p.waits_on}` : ""})`
124
+ : `(builds ${p.due_at})`
125
+ } ${p.id}`
126
+ )
127
+ .join("\n")
83
128
  : "Nothing pending."
84
129
  );
85
130
  return 0;
@@ -93,5 +138,41 @@ export async function cmdPlan(ctx) {
93
138
  printResult(io, flags, result, (r) => r.message);
94
139
  return 0;
95
140
  }
96
- throw new CliError("Usage: plan auto [settings…] | plan pending | plan veto <proposal-id>");
141
+ if (sub === "strategies") {
142
+ refuseUnknownFlags(ctx, {}, ["site", "archived"]);
143
+ const result = await client.callTool(
144
+ "list_plan_strategies",
145
+ argsFromFlags(ARGS.list_plan_strategies, flags, rest)
146
+ );
147
+ printResult(io, flags, result, (r) =>
148
+ r.strategies.length
149
+ ? r.strategies.map((s) => ` ${s.words} ${s.id}`).join("\n")
150
+ : 'No typed strategies. Add one: plan strategy add "<your goal>"'
151
+ );
152
+ return 0;
153
+ }
154
+ if (sub === "strategy") {
155
+ const action = rest[0];
156
+ if (action === "add") {
157
+ refuseUnknownFlags(ctx, {}, ["site", "words"]);
158
+ const args = argsFromFlags(ARGS.create_plan_strategy, flags, rest.slice(1));
159
+ if (!args.words) throw new CliError('Say the goal: plan strategy add "<your goal>"');
160
+ const result = await client.callTool("create_plan_strategy", args);
161
+ printResult(io, flags, result, (r) => r.message);
162
+ return 0;
163
+ }
164
+ if (action === "archive") {
165
+ refuseUnknownFlags(ctx, {}, ["restore"]);
166
+ const result = await client.callTool(
167
+ "archive_plan_strategy",
168
+ argsFromFlags(ARGS.archive_plan_strategy, flags, rest.slice(1))
169
+ );
170
+ printResult(io, flags, result, (r) => r.message);
171
+ return 0;
172
+ }
173
+ throw new CliError('Usage: plan strategy add "<words…>" | plan strategy archive <strategy-id> [--restore]');
174
+ }
175
+ throw new CliError(
176
+ "Usage: plan auto [settings…] | plan pending | plan veto <proposal-id> | plan later <action-id> | plan later remove <id> | plan strategies | plan strategy add|archive"
177
+ );
97
178
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.176.19",
3
+ "version": "0.176.20",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",