@letterstory/cli 0.177.116 → 0.177.118

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/README.md CHANGED
@@ -903,6 +903,7 @@ letterstory mail postal-address "123 Main St, Portland, OR 97201" # CAN-SPAM f
903
903
  # Sequences (approving or enrolling SENDS)
904
904
  letterstory sequences list | get <id> | create | update <id> | pause <id> | resume <id>
905
905
  letterstory sequences enroll <id> --list <list-id> # or --email a@x.com ...
906
+ letterstory sequences stop <id> --list <list-id> # or <enrollment-id>... or --all
906
907
  letterstory sequences review list | approve <item-id> | skip <item-id> | edit <item-id> --subject "…"
907
908
  letterstory sequences links create --days 2 # no-login phone review link, shown once
908
909
  letterstory sequences update <id> --test-mode # internal accounts only: walks as live, sends nothing
@@ -915,7 +916,7 @@ letterstory prospects lists | ls --list <list-id> | get <id> | import --csv-file
915
916
  letterstory prospects source --description "heads of growth at seed-stage fintech" --list-name "Fintech"
916
917
  letterstory prospects openers <list-id> --new-group "Fintech openers" # print an opening line per row
917
918
  letterstory prospects columns add "Cake image" | columns delete <column-id> --yes
918
- letterstory prospects delete <prospect-id>... --yes
919
+ letterstory prospects delete <prospect-id>... --yes # or --list <list-id> for the whole list; active enrollments stop
919
920
  ```
920
921
 
921
922
  Connecting a bring-your-own Gmail mailbox needs a browser (Google consent), so it is done in the
package/lib/cli.mjs CHANGED
@@ -87,11 +87,12 @@ import {
87
87
  cmdRefs,
88
88
  cmdModels,
89
89
  cmdUsage,
90
+ cmdLog,
90
91
  } from "./commands.mjs";
91
92
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
92
93
 
93
94
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
94
- export const VERSION = "0.177.116";
95
+ export const VERSION = "0.177.118";
95
96
 
96
97
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
97
98
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -1585,6 +1586,9 @@ Seers (event-driven signals -> drafts):
1585
1586
  seers apply --file <path> [--dry-run] Idempotent, name-keyed upsert from a manifest
1586
1587
  (never deletes; --dry-run prints the plan)
1587
1588
 
1589
+ Log (what Letter did for your org, newest first: pull requests, posts, emails, purchases):
1590
+ log [--limit <n>] [--before <ISO>] One page; --before pages back
1591
+
1588
1592
  Org (the account as one file, its integrations and billing):
1589
1593
  org export [--sections <s>…] [--file <path>] The org's whole config as one JSON bundle
1590
1594
  org export --split <dir> …as one file per record (for keeping config in git)
@@ -1773,7 +1777,8 @@ Sequences (multi-step cold email sent from your mailers; approving or enrolling
1773
1777
  --enroll-on-cake-list: only for prospects in that list (none = any)
1774
1778
  sequences pause|resume <sequence-id> Stop / restart sending
1775
1779
  sequences enroll <sequence-id> (--list <list-id> | --email <addr>... | --recipients '<json>'|--recipients-file <path>)
1776
- sequences stop <sequence-id> <enrollment-id> Stop one recipient
1780
+ sequences stop <sequence-id> (<enrollment-id>... | --list <list-id> | --all)
1781
+ Stop recipients: these, a list's, or everyone
1777
1782
  sequences review list Emails waiting for a decision
1778
1783
  sequences review edit <item-id> [--subject <s>] [--body <text>|--file <path>]
1779
1784
  [--personalize <line> [--personalize-mode replace|insert]] Mark the edit a personalization (proposed to the opener library)
@@ -1814,7 +1819,8 @@ Prospects (who you write to):
1814
1819
  Funding + competitors for un-enriched rows
1815
1820
  prospects openers <list-id> [--group <ledes-group-id>|--new-group <name>]
1816
1821
  Print an opening line for every row without one (background)
1817
- prospects delete <prospect-id>... --yes Permanently delete prospects
1822
+ prospects delete (<prospect-id>... | --list <list-id> [--status <s>] [--q <text>]) --yes
1823
+ Permanently delete prospects (a whole list in one go); their active enrollments stop
1818
1824
  prospects columns add <label> Add a custom column (key returned)
1819
1825
  prospects columns delete <column-id> --yes
1820
1826
  prospects update <prospect-id> [--status new|contacted|replied|unsubscribed|archived] [--name <n>]
@@ -2371,6 +2377,7 @@ const CLIENT_COMMANDS = {
2371
2377
  refs: cmdRefs,
2372
2378
  models: cmdModels,
2373
2379
  usage: cmdUsage,
2380
+ log: cmdLog,
2374
2381
  // Platform-scoped (staff key) — the only commands that act BEFORE an org exists.
2375
2382
  admin: cmdAdmin,
2376
2383
  };
@@ -0,0 +1,32 @@
1
+ // `log` — the Log from a terminal (docs/architecture/letter-log.md): what Letter did for the org, newest first.
2
+ // A thin wrapper over get_letter_log, the function the app's Log page calls.
3
+ //
4
+ // letterstory log [--limit <n>] [--before <ISO>]
5
+
6
+ import { argsFromFlags, printResult } from "./shared.mjs";
7
+
8
+ export const ARGS = {
9
+ get_letter_log: {
10
+ limit: { flag: "limit", type: "num" },
11
+ before: { flag: "before" },
12
+ },
13
+ };
14
+
15
+ export async function cmdLog(ctx) {
16
+ const { client, flags, io } = ctx;
17
+ const result = await client.callTool("get_letter_log", argsFromFlags(ARGS.get_letter_log, flags, ctx.positionals));
18
+ printResult(
19
+ io,
20
+ flags,
21
+ result,
22
+ (r) =>
23
+ [
24
+ ...r.entries.map(
25
+ (e) =>
26
+ `${e.at.slice(0, 16).replace("T", " ")} ${e.action}${e.title ? ` ${e.title}` : ""}${e.by ? ` (${e.by})` : ""}`
27
+ ),
28
+ ...(r.next_before ? [`Older: letterstory log --before ${r.next_before}`] : []),
29
+ ].join("\n") || "Nothing yet"
30
+ );
31
+ return 0;
32
+ }
@@ -216,9 +216,13 @@ export const ARGS = {
216
216
  recipients: { value: readRecipients },
217
217
  list_id: "list",
218
218
  },
219
+ // `stop <sequence-id> <enrollment-id>...` | `--list <list-id>` | `--all`.
219
220
  stop_sequence_enrollment: {
220
221
  sequence_id: { positional: 0, label: "sequence-id", required: true },
221
- enrollment_id: { positional: 1, label: "enrollment-id", required: true },
222
+ enrollment_id: { value: (_flags, positionals) => (positionals.length === 2 ? positionals[1] : undefined) },
223
+ enrollment_ids: { value: (_flags, positionals) => (positionals.length > 2 ? positionals.slice(1) : undefined) },
224
+ list_id: "list",
225
+ all: { flag: "all", type: "bool" },
222
226
  },
223
227
  list_review_items: {
224
228
  dispatch_id: "dispatch",
@@ -317,14 +321,22 @@ export const ARGS = {
317
321
  status: { flag: "status", enum: PROSPECT_STATUSES },
318
322
  q: "q",
319
323
  },
324
+ // `delete <prospect-id>...`, or a whole view: `--list <list-id>` / `--status` / `--q`.
320
325
  delete_prospects: {
321
326
  prospect_ids: {
322
327
  value: (flags, positionals) => {
323
328
  const ids = [...positionals, ...flagList(flags.id)];
324
- if (!ids.length) throw new CliError("Missing <prospect-id>... (or --id <prospect-id>, repeatable)");
325
- return ids;
329
+ if (ids.length) return ids;
330
+ if (flags.list === undefined && flags.status === undefined && flags.q === undefined)
331
+ throw new CliError(
332
+ "Missing <prospect-id>... (or --list <list-id> / --status / --q for a whole view)"
333
+ );
334
+ return undefined;
326
335
  },
327
336
  },
337
+ list_id: "list",
338
+ status: { flag: "status", enum: PROSPECT_STATUSES },
339
+ q: "q",
328
340
  },
329
341
  create_prospect_column: {
330
342
  label: { positional: 0, label: "label", required: true },
@@ -587,7 +599,7 @@ export async function cmdSequences(ctx) {
587
599
  case "enroll":
588
600
  return run(rest, "enroll_in_sequence", "Enrolled.");
589
601
  case "stop":
590
- return run(rest, "stop_sequence_enrollment", "Enrollment stopped.");
602
+ return run(rest, "stop_sequence_enrollment", "Stopped.");
591
603
  case "review":
592
604
  return sequencesReview({ ...rest, positionals: rest.positionals.slice(1) }, rest.positionals[0]);
593
605
  case "links":
package/lib/commands.mjs CHANGED
@@ -56,6 +56,7 @@ export * from "./commands/sim.mjs";
56
56
  export * from "./commands/vary.mjs";
57
57
  export * from "./commands/domains.mjs";
58
58
  export * from "./commands/usage.mjs";
59
+ export * from "./commands/log.mjs";
59
60
  export * from "./commands/proofs.mjs";
60
61
  export * from "./commands/bench.mjs";
61
62
  export * from "./commands/replicate.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.116",
3
+ "version": "0.177.118",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",