/** * Log Hub HTTP Server (Singleton) * * Receives log entries from external programs via HTTP POST. * Lazy start — no resources until init() is called. * * Pattern: Same as progress.ts (module-level singleton). */ import { LogBuffer } from './log-buffer.js'; import { PanelStore } from './panel-store.js'; import { ControlStore } from './control-store.js'; import { type SubscriberInfo } from './control-push.js'; import type { LogEntry, LogLevel, LogConfig, LogStats } from './log-types.js'; /** * Initialize the Log Hub — start HTTP server and create buffer */ export declare function initLogHub(config: LogConfig): Promise; /** * Stop the Log Hub — free all resources */ export declare function freeLogHub(): string; /** * Check if Log Hub is running */ export declare function isLogHubRunning(): boolean; /** * Get the buffer (for direct queries from MCP tool) */ export declare function getLogBuffer(): LogBuffer | null; /** * Get the panel store (for the viewer's snapshot-on-connect) */ export declare function getPanelStore(): PanelStore | null; /** * Get the control store (for the viewer's snapshot-on-connect and MCP reads) */ export declare function getControlStore(): ControlStore | null; /** * Set ONE control value — the single source of truth for changing a control. * BOTH entry points use it: the HTTP route (POST /control, driven by the * dashboard) and the MCP tool (aidex_log control_set, driven by the AI). It * updates the store, mirrors the value into the widget so every viewer's * slider/number reflects it, and broadcasts that widget. Returns false on a * bad id/value or when the hub isn't running. */ export declare function setControl(id: string, value: number | string): boolean; /** * Register ONE press of a button control: read the counter, add one, store it. * * Deliberately server-side rather than "the viewer sends the new count". Two * browsers can have the same dashboard open; if each computed the next value * from its own copy they would both send the same number and one press would * vanish. Here the hub owns the counter, so presses from any number of viewers * add up. Returns the new count, or null if the id isn't a known button. */ export declare function pressButton(id: string): number | null; /** * Read all control values as a flat { id: value } map (for the MCP tool). */ export declare function getControlValues(): Record; /** * Current push subscriptions (for status display). */ export declare function getControlSubscribers(): SubscriberInfo[]; /** * Get config (for status display) */ export declare function getLogConfig(): LogConfig | null; /** * Write an entry from MCP (source: "claude") */ export declare function writeLogEntry(level: LogLevel, message: string, data?: string): LogEntry | null; /** * Get full stats including port and persist info */ export declare function getLogStats(): LogStats | null; //# sourceMappingURL=log-server.d.ts.map