/** * Dashboard HTTP server — Express app wiring auth, the runtime pool, the SSE * hub, and the file API into the REST surface the browser client consumes. * * Bind address discipline: local mode binds 127.0.0.1 only. The * caller decides the bind address; `createDashboardServer` never listens by * itself. Remote mode still passes every request through DashboardAuth. */ import express from "express"; import type { DashboardAuth } from "./auth.js"; import { DashboardImageService } from "./dashboard-images.js"; import { EventHub } from "./event-hub.js"; import type { RuntimePool } from "./runtime-pool.js"; export type DashboardServerApp = express.Express & { /** Close dashboard-owned services. Safe to call more than once during shutdown. */ closeDashboard(): Promise; }; export interface DashboardSessionInfoSource { path: string; id: string; cwd: string; name?: string; created: Date; modified: Date; messageCount: number; firstMessage: string; } export interface DashboardServerOptions { auth: DashboardAuth; pool: RuntimePool; /** Directory of built client assets; omit to skip static serving (tests). */ staticDir?: string; /** Session listing (cross-project) — injected so tests can stub it. */ listAllSessions: () => Promise; deleteSession: (path: string) => Promise; logger?: (line: string) => void; /** Build version of the running server process (for the settings footer / stale-server detection). */ serverVersion?: string; /** Restart hook — when set, POST /api/server/restart invokes it (typically process exit for a supervisor to respawn). */ onRestart?: () => void; /** Injectable only to make SSE limits deterministic in integration tests. */ eventHub?: EventHub; /** Injectable bounded image repository/preview service for deterministic tests and lifecycle ownership. */ imageService?: DashboardImageService; /** Named heartbeat interval; defaults to 25 seconds. */ heartbeatIntervalMs?: number; /** Test-only override for the global dreb memory home directory. */ memoryHomeDir?: string; } export declare const MAX_SSE_BUFFERED_BYTES: number; export declare const CLIENT_DIAGNOSTIC_RATE_LIMIT_MS = 30000; /** Parse the device cookie from a Cookie header. */ export declare function parseDeviceCookie(cookieHeader: string | undefined): string | undefined; export declare function createDashboardServer(options: DashboardServerOptions): DashboardServerApp; //# sourceMappingURL=server.d.ts.map