@letterstory/cli 0.177.197 → 0.177.199
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 -1
- package/lib/commands/usage.mjs +1 -0
- package/lib/commands/visits.mjs +29 -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.199";
|
|
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;
|
|
@@ -104,6 +104,7 @@ export const EXIT_PAYMENT_REQUIRED = 3;
|
|
|
104
104
|
export const BOOLEAN_FLAGS = new Set([
|
|
105
105
|
"supporting",
|
|
106
106
|
"share-website",
|
|
107
|
+
"payments",
|
|
107
108
|
"connections-only",
|
|
108
109
|
"suggestions",
|
|
109
110
|
"background",
|
|
@@ -116,6 +117,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
116
117
|
// org overview: only what waits on someone (the More menu's closed read).
|
|
117
118
|
"needs-only",
|
|
118
119
|
"include-tests",
|
|
120
|
+
// visits agent-sites: test orgs too.
|
|
121
|
+
"include-test",
|
|
119
122
|
// visits transact asks --before: page the team's tests instead of agents' asks.
|
|
120
123
|
"tests",
|
|
121
124
|
"as-test",
|
|
@@ -2156,6 +2159,7 @@ Visits (Visitors: AI agents reading your site, and AI answers sending people to
|
|
|
2156
2159
|
visits pages [--since 28d] [--path '/docs/*'] [--agent <id>] [--limit <n>] [--site <id>]
|
|
2157
2160
|
People and AI agents per page
|
|
2158
2161
|
visits health --site <id> Staff: how far to trust a site's numbers, each check and its fix
|
|
2162
|
+
visits agent-sites [--include-test] Staff: every agent site by stage, waiting on a person first
|
|
2159
2163
|
visits connect vercel|cloudflare [--site <id>] Send the host's request logs (no code to deploy)
|
|
2160
2164
|
visits connectors | disconnect <id> The site's host connectors
|
|
2161
2165
|
visits transact [--site <id>|--host <h>] Transact: cited public corpus answers with website fallback
|
package/lib/commands/usage.mjs
CHANGED
|
@@ -86,6 +86,7 @@ export const ARGS = {
|
|
|
86
86
|
},
|
|
87
87
|
fresh: { flag: "fresh", type: "bool" },
|
|
88
88
|
choice_id: { flag: "choice" },
|
|
89
|
+
payments: { flag: "payments", type: "bool" },
|
|
89
90
|
days: { flag: "days", type: "num" },
|
|
90
91
|
site_id: { flag: "site" },
|
|
91
92
|
prompt: { positional: 0, required: true, label: "prompt" },
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
// letterstory visits domain composal.com [--site <id>] move the site to a new domain, keeping its key
|
|
20
20
|
// letterstory visits pages --since 28d [--path '/docs/*'] [--agent openai-crawler]
|
|
21
21
|
// letterstory visits health --site <id> staff: how far to trust a site's numbers, and what to fix
|
|
22
|
+
// letterstory visits agent-sites [--include-test] staff: every agent site by stage, waiting on a person first
|
|
22
23
|
// letterstory visits connect vercel|cloudflare send the host's request logs (no code to deploy)
|
|
23
24
|
// letterstory visits connectors | disconnect <id>
|
|
24
25
|
// letterstory visits shortcut [mod+e | default] your own key for Letter Edit's card (⌘L by default)
|
|
@@ -121,6 +122,9 @@ export const ARGS = {
|
|
|
121
122
|
days,
|
|
122
123
|
},
|
|
123
124
|
visitors_admin_coverage: { site_id: "site" },
|
|
125
|
+
visitors_admin_agent_sites: {
|
|
126
|
+
include_test: { value: (flags) => (flagBool(flags["include-test"]) ? true : undefined) },
|
|
127
|
+
},
|
|
124
128
|
visitors_add_connector: {
|
|
125
129
|
site_id: "site",
|
|
126
130
|
kind: { positional: 0, label: "host (vercel | cloudflare)", required: true, enum: ["vercel", "cloudflare"] },
|
|
@@ -329,6 +333,8 @@ export async function cmdVisits(ctx) {
|
|
|
329
333
|
return visitsPages(rest);
|
|
330
334
|
case "health":
|
|
331
335
|
return visitsHealth(rest);
|
|
336
|
+
case "agent-sites":
|
|
337
|
+
return visitsAgentSites(rest);
|
|
332
338
|
case "connect":
|
|
333
339
|
return visitsConnect(rest);
|
|
334
340
|
case "connectors":
|
|
@@ -341,7 +347,7 @@ export async function cmdVisits(ctx) {
|
|
|
341
347
|
return visitsTransact(rest);
|
|
342
348
|
default:
|
|
343
349
|
throw new CliError(
|
|
344
|
-
"Usage: visits [list|requests|citations|people|who|path|compare|export|sites|domain|pages|health|connect|connectors|disconnect|shortcut|transact]"
|
|
350
|
+
"Usage: visits [list|requests|citations|people|who|path|compare|export|sites|domain|pages|health|agent-sites|connect|connectors|disconnect|shortcut|transact]"
|
|
345
351
|
);
|
|
346
352
|
}
|
|
347
353
|
}
|
|
@@ -365,6 +371,28 @@ function floorLines(floors) {
|
|
|
365
371
|
];
|
|
366
372
|
}
|
|
367
373
|
|
|
374
|
+
/** What each stage is called on /superadmin/agent-sites. */
|
|
375
|
+
const AGENT_SITE_STAGE_WORDS = { live: "live, not linked", address: "address set", built: "built", linked: "linked" };
|
|
376
|
+
|
|
377
|
+
/** `visits agent-sites` (staff): every agent site by stage, waiting on a person first. */
|
|
378
|
+
async function visitsAgentSites(ctx) {
|
|
379
|
+
const { flags, io } = ctx;
|
|
380
|
+
const result = await call(ctx, "visitors_admin_agent_sites");
|
|
381
|
+
printResult(io, flags, result, (r) => {
|
|
382
|
+
const c = r.counts ?? {};
|
|
383
|
+
const lines = [
|
|
384
|
+
`${c.live ?? 0} live, not linked · ${c.address ?? 0} address set · ${c.built ?? 0} built · ${c.linked ?? 0} linked`,
|
|
385
|
+
"",
|
|
386
|
+
];
|
|
387
|
+
for (const s of (r.sites ?? []).filter((x) => x.stage !== "built"))
|
|
388
|
+
lines.push(
|
|
389
|
+
` ${(AGENT_SITE_STAGE_WORDS[s.stage] ?? s.stage).padEnd(17)} ${s.org_name ?? s.org_id} ${s.address ?? ""}${s.since ? ` (since ${s.since.slice(0, 10)})` : ""}`
|
|
390
|
+
);
|
|
391
|
+
return lines.join("\n");
|
|
392
|
+
});
|
|
393
|
+
return 0;
|
|
394
|
+
}
|
|
395
|
+
|
|
368
396
|
async function visitsHealth(ctx) {
|
|
369
397
|
const { flags, io } = ctx;
|
|
370
398
|
if (!ctx.flags.site) throw new CliError("Usage: visits health --site <site id> (staff only)");
|