project-brain 0.6.1 → 0.9.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/README.md CHANGED
@@ -10,7 +10,7 @@ project-brain indexes your project files into a local LanceDB vector store using
10
10
  # 1. Install globally
11
11
  bun install -g project-brain
12
12
 
13
- # 2. One-time: register in your AI tools (Claude, Codex, Cursor, Gemini)
13
+ # 2. One-time: register in your AI tools (Claude, Codex, Cursor, Gemini, Windsurf, Zed, VS Code)
14
14
  project-brain setup
15
15
 
16
16
  # 3. Per-project: initialize, index, and install git hook
@@ -61,7 +61,7 @@ Run commands directly from your terminal in any project directory.
61
61
 
62
62
  ### Inside AI tools (slash commands)
63
63
 
64
- Once `project-brain setup` has registered the MCP server in your AI tool, you can invoke commands as slash commands from within Claude Code, Codex, Cursor, or any MCP-compatible AI:
64
+ Once `project-brain setup` has registered the MCP server in your AI tool, you can invoke commands as slash commands from within Claude Code, Codex, Cursor, Windsurf, Zed, VS Code, or any MCP-compatible AI:
65
65
 
66
66
  | Slash command | Equivalent CLI | What it does |
67
67
  |---|---|---|
@@ -84,6 +84,12 @@ Once connected over MCP, AI assistants get these tools. The server also injects
84
84
  | `search_context` | Semantic/conceptual lookup. Returns ranked snippets, each with a `chunk_id`. **Primary** for fuzzy/cross-file questions ("how does X work"). |
85
85
  | `expand_context` | Full body of a `chunk_id` from `search_context` — read this instead of re-reading whole files. |
86
86
 
87
+ ### Lexical (keyword — no embeddings needed)
88
+
89
+ | Tool | What it does |
90
+ |---|---|
91
+ | `search_code` | Exact/keyword full-text search (BM25) over indexed code — identifiers, error strings, exact phrases. Works offline without Ollama. Not regex. |
92
+
87
93
  ### Structural (AST graph — exact, no embeddings needed)
88
94
 
89
95
  | Tool | What it does |
@@ -92,6 +98,8 @@ Once connected over MCP, AI assistants get these tools. The server also injects
92
98
  | `find_callers` | Every symbol that calls the named symbol (who depends on X). |
93
99
  | `find_callees` | Every symbol the named symbol calls (what X depends on). |
94
100
  | `impact` | Blast radius — all symbols transitively affected if the named symbol changes (reverse call graph, bounded by `maxDepth`). |
101
+ | `trace_path` | Shortest call path between two symbols (how does A reach B) — ordered caller→callee chain. |
102
+ | `repo_map` | Token-budgeted overview of the most important symbols in the codebase, ranked by PageRank over the call graph. Use for repo orientation / where to start reading. |
95
103
 
96
104
  ### Modules & knowledge
97
105
 
@@ -102,8 +110,13 @@ Once connected over MCP, AI assistants get these tools. The server also injects
102
110
  | `add_knowledge` | Persist a note/decision into the brain for future sessions. |
103
111
  | `delete_knowledge` | Remove chunks by source (deleted/renamed files). |
104
112
  | `check_health` | Embedding service + index status; run if results look empty or stale. |
113
+ | `list_projects` | List every indexed project with chunk counts and embedding meta. |
114
+ | `delete_project` | Delete an entire indexed project's vector index + metadata (never touches its `.project-brain/` directory). |
115
+ | `manage_adr` | Create or list Architecture Decision Records. Append-only: supersede by creating a new ADR with `supersedes:<slug>`. |
116
+ | `get_architecture` | One-call project summary: detected tech stack, indexed modules, chunk count, and symbol count. |
117
+ | `sync_project` | Re-index changed files now (incremental, hash-gated). Streams progress via MCP notifications when the client supplies a `progressToken`. Use when results look stale. |
105
118
 
106
- Routing: exact symbol → `find_symbol`; who-calls → `find_callers`; what-it-calls → `find_callees`; "what breaks if I change X" → `impact`; fuzzy/conceptual → `search_context` then `expand_context`. The canonical tool list lives in `src/constants.ts` (`TOOL_CATALOG`) and is rendered into both the MCP server instructions and the per-project `CLAUDE.md`.
119
+ Routing: exact symbol → `find_symbol`; who-calls → `find_callers`; what-it-calls → `find_callees`; "what breaks if I change X" → `impact`; "how does A end up calling B" → `trace_path`; fuzzy/conceptual → `search_context` then `expand_context`; exact string/identifier you can type verbatim → `search_code`. The canonical tool list lives in `src/constants.ts` (`TOOL_CATALOG`) and is rendered into both the MCP server instructions and the per-project `CLAUDE.md`.
107
120
 
108
121
  ## Recipes — get the most out of it
109
122
 
@@ -120,7 +133,7 @@ You talk to your **AI assistant** in natural language; it picks the right tool.
120
133
 
121
134
  Tips to maximize value:
122
135
 
