@letterstory/cli 0.177.178 → 0.177.179
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 +1 -1
- package/lib/commands/visits.mjs +11 -2
- 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.179";
|
|
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;
|
package/lib/commands/visits.mjs
CHANGED
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
// letterstory visits transact search "sso" the knowledge base and the site's pages, as an ask searches them
|
|
30
30
|
// letterstory visits transact remove <source-id>
|
|
31
31
|
// letterstory visits transact test "What does it cost?"
|
|
32
|
+
// letterstory visits transact prebuild <site-id>... [--dry-run] staff: build customers' agent sites, Letter paying
|
|
32
33
|
// letterstory visits transact asks [--since 7d] [--limit 50]
|
|
33
34
|
// letterstory visits transact learnings [--since 7d]
|
|
34
35
|
// letterstory visits transact site [publish|unpublish] [--domain ask.acme.com | --domain none] [--remove <slug>] the Agent Site tab
|
|
35
36
|
|
|
36
37
|
import { CliError } from "../client.mjs";
|
|
37
|
-
import { flagStr, printResult, argsFromFlags } from "./shared.mjs";
|
|
38
|
+
import { flagBool, flagStr, printResult, argsFromFlags } from "./shared.mjs";
|
|
38
39
|
|
|
39
40
|
const PURPOSES = ["live", "index", "training", "automated_browser", "unknown"];
|
|
40
41
|
const PATH_KINDS = ["page", "agent_file", "site_file", "asset"];
|
|
@@ -187,6 +188,10 @@ export const ARGS = {
|
|
|
187
188
|
visitors_list_transact_asks: { site_id: "site", host: "host", days, limit: { flag: "limit", type: "num" } },
|
|
188
189
|
visitors_get_transact_learnings: { site_id: "site", host: "host", days },
|
|
189
190
|
visitors_get_agent_site: { site_id: "site", host: "host" },
|
|
191
|
+
visitors_prebuild_agent_sites: {
|
|
192
|
+
site_ids: { value: (flags, positionals) => (positionals.length ? positionals : undefined) },
|
|
193
|
+
dry_run: { value: (flags) => (flagBool(flags["dry-run"]) ? true : undefined) },
|
|
194
|
+
},
|
|
190
195
|
visitors_set_agent_site: {
|
|
191
196
|
site_id: "site",
|
|
192
197
|
publish: { value: (flags, positionals) => ({ publish: true, unpublish: false })[positionals[0]] },
|
|
@@ -370,7 +375,7 @@ function transactLines(t) {
|
|
|
370
375
|
return lines;
|
|
371
376
|
}
|
|
372
377
|
|
|
373
|
-
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `search "…"`; `remove <id>`; `test "…"`; `asks`; `learnings`; `site`. */
|
|
378
|
+
/** `visits transact`: read it; `on` / `off`; `add <kind> …`; `source <id>`; `search "…"`; `remove <id>`; `test "…"`; `prebuild <site ids>` (staff); `asks`; `learnings`; `site`. */
|
|
374
379
|
async function visitsTransact(ctx) {
|
|
375
380
|
const { flags, io } = ctx;
|
|
376
381
|
const sub = ctx.positionals[0];
|
|
@@ -440,6 +445,10 @@ async function visitsTransact(ctx) {
|
|
|
440
445
|
);
|
|
441
446
|
return 0;
|
|
442
447
|
}
|
|
448
|
+
if (sub === "prebuild") {
|
|
449
|
+
printResult(io, flags, await call(rest, "visitors_prebuild_agent_sites"));
|
|
450
|
+
return 0;
|
|
451
|
+
}
|
|
443
452
|
if (sub === "site") {
|
|
444
453
|
const write =
|
|
445
454
|
rest.positionals[0] === "publish" ||
|