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.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +75 -194
  3. package/dist/agents/adapters/mcp.d.ts +3 -1
  4. package/dist/agents/adapters/mcp.d.ts.map +1 -1
  5. package/dist/agents/adapters/mcp.js +622 -29
  6. package/dist/agents/adapters/mcp.js.map +1 -1
  7. package/dist/agents/adapters.d.ts +2 -2
  8. package/dist/agents/adapters.d.ts.map +1 -1
  9. package/dist/agents/coordinator.d.ts.map +1 -1
  10. package/dist/agents/coordinator.js +78 -13
  11. package/dist/agents/coordinator.js.map +1 -1
  12. package/dist/dashboard/index.html +593 -0
  13. package/dist/dashboard/server.d.ts +26 -0
  14. package/dist/dashboard/server.d.ts.map +1 -0
  15. package/dist/dashboard/server.js +112 -0
  16. package/dist/dashboard/server.js.map +1 -0
  17. package/dist/engines/attention-stream.d.ts +91 -0
  18. package/dist/engines/attention-stream.d.ts.map +1 -0
  19. package/dist/engines/attention-stream.js +193 -0
  20. package/dist/engines/attention-stream.js.map +1 -0
  21. package/dist/engines/byzantine-consensus.d.ts +104 -0
  22. package/dist/engines/byzantine-consensus.d.ts.map +1 -0
  23. package/dist/engines/byzantine-consensus.js +202 -0
  24. package/dist/engines/byzantine-consensus.js.map +1 -0
  25. package/dist/engines/context-assembler.d.ts +83 -0
  26. package/dist/engines/context-assembler.d.ts.map +1 -0
  27. package/dist/engines/context-assembler.js +318 -0
  28. package/dist/engines/context-assembler.js.map +1 -0
  29. package/dist/engines/darwin-journal.d.ts +44 -0
  30. package/dist/engines/darwin-journal.d.ts.map +1 -0
  31. package/dist/engines/darwin-journal.js +82 -0
  32. package/dist/engines/darwin-journal.js.map +1 -0
  33. package/dist/engines/darwin-loop.d.ts +37 -0
  34. package/dist/engines/darwin-loop.d.ts.map +1 -0
  35. package/dist/engines/darwin-loop.js +111 -0
  36. package/dist/engines/darwin-loop.js.map +1 -0
  37. package/dist/engines/entanglement.d.ts +99 -0
  38. package/dist/engines/entanglement.d.ts.map +1 -0
  39. package/dist/engines/entanglement.js +237 -0
  40. package/dist/engines/entanglement.js.map +1 -0
  41. package/dist/engines/entity-extractor.d.ts +42 -0
  42. package/dist/engines/entity-extractor.d.ts.map +1 -0
  43. package/dist/engines/entity-extractor.js +121 -0
  44. package/dist/engines/entity-extractor.js.map +1 -0
  45. package/dist/engines/event-bus.d.ts +161 -0
  46. package/dist/engines/event-bus.d.ts.map +1 -0
  47. package/dist/engines/event-bus.js +144 -0
  48. package/dist/engines/event-bus.js.map +1 -0
  49. package/dist/engines/graph-memory.d.ts +113 -0
  50. package/dist/engines/graph-memory.d.ts.map +1 -0
  51. package/dist/engines/graph-memory.js +291 -0
  52. package/dist/engines/graph-memory.js.map +1 -0
  53. package/dist/engines/graph-traversal.d.ts +66 -0
  54. package/dist/engines/graph-traversal.d.ts.map +1 -0
  55. package/dist/engines/graph-traversal.js +249 -0
  56. package/dist/engines/graph-traversal.js.map +1 -0
  57. package/dist/engines/hilbert-space.d.ts +75 -0
  58. package/dist/engines/hilbert-space.d.ts.map +1 -0
  59. package/dist/engines/hilbert-space.js +190 -0
  60. package/dist/engines/hilbert-space.js.map +1 -0
  61. package/dist/engines/hybrid-retriever.d.ts +46 -0
  62. package/dist/engines/hybrid-retriever.d.ts.map +1 -0
  63. package/dist/engines/hybrid-retriever.js +156 -0
  64. package/dist/engines/hybrid-retriever.js.map +1 -0
  65. package/dist/engines/index.d.ts +19 -5
  66. package/dist/engines/index.d.ts.map +1 -1
  67. package/dist/engines/index.js +8 -0
  68. package/dist/engines/index.js.map +1 -1
  69. package/dist/engines/kv-bridge.d.ts +98 -0
  70. package/dist/engines/kv-bridge.d.ts.map +1 -0
  71. package/dist/engines/kv-bridge.js +215 -0
  72. package/dist/engines/kv-bridge.js.map +1 -0
  73. package/dist/engines/memory.d.ts.map +1 -1
  74. package/dist/engines/memory.js +33 -27
  75. package/dist/engines/memory.js.map +1 -1
  76. package/dist/engines/nexusnet-relay.d.ts +37 -0
  77. package/dist/engines/nexusnet-relay.d.ts.map +1 -0
  78. package/dist/engines/nexusnet-relay.js +117 -0
  79. package/dist/engines/nexusnet-relay.js.map +1 -0
  80. package/dist/engines/pattern-codebook.d.ts +67 -0
  81. package/dist/engines/pattern-codebook.d.ts.map +1 -0
  82. package/dist/engines/pattern-codebook.js +169 -0
  83. package/dist/engines/pattern-codebook.js.map +1 -0
  84. package/dist/engines/session-dna.d.ts +87 -0
  85. package/dist/engines/session-dna.d.ts.map +1 -0
  86. package/dist/engines/session-dna.js +238 -0
  87. package/dist/engines/session-dna.js.map +1 -0
  88. package/dist/engines/skill-card.d.ts +45 -0
  89. package/dist/engines/skill-card.d.ts.map +1 -0
  90. package/dist/engines/skill-card.js +81 -0
  91. package/dist/engines/skill-card.js.map +1 -0
  92. package/dist/engines/token-supremacy.d.ts +23 -0
  93. package/dist/engines/token-supremacy.d.ts.map +1 -1
  94. package/dist/engines/token-supremacy.js +127 -7
  95. package/dist/engines/token-supremacy.js.map +1 -1
  96. package/dist/index.d.ts +1 -0
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +7 -0
  99. package/dist/index.js.map +1 -1
  100. package/dist/phantom/index.d.ts.map +1 -1
  101. package/dist/phantom/index.js +5 -0
  102. package/dist/phantom/index.js.map +1 -1
  103. 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 meta-framework that makes agents smarter about themselves.**
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: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
- [![Node.js](https://img.shields.io/badge/Node.js-18%2B-green.svg)](https://nodejs.org)
9
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue.svg)](https://typescriptlang.org)
10
- [![npm](https://img.shields.io/npm/v/nexus-prime)](https://www.npmjs.com/package/nexus-prime)
11
-
12
- ---
13
-
14
- ## The Super Intellect Stack
6
+ [![Node.js](https://img.shields.io/badge/Node.js-22%2B-green.svg)](https://nodejs.org)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue.svg)](https://typescriptlang.org)
8
+ [![Version](https://img.shields.io/badge/Version-1.2.0-orange.svg)](#-quickstart)
15
9
 
16
- Nexus Prime is the **runtime layer** in a 4-project ecosystem:
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
- ## Why?
15
+ ## 🎯 The Problem & Value Proposition
41
16
 
42
- Every AI coding session starts cold. The agent re-reads the same files, re-discovers the same patterns, makes the same mistakes. Nexus Prime fixes this:
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
- - **Memory persists between sessions** findings survive restarts
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
- ## Architecture
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
- ## Quick Start
30
+ ## 30-Second Quickstart
96
31
 
97
32
  ```bash
98
- # Install from npm
99
- npm install -g nexus-prime
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
- ### Wire into your AI agent
37
+ # Start the dashboard and background daemon
38
+ npm run start
39
+ ```
109
40
 
110
- Add to your MCP config (AntiGravity, Claude Desktop, etc.):
41
+ Add to your agent's MCP config (Cursor, Claude Desktop, etc.):
111
42
 
112
43
  ```json
113
44
  {
114
- "mcpServers": {
115
- "nexus-prime": {
116
- "command": "node",
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
- ## The 8 MCP Tools
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
- | Tool | When | What |
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
- ### Parallel Work
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
- | Tool | When | What |
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
- ## Memory System
65
+ ## 🧠 Core Primitives
153
66
 
154
- Three-tier architecture modelled on human memory:
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
- | Tier | Size | Backed by | Purpose |
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
- **Recall** uses hybrid scoring: TF-IDF vectors (128-dim) + priority + recency + access count.
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
- ## Phantom Workers
81
+ ## 🛠️ MCP Tool API
167
82
 
168
- Parallel sub-agent framework using real git worktrees:
83
+ Nexus Prime exposes powerful tools to the AI agent:
169
84
 
170
- ```
171
- GhostPass (read-only analysis)
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
- Each worker gets an isolated copy of the repo. Workers broadcast findings via the **POD Network**. The `MergeOracle` evaluates outcomes by confidence score.
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
- ## Session Telemetry
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
- Every MCP response includes a telemetry footer:
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
- ─── 📡 Nexus Prime (12s) ───
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
- ## Guardrails (MindKit)
105
+ ## 🤖 Sub-Agent Roles
193
106
 
194
- 6 machine-checked rules + external rules synced from [MindKit](https://github.com/sir-ad/mindkit):
107
+ Nexus Prime manages a crew of specialized sub-agents:
195
108
 
196
- | Rule | Trigger | Action |
197
- |------|---------|--------|
198
- | `TOKEN_BUDGET` | Context > 100k tokens | 🚫 Block |
199
- | `TOKEN_WARN` | Context > 70k tokens | ⚠️ Warn |
200
- | `DESTRUCTIVE_GUARD` | `isDestructive: true` | 🚫 Block |
201
- | `BULK_FILE_GUARD` | > 10 files modified | ⚠️ Warn |
202
- | `NO_PROD_WRITES` | `/etc`, `/usr`, `/bin` | 🚫 Block |
203
- | `MEMORY_FIRST` | "research" / "look up" | ℹ️ Remind |
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
- ## Project Structure
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
- ## Configuration
123
+ Skills are built-in behaviors the orchestrator can call upon:
241
124
 
242
- | Env Var | Default | Description |
243
- |---------|---------|-------------|
244
- | `NEXUS_EMBED_MODE` | `local` | `local` (TF-IDF) or `api` (OpenAI-compatible) |
245
- | `NEXUS_EMBED_URL` | | API endpoint when mode=api |
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 [sir-ad](https://github.com/sir-ad)
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
- private scanSourceFiles;
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":["../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