Skip to main content

chat

@codebolt/codeboltjs


Variable: chat

const chat: {
askQuestion: (question: string, buttons: string[], withFeedback: boolean) => Promise<string>;
checkForSteeringMessage: () => SteeringMessage | null;
getChatHistory: (threadId: string) => Promise<ChatMessage>;
onSteeringMessageReceived: () => Promise<SteeringMessage | null>;
processFinished: () => void;
processStarted: (onStopClicked?: (message: StopProcessMessage) => void) => ProcessControl | ProcessControlWithCleanup;
sendConfirmationRequest: (confirmationMessage: string, buttons: string[], withFeedback: boolean) => Promise<string>;
sendMessage: (message: string, payload?: object) => void;
sendNotificationEvent: (notificationMessage: string, type:
| "browser"
| "terminal"
| "git"
| "debug"
| "planner"
| "editor"
| "preview") => void;
setRequestHandler: (handler: RequestHandler) => void;
stopProcess: () => void;
waitforReply: (message: string) => Promise<UserMessage>;
};

Defined in: packages/codeboltjs/src/modules/chat.ts:40

Chat module to interact with the WebSocket server.

Type Declaration

NameTypeDescriptionDefined in
askQuestion()(question: string, buttons: string[], withFeedback: boolean) => Promise<string>-packages/codeboltjs/src/modules/chat.ts:186
checkForSteeringMessage()() => SteeringMessage | nullChecks if any steering message has been received.packages/codeboltjs/src/modules/chat.ts:213
getChatHistory()(threadId: string) => Promise<ChatMessage>Retrieves the chat history from the server.packages/codeboltjs/src/modules/chat.ts:45
onSteeringMessageReceived()() => Promise<SteeringMessage | null>Waits for a steering message.packages/codeboltjs/src/modules/chat.ts:229
processFinished()() => voidStops the ongoing process. Sends a specific message to the server to stop the process.packages/codeboltjs/src/modules/chat.ts:166
processStarted()(onStopClicked?: (message: StopProcessMessage) => void) => ProcessControl | ProcessControlWithCleanupNotifies the server that a process has started and sets up a listener for stopProcessClicked events.packages/codeboltjs/src/modules/chat.ts:115
sendConfirmationRequest()(confirmationMessage: string, buttons: string[], withFeedback: boolean) => Promise<string>Sends a confirmation request to the server with two options: Yes or No.packages/codeboltjs/src/modules/chat.ts:175
sendMessage()(message: string, payload?: object) => voidSends a message through the WebSocket connection.packages/codeboltjs/src/modules/chat.ts:89
sendNotificationEvent()(notificationMessage: string, type: | "browser" | "terminal" | "git" | "debug" | "planner" | "editor" | "preview") => voidSends a notification event to the server.packages/codeboltjs/src/modules/chat.ts:201
setRequestHandler()(handler: RequestHandler) => voidSets a global request handler for all incoming messagespackages/codeboltjs/src/modules/chat.ts:58
stopProcess()() => voidStops the ongoing process. Sends a specific message to the server to stop the process.packages/codeboltjs/src/modules/chat.ts:157
waitforReply()(message: string) => Promise<UserMessage>Waits for a reply to a sent message.packages/codeboltjs/src/modules/chat.ts:101