@perfonext/render-mcp 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -86
- package/dist/index.js +1 -1
- package/dist/ingest/server.d.ts +5 -0
- package/dist/ingest/server.d.ts.map +1 -1
- package/dist/ingest/server.js +183 -77
- package/dist/ingest/server.js.map +1 -1
- package/dist/parser/analysis.d.ts.map +1 -1
- package/dist/parser/analysis.js +84 -70
- package/dist/parser/analysis.js.map +1 -1
- package/dist/parser/react-profile.d.ts.map +1 -1
- package/dist/parser/react-profile.js +1 -3
- package/dist/parser/react-profile.js.map +1 -1
- package/dist/parser/react-scan-lite.d.ts.map +1 -1
- package/dist/parser/react-scan-lite.js +20 -6
- package/dist/parser/react-scan-lite.js.map +1 -1
- package/dist/store.js +1 -1
- package/dist/store.js.map +1 -1
- package/dist/tools/begin-render-analysis.d.ts.map +1 -1
- package/dist/tools/begin-render-analysis.js +1 -1
- package/dist/tools/begin-render-analysis.js.map +1 -1
- package/dist/tools/compare-renders.d.ts.map +1 -1
- package/dist/tools/compare-renders.js +16 -4
- package/dist/tools/compare-renders.js.map +1 -1
- package/dist/tools/get-captured-renders.d.ts.map +1 -1
- package/dist/tools/get-captured-renders.js +8 -2
- package/dist/tools/get-captured-renders.js.map +1 -1
- package/dist/tools/get-hot-commits.d.ts.map +1 -1
- package/dist/tools/get-hot-commits.js +24 -7
- package/dist/tools/get-hot-commits.js.map +1 -1
- package/dist/tools/get-render-summary.d.ts.map +1 -1
- package/dist/tools/get-render-summary.js +23 -10
- package/dist/tools/get-render-summary.js.map +1 -1
- package/dist/tools/get-rerender-causes.d.ts.map +1 -1
- package/dist/tools/get-rerender-causes.js +17 -5
- package/dist/tools/get-rerender-causes.js.map +1 -1
- package/dist/tools/get-slow-components.d.ts.map +1 -1
- package/dist/tools/get-slow-components.js +20 -5
- package/dist/tools/get-slow-components.js.map +1 -1
- package/dist/tools/load-render-profile.d.ts.map +1 -1
- package/dist/tools/load-render-profile.js +7 -3
- package/dist/tools/load-render-profile.js.map +1 -1
- package/dist/tools/run-render-capture.d.ts.map +1 -1
- package/dist/tools/run-render-capture.js +7 -3
- package/dist/tools/run-render-capture.js.map +1 -1
- package/dist/tools/stop-render-capture.d.ts.map +1 -1
- package/dist/tools/stop-render-capture.js +20 -4
- package/dist/tools/stop-render-capture.js.map +1 -1
- package/package.json +16 -5
package/README.md
CHANGED
|
@@ -1,12 +1,55 @@
|
|
|
1
1
|
# perfonext-render-mcp
|
|
2
2
|
|
|
3
|
+
> Analyze React render behavior in Next.js apps and apply fixes in the editor.
|
|
4
|
+
|
|
3
5
|
[](https://www.npmjs.com/package/@perfonext/render-mcp)
|
|
6
|
+
[](https://www.npmjs.com/package/@perfonext/render-mcp)
|
|
7
|
+
[](https://www.npmjs.com/package/@perfonext/render-mcp)
|
|
8
|
+
|
|
9
|
+
`perfonext-render-mcp` is a Model Context Protocol (MCP) server that gives GitHub Copilot, Claude Desktop,
|
|
10
|
+
Claude Code, and other MCP clients structured, machine-readable React render analysis for Next.js performance
|
|
11
|
+
work. It turns live capture sessions and React DevTools Profiler exports into component costs, exact rerender
|
|
12
|
+
causes, and regression diffs — evidence Copilot can act on directly.
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
Run directly with `npx`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx -y @perfonext/render-mcp
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or install globally:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g @perfonext/render-mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The executable command remains `perfonext-render-mcp` after installation.
|
|
29
|
+
|
|
30
|
+
Add the server to VS Code in `.vscode/mcp.json` (the workspace MCP configuration file):
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"servers": {
|
|
35
|
+
"perfonext-render": {
|
|
36
|
+
"type": "stdio",
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["-y", "@perfonext/render-mcp"]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then reload the VS Code window and run **MCP: List Servers** to start it, or accept the trust prompt when it appears. For a locally-built checkout, point `command`/`args` at `node` and the repo's `dist/index.js` instead.
|
|
4
45
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
46
|
+
Then ask Copilot: _"Run a render analysis on my app."_
|
|
47
|
+
|
|
48
|
+
## What It Does
|
|
8
49
|
|
|
9
|
-
|
|
50
|
+
`perfonext-render-mcp` is the **agent companion** to React DevTools Profiler and `react-scan` — best at
|
|
51
|
+
machine-readable summaries, exact rerender-cause attribution, source-aware follow-up, and diffing. The loop is
|
|
52
|
+
**collect → analyze → fix**, all locally:
|
|
10
53
|
|
|
11
54
|
- **collect** — choose live capture (react-scan/lite streams events in real time) or manual DevTools export
|
|
12
55
|
- **analyze** — the MCP returns structured, machine-readable evidence: component costs, rerender causes, commit breakdowns, and regressions
|
|
@@ -15,7 +58,7 @@ The loop is **collect → analyze → fix**, all locally:
|
|
|
15
58
|
> **Note:** while a live capture session is active, React DevTools Timeline Profiler will not receive events
|
|
16
59
|
> (react-scan/lite takes over the profiling channel). Calling `stop_render_capture` restores it.
|
|
17
60
|
|
|
18
|
-
|
|
61
|
+
Capabilities:
|
|
19
62
|
|
|
20
63
|
- **live capture** — streams per-commit fiber events from a running React app directly into the MCP over a local HTTP endpoint; no manual export required
|
|
21
64
|
- **manual export** — loads exported React DevTools Profiler JSON files as an alternative input path
|
|
@@ -33,38 +76,39 @@ The loop is **collect → analyze → fix**, all locally:
|
|
|
33
76
|
|
|
34
77
|
### Entry point
|
|
35
78
|
|
|
36
|
-
| Tool
|
|
37
|
-
|
|
79
|
+
| Tool | Description |
|
|
80
|
+
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
38
81
|
| `begin_render_analysis` | Entry point. Accepts `approach: "live" \| "manual"`. For `live`: starts a capture session and returns the instrumentation snippet. For `manual`: returns React DevTools Profiler export steps. |
|
|
39
82
|
|
|
40
83
|
### Live capture
|
|
41
84
|
|
|
42
|
-
| Tool
|
|
43
|
-
|
|
44
|
-
| `run_render_capture`
|
|
45
|
-
| `stop_render_capture`
|
|
46
|
-
| `get_captured_renders` | Optional diagnostic: peek at session progress without stopping (commit count, unknown events). Only call if something seems wrong.
|
|
85
|
+
| Tool | Description |
|
|
86
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
87
|
+
| `run_render_capture` | Called after instrumentation is wired up. Accepts `method: "manual-interaction" \| "test-suite"`. Returns focused instructions for whichever method the user picks. Test suites must run **headed** (e.g. `playwright test --headed`) so React profiling hooks activate. |
|
|
88
|
+
| `stop_render_capture` | Stop the session, finalize buffered events into a profile, and return a `profileId` plus `dataQuality` (`exact` \| `heuristic`) for analysis |
|
|
89
|
+
| `get_captured_renders` | Optional diagnostic: peek at session progress without stopping (commit count, unknown events). Only call if something seems wrong. |
|
|
47
90
|
|
|
48
91
|
### Analysis
|
|
49
92
|
|
|
50
|
-
| Tool
|
|
51
|
-
|
|
52
|
-
| `load_render_profile` | Parse and load an exported React DevTools Profiler JSON file from disk (manual path entry point)
|
|
53
|
-
| `get_render_summary`
|
|
54
|
-
| `get_hot_commits`
|
|
55
|
-
| `get_slow_components` | Rank the slowest components by total actual render time
|
|
93
|
+
| Tool | Description |
|
|
94
|
+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `load_render_profile` | Parse and load an exported React DevTools Profiler JSON file from disk (manual path entry point) |
|
|
96
|
+
| `get_render_summary` | Summarize a loaded profile: top components by render cost, hottest commits, and detected render issues |
|
|
97
|
+
| `get_hot_commits` | Rank the most expensive commits and show the top components inside each spike |
|
|
98
|
+
| `get_slow_components` | Rank the slowest components by total actual render time |
|
|
56
99
|
| `get_rerender_causes` | Explain rerender causes with evidence, confidence, and a risk score. Reports exact changed props/state/hooks when `changeDescription` data is present (`dataQuality: "exact"`), heuristics otherwise |
|
|
57
|
-
| `compare_renders`
|
|
100
|
+
| `compare_renders` | Diff two loaded render profiles and rank regressions, improvements, additions, and removals |
|
|
58
101
|
|
|
59
|
-
##
|
|
102
|
+
## Usage Walkthrough
|
|
60
103
|
|
|
61
|
-
Ask Copilot:
|
|
104
|
+
Ask Copilot: _"Run a render analysis on my app."_
|
|
62
105
|
|
|
63
106
|
Copilot calls `begin_render_analysis` and asks you to choose:
|
|
64
107
|
|
|
65
108
|
**Option A — Live capture (recommended)**
|
|
66
109
|
|
|
67
110
|
Copilot will:
|
|
111
|
+
|
|
68
112
|
1. Start a capture session (ingest server on `127.0.0.1:7721`)
|
|
69
113
|
2. Install `react-scan` as a devDependency if not present
|
|
70
114
|
3. Write `instrumentation-client.js` at your project root with the session snippet
|
|
@@ -85,30 +129,6 @@ The ingest server runs on a **fixed port (7721)**. Only the `sessionId` line in
|
|
|
85
129
|
3. Export the JSON and share the file path
|
|
86
130
|
4. Copilot calls `load_render_profile({ filePath: "..." })`
|
|
87
131
|
|
|
88
|
-
## Rerender Score Contract
|
|
89
|
-
|
|
90
|
-
`get_rerender_causes` returns a `dataQuality`, and per component a `score`, `scoreBand`, `confidence`,
|
|
91
|
-
`evidence[]`, and (when known) a `source` file/line.
|
|
92
|
-
|
|
93
|
-
- `dataQuality`:
|
|
94
|
-
- `exact`: at least one fiber carried real `changeDescription` data (live capture in a headed browser), so
|
|
95
|
-
causes name the specific props/state/hooks that changed
|
|
96
|
-
- `heuristic`: no diff data available (DevTools JSON export, or a headless run), so causes are inferred from
|
|
97
|
-
render patterns
|
|
98
|
-
- `score`: a `0-10` rerender-risk score
|
|
99
|
-
- `scoreBand`:
|
|
100
|
-
- `low`: `0.0-2.9`
|
|
101
|
-
- `medium`: `3.0-5.9`
|
|
102
|
-
- `high`: `6.0-10.0`
|
|
103
|
-
- `confidence`: how many independent evidence signals supported the finding
|
|
104
|
-
- `low`: one weak signal or only fallback export evidence
|
|
105
|
-
- `medium`: two independent signals
|
|
106
|
-
- `high`: three or more independent signals
|
|
107
|
-
- `evidence[]`: machine-readable signals such as exact change descriptions, repeated updates, nested-update
|
|
108
|
-
propagation, wide commit spread, or high actual-vs-self duration ratio
|
|
109
|
-
|
|
110
|
-
The score ranks investigation order, not exact root cause.
|
|
111
|
-
|
|
112
132
|
## Example Copilot Prompts
|
|
113
133
|
|
|
114
134
|
- "Run a render analysis on my app."
|
|
@@ -116,49 +136,12 @@ The score ranks investigation order, not exact root cause.
|
|
|
116
136
|
- "Which components are re-rendering the most and why?"
|
|
117
137
|
- "Compare this run to the profile I captured before the refactor."
|
|
118
138
|
- "I already have a React DevTools export — load it and tell me what's slow."
|
|
139
|
+
- "Show me the hottest commits and which components dominated each spike."
|
|
119
140
|
|
|
120
|
-
##
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
Run directly with `npx`:
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
npx -y @perfonext/render-mcp
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Or install globally:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
npm install -g @perfonext/render-mcp
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
The executable command remains `perfonext-render-mcp` after installation.
|
|
136
|
-
|
|
137
|
-
## MCP Configuration
|
|
138
|
-
|
|
139
|
-
Add to your VS Code `settings.json`:
|
|
140
|
-
|
|
141
|
-
```json
|
|
142
|
-
{
|
|
143
|
-
"mcp": {
|
|
144
|
-
"servers": {
|
|
145
|
-
"perfonext-render": {
|
|
146
|
-
"command": "npx",
|
|
147
|
-
"args": ["-y", "@perfonext/render-mcp"]
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Example Copilot Prompts
|
|
141
|
+
## Related Perfonext Tools
|
|
155
142
|
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
- "Which components are re-rendering the most and why?"
|
|
159
|
-
- "Compare this run to the profile I captured before the refactor."
|
|
160
|
-
- "I already have a React DevTools export — load it and tell me what's slow."
|
|
161
|
-
- "Show me the hottest commits and which components dominated each spike."
|
|
143
|
+
- [perfonext-profiler-mcp](https://github.com/souvikdu/perfonext-profiler-mcp) — CPU profiling (V8/Chrome) for Next.js servers
|
|
144
|
+
- [perfonext-build-mcp](https://github.com/souvikdu/perfonext-build-mcp) — Next.js bundle/build analysis
|
|
162
145
|
|
|
163
146
|
## Development
|
|
164
147
|
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import { registerStopRenderCapture } from './tools/stop-render-capture.js';
|
|
|
13
13
|
import { registerGetCapturedRenders } from './tools/get-captured-renders.js';
|
|
14
14
|
const server = new McpServer({
|
|
15
15
|
name: 'perfonext-render-mcp',
|
|
16
|
-
version: '0.3.
|
|
16
|
+
version: '0.3.3',
|
|
17
17
|
});
|
|
18
18
|
registerLoadRenderProfile(server);
|
|
19
19
|
registerCompareRenders(server);
|
package/dist/ingest/server.d.ts
CHANGED
|
@@ -45,6 +45,11 @@ export interface CaptureSession {
|
|
|
45
45
|
* is not wired correctly (e.g. the import path is wrong or the file runs server-side). */
|
|
46
46
|
unknownEvents: number;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Closes the ingest server and clears all sessions.
|
|
50
|
+
* @internal Test-only teardown hook — not part of the public tool surface.
|
|
51
|
+
*/
|
|
52
|
+
export declare function stopIngestServer(): Promise<void>;
|
|
48
53
|
export declare function createCaptureSession(): Promise<CaptureSession>;
|
|
49
54
|
export declare function getCaptureSession(sessionId: string): CaptureSession | undefined;
|
|
50
55
|
export declare function stopCaptureSession(sessionId: string): CaptureSession | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","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AAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,kBAAkB,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB;;+FAE2F;IAC3F,aAAa,EAAE,MAAM,CAAC;CACvB;AAgND;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAatD;AAMD,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,cAAc,CAAC,CAoBpE;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAE/E;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAKhF;AAED,qEAAqE;AACrE,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAE5D;AAED,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAE7C"}
|
package/dist/ingest/server.js
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import { createServer } from 'node:http';
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
|
+
/** Coerces to a finite, non-negative duration — rejects NaN/Infinity/negative wire data. */
|
|
4
|
+
function toFiniteDuration(value) {
|
|
5
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : 0;
|
|
6
|
+
}
|
|
3
7
|
function normalizeFiber(raw) {
|
|
4
8
|
const cd = raw.changeDescription ?? null;
|
|
9
|
+
const actualDuration = toFiniteDuration(raw.actualDuration);
|
|
10
|
+
const rawSelfDuration = toFiniteDuration(raw.selfBaseDuration);
|
|
5
11
|
return {
|
|
6
12
|
fiberId: typeof raw.fiberId === 'number' ? raw.fiberId : 0,
|
|
7
|
-
name:
|
|
13
|
+
name: typeof raw.name === 'string' && raw.name.trim() ? raw.name.trim() : '(anonymous)',
|
|
8
14
|
depth: typeof raw.depth === 'number' ? raw.depth : 0,
|
|
9
|
-
actualDuration
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
actualDuration,
|
|
16
|
+
// selfBaseDuration is measured independently of actualDuration and can exceed
|
|
17
|
+
// it in practice; clamp so self-cost ratios derived downstream stay <= 1.
|
|
18
|
+
selfDuration: Math.min(rawSelfDuration, actualDuration),
|
|
19
|
+
changeDescription: cd != null
|
|
20
|
+
? {
|
|
21
|
+
isFirstMount: cd.isFirstMount ?? false,
|
|
22
|
+
props: cd.props ?? null,
|
|
23
|
+
state: cd.state ? ['state'] : null,
|
|
24
|
+
context: cd.context ? ['context'] : null,
|
|
25
|
+
hooks: cd.hooks?.map((i) => `hook[${i}]`) ?? null,
|
|
26
|
+
parent: cd.parent ?? false,
|
|
27
|
+
}
|
|
28
|
+
: null,
|
|
29
|
+
source: raw.source && typeof raw.source === 'object' ? raw.source : null,
|
|
20
30
|
parentId: null,
|
|
21
31
|
};
|
|
22
32
|
}
|
|
@@ -27,14 +37,18 @@ function parseOneEvent(raw, commitIndex, urlSessionId) {
|
|
|
27
37
|
// ── Native react-scan/lite endpoint format ────────────────────────────────
|
|
28
38
|
// Body: { message: LiteEventKind, data: {...}, sessionId, timestamp }
|
|
29
39
|
if (typeof r.message === 'string') {
|
|
30
|
-
const data =
|
|
40
|
+
const data = r.data && typeof r.data === 'object' ? r.data : {};
|
|
31
41
|
const ts = typeof r.timestamp === 'number' ? r.timestamp : Date.now();
|
|
32
42
|
if (r.message === 'commit') {
|
|
33
43
|
const tree = Array.isArray(data.tree) ? data.tree : [];
|
|
34
44
|
const fibers = tree.map(normalizeFiber);
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
45
|
+
// A commit can report more than one depth-0 fiber (independent root subtrees,
|
|
46
|
+
// e.g. a layout boundary alongside a page boundary) — sum them all rather than
|
|
47
|
+
// taking only the first, which silently dropped the rest of the committed work.
|
|
48
|
+
const rootDurations = fibers.filter((f) => f.depth === 0).map((f) => f.actualDuration);
|
|
49
|
+
const duration = rootDurations.length > 0
|
|
50
|
+
? rootDurations.reduce((s, d) => s + d, 0)
|
|
51
|
+
: fibers.reduce((s, f) => s + f.actualDuration, 0);
|
|
38
52
|
return {
|
|
39
53
|
kind: 'commit',
|
|
40
54
|
event: {
|
|
@@ -67,92 +81,164 @@ let serverPort = null;
|
|
|
67
81
|
// ---------------------------------------------------------------------------
|
|
68
82
|
// Internal helpers
|
|
69
83
|
// ---------------------------------------------------------------------------
|
|
84
|
+
// Caps memory use for a single POST — a render-storm capture can otherwise buffer
|
|
85
|
+
// an unbounded stream of events from a runaway page.
|
|
86
|
+
const MAX_BODY_BYTES = 20 * 1024 * 1024;
|
|
87
|
+
class PayloadTooLargeError extends Error {
|
|
88
|
+
}
|
|
70
89
|
function readBody(req) {
|
|
71
90
|
return new Promise((resolve, reject) => {
|
|
72
91
|
const chunks = [];
|
|
73
|
-
|
|
92
|
+
let total = 0;
|
|
93
|
+
const onData = (chunk) => {
|
|
94
|
+
total += chunk.length;
|
|
95
|
+
if (total > MAX_BODY_BYTES) {
|
|
96
|
+
// Don't destroy the socket — that resets the connection before the 413
|
|
97
|
+
// response can flush. Stop listening and drain the rest of the body instead.
|
|
98
|
+
req.off('data', onData);
|
|
99
|
+
req.resume();
|
|
100
|
+
reject(new PayloadTooLargeError('request body exceeds size limit'));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
chunks.push(chunk);
|
|
104
|
+
};
|
|
105
|
+
req.on('data', onData);
|
|
74
106
|
req.on('end', () => resolve(Buffer.concat(chunks).toString('utf-8')));
|
|
75
107
|
req.on('error', reject);
|
|
76
108
|
});
|
|
77
109
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const url = req.url ?? '';
|
|
88
|
-
const match = url.match(/^\/ingest\/([^/]+)$/);
|
|
89
|
-
if (!match || req.method !== 'POST') {
|
|
90
|
-
res.writeHead(404);
|
|
91
|
-
res.end(JSON.stringify({ error: 'not found' }));
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const sessionId = decodeURIComponent(match[1]);
|
|
95
|
-
const session = sessions.get(sessionId);
|
|
96
|
-
if (!session) {
|
|
97
|
-
res.writeHead(404);
|
|
98
|
-
res.end(JSON.stringify({ error: 'session not found' }));
|
|
99
|
-
return;
|
|
110
|
+
/** Echoes the request Origin only for localhost/127.0.0.1 — this endpoint should
|
|
111
|
+
* only ever be called by the instrumented app itself, not an arbitrary open tab. */
|
|
112
|
+
function corsOrigin(req) {
|
|
113
|
+
const origin = req.headers.origin;
|
|
114
|
+
if (!origin)
|
|
115
|
+
return null;
|
|
116
|
+
try {
|
|
117
|
+
const { hostname } = new URL(origin);
|
|
118
|
+
return hostname === 'localhost' || hostname === '127.0.0.1' ? origin : null;
|
|
100
119
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
res.end(JSON.stringify({ error: 'session already stopped' }));
|
|
104
|
-
return;
|
|
120
|
+
catch {
|
|
121
|
+
return null;
|
|
105
122
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
123
|
+
}
|
|
124
|
+
function handleRequest(req, res) {
|
|
125
|
+
try {
|
|
126
|
+
const allowedOrigin = corsOrigin(req);
|
|
127
|
+
if (allowedOrigin) {
|
|
128
|
+
res.setHeader('Access-Control-Allow-Origin', allowedOrigin);
|
|
129
|
+
// The ACAO value varies per request (echoed origin) — tell caches not to reuse it.
|
|
130
|
+
res.setHeader('Vary', 'Origin');
|
|
131
|
+
}
|
|
132
|
+
res.setHeader('Access-Control-Allow-Methods', 'POST, OPTIONS');
|
|
133
|
+
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
|
|
134
|
+
if (req.method === 'OPTIONS') {
|
|
135
|
+
res.writeHead(204);
|
|
136
|
+
res.end();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const url = req.url ?? '';
|
|
140
|
+
const match = url.match(/^\/ingest\/([^/]+)$/);
|
|
141
|
+
if (!match || req.method !== 'POST') {
|
|
142
|
+
res.writeHead(404);
|
|
143
|
+
res.end(JSON.stringify({ error: 'not found' }));
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
let sessionId;
|
|
109
147
|
try {
|
|
110
|
-
|
|
111
|
-
rawEvents = Array.isArray(parsed) ? parsed : [parsed];
|
|
148
|
+
sessionId = decodeURIComponent(match[1]);
|
|
112
149
|
}
|
|
113
150
|
catch {
|
|
114
151
|
res.writeHead(400);
|
|
115
|
-
res.end(JSON.stringify({ error: 'invalid
|
|
152
|
+
res.end(JSON.stringify({ error: 'invalid session id encoding' }));
|
|
116
153
|
return;
|
|
117
154
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
155
|
+
const session = sessions.get(sessionId);
|
|
156
|
+
if (!session) {
|
|
157
|
+
res.writeHead(404);
|
|
158
|
+
res.end(JSON.stringify({ error: 'session not found' }));
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (session.status !== 'active') {
|
|
162
|
+
res.writeHead(410);
|
|
163
|
+
res.end(JSON.stringify({ error: 'session already stopped' }));
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
readBody(req)
|
|
167
|
+
.then((body) => {
|
|
168
|
+
let rawEvents;
|
|
169
|
+
try {
|
|
170
|
+
const parsed = JSON.parse(body);
|
|
171
|
+
rawEvents = Array.isArray(parsed) ? parsed : [parsed];
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
res.writeHead(400);
|
|
175
|
+
res.end(JSON.stringify({ error: 'invalid JSON' }));
|
|
176
|
+
return;
|
|
126
177
|
}
|
|
127
|
-
received
|
|
128
|
-
|
|
129
|
-
session.commits.
|
|
178
|
+
let received = 0;
|
|
179
|
+
for (const raw of rawEvents) {
|
|
180
|
+
const normalized = parseOneEvent(raw, session.commits.length, sessionId);
|
|
181
|
+
if (!normalized) {
|
|
182
|
+
if (raw && typeof raw === 'object' && !('message' in raw)) {
|
|
183
|
+
session.unknownEvents++;
|
|
184
|
+
}
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
received++;
|
|
188
|
+
if (normalized.kind === 'commit') {
|
|
189
|
+
session.commits.push(normalized.event);
|
|
190
|
+
}
|
|
191
|
+
else if (normalized.kind === 'status') {
|
|
192
|
+
session.profilingAvailable = normalized.available;
|
|
193
|
+
}
|
|
130
194
|
}
|
|
131
|
-
|
|
132
|
-
|
|
195
|
+
res.writeHead(200);
|
|
196
|
+
res.end(JSON.stringify({ ok: true, received }));
|
|
197
|
+
})
|
|
198
|
+
.catch((err) => {
|
|
199
|
+
if (err instanceof PayloadTooLargeError) {
|
|
200
|
+
res.writeHead(413);
|
|
201
|
+
res.end(JSON.stringify({ error: 'payload too large' }));
|
|
202
|
+
return;
|
|
133
203
|
}
|
|
204
|
+
res.writeHead(500);
|
|
205
|
+
res.end(JSON.stringify({ error: 'internal error' }));
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
if (!res.headersSent) {
|
|
210
|
+
res.writeHead(500);
|
|
211
|
+
res.end(JSON.stringify({ error: 'internal error' }));
|
|
134
212
|
}
|
|
135
|
-
|
|
136
|
-
res.end(JSON.stringify({ ok: true, received }));
|
|
137
|
-
})
|
|
138
|
-
.catch(() => {
|
|
139
|
-
res.writeHead(500);
|
|
140
|
-
res.end(JSON.stringify({ error: 'internal error' }));
|
|
141
|
-
});
|
|
213
|
+
}
|
|
142
214
|
}
|
|
143
|
-
// Default port 7721; override with PERFONEXT_INGEST_PORT
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
215
|
+
// Default port 7721; override with PERFONEXT_INGEST_PORT (0 = OS-assigned ephemeral
|
|
216
|
+
// port, used by tests so the suite never collides with a real running server).
|
|
217
|
+
function resolveIngestPort() {
|
|
218
|
+
const raw = process.env.PERFONEXT_INGEST_PORT;
|
|
219
|
+
const parsed = parseInt(raw ?? '7721', 10);
|
|
220
|
+
if (!Number.isFinite(parsed) || parsed < 0 || parsed > 65535) {
|
|
221
|
+
throw new Error(`PERFONEXT_INGEST_PORT must be a number between 0 and 65535 (got: "${raw}")`);
|
|
222
|
+
}
|
|
223
|
+
return parsed;
|
|
147
224
|
}
|
|
148
|
-
|
|
225
|
+
// Guards concurrent createCaptureSession() calls from racing to bind the same port.
|
|
226
|
+
let startPromise = null;
|
|
149
227
|
function startHttpServer() {
|
|
150
|
-
|
|
228
|
+
if (startPromise)
|
|
229
|
+
return startPromise;
|
|
230
|
+
const port = resolveIngestPort();
|
|
231
|
+
startPromise = new Promise((resolve, reject) => {
|
|
151
232
|
const server = createServer(handleRequest);
|
|
233
|
+
server.on('clientError', (_err, socket) => {
|
|
234
|
+
if (socket.writable)
|
|
235
|
+
socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
|
|
236
|
+
});
|
|
152
237
|
// Bind to loopback only — no external exposure.
|
|
153
|
-
server.listen(
|
|
238
|
+
server.listen(port, '127.0.0.1', () => {
|
|
154
239
|
const addr = server.address();
|
|
155
240
|
if (!addr || typeof addr === 'string') {
|
|
241
|
+
startPromise = null;
|
|
156
242
|
reject(new Error('Unexpected server address'));
|
|
157
243
|
return;
|
|
158
244
|
}
|
|
@@ -161,8 +247,9 @@ function startHttpServer() {
|
|
|
161
247
|
resolve(addr.port);
|
|
162
248
|
});
|
|
163
249
|
server.on('error', (err) => {
|
|
250
|
+
startPromise = null;
|
|
164
251
|
if (err.code === 'EADDRINUSE') {
|
|
165
|
-
reject(new Error(`Ingest server port ${
|
|
252
|
+
reject(new Error(`Ingest server port ${port} is already in use. ` +
|
|
166
253
|
'Free the port or set PERFONEXT_INGEST_PORT to a different value.'));
|
|
167
254
|
}
|
|
168
255
|
else {
|
|
@@ -170,6 +257,25 @@ function startHttpServer() {
|
|
|
170
257
|
}
|
|
171
258
|
});
|
|
172
259
|
});
|
|
260
|
+
return startPromise;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Closes the ingest server and clears all sessions.
|
|
264
|
+
* @internal Test-only teardown hook — not part of the public tool surface.
|
|
265
|
+
*/
|
|
266
|
+
export async function stopIngestServer() {
|
|
267
|
+
const server = httpServer;
|
|
268
|
+
if (server) {
|
|
269
|
+
// Close before clearing module state — if close() fails, the server may
|
|
270
|
+
// still be bound, so leave state intact for diagnosis/retry.
|
|
271
|
+
await new Promise((resolve, reject) => {
|
|
272
|
+
server.close((err) => (err ? reject(err) : resolve()));
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
httpServer = null;
|
|
276
|
+
serverPort = null;
|
|
277
|
+
startPromise = null;
|
|
278
|
+
sessions.clear();
|
|
173
279
|
}
|
|
174
280
|
// ---------------------------------------------------------------------------
|
|
175
281
|
// Public API
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/ingest/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAuEzC,SAAS,cAAc,CAAC,GAAa;IACnC,MAAM,EAAE,GAAG,GAAG,CAAC,iBAAiB,IAAI,IAAI,CAAC;IACzC,OAAO;QACL,OAAO,EAAE,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1D,IAAI,EAAE,CAAC,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAA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AqE;AACrE,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../src/parser/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,
|
|
1
|
+
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../src/parser/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAIf,gBAAgB,EAChB,mBAAmB,EAEnB,gBAAgB,EAEhB,WAAW,EAGX,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EAId,MAAM,YAAY,CAAC;AA+BpB,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AAmFD,wBAAgB,aAAa,CAC3B,OAAO,EAAE,mBAAmB,EAC5B,KAAK,SAAK,EACV,cAAc,SAAI,EAClB,aAAa,CAAC,EAAE,MAAM,GACrB,gBAAgB,EAAE,CAsBpB;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,mBAAmB,EAC5B,KAAK,SAAK,GACT;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,kBAAkB,EAAE,CAAC;IACpC,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,QAAQ,EAAE,M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