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

# Directory Structure

```
├── .github
│   └── workflows
│       ├── e2e-tests.yml
│       ├── post_discord_invite.yml
│       ├── test.yml
│       └── update-contributors.yml
├── .gitignore
├── 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
│   ├── mkdocs.yml
│   └── site
│       ├── 404.html
│       ├── architecture
│       │   └── index.html
│       ├── assets
│       │   ├── images
│       │   │   └── favicon.png
│       │   ├── javascripts
│       │   │   ├── bundle.f55a23d4.min.js
│       │   │   ├── bundle.f55a23d4.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.973d3a69.min.js
│       │   │       └── search.973d3a69.min.js.map
│       │   └── stylesheets
│       │       ├── main.2a3383ac.min.css
│       │       ├── main.2a3383ac.min.css.map
│       │       ├── palette.06af60db.min.css
│       │       └── palette.06af60db.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
├── 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
├── package-lock.json
├── pyproject.toml
├── README.md
├── scripts
│   ├── generate_lang_contributors.py
│   └── post_install_fix.sh
├── SECURITY.md
├── src
│   └── codegraphcontext
│       ├── __init__.py
│       ├── __main__.py
│       ├── cli
│       │   ├── __init__.py
│       │   ├── cli_helpers.py
│       │   ├── main.py
│       │   ├── setup_macos.py
│       │   └── setup_wizard.py
│       ├── core
│       │   ├── __init__.py
│       │   ├── database.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
│       │   │   ├── go.py
│       │   │   ├── java.py
│       │   │   ├── javascript.py
│       │   │   ├── python.py
│       │   │   ├── ruby.py
│       │   │   ├── rust.py
│       │   │   └── typescript.py
│       │   ├── package_resolver.py
│       │   ├── query_tool_languages
│       │   │   ├── c_toolkit.py
│       │   │   ├── cpp_toolkit.py
│       │   │   ├── go_toolkit.py
│       │   │   ├── java_toolkit.py
│       │   │   ├── javascript_toolkit.py
│       │   │   ├── python_toolkit.py
│       │   │   ├── ruby_toolkit.py
│       │   │   ├── rust_toolkit.py
│       │   │   └── typescript_toolkit.py
│       │   └── system.py
│       └── utils
│           └── debug_log.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_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_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_typescript
│   │   ├── package.json
│   │   ├── README.md
│   │   ├── 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_tree_sitter
│   │   ├── __init__.py
│   │   ├── class_instantiation.py
│   │   ├── complex_classes.py
│   │   └── test_file.py
│   └── test_typescript_parser.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
    │   │   ├── 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
```

# Files

--------------------------------------------------------------------------------
/docs/site/404.html:
--------------------------------------------------------------------------------

```html
  1 | 
  2 | <!doctype html>
  3 | <html lang="en" class="no-js">
  4 |   <head>
  5 |     
  6 |       <meta charset="utf-8">
  7 |       <meta name="viewport" content="width=device-width,initial-scale=1">
  8 |       
  9 |       
 10 |       
 11 |       
 12 |       
 13 |       
 14 |       <link rel="icon" href="/assets/images/favicon.png">
 15 |       <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.21">
 16 |     
 17 |     
 18 |       
 19 |         <title>CodeGraphContext</title>
 20 |       
 21 |     
 22 |     
 23 |       <link rel="stylesheet" href="/assets/stylesheets/main.2a3383ac.min.css">
 24 |       
 25 |       
 26 | 
 27 | 
 28 |     
 29 |     
 30 |       
 31 |     
 32 |     
 33 |       
 34 |         
 35 |         
 36 |         <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 37 |         <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
 38 |         <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
 39 |       
 40 |     
 41 |     
 42 |     <script>__md_scope=new URL("/",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
 43 |     
 44 |       
 45 | 
 46 |     
 47 |     
 48 |     
 49 |   </head>
 50 |   
 51 |   
 52 |     <body dir="ltr">
 53 |   
 54 |     
 55 |     <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
 56 |     <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
 57 |     <label class="md-overlay" for="__drawer"></label>
 58 |     <div data-md-component="skip">
 59 |       
 60 |     </div>
 61 |     <div data-md-component="announce">
 62 |       
 63 |     </div>
 64 |     
 65 |     
 66 |       
 67 | 
 68 |   
 69 | 
 70 | <header class="md-header md-header--shadow" data-md-component="header">
 71 |   <nav class="md-header__inner md-grid" aria-label="Header">
 72 |     <a href="/." title="CodeGraphContext" class="md-header__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
 73 |       
 74 |   
 75 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
 76 | 
 77 |     </a>
 78 |     <label class="md-header__button md-icon" for="__drawer">
 79 |       
 80 |       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
 81 |     </label>
 82 |     <div class="md-header__title" data-md-component="header-title">
 83 |       <div class="md-header__ellipsis">
 84 |         <div class="md-header__topic">
 85 |           <span class="md-ellipsis">
 86 |             CodeGraphContext
 87 |           </span>
 88 |         </div>
 89 |         <div class="md-header__topic" data-md-component="header-topic">
 90 |           <span class="md-ellipsis">
 91 |             
 92 |               
 93 |             
 94 |           </span>
 95 |         </div>
 96 |       </div>
 97 |     </div>
 98 |     
 99 |     
100 |       <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
101 |     
102 |     
103 |     
104 |       
105 |       
106 |         <label class="md-header__button md-icon" for="__search">
107 |           
108 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
109 |         </label>
110 |         <div class="md-search" data-md-component="search" role="dialog">
111 |   <label class="md-search__overlay" for="__search"></label>
112 |   <div class="md-search__inner" role="search">
113 |     <form class="md-search__form" name="search">
114 |       <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
115 |       <label class="md-search__icon md-icon" for="__search">
116 |         
117 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
118 |         
119 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
120 |       </label>
121 |       <nav class="md-search__options" aria-label="Search">
122 |         
123 |         <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
124 |           
125 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
126 |         </button>
127 |       </nav>
128 |       
129 |     </form>
130 |     <div class="md-search__output">
131 |       <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
132 |         <div class="md-search-result" data-md-component="search-result">
133 |           <div class="md-search-result__meta">
134 |             Initializing search
135 |           </div>
136 |           <ol class="md-search-result__list" role="presentation"></ol>
137 |         </div>
138 |       </div>
139 |     </div>
140 |   </div>
141 | </div>
142 |       
143 |     
144 |     
145 |   </nav>
146 |   
147 | </header>
148 |     
149 |     <div class="md-container" data-md-component="container">
150 |       
151 |       
152 |         
153 |           
154 |         
155 |       
156 |       <main class="md-main" data-md-component="main">
157 |         <div class="md-main__inner md-grid">
158 |           
159 |             
160 |               
161 |               <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
162 |                 <div class="md-sidebar__scrollwrap">
163 |                   <div class="md-sidebar__inner">
164 |                     
165 | 
166 | 
167 | 
168 | <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
169 |   <label class="md-nav__title" for="__drawer">
170 |     <a href="/." title="CodeGraphContext" class="md-nav__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
171 |       
172 |   
173 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
174 | 
175 |     </a>
176 |     CodeGraphContext
177 |   </label>
178 |   
179 |   <ul class="md-nav__list" data-md-scrollfix>
180 |     
181 |       
182 |       
183 |   
184 |   
185 |   
186 |   
187 |     <li class="md-nav__item">
188 |       <a href="/." class="md-nav__link">
189 |         
190 |   
191 |   
192 |   <span class="md-ellipsis">
193 |     Home
194 |     
195 |   </span>
196 |   
197 | 
198 |       </a>
199 |     </li>
200 |   
201 | 
202 |     
203 |       
204 |       
205 |   
206 |   
207 |   
208 |   
209 |     <li class="md-nav__item">
210 |       <a href="/installation/" class="md-nav__link">
211 |         
212 |   
213 |   
214 |   <span class="md-ellipsis">
215 |     Installation
216 |     
217 |   </span>
218 |   
219 | 
220 |       </a>
221 |     </li>
222 |   
223 | 
224 |     
225 |       
226 |       
227 |   
228 |   
229 |   
230 |   
231 |     <li class="md-nav__item">
232 |       <a href="/use_cases/" class="md-nav__link">
233 |         
234 |   
235 |   
236 |   <span class="md-ellipsis">
237 |     Use Cases
238 |     
239 |   </span>
240 |   
241 | 
242 |       </a>
243 |     </li>
244 |   
245 | 
246 |     
247 |       
248 |       
249 |   
250 |   
251 |   
252 |   
253 |     <li class="md-nav__item">
254 |       <a href="/architecture/" class="md-nav__link">
255 |         
256 |   
257 |   
258 |   <span class="md-ellipsis">
259 |     Architecture
260 |     
261 |   </span>
262 |   
263 | 
264 |       </a>
265 |     </li>
266 |   
267 | 
268 |     
269 |       
270 |       
271 |   
272 |   
273 |   
274 |   
275 |     <li class="md-nav__item">
276 |       <a href="/cli/" class="md-nav__link">
277 |         
278 |   
279 |   
280 |   <span class="md-ellipsis">
281 |     CLI Reference
282 |     
283 |   </span>
284 |   
285 | 
286 |       </a>
287 |     </li>
288 |   
289 | 
290 |     
291 |       
292 |       
293 |   
294 |   
295 |   
296 |   
297 |     <li class="md-nav__item">
298 |       <a href="/server/" class="md-nav__link">
299 |         
300 |   
301 |   
302 |   <span class="md-ellipsis">
303 |     Server
304 |     
305 |   </span>
306 |   
307 | 
308 |       </a>
309 |     </li>
310 |   
311 | 
312 |     
313 |       
314 |       
315 |   
316 |   
317 |   
318 |   
319 |     <li class="md-nav__item">
320 |       <a href="/core/" class="md-nav__link">
321 |         
322 |   
323 |   
324 |   <span class="md-ellipsis">
325 |     Core Concepts
326 |     
327 |   </span>
328 |   
329 | 
330 |       </a>
331 |     </li>
332 |   
333 | 
334 |     
335 |       
336 |       
337 |   
338 |   
339 |   
340 |   
341 |     <li class="md-nav__item">
342 |       <a href="/tools/" class="md-nav__link">
343 |         
344 |   
345 |   
346 |   <span class="md-ellipsis">
347 |     Tools
348 |     
349 |   </span>
350 |   
351 | 
352 |       </a>
353 |     </li>
354 |   
355 | 
356 |     
357 |       
358 |       
359 |   
360 |   
361 |   
362 |   
363 |     <li class="md-nav__item">
364 |       <a href="/cookbook/" class="md-nav__link">
365 |         
366 |   
367 |   
368 |   <span class="md-ellipsis">
369 |     Cookbook
370 |     
371 |   </span>
372 |   
373 | 
374 |       </a>
375 |     </li>
376 |   
377 | 
378 |     
379 |       
380 |       
381 |   
382 |   
383 |   
384 |   
385 |     
386 |     
387 |     
388 |     
389 |     
390 |     <li class="md-nav__item md-nav__item--nested">
391 |       
392 |         
393 |         
394 |         <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
395 |         
396 |           
397 |           <label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
398 |             
399 |   
400 |   
401 |   <span class="md-ellipsis">
402 |     Contributing
403 |     
404 |   </span>
405 |   
406 | 
407 |             <span class="md-nav__icon md-icon"></span>
408 |           </label>
409 |         
410 |         <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
411 |           <label class="md-nav__title" for="__nav_10">
412 |             <span class="md-nav__icon md-icon"></span>
413 |             Contributing
414 |           </label>
415 |           <ul class="md-nav__list" data-md-scrollfix>
416 |             
417 |               
418 |                 
419 |   
420 |   
421 |   
422 |   
423 |     <li class="md-nav__item">
424 |       <a href="/contributing/" class="md-nav__link">
425 |         
426 |   
427 |   
428 |   <span class="md-ellipsis">
429 |     Overview
430 |     
431 |   </span>
432 |   
433 | 
434 |       </a>
435 |     </li>
436 |   
437 | 
438 |               
439 |             
440 |               
441 |                 
442 |   
443 |   
444 |   
445 |   
446 |     <li class="md-nav__item">
447 |       <a href="/contributing_languages/" class="md-nav__link">
448 |         
449 |   
450 |   
451 |   <span class="md-ellipsis">
452 |     Adding New Languages
453 |     
454 |   </span>
455 |   
456 | 
457 |       </a>
458 |     </li>
459 |   
460 | 
461 |               
462 |             
463 |           </ul>
464 |         </nav>
465 |       
466 |     </li>
467 |   
468 | 
469 |     
470 |       
471 |       
472 |   
473 |   
474 |   
475 |   
476 |     <li class="md-nav__item">
477 |       <a href="/troubleshooting/" class="md-nav__link">
478 |         
479 |   
480 |   
481 |   <span class="md-ellipsis">
482 |     Troubleshooting
483 |     
484 |   </span>
485 |   
486 | 
487 |       </a>
488 |     </li>
489 |   
490 | 
491 |     
492 |       
493 |       
494 |   
495 |   
496 |   
497 |   
498 |     <li class="md-nav__item">
499 |       <a href="/future_work/" class="md-nav__link">
500 |         
501 |   
502 |   
503 |   <span class="md-ellipsis">
504 |     Future Work
505 |     
506 |   </span>
507 |   
508 | 
509 |       </a>
510 |     </li>
511 |   
512 | 
513 |     
514 |       
515 |       
516 |   
517 |   
518 |   
519 |   
520 |     <li class="md-nav__item">
521 |       <a href="/license/" class="md-nav__link">
522 |         
523 |   
524 |   
525 |   <span class="md-ellipsis">
526 |     License
527 |     
528 |   </span>
529 |   
530 | 
531 |       </a>
532 |     </li>
533 |   
534 | 
535 |     
536 |   </ul>
537 | </nav>
538 |                   </div>
539 |                 </div>
540 |               </div>
541 |             
542 |             
543 |               
544 |               <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
545 |                 <div class="md-sidebar__scrollwrap">
546 |                   <div class="md-sidebar__inner">
547 |                     
548 | 
549 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
550 |   
551 |   
552 |   
553 |   
554 | </nav>
555 |                   </div>
556 |                 </div>
557 |               </div>
558 |             
559 |           
560 |           
561 |             <div class="md-content" data-md-component="content">
562 |               <article class="md-content__inner md-typeset">
563 |                 
564 |   <h1>404 - Not found</h1>
565 | 
566 |               </article>
567 |             </div>
568 |           
569 |           
570 | <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
571 |         </div>
572 |         
573 |       </main>
574 |       
575 |         <footer class="md-footer">
576 |   
577 |   <div class="md-footer-meta md-typeset">
578 |     <div class="md-footer-meta__inner md-grid">
579 |       <div class="md-copyright">
580 |   
581 |   
582 |     Made with
583 |     <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
584 |       Material for MkDocs
585 |     </a>
586 |   
587 | </div>
588 |       
589 |     </div>
590 |   </div>
591 | </footer>
592 |       
593 |     </div>
594 |     <div class="md-dialog" data-md-component="dialog">
595 |       <div class="md-dialog__inner md-typeset"></div>
596 |     </div>
597 |     
598 |     
599 |     
600 |       
601 |       <script id="__config" type="application/json">{"base": "/", "features": [], "search": "/assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
602 |     
603 |     
604 |       <script src="/assets/javascripts/bundle.f55a23d4.min.js"></script>
605 |       
606 |     
607 |   </body>
608 | </html>
```

--------------------------------------------------------------------------------
/docs/docs/cookbook.md:
--------------------------------------------------------------------------------

