import type { Logger } from "pino";
import { type AgentCapabilityFlags, type AgentClient, type AgentLaunchContext, type AgentMode, type AgentModelDefinition, type AgentPermissionRequest, type AgentPermissionResponse, type AgentPersistenceHandle, type AgentPromptInput, type AgentRunOptions, type AgentRunResult, type AgentRuntimeInfo, type AgentSession, type AgentSessionConfig, type AgentSlashCommand, type AgentStreamEvent, type ListPersistedAgentsOptions, type ListModesOptions, type ListModelsOptions, type PersistedAgentDescriptor } from "../../agent-sdk-types.js";
import { type ProviderRuntimeSettings } from "../../provider-launch-config.js";
import type { PiRuntime, PiRuntimeSession } from "./runtime.js";
import type { PiSessionState } from "./rpc-types.js";
interface PiRpcAgentClientOptions {
    logger: Logger;
    runtimeSettings?: ProviderRuntimeSettings;
    runtime?: PiRuntime;
}
interface StartTurnResult {
    turnId: string;
}
interface PiRpcAgentSessionOptions {
    runtimeSession: PiRuntimeSession;
    config: AgentSessionConfig;
    initialState: PiSessionState;
    capabilities: AgentCapabilityFlags;
    cleanup?: () => void;
}
export declare function transformPiModels(models: AgentModelDefinition[]): AgentModelDefinition[];
export declare class PiRpcAgentSession implements AgentSession {
    readonly provider = "pi";
    readonly capabilities: AgentCapabilityFlags;
    private readonly subscribers;
    private readonly activeToolCalls;
    private readonly pendingExtensionUiRequests;
    private activeAskUserDialog;
    private pendingCombinedAskUserResponse;
    private activeTurnId;
    private lastKnownThinkingOptionId;
    currentLeafOverrideId: string | null | undefined;
    private readonly capturedUserEntries;
    private readonly capturedUserEntriesById;
    private readonly seenUserEntryIds;
    private readonly pendingUserMessages;
    private readonly pendingExtensionResults;
    private state;
    private closed;
    constructor(options: PiRpcAgentSessionOptions);
    private readonly runtimeSession;
    private readonly config;
    private readonly cleanup?;
    get id(): string | null;
    run(prompt: AgentPromptInput, options?: AgentRunOptions): Promise<AgentRunResult>;
    startTurn(prompt: AgentPromptInput, _options?: AgentRunOptions): Promise<StartTurnResult>;
    subscribe(callback: (event: AgentStreamEvent) => void): () => void;
    streamHistory(): AsyncGenerator<AgentStreamEvent>;
    getRuntimeInfo(): Promise<AgentRuntimeInfo>;
    getAvailableModes(): Promise<AgentMode[]>;
    getCurrentMode(): Promise<string | null>;
    setMode(modeId: string): Promise<void>;
    getPendingPermissions(): AgentPermissionRequest[];
    respondToPermission(requestId: string, response: AgentPermissionResponse): Promise<void>;
    describePersistence(): AgentPersistenceHandle | null;
    interrupt(): Promise<void>;
    revertConversation(input: {
        messageId: string;
    }): Promise<void>;
    private runPiTreeExtensionCommand;
    close(): Promise<void>;
    listCommands(): Promise<AgentSlashCommand[]>;
    setModel(modelId: string | null): Promise<void>;
    setThinkingOption(thinkingOptionId: string | null): Promise<void>;
    private emit;
    private currentTurnIdForEvent;
    private requestEntryCapture;
    private waitForExtensionResult;
    private resolveExtensionResult;
    private rejectExtensionResult;
    private rejectAllExtensionResults;
    private recordCapturedUserEntries;
    private flushPendingUserMessages;
    private handleEntryCaptureMarker;
    private handleCommandResultMarker;
    private handleExtensionUiRequest;
    private respondToCombinedAskUserFollowUp;
    private handleRuntimeEvent;
    private handleProcessExit;
    private handleSessionEvent;
    private handleMessageUpdate;
    private handleMessageEnd;
    private emitToolCallEvent;
    private completeTurn;
    private refreshState;
    private refreshAfterTurn;
}
export declare class PiRpcAgentClient implements AgentClient {
    readonly provider = "pi";
    readonly capabilities: AgentCapabilityFlags;
    private readonly logger;
    private readonly runtimeSettings?;
    private readonly runtime;
    constructor(options: PiRpcAgentClientOptions);
    createSession(config: AgentSessionConfig, launchContext?: AgentLaunchContext): Promise<AgentSession>;
    resumeSession(handle: AgentPersistenceHandle, overrides?: Partial<AgentSessionConfig>, _launchContext?: AgentLaunchContext): Promise<AgentSession>;
    listModels(options: ListModelsOptions): Promise<AgentModelDefinition[]>;
    listModes(_options: ListModesOptions): Promise<AgentMode[]>;
    listPersistedAgents(_options?: ListPersistedAgentsOptions): Promise<PersistedAgentDescriptor[]>;
    isAvailable(): Promise<boolean>;
    getDiagnostic(): Promise<{
        diagnostic: string;
    }>;
    private prepareMcpConfig;
    private detectMcpAdapter;
    private resolvePiLaunch;
}
export {};
//# sourceMappingURL=agent.d.ts.map