Class ProjectAnalyzerTools

java.lang.Object
com.tnsai.tools.developer.ProjectAnalyzerTools

public class ProjectAnalyzerTools extends Object
Function-shape project-analysis tools — directory-tree visualization, file/line statistics, and language breakdown. Replaces the most-useful subset of the legacy ProjectAnalyzerTool (the analyze + dependencies operations are composable on top of these primitives + the existing DocumentTools.documentRead for build files).
MethodPurposeIdempotent
projectTree(java.lang.String, int)Visual directory tree (depth-bounded, ignores node_modules/.git/etc.)true
projectStats(java.lang.String)File counts + line-of-code counts grouped by languagetrue
projectLanguages(java.lang.String)Language breakdown as a {extension, language, count} maptrue

Pure-filesystem; no auth, no network. Skips standard build/cache directories (node_modules, .git, target, build, dist, .venv, …) so output stays focused.

Since:
0.5.7 (Phase 2 batch 30 — built-in tool migration to function shape, see #188)
  • Constructor Details

    • ProjectAnalyzerTools

      public ProjectAnalyzerTools()
  • Method Details

    • projectTree

      @Tool(name="project_tree", description="Render a visual directory tree starting at {path} (defaults to JVM CWD). {depth} clamps to [1, 10] (default 3). Standard build/cache/VCS directories ({@code node_modules}, {@code .git}, {@code target}, {@code build}, {@code dist}, {@code .venv}, \u2026) are skipped. Returns the ASCII tree string.", keywords={"project","tree","structure","directory"}, idempotent=true) public String projectTree(@ToolParam(description="Project root (defaults to JVM CWD)",required=false,defaultValue="") String path, @ToolParam(description="Max depth (1..10); 0 \u2192 default 3",required=false,defaultValue="0") int depth) throws IOException
      Throws:
      IOException
    • projectStats

      @Tool(name="project_stats", description="Walk {path} (defaults to JVM CWD) and return total file count + lines-of-code counts grouped by language. Returns a map: {totalFiles, totalLines, byLanguage: {Java: {files: N, lines: N}, \u2026}}. Caps at 10000 files to keep traversal bounded.", keywords={"project","stats","loc","lines","files"}, idempotent=true) public Map<String,Object> projectStats(@ToolParam(description="Project root (defaults to JVM CWD)",required=false,defaultValue="") String path) throws IOException
      Throws:
      IOException
    • projectLanguages

      @Tool(name="project_languages", description="Quick language breakdown \u2014 file counts only (no LoC). Faster than {@code project_stats} when you only need the language distribution. Returns a map {language: count} sorted by count descending.", keywords={"project","languages","breakdown"}, idempotent=true) public Map<String,Long> projectLanguages(@ToolParam(description="Project root (defaults to JVM CWD)",required=false,defaultValue="") String path) throws IOException
      Throws:
      IOException