@letterstory/cli 0.177.206 → 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 +5 -2
- package/lib/commands/build.mjs +31 -2
- package/lib/commands/outbound.mjs +8 -1
- 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.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>] [--
|
|
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
|
package/lib/commands/build.mjs
CHANGED
|
@@ -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: {
|
|
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,
|
|
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;
|
|
@@ -173,6 +173,10 @@ export const ARGS = {
|
|
|
173
173
|
get_sequence: {
|
|
174
174
|
sequence_id: { positional: 0, label: "sequence-id", required: true },
|
|
175
175
|
},
|
|
176
|
+
duplicate_sequence: {
|
|
177
|
+
sequence_id: { positional: 0, label: "sequence-id", required: true },
|
|
178
|
+
name: { flag: "name" },
|
|
179
|
+
},
|
|
176
180
|
create_sequence: {
|
|
177
181
|
name: { flag: "name", required: true },
|
|
178
182
|
flow: {
|
|
@@ -543,7 +547,7 @@ function deleteDispatchLine(result) {
|
|
|
543
547
|
return `Dispatch deleted; ${n(moved)} moved${moved > 0 ? ` to ${result.moved_to}` : ""}.`;
|
|
544
548
|
}
|
|
545
549
|
|
|
546
|
-
const SEQUENCES_USAGE = `Usage: sequences <list|get|create|update|pause|resume|enroll|stop|review|links|cakes|heyreach>`;
|
|
550
|
+
const SEQUENCES_USAGE = `Usage: sequences <list|get|create|duplicate|update|pause|resume|enroll|stop|review|links|cakes|heyreach>`;
|
|
547
551
|
const DISPATCHES_USAGE = `Usage: dispatches <list|create|rename|delete>`;
|
|
548
552
|
|
|
549
553
|
// Dispatches: the named review desks a sequence's review stage queues to.
|
|
@@ -593,6 +597,9 @@ export async function cmdSequences(ctx) {
|
|
|
593
597
|
case "create":
|
|
594
598
|
case "new":
|
|
595
599
|
return run(rest, "create_sequence", "Created sequence (a draft: set --status active to send).");
|
|
600
|
+
case "duplicate":
|
|
601
|
+
case "copy":
|
|
602
|
+
return run(rest, "duplicate_sequence", "Copied as a draft.");
|
|
596
603
|
case "update":
|
|
597
604
|
return run(rest, "update_sequence", "Updated sequence.");
|
|
598
605
|
case "pause":
|