import { Raw } from '@vscode/prompt-tsx'; import { IConfigurationService } from '../../../platform/configuration/common/configurationService'; import { IEndpointProvider } from '../../../platform/endpoint/common/endpointProvider'; import { NextCursorLinePrediction } from '../../../platform/inlineEdits/common/dataTypes/nextCursorLinePrediction'; import { ILanguageDiagnosticsService } from '../../../platform/languages/common/languageDiagnosticsService'; import { IProxyModelsService } from '../../../platform/proxyModels/common/proxyModelsService'; import { IExperimentationService } from '../../../platform/telemetry/common/nullExperimentationService'; import { Result } from '../../../util/common/result'; 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 { PromptPieces } from '../common/promptCrafting'; import type { RequestTracingContext } from './xtabProvider'; export type CursorJumpPrediction = { readonly kind: 'sameFile'; readonly lineNumber: number; } | { readonly kind: 'differentFile'; readonly filePath: string; readonly lineNumber: number; }; /** * System prompt used for the cursor-jump (next-cursor-line) prediction model. * Kept as an exported constant so that training-data generation can mirror it * verbatim — drift between this string and the datagen prompt would corrupt * the training distribution. */ export declare const NEXT_CURSOR_PREDICTION_SYSTEM_MESSAGE = "Your task is to predict the line number where the developer is most likely to make their next edit. If you jump in the current file, just output the line number. If you want to jump to another file, output the filepath (relative to workspace root), colon, then line number. If you don't think anywhere is a good next line jump target, just output the current line number of the cursor. Make sure to output no explanation, reasoning, extra spaces, etc."; export declare class XtabNextCursorPredictor { private readonly computeTokens; private readonly instaService; private readonly configService; private readonly expService; private readonly langDiagService; private readonly endpointProvider; private readonly proxyModelsService; private isDisabled; constructor(computeTokens: (text: string) => number, instaService: IInstantiationService, configService: IConfigurationService, expService: IExperimentationService, langDiagService: ILanguageDiagnosticsService, endpointProvider: IEndpointProvider, proxyModelsService: IProxyModelsService); determineEnablement(supportsNextCursorLinePrediction?: boolean): NextCursorLinePrediction | undefined; /** * Build the chat messages and `keptRange` for the cursor-prediction prompt * without making any network call. Extracted from {@link predictNextCursorPosition} * so that test/datagen tooling can capture the exact production prompt * (and the kept-line range used to validate the assistant's response) * without spinning up a mock endpoint. */ buildCursorPredictionPrompt(promptPieces: PromptPieces): Result<{ messages: Raw.ChatMessage[]; keptRange: OffsetRange; }, Error>; predictNextCursorPosition(promptPieces: PromptPieces, tracing: RequestTracingContext, cancellationToken: CancellationToken): Promise>; private resolveEndpoint; private determineModelName; private determineLintOptions; parseResponse(rawResponse: string, keptRange: OffsetRange): Result; private parseSameFileLineNumber; } //# sourceMappingURL=xtabNextCursorPredictor.d.ts.map