diff --git a/chat-sample/package.json b/chat-sample/package.json index c914ff232..4d25b65db 100644 --- a/chat-sample/package.json +++ b/chat-sample/package.json @@ -9,7 +9,7 @@ }, "version": "0.1.0", "engines": { - "vscode": "^1.86.0" + "vscode": "^1.88.0" }, "extensionDependencies": [ "github.copilot-chat" @@ -17,20 +17,34 @@ "categories": [ "Other" ], - "activationEvents": [ - "onStartupFinished" - ], + "activationEvents": [ ], "enabledApiProposals": [ "chatParticipant", - "chatVariableResolver", + "chatVariableResolver", "languageModels" ], "contributes": { + "chatParticipants": [ + { + "name": "cat", + "description": "Meow! What can I teach you?", + "commands": [ + { + "name": "teach", + "description": "Pick at random a computer science concept then explain it in purfect way of a cat" + }, + { + "name": "play", + "description": "Do whatever you want, you are a cat after all" + } + ] + } + ], "commands": [ - { - "command": "cat.namesInEditor", - "title": "Use Cat Names in Editor" - } + { + "command": "cat.namesInEditor", + "title": "Use Cat Names in Editor" + } ] }, "main": "./out/extension.js", diff --git a/chat-sample/src/extension.ts b/chat-sample/src/extension.ts index fd4efa821..f159b8ace 100644 --- a/chat-sample/src/extension.ts +++ b/chat-sample/src/extension.ts @@ -71,16 +71,6 @@ export function activate(context: vscode.ExtensionContext) { const cat = vscode.chat.createChatParticipant(CAT_PARTICIPANT_NAME, handler); cat.isSticky = true; // Cat is persistant, whenever a user starts interacting with @cat, @cat will automatically be added to the following messages cat.iconPath = vscode.Uri.joinPath(context.extensionUri, 'cat.jpeg'); - cat.description = vscode.l10n.t('Meow! What can I teach you?'); - cat.commandProvider = { - provideCommands(token) { - return [ - { name: 'teach', description: 'Pick at random a computer science concept then explain it in purfect way of a cat' }, - { name: 'play', description: 'Do whatever you want, you are a cat after all' } - ]; - } - }; - cat.followupProvider = { provideFollowups(result: ICatChatResult, token: vscode.CancellationToken) { return [{ diff --git a/chat-sample/src/vscode.proposed.chatParticipant.d.ts b/chat-sample/src/vscode.proposed.chatParticipant.d.ts index 5fcc77cb7..b6794145d 100644 --- a/chat-sample/src/vscode.proposed.chatParticipant.d.ts +++ b/chat-sample/src/vscode.proposed.chatParticipant.d.ts @@ -143,49 +143,6 @@ declare module 'vscode' { readonly kind: ChatResultFeedbackKind; } - export interface ChatCommand { - /** - * A short name by which this command is referred to in the UI, e.g. `fix` or - * `explain` for commands that fix an issue or explain code. - * - * **Note**: The name should be unique among the commands provided by this participant. - */ - readonly name: string; - - /** - * Human-readable description explaining what this command does. - */ - readonly description: string; - - /** - * When the user clicks this command in `/help`, this text will be submitted to this command - */ - readonly sampleRequest?: string; - - /** - * Whether executing the command puts the chat into a persistent mode, where the command is automatically added to the chat input for the next message. - */ - readonly isSticky?: boolean; - } - - /** - * A ChatCommandProvider returns {@link ChatCommands commands} that can be invoked on a chat participant using `/`. For example, `@participant /command`. - * These can be used as shortcuts to let the user explicitly invoke different functionalities provided by the participant. - */ - export interface ChatCommandProvider { - /** - * Returns a list of commands that its participant is capable of handling. A command - * can be selected by the user and will then be passed to the {@link ChatRequestHandler handler} - * via the {@link ChatRequest.command command} property. - * - * - * @param token A cancellation token. - * @returns A list of commands. The lack of a result can be signaled by returning `undefined`, `null`, or - * an empty array. - */ - provideCommands(context: ChatContext, token: CancellationToken): ProviderResult; - } - /** * A followup question suggested by the participant. */ @@ -239,11 +196,6 @@ declare module 'vscode' { */ readonly name: string; - /** - * A human-readable description explaining what this participant does. - */ - description?: string; - /** * Icon for the participant shown in UI. */ @@ -263,11 +215,6 @@ declare module 'vscode' { */ requestHandler: ChatRequestHandler; - /** - * This provider will be called to retrieve the participant's commands. - */ - commandProvider?: ChatCommandProvider; - /** * This provider will be called once after each request to retrieve suggested followup questions. */