@letterstory/cli 0.176.32 → 0.176.34

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.32";
86
+ export const VERSION = "0.176.34";
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;
@@ -773,7 +773,7 @@ Offerings (context layered org → offering → collection; a layer sets only wh
773
773
  What it may promote; the primary is what it publishes as
774
774
  offerings topic <topic-id> --offering <offering-id|none>
775
775
  Override which offering one planner topic promotes
776
- probes list [--collection <uuid>] [--active-only] [--kind mention|citation|page]
776
+ probes list [--collection <uuid>] [--active-only] [--kind mention|citation|page] [--days 30]
777
777
  probes keep | pause | resume <probe_id> Keep = protect an AI probe from rotation (no pause)
778
778
  probes edit <probe_id> <new question text> Fix/sharpen a generated probe
779
779
  probes add <question> [--kind mention|citation] [--scope site|company|<blogId>] [--cluster <id>]
@@ -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
  }
@@ -30,7 +30,7 @@ export async function cmdProbes(ctx) {
30
30
  }
31
31
 
32
32
  function formatProbeLine(p) {
33
- const state = p.lifecycle_state ? `[${p.lifecycle_state}]` : p.is_active ? "[active]" : "[paused]";
33
+ const state = p.lifecycle?.state ? `[${p.lifecycle.state}]` : p.is_active ? "[active]" : "[paused]";
34
34
  return `${p.id} ${state} (${p.probe_kind}/${p.scope}, source=${p.source ?? "?"}) ${p.text}`;
35
35
  }
36
36
 
@@ -42,6 +42,7 @@ async function probesList(ctx) {
42
42
  collection_id: flagStr(flags.collection),
43
43
  active_only: flagBool(flags["active-only"]),
44
44
  probe_kind: flagStr(flags.kind),
45
+ days: flagNum(flags.days),
45
46
  })
46
47
  );
47
48
  printResult(io, flags, result, (r) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.176.32",
3
+ "version": "0.176.34",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",