tree-sitter-analyzer 0.8.3__py3-none-any.whl → 0.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 +132 -132
- tree_sitter_analyzer/__main__.py +11 -11
- tree_sitter_analyzer/api.py +533 -533
- tree_sitter_analyzer/cli/__init__.py +39 -39
- tree_sitter_analyzer/cli/__main__.py +12 -12
- tree_sitter_analyzer/cli/commands/__init__.py +26 -26
- tree_sitter_analyzer/cli/commands/advanced_command.py +88 -88
- tree_sitter_analyzer/cli/commands/base_command.py +182 -180
- tree_sitter_analyzer/cli/commands/structure_command.py +138 -138
- tree_sitter_analyzer/cli/commands/summary_command.py +101 -101
- tree_sitter_analyzer/core/__init__.py +15 -15
- tree_sitter_analyzer/core/analysis_engine.py +74 -78
- tree_sitter_analyzer/core/cache_service.py +320 -320
- tree_sitter_analyzer/core/engine.py +566 -566
- tree_sitter_analyzer/core/parser.py +293 -293
- tree_sitter_analyzer/encoding_utils.py +459 -459
- tree_sitter_analyzer/file_handler.py +210 -210
- tree_sitter_analyzer/formatters/__init__.py +1 -1
- tree_sitter_analyzer/formatters/base_formatter.py +167 -167
- tree_sitter_analyzer/formatters/formatter_factory.py +78 -78
- tree_sitter_analyzer/formatters/java_formatter.py +18 -18
- tree_sitter_analyzer/formatters/python_formatter.py +19 -19
- tree_sitter_analyzer/interfaces/__init__.py +9 -9
- tree_sitter_analyzer/interfaces/cli.py +528 -528
- tree_sitter_analyzer/interfaces/cli_adapter.py +344 -343
- tree_sitter_analyzer/interfaces/mcp_adapter.py +206 -206
- tree_sitter_analyzer/language_detector.py +53 -53
- tree_sitter_analyzer/languages/__init__.py +10 -10
- tree_sitter_analyzer/languages/java_plugin.py +1 -1
- tree_sitter_analyzer/languages/javascript_plugin.py +446 -446
- tree_sitter_analyzer/languages/python_plugin.py +755 -755
- tree_sitter_analyzer/mcp/__init__.py +34 -31
- tree_sitter_analyzer/mcp/resources/__init__.py +44 -44
- tree_sitter_analyzer/mcp/resources/code_file_resource.py +209 -209
- tree_sitter_analyzer/mcp/server.py +623 -436
- tree_sitter_analyzer/mcp/tools/__init__.py +30 -30
- tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py +10 -6
- tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py +247 -242
- tree_sitter_analyzer/mcp/tools/base_tool.py +54 -54
- tree_sitter_analyzer/mcp/tools/read_partial_tool.py +310 -308
- tree_sitter_analyzer/mcp/tools/table_format_tool.py +386 -379
- tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py +563 -559
- tree_sitter_analyzer/mcp/utils/__init__.py +107 -107
- tree_sitter_analyzer/models.py +10 -10
- tree_sitter_analyzer/output_manager.py +253 -253
- tree_sitter_analyzer/plugins/__init__.py +280 -280
- tree_sitter_analyzer/plugins/base.py +529 -529
- tree_sitter_analyzer/plugins/manager.py +379 -379
- tree_sitter_analyzer/queries/__init__.py +26 -26
- tree_sitter_analyzer/queries/java.py +391 -391
- tree_sitter_analyzer/queries/javascript.py +148 -148
- tree_sitter_analyzer/queries/python.py +285 -285
- tree_sitter_analyzer/queries/typescript.py +229 -229
- tree_sitter_analyzer/query_loader.py +257 -257
- tree_sitter_analyzer/security/boundary_manager.py +237 -279
- tree_sitter_analyzer/security/validator.py +60 -58
- tree_sitter_analyzer/utils.py +294 -277
- {tree_sitter_analyzer-0.8.3.dist-info → tree_sitter_analyzer-0.9.2.dist-info}/METADATA +28 -19
- tree_sitter_analyzer-0.9.2.dist-info/RECORD +77 -0
- {tree_sitter_analyzer-0.8.3.dist-info → tree_sitter_analyzer-0.9.2.dist-info}/entry_points.txt +1 -0
- tree_sitter_analyzer-0.8.3.dist-info/RECORD +0 -77
- {tree_sitter_analyzer-0.8.3.dist-info → tree_sitter_analyzer-0.9.2.dist-info}/WHEEL +0 -0
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Base Tool Protocol for MCP Tools
|
|
4
|
-
|
|
5
|
-
This module defines the protocol that all MCP tools must implement
|
|
6
|
-
to ensure type safety and consistency.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from typing import Any, Protocol
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class MCPTool(Protocol):
|
|
13
|
-
"""
|
|
14
|
-
Protocol for MCP tools.
|
|
15
|
-
|
|
16
|
-
All MCP tools must implement this protocol to ensure they have
|
|
17
|
-
the required methods for integration with the MCP server.
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
def get_tool_definition(self) -> Any:
|
|
21
|
-
"""
|
|
22
|
-
Get the MCP tool definition.
|
|
23
|
-
|
|
24
|
-
Returns:
|
|
25
|
-
Tool definition object compatible with MCP server
|
|
26
|
-
"""
|
|
27
|
-
...
|
|
28
|
-
|
|
29
|
-
async def execute(self, arguments: dict[str, Any]) -> dict[str, Any]:
|
|
30
|
-
"""
|
|
31
|
-
Execute the tool with the given arguments.
|
|
32
|
-
|
|
33
|
-
Args:
|
|
34
|
-
arguments: Tool arguments
|
|
35
|
-
|
|
36
|
-
Returns:
|
|
37
|
-
Dictionary containing execution results
|
|
38
|
-
"""
|
|
39
|
-
...
|
|
40
|
-
|
|
41
|
-
def validate_arguments(self, arguments: dict[str, Any]) -> bool:
|
|
42
|
-
"""
|
|
43
|
-
Validate tool arguments.
|
|
44
|
-
|
|
45
|
-
Args:
|
|
46
|
-
arguments: Arguments to validate
|
|
47
|
-
|
|
48
|
-
Returns:
|
|
49
|
-
True if arguments are valid
|
|
50
|
-
|
|
51
|
-
Raises:
|
|
52
|
-
ValueError: If arguments are invalid
|
|
53
|
-
"""
|
|
54
|
-
...
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Base Tool Protocol for MCP Tools
|
|
4
|
+
|
|
5
|
+
This module defines the protocol that all MCP tools must implement
|
|
6
|
+
to ensure type safety and consistency.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Any, Protocol
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class MCPTool(Protocol):
|
|
13
|
+
"""
|
|
14
|
+
Protocol for MCP tools.
|
|
15
|
+
|
|
16
|
+
All MCP tools must implement this protocol to ensure they have
|
|
17
|
+
the required methods for integration with the MCP server.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def get_tool_definition(self) -> Any:
|
|
21
|
+
"""
|
|
22
|
+
Get the MCP tool definition.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
Tool definition object compatible with MCP server
|
|
26
|
+
"""
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
async def execute(self, arguments: dict[str, Any]) -> dict[str, Any]:
|
|
30
|
+
"""
|
|
31
|
+
Execute the tool with the given arguments.
|
|
32
|
+
|
|
33
|
+
Args:
|
|
34
|
+
arguments: Tool arguments
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
Dictionary containing execution results
|
|
38
|
+
"""
|
|
39
|
+
...
|
|
40
|
+
|
|
41
|
+
def validate_arguments(self, arguments: dict[str, Any]) -> bool:
|
|
42
|
+
"""
|
|
43
|
+
Validate tool arguments.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
arguments: Arguments to validate
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
True if arguments are valid
|
|
50
|
+
|
|
51
|
+
Raises:
|
|
52
|
+
ValueError: If arguments are invalid
|
|
53
|
+
"""
|
|
54
|
+
...
|