@letterstory/cli 0.158.2 → 0.158.4
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/README.md +1 -1
- package/lib/cli.mjs +6 -3
- package/lib/commands/build.mjs +12 -1
- package/lib/commands/repo.mjs +1 -1
- package/lib/commands/visits.mjs +69 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -879,7 +879,7 @@ letterstory mailers domain <owned-domain-id> # provisioning stag
|
|
|
879
879
|
letterstory mailers messages <mailer-id> [--folder inbox|sent|all] [--limit 25] # envelopes
|
|
880
880
|
letterstory mailers message <mailer-id> <uid> --folder inbox # one message, plain-text body
|
|
881
881
|
letterstory mailers forward <mailer-id> --to me@acme.com # or --clear
|
|
882
|
-
letterstory mailers warmup start|pause <mailer-id> #
|
|
882
|
+
letterstory mailers warmup start|pause <mailer-id> # 14+ days; ready once the warmup score reaches 85
|
|
883
883
|
letterstory mailers limit <mailer-id> 40 # 0..500; refused while warming
|
|
884
884
|
letterstory mailers retire <mailer-id> # disable; history kept
|
|
885
885
|
letterstory mailers retire <mailer-id> --release-mailbox --yes # also delete the hosted mailbox (irreversible)
|
package/lib/cli.mjs
CHANGED
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
|
|
67
67
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
68
68
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
69
|
-
export const VERSION = "0.158.
|
|
69
|
+
export const VERSION = "0.158.4";
|
|
70
70
|
|
|
71
71
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
72
72
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
|
@@ -1401,7 +1401,7 @@ Mailers (the sending mailboxes):
|
|
|
1401
1401
|
mailers message <mailer-id> <uid> --folder inbox|sent
|
|
1402
1402
|
One message in full (plain-text body)
|
|
1403
1403
|
mailers forward <mailer-id> (--to <email> | --clear) Copy inbound mail to an address
|
|
1404
|
-
mailers warmup start|pause <mailer-id> Start / pause warming (
|
|
1404
|
+
mailers warmup start|pause <mailer-id> Start / pause warming (14+ days; ready at score 85)
|
|
1405
1405
|
mailers limit <mailer-id> <per-day> Daily send limit, 0..500 (not while warming)
|
|
1406
1406
|
mailers retire <mailer-id> [--release-mailbox --yes] Disable a mailer; --release-mailbox also deletes
|
|
1407
1407
|
the hosted mailbox (stops billing, irreversible)
|
|
@@ -1448,6 +1448,7 @@ Build (a change to your site, or launching what isn't code; the Build box's own
|
|
|
1448
1448
|
done by Build itself (a phantom site buys its own domain), and the
|
|
1449
1449
|
build reads Done with no PR to merge. --again repeats an open build's ask
|
|
1450
1450
|
build talk <words…> [--conversation <id>|--build <id>] [--site <host>] [--harness claude-code|letterpress-1]
|
|
1451
|
+
[--repo owner/name]
|
|
1451
1452
|
One turn of a conversation with Build (questions, follow-ups on a build)
|
|
1452
1453
|
|
|
1453
1454
|
The Site (one model of your whole marketing site, keyed by host and path):
|
|
@@ -1516,7 +1517,7 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
|
|
|
1516
1517
|
One PR adding Letterprove's script and identify calls
|
|
1517
1518
|
(pick the repo where users sign in)
|
|
1518
1519
|
repo install-visitors [--site <id>] [--repo <owner/name>] [--branch <base>] [--action build|build_pr|build_merge|slack|linear] [--wait]
|
|
1519
|
-
One PR adding the Visitors script tag to the repo that
|
|
1520
|
+
One PR adding the Visitors script tag and server snippet to the repo that
|
|
1520
1521
|
builds the site (--repo: another repo)
|
|
1521
1522
|
repo sites [--detect [--force]] Which website each repo builds, and the evidence
|
|
1522
1523
|
repo set-site --repo <owner/name> --site <host> [--not] [--branch <name>|none]
|
|
@@ -1556,6 +1557,8 @@ Visits (Visitors: AI agents reading your site, and AI answers sending people to
|
|
|
1556
1557
|
visits pages [--since 28d] [--path '/docs/*'] [--agent <id>] [--limit <n>] [--site <id>]
|
|
1557
1558
|
People and AI agents per page
|
|
1558
1559
|
visits health --site <id> Staff: how far to trust a site's numbers, each check and its fix
|
|
1560
|
+
visits connect vercel|cloudflare [--site <id>] Send the host's request logs (no code to deploy)
|
|
1561
|
+
visits connectors | disconnect <id> The site's host connectors
|
|
1559
1562
|
|
|
1560
1563
|
Sim (Simulations: a free, simulated copy of your API for agents, and what they did with it):
|
|
1561
1564
|
sim [list] Your simulations and their URLs
|
package/lib/commands/build.mjs
CHANGED
|
@@ -34,6 +34,8 @@ const ARGS = {
|
|
|
34
34
|
subjects: { flag: "subject", type: "list" },
|
|
35
35
|
files: { value: (_flags, _positionals, extra) => (extra.files?.length ? extra.files : undefined) },
|
|
36
36
|
harness: { flag: "harness", enum: ["claude-code", "letterpress-1"] },
|
|
37
|
+
// --repo owner/name: the repo you're working in, where a Proofs install goes.
|
|
38
|
+
repo: "repo",
|
|
37
39
|
},
|
|
38
40
|
};
|
|
39
41
|
|
|
@@ -83,7 +85,16 @@ async function buildStart(ctx) {
|
|
|
83
85
|
|
|
84
86
|
async function buildTalk(ctx) {
|
|
85
87
|
const { client, flags, io } = ctx;
|
|
86
|
-
refuseUnknownFlags(ctx, {}, [
|
|
88
|
+
refuseUnknownFlags(ctx, {}, [
|
|
89
|
+
"message",
|
|
90
|
+
"conversation",
|
|
91
|
+
"build",
|
|
92
|
+
"site",
|
|
93
|
+
"subject",
|
|
94
|
+
"harness",
|
|
95
|
+
"repo",
|
|
96
|
+
...FILE_FLAGS,
|
|
97
|
+
]);
|
|
87
98
|
const files = await attachedFiles(ctx);
|
|
88
99
|
const args = argsFromFlags(ARGS.send_build_message, flags, ctx.positionals, { files });
|
|
89
100
|
if (!args.message) throw new CliError('Say something: letterstory build talk "make the hero darker"');
|
package/lib/commands/repo.mjs
CHANGED
|
@@ -513,7 +513,7 @@ async function repoInstallLetterprove(ctx) {
|
|
|
513
513
|
return followRun(ctx, result.run);
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
-
/** `repo install-visitors [--site id] [--repo owner/name] [--branch b] [--wait]`: the Visitors script tag → one PR. */
|
|
516
|
+
/** `repo install-visitors [--site id] [--repo owner/name] [--branch b] [--wait]`: the Visitors script tag and server snippet → one PR. */
|
|
517
517
|
async function repoInstallVisitors(ctx) {
|
|
518
518
|
const { client, flags, io } = ctx;
|
|
519
519
|
refuseUnknownFlags(ctx, {}, ["site", "repo", "owner", "name", "branch", "action", "wait"]);
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
// letterstory visits sites
|
|
13
13
|
// letterstory visits pages --since 28d [--path '/docs/*'] [--agent openai-crawler]
|
|
14
14
|
// letterstory visits health --site <id> staff: how far to trust a site's numbers, and what to fix
|
|
15
|
+
// letterstory visits connect vercel|cloudflare send the host's request logs (no code to deploy)
|
|
16
|
+
// letterstory visits connectors | disconnect <id>
|
|
15
17
|
|
|
16
18
|
import { CliError } from "../client.mjs";
|
|
17
19
|
import { flagStr, printResult, argsFromFlags } from "./shared.mjs";
|
|
@@ -34,6 +36,15 @@ export const ARGS = {
|
|
|
34
36
|
},
|
|
35
37
|
visitors_get_citations: { site_id: "site", days },
|
|
36
38
|
visitors_admin_coverage: { site_id: "site" },
|
|
39
|
+
visitors_add_connector: {
|
|
40
|
+
site_id: "site",
|
|
41
|
+
kind: { positional: 0, label: "host (vercel | cloudflare)", required: true, enum: ["vercel", "cloudflare"] },
|
|
42
|
+
},
|
|
43
|
+
visitors_list_connectors: { site_id: "site" },
|
|
44
|
+
visitors_remove_connector: {
|
|
45
|
+
site_id: "site",
|
|
46
|
+
connector_id: { positional: 0, label: "connector id", required: true },
|
|
47
|
+
},
|
|
37
48
|
visitors_get_page_traffic: {
|
|
38
49
|
site_id: "site",
|
|
39
50
|
days,
|
|
@@ -88,8 +99,16 @@ export async function cmdVisits(ctx) {
|
|
|
88
99
|
return visitsPages(rest);
|
|
89
100
|
case "health":
|
|
90
101
|
return visitsHealth(rest);
|
|
102
|
+
case "connect":
|
|
103
|
+
return visitsConnect(rest);
|
|
104
|
+
case "connectors":
|
|
105
|
+
return visitsConnectors(rest);
|
|
106
|
+
case "disconnect":
|
|
107
|
+
return visitsDisconnect(rest);
|
|
91
108
|
default:
|
|
92
|
-
throw new CliError(
|
|
109
|
+
throw new CliError(
|
|
110
|
+
"Usage: visits [list|citations|compare|export|sites|pages|health|connect|connectors|disconnect]"
|
|
111
|
+
);
|
|
93
112
|
}
|
|
94
113
|
}
|
|
95
114
|
|
|
@@ -140,6 +159,42 @@ async function visitsHealth(ctx) {
|
|
|
140
159
|
return 0;
|
|
141
160
|
}
|
|
142
161
|
|
|
162
|
+
function connectorLines(c) {
|
|
163
|
+
const status = c.last_received_at ? `delivering, last ${c.last_received_at}` : "waiting for the first delivery";
|
|
164
|
+
return [
|
|
165
|
+
`${c.kind} (${c.id}): ${status}${c.received_count ? `, ${c.received_count} requests` : ""}`,
|
|
166
|
+
...(c.last_error ? [` last error: ${c.last_error}`] : []),
|
|
167
|
+
...c.steps.map((step, i) => ` ${i + 1}. ${step}`),
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
async function visitsConnect(ctx) {
|
|
172
|
+
const { flags, io } = ctx;
|
|
173
|
+
const result = await call(ctx, "visitors_add_connector");
|
|
174
|
+
printResult(io, flags, result, (c) => connectorLines(c).join("\n"));
|
|
175
|
+
return 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
async function visitsConnectors(ctx) {
|
|
179
|
+
const { flags, io } = ctx;
|
|
180
|
+
const result = await call(ctx, "visitors_list_connectors");
|
|
181
|
+
printResult(io, flags, result, (r) =>
|
|
182
|
+
r.connectors?.length
|
|
183
|
+
? r.connectors.flatMap((c) => [...connectorLines(c), ""]).join("\n")
|
|
184
|
+
: "No host connectors. Add one: visits connect vercel|cloudflare"
|
|
185
|
+
);
|
|
186
|
+
return 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async function visitsDisconnect(ctx) {
|
|
190
|
+
const { flags, io } = ctx;
|
|
191
|
+
const result = await call(ctx, "visitors_remove_connector");
|
|
192
|
+
printResult(io, flags, result, (r) =>
|
|
193
|
+
r.removed ? "Disconnected. Remove the drain or Logpush job in the host too." : "No such connector."
|
|
194
|
+
);
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
143
198
|
const PURPOSE_LABELS = {
|
|
144
199
|
live: "answering a user",
|
|
145
200
|
index: "search index",
|
|
@@ -173,6 +228,19 @@ async function visitsList(ctx) {
|
|
|
173
228
|
lines.push("", "Most read:");
|
|
174
229
|
for (const p of r.top_paths.slice(0, 10)) lines.push(` ${String(p.total).padStart(6)} ${p.path}`);
|
|
175
230
|
}
|
|
231
|
+
const sv = r.served;
|
|
232
|
+
if (sv?.total) {
|
|
233
|
+
const known = sv.formats.markdown + sv.formats.html + sv.formats.other;
|
|
234
|
+
lines.push(
|
|
235
|
+
"",
|
|
236
|
+
`Served: ${sv.formats.markdown} markdown, ${sv.formats.html} HTML${sv.formats.other ? `, ${sv.formats.other} other` : ""}${sv.formats.unknown ? `, ${sv.formats.unknown} unknown` : ""}${sv.outcomes.blocked ? ` · ${sv.outcomes.blocked} blocked` : ""}`
|
|
237
|
+
);
|
|
238
|
+
if (known)
|
|
239
|
+
for (const a of sv.agents.slice(0, 8))
|
|
240
|
+
lines.push(
|
|
241
|
+
` ${a.agent.padEnd(22)} ${String(a.markdown).padStart(6)} md ${String(a.html).padStart(6)} html`
|
|
242
|
+
);
|
|
243
|
+
}
|
|
176
244
|
if (!r.total) lines.push("No agent visits in this window. Is the server snippet installed? (visits sites)");
|
|
177
245
|
lines.push(...floorLines(r.floors));
|
|
178
246
|
return lines.join("\n");
|