@letterstory/cli 0.176.103 → 0.176.105
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 +2 -1
- package/lib/commands/admin.mjs +21 -1
- package/lib/commands/automate.mjs +9 -0
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
88
88
|
|
|
89
89
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
90
|
-
export const VERSION = "0.176.
|
|
90
|
+
export const VERSION = "0.176.105";
|
|
91
91
|
|
|
92
92
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
93
93
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -679,6 +679,7 @@ Reviewers:
|
|
|
679
679
|
[--prompt <what Letterpress does with each event>] [--slack-channel <C…>] [--instruction <which events>]
|
|
680
680
|
[--event <name>] [--kind post|landing] [--competitor <host>] [--site <host>]
|
|
681
681
|
[--every <n> --unit hours|days|weeks|months] [--facts <a,b>] [--recipe <id>]
|
|
682
|
+
[--fit-run <run-id> --publication-host <site>]
|
|
682
683
|
[--hot-leads-only] [--per-day <n>] [--backfill all|<YYYY-MM-DD>] [--off]
|
|
683
684
|
Make one (a template fills what you leave out): it starts
|
|
684
685
|
from now (--backfill also runs it on past events, oldest
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -5264,7 +5264,7 @@ const PULL_REQUESTS = "/api/superadmin/pull-requests";
|
|
|
5264
5264
|
const PLATFORM_USAGE = "/api/superadmin/usage/platform";
|
|
5265
5265
|
const BUILD_FAILURES = "/api/superadmin/build-failures";
|
|
5266
5266
|
const ENGINE_USAGE =
|
|
5267
|
-
"Usage: admin letterpress status | gaps | telemetry [--days N] [--harness h] [--all-orgs] | tokens [--days N] [--so-far] [--all-orgs] | prs [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--state merged|open|closed] [--top N] [--tz zone] [--all-orgs] | failures [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--failure ours|agent|setup|undelivered] [--cause c] [--stopped-at step] [--repo owner/name] [--slow] [--tz zone] [--all-orgs] | blocked [--days N] [--org id] [--all-orgs] | unblock <org-id> <host> <subject> | decisions <org-id> [--site host] [--surface plan|fix|build|site] | undo <org-id> <host> <decision-id> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--pr merged|closed|open|none] [--harness h] [--days N] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
|
|
5267
|
+
"Usage: admin letterpress status | gaps | telemetry [--days N] [--harness h] [--all-orgs] | tokens [--days N] [--so-far] [--all-orgs] | prs [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--state merged|open|closed] [--top N] [--tz zone] [--all-orgs] | failures [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--failure ours|agent|setup|undelivered] [--cause c] [--stopped-at step] [--repo owner/name] [--slow] [--tz zone] [--all-orgs] | blocked [--days N] [--org id] [--all-orgs] | unblock <org-id> <host> <subject> | decisions <org-id> [--site host] [--surface plan|fix|build|site] | undo <org-id> <host> <decision-id> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--pr merged|closed|open|none] [--harness h] [--days N] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | ideas <org-id> [--site host] | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
|
|
5268
5268
|
|
|
5269
5269
|
/** One number of the settings from a dotted path and a value: the PUT body save_engine_settings reads. */
|
|
5270
5270
|
function engineSettingsPatch(path, value) {
|
|
@@ -5731,6 +5731,26 @@ async function cmdAdminLetterpress(ctx) {
|
|
|
5731
5731
|
);
|
|
5732
5732
|
return 0;
|
|
5733
5733
|
}
|
|
5734
|
+
case "ideas": {
|
|
5735
|
+
// list_company_ideas: the rows the company's Ideas tab lists, with the recipe behind each.
|
|
5736
|
+
const org = positionals[1];
|
|
5737
|
+
if (!org) throw new CliError(ENGINE_USAGE);
|
|
5738
|
+
const q = new URLSearchParams({ org_id: org });
|
|
5739
|
+
if (flags.site) q.set("domain", String(flags.site));
|
|
5740
|
+
const r = await staffRequest(ctx, "GET", `${LETTERPRESS}-companies/ideas?${q}`);
|
|
5741
|
+
printResult(io, flags, r, (x) =>
|
|
5742
|
+
x.ideas.length
|
|
5743
|
+
? [
|
|
5744
|
+
`${x.host}: ${x.ideas.length} idea${x.ideas.length === 1 ? "" : "s"}${x.status === "ready" ? "" : ` (${x.status})`}`,
|
|
5745
|
+
...x.ideas.map(
|
|
5746
|
+
(i, n) =>
|
|
5747
|
+
`${String(n + 1).padStart(2)}. ${i.title}${i.recipe ? ` [${i.recipe}]` : ""}${i.badge ? ` (${i.badge.label})` : ""}\n ${i.detail ?? i.why}`
|
|
5748
|
+
),
|
|
5749
|
+
].join("\n")
|
|
5750
|
+
: x.message
|
|
5751
|
+
);
|
|
5752
|
+
return 0;
|
|
5753
|
+
}
|
|
5734
5754
|
case "facts": {
|
|
5735
5755
|
// list_account_facts: what the verdicts rest on.
|
|
5736
5756
|
const org = positionals[1];
|
|
@@ -132,6 +132,15 @@ export const ARGS = {
|
|
|
132
132
|
scope,
|
|
133
133
|
// --recipe <id>: make the automation a Plan recipe carries (the Plan row's own call).
|
|
134
134
|
recipe: { flag: "recipe" },
|
|
135
|
+
publication: {
|
|
136
|
+
value: (flags) => {
|
|
137
|
+
const run = flagStr(flags["fit-run"]);
|
|
138
|
+
const host = flagStr(flags["publication-host"]);
|
|
139
|
+
if (Boolean(run) !== Boolean(host))
|
|
140
|
+
throw new CliError("Pass --fit-run and --publication-host together.");
|
|
141
|
+
return run ? { run_id: run, host } : undefined;
|
|
142
|
+
},
|
|
143
|
+
},
|
|
135
144
|
name: { flag: "name" },
|
|
136
145
|
trigger: { flag: "trigger", enum: TRIGGERS },
|
|
137
146
|
trigger_params: triggerParams,
|