import type { CollabSessionState } from "../../../collab/protocol";
import type { StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle } from "../../../config/settings-schema";
import type { AgentSession } from "../../../session/agent-session";
export type { StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle };
/** Collab session indicator + (guest-only) host-state override for segments. */
export interface CollabStatus {
    role: "host" | "guest";
    participantCount: number;
    /** Guest only: host footer snapshot that overrides locally computed values. */
    stateOverride?: CollabSessionState | null;
}
export interface StatusLineSegmentOptions {
    model?: {
        showThinkingLevel?: boolean;
    };
    path?: {
        abbreviate?: boolean;
        maxLength?: number;
        stripWorkPrefix?: boolean;
    };
    git?: {
        showBranch?: boolean;
        showStaged?: boolean;
        showUnstaged?: boolean;
        showUntracked?: boolean;
    };
    time?: {
        format?: "12h" | "24h";
        showSeconds?: boolean;
    };
}
export interface StatusLineSettings {
    preset?: StatusLinePreset;
    leftSegments?: StatusLineSegmentId[];
    rightSegments?: StatusLineSegmentId[];
    separator?: StatusLineSeparatorStyle;
    segmentOptions?: StatusLineSegmentOptions;
    showHookStatus?: boolean;
    sessionAccent?: boolean;
    /** Drop the theme's `statusLineBg` fill and powerline caps so the bar
     *  inherits the terminal's default background. */
    transparent?: boolean;
}
export type EffectiveStatusLineSettings = Required<Pick<StatusLineSettings, "leftSegments" | "rightSegments" | "separator" | "segmentOptions">> & StatusLineSettings;
export type RGB = readonly [number, number, number];
export interface SegmentContext {
    session: AgentSession;
    /** Focused subagent id while the view is proxied at its session, undefined otherwise. */
    focusedAgentId?: string | undefined;
    width: number;
    options: StatusLineSegmentOptions;
    planMode: {
        enabled: boolean;
        paused: boolean;
    } | null;
    loopMode: {
        enabled: boolean;
    } | null;
    goalMode: {
        enabled: boolean;
        paused: boolean;
    } | null;
    collab: CollabStatus | null;
    usageStats: {
        input: number;
        output: number;
        cacheRead: number;
        cacheWrite: number;
        premiumRequests: number;
        cost: number;
        tokensPerSecond: number | null;
    };
    /** Context usage percent, or null when unknown (e.g. right after compaction). */
    contextPercent: number | null;
    contextWindow: number;
    autoCompactEnabled: boolean;
    subagentCount: number;
    sessionStartTime: number;
    git: {
        branch: string | null;
        status: {
            staged: number;
            unstaged: number;
            untracked: number;
        } | null;
        pr: {
            number: number;
            url: string;
        } | null;
    };
    usage: {
        fiveHour?: {
            percent: number;
            resetMinutes?: number;
        };
        sevenDay?: {
            percent: number;
            resetHours?: number;
        };
    } | null;
}
export interface RenderedSegment {
    content: string;
    visible: boolean;
}
export interface StatusLineSegment {
    id: StatusLineSegmentId;
    render(ctx: SegmentContext): RenderedSegment;
}
export interface SeparatorDef {
    left: string;
    right: string;
    endCaps?: {
        left: string;
        right: string;
        useBgAsFg: boolean;
    };
}
export interface PresetDef {
    leftSegments: StatusLineSegmentId[];
    rightSegments: StatusLineSegmentId[];
    separator: StatusLineSeparatorStyle;
    segmentOptions?: StatusLineSegmentOptions;
}
