/** * ruRE Phase 1 — static analysis via the TypeScript compiler API (ADR-0002). * * Parses JS/MJS/CJS/TS/TSX source into an AST and inspects it. This module * only reads and inspects; it never calls eval, vm, child_process, or a * dynamic require on analyzed content (ADR-0001 "parses, never executes"). * * The `typescript` package is loaded lazily (not as a top-level import): * mcp-tools/rure-tools.ts is registered into every CLI invocation's tool * set via mcp-client.ts, so a static `import ts from 'typescript'` here * would load the full compiler into memory on every `ruflo` command, not * just the ones that use ruRE. Same reasoning as aidefence-gate.ts's lazy * load, and the same failure shape as the #2561 cold-start regression. */ export interface Evidence { file: string; /** 1-indexed, inclusive. */ lineStart: number; lineEnd: number; } export interface ImportRecord { source: string; names: string[]; evidence: Evidence; } export interface ExportRecord { name: string; evidence: Evidence; } export interface ElectronBoundaryHit { kind: 'require-electron' | 'ipcMain' | 'ipcRenderer' | 'contextBridge' | 'nodeIntegration-flag'; detail: string; evidence: Evidence; } export interface ModuleAnalysis { file: string; imports: ImportRecord[]; exports: ExportRecord[]; electronBoundaries: ElectronBoundaryHit[]; /** Raw text snippets this module's analysis quoted, for the AIDefence gate to scan. */ rawSnippets: string[]; } /** No `typescript` dependency — pure extension check, safe to call eagerly. */ export declare function isAnalyzableFile(path: string): boolean; /** Parses one file's source text into a structural analysis. Never executes it. */ export declare function analyzeModuleSource(file: string, sourceText: string): Promise; //# sourceMappingURL=ts-walk.d.ts.map