0.1.15 • Published 4 months ago

@aws/chat-client v0.1.15

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

Q Chat Client

This package contains a chat client for the Q Language Server, that can be embedded in a webview. It uses MynahUI to render a web based chat interface.

Communication

The chat client communicates with the host application (e.g., an IDE extension) through postMessage requests to the webview:

  • When the host application sends a request, the client processes the message and sends it to the UI
  • When an event is triggered in the UI, the client sends a message through postMessage to the host application that rendered the chat client

Usage

To use the chat client, embed it in a webview within your application and handle the postMessage communication as needed. Chat client is based on inbound (from a destination to the chat client) and outbound events (from the chat client to a destination). Events consist of command and params:

interface SomeEvent {
    command: string;
    params: SomeOptions;
}

Inbound events

NameDescriptioncommandparams
sendChatPrompt responseProvides response to sendChatPrompt requestaws/chat/sendChatPromptChatResult
openTab requestRequest to open tab (creates tab if no tabId provided)aws/chat/openTabrequestID - ID shared between the webview and vscode client, OpenTabParams
sendToPromptRequest to send selection to promptsendToPromptSendToPromptParams
genericCommandRequest to execute generic commandgenericCommandGenericCommandParams
errorMessageRequest to show error in chat UIerrorMessageErrorParams
chatOptionsConfigures chat startup optionschatOptionsChatOptions
chatUpdateUpdates existing chat messagesaws/chat/sendChatUpdateChatUpdateParams
contextCommandSends context commands to the UIaws/chat/sendContextCommandsContextCommandParams
listConversations responseProvides response with list of history conversations to the UIaws/chat/listConversationsListConversationsResult
conversationClick responseProvides response to conversation click or action, specifying action execution resultaws/chat/conversationClickConversationClickResult
getSerializedChat requestRequest to get serialized chataws/chat/getSerializedChatGetSerializedChatParams
chatOptionsUpdateSends chat options update request from serveraws/chat/chatOptionsUpdateChatOptionsUpdateParams

Outbound events

NameDescriptioncommandparams
openTab responseProvides response to openTab requestaws/chat/openTabrequestID - ID shared between the webview and vscode client, UiMessageResultParams with result of type OpenTabResult
disclaimerAcknowledgedNotifies destination that legal disclaimer was acknowledged by a userdisclaimerAcknowledgedN/A
sendChatPromptSends a chat prompt to the serveraws/chat/sendChatPromptChatParams
sendQuickActionCommandSends a quick action commandaws/chat/quickActionQuickActionParams
tabAddedNotifies when a tab is addedaws/chat/tabAddTabAddParams
tabChangedNotifies when a tab is changedaws/chat/tabChangeTabChangeParams
tabRemovedNotifies when a tab is removedaws/chat/tabRemoveTabRemoveParams
insertToCursorPositionRequests to insert code at cursor positioninsertToCursorPositionInsertToCursorPositionParams
copyToClipboardRequests to copy code to clipboardcopyToClipboardCopyCodeToClipboardParams
authFollowUpClickedNotifies when an auth follow-up is clickedauthFollowUpClickedAuthFollowUpClickedParams
followUpClickedNotifies when a follow-up suggestion is clickedaws/chat/followUpClickFollowUpClickParams
sendFeedbackSends user feedbackaws/chat/feedbackFeedbackParams
linkClickNotifies when a link is clickedaws/chat/linkClickLinkClickParams
sourceLinkClickNotifies when a source link is clickedaws/chat/sourceLinkClickSourceLinkClickParams
infoLinkClickNotifies when an info link is clickedaws/chat/infoLinkClickInfoLinkClickParams
uiReadyNotifies when the UI is readyaws/chat/readyN/A
chatPromptOptionAcknowledgedNotifies when a chat prompt option is acknowledgedchatPromptOptionAcknowledgedChatPromptOptionAcknowledgedParams
createPromptRequests to create a promptaws/chat/createPromptCreatePromptParams
fileClickNotifies when a file is clickedaws/chat/fileClickFileClickParams
listConversationsRequests to list conversations with filter providedaws/chat/listConversationsListConversationsParams
conversationClickNotifies when a conversation is clickedaws/chat/conversationClickConversationClickParams
tabBarActionNotifies when a tab bar action is requestedaws/chat/tabBarActionTabBarActionParams
getSerializedChat responseProvides response to getSerializedChat requestaws/chat/getSerializedChatGetSerializedChatResult

Configuration

Configuration can be passed as an explicit parameter when creating chat inside of webview, for example:

amazonQChat.createChat(acquireVsCodeApi(), configuration);

Configuration values:

// Configures quick actions
quickActionCommands?: QuickActionCommandGroup[]

// Configures chat client not to show legal disclaimer as it has already been acknowledged before
disclaimerAcknowledged?: boolean
0.1.10

5 months ago

0.1.11

5 months ago

0.1.12

4 months ago

0.1.13

4 months ago

0.1.14

4 months ago

0.1.15

4 months ago

0.1.2

7 months ago

0.1.1

8 months ago

0.1.8

5 months ago

0.0.9

11 months ago

0.1.7

5 months ago

0.0.8

11 months ago

0.1.9

5 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.6

5 months ago

0.0.7

11 months ago

0.1.5

5 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago