codegraphcontext 0.5.4__tar.gz → 0.5.6__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 (189) hide show
  1. {codegraphcontext-0.5.4/src/codegraphcontext.egg-info → codegraphcontext-0.5.6}/PKG-INFO +1 -1
  2. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/pyproject.toml +1 -1
  3. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/advanced_language_query_tool.py +6 -4
  4. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/code_finder.py +1 -1
  5. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/scip_pipeline.py +31 -0
  6. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/go.py +23 -1
  7. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/php.py +80 -30
  8. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/python.py +14 -3
  9. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +1 -1
  10. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +15 -6
  11. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/gcf_encoder.py +7 -1
  12. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/path_sandbox.py +6 -5
  13. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/visualize_graph.py +23 -3
  14. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/server.py +51 -19
  15. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6/src/codegraphcontext.egg-info}/PKG-INFO +1 -1
  16. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/LICENSE +0 -0
  17. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/MANIFEST.in +0 -0
  18. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/README.md +0 -0
  19. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/setup.cfg +0 -0
  20. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/__init__.py +0 -0
  21. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/__main__.py +0 -0
  22. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/api/__init__.py +0 -0
  23. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/api/app.py +0 -0
  24. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/api/auth.py +0 -0
  25. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/api/mcp_sse.py +0 -0
  26. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/api/router.py +0 -0
  27. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/api/schemas.py +0 -0
  28. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/__init__.py +0 -0
  29. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/cli_helpers.py +0 -0
  30. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/config_manager.py +0 -0
  31. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/hook_manager.py +0 -0
  32. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/main.py +0 -0
  33. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/project_config.py +0 -0
  34. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/registry_commands.py +0 -0
  35. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/setup_macos.py +0 -0
  36. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/setup_wizard.py +0 -0
  37. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/simulator.py +0 -0
  38. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/cli/visualizer.py +0 -0
  39. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/__init__.py +0 -0
  40. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/bundle_registry.py +0 -0
  41. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/cgc_bundle.py +0 -0
  42. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/cgcignore.py +0 -0
  43. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/database.py +0 -0
  44. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/database_embedded_kuzu.py +0 -0
  45. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/database_falkordb.py +0 -0
  46. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
  47. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/database_kuzu.py +0 -0
  48. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/database_ladybug.py +0 -0
  49. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/database_nornic.py +0 -0
  50. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/falkor_worker.py +0 -0
  51. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/graph_query.py +0 -0
  52. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/jobs.py +0 -0
  53. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/simulator.py +0 -0
  54. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/core/watcher.py +0 -0
  55. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/prompts.py +0 -0
  56. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/server.py +0 -0
  57. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/stdlibs.py +0 -0
  58. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tool_definitions.py +0 -0
  59. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/__init__.py +0 -0
  60. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/datasources/__init__.py +0 -0
  61. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/datasources/cassandra_ingester.py +0 -0
  62. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/datasources/mysql_ingester.py +0 -0
  63. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/datasources/redis_ingester.py +0 -0
  64. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/graph_builder.py +0 -0
  65. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/handlers/analysis_handlers.py +0 -0
  66. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
  67. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
  68. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
  69. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
  70. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
  71. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/constants.py +0 -0
  72. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
  73. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/embeddings.py +0 -0
  74. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
  75. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/persistence/utils.py +0 -0
  76. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/persistence/writer.py +0 -0
  77. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/pipeline.py +0 -0
  78. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
  79. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
  80. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/resolution/calls.py +0 -0
  81. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +0 -0
  82. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/resolution/post_resolution.py +0 -0
  83. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
  84. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/schema.py +0 -0
  85. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/schema_contract.py +0 -0
  86. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/indexing/vector_resolver.py +0 -0
  87. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/c.py +0 -0
  88. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/cpp.py +0 -0
  89. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/csharp.py +0 -0
  90. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/css.py +0 -0
  91. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/dart.py +0 -0
  92. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/elisp.py +0 -0
  93. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/elixir.py +0 -0
  94. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/gradle.py +0 -0
  95. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/haskell.py +0 -0
  96. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/html.py +0 -0
  97. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/java.py +0 -0
  98. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/javascript.py +0 -0
  99. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
  100. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/lua.py +0 -0
  101. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/maven.py +0 -0
  102. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/mybatis.py +0 -0
  103. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/perl.py +0 -0
  104. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/ruby.py +0 -0
  105. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/rust.py +0 -0
  106. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/scala.py +0 -0
  107. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/sfc_common.py +0 -0
  108. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/solidity.py +0 -0
  109. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/solidity_remappings.py +0 -0
  110. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/svelte.py +0 -0
  111. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/swift.py +0 -0
  112. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/typescript.py +0 -0
  113. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
  114. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/languages/vue.py +0 -0
  115. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/package_resolver.py +0 -0
  116. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
  117. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
  118. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
  119. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/elisp_toolkit.py +0 -0
  120. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
  121. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
  122. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
  123. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
  124. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
  125. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
  126. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
  127. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
  128. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/solidity_toolkit.py +0 -0
  129. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
  130. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
  131. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/report_generator.py +0 -0
  132. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/scip_indexer.py +0 -0
  133. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/scip_pb2.py +0 -0
  134. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/system.py +0 -0
  135. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/tree_sitter_parser.py +0 -0
  136. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/tools/type_utils.py +0 -0
  137. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/cypher_ddl.py +0 -0
  138. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/cypher_readonly.py +0 -0
  139. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/debug_log.py +0 -0
  140. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/git_utils.py +0 -0
  141. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/path_ignore.py +0 -0
  142. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/repo_path.py +0 -0
  143. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/tool_limits.py +0 -0
  144. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
  145. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/__vite-browser-external-9wXp6ZBx.js +0 -0
  146. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/function-calls-BtRHrqa2.png +0 -0
  147. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/graph-total-D1fBAugo.png +0 -0
  148. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/hero-graph-2voMJp2a.jpg +0 -0
  149. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/hierarchy-DGADo0YT.png +0 -0
  150. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/index-C-187lf0.js +0 -0
  151. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/index-fNAa6jgv.css +0 -0
  152. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/parser-pyodide.worker-BgsDfaad.js +0 -0
  153. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/parser.worker-_nvrecvj.js +0 -0
  154. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/assets/tree-sitter-qKYAACSa.wasm +0 -0
  155. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/cgcIcon.png +0 -0
  156. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/favicon.ico +0 -0
  157. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/index.html +0 -0
  158. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/logo-icon.svg +0 -0
  159. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/logo.svg +0 -0
  160. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/placeholder.svg +0 -0
  161. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/preview-image.png +0 -0
  162. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/robots.txt +0 -0
  163. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c.wasm +0 -0
  164. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c_sharp.wasm +0 -0
  165. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-core.js +0 -0
  166. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-cpp.wasm +0 -0
  167. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-dart.wasm +0 -0
  168. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-go.wasm +0 -0
  169. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-java.wasm +0 -0
  170. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-javascript.wasm +0 -0
  171. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-kotlin.wasm +0 -0
  172. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-perl.wasm +0 -0
  173. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-php.wasm +0 -0
  174. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-python.wasm +0 -0
  175. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-ruby.wasm +0 -0
  176. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-rust.wasm +0 -0
  177. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-swift.wasm +0 -0
  178. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-tsx.wasm +0 -0
  179. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter-typescript.wasm +0 -0
  180. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/tree-sitter.wasm +0 -0
  181. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.js +0 -0
  182. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.wasm +0 -0
  183. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext.egg-info/SOURCES.txt +0 -0
  184. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
  185. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
  186. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext.egg-info/requires.txt +0 -0
  187. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/src/codegraphcontext.egg-info/top_level.txt +0 -0
  188. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/tests/test_issue_806_fix.py +0 -0
  189. {codegraphcontext-0.5.4 → codegraphcontext-0.5.6}/tests/test_mcp_sse.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codegraphcontext
