/** * Self-verification module for agent * Runs build/test and analyzes errors for auto-fixing */ export interface VerifyResult { success: boolean; /** * Set when the check never reached a verdict: its command was refused by the * shell guard, could not be started, timed out, or the project's * dependencies are not installed. `success` is false, but nothing about the * code was learned, so it is neither a pass nor a failure to fix. */ notRun?: string; type: 'build' | 'test' | 'lint' | 'typecheck'; command: string; output: string; errors: ParsedError[]; duration: number; } export interface ParsedError { file?: string; line?: number; column?: number; message: string; code?: string; severity: 'error' | 'warning'; } export interface VerifyOptions { runBuild: boolean; runTest: boolean; runLint: boolean; runTypecheck: boolean; timeout: number; /** * Stops the checks when it fires (the run was stopped): a running command * is killed and its check is reported as not run. */ signal?: AbortSignal; } /** * Detect project type and available scripts */ export declare function detectProjectScripts(projectRoot: string): { build?: string; test?: string; lint?: string; typecheck?: string; packageManager: 'npm' | 'yarn' | 'pnpm' | 'bun'; }; /** * Run build verification */ export declare function runBuildVerification(projectRoot: string, timeout?: number, signal?: AbortSignal): Promise; /** * Run test verification */ export declare function runTestVerification(projectRoot: string, timeout?: number, signal?: AbortSignal): Promise; /** * Run TypeScript type checking */ export declare function runTypecheckVerification(projectRoot: string, timeout?: number, signal?: AbortSignal): Promise; /** * Run lint verification */ export declare function runLintVerification(projectRoot: string, timeout?: number, signal?: AbortSignal): Promise; /** * Run all verifications */ export declare function runAllVerifications(projectRoot: string, options?: Partial): Promise; /** * Format verification results for display */ export declare function formatVerifyResults(results: VerifyResult[]): string; /** * Format errors for agent to fix */ export declare function formatErrorsForAgent(results: VerifyResult[]): string; /** * Checks that ran and failed. A check that could not run is not among them. */ export declare function failedChecks(results: VerifyResult[]): VerifyResult[]; /** * Checks that could not be carried out (see VerifyResult.notRun). */ export declare function checksNotRun(results: VerifyResult[]): VerifyResult[]; /** * Check if any verification failed */ export declare function hasVerificationErrors(results: VerifyResult[]): boolean; /** * Get summary of verification */ export declare function getVerificationSummary(results: VerifyResult[]): { passed: number; failed: number; notRun: number; total: number; errors: number; };