diff --git a/src/vs/workbench/api/browser/mainThreadChatAgents2.ts b/src/vs/workbench/api/browser/mainThreadChatAgents2.ts index e0cebf411d9..99bf1033707 100644 --- a/src/vs/workbench/api/browser/mainThreadChatAgents2.ts +++ b/src/vs/workbench/api/browser/mainThreadChatAgents2.ts @@ -92,7 +92,7 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA this._chatService.transferChatSession({ sessionId, inputValue }, URI.revive(toWorkspace)); } - $registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionChatAgentMetadata, dynamicProps: { name: string; description: string } | undefined): void { + $registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionChatAgentMetadata, dynamicProps: { name: string; description: string; publisherDisplayName: string } | undefined): void { const staticAgentRegistration = this._chatAgentService.getAgent(id); if (!staticAgentRegistration && !dynamicProps) { if (this._chatAgentService.getAgentsByName(id).length) { @@ -138,8 +138,8 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA description: dynamicProps.description, extensionId: extension, extensionDisplayName: extensionDescription?.displayName ?? extension.value, - extensionPublisherId: extensionDescription?.publisher ?? '', // extensionDescription _should_ be present at this point, since this extension is active and registering agents - extensionPublisherDisplayName: extensionDescription?.publisherDisplayName, + extensionPublisherId: '', + publisherDisplayName: dynamicProps.publisherDisplayName, metadata: revive(metadata), slashCommands: [], locations: [ChatAgentLocation.Panel] // TODO all dynamic participants are panel only? diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index e4b0c0478d7..3caf8e8556a 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -1422,9 +1422,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I checkProposedApiEnabled(extension, 'chatParticipant'); return extHostChatAgents2.createChatAgent(extension, id, handler); }, - createDynamicChatParticipant(id: string, name: string, description: string, handler: vscode.ChatExtendedRequestHandler): vscode.ChatParticipant { + createDynamicChatParticipant(id: string, name: string, publisherName: string, description: string, handler: vscode.ChatExtendedRequestHandler): vscode.ChatParticipant { checkProposedApiEnabled(extension, 'chatParticipantAdditions'); - return extHostChatAgents2.createDynamicChatAgent(extension, id, name, description, handler); + return extHostChatAgents2.createDynamicChatAgent(extension, id, name, publisherName, description, handler); } }; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index acfb4457a55..e5e5b09e8cb 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1221,7 +1221,7 @@ export interface IExtensionChatAgentMetadata extends Dto { } export interface MainThreadChatAgentsShape2 extends IDisposable { - $registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionChatAgentMetadata, dynamicProps: { name: string; description: string } | undefined): void; + $registerAgent(handle: number, extension: ExtensionIdentifier, id: string, metadata: IExtensionChatAgentMetadata, dynamicProps: { name: string; description: string; publisherDisplayName: string } | undefined): void; $registerAgentCompletionsProvider(handle: number, triggerCharacters: string[]): void; $unregisterAgentCompletionsProvider(handle: number): void; $updateAgent(handle: number, metadataUpdate: IExtensionChatAgentMetadata): void; diff --git a/src/vs/workbench/api/common/extHostChatAgents2.ts b/src/vs/workbench/api/common/extHostChatAgents2.ts index 165da541365..7279fb1512e 100644 --- a/src/vs/workbench/api/common/extHostChatAgents2.ts +++ b/src/vs/workbench/api/common/extHostChatAgents2.ts @@ -17,7 +17,7 @@ import { URI } from 'vs/base/common/uri'; import { Location } from 'vs/editor/common/languages'; import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { ILogService } from 'vs/platform/log/common/log'; -import { ExtHostChatAgentsShape2, IChatAgentCompletionItem, IChatAgentHistoryEntryDto, IMainContext, MainContext, MainThreadChatAgentsShape2 } from 'vs/workbench/api/common/extHost.protocol'; +import { ExtHostChatAgentsShape2, IChatAgentCompletionItem, IChatAgentHistoryEntryDto, IExtensionChatAgentMetadata, IMainContext, MainContext, MainThreadChatAgentsShape2 } from 'vs/workbench/api/common/extHost.protocol'; import { CommandsConverter, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; import * as typeConvert from 'vs/workbench/api/common/extHostTypeConverters'; import * as extHostTypes from 'vs/workbench/api/common/extHostTypes'; @@ -237,12 +237,12 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS return agent.apiAgent; } - createDynamicChatAgent(extension: IExtensionDescription, id: string, name: string, description: string, handler: vscode.ChatExtendedRequestHandler): vscode.ChatParticipant { + createDynamicChatAgent(extension: IExtensionDescription, id: string, name: string, publisherName: string, description: string, handler: vscode.ChatExtendedRequestHandler): vscode.ChatParticipant { const handle = ExtHostChatAgents2._idPool++; const agent = new ExtHostChatAgent(extension, id, this._proxy, handle, handler); this._agents.set(handle, agent); - this._proxy.$registerAgent(handle, extension.identifier, id, { isSticky: true }, { name, description }); + this._proxy.$registerAgent(handle, extension.identifier, id, { isSticky: true } satisfies IExtensionChatAgentMetadata, { name, description, publisherDisplayName: publisherName }); return agent.apiAgent; } diff --git a/src/vs/workbench/contrib/chat/browser/chatAgentHover.ts b/src/vs/workbench/contrib/chat/browser/chatAgentHover.ts index 9a66865acf4..55e72653021 100644 --- a/src/vs/workbench/contrib/chat/browser/chatAgentHover.ts +++ b/src/vs/workbench/contrib/chat/browser/chatAgentHover.ts @@ -25,7 +25,6 @@ export class ChatAgentHover extends Disposable { private readonly icon: HTMLElement; private readonly name: HTMLElement; private readonly extensionName: HTMLElement; - private readonly verifiedBadge: HTMLElement; private readonly publisherName: HTMLElement; private readonly description: HTMLElement; @@ -64,13 +63,12 @@ export class ChatAgentHover extends Disposable { hoverElement.separator.textContent = '|'; - this.verifiedBadge = dom.$('span.extension-verified-publisher', undefined, renderIcon(verifiedPublisherIcon)); - this.verifiedBadge.style.display = 'none'; + const verifiedBadge = dom.$('span.extension-verified-publisher', undefined, renderIcon(verifiedPublisherIcon)); this.publisherName = dom.$('span.chat-agent-hover-publisher-name'); dom.append( hoverElement.publisher, - this.verifiedBadge, + verifiedBadge, this.publisherName); const label = localize('marketplaceLabel', "View in Marketplace") + '.'; @@ -106,22 +104,31 @@ export class ChatAgentHover extends Disposable { this.icon.replaceChildren(dom.$('.avatar.codicon-avatar', undefined, avatarIcon)); } + this.domNode.classList.toggle('noExtensionName', !!agent.isDynamic); + this.name.textContent = `@${agent.name}`; this.extensionName.textContent = agent.extensionDisplayName; - this.publisherName.textContent = agent.extensionPublisherDisplayName ?? agent.extensionPublisherId; + this.publisherName.textContent = agent.publisherDisplayName ?? agent.extensionPublisherId; + + let description = agent.description ?? ''; + if (description) { + if (!description.match(/\. *$/)) { + description += '.'; + } + } - const description = agent.description && !agent.description.endsWith('.') ? - `${agent.description}. ` : - (agent.description || ''); this.description.textContent = description; - const cancel = this._register(new CancellationTokenSource()); - this.extensionService.getExtensions([{ id: agent.extensionId.value }], cancel.token).then(extensions => { - cancel.dispose(); - const extension = extensions[0]; - if (extension?.publisherDomain?.verified) { - this.verifiedBadge.style.display = ''; - } - }); + this.domNode.classList.toggle('verifiedPublisher', false); + if (!agent.isDynamic) { + const cancel = this._register(new CancellationTokenSource()); + this.extensionService.getExtensions([{ id: agent.extensionId.value }], cancel.token).then(extensions => { + cancel.dispose(); + const extension = extensions[0]; + if (extension?.publisherDomain?.verified) { + this.domNode.classList.toggle('verifiedPublisher', true); + } + }); + } } } diff --git a/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.ts b/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.ts index 13e3a369b7f..078dffefec5 100644 --- a/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.ts +++ b/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.ts @@ -42,7 +42,7 @@ export class ChatMarkdownDecorationsRenderer { let text = part.text; const isDupe = this.chatAgentService.getAgentsByName(part.agent.name).length > 1; if (isDupe) { - text += ` (${part.agent.extensionPublisherDisplayName})`; + text += ` (${part.agent.publisherDisplayName})`; } result += `[${text}](${agentRefUrl}?${encodeURIComponent(part.agent.id)})`; diff --git a/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.ts b/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.ts index 3ba58f37bf9..c50724ba6d1 100644 --- a/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.ts +++ b/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.ts @@ -206,7 +206,7 @@ export class ChatExtensionPointHandler implements IWorkbenchContribution { providerDescriptor.id, { extensionId: extension.description.identifier, - extensionPublisherDisplayName: extension.description.publisherDisplayName ?? extension.description.publisher, // May not be present in OSS + publisherDisplayName: extension.description.publisherDisplayName ?? extension.description.publisher, // May not be present in OSS extensionPublisherId: extension.description.publisher, extensionDisplayName: extension.description.displayName ?? extension.description.name, id: providerDescriptor.id, diff --git a/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts b/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts index 61201d37420..30fd0e2f170 100644 --- a/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts +++ b/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.ts @@ -213,7 +213,7 @@ class InputEditorDecorations extends Disposable { const textDecorations: IDecorationOptions[] | undefined = []; if (agentPart) { const isDupe = !!this.chatAgentService.getAgents().find(other => other.name === agentPart.agent.name && other.id !== agentPart.agent.id); - const publisher = isDupe ? `(${agentPart.agent.extensionPublisherDisplayName}) ` : ''; + const publisher = isDupe ? `(${agentPart.agent.publisherDisplayName}) ` : ''; const agentHover = `${publisher}${agentPart.agent.description}`; textDecorations.push({ range: agentPart.editorRange, hoverMessage: new MarkdownString(agentHover) }); if (agentSubcommandPart) { @@ -361,7 +361,7 @@ class AgentCompletions extends Disposable { return { // Leading space is important because detail has no space at the start by design label: isDupe ? - { label: withAt, description: a.description, detail: ` (${a.extensionPublisherDisplayName})` } : + { label: withAt, description: a.description, detail: ` (${a.publisherDisplayName})` } : withAt, insertText: `${withAt} `, detail: a.description, @@ -452,7 +452,7 @@ class AgentCompletions extends Disposable { return { label: isDupe ? - { label: agentLabel, description: agent.description, detail: ` (${agent.extensionPublisherDisplayName})` } : + { label: agentLabel, description: agent.description, detail: ` (${agent.publisherDisplayName})` } : agentLabel, detail, filterText: `${chatSubcommandLeader}${agent.name}`, diff --git a/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css b/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css index e39b61cf7fd..068ffd872ee 100644 --- a/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css +++ b/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css @@ -37,6 +37,14 @@ color: var(--vscode-extensionIcon-verifiedForeground); } +.chat-agent-hover .extension-verified-publisher { + display: none; +} + +.chat-agent-hover.verifiedPublisher .extension-verified-publisher { + display: flex; +} + .chat-agent-hover-header .chat-agent-hover-name { font-size: 15px; font-weight: 600; @@ -47,6 +55,11 @@ gap: 6px; } +.chat-agent-hover.noExtensionName .chat-agent-hover-separator, +.chat-agent-hover.noExtensionName .chat-agent-hover-extension-name { + display: none; +} + .chat-agent-hover-separator { opacity: 0.7; } @@ -57,6 +70,7 @@ } .chat-agent-hover .chat-agent-hover-marketplace-button .monaco-text-button { + margin-left: 3px; display: unset; padding: unset; border: unset; diff --git a/src/vs/workbench/contrib/chat/common/chatAgents.ts b/src/vs/workbench/contrib/chat/common/chatAgents.ts index 97a01f4c47b..609a7c18dbf 100644 --- a/src/vs/workbench/contrib/chat/common/chatAgents.ts +++ b/src/vs/workbench/contrib/chat/common/chatAgents.ts @@ -60,10 +60,13 @@ export interface IChatAgentData { description?: string; extensionId: ExtensionIdentifier; extensionPublisherId: string; - extensionPublisherDisplayName?: string; + /** This is the extension publisher id, or, in the case of a dynamically registered participant (remote agent), whatever publisher name we have for it */ + publisherDisplayName?: string; extensionDisplayName: string; /** The agent invoked when no agent is specified */ isDefault?: boolean; + /** This agent is not contributed in package.json, but is registered dynamically */ + isDynamic?: boolean; metadata: IChatAgentMetadata; slashCommands: IChatAgentCommand[]; defaultImplicitVariables?: string[]; @@ -236,6 +239,7 @@ export class ChatAgentService implements IChatAgentService { } registerDynamicAgent(data: IChatAgentData, agentImpl: IChatAgentImplementation): IDisposable { + data.isDynamic = true; const agent = { data, impl: agentImpl }; this._agents.push(agent); this._onDidChangeAgents.fire(new MergedChatAgent(data, agentImpl)); @@ -327,7 +331,7 @@ export class MergedChatAgent implements IChatAgent { get description(): string { return this.data.description ?? ''; } get extensionId(): ExtensionIdentifier { return this.data.extensionId; } get extensionPublisherId(): string { return this.data.extensionPublisherId; } - get extensionPublisherDisplayName() { return this.data.extensionPublisherDisplayName; } + get extensionPublisherDisplayName() { return this.data.publisherDisplayName; } get extensionDisplayName(): string { return this.data.extensionDisplayName; } get isDefault(): boolean | undefined { return this.data.isDefault; } get metadata(): IChatAgentMetadata { return this.data.metadata; } diff --git a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_and_subcommand_after_newline.0.snap b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_and_subcommand_after_newline.0.snap index 2bdf072855b..bffaba0f3ea 100644 --- a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_and_subcommand_after_newline.0.snap +++ b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_and_subcommand_after_newline.0.snap @@ -32,7 +32,7 @@ value: "nullExtensionDescription", _lower: "nullextensiondescription" }, - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", extensionPublisherId: "", locations: [ "panel" ], diff --git a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_and_subcommand_with_leading_whitespace.0.snap b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_and_subcommand_with_leading_whitespace.0.snap index 99377413491..b2392476b7c 100644 --- a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_and_subcommand_with_leading_whitespace.0.snap +++ b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_and_subcommand_with_leading_whitespace.0.snap @@ -32,7 +32,7 @@ value: "nullExtensionDescription", _lower: "nullextensiondescription" }, - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", extensionPublisherId: "", locations: [ "panel" ], diff --git a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_with_question_mark.0.snap b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_with_question_mark.0.snap index 79c66573c25..1965499f050 100644 --- a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_with_question_mark.0.snap +++ b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_with_question_mark.0.snap @@ -18,7 +18,7 @@ value: "nullExtensionDescription", _lower: "nullextensiondescription" }, - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", extensionPublisherId: "", locations: [ "panel" ], diff --git a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_with_subcommand_after_text.0.snap b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_with_subcommand_after_text.0.snap index 9aaa5755d16..4ec681f874b 100644 --- a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_with_subcommand_after_text.0.snap +++ b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agent_with_subcommand_after_text.0.snap @@ -18,7 +18,7 @@ value: "nullExtensionDescription", _lower: "nullextensiondescription" }, - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", extensionPublisherId: "", locations: [ "panel" ], diff --git a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents__subCommand.0.snap b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents__subCommand.0.snap index 6e9d8ffe8e4..fde8b6955f1 100644 --- a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents__subCommand.0.snap +++ b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents__subCommand.0.snap @@ -18,7 +18,7 @@ value: "nullExtensionDescription", _lower: "nullextensiondescription" }, - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", extensionPublisherId: "", locations: [ "panel" ], diff --git a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents_and_variables_and_multiline.0.snap b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents_and_variables_and_multiline.0.snap index 86bcbd48b28..776a2546830 100644 --- a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents_and_variables_and_multiline.0.snap +++ b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents_and_variables_and_multiline.0.snap @@ -18,7 +18,7 @@ value: "nullExtensionDescription", _lower: "nullextensiondescription" }, - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", extensionPublisherId: "", locations: [ "panel" ], diff --git a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents_and_variables_and_multiline__part2.0.snap b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents_and_variables_and_multiline__part2.0.snap index 8f0bb2e8da1..60d1a54726f 100644 --- a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents_and_variables_and_multiline__part2.0.snap +++ b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatRequestParser_agents_and_variables_and_multiline__part2.0.snap @@ -18,7 +18,7 @@ value: "nullExtensionDescription", _lower: "nullextensiondescription" }, - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", extensionPublisherId: "", locations: [ "panel" ], diff --git a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatService_can_deserialize.0.snap b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatService_can_deserialize.0.snap index d441c9b2021..83ff5c45284 100644 --- a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatService_can_deserialize.0.snap +++ b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatService_can_deserialize.0.snap @@ -29,7 +29,7 @@ _lower: "nullextensiondescription" }, extensionPublisherId: "", - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", locations: [ "panel" ], metadata: { }, @@ -67,7 +67,7 @@ _lower: "nullextensiondescription" }, extensionPublisherId: "", - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", locations: [ "panel" ], metadata: { }, diff --git a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatService_can_serialize.1.snap b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatService_can_serialize.1.snap index c207dd0e8aa..c4e365a2a54 100644 --- a/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatService_can_serialize.1.snap +++ b/src/vs/workbench/contrib/chat/test/common/__snapshots__/ChatService_can_serialize.1.snap @@ -28,7 +28,7 @@ _lower: "nullextensiondescription" }, extensionPublisherId: "", - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", locations: [ "panel" ], metadata: { @@ -70,7 +70,7 @@ _lower: "nullextensiondescription" }, extensionPublisherId: "", - extensionPublisherDisplayName: "", + publisherDisplayName: "", extensionDisplayName: "", locations: [ "panel" ], metadata: { diff --git a/src/vs/workbench/contrib/chat/test/common/chatRequestParser.test.ts b/src/vs/workbench/contrib/chat/test/common/chatRequestParser.test.ts index d96fd480651..6d4713e110d 100644 --- a/src/vs/workbench/contrib/chat/test/common/chatRequestParser.test.ts +++ b/src/vs/workbench/contrib/chat/test/common/chatRequestParser.test.ts @@ -115,7 +115,7 @@ suite('ChatRequestParser', () => { }); const getAgentWithSlashCommands = (slashCommands: IChatAgentCommand[]) => { - return { id: 'agent', name: 'agent', extensionId: nullExtensionDescription.identifier, extensionPublisherDisplayName: '', extensionDisplayName: '', extensionPublisherId: '', locations: [ChatAgentLocation.Panel], metadata: {}, slashCommands } satisfies IChatAgentData; + return { id: 'agent', name: 'agent', extensionId: nullExtensionDescription.identifier, publisherDisplayName: '', extensionDisplayName: '', extensionPublisherId: '', locations: [ChatAgentLocation.Panel], metadata: {}, slashCommands } satisfies IChatAgentData; }; test('agent with subcommand after text', async () => { diff --git a/src/vs/workbench/contrib/chat/test/common/chatService.test.ts b/src/vs/workbench/contrib/chat/test/common/chatService.test.ts index 03efc208a54..bcca1f9bc98 100644 --- a/src/vs/workbench/contrib/chat/test/common/chatService.test.ts +++ b/src/vs/workbench/contrib/chat/test/common/chatService.test.ts @@ -35,7 +35,7 @@ const chatAgentWithUsedContext: IChatAgent = { id: chatAgentWithUsedContextId, name: chatAgentWithUsedContextId, extensionId: nullExtensionDescription.identifier, - extensionPublisherDisplayName: '', + publisherDisplayName: '', extensionPublisherId: '', extensionDisplayName: '', locations: [ChatAgentLocation.Panel], @@ -92,8 +92,8 @@ suite('ChatService', () => { return {}; }, } satisfies IChatAgentImplementation; - testDisposables.add(chatAgentService.registerAgent('testAgent', { name: 'testAgent', id: 'testAgent', isDefault: true, extensionId: nullExtensionDescription.identifier, extensionPublisherId: '', extensionPublisherDisplayName: '', extensionDisplayName: '', locations: [ChatAgentLocation.Panel], metadata: {}, slashCommands: [] })); - testDisposables.add(chatAgentService.registerAgent(chatAgentWithUsedContextId, { name: chatAgentWithUsedContextId, id: chatAgentWithUsedContextId, extensionId: nullExtensionDescription.identifier, extensionPublisherId: '', extensionPublisherDisplayName: '', extensionDisplayName: '', locations: [ChatAgentLocation.Panel], metadata: {}, slashCommands: [] })); + testDisposables.add(chatAgentService.registerAgent('testAgent', { name: 'testAgent', id: 'testAgent', isDefault: true, extensionId: nullExtensionDescription.identifier, extensionPublisherId: '', publisherDisplayName: '', extensionDisplayName: '', locations: [ChatAgentLocation.Panel], metadata: {}, slashCommands: [] })); + testDisposables.add(chatAgentService.registerAgent(chatAgentWithUsedContextId, { name: chatAgentWithUsedContextId, id: chatAgentWithUsedContextId, extensionId: nullExtensionDescription.identifier, extensionPublisherId: '', publisherDisplayName: '', extensionDisplayName: '', locations: [ChatAgentLocation.Panel], metadata: {}, slashCommands: [] })); testDisposables.add(chatAgentService.registerAgentImplementation('testAgent', agent)); chatAgentService.updateAgent('testAgent', { requester: { name: 'test' }, fullName: 'test' }); }); diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts index 1b75d872724..83a2621d73a 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts @@ -318,7 +318,7 @@ export class InlineChatSessionServiceImpl implements IInlineChatSessionService { id: _bridgeAgentId, name: 'editor', extensionId: nullExtensionDescription.identifier, - extensionPublisherDisplayName: '', + publisherDisplayName: '', extensionDisplayName: '', extensionPublisherId: '', isDefault: true, diff --git a/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts b/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts index 5bf79cc3971..e202d8dfe58 100644 --- a/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts +++ b/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatController.test.ts @@ -183,7 +183,7 @@ suite('InteractiveChatController', function () { store.add(chatAgentService.registerDynamicAgent({ extensionId: nullExtensionDescription.identifier, - extensionPublisherDisplayName: '', + publisherDisplayName: '', extensionDisplayName: '', extensionPublisherId: '', id: 'testAgent', diff --git a/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatSession.test.ts b/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatSession.test.ts index b28ae6f4ad7..4e3f576d720 100644 --- a/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatSession.test.ts +++ b/src/vs/workbench/contrib/inlineChat/test/browser/inlineChatSession.test.ts @@ -130,7 +130,7 @@ suite('InlineChatSession', function () { instaService.get(IChatAgentService).registerDynamicAgent({ extensionId: nullExtensionDescription.identifier, - extensionPublisherDisplayName: '', + publisherDisplayName: '', extensionDisplayName: '', extensionPublisherId: '', id: 'testAgent', diff --git a/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts b/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts index fe78e9389a6..f8914d33b94 100644 --- a/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +++ b/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts @@ -158,7 +158,7 @@ declare module 'vscode' { */ export function createChatParticipant(id: string, handler: ChatExtendedRequestHandler): ChatParticipant; - export function createDynamicChatParticipant(id: string, name: string, description: string, handler: ChatExtendedRequestHandler): ChatParticipant; + export function createDynamicChatParticipant(id: string, name: string, publisherName: string, description: string, handler: ChatExtendedRequestHandler): ChatParticipant; } /*