Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,12 @@
"category": "%command.pull.request.category%",
"icon": "$(cloud)"
},
{
"command": "pr.pickInWorktree",
"title": "%command.pr.pickInWorktree.title%",
"category": "%command.pull.request.category%",
"icon": "$(folder-library)"
},
{
"command": "pr.exit",
"title": "%command.pr.exit.title%",
Expand Down Expand Up @@ -2059,6 +2065,10 @@
"command": "pr.pickOnCodespaces",
"when": "false"
},
{
"command": "pr.pickInWorktree",
"when": "false"
},
{
"command": "pr.exit",
"when": "github:inReviewMode"
Expand Down Expand Up @@ -2857,6 +2867,11 @@
"when": "view == pr:github && viewItem =~ /pullrequest(:local)?:nonactive/ && (!isWeb || remoteName != codespaces && virtualWorkspace != vscode-vfs)",
"group": "1_pullrequest@3"
},
{
"command": "pr.pickInWorktree",
"when": "view == pr:github && viewItem =~ /pullrequest(:local)?:nonactive/ && !isWeb",
"group": "1_pullrequest@4"
},
{
"command": "pr.openChanges",
"when": "view =~ /(pr|prStatus):github/ && viewItem =~ /(pullrequest|description)/",
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
"command.pr.openChanges.title": "Open Changes",
"command.pr.pickOnVscodeDev.title": "Checkout Pull Request on vscode.dev",
"command.pr.pickOnCodespaces.title": "Checkout Pull Request on Codespaces",
"command.pr.pickInWorktree.title": "Checkout Pull Request in Worktree",
"command.pr.exit.title": "Checkout Default Branch",
"command.pr.dismissNotification.title": "Dismiss Notification",
"command.pr.markAllCopilotNotificationsAsRead.title": "Dismiss All Copilot Notifications",
Expand Down
3 changes: 3 additions & 0 deletions src/@types/git.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ export interface Repository {
applyStash(index?: number): Promise<void>;
popStash(index?: number): Promise<void>;
dropStash(index?: number): Promise<void>;

createWorktree(options?: { path?: string; commitish?: string; branch?: string }): Promise<string>;
deleteWorktree(path: string, options?: { force?: boolean }): Promise<void>;
}

export interface RemoteSource {
Expand Down
2 changes: 0 additions & 2 deletions src/@types/vscode.proposed.chatContextProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ declare module 'vscode' {
/**
* An optional command that is executed when the context item is clicked.
* The original context item will be passed as the first argument to the command.
* The original context item will be passed as the first argument to the command.
*/
command?: Command;
}
Expand Down Expand Up @@ -158,7 +157,6 @@ declare module 'vscode' {
* `resolveChatContext` is only called for items that do not have a `value`.
*
* Called when the resource is a webview or a text editor.
* Called when the resource is a webview or a text editor.
*
* @param options Options include the resource for which to provide context.
* @param token A cancellation token.
Expand Down
231 changes: 219 additions & 12 deletions src/@types/vscode.proposed.chatParticipantAdditions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

// version: 3

declare module 'vscode' {

export interface ChatParticipant {
Expand Down Expand Up @@ -96,6 +98,108 @@ declare module 'vscode' {
constructor(title: string, message: string | MarkdownString, data: any, buttons?: string[]);
}

/**
* An option for a question in a carousel.
*/
export interface ChatQuestionOption {
/**
* Unique identifier for the option.
*/
id: string;
/**
* The display label for the option.
*/
label: string;
/**
* The value returned when this option is selected.
*/
value: unknown;
}

/**
* The type of question for a chat question carousel.
*/
export enum ChatQuestionType {
/**
* A free-form text input question.
*/
Text = 1,
/**
* A single-select question with radio buttons.
*/
SingleSelect = 2,
/**
* A multi-select question with checkboxes.
*/
MultiSelect = 3
}

/**
* A question to be displayed in a question carousel.
*/
export class ChatQuestion {
/**
* Unique identifier for the question.
*/
id: string;
/**
* The type of question: Text for free-form input, SingleSelect for radio buttons, MultiSelect for checkboxes.
*/
type: ChatQuestionType;
/**
* The title/header of the question.
*/
title: string;
/**
* Optional detailed message or description for the question.
*/
message?: string | MarkdownString;
/**
* Options for singleSelect or multiSelect questions.
*/
options?: ChatQuestionOption[];
/**
* The id(s) of the default selected option(s).
* For SingleSelect, this should be a single option id.
* For MultiSelect, this can be an array of option ids.
*/
defaultValue?: string | string[];
/**
* Whether to allow free-form text input in addition to predefined options.
* When true, users can provide their own text answer even for SingleSelect or MultiSelect questions.
*/
allowFreeformInput?: boolean;

constructor(
id: string,
type: ChatQuestionType,
title: string,
options?: {
message?: string | MarkdownString;
options?: ChatQuestionOption[];
defaultValue?: string | string[];
allowFreeformInput?: boolean;
}
);
}

/**
* A carousel view for presenting multiple questions inline in the chat.
* The UI is displayed but does not block the chat input.
*/
export class ChatResponseQuestionCarouselPart {
/**
* The questions to display in the carousel.
*/
questions: ChatQuestion[];
/**
* Whether users can skip answering the questions.
*/
allowSkip: boolean;

constructor(questions: ChatQuestion[], allowSkip?: boolean);
}

export class ChatResponseCodeCitationPart {
value: Uri;
license: string;
Expand Down Expand Up @@ -162,6 +266,66 @@ declare module 'vscode' {
output: McpToolInvocationContentData[];
}

export enum ChatTodoStatus {
NotStarted = 1,
InProgress = 2,
Completed = 3
}

export interface ChatTodoToolInvocationData {
todoList: Array<{
id: number;
title: string;
status: ChatTodoStatus;
}>;
}

/**
* Generic tool result data that displays input and output in collapsible sections.
*/
export interface ChatSimpleToolResultData {
/**
* The input to display.
*/
input: string;
/**
* The output to display.
*/
output: string;
}


export interface ChatToolResourcesInvocationData {
/**
* Array of file URIs or locations to display as a collapsible list
*/
values: Array<Uri | Location>;
}

export class ChatSubagentToolInvocationData {
/**
* A description of the subagent's purpose or task.
*/
description?: string;

/**
* The name of the subagent being invoked.
*/
agentName?: string;

/**
* The prompt given to the subagent.
*/
prompt?: string;

/**
* The result text from the subagent after completion.
*/
result?: string;

constructor(description?: string, agentName?: string, prompt?: string, result?: string);
}

export class ChatToolInvocationPart {
toolName: string;
toolCallId: string;
Expand All @@ -171,11 +335,16 @@ declare module 'vscode' {
pastTenseMessage?: string | MarkdownString;
isConfirmed?: boolean;
isComplete?: boolean;
toolSpecificData?: ChatTerminalToolInvocationData;
fromSubAgent?: boolean;
toolSpecificData?: ChatTerminalToolInvocationData | ChatMcpToolInvocationData | ChatTodoToolInvocationData | ChatSimpleToolResultData | ChatToolResourcesInvocationData | ChatSubagentToolInvocationData;
subAgentInvocationId?: string;
presentation?: 'hidden' | 'hiddenAfterComplete' | undefined;

constructor(toolName: string, toolCallId: string, isError?: boolean);
/**
* If this flag is set, this will be treated as an update to any previous tool call with the same id.
*/
enablePartialUpdate?: boolean;

constructor(toolName: string, toolCallId: string, errorMessage?: string);
}

/**
Expand Down Expand Up @@ -244,7 +413,31 @@ declare module 'vscode' {
constructor(uris: Uri[], callback: () => Thenable<unknown>);
}

export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatResponsePullRequestPart | ChatPrepareToolInvocationPart | ChatToolInvocationPart | ChatResponseMultiDiffPart | ChatResponseThinkingProgressPart | ChatResponseExternalEditPart;
/**
* Internal type that lists all the proposed chat response parts. This is used to generate `ExtendedChatResponsePart`
* which is the actual type used in this API. This is done so that other proposals can easily add their own response parts
* without having to modify this file.
*/
export interface ExtendedChatResponseParts {
ChatResponsePart: ChatResponsePart;
ChatResponseTextEditPart: ChatResponseTextEditPart;
ChatResponseNotebookEditPart: ChatResponseNotebookEditPart;
ChatResponseWorkspaceEditPart: ChatResponseWorkspaceEditPart;
ChatResponseConfirmationPart: ChatResponseConfirmationPart;
ChatResponseCodeCitationPart: ChatResponseCodeCitationPart;
ChatResponseReferencePart2: ChatResponseReferencePart2;
ChatResponseMovePart: ChatResponseMovePart;
ChatResponseExtensionsPart: ChatResponseExtensionsPart;
ChatResponsePullRequestPart: ChatResponsePullRequestPart;
ChatToolInvocationPart: ChatToolInvocationPart;
ChatResponseMultiDiffPart: ChatResponseMultiDiffPart;
ChatResponseThinkingProgressPart: ChatResponseThinkingProgressPart;
ChatResponseExternalEditPart: ChatResponseExternalEditPart;
ChatResponseQuestionCarouselPart: ChatResponseQuestionCarouselPart;
}

export type ExtendedChatResponsePart = ExtendedChatResponseParts[keyof ExtendedChatResponseParts];

export class ChatResponseWarningPart {
value: MarkdownString;
constructor(value: string | MarkdownString);
Expand Down Expand Up @@ -348,12 +541,16 @@ declare module 'vscode' {
}

export class ChatResponsePullRequestPart {
readonly uri: Uri;
/**
* @deprecated use `command` instead
*/
readonly uri?: Uri;
readonly command: Command;
readonly linkTag: string;
readonly title: string;
readonly description: string;
readonly author: string;
constructor(uri: Uri, title: string, description: string, author: string, linkTag: string);
constructor(uriOrCommand: Uri | Command, title: string, description: string, author: string, linkTag: string);
}

export interface ChatResponseStream {
Expand Down Expand Up @@ -408,6 +605,15 @@ declare module 'vscode' {
*/
confirmation(title: string, message: string | MarkdownString, data: any, buttons?: string[]): void;

/**
* Show an inline carousel of questions to gather information from the user.
* This is a blocking call that waits for the user to submit or skip the questions.
* @param questions Array of questions to display to the user
* @param allowSkip Whether the user can skip questions without answering
* @returns A promise that resolves with the user's answers, or undefined if skipped
*/
questionCarousel(questions: ChatQuestion[], allowSkip?: boolean): Thenable<Record<string, unknown> | undefined>;

/**
* Push a warning to this stream. Short-hand for
* `push(new ChatResponseWarningPart(message))`.
Expand Down Expand Up @@ -442,6 +648,13 @@ declare module 'vscode' {
push(part: ExtendedChatResponsePart): void;

clearToPreviousToolInvocation(reason: ChatResponseClearToPreviousToolInvocationReason): void;

/**
* Report token usage information for this request.
* This is typically called when the underlying language model provides usage statistics.
* @param usage Token usage information including prompt and completion tokens
*/
usage(usage: ChatResultUsage): void;
}

export enum ChatResponseReferencePartStatusKind {
Expand Down Expand Up @@ -633,12 +846,6 @@ declare module 'vscode' {
* An optional detail string that will be rendered at the end of the response in certain UI contexts.
*/
details?: string;

/**
* Token usage information for this request, if available.
* This is typically provided by the underlying language model.
*/
readonly usage?: ChatResultUsage;
}

export namespace chat {
Expand Down
Loading