/** * In-process event bus for agent state transitions. * * Spec §5.8: "the file is canonical … the [notify] ping just makes detection * lower-latency." This bus is the in-process equivalent of the notify-socket * ping for SDK agents — they share the parent's event loop, so we can signal * the widget directly without serializing through a Unix socket. * * RPC and tmux agents (out-of-process) will reach the same listener by way of * the notify-socket handler, which can simply re-emit on this bus when it * arrives. Either way, the listener treats the event as a hint to re-read * the agent status YAML — the file remains the source of truth. */ import { EventEmitter } from "node:events"; export type AgentUpdateKind = "progress" | "completion" | "error"; export interface AgentUpdate { agentId: string; kind: AgentUpdateKind; } declare class AgentEventBus extends EventEmitter { emitUpdate(update: AgentUpdate): void; onUpdate(listener: (update: AgentUpdate) => void): () => void; } export declare const agentEvents: AgentEventBus; /** Test helper — drop all listeners so unit tests can isolate behavior. */ export declare function _resetAgentEventsForTest(): void; export {}; //# sourceMappingURL=agent-events.d.ts.map