export class AgentMessageQueue {
    _steeringQueue = [];
    _followUpQueue = [];
    _steeringMode;
    _followUpMode;
    constructor(options) {
        this._steeringMode = options?.steeringMode ?? 'one-at-a-time';
        this._followUpMode = options?.followUpMode ?? 'one-at-a-time';
    }
    steer(message) {
        this._steeringQueue.push(message);
    }
    followUp(message) {
        this._followUpQueue.push(message);
    }
    setSteeringMode(mode) {
        this._steeringMode = mode;
    }
    getSteeringMode() {
        return this._steeringMode;
    }
    setFollowUpMode(mode) {
        this._followUpMode = mode;
    }
    getFollowUpMode() {
        return this._followUpMode;
    }
    clearSteeringQueue() {
        this._steeringQueue = [];
    }
    clearFollowUpQueue() {
        this._followUpQueue = [];
    }
    clearAllQueues() {
        this._steeringQueue = [];
        this._followUpQueue = [];
    }
    hasQueuedMessages() {
        return this._steeringQueue.length > 0 || this._followUpQueue.length > 0;
    }
    dequeueSteeringMessages() {
        return this._dequeue('_steeringQueue', this._steeringMode);
    }
    dequeueFollowUpMessages() {
        return this._dequeue('_followUpQueue', this._followUpMode);
    }
    reset() {
        this.clearAllQueues();
    }
    _dequeue(queueKey, mode) {
        const queue = this[queueKey];
        if (mode === 'one-at-a-time') {
            if (queue.length === 0)
                return [];
            const first = queue[0];
            this[queueKey] = queue.slice(1);
            return [first];
        }
        this[queueKey] = [];
        return queue.slice();
    }
}
//# sourceMappingURL=agent-message-queue.js.map