/** * serve-client — discover, spawn, and call the `openlore serve` daemon. * * Lets in-process callers (notably the stdio MCP server) delegate tool dispatch * to a shared warm daemon instead of running it locally. Delegation means a * single process holds the warm caches and runs ONE watcher for a repo, so two * agents (Pi + Claude Code, or Claude Code + Cline) don't each spin a watcher * racing to write the same .openlore/analysis. * * Every call degrades gracefully: if no daemon can be reached or spawned, the * caller falls back to in-process dispatch. */ /** A resolved, reachable daemon. */ export interface ServeEndpoint { baseUrl: string; token?: string; } /** * CLI args to spawn the daemon. Exported + asserted in tests because the daemon * MUST accept exactly these — `serve` has only `--no-watch` (watch is the * default), so passing a non-existent `--watch` flag makes commander reject and * the daemon never starts. Keep this in lockstep with serve.ts's options. */ export declare function serveSpawnArgs(directory: string): string[]; /** * Resolve a live daemon for `directory`: reuse an announced healthy one, else * (when `spawn` is true) start `openlore serve` detached and poll until * /health is ready. Returns null if none could be brought up — callers then run * in-process. Never kills a daemon; it may serve other clients. */ export declare function ensureServeDaemon(directory: string, opts?: { spawn?: boolean; }): Promise; /** * Call a tool on the daemon. Throws on transport failure so the caller can fall * back to in-process dispatch; a tool-level error is returned in the body (the * handler's own `{ error }`), not thrown. */ export declare function callServeTool(ep: ServeEndpoint, name: string, args: Record, directory: string, signal?: AbortSignal): Promise; //# sourceMappingURL=serve-client.d.ts.map