🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@aws/chat-client

Package Overview
Dependencies
Maintainers
8
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws/chat-client

AWS Chat Client

0.1.10
latest
Source
npm
Version published
Weekly downloads
7.2K
-17.53%
Maintainers
8
Weekly downloads
 
Created
Source

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

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 acknowlegded by a userdisclaimerAcknowledgedN/A

TODO: Provide full list of events

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

FAQs

Package last updated on 14 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts