codegraphcontext 0.4.1__tar.gz → 0.4.3__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.1 → codegraphcontext-0.4.3}/LICENSE +1 -1
- {codegraphcontext-0.4.1/src/codegraphcontext.egg-info → codegraphcontext-0.4.3}/PKG-INFO +4 -3
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/README.md +1 -1
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/pyproject.toml +2 -1
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/config_manager.py +161 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/server.py +131 -7
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tool_definitions.py +23 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/pipeline.py +5 -45
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/server.py +7 -4
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3/src/codegraphcontext.egg-info}/PKG-INFO +4 -3
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext.egg-info/requires.txt +3 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/MANIFEST.in +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/setup.cfg +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/cli_helpers.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/main.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/registry_commands.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/setup_wizard.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/bundle_registry.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/cgc_bundle.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/cgcignore.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/database_falkordb.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/database_kuzu.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/watcher.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/code_finder.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/graph_builder.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/handlers/analysis_handlers.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/constants.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/persistence/writer.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/resolution/calls.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/schema.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/schema_contract.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/scip_pipeline.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/c.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/cpp.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/csharp.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/dart.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/elixir.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/go.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/javascript.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/perl.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/php.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/python.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/ruby.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/rust.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/typescript.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/scip_indexer.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/scip_pb2.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/tree_sitter_parser.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/utils/path_ignore.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/utils/repo_path.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/utils/visualize_graph.py +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/assets/__vite-browser-external-9wXp6ZBx.js +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/assets/function-calls-BtRHrqa2.png +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/assets/graph-total-D1fBAugo.png +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/assets/hero-graph-2voMJp2a.jpg +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/assets/hierarchy-DGADo0YT.png +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/assets/index-BJT3EMmQ.js +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/assets/index-DjDPHWki.css +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/assets/parser.worker-CZgm11E5.js +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/assets/tree-sitter-qKYAACSa.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/favicon.ico +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/index.html +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/placeholder.svg +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/preview-image.png +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/robots.txt +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c_sharp.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-core.js +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-cpp.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-dart.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-go.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-java.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-javascript.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-kotlin.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-perl.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-php.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-python.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-ruby.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-rust.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-swift.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-tsx.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter-typescript.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/tree-sitter.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.js +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.wasm +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext.egg-info/SOURCES.txt +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
- {codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext.egg-info/top_level.txt +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
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
|
|
7
7
|
|
|
8
|
-
Copyright (c) 2025
|
|
8
|
+
Copyright (c) 2025-2026
|
|
9
9
|
|
|
10
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
11
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -53,6 +53,7 @@ Requires-Dist: pathspec>=0.12.1
|
|
|
53
53
|
Requires-Dist: falkordb>=0.1.0
|
|
54
54
|
Requires-Dist: requests>=2.28.0
|
|
55
55
|
Requires-Dist: falkordblite>=0.1.0; sys_platform != "win32" and python_version >= "3.12"
|
|
56
|
+
Requires-Dist: kuzu>=0.4.0; sys_platform == "win32" or (sys_platform != "win32" and python_version >= "3.10" and python_version < "3.12")
|
|
56
57
|
Requires-Dist: fastapi>=0.100.0
|
|
57
58
|
Requires-Dist: uvicorn>=0.22.0
|
|
58
59
|
Provides-Extra: parsing
|
|
@@ -164,7 +165,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
164
165
|
---
|
|
165
166
|
|
|
166
167
|
## Project Details
|
|
167
|
-
- **Version:** 0.4.
|
|
168
|
+
- **Version:** 0.4.3
|
|
168
169
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
169
170
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
170
171
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
@@ -97,7 +97,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
97
97
|
---
|
|
98
98
|
|
|
99
99
|
## Project Details
|
|
100
|
-
- **Version:** 0.4.
|
|
100
|
+
- **Version:** 0.4.3
|
|
101
101
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
102
102
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
103
103
|
- **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.3"
|
|
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"
|
|
@@ -32,6 +32,7 @@ dependencies = [
|
|
|
32
32
|
"falkordb>=0.1.0",
|
|
33
33
|
"requests>=2.28.0",
|
|
34
34
|
"falkordblite>=0.1.0; sys_platform != 'win32' and python_version >= '3.12'",
|
|
35
|
+
"kuzu>=0.4.0; sys_platform == 'win32' or (sys_platform != 'win32' and python_version >= '3.10' and python_version < '3.12')",
|
|
35
36
|
"fastapi>=0.100.0",
|
|
36
37
|
"uvicorn>=0.22.0"
|
|
37
38
|
]
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/config_manager.py
RENAMED
|
@@ -751,6 +751,21 @@ def resolve_context(
|
|
|
751
751
|
is_local=True,
|
|
752
752
|
)
|
|
753
753
|
|
|
754
|
+
# --- 2b. Saved workspace mapping (CWD -> child .codegraphcontext/) ---
|
|
755
|
+
mapping = get_workspace_mapping(cwd)
|
|
756
|
+
if mapping:
|
|
757
|
+
mapped_ctx_path = Path(mapping["context_path"])
|
|
758
|
+
if mapped_ctx_path.exists() and mapped_ctx_path.is_dir():
|
|
759
|
+
mapped_db = mapping.get("database", "falkordb")
|
|
760
|
+
return ResolvedContext(
|
|
761
|
+
mode="per-repo",
|
|
762
|
+
context_name="",
|
|
763
|
+
database=mapped_db,
|
|
764
|
+
db_path=str(mapped_ctx_path / "db" / mapped_db),
|
|
765
|
+
cgcignore_path=str(mapped_ctx_path / ".cgcignore"),
|
|
766
|
+
is_local=True,
|
|
767
|
+
)
|
|
768
|
+
|
|
754
769
|
# --- 3. Global config.yaml ---
|
|
755
770
|
if cfg.mode == "named":
|
|
756
771
|
ctx_name = cfg.default_context
|
|
@@ -888,3 +903,149 @@ def list_contexts() -> List[ContextInfo]:
|
|
|
888
903
|
"""Return all named contexts."""
|
|
889
904
|
cfg = load_context_config()
|
|
890
905
|
return list(cfg.contexts.values())
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
# =============================================================================
|
|
909
|
+
# CHILD CONTEXT DISCOVERY
|
|
910
|
+
# =============================================================================
|
|
911
|
+
|
|
912
|
+
@dataclass
|
|
913
|
+
class DiscoveredContext:
|
|
914
|
+
"""A .codegraphcontext folder found in a child directory."""
|
|
915
|
+
path: str # absolute path to the parent repo directory
|
|
916
|
+
cgc_path: str # absolute path to the .codegraphcontext directory
|
|
917
|
+
repo_name: str # name of the parent directory
|
|
918
|
+
database: str # backend from local config.yaml, or default
|
|
919
|
+
db_path: str # resolved db path
|
|
920
|
+
cgcignore_path: str # path to .cgcignore if present
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
def discover_child_contexts(
|
|
924
|
+
start: Optional[Path] = None,
|
|
925
|
+
max_depth: int = 1,
|
|
926
|
+
) -> List[DiscoveredContext]:
|
|
927
|
+
"""Walk child directories of *start* up to *max_depth* levels looking for
|
|
928
|
+
``.codegraphcontext/`` folders that represent per-repo databases.
|
|
929
|
+
|
|
930
|
+
Returns a list of :class:`DiscoveredContext` for each match found.
|
|
931
|
+
The global ``~/.codegraphcontext`` is always excluded.
|
|
932
|
+
"""
|
|
933
|
+
start = (start or Path.cwd()).resolve()
|
|
934
|
+
global_dir = CONFIG_DIR.resolve()
|
|
935
|
+
results: List[DiscoveredContext] = []
|
|
936
|
+
|
|
937
|
+
def _scan(directory: Path, depth: int) -> None:
|
|
938
|
+
if depth > max_depth:
|
|
939
|
+
return
|
|
940
|
+
try:
|
|
941
|
+
entries = sorted(directory.iterdir())
|
|
942
|
+
except PermissionError:
|
|
943
|
+
return
|
|
944
|
+
for entry in entries:
|
|
945
|
+
if not entry.is_dir() or entry.name.startswith("."):
|
|
946
|
+
continue
|
|
947
|
+
candidate = entry / ".codegraphcontext"
|
|
948
|
+
if candidate.exists() and candidate.is_dir() and candidate.resolve() != global_dir:
|
|
949
|
+
local_db = "falkordb"
|
|
950
|
+
local_yaml = candidate / "config.yaml"
|
|
951
|
+
if local_yaml.exists():
|
|
952
|
+
try:
|
|
953
|
+
with open(local_yaml) as f:
|
|
954
|
+
raw = yaml.safe_load(f) or {}
|
|
955
|
+
local_db = raw.get("database", "falkordb")
|
|
956
|
+
except Exception:
|
|
957
|
+
pass
|
|
958
|
+
results.append(DiscoveredContext(
|
|
959
|
+
path=str(entry),
|
|
960
|
+
cgc_path=str(candidate),
|
|
961
|
+
repo_name=entry.name,
|
|
962
|
+
database=local_db,
|
|
963
|
+
db_path=str(candidate / "db" / local_db),
|
|
964
|
+
cgcignore_path=str(candidate / ".cgcignore"),
|
|
965
|
+
))
|
|
966
|
+
if depth < max_depth:
|
|
967
|
+
_scan(entry, depth + 1)
|
|
968
|
+
|
|
969
|
+
_scan(start, 1)
|
|
970
|
+
return results
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
# =============================================================================
|
|
974
|
+
# WORKSPACE MAPPINGS (global persistence of CWD -> context path)
|
|
975
|
+
# =============================================================================
|
|
976
|
+
|
|
977
|
+
def _load_workspace_mappings() -> Dict[str, Dict[str, str]]:
|
|
978
|
+
"""Load the ``workspace_mappings`` section from config.yaml."""
|
|
979
|
+
if not CONTEXT_CONFIG_FILE.exists():
|
|
980
|
+
return {}
|
|
981
|
+
try:
|
|
982
|
+
with open(CONTEXT_CONFIG_FILE, "r") as f:
|
|
983
|
+
raw = yaml.safe_load(f) or {}
|
|
984
|
+
return raw.get("workspace_mappings", {}) or {}
|
|
985
|
+
except Exception:
|
|
986
|
+
return {}
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
def _save_workspace_mappings(mappings: Dict[str, Dict[str, str]]) -> None:
|
|
990
|
+
"""Write *mappings* back into the ``workspace_mappings`` key of config.yaml,
|
|
991
|
+
preserving all other keys."""
|
|
992
|
+
ensure_config_dir()
|
|
993
|
+
raw: Dict[str, Any] = {}
|
|
994
|
+
if CONTEXT_CONFIG_FILE.exists():
|
|
995
|
+
try:
|
|
996
|
+
with open(CONTEXT_CONFIG_FILE, "r") as f:
|
|
997
|
+
raw = yaml.safe_load(f) or {}
|
|
998
|
+
except Exception:
|
|
999
|
+
raw = {}
|
|
1000
|
+
raw["workspace_mappings"] = mappings
|
|
1001
|
+
try:
|
|
1002
|
+
with open(CONTEXT_CONFIG_FILE, "w") as f:
|
|
1003
|
+
yaml.dump(raw, f, default_flow_style=False, sort_keys=False)
|
|
1004
|
+
except Exception as e:
|
|
1005
|
+
console.print(f"[red]Error saving workspace mappings: {e}[/red]")
|
|
1006
|
+
|
|
1007
|
+
|
|
1008
|
+
def get_workspace_mapping(cwd: Path) -> Optional[Dict[str, str]]:
|
|
1009
|
+
"""Look up a saved workspace mapping for *cwd*.
|
|
1010
|
+
|
|
1011
|
+
Returns a dict with ``context_path`` and ``database`` keys, or None.
|
|
1012
|
+
"""
|
|
1013
|
+
mappings = _load_workspace_mappings()
|
|
1014
|
+
return mappings.get(str(cwd.resolve()))
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
def save_workspace_mapping(cwd: Path, context_path: Path) -> None:
|
|
1018
|
+
"""Persist an association from *cwd* to a ``.codegraphcontext`` directory."""
|
|
1019
|
+
context_path = context_path.resolve()
|
|
1020
|
+
local_db = "falkordb"
|
|
1021
|
+
local_yaml = context_path / "config.yaml"
|
|
1022
|
+
if local_yaml.exists():
|
|
1023
|
+
try:
|
|
1024
|
+
with open(local_yaml) as f:
|
|
1025
|
+
raw = yaml.safe_load(f) or {}
|
|
1026
|
+
local_db = raw.get("database", "falkordb")
|
|
1027
|
+
except Exception:
|
|
1028
|
+
pass
|
|
1029
|
+
|
|
1030
|
+
mappings = _load_workspace_mappings()
|
|
1031
|
+
mappings[str(cwd.resolve())] = {
|
|
1032
|
+
"context_path": str(context_path),
|
|
1033
|
+
"database": local_db,
|
|
1034
|
+
}
|
|
1035
|
+
_save_workspace_mappings(mappings)
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
def remove_workspace_mapping(cwd: Path) -> bool:
|
|
1039
|
+
"""Delete a saved workspace mapping. Returns True if one was removed."""
|
|
1040
|
+
mappings = _load_workspace_mappings()
|
|
1041
|
+
key = str(cwd.resolve())
|
|
1042
|
+
if key in mappings:
|
|
1043
|
+
del mappings[key]
|
|
1044
|
+
_save_workspace_mappings(mappings)
|
|
1045
|
+
return True
|
|
1046
|
+
return False
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
def list_workspace_mappings() -> Dict[str, Dict[str, str]]:
|
|
1050
|
+
"""Return all saved workspace mappings."""
|
|
1051
|
+
return _load_workspace_mappings()
|
|
@@ -22,7 +22,12 @@ from .tools.graph_builder import GraphBuilder
|
|
|
22
22
|
from .tools.code_finder import CodeFinder
|
|
23
23
|
from .tools.package_resolver import get_local_package_path
|
|
24
24
|
from .utils.debug_log import debug_log, info_logger, error_logger, warning_logger, debug_logger
|
|
25
|
-
from .cli.config_manager import
|
|
25
|
+
from .cli.config_manager import (
|
|
26
|
+
resolve_context,
|
|
27
|
+
discover_child_contexts,
|
|
28
|
+
save_workspace_mapping,
|
|
29
|
+
get_workspace_mapping,
|
|
30
|
+
)
|
|
26
31
|
|
|
27
32
|
# Import Tool Definitions and Handlers
|
|
28
33
|
from .tool_definitions import TOOLS
|
|
@@ -92,15 +97,28 @@ class MCPServer:
|
|
|
92
97
|
running loop or creates a new one.
|
|
93
98
|
cwd: Working directory used for context resolution. Defaults to Path.cwd().
|
|
94
99
|
"""
|
|
100
|
+
self.cwd = (cwd or Path.cwd()).resolve()
|
|
101
|
+
self.discovered_child_contexts: List[dict] = []
|
|
102
|
+
self._context_note_pending = False
|
|
103
|
+
|
|
95
104
|
try:
|
|
96
|
-
ctx = resolve_context(cwd=
|
|
105
|
+
ctx = resolve_context(cwd=self.cwd)
|
|
97
106
|
self.resolved_context = ctx
|
|
98
107
|
|
|
99
108
|
if ctx.database:
|
|
100
109
|
os.environ['CGC_RUNTIME_DB_TYPE'] = ctx.database
|
|
101
110
|
|
|
102
111
|
self.db_manager = get_database_manager(db_path=ctx.db_path)
|
|
103
|
-
self.db_manager.get_driver()
|
|
112
|
+
self.db_manager.get_driver()
|
|
113
|
+
|
|
114
|
+
if not ctx.is_local:
|
|
115
|
+
try:
|
|
116
|
+
children = discover_child_contexts(self.cwd, max_depth=1)
|
|
117
|
+
if children:
|
|
118
|
+
self.discovered_child_contexts = [asdict(c) for c in children]
|
|
119
|
+
self._context_note_pending = True
|
|
120
|
+
except Exception:
|
|
121
|
+
pass
|
|
104
122
|
except ValueError as e:
|
|
105
123
|
raise ValueError(f"Database configuration error: {e}")
|
|
106
124
|
|
|
@@ -220,6 +238,96 @@ class MCPServer:
|
|
|
220
238
|
def get_repository_stats_tool(self, **args) -> Dict[str, Any]:
|
|
221
239
|
return management_handlers.get_repository_stats(self.code_finder, **args)
|
|
222
240
|
|
|
241
|
+
def discover_codegraph_contexts_tool(self, **args) -> Dict[str, Any]:
|
|
242
|
+
scan_path = Path(args.get("path", str(self.cwd))).resolve()
|
|
243
|
+
max_depth = int(args.get("max_depth", 1))
|
|
244
|
+
try:
|
|
245
|
+
children = discover_child_contexts(scan_path, max_depth=max_depth)
|
|
246
|
+
if not children:
|
|
247
|
+
return {
|
|
248
|
+
"status": "no_contexts_found",
|
|
249
|
+
"message": f"No .codegraphcontext folders found under {scan_path} (depth={max_depth}).",
|
|
250
|
+
"contexts": [],
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
"status": "ok",
|
|
254
|
+
"message": f"Found {len(children)} context(s) under {scan_path}.",
|
|
255
|
+
"contexts": [asdict(c) for c in children],
|
|
256
|
+
}
|
|
257
|
+
except Exception as e:
|
|
258
|
+
return {"error": f"Discovery failed: {e}"}
|
|
259
|
+
|
|
260
|
+
def switch_context_tool(self, **args) -> Dict[str, Any]:
|
|
261
|
+
raw_path = args.get("context_path", "")
|
|
262
|
+
should_save = args.get("save", True)
|
|
263
|
+
|
|
264
|
+
if not raw_path:
|
|
265
|
+
return {"error": "context_path is required."}
|
|
266
|
+
|
|
267
|
+
target = Path(raw_path).resolve()
|
|
268
|
+
# Accept either the repo dir or the .codegraphcontext dir directly
|
|
269
|
+
if target.name == ".codegraphcontext":
|
|
270
|
+
cgc_dir = target
|
|
271
|
+
else:
|
|
272
|
+
cgc_dir = target / ".codegraphcontext"
|
|
273
|
+
|
|
274
|
+
if not cgc_dir.exists() or not cgc_dir.is_dir():
|
|
275
|
+
return {"error": f"No .codegraphcontext directory found at {cgc_dir}."}
|
|
276
|
+
|
|
277
|
+
local_db = "falkordb"
|
|
278
|
+
local_yaml = cgc_dir / "config.yaml"
|
|
279
|
+
if local_yaml.exists():
|
|
280
|
+
try:
|
|
281
|
+
import yaml
|
|
282
|
+
with open(local_yaml) as f:
|
|
283
|
+
raw = yaml.safe_load(f) or {}
|
|
284
|
+
local_db = raw.get("database", "falkordb")
|
|
285
|
+
except Exception:
|
|
286
|
+
pass
|
|
287
|
+
|
|
288
|
+
new_db_path = str(cgc_dir / "db" / local_db)
|
|
289
|
+
|
|
290
|
+
try:
|
|
291
|
+
# Tear down old connection
|
|
292
|
+
try:
|
|
293
|
+
self.db_manager.close_driver()
|
|
294
|
+
except Exception:
|
|
295
|
+
pass
|
|
296
|
+
|
|
297
|
+
os.environ['CGC_RUNTIME_DB_TYPE'] = local_db
|
|
298
|
+
new_manager = get_database_manager(db_path=new_db_path)
|
|
299
|
+
new_manager.get_driver()
|
|
300
|
+
|
|
301
|
+
self.db_manager = new_manager
|
|
302
|
+
self.resolved_context = type(self.resolved_context)(
|
|
303
|
+
mode="per-repo",
|
|
304
|
+
context_name="",
|
|
305
|
+
database=local_db,
|
|
306
|
+
db_path=new_db_path,
|
|
307
|
+
cgcignore_path=str(cgc_dir / ".cgcignore"),
|
|
308
|
+
is_local=True,
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
# Rebuild dependent components with the new DB manager
|
|
312
|
+
self.graph_builder = GraphBuilder(self.db_manager, self.job_manager, self.loop)
|
|
313
|
+
self.code_finder = CodeFinder(self.db_manager)
|
|
314
|
+
self.code_watcher = CodeWatcher(self.graph_builder, self.job_manager)
|
|
315
|
+
|
|
316
|
+
if should_save:
|
|
317
|
+
save_workspace_mapping(self.cwd, cgc_dir)
|
|
318
|
+
|
|
319
|
+
self._context_note_pending = False
|
|
320
|
+
|
|
321
|
+
return {
|
|
322
|
+
"status": "ok",
|
|
323
|
+
"message": f"Switched to context at {cgc_dir}.",
|
|
324
|
+
"database": local_db,
|
|
325
|
+
"db_path": new_db_path,
|
|
326
|
+
"saved": should_save,
|
|
327
|
+
}
|
|
328
|
+
except Exception as e:
|
|
329
|
+
return {"error": f"Failed to switch context: {e}"}
|
|
330
|
+
|
|
223
331
|
|
|
224
332
|
async def handle_tool_call(self, tool_name: str, args: Dict[str, Any]) -> Dict[str, Any]:
|
|
225
333
|
"""
|
|
@@ -244,13 +352,29 @@ class MCPServer:
|
|
|
244
352
|
"unwatch_directory": self.unwatch_directory_tool,
|
|
245
353
|
"load_bundle": self.load_bundle_tool,
|
|
246
354
|
"search_registry_bundles": self.search_registry_bundles_tool,
|
|
247
|
-
"get_repository_stats": self.get_repository_stats_tool
|
|
355
|
+
"get_repository_stats": self.get_repository_stats_tool,
|
|
356
|
+
"discover_codegraph_contexts": self.discover_codegraph_contexts_tool,
|
|
357
|
+
"switch_context": self.switch_context_tool,
|
|
248
358
|
}
|
|
249
359
|
handler = tool_map.get(tool_name)
|
|
250
360
|
if handler:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
361
|
+
result = await asyncio.to_thread(handler, **args)
|
|
362
|
+
|
|
363
|
+
if self._context_note_pending and tool_name not in (
|
|
364
|
+
"discover_codegraph_contexts", "switch_context"
|
|
365
|
+
):
|
|
366
|
+
names = [c["repo_name"] for c in self.discovered_child_contexts]
|
|
367
|
+
note = (
|
|
368
|
+
"NOTE: No CodeGraphContext database was found at the current workspace root. "
|
|
369
|
+
f"However, the following child directories have indexed databases: {names}. "
|
|
370
|
+
"Use the `switch_context` tool to connect to one, or "
|
|
371
|
+
"`discover_codegraph_contexts` for a deeper scan."
|
|
372
|
+
)
|
|
373
|
+
if isinstance(result, dict):
|
|
374
|
+
result["_context_discovery_note"] = note
|
|
375
|
+
self._context_note_pending = False
|
|
376
|
+
|
|
377
|
+
return result
|
|
254
378
|
else:
|
|
255
379
|
return {"error": f"Unknown tool: {tool_name}"}
|
|
256
380
|
|
|
@@ -193,5 +193,28 @@ TOOLS = {
|
|
|
193
193
|
"repo_path": {"type": "string", "description": "Optional: Path to a specific repository. If not provided, returns overall database statistics."}
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
+
},
|
|
197
|
+
"discover_codegraph_contexts": {
|
|
198
|
+
"name": "discover_codegraph_contexts",
|
|
199
|
+
"description": "Scan child directories of the current workspace (or a given path) for .codegraphcontext folders that contain indexed code graph databases. Useful when the IDE is opened on a parent folder that itself has no database, but its sub-projects do.",
|
|
200
|
+
"inputSchema": {
|
|
201
|
+
"type": "object",
|
|
202
|
+
"properties": {
|
|
203
|
+
"path": {"type": "string", "description": "Optional: Root directory to scan. Defaults to the server's current working directory."},
|
|
204
|
+
"max_depth": {"type": "integer", "description": "How many levels of child directories to scan. Defaults to 1 (immediate children only).", "default": 1}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"switch_context": {
|
|
209
|
+
"name": "switch_context",
|
|
210
|
+
"description": "Switch the current MCP session to use a different .codegraphcontext database. Provide the path to the repo directory (or its .codegraphcontext/ folder). The server will reconnect to that database so subsequent queries use it. By default the mapping is saved globally for persistence across restarts.",
|
|
211
|
+
"inputSchema": {
|
|
212
|
+
"type": "object",
|
|
213
|
+
"properties": {
|
|
214
|
+
"context_path": {"type": "string", "description": "Path to the repository root that contains a .codegraphcontext/ folder, or directly to the .codegraphcontext/ folder itself."},
|
|
215
|
+
"save": {"type": "boolean", "description": "Whether to persist this mapping so the server reconnects automatically next time. Defaults to true.", "default": True}
|
|
216
|
+
},
|
|
217
|
+
"required": ["context_path"]
|
|
218
|
+
}
|
|
196
219
|
}
|
|
197
220
|
}
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/pipeline.py
RENAMED
|
@@ -30,55 +30,37 @@ async def run_tree_sitter_index_async(
|
|
|
30
30
|
add_minimal_file_node: Callable[[Path, Path, bool], None],
|
|
31
31
|
) -> None:
|
|
32
32
|
"""Parse all discovered files, write symbols, then inheritance + CALLS."""
|
|
33
|
-
wall_start = time.perf_counter()
|
|
34
|
-
|
|
35
33
|
if job_id:
|
|
36
34
|
job_manager.update_job(job_id, status=JobStatus.RUNNING)
|
|
37
35
|
|
|
38
|
-
t0 = time.perf_counter()
|
|
39
36
|
writer.add_repository_to_graph(path, is_dependency)
|
|
40
37
|
repo_name = path.name
|
|
41
|
-
t_repo = time.perf_counter() - t0
|
|
42
38
|
|
|
43
|
-
t0 = time.perf_counter()
|
|
44
39
|
files, _ignore_root = discover_files_to_index(path, cgcignore_path)
|
|
45
|
-
t_discover = time.perf_counter() - t0
|
|
46
40
|
|
|
47
41
|
if job_id:
|
|
48
42
|
job_manager.update_job(job_id, total_files=len(files))
|
|
49
43
|
|
|
50
44
|
debug_log("Starting pre-scan to build imports map...")
|
|
51
|
-
t0 = time.perf_counter()
|
|
52
45
|
imports_map = pre_scan_for_imports(files, parsers.keys(), get_parser)
|
|
53
|
-
t_prescan = time.perf_counter() - t0
|
|
54
46
|
debug_log(f"Pre-scan complete. Found {len(imports_map)} definitions.")
|
|
55
47
|
|
|
56
48
|
all_file_data: List[Dict[str, Any]] = []
|
|
57
49
|
resolved_repo_path_str = str(path.resolve()) if path.is_dir() else str(path.parent.resolve())
|
|
58
50
|
|
|
59
51
|
processed_count = 0
|
|
60
|
-
t_parse_total = 0.0
|
|
61
|
-
t_file_db_total = 0.0
|
|
62
|
-
n_files_seen = 0
|
|
63
52
|
for file in files:
|
|
64
53
|
if not file.is_file():
|
|
65
54
|
continue
|
|
66
|
-
n_files_seen += 1
|
|
67
55
|
if job_id:
|
|
68
56
|
job_manager.update_job(job_id, current_file=str(file))
|
|
69
57
|
repo_path = path.resolve() if path.is_dir() else file.parent.resolve()
|
|
70
|
-
t_parse0 = time.perf_counter()
|
|
71
58
|
file_data = parse_file(repo_path, file, is_dependency)
|
|
72
|
-
t_parse_total += time.perf_counter() - t_parse0
|
|
73
59
|
if "error" not in file_data:
|
|
74
|
-
t_db0 = time.perf_counter()
|
|
75
60
|
writer.add_file_to_graph(file_data, repo_name, imports_map, repo_path_str=resolved_repo_path_str)
|
|
76
|
-
t_file_db_total += time.perf_counter() - t_db0
|
|
77
61
|
all_file_data.append(file_data)
|
|
78
62
|
elif not file_data.get("unsupported"):
|
|
79
|
-
t_db0 = time.perf_counter()
|
|
80
63
|
add_minimal_file_node(file, repo_path, is_dependency)
|
|
81
|
-
t_file_db_total += time.perf_counter() - t_db0
|
|
82
64
|
processed_count += 1
|
|
83
65
|
|
|
84
66
|
if job_id:
|
|
@@ -91,39 +73,17 @@ async def run_tree_sitter_index_async(
|
|
|
91
73
|
f"Starting post-processing phase (inheritance + function calls)..."
|
|
92
74
|
)
|
|
93
75
|
|
|
76
|
+
t0 = time.time()
|
|
94
77
|
info_logger(f"[INHERITS] Resolving inheritance links across {len(all_file_data)} files...")
|
|
95
|
-
t0 = time.perf_counter()
|
|
96
78
|
inheritance_batch, csharp_files = build_inheritance_and_csharp_files(all_file_data, imports_map)
|
|
97
|
-
t_inherit_resolve = time.perf_counter() - t0
|
|
98
|
-
t0 = time.perf_counter()
|
|
99
79
|
writer.write_inheritance_links(inheritance_batch, csharp_files, imports_map)
|
|
100
|
-
|
|
101
|
-
info_logger(
|
|
102
|
-
f"Inheritance: resolve={t_inherit_resolve:.2f}s db={t_inherit_db:.2f}s "
|
|
103
|
-
f"(batch={len(inheritance_batch)}, csharp_files={len(csharp_files)})"
|
|
104
|
-
)
|
|
80
|
+
t1 = time.time()
|
|
81
|
+
info_logger(f"Inheritance links created in {t1 - t0:.1f}s. Starting function calls...")
|
|
105
82
|
|
|
106
|
-
t0 = time.perf_counter()
|
|
107
83
|
groups = build_function_call_groups(all_file_data, imports_map, None)
|
|
108
|
-
t_calls_resolve = time.perf_counter() - t0
|
|
109
|
-
t0 = time.perf_counter()
|
|
110
84
|
writer.write_function_call_groups(*groups)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
info_logger(
|
|
114
|
-
f"Function calls: resolve={t_calls_resolve:.2f}s db={t_calls_db:.2f}s "
|
|
115
|
-
f"({n_call_edges} CALLS edges batched)"
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
wall_total = time.perf_counter() - wall_start
|
|
119
|
-
info_logger(
|
|
120
|
-
"[INDEX] Timing summary (seconds): "
|
|
121
|
-
f"repo_node={t_repo:.3f} discover={t_discover:.3f} pre_scan={t_prescan:.3f} "
|
|
122
|
-
f"parse={t_parse_total:.3f} file_db_writes={t_file_db_total:.3f} "
|
|
123
|
-
f"inherit_resolve={t_inherit_resolve:.3f} inherit_db={t_inherit_db:.3f} "
|
|
124
|
-
f"calls_resolve={t_calls_resolve:.3f} calls_db={t_calls_db:.3f} "
|
|
125
|
-
f"wall_total={wall_total:.3f} | files_seen={n_files_seen} parsed_ok={len(all_file_data)}"
|
|
126
|
-
)
|
|
85
|
+
t2 = time.time()
|
|
86
|
+
info_logger(f"Function calls created in {t2 - t1:.1f}s. Total post-processing: {t2 - t0:.1f}s")
|
|
127
87
|
|
|
128
88
|
if job_id:
|
|
129
89
|
job_manager.update_job(job_id, status=JobStatus.COMPLETED, end_time=datetime.now())
|
|
@@ -81,13 +81,16 @@ async def get_graph(repo_path: Optional[str] = None, cypher_query: Optional[str]
|
|
|
81
81
|
elif repo_path:
|
|
82
82
|
repo_path = str(Path(repo_path).resolve())
|
|
83
83
|
print(f"DEBUG: Fetching subgraph for: {repo_path}", flush=True)
|
|
84
|
+
# Get all nodes within the repository scope
|
|
84
85
|
query = """
|
|
85
86
|
MATCH (r:Repository {path: $repo_path})
|
|
86
87
|
OPTIONAL MATCH (r)-[:CONTAINS*0..]->(n)
|
|
87
|
-
WITH DISTINCT n
|
|
88
|
-
|
|
89
|
-
OPTIONAL MATCH (
|
|
90
|
-
|
|
88
|
+
WITH DISTINCT r, COLLECT(DISTINCT n) as repo_nodes
|
|
89
|
+
UNWIND repo_nodes as node
|
|
90
|
+
OPTIONAL MATCH (node)-[rel]->(target)
|
|
91
|
+
WITH r, node, rel, target, repo_nodes
|
|
92
|
+
WHERE target IN repo_nodes OR target = r
|
|
93
|
+
RETURN node as n, rel, target as m
|
|
91
94
|
"""
|
|
92
95
|
result = session.run(query, repo_path=repo_path)
|
|
93
96
|
else:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
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
|
|
7
7
|
|
|
8
|
-
Copyright (c) 2025
|
|
8
|
+
Copyright (c) 2025-2026
|
|
9
9
|
|
|
10
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
11
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -53,6 +53,7 @@ Requires-Dist: pathspec>=0.12.1
|
|
|
53
53
|
Requires-Dist: falkordb>=0.1.0
|
|
54
54
|
Requires-Dist: requests>=2.28.0
|
|
55
55
|
Requires-Dist: falkordblite>=0.1.0; sys_platform != "win32" and python_version >= "3.12"
|
|
56
|
+
Requires-Dist: kuzu>=0.4.0; sys_platform == "win32" or (sys_platform != "win32" and python_version >= "3.10" and python_version < "3.12")
|
|
56
57
|
Requires-Dist: fastapi>=0.100.0
|
|
57
58
|
Requires-Dist: uvicorn>=0.22.0
|
|
58
59
|
Provides-Extra: parsing
|
|
@@ -164,7 +165,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
164
165
|
---
|
|
165
166
|
|
|
166
167
|
## Project Details
|
|
167
|
-
- **Version:** 0.4.
|
|
168
|
+
- **Version:** 0.4.3
|
|
168
169
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
169
170
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
170
171
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext.egg-info/requires.txt
RENAMED
|
@@ -20,6 +20,9 @@ uvicorn>=0.22.0
|
|
|
20
20
|
[:sys_platform != "win32" and python_version >= "3.12"]
|
|
21
21
|
falkordblite>=0.1.0
|
|
22
22
|
|
|
23
|
+
[:sys_platform == "win32" or (sys_platform != "win32" and python_version >= "3.10" and python_version < "3.12")]
|
|
24
|
+
kuzu>=0.4.0
|
|
25
|
+
|
|
23
26
|
[dev]
|
|
24
27
|
pytest>=7.4.0
|
|
25
28
|
black>=23.11.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/cli/registry_commands.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/bundle_registry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/database_falkordb.py
RENAMED
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/database_kuzu.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/core/falkor_worker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/graph_builder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/__init__.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/constants.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/discovery.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/pre_scan.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/sanitize.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/indexing/schema.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/cpp.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/csharp.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/dart.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/elixir.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/go.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/haskell.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/java.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/javascript.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/kotlin.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/perl.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/php.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/python.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/ruby.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/rust.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/scala.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/swift.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/languages/typescript.py
RENAMED
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/package_resolver.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/scip_indexer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/tools/tree_sitter_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/utils/tree_sitter_manager.py
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/utils/visualize_graph.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/placeholder.svg
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext/viz/dist/preview-image.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{codegraphcontext-0.4.1 → codegraphcontext-0.4.3}/src/codegraphcontext.egg-info/top_level.txt
RENAMED
|
File without changes
|