import { Raw } from '@vscode/prompt-tsx';
import { IConfigurationService } from '../../../platform/configuration/common/configurationService';
import { IDiffService } from '../../../platform/diff/common/diffService';
import { IIgnoreService } from '../../../platform/ignore/common/ignoreService';
import * as xtabPromptOptions from '../../../platform/inlineEdits/common/dataTypes/xtabPromptOptions';
import { InlineEditRequestLogContext } from '../../../platform/inlineEdits/common/inlineEditLogContext';
import { IStatelessNextEditProvider, NoNextEditReason, PushEdit, ShowNextEditPreference, StatelessNextEditRequest, StatelessNextEditResult, StatelessNextEditTelemetryBuilder } from '../../../platform/inlineEdits/common/statelessNextEditProvider';
import { ILanguageContextProviderService } from '../../../platform/languageContextProvider/common/languageContextProviderService';
import { ILanguageDiagnosticsService } from '../../../platform/languages/common/languageDiagnosticsService';
import { Prediction } from '../../../platform/networking/common/fetch';
import { IChatEndpoint } from '../../../platform/networking/common/networking';
import { ISimulationTestContext } from '../../../platform/simulationTestContext/common/simulationTestContext';
import { IExperimentationService } from '../../../platform/telemetry/common/nullExperimentationService';
import { ITelemetryService } from '../../../platform/telemetry/common/telemetry';
import { IWorkspaceService } from '../../../platform/workspace/common/workspaceService';
import { Result } from '../../../util/common/result';
import { ITracer } from '../../../util/common/tracing';
import { CancellationToken } from '../../../util/vs/base/common/cancellation';
import { OffsetRange } from '../../../util/vs/editor/common/core/ranges/offsetRange';
import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation';
import { DelaySession } from '../../inlineEdits/common/delayer';
import { PromptPieces } from '../common/promptCrafting';
declare const enum RetryState {
    NotRetrying = 0,
    Retrying = 1
}
export declare class XtabProvider implements IStatelessNextEditProvider {
    private readonly simulationCtx;
    private readonly instaService;
    private readonly workspaceService;
    private readonly diffService;
    private readonly configService;
    private readonly expService;
    private readonly langCtxService;
    private readonly langDiagService;
    private readonly ignoreService;
    private readonly telemetryService;
    static readonly ID = "XtabProvider";
    readonly ID = "XtabProvider";
    readonly dependsOnSelection = true;
    readonly showNextEditPreference = ShowNextEditPreference.Always;
    private static computeTokens;
    private readonly delayer;
    private forceUseDefaultModel;
    constructor(simulationCtx: ISimulationTestContext, instaService: IInstantiationService, workspaceService: IWorkspaceService, diffService: IDiffService, configService: IConfigurationService, expService: IExperimentationService, langCtxService: ILanguageContextProviderService, langDiagService: ILanguageDiagnosticsService, ignoreService: IIgnoreService, telemetryService: ITelemetryService);
    handleAcceptance(): void;
    handleRejection(): void;
    provideNextEdit(request: StatelessNextEditRequest, pushEdit: PushEdit, tracer: ITracer, logContext: InlineEditRequestLogContext, cancellationToken: CancellationToken): Promise<StatelessNextEditResult>;
    private filterEdit;
    _provideNextEdit(request: StatelessNextEditRequest, pushEdit: PushEdit, tracer: ITracer, logContext: InlineEditRequestLogContext, cancellationToken: CancellationToken): Promise<StatelessNextEditResult>;
    private doGetNextEdit;
    private doGetNextEditWithSelection;
    private constructTaggedFile;
    private getAndProcessLanguageContext;
    private getLanguageContext;
    streamEdits(request: StatelessNextEditRequest, pushEdit: PushEdit, endpoint: IChatEndpoint, messages: Raw.ChatMessage[], editWindow: OffsetRange, editWindowLines: string[], cursorOriginalLinesOffset: number, cursorLineOffset: number, // cursor offset within the line it's in; 1-based
    editWindowLineRange: OffsetRange, promptPieces: PromptPieces, prediction: Prediction | undefined, opts: {
        showLabel: boolean;
        responseFormat: xtabPromptOptions.ResponseFormat;
        shouldRemoveCursorTagFromResponse: boolean;
        retryState: RetryState;
    }, delaySession: DelaySession, parentTracer: ITracer, telemetryBuilder: StatelessNextEditTelemetryBuilder, logContext: InlineEditRequestLogContext, cancellationToken: CancellationToken): Promise<Result<void, NoNextEditReason> | undefined>;
    private pushNoSuggestionsOrRetry;
    private determineNextCursorPredicationEnablement;
    private computeAreaAroundEditWindowLinesRange;
    private computeEditWindowLinesRange;
    private static mapChatFetcherErrorToNoNextEditReason;
    private determineModelConfiguration;
    private overrideByStringModelConfig;
    private static overrideModelConfig;
    private predictNextCursorPosition;
    private pickSystemPrompt;
    private determineLanguageContextOptions;
    private getEndpoint;
    private getPredictedOutput;
    private static getPredictionContents;
    private debounce;
    private enforceArtificialDelay;
}
/**
 * Finds the range of lines containing merge conflict markers within a specified edit window.
 *
 * @param lines - Array of strings representing the lines of text to search through
 * @param editWindowRange - The range within which to search for merge conflict markers
 * @param maxMergeConflictLines - Maximum number of lines to search for conflict markers
 * @returns An OffsetRange object representing the start and end of the conflict markers, or undefined if not found
 */
export declare function findMergeConflictMarkersRange(lines: string[], editWindowRange: OffsetRange, maxMergeConflictLines: number): OffsetRange | undefined;
export {};
//# sourceMappingURL=xtabProvider.d.ts.map