@letterstory/cli 0.177.172 → 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 +1 -1
- package/lib/commands/build.mjs +24 -0
- package/package.json +1 -1
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.
|
|
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;
|
package/lib/commands/build.mjs
CHANGED
|
@@ -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;
|