Files
VoiceAgent/dist/core/InputQueue.d.ts
Bijit Mondal 5e7eb469ae 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.
2026-02-23 16:15:49 +05:30

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