import { LspClient } from "./lsp-client.js"; import type { LspServerAdapter, StatusContext } from "./types.js"; export declare const DEFAULT_FILE_LIMIT = 50; /** Cap on rendered diagnostics per lane/tool; extras are truncated with a count. */ export declare const DEFAULT_MAX_DIAGNOSTICS = 200; /** Cap on LSP lanes running at once: each lane spawns its own server process * (jdtls alone is a JVM with a 2 GB heap), so an unbounded parallel dispatch * across every installed language server would stampede the machine. */ export declare const MAX_PARALLEL_LSP_LANES = 4; /** * Run async tasks with at most `limit` in flight, preserving result order. * Tasks must not reject: callers isolate per-task errors themselves (both * lsp tool entry points do), and a rejecting task would lose the remaining * queued tasks' results. */ export declare function withConcurrencyLimit(tasks: Array<() => Promise>, limit: number): Promise; export declare function runDiagnostics(adapter: LspServerAdapter, params: { root?: string; paths?: string[]; limit?: number; files?: string[]; autoInstall?: boolean; maxDiagnostics?: number; }, timeoutMs: number, signal: AbortSignal | undefined, ctx: StatusContext, statusKey: string): Promise<{ content: { type: "text"; text: string; }[]; details: unknown; }>; export declare function runFix(adapter: LspServerAdapter, params: { root?: string; paths: string[]; kind?: string; write?: boolean; autoInstall?: boolean; }, timeoutMs: number, signal: AbortSignal | undefined, ctx: StatusContext, statusKey: string): Promise<{ content: { type: "text"; text: string; }[]; details: unknown; }>; /** withLspClient 起一次服务器并把状态栏从头报到尾。 * * 状态栏从第一件事就开始报,而不是等服务器起来:自动安装要下载几十 MB * (jdtls、rust-analyzer 尤其),以前这段完全是沉默的,界面上看不出在下载 * 还是卡死了。安装与运行用两种文案(installing / diagnostics|fix),卡在哪 * 一步一眼看得出来;清状态放在最外层 finally,安装失败、被取消、运行报错 * 都不会留下一条挂着的状态。 */ export declare function withLspClient(adapter: LspServerAdapter, root: string, timeoutMs: number, signal: AbortSignal | undefined, ctx: StatusContext, statusKey: string, activity: "diagnostics" | "fix", autoInstall: boolean | undefined, operation: (client: LspClient) => Promise): Promise<{ result: T; autoInstalled: boolean; }>; export declare function clearStatus(ctx: StatusContext, statusKey: string): void; export declare function textResult(text: string, details: unknown): { content: { type: "text"; text: string; }[]; details: unknown; }; /** Extract the rendered text section from a tool result (shared by the tools). */ export declare function textFromResult(result: { content?: Array<{ type?: string; text?: string; }>; }): string; //# sourceMappingURL=lsp-runner.d.ts.map