Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/@types/vscode.proposed.chatParticipantAdditions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,6 @@ declare module 'vscode' {
readonly toolReferences?: readonly ChatLanguageModelToolReference[];
}

export interface ChatResultFeedback {
readonly unhelpfulReason?: string;
}

export namespace lm {
export function fileIsIgnored(uri: Uri, token?: CancellationToken): Thenable<boolean>;
}
Expand Down
31 changes: 19 additions & 12 deletions src/@types/vscode.proposed.chatParticipantPrivate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ declare module 'vscode' {
constructor(cell: TextDocument);
}

export interface ChatRequestSessionGrouping {
readonly id: string;
readonly order: number;
readonly kind?: string;
}

export interface ChatRequest {
/**
* The id of the chat request. Used to identity an interaction with any of the chat surfaces.
Expand Down Expand Up @@ -122,11 +116,6 @@ declare module 'vscode' {
*/
readonly parentRequestId?: string;

/**
* Optional metadata used to group related requests together in the UI.
*/
readonly sessionGrouping?: ChatRequestSessionGrouping;

/**
* The permission level for tool auto-approval in this request.
* - `'autoApprove'`: Auto-approve all tool calls and retry on errors.
Expand Down Expand Up @@ -199,10 +188,15 @@ declare module 'vscode' {
*/
readonly modelId?: string;

/**
* The mode instructions that were active for this request, if any.
*/
readonly modeInstructions2?: ChatRequestModeInstructions;

/**
* @hidden
*/
constructor(prompt: string, command: string | undefined, references: ChatPromptReference[], participant: string, toolReferences: ChatLanguageModelToolReference[], editedFileEvents: ChatRequestEditedFileEvent[] | undefined, id: string | undefined, modelId: string | undefined);
constructor(prompt: string, command: string | undefined, references: ChatPromptReference[], participant: string, toolReferences: ChatLanguageModelToolReference[], editedFileEvents: ChatRequestEditedFileEvent[] | undefined, id: string | undefined, modelId: string | undefined, modeInstructions2: ChatRequestModeInstructions | undefined);
}

export class ChatResponseTurn2 {
Expand Down Expand Up @@ -421,4 +415,17 @@ declare module 'vscode' {
}

// #endregion

export interface LanguageModelToolInformation {
/**
* The full reference name of this tool as used in agent definition files.
*
* For MCP tools, this is the canonical name in the format `serverShortName/toolReferenceName`
* (e.g., `github/search_issues`). This can be used to map between the tool names specified
* in agent `.md` files and the tool's internal {@link LanguageModelToolInformation.name id}.
*
* This property is only set for MCP tools. For other tool types, it is `undefined`.
*/
readonly fullReferenceName?: string;
}
}
79 changes: 76 additions & 3 deletions src/@types/vscode.proposed.chatSessionsProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,36 @@ declare module 'vscode' {
readonly command?: string;
};

/**
* @deprecated Use `inputState` instead
*/
readonly sessionOptions: ReadonlyArray<{ optionId: string; value: string | ChatSessionProviderOptionItem }>;

readonly inputState: ChatSessionInputState;
}

/**
* Extension callback invoked when a new chat session is started.
*/
export type ChatSessionItemControllerNewItemHandler = (context: ChatSessionItemControllerNewItemHandlerContext, token: CancellationToken) => Thenable<ChatSessionItem>;

/**
* Extension callback invoked to get the input state for a chat session.
*
* @param sessionResource The resource of the chat session to get the input state for. `undefined` indicates this is
* for a blank chat editor that is not yet associated with a session.
* @param context Additional context
* @param token Cancellation token.
*
* @return A new chat session input state. This should be created using {@link ChatSessionItemController.createChatSessionInputState}.
*/
export type ChatSessionControllerGetInputState = (sessionResource: Uri | undefined, context: {
/**
* The previous input state for the session.
*/
readonly previousInputState: ChatSessionInputState | undefined;
}, token: CancellationToken) => Thenable<ChatSessionInputState> | ChatSessionInputState;

/**
* Extension callback invoked to fork an existing chat session item managed by a {@linkcode ChatSessionItemController}.
*
Expand Down Expand Up @@ -150,6 +172,11 @@ declare module 'vscode' {
*/
readonly refreshHandler: ChatSessionItemControllerRefreshHandler;

