import http from "node:http"; import { Store } from "./store.js"; import { type TraceContent } from "./tracing.js"; /** Serve the board on localhost. Returns the URL, or null if the port was taken (someone else is serving). */ /** One store's routes. `prefix` is the path the board lives under ("" locally, "/b/" hosted). */ /** Per-store live state: who is connected (MCP clients announce themselves) and who is listening (the page). */ export interface Live { presence: Map; sse: Set; broadcast: (event: string, data: unknown) => void; samplers: Map Promise; stream?: (system: string, user: string, onText?: (text: string) => void) => Promise; }>; } export declare function liveFor(key: string): Live; /** * `trace` decides how much of a turn is recorded: "full" keeps the prompt and the reply, "metadata" * keeps everything else. It defaults to metadata because recording someone's words is a thing you opt * into. A local server is somebody running staves on their own machine with their own Langfuse keys, * so it opts itself in; the hosted gateway passes "full" only for the accounts that run the product. */ export declare function boardHandler(store: Store, prefix?: string, options?: { trace?: TraceContent; }): (req: http.IncomingMessage, res: http.ServerResponse) => Promise | undefined>; export declare function serveHttp(store: Store, port?: number, log?: (s: string) => void, tries?: number): Promise; /** Load the shipped editor; the development preview uses this same handler. */ export declare function loadEditor(): Promise<{ editorHandler: (store: Store, modelStatus?: { status: string; }, prefix?: string) => ReturnType & { store: Store; }; }>;