```markdown
  1 | # MCP Tool Cookbook
  2 | 
  3 | This cookbook provides examples of how to use the `mcp` tool to query and understand your Python codebase. The "Tool" indicates which `mcp` tool to use, and the "JSON Arguments" are what the LLM would provide to that tool.
  4 | 
  5 | ---
  6 | 
  7 | ## Basic Queries
  8 | 
  9 | ### 1. Find a specific function by name
 10 | - **Natural Language:** "Where is the function `foo` defined?"
 11 | - **Tool:** `find_code`
 12 | - **JSON Arguments:**
 13 | ```json
 14 | {
 15 |   "query": "foo"
 16 | }
 17 | ```
 18 | 
 19 | ![Query 1](images/1.png)
 20 | 
 21 | ### 2. Find all calls to a specific function
 22 | - **Natural Language:** "Find all calls to the `helper` function."
 23 | - **Tool:** `analyze_code_relationships`
 24 | - **JSON Arguments:**
 25 | ```json
 26 | {
 27 |   "query_type": "find_callers",
 28 |   "target": "helper"
 29 | }
 30 | ```
 31 | 
 32 | ![Query 2](images/2.png)
 33 | 
 34 | ### 3. Find what a function calls
 35 | - **Natural Language:** "What functions are called inside the `foo` function?"
 36 | - **Tool:** `analyze_code_relationships`
 37 | - **JSON Arguments:**
 38 | ```json
 39 | {
 40 |   "query_type": "find_callees",
 41 |   "target": "foo",
 42 |   "context": "/teamspace/studios/this_studio/demo/CodeGraphContext/tests/sample_project/module_a.py"
 43 | }
 44 | ```
 45 | 
 46 | ![Query 3](images/3.png)
 47 | 
 48 | ### 4. Find all imports of a specific module
 49 | - **Natural Language:** "Where is the `math` module imported?"
 50 | - **Tool:** `analyze_code_relationships`
 51 | - **JSON Arguments:**
 52 | ```json
 53 | {
 54 |   "query_type": "find_importers",
 55 |   "target": "math"
 56 | }
 57 | ```
 58 | 
 59 | ![Query 4](images/4.png)
 60 | 
 61 | ### 5. Find all methods of a class
 62 | - **Natural Language:** "What are the methods of the `A` class?"
 63 | - **Tool:** `analyze_code_relationships`
 64 | - **JSON Arguments:**
 65 | ```json
 66 | {
 67 |   "query_type": "class_hierarchy",
 68 |   "target": "A"
 69 | }
 70 | ```
 71 | - **Note:** The response for `class_hierarchy` includes a list of methods.
 72 | 
 73 | ![Query 5](images/5.png)
 74 | 
 75 | ### 6. Find all classes that inherit from a specific class
 76 | - **Natural Language:** "Show me all classes that inherit from `Base`."
 77 | - **Tool:** `analyze_code_relationships`
 78 | - **JSON Arguments:**
 79 | ```json
 80 | {
 81 |   "query_type": "class_hierarchy",
 82 |   "target": "Base"
 83 | }
 84 | ```
 85 | - **Note:** The response for `class_hierarchy` includes a list of child classes.
 86 | 
 87 | ![Query 6](images/6.png)
 88 | 
 89 | ### 7. Find all functions with a specific decorator
 90 | - **Natural Language:** "Find all functions with the `log_decorator`."
 91 | - **Tool:** `analyze_code_relationships`
 92 | - **JSON Arguments:**
 93 | ```json
 94 | {
 95 |   "query_type": "find_functions_by_decorator",
 96 |   "target": "log_decorator"
 97 | }
 98 | ```
 99 | 
100 | ![Query 7](images/7.png)
101 | 
102 | ### 8. Find all dataclasses
103 | - **Natural Language:** "Find all dataclasses."
104 | - **Tool:** `execute_cypher_query`
105 | - **JSON Arguments:**
106 | ```json
107 | {
108 |   "cypher_query": "MATCH (c:Class) WHERE 'dataclass' IN c.decorators RETURN c.name, c.file_path"
109 | }
110 | ```
111 | 
112 | ![Query 8](images/8.png)
113 | 
114 | ---
115 | 
116 | ## Code Analysis & Quality
117 | 
118 | ### 9. Find the 5 most complex functions
119 | - **Natural Language:** "Find the 5 most complex functions."
120 | - **Tool:** `find_most_complex_functions`
121 | - **JSON Arguments:**
122 | ```json
123 | {
124 |   "limit": 5
125 | }
126 | ```
127 | 
128 | ![Query 9](images/9.png)
129 | 
130 | ### 10. Calculate cyclomatic complexity of a function
131 | - **Natural Language:** "What is the cyclomatic complexity of `try_except_finally`?"
132 | - **Tool:** `calculate_cyclomatic_complexity`
133 | - **JSON Arguments:**
134 | ```json
135 | {
136 |   "function_name": "try_except_finally"
137 | }
138 | ```
139 | 
140 | ### 11. Find unused code
141 | - **Natural Language:** "Find unused code, but ignore API endpoints decorated with `@app.route`."
142 | - **Tool:** `find_dead_code`
143 | - **JSON Arguments:**
144 | ```json
145 | {
146 |   "exclude_decorated_with": ["@app.route"]
147 | }
148 | ```
149 | 
150 | ![Query 11](images/11.png)
151 | 
152 | ### 12. Find the call chain between two functions
153 | - **Natural Language:** "What is the call chain from `wrapper` to `helper`?"
154 | - **Tool:** `analyze_code_relationships`
155 | - **JSON Arguments:**
156 | ```json
157 | {
158 |   "query_type": "call_chain",
159 |   "target": "wrapper->helper"
160 | }
161 | ```
162 | 
163 | ![Query 12](images/12.png)
164 | 
165 | ### 13. Find all direct and indirect callers of a function
166 | - **Natural Language:** "Show me all functions that eventually call the `helper` function."
167 | - **Tool:** `analyze_code_relationships`
168 | - **JSON Arguments:**
169 | ```json
170 | {
171 |   "query_type": "find_all_callers",
172 |   "target": "helper"
173 | }
174 | ```
175 | 
176 | ![Query 13](images/13.png)
177 | 
178 | ### 14. Find functions by argument name
179 | - **Natural Language:** "Find all functions that take `self` as an argument."
180 | - **Tool:** `analyze_code_relationships`
181 | - **JSON Arguments:**
182 | ```json
183 | {
184 |   "query_type": "find_functions_by_argument",
185 |   "target": "self"
186 | }
187 | ```
188 | 
189 | ![Query 14](images/14.png)
190 | 
191 | ### 15. List all python package imports from a directory
192 | - **Natural Language:** "List all python package imports from my project directory."
193 | - **Tool:** `execute_cypher_query`
194 | - **JSON Arguments:**
195 | ```json
196 | {
197 |   "cypher_query": "MATCH (f:File)-[:IMPORTS]->(m:Module) WHERE f.path ENDS WITH '.py' RETURN DISTINCT m.name"
198 | }
199 | ```
200 | 
201 | ---
202 | 
203 | ## Repository Information Queries
204 | 
205 | ### 16. List all indexed projects
206 | - **Natural Language:** "List all projects I have indexed."
207 | - **Tool:** `list_indexed_repositories`
208 | - **JSON Arguments:**
209 | ```json
210 |   {}
211 | ```
212 | 
213 | ![Query 16](images/16.png)
214 | 
215 | ### 17. Check the status of an indexing job
216 | - **Natural Language:** "What is the status of job `4cb9a60e-c1b1-43a7-9c94-c840771506bc`?"
217 | - **Tool:** `check_job_status`
218 | - **JSON Arguments:**
219 | ```json
220 | {
221 |   "job_id": "4cb9a60e-c1b1-43a7-9c94-c840771506bc"
222 | }
223 | ```
224 | 
225 | ### 18. List all background jobs
226 | - **Natural Language:** "Show me all background jobs."
227 | - **Tool:** `list_jobs`
228 | - **JSON Arguments:**
229 | ```json
230 |   {}
231 | ```
232 | 
233 | ---
234 | 
235 | ## Advanced Cypher Queries
236 | 
237 | These examples use the `execute_cypher_query` tool for more specific and complex questions.
238 | 
239 | ### 19. Find all function definitions
240 | - **Natural Language:** "Find all function definitions in the codebase."
241 | - **JSON Arguments:**
242 | ```json
243 | {
244 |   "cypher_query": "MATCH (n:Function) RETURN n.name, n.file_path, n.line_number LIMIT 50"
245 | }
246 | ```
247 | 
248 | ![Query 19](images/19.png)
249 | 
250 | ### 20. Find all classes
251 | - **Natural Language:** "Show me all the classes."
252 | - **JSON Arguments:**
253 | ```json
254 | {
255 |   "cypher_query": "MATCH (n:Class) RETURN n.name, n.file_path, n.line_number LIMIT 50"
256 | }
257 | ```
258 | 
259 | ![Query 20](images/20.png)
260 | 
261 | ### 21. Find all functions in a file
262 | - **Natural Language:** "Find all functions in `module_a.py`."
263 | - **JSON Arguments:**
264 | ```json
265 | {
266 |   "cypher_query": "MATCH (f:Function) WHERE f.file_path ENDS WITH 'module_a.py' RETURN f.name"
267 | }
268 | ```
269 | 
270 | ![Query 21](images/21.png)
271 | 
272 | ### 22. Find all classes in a file
273 | - **Natural Language:** "Find all classes in `advanced_classes.py`."
274 | - **JSON Arguments:**
275 | ```json
276 | {
277 |   "cypher_query": "MATCH (c:Class) WHERE c.file_path ENDS WITH 'advanced_classes.py' RETURN c.name"
278 | }
279 | ```
280 | 
281 | ![Query 22](images/22.png)
282 | 
283 | ### 23. List all top-level functions and classes in a file
284 | - **Natural Language:** "List all top-level functions and classes in `module_a.py`."
285 | - **JSON Arguments:**
286 | ```json
287 | {
288 |   "cypher_query": "MATCH (f:File)-[:CONTAINS]->(n) WHERE f.name = 'module_a.py' AND (n:Function OR n:Class) AND n.context IS NULL RETURN n.name"
289 | }
290 | ```
291 | 
292 | ![Query 23](images/23.png)
293 | 
294 | ### 24. Find functions in one module that call a function in another
295 | - **Natural Language:** "Find functions in `module_a.py` that call `helper` in `module_b.py`."
296 | - **JSON Arguments:**
297 | ```json
298 | {
299 |   "cypher_query": "MATCH (caller:Function)-[:CALLS]->(callee:Function {name: 'helper'}) WHERE caller.file_path ENDS WITH 'module_a.py' AND callee.file_path ENDS WITH 'module_b.py' RETURN caller.name"
300 | }
301 | ```
302 | 
303 | ![Query 24](images/24.png)
304 | 
305 | ### 25. Find circular file imports
306 | - **Natural Language:** "Are there any circular dependencies between files?"
307 | - **JSON Arguments:**
308 | ```json
309 | {
310 |   "cypher_query": "MATCH (f1:File)-[:IMPORTS]->(m2:Module), (f2:File)-[:IMPORTS]->(m1:Module) WHERE f1.name = m1.name + '.py' AND f2.name = m2.name + '.py' RETURN f1.name, f2.name"
311 | }
312 | ```
313 | 
314 | ### 26. Find all functions with more than 5 arguments
315 | - **Natural Language:** "Find all functions with a large number of arguments."
316 | - **JSON Arguments:**
317 | ```json
318 | {
319 |   "cypher_query": "MATCH (f:Function) WHERE size(f.args) > 5 RETURN f.name, f.file_path, size(f.args) as arg_count"
320 | }
321 | ```
322 | 
323 | ![Query 26](images/26.png)
324 | 
325 | ### 27. Find all functions in a file that have a docstring
326 | - **Natural Language:** "Find all functions in `module_a.py` that have a docstring."
327 | - **JSON Arguments:**
328 | ```json
329 | {
330 |   "cypher_query": "MATCH (f:Function) WHERE f.file_path ENDS WITH 'module_a.py' AND f.docstring IS NOT NULL AND f.docstring <> '' RETURN f.name"
331 | }
332 | ```
333 | 
334 | ### 28. Find all classes that have a specific method
335 | - **Natural Language:** "Find all classes that have a `greet` method."
336 | - **JSON Arguments:**
337 | ```json
338 | {
339 |   "cypher_query": "MATCH (c:Class)-[:CONTAINS]->(m:Function {name: 'greet'}) RETURN c.name, c.file_path"
340 | }
341 | ```
342 | 
343 | ![Query 28](images/28.png)
344 | 
345 | ### 29. Find the depth of inheritance for all classes
346 | - **Natural Language:** "How deep are the inheritance chains for all classes?"
347 | - **JSON Arguments:**
348 | ```json
349 | {
350 |   "cypher_query": "MATCH (c:Class) OPTIONAL MATCH path = (c)-[:INHERITS*]->(parent:Class) RETURN c.name, c.file_path, length(path) AS depth ORDER BY depth DESC"
351 | }
352 | ```
353 | 
354 | ![Query 29](images/29.png)
355 | 
356 | ### 30. Find all functions that have a docstring
357 | - **Natural Language:** "Show me all functions that are documented."
358 | - **JSON Arguments:**
359 | ```json
360 | {
361 |   "cypher_query": "MATCH (f:Function) WHERE f.docstring IS NOT NULL AND f.docstring <> '' RETURN f.name, f.file_path LIMIT 50"
362 | }
363 | ```
364 | 
365 | ![Query 30](images/30.png)
366 | 
367 | ### 31. Find all decorated methods in a class
368 | - **Natural Language:** "Find all decorated methods in the `Child` class."
369 | - **JSON Arguments:**
370 | ```json
371 | {
372 |   "cypher_query": "MATCH (c:Class {name: 'Child'})-[:CONTAINS]->(m:Function) WHERE m.decorators IS NOT NULL AND size(m.decorators) > 0 RETURN m.name"
373 | }
374 | ```
375 | 
376 | ![Query 31](images/31.png)
377 | 
378 | ### 32. Find the number of functions in each file
379 | - **Natural Language:** "How many functions are in each file?"
380 | - **JSON Arguments:**
381 | ```json
382 | {
383 |   "cypher_query": "MATCH (f:Function) RETURN f.file_path, count(f) AS function_count ORDER BY function_count DESC"
384 | }
385 | ```
386 | 
387 | ![Query 32](images/32.png)
388 | 
389 | ### 33. Find all methods that override a parent method
390 | - **Natural Language:** "Find all methods that are overridden from a parent class."
391 | - **JSON Arguments:**
392 | ```json
393 | {
394 |   "cypher_query": "MATCH (c:Class)-[:INHERITS]->(p:Class), (c)-[:CONTAINS]->(m:Function), (p)-[:CONTAINS]->(m_parent:Function) WHERE m.name = m_parent.name RETURN m.name as method, c.name as child_class, p.name as parent_class"
395 | }
396 | ```
397 | 
398 | ![Query 33](images/33.png)
399 | 
400 | ### 34. Find all functions that call `super()`
401 | - **Natural Language:** "Find all methods that call their parent's method via `super()`."
402 | - **JSON Arguments:**
403 | ```json
404 | {
405 |   "cypher_query": "MATCH (f:Function)-[r:CALLS]->() WHERE r.full_call_name STARTS WITH 'super(' RETURN f.name, f.file_path"
406 | }
407 | ```
408 | 
409 | ![Query 34](images/34.png)
410 | 
411 | ### 35. Find all calls to a function with a specific argument
412 | - **Natural Language:** "Find all calls to `helper` with the argument `x`."
413 | - **JSON Arguments:**
414 | ```json
415 | {
416 |   "cypher_query": "MATCH ()-[r:CALLS]->(f:Function {name: 'helper'}) WHERE 'x' IN r.args RETURN r.full_call_name, r.line_number, r.file_path"
417 | }
418 | ```
419 | 
420 | ![Query 35](images/35.png)
421 | 
422 | ### 36. Find all functions that are not called by any other function
423 | - **Natural Language:** "Find all dead code (functions that are never called)."
424 | - **JSON Arguments:**
425 | ```json
426 | {
427 |   "cypher_query": "MATCH (f:Function) WHERE NOT (()-[:CALLS]->(f)) AND f.is_dependency = false RETURN f.name, f.file_path"
428 | }
429 | ```
430 | 
431 | ![Query 36](images/36.png)
432 | 
433 | ### 37. Find all functions that are called with a specific argument
434 | - **Natural Language:** "Find all calls to `print` with the argument `'hello'`."
435 | - **JSON Arguments:**
436 | ```json
437 | {
438 |   "cypher_query": "MATCH (c:Call) WHERE c.name = 'print' AND 'hello' IN c.args RETURN c.file, c.lineno"
439 | }
440 | ```
441 | 
442 | ### 38. Find all direct and indirect callees of a function
443 | - **Natural Language:** "Show me all functions that are eventually called by the `foo` function."
444 | - **Tool:** `analyze_code_relationships`
445 | - **JSON Arguments:**
446 | ```json
447 | {
448 |   "query_type": "find_all_callees",
449 |   "target": "foo",
450 |   "context": "/teamspace/studios/this_studio/demo/CodeGraphContext/tests/sample_project/module_a.py"
451 | }
452 | ```
453 | 
454 | ![Query 38](images/38.png)
455 | 
456 | ### 39. Find all functions that are overridden
457 | - **Natural Language:** "Find all functions that are overridden."
458 | - **Tool:** `analyze_code_relationships`
459 | - **JSON Arguments:**
460 | ```json
461 | {
462 |   "query_type": "overrides",
463 |   "target": "foo"
464 | }
465 | ```
466 | 
467 | ![Query 39](images/39.png)
468 | 
469 | ### 40. Find all modules imported by `module_a`
470 | - **Natural Language:** "Find all modules imported by `module_a`."
471 | - **Tool:** `execute_cypher_query`
472 | - **JSON Arguments:**
473 | ```json
474 | {
475 |   "cypher_query": "MATCH (f:File {name: 'module_a.py'})-[:IMPORTS]->(m:Module) RETURN m.name AS imported_module_name"
476 | }
477 | ```
478 | 
479 | ![Query 40](images/40.png)
480 | 
481 | ### 41. Find large functions that should be refactored
482 | - **Natural Language:** "Find functions with more than 20 lines of code that might need refactoring."
483 | - **Tool:** `execute_cypher_query`
484 | - **JSON Arguments:**
485 | ```json
486 | {
487 |   "cypher_query": "MATCH (f:Function)\n    WHERE f.end_line - f.line_number > 20\n    RETURN f"
488 | }
489 | ```
490 | 
491 | ![Query 41](images/41.png)
492 | 
493 | ### 42. Find recursive functions
494 | - **Natural Language:** "Find all functions that call themselves (recursive functions)."
495 | - **Tool:** `execute_cypher_query`
496 | - **JSON Arguments:**
497 | ```json
498 | {
499 |   "cypher_query": "MATCH p=(f:Function)-[:CALLS]->(f2:Function)\n    WHERE f.name = f2.name AND f.file_path = f2.file_path\n    RETURN p"
500 | }
501 | ```
502 | ![Query 42](images/42.png)
503 | 
504 | ### 43. Find most connected functions (hub functions)
505 | - **Natural Language:** "Find the functions that are most central to the codebase (called by many and call many others)."
506 | - **Tool:** `execute_cypher_query`
507 | - **JSON Arguments:**
508 | ```json
509 | {
510 |   "cypher_query": "MATCH (f:Function)\n    OPTIONAL MATCH (f)-[:CALLS]->(callee:Function)\n    OPTIONAL MATCH (caller:Function)-[:CALLS]->(f)\n    WITH f, count(DISTINCT callee) AS calls_out, count(DISTINCT caller) AS calls_in\n    ORDER BY (calls_out + calls_in) DESC\n    LIMIT 5\n    MATCH p=(f)-[*0..2]-()\n    RETURN p"
511 | }
512 | ```
513 | ![Query 43](images/43.png)
514 | 
515 | ## Security & Sensitive Data Analysis
516 | 
517 | ### 44. Find potential security vulnerabilities (hardcoded secrets)
518 | - **Natural Language:** "Find potential hardcoded passwords, API keys, or secrets in the codebase."
519 | - **Tool:** `execute_cypher_query`
520 | - **JSON Arguments:**
521 | ```json
522 | {
523 |   "cypher_query": "WITH [\"password\",  \"api_key\", \"apikey\",    \"secret_token\", \"token\", \"auth\", \"access_key\", \"private_key\", \"client_secret\", \"sessionid\", \"jwt\"] AS keywords\n    MATCH (f:Function)\n    WHERE ANY(word IN keywords WHERE toLower(f.source_code) CONTAINS word)\n    RETURN f"
524 | }
525 | ```
```

