code-graph-rag 0.0.209__tar.gz → 0.0.245__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.
Files changed (153) hide show
  1. {code_graph_rag-0.0.209/code_graph_rag.egg-info → code_graph_rag-0.0.245}/PKG-INFO +1 -1
  2. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/README.md +4 -2
  3. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245/code_graph_rag.egg-info}/PKG-INFO +1 -1
  4. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/code_graph_rag.egg-info/SOURCES.txt +2 -0
  5. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/cli.py +24 -4
  6. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/cli_help.py +5 -0
  7. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/config.py +29 -3
  8. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/constants.py +263 -2
  9. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/cypher_queries.py +64 -5
  10. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/graph_updater.py +4 -0
  11. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/language_spec.py +27 -9
  12. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/logs.py +2 -0
  13. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/main.py +11 -7
  14. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parser_loader.py +16 -2
  15. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/call_processor.py +821 -44
  16. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/call_resolver.py +396 -15
  17. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/class_ingest/mixin.py +73 -12
  18. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/cpp/type_inference.py +41 -0
  19. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/cpp/utils.py +51 -0
  20. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/definition_processor.py +9 -4
  21. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/factory.py +1 -0
  22. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/function_ingest.py +61 -0
  23. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/go/__init__.py +3 -0
  24. code_graph_rag-0.0.245/codebase_rag/parsers/go/module_paths.py +65 -0
  25. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/go/type_inference.py +97 -0
  26. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/registry.py +1 -0
  27. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/import_processor.py +163 -78
  28. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/js_ts/ingest.py +28 -1
  29. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/js_ts/type_inference.py +4 -6
  30. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/py/ast_analyzer.py +5 -1
  31. code_graph_rag-0.0.245/codebase_rag/parsers/rs/__init__.py +3 -0
  32. code_graph_rag-0.0.245/codebase_rag/parsers/rs/type_inference.py +314 -0
  33. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/rs/utils.py +45 -0
  34. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/stdlib_extractor.py +5 -1
  35. code_graph_rag-0.0.245/codebase_rag/parsers/type_inference.py +410 -0
  36. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/utils.py +2 -2
  37. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/prompts.py +62 -4
  38. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/services/llm.py +5 -5
  39. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/types_defs.py +1 -1
  40. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/pyproject.toml +1 -1
  41. code_graph_rag-0.0.209/codebase_rag/parsers/type_inference.py +0 -229
  42. code_graph_rag-0.0.209/codec/__init__.py +0 -0
  43. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/LICENSE +0 -0
  44. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/PYPI_README.md +0 -0
  45. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/cgr/__init__.py +0 -0
  46. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/code_graph_rag.egg-info/dependency_links.txt +0 -0
  47. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/code_graph_rag.egg-info/entry_points.txt +0 -0
  48. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/code_graph_rag.egg-info/requires.txt +0 -0
  49. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/code_graph_rag.egg-info/top_level.txt +0 -0
  50. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/__init__.py +0 -0
  51. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/cgr_state.py +0 -0
  52. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/decorators.py +0 -0
  53. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/docker-compose.yaml +0 -0
  54. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/embedder.py +0 -0
  55. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/exceptions.py +0 -0
  56. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/graph_loader.py +0 -0
  57. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/mcp/__init__.py +0 -0
  58. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/mcp/client.py +0 -0
  59. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/mcp/server.py +0 -0
  60. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/mcp/tools.py +0 -0
  61. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/models.py +0 -0
  62. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/__init__.py +0 -0
  63. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/class_ingest/__init__.py +0 -0
  64. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/class_ingest/cpp_modules.py +0 -0
  65. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/class_ingest/identity.py +0 -0
  66. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/class_ingest/method_override.py +0 -0
  67. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/class_ingest/node_type.py +0 -0
  68. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/class_ingest/parent_extraction.py +0 -0
  69. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/class_ingest/relationships.py +0 -0
  70. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/class_ingest/utils.py +0 -0
  71. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/cpp/__init__.py +0 -0
  72. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/cpp_frontend/__init__.py +0 -0
  73. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/cpp_frontend/constants.py +0 -0
  74. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/cpp_frontend/frontend.py +0 -0
  75. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/cpp_frontend/qn.py +0 -0
  76. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/dependency_parser.py +0 -0
  77. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/export_detection.py +0 -0
  78. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/go/utils.py +0 -0
  79. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/__init__.py +0 -0
  80. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/base.py +0 -0
  81. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/cpp.py +0 -0
  82. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/java.py +0 -0
  83. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/js_ts.py +0 -0
  84. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/lua.py +0 -0
  85. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/php.py +0 -0
  86. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/protocol.py +0 -0
  87. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/python.py +0 -0
  88. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/handlers/rust.py +0 -0
  89. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/java/__init__.py +0 -0
  90. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/java/method_resolver.py +0 -0
  91. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/java/type_inference.py +0 -0
  92. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/java/type_resolver.py +0 -0
  93. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/java/utils.py +0 -0
  94. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/java/variable_analyzer.py +0 -0
  95. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/js_ts/__init__.py +0 -0
  96. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/js_ts/module_system.py +0 -0
  97. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/js_ts/utils.py +0 -0
  98. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/lua/__init__.py +0 -0
  99. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/lua/type_inference.py +0 -0
  100. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/lua/utils.py +0 -0
  101. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/py/__init__.py +0 -0
  102. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/py/expression_analyzer.py +0 -0
  103. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/py/type_inference.py +0 -0
  104. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/py/utils.py +0 -0
  105. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/py/variable_analyzer.py +0 -0
  106. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/python_source_roots.py +0 -0
  107. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/parsers/structure_processor.py +0 -0
  108. {code_graph_rag-0.0.209/codebase_rag/parsers/rs → code_graph_rag-0.0.245/codebase_rag/providers}/__init__.py +0 -0
  109. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/providers/base.py +0 -0
  110. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/providers/litellm.py +0 -0
  111. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/readme_sections.py +0 -0
  112. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/schema_builder.py +0 -0
  113. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/schemas.py +0 -0
  114. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/services/__init__.py +0 -0
  115. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/services/anthropic_token_counter.py +0 -0
  116. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/services/graph_service.py +0 -0
  117. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/services/protobuf_service.py +0 -0
  118. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/stack/__init__.py +0 -0
  119. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/stack/cli.py +0 -0
  120. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/stack/constants.py +0 -0
  121. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/stack/health.py +0 -0
  122. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/stack/manager.py +0 -0
  123. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tool_errors.py +0 -0
  124. {code_graph_rag-0.0.209/codebase_rag/providers → code_graph_rag-0.0.245/codebase_rag/tools}/__init__.py +0 -0
  125. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/code_retrieval.py +0 -0
  126. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/codebase_query.py +0 -0
  127. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/directory_lister.py +0 -0
  128. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/file_editor.py +0 -0
  129. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/file_reader.py +0 -0
  130. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/file_writer.py +0 -0
  131. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/health_checker.py +0 -0
  132. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/language.py +0 -0
  133. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/semantic_search.py +0 -0
  134. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/shell_command.py +0 -0
  135. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/tools/tool_descriptions.py +0 -0
  136. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/unixcoder.py +0 -0
  137. {code_graph_rag-0.0.209/codebase_rag/tools → code_graph_rag-0.0.245/codebase_rag/utils}/__init__.py +0 -0
  138. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/utils/dependencies.py +0 -0
  139. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/utils/fqn_resolver.py +0 -0
  140. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/utils/path_utils.py +0 -0
  141. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/utils/rich_markdown.py +0 -0
  142. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/utils/source_extraction.py +0 -0
  143. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/utils/token_utils.py +0 -0
  144. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/vector_store.py +0 -0
  145. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/workspaces/__init__.py +0 -0
  146. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/workspaces/cli.py +0 -0
  147. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/workspaces/constants.py +0 -0
  148. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/workspaces/models.py +0 -0
  149. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codebase_rag/workspaces/storage.py +0 -0
  150. {code_graph_rag-0.0.209/codebase_rag/utils → code_graph_rag-0.0.245/codec}/__init__.py +0 -0
  151. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codec/schema_pb2.py +0 -0
  152. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/codec/schema_pb2.pyi +0 -0
  153. {code_graph_rag-0.0.209 → code_graph_rag-0.0.245}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-graph-rag
