tree-sitter-analyzer 0.8.2__tar.gz → 0.9.1__tar.gz

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.

Files changed (115) hide show
  1. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/CHANGELOG.md +36 -0
  2. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/PKG-INFO +23 -13
  3. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/PROJECT_ROOT_CONFIG.md +203 -203
  4. tree_sitter_analyzer-0.9.1/PYPI_RELEASE_GUIDE.md +125 -0
  5. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/README.md +22 -12
  6. tree_sitter_analyzer-0.9.1/RELEASE_NOTES_v0.9.1.md +100 -0
  7. tree_sitter_analyzer-0.9.1/UPLOAD_COMMANDS.md +90 -0
  8. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/project_root_demo.py +247 -247
  9. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/security_demo.py +282 -282
  10. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/security_integration_demo.py +216 -216
  11. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/pyproject.toml +20 -22
  12. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/start_mcp_server.py +116 -116
  13. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/__init__.py +1 -1
  14. tree_sitter_analyzer-0.9.1/tree_sitter_analyzer/mcp/__init__.py +45 -0
  15. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/server.py +185 -43
  16. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/tools/read_partial_tool.py +4 -4
  17. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/project_detector.py +317 -317
  18. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/security/__init__.py +22 -22
  19. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/security/boundary_manager.py +237 -237
  20. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/security/regex_checker.py +292 -292
  21. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/security/validator.py +241 -241
  22. tree_sitter_analyzer-0.9.1/upload_interactive.py +167 -0
  23. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/uv.lock +1 -1
  24. tree_sitter_analyzer-0.8.2/RELEASE_CHECKLIST_v0.8.2.md +0 -182
  25. tree_sitter_analyzer-0.8.2/RELEASE_NOTES_v0.8.2.md +0 -181
  26. tree_sitter_analyzer-0.8.2/tree_sitter_analyzer/mcp/__init__.py +0 -31
  27. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/.gitignore +0 -0
  28. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/.pre-commit-config.yaml +0 -0
  29. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/AI_COLLABORATION_GUIDE.md +0 -0
  30. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/CODE_STYLE_GUIDE.md +0 -0
  31. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/CONTRIBUTING.md +0 -0
  32. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/DEPLOYMENT_GUIDE.md +0 -0
  33. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/LLM_CODING_GUIDELINES.md +0 -0
  34. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/MCP_SETUP_DEVELOPERS.md +0 -0
  35. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/MCP_SETUP_USERS.md +0 -0
  36. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/README_ja.md +0 -0
  37. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/README_zh.md +0 -0
  38. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/build_standalone.py +0 -0
  39. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/check_quality.py +0 -0
  40. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/docs/api.md +0 -0
  41. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/BigService.java +0 -0
  42. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/BigService.json +0 -0
  43. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/BigService.summary.json +0 -0
  44. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/JavaDocTest.java +0 -0
  45. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/MultiClass.java +0 -0
  46. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/Sample.java +0 -0
  47. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/calculate_token_comparison.py +0 -0
  48. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/examples/sample.py +0 -0
  49. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/llm_code_checker.py +0 -0
  50. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/pytest.ini +0 -0
  51. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/__main__.py +0 -0
  52. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/api.py +0 -0
  53. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/__init__.py +0 -0
  54. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/__main__.py +0 -0
  55. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/commands/__init__.py +0 -0
  56. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/commands/advanced_command.py +0 -0
  57. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/commands/base_command.py +0 -0
  58. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/commands/default_command.py +0 -0
  59. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/commands/partial_read_command.py +0 -0
  60. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/commands/query_command.py +0 -0
  61. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/commands/structure_command.py +0 -0
  62. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/commands/summary_command.py +0 -0
  63. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/commands/table_command.py +0 -0
  64. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli/info_commands.py +0 -0
  65. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/cli_main.py +0 -0
  66. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/core/__init__.py +0 -0
  67. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/core/analysis_engine.py +0 -0
  68. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/core/cache_service.py +0 -0
  69. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/core/engine.py +0 -0
  70. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/core/parser.py +0 -0
  71. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/core/query.py +0 -0
  72. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/encoding_utils.py +0 -0
  73. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/exceptions.py +0 -0
  74. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/file_handler.py +0 -0
  75. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/formatters/__init__.py +0 -0
  76. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/formatters/base_formatter.py +0 -0
  77. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/formatters/formatter_factory.py +0 -0
  78. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/formatters/java_formatter.py +0 -0
  79. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/formatters/python_formatter.py +0 -0
  80. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/interfaces/__init__.py +0 -0
  81. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/interfaces/cli.py +0 -0
  82. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/interfaces/cli_adapter.py +0 -0
  83. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/interfaces/mcp_adapter.py +0 -0
  84. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/interfaces/mcp_server.py +0 -0
  85. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/language_detector.py +0 -0
  86. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/language_loader.py +0 -0
  87. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/languages/__init__.py +0 -0
  88. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/languages/java_plugin.py +0 -0
  89. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/languages/javascript_plugin.py +0 -0
  90. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/languages/python_plugin.py +0 -0
  91. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/resources/__init__.py +0 -0
  92. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/resources/code_file_resource.py +0 -0
  93. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/resources/project_stats_resource.py +0 -0
  94. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/tools/__init__.py +0 -0
  95. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py +0 -0
  96. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py +0 -0
  97. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/tools/base_tool.py +0 -0
  98. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/tools/table_format_tool.py +0 -0
  99. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py +0 -0
  100. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/utils/__init__.py +0 -0
  101. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/mcp/utils/error_handler.py +0 -0
  102. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/models.py +0 -0
  103. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/output_manager.py +0 -0
  104. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/plugins/__init__.py +0 -0
  105. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/plugins/base.py +0 -0
  106. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/plugins/manager.py +0 -0
  107. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/queries/__init__.py +0 -0
  108. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/queries/java.py +0 -0
  109. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/queries/javascript.py +0 -0
  110. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/queries/python.py +0 -0
  111. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/queries/typescript.py +0 -0
  112. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/query_loader.py +0 -0
  113. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/table_formatter.py +0 -0
  114. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/tree_sitter_analyzer/utils.py +0 -0
  115. {tree_sitter_analyzer-0.8.2 → tree_sitter_analyzer-0.9.1}/upload_to_pypi.py +0 -0
