import type * as vscode from "vscode";
import { CancellationToken } from "../../../base/common/cancellation.js";
import { Disposable } from "../../../base/common/lifecycle.js";
import { UriComponents } from "../../../base/common/uri.js";
import { IExtensionDescription } from "../../../platform/extensions/common/extensions.js";
import { ILogService } from "../../../platform/log/common/log.service.js";
import { IChatSessionProviderOptionItem } from "../../contrib/chat/common/chatSessionsService.js";
import { IChatAgentRequest, IChatAgentResult } from "../../contrib/chat/common/participants/chatAgents.js";
import { ChatSessionContentContextDto, IChatSessionDto, ExtHostChatSessionsShape, IChatSessionRequestHistoryItemDto, IChatSessionProviderOptions, IChatNewSessionRequestDto } from "./extHost.protocol.js";
import { ExtHostCommands } from "./extHostCommands.js";
import { ExtHostLanguageModels } from "./extHostLanguageModels.js";
import { IExtHostRpcService } from "./extHostRpcService.js";
import * as typeConvert from "./extHostTypeConverters.js";
export declare class ExtHostChatSessions extends Disposable implements ExtHostChatSessionsShape {
    private readonly commands;
    private readonly _languageModels;
    private readonly _extHostRpc;
    private readonly _logService;
    private readonly _proxy;
    private _itemControllerHandlePool;
    private readonly _chatSessionItemControllers;
    private _contentProviderHandlePool;
    private readonly _chatSessionContentProviders;
    /**
     * Map of uri -> chat sessions infos
     */
    private readonly _extHostChatSessions;
    /**
     * Store option groups with onSearch callbacks per provider handle
     */
    private readonly _providerOptionGroups;
    constructor(commands: ExtHostCommands, _languageModels: ExtHostLanguageModels, _extHostRpc: IExtHostRpcService, _logService: ILogService);
    registerChatSessionItemProvider(extension: IExtensionDescription, chatSessionType: string, provider: vscode.ChatSessionItemProvider): vscode.Disposable;
    createChatSessionItemController(extension: IExtensionDescription, id: string, refreshHandler: (token: vscode.CancellationToken) => Thenable<void>): vscode.ChatSessionItemController;
    registerChatSessionContentProvider(extension: IExtensionDescription, chatSessionScheme: string, chatParticipant: vscode.ChatParticipant, provider: vscode.ChatSessionContentProvider, capabilities?: vscode.ChatSessionCapabilities): vscode.Disposable;
    $provideChatSessionContent(handle: number, sessionResourceComponents: UriComponents, context: ChatSessionContentContextDto, token: CancellationToken): Promise<IChatSessionDto>;
    $provideHandleOptionsChange(handle: number, sessionResourceComponents: UriComponents, updates: Record<string, string | IChatSessionProviderOptionItem | undefined>, token: CancellationToken): Promise<void>;
    $provideChatSessionProviderOptions(handle: number, token: CancellationToken): Promise<IChatSessionProviderOptions | undefined>;
    $interruptChatSessionActiveResponse(providerHandle: number, sessionResource: UriComponents, requestId: string): Promise<void>;
    $disposeChatSessionContent(providerHandle: number, sessionResource: UriComponents): Promise<void>;
    $invokeChatSessionRequestHandler(handle: number, sessionResource: UriComponents, request: IChatAgentRequest, history: any[], token: CancellationToken): Promise<IChatAgentResult>;
    $forkChatSession(handle: number, sessionResourceComponents: UriComponents, request: IChatSessionRequestHistoryItemDto | undefined, token: CancellationToken): Promise<ReturnType<typeof typeConvert.ChatSessionItem.from>>;
    private convertRequestDtoToRequestTurn;
    private getChatSessionItemController;
    private getModelForRequest;
    private convertRequestTurn;
    private convertReferenceToVariable;
    private convertResponseTurn;
    $invokeOptionGroupSearch(providerHandle: number, optionGroupId: string, query: string, token: CancellationToken): Promise<IChatSessionProviderOptionItem[]>;
    $refreshChatSessionItems(handle: number, token: CancellationToken): Promise<void>;
    $newChatSessionItem(handle: number, request: IChatNewSessionRequestDto, token: CancellationToken): Promise<ReturnType<typeof typeConvert.ChatSessionItem.from> | undefined>;
    $onDidChangeChatSessionItemState(controllerHandle: number, sessionResourceComponents: UriComponents, archived: boolean): void;
}