3
- Version: 0.5.4
3
+ Version: 0.5.6
4
4
  Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
5
5
  Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codegraphcontext"
3
- version = "0.5.4"
3
+ version = "0.5.6"
4
4
  description = "An MCP server that indexes local code into a graph database to provide context to AI assistants."
5
5
  authors = [{ name = "Shashank Shekhar Singh", email = "shashankshekharsingh1205@gmail.com" }]
6
6
  readme = "README.md"
@@ -82,10 +82,12 @@ class Advanced_language_query:
82
82
 
83
83
  if language not in self.TOOLKITS:
84
84
  raise ValueError(f"Unsupported language: {language}")
85
- self.toolkit = self.TOOLKITS[language]()
86
-
87
- # Getting the language query
88
- cypher_query = self.toolkit.get_cypher_query(label)
85
+ try:
86
+ self.toolkit = self.TOOLKITS[language]()
87
+ # Getting the language query
88
+ cypher_query = self.toolkit.get_cypher_query(label)
89
+ except NotImplementedError as exc:
90
+ return {"error": str(exc), "language": language, "query": query}
89
91
  try:
90
92
  debug_log(f"Executing Cypher query: {cypher_query}")
91
93
  with self.db_manager.get_driver().session() as session:
@@ -654,7 +654,7 @@ class CodeFinder:
654
654
  OPTIONAL MATCH (repo:Repository)-[:CONTAINS]->(file)
