nfunc-mcp 0.2.0 → 0.4.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/README.md +85 -335
- package/dist/index.js +27 -4
- package/dist/index.js.map +1 -1
- package/dist/mappers/a11yDedupe.d.ts +25 -0
- package/dist/mappers/a11yDedupe.js +95 -0
- package/dist/mappers/a11yDedupe.js.map +1 -0
- package/dist/mappers/compositeScore.d.ts +23 -0
- package/dist/mappers/compositeScore.js +107 -0
- package/dist/mappers/compositeScore.js.map +1 -0
- package/dist/mappers/correlator.js +94 -33
- package/dist/mappers/correlator.js.map +1 -1
- package/dist/mappers/defectFormatter.js +129 -15
- package/dist/mappers/defectFormatter.js.map +1 -1
- package/dist/mappers/labFieldComparator.d.ts +62 -0
- package/dist/mappers/labFieldComparator.js +134 -0
- package/dist/mappers/labFieldComparator.js.map +1 -0
- package/dist/mappers/priorityMapper.d.ts +38 -0
- package/dist/mappers/priorityMapper.js +126 -0
- package/dist/mappers/priorityMapper.js.map +1 -1
- package/dist/mappers/psiAggregator.d.ts +130 -0
- package/dist/mappers/psiAggregator.js +293 -0
- package/dist/mappers/psiAggregator.js.map +1 -0
- package/dist/mappers/webVitalsMapper.d.ts +52 -0
- package/dist/mappers/webVitalsMapper.js +131 -0
- package/dist/mappers/webVitalsMapper.js.map +1 -0
- package/dist/tools/accessibility.js +72 -31
- package/dist/tools/accessibility.js.map +1 -1
- package/dist/tools/lighthouse.d.ts +14 -0
- package/dist/tools/lighthouse.js +134 -34
- package/dist/tools/lighthouse.js.map +1 -1
- package/dist/tools/performanceAudit.d.ts +2 -0
- package/dist/tools/performanceAudit.js +446 -0
- package/dist/tools/performanceAudit.js.map +1 -0
- package/dist/tools/performanceAuditPlan.d.ts +2 -0
- package/dist/tools/performanceAuditPlan.js +438 -0
- package/dist/tools/performanceAuditPlan.js.map +1 -0
- package/dist/tools/qaGate.js +109 -34
- package/dist/tools/qaGate.js.map +1 -1
- package/dist/utils/csvReader.d.ts +20 -0
- package/dist/utils/csvReader.js +172 -0
- package/dist/utils/csvReader.js.map +1 -0
- package/dist/utils/httpClient.d.ts +84 -0
- package/dist/utils/httpClient.js +171 -0
- package/dist/utils/httpClient.js.map +1 -0
- package/dist/utils/outputParsers.d.ts +25 -0
- package/dist/utils/outputParsers.js +42 -0
- package/dist/utils/outputParsers.js.map +1 -1
- package/dist/utils/psiAuth.d.ts +26 -0
- package/dist/utils/psiAuth.js +36 -0
- package/dist/utils/psiAuth.js.map +1 -0
- package/dist/utils/psiParser.d.ts +124 -0
- package/dist/utils/psiParser.js +200 -0
- package/dist/utils/psiParser.js.map +1 -0
- package/dist/utils/publicUrl.d.ts +17 -0
- package/dist/utils/publicUrl.js +115 -0
- package/dist/utils/publicUrl.js.map +1 -0
- package/dist/utils/sitemapReader.d.ts +27 -0
- package/dist/utils/sitemapReader.js +272 -0
- package/dist/utils/sitemapReader.js.map +1 -0
- package/dist/utils/urlClassifier.d.ts +45 -0
- package/dist/utils/urlClassifier.js +267 -0
- package/dist/utils/urlClassifier.js.map +1 -0
- package/docs/manual.md +558 -0
- package/docs/psi-report-spec.md +174 -0
- package/package.json +14 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility.js","sourceRoot":"","sources":["../../src/tools/accessibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAGtE,MAAM,UAAU,GAAG;IACjB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG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GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;gBAChC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,MAAM,CAAC,MAAM,OAAO,OAAO,CAAC,MAAM,2BAA2B,CAAC,EAAE;gBACvF,CAAC,CAAC,EAAE,CAAC;YACP,eAAe,EAAE,QAAQ,CAAC,MAAM;YAChC,kEAAkE;YAClE,6CAA6C;YAC7C,mBAAmB,EAAE,QAAQ;YAC7B,QAAQ;SACT,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACnE,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
export type FormFactor = "mobile" | "desktop";
|
|
3
|
+
/**
|
|
4
|
+
* Lighthouse defaults to mobile: a 412x823 screen, a mid-range Android UA,
|
|
5
|
+
* simulated slow 4G and a 4x CPU slowdown. Desktop needs --preset=desktop,
|
|
6
|
+
* which also drops throttling to 1x.
|
|
7
|
+
*
|
|
8
|
+
* These are not interchangeable runs. On a real commerce page the desktop
|
|
9
|
+
* pass scored accessibility 73 against mobile's 87 and surfaced image-alt,
|
|
10
|
+
* aria-required-children, aria-required-parent, aria-allowed-attr and
|
|
11
|
+
* aria-valid-attr-value failures that the mobile pass never reported, because
|
|
12
|
+
* the two render different DOM. Mobile likewise found failures desktop did
|
|
13
|
+
* not. Neither substitutes for the other.
|
|
14
|
+
*/
|
|
15
|
+
export declare function formFactorArgs(ff: FormFactor): string[];
|
|
2
16
|
export declare function registerLighthouseTool(server: McpServer): void;
|
package/dist/tools/lighthouse.js
CHANGED
|
@@ -4,57 +4,157 @@ import { parseLighthouseJSON } from "../utils/outputParsers.js";
|
|
|
4
4
|
import { shellErrorResponse, parseErrorResponse, } from "../utils/toolResponse.js";
|
|
5
5
|
import { formatLighthouseFinding } from "../mappers/defectFormatter.js";
|
|
6
6
|
import { sortFindingsByPriority } from "../mappers/priorityMapper.js";
|
|
7
|
+
/**
|
|
8
|
+
* Lighthouse defaults to mobile: a 412x823 screen, a mid-range Android UA,
|
|
9
|
+
* simulated slow 4G and a 4x CPU slowdown. Desktop needs --preset=desktop,
|
|
10
|
+
* which also drops throttling to 1x.
|
|
11
|
+
*
|
|
12
|
+
* These are not interchangeable runs. On a real commerce page the desktop
|
|
13
|
+
* pass scored accessibility 73 against mobile's 87 and surfaced image-alt,
|
|
14
|
+
* aria-required-children, aria-required-parent, aria-allowed-attr and
|
|
15
|
+
* aria-valid-attr-value failures that the mobile pass never reported, because
|
|
16
|
+
* the two render different DOM. Mobile likewise found failures desktop did
|
|
17
|
+
* not. Neither substitutes for the other.
|
|
18
|
+
*/
|
|
19
|
+
export function formFactorArgs(ff) {
|
|
20
|
+
return ff === "desktop" ? ["--preset=desktop"] : ["--form-factor=mobile"];
|
|
21
|
+
}
|
|
7
22
|
const inputShape = {
|
|
8
23
|
url: z.string().url(),
|
|
9
24
|
categories: z.array(z.string()).optional(),
|
|
10
25
|
thresholds: z.record(z.string(), z.number()).optional(),
|
|
26
|
+
form_factor: z
|
|
27
|
+
.enum(["mobile", "desktop", "both"])
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Device profile to emulate. 'desktop' (default) runs unthrottled. " +
|
|
30
|
+
"'mobile' applies the Lighthouse CLI's own default profile — a " +
|
|
31
|
+
"412x823 screen on simulated slow 4G with a 4x CPU slowdown — which " +
|
|
32
|
+
"is considerably harsher and will report much lower performance " +
|
|
33
|
+
"scores for the same page. 'both' runs the two concurrently and " +
|
|
34
|
+
"reports each separately, tagging every finding with the form " +
|
|
35
|
+
"factors it affects; use it when you want to know which defects are " +
|
|
36
|
+
"device-specific, since the two profiles render different DOM and " +
|
|
37
|
+
"genuinely find different accessibility and SEO problems."),
|
|
11
38
|
};
|
|
12
39
|
export function registerLighthouseTool(server) {
|
|
13
40
|
server.registerTool("run_lighthouse", {
|
|
14
41
|
description: "Runs Google Lighthouse against a URL and returns a QA-style report " +
|
|
15
42
|
"with category scores, TTFB, and prioritised findings (P1/P2/P3). " +
|
|
16
|
-
"
|
|
17
|
-
"
|
|
43
|
+
"\n\n" +
|
|
44
|
+
"`form_factor` selects the device profile: 'mobile' (default, " +
|
|
45
|
+
"throttled slow 4G with 4x CPU slowdown), 'desktop' (unthrottled), or " +
|
|
46
|
+
"'both'. **Prefer 'both' when auditing a page properly** — the two " +
|
|
47
|
+
"profiles render different DOM and find different defects, not just " +
|
|
48
|
+
"different performance numbers. With 'both', `scores` is keyed by " +
|
|
49
|
+
"form factor and each finding carries affects_form_factors plus " +
|
|
50
|
+
"form_factor_specific, so device-only regressions are obvious. " +
|
|
51
|
+
"\n\n" +
|
|
52
|
+
"Requires the Lighthouse CLI on PATH (`npm install -g lighthouse`) " +
|
|
53
|
+
"and a Chrome/Chromium binary available.",
|
|
18
54
|
inputSchema: inputShape,
|
|
19
|
-
}, async ({ url, categories, thresholds }) => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
55
|
+
}, async ({ url, categories, thresholds, form_factor }) => {
|
|
56
|
+
const requested = form_factor ?? "desktop";
|
|
57
|
+
const factors = requested === "both" ? ["mobile", "desktop"] : [requested];
|
|
58
|
+
const runOne = async (ff) => {
|
|
59
|
+
const args = [
|
|
60
|
+
url,
|
|
61
|
+
"--output=json",
|
|
62
|
+
"--quiet",
|
|
63
|
+
"--chrome-flags=--headless",
|
|
64
|
+
...formFactorArgs(ff),
|
|
65
|
+
];
|
|
66
|
+
if (categories && categories.length > 0) {
|
|
67
|
+
args.push(`--only-categories=${categories.join(",")}`);
|
|
68
|
+
}
|
|
69
|
+
return { ff, result: await runShell("lighthouse", args, { timeoutMs: 180_000 }) };
|
|
70
|
+
};
|
|
71
|
+
// Concurrent, so "both" costs little more wall time than a single run.
|
|
72
|
+
const runs = await Promise.all(factors.map(runOne));
|
|
73
|
+
const parsedByFactor = new Map();
|
|
74
|
+
for (const { ff, result } of runs) {
|
|
75
|
+
if (!result.stdout) {
|
|
76
|
+
if (factors.length === 1) {
|
|
77
|
+
return shellErrorResponse("Lighthouse produced no JSON output", result);
|
|
78
|
+
}
|
|
79
|
+
continue; // one form factor failed; report the other
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
parsedByFactor.set(ff, parseLighthouseJSON(result.stdout));
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
if (factors.length === 1) {
|
|
86
|
+
return parseErrorResponse("Failed to parse Lighthouse JSON", err, result);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
32
89
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
parsed = parseLighthouseJSON(result.stdout);
|
|
90
|
+
if (parsedByFactor.size === 0) {
|
|
91
|
+
return shellErrorResponse("Lighthouse produced no usable output for any form factor", runs[0].result);
|
|
36
92
|
}
|
|
37
|
-
|
|
38
|
-
|
|
93
|
+
const buildFindings = (parsed) => {
|
|
94
|
+
const out = [];
|
|
95
|
+
for (const audit of parsed.failedAudits) {
|
|
96
|
+
const threshold = thresholds?.[audit.id];
|
|
97
|
+
if (typeof threshold === "number" && audit.score >= threshold)
|
|
98
|
+
continue;
|
|
99
|
+
const f = formatLighthouseFinding(audit);
|
|
100
|
+
if (f)
|
|
101
|
+
out.push(f);
|
|
102
|
+
}
|
|
103
|
+
return out;
|
|
104
|
+
};
|
|
105
|
+
// Single form factor keeps the original flat report shape.
|
|
106
|
+
if (parsedByFactor.size === 1 && factors.length === 1) {
|
|
107
|
+
const parsed = parsedByFactor.get(factors[0]);
|
|
108
|
+
const findings = buildFindings(parsed);
|
|
109
|
+
sortFindingsByPriority(findings);
|
|
110
|
+
return {
|
|
111
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
112
|
+
url,
|
|
113
|
+
form_factor: factors[0],
|
|
114
|
+
scores: parsed.categoryScores,
|
|
115
|
+
ttfb_ms: parsed.ttfbMs,
|
|
116
|
+
findings,
|
|
117
|
+
}, null, 2) }],
|
|
118
|
+
};
|
|
39
119
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
120
|
+
// Both: merge on audit_id and record which form factors each affects, so
|
|
121
|
+
// "fails on desktop only" is readable straight off the finding.
|
|
122
|
+
const merged = new Map();
|
|
123
|
+
const scores = {};
|
|
124
|
+
const ttfb = {};
|
|
125
|
+
for (const ff of factors) {
|
|
126
|
+
const parsed = parsedByFactor.get(ff);
|
|
127
|
+
if (!parsed)
|
|
44
128
|
continue;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
129
|
+
scores[ff] = parsed.categoryScores;
|
|
130
|
+
ttfb[ff] = parsed.ttfbMs;
|
|
131
|
+
for (const f of buildFindings(parsed)) {
|
|
132
|
+
const key = String(f.evidence["audit_id"]);
|
|
133
|
+
const existing = merged.get(key);
|
|
134
|
+
if (existing)
|
|
135
|
+
existing._ff.push(ff);
|
|
136
|
+
else
|
|
137
|
+
merged.set(key, { ...f, _ff: [ff] });
|
|
138
|
+
}
|
|
48
139
|
}
|
|
140
|
+
const findings = Array.from(merged.values()).map(({ _ff, ...f }) => ({
|
|
141
|
+
...f,
|
|
142
|
+
evidence: {
|
|
143
|
+
...f.evidence,
|
|
144
|
+
affects_form_factors: _ff,
|
|
145
|
+
form_factor_specific: _ff.length === 1,
|
|
146
|
+
},
|
|
147
|
+
}));
|
|
49
148
|
sortFindingsByPriority(findings);
|
|
50
|
-
const report = {
|
|
51
|
-
url,
|
|
52
|
-
scores: parsed.categoryScores,
|
|
53
|
-
ttfb_ms: parsed.ttfbMs,
|
|
54
|
-
findings,
|
|
55
|
-
};
|
|
56
149
|
return {
|
|
57
|
-
content: [{ type: "text", text: JSON.stringify(
|
|
150
|
+
content: [{ type: "text", text: JSON.stringify({
|
|
151
|
+
url,
|
|
152
|
+
form_factor: "both",
|
|
153
|
+
form_factors_run: Array.from(parsedByFactor.keys()),
|
|
154
|
+
scores,
|
|
155
|
+
ttfb_ms: ttfb,
|
|
156
|
+
findings,
|
|
157
|
+
}, null, 2) }],
|
|
58
158
|
};
|
|
59
159
|
});
|
|
60
160
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lighthouse.js","sourceRoot":"","sources":["../../src/tools/lighthouse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"lighthouse.js","sourceRoot":"","sources":["../../src/tools/lighthouse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAKtE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAAC,EAAc;IAC3C,OAAO,EAAE,KAAK,SA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