/** * Core lens interfaces that define how quality tools are wrapped and executed */ import { ExecuteResult } from './executors.js'; import { LensResult } from './output.js'; import { ToolConfiguration } from './config.js'; import { UnknownParsedData } from './common.js'; /** * Configuration for a specific lens instance */ export interface LensConfig { /** Tool configuration from codebase-composition */ tool: ToolConfiguration; /** Working directory */ cwd: string; /** Enable debug mode */ debug?: boolean; } /** * Base interface for all quality lenses */ export interface Lens { /** Unique identifier for this lens */ readonly name: string; /** Human-readable description */ readonly description: string; /** Languages this lens supports */ readonly languages: string[]; /** Tool names this lens can work with */ readonly supportedTools: string[]; /** * Configure the lens with tool configuration */ configure(config: LensConfig): void; /** * Execute the quality tool and return raw output */ execute(): Promise; /** * Parse the raw tool output into structured data */ parse(output: ExecuteResult): TParsed; /** * Format parsed data into standardized result */ format(parsed: TParsed): LensResult; /** * Run the complete pipeline: execute -> parse -> format */ run(): Promise; /** * Check if this lens can handle the given tool configuration */ canHandle(tool: ToolConfiguration): boolean; /** * Prepare a command string before execution * Allows lenses to add required flags for proper parsing * * @param command - The raw command string from config * @returns Modified command with any additional flags needed */ prepareCommand?(command: string): string; } /** * Options for creating a lens */ export interface LensOptions { /** Enable debug logging */ debug?: boolean; /** Custom timeout override */ timeout?: number; /** Whether to throw on non-zero exit codes */ throwOnError?: boolean; } /** * Metadata about a lens for registration and discovery */ export interface LensMetadata { /** Unique identifier */ name: string; /** Tool names this lens supports */ supportedTools: string[]; /** Languages supported */ languages: string[]; /** Priority for automatic selection (higher = preferred) */ priority?: number; } //# sourceMappingURL=lens.d.ts.map