#
tokens: 48503/50000 30/422 files (page 3/22)
lines: on (toggle) GitHub
raw markdown copy reset
This is page 3 of 22. Use http://codebase.md/shashankss1205/codegraphcontext?lines=true&page={x} to view the full context.

# Directory Structure

```
├── .cgcignore
├── .github
│   ├── FUNDING.yml
│   └── workflows
│       ├── e2e-tests.yml
│       ├── post_discord_invite.yml
│       ├── test.yml
│       └── update-contributors.yml
├── .gitignore
├── CLI_Commands.md
├── CONTRIBUTING.md
├── contributors.md
├── docs
│   ├── docs
│   │   ├── architecture.md
│   │   ├── cli.md
│   │   ├── contributing_languages.md
│   │   ├── contributing.md
│   │   ├── cookbook.md
│   │   ├── core.md
│   │   ├── future_work.md
│   │   ├── images
│   │   │   ├── 1.png
│   │   │   ├── 11.png
│   │   │   ├── 12.png
│   │   │   ├── 13.png
│   │   │   ├── 14.png
│   │   │   ├── 16.png
│   │   │   ├── 19.png
│   │   │   ├── 2.png
│   │   │   ├── 20.png
│   │   │   ├── 21.png
│   │   │   ├── 22.png
│   │   │   ├── 23.png
│   │   │   ├── 24.png
│   │   │   ├── 26.png
│   │   │   ├── 28.png
│   │   │   ├── 29.png
│   │   │   ├── 3.png
│   │   │   ├── 30.png
│   │   │   ├── 31.png
│   │   │   ├── 32.png
│   │   │   ├── 33.png
│   │   │   ├── 34.png
│   │   │   ├── 35.png
│   │   │   ├── 36.png
│   │   │   ├── 38.png
│   │   │   ├── 39.png
│   │   │   ├── 4.png
│   │   │   ├── 40.png
│   │   │   ├── 41.png
│   │   │   ├── 42.png
│   │   │   ├── 43.png
│   │   │   ├── 44.png
│   │   │   ├── 5.png
│   │   │   ├── 6.png
│   │   │   ├── 7.png
│   │   │   ├── 8.png
│   │   │   ├── 9.png
│   │   │   ├── Indexing.gif
│   │   │   ├── tool_images
│   │   │   │   ├── 1.png
│   │   │   │   ├── 2.png
│   │   │   │   └── 3.png
│   │   │   └── Usecase.gif
│   │   ├── index.md
│   │   ├── installation.md
│   │   ├── license.md
│   │   ├── server.md
│   │   ├── tools.md
│   │   ├── troubleshooting.md
│   │   ├── use_cases.md
│   │   └── watching.md
│   ├── mkdocs.yml
│   └── site
│       ├── 404.html
│       ├── architecture
│       │   └── index.html
│       ├── assets
│       │   ├── images
│       │   │   └── favicon.png
│       │   ├── javascripts
│       │   │   ├── bundle.79ae519e.min.js
│       │   │   ├── bundle.79ae519e.min.js.map
│       │   │   ├── lunr
│       │   │   │   ├── min
│       │   │   │   │   ├── lunr.ar.min.js
│       │   │   │   │   ├── lunr.da.min.js
│       │   │   │   │   ├── lunr.de.min.js
│       │   │   │   │   ├── lunr.du.min.js
│       │   │   │   │   ├── lunr.el.min.js
│       │   │   │   │   ├── lunr.es.min.js
│       │   │   │   │   ├── lunr.fi.min.js
│       │   │   │   │   ├── lunr.fr.min.js
│       │   │   │   │   ├── lunr.he.min.js
│       │   │   │   │   ├── lunr.hi.min.js
│       │   │   │   │   ├── lunr.hu.min.js
│       │   │   │   │   ├── lunr.hy.min.js
│       │   │   │   │   ├── lunr.it.min.js
│       │   │   │   │   ├── lunr.ja.min.js
│       │   │   │   │   ├── lunr.jp.min.js
│       │   │   │   │   ├── lunr.kn.min.js
│       │   │   │   │   ├── lunr.ko.min.js
│       │   │   │   │   ├── lunr.multi.min.js
│       │   │   │   │   ├── lunr.nl.min.js
│       │   │   │   │   ├── lunr.no.min.js
│       │   │   │   │   ├── lunr.pt.min.js
│       │   │   │   │   ├── lunr.ro.min.js
│       │   │   │   │   ├── lunr.ru.min.js
│       │   │   │   │   ├── lunr.sa.min.js
│       │   │   │   │   ├── lunr.stemmer.support.min.js
│       │   │   │   │   ├── lunr.sv.min.js
│       │   │   │   │   ├── lunr.ta.min.js
│       │   │   │   │   ├── lunr.te.min.js
│       │   │   │   │   ├── lunr.th.min.js
│       │   │   │   │   ├── lunr.tr.min.js
│       │   │   │   │   ├── lunr.vi.min.js
│       │   │   │   │   └── lunr.zh.min.js
│       │   │   │   ├── tinyseg.js
│       │   │   │   └── wordcut.js
│       │   │   └── workers
│       │   │       ├── search.2c215733.min.js
│       │   │       └── search.2c215733.min.js.map
│       │   └── stylesheets
│       │       ├── main.484c7ddc.min.css
│       │       ├── main.484c7ddc.min.css.map
│       │       ├── palette.ab4e12ef.min.css
│       │       └── palette.ab4e12ef.min.css.map
│       ├── cli
│       │   └── index.html
│       ├── contributing
│       │   └── index.html
│       ├── contributing_languages
│       │   └── index.html
│       ├── cookbook
│       │   └── index.html
│       ├── core
│       │   └── index.html
│       ├── future_work
│       │   └── index.html
│       ├── images
│       │   ├── 1.png
│       │   ├── 11.png
│       │   ├── 12.png
│       │   ├── 13.png
│       │   ├── 14.png
│       │   ├── 16.png
│       │   ├── 19.png
│       │   ├── 2.png
│       │   ├── 20.png
│       │   ├── 21.png
│       │   ├── 22.png
│       │   ├── 23.png
│       │   ├── 24.png
│       │   ├── 26.png
│       │   ├── 28.png
│       │   ├── 29.png
│       │   ├── 3.png
│       │   ├── 30.png
│       │   ├── 31.png
│       │   ├── 32.png
│       │   ├── 33.png
│       │   ├── 34.png
│       │   ├── 35.png
│       │   ├── 36.png
│       │   ├── 38.png
│       │   ├── 39.png
│       │   ├── 4.png
│       │   ├── 40.png
│       │   ├── 41.png
│       │   ├── 42.png
│       │   ├── 43.png
│       │   ├── 44.png
│       │   ├── 5.png
│       │   ├── 6.png
│       │   ├── 7.png
│       │   ├── 8.png
│       │   ├── 9.png
│       │   ├── Indexing.gif
│       │   ├── tool_images
│       │   │   ├── 1.png
│       │   │   ├── 2.png
│       │   │   └── 3.png
│       │   └── Usecase.gif
│       ├── index.html
│       ├── installation
│       │   └── index.html
│       ├── license
│       │   └── index.html
│       ├── search
│       │   └── search_index.json
│       ├── server
│       │   └── index.html
│       ├── sitemap.xml
│       ├── sitemap.xml.gz
│       ├── tools
│       │   └── index.html
│       ├── troubleshooting
│       │   └── index.html
│       ├── use_cases
│       │   └── index.html
│       └── watching
│           └── index.html
├── funding.json
├── images
│   ├── 1.png
│   ├── 11.png
│   ├── 12.png
│   ├── 13.png
│   ├── 14.png
│   ├── 16.png
│   ├── 19.png
│   ├── 2.png
│   ├── 20.png
│   ├── 21.png
│   ├── 22.png
│   ├── 23.png
│   ├── 24.png
│   ├── 26.png
│   ├── 28.png
│   ├── 29.png
│   ├── 3.png
│   ├── 30.png
│   ├── 31.png
│   ├── 32.png
│   ├── 33.png
│   ├── 34.png
│   ├── 35.png
│   ├── 36.png
│   ├── 38.png
│   ├── 39.png
│   ├── 4.png
│   ├── 40.png
│   ├── 41.png
│   ├── 42.png
│   ├── 43.png
│   ├── 44.png
│   ├── 5.png
│   ├── 6.png
│   ├── 7.png
│   ├── 8.png
│   ├── 9.png
│   ├── Indexing.gif
│   ├── tool_images
│   │   ├── 1.png
│   │   ├── 2.png
│   │   └── 3.png
│   └── Usecase.gif
├── LICENSE
├── MANIFEST.in
├── organizer
│   ├── CONTRIBUTING_LANGUAGES.md
│   ├── cookbook.md
│   ├── docs.md
│   ├── language_specific_nodes.md
│   ├── Tools_Exploration.md
│   └── troubleshoot.md
├── pyproject.toml
├── README.md
├── scripts
│   ├── generate_lang_contributors.py
│   ├── post_install_fix.sh
│   ├── test_all_parsers.py
│   └── update_language_parsers.py
├── SECURITY.md
├── src
│   └── codegraphcontext
│       ├── __init__.py
│       ├── __main__.py
│       ├── cli
│       │   ├── __init__.py
│       │   ├── cli_helpers.py
│       │   ├── config_manager.py
│       │   ├── main.py
│       │   ├── setup_macos.py
│       │   └── setup_wizard.py
│       ├── core
│       │   ├── __init__.py
│       │   ├── database_falkordb.py
│       │   ├── database.py
│       │   ├── falkor_worker.py
│       │   ├── jobs.py
│       │   └── watcher.py
│       ├── prompts.py
│       ├── server.py
│       ├── tools
│       │   ├── __init__.py
│       │   ├── advanced_language_query_tool.py
│       │   ├── code_finder.py
│       │   ├── graph_builder.py
│       │   ├── languages
│       │   │   ├── c.py
│       │   │   ├── cpp.py
│       │   │   ├── csharp.py
│       │   │   ├── go.py
│       │   │   ├── java.py
│       │   │   ├── javascript.py
│       │   │   ├── kotlin.py
│       │   │   ├── php.py
│       │   │   ├── python.py
│       │   │   ├── ruby.py
│       │   │   ├── rust.py
│       │   │   ├── scala.py
│       │   │   ├── swift.py
│       │   │   ├── typescript.py
│       │   │   └── typescriptjsx.py
│       │   ├── package_resolver.py
│       │   ├── query_tool_languages
│       │   │   ├── c_toolkit.py
│       │   │   ├── cpp_toolkit.py
│       │   │   ├── csharp_toolkit.py
│       │   │   ├── go_toolkit.py
│       │   │   ├── java_toolkit.py
│       │   │   ├── javascript_toolkit.py
│       │   │   ├── python_toolkit.py
│       │   │   ├── ruby_toolkit.py
│       │   │   ├── rust_toolkit.py
│       │   │   ├── scala_toolkit.py
│       │   │   ├── swift_toolkit.py
│       │   │   └── typescript_toolkit.py
│       │   └── system.py
│       └── utils
│           ├── debug_log.py
│           └── tree_sitter_manager.py
├── tests
│   ├── __init__.py
│   ├── conftest.py
│   ├── sample_project
│   │   ├── advanced_calls.py
│   │   ├── advanced_classes.py
│   │   ├── advanced_classes2.py
│   │   ├── advanced_functions.py
│   │   ├── advanced_imports.py
│   │   ├── async_features.py
│   │   ├── callbacks_decorators.py
│   │   ├── circular1.py
│   │   ├── circular2.py
│   │   ├── class_instantiation.py
│   │   ├── cli_and_dunder.py
│   │   ├── complex_classes.py
│   │   ├── comprehensions_generators.py
│   │   ├── context_managers.py
│   │   ├── control_flow.py
│   │   ├── datatypes.py
│   │   ├── dynamic_dispatch.py
│   │   ├── dynamic_imports.py
│   │   ├── edge_cases
│   │   │   ├── comments_only.py
│   │   │   ├── docstring_only.py
│   │   │   ├── empty.py
│   │   │   ├── hardcoded_secrets.py
│   │   │   ├── long_functions.py
│   │   │   └── syntax_error.py
│   │   ├── function_chains.py
│   │   ├── generators.py
│   │   ├── import_reexports.py
│   │   ├── mapping_calls.py
│   │   ├── module_a.py
│   │   ├── module_b.py
│   │   ├── module_c
│   │   │   ├── __init__.py
│   │   │   ├── submodule1.py
│   │   │   └── submodule2.py
│   │   ├── namespace_pkg
│   │   │   └── ns_module.py
│   │   ├── pattern_matching.py
│   │   └── typing_examples.py
│   ├── sample_project_c
│   │   ├── cgc_sample
│   │   ├── include
│   │   │   ├── config.h
│   │   │   ├── math
│   │   │   │   └── vec.h
│   │   │   ├── module.h
│   │   │   ├── platform.h
│   │   │   └── util.h
│   │   ├── Makefile
│   │   ├── README.md
│   │   └── src
│   │       ├── main.c
│   │       ├── math
│   │       │   └── vec.c
│   │       ├── module.c
│   │       └── util.c
│   ├── sample_project_cpp
│   │   ├── class_features.cpp
│   │   ├── classes.cpp
│   │   ├── control_flow.cpp
│   │   ├── edge_cases.cpp
│   │   ├── enum_struct_union.cpp
│   │   ├── exceptions.cpp
│   │   ├── file_io.cpp
│   │   ├── function_chain.cpp
│   │   ├── function_chain.h
│   │   ├── function_types.cpp
│   │   ├── main.cpp
│   │   ├── main.exe
│   │   ├── namespaces.cpp
│   │   ├── raii_example.cpp
│   │   ├── README.md
│   │   ├── sample_project.exe
│   │   ├── stl_usage.cpp
│   │   ├── templates.cpp
│   │   └── types_variable_assignments.cpp
│   ├── sample_project_csharp
│   │   ├── README.md
│   │   └── src
│   │       └── Example.App
│   │           ├── Attributes
│   │           │   └── CustomAttributes.cs
│   │           ├── Example.App.csproj
│   │           ├── Models
│   │           │   ├── Person.cs
│   │           │   ├── Point.cs
│   │           │   ├── Role.cs
│   │           │   └── User.cs
│   │           ├── OuterClass.cs
│   │           ├── Program.cs
│   │           ├── Services
│   │           │   ├── GreetingService.cs
│   │           │   ├── IGreetingService.cs
│   │           │   └── LegacyService.cs
│   │           └── Utils
│   │               ├── CollectionHelper.cs
│   │               └── FileHelper.cs
│   ├── sample_project_go
│   │   ├── advanced_types.go
│   │   ├── basic_functions.go
│   │   ├── embedded_composition.go
│   │   ├── error_handling.go
│   │   ├── generics.go
│   │   ├── go.mod
│   │   ├── goroutines_channels.go
│   │   ├── interfaces.go
│   │   ├── packages_imports.go
│   │   ├── README.md
│   │   ├── structs_methods.go
│   │   └── util
│   │       └── helpers.go
│   ├── sample_project_java
│   │   ├── out
│   │   │   └── com
│   │   │       └── example
│   │   │           └── app
│   │   │               ├── annotations
│   │   │               │   └── Logged.class
│   │   │               ├── Main.class
│   │   │               ├── misc
│   │   │               │   ├── Outer.class
│   │   │               │   └── Outer$Inner.class
│   │   │               ├── model
│   │   │               │   ├── Role.class
│   │   │               │   └── User.class
│   │   │               ├── service
│   │   │               │   ├── AbstractGreeter.class
│   │   │               │   ├── GreetingService.class
│   │   │               │   └── impl
│   │   │               │       └── GreetingServiceImpl.class
│   │   │               └── util
│   │   │                   ├── CollectionUtils.class
│   │   │                   └── IOHelper.class
│   │   ├── README.md
│   │   ├── sources.txt
│   │   └── src
│   │       └── com
│   │           └── example
│   │               └── app
│   │                   ├── annotations
│   │                   │   └── Logged.java
│   │                   ├── Main.java
│   │                   ├── misc
│   │                   │   └── Outer.java
│   │                   ├── model
│   │                   │   ├── Role.java
│   │                   │   └── User.java
│   │                   ├── service
│   │                   │   ├── AbstractGreeter.java
│   │                   │   ├── GreetingService.java
│   │                   │   └── impl
│   │                   │       └── GreetingServiceImpl.java
│   │                   └── util
│   │                       ├── CollectionUtils.java
│   │                       └── IOHelper.java
│   ├── sample_project_javascript
│   │   ├── arrays.js
│   │   ├── asyncAwait.js
│   │   ├── classes.js
│   │   ├── dom.js
│   │   ├── errorHandling.js
│   │   ├── events.js
│   │   ├── exporter.js
│   │   ├── fetchAPI.js
│   │   ├── fixtures
│   │   │   └── js
│   │   │       └── accessors.js
│   │   ├── functions.js
│   │   ├── importer.js
│   │   ├── objects.js
│   │   ├── promises.js
│   │   ├── README.md
│   │   └── variables.js
│   ├── sample_project_kotlin
│   │   ├── AdvancedClasses.kt
│   │   ├── Annotations.kt
│   │   ├── Coroutines.kt
│   │   ├── EdgeCases.kt
│   │   ├── Functions.kt
│   │   ├── Main.kt
│   │   ├── Properties.kt
│   │   └── User.kt
│   ├── sample_project_misc
│   │   ├── index.html
│   │   ├── README.md
│   │   ├── styles.css
│   │   ├── tables.css
│   │   └── tables.html
│   ├── sample_project_php
│   │   ├── classes_objects.php
│   │   ├── database.php
│   │   ├── edgecases.php
│   │   ├── error_handling.php
│   │   ├── file_handling.php
│   │   ├── functions.php
│   │   ├── generators_iterators.php
│   │   ├── globals_superglobals.php
│   │   ├── Inheritance.php
│   │   ├── interface_traits.php
│   │   └── README.md
│   ├── sample_project_ruby
│   │   ├── class_example.rb
│   │   ├── enumerables.rb
│   │   ├── error_handling.rb
│   │   ├── file_io.rb
│   │   ├── inheritance_example.rb
│   │   ├── main.rb
│   │   ├── metaprogramming.rb
│   │   ├── mixins_example.rb
│   │   ├── module_example.rb
│   │   └── tests
│   │       ├── test_mixins.py
│   │       └── test_sample.rb
│   ├── sample_project_rust
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src
│   │       ├── basic_functions.rs
│   │       ├── concurrency.rs
│   │       ├── error_handling.rs
│   │       ├── generics.rs
│   │       ├── iterators_closures.rs
│   │       ├── lib.rs
│   │       ├── lifetimes_references.rs
│   │       ├── modules.rs
│   │       ├── smart_pointers.rs
│   │       ├── structs_enums.rs
│   │       └── traits.rs
│   ├── sample_project_scala
│   │   ├── Animals.scala
│   │   ├── Complex.scala
│   │   ├── Functional.scala
│   │   ├── Geometry.scala
│   │   ├── Main.scala
│   │   ├── PackageObject.scala
│   │   ├── Script.sc
│   │   ├── Services.scala
│   │   ├── Shapes.scala
│   │   ├── Utils.scala
│   │   └── Variables.scala
│   ├── sample_project_swift
│   │   ├── Generics.swift
│   │   ├── Main.swift
│   │   ├── README.md
│   │   ├── Shapes.swift
│   │   ├── User.swift
│   │   └── Vehicles.swift
│   ├── sample_project_typescript
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── sample_tsx.tsx
│   │   ├── src
│   │   │   ├── advanced-types.ts
│   │   │   ├── async-promises.ts
│   │   │   ├── classes-inheritance.ts
│   │   │   ├── decorators-metadata.ts
│   │   │   ├── error-validation.ts
│   │   │   ├── functions-generics.ts
│   │   │   ├── index.ts
│   │   │   ├── modules-namespaces.ts
│   │   │   ├── types-interfaces.ts
│   │   │   └── utilities-helpers.ts
│   │   └── tsconfig.json
│   ├── test_cpp_parser.py
│   ├── test_database_validation.py
│   ├── test_end_to_end.py
│   ├── test_graph_indexing_js.py
│   ├── test_graph_indexing.py
│   ├── test_kotlin_parser.py
│   ├── test_swift_parser.py
│   ├── test_tree_sitter
│   │   ├── __init__.py
│   │   ├── class_instantiation.py
│   │   ├── complex_classes.py
│   │   └── test_file.py
│   ├── test_tree_sitter_manager.py
│   └── test_typescript_parser.py
├── visualize_graph.py
├── website
│   ├── .example.env
│   ├── .gitignore
│   ├── api
│   │   └── pypi.ts
│   ├── bun.lockb
│   ├── components.json
│   ├── eslint.config.js
│   ├── index.html
│   ├── package-lock.json
│   ├── package.json
│   ├── postcss.config.js
│   ├── public
│   │   ├── favicon.ico
│   │   ├── placeholder.svg
│   │   └── robots.txt
│   ├── README.md
│   ├── src
│   │   ├── App.css
│   │   ├── App.tsx
│   │   ├── assets
│   │   │   ├── function-calls.png
│   │   │   ├── graph-total.png
│   │   │   ├── hero-graph.jpg
│   │   │   └── hierarchy.png
│   │   ├── components
│   │   │   ├── ComparisonTable.tsx
│   │   │   ├── CookbookSection.tsx
│   │   │   ├── DemoSection.tsx
│   │   │   ├── ExamplesSection.tsx
│   │   │   ├── FeaturesSection.tsx
│   │   │   ├── Footer.tsx
│   │   │   ├── HeroSection.tsx
│   │   │   ├── InstallationSection.tsx
│   │   │   ├── MoveToTop.tsx
│   │   │   ├── ShowDownloads.tsx
│   │   │   ├── ShowStarGraph.tsx
│   │   │   ├── SocialMentionsTimeline.tsx
│   │   │   ├── TestimonialSection.tsx
│   │   │   ├── ThemeProvider.tsx
│   │   │   ├── ThemeToggle.tsx
│   │   │   └── ui
│   │   │       ├── accordion.tsx
│   │   │       ├── alert-dialog.tsx
│   │   │       ├── alert.tsx
│   │   │       ├── aspect-ratio.tsx
│   │   │       ├── avatar.tsx
│   │   │       ├── badge.tsx
│   │   │       ├── breadcrumb.tsx
│   │   │       ├── button.tsx
│   │   │       ├── calendar.tsx
│   │   │       ├── card.tsx
│   │   │       ├── carousel.tsx
│   │   │       ├── chart.tsx
│   │   │       ├── checkbox.tsx
│   │   │       ├── collapsible.tsx
│   │   │       ├── command.tsx
│   │   │       ├── context-menu.tsx
│   │   │       ├── dialog.tsx
│   │   │       ├── drawer.tsx
│   │   │       ├── dropdown-menu.tsx
│   │   │       ├── form.tsx
│   │   │       ├── hover-card.tsx
│   │   │       ├── input-otp.tsx
│   │   │       ├── input.tsx
│   │   │       ├── label.tsx
│   │   │       ├── menubar.tsx
│   │   │       ├── navigation-menu.tsx
│   │   │       ├── orbiting-circles.tsx
│   │   │       ├── pagination.tsx
│   │   │       ├── popover.tsx
│   │   │       ├── progress.tsx
│   │   │       ├── radio-group.tsx
│   │   │       ├── resizable.tsx
│   │   │       ├── scroll-area.tsx
│   │   │       ├── select.tsx
│   │   │       ├── separator.tsx
│   │   │       ├── sheet.tsx
│   │   │       ├── sidebar.tsx
│   │   │       ├── skeleton.tsx
│   │   │       ├── slider.tsx
│   │   │       ├── sonner.tsx
│   │   │       ├── switch.tsx
│   │   │       ├── table.tsx
│   │   │       ├── tabs.tsx
│   │   │       ├── textarea.tsx
│   │   │       ├── toast.tsx
│   │   │       ├── toaster.tsx
│   │   │       ├── toggle-group.tsx
│   │   │       ├── toggle.tsx
│   │   │       ├── tooltip.tsx
│   │   │       └── use-toast.ts
│   │   ├── hooks
│   │   │   ├── use-mobile.tsx
│   │   │   └── use-toast.ts
│   │   ├── index.css
│   │   ├── lib
│   │   │   └── utils.ts
│   │   ├── main.tsx
│   │   ├── pages
│   │   │   ├── Index.tsx
│   │   │   └── NotFound.tsx
│   │   └── vite-env.d.ts
│   ├── tailwind.config.ts
│   ├── tsconfig.app.json
│   ├── tsconfig.json
│   ├── tsconfig.node.json
│   ├── vercel.json
│   └── vite.config.ts
└── windows_setup_guide.md
```

