@letterstory/cli 0.177.126 → 0.177.128
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 +4 -1
- package/lib/commands/probes.mjs +33 -2
- package/lib/commands/strategy.mjs +34 -1
- 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.128";
|
|
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;
|
|
@@ -936,8 +936,11 @@ Offerings (context layered org → offering → collection; a layer sets only wh
|
|
|
936
936
|
probes keep | pause | resume <probe_id> Keep = protect an AI probe from rotation (no pause)
|
|
937
937
|
probes edit <probe_id> <new question text> Fix/sharpen a generated probe
|
|
938
938
|
probes add <question> [--kind mention|citation] [--scope site|company|<blogId>] [--cluster <id>]
|
|
939
|
+
probes priority <t:id|q:id> <high|normal|low|none> Set or remove a prompt's priority
|
|
939
940
|
onboarding status Show the onboarding checklist
|
|
940
941
|
onboarding for <website|seo|geo|visitors|cmd_l> … What Letter is for: the onboarding's first question
|
|
942
|
+
onboarding site ["<what you're building>"] [--brands a.com,b.com] [--backend repo|none|not_app]
|
|
943
|
+
No website: Letter builds one on a preview address
|
|
941
944
|
onboarding step [--current <step>] [--complete <step>] [--skip <step>] [--status <status>]
|
|
942
945
|
series list The org's content series + coverage state
|
|
943
946
|
series create --name <n> [--description <d>] [--coverage a,b,c] [--collection <uuid>] [--template <key>]
|
package/lib/commands/probes.mjs
CHANGED
|
@@ -5,7 +5,26 @@
|
|
|
5
5
|
// or a script can see and act on exactly what a person can.
|
|
6
6
|
|
|
7
7
|
import { CliError } from "../client.mjs";
|
|
8
|
-
import { flagStr, flagNum, flagBool, requirePositional, printResult, compact, ok } from "./shared.mjs";
|
|
8
|
+
import { flagStr, flagNum, flagBool, requirePositional, printResult, compact, ok, argsFromFlags } from "./shared.mjs";
|
|
9
|
+
|
|
10
|
+
const PRIORITIES = ["high", "normal", "low"];
|
|
11
|
+
|
|
12
|
+
// How every tool this module calls through ARGS gets its arguments — see `argsFromFlags` in shared.mjs.
|
|
13
|
+
export const ARGS = {
|
|
14
|
+
set_prompt_priority: {
|
|
15
|
+
// The row's key from Measure → Prompt tracking (`t:<target id>` or `q:<probe id>`).
|
|
16
|
+
question_key: { positional: 0, label: "t:id|q:id", required: true },
|
|
17
|
+
// `none` removes the priority.
|
|
18
|
+
priority: {
|
|
19
|
+
value: (_flags, positionals) => {
|
|
20
|
+
const v = positionals[1];
|
|
21
|
+
if (v === "none") return null;
|
|
22
|
+
if (!PRIORITIES.includes(v)) throw new CliError("Priority must be one of: high, normal, low, none");
|
|
23
|
+
return v;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
9
28
|
|
|
10
29
|
export async function cmdProbes(ctx) {
|
|
11
30
|
const sub = ctx.positionals[0];
|
|
@@ -24,8 +43,10 @@ export async function cmdProbes(ctx) {
|
|
|
24
43
|
return probesEdit(rest);
|
|
25
44
|
case "add":
|
|
26
45
|
return probesAdd(rest);
|
|
46
|
+
case "priority":
|
|
47
|
+
return probesPriority(rest);
|
|
27
48
|
default:
|
|
28
|
-
throw new CliError("Usage: probes <list|keep|pause|resume|edit|add>");
|
|
49
|
+
throw new CliError("Usage: probes <list|keep|pause|resume|edit|add|priority>");
|
|
29
50
|
}
|
|
30
51
|
}
|
|
31
52
|
|
|
@@ -91,6 +112,16 @@ async function probesAdd(ctx) {
|
|
|
91
112
|
return 0;
|
|
92
113
|
}
|
|
93
114
|
|
|
115
|
+
async function probesPriority(ctx) {
|
|
116
|
+
const { client, positionals, flags } = ctx;
|
|
117
|
+
const result = await client.callTool(
|
|
118
|
+
"set_prompt_priority",
|
|
119
|
+
argsFromFlags(ARGS.set_prompt_priority, flags, positionals)
|
|
120
|
+
);
|
|
121
|
+
ok(ctx, `Priority saved (${result.question_key}).`);
|
|
122
|
+
return 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
94
125
|
export async function cmdSuggestions(ctx) {
|
|
95
126
|
const sub = ctx.positionals[0];
|
|
96
127
|
const rest = { ...ctx, positionals: ctx.positionals.slice(1) };
|
|
@@ -97,6 +97,22 @@ export const ARGS = {
|
|
|
97
97
|
positionals.map((p) => p.toLowerCase().replace("⌘l", "cmd_l").replace("-", "_")),
|
|
98
98
|
},
|
|
99
99
|
},
|
|
100
|
+
// No website: Letter builds one on a preview address (`onboarding site "<context>" --brands vercel.com,vanta.com`).
|
|
101
|
+
build_signup_site: {
|
|
102
|
+
context: { value: (_flags, positionals) => positionals.join(" ").trim() || undefined },
|
|
103
|
+
brands: {
|
|
104
|
+
value: (flags) => {
|
|
105
|
+
const brands = flagList(flags.brands).flatMap((b) =>
|
|
106
|
+
b
|
|
107
|
+
.split(",")
|
|
108
|
+
.map((x) => x.trim())
|
|
109
|
+
.filter(Boolean)
|
|
110
|
+
);
|
|
111
|
+
return brands.length ? brands : undefined;
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
backend: { flag: "backend", enum: ["repo", "none", "not_app"] },
|
|
115
|
+
},
|
|
100
116
|
// Step ids are the server's to define (the registry is the authority); forwarded as given.
|
|
101
117
|
set_onboarding_step: {
|
|
102
118
|
current_step: "current",
|
|
@@ -302,8 +318,10 @@ export async function cmdOnboarding(ctx) {
|
|
|
302
318
|
return onboardingStep(rest);
|
|
303
319
|
case "for":
|
|
304
320
|
return onboardingFor(rest);
|
|
321
|
+
case "site":
|
|
322
|
+
return onboardingSite(rest);
|
|
305
323
|
default:
|
|
306
|
-
throw new CliError(`Unknown onboarding subcommand: ${sub ?? "(none)"}. Try: status, for, step`);
|
|
324
|
+
throw new CliError(`Unknown onboarding subcommand: ${sub ?? "(none)"}. Try: status, for, site, step`);
|
|
307
325
|
}
|
|
308
326
|
}
|
|
309
327
|
|
|
@@ -341,6 +359,21 @@ async function onboardingFor(ctx) {
|
|
|
341
359
|
return 0;
|
|
342
360
|
}
|
|
343
361
|
|
|
362
|
+
/**
|
|
363
|
+
* `onboarding site ["<what you're building>"] [--brands a.com,b.com] [--backend repo|none|not_app]`: no website yet, so
|
|
364
|
+
* Letter builds one on a preview address, nothing bought (build_signup_site). Prints where the site is and the path.
|
|
365
|
+
*/
|
|
366
|
+
async function onboardingSite(ctx) {
|
|
367
|
+
const { client, flags, io, positionals } = ctx;
|
|
368
|
+
const args = argsFromFlags(ARGS.build_signup_site, flags, positionals);
|
|
369
|
+
const result = await client.callTool("build_signup_site", args);
|
|
370
|
+
ok(ctx, "Building your website.");
|
|
371
|
+
printResult(io, flags, result, (r) =>
|
|
372
|
+
[`${r.app.name}: ${r.app.stage_note ?? r.app.stage}`, ...signupPathLines(r.path)].join("\n")
|
|
373
|
+
);
|
|
374
|
+
return 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
344
377
|
async function onboardingStep(ctx) {
|
|
345
378
|
const { client, flags, io } = ctx;
|
|
346
379
|
const args = argsFromFlags(ARGS.set_onboarding_step, flags);
|