import { LspClient } from './client.js';
import type { ShellPathService } from '../../runtime/shell-paths.js';
type LspRoots = Pick<ShellPathService, 'workingDirectory' | 'resolveProjectPath'>;
export interface LspServerConfig {
    command: string;
    args: string[];
    initializationOptions?: Record<string, unknown> | undefined;
}
export declare class LspService {
    private clients;
    private configs;
    private initializing;
    private readonly roots;
    constructor(roots: LspRoots);
    /** Register a server configuration for a language. */
    registerServer(langId: string, config: LspServerConfig): void;
    /**
     * Get or start a client for a language.
     * Returns null if no server is configured or if the server fails to start.
     */
    getClient(langId: string): Promise<LspClient | null>;
    private _startClient;
    /**
     * Check if a server is available for a language
     * (config exists AND command is installed on PATH).
     */
    isAvailable(langId: string): Promise<boolean>;
    /** Initialize a server with the LSP handshake. */
    private _initializeServer;
    /** Stop all running servers. */
    shutdown(): Promise<void>;
    /**
     * Auto-detect installed LSP servers and return their configs.
     * Registers detected servers automatically.
     */
    detectServers(): Promise<Map<string, LspServerConfig>>;
    /**
     * Ensure a server binary is available for the given language.
     * Downloads the binary if it's a known downloadable server (rust-analyzer, gopls)
     * and not already available. Non-blocking for bundled/PATH servers.
     */
    ensureServer(langId: string): Promise<void>;
}
export {};
//# sourceMappingURL=service.d.ts.map