/** * Terminal-facing half of the billing gate: the prose that talks to a human. * * Split from `./billing.ts` so a Next.js consumer can use the prices, the * formatter, and the link mint without inheriting `chalk` or `process.exit`. * * Everything here is full prose rather than terse status output — a recurring * charge and a declined card are exactly the moments where more words are the * right call. */ import { type PaidResource } from "./billing.js"; import type { OutpostTokenSource } from "./client.js"; import type { OutpostTransport } from "./transport.js"; import type { BillingErrorPayload } from "./types.js"; /** * Gate a paid provisioning call behind an explicit, informed `--yes`. * * Prints the monthly charge in full and exits non-zero when the caller has not * passed `--yes`. Returns normally once approved so the caller proceeds. */ export declare function confirmChargeOrExit(opts: { resource: PaidResource; unitCents: number; quantity?: number; yes?: boolean; }): void; /** The transport + token pair every billing surface needs to mint a link. */ export interface BillingSurfaceContext { transport: OutpostTransport; token: OutpostTokenSource; baseUrl?: string; } /** * The provision was blocked because the payer has no card on file. * * Mints the card-capture link the backend pointed us at and prints a plain, * shareable message so the user can add a card — or hand the link to whoever owns * billing — and re-run. Returns the URL, or `null` when the server gave no `setup` * action to act on. Never prints tokens or secrets. */ export declare function surfaceBillingRequired(ctx: BillingSurfaceContext, billing: BillingErrorPayload): Promise; /** * Status-aware surface for a 402 billing block. * * hq-pro's envelope carries two distinct remediations that must never be * conflated (mirroring the server's own classification): * * - `payment_failed` — a card EXISTS and the charge was DECLINED. The server's * `message` already carries the friendly decline copy ("Your card was * declined…", "insufficient funds", …). Telling this user "No card on file" * sends them down the wrong remediation path entirely (observed live * 2026-07-20: a declined $80 Outpost proration surfaced as "no card", * triggering a hunt for a missing card that existed). The capture link still * surfaces — as the way to UPDATE the card. * - anything else (`billing_required`) — genuinely no usable card on file; the * add-a-card copy is correct. */ export declare function surfaceBillingBlocked(ctx: BillingSurfaceContext, billing: BillingErrorPayload, serverMessage?: string): Promise; //# sourceMappingURL=cli-billing.d.ts.map