--------------------------------------------------------------------------------
/tests/sample_project_typescript/src/error-validation.ts:
--------------------------------------------------------------------------------

```typescript
  1 | /**
  2 |  * Error Handling and Validation
  3 |  * Demonstrates TypeScript's error handling patterns, custom error types,
  4 |  * type guards, assertion functions, and validation patterns
  5 |  */
  6 | 
  7 | // ========== Custom Error Classes ==========
  8 | export class ApplicationError extends Error {
  9 |   public readonly code: string;
 10 |   public readonly timestamp: Date;
 11 |   public readonly context?: Record<string, any>;
 12 | 
 13 |   constructor(message: string, code: string, context?: Record<string, any>) {
 14 |     super(message);
 15 |     this.name = "ApplicationError";
 16 |     this.code = code;
 17 |     this.timestamp = new Date();
 18 |     this.context = context;
 19 |     
 20 |     // Maintains proper stack trace for where our error was thrown (only available on V8)
 21 |     if (Error.captureStackTrace) {
 22 |       Error.captureStackTrace(this, ApplicationError);
 23 |     }
 24 |   }
 25 | }
 26 | 
 27 | export class ValidationError extends ApplicationError {
 28 |   public readonly field?: string;
 29 |   public readonly value?: any;
 30 | 
 31 |   constructor(message: string, field?: string, value?: any, context?: Record<string, any>) {
 32 |     super(message, "VALIDATION_ERROR", context);
 33 |     this.name = "ValidationError";
 34 |     this.field = field;
 35 |     this.value = value;
 36 |   }
 37 | }
 38 | 
 39 | export class NotFoundError extends ApplicationError {
 40 |   public readonly resource: string;
 41 |   public readonly identifier: any;
 42 | 
 43 |   constructor(resource: string, identifier: any, context?: Record<string, any>) {
 44 |     super(`${resource} with identifier "${identifier}" not found`, "NOT_FOUND", context);
 45 |     this.name = "NotFoundError";
 46 |     this.resource = resource;
 47 |     this.identifier = identifier;
 48 |   }
 49 | }
 50 | 
 51 | export class UnauthorizedError extends ApplicationError {
 52 |   constructor(message: string = "Access denied", context?: Record<string, any>) {
 53 |     super(message, "UNAUTHORIZED", context);
 54 |     this.name = "UnauthorizedError";
 55 |   }
 56 | }
 57 | 
 58 | export class NetworkError extends ApplicationError {
 59 |   public readonly statusCode?: number;
 60 |   public readonly url?: string;
 61 | 
 62 |   constructor(message: string, statusCode?: number, url?: string, context?: Record<string, any>) {
 63 |     super(message, "NETWORK_ERROR", context);
 64 |     this.name = "NetworkError";
 65 |     this.statusCode = statusCode;
 66 |     this.url = url;
 67 |   }
 68 | }
 69 | 
 70 | // ========== Result Pattern ==========
 71 | export type Result<T, E = Error> = 
 72 |   | { success: true; data: T; error?: never }
 73 |   | { success: false; data?: never; error: E };
 74 | 
 75 | export const Ok = <T>(data: T): Result<T, never> => ({ success: true, data });
 76 | export const Err = <E>(error: E): Result<never, E> => ({ success: false, error });
 77 | 
 78 | export function isOk<T, E>(result: Result<T, E>): result is { success: true; data: T } {
 79 |   return result.success;
 80 | }
 81 | 
 82 | export function isErr<T, E>(result: Result<T, E>): result is { success: false; error: E } {
 83 |   return !result.success;
 84 | }
 85 | 
 86 | // Result utility functions
 87 | export function map<T, U, E>(
 88 |   result: Result<T, E>,
 89 |   fn: (data: T) => U
 90 | ): Result<U, E> {
 91 |   return isOk(result) ? Ok(fn(result.data)) : result;
 92 | }
 93 | 
 94 | export function flatMap<T, U, E>(
 95 |   result: Result<T, E>,
 96 |   fn: (data: T) => Result<U, E>
 97 | ): Result<U, E> {
 98 |   return isOk(result) ? fn(result.data) : result;
 99 | }
100 | 
101 | export function mapError<T, E, F>(
102 |   result: Result<T, E>,
103 |   fn: (error: E) => F
104 | ): Result<T, F> {
105 |   return isErr(result) ? Err(fn(result.error)) : result;
106 | }
107 | 
108 | // ========== Type Guards ==========
109 | export function isString(value: unknown): value is string {
110 |   return typeof value === "string";
111 | }
112 | 
113 | export function isNumber(value: unknown): value is number {
114 |   return typeof value === "number" && !isNaN(value);
115 | }
116 | 
117 | export function isObject(value: unknown): value is object {
118 |   return typeof value === "object" && value !== null && !Array.isArray(value);
119 | }
120 | 
121 | export function isArray<T>(value: unknown, elementGuard: (item: unknown) => item is T): value is T[] {
122 |   return Array.isArray(value) && value.every(elementGuard);
123 | }
124 | 
125 | export function hasProperty<K extends string>(
126 |   obj: unknown,
127 |   prop: K
128 | ): obj is Record<K, unknown> {
129 |   return isObject(obj) && prop in obj;
130 | }
131 | 
132 | export function hasProperties<K extends string>(
133 |   obj: unknown,
134 |   ...props: K[]
135 | ): obj is Record<K, unknown> {
136 |   return isObject(obj) && props.every(prop => prop in obj);
137 | }
138 | 
139 | // Advanced type guards
140 | export function isInstanceOf<T extends new (...args: any[]) => any>(
141 |   constructor: T,
142 |   value: unknown
143 | ): value is InstanceType<T> {
144 |   return value instanceof constructor;
145 | }
146 | 
147 | export function isOneOf<T extends readonly unknown[]>(
148 |   values: T,
149 |   value: unknown
150 | ): value is T[number] {
151 |   return values.includes(value);
152 | }
153 | 
154 | // ========== Assertion Functions ==========
155 | export function assert(condition: any, message?: string): asserts condition {
156 |   if (!condition) {
157 |     throw new Error(message || "Assertion failed");
158 |   }
159 | }
160 | 
161 | export function assertIsString(value: unknown): asserts value is string {
162 |   if (!isString(value)) {
163 |     throw new ValidationError("Expected string", "value", value);
164 |   }
165 | }
166 | 
167 | export function assertIsNumber(value: unknown): asserts value is number {
168 |   if (!isNumber(value)) {
169 |     throw new ValidationError("Expected number", "value", value);
170 |   }
171 | }
172 | 
173 | export function assertIsObject(value: unknown): asserts value is object {
174 |   if (!isObject(value)) {
175 |     throw new ValidationError("Expected object", "value", value);
176 |   }
177 | }
178 | 
179 | export function assertHasProperty<K extends string>(
180 |   obj: unknown,
181 |   prop: K
182 | ): asserts obj is Record<K, unknown> {
183 |   if (!hasProperty(obj, prop)) {
184 |     throw new ValidationError(`Expected property "${prop}"`, prop, obj);
185 |   }
186 | }
187 | 
188 | export function assertNever(value: never): never {
189 |   throw new Error(`Unexpected value: ${JSON.stringify(value)}`);
190 | }
191 | 
192 | // ========== Validation Schemas ==========
193 | export interface ValidationRule<T> {
194 |   validate: (value: T) => boolean;
195 |   message: string;
196 | }
197 | 
198 | export interface Schema<T> {
199 |   rules: ValidationRule<T>[];
200 |   optional?: boolean;
201 |   transform?: (value: any) => T;
202 | }
203 | 
204 | export class SchemaValidator {
205 |   static validate<T>(value: unknown, schema: Schema<T>): Result<T, ValidationError> {
206 |     // Handle optional values
207 |     if (value === undefined || value === null) {
208 |       if (schema.optional) {
209 |         return Ok(value as T);
210 |       } else {
211 |         return Err(new ValidationError("Value is required"));
212 |       }
213 |     }
214 | 
215 |     // Transform value if transformer is provided
216 |     let processedValue: T;
217 |     if (schema.transform) {
218 |       try {
219 |         processedValue = schema.transform(value);
220 |       } catch (error) {
221 |         return Err(new ValidationError(`Transformation failed: ${error}`));
222 |       }
223 |     } else {
224 |       processedValue = value as T;
225 |     }
226 | 
227 |     // Run validation rules
228 |     for (const rule of schema.rules) {
229 |       if (!rule.validate(processedValue)) {
230 |         return Err(new ValidationError(rule.message, "value", value));
231 |       }
232 |     }
233 | 
234 |     return Ok(processedValue);
235 |   }
236 | 
237 |   static validateObject<T extends Record<string, any>>(
238 |     value: unknown,
239 |     schemas: { [K in keyof T]: Schema<T[K]> }
240 |   ): Result<T, ValidationError[]> {
241 |     if (!isObject(value)) {
242 |       return Err([new ValidationError("Expected object", "root", value)]);
243 |     }
244 | 
245 |     const result = {} as T;
246 |     const errors: ValidationError[] = [];
247 | 
248 |     for (const [key, schema] of Object.entries(schemas)) {
249 |       const fieldValue = (value as any)[key];
250 |       const fieldResult = SchemaValidator.validate(fieldValue, schema);
251 | 
252 |       if (isOk(fieldResult)) {
253 |         (result as any)[key] = fieldResult.data;
254 |       } else {
255 |         const error = fieldResult.error;
256 |         error.field = key;
257 |         errors.push(error);
258 |       }
259 |     }
260 | 
261 |     return errors.length === 0 ? Ok(result) : Err(errors);
262 |   }
263 | }
264 | 
265 | // ========== Common Validation Rules ==========
266 | export const ValidationRules = {
267 |   required: <T>(): ValidationRule<T> => ({
268 |     validate: (value) => value !== undefined && value !== null && value !== "",
269 |     message: "Value is required"
270 |   }),
271 | 
272 |   minLength: (min: number): ValidationRule<string> => ({
273 |     validate: (value) => value.length >= min,
274 |     message: `Minimum length is ${min}`
275 |   }),
276 | 
277 |   maxLength: (max: number): ValidationRule<string> => ({
278 |     validate: (value) => value.length <= max,
279 |     message: `Maximum length is ${max}`
280 |   }),
281 | 
282 |   email: (): ValidationRule<string> => ({
283 |     validate: (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value),
284 |     message: "Invalid email format"
285 |   }),
286 | 
287 |   min: (min: number): ValidationRule<number> => ({
288 |     validate: (value) => value >= min,
289 |     message: `Value must be at least ${min}`
290 |   }),
291 | 
292 |   max: (max: number): ValidationRule<number> => ({
293 |     validate: (value) => value <= max,
294 |     message: `Value must be at most ${max}`
295 |   }),
296 | 
297 |   regex: (pattern: RegExp, message?: string): ValidationRule<string> => ({
298 |     validate: (value) => pattern.test(value),
299 |     message: message || `Value does not match pattern ${pattern}`
300 |   }),
301 | 
302 |   oneOf: <T>(values: T[]): ValidationRule<T> => ({
303 |     validate: (value) => values.includes(value),
304 |     message: `Value must be one of: ${values.join(", ")}`
305 |   }),
306 | 
307 |   custom: <T>(fn: (value: T) => boolean, message: string): ValidationRule<T> => ({
308 |     validate: fn,
309 |     message
310 |   })
311 | };
312 | 
313 | // ========== Safe Parsing Functions ==========
314 | export function safeParseInt(value: string): Result<number, ValidationError> {
315 |   const parsed = parseInt(value, 10);
316 |   if (isNaN(parsed)) {
317 |     return Err(new ValidationError("Invalid integer", "value", value));
318 |   }
319 |   return Ok(parsed);
320 | }
321 | 
322 | export function safeParseFloat(value: string): Result<number, ValidationError> {
323 |   const parsed = parseFloat(value);
324 |   if (isNaN(parsed)) {
325 |     return Err(new ValidationError("Invalid float", "value", value));
326 |   }
327 |   return Ok(parsed);
328 | }
329 | 
330 | export function safeParse<T>(
331 |   value: string,
332 |   parser: (str: string) => T
333 | ): Result<T, ValidationError> {
334 |   try {
335 |     return Ok(parser(value));
336 |   } catch (error) {
337 |     return Err(new ValidationError(
338 |       `Parse error: ${error instanceof Error ? error.message : error}`,
339 |       "value",
340 |       value
341 |     ));
342 |   }
343 | }
344 | 
345 | export function safeJsonParse<T = any>(json: string): Result<T, ValidationError> {
346 |   return safeParse(json, JSON.parse);
347 | }
348 | 
349 | // ========== Error Boundary Pattern ==========
350 | export class ErrorBoundary {
351 |   private errorHandlers = new Map<string, (error: Error) => void>();
352 |   private globalHandler?: (error: Error) => void;
353 | 
354 |   onError(type: string, handler: (error: Error) => void): void {
355 |     this.errorHandlers.set(type, handler);
356 |   }
357 | 
358 |   onGlobalError(handler: (error: Error) => void): void {
359 |     this.globalHandler = handler;
360 |   }
361 | 
362 |   handle(error: Error): void {
363 |     const handler = this.errorHandlers.get(error.name);
364 |     
365 |     if (handler) {
366 |       handler(error);
367 |     } else if (this.globalHandler) {
368 |       this.globalHandler(error);
369 |     } else {
370 |       console.error("Unhandled error:", error);
371 |     }
372 |   }
373 | 
374 |   wrap<T extends (...args: any[]) => any>(fn: T): T {
375 |     return ((...args: any[]) => {
376 |       try {
377 |         const result = fn(...args);
378 |         
379 |         // Handle async functions
380 |         if (result instanceof Promise) {
381 |           return result.catch((error) => {
382 |             this.handle(error);
383 |             throw error;
384 |           });
385 |         }
386 |         
387 |         return result;
388 |       } catch (error) {
389 |         if (error instanceof Error) {
390 |           this.handle(error);
391 |         }
392 |         throw error;
393 |       }
394 |     }) as T;
395 |   }
396 | }
397 | 
398 | // ========== Try-Catch Utilities ==========
399 | export function tryCatch<T>(fn: () => T): Result<T, Error> {
400 |   try {
401 |     return Ok(fn());
402 |   } catch (error) {
403 |     return Err(error instanceof Error ? error : new Error(String(error)));
404 |   }
405 | }
406 | 
407 | export async function tryCatchAsync<T>(fn: () => Promise<T>): Promise<Result<T, Error>> {
408 |   try {
409 |     const result = await fn();
410 |     return Ok(result);
411 |   } catch (error) {
412 |     return Err(error instanceof Error ? error : new Error(String(error)));
413 |   }
414 | }
415 | 
416 | // ========== Usage Examples ==========
417 | // Define user schema
418 | const userSchema = {
419 |   id: {
420 |     rules: [ValidationRules.required()],
421 |     transform: (value: any) => parseInt(value, 10)
422 |   } as Schema<number>,
423 |   
424 |   name: {
425 |     rules: [
426 |       ValidationRules.required(),
427 |       ValidationRules.minLength(2),
428 |       ValidationRules.maxLength(100)
429 |     ]
430 |   } as Schema<string>,
431 |   
432 |   email: {
433 |     rules: [
434 |       ValidationRules.required(),
435 |       ValidationRules.email()
436 |     ]
437 |   } as Schema<string>,
438 |   
439 |   age: {
440 |     rules: [
441 |       ValidationRules.min(0),
442 |       ValidationRules.max(120)
443 |     ],
444 |     optional: true,
445 |     transform: (value: any) => parseInt(value, 10)
446 |   } as Schema<number>
447 | };
448 | 
449 | // Example functions that use error handling
450 | export function validateUser(userData: unknown): Result<{
451 |   id: number;
452 |   name: string;
453 |   email: string;
454 |   age?: number;
455 | }, ValidationError[]> {
456 |   return SchemaValidator.validateObject(userData, userSchema);
457 | }
458 | 
459 | export async function fetchUser(id: number): Promise<Result<any, ApplicationError>> {
460 |   if (id <= 0) {
461 |     return Err(new ValidationError("Invalid user ID", "id", id));
462 |   }
463 | 
464 |   // Simulate API call that might fail
465 |   const shouldFail = Math.random() > 0.7;
466 |   
467 |   if (shouldFail) {
468 |     return Err(new NetworkError("Failed to fetch user", 500, `/api/users/${id}`));
469 |   }
470 | 
471 |   // Simulate user not found
472 |   if (id === 404) {
473 |     return Err(new NotFoundError("User", id));
474 |   }
475 | 
476 |   return Ok({
477 |     id,
478 |     name: `User ${id}`,
479 |     email: `user${id}@example.com`,
480 |     age: 25
481 |   });
482 | }
483 | 
484 | // Error boundary usage
485 | export const errorBoundary = new ErrorBoundary();
486 | 
487 | errorBoundary.onError("ValidationError", (error) => {
488 |   console.error("Validation failed:", error.message);
489 | });
490 | 
491 | errorBoundary.onError("NetworkError", (error) => {
492 |   console.error("Network error occurred:", error.message);
493 | });
494 | 
495 | errorBoundary.onGlobalError((error) => {
496 |   console.error("Unexpected error:", error);
497 | });
498 | 
499 | // Example wrapped function
500 | export const safeProcessUser = errorBoundary.wrap(async (userData: unknown) => {
501 |   const validationResult = validateUser(userData);
502 |   
503 |   if (isErr(validationResult)) {
504 |     throw new ValidationError("User validation failed", "user", userData);
505 |   }
506 | 
507 |   const user = validationResult.data;
508 |   const fetchResult = await fetchUser(user.id);
509 |   
510 |   if (isErr(fetchResult)) {
511 |     throw fetchResult.error;
512 |   }
513 | 
514 |   return fetchResult.data;
515 | });
516 | 
517 | // ========== Usage Examples ==========
518 | export const errorHandlingExamples = {
519 |   // Result pattern examples
520 |   parseNumber: (str: string) => safeParseInt(str),
521 |   parseJson: (json: string) => safeJsonParse(json),
522 |   
523 |   // Validation examples
524 |   validUser: validateUser({
525 |     id: "123",
526 |     name: "John Doe",
527 |     email: "[email protected]",
528 |     age: "30"
529 |   }),
530 |   
531 |   invalidUser: validateUser({
532 |     id: "",
533 |     name: "J",
534 |     email: "invalid-email",
535 |     age: "200"
536 |   }),
537 |   
538 |   // Error boundary
539 |   errorBoundary,
540 |   
541 |   // Type guards
542 |   typeChecks: {
543 |     isString: isString("hello"),
544 |     isNumber: isNumber(42),
545 |     hasProperty: hasProperty({ name: "test" }, "name"),
546 |   }
547 | };
```

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

