mcp-web-validator 1.3.55 → 1.3.56

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.
@@ -41,12 +41,12 @@ export declare function htmlValidationContent(messages: W3CMessage[], source?: s
41
41
  error: number;
42
42
  warning: number;
43
43
  info: number;
44
- }): string;
44
+ }, checker?: "w3c_remote" | "nu_local"): string;
45
45
  export declare function cssValidationContent(messages: CSSMessage[], totalMessages?: number, counts?: {
46
46
  error: number;
47
47
  warning?: number;
48
48
  compatibilityLimitation: number;
49
- }): string;
49
+ }, checker?: "w3c_remote" | "stylelint_local"): string;
50
50
  export declare function seoAuditContent(issues: SEOIssue[], totalIssues: number, truncated: boolean, counts?: AuditCounts): string;
51
51
  export declare function schemaValidationContent(issues: SEOIssue[], totalIssues: number, truncated: boolean, htmlContent: string): string;
52
52
  export declare function linkCheckContent(links: LinkStatus[], baseUrl?: string): string;
@@ -229,7 +229,8 @@ export function availabilityReviewContent(review) {
229
229
  nextStep,
230
230
  });
231
231
  }
232
- export function htmlValidationContent(messages, source, totalMessages = messages.length, counts) {
232
+ export function htmlValidationContent(messages, source, totalMessages = messages.length, counts, checker = "w3c_remote") {
233
+ const validatorLabel = checker === "nu_local" ? "The local Nu HTML Checker" : "The W3C validator";
233
234
  const errorCount = counts?.error
234
235
  ?? messages.filter((message) => getW3CMessageSeverity(message) === "error").length;
235
236
  const warningCount = counts?.warning
@@ -240,7 +241,7 @@ export function htmlValidationContent(messages, source, totalMessages = messages
240
241
  return toolContent({
241
242
  title: "HTML validation",
242
243
  status: "clean",
243
- outcome: `The W3C validator returned no HTML diagnostics${sourceText}.`,
244
+ outcome: validatorLabel + " returned no HTML diagnostics" + sourceText + ".",
244
245
  nextStep: "Keep this result as a baseline and validate again after the next markup change.",
245
246
  });
246
247
  }
@@ -248,7 +249,9 @@ export function htmlValidationContent(messages, source, totalMessages = messages
248
249
  return toolContent({
249
250
  title: "HTML validation",
250
251
  status: hasActionableDiagnostics ? "attention needed" : "review suggested",
251
- outcome: `The W3C validator returned ${countLabel(errorCount, "error")}, ${countLabel(warningCount, "warning")}, and ${countLabel(infoCount, "informational diagnostic")}${sourceText}.`,
252
+ outcome: validatorLabel + " returned " + countLabel(errorCount, "error") + ", "
253
+ + countLabel(warningCount, "warning") + ", and "
254
+ + countLabel(infoCount, "informational diagnostic") + sourceText + ".",
252
255
  actions: messages.map((message) => ({
253
256
  priority: priorityForSeverity(getW3CMessageSeverity(message)),
254
257
  message: message.message,
@@ -262,12 +265,15 @@ export function htmlValidationContent(messages, source, totalMessages = messages
262
265
  : undefined,
263
266
  });
264
267
  }
265
- export function cssValidationContent(messages, totalMessages = messages.length, counts) {
268
+ export function cssValidationContent(messages, totalMessages = messages.length, counts, checker = "w3c_remote") {
269
+ const stylelint = checker === "stylelint_local";
266
270
  if (totalMessages === 0) {
267
271
  return toolContent({
268
272
  title: "CSS validation",
269
- status: "clean",
270
- outcome: "The W3C validator returned no CSS errors or warnings.",
273
+ status: stylelint ? "no lint findings" : "clean",
274
+ outcome: stylelint
275
+ ? "Local Stylelint found no findings in the selected quality rules; W3C CSS conformance was not tested."
276
+ : "The W3C validator returned no CSS errors or warnings.",
271
277
  nextStep: "Validate again after the next stylesheet change.",
272
278
  });
273
279
  }
@@ -281,7 +287,10 @@ export function cssValidationContent(messages, totalMessages = messages.length,
281
287
  return toolContent({
282
288
  title: "CSS validation",
283
289
  status: actionableErrors > 0 ? "attention needed" : "review suggested",
284
- outcome: `The W3C validator returned ${countLabel(actionableErrors, "CSS error")}, ${countLabel(warningCount, "CSS warning")}, and ${countLabel(compatibilityLimitationCount, "known validator limitation")}.`,
290
+ outcome: (stylelint ? "Local Stylelint found " : "The W3C validator returned ")
291
+ + countLabel(actionableErrors, "CSS error") + ", "
292
+ + countLabel(warningCount, "CSS warning") + ", and "
293
+ + countLabel(compatibilityLimitationCount, "known validator limitation") + ".",
285
294
  actions: messages.map((message) => ({
286
295
  priority: message.compatibility === "known-validator-limitation"
287
296
  ? 2
@@ -299,7 +308,9 @@ export function cssValidationContent(messages, totalMessages = messages.length,
299
308
  ? "Jigsaw currently does not recognize the standards-defined @container rule. The upstream diagnostic is preserved and marked as a known validator limitation."
300
309
  : undefined,
301
310
  totalMessages > messages.length
302
- ? `Showing the first ${messages.length} of ${totalMessages} CSS diagnostics in structured output; summary counts include all returned Jigsaw diagnostics.`
311
+ ? "Showing the first " + messages.length + " of " + totalMessages
312
+ + " CSS diagnostics in structured output; summary counts include all returned "
313
+ + (stylelint ? "Stylelint" : "Jigsaw") + " diagnostics."
303
314
  : undefined,
304
315
  ].filter(Boolean).join(" ") || undefined,
305
316
  });