import { CancellationToken } from "../../../../../base/common/cancellation.js";
import { Event } from "../../../../../base/common/event.js";
import { IObservable } from "../../../../../base/common/observable.js";
import { URI } from "../../../../../base/common/uri.js";
import { ChatAgentLocation } from "../constants.js";
import { IChatEditingSession } from "../editing/chatEditingService.js";
import { IChatModel, IExportableChatData, ISerializableChatData, IChatRequestModel, IChatRequestVariableData } from "../model/chatModel.js";
import { IParsedChatRequest } from "../requestParser/chatParserTypes.js";
import { IChatSessionStartOptions, IChatModelReference, IChatSessionContext, IChatSendRequestOptions, ChatSendResult, IChatProgress, ChatRequestQueueKind, IChatCompleteResponse, IChatDetail, IChatUserActionEvent } from "./chatService.js";
export declare const IChatService: import("../../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier<IChatService>;
export interface IChatService {
    _serviceBrand: undefined;
    transferredSessionResource: URI | undefined;
    readonly onDidSubmitRequest: Event<{
        readonly chatSessionResource: URI;
    }>;
    readonly onDidCreateModel: Event<IChatModel>;
    /**
    * An observable containing all live chat models.
    */
    readonly chatModels: IObservable<Iterable<IChatModel>>;
    isEnabled(location: ChatAgentLocation): boolean;
    hasSessions(): boolean;
    startSession(location: ChatAgentLocation, options?: IChatSessionStartOptions): IChatModelReference;
    /**
    * Get an active session without holding a reference to it.
    */
    getSession(sessionResource: URI): IChatModel | undefined;
    /**
    * Acquire a reference to an active session.
    */
    getActiveSessionReference(sessionResource: URI): IChatModelReference | undefined;
    getOrRestoreSession(sessionResource: URI): Promise<IChatModelReference | undefined>;
    getSessionTitle(sessionResource: URI): string | undefined;
    loadSessionFromContent(data: IExportableChatData | ISerializableChatData | URI): IChatModelReference | undefined;
    loadSessionForResource(resource: URI, location: ChatAgentLocation, token: CancellationToken): Promise<IChatModelReference | undefined>;
    readonly editingSessions: IChatEditingSession[];
    getChatSessionFromInternalUri(sessionResource: URI): IChatSessionContext | undefined;
    /**
    * Sends a chat request for the given session.
    * @returns A result indicating whether the request was sent, queued, or rejected.
    */
    sendRequest(sessionResource: URI, message: string, options?: IChatSendRequestOptions): Promise<ChatSendResult>;
    /**
    * Sets a custom title for a chat model.
    */
    setTitle(sessionResource: URI, title: string): void;
    appendProgress(request: IChatRequestModel, progress: IChatProgress): void;
    resendRequest(request: IChatRequestModel, options?: IChatSendRequestOptions): Promise<void>;
    adoptRequest(sessionResource: URI, request: IChatRequestModel): Promise<void>;
    removeRequest(sessionResource: URI, requestId: string): Promise<void>;
    cancelCurrentRequestForSession(sessionResource: URI): void;
    /**
    * Sets yieldRequested on the active request for the given session.
    */
    setYieldRequested(sessionResource: URI): void;
    /**
    * Removes a pending request from the session's queue.
    */
    removePendingRequest(sessionResource: URI, requestId: string): void;
    /**
    * Sets the pending requests for a session, allowing for deletions/reordering.
    * Adding new requests should go through sendRequest with the queue option.
    */
    setPendingRequests(sessionResource: URI, requests: readonly {
        requestId: string;
        kind: ChatRequestQueueKind;
    }[]): void;
    /**
    * Ensures pending requests for the session are processing. If restoring from
    * storage or after an error, pending requests may be present without an
    * active chat message 'loop' happening. THis triggers the loop to happen
    * as needed. Idempotent, safe to call at any time.
    */
    processPendingRequests(sessionResource: URI): void;
    addCompleteRequest(sessionResource: URI, message: IParsedChatRequest | string, variableData: IChatRequestVariableData | undefined, attempt: number | undefined, response: IChatCompleteResponse): void;
    setChatSessionTitle(sessionResource: URI, title: string): void;
    getLocalSessionHistory(): Promise<IChatDetail[]>;
    clearAllHistoryEntries(): Promise<void>;
    removeHistoryEntry(sessionResource: URI): Promise<void>;
    getChatStorageFolder(): URI;
    logChatIndex(): void;
    getLiveSessionItems(): Promise<IChatDetail[]>;
    getHistorySessionItems(): Promise<IChatDetail[]>;
    getMetadataForSession(sessionResource: URI): Promise<IChatDetail | undefined>;
    readonly onDidPerformUserAction: Event<IChatUserActionEvent>;
    notifyUserAction(event: IChatUserActionEvent): void;
    readonly onDidReceiveQuestionCarouselAnswer: Event<{
        requestId: string;
        resolveId: string;
        answers: Record<string, unknown> | undefined;
    }>;
    notifyQuestionCarouselAnswer(requestId: string, resolveId: string, answers: Record<string, unknown> | undefined): void;
    readonly onDidDisposeSession: Event<{
        readonly sessionResource: URI[];
        readonly reason: "cleared";
    }>;
    transferChatSession(transferredSessionResource: URI, toWorkspace: URI): Promise<void>;
    activateDefaultAgent(location: ChatAgentLocation): Promise<void>;
    readonly edits2Enabled: boolean;
    readonly requestInProgressObs: IObservable<boolean>;
    /**
    * For tests only!
    */
    setSaveModelsEnabled(enabled: boolean): void;
    /**
    * For tests only!
    */
    waitForModelDisposals(): Promise<void>;
}
