@letterstory/cli 0.176.2 → 0.176.4

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
@@ -80,7 +80,7 @@ import {
80
80
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
81
81
 
82
82
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
83
- export const VERSION = "0.176.2";
83
+ export const VERSION = "0.176.4";
84
84
 
85
85
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
86
86
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -243,12 +243,30 @@ export function billingAccountText(r) {
243
243
  : "When they run out, new work needs a card (an admin adds one in Settings → Billing).",
244
244
  ]
245
245
  : []),
246
- // No plan and not on free tokens (unassigned, or the plan ended): adding a card starts one (addCard).
247
- ...(r.addCard && !f
246
+ // What an ended plan left owing (earlierPlan): until it is settled a card can't start a new plan, so
247
+ // no plans are listed to pay for.
248
+ ...(r.earlierPlan ? [r.earlierPlan.message] : []),
249
+ // Paying by card starts a plan (addCard): every plan offered, as letter.dev/pricing shows them, Growth's
250
+ // "Most teams" and, with usage, "Cheapest for you" (Kaya, 2026-11-02), the same choice Settings →
251
+ // Billing shows; a person enters the card there.
252
+ ...(r.addCard && !r.earlierPlan
248
253
  ? [
249
- `Adding a card starts ${r.addCard.planName}, at ${usd(r.addCard.monthlyUsd)} a month: an admin adds one in Settings → Billing.`,
254
+ r.addCard.lockedBy
255
+ ? `Paying by card starts ${r.addCard.planName}, at ${usd(r.addCard.monthlyUsd)} a month (a signup from ${r.addCard.lockedBy} is in progress): an admin pays in Settings → Billing.`
256
+ : `Pay by card: an admin picks a plan in Settings → Billing.${r.addCard.tokensPerMonth ? ` At your usage (about ${r.addCard.tokensPerMonth} tokens a month):` : ""}`,
257
+ ...(r.addCard.lockedBy ? [] : (r.addCard.plans ?? [])).map(
258
+ (p) =>
259
+ ` ${p.planName}${[p.badge, p.cheapestForYou ? "Cheapest for you" : null]
260
+ .filter(Boolean)
261
+ .map((b) => ` [${b}]`)
262
+ .join(
263
+ ""
264
+ )}: ${usd(p.monthlyUsd)} a month, ${p.includedTokens} tokens, ${usd(p.usdPer1kTokens)} per 1,000, past the pool ${usd(p.overageUsdPer1kTokens)} per 1,000${p.expectedMonthlyUsd !== null ? `; about ${usd(p.expectedMonthlyUsd)} a month at your usage` : ""}${p.savesUsdPerMonth ? `, saves ${usd(p.savesUsdPerMonth)} a month` : ""}.${p.tagline ? ` ${p.tagline}` : ""}${p.extras?.length ? ` ${p.extras.join(", ")}.` : ""}`
265
+ ),
250
266
  ]
251
267
  : []),
268
+ // Free tokens carrying over, not landed yet: the account read's own sentence (Kaya, 2026-11-02).
269
+ ...(r.carryOverArriving ? [`${r.carryOverArriving.words}.`] : []),
252
270
  ...(u
253
271
  ? [
254
272
  `This period (${u.periodFrom.slice(0, 10)} to ${u.periodTo.slice(0, 10)}): ${u.usedTokens} of ${u.allowanceTokens} tokens included${u.overageUsd > 0 ? `, ${usd(u.overageUsd)} of overage so far${u.overageChargedUsd ? ` (${usd(u.overageChargedUsd)} of it already charged to the card)` : ""}` : ""}${u.runningTokens ? `; ${u.runningTokens} more held by running work${u.runningOverageUsd > 0 ? ` (${usd(u.runningOverageUsd)} against the cap)` : ""}` : ""}.`,
@@ -344,6 +362,7 @@ function billingUsageText(r) {
344
362
  `Tokens: ${r.tokens.used} used of ${r.tokens.allowance} included${r.tokens.complimentary ? ` (+${r.tokens.complimentary} complimentary)` : ""}${r.tokens.arriving ? ` (${r.tokens.arriving} of them still being counted)` : ""}${r.tokens.running ? `, ${r.tokens.running} held by running work` : ""}.`
345
363
  );
346
364
  else lines.push("Not billed by usage: quantities only.");
365
+ if (r.carryOverArriving) lines.push(`${r.carryOverArriving.words}.`);
347
366
  if (r.usd)
348
367
  lines.push(
349
368
  `Plan fee ${usd(r.usd.planFee)}; overage so far ${usd(r.usd.overage)}. What was charged and the next invoice: letterstory org billing invoices.`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.176.2",
3
+ "version": "0.176.4",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",