@letterstory/cli 0.82.0 → 0.82.2
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/README.md +3 -1
- package/lib/cli.mjs +6 -2
- package/lib/commands/admin.mjs +24 -4
- package/lib/commands/authors.mjs +5 -1
- package/lib/commands/onboard.mjs +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -437,7 +437,9 @@ letterstory admin crm payment-link <account-id> # Stripe Payment Link at
|
|
|
437
437
|
|
|
438
438
|
`onboard` runs org → link → phantom sites → Slack channel → checklist → app invites →
|
|
439
439
|
stage in one call. Each site is a real (not test) fleet build; `--site ""` lets the engine
|
|
440
|
-
infer its beat from the client's homepage. `
|
|
440
|
+
infer its beat from the client's homepage. `--disclose 2` (or `--disclose all`) turns on sponsor
|
|
441
|
+
disclosure ("safe mode") for that site, and `--disclose-note "…"` records the client's words
|
|
442
|
+
as the reason; `onboard-plan` flags the sites whose calls asked for it. `onboard-plan` reads the account's recorded calls
|
|
441
443
|
(newest first, cached per set of calls; `--refresh` re-reads) and says how many sites, what each
|
|
442
444
|
is about, who to invite, and whether they've paid. `payment-link` stamps the account's org on
|
|
443
445
|
the Stripe subscription, so paying through it binds and marks the account paid by itself.
|
package/lib/cli.mjs
CHANGED
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
} from "./commands.mjs";
|
|
58
58
|
|
|
59
59
|
// Keep in sync with cli/package.json.
|
|
60
|
-
export const VERSION = "0.82.
|
|
60
|
+
export const VERSION = "0.82.2";
|
|
61
61
|
|
|
62
62
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
63
63
|
// can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
|
|
@@ -81,6 +81,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
81
81
|
"rebuild",
|
|
82
82
|
"print-key",
|
|
83
83
|
"stdin",
|
|
84
|
+
// `authors generate <id> --with-bios`.
|
|
85
|
+
"with-bios",
|
|
84
86
|
// `covers generate <id> --regenerate` and `arena run --gate --article <id>`
|
|
85
87
|
// both put a value-less flag next to a value: without these entries the parser
|
|
86
88
|
// hands the following token to the flag and the real argument disappears.
|
|
@@ -338,7 +340,8 @@ Collections:
|
|
|
338
340
|
|
|
339
341
|
Authors (the per-collection author bank — recurring bylines):
|
|
340
342
|
authors list <collection-id> List the bank + byline distribution
|
|
341
|
-
authors generate <collection-id> [--count <n>]
|
|
343
|
+
authors generate <collection-id> [--count <n>] [--with-bios]
|
|
344
|
+
Generate a masthead (names only; --with-bios adds a one-line bio + role)
|
|
342
345
|
authors add <collection-id> --name <n> [--bio <t>] [--role <t>] [--expertise a,b] [--started-at YYYY-MM-DD]
|
|
343
346
|
authors edit <collection-id> <author-id> [--name] [--bio] [--role] [--expertise a,b] [--started-at] [--active true|false]
|
|
344
347
|
authors retire <collection-id> <author-id> Stop assigning new posts to them
|
|
@@ -521,6 +524,7 @@ Phantom launch recipe (a CLIENT domain -> a live phantom with its first posts; d
|
|
|
521
524
|
${bin === "phantom" ? "onboard" : "phantom-onboard"} <domain> [--about "the beat"] [--name X]
|
|
522
525
|
[--posts N] [--cadence N] [--cover editorial_image|full_ai|line_art] [--theme T]
|
|
523
526
|
[--real] [--domain host] [--domain-mode subdomain|buy_now|connect_later]
|
|
527
|
+
[--disclose [surfaces]] [--sponsor-label X] [--disclose-note "why"]
|
|
524
528
|
[--accept] [--dry-run]
|
|
525
529
|
Plan (read-only) then, with --accept
|
|
526
530
|
or an override flag, provision + configure
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -2405,7 +2405,11 @@ function planLines(p) {
|
|
|
2405
2405
|
`domain: ${p.domain ?? "(unknown)"}`,
|
|
2406
2406
|
`sites: ${p.sites.length}`,
|
|
2407
2407
|
...p.sites.map(
|
|
2408
|
-
(s, i) =>
|
|
2408
|
+
(s, i) =>
|
|
2409
|
+
` ${i + 1}. ${s.direction || "(infer from their homepage)"}${s.why ? ` — ${s.why}` : ""}` +
|
|
2410
|
+
(s.disclose_sponsor?.recommended
|
|
2411
|
+
? `\n disclose the sponsor (--disclose ${i + 1})${s.disclose_sponsor.quote ? `: “${s.disclose_sponsor.quote}”` : ""}`
|
|
2412
|
+
: "")
|
|
2409
2413
|
),
|
|
2410
2414
|
`slack: ${p.slackEmails.join(", ") || "(nobody found)"}`,
|
|
2411
2415
|
`invites: ${p.invites.map((i) => `${i.email}:${i.role}`).join(", ") || "(none)"}`,
|
|
@@ -2418,19 +2422,35 @@ function planLines(p) {
|
|
|
2418
2422
|
/**
|
|
2419
2423
|
* `admin crm onboard` body from flags — the same CrmOnboardBodySchema the desk sends.
|
|
2420
2424
|
* --site "<direction>" per site (repeatable; "" = infer from the homepage) and/or
|
|
2421
|
-
* --sites N (pads with inferred sites); --
|
|
2422
|
-
*
|
|
2425
|
+
* --sites N (pads with inferred sites); --disclose N (repeatable, 1-based; "all") turns on
|
|
2426
|
+
* sponsor disclosure ("safe mode": the line after each article + schema.org sponsor) for
|
|
2427
|
+
* that site, with --disclose-note "<the client's words>" as the reason; --slack a@x,b@x
|
|
2428
|
+
* (bare --slack = the channel, no invites yet); --invite email[:admin|editor] (repeatable);
|
|
2429
|
+
* --no-checklist.
|
|
2423
2430
|
*/
|
|
2424
2431
|
function onboardBody(flags) {
|
|
2425
2432
|
const domain = flagStr(flags.domain);
|
|
2426
2433
|
if (!domain) {
|
|
2427
2434
|
throw new CliError(
|
|
2428
|
-
'Usage: admin crm onboard <account-id> --domain acme.com [--name "Acme"] [--site "<direction>"]… [--sites N] [--slack a@x,b@x] [--invite a@x[:admin]]… [--no-checklist]'
|
|
2435
|
+
'Usage: admin crm onboard <account-id> --domain acme.com [--name "Acme"] [--site "<direction>"]… [--sites N] [--disclose N|all]… [--disclose-note "…"] [--slack a@x,b@x] [--invite a@x[:admin]]… [--no-checklist]'
|
|
2429
2436
|
);
|
|
2430
2437
|
}
|
|
2431
2438
|
const sites = flagList(flags.site).map((direction) => ({ direction: direction.trim() || null }));
|
|
2432
2439
|
const total = flagNum(flags.sites);
|
|
2433
2440
|
while (total !== undefined && sites.length < total) sites.push({ direction: null });
|
|
2441
|
+
const disclose = flagList(flags.disclose)
|
|
2442
|
+
.flatMap((v) => String(v).split(","))
|
|
2443
|
+
.map((v) => v.trim())
|
|
2444
|
+
.filter(Boolean);
|
|
2445
|
+
const note = flagStr(flags["disclose-note"]);
|
|
2446
|
+
for (const which of disclose) {
|
|
2447
|
+
const targets =
|
|
2448
|
+
which === "all"
|
|
2449
|
+
? sites.map((_, i) => i)
|
|
2450
|
+
: [Number(which) - 1].filter((i) => Number.isInteger(i) && i >= 0 && i < sites.length);
|
|
2451
|
+
if (targets.length === 0) throw new CliError(`--disclose ${which}: no such site (1–${sites.length}, or "all")`);
|
|
2452
|
+
for (const i of targets) sites[i] = { ...sites[i], disclosure: compact({ note }) };
|
|
2453
|
+
}
|
|
2434
2454
|
const slackEmails = flagList(flags.slack)
|
|
2435
2455
|
.flatMap((v) => v.split(","))
|
|
2436
2456
|
.map((e) => e.trim())
|
package/lib/commands/authors.mjs
CHANGED
|
@@ -61,7 +61,11 @@ async function authorsList(ctx) {
|
|
|
61
61
|
|
|
62
62
|
async function authorsGenerate(ctx) {
|
|
63
63
|
const { client, flags, io } = ctx;
|
|
64
|
-
const args = compact({
|
|
64
|
+
const args = compact({
|
|
65
|
+
collection_id: collectionId(ctx),
|
|
66
|
+
count: flagNum(flags.count),
|
|
67
|
+
with_bios: flagBool(flags["with-bios"]) || undefined,
|
|
68
|
+
});
|
|
65
69
|
const result = await client.callTool("generate_collection_authors", args);
|
|
66
70
|
ok(ctx, "Generated authors.");
|
|
67
71
|
printResult(io, flags, result);
|
package/lib/commands/onboard.mjs
CHANGED
|
@@ -151,6 +151,23 @@ export const ARGS = {
|
|
|
151
151
|
is_test: { flag: "real", type: "bool", invert: true },
|
|
152
152
|
// A self-serve integrator's customers launch their own sites: no staff pings.
|
|
153
153
|
notify_staff: { flag: "no-notify-staff", type: "bool", invert: true },
|
|
154
|
+
// Sponsor disclosure ("safe mode"): bare --disclose = the safe-mode surfaces (the
|
|
155
|
+
// server's default); --disclose article_footer,cover_badge picks them. Off unless asked.
|
|
156
|
+
disclosure: {
|
|
157
|
+
value: (flags) => {
|
|
158
|
+
if (flags.disclose === undefined || flags.disclose === false) return undefined;
|
|
159
|
+
const listed = typeof flags.disclose === "string" ? flags.disclose : "";
|
|
160
|
+
const surfaces = listed
|
|
161
|
+
.split(",")
|
|
162
|
+
.map((s) => s.trim())
|
|
163
|
+
.filter(Boolean);
|
|
164
|
+
return compact({
|
|
165
|
+
surfaces: surfaces.length ? surfaces : undefined,
|
|
166
|
+
sponsor_label: flagStr(flags["sponsor-label"]),
|
|
167
|
+
note: flagStr(flags["disclose-note"]),
|
|
168
|
+
});
|
|
169
|
+
},
|
|
170
|
+
},
|
|
154
171
|
},
|
|
155
172
|
},
|
|
156
173
|
},
|