@letterstory/cli 0.177.171 → 0.177.173

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.171";
96
+ export const VERSION = "0.177.173";
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;
@@ -5393,7 +5393,7 @@ const BUILD_FAILURES = "/api/superadmin/build-failures";
5393
5393
  const SUGGESTION_REVIEW = "/api/superadmin/suggestion-review";
5394
5394
  const TURN_ENDINGS = "/api/superadmin/turn-endings";
5395
5395
  const ENGINE_USAGE =
5396
- "Usage: admin letterpress status | gaps | friction [--kind error|exception|rage|step|rule|server|stall|background] [--surface s] [--org id] [--limit N] [--customers] | issues [--days N] [--state came_back|open|fixing|resolved] [--source ask|friction] [--surface s] [--whose ours|agent|setup] [--limit N] | issues fix|unfix <key> [--pr url] [--note …] | tools [--days N] [--org id] [--customers] | checks | frustration [--days N] | health | asks [--days N] [--surface cmd_l|build_chat|slack|terminal|app|signup|letter] [--people | --letter] [--door d] [--family premise|landing|preview|outcome|run|infra|writing|waiting|other] [--whose ours|agent|setup|member] [--pattern <code or key>] [--org id] [--limit N] [--customers] | telemetry [--days N] [--harness h] [--customers] | tokens [--days N] [--so-far] [--all-orgs] | prs [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--state merged|open|closed] [--people | --letter] [--top N] [--tz zone] [--all-orgs] | failures [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--failure ours|agent|setup|undelivered] [--cause c] [--stopped-at step] [--repo owner/name] [--slow] [--tz zone] [--customers] | blocked [--days N] [--org id] [--customers] | endings [--days N | --since ISO] [--org id,id] [--no-model] [--top N] [--write-cases [--dir evals/letterpress]] | unblock <org-id> <host> <subject> | decisions <org-id> [--site host] [--surface plan|fix|build|site] | undo <org-id> <host> <decision-id> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--no-change-code code] [--failure-kind network|provider|tool_denied|agent|unrecorded] [--pr merged|closed|open|none] [--harness h] [--days N] [--customers] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | ideas <org-id> [--site host] [--repo connected|none] | suggestions fix|idea [--day YYYY-MM-DD] [--type key [--org id]] [--customers] | suggestions flag fix|idea <type-key> [--org id --item item-id] [--note …] | suggestions clear <flag-id> | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
5396
+ "Usage: admin letterpress status | gaps | friction [--kind error|exception|rage|step|server|stall|background] [--surface s] [--org id] [--limit N] [--customers] | issues [--days N] [--state came_back|open|fixing|resolved] [--source ask|friction] [--surface s] [--whose ours|agent|setup] [--limit N] | issues fix|unfix <key> [--pr url] [--note …] | tools [--days N] [--org id] [--customers] | checks | frustration [--days N] | health | asks [--days N] [--surface cmd_l|build_chat|slack|terminal|app|signup|letter] [--people | --letter] [--door d] [--family premise|landing|preview|outcome|run|infra|writing|waiting|other] [--whose ours|agent|setup|member] [--pattern <code or key>] [--org id] [--limit N] [--customers] | telemetry [--days N] [--harness h] [--customers] | tokens [--days N] [--so-far] [--all-orgs] | prs [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--state merged|open|closed] [--people | --letter] [--top N] [--tz zone] [--all-orgs] | failures [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--failure ours|agent|setup|undelivered] [--cause c] [--stopped-at step] [--repo owner/name] [--slow] [--tz zone] [--customers] | blocked [--days N] [--org id] [--customers] | endings [--days N | --since ISO] [--org id,id] [--no-model] [--top N] [--write-cases [--dir evals/letterpress]] | unblock <org-id> <host> <subject> | decisions <org-id> [--site host] [--surface plan|fix|build|site] | undo <org-id> <host> <decision-id> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--no-change-code code] [--failure-kind network|provider|tool_denied|agent|unrecorded] [--pr merged|closed|open|none] [--harness h] [--days N] [--customers] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | ideas <org-id> [--site host] [--repo connected|none] | suggestions fix|idea [--day YYYY-MM-DD] [--type key [--org id]] [--customers] | suggestions flag fix|idea <type-key> [--org id --item item-id] [--note …] | suggestions clear <flag-id> | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
5397
5397
 
