@letterstory/cli 0.177.193 → 0.177.195

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.193";
96
+ export const VERSION = "0.177.195";
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;
@@ -35,7 +35,7 @@
35
35
  // letterstory visits transact prebuild <site-id>... [--dry-run] staff: build customers' agent sites, Letter paying
36
36
  // letterstory visits transact asks [--since 7d] [--limit 50]
37
37
  // letterstory visits transact learnings [--since 7d]
38
- // letterstory visits transact site [publish|unpublish] [--domain ask.acme.com | --domain none] [--remove <slug>] [--dismiss "<question>"] [--forget <address>] [--check-link] the Agent Site tab
38
+ // letterstory visits transact site [publish|unpublish] [--domain ask.acme.com | --domain none] [--remove <slug>] [--dismiss "<question>"] [--forget <address>] [--check-link] [--dns-for <address>] the Agent Site tab
39
39
 
40
40
  import { CliError } from "../client.mjs";
41
41
  import { closeSync, fstatSync, openSync, readSync } from "node:fs";
@@ -161,7 +161,10 @@ export const ARGS = {
161
161
  },
162
162
  ask_id: "ask",
163
163
  directory: {
164
- value: (flags) => (flags.file || flags.prompt || flags.supporting || flags.prepare ? false : undefined),
164
+ value: (flags, positionals) =>
165
+ (flags.file || flags.prompt || flags.supporting || flags.prepare) && positionals[0] === "text"
166
+ ? false
167
+ : undefined,
165
168
  },
166
169
  prepare: {
167
170
  value: (flags) => {
@@ -247,6 +250,7 @@ export const ARGS = {
247
250
  site_id: "site",
248
251
  host: "host",
249
252
  check_link: { value: (flags) => (flagBool(flags["check-link"]) ? true : undefined) },
253
+ dns_for: { flag: "dns-for" },
250
254
  },
251
255
  visitors_prebuild_agent_sites: {
252
256
  site_ids: { value: (flags, positionals) => (positionals.length ? positionals : undefined) },
@@ -529,10 +533,13 @@ async function visitsTransact(ctx) {
529
533
  if (!r.available) return "Agent Sites aren't available yet";
530
534
  if (!r.published) return "Not published";
531
535
  const lines = [`Staging: ${r.staging_url}`];
532
- if (r.domain) {
533
- lines.push(`Domain: ${r.domain.name} (${r.domain.status})`);
534
- if (r.domain.status === "pending")
535
- for (const rec of r.domain.records) lines.push(` ${rec.type} ${rec.name} ${rec.value}`);
536
+ if (r.domain) lines.push(`Domain: ${r.domain.name} (${r.domain.status})`);
537
+ else if (r.dns_setup) lines.push(`DNS for ${r.dns_setup.name}:`);
538
+ const records = r.domain?.status === "pending" ? r.domain.records : (r.dns_setup?.records ?? []);
539
+ for (const rec of records) {
540
+ const advisory =
541
+ rec.type === "CAA" && !r.domain?.caa_required ? " (if certificate validation requires it)" : "";
542
+ lines.push(` ${rec.type} ${rec.name} ${rec.value}${advisory}`);
536
543
  }
537
544
  lines.push(
538
545
  r.building
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.193",
3
+ "version": "0.177.195",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",