@letterstory/cli 0.177.148 → 0.177.150
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 +4 -2
- package/lib/commands/build.mjs +20 -0
- package/lib/commands/visits.mjs +13 -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.150";
|
|
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;
|
|
@@ -102,6 +102,7 @@ export const EXIT_PAYMENT_REQUIRED = 3;
|
|
|
102
102
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
|
103
103
|
// `negate` spelling) in a command's ARGS map must be listed; boolean-flags.test.ts enforces it.
|
|
104
104
|
export const BOOLEAN_FLAGS = new Set([
|
|
105
|
+
"discover",
|
|
105
106
|
// visits transact add folder|page|connection: leave it out of the set (a connection: switch it off).
|
|
106
107
|
"uncheck",
|
|
107
108
|
"clear-choice",
|
|
@@ -1979,6 +1980,7 @@ Build (a change to your site, or launching what isn't code; the Build box's own
|
|
|
1979
1980
|
One turn of a conversation with Build (questions, follow-ups on a build)
|
|
1980
1981
|
build cancel <build-id> Stop a build before it merges: what's being built stops, its
|
|
1981
1982
|
preview goes, and its open pull request is closed unmerged
|
|
1983
|
+
build retry <build-id> Try again what failed in a build, once what stopped it is fixed
|
|
1982
1984
|
build benchmark <words…> [--prompt <text>] [--site <host>] [--agent letterpress-1|claude-code|codex]...
|
|
1983
1985
|
[--attach <path>]... [--attach-url <name>=<https url>]... [--attach-ref <path>]... [--attach-url-ref <name>=<https url>]...
|
|
1984
1986
|
Staff only. The same prompt on Letterpress-1 (as Build runs it) and on
|
|
@@ -2134,7 +2136,7 @@ Visits (Visitors: AI agents reading your site, and AI answers sending people to
|
|
|
2134
2136
|
Look into your product's code, events or database when the pages don't answer
|
|
2135
2137
|
visits transact pr [--repo owner/name] [--base <branch>] [--site <id>|--host <h>]
|
|
2136
2138
|
One pull request: the line for agents, and answers to what they asked
|
|
2137
|
-
visits transact source <source-id>|--folder <path> | remove <id> | test "<question>"
|
|
2139
|
+
visits transact source <source-id>|--folder <path> | remove <id> | tests | test "<question>" [--discover]
|
|
2138
2140
|
visits transact asks [--since 7d] [--limit <n>] What agents asked, answered, and asks per agent visit
|
|
2139
2141
|
|
|
2140
2142
|
Sim (Simulations: a free, simulated copy of your API for agents, and what they did with it):
|
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 retry <id> → retry_growth_build (try again what failed, once what stopped it is fixed)
|
|
8
9
|
// build benchmark <words…> → start_build_benchmark (staff only: Letterpress-1, stock Claude Code
|
|
9
10
|
// and stock Codex on the same prompt, each a preview)
|
|
10
11
|
// build benchmarks → list_build_benchmarks (staff only; --id <uuid> for one)
|
|
@@ -167,6 +168,7 @@ const ARGS = {
|
|
|
167
168
|
intent: { flag: "intent", enum: ["build"] },
|
|
168
169
|
},
|
|
169
170
|
cancel_growth_build: { id: { positional: 0, required: true, label: "build-id" } },
|
|
171
|
+
retry_growth_build: { id: { positional: 0, required: true, label: "build-id" } },
|
|
170
172
|
start_build_benchmark: {
|
|
171
173
|
prompt: { value: (flags, positionals) => flagStr(flags.prompt) ?? (positionals.join(" ").trim() || undefined) },
|
|
172
174
|
domain: "site",
|
|
@@ -221,6 +223,7 @@ async function attachedFiles(ctx) {
|
|
|
221
223
|
export async function cmdBuild(ctx) {
|
|
222
224
|
if (ctx.positionals[0] === "talk") return buildTalk({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
223
225
|
if (ctx.positionals[0] === "cancel") return buildCancel({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
226
|
+
if (ctx.positionals[0] === "retry") return buildRetry({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
224
227
|
if (ctx.positionals[0] === "benchmark") return buildBenchmark({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
225
228
|
if (ctx.positionals[0] === "benchmarks") return buildBenchmarks({ ...ctx, positionals: ctx.positionals.slice(1) });
|
|
226
229
|
const read = readCommand(ctx.positionals);
|
|
@@ -257,6 +260,23 @@ async function buildCancel(ctx) {
|
|
|
257
260
|
return 0;
|
|
258
261
|
}
|
|
259
262
|
|
|
263
|
+
/** `build retry <id>`: try again what failed in a build (retry_growth_build). */
|
|
264
|
+
async function buildRetry(ctx) {
|
|
265
|
+
const { client, flags, io } = ctx;
|
|
266
|
+
refuseUnknownFlags(ctx, {}, []);
|
|
267
|
+
const args = argsFromFlags(ARGS.retry_growth_build, flags, ctx.positionals);
|
|
268
|
+
const result = await client.callTool("retry_growth_build", args);
|
|
269
|
+
printResult(io, flags, result, (r) =>
|
|
270
|
+
[
|
|
271
|
+
r.message,
|
|
272
|
+
...(r.retried ?? []).map(
|
|
273
|
+
(s) => ` ${s.ok ? "started" : "not started"} ${s.title}${s.message ? `: ${s.message}` : ""}`
|
|
274
|
+
),
|
|
275
|
+
].join("\n")
|
|
276
|
+
);
|
|
277
|
+
return 0;
|
|
278
|
+
}
|
|
279
|
+
|
|
260
280
|
async function buildBenchmark(ctx) {
|
|
261
281
|
const { client, flags, io } = ctx;
|
|
262
282
|
refuseUnknownFlags(ctx, {}, ["prompt", "site", "agent", ...FILE_FLAGS]);
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -156,7 +156,9 @@ export const ARGS = {
|
|
|
156
156
|
folder: "folder",
|
|
157
157
|
limit: { flag: "limit", type: "num" },
|
|
158
158
|
},
|
|
159
|
+
visitors_list_transact_tests: { site_id: "site" },
|
|
159
160
|
visitors_test_transact: {
|
|
161
|
+
discovery: { flag: "discover", type: "bool" },
|
|
160
162
|
site_id: "site",
|
|
161
163
|
question: { positional: 0, label: "question", required: true },
|
|
162
164
|
},
|
|
@@ -382,11 +384,22 @@ async function visitsTransact(ctx) {
|
|
|
382
384
|
printResult(io, flags, result, () => "Removed");
|
|
383
385
|
return 0;
|
|
384
386
|
}
|
|
387
|
+
if (sub === "tests") {
|
|
388
|
+
printResult(io, flags, await call(rest, "visitors_list_transact_tests"));
|
|
389
|
+
return 0;
|
|
390
|
+
}
|
|
385
391
|
if (sub === "test") {
|
|
386
392
|
const result = await call(rest, "visitors_test_transact");
|
|
387
393
|
printResult(io, flags, result, (r) =>
|
|
388
394
|
[
|
|
389
395
|
r.answer,
|
|
396
|
+
...(r.discovery
|
|
397
|
+
? [
|
|
398
|
+
`Agent answer: ${r.discovery.answer}`,
|
|
399
|
+
`Transact: ${r.discovery.transact}`,
|
|
400
|
+
...r.discovery.sources.map((s) => ` ${s.via}: ${s.url}`),
|
|
401
|
+
]
|
|
402
|
+
: []),
|
|
390
403
|
...r.citations.map((c) => ` [${c.n}] ${c.title}${c.url ? ` ${c.url}` : ""}: "${c.quote}"`),
|
|
391
404
|
].join("\n")
|
|
392
405
|
);
|