```javascript
 1 | /*!
 2 |  * Lunr languages, `Turkish` 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(r,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(r.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");r.tr=function(){this.pipeline.reset(),this.pipeline.add(r.tr.trimmer,r.tr.stopWordFilter,r.tr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(r.tr.stemmer))},r.tr.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.tr.trimmer=r.trimmerSupport.generateTrimmer(r.tr.wordCharacters),r.Pipeline.registerFunction(r.tr.trimmer,"trimmer-tr"),r.tr.stemmer=function(){var i=r.stemmerSupport.Among,e=r.stemmerSupport.SnowballProgram,n=new function(){function r(r,i,e){for(;;){var n=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(r,i,e)){Dr.cursor=Dr.limit-n;break}if(Dr.cursor=Dr.limit-n,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function n(){var i,e;i=Dr.limit-Dr.cursor,r(Wr,97,305);for(var n=0;n<Br.length;n++){e=Dr.limit-Dr.cursor;var t=Br[n];if(Dr.eq_s_b(1,t[0])&&r(t[1],t[2],t[3]))return Dr.cursor=Dr.limit-i,!0;Dr.cursor=Dr.limit-e}return Dr.cursor=Dr.limit-e,!(!Dr.eq_s_b(1,"ü")||!r(Zr,246,252))&&(Dr.cursor=Dr.limit-i,!0)}function t(r,i){var e,n=Dr.limit-Dr.cursor;return r()&&(Dr.cursor=Dr.limit-n,Dr.cursor>Dr.limit_backward&&(Dr.cursor--,e=Dr.limit-Dr.cursor,i()))?(Dr.cursor=Dr.limit-e,!0):(Dr.cursor=Dr.limit-n,r()?(Dr.cursor=Dr.limit-n,!1):(Dr.cursor=Dr.limit-n,!(Dr.cursor<=Dr.limit_backward)&&(Dr.cursor--,!!i()&&(Dr.cursor=Dr.limit-n,!0))))}function u(r){return t(r,function(){return Dr.in_grouping_b(Wr,97,305)})}function o(){return u(function(){return Dr.eq_s_b(1,"n")})}function s(){return u(function(){return Dr.eq_s_b(1,"s")})}function c(){return u(function(){return Dr.eq_s_b(1,"y")})}function l(){return t(function(){return Dr.in_grouping_b(Lr,105,305)},function(){return Dr.out_grouping_b(Wr,97,305)})}function a(){return Dr.find_among_b(ur,10)&&l()}function m(){return n()&&Dr.in_grouping_b(Lr,105,305)&&s()}function d(){return Dr.find_among_b(or,2)}function f(){return n()&&Dr.in_grouping_b(Lr,105,305)&&c()}function b(){return n()&&Dr.find_among_b(sr,4)}function w(){return n()&&Dr.find_among_b(cr,4)&&o()}function _(){return n()&&Dr.find_among_b(lr,2)&&c()}function k(){return n()&&Dr.find_among_b(ar,2)}function p(){return n()&&Dr.find_among_b(mr,4)}function g(){return n()&&Dr.find_among_b(dr,2)}function y(){return n()&&Dr.find_among_b(fr,4)}function z(){return n()&&Dr.find_among_b(br,2)}function v(){return n()&&Dr.find_among_b(wr,2)&&c()}function h(){return Dr.eq_s_b(2,"ki")}function q(){return n()&&Dr.find_among_b(_r,2)&&o()}function C(){return n()&&Dr.find_among_b(kr,4)&&c()}function P(){return n()&&Dr.find_among_b(pr,4)}function F(){return n()&&Dr.find_among_b(gr,4)&&c()}function S(){return Dr.find_among_b(yr,4)}function W(){return n()&&Dr.find_among_b(zr,2)}function L(){return n()&&Dr.find_among_b(vr,4)}function x(){return n()&&Dr.find_among_b(hr,8)}function A(){return Dr.find_among_b(qr,2)}function E(){return n()&&Dr.find_among_b(Cr,32)&&c()}function j(){return Dr.find_among_b(Pr,8)&&c()}function T(){return n()&&Dr.find_among_b(Fr,4)&&c()}function Z(){return Dr.eq_s_b(3,"ken")&&c()}function B(){var r=Dr.limit-Dr.cursor;return!(T()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,Z()))))}function D(){if(A()){var r=Dr.limit-Dr.cursor;if(S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T())return!1}return!0}function G(){if(W()){Dr.bra=Dr.cursor,Dr.slice_del();var r=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,x()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,T()||(Dr.cursor=Dr.limit-r)))),nr=!1,!1}return!0}function H(){if(!L())return!0;var r=Dr.limit-Dr.cursor;return!E()&&(Dr.cursor=Dr.limit-r,!j())}function I(){var r,i=Dr.limit-Dr.cursor;return!(S()||(Dr.cursor=Dr.limit-i,F()||(Dr.cursor=Dr.limit-i,P()||(Dr.cursor=Dr.limit-i,C()))))||(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,T()||(Dr.cursor=Dr.limit-r),!1)}function J(){var r,i=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,nr=!0,B()&&(Dr.cursor=Dr.limit-i,D()&&(Dr.cursor=Dr.limit-i,G()&&(Dr.cursor=Dr.limit-i,H()&&(Dr.cursor=Dr.limit-i,I()))))){if(Dr.cursor=Dr.limit-i,!x())return;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T()||(Dr.cursor=Dr.limit-r)}Dr.bra=Dr.cursor,Dr.slice_del()}function K(){var r,i,e,n;if(Dr.ket=Dr.cursor,h()){if(r=Dr.limit-Dr.cursor,p())return Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,a()&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))),!0;if(Dr.cursor=Dr.limit-r,w()){if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,e=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-e,!m()&&(Dr.cursor=Dr.limit-e,!K())))return!0;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}return!0}if(Dr.cursor=Dr.limit-r,g()){if(n=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-n,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-n,!K())return!1;return!0}}return!1}function M(r){if(Dr.ket=Dr.cursor,!g()&&(Dr.cursor=Dr.limit-r,!k()))return!1;var i=Dr.limit-Dr.cursor;if(d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-i,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-i,!K())return!1;return!0}function N(r){if(Dr.ket=Dr.cursor,!z()&&(Dr.cursor=Dr.limit-r,!b()))return!1;var i=Dr.limit-Dr.cursor;return!(!m()&&(Dr.cursor=Dr.limit-i,!d()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)}function O(){var r,i=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,!(!w()&&(Dr.cursor=Dr.limit-i,!v()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,!(!W()||(Dr.bra=Dr.cursor,Dr.slice_del(),!K()))||(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!(a()||(Dr.cursor=Dr.limit-r,m()||(Dr.cursor=Dr.limit-r,K())))||(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)))}function Q(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,!p()&&(Dr.cursor=Dr.limit-e,!f()&&(Dr.cursor=Dr.limit-e,!_())))return!1;if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,a())Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()||(Dr.cursor=Dr.limit-i);else if(Dr.cursor=Dr.limit-r,!W())return!0;return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,K(),!0}function R(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,W())return Dr.bra=Dr.cursor,Dr.slice_del(),void K();if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,q())if(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-r,!m())){if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!W())return;if(Dr.bra=Dr.cursor,Dr.slice_del(),!K())return}Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}else if(Dr.cursor=Dr.limit-e,!M(e)&&(Dr.cursor=Dr.limit-e,!N(e))){if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,y())return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,i=Dr.limit-Dr.cursor,void(a()?(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())):(Dr.cursor=Dr.limit-i,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,K())));if(Dr.cursor=Dr.limit-e,!O()){if(Dr.cursor=Dr.limit-e,d())return Dr.bra=Dr.cursor,void Dr.slice_del();Dr.cursor=Dr.limit-e,K()||(Dr.cursor=Dr.limit-e,Q()||(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,(a()||(Dr.cursor=Dr.limit-e,m()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))))}}}function U(){var r;if(Dr.ket=Dr.cursor,r=Dr.find_among_b(Sr,4))switch(Dr.bra=Dr.cursor,r){case 1:Dr.slice_from("p");break;case 2:Dr.slice_from("ç");break;case 3:Dr.slice_from("t");break;case 4:Dr.slice_from("k")}}function V(){for(;;){var r=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(Wr,97,305)){Dr.cursor=Dr.limit-r;break}if(Dr.cursor=Dr.limit-r,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function X(r,i,e){if(Dr.cursor=Dr.limit-r,V()){var n=Dr.limit-Dr.cursor;if(!Dr.eq_s_b(1,i)&&(Dr.cursor=Dr.limit-n,!Dr.eq_s_b(1,e)))return!0;Dr.cursor=Dr.limit-r;var t=Dr.cursor;return Dr.insert(Dr.cursor,Dr.cursor,e),Dr.cursor=t,!1}return!0}function Y(){var r=Dr.limit-Dr.cursor;(Dr.eq_s_b(1,"d")||(Dr.cursor=Dr.limit-r,Dr.eq_s_b(1,"g")))&&X(r,"a","ı")&&X(r,"e","i")&&X(r,"o","u")&&X(r,"ö","ü")}function $(){for(var r,i=Dr.cursor,e=2;;){for(r=Dr.cursor;!Dr.in_grouping(Wr,97,305);){if(Dr.cursor>=Dr.limit)return Dr.cursor=r,!(e>0)&&(Dr.cursor=i,!0);Dr.cursor++}e--}}function rr(r,i,e){for(;!Dr.eq_s(i,e);){if(Dr.cursor>=Dr.limit)return!0;Dr.cursor++}return(tr=i)!=Dr.limit||(Dr.cursor=r,!1)}function ir(){var r=Dr.cursor;return!rr(r,2,"ad")||(Dr.cursor=r,!rr(r,5,"soyad"))}function er(){var r=Dr.cursor;return!ir()&&(Dr.limit_backward=r,Dr.cursor=Dr.limit,Y(),Dr.cursor=Dr.limit,U(),!0)}var nr,tr,ur=[new i("m",-1,-1),new i("n",-1,-1),new i("miz",-1,-1),new i("niz",-1,-1),new i("muz",-1,-1),new i("nuz",-1,-1),new i("müz",-1,-1),new i("nüz",-1,-1),new i("mız",-1,-1),new i("nız",-1,-1)],or=[new i("leri",-1,-1),new i("ları",-1,-1)],sr=[new i("ni",-1,-1),new i("nu",-1,-1),new i("nü",-1,-1),new i("nı",-1,-1)],cr=[new i("in",-1,-1),new i("un",-1,-1),new i("ün",-1,-1),new i("ın",-1,-1)],lr=[new i("a",-1,-1),new i("e",-1,-1)],ar=[new i("na",-1,-1),new i("ne",-1,-1)],mr=[new i("da",-1,-1),new i("ta",-1,-1),new i("de",-1,-1),new i("te",-1,-1)],dr=[new i("nda",-1,-1),new i("nde",-1,-1)],fr=[new i("dan",-1,-1),new i("tan",-1,-1),new i("den",-1,-1),new i("ten",-1,-1)],br=[new i("ndan",-1,-1),new i("nden",-1,-1)],wr=[new i("la",-1,-1),new i("le",-1,-1)],_r=[new i("ca",-1,-1),new i("ce",-1,-1)],kr=[new i("im",-1,-1),new i("um",-1,-1),new i("üm",-1,-1),new i("ım",-1,-1)],pr=[new i("sin",-1,-1),new i("sun",-1,-1),new i("sün",-1,-1),new i("sın",-1,-1)],gr=[new i("iz",-1,-1),new i("uz",-1,-1),new i("üz",-1,-1),new i("ız",-1,-1)],yr=[new i("siniz",-1,-1),new i("sunuz",-1,-1),new i("sünüz",-1,-1),new i("sınız",-1,-1)],zr=[new i("lar",-1,-1),new i("ler",-1,-1)],vr=[new i("niz",-1,-1),new i("nuz",-1,-1),new i("nüz",-1,-1),new i("nız",-1,-1)],hr=[new i("dir",-1,-1),new i("tir",-1,-1),new i("dur",-1,-1),new i("tur",-1,-1),new i("dür",-1,-1),new i("tür",-1,-1),new i("dır",-1,-1),new i("tır",-1,-1)],qr=[new i("casına",-1,-1),new i("cesine",-1,-1)],Cr=[new i("di",-1,-1),new i("ti",-1,-1),new i("dik",-1,-1),new i("tik",-1,-1),new i("duk",-1,-1),new i("tuk",-1,-1),new i("dük",-1,-1),new i("tük",-1,-1),new i("dık",-1,-1),new i("tık",-1,-1),new i("dim",-1,-1),new i("tim",-1,-1),new i("dum",-1,-1),new i("tum",-1,-1),new i("düm",-1,-1),new i("tüm",-1,-1),new i("dım",-1,-1),new i("tım",-1,-1),new i("din",-1,-1),new i("tin",-1,-1),new i("dun",-1,-1),new i("tun",-1,-1),new i("dün",-1,-1),new i("tün",-1,-1),new i("dın",-1,-1),new i("tın",-1,-1),new i("du",-1,-1),new i("tu",-1,-1),new i("dü",-1,-1),new i("tü",-1,-1),new i("dı",-1,-1),new i("tı",-1,-1)],Pr=[new i("sa",-1,-1),new i("se",-1,-1),new i("sak",-1,-1),new i("sek",-1,-1),new i("sam",-1,-1),new i("sem",-1,-1),new i("san",-1,-1),new i("sen",-1,-1)],Fr=[new i("miş",-1,-1),new i("muş",-1,-1),new i("müş",-1,-1),new i("mış",-1,-1)],Sr=[new i("b",-1,1),new i("c",-1,2),new i("d",-1,3),new i("ğ",-1,4)],Wr=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,8,0,0,0,0,0,0,1],Lr=[1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,1],xr=[1,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],Ar=[17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130],Er=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],jr=[17],Tr=[65],Zr=[65],Br=[["a",xr,97,305],["e",Ar,101,252],["ı",Er,97,305],["i",jr,101,105],["o",Tr,111,117],["ö",Zr,246,252],["u",Tr,111,117]],Dr=new e;this.setCurrent=function(r){Dr.setCurrent(r)},this.getCurrent=function(){return Dr.getCurrent()},this.stem=function(){return!!($()&&(Dr.limit_backward=Dr.cursor,Dr.cursor=Dr.limit,J(),Dr.cursor=Dr.limit,nr&&(R(),Dr.cursor=Dr.limit_backward,er())))}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.tr.stemmer,"stemmer-tr"),r.tr.stopWordFilter=r.generateStopWordFilter("acaba altmış altı ama ancak arada aslında ayrıca bana bazı belki ben benden beni benim beri beş bile bin bir biri birkaç birkez birçok birşey birşeyi biz bizden bize bizi bizim bu buna bunda bundan bunlar bunları bunların bunu bunun burada böyle böylece da daha dahi de defa değil diye diğer doksan dokuz dolayı dolayısıyla dört edecek eden ederek edilecek ediliyor edilmesi ediyor elli en etmesi etti ettiği ettiğini eğer gibi göre halen hangi hatta hem henüz hep hepsi her herhangi herkesin hiç hiçbir iki ile ilgili ise itibaren itibariyle için işte kadar karşın katrilyon kendi kendilerine kendini kendisi kendisine kendisini kez ki kim kimden kime kimi kimse kırk milyar milyon mu mü mı nasıl ne neden nedenle nerde nerede nereye niye niçin o olan olarak oldu olduklarını olduğu olduğunu olmadı olmadığı olmak olması olmayan olmaz olsa olsun olup olur olursa oluyor on ona ondan onlar onlardan onları onların onu onun otuz oysa pek rağmen sadece sanki sekiz seksen sen senden seni senin siz sizden sizi sizin tarafından trilyon tüm var vardı ve veya ya yani yapacak yapmak yaptı yaptıkları yaptığı yaptığını yapılan yapılması yapıyor yedi yerine yetmiş yine yirmi yoksa yüz zaten çok çünkü öyle üzere üç şey şeyden şeyi şeyler şu şuna şunda şundan şunları şunu şöyle".split(" ")),r.Pipeline.registerFunction(r.tr.stopWordFilter,"stopWordFilter-tr")}});
```

