@timmeck/brain 2.1.0 → 2.1.1
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 +102 -172
- package/brain.log +386 -0
- package/dist/cli/commands/setup.d.ts +2 -0
- package/dist/cli/commands/setup.js +279 -0
- package/dist/cli/commands/setup.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +12 -7
- package/smithery.yaml +10 -0
package/README.md
CHANGED
|
@@ -4,150 +4,90 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@timmeck/brain)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://github.com/timmeck/brain)
|
|
7
|
+
[](https://smithery.ai/server/@timmeck/brain)
|
|
7
8
|
|
|
8
|
-
**Adaptive Error Memory & Code Intelligence
|
|
9
|
+
**Adaptive Error Memory & Code Intelligence MCP Server for Claude Code**
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Brain is an MCP server that gives Claude Code a persistent memory. It remembers every error you've encountered, every solution that worked (or didn't), and every code module across all your projects. Over time, it learns — strengthening connections between related concepts through a Hebbian synapse network, surfacing patterns, and proactively suggesting solutions before you even ask.
|
|
13
|
-
|
|
14
|
-
## Why Brain?
|
|
15
|
-
|
|
16
|
-
Without Brain, Claude Code starts fresh every session. With Brain:
|
|
17
|
-
|
|
18
|
-
- **Errors are solved faster** — Brain matches new errors against its database and suggests proven solutions with confidence scores
|
|
19
|
-
- **Cross-project learning** — Brain remembers fixes from your other projects and suggests them automatically
|
|
20
|
-
- **Code is never rewritten** — Before writing new code, Brain checks if similar modules already exist across your projects
|
|
21
|
-
- **Patterns emerge automatically** — The research engine analyzes your codebase to find trends, gaps, and synergies
|
|
22
|
-
- **Knowledge compounds** — Every fix, every module, every session makes Brain smarter
|
|
23
|
-
- **Errors are caught automatically** — Hooks detect errors in real-time and report them to Brain without manual intervention
|
|
24
|
-
- **Proactive prevention** — Brain warns you BEFORE an error occurs when it detects code matching known antipatterns
|
|
25
|
-
- **Semantic search** — Local embeddings enable vector-based similarity search alongside TF-IDF matching
|
|
26
|
-
- **Universal access** — REST API and MCP over HTTP make Brain available to any tool, IDE, or CI/CD pipeline
|
|
27
|
-
|
|
28
|
-
## Features
|
|
29
|
-
|
|
30
|
-
### Core Intelligence
|
|
31
|
-
- **Error Memory** — Track errors, match against known solutions, learn from successes and failures
|
|
32
|
-
- **Code Intelligence** — Register and discover reusable code modules across projects
|
|
33
|
-
- **Hebbian Synapse Network** — Weighted graph connecting errors, solutions, code modules, and concepts. Connections strengthen with use (like biological synapses)
|
|
34
|
-
- **Spreading Activation** — Explore related knowledge by activating nodes in the synapse network
|
|
35
|
-
- **Research Engine** — Automated analysis producing actionable insights: trends, gaps, synergies, template candidates
|
|
36
|
-
- **Learning Engine** — Pattern extraction, rule generation, confidence decay, antipattern detection with adaptive thresholds
|
|
37
|
-
|
|
38
|
-
### Smart Matching (v1.3+)
|
|
39
|
-
- **Context Enrichment** — Errors are enriched with task context, working directory, and command information
|
|
40
|
-
- **Error Chain Tracking** — Detects when errors cascade from fix attempts ("this error arose while fixing error #12")
|
|
41
|
-
- **Module Similarity** — Pairwise similarity detection finds duplicate code across projects
|
|
42
|
-
- **Cyclomatic Complexity** — Complexity metrics flow into reusability scores
|
|
43
|
-
- **Source Hash Detection** — Skips re-analysis for unchanged modules, triggers re-analysis on changes
|
|
44
|
-
- **Dependency Synapses** — Internal imports create `depends_on` synapses, enriching the network
|
|
45
|
-
|
|
46
|
-
### Advanced Intelligence (v1.4+)
|
|
47
|
-
- **Cross-Project Transfer Learning** — Matches errors against resolved errors from ALL projects, not just the current one
|
|
48
|
-
- **Proactive Prevention** — Post-write hook checks new code against known antipatterns before errors occur
|
|
49
|
-
- **Adaptive Thresholds** — Learning thresholds auto-calibrate based on data volume (10 errors vs. 500 errors need different sensitivity)
|
|
50
|
-
- **User Feedback Loop** — Rate insights and rules as useful/not useful to improve future analysis
|
|
51
|
-
|
|
52
|
-
### Visualization (v1.5+)
|
|
53
|
-
- **Live Dashboard** — SSE-powered real-time dashboard with streaming stats
|
|
54
|
-
- **Health Score** — Single-number indicator of how well Brain is performing
|
|
55
|
-
- **Error Timeline** — Daily error counts over time, per project
|
|
56
|
-
- **Error Explain** — Full "medical record" of any error: solutions, chains, related errors, rules, insights
|
|
57
|
-
|
|
58
|
-
### Git Integration (v1.6+)
|
|
59
|
-
- **Commit Linking** — Link errors to git commits (introduced_by, fixed_by)
|
|
60
|
-
- **Diff-Aware Context** — Captures current git diff and branch when errors occur
|
|
61
|
-
- **Commit History** — Track which commits introduced errors and which fixed them
|
|
62
|
-
|
|
63
|
-
### Universal Access (v1.7+)
|
|
64
|
-
- **REST API** — Full HTTP API on port 7777 with RESTful routes + generic RPC endpoint
|
|
65
|
-
- **MCP over HTTP/SSE** — Standard MCP protocol over HTTP for Cursor, Windsurf, Cline, Continue, and other tools
|
|
66
|
-
- **Batch RPC** — Send multiple API calls in a single request
|
|
67
|
-
- **API Key Auth** — Optional authentication via `X-API-Key` header
|
|
68
|
-
|
|
69
|
-
### Semantic Search (v1.8+)
|
|
70
|
-
- **Local Embeddings** — all-MiniLM-L6-v2 (23MB) runs locally via ONNX, no cloud required
|
|
71
|
-
- **Hybrid Search** — Triple-signal matching: TF-IDF + Vector Similarity + Synapse Boost
|
|
72
|
-
- **Background Sweep** — Embeddings are computed automatically for all entries
|
|
73
|
-
- **Graceful Fallback** — Works without embeddings; vector search enhances but isn't required
|
|
11
|
+
<!-- TODO: Replace with actual recording once setup wizard is recorded -->
|
|
12
|
+
<!--  -->
|
|
74
13
|
|
|
75
14
|
## Quick Start
|
|
76
15
|
|
|
77
|
-
### Installation
|
|
78
|
-
|
|
79
16
|
```bash
|
|
80
17
|
npm install -g @timmeck/brain
|
|
18
|
+
brain setup
|
|
81
19
|
```
|
|
82
20
|
|
|
83
|
-
|
|
21
|
+
That's it. One command configures MCP, hooks, and starts the daemon. Brain is now learning from every error you encounter.
|
|
84
22
|
|
|
85
|
-
|
|
86
|
-
git clone https://github.com/timmeck/brain.git
|
|
87
|
-
cd brain
|
|
88
|
-
npm install
|
|
89
|
-
npm run build
|
|
90
|
-
```
|
|
23
|
+
## What Brain Does
|
|
91
24
|
|
|
92
|
-
###
|
|
25
|
+
### Before Brain: Every session starts from zero
|
|
93
26
|
|
|
94
|
-
|
|
27
|
+
```
|
|
28
|
+
You: Fix this TypeError
|
|
29
|
+
Claude: *investigates from scratch, tries 3 approaches, 15 minutes later finds the fix*
|
|
95
30
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
"mcpServers": {
|
|
99
|
-
"brain": {
|
|
100
|
-
"command": "brain",
|
|
101
|
-
"args": ["mcp-server"]
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
"hooks": {
|
|
105
|
-
"PostToolUse": [
|
|
106
|
-
{
|
|
107
|
-
"matcher": {
|
|
108
|
-
"tool_name": "Bash"
|
|
109
|
-
},
|
|
110
|
-
"command": "node C:\\Users\\<YOU>\\AppData\\Roaming\\npm\\node_modules\\@timmeck\\brain\\dist\\hooks\\post-tool-use.js"
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
}
|
|
31
|
+
Next day, same error in another project:
|
|
32
|
+
Claude: *investigates from scratch again*
|
|
115
33
|
```
|
|
116
34
|
|
|
117
|
-
|
|
35
|
+
### After Brain: Errors get solved faster every time
|
|
118
36
|
|
|
119
|
-
|
|
37
|
+
```
|
|
38
|
+
You: Fix this TypeError
|
|
39
|
+
Claude: *Brain found 3 similar errors. Solution with 94% confidence:
|
|
40
|
+
"Add null check before accessing .length — this pattern occurs
|
|
41
|
+
in array-processing modules across 4 of your projects."*
|
|
42
|
+
Fixed in 30 seconds.
|
|
43
|
+
```
|
|
120
44
|
|
|
121
|
-
|
|
45
|
+
### Before Brain: Duplicate code everywhere
|
|
122
46
|
|
|
123
|
-
```json
|
|
124
|
-
{
|
|
125
|
-
"brain": {
|
|
126
|
-
"url": "http://localhost:7778/sse"
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
47
|
```
|
|
48
|
+
You: Write a retry wrapper with exponential backoff
|
|
49
|
+
Claude: *writes a new implementation*
|
|
130
50
|
|
|
131
|
-
|
|
51
|
+
Meanwhile, you already have 3 retry wrappers across different projects.
|
|
52
|
+
```
|
|
132
53
|
|
|
133
|
-
###
|
|
54
|
+
### After Brain: Code is never rewritten
|
|
134
55
|
|
|
135
|
-
```bash
|
|
136
|
-
brain start
|
|
137
|
-
brain status
|
|
138
|
-
brain doctor # verify everything is configured correctly
|
|
139
56
|
```
|
|
57
|
+
You: Write a retry wrapper
|
|
58
|
+
Claude: *Brain found a reusable module: src/utils/retry.ts (project: api-server)
|
|
59
|
+
Reusability score: 0.92, used in 4 projects, 12 imports*
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Before Brain: Errors keep recurring
|
|
140
63
|
|
|
141
|
-
|
|
64
|
+
```
|
|
65
|
+
Week 1: ECONNRESET on API call → fix with retry
|
|
66
|
+
Week 2: Same ECONNRESET → debug from scratch
|
|
67
|
+
Week 3: Same pattern in different service → no idea it's related
|
|
68
|
+
```
|
|
142
69
|
|
|
143
|
-
###
|
|
70
|
+
### After Brain: Patterns emerge, prevention kicks in
|
|
144
71
|
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
72
|
+
```
|
|
73
|
+
Brain: "⚠ Warning: This code matches antipattern #7 — missing connection
|
|
74
|
+
timeout on HTTP client. This has caused ECONNRESET in 3 projects.
|
|
75
|
+
Suggested fix: add timeout: 5000 to request config."
|
|
148
76
|
```
|
|
149
77
|
|
|
150
|
-
|
|
78
|
+
## Features
|
|
79
|
+
|
|
80
|
+
- **Error Memory** — Track errors, match against known solutions with hybrid search (TF-IDF + vector + synapse boost)
|
|
81
|
+
- **Code Intelligence** — Register and discover reusable code modules across all projects
|
|
82
|
+
- **Hebbian Synapse Network** — Weighted graph where connections strengthen with use ("neurons that fire together wire together")
|
|
83
|
+
- **Auto Error Detection** — PostToolUse hook catches errors in real-time, no manual reporting needed
|
|
84
|
+
- **Cross-Project Learning** — Solutions from project A help solve errors in project B
|
|
85
|
+
- **Proactive Prevention** — Warns before errors occur when code matches known antipatterns
|
|
86
|
+
- **Semantic Search** — Local all-MiniLM-L6-v2 embeddings (23MB, no cloud required) for vector similarity
|
|
87
|
+
- **Learning Engine** — Extracts patterns, generates rules, detects antipatterns with adaptive thresholds
|
|
88
|
+
- **Research Engine** — Automated trend analysis, gap detection, cross-project synergy mapping
|
|
89
|
+
- **Git Integration** — Links errors to commits, tracks which changes introduced or fixed bugs
|
|
90
|
+
- **Universal Access** — MCP (stdio + HTTP/SSE), REST API, works with Claude Code, Cursor, Windsurf, Cline
|
|
151
91
|
|
|
152
92
|
## Architecture
|
|
153
93
|
|
|
@@ -209,27 +149,6 @@ Cross-brain peering via IPC named pipes (\\.\pipe\brain-*, /tmp/brain-*)
|
|
|
209
149
|
| **REST API** | HTTP API exposing all 40+ Brain methods as RESTful endpoints |
|
|
210
150
|
| **MCP HTTP Server** | SSE transport enabling non-Claude MCP clients (Cursor, Windsurf, etc.) |
|
|
211
151
|
|
|
212
|
-
## CLI Commands
|
|
213
|
-
|
|
214
|
-
```
|
|
215
|
-
brain start Start the Brain daemon
|
|
216
|
-
brain stop Stop the daemon
|
|
217
|
-
brain status Show stats (errors, solutions, modules, synapses, insights)
|
|
218
|
-
brain doctor Health check: daemon, DB, MCP, hooks
|
|
219
|
-
brain projects List all imported projects with module counts
|
|
220
|
-
brain query <text> Search for errors and solutions
|
|
221
|
-
brain modules List registered code modules
|
|
222
|
-
brain insights Show research insights
|
|
223
|
-
brain network Explore the synapse network
|
|
224
|
-
brain learn Trigger a learning cycle manually
|
|
225
|
-
brain explain <id> Full error report: solutions, chains, rules, insights
|
|
226
|
-
brain config View and manage Brain configuration
|
|
227
|
-
brain export Export Brain data as JSON
|
|
228
|
-
brain import <dir> Import a project directory into Brain
|
|
229
|
-
brain dashboard Generate interactive HTML dashboard (--live for SSE)
|
|
230
|
-
brain peers Show status of peer brains in the ecosystem
|
|
231
|
-
```
|
|
232
|
-
|
|
233
152
|
## MCP Tools
|
|
234
153
|
|
|
235
154
|
These tools are available to Claude Code (and other MCP clients) when Brain is configured:
|
|
@@ -254,9 +173,31 @@ These tools are available to Claude Code (and other MCP clients) when Brain is c
|
|
|
254
173
|
| `brain_query_peer` | Query another brain in the ecosystem (method + params) |
|
|
255
174
|
| `brain_error_trading_context` | Correlate an error with trading outcomes from Trading Brain |
|
|
256
175
|
|
|
176
|
+
## CLI Commands
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
brain setup One-command setup: MCP + hooks + daemon
|
|
180
|
+
brain start Start the Brain daemon
|
|
181
|
+
brain stop Stop the daemon
|
|
182
|
+
brain status Show stats (errors, solutions, modules, synapses, insights)
|
|
183
|
+
brain doctor Health check: daemon, DB, MCP, hooks
|
|
184
|
+
brain projects List all imported projects with module counts
|
|
185
|
+
brain query <text> Search for errors and solutions
|
|
186
|
+
brain modules List registered code modules
|
|
187
|
+
brain insights Show research insights
|
|
188
|
+
brain network Explore the synapse network
|
|
189
|
+
brain learn Trigger a learning cycle manually
|
|
190
|
+
brain explain <id> Full error report: solutions, chains, rules, insights
|
|
191
|
+
brain config View and manage Brain configuration
|
|
192
|
+
brain export Export Brain data as JSON
|
|
193
|
+
brain import <dir> Import a project directory into Brain
|
|
194
|
+
brain dashboard Generate interactive HTML dashboard (--live for SSE)
|
|
195
|
+
brain peers Show status of peer brains in the ecosystem
|
|
196
|
+
```
|
|
197
|
+
|
|
257
198
|
## REST API
|
|
258
199
|
|
|
259
|
-
Brain
|
|
200
|
+
Brain includes a full REST API on port 7777 (default).
|
|
260
201
|
|
|
261
202
|
### Generic RPC Endpoint
|
|
262
203
|
|
|
@@ -313,21 +254,26 @@ GET /api/v1/methods # List all 40+ available methods
|
|
|
313
254
|
|
|
314
255
|
### Authentication
|
|
315
256
|
|
|
316
|
-
Set an API key via environment variable:
|
|
317
|
-
|
|
318
257
|
```bash
|
|
319
258
|
BRAIN_API_KEY=your-secret-key brain start
|
|
259
|
+
curl -H "X-API-Key: your-secret-key" http://localhost:7777/api/v1/analytics/summary
|
|
320
260
|
```
|
|
321
261
|
|
|
322
|
-
|
|
262
|
+
## Setup with Cursor / Windsurf / Cline / Continue
|
|
323
263
|
|
|
324
|
-
|
|
325
|
-
|
|
264
|
+
Brain supports MCP over HTTP with SSE transport:
|
|
265
|
+
|
|
266
|
+
```json
|
|
267
|
+
{
|
|
268
|
+
"brain": {
|
|
269
|
+
"url": "http://localhost:7778/sse"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
326
272
|
```
|
|
327
273
|
|
|
328
|
-
|
|
274
|
+
Make sure the Brain daemon is running (`brain start`).
|
|
329
275
|
|
|
330
|
-
|
|
276
|
+
## Configuration
|
|
331
277
|
|
|
332
278
|
| Env Variable | Default | Description |
|
|
333
279
|
|---|---|---|
|
|
@@ -341,21 +287,9 @@ Brain is configured via `config.json` in the data directory or environment varia
|
|
|
341
287
|
| `BRAIN_EMBEDDINGS_ENABLED` | `true` | Enable local embeddings |
|
|
342
288
|
| `BRAIN_EMBEDDINGS_MODEL` | `Xenova/all-MiniLM-L6-v2` | Embedding model |
|
|
343
289
|
|
|
344
|
-
## Auto Error Detection
|
|
345
|
-
|
|
346
|
-
When the PostToolUse hook is configured, Brain automatically:
|
|
347
|
-
|
|
348
|
-
1. **Captures errors** — Detects errors from Bash command output (exit codes, error patterns like `TypeError`, `ENOENT`, `npm ERR!`, `BUILD FAILED`, etc.)
|
|
349
|
-
2. **Reports to Brain** — Sends the error to the daemon for storage and matching
|
|
350
|
-
3. **Suggests solutions** — If Brain has seen a similar error before, it outputs a hint via stderr
|
|
351
|
-
4. **Checks antipatterns** — Warns if the error matches a known antipattern
|
|
352
|
-
5. **Checks code** — PostWrite hook proactively checks new code against known error patterns
|
|
353
|
-
|
|
354
|
-
This happens silently in the background — no manual intervention needed.
|
|
355
|
-
|
|
356
290
|
## How It Learns
|
|
357
291
|
|
|
358
|
-
1. **Error Reported** — Claude encounters an error
|
|
292
|
+
1. **Error Reported** — Claude encounters an error (hook catches it automatically or via `brain_report_error`)
|
|
359
293
|
2. **Context Enriched** — Brain captures task context, working directory, command, git branch, and diff
|
|
360
294
|
3. **Hybrid Matched** — Error is compared against known errors using TF-IDF signals, vector embeddings, and synapse proximity
|
|
361
295
|
4. **Solution Found** — When the error is fixed, `brain_report_solution` records the fix
|
|
@@ -366,17 +300,6 @@ This happens silently in the background — no manual intervention needed.
|
|
|
366
300
|
9. **Embeddings Computed** — Background sweep generates vector embeddings for semantic search
|
|
367
301
|
10. **Next Time** — When a similar error appears, Brain instantly suggests the proven solution — even from other projects
|
|
368
302
|
|
|
369
|
-
## Tech Stack
|
|
370
|
-
|
|
371
|
-
- **TypeScript** — Full type safety, ES2022 target, ESM modules
|
|
372
|
-
- **better-sqlite3** — Fast, embedded, synchronous database
|
|
373
|
-
- **MCP SDK** — Model Context Protocol integration (stdio + HTTP/SSE transports)
|
|
374
|
-
- **@huggingface/transformers** — Local ONNX-based sentence embeddings (all-MiniLM-L6-v2)
|
|
375
|
-
- **Commander** — CLI framework
|
|
376
|
-
- **Chalk** — Colored terminal output
|
|
377
|
-
- **Winston** — Structured logging
|
|
378
|
-
- **Vitest** — Testing
|
|
379
|
-
|
|
380
303
|
## Brain Ecosystem
|
|
381
304
|
|
|
382
305
|
Brain is part of the **Brain Ecosystem** — a family of standalone MCP servers that give Claude Code persistent, self-learning memory.
|
|
@@ -386,7 +309,7 @@ Brain is part of the **Brain Ecosystem** — a family of standalone MCP servers
|
|
|
386
309
|
| **Brain** | Error memory & code intelligence | **7777** / 7778 |
|
|
387
310
|
| [Trading Brain](https://github.com/timmeck/trading-brain) | Adaptive trading intelligence | 7779 / 7780 |
|
|
388
311
|
| [Marketing Brain](https://github.com/timmeck/marketing-brain) | Content strategy & engagement | 7781 / 7782 |
|
|
389
|
-
| [Brain Core](https://github.com/timmeck/brain-core) v1.
|
|
312
|
+
| [Brain Core](https://github.com/timmeck/brain-core) v1.5.0 | Shared infrastructure (IPC, MCP, REST, CLI, math, synapses) | — |
|
|
390
313
|
| [Brain Hub](https://timmeck.github.io/brain-hub/) | Ecosystem landing page | — |
|
|
391
314
|
|
|
392
315
|
Each brain is **fully standalone** — [Brain Core](https://www.npmjs.com/package/@timmeck/brain-core) provides shared infrastructure (IPC, MCP, REST API, CLI, math, synapse algorithms) used by all brains, eliminating ~2,800 lines of duplicated code.
|
|
@@ -395,9 +318,16 @@ Each brain is **fully standalone** — [Brain Core](https://www.npmjs.com/packag
|
|
|
395
318
|
|
|
396
319
|
Brains discover and query each other at runtime via IPC named pipes. Use `brain peers` to see online peers, or the `brain_query_peer` / `brain_ecosystem_status` MCP tools to access peer data from Claude Code. Brains also push event notifications to each other — when Brain reports an error, Trading Brain and Marketing Brain are notified automatically.
|
|
397
320
|
|
|
398
|
-
|
|
321
|
+
## Tech Stack
|
|
399
322
|
|
|
400
|
-
|
|
323
|
+
- **TypeScript** — Full type safety, ES2022 target, ESM modules
|
|
324
|
+
- **better-sqlite3** — Fast, embedded, synchronous database
|
|
325
|
+
- **MCP SDK** — Model Context Protocol integration (stdio + HTTP/SSE transports)
|
|
326
|
+
- **@huggingface/transformers** — Local ONNX-based sentence embeddings (all-MiniLM-L6-v2)
|
|
327
|
+
- **Commander** — CLI framework
|
|
328
|
+
- **Chalk** — Colored terminal output
|
|
329
|
+
- **Winston** — Structured logging
|
|
330
|
+
- **Vitest** — Testing (189 tests)
|
|
401
331
|
|
|
402
332
|
## License
|
|
403
333
|
|
package/brain.log
CHANGED
|
@@ -3874,3 +3874,389 @@
|
|
|
3874
3874
|
2026-02-27T15:40:46.845Z [info] Applying migration 009_embeddings
|
|
3875
3875
|
2026-02-27T15:40:46.845Z [info] Migrations complete. Now at version 9
|
|
3876
3876
|
2026-02-27T15:40:46.850Z [info] New error reported (id=1, type=Error)
|
|
3877
|
+
2026-02-27T16:17:59.261Z [info] Running 9 migration(s) from version 0
|
|
3878
|
+
2026-02-27T16:17:59.262Z [info] Applying migration 001_core_schema
|
|
3879
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 002_learning_schema
|
|
3880
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 003_code_schema
|
|
3881
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 004_synapses_schema
|
|
3882
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 005_fts_indexes
|
|
3883
|
+
2026-02-27T16:17:59.265Z [info] Applying migration 006_synapses_phase3
|
|
3884
|
+
2026-02-27T16:17:59.265Z [info] Applying migration 007_feedback
|
|
3885
|
+
2026-02-27T16:17:59.267Z [info] Applying migration 008_git_integration
|
|
3886
|
+
2026-02-27T16:17:59.267Z [info] Applying migration 009_embeddings
|
|
3887
|
+
2026-02-27T16:17:59.268Z [info] Migrations complete. Now at version 9
|
|
3888
|
+
2026-02-27T16:17:59.271Z [info] Running 9 migration(s) from version 0
|
|
3889
|
+
2026-02-27T16:17:59.271Z [info] Applying migration 001_core_schema
|
|
3890
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 002_learning_schema
|
|
3891
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 003_code_schema
|
|
3892
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 004_synapses_schema
|
|
3893
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 005_fts_indexes
|
|
3894
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 006_synapses_phase3
|
|
3895
|
+
2026-02-27T16:17:59.274Z [info] Applying migration 007_feedback
|
|
3896
|
+
2026-02-27T16:17:59.275Z [info] Applying migration 008_git_integration
|
|
3897
|
+
2026-02-27T16:17:59.276Z [info] Applying migration 009_embeddings
|
|
3898
|
+
2026-02-27T16:17:59.276Z [info] Migrations complete. Now at version 9
|
|
3899
|
+
2026-02-27T16:17:59.279Z [info] Gap analysis complete: 1 insights
|
|
3900
|
+
2026-02-27T16:17:59.261Z [info] Running 9 migration(s) from version 0
|
|
3901
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 001_core_schema
|
|
3902
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 002_learning_schema
|
|
3903
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 003_code_schema
|
|
3904
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 004_synapses_schema
|
|
3905
|
+
2026-02-27T16:17:59.265Z [info] Applying migration 005_fts_indexes
|
|
3906
|
+
2026-02-27T16:17:59.266Z [info] Applying migration 006_synapses_phase3
|
|
3907
|
+
2026-02-27T16:17:59.266Z [info] Applying migration 007_feedback
|
|
3908
|
+
2026-02-27T16:17:59.268Z [info] Applying migration 008_git_integration
|
|
3909
|
+
2026-02-27T16:17:59.269Z [info] Applying migration 009_embeddings
|
|
3910
|
+
2026-02-27T16:17:59.270Z [info] Migrations complete. Now at version 9
|
|
3911
|
+
2026-02-27T16:17:59.273Z [info] Running 9 migration(s) from version 0
|
|
3912
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 001_core_schema
|
|
3913
|
+
2026-02-27T16:17:59.274Z [info] Applying migration 002_learning_schema
|
|
3914
|
+
2026-02-27T16:17:59.274Z [info] Applying migration 003_code_schema
|
|
3915
|
+
2026-02-27T16:17:59.274Z [info] Applying migration 004_synapses_schema
|
|
3916
|
+
2026-02-27T16:17:59.274Z [info] Applying migration 005_fts_indexes
|
|
3917
|
+
2026-02-27T16:17:59.275Z [info] Applying migration 006_synapses_phase3
|
|
3918
|
+
2026-02-27T16:17:59.275Z [info] Applying migration 007_feedback
|
|
3919
|
+
2026-02-27T16:17:59.276Z [info] Applying migration 008_git_integration
|
|
3920
|
+
2026-02-27T16:17:59.277Z [info] Applying migration 009_embeddings
|
|
3921
|
+
2026-02-27T16:17:59.277Z [info] Migrations complete. Now at version 9
|
|
3922
|
+
2026-02-27T16:17:59.280Z [info] Trend analysis complete: 0 insights
|
|
3923
|
+
2026-02-27T16:17:59.261Z [info] Running 9 migration(s) from version 0
|
|
3924
|
+
2026-02-27T16:17:59.261Z [info] Running 9 migration(s) from version 0
|
|
3925
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 001_core_schema
|
|
3926
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 002_learning_schema
|
|
3927
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 003_code_schema
|
|
3928
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 004_synapses_schema
|
|
3929
|
+
2026-02-27T16:17:59.265Z [info] Applying migration 005_fts_indexes
|
|
3930
|
+
2026-02-27T16:17:59.265Z [info] Applying migration 006_synapses_phase3
|
|
3931
|
+
2026-02-27T16:17:59.266Z [info] Applying migration 007_feedback
|
|
3932
|
+
2026-02-27T16:17:59.268Z [info] Applying migration 008_git_integration
|
|
3933
|
+
2026-02-27T16:17:59.268Z [info] Applying migration 009_embeddings
|
|
3934
|
+
2026-02-27T16:17:59.269Z [info] Migrations complete. Now at version 9
|
|
3935
|
+
2026-02-27T16:17:59.272Z [info] Running 9 migration(s) from version 0
|
|
3936
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 001_core_schema
|
|
3937
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 002_learning_schema
|
|
3938
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 003_code_schema
|
|
3939
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 004_synapses_schema
|
|
3940
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 005_fts_indexes
|
|
3941
|
+
2026-02-27T16:17:59.274Z [info] Applying migration 006_synapses_phase3
|
|
3942
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 001_core_schema
|
|
3943
|
+
2026-02-27T16:17:59.274Z [info] Applying migration 007_feedback
|
|
3944
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 002_learning_schema
|
|
3945
|
+
2026-02-27T16:17:59.276Z [info] Applying migration 008_git_integration
|
|
3946
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 003_code_schema
|
|
3947
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 004_synapses_schema
|
|
3948
|
+
2026-02-27T16:17:59.276Z [info] Applying migration 009_embeddings
|
|
3949
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 005_fts_indexes
|
|
3950
|
+
2026-02-27T16:17:59.265Z [info] Applying migration 006_synapses_phase3
|
|
3951
|
+
2026-02-27T16:17:59.277Z [info] Migrations complete. Now at version 9
|
|
3952
|
+
2026-02-27T16:17:59.265Z [info] Applying migration 007_feedback
|
|
3953
|
+
2026-02-27T16:17:59.279Z [info] Running 9 migration(s) from version 0
|
|
3954
|
+
2026-02-27T16:17:59.267Z [info] Applying migration 008_git_integration
|
|
3955
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 001_core_schema
|
|
3956
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 002_learning_schema
|
|
3957
|
+
2026-02-27T16:17:59.267Z [info] Applying migration 009_embeddings
|
|
3958
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 003_code_schema
|
|
3959
|
+
2026-02-27T16:17:59.268Z [info] Migrations complete. Now at version 9
|
|
3960
|
+
2026-02-27T16:17:59.280Z [info] Applying migration 004_synapses_schema
|
|
3961
|
+
2026-02-27T16:17:59.271Z [info] Running 9 migration(s) from version 0
|
|
3962
|
+
2026-02-27T16:17:59.280Z [info] Applying migration 005_fts_indexes
|
|
3963
|
+
2026-02-27T16:17:59.271Z [info] Applying migration 001_core_schema
|
|
3964
|
+
2026-02-27T16:17:59.280Z [info] Applying migration 006_synapses_phase3
|
|
3965
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 002_learning_schema
|
|
3966
|
+
2026-02-27T16:17:59.281Z [info] Applying migration 007_feedback
|
|
3967
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 003_code_schema
|
|
3968
|
+
2026-02-27T16:17:59.282Z [info] Applying migration 008_git_integration
|
|
3969
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 004_synapses_schema
|
|
3970
|
+
2026-02-27T16:17:59.283Z [info] Applying migration 009_embeddings
|
|
3971
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 005_fts_indexes
|
|
3972
|
+
2026-02-27T16:17:59.283Z [info] Migrations complete. Now at version 9
|
|
3973
|
+
2026-02-27T16:17:59.285Z [info] Running 9 migration(s) from version 0
|
|
3974
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 006_synapses_phase3
|
|
3975
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 001_core_schema
|
|
3976
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 007_feedback
|
|
3977
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 002_learning_schema
|
|
3978
|
+
2026-02-27T16:17:59.274Z [info] Applying migration 008_git_integration
|
|
3979
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 003_code_schema
|
|
3980
|
+
2026-02-27T16:17:59.275Z [info] Applying migration 009_embeddings
|
|
3981
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 004_synapses_schema
|
|
3982
|
+
2026-02-27T16:17:59.275Z [info] Migrations complete. Now at version 9
|
|
3983
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 005_fts_indexes
|
|
3984
|
+
2026-02-27T16:17:59.278Z [info] Running 9 migration(s) from version 0
|
|
3985
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 006_synapses_phase3
|
|
3986
|
+
2026-02-27T16:17:59.278Z [info] Applying migration 001_core_schema
|
|
3987
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 007_feedback
|
|
3988
|
+
2026-02-27T16:17:59.278Z [info] Applying migration 002_learning_schema
|
|
3989
|
+
2026-02-27T16:17:59.289Z [info] Applying migration 008_git_integration
|
|
3990
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 003_code_schema
|
|
3991
|
+
2026-02-27T16:17:59.289Z [info] Applying migration 009_embeddings
|
|
3992
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 004_synapses_schema
|
|
3993
|
+
2026-02-27T16:17:59.290Z [info] Migrations complete. Now at version 9
|
|
3994
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 005_fts_indexes
|
|
3995
|
+
2026-02-27T16:17:59.280Z [info] Applying migration 006_synapses_phase3
|
|
3996
|
+
2026-02-27T16:17:59.280Z [info] Applying migration 007_feedback
|
|
3997
|
+
2026-02-27T16:17:59.281Z [info] Applying migration 008_git_integration
|
|
3998
|
+
2026-02-27T16:17:59.282Z [info] Applying migration 009_embeddings
|
|
3999
|
+
2026-02-27T16:17:59.282Z [info] Migrations complete. Now at version 9
|
|
4000
|
+
2026-02-27T16:17:59.285Z [info] Running 9 migration(s) from version 0
|
|
4001
|
+
2026-02-27T16:17:59.285Z [info] Applying migration 001_core_schema
|
|
4002
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 002_learning_schema
|
|
4003
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 003_code_schema
|
|
4004
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 004_synapses_schema
|
|
4005
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 005_fts_indexes
|
|
4006
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 006_synapses_phase3
|
|
4007
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 007_feedback
|
|
4008
|
+
2026-02-27T16:17:59.288Z [info] Applying migration 008_git_integration
|
|
4009
|
+
2026-02-27T16:17:59.289Z [info] Applying migration 009_embeddings
|
|
4010
|
+
2026-02-27T16:17:59.289Z [info] Migrations complete. Now at version 9
|
|
4011
|
+
2026-02-27T16:17:59.261Z [info] Running 9 migration(s) from version 0
|
|
4012
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 001_core_schema
|
|
4013
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 002_learning_schema
|
|
4014
|
+
2026-02-27T16:17:59.263Z [info] Applying migration 003_code_schema
|
|
4015
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 004_synapses_schema
|
|
4016
|
+
2026-02-27T16:17:59.264Z [info] Applying migration 005_fts_indexes
|
|
4017
|
+
2026-02-27T16:17:59.265Z [info] Applying migration 006_synapses_phase3
|
|
4018
|
+
2026-02-27T16:17:59.265Z [info] Applying migration 007_feedback
|
|
4019
|
+
2026-02-27T16:17:59.267Z [info] Applying migration 008_git_integration
|
|
4020
|
+
2026-02-27T16:17:59.267Z [info] Applying migration 009_embeddings
|
|
4021
|
+
2026-02-27T16:17:59.268Z [info] Migrations complete. Now at version 9
|
|
4022
|
+
2026-02-27T16:17:59.271Z [info] Running 9 migration(s) from version 0
|
|
4023
|
+
2026-02-27T16:17:59.271Z [info] Applying migration 001_core_schema
|
|
4024
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 002_learning_schema
|
|
4025
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 003_code_schema
|
|
4026
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 004_synapses_schema
|
|
4027
|
+
2026-02-27T16:17:59.272Z [info] Applying migration 005_fts_indexes
|
|
4028
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 006_synapses_phase3
|
|
4029
|
+
2026-02-27T16:17:59.273Z [info] Applying migration 007_feedback
|
|
4030
|
+
2026-02-27T16:17:59.274Z [info] Applying migration 008_git_integration
|
|
4031
|
+
2026-02-27T16:17:59.275Z [info] Applying migration 009_embeddings
|
|
4032
|
+
2026-02-27T16:17:59.276Z [info] Migrations complete. Now at version 9
|
|
4033
|
+
2026-02-27T16:17:59.278Z [info] Running 9 migration(s) from version 0
|
|
4034
|
+
2026-02-27T16:17:59.278Z [info] Applying migration 001_core_schema
|
|
4035
|
+
2026-02-27T16:17:59.278Z [info] Applying migration 002_learning_schema
|
|
4036
|
+
2026-02-27T16:17:59.278Z [info] Applying migration 003_code_schema
|
|
4037
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 004_synapses_schema
|
|
4038
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 005_fts_indexes
|
|
4039
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 006_synapses_phase3
|
|
4040
|
+
2026-02-27T16:17:59.280Z [info] Applying migration 007_feedback
|
|
4041
|
+
2026-02-27T16:17:59.282Z [info] Applying migration 008_git_integration
|
|
4042
|
+
2026-02-27T16:17:59.282Z [info] Applying migration 009_embeddings
|
|
4043
|
+
2026-02-27T16:17:59.283Z [info] Migrations complete. Now at version 9
|
|
4044
|
+
2026-02-27T16:17:59.286Z [info] Running 9 migration(s) from version 0
|
|
4045
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 001_core_schema
|
|
4046
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 002_learning_schema
|
|
4047
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 003_code_schema
|
|
4048
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 004_synapses_schema
|
|
4049
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 005_fts_indexes
|
|
4050
|
+
2026-02-27T16:17:59.288Z [info] Applying migration 006_synapses_phase3
|
|
4051
|
+
2026-02-27T16:17:59.288Z [info] Applying migration 007_feedback
|
|
4052
|
+
2026-02-27T16:17:59.289Z [info] Applying migration 008_git_integration
|
|
4053
|
+
2026-02-27T16:17:59.290Z [info] Applying migration 009_embeddings
|
|
4054
|
+
2026-02-27T16:17:59.290Z [info] Migrations complete. Now at version 9
|
|
4055
|
+
2026-02-27T16:17:59.279Z [info] Running 9 migration(s) from version 0
|
|
4056
|
+
2026-02-27T16:17:59.281Z [info] Applying migration 001_core_schema
|
|
4057
|
+
2026-02-27T16:17:59.282Z [info] Applying migration 002_learning_schema
|
|
4058
|
+
2026-02-27T16:17:59.282Z [info] Applying migration 003_code_schema
|
|
4059
|
+
2026-02-27T16:17:59.282Z [info] Applying migration 004_synapses_schema
|
|
4060
|
+
2026-02-27T16:17:59.282Z [info] Applying migration 005_fts_indexes
|
|
4061
|
+
2026-02-27T16:17:59.283Z [info] Applying migration 006_synapses_phase3
|
|
4062
|
+
2026-02-27T16:17:59.284Z [info] Applying migration 007_feedback
|
|
4063
|
+
2026-02-27T16:17:59.285Z [info] Applying migration 008_git_integration
|
|
4064
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 009_embeddings
|
|
4065
|
+
2026-02-27T16:17:59.286Z [info] Migrations complete. Now at version 9
|
|
4066
|
+
2026-02-27T16:17:59.289Z [info] Learning cycle starting
|
|
4067
|
+
2026-02-27T16:17:59.290Z [info] Running synapse decay cycle
|
|
4068
|
+
2026-02-27T16:17:59.290Z [info] Decay complete: 0 decayed, 0 pruned
|
|
4069
|
+
2026-02-27T16:17:59.290Z [info] Learning cycle complete: 1 patterns, 0 rules, 0 pruned, 0 antipatterns (1ms)
|
|
4070
|
+
2026-02-27T16:17:59.291Z [info] Running 9 migration(s) from version 0
|
|
4071
|
+
2026-02-27T16:17:59.291Z [info] Applying migration 001_core_schema
|
|
4072
|
+
2026-02-27T16:17:59.291Z [info] Applying migration 002_learning_schema
|
|
4073
|
+
2026-02-27T16:17:59.291Z [info] Applying migration 003_code_schema
|
|
4074
|
+
2026-02-27T16:17:59.291Z [info] Applying migration 004_synapses_schema
|
|
4075
|
+
2026-02-27T16:17:59.292Z [info] Applying migration 005_fts_indexes
|
|
4076
|
+
2026-02-27T16:17:59.292Z [info] Applying migration 006_synapses_phase3
|
|
4077
|
+
2026-02-27T16:17:59.293Z [info] Applying migration 007_feedback
|
|
4078
|
+
2026-02-27T16:17:59.294Z [info] Applying migration 008_git_integration
|
|
4079
|
+
2026-02-27T16:17:59.295Z [info] Applying migration 009_embeddings
|
|
4080
|
+
2026-02-27T16:17:59.296Z [info] Migrations complete. Now at version 9
|
|
4081
|
+
2026-02-27T16:17:59.298Z [info] Learning cycle starting
|
|
4082
|
+
2026-02-27T16:17:59.298Z [info] Running synapse decay cycle
|
|
4083
|
+
2026-02-27T16:17:59.298Z [info] Decay complete: 0 decayed, 0 pruned
|
|
4084
|
+
2026-02-27T16:17:59.298Z [info] Learning cycle complete: 1 patterns, 0 rules, 0 pruned, 0 antipatterns (0ms)
|
|
4085
|
+
2026-02-27T16:17:59.299Z [info] Running 9 migration(s) from version 0
|
|
4086
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 001_core_schema
|
|
4087
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 002_learning_schema
|
|
4088
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 003_code_schema
|
|
4089
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 004_synapses_schema
|
|
4090
|
+
2026-02-27T16:17:59.300Z [info] Applying migration 005_fts_indexes
|
|
4091
|
+
2026-02-27T16:17:59.300Z [info] Applying migration 006_synapses_phase3
|
|
4092
|
+
2026-02-27T16:17:59.301Z [info] Applying migration 007_feedback
|
|
4093
|
+
2026-02-27T16:17:59.302Z [info] Applying migration 008_git_integration
|
|
4094
|
+
2026-02-27T16:17:59.303Z [info] Applying migration 009_embeddings
|
|
4095
|
+
2026-02-27T16:17:59.303Z [info] Migrations complete. Now at version 9
|
|
4096
|
+
2026-02-27T16:17:59.275Z [info] Running 9 migration(s) from version 0
|
|
4097
|
+
2026-02-27T16:17:59.276Z [info] Applying migration 001_core_schema
|
|
4098
|
+
2026-02-27T16:17:59.277Z [info] Applying migration 002_learning_schema
|
|
4099
|
+
2026-02-27T16:17:59.277Z [info] Applying migration 003_code_schema
|
|
4100
|
+
2026-02-27T16:17:59.277Z [info] Applying migration 004_synapses_schema
|
|
4101
|
+
2026-02-27T16:17:59.278Z [info] Applying migration 005_fts_indexes
|
|
4102
|
+
2026-02-27T16:17:59.278Z [info] Applying migration 006_synapses_phase3
|
|
4103
|
+
2026-02-27T16:17:59.279Z [info] Applying migration 007_feedback
|
|
4104
|
+
2026-02-27T16:17:59.280Z [info] Applying migration 008_git_integration
|
|
4105
|
+
2026-02-27T16:17:59.281Z [info] Applying migration 009_embeddings
|
|
4106
|
+
2026-02-27T16:17:59.282Z [info] Migrations complete. Now at version 9
|
|
4107
|
+
2026-02-27T16:17:59.285Z [info] Running 9 migration(s) from version 0
|
|
4108
|
+
2026-02-27T16:17:59.285Z [info] Applying migration 001_core_schema
|
|
4109
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 002_learning_schema
|
|
4110
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 003_code_schema
|
|
4111
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 004_synapses_schema
|
|
4112
|
+
2026-02-27T16:17:59.286Z [info] Applying migration 005_fts_indexes
|
|
4113
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 006_synapses_phase3
|
|
4114
|
+
2026-02-27T16:17:59.287Z [info] Applying migration 007_feedback
|
|
4115
|
+
2026-02-27T16:17:59.288Z [info] Applying migration 008_git_integration
|
|
4116
|
+
2026-02-27T16:17:59.289Z [info] Applying migration 009_embeddings
|
|
4117
|
+
2026-02-27T16:17:59.289Z [info] Migrations complete. Now at version 9
|
|
4118
|
+
2026-02-27T16:17:59.291Z [info] Running 9 migration(s) from version 0
|
|
4119
|
+
2026-02-27T16:17:59.291Z [info] Applying migration 001_core_schema
|
|
4120
|
+
2026-02-27T16:17:59.292Z [info] Applying migration 002_learning_schema
|
|
4121
|
+
2026-02-27T16:17:59.292Z [info] Applying migration 003_code_schema
|
|
4122
|
+
2026-02-27T16:17:59.292Z [info] Applying migration 004_synapses_schema
|
|
4123
|
+
2026-02-27T16:17:59.292Z [info] Applying migration 005_fts_indexes
|
|
4124
|
+
2026-02-27T16:17:59.293Z [info] Applying migration 006_synapses_phase3
|
|
4125
|
+
2026-02-27T16:17:59.294Z [info] Applying migration 007_feedback
|
|
4126
|
+
2026-02-27T16:17:59.295Z [info] Applying migration 008_git_integration
|
|
4127
|
+
2026-02-27T16:17:59.295Z [info] Applying migration 009_embeddings
|
|
4128
|
+
2026-02-27T16:17:59.296Z [info] Migrations complete. Now at version 9
|
|
4129
|
+
2026-02-27T16:17:59.298Z [info] Running 9 migration(s) from version 0
|
|
4130
|
+
2026-02-27T16:17:59.298Z [info] Applying migration 001_core_schema
|
|
4131
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 002_learning_schema
|
|
4132
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 003_code_schema
|
|
4133
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 004_synapses_schema
|
|
4134
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 005_fts_indexes
|
|
4135
|
+
2026-02-27T16:17:59.300Z [info] Applying migration 006_synapses_phase3
|
|
4136
|
+
2026-02-27T16:17:59.300Z [info] Applying migration 007_feedback
|
|
4137
|
+
2026-02-27T16:17:59.301Z [info] Applying migration 008_git_integration
|
|
4138
|
+
2026-02-27T16:17:59.302Z [info] Applying migration 009_embeddings
|
|
4139
|
+
2026-02-27T16:17:59.302Z [info] Migrations complete. Now at version 9
|
|
4140
|
+
2026-02-27T16:17:59.304Z [info] Running 9 migration(s) from version 0
|
|
4141
|
+
2026-02-27T16:17:59.304Z [info] Applying migration 001_core_schema
|
|
4142
|
+
2026-02-27T16:17:59.305Z [info] Applying migration 002_learning_schema
|
|
4143
|
+
2026-02-27T16:17:59.305Z [info] Applying migration 003_code_schema
|
|
4144
|
+
2026-02-27T16:17:59.305Z [info] Applying migration 004_synapses_schema
|
|
4145
|
+
2026-02-27T16:17:59.305Z [info] Applying migration 005_fts_indexes
|
|
4146
|
+
2026-02-27T16:17:59.306Z [info] Applying migration 006_synapses_phase3
|
|
4147
|
+
2026-02-27T16:17:59.306Z [info] Applying migration 007_feedback
|
|
4148
|
+
2026-02-27T16:17:59.307Z [info] Applying migration 008_git_integration
|
|
4149
|
+
2026-02-27T16:17:59.308Z [info] Applying migration 009_embeddings
|
|
4150
|
+
2026-02-27T16:17:59.309Z [info] Migrations complete. Now at version 9
|
|
4151
|
+
2026-02-27T16:17:59.311Z [info] Running synapse decay cycle
|
|
4152
|
+
2026-02-27T16:17:59.311Z [info] Decay complete: 0 decayed, 1 pruned
|
|
4153
|
+
2026-02-27T16:17:59.292Z [info] Running 9 migration(s) from version 0
|
|
4154
|
+
2026-02-27T16:17:59.293Z [info] Applying migration 001_core_schema
|
|
4155
|
+
2026-02-27T16:17:59.294Z [info] Applying migration 002_learning_schema
|
|
4156
|
+
2026-02-27T16:17:59.294Z [info] Applying migration 003_code_schema
|
|
4157
|
+
2026-02-27T16:17:59.294Z [info] Applying migration 004_synapses_schema
|
|
4158
|
+
2026-02-27T16:17:59.295Z [info] Applying migration 005_fts_indexes
|
|
4159
|
+
2026-02-27T16:17:59.295Z [info] Applying migration 006_synapses_phase3
|
|
4160
|
+
2026-02-27T16:17:59.296Z [info] Applying migration 007_feedback
|
|
4161
|
+
2026-02-27T16:17:59.297Z [info] Applying migration 008_git_integration
|
|
4162
|
+
2026-02-27T16:17:59.298Z [info] Applying migration 009_embeddings
|
|
4163
|
+
2026-02-27T16:17:59.298Z [info] Migrations complete. Now at version 9
|
|
4164
|
+
2026-02-27T16:17:59.303Z [info] Code module registered (id=1, name=retry, granularity=file, score=0.96)
|
|
4165
|
+
2026-02-27T16:17:59.304Z [info] Running 9 migration(s) from version 0
|
|
4166
|
+
2026-02-27T16:17:59.304Z [info] Applying migration 001_core_schema
|
|
4167
|
+
2026-02-27T16:17:59.304Z [info] Applying migration 002_learning_schema
|
|
4168
|
+
2026-02-27T16:17:59.304Z [info] Applying migration 003_code_schema
|
|
4169
|
+
2026-02-27T16:17:59.304Z [info] Applying migration 004_synapses_schema
|
|
4170
|
+
2026-02-27T16:17:59.305Z [info] Applying migration 005_fts_indexes
|
|
4171
|
+
2026-02-27T16:17:59.305Z [info] Applying migration 006_synapses_phase3
|
|
4172
|
+
2026-02-27T16:17:59.306Z [info] Applying migration 007_feedback
|
|
4173
|
+
2026-02-27T16:17:59.307Z [info] Applying migration 008_git_integration
|
|
4174
|
+
2026-02-27T16:17:59.308Z [info] Applying migration 009_embeddings
|
|
4175
|
+
2026-02-27T16:17:59.308Z [info] Migrations complete. Now at version 9
|
|
4176
|
+
2026-02-27T16:17:59.311Z [info] Code module registered (id=1, name=retry, granularity=file, score=0.96)
|
|
4177
|
+
2026-02-27T16:17:59.312Z [info] Running 9 migration(s) from version 0
|
|
4178
|
+
2026-02-27T16:17:59.312Z [info] Applying migration 001_core_schema
|
|
4179
|
+
2026-02-27T16:17:59.312Z [info] Applying migration 002_learning_schema
|
|
4180
|
+
2026-02-27T16:17:59.312Z [info] Applying migration 003_code_schema
|
|
4181
|
+
2026-02-27T16:17:59.312Z [info] Applying migration 004_synapses_schema
|
|
4182
|
+
2026-02-27T16:17:59.313Z [info] Applying migration 005_fts_indexes
|
|
4183
|
+
2026-02-27T16:17:59.313Z [info] Applying migration 006_synapses_phase3
|
|
4184
|
+
2026-02-27T16:17:59.314Z [info] Applying migration 007_feedback
|
|
4185
|
+
2026-02-27T16:17:59.315Z [info] Applying migration 008_git_integration
|
|
4186
|
+
2026-02-27T16:17:59.316Z [info] Applying migration 009_embeddings
|
|
4187
|
+
2026-02-27T16:17:59.316Z [info] Migrations complete. Now at version 9
|
|
4188
|
+
2026-02-27T16:17:59.318Z [info] Code module registered (id=1, name=retry, granularity=file, score=0.96)
|
|
4189
|
+
2026-02-27T16:17:59.319Z [info] Running 9 migration(s) from version 0
|
|
4190
|
+
2026-02-27T16:17:59.319Z [info] Applying migration 001_core_schema
|
|
4191
|
+
2026-02-27T16:17:59.319Z [info] Applying migration 002_learning_schema
|
|
4192
|
+
2026-02-27T16:17:59.319Z [info] Applying migration 003_code_schema
|
|
4193
|
+
2026-02-27T16:17:59.319Z [info] Applying migration 004_synapses_schema
|
|
4194
|
+
2026-02-27T16:17:59.320Z [info] Applying migration 005_fts_indexes
|
|
4195
|
+
2026-02-27T16:17:59.320Z [info] Applying migration 006_synapses_phase3
|
|
4196
|
+
2026-02-27T16:17:59.321Z [info] Applying migration 007_feedback
|
|
4197
|
+
2026-02-27T16:17:59.322Z [info] Applying migration 008_git_integration
|
|
4198
|
+
2026-02-27T16:17:59.323Z [info] Applying migration 009_embeddings
|
|
4199
|
+
2026-02-27T16:17:59.323Z [info] Migrations complete. Now at version 9
|
|
4200
|
+
2026-02-27T16:17:59.325Z [info] Code module registered (id=1, name=retry, granularity=file, score=0.96)
|
|
4201
|
+
2026-02-27T16:17:59.296Z [info] Running 9 migration(s) from version 0
|
|
4202
|
+
2026-02-27T16:17:59.297Z [info] Applying migration 001_core_schema
|
|
4203
|
+
2026-02-27T16:17:59.298Z [info] Applying migration 002_learning_schema
|
|
4204
|
+
2026-02-27T16:17:59.298Z [info] Applying migration 003_code_schema
|
|
4205
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 004_synapses_schema
|
|
4206
|
+
2026-02-27T16:17:59.299Z [info] Applying migration 005_fts_indexes
|
|
4207
|
+
2026-02-27T16:17:59.300Z [info] Applying migration 006_synapses_phase3
|
|
4208
|
+
2026-02-27T16:17:59.300Z [info] Applying migration 007_feedback
|
|
4209
|
+
2026-02-27T16:17:59.301Z [info] Applying migration 008_git_integration
|
|
4210
|
+
2026-02-27T16:17:59.302Z [info] Applying migration 009_embeddings
|
|
4211
|
+
2026-02-27T16:17:59.303Z [info] Migrations complete. Now at version 9
|
|
4212
|
+
2026-02-27T16:17:59.306Z [info] New error reported (id=1, type=TypeError)
|
|
4213
|
+
2026-02-27T16:17:59.307Z [info] Running 9 migration(s) from version 0
|
|
4214
|
+
2026-02-27T16:17:59.307Z [info] Applying migration 001_core_schema
|
|
4215
|
+
2026-02-27T16:17:59.308Z [info] Applying migration 002_learning_schema
|
|
4216
|
+
2026-02-27T16:17:59.308Z [info] Applying migration 003_code_schema
|
|
4217
|
+
2026-02-27T16:17:59.308Z [info] Applying migration 004_synapses_schema
|
|
4218
|
+
2026-02-27T16:17:59.308Z [info] Applying migration 005_fts_indexes
|
|
4219
|
+
2026-02-27T16:17:59.309Z [info] Applying migration 006_synapses_phase3
|
|
4220
|
+
2026-02-27T16:17:59.309Z [info] Applying migration 007_feedback
|
|
4221
|
+
2026-02-27T16:17:59.311Z [info] Applying migration 008_git_integration
|
|
4222
|
+
2026-02-27T16:17:59.311Z [info] Applying migration 009_embeddings
|
|
4223
|
+
2026-02-27T16:17:59.312Z [info] Migrations complete. Now at version 9
|
|
4224
|
+
2026-02-27T16:17:59.314Z [info] New error reported (id=1, type=TypeError)
|
|
4225
|
+
2026-02-27T16:17:59.314Z [info] Solution reported (id=1) for error 1
|
|
4226
|
+
2026-02-27T16:17:59.315Z [info] Running 9 migration(s) from version 0
|
|
4227
|
+
2026-02-27T16:17:59.315Z [info] Applying migration 001_core_schema
|
|
4228
|
+
2026-02-27T16:17:59.315Z [info] Applying migration 002_learning_schema
|
|
4229
|
+
2026-02-27T16:17:59.315Z [info] Applying migration 003_code_schema
|
|
4230
|
+
2026-02-27T16:17:59.315Z [info] Applying migration 004_synapses_schema
|
|
4231
|
+
2026-02-27T16:17:59.316Z [info] Applying migration 005_fts_indexes
|
|
4232
|
+
2026-02-27T16:17:59.316Z [info] Applying migration 006_synapses_phase3
|
|
4233
|
+
2026-02-27T16:17:59.317Z [info] Applying migration 007_feedback
|
|
4234
|
+
2026-02-27T16:17:59.318Z [info] Applying migration 008_git_integration
|
|
4235
|
+
2026-02-27T16:17:59.318Z [info] Applying migration 009_embeddings
|
|
4236
|
+
2026-02-27T16:17:59.319Z [info] Migrations complete. Now at version 9
|
|
4237
|
+
2026-02-27T16:17:59.321Z [info] New error reported (id=1, type=TypeError)
|
|
4238
|
+
2026-02-27T16:17:59.321Z [info] Known error (id=1), occurrence incremented
|
|
4239
|
+
2026-02-27T16:17:59.321Z [info] Running 9 migration(s) from version 0
|
|
4240
|
+
2026-02-27T16:17:59.322Z [info] Applying migration 001_core_schema
|
|
4241
|
+
2026-02-27T16:17:59.322Z [info] Applying migration 002_learning_schema
|
|
4242
|
+
2026-02-27T16:17:59.322Z [info] Applying migration 003_code_schema
|
|
4243
|
+
2026-02-27T16:17:59.322Z [info] Applying migration 004_synapses_schema
|
|
4244
|
+
2026-02-27T16:17:59.323Z [info] Applying migration 005_fts_indexes
|
|
4245
|
+
2026-02-27T16:17:59.323Z [info] Applying migration 006_synapses_phase3
|
|
4246
|
+
2026-02-27T16:17:59.324Z [info] Applying migration 007_feedback
|
|
4247
|
+
2026-02-27T16:17:59.325Z [info] Applying migration 008_git_integration
|
|
4248
|
+
2026-02-27T16:17:59.325Z [info] Applying migration 009_embeddings
|
|
4249
|
+
2026-02-27T16:17:59.326Z [info] Migrations complete. Now at version 9
|
|
4250
|
+
2026-02-27T16:17:59.328Z [info] New error reported (id=1, type=Error)
|
|
4251
|
+
2026-02-27T16:17:59.341Z [info] Running 9 migration(s) from version 0
|
|
4252
|
+
2026-02-27T16:17:59.342Z [info] Applying migration 001_core_schema
|
|
4253
|
+
2026-02-27T16:17:59.343Z [info] Applying migration 002_learning_schema
|
|
4254
|
+
2026-02-27T16:17:59.343Z [info] Applying migration 003_code_schema
|
|
4255
|
+
2026-02-27T16:17:59.343Z [info] Applying migration 004_synapses_schema
|
|
4256
|
+
2026-02-27T16:17:59.344Z [info] Applying migration 005_fts_indexes
|
|
4257
|
+
2026-02-27T16:17:59.344Z [info] Applying migration 006_synapses_phase3
|
|
4258
|
+
2026-02-27T16:17:59.345Z [info] Applying migration 007_feedback
|
|
4259
|
+
2026-02-27T16:17:59.346Z [info] Applying migration 008_git_integration
|
|
4260
|
+
2026-02-27T16:17:59.347Z [info] Applying migration 009_embeddings
|
|
4261
|
+
2026-02-27T16:17:59.347Z [info] Migrations complete. Now at version 9
|
|
4262
|
+
2026-02-27T16:17:59.351Z [info] New error reported (id=1, type=Error)
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import { execSync } from 'node:child_process';
|
|
6
|
+
import { getDataDir } from '../../utils/paths.js';
|
|
7
|
+
import { c, icons, header, divider } from '../colors.js';
|
|
8
|
+
function pass(label, detail) {
|
|
9
|
+
const extra = detail ? ` ${c.dim(detail)}` : '';
|
|
10
|
+
console.log(` ${c.green(icons.check)} ${label}${extra}`);
|
|
11
|
+
}
|
|
12
|
+
function fail(label, detail) {
|
|
13
|
+
const extra = detail ? ` ${c.dim(detail)}` : '';
|
|
14
|
+
console.log(` ${c.red(icons.cross)} ${label}${extra}`);
|
|
15
|
+
}
|
|
16
|
+
function skip(label, detail) {
|
|
17
|
+
const extra = detail ? ` ${c.dim(detail)}` : '';
|
|
18
|
+
console.log(` ${c.dim(icons.arrow)} ${label}${extra}`);
|
|
19
|
+
}
|
|
20
|
+
function step(n, label) {
|
|
21
|
+
console.log(`\n ${c.cyan(`[${n}/6]`)} ${c.value(label)}`);
|
|
22
|
+
}
|
|
23
|
+
function resolveHookPath() {
|
|
24
|
+
const platform = process.platform;
|
|
25
|
+
try {
|
|
26
|
+
const prefix = execSync('npm prefix -g', { encoding: 'utf8' }).trim();
|
|
27
|
+
const hookRelative = 'node_modules/@timmeck/brain/dist/hooks/post-tool-use.js';
|
|
28
|
+
if (platform === 'win32') {
|
|
29
|
+
return path.join(prefix, hookRelative);
|
|
30
|
+
}
|
|
31
|
+
// macOS/Linux: global prefix + lib/node_modules/...
|
|
32
|
+
return path.join(prefix, 'lib', hookRelative);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Fallback: try to resolve from this package's location
|
|
36
|
+
return path.resolve(import.meta.dirname, '../../hooks/post-tool-use.js');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function buildHookCommand(hookPath) {
|
|
40
|
+
const normalized = hookPath.replace(/\\/g, '\\\\');
|
|
41
|
+
return `node ${normalized}`;
|
|
42
|
+
}
|
|
43
|
+
function readSettings(settingsPath) {
|
|
44
|
+
try {
|
|
45
|
+
const raw = fs.readFileSync(settingsPath, 'utf8');
|
|
46
|
+
return JSON.parse(raw);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function ensureDir(dir) {
|
|
53
|
+
if (!fs.existsSync(dir)) {
|
|
54
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export function setupCommand() {
|
|
58
|
+
return new Command('setup')
|
|
59
|
+
.description('One-command setup: configures MCP, hooks, and starts the daemon')
|
|
60
|
+
.option('--no-daemon', 'Skip starting the daemon')
|
|
61
|
+
.option('--no-hooks', 'Skip hook configuration')
|
|
62
|
+
.option('--dry-run', 'Show what would be done without making changes')
|
|
63
|
+
.action(async (opts) => {
|
|
64
|
+
console.log(header('Brain Setup Wizard', icons.brain));
|
|
65
|
+
console.log();
|
|
66
|
+
console.log(` ${c.dim('Platform:')} ${c.value(process.platform)} ${c.dim('Node:')} ${c.value(process.version)} ${c.dim('Arch:')} ${c.value(process.arch)}`);
|
|
67
|
+
const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
|
|
68
|
+
const dataDir = getDataDir();
|
|
69
|
+
const hookPath = resolveHookPath();
|
|
70
|
+
const hookCommand = buildHookCommand(hookPath);
|
|
71
|
+
let settingsChanged = false;
|
|
72
|
+
let allGood = true;
|
|
73
|
+
// ── Step 1: Data Directory ──────────────────────────────
|
|
74
|
+
step(1, 'Data Directory');
|
|
75
|
+
if (fs.existsSync(dataDir)) {
|
|
76
|
+
pass('Data directory exists', dataDir);
|
|
77
|
+
}
|
|
78
|
+
else if (opts.dryRun) {
|
|
79
|
+
skip('Would create data directory', dataDir);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
ensureDir(dataDir);
|
|
83
|
+
pass('Created data directory', dataDir);
|
|
84
|
+
}
|
|
85
|
+
// ── Step 2: Claude Code settings.json ──────────────────
|
|
86
|
+
step(2, 'MCP Server Configuration');
|
|
87
|
+
const claudeDir = path.join(os.homedir(), '.claude');
|
|
88
|
+
if (!opts.dryRun) {
|
|
89
|
+
ensureDir(claudeDir);
|
|
90
|
+
}
|
|
91
|
+
const settings = readSettings(settingsPath);
|
|
92
|
+
// Check MCP server entry
|
|
93
|
+
if (!settings.mcpServers) {
|
|
94
|
+
settings.mcpServers = {};
|
|
95
|
+
}
|
|
96
|
+
const mcpServers = settings.mcpServers;
|
|
97
|
+
if (mcpServers.brain) {
|
|
98
|
+
pass('MCP server already configured');
|
|
99
|
+
}
|
|
100
|
+
else if (opts.dryRun) {
|
|
101
|
+
skip('Would add MCP server entry', '"brain" → brain mcp-server');
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
mcpServers.brain = {
|
|
105
|
+
command: 'brain',
|
|
106
|
+
args: ['mcp-server'],
|
|
107
|
+
};
|
|
108
|
+
settingsChanged = true;
|
|
109
|
+
pass('Added MCP server entry', '"brain" → brain mcp-server');
|
|
110
|
+
}
|
|
111
|
+
// ── Step 3: PostToolUse Hook ───────────────────────────
|
|
112
|
+
step(3, 'Auto-Detect Hook');
|
|
113
|
+
if (opts.hooks === false) {
|
|
114
|
+
skip('Skipped hook configuration', '--no-hooks');
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
// Verify hook file exists
|
|
118
|
+
const hookFileExists = fs.existsSync(hookPath);
|
|
119
|
+
if (!hookFileExists) {
|
|
120
|
+
// Try dist-relative path as fallback
|
|
121
|
+
const fallbackPath = path.resolve(import.meta.dirname, '../../hooks/post-tool-use.js');
|
|
122
|
+
if (fs.existsSync(fallbackPath)) {
|
|
123
|
+
pass('Hook file found', fallbackPath);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
fail('Hook file not found', `Expected at: ${hookPath}`);
|
|
127
|
+
console.log(` ${c.dim('Make sure @timmeck/brain is installed globally: npm install -g @timmeck/brain')}`);
|
|
128
|
+
allGood = false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
pass('Hook file found', hookPath);
|
|
133
|
+
}
|
|
134
|
+
if (!settings.hooks) {
|
|
135
|
+
settings.hooks = {};
|
|
136
|
+
}
|
|
137
|
+
const hooks = settings.hooks;
|
|
138
|
+
if (!hooks.PostToolUse) {
|
|
139
|
+
hooks.PostToolUse = [];
|
|
140
|
+
}
|
|
141
|
+
const postToolUse = hooks.PostToolUse;
|
|
142
|
+
// Check if brain hook is already configured
|
|
143
|
+
const hasBrainHook = postToolUse.some((h) => {
|
|
144
|
+
if (h.command?.includes('brain') || h.command?.includes('post-tool-use'))
|
|
145
|
+
return true;
|
|
146
|
+
return h.hooks?.some((inner) => inner.command?.includes('brain') || inner.command?.includes('post-tool-use'));
|
|
147
|
+
});
|
|
148
|
+
if (hasBrainHook) {
|
|
149
|
+
pass('Auto-detect hook already configured');
|
|
150
|
+
}
|
|
151
|
+
else if (opts.dryRun) {
|
|
152
|
+
skip('Would add PostToolUse hook', hookCommand);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
postToolUse.push({
|
|
156
|
+
matcher: { tool_name: 'Bash' },
|
|
157
|
+
hooks: [{ command: hookCommand }],
|
|
158
|
+
});
|
|
159
|
+
settingsChanged = true;
|
|
160
|
+
pass('Added PostToolUse hook', 'auto-detects errors from Bash commands');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// ── Step 4: Write settings.json ────────────────────────
|
|
164
|
+
step(4, 'Save Configuration');
|
|
165
|
+
if (settingsChanged && !opts.dryRun) {
|
|
166
|
+
try {
|
|
167
|
+
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n', 'utf8');
|
|
168
|
+
pass('Saved settings.json', settingsPath);
|
|
169
|
+
}
|
|
170
|
+
catch (err) {
|
|
171
|
+
fail('Failed to save settings.json', err instanceof Error ? err.message : String(err));
|
|
172
|
+
allGood = false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
else if (opts.dryRun && settingsChanged) {
|
|
176
|
+
skip('Would save settings.json', settingsPath);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
pass('No changes needed', 'settings.json already up to date');
|
|
180
|
+
}
|
|
181
|
+
// ── Step 5: Start Daemon ──────────────────────────────
|
|
182
|
+
step(5, 'Start Daemon');
|
|
183
|
+
if (opts.daemon === false) {
|
|
184
|
+
skip('Skipped daemon start', '--no-daemon');
|
|
185
|
+
}
|
|
186
|
+
else if (opts.dryRun) {
|
|
187
|
+
skip('Would start Brain daemon');
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
const pidPath = path.join(dataDir, 'brain.pid');
|
|
191
|
+
let alreadyRunning = false;
|
|
192
|
+
if (fs.existsSync(pidPath)) {
|
|
193
|
+
const pid = parseInt(fs.readFileSync(pidPath, 'utf8').trim(), 10);
|
|
194
|
+
try {
|
|
195
|
+
process.kill(pid, 0);
|
|
196
|
+
alreadyRunning = true;
|
|
197
|
+
pass('Daemon already running', `PID ${pid}`);
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
// Stale PID file, remove it
|
|
201
|
+
fs.unlinkSync(pidPath);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (!alreadyRunning) {
|
|
205
|
+
try {
|
|
206
|
+
const { spawn } = await import('node:child_process');
|
|
207
|
+
const entryPoint = path.resolve(import.meta.dirname, '../../index.js');
|
|
208
|
+
const child = spawn(process.execPath, [entryPoint, 'daemon'], {
|
|
209
|
+
detached: true,
|
|
210
|
+
stdio: 'ignore',
|
|
211
|
+
});
|
|
212
|
+
child.unref();
|
|
213
|
+
// Wait briefly for daemon to write PID file
|
|
214
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
215
|
+
if (fs.existsSync(pidPath)) {
|
|
216
|
+
const pid = fs.readFileSync(pidPath, 'utf8').trim();
|
|
217
|
+
pass('Daemon started', `PID ${pid}`);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
pass('Daemon starting', 'may take a moment');
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
catch (err) {
|
|
224
|
+
fail('Failed to start daemon', err instanceof Error ? err.message : String(err));
|
|
225
|
+
allGood = false;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// ── Step 6: Doctor Checks ──────────────────────────────
|
|
230
|
+
step(6, 'Health Check');
|
|
231
|
+
if (opts.dryRun) {
|
|
232
|
+
skip('Would run doctor checks');
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
// Quick health checks inline (subset of doctor)
|
|
236
|
+
const dbPath = path.join(dataDir, 'brain.db');
|
|
237
|
+
if (fs.existsSync(dbPath)) {
|
|
238
|
+
const stat = fs.statSync(dbPath);
|
|
239
|
+
pass('Database', `${(stat.size / 1024 / 1024).toFixed(1)} MB`);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
skip('Database', 'will be created on first daemon start');
|
|
243
|
+
}
|
|
244
|
+
// Check daemon reachability
|
|
245
|
+
const pidPath = path.join(dataDir, 'brain.pid');
|
|
246
|
+
if (fs.existsSync(pidPath)) {
|
|
247
|
+
const pid = parseInt(fs.readFileSync(pidPath, 'utf8').trim(), 10);
|
|
248
|
+
try {
|
|
249
|
+
process.kill(pid, 0);
|
|
250
|
+
pass('Daemon reachable', `PID ${pid}`);
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
fail('Daemon not reachable');
|
|
254
|
+
allGood = false;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
// ── Summary ─────────────────────────────────────────────
|
|
259
|
+
console.log();
|
|
260
|
+
if (opts.dryRun) {
|
|
261
|
+
console.log(` ${icons.brain} ${c.cyan('Dry run complete.')} No changes were made.`);
|
|
262
|
+
}
|
|
263
|
+
else if (allGood) {
|
|
264
|
+
console.log(` ${icons.ok} ${c.success('Brain is ready!')} All systems configured.`);
|
|
265
|
+
console.log();
|
|
266
|
+
console.log(` ${c.dim('Next steps:')}`);
|
|
267
|
+
console.log(` ${c.dim('1.')} Restart Claude Code to load the MCP server`);
|
|
268
|
+
console.log(` ${c.dim('2.')} Run ${c.cyan('brain status')} to check Brain stats`);
|
|
269
|
+
console.log(` ${c.dim('3.')} Run ${c.cyan('brain doctor')} for a full health check`);
|
|
270
|
+
console.log(` ${c.dim('4.')} Import a project: ${c.cyan('brain import ./my-project')}`);
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
console.log(` ${icons.warn} ${c.warn('Setup completed with warnings.')} Check the items above.`);
|
|
274
|
+
console.log(` Run ${c.cyan('brain doctor')} for a detailed health check.`);
|
|
275
|
+
}
|
|
276
|
+
console.log(`\n${divider()}`);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/cli/commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzD,SAAS,IAAI,CAAC,KAAa,EAAE,MAAe;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,KAAK,EAAE,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,IAAI,CAAC,KAAa,EAAE,MAAe;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,KAAK,E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OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;QAC7F,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,yBAAyB,CAAC,CAAC;YACnG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,+BAA+B,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import { projectsCommand } from './cli/commands/projects.js';
|
|
|
16
16
|
import { doctorCommand } from './cli/commands/doctor.js';
|
|
17
17
|
import { explainCommand } from './cli/commands/explain.js';
|
|
18
18
|
import { peersCommand } from './cli/commands/peers.js';
|
|
19
|
+
import { setupCommand } from './cli/commands/setup.js';
|
|
19
20
|
const program = new Command();
|
|
20
21
|
program
|
|
21
22
|
.name('brain')
|
|
@@ -37,6 +38,7 @@ program.addCommand(projectsCommand());
|
|
|
37
38
|
program.addCommand(doctorCommand());
|
|
38
39
|
program.addCommand(explainCommand());
|
|
39
40
|
program.addCommand(peersCommand());
|
|
41
|
+
program.addCommand(setupCommand());
|
|
40
42
|
// Hidden command: run MCP server (called by Claude Code)
|
|
41
43
|
program
|
|
42
44
|
.command('mcp-server')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,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;KACjD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;IACrB,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC;IAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timmeck/brain",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Adaptive error memory and code intelligence system with Hebbian synapse network, hybrid search, and REST API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -16,17 +16,22 @@
|
|
|
16
16
|
"test:coverage": "vitest --coverage"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
|
-
"error-memory",
|
|
20
|
-
"code-intelligence",
|
|
21
19
|
"mcp",
|
|
20
|
+
"mcp-server",
|
|
21
|
+
"model-context-protocol",
|
|
22
|
+
"claude",
|
|
22
23
|
"claude-code",
|
|
24
|
+
"cursor",
|
|
25
|
+
"windsurf",
|
|
26
|
+
"cline",
|
|
27
|
+
"ai-tools",
|
|
28
|
+
"error-memory",
|
|
29
|
+
"code-intelligence",
|
|
30
|
+
"developer-tools",
|
|
23
31
|
"hebbian-learning",
|
|
24
32
|
"synapse-network",
|
|
25
33
|
"adaptive-learning",
|
|
26
|
-
"vector-search"
|
|
27
|
-
"embeddings",
|
|
28
|
-
"rest-api",
|
|
29
|
-
"developer-tools"
|
|
34
|
+
"vector-search"
|
|
30
35
|
],
|
|
31
36
|
"author": "Tim Mecklenburg",
|
|
32
37
|
"license": "MIT",
|