import { type SpeechAccountingOptions, type SpeechAllocatorReceipt, type SpeechHold, type SpeechOperation } from './admission.js'; import { type SpeechUsage, type SpeechUsageUpdate } from './usage.js'; export interface SpeechSettlementEntry { readonly entryRef: string; readonly operation: SpeechOperation; readonly campaignRef: string; readonly utcDay: string; readonly kind: 'estimate' | 'final' | 'adjustment'; readonly rootEntryRef?: string; readonly revision: number; readonly providerRevision?: number; readonly pricingRevision: string; readonly costMicroUsd: number; readonly deltaMicroUsd: number; readonly uncertain: boolean; readonly usage?: SpeechUsage; readonly countedUnitDelta: 0; readonly outcome: 'completed' | 'cancelled' | 'failed' | 'unknown'; readonly overrun: boolean; } export interface SpeechSettlementRequest { readonly operationId: string; readonly usage?: SpeechUsage; readonly providerRevision?: number; readonly outcome: SpeechSettlementEntry['outcome']; } export interface SpeechReconciliationRow { readonly operationId: string; readonly attemptId: string; readonly allocatorReceiptRef: string; readonly submitKey: string; readonly coordinatorEpoch: number; readonly entryRefs: readonly string[]; readonly issues: readonly ('orphan-usage' | 'allocator-mismatch' | 'duplicate-allocator-receipt' | 'uncounted-admission' | 'duplicate-usage-receipt' | 'orphan-adjustment' | 'missing-usage')[]; } /** L7 supplies a complete, consistent owner snapshot; this projection never writes or counts units. */ export declare const reconcileSpeech: (admissions: readonly SpeechHold[], allocatorReceipts: readonly SpeechAllocatorReceipt[], usageReceipts: readonly SpeechSettlementEntry[]) => SpeechReconciliationRow[]; /** Usage updates are operational evidence on the existing hold; they never charge or allocate units. */ export declare const recordSpeechUsage: (options: SpeechAccountingOptions, operationId: string, input: SpeechUsageUpdate) => Promise; /** Missing final usage consumes the conservative hold, never zero. Adjustments debit only the difference. */ export declare const settleSpeech: (options: SpeechAccountingOptions, input: SpeechSettlementRequest) => Promise; /** Only a never-dispatched hold may be released for zero; Stop itself needs no new admission. */ export declare const releaseSpeech: (options: SpeechAccountingOptions, operationId: string) => Promise; //# sourceMappingURL=settlement.d.ts.map