--------------------------------------------------------------------------------
/docs/site/license/index.html:
--------------------------------------------------------------------------------

```html
  1 | 
  2 | <!doctype html>
  3 | <html lang="en" class="no-js">
  4 |   <head>
  5 |     
  6 |       <meta charset="utf-8">
  7 |       <meta name="viewport" content="width=device-width,initial-scale=1">
  8 |       
  9 |       
 10 |       
 11 |       
 12 |         <link rel="prev" href="../future_work/">
 13 |       
 14 |       
 15 |       
 16 |       <link rel="icon" href="../assets/images/favicon.png">
 17 |       <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.21">
 18 |     
 19 |     
 20 |       
 21 |         <title>License - CodeGraphContext</title>
 22 |       
 23 |     
 24 |     
 25 |       <link rel="stylesheet" href="../assets/stylesheets/main.2a3383ac.min.css">
 26 |       
 27 |       
 28 | 
 29 | 
 30 |     
 31 |     
 32 |       
 33 |     
 34 |     
 35 |       
 36 |         
 37 |         
 38 |         <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 39 |         <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
 40 |         <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
 41 |       
 42 |     
 43 |     
 44 |     <script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
 45 |     
 46 |       
 47 | 
 48 |     
 49 |     
 50 |     
 51 |   </head>
 52 |   
 53 |   
 54 |     <body dir="ltr">
 55 |   
 56 |     
 57 |     <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
 58 |     <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
 59 |     <label class="md-overlay" for="__drawer"></label>
 60 |     <div data-md-component="skip">
 61 |       
 62 |         
 63 |         <a href="#license" class="md-skip">
 64 |           Skip to content
 65 |         </a>
 66 |       
 67 |     </div>
 68 |     <div data-md-component="announce">
 69 |       
 70 |     </div>
 71 |     
 72 |     
 73 |       
 74 | 
 75 |   
 76 | 
 77 | <header class="md-header md-header--shadow" data-md-component="header">
 78 |   <nav class="md-header__inner md-grid" aria-label="Header">
 79 |     <a href=".." title="CodeGraphContext" class="md-header__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
 80 |       
 81 |   
 82 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
 83 | 
 84 |     </a>
 85 |     <label class="md-header__button md-icon" for="__drawer">
 86 |       
 87 |       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
 88 |     </label>
 89 |     <div class="md-header__title" data-md-component="header-title">
 90 |       <div class="md-header__ellipsis">
 91 |         <div class="md-header__topic">
 92 |           <span class="md-ellipsis">
 93 |             CodeGraphContext
 94 |           </span>
 95 |         </div>
 96 |         <div class="md-header__topic" data-md-component="header-topic">
 97 |           <span class="md-ellipsis">
 98 |             
 99 |               License
100 |             
101 |           </span>
102 |         </div>
103 |       </div>
104 |     </div>
105 |     
106 |     
107 |       <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
108 |     
109 |     
110 |     
111 |       
112 |       
113 |         <label class="md-header__button md-icon" for="__search">
114 |           
115 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
116 |         </label>
117 |         <div class="md-search" data-md-component="search" role="dialog">
118 |   <label class="md-search__overlay" for="__search"></label>
119 |   <div class="md-search__inner" role="search">
120 |     <form class="md-search__form" name="search">
121 |       <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
122 |       <label class="md-search__icon md-icon" for="__search">
123 |         
124 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
125 |         
126 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
127 |       </label>
128 |       <nav class="md-search__options" aria-label="Search">
129 |         
130 |         <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
131 |           
132 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
133 |         </button>
134 |       </nav>
135 |       
136 |     </form>
137 |     <div class="md-search__output">
138 |       <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
139 |         <div class="md-search-result" data-md-component="search-result">
140 |           <div class="md-search-result__meta">
141 |             Initializing search
142 |           </div>
143 |           <ol class="md-search-result__list" role="presentation"></ol>
144 |         </div>
145 |       </div>
146 |     </div>
147 |   </div>
148 | </div>
149 |       
150 |     
151 |     
152 |   </nav>
153 |   
154 | </header>
155 |     
156 |     <div class="md-container" data-md-component="container">
157 |       
158 |       
159 |         
160 |           
161 |         
162 |       
163 |       <main class="md-main" data-md-component="main">
164 |         <div class="md-main__inner md-grid">
165 |           
166 |             
167 |               
168 |               <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
169 |                 <div class="md-sidebar__scrollwrap">
170 |                   <div class="md-sidebar__inner">
171 |                     
172 | 
173 | 
174 | 
175 | <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
176 |   <label class="md-nav__title" for="__drawer">
177 |     <a href=".." title="CodeGraphContext" class="md-nav__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
178 |       
179 |   
180 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
181 | 
182 |     </a>
183 |     CodeGraphContext
184 |   </label>
185 |   
186 |   <ul class="md-nav__list" data-md-scrollfix>
187 |     
188 |       
189 |       
190 |   
191 |   
192 |   
193 |   
194 |     <li class="md-nav__item">
195 |       <a href=".." class="md-nav__link">
196 |         
197 |   
198 |   
199 |   <span class="md-ellipsis">
200 |     Home
201 |     
202 |   </span>
203 |   
204 | 
205 |       </a>
206 |     </li>
207 |   
208 | 
209 |     
210 |       
211 |       
212 |   
213 |   
214 |   
215 |   
216 |     <li class="md-nav__item">
217 |       <a href="../installation/" class="md-nav__link">
218 |         
219 |   
220 |   
221 |   <span class="md-ellipsis">
222 |     Installation
223 |     
224 |   </span>
225 |   
226 | 
227 |       </a>
228 |     </li>
229 |   
230 | 
231 |     
232 |       
233 |       
234 |   
235 |   
236 |   
237 |   
238 |     <li class="md-nav__item">
239 |       <a href="../use_cases/" class="md-nav__link">
240 |         
241 |   
242 |   
243 |   <span class="md-ellipsis">
244 |     Use Cases
245 |     
246 |   </span>
247 |   
248 | 
249 |       </a>
250 |     </li>
251 |   
252 | 
253 |     
254 |       
255 |       
256 |   
257 |   
258 |   
259 |   
260 |     <li class="md-nav__item">
261 |       <a href="../architecture/" class="md-nav__link">
262 |         
263 |   
264 |   
265 |   <span class="md-ellipsis">
266 |     Architecture
267 |     
268 |   </span>
269 |   
270 | 
271 |       </a>
272 |     </li>
273 |   
274 | 
275 |     
276 |       
277 |       
278 |   
279 |   
280 |   
281 |   
282 |     <li class="md-nav__item">
283 |       <a href="../cli/" class="md-nav__link">
284 |         
285 |   
286 |   
287 |   <span class="md-ellipsis">
288 |     CLI Reference
289 |     
290 |   </span>
291 |   
292 | 
293 |       </a>
294 |     </li>
295 |   
296 | 
297 |     
298 |       
299 |       
300 |   
301 |   
302 |   
303 |   
304 |     <li class="md-nav__item">
305 |       <a href="../server/" class="md-nav__link">
306 |         
307 |   
308 |   
309 |   <span class="md-ellipsis">
310 |     Server
311 |     
312 |   </span>
313 |   
314 | 
315 |       </a>
316 |     </li>
317 |   
318 | 
319 |     
320 |       
321 |       
322 |   
323 |   
324 |   
325 |   
326 |     <li class="md-nav__item">
327 |       <a href="../core/" class="md-nav__link">
328 |         
329 |   
330 |   
331 |   <span class="md-ellipsis">
332 |     Core Concepts
333 |     
334 |   </span>
335 |   
336 | 
337 |       </a>
338 |     </li>
339 |   
340 | 
341 |     
342 |       
343 |       
344 |   
345 |   
346 |   
347 |   
348 |     <li class="md-nav__item">
349 |       <a href="../tools/" class="md-nav__link">
350 |         
351 |   
352 |   
353 |   <span class="md-ellipsis">
354 |     Tools
355 |     
356 |   </span>
357 |   
358 | 
359 |       </a>
360 |     </li>
361 |   
362 | 
363 |     
364 |       
365 |       
366 |   
367 |   
368 |   
369 |   
370 |     <li class="md-nav__item">
371 |       <a href="../cookbook/" class="md-nav__link">
372 |         
373 |   
374 |   
375 |   <span class="md-ellipsis">
376 |     Cookbook
377 |     
378 |   </span>
379 |   
380 | 
381 |       </a>
382 |     </li>
383 |   
384 | 
385 |     
386 |       
387 |       
388 |   
389 |   
390 |   
391 |   
392 |     
393 |     
394 |     
395 |     
396 |     
397 |     <li class="md-nav__item md-nav__item--nested">
398 |       
399 |         
400 |         
401 |         <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
402 |         
403 |           
404 |           <label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
405 |             
406 |   
407 |   
408 |   <span class="md-ellipsis">
409 |     Contributing
410 |     
411 |   </span>
412 |   
413 | 
414 |             <span class="md-nav__icon md-icon"></span>
415 |           </label>
416 |         
417 |         <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
418 |           <label class="md-nav__title" for="__nav_10">
419 |             <span class="md-nav__icon md-icon"></span>
420 |             Contributing
421 |           </label>
422 |           <ul class="md-nav__list" data-md-scrollfix>
423 |             
424 |               
425 |                 
426 |   
427 |   
428 |   
429 |   
430 |     <li class="md-nav__item">
431 |       <a href="../contributing/" class="md-nav__link">
432 |         
433 |   
434 |   
435 |   <span class="md-ellipsis">
436 |     Overview
437 |     
438 |   </span>
439 |   
440 | 
441 |       </a>
442 |     </li>
443 |   
444 | 
445 |               
446 |             
447 |               
448 |                 
449 |   
450 |   
451 |   
452 |   
453 |     <li class="md-nav__item">
454 |       <a href="../contributing_languages/" class="md-nav__link">
455 |         
456 |   
457 |   
458 |   <span class="md-ellipsis">
459 |     Adding New Languages
460 |     
461 |   </span>
462 |   
463 | 
464 |       </a>
465 |     </li>
466 |   
467 | 
468 |               
469 |             
470 |           </ul>
471 |         </nav>
472 |       
473 |     </li>
474 |   
475 | 
476 |     
477 |       
478 |       
479 |   
480 |   
481 |   
482 |   
483 |     <li class="md-nav__item">
484 |       <a href="../troubleshooting/" class="md-nav__link">
485 |         
486 |   
487 |   
488 |   <span class="md-ellipsis">
489 |     Troubleshooting
490 |     
491 |   </span>
492 |   
493 | 
494 |       </a>
495 |     </li>
496 |   
497 | 
498 |     
499 |       
500 |       
501 |   
502 |   
503 |   
504 |   
505 |     <li class="md-nav__item">
506 |       <a href="../future_work/" class="md-nav__link">
507 |         
508 |   
509 |   
510 |   <span class="md-ellipsis">
511 |     Future Work
512 |     
513 |   </span>
514 |   
515 | 
516 |       </a>
517 |     </li>
518 |   
519 | 
520 |     
521 |       
522 |       
523 |   
524 |   
525 |     
526 |   
527 |   
528 |   
529 |     <li class="md-nav__item md-nav__item--active">
530 |       
531 |       <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
532 |       
533 |       
534 |         
535 |       
536 |       
537 |       <a href="./" class="md-nav__link md-nav__link--active">
538 |         
539 |   
540 |   
541 |   <span class="md-ellipsis">
542 |     License
543 |     
544 |   </span>
545 |   
546 | 
547 |       </a>
548 |       
549 |     </li>
550 |   
551 | 
552 |     
553 |   </ul>
554 | </nav>
555 |                   </div>
556 |                 </div>
557 |               </div>
558 |             
559 |             
560 |               
561 |               <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
562 |                 <div class="md-sidebar__scrollwrap">
563 |                   <div class="md-sidebar__inner">
564 |                     
565 | 
566 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
567 |   
568 |   
569 |   
570 |     
571 |   
572 |   
573 | </nav>
574 |                   </div>
575 |                 </div>
576 |               </div>
577 |             
578 |           
579 |           
580 |             <div class="md-content" data-md-component="content">
581 |               <article class="md-content__inner md-typeset">
582 |                 
583 |                   
584 | 
585 | 
586 | 
587 | <h1 id="license">License</h1>
588 | <p>CodeGraphContext is licensed under the MIT License.</p>
589 | <pre><code>MIT License
590 | 
591 | Copyright (c) 2025
592 | 
593 | Permission is hereby granted, free of charge, to any person obtaining a copy
594 | of this software and associated documentation files (the &quot;Software&quot;), to deal
595 | in the Software without restriction, including without limitation the rights
596 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
597 | copies of the Software, and to permit persons to whom the Software is
598 | furnished to do so, subject to the following conditions:
599 | 
600 | The above copyright notice and this permission notice shall be included in all
601 | copies or substantial portions of the Software.
602 | 
603 | THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
604 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
605 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
606 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
607 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
608 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
609 | SOFTWARE.
610 | </code></pre>
611 | 
612 | 
613 | 
614 | 
615 | 
616 | 
617 | 
618 | 
619 | 
620 | 
621 | 
622 | 
623 |                 
624 |               </article>
625 |             </div>
626 |           
627 |           
628 | <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
629 |         </div>
630 |         
631 |       </main>
632 |       
633 |         <footer class="md-footer">
634 |   
635 |   <div class="md-footer-meta md-typeset">
636 |     <div class="md-footer-meta__inner md-grid">
637 |       <div class="md-copyright">
638 |   
639 |   
640 |     Made with
641 |     <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
642 |       Material for MkDocs
643 |     </a>
644 |   
645 | </div>
646 |       
647 |     </div>
648 |   </div>
649 | </footer>
650 |       
651 |     </div>
652 |     <div class="md-dialog" data-md-component="dialog">
653 |       <div class="md-dialog__inner md-typeset"></div>
654 |     </div>
655 |     
656 |     
657 |     
658 |       
659 |       <script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
660 |     
661 |     
662 |       <script src="../assets/javascripts/bundle.f55a23d4.min.js"></script>
663 |       
664 |     
665 |   </body>
666 | </html>
```

--------------------------------------------------------------------------------
/organizer/cookbook.md:
--------------------------------------------------------------------------------