3
- Version: 0.0.209
3
+ Version: 0.0.245
4
4
  Summary: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
5
5
  License-Expression: MIT
6
6
  Keywords: rag,retrieval-augmented-generation,knowledge-graph,code-analysis,tree-sitter,mcp,mcp-server,llm,graph-database,semantic-search,codebase,memgraph,developer-tools,monorepo
@@ -82,7 +82,8 @@ An accurate Retrieval-Augmented Generation (RAG) system that analyzes multi-lang
82
82
  | PHP | Fully Supported | .php | ✓ | ✓ | ✓ | - | Classes, interfaces, traits, enums, namespaces, PHP 8 attributes |
83
83
  | Python | Fully Supported | .py | ✓ | ✓ | ✓ | ✓ | Type inference, decorators, nested functions |
84
84
  | Rust | Fully Supported | .rs | ✓ | ✓ | ✓ | ✓ | impl blocks, associated functions |
85
- | TypeScript | Fully Supported | .ts, .tsx | ✓ | ✓ | ✓ | - | Interfaces, type aliases, enums, namespaces, ES6/CommonJS modules |
85
+ | TypeScript (TSX) | Fully Supported | .tsx | ✓ | ✓ | ✓ | - | All TypeScript features plus JSX elements and components |
86
+ | TypeScript | Fully Supported | .ts | ✓ | ✓ | ✓ | - | Interfaces, type aliases, enums, namespaces, ES6/CommonJS modules |
86
87
  | Go | In Development | .go | ✓ | ✓ | ✓ | - | Methods, type declarations |
87
88
  | Scala | In Development | .scala, .sc | ✓ | ✓ | ✓ | - | Case classes, objects |
88
89
  <!-- /SECTION:supported_languages -->
@@ -689,6 +690,7 @@ The knowledge graph uses the following node types and relationships:
689
690
  - **PHP**: `anonymous_function`, `arrow_function`, `class_declaration`, `enum_declaration`, `function_definition`, `interface_declaration`, `method_declaration`, `trait_declaration`
690
691
  - **Python**: `class_definition`, `function_definition`
691
692
  - **Rust**: `closure_expression`, `enum_item`, `function_item`, `function_signature_item`, `impl_item`, `struct_item`, `trait_item`, `type_item`, `union_item`
693
+ - **TypeScript (TSX)**: `abstract_class_declaration`, `arrow_function`, `class`, `class_declaration`, `enum_declaration`, `function_declaration`, `function_expression`, `function_signature`, `generator_function_declaration`, `interface_declaration`, `internal_module`, `method_definition`, `type_alias_declaration`
692
694
  - **TypeScript**: `abstract_class_declaration`, `arrow_function`, `class`, `class_declaration`, `enum_declaration`, `function_declaration`, `function_expression`, `function_signature`, `generator_function_declaration`, `interface_declaration`, `internal_module`, `method_definition`, `type_alias_declaration`
693
695
  - **Go**: `function_declaration`, `method_declaration`, `type_alias`, `type_spec`
694
696
  - **Scala**: `class_definition`, `function_declaration`, `function_definition`, `object_definition`, `trait_definition`
@@ -715,7 +717,7 @@ The knowledge graph uses the following node types and relationships:
715
717
  | ModuleImplementation | IMPLEMENTS | ModuleInterface |
716
718
  | Project | DEPENDS_ON_EXTERNAL | ExternalPackage |
717
719
  | Function, Method | CALLS | Function, Method |
718
- | Module, Function, Method | REFERENCES | Function, Method |
720
+ | Module, Function, Method | REFERENCES | Function, Method, Class |
719
721
  | Module, Function, Method | INSTANTIATES | Class |