# Files

--------------------------------------------------------------------------------
/docs/docs/architecture.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Architecture Documentation
 2 | 
 3 | This document provides a detailed overview of the architecture of the CodeGraphContext project.
 4 | 
 5 | ## High-Level Overview
 6 | 
 7 | The project is a client-server application designed to analyze and visualize codebases. It consists of:
 8 | 
 9 | *   **A Python backend:** This is the core of the application, responsible for parsing and analyzing code, building a graph representation of the codebase, and exposing this data through an API.
10 | *   **A web-based frontend:** A user interface for interacting with the backend, visualizing the code graph, and exploring the codebase.
11 | *   **A command-line interface (CLI):** For managing the backend and performing analysis from the terminal.
12 | 
13 | ## Backend Architecture
14 | 
15 | The backend is a Python application located in the `src/codegraphcontext` directory.
16 | 
17 | ### Core Components
18 | 
19 | The `src/codegraphcontext/core` directory contains the fundamental building blocks of the backend:
20 | 
21 | *   **Database:** A graph database is used to store the code graph. This allows for efficient querying of relationships between code elements (e.g., function calls, class inheritance).
22 | *   **Jobs:** Asynchronous jobs are used for long-running tasks like indexing a new codebase. This prevents the application from becoming unresponsive.
23 | *   **Watcher:** A file system watcher monitors the codebase for changes and triggers re-indexing, keeping the code graph up-to-date.
24 | 
25 | ### Tools
26 | 
27 | The `src/codegraphcontext/tools` directory contains the logic for code analysis:
28 | 
29 | *   **Graph Builder:** This component is responsible for parsing the code and building the graph representation that is stored in the database.
30 | *   **Code Finder:** Provides functionality to search for specific code elements within the indexed codebase.
31 | *   **Import Extractor:** This tool analyzes the import statements in the code to understand dependencies between modules.
32 | 
33 | ### Server
34 | 
35 | The `src/codegraphcontext/server.py` file implements the API server. It exposes the functionality of the backend to the frontend through a JSON-RPC API.
36 | 
37 | ### CLI
38 | 
39 | The `src/codegraphcontext/cli` directory contains the implementation of the command-line interface. It allows users to:
40 | 
41 | *   Start and stop the backend server.
42 | *   Index new projects.
43 | *   Run analysis tools from the command line.
44 | 
45 | ## Frontend Architecture
46 | 
47 | The frontend is a modern web application located in the `website/` directory.
48 | 
49 | *   **Framework:** It is built using React and TypeScript.
50 | *   **Build Tool:** Vite is used for fast development and building the application.
51 | *   **Component-Based:** The UI is organized into reusable components, located in `website/src/components`. This includes UI elements like buttons and dialogs, as well as higher-level components for different sections of the application.
52 | *   **Styling:** Tailwind CSS is used for styling the application.
53 | 
54 | ## Testing
55 | 
56 | The `tests/` directory contains the test suite for the project.
57 | 
58 | *   **Integration Tests:** `test_cgc_integration.py` contains tests that verify the interaction between different components of the backend.
59 | *   **Unit Tests:** Other files in this directory contain unit tests for specific modules and functions.
60 | *   **Sample Project:** The `tests/sample_project` directory contains a variety of Python files used as input for testing the code analysis tools.
61 | 
```

--------------------------------------------------------------------------------
/organizer/docs.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Architecture Documentation
 2 | 
 3 | This document provides a detailed overview of the architecture of the CodeGraphContext project.
 4 | 
 5 | ## High-Level Overview
 6 | 
 7 | The project is a client-server application designed to analyze and visualize codebases. It consists of:
 8 | 
 9 | *   **A Python backend:** This is the core of the application, responsible for parsing and analyzing code, building a graph representation of the codebase, and exposing this data through an API.
10 | *   **A web-based frontend:** A user interface for interacting with the backend, visualizing the code graph, and exploring the codebase.
11 | *   **A command-line interface (CLI):** For managing the backend and performing analysis from the terminal.
12 | 
13 | ## Backend Architecture
14 | 
15 | The backend is a Python application located in the `src/codegraphcontext` directory.
16 | 
17 | ### Core Components
18 | 
19 | The `src/codegraphcontext/core` directory contains the fundamental building blocks of the backend:
20 | 
21 | *   **Database:** A graph database is used to store the code graph. This allows for efficient querying of relationships between code elements (e.g., function calls, class inheritance).
22 | *   **Jobs:** Asynchronous jobs are used for long-running tasks like indexing a new codebase. This prevents the application from becoming unresponsive.
23 | *   **Watcher:** A file system watcher monitors the codebase for changes and triggers re-indexing, keeping the code graph up-to-date.
24 | 
25 | ### Tools
26 | 
27 | The `src/codegraphcontext/tools` directory contains the logic for code analysis:
28 | 
29 | *   **Graph Builder:** This component is responsible for parsing the code and building the graph representation that is stored in the database.
30 | *   **Code Finder:** Provides functionality to search for specific code elements within the indexed codebase.
31 | *   **Import Extractor:** This tool analyzes the import statements in the code to understand dependencies between modules.
32 | 
33 | ### Server
34 | 
35 | The `src/codegraphcontext/server.py` file implements the API server. It exposes the functionality of the backend to the frontend through a JSON-RPC API.
36 | 
37 | ### CLI
38 | 
39 | The `src/codegraphcontext/cli` directory contains the implementation of the command-line interface. It allows users to:
40 | 
41 | *   Start and stop the backend server.
42 | *   Index new projects.
43 | *   Run analysis tools from the command line.
44 | 
45 | ## Frontend Architecture
46 | 
47 | The frontend is a modern web application located in the `website/` directory.
48 | 
49 | *   **Framework:** It is built using React and TypeScript.
50 | *   **Build Tool:** Vite is used for fast development and building the application.
51 | *   **Component-Based:** The UI is organized into reusable components, located in `website/src/components`. This includes UI elements like buttons and dialogs, as well as higher-level components for different sections of the application.
52 | *   **Styling:** Tailwind CSS is used for styling the application.
53 | 
54 | ## Testing
55 | 
56 | The `tests/` directory contains the test suite for the project.
57 | 
58 | *   **Integration Tests:** `test_cgc_integration.py` contains tests that verify the interaction between different components of the backend.
59 | *   **Unit Tests:** Other files in this directory contain unit tests for specific modules and functions.
60 | *   **Sample Project:** The `tests/sample_project` directory contains a variety of Python files used as input for testing the code analysis tools.
61 | 
```

--------------------------------------------------------------------------------
/website/tailwind.config.ts:
--------------------------------------------------------------------------------

```typescript
  1 | import type { Config } from "tailwindcss";
  2 | 
  3 | export default {
  4 |   darkMode: ["class"],
  5 |   content: ["./pages/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", "./app/**/*.{ts,tsx}", "./src/**/*.{ts,tsx}"],
  6 |   prefix: "",
  7 |   theme: {
  8 |     container: {
  9 |       center: true,
 10 |       padding: "2rem",
 11 |       screens: {
 12 |         "2xl": "1400px",
 13 |       },
 14 |     },
 15 |     extend: {
 16 |       colors: {
 17 |         border: "hsl(var(--border))",
 18 |         input: "hsl(var(--input))",
 19 |         ring: "hsl(var(--ring))",
 20 |         background: "hsl(var(--background))",
 21 |         foreground: "hsl(var(--foreground))",
 22 |         primary: {
 23 |           DEFAULT: "hsl(var(--primary))",
 24 |           foreground: "hsl(var(--primary-foreground))",
 25 |         },
 26 |         secondary: {
 27 |           DEFAULT: "hsl(var(--secondary))",
 28 |           foreground: "hsl(var(--secondary-foreground))",
 29 |         },
 30 |         destructive: {
 31 |           DEFAULT: "hsl(var(--destructive))",
 32 |           foreground: "hsl(var(--destructive-foreground))",
 33 |         },
 34 |         muted: {
 35 |           DEFAULT: "hsl(var(--muted))",
 36 |           foreground: "hsl(var(--muted-foreground))",
 37 |         },
 38 |         accent: {
 39 |           DEFAULT: "hsl(var(--accent))",
 40 |           foreground: "hsl(var(--accent-foreground))",
 41 |         },
 42 |         popover: {
 43 |           DEFAULT: "hsl(var(--popover))",
 44 |           foreground: "hsl(var(--popover-foreground))",
 45 |         },
 46 |         card: {
 47 |           DEFAULT: "hsl(var(--card))",
 48 |           foreground: "hsl(var(--card-foreground))",
 49 |         },
 50 |         sidebar: {
 51 |           DEFAULT: "hsl(var(--sidebar-background))",
 52 |           foreground: "hsl(var(--sidebar-foreground))",
 53 |           primary: "hsl(var(--sidebar-primary))",
 54 |           "primary-foreground": "hsl(var(--sidebar-primary-foreground))",
 55 |           accent: "hsl(var(--sidebar-accent))",
 56 |           "accent-foreground": "hsl(var(--sidebar-accent-foreground))",
 57 |           border: "hsl(var(--sidebar-border))",
 58 |           ring: "hsl(var(--sidebar-ring))",
 59 |         },
 60 |         // Graph-specific colors
 61 |         "graph-node-1": "hsl(var(--graph-node-1))",
 62 |         "graph-node-2": "hsl(var(--graph-node-2))",
 63 |         "graph-node-3": "hsl(var(--graph-node-3))",
 64 |         "graph-edge": "hsl(var(--graph-edge))",
 65 |       },
 66 |       backgroundImage: {
 67 |         "gradient-primary": "var(--gradient-primary)",
 68 |         "gradient-hero": "var(--gradient-hero)",
 69 |         "gradient-card": "var(--gradient-card)",
 70 |       },
 71 |       boxShadow: {
 72 |         "glow": "var(--shadow-glow)",
 73 |         "card": "var(--shadow-card)",
 74 |       },
 75 |       transitionTimingFunction: {
 76 |         "smooth": "var(--transition-smooth)",
 77 |         "bounce": "var(--transition-bounce)",
 78 |       },
 79 |       borderRadius: {
 80 |         lg: "var(--radius)",
 81 |         md: "calc(var(--radius) - 2px)",
 82 |         sm: "calc(var(--radius) - 4px)",
 83 |       },
 84 |       keyframes: {
 85 |         "accordion-down": {
 86 |           from: {
 87 |             height: "0",
 88 |           },
 89 |           to: {
 90 |             height: "var(--radix-accordion-content-height)",
 91 |           },
 92 |         },
 93 |         "accordion-up": {
 94 |           from: {
 95 |             height: "var(--radix-accordion-content-height)",
 96 |           },
 97 |           to: {
 98 |             height: "0",
 99 |           },
100 |         },
101 |       },
102 |       animation: {
103 |         "accordion-down": "accordion-down 0.2s ease-out",
104 |         "accordion-up": "accordion-up 0.2s ease-out",
105 |       },
106 |     },
107 |   },
108 |   plugins: [require("tailwindcss-animate")],
109 | } satisfies Config;
110 | 
```

--------------------------------------------------------------------------------
/src/codegraphcontext/tools/advanced_language_query_tool.py:
--------------------------------------------------------------------------------

```python
  1 | import re
  2 | import logging
  3 | #importing all the language toolkits
  4 | from ..tools.query_tool_languages.c_toolkit import CToolkit
  5 | from ..tools.query_tool_languages.cpp_toolkit import CppToolkit
  6 | from ..tools.query_tool_languages.go_toolkit import GoToolkit
  7 | from ..tools.query_tool_languages.java_toolkit import JavaToolkit
  8 | from ..tools.query_tool_languages.javascript_toolkit import JavascriptToolkit
  9 | from ..tools.query_tool_languages.python_toolkit import PythonToolkit
 10 | from ..tools.query_tool_languages.ruby_toolkit import RubyToolkit
 11 | from ..tools.query_tool_languages.rust_toolkit import RustToolkit
 12 | from ..tools.query_tool_languages.typescript_toolkit import TypescriptToolkit
 13 | from ..tools.query_tool_languages.csharp_toolkit import CSharpToolkit
 14 | 
 15 | from ..core.database import DatabaseManager
 16 | from ..utils.debug_log import debug_log
 17 | 
 18 | logger = logging.getLogger(__name__)
 19 | 
 20 | class Advanced_language_query:
 21 |     """
 22 |     Tool implementation for executing a read-only language specific Cypher query.
 23 |     
 24 |     Important: Includes a safety check to prevent any database modification
 25 |     by disallowing keywords like CREATE, MERGE, DELETE, etc.
 26 |     """
 27 | 
 28 |     TOOLKITS = {
 29 |         "c": CToolkit,
 30 |         "cpp": CppToolkit,
 31 |         "go": GoToolkit,
 32 |         "java": JavaToolkit,
 33 |         "javascript": JavascriptToolkit,
 34 |         "python": PythonToolkit,
 35 |         "ruby": RubyToolkit,
 36 |         "rust": RustToolkit,
 37 |         "typescript": TypescriptToolkit,
 38 |         "c_sharp": CSharpToolkit
 39 |     }
 40 |     Supported_queries = {
 41 |         "repository": "Repository",
 42 |         "directory": "Directory",
 43 |         "file": "File",
 44 |         "module": "Module",
 45 |         "function": "Function",
 46 |         "class": "Class",
 47 |         "struct": "Struct",
 48 |         "enum": "Enum",
 49 |         "union": "Union",
 50 |         "macro": "Macro",
 51 |         "variable": "Variable"
 52 |     }
 53 | 
 54 | 
 55 |     def __init__(self, db_manager: DatabaseManager):
 56 |         self.db_manager = db_manager
 57 | 
 58 |     def advanced_language_query(self, language: str, query: str):
 59 |         # Validating whether query is valid or not
 60 |         query = query.strip().lower()
 61 |         if query not in self.Supported_queries:
 62 |             raise ValueError(
 63 |                 f"Unsupported query type '{query}'"
 64 |                 f"Supported: {', '.join(self.Supported_queries.keys())}"
 65 |             )
 66 |         label = self.Supported_queries[query]
 67 | 
 68 |         # Set toolkit for the specified language
 69 |         language = language.lower()
 70 | 
 71 |         if language not in self.TOOLKITS:
 72 |             raise ValueError(f"Unsupported language: {language}")
 73 |         self.toolkit = self.TOOLKITS[language]()
 74 | 
 75 |         # Getting the language query
 76 |         cypher_query = self.toolkit.get_cypher_query(label)
 77 |         try:
 78 |             debug_log(f"Executing Cypher query: {cypher_query}")
 79 |             with self.db_manager.get_driver().session() as session:
 80 |                 result = session.run(cypher_query)
 81 |                 # Convert results to a list of dictionaries for clean JSON serialization
 82 |                 records = [record.data() for record in result]
 83 | 
 84 |                 return {
 85 |                     "success": True, 
 86 |                     "language": language,
 87 |                     "query": cypher_query,
 88 |                     "results": records 
 89 |                 }
 90 |         except Exception as e:
 91 |             debug_log(f"Error executing Cypher query: {str(e)}")
 92 |             return {
 93 |                 "error": "An unexpected error occurred while executing the query.",
 94 |                 "details": str(e)
 95 |             }
 96 | 
 97 | 
 98 | 
 99 | 
100 | 
```

