import type { Agent0CatalogModel, Agent0AbortSessionResult, Agent0CommandListResult, Agent0Config, Agent0CreateSessionInput, Agent0Message, Agent0QuestionListResult, Agent0RejectQuestionResult, Agent0ReplyQuestionInput, Agent0ReplyQuestionResult, Agent0RunCommandInput, Agent0RuntimeEvent, Agent0RuntimeEventStreamOptions, Agent0ProjectPaths, Agent0SendMessageInput, Agent0Session, Agent0SessionMessageListResult, Agent0SessionListResult, Agent0Warning } from '../types.js';
import { AdkError } from '@botpress/analytics';
import { type Agent0RuntimeClient, type Agent0RuntimeStatus } from './client.js';
export type Agent0RuntimeManagerState = 'stopped' | 'starting' | 'running' | 'restarting' | 'stopping' | 'unavailable';
export type Agent0RuntimeManagerErrorCode = 'RUNTIME_NOT_RUNNING' | 'RUNTIME_START_FAILED';
export interface Agent0RuntimeManagerConfigStore {
    read(): Promise<Agent0Config>;
}
export interface Agent0RuntimeManagerCatalogSource {
    listModelsWithStatus(): Promise<{
        models: Agent0CatalogModel[];
        warnings: Agent0Warning[];
    }>;
}
export type Agent0RuntimeManagerProjectDirsResolver = (agentPath: string) => Promise<Agent0ProjectPaths>;
export type Agent0RuntimeManagerStarter = (options: {
    paths: Agent0ProjectPaths;
    agentPath: string;
    adkDevConsolePort: number;
    agent0Config: Agent0Config;
    cognitiveModels?: Agent0CatalogModel[];
    startupTimeoutMs?: number;
    onLog?: (message: string) => void;
}) => Promise<Agent0RuntimeClient>;
export interface Agent0RuntimeManagerOptions {
    agentPath: string;
    adkDevConsolePort: number;
    startupTimeoutMs?: number;
    onLog?: (message: string) => void;
    configStore?: Agent0RuntimeManagerConfigStore;
    resolveProjectDirs?: Agent0RuntimeManagerProjectDirsResolver;
    cognitiveSource?: Agent0RuntimeManagerCatalogSource;
    startRuntimeClient?: Agent0RuntimeManagerStarter;
}
export interface Agent0RuntimeManagerSnapshot {
    state: Agent0RuntimeManagerState;
    engineGeneration: number;
    configVersion?: string;
    warnings: Agent0Warning[];
    error?: string;
}
export declare class Agent0RuntimeManagerError extends AdkError<Agent0RuntimeManagerErrorCode> {
    constructor(code: Agent0RuntimeManagerErrorCode, message: string, options?: {
        cause?: unknown;
    });
}
export declare class Agent0RuntimeManager implements Agent0RuntimeClient {
    private readonly options;
    private state;
    private client;
    private operation;
    private engineGeneration;
    private configVersion;
    private warnings;
    private lastError;
    constructor(options: Agent0RuntimeManagerOptions);
    start(): Promise<Agent0RuntimeClient>;
    restart(): Promise<Agent0RuntimeClient>;
    invalidate(): Promise<void>;
    stop(): Promise<void>;
    getStatus(): Promise<Agent0RuntimeStatus>;
    listSessions(): Promise<Agent0SessionListResult>;
    createSession(input?: Agent0CreateSessionInput): Promise<Agent0Session>;
    listMessages(sessionId: string): Promise<Agent0SessionMessageListResult>;
    sendMessage(sessionId: string, input: Agent0SendMessageInput): Promise<Agent0Message>;
    abortSession(sessionId: string): Promise<Agent0AbortSessionResult>;
    listQuestions(sessionId?: string): Promise<Agent0QuestionListResult>;
    replyQuestion(sessionId: string, questionId: string, input: Agent0ReplyQuestionInput): Promise<Agent0ReplyQuestionResult>;
    rejectQuestion(sessionId: string, questionId: string): Promise<Agent0RejectQuestionResult>;
    listCommands(): Promise<Agent0CommandListResult>;
    runCommand(sessionId: string, input: Agent0RunCommandInput): Promise<Agent0Message>;
    streamEvents(options?: Agent0RuntimeEventStreamOptions): AsyncIterable<Agent0RuntimeEvent>;
    getSnapshot(): Agent0RuntimeManagerSnapshot;
    private startUnlocked;
    private stopUnlocked;
    private resolveCognitiveModels;
    private enqueue;
    private toNotRunningError;
    private cloneWarnings;
}
//# sourceMappingURL=manager.d.ts.map