@0x1f320.sh/why-did-you-render-mcp 1.0.0-dev.10 → 1.0.0-dev.12
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/dist/server/index.js +9 -9
- package/package.json +3 -4
package/dist/server/index.js
CHANGED
|
@@ -388,19 +388,19 @@ function register$3(server) {
|
|
|
388
388
|
function register$2(server) {
|
|
389
389
|
server.registerTool("get_render_summary", {
|
|
390
390
|
title: "Get Render Summary",
|
|
391
|
-
description: "Returns a summary of
|
|
391
|
+
description: "Returns a summary of re-renders grouped by component name with counts. If multiple projects are active and no project is specified, the tool will ask you to disambiguate.",
|
|
392
392
|
inputSchema: { project: z.string().optional().describe("Project identifier (the browser's origin URL, e.g. http://localhost:3000). Omit to auto-detect.") }
|
|
393
393
|
}, async ({ project }) => {
|
|
394
394
|
const resolved = resolveProject(project);
|
|
395
395
|
if (resolved.error) return textResult(resolved.error);
|
|
396
396
|
const summary = store.getSummary(resolved.projectId);
|
|
397
|
-
if (Object.keys(summary).length === 0) return textResult("No
|
|
397
|
+
if (Object.keys(summary).length === 0) return textResult("No renders recorded yet.");
|
|
398
398
|
const lines = [];
|
|
399
399
|
for (const [projectId, components] of Object.entries(summary)) {
|
|
400
400
|
lines.push(`[${projectId}]`);
|
|
401
401
|
for (const [name, count] of Object.entries(components)) lines.push(` ${name}: ${count} re-render(s)`);
|
|
402
402
|
}
|
|
403
|
-
return textResult(`
|
|
403
|
+
return textResult(`Re-render summary:\n\n${lines.join("\n")}`);
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
406
|
//#endregion
|
|
@@ -408,7 +408,7 @@ function register$2(server) {
|
|
|
408
408
|
function register$1(server) {
|
|
409
409
|
server.registerTool("get_renders_by_commit", {
|
|
410
410
|
title: "Get Renders by Commit",
|
|
411
|
-
description: "Returns all
|
|
411
|
+
description: "Returns all re-renders for a specific React commit ID. Use get_commits first to discover available commit IDs.",
|
|
412
412
|
inputSchema: {
|
|
413
413
|
commitId: z.number().describe("The React commit ID to filter by."),
|
|
414
414
|
component: z.string().optional().describe("Filter by component name. Omit to get all renders."),
|
|
@@ -424,11 +424,11 @@ function register$1(server) {
|
|
|
424
424
|
});
|
|
425
425
|
}
|
|
426
426
|
//#endregion
|
|
427
|
-
//#region src/server/tools/get-
|
|
427
|
+
//#region src/server/tools/get-renders.ts
|
|
428
428
|
function register(server) {
|
|
429
|
-
server.registerTool("
|
|
430
|
-
title: "Get
|
|
431
|
-
description: "Returns all
|
|
429
|
+
server.registerTool("get_renders", {
|
|
430
|
+
title: "Get Renders",
|
|
431
|
+
description: "Returns all re-renders collected from the browser. If multiple projects are active and no project is specified, the tool will ask you to disambiguate by asking the user for their dev server URL.",
|
|
432
432
|
inputSchema: {
|
|
433
433
|
component: z.string().optional().describe("Filter by component name. Omit to get all renders."),
|
|
434
434
|
project: z.string().optional().describe("Project identifier (the browser's origin URL, e.g. http://localhost:3000). Omit to auto-detect.")
|
|
@@ -437,7 +437,7 @@ function register(server) {
|
|
|
437
437
|
const resolved = resolveProject(project);
|
|
438
438
|
if (resolved.error) return textResult(resolved.error);
|
|
439
439
|
const renders = component ? store.getRendersByComponent(component, resolved.projectId) : store.getAllRenders(resolved.projectId);
|
|
440
|
-
if (renders.length === 0) return textResult(component ? `No
|
|
440
|
+
if (renders.length === 0) return textResult(component ? `No renders recorded for "${component}".` : "No renders recorded yet. Make sure the browser is connected and triggering re-renders.");
|
|
441
441
|
return textResult(JSON.stringify(renders, null, 2));
|
|
442
442
|
});
|
|
443
443
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0x1f320.sh/why-did-you-render-mcp",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server that collects why-did-you-render data from browser and exposes it to coding agents",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,9 +34,7 @@
|
|
|
34
34
|
"require": "./dist/client/index.cjs"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
"files": [
|
|
38
|
-
"dist"
|
|
39
|
-
],
|
|
37
|
+
"files": ["dist"],
|
|
40
38
|
"scripts": {
|
|
41
39
|
"build": "tsdown",
|
|
42
40
|
"dev": "tsdown --watch",
|
|
@@ -56,6 +54,7 @@
|
|
|
56
54
|
"devDependencies": {
|
|
57
55
|
"@biomejs/biome": "^1.9.4",
|
|
58
56
|
"@semantic-release/changelog": "^6.0.3",
|
|
57
|
+
"@semantic-release/exec": "^7.1.0",
|
|
59
58
|
"@semantic-release/git": "^10.0.1",
|
|
60
59
|
"@types/node": "^22.14.1",
|
|
61
60
|
"@types/ws": "^8.18.0",
|