--------------------------------------------------------------------------------
/docs/docs/use_cases.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Real World Use Cases
 2 | 
 3 | CodeGraphContext can be a powerful ally in your daily coding journey. Here are some real-world scenarios where it can significantly boost your productivity and understanding of a codebase:
 4 | 
 5 | 1.  **Onboarding New Developers:** A new team member can quickly get up to speed by asking questions like:
 6 |     -   "Where is the authentication logic handled?"
 7 |     -   "Show me the main entry point of the application."
 8 | 
 9 | 2.  **Impact Analysis:** Before making a change, assess the potential ripple effects:
10 |     -   "What other parts of the code will be affected if I change the `calculate_total` function?"
11 | 
12 | 3.  **Code Review:** Gain context on pull requests faster:
13 |     -   "Show me the callers of this new function."
14 |     -   "Does this change introduce any new dependencies?"
15 | 
16 | 4.  **Debugging:** Trace execution flows to pinpoint the source of a bug:
17 |     -   "Show me the call chain from `handle_request` to `process_payment`."
18 | 
19 | 5.  **Refactoring:** Identify and plan large-scale code changes:
20 |     -   "Find all instances of the deprecated `OldApiClass`."
21 |     -   "List all functions that use the `urllib` library so I can replace them with `requests`."
22 | 
23 | 6.  **Identifying Code Smells:** Proactively find areas that need improvement:
24 |     -   "Find the 10 most complex functions in the codebase."
25 |     -   "Show me functions with more than 5 arguments."
26 | 
27 | 7.  **Security Audits:** Search for potentially vulnerable code patterns:
28 |     -   "Find all functions that use the `eval` function."
29 |     -   "Show me where raw SQL queries are being executed."
30 | 
31 | 8.  **Automated Documentation:** Use the tool's understanding of the code to generate documentation. (This is what this agent is doing!)
32 | 
33 | 9.  **Dependency Management:** Understand how your project uses its dependencies:
34 |     -   "Which files import the `requests` library?"
35 |     -   "Are there any circular dependencies between modules?"
36 | 
37 | 10. **Cleaning Up Unused Code:** Keep your codebase lean and maintainable:
38 |     -   "Is there any dead or unused code in this project?"
39 | 
40 | 11. **Exploring a Large Codebase:** Navigate large, unfamiliar projects with ease:
41 |     -   "List all the classes in the `core` module."
42 |     -   "What are the top-level functions in the `utils` directory?"
43 | 
44 | 12. **Enforcing Coding Standards:** Check for adherence to team conventions:
45 |     -   "Find all functions that are not decorated with `@log_execution`."
46 |     -   "Show me all public methods that don't have a docstring."
47 | 
48 | 13. **Discovering API Usage:** Find examples of how to use internal or external APIs:
49 |     -   "Show me how other parts of the code use the `UserService`."
50 | 
51 | 14. **Improving Test Coverage:** Identify areas that may lack test coverage:
52 |     -   "Find all functions that are not called by any test files."
53 | 
54 | 15. **Visualizing Code Structure:** Get a bird's-eye view of your project's architecture:
55 |     -   "Generate a graph visualization of the `auth` module and its dependencies."
56 | 
57 | 16. **Learning a New Framework:** Understand how a new framework operates by exploring its source code.
58 | 
59 | 17. **Code Archeology:** Investigate legacy code to understand its history and purpose.
60 | 
61 | 18. **Planning a Migration:** Identify all points of contact when migrating a library or framework:
62 |     -   "Find all the places where the `old_payment_gateway` is used."
63 | 
64 | 19. **Knowledge Sharing:** Use the code graph as a centralized, always-up-to-date knowledge base for your team.
65 | 
66 | 20. **Automated Code Reviews:** Integrate CodeGraphContext into your CI/CD pipeline to automatically flag potential issues in pull requests.
67 | 
```

--------------------------------------------------------------------------------
/tests/test_kotlin_parser.py:
--------------------------------------------------------------------------------

```python
 1 | import pytest
 2 | from pathlib import Path
 3 | import sys
 4 | import os
 5 | 
 6 | # Ensure src is in path
 7 | sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")))
 8 | 
 9 | from codegraphcontext.tools.languages.kotlin import KotlinTreeSitterParser
