diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts index 44fa4396796..6fb0262e132 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts @@ -67,7 +67,7 @@ suite('chat', () => { interactive.sendInteractiveRequestToProvider('provider', { message: '@participant /hello friend' }); } else { assert.strictEqual(request.context.history.length, 1); - assert.strictEqual(request.context.history[0].participant.participant, 'participant'); + assert.strictEqual(request.context.history[0].participant.name, 'participant'); assert.strictEqual(request.context.history[0].command, 'hello'); } }); diff --git a/src/vs/workbench/api/common/extHostChatAgents2.ts b/src/vs/workbench/api/common/extHostChatAgents2.ts index ad00314cac6..9f9266babba 100644 --- a/src/vs/workbench/api/common/extHostChatAgents2.ts +++ b/src/vs/workbench/api/common/extHostChatAgents2.ts @@ -231,11 +231,11 @@ export class ExtHostChatAgents2 implements ExtHostChatAgentsShape2 { { ...ehResult, metadata: undefined }; // REQUEST turn - res.push(new extHostTypes.ChatRequestTurn(h.request.message, h.request.command, h.request.variables.variables.map(typeConvert.ChatAgentResolvedVariable.to), { extensionId: '', participant: h.request.agentId })); + res.push(new extHostTypes.ChatRequestTurn(h.request.message, h.request.command, h.request.variables.variables.map(typeConvert.ChatAgentResolvedVariable.to), { extensionId: '', name: h.request.agentId })); // RESPONSE turn const parts = coalesce(h.response.map(r => typeConvert.ChatResponsePart.fromContent(r, this.commands.converter))); - res.push(new extHostTypes.ChatResponseTurn(parts, result, { extensionId: '', participant: h.request.agentId }, h.request.command)); + res.push(new extHostTypes.ChatResponseTurn(parts, result, { extensionId: '', name: h.request.agentId }, h.request.command)); } return res; @@ -508,9 +508,11 @@ class ExtHostChatAgent { updateMetadataSoon(); }, get fullName() { + checkProposedApiEnabled(that.extension, 'defaultChatParticipant'); return that._fullName ?? that.extension.displayName ?? that.extension.name; }, set fullName(v) { + checkProposedApiEnabled(that.extension, 'defaultChatParticipant'); that._fullName = v; updateMetadataSoon(); }, diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 4827cdfbfeb..4fb94e3f1c8 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -4257,7 +4257,7 @@ export class ChatRequestTurn implements vscode.ChatRequestTurn { readonly prompt: string, readonly command: string | undefined, readonly variables: vscode.ChatResolvedVariable[], - readonly participant: { extensionId: string; participant: string }, + readonly participant: { extensionId: string; name: string }, ) { } } @@ -4266,7 +4266,7 @@ export class ChatResponseTurn implements vscode.ChatResponseTurn { constructor( readonly response: ReadonlyArray, readonly result: vscode.ChatResult, - readonly participant: { extensionId: string; participant: string }, + readonly participant: { extensionId: string; name: string }, readonly command?: string ) { } } diff --git a/src/vscode-dts/vscode.proposed.chatParticipant.d.ts b/src/vscode-dts/vscode.proposed.chatParticipant.d.ts index ed62261761d..5fcc77cb7b5 100644 --- a/src/vscode-dts/vscode.proposed.chatParticipant.d.ts +++ b/src/vscode-dts/vscode.proposed.chatParticipant.d.ts @@ -23,7 +23,7 @@ declare module 'vscode' { /** * The name of the chat participant and contributing extension to which this request was directed. */ - readonly participant: { readonly extensionId: string; readonly participant: string }; + readonly participant: { readonly extensionId: string; readonly name: string }; /** * The name of the {@link ChatCommand command} that was selected for this request. @@ -35,7 +35,7 @@ declare module 'vscode' { */ readonly variables: ChatResolvedVariable[]; - private constructor(prompt: string, command: string | undefined, variables: ChatResolvedVariable[], participant: { extensionId: string; participant: string }); + private constructor(prompt: string, command: string | undefined, variables: ChatResolvedVariable[], participant: { extensionId: string; name: string }); } /** @@ -56,14 +56,14 @@ declare module 'vscode' { /** * The name of the chat participant and contributing extension that this response came from. */ - readonly participant: { readonly extensionId: string; readonly participant: string }; + readonly participant: { readonly extensionId: string; readonly name: string }; /** * The name of the command that this response came from. */ readonly command?: string; - private constructor(response: ReadonlyArray, result: ChatResult, participant: { extensionId: string; participant: string }); + private constructor(response: ReadonlyArray, result: ChatResult, participant: { extensionId: string; name: string }); } export interface ChatContext { @@ -239,16 +239,10 @@ declare module 'vscode' { */ readonly name: string; - /** - * The full name of this participant. - * TODO@API This is only used for the default participant, but it seems useful, so should we keep it so we can use it in the future? - */ - fullName: string; - /** * A human-readable description explaining what this participant does. */ - description: string; + description?: string; /** * Icon for the participant shown in UI. diff --git a/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts b/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts index e1c026a6557..07a2b6f5c42 100644 --- a/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts +++ b/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts @@ -18,6 +18,11 @@ declare module 'vscode' { */ isDefault?: boolean; + /** + * The full name of this participant. + */ + fullName?: string; + /** * When true, this participant is invoked when the user submits their query using ctrl/cmd+enter * TODO@API name