5398
5398
  /** One number of the settings from a dotted path and a value: the PUT body save_engine_settings reads. */
5399
5399
  function engineSettingsPatch(path, value) {
@@ -5,6 +5,7 @@
5
5
  // build <words…> → start_build (--prompt for a long ask; --again to repeat one)
6
6
  // build talk <words…> → send_build_message (--conversation <id> | --build <id> to continue)
7
7
  // build cancel <id> → cancel_growth_build (stop it before it merges: its PR is closed)
8
+ // build archive <id> → archive_growth_build (off the Open list; --restore brings it back)
8
9
  // build retry <id> → retry_growth_build (try again what failed, once what stopped it is fixed)
9
10
  // build benchmark <words…> → start_build_benchmark (staff only: Letterpress-1, stock Claude Code
10
11
  // and stock Codex on the same prompt, each a preview)
@@ -169,6 +170,11 @@ const ARGS = {
169
170
  },
170
171
  cancel_growth_build: { id: { positional: 0, required: true, label: "build-id" } },
171
172
  retry_growth_build: { id: { positional: 0, required: true, label: "build-id" } },
173
+ // --restore: back to the Open list.
174
+ archive_growth_build: {
175
+ id: { positional: 0, required: true, label: "build-id" },
176
+ archived: { value: (flags) => (flags.restore ? false : undefined) },
177
+ },
172
178
  start_build_benchmark: {
173
179
  prompt: { value: (flags, positionals) => flagStr(flags.prompt) ?? (positionals.join(" ").trim() || undefined) },
174
180
  domain: "site",
@@ -223,6 +229,9 @@ async function attachedFiles(ctx) {
223
229
  export async function cmdBuild(ctx) {
224
230
  if (ctx.positionals[0] === "talk") return buildTalk({ ...ctx, positionals: ctx.positionals.slice(1) });
225
231
  if (ctx.positionals[0] === "cancel") return buildCancel({ ...ctx, positionals: ctx.positionals.slice(1) });
232
+ // Only `archive <build-id>`: "archive old blog posts" is words to build from.
233
+ if (ctx.positionals[0] === "archive" && /^[0-9a-f-]{36}$/i.test(ctx.positionals[1] ?? ""))
234
+ return buildArchive({ ...ctx, positionals: ctx.positionals.slice(1) });
226
235
  if (ctx.positionals[0] === "retry") return buildRetry({ ...ctx, positionals: ctx.positionals.slice(1) });
227
236
  if (ctx.positionals[0] === "benchmark") return buildBenchmark({ ...ctx, positionals: ctx.positionals.slice(1) });
228
237
  if (ctx.positionals[0] === "benchmarks") return buildBenchmarks({ ...ctx, positionals: ctx.positionals.slice(1) });
@@ -260,6 +269,21 @@ async function buildCancel(ctx) {
260
269
  return 0;
261
270
  }
262
271
 
272
+ /** `build archive <id>`: move a build off the Open list, or back with --restore (archive_growth_build). */
273
+ async function buildArchive(ctx) {
274
+ const { client, flags, io } = ctx;
275
+ refuseUnknownFlags(ctx, {}, ["restore"]);
276
+ const args = argsFromFlags(ARGS.archive_growth_build, flags, ctx.positionals);
277
+ const result = await client.callTool("archive_growth_build", args);
278
+ printResult(
279
+ io,
280
+ flags,
281
+ result,
282
+ (r) => `${args.archived === false ? "Back on Open" : "Archived"}: ${r.build?.title ?? args.id}`
283
+ );
284
+ return 0;
285
+ }
286
+
263
287
  /** `build retry <id>`: try again what failed in a build (retry_growth_build). */
264
288
  async function buildRetry(ctx) {
265
289
  const { client, flags, io } = ctx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.171",
3
+ "version": "0.177.173",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",