10 | from codegraphcontext.tools.graph_builder import TreeSitterParser
11 | from codegraphcontext.utils.tree_sitter_manager import get_tree_sitter_manager
12 | 
13 | @pytest.fixture
14 | def parser():
15 |     """Returns an instance of the Kotlin parser via generic wrapper."""
16 |     return TreeSitterParser('kotlin')
17 | 
18 | @pytest.fixture
19 | def sample_project_path():
20 |     """Returns the path to the sample Kotlin project."""
21 |     return Path(__file__).parent / "sample_project_kotlin"
22 | 
23 | def test_parse_main_kt(parser, sample_project_path):
24 |     """Test parsing of Main.kt."""
25 |     file_path = sample_project_path / "Main.kt"
26 |     result = parser.parse(file_path, is_dependency=False)
27 | 
28 |     assert result["file_path"] == str(file_path)
29 |     
30 |     # Check Classes
31 |     classes = {c["name"] for c in result["classes"]}
32 |     assert "Main" in classes
33 |     assert "Calculator" in classes
34 | 
35 |     # Check Functions in Main
36 |     # Functions are returned in a flat list with 'class_context'
37 |     main_functions = [f for f in result["functions"] if f.get("class_context") == "Main"]
38 |     method_names = {m["name"] for m in main_functions}
39 |     assert "main" in method_names
40 |     
41 |     # Check Call to User.greet
42 |     # Calls are in result["function_calls"]
43 |     greet_call = next((c for c in result["function_calls"] if c["name"] == "greet"), None)
44 |     assert greet_call is not None, "Should detect call to greet()"
45 |     
46 |     # Verify type inference for the call (user.greet())
47 |     # The variable 'user' is initialized with 'User(...)', so inferred_obj_type should be 'User'
48 |     assert greet_call.get("inferred_obj_type") == "User"
49 | 
50 | def test_parse_user_kt(parser, sample_project_path):
51 |     """Test parsing of User.kt (Data Class and Interface)."""
52 |     file_path = sample_project_path / "User.kt"
53 |     result = parser.parse(file_path, is_dependency=False)
54 | 
55 |     # Check Interface
56 |     classes = {c["name"]: c for c in result["classes"]}
57 |     assert "Greeter" in classes
58 | 
59 |     # Check Data Class
60 |     assert "User" in classes
61 |     user_class = classes["User"]
62 |     
63 |     # Verify inheritance
64 |     assert "Greeter" in user_class.get("bases", [])
65 | 
66 |     # Check method override
67 |     user_methods = [f for f in result["functions"] if f.get("class_context") == "User"]
68 |     method_names = {m["name"] for m in user_methods}
69 |     assert "greet" in method_names
70 | 
71 | def test_type_inference_calculator(parser, sample_project_path):
72 |     """Test type inference for a simple local class usage."""
73 |     file_path = sample_project_path / "Main.kt"
74 |     result = parser.parse(file_path, is_dependency=False)
75 |     
76 |     # val calculator = Calculator()
77 |     # println(calculator.add(5, 10))
78 |     
79 |     add_call = next((c for c in result["function_calls"] if c["name"] == "add"), None)
80 |     assert add_call is not None
81 |     assert add_call.get("inferred_obj_type") == "Calculator"
82 | 
83 | def test_import_resolution_support(parser, sample_project_path):
84 |     """Test that imports are correctly extracted."""
85 |     file_path = sample_project_path / "Main.kt"
86 |     result = parser.parse(file_path, is_dependency=False)
87 |     
88 |     imports = result.get("imports", [])
89 |     assert len(imports) > 0
90 |     
91 |     # Imports have "name" (path) and "full_import_name"
92 |     found = False
93 |     for imp in imports:
94 |         if "com.example.project.User" in imp.get("name", ""):
95 |             found = True
96 |             break
97 |     assert found, "Should find import for User"
98 | 
```

--------------------------------------------------------------------------------
/docs/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js:
--------------------------------------------------------------------------------

```javascript
1 | !function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var r;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(t){r=t,this.cursor=0,this.limit=t.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var t=r;return r=null,t},in_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e>s||e<i)return this.cursor++,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e<i)return this.cursor--,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor+s)!=i.charCodeAt(s))return!1;return this.cursor+=t,!0},eq_s_b:function(t,i){if(this.cursor-this.limit_backward<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor-t+s)!=i.charCodeAt(s))return!1;return this.cursor-=t,!0},find_among:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=l;m<_.s_size;m++){if(n+l==u){f=-1;break}if(f=r.charCodeAt(n+l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=_.s_size-1-l;m>=0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if((s=_.substring_i)<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});
```

--------------------------------------------------------------------------------
/src/codegraphcontext/cli/setup_macos.py:
--------------------------------------------------------------------------------

```python
 1 | # src/codegraphcontext/cli/setup_macos.py
 2 | import platform
 3 | import time
 4 | from pathlib import Path
 5 | 
 6 | def _has_brew(run_command, console) -> bool:
 7 |     return run_command(["which", "brew"], console, check=False) is not None
 8 | 
 9 | def _brew_install_neo4j(run_command, console) -> str:
10 |     if run_command(["brew", "install", "neo4j@5"], console, check=False):
11 |         return "neo4j@5"
12 |     if run_command(["brew", "install", "neo4j"], console, check=False):
13 |         return "neo4j"
14 |     return ""
15 | 
16 | def _brew_start(service: str, run_command, console) -> bool:
17 |     return run_command(["brew", "services", "start", service], console, check=False) is not None
18 | 
19 | def _set_initial_password(new_pw: str, run_command, console) -> bool:
20 |     cmd = [
21 |         "cypher-shell",
22 |         "-u", "neo4j",
23 |         "-p", "neo4j",
24 |         f"ALTER CURRENT USER SET PASSWORD FROM 'neo4j' TO '{new_pw}'",
25 |     ]
26 |     return run_command(cmd, console, check=False) is not None
27 | 
28 | def setup_macos_binary(console, prompt, run_command, _generate_mcp_json):
29 |     """Automates Neo4j install & config on macOS via Homebrew."""
30 |     os_name = platform.system()
31 |     console.print(f"Detected Operating System: [bold yellow]{os_name}[/bold yellow]")
32 | 
33 |     if os_name != "Darwin":
34 |         console.print("[yellow]This installer is for macOS only.[/yellow]")
35 |         return
36 | 
37 |     console.print("[bold]Starting automated Neo4j installation for macOS.[/bold]")
38 | 
39 |     if not prompt([{
40 |         "type": "confirm",
41 |         "message": "Proceed with Homebrew-based install of Neo4j?",
42 |         "name": "proceed",
43 |         "default": True
44 |     }]).get("proceed"):
45 |         return
46 | 
47 |     console.print("\n[bold]Step: Checking for Homebrew...[/bold]")
48 |     if not _has_brew(run_command, console):
49 |         console.print(
50 |             "[bold red]Homebrew not found.[/bold red] "
51 |             "Install from [bold blue]https://brew.sh[/bold blue] and re-run this setup."
52 |         )
53 |         return
54 | 
55 |     console.print("\n[bold]Step: Installing Neo4j via Homebrew...[/bold]")
56 |     service = _brew_install_neo4j(run_command, console)
57 |     if not service:
58 |         console.print("[bold red]Failed to install Neo4j via Homebrew.[/bold red]")
59 |         return
60 | 
61 |     console.print(f"\n[bold]Step: Starting Neo4j service ({service})...[/bold]")
62 |     if not _brew_start(service, run_command, console):
63 |         console.print("[bold red]Failed to start Neo4j with brew services.[/bold red]")
64 |         return
65 | 
66 |     while True:
67 |         answers = prompt([
68 |             {"type": "password", "message": "Enter a new password for Neo4j:", "name": "pw"},
69 |             {"type": "password", "message": "Confirm the new password:", "name": "pw2"},
70 |         ]) or {}
71 |         if not answers:
72 |             return
73 |         pw, pw2 = answers.get("pw"), answers.get("pw2")
74 |         if pw and pw == pw2:
75 |             new_password = pw
76 |             break
77 |         console.print("[red]Passwords do not match or are empty. Please try again.[/red]")
78 | 
79 |     console.print("\n[yellow]Waiting 10 seconds for Neo4j to finish starting...[/yellow]")
80 |     time.sleep(10)
81 | 
82 |     console.print("\n[bold]Step: Setting initial password with cypher-shell...[/bold]")
83 |     if not _set_initial_password(new_password, run_command, console):
84 |         console.print(
85 |             "[bold red]Failed to set the initial password.[/bold red]\n"
86 |             "Try manually:\n"
87 |             "  cypher-shell -u neo4j -p neo4j \"ALTER CURRENT USER SET PASSWORD FROM 'neo4j' TO '<your_pw>'\""
88 |         )
89 |         return
90 | 
91 |     creds = {"uri": "neo4j://localhost:7687", "username": "neo4j", "password": new_password}
92 |     _generate_mcp_json(creds)
93 | 
94 |     env_path = Path.home() / ".codegraphcontext" / ".env"
95 |     console.print(f"\n[bold green]All done![/bold green] Neo4j running. Credentials saved to: [bold]{env_path}[/bold]")
96 | 
```

--------------------------------------------------------------------------------
/windows_setup_guide.md:
--------------------------------------------------------------------------------

```markdown
  1 | # CodeGraphContext – Windows Setup Guide
  2 | 
  3 | This guide explains how to set up **CodeGraphContext on Windows**.
  4 | 
  5 | ⚠️ **Important Note for Windows Users**
  6 | - **FalkorDB Lite (redislite) is not supported natively on Windows**
  7 | - Recommended approach: **Use WSL (Windows Subsystem for Linux)**
  8 | - Alternative: Use **Neo4j** as the database backend
  9 | 
 10 | ---
 11 | 
 12 | ## Option 1 (Recommended): Setup Using WSL
 13 | 
 14 | WSL allows you to run CodeGraphContext in a Linux environment on Windows, enabling **FalkorDB Lite** and ensuring the smoothest setup experience.
 15 | 
 16 | ---
 17 | 
 18 | ### Step 1: Install WSL
 19 | 
 20 | Open **PowerShell as Administrator** and run:
 21 | 
 22 | ```powershell
 23 | wsl --install
 24 | ````
 25 | 
 26 | Restart your system if prompted.
 27 | 
 28 | Verify WSL installation:
 29 | 
 30 | ```powershell
 31 | wsl --version
 32 | ```
 33 | 
 34 | ---
 35 | 
 36 | ### Step 2: Open Ubuntu (WSL Terminal)
 37 | 
 38 | After restart:
 39 | 
 40 | * Open the Start Menu
 41 | * Search for **Ubuntu**
 42 | * Open it
 43 | 
 44 | Update packages:
 45 | 
 46 | ```bash
 47 | sudo apt update
 48 | sudo apt upgrade -y
 49 | ```
 50 | 
 51 | ---
 52 | 
 53 | ### Step 3: Install Python (3.12+ Recommended)
 54 | 
 55 | Inside the WSL terminal:
 56 | 
 57 | ```bash
 58 | sudo apt install python3.12 python3-pip -y
 59 | ```
 60 | 
 61 | Verify installation:
 62 | 
 63 | ```bash
 64 | python3 --version
 65 | pip3 --version
 66 | ```
 67 | 
 68 | > CodeGraphContext supports **Python 3.10 – 3.14**.
 69 | > **FalkorDB Lite works best with Python 3.12+**.
 70 | 
 71 | ---
 72 | 
 73 | ### Step 4: Install CodeGraphContext
 74 | 
 75 | ```bash
 76 | pip install codegraphcontext
 77 | ```
 78 | 
 79 | Verify installation:
 80 | 
 81 | ```bash
 82 | cgc --help
 83 | ```
 84 | 
 85 | ---
 86 | 
 87 | ### Step 5: Index a Project
 88 | 
 89 | Navigate to your project directory.
 90 | 
 91 | Example (accessing Windows files from WSL):
 92 | 
 93 | ```bash
 94 | cd /mnt/c/Users/<yourname>/Desktop/<your-project-folder>
 95 | ```
 96 | 
 97 | Index the codebase:
 98 | 
 99 | ```bash
100 | cgc index .
101 | ```
102 | 
103 | ---
104 | 
105 | ### Step 6 (Optional): Live Watch Mode
106 | 
107 | To automatically update the graph when files change:
108 | 
109 | ```bash
110 | cgc watch .
111 | ```
112 | 
113 | ---
114 | 
115 | ### Step 7 (Optional): MCP Setup (AI Integration)
116 | 
117 | To use CodeGraphContext as an MCP server for AI assistants/IDEs:
118 | 
119 | ```bash
120 | cgc mcp setup
121 | ```
122 | 
123 | Start the MCP server:
124 | 
125 | ```bash
126 | cgc mcp start
127 | ```
128 | 
129 | ---
130 | 
131 | ## Option 2: Native Windows Setup Using Neo4j
132 | 
133 | If you do not want WSL, CodeGraphContext can be configured to use **Neo4j** as its database backend.
134 | 
135 | ---
136 | 
137 | ### Step 1: Install Python (Windows)
138 | 
139 | Download Python from:
140 | [https://www.python.org/downloads/](https://www.python.org/downloads/)
141 | 
142 | During installation, ensure:
143 | ✅ **Add Python to PATH**
144 | 
145 | Verify:
146 | 
147 | ```powershell
148 | python --version
149 | pip --version
150 | ```
151 | 
152 | ---
153 | 
154 | ### Step 2: Install CodeGraphContext
155 | 
156 | ```powershell
157 | pip install codegraphcontext
158 | ```
159 | 
160 | Verify:
161 | 
162 | ```powershell
163 | cgc --help
164 | ```
165 | 
166 | ---
167 | 
168 | ### Step 3: Install & Run Neo4j
169 | 
170 | Neo4j can be installed using one of the following:
171 | 
172 | * Neo4j Desktop (GUI)
173 | * Neo4j via Docker (recommended)
174 | * Neo4j AuraDB (cloud)
175 | 
176 | Ensure Neo4j is running and note:
177 | 
178 | * URI (example: `bolt://localhost:7687`)
179 | * Username
180 | * Password
181 | 
182 | ---
183 | 
184 | ### Step 4: Configure Neo4j in CodeGraphContext
185 | 
186 | Run:
187 | 
188 | ```bash
189 | cgc neo4j setup
190 | ```
191 | 
192 | Follow the prompts to enter your Neo4j credentials.
193 | 
194 | ---
195 | 
196 | ### Step 5: Index a Project
197 | 
198 | Navigate to your project:
199 | 
200 | ```powershell
201 | cd path\to\your\project
202 | ```
203 | 
204 | Index the codebase:
205 | 
206 | ```powershell
207 | cgc index .
208 | ```
209 | 
210 | ---
211 | 
212 | ## Ignoring Files (`.cgcignore`)
213 | 
214 | To ignore files and folders while indexing, create a `.cgcignore` file in your project root.
215 | 
216 | Example `.cgcignore`:
217 | 
218 | ```txt
219 | /build/
220 | /dist/
221 | /node_modules/
222 | /vendor/
223 | *.log
224 | ```
225 | 
226 | ---
227 | 
228 | ## Common Windows Issues
229 | 
230 | ### `'cgc' command not found`
231 | 
232 | * Restart your terminal after installation
233 | * Ensure Python Scripts directory is in PATH
234 | * Try: `python -m pip install codegraphcontext`
235 | 
236 | ### WSL path confusion
237 | 
238 | Windows drives can be accessed from WSL using:
239 | 
240 | ```bash
241 | cd /mnt/c/
242 | ```
243 | 
244 | ### Neo4j connection issues
245 | 
246 | * Ensure Neo4j is running
247 | * Check URI format: `bolt://localhost:7687`
248 | * Double-check username/password
249 | 
250 | ---
251 | 
252 | ## Verify Installation
253 | 
254 | Run:
255 | 
256 | ```bash
257 | cgc list
258 | ```
259 | If no errors are shown, setup is complete 
260 | 
261 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/dialog.tsx:
--------------------------------------------------------------------------------

```typescript
 1 | import * as React from "react";
 2 | import * as DialogPrimitive from "@radix-ui/react-dialog";
 3 | import { X } from "lucide-react";
 4 | 
 5 | import { cn } from "@/lib/utils";
 6 | 
 7 | const Dialog = DialogPrimitive.Root;
 8 | 
 9 | const DialogTrigger = DialogPrimitive.Trigger;
10 | 
11 | const DialogPortal = DialogPrimitive.Portal;
12 | 
13 | const DialogClose = DialogPrimitive.Close;
14 | 
15 | const DialogOverlay = React.forwardRef<
16 |   React.ElementRef<typeof DialogPrimitive.Overlay>,
17 |   React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
18 | >(({ className, ...props }, ref) => (
19 |   <DialogPrimitive.Overlay
20 |     ref={ref}
21 |     className={cn(
22 |       "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
23 |       className,
24 |     )}
25 |     {...props}
26 |   />
27 | ));
28 | DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
29 | 
30 | const DialogContent = React.forwardRef<
31 |   React.ElementRef<typeof DialogPrimitive.Content>,
32 |   React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
33 | >(({ className, children, ...props }, ref) => (
34 |   <DialogPortal>
35 |     <DialogOverlay />
36 |     <DialogPrimitive.Content
37 |       ref={ref}
38 |       className={cn(
39 |         "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
40 |         className,
41 |       )}
42 |       {...props}
43 |     >
44 |       {children}
45 |       <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none">
46 |         <X className="h-4 w-4" />
47 |         <span className="sr-only">Close</span>
48 |       </DialogPrimitive.Close>
49 |     </DialogPrimitive.Content>
50 |   </DialogPortal>
51 | ));
52 | DialogContent.displayName = DialogPrimitive.Content.displayName;
53 | 
54 | const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
55 |   <div className={cn("flex flex-col space-y-1.5 text-center sm:text-left", className)} {...props} />
56 | );
57 | DialogHeader.displayName = "DialogHeader";
58 | 
59 | const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
60 |   <div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props} />
61 | );
62 | DialogFooter.displayName = "DialogFooter";
63 | 
64 | const DialogTitle = React.forwardRef<
65 |   React.ElementRef<typeof DialogPrimitive.Title>,
66 |   React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
67 | >(({ className, ...props }, ref) => (
68 |   <DialogPrimitive.Title
69 |     ref={ref}
70 |     className={cn("text-lg font-semibold leading-none tracking-tight", className)}
71 |     {...props}
72 |   />
73 | ));
74 | DialogTitle.displayName = DialogPrimitive.Title.displayName;
75 | 
76 | const DialogDescription = React.forwardRef<
77 |   React.ElementRef<typeof DialogPrimitive.Description>,
78 |   React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
79 | >(({ className, ...props }, ref) => (
80 |   <DialogPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
81 | ));
82 | DialogDescription.displayName = DialogPrimitive.Description.displayName;
83 | 
84 | export {
85 |   Dialog,
86 |   DialogPortal,
87 |   DialogOverlay,
88 |   DialogClose,
89 |   DialogTrigger,
90 |   DialogContent,
91 |   DialogHeader,
92 |   DialogFooter,
93 |   DialogTitle,
94 |   DialogDescription,
95 | };
96 | 
```

--------------------------------------------------------------------------------
/funding.json:
--------------------------------------------------------------------------------

```json
 1 | {
 2 |     "$schema": "https://fundingjson.org/schema/v1.1.0.json",
 3 |     "version": "v1.1.0",
 4 |     "entity": {
 5 |         "type": "individual",
 6 |         "role": "maintainer",
 7 |         "name": "Shashank Shekhar Singh",
 8 |         "email": "[email protected]",
 9 |         "phone": "",
10 |         "description": "Maintainer of CodeGraphContext, an open-source developer tooling project focused on graph-based code understanding for AI and large-scale software systems.",
11 |         "webpageUrl": {
12 |             "url": "https://www.linkedin.com/in/shashank-shekhar-singh-121128254"
13 |         }
14 |     },
15 |     "projects": [
16 |         {
17 |             "guid": "codegraphcontext",
18 |             "name": "CodeGraphContext",
19 |             "description": "CodeGraphContext is an open-source developer infrastructure tool that indexes source code into a continuously updated graph, enabling AI assistants and engineering teams to understand real-world codebases with accuracy and context.",
20 |             "webpageUrl": {
21 |                 "url": "https://codegraphcontext.vercel.app/"
22 |             },
23 |             "repositoryUrl": {
24 |                 "url": "https://github.com/Shashankss1205/CodeGraphContext"
25 |             },
26 |             "licenses": [
27 |                 "spdx:MIT"
28 |             ],
29 |             "tags": [
30 |                 "developer-tools",
31 |                 "industry-tooling",
32 |                 "ai-infrastructure",
33 |                 "code-analysis",
34 |                 "knowledge-graph",
35 |                 "mcp",
36 |                 "open-source"
37 |             ]
38 |         }
39 |     ],
40 |     "funding": {
41 |         "channels": [
42 |             {
43 |                 "guid": "bank-transfer",
44 |                 "type": "bank",
45 |                 "address": "[email protected]",
46 |                 "description": "Will accept direct bank transfers. Please e-mail me for details."
47 |             },
48 |             {
49 |                 "guid": "github-sponsors",
50 |                 "type": "payment-provider",
51 |                 "address": "https://github.com/sponsors/Shashankss1205",
52 |                 "description": "Project maintainer will accept payments through GitHub Sponsors."
53 |             }
54 |         ],
55 |         "plans": [
56 |             {
57 |                 "guid": "hosting",
58 |                 "status": "active",
59 |                 "name": "Open Source Infrastructure & Industry Tooling Deployment",
60 |                 "description": "This will cover the monthly server hosting costs for the projects.",
61 |                 "amount": 10000,
62 |                 "currency": "INR",
63 |                 "frequency": "monthly",
64 |                 "channels": [
65 |                     "bank-transfer",
66 |                     "github-sponsors"
67 |                 ]
68 |             },
69 |             {
70 |                 "guid": "development",
71 |                 "status": "active",
72 |                 "name": "Open Source Infrastructure & Industry Tooling Development",
73 |                 "description": "Funding to improve usability, reliability, performance, and ecosystem readiness of CodeGraphContext as an industry-grade open-source developer tool.",
74 |                 "amount": 50000,
75 |                 "currency": "INR",
76 |                 "frequency": "one-time",
77 |                 "channels": [
78 |                     "bank-transfer",
79 |                     "github-sponsors"
80 |                 ]
81 |             },
82 |             {
83 |                 "guid": "developer-time",
84 |                 "status": "active",
85 |                 "name": "Developer compensation",
86 |                 "description": "This will cover the cost of one developer working part-time on the projects.",
87 |                 "amount": 40000,
88 |                 "currency": "INR",
89 |                 "frequency": "monthly",
90 |                 "channels": [
91 |                     "bank-transfer",
92 |                     "github-sponsors"
93 |                 ]
94 |             }
95 |         ],
96 |         "history": null
97 |     }
98 | }
```

--------------------------------------------------------------------------------
/tests/sample_project_rust/src/basic_functions.rs:
--------------------------------------------------------------------------------

```rust
  1 | // basic_functions.rs - Demonstrates basic Rust function patterns and ownership
  2 | use std::fmt;
  3 | 
  4 | /// Simple function with single return value
  5 | pub fn simple_function(x: i32) -> i32 {
  6 |     x * 2
  7 | }
  8 | 
  9 | /// Multiple return values using tuple
 10 | pub fn multiple_returns(a: i32, b: i32) -> (i32, i32, i32) {
 11 |     (a + b, a - b, a * b)
 12 | }
 13 | 
 14 | /// Function with Result return type for error handling
 15 | pub fn divide(a: i32, b: i32) -> Result<i32, String> {
 16 |     if b == 0 {
 17 |         Err("Division by zero".to_string())
 18 |     } else {
 19 |         Ok(a / b)
 20 |     }
 21 | }
 22 | 
 23 | /// Function with Option return type
 24 | pub fn find_first_even(numbers: &[i32]) -> Option<i32> {
 25 |     for &num in numbers {
 26 |         if num % 2 == 0 {
 27 |             return Some(num);
 28 |         }
 29 |     }
 30 |     None
 31 | }
 32 | 
 33 | /// Function demonstrating ownership transfer
 34 | pub fn take_ownership(s: String) -> usize {
 35 |     let len = s.len();
 36 |     println!("Taking ownership of: {}", s);
 37 |     len
 38 | }
 39 | 
 40 | /// Function borrowing immutably
 41 | pub fn borrow_read(s: &String) -> usize {
 42 |     s.len()
 43 | }
 44 | 
 45 | /// Function borrowing mutably
 46 | pub fn borrow_write(s: &mut String) {
 47 |     s.push_str(" - modified");
 48 | }
 49 | 
 50 | /// Function returning borrowed reference with lifetime
 51 | pub fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
 52 |     if x.len() > y.len() {
 53 |         x
 54 |     } else {
 55 |         y
 56 |     }
 57 | }
 58 | 
 59 | /// Generic function with trait bound
 60 | pub fn print_it<T: fmt::Display>(item: T) {
 61 |     println!("Item: {}", item);
 62 | }
 63 | 
 64 | /// Generic function with multiple trait bounds
 65 | pub fn compare_and_print<T: PartialOrd + fmt::Display>(a: T, b: T) {
 66 |     if a > b {
 67 |         println!("{} is greater than {}", a, b);
 68 |     } else {
 69 |         println!("{} is less than or equal to {}", a, b);
 70 |     }
 71 | }
 72 | 
 73 | /// Higher-order function taking closure
 74 | pub fn apply_twice<F>(f: F, x: i32) -> i32
 75 | where
 76 |     F: Fn(i32) -> i32,
 77 | {
 78 |     f(f(x))
 79 | }
 80 | 
 81 | /// Function returning closure
 82 | pub fn make_multiplier(factor: i32) -> impl Fn(i32) -> i32 {
 83 |     move |x| x * factor
 84 | }
 85 | 
 86 | /// Recursive function
 87 | pub fn factorial(n: u32) -> u32 {
 88 |     match n {
 89 |         0 | 1 => 1,
 90 |         _ => n * factorial(n - 1),
 91 |     }
 92 | }
 93 | 
 94 | /// Fibonacci using recursion
 95 | pub fn fibonacci(n: u32) -> u32 {
 96 |     match n {
 97 |         0 => 0,
 98 |         1 => 1,
 99 |         _ => fibonacci(n - 1) + fibonacci(n - 2),
100 |     }
101 | }
102 | 
103 | /// Function with slice parameter
104 | pub fn sum_slice(numbers: &[i32]) -> i32 {
105 |     numbers.iter().sum()
106 | }
107 | 
108 | /// Function with vector parameter (takes ownership)
109 | pub fn sort_vector(mut vec: Vec<i32>) -> Vec<i32> {
110 |     vec.sort();
111 |     vec
112 | }
113 | 
114 | /// Function demonstrating early return
115 | pub fn validate_age(age: i32) -> Result<i32, String> {
116 |     if age < 0 {
117 |         return Err("Age cannot be negative".to_string());
118 |     }
119 |     if age > 150 {
120 |         return Err("Age is unrealistic".to_string());
121 |     }
122 |     Ok(age)
123 | }
124 | 
125 | /// Function with default parameters using Option
126 | pub fn greet(name: &str, title: Option<&str>) -> String {
127 |     match title {
128 |         Some(t) => format!("Hello, {} {}", t, name),
129 |         None => format!("Hello, {}", name),
130 |     }
131 | }
132 | 
133 | /// Variadic-like function using slice
134 | pub fn sum_all(numbers: &[i32]) -> i32 {
135 |     numbers.iter().sum()
136 | }
137 | 
138 | /// Function with multiple lifetimes
139 | pub fn first_word<'a, 'b>(s1: &'a str, s2: &'b str) -> &'a str {
140 |     s1.split_whitespace().next().unwrap_or(s1)
141 | }
142 | 
143 | /// Associated function (like static method)
144 | pub fn from_string(s: String) -> Result<i32, std::num::ParseIntError> {
145 |     s.parse()
146 | }
147 | 
148 | #[cfg(test)]
149 | mod tests {
150 |     use super::*;
151 | 
152 |     #[test]
153 |     fn test_simple_function() {
154 |         assert_eq!(simple_function(5), 10);
155 |     }
156 | 
157 |     #[test]
158 |     fn test_multiple_returns() {
159 |         let (sum, diff, prod) = multiple_returns(10, 3);
160 |         assert_eq!(sum, 13);
161 |         assert_eq!(diff, 7);
162 |         assert_eq!(prod, 30);
163 |     }
164 | 
165 |     #[test]
166 |     fn test_divide() {
167 |         assert_eq!(divide(10, 2), Ok(5));
168 |         assert!(divide(10, 0).is_err());
169 |     }
170 | 
171 |     #[test]
172 |     fn test_factorial() {
173 |         assert_eq!(factorial(5), 120);
174 |     }
175 | }
176 | 
177 | 
```

--------------------------------------------------------------------------------
/website/src/hooks/use-toast.ts:
--------------------------------------------------------------------------------

```typescript
  1 | import * as React from "react";
  2 | 
  3 | import type { ToastActionElement, ToastProps } from "@/components/ui/toast";
  4 | 
  5 | const TOAST_LIMIT = 1;
  6 | const TOAST_REMOVE_DELAY = 1000000;
  7 | 
  8 | type ToasterToast = ToastProps & {
  9 |   id: string;
 10 |   title?: React.ReactNode;
 11 |   description?: React.ReactNode;
 12 |   action?: ToastActionElement;
 13 | };
 14 | 
 15 | const actionTypes = {
 16 |   ADD_TOAST: "ADD_TOAST",
 17 |   UPDATE_TOAST: "UPDATE_TOAST",
 18 |   DISMISS_TOAST: "DISMISS_TOAST",
 19 |   REMOVE_TOAST: "REMOVE_TOAST",
 20 | } as const;
 21 | 
 22 | let count = 0;
 23 | 
 24 | function genId() {
 25 |   count = (count + 1) % Number.MAX_SAFE_INTEGER;
 26 |   return count.toString();
 27 | }
 28 | 
 29 | type ActionType = typeof actionTypes;
 30 | 
 31 | type Action =
 32 |   | {
 33 |       type: ActionType["ADD_TOAST"];
 34 |       toast: ToasterToast;
 35 |     }
 36 |   | {
 37 |       type: ActionType["UPDATE_TOAST"];
 38 |       toast: Partial<ToasterToast>;
 39 |     }
 40 |   | {
 41 |       type: ActionType["DISMISS_TOAST"];
 42 |       toastId?: ToasterToast["id"];
 43 |     }
 44 |   | {
 45 |       type: ActionType["REMOVE_TOAST"];
 46 |       toastId?: ToasterToast["id"];
 47 |     };
 48 | 
 49 | interface State {
 50 |   toasts: ToasterToast[];
 51 | }
 52 | 
 53 | const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
 54 | 
 55 | const addToRemoveQueue = (toastId: string) => {
 56 |   if (toastTimeouts.has(toastId)) {
 57 |     return;
 58 |   }
 59 | 
 60 |   const timeout = setTimeout(() => {
 61 |     toastTimeouts.delete(toastId);
 62 |     dispatch({
 63 |       type: "REMOVE_TOAST",
 64 |       toastId: toastId,
 65 |     });
 66 |   }, TOAST_REMOVE_DELAY);
 67 | 
 68 |   toastTimeouts.set(toastId, timeout);
 69 | };
 70 | 
 71 | export const reducer = (state: State, action: Action): State => {
 72 |   switch (action.type) {
 73 |     case "ADD_TOAST":
 74 |       return {
 75 |         ...state,
 76 |         toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
 77 |       };
 78 | 
 79 |     case "UPDATE_TOAST":
 80 |       return {
 81 |         ...state,
 82 |         toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),
 83 |       };
 84 | 
 85 |     case "DISMISS_TOAST": {
 86 |       const { toastId } = action;
 87 | 
 88 |       // ! Side effects ! - This could be extracted into a dismissToast() action,
 89 |       // but I'll keep it here for simplicity
 90 |       if (toastId) {
 91 |         addToRemoveQueue(toastId);
 92 |       } else {
 93 |         state.toasts.forEach((toast) => {
 94 |           addToRemoveQueue(toast.id);
 95 |         });
 96 |       }
 97 | 
 98 |       return {
 99 |         ...state,
100 |         toasts: state.toasts.map((t) =>
101 |           t.id === toastId || toastId === undefined
102 |             ? {
103 |                 ...t,
104 |                 open: false,
105 |               }
106 |             : t,
107 |         ),
108 |       };
109 |     }
110 |     case "REMOVE_TOAST":
111 |       if (action.toastId === undefined) {
112 |         return {
113 |           ...state,
114 |           toasts: [],
115 |         };
116 |       }
117 |       return {
118 |         ...state,
119 |         toasts: state.toasts.filter((t) => t.id !== action.toastId),
120 |       };
121 |   }
122 | };
123 | 
124 | const listeners: Array<(state: State) => void> = [];
125 | 
126 | let memoryState: State = { toasts: [] };
127 | 
128 | function dispatch(action: Action) {
129 |   memoryState = reducer(memoryState, action);
130 |   listeners.forEach((listener) => {
131 |     listener(memoryState);
132 |   });
133 | }
134 | 
135 | type Toast = Omit<ToasterToast, "id">;
136 | 
137 | function toast({ ...props }: Toast) {
138 |   const id = genId();
139 | 
140 |   const update = (props: ToasterToast) =>
141 |     dispatch({
142 |       type: "UPDATE_TOAST",
143 |       toast: { ...props, id },
144 |     });
145 |   const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
146 | 
147 |   dispatch({
148 |     type: "ADD_TOAST",
149 |     toast: {
150 |       ...props,
151 |       id,
152 |       open: true,
153 |       onOpenChange: (open) => {
154 |         if (!open) dismiss();
155 |       },
156 |     },
157 |   });
158 | 
159 |   return {
160 |     id: id,
161 |     dismiss,
162 |     update,
163 |   };
164 | }
165 | 
166 | function useToast() {
167 |   const [state, setState] = React.useState<State>(memoryState);
168 | 
169 |   React.useEffect(() => {
170 |     listeners.push(setState);
171 |     return () => {
172 |       const index = listeners.indexOf(setState);
173 |       if (index > -1) {
174 |         listeners.splice(index, 1);
175 |       }
176 |     };
177 |   }, [state]);
178 | 
179 |   return {
180 |     ...state,
181 |     toast,
182 |     dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
183 |   };
184 | }
185 | 
186 | export { useToast, toast };
187 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/form.tsx:
--------------------------------------------------------------------------------

```typescript
  1 | import * as React from "react";
  2 | import * as LabelPrimitive from "@radix-ui/react-label";
  3 | import { Slot } from "@radix-ui/react-slot";
  4 | import { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext } from "react-hook-form";
  5 | 
  6 | import { cn } from "@/lib/utils";
  7 | import { Label } from "@/components/ui/label";
  8 | 
  9 | const Form = FormProvider;
 10 | 
 11 | type FormFieldContextValue<
 12 |   TFieldValues extends FieldValues = FieldValues,
 13 |   TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
 14 | > = {
 15 |   name: TName;
 16 | };
 17 | 
 18 | const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);
 19 | 
 20 | const FormField = <
 21 |   TFieldValues extends FieldValues = FieldValues,
 22 |   TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
 23 | >({
 24 |   ...props
 25 | }: ControllerProps<TFieldValues, TName>) => {
 26 |   return (
 27 |     <FormFieldContext.Provider value={{ name: props.name }}>
 28 |       <Controller {...props} />
 29 |     </FormFieldContext.Provider>
 30 |   );
 31 | };
 32 | 
 33 | const useFormField = () => {
 34 |   const fieldContext = React.useContext(FormFieldContext);
 35 |   const itemContext = React.useContext(FormItemContext);
 36 |   const { getFieldState, formState } = useFormContext();
 37 | 
 38 |   const fieldState = getFieldState(fieldContext.name, formState);
 39 | 
 40 |   if (!fieldContext) {
 41 |     throw new Error("useFormField should be used within <FormField>");
 42 |   }
 43 | 
 44 |   const { id } = itemContext;
 45 | 
 46 |   return {
 47 |     id,
 48 |     name: fieldContext.name,
 49 |     formItemId: `${id}-form-item`,
 50 |     formDescriptionId: `${id}-form-item-description`,
 51 |     formMessageId: `${id}-form-item-message`,
 52 |     ...fieldState,
 53 |   };
 54 | };
 55 | 
 56 | type FormItemContextValue = {
 57 |   id: string;
 58 | };
 59 | 
 60 | const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);
 61 | 
 62 | const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
 63 |   ({ className, ...props }, ref) => {
 64 |     const id = React.useId();
 65 | 
 66 |     return (
 67 |       <FormItemContext.Provider value={{ id }}>
 68 |         <div ref={ref} className={cn("space-y-2", className)} {...props} />
 69 |       </FormItemContext.Provider>
 70 |     );
 71 |   },
 72 | );
 73 | FormItem.displayName = "FormItem";
 74 | 
 75 | const FormLabel = React.forwardRef<
 76 |   React.ElementRef<typeof LabelPrimitive.Root>,
 77 |   React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
 78 | >(({ className, ...props }, ref) => {
 79 |   const { error, formItemId } = useFormField();
 80 | 
 81 |   return <Label ref={ref} className={cn(error && "text-destructive", className)} htmlFor={formItemId} {...props} />;
 82 | });
 83 | FormLabel.displayName = "FormLabel";
 84 | 
 85 | const FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(
 86 |   ({ ...props }, ref) => {
 87 |     const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
 88 | 
 89 |     return (
 90 |       <Slot
 91 |         ref={ref}
 92 |         id={formItemId}
 93 |         aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}
 94 |         aria-invalid={!!error}
 95 |         {...props}
 96 |       />
 97 |     );
 98 |   },
 99 | );
