import type * as vscode from "vscode";
import { CancellationToken } from "../../../base/common/cancellation.js";
import { SerializedError } from "../../../base/common/errors.js";
import { Event } from "../../../base/common/event.js";
import { IDisposable } from "../../../base/common/lifecycle.js";
import { UriComponents } from "../../../base/common/uri.js";
import { ExtensionIdentifier, IExtensionDescription } from "../../../platform/extensions/common/extensions.js";
import { ILogService } from "../../../platform/log/common/log.service.js";
import { IChatMessage, IChatResponsePart, ILanguageModelChatInfoOptions, ILanguageModelChatMetadataAndIdentifier, ILanguageModelChatRequestOptions } from "../../contrib/chat/common/languageModels.js";
import { SerializableObjectWithBuffers } from "../../services/extensions/common/proxyIdentifier.js";
import { ExtHostLanguageModelsShape } from "./extHost.protocol.js";
import { IExtHostAuthentication } from "./extHostAuthentication.js";
import { IExtHostRpcService } from "./extHostRpcService.js";
export interface IExtHostLanguageModels extends ExtHostLanguageModels {
}
export declare const IExtHostLanguageModels: import("../../../platform/instantiation/common/instantiation.js").ServiceIdentifier<IExtHostLanguageModels>;
export declare class ExtHostLanguageModels implements ExtHostLanguageModelsShape {
    private readonly _logService;
    private readonly _extHostAuthentication;
    _serviceBrand: undefined;
    private static _idPool;
    private readonly _proxy;
    private readonly _onDidChangeModelAccess;
    private readonly _onDidChangeProviders;
    readonly onDidChangeProviders: Event<void>;
    private readonly _onDidChangeModelProxyAvailability;
    readonly onDidChangeModelProxyAvailability: Event<void>;
    private readonly _languageModelProviders;
    private readonly _localModels;
    private readonly _modelAccessList;
    private readonly _pendingRequest;
    private readonly _ignoredFileProviders;
    private _languageModelProxyProvider;
    constructor(extHostRpc: IExtHostRpcService, _logService: ILogService, _extHostAuthentication: IExtHostAuthentication);
    dispose(): void;
    registerLanguageModelChatProvider(extension: IExtensionDescription, vendor: string, provider: vscode.LanguageModelChatProvider): IDisposable;
    private toModelIdentifier;
    private getVendorFromModelIdentifier;
    $provideLanguageModelChatInfo(vendor: string, options: ILanguageModelChatInfoOptions, token: CancellationToken): Promise<ILanguageModelChatMetadataAndIdentifier[]>;
    $startChatRequest(modelId: string, requestId: number, from: ExtensionIdentifier | undefined, messages: SerializableObjectWithBuffers<IChatMessage[]>, options: ILanguageModelChatRequestOptions, token: CancellationToken): Promise<void>;
    $provideTokenLength(modelId: string, value: string, token: CancellationToken): Promise<number>;
    getDefaultLanguageModel(extension: IExtensionDescription, forceResolveModels?: boolean): Promise<vscode.LanguageModelChat | undefined>;
    getLanguageModelByIdentifier(extension: IExtensionDescription, modelId: string | undefined): Promise<vscode.LanguageModelChat | undefined>;
    private _createLanguageModelChatApi;
    selectLanguageModels(extension: IExtensionDescription, selector: vscode.LanguageModelChatSelector): Promise<vscode.LanguageModelChat[]>;
    private _sendChatRequest;
    private _convertMessages;
    $acceptResponsePart(requestId: number, chunk: SerializableObjectWithBuffers<IChatResponsePart | IChatResponsePart[]>): Promise<void>;
    $onChatModelsChange(): void;
    $acceptResponseDone(requestId: number, error: SerializedError | undefined): Promise<void>;
    private _getAuthAccess;
    private _isUsingAuth;
    private _fakeAuthPopulate;
    private _computeTokenLength;
    $updateModelAccesslist(data: {
        from: ExtensionIdentifier;
        to: ExtensionIdentifier;
        enabled: boolean;
    }[]): void;
    private readonly _languageAccessInformationExtensions;
    createLanguageModelAccessInformation(from: Readonly<IExtensionDescription>): vscode.LanguageModelAccessInformation;
    fileIsIgnored(extension: IExtensionDescription, uri: vscode.Uri, token?: vscode.CancellationToken): Promise<boolean>;
    get isModelProxyAvailable(): boolean;
    getModelProxy(extension: IExtensionDescription): Promise<vscode.LanguageModelProxy>;
    $isFileIgnored(handle: number, uri: UriComponents, token: CancellationToken): Promise<boolean>;
    registerIgnoredFileProvider(extension: IExtensionDescription, provider: vscode.LanguageModelIgnoredFileProvider): vscode.Disposable;
    registerLanguageModelProxyProvider(extension: IExtensionDescription, provider: vscode.LanguageModelProxyProvider): vscode.Disposable;
}
