lady-lens 1.6.8 → 1.6.15
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/DOCUMENTATIE.md +431 -430
- package/README.md +408 -405
- package/bin/lens.mjs +199 -200
- package/core/bench/index.js +1 -1
- package/core/configuration/frontmatter.js +151 -146
- package/core/configuration/index.js +5 -5
- package/core/{mcp → daemon}/daemon.js +200 -197
- package/core/daemon/index.js +20 -0
- package/core/daemonCall/index.js +64 -64
- package/core/git/fakeGit.js +7 -2
- package/core/git/hooks.js +106 -0
- package/core/git/index.js +167 -162
- package/core/graph/adapters/ladybug/projectWriteQueries.js +41 -13
- package/core/graph/adapters/ladybug/repositoryStore.js +200 -200
- package/core/graph/query/classShape.js +20 -0
- package/core/graph/query/functionView.js +198 -200
- package/core/graph/query/index.js +1 -0
- package/core/graph/query/parameterSeams.js +198 -0
- package/core/graph/query/questionIntent.js +6 -6
- package/core/graph/sync/codeFacts.js +187 -200
- package/core/graph/sync/filePurpose.js +37 -0
- package/core/graph/sync/gitHistory.js +78 -42
- package/core/graph/sync/graphSync.js +200 -200
- package/core/graph/sync/headCommit.js +38 -38
- package/core/graph/sync/index.js +11 -11
- package/core/mcp/handlers/repoList.js +2 -2
- package/core/mcp/httpServer.js +17 -0
- package/core/mcp/index.js +39 -38
- package/core/mcp/mendixSchemas.js +7 -3
- package/core/mcp/streamableHttp.js +34 -33
- package/core/mcp/syncQueue.js +35 -0
- package/core/mendix/diffUnits.js +115 -0
- package/core/mendix/elementDiff.js +195 -92
- package/core/mendix/flows.js +12 -2
- package/core/mendix/index.js +2 -1
- package/core/mendix/mendixDiff.js +171 -107
- package/core/mendix/modelReader.js +138 -90
- package/core/observability/index.js +3 -3
- package/core/observability/tracing.js +124 -114
- package/core/repository/groups.js +162 -0
- package/core/repository/index.js +7 -0
- package/core/repository/projectSettings.js +140 -141
- package/core/repository/registry.js +1 -1
- package/core/search/graphModelLoader.js +151 -156
- package/core/search/schemas.js +1 -1
- package/package.json +2 -2
- package/skills/lady-lens/SKILL.md +2 -2
package/DOCUMENTATIE.md
CHANGED
|
@@ -1,430 +1,431 @@
|
|
|
1
|
-
# lady-lens documentation
|
|
2
|
-
|
|
3
|
-
Full guide to architecture, API ports, MCP integration, npm package use and configuration through `config.json`. (The file name stays `DOCUMENTATIE.md` so existing links keep working.)
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 0. Installation and setup
|
|
8
|
-
|
|
9
|
-
Requires Node.js 18 or newer; the Mendix MDL export needs 22.13 or newer (see Step 6 below: another Node for lens). Do these steps once, in order.
|
|
10
|
-
|
|
11
|
-
**Step 1: install**
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install -g lady-lens # from npmjs.org
|
|
15
|
-
lens v # prints the version: `lens` is now on your PATH
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
From source instead (development, or a version that is not published yet): `npm install` and `npm run pack` in this folder build `dist\lady-lens-<version>.tgz`; install it with `npm install -g .\dist\lady-lens-<version>.tgz` (later: `lens update .\dist\lady-lens-<version>.tgz`). With `npm link`, `lens` runs straight from this folder.
|
|
19
|
-
|
|
20
|
-
**Step 2: register a project and index it**
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
lens add C:\git\my-project # registers the project and runs the first sync
|
|
24
|
-
lens list # check that it is listed
|
|
25
|
-
lens sync # later: incremental sync (--full = everything)
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
**Step 3: connect your AI assistant (stdio, no daemon needed)**
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
lens install # every agent found; or one: lens install vscode
|
|
32
|
-
lens install --skill # also the Lady-lens workflow skill
|
|
33
|
-
lens install --
|
|
34
|
-
lens install --
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
lens
|
|
44
|
-
lens
|
|
45
|
-
lens
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
lens update
|
|
61
|
-
lens update
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
lens node
|
|
80
|
-
lens node
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- **
|
|
94
|
-
- **
|
|
95
|
-
- **
|
|
96
|
-
- **
|
|
97
|
-
- **
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
| **
|
|
113
|
-
| **
|
|
114
|
-
| **
|
|
115
|
-
| **
|
|
116
|
-
| **
|
|
117
|
-
| **
|
|
118
|
-
| **
|
|
119
|
-
| **
|
|
120
|
-
| **
|
|
121
|
-
| **
|
|
122
|
-
| **
|
|
123
|
-
| **Config
|
|
124
|
-
| **Config
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
- `
|
|
237
|
-
- `
|
|
238
|
-
- `
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
- `
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
npm install
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
import {
|
|
304
|
-
import {
|
|
305
|
-
import {
|
|
306
|
-
import {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
- The
|
|
322
|
-
- The **
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
"
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
"
|
|
360
|
-
|
|
361
|
-
"
|
|
362
|
-
"
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
One daemon
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
-
|
|
384
|
-
-
|
|
385
|
-
-
|
|
386
|
-
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
"
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
|
408
|
-
|
|
|
409
|
-
| `lens
|
|
410
|
-
| `lens
|
|
411
|
-
| `lens
|
|
412
|
-
| `lens
|
|
413
|
-
| `lens
|
|
414
|
-
| `lens
|
|
415
|
-
| `lens
|
|
416
|
-
| `lens
|
|
417
|
-
| `lens
|
|
418
|
-
| `lens
|
|
419
|
-
| `lens
|
|
420
|
-
| `lens
|
|
421
|
-
| `lens install
|
|
422
|
-
| `lens
|
|
423
|
-
| `lens
|
|
424
|
-
| `lens
|
|
425
|
-
| `lens
|
|
426
|
-
| `lens
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
| `lens
|
|
430
|
-
|
|
|
1
|
+
# lady-lens documentation
|
|
2
|
+
|
|
3
|
+
Full guide to architecture, API ports, MCP integration, npm package use and configuration through `config.json`. (The file name stays `DOCUMENTATIE.md` so existing links keep working.)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 0. Installation and setup
|
|
8
|
+
|
|
9
|
+
Requires Node.js 18 or newer; the Mendix MDL export needs 22.13 or newer (see Step 6 below: another Node for lens). Do these steps once, in order.
|
|
10
|
+
|
|
11
|
+
**Step 1: install**
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g lady-lens # from npmjs.org
|
|
15
|
+
lens v # prints the version: `lens` is now on your PATH
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
From source instead (development, or a version that is not published yet): `npm install` and `npm run pack` in this folder build `dist\lady-lens-<version>.tgz`; install it with `npm install -g .\dist\lady-lens-<version>.tgz` (later: `lens update .\dist\lady-lens-<version>.tgz`). With `npm link`, `lens` runs straight from this folder.
|
|
19
|
+
|
|
20
|
+
**Step 2: register a project and index it**
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
lens add C:\git\my-project # registers the project and runs the first sync
|
|
24
|
+
lens list # check that it is listed
|
|
25
|
+
lens sync # later: incremental sync (--full = everything)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Step 3: connect your AI assistant (stdio, no daemon needed)**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
lens install # every agent found; or one: lens install vscode
|
|
32
|
+
lens install --skill # also the Lady-lens workflow skill
|
|
33
|
+
lens install --hooks # non-blocking Git post-commit hooks for background sync
|
|
34
|
+
lens install --mendix # the Mendix skill; or for some agents: lens install skill-mendix vscode claude-code
|
|
35
|
+
lens install --dry-run # shows what would change, writes nothing
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`lens install` adds a stdio entry to each agent's MCP configuration (VS Code: `%APPDATA%\Code\User\mcp.json`), keeps the other servers and saves the old file as `<file>.lady-lens.bak`. Restart the agent afterwards (VS Code: *MCP: List Servers* or reload the window).
|
|
39
|
+
|
|
40
|
+
**Step 4 (alternative): one background daemon for all projects**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
lens mcp -d # MCP on http://127.0.0.1:4318/mcp, UI on http://127.0.0.1:4317
|
|
44
|
+
lens status # is it running?
|
|
45
|
+
lens ps # tracked PIDs per folder
|
|
46
|
+
lens stop # stop it
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Example for VS Code (`mcp.json`):
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{ "servers": { "lady-lens": { "type": "http", "url": "http://127.0.0.1:4318/mcp?repo=C:/git/my-project" } } }
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
See [section 5](#5-using-it-as-an-mcp-server) for several projects per daemon and other agents.
|
|
56
|
+
|
|
57
|
+
**Step 5: update**
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
lens update # the newest version from npm
|
|
61
|
+
lens update 1.2.8 # a given version
|
|
62
|
+
lens update C:\path\lady-lens-1.2.8.tgz # a package file: a machine without npm access, or a build from source
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
In order, `lens update`:
|
|
66
|
+
|
|
67
|
+
1. stops every lens process: the daemon and the stdio servers your agents started. On Windows a running lens keeps the graph database module (`lbugjs.node`) open, and npm cannot replace it (`EBUSY`);
|
|
68
|
+
2. runs `npm install -g` with the package. When that still fails (an agent started lens again), it stops lens once more and retries once;
|
|
69
|
+
3. lets the new lens refresh what you installed (`lens install --refresh`): the MCP entry in every agent where lady-lens is registered (a `--repo` is kept), the installed `SKILL.md` files (main and Mendix skill), and `~/.lady-lens/lens-instructions.md` with the instruction files that point to it. Your own `CLAUDE.md`, `AGENTS.md` or `copilot-instructions.md` only holds a link line and does not change. Nothing you did not install is added;
|
|
70
|
+
4. starts the daemon again if it ran.
|
|
71
|
+
|
|
72
|
+
Reconnect the MCP server in your agents afterwards (Claude Code: `/mcp`; VS Code: restart the server), so they start the new version.
|
|
73
|
+
|
|
74
|
+
**Step 6: another Node for lens**
|
|
75
|
+
|
|
76
|
+
The Mendix MDL export reads mxcli's catalog with `node:sqlite`, which needs Node 22.13 or newer. When your projects need an older Node on PATH (nvm), let only lens run on a newer one; PATH and nvm stay as they are:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
lens node "C:\Program Files\nodejs\node.exe" # lens, its daemon and the agent registrations now run on that Node
|
|
80
|
+
lens node # which Node lens runs on
|
|
81
|
+
lens node --clear # back to the Node on PATH
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The choice is kept in `~/.lady-lens/lens.json`. It holds at once, in every terminal and for agents started from the desktop; `setx LENS_NODE ...` only reaches terminals started later (in cmder not even those), so use `lens node`. `LENS_NODE` still overrides the file. `lens node` stops lens, re-registers the agents with the new Node and starts the daemon again if it ran. The package stays where npm installed it: Ladybug's native module works on every Node version. `lens sync --debug` writes the Node it ran on in the second line of its log.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 1. Architecture overview and philosophy
|
|
89
|
+
|
|
90
|
+
`lady-lens` is a fast, local code graph and semantic analysis engine built on [LadybugDB](https://www.npmjs.com/package/@ladybugdb/core). It indexes source code, documentation, decisions and dependencies into a directed graph. AI coding agents and developers can ask for exact facts about the codebase (definitions, import chains, callers, test reach, code health and architecture metrics) without spending expensive LLM tokens on context.
|
|
91
|
+
|
|
92
|
+
The code base follows a strict **hexagonal architecture (ports and adapters)**:
|
|
93
|
+
- **Core domain / model**: graphs, nodes (files, functions, documents, decisions) and edges (`IMPORTS`, `CALLS`, `TESTS`, `READS`, `CO_CHANGES`).
|
|
94
|
+
- **Storage port (`GraphStorePort`)**: interchangeable storage adapters (in memory for fast tests, LadybugDB for persistent indexing).
|
|
95
|
+
- **Sync and extraction port**: incremental parsing and AST extraction for JavaScript/TypeScript, C# and other registered languages; Mendix `.mpr` models are handled through `mxcli` as an external graph contributor.
|
|
96
|
+
- **Git port (`core/git`)**: the only place that starts git; see [Branches and commits](#branches-and-commits).
|
|
97
|
+
- **Query and view ports**: `functionView`, `folderView`, `codeHealth`, `rankGraphNodes`, `impact`.
|
|
98
|
+
- **Primary adapters**: reachable through the **npm package**, the **MCP server (Model Context Protocol)** and the **CLI (`lens`)**.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 2. API ports: access through MCP and the npm package
|
|
103
|
+
|
|
104
|
+
Every feature of `lady-lens` is a **first-class API port**, available programmatically through the npm package (`lady-lens`) and interactively through the Model Context Protocol (MCP).
|
|
105
|
+
|
|
106
|
+
The library sync API is `createGraphSync().sync({ mode: 'incremental' })`; use `mode: 'full'` for a complete re-index.
|
|
107
|
+
|
|
108
|
+
### Overview of all ports
|
|
109
|
+
|
|
110
|
+
| Port / domain | MCP tool | npm export (`lady-lens`) | Description |
|
|
111
|
+
| :--- | :--- | :--- | :--- |
|
|
112
|
+
| **Function analysis** | `functionView` | `functionView(graph, symbol, { readFile, maxSites })` / `functionViewTool(args)` | Definition, line numbers, docstring/purpose, parameter seams (`parameterSeams`: methods and properties called on parameters), all calling files (`callers`), linked tests and referenced backlog stories of a function; `resolved` and `unresolved` call counts (a `note` "niet bewezen leeg" when none is bound but the name appears); for a class `children` (methods) and `inheritors` (subclasses). |
|
|
113
|
+
| **Folder and module analysis** | `folderView` | `folderView(graph, folder)` / `folderViewTool(args)` | Structure of a folder: parts, internal data flow, who calls the folder from outside and possible deviations (cycles, untested files). |
|
|
114
|
+
| **Code health and metrics** | `health` | `codeHealth(graph, opts)` / `healthTool(args)` | NDepend-style statistics: test reach (including index.js barrels), cyclic dependencies, boundary violations, hotspots (churn x lines), coupling (Ca, Ce, instability), zone of pain, and AST design smells with actionable pattern advice (`dispatch-chain`, `fallback-heavy`, `deep-nesting`, `loop-branching`, `long-condition`, `flag-parameter`, `repeated-literal`, `global-mutable-state`, `direct-io`, `god-module`). A measured line coverage (`coverage-summary.json`, written by `vitest --coverage` with the `json-summary` reporter) beats the import guess: a file covered through another one is tested, and its exports are not guessed by name. Barrels (`index.js`) are never flagged for untested exports, fan-in/out, zone of pain or god-module; tool config files (`*.config.*`) are scripts. On request `hubs` (most neighbours) and `bridges` (betweenness), each with `total` and `truncated` (`hubsAndBridges(graph, opts)`). |
|
|
115
|
+
| **Symbol location** | `definedIn` | `definedIn(graph, symbol)` / `definedInTool(args)` | Where an identifier is defined or exported: file path and exact start/end lines. |
|
|
116
|
+
| **Imports** | `imports` | `importsOf(graph, file)` / `imports(args)` | Which files and modules a given file imports directly. |
|
|
117
|
+
| **Dependents** | `importedBy` | `importersOf(graph, file)` / `importedBy(args)` | Which files import the given file (fan-in analysis). |
|
|
118
|
+
| **Exports** | `exports` | `exportsOf(graph, file)` / `exportsTool(args)` | Complete sorted list of exported functions, variables and types of a file. |
|
|
119
|
+
| **File check** | `exists` | `fileLookup(graph, file)` / `fileExists(args)` | Checks whether a file is in the project graph; suggests matches for typos or moved folders. |
|
|
120
|
+
| **Graph search** | `graph_query` | `graph_query(args)` / `rankGraphNodes(graph, query)` | Semantic and keyword search through the graph by relevance score, IDF weighting and relations. |
|
|
121
|
+
| **Interactive search** | `searchView` | `searchView(args)` | Advanced search with regex, case sensitivity, file type filter (code, doc, test) and path globs. |
|
|
122
|
+
| **Text and regex** | `grep` | `grep(args)` | Fast regex search through code, honouring `.gitignore` and project exclusions. |
|
|
123
|
+
| **Config search** | `config_grep` | `grep(args)` + config filter | Searches only project and configuration files, such as `.csproj` and reference-manager XML. |
|
|
124
|
+
| **Config references** | `config_references` | `grep(args)` + config filter | Finds which config files mention a package, project or Siemens functional block. |
|
|
125
|
+
| **Config update** | `config_update` | `fs` + `createGraphSync().touch()` | Replaces one config file, optionally checks a SHA-256 and refreshes the graph facts. |
|
|
126
|
+
| **Path matching** | `glob` | `glob(args)` | Finds repository paths by glob pattern (e.g. `core/**/*.js`). |
|
|
127
|
+
| **AST chunk reader** | `read_chunk` | `read_chunk(args)` | Reads one AST chunk (class/function) or a range of lines. Large files return a compact summary. |
|
|
128
|
+
| **Decisions and discussions** | `discussion_save`, `discussion_query`, etc. | `saveDiscussion`, `loadDiscussions`, `queryDiscussions` | Manages architecture decisions and discussions, with frontmatter links to code nodes. |
|
|
129
|
+
| **Multi-repo management** | `repo_list`, `repo_add`, `repo_remove` | `registerRepo`, `unregisterRepo`, `listRegisteredRepos` | Manages several projects in the central Ladybug database registry. |
|
|
130
|
+
| **Graph sync** | `repo_sync` | `createGraphSync(options).sync()` | Scans the project incrementally (by size and mtime) or fully (`mode: 'full'`). Records the branch and commit and reports `commitsSince`. With `branch: '<name>'` another branch is indexed into the scope `branch:<name>` without checking it out. |
|
|
131
|
+
| **Branch difference** | `branch_diff` | `branchDiff({ from, to, root })` | What `to` changes since its merge-base with `from`: files (added, removed, modified, renamed) and functions (added, removed, modified, renamed) and changed import and call relations. |
|
|
132
|
+
| **Mendix model difference** | `mendix_diff` | `mendixDiff({ from, to, root, detail, ignore, documents, modules })` | The Mendix model changes `to` brings since its merge-base with `from`, read from git or disk worktree without a checkout or mxcli, for single-file `.mpr` (MPR v1) and `mprcontents/` (MPR v2). Supports cross-folder resolution for multi-clone repos (`repo_list` groups), `to: 'working-tree'`, compact element diffing (`detail: 'changes' | 'summary' | 'full'`), noise reduction (`ignore: ['translations', 'layout']`), and added/deleted document elements. Returns `schemaVersion: 1`, `resolved`, `commits`, `widgets`, `files`, `documents` and `ignored`. Needs Node 22.13+ (`lens node`). |
|
|
133
|
+
| **Diff impact** | `diff_impact` | `diffImpact(args)` / `changedFunctions({ from, to, git, readFile })` | The functions a diff changes (the work not committed yet, or `from`..`to`) with callers, tests, bound/unbound call counts, complexity and test gaps; riskiest first, with `total` and `truncated`. |
|
|
134
|
+
| **Search over projects** | `cross_repo_search` | `crossRepoSearch(args)` | `searchView` over every registered project or `repos: [...]`, project after project; unregistered names in `unknown`. |
|
|
135
|
+
| **Tool metadata** | (all tools) | `RESEARCH_TOOL_SCHEMAS`, `buildMcpToolSchemas()` | Every schema has `readOnly` (MCP `annotations.readOnlyHint`); the discussion tools carry `usedBy: ['/discuss', '/research']` so a host such as Kura gives them only to those consumers. |
|
|
136
|
+
| **Branch impact** | `branch_impact` | `branchImpact({ change, against, root })` | What a change on one branch (e.g. a bugfix on `release`) means for another: functions still used there (file and line), overlap, shared files and text merge conflicts. |
|
|
137
|
+
| **Commit inspection** | `commit_show` | `commitShow({ commit, root })` | What one commit changed (files and functions against its first parent); for a merge commit, what the merge brought in. |
|
|
138
|
+
| **Function history** | `function_history` | `functionHistory({ name, file, ref, max, root })` | Commits that added, modified or removed one function; without `name` every commit that touched the file. Name based: a renamed function starts a new history. |
|
|
139
|
+
|
|
140
|
+
### Branches and commits
|
|
141
|
+
|
|
142
|
+
The graph knows which branch and commit it was built on:
|
|
143
|
+
|
|
144
|
+
- After every sync a `Branch` node points to its `Commit` (`HEAD_AT`). `repo_sync` reports how many commits came in since the previous sync on that branch. A commit that changed no file is recorded too.
|
|
145
|
+
- A saved discussion gets `CREATED_AT` (commit) and `ON_BRANCH` (branch). If you switch to a branch where the source file does not exist, the discussion stays; `discussion_query` shows the source as "not on this branch" and on which branch the file does exist. Switching back and syncing restores the link by itself.
|
|
146
|
+
- `repo_sync({ branch: 'feature-x' })` reads that branch with `git ls-tree` and `git cat-file --batch` into its own scope `branch:feature-x`. The working copy, `HEAD` and the project scope stay unchanged. A second call only reads what changed since the stored commit. This scope has no Mendix contributions and no co-change signal.
|
|
147
|
+
- `branch_diff`, `branch_impact`, `commit_show` and `function_history` read git directly and check nothing out. Functions are compared by name and content (hash of the body); a function whose name changed but whose body is alike (same file, or a renamed file) shows as `renamed` with `oldName`, and `branch_diff` also lists added and removed import and call relations (`relations`). `branch_impact` finds callers with `git grep` (at most 20 references per function; for a renamed function it searches the old name) and uses `git merge-tree --write-tree` (git 2.38 or newer) for conflicts.
|
|
148
|
+
- All git calls go through `core/git` (`createGit({ root, run })`); a test checks that git is started nowhere else. `createFakeGit(state)` is an in-memory git for tests; `test/gitPort.contract.test.js` runs the same scenario on both and compares the answers.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 3. Configuration through `config.json`
|
|
153
|
+
|
|
154
|
+
All `lady-lens` settings can be set in one central **`config.json`** file in the root of the project.
|
|
155
|
+
|
|
156
|
+
### Automatic detection
|
|
157
|
+
`lady-lens` looks for configuration files in this order:
|
|
158
|
+
1. A file given with `--config <path>` or the environment variable `LENS_SETTINGS_PATH`.
|
|
159
|
+
2. `config.json` (recommended default)
|
|
160
|
+
3. `lens.config.json`
|
|
161
|
+
4. `.lady-lens.json`
|
|
162
|
+
5. `.lady-lens.yaml`
|
|
163
|
+
|
|
164
|
+
### Complete example of `config.json`
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"project": {
|
|
169
|
+
"graph_roots": ["."],
|
|
170
|
+
"exclude_dirs": [
|
|
171
|
+
".git",
|
|
172
|
+
".memory",
|
|
173
|
+
"node_modules",
|
|
174
|
+
"outputs",
|
|
175
|
+
"coverage",
|
|
176
|
+
"dist",
|
|
177
|
+
"build",
|
|
178
|
+
"target",
|
|
179
|
+
".vs",
|
|
180
|
+
".idea"
|
|
181
|
+
],
|
|
182
|
+
"graph_extensions": [
|
|
183
|
+
".js",
|
|
184
|
+
".mjs",
|
|
185
|
+
".ts",
|
|
186
|
+
".jsx",
|
|
187
|
+
".tsx",
|
|
188
|
+
".cs",
|
|
189
|
+
".csproj",
|
|
190
|
+
".sln",
|
|
191
|
+
".sql",
|
|
192
|
+
".ps1",
|
|
193
|
+
".md",
|
|
194
|
+
".yaml",
|
|
195
|
+
".yml",
|
|
196
|
+
".json"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"graph": {
|
|
200
|
+
"ast": {
|
|
201
|
+
"enabled": false
|
|
202
|
+
},
|
|
203
|
+
"documentation": {
|
|
204
|
+
"enabled": true
|
|
205
|
+
},
|
|
206
|
+
"links": {
|
|
207
|
+
"enabled": true
|
|
208
|
+
},
|
|
209
|
+
"freshness": {
|
|
210
|
+
"default_max_age_days": 30
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"mcp": {
|
|
214
|
+
"port": 4318,
|
|
215
|
+
"uiPort": 4317
|
|
216
|
+
},
|
|
217
|
+
"database": ".memory/graph/project.lbdb",
|
|
218
|
+
"env": {
|
|
219
|
+
"TOOL_RESULT_CHARS": "6000",
|
|
220
|
+
"READ_CHUNK_MAX_CHARS": "12000",
|
|
221
|
+
"READ_CHUNK_MAX_LINES": "400",
|
|
222
|
+
"GREP_MAX_MATCHES": "50",
|
|
223
|
+
"DEBUG_LEVEL": "2",
|
|
224
|
+
"DEBUG_LOG_FILE": ""
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Configuration sections
|
|
230
|
+
|
|
231
|
+
1. **`project`**:
|
|
232
|
+
- `graph_roots`: folders to index (default `["."]`).
|
|
233
|
+
- `exclude_dirs`: folders ignored during sync, glob and grep.
|
|
234
|
+
- `graph_extensions`: file extensions included in the code graph.
|
|
235
|
+
2. **`graph`**:
|
|
236
|
+
- `ast.enabled`: also store the full JavaScript syntax tree of every file (default `false`). Symbols, calls and functions are extracted either way; the stored tree is about 9× the size of the source and can fill the graph database's buffer on large vendored bundles.
|
|
237
|
+
- `documentation.enabled`: index markdown documents and link frontmatter.
|
|
238
|
+
- `links.enabled`: link import and call relations automatically.
|
|
239
|
+
- `freshness.default_max_age_days`: maximum age before automatic re-indexing.
|
|
240
|
+
3. **`mcp`**:
|
|
241
|
+
- `port`: HTTP/SSE port of the MCP server (default `4318`).
|
|
242
|
+
- `uiPort`: web UI dashboard port (default `4317`).
|
|
243
|
+
4. **`database`**:
|
|
244
|
+
- Path to the LadybugDB database file. If not set, lens uses `~/.lady-lens/repos/<id>/graph.lbdb`.
|
|
245
|
+
5. **`env`**:
|
|
246
|
+
- Sets lens environment variables directly (such as `TOOL_RESULT_CHARS`, `DEBUG_LEVEL`).
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 4. Using it as an npm package
|
|
251
|
+
|
|
252
|
+
Install the package as a dependency from npm (or a `.tgz` built with `npm run pack`, see [section 0](#0-installation-and-setup)):
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
npm install lady-lens
|
|
256
|
+
npm install ..\lady-lens\dist\lady-lens-<version>.tgz # a build from source
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Direct imports (main entry)
|
|
260
|
+
|
|
261
|
+
Every port is available from the root export:
|
|
262
|
+
|
|
263
|
+
```javascript
|
|
264
|
+
import {
|
|
265
|
+
createGraphSync,
|
|
266
|
+
functionViewTool,
|
|
267
|
+
folderViewTool,
|
|
268
|
+
healthTool,
|
|
269
|
+
definedInTool,
|
|
270
|
+
graph_query,
|
|
271
|
+
grep,
|
|
272
|
+
glob,
|
|
273
|
+
read_chunk,
|
|
274
|
+
RESEARCH_TOOLS,
|
|
275
|
+
loadProjectSettingsSync
|
|
276
|
+
} from 'lady-lens';
|
|
277
|
+
|
|
278
|
+
// 1. Read the settings (reads config.json automatically)
|
|
279
|
+
const settings = loadProjectSettingsSync();
|
|
280
|
+
|
|
281
|
+
// 2. Incremental sync of the repository
|
|
282
|
+
const syncResult = await createGraphSync().sync({ mode: 'incremental' });
|
|
283
|
+
console.log(`Graph synced: ${syncResult.nodes} nodes`);
|
|
284
|
+
|
|
285
|
+
// 3. Ask for a function view
|
|
286
|
+
const fnDetails = await functionViewTool({ symbol: 'createGraphSync' });
|
|
287
|
+
console.log('Callers of createGraphSync:', fnDetails.callers);
|
|
288
|
+
|
|
289
|
+
// 4. Inspect code health
|
|
290
|
+
const health = await healthTool({ limit: 5 });
|
|
291
|
+
console.log('Top hotspots:', health.hotspots);
|
|
292
|
+
|
|
293
|
+
// 5. Semantic graph query
|
|
294
|
+
const queryResult = await graph_query({ query: 'database storage' });
|
|
295
|
+
console.log('Nodes found:', queryResult.nodes);
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Modular subpath imports
|
|
299
|
+
|
|
300
|
+
Specialised scenarios can use subpath imports:
|
|
301
|
+
|
|
302
|
+
```javascript
|
|
303
|
+
import { createGraph, createGraphRepository } from 'lady-lens/graph';
|
|
304
|
+
import { RESEARCH_TOOLS, grep, glob } from 'lady-lens/search';
|
|
305
|
+
import { createLadyLensMcpServer, createMcpHttpServer } from 'lady-lens/mcp';
|
|
306
|
+
import { listRegisteredRepos, registerRepo } from 'lady-lens/repository';
|
|
307
|
+
import { createProfiler, globalProfiler } from 'lady-lens/observability';
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 5. Using it as an MCP server
|
|
313
|
+
|
|
314
|
+
Start the background service with the CLI:
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
lens mcp -d
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
This starts:
|
|
321
|
+
- The **Streamable HTTP MCP server** on `http://127.0.0.1:4318/mcp`
|
|
322
|
+
- The legacy **SSE MCP server** on `http://127.0.0.1:4318/sse`
|
|
323
|
+
- The **UI dashboard** on `http://127.0.0.1:4317`
|
|
324
|
+
|
|
325
|
+
### AI assistant configuration
|
|
326
|
+
|
|
327
|
+
Add the server to your MCP configuration file (for example in Antigravity, Claude Desktop, Cursor or VS Code):
|
|
328
|
+
|
|
329
|
+
#### Streamable HTTP mode (recommended)
|
|
330
|
+
```json
|
|
331
|
+
{
|
|
332
|
+
"mcpServers": {
|
|
333
|
+
"lady-lens": {
|
|
334
|
+
"url": "http://127.0.0.1:4318/mcp"
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Use `/sse` only for older clients that do not support Streamable HTTP.
|
|
341
|
+
|
|
342
|
+
### Configuration files through MCP
|
|
343
|
+
|
|
344
|
+
No extra setting in `config.json` is needed. The agent uses these tools:
|
|
345
|
+
|
|
346
|
+
```json
|
|
347
|
+
{
|
|
348
|
+
"name": "config_references",
|
|
349
|
+
"arguments": { "reference": "INVENTORY_OP" }
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
This returns, among other things, `referenceManager.xml`, the line number and the matching text. Use `config_references` for this, not `imports` or `importedBy`.
|
|
354
|
+
|
|
355
|
+
Read the file before changing it. Then pass the complete new content to `config_update`. Use the SHA-256 of the content you read as `expectedHash`; a stale update is refused.
|
|
356
|
+
|
|
357
|
+
```json
|
|
358
|
+
{
|
|
359
|
+
"name": "config_update",
|
|
360
|
+
"arguments": {
|
|
361
|
+
"path": "App/App.csproj",
|
|
362
|
+
"content": "<Project>...</Project>",
|
|
363
|
+
"expectedHash": "<sha256>"
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Supported: `.csproj`, `.sln`, `.props`, `.targets`, `.xml`, `.ini`, `.yaml`, `.yml`, `.toml` and `package.json`. After an update an incremental graph sync runs.
|
|
369
|
+
|
|
370
|
+
### Agent instruction
|
|
371
|
+
|
|
372
|
+
Use this text in the agent chat:
|
|
373
|
+
|
|
374
|
+
> Use Lady Lens MCP. First pick the right repo with `repo` or register it with `lens add`. Use `config_references` for questions like: who references `INVENTORY_OP`? Do not use `imports` or `importedBy`. Then read the config files found. Use `config_update` with the complete new content and `expectedHash`. Do not write directly outside `config_update`.
|
|
375
|
+
|
|
376
|
+
#### One daemon, several projects
|
|
377
|
+
One daemon serves every registered project (`lens add <folder>`). Pick the project per client in the URL:
|
|
378
|
+
|
|
379
|
+
```json
|
|
380
|
+
{ "mcpServers": { "lady-lens": { "url": "http://127.0.0.1:4318/mcp?repo=C:/git/my-project" } } }
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
- `repo` is a registered folder or id; the `X-Lens-Repo` header works too.
|
|
384
|
+
- An unregistered repo is refused (HTTP 403): run `lens add <folder>` first.
|
|
385
|
+
- Without `repo` the folder where `lens mcp -d` was started applies; a tool call can override that with its `repo` argument.
|
|
386
|
+
- Tool calls run one after another, so simultaneous requests for different projects do not affect each other.
|
|
387
|
+
- The UI dashboard that starts with `lens mcp -d` works the same way: `http://127.0.0.1:4317/?repo=<folder or id>` shows that project (not registered: HTTP 403); with more than one registered project a dropdown appears.
|
|
388
|
+
|
|
389
|
+
#### Direct stdio mode
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"mcpServers": {
|
|
393
|
+
"lady-lens": {
|
|
394
|
+
"command": "node",
|
|
395
|
+
"args": ["C:/git/lady-lens/bin/lens.mjs", "mcp", "--stdio"]
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
## 6. CLI command reference
|
|
404
|
+
|
|
405
|
+
The command line interface `lens` gives direct access to every feature:
|
|
406
|
+
|
|
407
|
+
| Command | Description |
|
|
408
|
+
| :--- | :--- |
|
|
409
|
+
| `lens sync [--repo <dir>] [--full] [--debug]` | Sync the graph for the current project or a target folder. `--debug` writes every step (scan, parse, mxcli calls, graph write) with its time, size, memory and any error stack to `~/.lady-lens/logs/sync-<time>.log`. |
|
|
410
|
+
| `lens ask <tool> '<json>'` | Call one of the research tools directly (e.g. `lens ask functionView '{"symbol":"createProfiler"}'`). |
|
|
411
|
+
| `lens mcp [-d]` | Start the MCP server (optionally in the background with `-d`). |
|
|
412
|
+
| `lens stop [pid]` | End the background daemon and release ports and locks, or only the given PID. |
|
|
413
|
+
| `lens ps` | Show the tracked daemon PIDs per folder. |
|
|
414
|
+
| `lens status` | Show whether the background daemon is running. |
|
|
415
|
+
| `lens ui [--port 4317]` | Start the interactive graph visualisation in the browser. The **Stacktrace** tab ties a pasted Node, .NET, Python or Java trace to project files and functions (`POST /api/trace`, `traceView` in `core/search/stackTrace.js`). The four tabs share one place in the URL (Back/Forward, crumbs, copyable link). Under the code: health issues, the function at the line with callers, calls, call tree, tests and documents, the file's imports, and its history (`GET /api/at`, `/api/flow`, `/api/history`; `callFlow`, `toMermaid`, `codeHistory` in `core/search`). Graph Network: the flow diagram of the function with Mermaid export. |
|
|
416
|
+
| `lens list` | Overview of all registered repositories and their database paths. |
|
|
417
|
+
| `lens add <dir>` | Register a new project and run the first sync right away. |
|
|
418
|
+
| `lens remove <id\|dir>` | Remove a repository from the registry. |
|
|
419
|
+
| `lens tools` | Show all available tools with their schemas and parameters. |
|
|
420
|
+
| `lens bench [--repo <dir>] [--runs N] [--baseline] [--no-processes] [--json]` | Time the sync (with its phases) and every question on a repository, in a temporary database: the registry and the repository's own database stay as they are. Saves the run in `~/.lady-lens/bench/<repo id>/` (numbers and environment, no paths or code) and compares it with the baseline there; `lens bench compare` compares the newest run again. See README, Performance. |
|
|
421
|
+
| `lens install [agent...]` | Install the MCP stdio configuration in detected agents. |
|
|
422
|
+
| `lens install --skill` | Install the Lady-lens workflow skill, write `~/.lady-lens/lens-instructions.md`, and add one marked line pointing to it in `~/.claude/CLAUDE.md`, `~/.copilot/copilot-instructions.md`, `~/.codex/AGENTS.md` and `~/.vibe/AGENTS.md`; own rules files for VS Code and Antigravity. |
|
|
423
|
+
| `lens install --hooks` | Install non-blocking Git hooks (`post-commit`, `post-checkout`, `post-merge`, `post-rewrite`) in `.git/hooks` for bundled background daemon sync (`POST /sync?repo=...`). `LENS_HOOKS=0` disables. |
|
|
424
|
+
| `lens uninstall [agent...]` | Remove the MCP entry from the agents. |
|
|
425
|
+
| `lens uninstall --skill` | Remove the skill, the marked line and the two rules files. |
|
|
426
|
+
| `lens uninstall --hooks` | Remove lady-lens hook blocks from `.git/hooks`, leaving other hook content intact. |
|
|
427
|
+
| `lens install --mendix` | Install the `lady-lens-mendix` skill in the detected Claude, Copilot and Agents skill directories: search Mendix pages, widgets and flows in `.mxcli/mdl` (written from mxcli's catalog by a background export that `lens sync` starts after a model change; it never holds up the sync or MCP calls: `LENS_MDL_EXPORT=background|inline|off`, state in `.mxcli/lens-mdl.json`), change them with `mxcli`. Every other mxcli call stops after `LENS_MXCLI_TIMEOUT_MS` (default 120000); when mxcli gives nothing, the previous Mendix model is kept. `lens uninstall --mendix` removes it. |
|
|
428
|
+
| `lens update [<version or file.tgz>]` | Update lady-lens: stop every lens process (on Windows they keep the graph database module open and npm cannot replace it), `npm install -g` the newest version (or the given version or local tgz), then let the new lens re-register itself where it was registered and copy again the skills and policies that are installed (`lens install --refresh`), and start the daemon again if it ran. Reconnect your agents afterwards. `lens install skill`, `lens install skill-mendix` and agent names (`vscode`, `claude-code`) work as well as `--skill` / `--mendix`. |
|
|
429
|
+
| `lens node [<path to node.exe> or --clear]` | Run lens on another Node than the one on PATH, e.g. Node 22.13+ for the Mendix MDL export while nvm keeps Node 18 for your projects. The choice is kept in `~/.lady-lens/lens.json`, so it holds at once, in every terminal and for agents started from the desktop (unlike `setx`, which only reaches terminals started later). It stops lens, re-registers the agents with that Node (`lens install --refresh`) and starts the daemon again if it ran. `lens node` shows the choice, `--clear` undoes it. `LENS_NODE` overrides the file. |
|
|
430
|
+
| `lens v` / `lens version` | Show the installed package version. |
|
|
431
|
+
| `.\scripts\update-lens.ps1 [-Pack] [-Source <source>]` | Older script for a build from source; `lens update <file.tgz>` does the same and also refreshes the agents and skills. |
|