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 @@ -41,6 +41,8 @@ import {
4141 FileClickParams ,
4242 CONTEXT_COMMAND_NOTIFICATION_METHOD ,
4343 ContextCommandParams ,
44+ CREATE_PROMPT_NOTIFICATION_METHOD ,
45+ CreatePromptParams ,
4446} from './lsp'
4547
4648export const chatRequestType = new AutoParameterStructuresProtocolRequestType <
@@ -96,3 +98,6 @@ export const fileClickNotificationType = new ProtocolNotificationType<FileClickP
9698export const contextCommandsNotificationType = new ProtocolNotificationType < ContextCommandParams , void > (
9799 CONTEXT_COMMAND_NOTIFICATION_METHOD
98100)
101+ export const createPromptNotificationType = new ProtocolNotificationType < CreatePromptParams , void > (
102+ CREATE_PROMPT_NOTIFICATION_METHOD
103+ )
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import {
3939 chatUpdateNotificationType ,
4040 fileClickNotificationType ,
4141 contextCommandsNotificationType ,
42+ createPromptNotificationType ,
4243} from '../protocol'
4344import { createConnection } from 'vscode-languageserver/browser'
4445import {
@@ -142,7 +143,8 @@ export const baseRuntime = (connections: { reader: MessageReader; writer: Messag
142143 openTab : params => lspConnection . sendRequest ( openTabRequestType . method , params ) ,
143144 sendChatUpdate : params => lspConnection . sendNotification ( chatUpdateNotificationType . method , params ) ,
144145 onFileClicked : handler => lspConnection . onNotification ( fileClickNotificationType . method , handler ) ,
145- sendContextCommands : params => lspConnection . sendNotification ( contextCommandsNotificationType . method ) ,
146+ sendContextCommands : params => lspConnection . sendNotification ( contextCommandsNotificationType . method , params ) ,
147+ onCreatePrompt : handler => lspConnection . onNotification ( createPromptNotificationType . method , handler ) ,
146148 }
147149
148150 const identityManagement : IdentityManagement = {
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ import {
3838 fileClickNotificationType ,
3939 ContextCommandParams ,
4040 contextCommandsNotificationType ,
41+ CreatePromptParams ,
42+ createPromptNotificationType ,
4143} from '../../protocol'
4244import { Chat } from '../../server-interface'
4345
@@ -111,4 +113,8 @@ export class BaseChat implements Chat {
111113 public sendContextCommands ( params : ContextCommandParams ) {
112114 this . connection . sendNotification ( contextCommandsNotificationType . method , params )
113115 }
116+
117+ public onCreatePrompt ( handler : NotificationHandler < CreatePromptParams > ) {
118+ this . connection . onNotification ( createPromptNotificationType . method , handler )
119+ }
114120}
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121 ChatUpdateParams ,
2222 FileClickParams ,
2323 ContextCommandParams ,
24+ CreatePromptParams ,
2425} from '../protocol'
2526
2627/**
@@ -46,4 +47,5 @@ export type Chat = {
4647 sendChatUpdate : ( params : ChatUpdateParams ) => void
4748 onFileClicked : ( handler : NotificationHandler < FileClickParams > ) => void
4849 sendContextCommands : ( params : ContextCommandParams ) => void
50+ onCreatePrompt : ( handler : NotificationHandler < CreatePromptParams > ) => void
4951}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export const OPEN_TAB_REQUEST_METHOD = 'aws/chat/openTab'
1818export const CHAT_UPDATE_NOTIFICATION_METHOD = 'aws/chat/sendChatUpdate'
1919export const FILE_CLICK_NOTIFICATION_METHOD = 'aws/chat/fileClick'
2020export const CONTEXT_COMMAND_NOTIFICATION_METHOD = 'aws/chat/sendContextCommands'
21+ export const CREATE_PROMPT_NOTIFICATION_METHOD = 'aws/chat/createPrompt'
2122
2223export interface ChatItemAction {
2324 pillText : string
@@ -116,6 +117,8 @@ export interface QuickActionCommand {
116117 icon ?: IconType
117118}
118119
120+ export type IconType = 'file' | 'folder' | 'code-block' | 'list-add' | 'magic' | 'help' | 'trash'
121+
119122/**
120123 * Configuration object for registering chat quick actions groups.
121124 */
@@ -250,8 +253,6 @@ export interface ContextCommandGroup {
250253 commands : ContextCommand [ ]
251254}
252255
253- export type IconType = 'file' | 'folder' | 'code-block' | 'list-add' | 'magic' | 'help' | 'trash'
254-
255256export interface ContextCommand extends QuickActionCommand {
256257 id ?: string
257258 route ?: string [ ]
@@ -262,3 +263,7 @@ export interface ContextCommand extends QuickActionCommand {
262263export interface ContextCommandParams {
263264 contextCommandGroups : ContextCommandGroup [ ]
264265}
266+
267+ export interface CreatePromptParams {
268+ promptName : string
269+ }
You can’t perform that action at this time.
0 commit comments