codegraphcontext 0.5.8__tar.gz → 0.6.0__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.5.8/src/codegraphcontext.egg-info → codegraphcontext-0.6.0}/PKG-INFO +1 -1
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/pyproject.toml +2 -2
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/main.py +18 -3
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/cgc_bundle.py +167 -41
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/cgcignore.py +10 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/database_embedded_kuzu.py +164 -55
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/jobs.py +8 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/watcher.py +7 -1
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/server.py +31 -1
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tool_definitions.py +4 -1
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/code_finder.py +144 -7
- codegraphcontext-0.6.0/src/codegraphcontext/tools/graph_builder.py +702 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/handlers/analysis_handlers.py +4 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/persistence/writer.py +347 -38
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/pipeline.py +4 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/resolution/calls.py +14 -2
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/resolution/inheritance.py +316 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/schema.py +62 -44
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/schema_contract.py +8 -3
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/cpp.py +76 -9
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/csharp.py +3 -7
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/go.py +4 -2
- codegraphcontext-0.6.0/src/codegraphcontext/tools/languages/gradle.py +217 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/javascript.py +11 -2
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/kotlin.py +139 -13
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/lua.py +2 -1
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/php.py +21 -12
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/python.py +2 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/typescript.py +11 -2
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0/src/codegraphcontext.egg-info}/PKG-INFO +1 -1
- codegraphcontext-0.5.8/src/codegraphcontext/tools/graph_builder.py +0 -1250
- codegraphcontext-0.5.8/src/codegraphcontext/tools/languages/gradle.py +0 -116
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/LICENSE +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/MANIFEST.in +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/README.md +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/setup.cfg +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/__init__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/__main__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/api/__init__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/api/app.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/api/auth.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/api/mcp_sse.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/api/router.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/api/schemas.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/__init__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/cli_helpers.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/config_manager.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/hook_manager.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/project_config.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/registry_commands.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/setup_macos.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/setup_wizard.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/simulator.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/cli/visualizer.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/__init__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/bundle_registry.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/database.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/database_falkordb.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/database_falkordb_remote.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/database_kuzu.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/database_ladybug.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/database_nornic.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/falkor_worker.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/graph_query.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/core/simulator.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/prompts.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/stdlibs.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/__init__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/advanced_language_query_tool.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/datasources/__init__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/datasources/cassandra_ingester.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/datasources/mysql_ingester.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/datasources/redis_ingester.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/handlers/indexing_handlers.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/handlers/management_handlers.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/handlers/query_handlers.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/handlers/watcher_handlers.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/__init__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/constants.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/discovery.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/embeddings.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/persistence/__init__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/persistence/utils.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/pre_scan.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/resolution/__init__.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/resolution/post_resolution.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/sanitize.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/scip_pipeline.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/indexing/vector_resolver.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/c.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/css.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/dart.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/elisp.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/elixir.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/haskell.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/html.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/java.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/maven.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/mybatis.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/perl.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/ruby.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/rust.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/scala.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/sfc_common.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/solidity.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/solidity_remappings.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/svelte.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/swift.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/typescriptjsx.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/languages/vue.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/package_resolver.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/c_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/cpp_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/csharp_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/dart_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/elisp_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/go_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/haskell_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/java_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/javascript_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/perl_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/python_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/ruby_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/rust_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/scala_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/solidity_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/swift_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/query_tool_languages/typescript_toolkit.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/report_generator.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/scip_indexer.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/scip_pb2.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/system.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/tree_sitter_parser.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/tools/type_utils.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/cypher_ddl.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/cypher_readonly.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/debug_log.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/gcf_encoder.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/git_utils.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/path_ignore.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/path_sandbox.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/repo_path.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/secret_scanner.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/tool_limits.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/tree_sitter_manager.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/utils/visualize_graph.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/__vite-browser-external-9wXp6ZBx.js +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/function-calls-BtRHrqa2.png +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/graph-total-D1fBAugo.png +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/hero-graph-2voMJp2a.jpg +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/hierarchy-DGADo0YT.png +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/index-C-187lf0.js +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/index-fNAa6jgv.css +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/parser-pyodide.worker-BgsDfaad.js +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/parser.worker-_nvrecvj.js +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/assets/tree-sitter-qKYAACSa.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/cgcIcon.png +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/favicon.ico +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/index.html +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/logo-icon.svg +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/logo.svg +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/placeholder.svg +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/preview-image.png +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/robots.txt +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-c_sharp.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-core.js +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-cpp.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-dart.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-go.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-java.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-javascript.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-kotlin.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-perl.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-php.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-python.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-ruby.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-rust.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-swift.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-tsx.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter-typescript.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/tree-sitter.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.js +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/dist/wasm/web-tree-sitter.wasm +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext/viz/server.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext.egg-info/SOURCES.txt +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext.egg-info/dependency_links.txt +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext.egg-info/entry_points.txt +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext.egg-info/requires.txt +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/src/codegraphcontext.egg-info/top_level.txt +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/tests/test_issue_806_fix.py +0 -0
- {codegraphcontext-0.5.8 → codegraphcontext-0.6.0}/tests/test_mcp_sse.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codegraphcontext
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
|
|
5
5
|
Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "codegraphcontext"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.6.0"
|
|
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"
|
|
@@ -160,8 +160,8 @@ target-version = "py310"
|
|
|
160
160
|
select = ["E4", "E7", "E9", "F"]
|
|
161
161
|
|
|
162
162
|
[tool.pytest.ini_options]
|
|
163
|
+
pythonpath = ["src"]
|
|
163
164
|
testpaths = ["tests"]
|
|
164
|
-
python_files = ["test_*.py"]
|
|
165
165
|
norecursedirs = ["tests/fixtures", "tests/e2e/sample_projects", "venv", ".git", "__pycache__"]
|
|
166
166
|
markers = [
|
|
167
167
|
"integration: mark a test as an integration test.",
|
|
@@ -3023,10 +3023,19 @@ def analyze_dead_code(
|
|
|
3023
3023
|
# `path` was accepted and then dropped, so running inside one repository
|
|
3024
3024
|
# still reported dead code from every repository in the database.
|
|
3025
3025
|
repo_path = Path(path).resolve().as_posix() if path else None
|
|
3026
|
-
|
|
3026
|
+
# find_dead_code used to cap itself at 50 rows inside the query, which
|
|
3027
|
+
# doubled as this table's page size by accident. Now that it returns
|
|
3028
|
+
# the full set, ask for a page explicitly -- otherwise a real codebase
|
|
3029
|
+
# (7,141 dead functions was the reported figure) would print thousands
|
|
3030
|
+
# of table rows. The true count comes from total_count below (#1606).
|
|
3031
|
+
display_limit = get_tool_result_limit("find_dead_code")
|
|
3032
|
+
results = code_finder.find_dead_code(
|
|
3033
|
+
exclude_list, repo_path=repo_path, limit=display_limit
|
|
3034
|
+
)
|
|
3027
3035
|
|
|
3028
3036
|
unused_funcs = results.get('potentially_unused_functions', [])
|
|
3029
|
-
|
|
3037
|
+
total_count = results.get('total_count', len(unused_funcs))
|
|
3038
|
+
|
|
3030
3039
|
if not unused_funcs:
|
|
3031
3040
|
console.print("[green]✓ No dead code found![/green]")
|
|
3032
3041
|
return
|
|
@@ -3047,7 +3056,13 @@ def analyze_dead_code(
|
|
|
3047
3056
|
|
|
3048
3057
|
console.print("\n[bold yellow]⚠️ Potentially Unused Functions:[/bold yellow]")
|
|
3049
3058
|
console.print(table)
|
|
3050
|
-
|
|
3059
|
+
if total_count > len(unused_funcs):
|
|
3060
|
+
console.print(
|
|
3061
|
+
f"\n[dim]Total: {total_count} function(s); "
|
|
3062
|
+
f"showing the first {len(unused_funcs)} by path[/dim]"
|
|
3063
|
+
)
|
|
3064
|
+
else:
|
|
3065
|
+
console.print(f"\n[dim]Total: {total_count} function(s)[/dim]")
|
|
3051
3066
|
console.print(f"[dim]Note: {results.get('note', '')}[/dim]")
|
|
3052
3067
|
finally:
|
|
3053
3068
|
db_manager.close_driver()
|
|
@@ -80,6 +80,75 @@ def _validate_cypher_identifier(value: Any, kind: str) -> str:
|
|
|
80
80
|
return value
|
|
81
81
|
|
|
82
82
|
|
|
83
|
+
# Repo-scoped export rewrites the repository root to "." and every path under
|
|
84
|
+
# it to "./rel" (#1509). Import must invert that rewrite against a per-bundle
|
|
85
|
+
# destination root; otherwise every second bundle collides on path="." and
|
|
86
|
+
# File keys like ./README.md.
|
|
87
|
+
_BUNDLE_RELATIVE_ROOTS = {".", "./", ".\\"}
|
|
88
|
+
_NON_SLUG_RE = re.compile(r"[^A-Za-z0-9._-]+")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _sanitize_bundle_repo_slug(repo: Optional[str]) -> str:
|
|
92
|
+
"""Turn metadata['repo'] into a single path segment (pallets/flask → pallets__flask)."""
|
|
93
|
+
if not repo or not isinstance(repo, str):
|
|
94
|
+
return "unknown"
|
|
95
|
+
slug = repo.strip().replace("\\", "/").replace("..", "").strip("/")
|
|
96
|
+
slug = _NON_SLUG_RE.sub("__", slug).strip("_")
|
|
97
|
+
return slug or "unknown"
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _default_bundle_install_root(
|
|
101
|
+
metadata: Optional[Dict[str, Any]] = None,
|
|
102
|
+
destination_root: Optional[Path] = None,
|
|
103
|
+
) -> str:
|
|
104
|
+
"""Absolute posix dest root for one imported bundle: ~/.codegraphcontext/bundles/<slug>."""
|
|
105
|
+
slug = _sanitize_bundle_repo_slug((metadata or {}).get("repo"))
|
|
106
|
+
base = Path(destination_root) if destination_root is not None else (
|
|
107
|
+
Path.home() / ".codegraphcontext" / "bundles"
|
|
108
|
+
)
|
|
109
|
+
return (base / slug).resolve().as_posix()
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def _is_bundle_relative_path(val: Any) -> bool:
|
|
113
|
+
"""True for portable export paths: '.', './', '.\\', './foo', '.\\foo'."""
|
|
114
|
+
if not isinstance(val, str) or not val:
|
|
115
|
+
return False
|
|
116
|
+
if val in _BUNDLE_RELATIVE_ROOTS:
|
|
117
|
+
return True
|
|
118
|
+
return val.startswith("./") or val.startswith(".\\")
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _is_identifying_repo_path(repo_path: Optional[str]) -> bool:
|
|
122
|
+
"""False for None, empty, and bundle-relative paths that are not unique."""
|
|
123
|
+
if not repo_path:
|
|
124
|
+
return False
|
|
125
|
+
return not _is_bundle_relative_path(repo_path)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def _rebase_bundle_path(val: str, dest_root: str) -> str:
|
|
129
|
+
"""Map '.' / './rel' onto dest_root. Non-relative strings are returned unchanged."""
|
|
130
|
+
if not _is_bundle_relative_path(val):
|
|
131
|
+
return val
|
|
132
|
+
if val in _BUNDLE_RELATIVE_ROOTS:
|
|
133
|
+
return dest_root
|
|
134
|
+
rel = val[2:].replace("\\", "/").lstrip("/")
|
|
135
|
+
if not rel:
|
|
136
|
+
return dest_root
|
|
137
|
+
return dest_root + "/" + rel
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _rebase_property_map(
|
|
141
|
+
props: Optional[Dict[str, Any]], dest_root: Optional[str]
|
|
142
|
+
) -> Dict[str, Any]:
|
|
143
|
+
"""Rewrite every bundle-relative string property in *props* in place."""
|
|
144
|
+
if not props or not dest_root:
|
|
145
|
+
return props or {}
|
|
146
|
+
for key, val in list(props.items()):
|
|
147
|
+
if isinstance(val, str) and _is_bundle_relative_path(val):
|
|
148
|
+
props[key] = _rebase_bundle_path(val, dest_root)
|
|
149
|
+
return props
|
|
150
|
+
|
|
151
|
+
|
|
83
152
|
class CGCBundle:
|
|
84
153
|
"""Handles creation and loading of .cgc bundle files."""
|
|
85
154
|
|
|
@@ -259,6 +328,7 @@ class CGCBundle:
|
|
|
259
328
|
password: Optional[str] = None,
|
|
260
329
|
verify_key: Optional[str] = None,
|
|
261
330
|
graph_name: str = None,
|
|
331
|
+
destination_root: Optional[Path] = None,
|
|
262
332
|
) -> Tuple[bool, str]:
|
|
263
333
|
self._active_graph = graph_name
|
|
264
334
|
"""
|
|
@@ -268,6 +338,11 @@ class CGCBundle:
|
|
|
268
338
|
bundle_path: Path to the .cgc file
|
|
269
339
|
clear_existing: Whether to clear existing graph data first
|
|
270
340
|
readonly: If True, mount as read-only (future feature)
|
|
341
|
+
password: Optional password to decrypt an encrypted bundle
|
|
342
|
+
verify_key: Optional HMAC key to verify a signed bundle
|
|
343
|
+
destination_root: Optional base directory used to re-absolutize
|
|
344
|
+
repo-scoped relative paths ('.' / './…'). Defaults to
|
|
345
|
+
~/.codegraphcontext/bundles/<sanitized repo>.
|
|
271
346
|
|
|
272
347
|
Returns:
|
|
273
348
|
Tuple[bool, str]: (success, message)
|
|
@@ -304,10 +379,15 @@ class CGCBundle:
|
|
|
304
379
|
|
|
305
380
|
info_logger(f"Loading bundle: {metadata.get('repo', 'unknown')}")
|
|
306
381
|
info_logger(f"Bundle version: {metadata.get('cgc_version', 'unknown')}")
|
|
382
|
+
|
|
383
|
+
dest_root = _default_bundle_install_root(metadata, destination_root)
|
|
307
384
|
|
|
308
385
|
# Step 4: Handle existing data
|
|
309
386
|
repo_name = metadata.get('repo', 'unknown')
|
|
310
387
|
repo_path = metadata.get('repo_path')
|
|
388
|
+
if _is_bundle_relative_path(repo_path):
|
|
389
|
+
repo_path = _rebase_bundle_path(repo_path, dest_root)
|
|
390
|
+
metadata["repo_path"] = repo_path
|
|
311
391
|
|
|
312
392
|
if clear_existing:
|
|
313
393
|
# User explicitly wants to clear - remove everything
|
|
@@ -330,11 +410,11 @@ class CGCBundle:
|
|
|
330
410
|
|
|
331
411
|
# Step 6: Import nodes
|
|
332
412
|
info_logger("Importing nodes...")
|
|
333
|
-
node_count = self._import_nodes(payload_path / "nodes.jsonl")
|
|
413
|
+
node_count = self._import_nodes(payload_path / "nodes.jsonl", dest_root)
|
|
334
414
|
|
|
335
415
|
# Step 7: Import edges
|
|
336
416
|
info_logger("Importing edges...")
|
|
337
|
-
edge_count = self._import_edges(payload_path / "edges.jsonl")
|
|
417
|
+
edge_count = self._import_edges(payload_path / "edges.jsonl", dest_root)
|
|
338
418
|
|
|
339
419
|
success_msg = f"✅ Successfully imported {bundle_path.name}\n"
|
|
340
420
|
success_msg += f" Repository: {metadata.get('repo', 'unknown')}\n"
|
|
@@ -414,7 +494,11 @@ class CGCBundle:
|
|
|
414
494
|
if branch:
|
|
415
495
|
metadata["branch"] = branch
|
|
416
496
|
|
|
417
|
-
|
|
497
|
+
# Languages are derived for every bundle, not only repo-scoped ones.
|
|
498
|
+
# This used to sit inside the `if repo_path` branch above, so a
|
|
499
|
+
# whole-graph export never set the key at all.
|
|
500
|
+
try:
|
|
501
|
+
if repo_path:
|
|
418
502
|
repo_str = repo_path.resolve().as_posix()
|
|
419
503
|
result = session.run("""
|
|
420
504
|
MATCH (f:File)
|
|
@@ -422,11 +506,18 @@ class CGCBundle:
|
|
|
422
506
|
RETURN f.language as language, count(*) as count
|
|
423
507
|
ORDER BY count DESC
|
|
424
508
|
""", repo_path=repo_str, repo_prefix=repo_str + "/")
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
509
|
+
else:
|
|
510
|
+
result = session.run("""
|
|
511
|
+
MATCH (f:File)
|
|
512
|
+
RETURN f.language as language, count(*) as count
|
|
513
|
+
ORDER BY count DESC
|
|
514
|
+
""")
|
|
515
|
+
languages = {record["language"]: record["count"] for record in result if record["language"]}
|
|
516
|
+
metadata["languages"] = list(languages.keys())
|
|
517
|
+
except Exception:
|
|
518
|
+
metadata.setdefault("languages", [])
|
|
519
|
+
|
|
520
|
+
|
|
430
521
|
return metadata
|
|
431
522
|
|
|
432
523
|
def _extract_schema(self) -> Dict[str, Any]:
|
|
@@ -1299,8 +1390,10 @@ cgc import <bundle-file>.cgc
|
|
|
1299
1390
|
if result.single():
|
|
1300
1391
|
return True
|
|
1301
1392
|
|
|
1302
|
-
#
|
|
1303
|
-
|
|
1393
|
+
# Path '.' / './…' is the portable export of every repo-scoped
|
|
1394
|
+
# bundle, not a unique identity — matching on it refuses flask
|
|
1395
|
+
# then requests as duplicates (#1509).
|
|
1396
|
+
if _is_identifying_repo_path(repo_path):
|
|
1304
1397
|
result = session.run(
|
|
1305
1398
|
"MATCH (r:Repository {path: $path}) RETURN r LIMIT 1",
|
|
1306
1399
|
path=repo_path
|
|
@@ -1327,6 +1420,13 @@ cgc import <bundle-file>.cgc
|
|
|
1327
1420
|
return
|
|
1328
1421
|
|
|
1329
1422
|
repo_path = record['path']
|
|
1423
|
+
if not _is_identifying_repo_path(repo_path):
|
|
1424
|
+
warning_logger(
|
|
1425
|
+
f"Refusing to delete repository '{repo_identifier}': "
|
|
1426
|
+
f"path {repo_path!r} is not identifying and would match "
|
|
1427
|
+
"every repo-scoped bundle import"
|
|
1428
|
+
)
|
|
1429
|
+
return
|
|
1330
1430
|
|
|
1331
1431
|
repo_prefix = repo_path if repo_path.endswith("/") else f"{repo_path}/"
|
|
1332
1432
|
# Delete all nodes that belong to this repository
|
|
@@ -1376,7 +1476,7 @@ cgc import <bundle-file>.cgc
|
|
|
1376
1476
|
# This is a placeholder for future enhancement
|
|
1377
1477
|
debug_log("Schema import not yet implemented - relying on application schema")
|
|
1378
1478
|
|
|
1379
|
-
def _import_nodes(self, nodes_file: Path) -> int:
|
|
1479
|
+
def _import_nodes(self, nodes_file: Path, dest_root: Optional[str] = None) -> int:
|
|
1380
1480
|
"""Import nodes from JSONL file."""
|
|
1381
1481
|
count = 0
|
|
1382
1482
|
batch_size = 1000
|
|
@@ -1405,12 +1505,12 @@ cgc import <bundle-file>.cgc
|
|
|
1405
1505
|
batch.append((labels, node_data, old_id))
|
|
1406
1506
|
|
|
1407
1507
|
if len(batch) >= batch_size:
|
|
1408
|
-
count += self._import_node_batch(session, batch, id_mapping)
|
|
1508
|
+
count += self._import_node_batch(session, batch, id_mapping, dest_root)
|
|
1409
1509
|
batch = []
|
|
1410
1510
|
|
|
1411
1511
|
# Import remaining nodes
|
|
1412
1512
|
if batch:
|
|
1413
|
-
count += self._import_node_batch(session, batch, id_mapping)
|
|
1513
|
+
count += self._import_node_batch(session, batch, id_mapping, dest_root)
|
|
1414
1514
|
|
|
1415
1515
|
# Store ID mapping for edge import
|
|
1416
1516
|
self._id_mapping = id_mapping
|
|
@@ -1424,9 +1524,9 @@ cgc import <bundle-file>.cgc
|
|
|
1424
1524
|
# not a slow path, it is a hard import failure for any bundle containing
|
|
1425
1525
|
# that label (#1322).
|
|
1426
1526
|
#
|
|
1427
|
-
#
|
|
1428
|
-
#
|
|
1429
|
-
#
|
|
1527
|
+
# DbColumn and RedisKeyPattern had composite natural keys, which Kùzu
|
|
1528
|
+
# cannot declare as a PRIMARY KEY; they are keyed on a synthesized uid
|
|
1529
|
+
# (name+table_fqn / pattern+datasource_name) like the positional labels.
|
|
1430
1530
|
_PK_MAP = {
|
|
1431
1531
|
'Repository': 'path', 'File': 'path', 'Directory': 'path',
|
|
1432
1532
|
'Module': 'name',
|
|
@@ -1436,29 +1536,41 @@ cgc import <bundle-file>.cgc
|
|
|
1436
1536
|
'Annotation': 'uid', 'Record': 'uid', 'Property': 'uid',
|
|
1437
1537
|
'Parameter': 'uid', 'EnumMember': 'uid', 'Mixin': 'uid',
|
|
1438
1538
|
'Extension': 'uid', 'Object': 'uid',
|
|
1439
|
-
'DbTable': '
|
|
1539
|
+
'DbTable': 'fqn', 'Datasource': 'name', 'ExternalClass': 'name',
|
|
1540
|
+
'DbColumn': 'uid', 'RedisKeyPattern': 'uid',
|
|
1541
|
+
'GradleModule': 'name', 'MavenModule': 'uid', 'ExternalLibrary': 'uid',
|
|
1440
1542
|
}
|
|
1441
1543
|
_UID_PARTS = {
|
|
1442
|
-
'Function': ['name', 'path', 'line_number'],
|
|
1443
|
-
'Class': ['name', 'path', 'line_number'],
|
|
1444
|
-
'Variable': ['name', 'path', 'line_number'],
|
|
1445
|
-
'Trait': ['name', 'path', 'line_number'],
|
|
1446
|
-
'Interface': ['name', 'path', 'line_number'],
|
|
1447
|
-
'Macro': ['name', 'path', 'line_number'],
|
|
1448
|
-
'Struct': ['name', 'path', 'line_number'],
|
|
1449
|
-
'Enum': ['name', 'path', 'line_number'],
|
|
1450
|
-
'Union': ['name', 'path', 'line_number'],
|
|
1544
|
+
'Function': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1545
|
+
'Class': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1546
|
+
'Variable': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1547
|
+
'Trait': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1548
|
+
'Interface': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1549
|
+
'Macro': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1550
|
+
'Struct': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1551
|
+
'Enum': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1552
|
+
'Union': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1451
1553
|
'Annotation': ['name', 'path', 'line_number'],
|
|
1452
|
-
'Record': ['name', 'path', 'line_number'],
|
|
1453
|
-
'Property': ['name', 'path', 'line_number'],
|
|
1554
|
+
'Record': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1555
|
+
'Property': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1454
1556
|
'Parameter': ['name', 'path', 'function_line_number'],
|
|
1455
|
-
'EnumMember': ['name', 'path', 'line_number'],
|
|
1456
|
-
'Mixin': ['name', 'path', 'line_number'],
|
|
1457
|
-
'Extension': ['name', 'path', 'line_number'],
|
|
1458
|
-
'Object': ['name', 'path', 'line_number'],
|
|
1557
|
+
'EnumMember': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1558
|
+
'Mixin': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1559
|
+
'Extension': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1560
|
+
'Object': ['name', 'path', 'line_number', 'occurrence_index'],
|
|
1561
|
+
'DbColumn': ['name', 'table_fqn'],
|
|
1562
|
+
'RedisKeyPattern': ['pattern', 'datasource_name'],
|
|
1563
|
+
'MavenModule': ['group_id', 'artifact_id'],
|
|
1564
|
+
'ExternalLibrary': ['group_id', 'artifact_id'],
|
|
1459
1565
|
}
|
|
1460
1566
|
|
|
1461
|
-
def _import_node_batch(
|
|
1567
|
+
def _import_node_batch(
|
|
1568
|
+
self,
|
|
1569
|
+
session,
|
|
1570
|
+
batch: List[Tuple],
|
|
1571
|
+
id_mapping: Dict,
|
|
1572
|
+
dest_root: Optional[str] = None,
|
|
1573
|
+
) -> int:
|
|
1462
1574
|
"""Import a batch of nodes."""
|
|
1463
1575
|
id_function = self._get_id_function()
|
|
1464
1576
|
|
|
@@ -1472,10 +1584,20 @@ cgc import <bundle-file>.cgc
|
|
|
1472
1584
|
label_str = ':'.join(labels)
|
|
1473
1585
|
primary_label = labels[0]
|
|
1474
1586
|
|
|
1587
|
+
if dest_root:
|
|
1588
|
+
_rebase_property_map(properties, dest_root)
|
|
1589
|
+
|
|
1475
1590
|
pk_field = self._PK_MAP.get(primary_label)
|
|
1476
|
-
if pk_field == 'uid'
|
|
1477
|
-
|
|
1478
|
-
|
|
1591
|
+
parts = self._UID_PARTS.get(primary_label, []) if pk_field == 'uid' else []
|
|
1592
|
+
# After rebasing './…' paths, uid must include the dest root so
|
|
1593
|
+
# Function/Class MERGE keys do not collide across bundles (#1509).
|
|
1594
|
+
if pk_field == 'uid' and parts and (dest_root or 'uid' not in properties):
|
|
1595
|
+
properties['uid'] = ''.join(
|
|
1596
|
+
# occurrence_index defaults to 0 to match the writer's uid
|
|
1597
|
+
# for bundles exported before #1393 added the property.
|
|
1598
|
+
str(properties.get(p, 0 if p == 'occurrence_index' else ''))
|
|
1599
|
+
for p in parts
|
|
1600
|
+
)
|
|
1479
1601
|
|
|
1480
1602
|
if pk_field and pk_field in properties:
|
|
1481
1603
|
pk_val = properties[pk_field]
|
|
@@ -1500,7 +1622,7 @@ cgc import <bundle-file>.cgc
|
|
|
1500
1622
|
|
|
1501
1623
|
return len(batch)
|
|
1502
1624
|
|
|
1503
|
-
def _import_edges(self, edges_file: Path) -> int:
|
|
1625
|
+
def _import_edges(self, edges_file: Path, dest_root: Optional[str] = None) -> int:
|
|
1504
1626
|
"""Import edges from JSONL file."""
|
|
1505
1627
|
count = 0
|
|
1506
1628
|
batch_size = 1000
|
|
@@ -1513,16 +1635,18 @@ cgc import <bundle-file>.cgc
|
|
|
1513
1635
|
batch.append(edge_data)
|
|
1514
1636
|
|
|
1515
1637
|
if len(batch) >= batch_size:
|
|
1516
|
-
count += self._import_edge_batch(session, batch)
|
|
1638
|
+
count += self._import_edge_batch(session, batch, dest_root)
|
|
1517
1639
|
batch = []
|
|
1518
1640
|
|
|
1519
1641
|
# Import remaining edges
|
|
1520
1642
|
if batch:
|
|
1521
|
-
count += self._import_edge_batch(session, batch)
|
|
1643
|
+
count += self._import_edge_batch(session, batch, dest_root)
|
|
1522
1644
|
|
|
1523
1645
|
return count
|
|
1524
1646
|
|
|
1525
|
-
def _import_edge_batch(
|
|
1647
|
+
def _import_edge_batch(
|
|
1648
|
+
self, session, batch: List[Dict], dest_root: Optional[str] = None
|
|
1649
|
+
) -> int:
|
|
1526
1650
|
"""Import a batch of edges."""
|
|
1527
1651
|
id_mapping = getattr(self, '_id_mapping', {})
|
|
1528
1652
|
# Detect database backend to use appropriate ID function
|
|
@@ -1537,7 +1661,9 @@ cgc import <bundle-file>.cgc
|
|
|
1537
1661
|
if isinstance(old_to, dict):
|
|
1538
1662
|
old_to = (old_to.get('table', 0), old_to.get('offset', 0))
|
|
1539
1663
|
rel_type = _validate_cypher_identifier(edge.get('type'), "relationship type")
|
|
1540
|
-
properties = edge.get('properties', {})
|
|
1664
|
+
properties = edge.get('properties', {}) or {}
|
|
1665
|
+
if dest_root:
|
|
1666
|
+
properties = _rebase_property_map(properties, dest_root)
|
|
1541
1667
|
|
|
1542
1668
|
# Map old IDs to new IDs
|
|
1543
1669
|
new_from = id_mapping.get(old_from)
|
|
@@ -151,6 +151,16 @@ class CGCIgnoreMatcher:
|
|
|
151
151
|
if is_root_anchored:
|
|
152
152
|
pat = pat[1:]
|
|
153
153
|
|
|
154
|
+
# Under gitignore semantics a slash anywhere except the trailing
|
|
155
|
+
# position anchors the pattern to the ignore root: `src/generated`
|
|
156
|
+
# matches <root>/src/generated only, never vendor/src/generated.
|
|
157
|
+
# Only a *leading* slash used to anchor here, so any multi-segment
|
|
158
|
+
# pattern matched at every depth and silently over-ignored.
|
|
159
|
+
# `build/` keeps matching at any depth -- its slash was already
|
|
160
|
+
# stripped as is_dir_only, so no internal slash remains.
|
|
161
|
+
if '/' in pat:
|
|
162
|
+
is_root_anchored = True
|
|
163
|
+
|
|
154
164
|
# `**` spans whole path segments, never part of one. Joining the
|
|
155
165
|
# translated pieces with a bare `.*` lets the wildcard match inside a
|
|
156
166
|
# segment, so `docs/**` would swallow `docstring.py` and `**/build`
|