feat(websocket): integrate A2UI message handling and answer callback registration

This commit is contained in:
catlog22
2026-02-03 21:18:19 +08:00
parent bb4cd0529e
commit 9bb50a13fa
4 changed files with 30 additions and 2 deletions

View File

@@ -58,6 +58,23 @@ export class A2UIWebSocketHandler {
timestamp: number;
}>();
private answerCallback?: (answer: QuestionAnswer) => boolean;
/**
* Register callback for handling question answers
* @param callback - Function to handle incoming answers
*/
registerAnswerCallback(callback: (answer: QuestionAnswer) => boolean): void {
this.answerCallback = callback;
}
/**
* Get the registered answer callback
*/
getAnswerCallback(): ((answer: QuestionAnswer) => boolean) | undefined {
return this.answerCallback;
}
/**
* Send A2UI surface to all connected clients
* @param surfaceUpdate - A2UI surface update to send