720
722
  <!-- /SECTION:relationship_schemas -->
721
723
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-graph-rag
3
- Version: 0.0.209
3
+ Version: 0.0.245
4
4
  Summary: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
5
5
  License-Expression: MIT
6
6
  Keywords: rag,retrieval-augmented-generation,knowledge-graph,code-analysis,tree-sitter,mcp,mcp-server,llm,graph-database,semantic-search,codebase,memgraph,developer-tools,monorepo
@@ -70,6 +70,7 @@ codebase_rag/parsers/cpp_frontend/constants.py
70
70
  codebase_rag/parsers/cpp_frontend/frontend.py
71
71
  codebase_rag/parsers/cpp_frontend/qn.py
72
72
  codebase_rag/parsers/go/__init__.py
73
+ codebase_rag/parsers/go/module_paths.py
73
74
  codebase_rag/parsers/go/type_inference.py
74
75
  codebase_rag/parsers/go/utils.py
75
76
  codebase_rag/parsers/handlers/__init__.py
@@ -104,6 +105,7 @@ codebase_rag/parsers/py/type_inference.py
104
105
  codebase_rag/parsers/py/utils.py
105
106
  codebase_rag/parsers/py/variable_analyzer.py
106
107
  codebase_rag/parsers/rs/__init__.py
108
+ codebase_rag/parsers/rs/type_inference.py
107
109
  codebase_rag/parsers/rs/utils.py
108
110
  codebase_rag/providers/__init__.py
109
111
  codebase_rag/providers/base.py
@@ -2,6 +2,7 @@ import asyncio
2
2
  import json
3
3
  import time
4
4
  from collections.abc import Callable
5
+ from fnmatch import fnmatch
5
6
  from functools import partial
6
7
  from importlib.metadata import version as get_version
7
8
  from pathlib import Path
@@ -16,7 +17,7 @@ from . import cgr_state
16
17
  from . import cli_help as ch
17
18
  from . import constants as cs
18
19
  from . import logs as ls
19
- from .config import load_cgrignore_patterns, settings
20
+ from .config import load_ignore_patterns, settings
20
21
  from .graph_updater import GraphUpdater