100 | FormControl.displayName = "FormControl";
101 | 
102 | const FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
103 |   ({ className, ...props }, ref) => {
104 |     const { formDescriptionId } = useFormField();
105 | 
106 |     return <p ref={ref} id={formDescriptionId} className={cn("text-sm text-muted-foreground", className)} {...props} />;
107 |   },
108 | );
109 | FormDescription.displayName = "FormDescription";
110 | 
111 | const FormMessage = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
112 |   ({ className, children, ...props }, ref) => {
113 |     const { error, formMessageId } = useFormField();
114 |     const body = error ? String(error?.message) : children;
115 | 
116 |     if (!body) {
117 |       return null;
118 |     }
119 | 
120 |     return (
121 |       <p ref={ref} id={formMessageId} className={cn("text-sm font-medium text-destructive", className)} {...props}>
122 |         {body}
123 |       </p>
124 |     );
125 |   },
126 | );
127 | FormMessage.displayName = "FormMessage";
128 | 
129 | export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };
130 | 
```

--------------------------------------------------------------------------------
/src/codegraphcontext/core/__init__.py:
--------------------------------------------------------------------------------

```python
  1 | # src/codegraphcontext/core/__init__.py
  2 | """
  3 | Core database management module.
  4 | 
  5 | Supports both Neo4j and FalkorDB Lite backends.
  6 | Use DATABASE_TYPE environment variable to switch:
  7 | - DATABASE_TYPE=falkordb - Uses embedded FalkorDB Lite (recommended for lite-version)
  8 | - DATABASE_TYPE=neo4j - Uses Neo4j server
  9 | - If not set, auto-detects based on what's available
 10 | """
 11 | import os
 12 | from typing import Union
 13 | 
 14 | import importlib.util
 15 | 
 16 | def _is_falkordb_available() -> bool:
 17 |     """Check if FalkorDB Lite is installed (without importing native modules)."""
 18 |     import sys
 19 |     if sys.version_info < (3, 12):
 20 |         return False
 21 |     try:
 22 |         # Check for redislite/falkordb-client spec without loading it
 23 |         return importlib.util.find_spec("redislite") is not None
 24 |     except ImportError:
 25 |         return False
 26 | 
 27 | def _is_neo4j_configured() -> bool:
 28 |     """Check if Neo4j is configured with credentials."""
 29 |     return all([
 30 |         os.getenv('NEO4J_URI'),
 31 |         os.getenv('NEO4J_USERNAME'),
 32 |         os.getenv('NEO4J_PASSWORD')
 33 |     ])
 34 | 
 35 | def get_database_manager() -> Union['DatabaseManager', 'FalkorDBManager']:
 36 |     """
 37 |     Factory function to get the appropriate database manager based on configuration.
 38 |     
 39 |     Selection logic:
 40 |     1. Runtime Override: 'CGC_RUNTIME_DB_TYPE' (set via --database flag)
 41 |     2. Configured Default: 'DEFAULT_DATABASE' (set via 'cgc default database')
 42 |     3. Legacy Env Var: 'DATABASE_TYPE'
 43 |     4. Implicit Default: FalkorDB (if available)
 44 |     5. Fallback: Neo4j (if configured)
 45 |     """
 46 |     from codegraphcontext.utils.debug_log import info_logger
 47 |     
 48 |     # 1. Runtime Override (CLI flag) or Config/Env
 49 |     db_type = os.getenv('CGC_RUNTIME_DB_TYPE')
 50 |     if not db_type:
 51 |         db_type = os.getenv('DEFAULT_DATABASE')
 52 |     if not db_type:
 53 |         db_type = os.getenv('DATABASE_TYPE')
 54 | 
 55 |     if db_type:
 56 |         db_type = db_type.lower()
 57 |         if db_type == 'falkordb':
 58 |             if not _is_falkordb_available():
 59 |                  raise ValueError("Database set to 'falkordb' but FalkorDB Lite is not installed.\nRun 'pip install falkordblite'")
 60 |             from .database_falkordb import FalkorDBManager
 61 |             info_logger("Using FalkorDB Lite (explicit)")
 62 |             return FalkorDBManager()
 63 |             
 64 |         elif db_type == 'neo4j':
 65 |             if not _is_neo4j_configured():
 66 |                  raise ValueError("Database set to 'neo4j' but it is not configured.\nRun 'cgc neo4j setup' to configure Neo4j.")
 67 |             from .database import DatabaseManager
 68 |             info_logger("Using Neo4j Server (explicit)")
 69 |             return DatabaseManager()
 70 |         else:
 71 |             raise ValueError(f"Unknown database type: '{db_type}'. Use 'falkordb' or 'neo4j'.")
 72 | 
 73 |     # 4. Implicit Default -> FalkorDB (Zero Config)
 74 |     if _is_falkordb_available():
 75 |         from .database_falkordb import FalkorDBManager
 76 |         info_logger("Using FalkorDB Lite (default)")
 77 |         return FalkorDBManager()
 78 |         
 79 |     # 5. Fallback if FalkorDB missing but Neo4j is ready
 80 |     if _is_neo4j_configured():
 81 |         from .database import DatabaseManager
 82 |         info_logger("Using Neo4j Server (auto-detected)")
 83 |         return DatabaseManager()
 84 | 
 85 |     import sys
 86 |     error_msg = "No database backend available.\n"
 87 |     
 88 |     if sys.version_info < (3, 12):
 89 |         error_msg += (
 90 |             "FalkorDB Lite is not supported on Python < 3.12.\n"
 91 |             "You are running Python " + str(sys.version_info.major) + "." + str(sys.version_info.minor) + ".\n"
 92 |             "Please upgrade to Python 3.12+ to use the embedded database,\n"
 93 |             "OR run 'cgc neo4j setup' to configure an external Neo4j database."
 94 |         )
 95 |     else:
 96 |         error_msg += (
 97 |             "Recommended: Install FalkorDB Lite ('pip install falkordblite')\n"
 98 |             "Alternative: Run 'cgc neo4j setup' to configure Neo4j."
 99 |         )
100 |             
101 |     raise ValueError(error_msg)
102 | 
103 | # For backward compatibility, export DatabaseManager
104 | from .database import DatabaseManager
105 | from .database_falkordb import FalkorDBManager
106 | 
107 | __all__ = ['DatabaseManager', 'FalkorDBManager', 'get_database_manager']
108 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/sheet.tsx:
--------------------------------------------------------------------------------

```typescript
  1 | import * as SheetPrimitive from "@radix-ui/react-dialog";
  2 | import { cva, type VariantProps } from "class-variance-authority";
  3 | import { X } from "lucide-react";
  4 | import * as React from "react";
  5 | 
  6 | import { cn } from "@/lib/utils";
  7 | 
  8 | const Sheet = SheetPrimitive.Root;
  9 | 
 10 | const SheetTrigger = SheetPrimitive.Trigger;
 11 | 
 12 | const SheetClose = SheetPrimitive.Close;
 13 | 
 14 | const SheetPortal = SheetPrimitive.Portal;
 15 | 
 16 | const SheetOverlay = React.forwardRef<
 17 |   React.ElementRef<typeof SheetPrimitive.Overlay>,
 18 |   React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
 19 | >(({ className, ...props }, ref) => (
 20 |   <SheetPrimitive.Overlay
 21 |     className={cn(
 22 |       "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
 23 |       className,
 24 |     )}
 25 |     {...props}
 26 |     ref={ref}
 27 |   />
 28 | ));
 29 | SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
 30 | 
 31 | const sheetVariants = cva(
 32 |   "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
 33 |   {
 34 |     variants: {
 35 |       side: {
 36 |         top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
 37 |         bottom:
 38 |           "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
 39 |         left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
 40 |         right:
 41 |           "inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
 42 |       },
 43 |     },
 44 |     defaultVariants: {
 45 |       side: "right",
 46 |     },
 47 |   },
 48 | );
 49 | 
 50 | interface SheetContentProps
 51 |   extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
 52 |     VariantProps<typeof sheetVariants> {}
 53 | 
 54 | const SheetContent = React.forwardRef<React.ElementRef<typeof SheetPrimitive.Content>, SheetContentProps>(
 55 |   ({ side = "right", className, children, ...props }, ref) => (
 56 |     <SheetPortal>
 57 |       <SheetOverlay />
 58 |       <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>
 59 |         {children}
 60 |         <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none">
 61 |           <X className="h-4 w-4" />
 62 |           <span className="sr-only">Close</span>
 63 |         </SheetPrimitive.Close>
 64 |       </SheetPrimitive.Content>
 65 |     </SheetPortal>
 66 |   ),
 67 | );
 68 | SheetContent.displayName = SheetPrimitive.Content.displayName;
 69 | 
 70 | const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
 71 |   <div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...props} />
 72 | );
 73 | SheetHeader.displayName = "SheetHeader";
 74 | 
 75 | const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
 76 |   <div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props} />
 77 | );
 78 | SheetFooter.displayName = "SheetFooter";
 79 | 
 80 | const SheetTitle = React.forwardRef<
 81 |   React.ElementRef<typeof SheetPrimitive.Title>,
 82 |   React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
 83 | >(({ className, ...props }, ref) => (
 84 |   <SheetPrimitive.Title ref={ref} className={cn("text-lg font-semibold text-foreground", className)} {...props} />
 85 | ));
 86 | SheetTitle.displayName = SheetPrimitive.Title.displayName;
 87 | 
 88 | const SheetDescription = React.forwardRef<
 89 |   React.ElementRef<typeof SheetPrimitive.Description>,
 90 |   React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
 91 | >(({ className, ...props }, ref) => (
 92 |   <SheetPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
 93 | ));
 94 | SheetDescription.displayName = SheetPrimitive.Description.displayName;
 95 | 
 96 | export {
 97 |   Sheet,
 98 |   SheetClose,
 99 |   SheetContent,
100 |   SheetDescription,
101 |   SheetFooter,
102 |   SheetHeader,
103 |   SheetOverlay,
104 |   SheetPortal,
105 |   SheetTitle,
106 |   SheetTrigger,
107 | };
108 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_go/interfaces.go:
--------------------------------------------------------------------------------

```go
  1 | // interfaces.go - Demonstrates Go interfaces
  2 | package main
  3 | 
  4 | import (
  5 | 	"fmt"
  6 | 	"math"
  7 | )
  8 | 
  9 | // Shape is a basic interface
 10 | type Shape interface {
 11 | 	Area() float64
 12 | 	Perimeter() float64
 13 | }
 14 | 
 15 | // Drawable extends Shape interface
 16 | type Drawable interface {
 17 | 	Shape
 18 | 	Draw() string
 19 | }
 20 | 
 21 | // Named is a simple interface
 22 | type Named interface {
 23 | 	GetName() string
 24 | }
 25 | 
 26 | // Circle implements Shape
 27 | type Circle struct {
 28 | 	Radius float64
 29 | 	Name   string
 30 | }
 31 | 
 32 | // Rectangle implements Shape
 33 | type Rectangle struct {
 34 | 	Width  float64
 35 | 	Height float64
 36 | 	Name   string
 37 | }
 38 | 
 39 | // Triangle implements Shape
 40 | type Triangle struct {
 41 | 	A, B, C float64
 42 | 	Name    string
 43 | }
 44 | 
 45 | // Area implements Shape interface for Circle
 46 | func (c Circle) Area() float64 {
 47 | 	return math.Pi * c.Radius * c.Radius
 48 | }
 49 | 
 50 | // Perimeter implements Shape interface for Circle
 51 | func (c Circle) Perimeter() float64 {
 52 | 	return 2 * math.Pi * c.Radius
 53 | }
 54 | 
 55 | // Draw implements Drawable interface for Circle
 56 | func (c Circle) Draw() string {
 57 | 	return fmt.Sprintf("Drawing circle with radius %.2f", c.Radius)
 58 | }
 59 | 
 60 | // GetName implements Named interface for Circle
 61 | func (c Circle) GetName() string {
 62 | 	return c.Name
 63 | }
 64 | 
 65 | // Area implements Shape interface for Rectangle
 66 | func (r Rectangle) Area() float64 {
 67 | 	return r.Width * r.Height
 68 | }
 69 | 
 70 | // Perimeter implements Shape interface for Rectangle
 71 | func (r Rectangle) Perimeter() float64 {
 72 | 	return 2 * (r.Width + r.Height)
 73 | }
 74 | 
 75 | // Draw implements Drawable interface for Rectangle
 76 | func (r Rectangle) Draw() string {
 77 | 	return fmt.Sprintf("Drawing rectangle %.2fx%.2f", r.Width, r.Height)
 78 | }
 79 | 
 80 | // GetName implements Named interface for Rectangle
 81 | func (r Rectangle) GetName() string {
 82 | 	return r.Name
 83 | }
 84 | 
 85 | // Area implements Shape interface for Triangle
 86 | func (t Triangle) Area() float64 {
 87 | 	// Heron's formula
 88 | 	s := (t.A + t.B + t.C) / 2
 89 | 	return math.Sqrt(s * (s - t.A) * (s - t.B) * (s - t.C))
 90 | }
 91 | 
 92 | // Perimeter implements Shape interface for Triangle
 93 | func (t Triangle) Perimeter() float64 {
 94 | 	return t.A + t.B + t.C
 95 | }
 96 | 
 97 | // GetName implements Named interface for Triangle
 98 | func (t Triangle) GetName() string {
 99 | 	return t.Name
100 | }
101 | 
102 | // CalculateTotalArea accepts interface and calculates total
103 | func CalculateTotalArea(shapes []Shape) float64 {
104 | 	total := 0.0
105 | 	for _, shape := range shapes {
106 | 		total += shape.Area()
107 | 	}
108 | 	return total
109 | }
110 | 
111 | // PrintShapeInfo uses interface for polymorphism
112 | func PrintShapeInfo(s Shape) {
113 | 	fmt.Printf("Area: %.2f, Perimeter: %.2f\n", s.Area(), s.Perimeter())
114 | }
115 | 
116 | // DrawIfPossible uses type assertion
117 | func DrawIfPossible(s Shape) string {
118 | 	if drawable, ok := s.(Drawable); ok {
119 | 		return drawable.Draw()
120 | 	}
121 | 	return "Shape is not drawable"
122 | }
123 | 
124 | // DescribeShape uses type switch
125 | func DescribeShape(s Shape) string {
126 | 	switch v := s.(type) {
127 | 	case Circle:
128 | 		return fmt.Sprintf("Circle with radius %.2f", v.Radius)
129 | 	case Rectangle:
130 | 		return fmt.Sprintf("Rectangle with dimensions %.2fx%.2f", v.Width, v.Height)
131 | 	case Triangle:
132 | 		return fmt.Sprintf("Triangle with sides %.2f, %.2f, %.2f", v.A, v.B, v.C)
133 | 	default:
134 | 		return "Unknown shape"
135 | 	}
136 | }
137 | 
138 | // EmptyInterface demonstrates empty interface usage
139 | func EmptyInterface(data interface{}) string {
140 | 	switch v := data.(type) {
141 | 	case int:
142 | 		return fmt.Sprintf("Integer: %d", v)
143 | 	case string:
144 | 		return fmt.Sprintf("String: %s", v)
145 | 	case Shape:
146 | 		return fmt.Sprintf("Shape with area: %.2f", v.Area())
147 | 	default:
148 | 		return fmt.Sprintf("Unknown type: %T", v)
149 | 	}
150 | }
151 | 
152 | // InterfaceComposition demonstrates interface embedding
153 | type ComplexShape interface {
154 | 	Shape
155 | 	Named
156 | 	Volume() float64
157 | }
158 | 
159 | // ProcessShapes processes multiple shapes
160 | func ProcessShapes(shapes ...Shape) map[string]float64 {
161 | 	results := make(map[string]float64)
162 | 	totalArea := 0.0
163 | 	totalPerimeter := 0.0
164 | 	
165 | 	for _, shape := range shapes {
166 | 		totalArea += shape.Area()
167 | 		totalPerimeter += shape.Perimeter()
168 | 	}
169 | 	
170 | 	results["total_area"] = totalArea
171 | 	results["total_perimeter"] = totalPerimeter
172 | 	results["count"] = float64(len(shapes))
173 | 	
174 | 	return results
175 | }
176 | 
177 | func demonstrateInterfaces() {
178 | 	circle := Circle{Radius: 5.0, Name: "MyCircle"}
179 | 	rectangle := Rectangle{Width: 10.0, Height: 5.0, Name: "MyRectangle"}
180 | 	
181 | 	shapes := []Shape{circle, rectangle}
182 | 	fmt.Printf("Total area: %.2f\n", CalculateTotalArea(shapes))
183 | 	
184 | 	fmt.Println(DescribeShape(circle))
185 | 	fmt.Println(DrawIfPossible(circle))
186 | }
187 | 
188 | 
```

--------------------------------------------------------------------------------
/website/src/components/ExamplesSection.tsx:
--------------------------------------------------------------------------------

```typescript
  1 | import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
  2 | import { Badge } from "@/components/ui/badge";
  3 | import { MessageCircle, Search, Eye, BarChart3 } from "lucide-react";
  4 | import { motion } from "framer-motion";
  5 | 
  6 | const examplesData = [
  7 |   {
  8 |     icon: MessageCircle,
  9 |     category: "Indexing",
 10 |     title: "Add Projects to Graph",
 11 |     examples: [
 12 |       "Please index the code in the `/path/to/my-project` directory.",
 13 |       "Add the project at `~/dev/my-app` to the code graph."
 14 |     ]
 15 |   },
 16 |   {
 17 |     icon: Search,
 18 |     category: "Analysis",
 19 |     title: "Code Relationships", 
 20 |     examples: [
 21 |       "Show me all functions that call `process_data()`",
 22 |       "Find the class hierarchy for `BaseProcessor`"
 23 |     ]
 24 |   },
 25 |   {
 26 |     icon: Eye,
 27 |     category: "Monitoring",
 28 |     title: "Live Updates",
 29 |     examples: [
 30 |       "Watch the `/project` directory for changes.",
 31 |       "Keep the graph updated for my active development."
 32 |     ]
 33 |   },
 34 |   {
 35 |     icon: BarChart3,
 36 |     category: "Insights",
 37 |     title: "Code Quality",
 38 |     examples: [
 39 |       "Find dead code in my project",
 40 |       "Show the most complex functions by cyclomatic complexity"
 41 |     ]
 42 |   }
 43 | ];
 44 | 
 45 | const ExamplesSection = () => {
 46 |   return (
 47 |     <section className="py-24 px-4" data-aos="fade-in">
 48 |       <div className="container mx-auto max-w-6xl">
 49 |         <div className="text-center mb-16" data-aos="fade-down">
 50 |           <h2 className="text-4xl md:text-5xl font-bold mb-6 bg-gradient-to-r from-primary via-primary to-accent bg-clip-text text-transparent py-2">
 51 |             Natural Language Interface
 52 |           </h2>
 53 |           <p className="text-xl text-muted-foreground max-w-3xl mx-auto">
 54 |             Interact with your code graph using plain English. No complex queries or syntax to learn.
 55 |           </p>
 56 |         </div>
 57 |         
 58 |         <div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
 59 |           {examplesData.map((example, index) => (
 60 |             <div key={index} data-aos="fade-up" data-aos-delay={index * 100}>
 61 |               <Card className="h-full border-border/50 group animate-float-up bg-white/95 dark:bg-card/50 shadow-sm hover:shadow-lg transition-shadow duration-300">
 62 |                 <CardHeader>
 63 |                   <div className="flex items-center gap-4 mb-4">
 64 |                     <div className="p-3 rounded-xl bg-primary/5 border border-primary/15 group-hover:bg-primary/10 transition-colors dark:bg-primary/20 dark:border-primary/30">
 65 |                       <example.icon className="h-6 w-6 text-primary" />
 66 |                     </div>
 67 |                     <div>
 68 |                       <Badge variant="secondary" className="mb-2">{example.category}</Badge>
 69 |                       <CardTitle className="text-xl font-semibold">{example.title}</CardTitle>
 70 |                     </div>
 71 |                   </div>
 72 |                 </CardHeader>
 73 |                 <CardContent>
 74 |                   <div className="space-y-4">
 75 |                     {example.examples.map((text, idx) => (
 76 |                       <div key={idx} className="p-3 rounded-md border-l-4 border-accent/30 bg-muted/30 hover:border-accent/60 transition-colors">
 77 |                         <p className="text-sm text-muted-foreground italic">"{text}"</p>
 78 |                       </div>
 79 |                     ))}
 80 |                   </div>
 81 |                 </CardContent>
 82 |               </Card>
 83 |             </div>
 84 |           ))}
 85 |         </div>
 86 |         
 87 |         <div className="text-center mt-16" data-aos="fade-up" data-aos-delay="200">
 88 |           <Card className="max-w-2xl mx-auto bg-white/95 dark:bg-card/50 shadow-sm p-2">
 89 |             <CardContent className="pt-8">
 90 |               <h3 className="text-2xl font-bold mb-4">Ready to enhance your AI assistant?</h3>
 91 |               <p className="text-muted-foreground mb-6">
 92 |                 Start building intelligent code understanding today with CodeGraphContext.
 93 |               </p>
 94 |               <div className="p-3 rounded-md bg-muted/40 max-w-md mx-auto border shadow-inner">
 95 |                 <code className="text-accent font-mono">$ pip install codegraphcontext</code>
 96 |               </div>
 97 |             </CardContent>
 98 |           </Card>
 99 |         </div>
100 |       </div>
101 |     </section>
102 |   );
103 | };
104 | 
105 | export default ExamplesSection;
106 | 
```

--------------------------------------------------------------------------------
/organizer/troubleshoot.md:
--------------------------------------------------------------------------------

```markdown
  1 | # CodeGraphContext Troubleshooting Guide
  2 | 
  3 | Use this checklist whenever `cgc neo4j setup` or `cgc start` doesn’t behave as expected. It keeps the happy path short, but includes the fallback steps when something goes wrong.
  4 | 
  5 | ## 1. Prerequisites at a glance
  6 | 
  7 | - **Windows + PowerShell** commands below assume the `py` launcher. Adapt to `python3` if you’re on macOS/Linux.
  8 | - **Python 3.11** (recommended). Run `py -3.11 --version` to confirm.
  9 | - **Git** for cloning the repository.
 10 | - **Docker Desktop** installed *and running* before you launch `cgc neo4j setup` if you want the wizard to spin up a local Neo4j for you.
 11 | - **Neo4j account** (only required if you prefer Neo4j AuraDB instead of Docker).
 12 | 
 13 | > **Tip:** If Docker isn’t running, the setup wizard will fail when it tries to install Neo4j locally.
 14 | 
 15 | ## 2. Create and activate a virtual environment
 16 | 
 17 | From the repository root (`CodeGraphContext/`):
 18 | 
 19 | ```powershell
 20 | py -3.11 -m venv venv
 21 | .\venv\Scripts\python.exe -m pip install --upgrade pip
 22 | ```
 23 | 
 24 | - On Windows, Neo4j driver 6.x can crash with `AttributeError: socket.EAI_ADDRFAMILY`. If you see that, run:
 25 |   ```powershell
 26 |   .\venv\Scripts\python.exe -m pip install "neo4j<6"
 27 |   ```
 28 | 
 29 | ## 3. Run the Neo4j setup wizard (preferred)
 30 | 
 31 | Launch the wizard:
 32 | 
 33 | ```powershell
 34 | .\venv\Scripts\cgc.exe neo4j setup
 35 | ```
 36 | 
 37 | What happens next:
 38 | 
 39 | - The wizard checks for Docker. If it’s running, it can auto-provision a local Neo4j instance for you.
 40 | - Alternatively, you can supply credentials for an existing Neo4j AuraDB database.
 41 | - At the end, it generates:
 42 |   - `mcp.json` in your project directory (stores the MCP server command + env vars).
 43 |   - `~/.codegraphcontext/.env` containing `NEO4J_URI`, `NEO4J_USERNAME`, `NEO4J_PASSWORD`.
 44 | 
 45 | Make sure the Docker container (or remote Neo4j) is still running before you start the server.
 46 | 
 47 | ## 4. Start the MCP server
 48 | 
 49 | Once the wizard completes successfully:
 50 | 
 51 | ```powershell
 52 | .\venv\Scripts\cgc.exe start
 53 | ```
 54 | 
 55 | Expected output includes:
 56 | 
 57 | ```text
 58 | Starting CodeGraphContext Server...
 59 | ...
 60 | MCP Server is running. Waiting for requests...
 61 | ```
 62 | 
 63 | If you instead see:
 64 | 
 65 | ```text
 66 | Configuration Error: Neo4j credentials must be set via environment variables
 67 | ```
 68 | 
 69 | then either no credentials were saved, or the wizard was skipped—see the manual alternative below.
 70 | 
 71 | ## 5. Manual credential setup (fallback)
 72 | 
 73 | If you prefer not to use the wizard or need to fix a broken configuration:
 74 | 
 75 | 1. Create a `mcp.json` (or edit the one that exists) in the repository root:
 76 | 
 77 |    ```json
 78 |    {
 79 |      "mcpServers": {
 80 |        "CodeGraphContext": {
 81 |          "command": "cgc",
 82 |          "args": ["start"],
 83 |          "env": {
 84 |            "NEO4J_URI": "neo4j+s://YOUR-HOSTNAME:7687",
 85 |            "NEO4J_USERNAME": "neo4j",
 86 |            "NEO4J_PASSWORD": "super-secret-password"
 87 |          }
 88 |        }
 89 |      }
 90 |    }
 91 |    ```
 92 | 
 93 | 2. (Optional) Also create `%USERPROFILE%\.codegraphcontext\.env` with the same key/value pairs. The CLI loads that file automatically.
 94 | 
 95 | 3. Re-run:
 96 | 
 97 |    ```powershell
 98 |    .\venv\Scripts\cgc.exe start
 99 |    ```
