/**
 * Session State CC session state parity.
 *
 * Unified state container for a single agent session:
 *   - Token usage / cost accumulation across turns
 *   - Session trust acceptance (per-session, non-persistent)
 *   - Session-level settings
 *
 * This module is the qlogicagent equivalent of CC's:
 *   - bootstrap/state.ts (session state fields)
 *   - cost-tracker.ts (cost accumulation + persistence)
 *   - sessionRestore.ts (cost restore guard)
 *
 * Reference: claude-code src/bootstrap/state.ts, src/cost-tracker.ts
 */
import type { WireTokenUsage as TokenUsage } from "../../protocol/wire/index.js";
/** Per-model usage accumulation CC modelUsage parity */
export interface ModelUsage {
    inputTokens: number;
    outputTokens: number;
    cacheRead: number;
    cacheCreation: number;
    /** Media generation call count (image/video/music/tts/3d) */
    mediaCalls: number;
    /** Total seconds of media output (video, music) */
    mediaDurationSeconds: number;
    /** Total characters processed (TTS) */
    mediaCharacters: number;
}
/** Snapshot of the session state for persistence / restore */
export interface SessionUsageSnapshot {
    sessionId: string;
    modelUsage: Record<string, ModelUsage>;
    totalInputTokens: number;
    totalOutputTokens: number;
    turnCount: number;
    lastSavedAt: number;
}
export declare class SessionState {
    readonly sessionId: string;
    private _trustAccepted;
    private _modelUsage;
    private _totalInputTokens;
    private _totalOutputTokens;
    private _turnCount;
    private _toolCallCount;
    private _listeners;
    constructor(sessionId: string);
    get trustAccepted(): boolean;
    setTrustAccepted(accepted: boolean): void;
    get totalInputTokens(): number;
    get totalOutputTokens(): number;
    get turnCount(): number;
    get toolCallCount(): number;
    /** Get usage for a specific model */
    getModelUsage(model: string): ModelUsage | undefined;
    /** Get all model usages as a plain object */
    getAllModelUsage(): Record<string, ModelUsage>;
    /**
     * Add usage from an API response CC addToTotalSessionCost() parity.
     * Tracks token counts only; pricing is handled by Hub/Admin.
     *
     * @param usage - Token counts from the API response
     * @param model - Model identifier
     */
    addUsage(usage: TokenUsage, model: string): void;
    /**
     * Add usage from a media generation call (non-token billing).
     * Tracks quantities only (calls, seconds, characters); pricing is Hub/Admin's job.
     */
    addMediaUsage(model: string, billingUnit: string, quantity: number): void;
    /** Record a tool call */
    recordToolCall(): void;
    /** Increment turn count */
    recordTurnCompleted(): void;
    /**
     * Create a snapshot for persistence.
     * CC saveCurrentSessionCosts() parity.
     */
    createSnapshot(): SessionUsageSnapshot;
    /**
     * Restore from a previous snapshot.
     * CC setCostStateForRestore() parity.
     *
     * GUARD: Only restores if the snapshot's sessionId matches this session.
     * Prevents cross-session cost leakage (CC's lastSessionId guard).
     */
    restoreFromSnapshot(snapshot: SessionUsageSnapshot): boolean;
    /** Register a state change listener. Returns unsubscribe function. */
    onStateChange(listener: () => void): () => void;
    private notifyListeners;
}
/**
 * Create a new session state instance.
 */
export declare function createSessionState(sessionId: string): SessionState;
