import { AstGrepBinaryManager } from "../core/binary-manager.js"; import { WorkspaceManager } from "../core/workspace-manager.js"; interface FindingLocation { file: string; start: { line: number; column: number; }; end: { line: number; column: number; }; } interface Finding { file: string; range: FindingLocation; line: number; column: number; message?: string; severity?: string; ruleId?: string; fix?: string; } interface ScanResult { yaml: string; skippedLines: number; scan: { findings: Finding[]; summary: { totalFindings: number; errors: number; warnings: number; skippedLines: number; }; }; } /** * Rule builder that generates YAML and runs ast-grep scan */ export declare class ScanTool { private workspaceManager; private binaryManager; constructor(workspaceManager: WorkspaceManager, binaryManager: AstGrepBinaryManager); execute(paramsRaw: Record): Promise; private buildYaml; /** * Extract all metavariables from a rule object, including nested patterns * * @param rule - The rule object to extract metavariables from * @returns Set of all metavariables found in the rule */ private extractAllMetavariables; /** * Serialize a rule object to YAML format with proper indentation * * @param rule - The rule object to serialize (can contain nested rules) * @param indentLevel - Current indentation level (0 = top level, 1 = inside rule:, etc.) * @returns Array of YAML lines with proper indentation */ private serializeRule; /** * Resolves file paths to absolute paths. * Since input paths are absolute, ast-grep returns absolute paths. * STDIN and empty strings are returned as-is. */ private resolveFilePath; private parseFindings; static getSchema(): { name: string; description: string; inputSchema: { type: string; properties: { id: { type: string; description: string; }; language: { type: string; description: string; }; pattern: { type: string; description: string; }; rule: { type: string; description: string; }; message: { type: string; description: string; }; severity: { type: string; enum: string[]; description: string; }; where: { type: string; items: { type: string; properties: { metavariable: { type: string; description: string; }; regex: { type: string; description: string; }; equals: { type: string; description: string; }; not_regex: { type: string; description: string; }; not_equals: { type: string; description: string; }; kind: { type: string; description: string; }; }; required: string[]; }; description: string; }; fix: { type: string; description: string; }; paths: { type: string; items: { type: string; }; description: string; }; code: { type: string; description: string; }; timeoutMs: { type: string; description: string; }; verbose: { type: string; description: string; }; strictness: { type: string; enum: string[]; description: string; }; maxDepth: { type: string; description: string; }; }; required: string[]; additionalProperties: boolean; }; }; } export {}; //# sourceMappingURL=scan.d.ts.map