export class StubMcpCompletionBridge {
    listeners = new Map();
    scheduled = new Map();
    subscribeCalls = [];
    unsubscribeCalls = [];
    scheduleCompletion(jobId, completion) {
        this.scheduled.set(jobId, completion);
    }
    subscribe(jobId, listener) {
        this.subscribeCalls.push(jobId);
        this.listeners.set(jobId, listener);
        const scheduled = this.scheduled.get(jobId);
        if (scheduled) {
            this.scheduled.delete(jobId);
            setImmediate(() => listener(scheduled));
        }
    }
    unsubscribe(jobId) {
        this.unsubscribeCalls.push(jobId);
        this.listeners.delete(jobId);
    }
    publish(jobId, completion) {
        const listener = this.listeners.get(jobId);
        if (listener) {
            listener(completion);
        }
    }
}
//# sourceMappingURL=mcpCompletion.stub.js.map