@letterstory/cli 0.177.178 → 0.177.180

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 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.178";
96
+ export const VERSION = "0.177.180";
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;
@@ -95,6 +95,7 @@ export const ARGS = {
95
95
  after: { flag: "after" },
96
96
  limit: { flag: "limit", type: "num" },
97
97
  },
98
+ review_usage_payments: { host: { flag: "host" } },
98
99
  set_usage_payment_scope: paymentScopeArgs,
99
100
  preview_usage_payment_scope: paymentScopeArgs,
100
101
  get_agent_tests: { test_id: { positional: 0, label: "test_id" } },
@@ -453,10 +454,11 @@ export async function cmdUsage(ctx) {
453
454
  preview: "preview_usage_payment_scope",
454
455
  scope: "set_usage_payment_scope",
455
456
  evidence: "get_usage_payment_evidence",
457
+ review: "review_usage_payments",
456
458
  }[ctx.positionals[1] ?? "status"];
457
459
  if (!tool)
458
460
  throw new CliError(
459
- "Use payments connect, status, discover, catalog, preview, scope, evidence, refresh or disconnect"
461
+ "Use payments connect, status, discover, catalog, preview, scope, evidence, review, refresh or disconnect"
460
462
  );
461
463
  printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, [])));
462
464
  return 0;
@@ -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" ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.178",
3
+ "version": "0.177.180",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",