/**
 * UI bridge: NEW runtime state -> OLD react-ink message shapes.
 *
 * The copied react-ink TUI renders an `AgentMessage[]` (the union from
 * "indusagi/agent": UserMessage | AssistantMessage | ToolResultMessage |
 * BranchSummaryMessage | CompactionSummaryMessage | CustomMessage |
 * BashExecutionMessage). It discriminates content blocks by a `type` tag
 * ("text" | "image" | "thinking" | "toolCall") — see
 * react-ink/utils/message-groups.ts.
 *
 * The new runtime exposes a `RunSnapshot` whose `messages` are `Turn[]`
 * (user | assistant | tool), each carrying `Block[]` discriminated by a `kind`
 * tag ("text" | "thinking" | "tool_call" | "tool_result" | "image"), plus a
 * running `Usage` total and the bound model id.
 *
 * This module translates one side into the other. It is purely a *projection*
 * for rendering: required old fields the renderer does not read are filled with
 * sensible defaults (zeroed usage, "stop" reasons, best-effort timestamps).
 *
 * Imports:
 *   - NEW types from "../runtime" and "../llmgateway/contract".
 *   - OLD types from "indusagi/ai" and "indusagi/agent" (the compat shims).
 */
import type { RunSnapshot } from "../runtime";
import type { Reply, Turn, Usage as GatewayUsage } from "../llmgateway/contract";
import type { AssistantMessage, Usage as MlUsage } from "indusagi/ai";
import type { AgentMessage } from "indusagi/agent";
/**
 * Convert a single new `Turn` into the old message(s) it projects to.
 *
 * Returns an array because a tool turn fans out to one message per result. The
 * `timestamp` is a synthesized, monotonically increasing stamp (the new turns
 * carry none) so the renderer's relative ordering and time labels stay stable.
 */
export declare function turnToAgentMessages(turn: Turn, model: string, timestamp: number): AgentMessage[];
/**
 * A finalized model {@link Reply} -> old `AssistantMessage`.
 *
 * Useful for hosts that render the just-settled reply (with real usage) before
 * it is folded into the snapshot's `messages`. Carries the reply's own usage and
 * stop reason through, mapped to the old shapes.
 */
export declare function replyToAssistantMessage(reply: Reply, timestamp?: number): AssistantMessage;
/**
 * The core projection: a `RunSnapshot` -> the old `AgentMessage[]` the react-ink
 * UI renders. Turns are emitted in order; tool turns fan out to one message per
 * result. A synthetic per-turn timestamp is assigned (new turns carry none).
 */
export declare function toAgentMessages(snapshot: RunSnapshot): AgentMessage[];
/**
 * Convert a new gateway {@link GatewayUsage} into the old `indusagi/ai` `Usage`
 * shape, computing `totalTokens` and best-effort `cost` from the catalog card
 * for `model` (zeroed cost when the model is unknown).
 */
export declare function gatewayUsageToMl(usage: GatewayUsage, model: string): MlUsage;
/**
 * The shape the Footer / status line needs: the bound model id, its provider/
 * display label, the token totals (in the old `tokens` sub-shape the Footer
 * reads), the estimated cost, and the context-window utilization.
 */
export interface LiveUsage {
    /** The model id this run is bound to (e.g. "claude-…"). */
    readonly model: string;
    /** Vendor of the bound model, or "unknown" when the id is not in the catalog. */
    readonly provider: string;
    /** Human-friendly model name, falling back to the id. */
    readonly displayName: string;
    /** Token totals in the old Footer sub-shape (`SessionStats.tokens`). */
    readonly tokens: {
        readonly input: number;
        readonly output: number;
        readonly cacheRead: number;
        readonly cacheWrite: number;
        readonly total: number;
    };
    /** Estimated USD cost of the run so far. */
    readonly cost: number;
    /** The model's context window in tokens (0 when unknown). */
    readonly contextWindow: number;
    /** Billable tokens currently occupying context (input + cache tiers). */
    readonly contextTokens: number;
    /** Context utilization as a percentage of `contextWindow` (0 when unknown). */
    readonly contextPercent: number;
}
/**
 * Derive the Footer-facing live usage from a snapshot: the bound model id, its
 * catalog metadata, and the run's running token + cost totals. Pure projection
 * — safe to call on every snapshot.
 */
export declare function liveUsage(snapshot: RunSnapshot): LiveUsage;
