Skip to content

Commit a0970e0

Browse files
authored
Fix build (#8208)
1 parent 40b39d9 commit a0970e0

File tree

5 files changed

+143
-6
lines changed

5 files changed

+143
-6
lines changed

src/@types/vscode.proposed.chatContextProvider.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ declare module 'vscode' {
7373
* Chat context items can be provided without a `value`, as the `value` can be resolved later using `resolveChatContext`.
7474
* `resolveChatContext` is only called for items that do not have a `value`.
7575
*
76+
* Currently only called when the resource is a webview.
77+
*
7678
* @param options Options include the resource for which to provide context.
7779
* @param token A cancellation token.
7880
*/

src/@types/vscode.proposed.chatParticipantAdditions.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ declare module 'vscode' {
3232
export class ChatResponseCodeblockUriPart {
3333
isEdit?: boolean;
3434
value: Uri;
35-
constructor(value: Uri, isEdit?: boolean);
35+
undoStopId?: string;
36+
constructor(value: Uri, isEdit?: boolean, undoStopId?: string);
3637
}
3738

3839
/**
@@ -170,7 +171,7 @@ declare module 'vscode' {
170171
export class ChatResponseExternalEditPart {
171172
uris: Uri[];
172173
callback: () => Thenable<unknown>;
173-
applied: Thenable<void>;
174+
applied: Thenable<string>;
174175
constructor(uris: Uri[], callback: () => Thenable<unknown>);
175176
}
176177

@@ -314,7 +315,7 @@ declare module 'vscode' {
314315
* tracked as agent edits. This can be used to track edits made from
315316
* external tools that don't generate simple {@link textEdit textEdits}.
316317
*/
317-
externalEdit<T>(target: Uri | Uri[], callback: () => Thenable<T>): Thenable<T>;
318+
externalEdit(target: Uri | Uri[], callback: () => Thenable<unknown>): Thenable<string>;
318319

319320
markdownWithVulnerabilities(value: string | MarkdownString, vulnerabilities: ChatVulnerability[]): void;
320321
codeblockUri(uri: Uri, isEdit?: boolean): void;

src/@types/vscode.proposed.chatParticipantPrivate.d.ts

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,17 @@ declare module 'vscode' {
3030
}
3131

3232
export class ChatRequestEditorData {
33+
34+
readonly editor: TextEditor;
35+
3336
//TODO@API should be the editor
3437
document: TextDocument;
3538
selection: Selection;
39+
40+
/** @deprecated */
3641
wholeRange: Range;
3742

38-
constructor(document: TextDocument, selection: Selection, wholeRange: Range);
43+
constructor(editor: TextEditor, document: TextDocument, selection: Selection, wholeRange: Range);
3944
}
4045

4146
export class ChatRequestNotebookData {
@@ -148,6 +153,11 @@ declare module 'vscode' {
148153
}
149154

150155
export class ChatResponseTurn2 {
156+
/**
157+
* The id of the chat response. Used to identity an interaction with any of the chat surfaces.
158+
*/
159+
readonly id?: string;
160+
151161
/**
152162
* The content that was received from the chat participant. Only the stream parts that represent actual content (not metadata) are represented.
153163
*/
@@ -309,4 +319,65 @@ declare module 'vscode' {
309319
}
310320

311321
// #endregion
322+
323+
// #region CustomAgentsProvider
324+
325+
/**
326+
* Represents a custom agent resource file (e.g., .agent.md or .prompt.md) available for a repository.
327+
*/
328+
export interface CustomAgentResource {
329+
/**
330+
* The unique identifier/name of the custom agent resource.
331+
*/
332+
readonly name: string;
333+
334+
/**
335+
* A description of what the custom agent resource does.
336+
*/
337+
readonly description: string;
338+
339+
/**
340+
* The URI to the agent or prompt resource file.
341+
*/
342+
readonly uri: Uri;
343+
344+
/**
345+
* Indicates whether the custom agent resource is editable. Defaults to false.
346+
*/
347+
readonly isEditable?: boolean;
348+
}
349+
350+
/**
351+
* Options for querying custom agents.
352+
*/
353+
export interface CustomAgentQueryOptions { }
354+
355+
/**
356+
* A provider that supplies custom agent resources (from .agent.md and .prompt.md files) for repositories.
357+
*/
358+
export interface CustomAgentsProvider {
359+
/**
360+
* An optional event to signal that custom agents have changed.
361+
*/
362+
readonly onDidChangeCustomAgents?: Event<void>;
363+
364+
/**
365+
* Provide the list of custom agent resources available for a given repository.
366+
* @param options Optional query parameters.
367+
* @param token A cancellation token.
368+
* @returns An array of custom agent resources or a promise that resolves to such.
369+
*/
370+
provideCustomAgents(options: CustomAgentQueryOptions, token: CancellationToken): ProviderResult<CustomAgentResource[]>;
371+
}
372+
373+
export namespace chat {
374+
/**
375+
* Register a provider for custom agents.
376+
* @param provider The custom agents provider.
377+
* @returns A disposable that unregisters the provider when disposed.
378+
*/
379+
export function registerCustomAgentsProvider(provider: CustomAgentsProvider): Disposable;
380+
}
381+
382+
// #endregion
312383
}

src/@types/vscode.proposed.chatSessionsProvider.d.ts

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ declare module 'vscode' {
122122
/**
123123
* Statistics about the chat session.
124124
*/
125-
statistics?: {
125+
changes?: readonly ChatSessionChangedFile[] | {
126126
/**
127127
* Number of files edited during the session.
128128
*/
@@ -140,6 +140,30 @@ declare module 'vscode' {
140140
};
141141
}
142142

143+
export class ChatSessionChangedFile {
144+
/**
145+
* URI of the file.
146+
*/
147+
modifiedUri: Uri;
148+
149+
/**
150+
* File opened when the user takes the 'compare' action.
151+
*/
152+
originalUri?: Uri;
153+
154+
/**
155+
* Number of insertions made during the session.
156+
*/
157+
insertions: number;
158+
159+
/**
160+
* Number of deletions made during the session.
161+
*/
162+
deletions: number;
163+
164+
constructor(modifiedUri: Uri, insertions: number, deletions: number, originalUri?: Uri);
165+
}
166+
143167
export interface ChatSession {
144168
/**
145169
* The full history of the session
@@ -179,10 +203,39 @@ declare module 'vscode' {
179203
readonly requestHandler: ChatRequestHandler | undefined;
180204
}
181205

206+
/**
207+
* Event fired when chat session options change.
208+
*/
209+
export interface ChatSessionOptionChangeEvent {
210+
/**
211+
* Identifier of the chat session being updated.
212+
*/
213+
readonly resource: Uri;
214+
/**
215+
* Collection of option identifiers and their new values. Only the options that changed are included.
216+
*/
217+
readonly updates: ReadonlyArray<{
218+
/**
219+
* Identifier of the option that changed (for example `model`).
220+
*/
221+
readonly optionId: string;
222+
223+
/**
224+
* The new value assigned to the option. When `undefined`, the option is cleared.
225+
*/
226+
readonly value: string | ChatSessionProviderOptionItem;
227+
}>;
228+
}
229+
182230
/**
183231
* Provides the content for a chat session rendered using the native chat UI.
184232
*/
185233
export interface ChatSessionContentProvider {
234+
/**
235+
* Event that the provider can fire to signal that the options for a chat session have changed.
236+
*/
237+
readonly onDidChangeChatSessionOptions?: Event<ChatSessionOptionChangeEvent>;
238+
186239
/**
187240
* Provides the chat session content for a given uri.
188241
*
@@ -275,12 +328,22 @@ declare module 'vscode' {
275328
*/
276329
readonly name: string;
277330

331+
/**
332+
* Optional description shown in tooltips.
333+
*/
334+
readonly description?: string;
335+
278336
/**
279337
* When true, this option is locked and cannot be changed by the user.
280338
* The option will still be visible in the UI but will be disabled.
281339
* Use this when an option is set but cannot be hot-swapped (e.g., model already initialized).
282340
*/
283341
readonly locked?: boolean;
342+
343+
/**
344+
* An icon for the option item shown in UI.
345+
*/
346+
readonly icon?: ThemeIcon;
284347
}
285348

286349
/**

src/github/copilotRemoteAgent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ export class CopilotRemoteAgentManager extends Disposable {
10861086
timing: {
10871087
startTime: timestampNumber
10881088
},
1089-
statistics: pullRequest.item.additions !== undefined && pullRequest.item.deletions !== undefined && (pullRequest.item.additions > 0 || pullRequest.item.deletions > 0) ? {
1089+
changes: pullRequest.item.additions !== undefined && pullRequest.item.deletions !== undefined && (pullRequest.item.additions > 0 || pullRequest.item.deletions > 0) ? {
10901090
insertions: pullRequest.item.additions,
10911091
deletions: pullRequest.item.deletions,
10921092
files: fileCount

0 commit comments

Comments
 (0)