Skip to content
Merged
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
2 changes: 2 additions & 0 deletions src/@types/vscode.proposed.chatContextProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
7 changes: 4 additions & 3 deletions src/@types/vscode.proposed.chatParticipantAdditions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -170,7 +171,7 @@ declare module 'vscode' {
export class ChatResponseExternalEditPart {
uris: Uri[];
callback: () => Thenable<unknown>;
applied: Thenable<void>;
applied: Thenable<string>;
constructor(uris: Uri[], callback: () => Thenable<unknown>);
}

Expand Down Expand Up @@ -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<T>(target: Uri | Uri[], callback: () => Thenable<T>): Thenable<T>;
externalEdit(target: Uri | Uri[], callback: () => Thenable<unknown>): Thenable<string>;

markdownWithVulnerabilities(value: string | MarkdownString, vulnerabilities: ChatVulnerability[]): void;
codeblockUri(uri: Uri, isEdit?: boolean): void;
Expand Down
73 changes: 72 additions & 1 deletion src/@types/vscode.proposed.chatParticipantPrivate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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<void>;

/**
* 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<CustomAgentResource[]>;
}

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
}
65 changes: 64 additions & 1 deletion src/@types/vscode.proposed.chatSessionsProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ declare module 'vscode' {
/**
* Statistics about the chat session.
*/
statistics?: {
changes?: readonly ChatSessionChangedFile[] | {
/**
* Number of files edited during the session.
*/
Expand All @@ -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
Expand Down Expand Up @@ -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<ChatSessionOptionChangeEvent>;

/**
* Provides the chat session content for a given uri.
*
Expand Down Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/github/copilotRemoteAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down