export interface ProjectProfile { type: 'new' | 'organized' | 'legacy'; structure: 'monorepo' | 'single-package'; frameworks: string[]; language: 'typescript' | 'javascript' | 'csharp' | 'mixed'; stats: ProjectStats; } export interface ProjectStats { totalFiles: number; criticalFiles: number; highFiles: number; mediumFiles: number; okFiles: number; genericFiles: number; totalLines: number; totalExports: number; } export type FileClassification = 'critical' | 'high' | 'medium' | 'ok'; export interface ExportInfo { name: string; type: 'function' | 'class' | 'type' | 'interface' | 'const' | 'enum' | 'other'; line: number; signature?: string; } export interface FileInfo { path: string; lines: number; exports: ExportInfo[]; classification: FileClassification; isGeneric: boolean; } export interface InventoryData { generatedAt: string; files: FileInfo[]; stats: ProjectStats; } export type DuplicateCategory = 'accidental' | 'cross-stack' | 'polymorphic' | 'barrel'; export interface DuplicateLocation { file: string; line: number; signature?: string; } export interface DuplicateGroup { name: string; type: string; locations: DuplicateLocation[]; /** Category assigned by the detector. Absent in legacy data (pre-categorization). */ category?: DuplicateCategory; } export interface DuplicateData { generatedAt: string; duplicates: DuplicateGroup[]; totalDuplicateNames: number; /** Cross-stack DTO mirrors, separated from duplicates for distinct rendering. */ crossStackMirrors?: DuplicateGroup[]; } export interface DependencyEntry { file: string; importedByCount: number; importedBy: string[]; } export interface DependencyData { generatedAt: string; mostImported: DependencyEntry[]; } export type AuditFocus = 'duplication' | 'size' | 'naming' | 'all'; export interface AuditReport { generatedAt: string; duplication: DuplicationReport; size: SizeReport; conventions: ConventionReport; progress: ProgressReport | null; } export interface DuplicationReport { duplicates: DuplicateGroup[]; totalDuplicateNames: number; filesWithMostDuplicates: Array<{ file: string; count: number; }>; } export interface OversizedFile { file: string; lines: number; exports: number; classification: FileClassification; isGeneric: boolean; } export interface SizeReport { oversizedFiles: OversizedFile[]; heavyExporters: OversizedFile[]; totalOversized: number; totalHeavyExporters: number; averageFileSize: number; } export type ConventionSeverity = 'error' | 'warning'; export interface ConventionIssue { file: string; severity: ConventionSeverity; rule: string; message: string; suggestion?: string; } export interface ConventionReport { issues: ConventionIssue[]; namingIssues: number; missingBarrels: number; totalIssues: number; compliancePercent: number; } export interface ProgressReport { previousDate: string; newDuplicates: DuplicateGroup[]; resolvedDuplicates: DuplicateGroup[]; unchangedDuplicates: DuplicateGroup[]; grownFiles: FileSizeChange[]; shrunkFiles: FileSizeChange[]; newFiles: string[]; removedFiles: string[]; } export interface FileSizeChange { file: string; previousLines: number; currentLines: number; delta: number; } export interface DetectedModule { path: string; name: string; type: 'barrel' | 'csproj' | 'package' | 'directory'; exports: string[]; totalExports: number; description?: string; } export interface ModuleMapData { modules: DetectedModule[]; } export interface RegistryExport { type: ExportInfo['type']; signature?: string; file: string; line: number; } export interface RegistryModule { type: DetectedModule['type']; description?: string; exports: Record; dependsOn?: string[]; } export interface RegistryData { version: string; generatedAt: string; modules: Record; unmapped?: Record; } export type ProjectType = ProjectProfile['type']; export type SectionVerbosity = 'light' | 'medium' | 'verbose'; export interface TemplateSectionFlags { principles: boolean; recommendedStructure: boolean; blueprintRef: boolean; conventionsFull: boolean; cssRules: boolean; additionalRules: boolean; antiDuplication: SectionVerbosity; variationRule: SectionVerbosity; locationRule: SectionVerbosity; duplicates: 'conditional' | 'resolved' | 'confidence-tiers'; largeFiles: 'conditional' | 'flat' | 'split-by-severity'; genericFiles: 'conditional' | 'always'; criticalDeps: 'standard' | 'with-warning'; oportunistic: 'none' | 'proactive' | 'cautious'; capabilityIndex: boolean; intentProtocol: boolean; namingMinimas: boolean; autoMaintenance: 'standard' | 'extended'; postCompact: 'standard' | 'extended'; referenceFiles: 'with-blueprint' | 'standard-4' | 'full-7'; } export interface StructuralDuplicationSummary { totalPatterns: number; totalLocations: number; estimatedDuplicateLines: number; /** Number of file pairs sharing ≥ significantPairThreshold patterns */ significantPairCount: number; /** Threshold used for "significant" pair classification */ significantPairThreshold: number; filePairs: Array<{ fileA: string; fileB: string; sharedPatterns: number; exampleLine: { file: string; line: number; }; }>; topFiles: Array<{ file: string; patternCount: number; }>; } export interface ClaudeMdOptions { blueprintGenerated?: boolean; sectionFlags?: TemplateSectionFlags; structuralSummary?: StructuralDuplicationSummary; capabilityIndex?: CapabilityIndexData; } export interface CapabilityEntry { name: string; type: ExportInfo['type']; file: string; line: number; signature?: string; signatureShape: string; effects: string[]; description: string | null; domain: string | null; action: string | null; entity: string | null; dependsOn: string[] | null; source: 'declared' | 'extracted' | 'enriched'; } export interface CapabilityIndexData { version: '2.0'; generatedAt: string; source: 'static' | 'hybrid'; entries: CapabilityEntry[]; } export interface CapabilityIndexSummary { totalEntries: number; declaredCount: number; extractedCount: number; enrichedCount: number; } export interface AiArchMeta { version: 1; createdAt: string; updatedAt: string; initType: ProjectType; initFrameworks: string[]; initStructure: 'monorepo' | 'single-package'; initLanguage: ProjectProfile['language']; stackSelection: StackSelection | null; sections: TemplateSectionFlags; blueprintGenerated: boolean; } export type HooksMode = 'yes' | 'no' | 'warn'; export interface InitOptions { type: 'auto' | 'new' | 'legacy'; hooks: HooksMode; dryRun: boolean; directory: string; blueprint: boolean; interactive: boolean; embeddings?: boolean; } export interface StackSelection { projectType: 'fullstack' | 'frontend' | 'backend' | 'library'; frontend?: { framework: string; libraries: string[]; }; backend?: { framework: string; libraries: string[]; }; database?: { engine: string; orm?: string; }; monorepo: boolean; } export interface AuditOptions { focus: AuditFocus; format: 'console' | 'md' | 'json'; output?: string; directory: string; } export type UpdateTarget = 'claude-md' | 'inventory' | 'duplicates' | 'hooks' | 'registry' | 'memory' | 'blueprint' | 'all'; export interface UpdateOptions { directory: string; only: UpdateTarget; dryRun: boolean; embeddings?: boolean; } export type GuardSeverity = 'block' | 'warn' | 'info' | 'off'; export interface GuardMessage { severity: GuardSeverity; text: string; suggestion?: string; identifier?: string; } export interface GuardResult { guardName: string; passed: boolean; messages: GuardMessage[]; } export interface GuardConfig { mode: HooksMode; guards: Record; whitelist: string[]; zones?: Record; } export interface GuardMemoryEntry { count: number; lastSeen: string; files: string[]; } export interface GuardMemory { warnings: Record; lastUpdated: string; } export interface WorkingMemoryDecision { what: string; why: string; timestamp: string; } export interface WorkingMemoryFileChange { file: string; action: string; session: string; timestamp: string; } export interface WorkingMemoryTask { description: string; plan: string[]; completedSteps: number[]; decisions: WorkingMemoryDecision[]; } export interface WorkingMemoryBashCommand { command: string; timestamp: string; } export interface WorkingMemory { version: string; lastUpdated: string; currentTask: WorkingMemoryTask | null; recentChanges: WorkingMemoryFileChange[]; bashCommands: WorkingMemoryBashCommand[]; filesRead: string[]; rejectedApproaches: string[]; activeModules: string[]; sessionNotes: string[]; } export interface DomainField { name: string; type: string; nullable: boolean; isPrimaryKey: boolean; isForeignKey: boolean; referencedEntity?: string; } export interface DomainRelationship { targetEntity: string; type: 'one-to-many' | 'many-to-one' | 'many-to-many' | 'belongs-to'; foreignKey?: string; } export interface DomainEntity { name: string; type: 'catalog' | 'transactional' | 'relation' | 'unknown'; fields: DomainField[]; relationships: DomainRelationship[]; source: 'schema-file' | 'md-file' | 'sql-file' | 'csharp-model' | 'prisma' | 'inferred'; recordCount?: number; } export interface DomainModule { name: string; description: string; entities: string[]; source: string; } export interface DomainContext { entities: DomainEntity[]; modules: DomainModule[]; dataSourceHints: string[]; } export type LibraryCategory = 'routing' | 'state' | 'data-fetching' | 'ui-components' | 'styling' | 'forms' | 'validation' | 'orm' | 'auth' | 'testing' | 'charts' | 'export' | 'logging' | 'mapping' | 'mobile-framework' | 'baas' | 'other'; export interface StackLibrary { name: string; version?: string; category: LibraryCategory; } export interface StackLayer { primary: string; libraries: StackLibrary[]; buildTool?: string; } export interface TechStackProfile { frontend: StackLayer | null; backend: StackLayer | null; database: StackLayer | null; detected: boolean; } export interface FolderNode { path: string; purpose: string; children?: FolderNode[]; suggestedFiles?: string[]; } export interface CodePattern { name: string; context: string; stackRequirement: string[]; example: string; antiPattern?: string; } export interface DataFlow { name: string; layers: string[]; description: string; } export interface SharedUtility { name: string; purpose: string; suggestedPath: string; stackReason: string; } export interface DesignTokenHint { category: string; suggestion: string; } export interface AntiDuplicationEntry { need: string; solution: string; canonicalPath: string; } export interface AntiPatternEntry { pattern: string; reason: string; alternative: string; } export interface DomainGrouping { groupName: string; entities: string[]; sharedResources: string[]; } export interface BlueprintData { generatedAt: string; techStack: TechStackProfile; domain: DomainContext; folderStructure: FolderNode[]; patterns: CodePattern[]; dataFlows: DataFlow[]; sharedUtilities: SharedUtility[]; designTokens: DesignTokenHint[] | null; antiDuplicationMap: AntiDuplicationEntry[]; antiPatterns: AntiPatternEntry[]; domainGroupings: DomainGrouping[]; } export declare const GENERIC_FILE_NAMES: string[]; export declare const SOURCE_EXTENSIONS: string[]; export declare const EXCLUDE_DIRS: string[]; /** * Load per-project exclude dirs from .claude/aicodesight-config.json. * User excludes are additive — they extend EXCLUDE_DIRS, never replace. */ export declare function loadExcludeDirs(targetDir: string): string[];