UNPKG

@ton-ai-core/vibecode-linter

Version:

Advanced TypeScript linter with Git integration, dependency analysis, and comprehensive error reporting

53 lines 2.44 kB
import type { ProjectFileRecord, ProjectSnapshot, ProjectTreeDirectory, TreeFormatOptions } from "../types/project-info.js"; /** * CHANGE: Normalize relative path into POSIX segments. * WHY: Ensures deterministic tree regardless of OS separators. * QUOTE(ТЗ): "Математические инварианты" — один и тот же путь ⇒ один набор сегментов. * REF: user-request-project-info * FORMAT THEOREM: normalize(path) produces segments with ∀segment ≠ "" * PURITY: CORE * INVARIANT: Returns [] for empty/"." * COMPLEXITY: O(k) where k = |path| */ declare function normalizeSegments(relativePath: string): readonly string[]; /** * CHANGE: Build project snapshot from file records. * WHY: Provides single pure constructor for downstream shell usage. * QUOTE(ТЗ): "Сначала формализуем, потом программируем." * REF: user-request-project-info * SOURCE: n/a * FORMAT THEOREM: snapshot(files).totals = root.metrics + counts * PURITY: CORE * INVARIANT: directoryCount ≥ 1 (включает корень) * COMPLEXITY: O(n log n) */ export declare function createProjectSnapshot(rootLabel: string, files: readonly ProjectFileRecord[]): ProjectSnapshot; /** * CHANGE: Human-friendly size formatter (bytes → KB/MB). * WHY: CLI output should remain compact regardless of file size. * QUOTE(ТЗ): "Вывод текущей информации по проекту" * REF: user-request-project-info * FORMAT THEOREM: formatSize(b) monotonic, returns "" when b = 0 * PURITY: CORE * INVARIANT: Never returns negative units * COMPLEXITY: O(1) */ declare function formatSize(sizeBytes: number): string; /** * CHANGE: Recursively format project tree using ASCII connectors. * WHY: Provide deterministic textual representation for CLI shell. * QUOTE(ТЗ): "Отображать дерево папки" * REF: user-request-project-info * SOURCE: n/a * FORMAT THEOREM: traverse(node) visits every node exactly once * PURITY: CORE * INVARIANT: Connectors maintain tree structure (├── / └── / │) * COMPLEXITY: O(n) */ export declare function formatProjectTree(root: ProjectTreeDirectory, options?: TreeFormatOptions): readonly string[]; export declare const __projectTreeInternals: { formatSize: typeof formatSize; normalizeSegments: typeof normalizeSegments; }; export {}; //# sourceMappingURL=tree.d.ts.map