/**
* Fired when an item's archived state changes.
*/
readonly onDidChangeChatSessionItemState: Event<ChatSessionItem>;

/**
* Invoked when a new chat session is started.
*
Expand All @@ -168,9 +195,14 @@ declare module 'vscode' {
forkHandler?: ChatSessionItemControllerForkHandler;

/**
* Fired when an item's archived state changes.
* Gets the input state for a chat session.
*/
readonly onDidChangeChatSessionItemState: Event<ChatSessionItem>;
getChatSessionInputState?: ChatSessionControllerGetInputState;

/**
* Create a new managed ChatSessionInputState object.
*/
createChatSessionInputState(groups: ChatSessionProviderOptionGroup[]): ChatSessionInputState;
}

/**
Expand Down Expand Up @@ -321,6 +353,9 @@ declare module 'vscode' {
metadata?: { readonly [key: string]: any };
}

/**
* @deprecated Use `ChatSessionChangedFile2` instead
*/
export class ChatSessionChangedFile {
/**
* URI of the file.
Expand Down Expand Up @@ -468,11 +503,15 @@ declare module 'vscode' {
*/
export interface ChatSessionContentProvider {
/**
* @deprecated
*
* Event that the provider can fire to signal that the options for a chat session have changed.
*/
readonly onDidChangeChatSessionOptions?: Event<ChatSessionOptionChangeEvent>;

/**
* @deprecated
*
* Event that the provider can fire to signal that the available provider options have changed.
*
* When fired, the editor will re-query {@link ChatSessionContentProvider.provideChatSessionProviderOptions}
Expand All @@ -492,17 +531,26 @@ declare module 'vscode' {
* @return The {@link ChatSession chat session} associated with the given URI.
*/
provideChatSessionContent(resource: Uri, token: CancellationToken, context: {
readonly inputState: ChatSessionInputState;

/**
* @deprecated Use `inputState` instead
*/
readonly sessionOptions: ReadonlyArray<{ optionId: string; value: string | ChatSessionProviderOptionItem }>;
}): Thenable<ChatSession> | ChatSession;

/**
* @deprecated
*
* @param resource Identifier of the chat session being updated.
* @param updates Collection of option identifiers and their new values. Only the options that changed are included.
* @param token A cancellation token that can be used to cancel the notification if the session is disposed.
*/
provideHandleOptionsChange?(resource: Uri, updates: ReadonlyArray<ChatSessionOptionUpdate>, token: CancellationToken): void;

/**
* @deprecated
*
* Called as soon as you register (call me once)
*/
provideChatSessionProviderOptions?(token: CancellationToken): Thenable<ChatSessionProviderOptions>;
Expand Down Expand Up @@ -614,10 +662,15 @@ declare module 'vscode' {
*/
readonly description?: string;

/**
* The currently selected option for this group. This must be one of the items provided in the `items` array.
*/
readonly selected?: ChatSessionProviderOptionItem;

/**
* The selectable items within this option group.
*/
readonly items: ChatSessionProviderOptionItem[];
readonly items: readonly ChatSessionProviderOptionItem[];

/**
* A context key expression that controls when this option group picker is visible.
Expand Down Expand Up @@ -654,6 +707,9 @@ declare module 'vscode' {
* Optional commands.
*
* These commands will be displayed at the bottom of the group.
*
* For extensions that use the new `provideChatSessionInputState` API, these commands are passed a context object
* `{ inputState: ChatSessionInputState; sessionResource: Uri | undefined }` that they can use to determine which session and options they are being invoked for.
*/
readonly commands?: Command[];
}
Expand All @@ -672,4 +728,21 @@ declare module 'vscode' {
*/
readonly newSessionOptions?: Record<string, string | ChatSessionProviderOptionItem>;
}

/**
* Represents the current state of user inputs for a chat session.
*/
export interface ChatSessionInputState {
/**
* Fired when the input state is changed by the user.
*/
readonly onDidChange: Event<void>;

/**
* The groups of options to show in the UI for user input.
*
* To update the groups you must replace the entire `groups` array with a new array.
*/
groups: readonly ChatSessionProviderOptionGroup[];
}
}
Loading
Loading