tree-sitter-analyzer 1.9.1__py3-none-any.whl → 1.9.2__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.9.1"
14
+ __version__ = "1.9.2"
15
15
  __author__ = "aisheng.yu"
16
16
  __email__ = "aimasteracc@gmail.com"
17
17
 
@@ -397,7 +397,11 @@ def group_matches_by_file(matches: list[dict[str, Any]]) -> dict[str, Any]:
397
397
  # Convert to grouped structure
398
398
  files = []
399
399
  for file_path, file_matches in file_groups.items():
400
- files.append({"file": file_path, "matches": file_matches})
400
+ files.append({
401
+ "file": file_path,
402
+ "matches": file_matches,
403
+ "match_count": len(file_matches)
404
+ })
401
405
 
402
406
  return {"success": True, "count": total_matches, "files": files}
403
407
 
@@ -515,6 +519,11 @@ def summarize_search_results(
515
519
  truncated_line += "..."
516
520
  sample_lines.append(f"L{line_num}: {truncated_line}")
517
521
  remaining_lines -= 1
522
+
523
+ # Ensure we have at least some sample lines if matches exist
524
+ if not sample_lines and file_matches:
525
+ # Fallback: create a simple summary line
526
+ sample_lines.append(f"Found {len(file_matches)} matches")
518
527
 
519
528
  # Optimize file path for token efficiency
520
529
  optimized_path = _optimize_file_path(file_path, common_prefix)
@@ -341,21 +341,41 @@ class SearchContentTool(BaseMCPTool):
341
341
  # Simple cache lookup without complex cross-format logic for performance
342
342
  cached_result = self.cache.get(cache_key)
343
343
  if cached_result is not None:
344
- # Add cache hit indicator to result
345
- if isinstance(cached_result, dict):
346
- cached_result = cached_result.copy()
347
- cached_result["cache_hit"] = True
348
- return cached_result
349
- elif isinstance(cached_result, int):
350
- # For integer results (like total_only mode), return as-is
351
- return cached_result
344
+ # Check if this is a total_only request
345
+ total_only_requested = arguments.get("total_only", False)
346
+
347
+ if total_only_requested:
348
+ # For total_only mode, always return integer if possible
349
+ if isinstance(cached_result, int):
350
+ return cached_result
351
+ elif isinstance(cached_result, dict) and "total_matches" in cached_result:
352
+ return cached_result["total_matches"]
353
+ elif isinstance(cached_result, dict) and "count" in cached_result:
354
+ return cached_result["count"]
355
+ else:
356
+ # Fallback: extract count from dict or return 0
357
+ return 0
352
358
  else:
353
- # For other types, convert to dict format
354
- return {
355
- "success": True,
356
- "cached_result": cached_result,
357
- "cache_hit": True,
358
- }
359
+ # For non-total_only modes, return dict format
360
+ if isinstance(cached_result, dict):
361
+ cached_result = cached_result.copy()
362
+ cached_result["cache_hit"] = True
363
+ return cached_result
364
+ elif isinstance(cached_result, int):
365
+ # Convert integer to dict format for non-total_only modes
366
+ return {
367
+ "success": True,
368
+ "count": cached_result,
369
+ "total_matches": cached_result,
370
+ "cache_hit": True,
371
+ }
372
+ else:
373
+ # For other types, convert to dict format
374
+ return {
375
+ "success": True,
376
+ "cached_result": cached_result,
377
+ "cache_hit": True,
378
+ }
359
379
 
360
380
  # Handle max_count parameter properly
361
381
  # If user specifies max_count, use it directly (with reasonable upper limit)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tree-sitter-analyzer
3
- Version: 1.9.1
3
+ Version: 1.9.2
4
4
  Summary: AI-era enterprise-grade code analysis tool with comprehensive HTML/CSS support, dynamic plugin architecture, and MCP integration
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
@@ -202,7 +202,7 @@ Description-Content-Type: text/markdown
202
202
  [![Coverage](https://codecov.io/gh/aimasteracc/tree-sitter-analyzer/branch/main/graph/badge.svg)](https://codecov.io/gh/aimasteracc/tree-sitter-analyzer)
203
203
  [![Quality](https://img.shields.io/badge/quality-enterprise%20grade-blue.svg)](#quality-assurance)
204
204
  [![PyPI](https://img.shields.io/pypi/v/tree-sitter-analyzer.svg)](https://pypi.org/project/tree-sitter-analyzer/)
205
- [![Version](https://img.shields.io/badge/version-1.9.0-blue.svg)](https://github.com/aimasteracc/tree-sitter-analyzer/releases)
205
+ [![Version](https://img.shields.io/badge/version-1.9.2-blue.svg)](https://github.com/aimasteracc/tree-sitter-analyzer/releases)
206
206
  [![zread](https://img.shields.io/badge/Ask_Zread-_.svg?style=flat&color=00b0aa&labelColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQuOTYxNTYgMS42MDAxSDIuMjQxNTZDMS44ODgxIDEuNjAwMSAxLjYwMTU2IDEuODg2NjQgMS42MDE1NiAyLjI0MDFWNC45NjAxQzEuNjAxNTYgNS4zMTM1NiAxLjg4ODEgNS42MDAxIDIuMjQxNTYgNS42MDAxSDQuOTYxNTZDNS4zMTUwMiA1LjYwMDEgNS42MDE1NiA1LjMxMzU2IDUuNjAxNTYgNC45NjAxVjIuMjQwMUM1LjYwMTU2IDEuODg2NjQgNS4zMTUwMiAxLjYwMDEgNC45NjE1NiAxLjYwMDFaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00Ljk2MTU2IDEwLjM5OTlIMi4yNDE1NkMxLjg4ODEgMTAuMzk5OSAxLjYwMTU2IDEwLjY4NjQgMS42MDE1NiAxMS4wMzk5VjEzLjc1OTlDMS42MDE1NiAxNC4xMTM0IDEuODg4MSAxNC4zOTk5IDIuMjQxNTYgMTQuMzk5OUg0Ljk2MTU2QzUuMzE1MDIgMTQuMzk5OSA1LjYwMTU2IDE0LjExMzQgNS42MDE1NiAxMy43NTk5VjExLjAzOTlDNS42MDE1NiAxMC42ODY0IDUuMzE1MDIgMTAuMzk5OSA0Ljk2MTU2IDEwLjM5OTlaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik0xMy43NTg0IDEuNjAwMUgxMS4wMzg0QzEwLjY4NSAxLjYwMDEgMTAuMzk4NCAxLjg4NjY0IDEwLjM5ODQgMi4yNDAxVjQuOTYwMUMxMC4zOTg0IDUuMzEzNTYgMTAuNjg1IDUuNjAwMSAxMS4wMzg0IDUuNjAwMUgxMy43NTg0QzE0LjExMTkgNS42MDAxIDE0LjM5ODQgNS4zMTM1NiAxNC4zOTg0IDQuOTYwMVYyLjI0MDFDMTQuMzk4NCAxLjg4NjY0IDE0LjExMTkgMS42MDAxIDEzLjc1ODQgMS42MDAxWiIgZmlsbD0iI2ZmZiIvPgo8cGF0aCBkPSJNNCAxMkwxMiA0TDQgMTJaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00IDEyTDEyIDQiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L3N2Zz4K&logoColor=ffffff)](https://zread.ai/aimasteracc/tree-sitter-analyzer)
207
207
  [![GitHub Stars](https://img.shields.io/github/stars/aimasteracc/tree-sitter-analyzer.svg?style=social)](https://github.com/aimasteracc/tree-sitter-analyzer)
208
208
 
@@ -1,4 +1,4 @@
1
- tree_sitter_analyzer/__init__.py,sha256=yz1bxuVMf57NLkjSKaimvMe_1h8qwe5JUDLJ3OuewQM,3067
1
+ tree_sitter_analyzer/__init__.py,sha256=2gOLQE2qPo14YhUJcz4zjTq_sQ210fhLrHI0PcSa9aE,3067
2
2
  tree_sitter_analyzer/__main__.py,sha256=Zl79tpe4UaMu-7yeztc06tgP0CVMRnvGgas4ZQP5SCs,228
3
3
  tree_sitter_analyzer/api.py,sha256=y12xDnqvdNJdiG6GyqVdZBunmBLwfIjVgsCy0jjGOds,22129
4
4
  tree_sitter_analyzer/cli_main.py,sha256=AmKeZIUCSI8Gshbz_e1Niquf4pFbpPgtOTwQdLbQgcw,11093
@@ -71,12 +71,12 @@ tree_sitter_analyzer/mcp/tools/__init__.py,sha256=9KfetZTaUhvWTeKuZPYzWb7ZomFQ8S
71
71
  tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py,sha256=5IobTL2LuzYalJhIBbk_8QV2ehGGPRbyNO71ECYLmLs,30966
72
72
  tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py,sha256=mssed7bEfGeGxW4mOf7dg8BDS1oqHLolIBNX9DaZ3DM,8997
73
73
  tree_sitter_analyzer/mcp/tools/base_tool.py,sha256=K02l34Yn6brgg45yIXuSsRPB4Cp870ba86ZBlSU4OW8,3689
74
- tree_sitter_analyzer/mcp/tools/fd_rg_utils.py,sha256=MOuxAcunj4q0NUCSgrR-tBzE0zcHPk3WTHSy1XKvVmY,25069
74
+ tree_sitter_analyzer/mcp/tools/fd_rg_utils.py,sha256=P4zB5M_hMEZAfzcmhPdkNd5A_KA1atkr3DqBDUibMVE,25400
75
75
  tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py,sha256=if_P_rRqH72WGl845lCJ-aorb7nSOhnvh0cYPqdXje0,32126
76
76
  tree_sitter_analyzer/mcp/tools/list_files_tool.py,sha256=o66KKI2IkObU8qD3bhWKGcuytjCjxuENlxKdLV4NGkg,18187
77
77
  tree_sitter_analyzer/mcp/tools/query_tool.py,sha256=XOP21uVKe1J7ayiUnJJBUGls1QTJ5K0GoZ4HlbOr5YE,16887
78
78
  tree_sitter_analyzer/mcp/tools/read_partial_tool.py,sha256=O7UyZSNW5_-5hGOkO9xiw4qDY5WKvHtTiGQ_WjhAIA8,18305
79
- tree_sitter_analyzer/mcp/tools/search_content_tool.py,sha256=EY--l25VEKfbymP44ozWlfsfNTy94YEu1_3-vVrL6dY,35193
79
+ tree_sitter_analyzer/mcp/tools/search_content_tool.py,sha256=jjN4L8YJ91kHgXs9AdWIWVa5Vm0l4lot2Ud3FnBPN6Y,36297
80
80
  tree_sitter_analyzer/mcp/tools/table_format_tool.py,sha256=48zTj1AthSLfRT9KHzum332pKy3R2uxjGdw1omkzgfY,22853
81
81
  tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py,sha256=-zZnqN9WcoyRTKM_16ADH859LSebzi34BGYwQL2zCOs,25084
82
82
  tree_sitter_analyzer/mcp/utils/__init__.py,sha256=TgTTKsRJAqF95g1fAp5SR_zQVDkImpc_5R0Dw529UUw,3126
@@ -103,7 +103,7 @@ tree_sitter_analyzer/security/regex_checker.py,sha256=jWK6H8PTPgzbwRPfK_RZ8bBTS6
103
103
  tree_sitter_analyzer/security/validator.py,sha256=OIrlMmIqrfpG7FxrI9_xR6g3sgPpJyWPFfYiWma7Rkk,21708
104
104
  tree_sitter_analyzer/utils/__init__.py,sha256=ch_TjuMxxdGF9dDBOP_sYVGVZaMXzgGS1FOFn3sicHA,3863
105
105
  tree_sitter_analyzer/utils/tree_sitter_compat.py,sha256=p565DG7r5sHK2GgZFyj7X4eLwpWujaN_M61Z3oDqAxE,10610
106
- tree_sitter_analyzer-1.9.1.dist-info/METADATA,sha256=jtETjSq1c14B0QHeQxiJR9_HCDJF1MYhPbhhPfx-hDg,50168
107
- tree_sitter_analyzer-1.9.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
- tree_sitter_analyzer-1.9.1.dist-info/entry_points.txt,sha256=TJmEXxAMz3og3VPphTHsuE8tNJxf7GuAPjNHwVhXRnc,972
109
- tree_sitter_analyzer-1.9.1.dist-info/RECORD,,
106
+ tree_sitter_analyzer-1.9.2.dist-info/METADATA,sha256=KX23OZLqFpEQG_YTTdcSBbSbpShosquL0j2eOyDwbyY,50168
107
+ tree_sitter_analyzer-1.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
+ tree_sitter_analyzer-1.9.2.dist-info/entry_points.txt,sha256=TJmEXxAMz3og3VPphTHsuE8tNJxf7GuAPjNHwVhXRnc,972
109
+ tree_sitter_analyzer-1.9.2.dist-info/RECORD,,