@unerr-ai/unerr 0.0.0-beta.9 → 0.0.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 +213 -246
- package/dist/cli.js +17109 -10169
- package/dist/ui/assets/index-BISLlJyc.js +10 -0
- package/dist/ui/assets/index-BUChTv4H.css +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/ui/screenshots/activity.png +0 -0
- package/dist/ui/screenshots/code-base-intelligence.png +0 -0
- package/dist/ui/screenshots/dashboard.png +0 -0
- package/dist/ui/screenshots/project-memory.png +0 -0
- package/dist/ui/screenshots/reasoning-quality.png +0 -0
- package/dist/ui/screenshots/token-trace-main.png +0 -0
- package/package.json +30 -19
- package/dist/ui/assets/index-B_QbOkZx.js +0 -10
- package/dist/ui/assets/index-C2BBqscH.css +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://unerr.dev/icon-wordmark.svg" alt="unerr" width="320"
|
|
2
|
+
<a href="https://www.unerr.dev/"><img src="https://unerr.dev/icon-wordmark.svg" alt="unerr — local intelligence layer for AI coding agents" width="320" /></a>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
@@ -7,14 +7,19 @@
|
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
A local intelligence layer that sits between your AI agent and your codebase —<br/>
|
|
11
|
+
indexes every call, remembers every decision, and gets sharper the longer you use it.
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
<p align="center">
|
|
15
|
+
<a href="https://www.unerr.dev/"><img src="https://img.shields.io/badge/website-unerr.dev-8B5CF6?style=flat-square&logo=icloud&logoColor=white" alt="Website" /></a>
|
|
15
16
|
<a href="https://www.npmjs.com/package/@unerr-ai/unerr"><img src="https://img.shields.io/badge/install-npm_i_@unerr--ai/unerr-8B5CF6?style=flat-square&logo=npm" alt="Install" /></a>
|
|
17
|
+
<a href="https://discord.gg/JfZ4pYgb"><img src="https://img.shields.io/badge/community-Discord-5865F2?style=flat-square&logo=discord&logoColor=white" alt="Discord" /></a>
|
|
18
|
+
<a href="https://x.com/unerr_ai"><img src="https://img.shields.io/badge/follow-@unerr__ai-000000?style=flat-square&logo=x&logoColor=white" alt="X / Twitter" /></a>
|
|
19
|
+
<a href="https://www.linkedin.com/company/unerr"><img src="https://img.shields.io/badge/linkedin-unerr-0A66C2?style=flat-square&logo=linkedin&logoColor=white" alt="LinkedIn" /></a>
|
|
16
20
|
<img src="https://img.shields.io/badge/runtime-Node.js_≥20-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node.js" />
|
|
17
21
|
<img src="https://img.shields.io/badge/protocol-MCP-7C3AED?style=flat-square" alt="MCP" />
|
|
22
|
+
<img src="https://img.shields.io/badge/local--first-no_cloud-22D3EE?style=flat-square" alt="Local-first" />
|
|
18
23
|
<img src="https://img.shields.io/badge/license-ELv2-A1A1AA?style=flat-square" alt="License" />
|
|
19
24
|
</p>
|
|
20
25
|
|
|
@@ -24,144 +29,145 @@
|
|
|
24
29
|
|
|
25
30
|
---
|
|
26
31
|
|
|
27
|
-
##
|
|
32
|
+
## The agent isn't stupid. It's flying blind.
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
Watch any AI coding session for ten minutes and you'll see the same loop:
|
|
30
35
|
|
|
31
|
-
**
|
|
36
|
+
- It **reads 30 files** to find one function — burning the context window before it writes a line.
|
|
37
|
+
- It **edits something with 40 callers** and never knows it just broke three services.
|
|
38
|
+
- It **re-derives the same conventions** you taught it yesterday, this morning, and an hour ago.
|
|
39
|
+
- It **forgets the entire session** the moment the window closes.
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
- It doesn't know your team uses `fetch` prefixes, not `get`
|
|
35
|
-
- It forgot everything from yesterday's session
|
|
36
|
-
|
|
37
|
-
unerr gives it an intelligence layer that compounds. Every caller, every convention, every session — accumulated, not re-derived. The agent stops searching and starts knowing.
|
|
41
|
+
Every one of these is the same root cause: the agent has **no persistent memory of your code, your team's style, or its own past mistakes**. unerr is that memory. One process, fully local, indexed in seconds — and your agent picks it up automatically through MCP.
|
|
38
42
|
|
|
39
43
|
---
|
|
40
44
|
|
|
41
|
-
## What
|
|
45
|
+
## What you actually see
|
|
46
|
+
|
|
47
|
+
Run `unerr` and open the dashboard. Four panes, all live:
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
| Pane | Answers the question | Powered by |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| **Token Optimization** | *How much context did unerr save my agent this session?* — saved vs. delivered, compounding multiplier, breakdown by mechanism (compression, graph hits, skipped re-reads). | Per-turn ledger of every tool call |
|
|
52
|
+
| **Reasoning Quality** | *Did the agent actually use what it remembered?* — 4-pillar score across exploration, planning, execution, persistent memory. | 5-turn outcome window per fact/convention |
|
|
53
|
+
| **Codebase Map + Code Intelligence** | *What's the call graph and where are the blast-radius landmines?* — entities, edges, fan-in/out chokepoints, cross-module surprise links. | CozoDB graph (in-process, <5ms) |
|
|
54
|
+
| **Project Memory + Activity** | *What did we already learn, and what was I doing last time?* — facts the agent recorded, sessions stitched into intents, open blockers. | Append-only fact store + timeline.db |
|
|
44
55
|
|
|
45
|
-
|
|
46
|
-
|:---|:---|
|
|
47
|
-
| Reads 30 files to understand a call graph | Queries the graph in 5ms |
|
|
48
|
-
| Misses downstream callers, breaks things | Sees full blast radius before editing |
|
|
49
|
-
| Re-derives conventions every session | Knows your patterns, enforces them |
|
|
50
|
-
| Session degrades at 70% context fill | Stays sharp — 93% shell compression, context lasts 3–5x longer |
|
|
51
|
-
| Starts from zero tomorrow | Resumes where it left off |
|
|
56
|
+
The agent reads from the same store through MCP — every claim on the dashboard is also a tool call it just made.
|
|
52
57
|
|
|
53
58
|
### See it in action
|
|
54
59
|
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</
|
|
82
|
-
</
|
|
83
|
-
|
|
84
|
-
|
|
60
|
+
<table align="center">
|
|
61
|
+
<tr>
|
|
62
|
+
<td align="center" width="240">
|
|
63
|
+
<img src="https://unerr.dev/open-cli/screenshots/dashboard.png" alt="unerr dashboard — live overview" width="240" height="150" />
|
|
64
|
+
<br/><sub><strong>Dashboard</strong><br/>Live overview — active sessions, recent tool calls, tokens saved this turn.</sub>
|
|
65
|
+
</td>
|
|
66
|
+
<td align="center" width="240">
|
|
67
|
+
<img src="https://unerr.dev/open-cli/screenshots/token-trace-main.png" alt="unerr token trace — global" width="240" height="150" />
|
|
68
|
+
<br/><sub><strong>Token Trace · global</strong><br/>Aggregate savings across every session, broken down by mechanism (graph, file_read, shell, dedup, format).</sub>
|
|
69
|
+
</td>
|
|
70
|
+
<td align="center" width="240">
|
|
71
|
+
<img src="https://unerr.dev/open-cli/screenshots/token-session.png" alt="unerr token trace — session" width="240" height="150" />
|
|
72
|
+
<br/><sub><strong>Token Trace · session</strong><br/>Single session: per-turn savings, mechanism mix, and the compounding multiplier.</sub>
|
|
73
|
+
</td>
|
|
74
|
+
<td align="center" width="240">
|
|
75
|
+
<img src="https://unerr.dev/open-cli/screenshots/token-turn.png" alt="unerr token trace — turn" width="240" height="150" />
|
|
76
|
+
<br/><sub><strong>Token Trace · turn</strong><br/>Single turn: which tool calls fired, tokens each would have cost without unerr vs what was delivered.</sub>
|
|
77
|
+
</td>
|
|
78
|
+
</tr>
|
|
79
|
+
<tr>
|
|
80
|
+
<td align="center" width="240">
|
|
81
|
+
<img src="https://unerr.dev/open-cli/screenshots/reasoning-quality.png" alt="unerr reasoning quality — global" width="240" height="150" />
|
|
82
|
+
<br/><sub><strong>Reasoning Quality · global</strong><br/>Four-pillar score across cleaner context, fewer wasted turns, fewer breakages, persistent memory.</sub>
|
|
83
|
+
</td>
|
|
84
|
+
<td align="center" width="240">
|
|
85
|
+
<img src="https://unerr.dev/open-cli/screenshots/reasoning-session.png" alt="unerr reasoning quality — session" width="240" height="150" />
|
|
86
|
+
<br/><sub><strong>Reasoning Quality · session</strong><br/>Per-session: which facts and conventions were reinforced, acted on, ignored, or corrected.</sub>
|
|
87
|
+
</td>
|
|
88
|
+
<td align="center" width="240">
|
|
89
|
+
<img src="https://unerr.dev/open-cli/screenshots/code-base-intelligence.png" alt="unerr code intelligence" width="240" height="150" />
|
|
90
|
+
<br/><sub><strong>Code Intelligence</strong><br/>Call graph, fan-in/out chokepoints, cross-module surprise links, and a risk grade per file.</sub>
|
|
91
|
+
</td>
|
|
92
|
+
<td align="center" width="240">
|
|
93
|
+
<img src="https://unerr.dev/open-cli/screenshots/project-memory.png" alt="unerr project memory — facts" width="240" height="150" />
|
|
94
|
+
<br/><sub><strong>Project Memory</strong><br/>Conventions, anti-patterns, decisions — with decay-adjusted confidence and reinforcement counts.</sub>
|
|
95
|
+
</td>
|
|
96
|
+
</tr>
|
|
97
|
+
<tr>
|
|
98
|
+
<td align="center" width="240" colspan="4">
|
|
99
|
+
<img src="https://unerr.dev/open-cli/screenshots/activity.png" alt="unerr activity — timeline + heatmap" width="240" height="150" />
|
|
100
|
+
<br/><sub><strong>Activity</strong><br/>Turn-grouped timeline with a 30-day heatmap — each row is one burst of agent work (intent → tools → outcome).</sub>
|
|
101
|
+
</td>
|
|
102
|
+
</tr>
|
|
103
|
+
</table>
|
|
85
104
|
|
|
86
105
|
---
|
|
87
106
|
|
|
88
107
|
## Quick Start
|
|
89
108
|
|
|
90
|
-
|
|
109
|
+
> unerr is **per-repository**. Each project gets its own `.unerr/` directory, graph DB, and config. Run install once per repo.
|
|
110
|
+
|
|
111
|
+
### 1. Install the CLI globally
|
|
91
112
|
|
|
92
113
|
```bash
|
|
93
|
-
# 1. Install globally
|
|
94
114
|
npm install -g @unerr-ai/unerr
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
unerr install claude-code # or: cursor, vscode, windsurf, codex, etc.
|
|
98
|
-
|
|
99
|
-
# 3. Run (indexes your codebase, starts MCP server)
|
|
100
|
-
unerr
|
|
115
|
+
# verify
|
|
116
|
+
unerr --version
|
|
101
117
|
```
|
|
102
118
|
|
|
103
|
-
|
|
104
|
-
### Install from source
|
|
119
|
+
### 2. `cd` into the **root of the repository** you want to enhance
|
|
105
120
|
|
|
106
121
|
```bash
|
|
107
|
-
#
|
|
108
|
-
|
|
109
|
-
cd unerr-cli
|
|
110
|
-
pnpm install
|
|
111
|
-
pnpm run build
|
|
122
|
+
cd /path/to/your-project # must be the repo root (where .git or package.json lives)
|
|
123
|
+
```
|
|
112
124
|
|
|
113
|
-
|
|
114
|
-
pnpm link --global
|
|
125
|
+
This matters: every file unerr writes — `.mcp.json`, `.claude/`, `.cursor/`, `.unerr/`, `.gitignore` entry — is scoped to the current working directory. Running install from a subdirectory will create a stray, broken setup.
|
|
115
126
|
|
|
116
|
-
|
|
117
|
-
cd /path/to/your/project
|
|
118
|
-
unerr install claude-code # or: cursor, vscode, windsurf, codex, etc.
|
|
127
|
+
### 3. Install unerr for your coding agent
|
|
119
128
|
|
|
120
|
-
|
|
121
|
-
unerr
|
|
122
|
-
```
|
|
123
|
-
-->
|
|
129
|
+
Pick the agent you actually use. Each command writes the MCP config, agent-specific skill files, instruction injection, and (where supported) hooks — all in the current repo:
|
|
124
130
|
|
|
125
|
-
|
|
131
|
+
```bash
|
|
132
|
+
unerr install claude-code # → .mcp.json + CLAUDE.md + .claude/skills/ + hooks
|
|
133
|
+
unerr install cursor # → .cursor/mcp.json + .cursor/rules/ + hooks
|
|
134
|
+
unerr install antigravity # → .antigravity/mcp_config.json + .agents/rules/ + .agents/skills/
|
|
135
|
+
unerr install windsurf # → ~/.codeium/windsurf/mcp_config.json + .windsurf/rules/ + .windsurf/skills/
|
|
136
|
+
unerr install gemini-cli # → .gemini/settings.json + GEMINI.md + .gemini/skills/
|
|
137
|
+
unerr install github-copilot-cli # → .copilot/mcp-config.json + .github/copilot-instructions.md + .github/skills/
|
|
138
|
+
```
|
|
126
139
|
|
|
127
|
-
|
|
140
|
+
What it does:
|
|
128
141
|
|
|
129
|
-
|
|
142
|
+
1. Writes a project-level MCP config (`{"command": "unerr", "args": ["--mcp"]}`) — never global.
|
|
143
|
+
2. Drops 11 bundled skills into the agent's skills directory so the agent knows when to call which tool.
|
|
144
|
+
3. Injects a tool-preference section into the agent's instruction file (CLAUDE.md, .cursor/rules, etc.) — idempotent, removable with `unerr uninstall`.
|
|
145
|
+
4. Installs hooks where the agent supports them (Claude Code, Cursor, Cline) — these compress shell output and steer the agent back to graph tools.
|
|
146
|
+
5. Adds `.unerr` to `.gitignore`.
|
|
147
|
+
6. For Claude Code, denies built-in `Read`/`Grep`/`Glob` so the agent must use unerr's graph-aware equivalents (opt out with `--no-force-tools`).
|
|
130
148
|
|
|
131
|
-
|
|
149
|
+
> Need a different agent or doing it by hand? `unerr install --show-instructions <agent>` prints copy-pasteable setup.
|
|
132
150
|
|
|
133
|
-
|
|
151
|
+
### 4. Run `unerr` — and **keep it running**
|
|
134
152
|
|
|
135
153
|
```bash
|
|
136
|
-
unerr
|
|
137
|
-
unerr install cursor # .cursor/mcp.json + .cursor/rules/ + hooks
|
|
138
|
-
unerr install antigravity # .antigravity/mcp_config.json + .agents/rules/ + .agents/skills/
|
|
139
|
-
unerr install windsurf # ~/.codeium/windsurf/mcp_config.json + .windsurf/rules/ + .windsurf/skills/
|
|
140
|
-
unerr install gemini-cli # .gemini/settings.json + GEMINI.md + .gemini/skills/
|
|
141
|
-
unerr install github-copilot-cli # .copilot/mcp-config.json + .github/copilot-instructions.md + .github/skills/
|
|
154
|
+
unerr # first run: indexes the repo, starts the daemon; subsequent: resumes in <1s
|
|
142
155
|
```
|
|
143
156
|
|
|
144
|
-
|
|
157
|
+
**This is the part most people skip.** The `unerr --mcp` process your IDE spawns is just a **stdio bridge** — it owns nothing. All the intelligence (graph indexing, file watching, drift detection, fact storage, behavior automation) lives in the long-lived `unerr` daemon.
|
|
145
158
|
|
|
146
|
-
|
|
159
|
+
If the daemon isn't running, you still get tool responses, but they go stale: file edits won't show up in the graph, no incremental re-index, no live drift overlay, no convention auto-detection from new code. **Leave `unerr` running in a terminal tab or as a background service for the whole work session.** It uses ~80–200 MB and idles at near-zero CPU.
|
|
147
160
|
|
|
148
161
|
```bash
|
|
149
|
-
|
|
150
|
-
unerr
|
|
151
|
-
|
|
152
|
-
unerr install kiro # .kiro/mcp.json
|
|
153
|
-
unerr install codex # .codex/mcp.json + AGENTS.md
|
|
154
|
-
unerr install aider # .aider/mcp.json
|
|
155
|
-
unerr install opencode # .opencode/mcp.json
|
|
156
|
-
unerr install trae # .trae/mcp.json
|
|
157
|
-
unerr install augment # .augment/mcp.json
|
|
158
|
-
unerr install continue # .continue/config.json
|
|
162
|
+
# typical workflow
|
|
163
|
+
unerr & # start daemon in background (or run in a tmux/screen pane)
|
|
164
|
+
# now open Claude Code / Cursor / etc. — it auto-connects via MCP
|
|
159
165
|
```
|
|
160
166
|
|
|
161
|
-
|
|
167
|
+
After this, your agent connects automatically the next time you open the IDE. No config files to edit by hand.
|
|
162
168
|
|
|
163
169
|
<details>
|
|
164
|
-
<summary>Manual MCP config (any
|
|
170
|
+
<summary>Manual MCP config (any MCP-compatible client)</summary>
|
|
165
171
|
|
|
166
172
|
```json
|
|
167
173
|
{
|
|
@@ -178,45 +184,39 @@ unerr install continue # .continue/config.json
|
|
|
178
184
|
|
|
179
185
|
---
|
|
180
186
|
|
|
181
|
-
## What you
|
|
187
|
+
## What changes the moment you connect
|
|
182
188
|
|
|
183
|
-
###
|
|
189
|
+
### First session — instant value
|
|
184
190
|
|
|
185
|
-
- **Graph navigation** — `get_entity
|
|
186
|
-
- **Blast radius
|
|
187
|
-
- **
|
|
188
|
-
- **Shell compression** — 11 strategies, 645+ command classifiers. Diffs, errors, logs, test
|
|
189
|
-
- **
|
|
190
|
-
- **
|
|
191
|
-
- **Semantic search** — `semantic_search` finds conceptually similar code even with different naming. `find_similar` discovers related entities by embedding distance.
|
|
192
|
-
- **Business context** — `get_business_context` explains why code exists — purpose, feature area, taxonomy.
|
|
193
|
-
- **Tool adoption nudging** — 5-layer reinforcement system ensures agents consistently use unerr MCP tools over built-in alternatives. Exec nudges, hook interception, instruction-level enforcement, and skill reminders — all automatic, zero config.
|
|
191
|
+
- **Graph navigation in <5ms** — `get_entity`, `get_references`, `get_imports`, `search_code`. The agent stops reading 30 files to find one function.
|
|
192
|
+
- **Blast radius before edits** — `get_references` returns every caller. No more confident wrong changes that ripple across services.
|
|
193
|
+
- **Targeted file reads** — `file_read({entity: "fnName"})` returns just that function + relevant conventions/facts, not 2000 lines.
|
|
194
|
+
- **Shell compression** — 11 strategies, 645+ command classifiers. Diffs, errors, logs, test runs, YAML — each compressed differently. **93% average compression** across real-world benchmarks (2 MB → 138 KB). Raw output is kept on disk; the agent can recover it on demand.
|
|
195
|
+
- **Convention awareness** — naming, structure, import patterns auto-detected and injected into the agent's context.
|
|
196
|
+
- **Tool adoption nudging** — five reinforcement layers (exec nudges, hook interception, instruction injection, skill reminders, default-deny of built-ins on Claude Code) push the agent to use the graph instead of grep.
|
|
194
197
|
|
|
195
|
-
###
|
|
198
|
+
### Session 2+ — it starts compounding
|
|
196
199
|
|
|
197
|
-
- **Session persistence** —
|
|
198
|
-
- **Fact memory** — `record_fact` persists conventions, decisions, and anti-patterns
|
|
199
|
-
- **
|
|
200
|
-
- **
|
|
201
|
-
- **
|
|
202
|
-
- **Loop prevention** — circuit breaker fires after repeated failed attempts.
|
|
200
|
+
- **Session persistence** — what the agent learned today is available tomorrow. No more starting from zero.
|
|
201
|
+
- **Fact memory** — `record_fact` persists conventions, decisions, and anti-patterns; `recall_facts` retrieves them with decay-adjusted confidence. Facts also auto-detect from coding sessions.
|
|
202
|
+
- **Episodic narratives** — when you reopen a file, the agent sees what was modified there, when, and why.
|
|
203
|
+
- **Loop prevention** — a circuit breaker fires after repeated failed attempts on the same entity, surfacing the failure mode instead of letting the agent thrash.
|
|
204
|
+
- **Memory-effectiveness scoring** — every fact and convention opens a 5-turn observation window and resolves to a verdict (reinforced / acted_on / caught / ignored / corrected). The Reasoning Quality pane shows the **load-bearing rate** — not just how much the agent remembered, but how much of it actually mattered.
|
|
203
205
|
|
|
204
|
-
###
|
|
206
|
+
### Daemon mode — automated behaviors
|
|
205
207
|
|
|
206
|
-
When
|
|
208
|
+
When `unerr` is running long-lived, these activate in the background:
|
|
207
209
|
|
|
208
|
-
- **Architecture guard** — flags structural violations before they ship
|
|
209
|
-
- **Cascade guard** — warns when
|
|
210
|
-
- **Convention drift** — detects when new code diverges from established patterns
|
|
211
|
-
- **Auto-doc** — generates
|
|
212
|
-
- **Change narrative** — tracks the story behind multi-step refactors
|
|
213
|
-
- **Loop breaker** — intervenes when the agent is stuck
|
|
214
|
-
- **Session continuity** — preserves
|
|
210
|
+
- **Architecture guard** — flags structural violations before they ship.
|
|
211
|
+
- **Cascade guard** — warns when an edit has wide blast radius.
|
|
212
|
+
- **Convention drift** — detects when new code diverges from established patterns.
|
|
213
|
+
- **Auto-doc** — generates docs for undocumented entities.
|
|
214
|
+
- **Change narrative** — tracks the story behind multi-step refactors.
|
|
215
|
+
- **Loop breaker** — intervenes when the agent is stuck retrying.
|
|
216
|
+
- **Session continuity** — preserves state across restarts.
|
|
215
217
|
|
|
216
218
|
### Shell compression benchmarks
|
|
217
219
|
|
|
218
|
-
Every shell command the agent runs is classified (645+ command patterns + content heuristics) and compressed with the best-fit strategy:
|
|
219
|
-
|
|
220
220
|
| Strategy | What it compresses | Avg compression |
|
|
221
221
|
|----------|-------------------|:-:|
|
|
222
222
|
| **diff** | `git diff`, patch output | **99%** |
|
|
@@ -231,136 +231,106 @@ Every shell command the agent runs is classified (645+ command patterns + conten
|
|
|
231
231
|
| **yaml** | YAML configs, `kubectl get -o yaml`, Helm output | adaptive |
|
|
232
232
|
| **omni** | Fallback for unrecognized output | adaptive |
|
|
233
233
|
|
|
234
|
-
**Overall: 93% compression** (
|
|
234
|
+
**Overall: 93% compression** (2 MB → 138 KB across 40 real-world test cases).
|
|
235
235
|
|
|
236
236
|
### Language support
|
|
237
237
|
|
|
238
|
-
| Language | Tier |
|
|
238
|
+
| Language | Tier | Entities | Edges | Tree-sitter | SCIP |
|
|
239
239
|
|----------|:---:|:-:|:-:|:-:|:-:|
|
|
240
|
-
| TypeScript | 1 | ✓ | ✓ | ✓ | ✓ |
|
|
241
|
-
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
| Rust | 1 | ✓ | ✓ | ✓ | ✓ |
|
|
248
|
-
| Ruby | 1 | ✓ | ✓ | ✓ | ✓ |
|
|
249
|
-
| C | 1 | ✓ | ✓ | ✓ | ✓ |
|
|
250
|
-
| C++ | 1 | ✓ | ✓ | ✓ | ✓ |
|
|
251
|
-
| C# | 1 | ✓ | ✓ | ✓ | ✓ |
|
|
252
|
-
| PHP | 2 | ✓ | ✓ | ✓ | — |
|
|
253
|
-
| Swift | 2 | ✓ | ✓ | ✓ | — |
|
|
254
|
-
| Lua | 2 | ✓ | ✓ | ✓ | — |
|
|
255
|
-
| Dart | 2 | ✓ | ✓ | ✓ | — |
|
|
256
|
-
| Elixir | 2 | ✓ | ✓ | ✓ | — |
|
|
257
|
-
| Zig | 2 | ✓ | ✓ | ✓ | — |
|
|
258
|
-
|
|
259
|
-
**Tier 1** (13 languages): Full tree-sitter AST + dedicated extraction plugins + SCIP compiler-verified call graphs where available.
|
|
260
|
-
**Tier 2** (5 languages): Tree-sitter AST + generic extraction. Regex fallback for unsupported languages.
|
|
261
|
-
|
|
262
|
-
#### Tier 3: Discoverable (Search Only)
|
|
263
|
-
|
|
264
|
-
Tier 3 files are indexed for search discoverability — agents can find them via `search_code` using filename tokens and format-specific content extraction (headings, resource names, model definitions, etc.). No code entity extraction.
|
|
265
|
-
|
|
266
|
-
| Category | Extensions |
|
|
267
|
-
|----------|------------|
|
|
268
|
-
| Documentation | `.md`, `.mdx`, `.txt`, `.rst`, `.adoc`, `.org`, `.tex` |
|
|
269
|
-
| Declarative / IaC | `.tf`, `.tfvars`, `.hcl`, `.yaml`, `.yml`, `.toml`, `.json`, `.xml` |
|
|
270
|
-
| Schemas / IDL | `.proto`, `.graphql`, `.gql`, `.prisma`, `.avsc`, `.thrift`, `.smithy` |
|
|
271
|
-
| SQL | `.sql` |
|
|
272
|
-
| Shell | `.sh`, `.bash`, `.zsh` |
|
|
273
|
-
| Web / Templates | `.html`, `.css`, `.scss`, `.sass`, `.less`, `.vue`, `.svelte`, `.astro`, `.j2`, `.tmpl`, `.hbs`, `.ejs`, `.pug` |
|
|
274
|
-
| Build / Make | `.cmake`, `.bazel`, `.bzl`, `.mk`, `Makefile`, `Dockerfile`, `Jenkinsfile` |
|
|
275
|
-
| Config | `.ini`, `.cfg`, `.conf`, `.properties`, `.csv`, `.tsv`, `.editorconfig` |
|
|
276
|
-
| CI/CD | `.github/workflows/*.yml`, `.gitlab-ci.yml` |
|
|
240
|
+
| TypeScript / JavaScript / Python / Go / Java / Kotlin / Scala / Rust / Ruby / C / C++ / C# | 1 | ✓ | ✓ | ✓ | ✓ |
|
|
241
|
+
| PHP / Swift / Lua / Dart / Elixir / Zig | 2 | ✓ | ✓ | ✓ | — |
|
|
242
|
+
|
|
243
|
+
**Tier 1** (12 languages): full tree-sitter AST + dedicated extraction + SCIP compiler-verified call graphs where the toolchain is on PATH.
|
|
244
|
+
**Tier 2** (6 languages): tree-sitter AST + generic extraction. Regex fallback for the rest.
|
|
245
|
+
|
|
246
|
+
**Tier 3 (search-discoverable):** Markdown, IaC (`.tf`, `.yaml`, `.toml`), schemas (`.proto`, `.graphql`, `.prisma`), SQL, shell, templates, build files, CI configs — indexed for `search_code` only, no entity extraction.
|
|
277
247
|
|
|
278
248
|
---
|
|
279
249
|
|
|
280
250
|
## How it works
|
|
281
251
|
|
|
282
252
|
```
|
|
283
|
-
AI Agent (Claude Code / Cursor /
|
|
284
|
-
│
|
|
285
|
-
├── MCP tools ──→ unerr ──→ CozoDB graph (in-process, <5ms)
|
|
286
|
-
│ │
|
|
287
|
-
│ ├── Convention engine (auto-detects patterns)
|
|
288
|
-
│ ├── Fact store (cross-session memory)
|
|
289
|
-
│ ├── Shadow ledger (mark-working / revert / timeline)
|
|
290
|
-
│ ├── Token budgeter (prevents context rot)
|
|
291
|
-
│ └── Compression engine (11 strategies, 645+ classifiers)
|
|
253
|
+
AI Agent (Claude Code / Cursor / Windsurf / any MCP client)
|
|
292
254
|
│
|
|
293
|
-
├──
|
|
255
|
+
├── stdio MCP ──→ unerr --mcp (bridge, per IDE session)
|
|
256
|
+
│ │
|
|
257
|
+
│ └── UDS ──→ unerr (long-lived daemon, owns everything)
|
|
258
|
+
│ │
|
|
259
|
+
│ ├── CozoDB graph (in-process, <5ms)
|
|
260
|
+
│ ├── Fact store (cross-session memory)
|
|
261
|
+
│ ├── Timeline + ledger (every tool call)
|
|
262
|
+
│ ├── File watcher (incremental reindex)
|
|
263
|
+
│ ├── Convention engine
|
|
264
|
+
│ ├── Compression engine (11 strategies, 645+ classifiers)
|
|
265
|
+
│ └── Behavior modules (cascade-guard, loop-breaker, auto-doc…)
|
|
294
266
|
│
|
|
295
|
-
└──
|
|
267
|
+
└── Dashboard ──→ http://localhost:<port> (SSE-streamed live)
|
|
296
268
|
```
|
|
297
269
|
|
|
298
|
-
|
|
270
|
+
Two processes, one local DB. Zero network calls. No API keys. No cloud. Your code never leaves the machine.
|
|
299
271
|
|
|
300
272
|
---
|
|
301
273
|
|
|
302
274
|
## MCP Tools (20)
|
|
303
275
|
|
|
304
|
-
### Graph Intelligence (
|
|
276
|
+
### Graph Intelligence (8)
|
|
305
277
|
|
|
306
278
|
| Tool | What the agent gets |
|
|
307
279
|
|------|-----|
|
|
308
|
-
| `get_entity` | Any code entity
|
|
309
|
-
| `get_file` | All entities
|
|
310
|
-
| `get_references` |
|
|
311
|
-
| `get_imports` | Import
|
|
312
|
-
| `search_code` | Graph-ranked full-text search across all
|
|
313
|
-
| `
|
|
314
|
-
| `
|
|
315
|
-
| `
|
|
316
|
-
| `get_critical_nodes` | High fan-in/fan-out chokepoints (structural bottlenecks) |
|
|
317
|
-
| `get_cross_boundary_links` | Unexpected cross-module dependencies scored by surprise |
|
|
318
|
-
| `semantic_search` | Vector-based conceptual search (finds similar code with different names) |
|
|
319
|
-
| `find_similar` | Entities similar to a given entity by embedding distance |
|
|
320
|
-
| `get_project_stats` | Project-wide entity counts, risk distribution, health grade |
|
|
321
|
-
| `file_connections` | Connected files — imports, co-change correlations, structure |
|
|
322
|
-
| `get_test_coverage` | Direct and transitive test coverage for any entity |
|
|
280
|
+
| `get_entity` | Any code entity — signature, body, callers, callees, risk |
|
|
281
|
+
| `get_file` | All entities in a file with risk summary |
|
|
282
|
+
| `get_references` | Callers (blast radius) or callees (dependencies) |
|
|
283
|
+
| `get_imports` | Import graph for a file |
|
|
284
|
+
| `search_code` | Graph-ranked full-text search across all entities |
|
|
285
|
+
| `get_conventions` | Detected naming/structure/import patterns + adherence rates |
|
|
286
|
+
| `get_critical_nodes` | High fan-in/fan-out chokepoints |
|
|
287
|
+
| `get_cross_boundary_links` | Unexpected cross-module dependencies, scored by surprise |
|
|
323
288
|
|
|
324
|
-
###
|
|
289
|
+
### Structural Analysis (3)
|
|
325
290
|
|
|
326
291
|
| Tool | What the agent gets |
|
|
327
292
|
|------|-----|
|
|
328
|
-
| `
|
|
329
|
-
| `
|
|
293
|
+
| `get_project_stats` | Entity counts, risk distribution, health grade |
|
|
294
|
+
| `file_connections` | Imports + co-change correlations for a file |
|
|
295
|
+
| `get_test_coverage` | Direct + transitive tests for any entity |
|
|
330
296
|
|
|
331
|
-
###
|
|
297
|
+
### File Protocol (2)
|
|
332
298
|
|
|
333
299
|
| Tool | What the agent gets |
|
|
334
300
|
|------|-----|
|
|
335
|
-
| `
|
|
336
|
-
| `
|
|
301
|
+
| `file_read` | Context-aware read — auto-injects conventions and facts |
|
|
302
|
+
| `file_outline` | File structure (entities, exports) without reading the body |
|
|
337
303
|
|
|
338
|
-
###
|
|
304
|
+
### Persistent Memory (2)
|
|
339
305
|
|
|
340
306
|
| Tool | What the agent gets |
|
|
341
307
|
|------|-----|
|
|
342
|
-
| `
|
|
343
|
-
| `
|
|
344
|
-
|
|
308
|
+
| `record_fact` | Persist a convention, decision, or anti-pattern |
|
|
309
|
+
| `recall_facts` | Retrieve facts with hierarchical scope + decay-adjusted confidence |
|
|
310
|
+
|
|
311
|
+
### Session Narrative — Markers (4)
|
|
345
312
|
|
|
346
|
-
|
|
313
|
+
Inline markers the agent emits as it works. Persisted to the shadow ledger and `.unerr/timeline.db` — powers turn titles, cross-session intent stitching, the resume strip, and loop/blocker miners.
|
|
314
|
+
|
|
315
|
+
| Tool | What it does |
|
|
316
|
+
|------|-----|
|
|
317
|
+
| `mark_intent` | One-sentence task start (≤80 chars). Becomes the turn title |
|
|
318
|
+
| `mark_decision` | Records a chosen approach + up to 5 alternatives (≤140 chars) |
|
|
319
|
+
| `mark_blocker` | Flags an unresolved obstacle. Carries into the next session's resume strip |
|
|
320
|
+
| `mark_resolution` | Resolves a prior blocker by `marker_id` |
|
|
321
|
+
|
|
322
|
+
Every response includes `_meta` (latency, risk level, drift status) and inline `ur|<tag>` signals for high-priority guidance (drift, blast-radius warnings, circuit-breaker halts).
|
|
347
323
|
|
|
348
324
|
---
|
|
349
325
|
|
|
350
326
|
<details>
|
|
351
|
-
<summary><strong>
|
|
327
|
+
<summary><strong>CLI commands</strong></summary>
|
|
352
328
|
|
|
353
329
|
```bash
|
|
354
|
-
unerr # Start
|
|
355
|
-
unerr
|
|
356
|
-
unerr
|
|
357
|
-
unerr
|
|
358
|
-
unerr uninstall # Remove unerr integration from agents
|
|
359
|
-
unerr init # Initialize unerr in a new project
|
|
360
|
-
unerr timeline # What happened across sessions
|
|
361
|
-
unerr rewind # Restore to a previous working state
|
|
362
|
-
unerr learn # Teach unerr a convention or correction
|
|
363
|
-
unerr debug # Diagnostic dump
|
|
330
|
+
unerr # Start the long-lived daemon (or resume; auto-spawned by IDE if missing)
|
|
331
|
+
unerr --mcp # Stdio bridge — what your IDE invokes via .mcp.json
|
|
332
|
+
unerr install <agent> # Install MCP config + skills + instructions for one agent
|
|
333
|
+
unerr uninstall # Remove unerr integration from agents in this repo
|
|
364
334
|
```
|
|
365
335
|
|
|
366
336
|
</details>
|
|
@@ -370,30 +340,29 @@ unerr debug # Diagnostic dump
|
|
|
370
340
|
|
|
371
341
|
```
|
|
372
342
|
src/
|
|
373
|
-
entrypoints/
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
tracking/
|
|
377
|
-
behaviors/
|
|
378
|
-
commands/
|
|
379
|
-
tools/
|
|
380
|
-
hooks/
|
|
381
|
-
skills/
|
|
382
|
-
server/
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
schemas/ Zod schemas for entity/edge/rule types
|
|
386
|
-
utils/ Logging, detection, git helpers
|
|
343
|
+
entrypoints/ CLI entry + boot state machine
|
|
344
|
+
proxy/ MCP server (daemon), stdio↔UDS bridge, session stats, shell compression
|
|
345
|
+
intelligence/ CozoDB graph, AST extraction, conventions, rules, search, semantic
|
|
346
|
+
tracking/ Prompt ledger, drift detection, git attribution
|
|
347
|
+
behaviors/ Cascade guard, loop breaker, auto-doc, change narrative…
|
|
348
|
+
commands/ CLI commands (install, status, stats, timeline, learn, debug, …)
|
|
349
|
+
tools/ MCP tool implementations (intelligence + coding)
|
|
350
|
+
hooks/ Claude Code hook system integration
|
|
351
|
+
skills/ 11 bundled skill definitions
|
|
352
|
+
server/ + ui/ HTTP API + React (Vite) dashboard
|
|
353
|
+
config/ Agent registry (16 agents), MCP config writer, instruction injector
|
|
354
|
+
schemas/ Zod schemas
|
|
387
355
|
```
|
|
388
356
|
|
|
389
|
-
**Design principles
|
|
390
|
-
- Zero network calls — fully local, no API keys
|
|
391
|
-
- stdout is sacred — MCP JSON-RPC only, everything else to stderr
|
|
392
|
-
- <5ms query responses — CozoDB runs in-process (Rust via NAPI)
|
|
393
|
-
- 30s time-to-value — shallow index first, deep enrichment in background
|
|
394
|
-
- Enhancement, not dependency — agent falls back gracefully if unerr is unavailable
|
|
357
|
+
**Design principles**
|
|
395
358
|
|
|
396
|
-
|
|
359
|
+
- Zero network calls — fully local, no API keys.
|
|
360
|
+
- stdout is sacred — MCP JSON-RPC only; everything else to stderr.
|
|
361
|
+
- <5 ms query responses — CozoDB runs in-process (Rust via NAPI).
|
|
362
|
+
- First useful output <5 s — shallow index first, deep enrichment in background.
|
|
363
|
+
- Graceful degradation — the agent still works if unerr is down, you just lose the intelligence layer.
|
|
364
|
+
|
|
365
|
+
**Tech stack** TypeScript (ESM) · CozoDB (Rust/NAPI) · web-tree-sitter (WASM) · MCP SDK · Ink (React CLI) · React + Vite (dashboard) · tsup · Vitest
|
|
397
366
|
|
|
398
367
|
</details>
|
|
399
368
|
|
|
@@ -407,10 +376,8 @@ pnpm run dev # tsx watch
|
|
|
407
376
|
pnpm run test:run # full suite
|
|
408
377
|
pnpm run lint # biome check
|
|
409
378
|
pnpm run typecheck # tsc --noEmit
|
|
410
|
-
```
|
|
411
379
|
|
|
412
|
-
|
|
413
|
-
pnpm link --global # make `unerr` available globally
|
|
380
|
+
pnpm link --global # make local `unerr` available globally
|
|
414
381
|
```
|
|
415
382
|
|
|
416
383
|
</details>
|
|
@@ -418,15 +385,15 @@ pnpm link --global # make `unerr` available globally
|
|
|
418
385
|
<details>
|
|
419
386
|
<summary><strong>Contributing</strong></summary>
|
|
420
387
|
|
|
421
|
-
Contributions welcome
|
|
388
|
+
Contributions welcome — please open an issue first.
|
|
422
389
|
|
|
423
390
|
**Before submitting a PR:**
|
|
424
|
-
-
|
|
425
|
-
- All output
|
|
391
|
+
- `pnpm run typecheck && pnpm run lint && pnpm run test:run`
|
|
392
|
+
- All output to stderr — never stdout (MCP JSON-RPC channel)
|
|
426
393
|
- All CozoDB interactions are async — always `await`
|
|
427
394
|
- Use `.js` extensions in imports (NodeNext resolution)
|
|
428
395
|
|
|
429
|
-
See [CLAUDE.md](./CLAUDE.md) for
|
|
396
|
+
See [CLAUDE.md](./CLAUDE.md) for full conventions.
|
|
430
397
|
|
|
431
398
|
</details>
|
|
432
399
|
|
|
@@ -441,5 +408,5 @@ See [CLAUDE.md](./CLAUDE.md) for detailed conventions.
|
|
|
441
408
|
<p align="center">
|
|
442
409
|
<code>npm install -g @unerr-ai/unerr</code>
|
|
443
410
|
<br /><br />
|
|
444
|
-
<a href="https://www.npmjs.com/package/@unerr-ai/unerr"><sub>npm registry</sub></a> · <sub>
|
|
411
|
+
<a href="https://www.unerr.dev/"><sub>unerr.dev</sub></a> · <a href="https://www.npmjs.com/package/@unerr-ai/unerr"><sub>npm registry</sub></a> · <a href="https://discord.gg/2BjRftz8kG"><sub>Discord</sub></a> · <a href="https://x.com/unerr_ai"><sub>X</sub></a> · <a href="https://www.linkedin.com/company/unerr"><sub>LinkedIn</sub></a> · <sub>Fully local. No account. No cloud. Free.</sub>
|
|
445
412
|
</p>
|