100 | 
101 | ## 6. Common issues & fixes
102 | 
103 | | Symptom | Likely Cause | Fix |
104 | | --- | --- | --- |
105 | | `Configuration Error: Neo4j credentials must be set…` | `mcp.json`/`.env` missing or empty | Run `cgc neo4j setup` again **with Docker running**, or create the files manually (section 5). |
106 | | `AttributeError: socket.EAI_ADDRFAMILY` | Neo4j 6.x bug on Windows | Install the 5.x driver: `.\venv\Scripts\python.exe -m pip install "neo4j<6"` and retry. |
107 | | Setup wizard fails while pulling Docker image | Docker Desktop not running or Docker permissions missing | Start Docker Desktop, wait for it to report “Running”, then rerun `cgc neo4j setup`. |
108 | | Server exits immediately with no log | Neo4j instance is offline | Check Docker container status or AuraDB dashboard; restart Neo4j and call `cgc start` again. |
109 | 
110 | ## 7. After the server is running
111 | 
112 | - Keep the virtual environment active whenever you run `cgc` commands.
113 | - Use `pytest` from the same env to run tests:
114 | 
115 |   ```powershell
116 |   .\venv\Scripts\pytest
117 |   ```
118 | 
119 | - Front-end website lives under `website/` if you need to run `npm run dev`.
120 | 
121 | When in doubt, re-run the wizard with Docker active—it regenerates the configuration files without touching your code. Let me know if any section needs clarifying! :)
122 | 
```

--------------------------------------------------------------------------------
/website/src/components/ui/alert-dialog.tsx:
--------------------------------------------------------------------------------

```typescript
  1 | import * as React from "react";
  2 | import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
  3 | 
  4 | import { cn } from "@/lib/utils";
  5 | import { buttonVariants } from "@/components/ui/button";
  6 | 
  7 | const AlertDialog = AlertDialogPrimitive.Root;
  8 | 
  9 | const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
 10 | 
 11 | const AlertDialogPortal = AlertDialogPrimitive.Portal;
 12 | 
 13 | const AlertDialogOverlay = React.forwardRef<
 14 |   React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
 15 |   React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
 16 | >(({ className, ...props }, ref) => (
 17 |   <AlertDialogPrimitive.Overlay
 18 |     className={cn(
 19 |       "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
 20 |       className,
 21 |     )}
 22 |     {...props}
 23 |     ref={ref}
 24 |   />
 25 | ));
 26 | AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
 27 | 
 28 | const AlertDialogContent = React.forwardRef<
 29 |   React.ElementRef<typeof AlertDialogPrimitive.Content>,
 30 |   React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
 31 | >(({ className, ...props }, ref) => (
 32 |   <AlertDialogPortal>
 33 |     <AlertDialogOverlay />
 34 |     <AlertDialogPrimitive.Content
 35 |       ref={ref}
 36 |       className={cn(
 37 |         "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
 38 |         className,
 39 |       )}
 40 |       {...props}
 41 |     />
 42 |   </AlertDialogPortal>
 43 | ));
 44 | AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
 45 | 
 46 | const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
 47 |   <div className={cn("flex flex-col space-y-2 text-center sm:text-left", className)} {...props} />
 48 | );
 49 | AlertDialogHeader.displayName = "AlertDialogHeader";
 50 | 
 51 | const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
 52 |   <div className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} {...props} />
 53 | );
 54 | AlertDialogFooter.displayName = "AlertDialogFooter";
 55 | 
 56 | const AlertDialogTitle = React.forwardRef<
 57 |   React.ElementRef<typeof AlertDialogPrimitive.Title>,
 58 |   React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
 59 | >(({ className, ...props }, ref) => (
 60 |   <AlertDialogPrimitive.Title ref={ref} className={cn("text-lg font-semibold", className)} {...props} />
 61 | ));
 62 | AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
 63 | 
 64 | const AlertDialogDescription = React.forwardRef<
 65 |   React.ElementRef<typeof AlertDialogPrimitive.Description>,
 66 |   React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
 67 | >(({ className, ...props }, ref) => (
 68 |   <AlertDialogPrimitive.Description ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
 69 | ));
 70 | AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
 71 | 
 72 | const AlertDialogAction = React.forwardRef<
 73 |   React.ElementRef<typeof AlertDialogPrimitive.Action>,
 74 |   React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
 75 | >(({ className, ...props }, ref) => (
 76 |   <AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />
 77 | ));
 78 | AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
 79 | 
 80 | const AlertDialogCancel = React.forwardRef<
 81 |   React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
 82 |   React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
 83 | >(({ className, ...props }, ref) => (
 84 |   <AlertDialogPrimitive.Cancel
 85 |     ref={ref}
 86 |     className={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)}
 87 |     {...props}
 88 |   />
 89 | ));
 90 | AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
 91 | 
 92 | export {
 93 |   AlertDialog,
 94 |   AlertDialogPortal,
 95 |   AlertDialogOverlay,
 96 |   AlertDialogTrigger,
 97 |   AlertDialogContent,
 98 |   AlertDialogHeader,
 99 |   AlertDialogFooter,
100 |   AlertDialogTitle,
101 |   AlertDialogDescription,
102 |   AlertDialogAction,
103 |   AlertDialogCancel,
104 | };
105 | 
```

--------------------------------------------------------------------------------
/tests/sample_project_go/util/helpers.go:
--------------------------------------------------------------------------------

```go
  1 | // Package util provides utility functions for the sample project
  2 | package util
  3 | 
  4 | import (
  5 | 	"fmt"
  6 | 	"strings"
  7 | )
  8 | 
  9 | // StringUtils provides string utility functions
 10 | type StringUtils struct{}
 11 | 
 12 | // Reverse reverses a string
 13 | func (su StringUtils) Reverse(s string) string {
 14 | 	runes := []rune(s)
 15 | 	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
 16 | 		runes[i], runes[j] = runes[j], runes[i]
 17 | 	}
 18 | 	return string(runes)
 19 | }
 20 | 
 21 | // IsPalindrome checks if a string is a palindrome
 22 | func (su StringUtils) IsPalindrome(s string) bool {
 23 | 	s = strings.ToLower(strings.ReplaceAll(s, " ", ""))
 24 | 	return s == su.Reverse(s)
 25 | }
 26 | 
 27 | // MathUtils provides math utility functions
 28 | type MathUtils struct{}
 29 | 
 30 | // Factorial calculates factorial
 31 | func (mu MathUtils) Factorial(n int) int {
 32 | 	if n <= 1 {
 33 | 		return 1
 34 | 	}
 35 | 	return n * mu.Factorial(n-1)
 36 | }
 37 | 
 38 | // Fibonacci calculates fibonacci number
 39 | func (mu MathUtils) Fibonacci(n int) int {
 40 | 	if n <= 1 {
 41 | 		return n
 42 | 	}
 43 | 	return mu.Fibonacci(n-1) + mu.Fibonacci(n-2)
 44 | }
 45 | 
 46 | // GCD calculates greatest common divisor
 47 | func (mu MathUtils) GCD(a, b int) int {
 48 | 	for b != 0 {
 49 | 		a, b = b, a%b
 50 | 	}
 51 | 	return a
 52 | }
 53 | 
 54 | // LCM calculates least common multiple
 55 | func (mu MathUtils) LCM(a, b int) int {
 56 | 	return (a * b) / mu.GCD(a, b)
 57 | }
 58 | 
 59 | // SliceUtils provides slice utility functions
 60 | type SliceUtils struct{}
 61 | 
 62 | // Sum calculates sum of integers
 63 | func (su SliceUtils) Sum(nums []int) int {
 64 | 	total := 0
 65 | 	for _, num := range nums {
 66 | 		total += num
 67 | 	}
 68 | 	return total
 69 | }
 70 | 
 71 | // Average calculates average
 72 | func (su SliceUtils) Average(nums []int) float64 {
 73 | 	if len(nums) == 0 {
 74 | 		return 0
 75 | 	}
 76 | 	return float64(su.Sum(nums)) / float64(len(nums))
 77 | }
 78 | 
 79 | // Max finds maximum value
 80 | func (su SliceUtils) Max(nums []int) int {
 81 | 	if len(nums) == 0 {
 82 | 		return 0
 83 | 	}
 84 | 	max := nums[0]
 85 | 	for _, num := range nums {
 86 | 		if num > max {
 87 | 			max = num
 88 | 		}
 89 | 	}
 90 | 	return max
 91 | }
 92 | 
 93 | // Min finds minimum value
 94 | func (su SliceUtils) Min(nums []int) int {
 95 | 	if len(nums) == 0 {
 96 | 		return 0
 97 | 	}
 98 | 	min := nums[0]
 99 | 	for _, num := range nums {
100 | 		if num < min {
101 | 			min = num
102 | 		}
103 | 	}
104 | 	return min
105 | }
106 | 
107 | // Unique removes duplicates from slice
108 | func (su SliceUtils) Unique(nums []int) []int {
109 | 	seen := make(map[int]bool)
110 | 	result := []int{}
111 | 	
112 | 	for _, num := range nums {
113 | 		if !seen[num] {
114 | 			seen[num] = true
115 | 			result = append(result, num)
116 | 		}
117 | 	}
118 | 	
119 | 	return result
120 | }
121 | 
122 | // Validator provides validation functions
123 | type Validator struct{}
124 | 
125 | // IsEmail checks if string is valid email format (simplified)
126 | func (v Validator) IsEmail(email string) bool {
127 | 	return strings.Contains(email, "@") && strings.Contains(email, ".")
128 | }
129 | 
130 | // IsURL checks if string is valid URL format (simplified)
131 | func (v Validator) IsURL(url string) bool {
132 | 	return strings.HasPrefix(url, "http://") || strings.HasPrefix(url, "https://")
133 | }
134 | 
135 | // IsEmpty checks if string is empty or whitespace
136 | func (v Validator) IsEmpty(s string) bool {
137 | 	return strings.TrimSpace(s) == ""
138 | }
139 | 
140 | // Logger provides logging functionality
141 | type Logger struct {
142 | 	Prefix string
143 | }
144 | 
145 | // NewLogger creates a new logger
146 | func NewLogger(prefix string) *Logger {
147 | 	return &Logger{Prefix: prefix}
148 | }
149 | 
150 | // Info logs info message
151 | func (l Logger) Info(message string) {
152 | 	fmt.Printf("[%s] INFO: %s\n", l.Prefix, message)
153 | }
154 | 
155 | // Error logs error message
156 | func (l Logger) Error(message string) {
157 | 	fmt.Printf("[%s] ERROR: %s\n", l.Prefix, message)
158 | }
159 | 
160 | // Debug logs debug message
161 | func (l Logger) Debug(message string) {
162 | 	fmt.Printf("[%s] DEBUG: %s\n", l.Prefix, message)
163 | }
164 | 
165 | // Helper functions (package-level)
166 | 
167 | // Capitalize capitalizes first letter of string
168 | func Capitalize(s string) string {
169 | 	if len(s) == 0 {
170 | 		return s
171 | 	}
172 | 	return strings.ToUpper(s[:1]) + s[1:]
173 | }
174 | 
175 | // Truncate truncates string to specified length
176 | func Truncate(s string, length int) string {
177 | 	if len(s) <= length {
178 | 		return s
179 | 	}
180 | 	return s[:length] + "..."
181 | }
182 | 
183 | // Contains checks if slice contains value
184 | func Contains(slice []string, value string) bool {
185 | 	for _, item := range slice {
186 | 		if item == value {
187 | 			return true
188 | 		}
189 | 	}
190 | 	return false
191 | }
192 | 
193 | // Map applies function to each element
194 | func Map(slice []int, fn func(int) int) []int {
195 | 	result := make([]int, len(slice))
196 | 	for i, v := range slice {
197 | 		result[i] = fn(v)
198 | 	}
199 | 	return result
200 | }
201 | 
202 | // Filter filters slice based on predicate
203 | func Filter(slice []int, predicate func(int) bool) []int {
204 | 	result := []int{}
205 | 	for _, v := range slice {
206 | 		if predicate(v) {
207 | 			result = append(result, v)
208 | 		}
209 | 	}
210 | 	return result
211 | }
212 | 
213 | 
```

--------------------------------------------------------------------------------
/docs/docs/server.md:
--------------------------------------------------------------------------------

```markdown
 1 | # MCPServer
 2 | 
 3 | The `MCPServer` class is the core of the CodeGraphContext application. It orchestrates all the major components, including database management, background job tracking, file system watching, and tool handling.
 4 | 
 5 | ## Initialization
 6 | 
 7 | The server is initialized with an asyncio event loop. Upon initialization, it sets up the following components:
 8 | 
 9 | -   `DatabaseManager`: Manages the connection to the Neo4j database.
