/**
 * SpendRecord type and SpendEmitter
 *
 * Foundation for multi-model spend tracking. SpendRecord captures per-request
 * cost data across all LLM providers. SpendEmitter is a singleton EventEmitter
 * that decouples tracking from persistence and alerting.
 */
import { EventEmitter } from 'events';
/**
 * Unified spend record for any LLM provider request
 */
export interface SpendRecord {
    /** Unique record ID (UUID v4) */
    id: string;
    /** ISO 8601 timestamp */
    timestamp: string;
    /** Provider identifier */
    provider: string;
    /** Full model ID */
    model: string;
    /** Input token count */
    input_tokens: number;
    /** Output token count */
    output_tokens: number;
    /** Cached input tokens read (discount pricing) */
    cached_tokens: number;
    /** Cache write tokens (surcharge pricing) */
    cache_write_tokens: number;
    /** Reasoning/thinking tokens */
    reasoning_tokens: number;
    /** Calculated cost in USD */
    cost_usd: number;
    /** How cost was determined */
    cost_source: 'calculated' | 'api_reported' | 'unknown' | 'local';
    /** SpecWeave project name */
    project?: string;
    /** Increment ID if in increment context */
    increment_id?: string;
    /** Session identifier */
    session_id?: string;
    /** Request duration in milliseconds */
    duration_ms?: number;
}
/**
 * Input for creating a SpendRecord (required fields + optional overrides)
 */
export interface SpendRecordInput {
    provider: string;
    model: string;
    input_tokens: number;
    output_tokens: number;
    cached_tokens?: number;
    cache_write_tokens?: number;
    reasoning_tokens?: number;
    cost_usd: number;
    cost_source: SpendRecord['cost_source'];
    project?: string;
    increment_id?: string;
    session_id?: string;
    duration_ms?: number;
}
/**
 * Create a SpendRecord with generated ID and timestamp
 */
export declare function createSpendRecord(input: SpendRecordInput): SpendRecord;
/**
 * Singleton EventEmitter for spend tracking events.
 * Decouples spend record creation from persistence and alerting.
 */
export declare class SpendEmitter extends EventEmitter {
    private static instance;
    private constructor();
    static getInstance(): SpendEmitter;
    /** Type-safe emit for spend events */
    emitSpend(record: SpendRecord): boolean;
    /** Type-safe listener registration */
    onSpend(listener: (record: SpendRecord) => void): this;
    /** Type-safe listener removal */
    offSpend(listener: (record: SpendRecord) => void): this;
}
//# sourceMappingURL=spend-record.d.ts.map