/** * Local HTTP relay — captures events from the Python subprocess's * StudioForwarder (which POSTs to MEL_BUILDER_URL/events/relay) and * forwards them over the Socket.IO WebSocket connection to the cloud. * * Security: * - Bound to 127.0.0.1 only (no external access) * - Random port (no collision with other services) * - Per-run nonce required in the URL path to prevent injection from * other processes on the same machine */ import http from "http"; import type { Socket } from "socket.io-client"; export interface LocalRelay { port: number; nonce: string; close: () => void; } export declare function setActiveProject(project: string): void; export interface LocalRelayRoutes { /** POST /vaults/op (Obsidian vault tools, protocol §2). Authenticated by the * vault capability in `Authorization: Vault `, not by the nonce: the * handler verifies it (local device vaults) or forwards it to the server. */ vaultOp?: (req: http.IncomingMessage, res: http.ServerResponse) => Promise | void; } export declare function startLocalRelay(socket: Socket, verbose: boolean, serverUrl?: string, routes?: LocalRelayRoutes): Promise;