devsmind-mcp 2.1.1 ā 2.2.2
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 +189 -28
- package/dist/cli/index.js +52 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.js +48 -56
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/integrations/mcp.d.ts +8 -0
- package/dist/cli/integrations/mcp.js +164 -0
- package/dist/cli/integrations/mcp.js.map +1 -0
- package/dist/cli/integrations/memory.d.ts +11 -0
- package/dist/cli/integrations/memory.js +151 -0
- package/dist/cli/integrations/memory.js.map +1 -0
- package/dist/cli/integrations/prompt.d.ts +54 -0
- package/dist/cli/integrations/prompt.js +360 -0
- package/dist/cli/integrations/prompt.js.map +1 -0
- package/dist/cli/integrations/registry.d.ts +102 -0
- package/dist/cli/integrations/registry.js +330 -0
- package/dist/cli/integrations/registry.js.map +1 -0
- package/dist/cli/rule.d.ts +14 -1
- package/dist/cli/rule.js +119 -57
- package/dist/cli/rule.js.map +1 -1
- package/dist/cli/sync.d.ts +13 -0
- package/dist/cli/sync.js +119 -0
- package/dist/cli/sync.js.map +1 -0
- package/dist/db/database.d.ts +21 -1
- package/dist/db/database.js +35 -2
- package/dist/db/database.js.map +1 -1
- package/dist/mcp/server.d.ts +9 -0
- package/dist/mcp/server.js +57 -25
- package/dist/mcp/server.js.map +1 -1
- package/dist/utils/config.d.ts +11 -0
- package/dist/utils/config.js +31 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/scanner.d.ts +7 -0
- package/dist/utils/scanner.js +9 -3
- package/dist/utils/scanner.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,23 +77,150 @@ DevsMind supports two deployment topologies depending on your team's workflow:
|
|
|
77
77
|
|
|
78
78
|
## ā” Quick Start
|
|
79
79
|
|
|
80
|
+
DevsMind is installed **once per machine**, but there are two different first-time flows depending on whether you're *creating* a brain for a project or *joining* one a teammate already created. Both start with the global install:
|
|
81
|
+
|
|
80
82
|
```bash
|
|
81
|
-
# 1. Install
|
|
82
83
|
npm install -g devsmind-mcp
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
> **š Already using DevsMind? Upgrading an existing install?**
|
|
87
|
+
> ```bash
|
|
88
|
+
> npm install -g devsmind-mcp@latest # pull the latest CLI
|
|
89
|
+
> devsmind rule # re-paste ā rule content changed in 2.2.1
|
|
90
|
+
> devsmind memory # new in 2.2.2 ā seed your tool's own memory too (optional)
|
|
91
|
+
> ```
|
|
92
|
+
> As of **2.2.1**, the generated rule's content changed (a new "why this matters" section, and a scope restriction on `stage_change`) ā an old pasted rule still works, but re-running `devsmind rule` and re-pasting it into your IDE picks up the update. **2.2.2** adds `devsmind memory` as an entirely new, optional command ā nothing to re-run for it, just something new you can now do. Check the [Changelog](#changelog) each time you upgrade to see if a given release calls for this.
|
|
93
|
+
|
|
94
|
+
The MCP connection and the workspace rule are **per-developer, per-tool** ā they live in your IDE/CLI's own config files on your machine and are **not** committed to git. So every teammate runs `devsmind mcp` and `devsmind rule` once on their own machine, even when the brain itself is already set up.
|
|
95
|
+
|
|
96
|
+
### š A) Starting a new brain (first person on the project)
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# 1. Create the brain. Interactive: asks for project name, repos, tech stack,
|
|
100
|
+
# which folders to index, etc. Creates the .devmind/ directory.
|
|
101
|
+
devsmind init
|
|
102
|
+
|
|
103
|
+
# 2. Connect your IDE / CLI to the DevsMind MCP server (guided, per-tool).
|
|
104
|
+
# Asks what you're working in (Cursor, VS Code, Claude Code, Codex, ā¦) and
|
|
105
|
+
# then either PRINTS the exact snippet to paste, or WRITES/merges the correct
|
|
106
|
+
# config file for you (with a preview + confirmation).
|
|
107
|
+
devsmind mcp
|
|
108
|
+
|
|
109
|
+
# 3. Place the AI workspace rule into your tool's native rules file (guided).
|
|
110
|
+
# This is what actually teaches your agent to USE DevsMind (which tools to
|
|
111
|
+
# call, when, and the DEVMIND_PATH for this project). Without it the server
|
|
112
|
+
# is connected but your agent won't know to use it.
|
|
113
|
+
devsmind rule
|
|
114
|
+
|
|
115
|
+
# 4. (Optional) Seed your tool's OWN persistent memory/skills store too ā a
|
|
116
|
+
# different mechanism from the rule file above, only available for a
|
|
117
|
+
# couple of tools (see why below). Safe to skip; the rule alone is enough.
|
|
118
|
+
devsmind memory
|
|
119
|
+
|
|
120
|
+
# 5. Start the MCP server. Run from the folder containing .devmind (or pass
|
|
121
|
+
# --path <devmind_path>). Skip this if you connected via stdio in step 2 ā
|
|
122
|
+
# then your IDE launches the server itself.
|
|
123
|
+
devsmind start
|
|
83
124
|
|
|
84
|
-
#
|
|
125
|
+
# 6. (Optional, recommended) Index your codebase so the graph actually has
|
|
126
|
+
# content to look up. This is the one step unique to a NEW project. It's
|
|
127
|
+
# skippable ā you can instead let the graph "grow as you go" as your agent
|
|
128
|
+
# records changes ā but until the code is indexed (or enough organic usage
|
|
129
|
+
# has accumulated) there's little for the agent to query yet.
|
|
130
|
+
devsmind index --run --provider gemini --key YOUR_GEMINI_KEY
|
|
131
|
+
# (see the `index` / `reindex` reference below for providers, flags, and the
|
|
132
|
+
# zero-setup grow-as-you-go alternative)
|
|
133
|
+
|
|
134
|
+
# 7. Commit .devmind/ so your team shares the same brain.
|
|
135
|
+
git add .devmind && git commit -m "Add DevsMind brain"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### š B) Joining / resuming an existing brain (teammate already set it up)
|
|
139
|
+
|
|
140
|
+
The `.devmind/` folder is already in the repo ā **no fresh setup, no indexing.** The committed `config.json` + `graph/` + `history/` are shared, but the `.env` (your developer identity, and in standalone mode your machine's local repo paths) is gitignored, so you still run `devsmind init` once to set up your local side:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# 1. Get the committed brain.
|
|
144
|
+
git pull # or: git clone <repo>
|
|
145
|
+
|
|
146
|
+
# 2. Set up your machine-local .env. `init` detects the existing brain and,
|
|
147
|
+
# instead of creating a new one, just configures this machine: your
|
|
148
|
+
# developer name/email, and (standalone mode) the local paths to each repo.
|
|
149
|
+
# It does NOT re-create config or re-index the graph.
|
|
85
150
|
devsmind init
|
|
86
151
|
|
|
87
|
-
# 3.
|
|
152
|
+
# 3. Connect your IDE / CLI (same guided command as above).
|
|
153
|
+
devsmind mcp
|
|
154
|
+
|
|
155
|
+
# 4. Place the workspace rule for your tool.
|
|
88
156
|
devsmind rule
|
|
89
157
|
|
|
90
|
-
#
|
|
91
|
-
#
|
|
92
|
-
|
|
158
|
+
# 5. (Optional) Seed your tool's own persistent memory/skills store, if it
|
|
159
|
+
# has one DevsMind can safely write to (see why below). Skippable.
|
|
160
|
+
devsmind memory
|
|
161
|
+
|
|
162
|
+
# 6. Sync the committed graph/ + history/ JSONs into your local brain.db.
|
|
163
|
+
# Especially important for stdio setups (VS Code and most CLI tools): the
|
|
164
|
+
# editor spawns the server itself and only loads the graph once per process,
|
|
165
|
+
# so after every `git pull` run this to pick up teammates' changes.
|
|
166
|
+
devsmind sync
|
|
167
|
+
|
|
168
|
+
# 7. Start the server (skip if you connected via stdio ā the IDE runs it).
|
|
93
169
|
devsmind start
|
|
94
170
|
```
|
|
95
171
|
|
|
96
|
-
That's the whole loop. For what each step actually does under the hood ā `init`'s full prompt flow, every `index`/`reindex` flag, provider setup,
|
|
172
|
+
That's the whole loop. For what each step actually does under the hood ā `init`'s full prompt flow, `mcp`/`rule`/`sync`/`memory` in depth, every `index`/`reindex` flag, provider setup, and benchmarks ā see the sections below.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## š Adding DevsMind to your IDE / CLI: `devsmind mcp`, `devsmind rule` & `devsmind memory`
|
|
177
|
+
|
|
178
|
+
These three commands solve three genuinely different problems, and it helps to understand *why* there are three instead of one:
|
|
179
|
+
|
|
180
|
+
1. **`devsmind mcp` ā can your agent even reach the tools?** Connecting the MCP server is what makes `search_nodes`, `get_node_graph`, `stage_change`, and every other DevsMind tool *exist* from your agent's point of view. Skip this and DevsMind is just files sitting on disk ā nothing in your IDE or CLI knows they're there to query at all. This is pure capability, wired up per tool since every one of them expects the server in a different config file, key, and shape.
|
|
181
|
+
2. **`devsmind rule` ā does your agent know it should use them?** Being *connectable* isn't the same as being *used*. Without the workspace rule, an agent with DevsMind fully wired up will often still default to grep and raw file reads out of habit, because nothing told it DevsMind exists or why it matters more than what it already knows how to do. The rule is what actually changes behavior ā it's where DevsMind explains the team-brain framing, the consequence of skipping `stage_change`/`commit_changes`, and exactly which tool to reach for and when.
|
|
182
|
+
3. **`devsmind memory` ā does that behavior survive without you re-pasting anything?** The rule file is still a static file *you* maintain and paste in once. Several tools now have their own persistent, agent-written memory or "skills" store ā a place the agent records a lesson itself and reads it back automatically forever after, independent of whether the pasted rule ever goes stale or gets skipped during a teammate's setup. Where it's safe to do so, this seeds that store directly with the same content, so the workflow contract lives in a place the *tool itself* owns and refreshes, not just a copy-pasted file.
|
|
183
|
+
|
|
184
|
+
`mcp` and `rule` are both **guided and per-tool**: they ask what you're working in (Cursor, VS Code, Windsurf, Kiro, Antigravity, Claude Code, Codex CLI, Qwen Code CLI, ā¦), then either **print the exact snippet to copy-paste (manual)** or **create/merge the config file for you (automatic)** ā with a preview and confirmation, never clobbering your existing servers.
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Add the MCP server connection. Picks the right transport per tool
|
|
188
|
+
# (stdio for CLI tools, stdio-or-HTTP for IDEs) and the right config file
|
|
189
|
+
# + key (mcpServers / servers / [mcp_servers] / serverUrl / httpUrl / url).
|
|
190
|
+
devsmind mcp
|
|
191
|
+
|
|
192
|
+
# Place the workspace rule in the tool's native rules file
|
|
193
|
+
# (.cursor/rules/*.mdc, CLAUDE.md, AGENTS.md, QWEN.md, .github/copilot-instructions.md, ā¦).
|
|
194
|
+
# In a pipe or with --print, it just prints the rule (back-compat: `devsmind rule --print > rule.md`).
|
|
195
|
+
devsmind rule
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**`devsmind sync`** ā force the committed `graph/` + `history/` JSONs into your local `brain.db`.
|
|
199
|
+
Under `--stdio` (how VS Code and most CLI tools run the server), the editor spawns the process itself and the on-disk graph is only loaded once per process ā so after a `git pull` your teammates' graph changes won't appear until you re-sync. Run this to apply them without restarting:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
devsmind sync
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**`devsmind memory`** ā beyond the rule file, some IDEs/CLIs have their own persistent, agent-managed memory or "skills" store ā a place the agent itself writes a lesson to once and reads back automatically in every future session, no re-pasting required. This is a *different* mechanism per tool, under genuinely different names (Claude Code's "Auto Memory," Antigravity's "Skills" / `/learn`, Cursor's "Memories," Windsurf's "Cascade Memories," ā¦), and not every one of them is safe to write into ā some are backed by an undocumented database, gated behind manual approval, or explicitly documented as internal, regenerated state that a manual edit would just get overwritten. Writing to the wrong one is worse than doing nothing: it looks like it worked and either silently does nothing or gets clobbered by the tool's own background process. So `devsmind memory` only writes where research specifically confirmed the tool reads back a file it didn't create itself ā everywhere else, it explains why not and what to do instead:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
devsmind memory
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
| Tool | Feature | Seeded automatically? |
|
|
212
|
+
|---|---|---|
|
|
213
|
+
| Google Antigravity (IDE + CLI) | Skills / `/learn` | ā
ā confirmed by Google's own codelab plus a firsthand test that a manually-placed `SKILL.md` is discovered the same as an agent-created one |
|
|
214
|
+
| Claude Code | Auto Memory | ā
ā writes a `devsmind.md` topic file plus a one-line pointer appended into `MEMORY.md` (topic files only load "on demand," so the pointer is what makes it get found) |
|
|
215
|
+
| Qwen Code CLI | `QWEN.md` | Already handled ā it's the same file `devsmind rule` writes to |
|
|
216
|
+
| Codex CLI | Memories | ā manual guidance only ā Codex's own docs warn these files are "generated state" a background job regenerates; a manual write would likely get silently overwritten |
|
|
217
|
+
| Qwen Code CLI | background auto-memory dir | ā manual guidance only ā same undocumented, auto-generated pattern as Codex, no source confirms a manual file survives |
|
|
218
|
+
| Cursor | Memories | ā manual guidance only ā internal database, requires the agent to propose and you to approve, nothing to write a file to |
|
|
219
|
+
| Windsurf | Cascade Memories | ā manual guidance only ā no source confirms whether a manually-placed file is ever discovered |
|
|
220
|
+
| Kiro | Knowledge / PR-comment learning | ā manual guidance only ā not file-based (JSON+embeddings or AWS-internal, opaque) |
|
|
221
|
+
| VS Code (Copilot) | Copilot Memory | ā manual guidance only ā no documented write API, format has changed repeatedly through 2026 |
|
|
222
|
+
|
|
223
|
+
For everything in the ā rows, `devsmind memory` prints the tool's own name for the feature and exactly why it isn't safe to write to, plus what to do instead ā never a silent no-op.
|
|
97
224
|
|
|
98
225
|
---
|
|
99
226
|
|
|
@@ -236,13 +363,12 @@ This is the **joining-developer / repair flow** ā it never overwrites the shar
|
|
|
236
363
|
3. **Standalone mode:** checks every repo's `path_key` in `.env` against the filesystem. Any repo with a missing or now-invalid local path gets prompted for a corrected absolute path; everything else in `.env` (including unrelated keys) is preserved as-is.
|
|
237
364
|
4. Rewrites `.env`, ensures `.gitignore` exists, and re-initializes `brain.db` if needed.
|
|
238
365
|
|
|
239
|
-
This is exactly what a new team member runs after `git clone`-ing a project that already has `.devmind/config.json` committed ā see [Joining
|
|
366
|
+
This is exactly what a new team member runs after `git clone`-ing a project that already has `.devmind/config.json` committed ā see [Quick Start B) Joining / resuming an existing brain](#-quick-start) above.
|
|
240
367
|
|
|
241
368
|
---
|
|
242
369
|
|
|
243
370
|
## š„ļø Other CLI Commands
|
|
244
371
|
|
|
245
|
-
* **`devsmind rule [--path <devmind_path>]`** ā prints a ready-to-paste AI workspace rule, pre-filled with this project's specific configuration, so you don't have to hand-write a system prompt. Paste the output into `.cursorrules`, Claude Project instructions, Antigravity system settings, etc.
|
|
246
372
|
* **`devsmind start [--stdio] [-p, --port <number>]`** ā starts the MCP server. Default: HTTP on port `4513`, reachable at `http://localhost:4513/mcp`. Pass `--stdio` for IDEs that manage the server process directly instead of connecting over HTTP.
|
|
247
373
|
* **`devsmind view [-p, --path <devmind_path>] [-P, --port <number>]`** ā opens the interactive D3.js graph visualizer in your browser (see [below](#-interactive-graph-visualizer)).
|
|
248
374
|
* **`devsmind prune [-p, --path <devmind_path>]`** ā interactive terminal tool to review node stats, inspect current code, page through chronological change history, and permanently delete individual nodes or clear all nodes/history.
|
|
@@ -321,16 +447,20 @@ This "grow-as-you-go" path needs zero upfront setup and is a reasonable default
|
|
|
321
447
|
|
|
322
448
|
DevsMind tools are designed with **layered granularity**. The AI only pulls the depth of data it needs, keeping token overhead minimal.
|
|
323
449
|
|
|
324
|
-
|
|
450
|
+
DevsMind exposes **21 tools** to the AI agent, grouped below by what they're for.
|
|
451
|
+
|
|
452
|
+
### š Category 1: Discovery & Search
|
|
325
453
|
* `get_node_summary`: Returns node type, location, connections count, history counts, and last update. (~50 tokens)
|
|
326
454
|
* `list_nodes`: List all nodes matching optional type and file path filters. Useful to discover all entities in a component, package, or directory.
|
|
327
|
-
* `
|
|
455
|
+
* `search_nodes`: The one search tool to call ā searches node names/identifiers/reasoning first (cheap, SQL-only) and, if nothing matches, **automatically falls back to a full regex/string code-content search** (matches grouped by node ID, file path, and matching lines) in the same call. Each result is tagged `matched_via: "identifier"` or `matched_via: "code"`. Preferred over a raw grep of the filesystem, and over calling any search tool twice.
|
|
456
|
+
* `get_node_graph`: Recursively retrieves connected nodes and relationships up to a specified depth (default: 6). With `direction:"out"` + `include_code:true`, pulls an entire call flow ā the starting node plus everything it transitively calls, each with live source ā in a single call. `direction:"in"` finds every caller (impact analysis before a change).
|
|
328
457
|
* `get_orphaned_nodes`: Identifies disconnected code nodes in the graph that have no incoming or outgoing connections.
|
|
329
458
|
* `get_visualizer_url`: Returns local browser URLs for opening the interactive 2D and 3D graph visualizers.
|
|
330
459
|
|
|
331
460
|
### š Category 2: Code & History
|
|
461
|
+
* `get_node_code`: Returns a node's **current** source code, parsed live from its file on disk ā token-efficient, since it returns only that function/class/route rather than the whole file. Flags drift explicitly: `snapshot_outdated: true` means the graph has fallen behind disk (re-stage it), and `source: "cached"` means the symbol couldn't be located in its file at all (renamed/moved/deleted) and a possibly-stale cached snapshot was returned instead.
|
|
332
462
|
* `get_node_history`: Retrieves all history records, code snapshots, and change reasoning logs for a node.
|
|
333
|
-
* `get_recent_changes`: Lists nodes modified across the project in the last N hours (
|
|
463
|
+
* `get_recent_changes`: Lists nodes modified across the project in the last N hours (default: 24h), with optional downstream impact analysis.
|
|
334
464
|
* `get_developer_activity`: Pulls logs and changes authored by a specific team member.
|
|
335
465
|
* `get_changes_by_requirement`: Finds all changes linked to a particular ticket or task ID (e.g. `JIRA-402`).
|
|
336
466
|
* `search_decisions`: Performs a text search specifically across the architectural/implementation rationale logs.
|
|
@@ -342,17 +472,15 @@ DevsMind tools are designed with **layered granularity**. The AI only pulls the
|
|
|
342
472
|
* `index_complete`: Marks the codebase indexing session as fully completed.
|
|
343
473
|
|
|
344
474
|
### āļø Category 4: Writes & Mutations
|
|
345
|
-
* `stage_change`: Buffers one touched entity (node id + code snapshot + reasoning) to disk **without** writing to the graph yet. Call once per file you changed during a task ā you do *not* reason about connections here.
|
|
346
|
-
* `commit_changes`: Flushes the whole staged buffer in one pass ā creates/updates every node, writes every history snapshot, then resolves all connections between them (and into the existing graph) via local AST, auto-creating any referenced-but-missing target nodes. Because all nodes exist before edges are resolved, calls between the changed files link correctly regardless of staging order.
|
|
347
|
-
* `update_history`: Single-node convenience ā creates the node, writes the history snapshot (respects the 1h session boundary rule), **and** resolves that node's outgoing connections. Equivalent to one `stage_change` + `commit_changes`.
|
|
475
|
+
* `stage_change`: Buffers one touched entity (node id + code snapshot + reasoning) to disk **without** writing to the graph yet. Call once per file/entity you changed during a task ā you do *not* reason about connections here.
|
|
476
|
+
* `commit_changes`: Flushes the whole staged buffer in one pass ā creates/updates every node, writes every history snapshot, then resolves all connections between them (and into the existing graph) via local AST, auto-creating any referenced-but-missing target nodes. Because all nodes exist before edges are resolved, calls between the changed files link correctly regardless of staging order. **Must be called exactly once** after staging, or nothing is written to the graph.
|
|
348
477
|
* `rename_node`: Re-keys a node identifier and updates all associated records (connections and history) seamlessly.
|
|
349
478
|
* `deprecate_node`: Marks a code node as deprecated, removing its connection mappings while retaining its coding snapshots and reasoning logs in the database.
|
|
350
479
|
|
|
351
|
-
> The former `add_node` / `add_connection` tools are removed ā nodes and edges are now created automatically by `stage_change` + `commit_changes
|
|
480
|
+
> The former `add_node` / `add_connection` tools are removed ā nodes and edges are now created automatically by `stage_change` + `commit_changes`, so the AI never hand-manages edges. `update_history` (the old single-node write) and `search_code` (now folded into `search_nodes`'s automatic fallback) still work if called directly for backward compatibility, but neither is advertised to the AI anymore.
|
|
352
481
|
|
|
353
482
|
### š§¹ Category 5: Optimization & Maintenance
|
|
354
483
|
* `recheck_graph`: Scans the graph to verify file existence and deprecates language primitives, builtins, and nodes associated with missing/deleted files, retaining nodes with active histories.
|
|
355
|
-
* `search_nodes`: Full-text search (FTS5) index for node names, identifiers, and reasoning logs.
|
|
356
484
|
|
|
357
485
|
---
|
|
358
486
|
|
|
@@ -382,21 +510,27 @@ By placing `.devmind/config.json` and `.devmind/brain.db` in Git, you share the
|
|
|
382
510
|
`git push` āāāāāāāāŗ [Shared Remote Git] āāāāāāāāāŗ why it was added, and ticket ID!
|
|
383
511
|
```
|
|
384
512
|
|
|
385
|
-
### Joining a Project
|
|
386
|
-
When a new developer joins your team, they onboard instantly:
|
|
387
|
-
1. Clone the project repository (which contains `.devmind/config.json`, `.devmind/history/`, and `.devmind/graph/`).
|
|
388
|
-
2. Install the package globally: `npm install -g devsmind-mcp`
|
|
389
|
-
3. Initialize the local environment and generate local cache database by running: `devsmind init`
|
|
390
|
-
4. Copy the workspace rule printed by `devsmind rule` into their IDE configuration rules.
|
|
391
|
-
5. Launch the server: `devsmind start` (this automatically syncs and reconstructs the SQLite database cache from the local JSON files on startup).
|
|
392
|
-
|
|
393
|
-
The new developer's AI agent now possesses the full architectural context and decision history of your senior team.
|
|
394
|
-
|
|
395
513
|
---
|
|
396
514
|
|
|
397
515
|
## Changelog
|
|
398
516
|
|
|
399
|
-
### Version 2.
|
|
517
|
+
### Version 2.2.2 (Current Release)
|
|
518
|
+
* **`devsmind memory` ā Seed Each Tool's Own Persistent Memory/Skills Store**: The rule file and the MCP `instructions` field both get the workflow contract in front of an agent, but neither IS the tool's own memory ā several IDEs/CLIs have a separate, agent-managed store (Claude Code's "Auto Memory," Antigravity's "Skills" / `/learn`, Cursor's "Memories," and others, each under genuinely different names, not one shared convention) that the agent writes a lesson to once and reads back automatically forever after, no re-pasting required. A dedicated research pass ā not just checking for features branded "memory," but actually verifying whether each tool reads back a file it didn't create, or only trusts content from its own internal mechanism ā found only 2 of 8 tools safe to write into: **Antigravity** (IDE + CLI), confirmed by a firsthand test that a manually-placed `SKILL.md` is discovered the same as an agent-created one, and **Claude Code**, which writes a `devsmind.md` topic file plus a one-line pointer appended into `MEMORY.md` (topic files only load "on demand," so the pointer is what makes it actually get found). Everywhere else ā Codex CLI, Qwen's background auto-memory tier, Windsurf, Cursor, Kiro, VS Code Copilot ā `devsmind memory` prints the tool's own name for the feature and the specific evidence for why writing to it isn't safe (e.g. quoting Codex's own docs: *"these files are treated as generated state... don't rely on editing them by hand"*), instead of a silent no-op that looks like it worked and didn't. Reuses the same `DEVSMIND_INSTRUCTIONS` content as the MCP `instructions` field ā one source of truth, not a third hand-maintained copy.
|
|
519
|
+
|
|
520
|
+
### Version 2.2.1
|
|
521
|
+
* **`search_nodes` Now Falls Back to Code Content ā `search_code` Folded In**: `search_nodes` only ever matched a node's name, id, or reasoning text, so a query like "alipay" returned nothing whenever "Alipay" only appeared inside the code body rather than the function name ā the agent had to burn a second turn calling `search_code` to actually find it. `search_nodes` now tries the cheap identifier match first and, if that's empty, automatically runs the same code-content search `search_code` used to do, tagging each result `matched_via: "identifier"` or `matched_via: "code"`. `search_code` is no longer advertised as a separate tool ā its logic lives inside `search_nodes` now ā but its handler is kept for direct/legacy calls, so any existing workspace rule that still names it explicitly keeps working unchanged. **Re-run `devsmind rule` to pick up the updated guidance** (not required ā old rules still function, just with one avoidable extra turn on a cold miss).
|
|
522
|
+
* **MCP `instructions` Field ā a Server-Controlled Source of Truth**: The workflow contract (search before grep, read code through the graph, stage + commit after every change) previously lived only in whatever the user pasted from `devsmind rule` ā a copy that could go stale the moment the rule template changed, or simply never get pasted at all. The server now also sends this contract via the MCP protocol's own `instructions` field at connection time, so every client gets the current, correct version automatically, with zero setup and no dependency on a rule file existing or being current. This doesn't replace `devsmind rule` (which still carries the per-project config ā `DEVMIND_PATH`, tech stack, repos ā that a stateless server has no other way to know), but it does mean the cross-cutting behavioral rules are no longer solely dependent on it.
|
|
523
|
+
* **The Rule Now Explains *Why*, Not Just *What***: The generated rule previously listed tool triggers without motivation. It now opens with why DevsMind is different from a normal opt-in tool ā it's the team's shared graph, not a personal scratchpad, and unrecorded reasoning (the *why* behind a change, not just the diff) is unrecoverable once the turn ends ā and explains the specific gap `get_node_graph` (dependency impact git can't show) and `get_node_history` (the *why* behind a change, which `git blame` can't show) each fill. The same core contract is now in the MCP `instructions` field above, so an agent gets it twice: once explained in the rule, once enforced at every connection.
|
|
524
|
+
* **Consequence Framing Extended to Every Read/Write Tool's Own Description, and to Every Critical Rule**: The "why this matters" framing above previously lived only in the rule's new intro section. It's now threaded through `stage_change`, `commit_changes`, `get_node_code`, `get_node_graph`, `get_node_history`, and `search_nodes`'s own MCP descriptions (the one part of the contract that's resent on *every single tool call*, not just read once at session start) ā each explains what's lost or missed if it's skipped, not just what it does. The rule's "MANDATORY" and "Critical Rules" sections got the same treatment: each item now states its consequence (a stranded staged change no one else will ever see, a dependency you didn't check before breaking a signature, a decision you silently undid) instead of a bare imperative.
|
|
525
|
+
* **Fixed: `stage_change` Had No File-Type Guardrail ā Non-Code Files Could Bloat the Graph**: The consequence-framing changes above made the agent take recording changes more seriously ā including, in practice, staging files DevsMind was never meant to track (CSS, JSON, markdown, other non-code assets), since `stage_change` accepted any `file_path` with zero validation. It now rejects any file whose extension isn't one of the indexable source-code types (`.ts`, `.py`, `.go`, `.vue`, etc. ā the same allowlist `devsmind index` already scans by) with a clear `isError` response explaining why and listing the supported extensions, instead of silently accepting it and letting a dead-end, caller-less node into the graph. The rejection is enforced in code, not just described in the rule ā reusing the lesson from the tools above, prose alone doesn't reliably stop a determined agent. `devsmind rule` and the MCP `instructions` field both now state this scope up front too.
|
|
526
|
+
|
|
527
|
+
### Version 2.2.0
|
|
528
|
+
* **`devsmind mcp` ā Guided, Per-Tool MCP Setup**: Adding DevsMind to an IDE was previously undocumented and manual ā every tool uses a different config file, location, key, and transport, and you were left to figure yours out. The new `devsmind mcp` command asks what you're working in (Cursor, VS Code/Copilot, Windsurf, Kiro, Google Antigravity, Claude Code, OpenAI Codex CLI, Qwen Code CLI, plus the Antigravity CLI) and then either **prints the exact snippet to paste** (manual mode) or **creates/merges the correct config file for you** (automatic mode) ā with a preview and confirmation, and merging into any existing servers rather than overwriting them. It picks the best-fit transport per tool (stdio for CLI tools; stdio or HTTP for IDEs) and emits each tool's specific shape: the right top-level key (`mcpServers` vs VS Code's `servers` vs Codex's TOML `[mcp_servers.*]`) and the right remote-endpoint key (`url` vs Windsurf/Antigravity's `serverUrl` vs Qwen's `httpUrl`). Automatic mode includes a `cd`-style folder navigator so you can place project- or global-scoped configs anywhere on disk.
|
|
529
|
+
* **`devsmind sync` ā Force a Graph ā `brain.db` Load On Demand**: The disk-to-DB sync (`syncFromDisk()`, which loads the committed `graph/**` + `history/*.json` into the local SQLite cache) only runs once per process, in the DB constructor. Under `--stdio` ā how VS Code and most CLI tools run the server ā the editor spawns the process itself and never hits the HTTP routes that would otherwise trigger a fresh sync, so after a `git pull` your teammates' graph changes never reached your local brain without restarting the whole editor. `devsmind sync` applies them explicitly and reports what changed (node / connection / history counts with deltas). Run it after pulling.
|
|
530
|
+
* **`devsmind rule` ā Now Places the Rule For You, Per Tool**: Previously `rule` only dumped the workspace rule to stdout with a generic "paste this somewhere" tip. It now runs the same guided per-tool flow: pick your tool, then either see the exact native rules-file path (manual) or have the rule **written into that file for you** (automatic) ā `.cursor/rules/devsmind.mdc` (with the required frontmatter), `CLAUDE.md`, `AGENTS.md`, `QWEN.md`, `.github/copilot-instructions.md`, and so on. Shared files get a delimited DevsMind block that updates in place on re-run instead of duplicating. Piped/redirected output and the new `--print` flag still emit the plain rule, so `devsmind rule --print > rule.md` and existing scripts keep working.
|
|
531
|
+
* **Interactive Folder Navigator for Paths**: Everywhere the CLI asks for a directory ā `devsmind init`'s brain location and repository paths, and the automatic-write location in `devsmind mcp` / `devsmind rule` ā you now get a `cd`-style browser: step into subfolders, go up, or type/paste a path directly (handy for another drive or a far-away folder, with `~` expansion). No more hand-typing and re-typing absolute paths; only existing directories can be confirmed.
|
|
532
|
+
|
|
533
|
+
### Version 2.1.1
|
|
400
534
|
* **`get_node_code` Now Reads Live Source From Disk**: Previously this tool served the last *cached* code snapshot from `.devmind/history/`, never touching the source file. If anyone edited code outside the agent's `stage_change` flow ā a `git pull`, a manual edit, a teammate's commit ā the agent was handed confidently-wrong code with no warning. It now parses the node's current source straight from its file via the local AST (deterministic, no LLM, no file read into context), and only falls back to the cached snapshot when the symbol genuinely can't be located on disk. Measured against a real 7,300-node production brain, **87% of sampled nodes were serving stale code** under the old behavior.
|
|
401
535
|
* **Silent Staleness Is Now Reported**: Because the live source and the stored snapshot are both in hand, comparing them is free. `get_node_code` now returns `snapshot_outdated: true` when the graph has drifted from disk, and `source: "cached"` when a symbol could not be found in its file at all (renamed, moved, deleted, or a non-TS/JS file) ā so the agent can re-record the node instead of silently trusting a stale answer. Historical snapshots from `get_node_history` are unchanged and still frozen, which is the point of them.
|
|
402
536
|
* **Whole Call Flows in a Single Call (`get_node_graph` + `include_code`)**: Tracing a request through ~10 functions previously meant a `get_node_code` round trip per function ā roughly 21 chat turns, each re-sending the conversation and generating fresh output tokens. `get_node_graph` now accepts `direction` (`"out"` = callees / a call flow, `"in"` = callers / impact analysis, `"both"` = the surrounding neighborhood, the unchanged default) and `include_code: true`, which attaches each node's live source. One call now returns the entry point plus everything it transitively calls, with code ā collapsing that trace to ~2 turns.
|
|
@@ -437,6 +571,33 @@ The new developer's AI agent now possesses the full architectural context and de
|
|
|
437
571
|
|
|
438
572
|
### Version 1.2.2
|
|
439
573
|
* **Node.js v24 LTS & npm Dependency Conflict Resolution**: Fixed native compilation conflicts (like `better-sqlite3` and `node-gyp` errors) that crashed on Node v24, ensuring DevsMind builds and installs out-of-the-box on both Node v22 and Node v24 environments.
|
|
574
|
+
* **Robust LLM JSON Parsing**: Added extraction/repair utilities for the indexer's LLM responses, so malformed or fenced JSON (trailing commas, markdown code fences, truncated output) is recovered instead of aborting the extraction step.
|
|
575
|
+
* **Duplicate Node Location Support**: Fixed indexing failures when two distinct code entities legitimately shared the same declared location (e.g. overloaded members), instead of one silently clobbering the other.
|
|
576
|
+
|
|
577
|
+
### Version 1.2.1
|
|
578
|
+
* **Vertex AI Gemini Provider**: Added `--provider vertex` as an alternative to the direct Gemini API for `index`/`reindex`, authenticating via a Google Cloud service account instead of a raw API key ā the option teams already using GCP IAM and billing need instead of managing a separate Gemini key.
|
|
579
|
+
* **Fixed: 3 Bugs in the Interactive Configuration Browser**: The tree-based folder browser introduced in 1.2.0 could let navigation escape above the repo root, didn't visually show that a folder was excluded *because* its parent was excluded (only directly-excluded entries were marked), and mishandled the `.gitignore`-import confirmation step. All three fixed.
|
|
580
|
+
* **Cursor Position Preserved in the File Browser**: Toggling a file or folder's include/exclude state used to reset the browser's cursor to the top of the list, making it tedious to toggle several entries in a row in a large tree. The cursor position is now retained across toggles.
|
|
581
|
+
|
|
582
|
+
### Version 1.2.0
|
|
583
|
+
* **Interactive Tree-Based Configuration Browser for `devsmind init`**: Replaced manually typing comma-separated ignore patterns with a navigable folder tree ā browse into subdirectories, toggle files/folders to include or exclude them (with inherited-exclusion status shown for anything under an excluded parent), and optionally seed exclusions from the repo's `.gitignore` or a common-preset list (lockfiles, build configs, etc.) before fine-tuning by hand.
|
|
584
|
+
|
|
585
|
+
### Version 1.1.1
|
|
586
|
+
* **Fixed: Foreign Key Constraint Failures in `addConnection`**: Creating a connection could fail outright if the target node hadn't been inserted yet (an ordering issue during indexing), instead of being handled gracefully. Connection writes are now resilient to out-of-order node creation.
|
|
587
|
+
|
|
588
|
+
### Version 1.1.0
|
|
589
|
+
* **Native Background Index Runner (`devsmind index --run`)**: Indexing could previously only be driven in-chat via MCP tools, burning the IDE agent's own token budget per file. This release moved the Gemini and Ollama LLM integrations directly into the CLI runner, so a full first-pass index can run in the background from the terminal instead ā the predecessor to today's `index`/`reindex` commands.
|
|
590
|
+
* **Compressed History Snapshots**: History code snapshots are now transparently zlib-compressed on write and decompressed on read, substantially shrinking `brain.db`'s on-disk size as a project's change history grows.
|
|
591
|
+
* **SQLite `VACUUM` on Index Completion & Graph Recheck**: Reclaims space freed by deletions/compaction automatically at the end of an index run and during `recheck_graph`, instead of the database file only ever growing.
|
|
592
|
+
|
|
593
|
+
### Version 1.0.1
|
|
594
|
+
* **MCP Server & Rule Generator Scaffolding**: Wired the initial `devsmind rule` generator, a versioned SQLite database schema, and the first MCP server tool surface together as a coherent baseline for the releases that followed.
|
|
595
|
+
|
|
596
|
+
### Version 1.0.0 (Initial Release)
|
|
597
|
+
* **Core MCP Toolset**: Shipped the first working tool surface ā including `deprecate_node` and `get_node_code` (with a stale-snapshot refresh protocol referenced from the workspace rule) ā plus the `devsmind prune` command, replacing an earlier `get_project_context` / `delete_node` pairing with the deprecate-first model DevsMind still uses today.
|
|
598
|
+
* **Workspace Rule Tuning**: Slimmed the generated rule to roughly 400 tokens by cutting redundant inline tool-argument JSON, then reorganized the remaining guidance into an "Available Tools" table with a one-line use-case per tool for faster agent lookup.
|
|
599
|
+
* **Cross-Platform Path Fixes**: Fixed `DEVMIND_PATH` printing with backslashes on Windows (which broke downstream parsing) in favor of forward slashes, added a descriptive error when `getDatabase` can't find the target directory, and added `resolveDevmindPath` auto-detection so tools still work if the calling agent forgot to pass `devmind_path` explicitly.
|
|
600
|
+
* **Initial Documentation**: First pass of the README ā workspace topologies, the full MCP tool list, `devsmind init` re-initialization behavior, a simplified quick start, and the `delete_node`-to-`deprecate_node` policy ā plus an internal roadmap doc for planned "next core" features.
|
|
440
601
|
|
|
441
602
|
---
|
|
442
603
|
|
package/dist/cli/index.js
CHANGED
|
@@ -6,6 +6,9 @@ const init_1 = require("./init");
|
|
|
6
6
|
const rule_1 = require("./rule");
|
|
7
7
|
const view_1 = require("./view");
|
|
8
8
|
const prune_1 = require("./prune");
|
|
9
|
+
const sync_1 = require("./sync");
|
|
10
|
+
const mcp_1 = require("./integrations/mcp");
|
|
11
|
+
const memory_1 = require("./integrations/memory");
|
|
9
12
|
const runner_1 = require("./runner");
|
|
10
13
|
const server_1 = require("../mcp/server");
|
|
11
14
|
const program = new commander_1.Command();
|
|
@@ -61,10 +64,56 @@ program
|
|
|
61
64
|
});
|
|
62
65
|
program
|
|
63
66
|
.command('rule')
|
|
64
|
-
.description('
|
|
67
|
+
.description('Get the AI workspace rule and place it in your tool (guided), or print it')
|
|
65
68
|
.option('-p, --path <devmind_path>', 'Explicit path to the .devmind directory (auto-detected from cwd by default)')
|
|
66
|
-
.
|
|
67
|
-
(
|
|
69
|
+
.option('--print', 'Just print the rule to stdout (no interactive placement)')
|
|
70
|
+
.action(async (opts) => {
|
|
71
|
+
try {
|
|
72
|
+
await (0, rule_1.handleRule)(opts);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
console.error(`ā Rule failed: ${err.message}`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
program
|
|
80
|
+
.command('mcp')
|
|
81
|
+
.description('Add DevsMind as an MCP server to your IDE or CLI (guided, per-tool)')
|
|
82
|
+
.option('-p, --path <devmind_path>', 'Explicit path to the .devmind directory (auto-detected from cwd by default)')
|
|
83
|
+
.action(async (opts) => {
|
|
84
|
+
try {
|
|
85
|
+
await (0, mcp_1.handleMcp)(opts);
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
console.error(`ā MCP setup failed: ${err.message}`);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
program
|
|
93
|
+
.command('memory')
|
|
94
|
+
.description('Seed a tool\'s own persistent agent-memory/skills store (guided, per-tool)')
|
|
95
|
+
.option('-p, --path <devmind_path>', 'Explicit path to the .devmind directory (auto-detected from cwd by default)')
|
|
96
|
+
.action(async (opts) => {
|
|
97
|
+
try {
|
|
98
|
+
await (0, memory_1.handleMemory)(opts);
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
console.error(`ā Memory setup failed: ${err.message}`);
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
program
|
|
106
|
+
.command('sync')
|
|
107
|
+
.description('Sync the committed graph + history from disk into the local brain.db')
|
|
108
|
+
.option('-p, --path <devmind_path>', 'Explicit path to the .devmind directory (auto-detected from cwd by default)')
|
|
109
|
+
.action(async (opts) => {
|
|
110
|
+
try {
|
|
111
|
+
await (0, sync_1.handleSync)(opts);
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
console.error(`ā Sync failed: ${err.message}`);
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}
|
|
68
117
|
});
|
|
69
118
|
program
|
|
70
119
|
.command('view')
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,iCAAoC;AACpC,iCAAoC;AACpC,iCAAoC;AACpC,mCAAsC;AACtC,qCAA0E;AAC1E,0CAAmF;AAEnF,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,8BAA8B,CAAC;KA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,EAAE,EAAE;IACxC,IAAI,CAAC;QACH,MAAM,IAAA,mBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,qBAAsB,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/cli/init.js
CHANGED
|
@@ -43,7 +43,22 @@ const child_process_1 = require("child_process");
|
|
|
43
43
|
const prompts_1 = __importDefault(require("prompts"));
|
|
44
44
|
const dotenv = __importStar(require("dotenv"));
|
|
45
45
|
const database_1 = require("../db/database");
|
|
46
|
+
const prompt_1 = require("./integrations/prompt");
|
|
46
47
|
// āāā Detection Helpers āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
48
|
+
/**
|
|
49
|
+
* Interactive folder picker for init. Returns the chosen absolute directory, or
|
|
50
|
+
* null if the user cancelled (so callers can abort init cleanly).
|
|
51
|
+
*/
|
|
52
|
+
async function browseForDir(message, startDir) {
|
|
53
|
+
try {
|
|
54
|
+
return await (0, prompt_1.pickDirectory)(startDir, message);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
if (err instanceof prompt_1.CancelledError)
|
|
58
|
+
return null;
|
|
59
|
+
throw err;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
47
62
|
/** Read a global git config value (user.name, user.email, etc.) */
|
|
48
63
|
function readGitConfig(key) {
|
|
49
64
|
try {
|
|
@@ -462,21 +477,12 @@ async function handleExistingInit(devmindDir, configPath, envPath, dbPath) {
|
|
|
462
477
|
for (const repo of reposToPrompt) {
|
|
463
478
|
if ('path_key' in repo && repo.path_key) {
|
|
464
479
|
const initialPath = envConfig[repo.path_key] || process.cwd();
|
|
465
|
-
const
|
|
466
|
-
|
|
467
|
-
name: 'localPath',
|
|
468
|
-
message: `Local path for repo "${repo.name}" (${repo.path_key})?`,
|
|
469
|
-
initial: initialPath,
|
|
470
|
-
validate: (val) => {
|
|
471
|
-
const resolved = path.resolve(val);
|
|
472
|
-
return fs.existsSync(resolved) ? true : `Directory does not exist: ${resolved}`;
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
if (response.localPath === undefined) {
|
|
480
|
+
const localPath = await browseForDir(`Select the local folder for repo "${repo.name}" (${repo.path_key})`, initialPath);
|
|
481
|
+
if (localPath === null) {
|
|
476
482
|
console.log('ā Initialization cancelled.');
|
|
477
483
|
return;
|
|
478
484
|
}
|
|
479
|
-
envLines.push(`${repo.path_key}=${
|
|
485
|
+
envLines.push(`${repo.path_key}=${localPath}`);
|
|
480
486
|
}
|
|
481
487
|
}
|
|
482
488
|
}
|
|
@@ -535,29 +541,22 @@ async function handleNewInit(cwd) {
|
|
|
535
541
|
}
|
|
536
542
|
else {
|
|
537
543
|
const defaultFolderName = `${baseResponse.projectName.toLowerCase().replace(/[^a-z0-9]/g, '-')}-brain`;
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
{
|
|
546
|
-
type: 'text',
|
|
547
|
-
name: 'folderParent',
|
|
548
|
-
message: 'Where do you want it to live?',
|
|
549
|
-
initial: cwd,
|
|
550
|
-
validate: (val) => {
|
|
551
|
-
const resolved = path.resolve(val);
|
|
552
|
-
return fs.existsSync(resolved) ? true : `Directory does not exist: ${resolved}`;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
]);
|
|
556
|
-
if (folderResponse.folderName === undefined || folderResponse.folderParent === undefined) {
|
|
544
|
+
const folderNameResponse = await (0, prompts_1.default)({
|
|
545
|
+
type: 'text',
|
|
546
|
+
name: 'folderName',
|
|
547
|
+
message: "Brain's folder name?",
|
|
548
|
+
initial: defaultFolderName
|
|
549
|
+
});
|
|
550
|
+
if (folderNameResponse.folderName === undefined) {
|
|
557
551
|
console.log('ā Initialization cancelled.');
|
|
558
552
|
return;
|
|
559
553
|
}
|
|
560
|
-
|
|
554
|
+
const folderParent = await browseForDir('Where do you want the brain folder to live?', cwd);
|
|
555
|
+
if (folderParent === null) {
|
|
556
|
+
console.log('ā Initialization cancelled.');
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
targetDir = path.join(folderParent, folderNameResponse.folderName);
|
|
561
560
|
devmindDir = path.join(targetDir, '.devmind');
|
|
562
561
|
if (!fs.existsSync(targetDir)) {
|
|
563
562
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
@@ -593,35 +592,28 @@ async function handleNewInit(cwd) {
|
|
|
593
592
|
while (addAnother) {
|
|
594
593
|
console.log(`\nš¦ Configuring Repository #${repoIndex}:`);
|
|
595
594
|
const defaultName = repoIndex === 1 ? baseResponse.projectName : `service-${repoIndex}`;
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
validate: (val) => {
|
|
609
|
-
const resolved = path.resolve(val);
|
|
610
|
-
return fs.existsSync(resolved) ? true : `Directory does not exist: ${resolved}`;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
]);
|
|
614
|
-
if (repoResponse.name === undefined || repoResponse.localPath === undefined) {
|
|
595
|
+
const repoNameResponse = await (0, prompts_1.default)({
|
|
596
|
+
type: 'text',
|
|
597
|
+
name: 'name',
|
|
598
|
+
message: 'Repository name?',
|
|
599
|
+
initial: defaultName
|
|
600
|
+
});
|
|
601
|
+
if (repoNameResponse.name === undefined) {
|
|
602
|
+
console.log('ā Initialization cancelled.');
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
const localPath = await browseForDir(`Select the local folder for repository "${repoNameResponse.name}"`, cwd);
|
|
606
|
+
if (localPath === null) {
|
|
615
607
|
console.log('ā Initialization cancelled.');
|
|
616
608
|
return;
|
|
617
609
|
}
|
|
618
|
-
const pathKey = `REPO_${
|
|
619
|
-
repos.push({ name:
|
|
620
|
-
envLines.push(`${pathKey}=${
|
|
621
|
-
const absoluteRepoPath =
|
|
610
|
+
const pathKey = `REPO_${repoNameResponse.name.toUpperCase().replace(/[^A-Z0-9]/g, '_')}`;
|
|
611
|
+
repos.push({ name: repoNameResponse.name, path_key: pathKey });
|
|
612
|
+
envLines.push(`${pathKey}=${localPath}`);
|
|
613
|
+
const absoluteRepoPath = localPath;
|
|
622
614
|
repoPaths.push(absoluteRepoPath);
|
|
623
615
|
// Now configure exclusions for this standalone repository
|
|
624
|
-
console.log(`\nš Exclusions setup for repository "${
|
|
616
|
+
console.log(`\nš Exclusions setup for repository "${repoNameResponse.name}":`);
|
|
625
617
|
const currentExcluded = new Set();
|
|
626
618
|
// showIgnorePresets will prompt user for .gitignore patterns AND common presets
|
|
627
619
|
await showIgnorePresets(currentExcluded, absoluteRepoPath);
|