import type { PortableTool } from "../portable-tool.js";
export declare const LSP_TOOL_NAME: "lsp";
export type LspOperation = "goToDefinition" | "findReferences" | "hover" | "documentSymbol" | "diagnostics" | "completion" | "signatureHelp" | "rename" | "codeAction";
export interface LspToolParams {
    /** LSP operation to perform */
    operation: LspOperation;
    /** File path (absolute or relative to workspace root) */
    filePath: string;
    /** Line number (1-indexed) */
    line?: number;
    /** Character position (1-indexed) */
    character?: number;
    /** New name (for rename operation) */
    newName?: string;
    /** Include context lines around results */
    includeContext?: boolean;
}
export declare const LSP_TOOL_SCHEMA: {
    readonly type: "object";
    readonly properties: {
        readonly operation: {
            readonly type: "string";
            readonly enum: readonly ["goToDefinition", "findReferences", "hover", "documentSymbol", "diagnostics", "completion", "signatureHelp", "rename", "codeAction"];
            readonly description: string;
        };
        readonly filePath: {
            readonly type: "string";
            readonly description: "File path. Absolute or relative to workspace root.";
        };
        readonly line: {
            readonly type: "number";
            readonly description: "Line number (1-indexed). Required for positional operations.";
        };
        readonly character: {
            readonly type: "number";
            readonly description: "Character position (1-indexed). Required for positional operations.";
        };
        readonly newName: {
            readonly type: "string";
            readonly description: "New name for rename operation.";
        };
        readonly includeContext: {
            readonly type: "boolean";
            readonly description: "Include surrounding code context in results (default: true).";
        };
    };
    readonly required: readonly ["operation", "filePath"];
};
export interface LspLocation {
    filePath: string;
    line: number;
    character: number;
    endLine?: number;
    endCharacter?: number;
    context?: string;
}
export interface LspSymbol {
    name: string;
    kind: string;
    range: {
        startLine: number;
        endLine: number;
    };
    children?: LspSymbol[];
}
export interface LspDiagnostic {
    message: string;
    severity: "error" | "warning" | "info" | "hint";
    line: number;
    character: number;
    source?: string;
    code?: string | number;
}
export interface LspHoverInfo {
    contents: string;
    range?: {
        startLine: number;
        startCharacter: number;
        endLine: number;
        endCharacter: number;
    };
}
export interface LspCompletion {
    label: string;
    kind: string;
    detail?: string;
    insertText?: string;
}
export interface LspRenameEdit {
    filePath: string;
    edits: Array<{
        line: number;
        character: number;
        endLine: number;
        endCharacter: number;
        newText: string;
    }>;
}
export interface LspCodeAction {
    title: string;
    kind?: string;
    isPreferred?: boolean;
}
export type LspResult = {
    type: "locations";
    locations: LspLocation[];
} | {
    type: "symbols";
    symbols: LspSymbol[];
} | {
    type: "diagnostics";
    diagnostics: LspDiagnostic[];
} | {
    type: "hover";
    hover: LspHoverInfo | null;
} | {
    type: "completions";
    completions: LspCompletion[];
} | {
    type: "rename";
    edits: LspRenameEdit[];
} | {
    type: "codeActions";
    actions: LspCodeAction[];
} | {
    type: "signatureHelp";
    signatures: string[];
};
/**
 * Host-provided LSP backend.
 * The host manages language server lifecycle and connections.
 */
export interface LspToolDeps {
    /** Execute an LSP operation. Host dispatches to appropriate language server. */
    executeOperation(params: {
        operation: LspOperation;
        filePath: string;
        line?: number;
        character?: number;
        newName?: string;
        includeContext?: boolean;
    }): Promise<LspResult>;
    /** Check if file exists and get its size */
    statFile?(filePath: string): Promise<{
        exists: boolean;
        size: number;
    } | null>;
    /** Resolve relative path to absolute */
    resolvePath(filePath: string): string;
    /** List supported language IDs (e.g. ['typescript', 'python', 'rust']) */
    supportedLanguages?(): string[];
}
export declare function createLspTool(deps: LspToolDeps): PortableTool<LspToolParams>;
