/** * Generate test cases based on semantic type inference. * * This module generates validation tests for parameters with inferred * semantic types, testing that tools properly reject invalid values. */ import type { MCPTool } from '../transport/types.js'; import type { InterviewQuestion } from '../interview/types.js'; import type { SemanticType, SemanticInference } from './semantic-types.js'; /** * Result of generating semantic tests for a tool. */ export interface SemanticTestResult { /** Generated test cases */ tests: InterviewQuestion[]; /** Semantic inferences for each parameter */ inferences: SemanticInference[]; } /** * Options for semantic test generation. */ export interface SemanticTestOptions { /** Minimum confidence threshold for generating tests (0-1, default: 0.5) */ minConfidence?: number; /** Maximum invalid values to test per parameter (default: 2) */ maxInvalidValuesPerParam?: number; /** Skip semantic tests entirely */ skipSemanticTests?: boolean; /** * Enable flexible semantic validation (default: true). * When true, semantic tests use 'either' outcome, allowing tools to * accept flexible formats (e.g., dayjs accepting various date strings). * When false, tests expect strict rejection of invalid formats. */ flexibleSemanticTests?: boolean; } /** * Generate semantic validation tests for a tool. * * Analyzes the tool's input schema, infers semantic types for parameters, * and generates test cases with invalid values to verify proper validation. * * @param tool - The MCP tool to generate tests for * @param options - Configuration options * @returns Generated tests and semantic inferences */ export declare function generateSemanticTests(tool: MCPTool, options?: SemanticTestOptions): SemanticTestResult; /** * Get the invalid test values for a semantic type. * Useful for external modules that need access to the test values. */ export declare function getInvalidValuesForType(type: SemanticType): readonly string[]; /** * Get all semantic types that have invalid test values defined. */ export declare function getTestableSemanticTypes(): SemanticType[]; //# sourceMappingURL=semantic-test-generator.d.ts.map