codegraphcontext 0.2.3__tar.gz → 0.2.5__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.2.3/src/codegraphcontext.egg-info → codegraphcontext-0.2.5}/PKG-INFO +2 -3
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/README.md +1 -1
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/pyproject.toml +2 -3
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/setup_wizard.py +8 -3
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/database_falkordb.py +15 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/code_finder.py +57 -6
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/graph_builder.py +18 -5
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5/src/codegraphcontext.egg-info}/PKG-INFO +2 -3
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext.egg-info/requires.txt +0 -1
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/LICENSE +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/MANIFEST.in +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/setup.cfg +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/cli_helpers.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/config_manager.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/main.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/registry_commands.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/bundle_registry.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/cgc_bundle.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/watcher.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/server.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tool_definitions.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/handlers/analysis_handlers.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/c.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/cpp.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/csharp.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/go.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/javascript.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/php.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/python.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/ruby.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/rust.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/typescript.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/utils/visualize_graph.py +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext.egg-info/SOURCES.txt +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
- {codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
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
|
|
@@ -51,7 +51,6 @@ Requires-Dist: nbformat
|
|
|
51
51
|
Requires-Dist: nbconvert>=7.16.6
|
|
52
52
|
Requires-Dist: pathspec>=0.12.1
|
|
53
53
|
Requires-Dist: falkordblite>=0.1.0; sys_platform != "win32" and python_version >= "3.12"
|
|
54
|
-
Requires-Dist: requests
|
|
55
54
|
Provides-Extra: parsing
|
|
56
55
|
Requires-Dist: tree-sitter>=0.21.0; extra == "parsing"
|
|
57
56
|
Requires-Dist: tree-sitter-language-pack>=0.6.0; extra == "parsing"
|
|
@@ -147,7 +146,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
147
146
|
---
|
|
148
147
|
|
|
149
148
|
## Project Details
|
|
150
|
-
- **Version:** 0.2.
|
|
149
|
+
- **Version:** 0.2.5
|
|
151
150
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
152
151
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
153
152
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
@@ -84,7 +84,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
84
84
|
---
|
|
85
85
|
|
|
86
86
|
## Project Details
|
|
87
|
-
- **Version:** 0.2.
|
|
87
|
+
- **Version:** 0.2.5
|
|
88
88
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
89
89
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
90
90
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codegraphcontext"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.5"
|
|
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"
|
|
@@ -29,8 +29,7 @@ dependencies = [
|
|
|
29
29
|
"nbformat",
|
|
30
30
|
"nbconvert>=7.16.6",
|
|
31
31
|
"pathspec>=0.12.1",
|
|
32
|
-
"falkordblite>=0.1.0; sys_platform != 'win32' and python_version >= '3.12'"
|
|
33
|
-
"requests"
|
|
32
|
+
"falkordblite>=0.1.0; sys_platform != 'win32' and python_version >= '3.12'"
|
|
34
33
|
]
|
|
35
34
|
|
|
36
35
|
[project.optional-dependencies]
|
|
@@ -140,7 +140,7 @@ def _configure_ide(mcp_config):
|
|
|
140
140
|
questions = [
|
|
141
141
|
{
|
|
142
142
|
"type": "confirm",
|
|
143
|
-
"message": "Automatically configure your IDE/CLI (VS Code, Cursor, Windsurf, Claude, Gemini, Cline, RooCode, ChatGPT Codex, Amazon Q Developer, Aider, Kiro)?",
|
|
143
|
+
"message": "Automatically configure your IDE/CLI (VS Code, Cursor, Windsurf, Claude, Gemini, Cline, RooCode, ChatGPT Codex, Amazon Q Developer, Aider, Kiro, Antigravity)?",
|
|
144
144
|
"name": "configure_ide",
|
|
145
145
|
"default": True,
|
|
146
146
|
}
|
|
@@ -154,7 +154,7 @@ def _configure_ide(mcp_config):
|
|
|
154
154
|
{
|
|
155
155
|
"type": "list",
|
|
156
156
|
"message": "Choose your IDE/CLI to configure:",
|
|
157
|
-
"choices": ["VS Code", "Cursor", "Windsurf", "Claude code", "Gemini CLI", "ChatGPT Codex", "Cline", "RooCode", "Amazon Q Developer", "JetBrainsAI", "Aider", "Kiro", "None of the above"],
|
|
157
|
+
"choices": ["VS Code", "Cursor", "Windsurf", "Claude code", "Gemini CLI", "ChatGPT Codex", "Cline", "RooCode", "Amazon Q Developer", "JetBrainsAI", "Aider", "Kiro", "Antigravity", "None of the above"],
|
|
158
158
|
"name": "ide_choice",
|
|
159
159
|
}
|
|
160
160
|
]
|
|
@@ -166,7 +166,7 @@ def _configure_ide(mcp_config):
|
|
|
166
166
|
return
|
|
167
167
|
|
|
168
168
|
|
|
169
|
-
if ide_choice in ["VS Code", "Cursor
|
|
169
|
+
if ide_choice in ["VS Code", "Cursor", "Claude code", "Gemini CLI", "ChatGPT Codex", "Cline", "Windsurf", "RooCode", "Amazon Q Developer", "JetBrainsAI", "Aider", "Kiro", "Antigravity"]:
|
|
170
170
|
console.print(f"\n[bold cyan]Configuring for {ide_choice}...[/bold cyan]")
|
|
171
171
|
|
|
172
172
|
if ide_choice == "Amazon Q Developer":
|
|
@@ -229,6 +229,11 @@ def _configure_ide(mcp_config):
|
|
|
229
229
|
Path.home() / ".kiro" / "settings" / "mcp.json", # macOS / Linux / Windows (user-level global)
|
|
230
230
|
Path.home() / ".config" / "kiro" / "settings" / "mcp.json", # Linux (XDG config)
|
|
231
231
|
Path.home() / "AppData" / "Roaming" / "Kiro" / "settings" / "mcp.json", # Windows
|
|
232
|
+
],
|
|
233
|
+
"Antigravity": [
|
|
234
|
+
Path.home() / ".antigravity" / "mcp_settings.json", # macOS / Linux / Windows (user-level global)
|
|
235
|
+
Path.home() / ".config" / "antigravity" / "mcp_settings.json", # Linux (XDG config)
|
|
236
|
+
Path.home() / "AppData" / "Roaming" / "Antigravity" / "mcp_settings.json", # Windows
|
|
232
237
|
]
|
|
233
238
|
}
|
|
234
239
|
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/database_falkordb.py
RENAMED
|
@@ -15,6 +15,21 @@ from typing import Optional, Tuple
|
|
|
15
15
|
|
|
16
16
|
from codegraphcontext.utils.debug_log import debug_log, info_logger, error_logger, warning_logger
|
|
17
17
|
|
|
18
|
+
# ---------------------------------------------------------------------------
|
|
19
|
+
# Compatibility patch: redis-py >= 5.x added OpenTelemetry error telemetry that
|
|
20
|
+
# accesses conn.port inside its error handler. UnixDomainSocketConnection never
|
|
21
|
+
# had a 'port' attribute, so any exception raised during a Unix-socket connection
|
|
22
|
+
# (e.g. the sentinel-detection INFO call inside FalkorDB.__init__) would produce
|
|
23
|
+
# a secondary AttributeError masking the real problem.
|
|
24
|
+
# Patching the class at import time costs nothing and fixes all call-sites.
|
|
25
|
+
# ---------------------------------------------------------------------------
|
|
26
|
+
try:
|
|
27
|
+
from redis.connection import UnixDomainSocketConnection as _UDSC
|
|
28
|
+
if not hasattr(_UDSC, 'port'):
|
|
29
|
+
_UDSC.port = 0 # type: ignore[attr-defined]
|
|
30
|
+
except Exception:
|
|
31
|
+
pass # redis not installed or class structure changed — safe to ignore
|
|
32
|
+
|
|
18
33
|
class FalkorDBManager:
|
|
19
34
|
"""
|
|
20
35
|
Manages the FalkorDB Lite database connection as a singleton.
|
|
@@ -14,9 +14,22 @@ class CodeFinder:
|
|
|
14
14
|
def __init__(self, db_manager: DatabaseManager):
|
|
15
15
|
self.db_manager = db_manager
|
|
16
16
|
self.driver = self.db_manager.get_driver()
|
|
17
|
+
self._is_falkordb = getattr(db_manager, 'get_backend_type', lambda: 'neo4j')() != 'neo4j'
|
|
17
18
|
|
|
18
19
|
def format_query(self, find_by: Literal["Class", "Function"], fuzzy_search:bool) -> str:
|
|
19
20
|
"""Format the search query based on the search type and fuzzy search settings."""
|
|
21
|
+
if self._is_falkordb:
|
|
22
|
+
# FalkorDB does not support CALL db.idx.fulltext.queryNodes.
|
|
23
|
+
# Fall back to a pure Cypher CONTAINS/toLower match on node name.
|
|
24
|
+
name_filter = "toLower(node.name) CONTAINS toLower($search_term)"
|
|
25
|
+
return f"""
|
|
26
|
+
MATCH (node:{find_by})
|
|
27
|
+
WHERE {name_filter}
|
|
28
|
+
RETURN node.name as name, node.path as path, node.line_number as line_number,
|
|
29
|
+
node.source as source, node.docstring as docstring, node.is_dependency as is_dependency
|
|
30
|
+
ORDER BY node.is_dependency ASC, node.name
|
|
31
|
+
LIMIT 20
|
|
32
|
+
"""
|
|
20
33
|
return f"""
|
|
21
34
|
CALL db.index.fulltext.queryNodes("code_search_index", $search_term) YIELD node, score
|
|
22
35
|
WITH node, score
|
|
@@ -40,8 +53,10 @@ class CodeFinder:
|
|
|
40
53
|
""", name=search_term)
|
|
41
54
|
return result.data()
|
|
42
55
|
|
|
43
|
-
# Fuzzy search using fulltext index
|
|
44
|
-
|
|
56
|
+
# Fuzzy search using fulltext index (Neo4j) or CONTAINS fallback (FalkorDB)
|
|
57
|
+
# On FalkorDB, format_query uses CONTAINS so we pass the raw term; on Neo4j
|
|
58
|
+
# we need the Lucene field-selector prefix.
|
|
59
|
+
formatted_search_term = search_term if self._is_falkordb else f"name:{search_term}"
|
|
45
60
|
result = session.run(self.format_query("Function", fuzzy_search), search_term=formatted_search_term)
|
|
46
61
|
return result.data()
|
|
47
62
|
|
|
@@ -58,8 +73,10 @@ class CodeFinder:
|
|
|
58
73
|
""", name=search_term)
|
|
59
74
|
return result.data()
|
|
60
75
|
|
|
61
|
-
# Fuzzy search using fulltext index
|
|
62
|
-
|
|
76
|
+
# Fuzzy search using fulltext index (Neo4j) or CONTAINS fallback (FalkorDB)
|
|
77
|
+
# On FalkorDB, format_query uses CONTAINS so we pass the raw term; on Neo4j
|
|
78
|
+
# we need the Lucene field-selector prefix.
|
|
79
|
+
formatted_search_term = search_term if self._is_falkordb else f"name:{search_term}"
|
|
63
80
|
result = session.run(self.format_query("Class", fuzzy_search), search_term=formatted_search_term)
|
|
64
81
|
return result.data()
|
|
65
82
|
|
|
@@ -79,6 +96,8 @@ class CodeFinder:
|
|
|
79
96
|
|
|
80
97
|
def find_by_content(self, search_term: str) -> List[Dict]:
|
|
81
98
|
"""Find code by content matching in source or docstrings using the full-text index."""
|
|
99
|
+
if self._is_falkordb:
|
|
100
|
+
return self._find_by_content_falkordb(search_term)
|
|
82
101
|
with self.driver.session() as session:
|
|
83
102
|
result = session.run("""
|
|
84
103
|
CALL db.index.fulltext.queryNodes("code_search_index", $search_term) YIELD node, score
|
|
@@ -86,10 +105,10 @@ class CodeFinder:
|
|
|
86
105
|
WHERE node:Function OR node:Class OR node:Variable
|
|
87
106
|
MATCH (node)<-[:CONTAINS]-(f:File)
|
|
88
107
|
RETURN
|
|
89
|
-
CASE
|
|
108
|
+
CASE
|
|
90
109
|
WHEN node:Function THEN 'function'
|
|
91
110
|
WHEN node:Class THEN 'class'
|
|
92
|
-
ELSE 'variable'
|
|
111
|
+
ELSE 'variable'
|
|
93
112
|
END as type,
|
|
94
113
|
node.name as name, f.path as path,
|
|
95
114
|
node.line_number as line_number, node.source as source,
|
|
@@ -98,6 +117,32 @@ class CodeFinder:
|
|
|
98
117
|
LIMIT 20
|
|
99
118
|
""", search_term=search_term)
|
|
100
119
|
return result.data()
|
|
120
|
+
|
|
121
|
+
def _find_by_content_falkordb(self, search_term: str) -> List[Dict]:
|
|
122
|
+
"""FalkorDB-compatible content search using pure Cypher CONTAINS matching.
|
|
123
|
+
FalkorDB does not support CALL db.idx.fulltext.queryNodes, so we fall back
|
|
124
|
+
to substring matching on name, source, and docstring fields."""
|
|
125
|
+
all_results = []
|
|
126
|
+
with self.driver.session() as session:
|
|
127
|
+
for label, type_name in [('Function', 'function'), ('Class', 'class')]:
|
|
128
|
+
try:
|
|
129
|
+
result = session.run(f"""
|
|
130
|
+
MATCH (node:{label})
|
|
131
|
+
WHERE toLower(node.name) CONTAINS toLower($search_term)
|
|
132
|
+
OR (node.source IS NOT NULL AND toLower(node.source) CONTAINS toLower($search_term))
|
|
133
|
+
OR (node.docstring IS NOT NULL AND toLower(node.docstring) CONTAINS toLower($search_term))
|
|
134
|
+
RETURN
|
|
135
|
+
'{type_name}' as type,
|
|
136
|
+
node.name as name, node.path as path,
|
|
137
|
+
node.line_number as line_number, node.source as source,
|
|
138
|
+
node.docstring as docstring, node.is_dependency as is_dependency
|
|
139
|
+
ORDER BY node.is_dependency ASC, node.name
|
|
140
|
+
LIMIT 20
|
|
141
|
+
""", search_term=search_term)
|
|
142
|
+
all_results.extend(result.data())
|
|
143
|
+
except Exception:
|
|
144
|
+
logger.debug(f"FalkorDB content query failed for label {label}", exc_info=True)
|
|
145
|
+
return all_results[:20]
|
|
101
146
|
|
|
102
147
|
def find_by_module_name(self, search_term: str) -> List[Dict]:
|
|
103
148
|
"""Find modules by name matching"""
|
|
@@ -130,6 +175,12 @@ class CodeFinder:
|
|
|
130
175
|
|
|
131
176
|
def find_related_code(self, user_query: str, fuzzy_search: bool, edit_distance: int) -> Dict[str, Any]:
|
|
132
177
|
"""Find code related to a query using multiple search strategies"""
|
|
178
|
+
# FalkorDB does not support Lucene-style fuzzy edit-distance syntax (e.g. term~2).
|
|
179
|
+
# On FalkorDB, always use the plain query so that the CONTAINS-based fallbacks work.
|
|
180
|
+
if fuzzy_search and self._is_falkordb:
|
|
181
|
+
logger.debug("FalkorDB backend: ignoring fuzzy edit-distance normalisation; using plain CONTAINS search.")
|
|
182
|
+
fuzzy_search = False
|
|
183
|
+
|
|
133
184
|
if fuzzy_search:
|
|
134
185
|
user_query_normalized = " ".join(map(lambda x: f"{x}~{edit_distance}", user_query.split(" ")))
|
|
135
186
|
else:
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/graph_builder.py
RENAMED
|
@@ -105,6 +105,7 @@ class GraphBuilder:
|
|
|
105
105
|
'.cpp': TreeSitterParser('cpp'),
|
|
106
106
|
'.h': TreeSitterParser('cpp'),
|
|
107
107
|
'.hpp': TreeSitterParser('cpp'),
|
|
108
|
+
'.hh': TreeSitterParser('cpp'),
|
|
108
109
|
'.rs': TreeSitterParser('rust'),
|
|
109
110
|
'.c': TreeSitterParser('c'),
|
|
110
111
|
# '.h': TreeSitterParser('c'), # Need to write an algo for distinguishing C vs C++ headers
|
|
@@ -149,11 +150,20 @@ class GraphBuilder:
|
|
|
149
150
|
session.run("CREATE INDEX function_lang IF NOT EXISTS FOR (f:Function) ON (f.lang)")
|
|
150
151
|
session.run("CREATE INDEX class_lang IF NOT EXISTS FOR (c:Class) ON (c.lang)")
|
|
151
152
|
session.run("CREATE INDEX annotation_lang IF NOT EXISTS FOR (a:Annotation) ON (a.lang)")
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
is_falkordb = getattr(self.db_manager, 'get_backend_type', lambda: 'neo4j')() != 'neo4j'
|
|
154
|
+
if is_falkordb:
|
|
155
|
+
# FalkorDB uses db.idx.fulltext.createNodeIndex per label
|
|
156
|
+
for label in ['Function', 'Class']:
|
|
157
|
+
try:
|
|
158
|
+
session.run(f"CALL db.idx.fulltext.createNodeIndex('{label}', 'name', 'source', 'docstring')")
|
|
159
|
+
except Exception:
|
|
160
|
+
pass # Index may already exist
|
|
161
|
+
else:
|
|
162
|
+
session.run("""
|
|
163
|
+
CREATE FULLTEXT INDEX code_search_index IF NOT EXISTS
|
|
164
|
+
FOR (n:Function|Class|Variable)
|
|
165
|
+
ON EACH [n.name, n.source, n.docstring]
|
|
166
|
+
""")
|
|
157
167
|
|
|
158
168
|
info_logger("Database schema verified/created successfully")
|
|
159
169
|
except Exception as e:
|
|
@@ -209,6 +219,9 @@ class GraphBuilder:
|
|
|
209
219
|
if '.hpp' in files_by_lang:
|
|
210
220
|
from .languages import cpp as cpp_lang_module
|
|
211
221
|
imports_map.update(cpp_lang_module.pre_scan_cpp(files_by_lang['.hpp'], self.parsers['.hpp']))
|
|
222
|
+
if '.hh' in files_by_lang:
|
|
223
|
+
from .languages import cpp as cpp_lang_module
|
|
224
|
+
imports_map.update(cpp_lang_module.pre_scan_cpp(files_by_lang['.hh'], self.parsers['.hh']))
|
|
212
225
|
if '.rs' in files_by_lang:
|
|
213
226
|
from .languages import rust as rust_lang_module
|
|
214
227
|
imports_map.update(rust_lang_module.pre_scan_rust(files_by_lang['.rs'], self.parsers['.rs']))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
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
|
|
@@ -51,7 +51,6 @@ Requires-Dist: nbformat
|
|
|
51
51
|
Requires-Dist: nbconvert>=7.16.6
|
|
52
52
|
Requires-Dist: pathspec>=0.12.1
|
|
53
53
|
Requires-Dist: falkordblite>=0.1.0; sys_platform != "win32" and python_version >= "3.12"
|
|
54
|
-
Requires-Dist: requests
|
|
55
54
|
Provides-Extra: parsing
|
|
56
55
|
Requires-Dist: tree-sitter>=0.21.0; extra == "parsing"
|
|
57
56
|
Requires-Dist: tree-sitter-language-pack>=0.6.0; extra == "parsing"
|
|
@@ -147,7 +146,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
147
146
|
---
|
|
148
147
|
|
|
149
148
|
## Project Details
|
|
150
|
-
- **Version:** 0.2.
|
|
149
|
+
- **Version:** 0.2.5
|
|
151
150
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
152
151
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
153
152
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/config_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/cli/registry_commands.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/core/bundle_registry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/cpp.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/csharp.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/go.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/haskell.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/java.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/javascript.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/kotlin.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/php.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/python.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/ruby.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/rust.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/scala.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/swift.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/tools/languages/typescript.py
RENAMED
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/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.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/utils/tree_sitter_manager.py
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext/utils/visualize_graph.py
RENAMED
|
File without changes
|
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{codegraphcontext-0.2.3 → codegraphcontext-0.2.5}/src/codegraphcontext.egg-info/top_level.txt
RENAMED
|
File without changes
|