mirror of
https://github.com/Bijit-Mondal/VoiceAgent.git
synced 2026-03-02 18:36:39 +00:00
feat: Introduce new core components for conversation and speech management
- Added ConversationManager for managing conversation history with configurable limits. - Implemented InputQueue for serial processing of input items. - Created SpeechManager for handling text-to-speech generation and streaming. - Developed StreamProcessor for processing LLM streams and forwarding events. - Added TranscriptionManager for audio transcription using AI SDK. - Introduced WebSocketManager for managing WebSocket connections and messaging. - Updated VoiceAgent to support new architecture and improved socket handling. - Refactored index files to export new core components.
This commit is contained in:
35
dist/core/WebSocketManager.d.ts
vendored
Normal file
35
dist/core/WebSocketManager.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { WebSocket } from "ws";
|
||||
import { EventEmitter } from "events";
|
||||
/**
|
||||
* Manages a single WebSocket connection lifecycle.
|
||||
* Handles connecting, attaching existing sockets, sending messages,
|
||||
* and clean disconnection.
|
||||
*/
|
||||
export declare class WebSocketManager extends EventEmitter {
|
||||
private socket?;
|
||||
private _isConnected;
|
||||
get isConnected(): boolean;
|
||||
get currentSocket(): WebSocket | undefined;
|
||||
/**
|
||||
* Connect to a WebSocket server by URL.
|
||||
*/
|
||||
connect(url: string): Promise<void>;
|
||||
/**
|
||||
* Attach an existing WebSocket (server-side usage).
|
||||
*/
|
||||
handleSocket(socket: WebSocket): void;
|
||||
/**
|
||||
* Send a JSON message via WebSocket if connected.
|
||||
* Gracefully handles send failures (e.g., socket closing mid-send).
|
||||
*/
|
||||
send(message: Record<string, unknown>): void;
|
||||
/**
|
||||
* Disconnect and clean up the current socket.
|
||||
*/
|
||||
disconnect(): void;
|
||||
/**
|
||||
* Attach internal event listeners on the current socket.
|
||||
*/
|
||||
private attachListeners;
|
||||
}
|
||||
//# sourceMappingURL=WebSocketManager.d.ts.map
|
||||
Reference in New Issue
Block a user