10 | -   `JobManager`: Tracks the status of background jobs, such as code indexing.
11 | -   `CodeWatcher`: Monitors the file system for changes to keep the code graph up-to-date.
12 | -   `GraphBuilder`: Builds the code graph from the source code.
13 | -   `CodeFinder`: Provides tools for searching and analyzing the code graph.
14 | 
15 | ## Tool Manifest
16 | 
17 | The `MCPServer` exposes a set of tools to the AI assistant. These tools are defined in the `_init_tools` method. Here is a list of available tools:
18 | 
19 | ### `add_code_to_graph`
20 | Performs a one-time scan of a local folder to add its code to the graph. Ideal for indexing libraries, dependencies, or projects not being actively modified. Returns a job ID for background processing.
21 | 
22 | ### `check_job_status`
23 | Check the status and progress of a background job.
24 | 
25 | ### `list_jobs`
26 | List all background jobs and their current status.
27 | 
28 | ### `find_code`
29 | Find relevant code snippets related to a keyword (e.g., function name, class name, or content).
30 | 
31 | ### `analyze_code_relationships`
32 | Analyze code relationships like 'who calls this function' or 'class hierarchy'. Supported query types include: find_callers, find_callees, find_all_callers, find_all_callees, find_importers, who_modifies, class_hierarchy, overrides, dead_code, call_chain, module_deps, variable_scope, find_complexity, find_functions_by_argument, find_functions_by_decorator.
33 | 
34 | ### `watch_directory`
35 | Performs an initial scan of a directory and then continuously monitors it for changes, automatically keeping the graph up-to-date. Ideal for projects under active development. Returns a job ID for the initial scan.
36 | 
37 | ### `execute_cypher_query`
38 | 
39 | This is an advanced tool for directly querying the underlying Neo4j graph using a read-only Cypher query. It should be used as a fallback when other tools cannot answer very specific or complex questions about the code graph.
40 | 
41 | **Schema Overview:**
42 | 
43 | The code graph has the following structure:
44 | 
45 | *   **Nodes:**
46 |     *   `Repository`: Represents a project repository.
47 |     *   `File`: Represents a single source code file.
48 |     *   `Module`: Represents a package or a module.
49 |     *   `Class`: Represents a class definition.
50 |     *   `Function`: Represents a function or method definition.
51 | *   **Properties:**
52 |     *   Nodes have properties like `name`, `path`, `cyclomatic_complexity` (for functions), and `code`.
53 | *   **Relationships:**
54 |     *   `CONTAINS`: e.g., `(:File)-[:CONTAINS]->(:Function)`
55 |     *   `CALLS`: e.g., `(:Function)-[:CALLS]->(:Function)`
56 |     *   `IMPORTS`: e.g., `(:File)-[:IMPORTS]->(:Module)`
57 |     *   `INHERITS`: e.g., `(:Class)-[:INHERITS]->(:Class)`
58 | 
59 | ### `add_package_to_graph`
60 | Add a Python package to Neo4j graph by discovering its location. Returns immediately with job ID.
61 | 
62 | ### `find_dead_code`
63 | Find potentially unused functions (dead code) across the entire indexed codebase, optionally excluding functions with specific decorators.
64 | 
65 | ### `calculate_cyclomatic_complexity`
66 | Calculate the cyclomatic complexity of a specific function to measure its complexity.
67 | 
68 | ### `find_most_complex_functions`
69 | Find the most complex functions in the codebase based on cyclomatic complexity.
70 | 
71 | ### `list_indexed_repositories`
72 | List all indexed repositories.
73 | 
74 | ### `delete_repository`
75 | Delete an indexed repository from the graph.
76 | 
77 | ### `visualize_graph_query`
78 | Generates a URL to visualize the results of a Cypher query in the Neo4j Browser. The user can open this URL in their web browser to see the graph visualization.
79 | 
80 | ### `list_watched_paths`
81 | Lists all directories currently being watched for live file changes.
82 | 
83 | ### `unwatch_directory`
84 | Stops watching a directory for live file changes.
85 | 
86 | ## Other Methods
87 | 
88 | -   `get_database_status()`: Returns the current connection status of the Neo4j database.
89 | -   `get_local_package_path(package_name)`: Finds the local installation path of a Python package.
90 | -   `run()`: Runs the main server loop, listening for JSON-RPC requests from stdin.
91 | -   `shutdown()`: Gracefully shuts down the server and its components.
92 | 
```

--------------------------------------------------------------------------------
/docs/site/assets/javascripts/lunr/min/lunr.sv.min.js:
--------------------------------------------------------------------------------

```javascript
 1 | /*!
 2 |  * Lunr languages, `Swedish` language
 3 |  * https://github.com/MihaiValentin/lunr-languages
 4 |  *
 5 |  * Copyright 2014, Mihai Valentin
 6 |  * http://www.mozilla.org/MPL/
 7 |  */
 8 | /*!
 9 |  * based on
10 |  * Snowball JavaScript Library v0.3
11 |  * http://code.google.com/p/urim/
12 |  * http://snowball.tartarus.org/
13 |  *
14 |  * Copyright 2010, Oleg Mazko
15 |  * http://www.mozilla.org/MPL/
16 |  */
17 | 
18 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o<a&&(o=a)}}function t(){var e,r=w.limit_backward;if(w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});
```

--------------------------------------------------------------------------------
/scripts/post_install_fix.sh:
--------------------------------------------------------------------------------

```bash
  1 | #!/bin/bash
  2 | set -e
  3 | 
  4 | echo "Running Post Install fix for CodeGraphContext..."
  5 | 
  6 | detect_shell_config() {
  7 |     # Windows PowerShell detection
  8 |     if [[ "$OS" == "Windows_NT" ]] && [[ -n "$PROFILE" ]]; then
  9 |         echo "$PROFILE"
 10 |         return
 11 |     fi
 12 |     
 13 |     # Unix/Linux/Mac shell detection
 14 |     if [ "$SHELL" = "/bin/bash" ] || [ "$SHELL" = "/usr/bin/bash" ]; then
 15 |         echo "$HOME/.bashrc"
 16 |     elif [ "$SHELL" = "/bin/zsh" ] || [ "$SHELL" = "/usr/bin/zsh" ]; then
 17 |         echo "$HOME/.zshrc"
 18 |     elif [ -n "$BASH_VERSION" ]; then
 19 |         echo "$HOME/.bashrc"
 20 |     elif [ -n "$ZSH_VERSION" ]; then
 21 |         echo "$HOME/.zshrc"
 22 |     else
 23 |         echo "$HOME/.profile"
 24 |     fi
 25 | }
 26 | 
 27 | # Add to PATH for Windows PowerShell
 28 | fix_windows_path() {
 29 |     local profile_file="$1"
 30 |     local path_line='$env:PATH = "$env:USERPROFILE\.local\bin;$env:PATH"'
 31 |     
 32 |     echo "Using PowerShell profile: $profile_file"
 33 |     
 34 |     # Create profile directory if needed
 35 |     local profile_dir=$(dirname "$profile_file")
 36 |     mkdir -p "$profile_dir" 2>/dev/null || true
 37 |     
 38 |     # Check if already configured
 39 |     if [[ -f "$profile_file" ]] && grep -q ".local" "$profile_file"; then
 40 |         echo "PATH is already configured in PowerShell profile"
 41 |     else
 42 |         echo "Adding to PowerShell PATH..."
 43 |         echo "" >> "$profile_file"
 44 |         echo "# Added by CodeGraphContext" >> "$profile_file"
 45 |         echo "$path_line" >> "$profile_file"
 46 |         echo "Added PATH to PowerShell profile"
 47 |     fi
 48 |     
 49 |     # Add to current session (Windows style)
 50 |     export PATH="$USERPROFILE/.local/bin:$PATH"
 51 |     
 52 |     echo "⚠️ Please restart PowerShell or run: . \$PROFILE"
 53 | }
 54 | 
 55 | # Add to PATH for Linux/Mac
 56 | fix_unix_path() {
 57 |     local config_file="$1"
 58 |     local path_line='export PATH="$HOME/.local/bin:$PATH"'
 59 | 
 60 |     echo "Using shell config: $config_file"
 61 | 
 62 |     # check if PATH is already configured
 63 |     if [ -f "$config_file" ] && grep -q ".local/bin" "$config_file"; then
 64 |         echo "PATH is already configured in $config_file"
 65 |     else
 66 |         echo "Adding ~/.local/bin to PATH..."
 67 |         echo "" >> "$config_file"
 68 |         echo "# Added by CodeGraphContext" >> "$config_file"
 69 |         echo "$path_line" >> "$config_file"
 70 |         echo "Added PATH to $config_file"
 71 |     fi
 72 | 
 73 |     # Source the config for current session
 74 |     echo "Sourcing/Reloading shell config for current session..."
 75 |     export PATH="$HOME/.local/bin:$PATH"
 76 | 
 77 |     # source it 
 78 |     if [ -f "$config_file" ]; then
 79 |         source "$config_file" 2>/dev/null || true
 80 |     fi
 81 | }
 82 | 
 83 | # Main PATH fixing function
 84 | fix_path() {
 85 |     local config_file=$(detect_shell_config)
 86 |     
 87 |     # Check if we're on Windows
 88 |     if [[ "$OS" == "Windows_NT" ]] && [[ -n "$PROFILE" ]]; then
 89 |         fix_windows_path "$config_file"
 90 |     else
 91 |         fix_unix_path "$config_file"
 92 |     fi
 93 | }
 94 | 
 95 | check_cgc() {
 96 |     if command -v cgc >/dev/null 2>&1; then
 97 |         return 0
 98 |     else
 99 |         return 1
100 |     fi
101 | }
102 | 
103 | # Get potential cgc locations based on platform
104 | get_cgc_locations() {
105 |     if [[ "$OS" == "Windows_NT" ]]; then
106 |         # Windows locations
107 |         echo "$USERPROFILE/.local/bin/cgc.exe"
108 |         echo "$USERPROFILE/.local/bin/cgc"
109 |         echo "$HOME/.local/bin/cgc.exe"
110 |         echo "$HOME/.local/bin/cgc"
111 |     else
112 |         # Linux/Mac locations
113 |         echo "$HOME/.local/bin/cgc"
114 |     fi
115 | }
116 | 
117 | 
118 | # Main execution
119 | if check_cgc; then
120 |     echo "✅ cgc (CodeGraphContext) is already available!"
121 | else
122 |     echo "⚠️ cgc command not found, fixing PATH..."
123 | 
124 |     # Check if cgc exists in expected locations
125 |     cgc_found=false
126 |     for cgc_path in $(get_cgc_locations); do
127 |         if [[ -f "$cgc_path" ]]; then
128 |             cgc_found=true
129 |             echo "📍 Found cgc at: $cgc_path"
130 |             break
131 |         fi
132 |     done
133 | 
134 |     if [[ "$cgc_found" == true ]]; then
135 |         fix_path
136 | 
137 |         # Check again
138 |         if check_cgc; then
139 |             echo "✅ cgc command (CodeGraphContext) is now available to use!"
140 |             echo "You can now run: cgc neo4j setup"
141 |         else
142 |             if [[ "$OS" == "Windows_NT" ]]; then
143 |                 echo "⚠️ Please restart PowerShell or run: . \$PROFILE"
144 |             else
145 |                 echo "❌ There seems to still be an issue... Please reload your terminal manually."
146 |             fi
147 |         fi
148 |     else
149 |         if [[ "$OS" == "Windows_NT" ]]; then
150 |             echo "❌ cgc not found in expected Windows locations. Please reinstall:"
151 |             echo "   pip install codegraphcontext"
152 |         else
153 |             echo "❌ cgc not found in ~/.local/bin. Please reinstall:"
154 |             echo "   pip install codegraphcontext"
155 |         fi
156 |     fi
157 | fi
```

--------------------------------------------------------------------------------
/docs/docs/cli.md:
--------------------------------------------------------------------------------

```markdown
 1 | # CLI Reference
 2 | 
 3 | The CodeGraphContext CLI provides a comprehensive command-line interface to manage the server, index your code, search, analyzing and interact with the code graph.
 4 | 
 5 | ## 1. Project Management
 6 | Use these commands to manage the repositories in your code graph.
 7 | 
 8 | | Command | Arguments | Description |
 9 | | :--- | :--- | :--- |
10 | | **`cgc index`** | `[path]` <br> `--force` | Adds a repository to the graph. Default path is current directory. Use `--force` to re-index from scratch. <br> *(Alias: `cgc i`)* |
11 | | **`cgc list`** | None | Lists all repositories currently indexed in the database. <br> *(Alias: `cgc ls`)* |
12 | | **`cgc delete`** | `[path]` <br> `--all` | Removes a repository from the graph. Use `--all` to wipe everything. <br> *(Alias: `cgc rm`)* |
13 | | **`cgc stats`** | `[path]` | Shows indexing statistics (node counts) for the DB or a specific repo. |
14 | | **`cgc clean`** | None | Removes orphaned nodes and cleans up the database. |
15 | | **`cgc add-package`** | `<name> <lang>` | Manually adds an external package node (e.g., `cgc add-package requests python`). |
16 | 
17 | ## 2. Watching & Monitoring
18 | Automatically track changes and keep your code graph up-to-date.
19 | 
20 | | Command | Arguments | Description |
21 | | :--- | :--- | :--- |
22 | | **`cgc watch`** | `[path]` | Watches a directory for file changes and automatically re-indexes. Runs in foreground. Default path is current directory. <br> *(Alias: `cgc w`)* |
23 | | **`cgc unwatch`** | `<path>` | Stops watching a previously watched directory. (Primarily for MCP mode) |
24 | | **`cgc watching`** | None | Lists all directories currently being watched for changes. (Primarily for MCP mode) |
25 | 
26 | ## 3. Code Analysis
27 | Understand the structure, quality, and relationships of your code.
28 | 
29 | | Command | Arguments | Description |
30 | | :--- | :--- | :--- |
31 | | **`cgc analyze calls`** | `<func_name>` <br> `--file` | Shows **outgoing** calls: what functions does this function call? |
32 | | **`cgc analyze callers`** | `<func_name>` <br> `--file` | Shows **incoming** calls: who calls this function? |
33 | | **`cgc analyze chain`** | `<start> <end>` <br> `--depth` | Finds the call path between two functions. Default depth is 5. |
34 | | **`cgc analyze deps`** | `<module>` <br> `--no-external` | Inspects dependencies (imports and importers) for a module. |
35 | | **`cgc analyze tree`** | `<class_name>` <br> `--file` | Visualizes the Class Inheritance hierarchy for a given class. |
36 | | **`cgc analyze complexity`**| `[path]` <br> `--threshold` <br> `--limit` | Lists functions with high Cyclomatic Complexity. Default threshold: 10. |
37 | | **`cgc analyze dead-code`** | `--exclude` | Finds potentially unused functions (0 callers). Use `--exclude` for decorators. |
38 | 
39 | ## 4. Discovery & Search
40 | Find code elements when you don't know the exact structure.
41 | 
42 | | Command | Arguments | Description |
43 | | :--- | :--- | :--- |
44 | | **`cgc find name`** | `<name>` <br> `--type` | Finds code elements (Class, Function) by their **exact** name. |
45 | | **`cgc find pattern`** | `<pattern>` <br> `--case-sensitive` | Finds elements using fuzzy substring matching (e.g. "User" finds "UserHelper"). |
46 | | **`cgc find type`** | `<type>` <br> `--limit` | Lists all nodes of a specific type (e.g. `function`, `class`, `module`). |
47 | 
48 | ## 5. Configuration & Setup
49 | Manage your environment and database connections.
50 | 
51 | | Command | Arguments | Description |
52 | | :--- | :--- | :--- |
53 | | **`cgc mcp setup`** | None | Configures your IDE/MCP Client. Creates `mcp.json`. <br> *(Alias: `cgc m`)* |
54 | | **`cgc neo4j setup`** | None | Wizard to configure a Neo4j connection. <br> *(Alias: `cgc n`)* |
55 | | **`cgc config show`** | None | Displays current configuration values. |
56 | | **`cgc config set`** | `<key> <value>` | Sets a config value (e.g. `DEFAULT_DATABASE`). |
57 | | **`cgc config reset`** | None | Resets configuration to defaults. |
58 | | **`cgc config db`** | `<backend>` | Quick switch between `neo4j` and `falkordb`. |
59 | 
60 | ## 6. Utilities & Runtime
61 | Helper commands for developers and the MCP server.
62 | 
63 | | Command | Arguments | Description |
64 | | :--- | :--- | :--- |
65 | | **`cgc doctor`** | None | Runs system diagnostics (DB connection, dependencies, permissions). |
66 | | **`cgc visualize`** | `[query]` | Generates a link to open the Neo4j Browser. <br> *(Alias: `cgc v`)* |
67 | | **`cgc query`** | `<query>` | Executes a raw Cypher query directly against the DB. |
68 | | **`cgc mcp start`** | None | Starts the MCP Server (used by IDEs). |
69 | | **`cgc mcp tools`** | None | Lists all available MCP tools supported by the server. |
70 | | **`cgc start`** | None | **Deprecated**. Use `cgc mcp start` instead. |
```

--------------------------------------------------------------------------------
/docs/site/assets/javascripts/lunr/min/lunr.da.min.js:
--------------------------------------------------------------------------------

```javascript
 1 | /*!
 2 |  * Lunr languages, `Danish` language
 3 |  * https://github.com/MihaiValentin/lunr-languages
 4 |  *
 5 |  * Copyright 2014, Mihai Valentin
 6 |  * http://www.mozilla.org/MPL/
 7 |  */
 8 | /*!
 9 |  * based on
10 |  * Snowball JavaScript Library v0.3
11 |  * http://code.google.com/p/urim/
12 |  * http://snowball.tartarus.org/
13 |  *
14 |  * Copyright 2010, Oleg Mazko
15 |  * http://www.mozilla.org/MPL/
16 |  */
17 | 
18 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){var e,r=f.cursor+3;if(d=f.limit,0<=r&&r<=f.limit){for(a=r;;){if(e=f.cursor,f.in_grouping(w,97,248)){f.cursor=e;break}if(f.cursor=e,e>=f.limit)return;f.cursor++}for(;!f.out_grouping(w,97,248);){if(f.cursor>=f.limit)return;f.cursor++}d=f.cursor,d<a&&(d=a)}}function n(){var e,r;if(f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(c,32),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del();break;case 2:f.in_grouping_b(p,97,229)&&f.slice_del()}}function t(){var e,r=f.limit-f.cursor;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.find_among_b(l,4)?(f.bra=f.cursor,f.limit_backward=e,f.cursor=f.limit-r,f.cursor>f.limit_backward&&(f.cursor--,f.bra=f.cursor,f.slice_del())):f.limit_backward=e)}function s(){var e,r,i,n=f.limit-f.cursor;if(f.ket=f.cursor,f.eq_s_b(2,"st")&&(f.bra=f.cursor,f.eq_s_b(2,"ig")&&f.slice_del()),f.cursor=f.limit-n,f.cursor>=d&&(r=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,e=f.find_among_b(m,5),f.limit_backward=r,e))switch(f.bra=f.cursor,e){case 1:f.slice_del(),i=f.limit-f.cursor,t(),f.cursor=f.limit-i;break;case 2:f.slice_from("løs")}}function o(){var e;f.cursor>=d&&(e=f.limit_backward,f.limit_backward=d,f.ket=f.cursor,f.out_grouping_b(w,97,248)?(f.bra=f.cursor,u=f.slice_to(u),f.limit_backward=e,f.eq_v_b(u)&&f.slice_del()):f.limit_backward=e)}var a,d,u,c=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],l=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],w=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],p=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],f=new i;this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var r=f.cursor;return e(),f.limit_backward=r,f.cursor=f.limit,n(),f.cursor=f.limit,t(),f.cursor=f.limit,s(),f.cursor=f.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});
```

--------------------------------------------------------------------------------
/docs/docs/tools.md:
--------------------------------------------------------------------------------

```markdown
 1 | # Tools
 2 | 
 3 | The `tools` directory contains the logic for code analysis, including building the graph, finding code, and extracting imports.
 4 | 
 5 | ## `GraphBuilder`
 6 | 
 7 | The `GraphBuilder` class in `graph_builder.py` is responsible for parsing the source code and building the graph representation that is stored in the Neo4j database.
 8 | 
 9 | ### `TreeSitterParser`
