/** * Methods are bound arrow fields: upstream Pi's `createEventBus()` returns * closures, so extensions (e.g. `pi-gemini-acp`) detach `pi.events.on` and * `pi.events.emit` and call them without a receiver. */ export declare class EventBus { #private; emit: (channel: string, data: unknown) => void; on: (channel: string, handler: (data: unknown) => void) => (() => void); /** Whether `channel` has at least one listener. */ hasListeners: (channel: string) => boolean; /** * Calls `onChange` whenever `channel` gains its first listener (`true`) or loses its last * (`false`), so a forwarding emitter on another thread can drop frames nobody reads. * Returns the unsubscribe. */ watchListeners: (channel: string, onChange: (present: boolean) => void) => (() => void); clear: () => void; } /** * Publishes a subagent frame on the session bus and the observability bus. * SDK embedders may pass the same EventBus for both slots; the identity check * skips the aliased re-emit so listeners never see duplicate frames. */ export declare function emitSubagentFrame(eventBus: EventBus | undefined, subagentEventBus: EventBus | undefined, channel: string, payload: unknown): void;