devsmind-mcp 2.3.0 → 3.0.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/README.md +326 -234
- package/dist/cli/activity.d.ts +9 -0
- package/dist/cli/activity.js +69 -0
- package/dist/cli/activity.js.map +1 -0
- package/dist/cli/describe.d.ts +31 -0
- package/dist/cli/describe.js +201 -0
- package/dist/cli/describe.js.map +1 -0
- package/dist/cli/diff.d.ts +14 -0
- package/dist/cli/diff.js +161 -0
- package/dist/cli/diff.js.map +1 -0
- package/dist/cli/embed.d.ts +6 -0
- package/dist/cli/embed.js +109 -0
- package/dist/cli/embed.js.map +1 -0
- package/dist/cli/extract-agent.d.ts +66 -0
- package/dist/cli/extract-agent.js +192 -0
- package/dist/cli/extract-agent.js.map +1 -0
- package/dist/cli/feedback.d.ts +11 -0
- package/dist/cli/feedback.js +90 -0
- package/dist/cli/feedback.js.map +1 -0
- package/dist/cli/index.js +128 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.d.ts +30 -0
- package/dist/cli/init.js +98 -18
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/integrations/memory-topics.d.ts +44 -0
- package/dist/cli/integrations/memory-topics.js +295 -0
- package/dist/cli/integrations/memory-topics.js.map +1 -0
- package/dist/cli/integrations/memory.d.ts +11 -5
- package/dist/cli/integrations/memory.js +132 -36
- package/dist/cli/integrations/memory.js.map +1 -1
- package/dist/cli/integrations/prompt.d.ts +8 -0
- package/dist/cli/integrations/prompt.js +24 -3
- package/dist/cli/integrations/prompt.js.map +1 -1
- package/dist/cli/integrations/registry.d.ts +19 -5
- package/dist/cli/integrations/registry.js +23 -13
- package/dist/cli/integrations/registry.js.map +1 -1
- package/dist/cli/llm-client.d.ts +116 -0
- package/dist/cli/llm-client.js +322 -0
- package/dist/cli/llm-client.js.map +1 -0
- package/dist/cli/prune.js +4 -3
- package/dist/cli/prune.js.map +1 -1
- package/dist/cli/rule.d.ts +22 -2
- package/dist/cli/rule.js +116 -56
- package/dist/cli/rule.js.map +1 -1
- package/dist/cli/runner.d.ts +21 -0
- package/dist/cli/runner.js +94 -276
- package/dist/cli/runner.js.map +1 -1
- package/dist/cli/sync-progress.d.ts +9 -0
- package/dist/cli/sync-progress.js +41 -0
- package/dist/cli/sync-progress.js.map +1 -0
- package/dist/cli/sync.js +5 -2
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/view.js +3 -2
- package/dist/cli/view.js.map +1 -1
- package/dist/cli/workflow.js +26 -20
- package/dist/cli/workflow.js.map +1 -1
- package/dist/db/activity.d.ts +200 -0
- package/dist/db/activity.js +347 -0
- package/dist/db/activity.js.map +1 -0
- package/dist/db/analyze.js +25 -9
- package/dist/db/analyze.js.map +1 -1
- package/dist/db/database.d.ts +607 -79
- package/dist/db/database.js +1936 -488
- package/dist/db/database.js.map +1 -1
- package/dist/db/edges.d.ts +24 -0
- package/dist/db/edges.js +84 -0
- package/dist/db/edges.js.map +1 -1
- package/dist/db/embedder.d.ts +39 -0
- package/dist/db/embedder.js +0 -0
- package/dist/db/embedder.js.map +1 -0
- package/dist/db/feedback.d.ts +128 -0
- package/dist/db/feedback.js +182 -0
- package/dist/db/feedback.js.map +1 -0
- package/dist/db/file-diff.d.ts +32 -0
- package/dist/db/file-diff.js +110 -0
- package/dist/db/file-diff.js.map +1 -0
- package/dist/db/grep.d.ts +78 -0
- package/dist/db/grep.js +475 -0
- package/dist/db/grep.js.map +1 -0
- package/dist/db/message-revert.d.ts +63 -0
- package/dist/db/message-revert.js +258 -0
- package/dist/db/message-revert.js.map +1 -0
- package/dist/db/revert.d.ts +31 -0
- package/dist/db/revert.js +108 -0
- package/dist/db/revert.js.map +1 -0
- package/dist/db/schema.d.ts +49 -4
- package/dist/db/schema.js +125 -73
- package/dist/db/schema.js.map +1 -1
- package/dist/db/search-index.d.ts +65 -0
- package/dist/db/search-index.js +74 -0
- package/dist/db/search-index.js.map +1 -0
- package/dist/db/staging.d.ts +90 -5
- package/dist/db/staging.js +148 -22
- package/dist/db/staging.js.map +1 -1
- package/dist/mcp/server.d.ts +29 -7
- package/dist/mcp/server.js +2755 -745
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/vendor/3d-force-graph.min.js +5 -0
- package/dist/mcp/vendor/force-graph.min.js +5 -0
- package/dist/mcp/vendor/model/model_int8.onnx +0 -0
- package/dist/mcp/vendor/model/vocab.txt +30522 -0
- package/dist/mcp/vendor/three.min.js +7 -0
- package/dist/mcp/view.css +419 -0
- package/dist/mcp/view.html +161 -0
- package/dist/mcp/view.js +245 -0
- package/dist/mcp/view_chat.js +382 -0
- package/dist/mcp/view_graph.js +576 -0
- package/dist/mcp/visualizer.d.ts +25 -2
- package/dist/mcp/visualizer.js +31 -4
- package/dist/mcp/visualizer.js.map +1 -1
- package/dist/utils/ast.d.ts +187 -0
- package/dist/utils/ast.js +640 -20
- package/dist/utils/ast.js.map +1 -1
- package/dist/utils/diff.d.ts +44 -0
- package/dist/utils/diff.js +78 -0
- package/dist/utils/diff.js.map +1 -0
- package/dist/utils/edit.d.ts +47 -0
- package/dist/utils/edit.js +196 -0
- package/dist/utils/edit.js.map +1 -0
- package/dist/utils/scanner.js +12 -4
- package/dist/utils/scanner.js.map +1 -1
- package/dist/utils/tokenize.d.ts +45 -0
- package/dist/utils/tokenize.js +129 -0
- package/dist/utils/tokenize.js.map +1 -0
- package/dist/utils/version.d.ts +14 -0
- package/dist/utils/version.js +61 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +18 -5
- package/dist/mcp/visualizer_2d.html +0 -635
- package/dist/mcp/visualizer_3d.html +0 -613
package/README.md
CHANGED
|
@@ -1,234 +1,326 @@
|
|
|
1
|
-
# 🧠 DevsMind — Team AI Brain
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/devsmind-mcp)
|
|
4
|
-
[](https://github.com/Abialidr/devsmind/blob/main/LICENSE)
|
|
5
|
-
|
|
6
|
-
> **The evolutionary collective memory layer for your AI coding agents. Shared across your entire team.**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
│
|
|
17
|
-
│
|
|
18
|
-
│
|
|
19
|
-
│
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
├──
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
##
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
devsmind
|
|
100
|
-
devsmind
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
devsmind
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
>
|
|
145
|
-
>
|
|
146
|
-
> **
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
##
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
|
155
|
-
|
|
156
|
-
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
1
|
+
# 🧠 DevsMind — Team AI Brain
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/devsmind-mcp)
|
|
4
|
+
[](https://github.com/Abialidr/devsmind/blob/main/LICENSE)
|
|
5
|
+
|
|
6
|
+
> **The evolutionary collective memory layer for your AI coding agents. Shared across your entire team.**
|
|
7
|
+
>
|
|
8
|
+
> **TypeScript / JavaScript projects only, for now.** The core write path (`edit_node`) relies on parsing your code — that's currently TS/JS only. Other languages are on the roadmap, not yet supported.
|
|
9
|
+
|
|
10
|
+
AI agents (like Cursor, Cline, Copilot, or Antigravity) lose all context between sessions. Teams repeat the same conversations, new developers ask questions answered months ago, and the same bug gets fixed twice because nobody remembered the first fix.
|
|
11
|
+
|
|
12
|
+
Git tells you **WHAT** changed. **DevsMind tells your AI agent WHY it changed, WHO decided it, WHAT requirement it served, and WHAT broke before.**
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
┌──────────────────────────────────────────────┐
|
|
16
|
+
│ DevsMind MCP Server │
|
|
17
|
+
│ (installed once globally on machine) │
|
|
18
|
+
│ │
|
|
19
|
+
│ Stateless. Holds no data. │
|
|
20
|
+
│ `devsmind start` binds it to ONE project │
|
|
21
|
+
│ (--path, or auto-detected from cwd), so │
|
|
22
|
+
│ the agent never passes a path at all. │
|
|
23
|
+
└──────────────────────┬───────────────────────┘
|
|
24
|
+
│ one bound server per project
|
|
25
|
+
┌─────────────────┴─────────────────┐
|
|
26
|
+
▼ ▼
|
|
27
|
+
c:\work\my-project\.devmind\ c:\work\other-project\.devmind\
|
|
28
|
+
brain.db brain.db
|
|
29
|
+
(Project A team brain) (Project B team brain)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
> 📖 Looking for the exhaustive version (every flag, every schema field)? See [detailExplanation.md](detailExplanation.md). This file is the fast path.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## How it works
|
|
37
|
+
|
|
38
|
+
Run `devsmind init` once per project → creates `.devmind/`. Commit it. Every teammate's agent reads and writes the same graph.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 🛠️ Architecture: The `.devmind/` Directory
|
|
43
|
+
|
|
44
|
+
Running `devsmind init` creates a `.devmind/` directory in your workspace. This folder contains the configuration, distributed graph database, and local cache:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
.devmind/
|
|
48
|
+
├── .gitignore ← Written by init; ignores everything marked LOCAL below
|
|
49
|
+
├── config.json ← Project metadata & repository mapping (COMMITTED)
|
|
50
|
+
├── graph/ ← Distributed graph structure JSON (COMMITTED)
|
|
51
|
+
│ └── [repo_name]/[path].json
|
|
52
|
+
├── history/ ← Change logs, code snapshots, reasoning (COMMITTED)
|
|
53
|
+
│ └── [id].json
|
|
54
|
+
├── vectors/ ← Semantic embeddings from `devsmind embed` (COMMITTED)
|
|
55
|
+
├── workflows/ ← Feature timelines: steps + reasoning (COMMITTED)
|
|
56
|
+
│ └── [id]/workflow.json + v2.json
|
|
57
|
+
├── .env ← This machine's developer name + repo paths (LOCAL)
|
|
58
|
+
├── brain.db ← SQLite cache, rebuilt from the JSON above (LOCAL)
|
|
59
|
+
├── index_scratchpad.json ← In-progress index, resumable across restarts (LOCAL)
|
|
60
|
+
├── history_scratchpad.json ← Staged-but-uncommitted edits (LOCAL)
|
|
61
|
+
└── local/ ← Activity log + feedback: YOUR requests, YOUR (LOCAL)
|
|
62
|
+
├── sessions.json reverts. Never pushed, never a teammate's.
|
|
63
|
+
├── messages/[id].json
|
|
64
|
+
└── feedback*.jsonl
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**COMMITTED vs LOCAL is the whole storage design.** Committed is the *team's* shared brain — graph, reasoning, feature timelines. Local is either derivable (`brain.db` is a cache; delete it and `devsmind sync` rebuilds it) or genuinely personal (`local/` holds your verbatim requests and revert backups, which only mean anything on the machine that wrote them).
|
|
68
|
+
|
|
69
|
+
### Flexibility: Where should the brain live?
|
|
70
|
+
|
|
71
|
+
DevsMind supports two deployment topologies depending on your team's workflow:
|
|
72
|
+
|
|
73
|
+
* **Option A: Inside the workspace/project root directory (Shared with team)**
|
|
74
|
+
```
|
|
75
|
+
c:\work\my-project\
|
|
76
|
+
├── .devmind\ ← Config and distributed JSON database live here
|
|
77
|
+
├── backend-service\
|
|
78
|
+
└── frontend-web\
|
|
79
|
+
```
|
|
80
|
+
* **Option B: Standalone folder (Fully separated)**
|
|
81
|
+
```
|
|
82
|
+
c:\Users\username\brains\my-project\
|
|
83
|
+
└── .devmind\ ← Brain is kept separate from code folders
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 🚀 Why teams use it
|
|
89
|
+
|
|
90
|
+
| Feature | What it means |
|
|
91
|
+
|---|---|
|
|
92
|
+
| **Function-level history** | Every function/class has a change log — not just diffs, but *why* |
|
|
93
|
+
| **Workflows: how a feature grew** | A named, git-shared log of one feature across many nodes and many days. An agent resuming a week later reads how the code got this way instead of starting from zero. Each step carries the reasoning and the nodes it touched — and a step can be pure **research** ("evaluated Razorpay, no split settlements → Stripe"), which is the one thing nothing else keeps: git has the diff, history has the per-node why, neither records what you rejected. Reference docs attach as repo **paths**, not copies, so they can't go stale. Binding is per session, so two people never fight over one pointer |
|
|
94
|
+
| **AI-written context** | Your agent records why/goal/decision/ticket once per commit — covers everything staged since the last one |
|
|
95
|
+
| **Token-cheap lookups** | Agent reads one function via the graph instead of a whole file — up to ~70% fewer tokens |
|
|
96
|
+
| **One server, one project** | Install once globally, then `devsmind start` binds to the project it was launched in (or `--path`). The agent never discovers, remembers, or sends a brain path — it's resolved once at startup and dropped from every tool's schema. Run one per project |
|
|
97
|
+
| **Git-native sharing** | The graph is JSON + SQLite cache, committed like code |
|
|
98
|
+
| **See it and undo it** | `edit_node` replaces your agent's edit tool — so it gives back what one gives you: `devsmind view` shows a red/green diff of every change with the *why* attached, and reverts it in a click |
|
|
99
|
+
| **Chat: your work, by day** | `devsmind view` → Chat: a chat-bubble timeline of your requests, local-only, with git-style whole-file diffs. Revert a whole request (with a backup, un-revertable) — not just one function |
|
|
100
|
+
| **Graph, made findable** | `devsmind view` → Graph: a repo/type sidebar and filters instead of a wall of nodes — click one to see just its uses/used-by, 2D or 3D, no CDN required (works offline) |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## ⚡ Quick Start
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm install -g devsmind-mcp
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Starting a brand-new brain
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
devsmind init # 1. Create .devmind/ — interactive: project name, repos, tech stack
|
|
114
|
+
devsmind mcp # 2. Connect your IDE/CLI to the MCP server
|
|
115
|
+
devsmind rule # 3. Paste the workspace rule — this is what teaches your agent to actually use it
|
|
116
|
+
devsmind memory # 4. Seed your tool's OWN memory store, so the rule survives a long session
|
|
117
|
+
devsmind start # 5. Start the server (skip if your IDE launches it via stdio)
|
|
118
|
+
devsmind index --run --provider gemini --key YOUR_KEY # 6. (optional) index the codebase now
|
|
119
|
+
git add .devmind && git commit -m "Add DevsMind brain" # 7. share it
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
> **Step 4 is the one people skip and then wonder why the agent drifts.** A pasted rule is a file *you* maintain; several tools also have their own persistent memory the agent reads back automatically, every session, without anyone re-pasting anything. Where DevsMind can safely write to that store it does — Claude Code (Auto Memory) and Antigravity (Skills) today. For every other tool it prints why it isn't safe and what to do instead, rather than writing something that silently gets overwritten. `--print` shows exactly what it would write without touching anything.
|
|
123
|
+
|
|
124
|
+
### Joining a brain a teammate already created
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
git pull # 1. .devmind/ is already in the repo
|
|
128
|
+
devsmind init # 2. sets up YOUR machine only (dev identity, local paths) — doesn't touch the shared graph
|
|
129
|
+
devsmind mcp # 3. connect your IDE/CLI
|
|
130
|
+
devsmind rule # 4. paste the workspace rule
|
|
131
|
+
devsmind memory # 5. seed your tool's own memory store (see above)
|
|
132
|
+
devsmind sync # 6. load teammates' committed changes into your local cache
|
|
133
|
+
devsmind start # 7. start the server (skip if stdio)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
> `mcp`, `rule` and `memory` are all **per-machine, per-tool** — they configure your editor, not the shared brain. A teammate's setup never reaches you, so each of you runs these once.
|
|
137
|
+
|
|
138
|
+
> **Already set up, just upgrading?**
|
|
139
|
+
> ```bash
|
|
140
|
+
> npm install -g devsmind-mcp@latest
|
|
141
|
+
> devsmind rule # re-paste — the generated rule changes between releases
|
|
142
|
+
> devsmind memory # re-seed — same reason, and it goes stale the same way
|
|
143
|
+
> ```
|
|
144
|
+
> Both, not just the rule. They carry the same contract into two different places, so upgrading one and not the other leaves your agent half-informed.
|
|
145
|
+
>
|
|
146
|
+
> **This matters more for 3.0.0 than for any release before it**, because 3.0.0 *removed* tools rather than adding them. A rule or memory file written against 2.x tells your agent to call `workflow_pause`, `get_node_graph`, `search_decisions` and `search_nodes`' `keywords` — none of which exist now. It won't fail loudly; the agent will just waste turns on tools that aren't there. Check the [Changelog](CHANGELOG.md) after any upgrade — some releases need this re-run, some don't.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 🔌 The three setup commands, and why there are three
|
|
151
|
+
|
|
152
|
+
| Command | Answers | Skip it and… |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| `devsmind mcp` | Can your agent *reach* the tools at all? | DevsMind tools don't exist from the agent's point of view |
|
|
155
|
+
| `devsmind rule` | Does your agent *know* to use them? | Agent defaults back to grep/raw file reads out of habit |
|
|
156
|
+
| `devsmind memory` *(optional)* | Does that behavior *persist* without re-pasting? | Only matters for a handful of tools with their own agent-writable memory store |
|
|
157
|
+
|
|
158
|
+
`mcp`, `rule` and `memory` are all guided: pick your tool (Cursor, VS Code, Claude Code, Codex, Windsurf, Kiro, Antigravity, Qwen Code, …), then either copy a printed snippet or let DevsMind write/merge the config file for you. `devsmind rule` also asks which **workflow style** you want — **Automatic** (default: the agent stages, commits, and tracks every edit without being asked) or **Manual** (search/read stays always-on, but the agent only stages/commits when you explicitly ask it to — you stay the one deciding what reaches the graph). Either way it also prints a short **session kickoff prompt** to paste at the start of a fresh chat.
|
|
159
|
+
|
|
160
|
+
> ### 🧪 Which tools are actually *verified* — and where you can help
|
|
161
|
+
>
|
|
162
|
+
> DevsMind has been **used and tested day-to-day in Antigravity and Claude Code**. Those two are the ones we can vouch for from real use.
|
|
163
|
+
>
|
|
164
|
+
> The other seven are built from each tool's documented config format, and automated tests confirm DevsMind writes a **well-formed** config for every one of them — the right file, the right shape, merged without clobbering anything you already had. What those tests *cannot* prove is the part that matters most: that the tool then reads it, and that the agent behaves differently afterwards. Nobody has sat in Cursor or Windsurf or Codex with this and watched what the agent actually does.
|
|
165
|
+
>
|
|
166
|
+
> **So if you use one of the unverified tools, your report is genuinely valuable** — more than a bug report, because right now there's simply no data. Useful things to check:
|
|
167
|
+
> - Did `devsmind mcp` land the server where your tool looks, and did the tool connect?
|
|
168
|
+
> - After `devsmind rule`, does the agent actually reach for `search_nodes` before grepping — and does it still, 40 turns in?
|
|
169
|
+
> - Does `commit_changes` get called on its own, or only when you ask?
|
|
170
|
+
> - How does the agent handle a tool it doesn't understand — recover, or spiral?
|
|
171
|
+
>
|
|
172
|
+
> Benchmarks against a raw agent on the same task are especially welcome. [Open an issue](https://github.com/Abialidr/devsmind-mcp/issues) with your tool, version, and what you saw — including "it just worked," which is a result too.
|
|
173
|
+
|
|
174
|
+
**`devsmind memory`** only writes where it's actually confirmed safe:
|
|
175
|
+
|
|
176
|
+
| Tool | Seeded automatically? |
|
|
177
|
+
|---|---|
|
|
178
|
+
| Claude Code (Auto Memory) | ✅ |
|
|
179
|
+
| Google Antigravity (Skills / `/learn`) | ✅ |
|
|
180
|
+
| Qwen Code CLI | Already covered by `devsmind rule` |
|
|
181
|
+
| Codex CLI, Cursor, Windsurf, Kiro, VS Code Copilot | ❌ — prints why + what to do instead |
|
|
182
|
+
|
|
183
|
+
> ⚠️ **The rule is a nudge, not a guarantee.** On long sessions agents drift back to grep and raw file reads, and quietly stop calling `search_nodes` / `commit_changes`.
|
|
184
|
+
>
|
|
185
|
+
> When you notice, just say it: *"use the DevsMind graph, then stage and commit this."* One sentence, and it's usually the highest-leverage thing you can type.
|
|
186
|
+
>
|
|
187
|
+
> **Worth saying because a skipped commit can't be backfilled.** The *code* graph is repairable after the fact — see below. The **reasoning** isn't: why a change was made, what it was weighed against, what broke before. That exists only in that conversation, in that turn. No reindex, no git log, no analyze recovers it.
|
|
188
|
+
|
|
189
|
+
> 🔧 **The graph won't be 100% right — that's expected, and fixable.**
|
|
190
|
+
>
|
|
191
|
+
> Node extraction is a judgment call, so some nodes come out too coarse, mislabeled, or missing an edge no parser could prove (dynamic dispatch, generated bindings). DevsMind is built to be corrected rather than re-indexed:
|
|
192
|
+
>
|
|
193
|
+
> - `devsmind analyze --fix` — free local health check. Finds god entities, cycles, orphans, dangling edges, duplicates; auto-applies only the safe fixes.
|
|
194
|
+
> - Ask your agent to fix what it hits: `record_alias` (same symbol, another name), `link_nodes` (a real edge the AST missed), `merge_nodes` / `split_node`, `create_missing_node`.
|
|
195
|
+
> - Every `commit_changes` also **reports** problems it noticed into `.devmind/local/feedback_graph.jsonl`. Read them back with `devsmind feedback`, or have an agent drain the queue: `read_graph_feedback` → verify → fix → `mark_graph_feedback_processed`.
|
|
196
|
+
>
|
|
197
|
+
> Nothing here needs an API key, and none of it is auto-applied behind your back.
|
|
198
|
+
|
|
199
|
+
> 💛 **And there's feedback about DevsMind itself — please share it.**
|
|
200
|
+
>
|
|
201
|
+
> The same `commit_changes` call asks your agent three questions that aren't about your graph at all: which tools actually helped, what it reached for *instead* of a DevsMind tool and why, and one concrete thing that would have made the task easier. Those land in `.devmind/local/feedback_product.jsonl`.
|
|
202
|
+
>
|
|
203
|
+
> It's **gitignored and never uploaded** — DevsMind has no telemetry, so unless you send it, nobody sees it. But it's the most useful bug report there is: a log of where a real agent, on real code, gave up on a DevsMind tool and did it the old way. Run `devsmind feedback`, and if anything in there looks like a pattern, [open an issue](https://github.com/Abialidr/devsmind-mcp/issues) with it. That's how this gets better.
|
|
204
|
+
|
|
205
|
+
**Paste this at the start of every session**, no matter which workflow style your project uses — the strictest, shortest version of the nudge above:
|
|
206
|
+
|
|
207
|
+
> Before doing anything else: fully read and follow this project's DevsMind rule — no exceptions, no shortcuts, not even for a small edit.
|
|
208
|
+
> Call `start_session` before your first write and carry its `session_id` on every DevsMind write this conversation, or nothing gets recorded.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## 📇 Indexing your codebase: `index` vs `reindex`
|
|
213
|
+
|
|
214
|
+
Both extract code entities via an LLM, then resolve connections locally (free, no LLM). You don't strictly need either — the graph also grows "as you go" from your agent's own edits — but until something has indexed the codebase, there's little for the agent to look up yet.
|
|
215
|
+
|
|
216
|
+
| | `index --run` | `reindex` |
|
|
217
|
+
|---|---|---|
|
|
218
|
+
| Use for | First full pass | Keeping an already-indexed graph in sync |
|
|
219
|
+
| Flag required | `--run` | none — always executes |
|
|
220
|
+
| Selection | Whole repo (or `--nodes-only` / `--edges-only` / `--repos`) | Diffs mtimes since last run, or `--fill-gaps` to backfill zero-node files |
|
|
221
|
+
| Destructive option | `--from-scratch` wipes everything first | — |
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
devsmind index --run --provider gemini --key YOUR_KEY
|
|
225
|
+
devsmind reindex --provider gemini --key YOUR_KEY --fill-gaps
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**The LLM never has to *find* your code.** The AST enumerates every declaration; anything **exported** becomes a node with zero LLM calls. Only genuinely ambiguous leftovers — an unexported helper, an anonymous default, a small inline callback — go to an agent that decides keep / drop / merge / rename, and if it can't decide in time it keeps them. The old approach shipped the whole file to a model and asked it to "extract all code structures", which meant a function it happened to overlook just never got indexed, silently. Cheaper *and* harder to miss things.
|
|
229
|
+
|
|
230
|
+
**Common flags** (both commands): `--provider gemini|vertex|ollama` · `--model <name>` · `--key <api_key>` · `--rpm <number>` (unthrottled by default).
|
|
231
|
+
|
|
232
|
+
> `--chunk-size` / `--chunk-overlap` / `--local-edges` are still accepted but do **nothing** — extraction is per-candidate (AST-enumerated) rather than whole-file-to-an-LLM, so chunking no longer applies, and edges have been local-only for a while. Passing one prints a warning rather than failing, so an old shell script keeps working.
|
|
233
|
+
|
|
234
|
+
### The third phase: descriptions
|
|
235
|
+
|
|
236
|
+
Indexing runs in **three** phases, and the third is the one that decides whether search actually works:
|
|
237
|
+
|
|
238
|
+
| Phase | What | Cost |
|
|
239
|
+
|---|---|---|
|
|
240
|
+
| 1 | Extract nodes + code snapshots | LLM (only for *ambiguous* symbols — exported ones auto-accept for free) |
|
|
241
|
+
| 2 | Resolve connections | **Free** — local AST, never an LLM |
|
|
242
|
+
| 3 | Write a natural-language `description` per node | LLM, same credentials as Phase 1 |
|
|
243
|
+
|
|
244
|
+
Phases 1 and 2 never write a description. That matters because `search_nodes` weights `description` in its BM25 ranking and embeds it for the semantic layer — so an index that "finished" without Phase 3 can only be searched by identifier, path, and grep. Natural-language queries find nothing.
|
|
245
|
+
|
|
246
|
+
So **Phase 3 is mandatory on a full run** and happens automatically; `--describe` has no effect there. It's opt-in only on `--nodes-only` (which exists precisely to be a fast, structure-only pass), and rejected outright with `--edges-only`, which resolves no credentials and creates no nodes.
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
devsmind describe --provider gemini --key YOUR_KEY # backfill a pre-existing description gap
|
|
250
|
+
devsmind embed # then vectors — fully local, no API key
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
`describe` is for nodes that predate the requirement; anything created from now on gets described at `commit_changes`, which refuses a new node without one. `embed` turns those descriptions into vectors on-device (ONNX, `all-MiniLM-L6-v2`) — no credentials, no network. Both are idempotent: the work queue is just "what's still missing", so re-running is safe and a second run is a no-op.
|
|
254
|
+
|
|
255
|
+
**Providers:**
|
|
256
|
+
|
|
257
|
+
| Provider | Auth | Notes |
|
|
258
|
+
|---|---|---|
|
|
259
|
+
| `gemini` (default) | `--key` or `GEMINI_API_KEY` | fastest, most accurate in testing |
|
|
260
|
+
| `vertex` | service account JSON or bearer token | for teams already on GCP |
|
|
261
|
+
| `ollama` | none — local server | free, private, slower and less accurate |
|
|
262
|
+
|
|
263
|
+
Rough benchmark (~1,080-file repo, informal): local Ollama model took ~15h at ~50% accuracy; `gemini-2.5-flash` took ~5h at ~90%. Local avoids API cost; cloud is faster and more accurate for extraction. Edge resolution is local/free either way.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 🖥️ Other commands (cheat sheet)
|
|
268
|
+
|
|
269
|
+
| Command | What it does |
|
|
270
|
+
|---|---|
|
|
271
|
+
| `devsmind start [--stdio] [-p <port>]` | Run the MCP server |
|
|
272
|
+
| `devsmind sync [--analyze] [--fix]` | Pull committed graph changes into your local cache |
|
|
273
|
+
| `devsmind describe [--provider …] [--key …] [--dry-run]` | Backfill natural-language descriptions for nodes that have none — what `search_nodes` needs to match a plain-English query. `--dry-run` lists the backlog without an API key. Safe to re-run |
|
|
274
|
+
| `devsmind embed [--force] [--dry-run]` | Turn those descriptions into semantic vectors, **fully local** — on-device ONNX, no credentials, no network. `--force` re-embeds everything after a model upgrade. Safe to re-run |
|
|
275
|
+
| `devsmind feedback [--since <days>] [--all]` | Read what your agent reported via `commit_changes` — graph problems, product feedback, indexer-rule candidates. Local, never pushed |
|
|
276
|
+
| `devsmind view` | Open the DevsMind app — Chat (your work by day, whole-file diffs, revert a whole request with a backup) and Graph (click a node for its change history and a revert button; ego-graph, filters, works offline) |
|
|
277
|
+
| `devsmind activity [--since <days>]` | Your local activity timeline in the terminal (read-only — revert stays on the page) |
|
|
278
|
+
| `devsmind diff <node_id>` | Red/green of what the agent changed in one function/class, with the reasoning it recorded |
|
|
279
|
+
| `devsmind revert <node_id>` | Undo that entity's most recent recorded edit, and erase it from history — permanent, single-entity. See Activity for a reversible, whole-request revert |
|
|
280
|
+
| `devsmind analyze [--fix]` | Zero-AI local health check (god entities, cycles, orphans, dangling edges, dupes, stale attribution…) — `--fix` auto-applies only the safe/reversible fixes |
|
|
281
|
+
| `devsmind prune` | Interactive review + permanent delete of nodes/history |
|
|
282
|
+
| `devsmind workflow` | Interactive view of multi-day feature workflows |
|
|
283
|
+
| `devsmind workflow-import <path>` | Import existing flow docs as resumable workflows |
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## 🔌 MCP tools, grouped by purpose
|
|
288
|
+
|
|
289
|
+
DevsMind exposes 35 tools to the agent. The ones you'll see referenced most:
|
|
290
|
+
|
|
291
|
+
| Group | Tools |
|
|
292
|
+
|---|---|
|
|
293
|
+
| **Session (call before your first write)** | `start_session` — mints a `session_id`. Every **write** requires it; read-only tools don't, so an agent can search from its very first call. Every response echoes the id back so it survives a long or compacted conversation |
|
|
294
|
+
| **Search/discovery** | `search_nodes` — one call covering the graph **and** a real grep of every repo; takes a natural-language `query` and/or `pattern` (a real regex, used exactly as you'd give grep). `list_nodes` enumerates a component or directory, paged |
|
|
295
|
+
| **Read code/history** | `get_node_code` — the one node-read call. Code, metadata, imports, named callers **and** callees, a file outline, and recent reasoning, all included by default; `graph_depth`/`graph_direction` walk further for a blast radius or a whole call flow, and `history:"full"` returns every revision with diffs. `get_activity_log` answers "what changed recently / which files did we touch" |
|
|
296
|
+
| **Write (the important one)** | `edit_node` — edits any file, traces what changed, and **returns the red/green diff of what it changed** so you see it in the session — all in one call. `stage_change` covers what it can't (non-TS/JS languages). `commit_changes` flushes everything staged and takes the one `reasoning` (why/goal) that gets recorded against all of it. |
|
|
297
|
+
| **Maintenance** | `analyze_graph` (zero-token health check), `recheck_graph`, `rename_node`/`deprecate_node`, and the feedback loop: `read_graph_feedback` → fix → `mark_graph_feedback_processed` |
|
|
298
|
+
| **Multi-day workflows** | `workflow_create`, `workflow_bind` (per session, local to you), `workflow_list`, `workflow_get_context`, `workflow_add_step`, `workflow_sync`, `workflow_archive`, `workflow_import` |
|
|
299
|
+
|
|
300
|
+
Full descriptions and token-cost notes: see [detailExplanation.md § MCP Tool Reference](detailExplanation.md#-mcp-tool-reference).
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## 🗄️ Storage model, briefly
|
|
305
|
+
|
|
306
|
+
The layout is up top under [Architecture](#-architecture-the-devmind-directory). What matters about it:
|
|
307
|
+
|
|
308
|
+
**The JSON is the source of truth, not the database.** `graph/`, `history/`, `vectors/` and `workflows/` are line-oriented JSON — git-mergeable, reviewable in a PR. `brain.db` is a disposable local cache rebuilt from them by `devsmind sync` or on server start, which is why it's gitignored: sharing a SQLite binary would conflict on every merge.
|
|
309
|
+
|
|
310
|
+
**`local/` is the one thing nothing can regenerate.** Your requests, revert backups and feedback exist only there, on your machine, by design.
|
|
311
|
+
|
|
312
|
+
**`devsmind init` writes `.devmind/.gitignore`** covering every LOCAL entry and repairs it on each re-run, so a brain from an older version can't leave something exposed. It appends rather than rewrites, so lines you added yourself survive.
|
|
313
|
+
|
|
314
|
+
`brain.db` has 9 tables — 7 documented in [detailExplanation.md § Database Schema](detailExplanation.md#-database-schema-devmindbraindb), plus `node_tokens` and `node_vectors`, which are derived search indexes rebuilt from the nodes themselves.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## Changelog
|
|
319
|
+
|
|
320
|
+
See [CHANGELOG.md](CHANGELOG.md) for what shipped in each release.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## 📄 License
|
|
325
|
+
|
|
326
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `devsmind activity` — the local, gitignored timeline in the terminal: read-only, same store
|
|
3
|
+
* `devsmind view` → Activity reads. Revert/un-revert stays on the page, where the diff and the
|
|
4
|
+
* confirmation live together; this is for a quick "what did I do" check without a browser.
|
|
5
|
+
*/
|
|
6
|
+
export declare function handleActivity(opts: {
|
|
7
|
+
path?: string;
|
|
8
|
+
since?: string;
|
|
9
|
+
}): Promise<void>;
|