lady-lens 1.2.0 → 1.6.11
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 +43 -23
- package/README.md +82 -34
- package/bin/lens.mjs +126 -110
- package/core/bench/budget.js +31 -0
- package/core/bench/command.js +59 -0
- package/core/bench/compare.js +50 -0
- package/core/bench/environment.js +29 -0
- package/core/bench/index.js +11 -0
- package/core/bench/measure.js +49 -0
- package/core/bench/operations.js +63 -0
- package/core/bench/processTimes.js +49 -0
- package/core/bench/report.js +35 -0
- package/core/bench/runBench.js +120 -0
- package/core/bench/scaleRepo.js +78 -0
- package/core/bench/store.js +31 -0
- package/core/branches/branchDiff.js +4 -10
- package/core/branches/branchImpact.js +9 -4
- package/core/branches/changedFunctions.js +68 -65
- package/core/branches/compare.js +37 -22
- package/core/branches/readSources.js +23 -0
- package/core/configuration/frontmatter.js +97 -132
- package/core/configuration/index.js +2 -1
- package/core/configuration/toolLimits.js +40 -0
- package/core/{mcp → daemon}/daemon.js +200 -191
- package/core/daemon/index.js +20 -0
- package/core/daemonCall/index.js +64 -0
- package/core/discussions/mcp/discussionTools.js +170 -164
- package/core/discussions/model/nodes.js +142 -151
- package/core/discussions/storage/markdownExtractor.js +33 -38
- package/core/eval/graphEval.js +172 -163
- package/core/git/fakeGit.js +143 -130
- package/core/git/index.js +164 -116
- package/core/graph/adapters/ladybug/configIndexer.js +107 -109
- package/core/graph/adapters/ladybug/directQueries.js +161 -164
- package/core/graph/adapters/ladybug/index.js +30 -28
- package/core/graph/adapters/ladybug/ladybugGraphStore.js +178 -181
- package/core/graph/adapters/ladybug/ladybugIndexer.js +89 -71
- package/core/graph/adapters/ladybug/ladybugMarkdownIndexer.js +105 -105
- package/core/graph/adapters/ladybug/projectWriteQueries.js +41 -13
- package/core/graph/adapters/ladybug/repositoryStore.js +26 -26
- package/core/graph/adapters/ladybug/writeBatches.js +54 -0
- package/core/graph/adapters/memory/directQueries.js +184 -178
- package/core/graph/adapters/memory/repositoryStore.js +149 -128
- package/core/graph/model/graphEdges.js +77 -0
- package/core/graph/model/graphLookup.js +32 -0
- package/core/graph/model/graphModel.js +175 -209
- package/core/graph/model/graphRows.js +109 -61
- package/core/graph/model/graphValidation.js +67 -69
- package/core/graph/query/answerNode.js +27 -0
- package/core/graph/query/architectureMetrics.js +165 -126
- package/core/graph/query/codeHealth.js +188 -177
- package/core/graph/query/docComment.js +60 -0
- package/core/graph/query/folderParts.js +79 -0
- package/core/graph/query/folderPredicates.js +89 -0
- package/core/graph/query/folderView.js +161 -171
- package/core/graph/query/folderViewRender.js +129 -0
- package/core/graph/query/functionView.js +200 -175
- package/core/graph/query/graphContext.js +109 -99
- package/core/graph/query/graphQuery.js +160 -233
- package/core/graph/query/graphRank.js +155 -177
- package/core/graph/query/graphSemantic.js +228 -238
- package/core/graph/query/healthIssues.js +161 -0
- package/core/graph/query/hubsAndBridges.js +81 -63
- package/core/graph/query/impact.js +187 -161
- package/core/graph/query/importCycles.js +94 -62
- package/core/graph/query/importLookup.js +185 -221
- package/core/graph/query/index.js +13 -11
- package/core/graph/query/queryFreshness.js +47 -0
- package/core/graph/query/questionIntent.js +117 -0
- package/core/graph/query/rankCorrections.js +85 -0
- package/core/graph/query/rankTokens.js +59 -0
- package/core/graph/query/searchIndex.js +69 -0
- package/core/graph/query/statePlaces.js +90 -0
- package/core/graph/repository/graphRepository.js +128 -125
- package/core/graph/repository/projectGraphGate.js +104 -83
- package/core/graph/sync/codeFacts.js +81 -109
- package/core/graph/sync/commentWords.js +12 -0
- package/core/graph/sync/contributors.js +24 -7
- package/core/graph/sync/designSmellAdvice.js +20 -0
- package/core/graph/sync/designSmells.js +3 -0
- package/core/graph/sync/documentRelations.js +133 -81
- package/core/graph/sync/fileEntity.js +7 -2
- package/core/graph/sync/filePurpose.js +37 -0
- package/core/graph/sync/fileSmells.js +137 -0
- package/core/graph/sync/functionComplexity.js +193 -106
- package/core/graph/sync/functionSmells.js +166 -0
- package/core/graph/sync/gitHistory.js +59 -11
- package/core/graph/sync/graphSync.js +200 -181
- package/core/graph/sync/headCommit.js +48 -36
- package/core/graph/sync/index.js +5 -3
- package/core/graph/sync/languages/blocks.js +10 -8
- package/core/graph/sync/languages/docker.js +118 -107
- package/core/graph/sync/languages/engine.js +193 -185
- package/core/graph/sync/languages/index.js +3 -1
- package/core/graph/sync/languages/infra.js +139 -91
- package/core/graph/sync/languages/jsonConfig.js +73 -0
- package/core/graph/sync/languages/terraformConfig.js +66 -0
- package/core/graph/sync/languages/tomlConfig.js +54 -0
- package/core/graph/sync/languages/web.js +133 -141
- package/core/graph/sync/mendix.js +97 -124
- package/core/graph/sync/mendixExport.js +127 -0
- package/core/graph/sync/mxcli.js +54 -0
- package/core/graph/sync/projectRelations.js +136 -43
- package/core/language/fuzzy.js +57 -51
- package/core/language/lexicon.js +103 -79
- package/core/language/lexiconValidation.js +71 -46
- package/core/mcp/agentInstall.js +192 -156
- package/core/mcp/handlers/branchDiff.js +6 -0
- package/core/mcp/handlers/config.js +4 -3
- package/core/mcp/handlers/index.js +2 -2
- package/core/mcp/handlers/repoSync.js +12 -5
- package/core/mcp/httpServer.js +153 -278
- package/core/mcp/index.js +2 -2
- package/core/mcp/managementSchemas.js +193 -191
- package/core/mcp/mcpDashboard.html +171 -0
- package/core/mcp/mcpToolRow.html +1 -0
- package/core/mcp/mendixSchemas.js +19 -0
- package/core/mcp/policyInstall.js +84 -77
- package/core/mcp/server.js +141 -130
- package/core/mcp/streamableHttp.js +34 -31
- package/core/mcp/toolRoutes.js +34 -33
- package/core/mendix/bson.js +71 -0
- package/core/mendix/elementDiff.js +92 -0
- package/core/mendix/flows.js +83 -0
- package/core/mendix/index.js +6 -0
- package/core/mendix/mendixDiff.js +107 -0
- package/core/mendix/modelReader.js +90 -0
- package/core/observability/debugLog.js +52 -23
- package/core/observability/index.js +3 -2
- package/core/observability/profiler.js +5 -1
- package/core/observability/tracing.js +124 -0
- package/core/repository/gitignoreRules.js +96 -0
- package/core/repository/index.js +18 -16
- package/core/repository/projectScanner.js +66 -62
- package/core/repository/projectSettings.js +22 -7
- package/core/repository/registry.js +152 -138
- package/core/search/budget.js +98 -17
- package/core/search/callFlow.js +137 -0
- package/core/search/chunkReader.js +198 -139
- package/core/search/codeHealth.js +67 -68
- package/core/search/codeHistory.js +32 -0
- package/core/search/diffImpact.js +72 -58
- package/core/search/graphModelLoader.js +26 -23
- package/core/search/graphQuery.js +199 -84
- package/core/search/graphQueryArgs.js +33 -0
- package/core/search/grepSearch.js +178 -122
- package/core/search/index.js +133 -116
- package/core/search/queryFlow.js +101 -85
- package/core/search/queryPlaces.js +21 -0
- package/core/search/schemas.js +135 -122
- package/core/search/searchView.js +109 -95
- package/core/search/stackTrace.js +116 -0
- package/core/search/toolLimit.js +41 -0
- package/core/update/index.js +3 -0
- package/core/update/lensNode.js +41 -0
- package/core/update/lensUpdate.js +47 -0
- package/index.js +93 -90
- package/package.json +105 -102
- package/skills/lady-lens/SKILL.md +29 -28
- package/skills/lady-lens/lens-instructions.md +14 -11
- package/skills/lady-lens-mendix/SKILL.md +53 -40
- package/ui/graph-ui-context.html +84 -0
- package/ui/graph-ui-graph.html +87 -0
- package/ui/graph-ui-health.html +27 -0
- package/ui/graph-ui-nav.html +54 -0
- package/ui/graph-ui-trace.html +65 -0
- package/ui/graph-ui.css +163 -122
- package/ui/graph-ui.html +178 -200
- package/ui/graph-ui.mjs +162 -73
package/DOCUMENTATIE.md
CHANGED
|
@@ -6,19 +6,16 @@ Full guide to architecture, API ports, MCP integration, npm package use and conf
|
|
|
6
6
|
|
|
7
7
|
## 0. Installation and setup
|
|
8
8
|
|
|
9
|
-
Requires Node.js 18 or newer
|
|
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
10
|
|
|
11
11
|
**Step 1: install**
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
|
|
15
|
-
npm install # dependencies of lady-lens itself
|
|
16
|
-
npm run pack # builds dist\lady-lens-<version>.tgz
|
|
17
|
-
npm install -g .\dist\lady-lens-<version>.tgz
|
|
14
|
+
npm install -g lady-lens # from npmjs.org
|
|
18
15
|
lens v # prints the version: `lens` is now on your PATH
|
|
19
16
|
```
|
|
20
17
|
|
|
21
|
-
|
|
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.
|
|
22
19
|
|
|
23
20
|
**Step 2: register a project and index it**
|
|
24
21
|
|
|
@@ -33,6 +30,7 @@ lens sync # later: incremental sync (--full = everything
|
|
|
33
30
|
```bash
|
|
34
31
|
lens install # every agent found; or one: lens install vscode
|
|
35
32
|
lens install --skill # also the Lady-lens workflow skill
|
|
33
|
+
lens install --mendix # the Mendix skill; or for some agents: lens install skill-mendix vscode claude-code
|
|
36
34
|
lens install --dry-run # shows what would change, writes nothing
|
|
37
35
|
```
|
|
38
36
|
|
|
@@ -57,15 +55,32 @@ See [section 5](#5-using-it-as-an-mcp-server) for several projects per daemon an
|
|
|
57
55
|
|
|
58
56
|
**Step 5: update**
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
```bash
|
|
59
|
+
lens update # the newest version from npm
|
|
60
|
+
lens update 1.2.8 # a given version
|
|
61
|
+
lens update C:\path\lady-lens-1.2.8.tgz # a package file: a machine without npm access, or a build from source
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
In order, `lens update`:
|
|
65
|
+
|
|
66
|
+
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`);
|
|
67
|
+
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;
|
|
68
|
+
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;
|
|
69
|
+
4. starts the daemon again if it ran.
|
|
70
|
+
|
|
71
|
+
Reconnect the MCP server in your agents afterwards (Claude Code: `/mcp`; VS Code: restart the server), so they start the new version.
|
|
61
72
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
**Step 6: another Node for lens**
|
|
74
|
+
|
|
75
|
+
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:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
lens node "C:\Program Files\nodejs\node.exe" # lens, its daemon and the agent registrations now run on that Node
|
|
79
|
+
lens node # which Node lens runs on
|
|
80
|
+
lens node --clear # back to the Node on PATH
|
|
66
81
|
```
|
|
67
82
|
|
|
68
|
-
The
|
|
83
|
+
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.
|
|
69
84
|
|
|
70
85
|
---
|
|
71
86
|
|
|
@@ -95,7 +110,7 @@ The library sync API is `createGraphSync().sync({ mode: 'incremental' })`; use `
|
|
|
95
110
|
| :--- | :--- | :--- | :--- |
|
|
96
111
|
| **Function analysis** | `functionView` | `functionView(graph, symbol, { readFile, maxSites })` / `functionViewTool(args)` | Definition, line numbers, docstring/purpose, 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). |
|
|
97
112
|
| **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). |
|
|
98
|
-
| **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) and zone of pain. On request `hubs` (most neighbours) and `bridges` (betweenness), each with `total` and `truncated` (`hubsAndBridges(graph, opts)`). |
|
|
113
|
+
| **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)`). |
|
|
99
114
|
| **Symbol location** | `definedIn` | `definedIn(graph, symbol)` / `definedInTool(args)` | Where an identifier is defined or exported: file path and exact start/end lines. |
|
|
100
115
|
| **Imports** | `imports` | `importsOf(graph, file)` / `imports(args)` | Which files and modules a given file imports directly. |
|
|
101
116
|
| **Dependents** | `importedBy` | `importersOf(graph, file)` / `importedBy(args)` | Which files import the given file (fan-in analysis). |
|
|
@@ -113,6 +128,7 @@ The library sync API is `createGraphSync().sync({ mode: 'incremental' })`; use `
|
|
|
113
128
|
| **Multi-repo management** | `repo_list`, `repo_add`, `repo_remove` | `registerRepo`, `unregisterRepo`, `listRegisteredRepos` | Manages several projects in the central Ladybug database registry. |
|
|
114
129
|
| **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. |
|
|
115
130
|
| **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. |
|
|
131
|
+
| **Mendix model difference** | `mendix_diff` | `mendixDiff({ from, to, root })` | The Mendix model changes `to` brings since its merge-base with `from`, read from git without a checkout or mxcli, for a single-file `.mpr` (MPR v1, documents compared by `ContentsHash`) and for `mprcontents/` (MPR v2, the `.mxunit` files git reports). Returns `commits` (sha, date, author, subject), `files`, and `documents`: per document `module`, `folders`, `name`, `qualifiedName`, `type` and `change`; for a modified one `elements` (added, deleted, modified; `type`, `name`, `detail` such as `NanoflowCallAction: Module.Flow`, and `properties` as `{ path, before, after }` with paths like `Action > ParameterMappings`; a pointer shows as `{ element }`); for a microflow or nanoflow `flow.before` / `flow.after` with `nodes` (`summary`, `status`) and `edges` (`from`, `to`, `cases`, `status`). Needs Node 22.13+ (`lens node`). |
|
|
116
132
|
| **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`. |
|
|
117
133
|
| **Search over projects** | `cross_repo_search` | `crossRepoSearch(args)` | `searchView` over every registered project or `repos: [...]`, project after project; unregistered names in `unknown`. |
|
|
118
134
|
| **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. |
|
|
@@ -181,7 +197,7 @@ All `lady-lens` settings can be set in one central **`config.json`** file in the
|
|
|
181
197
|
},
|
|
182
198
|
"graph": {
|
|
183
199
|
"ast": {
|
|
184
|
-
"enabled":
|
|
200
|
+
"enabled": false
|
|
185
201
|
},
|
|
186
202
|
"documentation": {
|
|
187
203
|
"enabled": true
|
|
@@ -216,7 +232,7 @@ All `lady-lens` settings can be set in one central **`config.json`** file in the
|
|
|
216
232
|
- `exclude_dirs`: folders ignored during sync, glob and grep.
|
|
217
233
|
- `graph_extensions`: file extensions included in the code graph.
|
|
218
234
|
2. **`graph`**:
|
|
219
|
-
- `ast.enabled`:
|
|
235
|
+
- `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.
|
|
220
236
|
- `documentation.enabled`: index markdown documents and link frontmatter.
|
|
221
237
|
- `links.enabled`: link import and call relations automatically.
|
|
222
238
|
- `freshness.default_max_age_days`: maximum age before automatic re-indexing.
|
|
@@ -232,10 +248,11 @@ All `lady-lens` settings can be set in one central **`config.json`** file in the
|
|
|
232
248
|
|
|
233
249
|
## 4. Using it as an npm package
|
|
234
250
|
|
|
235
|
-
Install the package
|
|
251
|
+
Install the package as a dependency from npm (or a `.tgz` built with `npm run pack`, see [section 0](#0-installation-and-setup)):
|
|
236
252
|
|
|
237
253
|
```bash
|
|
238
|
-
npm install
|
|
254
|
+
npm install lady-lens
|
|
255
|
+
npm install ..\lady-lens\dist\lady-lens-<version>.tgz # a build from source
|
|
239
256
|
```
|
|
240
257
|
|
|
241
258
|
### Direct imports (main entry)
|
|
@@ -328,7 +345,7 @@ No extra setting in `config.json` is needed. The agent uses these tools:
|
|
|
328
345
|
```json
|
|
329
346
|
{
|
|
330
347
|
"name": "config_references",
|
|
331
|
-
"arguments": { "reference": "
|
|
348
|
+
"arguments": { "reference": "INVENTORY_OP" }
|
|
332
349
|
}
|
|
333
350
|
```
|
|
334
351
|
|
|
@@ -353,7 +370,7 @@ Supported: `.csproj`, `.sln`, `.props`, `.targets`, `.xml`, `.ini`, `.yaml`, `.y
|
|
|
353
370
|
|
|
354
371
|
Use this text in the agent chat:
|
|
355
372
|
|
|
356
|
-
> 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 `
|
|
373
|
+
> 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`.
|
|
357
374
|
|
|
358
375
|
#### One daemon, several projects
|
|
359
376
|
One daemon serves every registered project (`lens add <folder>`). Pick the project per client in the URL:
|
|
@@ -388,21 +405,24 @@ The command line interface `lens` gives direct access to every feature:
|
|
|
388
405
|
|
|
389
406
|
| Command | Description |
|
|
390
407
|
| :--- | :--- |
|
|
391
|
-
| `lens sync [--repo <dir>] [--full]` | Sync the graph for the current project or a target folder. |
|
|
408
|
+
| `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`. |
|
|
392
409
|
| `lens ask <tool> '<json>'` | Call one of the research tools directly (e.g. `lens ask functionView '{"symbol":"createProfiler"}'`). |
|
|
393
410
|
| `lens mcp [-d]` | Start the MCP server (optionally in the background with `-d`). |
|
|
394
411
|
| `lens stop [pid]` | End the background daemon and release ports and locks, or only the given PID. |
|
|
395
412
|
| `lens ps` | Show the tracked daemon PIDs per folder. |
|
|
396
413
|
| `lens status` | Show whether the background daemon is running. |
|
|
397
|
-
| `lens ui [--port 4317]` | Start the interactive graph visualisation in the browser. |
|
|
414
|
+
| `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. |
|
|
398
415
|
| `lens list` | Overview of all registered repositories and their database paths. |
|
|
399
416
|
| `lens add <dir>` | Register a new project and run the first sync right away. |
|
|
400
417
|
| `lens remove <id\|dir>` | Remove a repository from the registry. |
|
|
401
418
|
| `lens tools` | Show all available tools with their schemas and parameters. |
|
|
419
|
+
| `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. |
|
|
402
420
|
| `lens install [agent...]` | Install the MCP stdio configuration in detected agents. |
|
|
403
421
|
| `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. |
|
|
404
422
|
| `lens uninstall [agent...]` | Remove the MCP entry from the agents. |
|
|
405
423
|
| `lens uninstall --skill` | Remove the skill, the marked line and the two rules files. |
|
|
406
|
-
| `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 by `lens sync`
|
|
424
|
+
| `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. |
|
|
425
|
+
| `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`. |
|
|
426
|
+
| `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. |
|
|
407
427
|
| `lens v` / `lens version` | Show the installed package version. |
|
|
408
|
-
| `.\scripts\update-lens.ps1 [-Pack] [-Source <source>]` |
|
|
428
|
+
| `.\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. |
|
package/README.md
CHANGED
|
@@ -10,19 +10,16 @@ lady-lens grew inside the build of our own coding agent, Kura. We used it there
|
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
13
|
-
Needs Node.js 18 or newer. Run these steps once, in order.
|
|
13
|
+
Needs Node.js 18 or newer; the Mendix MDL export needs 22.13 or newer (see [Another Node for lens](#another-node-for-lens)). Run these steps once, in order.
|
|
14
14
|
|
|
15
|
-
**1. Install lady-lens**
|
|
15
|
+
**1. Install lady-lens** from npm:
|
|
16
16
|
|
|
17
17
|
```
|
|
18
|
-
|
|
19
|
-
npm install # dependencies of lady-lens itself
|
|
20
|
-
npm run pack # builds dist\lady-lens-<version>.tgz
|
|
21
|
-
npm install -g .\dist\lady-lens-<version>.tgz
|
|
18
|
+
npm install -g lady-lens
|
|
22
19
|
lens v # prints the version: `lens` is on your PATH
|
|
23
20
|
```
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
From source instead (development, or a version that is not published yet): run `npm install` and `npm run pack` in this folder, which builds `dist\lady-lens-<version>.tgz`, and install that with `npm install -g .\dist\lady-lens-<version>.tgz` (later: `lens update .\dist\lady-lens-<version>.tgz`). `npm link` makes `lens` run straight from this folder.
|
|
26
23
|
|
|
27
24
|
**2. Register your repository and index it:**
|
|
28
25
|
|
|
@@ -37,6 +34,7 @@ lens list # check that it is there
|
|
|
37
34
|
lens install # MCP entry (stdio) in every agent found; or name one: lens install vscode
|
|
38
35
|
lens install --skill # the Lady-lens workflow skill for those agents
|
|
39
36
|
lens install --mendix # the Mendix skill (search .mpr content via .mxcli/mdl, change it with mxcli)
|
|
37
|
+
lens install skill-mendix vscode claude-code # the same, only for those agents
|
|
40
38
|
```
|
|
41
39
|
|
|
42
40
|
`lens install --dry-run` shows what would change and writes nothing. Restart the agent afterwards (in VS Code: *MCP: List Servers* or reload the window).
|
|
@@ -51,17 +49,32 @@ lens stop # stop it
|
|
|
51
49
|
|
|
52
50
|
In VS Code add it to `mcp.json` as `{ "servers": { "lady-lens": { "type": "http", "url": "http://127.0.0.1:4318/mcp?repo=C:/git/my-project" } } }`. See [MCP Configuration](#mcp-configuration-model-context-protocol) for the other agents.
|
|
53
51
|
|
|
54
|
-
**5. Update later** with one command:
|
|
52
|
+
**5. Update later** with one command:
|
|
55
53
|
|
|
56
54
|
```
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
lens update # the newest version from npm
|
|
56
|
+
lens update 1.2.8 # a given version
|
|
57
|
+
lens update C:\path\lady-lens-1.2.8.tgz # a package file (a machine without npm access, or a build from source)
|
|
59
58
|
```
|
|
60
59
|
|
|
60
|
+
`lens update` stops every lens process (on Windows a running lens keeps the graph database module open, and npm cannot replace it), installs the package, lets the new lens re-register itself in the agents where it was registered and copy the installed skills and instruction files again (`lens install --refresh`: the `SKILL.md` files and `~/.lady-lens/lens-instructions.md`; your own `CLAUDE.md` or `AGENTS.md` only holds a link to it), and starts the daemon again if it ran. It adds nothing you did not install. Reconnect your agents afterwards (Claude Code: `/mcp`).
|
|
61
|
+
|
|
62
|
+
### Another Node for lens
|
|
63
|
+
|
|
64
|
+
The Mendix MDL export needs Node 22.13 or newer (`node:sqlite`). 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:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
lens node "C:\Program Files\nodejs\node.exe" # lens, its daemon and the agent registrations now run on that Node
|
|
68
|
+
lens node # which Node lens runs on
|
|
69
|
+
lens node --clear # back to the Node on PATH
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The choice is kept in `~/.lady-lens/lens.json`: it holds at once, in every terminal and for agents started from the desktop (`setx` only reaches terminals started later). The package stays where npm installed it. Ladybug's native module works on every Node version.
|
|
73
|
+
|
|
61
74
|
## Use
|
|
62
75
|
|
|
63
76
|
```
|
|
64
|
-
lens sync # index this repo (incremental; --full re-indexes everything)
|
|
77
|
+
lens sync # index this repo (incremental; --full re-indexes everything; --debug logs every step to ~/.lady-lens/logs)
|
|
65
78
|
lens mcp # MCP server (Streamable HTTP on /mcp, UI dashboard on 4317)
|
|
66
79
|
lens mcp -d # run MCP + UI in background (detached)
|
|
67
80
|
lens stop # stop background lady-lens daemon
|
|
@@ -71,17 +84,30 @@ lens ask functionView '{"symbol":"createGraphSync"}'
|
|
|
71
84
|
lens ask importedBy '{"file":"core/graph/index.js"}'
|
|
72
85
|
lens ask graph_query '{"query":"plan review"}'
|
|
73
86
|
lens ask graph_query '{"query":"plan review","kind":"doc"}' # only the documentation
|
|
74
|
-
lens ui # http://127.0.0.1:4317: search, nodes coloured per type, code and docs
|
|
87
|
+
lens ui # http://127.0.0.1:4317: search, stack trace, nodes coloured per type, code and docs
|
|
75
88
|
lens list # every repo lens knows
|
|
76
89
|
lens add <dir> # register a repository and sync
|
|
77
90
|
lens remove <id|dir> # unregister a repository
|
|
78
91
|
lens tools # every question and what it answers
|
|
79
92
|
```
|
|
80
93
|
|
|
94
|
+
When the daemon runs (`lens mcp -d`), `lens ask` for a registered repository goes through it: the daemon has lady-lens and the graph loaded, so a question costs one HTTP call (about 0.4 s instead of about 1 s). Without a daemon, for a repository it does not serve, or with `--db`, `lens ask` runs the tool itself.
|
|
95
|
+
|
|
81
96
|
`--repo <dir>` asks about another repo than the current folder; `lens ui --port 5000` picks another port.
|
|
82
97
|
|
|
98
|
+
The four tabs of the dashboard are one whole: there is one place (tab, file, line) for the page, kept in the URL (`#tab=…&path=…&line=…`), so the browser's Back/Forward, the ◀ ▶ buttons and the crumbs under the tabs step through where you were, and a copied link opens the same place. Every file or function in any tab is a link to it.
|
|
99
|
+
|
|
100
|
+
- **Search & Explorer**: the code with the line you went to; functions with health issues are marked ⚠ in the gutter, the file's and the function's issues stand above the code. Under it: the function at the line (purpose, callers, calls, a call tree that opens per level with a chosen depth, tests, the documents that name it), the file's imports both ways, and, loaded last, its history: the commits that changed the function (else the file), who changed it last, the files that usually change with it, and a hotspot sign (commits × lines in the project's top 10).
|
|
101
|
+
- **Graph Network**: at a function, the flow diagram of its call chain (callers left, callees right, depth and direction to choose); a click on a function goes there, **Mermaid** shows and copies the text for a document or ticket. At a file or without a place: the overview of files.
|
|
102
|
+
- **Architecture & Health**: every file and function opens its code, a function name its flow diagram.
|
|
103
|
+
- **Stacktrace**: see below; a frame opens its code or its flow diagram, where the frames of the trace are marked.
|
|
104
|
+
|
|
105
|
+
In the dashboard's **Stacktrace** tab you paste a Node, .NET, Python or Java stack trace: each frame shows its file, line, function and the code around the line. Paths from another machine (`C:\build\...`, `/home/ci/...`) match the project file with the longest equal tail of folders; several equal matches let you choose, no match says "niet gevonden", library frames (`node_modules`, `site-packages`, frames without a file) are folded away. The page posts the trace to `POST /api/trace` (follows `?repo=`).
|
|
106
|
+
|
|
83
107
|
## Questions
|
|
84
108
|
|
|
109
|
+
Every tool that returns a list takes `limit`: how many items its main list holds (`graph_query` 20 nodes, `grep` 50 matches, `glob` 200 paths, `importedBy`/`imports`/`exports` 200, `searchView` 100, `diff_impact` 50, `definedIn` 50, `folderView` 40 parts, `functionView` 20 callers, tests and stories, `health` 20 per list, `discussion_query` 10). Without `limit` the default holds; the setting `LENS_<TOOL>_LIMIT` (`LENS_GRAPH_QUERY_LIMIT`, `LENS_IMPORTED_BY_LIMIT`, or `env` in the lens configuration of a repository) changes it. A cut list says so in `truncated` and `limited`. The context budget still caps the whole answer.
|
|
110
|
+
|
|
85
111
|
| Tool | Answers |
|
|
86
112
|
|---|---|
|
|
87
113
|
| `definedIn` | where a function or name is defined, with lines |
|
|
@@ -91,13 +117,14 @@ lens tools # every question and what it answers
|
|
|
91
117
|
| `exports` | what a file exports |
|
|
92
118
|
| `exists` | whether a file exists, and where a file with that name does |
|
|
93
119
|
| `cross_repo_search` | one search over all registered projects, or `repos: [...]`; results per project, unregistered names in `unknown` |
|
|
94
|
-
| `graph_query` | files about a subject; `kind: "doc"` only documentation (for a file path: the documents that name it first, `mentions` and `lines`); `history: true` also superseded decisions; a `node` gets its `consequences` and `risks`, and a one-hop answer says `total` and `truncated` |
|
|
120
|
+
| `graph_query` | files about a subject, 20 candidates by default for a caller or its model to choose from (over the context budget edges, `context` and `provenance` go first, and candidates after the first become `path`, `purpose` and a few `exports`); `kind: "doc"` only documentation (for a file path: the documents that name it first, `mentions` and `lines`); `history: true` also superseded decisions; a `node` gets its `consequences` and `risks`, and a one-hop answer says `total` and `truncated` |
|
|
95
121
|
| `grep`, `glob`, `read_chunk` | text search, paths, and lines of a file, with the same exclusions as the graph |
|
|
96
122
|
| `config_grep` | config-only search, including `.csproj` and reference-manager XML |
|
|
97
123
|
| `config_references` | find which config files reference a package, project, or functional block by name |
|
|
98
124
|
| `config_update` | safely replace one config file and refresh its graph facts; supports `expectedHash` |
|
|
99
125
|
| `repo_sync` | index the repository; records the branch and commit and reports `commitsSince`; `branch: "<name>"` indexes another branch into its own scope `branch:<name>` without checking it out |
|
|
100
126
|
| `branch_diff` | what branch `to` changes since its merge-base with `from`: files and functions added, removed, modified, renamed, plus changed import and call relations |
|
|
127
|
+
| `mendix_diff` | Mendix model changes of a branch, read from git (no checkout, no mxcli; old single-file .mpr and mprcontents/): commits, changed documents with module, folder, name and type, every added, deleted or modified element with each property before and after, and for a microflow or nanoflow the flow graph before and after with a status per node and sequence flow. Data for a client that shows it (an extension); needs Node 22.13+ (`lens node`) |
|
|
101
128
|
| `branch_impact` | what a change on one branch (e.g. a bugfix on `release`) means for another: functions still used there, overlap, shared files, text merge conflicts |
|
|
102
129
|
| `commit_show` | what one commit changed (files and functions against its first parent) |
|
|
103
130
|
| `function_history` | the commits that added, modified or removed one function; without `name` every commit that touched the file |
|
|
@@ -113,6 +140,7 @@ Compare before you merge:
|
|
|
113
140
|
branch_diff { "from": "main", "to": "feature-x" }
|
|
114
141
|
branch_impact { "change": "release", "against": "feature-x" }
|
|
115
142
|
commit_show { "commit": "263e4279" }
|
|
143
|
+
mendix_diff { "from": "main", "to": "bugfix/1234-wrong-proposed-destination" }
|
|
116
144
|
diff_impact { } # the work not committed yet
|
|
117
145
|
diff_impact { "from": "main" } # this branch since it left main
|
|
118
146
|
function_history { "name": "createGraphSync", "file": "core/graph/sync/graphSync.js" }
|
|
@@ -128,7 +156,7 @@ lady-lens can be used by AI coding assistants (Antigravity, Cursor, Claude Deskt
|
|
|
128
156
|
|
|
129
157
|
```bash
|
|
130
158
|
lens install # every agent found on this machine
|
|
131
|
-
lens install cursor vscode # or name them: claude-code, claude-desktop, cursor, windsurf, gemini-cli, antigravity, vscode, codex, vibe
|
|
159
|
+
lens install cursor vscode # or name them: claude-code, claude-desktop, cursor, windsurf, gemini-cli, antigravity, antigravity-cli, vscode, codex, vibe
|
|
132
160
|
lens install --dry-run # show what would change, write nothing
|
|
133
161
|
lens install --skill # install the Lady-lens workflow skill for detected agents
|
|
134
162
|
lens install --skill --dry-run
|
|
@@ -210,6 +238,7 @@ If you prefer the agent to spawn lady-lens directly on demand:
|
|
|
210
238
|
|
|
211
239
|
### Client Config Locations:
|
|
212
240
|
- **Google Antigravity**: `%USERPROFILE%\.gemini\antigravity\mcp_config.json`
|
|
241
|
+
- **Antigravity CLI**: `%USERPROFILE%\.gemini\config\mcp_config.json`. It takes stdio or Streamable HTTP (`/mcp`) only; an `/sse` url does not work there. `lens install antigravity-cli` writes a stdio entry: no daemon, no port, and no loopback call that the agent's sandbox might block.
|
|
213
242
|
- **Gemini CLI**: `%USERPROFILE%\.gemini\settings.json`
|
|
214
243
|
- **Claude Code**: `%USERPROFILE%\.claude.json`
|
|
215
244
|
- **Windsurf**: `%USERPROFILE%\.codeium\windsurf\mcp_config.json`
|
|
@@ -226,7 +255,7 @@ In the two TOML files `lens install` appends a block whose every line ends in `#
|
|
|
226
255
|
|
|
227
256
|
One Ladybug database per repository in `~/.lady-lens/repos/<id>/graph.lbdb` (`<id>` = a short hash of the repo path), and a list of every repo in `~/.lady-lens/repos.json`. Nothing is written into the repository itself.
|
|
228
257
|
|
|
229
|
-
What is indexed: `.
|
|
258
|
+
What is indexed: source files of every language lens parses (JavaScript, TypeScript, C#, Python, Java, Go, Rust, PHP, Ruby, Kotlin, Swift, C and C++), `.md`, `.sql`, `.ps1` and configuration (`.json`, `.yaml`, `.csproj`, `.sln`), minus `node_modules`, `.git`, `outputs`, `coverage`, `dist`, `build`, `bin`, `obj` and a few more. A repository describes its own in `.lady-lens.yaml` (`project.exclude_dirs`, `project.graph_extensions`). What `.gitignore` leaves out is not indexed either: git says what it ignores, and in a folder git refuses ("dubious ownership") or without git lens reads the `.gitignore` files itself.
|
|
230
259
|
|
|
231
260
|
Node.js `>=18` is required. Mendix `.mpr` projects are handled through the `mxcli` contributor when `mxcli` is available.
|
|
232
261
|
|
|
@@ -249,26 +278,45 @@ console.log(formatGraphEval(report));
|
|
|
249
278
|
|
|
250
279
|
## Performance
|
|
251
280
|
|
|
252
|
-
|
|
281
|
+
Measure first, then optimize: an optimization without numbers before and after is a guess.
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
npm run bench # lady-lens itself, in a temporary database
|
|
285
|
+
npm run bench -- --baseline # ... and keep it as outputs/bench/baseline.json
|
|
286
|
+
npm run bench:compare # the newest run against the baseline: more than 25% slower is a REGRESSION
|
|
287
|
+
npm run bench -- --scale many-imports # a generated repository: default, small-files, large-files, mixed-languages, many-imports (--count, --seed)
|
|
288
|
+
lens bench --repo C:\git\my-project # your own repository: temporary database, the registry stays as it is (lens bench compare)
|
|
289
|
+
LENS_PROFILE=1 lens sync # the phases of one real sync, on stderr
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Traces: `LENS_TRACE_FILE=<file>` writes one JSON line per span (`trace_id`, `span_id`, `parent_span_id`, `name`, `duration_ms`, `status`, `attributes`), the same shape as Kura's `outputs/traces.jsonl`. A CLI command is the root span (with `node.startup_ms`: Node plus the static imports); below it `load modules`, `tool: <name>`, `freshness: status` and `freshness: sync`, `query: load graph` and every step of a sync. In the daemon each tool call is its own trace. A caller that sets `TRACEPARENT` (W3C, `00-<trace id>-<span id>-01`) gets lens's spans in its own trace; point `LENS_TRACE_FILE` at the caller's file to see them together. A `lens ask` answered by the daemon sends its span as the `traceparent` header, so the daemon's spans (when it was started with `LENS_TRACE_FILE`) hang under it.
|
|
293
|
+
|
|
294
|
+
```
|
|
295
|
+
$env:LENS_TRACE_FILE = "$HOME\.lady-lens\logs\traces.jsonl"; lens ask graph_query '{"query":"queue"}'
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Every measurement runs once to warm up and then 5 times (`--runs`). The run shows the median, min, max and the spread, and marks a measurement whose runs differ more than 10% as `unstable`. A full or incremental sync is split into its phases: stored files, scan (with read and hash), parse (per file type), contributors, Mendix, co-change from git, derive relations, write to the graph, record head. `process: lens ask` and `process: daemon start` time a new process from start to answer. Each run is saved as `outputs/bench/<date>-<commit>.json` (for `lens bench`: `~/.lady-lens/bench/<repo id>/`), with the numbers, the lady-lens version, Node, OS, CPU and a hash of the machine; no paths or code of the measured repository. A comparison between two machines or two repositories gives a warning.
|
|
299
|
+
|
|
300
|
+
`npm run check` ends with `npm run test:perf`: the performance tests alone (no coverage, no parallel workers, where a time swung 5x), each measurement held to a budget in `test/perf-budgets.json`. The budgets leave 5x room for a slower or busy machine (CI runs the same step), so they catch a large slowdown; a slowdown of 25% shows in `npm run bench:compare` on your own machine. After a speed-up, `npm run bench:ratchet` makes the budgets stricter; it never loosens one.
|
|
253
301
|
|
|
254
|
-
Baseline, lady-lens 1.
|
|
302
|
+
Baseline, lady-lens 1.5.2 (349 files, 350 nodes), 2026-11-12, median of 5 runs on a development machine (Windows, 16 x i7-11850H, Node 24):
|
|
255
303
|
|
|
256
|
-
| Operation |
|
|
257
|
-
| :--- | ---: |
|
|
258
|
-
| Full sync
|
|
259
|
-
| Incremental sync (unchanged) |
|
|
260
|
-
|
|
|
261
|
-
| `
|
|
262
|
-
| `folderView` |
|
|
263
|
-
| `
|
|
264
|
-
|
|
|
265
|
-
| `
|
|
266
|
-
|
|
|
267
|
-
| `
|
|
268
|
-
| `
|
|
269
|
-
| `
|
|
304
|
+
| Operation | Median |
|
|
305
|
+
| :--- | ---: |
|
|
306
|
+
| Full sync (parse 59%, write to graph 29%) | 3381 ms |
|
|
307
|
+
| Incremental sync (unchanged) | 193 ms |
|
|
308
|
+
| Graph load, cold / warm | 125 / 127 ms |
|
|
309
|
+
| `graph_query` (end to end) | 197 ms |
|
|
310
|
+
| `functionView` / `folderView` | 50 / 148 ms |
|
|
311
|
+
| Direct queries (`definedIn`, `exports`, `imports`, `importedBy`, `exists`) | 26 to 37 ms |
|
|
312
|
+
| `health` | 157 ms |
|
|
313
|
+
| `diff_impact` (all functions of one file changed) | 204 ms |
|
|
314
|
+
| `cross_repo_search` (3 folders) | 74 ms |
|
|
315
|
+
| `hubs` and `bridges` | 17 ms |
|
|
316
|
+
| `rankGraphNodes` | 4.6 ms |
|
|
317
|
+
| `lens ask` as a new process / daemon start | 854 / 677 ms |
|
|
270
318
|
|
|
271
|
-
|
|
319
|
+
A generated repository (`npm run bench -- --scale many-imports`: 1000 source files with 12 imports each, plus tests and documents, 1260 files, seed 1), same machine, median of 3 runs: full sync 6255 ms, of which writing to the graph 5222 ms (83%); incremental sync 285 ms; graph load 564 ms; `graph_query` 576 ms; `folderView` 620 ms; `health` 666 ms; `functionView` 57 ms. Writing to the graph is where a large sync spends its time.
|
|
272
320
|
|
|
273
321
|
## Settings & Configuration
|
|
274
322
|
|
|
@@ -282,7 +330,7 @@ lady-lens can be configured fully through a **`config.json`** file in the root o
|
|
|
282
330
|
"graph_extensions": [".js", ".mjs", ".ts", ".cs", ".md", ".json"]
|
|
283
331
|
},
|
|
284
332
|
"graph": {
|
|
285
|
-
"ast": { "enabled":
|
|
333
|
+
"ast": { "enabled": false },
|
|
286
334
|
"documentation": { "enabled": true }
|
|
287
335
|
},
|
|
288
336
|
"mcp": {
|
|
@@ -296,7 +344,7 @@ lady-lens can be configured fully through a **`config.json`** file in the root o
|
|
|
296
344
|
}
|
|
297
345
|
```
|
|
298
346
|
|
|
299
|
-
Settings can also be overridden with the environment variables `LENS_<NAME>`: `LENS_GRAPH_DB`, `LENS_REPO_ROOT`, `LENS_SETTINGS_PATH`, `LENS_TOOL_RESULT_CHARS`, `LENS_READ_CHUNK_MAX_CHARS`, `LENS_READ_CHUNK_MAX_LINES`, `LENS_GREP_MAX_MATCHES`, `LENS_DEBUG_LOG_FILE`, `LENS_DEBUG_LEVEL
|
|
347
|
+
Settings can also be overridden with the environment variables `LENS_<NAME>`: `LENS_GRAPH_DB`, `LENS_REPO_ROOT`, `LENS_SETTINGS_PATH`, `LENS_TOOL_RESULT_CHARS`, `LENS_READ_CHUNK_MAX_CHARS`, `LENS_READ_CHUNK_MAX_LINES`, `LENS_GREP_MAX_MATCHES`, `LENS_DEBUG_LOG_FILE`, `LENS_DEBUG_LEVEL`, `LENS_MDL_EXPORT` (`background` default, `inline`, `off`: the Mendix MDL export after a model change), `LENS_MXCLI_TIMEOUT_MS` (time limit of one mxcli call, default 120000).
|
|
300
348
|
|
|
301
349
|
## As a library (NPM Package)
|
|
302
350
|
|