@nano-step/nano-brain 2026.6.202 → 2026.6.204
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 +57 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -122,8 +122,8 @@ watcher:
|
|
|
122
122
|
debounce_ms: 2000
|
|
123
123
|
reindex_interval: 300
|
|
124
124
|
# Per-collection exclude_patterns and allowed_extensions are also supported
|
|
125
|
-
# via the workspaces map. See "
|
|
126
|
-
#
|
|
125
|
+
# via the workspaces map. See "Ignore patterns" section below for the
|
|
126
|
+
# global and workspace-local .nano-brainignore files.
|
|
127
127
|
|
|
128
128
|
storage:
|
|
129
129
|
max_file_size: 314572800 # 300MB
|
|
@@ -188,15 +188,17 @@ curl -H "Authorization: Bearer nbt_..." http://host:3100/api/v1/query -d '{"quer
|
|
|
188
188
|
# url: http://admin:mypassword@host:3100/mcp
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
-
###
|
|
191
|
+
### Ignore patterns
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
Two layers of `.nano-brainignore` files control what the watcher indexes,
|
|
194
|
+
both using standard `.gitignore` syntax (one pattern per line, supports `**`,
|
|
195
|
+
`!negation`, blank lines, `#` comments).
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
#### Global — `~/.nano-brain/.nano-brainignore`
|
|
198
198
|
|
|
199
|
-
**
|
|
199
|
+
Loaded once at server startup. Patterns apply to **every** registered
|
|
200
|
+
collection across **every** workspace. Use this for rules that are personal
|
|
201
|
+
to your machine and span all your projects (e.g. always skip `*.png`).
|
|
200
202
|
|
|
201
203
|
```
|
|
202
204
|
# Skip generated files everywhere
|
|
@@ -211,15 +213,52 @@ node_modules/
|
|
|
211
213
|
!icons/important.png
|
|
212
214
|
```
|
|
213
215
|
|
|
214
|
-
|
|
216
|
+
#### Workspace-local — `<workspace_root>/.nano-brainignore`
|
|
217
|
+
|
|
218
|
+
Loaded once per collection when the watcher starts watching it (server
|
|
219
|
+
startup, `POST /api/v1/init`, or `POST /api/v1/collections`). Patterns
|
|
220
|
+
apply **only** to that one workspace. Use this for project-specific rules
|
|
221
|
+
you want to **share with your team via version control** — e.g. skip
|
|
222
|
+
generated code that you commit to git but don't want indexed.
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
# nano-brain-specific rules for this repo (commit me)
|
|
226
|
+
*.generated.go
|
|
227
|
+
fixtures/large/
|
|
228
|
+
*.snap
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Workspace-local rules layer **additively** on top of global rules and
|
|
232
|
+
per-collection `.gitignore`. There is no cross-file negation: a `!pattern`
|
|
233
|
+
in workspace-local cannot un-exclude a path matched by global.
|
|
234
|
+
|
|
235
|
+
The file at the workspace root is loaded for the `code` collection. The
|
|
236
|
+
sibling `memory` and `sessions` collections are rooted under `~/.nano-brain/`
|
|
237
|
+
and do not normally need their own ignore files.
|
|
238
|
+
|
|
239
|
+
#### Order of evaluation (most aggressive first)
|
|
215
240
|
|
|
216
241
|
1. Hardcoded default exclude dirs (`node_modules`, `.git`, `dist`, `build`, `target`, etc.)
|
|
217
|
-
2.
|
|
218
|
-
3.
|
|
219
|
-
4. Per-collection `
|
|
220
|
-
5. Per-collection `
|
|
242
|
+
2. Global `~/.nano-brain/.nano-brainignore`
|
|
243
|
+
3. Workspace-local `<workspace_root>/.nano-brainignore`
|
|
244
|
+
4. Per-collection `.gitignore` (in collection root)
|
|
245
|
+
5. Per-collection `exclude_patterns` (config-level)
|
|
246
|
+
6. Per-collection `allowed_extensions` (whitelist)
|
|
247
|
+
|
|
248
|
+
#### Reloading
|
|
249
|
+
|
|
250
|
+
Both global and workspace-local files are loaded at collection registration
|
|
251
|
+
time. To pick up edits:
|
|
252
|
+
|
|
253
|
+
- **Global**: restart the server.
|
|
254
|
+
- **Workspace-local**: restart the server, OR re-register the workspace
|
|
255
|
+
with `POST /api/v1/init` (this rebuilds the collection's filter and
|
|
256
|
+
re-reads the file).
|
|
257
|
+
|
|
258
|
+
`POST /api/reload-config` does **not** re-read ignore files — only search
|
|
259
|
+
config and log level are reloaded by that endpoint.
|
|
221
260
|
|
|
222
|
-
|
|
261
|
+
Issues: #263 (global), #317 (workspace-local).
|
|
223
262
|
|
|
224
263
|
### Session Summarization
|
|
225
264
|
|
|
@@ -311,6 +350,7 @@ docker run -d \
|
|
|
311
350
|
| GET | `/api/status` | Server status with version, uptime, workspace stats |
|
|
312
351
|
| POST | `/api/v1/init` | Register workspace |
|
|
313
352
|
| GET | `/api/v1/workspaces` | List all workspaces (with doc counts) |
|
|
353
|
+
| POST | `/api/v1/workspaces/resolve` | Resolve path → workspace hash + `registered` status (read-only) |
|
|
314
354
|
| DELETE | `/api/v1/workspaces/:hash` | Permanently delete a workspace + cascade docs/chunks/embeddings |
|
|
315
355
|
| GET | `/api/v1/wake-up` | Workspace briefing |
|
|
316
356
|
| POST | `/api/harvest` | Trigger session harvesting |
|
|
@@ -353,6 +393,7 @@ Workspace is passed in the JSON body for POST, query param for GET.
|
|
|
353
393
|
| `nano-brain` (no args) | Start HTTP server (default: port 3100) |
|
|
354
394
|
| `nano-brain init --root=<path>` | Register workspace |
|
|
355
395
|
| `nano-brain workspaces list` | List registered workspaces with doc counts |
|
|
396
|
+
| `nano-brain workspaces current [--path=<p>] [--export\|--json\|--check]` | Resolve current/path workspace hash. `--export` prints `export NANO_BRAIN_WORKSPACE=<hash>` for `eval`; `--check` exits 2 if not registered |
|
|
356
397
|
| `nano-brain workspaces remove --workspace=<hash> [--dry-run\|--force]` | Permanently delete a workspace + all its documents/chunks/embeddings |
|
|
357
398
|
| `nano-brain write` | Write document via CLI |
|
|
358
399
|
| `nano-brain query [--scope=all] [--tags=t1,t2]` | Hybrid search (BM25 + vector + RRF + recency) |
|
|
@@ -379,7 +420,7 @@ Workspace is passed in the JSON body for POST, query param for GET.
|
|
|
379
420
|
|
|
380
421
|
## MCP Tools
|
|
381
422
|
|
|
382
|
-
nano-brain exposes
|
|
423
|
+
nano-brain exposes 14 tools via MCP (Model Context Protocol):
|
|
383
424
|
|
|
384
425
|
| Tool | Description |
|
|
385
426
|
|------|-------------|
|
|
@@ -396,6 +437,7 @@ nano-brain exposes 13 tools via MCP (Model Context Protocol):
|
|
|
396
437
|
| `memory_trace` | Call chain trace from entry point |
|
|
397
438
|
| `memory_impact` | Cross-file change impact analysis |
|
|
398
439
|
| `memory_symbols` | Symbol search (functions, types, constants) |
|
|
440
|
+
| `memory_workspaces_resolve` | Resolve filesystem path → workspace hash + registered status (read-only) |
|
|
399
441
|
|
|
400
442
|
### MCP Configuration
|
|
401
443
|
|