import { type HandleMessageStreamEvent } from "#protocol/message.js";
import type { InputRequest } from "#runtime/input/types.js";
import { type CliTheme } from "#cli/ui/output.js";
import { createDevelopmentTerminal } from "#cli/dev/repl/terminal.js";
export type ReplDisplayBlockKind = "content" | "meta";
export type LiveContentKind = "message" | "reasoning";
export interface FormattedContentEvent {
    readonly finalized: boolean;
    readonly kind: LiveContentKind;
    readonly line: string;
}
export interface TurnDisplayState {
    readonly activeLiveContentKind: LiveContentKind | null;
    readonly lastPrintedBlockKind: ReplDisplayBlockKind | null;
}
interface TurnEventRenderOptions {
    readonly isSubagent?: boolean;
    readonly sourceLabel?: string;
}
export type TurnDisplayTerminal = Pick<ReturnType<typeof createDevelopmentTerminal>, "commitLive" | "print" | "updateLive">;
export declare function formatContentEvent(theme: CliTheme, event: HandleMessageStreamEvent, options?: TurnEventRenderOptions): FormattedContentEvent | undefined;
export declare function formatEvent(theme: CliTheme, event: HandleMessageStreamEvent, options?: TurnEventRenderOptions): string | undefined;
export declare function createTurnDisplayState(): TurnDisplayState;
export declare function renderTurnEvent(input: {
    readonly event: HandleMessageStreamEvent;
    readonly options?: TurnEventRenderOptions;
    readonly state: TurnDisplayState;
    readonly terminal: TurnDisplayTerminal;
    readonly theme: CliTheme;
}): TurnDisplayState;
/**
 * Decides whether the REPL should drain in-flight subagent stream
 * subscriptions before redrawing the next user prompt.
 *
 * Returns `true` for ordinary turn boundaries (no pending input
 * requests on the parent stream). The drain ensures any final
 * subagent events — `session.completed`, `session.failed`, or
 * trailing messages — render in order with the parent boundary.
 *
 * Returns `false` when the parent's boundary carries one or more
 * pending input requests (HITL). A subagent that triggered the HITL
 * request runs in `task` mode (see `execution/subagent-tool.ts`)
 * and never emits a turn-boundary event on its own stream while
 * parked for HITL — `harness/tool-loop.ts` gates `emitTurnEpilogue`
 * on `mode === "conversation"`. Blocking on
 * `ReplSubagentStreamManager.waitForIdle()` here would stall the
 * prompt until the subagent's serverless function times out, which
 * is exactly the multi-minute delay this gate prevents.
 *
 * Subagent subscriptions stay alive across the prompt; they resume
 * rendering when the user answers and the subagent unparks.
 *
 * Exported for unit-test coverage of the gating contract.
 */
export declare function shouldDrainSubagentStreamsOnBoundary(pendingInputRequests: readonly InputRequest[]): boolean;
/**
 * Run the minimal interactive `eve dev` REPL against an Eve server.
 */
export declare function runDevelopmentRepl(input: {
    serverUrl: string;
}): Promise<void>;
export {};
