mirror of
https://github.com/Bijit-Mondal/VoiceAgent.git
synced 2026-03-02 18:36:39 +00:00
- 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.
33 lines
952 B
TypeScript
33 lines
952 B
TypeScript
/**
|
|
* A generic serial input queue that ensures only one processor runs at a time.
|
|
*
|
|
* @template T The shape of each queued item (must include resolve/reject)
|
|
*/
|
|
export interface QueueItem<T = string> {
|
|
resolve: (v: T) => void;
|
|
reject: (e: unknown) => void;
|
|
}
|
|
export declare class InputQueue<T extends QueueItem<any>> {
|
|
private queue;
|
|
private processing;
|
|
/** Callback invoked for each item — must return a resolved value */
|
|
processor: (item: T) => Promise<any>;
|
|
/**
|
|
* Enqueue an item for serial processing.
|
|
*/
|
|
enqueue(item: T): void;
|
|
/**
|
|
* Reject all pending items (used on disconnect/destroy).
|
|
*/
|
|
rejectAll(reason: Error): void;
|
|
/**
|
|
* Number of items waiting in the queue.
|
|
*/
|
|
get length(): number;
|
|
/**
|
|
* Whether the queue is currently processing an item.
|
|
*/
|
|
get isProcessing(): boolean;
|
|
private drain;
|
|
}
|
|
//# sourceMappingURL=InputQueue.d.ts.map
|