655
655
  WITH file, repo, COLLECT({{
656
656
  imported_module: module.name,
657
- import_alias: module.alias,
657
+ import_alias: imp.alias,
658
658
  full_import_name: module.full_import_name
659
659
  }}) AS imports
660
660
  RETURN
@@ -191,12 +191,39 @@ async def run_scip_index_async(
191
191
  cgcignore_path=cgcignore_path,
192
192
  supported_extensions=set(parsers_keys),
193
193
  )
194
+ minimal_nodes = 0
194
195
  for repo_file in supplementary_files:
195
196
  abs_str = str(repo_file.resolve())
196
197
  if abs_str in scip_abs_paths:
197
198
  continue
198
199
  ts_parser = get_parser(repo_file.suffix)
199
200
  if not ts_parser:
201
+ # No parser: still record the file. `discover_files_to_index`
202
+ # returns supported extensions *plus* generic ones (.md, .json,
203
+ # .yaml, Dockerfile, .gitignore …), and the Tree-sitter pipeline
204
+ # gives those a minimal File node (pipeline.py, via
205
+ # `add_minimal_file_node`) precisely so the graph accounts for
206
+ # every discovered file.
207
+ #
208
+ # Skipping them here left the SCIP path short by exactly the
209
+ # number of non-code files, so `cgc index` compared a graph
210
+ # count against the discovery count and reported "only N of M
211
+ # files indexed. Continuing." on every run, forever.
212
+ try:
213
+ await asyncio.to_thread(
214
+ writer.add_minimal_file_node,
215
+ repo_file,
216
+ index_root,
217
+ is_dependency,
218
+ )
219
+ minimal_nodes += 1
220
+ processed += 1
221
+ if job_id:
222
+ job_manager.update_job(
223
+ job_id, processed_files=processed, current_file=abs_str
224
+ )
225
+ except Exception as e:
226
+ debug_log(f"Minimal file node failed for {abs_str}: {e}")
200
227
  continue
201
228
  try:
202
229
  ts_data = ts_parser.parse(repo_file, is_dependency, index_source=True)
