@letterstory/cli 0.177.80 → 0.177.82

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/README.md CHANGED
@@ -446,7 +446,7 @@ how it was tested, and what we learned and why.
446
446
 
447
447
  ```bash
448
448
  # Needs a STAFF key with recipes:read (reads) and recipes:write (writes): mint it on
449
- # /superadmin/letterpress/tuning?tab=settings → "Your agent's key". Recipes are global: one library behind every
449
+ # /superadmin/recipes?view=settings → "Your agent's key". Recipes are global: one library behind every
450
450
  # account's Plan. The same routes and functions as that page.
451
451
  export LETTERSTORY_STAFF_API_KEY=<your staff key with recipes:read,recipes:write>
452
452
 
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.80";
93
+ export const VERSION = "0.177.82";
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;
@@ -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 | asks [--days N] [--people | --letter] [--door d] [--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] [--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>";
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) {
@@ -5478,12 +5478,36 @@ async function cmdAdminLetterpress(ctx) {
5478
5478
  );
5479
5479
  return 0;
5480
5480
  }
5481
+ case "friction": {
5482
+ // get_member_friction: what members ran into on screen this week (docs/architecture/failure-visibility.md).
5483
+ const q = new URLSearchParams({ view: "friction" });
5484
+ if (flags.kind) q.set("kind", String(flags.kind));
5485
+ if (flags.surface) q.set("surface", String(flags.surface));
5486
+ if (flags.org) q.set("org_id", String(flags.org));
5487
+ if (flags.limit) q.set("limit", String(flags.limit));
5488
+ const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?${q}`);
5489
+ printResult(io, flags, r, (f) =>
5490
+ [
5491
+ `Seen by members 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
+ ...f.rows.map(
5493
+ (x) =>
5494
+ `${String(x.people).padStart(4)} people ${x.kind.padEnd(9)} ${x.is_new ? "NEW " : x.spiking ? "UP " : " "}${x.message.slice(0, 90)} ${x.pages[0] ?? ""} ${x.orgs
5495
+ .map((o) => o.name)
5496
+ .slice(0, 3)
5497
+ .join(", ")}${x.replays[0] ? ` ${x.replays[0]}` : ""}`
5498
+ ),
5499
+ ].join("\n")
5500
+ );
5501
+ return 0;
5502
+ }
5481
5503
  case "asks": {
5482
5504
  // get_ask_outcomes: did each ask end with what was asked (docs/architecture/failure-visibility.md).
5483
5505
  const q = new URLSearchParams({ view: "asks", days: String(flags.days ?? 7) });
5484
5506
  if (flagBool(flags.people)) q.set("asked_by", "person");
5485
5507
  if (flagBool(flags.letter)) q.set("asked_by", "letter");
5486
5508
  if (flags.door) q.set("door", String(flags.door));
5509
+ if (flags.surface) q.set("surface", String(flags.surface));
5510
+ if (flags.whose) q.set("whose", String(flags.whose));
5487
5511
  if (flags.org) q.set("org_id", String(flags.org));
5488
5512
  if (flags.limit) q.set("limit", String(flags.limit));
5489
5513
  const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?${q}`);
@@ -5495,6 +5519,9 @@ async function cmdAdminLetterpress(ctx) {
5495
5519
  `Delivered, last ${a.days} days${a.computed_at ? ` (read ${a.computed_at}${a.stale ? ", stale" : ""}${a.partial ? ", partial" : ""})` : ""}`,
5496
5520
  line(a.summary.person),
5497
5521
  line(a.summary.letter),
5522
+ a.summary.whose
5523
+ ? `Whose: ours ${a.summary.whose.ours} the agent's ${a.summary.whose.agent} their setup ${a.summary.whose.setup} their call ${a.summary.whose.member}`
5524
+ : "",
5498
5525
  "",
5499
5526
  ...a.summary.doors.map(line),
5500
5527
  "",
@@ -5504,7 +5531,7 @@ async function cmdAdminLetterpress(ctx) {
5504
5531
  "",
5505
5532
  ...a.failures.map(
5506
5533
  (f) =>
5507
- `${f.at.slice(0, 16)} ${(f.org ?? f.org_id).slice(0, 20).padEnd(20)} ${f.door.padEnd(22)} ${f.outcome.padEnd(13)} ${f.reason ?? ""}: ${f.why ?? ""}${f.pr_url ? ` ${f.pr_url}` : ""}`
5534
+ `${f.at.slice(0, 16)} ${(f.org ?? f.org_id).slice(0, 20).padEnd(20)} ${f.door.padEnd(22)} ${f.outcome.padEnd(13)} ${(f.whose ?? "").padEnd(6)} ${f.reason ?? ""}: ${f.why ?? ""}${f.pr_url ? ` ${f.pr_url}` : ""}`
5508
5535
  ),
5509
5536
  ].join("\n")
5510
5537
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.80",
3
+ "version": "0.177.82",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",