@letterstory/cli 0.176.34 → 0.176.36
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 +7 -3
- package/lib/commands/admin.mjs +4 -2
- package/lib/commands/automations.mjs +3 -1
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
84
84
|
|
|
85
85
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
86
|
-
export const VERSION = "0.176.
|
|
86
|
+
export const VERSION = "0.176.36";
|
|
87
87
|
|
|
88
88
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
89
89
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
|
@@ -99,6 +99,8 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
99
99
|
"wait",
|
|
100
100
|
// automations set: stop reading a data feed.
|
|
101
101
|
"no-reads",
|
|
102
|
+
// automations add|set --reads: leave out records the feed only changed.
|
|
103
|
+
"new-only",
|
|
102
104
|
// vary start: pause the test running on the page first.
|
|
103
105
|
"pause-running",
|
|
104
106
|
// bench run: the spec was just changed.
|
|
@@ -605,13 +607,15 @@ Reviewers:
|
|
|
605
607
|
automations dismiss <topic-id> --collection <id> Set one subject aside
|
|
606
608
|
automations add topic|series|signal|best --collection <id> [--topic <id>] [--goal <target-id>]
|
|
607
609
|
[--seer <id>] [--pace <n> | --on "fri 09:00 America/New_York"] [--brief <text>]
|
|
608
|
-
[--reads <seer-id> [--window <days>]] [--new-topic <name>] [--new-series <name>]
|
|
610
|
+
[--reads <seer-id> [--window <days>] [--new-only]] [--new-topic <name>] [--new-series <name>]
|
|
609
611
|
Add one (refused if it says the same as another).
|
|
610
612
|
--on pins it: one post a week, on that day and time
|
|
611
613
|
--reads: a data feed (a data_feed seer) whose records in
|
|
612
614
|
the window before each post are the post's own data
|
|
615
|
+
--new-only: only records the feed dates in the window,
|
|
616
|
+
not ones it merely changed (a price, a flag)
|
|
613
617
|
automations set <automation-id> --collection <id> [--pace <n> | --on "<day> <HH:MM> <tz>" | --unpin]
|
|
614
|
-
[--reads <seer-id> [--window <days>] | --no-reads]
|
|
618
|
+
[--reads <seer-id> [--window <days>] [--new-only] | --no-reads]
|
|
615
619
|
[--pause | --resume] [--goal <id>] [--brief <text>] [--remap]
|
|
616
620
|
automations remove <automation-id> --collection <id>
|
|
617
621
|
automate options What an automation can be made of here: the triggers,
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -5240,6 +5240,7 @@ function recipeFromFlags(flags) {
|
|
|
5240
5240
|
const ENGINE = "/api/superadmin/engine-settings";
|
|
5241
5241
|
const LETTERPRESS = "/api/superadmin/letterpress";
|
|
5242
5242
|
const CODING_TELEMETRY = "/api/superadmin/coding-telemetry";
|
|
5243
|
+
const PULL_REQUESTS = "/api/superadmin/pull-requests";
|
|
5243
5244
|
const ENGINE_USAGE =
|
|
5244
5245
|
"Usage: admin letterpress status | gaps | telemetry [--days N] [--harness h] [--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] | 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>";
|
|
5245
5246
|
|
|
@@ -5487,7 +5488,8 @@ async function cmdAdminLetterpress(ctx) {
|
|
|
5487
5488
|
case "prs": {
|
|
5488
5489
|
// get_pull_requests (the days) or, with --day / --org / --state, list_pull_requests (the PRs behind them).
|
|
5489
5490
|
const listing = flags.day || flags.org || flags.state;
|
|
5490
|
-
const q = new URLSearchParams({
|
|
5491
|
+
const q = new URLSearchParams({ days: String(flags.days ?? 30) });
|
|
5492
|
+
if (listing) q.set("view", "list");
|
|
5491
5493
|
for (const [flag, key] of [
|
|
5492
5494
|
["day", "day"],
|
|
5493
5495
|
["org", "org_id"],
|
|
@@ -5501,7 +5503,7 @@ async function cmdAdminLetterpress(ctx) {
|
|
|
5501
5503
|
if (flags[flag]) q.set(key, String(flags[flag]));
|
|
5502
5504
|
if (flagBool(flags["all-orgs"])) q.set("customers", "0");
|
|
5503
5505
|
if (flagBool(flags["all-time"])) q.set("all_time", "1");
|
|
5504
|
-
const r = await staffRequest(ctx, "GET", `${
|
|
5506
|
+
const r = await staffRequest(ctx, "GET", `${PULL_REQUESTS}?${q}`);
|
|
5505
5507
|
const pct = (v) => (v == null ? "—" : `${Math.round(100 * v)}%`);
|
|
5506
5508
|
printResult(io, flags, r, (x) =>
|
|
5507
5509
|
listing
|
|
@@ -26,6 +26,7 @@ export function parsePublishAt(text) {
|
|
|
26
26
|
/**
|
|
27
27
|
* `--reads <seer-id> [--window <days>]` → { seer_id, window_days } (the tool's `reads`): a data
|
|
28
28
|
* feed the automation reads, the window ending at each post's publish instant (7 days unless set).
|
|
29
|
+
* `--new-only` adds include_changed: false (records the feed only changed never count).
|
|
29
30
|
* `--no-reads` sends null (stop reading one).
|
|
30
31
|
*/
|
|
31
32
|
export function parseReads(flags) {
|
|
@@ -33,12 +34,13 @@ export function parseReads(flags) {
|
|
|
33
34
|
const seer = flagStr(flags.reads);
|
|
34
35
|
if (seer === undefined) {
|
|
35
36
|
if (flags.window !== undefined) throw new CliError("--window goes with --reads <seer-id>");
|
|
37
|
+
if (flags["new-only"] === true) throw new CliError("--new-only goes with --reads <seer-id>");
|
|
36
38
|
return undefined;
|
|
37
39
|
}
|
|
38
40
|
const days = flags.window === undefined ? 7 : Number(flags.window);
|
|
39
41
|
if (!Number.isInteger(days) || days < 1)
|
|
40
42
|
throw new CliError("--window takes a whole number of days, e.g. --window 7");
|
|
41
|
-
return { seer_id: seer, window_days: days };
|
|
43
|
+
return { seer_id: seer, window_days: days, ...(flags["new-only"] === true ? { include_changed: false } : {}) };
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
/** See `argsFromFlags` in shared.mjs; `scripts/parity-check.ts` diffs these keys against the tool. */
|