@letterstory/cli 0.176.33 → 0.176.35

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 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.33";
86
+ export const VERSION = "0.176.35";
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;
@@ -1252,6 +1252,7 @@ Admin (STAFF key — --staff-key / LETTERSTORY_STAFF_API_KEY; acts before an org
1252
1252
  a dry run over the calls: every moment the model finds, posting nothing
1253
1253
  | highlights-post --picks-file picks.json [--verdict keep|pass] post picks from a scan
1254
1254
  | highlights-reorder [--before-ts ts] [--limit N] repost every clip in call order (deletes old posts)
1255
+ | highlights-recut <id> --start S --end S --quote "…" [--dry-run] widen a posted clip to the whole moment
1255
1256
  | renewals [--days 90]
1256
1257
  | reach-outs [--day YYYY-MM-DD] [--fresh] the day's reach-outs, N of 5 (#crm-reminders' count)
1257
1258
  | replies [--days 14] replies nobody has answered yet, newest first
@@ -14,7 +14,7 @@
14
14
  // The old names — evals, eval-add, eval-set, proposals, propose-eval, capture-eval, reject-eval — still work.)
15
15
  // admin evals scoreboard|cases|runs|run|triage|guard|retire … (fleet:read / tuning:experiment)
16
16
  // admin fleet-experiments list|articles|clients|mark|unmark|new|assign|assign-eligible|assign-orgs|spin-up|apply|start|stop|decide … (fleet:read / fleet:experiment)
17
- // admin crm import|capture|outreach|signals|record|signal|add|accounts|account|score|slack-channels|link-slack|white-glove|set-white-glove|churn|revenue|reach-outs|replies|record-churn|draft-churn-reason|undo-churn|outcomes|record-outcome|highlights|highlights-scan|highlights-post|highlights-reorder|renewals|track-record|weekly-note|at-risk|expansion-signals|collections|delivery-flags|pulse|client-health|case|onboard|onboarding|retry-onboarding|onboard-plan|payment-link … (crm:read / crm:write)
17
+ // admin crm import|capture|outreach|signals|record|signal|add|accounts|account|score|slack-channels|link-slack|white-glove|set-white-glove|churn|revenue|reach-outs|replies|record-churn|draft-churn-reason|undo-churn|outcomes|record-outcome|highlights|highlights-scan|highlights-post|highlights-reorder|highlights-recut|renewals|track-record|weekly-note|at-risk|expansion-signals|collections|delivery-flags|pulse|client-health|case|onboard|onboarding|retry-onboarding|onboard-plan|payment-link … (crm:read / crm:write)
18
18
  // admin spend summary|reconcile|pnl|margin|pricing|entries|add|import|usage|remove|reference|stripe-sync|services|service … (spend:read / spend:write)
19
19
  // admin brand-detection <org-id> (fleet:read)
20
20
  // admin brand-detection <org-id> [--term t]... [--exact t]... [--exclude p]... [--note "…"] | --clear [--note "…"] (fleet:instrument)
@@ -3671,6 +3671,27 @@ async function cmdAdminCrm(ctx) {
3671
3671
  `reposted ${x.reposted}, ${x.remaining} to go${x.remaining ? ` (--before-ts ${x.beforeTs})` : ""}${x.stoppedOn ? `; stopped on ${x.stoppedOn.id}: ${x.stoppedOn.error}` : ""}`
3672
3672
  );
3673
3673
  }
