/** * QA360 Prompt Builder * * Constructs effective prompts for LLM test generation. * Uses system prompts, few-shot examples, and structured templates. */ import type { TestSpec, GenerationSource } from './types.js'; /** * Prompt builder options */ export interface PromptBuilderOptions { /** * Include code comments in generated tests */ includeComments?: boolean; /** * Include detailed assertions */ includeDetailedAssertions?: boolean; /** * Include retry logic for flaky tests */ includeRetryLogic?: boolean; /** * Target code style */ codeStyle?: 'clean' | 'verbose' | 'concise'; /** * Few-shot examples to include */ examples?: string[]; /** * Custom system prompt */ systemPrompt?: string; } /** * Built prompt result */ export interface BuiltPrompt { system: string; user: string; estimatedTokens: number; } /** * Prompt Builder class */ export declare class PromptBuilder { private readonly options; private readonly defaultOptions; constructor(options?: PromptBuilderOptions); /** * Build prompt from generation source */ buildFromSource(source: GenerationSource): Promise; /** * Build prompt from OpenAPI/Swagger spec */ buildFromOpenAPI(specPath: string): BuiltPrompt; /** * Build prompt from HAR file */ buildFromHAR(filePath: string): BuiltPrompt; /** * Build prompt from URL */ buildFromUrl(url: string): BuiltPrompt; /** * Build prompt from test spec */ buildFromSpec(spec: TestSpec): BuiltPrompt; /** * Build prompt from description */ buildFromDescription(description: string): BuiltPrompt; /** * Build prompt from existing code */ buildFromCode(code: string, language: string): BuiltPrompt; /** * Build API spec prompt */ private buildApiSpecPrompt; /** * Build UI spec prompt */ private buildUiSpecPrompt; /** * Build performance spec prompt */ private buildPerfSpecPrompt; /** * Build unit test spec prompt */ private buildUnitSpecPrompt; /** * Get default system prompt */ private getDefaultSystemPrompt; /** * Get code style instructions */ private getCodeStyleInstructions; /** * Get few-shot example */ private getFewShotExample; /** * Get API test example */ private getApiExample; /** * Get UI test example */ private getUiExample; /** * Get performance test example */ private getPerfExample; /** * Get unit test example */ private getUnitExample; /** * Count approximate tokens */ private countTokens; } /** * Create a prompt builder with default options */ export declare function createPromptBuilder(options?: PromptBuilderOptions): PromptBuilder;