@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
|
@@ -17,13 +17,23 @@ export function registerStopRenderCapture(server) {
|
|
|
17
17
|
const session = getCaptureSession(sessionId);
|
|
18
18
|
if (!session) {
|
|
19
19
|
return {
|
|
20
|
-
content: [
|
|
20
|
+
content: [
|
|
21
|
+
{
|
|
22
|
+
type: 'text',
|
|
23
|
+
text: JSON.stringify({ error: `Session "${sessionId}" not found` }, null, 2),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
21
26
|
isError: true,
|
|
22
27
|
};
|
|
23
28
|
}
|
|
24
29
|
if (session.status === 'stopped') {
|
|
25
30
|
return {
|
|
26
|
-
content: [
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: 'text',
|
|
34
|
+
text: JSON.stringify({ error: `Session "${sessionId}" is already stopped` }, null, 2),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
27
37
|
isError: true,
|
|
28
38
|
};
|
|
29
39
|
}
|
|
@@ -38,7 +48,12 @@ export function registerStopRenderCapture(server) {
|
|
|
38
48
|
: 'No commits captured. Make sure the instrumentation snippet was loaded ' +
|
|
39
49
|
'and you interacted with the app while the session was active.';
|
|
40
50
|
return {
|
|
41
|
-
content: [
|
|
51
|
+
content: [
|
|
52
|
+
{
|
|
53
|
+
type: 'text',
|
|
54
|
+
text: JSON.stringify({ warning, sessionId, commitCount: 0 }, null, 2),
|
|
55
|
+
},
|
|
56
|
+
],
|
|
42
57
|
};
|
|
43
58
|
}
|
|
44
59
|
const profile = adaptReactScanEvents(session.commits, sessionId);
|
|
@@ -49,7 +64,8 @@ export function registerStopRenderCapture(server) {
|
|
|
49
64
|
profileId: profile.id,
|
|
50
65
|
sessionId,
|
|
51
66
|
commitCount: profile.commits.length,
|
|
52
|
-
componentCount: profile.components.filter(c => isAnalyzableComponent(c.componentName))
|
|
67
|
+
componentCount: profile.components.filter((c) => isAnalyzableComponent(c.componentName))
|
|
68
|
+
.length,
|
|
53
69
|
totalCommitDuration: formatMs(profile.totalCommitDuration),
|
|
54
70
|
profilingAvailable: session.profilingAvailable,
|
|
55
71
|
dataQuality: profile.hasChangeDescriptions ? 'exact' : 'heuristic',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop-render-capture.js","sourceRoot":"","sources":["../../src/tools/stop-render-capture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,yBAAyB,CAAC,MAAiB;IACzD,MAAM,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"stop-render-capture.js","sourceRoot":"","sources":["../../src/tools/stop-render-capture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO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|
|
2
2
|
"name": "@perfonext/render-mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "MCP server for analyzing Next.js React Profiler exports: render summaries, rerender causes, hot commits, and profile diffing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,9 +19,13 @@
|
|
|
19
19
|
"node": ">=18"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "tsc && chmod +x dist/index.js",
|
|
22
|
+
"build": "tsc && shx chmod +x dist/index.js",
|
|
23
23
|
"dev": "tsc --watch",
|
|
24
24
|
"test": "vitest run",
|
|
25
|
+
"lint": "eslint .",
|
|
26
|
+
"lint:fix": "eslint . --fix",
|
|
27
|
+
"format": "prettier --write .",
|
|
28
|
+
"format:check": "prettier --check .",
|
|
25
29
|
"inspector": "npx @modelcontextprotocol/inspector node dist/index.js",
|
|
26
30
|
"prepublishOnly": "npm run build"
|
|
27
31
|
},
|
|
@@ -37,20 +41,27 @@
|
|
|
37
41
|
],
|
|
38
42
|
"repository": {
|
|
39
43
|
"type": "git",
|
|
40
|
-
"url": "git+https://github.com/
|
|
44
|
+
"url": "git+https://github.com/souvikdu/perfonext-render-mcp.git"
|
|
41
45
|
},
|
|
42
46
|
"bugs": {
|
|
43
|
-
"url": "https://github.com/
|
|
47
|
+
"url": "https://github.com/souvikdu/perfonext-render-mcp/issues"
|
|
44
48
|
},
|
|
45
|
-
"homepage": "https://github.com/
|
|
49
|
+
"homepage": "https://github.com/souvikdu/perfonext-render-mcp#readme",
|
|
46
50
|
"license": "MIT",
|
|
47
51
|
"dependencies": {
|
|
48
52
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
49
53
|
"zod": "^4.4.1"
|
|
50
54
|
},
|
|
51
55
|
"devDependencies": {
|
|
56
|
+
"@eslint/js": "^9.17.0",
|
|
52
57
|
"@types/node": "^25.6.0",
|
|
58
|
+
"eslint": "^9.17.0",
|
|
59
|
+
"eslint-config-prettier": "^10.0.1",
|
|
60
|
+
"globals": "^15.14.0",
|
|
61
|
+
"prettier": "^3.4.2",
|
|
62
|
+
"shx": "^0.4.0",
|
|
53
63
|
"typescript": "^6.0.3",
|
|
64
|
+
"typescript-eslint": "^8.18.2",
|
|
54
65
|
"vitest": "^3.2.4"
|
|
55
66
|
}
|
|
56
67
|
}
|