import type { ThinkingLevel } from "@sheason/pi-agent-core";
import type { Api, Model } from "@sheason/pi-ai";
import { type AgentSessionEvent, type AgentSessionRuntimeDiagnostic, type AgentSessionServices, type CompactionResult, type LoadExtensionsResult, type ModelCycleResult } from "@sheason/pi-coding-agent";
import { HubResourceLoader } from "../resources/hub-resource-loader.js";
import type { LiveRenderEvent } from "../transport/live-events.js";
import { type CreateHubAgentAdapterOptions, type HubAgentAdapterApi, type InputQueueFlushResult, type MessageSourceMetadata, type QueuedInputMessage } from "./types.js";
export declare function mapAgentSessionEventToLiveRenderEvent(event: AgentSessionEvent): LiveRenderEvent | undefined;
export declare class HubAgentAdapter implements HubAgentAdapterApi {
    readonly session: import("@sheason/pi-coding-agent").AgentSession;
    readonly services: AgentSessionServices;
    readonly extensionsResult: LoadExtensionsResult;
    readonly resourceLoader: HubResourceLoader;
    readonly diagnostics: readonly AgentSessionRuntimeDiagnostic[];
    /** Hub tool catalog, including static D-Pi tools and dynamic MCP tools. */
    private readonly tools;
    /** Dynamic MCP tools passed by reference to AgentSession customTools. */
    private readonly dynamicTools;
    private readonly sessionService;
    private readonly refreshModelsConfig?;
    private readonly refreshSources?;
    private readonly refreshMcp?;
    private readonly beforeInputQueueDrain?;
    private readonly agentId;
    private readonly logs;
    private readonly onModelChange?;
    private readonly sessionLogger;
    private readonly unsubscribeSessionEvents;
    private readonly liveEventListeners;
    private readonly inputQueue;
    private _steeringShadow;
    private _followUpShadow;
    private inputQueuePumpPromise;
    private explicitFlushDepth;
    private readonly queuedInputTimes;
    private activeAssistantLiveMessageId;
    private assistantLiveMessageSeq;
    private readonly activeMessageLiveIds;
    private messageLiveSeq;
    private abortPromise;
    /** Timestamp (ms) of the last throttled sync triggered by message_update for contextUsage updates. */
    private lastMessageUpdateSyncMs;
    private static readonly MESSAGE_UPDATE_SYNC_INTERVAL_MS;
    private constructor();
    static create(options: CreateHubAgentAdapterOptions): Promise<HubAgentAdapter>;
    enqueueFromPeer(peerId: string, text: string, metadata?: MessageSourceMetadata, images?: QueuedInputMessage["images"], queueMode?: "steer" | "followUp"): Promise<void>;
    enqueueFromHost(hostId: string, text: string, metadata?: MessageSourceMetadata, images?: QueuedInputMessage["images"], queueMode?: "steer" | "followUp"): Promise<void>;
    enqueueFromSource(sourceName: string, text: string): Promise<void>;
    enqueueFromAgent(agentId: string, text: string, options?: {
        messageId?: string;
        responseIds?: string[];
        responseTimeout?: number;
    }): Promise<void>;
    continueCurrentTranscript(): void;
    requestInputQueuePump(): void;
    flushInputQueue(): Promise<InputQueueFlushResult>;
    private startInputQueueFlush;
    private runInputQueueFlush;
    dequeue(): Promise<QueuedInputMessage[]>;
    private enqueueInput;
    private getQueuedInputMessageCount;
    private getUserMessageText;
    private drainInputQueue;
    private drainNextInputMessage;
    private restoreInputQueue;
    private scheduleInputQueuePump;
    private scheduleInputQueuePumpAfterSessionSettles;
    private scheduleInputQueuePumpWhenIdle;
    private ensureInputQueuePump;
    private pumpInputQueue;
    private promptQueuedInputMessages;
    private logQueueSubmit;
    private getQueueWaitMs;
    private log;
    abort(): Promise<void>;
    private abortActiveSession;
    setModel(model: Model<Api>): Promise<void>;
    cycleModel(direction?: "forward" | "backward"): Promise<ModelCycleResult | undefined>;
    setThinkingLevel(level: ThinkingLevel): void;
    cycleThinkingLevel(): ThinkingLevel | undefined;
    compact(customInstructions?: string): Promise<CompactionResult>;
    reload(): Promise<void>;
    getAvailableModels(): Promise<Model<Api>[]>;
    private refreshCurrentModelFromRegistry;
    private syncDynamicTools;
    subscribeLiveEvents(listener: (event: LiveRenderEvent) => void): () => void;
    dispose(): void;
    private handleSessionEvent;
    private emitLiveRenderEventForSessionEvent;
    private mapSessionEventToLiveRenderEvent;
    private getLiveMessageId;
    refreshSessionOptions(): Promise<void>;
}
//# sourceMappingURL=hub-agent-adapter.d.ts.map