@@ -5,6 +5,42 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.9.1] - 2025-08-12
9
+
10
+ ### 🎯 MCP Tools Unification & Simplification
11
+
12
+ #### 🔧 Unified Tool Names
13
+ - **BREAKING**: Simplified MCP tools to 3 core tools with clear naming:
14
+ - `check_code_scale` - Step 1: Check file scale and complexity
15
+ - `analyze_code_structure` - Step 2: Generate structure tables with line positions
16
+ - `extract_code_section` - Step 3: Extract specific code sections by line range
17
+ - **Removed**: Backward compatibility for old tool names (`analyze_code_scale`, `read_code_partial`, `format_table`, `analyze_code_universal`)
18
+ - **Enhanced**: Tool descriptions with step numbers and usage guidance
19
+
20
+ #### 📋 Parameter Standardization
21
+ - **Standardized**: All parameters use snake_case naming convention
22
+ - **Fixed**: Common LLM parameter mistakes with clear validation
23
+ - **Required**: `file_path` parameter for all tools
24
+ - **Required**: `start_line` parameter for `extract_code_section`
25
+
26
+ #### 📖 Documentation Improvements
27
+ - **Updated**: README.md with unified tool workflow examples
28
+ - **Enhanced**: MCP_INFO with workflow guidance
29
+ - **Simplified**: Removed redundant documentation files
30
+ - **Added**: Clear three-step workflow instructions for LLMs
31
+
32
+ #### 🧪 Test Suite Updates
33
+ - **Fixed**: All MCP-related tests updated for new tool names
34
+ - **Updated**: 138 MCP tests passing with new unified structure
35
+ - **Enhanced**: Test coverage for unified tool workflow
36
+ - **Maintained**: 100% backward compatibility in core analysis engine
37
+
38
+ #### 🎉 Benefits
39
+ - **Simplified**: LLM integration with clear tool naming
40
+ - **Reduced**: Parameter confusion with consistent snake_case
41
+ - **Improved**: Workflow clarity with numbered steps
42
+ - **Enhanced**: Error messages with available tool suggestions
43
+
8
44
  ## [0.8.2] - 2025-08-05
