/** * Portal Event Bus * Provides an event emitter singleton to stream data to the web dashboard. * * Provides: * - portalEvents: Global singleton event emitter for portal communication. * - PortalEventEmitter: Class defining the portal event bus behavior. */ import { EventEmitter } from "events"; declare class PortalEventEmitter extends EventEmitter { constructor(); /** * Emit an agentic activity event. * @param toolName The name of the tool called * @param args The arguments passed to the tool * @param status The execution status (running, success, error) * @param activityId A unique identifier for this activity */ emitActivity(toolName: string, args: Record, status: 'running' | 'success' | 'error', activityId: string): Promise; private artifactBuffers; /** * Emit a build log stream, buffering partial chunks into clean lines * @param projectId The target project identifier * @param taskId The task ID generating the log * @param chunk Raw string chunk of the log */ emitTaskLog(projectId: string, taskId: string | undefined, chunk: string): void; /** * Emit a signal to clear the build terminal for a project * @param projectId The target project identifier * @param taskId Optional specific task ID * @param logPaths Optional list of associated log files */ clearTaskLog(projectId: string, taskId?: string, logPaths?: string[]): void; /** * Emit a serial monitor read * @param port Serial port emitting the log * @param data Log payload data * @param taskId Optional task ID */ emitSerialLog(port: string, data: string, taskId?: string): void; /** * Emit general server status * @param status String enum of "online" or "offline" */ emitServerStatus(status: "online" | "offline"): void; /** * Emit hardware queue lock status * @param state The lock state object */ emitLockState(state: { isLocked: boolean; sessionId?: string; reason?: string; }): void; /** * Emit a map of all spooler connection and config properties * @param states Record mapping ports to spooler states */ emitSpoolerStates(states: Record): void; /** * Emit an update signal when the command history registry changes * @param projectDir Target project context */ emitCommandHistoryUpdated(projectDir: string): void; /** * Emits a lightweight invalidation signal for policy, approval, and automation state. * * @param projectDir Optional workspace affected by the state change. */ emitSafetyStateUpdated(projectDir?: string): void; /** * Emit a signal containing the latest rich hardware port state * @param devices List of device objects */ emitHardwareStateUpdated(devices: unknown[]): void; private lastKnownProjectDir?; /** * Caches and emits the last known dynamically targeted workspace directory. * @param projectDir Target project directory path */ emitWorkspaceState(projectDir: string): void; /** * Retrieves the last known workspace path * @returns The last targeted workspace directory */ getLastKnownWorkspace(): string | undefined; /** * Emit an update signal when the overall workspaces registry changes. * @param workspaces List of available workspace directories */ emitWorkspacesUpdated(workspaces: string[]): void; } /** * Singleton instance of the portal event emitter. * Used internally by MCP tools to stream live metrics. */ export declare const portalEvents: PortalEventEmitter; export {}; //# sourceMappingURL=events.d.ts.map