UNPKG

vibe-tools

Version:
76 lines (75 loc) 2.87 kB
import PQueue from 'p-queue'; import { TestOptions, RetryConfig, TestReport, TestScenarioResult, TestScenario } from './types'; /** * Creates and configures the retry configuration based on the provided options */ export declare function createRetryConfig(retries?: number): RetryConfig; /** * Creates and configures the provider and model based on the provided options */ export declare function setupProviderAndModel(options: TestOptions): { provider: 'anthropic' | 'openrouter'; model: string; }; /** * Creates a function that returns a Gemini provider, ensuring only one instance is created */ export declare function createGeminiProviderFactory(): () => import("../../providers/base").BaseModelProvider; /** * Formats a time duration in seconds into a human-readable string */ export declare function formatTime(seconds: number): string; /** * Creates and configures a PQueue instance for parallel execution with progress reporting */ export declare function createExecutionQueue(options: TestOptions, startTime: number, progressStats: { totalScenarios: number; completedScenarios: number; }): PQueue; /** * Creates a test report object with the common fields populated */ export declare function createTestReport(featureName: string, description: string, scenarios: TestScenarioResult[], branch: string, provider: string, model: string, totalExecutionTime: number): TestReport; /** * Generates parallel execution statistics summary */ export declare function generateParallelStats(parallel: number, sequentialEstimatedTime: number, totalExecutionTime: number, scenarios: TestScenarioResult[]): string; /** * Helper function to filter scenarios based on tags and scenario numbers */ export declare function filterScenarios(scenarios: TestScenario[], tags?: string[], scenarioNumbers?: string): TestScenario[]; /** * Create a queue for processing files in parallel */ export declare function createFileProcessingQueue(options: TestOptions, globalStats: { totalFiles: number; completedFiles: number; totalScenarios: number; completedScenarios: number; passedScenarios: number; failedScenarios: number; }): PQueue; /** * Process a single feature file and return its report */ export declare function processFeatureFile(file: string, options: TestOptions, commonConfig: { provider: 'anthropic' | 'openrouter'; model: string; branchOutputDir: string; branch: string; timeout: number; retryConfig: RetryConfig; debug: boolean; mcpServers: string[]; tags?: string[]; }, globalStats: { totalFiles: number; completedFiles: number; totalScenarios: number; completedScenarios: number; passedScenarios: number; failedScenarios: number; }, outputCallback: (output: string) => Promise<void>): Promise<{ file: string; report: TestReport | null; }>;