@letterstory/cli 0.177.86 → 0.177.88
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 +1 -1
- package/lib/commands/admin.mjs +67 -3
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
import { fetchParkedSections, withoutParked } from "./parked.mjs";
|
|
91
91
|
|
|
92
92
|
// Matches cli/package.json; publish-cli.yml rewrites both to the published version.
|
|
93
|
-
export const VERSION = "0.177.
|
|
93
|
+
export const VERSION = "0.177.88";
|
|
94
94
|
|
|
95
95
|
/** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
|
|
96
96
|
export const EXIT_PAYMENT_REQUIRED = 3;
|
package/lib/commands/admin.mjs
CHANGED
|
@@ -5326,7 +5326,7 @@ const BUILD_FAILURES = "/api/superadmin/build-failures";
|
|
|
5326
5326
|
const SUGGESTION_REVIEW = "/api/superadmin/suggestion-review";
|
|
5327
5327
|
const TURN_ENDINGS = "/api/superadmin/turn-endings";
|
|
5328
5328
|
const ENGINE_USAGE =
|
|
5329
|
-
"Usage: admin letterpress status | gaps | friction [--kind error|exception|rage|step] [--surface s] [--org id] [--limit N] | asks [--days N] [--surface cmd_l|build_chat|slack|terminal|app|signup|letter] [--people | --letter] [--door d] [--whose ours|agent|setup|member] [--org id] [--limit N] | 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] | endings [--days N | --since ISO] [--org id,id] [--no-model] [--top N] [--write-cases [--dir evals/letterpress]] | 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] [--repo connected|none] | suggestions fix|idea [--day YYYY-MM-DD] [--type key [--org id]] [--all-orgs] | suggestions flag fix|idea <type-key> [--org id --item item-id] [--note …] | suggestions clear <flag-id> | 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>";
|
|
5329
|
+
"Usage: admin letterpress status | gaps | friction [--kind error|exception|rage|step|server|stall|background] [--surface s] [--org id] [--limit N] | tools [--days N] [--org id] [--all-orgs] | checks | frustration [--days N] | health | asks [--days N] [--surface cmd_l|build_chat|slack|terminal|app|signup|letter] [--people | --letter] [--door d] [--whose ours|agent|setup|member] [--pattern <code or key>] [--org id] [--limit N] | 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] | endings [--days N | --since ISO] [--org id,id] [--no-model] [--top N] [--write-cases [--dir evals/letterpress]] | 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] [--repo connected|none] | suggestions fix|idea [--day YYYY-MM-DD] [--type key [--org id]] [--all-orgs] | suggestions flag fix|idea <type-key> [--org id --item item-id] [--note …] | suggestions clear <flag-id> | 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>";
|
|
5330
5330
|
|
|
5331
5331
|
/** One number of the settings from a dotted path and a value: the PUT body save_engine_settings reads. */
|
|
5332
5332
|
function engineSettingsPatch(path, value) {
|
|
@@ -5488,10 +5488,10 @@ async function cmdAdminLetterpress(ctx) {
|
|
|
5488
5488
|
const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?${q}`);
|
|
5489
5489
|
printResult(io, flags, r, (f) =>
|
|
5490
5490
|
[
|
|
5491
|
-
`
|
|
5491
|
+
`Got in the way this week${f.computed_at ? ` (read ${f.computed_at}${f.stale ? ", stale" : ""})` : ""}: ${f.totals.kinds} kinds of trouble in ${f.totals.orgs} organizations, ${f.totals.new} new, ${f.totals.spiking} spiking`,
|
|
5492
5492
|
...f.rows.map(
|
|
5493
5493
|
(x) =>
|
|
5494
|
-
`${String(x.people).padStart(4)} people ${x.kind.padEnd(
|
|
5494
|
+
`${String(x.people).padStart(4)} ${["server", "stall", "background"].includes(x.kind) ? "orgs " : "people"} ${x.kind.padEnd(10)} ${x.is_new ? "NEW " : x.spiking ? "UP " : " "}${x.message.slice(0, 90)} ${x.pages[0] ?? ""} ${x.orgs
|
|
5495
5495
|
.map((o) => o.name)
|
|
5496
5496
|
.slice(0, 3)
|
|
5497
5497
|
.join(", ")}${x.replays[0] ? ` ${x.replays[0]}` : ""}`
|
|
@@ -5500,6 +5500,69 @@ async function cmdAdminLetterpress(ctx) {
|
|
|
5500
5500
|
);
|
|
5501
5501
|
return 0;
|
|
5502
5502
|
}
|
|
5503
|
+
case "tools": {
|
|
5504
|
+
// get_tool_failures: each Letterpress tool's failures inside turns.
|
|
5505
|
+
const q = new URLSearchParams({ view: "tools", days: String(flags.days ?? 7) });
|
|
5506
|
+
if (flagBool(flags["all-orgs"])) q.set("customers", "0");
|
|
5507
|
+
if (flags.org) q.set("org_id", String(flags.org));
|
|
5508
|
+
const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?${q}`);
|
|
5509
|
+
printResult(io, flags, r, (t) =>
|
|
5510
|
+
[
|
|
5511
|
+
`Tools that failed, last ${t.days} days (${t.turns} turns)`,
|
|
5512
|
+
...t.rows.map(
|
|
5513
|
+
(x) =>
|
|
5514
|
+
`${String(x.failed).padStart(4)} of ${String(x.calls).padEnd(5)} ${x.tool.padEnd(32)} ${x.orgs} orgs ${x.top_reason ?? ""}`
|
|
5515
|
+
),
|
|
5516
|
+
].join("\n")
|
|
5517
|
+
);
|
|
5518
|
+
return 0;
|
|
5519
|
+
}
|
|
5520
|
+
case "checks": {
|
|
5521
|
+
// get_ideas_checks: what the newest hourly Ideas checks found.
|
|
5522
|
+
const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?view=ideas_checks`);
|
|
5523
|
+
printResult(io, flags, r, (c) =>
|
|
5524
|
+
[
|
|
5525
|
+
c.checked_at
|
|
5526
|
+
? `Ideas checks ${c.checked_at}: ${c.total} broken on ${c.accounts} accounts, ${c.unread} unread, ${c.undecided_fits} fits undecided`
|
|
5527
|
+
: `No Ideas check has run yet; ${c.undecided_fits} fits undecided`,
|
|
5528
|
+
...c.checks.map(
|
|
5529
|
+
(g) =>
|
|
5530
|
+
`${String(g.count).padStart(4)} ${g.invariant.padEnd(22)} ${g.owner.padEnd(10)} ${g.examples[0] ? `${g.examples[0].host}: ${g.examples[0].evidence}` : ""}`
|
|
5531
|
+
),
|
|
5532
|
+
].join("\n")
|
|
5533
|
+
);
|
|
5534
|
+
return 0;
|
|
5535
|
+
}
|
|
5536
|
+
case "frustration": {
|
|
5537
|
+
// get_frustration_flags: the frustration watch's flags.
|
|
5538
|
+
const q = new URLSearchParams({ view: "frustration", days: String(flags.days ?? 7) });
|
|
5539
|
+
const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?${q}`);
|
|
5540
|
+
printResult(io, flags, r, (f) =>
|
|
5541
|
+
[
|
|
5542
|
+
`Frustration watch, last ${f.days} days: ${f.flags.length} flags from ${f.runs} runs${f.failed_runs ? `, ${f.failed_runs} failed` : ""}`,
|
|
5543
|
+
...f.flags.map(
|
|
5544
|
+
(x) =>
|
|
5545
|
+
`${x.at.slice(0, 16)} ${x.severity.padEnd(6)} ${x.company}: ${x.happened}${x.next_step ? ` → ${x.next_step}` : ""}`
|
|
5546
|
+
),
|
|
5547
|
+
].join("\n")
|
|
5548
|
+
);
|
|
5549
|
+
return 0;
|
|
5550
|
+
}
|
|
5551
|
+
case "health": {
|
|
5552
|
+
// get_customer_health: the Status checks stopping customer work right now.
|
|
5553
|
+
const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?view=health`);
|
|
5554
|
+
printResult(io, flags, r, (h) =>
|
|
5555
|
+
h.stopping.length
|
|
5556
|
+
? h.stopping
|
|
5557
|
+
.map(
|
|
5558
|
+
(c) =>
|
|
5559
|
+
`${c.state.padEnd(5)} ${c.title}: ${c.headline ?? ""}${c.since ? ` (since ${c.since})` : ""}`
|
|
5560
|
+
)
|
|
5561
|
+
.join("\n")
|
|
5562
|
+
: "Nothing is stopping customer work."
|
|
5563
|
+
);
|
|
5564
|
+
return 0;
|
|
5565
|
+
}
|
|
5503
5566
|
case "asks": {
|
|
5504
5567
|
// get_ask_outcomes: did each ask end with what was asked (docs/architecture/failure-visibility.md).
|
|
5505
5568
|
const q = new URLSearchParams({ view: "asks", days: String(flags.days ?? 7) });
|
|
@@ -5508,6 +5571,7 @@ async function cmdAdminLetterpress(ctx) {
|
|
|
5508
5571
|
if (flags.door) q.set("door", String(flags.door));
|
|
5509
5572
|
if (flags.surface) q.set("surface", String(flags.surface));
|
|
5510
5573
|
if (flags.whose) q.set("whose", String(flags.whose));
|
|
5574
|
+
if (flags.pattern) q.set("pattern", String(flags.pattern));
|
|
5511
5575
|
if (flags.org) q.set("org_id", String(flags.org));
|
|
5512
5576
|
if (flags.limit) q.set("limit", String(flags.limit));
|
|
5513
5577
|
const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?${q}`);
|