import { ChatFetchError } from '../../../platform/chat/common/commonTypes'; import { IConfigurationService } from '../../../platform/configuration/common/configurationService'; import { IDiffService } from '../../../platform/diff/common/diffService'; import { IIgnoreService } from '../../../platform/ignore/common/ignoreService'; import { LanguageId } from '../../../platform/inlineEdits/common/dataTypes/languageId'; import * as xtabPromptOptions from '../../../platform/inlineEdits/common/dataTypes/xtabPromptOptions'; import { LanguageContextLanguages, LanguageContextOptions } from '../../../platform/inlineEdits/common/dataTypes/xtabPromptOptions'; import { InlineEditRequestLogContext } from '../../../platform/inlineEdits/common/inlineEditLogContext'; import { IInlineEditsModelService } from '../../../platform/inlineEdits/common/inlineEditsModelService'; import { EditStreamingWithTelemetry, IStatelessNextEditProvider, NoNextEditReason, StatelessNextEditDocument, StatelessNextEditRequest, StatelessNextEditTelemetryBuilder } from '../../../platform/inlineEdits/common/statelessNextEditProvider'; import { ILanguageContextProviderService } from '../../../platform/languageContextProvider/common/languageContextProviderService'; import { ILanguageDiagnosticsService } from '../../../platform/languages/common/languageDiagnosticsService'; import { ILogger } from '../../../platform/log/common/logService'; 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 { CancellationToken } from '../../../util/vs/base/common/cancellation'; import { LineReplacement } from '../../../util/vs/editor/common/core/edits/lineEdit'; import { OffsetRange } from '../../../util/vs/editor/common/core/ranges/offsetRange'; import { IInstantiationService } from '../../../util/vs/platform/instantiation/common/instantiation'; import { ISimilarFilesContextService } from '../common/similarFilesContextService'; import { CurrentDocument } from '../common/xtabCurrentDocument'; export interface ModelConfig extends xtabPromptOptions.PromptOptions { modelName: string | undefined; } export interface RequestTracingContext { tracer: ILogger; logContext: InlineEditRequestLogContext; telemetry: StatelessNextEditTelemetryBuilder; } export declare class XtabProvider implements IStatelessNextEditProvider { private readonly modelService; 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 similarFilesContextService; private readonly _telemetryService; static readonly ID = "XtabProvider"; readonly ID = "XtabProvider"; private static computeTokens; private readonly userInteractionMonitor; private readonly terminalMonitor; private forceUseDefaultModel; private nextCursorPredictor; constructor(modelService: IInlineEditsModelService, simulationCtx: ISimulationTestContext, instaService: IInstantiationService, workspaceService: IWorkspaceService, diffService: IDiffService, configService: IConfigurationService, expService: IExperimentationService, langCtxService: ILanguageContextProviderService, langDiagService: ILanguageDiagnosticsService, ignoreService: IIgnoreService, similarFilesContextService: ISimilarFilesContextService, _telemetryService: ITelemetryService); handleAcceptance(): void; handleRejection(): void; handleIgnored(): void; provideNextEdit(request: StatelessNextEditRequest, logger: ILogger, logContext: InlineEditRequestLogContext, cancellationToken: CancellationToken): EditStreamingWithTelemetry; private doGetNextEdit; /** * Gathers language context and neighbor snippets and clips the current file, returning the * pieces {@link getUserPrompt} needs, or a {@link NoNextEditReason} when the request is * cancelled mid-gathering or the current file cannot fit its budget. * * Under a global budget the current file is clipped LAST: the cascade runs first so the * current file can reuse whatever budget it leaves unused (via `finalSurplus`), and the * already-run cascade is returned as `precomputedCascade` so {@link getUserPrompt} renders * it exactly once. With no global budget (prod default) the current file is clipped to its * own per-part cap first, byte-identical to the legacy path. */ private gatherContextAndClipCurrentFile; private doGetNextEditWithSelection; private _configureDebounceTimings; private _applyAggressivenessSettings; private getAndProcessLanguageContext; private getLanguageContext; private streamEditsWithFiltering; private streamEdits; /** * Initiates the HTTP fetch, sets up the streaming pipeline, and returns either * a clean line stream (with cursor-tag removal and latency logging applied) * or an error / retry signal. * * This method encapsulates all fetch infrastructure so that downstream response * format handlers only need an `AsyncIterable` line stream. */ private _performFetch; private _streamEditsImpl; private doGetNextEditsWithCursorJump; private handleCrossFilePrediction; private computeEditWindowLinesRange; private determineModelConfiguration; /** * Resolve the opt-in global budget from its single experiment-driven JSON * config string (mirrors `modelConfigurationString`). Returns `undefined` * — disabling the global budget, identical to prod — when the string is * unset, empty, or fails to parse/validate. Parse failures are reported via * telemetry so misconfigured experiments are observable. */ private getGlobalBudget; private getEndpointWithLogging; private getEndpoint; private getPredictedOutput; private debounce; private determineArtificialDelayMs; private filterEdit; static getNextCursorColumn(nextCursorLine: string | undefined): number; } export declare function filterOutEditsWithSubstrings(edits: readonly LineReplacement[], substringsToFilterOut: string[]): readonly LineReplacement[]; export declare function computeAreaAroundEditWindowLinesRange(currentDocument: CurrentDocument): OffsetRange; export declare function mapChatFetcherErrorToNoNextEditReason(fetchError: ChatFetchError): NoNextEditReason; export declare function overrideModelConfig(modelConfig: ModelConfig, overridingConfig: xtabPromptOptions.ModelConfiguration): ModelConfig; export declare function pickSystemPrompt(promptingStrategy: xtabPromptOptions.PromptingStrategy | undefined): string; export declare function determineLanguageContextOptions(languageId: LanguageId, { enabled, enabledLanguages, maxTokens, enableAllContextProviders, traitPosition }: { enabled: boolean; enabledLanguages: LanguageContextLanguages; maxTokens: number; enableAllContextProviders: boolean; traitPosition: 'before' | 'after'; }): LanguageContextOptions; export declare function getPredictionContents(doc: StatelessNextEditDocument, cursorLineOffset: number, editWindowLines: readonly string[], cursorLineInEditWindowOffset: number, responseFormat: xtabPromptOptions.ResponseFormat, patchModelPredictionKind: xtabPromptOptions.PatchModelPrediction): string; //# sourceMappingURL=xtabProvider.d.ts.map