brainclaw 1.9.1 → 1.10.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 +47 -1
- package/dist/brainclaw-vscode.vsix +0 -0
- package/dist/cli.js +18 -1
- package/dist/commands/code-map.js +129 -0
- package/dist/commands/codev.js +7 -0
- package/dist/commands/mcp.js +121 -0
- package/dist/commands/run-profile.js +3 -2
- package/dist/commands/switch.js +100 -89
- package/dist/core/agent-files.js +12 -0
- package/dist/core/code-map/backend.js +123 -0
- package/dist/core/code-map/core.js +81 -0
- package/dist/core/code-map/drafts.js +2 -0
- package/dist/core/code-map/extractor.js +29 -0
- package/dist/core/code-map/finalizer.js +191 -0
- package/dist/core/code-map/freshness.js +108 -0
- package/dist/core/code-map/ids.js +0 -0
- package/dist/core/code-map/importable.js +35 -0
- package/dist/core/code-map/indexes.js +197 -0
- package/dist/core/code-map/lang/java/imports.scm +17 -0
- package/dist/core/code-map/lang/java/index.js +254 -0
- package/dist/core/code-map/lang/java/tags.scm +48 -0
- package/dist/core/code-map/lang/php/imports.scm +21 -0
- package/dist/core/code-map/lang/php/index.js +251 -0
- package/dist/core/code-map/lang/php/tags.scm +44 -0
- package/dist/core/code-map/lang/provider.js +9 -0
- package/dist/core/code-map/lang/providers.js +24 -0
- package/dist/core/code-map/lang/python/imports.scm +90 -0
- package/dist/core/code-map/lang/python/index.js +364 -0
- package/dist/core/code-map/lang/python/tags.scm +81 -0
- package/dist/core/code-map/lang/query-runtime.js +374 -0
- package/dist/core/code-map/lang/registry.js +125 -0
- package/dist/core/code-map/lang/typescript/imports.scm +90 -0
- package/dist/core/code-map/lang/typescript/index.js +306 -0
- package/dist/core/code-map/lang/typescript/tags.js.scm +106 -0
- package/dist/core/code-map/lang/typescript/tags.scm +151 -0
- package/dist/core/code-map/lock.js +210 -0
- package/dist/core/code-map/materialized.js +51 -0
- package/dist/core/code-map/memory-reader.js +59 -0
- package/dist/core/code-map/paths.js +53 -0
- package/dist/core/code-map/query.js +568 -0
- package/dist/core/code-map/refresh.js +0 -0
- package/dist/core/code-map/resolve.js +177 -0
- package/dist/core/code-map/store.js +206 -0
- package/dist/core/code-map/types.js +288 -0
- package/dist/core/code-map/vocabulary.js +57 -0
- package/dist/core/code-map/wasm-loader.js +294 -0
- package/dist/core/code-map/work-section.js +206 -0
- package/dist/core/codev-rounds.js +4 -0
- package/dist/core/execution-adapters.js +11 -10
- package/dist/core/execution-profile.js +58 -0
- package/dist/core/facade-schema.js +9 -0
- package/dist/core/instruction-templates.js +2 -0
- package/dist/core/mcp-command-resolution.js +3 -1
- package/dist/core/store-resolution.js +41 -4
- package/dist/facts.js +9 -5
- package/dist/facts.json +8 -4
- package/dist/vendor/web-tree-sitter/tree-sitter.js +3980 -0
- package/dist/vendor/web-tree-sitter/tree-sitter.wasm +0 -0
- package/dist/wasm/tree-sitter-java.wasm +0 -0
- package/dist/wasm/tree-sitter-javascript.wasm +0 -0
- package/dist/wasm/tree-sitter-php.wasm +0 -0
- package/dist/wasm/tree-sitter-python.wasm +0 -0
- package/dist/wasm/tree-sitter-tsx.wasm +0 -0
- package/dist/wasm/tree-sitter-typescript.wasm +0 -0
- package/dist/wasm/tree-sitter.wasm +0 -0
- package/docs/cli.md +46 -8
- package/docs/code-map.md +198 -0
- package/docs/integrations/mcp.md +13 -6
- package/docs/mcp-schema-changelog.md +7 -3
- package/docs/quickstart.md +1 -1
- package/package.json +11 -6
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/cli.md
CHANGED
|
@@ -34,25 +34,32 @@ All commands support these global options:
|
|
|
34
34
|
|
|
35
35
|
### `brainclaw switch [project]`
|
|
36
36
|
|
|
37
|
-
Set the active project for subsequent CLI and MCP commands. This eliminates the need to `cd` into a subproject directory in multi-project workspaces.
|
|
37
|
+
Set the active project for subsequent CLI and MCP commands. This eliminates the need to `cd` into a subproject directory in multi-project workspaces.
|
|
38
|
+
|
|
39
|
+
**Session-scoped by default (v1.10.0).** A plain `switch <project>` only affects the **calling agent's session** — it auto-creates a session if needed and never touches the shared pointer. This is what keeps two agents working in the same monorepo independent: neither clobbers the other. `switch --list` and the no-argument "show current" reflect the session's own active project.
|
|
40
|
+
|
|
41
|
+
`--global` is the **only** path that writes (or, with `--clear`, removes) the shared, per-workspace `.brainclaw/active-project.json` that every agent on the host sees. Use it for an operator setting a workspace-wide default — not for per-agent work.
|
|
38
42
|
|
|
39
43
|
| Option | Description |
|
|
40
44
|
|---|---|
|
|
41
|
-
| `--list` | List all available projects in the workspace |
|
|
42
|
-
| `--clear` | Clear the active project (revert to cwd
|
|
43
|
-
| `--
|
|
45
|
+
| `--list` | List all available projects in the workspace (marks the session's active project) |
|
|
46
|
+
| `--clear` | Clear the **session's** active project (revert to cwd); add `--global` to clear the shared pointer |
|
|
47
|
+
| `--global` | Write/clear the **shared** workspace default for all agents (the only path that mutates `active-project.json`); bypasses the session |
|
|
48
|
+
| `--json` | Output as JSON (includes `scope: "session" \| "global"`) |
|
|
44
49
|
|
|
45
50
|
The `<project>` argument accepts:
|
|
46
|
-
- **Project name** — matched against the global registry and
|
|
51
|
+
- **Project name** — matched against the global registry, workspace config, and cross-project links
|
|
47
52
|
- **Relative path** — resolved from the workspace root (e.g. `apps/lodestar`)
|
|
48
53
|
- **Absolute path** — used directly
|
|
49
54
|
|
|
50
55
|
```bash
|
|
51
56
|
brainclaw switch --list # discover available projects
|
|
52
|
-
brainclaw switch lodestar # switch
|
|
57
|
+
brainclaw switch lodestar # session-scoped switch (isolated to this agent)
|
|
53
58
|
brainclaw switch apps/lodestar # switch by relative path
|
|
54
|
-
brainclaw switch # show current active project
|
|
55
|
-
brainclaw switch --clear # clear
|
|
59
|
+
brainclaw switch # show current active project (session-aware)
|
|
60
|
+
brainclaw switch --clear # clear THIS session's active project
|
|
61
|
+
brainclaw switch lodestar --global # set the shared workspace default for everyone
|
|
62
|
+
brainclaw switch --clear --global # clear the shared workspace default
|
|
56
63
|
brainclaw --cwd /other/path status # one-off override without switching
|
|
57
64
|
```
|
|
58
65
|
|
|
@@ -599,6 +606,37 @@ brainclaw note create "Need follow-up on launcher script" --plan pln_abc123
|
|
|
599
606
|
|
|
600
607
|
---
|
|
601
608
|
|
|
609
|
+
## Code Map
|
|
610
|
+
|
|
611
|
+
A per-project Tree-sitter symbol + import index (JS/TS, Python, PHP, Java) so agents
|
|
612
|
+
can ask "where is X / what should I read first" before editing. The MCP equivalents
|
|
613
|
+
are `bclaw_code_status` / `bclaw_code_find` / `bclaw_code_brief` / `bclaw_code_refresh`.
|
|
614
|
+
Full reference (freshness model, supported languages, WASM bundling): [docs/code-map.md](code-map.md).
|
|
615
|
+
|
|
616
|
+
### `brainclaw code-map status`
|
|
617
|
+
|
|
618
|
+
Store presence, freshness badge (`fresh` / `stale_changed_files` / `stale_extractor` / `stale_grammar` / `partial` / `missing_index`), and index stats (files, nodes, edges). Read-only.
|
|
619
|
+
|
|
620
|
+
### `brainclaw code-map refresh [--all|--changed]`
|
|
621
|
+
|
|
622
|
+
Build or update the index. `--changed` (default) re-parses only touched files; `--all` does a full re-index. Run this when status shows `missing_index` or a stale badge. Fails fast (never blocks) if another writer holds the project lock.
|
|
623
|
+
|
|
624
|
+
### `brainclaw code-map find <query> [--limit <n>]`
|
|
625
|
+
|
|
626
|
+
Search the symbol index by name (function / class / component / hook / type). Returns ranked matches with path + score. Note: this is a symbol/structure index, not a full-text search — use it to locate definitions, not arbitrary strings.
|
|
627
|
+
|
|
628
|
+
### `brainclaw code-map brief <target> [--limit <n>]`
|
|
629
|
+
|
|
630
|
+
Given a symbol or path, return a ranked reading list (`suggested_files_to_read`) plus related memory (decisions/traps/constraints) — what to read before editing.
|
|
631
|
+
|
|
632
|
+
```bash
|
|
633
|
+
brainclaw code-map refresh --all
|
|
634
|
+
brainclaw code-map find RouteCollector
|
|
635
|
+
brainclaw code-map brief src/core/code-map/work-section.ts
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
---
|
|
639
|
+
|
|
602
640
|
## Memory Review
|
|
603
641
|
|
|
604
642
|
### `brainclaw reflect [text]`
|
package/docs/code-map.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Code Map
|
|
2
|
+
|
|
3
|
+
Code Map is a per-project structural index of your JavaScript / TypeScript /
|
|
4
|
+
TSX codebase. It parses each supported file with Tree-sitter and records the
|
|
5
|
+
symbols it defines (functions, classes, types, interfaces, React components and
|
|
6
|
+
hooks), what it imports and exports, and how files relate — then answers fast
|
|
7
|
+
"what should I read before I edit this?" questions for both human operators and
|
|
8
|
+
coding agents.
|
|
9
|
+
|
|
10
|
+
Code Map is a **discovery aid**, not a build artifact. It never changes your
|
|
11
|
+
code, never blocks `bclaw_work`, and degrades gracefully: if the index is
|
|
12
|
+
missing or stale, every command says so via a freshness badge instead of
|
|
13
|
+
returning silently wrong answers.
|
|
14
|
+
|
|
15
|
+
The index lives under `.brainclaw/code-map/` (one JSONL shard per file, plus
|
|
16
|
+
named symbol/import indexes and a manifest). It is safe to delete; a refresh
|
|
17
|
+
rebuilds it.
|
|
18
|
+
|
|
19
|
+
## When to use it
|
|
20
|
+
|
|
21
|
+
- **Before editing** an unfamiliar area: `code-map brief <symbol-or-path>` (or
|
|
22
|
+
`bclaw_code_brief`) returns a ranked list of files to read plus related
|
|
23
|
+
brainclaw memory.
|
|
24
|
+
- **To locate** a function/class/component/hook by name without grepping:
|
|
25
|
+
`code-map find <query>` (or `bclaw_code_find`).
|
|
26
|
+
- **To check coverage / staleness**: `code-map status` (or `bclaw_code_status`).
|
|
27
|
+
- **After pulling changes or doing work**: `code-map refresh` to bring the index
|
|
28
|
+
back to `fresh`.
|
|
29
|
+
|
|
30
|
+
## CLI
|
|
31
|
+
|
|
32
|
+
All commands are available as `brainclaw code-map …` or `bclaw code-map …`, and
|
|
33
|
+
honor the global options (`--cwd`, `--verbose`, `--debug`). Every command also
|
|
34
|
+
accepts `--json` for machine-readable output, and prints a `Freshness:` line.
|
|
35
|
+
|
|
36
|
+
### `brainclaw code-map status`
|
|
37
|
+
|
|
38
|
+
Read-only. Reports whether the store exists, the freshness badge, and index
|
|
39
|
+
stats (files indexed, nodes, edges). Never refreshes.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
brainclaw code-map status
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Code Map status
|
|
47
|
+
Store: present
|
|
48
|
+
Freshness: fresh
|
|
49
|
+
Files: 142
|
|
50
|
+
Nodes: 1873
|
|
51
|
+
Edges: 2410
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### `brainclaw code-map refresh [--changed | --all]`
|
|
55
|
+
|
|
56
|
+
Rebuilds the index behind a per-project lock. Defaults to `--changed`.
|
|
57
|
+
|
|
58
|
+
| Flag | Behavior |
|
|
59
|
+
|---|---|
|
|
60
|
+
| `--changed` (default) | Re-parses files whose **content** changed (git status + file-hash diff) **and** any shard whose stored extractor-config / grammar / engine hashes no longer match the current ones (i.e. `stale_extractor` / `stale_grammar`). A config or grammar bump is therefore healed by this cheap path — not only by `--all`. Compaction is limited to git-proven deletes. |
|
|
61
|
+
| `--all` | Enumerates every supported file, re-parses, and performs full orphan compaction (drops shards whose file is gone or now ignored). |
|
|
62
|
+
|
|
63
|
+
If a live writer already holds the project lock, `refresh` **fails fast** with a
|
|
64
|
+
clear status rather than blocking — it never stalls `bclaw_work`.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
brainclaw code-map refresh # changed (cheap, default)
|
|
68
|
+
brainclaw code-map refresh --all # full rebuild + compaction
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### `brainclaw code-map find <query>`
|
|
72
|
+
|
|
73
|
+
Read-only. Searches the symbol index for a name/token and returns ranked matches
|
|
74
|
+
with path and score. A `missing_index` badge means you should run `refresh`
|
|
75
|
+
first.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
brainclaw code-map find useAuth
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
Code Map find: "useAuth"
|
|
83
|
+
Freshness: fresh
|
|
84
|
+
[9.0] useAuth hook — src/hooks/useAuth.ts
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `brainclaw code-map brief <symbol-or-path>`
|
|
88
|
+
|
|
89
|
+
Read-only. Builds a reading brief for a symbol or file: a ranked
|
|
90
|
+
`suggested files to read` list (capped at 12) plus related brainclaw memory
|
|
91
|
+
(decisions / constraints / traps, capped at 5). Use it before editing.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
brainclaw code-map brief App
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## MCP tools
|
|
98
|
+
|
|
99
|
+
Capable agents should prefer the MCP surface. The four tools mirror the CLI and
|
|
100
|
+
all return a `freshness_badge`:
|
|
101
|
+
|
|
102
|
+
| Tool | Kind | Purpose |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| `bclaw_code_status` | read | Store presence, freshness badge, index stats. Never refreshes. |
|
|
105
|
+
| `bclaw_code_find` | read | Ranked symbol-index search (`query`, optional `limit`). Never refreshes. |
|
|
106
|
+
| `bclaw_code_brief` | read | Reading brief for a symbol/path (`target`, optional `limit`, files capped at 12). Never refreshes. |
|
|
107
|
+
| `bclaw_code_refresh` | write | Rebuild the index. `scope` = `"changed"` (default) or `"all"`. Fails fast on a live lock. |
|
|
108
|
+
|
|
109
|
+
The read tools never trigger a parse — if `bclaw_code_status` /
|
|
110
|
+
`bclaw_code_find` / `bclaw_code_brief` report `missing_index` or a stale badge,
|
|
111
|
+
call `bclaw_code_refresh` and retry.
|
|
112
|
+
|
|
113
|
+
## Freshness badge model
|
|
114
|
+
|
|
115
|
+
Every Code Map response carries a freshness badge so a stale index is always
|
|
116
|
+
visible rather than silently misleading. The status is one of:
|
|
117
|
+
|
|
118
|
+
| Status | Meaning | Fix |
|
|
119
|
+
|---|---|---|
|
|
120
|
+
| `fresh` | Index matches the working tree, the extractor config, and the parser binaries. | — |
|
|
121
|
+
| `stale_changed_files` | One or more indexed files have changed on disk since they were parsed. | `refresh --changed` |
|
|
122
|
+
| `stale_extractor` | The extractor configuration (ignore rules, size caps, supported extensions, query budget, or active language set) changed since these shards were produced. | `refresh --changed` (heals on the cheap path) |
|
|
123
|
+
| `stale_grammar` | A Tree-sitter grammar (or the engine glue) binary changed since these shards were produced. | `refresh --changed` (heals on the cheap path) |
|
|
124
|
+
| `partial` | The index could not be fully read/built this pass (e.g. the project lock was held by a live writer). | retry |
|
|
125
|
+
| `missing_index` | No index exists yet for this project. | `refresh --all` |
|
|
126
|
+
|
|
127
|
+
Staleness reasons are kept separate on purpose: a content change
|
|
128
|
+
(`stale_changed_files`) is independent from a config change (`stale_extractor`)
|
|
129
|
+
which is independent from a parser-binary change (`stale_grammar`). The badge
|
|
130
|
+
surfaces the dominant reason; `--json` output and the manifest carry the per-file
|
|
131
|
+
counts.
|
|
132
|
+
|
|
133
|
+
## Lifecycle — pull-based, no daemon
|
|
134
|
+
|
|
135
|
+
Code Map never runs in the background and never auto-reindexes. The model is lazy
|
|
136
|
+
reconciliation at the read path:
|
|
137
|
+
|
|
138
|
+
1. You edit or pull code — the index does not change.
|
|
139
|
+
2. The next `status` / `find` / `brief` recomputes a freshness badge (git status +
|
|
140
|
+
file-hash diff vs the stored shards), so a stale index is always *visible*,
|
|
141
|
+
never silently wrong.
|
|
142
|
+
3. `refresh --changed` re-parses only the changed files (incremental); `--all` does
|
|
143
|
+
a full rebuild + orphan compaction.
|
|
144
|
+
4. `bclaw_work` nudges a refresh when the badge is `missing_index` or stale, so an
|
|
145
|
+
agent knows to reconcile before trusting the map.
|
|
146
|
+
|
|
147
|
+
It never blocks `bclaw_work` (a held lock fails fast), so the worst case of a stale
|
|
148
|
+
index is a one-line "run refresh" hint — not a wrong answer.
|
|
149
|
+
|
|
150
|
+
## Monorepos and nested projects
|
|
151
|
+
|
|
152
|
+
Code Map is **per project**: the index lives at `<project>/.brainclaw/code/`, and
|
|
153
|
+
`refresh` indexes the source tree under the project root it runs in — descending
|
|
154
|
+
into subdirectories but skipping `node_modules`, `dist`, `.git`, `.brainclaw`,
|
|
155
|
+
`vendor`, `target`, … at any depth.
|
|
156
|
+
|
|
157
|
+
There is no nested-project *boundary*, so the scope follows **where you run it**:
|
|
158
|
+
|
|
159
|
+
| You run refresh / find / brief … | … against |
|
|
160
|
+
|---|---|
|
|
161
|
+
| at the monorepo root | one index covering the whole tree (every child project's source) |
|
|
162
|
+
| inside a child project (e.g. `apps/api`) | that child's own index, at `apps/api/.brainclaw/code/` |
|
|
163
|
+
|
|
164
|
+
When an agent works inside a child project, brainclaw's project resolution routes
|
|
165
|
+
Code Map to **that child** — the same per-project scoping that powers `bclaw_work`
|
|
166
|
+
/ `bclaw_switch` — so each project gets its own clean map without manual `--cwd`
|
|
167
|
+
juggling. A submodule that is itself an application (under e.g. `apps/`) is indexed
|
|
168
|
+
like any other directory.
|
|
169
|
+
|
|
170
|
+
**Not yet supported** (roadmap):
|
|
171
|
+
|
|
172
|
+
- A single aggregated view that keeps **separate per-child indexes and federates
|
|
173
|
+
them** at the root (a query spanning services without double-indexing).
|
|
174
|
+
- **Cross-service edges** — e.g. linking an API call to the route that defines it in
|
|
175
|
+
another service. Code Map indexes language *symbols* and *module imports*, not
|
|
176
|
+
framework routes or runtime HTTP calls, so it does not (today) map "service A calls
|
|
177
|
+
endpoint X defined in service B".
|
|
178
|
+
|
|
179
|
+
## WASM bundling note
|
|
180
|
+
|
|
181
|
+
The parser is [Tree-sitter](https://tree-sitter.github.io/) compiled to
|
|
182
|
+
WebAssembly. The engine glue (`web-tree-sitter`) and the prebuilt grammar `.wasm`
|
|
183
|
+
files (TypeScript / TSX / JavaScript) are **bundled into the package** during the
|
|
184
|
+
build (`scripts/copy-code-map-wasm.mjs` copies them into `dist/wasm/` and vendors
|
|
185
|
+
the engine glue into `dist/vendor/web-tree-sitter/`).
|
|
186
|
+
|
|
187
|
+
Two properties matter for packaging:
|
|
188
|
+
|
|
189
|
+
1. **Lazy load on first parse only.** The WASM engine is loaded via a dynamic
|
|
190
|
+
import the first time a file is actually parsed. Nothing in the CLI / MCP
|
|
191
|
+
module-load graph statically imports the parser, so `--version`,
|
|
192
|
+
`code-map status`, `code-map find`, and `code-map brief` all work even if the
|
|
193
|
+
engine is absent — only `refresh` needs it.
|
|
194
|
+
2. **Self-contained at runtime.** Because the glue and grammars are vendored into
|
|
195
|
+
`dist/`, parsing works from the published package without the build-time
|
|
196
|
+
dev dependencies. WASM assets are resolved relative to the module
|
|
197
|
+
(`import.meta.url`), never the current working directory, so the loader is
|
|
198
|
+
safe inside git worktrees.
|
package/docs/integrations/mcp.md
CHANGED
|
@@ -25,10 +25,11 @@ The default dynamic workflow is:
|
|
|
25
25
|
1. `bclaw_work` to start the session and load the relevant context in one call (returns compact payload by default — pass `compact: false` for the full context result)
|
|
26
26
|
2. `bclaw_context({ kind: "execution" })` early when the agent needs local tooling signals or package update visibility
|
|
27
27
|
3. `bclaw_context({ kind: "memory" })`, `bclaw_context({ kind: "board" })`, or `bclaw_context({ kind: "delta" })` when the target path changes or full memory is needed beyond the compact summary
|
|
28
|
-
4. `
|
|
29
|
-
5. `
|
|
30
|
-
6. `
|
|
31
|
-
7. `
|
|
28
|
+
4. `bclaw_code_brief({ target })` / `bclaw_code_find({ query })` before editing unfamiliar code — get a ranked reading list (with related decisions/traps) and locate symbols from the Code Map instead of grepping blind. A `missing_index` badge means run `bclaw_code_refresh` first. See [code map](../code-map.md)
|
|
29
|
+
5. `bclaw_find` / `bclaw_get` / `bclaw_create` / `bclaw_update` / `bclaw_remove` / `bclaw_transition` for entity reads and writes
|
|
30
|
+
6. `bclaw_coordinate`, `bclaw_dispatch`, or `bclaw_loop` for assign, consult, review, reroute, summarize, dispatch, or multi-turn loop flows
|
|
31
|
+
7. `bclaw_read_inbox` when resuming delegated work
|
|
32
|
+
8. `bclaw_write_note`, `bclaw_quick_capture`, or `bclaw_create({ entity: "candidate", ... })` when the result should become runtime or durable shared memory
|
|
32
33
|
|
|
33
34
|
This keeps session continuity inside Brainclaw instead of pushing the agent back to manual CLI usage.
|
|
34
35
|
|
|
@@ -36,7 +37,7 @@ When a human operator needs the CLI equivalent of `bclaw_write_note`, use `brain
|
|
|
36
37
|
|
|
37
38
|
## Available Tools
|
|
38
39
|
|
|
39
|
-
All
|
|
40
|
+
All 65 published MCP tools are discoverable via `tools/list`. Each tool carries an `annotations` object with `tier` and `category` metadata so clients can filter or group tools without server-side hiding.
|
|
40
41
|
|
|
41
42
|
### Tool tiers
|
|
42
43
|
|
|
@@ -46,7 +47,7 @@ Every tool has one of three tiers in its `annotations.tier` field:
|
|
|
46
47
|
- **standard** — Day-to-day coordination tools: plans, claims, messaging, sequences, dispatch, review, memory. Returned by default alongside facades.
|
|
47
48
|
- **advanced** — Specialized governance, audit, registry, and power tools.
|
|
48
49
|
|
|
49
|
-
By default, `tools/list` returns **facade + standard** tools (
|
|
50
|
+
By default, `tools/list` returns **facade + standard** tools (44 tools). To get all tools including advanced, pass `{ "catalog": "all" }`, `{ "include": "all" }`, or `{ "advanced": true }`. To filter by a single tier, pass `{ "tier": "facade" }`, `{ "tier": "standard" }`, or `{ "tier": "advanced" }`.
|
|
50
51
|
|
|
51
52
|
Published tools remain callable regardless of catalog filtering — the tier only affects discovery via `tools/list`.
|
|
52
53
|
|
|
@@ -106,6 +107,12 @@ Each tool also has an `annotations.category` field: `session`, `context`, `memor
|
|
|
106
107
|
| `bclaw_update` | memory | Partially update mutable fields on a canonical entity |
|
|
107
108
|
| `bclaw_remove` | memory | Archive or purge a canonical entity |
|
|
108
109
|
| `bclaw_transition` | memory | Move an entity through its validated state machine |
|
|
110
|
+
| `bclaw_code_status` | discovery | Code Map freshness badge + index stats (store presence, files/nodes/edges) |
|
|
111
|
+
| `bclaw_code_find` | discovery | Search the Code Map symbol index by name (function/class/component/hook/type) |
|
|
112
|
+
| `bclaw_code_brief` | discovery | Ranked reading list + related decisions/traps before editing a symbol or path |
|
|
113
|
+
| `bclaw_code_refresh` | discovery | Rebuild the Code Map index (`scope: changed \| all`) |
|
|
114
|
+
|
|
115
|
+
See [code map](../code-map.md) for the full Code Map reference (CLI, freshness model, supported languages).
|
|
109
116
|
|
|
110
117
|
### Advanced tools
|
|
111
118
|
|
|
@@ -104,10 +104,14 @@ will still succeed. A follow-up PR will strip the dead handler code.
|
|
|
104
104
|
changelog records the published MCP surface fingerprint. When a tool
|
|
105
105
|
name, tier, category, or input schema changes, the test fails until
|
|
106
106
|
this section is updated.
|
|
107
|
-
- MCP public surface fingerprint: `sha256:
|
|
108
|
-
(updated 2026-06-
|
|
107
|
+
- MCP public surface fingerprint: `sha256:35fd83b0d124df94`
|
|
108
|
+
(updated 2026-06-20 for 1.10.0: Code Map tools added to the published surface —
|
|
109
|
+
`bclaw_code_find`, `bclaw_code_brief`, `bclaw_code_refresh`, `bclaw_code_status`.
|
|
110
|
+
Additive: no tool removed or renamed.)
|
|
111
|
+
Previous: `sha256:70cf80b9615f631f`,
|
|
112
|
+
updated 2026-06-18 for 1.9.1: monorepo project-scoping fix — session-aware
|
|
109
113
|
effective-cwd resolution and read-path project scoping shift the published
|
|
110
|
-
input-schema surface. Additive: no tool added, removed, or renamed.
|
|
114
|
+
input-schema surface. Additive: no tool added, removed, or renamed.
|
|
111
115
|
Previous: `sha256:b1d3c6a00a224509`,
|
|
112
116
|
updated 2026-06-14: journal ON by default + `migrate --enable-journal`,
|
|
113
117
|
registry post-image families + verify gate, and capped auto-handoff diff
|
package/docs/quickstart.md
CHANGED
|
@@ -12,7 +12,7 @@ If you're about to cut a release that changes the CLI, MCP, or context surface,
|
|
|
12
12
|
npm install -g brainclaw
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Requires Node.js
|
|
15
|
+
Requires Node.js 22.12+ (`engines.node = ">=22.12.0"`). CI exercises Node 22 (Active LTS) and Node 24 (current LTS) — Node 22 or 24 is the recommended runtime. Node 20 reached EOL in April 2026 and is no longer supported. Verify with `brainclaw --version`.
|
|
16
16
|
|
|
17
17
|
## Step 2: Bootstrap this machine
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brainclaw",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Shared project memory for humans and coding agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"dist/**/*.js",
|
|
20
20
|
"dist/core/default-profiles/*.yaml",
|
|
21
|
+
"dist/core/code-map/lang/**/*.scm",
|
|
22
|
+
"dist/wasm/*.wasm",
|
|
23
|
+
"dist/vendor/web-tree-sitter/*.wasm",
|
|
21
24
|
"dist/brainclaw-vscode.vsix",
|
|
22
25
|
"dist/facts.json",
|
|
23
26
|
"docs/**/*.md",
|
|
@@ -31,14 +34,14 @@
|
|
|
31
34
|
"access": "public"
|
|
32
35
|
},
|
|
33
36
|
"engines": {
|
|
34
|
-
"node": ">=
|
|
37
|
+
"node": ">=22.12.0"
|
|
35
38
|
},
|
|
36
39
|
"scripts": {
|
|
37
40
|
"clean:build": "node scripts/clean-build.mjs dist dist-test",
|
|
38
41
|
"clean:dist": "node scripts/clean-build.mjs dist",
|
|
39
42
|
"clean:dist-test": "node scripts/clean-build.mjs dist-test",
|
|
40
43
|
"build": "npm run build:cli && node scripts/build-vsix.mjs --optional",
|
|
41
|
-
"build:cli": "npm run clean:dist && tsc && node scripts/copy-default-profiles.mjs",
|
|
44
|
+
"build:cli": "npm run clean:dist && tsc && node scripts/copy-default-profiles.mjs && node scripts/copy-code-map-wasm.mjs",
|
|
42
45
|
"build:release": "npm run build:cli && node scripts/emit-site-facts.mjs && node scripts/build-vsix.mjs",
|
|
43
46
|
"emit:facts": "npm run build:cli && node scripts/emit-site-facts.mjs",
|
|
44
47
|
"dev": "npm run clean:dist && tsc && node scripts/copy-default-profiles.mjs && node dist/cli.js",
|
|
@@ -70,17 +73,19 @@
|
|
|
70
73
|
],
|
|
71
74
|
"license": "MIT",
|
|
72
75
|
"dependencies": {
|
|
73
|
-
"commander": "^
|
|
76
|
+
"commander": "^15.0.0",
|
|
74
77
|
"yaml": "^2.7.1",
|
|
75
78
|
"zod": "^4.4.3"
|
|
76
79
|
},
|
|
77
80
|
"devDependencies": {
|
|
78
81
|
"@eslint/js": "^10.0.1",
|
|
79
|
-
"@types/node": "^
|
|
82
|
+
"@types/node": "^25.9.3",
|
|
80
83
|
"ajv": "^8.20.0",
|
|
81
84
|
"c8": "^11.0.0",
|
|
82
85
|
"eslint": "^10.5.0",
|
|
86
|
+
"tree-sitter-wasms": "^0.1.13",
|
|
83
87
|
"typescript": "^6.0.3",
|
|
84
|
-
"typescript-eslint": "^8.61.1"
|
|
88
|
+
"typescript-eslint": "^8.61.1",
|
|
89
|
+
"web-tree-sitter": "^0.25.10"
|
|
85
90
|
}
|
|
86
91
|
}
|