File size: 2,306 Bytes
fd8cdf5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import type { DashboardJSON } from '../../types/dashboard.js';
import type { FileEntry } from './scanner.js';
/**
 * Options for the analyze command.
 */
export interface AnalyzeOptions {
    /** Force full rebuild, skipping incremental mode */
    full: boolean;
}
/**
 * Result of a successful analysis run.
 */
export interface AnalyzeResult {
    /** The generated dashboard JSON conforming to the DashboardJSON schema */
    dashboard: DashboardJSON;
    /** Summary statistics of the analysis */
    stats: AnalyzeStats;
    /** The scanned file entries (used for domain context generation) */
    files: FileEntry[];
}
/**
 * Summary statistics from the analysis.
 */
export interface AnalyzeStats {
    /** Total number of files analyzed */
    filesAnalyzed: number;
    /** Number of nodes created, broken down by type */
    nodesByType: Record<string, number>;
    /** Total number of edges created */
    edgesCreated: number;
    /** Number of layers identified */
    layersIdentified: number;
}
/**
 * Main entry point for the static analysis engine.
 *
 * Scans the target directory, parses source files, builds a knowledge graph,
 * detects architectural layers, and generates a guided tour — all without
 * requiring an AI agent.
 *
 * Supports incremental mode: when an existing meta.json is found and --full
 * is not specified, only re-analyzes files changed since the last commit hash.
 *
 * @param targetPath - Absolute path to the directory to analyze
 * @param options - Analysis options (e.g., full rebuild vs incremental)
 * @returns AnalyzeResult with the generated dashboard and statistics
 */
export declare function analyze(targetPath: string, options: AnalyzeOptions): Promise<AnalyzeResult>;
export type { ScanResult, FileEntry } from './scanner.js';
export type { ParseResult, FunctionInfo, ClassInfo, ImportInfo } from './parser.js';
export type { GraphOutput } from './graph-builder.js';
export { scanProject } from './scanner.js';
export { parseFile } from './parser.js';
export { buildGraph } from './graph-builder.js';
export { detectLayers } from './layer-detector.js';
export { buildTour } from './tour-builder.js';
export { generateDomainContext } from './domain-context.js';
export type { DomainContext, EntryPoint, FileSignature } from './domain-context.js';