3674
+ case "highlights-recut": {
3675
+ // admin crm highlights-recut <highlight-id> --start S --end S --quote "…" [--dry-run]
3676
+ // — widen a posted clip to the whole moment; replaces its #customer-love post.
3677
+ const start = flagNum(flags.start);
3678
+ const end = flagNum(flags.end);
3679
+ const quote = flagStr(flags.quote);
3680
+ if (!id || start == null || end == null || !quote)
3681
+ throw new CliError(
3682
+ 'Usage: admin crm highlights-recut <highlight-id> --start S --end S --quote "…" [--dry-run]'
3683
+ );
3684
+ const r = await staffPost(
3685
+ ctx,
3686
+ `${CRM}/highlights/${encodeURIComponent(id)}/recut`,
3687
+ compact({ start_sec: start, end_sec: end, quote, dry_run: flags["dry-run"] ? true : undefined })
3688
+ );
3689
+ return out(
3690
+ r,
3691
+ (x) =>
3692
+ `${x.status} ${x.before.startSec}-${x.before.endSec}s → ${x.after ? `${x.after.startSec}-${x.after.endSec}s` : "?"}${x.error ? ` ${x.error}` : ""}${x.slackPermalink ? ` ${x.slackPermalink}` : ""}`
3693
+ );
3694
+ }
3674
3695
  case "renewals": {
3675
3696
  // admin crm renewals [--days 90] — contracts renewing soon, and Stripe cancels scheduled.
3676
3697
  const params = new URLSearchParams(compact({ days: flagStr(flags.days) }));
@@ -3963,7 +3984,7 @@ async function cmdAdminCrm(ctx) {
3963
3984
  }
3964
3985
  default:
3965
3986
  throw new CliError(
3966
- "Usage: admin crm import|capture|outreach|signals|record|signal|accounts|account|score|slack-channels|link-slack|white-glove|set-white-glove|churn|revenue|reach-outs|replies|record-churn|draft-churn-reason|undo-churn|outcomes|record-outcome|highlights|highlights-scan|highlights-post|highlights-reorder|renewals|track-record|weekly-note|at-risk|expansion-signals|collections|delivery-flags|pulse|client-health|case|onboard|onboarding|retry-onboarding|onboard-plan|prospect-org|prospect-orgs|prospect-org-repost|payment-link … (see --help)"
3987
+ "Usage: admin crm import|capture|outreach|signals|record|signal|accounts|account|score|slack-channels|link-slack|white-glove|set-white-glove|churn|revenue|reach-outs|replies|record-churn|draft-churn-reason|undo-churn|outcomes|record-outcome|highlights|highlights-scan|highlights-post|highlights-reorder|highlights-recut|renewals|track-record|weekly-note|at-risk|expansion-signals|collections|delivery-flags|pulse|client-health|case|onboard|onboarding|retry-onboarding|onboard-plan|prospect-org|prospect-orgs|prospect-org-repost|payment-link … (see --help)"
3967
3988
  );
3968
3989
  }
3969
3990
  }
@@ -5219,6 +5240,7 @@ function recipeFromFlags(flags) {
5219
5240
  const ENGINE = "/api/superadmin/engine-settings";
5220
5241
  const LETTERPRESS = "/api/superadmin/letterpress";
5221
5242
  const CODING_TELEMETRY = "/api/superadmin/coding-telemetry";
5243
+ const PULL_REQUESTS = "/api/superadmin/pull-requests";
5222
5244
  const ENGINE_USAGE =
5223
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>";
5224
5246
 
@@ -5466,7 +5488,8 @@ async function cmdAdminLetterpress(ctx) {
5466
5488
  case "prs": {
5467
5489
  // get_pull_requests (the days) or, with --day / --org / --state, list_pull_requests (the PRs behind them).
5468
5490
  const listing = flags.day || flags.org || flags.state;
5469
- const q = new URLSearchParams({ view: listing ? "pr_list" : "prs", days: String(flags.days ?? 30) });
5491
+ const q = new URLSearchParams({ days: String(flags.days ?? 30) });
5492
+ if (listing) q.set("view", "list");
5470
5493
  for (const [flag, key] of [
5471
5494
  ["day", "day"],
5472
5495
  ["org", "org_id"],
@@ -5480,7 +5503,7 @@ async function cmdAdminLetterpress(ctx) {
5480
5503
  if (flags[flag]) q.set(key, String(flags[flag]));
5481
5504
  if (flagBool(flags["all-orgs"])) q.set("customers", "0");
5482
5505
  if (flagBool(flags["all-time"])) q.set("all_time", "1");
5483
- const r = await staffRequest(ctx, "GET", `${CODING_TELEMETRY}?${q}`);
5506
+ const r = await staffRequest(ctx, "GET", `${PULL_REQUESTS}?${q}`);
5484
5507
  const pct = (v) => (v == null ? "—" : `${Math.round(100 * v)}%`);
5485
5508
  printResult(io, flags, r, (x) =>
5486
5509
  listing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.176.33",
3
+ "version": "0.176.35",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",