codegraphcontext 0.4.3__tar.gz → 0.4.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.4.3/src/codegraphcontext.egg-info → codegraphcontext-0.4.5}/PKG-INFO +16 -15
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/README.md +6 -6
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/pyproject.toml +10 -9
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/cli/cli_helpers.py +15 -3
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/cli/main.py +2 -2
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/__init__.py +3 -3
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/database_kuzu.py +24 -4
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/watcher.py +92 -12
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/code_finder.py +36 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/persistence/writer.py +13 -4
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/resolution/calls.py +13 -4
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/dart.py +110 -16
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/python.py +37 -1
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/scip_indexer.py +4 -2
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/tree_sitter_parser.py +5 -4
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/utils/tree_sitter_manager.py +55 -7
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5/src/codegraphcontext.egg-info}/PKG-INFO +16 -15
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext.egg-info/requires.txt +11 -6
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/LICENSE +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/MANIFEST.in +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/setup.cfg +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/cli/config_manager.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/cli/registry_commands.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/cli/setup_wizard.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/bundle_registry.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/cgc_bundle.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/cgcignore.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/database_falkordb.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/jobs.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/server.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tool_definitions.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/graph_builder.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/handlers/analysis_handlers.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/constants.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/pipeline.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/schema.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/schema_contract.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/indexing/scip_pipeline.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/c.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/cpp.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/csharp.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/elixir.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/go.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/javascript.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/kotlin.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/perl.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/php.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/ruby.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/rust.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/typescript.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/scip_pb2.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/utils/path_ignore.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/utils/repo_path.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/utils/visualize_graph.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/assets/__vite-browser-external-9wXp6ZBx.js +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/assets/function-calls-BtRHrqa2.png +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/assets/graph-total-D1fBAugo.png +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/assets/hero-graph-2voMJp2a.jpg +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/assets/hierarchy-DGADo0YT.png +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/assets/index-BJT3EMmQ.js +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/assets/index-DjDPHWki.css +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/assets/parser.worker-CZgm11E5.js +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/assets/tree-sitter-qKYAACSa.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/favicon.ico +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/index.html +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/placeholder.svg +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/preview-image.png +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/robots.txt +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c_sharp.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-core.js +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-cpp.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-dart.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-go.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-java.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-javascript.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-kotlin.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-perl.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-php.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-python.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-ruby.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-rust.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-swift.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-tsx.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter-typescript.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/tree-sitter.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.js +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.wasm +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/viz/server.py +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext.egg-info/SOURCES.txt +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
- {codegraphcontext-0.4.3 → codegraphcontext-0.4.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.4.
|
|
3
|
+
Version: 0.4.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
|
|
@@ -39,27 +39,28 @@ License-File: LICENSE
|
|
|
39
39
|
Requires-Dist: neo4j>=5.15.0
|
|
40
40
|
Requires-Dist: watchdog>=3.0.0
|
|
41
41
|
Requires-Dist: stdlibs>=2023.11.18
|
|
42
|
-
Requires-Dist: typer
|
|
42
|
+
Requires-Dist: typer>=0.9.0
|
|
43
43
|
Requires-Dist: rich>=13.7.0
|
|
44
44
|
Requires-Dist: inquirerpy>=0.3.4
|
|
45
45
|
Requires-Dist: python-dotenv>=1.0.0
|
|
46
|
-
Requires-Dist: tree-sitter>=0.21.0
|
|
47
|
-
Requires-Dist: tree-sitter-language-pack>=0.6.0
|
|
48
|
-
Requires-Dist: tree-sitter-c-sharp>=0.21.0
|
|
46
|
+
Requires-Dist: tree-sitter>=0.21.0; python_version != "3.13"
|
|
47
|
+
Requires-Dist: tree-sitter-language-pack>=0.6.0; python_version != "3.13"
|
|
48
|
+
Requires-Dist: tree-sitter-c-sharp>=0.21.0; python_version != "3.13"
|
|
49
49
|
Requires-Dist: pyyaml
|
|
50
50
|
Requires-Dist: nbformat
|
|
51
51
|
Requires-Dist: nbconvert>=7.16.6
|
|
52
52
|
Requires-Dist: pathspec>=0.12.1
|
|
53
53
|
Requires-Dist: falkordb>=0.1.0
|
|
54
54
|
Requires-Dist: requests>=2.28.0
|
|
55
|
+
Requires-Dist: protobuf<3.21,>=3.20
|
|
55
56
|
Requires-Dist: falkordblite>=0.1.0; sys_platform != "win32" and python_version >= "3.12"
|
|
56
|
-
Requires-Dist:
|
|
57
|
+
Requires-Dist: real_ladybug; sys_platform == "win32" or (sys_platform != "win32" and python_version >= "3.10")
|
|
57
58
|
Requires-Dist: fastapi>=0.100.0
|
|
58
59
|
Requires-Dist: uvicorn>=0.22.0
|
|
59
60
|
Provides-Extra: parsing
|
|
60
|
-
Requires-Dist: tree-sitter>=0.21.0; extra == "parsing"
|
|
61
|
-
Requires-Dist: tree-sitter-language-pack>=0.6.0; extra == "parsing"
|
|
62
|
-
Requires-Dist: tree-sitter-c-sharp>=0.21.0; extra == "parsing"
|
|
61
|
+
Requires-Dist: tree-sitter>=0.21.0; python_version != "3.13" and extra == "parsing"
|
|
62
|
+
Requires-Dist: tree-sitter-language-pack>=0.6.0; python_version != "3.13" and extra == "parsing"
|
|
63
|
+
Requires-Dist: tree-sitter-c-sharp>=0.21.0; python_version != "3.13" and extra == "parsing"
|
|
63
64
|
Provides-Extra: dev
|
|
64
65
|
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
65
66
|
Requires-Dist: black>=23.11.0; extra == "dev"
|
|
@@ -165,7 +166,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
|
|
|
165
166
|
---
|
|
166
167
|
|
|
167
168
|
## Project Details
|
|
168
|
-
- **Version:** 0.4.
|
|
169
|
+
- **Version:** 0.4.5
|
|
169
170
|
- **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
170
171
|
- **License:** MIT License (See [LICENSE](LICENSE) for details)
|
|
171
172
|
- **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
|
|
@@ -228,7 +229,7 @@ CodeGraphContext supports multiple graph database backends to suit your environm
|
|
|
228
229
|
| **Setup** | Zero-config / Embedded | Zero-config / In-process | Docker / External |
|
|
229
230
|
| **Platform** | **All (Windows Native, macOS, Linux)** | Unix-only (Linux/macOS/WSL) | All Platforms |
|
|
230
231
|
| **Use Case** | Desktop, IDE, Local development | Specialized Unix development | Enterprise, Massive graphs |
|
|
231
|
-
| **Requirement**| `pip install
|
|
232
|
+
| **Requirement**| `pip install real_ladybug` | `pip install falkordblite` | Neo4j Server / Docker |
|
|
232
233
|
| **Speed** | ⚡ Extremely Fast | ⚡ Fast | 🚀 Scalable |
|
|
233
234
|
| **Persistence**| Yes (to disk) | Yes (to disk) | Yes (to disk) |
|
|
234
235
|
|
|
@@ -251,12 +252,12 @@ _If you’re using CodeGraphContext in your project, feel free to open a PR and
|
|
|
251
252
|
- `neo4j>=5.15.0`
|
|
252
253
|
- `watchdog>=3.0.0`
|
|
253
254
|
- `stdlibs>=2023.11.18`
|
|
254
|
-
- `typer
|
|
255
|
+
- `typer>=0.9.0`
|
|
255
256
|
- `rich>=13.7.0`
|
|
256
257
|
- `inquirerpy>=0.3.7`
|
|
257
258
|
- `python-dotenv>=1.0.0`
|
|
258
|
-
- `tree-sitter>=0.21.0`
|
|
259
|
-
- `tree-sitter-language-pack>=0.6.0`
|
|
259
|
+
- `tree-sitter>=0.21.0` (not installed on Python 3.13)
|
|
260
|
+
- `tree-sitter-language-pack>=0.6.0` (not installed on Python 3.13)
|
|
260
261
|
- `pyyaml`
|
|
261
262
|
- `pytest`
|
|
262
263
|
- `nbformat`
|
|
@@ -339,7 +340,7 @@ Use CodeGraphContext as an **MCP server** for AI assistants:
|
|
|
339
340
|
|
|
340
341
|
2. **Database Setup (Automatic)**
|
|
341
342
|
|
|
342
|
-
- **KùzuDB (default on Windows):** Runs natively on Windows, macOS, and Linux. On Windows it is the usual embedded choice; `pip install
|
|
343
|
+
- **KùzuDB (default on Windows):** Runs natively on Windows, macOS, and Linux. On Windows it is the usual embedded choice; `pip install real_ladybug` if needed.
|
|
343
344
|
- **FalkorDB Lite (typical default on Unix):** When Python 3.12+ and `falkordblite` are available on Unix/macOS/WSL, the embedded backend prefers FalkorDB Lite; otherwise KùzuDB is used.
|
|
344
345
|
- **Neo4j (Alternative):** To use Neo4j instead, or if you prefer a server-based approach, run: `cgc neo4j setup`
|
|
345
346
|
|
|
@@ -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.5
|
|
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/)
|
|
@@ -160,7 +160,7 @@ CodeGraphContext supports multiple graph database backends to suit your environm
|
|
|
160
160
|
| **Setup** | Zero-config / Embedded | Zero-config / In-process | Docker / External |
|
|
161
161
|
| **Platform** | **All (Windows Native, macOS, Linux)** | Unix-only (Linux/macOS/WSL) | All Platforms |
|
|
162
162
|
| **Use Case** | Desktop, IDE, Local development | Specialized Unix development | Enterprise, Massive graphs |
|
|
163
|
-
| **Requirement**| `pip install
|
|
163
|
+
| **Requirement**| `pip install real_ladybug` | `pip install falkordblite` | Neo4j Server / Docker |
|
|
164
164
|
| **Speed** | ⚡ Extremely Fast | ⚡ Fast | 🚀 Scalable |
|
|
165
165
|
| **Persistence**| Yes (to disk) | Yes (to disk) | Yes (to disk) |
|
|
166
166
|
|
|
@@ -183,12 +183,12 @@ _If you’re using CodeGraphContext in your project, feel free to open a PR and
|
|
|
183
183
|
- `neo4j>=5.15.0`
|
|
184
184
|
- `watchdog>=3.0.0`
|
|
185
185
|
- `stdlibs>=2023.11.18`
|
|
186
|
-
- `typer
|
|
186
|
+
- `typer>=0.9.0`
|
|
187
187
|
- `rich>=13.7.0`
|
|
188
188
|
- `inquirerpy>=0.3.7`
|
|
189
189
|
- `python-dotenv>=1.0.0`
|
|
190
|
-
- `tree-sitter>=0.21.0`
|
|
191
|
-
- `tree-sitter-language-pack>=0.6.0`
|
|
190
|
+
- `tree-sitter>=0.21.0` (not installed on Python 3.13)
|
|
191
|
+
- `tree-sitter-language-pack>=0.6.0` (not installed on Python 3.13)
|
|
192
192
|
- `pyyaml`
|
|
193
193
|
- `pytest`
|
|
194
194
|
- `nbformat`
|
|
@@ -271,7 +271,7 @@ Use CodeGraphContext as an **MCP server** for AI assistants:
|
|
|
271
271
|
|
|
272
272
|
2. **Database Setup (Automatic)**
|
|
273
273
|
|
|
274
|
-
- **KùzuDB (default on Windows):** Runs natively on Windows, macOS, and Linux. On Windows it is the usual embedded choice; `pip install
|
|
274
|
+
- **KùzuDB (default on Windows):** Runs natively on Windows, macOS, and Linux. On Windows it is the usual embedded choice; `pip install real_ladybug` if needed.
|
|
275
275
|
- **FalkorDB Lite (typical default on Unix):** When Python 3.12+ and `falkordblite` are available on Unix/macOS/WSL, the embedded backend prefers FalkorDB Lite; otherwise KùzuDB is used.
|
|
276
276
|
- **Neo4j (Alternative):** To use Neo4j instead, or if you prefer a server-based approach, run: `cgc neo4j setup`
|
|
277
277
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codegraphcontext"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.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"
|
|
@@ -18,30 +18,31 @@ dependencies = [
|
|
|
18
18
|
"neo4j>=5.15.0",
|
|
19
19
|
"watchdog>=3.0.0",
|
|
20
20
|
"stdlibs>=2023.11.18",
|
|
21
|
-
"typer
|
|
21
|
+
"typer>=0.9.0",
|
|
22
22
|
"rich>=13.7.0",
|
|
23
23
|
"inquirerpy>=0.3.4",
|
|
24
24
|
"python-dotenv>=1.0.0",
|
|
25
|
-
"tree-sitter>=0.21.0",
|
|
26
|
-
"tree-sitter-language-pack>=0.6.0",
|
|
27
|
-
"tree-sitter-c-sharp>=0.21.0",
|
|
25
|
+
"tree-sitter>=0.21.0; python_version != '3.13'",
|
|
26
|
+
"tree-sitter-language-pack>=0.6.0; python_version != '3.13'",
|
|
27
|
+
"tree-sitter-c-sharp>=0.21.0; python_version != '3.13'",
|
|
28
28
|
"pyyaml",
|
|
29
29
|
"nbformat",
|
|
30
30
|
"nbconvert>=7.16.6",
|
|
31
31
|
"pathspec>=0.12.1",
|
|
32
32
|
"falkordb>=0.1.0",
|
|
33
33
|
"requests>=2.28.0",
|
|
34
|
+
"protobuf>=3.20,<3.21",
|
|
34
35
|
"falkordblite>=0.1.0; sys_platform != 'win32' and python_version >= '3.12'",
|
|
35
|
-
"
|
|
36
|
+
"real_ladybug; sys_platform == 'win32' or (sys_platform != 'win32' and python_version >= '3.10')",
|
|
36
37
|
"fastapi>=0.100.0",
|
|
37
38
|
"uvicorn>=0.22.0"
|
|
38
39
|
]
|
|
39
40
|
|
|
40
41
|
[project.optional-dependencies]
|
|
41
42
|
parsing = [
|
|
42
|
-
"tree-sitter>=0.21.0",
|
|
43
|
-
"tree-sitter-language-pack>=0.6.0",
|
|
44
|
-
"tree-sitter-c-sharp>=0.21.0",
|
|
43
|
+
"tree-sitter>=0.21.0; python_version != '3.13'",
|
|
44
|
+
"tree-sitter-language-pack>=0.6.0; python_version != '3.13'",
|
|
45
|
+
"tree-sitter-c-sharp>=0.21.0; python_version != '3.13'",
|
|
45
46
|
]
|
|
46
47
|
dev = [
|
|
47
48
|
"pytest>=7.4.0",
|
|
@@ -721,19 +721,31 @@ def watch_helper(path: str, context: Optional[str] = None):
|
|
|
721
721
|
# Add the directory to watch
|
|
722
722
|
if is_indexed:
|
|
723
723
|
console.print("[green]✓[/green] Already indexed (no initial scan needed)")
|
|
724
|
-
watcher.watch_directory(
|
|
724
|
+
watcher.watch_directory(
|
|
725
|
+
str(path_obj),
|
|
726
|
+
perform_initial_scan=False,
|
|
727
|
+
cgcignore_path=ctx.cgcignore_path,
|
|
728
|
+
)
|
|
725
729
|
else:
|
|
726
730
|
console.print("[yellow]⚠[/yellow] Not indexed yet. Performing initial scan...")
|
|
727
731
|
|
|
728
732
|
# Index the repository first (like MCP does)
|
|
729
733
|
async def do_index():
|
|
730
|
-
await graph_builder.build_graph_from_path_async(
|
|
734
|
+
await graph_builder.build_graph_from_path_async(
|
|
735
|
+
path_obj,
|
|
736
|
+
is_dependency=False,
|
|
737
|
+
cgcignore_path=ctx.cgcignore_path,
|
|
738
|
+
)
|
|
731
739
|
|
|
732
740
|
asyncio.run(do_index())
|
|
733
741
|
console.print("[green]✓[/green] Initial scan complete")
|
|
734
742
|
|
|
735
743
|
# Now start watching (without another scan)
|
|
736
|
-
watcher.watch_directory(
|
|
744
|
+
watcher.watch_directory(
|
|
745
|
+
str(path_obj),
|
|
746
|
+
perform_initial_scan=False,
|
|
747
|
+
cgcignore_path=ctx.cgcignore_path,
|
|
748
|
+
)
|
|
737
749
|
|
|
738
750
|
console.print("[bold green]👀 Monitoring for file changes...[/bold green] (Press Ctrl+C to stop)")
|
|
739
751
|
console.print("[dim]💡 Tip: Open a new terminal window to continue working[/dim]\n")
|
|
@@ -854,11 +854,11 @@ def doctor():
|
|
|
854
854
|
elif default_db == "kuzudb":
|
|
855
855
|
from importlib.util import find_spec
|
|
856
856
|
|
|
857
|
-
if find_spec("
|
|
857
|
+
if find_spec("real_ladybug") is not None:
|
|
858
858
|
console.print(f" [green]✓[/green] KuzuDB is installed")
|
|
859
859
|
else:
|
|
860
860
|
console.print(f" [red]✗[/red] KuzuDB is not installed")
|
|
861
|
-
console.print(f" Run: pip install
|
|
861
|
+
console.print(f" Run: pip install real_ladybug")
|
|
862
862
|
all_checks_passed = False
|
|
863
863
|
else:
|
|
864
864
|
# FalkorDB
|
|
@@ -22,7 +22,7 @@ import importlib.util
|
|
|
22
22
|
def _is_kuzudb_available() -> bool:
|
|
23
23
|
"""Check if KùzuDB is installed."""
|
|
24
24
|
try:
|
|
25
|
-
return importlib.util.find_spec("
|
|
25
|
+
return importlib.util.find_spec("real_ladybug") is not None
|
|
26
26
|
except ImportError:
|
|
27
27
|
return False
|
|
28
28
|
|
|
@@ -70,7 +70,7 @@ def get_database_manager(db_path: Optional[str] = None) -> Union['DatabaseManage
|
|
|
70
70
|
db_type = db_type.lower()
|
|
71
71
|
if db_type == 'kuzudb':
|
|
72
72
|
if not _is_kuzudb_available():
|
|
73
|
-
raise ValueError("Database set to 'kuzudb' but Kùzu is not installed.\nRun 'pip install
|
|
73
|
+
raise ValueError("Database set to 'kuzudb' but Kùzu is not installed.\nRun 'pip install real_ladybug'")
|
|
74
74
|
from .database_kuzu import KuzuDBManager
|
|
75
75
|
info_logger(f"Using KùzuDB (explicit) at {db_path or 'default path'}")
|
|
76
76
|
return KuzuDBManager(db_path=db_path)
|
|
@@ -147,7 +147,7 @@ def get_database_manager(db_path: Optional[str] = None) -> Union['DatabaseManage
|
|
|
147
147
|
return DatabaseManager()
|
|
148
148
|
|
|
149
149
|
error_msg = "No database backend available.\n"
|
|
150
|
-
error_msg += "Recommended: Install KùzuDB for zero-config ('pip install
|
|
150
|
+
error_msg += "Recommended: Install KùzuDB for zero-config ('pip install real_ladybug')\n"
|
|
151
151
|
|
|
152
152
|
if platform.system() != "Windows":
|
|
153
153
|
error_msg += "Alternative: Install FalkorDB Lite ('pip install falkordblite')\n"
|
{codegraphcontext-0.4.3 → codegraphcontext-0.4.5}/src/codegraphcontext/core/database_kuzu.py
RENAMED
|
@@ -66,7 +66,7 @@ class KuzuDBManager:
|
|
|
66
66
|
if self._conn is None:
|
|
67
67
|
with self._lock:
|
|
68
68
|
if self._conn is None:
|
|
69
|
-
import kuzu
|
|
69
|
+
import real_ladybug as kuzu
|
|
70
70
|
max_retries = 5
|
|
71
71
|
for attempt in range(max_retries):
|
|
72
72
|
try:
|
|
@@ -77,7 +77,7 @@ class KuzuDBManager:
|
|
|
77
77
|
info_logger("KùzuDB connection established and schema verified")
|
|
78
78
|
break
|
|
79
79
|
except ImportError:
|
|
80
|
-
error_logger("KùzuDB is not installed. Run 'pip install
|
|
80
|
+
error_logger("KùzuDB is not installed. Run 'pip install real_ladybug'")
|
|
81
81
|
raise ValueError("KùzuDB missing.")
|
|
82
82
|
except Exception as e:
|
|
83
83
|
if "lock" in str(e).lower() and attempt < max_retries - 1:
|
|
@@ -156,6 +156,26 @@ class KuzuDBManager:
|
|
|
156
156
|
warning_logger(f"Kuzu Schema Rel Error ({table_name}): {e}")
|
|
157
157
|
debug_log(f"Kuzu Schema Rel Error ({table_name}): {e}")
|
|
158
158
|
|
|
159
|
+
self._run_schema_migrations()
|
|
160
|
+
|
|
161
|
+
def _run_schema_migrations(self):
|
|
162
|
+
"""Add columns introduced after older local Kùzu databases were created."""
|
|
163
|
+
migrations = [
|
|
164
|
+
("Module", "full_import_name", "STRING"),
|
|
165
|
+
("IMPORTS", "full_import_name", "STRING"),
|
|
166
|
+
("IMPORTS", "imported_name", "STRING"),
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
for table_name, column_name, column_type in migrations:
|
|
170
|
+
try:
|
|
171
|
+
self._conn.execute(f"ALTER TABLE `{table_name}` ADD {column_name} {column_type}")
|
|
172
|
+
except Exception as e:
|
|
173
|
+
err = str(e).lower()
|
|
174
|
+
if "already exists" in err or "duplicate" in err:
|
|
175
|
+
continue
|
|
176
|
+
warning_logger(f"Kuzu Schema Migration Error ({table_name}.{column_name}): {e}")
|
|
177
|
+
debug_log(f"Kuzu Schema Migration Error ({table_name}.{column_name}): {e}")
|
|
178
|
+
|
|
159
179
|
def close_driver(self):
|
|
160
180
|
"""Closes the connection."""
|
|
161
181
|
if self._conn is not None:
|
|
@@ -188,10 +208,10 @@ class KuzuDBManager:
|
|
|
188
208
|
@staticmethod
|
|
189
209
|
def test_connection(db_path: str = None) -> Tuple[bool, Optional[str]]:
|
|
190
210
|
try:
|
|
191
|
-
import kuzu
|
|
211
|
+
import real_ladybug as kuzu
|
|
192
212
|
return True, None
|
|
193
213
|
except ImportError:
|
|
194
|
-
return False, "KùzuDB is not installed. Run 'pip install
|
|
214
|
+
return False, "KùzuDB is not installed. Run 'pip install real_ladybug'"
|
|
195
215
|
|
|
196
216
|
class KuzuDriverWrapper:
|
|
197
217
|
def __init__(self, conn):
|
|
@@ -10,9 +10,13 @@ from watchdog.observers import Observer
|
|
|
10
10
|
from watchdog.events import FileSystemEventHandler
|
|
11
11
|
|
|
12
12
|
if typing.TYPE_CHECKING:
|
|
13
|
+
from pathspec import PathSpec
|
|
13
14
|
from codegraphcontext.tools.graph_builder import GraphBuilder
|
|
14
15
|
from codegraphcontext.core.jobs import JobManager
|
|
15
16
|
|
|
17
|
+
from codegraphcontext.core.cgcignore import build_ignore_spec
|
|
18
|
+
from codegraphcontext.tools.indexing.constants import DEFAULT_IGNORE_PATTERNS
|
|
19
|
+
from codegraphcontext.cli.config_manager import get_config_value
|
|
16
20
|
from codegraphcontext.utils.debug_log import debug_log, info_logger, error_logger, warning_logger
|
|
17
21
|
|
|
18
22
|
class RepositoryEventHandler(FileSystemEventHandler):
|
|
@@ -23,7 +27,15 @@ class RepositoryEventHandler(FileSystemEventHandler):
|
|
|
23
27
|
to build a baseline and then uses this cached state to perform efficient
|
|
24
28
|
updates when files are changed, created, or deleted.
|
|
25
29
|
"""
|
|
26
|
-
def __init__(
|
|
30
|
+
def __init__(
|
|
31
|
+
self,
|
|
32
|
+
graph_builder: "GraphBuilder",
|
|
33
|
+
repo_path: Path,
|
|
34
|
+
debounce_interval=2.0,
|
|
35
|
+
perform_initial_scan: bool = True,
|
|
36
|
+
cgcignore_path: str = None,
|
|
37
|
+
ignore_spec: "PathSpec" = None,
|
|
38
|
+
):
|
|
27
39
|
"""
|
|
28
40
|
Initializes the event handler.
|
|
29
41
|
|
|
@@ -32,12 +44,17 @@ class RepositoryEventHandler(FileSystemEventHandler):
|
|
|
32
44
|
repo_path: The absolute path to the repository directory to watch.
|
|
33
45
|
debounce_interval: The time in seconds to wait for more changes before processing an event.
|
|
34
46
|
perform_initial_scan: Whether to perform an initial scan of the repository.
|
|
47
|
+
cgcignore_path: Optional explicit .cgcignore path from the active context.
|
|
48
|
+
ignore_spec: Optional precompiled ignore spec, useful for tests.
|
|
35
49
|
"""
|
|
36
50
|
super().__init__()
|
|
37
51
|
self.graph_builder = graph_builder
|
|
38
|
-
self.repo_path = repo_path
|
|
52
|
+
self.repo_path = repo_path.resolve()
|
|
39
53
|
self.debounce_interval = debounce_interval
|
|
40
54
|
self.timers = {} # A dictionary to manage debounce timers for file paths.
|
|
55
|
+
self.ignore_root = self.repo_path
|
|
56
|
+
self.ignore_spec = ignore_spec
|
|
57
|
+
self._load_ignore_spec(cgcignore_path)
|
|
41
58
|
|
|
42
59
|
# Caches for the repository's state.
|
|
43
60
|
self.all_file_data = []
|
|
@@ -47,11 +64,65 @@ class RepositoryEventHandler(FileSystemEventHandler):
|
|
|
47
64
|
if perform_initial_scan:
|
|
48
65
|
self._initial_scan()
|
|
49
66
|
|
|
67
|
+
def _load_ignore_spec(self, cgcignore_path: str = None) -> None:
|
|
68
|
+
"""Load .cgcignore rules using the same defaults as repository indexing."""
|
|
69
|
+
if self.ignore_spec is not None:
|
|
70
|
+
return
|
|
71
|
+
try:
|
|
72
|
+
self.ignore_spec, resolved_cgcignore = build_ignore_spec(
|
|
73
|
+
ignore_root=self.ignore_root,
|
|
74
|
+
default_patterns=DEFAULT_IGNORE_PATTERNS,
|
|
75
|
+
explicit_path=cgcignore_path,
|
|
76
|
+
)
|
|
77
|
+
if resolved_cgcignore:
|
|
78
|
+
debug_log(
|
|
79
|
+
f"Watcher using .cgcignore at {resolved_cgcignore} "
|
|
80
|
+
f"(filtering relative to {self.ignore_root})"
|
|
81
|
+
)
|
|
82
|
+
except OSError as e:
|
|
83
|
+
self.ignore_spec = None
|
|
84
|
+
warning_logger(f"Could not load/create watcher .cgcignore: {e}")
|
|
85
|
+
|
|
86
|
+
def _should_ignore(self, path: str | Path) -> bool:
|
|
87
|
+
"""Return True when a path is excluded by .cgcignore or IGNORE_DIRS."""
|
|
88
|
+
path_obj = Path(path).resolve()
|
|
89
|
+
ignore_root = getattr(self, "ignore_root", getattr(self, "repo_path", None))
|
|
90
|
+
|
|
91
|
+
ignore_dirs_str = get_config_value("IGNORE_DIRS") or ""
|
|
92
|
+
if ignore_dirs_str and ignore_root:
|
|
93
|
+
ignore_dirs = {d.strip().lower() for d in ignore_dirs_str.split(",") if d.strip()}
|
|
94
|
+
try:
|
|
95
|
+
parts = {p.lower() for p in path_obj.relative_to(ignore_root).parent.parts}
|
|
96
|
+
if parts.intersection(ignore_dirs):
|
|
97
|
+
return True
|
|
98
|
+
except ValueError:
|
|
99
|
+
pass
|
|
100
|
+
|
|
101
|
+
ignore_spec = getattr(self, "ignore_spec", None)
|
|
102
|
+
if not ignore_spec or not ignore_root:
|
|
103
|
+
return False
|
|
104
|
+
|
|
105
|
+
try:
|
|
106
|
+
rel_path = path_obj.relative_to(ignore_root).as_posix()
|
|
107
|
+
except ValueError:
|
|
108
|
+
return False
|
|
109
|
+
return ignore_spec.match_file(rel_path)
|
|
110
|
+
|
|
111
|
+
def _is_supported_code_file(self, path: str | Path) -> bool:
|
|
112
|
+
path_obj = Path(path)
|
|
113
|
+
return path_obj.is_file() and path_obj.suffix in self.graph_builder.parsers and not self._should_ignore(path_obj)
|
|
114
|
+
|
|
115
|
+
def _iter_supported_files(self) -> list[Path]:
|
|
116
|
+
supported_extensions = self.graph_builder.parsers.keys()
|
|
117
|
+
return [
|
|
118
|
+
f for f in self.repo_path.rglob("*")
|
|
119
|
+
if f.is_file() and f.suffix in supported_extensions and not self._should_ignore(f)
|
|
120
|
+
]
|
|
121
|
+
|
|
50
122
|
def _initial_scan(self):
|
|
51
123
|
"""Scans the entire repository, parses all files, and builds the initial graph."""
|
|
52
124
|
info_logger(f"Performing initial scan for watcher: {self.repo_path}")
|
|
53
|
-
|
|
54
|
-
all_files = [f for f in self.repo_path.rglob("*") if f.is_file() and f.suffix in supported_extensions]
|
|
125
|
+
all_files = self._iter_supported_files()
|
|
55
126
|
|
|
56
127
|
# 1. Pre-scan all files to get a global map of where every symbol is defined.
|
|
57
128
|
self.imports_map = self.graph_builder.pre_scan_imports(all_files)
|
|
@@ -126,6 +197,10 @@ class RepositoryEventHandler(FileSystemEventHandler):
|
|
|
126
197
|
"""
|
|
127
198
|
info_logger(f"File change detected (incremental update): {event_path_str}")
|
|
128
199
|
changed_path = Path(event_path_str)
|
|
200
|
+
if self._should_ignore(changed_path):
|
|
201
|
+
debug_log(f"Ignored watcher update based on .cgcignore: {changed_path}")
|
|
202
|
+
return
|
|
203
|
+
|
|
129
204
|
changed_path_str = str(changed_path.resolve())
|
|
130
205
|
supported_extensions = self.graph_builder.parsers.keys()
|
|
131
206
|
|
|
@@ -160,7 +235,7 @@ class RepositoryEventHandler(FileSystemEventHandler):
|
|
|
160
235
|
subset_file_data = []
|
|
161
236
|
for path_str in affected_paths:
|
|
162
237
|
p = Path(path_str)
|
|
163
|
-
if p.exists() and p.suffix in supported_extensions:
|
|
238
|
+
if p.exists() and p.suffix in supported_extensions and not self._should_ignore(p):
|
|
164
239
|
parsed = self.graph_builder.parse_file(self.repo_path, p)
|
|
165
240
|
if "error" not in parsed:
|
|
166
241
|
subset_file_data.append(parsed)
|
|
@@ -177,22 +252,22 @@ class RepositoryEventHandler(FileSystemEventHandler):
|
|
|
177
252
|
|
|
178
253
|
# The following methods are called by the watchdog observer when a file event occurs.
|
|
179
254
|
def on_created(self, event):
|
|
180
|
-
if not event.is_directory and
|
|
255
|
+
if not event.is_directory and self._is_supported_code_file(event.src_path):
|
|
181
256
|
self._debounce(event.src_path, lambda: self._handle_modification(event.src_path))
|
|
182
257
|
|
|
183
258
|
def on_modified(self, event):
|
|
184
|
-
if not event.is_directory and
|
|
259
|
+
if not event.is_directory and self._is_supported_code_file(event.src_path):
|
|
185
260
|
self._debounce(event.src_path, lambda: self._handle_modification(event.src_path))
|
|
186
261
|
|
|
187
262
|
def on_deleted(self, event):
|
|
188
|
-
if not event.is_directory and Path(event.src_path).suffix in self.graph_builder.parsers:
|
|
263
|
+
if not event.is_directory and Path(event.src_path).suffix in self.graph_builder.parsers and not self._should_ignore(event.src_path):
|
|
189
264
|
self._debounce(event.src_path, lambda: self._handle_modification(event.src_path))
|
|
190
265
|
|
|
191
266
|
def on_moved(self, event):
|
|
192
267
|
if not event.is_directory:
|
|
193
|
-
if Path(event.src_path).suffix in self.graph_builder.parsers:
|
|
268
|
+
if Path(event.src_path).suffix in self.graph_builder.parsers and not self._should_ignore(event.src_path):
|
|
194
269
|
self._debounce(event.src_path, lambda: self._handle_modification(event.src_path))
|
|
195
|
-
if Path(event.dest_path).suffix in self.graph_builder.parsers:
|
|
270
|
+
if Path(event.dest_path).suffix in self.graph_builder.parsers and not self._should_ignore(event.dest_path):
|
|
196
271
|
self._debounce(event.dest_path, lambda: self._handle_modification(event.dest_path))
|
|
197
272
|
|
|
198
273
|
|
|
@@ -207,7 +282,7 @@ class CodeWatcher:
|
|
|
207
282
|
self.watched_paths = set() # Keep track of paths already being watched.
|
|
208
283
|
self.watches = {} # Store watch objects to allow unscheduling
|
|
209
284
|
|
|
210
|
-
def watch_directory(self, path: str, perform_initial_scan: bool = True):
|
|
285
|
+
def watch_directory(self, path: str, perform_initial_scan: bool = True, cgcignore_path: str = None):
|
|
211
286
|
"""Schedules a directory to be watched for changes."""
|
|
212
287
|
path_obj = Path(path).resolve()
|
|
213
288
|
path_str = str(path_obj)
|
|
@@ -217,7 +292,12 @@ class CodeWatcher:
|
|
|
217
292
|
return {"message": f"Path already being watched: {path_str}"}
|
|
218
293
|
|
|
219
294
|
# Create a new, dedicated event handler for this specific repository path.
|
|
220
|
-
event_handler = RepositoryEventHandler(
|
|
295
|
+
event_handler = RepositoryEventHandler(
|
|
296
|
+
self.graph_builder,
|
|
297
|
+
path_obj,
|
|
298
|
+
perform_initial_scan=perform_initial_scan,
|
|
299
|
+
cgcignore_path=cgcignore_path,
|
|
300
|
+
)
|
|
221
301
|
|
|
222
302
|
watch = self.observer.schedule(event_handler, path_str, recursive=True)
|
|
223
303
|
self.watches[path_str] = watch
|
|
@@ -864,6 +864,42 @@ class CodeFinder:
|
|
|
864
864
|
"""Find all dependencies and dependents of a module"""
|
|
865
865
|
with self.driver.session() as session:
|
|
866
866
|
repo_filter = "AND file.path STARTS WITH $repo_path" if repo_path else ""
|
|
867
|
+
backend = getattr(self.db_manager, "get_backend_type", lambda: "")()
|
|
868
|
+
|
|
869
|
+
# KuzuDB is stricter about OPTIONAL MATCH variable scoping, and nested
|
|
870
|
+
# repository ownership is already represented in the file path.
|
|
871
|
+
if backend == "kuzudb":
|
|
872
|
+
importers_result = session.run(f"""
|
|
873
|
+
MATCH (file:File)-[imp:IMPORTS]->(module:Module)
|
|
874
|
+
WHERE (module.name = $module_name OR module.full_import_name CONTAINS $module_name) {repo_filter}
|
|
875
|
+
RETURN DISTINCT
|
|
876
|
+
file.path as importer_file_path,
|
|
877
|
+
imp.line_number as import_line_number,
|
|
878
|
+
file.is_dependency as file_is_dependency,
|
|
879
|
+
'' as repository_name
|
|
880
|
+
ORDER BY file_is_dependency ASC, importer_file_path
|
|
881
|
+
LIMIT 50
|
|
882
|
+
""", module_name=module_name, repo_path=repo_path)
|
|
883
|
+
|
|
884
|
+
imports_result = session.run(f"""
|
|
885
|
+
MATCH (file:File)-[:IMPORTS]->(target_module:Module)
|
|
886
|
+
WHERE (target_module.name = $module_name OR target_module.full_import_name CONTAINS $module_name) {repo_filter}
|
|
887
|
+
WITH file, target_module
|
|
888
|
+
MATCH (file)-[imp:IMPORTS]->(other_module:Module)
|
|
889
|
+
WHERE other_module.name <> target_module.name
|
|
890
|
+
RETURN DISTINCT
|
|
891
|
+
other_module.name as imported_module,
|
|
892
|
+
imp.alias as import_alias
|
|
893
|
+
ORDER BY imported_module
|
|
894
|
+
LIMIT 50
|
|
895
|
+
""", module_name=module_name, repo_path=repo_path)
|
|
896
|
+
|
|
897
|
+
return {
|
|
898
|
+
"module_name": module_name,
|
|
899
|
+
"importers": importers_result.data(),
|
|
900
|
+
"imports": imports_result.data()
|
|
901
|
+
}
|
|
902
|
+
|
|
867
903
|
# Find files that import this module (who imports this module)
|
|
868
904
|
importers_result = session.run(f"""
|
|
869
905
|
MATCH (file:File)-[imp:IMPORTS]->(module:Module {{name: $module_name}})
|
|
@@ -278,19 +278,28 @@ class GraphWriter:
|
|
|
278
278
|
js_imports = []
|
|
279
279
|
other_imports = []
|
|
280
280
|
for imp in file_data.get("imports", []):
|
|
281
|
-
if lang
|
|
281
|
+
if lang in {"javascript", "typescript", "tsx"}:
|
|
282
282
|
module_name = imp.get("source")
|
|
283
283
|
if module_name:
|
|
284
284
|
js_imports.append(
|
|
285
285
|
{
|
|
286
286
|
"module_name": module_name,
|
|
287
287
|
"imported_name": imp.get("name", "*"),
|
|
288
|
-
"alias": imp.get("alias"),
|
|
289
|
-
"line_number": imp.get("line_number"),
|
|
288
|
+
"alias": imp.get("alias") or "",
|
|
289
|
+
"line_number": imp.get("line_number") or 0,
|
|
290
290
|
}
|
|
291
291
|
)
|
|
292
292
|
else:
|
|
293
|
-
|
|
293
|
+
module_name = imp.get("name") or imp.get("source") or imp.get("full_import_name")
|
|
294
|
+
if module_name:
|
|
295
|
+
other_imports.append(
|
|
296
|
+
{
|
|
297
|
+
"name": module_name,
|
|
298
|
+
"alias": imp.get("alias") or "",
|
|
299
|
+
"full_import_name": imp.get("full_import_name") or module_name,
|
|
300
|
+
"line_number": imp.get("line_number") or 0,
|
|
301
|
+
}
|
|
302
|
+
)
|
|
294
303
|
|
|
295
304
|
if js_imports:
|
|
296
305
|
session.run(
|
|
@@ -20,6 +20,7 @@ def resolve_function_call(
|
|
|
20
20
|
if called_name in __builtins__:
|
|
21
21
|
return None
|
|
22
22
|
|
|
23
|
+
resolved_called_name = called_name
|
|
23
24
|
resolved_path = None
|
|
24
25
|
full_call = call.get("full_name", called_name)
|
|
25
26
|
base_obj = full_call.split(".")[0] if "." in full_call else None
|
|
@@ -43,6 +44,14 @@ def resolve_function_call(
|
|
|
43
44
|
|
|
44
45
|
if not resolved_path:
|
|
45
46
|
possible_paths = imports_map.get(lookup_name, [])
|
|
47
|
+
if not possible_paths and lookup_name in local_imports:
|
|
48
|
+
imported_name = local_imports[lookup_name]
|
|
49
|
+
alias_paths = imports_map.get(imported_name, [])
|
|
50
|
+
if alias_paths:
|
|
51
|
+
possible_paths = alias_paths
|
|
52
|
+
lookup_name = imported_name
|
|
53
|
+
if called_name == base_obj or called_name == call["name"]:
|
|
54
|
+
resolved_called_name = imported_name
|
|
46
55
|
if len(possible_paths) == 1:
|
|
47
56
|
resolved_path = possible_paths[0]
|
|
48
57
|
elif len(possible_paths) > 1:
|
|
@@ -74,8 +83,8 @@ def resolve_function_call(
|
|
|
74
83
|
if called_name in local_names:
|
|
75
84
|
resolved_path = caller_file_path
|
|
76
85
|
is_unresolved_external = False
|
|
77
|
-
elif
|
|
78
|
-
candidates = imports_map[
|
|
86
|
+
elif resolved_called_name in imports_map and imports_map[resolved_called_name]:
|
|
87
|
+
candidates = imports_map[resolved_called_name]
|
|
79
88
|
for path in candidates:
|
|
80
89
|
for imp_name in local_imports.values():
|
|
81
90
|
if imp_name.replace(".", "/") in path:
|
|
@@ -100,7 +109,7 @@ def resolve_function_call(
|
|
|
100
109
|
"caller_name": caller_name,
|
|
101
110
|
"caller_file_path": caller_file_path,
|
|
102
111
|
"caller_line_number": caller_line_number,
|
|
103
|
-
"called_name":
|
|
112
|
+
"called_name": resolved_called_name,
|
|
104
113
|
"called_file_path": resolved_path,
|
|
105
114
|
"line_number": call["line_number"],
|
|
106
115
|
"args": call.get("args", []),
|
|
@@ -109,7 +118,7 @@ def resolve_function_call(
|
|
|
109
118
|
return {
|
|
110
119
|
"type": "file",
|
|
111
120
|
"caller_file_path": caller_file_path,
|
|
112
|
-
"called_name":
|
|
121
|
+
"called_name": resolved_called_name,
|
|
113
122
|
"called_file_path": resolved_path,
|
|
114
123
|
"line_number": call["line_number"],
|
|
115
124
|
"args": call.get("args", []),
|