ast-mcp-server 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +28 -8
- package/dist/batch/runner.js +10 -2
- package/dist/batch/schema.js +8 -1
- package/dist/cli-output.js +28 -0
- package/dist/cli.js +57 -9
- package/dist/server.js +6 -1
- package/dist/services/agent-setup.js +1 -0
- package/dist/services/operation-plan-file.js +1 -1
- package/dist/services/operations.js +172 -17
- package/dist/services/pagination.js +16 -10
- package/dist/services/scaffold.js +241 -0
- package/dist/services/symbols.js +16 -0
- package/dist/tools/apply_operation.js +1 -1
- package/dist/tools/find_references.js +32 -9
- package/dist/tools/get_diagnostics.js +4 -4
- package/dist/tools/operation-schema.js +1 -1
- package/dist/tools/result.js +45 -1
- package/dist/tools/scaffold_class.js +145 -0
- package/dist/tools/search_symbols.js +79 -18
- package/package.json +9 -2
- package/skills/structural-code-editing/SKILL.md +30 -6
- package/benchmark/README.md +0 -86
package/benchmark/README.md
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# Benchmark methodology
|
|
2
|
-
|
|
3
|
-
The benchmark suite measures two separate properties. It deliberately avoids converting characters into tokens because tokenizer choice changes the answer.
|
|
4
|
-
|
|
5
|
-
## Project payload and latency
|
|
6
|
-
|
|
7
|
-
`scripts/benchmark.mjs`:
|
|
8
|
-
|
|
9
|
-
1. Loads a real TypeScript project from disk.
|
|
10
|
-
2. Selects the lexicographically first non-declaration source files after an optional filter.
|
|
11
|
-
3. Serializes the default compact outline payload (`file` plus `outline`).
|
|
12
|
-
4. Also records the larger opt-in payload containing detailed symbol metadata.
|
|
13
|
-
5. Reports fresh project load, cold cached-session, warm cached-session, and per-file outline latency.
|
|
14
|
-
|
|
15
|
-
Run:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
yarn benchmark /absolute/project/path --sample 20 --output benchmark/results/project.json
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
The selection rule is deterministic but not statistically representative of every repository. Use `--filter` and multiple samples when comparing particular modules.
|
|
22
|
-
|
|
23
|
-
## Compact-first task corpus
|
|
24
|
-
|
|
25
|
-
`task-corpus.json` defines twelve questions over this repository. Each task declares:
|
|
26
|
-
|
|
27
|
-
- files a full-file workflow would load;
|
|
28
|
-
- declarations a compact-first workflow would request after inspecting outlines;
|
|
29
|
-
- evidence strings necessary to answer that task.
|
|
30
|
-
|
|
31
|
-
`scripts/benchmark-corpus.mjs` compares:
|
|
32
|
-
|
|
33
|
-
- baseline: complete text of every declared file;
|
|
34
|
-
- compact: default outline payloads plus only the selected declaration sources.
|
|
35
|
-
|
|
36
|
-
It fails unless every predefined evidence string is present in the compact payload. This makes the check reproducible, but it does not prove that every possible reviewer would reach an equivalent conclusion.
|
|
37
|
-
|
|
38
|
-
Run:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
yarn benchmark:corpus benchmark/task-corpus.json --output benchmark/results/self-corpus.json
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Interpreting results
|
|
45
|
-
|
|
46
|
-
- Character reduction measures serialized payload size, not billed model tokens.
|
|
47
|
-
- Negative reduction on a tiny file is valid: protocol structure can cost more than reading that file directly.
|
|
48
|
-
- Project-load latency and warm-session latency should be considered separately.
|
|
49
|
-
- Detailed symbol metadata is opt-in because it repeats signature text and can dominate small files.
|
|
50
|
-
- Benchmark scripts record absolute local paths and timestamps. Checked reports replace local paths with descriptive placeholders; regenerate them when comparing another machine or revision.
|
|
51
|
-
|
|
52
|
-
## Batch orchestration
|
|
53
|
-
|
|
54
|
-
`scripts/benchmark-batch.mjs` compares a two-operation search-to-source workflow in fresh Node processes:
|
|
55
|
-
|
|
56
|
-
- separate: the client receives the broad symbol-search payload, selects the first match, then requests its source;
|
|
57
|
-
- batch: `ast-tool` performs the same two MCP tool invocations in process and emits only the final source result.
|
|
58
|
-
|
|
59
|
-
Run:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
yarn benchmark:batch --iterations 5 --output benchmark/results/self-batch.json
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
The report records logical model round-trips, actual tool invocations, median wall time, process maximum RSS, final-result characters, and total characters exposed to the model. It does not include model inference latency, so the practical wall-time benefit of removing a model round-trip will be larger than this local process-only comparison. Maximum RSS includes the Node runtime and TypeScript project in each fresh worker.
|
|
66
|
-
|
|
67
|
-
## Checked results
|
|
68
|
-
|
|
69
|
-
Results generated on 2026-08-03 with Node.js v24.16.0:
|
|
70
|
-
|
|
71
|
-
| Workload | Sample | Full source chars | Compact chars | Reduction | Fresh load | Warm session |
|
|
72
|
-
| --------------- | -------: | ----------------: | ------------: | --------: | ---------: | -----------: |
|
|
73
|
-
| This repository | 20 files | 77,982 | 12,512 | 83.96% | 543 ms | 1.86 ms |
|
|
74
|
-
| `x-scraper` | 20 files | 178,110 | 17,036 | 90.44% | 3,951 ms | 180.16 ms |
|
|
75
|
-
| Task corpus | 12 tasks | 83,289 | 28,372 | 65.94% | n/a | n/a |
|
|
76
|
-
|
|
77
|
-
The task corpus passed all 12 predefined evidence checks. Its compact count includes the selected declaration bodies, not just outlines. Exact raw reports are under `benchmark/results/`.
|
|
78
|
-
|
|
79
|
-
The checked broad search-to-source batch result used five fresh-process samples:
|
|
80
|
-
|
|
81
|
-
| Mode | Model round-trips | Tool invocations | Context chars | Median wall time | Median max RSS |
|
|
82
|
-
| -------- | ----------------: | ---------------: | ------------: | ---------------: | -------------: |
|
|
83
|
-
| Separate | 2 | 2 | 11,514 | 536.19 ms | 377.54 MB |
|
|
84
|
-
| Batch | 1 | 2 | 552 | 535.24 ms | 378.35 MB |
|
|
85
|
-
|
|
86
|
-
That run reduced model round-trips by 50% and serialized context by 95.21%. Local execution latency decreased by 0.18% and RSS increased by 0.21%, both small enough to treat as noise rather than a performance claim. The batch value is orchestration/context reduction; it does not make TypeScript analysis free.
|