mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-14 02:42:04 +08:00
feat(websocket): integrate A2UI message handling and answer callback registration
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { createHash } from 'crypto';
|
||||
import type { IncomingMessage } from 'http';
|
||||
import type { Duplex } from 'stream';
|
||||
import { a2uiWebSocketHandler, handleA2UIMessage } from './a2ui/A2UIWebSocketHandler.js';
|
||||
import { handleAnswer } from '../tools/ask-question.js';
|
||||
|
||||
// WebSocket clients for real-time notifications
|
||||
export const wsClients = new Set<Duplex>();
|
||||
@@ -174,6 +176,11 @@ export function handleWebSocketUpgrade(req: IncomingMessage, socket: Duplex, _he
|
||||
case 0x1: // Text frame
|
||||
if (payload) {
|
||||
console.log('[WS] Received:', payload);
|
||||
// Try to handle as A2UI message
|
||||
const handledAsA2UI = handleA2UIMessage(payload, a2uiWebSocketHandler, handleAnswer);
|
||||
if (handledAsA2UI) {
|
||||
console.log('[WS] Handled as A2UI message');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x8: // Close frame
|
||||
|
||||
Reference in New Issue
Block a user