import type { RedisPublisher } from "./agent/events.js"; export interface BrokerEventPublisherOptions { /** Ship a batch of frames to the broker (RunnerControlClient.publishTelemetry). */ send: (frames: string[]) => Promise; /** Flush once this many frames are buffered (default 16). */ maxBatch?: number; /** Flush a partial batch after this long since the first buffered frame (default 200ms). */ maxDelayMs?: number; } export declare class BrokerEventPublisher implements RedisPublisher { private readonly send; private readonly maxBatch; private readonly maxDelayMs; private buffer; private timer; constructor(opts: BrokerEventPublisherOptions); /** RedisPublisher contract: buffer the frame; flush on size, else arm the delay timer. The * `channel` is ignored — the broker derives it from the run token (the run's own channel). The * return value (subscriber count) is unused by the run-event emitter, so we resolve 0. */ publish(_channel: string, message: string): Promise; /** Ship whatever is buffered now (and cancel any pending timer). Errors are logged, not thrown. */ flush(): Promise; /** Drain the final batch at run end (the worker calls this in cleanup). */ close(): Promise; }