/** * `bitmagic allowance` — what this window's Bitmagic Pro allowance has left, and * whether purchased sparks are allowed to take over once it runs out. * * The allowance is a spending LIMIT, not a grant: when a window is exhausted the * rest of a spend spills into the creator's purchased spark balance. That used * to happen silently and automatically, which is worst here — the CLI is * normally driven by the creator's own coding agent, so an agent could burn the * human's wallet without the human seeing a number. Now it takes one accept: * `bitmagic allowance --allow-sparks`, after which spilling is automatic again. * * The setting lives on the ACCOUNT, not in `~/.bitmagic` — the same * `GET /api/pro/plan` and `POST /api/pro/spill-consent` handlers the My Plan * card uses, so the two surfaces cannot disagree and a second machine inherits * the answer. * * Rendering follows the `bitmagic usage` convention: a pure function over the * response, plain aligned text and no colour, because an agent tool is usually * what reads this. */ interface PlanWindow { limit: number; used: number; remaining: number; /** Epoch ms, or null when the window is closed and reopens on next use. */ resetsAt: number | null; } interface PlanAllowance { total: number; long: PlanWindow; short: PlanWindow; } interface SpillConsent { accepted: boolean; acceptedAt: number | null; } export interface ProPlanResponse { success: boolean; entitled: boolean; allowance: PlanAllowance | null; /** Null when the caller does not hold Pro — there is no spill-over to have agreed to. */ spillConsent: SpillConsent | null; } /** * PURE. The one-line answer to "may my spark balance be spent right now?". * * Exported because `bitmagic usage` prints the same line — a creator who checks * where their sparks went should learn from the same place whether more can go. */ export declare function formatSpillLine(plan: ProPlanResponse): string; /** * PURE. The whole report as text. * * `now` is a parameter rather than a `Date.now()` call so reset times are * testable, and so every line of one report agrees on a single instant. */ export declare function formatAllowanceReport(plan: ProPlanResponse, now?: number): string; export interface AllowanceOptions { env?: string; /** true to accept, false to withdraw, undefined to only read the state. */ setSpill?: boolean; /** * Whether a human is at the keyboard. Injected so the TTY rule is testable; * defaults to the real stdin. */ interactive?: boolean; } export declare function runAllowance(options?: AllowanceOptions): Promise; export declare const allowanceCommand: import("citty").CommandDef<{ readonly 'allow-sparks': { readonly type: "boolean"; readonly description: "Let your purchased sparks fund work once the allowance runs out. Ask a human to run this."; }; readonly 'block-sparks': { readonly type: "boolean"; readonly description: "Stop purchased sparks funding work; the allowance alone pays."; }; readonly env: { readonly type: "string"; readonly description: "Environment to query (dev, prod, local)."; }; readonly json: { readonly type: "boolean"; readonly description: "Print the result as JSON on stdout; all progress goes to stderr."; }; }>; export {};