@letterstory/cli 0.177.167 → 0.177.169
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 +2 -2
- package/lib/commands/site.mjs +2 -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.169";
|
|
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;
|
|
@@ -2016,7 +2016,7 @@ The Site (one model of your whole marketing site, keyed by host and path):
|
|
|
2016
2016
|
site refresh <host> [--force-map] [--force-audit] [--skip-observe] [--skip-suggest]
|
|
2017
2017
|
Run the daily loop now: re-map, re-audit, signals, Jev
|
|
2018
2018
|
site unmap <host> Remove a host and everything hanging off it
|
|
2019
|
-
site tree <host> [path] [--depth <n>] [--unfold] [--since <iso>]
|
|
2019
|
+
site tree <host> [path] [--depth <n>] [--unfold] [--since <iso>] [--filter <words>]
|
|
2020
2020
|
The tree one folder at a time; --since adds +N/-N per folder
|
|
2021
2021
|
site page <host> <path> One page: facts, bindings, raw URLs, open items
|
|
2022
2022
|
site observations <host> [path] [--state open|dismissed|resolved] [--tone risk|warn|info] [--key <k>] [--since <iso>] [--min-reach <0..1>] [--keys]
|
package/lib/commands/site.mjs
CHANGED
|
@@ -90,6 +90,8 @@ const ARGS = {
|
|
|
90
90
|
unfold: { flag: "unfold", type: "bool" },
|
|
91
91
|
subtree: { flag: "subtree", type: "bool" },
|
|
92
92
|
since: { flag: "since" },
|
|
93
|
+
// The Site's search over the whole map: matches and the folders above them.
|
|
94
|
+
filter: { flag: "filter" },
|
|
93
95
|
// The ranking's top n, or "all", instead of the attention policy's short list.
|
|
94
96
|
focus_size: {
|
|
95
97
|
value: (flags) => {
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
// letterstory visits transact test "What does it cost?"
|
|
33
33
|
// letterstory visits transact asks [--since 7d] [--limit 50]
|
|
34
34
|
// letterstory visits transact learnings [--since 7d]
|
|
35
|
+
// letterstory visits transact site [publish|unpublish] [--domain ask.acme.com | --domain none] the agent-optimized site
|
|
35
36
|
|
|
36
37
|
import { CliError } from "../client.mjs";
|
|
37
38
|
import { flagStr, printResult, argsFromFlags } from "./shared.mjs";
|
|
@@ -193,6 +194,15 @@ export const ARGS = {
|
|
|
193
194
|
},
|
|
194
195
|
visitors_list_transact_asks: { site_id: "site", days, limit: { flag: "limit", type: "num" } },
|
|
195
196
|
visitors_get_transact_learnings: { site_id: "site", days },
|
|
197
|
+
visitors_get_agent_site: { site_id: "site" },
|
|
198
|
+
visitors_set_agent_site: {
|
|
199
|
+
site_id: "site",
|
|
200
|
+
publish: { value: (flags, positionals) => ({ publish: true, unpublish: false })[positionals[0]] },
|
|
201
|
+
domain: {
|
|
202
|
+
value: (flags) =>
|
|
203
|
+
typeof flags.domain !== "string" ? undefined : flags.domain === "none" ? null : flags.domain,
|
|
204
|
+
},
|
|
205
|
+
},
|
|
196
206
|
visitors_export: {
|
|
197
207
|
site_id: "site",
|
|
198
208
|
days,
|
|
@@ -367,7 +377,7 @@ function transactLines(t) {
|
|
|
367
377
|
return lines;
|
|
368
378
|
}
|
|
369
379
|
|
|
370
|
-
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `search "…"`; `remove <id>`; `test "…"`; `pr`; `asks`; `learnings`. */
|
|
380
|
+
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `search "…"`; `remove <id>`; `test "…"`; `pr`; `asks`; `learnings`; `site`. */
|
|
371
381
|
async function visitsTransact(ctx) {
|
|
372
382
|
const { flags, io } = ctx;
|
|
373
383
|
const sub = ctx.positionals[0];
|
|
@@ -441,6 +451,24 @@ async function visitsTransact(ctx) {
|
|
|
441
451
|
printResult(io, flags, await call(rest, "visitors_open_transact_pr"));
|
|
442
452
|
return 0;
|
|
443
453
|
}
|
|
454
|
+
if (sub === "site") {
|
|
455
|
+
const write =
|
|
456
|
+
rest.positionals[0] === "publish" || rest.positionals[0] === "unpublish" || flags.domain !== undefined;
|
|
457
|
+
const result = await call(rest, write ? "visitors_set_agent_site" : "visitors_get_agent_site");
|
|
458
|
+
printResult(io, flags, result, (r) => {
|
|
459
|
+
if (!r.available) return "Agent-optimized Sites aren't available yet";
|
|
460
|
+
if (!r.published) return "Not published";
|
|
461
|
+
const lines = [`Staging: ${r.staging_url}`];
|
|
462
|
+
if (r.domain) {
|
|
463
|
+
lines.push(`Domain: ${r.domain.name} (${r.domain.status})`);
|
|
464
|
+
if (r.domain.status === "pending")
|
|
465
|
+
for (const rec of r.domain.records) lines.push(` ${rec.type} ${rec.name} ${rec.value}`);
|
|
466
|
+
}
|
|
467
|
+
lines.push(`${r.questions.length} questions`, ...r.questions.map((q) => ` ${q.question} ${q.url}`));
|
|
468
|
+
return lines.join("\n");
|
|
469
|
+
});
|
|
470
|
+
return 0;
|
|
471
|
+
}
|
|
444
472
|
if (sub === "learnings") {
|
|
445
473
|
const result = await call(rest, "visitors_get_transact_learnings");
|
|
446
474
|
printResult(
|