/** * Read-only project analysis that runs here in Node, against files on disk, * instead of inside the editor. * * Why it moved: `@tool` scripts run on the editor's main thread, so a * project-wide sweep freezes the UI — and because the bridge pings every 10s and * gives up after two misses, a sweep slower than 20s kills its own connection. * That was not hypothetical: measured against a 24,649-file project, * `find_unused_resources` in the editor took 26,293 ms and returned * "Godot disconnected". The same question answered here took 1,601 ms. * * Nothing in this file needs Godot's object model — it reads `.tscn`/`.tres`/ * `.gd` as text, which is what the editor-side implementation did anyway. It * therefore also works with the editor closed, given GODOT_MCP_PROJECT. */ export interface UnusedScanOptions { includeAddons?: boolean; includeScripts?: boolean; limit?: number; } export interface UnusedScanResult { ok: true; unused: string[]; unused_count: number; truncated: boolean; files_scanned: number; include_addons: boolean; include_scripts: boolean; scanned_in: 'node'; elapsed_ms: number; note: string; } /** One file in the project, in both the forms we need. */ interface ProjectFile { res: string; abs: string; ext: string; } /** * Walk the project directory, mirroring the editor-side walk: dot-entries, * Godot's own `.godot` cache and `addons/` are skipped unless asked for. */ export declare function walkProject(root: string, includeAddons: boolean): Promise; /** * Find assets nothing in the project points at, by res:// path or by UID. */ export declare function findUnusedResources(root: string, options?: UnusedScanOptions): Promise; export interface ProjectStatistics { ok: true; include_addons: boolean; files_total: number; files_by_extension: Record; scripts: number; scenes: number; resources: number; script_lines: number; script_functions: number; scripts_with_class_name: number; signal_declarations: number; todo_markers: number; nodes_in_scenes: number; scenes_scanned: number; project_bytes: number; scanned_in: 'node'; elapsed_ms: number; } /** * Project-wide counts, read from disk here instead of in the editor. * * Moved for the same reason as findUnusedResources, and it was worse: measured * against the same 24,649-file project the editor-side version took 120,685 ms * — six times the bridge's 20s watchdog — and a live call did drop the editor * off the bridge. Two things made it that slow, and neither needs the engine: * it opened every file with FileAccess just to read its length (a `stat` here), * and it called ResourceLoader.load() on every .tscn, which pulls each scene's * textures and scripts into the resource cache to count its nodes. */ export declare function projectStatistics(root: string, includeAddons?: boolean): Promise; /** Does this look like a Godot project root? */ export declare function isProjectRoot(dir: string): Promise; export {}; //# sourceMappingURL=project-scan.d.ts.map