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.
- tree_sitter_analyzer/__init__.py +1 -1
- tree_sitter_analyzer/mcp/tools/fd_rg_utils.py +10 -1
- tree_sitter_analyzer/mcp/tools/search_content_tool.py +34 -14
- {tree_sitter_analyzer-1.9.1.dist-info → tree_sitter_analyzer-1.9.2.dist-info}/METADATA +2 -2
- {tree_sitter_analyzer-1.9.1.dist-info → tree_sitter_analyzer-1.9.2.dist-info}/RECORD +7 -7
- {tree_sitter_analyzer-1.9.1.dist-info → tree_sitter_analyzer-1.9.2.dist-info}/WHEEL +0 -0
- {tree_sitter_analyzer-1.9.1.dist-info → tree_sitter_analyzer-1.9.2.dist-info}/entry_points.txt +0 -0
tree_sitter_analyzer/__init__.py
CHANGED
|
@@ -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({
|
|
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
|
-
#
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
return
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
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.
|
|
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
|
[](https://codecov.io/gh/aimasteracc/tree-sitter-analyzer)
|
|
203
203
|
[](#quality-assurance)
|
|
204
204
|
[](https://pypi.org/project/tree-sitter-analyzer/)
|
|
205
|
-
[](https://github.com/aimasteracc/tree-sitter-analyzer/releases)
|
|
206
206
|
[](https://zread.ai/aimasteracc/tree-sitter-analyzer)
|
|
207
207
|
[](https://github.com/aimasteracc/tree-sitter-analyzer)
|
|
208
208
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
tree_sitter_analyzer/__init__.py,sha256=
|
|
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=
|
|
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=
|
|
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.
|
|
107
|
-
tree_sitter_analyzer-1.9.
|
|
108
|
-
tree_sitter_analyzer-1.9.
|
|
109
|
-
tree_sitter_analyzer-1.9.
|
|
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,,
|
|
File without changes
|
{tree_sitter_analyzer-1.9.1.dist-info → tree_sitter_analyzer-1.9.2.dist-info}/entry_points.txt
RENAMED
|
File without changes
|