/** * AgentBridge — Agent-to-agent messaging via the WebSocket bridge. * * Routes task assignments and results between the orchestrator and * external agent workers. Messages are tagged with agent IDs for routing. */ import { EventEmitter } from "events"; import type { MemoireWsServer } from "../figma/ws-server.js"; import type { AgentTaskEnvelope, AgentRegistryEntry } from "../plugin/shared/contracts.js"; export declare class AgentBridge extends EventEmitter { private wsServer; private msgCounter; constructor(wsServer: MemoireWsServer); /** Broadcast an agent registration to all connected clients. */ broadcastRegistration(entry: AgentRegistryEntry): void; /** Broadcast an agent deregistration. */ broadcastDeregistration(agentId: string): void; /** Send a task assignment to all connected clients (agent workers listen). */ sendTaskAssignment(agentId: string, taskId: string, payload: unknown): void; /** Send a task cancellation. */ sendTaskCancel(agentId: string, taskId: string): void; /** Handle an incoming agent message (task result from a worker). */ handleAgentMessage(data: AgentTaskEnvelope): void; }