@@ -223,6 +250,10 @@ async def run_scip_index_async(
223
250
  info_logger(
224
251
  f"[SCIP+TS] Supplemented {supplemented} files not covered by SCIP indexer"
225
252
  )
253
+ if minimal_nodes:
254
+ info_logger(
255
+ f"[SCIP+TS] Recorded {minimal_nodes} non-code file(s) as minimal File nodes"
256
+ )
226
257
 
227
258
  info_logger(
228
259
  f"[INHERITS] Resolving inheritance links across {len(files_data)} files..."
@@ -34,19 +34,41 @@ GO_QUERIES = {
34
34
  )
35
35
  ) @interface_node
36
36
  """,
37
+ # `import_spec` is a direct child of `import_declaration` only for a
38
+ # single-line `import "fmt"`. A grouped block — which gofmt produces for
39
+ # any file with more than one import, i.e. nearly all of them — nests the
40
+ # specs inside an `import_spec_list`, so matching only the direct-child
41
+ # shape returned zero imports for those files.
37
42
  "imports": """
38
43
  (import_declaration
39
44
  (import_spec
40
45
  path: (interpreted_string_literal) @path
41
46
  )
42
47
  ) @import
43
-
48
+
49
+ (import_declaration
50
+ (import_spec_list
51
+ (import_spec
52
+ path: (interpreted_string_literal) @path
53
+ )
54
+ )
55
+ ) @import
56
+
44
57
  (import_declaration
45
58
  (import_spec
46
59
  name: (package_identifier) @alias
47
60
  path: (interpreted_string_literal) @path
48
61
  )
49
62
  ) @import_alias
63
+
64
+ (import_declaration
65
+ (import_spec_list
66
+ (import_spec
67
+ name: (package_identifier) @alias
68
+ path: (interpreted_string_literal) @path
69
+ )
70
+ )
71
+ ) @import_alias
50
72
  """,
51
73
  "calls": """
52
74
  (call_expression
@@ -31,8 +31,16 @@ PHP_QUERIES = {
31
31
  name: (name) @name
32
32
  ) @trait
33
33
  """,
34
+ # A top-level `use App\Models\User;` is a `namespace_use_declaration`.
35
+ # `use_declaration` is the *trait* use inside a class body (relied on at
36
+ # ~line 309), so capturing it here dropped every real import and labelled
37
+ # trait uses as imports instead.
38
+ #
39
+ # Capture the clause rather than the declaration: it is the level that
40
+ # exists once per imported symbol, so the braced group form
41
+ # `use Foo\{A, B as C};` yields one row per symbol for free.
34
42
  "imports": """
35
- (use_declaration) @import
43
+ (namespace_use_clause) @import
36
44
  """,
37
45
  "calls": """
38
46
  (function_call_expression
@@ -394,40 +402,82 @@ class PhpTreeSitterParser:
394
402
  for node, capture_name in captures:
395
403
  if capture_name == "import":
396
404
  try:
397
- import_text = self._get_node_text(node)
398
- # use Foo\Bar as Baz;
399
- # Node usually has children: name (qualified_name), optional alias
400
-
401
- name_node = None
402
- alias_node = None
403
-
405
+ # `namespace_use_clause` shapes, in tree-sitter-php:
406
+ # App\Models\User -> qualified_name
407
+ # App\Models\Post as Blog -> qualified_name, name(alias)
408
+ # A -> name (group member)
409
+ # B as C -> name, name(alias) (group member)
410
+ # function Bar\helper -> qualified_name, with a
411
+ # leading `function`/`const` token
412
+ #
413
+ # The alias, when present, is always the final `name` child.
414
+ path_node = None
415
+ alias = None
416
+ name_children = []
417
+
404
418
  for child in node.children:
405
- if child.type == "qualified_name" or child.type == "name":
406
- name_node = child
407
- # Alias in PHP: use X as Y; The 'as' is usually implicit structure or explicit?
408
- # Tree sitter grammar: use_declaration -> use_clause -> (use_as_clause (qualified_name) (name))
409
-
410
- # Assuming simple handling for now, extracting string from text
411
- # Regex might be safer given tree complexity for `use`
412
- import_match = re.search(r'use\s+([\w\\]+)(?:\s+as\s+(\w+))?', import_text)
413
- if import_match:
414
- import_path = import_match.group(1).strip()
415
- alias = import_match.group(2).strip() if import_match.group(2) else None
416
-
417
- import_data = {
418
- "name": import_path,
419
- "full_import_name": import_text,
420
- "line_number": node.start_point[0] + 1,
421
- "alias": alias,
422
- "context": (None, None),
423
- "lang": self.language_name,
424
- "is_dependency": False,
425
- }
426
- imports.append(import_data)
419
+ if child.type == "qualified_name":
420
+ path_node = child
421
+ elif child.type == "name":
422
+ name_children.append(child)
423
+
424
+ if path_node is not None:
425
+ # qualified_name carries the path; a trailing bare name
426
+ # is therefore the alias.
427
+ import_path = self._get_node_text(path_node)
428
+ if name_children:
429
+ alias = self._get_node_text(name_children[-1])
430
+ elif name_children:
431
+ # Group member: first name is the symbol, second (if
432
+ # any) is its alias.
433
+ import_path = self._get_node_text(name_children[0])
434
+ if len(name_children) > 1:
435
+ alias = self._get_node_text(name_children[-1])
436
+ else:
437
+ continue
438
+
439
+ # A braced group prefixes its members: `use Foo\{A, B};`
440
+ # means Foo\A and Foo\B. Walk up to recover the prefix so
441
+ # the recorded path is the real fully-qualified name.
442
+ group = node.parent
443
+ if group is not None and group.type == "namespace_use_group":
444
+ decl = group.parent
445
+ if decl is not None:
446
+ # The prefix is a `namespace_name` sibling of the
447
+ # group (`use Foo\Bar\{A, B};` -> "Foo\Bar").
448
+ prefix_parts = [
449
+ self._get_node_text(c)
450
+ for c in decl.children
451
+ if c.type in ("namespace_name", "qualified_name", "name")
452
+ ]
453
+ if prefix_parts:
454
+ import_path = (
455
+ prefix_parts[0].rstrip("\\") + "\\" + import_path
456
+ )
457
+
458
+ import_path = import_path.strip()
459
+ if not import_path:
460
+ continue
461
+
462
+ import_data = {
463
+ # `name` is the symbol as referenced in code — the last
464
+ # segment, or the alias when one is given.
465
+ "name": alias or import_path.split("\\")[-1],
466
+ "full_import_name": import_path,
467
+ "line_number": node.start_point[0] + 1,
468
+ "alias": alias,
469
+ "context": (None, None),
470
+ "lang": self.language_name,
471
+ "is_dependency": False,
472
+ }
473
+ imports.append(import_data)
427
474
  except Exception as e:
428
475
  error_logger(f"Error parsing import: {e}")
429
476
  continue
430
477
 
478
+ # Query captures arrive in match order, not source order; sort so the
479
+ # emitted rows are deterministic across runs.
480
+ imports.sort(key=lambda i: (i["line_number"], i["full_import_name"]))
431
481
  return imports
432
482
 
433
483
  def _parse_calls(self, captures: list, source_code: str, var_type_map: dict) -> list[dict]:
@@ -303,9 +303,20 @@ class PythonTreeSitterParser:
303
303
  arg_text = self._get_node_text(name_node)
304
304
  elif p.type == 'typed_parameter':
305
305
  # Typed parameter: def foo(x: int)
306
- name_node = p.child_by_field_name('name')
307
- if name_node:
308
- arg_text = self._get_node_text(name_node)
306
+ # `typed_parameter` has no `name` field in
307
+ # tree-sitter-python — only `type`. Its children are
308
+ # (<identifier|splat>, ':', type), so the parameter
309
+ # is the first child. Looking up a `name` field here
310
+ # returned None and silently dropped every annotated
311
+ # parameter that had no default.
312
+ for child in p.children:
313
+ if child.type in (
314
+ 'identifier',
315
+ 'list_splat_pattern',
316
+ 'dictionary_splat_pattern',
317
+ ):
318
+ arg_text = self._get_node_text(child)
319
+ break
309
320
  elif p.type == 'typed_default_parameter':
310
321
  # Typed parameter with default: def foo(x: int = 5) or def foo(x: str = typer.Argument(...))
311
322
  name_node = p.child_by_field_name('name')
@@ -43,7 +43,7 @@ class CppToolkit:
43
43
  return """
44
44
  MATCH (f:File)-[i:IMPORTS]->(m:Module)
45
45
  RETURN f.name AS file_name, m.name AS module_name,
46
- m.full_import_name AS full_import_name, m.alias AS alias
46
+ m.full_import_name AS full_import_name, i.alias AS alias
47
47
  ORDER BY f.name
48
48
  """
49
49
 
@@ -12,15 +12,23 @@ from typing import Any, Dict, List, Optional
12
12
 
13
13
 
14
14
  class JavaToolkit:
15
- """Spring-aware Java analysis methods backed by CodeFinder / raw Cypher."""
15
+ """Spring-aware Java analysis methods backed by CodeFinder / raw Cypher.
16
16
 
17
- def __init__(self, code_finder: Any):
18
- """
19
- Args:
20
- code_finder: A ``CodeFinder`` instance (or compatible duck-type).
21
- """
17
+ Note: The generic ``advanced_language_query`` path calls this toolkit
18
+ with no arguments (consistent with all other language toolkits). The
19
+ Spring-specific MCP tools (``find_java_spring_endpoints`` /
20
+ ``find_java_spring_beans``) pass a ``code_finder`` via ``_init_with``.
21
+ """
22
+
23
+ def __init__(self) -> None:
24
+ self._cf: Any = None
25
+ self._driver: Any = None
26
+
27
+ def _init_with(self, code_finder: Any) -> "JavaToolkit":
28
+ """Initialise with a live CodeFinder for Spring-specific queries."""
22
29
  self._cf = code_finder
23
30
  self._driver = code_finder.driver
31
+ return self
24
32
 
25
33
  # ── Internal helpers ──────────────────────────────────────────────────────
26
34
 
@@ -249,5 +257,6 @@ class JavaToolkit:
249
257
  # Legacy shim — keeps existing callers working
250
258
  def get_cypher_query(self, query: str) -> str:
251
259
  raise NotImplementedError(
260
+ "AdvancedLanguageQuery is not implemented yet for Java. "
252
261
  "Use find_spring_endpoints(), find_beans_by_stereotype(), etc. instead."
253
262
  )
@@ -15,9 +15,12 @@ See https://gcformat.com for the full specification.
15
15
  """
16
16
 
17
17
  import json
18
+ import logging
18
19
  import os
19
20
  from typing import Any
20
21
 
22
+ logger = logging.getLogger(__name__)
23
+
21
24
  _gcf_encode = None
22
25
  _gcf_checked = False
23
26
 
@@ -53,6 +56,9 @@ def encode_response(result: Any) -> str:
53
56
  if is_gcf_enabled():
54
57
  encoder = _load_gcf()
55
58
  if encoder is not None:
56
- return encoder(result)
59
+ try:
60
+ return encoder(result)
61
+ except Exception:
62
+ logger.debug("GCF encoding failed; falling back to JSON", exc_info=True)
57
63
 
58
64
  return json.dumps(result, indent=2)
@@ -61,11 +61,12 @@ def sanitize_bundle_filename(filename: str, default: str = "bundle.cgc") -> str:
61
61
  name = Path(filename).name
62
62
  if not name or name in (".", ".."):
63
63
  return default
64
- if not re.fullmatch(r"[\w.\-]+\.cgc", name, flags=re.IGNORECASE):
65
- if not name.endswith(".cgc"):
66
- sanitized = re.sub(r'[^\w.\-]+', '_', name)
67
- name = f"{sanitized}.cgc"
68
- return name
64
+ # Always sanitize the stem so that unsafe characters cannot bypass the
65
+ # check by simply appending a .cgc extension.
66
+ stem = name[:-4] if name.lower().endswith(".cgc") else name
67
+ sanitized_stem = re.sub(r"[^\w.\-]+", "_", stem)
68
+ # Re-attach the extension whether it was present or not.
69
+ return f"{sanitized_stem}.cgc"
69
70
 
70
71
 
71
72
  def is_safe_download_url(url: str) -> bool:
@@ -12,6 +12,7 @@ import json
12
12
  import os
13
13
  import tempfile
14
14
  import webbrowser
15
+ from html import escape as html_escape
15
16
  from pathlib import Path
16
17
  from typing import Any, Dict, List, Optional
17
18
 
@@ -55,6 +56,24 @@ def edge_color(rel_type: str) -> str:
55
56
  return _EDGE_COLORS.get(rel_type, _EDGE_COLORS["default"])
56
57
 
57
58
 
59
+ def _json_for_script(data: Any) -> str:
60
+ """Serialise ``data`` for inlining inside a ``<script>`` element.
61
+
62
+ ``json.dumps`` escapes quotes and backslashes but leaves ``<``, ``>`` and
63
+ ``&`` alone, so a node name or file path containing ``</script>`` closes
64
+ the element early and the rest of the document is parsed as markup. Those
65
+ three characters only ever appear inside string literals, so replacing
66
+ them with their ``\\uXXXX`` form keeps the payload valid JSON and valid
67
+ JavaScript while making it inert as markup.
68
+ """
69
+ return (
70
+ json.dumps(data, indent=2)
71
+ .replace("<", "\\u003c")
72
+ .replace(">", "\\u003e")
73
+ .replace("&", "\\u0026")
74
+ )
75
+
76
+
58
77
  def build_graph_data(
59
78
  nodes: List[Dict[str, Any]],
60
79
  edges: List[Dict[str, Any]],
@@ -125,14 +144,15 @@ def render_html(
125
144
  str
126
145
  Complete HTML document as a string.
127
146
  """
128
- graph_json = json.dumps(graph_data, indent=2)
147
+ graph_json = _json_for_script(graph_data)
148
+ safe_title = html_escape(title)
129
149
 
130
150
  html = f"""<!DOCTYPE html>
131
151
  <html lang="en">
132
152
  <head>
133
153
  <meta charset="UTF-8" />
134
154
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
135
- <title>{title}</title>
155
+ <title>{safe_title}</title>
136
156
  <style>
137
157
  * {{ box-sizing: border-box; margin: 0; padding: 0; }}
138
158
  body {{
@@ -198,7 +218,7 @@ def render_html(
198
218
  </head>
199
219
  <body>
200
220
  <div id="header">
201
- <h1>🏗 {title}</h1>
221
+ <h1>🏗 {safe_title}</h1>
202
222
  <span id="stats"></span>
203
223
  </div>
204
224
  <div id="canvas-container">
@@ -96,13 +96,16 @@ def _get_eid(element):
96
96
  if isinstance(element, (int, str)):
97
97
  return str(element)
98
98
 
99
- # If element is a dict (like Neo4j returned items or KuzuDB node/rel dicts)
99
+ # If element is a dict (like Neo4j returned items or KuzuDB/Ladybug node/rel
100
+ # dicts). KùzuDB spells its internal id field '_id'; LadybugDB spells the
101
+ # same field '_ID' (uppercase) — confirmed against a live query on each
102
+ # embedded backend.
100
103
  if isinstance(element, dict):
101
104
  # KuzuDB _src / _dst are directly {'offset': X, 'table': Y}
102
105
  if 'offset' in element and 'table' in element:
103
106
  return f"{element.get('table')}_{element.get('offset')}"
104
-
105
- for key in ['_id', 'id', 'element_id']:
107
+
108
+ for key in ['_id', '_ID', 'id', 'element_id']:
106
109
  if key in element:
107
110
  val = element[key]
108
111
  if val is not None:
@@ -116,7 +119,7 @@ def _get_eid(element):
116
119
  for attr in ['element_id', 'id', '_id']:
117
120
  if hasattr(element, attr):
118
121
  val = getattr(element, attr)
119
- if val is not None:
122
+ if val is not None:
120
123
  # KuzuDB objects if any
121
124
  if isinstance(val, dict):
122
125
  return f"{val.get('table', 0)}_{val.get('offset', 0)}"
@@ -124,6 +127,18 @@ def _get_eid(element):
124
127
  return str(id(element))
125
128
 
126
129
 
130
+ def _meta(d: dict, name: str):
131
+ """Read a KùzuDB/LadybugDB internal dict field regardless of its casing.
132
+
133
+ KùzuDB spells these fields lowercase (_label/_src/_dst); LadybugDB spells
134
+ the same fields uppercase (_LABEL/_SRC/_DST) — confirmed against a live
135
+ query on each embedded backend. Keying on one casing only silently drops
136
+ every row on the other backend.
137
+ """
138
+ lower = f"_{name}"
139
+ return d[lower] if lower in d else d.get(f"_{name.upper()}")
140
+
141
+
127
142
  @app.get("/api/graph")
128
143
  async def get_graph(repo_path: Optional[str] = None, cypher_query: Optional[str] = None):
129
144
  if not db_manager:
@@ -186,9 +201,10 @@ async def get_graph(repo_path: Optional[str] = None, cypher_query: Optional[str]
186
201
  # Extract labels
187
202
  labels = []
188
203
  if isinstance(node, dict):
189
- # KuzuDB node label is under '_label'
190
- if '_label' in node:
191
- labels = [node['_label']]
204
+ # KuzuDB node label is under '_label' (LadybugDB: '_LABEL')
205
+ meta_label = _meta(node, 'label')
206
+ if meta_label is not None:
207
+ labels = [meta_label]
192
208
  elif 'label' in node:
193
209
  labels = [node['label']]
194
210
  else:
@@ -247,13 +263,17 @@ async def get_graph(repo_path: Optional[str] = None, cypher_query: Optional[str]
247
263
  # FalkorDB / KuzuDB may return rels as dicts OR objects
248
264
  if isinstance(rel, dict):
249
265
  rid = get_eid(rel)
250
- # KuzuDB uses _src and _dst, FalkorDB uses src_node/dest_node
251
- src = rel.get('_src', rel.get('src_node'))
252
- dst = rel.get('_dst', rel.get('dest_node'))
253
-
266
+ # KuzuDB uses _src/_dst (LadybugDB: _SRC/_DST), FalkorDB uses src_node/dest_node
267
+ src = _meta(rel, 'src')
268
+ if src is None:
269
+ src = rel.get('src_node')
270
+ dst = _meta(rel, 'dst')
271
+ if dst is None:
272
+ dst = rel.get('dest_node')
273
+
254
274
  source = get_eid(src) if src is not None else None
255
275
  target = get_eid(dst) if dst is not None else None
256
- rel_type = str(rel.get('_label', rel.get('relation', rel.get('type', 'RELATED')))).upper()
276
+ rel_type = str(_meta(rel, 'label') or rel.get('relation', rel.get('type', 'RELATED'))).upper()
257
277
  else:
258
278
  rid = get_eid(rel)
259
279
  start_node = None
@@ -420,8 +440,9 @@ def parse_node(node, nodes_dict):
420
440
 
421
441
  labels = []
422
442
  if isinstance(node, dict):
423
- if '_label' in node:
424
- labels = [node['_label']]
443
+ meta_label = _meta(node, 'label')
444
+ if meta_label is not None:
445
+ labels = [meta_label]
425
446
  elif 'label' in node:
426
447
  labels = [node['label']]
427
448
  else:
@@ -463,11 +484,15 @@ def parse_node(node, nodes_dict):
463
484
  def parse_rel(rel, edges):
464
485
  rid = _get_eid(rel)
465
486
  if isinstance(rel, dict):
466
- src = rel.get('_src', rel.get('src_node'))
467
- dst = rel.get('_dst', rel.get('dest_node'))
487
+ src = _meta(rel, 'src')
488
+ if src is None:
489
+ src = rel.get('src_node')
490
+ dst = _meta(rel, 'dst')
491
+ if dst is None:
492
+ dst = rel.get('dest_node')
468
493
  source = _get_eid(src) if src is not None else None
469
494
  target = _get_eid(dst) if dst is not None else None
470
- rel_type = str(rel.get('_label', rel.get('relation', rel.get('type', 'RELATED')))).upper()
495
+ rel_type = str(_meta(rel, 'label') or rel.get('relation', rel.get('type', 'RELATED'))).upper()
471
496
  else:
472
497
  start_node = None
473
498
  end_node = None
@@ -510,9 +535,16 @@ def parse_element(val, nodes_dict, edges):
510
535
 
511
536
  type_name = type(val).__name__
512
537
 
513
- if type_name in ('Node', 'KuzuNode') or (isinstance(val, dict) and ('_label' in val or 'labels' in val) and not any(k in val for k in ('_src', '_dst', 'src_node', 'dest_node'))):
538
+ is_dict_rel = isinstance(val, dict) and (
539
+ any(k in val for k in ('_src', '_dst', '_SRC', '_DST', 'src_node', 'dest_node'))
540
+ )
541
+ is_dict_node = isinstance(val, dict) and (
542
+ '_label' in val or '_LABEL' in val or 'labels' in val
543
+ ) and not is_dict_rel
544
+
545
+ if type_name in ('Node', 'KuzuNode') or is_dict_node:
514
546
  parse_node(val, nodes_dict)
515
- elif type_name in ('Relationship', 'KuzuRelationship') or (isinstance(val, dict) and any(k in val for k in ('_src', '_dst', 'src_node', 'dest_node'))):
547
+ elif type_name in ('Relationship', 'KuzuRelationship') or is_dict_rel:
516
548
  parse_rel(val, edges)
517
549
  elif isinstance(val, (list, tuple)):
518
550
  for item in val:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codegraphcontext
3
- Version: 0.5.4
3
+ Version: 0.5.6
4
4
  Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
5
5
  Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
6
6
  License: MIT License