10 | 
11 | `GraphBuilder` uses the `TreeSitterParser` class, which is a generic parser wrapper for a specific language using the tree-sitter library. This allows CodeGraphContext to support multiple programming languages in a modular way.
12 | 
13 | ### Graph Building Process
14 | 
15 | The graph building process consists of several steps:
16 | 
17 | 1.  **Pre-scan for Imports:** A quick scan of all files to build a global map of where every symbol is defined.
18 | 2.  **Parse Files:** Each file is parsed in detail to extract its structure, including functions, classes, variables, and imports.
19 | 3.  **Add Nodes to Graph:** The extracted code elements are added to the graph as nodes.
20 | 4.  **Create Relationships:** Relationships between the nodes are created, such as `CALLS` for function calls and `INHERITS` for class inheritance.
21 | 
22 | ## `CodeFinder`
23 | 
24 | The `CodeFinder` class in `code_finder.py` provides functionality to search for specific code elements and analyze their relationships within the indexed codebase.
25 | 
26 | ### Key Methods
27 | 
28 | -   `find_by_function_name()`: Finds functions by name.
29 | -   `find_by_class_name()`: Finds classes by name.
30 | -   `find_by_variable_name()`: Finds variables by name.
31 | -   `find_by_content()`: Finds code by content matching in source or docstrings.
32 | -   `find_related_code()`: Finds code related to a query using multiple search strategies.
33 | -   `analyze_code_relationships()`: Analyzes different types of code relationships, such as callers, callees, importers, and class hierarchies.
34 | 
35 | ## `ImportExtractor`
36 | 
37 | The `ImportExtractor` class in `import_extractor.py` is a utility for extracting package and module imports from source code files of various programming languages. It uses the most appropriate parsing technique for each language, such as AST for Python and regular expressions for JavaScript.
38 | 
39 | # Tools Exploration
40 | There are a total of 14 tools available to the users, and here we have attached illustrative demos for each one of them.
41 | 
42 | ## find_code Tool
43 | 
44 | The `find_code` tool allows users to search for code snippets, functions, classes, and variables within the codebase using natural language queries. This tool helps developers understand and navigate large codebases efficiently.
45 | 
46 | Below is an embedded link to a demo video showcasing the usage of the `find_code` tool in action.
47 | [![Watch the demo video](./images/tool_images/1.png)](https://drive.google.com/file/d/1ojCDIIAwcir9e3jgHHIVC5weZ9nuIQcs/view?usp=drive_link)
48 | 
49 | ---
50 | 
51 | ## watch_directory Tool
52 | 
53 | The `watch_directory` tool allows users to monitor a specified directory for file changes, additions, or deletions in real-time. It helps developers automate workflows such as triggering scripts, updating indexes, or syncing files whenever changes occur in the directory.
54 | 
55 | Below is an embedded link to a demo video showcasing the usage of the `watch_directory` tool in a development environment.
56 | [![Watch the demo](./images/tool_images/2.png)](https://drive.google.com/file/d/1OEjcS2iwwymss99zLidbeBjcblferKBX/view?usp=drive_link) 
57 | 
58 | ---
59 | 
60 | ## analyze_code_relationships Tool
61 | 
62 | The `analyze_code_relationships` tool in CodeGraphContext is designed to let users query and explore the various relationships between code elements in a codebase, represented as a graph in Neo4j. 
63 | 
64 | ### Relationship Types That Can Be Analyzed
65 | 
66 | - **CALLS:** Finds which functions call or are called by a function.
67 | - **CALLED_BY:** Finds all functions that directly or indirectly call a target function (inverse of CALLS).
68 | - **INHERITS_FROM:** Finds class inheritance relationships; which classes inherit from which.
69 | - **CONTAINS:** Shows containment (which classes/functions are inside which modules or files).
70 | - **IMPLEMENTS:** Shows which classes implement an interface.
71 | - **IMPORTS:** Identifies which files or modules import a specific module.
72 | - **DEFINED_IN:** Locates where an entity (function/class) is defined.
73 | - **HAS_ARGUMENT:** Shows relationships from functions to their arguments.
74 | - **DECLARES:** Finds variables declared in functions or classes.
75 | 
76 | Below is an embedded link to a demo video showcasing the usage of the `analyse_code_relationships` tool.
77 | [![Watch the demo](./images/tool_images/3.png)](https://drive.google.com/file/d/154M_lTPbg9_Gj9bd2ErnAVbJArSbcb2M/view?usp=drive_link) 
78 | 
79 | ---
80 | 
```

--------------------------------------------------------------------------------
/docs/site/assets/javascripts/lunr/min/lunr.no.min.js:
--------------------------------------------------------------------------------

```javascript
 1 | /*!
 2 |  * Lunr languages, `Norwegian` language
 3 |  * https://github.com/MihaiValentin/lunr-languages
 4 |  *
 5 |  * Copyright 2014, Mihai Valentin
 6 |  * http://www.mozilla.org/MPL/
 7 |  */
 8 | /*!
 9 |  * based on
10 |  * Snowball JavaScript Library v0.3
11 |  * http://code.google.com/p/urim/
12 |  * http://snowball.tartarus.org/
13 |  *
14 |  * Copyright 2010, Oleg Mazko
15 |  * http://www.mozilla.org/MPL/
16 |  */
17 | 
18 | !function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,r=w.cursor+3;if(a=w.limit,0<=r||r<=w.limit){for(s=r;;){if(e=w.cursor,w.in_grouping(d,97,248)){w.cursor=e;break}if(e>=w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}a=w.cursor,a<s&&(a=s)}}function i(){var e,r,n;if(w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
```

--------------------------------------------------------------------------------
/docs/docs/troubleshooting.md:
--------------------------------------------------------------------------------

```markdown
  1 | # CodeGraphContext Troubleshooting Guide
  2 | 
  3 | Use this checklist whenever `cgc mcp setup` or `cgc mcp start` doesn’t behave as expected. It keeps the happy path short, but includes the fallback steps when something goes wrong.
  4 | 
  5 | ## 1. Prerequisites at a glance
  6 | 
  7 | - **Windows + PowerShell** commands below assume the `py` launcher. Adapt to `python3` if you're on macOS/Linux.
  8 | - **Python 3.12+** (recommended for FalkorDB Lite support). Run `py -3.12 --version` to confirm.
  9 | - **Database Options:**
 10 |   - **FalkorDB Lite** (default for Unix/Linux/macOS, Python 3.12+): No setup required, works out of the box.
 11 |   - **Neo4j** (required for Windows, optional for others): Requires Docker, WSL, or native installation. Setup via `cgc neo4j setup`.
 12 | 
 13 | ## 2. Create and activate a virtual environment
 14 | 
 15 | From the repository root (`CodeGraphContext/`):
 16 | 
 17 | ```powershell
 18 | py -3.11 -m venv venv
 19 | .\venv\Scripts\python.exe -m pip install --upgrade pip
 20 | ```
 21 | 
 22 | - On Windows, Neo4j driver 6.x can crash with `AttributeError: socket.EAI_ADDRFAMILY`. If you see that, run:
 23 |   ```powershell
 24 |   .\venv\Scripts\python.exe -m pip install "neo4j<6"
 25 |   ```
 26 | 
 27 | ## 3. Run the Neo4j setup wizard (optional for Unix, required for Windows)
 28 | 
 29 | **Note:** If you're on Unix/Linux/macOS with Python 3.12+, FalkorDB Lite is already your default database. You can skip this step unless you prefer Neo4j.
 30 | 
 31 | **For Windows users or those preferring Neo4j**, launch the wizard:
 32 | 
 33 | ```powershell
 34 | .\venv\Scripts\cgc.exe neo4j setup
 35 | ```
 36 | 
 37 | > **Tip:** If you want the wizard to spin up a local Neo4j instance for you, make sure **Docker Desktop** is installed and running before you launch `cgc neo4j setup`. If Docker isn't running, the setup wizard will fail when it tries to install Neo4j locally.
 38 | 
 39 | What happens next:
 40 | 
 41 | - The wizard checks for Docker. If it's running, it can auto-provision a local Neo4j instance for you.
 42 | - Alternatively, you can supply credentials for an existing Neo4j AuraDB database.
 43 | - At the end, it generates:
 44 |   - `mcp.json` in your project directory (stores the MCP server command + env vars).
 45 |   - `~/.codegraphcontext/.env` containing `NEO4J_URI`, `NEO4J_USERNAME`, `NEO4J_PASSWORD`.
 46 | 
 47 | Make sure the Docker container (or remote Neo4j) is still running before you start the server.
 48 | 
 49 | ## 4. Start the MCP server
 50 | 
 51 | Once the wizard completes successfully:
 52 | 
 53 | ```powershell
 54 | .\venv\Scripts\cgc.exe mcp start
 55 | ```
 56 | 
 57 | Expected output includes:
 58 | 
 59 | ```text
 60 | Starting CodeGraphContext Server...
 61 | ...
 62 | MCP Server is running. Waiting for requests...
 63 | ```
 64 | 
 65 | If you instead see:
 66 | 
 67 | ```text
 68 | Configuration Error: Neo4j credentials must be set via environment variables
 69 | ```
 70 | 
 71 | then either no credentials were saved, or the wizard was skipped—see the manual alternative below.
 72 | 
 73 | ## 5. Manual credential setup (fallback)
 74 | 
 75 | If you prefer not to use the wizard or need to fix a broken configuration:
 76 | 
 77 | 1. Create a `mcp.json` (or edit the one that exists) in the repository root:
 78 | 
 79 |    ```json
 80 |    {
 81 |      "mcpServers": {
 82 |        "CodeGraphContext": {
 83 |          "command": "cgc",
 84 |          "args": ["mcp", "start"],
 85 |          "env": {
 86 |            "NEO4J_URI": "neo4j+s://YOUR-HOSTNAME:7687",
 87 |            "NEO4J_USERNAME": "neo4j",
 88 |            "NEO4J_PASSWORD": "super-secret-password"
 89 |          }
 90 |        }
 91 |      }
 92 |    }
 93 |    ```
 94 | 
 95 | 2. (Optional) Also create `%USERPROFILE%\.codegraphcontext\.env` with the same key/value pairs. The CLI loads that file automatically.
 96 | 
 97 | 3. Re-run:
 98 | 
 99 |    ```powershell
100 |    .\venv\Scripts\cgc.exe mcp start
101 |    ```
102 | 
103 | ## 6. Common issues & fixes
104 | 
105 | | Symptom | Likely Cause | Fix |
106 | | --- | --- | --- |
107 | | `Configuration Error: Neo4j credentials must be set…` | `mcp.json`/`.env` missing or empty | Run `cgc neo4j setup` again **with Docker running**, or create the files manually (section 5). |
108 | | `AttributeError: socket.EAI_ADDRFAMILY` | Neo4j 6.x bug on Windows | Install the 5.x driver: `.\venv\Scripts\python.exe -m pip install "neo4j<6"` and retry. |
109 | | Setup wizard fails while pulling Docker image | Docker Desktop not running or Docker permissions missing | Start Docker Desktop, wait for it to report “Running”, then rerun `cgc neo4j setup`. |
110 | | Server exits immediately with no log | Neo4j instance is offline | Check Docker container status or AuraDB dashboard; restart Neo4j and call `cgc mcp start` again. |
111 | 
112 | ## 7. After the server is running
113 | 
114 | - Keep the virtual environment active whenever you run `cgc` commands.
115 | - Use `pytest` from the same env to run tests:
116 | 
117 |   ```powershell
118 |   .\venv\Scripts\pytest
119 |   ```
120 | 
121 | - Front-end website lives under `website/` if you need to run `npm run dev`.
122 | 
123 | When in doubt, re-run the wizard with Docker active—it regenerates the configuration files without touching your code. Let me know if any section needs clarifying! :)
```

--------------------------------------------------------------------------------
/tests/sample_project_go/goroutines_channels.go:
--------------------------------------------------------------------------------

```go
  1 | // goroutines_channels.go - Demonstrates Go concurrency patterns
  2 | package main
  3 | 
  4 | import (
  5 | 	"fmt"
  6 | 	"sync"
  7 | 	"time"
  8 | )
  9 | 
 10 | // SimpleGoroutine demonstrates basic goroutine
 11 | func SimpleGoroutine(id int) {
 12 | 	fmt.Printf("Goroutine %d starting\n", id)
 13 | 	time.Sleep(time.Millisecond * 100)
 14 | 	fmt.Printf("Goroutine %d done\n", id)
 15 | }
 16 | 
 17 | // ChannelSender sends data to a channel
 18 | func ChannelSender(ch chan<- int, values []int) {
 19 | 	for _, v := range values {
 20 | 		ch <- v
 21 | 	}
 22 | 	close(ch)
 23 | }
 24 | 
 25 | // ChannelReceiver receives data from a channel
 26 | func ChannelReceiver(ch <-chan int, done chan<- bool) {
 27 | 	sum := 0
 28 | 	for v := range ch {
 29 | 		sum += v
 30 | 	}
 31 | 	fmt.Printf("Sum: %d\n", sum)
 32 | 	done <- true
 33 | }
 34 | 
 35 | // BufferedChannelExample demonstrates buffered channels
 36 | func BufferedChannelExample() {
 37 | 	ch := make(chan string, 3)
 38 | 	
 39 | 	ch <- "first"
 40 | 	ch <- "second"
 41 | 	ch <- "third"
 42 | 	
 43 | 	fmt.Println(<-ch)
 44 | 	fmt.Println(<-ch)
 45 | 	fmt.Println(<-ch)
 46 | }
 47 | 
 48 | // SelectExample demonstrates select statement
 49 | func SelectExample(ch1, ch2 chan string) string {
 50 | 	select {
 51 | 	case msg1 := <-ch1:
 52 | 		return fmt.Sprintf("Received from ch1: %s", msg1)
 53 | 	case msg2 := <-ch2:
 54 | 		return fmt.Sprintf("Received from ch2: %s", msg2)
 55 | 	case <-time.After(time.Second):
 56 | 		return "Timeout"
 57 | 	}
 58 | }
 59 | 
 60 | // Worker demonstrates worker pool pattern
 61 | func Worker(id int, jobs <-chan int, results chan<- int, wg *sync.WaitGroup) {
 62 | 	defer wg.Done()
 63 | 	for job := range jobs {
 64 | 		fmt.Printf("Worker %d processing job %d\n", id, job)
 65 | 		time.Sleep(time.Millisecond * 50)
 66 | 		results <- job * 2
 67 | 	}
 68 | }
 69 | 
 70 | // WorkerPool creates a pool of workers
 71 | func WorkerPool(numWorkers int, numJobs int) []int {
 72 | 	jobs := make(chan int, numJobs)
 73 | 	results := make(chan int, numJobs)
 74 | 	var wg sync.WaitGroup
 75 | 	
 76 | 	// Start workers
 77 | 	for w := 1; w <= numWorkers; w++ {
 78 | 		wg.Add(1)
 79 | 		go Worker(w, jobs, results, &wg)
 80 | 	}
 81 | 	
 82 | 	// Send jobs
 83 | 	for j := 1; j <= numJobs; j++ {
 84 | 		jobs <- j
 85 | 	}
 86 | 	close(jobs)
 87 | 	
 88 | 	// Wait and collect results
 89 | 	go func() {
 90 | 		wg.Wait()
 91 | 		close(results)
 92 | 	}()
 93 | 	
 94 | 	var output []int
 95 | 	for result := range results {
 96 | 		output = append(output, result)
 97 | 	}
 98 | 	
 99 | 	return output
100 | }
101 | 
102 | // Counter demonstrates mutex for safe concurrent access
103 | type Counter struct {
104 | 	mu    sync.Mutex
105 | 	value int
106 | }
107 | 
108 | // Increment safely increments counter
109 | func (c *Counter) Increment() {
110 | 	c.mu.Lock()
111 | 	defer c.mu.Unlock()
112 | 	c.value++
113 | }
114 | 
115 | // GetValue safely gets counter value
116 | func (c *Counter) GetValue() int {
117 | 	c.mu.Lock()
118 | 	defer c.mu.Unlock()
119 | 	return c.value
120 | }
121 | 
122 | // RWMutexExample demonstrates read-write mutex
123 | type ConcurrentMap struct {
124 | 	mu   sync.RWMutex
125 | 	data map[string]int
126 | }
127 | 
128 | // Set adds or updates a value
129 | func (cm *ConcurrentMap) Set(key string, value int) {
130 | 	cm.mu.Lock()
131 | 	defer cm.mu.Unlock()
132 | 	cm.data[key] = value
133 | }
134 | 
135 | // Get retrieves a value
136 | func (cm *ConcurrentMap) Get(key string) (int, bool) {
137 | 	cm.mu.RLock()
138 | 	defer cm.mu.RUnlock()
139 | 	val, ok := cm.data[key]
140 | 	return val, ok
141 | }
142 | 
143 | // OnceExample demonstrates sync.Once
144 | var once sync.Once
145 | var instance *Singleton
146 | 
147 | type Singleton struct {
148 | 	data string
149 | }
150 | 
151 | // GetSingleton returns singleton instance
152 | func GetSingleton() *Singleton {
153 | 	once.Do(func() {
154 | 		fmt.Println("Creating singleton instance")
155 | 		instance = &Singleton{data: "singleton data"}
156 | 	})
157 | 	return instance
158 | }
159 | 
160 | // PipelineStage1 first stage of pipeline
161 | func PipelineStage1(input <-chan int, output chan<- int) {
162 | 	for num := range input {
163 | 		output <- num * 2
164 | 	}
165 | 	close(output)
166 | }
167 | 
168 | // PipelineStage2 second stage of pipeline
169 | func PipelineStage2(input <-chan int, output chan<- int) {
170 | 	for num := range input {
171 | 		output <- num + 10
172 | 	}
173 | 	close(output)
174 | }
175 | 
176 | // Pipeline demonstrates pipeline pattern
177 | func Pipeline(numbers []int) []int {
178 | 	stage1 := make(chan int)
179 | 	stage2 := make(chan int)
180 | 	
181 | 	// Input
182 | 	go func() {
183 | 		for _, num := range numbers {
184 | 			stage1 <- num
185 | 		}
186 | 		close(stage1)
187 | 	}()
188 | 	
189 | 	// Stage 1
190 | 	go PipelineStage1(stage1, stage2)
191 | 	
192 | 	// Collect results
193 | 	var results []int
194 | 	for result := range stage2 {
195 | 		results = append(results, result)
196 | 	}
197 | 	
198 | 	return results
199 | }
200 | 
201 | // FanOut sends data to multiple channels
202 | func FanOut(input <-chan int, outputs []chan<- int) {
203 | 	for val := range input {
204 | 		for _, out := range outputs {
205 | 			out <- val
206 | 		}
207 | 	}
208 | 	for _, out := range outputs {
209 | 		close(out)
210 | 	}
211 | }
212 | 
213 | // FanIn merges multiple channels into one
214 | func FanIn(inputs ...<-chan int) <-chan int {
215 | 	output := make(chan int)
216 | 	var wg sync.WaitGroup
217 | 	
218 | 	for _, input := range inputs {
219 | 		wg.Add(1)
220 | 		go func(ch <-chan int) {
221 | 			defer wg.Done()
222 | 			for val := range ch {
223 | 				output <- val
224 | 			}
225 | 		}(input)
226 | 	}
227 | 	
228 | 	go func() {
229 | 		wg.Wait()
230 | 		close(output)
231 | 	}()
232 | 	
233 | 	return output
234 | }
235 | 
236 | func demonstrateConcurrency() {
237 | 	// Simple goroutines
238 | 	for i := 1; i <= 3; i++ {
239 | 		go SimpleGoroutine(i)
240 | 	}
241 | 	
242 | 	// Worker pool
243 | 	results := WorkerPool(3, 5)
244 | 	fmt.Println("Results:", results)
245 | 	
246 | 	time.Sleep(time.Second)
247 | }
248 | 
249 | 
```
Page 3/22FirstPrevNextLast