diff --git a/src/@types/vscode.proposed.chatContextProvider.d.ts b/src/@types/vscode.proposed.chatContextProvider.d.ts index 173c5dd11f..e230959182 100644 --- a/src/@types/vscode.proposed.chatContextProvider.d.ts +++ b/src/@types/vscode.proposed.chatContextProvider.d.ts @@ -73,6 +73,8 @@ declare module 'vscode' { * Chat context items can be provided without a `value`, as the `value` can be resolved later using `resolveChatContext`. * `resolveChatContext` is only called for items that do not have a `value`. * + * Currently only called when the resource is a webview. + * * @param options Options include the resource for which to provide context. * @param token A cancellation token. */ diff --git a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts index f4ce44cd9e..71520fa1ec 100644 --- a/src/@types/vscode.proposed.chatParticipantAdditions.d.ts +++ b/src/@types/vscode.proposed.chatParticipantAdditions.d.ts @@ -32,7 +32,8 @@ declare module 'vscode' { export class ChatResponseCodeblockUriPart { isEdit?: boolean; value: Uri; - constructor(value: Uri, isEdit?: boolean); + undoStopId?: string; + constructor(value: Uri, isEdit?: boolean, undoStopId?: string); } /** @@ -170,7 +171,7 @@ declare module 'vscode' { export class ChatResponseExternalEditPart { uris: Uri[]; callback: () => Thenable; - applied: Thenable; + applied: Thenable; constructor(uris: Uri[], callback: () => Thenable); } @@ -314,7 +315,7 @@ declare module 'vscode' { * tracked as agent edits. This can be used to track edits made from * external tools that don't generate simple {@link textEdit textEdits}. */ - externalEdit(target: Uri | Uri[], callback: () => Thenable): Thenable; + externalEdit(target: Uri | Uri[], callback: () => Thenable): Thenable; markdownWithVulnerabilities(value: string | MarkdownString, vulnerabilities: ChatVulnerability[]): void; codeblockUri(uri: Uri, isEdit?: boolean): void; diff --git a/src/@types/vscode.proposed.chatParticipantPrivate.d.ts b/src/@types/vscode.proposed.chatParticipantPrivate.d.ts index 9f9d0a4b6a..c4a40a62c0 100644 --- a/src/@types/vscode.proposed.chatParticipantPrivate.d.ts +++ b/src/@types/vscode.proposed.chatParticipantPrivate.d.ts @@ -30,12 +30,17 @@ declare module 'vscode' { } export class ChatRequestEditorData { + + readonly editor: TextEditor; + //TODO@API should be the editor document: TextDocument; selection: Selection; + + /** @deprecated */ wholeRange: Range; - constructor(document: TextDocument, selection: Selection, wholeRange: Range); + constructor(editor: TextEditor, document: TextDocument, selection: Selection, wholeRange: Range); } export class ChatRequestNotebookData { @@ -148,6 +153,11 @@ declare module 'vscode' { } export class ChatResponseTurn2 { + /** + * The id of the chat response. Used to identity an interaction with any of the chat surfaces. + */ + readonly id?: string; + /** * The content that was received from the chat participant. Only the stream parts that represent actual content (not metadata) are represented. */ @@ -309,4 +319,65 @@ declare module 'vscode' { } // #endregion + + // #region CustomAgentsProvider + + /** + * Represents a custom agent resource file (e.g., .agent.md or .prompt.md) available for a repository. + */ + export interface CustomAgentResource { + /** + * The unique identifier/name of the custom agent resource. + */ + readonly name: string; + + /** + * A description of what the custom agent resource does. + */ + readonly description: string; + + /** + * The URI to the agent or prompt resource file. + */ + readonly uri: Uri; + + /** + * Indicates whether the custom agent resource is editable. Defaults to false. + */ + readonly isEditable?: boolean; + } + + /** + * Options for querying custom agents. + */ + export interface CustomAgentQueryOptions { } + + /** + * A provider that supplies custom agent resources (from .agent.md and .prompt.md files) for repositories. + */ + export interface CustomAgentsProvider { + /** + * An optional event to signal that custom agents have changed. + */ + readonly onDidChangeCustomAgents?: Event; + + /** + * Provide the list of custom agent resources available for a given repository. + * @param options Optional query parameters. + * @param token A cancellation token. + * @returns An array of custom agent resources or a promise that resolves to such. + */ + provideCustomAgents(options: CustomAgentQueryOptions, token: CancellationToken): ProviderResult; + } + + export namespace chat { + /** + * Register a provider for custom agents. + * @param provider The custom agents provider. + * @returns A disposable that unregisters the provider when disposed. + */ + export function registerCustomAgentsProvider(provider: CustomAgentsProvider): Disposable; + } + + // #endregion } diff --git a/src/@types/vscode.proposed.chatSessionsProvider.d.ts b/src/@types/vscode.proposed.chatSessionsProvider.d.ts index aab1337d50..bd4e624430 100644 --- a/src/@types/vscode.proposed.chatSessionsProvider.d.ts +++ b/src/@types/vscode.proposed.chatSessionsProvider.d.ts @@ -122,7 +122,7 @@ declare module 'vscode' { /** * Statistics about the chat session. */ - statistics?: { + changes?: readonly ChatSessionChangedFile[] | { /** * Number of files edited during the session. */ @@ -140,6 +140,30 @@ declare module 'vscode' { }; } + export class ChatSessionChangedFile { + /** + * URI of the file. + */ + modifiedUri: Uri; + + /** + * File opened when the user takes the 'compare' action. + */ + originalUri?: Uri; + + /** + * Number of insertions made during the session. + */ + insertions: number; + + /** + * Number of deletions made during the session. + */ + deletions: number; + + constructor(modifiedUri: Uri, insertions: number, deletions: number, originalUri?: Uri); + } + export interface ChatSession { /** * The full history of the session @@ -179,10 +203,39 @@ declare module 'vscode' { readonly requestHandler: ChatRequestHandler | undefined; } + /** + * Event fired when chat session options change. + */ + export interface ChatSessionOptionChangeEvent { + /** + * Identifier of the chat session being updated. + */ + readonly resource: Uri; + /** + * Collection of option identifiers and their new values. Only the options that changed are included. + */ + readonly updates: ReadonlyArray<{ + /** + * Identifier of the option that changed (for example `model`). + */ + readonly optionId: string; + + /** + * The new value assigned to the option. When `undefined`, the option is cleared. + */ + readonly value: string | ChatSessionProviderOptionItem; + }>; + } + /** * Provides the content for a chat session rendered using the native chat UI. */ export interface ChatSessionContentProvider { + /** + * Event that the provider can fire to signal that the options for a chat session have changed. + */ + readonly onDidChangeChatSessionOptions?: Event; + /** * Provides the chat session content for a given uri. * @@ -275,12 +328,22 @@ declare module 'vscode' { */ readonly name: string; + /** + * Optional description shown in tooltips. + */ + readonly description?: string; + /** * When true, this option is locked and cannot be changed by the user. * The option will still be visible in the UI but will be disabled. * Use this when an option is set but cannot be hot-swapped (e.g., model already initialized). */ readonly locked?: boolean; + + /** + * An icon for the option item shown in UI. + */ + readonly icon?: ThemeIcon; } /** diff --git a/src/github/copilotRemoteAgent.ts b/src/github/copilotRemoteAgent.ts index 4a50176de1..8b2f53540b 100644 --- a/src/github/copilotRemoteAgent.ts +++ b/src/github/copilotRemoteAgent.ts @@ -1086,7 +1086,7 @@ export class CopilotRemoteAgentManager extends Disposable { timing: { startTime: timestampNumber }, - statistics: pullRequest.item.additions !== undefined && pullRequest.item.deletions !== undefined && (pullRequest.item.additions > 0 || pullRequest.item.deletions > 0) ? { + changes: pullRequest.item.additions !== undefined && pullRequest.item.deletions !== undefined && (pullRequest.item.additions > 0 || pullRequest.item.deletions > 0) ? { insertions: pullRequest.item.additions, deletions: pullRequest.item.deletions, files: fileCount