nexus-prime 0.2.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +75 -194
- package/dist/agents/adapters/mcp.d.ts +3 -1
- package/dist/agents/adapters/mcp.d.ts.map +1 -1
- package/dist/agents/adapters/mcp.js +622 -29
- package/dist/agents/adapters/mcp.js.map +1 -1
- package/dist/agents/adapters.d.ts +2 -2
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/coordinator.d.ts.map +1 -1
- package/dist/agents/coordinator.js +78 -13
- package/dist/agents/coordinator.js.map +1 -1
- package/dist/dashboard/index.html +593 -0
- package/dist/dashboard/server.d.ts +26 -0
- package/dist/dashboard/server.d.ts.map +1 -0
- package/dist/dashboard/server.js +112 -0
- package/dist/dashboard/server.js.map +1 -0
- package/dist/engines/attention-stream.d.ts +91 -0
- package/dist/engines/attention-stream.d.ts.map +1 -0
- package/dist/engines/attention-stream.js +193 -0
- package/dist/engines/attention-stream.js.map +1 -0
- package/dist/engines/byzantine-consensus.d.ts +104 -0
- package/dist/engines/byzantine-consensus.d.ts.map +1 -0
- package/dist/engines/byzantine-consensus.js +202 -0
- package/dist/engines/byzantine-consensus.js.map +1 -0
- package/dist/engines/context-assembler.d.ts +83 -0
- package/dist/engines/context-assembler.d.ts.map +1 -0
- package/dist/engines/context-assembler.js +318 -0
- package/dist/engines/context-assembler.js.map +1 -0
- package/dist/engines/darwin-journal.d.ts +44 -0
- package/dist/engines/darwin-journal.d.ts.map +1 -0
- package/dist/engines/darwin-journal.js +82 -0
- package/dist/engines/darwin-journal.js.map +1 -0
- package/dist/engines/darwin-loop.d.ts +37 -0
- package/dist/engines/darwin-loop.d.ts.map +1 -0
- package/dist/engines/darwin-loop.js +111 -0
- package/dist/engines/darwin-loop.js.map +1 -0
- package/dist/engines/entanglement.d.ts +99 -0
- package/dist/engines/entanglement.d.ts.map +1 -0
- package/dist/engines/entanglement.js +237 -0
- package/dist/engines/entanglement.js.map +1 -0
- package/dist/engines/entity-extractor.d.ts +42 -0
- package/dist/engines/entity-extractor.d.ts.map +1 -0
- package/dist/engines/entity-extractor.js +121 -0
- package/dist/engines/entity-extractor.js.map +1 -0
- package/dist/engines/event-bus.d.ts +161 -0
- package/dist/engines/event-bus.d.ts.map +1 -0
- package/dist/engines/event-bus.js +144 -0
- package/dist/engines/event-bus.js.map +1 -0
- package/dist/engines/graph-memory.d.ts +113 -0
- package/dist/engines/graph-memory.d.ts.map +1 -0
- package/dist/engines/graph-memory.js +291 -0
- package/dist/engines/graph-memory.js.map +1 -0
- package/dist/engines/graph-traversal.d.ts +66 -0
- package/dist/engines/graph-traversal.d.ts.map +1 -0
- package/dist/engines/graph-traversal.js +249 -0
- package/dist/engines/graph-traversal.js.map +1 -0
- package/dist/engines/hilbert-space.d.ts +75 -0
- package/dist/engines/hilbert-space.d.ts.map +1 -0
- package/dist/engines/hilbert-space.js +190 -0
- package/dist/engines/hilbert-space.js.map +1 -0
- package/dist/engines/hybrid-retriever.d.ts +46 -0
- package/dist/engines/hybrid-retriever.d.ts.map +1 -0
- package/dist/engines/hybrid-retriever.js +156 -0
- package/dist/engines/hybrid-retriever.js.map +1 -0
- package/dist/engines/index.d.ts +19 -5
- package/dist/engines/index.d.ts.map +1 -1
- package/dist/engines/index.js +8 -0
- package/dist/engines/index.js.map +1 -1
- package/dist/engines/kv-bridge.d.ts +98 -0
- package/dist/engines/kv-bridge.d.ts.map +1 -0
- package/dist/engines/kv-bridge.js +215 -0
- package/dist/engines/kv-bridge.js.map +1 -0
- package/dist/engines/memory.d.ts.map +1 -1
- package/dist/engines/memory.js +33 -27
- package/dist/engines/memory.js.map +1 -1
- package/dist/engines/nexusnet-relay.d.ts +37 -0
- package/dist/engines/nexusnet-relay.d.ts.map +1 -0
- package/dist/engines/nexusnet-relay.js +117 -0
- package/dist/engines/nexusnet-relay.js.map +1 -0
- package/dist/engines/pattern-codebook.d.ts +67 -0
- package/dist/engines/pattern-codebook.d.ts.map +1 -0
- package/dist/engines/pattern-codebook.js +169 -0
- package/dist/engines/pattern-codebook.js.map +1 -0
- package/dist/engines/session-dna.d.ts +87 -0
- package/dist/engines/session-dna.d.ts.map +1 -0
- package/dist/engines/session-dna.js +238 -0
- package/dist/engines/session-dna.js.map +1 -0
- package/dist/engines/skill-card.d.ts +45 -0
- package/dist/engines/skill-card.d.ts.map +1 -0
- package/dist/engines/skill-card.js +81 -0
- package/dist/engines/skill-card.js.map +1 -0
- package/dist/engines/token-supremacy.d.ts +23 -0
- package/dist/engines/token-supremacy.d.ts.map +1 -1
- package/dist/engines/token-supremacy.js +127 -7
- package/dist/engines/token-supremacy.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/phantom/index.d.ts.map +1 -1
- package/dist/phantom/index.js +5 -0
- package/dist/phantom/index.js.map +1 -1
- package/package.json +7 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sir-ad
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,253 +1,134 @@
|
|
|
1
1
|
# 🧬 Nexus Prime
|
|
2
2
|
|
|
3
|
-
**The AI
|
|
4
|
-
|
|
5
|
-
Nexus Prime is an MCP server that gives AI coding agents cross-session memory, token optimization, parallel sub-agent orchestration, and machine-checked guardrails — running as a background process that any agent can call as native tools.
|
|
3
|
+
**The Self-Evolving Agent Operating System. Give your AI agent a brain that persists, thinks, and learns.**
|
|
6
4
|
|
|
7
5
|
[](LICENSE)
|
|
8
|
-
[](https://nodejs.org)
|
|
7
|
+
[](https://typescriptlang.org)
|
|
8
|
+
[](#-quickstart)
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
┌─────────────────────────────────────────────────┐
|
|
20
|
-
│ Phantom (PM) │
|
|
21
|
-
│ "What to build" — PRDs, releases, docs │
|
|
22
|
-
│ github.com/sir-ad/phantom │
|
|
23
|
-
├─────────────────────────────────────────────────┤
|
|
24
|
-
│ MindKit (Skills) │
|
|
25
|
-
│ "How to think" — 22 skills, guardrails, routing │
|
|
26
|
-
│ github.com/sir-ad/mindkit │
|
|
27
|
-
├─────────────────────────────────────────────────┤
|
|
28
|
-
│ Nexus Prime (OS) ← YOU ARE HERE │
|
|
29
|
-
│ "How to run" — memory, tokens, workers, POD │
|
|
30
|
-
│ github.com/sir-ad/nexus-prime │
|
|
31
|
-
├─────────────────────────────────────────────────┤
|
|
32
|
-
│ Grain (Language) │
|
|
33
|
-
│ "How to speak" — 10 universal AI primitives │
|
|
34
|
-
│ github.com/sir-ad/grain │
|
|
35
|
-
└─────────────────────────────────────────────────┘
|
|
36
|
-
```
|
|
10
|
+
> [!IMPORTANT]
|
|
11
|
+
> **Nexus Prime** is a Meta-Framework exposed as an MCP (Model Context Protocol) server. It runs alongside your existing AI agents (Claude, Cursor, AntiGravity) to provide persistent memory, token optimization, and orchestrate parallel worker swarms.
|
|
37
12
|
|
|
38
13
|
---
|
|
39
14
|
|
|
40
|
-
##
|
|
15
|
+
## 🎯 The Problem & Value Proposition
|
|
41
16
|
|
|
42
|
-
Every AI
|
|
17
|
+
Every AI agent session starts with **total amnesia**. Your agent forgets yesterday's bug fix. It wastes 80% of its context window re-reading files it already understood. And when a task is complex enough to need multiple approaches, it works alone — sequentially, slowly.
|
|
43
18
|
|
|
44
|
-
|
|
45
|
-
- **Token usage is optimized** — agents read only what they need (50-90% savings)
|
|
46
|
-
- **Parallel sub-agents** explore multiple solutions simultaneously via git worktrees
|
|
47
|
-
- **Guardrails prevent mistakes** before code is written
|
|
48
|
-
- **Self-evolution** — learns from past sessions and adapts
|
|
19
|
+
Nexus Prime gives your agent four superpowers:
|
|
49
20
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
│ AI Agent (Claude / Gemini / GPT) │
|
|
57
|
-
│ │
|
|
58
|
-
│ Session Start During Work Shutdown │
|
|
59
|
-
│ nexus_recall_memory nexus_store_memory store │
|
|
60
|
-
│ nexus_memory_stats nexus_optimize_tokens summary │
|
|
61
|
-
│ nexus_mindkit_check │
|
|
62
|
-
│ nexus_ghost_pass │
|
|
63
|
-
│ nexus_spawn_workers │
|
|
64
|
-
│ nexus_audit_evolution │
|
|
65
|
-
└────────────────────────┬────────────────────────────┘
|
|
66
|
-
│ MCP (stdio)
|
|
67
|
-
┌────────────────────────▼────────────────────────────┐
|
|
68
|
-
│ NEXUS PRIME MCP SERVER │
|
|
69
|
-
│ │
|
|
70
|
-
│ MemoryEngine TokenSupremacyEngine │
|
|
71
|
-
│ ├─ Prefrontal (7) ├─ Content-Aware Scoring │
|
|
72
|
-
│ ├─ Hippocampus (200) ├─ BudgetAllocator │
|
|
73
|
-
│ └─ Cortex (∞, SQLite) └─ DifferentialContext │
|
|
74
|
-
│ │
|
|
75
|
-
│ PhantomWorkers GuardrailEngine │
|
|
76
|
-
│ ├─ GhostPass ├─ TokenBudget │
|
|
77
|
-
│ ├─ PhantomWorker ├─ DestructiveGuard │
|
|
78
|
-
│ ├─ MergeOracle ├─ MindKit GitHub Sync │
|
|
79
|
-
│ └─ POD Network └─ MemoryFirst │
|
|
80
|
-
│ │
|
|
81
|
-
│ HyperTuning AgentLearner │
|
|
82
|
-
│ ├─ Adaptive Budget ├─ SQL Pattern Detection │
|
|
83
|
-
│ └─ Complexity Signals └─ Evolution Candidates │
|
|
84
|
-
│ │
|
|
85
|
-
│ Embedder (TF-IDF 128-dim + optional OpenAI API) │
|
|
86
|
-
│ SessionTelemetry (📡 footer on every response) │
|
|
87
|
-
└─────────────────────────────────────────────────────┘
|
|
88
|
-
│
|
|
89
|
-
▼
|
|
90
|
-
~/.nexus-prime/memory.db (SQLite, survives restarts)
|
|
91
|
-
```
|
|
21
|
+
| Superpower | What It Does |
|
|
22
|
+
|:---|:---|
|
|
23
|
+
| **🧠 Persistent Memory** | 3-tier knowledge system (Prefrontal → Hippocampus → Cortex). 820+ Zettelkasten links. Survives restarts. Automatically links related concepts. |
|
|
24
|
+
| **⚡ Token Supremacy** | HyperTune™ optimizer reads only the relevant chunks. Continuous Attention Streams (CAS) compress discrete tokens into weighted continuous semantics. Saves 50-90% context. |
|
|
25
|
+
| **🐝 Phantom Swarms** | Parallel workers in isolated Git Worktrees. Ghost Pass risk analysis → Spawn Parallel Workers → Byzantine Merge. |
|
|
26
|
+
| **🛡️ MindKit Guardrails** | Machine-checked safety. Scores 0-100. Blocks destructive operations (like deleting test fixtures) before they happen. |
|
|
92
27
|
|
|
93
28
|
---
|
|
94
29
|
|
|
95
|
-
##
|
|
30
|
+
## ⚡ 30-Second Quickstart
|
|
96
31
|
|
|
97
32
|
```bash
|
|
98
|
-
#
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
# Or clone and build
|
|
102
|
-
git clone https://github.com/sir-ad/nexus-prime
|
|
103
|
-
cd nexus-prime
|
|
104
|
-
npm install
|
|
105
|
-
npm run build
|
|
106
|
-
```
|
|
33
|
+
# Clone and build
|
|
34
|
+
git clone https://github.com/sir-ad/nexus-prime.git
|
|
35
|
+
cd nexus-prime && npm install && npm run build
|
|
107
36
|
|
|
108
|
-
|
|
37
|
+
# Start the dashboard and background daemon
|
|
38
|
+
npm run start
|
|
39
|
+
```
|
|
109
40
|
|
|
110
|
-
Add to your MCP config (
|
|
41
|
+
Add to your agent's MCP config (Cursor, Claude Desktop, etc.):
|
|
111
42
|
|
|
112
43
|
```json
|
|
113
44
|
{
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
"args": ["/path/to/nexus-prime/dist/cli.js", "mcp"]
|
|
118
|
-
}
|
|
45
|
+
"nexus-prime": {
|
|
46
|
+
"command": "node",
|
|
47
|
+
"args": ["/absolute/path/to/nexus-prime/dist/cli.js", "mcp"]
|
|
119
48
|
}
|
|
120
49
|
}
|
|
121
50
|
```
|
|
122
51
|
|
|
123
|
-
|
|
52
|
+
> [!TIP]
|
|
53
|
+
> Once connected, ask your agent to call `nexus_memory_stats()` to confirm the cortex is online.
|
|
124
54
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
### Memory
|
|
128
|
-
|
|
129
|
-
| Tool | When | What |
|
|
130
|
-
|------|------|------|
|
|
131
|
-
| `nexus_store_memory` | After discoveries | Store findings, bugs, decisions. Priority 0-1. |
|
|
132
|
-
| `nexus_recall_memory` | Session start + mid-session | Semantic recall. Top-k memories matching query. |
|
|
133
|
-
| `nexus_memory_stats` | Session start | Tier counts, top tags, Zettelkasten link stats. |
|
|
134
|
-
|
|
135
|
-
### Intelligence
|
|
55
|
+
---
|
|
136
56
|
|
|
137
|
-
|
|
138
|
-
|------|------|------|
|
|
139
|
-
| `nexus_optimize_tokens` | Before reading 3+ files | Pre-flight reading plan. 50-90% token savings. |
|
|
140
|
-
| `nexus_ghost_pass` | Before modifying 3+ files | Risk analysis + worker approach suggestions. |
|
|
141
|
-
| `nexus_mindkit_check` | Before destructive ops | Guardrail check. PASS/FAIL with score 0-100. |
|
|
57
|
+
## 📊 Real-Time Dashboard
|
|
142
58
|
|
|
143
|
-
|
|
59
|
+
Nexus Prime includes a **built-in visualization dashboard** powered by Server-Sent Events (SSE). Watch your agent's memory stores, token optimizations, phantom dispatches, and guardrail checks stream in real time — zero polling.
|
|
144
60
|
|
|
145
|
-
|
|
146
|
-
|------|------|------|
|
|
147
|
-
| `nexus_spawn_workers` | Complex multi-file refactors | Phantom Workers in isolated git worktrees. |
|
|
148
|
-
| `nexus_audit_evolution` | Sprint boundaries / post-bug | Find recurring patterns, file hotspots. |
|
|
61
|
+
**Access it locally at:** `http://127.0.0.1:3377`
|
|
149
62
|
|
|
150
63
|
---
|
|
151
64
|
|
|
152
|
-
##
|
|
65
|
+
## 🧠 Core Primitives
|
|
153
66
|
|
|
154
|
-
|
|
67
|
+
### Memory Tiers
|
|
68
|
+
The fundamental unit of knowledge is a Memory, structured in 3 tiers (inspired by human cognition):
|
|
69
|
+
- `prefrontal` — Active working memory, 7 items, instant recall.
|
|
70
|
+
- `hippocampus` — Recent session context, ~200 items.
|
|
71
|
+
- `cortex` — Long-term permanent storage backed by SQLite.
|
|
155
72
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
| **Prefrontal** | 7 items | RAM | Active working set |
|
|
159
|
-
| **Hippocampus** | 200 items | RAM | Recent session context |
|
|
160
|
-
| **Cortex** | Unlimited | SQLite | Long-term persistence |
|
|
73
|
+
### Zettelkasten Linking
|
|
74
|
+
Memories link to each other automatically when they share semantic context. High-priority stores trigger **fission** — the memory broadcasts to related existing memories, strengthening their links.
|
|
161
75
|
|
|
162
|
-
|
|
76
|
+
### Context Compression (CAS Engine)
|
|
77
|
+
The Continuous Attention Stream (CAS) Engine replaces discrete tokens with weighted continuous fluid potentials. Common patterns get compressed; novel information gets expanded. Achieves extreme context expansion.
|
|
163
78
|
|
|
164
79
|
---
|
|
165
80
|
|
|
166
|
-
##
|
|
81
|
+
## 🛠️ MCP Tool API
|
|
167
82
|
|
|
168
|
-
|
|
83
|
+
Nexus Prime exposes powerful tools to the AI agent:
|
|
169
84
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
→ N PhantomWorkers (parallel, isolated git worktrees)
|
|
173
|
-
→ POD Network (asynchronous learning exchange)
|
|
174
|
-
→ MergeOracle (Byzantine vote, confidence-weighted merge)
|
|
175
|
-
```
|
|
85
|
+
### `nexus_store_memory(content, priority, tags[])`
|
|
86
|
+
Writes a memory to the prefrontal tier. If `priority ≥ 0.9`, it is auto-promoted to the Cortex. If `priority ≥ 0.8`, it generates Zettelkasten links.
|
|
176
87
|
|
|
177
|
-
|
|
88
|
+
### `nexus_recall_memory(query, k)`
|
|
89
|
+
Semantic nearest-neighbor search across all memory tiers. Uses hybrid scoring (`0.5×similarity + 0.25×priority + 0.15×recency + 0.1×access_bonus`).
|
|
178
90
|
|
|
179
|
-
|
|
91
|
+
### `nexus_optimize_tokens(task, files[])`
|
|
92
|
+
Analyzes files by relevance to the task, returning a structured reading plan (e.g., `full`, `outline`, or `skip`). Distributes the token budget securely.
|
|
180
93
|
|
|
181
|
-
|
|
94
|
+
### `nexus_ghost_pass(goal, files[])`
|
|
95
|
+
Read-only pre-flight analysis. Identifies risk areas (e.g., concurrent writes) and suggests parallel worker strategies before modifying files.
|
|
182
96
|
|
|
183
|
-
|
|
97
|
+
### `nexus_spawn_workers(goal, files[])`
|
|
98
|
+
Spawns parallel Phantom Workers in mathematically isolated Git Worktrees. Evaluates different implementation approaches simultaneously. Returns a `MergeDecision` from the Oracle to synthesize or apply the best approach.
|
|
184
99
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
3 calls │ 20.3k tokens saved │ 2 stored │ 5 recalled │ 59 Zettel links
|
|
188
|
-
```
|
|
100
|
+
### `nexus_mindkit_check(action, filesToModify, isDestructive)`
|
|
101
|
+
Evaluates high-risk actions against machine-checked Guardrail predicates. Returns `PASS/FAIL` and actionable suggestions to prevent disaster.
|
|
189
102
|
|
|
190
103
|
---
|
|
191
104
|
|
|
192
|
-
##
|
|
105
|
+
## 🤖 Sub-Agent Roles
|
|
193
106
|
|
|
194
|
-
|
|
107
|
+
Nexus Prime manages a crew of specialized sub-agents:
|
|
195
108
|
|
|
196
|
-
|
|
|
197
|
-
|
|
198
|
-
| `
|
|
199
|
-
| `
|
|
200
|
-
|
|
|
201
|
-
| `
|
|
202
|
-
| `
|
|
203
|
-
| `
|
|
109
|
+
| Role | Trigger Tool | Responsibility |
|
|
110
|
+
|------|--------------|----------------|
|
|
111
|
+
| **Ghost Pass Analyst** | `nexus_ghost_pass` | Reads AST, identifies risk areas, suggests approaches. |
|
|
112
|
+
| **Phantom Worker** | `nexus_spawn_workers` | Executes tasks in isolated git worktrees independently. |
|
|
113
|
+
| **Merge Oracle** | Post-worker | Byzantine vote on worker outputs, synthesizes winning diff. |
|
|
114
|
+
| **Evolution Auditor** | `nexus_audit_evolution` | Scans memory for hotspots and recurring failure patterns. |
|
|
115
|
+
| **Guardrail Enforcer**| `nexus_mindkit_check` | Machine-checks actions against Token Budget and Destructive rules. |
|
|
116
|
+
| **Token Budgeteer** | `nexus_optimize_tokens` | Scores file relevance and builds optimized reading plans. |
|
|
117
|
+
| **Memory Librarian** | `nexus_store_memory` | Promotes/demotes items across Prefrontal, Hippocampus, and Cortex. |
|
|
204
118
|
|
|
205
119
|
---
|
|
206
120
|
|
|
207
|
-
##
|
|
208
|
-
|
|
209
|
-
```
|
|
210
|
-
nexus-prime/
|
|
211
|
-
├── src/
|
|
212
|
-
│ ├── index.ts # NexusPrime main class
|
|
213
|
-
│ ├── cli.ts # CLI entry (node dist/cli.js mcp)
|
|
214
|
-
│ ├── agents/
|
|
215
|
-
│ │ ├── adapters/mcp.ts # MCP server, 8 tools + telemetry
|
|
216
|
-
│ │ ├── coordinator.ts # Worker dispatch orchestration
|
|
217
|
-
│ │ ├── orchestrator.ts # Context-aware agent runner
|
|
218
|
-
│ │ └── learner.ts # SQL-based evolution detection
|
|
219
|
-
│ ├── engines/
|
|
220
|
-
│ │ ├── memory.ts # Three-tier memory + queryByTags
|
|
221
|
-
│ │ ├── embedder.ts # TF-IDF + optional OpenAI embeddings
|
|
222
|
-
│ │ ├── token-supremacy.ts # Content-aware token optimization
|
|
223
|
-
│ │ ├── guardrails-bridge.ts # GuardrailEngine + MindKit sync
|
|
224
|
-
│ │ └── meta-learner.ts # HyperTuning adaptive parameters
|
|
225
|
-
│ └── phantom/
|
|
226
|
-
│ ├── index.ts # GhostPass, PhantomWorker, MergeOracle
|
|
227
|
-
│ └── phase4-orchestrator.ts # Self-built phase orchestrator
|
|
228
|
-
├── packages/
|
|
229
|
-
│ └── mindkit/ # Standalone npm package
|
|
230
|
-
├── test/
|
|
231
|
-
│ ├── phantom.test.ts # E2E Phantom Workers test
|
|
232
|
-
│ └── memory.test.ts # Semantic recall test
|
|
233
|
-
├── GEMINI.md # Session protocol for AI agents
|
|
234
|
-
├── AGENTS.md # Agent overview
|
|
235
|
-
└── NEXUS.md # Language specification
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
---
|
|
121
|
+
## 🧩 Default Skill Cards
|
|
239
122
|
|
|
240
|
-
|
|
123
|
+
Skills are built-in behaviors the orchestrator can call upon:
|
|
241
124
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
| `NEXUS_EMBED_KEY` | — | API key when mode=api |
|
|
247
|
-
| `NEXUS_EMBED_MODEL` | — | Model name when mode=api |
|
|
125
|
+
1. **`debug_typescript_error`**: Standard procedure for TS compiler errors. Triggers on "tsc error".
|
|
126
|
+
2. **`optimize_token_budget`**: Drastic reduction of context usage. Triggers on "token limit" or "out of memory". Opens `nexus_optimize_tokens`.
|
|
127
|
+
3. **`parallel_refactor`**: Uses `nexus_ghost_pass` and `nexus_spawn_workers` to explore refactoring strategies asynchronously.
|
|
128
|
+
4. **`memory_first_research`**: Triggers `nexus_recall_memory` with high k to prevent re-researching solved problems.
|
|
248
129
|
|
|
249
130
|
---
|
|
250
131
|
|
|
251
|
-
## License
|
|
132
|
+
## 📜 License
|
|
252
133
|
|
|
253
|
-
MIT
|
|
134
|
+
Nexus Prime is released under the MIT License. See [LICENSE](LICENSE) for details.
|
|
@@ -8,11 +8,13 @@ export declare class MCPAdapter implements Adapter {
|
|
|
8
8
|
private server;
|
|
9
9
|
private nexusRef?;
|
|
10
10
|
private telemetry;
|
|
11
|
+
private sessionDNA;
|
|
11
12
|
constructor();
|
|
12
13
|
setNexusRef(nexus: NexusPrime): void;
|
|
13
14
|
private setupToolHandlers;
|
|
14
15
|
private handleToolCall;
|
|
15
|
-
|
|
16
|
+
scanSourceFiles(cwd: string): string[];
|
|
17
|
+
private walk;
|
|
16
18
|
connect(): Promise<void>;
|
|
17
19
|
disconnect(): Promise<void>;
|
|
18
20
|
send(_message: NetworkMessage): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/mcp.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/mcp.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAgK5C,qBAAa,UAAW,YAAW,OAAO;IACtC,IAAI,SAAS;IACb,IAAI,EAAG,KAAK,CAAU;IACtB,SAAS,UAAS;IAClB,MAAM,EAAE,MAAM,EAAE,CAAM;IAEtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,CAAa;IAC9B,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,UAAU,CAAoB;;IAWtC,WAAW,CAAC,KAAK,EAAE,UAAU;IAI7B,OAAO,CAAC,iBAAiB;YA2RX,cAAc;IA8nB5B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAItC,OAAO,CAAC,IAAI;IAmBN,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAkB3B,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IACnD,OAAO,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;CAC1C"}
|