/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { EventEmitter } from 'node:events'; import type { PolicyEngine } from '../policy/policy-engine.js'; import { type Message } from './types.js'; export declare class MessageBus extends EventEmitter { private readonly policyEngine; private readonly debug; constructor(policyEngine: PolicyEngine, debug?: boolean); private isValidMessage; private emitMessage; publish(message: Message): Promise; subscribe(type: T['type'], listener: (message: T) => void): void; unsubscribe(type: T['type'], listener: (message: T) => void): void; /** * Request-response pattern: Publish a message and wait for a correlated response * This enables synchronous-style communication over the async MessageBus * The correlation ID is generated internally and added to the request */ request(request: Omit, responseType: TResponse['type'], timeoutMs?: number): Promise; }