memorydetective 1.2.0 → 1.3.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 -1
- package/README.md +37 -1
- package/USAGE.md +39 -23
- package/dist/cli.js +1 -1
- package/dist/index.js +34 -25
- package/dist/index.js.map +1 -1
- package/dist/runtime/suggestions.d.ts +44 -0
- package/dist/runtime/suggestions.js +161 -0
- package/dist/runtime/suggestions.js.map +1 -0
- package/dist/tools/analyzeMemgraph.d.ts +3 -1
- package/dist/tools/analyzeMemgraph.js +8 -0
- package/dist/tools/analyzeMemgraph.js.map +1 -1
- package/dist/tools/classifyCycle.d.ts +8 -1
- package/dist/tools/classifyCycle.js +28 -3
- package/dist/tools/classifyCycle.js.map +1 -1
- package/dist/tools/findRetainers.d.ts +3 -1
- package/dist/tools/findRetainers.js +5 -0
- package/dist/tools/findRetainers.js.map +1 -1
- package/dist/tools/getInvestigationPlaybook.d.ts +43 -0
- package/dist/tools/getInvestigationPlaybook.js +220 -0
- package/dist/tools/getInvestigationPlaybook.js.map +1 -0
- package/dist/tools/reachableFromCycle.d.ts +4 -2
- package/dist/tools/reachableFromCycle.js +14 -1
- package/dist/tools/reachableFromCycle.js.map +1 -1
- package/dist/tools/swift/findSymbolReferences.d.ts +2 -2
- package/dist/tools/swift/getHoverInfo.d.ts +2 -2
- package/dist/tools/swift/getSymbolDefinition.d.ts +6 -6
- package/dist/tools/swift/searchPattern.d.ts +2 -2
- package/dist/types.d.ts +14 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,47 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.3.0] — 2026-05-01
|
|
10
|
+
|
|
11
|
+
Pipeline-aware release. Addresses real-user feedback that the Swift tools were "an attachment" rather than part of the investigation chain. **Discovery is now data, not inference.** 25 → 26 tools.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **`suggestedNextCalls` field** on `analyzeMemgraph`, `classifyCycle`, `findRetainers`, and `reachableFromCycle` results. Each entry is a typed `{ tool, args, why }` triple with pre-populated arguments based on the current result. The orchestrating LLM can chain calls without re-reasoning over the response.
|
|
16
|
+
- `analyzeMemgraph` → suggests `classifyCycle` + `reachableFromCycle`.
|
|
17
|
+
- `classifyCycle` → suggests `swiftSearchPattern` (with a regex pre-translated from the matched pattern) + `swiftGetSymbolDefinition` (with the cycle's app-level class name extracted).
|
|
18
|
+
- `findRetainers` → suggests `swiftGetSymbolDefinition` for the class.
|
|
19
|
+
- `reachableFromCycle` → suggests `swiftGetSymbolDefinition` + `swiftFindSymbolReferences` for the dominant app-level class.
|
|
20
|
+
- **`getInvestigationPlaybook` meta-tool** — returns a versioned, declarative pipeline for a known investigation kind. Five playbooks shipped: `memgraph-leak`, `perf-hangs`, `ui-jank`, `app-launch-slow`, `verify-fix`. Use this once at the start of an investigation to give a fresh agent the canonical sequence without rediscovering it.
|
|
21
|
+
- **Tool-name namespaces in descriptions**: every tool description now opens with a category tag (`[mg.memory]`, `[mg.trace]`, `[mg.code]`, `[mg.log]`, `[mg.discover]`, `[mg.render]`, `[mg.ci]`, `[meta]`). Makes related tools visible as a group at a glance, especially when the agent is browsing the deferred-tools list.
|
|
22
|
+
- **Pipeline lines in key tool descriptions** (`analyzeMemgraph` and `classifyCycle`): each description ends with a "Pipeline: → X (purpose) → Y (purpose)" sentence. Even when the agent only reads the description (not the result), the chain is visible.
|
|
23
|
+
- New `src/runtime/suggestions.ts` helper module so multiple tools agree on the same heuristics for "which class is most actionable" and "which followup is most useful".
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- No breaking changes. All `suggestedNextCalls` fields are optional; old callers that ignore them continue to work.
|
|
28
|
+
- `classifyReport` (pure function) now also returns `classNamesByIndex` so the caller can build typed suggestions without re-walking the cycle forest.
|
|
29
|
+
|
|
30
|
+
### Notes
|
|
31
|
+
|
|
32
|
+
- Inspired by the HATEOAS pattern (Hypermedia as the Engine of Application State) — each response telegraphs the next valid actions. Keeps tool boundaries clean while making the workflow self-documenting.
|
|
33
|
+
|
|
34
|
+
## [1.2.1] — 2026-05-01
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- README: new fourth example "End-to-end: leak → file → fix suggestion" walking through the complete chat-driven workflow with v1.2's Swift source-bridging tools.
|
|
39
|
+
- USAGE.md: section 4 ("Common follow-up requests") expanded with prompts that exercise `swiftGetSymbolDefinition`, `swiftFindSymbolReferences`, `swiftGetSymbolsOverview`, `swiftGetHoverInfo`, `swiftSearchPattern`. New `reachableFromCycle` row added.
|
|
40
|
+
- USAGE.md: section 3 ("How fixes flow") rewritten to reflect the new responsibility split — `memorydetective` now covers diagnose **and** source bridging; the agent owns "decide and apply the edit".
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- USAGE.md concrete end-to-end example replaced with a richer 9-step flow that exercises memgraph analysis + `reachableFromCycle` + Swift LSP tools end-to-end.
|
|
45
|
+
|
|
46
|
+
### Notes
|
|
47
|
+
|
|
48
|
+
- Doc-only release. No code changes from `1.2.0`.
|
|
49
|
+
|
|
9
50
|
## [1.2.0] — 2026-05-01
|
|
10
51
|
|
|
11
52
|
Swift source-bridging. The agent can now go from "found a leak in the cycle" to "find the file/line in this project" without leaving chat. 20 → 25 tools.
|
|
@@ -119,7 +160,9 @@ When called with no arguments it starts the MCP server over stdio.
|
|
|
119
160
|
- **`captureMemgraph`** does not work on physical iOS devices — `leaks(1)` only attaches to processes on the local Mac (which includes iOS simulators). Memory Graph capture from a physical device still requires Xcode.
|
|
120
161
|
- **`detectLeaksInXCUITest`** is flagged experimental: orchestration logic is implemented but not yet validated against a wide set of production XCUITest runs.
|
|
121
162
|
|
|
122
|
-
[Unreleased]: https://github.com/carloshpdoc/memorydetective/compare/v1.
|
|
163
|
+
[Unreleased]: https://github.com/carloshpdoc/memorydetective/compare/v1.3.0...HEAD
|
|
164
|
+
[1.3.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.2.1...v1.3.0
|
|
165
|
+
[1.2.1]: https://github.com/carloshpdoc/memorydetective/compare/v1.2.0...v1.2.1
|
|
123
166
|
[1.2.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.1.0...v1.2.0
|
|
124
167
|
[1.1.0]: https://github.com/carloshpdoc/memorydetective/compare/v1.0.1...v1.1.0
|
|
125
168
|
[1.0.1]: https://github.com/carloshpdoc/memorydetective/compare/v1.0.0...v1.0.1
|
package/README.md
CHANGED
|
@@ -72,6 +72,40 @@ memorydetective classify ~/Desktop/myapp.memgraph
|
|
|
72
72
|
> **Claude:** *(calls `listTraceDevices` → `recordTimeProfile` → `analyzeHangs`)*
|
|
73
73
|
> Recorded `~/Desktop/run.trace` (90s, attached to DemoApp on iPhone 17 Pro Max). Found **23 user-visible hangs** (>500 ms each), longest 1.16 s, average 769 ms — severe load. All on the main thread. Sample-level hotspots aren't symbolicated yet; open the trace in Instruments for that step (or wait for `analyzeTimeProfile` v0.2).
|
|
74
74
|
|
|
75
|
+
### End-to-end: leak → file → fix suggestion
|
|
76
|
+
|
|
77
|
+
The full loop, from artifact to code edit. Combines memory-graph analysis with Swift source-bridging.
|
|
78
|
+
|
|
79
|
+
> **You:** Tem um leak. Memgraph em `~/Desktop/example-leaks.memgraph`. The cycle points at `DetailViewModel`. Find where it lives in the project `~/Development/myapp/` and suggest a fix.
|
|
80
|
+
>
|
|
81
|
+
> **Claude:** *(calls `analyzeMemgraph` → `classifyCycle` → `reachableFromCycle`)*
|
|
82
|
+
> Found **4 ROOT CYCLE blocks**. The dominant one matches `swiftui.tag-index-projection` with high confidence. `reachableFromCycle` confirms 4 `DetailViewModel` instances pinning ~1100 `NSURLSessionConfiguration`s each — the VM is the culprit, the network stack is collateral.
|
|
83
|
+
>
|
|
84
|
+
> *(calls `swiftSearchPattern` to locate `.tag(` + `onImageSliderTap` patterns in `~/Development/myapp/Sources/`)*
|
|
85
|
+
> 1 match in `MyApp/Views/MediaCarousel.swift:142`.
|
|
86
|
+
>
|
|
87
|
+
> *(calls `swiftGetSymbolDefinition({ symbolName: "DetailViewModel", projectRoot: "...", candidatePaths: ["MyApp/ViewModels/"] })`)*
|
|
88
|
+
> Declared at `MyApp/ViewModels/DetailViewModel.swift:18` — `class DetailViewModel: ObservableObject`.
|
|
89
|
+
>
|
|
90
|
+
> *(calls `swiftFindSymbolReferences` to scope the blast radius — 7 callsites)*
|
|
91
|
+
>
|
|
92
|
+
> **Suggested fix at `MediaCarousel.swift:142`:**
|
|
93
|
+
> ```swift
|
|
94
|
+
> // before
|
|
95
|
+
> .tag(index)
|
|
96
|
+
> .onImageSliderTap { index in
|
|
97
|
+
> self.viewModel.handlePhotoTap(at: index)
|
|
98
|
+
> }
|
|
99
|
+
>
|
|
100
|
+
> // after — static helper + weak captures
|
|
101
|
+
> .tag(index)
|
|
102
|
+
> .onImageSliderTap { [weak vm = _viewModel.wrappedValue,
|
|
103
|
+
> weak coord = self.coordinator] index in
|
|
104
|
+
> Self.handlePhotoTap(index: index, viewModel: vm, coordinator: coord)
|
|
105
|
+
> }
|
|
106
|
+
> ```
|
|
107
|
+
> Want me to apply this and verify with a fresh `.memgraph`?
|
|
108
|
+
|
|
75
109
|
---
|
|
76
110
|
|
|
77
111
|
## Configure
|
|
@@ -177,7 +211,9 @@ Copilot's MCP integration moves fast — if this snippet is stale, see the [VS C
|
|
|
177
211
|
|
|
178
212
|
## API
|
|
179
213
|
|
|
180
|
-
|
|
214
|
+
26 MCP tools, grouped by purpose. Tool descriptions are tagged with a category prefix (`[mg.memory]`, `[mg.trace]`, `[mg.code]`, `[mg.log]`, `[mg.render]`, `[mg.ci]`, `[mg.discover]`, `[meta]`) so related tools are visible at a glance.
|
|
215
|
+
|
|
216
|
+
Many tools include a `suggestedNextCalls` field in their response — a typed list of `{ tool, args, why }` entries pre-populated from the current result, so the orchestrating LLM can chain calls without re-reasoning. Start with `getInvestigationPlaybook(kind)` for the canonical sequence.
|
|
181
217
|
|
|
182
218
|
### Read & analyze (13)
|
|
183
219
|
|
package/USAGE.md
CHANGED
|
@@ -117,15 +117,18 @@ Claude orchestrates the full flow (see [section 3](#3-how-fixes-actually-flow-fr
|
|
|
117
117
|
|
|
118
118
|
## 3. How fixes actually flow from diagnosis to edit
|
|
119
119
|
|
|
120
|
-
`memorydetective`
|
|
120
|
+
`memorydetective` covers the diagnose side **and the source-bridging side**. It tells you **what** is wrong, **where in the cycle**, **what type of fix** is needed, **where the relevant types live in your project** (via Swift LSP integration), and **every callsite that references them**. It does not edit your code — that final step still belongs to your LLM agent.
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
So the workflow has two halves:
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
| Half | Owned by `memorydetective` | Owned by the LLM agent |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| **Diagnose** | ✅ memgraph parsing, cycle classification, fix-hint catalog, hangs / allocations / app-launch / animation hitches | |
|
|
127
|
+
| **Locate in source** | ✅ `swiftGetSymbolDefinition`, `swiftFindSymbolReferences`, `swiftSearchPattern`, `swiftGetSymbolsOverview`, `swiftGetHoverInfo` (SourceKit-LSP under the hood) | |
|
|
128
|
+
| **Decide the actual edit** | | ✅ The agent reads the surrounding code, picks the right capture-list pattern, writes the diff |
|
|
129
|
+
| **Apply the edit** | | ✅ The agent's `Edit`/`MultiEdit` tools write to the user's file |
|
|
125
130
|
|
|
126
|
-
|
|
127
|
-
- LLM agents already excel at code editing. Letting them keep that role keeps `memorydetective` focused.
|
|
128
|
-
- The catalog of known patterns becomes the knowledge moat; the LLM brings the codebase awareness.
|
|
131
|
+
The split between "locate" (us) and "edit" (the agent) is intentional. Locating is a deterministic SourceKit-LSP query; editing requires understanding the user's surrounding code style, naming conventions, and intent — that's the LLM's strength. We give the agent every piece of structured information it needs to make the edit, and step back at the file-write boundary.
|
|
129
132
|
|
|
130
133
|
### Concrete end-to-end example
|
|
131
134
|
|
|
@@ -133,39 +136,45 @@ Configuration (one-time): `memorydetective` registered as an MCP server in Claud
|
|
|
133
136
|
|
|
134
137
|
You open Claude Code in your iOS project and ask:
|
|
135
138
|
|
|
136
|
-
> **You:**
|
|
139
|
+
> **You:** Tem um leak. Memgraph em `~/Desktop/example-leaks.memgraph`. The cycle points at `DetailViewModel`. Find where it lives in the project `~/Development/myapp/` and suggest a fix.
|
|
137
140
|
|
|
138
141
|
What Claude does, step by step:
|
|
139
142
|
|
|
140
|
-
1. **Calls `analyzeMemgraph(path
|
|
141
|
-
- Receives: 60,436 leaks, 4 ROOT CYCLE blocks, top cycle is a `_DictionaryStorage` chain.
|
|
143
|
+
1. **Calls `analyzeMemgraph(path)`**
|
|
144
|
+
- Receives: 60,436 leaks, 4 ROOT CYCLE blocks, top cycle is a `_DictionaryStorage` chain. App-level classes in chain: `DetailViewModel`, `GraphQLClient`, `ItemRepositoryImpl`.
|
|
145
|
+
|
|
146
|
+
2. **Calls `classifyCycle(path)`**
|
|
147
|
+
- Receives: `swiftui.tag-index-projection` (high confidence) + fix hint pointing at `.tag()` modifier capturing `self`.
|
|
148
|
+
|
|
149
|
+
3. **Calls `reachableFromCycle({ rootClassName: "DetailViewModel" })`**
|
|
150
|
+
- Confirms 4 `DetailViewModel` instances and ~1100 `NSURLSessionConfiguration`s reachable from each — the VM is the culprit pinning the network stack as collateral, not the other way around.
|
|
151
|
+
|
|
152
|
+
4. **Calls `swiftSearchPattern({ pattern: "\\.tag\\(", filePath: "..." })` across views**
|
|
153
|
+
- Surfaces 1 match in `MyApp/Views/MediaCarousel.swift:142`.
|
|
142
154
|
|
|
143
|
-
|
|
144
|
-
-
|
|
155
|
+
5. **Calls `swiftGetSymbolDefinition({ symbolName: "DetailViewModel", projectRoot: "~/Development/myapp/", candidatePaths: ["MyApp/ViewModels/"] })`**
|
|
156
|
+
- Returns `MyApp/ViewModels/DetailViewModel.swift:18` — `class DetailViewModel: ObservableObject`.
|
|
145
157
|
|
|
146
|
-
|
|
147
|
-
-
|
|
148
|
-
- `Grep` for `onImageSliderTap` (or whatever closure name surfaced in the chain).
|
|
149
|
-
- `Read` the candidate files to see how the closure is captured.
|
|
158
|
+
6. **Calls `swiftFindSymbolReferences({ symbolName: "DetailViewModel", filePath: "..." })`**
|
|
159
|
+
- Lists 7 callsites across the codebase. Helps the agent gauge fix blast radius.
|
|
150
160
|
|
|
151
|
-
|
|
161
|
+
7. **Presents the proposed fix in chat:**
|
|
152
162
|
|
|
153
|
-
> **Claude:** Found the cycle. `
|
|
163
|
+
> **Claude:** Found the cycle. `MediaCarousel.swift:142` passes `onImageSliderTap` as a closure that captures `self`. The `.tag(index)` modifier on the carousel `ForEach` triggers the SwiftUI internal `TagIndexProjection` observation that pins `DetailViewModel`.
|
|
154
164
|
>
|
|
155
|
-
> Suggested fix:
|
|
165
|
+
> Suggested fix:
|
|
156
166
|
> ```swift
|
|
157
167
|
> // before
|
|
158
168
|
> onImageSliderTap: { index in
|
|
159
169
|
> self.viewModel.handlePhotoTap(at: index)
|
|
160
170
|
> }
|
|
161
171
|
>
|
|
162
|
-
> // after
|
|
172
|
+
> // after — static helper + weak captures
|
|
163
173
|
> onImageSliderTap: { [weak vm = _viewModel.wrappedValue,
|
|
164
174
|
> weak coord = self.coordinator] index in
|
|
165
175
|
> Self.handlePhotoTap(index: index, viewModel: vm, coordinator: coord)
|
|
166
176
|
> }
|
|
167
177
|
>
|
|
168
|
-
> // plus a static helper:
|
|
169
178
|
> private static func handlePhotoTap(
|
|
170
179
|
> index: Int,
|
|
171
180
|
> viewModel: DetailViewModel?,
|
|
@@ -175,11 +184,11 @@ What Claude does, step by step:
|
|
|
175
184
|
>
|
|
176
185
|
> Want me to apply this?
|
|
177
186
|
|
|
178
|
-
|
|
187
|
+
8. **You accept** → Claude calls its own `Edit` tool → diff appears in your IDE → you review and commit.
|
|
179
188
|
|
|
180
|
-
|
|
189
|
+
9. **(Optional) Verify the fix:** export a fresh `.memgraph` after running the same flow, then ask Claude:
|
|
181
190
|
|
|
182
|
-
> **You:** Did the fix work? Compare `~/Desktop/
|
|
191
|
+
> **You:** Did the fix work? Compare `~/Desktop/before.memgraph` to `~/Desktop/after.memgraph`.
|
|
183
192
|
|
|
184
193
|
Claude calls `diffMemgraphs` — instance counts dropped, the `swiftui.tag-index-projection` cycle is gone from `cycles.persisted`, present in `cycles.goneFromBefore`.
|
|
185
194
|
|
|
@@ -202,12 +211,19 @@ Once you have the diagnosis, here are useful follow-up prompts you can paste int
|
|
|
202
211
|
| Prompt | What Claude calls |
|
|
203
212
|
|---|---|
|
|
204
213
|
| "How many `DetailViewModel` instances are leaking?" | `countAlive(path, className: "DetailViewModel")` |
|
|
214
|
+
| "How many `NSURLSessionConfiguration`s are *inside* the cycle rooted at `DetailViewModel`?" | `reachableFromCycle(path, rootClassName: "DetailViewModel", className: "NSURLSessionConfiguration")` |
|
|
205
215
|
| "Show the retain chain that keeps `DetailViewModel` alive." | `findRetainers(path, className: "DetailViewModel")` |
|
|
206
216
|
| "Compare `~/Desktop/before.memgraph` to `~/Desktop/after.memgraph` — did the leak go away?" | `diffMemgraphs(before, after)` |
|
|
207
217
|
| "Render the cycle as a Mermaid graph for the PR description." | `renderCycleGraph(path, format: "mermaid")` |
|
|
208
218
|
| "Profile this app on my iPhone for 90 seconds and tell me about hangs." | `listTraceDevices` → `recordTimeProfile` → `analyzeHangs` |
|
|
209
219
|
| "Pull the last 5 minutes of `error`-level logs from `MyApp`." | `logShow(last: "5m", process: "MyApp", level: "default")` |
|
|
210
220
|
| "Run my XCUITest with leak detection." | `detectLeaksInXCUITest(workspace, scheme, testIdentifier, …)` |
|
|
221
|
+
| **Source bridging — combine with the memory tools above:** | |
|
|
222
|
+
| "Where is `DetailViewModel` declared in this project?" | `swiftGetSymbolDefinition(symbolName, candidatePaths)` |
|
|
223
|
+
| "Find every reference to `DetailViewModel` across the codebase." | `swiftFindSymbolReferences(symbolName, filePath)` |
|
|
224
|
+
| "What types live in `MediaCarousel.swift`?" | `swiftGetSymbolsOverview(filePath)` |
|
|
225
|
+
| "What's the type at this position in this file?" | `swiftGetHoverInfo(filePath, line, character)` |
|
|
226
|
+
| "Search for `[weak self]` captures in this file." | `swiftSearchPattern(filePath, pattern: "\\[weak self\\]")` |
|
|
211
227
|
|
|
212
228
|
The agent decides which tool to call based on your prompt — you don't need to remember the tool names.
|
|
213
229
|
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import { renderCycleGraph, renderCycleGraphSchema, } from "./tools/renderCycleGr
|
|
|
20
20
|
import { logShow, logShowSchema, logStream, logStreamSchema, } from "./tools/logShow.js";
|
|
21
21
|
import { detectLeaksInXCUITest, detectLeaksInXCUITestSchema, } from "./tools/detectLeaksInXCUITest.js";
|
|
22
22
|
import { reachableFromCycle, reachableFromCycleSchema, } from "./tools/reachableFromCycle.js";
|
|
23
|
+
import { getInvestigationPlaybook, getInvestigationPlaybookSchema, } from "./tools/getInvestigationPlaybook.js";
|
|
23
24
|
import { swiftGetSymbolDefinition, swiftGetSymbolDefinitionSchema, swiftFindSymbolReferences, swiftFindSymbolReferencesSchema, swiftGetSymbolsOverview, swiftGetSymbolsOverviewSchema, swiftGetHoverInfo, swiftGetHoverInfoSchema, swiftSearchPattern, swiftSearchPatternSchema, } from "./tools/swift/index.js";
|
|
24
25
|
const SERVER_NAME = "memorydetective";
|
|
25
26
|
const SERVER_VERSION = "0.1.0-dev";
|
|
@@ -29,7 +30,7 @@ const server = new McpServer({
|
|
|
29
30
|
});
|
|
30
31
|
server.registerTool("analyzeMemgraph", {
|
|
31
32
|
title: "Analyze a .memgraph file",
|
|
32
|
-
description: "Run `leaks(1)` against a `.memgraph` file (exported from Xcode Memory Graph Debugger) and return a structured summary: header info, totals, top-level ROOT CYCLE blocks with chain length,
|
|
33
|
+
description: "[mg.memory] Run `leaks(1)` against a `.memgraph` file (exported from Xcode Memory Graph Debugger) and return a structured summary: header info, totals, top-level ROOT CYCLE blocks with chain length, plain-English diagnosis. Set `fullChains: true` to also include the full nested retain forest.\n\nPipeline: → `classifyCycle` (named-antipattern + fix hint) → `reachableFromCycle` (scope blame to a single root). The response includes `suggestedNextCalls` so the agent can chain without re-reasoning.",
|
|
33
34
|
inputSchema: analyzeMemgraphSchema.shape,
|
|
34
35
|
}, async (input) => {
|
|
35
36
|
const result = await analyzeMemgraph(input);
|
|
@@ -44,7 +45,7 @@ server.registerTool("analyzeMemgraph", {
|
|
|
44
45
|
});
|
|
45
46
|
server.registerTool("findCycles", {
|
|
46
47
|
title: "Find ROOT CYCLE blocks in a .memgraph",
|
|
47
|
-
description: "Extract just the ROOT CYCLE blocks from a `.memgraph` as flattened chains (depth + edge + retainKind + className + address). Optionally filter to cycles touching a specific class name (substring match). Use this when you want to inspect chains without the noise of standalone leaks.",
|
|
48
|
+
description: "[mg.memory] Extract just the ROOT CYCLE blocks from a `.memgraph` as flattened chains (depth + edge + retainKind + className + address). Optionally filter to cycles touching a specific class name (substring match). Use this when you want to inspect chains without the noise of standalone leaks.",
|
|
48
49
|
inputSchema: findCyclesSchema.shape,
|
|
49
50
|
}, async (input) => {
|
|
50
51
|
const result = await findCycles(input);
|
|
@@ -59,7 +60,7 @@ server.registerTool("findCycles", {
|
|
|
59
60
|
});
|
|
60
61
|
server.registerTool("findRetainers", {
|
|
61
62
|
title: "Find what retains a class",
|
|
62
|
-
description: "Walk the cycle forest from a `.memgraph` and return every retain chain that ends in a node whose className contains the given substring. Useful for answering \"who is keeping <class> alive?\". Returns paths from a top-level node down to the matching node.",
|
|
63
|
+
description: "[mg.memory] Walk the cycle forest from a `.memgraph` and return every retain chain that ends in a node whose className contains the given substring. Useful for answering \"who is keeping <class> alive?\". Returns paths from a top-level node down to the matching node.",
|
|
63
64
|
inputSchema: findRetainersSchema.shape,
|
|
64
65
|
}, async (input) => {
|
|
65
66
|
const result = await findRetainers(input);
|
|
@@ -69,7 +70,7 @@ server.registerTool("findRetainers", {
|
|
|
69
70
|
});
|
|
70
71
|
server.registerTool("countAlive", {
|
|
71
72
|
title: "Count instances by class",
|
|
72
|
-
description: "Count how many times each class appears in a `.memgraph`'s leaked nodes. Provide `className` (substring) for a single number, or omit it to get the top N most-leaked classes. Use this to confirm whether a fix actually reduced instance counts.",
|
|
73
|
+
description: "[mg.memory] Count how many times each class appears in a `.memgraph`'s leaked nodes. Provide `className` (substring) for a single number, or omit it to get the top N most-leaked classes. Use this to confirm whether a fix actually reduced instance counts.",
|
|
73
74
|
inputSchema: countAliveSchema.shape,
|
|
74
75
|
}, async (input) => {
|
|
75
76
|
const result = await countAlive(input);
|
|
@@ -79,7 +80,7 @@ server.registerTool("countAlive", {
|
|
|
79
80
|
});
|
|
80
81
|
server.registerTool("diffMemgraphs", {
|
|
81
82
|
title: "Diff two memgraph snapshots",
|
|
82
|
-
description: "Compare a baseline `.memgraph` (`before`) against a comparison `.memgraph` (`after`). Returns total leak/byte deltas, classes whose counts increased or decreased, and ROOT CYCLE signatures bucketed into newInAfter / goneFromBefore / persisted. The killer feature for verifying that a fix actually worked.",
|
|
83
|
+
description: "[mg.memory] Compare a baseline `.memgraph` (`before`) against a comparison `.memgraph` (`after`). Returns total leak/byte deltas, classes whose counts increased or decreased, and ROOT CYCLE signatures bucketed into newInAfter / goneFromBefore / persisted. The killer feature for verifying that a fix actually worked.",
|
|
83
84
|
inputSchema: diffMemgraphsSchema.shape,
|
|
84
85
|
}, async (input) => {
|
|
85
86
|
const result = await diffMemgraphs(input);
|
|
@@ -89,7 +90,7 @@ server.registerTool("diffMemgraphs", {
|
|
|
89
90
|
});
|
|
90
91
|
server.registerTool("classifyCycle", {
|
|
91
92
|
title: "Classify ROOT CYCLEs against known patterns",
|
|
92
|
-
description: "
|
|
93
|
+
description: "[mg.memory] Match each ROOT CYCLE against a built-in catalog of 8 known antipatterns (TagIndexProjection cycle, ForEachState retention, Combine sink-store-self, Task-without-weak-self, NotificationCenter observer, viewmodel-wrapped-strong closure, UINavigationController host, _DictionaryStorage internal). Returns `patternId`, `confidence`, and a `fixHint` per cycle.\n\nPipeline: this is the killer tool — after the result, **follow `suggestedNextCalls`** which pre-translates each match to a Swift regex (`swiftSearchPattern`) + the captured class name (`swiftGetSymbolDefinition`). Discovery is data, not inference.",
|
|
93
94
|
inputSchema: classifyCycleSchema.shape,
|
|
94
95
|
}, async (input) => {
|
|
95
96
|
const result = await classifyCycle(input);
|
|
@@ -99,7 +100,7 @@ server.registerTool("classifyCycle", {
|
|
|
99
100
|
});
|
|
100
101
|
server.registerTool("analyzeHangs", {
|
|
101
102
|
title: "Analyze potential hangs from a .trace bundle",
|
|
102
|
-
description: "Run `xcrun xctrace export` against a `.trace` bundle for the `potential-hangs` schema and return aggregated stats (Hang vs Microhang counts, longest, average, total duration) plus the top N longest hangs sorted by duration. Use `minDurationMs: 250` to filter to user-visible hangs only.",
|
|
103
|
+
description: "[mg.trace] Run `xcrun xctrace export` against a `.trace` bundle for the `potential-hangs` schema and return aggregated stats (Hang vs Microhang counts, longest, average, total duration) plus the top N longest hangs sorted by duration. Use `minDurationMs: 250` to filter to user-visible hangs only.",
|
|
103
104
|
inputSchema: analyzeHangsSchema.shape,
|
|
104
105
|
}, async (input) => {
|
|
105
106
|
const result = await analyzeHangs(input);
|
|
@@ -109,7 +110,7 @@ server.registerTool("analyzeHangs", {
|
|
|
109
110
|
});
|
|
110
111
|
server.registerTool("analyzeTimeProfile", {
|
|
111
112
|
title: "Analyze a Time Profiler trace",
|
|
112
|
-
description: "Export the `time-profile` schema from a `.trace` bundle and return top symbols by sample count. Note: heavy/unsymbolicated traces may crash xctrace export — when that happens, the tool returns a `notice` field with workarounds (open in Instruments first to symbolicate, or re-record shorter).",
|
|
113
|
+
description: "[mg.trace] Export the `time-profile` schema from a `.trace` bundle and return top symbols by sample count. Note: heavy/unsymbolicated traces may crash xctrace export — when that happens, the tool returns a `notice` field with workarounds (open in Instruments first to symbolicate, or re-record shorter).",
|
|
113
114
|
inputSchema: analyzeTimeProfileSchema.shape,
|
|
114
115
|
}, async (input) => {
|
|
115
116
|
const result = await analyzeTimeProfile(input);
|
|
@@ -119,7 +120,7 @@ server.registerTool("analyzeTimeProfile", {
|
|
|
119
120
|
});
|
|
120
121
|
server.registerTool("listTraceDevices", {
|
|
121
122
|
title: "List physical devices and simulators",
|
|
122
|
-
description: "Run `xcrun xctrace list devices` and return parsed devices/simulators with their UDIDs. The LLM should call this before `recordTimeProfile` to discover the right UDID without asking the user. Set `includeOffline: true` to include disconnected devices.",
|
|
123
|
+
description: "[mg.discover] Run `xcrun xctrace list devices` and return parsed devices/simulators with their UDIDs. The LLM should call this before `recordTimeProfile` to discover the right UDID without asking the user. Set `includeOffline: true` to include disconnected devices.",
|
|
123
124
|
inputSchema: listTraceDevicesSchema.shape,
|
|
124
125
|
}, async (input) => {
|
|
125
126
|
const result = await listTraceDevices(input);
|
|
@@ -129,7 +130,7 @@ server.registerTool("listTraceDevices", {
|
|
|
129
130
|
});
|
|
130
131
|
server.registerTool("listTraceTemplates", {
|
|
131
132
|
title: "List xctrace recording templates",
|
|
132
|
-
description: "Run `xcrun xctrace list templates` and return parsed standard + custom templates. Useful when picking a template name for `recordTimeProfile` (e.g. \"Time Profiler\", \"Animation Hitches\", \"Allocations\").",
|
|
133
|
+
description: "[mg.discover] Run `xcrun xctrace list templates` and return parsed standard + custom templates. Useful when picking a template name for `recordTimeProfile` (e.g. \"Time Profiler\", \"Animation Hitches\", \"Allocations\").",
|
|
133
134
|
inputSchema: listTraceTemplatesSchema.shape,
|
|
134
135
|
}, async (input) => {
|
|
135
136
|
const result = await listTraceTemplates(input);
|
|
@@ -139,7 +140,7 @@ server.registerTool("listTraceTemplates", {
|
|
|
139
140
|
});
|
|
140
141
|
server.registerTool("recordTimeProfile", {
|
|
141
142
|
title: "Record a Time Profiler trace",
|
|
142
|
-
description: "Wrapper around `xcrun xctrace record`. Capture a `.trace` bundle from a running app on a device or simulator. Required: exactly 1 of `deviceId`/`simulatorId`, exactly 1 of `attachAppName`/`attachPid`/`launchBundleId`, an `output` path ending in `.trace`. Defaults: template = \"Time Profiler\", durationSec = 90.",
|
|
143
|
+
description: "[mg.trace] Wrapper around `xcrun xctrace record`. Capture a `.trace` bundle from a running app on a device or simulator. Required: exactly 1 of `deviceId`/`simulatorId`, exactly 1 of `attachAppName`/`attachPid`/`launchBundleId`, an `output` path ending in `.trace`. Defaults: template = \"Time Profiler\", durationSec = 90.",
|
|
143
144
|
inputSchema: recordTimeProfileShape,
|
|
144
145
|
}, async (input) => {
|
|
145
146
|
const result = await recordTimeProfile(input);
|
|
@@ -149,7 +150,7 @@ server.registerTool("recordTimeProfile", {
|
|
|
149
150
|
});
|
|
150
151
|
server.registerTool("captureMemgraph", {
|
|
151
152
|
title: "Capture a .memgraph from a running process",
|
|
152
|
-
description: "Wrapper around `leaks --outputGraph`. Resolves `appName` to a PID via `pgrep -x` (or accepts `pid` directly), then writes a `.memgraph` snapshot. **Limitation**: only works for processes running on the local Mac (Mac apps + iOS simulator). Does NOT work for physical iOS devices — use Xcode's Memory Graph button there.",
|
|
153
|
+
description: "[mg.memory] Wrapper around `leaks --outputGraph`. Resolves `appName` to a PID via `pgrep -x` (or accepts `pid` directly), then writes a `.memgraph` snapshot. **Limitation**: only works for processes running on the local Mac (Mac apps + iOS simulator). Does NOT work for physical iOS devices — use Xcode's Memory Graph button there.",
|
|
153
154
|
inputSchema: captureMemgraphShape,
|
|
154
155
|
}, async (input) => {
|
|
155
156
|
const result = await captureMemgraph(input);
|
|
@@ -159,7 +160,7 @@ server.registerTool("captureMemgraph", {
|
|
|
159
160
|
});
|
|
160
161
|
server.registerTool("analyzeAnimationHitches", {
|
|
161
162
|
title: "Analyze animation hitches from a .trace bundle",
|
|
162
|
-
description: "Parse the `animation-hitches` schema from a `.trace` recorded with the Animation Hitches Instruments template. Returns hitch totals, by-type counts, longest hitches, and how many crossed the user-perceptible 100ms threshold.",
|
|
163
|
+
description: "[mg.trace] Parse the `animation-hitches` schema from a `.trace` recorded with the Animation Hitches Instruments template. Returns hitch totals, by-type counts, longest hitches, and how many crossed the user-perceptible 100ms threshold.",
|
|
163
164
|
inputSchema: analyzeAnimationHitchesSchema.shape,
|
|
164
165
|
}, async (input) => {
|
|
165
166
|
const result = await analyzeAnimationHitches(input);
|
|
@@ -167,7 +168,7 @@ server.registerTool("analyzeAnimationHitches", {
|
|
|
167
168
|
});
|
|
168
169
|
server.registerTool("analyzeAllocations", {
|
|
169
170
|
title: "Analyze allocations from a .trace bundle",
|
|
170
|
-
description: "Parse the `allocations` schema from a `.trace` recorded with the Allocations Instruments template. Returns per-category aggregates (cumulative bytes, allocation count, lifecycle = transient/persistent/mixed), top allocators by size and by count, and a one-liner diagnosis identifying the dominant allocator.",
|
|
171
|
+
description: "[mg.trace] Parse the `allocations` schema from a `.trace` recorded with the Allocations Instruments template. Returns per-category aggregates (cumulative bytes, allocation count, lifecycle = transient/persistent/mixed), top allocators by size and by count, and a one-liner diagnosis identifying the dominant allocator.",
|
|
171
172
|
inputSchema: analyzeAllocationsSchema.shape,
|
|
172
173
|
}, async (input) => {
|
|
173
174
|
const result = await analyzeAllocations(input);
|
|
@@ -175,7 +176,7 @@ server.registerTool("analyzeAllocations", {
|
|
|
175
176
|
});
|
|
176
177
|
server.registerTool("analyzeAppLaunch", {
|
|
177
178
|
title: "Analyze cold/warm launch breakdown",
|
|
178
|
-
description: "Parse the `app-launch` schema from a `.trace` recorded with the App Launch Instruments template. Returns total launch time, launch type (cold/warm), per-phase breakdown (process-creation, dyld-init, ObjC-init, AppDelegate, first-frame), and the slowest phase.",
|
|
179
|
+
description: "[mg.trace] Parse the `app-launch` schema from a `.trace` recorded with the App Launch Instruments template. Returns total launch time, launch type (cold/warm), per-phase breakdown (process-creation, dyld-init, ObjC-init, AppDelegate, first-frame), and the slowest phase.",
|
|
179
180
|
inputSchema: analyzeAppLaunchSchema.shape,
|
|
180
181
|
}, async (input) => {
|
|
181
182
|
const result = await analyzeAppLaunch(input);
|
|
@@ -183,7 +184,7 @@ server.registerTool("analyzeAppLaunch", {
|
|
|
183
184
|
});
|
|
184
185
|
server.registerTool("renderCycleGraph", {
|
|
185
186
|
title: "Render a retain cycle as Mermaid or DOT graph",
|
|
186
|
-
description: "Read a `.memgraph`, pick a ROOT CYCLE by index, and emit the chain as a Mermaid graph definition (default — embeddable in markdown / GitHub) or a Graphviz DOT file. App-level classes are highlighted; CYCLE BACK terminators are styled distinctly. Use `cycleIndex` to render cycles other than the first.",
|
|
187
|
+
description: "[mg.render] Read a `.memgraph`, pick a ROOT CYCLE by index, and emit the chain as a Mermaid graph definition (default — embeddable in markdown / GitHub) or a Graphviz DOT file. App-level classes are highlighted; CYCLE BACK terminators are styled distinctly. Use `cycleIndex` to render cycles other than the first.",
|
|
187
188
|
inputSchema: renderCycleGraphSchema.shape,
|
|
188
189
|
}, async (input) => {
|
|
189
190
|
const result = await renderCycleGraph(input);
|
|
@@ -191,7 +192,7 @@ server.registerTool("renderCycleGraph", {
|
|
|
191
192
|
});
|
|
192
193
|
server.registerTool("logShow", {
|
|
193
194
|
title: "Query macOS unified logging (one-shot)",
|
|
194
|
-
description: "Wrap `log show --style compact --last <window>` with optional NSPredicate filter, process and subsystem sugar. Returns parsed entries (timestamp, type, process, pid, subsystem, category, message) bounded by `maxEntries`. Use this to look back at app logs without leaving chat.",
|
|
195
|
+
description: "[mg.log] Wrap `log show --style compact --last <window>` with optional NSPredicate filter, process and subsystem sugar. Returns parsed entries (timestamp, type, process, pid, subsystem, category, message) bounded by `maxEntries`. Use this to look back at app logs without leaving chat.",
|
|
195
196
|
inputSchema: logShowSchema.shape,
|
|
196
197
|
}, async (input) => {
|
|
197
198
|
const result = await logShow(input);
|
|
@@ -199,7 +200,7 @@ server.registerTool("logShow", {
|
|
|
199
200
|
});
|
|
200
201
|
server.registerTool("logStream", {
|
|
201
202
|
title: "Stream macOS unified logging for a bounded window",
|
|
202
|
-
description: "Wrap `log stream --style compact` for a bounded duration (≤60 s — MCP requests should not block longer). Returns parsed entries collected during the window. Useful for capturing a specific user flow without setting up a full Console.app session.",
|
|
203
|
+
description: "[mg.log] Wrap `log stream --style compact` for a bounded duration (≤60 s — MCP requests should not block longer). Returns parsed entries collected during the window. Useful for capturing a specific user flow without setting up a full Console.app session.",
|
|
203
204
|
inputSchema: logStreamSchema.shape,
|
|
204
205
|
}, async (input) => {
|
|
205
206
|
const result = await logStream(input);
|
|
@@ -207,7 +208,7 @@ server.registerTool("logStream", {
|
|
|
207
208
|
});
|
|
208
209
|
server.registerTool("detectLeaksInXCUITest", {
|
|
209
210
|
title: "Run an XCUITest with leak detection (CI-runnable)",
|
|
210
|
-
description: "Build the workspace for testing, launch the test cycle, capture a baseline `.memgraph` once the app appears, run the test to completion, capture an after `.memgraph`, and diff. Returns `passed: false` when new ROOT CYCLE blocks appear that aren't in the `allowlistPatterns` list. Designed for CI gating — non-zero exit code on failure.",
|
|
211
|
+
description: "[mg.ci] Build the workspace for testing, launch the test cycle, capture a baseline `.memgraph` once the app appears, run the test to completion, capture an after `.memgraph`, and diff. Returns `passed: false` when new ROOT CYCLE blocks appear that aren't in the `allowlistPatterns` list. Designed for CI gating — non-zero exit code on failure.",
|
|
211
212
|
inputSchema: detectLeaksInXCUITestSchema.shape,
|
|
212
213
|
}, async (input) => {
|
|
213
214
|
const result = await detectLeaksInXCUITest(input);
|
|
@@ -215,7 +216,7 @@ server.registerTool("detectLeaksInXCUITest", {
|
|
|
215
216
|
});
|
|
216
217
|
server.registerTool("reachableFromCycle", {
|
|
217
218
|
title: "Count instances reachable from a specific cycle root",
|
|
218
|
-
description: "Cycle-scoped reachability + class counting. Answers questions like \"how many `NSURLSessionConfiguration` instances are reachable from the cycle rooted at `DetailViewModel`?\" — distinguishing the actual culprit (the cycle root) from its retained dependencies. Pick a cycle by zero-based `cycleIndex` or by `rootClassName` substring. Returns per-class counts ranked by occurrence, plus the total reachable node count.",
|
|
219
|
+
description: "[mg.memory] Cycle-scoped reachability + class counting. Answers questions like \"how many `NSURLSessionConfiguration` instances are reachable from the cycle rooted at `DetailViewModel`?\" — distinguishing the actual culprit (the cycle root) from its retained dependencies. Pick a cycle by zero-based `cycleIndex` or by `rootClassName` substring. Returns per-class counts ranked by occurrence, plus the total reachable node count.",
|
|
219
220
|
inputSchema: reachableFromCycleSchema.shape,
|
|
220
221
|
}, async (input) => {
|
|
221
222
|
const result = await reachableFromCycle(input);
|
|
@@ -225,7 +226,7 @@ server.registerTool("reachableFromCycle", {
|
|
|
225
226
|
});
|
|
226
227
|
server.registerTool("swiftGetSymbolDefinition", {
|
|
227
228
|
title: "Locate a Swift symbol's source declaration",
|
|
228
|
-
description: "Find the file:line where a Swift symbol (class, struct, enum, protocol, func, var, etc.) is declared. Pre-scans `candidatePaths` (or `hint.filePath`) with a fast regex first, then asks SourceKit-LSP for jump-to-definition. Returns the position even when LSP can't follow through. Use after `findRetainers` / `classifyCycle` surface a class name from a memgraph cycle to land in the actual source file.",
|
|
229
|
+
description: "[mg.code] Find the file:line where a Swift symbol (class, struct, enum, protocol, func, var, etc.) is declared. Pre-scans `candidatePaths` (or `hint.filePath`) with a fast regex first, then asks SourceKit-LSP for jump-to-definition. Returns the position even when LSP can't follow through. Use after `findRetainers` / `classifyCycle` surface a class name from a memgraph cycle to land in the actual source file.",
|
|
229
230
|
inputSchema: swiftGetSymbolDefinitionSchema.shape,
|
|
230
231
|
}, async (input) => {
|
|
231
232
|
const result = await swiftGetSymbolDefinition(input);
|
|
@@ -233,7 +234,7 @@ server.registerTool("swiftGetSymbolDefinition", {
|
|
|
233
234
|
});
|
|
234
235
|
server.registerTool("swiftFindSymbolReferences", {
|
|
235
236
|
title: "Find every reference to a Swift symbol",
|
|
236
|
-
description: "Locates the symbol's declaration in `filePath`, then asks SourceKit-LSP for `textDocument/references`. Returns every callsite + capture across the project, with a snippet of each line. **Requires an IndexStoreDB** at `<projectRoot>/.build/index/store` for cross-file references — build it with `swift build -Xswiftc -index-store-path -Xswiftc <projectRoot>/.build/index/store`. The result includes a `needsIndex: true` hint when the index is missing.",
|
|
237
|
+
description: "[mg.code] Locates the symbol's declaration in `filePath`, then asks SourceKit-LSP for `textDocument/references`. Returns every callsite + capture across the project, with a snippet of each line. **Requires an IndexStoreDB** at `<projectRoot>/.build/index/store` for cross-file references — build it with `swift build -Xswiftc -index-store-path -Xswiftc <projectRoot>/.build/index/store`. The result includes a `needsIndex: true` hint when the index is missing.",
|
|
237
238
|
inputSchema: swiftFindSymbolReferencesSchema.shape,
|
|
238
239
|
}, async (input) => {
|
|
239
240
|
const result = await swiftFindSymbolReferences(input);
|
|
@@ -241,7 +242,7 @@ server.registerTool("swiftFindSymbolReferences", {
|
|
|
241
242
|
});
|
|
242
243
|
server.registerTool("swiftGetSymbolsOverview", {
|
|
243
244
|
title: "List top-level symbols in a Swift file",
|
|
244
|
-
description: "Cheap orientation: returns the top-level symbols (classes, structs, enums, protocols, free functions) declared in a Swift file via SourceKit-LSP's `documentSymbol`. Set `topLevelOnly: false` for nested children too. Useful right after `swiftGetSymbolDefinition` lands you in a new file.",
|
|
245
|
+
description: "[mg.code] Cheap orientation: returns the top-level symbols (classes, structs, enums, protocols, free functions) declared in a Swift file via SourceKit-LSP's `documentSymbol`. Set `topLevelOnly: false` for nested children too. Useful right after `swiftGetSymbolDefinition` lands you in a new file.",
|
|
245
246
|
inputSchema: swiftGetSymbolsOverviewSchema.shape,
|
|
246
247
|
}, async (input) => {
|
|
247
248
|
const result = await swiftGetSymbolsOverview(input);
|
|
@@ -249,7 +250,7 @@ server.registerTool("swiftGetSymbolsOverview", {
|
|
|
249
250
|
});
|
|
250
251
|
server.registerTool("swiftGetHoverInfo", {
|
|
251
252
|
title: "Get type info / docs at a Swift source position",
|
|
252
|
-
description: "SourceKit-LSP `textDocument/hover` at a (line, character) position. Returns the markdown / plaintext hover content plus a best-effort extracted declaration fragment. Use to disambiguate `self` captures: a class self in a closure can leak; a struct self can't.",
|
|
253
|
+
description: "[mg.code] SourceKit-LSP `textDocument/hover` at a (line, character) position. Returns the markdown / plaintext hover content plus a best-effort extracted declaration fragment. Use to disambiguate `self` captures: a class self in a closure can leak; a struct self can't.",
|
|
253
254
|
inputSchema: swiftGetHoverInfoSchema.shape,
|
|
254
255
|
}, async (input) => {
|
|
255
256
|
const result = await swiftGetHoverInfo(input);
|
|
@@ -257,12 +258,20 @@ server.registerTool("swiftGetHoverInfo", {
|
|
|
257
258
|
});
|
|
258
259
|
server.registerTool("swiftSearchPattern", {
|
|
259
260
|
title: "Regex-search a Swift file (no LSP)",
|
|
260
|
-
description: "Pure regex search over a file's contents — no SourceKit-LSP, no IndexStoreDB. Catches what LSP misses: closure capture lists (`[weak self]`, `[unowned self]`), `Task { ... self ... }` blocks, and any other pattern the agent constructs from a leak chain. Returns matches with line/character positions and a trimmed snippet.",
|
|
261
|
+
description: "[mg.code] Pure regex search over a file's contents — no SourceKit-LSP, no IndexStoreDB. Catches what LSP misses: closure capture lists (`[weak self]`, `[unowned self]`), `Task { ... self ... }` blocks, and any other pattern the agent constructs from a leak chain. Returns matches with line/character positions and a trimmed snippet.",
|
|
261
262
|
inputSchema: swiftSearchPatternSchema.shape,
|
|
262
263
|
}, async (input) => {
|
|
263
264
|
const result = await swiftSearchPattern(input);
|
|
264
265
|
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
265
266
|
});
|
|
267
|
+
server.registerTool("getInvestigationPlaybook", {
|
|
268
|
+
title: "Get the canonical tool sequence for a known investigation kind",
|
|
269
|
+
description: "[meta] Returns a versioned, declarative pipeline for a known investigation flow (`memgraph-leak`, `perf-hangs`, `ui-jank`, `app-launch-slow`, `verify-fix`). Each step has a tool name, purpose, and argsTemplate. Use this once at the start of an investigation so any LLM agent can follow the right sequence without rediscovering it from individual tool descriptions.",
|
|
270
|
+
inputSchema: getInvestigationPlaybookSchema.shape,
|
|
271
|
+
}, async (input) => {
|
|
272
|
+
const result = await getInvestigationPlaybook(input);
|
|
273
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
274
|
+
});
|
|
266
275
|
async function main() {
|
|
267
276
|
// CLI mode: when called with arguments, run the synchronous CLI wrapper.
|
|
268
277
|
// No arguments → start the MCP server over stdio (the default and the
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,eAAe,EACf,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACL,aAAa,EACb,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACL,aAAa,EACb,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,EACb,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,eAAe,EACf,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,+BAA+B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AAE,CAAC,EAAE,CAAC;AAChF,CAAC,CACF,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,yEAAyE;IACzE,sEAAsE;IACtE,sBAAsB;IACtB,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for building `suggestedNextCalls` arrays. Centralized so multiple
|
|
3
|
+
* tools agree on the same heuristics for "which class is most actionable"
|
|
4
|
+
* and "which followup is most useful".
|
|
5
|
+
*/
|
|
6
|
+
import type { CycleSummary } from "../tools/analyzeMemgraph.js";
|
|
7
|
+
import type { NextCallSuggestion } from "../types.js";
|
|
8
|
+
/** True when this class name looks like the user's own code (not stdlib / system). */
|
|
9
|
+
export declare function looksAppLevel(className: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* From a list of class names in a cycle, pick the most likely "the thing the
|
|
12
|
+
* user wrote" — the dominant app-level class. Used to seed swift* followups.
|
|
13
|
+
*/
|
|
14
|
+
export declare function pickPrimaryAppClass(classNames: string[]): string | null;
|
|
15
|
+
/** Pull primary app-level class from a CycleSummary's chain. */
|
|
16
|
+
export declare function primaryAppClassFor(summary: CycleSummary): string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Build a suggestedNextCalls array for `classifyCycle`'s output.
|
|
19
|
+
* Maps the matched pattern + the cycle root to the most useful followups.
|
|
20
|
+
*/
|
|
21
|
+
export declare function suggestionsForClassification(opts: {
|
|
22
|
+
patternId: string | null;
|
|
23
|
+
rootClass: string;
|
|
24
|
+
appLevelClass: string | null;
|
|
25
|
+
}): NextCallSuggestion[];
|
|
26
|
+
/** Build suggestion to call swiftFindSymbolReferences for a class name. */
|
|
27
|
+
export declare function suggestionFindReferences(opts: {
|
|
28
|
+
symbolName: string;
|
|
29
|
+
filePath?: string;
|
|
30
|
+
}): NextCallSuggestion;
|
|
31
|
+
/** Build suggestion to call swiftGetSymbolDefinition for a class name. */
|
|
32
|
+
export declare function suggestionGetDefinition(opts: {
|
|
33
|
+
symbolName: string;
|
|
34
|
+
candidatePaths?: string[];
|
|
35
|
+
}): NextCallSuggestion;
|
|
36
|
+
/** Build suggestion to call classifyCycle (used after analyzeMemgraph). */
|
|
37
|
+
export declare function suggestionClassifyCycle(opts: {
|
|
38
|
+
path: string;
|
|
39
|
+
}): NextCallSuggestion;
|
|
40
|
+
/** Build suggestion to call reachableFromCycle (used after analyzeMemgraph). */
|
|
41
|
+
export declare function suggestionReachableFromCycle(opts: {
|
|
42
|
+
path: string;
|
|
43
|
+
cycleIndex?: number;
|
|
44
|
+
}): NextCallSuggestion;
|