import type { AgentRegistry } from '../agent/index.js'; import type { Ledger } from '../ledger/index.js'; import type { UserRegistry } from '../user/index.js'; import type { Vault } from '../vault/index.js'; export interface DashboardServerOptions { /** Port to serve the dashboard on (default: 3200) */ port: number; /** Vault instance for listing credentials */ vault: Vault; /** Ledger for audit log queries and stats */ ledger: Ledger; /** Agent registry for listing agents and grants */ agentRegistry: AgentRegistry; /** User registry for listing RBAC users (optional — RBAC may not be active) */ userRegistry?: UserRegistry; /** Whether Gate is currently running */ gateRunning: boolean; /** Gate port (if running) */ gatePort: number | null; /** Log level */ logLevel?: 'debug' | 'info' | 'warn' | 'error'; /** Path to built dashboard static files (default: dist/dashboard) */ staticDir?: string; /** Server start time (for uptime calculation) */ startTime?: number; } /** * Dashboard HTTP server — serves the React dashboard and exposes * REST API endpoints for credentials, agents, audit log, and stats. * * Also provides a WebSocket endpoint (/ws) for live audit feed * using the `ws` library for reliable frame handling and heartbeats. */ export declare class DashboardServer { private server; private wss; private port; private vault; private ledger; private agentRegistry; private userRegistry; private gateRunning; private gatePort; private logger; private staticDir; private startTime; constructor(options: DashboardServerOptions); /** * Update the Gate running status (for health endpoint). */ setGateStatus(running: boolean, port: number | null): void; /** * Broadcast an audit entry to all connected WebSocket clients. * Called from Gate after each request is logged. */ broadcast(entry: { id?: number; timestamp: string; credentialId?: string | null; credentialName?: string | null; service: string; targetDomain: string; method: string; path: string; status: 'allowed' | 'blocked' | 'system'; blockedReason?: string | null; responseCode?: number | null; agentName?: string | null; agentTokenPrefix?: string | null; channel?: 'gate' | 'mcp'; }): void; /** * Start the dashboard server. */ start(): Promise; /** * The port the dashboard server is listening on. */ get listeningPort(): number; /** * Stop the dashboard server. */ stop(): Promise; private handleRequest; private handleApiRequest; private handleHealth; private handleStats; private handleCredentials; private handleAgents; private handleRequests; private handleUsers; private serveStatic; private json; } //# sourceMappingURL=dashboard-server.d.ts.map