import type { UserContent } from "ai";
import { type SessionState } from "#client/index.js";
import type { ClientSession } from "#client/session.js";
import type { HandleMessageStreamEvent } from "#protocol/message.js";
import type { InputResponse } from "#runtime/input/types.js";
import type { JsonObject } from "#shared/json.js";
/**
 * Result returned after one development-client message exchange.
 */
export interface DevelopmentClientSendResult {
    readonly events: HandleMessageStreamEvent[];
    readonly sessionId: string;
    readonly session: SessionState;
}
/**
 * Stable service-style client for the Eve development message protocol.
 */
export interface DevelopmentMessageClient {
    /**
     * Clears the current durable session cursor.
     */
    clear(): Promise<void>;
    /**
     * Closes the client and disposes any session-attached resources.
     */
    close(): Promise<void>;
    /**
     * Returns the current durable session cursor.
     */
    getSession(): SessionState;
    /**
     * Sends one turn payload through the active development session.
     */
    send(input: {
        readonly clientContext?: string | readonly string[] | JsonObject;
        readonly inputResponses?: readonly InputResponse[];
        readonly message?: string | UserContent;
        onEvent?(event: HandleMessageStreamEvent): void;
        onResponseStart?(response: {
            sessionId?: string;
        }): void;
    }): Promise<DevelopmentClientSendResult>;
}
/**
 * Tracks local dev runtime-artifact revisions and starts a fresh session for
 * normal prompts after HMR, while preserving the current session for
 * input-response resumes.
 */
export interface DevelopmentRuntimeArtifactSessionRefresher {
    /**
     * Clears the remembered runtime-artifact revision.
     */
    clear(): void;
    /**
     * Returns the session that should dispatch the next turn.
     */
    refresh(input: {
        readonly createSession: () => ClientSession;
        readonly inputResponses?: readonly InputResponse[];
        readonly message?: string | UserContent;
        readonly onRuntimeArtifactsChanged?: (change: DevelopmentRuntimeArtifactChange) => void | Promise<void>;
        readonly session: ClientSession;
    }): Promise<ClientSession>;
    /**
     * Checks for a runtime-artifact revision change while the UI is idle.
     */
    refreshIdle(input: {
        readonly createSession: () => ClientSession;
        readonly onRuntimeArtifactsChanged?: (change: DevelopmentRuntimeArtifactChange) => void | Promise<void>;
        readonly session: ClientSession;
    }): Promise<ClientSession>;
}
export interface DevelopmentRuntimeArtifactChange {
    readonly previousRevision: string;
    readonly revision: string;
}
/**
 * Creates a revision-aware local dev session refresher.
 */
export declare function createDevelopmentRuntimeArtifactSessionRefresher(input: {
    readonly serverUrl: string;
}): DevelopmentRuntimeArtifactSessionRefresher;
/**
 * Creates a stateful development client bound to one Eve server URL.
 */
export declare function createDevClient(input: {
    serverUrl: string;
}): DevelopmentMessageClient;
