import { HandleTable } from '../daemon/handles.js'; export interface ControlServerOpts { /** Path to bind the Unix socket. */ socketPath: string; /** Directory of encrypted keyfiles to load on unlock. */ keysDir: string; /** * Directory of per-portal policy TOMLs. Used to migrate legacy `eth:*.toml` * filenames alongside the matching `eth:*.sigil` keyfiles when the handle * prefix is renamed. */ policyDir: string; /** Live HandleTable shared with the MCP server. */ handles: HandleTable; /** Optional log sink — defaults to no-op. */ onLog?: (event: ControlLogEvent) => void; /** Optional process ID override (tests). */ pid?: number; } export type ControlLogEvent = { kind: 'listening'; path: string; } | { kind: 'accepted'; } | { kind: 'request'; method: string; } | { kind: 'response'; ok: boolean; code?: string; } | { kind: 'parse_error'; line: string; } | { kind: 'stale_socket_cleared'; path: string; } | { kind: 'bind_error'; error: string; } | { kind: 'legacy_handle_migrated'; from: string; to: string; }; export interface ControlServerHandle { /** Returns when the server socket is closed (and the file unlinked). */ close(): Promise; /** The bound socket path (echoed back for convenience). */ socketPath: string; } /** * Start a control listener bound to `socketPath`. Returns once the server is * listening. On EADDRINUSE, probes the existing socket: if it answers, throws * (a live sigil-mcp owns it); if it doesn't, unlinks the stale socket and * re-binds. * * The server is unref'd — it doesn't keep the event loop alive on its own, * so sigil-mcp can still exit when stdin closes. */ export declare function startControlServer(opts: ControlServerOpts): Promise; //# sourceMappingURL=server.d.ts.map