@letterstory/cli 0.15.4 → 0.15.5
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 +14 -1
- package/lib/commands/reviewers.mjs +62 -0
- package/lib/commands/shredder.mjs +2 -0
- package/lib/commands.mjs +1 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
cmdDomains,
|
|
20
20
|
cmdPosts,
|
|
21
21
|
cmdPublished,
|
|
22
|
+
cmdReviewers,
|
|
22
23
|
cmdCollections,
|
|
23
24
|
cmdAuthors,
|
|
24
25
|
cmdFlows,
|
|
@@ -43,7 +44,7 @@ import {
|
|
|
43
44
|
} from "./commands.mjs";
|
|
44
45
|
|
|
45
46
|
// Keep in sync with cli/package.json.
|
|
46
|
-
export const VERSION = "0.15.
|
|
47
|
+
export const VERSION = "0.15.5";
|
|
47
48
|
|
|
48
49
|
// Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
|
|
49
50
|
// can't accidentally swallow the id as --json's value.
|
|
@@ -183,6 +184,13 @@ Content:
|
|
|
183
184
|
published list [--limit <n>] [--collection <uuid>] [--format html|md]
|
|
184
185
|
published show (--id <uuid> | --slug <slug>) [--format html|md]
|
|
185
186
|
|
|
187
|
+
Reviewers:
|
|
188
|
+
reviewers standing list List the org's standing reviewers
|
|
189
|
+
reviewers standing add --email <e> [--name <n>] Auto-invite this contact as a
|
|
190
|
+
guest reviewer on every future
|
|
191
|
+
finished draft (no email sent now)
|
|
192
|
+
reviewers standing remove <reviewer-id> Stop future auto-invites
|
|
193
|
+
|
|
186
194
|
Collections:
|
|
187
195
|
collections list List your collections
|
|
188
196
|
collections new --name <n> [--description <text>]
|
|
@@ -422,6 +430,10 @@ Shredder (diversify content produced outside Letterstory; structure preserved):
|
|
|
422
430
|
shredder create --name <n> New endpoint (returns a callable public id)
|
|
423
431
|
shredder delete <endpoint-id> --yes
|
|
424
432
|
shredder run <endpoint-id> (--body <text>|--file <path>|--file -) [--coverage <0..1>] [--attempts <n>]
|
|
433
|
+
[--aggression standard|high|max]
|
|
434
|
+
standard (default) keeps the piece's own terminology;
|
|
435
|
+
high rewrites more and may reword recurring terms;
|
|
436
|
+
max rewrites hardest — expect vocabulary drift
|
|
425
437
|
Shred prose through an endpoint (logs telemetry)
|
|
426
438
|
shredder runs [--endpoint <id>] [--limit <n>] Recent shred calls (telemetry), newest first
|
|
427
439
|
|
|
@@ -482,6 +494,7 @@ const CLIENT_COMMANDS = {
|
|
|
482
494
|
domains: cmdDomains,
|
|
483
495
|
posts: cmdPosts,
|
|
484
496
|
published: cmdPublished,
|
|
497
|
+
reviewers: cmdReviewers,
|
|
485
498
|
collections: cmdCollections,
|
|
486
499
|
authors: cmdAuthors,
|
|
487
500
|
flows: cmdFlows,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// `reviewers standing` — an org's standing reviewers (organization_standing_reviewers):
|
|
2
|
+
// external contacts auto-invited as a guest reviewer on every article that reaches a
|
|
3
|
+
// finished, never-published draft (src/lib/services/standing-reviewers.ts + the
|
|
4
|
+
// notify-standing-reviewers cron), instead of inviting them by hand on each article.
|
|
5
|
+
// Same flag/positional/io conventions as posts.mjs — no commander, no color.
|
|
6
|
+
|
|
7
|
+
import { CliError } from "../client.mjs";
|
|
8
|
+
import { flagStr, requireFlag, requirePositional, printResult, compact, ok } from "./shared.mjs";
|
|
9
|
+
|
|
10
|
+
export async function cmdReviewers(ctx) {
|
|
11
|
+
const sub = ctx.positionals[0];
|
|
12
|
+
const rest = { ...ctx, positionals: ctx.positionals.slice(1) };
|
|
13
|
+
switch (sub) {
|
|
14
|
+
case "standing":
|
|
15
|
+
return cmdStandingReviewers(rest);
|
|
16
|
+
default:
|
|
17
|
+
throw new CliError(`Unknown reviewers subcommand: ${sub ?? "(none)"}. Try: standing`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function cmdStandingReviewers(ctx) {
|
|
22
|
+
const sub = ctx.positionals[0];
|
|
23
|
+
const rest = { ...ctx, positionals: ctx.positionals.slice(1) };
|
|
24
|
+
switch (sub) {
|
|
25
|
+
case "list":
|
|
26
|
+
case "ls":
|
|
27
|
+
return standingList(rest);
|
|
28
|
+
case "add":
|
|
29
|
+
return standingAdd(rest);
|
|
30
|
+
case "remove":
|
|
31
|
+
case "rm":
|
|
32
|
+
return standingRemove(rest);
|
|
33
|
+
default:
|
|
34
|
+
throw new CliError(`Unknown reviewers standing subcommand: ${sub ?? "(none)"}. Try: list, add, remove`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function standingList(ctx) {
|
|
39
|
+
const { client, flags, io } = ctx;
|
|
40
|
+
const result = await client.callTool("list_standing_reviewers", {});
|
|
41
|
+
printResult(io, flags, result);
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async function standingAdd(ctx) {
|
|
46
|
+
const { client, flags, io } = ctx;
|
|
47
|
+
const email = requireFlag(flags, "email");
|
|
48
|
+
const args = compact({ email, name: flagStr(flags.name) });
|
|
49
|
+
const result = await client.callTool("add_standing_reviewer", args);
|
|
50
|
+
ok(ctx, `Added ${email} as a standing reviewer.`);
|
|
51
|
+
printResult(io, flags, result);
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function standingRemove(ctx) {
|
|
56
|
+
const { client, positionals, flags, io } = ctx;
|
|
57
|
+
const id = requirePositional(positionals, 0, "reviewer-id");
|
|
58
|
+
const result = await client.callTool("remove_standing_reviewer", { reviewer_id: id });
|
|
59
|
+
ok(ctx, "Removed.");
|
|
60
|
+
printResult(io, flags, result);
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
@@ -80,6 +80,8 @@ async function shredderRun(ctx) {
|
|
|
80
80
|
text,
|
|
81
81
|
coverage: flagNum(flags.coverage),
|
|
82
82
|
attempts_per_unit: flagNum(flags.attempts),
|
|
83
|
+
// How hard to rewrite. Validated service-side; sent only when the caller asked.
|
|
84
|
+
...(flags.aggression ? { aggression: String(flags.aggression) } : {}),
|
|
83
85
|
});
|
|
84
86
|
const result = await client.callTool("run_shred", args);
|
|
85
87
|
ok(ctx, "Shred complete.");
|
package/lib/commands.mjs
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./commands/discovery.mjs";
|
|
|
9
9
|
export * from "./commands/deploy.mjs";
|
|
10
10
|
export * from "./commands/mcp.mjs";
|
|
11
11
|
export * from "./commands/posts.mjs";
|
|
12
|
+
export * from "./commands/reviewers.mjs";
|
|
12
13
|
export * from "./commands/collections.mjs";
|
|
13
14
|
export * from "./commands/authors.mjs";
|
|
14
15
|
export * from "./commands/flows.mjs";
|