@theihtisham/agent-shadow-brain 5.0.1 → 5.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 +244 -37
- package/dist/brain/code-dna.d.ts +70 -0
- package/dist/brain/code-dna.d.ts.map +1 -0
- package/dist/brain/code-dna.js +611 -0
- package/dist/brain/code-dna.js.map +1 -0
- package/dist/brain/fine-tuning-engine.d.ts +99 -0
- package/dist/brain/fine-tuning-engine.d.ts.map +1 -0
- package/dist/brain/fine-tuning-engine.js +681 -0
- package/dist/brain/fine-tuning-engine.js.map +1 -0
- package/dist/brain/intent-engine.d.ts +64 -0
- package/dist/brain/intent-engine.d.ts.map +1 -0
- package/dist/brain/intent-engine.js +374 -0
- package/dist/brain/intent-engine.js.map +1 -0
- package/dist/brain/lsp-server.d.ts +62 -0
- package/dist/brain/lsp-server.d.ts.map +1 -0
- package/dist/brain/lsp-server.js +480 -0
- package/dist/brain/lsp-server.js.map +1 -0
- package/dist/brain/orchestrator.d.ts +13 -0
- package/dist/brain/orchestrator.d.ts.map +1 -1
- package/dist/brain/orchestrator.js +25 -1
- package/dist/brain/orchestrator.js.map +1 -1
- package/dist/brain/smart-cache.d.ts +100 -0
- package/dist/brain/smart-cache.d.ts.map +1 -0
- package/dist/brain/smart-cache.js +417 -0
- package/dist/brain/smart-cache.js.map +1 -0
- package/dist/brain/temporal-intelligence.d.ts +89 -0
- package/dist/brain/temporal-intelligence.d.ts.map +1 -0
- package/dist/brain/temporal-intelligence.js +378 -0
- package/dist/brain/temporal-intelligence.js.map +1 -0
- package/dist/cli.js +267 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +205 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="
|
|
3
|
+
<img src="banner.svg" alt="Agent Shadow Brain v5.1.1 — Hyper-Cognitive Intelligence Edition" width="100%">
|
|
4
4
|
|
|
5
5
|
<br/>
|
|
6
6
|
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
|
|
18
18
|
<br/>
|
|
19
19
|
|
|
20
|
-
### **The World's #1
|
|
20
|
+
### **The World's #1 Hyper-Cognitive AI Coding Brain**
|
|
21
21
|
|
|
22
22
|
**Shadow Brain** is a zero-config, self-evolving, infinite-memory intelligence layer that makes **every AI coding agent** write better, safer, faster code. Install it once, and it automatically detects your project, your AI tools, your frameworks — and starts making your agents smarter forever.
|
|
23
23
|
|
|
24
|
-
> **v5.
|
|
24
|
+
> **v5.1.1 — Hyper-Cognitive Intelligence Edition**: 6 new brain modules — **Built-in LSP Server** for real-time IDE feedback, **Custom LLM Fine-Tuning Engine** to train on your codebase, **Smart Cache** with multi-tier predictive prefetch, **Intent Engine** for natural language command understanding, **Code DNA** fingerprinting with 9-gene analysis, and **Temporal Intelligence** for velocity tracking & bug prediction. Plus all v5.0.1 zero-config features (MCP server, dashboard, plugins, export/import), v5.0.0 infinite intelligence (hierarchical memory, consensus, collective learning), and v4.0.0 hyper-intelligence (TurboQuant, SSSP, self-evolution, adversarial defense, swarm, knowledge graph, predictive engine).
|
|
25
25
|
|
|
26
|
-
[**Install Now**](#-getting-started-30-seconds) · [**Dashboard**](#-web-dashboard) · [**v5.
|
|
26
|
+
[**Install Now**](#-getting-started-30-seconds) · [**Dashboard**](#-web-dashboard) · [**v5.1.1 New**](#-v511-whats-new) · [**Algorithms**](#-algorithms--research) · [**CLI Reference**](#-cli-reference) · [**Architecture**](#-architecture)
|
|
27
27
|
|
|
28
28
|
</div>
|
|
29
29
|
|
|
@@ -45,22 +45,27 @@ You use AI coding agents. They're powerful, but:
|
|
|
45
45
|
|
|
46
46
|
## The Solution
|
|
47
47
|
|
|
48
|
-
**Shadow Brain v5.
|
|
48
|
+
**Shadow Brain v5.1.1** — zero-config, auto-detecting, infinite-intelligence shadow layer:
|
|
49
49
|
|
|
50
50
|
```
|
|
51
51
|
┌──────────────┐ auto-detect ┌──────────────────────────────────────────┐
|
|
52
|
-
│ AI Agents │ ◀──────────────── │ SHADOW BRAIN v5.
|
|
52
|
+
│ AI Agents │ ◀──────────────── │ SHADOW BRAIN v5.1.1 │
|
|
53
53
|
│ Claude Code │ MCP auto-install │ │
|
|
54
|
-
│ Cursor │ zero-config │ ┌─
|
|
55
|
-
│ Kilo Code │ │ │
|
|
56
|
-
│ Cline │ watches │ │
|
|
57
|
-
│ OpenCode │ ──────────────▶ │ │
|
|
58
|
-
│ Codex │ file changes │ │
|
|
59
|
-
│ Roo Code │ git commits │ │
|
|
60
|
-
│ Aider │ activity │
|
|
61
|
-
│ Windsurf │ │
|
|
62
|
-
└──────────────┘ │
|
|
63
|
-
▲ │ │
|
|
54
|
+
│ Cursor │ zero-config │ ┌─ HYPER-COGNITIVE (v5.1.1 NEW) ────┐ │
|
|
55
|
+
│ Kilo Code │ │ │ Built-in LSP Server (stdio+TCP) │ │
|
|
56
|
+
│ Cline │ watches │ │ Custom LLM Fine-Tuning Engine │ │
|
|
57
|
+
│ OpenCode │ ──────────────▶ │ │ Smart Cache (hot/warm/cold tiers) │ │
|
|
58
|
+
│ Codex │ file changes │ │ Intent Engine (NLP commands) │ │
|
|
59
|
+
│ Roo Code │ git commits │ │ Code DNA (9-gene fingerprinting) │ │
|
|
60
|
+
│ Aider │ activity │ │ Temporal Intelligence (velocity) │ │
|
|
61
|
+
│ Windsurf │ │ └────────────────────────────────────┘ │
|
|
62
|
+
└──────────────┘ │ ┌─ ZERO-CONFIG (v5.0.1) ─────────────┐ │
|
|
63
|
+
▲ │ │ Auto-detect + MCP + Dashboard │ │
|
|
64
|
+
│ │ │ Plugins + Export/Import + Hooks │ │
|
|
65
|
+
│ │ └────────────────────────────────────┘ │
|
|
66
|
+
│ │ ┌─ INFINITE MEMORY (v5.0.0) ────────┐ │
|
|
67
|
+
│ │ │ 4-tier hierarchical compression │ │
|
|
68
|
+
│ │ │ Context-triggered recall │ │
|
|
64
69
|
│ │ │ Multi-agent consensus + trust │ │
|
|
65
70
|
│ │ │ Collective cross-project learning │ │
|
|
66
71
|
│ │ └────────────────────────────────────┘ │
|
|
@@ -74,6 +79,129 @@ You use AI coding agents. They're powerful, but:
|
|
|
74
79
|
|
|
75
80
|
---
|
|
76
81
|
|
|
82
|
+
## v5.1.1 — What's New
|
|
83
|
+
|
|
84
|
+
### 6 Hyper-Cognitive Brain Modules
|
|
85
|
+
|
|
86
|
+
<table>
|
|
87
|
+
<tr>
|
|
88
|
+
<td width="50%">
|
|
89
|
+
|
|
90
|
+
### Built-in LSP Server
|
|
91
|
+
|
|
92
|
+
**Language Server Protocol** — real-time IDE feedback without external tools.
|
|
93
|
+
|
|
94
|
+
Pure Node.js LSP server supporting stdio and TCP transport modes:
|
|
95
|
+
- **Diagnostics**: pushes brain insights as IDE warnings/errors
|
|
96
|
+
- **Hover**: shows code health info on hover
|
|
97
|
+
- **Code Actions**: quick-fix suggestions from brain analysis
|
|
98
|
+
- **Zero dependency**: no external LSP libraries required
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
shadow-brain lsp --stdio # stdio mode (for editors)
|
|
102
|
+
shadow-brain lsp --tcp 2087 # TCP mode (for remote)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Custom LLM Fine-Tuning Engine
|
|
106
|
+
|
|
107
|
+
**Train on your codebase** — your brain learns YOUR patterns.
|
|
108
|
+
|
|
109
|
+
Automatic training data generation from code changes, insights, and fixes:
|
|
110
|
+
- **Pair extraction**: before/after code → training pairs
|
|
111
|
+
- **Pattern mining**: recurring fix patterns → fine-tune examples
|
|
112
|
+
- **JSONL export**: ready for OpenAI, Anthropic, or local fine-tuning
|
|
113
|
+
- **Quality scoring**: only high-confidence pairs enter the dataset
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
shadow-brain fine-tune status # Training data stats
|
|
117
|
+
shadow-brain fine-tune generate [dir] # Generate training pairs
|
|
118
|
+
shadow-brain fine-tune export [path] # Export JSONL dataset
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
</td>
|
|
122
|
+
<td width="50%">
|
|
123
|
+
|
|
124
|
+
### Smart Cache (Multi-Tier)
|
|
125
|
+
|
|
126
|
+
**Hot/Warm/Cold** — intelligent caching with predictive prefetch.
|
|
127
|
+
|
|
128
|
+
Three-tier LRU cache with automatic promotion and demotion:
|
|
129
|
+
- **Hot tier**: 200 entries, fastest access
|
|
130
|
+
- **Warm tier**: 1000 entries, promoted on repeated access
|
|
131
|
+
- **Cold tier**: 5000 entries, compressed storage
|
|
132
|
+
- **Predictive prefetch**: co-access graph predicts what you'll need next
|
|
133
|
+
- **Tag-based invalidation**: invalidate by category
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
shadow-brain cache stats # Hit rate, tier sizes, memory usage
|
|
137
|
+
shadow-brain cache clear # Clear all tiers
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Intent Engine
|
|
141
|
+
|
|
142
|
+
**Natural language → brain actions** — understand what you mean.
|
|
143
|
+
|
|
144
|
+
Multi-strategy NLP command understanding:
|
|
145
|
+
- **Keyword matching**: fast path for common commands
|
|
146
|
+
- **Fuzzy matching**: handles typos and variations
|
|
147
|
+
- **Context-aware**: uses current file/project context
|
|
148
|
+
- **Confidence scoring**: routes to best-matching action
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
shadow-brain intent "find security bugs" # Maps to: analyze + security filter
|
|
152
|
+
shadow-brain intent "show hot files" # Maps to: temporal + heatmap
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
<tr>
|
|
158
|
+
<td width="50%">
|
|
159
|
+
|
|
160
|
+
### Code DNA Fingerprinting
|
|
161
|
+
|
|
162
|
+
**9-gene analysis** — every file gets a unique genetic profile.
|
|
163
|
+
|
|
164
|
+
Analyzes code across 9 gene categories to create a structural fingerprint:
|
|
165
|
+
- **Structure genes**: classes, functions, nesting depth
|
|
166
|
+
- **Complexity genes**: cyclomatic complexity, cognitive load
|
|
167
|
+
- **Style genes**: naming conventions, formatting patterns
|
|
168
|
+
- **Dependency genes**: import graph, coupling metrics
|
|
169
|
+
- **Evolution genes**: change frequency, stability score
|
|
170
|
+
- **Similarity matching**: find structurally similar files across projects
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
shadow-brain dna analyze [dir] # Generate DNA profiles
|
|
174
|
+
shadow-brain dna compare f1 f2 # Compare two file fingerprints
|
|
175
|
+
shadow-brain dna similar [file] # Find similar files
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
</td>
|
|
179
|
+
<td width="50%">
|
|
180
|
+
|
|
181
|
+
### Temporal Intelligence
|
|
182
|
+
|
|
183
|
+
**Time-series code evolution** — velocity tracking & bug prediction.
|
|
184
|
+
|
|
185
|
+
Continuous monitoring of code change patterns over time:
|
|
186
|
+
- **Velocity metrics**: daily/weekly/monthly rates with trend detection
|
|
187
|
+
- **File heatmaps**: hotness scoring, churn risk, stability
|
|
188
|
+
- **Bug prediction**: 5-factor probability model per file
|
|
189
|
+
- **Anomaly detection**: burst detection, drought alerts, unusual hours
|
|
190
|
+
- **Peak analysis**: identifies your most productive hours and days
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
shadow-brain temporal stats # Velocity, anomalies, predictions
|
|
194
|
+
shadow-brain temporal hot # Top 10 hottest files
|
|
195
|
+
shadow-brain temporal predict # Bug risk predictions
|
|
196
|
+
shadow-brain temporal timeline # Recent event timeline
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
</td>
|
|
200
|
+
</tr>
|
|
201
|
+
</table>
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
77
205
|
## v5.0.1 — What's New
|
|
78
206
|
|
|
79
207
|
### Zero-Config Auto-Setup
|
|
@@ -89,7 +217,7 @@ Install it. That's it. Shadow Brain automatically:
|
|
|
89
217
|
|
|
90
218
|
```bash
|
|
91
219
|
npm install @theihtisham/agent-shadow-brain
|
|
92
|
-
# → Shadow Brain v5.
|
|
220
|
+
# → Shadow Brain v5.1.1 auto-configured for my-app (fullstack)
|
|
93
221
|
# → AI tools detected: Claude Code, Cursor
|
|
94
222
|
# → Run: shadow-brain start
|
|
95
223
|
```
|
|
@@ -208,7 +336,7 @@ That's literally it. Shadow Brain will:
|
|
|
208
336
|
2. **Auto-install** MCP server config for Claude Code, Cursor, Kilo Code, Cline, etc.
|
|
209
337
|
3. **Auto-install** git hooks for pre-commit and pre-push
|
|
210
338
|
4. Watch your project files for changes
|
|
211
|
-
5. Analyze every change with LLM +
|
|
339
|
+
5. Analyze every change with LLM + 22 brain modules
|
|
212
340
|
6. Inject expert insights into your agent's memory
|
|
213
341
|
7. Store all knowledge in hierarchical memory for infinite retention
|
|
214
342
|
8. Activate past memories automatically based on context
|
|
@@ -233,13 +361,13 @@ shadow-brain review . --output json # JSON for scripting
|
|
|
233
361
|
|
|
234
362
|
## Web Dashboard
|
|
235
363
|
|
|
236
|
-
The v5.
|
|
364
|
+
The v5.1.1 dashboard provides a real-time view into your brain:
|
|
237
365
|
|
|
238
366
|
```
|
|
239
367
|
┌──────────────────────────────────────────────────────────────────────────┐
|
|
240
|
-
│ Shadow Brain v5.
|
|
368
|
+
│ Shadow Brain v5.1.1 [Analyze] [↻] │
|
|
241
369
|
├──────────────────────────────────────────────────────────────────────────┤
|
|
242
|
-
│ Insights: 142 │ Fixes: 38 │ Memory: 247KB │ Modules:
|
|
370
|
+
│ Insights: 142 │ Fixes: 38 │ Memory: 247KB │ Modules: 22/22 │ ... │
|
|
243
371
|
├──────────────┬─────────────────────────────────────┬───────────────────┤
|
|
244
372
|
│ Health: 87% │ Live Insights Stream │ AI Tools │
|
|
245
373
|
│ ████████░░ │ ● [HIGH] SQL injection in login.ts │ ● Claude Code ✓ │
|
|
@@ -347,7 +475,7 @@ shadow-brain collective search performance
|
|
|
347
475
|
|
|
348
476
|
## v4.0.0 Hyper-Intelligence Engine
|
|
349
477
|
|
|
350
|
-
### 8 Breakthrough Modules (included in v5.
|
|
478
|
+
### 8 Breakthrough Modules (included in v5.1.1)
|
|
351
479
|
|
|
352
480
|
<table>
|
|
353
481
|
<tr>
|
|
@@ -473,7 +601,7 @@ shadow-brain predict bugs .
|
|
|
473
601
|
|
|
474
602
|
## Algorithms & Research
|
|
475
603
|
|
|
476
|
-
Shadow Brain v5.
|
|
604
|
+
Shadow Brain v5.1.1 implements algorithms from **peer-reviewed research**:
|
|
477
605
|
|
|
478
606
|
| Algorithm | Paper / Origin | Application | Complexity |
|
|
479
607
|
|---|---|---|---|
|
|
@@ -521,7 +649,18 @@ Input Vector (64-dim, float64)
|
|
|
521
649
|
|
|
522
650
|
<table>
|
|
523
651
|
<tr>
|
|
524
|
-
<td width="
|
|
652
|
+
<td width="20%">
|
|
653
|
+
|
|
654
|
+
### Hyper-Cognitive (v5.1.1)
|
|
655
|
+
- Built-in LSP Server
|
|
656
|
+
- Custom LLM Fine-Tuning
|
|
657
|
+
- Smart Cache (3-tier)
|
|
658
|
+
- Intent Engine (NLP)
|
|
659
|
+
- Code DNA Fingerprinting
|
|
660
|
+
- Temporal Intelligence
|
|
661
|
+
|
|
662
|
+
</td>
|
|
663
|
+
<td width="20%">
|
|
525
664
|
|
|
526
665
|
### Zero Config (v5.0.1)
|
|
527
666
|
- Auto-detect project + tools
|
|
@@ -533,7 +672,7 @@ Input Vector (64-dim, float64)
|
|
|
533
672
|
- Git hook auto-install
|
|
534
673
|
|
|
535
674
|
</td>
|
|
536
|
-
<td width="
|
|
675
|
+
<td width="20%">
|
|
537
676
|
|
|
538
677
|
### Infinite Intelligence (v5)
|
|
539
678
|
- 4-tier hierarchical memory
|
|
@@ -542,7 +681,7 @@ Input Vector (64-dim, float64)
|
|
|
542
681
|
- Collective cross-project learning
|
|
543
682
|
|
|
544
683
|
</td>
|
|
545
|
-
<td width="
|
|
684
|
+
<td width="20%">
|
|
546
685
|
|
|
547
686
|
### Hyper-Intelligence (v4)
|
|
548
687
|
- TurboQuant infinite memory
|
|
@@ -555,11 +694,12 @@ Input Vector (64-dim, float64)
|
|
|
555
694
|
- Predictive bug forecasting
|
|
556
695
|
|
|
557
696
|
</td>
|
|
558
|
-
<td width="
|
|
697
|
+
<td width="20%">
|
|
559
698
|
|
|
560
699
|
### Developer Experience
|
|
561
|
-
- **
|
|
700
|
+
- **60+ CLI commands**
|
|
562
701
|
- MCP Server (19 tools)
|
|
702
|
+
- Built-in LSP Server
|
|
563
703
|
- Web dashboard (real-time)
|
|
564
704
|
- Terminal UI (Ink/React)
|
|
565
705
|
- Pre-commit hooks
|
|
@@ -574,10 +714,16 @@ Input Vector (64-dim, float64)
|
|
|
574
714
|
|
|
575
715
|
## Architecture
|
|
576
716
|
|
|
577
|
-
### v5.
|
|
717
|
+
### v5.1.1 Module Map (22 modules)
|
|
578
718
|
|
|
579
719
|
| Module | File | What It Does | Since |
|
|
580
720
|
|---|---|---|---|
|
|
721
|
+
| **LSP Server** | `brain/lsp-server.ts` | Built-in Language Server Protocol (stdio+TCP) | v5.1.1 |
|
|
722
|
+
| **Fine-Tuning Engine** | `brain/fine-tuning-engine.ts` | Custom LLM training data generation | v5.1.1 |
|
|
723
|
+
| **Smart Cache** | `brain/smart-cache.ts` | Multi-tier caching with predictive prefetch | v5.1.1 |
|
|
724
|
+
| **Intent Engine** | `brain/intent-engine.ts` | Natural language command understanding | v5.1.1 |
|
|
725
|
+
| **Code DNA** | `brain/code-dna.ts` | 9-gene code fingerprinting + similarity | v5.1.1 |
|
|
726
|
+
| **Temporal Intelligence** | `brain/temporal-intelligence.ts` | Velocity tracking, heatmaps, bug prediction | v5.1.1 |
|
|
581
727
|
| **Auto Setup** | `brain/auto-setup.ts` | Zero-config project + tool detection | v5.0.1 |
|
|
582
728
|
| **MCP Server** | `brain/mcp-server.ts` | 19-tool MCP server for all AI tools | v5.0.1 |
|
|
583
729
|
| **Plugin System** | `brain/plugin-system.ts` | Hookable analysis pipeline | v5.0.1 |
|
|
@@ -624,7 +770,26 @@ Input Vector (64-dim, float64)
|
|
|
624
770
|
| `shadow-brain doctor` | Health check & diagnostics |
|
|
625
771
|
| `shadow-brain ask <question>` | Natural language brain query |
|
|
626
772
|
|
|
627
|
-
### v5.
|
|
773
|
+
### v5.1.1 Hyper-Cognitive Commands (NEW)
|
|
774
|
+
|
|
775
|
+
| Command | Description |
|
|
776
|
+
|---|---|
|
|
777
|
+
| `shadow-brain lsp [--stdio\|--tcp PORT]` | Start built-in LSP server |
|
|
778
|
+
| `shadow-brain fine-tune status` | Fine-tuning training data stats |
|
|
779
|
+
| `shadow-brain fine-tune generate [dir]` | Generate training pairs from code |
|
|
780
|
+
| `shadow-brain fine-tune export [path]` | Export JSONL dataset for fine-tuning |
|
|
781
|
+
| `shadow-brain cache stats` | Smart cache hit rate, tier sizes, memory |
|
|
782
|
+
| `shadow-brain cache clear` | Clear all cache tiers |
|
|
783
|
+
| `shadow-brain intent <text>` | Parse natural language intent |
|
|
784
|
+
| `shadow-brain dna analyze [dir]` | Generate Code DNA profiles |
|
|
785
|
+
| `shadow-brain dna compare <f1> <f2>` | Compare two file fingerprints |
|
|
786
|
+
| `shadow-brain dna similar <file>` | Find structurally similar files |
|
|
787
|
+
| `shadow-brain temporal stats` | Velocity, anomalies, predictions |
|
|
788
|
+
| `shadow-brain temporal hot` | Top 10 hottest files by churn |
|
|
789
|
+
| `shadow-brain temporal predict` | Bug risk predictions |
|
|
790
|
+
| `shadow-brain temporal timeline` | Recent event timeline |
|
|
791
|
+
|
|
792
|
+
### v5.0.1 Commands
|
|
628
793
|
|
|
629
794
|
| Command | Description |
|
|
630
795
|
|---|---|
|
|
@@ -681,13 +846,23 @@ Input Vector (64-dim, float64)
|
|
|
681
846
|
```typescript
|
|
682
847
|
import {
|
|
683
848
|
Orchestrator,
|
|
849
|
+
// v5.1.1 — Hyper-Cognitive modules
|
|
850
|
+
LSPServer,
|
|
851
|
+
FineTuningEngine,
|
|
852
|
+
SmartCache,
|
|
853
|
+
IntentEngine,
|
|
854
|
+
CodeDNA,
|
|
855
|
+
TemporalIntelligence,
|
|
856
|
+
// v5.0.1 — Zero-Config modules
|
|
684
857
|
AutoSetup,
|
|
685
858
|
PluginSystem,
|
|
686
859
|
BrainPortability,
|
|
860
|
+
// v5.0.0 — Infinite Intelligence modules
|
|
687
861
|
HierarchicalMemory,
|
|
688
862
|
ContextRecall,
|
|
689
863
|
ConsensusEngine,
|
|
690
864
|
CollectiveLearning,
|
|
865
|
+
// v4.0.0 — Hyper-Intelligence modules
|
|
691
866
|
TurboMemory,
|
|
692
867
|
SSSPRouter,
|
|
693
868
|
SelfEvolution,
|
|
@@ -699,6 +874,26 @@ import {
|
|
|
699
874
|
NeuralMesh,
|
|
700
875
|
} from '@theihtisham/agent-shadow-brain';
|
|
701
876
|
|
|
877
|
+
// v5.1.1 — Built-in LSP server
|
|
878
|
+
const lsp = new LSPServer('./my-project');
|
|
879
|
+
lsp.start({ mode: 'tcp', port: 2087 }); // or { mode: 'stdio' }
|
|
880
|
+
|
|
881
|
+
// v5.1.1 — Smart Cache
|
|
882
|
+
const cache = new SmartCache({ maxHotEntries: 200, enablePrefetch: true });
|
|
883
|
+
cache.set('analysis:auth', analysisResult, { ttl: 300_000, tags: ['security'] });
|
|
884
|
+
const cached = cache.get('analysis:auth');
|
|
885
|
+
|
|
886
|
+
// v5.1.1 — Temporal Intelligence
|
|
887
|
+
const temporal = new TemporalIntelligence('./my-project');
|
|
888
|
+
temporal.recordCommit(['src/auth.ts'], 'fix: JWT rotation');
|
|
889
|
+
const velocity = temporal.getVelocity(); // { daily, weekly, trend: 'accelerating' }
|
|
890
|
+
const bugRisks = temporal.predictBugs(10);
|
|
891
|
+
|
|
892
|
+
// v5.1.1 — Code DNA
|
|
893
|
+
const dna = new CodeDNA('./my-project');
|
|
894
|
+
const profile = await dna.analyze('src/auth.ts');
|
|
895
|
+
const similar = await dna.findSimilar('src/auth.ts', 5);
|
|
896
|
+
|
|
702
897
|
// v5.0.1 — Zero-config auto-setup
|
|
703
898
|
const setup = new AutoSetup('./my-project');
|
|
704
899
|
const config = await setup.detect();
|
|
@@ -763,7 +958,18 @@ await brain.start();
|
|
|
763
958
|
|
|
764
959
|
## Version History
|
|
765
960
|
|
|
766
|
-
### v5.
|
|
961
|
+
### v5.1.1 — Hyper-Cognitive Intelligence Edition (Current)
|
|
962
|
+
- **Built-in LSP Server** — pure Node.js Language Server Protocol with stdio + TCP modes, diagnostics, hover, code actions
|
|
963
|
+
- **Custom LLM Fine-Tuning Engine** — automatic training data generation from code changes, JSONL export for fine-tuning
|
|
964
|
+
- **Smart Cache** — 3-tier (hot/warm/cold) LRU cache with predictive prefetch, co-access graph, tag-based invalidation
|
|
965
|
+
- **Intent Engine** — multi-strategy NLP command understanding with keyword, fuzzy, and context-aware matching
|
|
966
|
+
- **Code DNA Fingerprinting** — 9-gene structural analysis (structure, complexity, style, dependency, evolution genes)
|
|
967
|
+
- **Temporal Intelligence** — velocity metrics, file heatmaps, 5-factor bug prediction, anomaly detection, peak analysis
|
|
968
|
+
- **6 new CLI commands** — lsp, fine-tune, cache, intent, dna, temporal
|
|
969
|
+
- **22 brain modules total** — 6 new + 16 existing from v5.0.1
|
|
970
|
+
- All v5.0.1, v5.0.0, and v4.0.0 features included and enhanced
|
|
971
|
+
|
|
972
|
+
### v5.0.1 — Zero-Config Intelligence Edition
|
|
767
973
|
- **Zero-Config Auto-Setup** — auto-detect project, AI tools, languages, frameworks; auto-install MCP config + git hooks
|
|
768
974
|
- **MCP Server** — 19-tool Model Context Protocol server for Claude Code, Cursor, and all AI tools
|
|
769
975
|
- **Rich Web Dashboard** — real-time WebSocket dashboard with 8 panels (health, memory tiers, insights, fixes, AI tools, modules, stats, controls)
|
|
@@ -852,11 +1058,12 @@ npm test
|
|
|
852
1058
|
- [x] ~~MCP server for Cursor + all tools~~ (v5.0.1)
|
|
853
1059
|
- [x] ~~Rich web dashboard with real-time WebSocket~~ (v5.0.1)
|
|
854
1060
|
- [x] ~~Plugin system + brain export/import~~ (v5.0.1)
|
|
855
|
-
- [
|
|
856
|
-
- [
|
|
857
|
-
- [
|
|
858
|
-
- [ ] **
|
|
859
|
-
- [ ] **
|
|
1061
|
+
- [x] ~~Custom LLM fine-tuning~~ (v5.1.1)
|
|
1062
|
+
- [x] ~~Language server (LSP)~~ (v5.1.1)
|
|
1063
|
+
- [x] ~~Web dashboard v3~~ (v5.1.1)
|
|
1064
|
+
- [ ] **Visual Studio Code integration** — inline insight overlays
|
|
1065
|
+
- [ ] **Multi-model orchestration** — route insights through multiple LLMs
|
|
1066
|
+
- [ ] **Real-time collaboration** — team brain with live cursors
|
|
860
1067
|
|
|
861
1068
|
---
|
|
862
1069
|
|
|
@@ -883,6 +1090,6 @@ MIT License — see [LICENSE](LICENSE) for details.
|
|
|
883
1090
|
|
|
884
1091
|
**Built with brains by [theihtisham](https://github.com/theihtisham)**
|
|
885
1092
|
|
|
886
|
-
**Topics:** `ai` `artificial-intelligence` `llm` `claude-code` `cursor` `cline` `kilo-code` `codex` `roo-code` `aider` `opencode` `windsurf` `code-review` `static-analysis` `developer-tools` `npm-package` `typescript` `ollama` `openai` `anthropic` `code-quality` `security-scanner` `health-score` `smart-fix` `vulnerability-scanner` `pattern-learning` `agent-tools` `ai-agent` `code-metrics` `pre-commit-hook` `github-actions` `developer-productivity` `neural-mesh` `quantum-computing` `shannon-entropy` `bayesian-inference` `mcp-server` `model-context-protocol` `semantic-analysis` `dependency-graph` `turboquant` `sssp-algorithm` `genetic-algorithm` `swarm-intelligence` `pagerank` `knowledge-graph` `hallucination-detection` `cross-agent` `self-evolving` `predictive-engine` `ant-colony` `infinite-memory` `vector-compression` `iclr-2026` `arxiv` `super-intelligence` `hyper-intelligence` `autonomous-agents` `ai-engineering` `agentic-coding` `vibe-coding` `cursor-ai` `zero-config` `auto-setup` `dashboard` `plugin-system` `brain-export` `natural-language` `real-time` `websocket` `team-collaboration` `ci-cd` `open-source` `trending` `hierarchical-memory` `context-recall` `consensus-engine` `collective-learning` `infinite-intelligence` `coding-assistant`
|
|
1093
|
+
**Topics:** `ai` `artificial-intelligence` `llm` `claude-code` `cursor` `cline` `kilo-code` `codex` `roo-code` `aider` `opencode` `windsurf` `code-review` `static-analysis` `developer-tools` `npm-package` `typescript` `ollama` `openai` `anthropic` `code-quality` `security-scanner` `health-score` `smart-fix` `vulnerability-scanner` `pattern-learning` `agent-tools` `ai-agent` `code-metrics` `pre-commit-hook` `github-actions` `developer-productivity` `neural-mesh` `quantum-computing` `shannon-entropy` `bayesian-inference` `mcp-server` `model-context-protocol` `semantic-analysis` `dependency-graph` `turboquant` `sssp-algorithm` `genetic-algorithm` `swarm-intelligence` `pagerank` `knowledge-graph` `hallucination-detection` `cross-agent` `self-evolving` `predictive-engine` `ant-colony` `infinite-memory` `vector-compression` `iclr-2026` `arxiv` `super-intelligence` `hyper-intelligence` `autonomous-agents` `ai-engineering` `agentic-coding` `vibe-coding` `cursor-ai` `zero-config` `auto-setup` `dashboard` `plugin-system` `brain-export` `natural-language` `real-time` `websocket` `team-collaboration` `ci-cd` `open-source` `trending` `hierarchical-memory` `context-recall` `consensus-engine` `collective-learning` `infinite-intelligence` `coding-assistant` `lsp-server` `language-server-protocol` `fine-tuning` `smart-cache` `intent-engine` `code-dna` `temporal-intelligence` `hyper-cognitive`
|
|
887
1094
|
|
|
888
1095
|
</div>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export interface CodeGene {
|
|
2
|
+
trait: string;
|
|
3
|
+
value: number;
|
|
4
|
+
samples: number;
|
|
5
|
+
category: GeneCategory;
|
|
6
|
+
}
|
|
7
|
+
export type GeneCategory = 'formatting' | 'naming' | 'structure' | 'complexity' | 'documentation' | 'error-handling' | 'testing' | 'imports' | 'typing' | 'async-patterns' | 'functional' | 'oop';
|
|
8
|
+
export interface DNAProfile {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
createdAt: number;
|
|
12
|
+
updatedAt: number;
|
|
13
|
+
genes: Map<string, CodeGene>;
|
|
14
|
+
fingerprint: string;
|
|
15
|
+
fileCount: number;
|
|
16
|
+
totalLines: number;
|
|
17
|
+
language: string;
|
|
18
|
+
similarity: number;
|
|
19
|
+
}
|
|
20
|
+
export interface DNAComparison {
|
|
21
|
+
similarity: number;
|
|
22
|
+
matchingGenes: string[];
|
|
23
|
+
divergingGenes: Array<{
|
|
24
|
+
gene: string;
|
|
25
|
+
profileA: number;
|
|
26
|
+
profileB: number;
|
|
27
|
+
delta: number;
|
|
28
|
+
}>;
|
|
29
|
+
verdict: 'same-team' | 'similar-style' | 'different-style' | 'inconsistent';
|
|
30
|
+
}
|
|
31
|
+
export interface StyleConsistencyReport {
|
|
32
|
+
overall: number;
|
|
33
|
+
fileScores: Array<{
|
|
34
|
+
file: string;
|
|
35
|
+
score: number;
|
|
36
|
+
violations: string[];
|
|
37
|
+
}>;
|
|
38
|
+
topViolations: Array<{
|
|
39
|
+
gene: string;
|
|
40
|
+
expected: number;
|
|
41
|
+
actual: number;
|
|
42
|
+
files: string[];
|
|
43
|
+
}>;
|
|
44
|
+
recommendations: string[];
|
|
45
|
+
}
|
|
46
|
+
export interface CodeDNAStats {
|
|
47
|
+
profiles: number;
|
|
48
|
+
totalGenes: number;
|
|
49
|
+
avgConsistency: number;
|
|
50
|
+
dominantStyle: Record<string, number>;
|
|
51
|
+
language: string;
|
|
52
|
+
}
|
|
53
|
+
export declare class CodeDNA {
|
|
54
|
+
private profiles;
|
|
55
|
+
private projectDir;
|
|
56
|
+
constructor(projectDir: string);
|
|
57
|
+
buildProfile(name?: string, dir?: string): Promise<DNAProfile>;
|
|
58
|
+
analyzeFile(filePath: string, content: string): Map<string, number>;
|
|
59
|
+
compare(profileA: DNAProfile, profileB: DNAProfile): DNAComparison;
|
|
60
|
+
compareFileToProfile(filePath: string, content: string, profileId: string): DNAComparison | null;
|
|
61
|
+
checkConsistency(dir?: string): Promise<StyleConsistencyReport>;
|
|
62
|
+
private generateRecommendations;
|
|
63
|
+
private calculateConsistency;
|
|
64
|
+
private collectSourceFiles;
|
|
65
|
+
private detectLanguage;
|
|
66
|
+
getProfile(id: string): DNAProfile | undefined;
|
|
67
|
+
getAllProfiles(): DNAProfile[];
|
|
68
|
+
stats(): CodeDNAStats;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=code-dna.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-dna.d.ts","sourceRoot":"","sources":["../../src/brain/code-dna.ts"],"names":[],"mappings":"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"}
|