codegraphcontext 0.4.8__tar.gz → 0.4.9__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.
- {codegraphcontext-0.4.8/src/codegraphcontext.egg-info → codegraphcontext-0.4.9}/PKG-INFO +2 -2
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/README.md +1 -1
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/pyproject.toml +1 -1
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/cli/cli_helpers.py +3 -2
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/cli/config_manager.py +10 -3
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/cli/main.py +11 -1
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/database_falkordb.py +2 -2
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/database_kuzu.py +53 -14
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/server.py +45 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/code_finder.py +67 -49
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/graph_builder.py +4 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/handlers/analysis_handlers.py +3 -2
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/persistence/writer.py +229 -129
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/pipeline.py +1 -1
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/resolution/calls.py +85 -42
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +10 -3
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/schema.py +53 -46
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/c.py +86 -4
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/cpp.py +109 -53
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/csharp.py +23 -4
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/css.py +2 -3
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/dart.py +138 -80
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/elixir.py +54 -9
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/go.py +63 -2
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/html.py +8 -8
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/java.py +35 -11
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/javascript.py +1 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/kotlin.py +41 -6
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/perl.py +26 -4
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/php.py +6 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/python.py +7 -1
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/ruby.py +20 -1
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/rust.py +58 -39
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/scala.py +19 -7
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/swift.py +57 -53
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9/src/codegraphcontext.egg-info}/PKG-INFO +2 -2
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/LICENSE +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/MANIFEST.in +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/setup.cfg +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/cli/registry_commands.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/cli/setup_wizard.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/bundle_registry.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/cgc_bundle.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/cgcignore.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/database_nornic.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/watcher.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tool_definitions.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/datasources/__init__.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/datasources/cassandra_ingester.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/datasources/mysql_ingester.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/datasources/redis_ingester.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/constants.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/embeddings.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/resolution/post_resolution.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/schema_contract.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/scip_pipeline.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/indexing/vector_resolver.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/gradle.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/lua.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/maven.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/mybatis.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/typescript.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/report_generator.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/scip_indexer.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/scip_pb2.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/tree_sitter_parser.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/type_utils.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/utils/git_utils.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/utils/path_ignore.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/utils/repo_path.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/utils/tool_limits.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/utils/visualize_graph.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/assets/__vite-browser-external-9wXp6ZBx.js +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/assets/function-calls-BtRHrqa2.png +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/assets/graph-total-D1fBAugo.png +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/assets/hero-graph-2voMJp2a.jpg +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/assets/hierarchy-DGADo0YT.png +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/assets/index-BJT3EMmQ.js +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/assets/index-DjDPHWki.css +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/assets/parser.worker-CZgm11E5.js +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/assets/tree-sitter-qKYAACSa.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/favicon.ico +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/index.html +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/placeholder.svg +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/preview-image.png +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/robots.txt +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c_sharp.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-core.js +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-cpp.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-dart.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-go.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-java.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-javascript.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-kotlin.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-perl.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-php.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-python.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-ruby.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-rust.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-swift.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-tsx.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter-typescript.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/tree-sitter.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.js +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.wasm +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/viz/server.py +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext.egg-info/SOURCES.txt +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext.egg-info/requires.txt +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext.egg-info/top_level.txt +0 -0
- {codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/tests/test_issue_806_fix.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
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
|
|
@@ -167,7 +167,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
167
167
|
---
|
|
168
168
|
|
|
169
169
|
## Project Details
|
|
170
|
-
- **Version:** 0.4.
|
|
170
|
+
- **Version:** 0.4.9
|
|
171
171
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
172
172
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
173
173
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
@@ -98,7 +98,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
98
98
|
---
|
|
99
99
|
|
|
100
100
|
## Project Details
|
|
101
|
-
- **Version:** 0.4.
|
|
101
|
+
- **Version:** 0.4.9
|
|
102
102
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
103
103
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
104
104
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codegraphcontext"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.9"
|
|
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"
|
|
@@ -87,8 +87,9 @@ def _initialize_services(cli_context_flag: Optional[str] = None) -> tuple[Any, A
|
|
|
87
87
|
):
|
|
88
88
|
os.environ["DEFAULT_DATABASE"] = ctx.database
|
|
89
89
|
|
|
90
|
-
# Pass the exact DB path resolved from the context
|
|
91
|
-
|
|
90
|
+
# Pass the exact DB path resolved from the context, or the runtime override
|
|
91
|
+
runtime_path = os.getenv("CGC_RUNTIME_DB_PATH")
|
|
92
|
+
db_manager = get_database_manager(db_path=runtime_path or ctx.db_path)
|
|
92
93
|
except ValueError as e:
|
|
93
94
|
console.print(f"[bold red]Database Configuration Error:[/bold red] {e}")
|
|
94
95
|
return None, None, None, ctx
|
{codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/cli/config_manager.py
RENAMED
|
@@ -634,10 +634,17 @@ def _default_global_db_path(database: str) -> str:
|
|
|
634
634
|
"""Return the canonical DB path for the global context.
|
|
635
635
|
|
|
636
636
|
New layout: ``~/.codegraphcontext/global/db/<backend>/``
|
|
637
|
-
For backward-compat,
|
|
637
|
+
For backward-compat, we check:
|
|
638
|
+
1. FALKORDB_PATH in config (if database is falkordb)
|
|
639
|
+
2. Legacy flat path
|
|
640
|
+
3. New layout default
|
|
638
641
|
"""
|
|
639
|
-
if database == "falkordb"
|
|
640
|
-
|
|
642
|
+
if database == "falkordb":
|
|
643
|
+
custom_path = load_config().get("FALKORDB_PATH")
|
|
644
|
+
if custom_path:
|
|
645
|
+
return str(Path(custom_path).resolve())
|
|
646
|
+
if _LEGACY_FALKORDB_PATH.exists():
|
|
647
|
+
return str(_LEGACY_FALKORDB_PATH)
|
|
641
648
|
return str(CONFIG_DIR / "global" / "db" / database)
|
|
642
649
|
|
|
643
650
|
|
|
@@ -2552,12 +2552,22 @@ def main(
|
|
|
2552
2552
|
"-h",
|
|
2553
2553
|
help="[Root-level only] Show help and exit",
|
|
2554
2554
|
is_eager=True,
|
|
2555
|
-
),
|
|
2555
|
+
),
|
|
2556
|
+
db_path: Optional[str] = typer.Option(
|
|
2557
|
+
None,
|
|
2558
|
+
"--path",
|
|
2559
|
+
"--db-path",
|
|
2560
|
+
help="[Global] Temporarily override database path (for local DBs like KuzuDB)"
|
|
2561
|
+
),
|
|
2556
2562
|
):
|
|
2557
2563
|
"""
|
|
2558
2564
|
Main entry point for the cgc CLI application.
|
|
2559
2565
|
If no subcommand is provided, it displays a welcome message with instructions.
|
|
2560
2566
|
"""
|
|
2567
|
+
if db_path:
|
|
2568
|
+
os.environ["CGC_RUNTIME_DB_PATH"] = db_path
|
|
2569
|
+
if database:
|
|
2570
|
+
os.environ["CGC_RUNTIME_DB_TYPE"] = database
|
|
2561
2571
|
# Initialize context object for sharing state with subcommands
|
|
2562
2572
|
ctx.ensure_object(dict)
|
|
2563
2573
|
|
{codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/database_falkordb.py
RENAMED
|
@@ -335,7 +335,7 @@ class FalkorDBDriverWrapper:
|
|
|
335
335
|
def __init__(self, graph):
|
|
336
336
|
self.graph = graph
|
|
337
337
|
|
|
338
|
-
def session(self):
|
|
338
|
+
def session(self, **kwargs):
|
|
339
339
|
"""Returns a session-like object for FalkorDB."""
|
|
340
340
|
return FalkorDBSessionWrapper(self.graph)
|
|
341
341
|
|
|
@@ -377,7 +377,7 @@ class FalkorDBSessionWrapper:
|
|
|
377
377
|
except Exception as e:
|
|
378
378
|
# Ignore errors about existing constraints/indexes
|
|
379
379
|
error_msg = str(e).lower()
|
|
380
|
-
if "already exists" in error_msg or "already created" in error_msg:
|
|
380
|
+
if "already exists" in error_msg or "already created" in error_msg or "already indexed" in error_msg:
|
|
381
381
|
return FalkorDBResultWrapper(None)
|
|
382
382
|
|
|
383
383
|
error_logger(f"FalkorDB query failed: {query[:100]}... Error: {e}")
|
{codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/core/database_kuzu.py
RENAMED
|
@@ -106,7 +106,7 @@ class KuzuDBManager:
|
|
|
106
106
|
("Repository", "path STRING, name STRING, is_dependency BOOLEAN, indexed_at STRING, commit_hash STRING, PRIMARY KEY (path)"),
|
|
107
107
|
("File", "path STRING, name STRING, relative_path STRING, package_name STRING, is_dependency BOOLEAN, PRIMARY KEY (path)"),
|
|
108
108
|
("Directory", "path STRING, name STRING, PRIMARY KEY (path)"),
|
|
109
|
-
("Module", "name STRING, lang STRING, full_import_name STRING, PRIMARY KEY (name)"),
|
|
109
|
+
("Module", "name STRING, lang STRING, full_import_name STRING, path STRING, line_number INT64, PRIMARY KEY (name)"),
|
|
110
110
|
# For types with composite keys (name, path, line_number), we use a 'uid'
|
|
111
111
|
("Function", "uid STRING, name STRING, path STRING, line_number INT64, end_line INT64, source STRING, docstring STRING, lang STRING, cyclomatic_complexity INT64, context STRING, context_type STRING, class_context STRING, class_context_line INT64, is_dependency BOOLEAN, decorators STRING[], args STRING[], http_method STRING, http_path STRING, PRIMARY KEY (uid)"),
|
|
112
112
|
("Class", "uid STRING, name STRING, path STRING, line_number INT64, end_line INT64, source STRING, docstring STRING, lang STRING, node_type STRING, is_dependency BOOLEAN, decorators STRING[], PRIMARY KEY (uid)"),
|
|
@@ -120,7 +120,12 @@ class KuzuDBManager:
|
|
|
120
120
|
("Annotation", "uid STRING, name STRING, path STRING, line_number INT64, end_line INT64, source STRING, docstring STRING, lang STRING, is_dependency BOOLEAN, PRIMARY KEY (uid)"),
|
|
121
121
|
("Record", "uid STRING, name STRING, path STRING, line_number INT64, end_line INT64, source STRING, docstring STRING, lang STRING, is_dependency BOOLEAN, PRIMARY KEY (uid)"),
|
|
122
122
|
("Property", "uid STRING, name STRING, path STRING, line_number INT64, end_line INT64, source STRING, docstring STRING, lang STRING, is_dependency BOOLEAN, PRIMARY KEY (uid)"),
|
|
123
|
-
("Parameter", "uid STRING, name STRING, path STRING, function_line_number INT64, PRIMARY KEY (uid)")
|
|
123
|
+
("Parameter", "uid STRING, name STRING, path STRING, function_line_number INT64, PRIMARY KEY (uid)"),
|
|
124
|
+
("Mixin", "uid STRING, name STRING, path STRING, line_number INT64, end_line INT64, source STRING, docstring STRING, lang STRING, is_dependency BOOLEAN, PRIMARY KEY (uid)"),
|
|
125
|
+
("Extension", "uid STRING, name STRING, path STRING, line_number INT64, end_line INT64, source STRING, docstring STRING, lang STRING, is_dependency BOOLEAN, PRIMARY KEY (uid)"),
|
|
126
|
+
("Object", "uid STRING, name STRING, path STRING, line_number INT64, end_line INT64, source STRING, docstring STRING, lang STRING, is_dependency BOOLEAN, PRIMARY KEY (uid)"),
|
|
127
|
+
("DbTable", "name STRING, fqn STRING, datasource_name STRING, path STRING, PRIMARY KEY (name)"),
|
|
128
|
+
("ExternalClass", "name STRING, path STRING, PRIMARY KEY (name)")
|
|
124
129
|
]
|
|
125
130
|
|
|
126
131
|
# rel_tables: list of (table_name, schema, use_group)
|
|
@@ -131,26 +136,57 @@ class KuzuDBManager:
|
|
|
131
136
|
# keywords in CREATE REL TABLE statements. We must escape them with backticks
|
|
132
137
|
# or the rel table creation will fail silently, leading to runtime
|
|
133
138
|
# "Binder exception: Table CONTAINS does not exist".
|
|
134
|
-
("CONTAINS", "
|
|
139
|
+
("CONTAINS", """
|
|
140
|
+
FROM File TO Function, FROM File TO Class, FROM File TO Variable, FROM File TO Trait, FROM File TO Interface,
|
|
141
|
+
FROM File TO `Macro`, FROM File TO Struct, FROM File TO Enum, FROM File TO `Union`, FROM File TO Annotation,
|
|
142
|
+
FROM File TO Record, FROM File TO `Property`, FROM File TO Mixin, FROM File TO Extension, FROM File TO Module,
|
|
143
|
+
FROM File TO Object,
|
|
144
|
+
FROM Repository TO Directory, FROM Directory TO Directory, FROM Directory TO File, FROM Repository TO File,
|
|
145
|
+
FROM Class TO Function, FROM Module TO Function, FROM Interface TO Function, FROM Struct TO Function,
|
|
146
|
+
FROM Record TO Function, FROM Trait TO Function, FROM Object TO Function, FROM Mixin TO Function,
|
|
147
|
+
FROM Extension TO Function, FROM Class TO Class, FROM Class TO Interface, FROM Class TO Struct,
|
|
148
|
+
FROM Class TO Variable, FROM Module TO Class, FROM Module TO Module, FROM `Macro` TO `Macro`, FROM Function TO Function
|
|
149
|
+
""", True),
|
|
135
150
|
("CALLS", """
|
|
136
|
-
FROM Function TO Function, FROM Function TO Class, FROM Function TO Interface, FROM Function TO Trait,
|
|
137
|
-
FROM
|
|
151
|
+
FROM Function TO Function, FROM Function TO Class, FROM Function TO Interface, FROM Function TO Trait,
|
|
152
|
+
FROM Function TO Struct, FROM Function TO Enum, FROM Function TO Record, FROM Function TO `Union`,
|
|
153
|
+
FROM Function TO Mixin, FROM Function TO Extension, FROM Function TO Object,
|
|
154
|
+
FROM Class TO Function, FROM Class TO Class, FROM Class TO Interface, FROM Class TO Trait,
|
|
155
|
+
FROM Class TO Struct, FROM Class TO Enum, FROM Class TO Record, FROM Class TO `Union`,
|
|
138
156
|
FROM Interface TO Function, FROM Interface TO Class, FROM Interface TO Interface,
|
|
139
|
-
FROM
|
|
140
|
-
|
|
157
|
+
FROM Trait TO Function, FROM Trait TO Class, FROM Trait TO Interface,
|
|
158
|
+
FROM Mixin TO Function, FROM Mixin TO Class, FROM Mixin TO Interface,
|
|
159
|
+
FROM Extension TO Function, FROM Extension TO Class, FROM Extension TO Interface,
|
|
160
|
+
FROM Object TO Function, FROM Object TO Class, FROM Object TO Interface,
|
|
161
|
+
FROM `Union` TO Function, FROM `Union` TO Class, FROM `Union` TO Interface,
|
|
162
|
+
FROM `Macro` TO Function, FROM `Macro` TO Class, FROM `Macro` TO Interface,
|
|
163
|
+
FROM File TO Function, FROM File TO Class, FROM File TO Interface, FROM File TO Trait,
|
|
164
|
+
FROM File TO Struct, FROM File TO Enum, FROM File TO Record, FROM File TO `Union`,
|
|
165
|
+
FROM Variable TO Function, FROM Variable TO Class, FROM Variable TO Interface,
|
|
166
|
+
line_number INT64, args STRING[], full_call_name STRING, confidence DOUBLE, resolution_tier INT64,
|
|
167
|
+
confidence_label STRING, source STRING, resolution_method STRING, called_name STRING
|
|
141
168
|
""", True),
|
|
142
169
|
("IMPORTS", "FROM File TO Module, alias STRING, full_import_name STRING, imported_name STRING, line_number INT64", False),
|
|
143
170
|
("INHERITS", """
|
|
144
|
-
FROM Class TO Class, FROM Class TO Interface, FROM Class TO Trait,
|
|
145
|
-
FROM
|
|
146
|
-
FROM Interface TO Interface, FROM Interface TO Trait,
|
|
147
|
-
FROM Struct TO Interface, FROM Struct TO Trait,
|
|
171
|
+
FROM Class TO Class, FROM Class TO Interface, FROM Class TO Trait, FROM Class TO Mixin, FROM Class TO Extension, FROM Class TO ExternalClass, FROM Class TO Struct, FROM Class TO Enum, FROM Class TO `Union`, FROM Class TO Record, FROM Class TO Object,
|
|
172
|
+
FROM Trait TO Trait, FROM Trait TO Interface, FROM Trait TO ExternalClass, FROM Trait TO Class,
|
|
173
|
+
FROM Interface TO Interface, FROM Interface TO Trait, FROM Interface TO ExternalClass, FROM Interface TO Class,
|
|
174
|
+
FROM Struct TO Interface, FROM Struct TO Trait, FROM Struct TO ExternalClass, FROM Struct TO Struct, FROM Struct TO Class,
|
|
175
|
+
FROM Record TO Record, FROM Record TO Interface, FROM Record TO ExternalClass, FROM Record TO Class, FROM Record TO Struct,
|
|
176
|
+
FROM Mixin TO Mixin, FROM Mixin TO Interface, FROM Mixin TO ExternalClass, FROM Mixin TO Class,
|
|
177
|
+
FROM Extension TO Extension, FROM Extension TO Interface, FROM Extension TO ExternalClass, FROM Extension TO Class,
|
|
178
|
+
FROM Enum TO Class, FROM Enum TO Interface, FROM Enum TO ExternalClass, FROM Enum TO Enum,
|
|
179
|
+
FROM `Union` TO Class, FROM `Union` TO Interface, FROM `Union` TO ExternalClass, FROM `Union` TO `Union`,
|
|
180
|
+
FROM Module TO Module, FROM Module TO ExternalClass, FROM Object TO Object, FROM Object TO ExternalClass, FROM Object TO Class,
|
|
148
181
|
confidence_label STRING
|
|
149
182
|
""", True),
|
|
150
183
|
("HAS_PARAMETER", "FROM Function TO Parameter", False),
|
|
151
184
|
("INCLUDES", "FROM Class TO Module", False),
|
|
152
|
-
("IMPLEMENTS", "FROM Class TO Interface, FROM Struct TO Interface, FROM Record TO Interface", True),
|
|
153
|
-
("INJECTS", "FROM Class TO Class, field_name STRING, inject_line INT64, confidence_label STRING", False)
|
|
185
|
+
("IMPLEMENTS", "FROM Class TO Interface, FROM Struct TO Interface, FROM Record TO Interface, FROM Mixin TO Interface, FROM Extension TO Interface, FROM Enum TO Interface, FROM Object TO Interface, FROM `Union` TO Interface, FROM Trait TO Interface", True),
|
|
186
|
+
("INJECTS", "FROM Class TO Class, field_name STRING, inject_line INT64, confidence_label STRING", False),
|
|
187
|
+
("MAPS_TO", "FROM Class TO DbTable, datastore STRING, line_number INT64", False),
|
|
188
|
+
("READS", "FROM Function TO DbTable, line_number INT64", False),
|
|
189
|
+
("WRITES", "FROM Function TO DbTable, line_number INT64", False)
|
|
154
190
|
]
|
|
155
191
|
|
|
156
192
|
for table_name, schema in node_tables:
|
|
@@ -181,9 +217,12 @@ class KuzuDBManager:
|
|
|
181
217
|
simple_migrations = [
|
|
182
218
|
("File", "package_name", "STRING"),
|
|
183
219
|
("Module", "full_import_name", "STRING"),
|
|
220
|
+
("Module", "path", "STRING"),
|
|
221
|
+
("Module", "line_number", "INT64"),
|
|
222
|
+
("DbTable", "path", "STRING"),
|
|
223
|
+
("ExternalClass", "path", "STRING"),
|
|
184
224
|
("IMPORTS", "full_import_name", "STRING"),
|
|
185
225
|
("IMPORTS", "imported_name", "STRING"),
|
|
186
|
-
# Freshness properties added to Repository in 0.4.8
|
|
187
226
|
("Repository", "indexed_at", "STRING"),
|
|
188
227
|
("Repository", "commit_hash", "STRING"),
|
|
189
228
|
# Spring endpoint properties on Function
|
|
@@ -27,6 +27,9 @@ from .cli.config_manager import (
|
|
|
27
27
|
discover_child_contexts,
|
|
28
28
|
save_workspace_mapping,
|
|
29
29
|
get_workspace_mapping,
|
|
30
|
+
_default_global_db_path,
|
|
31
|
+
CONFIG_DIR,
|
|
32
|
+
load_config,
|
|
30
33
|
)
|
|
31
34
|
|
|
32
35
|
# Import Tool Definitions and Handlers
|
|
@@ -398,6 +401,48 @@ class MCPServer:
|
|
|
398
401
|
if not raw_path:
|
|
399
402
|
return {"error": "context_path is required."}
|
|
400
403
|
|
|
404
|
+
# --- Special case: switch back to the global context ---
|
|
405
|
+
if raw_path == "global":
|
|
406
|
+
try:
|
|
407
|
+
try:
|
|
408
|
+
self.db_manager.close_driver()
|
|
409
|
+
except Exception:
|
|
410
|
+
pass
|
|
411
|
+
|
|
412
|
+
# Resolve global DB path directly — do NOT use resolve_context()
|
|
413
|
+
# because that checks CWD for local .codegraphcontext/ and may
|
|
414
|
+
# return per-repo instead of global.
|
|
415
|
+
db = os.getenv("CGC_RUNTIME_DB_TYPE") or load_config().get("DEFAULT_DATABASE", "falkordb")
|
|
416
|
+
global_db_path = _default_global_db_path(db)
|
|
417
|
+
new_manager = get_database_manager(db_path=global_db_path)
|
|
418
|
+
new_manager.get_driver()
|
|
419
|
+
|
|
420
|
+
self.db_manager = new_manager
|
|
421
|
+
self.resolved_context = type(self.resolved_context)(
|
|
422
|
+
mode="global",
|
|
423
|
+
context_name="",
|
|
424
|
+
database=db,
|
|
425
|
+
db_path=global_db_path,
|
|
426
|
+
cgcignore_path=str(CONFIG_DIR / "global" / ".cgcignore"),
|
|
427
|
+
is_local=False,
|
|
428
|
+
)
|
|
429
|
+
|
|
430
|
+
# Rebuild dependent components
|
|
431
|
+
self.graph_builder = GraphBuilder(self.db_manager, self.job_manager, self.loop)
|
|
432
|
+
self.code_finder = CodeFinder(self.db_manager)
|
|
433
|
+
self.code_watcher = CodeWatcher(self.graph_builder, self.job_manager)
|
|
434
|
+
self._context_note_pending = False
|
|
435
|
+
|
|
436
|
+
return {
|
|
437
|
+
"status": "ok",
|
|
438
|
+
"message": f"Switched back to global context at {global_db_path}.",
|
|
439
|
+
"database": db,
|
|
440
|
+
"db_path": global_db_path,
|
|
441
|
+
}
|
|
442
|
+
except Exception as e:
|
|
443
|
+
return {"error": f"Failed to switch to global context: {e}"}
|
|
444
|
+
|
|
445
|
+
# --- Normal path-based switch ---
|
|
401
446
|
target = Path(raw_path).resolve()
|
|
402
447
|
# Accept either the repo dir or the .codegraphcontext dir directly
|
|
403
448
|
if target.name == ".codegraphcontext":
|
|
@@ -824,64 +824,79 @@ class CodeFinder:
|
|
|
824
824
|
"note": "These functions might be unused, but could be entry points, callbacks, or called dynamically"
|
|
825
825
|
}
|
|
826
826
|
|
|
827
|
-
def find_all_callers(self, function_name: str, path: Optional[str] = None, repo_path: Optional[str] = None) -> List[Dict]:
|
|
828
|
-
"""Find all direct and indirect callers of a specific function."""
|
|
827
|
+
def find_all_callers(self, function_name: str, path: Optional[str] = None, repo_path: Optional[str] = None, depth: int = 3) -> List[Dict]:
|
|
828
|
+
"""Find all direct and indirect callers of a specific function, returning edges."""
|
|
829
829
|
with self.driver.session() as session:
|
|
830
|
-
repo_filter = "AND
|
|
830
|
+
repo_filter = "AND caller.path STARTS WITH $repo_path" if repo_path else ""
|
|
831
|
+
depth_str = f"1..{depth}" if depth > 1 else "1"
|
|
832
|
+
|
|
833
|
+
# KùzuDB-optimized: matching on the path end node via nodes(p) indexing
|
|
834
|
+
# ensures we avoid Binder exceptions for multi-labeled property lookups
|
|
835
|
+
# on the end node of variable-length paths.
|
|
831
836
|
if path:
|
|
832
|
-
# KùzuDB-compatible: Use anonymous end node and filter with WHERE
|
|
833
837
|
query = f"""
|
|
834
|
-
MATCH p = (
|
|
835
|
-
WITH
|
|
836
|
-
WITH
|
|
837
|
-
WHERE
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
838
|
+
MATCH p = (caller:Function)-[:CALLS*{depth_str}]->(target:Function)
|
|
839
|
+
WITH p, nodes(p) as path_nodes, relationships(p) as rels
|
|
840
|
+
WITH p, path_nodes, rels, path_nodes[size(path_nodes)-1] as last_node
|
|
841
|
+
WHERE last_node.name = $function_name AND last_node.path = $path
|
|
842
|
+
{repo_filter}
|
|
843
|
+
UNWIND rels as r
|
|
844
|
+
WITH startNode(r) as s, endNode(r) as e, r
|
|
845
|
+
RETURN DISTINCT s.name as caller_name, s.path as caller_path,
|
|
846
|
+
e.name as callee_name, e.path as callee_path,
|
|
847
|
+
r.line_number as line
|
|
848
|
+
LIMIT 100
|
|
841
849
|
"""
|
|
842
850
|
result = session.run(query, function_name=function_name, path=path, repo_path=repo_path)
|
|
843
851
|
else:
|
|
844
|
-
# KùzuDB-compatible: Use anonymous end node and filter with WHERE
|
|
845
852
|
query = f"""
|
|
846
|
-
MATCH p = (
|
|
847
|
-
WITH
|
|
848
|
-
WITH
|
|
849
|
-
WHERE
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
+
MATCH p = (caller:Function)-[:CALLS*{depth_str}]->(target:Function)
|
|
854
|
+
WITH p, nodes(p) as path_nodes, relationships(p) as rels
|
|
855
|
+
WITH p, path_nodes, rels, path_nodes[size(path_nodes)-1] as last_node
|
|
856
|
+
WHERE last_node.name = $function_name
|
|
857
|
+
{repo_filter}
|
|
858
|
+
UNWIND rels as r
|
|
859
|
+
WITH startNode(r) as s, endNode(r) as e, r
|
|
860
|
+
RETURN DISTINCT s.name as caller_name, s.path as caller_path,
|
|
861
|
+
e.name as callee_name, e.path as callee_path,
|
|
862
|
+
r.line_number as line
|
|
863
|
+
LIMIT 100
|
|
853
864
|
"""
|
|
854
865
|
result = session.run(query, function_name=function_name, repo_path=repo_path)
|
|
855
866
|
return result.data()
|
|
856
867
|
|
|
857
|
-
def find_all_callees(self, function_name: str, path: Optional[str] = None, repo_path: Optional[str] = None) -> List[Dict]:
|
|
858
|
-
"""Find all direct and indirect callees of a specific function."""
|
|
868
|
+
def find_all_callees(self, function_name: str, path: Optional[str] = None, repo_path: Optional[str] = None, depth: int = 3) -> List[Dict]:
|
|
869
|
+
"""Find all direct and indirect callees of a specific function, returning edges."""
|
|
859
870
|
with self.driver.session() as session:
|
|
860
|
-
repo_filter = "
|
|
871
|
+
repo_filter = "AND callee.path STARTS WITH $repo_path" if repo_path else ""
|
|
872
|
+
depth_str = f"1..{depth}" if depth > 1 else "1"
|
|
873
|
+
|
|
861
874
|
if path:
|
|
862
|
-
# KùzuDB-compatible: Use anonymous end node and extract from path
|
|
863
875
|
query = f"""
|
|
864
|
-
MATCH (caller:Function {{name: $function_name, path: $path}})
|
|
865
|
-
|
|
866
|
-
WITH p
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
876
|
+
MATCH p = (caller:Function {{name: $function_name, path: $path}})-[:CALLS*{depth_str}]->(callee:Function)
|
|
877
|
+
WITH p, nodes(p) as path_nodes, relationships(p) as rels
|
|
878
|
+
WITH p, path_nodes, rels, path_nodes[size(path_nodes)-1] as last_node
|
|
879
|
+
WHERE 1=1 {repo_filter}
|
|
880
|
+
UNWIND rels as r
|
|
881
|
+
WITH startNode(r) as s, endNode(r) as e, r
|
|
882
|
+
RETURN DISTINCT s.name as caller_name, s.path as caller_path,
|
|
883
|
+
e.name as callee_name, e.path as callee_path,
|
|
884
|
+
r.line_number as line
|
|
885
|
+
LIMIT 100
|
|
872
886
|
"""
|
|
873
887
|
result = session.run(query, function_name=function_name, path=path, repo_path=repo_path)
|
|
874
888
|
else:
|
|
875
|
-
# KùzuDB-compatible: Use anonymous end node and extract from path
|
|
876
889
|
query = f"""
|
|
877
|
-
MATCH (caller:Function {{name: $function_name}})
|
|
878
|
-
|
|
879
|
-
WITH p
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
890
|
+
MATCH p = (caller:Function {{name: $function_name}})-[:CALLS*{depth_str}]->(callee:Function)
|
|
891
|
+
WITH p, nodes(p) as path_nodes, relationships(p) as rels
|
|
892
|
+
WITH p, path_nodes, rels, path_nodes[size(path_nodes)-1] as last_node
|
|
893
|
+
WHERE 1=1 {repo_filter}
|
|
894
|
+
UNWIND rels as r
|
|
895
|
+
WITH startNode(r) as s, endNode(r) as e, r
|
|
896
|
+
RETURN DISTINCT s.name as caller_name, s.path as caller_path,
|
|
897
|
+
e.name as callee_name, e.path as callee_path,
|
|
898
|
+
r.line_number as line
|
|
899
|
+
LIMIT 100
|
|
885
900
|
"""
|
|
886
901
|
result = session.run(query, function_name=function_name, repo_path=repo_path)
|
|
887
902
|
return result.data()
|
|
@@ -1159,11 +1174,14 @@ class CodeFinder:
|
|
|
1159
1174
|
"variable_name": variable_name,
|
|
1160
1175
|
"instances": instances,
|
|
1161
1176
|
}
|
|
1162
|
-
|
|
1163
|
-
def analyze_code_relationships(self, query_type: str, target: str, context: Optional[str] = None, repo_path: Optional[str] = None) -> Dict[str, Any]:
|
|
1177
|
+
|
|
1178
|
+
def analyze_code_relationships(self, query_type: str, target: str, context: Optional[str] = None, repo_path: Optional[str] = None, depth: Optional[int] = None) -> Dict[str, Any]:
|
|
1164
1179
|
"""Main method to analyze different types of code relationships with fixed return types"""
|
|
1165
1180
|
query_type = query_type.lower().strip()
|
|
1166
1181
|
|
|
1182
|
+
# Use depth if provided, otherwise default to 3 for 'all' queries
|
|
1183
|
+
effective_depth = depth if depth is not None else 3
|
|
1184
|
+
|
|
1167
1185
|
try:
|
|
1168
1186
|
if query_type == "find_callers":
|
|
1169
1187
|
results = self.who_calls_function(target, context, repo_path=repo_path)
|
|
@@ -1237,17 +1255,17 @@ class CodeFinder:
|
|
|
1237
1255
|
}
|
|
1238
1256
|
|
|
1239
1257
|
elif query_type == "find_all_callers":
|
|
1240
|
-
results = self.find_all_callers(target, context, repo_path=repo_path)
|
|
1258
|
+
results = self.find_all_callers(target, context, repo_path=repo_path, depth=effective_depth)
|
|
1241
1259
|
return {
|
|
1242
|
-
"query_type": "find_all_callers", "target": target, "context": context, "results": results,
|
|
1243
|
-
"summary": f"Found {len(results)} direct and indirect callers of '{target}'"
|
|
1260
|
+
"query_type": "find_all_callers", "target": target, "context": context, "results": results, "depth": effective_depth,
|
|
1261
|
+
"summary": f"Found {len(results)} direct and indirect callers of '{target}' (depth: {effective_depth})"
|
|
1244
1262
|
}
|
|
1245
|
-
|
|
1263
|
+
|
|
1246
1264
|
elif query_type == "find_all_callees":
|
|
1247
|
-
results = self.find_all_callees(target, context, repo_path=repo_path)
|
|
1265
|
+
results = self.find_all_callees(target, context, repo_path=repo_path, depth=effective_depth)
|
|
1248
1266
|
return {
|
|
1249
|
-
"query_type": "find_all_callees", "target": target, "context": context, "results": results,
|
|
1250
|
-
"summary": f"Found {len(results)} direct and indirect callees of '{target}'"
|
|
1267
|
+
"query_type": "find_all_callees", "target": target, "context": context, "results": results, "depth": effective_depth,
|
|
1268
|
+
"summary": f"Found {len(results)} direct and indirect callees of '{target}' (depth: {effective_depth})"
|
|
1251
1269
|
}
|
|
1252
1270
|
|
|
1253
1271
|
elif query_type in ["call_chain", "path", "chain"]:
|
{codegraphcontext-0.4.8 → codegraphcontext-0.4.9}/src/codegraphcontext/tools/graph_builder.py
RENAMED
|
@@ -858,6 +858,10 @@ class GraphBuilder:
|
|
|
858
858
|
if "error" not in file_data:
|
|
859
859
|
self.add_file_to_graph(file_data, repo_name, imports_map)
|
|
860
860
|
return file_data
|
|
861
|
+
if not file_data.get("unsupported"):
|
|
862
|
+
# Generic file type (.md, .yml, .json, etc.) — create a bare File node
|
|
863
|
+
self.add_minimal_file_node(path, repo_path)
|
|
864
|
+
return file_data
|
|
861
865
|
error_logger(f"Skipping graph add for {file_path_str} due to parsing error: {file_data['error']}")
|
|
862
866
|
return None
|
|
863
867
|
return {"deleted": True, "path": file_path_str}
|
|
@@ -89,8 +89,9 @@ def analyze_code_relationships(code_finder: CodeFinder, **args) -> Dict[str, Any
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
try:
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
depth = args.get("depth")
|
|
93
|
+
debug_log(f"Analyzing relationships: {query_type} for {target}, repo_path={repo_path}, depth={depth}")
|
|
94
|
+
results = code_finder.analyze_code_relationships(query_type, target, context, repo_path=repo_path, depth=depth)
|
|
94
95
|
|
|
95
96
|
# Apply per-query-type limit (falls back to tool-level limit)
|
|
96
97
|
limit = get_tool_result_limit(query_type) or get_tool_result_limit("analyze_code_relationships")
|