/** * Pool of `sourcekit-lsp` clients, keyed by project root. * * Why a pool: starting `sourcekit-lsp` and waiting for it to be ready costs * ~2 seconds. Doing that on every tool call would kill the agent loop. * Instead we keep one client alive per project root and reuse it across * tool invocations. After an idle window we shut it down so we're not * blocking the user's build/test pipeline. */ import { type InitializedClient } from "./client.js"; /** Resolve a file path to its enclosing project root by walking up to the * nearest `Package.swift`, `*.xcodeproj`, or `*.xcworkspace`. Falls back * to the file's directory if nothing is found. */ export declare function projectRootFor(filePath: string): string; export interface AcquireOptions { /** Override idle shutdown window, ms. Default 5min. */ idleMs?: number; } /** Acquire an LSP client for a project root. Reuses an existing one if * warm, spawns + initializes one otherwise. */ export declare function acquireClient(projectRoot: string, opts?: AcquireOptions): Promise; /** Manually shut down the client for a given project root. */ export declare function shutdownClient(projectRoot: string): Promise; /** Shut down all pooled clients. Useful in tests + on process exit. */ export declare function shutdownAll(): Promise;