project-brain 0.48.0 → 0.48.2

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
@@ -1,10 +1,25 @@
1
1
  # project-brain
2
2
 
3
- Local-first MCP server that gives AI tools semantic memory of your codebase.
3
+ A local-first context layer for AI coding assistants: it knows your codebase, keeps the reasoning behind it, and shapes what the assistant reads, does and spends in every session.
4
+
5
+ It started as semantic memory of a codebase, and that is still the core. Around it, project-brain now runs the rest of the session: it picks the context and skills each prompt needs, drops the ones it does not, guards edits and commits against your own rules, isolates parallel work in worktrees, and keeps the machine and the index tidy.
4
6
 
5
7
  The whole Claude Code flow on one page (every piece, how to turn it off, what leaves the machine, troubleshooting): [docs/flow-map.md](docs/flow-map.md).
6
8
 
7
- project-brain indexes your project files into a local LanceDB vector store using Ollama embeddings, and builds a SQLite **structural graph** (symbols + call edges) with a WASM tree-sitter parser. Once indexed, AI assistants connected via MCP can search your codebase **semantically** (by meaning) AND **structurally** (exact symbols, callers/callees, change blast-radius), track module documentation, and maintain knowledge that persists across sessions.
9
+ ## What it does
10
+
11
+ | Area | What you get | Read more |
12
+ |---|---|---|
13
+ | **Codebase memory** | Semantic search by meaning (LanceDB + Ollama embeddings), keyword search (BM25), and a structural graph from tree-sitter: symbols, callers, callees, blast radius, call paths, a ranked repo map. Structural and keyword search work with no model at all. | [MCP Tools](#mcp-tools), [Structural commands](#structural--lexical-commands-find-callers-callees-impact-trace-map-code) |
14
+ | **Knowledge, the *why*** | An Open Knowledge Format bundle for decisions, constraints and traps, audited against the code graph so stale or broken knowledge fails CI. Module docs refresh from each commit. | [`okf`](#okf--knowledge-bundles-the-why-not-the-what) |
15
+ | **Context economy** | Per-prompt retrieval injected by a hook, skill and tool suggestions, a context gate that drops injected text the prompt does not need, unused MCP servers pruned per project, `CLAUDE.md` sections moved into on-demand skills, and `stats` to see what each session cost. | [Context-economy units](#context-economy-units), [Skill suggestions](#skill-suggestions), [`stats`](#stats) |
16
+ | **Guardrails** | Pre-edit guards for your coding rules and your architecture's layer boundaries, a commit check, model routing for delegated agents, and commit attribution control. | [Coding rules guard](#coding-rules-guard), [Architecture guard](#architecture-guard), [Model routing](#model-routing-for-sub-agents) |
17
+ | **Parallel work** | Worktrees with their own index (seeded from the main checkout), their own leased port, and `node_modules` cloned copy-on-write; finished worktrees are swept once merged. | [Worktree lifecycle](#worktree-lifecycle) |
18
+ | **Host skills** | Skills that run inside the assistant on top of the MCP tools: project audit, design review, UX review, QA, video recording of a flow, commit messages, OKF writing. | [Host skills](#host-skills-setup-installs) |
19
+ | **Claude Code terminal** | An activity pane (todos, commands, changes, agents, CI, filters), themes, readable-reply rules, session titles, and a shared headless browser. | [Claude TUI](#claude-tui) |
20
+ | **Housekeeping** | `status` across every registered project, idle-session pruning, index compaction, dead-worktree cleanup, and live updates that move a running MCP server to the new binary. | [`status`](#status), [Disk maintenance](#disk-maintenance), [Live updates](#live-updates) |
21
+
22
+ Everything beyond codebase memory is a unit in `project-brain setup`: you see each one with its state before anything is written, and unticking a unit undoes exactly what it wrote. The Jev pieces (reranking, skill picks, the context gate, the commit check) only call out when you configure a TypeSafe token, and they fail open; post-commit module docs use the Anthropic API by default and can run on local Ollama instead (`setup --concept-provider ollama`). [docs/flow-map.md](docs/flow-map.md) lists exactly what leaves the machine.
8
23
 
9
24
  ## Quick Start
10
25
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "project-brain",
3
- "version": "0.48.0",
3
+ "version": "0.48.2",
4
4
  "type": "module",
5
- "description": "Local-first MCP server that gives AI tools semantic memory of your codebase.",
5
+ "description": "Local-first context layer for AI coding assistants: codebase memory, project knowledge, and session guardrails over MCP.",
6
6
  "author": "jcsoftdev",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -49,11 +49,11 @@
49
49
  "zod": "^4.4.3"
50
50
  },
51
51
  "optionalDependencies": {
52
- "project-brain-darwin-arm64": "0.48.0",
53
- "project-brain-linux-x64": "0.48.0",
54
- "project-brain-linux-arm64": "0.48.0",
55
- "project-brain-windows-x64": "0.48.0",
56
- "project-brain-windows-arm64": "0.48.0"
52
+ "project-brain-darwin-arm64": "0.48.2",
53
+ "project-brain-linux-x64": "0.48.2",
54
+ "project-brain-linux-arm64": "0.48.2",
55
+ "project-brain-windows-x64": "0.48.2",
56
+ "project-brain-windows-arm64": "0.48.2"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/bun": "latest",
@@ -3,7 +3,7 @@ import { atom, read, update } from 'claude-code'
3
3
  import type { Register } from 'claude-code'
4
4
 
5
5
  import type { Api, Row, Span, Tone } from './register'
6
- import { ICONS, agentUsage, clean, fit, shortName, span, usageRight } from './register'
6
+ import { ICONS, clean, fit, shortName, span, usageRight } from './register'
7
7
  import type { AgentUsage } from '../types'
8
8
  import { notify } from './feat-notify'
9
9
 
@@ -58,6 +58,7 @@ const OUTPUT_PATH = /^\/(?:[^\0/]+\/)+tasks\/[A-Za-z0-9_-]{4,64}\.output$/
58
58
  const NOTICE_DOORS = new Set(['prompt', 'delivery', 'attachment', 'queue', 'hook-context', 'notice'])
59
59
 
60
60
  const tasksAtom = atom({ plugin: 'project-brain-activity', key: 'runningTasks' } as const, [] as RunningTask[], { shape: 'running-tasks-1' })
61
+ const agentUsage = atom({ plugin: 'project-brain-activity', key: 'agentUsage' } as const, {} as Record<string, AgentUsage>, { shape: 'agent-usage-1' })
61
62
  const tickAtom = atom({ plugin: 'project-brain-activity', key: 'runningTick' } as const, 0, { shape: 'running-tick-1' })
62
63
 
63
64
  // A reload drops these; session.start restarts the timer when work is still running.