tree-sitter-analyzer 1.3.4__py3-none-any.whl → 1.3.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tree-sitter-analyzer might be problematic. Click here for more details.

@@ -11,7 +11,7 @@ Architecture:
11
11
  - Data Models: Generic and language-specific code element representations
12
12
  """
13
13
 
14
- __version__ = "1.3.4"
14
+ __version__ = "1.3.6"
15
15
  __author__ = "aisheng.yu"
16
16
  __email__ = "aimasteracc@gmail.com"
17
17
 
@@ -8,6 +8,7 @@ First narrow files with fd, then search contents with ripgrep, with caps & meta.
8
8
  from __future__ import annotations
9
9
 
10
10
  import logging
11
+ import pathlib
11
12
  import time
12
13
  from typing import Any
13
14
 
@@ -303,17 +304,19 @@ class FindAndGrepTool(BaseMCPTool):
303
304
  if sort_mode == "path":
304
305
  files.sort()
305
306
  elif sort_mode == "mtime":
306
- files.sort(
307
- key=lambda p: (
308
- Path(p).stat().st_mtime if Path(p).exists() else 0
309
- ),
310
- reverse=True,
311
- )
307
+
308
+ def get_mtime(p):
309
+ path_obj = pathlib.Path(p)
310
+ return path_obj.stat().st_mtime if path_obj.exists() else 0
311
+
312
+ files.sort(key=get_mtime, reverse=True)
312
313
  elif sort_mode == "size":
313
- files.sort(
314
- key=lambda p: Path(p).stat().st_size if Path(p).exists() else 0,
315
- reverse=True,
316
- )
314
+
315
+ def get_size(p):
316
+ path_obj = pathlib.Path(p)
317
+ return path_obj.stat().st_size if path_obj.exists() else 0
318
+
319
+ files.sort(key=get_size, reverse=True)
317
320
  except (OSError, ValueError): # nosec B110
318
321
  pass
319
322
 
@@ -424,6 +427,12 @@ class FindAndGrepTool(BaseMCPTool):
424
427
  group_by_file = arguments.get("group_by_file", False)
425
428
  if group_by_file and matches:
426
429
  grouped_result = fd_rg_utils.group_matches_by_file(matches)
430
+
431
+ # If summary_only is also requested, add summary to grouped result
432
+ if arguments.get("summary_only", False):
433
+ summary = fd_rg_utils.summarize_search_results(matches)
434
+ grouped_result["summary"] = summary
435
+
427
436
  grouped_result["meta"] = {
428
437
  "searched_file_count": searched_file_count,
429
438
  "truncated": (truncated_fd or truncated_rg),
@@ -225,6 +225,13 @@ class SearchContentTool(BaseMCPTool):
225
225
  v = arguments[key]
226
226
  if not isinstance(v, list) or not all(isinstance(x, str) for x in v):
227
227
  raise ValueError(f"{key} must be an array of strings")
228
+
229
+ # Validate roots and files if provided
230
+ if "roots" in arguments:
231
+ self._validate_roots(arguments["roots"])
232
+ if "files" in arguments:
233
+ self._validate_files(arguments["files"])
234
+
228
235
  return True
229
236
 
230
237
  def _determine_requested_format(self, arguments: dict[str, Any]) -> str:
@@ -309,7 +316,7 @@ class SearchContentTool(BaseMCPTool):
309
316
  max_count = fd_rg_utils.clamp_int(
310
317
  arguments.get("max_count"),
311
318
  fd_rg_utils.DEFAULT_RESULTS_LIMIT,
312
- fd_rg_utils.MAX_RESULTS_HARD_CAP,
319
+ fd_rg_utils.DEFAULT_RESULTS_LIMIT,
313
320
  )
314
321
  timeout_ms = arguments.get("timeout_ms")
315
322
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tree-sitter-analyzer
3
- Version: 1.3.4
3
+ Version: 1.3.6
4
4
  Summary: Extensible multi-language code analyzer framework using Tree-sitter with dynamic plugin architecture
5
5
  Project-URL: Homepage, https://github.com/aimasteracc/tree-sitter-analyzer
6
6
  Project-URL: Documentation, https://github.com/aimasteracc/tree-sitter-analyzer#readme
@@ -163,11 +163,11 @@ Description-Content-Type: text/markdown
163
163
 
164
164
  [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://python.org)
165
165
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
166
- [![Tests](https://img.shields.io/badge/tests-1605%20passed-brightgreen.svg)](#quality-assurance)
167
- [![Coverage](https://img.shields.io/badge/coverage-74.38%25-green.svg)](#quality-assurance)
166
+ [![Tests](https://img.shields.io/badge/tests-1794%20passed-brightgreen.svg)](#quality-assurance)
167
+ [![Coverage](https://img.shields.io/badge/coverage-74.77%25-green.svg)](#quality-assurance)
168
168
  [![Quality](https://img.shields.io/badge/quality-enterprise%20grade-blue.svg)](#quality-assurance)
169
169
  [![PyPI](https://img.shields.io/pypi/v/tree-sitter-analyzer.svg)](https://pypi.org/project/tree-sitter-analyzer/)
170
- [![Version](https://img.shields.io/badge/version-1.3.4-blue.svg)](https://github.com/aimasteracc/tree-sitter-analyzer/releases)
170
+ [![Version](https://img.shields.io/badge/version-1.3.6-blue.svg)](https://github.com/aimasteracc/tree-sitter-analyzer/releases)
171
171
  [![GitHub Stars](https://img.shields.io/github/stars/aimasteracc/tree-sitter-analyzer.svg?style=social)](https://github.com/aimasteracc/tree-sitter-analyzer)
172
172
 
173
173
  ## 🚀 Break LLM Token Limits, Let AI Understand Code Files of Any Size
@@ -915,16 +915,16 @@ Tree-sitter Analyzer automatically detects and protects project boundaries:
915
915
  ## 🏆 Quality Assurance
916
916
 
917
917
  ### 📊 **Quality Metrics**
918
- - **1,514 tests** - 100% pass rate ✅
919
- - **74.24% code coverage** - Industry-leading level
918
+ - **1,794 tests** - 100% pass rate ✅
919
+ - **74.77% code coverage** - Industry-leading level
920
920
  - **Zero test failures** - Fully CI/CD ready
921
921
  - **Cross-platform compatibility** - Windows, macOS, Linux
922
922
 
923
- ### ⚡ **Latest Quality Achievements (v1.3.4)**
923
+ ### ⚡ **Latest Quality Achievements (v1.3.6)**
924
924
  - ✅ **Cross-platform path compatibility** - Fixed Windows short path names and macOS symbolic link differences
925
925
  - ✅ **Windows environment** - Implemented robust path normalization using Windows API
926
926
  - ✅ **macOS environment** - Fixed `/var` vs `/private/var` symbolic link differences
927
- - ✅ **Comprehensive test coverage** - 1605 tests, 74.38% coverage
927
+ - ✅ **Comprehensive test coverage** - 1794 tests, 74.77% coverage
928
928
  - ✅ **GitFlow implementation** - Professional development/release branch strategy. See [GitFlow documentation](GITFLOW.md) for details.
929
929
 
930
930
  ### ⚙️ **Running Tests**
@@ -1041,9 +1041,9 @@ All AI prompts in this document have been thoroughly tested in real environments
1041
1041
 
1042
1042
  **Test Environment:**
1043
1043
  - Operating System: Windows 10
1044
- - Project: tree-sitter-analyzer v1.3.4
1044
+ - Project: tree-sitter-analyzer v1.3.6
1045
1045
  - Test Files: BigService.java (1419 lines), sample.py (256 lines), MultiClass.java (54 lines)
1046
- - Test Coverage: 1605 tests passed, 74.38% coverage
1046
+ - Test Coverage: 1794 tests passed, 74.77% coverage
1047
1047
  - Test Tools: All MCP tools (check_code_scale, analyze_code_structure, extract_code_section, query_code, list_files, search_content, find_and_grep)
1048
1048
 
1049
1049
  **🚀 Start Now** → [30-Second Quick Start](#-30-second-quick-start)
@@ -1,4 +1,4 @@
1
- tree_sitter_analyzer/__init__.py,sha256=w-TSWkZBKM6e0-pDzQpQ40S0ZA6t89fBOLIWWSOoUmw,3067
1
+ tree_sitter_analyzer/__init__.py,sha256=6qwAmX_0FZeYzSiFG2Rzz7NXnwBNCy9ilxDdZHEtHxs,3067
2
2
  tree_sitter_analyzer/__main__.py,sha256=Zl79tpe4UaMu-7yeztc06tgP0CVMRnvGgas4ZQP5SCs,228
3
3
  tree_sitter_analyzer/api.py,sha256=N_bcf1pLwzXS3elPn30OySLR6ehsHdWpchXMycjl0PY,17399
4
4
  tree_sitter_analyzer/cli_main.py,sha256=jWjVJ5AgNmtf6Z7CgeK3IF-zi7yIiu9zn4Oyvzl-iNQ,10349
@@ -58,11 +58,11 @@ tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py,sha256=JyS9gey2oFoWjzsiiLjw
58
58
  tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py,sha256=mssed7bEfGeGxW4mOf7dg8BDS1oqHLolIBNX9DaZ3DM,8997
59
59
  tree_sitter_analyzer/mcp/tools/base_tool.py,sha256=qf2My325azlnKOugNVMN_R1jtZcjXVy354sGVKzvZls,3546
60
60
  tree_sitter_analyzer/mcp/tools/fd_rg_utils.py,sha256=R1ICH40vkWO3OdKZjxok9ptQZpZ6-tM5SkLHHOC4-BE,17749
61
- tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py,sha256=u4VeRWhyS_kltWtuzwHNPtmFHjQguKAceP9X-RHD7Lk,21194
61
+ tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py,sha256=D7eNjPZzV1YRo7VktvUqq7xNn4V8AS8429XjOBWXLsw,21531
62
62
  tree_sitter_analyzer/mcp/tools/list_files_tool.py,sha256=TA1BRQtb-D5x1pD-IcRJYnP0WnnFfl9q7skI25MOdHk,12873
63
63
  tree_sitter_analyzer/mcp/tools/query_tool.py,sha256=1xY1ONNY2sIFJxoILlnNzBnwGVgzEF7vVJ2ccqR9auA,10879
64
64
  tree_sitter_analyzer/mcp/tools/read_partial_tool.py,sha256=BMAJF205hTIrYTQJG6N1-vVuKSby2CSm9nWzSMMWceI,11339
65
- tree_sitter_analyzer/mcp/tools/search_content_tool.py,sha256=CmyZNtVFMXvwVHeGQdNqPdUB2miTDBgp4G_J86Cl5So,21597
65
+ tree_sitter_analyzer/mcp/tools/search_content_tool.py,sha256=J7sK5x2BbhtH0XcZq8ETGuH3vrdn4Nf2f4VB_nDGUTo,21819
66
66
  tree_sitter_analyzer/mcp/tools/table_format_tool.py,sha256=NDIiCtmZSbCmaQOp7ED83jGE5DuJhx4mcUketVHrkjs,16024
67
67
  tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py,sha256=-zZnqN9WcoyRTKM_16ADH859LSebzi34BGYwQL2zCOs,25084
68
68
  tree_sitter_analyzer/mcp/utils/__init__.py,sha256=TgTTKsRJAqF95g1fAp5SR_zQVDkImpc_5R0Dw529UUw,3126
@@ -82,7 +82,7 @@ tree_sitter_analyzer/security/__init__.py,sha256=ZTqTt24hsljCpTXAZpJC57L7MU5lJLT
82
82
  tree_sitter_analyzer/security/boundary_manager.py,sha256=3eeENRKWtz2pyZHzd8DiVaq8fdeC6s1eVOuBylSmQPg,9347
83
83
  tree_sitter_analyzer/security/regex_checker.py,sha256=jWK6H8PTPgzbwRPfK_RZ8bBTS6rtEbgjY5vr3YWjQ_U,9616
84
84
  tree_sitter_analyzer/security/validator.py,sha256=yR4qTWEcXpR--bSFwtWvSgY0AzqujOFAqlc1Z7dlTdk,9809
85
- tree_sitter_analyzer-1.3.4.dist-info/METADATA,sha256=ZGb953-SqZGOvjQQ_HZTkrrq-zuTuuOtxxYbKjDktVY,39700
86
- tree_sitter_analyzer-1.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
87
- tree_sitter_analyzer-1.3.4.dist-info/entry_points.txt,sha256=U4tfLGXgCWubKm2PyEb3zxhQ2pm7zVotMyfyS0CodD8,486
88
- tree_sitter_analyzer-1.3.4.dist-info/RECORD,,
85
+ tree_sitter_analyzer-1.3.6.dist-info/METADATA,sha256=pyc0iAD0QnuJlk5XrOVw-CrMeNU15mqrQTzMT58To_0,39700
86
+ tree_sitter_analyzer-1.3.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
87
+ tree_sitter_analyzer-1.3.6.dist-info/entry_points.txt,sha256=U4tfLGXgCWubKm2PyEb3zxhQ2pm7zVotMyfyS0CodD8,486
88
+ tree_sitter_analyzer-1.3.6.dist-info/RECORD,,