```markdown
  1 | # MCP Tool Cookbook
  2 | 
  3 | This cookbook provides examples of how to use the `mcp` tool to query and understand your Python codebase. The "Tool" indicates which `mcp` tool to use, and the "JSON Arguments" are what the LLM would provide to that tool.
  4 | 
  5 | ---
  6 | 
  7 | ## Basic Queries
  8 | 
  9 | ### 1. Find a specific function by name
 10 | - **Natural Language:** "Where is the function `foo` defined?"
 11 | - **Tool:** `find_code`
 12 | - **JSON Arguments:**
 13 |   ```json
 14 |   {
 15 |     "query": "foo"
 16 |   }
 17 |   ```
 18 | 
 19 | ![Query 1](../images/1.png)
 20 | 
 21 | ### 2. Find all calls to a specific function
 22 | - **Natural Language:** "Find all calls to the `helper` function."
 23 | - **Tool:** `analyze_code_relationships`
 24 | - **JSON Arguments:**
 25 |   ```json
 26 |   {
 27 |     "query_type": "find_callers",
 28 |     "target": "helper"
 29 |   }
 30 |   ```
 31 | 
 32 | ![Query 2](../images/2.png)
 33 | 
 34 | ### 3. Find what a function calls
 35 | - **Natural Language:** "What functions are called inside the `foo` function?"
 36 | - **Tool:** `analyze_code_relationships`
 37 | - **JSON Arguments:**
 38 |   ```json
 39 |   {
 40 |     "query_type": "find_callees",
 41 |     "target": "foo",
 42 |     "context": "/teamspace/studios/this_studio/demo/CodeGraphContext/tests/sample_project/module_a.py"
 43 |   }
 44 |   ```
 45 | 
 46 | ![Query 3](../images/3.png)
 47 | 
 48 | ### 4. Find all imports of a specific module
 49 | - **Natural Language:** "Where is the `math` module imported?"
 50 | - **Tool:** `analyze_code_relationships`
 51 | - **JSON Arguments:**
 52 |   ```json
 53 |   {
 54 |     "query_type": "find_importers",
 55 |     "target": "math"
 56 |   }
 57 |   ```
 58 | 
 59 | ![Query 4](../images/4.png)
 60 | 
 61 | ### 5. Find all methods of a class
 62 | - **Natural Language:** "What are the methods of the `A` class?"
 63 | - **Tool:** `analyze_code_relationships`
 64 | - **JSON Arguments:**
 65 |   ```json
 66 |   {
 67 |     "query_type": "class_hierarchy",
 68 |     "target": "A"
 69 |   }
 70 |   ```
 71 | - **Note:** The response for `class_hierarchy` includes a list of methods.
 72 | 
 73 | ![Query 5](../images/5.png)
 74 | 
 75 | ### 6. Find all classes that inherit from a specific class
 76 | - **Natural Language:** "Show me all classes that inherit from `Base`."
 77 | - **Tool:** `analyze_code_relationships`
 78 | - **JSON Arguments:**
 79 |   ```json
 80 |   {
 81 |     "query_type": "class_hierarchy",
 82 |     "target": "Base"
 83 |   }
 84 |   ```
 85 | - **Note:** The response for `class_hierarchy` includes a list of child classes.
 86 | 
 87 | ![Query 6](../images/6.png)
 88 | 
 89 | ### 7. Find all functions with a specific decorator
 90 | - **Natural Language:** "Find all functions with the `log_decorator`."
 91 | - **Tool:** `analyze_code_relationships`
 92 | - **JSON Arguments:**
 93 |   ```json
 94 |   {
 95 |     "query_type": "find_functions_by_decorator",
 96 |     "target": "log_decorator"
 97 |   }
 98 |   ```
 99 | 
100 | ![Query 7](../images/7.png)
101 | 
102 | ### 8. Find all dataclasses
103 | - **Natural Language:** "Find all dataclasses."
104 | - **Tool:** `execute_cypher_query`
105 | - **JSON Arguments:**
106 |   ```json
107 |   {
108 |     "cypher_query": "MATCH (c:Class) WHERE 'dataclass' IN c.decorators RETURN c.name, c.file_path"
109 |   }
110 |   ```
111 | 
112 | ![Query 8](../images/8.png)
113 | 
114 | ---
115 | 
116 | ## Code Analysis & Quality
117 | 
118 | ### 9. Find the 5 most complex functions
119 | - **Natural Language:** "Find the 5 most complex functions."
120 | - **Tool:** `find_most_complex_functions`
121 | - **JSON Arguments:**
122 |   ```json
123 |   {
124 |     "limit": 5
125 |   }
126 |   ```
127 | 
128 | ![Query 9](../images/9.png)
129 | 
130 | ### 10. Calculate cyclomatic complexity of a function
131 | - **Natural Language:** "What is the cyclomatic complexity of `try_except_finally`?"
132 | - **Tool:** `calculate_cyclomatic_complexity`
133 | - **JSON Arguments:**
134 |   ```json
135 |   {
136 |     "function_name": "try_except_finally"
137 |   }
138 |   ```
139 | 
140 | ### 11. Find unused code
141 | - **Natural Language:** "Find unused code, but ignore API endpoints decorated with `@app.route`."
142 | - **Tool:** `find_dead_code`
143 | - **JSON Arguments:**
144 |   ```json
145 |   {
146 |     "exclude_decorated_with": ["@app.route"]
147 |   }
148 |   ```
149 | 
150 | ![Query 11](../images/11.png)
151 | 
152 | ### 12. Find the call chain between two functions
153 | - **Natural Language:** "What is the call chain from `wrapper` to `helper`?"
154 | - **Tool:** `analyze_code_relationships`
155 | - **JSON Arguments:**
156 |   ```json
157 |   {
158 |     "query_type": "call_chain",
159 |     "target": "wrapper->helper"
160 |   }
161 |   ```
162 | 
163 | ![Query 12](../images/12.png)
164 | 
165 | ### 13. Find all direct and indirect callers of a function
166 | - **Natural Language:** "Show me all functions that eventually call the `helper` function."
167 | - **Tool:** `analyze_code_relationships`
168 | - **JSON Arguments:**
169 |   ```json
170 |   {
171 |     "query_type": "find_all_callers",
172 |     "target": "helper"
173 |   }
174 |   ```
175 | 
176 | ![Query 13](../images/13.png)
177 | 
178 | ### 14. Find functions by argument name
179 | - **Natural Language:** "Find all functions that take `self` as an argument."
180 | - **Tool:** `analyze_code_relationships`
181 | - **JSON Arguments:**
182 |   ```json
183 |   {
184 |     "query_type": "find_functions_by_argument",
185 |     "target": "self"
186 |   }
187 |   ```
188 | 
189 | ![Query 14](../images/14.png)
190 | 
191 | ### 15. List all python package imports from a directory
192 | - **Natural Language:** "List all python package imports from my project directory."
193 | - **Tool:** `execute_cypher_query`
194 | - **JSON Arguments:**
195 |   ```json
196 |   {
197 |     "cypher_query": "MATCH (f:File)-[:IMPORTS]->(m:Module) WHERE f.path ENDS WITH '.py' RETURN DISTINCT m.name"
198 |   }
199 |   ```
200 | 
201 | ---
202 | 
203 | ## Repository Information Queries
204 | 
205 | ### 16. List all indexed projects
206 | - **Natural Language:** "List all projects I have indexed."
207 | - **Tool:** `list_indexed_repositories`
208 | - **JSON Arguments:**
209 |   ```json
210 |   {}
211 |   ```
212 | 
213 | ![Query 16](../images/16.png)
214 | 
215 | ### 17. Check the status of an indexing job
216 | - **Natural Language:** "What is the status of job `4cb9a60e-c1b1-43a7-9c94-c840771506bc`?"
217 | - **Tool:** `check_job_status`
218 | - **JSON Arguments:**
219 |   ```json
220 |   {
221 |     "job_id": "4cb9a60e-c1b1-43a7-9c94-c840771506bc"
222 |   }
223 |   ```
224 | 
225 | ### 18. List all background jobs
226 | - **Natural Language:** "Show me all background jobs."
227 | - **Tool:** `list_jobs`
228 | - **JSON Arguments:**
229 |   ```json
230 |   {}
231 |   ```
232 | 
233 | ---
234 | 
235 | ## Advanced Cypher Queries
236 | 
237 | These examples use the `execute_cypher_query` tool for more specific and complex questions.
238 | 
239 | ### 19. Find all function definitions
240 | - **Natural Language:** "Find all function definitions in the codebase."
241 | - **JSON Arguments:**
242 |   ```json
243 |   {
244 |     "cypher_query": "MATCH (n:Function) RETURN n.name, n.file_path, n.line_number LIMIT 50"
245 |   }
246 |   ```
247 | 
248 | ![Query 19](../images/19.png)
249 | 
250 | ### 20. Find all classes
251 | - **Natural Language:** "Show me all the classes."
252 | - **JSON Arguments:**
253 |   ```json
254 |   {
255 |     "cypher_query": "MATCH (n:Class) RETURN n.name, n.file_path, n.line_number LIMIT 50"
256 |   }
257 |   ```
258 | 
259 | ![Query 20](../images/20.png)
260 | 
261 | ### 21. Find all functions in a file
262 | - **Natural Language:** "Find all functions in `module_a.py`."
263 | - **JSON Arguments:**
264 |   ```json
265 |   {
266 |     "cypher_query": "MATCH (f:Function) WHERE f.file_path ENDS WITH 'module_a.py' RETURN f.name"
267 |   }
268 |   ```
269 | 
270 | ![Query 21](../images/21.png)
271 | 
272 | ### 22. Find all classes in a file
273 | - **Natural Language:** "Find all classes in `advanced_classes.py`."
274 | - **JSON Arguments:**
275 |   ```json
276 |   {
277 |     "cypher_query": "MATCH (c:Class) WHERE c.file_path ENDS WITH 'advanced_classes.py' RETURN c.name"
278 |   }
279 |   ```
280 | 
281 | ![Query 22](../images/22.png)
282 | 
283 | ### 23. List all top-level functions and classes in a file
284 | - **Natural Language:** "List all top-level functions and classes in `module_a.py`."
285 | - **JSON Arguments:**
286 |   ```json
287 |   {
288 |     "cypher_query": "MATCH (f:File)-[:CONTAINS]->(n) WHERE f.name = 'module_a.py' AND (n:Function OR n:Class) AND n.context IS NULL RETURN n.name"
289 |   }
290 |   ```
291 | 
292 | ![Query 23](../images/23.png)
293 | 
294 | ### 24. Find functions in one module that call a function in another
295 | - **Natural Language:** "Find functions in `module_a.py` that call `helper` in `module_b.py`."
296 | - **JSON Arguments:**
297 |   ```json
298 |   {
299 |     "cypher_query": "MATCH (caller:Function)-[:CALLS]->(callee:Function {name: 'helper'}) WHERE caller.file_path ENDS WITH 'module_a.py' AND callee.file_path ENDS WITH 'module_b.py' RETURN caller.name"
300 |   }
301 |   ```
302 | 
303 | ![Query 24](../images/24.png)
304 | 
305 | ### 25. Find circular file imports
306 | - **Natural Language:** "Are there any circular dependencies between files?"
307 | - **JSON Arguments:**
308 |   ```json
309 |   {
310 |     "cypher_query": "MATCH (f1:File)-[:IMPORTS]->(m2:Module), (f2:File)-[:IMPORTS]->(m1:Module) WHERE f1.name = m1.name + '.py' AND f2.name = m2.name + '.py' RETURN f1.name, f2.name"
311 |   }
312 |   ```
313 | 
314 | ### 26. Find all functions with more than 5 arguments
315 | - **Natural Language:** "Find all functions with a large number of arguments."
316 | - **JSON Arguments:**
317 |   ```json
318 |   {
319 |     "cypher_query": "MATCH (f:Function) WHERE size(f.args) > 5 RETURN f.name, f.file_path, size(f.args) as arg_count"
320 |   }
321 |   ```
322 | 
323 | ![Query 26](../images/26.png)
324 | 
325 | ### 27. Find all functions in a file that have a docstring
326 | - **Natural Language:** "Find all functions in `module_a.py` that have a docstring."
327 | - **JSON Arguments:**
328 |   ```json
329 |   {
330 |     "cypher_query": "MATCH (f:Function) WHERE f.file_path ENDS WITH 'module_a.py' AND f.docstring IS NOT NULL AND f.docstring <> '' RETURN f.name"
331 |   }
332 |   ```
333 | 
334 | ### 28. Find all classes that have a specific method
335 | - **Natural Language:** "Find all classes that have a `greet` method."
336 | - **JSON Arguments:**
337 |   ```json
338 |   {
339 |     "cypher_query": "MATCH (c:Class)-[:CONTAINS]->(m:Function {name: 'greet'}) RETURN c.name, c.file_path"
340 |   }
341 |   ```
342 | 
343 | ![Query 28](../images/28.png)
344 | 
345 | ### 29. Find the depth of inheritance for all classes
346 | - **Natural Language:** "How deep are the inheritance chains for all classes?"
347 | - **JSON Arguments:**
348 |   ```json
349 |   {
350 |     "cypher_query": "MATCH (c:Class) OPTIONAL MATCH path = (c)-[:INHERITS*]->(parent:Class) RETURN c.name, c.file_path, length(path) AS depth ORDER BY depth DESC"
351 |   }
352 |   ```
353 | 
354 | ![Query 29](../images/29.png)
355 | 
356 | ### 30. Find all functions that have a docstring
357 | - **Natural Language:** "Show me all functions that are documented."
358 | - **JSON Arguments:**
359 |   ```json
360 |   {
361 |     "cypher_query": "MATCH (f:Function) WHERE f.docstring IS NOT NULL AND f.docstring <> '' RETURN f.name, f.file_path LIMIT 50"
362 |   }
363 |   ```
364 | 
365 | ![Query 30](../images/30.png)
366 | 
367 | ### 31. Find all decorated methods in a class
368 | - **Natural Language:** "Find all decorated methods in the `Child` class."
369 | - **JSON Arguments:**
370 |   ```json
371 |   {
372 |     "cypher_query": "MATCH (c:Class {name: 'Child'})-[:CONTAINS]->(m:Function) WHERE m.decorators IS NOT NULL AND size(m.decorators) > 0 RETURN m.name"
373 |   }
374 |   ```
375 | 
376 | ![Query 31](../images/31.png)
377 | 
378 | ### 32. Find the number of functions in each file
379 | - **Natural Language:** "How many functions are in each file?"
380 | - **JSON Arguments:**
381 |   ```json
382 |   {
383 |     "cypher_query": "MATCH (f:Function) RETURN f.file_path, count(f) AS function_count ORDER BY function_count DESC"
384 |   }
385 |   ```
386 | 
387 | ![Query 32](../images/32.png)
388 | 
389 | ### 33. Find all methods that override a parent method
390 | - **Natural Language:** "Find all methods that are overridden from a parent class."
391 | - **JSON Arguments:**
392 |   ```json
393 |   {
394 |     "cypher_query": "MATCH (c:Class)-[:INHERITS]->(p:Class), (c)-[:CONTAINS]->(m:Function), (p)-[:CONTAINS]->(m_parent:Function) WHERE m.name = m_parent.name RETURN m.name as method, c.name as child_class, p.name as parent_class"
395 |   }
396 |   ```
397 | 
398 | ![Query 33](../images/33.png)
399 | 
400 | ### 34. Find all functions that call `super()`
401 | - **Natural Language:** "Find all methods that call their parent's method via `super()`."
402 | - **JSON Arguments:**
403 |   ```json
404 |   {
405 |     "cypher_query": "MATCH (f:Function)-[r:CALLS]->() WHERE r.full_call_name STARTS WITH 'super(' RETURN f.name, f.file_path"
406 |   }
407 |   ```
408 | 
409 | ![Query 34](../images/34.png)
410 | 
411 | ### 35. Find all calls to a function with a specific argument
412 | - **Natural Language:** "Find all calls to `helper` with the argument `x`."
413 | - **JSON Arguments:**
414 |   ```json
415 |   {
416 |     "cypher_query": "MATCH ()-[r:CALLS]->(f:Function {name: 'helper'}) WHERE 'x' IN r.args RETURN r.full_call_name, r.line_number, r.file_path"
417 |   }
418 |   ```
419 | 
420 | ![Query 35](../images/35.png)
421 | 
422 | ### 36. Find all functions that are not called by any other function
423 | - **Natural Language:** "Find all dead code (functions that are never called)."
424 | - **JSON Arguments:**
425 |   ```json
426 |   {
427 |     "cypher_query": "MATCH (f:Function) WHERE NOT (()-[:CALLS]->(f)) AND f.is_dependency = false RETURN f.name, f.file_path"
428 |   }
429 |   ```
430 | 
431 | ![Query 36](../images/36.png)
432 | 
433 | ### 37. Find all functions that are called with a specific argument
434 | - **Natural Language:** "Find all calls to `print` with the argument `'hello'`."
435 | - **JSON Arguments:**
436 |   ```json
437 |   {
438 |     "cypher_query": "MATCH (c:Call) WHERE c.name = 'print' AND 'hello' IN c.args RETURN c.file, c.lineno"
439 |   }
440 |   ```
441 | 
442 | ### 38. Find all direct and indirect callees of a function
443 | - **Natural Language:** "Show me all functions that are eventually called by the `foo` function."
444 | - **Tool:** `analyze_code_relationships`
445 | - **JSON Arguments:**
446 |   ```json
447 |   {
448 |     "query_type": "find_all_callees",
449 |     "target": "foo",
450 |     "context": "/teamspace/studios/this_studio/demo/CodeGraphContext/tests/sample_project/module_a.py"
451 |   }
452 |   ```
453 | 
454 | ![Query 38](../images/38.png)
455 | 
456 | ### 39. Find all functions that are overridden
457 | - **Natural Language:** "Find all functions that are overridden."
458 | - **Tool:** `analyze_code_relationships`
459 | - **JSON Arguments:**
460 |   ```json
461 |   {
462 |     "query_type": "overrides",
463 |     "target": "foo"
464 |   }
465 |   ```
466 | 
467 | ![Query 39](../images/39.png)
468 | 
469 | ### 40. Find all modules imported by `module_a`
470 | - **Natural Language:** "Find all modules imported by `module_a`."
471 | - **Tool:** `execute_cypher_query`
472 | - **JSON Arguments:**
473 |   ```json
474 |   {
475 |     "cypher_query": "MATCH (f:File {name: 'module_a.py'})-[:IMPORTS]->(m:Module) RETURN m.name AS imported_module_name"
476 |   }
477 |   ```
478 | 
479 | ![Query 40](../images/40.png)
480 | 
481 | ### 41. Find large functions that should be refactored
482 | - **Natural Language:** "Find functions with more than 20 lines of code that might need refactoring."
483 | - **Tool:** `execute_cypher_query`
484 | - **JSON Arguments:**
485 |   ```json
486 |   {
487 |     "cypher_query": "MATCH (f:Function)
488 |     WHERE f.end_line - f.line_number > 20
489 |     RETURN f"
490 |   }
491 |   ```
492 | 
493 | ![Query 41](../images/41.png)
494 | 
495 | ### 42. Find recursive functions
496 | - **Natural Language:** "Find all functions that call themselves (recursive functions)."
497 | - **Tool:** `execute_cypher_query`
498 | - **JSON Arguments:**
499 |   ```json
500 |   {
501 |     "cypher_query": "MATCH p=(f:Function)-[:CALLS]->(f2:Function)
502 |     WHERE f.name = f2.name AND f.file_path = f2.file_path
503 |     RETURN p"
504 |   }
505 |   ```
506 | ![Query 42](../images/42.png)
507 | 
508 | ### 42. Find most connected functions (hub functions)
509 | - **Natural Language:** "Find the functions that are most central to the codebase (called by many and call many others)."
510 | - **Tool:** `execute_cypher_query`
511 | - **JSON Arguments:**
512 |   ```json
513 |   {
514 |     "cypher_query": "MATCH (f:Function)
515 |     OPTIONAL MATCH (f)-[:CALLS]->(callee:Function)
516 |     OPTIONAL MATCH (caller:Function)-[:CALLS]->(f)
517 |     WITH f, count(DISTINCT callee) AS calls_out, count(DISTINCT caller) AS calls_in
518 |     ORDER BY (calls_out + calls_in) DESC
519 |     LIMIT 5
520 |     MATCH p=(f)-[*0..2]-()
521 |     RETURN p"
522 |   }
523 |   ```
524 | ![Query 43](../images/43.png)
525 | 
526 | ## Security & Sensitive Data Analysis
527 | 
528 | ### 42. Find potential security vulnerabilities (hardcoded secrets)
529 | - **Natural Language:** "Find potential hardcoded passwords, API keys, or secrets in the codebase."
530 | - **Tool:** `execute_cypher_query`
531 | - **JSON Arguments:**
532 |   ```json
533 |   {
534 |     "cypher_query": "WITH ["password",  "api_key", "apikey",    "secret_token", "token", "auth", "access_key", "private_key", "client_secret", "sessionid", "jwt"] AS keywords
535 |     MATCH (f:Function)
536 |     WHERE ANY(word IN keywords WHERE toLower(f.source_code) CONTAINS word)
537 |     RETURN f"
538 |   }
539 |   ```
```

