/** * Persona types for configurable interviewer personalities. */ import type { InterviewQuestion } from '../interview/question-types.js'; import type { QuestionCategory } from '../interview/question-category.js'; export type { QuestionCategory } from '../interview/question-category.js'; /** * Weight distribution for question categories. * Values should be 0-1 and represent relative likelihood. */ export interface QuestionBias { /** Normal, expected usage patterns */ happyPath: number; /** Boundary values and unusual but valid inputs */ edgeCase: number; /** Invalid inputs and error conditions */ errorHandling: number; /** Limits, extremes, and constraints */ boundary: number; /** Security-focused tests (injection, traversal, etc.) */ security?: number; } /** * Built-in persona identifiers. */ export type BuiltInPersonaId = 'technical_writer' | 'security_tester' | 'qa_engineer' | 'novice_user'; /** * A persona defines an interviewer's personality and focus. */ export interface Persona { /** Unique identifier */ id: string; /** Human-readable name */ name: string; /** Description of the persona's focus */ description: string; /** System prompt that shapes LLM behavior */ systemPrompt: string; /** Weight distribution for question categories */ questionBias: QuestionBias; /** Categories this persona focuses on */ categories: QuestionCategory[]; /** Additional context to include in prompts */ additionalContext?: string; /** Whether this is a built-in persona */ builtin?: boolean; } /** * Result of interviewing with a specific persona. */ export interface PersonaInterviewResult { /** Persona used for this interview */ persona: Persona; /** Questions generated by this persona */ questions: InterviewQuestion[]; /** Findings specific to this persona's focus */ findings: PersonaFinding[]; /** Security issues found (security persona only) */ securityIssues?: SecurityIssue[]; } /** * A finding from a persona-focused interview. */ export interface PersonaFinding { /** Tool this finding relates to */ tool: string; /** Category of finding */ category: QuestionCategory; /** Severity level */ severity: 'info' | 'low' | 'medium' | 'high' | 'critical'; /** Short title */ title: string; /** Detailed description */ description: string; /** Evidence supporting this finding */ evidence?: string; /** Suggested remediation */ recommendation?: string; } /** * Security issue found during security persona testing. */ export interface SecurityIssue { /** Type of security issue */ type: SecurityIssueType; /** Tool affected */ tool: string; /** Severity */ severity: 'low' | 'medium' | 'high' | 'critical'; /** Description of the issue */ description: string; /** Payload or input that triggered the issue */ payload?: string; /** Response that indicates vulnerability */ response?: string; /** CWE ID if applicable */ cweId?: string; } /** * Types of security issues to detect. */ export type SecurityIssueType = 'path_traversal' | 'command_injection' | 'sql_injection' | 'xss' | 'ssrf' | 'information_disclosure' | 'authentication_bypass' | 'authorization_bypass' | 'dos' | 'other'; /** * Configuration for loading personas. */ export interface PersonaConfig { /** Persona ID or path to YAML file */ persona: string | string[]; /** Path to custom persona file */ personaFile?: string; } /** * YAML schema for custom persona definitions. */ export interface PersonaYAML { id: string; name: string; description: string; systemPrompt: string; questionBias: QuestionBias; categories: QuestionCategory[]; additionalContext?: string; } /** * Aggregated results from multiple personas. */ export interface AggregatedPersonaResults { /** Results from each persona */ byPersona: Map; /** Findings that appeared across multiple personas */ commonFindings: PersonaFinding[]; /** Unique findings per persona */ uniqueFindings: Map; /** Overall security assessment */ securitySummary?: { issueCount: number; criticalCount: number; highCount: number; issues: SecurityIssue[]; }; } //# sourceMappingURL=types.d.ts.map