import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
/**
 * Context window health state derived from utilization percentage.
 *
 * Matches the thresholds documented in context.proto (ContextInfo.utilization_percent):
 * - 0-70%:  healthy (green)
 * - 70-90%: warning (yellow, approaching summarization threshold)
 * - 90%+:   critical (red, at or above trigger threshold)
 */
export type ContextHealth = "healthy" | "warning" | "critical";
/** Normalized view of a single summarization event for rendering. */
export interface SummarizationEventView {
    readonly timestamp: string;
    readonly tokensBefore: number;
    readonly tokensAfter: number;
    readonly compressionRatio: number;
    readonly durationMs: number;
    readonly model: string;
    readonly messagesBefore: number;
    readonly messagesAfter: number;
    readonly costUsd: number;
}
/** Return value of {@link useContextWindow}. */
export interface UseContextWindowReturn {
    /** `true` when real `ContextInfo` data is available (native harness). */
    readonly hasContextInfo: boolean;
    /** Current token count in the context window. 0 when unavailable. */
    readonly currentTokenCount: number;
    /** Model's maximum context window size in tokens. 0 when unavailable. */
    readonly contextWindowLimit: number;
    /** Context utilization as a percentage (0-100). 0 when unavailable. */
    readonly utilizationPercent: number;
    /** Token threshold that triggers summarization. 0 when unavailable. */
    readonly triggerThreshold: number;
    /** Target token count after summarization. 0 when unavailable. */
    readonly targetTokens: number;
    /** Whether automatic summarization is enabled for this execution. */
    readonly summarizationEnabled: boolean;
    /** Summarization events ordered chronologically (oldest first). */
    readonly summarizationEvents: readonly SummarizationEventView[];
    /** Derived health state based on utilization thresholds. */
    readonly health: ContextHealth;
    /** `true` when utilization is within 5% of the trigger threshold. */
    readonly isNearThreshold: boolean;
}
/**
 * Extracts context window information from an execution's status.
 *
 * Provides real-time visibility into context utilization, summarization
 * thresholds, and summarization history for the native harness. Returns
 * a stable empty state when `ContextInfo` is absent (e.g., Cursor harness
 * where context is managed externally).
 *
 * The derived `health` and `isNearThreshold` fields are intended for
 * driving visual indicators (gauge color, alert badges) without coupling
 * rendering components to threshold arithmetic.
 *
 * @param execution - The execution snapshot from `useExecutionStream`, or `null`.
 *
 * @example
 * ```tsx
 * const { execution } = useExecutionStream(executionId);
 * const ctx = useContextWindow(execution);
 *
 * if (ctx.hasContextInfo) {
 *   return <ContextGauge {...ctx} />;
 * }
 * ```
 */
export declare function useContextWindow(execution: AgentExecution | null): UseContextWindowReturn;
//# sourceMappingURL=useContextWindow.d.ts.map