--------------------------------------------------------------------------------
/docs/site/future_work/index.html:
--------------------------------------------------------------------------------

```html
  1 | 
  2 | <!doctype html>
  3 | <html lang="en" class="no-js">
  4 |   <head>
  5 |     
  6 |       <meta charset="utf-8">
  7 |       <meta name="viewport" content="width=device-width,initial-scale=1">
  8 |       
  9 |       
 10 |       
 11 |       
 12 |         <link rel="prev" href="../troubleshooting/">
 13 |       
 14 |       
 15 |         <link rel="next" href="../license/">
 16 |       
 17 |       
 18 |       <link rel="icon" href="../assets/images/favicon.png">
 19 |       <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.21">
 20 |     
 21 |     
 22 |       
 23 |         <title>Future Work - CodeGraphContext</title>
 24 |       
 25 |     
 26 |     
 27 |       <link rel="stylesheet" href="../assets/stylesheets/main.2a3383ac.min.css">
 28 |       
 29 |       
 30 | 
 31 | 
 32 |     
 33 |     
 34 |       
 35 |     
 36 |     
 37 |       
 38 |         
 39 |         
 40 |         <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 41 |         <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
 42 |         <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
 43 |       
 44 |     
 45 |     
 46 |     <script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
 47 |     
 48 |       
 49 | 
 50 |     
 51 |     
 52 |     
 53 |   </head>
 54 |   
 55 |   
 56 |     <body dir="ltr">
 57 |   
 58 |     
 59 |     <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
 60 |     <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
 61 |     <label class="md-overlay" for="__drawer"></label>
 62 |     <div data-md-component="skip">
 63 |       
 64 |         
 65 |         <a href="#ongoing-concerns-and-future-work" class="md-skip">
 66 |           Skip to content
 67 |         </a>
 68 |       
 69 |     </div>
 70 |     <div data-md-component="announce">
 71 |       
 72 |     </div>
 73 |     
 74 |     
 75 |       
 76 | 
 77 |   
 78 | 
 79 | <header class="md-header md-header--shadow" data-md-component="header">
 80 |   <nav class="md-header__inner md-grid" aria-label="Header">
 81 |     <a href=".." title="CodeGraphContext" class="md-header__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
 82 |       
 83 |   
 84 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
 85 | 
 86 |     </a>
 87 |     <label class="md-header__button md-icon" for="__drawer">
 88 |       
 89 |       <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
 90 |     </label>
 91 |     <div class="md-header__title" data-md-component="header-title">
 92 |       <div class="md-header__ellipsis">
 93 |         <div class="md-header__topic">
 94 |           <span class="md-ellipsis">
 95 |             CodeGraphContext
 96 |           </span>
 97 |         </div>
 98 |         <div class="md-header__topic" data-md-component="header-topic">
 99 |           <span class="md-ellipsis">
100 |             
101 |               Future Work
102 |             
103 |           </span>
104 |         </div>
105 |       </div>
106 |     </div>
107 |     
108 |     
109 |       <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
110 |     
111 |     
112 |     
113 |       
114 |       
115 |         <label class="md-header__button md-icon" for="__search">
116 |           
117 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
118 |         </label>
119 |         <div class="md-search" data-md-component="search" role="dialog">
120 |   <label class="md-search__overlay" for="__search"></label>
121 |   <div class="md-search__inner" role="search">
122 |     <form class="md-search__form" name="search">
123 |       <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
124 |       <label class="md-search__icon md-icon" for="__search">
125 |         
126 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
127 |         
128 |         <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
129 |       </label>
130 |       <nav class="md-search__options" aria-label="Search">
131 |         
132 |         <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
133 |           
134 |           <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
135 |         </button>
136 |       </nav>
137 |       
138 |     </form>
139 |     <div class="md-search__output">
140 |       <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
141 |         <div class="md-search-result" data-md-component="search-result">
142 |           <div class="md-search-result__meta">
143 |             Initializing search
144 |           </div>
145 |           <ol class="md-search-result__list" role="presentation"></ol>
146 |         </div>
147 |       </div>
148 |     </div>
149 |   </div>
150 | </div>
151 |       
152 |     
153 |     
154 |   </nav>
155 |   
156 | </header>
157 |     
158 |     <div class="md-container" data-md-component="container">
159 |       
160 |       
161 |         
162 |           
163 |         
164 |       
165 |       <main class="md-main" data-md-component="main">
166 |         <div class="md-main__inner md-grid">
167 |           
168 |             
169 |               
170 |               <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
171 |                 <div class="md-sidebar__scrollwrap">
172 |                   <div class="md-sidebar__inner">
173 |                     
174 | 
175 | 
176 | 
177 | <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
178 |   <label class="md-nav__title" for="__drawer">
179 |     <a href=".." title="CodeGraphContext" class="md-nav__button md-logo" aria-label="CodeGraphContext" data-md-component="logo">
180 |       
181 |   
182 |   <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
183 | 
184 |     </a>
185 |     CodeGraphContext
186 |   </label>
187 |   
188 |   <ul class="md-nav__list" data-md-scrollfix>
189 |     
190 |       
191 |       
192 |   
193 |   
194 |   
195 |   
196 |     <li class="md-nav__item">
197 |       <a href=".." class="md-nav__link">
198 |         
199 |   
200 |   
201 |   <span class="md-ellipsis">
202 |     Home
203 |     
204 |   </span>
205 |   
206 | 
207 |       </a>
208 |     </li>
209 |   
210 | 
211 |     
212 |       
213 |       
214 |   
215 |   
216 |   
217 |   
218 |     <li class="md-nav__item">
219 |       <a href="../installation/" class="md-nav__link">
220 |         
221 |   
222 |   
223 |   <span class="md-ellipsis">
224 |     Installation
225 |     
226 |   </span>
227 |   
228 | 
229 |       </a>
230 |     </li>
231 |   
232 | 
233 |     
234 |       
235 |       
236 |   
237 |   
238 |   
239 |   
240 |     <li class="md-nav__item">
241 |       <a href="../use_cases/" class="md-nav__link">
242 |         
243 |   
244 |   
245 |   <span class="md-ellipsis">
246 |     Use Cases
247 |     
248 |   </span>
249 |   
250 | 
251 |       </a>
252 |     </li>
253 |   
254 | 
255 |     
256 |       
257 |       
258 |   
259 |   
260 |   
261 |   
262 |     <li class="md-nav__item">
263 |       <a href="../architecture/" class="md-nav__link">
264 |         
265 |   
266 |   
267 |   <span class="md-ellipsis">
268 |     Architecture
269 |     
270 |   </span>
271 |   
272 | 
273 |       </a>
274 |     </li>
275 |   
276 | 
277 |     
278 |       
279 |       
280 |   
281 |   
282 |   
283 |   
284 |     <li class="md-nav__item">
285 |       <a href="../cli/" class="md-nav__link">
286 |         
287 |   
288 |   
289 |   <span class="md-ellipsis">
290 |     CLI Reference
291 |     
292 |   </span>
293 |   
294 | 
295 |       </a>
296 |     </li>
297 |   
298 | 
299 |     
300 |       
301 |       
302 |   
303 |   
304 |   
305 |   
306 |     <li class="md-nav__item">
307 |       <a href="../server/" class="md-nav__link">
308 |         
309 |   
310 |   
311 |   <span class="md-ellipsis">
312 |     Server
313 |     
314 |   </span>
315 |   
316 | 
317 |       </a>
318 |     </li>
319 |   
320 | 
321 |     
322 |       
323 |       
324 |   
325 |   
326 |   
327 |   
328 |     <li class="md-nav__item">
329 |       <a href="../core/" class="md-nav__link">
330 |         
331 |   
332 |   
333 |   <span class="md-ellipsis">
334 |     Core Concepts
335 |     
336 |   </span>
337 |   
338 | 
339 |       </a>
340 |     </li>
341 |   
342 | 
343 |     
344 |       
345 |       
346 |   
347 |   
348 |   
349 |   
350 |     <li class="md-nav__item">
351 |       <a href="../tools/" class="md-nav__link">
352 |         
353 |   
354 |   
355 |   <span class="md-ellipsis">
356 |     Tools
357 |     
358 |   </span>
359 |   
360 | 
361 |       </a>
362 |     </li>
363 |   
364 | 
365 |     
366 |       
367 |       
368 |   
369 |   
370 |   
371 |   
372 |     <li class="md-nav__item">
373 |       <a href="../cookbook/" class="md-nav__link">
374 |         
375 |   
376 |   
377 |   <span class="md-ellipsis">
378 |     Cookbook
379 |     
380 |   </span>
381 |   
382 | 
383 |       </a>
384 |     </li>
385 |   
386 | 
387 |     
388 |       
389 |       
390 |   
391 |   
392 |   
393 |   
394 |     
395 |     
396 |     
397 |     
398 |     
399 |     <li class="md-nav__item md-nav__item--nested">
400 |       
401 |         
402 |         
403 |         <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
404 |         
405 |           
406 |           <label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
407 |             
408 |   
409 |   
410 |   <span class="md-ellipsis">
411 |     Contributing
412 |     
413 |   </span>
414 |   
415 | 
416 |             <span class="md-nav__icon md-icon"></span>
417 |           </label>
418 |         
419 |         <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
420 |           <label class="md-nav__title" for="__nav_10">
421 |             <span class="md-nav__icon md-icon"></span>
422 |             Contributing
423 |           </label>
424 |           <ul class="md-nav__list" data-md-scrollfix>
425 |             
426 |               
427 |                 
428 |   
429 |   
430 |   
431 |   
432 |     <li class="md-nav__item">
433 |       <a href="../contributing/" class="md-nav__link">
434 |         
435 |   
436 |   
437 |   <span class="md-ellipsis">
438 |     Overview
439 |     
440 |   </span>
441 |   
442 | 
443 |       </a>
444 |     </li>
445 |   
446 | 
447 |               
448 |             
449 |               
450 |                 
451 |   
452 |   
453 |   
454 |   
455 |     <li class="md-nav__item">
456 |       <a href="../contributing_languages/" class="md-nav__link">
457 |         
458 |   
459 |   
460 |   <span class="md-ellipsis">
461 |     Adding New Languages
462 |     
463 |   </span>
464 |   
465 | 
466 |       </a>
467 |     </li>
468 |   
469 | 
470 |               
471 |             
472 |           </ul>
473 |         </nav>
474 |       
475 |     </li>
476 |   
477 | 
478 |     
479 |       
480 |       
481 |   
482 |   
483 |   
484 |   
485 |     <li class="md-nav__item">
486 |       <a href="../troubleshooting/" class="md-nav__link">
487 |         
488 |   
489 |   
490 |   <span class="md-ellipsis">
491 |     Troubleshooting
492 |     
493 |   </span>
494 |   
495 | 
496 |       </a>
497 |     </li>
498 |   
499 | 
500 |     
501 |       
502 |       
503 |   
504 |   
505 |     
506 |   
507 |   
508 |   
509 |     <li class="md-nav__item md-nav__item--active">
510 |       
511 |       <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
512 |       
513 |       
514 |         
515 |       
516 |       
517 |         <label class="md-nav__link md-nav__link--active" for="__toc">
518 |           
519 |   
520 |   
521 |   <span class="md-ellipsis">
522 |     Future Work
523 |     
524 |   </span>
525 |   
526 | 
527 |           <span class="md-nav__icon md-icon"></span>
528 |         </label>
529 |       
530 |       <a href="./" class="md-nav__link md-nav__link--active">
531 |         
532 |   
533 |   
534 |   <span class="md-ellipsis">
535 |     Future Work
536 |     
537 |   </span>
538 |   
539 | 
540 |       </a>
541 |       
542 |         
543 | 
544 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
545 |   
546 |   
547 |   
548 |     
549 |   
550 |   
551 |     <label class="md-nav__title" for="__toc">
552 |       <span class="md-nav__icon md-icon"></span>
553 |       Table of contents
554 |     </label>
555 |     <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
556 |       
557 |         <li class="md-nav__item">
558 |   <a href="#semantic-search" class="md-nav__link">
559 |     <span class="md-ellipsis">
560 |       Semantic Search
561 |     </span>
562 |   </a>
563 |   
564 | </li>
565 |       
566 |     </ul>
567 |   
568 | </nav>
569 |       
570 |     </li>
571 |   
572 | 
573 |     
574 |       
575 |       
576 |   
577 |   
578 |   
579 |   
580 |     <li class="md-nav__item">
581 |       <a href="../license/" class="md-nav__link">
582 |         
583 |   
584 |   
585 |   <span class="md-ellipsis">
586 |     License
587 |     
588 |   </span>
589 |   
590 | 
591 |       </a>
592 |     </li>
593 |   
594 | 
595 |     
596 |   </ul>
597 | </nav>
598 |                   </div>
599 |                 </div>
600 |               </div>
601 |             
602 |             
603 |               
604 |               <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
605 |                 <div class="md-sidebar__scrollwrap">
606 |                   <div class="md-sidebar__inner">
607 |                     
608 | 
609 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
610 |   
611 |   
612 |   
613 |     
614 |   
615 |   
616 |     <label class="md-nav__title" for="__toc">
617 |       <span class="md-nav__icon md-icon"></span>
618 |       Table of contents
619 |     </label>
620 |     <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
621 |       
622 |         <li class="md-nav__item">
623 |   <a href="#semantic-search" class="md-nav__link">
624 |     <span class="md-ellipsis">
625 |       Semantic Search
626 |     </span>
627 |   </a>
628 |   
629 | </li>
630 |       
631 |     </ul>
632 |   
633 | </nav>
634 |                   </div>
635 |                 </div>
636 |               </div>
637 |             
638 |           
639 |           
640 |             <div class="md-content" data-md-component="content">
641 |               <article class="md-content__inner md-typeset">
642 |                 
643 |                   
644 | 
645 | 
646 | 
647 | <h1 id="ongoing-concerns-and-future-work">Ongoing Concerns and Future Work</h1>
648 | <p>This page outlines some of the current limitations of CodeGraphContext and areas for future development.</p>
649 | <h2 id="semantic-search">Semantic Search</h2>
650 | <p>The tool is smart enough to find and analyze a function through millions of code files, but the tool is not yet smart enough to understand that a user searching for “calculate_sum” is also intending to look at the “calculate_addition” function. This level of semantic similarity needs to be researched, developed, tested and eventually implemented by our tool.</p>
651 | 
652 | 
653 | 
654 | 
655 | 
656 | 
657 | 
658 | 
659 | 
660 | 
661 | 
662 | 
663 |                 
664 |               </article>
665 |             </div>
666 |           
667 |           
668 | <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
669 |         </div>
670 |         
671 |       </main>
672 |       
673 |         <footer class="md-footer">
674 |   
675 |   <div class="md-footer-meta md-typeset">
676 |     <div class="md-footer-meta__inner md-grid">
677 |       <div class="md-copyright">
678 |   
679 |   
680 |     Made with
681 |     <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
682 |       Material for MkDocs
683 |     </a>
684 |   
685 | </div>
686 |       
687 |     </div>
688 |   </div>
689 | </footer>
690 |       
691 |     </div>
692 |     <div class="md-dialog" data-md-component="dialog">
693 |       <div class="md-dialog__inner md-typeset"></div>
694 |     </div>
695 |     
696 |     
697 |     
698 |       
699 |       <script id="__config" type="application/json">{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
700 |     
701 |     
702 |       <script src="../assets/javascripts/bundle.f55a23d4.min.js"></script>
703 |       
704 |     
705 |   </body>
706 | </html>
```

--------------------------------------------------------------------------------
/tests/sample_project_typescript/src/decorators-metadata.ts:
--------------------------------------------------------------------------------