9
45
 
10
46
  ### 🎯 Major Quality Improvements
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tree-sitter-analyzer
3
- Version: 0.8.2
3
+ Version: 0.9.1
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
@@ -137,7 +137,7 @@ Description-Content-Type: text/markdown
137
137
 
138
138
  [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://python.org)
139
139
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
140
- [![Tests](https://img.shields.io/badge/tests-1358%20passed-brightgreen.svg)](#testing)
140
+ [![Tests](https://img.shields.io/badge/tests-306%20passed-brightgreen.svg)](#testing)
141
141
  [![Coverage](https://img.shields.io/badge/coverage-74.82%25-green.svg)](#testing)
142
142
  [![Quality](https://img.shields.io/badge/quality-enterprise%20grade-blue.svg)](#quality)
143
143
 
@@ -228,11 +228,10 @@ Extract specific code sections efficiently:
228
228
  - Content length information
229
229
 
230
230
  ### 3. AI Assistant Integration
231
- Four powerful MCP tools for AI assistants:
232
- - `analyze_code_scale` - Get code metrics and complexity
233
- - `analyze_code_structure` - Generate detailed structure tables
234
- - `read_code_partial` - Extract specific line ranges
235
- - `analyze_code_universal` - Universal analysis with auto-detection
231
+ Three-step workflow MCP tools for AI assistants:
232
+ - `check_code_scale` - **Step 1:** Get code metrics and complexity
233
+ - `analyze_code_structure` - **Step 2:** Generate detailed structure tables with line positions
234
+ - `extract_code_section` - **Step 3:** Extract specific code sections by line range
236
235
 
237
236
  ### 4. Multi-Language Support
238
237
  - **Java** - Full support with advanced analysis
@@ -244,14 +243,25 @@ Four powerful MCP tools for AI assistants:
244
243
 
245
244
  ### AI Assistant Usage (via Claude Desktop)
246
245
 
247
- **Step 1: Get code overview:**
248
- > "What's the overall complexity and size of this Java file examples/Sample.java?"
246
+ **Step 1: Check code scale**
247
+ ```
248
+ Use tool: check_code_scale
249
+ Parameters: {"file_path": "examples/Sample.java"}
250
+ ```
249
251
 
250
- **Step 2: Analyze code structure (for large files):**
251
- > "Please analyze the structure of examples/Sample.java and show me a detailed table"
252
+ **Step 2: Analyze structure (for large files >100 lines)**
253
+ ```
254
+ Use tool: analyze_code_structure
255
+ Parameters: {"file_path": "examples/Sample.java", "format_type": "full"}
256
+ ```
257
+
258
+ **Step 3: Extract specific code (using line positions from step 2)**
259
+ ```
260
+ Use tool: extract_code_section
261
+ Parameters: {"file_path": "examples/Sample.java", "start_line": 84, "end_line": 86}
262
+ ```
252
263
 
253
- **Step 3: Extract specific code:**
254
- > "Show me lines 84-86 from examples/Sample.java"
264
+ > **Note:** Always use snake_case parameter names: `file_path`, `start_line`, `end_line`, `format_type`
255
265
 
256
266
  ### CLI Usage
257
267
 
@@ -1,203 +1,203 @@
1
- # Project Root Configuration Guide
2
-
3
- **Quick reference for configuring project root in tree-sitter-analyzer**
4
-
5
- ## 🎯 Recommended Configuration (Most Users)
6
-
7
- ### MCP Server (Claude Desktop)
8
-
9
- ```json
10
- {
11
- "mcpServers": {
12
- "tree-sitter-analyzer": {
13
- "command": "uv",
14
- "args": [
15
- "run", "--with", "tree-sitter-analyzer[mcp]",
16
- "python", "-m", "tree_sitter_analyzer.mcp.server"
17
- ],
18
- "env": {
19
- "TREE_SITTER_PROJECT_ROOT": "${workspaceFolder}"
20
- }
21
- }
22
- }
23
- }
24
- ```
25
-
26
- ### CLI Usage
27
-
28
- ```bash
29
- # Auto-detect project root (recommended)
30
- tree-sitter-analyzer src/main.py --table=full
31
-
32
- # Explicit project root (when needed)
33
- tree-sitter-analyzer src/main.py --project-root /path/to/project --table=full
34
- ```
35
-
36
- ## 🔧 How It Works
37
-
38
- ### Auto-Detection Process
39
-
40
- 1. **Searches for project markers** (in priority order):
41
- - Version control: `.git`, `.hg`, `.svn`
42
- - Python: `pyproject.toml`, `setup.py`, `requirements.txt`
43
- - JavaScript: `package.json`, `yarn.lock`, `node_modules`
44
- - Java: `pom.xml`, `build.gradle`, `gradlew`
45
- - And 20+ more project types
46
-
47
- 2. **Traverses upward** from file location
48
- 3. **Selects best match** based on marker priority and count
49
- 4. **Falls back** to file directory if no markers found
50
-
51
- ### Security Benefits
52
-
53
- - ✅ **File access control**: Only files within project boundaries
54
- - ✅ **Path traversal protection**: Blocks `../../../etc/passwd` attacks
55
- - ✅ **Symlink safety**: Prevents symlink-based boundary bypass
56
- - ✅ **Audit logging**: Records all security events
57
-
58
- ## 📋 Configuration Options
59
-
60
- ### Priority Order (Highest to Lowest)
61
-
62
- | Priority | Method | CLI | MCP | Use Case |
63
- |----------|--------|-----|-----|----------|
64
- | 🥇 **1st** | Command line argument | `--project-root /path` | `"args": [..., "--project-root", "/path"]` | Fixed paths, overrides |
65
- | 🥈 **2nd** | Environment variable | `TREE_SITTER_PROJECT_ROOT=/path` | `"env": {"TREE_SITTER_PROJECT_ROOT": "/path"}` | Dynamic, workspace integration |
66
- | 🥉 **3rd** | Auto-detection | *(default)* | *(default)* | Zero configuration |
67
-
68
- ### When to Use Each Method
69
-
70
- #### Environment Variable (Recommended)
71
- ```json
72
- "env": {"TREE_SITTER_PROJECT_ROOT": "${workspaceFolder}"}
73
- ```
74
- - ✅ **Best for**: Most users, IDE integration
75
- - ✅ **Benefits**: Automatic workspace adaptation, flexible
76
- - ✅ **Works with**: VS Code, most IDEs
77
-
78
- #### Command Line Argument
79
- ```bash
80
- --project-root /specific/path
81
- ```
82
- - ✅ **Best for**: Fixed paths, CI/CD, overrides
83
- - ✅ **Benefits**: Explicit control, highest priority
84
- - ✅ **Works with**: Scripts, automation
85
-
86
- #### Auto-Detection
87
- ```bash
88
- # No configuration needed
89
- ```
90
- - ✅ **Best for**: Development, quick testing
91
- - ✅ **Benefits**: Zero configuration, intelligent
92
- - ✅ **Works with**: Standard project structures
93
-
94
- ## 🚨 Common Issues & Solutions
95
-
96
- ### Issue: "Absolute path must be within project directory"
97
-
98
- **Cause**: File is outside detected project boundary
99
-
100
- **Solutions:**
101
- 1. Use explicit project root: `--project-root /correct/path`
102
- 2. Check project markers exist in expected location
103
- 3. Verify file is actually within intended project
104
-
105
- ### Issue: "No project root detected"
106
-
107
- **Cause**: No project markers found
108
-
109
- **Solutions:**
110
- 1. Add a project marker file (`.git`, `pyproject.toml`, etc.)
111
- 2. Use explicit project root: `--project-root .`
112
- 3. Check current working directory
113
-
114
- ### Issue: Wrong project root detected
115
-
116
- **Cause**: Multiple nested projects or unexpected markers
117
-
118
- **Solutions:**
119
- 1. Use explicit project root to override
120
- 2. Remove unwanted project markers
121
- 3. Check marker priority (`.git` > `pyproject.toml` > `README.md`)
122
-
123
- ## 🧪 Testing Your Configuration
124
-
125
- ### Test Auto-Detection
126
- ```bash
127
- cd /your/project
128
- python -c "
129
- from tree_sitter_analyzer.project_detector import detect_project_root
130
- print('Detected:', detect_project_root())
131
- "
132
- ```
133
-
134
- ### Test MCP Server
135
- ```bash
136
- # Test with your configuration
137
- python -m tree_sitter_analyzer.mcp.server --help
138
- # Check logs for "MCP server starting with project root: ..."
139
- ```
140
-
141
- ### Test Security Boundaries
142
- ```bash
143
- # Should work (file within project)
144
- tree-sitter-analyzer src/main.py --table=compact
145
-
146
- # Should fail (file outside project)
147
- tree-sitter-analyzer ../outside.py --table=compact
148
- ```
149
-
150
- ## 📖 Examples by Project Type
151
-
152
- ### Python Project
153
- ```
154
- my-python-project/
155
- ├── pyproject.toml # ← Detected as project root
156
- ├── src/
157
- │ └── mypackage/
158
- │ └── main.py # ← Analyze this file
159
- └── tests/
160
- ```
161
-
162
- ### JavaScript Project
163
- ```
164
- my-js-project/
165
- ├── package.json # ← Detected as project root
166
- ├── src/
167
- │ └── index.js # ← Analyze this file
168
- └── node_modules/
169
- ```
170
-
171
- ### Java Project
172
- ```
173
- my-java-project/
174
- ├── pom.xml # ← Detected as project root
175
- ├── src/
176
- │ └── main/
177
- │ └── java/
178
- │ └── Main.java # ← Analyze this file
179
- └── target/
180
- ```
181
-
182
- ### Git Repository
183
- ```
184
- any-project/
185
- ├── .git/ # ← Detected as project root (highest priority)
186
- ├── src/
187
- │ └── code.ext # ← Analyze this file
188
- └── docs/
189
- ```
190
-
191
- ## 🎯 Best Practices
192
-
193
- 1. **Use environment variable for MCP**: `${workspaceFolder}` adapts automatically
194
- 2. **Let auto-detection work**: Most projects have standard markers
195
- 3. **Override when needed**: Use command line for special cases
196
- 4. **Test your setup**: Verify project root detection works as expected
197
- 5. **Keep it simple**: Start with recommended configuration, customize only if needed
198
-
199
- ---
200
-
201
- **Need help?** Check the full setup guides:
202
- - [MCP Setup for Users](MCP_SETUP_USERS.md)
203
- - [MCP Setup for Developers](MCP_SETUP_DEVELOPERS.md)
1
+ # Project Root Configuration Guide
2
+
3
+ **Quick reference for configuring project root in tree-sitter-analyzer**
4
+
5
+ ## 🎯 Recommended Configuration (Most Users)
6
+
7
+ ### MCP Server (Claude Desktop)
8
+
9
+ ```json
10
+ {
11
+ "mcpServers": {
12
+ "tree-sitter-analyzer": {
13
+ "command": "uv",
14
+ "args": [
15
+ "run", "--with", "tree-sitter-analyzer[mcp]",
16
+ "python", "-m", "tree_sitter_analyzer.mcp.server"
17
+ ],
18
+ "env": {
19
+ "TREE_SITTER_PROJECT_ROOT": "${workspaceFolder}"
20
+ }
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ ### CLI Usage
27
+
28
+ ```bash
29
+ # Auto-detect project root (recommended)
30
+ tree-sitter-analyzer src/main.py --table=full
31
+
32
+ # Explicit project root (when needed)
33
+ tree-sitter-analyzer src/main.py --project-root /path/to/project --table=full
34
+ ```
35
+
36
+ ## 🔧 How It Works
37
+
38
+ ### Auto-Detection Process
39
+
40
+ 1. **Searches for project markers** (in priority order):
41
+ - Version control: `.git`, `.hg`, `.svn`
42
+ - Python: `pyproject.toml`, `setup.py`, `requirements.txt`
43
+ - JavaScript: `package.json`, `yarn.lock`, `node_modules`
44
+ - Java: `pom.xml`, `build.gradle`, `gradlew`
45
+ - And 20+ more project types
46
+
47
+ 2. **Traverses upward** from file location
48
+ 3. **Selects best match** based on marker priority and count
49
+ 4. **Falls back** to file directory if no markers found
50
+
51
+ ### Security Benefits
52
+
53
+ - ✅ **File access control**: Only files within project boundaries
54
+ - ✅ **Path traversal protection**: Blocks `../../../etc/passwd` attacks
55
+ - ✅ **Symlink safety**: Prevents symlink-based boundary bypass
56
+ - ✅ **Audit logging**: Records all security events
57
+
58
+ ## 📋 Configuration Options
59
+
60
+ ### Priority Order (Highest to Lowest)
61
+
62
+ | Priority | Method | CLI | MCP | Use Case |
63
+ |----------|--------|-----|-----|----------|
64
+ | 🥇 **1st** | Command line argument | `--project-root /path` | `"args": [..., "--project-root", "/path"]` | Fixed paths, overrides |
65
+ | 🥈 **2nd** | Environment variable | `TREE_SITTER_PROJECT_ROOT=/path` | `"env": {"TREE_SITTER_PROJECT_ROOT": "/path"}` | Dynamic, workspace integration |
66
+ | 🥉 **3rd** | Auto-detection | *(default)* | *(default)* | Zero configuration |
67
+
68
+ ### When to Use Each Method
69
+
70
+ #### Environment Variable (Recommended)
71
+ ```json
72
+ "env": {"TREE_SITTER_PROJECT_ROOT": "${workspaceFolder}"}
73
+ ```
74
+ - ✅ **Best for**: Most users, IDE integration
75
+ - ✅ **Benefits**: Automatic workspace adaptation, flexible
76
+ - ✅ **Works with**: VS Code, most IDEs
77
+
78
+ #### Command Line Argument
79
+ ```bash
80
+ --project-root /specific/path
81
+ ```
82
+ - ✅ **Best for**: Fixed paths, CI/CD, overrides
83
+ - ✅ **Benefits**: Explicit control, highest priority
84
+ - ✅ **Works with**: Scripts, automation
85
+
86
+ #### Auto-Detection
87
+ ```bash
88
+ # No configuration needed
89
+ ```
90
+ - ✅ **Best for**: Development, quick testing
91
+ - ✅ **Benefits**: Zero configuration, intelligent
92
+ - ✅ **Works with**: Standard project structures
93
+
94
+ ## 🚨 Common Issues & Solutions
95
+
96
+ ### Issue: "Absolute path must be within project directory"
97
+
98
+ **Cause**: File is outside detected project boundary
99
+
100
+ **Solutions:**
101
+ 1. Use explicit project root: `--project-root /correct/path`
102
+ 2. Check project markers exist in expected location
103
+ 3. Verify file is actually within intended project
104
+
105
+ ### Issue: "No project root detected"
106
+
107
+ **Cause**: No project markers found
108
+
109
+ **Solutions:**
110
+ 1. Add a project marker file (`.git`, `pyproject.toml`, etc.)
111
+ 2. Use explicit project root: `--project-root .`
112
+ 3. Check current working directory
113
+
114
+ ### Issue: Wrong project root detected
115
+
116
+ **Cause**: Multiple nested projects or unexpected markers
117
+
118
+ **Solutions:**
119
+ 1. Use explicit project root to override
120
+ 2. Remove unwanted project markers
121
+ 3. Check marker priority (`.git` > `pyproject.toml` > `README.md`)
122
+
123
+ ## 🧪 Testing Your Configuration
124
+
125
+ ### Test Auto-Detection
126
+ ```bash
127
+ cd /your/project
128
+ python -c "
129
+ from tree_sitter_analyzer.project_detector import detect_project_root
130
+ print('Detected:', detect_project_root())
131
+ "
132
+ ```
133
+
134
+ ### Test MCP Server
135
+ ```bash
136
+ # Test with your configuration
137
+ python -m tree_sitter_analyzer.mcp.server --help
138
+ # Check logs for "MCP server starting with project root: ..."
139
+ ```
140
+
141
+ ### Test Security Boundaries
142
+ ```bash
143
+ # Should work (file within project)
144
+ tree-sitter-analyzer src/main.py --table=compact
145
+
146
+ # Should fail (file outside project)
147
+ tree-sitter-analyzer ../outside.py --table=compact
148
+ ```
149
+
150
+ ## 📖 Examples by Project Type
151
+
152
+ ### Python Project
153
+ ```
154
+ my-python-project/
155
+ ├── pyproject.toml # ← Detected as project root
156
+ ├── src/
157
+ │ └── mypackage/
158
+ │ └── main.py # ← Analyze this file
159
+ └── tests/
160
+ ```
161
+
162
+ ### JavaScript Project
163
+ ```
164
+ my-js-project/
165
+ ├── package.json # ← Detected as project root
166
+ ├── src/
167
+ │ └── index.js # ← Analyze this file
168
+ └── node_modules/
169
+ ```
170
+
171
+ ### Java Project
172
+ ```
173
+ my-java-project/
174
+ ├── pom.xml # ← Detected as project root
175
+ ├── src/
176
+ │ └── main/
177
+ │ └── java/
178
+ │ └── Main.java # ← Analyze this file
179
+ └── target/
180
+ ```
181
+
182
+ ### Git Repository
183
+ ```
184
+ any-project/
185
+ ├── .git/ # ← Detected as project root (highest priority)
186
+ ├── src/
187
+ │ └── code.ext # ← Analyze this file
188
+ └── docs/
189
+ ```
190
+
191
+ ## 🎯 Best Practices
192
+
193
+ 1. **Use environment variable for MCP**: `${workspaceFolder}` adapts automatically
194
+ 2. **Let auto-detection work**: Most projects have standard markers
195
+ 3. **Override when needed**: Use command line for special cases
196
+ 4. **Test your setup**: Verify project root detection works as expected
197
+ 5. **Keep it simple**: Start with recommended configuration, customize only if needed
198
+
199
+ ---
200
+
201
+ **Need help?** Check the full setup guides:
202
+ - [MCP Setup for Users](MCP_SETUP_USERS.md)
203
+ - [MCP Setup for Developers](MCP_SETUP_DEVELOPERS.md)
@@ -0,0 +1,125 @@
1
+ # PyPI Release Guide for tree-sitter-analyzer v0.9.1
2
+
3
+ ## 📦 Package Ready for Release
4
+
5
+ ✅ **All tests passed**: 306 tests
6
+ ✅ **Package built**: `dist/tree_sitter_analyzer-0.9.1-py3-none-any.whl`
7
+ ✅ **Source distribution**: `dist/tree_sitter_analyzer-0.9.1.tar.gz`
8
+ ✅ **Documentation updated**: README, CHANGELOG, release notes
9
+ ✅ **GitHub released**: Tagged v0.9.1 and pushed
10
+
11
+ ## 🚀 Manual PyPI Release Steps
12
+
13
+ ### Option 1: Using uv (Recommended)
14
+
15
+ 1. **Get PyPI API Token**:
16
+ - Go to https://pypi.org/account/register/ (create account if needed)
17
+ - Go to https://pypi.org/manage/account/token/
18
+ - Create a new API token with scope "Entire account"
19
+ - Copy the token (starts with `pypi-`)
20
+
21
+ 2. **Set Environment Variable**:
22
+ ```bash
23
+ # Windows
24
+ set UV_PUBLISH_TOKEN=pypi-your-token-here
25
+
26
+ # Linux/Mac
27
+ export UV_PUBLISH_TOKEN=pypi-your-token-here
28
+ ```
29
+
30
+ 3. **Upload to PyPI**:
31
+ ```bash
32
+ uv publish
33
+ ```
34
+
35
+ ### Option 2: Using twine
36
+
37
+ 1. **Install twine**:
38
+ ```bash
39
+ uv add --dev twine
40
+ ```
41
+
42
+ 2. **Upload to PyPI**:
43
+ ```bash
44
+ uv run twine upload dist/*
45
+ ```
46
+ - Enter username: `__token__`
47
+ - Enter password: `pypi-your-token-here`
48
+
49
+ ### Option 3: Test PyPI First (Recommended)
50
+
51
+ 1. **Upload to Test PyPI**:
52
+ ```bash
53
+ uv publish --publish-url https://test.pypi.org/legacy/ --token pypi-your-test-token
54
+ ```
55
+
56
+ 2. **Test Installation**:
57
+ ```bash
58
+ pip install --index-url https://test.pypi.org/simple/ tree-sitter-analyzer==0.9.1
59
+ ```
60
+
61
+ 3. **If successful, upload to production PyPI**:
62
+ ```bash
63
+ uv publish --token pypi-your-production-token
64
+ ```
65
+
66
+ ## 📋 Pre-Release Checklist
67
+
68
+ - [x] All tests pass (306/306)
69
+ - [x] Version updated in pyproject.toml (0.9.1)
70
+ - [x] Version updated in __init__.py (0.9.1)
71
+ - [x] CHANGELOG.md updated
72
+ - [x] README.md updated
73
+ - [x] Release notes created
74
+ - [x] Git tagged and pushed
75
+ - [x] Package built successfully
76
+ - [x] Package integrity verified
77
+
78
+ ## 🎯 Release Highlights
79
+
80
+ ### MCP Tools Unification
81
+ - **check_code_scale**: STEP 1 - Check file scale and complexity
82
+ - **analyze_code_structure**: STEP 2 - Generate structure tables with line positions
83
+ - **extract_code_section**: STEP 3 - Extract specific code sections
84
+
85
+ ### Key Benefits
86
+ - Clear 3-step workflow for LLMs
87
+ - Consistent snake_case parameter naming
88
+ - Enhanced error messages and guidance
89
+ - Simplified codebase (removed backward compatibility)
90
+ - 306 comprehensive tests
91
+
92
+ ## 📊 Test Results Summary
93
+
94
+ ```
95
+ MCP Tests: 103 passed ✅
96
+ Core Tests: 168 passed ✅
97
+ MCP Server Tests: 35 passed ✅
98
+ Total: 306 passed ✅
99
+ ```
100
+
101
+ ## 🔗 Post-Release Actions
102
+
103
+ After successful PyPI upload:
104
+
105
+ 1. **Verify Installation**:
106
+ ```bash
107
+ pip install tree-sitter-analyzer==0.9.1
108
+ python -c "import tree_sitter_analyzer; print(tree_sitter_analyzer.__version__)"
109
+ ```
110
+
111
+ 2. **Update Documentation**:
112
+ - Update installation instructions
113
+ - Announce on relevant channels
114
+ - Update project status
115
+
116
+ 3. **GitHub Release**:
117
+ - Create GitHub release from tag v0.9.1
118
+ - Attach release notes
119
+ - Include built packages
120
+
121
+ ## 🎉 Ready to Release!
122
+
123
+ The package is fully tested and ready for PyPI release. All 306 tests pass, documentation is complete, and the MCP tools unification provides significant improvements for LLM integration.
124
+
125
+ **This release represents a major improvement in usability for AI assistants working with large codebases!**