File tree Expand file tree Collapse file tree 5 files changed +23
-3
lines changed
Expand file tree Collapse file tree 5 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ import {
4343 InlineChatParams ,
4444 CONTEXT_COMMAND_NOTIFICATION_METHOD ,
4545 ContextCommandParams ,
46+ CREATE_PROMPT_NOTIFICATION_METHOD ,
47+ CreatePromptParams ,
4648} from './lsp'
4749
4850export const chatRequestType = new AutoParameterStructuresProtocolRequestType <
@@ -105,3 +107,6 @@ export const fileClickNotificationType = new ProtocolNotificationType<FileClickP
105107export const contextCommandsNotificationType = new ProtocolNotificationType < ContextCommandParams , void > (
106108 CONTEXT_COMMAND_NOTIFICATION_METHOD
107109)
110+ export const createPromptNotificationType = new ProtocolNotificationType < CreatePromptParams , void > (
111+ CREATE_PROMPT_NOTIFICATION_METHOD
112+ )
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ import {
4040 fileClickNotificationType ,
4141 inlineChatRequestType ,
4242 contextCommandsNotificationType ,
43+ createPromptNotificationType ,
4344} from '../protocol'
4445import { createConnection } from 'vscode-languageserver/browser'
4546import {
@@ -145,7 +146,8 @@ export const baseRuntime = (connections: { reader: MessageReader; writer: Messag
145146 openTab : params => lspConnection . sendRequest ( openTabRequestType . method , params ) ,
146147 sendChatUpdate : params => lspConnection . sendNotification ( chatUpdateNotificationType . method , params ) ,
147148 onFileClicked : handler => lspConnection . onNotification ( fileClickNotificationType . method , handler ) ,
148- sendContextCommands : params => lspConnection . sendNotification ( contextCommandsNotificationType . method ) ,
149+ sendContextCommands : params => lspConnection . sendNotification ( contextCommandsNotificationType . method , params ) ,
150+ onCreatePrompt : handler => lspConnection . onNotification ( createPromptNotificationType . method , handler ) ,
149151 }
150152
151153 const identityManagement : IdentityManagement = {
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ import {
4040 InlineChatParams ,
4141 ContextCommandParams ,
4242 contextCommandsNotificationType ,
43+ CreatePromptParams ,
44+ createPromptNotificationType ,
4345} from '../../protocol'
4446import { Chat } from '../../server-interface'
4547
@@ -117,4 +119,8 @@ export class BaseChat implements Chat {
117119 public sendContextCommands ( params : ContextCommandParams ) {
118120 this . connection . sendNotification ( contextCommandsNotificationType . method , params )
119121 }
122+
123+ public onCreatePrompt ( handler : NotificationHandler < CreatePromptParams > ) {
124+ this . connection . onNotification ( createPromptNotificationType . method , handler )
125+ }
120126}
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
2222 FileClickParams ,
2323 InlineChatParams ,
2424 ContextCommandParams ,
25+ CreatePromptParams ,
2526} from '../protocol'
2627
2728/**
@@ -48,4 +49,5 @@ export type Chat = {
4849 sendChatUpdate : ( params : ChatUpdateParams ) => void
4950 onFileClicked : ( handler : NotificationHandler < FileClickParams > ) => void
5051 sendContextCommands : ( params : ContextCommandParams ) => void
52+ onCreatePrompt : ( handler : NotificationHandler < CreatePromptParams > ) => void
5153}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export const CHAT_UPDATE_NOTIFICATION_METHOD = 'aws/chat/sendChatUpdate'
1919export const FILE_CLICK_NOTIFICATION_METHOD = 'aws/chat/fileClick'
2020export const INLINE_CHAT_REQUEST_METHOD = 'aws/chat/sendInlineChatPrompt'
2121export const CONTEXT_COMMAND_NOTIFICATION_METHOD = 'aws/chat/sendContextCommands'
22+ export const CREATE_PROMPT_NOTIFICATION_METHOD = 'aws/chat/createPrompt'
2223
2324export interface ChatItemAction {
2425 pillText : string
@@ -130,6 +131,8 @@ export interface QuickActionCommand {
130131 icon ?: IconType
131132}
132133
134+ export type IconType = 'file' | 'folder' | 'code-block' | 'list-add' | 'magic' | 'help' | 'trash'
135+
133136/**
134137 * Configuration object for registering chat quick actions groups.
135138 */
@@ -264,8 +267,6 @@ export interface ContextCommandGroup {
264267 commands : ContextCommand [ ]
265268}
266269
267- export type IconType = 'file' | 'folder' | 'code-block' | 'list-add' | 'magic' | 'help' | 'trash'
268-
269270export interface ContextCommand extends QuickActionCommand {
270271 id ?: string
271272 route ?: string [ ]
@@ -276,3 +277,7 @@ export interface ContextCommand extends QuickActionCommand {
276277export interface ContextCommandParams {
277278 contextCommandGroups : ContextCommandGroup [ ]
278279}
280+
281+ export interface CreatePromptParams {
282+ promptName : string
283+ }
You can’t perform that action at this time.
0 commit comments