export type AuthFailureReason = 'not_connected' | 'timeout'; export type AuthResolution = { ok: true; headers: Record; } | { ok: false; reason: AuthFailureReason; }; /** * Resolve MONOMIND_HOME the same way the dashboard server does: explicit * env var, else walk up from cwd looking for `.monomind/control.json`, * else cwd. Duplicated rather than imported from `ui/server.mjs` — that * module boots an entire HTTP server as an import side effect, which is * not safe to pull into a stdio MCP process. */ export declare function resolveMonomindHome(cwd?: string): string; /** * Resolves a fresh Authorization header at request time. Never throws — * every failure (no connection, corrupted connection file, network * unreachable, refresh rejected, timeout) collapses to one of two fixed * reasons so the underlying error — which could theoretically carry request * details — never has to be inspected or surfaced by a caller. */ export declare function resolveAuthHeader(monomindHome: string, options?: { timeoutMs?: number; getToken?: (home: string) => Promise; }): Promise; export declare function formatAuthFailureMessage(reason: AuthFailureReason): string; /** JSON-RPC messages carried by an SSE body (`data:` lines, events split by a blank line). */ export declare function parseSseMessages(body: string): unknown[]; export interface RunProxyOptions { cwd?: string; monomindHome?: string; monoesUrl?: string; timeoutMs?: number; requestTimeoutMs?: number; getToken?: (home: string) => Promise; stdin?: NodeJS.ReadableStream; stdout?: NodeJS.WritableStream; stderr?: NodeJS.WritableStream; exit?: (code: number) => void; fetchImpl?: typeof fetch; } /** * Entry point registered by `commands/mcp.ts`'s `monoes-proxy` subcommand. */ export declare function runMonoesProxy(options?: RunProxyOptions): Promise; //# sourceMappingURL=monoes-proxy.d.ts.map