purecontext-mcp 1.2.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT_INSTRUCTIONS.md +110 -784
- package/AGENT_REFERENCE.md +561 -0
- package/CHANGELOG.md +177 -6
- package/FRAMEWORK-ADAPTERS.md +351 -0
- package/LANGUAGE-SUPPORT.md +144 -0
- package/README.md +92 -12
- package/USER-GUIDE.md +8 -0
- package/dist/cli/hooks.d.ts +28 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +570 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/install-detect.d.ts +16 -0
- package/dist/cli/install-detect.d.ts.map +1 -0
- package/dist/cli/install-detect.js +70 -0
- package/dist/cli/install-detect.js.map +1 -0
- package/dist/cli/install-writers.d.ts +59 -0
- package/dist/cli/install-writers.d.ts.map +1 -0
- package/dist/cli/install-writers.js +292 -0
- package/dist/cli/install-writers.js.map +1 -0
- package/dist/cli/install.d.ts +14 -0
- package/dist/cli/install.d.ts.map +1 -0
- package/dist/cli/install.js +150 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/config/config-loader.js +3 -0
- package/dist/config/config-loader.js.map +1 -1
- package/dist/config/config-schema.d.ts +11 -0
- package/dist/config/config-schema.d.ts.map +1 -1
- package/dist/config/config-schema.js +15 -0
- package/dist/config/config-schema.js.map +1 -1
- package/dist/core/db/symbol-store.d.ts +1 -0
- package/dist/core/db/symbol-store.d.ts.map +1 -1
- package/dist/core/db/symbol-store.js +120 -6
- package/dist/core/db/symbol-store.js.map +1 -1
- package/dist/core/file-discovery.d.ts +6 -0
- package/dist/core/file-discovery.d.ts.map +1 -1
- package/dist/core/file-discovery.js +20 -13
- package/dist/core/file-discovery.js.map +1 -1
- package/dist/core/file-processor.d.ts.map +1 -1
- package/dist/core/file-processor.js +26 -1
- package/dist/core/file-processor.js.map +1 -1
- package/dist/core/git-log-reader.d.ts.map +1 -1
- package/dist/core/git-log-reader.js +21 -0
- package/dist/core/git-log-reader.js.map +1 -1
- package/dist/core/index-manager.d.ts.map +1 -1
- package/dist/core/index-manager.js +21 -7
- package/dist/core/index-manager.js.map +1 -1
- package/dist/core/indexing-worker.d.ts.map +1 -1
- package/dist/core/indexing-worker.js +14 -0
- package/dist/core/indexing-worker.js.map +1 -1
- package/dist/core/parse-dispatcher.d.ts.map +1 -1
- package/dist/core/parse-dispatcher.js +20 -5
- package/dist/core/parse-dispatcher.js.map +1 -1
- package/dist/core/search/query-preprocessor.d.ts +69 -3
- package/dist/core/search/query-preprocessor.d.ts.map +1 -1
- package/dist/core/search/query-preprocessor.js +450 -17
- package/dist/core/search/query-preprocessor.js.map +1 -1
- package/dist/core/search/relevance-ranker.d.ts +60 -5
- package/dist/core/search/relevance-ranker.d.ts.map +1 -1
- package/dist/core/search/relevance-ranker.js +931 -33
- package/dist/core/search/relevance-ranker.js.map +1 -1
- package/dist/core/test-mapper.d.ts.map +1 -1
- package/dist/core/test-mapper.js +7 -1
- package/dist/core/test-mapper.js.map +1 -1
- package/dist/core/types.d.ts +28 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/handlers/angular-html.d.ts +3 -0
- package/dist/handlers/angular-html.d.ts.map +1 -0
- package/dist/handlers/angular-html.js +215 -0
- package/dist/handlers/angular-html.js.map +1 -0
- package/dist/handlers/c.d.ts.map +1 -1
- package/dist/handlers/c.js +19 -0
- package/dist/handlers/c.js.map +1 -1
- package/dist/handlers/cpp-macro-registry.d.ts +21 -0
- package/dist/handlers/cpp-macro-registry.d.ts.map +1 -0
- package/dist/handlers/cpp-macro-registry.js +44 -0
- package/dist/handlers/cpp-macro-registry.js.map +1 -0
- package/dist/handlers/cpp.d.ts.map +1 -1
- package/dist/handlers/cpp.js +579 -10
- package/dist/handlers/cpp.js.map +1 -1
- package/dist/handlers/csharp.d.ts.map +1 -1
- package/dist/handlers/csharp.js +39 -2
- package/dist/handlers/csharp.js.map +1 -1
- package/dist/handlers/css.d.ts +3 -0
- package/dist/handlers/css.d.ts.map +1 -0
- package/dist/handlers/css.js +154 -0
- package/dist/handlers/css.js.map +1 -0
- package/dist/handlers/erlang.d.ts.map +1 -1
- package/dist/handlers/erlang.js +8 -1
- package/dist/handlers/erlang.js.map +1 -1
- package/dist/handlers/fortran.js +1 -1
- package/dist/handlers/fortran.js.map +1 -1
- package/dist/handlers/go.d.ts.map +1 -1
- package/dist/handlers/go.js +87 -2
- package/dist/handlers/go.js.map +1 -1
- package/dist/handlers/handler-registry.d.ts.map +1 -1
- package/dist/handlers/handler-registry.js +4 -0
- package/dist/handlers/handler-registry.js.map +1 -1
- package/dist/handlers/hcl.d.ts +3 -0
- package/dist/handlers/hcl.d.ts.map +1 -0
- package/dist/handlers/hcl.js +193 -0
- package/dist/handlers/hcl.js.map +1 -0
- package/dist/handlers/java.d.ts.map +1 -1
- package/dist/handlers/java.js +33 -16
- package/dist/handlers/java.js.map +1 -1
- package/dist/handlers/kotlin.d.ts.map +1 -1
- package/dist/handlers/kotlin.js +48 -3
- package/dist/handlers/kotlin.js.map +1 -1
- package/dist/handlers/less.d.ts +3 -0
- package/dist/handlers/less.d.ts.map +1 -0
- package/dist/handlers/less.js +255 -0
- package/dist/handlers/less.js.map +1 -0
- package/dist/handlers/objective-c.d.ts.map +1 -1
- package/dist/handlers/objective-c.js +122 -64
- package/dist/handlers/objective-c.js.map +1 -1
- package/dist/handlers/openapi.d.ts.map +1 -1
- package/dist/handlers/openapi.js +30 -5
- package/dist/handlers/openapi.js.map +1 -1
- package/dist/handlers/php.d.ts.map +1 -1
- package/dist/handlers/php.js +287 -41
- package/dist/handlers/php.js.map +1 -1
- package/dist/handlers/protobuf.d.ts.map +1 -1
- package/dist/handlers/protobuf.js +1 -0
- package/dist/handlers/protobuf.js.map +1 -1
- package/dist/handlers/python.d.ts.map +1 -1
- package/dist/handlers/python.js +1 -3
- package/dist/handlers/python.js.map +1 -1
- package/dist/handlers/ruby-dsl.d.ts +23 -0
- package/dist/handlers/ruby-dsl.d.ts.map +1 -0
- package/dist/handlers/ruby-dsl.js +251 -0
- package/dist/handlers/ruby-dsl.js.map +1 -0
- package/dist/handlers/ruby.d.ts.map +1 -1
- package/dist/handlers/ruby.js +29 -4
- package/dist/handlers/ruby.js.map +1 -1
- package/dist/handlers/rust.d.ts.map +1 -1
- package/dist/handlers/rust.js +98 -2
- package/dist/handlers/rust.js.map +1 -1
- package/dist/handlers/scss.d.ts +3 -0
- package/dist/handlers/scss.d.ts.map +1 -0
- package/dist/handlers/scss.js +290 -0
- package/dist/handlers/scss.js.map +1 -0
- package/dist/handlers/sql.d.ts.map +1 -1
- package/dist/handlers/sql.js +37 -18
- package/dist/handlers/sql.js.map +1 -1
- package/dist/handlers/typescript.d.ts.map +1 -1
- package/dist/handlers/typescript.js +65 -17
- package/dist/handlers/typescript.js.map +1 -1
- package/dist/handlers/xml.d.ts.map +1 -1
- package/dist/handlers/xml.js +35 -2
- package/dist/handlers/xml.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +10 -0
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/tools/detect-antipatterns.d.ts +1 -1
- package/dist/server/tools/get-architecture-snapshot.d.ts +1 -1
- package/dist/server/tools/get-entry-points.d.ts +1 -1
- package/dist/server/tools/get-lexical-scope-matches.d.ts +54 -0
- package/dist/server/tools/get-lexical-scope-matches.d.ts.map +1 -0
- package/dist/server/tools/get-lexical-scope-matches.js +470 -0
- package/dist/server/tools/get-lexical-scope-matches.js.map +1 -0
- package/dist/server/tools/search-symbols.d.ts +10 -0
- package/dist/server/tools/search-symbols.d.ts.map +1 -1
- package/dist/server/tools/search-symbols.js +353 -8
- package/dist/server/tools/search-symbols.js.map +1 -1
- package/dist/server/tools/trace-invocation-chain.d.ts +53 -0
- package/dist/server/tools/trace-invocation-chain.d.ts.map +1 -0
- package/dist/server/tools/trace-invocation-chain.js +280 -0
- package/dist/server/tools/trace-invocation-chain.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/02-installation.md +89 -17
- package/docs/05-cli-reference.md +89 -0
- package/docs/dev/benchmark-findings-eu-za-tebe.md +210 -0
- package/docs/dev/phase-35-coverage-audit.md +469 -0
- package/package.json +4 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Language Support
|
|
2
|
+
|
|
3
|
+
PureContext indexes **34 languages** out of the box, plus a small set of regex-based handlers for stylesheets. Every grammar is bundled as a WASM file — no separate install, no native compilation, no language servers to start. When you point it at a polyglot repo, all handlers run in parallel.
|
|
4
|
+
|
|
5
|
+
This page is the user-facing tour: what's supported, what gets pulled out, and what to expect from each major category. For parameter-level details (every node kind, every signature shape), see the [reference manual](docs/07-language-support.md).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## The full list
|
|
10
|
+
|
|
11
|
+
### Web and application languages
|
|
12
|
+
|
|
13
|
+
| Language | Extensions | What you get |
|
|
14
|
+
|----------|-----------|-------------|
|
|
15
|
+
| TypeScript | `.ts`, `.tsx`, `.mts`, `.cts` | functions, classes, methods, consts, types, interfaces, enums — full type annotations in signatures |
|
|
16
|
+
| JavaScript | `.js`, `.jsx`, `.mjs`, `.cjs` | functions, classes, methods, exported consts |
|
|
17
|
+
| Python | `.py` | functions, classes, methods, module-level consts — docstrings used as summaries |
|
|
18
|
+
| PHP | `.php` | functions, classes, interfaces, traits, enums, methods, properties, constants — PHP 8 attributes supported |
|
|
19
|
+
| Ruby | `.rb` | functions, classes, methods, modules, constants |
|
|
20
|
+
| Go | `.go` | functions, methods (bare names, no receiver prefix), structs, interfaces, consts, types — unexported names are skipped |
|
|
21
|
+
| Java | `.java` | classes, interfaces, enums, methods (including package-private), inner classes |
|
|
22
|
+
| Kotlin | `.kt`, `.kts` | functions, extension functions, classes, interfaces, objects, enums, typealiases — KDoc summaries |
|
|
23
|
+
| C# | `.cs` | classes, interfaces, enums, structs, records, methods, properties, consts |
|
|
24
|
+
| Scala | `.scala`, `.sc` | classes, traits, objects, case classes, functions, methods, types, enums |
|
|
25
|
+
| Dart | `.dart` | classes, mixins, extensions, enums, functions, methods — `_`-prefixed names are skipped |
|
|
26
|
+
| Swift | `.swift` | classes, structs, protocols, actors, extensions, methods, enums |
|
|
27
|
+
| Elixir | `.ex`, `.exs` | modules, functions, macros, structs, protocols |
|
|
28
|
+
| Haskell | `.hs`, `.lhs` | functions, data types, typeclasses, instances, type aliases, newtypes |
|
|
29
|
+
| Lua | `.lua` | functions, methods, consts |
|
|
30
|
+
| R | `.r`, `.R`, `.Rmd` | functions, consts, S3/S4/R6 classes — Roxygen2 doc comments |
|
|
31
|
+
| Perl | `.pl`, `.pm` | functions, packages |
|
|
32
|
+
| Groovy | `.groovy` | functions, classes, methods |
|
|
33
|
+
| Erlang | `.erl`, `.hrl` | functions, modules |
|
|
34
|
+
| Gleam | `.gleam` | functions, types |
|
|
35
|
+
|
|
36
|
+
### Systems languages
|
|
37
|
+
|
|
38
|
+
| Language | Extensions | What you get |
|
|
39
|
+
|----------|-----------|-------------|
|
|
40
|
+
| C | `.c`, `.h` | functions, structs, enums, macros, types — `static` functions skipped (translation-unit internal) |
|
|
41
|
+
| C++ | `.cpp`, `.cxx`, `.cc`, `.hpp`, `.hxx`, `.hh` | All C kinds plus namespaces, templates, template classes with export macros |
|
|
42
|
+
| Rust | `.rs` | functions, methods (bare names), structs, enums, traits, consts, types — `pub` filter for impl methods |
|
|
43
|
+
| Fortran | `.f90`, `.f95`, `.for`, `.f` | functions, subroutines, modules |
|
|
44
|
+
| Objective-C | `.m`, `.h` | functions, classes, methods |
|
|
45
|
+
|
|
46
|
+
### Scripting and game
|
|
47
|
+
|
|
48
|
+
| Language | Extensions | What you get |
|
|
49
|
+
|----------|-----------|-------------|
|
|
50
|
+
| Bash | `.sh`, `.bash` | functions |
|
|
51
|
+
| GDScript | `.gd` | functions, classes, signals |
|
|
52
|
+
|
|
53
|
+
### Infrastructure and config
|
|
54
|
+
|
|
55
|
+
| Language | Extensions | What you get |
|
|
56
|
+
|----------|-----------|-------------|
|
|
57
|
+
| Terraform / HCL | `.tf`, `.hcl` | resources, modules, variables, outputs |
|
|
58
|
+
| Nix | `.nix` | functions, attributes |
|
|
59
|
+
|
|
60
|
+
### Data and API
|
|
61
|
+
|
|
62
|
+
| Language | Extensions | What you get |
|
|
63
|
+
|----------|-----------|-------------|
|
|
64
|
+
| SQL | `.sql` | tables, views, functions, procedures |
|
|
65
|
+
| Protobuf | `.proto` | messages, services, enums, RPCs |
|
|
66
|
+
| GraphQL | `.graphql`, `.gql` | types, queries, mutations, subscriptions, fragments |
|
|
67
|
+
| OpenAPI / YAML | `.yaml`, `.yml` | endpoints, schemas (OpenAPI detected by content) |
|
|
68
|
+
| XML | `.xml` | elements (configurable patterns — opt-in) |
|
|
69
|
+
|
|
70
|
+
### Stylesheets (regex-based, no WASM grammar)
|
|
71
|
+
|
|
72
|
+
CSS-family languages don't have a stable tree-sitter grammar, so PureContext extracts a focused subset using regex. Only named, reusable constructs are indexed — plain selectors are skipped because they would flood the index with noise.
|
|
73
|
+
|
|
74
|
+
| Language | Extensions | What you get |
|
|
75
|
+
|----------|-----------|-------------|
|
|
76
|
+
| SCSS / SASS | `.scss`, `.sass` | `@mixin`, `@function`, top-level `$variables`, `%placeholders`, `@keyframes` |
|
|
77
|
+
| LESS | `.less` | `.mixin(@params)`, top-level `@variables`, `@keyframes` |
|
|
78
|
+
| CSS | `.css` | `--custom-properties` (opt-in via `indexing.cssVariables: true`) |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## What gets indexed for every language
|
|
83
|
+
|
|
84
|
+
Regardless of language, every symbol you find through `search_symbols` carries:
|
|
85
|
+
|
|
86
|
+
- **Name** — the identifier as it appears in source
|
|
87
|
+
- **Kind** — function, class, method, route, component, etc.
|
|
88
|
+
- **Byte offsets** — `startByte` / `endByte` for precise source retrieval; no need to re-read the whole file to grab a function body
|
|
89
|
+
- **Signature** — a one-line declaration with the full type information available in that language
|
|
90
|
+
- **Summary** — sourced from the docstring/JSDoc/Javadoc/Roxygen comment if present, otherwise inferred from framework context (route path, ORM table, etc.), otherwise a one-line AI summary, otherwise the signature itself
|
|
91
|
+
- **Import / dependency edges** — used by the dependency graph, blast radius, and cycle detection tools
|
|
92
|
+
|
|
93
|
+
The summary chain (docstring → framework inference → AI → signature fallback) is what makes search across an undocumented codebase still work. See [AI Summaries](AI-SUMMARIES.md) for how to enable LLM summaries on legacy projects.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## What is filtered out automatically
|
|
98
|
+
|
|
99
|
+
Some things you don't want in the index — they bloat it and pollute search results. PureContext excludes:
|
|
100
|
+
|
|
101
|
+
- Standard build and dependency directories: `node_modules/`, `.git/`, `dist/`, `build/`, `target/`, `.next/`, `.nuxt/`, `.claude/`
|
|
102
|
+
- Lock files (`*.lock`) and environment files (`.env*`)
|
|
103
|
+
- Binary files (detected by null-byte scanning of the first 8 KB — works without a hardcoded extension list)
|
|
104
|
+
- Files larger than 1 MB (raise the limit with `maxFileSizeBytes` in config)
|
|
105
|
+
- Secret files: `*.pem`, `*.key`, `id_rsa`, `credentials.json`, `serviceAccountKey*.json`
|
|
106
|
+
|
|
107
|
+
It also respects language-level visibility:
|
|
108
|
+
|
|
109
|
+
- **Go**: unexported names (lowercase first letter)
|
|
110
|
+
- **C**: `static` functions (translation-unit internal)
|
|
111
|
+
- **Java / C# / PHP**: `private` members
|
|
112
|
+
- **Dart**: `_`-prefixed names
|
|
113
|
+
|
|
114
|
+
Public API tools (`get_public_api`) rely on these rules being applied consistently — they assume the index already reflects what is externally visible.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Known limitations
|
|
119
|
+
|
|
120
|
+
- **TypeScript `.tsx`** uses a separate `tree-sitter-tsx` grammar from `.ts`. Both are bundled.
|
|
121
|
+
- **Python stubs** (`.pyi`) are not indexed — only `.py` files.
|
|
122
|
+
- **Terraform** `dynamic` blocks with complex expressions may not be fully extracted.
|
|
123
|
+
- **XML** element extraction uses configurable patterns rather than indexing every tag — turn it on per project if you need it.
|
|
124
|
+
- **CSS** custom properties (`--foo`) are off by default; enable with `indexing.cssVariables: true` when you have a design system worth indexing.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Adding a new language
|
|
129
|
+
|
|
130
|
+
If a grammar you care about is missing, the path to support is straightforward:
|
|
131
|
+
|
|
132
|
+
1. Add a new file in `src/handlers/`, implementing `LanguageHandler`
|
|
133
|
+
2. Bundle the `.wasm` grammar in `grammars/`
|
|
134
|
+
3. Register the handler in the language dispatcher
|
|
135
|
+
4. Add tests against fixture files in `test/handlers/`
|
|
136
|
+
|
|
137
|
+
Regex-only handlers (like SCSS) skip step 2 entirely — they return `null` from `grammarPath()`.
|
|
138
|
+
|
|
139
|
+
See `docs/25-architecture-overview.md` for the three-layer design (Core → Handlers → Adapters) and the conventions every handler follows.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
→ Full parameter-level reference: [docs/07-language-support.md](docs/07-language-support.md)
|
|
144
|
+
→ Adapter layer that adds framework-specific symbols on top: [FRAMEWORK-ADAPTERS.md](FRAMEWORK-ADAPTERS.md)
|
package/README.md
CHANGED
|
@@ -18,8 +18,12 @@ But token savings are the mechanism, not the point. The point is that AI gets be
|
|
|
18
18
|
## Quick start
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
# Connect to Claude Code (no global install needed)
|
|
21
|
+
# 1. Connect to Claude Code (no global install needed)
|
|
22
22
|
claude mcp add purecontext-mcp -- npx purecontext-mcp
|
|
23
|
+
|
|
24
|
+
# 2. Inside your project, install the workflow rules
|
|
25
|
+
# (auto-detects Claude / Cursor / Windsurf / Continue / Cline / Roo Code / VS Code / Claude Desktop)
|
|
26
|
+
npx purecontext-mcp install all
|
|
23
27
|
```
|
|
24
28
|
|
|
25
29
|
Then in a Claude Code conversation:
|
|
@@ -54,6 +58,8 @@ The guide explains what PureContext does, why each feature exists, and how to us
|
|
|
54
58
|
| [Visualizing Code Structure](VISUALIZING-CODE.md) | Mermaid/DOT diagrams, architecture snapshots |
|
|
55
59
|
| [AST-Level Search](AST-SEARCH.md) | Node types, signatures, decorators, complexity |
|
|
56
60
|
| [Code Intelligence](CODE-INTELLIGENCE.md) | Entry points, public API, TODOs, coverage |
|
|
61
|
+
| [Language Support](LANGUAGE-SUPPORT.md) | All 34 supported languages and what's extracted |
|
|
62
|
+
| [Framework Adapters](FRAMEWORK-ADAPTERS.md) | Vue, React, Django, Spring, Rails, Flutter, ORMs, and more |
|
|
57
63
|
| [Using PureContext with a Team](TEAM-SETUP.md) | Shared server, enterprise setup |
|
|
58
64
|
|
|
59
65
|
**Real-world workflows:**
|
|
@@ -77,9 +83,39 @@ You should start from docs/README.md.
|
|
|
77
83
|
|
|
78
84
|
## What it indexes
|
|
79
85
|
|
|
80
|
-
|
|
86
|
+
### Languages
|
|
87
|
+
|
|
88
|
+
**34 languages** via bundled tree-sitter WASM grammars — no separate install required.
|
|
89
|
+
|
|
90
|
+
| Category | Languages |
|
|
91
|
+
|----------|-----------|
|
|
92
|
+
| Web / Application | TypeScript, JavaScript, Python, PHP, Ruby, Go, Java, Kotlin, C#, Scala, Dart, Swift, Elixir, Haskell, Lua, R, Perl, Groovy, Erlang, Gleam |
|
|
93
|
+
| Systems | C, C++, Rust, Fortran, Objective-C |
|
|
94
|
+
| Scripting & Game | Bash, GDScript |
|
|
95
|
+
| Infrastructure & Config | Terraform / HCL, Nix |
|
|
96
|
+
| Data & API | SQL, Protobuf, GraphQL, OpenAPI / YAML, XML |
|
|
97
|
+
| Styling (regex-based) | SCSS, SASS, LESS, CSS |
|
|
98
|
+
|
|
99
|
+
→ [Language Support guide](LANGUAGE-SUPPORT.md) · [Full reference](docs/07-language-support.md)
|
|
100
|
+
|
|
101
|
+
### Frameworks
|
|
102
|
+
|
|
103
|
+
**Framework-aware extraction** — routes, components, hooks, models, ORM entities, and middleware are pulled out as first-class symbols (not just functions and classes).
|
|
104
|
+
|
|
105
|
+
| Stack | Frameworks |
|
|
106
|
+
|-------|-----------|
|
|
107
|
+
| JavaScript / TypeScript | Vue 3, React, Nuxt, Next.js (Pages + App Router), Angular, NestJS, Express, Fastify |
|
|
108
|
+
| Python | Django, FastAPI, Flask |
|
|
109
|
+
| Go | Gin, Echo, Fiber |
|
|
110
|
+
| PHP | Laravel, Symfony |
|
|
111
|
+
| Ruby | Rails, Sinatra |
|
|
112
|
+
| Java | Spring Boot, Micronaut, Quarkus |
|
|
113
|
+
| Kotlin | Ktor, Spring (Kotlin) |
|
|
114
|
+
| Rust | Axum, Actix-web, Rocket |
|
|
115
|
+
| Mobile | Flutter |
|
|
116
|
+
| ORMs | Hibernate, SQLAlchemy, Django ORM, Prisma, TypeORM |
|
|
81
117
|
|
|
82
|
-
|
|
118
|
+
→ [Framework Adapters guide](FRAMEWORK-ADAPTERS.md) · [Full reference](docs/08-framework-adapters.md)
|
|
83
119
|
|
|
84
120
|
---
|
|
85
121
|
|
|
@@ -180,22 +216,66 @@ If your team runs a shared PureContext server, connect with an HTTP transport in
|
|
|
180
216
|
|
|
181
217
|
Installing PureContext gives your agent the tools. Adding the agent instructions tells it *how* to use them — which tool to pick for each task, in what order, and what to avoid.
|
|
182
218
|
|
|
183
|
-
|
|
219
|
+
Without these instructions, an agent may default to reading entire files rather than using `search_symbols`, or may not know to call `list_repos` first to get the repository ID required by every tool.
|
|
220
|
+
|
|
221
|
+
### One-command install (recommended)
|
|
184
222
|
|
|
185
|
-
|
|
223
|
+
Run this once inside your project directory:
|
|
186
224
|
|
|
187
|
-
|
|
225
|
+
```bash
|
|
226
|
+
npx purecontext-mcp install all
|
|
227
|
+
```
|
|
188
228
|
|
|
189
|
-
|
|
229
|
+
This auto-detects which AI coding tools you have set up in the project and writes the PureContext workflow rules to the right place for each. Re-running is safe — every writer is idempotent (managed blocks are marked and replaced rather than appended).
|
|
230
|
+
|
|
231
|
+
When no `--scope` flag is given, the CLI prompts you to choose where to install:
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
Where should PureContext be installed?
|
|
235
|
+
1) Local — this project only
|
|
236
|
+
2) Global — all projects (user-level config)
|
|
237
|
+
3) Both
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Pass `--scope` to skip the prompt:
|
|
190
241
|
|
|
191
242
|
```bash
|
|
192
|
-
|
|
243
|
+
npx purecontext-mcp install all --scope=local # this project only
|
|
244
|
+
npx purecontext-mcp install all --scope=global # user-level, all projects
|
|
245
|
+
npx purecontext-mcp install all --scope=both # both places at once
|
|
193
246
|
```
|
|
194
247
|
|
|
195
|
-
|
|
248
|
+
For a single tool:
|
|
196
249
|
|
|
197
|
-
|
|
250
|
+
```bash
|
|
251
|
+
npx purecontext-mcp install <tool> --scope=global
|
|
252
|
+
```
|
|
198
253
|
|
|
199
|
-
|
|
254
|
+
To preview without writing files:
|
|
200
255
|
|
|
201
|
-
|
|
256
|
+
```bash
|
|
257
|
+
npx purecontext-mcp install all --dry-run
|
|
258
|
+
npx purecontext-mcp install --list # show which IDEs were detected
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Supported tools and where each one writes:
|
|
262
|
+
|
|
263
|
+
| Tool | Local | Global |
|
|
264
|
+
|------|-------|--------|
|
|
265
|
+
| `claude` | `CLAUDE.md` in project | `~/.claude/CLAUDE.md` + hooks |
|
|
266
|
+
| `cursor` | `.cursor/rules/purecontext.mdc` | `~/.cursor/rules/purecontext.mdc` |
|
|
267
|
+
| `windsurf` | `.windsurfrules` | `~/.windsurfrules` |
|
|
268
|
+
| `continue` | `.continue/config.json` | `~/.continue/config.json` |
|
|
269
|
+
| `cline` | `.clinerules` | local only |
|
|
270
|
+
| `roo-code` | `.roo/rules-code.md` | local only |
|
|
271
|
+
| `vscode` | `.github/copilot-instructions.md` | local only |
|
|
272
|
+
| `claude-desktop` | always global | always global |
|
|
273
|
+
|
|
274
|
+
### Manual install
|
|
275
|
+
|
|
276
|
+
If you'd rather paste the rules yourself, two instruction files are at the repository root:
|
|
277
|
+
|
|
278
|
+
- **`AGENT_INSTRUCTIONS_SHORT.md`** — ~2 KB. Mandatory workflow, tool selection table, core rules.
|
|
279
|
+
- **`AGENT_INSTRUCTIONS.md`** — ~15 KB. Adds parameter notes, decision trees, anti-patterns.
|
|
280
|
+
|
|
281
|
+
Paste the contents into whatever system prompt, memory, or rules configuration your agent uses.
|
package/USER-GUIDE.md
CHANGED
|
@@ -46,6 +46,14 @@ For parameter-level documentation — every tool input, output, and flag — see
|
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
|
+
## Language and framework coverage
|
|
50
|
+
|
|
51
|
+
- [Language Support](LANGUAGE-SUPPORT.md) — All 34 supported languages plus regex-based stylesheet handlers: what's extracted, what's filtered, and known limitations
|
|
52
|
+
|
|
53
|
+
- [Framework Adapters](FRAMEWORK-ADAPTERS.md) — Routes, components, and ORM entities pulled out as first-class symbols for Vue, React, Nuxt, Next.js, Angular, NestJS, Django, FastAPI, Flask, Spring Boot, Rails, Laravel, Flutter, and more
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
49
57
|
## For teams and enterprise
|
|
50
58
|
|
|
51
59
|
- [Using PureContext with a Team](team-setup.md) — Why a shared server is fundamentally different from local use, how to set it up, how to keep the index current automatically, and what enterprise deployments need to consider
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `purecontext-mcp hooks --install` / `hooks --list`
|
|
3
|
+
* `purecontext-mcp hook-pretooluse|hook-posttooluse|hook-precompact|hook-worktree-create|hook-worktree-remove`
|
|
4
|
+
*
|
|
5
|
+
* Merges hook entries into ~/.claude/settings.json using CLI-style commands
|
|
6
|
+
* (npx purecontext-mcp hook-*) so no scripts need to be copied to ~/.claude/hooks/.
|
|
7
|
+
* Also injects PureContext agent instructions into ~/.claude/CLAUDE.md.
|
|
8
|
+
*/
|
|
9
|
+
export declare function cmdHooksInstall(): void;
|
|
10
|
+
export declare function cmdHooksList(): void;
|
|
11
|
+
export declare function mergeSettings(): void;
|
|
12
|
+
export declare function injectClaudeMd(): void;
|
|
13
|
+
/** PreToolUse: warn before Edit/Write/MultiEdit. */
|
|
14
|
+
export declare function cmdHookPreToolUse(): Promise<void>;
|
|
15
|
+
/** PostToolUse: re-index the repo after Edit/Write/MultiEdit. */
|
|
16
|
+
export declare function cmdHookPostToolUse(): Promise<void>;
|
|
17
|
+
/** PreCompact: inject session snapshot before context compaction. */
|
|
18
|
+
export declare function cmdHookPreCompact(): Promise<void>;
|
|
19
|
+
/** WorktreeCreate: auto-index a new agent worktree. */
|
|
20
|
+
export declare function cmdHookWorktreeCreate(): Promise<void>;
|
|
21
|
+
/** WorktreeRemove: fires when an agent worktree is removed. No-op for now. */
|
|
22
|
+
export declare function cmdHookWorktreeRemove(): Promise<void>;
|
|
23
|
+
/** TaskCompleted: surface post-task diagnostics and remind about available tools. */
|
|
24
|
+
export declare function cmdHookTaskCompleted(): Promise<void>;
|
|
25
|
+
/** SubagentStart: inject condensed repo orientation for spawned subagents. */
|
|
26
|
+
export declare function cmdHookSubagentStart(): Promise<void>;
|
|
27
|
+
export declare function runHooksCommand(args: string[]): void;
|
|
28
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/cli/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0IH,wBAAgB,eAAe,IAAI,IAAI,CAetC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAenC;AAID,wBAAgB,aAAa,IAAI,IAAI,CAoDpC;AA6BD,wBAAgB,cAAc,IAAI,IAAI,CAuBrC;AAuCD,oDAAoD;AACpD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAoBvD;AAED,iEAAiE;AACjE,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CA8BxD;AA6DD,qEAAqE;AACrE,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAgBvD;AAED,uDAAuD;AACvD,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAkB3D;AAED,8EAA8E;AAC9E,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAG3D;AAyED,qFAAqF;AACrF,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAwC1D;AAED,8EAA8E;AAC9E,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CA8C1D;AAID,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAUpD"}
|