@letterstory/cli 0.177.207 → 0.177.208

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
@@ -93,7 +93,7 @@ import {
93
93
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
94
94
 
95
95
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
96
- export const VERSION = "0.177.207";
96
+ export const VERSION = "0.177.208";
97
97
 
98
98
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
99
99
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -2028,10 +2028,13 @@ Build (a change to your site, or launching what isn't code; the Build box's own
2028
2028
  build status <build-id> One build: each change's state, its preview and pull request
2029
2029
  build follow <build-id> [--json] What its agents do, line by line, until nothing in it is at
2030
2030
  work (as letterpress follows a build); --json: one line per event
2031
- build conversations [--limit <n>] [--origin <door>] Your conversations with Build, most recently active first;
2031
+ build conversations [--limit <n>] [--offset <n>] [--site <host>] [--open|--archived] [--origin <door>]
2032
+ Your conversations with Build, most recently active first;
2032
2033
  --origin console: only the Build box's (letter_edit: ⌘L's)
2033
2034
  build conversation <conversation-id> | --build <build-id>
2034
2035
  Every message in one, oldest first
2036
+ build archive-conversation <conversation-id> [--restore]
2037
+ Archive or restore a Build session
2035
2038
 
2036
2039
  The Site (one model of your whole marketing site, keyed by host and path):
2037
2040
  site list Mapped hosts, and hosts you already have elsewhere
@@ -15,6 +15,7 @@
15
15
  // build follow <id> → list_growth_builds (advance) + get_repo_change_activity, until nothing is at work
16
16
  // build conversations → list_build_conversations
17
17
  // build conversation <id> → get_build_conversation (--build <id> for the one holding a build)
18
+ // build archive-conversation <id> → archive_build_conversation (--restore brings the session back)
18
19
 
19
20
  import { readFileSync } from "node:fs";
20
21
  import { CliError } from "../client.mjs";
@@ -205,11 +206,21 @@ const ARGS = {
205
206
  from_plan: { flag: "from-plan", type: "bool" },
206
207
  },
207
208
  // --origin console: only what the app's Build box started (letter_edit: ⌘L's, mcp: the terminal's or an agent's).
208
- list_build_conversations: { limit: { flag: "limit", type: "num" }, origin: "origin" },
209
+ list_build_conversations: {
210
+ limit: { flag: "limit", type: "num" },
211
+ offset: { flag: "offset", type: "num" },
212
+ archived: { flag: "archived", type: "bool", negate: "open" },
213
+ domain: "site",
214
+ origin: "origin",
215
+ },
209
216
  get_build_conversation: {
210
217
  conversation_id: { positional: 0, label: "conversation-id" },
211
218
  build_id: "build",
212
219
  },
220
+ archive_build_conversation: {
221
+ conversation_id: { positional: 0, required: true, label: "conversation-id" },
222
+ archived: { value: (flags) => (flags.restore ? false : undefined) },
223
+ },
213
224
  };
214
225
 
215
226
  const FILE_FLAGS = ["attach", "attach-url", "attach-ref", "attach-url-ref"];
@@ -232,6 +243,8 @@ export async function cmdBuild(ctx) {
232
243
  // Only `archive <build-id>`: "archive old blog posts" is words to build from.
233
244
  if (ctx.positionals[0] === "archive" && /^[0-9a-f-]{36}$/i.test(ctx.positionals[1] ?? ""))
234
245
  return buildArchive({ ...ctx, positionals: ctx.positionals.slice(1) });
246
+ if (ctx.positionals[0] === "archive-conversation")
247
+ return buildArchiveConversation({ ...ctx, positionals: ctx.positionals.slice(1) });
235
248
  if (ctx.positionals[0] === "retry") return buildRetry({ ...ctx, positionals: ctx.positionals.slice(1) });
236
249
  if (ctx.positionals[0] === "benchmark") return buildBenchmark({ ...ctx, positionals: ctx.positionals.slice(1) });
237
250
  if (ctx.positionals[0] === "benchmarks") return buildBenchmarks({ ...ctx, positionals: ctx.positionals.slice(1) });
@@ -535,7 +548,7 @@ async function buildFollow(ctx) {
535
548
  /** `build conversations`: the organization's conversations with Build, most recently active first. */
536
549
  async function buildConversations(ctx) {
537
550
  const { client, flags, io } = ctx;
538
- refuseUnknownFlags(ctx, {}, ["limit", "origin"]);
551
+ refuseUnknownFlags(ctx, ARGS.list_build_conversations);
539
552
  const result = await client.callTool(
540
553
  "list_build_conversations",
541
554
  argsFromFlags(ARGS.list_build_conversations, flags)
@@ -550,6 +563,22 @@ async function buildConversations(ctx) {
550
563
  return 0;
551
564
  }
552
565
 
566
+ async function buildArchiveConversation(ctx) {
567
+ const { client, flags, io, positionals } = ctx;
568
+ refuseUnknownFlags(ctx, ARGS.archive_build_conversation);
569
+ if (positionals.length !== 1 || !UUID.test(positionals[0]))
570
+ throw new CliError("Name the session: build archive-conversation <conversation-id> [--restore]");
571
+ const args = argsFromFlags(ARGS.archive_build_conversation, flags, positionals);
572
+ const result = await client.callTool("archive_build_conversation", args);
573
+ printResult(
574
+ io,
575
+ flags,
576
+ result,
577
+ (r) => `${args.archived === false ? "Restored" : "Archived"}: ${r.conversation.title}`
578
+ );
579
+ return 0;
580
+ }
581
+
553
582
  /** `build conversation <id>` (or --build <id>): every message, oldest first. */
554
583
  async function buildConversation(ctx) {
555
584
  const { client, flags, io } = ctx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.207",
3
+ "version": "0.177.208",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",