File tree Expand file tree Collapse file tree 5 files changed +41
-1
lines changed
Expand file tree Collapse file tree 5 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ import {
4646 ContextCommandParams ,
4747 CREATE_PROMPT_NOTIFICATION_METHOD ,
4848 CreatePromptParams ,
49+ INLINE_CHAT_RESULT_NOTIFICATION_METHOD ,
50+ InlineChatResultParams ,
4951 ListConversationsParams ,
5052 ListConversationsResult ,
5153 LIST_CONVERSATIONS_REQUEST_METHOD ,
@@ -130,6 +132,13 @@ export const contextCommandsNotificationType = new ProtocolNotificationType<Cont
130132export const createPromptNotificationType = new ProtocolNotificationType < CreatePromptParams , void > (
131133 CREATE_PROMPT_NOTIFICATION_METHOD
132134)
135+ /**
136+ * The inline chat result notification is sent from client to server to notify the action taken by the user
137+ * from the suggested response returned by the server.
138+ */
139+ export const inlineChatResultNotificationType = new ProtocolNotificationType < InlineChatResultParams , void > (
140+ INLINE_CHAT_RESULT_NOTIFICATION_METHOD
141+ )
133142
134143// history
135144export const listConversationsRequestType = new AutoParameterStructuresProtocolRequestType <
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ import {
4141 inlineChatRequestType ,
4242 contextCommandsNotificationType ,
4343 createPromptNotificationType ,
44+ inlineChatResultNotificationType ,
4445 listConversationsRequestType ,
4546 conversationClickRequestType ,
4647 GetSerializedChatParams ,
@@ -167,6 +168,7 @@ export const baseRuntime = (connections: { reader: MessageReader; writer: Messag
167168 onFileClicked : handler => lspConnection . onNotification ( fileClickNotificationType . method , handler ) ,
168169 sendContextCommands : params => lspConnection . sendNotification ( contextCommandsNotificationType . method , params ) ,
169170 onCreatePrompt : handler => lspConnection . onNotification ( createPromptNotificationType . method , handler ) ,
171+ onInlineChatResult : handler => lspConnection . onNotification ( inlineChatResultNotificationType . method , handler ) ,
170172 onListConversations : handler => lspConnection . onRequest ( listConversationsRequestType . method , handler ) ,
171173 onConversationClick : handler => lspConnection . onRequest ( conversationClickRequestType . method , handler ) ,
172174 getSerializedChat : params => lspConnection . sendRequest ( getSerializedChatRequestType . method , params ) ,
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ import {
4343 contextCommandsNotificationType ,
4444 CreatePromptParams ,
4545 createPromptNotificationType ,
46+ InlineChatResultParams ,
47+ inlineChatResultNotificationType ,
4648 listConversationsRequestType ,
4749 ListConversationsParams ,
4850 ListConversationsResult ,
@@ -145,6 +147,10 @@ export class BaseChat implements Chat {
145147 this . connection . onNotification ( createPromptNotificationType . method , handler )
146148 }
147149
150+ public onInlineChatResult ( handler : NotificationHandler < InlineChatResultParams > ) {
151+ this . connection . onNotification ( inlineChatResultNotificationType . method , handler )
152+ }
153+
148154 public onListConversations ( handler : RequestHandler < ListConversationsParams , ListConversationsResult , void > ) {
149155 this . connection . onRequest ( listConversationsRequestType . method , handler )
150156 }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import {
2424 InlineChatResult ,
2525 ContextCommandParams ,
2626 CreatePromptParams ,
27+ InlineChatResultParams ,
2728 ListConversationsParams ,
2829 ListConversationsResult ,
2930 ConversationClickParams ,
@@ -67,4 +68,5 @@ export type Chat = {
6768 chatOptionsUpdate : ( params : ChatOptionsUpdateParams ) => void
6869 sendContextCommands : ( params : ContextCommandParams ) => void
6970 onCreatePrompt : ( handler : NotificationHandler < CreatePromptParams > ) => void
71+ onInlineChatResult : ( handler : NotificationHandler < InlineChatResultParams > ) => void
7072}
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export const CHAT_OPTIONS_UPDATE_NOTIFICATION_METHOD = 'aws/chat/chatOptionsUpda
2222// context
2323export const CONTEXT_COMMAND_NOTIFICATION_METHOD = 'aws/chat/sendContextCommands'
2424export const CREATE_PROMPT_NOTIFICATION_METHOD = 'aws/chat/createPrompt'
25+ export const INLINE_CHAT_RESULT_NOTIFICATION_METHOD = 'aws/chat/inlineChatResult'
2526// history
2627export const LIST_CONVERSATIONS_REQUEST_METHOD = 'aws/chat/listConversations'
2728export const CONVERSATION_CLICK_REQUEST_METHOD = 'aws/chat/conversationClick'
@@ -327,8 +328,28 @@ export interface CreatePromptParams {
327328 promptName : string
328329}
329330
330- // history
331+ export interface ProgrammingLanguage {
332+ languageName : string
333+ }
334+
335+ export type InlineChatUserDecision = 'ACCEPT' | 'REJECT' | 'DISMISS' | string
331336
337+ export interface InlineChatResultParams {
338+ requestId : string
339+ inputLength ?: number
340+ selectedLines ?: number
341+ suggestionAddedChars ?: number
342+ suggestionAddedLines ?: number
343+ suggestionDeletedChars ?: number
344+ suggestionDeletedLines ?: number
345+ codeIntent ?: boolean
346+ userDecision ?: InlineChatUserDecision
347+ responseStartLatency ?: number
348+ responseEndLatency ?: number
349+ programmingLanguage ?: ProgrammingLanguage
350+ }
351+
352+ // history
332353export type TextBasedFilterOption = {
333354 type : 'textarea' | 'textinput'
334355 placeholder ?: string
You can’t perform that action at this time.
0 commit comments