```typescript
  1 | /**
  2 |  * Decorators and Metadata
  3 |  * Demonstrates TypeScript decorators for classes, methods, properties, and parameters
  4 |  * Note: Requires experimentalDecorators and emitDecoratorMetadata in tsconfig.json
  5 |  * Also requires reflect-metadata package for metadata reflection
  6 |  */
  7 | 
  8 | import "reflect-metadata";
  9 | 
 10 | // ========== Metadata Keys ==========
 11 | export const METADATA_KEYS = {
 12 |   VALIDATION_RULES: Symbol("validation:rules"),
 13 |   ROUTE_INFO: Symbol("route:info"),
 14 |   INJECTABLE: Symbol("injectable"),
 15 |   CACHE_CONFIG: Symbol("cache:config"),
 16 |   LOG_CONFIG: Symbol("log:config"),
 17 |   REQUIRED_ROLE: Symbol("required:role"),
 18 |   SERIALIZABLE: Symbol("serializable"),
 19 |   MAPPED_PROPERTY: Symbol("mapped:property")
 20 | };
 21 | 
 22 | // ========== Class Decorators ==========
 23 | export function Entity(tableName?: string): ClassDecorator {
 24 |   return function <T extends Function>(constructor: T) {
 25 |     Reflect.defineMetadata("entity:table", tableName || constructor.name.toLowerCase(), constructor);
 26 |     return constructor;
 27 |   };
 28 | }
 29 | 
 30 | export function Injectable(): ClassDecorator {
 31 |   return function <T extends Function>(constructor: T) {
 32 |     Reflect.defineMetadata(METADATA_KEYS.INJECTABLE, true, constructor);
 33 |     return constructor;
 34 |   };
 35 | }
 36 | 
 37 | export function Component(config: { selector: string; template?: string }): ClassDecorator {
 38 |   return function <T extends Function>(constructor: T) {
 39 |     Reflect.defineMetadata("component:config", config, constructor);
 40 |     return constructor;
 41 |   };
 42 | }
 43 | 
 44 | export function Serializable(): ClassDecorator {
 45 |   return function <T extends Function>(constructor: T) {
 46 |     Reflect.defineMetadata(METADATA_KEYS.SERIALIZABLE, true, constructor);
 47 |     
 48 |     // Add serialize method to prototype if it doesn't exist
 49 |     if (!constructor.prototype.serialize) {
 50 |       constructor.prototype.serialize = function() {
 51 |         const result: any = {};
 52 |         const serializableProps = Reflect.getMetadata("serializable:properties", this.constructor) || [];
 53 |         
 54 |         for (const prop of serializableProps) {
 55 |           if (this[prop] !== undefined) {
 56 |             result[prop] = this[prop];
 57 |           }
 58 |         }
 59 |         
 60 |         return result;
 61 |       };
 62 |     }
 63 |     
 64 |     return constructor;
 65 |   };
 66 | }
 67 | 
 68 | // ========== Method Decorators ==========
 69 | export function Log(message?: string): MethodDecorator {
 70 |   return function (target: any, propertyName: string | symbol, descriptor: PropertyDescriptor) {
 71 |     const originalMethod = descriptor.value;
 72 |     const className = target.constructor.name;
 73 |     
 74 |     descriptor.value = function (...args: any[]) {
 75 |       console.log(`[${className}.${String(propertyName)}] ${message || 'Method called'} with args:`, args);
 76 |       const result = originalMethod.apply(this, args);
 77 |       console.log(`[${className}.${String(propertyName)}] Result:`, result);
 78 |       return result;
 79 |     };
 80 |     
 81 |     return descriptor;
 82 |   };
 83 | }
 84 | 
 85 | export function Validate(): MethodDecorator {
 86 |   return function (target: any, propertyName: string | symbol, descriptor: PropertyDescriptor) {
 87 |     const originalMethod = descriptor.value;
 88 |     
 89 |     descriptor.value = function (...args: any[]) {
 90 |       // Get validation rules from metadata
 91 |       const rules = Reflect.getMetadata(METADATA_KEYS.VALIDATION_RULES, target, propertyName) || [];
 92 |       
 93 |       for (const rule of rules) {
 94 |         if (!rule.validate(...args)) {
 95 |           throw new Error(rule.message);
 96 |         }
 97 |       }
 98 |       
 99 |       return originalMethod.apply(this, args);
100 |     };
101 |     
102 |     return descriptor;
103 |   };
104 | }
105 | 
106 | export function Cache(ttl: number = 60000): MethodDecorator {
107 |   const cache = new Map<string, { value: any; expires: number }>();
108 |   
109 |   return function (target: any, propertyName: string | symbol, descriptor: PropertyDescriptor) {
110 |     const originalMethod = descriptor.value;
111 |     
112 |     descriptor.value = function (...args: any[]) {
113 |       const cacheKey = `${target.constructor.name}.${String(propertyName)}:${JSON.stringify(args)}`;
114 |       const cached = cache.get(cacheKey);
115 |       
116 |       if (cached && Date.now() < cached.expires) {
117 |         console.log(`Cache hit for ${cacheKey}`);
118 |         return cached.value;
119 |       }
120 |       
121 |       const result = originalMethod.apply(this, args);
122 |       cache.set(cacheKey, { value: result, expires: Date.now() + ttl });
123 |       console.log(`Cache set for ${cacheKey}`);
124 |       
125 |       return result;
126 |     };
127 |     
128 |     return descriptor;
129 |   };
130 | }
131 | 
132 | export function Retry(maxAttempts: number = 3, delay: number = 1000): MethodDecorator {
133 |   return function (target: any, propertyName: string | symbol, descriptor: PropertyDescriptor) {
134 |     const originalMethod = descriptor.value;
135 |     
136 |     descriptor.value = async function (...args: any[]) {
137 |       for (let attempt = 1; attempt <= maxAttempts; attempt++) {
138 |         try {
139 |           return await originalMethod.apply(this, args);
140 |         } catch (error) {
141 |           if (attempt === maxAttempts) {
142 |             throw error;
143 |           }
144 |           
145 |           console.log(`Attempt ${attempt} failed, retrying in ${delay}ms...`);
146 |           await new Promise(resolve => setTimeout(resolve, delay * attempt));
147 |         }
148 |       }
149 |     };
150 |     
151 |     return descriptor;
152 |   };
153 | }
154 | 
155 | export function RequireRole(role: string): MethodDecorator {
156 |   return function (target: any, propertyName: string | symbol, descriptor: PropertyDescriptor) {
157 |     Reflect.defineMetadata(METADATA_KEYS.REQUIRED_ROLE, role, target, propertyName);
158 |     
159 |     const originalMethod = descriptor.value;
160 |     
161 |     descriptor.value = function (...args: any[]) {
162 |       const userRole = (this as any).currentUserRole;
163 |       const requiredRole = Reflect.getMetadata(METADATA_KEYS.REQUIRED_ROLE, target, propertyName);
164 |       
165 |       if (!userRole || userRole !== requiredRole) {
166 |         throw new Error(`Access denied. Required role: ${requiredRole}, current role: ${userRole}`);
167 |       }
168 |       
169 |       return originalMethod.apply(this, args);
170 |     };
171 |     
172 |     return descriptor;
173 |   };
174 | }
175 | 
176 | // ========== Property Decorators ==========
177 | export function Column(options?: { name?: string; type?: string; nullable?: boolean }): PropertyDecorator {
178 |   return function (target: any, propertyKey: string | symbol) {
179 |     const columns = Reflect.getMetadata("entity:columns", target.constructor) || [];
180 |     columns.push({
181 |       propertyKey,
182 |       ...options
183 |     });
184 |     Reflect.defineMetadata("entity:columns", columns, target.constructor);
185 |   };
186 | }
187 | 
188 | export function Required(): PropertyDecorator {
189 |   return function (target: any, propertyKey: string | symbol) {
190 |     const required = Reflect.getMetadata("validation:required", target.constructor) || [];
191 |     required.push(propertyKey);
192 |     Reflect.defineMetadata("validation:required", required, target.constructor);
193 |   };
194 | }
195 | 
196 | export function MinLength(length: number): PropertyDecorator {
197 |   return function (target: any, propertyKey: string | symbol) {
198 |     const validations = Reflect.getMetadata("validation:rules", target.constructor) || {};
199 |     validations[propertyKey] = validations[propertyKey] || [];
200 |     validations[propertyKey].push({
201 |       type: "minLength",
202 |       value: length,
203 |       message: `${String(propertyKey)} must be at least ${length} characters long`
204 |     });
205 |     Reflect.defineMetadata("validation:rules", validations, target.constructor);
206 |   };
207 | }
208 | 
209 | export function Max(value: number): PropertyDecorator {
210 |   return function (target: any, propertyKey: string | symbol) {
211 |     const validations = Reflect.getMetadata("validation:rules", target.constructor) || {};
212 |     validations[propertyKey] = validations[propertyKey] || [];
213 |     validations[propertyKey].push({
214 |       type: "max",
215 |       value: value,
216 |       message: `${String(propertyKey)} must not exceed ${value}`
217 |     });
218 |     Reflect.defineMetadata("validation:rules", validations, target.constructor);
219 |   };
220 | }
221 | 
222 | export function SerializableProperty(alias?: string): PropertyDecorator {
223 |   return function (target: any, propertyKey: string | symbol) {
224 |     const serializableProps = Reflect.getMetadata("serializable:properties", target.constructor) || [];
225 |     serializableProps.push(propertyKey);
226 |     Reflect.defineMetadata("serializable:properties", serializableProps, target.constructor);
227 |     
228 |     if (alias) {
229 |       const aliases = Reflect.getMetadata("serializable:aliases", target.constructor) || {};
230 |       aliases[propertyKey] = alias;
231 |       Reflect.defineMetadata("serializable:aliases", aliases, target.constructor);
232 |     }
233 |   };
234 | }
235 | 
236 | export function Computed(): PropertyDecorator {
237 |   return function (target: any, propertyKey: string | symbol) {
238 |     const computed = Reflect.getMetadata("computed:properties", target.constructor) || [];
239 |     computed.push(propertyKey);
240 |     Reflect.defineMetadata("computed:properties", computed, target.constructor);
241 |   };
242 | }
243 | 
244 | // ========== Parameter Decorators ==========
245 | export function Inject(token?: string): ParameterDecorator {
246 |   return function (target: any, propertyKey: string | symbol | undefined, parameterIndex: number) {
247 |     const existingTokens = Reflect.getMetadata("inject:tokens", target) || [];
248 |     existingTokens[parameterIndex] = token;
249 |     Reflect.defineMetadata("inject:tokens", existingTokens, target);
250 |   };
251 | }
252 | 
253 | export function ValidateParam(validator: (value: any) => boolean, message: string): ParameterDecorator {
254 |   return function (target: any, propertyKey: string | symbol | undefined, parameterIndex: number) {
255 |     const existingRules = Reflect.getMetadata(METADATA_KEYS.VALIDATION_RULES, target, propertyKey) || [];
256 |     existingRules.push({
257 |       parameterIndex,
258 |       validate: (args: any[]) => validator(args[parameterIndex]),
259 |       message
260 |     });
261 |     Reflect.defineMetadata(METADATA_KEYS.VALIDATION_RULES, existingRules, target, propertyKey);
262 |   };
263 | }
264 | 
265 | // ========== Accessor Decorators ==========
266 | export function Getter(): MethodDecorator {
267 |   return function (target: any, propertyName: string | symbol, descriptor: PropertyDescriptor) {
268 |     Reflect.defineMetadata("accessor:type", "getter", target, propertyName);
269 |     return descriptor;
270 |   };
271 | }
272 | 
273 | export function Setter(): MethodDecorator {
274 |   return function (target: any, propertyName: string | symbol, descriptor: PropertyDescriptor) {
275 |     Reflect.defineMetadata("accessor:type", "setter", target, propertyName);
276 |     return descriptor;
277 |   };
278 | }
279 | 
280 | // ========== Utility Functions for Metadata ==========
281 | export class MetadataReader {
282 |   static getClassMetadata<T>(target: any, key: string | symbol): T | undefined {
283 |     return Reflect.getMetadata(key, target);
284 |   }
285 | 
286 |   static getMethodMetadata<T>(target: any, method: string, key: string | symbol): T | undefined {
287 |     return Reflect.getMetadata(key, target, method);
288 |   }
289 | 
290 |   static getPropertyMetadata<T>(target: any, property: string, key: string | symbol): T | undefined {
291 |     return Reflect.getMetadata(key, target, property);
292 |   }
293 | 
294 |   static getAllMethodNames(target: any): string[] {
295 |     const methods: string[] = [];
296 |     let current = target.prototype;
297 |     
298 |     while (current && current !== Object.prototype) {
299 |       const names = Object.getOwnPropertyNames(current);
300 |       for (const name of names) {
301 |         if (name !== 'constructor' && typeof current[name] === 'function' && !methods.includes(name)) {
302 |           methods.push(name);
303 |         }
304 |       }
305 |       current = Object.getPrototypeOf(current);
306 |     }
307 |     
308 |     return methods;
309 |   }
310 | 
311 |   static getValidationRules(target: any): any {
312 |     return Reflect.getMetadata("validation:rules", target) || {};
313 |   }
314 | 
315 |   static getInjectableInfo(target: any): boolean {
316 |     return Reflect.getMetadata(METADATA_KEYS.INJECTABLE, target) || false;
317 |   }
318 | }
319 | 
320 | // ========== Example Classes Using Decorators ==========
321 | @Entity("users")
322 | @Injectable()
323 | @Serializable()
324 | export class User {
325 |   @Column({ name: "id", type: "integer" })
326 |   @Required()
327 |   @SerializableProperty()
328 |   public id!: number;
329 | 
330 |   @Column({ name: "username", type: "varchar" })
331 |   @Required()
332 |   @MinLength(3)
333 |   @SerializableProperty()
334 |   public username!: string;
335 | 
336 |   @Column({ name: "email", type: "varchar" })
337 |   @Required()
338 |   @SerializableProperty("emailAddress")
339 |   public email!: string;
340 | 
341 |   @Column({ name: "age", type: "integer" })
342 |   @Max(120)
343 |   @SerializableProperty()
344 |   public age!: number;
345 | 
346 |   private password!: string;
347 |   public currentUserRole?: string;
348 | 
349 |   constructor(id: number, username: string, email: string, age: number) {
350 |     this.id = id;
351 |     this.username = username;
352 |     this.email = email;
353 |     this.age = age;
354 |   }
355 | 
356 |   @Log("Getting user info")
357 |   @Cache(30000)
358 |   public getInfo(): string {
359 |     return `User: ${this.username} (${this.email})`;
360 |   }
361 | 
362 |   @Validate()
363 |   public updateAge(
364 |     @ValidateParam((value: number) => value > 0 && value <= 120, "Age must be between 1 and 120")
365 |     newAge: number
366 |   ): void {
367 |     this.age = newAge;
368 |   }
369 | 
370 |   @RequireRole("admin")
371 |   public deleteUser(): string {
372 |     return `User ${this.username} has been deleted`;
373 |   }
374 | 
375 |   @Retry(3, 1000)
376 |   public async syncWithExternalService(): Promise<string> {
377 |     // Simulate an operation that might fail
378 |     if (Math.random() > 0.7) {
379 |       throw new Error("External service unavailable");
380 |     }
381 |     return "Sync completed successfully";
382 |   }
383 | 
384 |   @Computed()
385 |   public get isAdult(): boolean {
386 |     return this.age >= 18;
387 |   }
388 | }
389 | 
390 | @Component({ selector: "user-service", template: "<div>User Service</div>" })
391 | export class UserService {
392 |   constructor(
393 |     @Inject("userRepository") private userRepo: any,
394 |     @Inject("logger") private logger: any
395 |   ) {}
396 | 
397 |   @Log("Finding user by ID")
398 |   public async findById(id: number): Promise<User | null> {
399 |     // Simulate database lookup
400 |     await new Promise(resolve => setTimeout(resolve, 100));
401 |     return new User(id, `user${id}`, `user${id}@example.com`, 25);
402 |   }
403 | }
404 | 
405 | // ========== Validation Engine ==========
406 | export class ValidationEngine {
407 |   static validate(instance: any): { valid: boolean; errors: string[] } {
408 |     const errors: string[] = [];
409 |     const constructor = instance.constructor;
410 |     
411 |     // Check required properties
412 |     const required = Reflect.getMetadata("validation:required", constructor) || [];
413 |     for (const prop of required) {
414 |       if (instance[prop] === undefined || instance[prop] === null) {
415 |         errors.push(`${prop} is required`);
416 |       }
417 |     }
418 |     
419 |     // Check validation rules
420 |     const rules = Reflect.getMetadata("validation:rules", constructor) || {};
421 |     for (const [prop, propRules] of Object.entries(rules)) {
422 |       const value = instance[prop];
423 |       for (const rule of (propRules as any[])) {
424 |         if (rule.type === "minLength" && typeof value === "string" && value.length < rule.value) {
425 |           errors.push(rule.message);
426 |         }
427 |         if (rule.type === "max" && typeof value === "number" && value > rule.value) {
428 |           errors.push(rule.message);
429 |         }
430 |       }
431 |     }
432 |     
433 |     return {
434 |       valid: errors.length === 0,
435 |       errors
436 |     };
437 |   }
438 | }
439 | 
440 | // ========== Usage Examples ==========
441 | export const decoratorExamples = {
442 |   // Create a user instance
443 |   user: new User(1, "john_doe", "[email protected]", 30),
444 |   
445 |   // Validation examples
446 |   validateUser: (user: User) => ValidationEngine.validate(user),
447 |   
448 |   // Metadata reader examples
449 |   getEntityInfo: (target: any) => ({
450 |     tableName: MetadataReader.getClassMetadata(target, "entity:table"),
451 |     columns: MetadataReader.getClassMetadata(target, "entity:columns"),
452 |     isInjectable: MetadataReader.getInjectableInfo(target)
453 |   }),
454 |   
455 |   // Service instance
456 |   userService: new UserService("mockUserRepo", "mockLogger")
457 | };
458 | 
459 | // Example usage of the decorated user
460 | decoratorExamples.user.currentUserRole = "admin";
461 | 
462 | // This will use caching
463 | console.log(decoratorExamples.user.getInfo());
464 | 
465 | // This will validate the parameter
466 | try {
467 |   decoratorExamples.user.updateAge(25);
468 | } catch (error) {
469 |   console.error("Validation error:", error);
470 | }
471 | 
472 | // Get metadata about the User class
473 | console.log("User metadata:", decoratorExamples.getEntityInfo(User));
```
Page 8/18FirstPrevNextLast