123
- - **Structural tools work without Ollama.** `find_symbol` / `find_callers` / `find_callees` / `impact` query the local SQLite graph — exact-symbol and call-graph answers work even with embeddings unavailable. Only semantic `search_context` needs Ollama.
136
+ - **Structural and lexical tools work without Ollama.** `find_symbol` / `find_callers` / `find_callees` / `impact` / `trace_path` query the local SQLite graph, and `search_code` queries the local FTS index — all work even with embeddings unavailable. `search_context` itself degrades gracefully too: with no Ollama it falls back to a BM25 lexical floor (code-aware query expansion over the local FTS index) and marks the result `degraded: true, mode: "lexical"` instead of failing — conceptual recall is reduced, so start Ollama for full semantic search when you can.
124
137
  - **Keep the index fresh automatically.** The git hook re-syncs on commit and the file watcher re-indexes on save while `serve` runs — no manual step. Run `project-brain sync` after big external changes.
125
138
  - **Prefer `expand_context` over re-reading files.** `search_context` returns a `chunk_id`; expanding it is cheaper than the assistant reading the whole file.
126
139
  - **Lead with the exact name when you have it.** "find_symbol X" / "who calls X" is faster and more precise than a semantic search.
@@ -130,7 +143,7 @@ Tips to maximize value:
130
143
 
131
144
  ### `setup`
132
145
 
133
- One-time global setup. Detects your environment and registers project-brain with AI tools (Claude, Cursor, Gemini, Codex).
146
+ One-time global setup. Detects your environment and registers project-brain with AI tools (Claude, Cursor, Gemini, Codex, Windsurf, Zed, VS Code).
134
147
 
135
148
  ```bash
136
149
  project-brain setup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-brain",
3
- "version": "0.6.1",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "Local-first MCP server that gives AI tools semantic memory of your codebase.",
6
6
  "author": "jcsoftdev",
@@ -30,9 +30,10 @@
30
30
  "scripts": {
31
31
  "dev": "bun run src/cli.ts",
32
32
  "test": "bun test",
33
+ "typecheck": "tsc --noEmit",
33
34
  "setup": "bun run src/cli.ts setup",
34
35
  "init": "bun run src/cli.ts init",
35
- "build": "bun build ./src/cli.ts --compile --outfile dist/project-brain"
36
+ "build": "bun build ./src/cli.ts ./src/parser/worker.ts --compile --outfile dist/project-brain"
36
37
  },
37
38
  "dependencies": {
38
39
  "@lancedb/lancedb": "^0.30.0",
@@ -42,11 +43,11 @@
42
43
  "zod": "^4.4.3"
43
44
  },
44
45
  "optionalDependencies": {
45
- "project-brain-darwin-arm64": "0.6.1",
46
- "project-brain-linux-x64": "0.6.1",
47
- "project-brain-linux-arm64": "0.6.1",
48
- "project-brain-windows-x64": "0.6.1",
49
- "project-brain-windows-arm64": "0.6.1"
46
+ "project-brain-darwin-arm64": "0.9.0",
47
+ "project-brain-linux-x64": "0.9.0",
48
+ "project-brain-linux-arm64": "0.9.0",
49
+ "project-brain-windows-x64": "0.9.0",
50
+ "project-brain-windows-arm64": "0.9.0"
50
51
  },
51
52
  "devDependencies": {
52
53
  "@types/bun": "latest",
@@ -0,0 +1,13 @@
1
+ # Module: {{name}}
2
+
3
+ ## Purpose
4
+
5
+ ## Key Files
6
+
7
+ ## Dependencies
8
+
9
+ ## Data Flow
10
+
11
+ ## Gotchas
12
+
13
+ ## Last Updated
@@ -0,0 +1,17 @@
1
+ # Project: {{projectId}}
2
+
3
+ This project is indexed with [project-brain](https://github.com/jcsoftdev/project-brain).
4
+
5
+ ## project-brain MCP
6
+
7
+ You have access to the `project-brain` MCP server for codebase knowledge retrieval.
8
+
9
+ {{tools}}
10
+
11
+ When answering questions about this codebase, run `search_context` first to find semantically relevant context before reading files directly — and reach for the structural tools when you know the exact symbol, caller, or want the impact of a change.
12
+
13
+ ### Project Context
14
+
15
+ - **Project ID**: {{projectId}}
16
+ - **Stack**: {{stack}}
17
+ {{modules}}
@@ -0,0 +1,7 @@
1
+ ## project-brain MCP
2
+
3
+ You have access to the `project-brain` MCP server for codebase knowledge retrieval.
4
+
5
+ {{tools}}
6
+
7
+ When answering questions about the codebase, run `search_context` first for fuzzy/conceptual questions, and use the structural tools (`find_symbol`/`find_callers`/`find_callees`/`impact`) for exact symbols, callers, and change impact — before reading files directly.
@@ -0,0 +1,7 @@
1
+ ## project-brain MCP
2
+
3
+ You have access to `project-brain` MCP tools for codebase knowledge.
4
+
5
+ {{tools}}
6
+
7
+ Prefer `search_context` over direct file reads for fuzzy/conceptual questions; use the structural tools for exact symbols, callers, and change impact.
@@ -0,0 +1,7 @@
1
+ ## project-brain MCP
2
+
3
+ You have access to `project-brain` MCP tools for codebase knowledge retrieval.
4
+
5
+ {{tools}}
6
+
7
+ When answering codebase questions, prefer `search_context` for fuzzy/conceptual lookups and the structural tools for exact symbols, callers, and change impact — faster and more precise than reading files directly.