21
22
  from .main import (
22
23
  _create_configuration_table,
@@ -192,7 +193,7 @@ def _run_graph_sync(
192
193
  clean: bool = False,
193
194
  output: str | None = None,
194
195
  ) -> None:
195
- cgrignore = load_cgrignore_patterns(repo)
196
+ cgrignore = load_ignore_patterns(repo)
196
197
  cli_excludes = frozenset(exclude) if exclude else frozenset()
197
198
  exclude_paths = cli_excludes | cgrignore.exclude or None
198
199
  unignore_paths: frozenset[str] | None
@@ -535,7 +536,7 @@ def index(
535
536
 
536
537
  _info(style(cs.CLI_MSG_OUTPUT_TO.format(path=output_proto_dir), cs.Color.CYAN))
537
538
 
538
- cgrignore = load_cgrignore_patterns(repo_to_index)
539
+ cgrignore = load_ignore_patterns(repo_to_index)
539
540
  cli_excludes = frozenset(exclude) if exclude else frozenset()
540
541
  exclude_paths = cli_excludes | cgrignore.exclude or None
541
542
  unignore_paths: frozenset[str] | None = None
@@ -941,6 +942,22 @@ def _dead_code_params(
941
942
  }
942
943
 
943
944
 
945
+ def _filter_excluded_rows(rows: list[ResultRow], exclude: list[str]) -> list[ResultRow]:
946
+ # (H) Drop candidates whose file path matches an exclude glob (generated dirs
947
+ # (H) like client/core or *.gen.* have no in-repo caller, so every symbol
948
+ # (H) reports as dead). fnmatch treats '*' as spanning '/', so '*client/core*'
949
+ # (H) matches at any depth.
950
+ if not exclude:
951
+ return rows
952
+ return [
953
+ row
954
+ for row in rows
955
+ if not any(
956
+ fnmatch(str(row.get(cs.KEY_PATH) or ""), pattern) for pattern in exclude
957
+ )
958
+ ]
959
+
960
+
944
961
  def _to_dead_code_row(row: ResultRow) -> DeadCodeRow:
945
962
  start = row.get(cs.KEY_START_LINE, 0)
946
963
  end = row.get(cs.KEY_END_LINE, 0)
@@ -1028,6 +1045,7 @@ def dead_code(
1028
1045
  decorator_root: list[str] = typer.Option(
1029
1046
  [], "--decorator-root", help=ch.HELP_DEADCODE_DECORATOR_ROOT
1030
1047
  ),
1048
+ exclude: list[str] = typer.Option([], "--exclude", help=ch.HELP_DEADCODE_EXCLUDE),
1031
1049
  include_tests: bool = typer.Option(
1032
1050
  True,
1033
1051
  "--include-tests/--no-include-tests",
@@ -1083,7 +1101,9 @@ def dead_code(
1083
1101
  app_context.console.print(style(message, cs.Color.RED))
1084
1102
  raise typer.Exit(1)
1085
1103
 
1086
- candidates = [_to_dead_code_row(row) for row in rows]
1104
+ candidates = [
1105
+ _to_dead_code_row(row) for row in _filter_excluded_rows(rows, exclude)
1106
+ ]
1087
1107
  _emit_dead_code(candidates, output_format, output, resolved)
1088
1108
 
1089
1109
  if fail_on_found and candidates:
@@ -191,6 +191,11 @@ HELP_DEADCODE_DECORATOR_ROOT = (
191
191
  "Treat functions/methods carrying this decorator as reachable roots. "
192
192
  "Extends the built-in set (route, task, fixture, command, ...). Repeatable."
193
193
  )
194
+ HELP_DEADCODE_EXCLUDE = (
195
+ "Glob matched against a symbol's file path to exclude from the report "
196
+ "(e.g. '*client/core*', '*.gen.*' for generated code). '*' spans '/'. "
197
+ "Repeatable."
198
+ )
194
199
  HELP_DEADCODE_INCLUDE_TESTS = (
195
200
  "Treat test code as reachable roots so production code it exercises is "
196
201
  "not reported. On by default."
@@ -360,13 +360,13 @@ class AppConfig(BaseSettings):
360
360
  settings = AppConfig()
361
361
 
362
362
  CGRIGNORE_FILENAME = ".cgrignore"
363
+ GITIGNORE_FILENAME = ".gitignore"
363
364
 
364
365
 
365
366
  EMPTY_CGRIGNORE = CgrignorePatterns(exclude=frozenset(), unignore=frozenset())
366
367
 
367
368
 
368
- def load_cgrignore_patterns(repo_path: Path) -> CgrignorePatterns:
369
- ignore_file = repo_path / CGRIGNORE_FILENAME
369
+ def _load_ignore_file(ignore_file: Path) -> CgrignorePatterns:
370
370
  if not ignore_file.is_file():
371
371
  return EMPTY_CGRIGNORE
372
372
 
@@ -394,11 +394,37 @@ def load_cgrignore_patterns(repo_path: Path) -> CgrignorePatterns:
394
394
  exclude=frozenset(exclude),
395
395
  unignore=frozenset(unignore),
396
396
  )
397
- except OSError as e:
397
+ except (OSError, ValueError) as e:
398
398
  logger.warning(logs.CGRIGNORE_READ_FAILED.format(path=ignore_file, error=e))
399
399
  return EMPTY_CGRIGNORE
400
400
 
401
401
 
402
+ def load_cgrignore_patterns(repo_path: Path) -> CgrignorePatterns:
403
+ return _load_ignore_file(repo_path / CGRIGNORE_FILENAME)
404
+
405
+
406
+ def load_ignore_patterns(repo_path: Path) -> CgrignorePatterns:
407
+ # (H) Merged exclude/unignore set for indexing: root .gitignore (gitignored
408
+ # (H) paths are build artifacts / generated output whose symbols pollute the
409
+ # (H) graph and the dead-code report) plus .cgrignore, which stays the
410
+ # (H) authoritative cgr-specific channel. The runtime skip check gives
411
+ # (H) excludes precedence over unignores, so a negation can only override a
412
+ # (H) .gitignore exclude by CANCELLING the exact same pattern string here at
413
+ # (H) load time (`!generated/` drops `generated/`). .cgrignore excludes are
414
+ # (H) never cancelled by .gitignore negations.
415
+ # (H) ponytail: root .gitignore only, exact-string cancellation only; a
416
+ # (H) finer-grained negation (`!dist/keep.py` under excluded `dist/`) still
417
+ # (H) cannot rescue -- an ordered PathSpec soft layer in should_skip_path is
418
+ # (H) the upgrade path if real repos need it.
419
+ cgr = _load_ignore_file(repo_path / CGRIGNORE_FILENAME)
420
+ git = _load_ignore_file(repo_path / GITIGNORE_FILENAME)
421
+ negations = cgr.unignore | git.unignore
422
+ return CgrignorePatterns(
423
+ exclude=cgr.exclude | (git.exclude - negations),
424
+ unignore=negations,
425
+ )
426
+
427
+
402
428
  CGR_INSTRUCTIONS_FILENAME = ".cgr.md"
403
429
  GLOBAL_CGR_INSTRUCTIONS_PATH = Path.home() / CGR_INSTRUCTIONS_FILENAME
404
430
 
@@ -101,7 +101,8 @@ EXT_LUA = ".lua"
101
101
  # (H) File extension tuples by language
102
102
  PY_EXTENSIONS = (EXT_PY,)
103
103
  JS_EXTENSIONS = (EXT_JS, EXT_JSX)
104
- TS_EXTENSIONS = (EXT_TS, EXT_TSX)
104
+ TS_EXTENSIONS = (EXT_TS,)
105
+ TSX_EXTENSIONS = (EXT_TSX,)
105
106
  RS_EXTENSIONS = (EXT_RS,)
106
107
  GO_EXTENSIONS = (EXT_GO,)
107
108
  SCALA_EXTENSIONS = (EXT_SCALA, EXT_SC)
@@ -122,6 +123,13 @@ CPP_EXTENSIONS = (
122
123
  PHP_EXTENSIONS = (EXT_PHP,)
123
124
  LUA_EXTENSIONS = (EXT_LUA,)
124
125
 
126
+ # (H) A C++ operator overload / user-defined literal is defined with the reserved
127
+ # (H) `operator` keyword heading the name (`operator==`, `operator[]`, `operator""_json`).
128
+ # (H) It is invoked by operator/literal syntax, not a named call, so it is a dead-code
129
+ # (H) reachability root; the keyword can only head such definitions, so this prefix on a
130
+ # (H) C++ file uniquely identifies them (member or free function).
131
+ CPP_OPERATOR_PREFIX = "operator"
132
+
125
133
  # (H) Package indicator files
126
134
  PKG_INIT_PY = "__init__.py"
127
135
  PKG_CARGO_TOML = "Cargo.toml"
@@ -414,6 +422,12 @@ TSCONFIG_FILENAMES: tuple[str, ...] = (
414
422
  "tsconfig.base.json",
415
423
  "jsconfig.json",
416
424
  )
425
+ # (H) When searching subdirectories for tsconfig files (monorepo `frontend/`,
426
+ # (H) `packages/*`), skip dependency/build/VCS trees: their tsconfigs carry
427
+ # (H) unrelated aliases and there can be thousands of them under node_modules.
428
+ TS_ALIAS_SKIP_DIRS: frozenset[str] = frozenset(
429
+ {"node_modules", "dist", "build", "out", ".git"}
430
+ )
417
431
  JS_INDEX_STEM = "index"
418
432
  TS_COMPILER_OPTIONS_KEY = "compilerOptions"
419
433
  TS_PATHS_KEY = "paths"
@@ -472,10 +486,85 @@ DEFAULT_ROOT_DECORATORS: frozenset[str] = frozenset(
472
486
  "root_validator",
473
487
  "field_serializer",
474
488
  "model_serializer",
489
+ "computed_field",
475
490
  "abstractmethod",
476
491
  }
477
492
  )
478
493
 
494
+ # (H) Go functions the runtime invokes with no explicit call site: `func init()`
495
+ # (H) runs at package load (any number per package), `func main()` is the program
496
+ # (H) entry. Both are reachability roots (like Python dunders), gated by the .go
497
+ # (H) extension so same-named symbols in other languages are unaffected.
498
+ GO_ROOT_FUNCTION_NAMES: frozenset[str] = frozenset({"init", "main"})
499
+
500
+ # (H) Rust `fn main()` is the binary entry point, invoked by the runtime with no
501
+ # (H) call site -- a reachability root (gated by .rs).
502
+ RUST_ROOT_FUNCTION_NAMES: frozenset[str] = frozenset({"main"})
503
+
504
+ # (H) Rust trait-impl methods the language/std dispatches implicitly (Display::fmt
505
+ # (H) via format!, PartialEq::eq via ==, Iterator::next via for, operator traits,
506
+ # (H) Drop::drop, serde, ...), never through an explicit call the graph can see.
507
+ # (H) Rooting them by name (gated by .rs) mirrors the Python-dunder exemption: these
508
+ # (H) names are conventionally reserved for trait impls, so a same-named user method
509
+ # (H) that is genuinely dead is under-reported rather than mis-reported.
510
+ RUST_TRAIT_METHOD_NAMES: frozenset[str] = frozenset(
511
+ {
512
+ "fmt",
513
+ "eq",
514
+ "ne",
515
+ "cmp",
516
+ "partial_cmp",
517
+ "hash",
518
+ "next",
519
+ "next_back",
520
+ "into_iter",
521
+ "size_hint",
522
+ "drop",
523
+ "clone",
524
+ "clone_from",
525
+ "default",
526
+ "from",
527
+ "from_str",
528
+ "try_from",
529
+ "into",
530
+ "try_into",
531
+ "deref",
532
+ "deref_mut",
533
+ "as_ref",
534
+ "as_mut",
535
+ "borrow",
536
+ "borrow_mut",
537
+ "poll",
538
+ "serialize",
539
+ "deserialize",
540
+ "source",
541
+ "add",
542
+ "add_assign",
543
+ "sub",
544
+ "sub_assign",
545
+ "mul",
546
+ "mul_assign",
547
+ "div",
548
+ "div_assign",
549
+ "rem",
550
+ "rem_assign",
551
+ "neg",
552
+ "not",
553
+ "bitand",
554
+ "bitand_assign",
555
+ "bitor",
556
+ "bitor_assign",
557
+ "bitxor",
558
+ "bitxor_assign",
559
+ "shl",
560
+ "shl_assign",
561
+ "shr",
562
+ "shr_assign",
563
+ "index",
564
+ "index_mut",
565
+ }
566
+ )
567
+
479
568
  # (H) Base classes that mark a class as a structural interface: its method stubs
480
569
  # (H) are never call targets themselves (callers resolve to the implementations),
481
570
  # (H) so dead-code analysis roots every method the class defines.
@@ -623,6 +712,7 @@ class SupportedLanguage(StrEnum):
623
712
  PYTHON = "python"
624
713
  JS = "javascript"
625
714
  TS = "typescript"
715
+ TSX = "tsx"
626
716
  RUST = "rust"
627
717
  GO = "go"
628
718
  SCALA = "scala"
@@ -660,6 +750,11 @@ LANGUAGE_METADATA: dict[SupportedLanguage, LanguageMetadata] = {
660
750
  "Interfaces, type aliases, enums, namespaces, ES6/CommonJS modules",
661
751
  "TypeScript",
662
752
  ),
753
+ SupportedLanguage.TSX: LanguageMetadata(
754
+ LanguageStatus.FULL,
755
+ "All TypeScript features plus JSX elements and components",
756
+ "TypeScript (TSX)",
757
+ ),
663
758
  SupportedLanguage.C: LanguageMetadata(
664
759
  LanguageStatus.FULL,
665
760
  "Functions, structs, unions, enums, preprocessor includes",
@@ -754,7 +849,9 @@ JS_TS_FUNCTION_NODES = (
754
849
  )
755
850
  JS_TS_CLASS_NODES = ("class_declaration", "class")
756
851
  JS_TS_IMPORT_NODES = ("import_statement", "lexical_declaration", "export_statement")
757
- JS_TS_LANGUAGES = frozenset({SupportedLanguage.JS, SupportedLanguage.TS})
852
+ JS_TS_LANGUAGES = frozenset(
853
+ {SupportedLanguage.JS, SupportedLanguage.TS, SupportedLanguage.TSX}
854
+ )
758
855
 
759
856
  # (H) C++ import node types
760
857
  CPP_IMPORT_NODES = ("preproc_include", "template_function", "declaration")
@@ -781,6 +878,8 @@ FIELD_DECLARATOR = "declarator"
781
878
  FIELD_PARAMETERS = "parameters"
782
879
  FIELD_RECEIVER = "receiver"
783
880
  FIELD_TYPE = "type"
881
+ # (H) The wrapped function/class inside a Python decorated_definition node.
882
+ FIELD_DEFINITION = "definition"
784
883
  FIELD_RESULT = "result"
785
884
  # (H) Rust impl `trait`/`type` fields and a trait's supertrait `bounds`.
786
885
  FIELD_TRAIT = "trait"
@@ -790,6 +889,7 @@ FIELD_VALUE = "value"
790
889
  FIELD_LEFT = "left"
791
890
  FIELD_RIGHT = "right"
792
891
  FIELD_FIELD = "field"
892
+ FIELD_SCOPE = "scope"
793
893
  FIELD_SUPERCLASS = "superclass"
794
894
  FIELD_SUPERCLASSES = "superclasses"
795
895
  FIELD_INTERFACES = "interfaces"
@@ -1008,6 +1108,7 @@ BUILD_EXT_CMD = "build_ext"
1008
1108
  INPLACE_FLAG = "--inplace"
1009
1109
  LANG_ATTR_PREFIX = "language_"
1010
1110
  LANG_ATTR_TYPESCRIPT = "language_typescript"
1111
+ LANG_ATTR_TSX = "language_tsx"
1011
1112
  LANG_ATTR_PHP = "language_php"
1012
1113
 
1013
1114
 
@@ -1655,6 +1756,13 @@ JS_FUNCTION_PROTOTYPE_SUFFIXES: dict[str, str] = {
1655
1756
  JS_SUFFIX_CALL: JS_METHOD_CALL,
1656
1757
  JS_SUFFIX_APPLY: JS_METHOD_APPLY,
1657
1758
  }
1759
+ # (H) `fn.bind(ctx)` / `fn.call(...)` / `fn.apply(...)` all use `fn`; when such a
1760
+ # (H) call sits in a value position (`onError: handleError.bind(toast)`) the `.bind`
1761
+ # (H) resolves to the Function.prototype builtin, so `fn` itself must be referenced
1762
+ # (H) separately or it reports as dead.
1763
+ JS_FUNCTION_PROTOTYPE_METHODS = frozenset(
1764
+ {JS_METHOD_BIND, JS_METHOD_CALL, JS_METHOD_APPLY}
1765
+ )
1658
1766
 
1659
1767
  # (H) C++ operator mappings
1660
1768
  CPP_OPERATORS: dict[str, str] = {
@@ -2003,6 +2111,11 @@ DEP_FILE_REQUIREMENTS = "requirements.txt"
2003
2111
  DEP_FILE_PACKAGE_JSON = "package.json"
2004
2112
  DEP_FILE_CARGO = "cargo.toml"
2005
2113
  DEP_FILE_GOMOD = "go.mod"
2114
+ # (H) The go.mod directive naming the module path that prefixes every import of
2115
+ # (H) the module's packages; a same-line comment (incl. the official
2116
+ # (H) `// Deprecated:` form) may trail it.
2117
+ GO_KEYWORD_MODULE = "module"
2118
+ GO_MOD_COMMENT_PREFIX = "//"
2006
2119
  DEP_FILE_GEMFILE = "gemfile"
2007
2120
  DEP_FILE_COMPOSER = "composer.json"
2008
2121
 
@@ -2126,6 +2239,10 @@ TS_GO_TYPE_DECLARATION = "type_declaration"
2126
2239
  TS_GO_TYPE_SPEC = "type_spec"
2127
2240
  TS_GO_TYPE_ALIAS = "type_alias"
2128
2241
  TS_GO_STRUCT_TYPE = "struct_type"
2242
+ TS_GO_SELECTOR_EXPRESSION = "selector_expression"
2243
+ TS_GO_FIELD_DECLARATION_LIST = "field_declaration_list"
2244
+ TS_GO_FIELD_DECLARATION = "field_declaration"
2245
+ TS_GO_FIELD_IDENTIFIER = "field_identifier"
2129
2246
  TS_GO_INTERFACE_TYPE = "interface_type"
2130
2247
  TS_GO_PARAMETER_DECLARATION = "parameter_declaration"
2131
2248
  TS_GO_FUNC_LITERAL = "func_literal"
@@ -2138,8 +2255,12 @@ TS_GO_PARAMETER_LIST = "parameter_list"
2138
2255
  TS_GO_VAR_DECLARATION = "var_declaration"
2139
2256
  TS_GO_VAR_SPEC = "var_spec"
2140
2257
  TS_GO_SHORT_VAR_DECLARATION = "short_var_declaration"
2258
+ TS_GO_ASSIGNMENT_STATEMENT = "assignment_statement"
2141
2259
  TS_GO_EXPRESSION_LIST = "expression_list"
2142
2260
  TS_GO_COMPOSITE_LITERAL = "composite_literal"
2261
+ TS_GO_LITERAL_VALUE = "literal_value"
2262
+ TS_GO_KEYED_ELEMENT = "keyed_element"
2263
+ TS_GO_LITERAL_ELEMENT = "literal_element"
2143
2264
  TS_GO_UNARY_EXPRESSION = "unary_expression"
2144
2265
  TS_GO_POINTER_TYPE = "pointer_type"
2145
2266
  # (H) Go composite types a method may return; a chained call lands on the CONTAINER,
@@ -2214,6 +2335,18 @@ TS_CPP_FUNCTION_DEFINITION = "function_definition"
2214
2335
  TS_CPP_DECLARATION = "declaration"
2215
2336
  TS_CPP_FIELD_DECLARATION = "field_declaration"
2216
2337
  TS_CPP_TEMPLATE_DECLARATION = "template_declaration"
2338
+ TS_CPP_TEMPLATE_PARAMETER_LIST = "template_parameter_list"
2339
+ # (H) The template TYPE-parameter declaration node types. A value/non-type param
2340
+ # (H) (`parameter_declaration`, e.g. `int N` / `MyEnum E`) and a template-template param
2341
+ # (H) are deliberately excluded: their type name is a concrete type, not a stand-in that
2342
+ # (H) a call receiver could be instantiated as, so it must not enter the template-param set.
2343
+ CPP_TYPE_PARAMETER_DECL_TYPES = frozenset(
2344
+ {
2345
+ "type_parameter_declaration",
2346
+ "optional_type_parameter_declaration",
2347
+ "variadic_type_parameter_declaration",
2348
+ }
2349
+ )
2217
2350
  TS_CPP_LAMBDA_EXPRESSION = "lambda_expression"
2218
2351
  TS_CPP_TRANSLATION_UNIT = "translation_unit"
2219
2352
  TS_CPP_LINKAGE_SPECIFICATION = "linkage_specification"
@@ -2275,6 +2408,15 @@ CPP_NESTED_SCOPE_NODE_TYPES = frozenset(
2275
2408
  )
2276
2409
  )
2277
2410
  JS_TS_PARENT_REF_TYPES = (TS_IDENTIFIER, TS_MEMBER_EXPRESSION)
2411
+ # (H) JSX element nodes that carry a component name (javascript and tsx
2412
+ # (H) grammars share these); the closing element repeats the name and must not
2413
+ # (H) double-emit.
2414
+ TS_JSX_SELF_CLOSING_ELEMENT = "jsx_self_closing_element"
2415
+ TS_JSX_OPENING_ELEMENT = "jsx_opening_element"
2416
+ # (H) The `{...}` wrapper around an expression in a JSX attribute value or child
2417
+ # (H) (`onClick={handleLogout}`, `onClick={() => x()}`); its inner expression can
2418
+ # (H) hand a function to the element as a prop.
2419
+ TS_JSX_EXPRESSION = "jsx_expression"
2278
2420
 
2279
2421
  # (H) Import processor function names
2280
2422
  IMPORT_REQUIRE = "require"
@@ -2422,6 +2564,16 @@ TS_SPREAD_PARAMETER = "spread_parameter"
2422
2564
  TS_LOCAL_VARIABLE_DECLARATION = "local_variable_declaration"
2423
2565
  TS_FIELD_DECLARATION = "field_declaration"
2424
2566
  TS_ASSIGNMENT_EXPRESSION = "assignment_expression"
2567
+ # (H) TS "cast" wrappers that are transparent for reference resolution: `x as T`,
2568
+ # (H) `x satisfies T`, and the non-null assertion `x!`. Their first named child is
2569
+ # (H) the wrapped value, so unwrapping reaches the real referenced expression
2570
+ # (H) (`export const persist = persistImpl as unknown as Persist`).
2571
+ TS_AS_EXPRESSION = "as_expression"
2572
+ TS_SATISFIES_EXPRESSION = "satisfies_expression"
2573
+ TS_NON_NULL_EXPRESSION = "non_null_expression"
2574
+ TS_CAST_WRAPPER_TYPES = frozenset(
2575
+ {TS_AS_EXPRESSION, TS_SATISFIES_EXPRESSION, TS_NON_NULL_EXPRESSION}
2576
+ )
2425
2577
  TS_OBJECT_CREATION_EXPRESSION = "object_creation_expression"
2426
2578
  TS_METHOD_INVOCATION = "method_invocation"
2427
2579
  TS_FIELD_ACCESS = "field_access"
@@ -2732,6 +2884,13 @@ GUARD_INHERITED_METHOD = "_inherited_method_guard"
2732
2884
  TS_PAIR = "pair"
2733
2885
  TS_OBJECT = "object"
2734
2886
  TS_ARRAY = "array"
2887
+
2888
+ # (H) When a variable_declarator's value is one of these, the variable binds the
2889
+ # (H) call/construction RESULT, not a function -- so an arrow found inside its
2890
+ # (H) arguments (`const m = useMutation({fn: () => {}})`) must not inherit the
2891
+ # (H) variable's name. Object-literal / arrow values are not here, so arrows nested
2892
+ # (H) directly under an object bound to a const still take the object's name.
2893
+ JS_CALL_RESULT_VALUE_TYPES = frozenset({TS_CALL_EXPRESSION, TS_NEW_EXPRESSION})
2735
2894
  TS_FUNCTION_EXPRESSION = "function_expression"
2736
2895
  TS_ARROW_FUNCTION = "arrow_function"
2737
2896
  TS_REQUIRED_PARAMETER = "required_parameter"
@@ -2928,6 +3087,89 @@ TS_RS_MACRO_INVOCATION = "macro_invocation"
2928
3087
  TS_RS_ATTRIBUTE_ITEM = "attribute_item"
2929
3088
  TS_RS_INNER_ATTRIBUTE_ITEM = "inner_attribute_item"
2930
3089
 
3090
+ # (H) Rust node types for local-variable type inference (receiver-dispatch)
3091
+ TS_RS_LET_DECLARATION = "let_declaration"
3092
+ TS_RS_PARAMETER = "parameter"
3093
+ TS_RS_SELF_PARAMETER = "self_parameter"
3094
+ TS_RS_STRUCT_EXPRESSION = "struct_expression"
3095
+ TS_RS_FIELD_DECLARATION_LIST = "field_declaration_list"
3096
+ TS_RS_FIELD_DECLARATION = "field_declaration"
3097
+ TS_RS_FIELD_IDENTIFIER = "field_identifier"
3098
+ TS_RS_MATCH_EXPRESSION = "match_expression"
3099
+ TS_RS_MATCH_ARM = "match_arm"
3100
+ # (H) A Rust call node whose callee is descended for chain flattening: a plain call
3101
+ # (H) or a turbofish generic_function (`f::<T>()`).
3102
+ RS_CALL_OR_GENERIC_FN = (TS_RS_CALL_EXPRESSION, TS_GENERIC_FUNCTION)
3103
+ TS_RS_TUPLE_STRUCT_PATTERN = "tuple_struct_pattern"
3104
+ TS_RS_TYPE_ARGUMENTS = "type_arguments"
3105
+ TS_RS_TRY_EXPRESSION = "try_expression"
3106
+ TS_RS_FIELD_EXPRESSION = "field_expression"
3107
+ TS_RS_FIELD_PATH = "path"
3108
+ TS_RS_TOKEN_DOT = "."
3109
+ # (H) Nodes that can be a receiver token preceding `.method` in a macro token
3110
+ # (H) stream: a plain identifier or the `self` keyword.
3111
+ # (H) A receiver/chain base that is a plain identifier or the `self` keyword (used
3112
+ # (H) both for macro-token receiver reconstruction and value-chain base flattening).
3113
+ RS_IDENT_OR_SELF = (TS_IDENTIFIER, KEYWORD_SELF)
3114
+ RS_MACRO_RECEIVER_TYPES = RS_IDENT_OR_SELF
3115
+ # (H) Rust `Self` return type resolves to the enclosing impl target.
3116
+ RS_SELF_TYPE = "Self"
3117
+ # (H) Transparent smart pointers that auto-deref (Rust deref coercion) to their
3118
+ # (H) inner type: a method call on the pointer dispatches to the inner type's method,
3119
+ # (H) so strip them from any type name (receiver OR return) to reach the real type.
3120
+ RS_DEREF_WRAPPERS = frozenset({"Arc", "Rc", "Box", "Pin"})
3121
+ # (H) Guard containers that do NOT deref-coerce: the inner value is only reachable
3122
+ # (H) through a lock/borrow guard accessor. Stripped to the inner type ONLY in field
3123
+ # (H) extraction (where the field is virtually always accessed via a lock chain, e.g.
3124
+ # (H) `self.shared.state.lock().unwrap()`); a bare local/param/return of a guard type
3125
+ # (H) is preserved so a direct wrapper-method call (`m.is_poisoned()`) is not
3126
+ # (H) mis-resolved to an inner-type method.
3127
+ RS_GUARD_WRAPPERS = frozenset({"Mutex", "RwLock", "RefCell", "Cell"})
3128
+ # (H) Result<T>/Option<T>: stripped to their inner T only for a RETURN type (the
3129
+ # (H) value a `?`/`.unwrap()` yields). NOT stripped for a receiver type, where a
3130
+ # (H) method call `opt.map(..)` dispatches to Option itself.
3131
+ RS_RESULT_WRAPPERS = frozenset({"Result", "Option"})
3132
+ # (H) Full strip set for return types (deref pointers + Result/Option unwrap).
3133
+ RS_RETURN_STRIP_WRAPPERS = RS_DEREF_WRAPPERS | RS_RESULT_WRAPPERS
3134
+ TS_RS_REFERENCE_TYPE = "reference_type"
3135
+ TS_RS_POINTER_TYPE = "pointer_type"
3136
+ # (H) Node types that can stand for a Rust return/field type. Reference/pointer
3137
+ # (H) wrappers (`&Frame`, `*const T`) are included so a generic inner argument
3138
+ # (H) (`Result<&Frame>`) and a bare `-> &Frame` return descend to the referent.
3139
+ RS_RETURN_TYPE_NODE_TYPES = (
3140
+ TS_TYPE_IDENTIFIER,
3141
+ TS_RS_PRIMITIVE_TYPE,
3142
+ TS_GENERIC_TYPE,
3143
+ TS_RS_SCOPED_TYPE_IDENTIFIER,
3144
+ TS_RS_REFERENCE_TYPE,
3145
+ TS_RS_POINTER_TYPE,
3146
+ )
3147
+ # (H) Wrapper-passthrough methods: they return the receiver's own (inner) type, so
3148
+ # (H) a call-bound local keeps its type across them (`Type::mk().unwrap().m()`).
3149
+ RS_IDENTITY_METHODS = frozenset(
3150
+ {
3151
+ "unwrap",
3152
+ "expect",
3153
+ "clone",
3154
+ "unwrap_or_default",
3155
+ "to_owned",
3156
+ "borrow",
3157
+ "borrow_mut",
3158
+ "as_ref",
3159
+ "as_mut",
3160
+ "as_deref",
3161
+ "as_deref_mut",
3162
+ }
3163
+ )
3164
+ # (H) Guard accessors: called on a guard container (Mutex/RwLock/RefCell) to obtain a
3165
+ # (H) guard that derefs to the inner type. In a receiver chain, one of these
3166
+ # (H) immediately after a guard-wrapped field unwraps the wrapper to its inner type
3167
+ # (H) (recorded in class_field_guard_inner) -- the only sound unwrap point, since
3168
+ # (H) guard containers do not deref-coerce.
3169
+ RS_GUARD_ACCESSORS = frozenset(
3170
+ {"lock", "read", "write", "try_lock", "borrow", "borrow_mut"}
3171
+ )
3172
+
2931
3173
  # (H) Rust identifier tuples
2932
3174
  RS_IDENTIFIER_TYPES = (TS_IDENTIFIER, TS_TYPE_IDENTIFIER)
2933
3175
  RS_SCOPED_TYPES = (TS_SCOPED_IDENTIFIER, TS_RS_SCOPED_TYPE_IDENTIFIER)
@@ -3096,6 +3338,25 @@ FQN_TS_FUNCTION_TYPES = (
3096
3338
  TS_FUNCTION_SIGNATURE,
3097
3339
  )
3098
3340
 
3341
+ # (H) When climbing a nameless arrow's ancestors to find its binding declarator,
3342
+ # (H) crossing one of these means the arrow lives INSIDE another function's body
3343
+ # (H) (a JSX event handler, a `.map()` callback), not directly bound to the outer
3344
+ # (H) const -- so it must not inherit that const's name. Without this stop the inner
3345
+ # (H) arrow becomes `Component.Component`/`utils.getInitials.getInitials`, a
3346
+ # (H) double-segment phantom with no incoming edge (dead-code false positive) that
3347
+ # (H) also steals the enclosing scope from the real inline handler nodes.
3348
+ JS_ARROW_NAME_CLIMB_BOUNDARY = frozenset(
3349
+ {
3350
+ TS_STATEMENT_BLOCK,
3351
+ TS_ARROW_FUNCTION,
3352
+ TS_FUNCTION_DECLARATION,
3353
+ TS_FUNCTION_EXPRESSION,
3354
+ TS_METHOD_DEFINITION,
3355
+ TS_GENERATOR_FUNCTION_DECLARATION,
3356
+ TS_CLASS_BODY,
3357
+ }
3358
+ )
3359
+
3099
3360
  # (H) FQN node type tuples for Rust
3100
3361
  FQN_RS_SCOPE_TYPES = (
3101
3362
  TS_RS_STRUCT_ITEM,