Path: blob/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts
5266 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45// version: 367declare module 'vscode' {89export interface ChatParticipant {10readonly onDidPerformAction: Event<ChatUserActionEvent>;11}1213/**14* Now only used for the "intent detection" API below15*/16export interface ChatCommand {17readonly name: string;18readonly description: string;19}2021export interface ChatVulnerability {22title: string;23description: string;24// id: string; // Later we will need to be able to link these across multiple content chunks.25}2627export class ChatResponseMarkdownWithVulnerabilitiesPart {28value: MarkdownString;29vulnerabilities: ChatVulnerability[];30constructor(value: string | MarkdownString, vulnerabilities: ChatVulnerability[]);31}3233export class ChatResponseCodeblockUriPart {34isEdit?: boolean;35value: Uri;36undoStopId?: string;37constructor(value: Uri, isEdit?: boolean, undoStopId?: string);38}3940/**41* Displays a {@link Command command} as a button in the chat response.42*/43export interface ChatCommandButton {44command: Command;45}4647export interface ChatDocumentContext {48uri: Uri;49version: number;50ranges: Range[];51}5253export class ChatResponseTextEditPart {54uri: Uri;55edits: TextEdit[];56isDone?: boolean;57constructor(uri: Uri, done: true);58constructor(uri: Uri, edits: TextEdit | TextEdit[]);59}6061export class ChatResponseNotebookEditPart {62uri: Uri;63edits: NotebookEdit[];64isDone?: boolean;65constructor(uri: Uri, done: true);66constructor(uri: Uri, edits: NotebookEdit | NotebookEdit[]);67}6869/**70* Represents a file-level edit (creation, deletion, or rename).71*/72export interface ChatWorkspaceFileEdit {73/**74* The original file URI (undefined for new files).75*/76oldResource?: Uri;7778/**79* The new file URI (undefined for deleted files).80*/81newResource?: Uri;82}8384/**85* Represents a workspace edit containing file-level operations.86*/87export class ChatResponseWorkspaceEditPart {88edits: ChatWorkspaceFileEdit[];89constructor(edits: ChatWorkspaceFileEdit[]);90}9192export class ChatResponseConfirmationPart {93title: string;94message: string | MarkdownString;95data: any;96buttons?: string[];97constructor(title: string, message: string | MarkdownString, data: any, buttons?: string[]);98}99100/**101* An option for a question in a carousel.102*/103export interface ChatQuestionOption {104/**105* Unique identifier for the option.106*/107id: string;108/**109* The display label for the option.110*/111label: string;112/**113* The value returned when this option is selected.114*/115value: unknown;116}117118/**119* The type of question for a chat question carousel.120*/121export enum ChatQuestionType {122/**123* A free-form text input question.124*/125Text = 1,126/**127* A single-select question with radio buttons.128*/129SingleSelect = 2,130/**131* A multi-select question with checkboxes.132*/133MultiSelect = 3134}135136/**137* A question to be displayed in a question carousel.138*/139export class ChatQuestion {140/**141* Unique identifier for the question.142*/143id: string;144/**145* The type of question: Text for free-form input, SingleSelect for radio buttons, MultiSelect for checkboxes.146*/147type: ChatQuestionType;148/**149* The title/header of the question.150*/151title: string;152/**153* Optional detailed message or description for the question.154*/155message?: string | MarkdownString;156/**157* Options for singleSelect or multiSelect questions.158*/159options?: ChatQuestionOption[];160/**161* The id(s) of the default selected option(s).162* For SingleSelect, this should be a single option id.163* For MultiSelect, this can be an array of option ids.164*/165defaultValue?: string | string[];166/**167* Whether to allow free-form text input in addition to predefined options.168* When true, users can provide their own text answer even for SingleSelect or MultiSelect questions.169*/170allowFreeformInput?: boolean;171172constructor(173id: string,174type: ChatQuestionType,175title: string,176options?: {177message?: string | MarkdownString;178options?: ChatQuestionOption[];179defaultValue?: string | string[];180allowFreeformInput?: boolean;181}182);183}184185/**186* A carousel view for presenting multiple questions inline in the chat.187* The UI is displayed but does not block the chat input.188*/189export class ChatResponseQuestionCarouselPart {190/**191* The questions to display in the carousel.192*/193questions: ChatQuestion[];194/**195* Whether users can skip answering the questions.196*/197allowSkip: boolean;198199constructor(questions: ChatQuestion[], allowSkip?: boolean);200}201202export class ChatResponseCodeCitationPart {203value: Uri;204license: string;205snippet: string;206constructor(value: Uri, license: string, snippet: string);207}208209export interface ChatToolInvocationStreamData {210/**211* Partial or not-yet-validated arguments that have streamed from the language model.212* Tools may use this to render interim UI while the full invocation input is collected.213*/214readonly partialInput?: unknown;215}216217export interface ChatTerminalToolInvocationData {218commandLine: {219original: string;220userEdited?: string;221toolEdited?: string;222};223language: string;224225/**226* Terminal command output. Displayed when the terminal is no longer available.227*/228output?: {229/** The raw output text, may include ANSI escape codes. */230text: string;231};232233/**234* Command execution state.235*/236state?: {237/** Exit code of the command. */238exitCode?: number;239/** Duration of execution in milliseconds. */240duration?: number;241};242}243244export class McpToolInvocationContentData {245/**246* The mime type which determines how the data property is interpreted.247*/248mimeType: string;249250/**251* The byte data for this part.252*/253data: Uint8Array;254255/**256* Construct a generic data part with the given content.257* @param data The byte data for this part.258* @param mimeType The mime type of the data.259*/260constructor(data: Uint8Array, mimeType: string);261}262263export interface ChatMcpToolInvocationData {264input: string;265output: McpToolInvocationContentData[];266}267268export enum ChatTodoStatus {269NotStarted = 1,270InProgress = 2,271Completed = 3272}273274export interface ChatTodoToolInvocationData {275todoList: Array<{276id: number;277title: string;278status: ChatTodoStatus;279}>;280}281282/**283* Generic tool result data that displays input and output in collapsible sections.284*/285export interface ChatSimpleToolResultData {286/**287* The input to display.288*/289input: string;290/**291* The output to display.292*/293output: string;294}295296297export interface ChatToolResourcesInvocationData {298/**299* Array of file URIs or locations to display as a collapsible list300*/301values: Array<Uri | Location>;302}303304export class ChatSubagentToolInvocationData {305/**306* A description of the subagent's purpose or task.307*/308description?: string;309310/**311* The name of the subagent being invoked.312*/313agentName?: string;314315/**316* The prompt given to the subagent.317*/318prompt?: string;319320/**321* The result text from the subagent after completion.322*/323result?: string;324325constructor(description?: string, agentName?: string, prompt?: string, result?: string);326}327328export class ChatToolInvocationPart {329toolName: string;330toolCallId: string;331isError?: boolean;332invocationMessage?: string | MarkdownString;333originMessage?: string | MarkdownString;334pastTenseMessage?: string | MarkdownString;335isConfirmed?: boolean;336isComplete?: boolean;337toolSpecificData?: ChatTerminalToolInvocationData | ChatMcpToolInvocationData | ChatTodoToolInvocationData | ChatSimpleToolResultData | ChatToolResourcesInvocationData | ChatSubagentToolInvocationData;338subAgentInvocationId?: string;339presentation?: 'hidden' | 'hiddenAfterComplete' | undefined;340341/**342* If this flag is set, this will be treated as an update to any previous tool call with the same id.343*/344enablePartialUpdate?: boolean;345346constructor(toolName: string, toolCallId: string, errorMessage?: string);347}348349/**350* Represents a single file diff entry in a multi diff view.351*/352export interface ChatResponseDiffEntry {353/**354* The original file URI (undefined for new files).355*/356originalUri?: Uri;357358/**359* The modified file URI (undefined for deleted files).360*/361modifiedUri?: Uri;362363/**364* Optional URI to navigate to when clicking on the file.365*/366goToFileUri?: Uri;367368/**369* Added data (e.g. line numbers) to show in the UI370*/371added?: number;372373/**374* Removed data (e.g. line numbers) to show in the UI375*/376removed?: number;377}378379/**380* Represents a part of a chat response that shows multiple file diffs.381*/382export class ChatResponseMultiDiffPart {383/**384* Array of file diff entries to display.385*/386value: ChatResponseDiffEntry[];387388/**389* The title for the multi diff editor.390*/391title: string;392393/**394* Whether the multi diff editor should be read-only.395* When true, users cannot open individual files or interact with file navigation.396*/397readOnly?: boolean;398399/**400* Create a new ChatResponseMultiDiffPart.401* @param value Array of file diff entries.402* @param title The title for the multi diff editor.403* @param readOnly Optional flag to make the multi diff editor read-only.404*/405constructor(value: ChatResponseDiffEntry[], title: string, readOnly?: boolean);406}407408export class ChatResponseExternalEditPart {409uris: Uri[];410callback: () => Thenable<unknown>;411applied: Thenable<string>;412constructor(uris: Uri[], callback: () => Thenable<unknown>);413}414415/**416* Internal type that lists all the proposed chat response parts. This is used to generate `ExtendedChatResponsePart`417* which is the actual type used in this API. This is done so that other proposals can easily add their own response parts418* without having to modify this file.419*/420export interface ExtendedChatResponseParts {421ChatResponsePart: ChatResponsePart;422ChatResponseTextEditPart: ChatResponseTextEditPart;423ChatResponseNotebookEditPart: ChatResponseNotebookEditPart;424ChatResponseWorkspaceEditPart: ChatResponseWorkspaceEditPart;425ChatResponseConfirmationPart: ChatResponseConfirmationPart;426ChatResponseCodeCitationPart: ChatResponseCodeCitationPart;427ChatResponseReferencePart2: ChatResponseReferencePart2;428ChatResponseMovePart: ChatResponseMovePart;429ChatResponseExtensionsPart: ChatResponseExtensionsPart;430ChatResponsePullRequestPart: ChatResponsePullRequestPart;431ChatToolInvocationPart: ChatToolInvocationPart;432ChatResponseMultiDiffPart: ChatResponseMultiDiffPart;433ChatResponseThinkingProgressPart: ChatResponseThinkingProgressPart;434ChatResponseExternalEditPart: ChatResponseExternalEditPart;435ChatResponseQuestionCarouselPart: ChatResponseQuestionCarouselPart;436}437438export type ExtendedChatResponsePart = ExtendedChatResponseParts[keyof ExtendedChatResponseParts];439440export class ChatResponseWarningPart {441value: MarkdownString;442constructor(value: string | MarkdownString);443}444445export class ChatResponseProgressPart2 extends ChatResponseProgressPart {446value: string;447task?: (progress: Progress<ChatResponseWarningPart | ChatResponseReferencePart>) => Thenable<string | void>;448constructor(value: string, task?: (progress: Progress<ChatResponseWarningPart | ChatResponseReferencePart>) => Thenable<string | void>);449}450451/**452* A specialized progress part for displaying thinking/reasoning steps.453*/454export class ChatResponseThinkingProgressPart {455value: string | string[];456id?: string;457metadata?: { readonly [key: string]: any };458task?: (progress: Progress<LanguageModelThinkingPart>) => Thenable<string | void>;459460/**461* Creates a new thinking progress part.462* @param value An initial progress message463* @param task A task that will emit thinking parts during its execution464*/465constructor(value: string | string[], id?: string, metadata?: { readonly [key: string]: any }, task?: (progress: Progress<LanguageModelThinkingPart>) => Thenable<string | void>);466}467468export class ChatResponseReferencePart2 {469/**470* The reference target.471*/472value: Uri | Location | { variableName: string; value?: Uri | Location } | string;473474/**475* The icon for the reference.476*/477iconPath?: Uri | ThemeIcon | {478/**479* The icon path for the light theme.480*/481light: Uri;482/**483* The icon path for the dark theme.484*/485dark: Uri;486};487options?: { status?: { description: string; kind: ChatResponseReferencePartStatusKind } };488489/**490* Create a new ChatResponseReferencePart.491* @param value A uri or location492* @param iconPath Icon for the reference shown in UI493*/494constructor(value: Uri | Location | { variableName: string; value?: Uri | Location } | string, iconPath?: Uri | ThemeIcon | {495/**496* The icon path for the light theme.497*/498light: Uri;499/**500* The icon path for the dark theme.501*/502dark: Uri;503}, options?: { status?: { description: string; kind: ChatResponseReferencePartStatusKind } });504}505506export class ChatResponseMovePart {507508readonly uri: Uri;509readonly range: Range;510511constructor(uri: Uri, range: Range);512}513514export interface ChatResponseAnchorPart {515/**516* The target of this anchor.517*518* If this is a {@linkcode Uri} or {@linkcode Location}, this is rendered as a normal link.519*520* If this is a {@linkcode SymbolInformation}, this is rendered as a symbol link.521*522* TODO mjbvz: Should this be a full `SymbolInformation`? Or just the parts we need?523* TODO mjbvz: Should we allow a `SymbolInformation` without a location? For example, until `resolve` completes?524*/525value2: Uri | Location | SymbolInformation;526527/**528* Optional method which fills in the details of the anchor.529*530* THis is currently only implemented for symbol links.531*/532resolve?(token: CancellationToken): Thenable<void>;533}534535export class ChatResponseExtensionsPart {536537readonly extensions: string[];538539constructor(extensions: string[]);540}541542export class ChatResponsePullRequestPart {543/**544* @deprecated use `command` instead545*/546readonly uri?: Uri;547readonly command: Command;548readonly linkTag: string;549readonly title: string;550readonly description: string;551readonly author: string;552constructor(uriOrCommand: Uri | Command, title: string, description: string, author: string, linkTag: string);553}554555export interface ChatResponseStream {556557/**558* Push a progress part to this stream. Short-hand for559* `push(new ChatResponseProgressPart(value))`.560*561* @param value A progress message562* @param task If provided, a task to run while the progress is displayed. When the Thenable resolves, the progress will be marked complete in the UI, and the progress message will be updated to the resolved string if one is specified.563* @returns This stream.564*/565progress(value: string, task?: (progress: Progress<ChatResponseWarningPart | ChatResponseReferencePart>) => Thenable<string | void>): void;566567thinkingProgress(thinkingDelta: ThinkingDelta): void;568569textEdit(target: Uri, edits: TextEdit | TextEdit[]): void;570571textEdit(target: Uri, isDone: true): void;572573notebookEdit(target: Uri, edits: NotebookEdit | NotebookEdit[]): void;574575notebookEdit(target: Uri, isDone: true): void;576577/**578* Push a workspace edit containing file-level operations (create, delete, rename).579* @param edits Array of file-level edits to apply580*/581workspaceEdit(edits: ChatWorkspaceFileEdit[]): void;582583/**584* Makes an external edit to one or more resources. Changes to the585* resources made within the `callback` and before it resolves will be586* tracked as agent edits. This can be used to track edits made from587* external tools that don't generate simple {@link textEdit textEdits}.588*/589externalEdit(target: Uri | Uri[], callback: () => Thenable<unknown>): Thenable<string>;590591markdownWithVulnerabilities(value: string | MarkdownString, vulnerabilities: ChatVulnerability[]): void;592codeblockUri(uri: Uri, isEdit?: boolean): void;593push(part: ChatResponsePart | ChatResponseTextEditPart | ChatResponseWarningPart | ChatResponseProgressPart2): void;594595/**596* Show an inline message in the chat view asking the user to confirm an action.597* Multiple confirmations may be shown per response. The UI might show "Accept All" / "Reject All" actions.598* @param title The title of the confirmation entry599* @param message An extra message to display to the user600* @param data An arbitrary JSON-stringifiable object that will be included in the ChatRequest when601* the confirmation is accepted or rejected602* TODO@API should this be MarkdownString?603* TODO@API should actually be a more generic function that takes an array of buttons604*/605confirmation(title: string, message: string | MarkdownString, data: any, buttons?: string[]): void;606607/**608* Show an inline carousel of questions to gather information from the user.609* This is a blocking call that waits for the user to submit or skip the questions.610* @param questions Array of questions to display to the user611* @param allowSkip Whether the user can skip questions without answering612* @returns A promise that resolves with the user's answers, or undefined if skipped613*/614questionCarousel(questions: ChatQuestion[], allowSkip?: boolean): Thenable<Record<string, unknown> | undefined>;615616/**617* Push a warning to this stream. Short-hand for618* `push(new ChatResponseWarningPart(message))`.619*620* @param message A warning message621* @returns This stream.622*/623warning(message: string | MarkdownString): void;624625reference(value: Uri | Location | { variableName: string; value?: Uri | Location }, iconPath?: Uri | ThemeIcon | { light: Uri; dark: Uri }): void;626627reference2(value: Uri | Location | string | { variableName: string; value?: Uri | Location }, iconPath?: Uri | ThemeIcon | { light: Uri; dark: Uri }, options?: { status?: { description: string; kind: ChatResponseReferencePartStatusKind } }): void;628629codeCitation(value: Uri, license: string, snippet: string): void;630631/**632* Begin a tool invocation in streaming mode. This creates a tool invocation that will633* display streaming progress UI until the tool is actually invoked.634* @param toolCallId Unique identifier for this tool call, used to correlate streaming updates and final invocation.635* @param toolName The name of the tool being invoked.636* @param streamData Optional initial streaming data with partial arguments.637*/638beginToolInvocation(toolCallId: string, toolName: string, streamData?: ChatToolInvocationStreamData & { subagentInvocationId?: string }): void;639640/**641* Update the streaming data for a tool invocation that was started with `beginToolInvocation`.642* @param toolCallId The tool call ID that was passed to `beginToolInvocation`.643* @param streamData New streaming data with updated partial arguments.644*/645updateToolInvocation(toolCallId: string, streamData: ChatToolInvocationStreamData): void;646647push(part: ExtendedChatResponsePart): void;648649clearToPreviousToolInvocation(reason: ChatResponseClearToPreviousToolInvocationReason): void;650651/**652* Report token usage information for this request.653* This is typically called when the underlying language model provides usage statistics.654* @param usage Token usage information including prompt and completion tokens655*/656usage(usage: ChatResultUsage): void;657}658659export enum ChatResponseReferencePartStatusKind {660Complete = 1,661Partial = 2,662Omitted = 3663}664665export type ThinkingDelta = {666text?: string | string[];667id: string;668metadata?: { readonly [key: string]: any };669} | {670text?: string | string[];671id?: string;672metadata: { readonly [key: string]: any };673} |674{675text: string | string[];676id?: string;677metadata?: { readonly [key: string]: any };678};679680export enum ChatResponseClearToPreviousToolInvocationReason {681NoReason = 0,682FilteredContentRetry = 1,683CopyrightContentRetry = 2,684}685686/**687* Does this piggy-back on the existing ChatRequest, or is it a different type of request entirely?688* Does it show up in history?689*/690export interface ChatRequest {691/**692* The `data` for any confirmations that were accepted693*/694acceptedConfirmationData?: any[];695696/**697* The `data` for any confirmations that were rejected698*/699rejectedConfirmationData?: any[];700}701702export interface ChatRequest {703704/**705* A map of all tools that should (`true`) and should not (`false`) be used in this request.706*/707readonly tools: Map<LanguageModelToolInformation, boolean>;708}709710export namespace lm {711/**712* Fired when the set of tools on a chat request changes.713*/714export const onDidChangeChatRequestTools: Event<ChatRequest>;715}716717export class LanguageModelToolExtensionSource {718/**719* ID of the extension that published the tool.720*/721readonly id: string;722723/**724* Label of the extension that published the tool.725*/726readonly label: string;727728private constructor(id: string, label: string);729}730731export class LanguageModelToolMCPSource {732/**733* Editor-configured label of the MCP server that published the tool.734*/735readonly label: string;736737/**738* Server-defined name of the MCP server.739*/740readonly name: string;741742/**743* Server-defined instructions for MCP tool use.744*/745readonly instructions?: string;746747private constructor(label: string, name: string, instructions?: string);748}749750export interface LanguageModelToolInformation {751source: LanguageModelToolExtensionSource | LanguageModelToolMCPSource | undefined;752}753754// TODO@API fit this into the stream755export interface ChatUsedContext {756documents: ChatDocumentContext[];757}758759export interface ChatParticipant {760/**761* Provide a set of variables that can only be used with this participant.762*/763participantVariableProvider?: { provider: ChatParticipantCompletionItemProvider; triggerCharacters: string[] };764765/**766* Event that fires when a request is paused or unpaused.767* Chat requests are initially unpaused in the {@link requestHandler}.768*/769readonly onDidChangePauseState: Event<ChatParticipantPauseStateEvent>;770}771772export interface ChatParticipantPauseStateEvent {773request: ChatRequest;774isPaused: boolean;775}776777export interface ChatParticipantCompletionItemProvider {778provideCompletionItems(query: string, token: CancellationToken): ProviderResult<ChatCompletionItem[]>;779}780781export class ChatCompletionItem {782id: string;783label: string | CompletionItemLabel;784values: ChatVariableValue[];785fullName?: string;786icon?: ThemeIcon;787insertText?: string;788detail?: string;789documentation?: string | MarkdownString;790command?: Command;791792constructor(id: string, label: string | CompletionItemLabel, values: ChatVariableValue[]);793}794795export type ChatExtendedRequestHandler = (request: ChatRequest, context: ChatContext, response: ChatResponseStream, token: CancellationToken) => ProviderResult<ChatResult | void>;796797/**798* Details about the prompt token usage by category and label.799*/800export interface ChatResultPromptTokenDetail {801/**802* The category this token usage belongs to (e.g., "System", "Context", "Conversation").803*/804readonly category: string;805806/**807* The label for this specific token usage (e.g., "System prompt", "Attached files").808*/809readonly label: string;810811/**812* The percentage of the total prompt tokens this represents (0-100).813*/814readonly percentageOfPrompt: number;815}816817/**818* Token usage information for a chat request.819*/820export interface ChatResultUsage {821/**822* The number of prompt tokens used in this request.823*/824readonly promptTokens: number;825826/**827* The number of completion tokens generated in this response.828*/829readonly completionTokens: number;830831/**832* Optional breakdown of prompt token usage by category and label.833* If the percentages do not sum to 100%, the remaining will be shown as "Uncategorized".834*/835readonly promptTokenDetails?: readonly ChatResultPromptTokenDetail[];836}837838export interface ChatResult {839nextQuestion?: {840prompt: string;841participant?: string;842command?: string;843};844/**845* An optional detail string that will be rendered at the end of the response in certain UI contexts.846*/847details?: string;848}849850export namespace chat {851/**852* Create a chat participant with the extended progress type853*/854export function createChatParticipant(id: string, handler: ChatExtendedRequestHandler): ChatParticipant;855}856857/*858* User action events859*/860861export enum ChatCopyKind {862// Keyboard shortcut or context menu863Action = 1,864Toolbar = 2865}866867export interface ChatCopyAction {868// eslint-disable-next-line local/vscode-dts-string-type-literals869kind: 'copy';870codeBlockIndex: number;871copyKind: ChatCopyKind;872copiedCharacters: number;873totalCharacters: number;874copiedText: string;875totalLines: number;876copiedLines: number;877modelId: string;878languageId?: string;879}880881export interface ChatInsertAction {882// eslint-disable-next-line local/vscode-dts-string-type-literals883kind: 'insert';884codeBlockIndex: number;885totalCharacters: number;886totalLines: number;887languageId?: string;888modelId: string;889newFile?: boolean;890}891892export interface ChatApplyAction {893// eslint-disable-next-line local/vscode-dts-string-type-literals894kind: 'apply';895codeBlockIndex: number;896totalCharacters: number;897totalLines: number;898languageId?: string;899modelId: string;900newFile?: boolean;901codeMapper?: string;902}903904export interface ChatTerminalAction {905// eslint-disable-next-line local/vscode-dts-string-type-literals906kind: 'runInTerminal';907codeBlockIndex: number;908languageId?: string;909}910911export interface ChatCommandAction {912// eslint-disable-next-line local/vscode-dts-string-type-literals913kind: 'command';914commandButton: ChatCommandButton;915}916917export interface ChatFollowupAction {918// eslint-disable-next-line local/vscode-dts-string-type-literals919kind: 'followUp';920followup: ChatFollowup;921}922923export interface ChatBugReportAction {924// eslint-disable-next-line local/vscode-dts-string-type-literals925kind: 'bug';926}927928export interface ChatEditorAction {929// eslint-disable-next-line local/vscode-dts-string-type-literals930kind: 'editor';931accepted: boolean;932}933934export interface ChatEditingSessionAction {935// eslint-disable-next-line local/vscode-dts-string-type-literals936kind: 'chatEditingSessionAction';937uri: Uri;938hasRemainingEdits: boolean;939outcome: ChatEditingSessionActionOutcome;940}941942export interface ChatEditingHunkAction {943// eslint-disable-next-line local/vscode-dts-string-type-literals944kind: 'chatEditingHunkAction';945uri: Uri;946lineCount: number;947linesAdded: number;948linesRemoved: number;949outcome: ChatEditingSessionActionOutcome;950hasRemainingEdits: boolean;951}952953export enum ChatEditingSessionActionOutcome {954Accepted = 1,955Rejected = 2,956Saved = 3957}958959export interface ChatUserActionEvent {960readonly result: ChatResult;961readonly action: ChatCopyAction | ChatInsertAction | ChatApplyAction | ChatTerminalAction | ChatCommandAction | ChatFollowupAction | ChatBugReportAction | ChatEditorAction | ChatEditingSessionAction | ChatEditingHunkAction;962}963964export interface ChatPromptReference {965/**966* TODO Needed for now to drive the variableName-type reference, but probably both of these should go away in the future.967*/968readonly name: string;969970/**971* The list of tools were referenced in the value of the reference972*/973readonly toolReferences?: readonly ChatLanguageModelToolReference[];974}975976export interface ChatResultFeedback {977readonly unhelpfulReason?: string;978}979980export namespace lm {981export function fileIsIgnored(uri: Uri, token?: CancellationToken): Thenable<boolean>;982}983984export interface ChatVariableValue {985/**986* The detail level of this chat variable value. If possible, variable resolvers should try to offer shorter values that will consume fewer tokens in an LLM prompt.987*/988level: ChatVariableLevel;989990/**991* The variable's value, which can be included in an LLM prompt as-is, or the chat participant may decide to read the value and do something else with it.992*/993value: string | Uri;994995/**996* A description of this value, which could be provided to the LLM as a hint.997*/998description?: string;999}10001001/**1002* The detail level of this chat variable value.1003*/1004export enum ChatVariableLevel {1005Short = 1,1006Medium = 2,1007Full = 31008}10091010export interface LanguageModelToolInvocationOptions<T> {1011model?: LanguageModelChat;1012chatStreamToolCallId?: string;1013}10141015export interface LanguageModelToolInvocationStreamOptions<T> {1016/**1017* Raw argument payload, such as the streamed JSON fragment from the language model.1018*/1019readonly rawInput?: unknown;10201021readonly chatRequestId?: string;1022/** @deprecated Use {@link chatSessionResource} instead */1023readonly chatSessionId?: string;1024readonly chatSessionResource?: Uri;1025readonly chatInteractionId?: string;1026}10271028export interface LanguageModelToolStreamResult {1029/**1030* A customized progress message to show while the tool runs.1031*/1032invocationMessage?: string | MarkdownString;1033}10341035export interface LanguageModelTool<T> {1036/**1037* Called zero or more times before {@link LanguageModelTool.prepareInvocation} while the1038* language model streams argument data for the invocation. Use this to update progress1039* or UI with the partial arguments that have been generated so far.1040*1041* Implementations must be free of side-effects and should be resilient to receiving1042* malformed or incomplete input.1043*/1044handleToolStream?(options: LanguageModelToolInvocationStreamOptions<T>, token: CancellationToken): ProviderResult<LanguageModelToolStreamResult>;1045}10461047export interface ChatRequest {1048readonly modeInstructions?: string;1049readonly modeInstructions2?: ChatRequestModeInstructions;1050}10511052export interface ChatRequestModeInstructions {1053readonly name: string;1054readonly content: string;1055readonly toolReferences?: readonly ChatLanguageModelToolReference[];1056readonly metadata?: Record<string, boolean | string | number>;1057}1058}105910601061