CoolFace
Apppublic

Leon4gr45/builder

sourceHugging Facemitupdated 2d agoView on Hugging Face
0likes
types.ts62 linesDownload Raw Back to testing
1export type TestAssertion =2  | { type: 'file_exists'; path: string; description: string }3  | { type: 'file_not_exists'; path: string; description: string }4  | { type: 'file_contains'; path: string; value: string; description: string }5  | { type: 'file_not_contains'; path: string; value: string; description: string }6  | { type: 'file_matches'; path: string; pattern: string; description: string }7  | { type: 'file_matches_any'; paths: string[]; pattern: string; description: string }8  | { type: 'valid_json'; path: string; description: string }9  | { type: 'tool_used'; toolName: string; description: string }10  | { type: 'tool_args_match'; toolName: string; pattern: string; description: string }11  | { type: 'output_matches'; pattern: string; description: string }12  | { type: 'tool_output_matches'; toolName: string; pattern: string; description: string }13  | { type: 'any_of'; assertions: TestAssertion[]; description: string }14  | { type: 'judge'; criteria: string; description: string };15 16export interface AssertionResult {17  assertion: TestAssertion;18  passed: boolean;19  actual?: string;20}21 22export interface TestScenario {23  id: string;24  name: string;25  category: 'bash-read' | 'bash-write' | 'bash-search' | 'bash-text' | 'bash-preview' | 'file-editing' | 'status' | 'multi-tool' | 'agent' | 'delegate' | 'compaction' | 'setup';26  prompt: string;27  setupFiles?: Record<string, string>;28  assertions?: TestAssertion[];29  timeout?: number;30  /** Agent type to use (defaults to 'orchestrator'). */31  agentType?: import('@/lib/llm/agent').AgentType;32  /** If true, skip VFS project creation (e.g. setup agent tests). */33  skipProjectSetup?: boolean;34}35 36export interface TestStep {37  id: string;38  name: string;39  prompt: string;40  assertions?: TestAssertion[];41  timeout?: number;42}43 44export interface TestSequence {45  id: string;46  name: string;47  category: string;48  setupFiles?: Record<string, string>;49  steps: TestStep[];50  agentType?: import('@/lib/llm/agent').AgentType;51  skipProjectSetup?: boolean;52  requires?: ('compaction')[];53}54 55export interface TestTrack {56  id: string;57  name: string;58  description: string;59  scenarioIds: string[];60}61 62