/** * AgentGuard® — CFO cost dashboard, read side. * * Aggregates the signed, hash-chained decision log into a CFO-legible view: * spend over time, by model, by provider, frontier-vs-"dark" (local / * open-weight / self-hosted) tokens, reserved-vs-settled true-up, an * enforcement/savings summary, and a tamper-evidence check. Everything is * derived IN-PROCESS from the customer-held ledger — no proxy, no data plane, * no provider billing API required. * * The "dark token" view is the differentiator: open-source / self-hosted usage * never appears on any provider's bill, so a provider console structurally * cannot show it. The signed ledger can, because the receipt is written where * the call is made. * * Honest scope note: the signed SpendDecision carries time, provider, model, * cents, action, builderCode, entryType and a provenance block — but NOT full * tenant/agent identity (only the scope key a cap matched on). Per-agent / * per-tenant breakdown therefore requires recording a metadata-only scope * digest on the decision; see `scopeKeyBreakdown` (best-effort from * triggeredScopeKey) and DASHBOARD.md. We do not invent attribution the ledger * does not carry. * * Patent notice: signed hash-chained decision log (U.S. application filed May * 2026); composes with DAG Trust Attestation, Patent D §7.3 (App. No. * 63/984,626). AgentGuard® is a U.S. registered trademark (Reg. No. 8281464) * of Dunecrest Ventures Inc. */ import type { SignedDecisionLogEntry, SpendDecision } from '../types'; export type TokenOrigin = 'frontier' | 'dark' | 'unknown'; /** Classify a decision as frontier vs dark (local/open-weight) spend. * Prefers the signed provenance block; falls back to the coarse provider * field and labels the result `inferred` so the UI never overstates. */ export declare function classifyOrigin(decision: SpendDecision): { origin: TokenOrigin; inferred: boolean; }; /** Cents this decision actually cost the org: settled actuals win over the * pre-dispatch projection; blocked calls cost zero. */ export declare function decisionCents(decision: SpendDecision): number; export interface BucketSpend { key: string; cents: number; calls: number; } export interface CfoDashboard { generatedAt: string; windowStart: string | null; windowEnd: string | null; totals: { calls: number; spentCents: number; frontierCents: number; darkCents: number; darkSharePct: number; inferredCents: number; }; enforcement: { allowed: number; downgraded: number; blocked: number; shadow: number; /** Cents NOT spent because a call was blocked or downgraded — the ROI line. */ estimatedSavedCents: number; }; trueUp: { reservedCents: number; settledCents: number; driftCents: number; }; byHour: BucketSpend[]; byModel: BucketSpend[]; byProvider: BucketSpend[]; byBuilderCode: BucketSpend[]; scopeKeyBreakdown: BucketSpend[]; integrity: { verified: boolean; entries: number; reason?: string; sequence?: number; /** Completeness signal: missing per-signer sequence numbers (possible omitted actions). */ sequenceGaps?: number[]; }; } /** * Build the CFO dashboard from signed ledger entries. Pure + synchronous. * `integrity` is passed in (compute via verifyChain, which is async) so this * stays a pure function; pass null to skip. */ export declare function aggregateLedger(entries: SignedDecisionLogEntry[], integrity?: CfoDashboard['integrity'] | null, now?: string): CfoDashboard; export declare const centsToUsd: (c: number) => string; //# sourceMappingURL=aggregate.d.ts.map