mcp-web-validator 1.3.47 → 1.3.48

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/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project are documented here. The project follows [Se
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.3.48] - 2026-10-28
8
+
9
+ ### Security
10
+
11
+ - Raised the minimum Undici 7 dependency to 7.30.1 to exclude older affected versions from the declared install range, preserving Node.js 22.12 compatibility.
12
+
13
+ ### Changed
14
+
15
+ - Updated @puppeteer/browsers from 3.2.5 to 3.2.6 for browser installation maintenance.
16
+
7
17
  ## [1.3.47] - 2026-10-27
8
18
 
9
19
  ### Fixed
package/README.md CHANGED
@@ -58,6 +58,12 @@ The npm package exposes these exact runtime tool names:
58
58
  | `report.validation` | Combine HTML/XHTML, optional CSS, SEO, JSON-LD, and bounded link checks in a Markdown report. | Reads selected files, contacts the validators, and checks eligible public links found in the markup; `.xhtml` inputs use XHTML parsing semantics for Nu validation. |
59
59
  | `screenshot.capture` | Capture desktop, tablet, mobile, or custom viewport screenshots. | Opens a selected local file or eligible public URL and writes PNG files to the selected output directory; existing matching files may be replaced. |
60
60
 
61
+ For direct Node.js integrations, `auditSeoMetadata(html, xRobotsTag)` and
62
+ `auditSeoMetadataDetailed(html, xRobotsTag)` from `dist/seo-auditor.js` accept
63
+ an optional caller-observed `X-Robots-Tag` HTTP response-header value. Separate
64
+ multiple header fields with newlines. This inspection is offline and never
65
+ fetches headers; the MCP `seo.metadata` tool still analyzes supplied HTML only.
66
+
61
67
  ## Hosted app tools
62
68
 
63
69
  The hosted app exposes eight tools:
@@ -81,6 +87,8 @@ Only validate files, markup, and public webpages that you own or are authorized
81
87
 
82
88
  The local server runs with the same operating-system permissions as its MCP client. Review tool inputs before approving file access, outbound validation, link checking, or screenshot creation. The hosted app has no access to your local filesystem.
83
89
 
90
+ For tighter local-file validation scope, optionally set `MCP_WEB_VALIDATOR_WORKSPACE_ROOT` to an **absolute directory path** in the local MCP server's environment. When set, `html.local`, `css.local`, local-file inputs to `report.validation`, and local screenshot `targetPath` accept only files whose resolved paths (including symlinks) stay within that directory. Screenshot `outputDir` must also remain within the resolved root, including when creating a new nested directory or following an existing symlink. Screenshots write PNG bytes through an exclusive open temporary sibling file before replacing the final filename, so an existing hard link or symlink cannot redirect the image write. Without this setting, the documented user-selected local-file and screenshot destination behavior is unchanged. This is a defense against unintended tool arguments, not an isolation boundary against a malicious local process concurrently changing filesystem paths.
91
+
84
92
  See the published [privacy policy](https://digestseo.com/privacy/) for data-handling details and [SECURITY.md](SECURITY.md) for private vulnerability reporting.
85
93
 
86
94
  ## Configure a local client
@@ -119,6 +127,52 @@ Marketplace or add the repository from Cursor's plugin UI. The plugin bundles
119
127
  the same local stdio server and does not require API keys or environment
120
128
  variables.
121
129
 
130
+ ### Visual Studio Code with GitHub Copilot
131
+
132
+ In VS Code, run **MCP: Add Server** from the Command Palette and choose **Command
133
+ (stdio)** with `npx -y mcp-web-validator`. Or add the following to your own
134
+ workspace's `.vscode/mcp.json` (VS Code format):
135
+
136
+ ```json
137
+ {
138
+ "servers": {
139
+ "mcp-web-validator": {
140
+ "type": "stdio",
141
+ "command": "npx",
142
+ "args": ["-y", "mcp-web-validator"]
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ For a remote-only connection, use this server entry instead (no local Node.js
149
+ required, but local-file and screenshot tools are unavailable):
150
+
151
+ ```json
152
+ {
153
+ "servers": {
154
+ "mcp-web-validator-hosted": {
155
+ "type": "http",
156
+ "url": "https://web-validator-mcp.digestseo.com/mcp"
157
+ }
158
+ }
159
+ }
160
+ ```
161
+
162
+ Open **MCP: List Servers** to start/check the connection. In Copilot Agent
163
+ chat, ask it to run `seo.metadata` on an HTML snippet you provide (input field
164
+ `htmlContent`) and report its metadata issues. This is an offline, no-network
165
+ smoke test of the local stdio server; it should return structured `issues` and
166
+ `totalIssues` without contacting W3C or fetching a webpage. Use the **local**
167
+ server for this check, since the hosted surface has different tool names.
168
+
169
+ The repository also contains a portable root `.mcp.json` for compatible
170
+ Copilot harness clients. Its top-level key is `mcpServers`, **not** `servers`;
171
+ do not copy that object unchanged into `.vscode/mcp.json`. VS Code's
172
+ [MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration)
173
+ explains the file formats and supported scopes. Review tool permissions before
174
+ allowing outbound validation or filesystem-writing screenshot calls.
175
+
122
176
  ### OpenAI Codex
123
177
 
124
178
  Codex CLI can add the published local stdio package directly:
@@ -209,6 +263,7 @@ npm run deploy:dry-run
209
263
 
210
264
  See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution expectations. Deployment and marketplace-review notes live in [chatgpt-plugin/SUBMISSION.md](chatgpt-plugin/SUBMISSION.md).
211
265
  For agent-assisted installation, see [llms-install.md](llms-install.md).
266
+ For a copy-ready, zero-paid-provider GitHub Actions metadata gate, see [examples/github-actions](examples/github-actions/README.md).
212
267
 
213
268
  ## Ecosystem
214
269
 
package/dist/index.js CHANGED
@@ -4,11 +4,11 @@ import { pathToFileURL } from "node:url";
4
4
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
6
  import { z } from "zod";
7
- import { captureScreenshots } from "./screenshot.js";
7
+ import { captureScreenshots, PartialScreenshotCaptureError } from "./screenshot.js";
8
8
  import { auditSeoMetadata, auditSeoMetadataDetailed, checkBrokenLinks, validateSchemaMarkup, validateSchemaMarkupDetailed, } from "./seo-auditor.js";
9
9
  import { createValidationReport, validationReportChecks, } from "./report.js";
10
10
  import { fetchPublicText, getErrorMessage, readTextFile } from "./network.js";
11
- import { cssValidationContent, failureContent, htmlValidationContent, linkCheckContent, reportContent, schemaValidationContent, screenshotCaptureContent, seoAuditContent, } from "./presentation.js";
11
+ import { cssValidationContent, failureContent, htmlValidationContent, linkCheckContent, reportContent, schemaValidationContent, screenshotCaptureContent, screenshotPartialCaptureContent, seoAuditContent, } from "./presentation.js";
12
12
  import { PACKAGE_VERSION } from "./version.js";
13
13
  import { getW3CMessageSeverity, MAX_CSS_VALIDATION_BYTES, validateCssContent, validateCssContentDetailed, validateHtmlContent, validateHtmlContentDetailed, } from "./w3c-validator.js";
14
14
  export const SERVER_VERSION = PACKAGE_VERSION;
@@ -17,12 +17,13 @@ const CSS_MAX_BYTES = MAX_CSS_VALIDATION_BYTES;
17
17
  const PATH_MAX_LENGTH = 4_096;
18
18
  const MAX_VIEWPORTS = 8;
19
19
  function localHtmlValidationMediaType(filePath) {
20
- return path.extname(filePath).toLowerCase() === ".xhtml"
20
+ const extension = path.extname(filePath).toLowerCase();
21
+ return extension === ".xhtml" || extension === ".xht"
21
22
  ? "application/xhtml+xml"
22
23
  : "text/html";
23
24
  }
24
25
  const filePathSchema = z.string().trim().min(1).max(PATH_MAX_LENGTH);
25
- const htmlContentSchema = z.string().min(1).max(HTML_MAX_BYTES);
26
+ const htmlContentSchema = z.string().min(1).max(HTML_MAX_BYTES).refine((value) => new TextEncoder().encode(value).byteLength <= HTML_MAX_BYTES, `HTML input must not exceed ${HTML_MAX_BYTES.toLocaleString("en-US")} UTF-8 bytes.`);
26
27
  const publicUrlSchema = z
27
28
  .string()
28
29
  .url()
@@ -70,6 +71,7 @@ const screenshotSchema = z.object({
70
71
  width: z.number().int(),
71
72
  height: z.number().int(),
72
73
  outputPath: z.string(),
74
+ incompleteAssetCount: z.number().int().nonnegative().optional(),
73
75
  });
74
76
  const reportSummarySchema = z.object({
75
77
  overallScore: z.number().int().min(0).max(100).nullable(),
@@ -87,6 +89,7 @@ const reportSummarySchema = z.object({
87
89
  schemaErrors: z.number().int().nonnegative(),
88
90
  linksChecked: z.number().int().nonnegative(),
89
91
  brokenLinks: z.number().int().nonnegative(),
92
+ unverifiedLinks: z.number().int().nonnegative(),
90
93
  });
91
94
  const externalReadOnlyAnnotations = {
92
95
  // These calls contact external recipients but do not modify external state.
@@ -132,6 +135,7 @@ function failedReport(filePath, error) {
132
135
  schemaErrors: 0,
133
136
  linksChecked: 0,
134
137
  brokenLinks: 0,
138
+ unverifiedLinks: 0,
135
139
  },
136
140
  htmlMessages: [],
137
141
  htmlTotalMessages: 0,
@@ -508,7 +512,7 @@ export function createServer() {
508
512
  });
509
513
  server.registerTool("screenshot.capture", {
510
514
  title: "Capture responsive screenshots",
511
- description: "Renders a local HTML file or HTTP(S) URL in a sandboxed local Chromium browser and writes PNG screenshots to the requested directory. Downloads the pinned headless browser on first use if it is not already cached. Existing matching files may be replaced.",
515
+ description: "Renders a local HTML file or HTTP(S) URL in a sandboxed local Chromium browser and writes PNG screenshots to the requested directory. Downloads the pinned headless browser on first use if it is not already cached. Existing matching files may be replaced. Completed PNG paths are included if a later viewport fails.",
512
516
  inputSchema: {
513
517
  targetPath: z
514
518
  .string()
@@ -559,10 +563,18 @@ export function createServer() {
559
563
  const outputDirectory = path.resolve(outputDir);
560
564
  try {
561
565
  const screenshots = await captureScreenshots(targetPath, outputDirectory, viewports);
566
+ const affected = screenshots.filter((capture) => (capture.incompleteAssetCount ?? 0) > 0);
567
+ if (affected.length > 0) {
568
+ const error = `${affected.length} screenshot viewport(s) have failed or blocked visual assets; files were saved but captures may be incomplete.`;
569
+ return result({ screenshots, outputDirectory, error }, screenshotPartialCaptureContent(screenshots.length, outputDirectory, error), true);
570
+ }
562
571
  return result({ screenshots, outputDirectory }, screenshotCaptureContent(screenshots.length, outputDirectory));
563
572
  }
564
573
  catch (cause) {
565
574
  const error = getErrorMessage(cause);
575
+ if (cause instanceof PartialScreenshotCaptureError) {
576
+ return result({ screenshots: cause.screenshots, outputDirectory, error }, screenshotPartialCaptureContent(cause.screenshots.length, outputDirectory, error), true);
577
+ }
566
578
  return result({ screenshots: [], outputDirectory, error }, failureContent("Screenshot capture", error, "Confirm the target is reachable or readable and the output directory is writable, then retry."), true);
567
579
  }
568
580
  });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceR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G;IACvB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;IACjD,OAAO,CAAC,KAAK,CAAC,qBAAqB,cAAc,mBAAmB,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACpG,IAAI,WAAW,KAAK,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;IACpC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC7B,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QACjF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["#!/usr/bin/env node\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport type { CallToolResult } from \"@modelcontextprotocol/sdk/types.js\";\nimport { z } from \"zod\";\nimport { captureScreenshots } from \"./screenshot.js\";\nimport {\n auditSeoMetadata,\n auditSeoMetadataDetailed,\n checkBrokenLinks,\n validateSchemaMarkup,\n validateSchemaMarkupDetailed,\n} from \"./seo-auditor.js\";\nimport {\n createValidationReport,\n type ValidationReport,\n type ValidationReportCheck,\n validationReportChecks,\n} from \"./report.js\";\nimport { fetchPublicText, getErrorMessage, readTextFile } from \"./network.js\";\nimport {\n cssValidationContent,\n failureContent,\n htmlValidationContent,\n linkCheckContent,\n reportContent,\n schemaValidationContent,\n screenshotCaptureContent,\n seoAuditContent,\n} from \"./presentation.js\";\nimport { PACKAGE_VERSION } from \"./version.js\";\nimport {\n getW3CMessageSeverity,\n type HtmlValidationMediaType,\n MAX_CSS_VALIDATION_BYTES,\n validateCssContent,\n validateCssContentDetailed,\n validateHtmlContent,\n validateHtmlContentDetailed,\n} from \"./w3c-validator.js\";\n\nexport const SERVER_VERSION = PACKAGE_VERSION;\n\nconst HTML_MAX_BYTES = 2_000_000;\nconst CSS_MAX_BYTES = MAX_CSS_VALIDATION_BYTES;\nconst PATH_MAX_LENGTH = 4_096;\nconst MAX_VIEWPORTS = 8;\n\nfunction localHtmlValidationMediaType(filePath: string): HtmlValidationMediaType {\n return path.extname(filePath).toLowerCase() === \".xhtml\"\n ? \"application/xhtml+xml\"\n : \"text/html\";\n}\n\nconst filePathSchema = z.string().trim().min(1).max(PATH_MAX_LENGTH);\nconst htmlContentSchema = z.string().min(1).max(HTML_MAX_BYTES);\nconst publicUrlSchema = z\n .string()\n .url()\n .refine((value) => {\n const protocol = new URL(value).protocol;\n return protocol === \"http:\" || protocol === \"https:\";\n }, \"URL must use HTTP or HTTPS.\");\n\nconst w3cMessageSchema = z.object({\n type: z.string(),\n subType: z.string().optional(),\n message: z.string(),\n lastLine: z.number().int().optional(),\n lastColumn: z.number().int().optional(),\n firstLine: z.number().int().optional(),\n firstColumn: z.number().int().optional(),\n extract: z.string().optional(),\n});\n\nconst cssMessageSchema = z.object({\n line: z.number().int(),\n type: z.string(),\n message: z.string(),\n context: z.string().optional(),\n compatibility: z.literal(\"known-validator-limitation\").optional(),\n});\n\nconst seoIssueSchema = z.object({\n code: z.string().describe(\"Stable machine-readable audit rule identifier.\"),\n severity: z.enum([\"error\", \"warning\", \"info\"]),\n category: z.enum([\"SEO\", \"Schema\", \"BrokenLinks\", \"Accessibility\"]),\n message: z.string(),\n element: z.string().optional(),\n});\n\nconst auditCountsSchema = z.object({\n error: z.number().int().nonnegative(),\n warning: z.number().int().nonnegative(),\n info: z.number().int().nonnegative(),\n});\n\nconst linkStatusSchema = z.object({\n url: z.string(),\n status: z.union([z.number().int(), z.enum([\"blocked\", \"failed\"])]),\n ok: z.boolean(),\n message: z.string().optional(),\n});\n\nconst screenshotSchema = z.object({\n viewportName: z.string(),\n width: z.number().int(),\n height: z.number().int(),\n outputPath: z.string(),\n});\n\nconst reportSummarySchema = z.object({\n overallScore: z.number().int().min(0).max(100).nullable(),\n htmlScore: z.number().int().min(0).max(100).nullable(),\n cssScore: z.number().int().min(0).max(100).nullable(),\n seoScore: z.number().int().min(0).max(100).nullable(),\n linkScore: z.number().int().min(0).max(100).nullable(),\n htmlErrors: z.number().int().nonnegative(),\n htmlWarnings: z.number().int().nonnegative(),\n cssErrors: z.number().int().nonnegative(),\n cssWarnings: z.number().int().nonnegative().optional(),\n cssCompatibilityLimitations: z.number().int().nonnegative(),\n seoErrors: z.number().int().nonnegative(),\n seoWarnings: z.number().int().nonnegative(),\n schemaErrors: z.number().int().nonnegative(),\n linksChecked: z.number().int().nonnegative(),\n brokenLinks: z.number().int().nonnegative(),\n});\n\nconst externalReadOnlyAnnotations = {\n // These calls contact external recipients but do not modify external state.\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n} as const;\n\nconst localReadOnlyAnnotations = {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n} as const;\n\nfunction result<T extends object>(\n structuredContent: T,\n content: string,\n isError = false,\n): CallToolResult {\n return {\n structuredContent: structuredContent as Record<string, unknown>,\n content: [\n {\n type: \"text\",\n text: content,\n },\n ],\n ...(isError ? { isError: true } : {}),\n };\n}\n\nfunction failedReport(filePath: string, error: string): ValidationReport {\n return {\n report: `Validation report could not be generated: ${error}`,\n summary: {\n overallScore: null,\n htmlScore: null,\n cssScore: null,\n seoScore: null,\n linkScore: null,\n htmlErrors: 0,\n htmlWarnings: 0,\n cssErrors: 0,\n cssWarnings: 0,\n cssCompatibilityLimitations: 0,\n seoErrors: 0,\n seoWarnings: 0,\n schemaErrors: 0,\n linksChecked: 0,\n brokenLinks: 0,\n },\n htmlMessages: [],\n htmlTotalMessages: 0,\n htmlTruncated: false,\n cssMessages: [],\n cssTotalMessages: 0,\n cssTruncated: false,\n seoIssues: [],\n seoTotalIssues: 0,\n seoTruncated: false,\n schemaIssues: [],\n schemaTotalIssues: 0,\n schemaTruncated: false,\n links: [],\n failedChecks: [\"input\"],\n errors: [`${path.basename(filePath || \"document\")}: ${error}`],\n };\n}\n\ninterface ValidationReportDependencies {\n readTextFile: typeof readTextFile;\n validateHtmlContent: typeof validateHtmlContent;\n validateHtmlContentDetailed?: typeof validateHtmlContentDetailed;\n validateCssContent: typeof validateCssContent;\n validateCssContentDetailed?: typeof validateCssContentDetailed;\n auditSeoMetadata: typeof auditSeoMetadata;\n auditSeoMetadataDetailed?: typeof auditSeoMetadataDetailed;\n validateSchemaMarkup: typeof validateSchemaMarkup;\n validateSchemaMarkupDetailed?: typeof validateSchemaMarkupDetailed;\n checkBrokenLinks: typeof checkBrokenLinks;\n}\n\nconst validationReportDependencies: ValidationReportDependencies = {\n readTextFile,\n validateHtmlContent,\n validateHtmlContentDetailed,\n validateCssContent,\n validateCssContentDetailed,\n auditSeoMetadata,\n auditSeoMetadataDetailed,\n validateSchemaMarkup,\n validateSchemaMarkupDetailed,\n checkBrokenLinks,\n};\n\nexport interface GenerateValidationReportOptions {\n htmlFilePath: string;\n cssFilePath?: string;\n baseUrl?: string;\n}\n\n/** Runs independent validation checks without discarding successful results when another check fails. */\nexport async function generateValidationReport(\n { htmlFilePath, cssFilePath, baseUrl }: GenerateValidationReportOptions,\n dependencies: ValidationReportDependencies = validationReportDependencies,\n): Promise<ValidationReport> {\n const htmlMediaType = localHtmlValidationMediaType(htmlFilePath);\n const html = await dependencies.readTextFile(htmlFilePath, HTML_MAX_BYTES, htmlMediaType);\n const failedChecks: ValidationReportCheck[] = [];\n const errors: string[] = [];\n const recordFailure = (check: ValidationReportCheck, label: string, cause: unknown): void => {\n if (!failedChecks.includes(check)) {\n failedChecks.push(check);\n }\n errors.push(`${label} was unavailable: ${getErrorMessage(cause)}`);\n };\n\n let css: string | undefined;\n if (cssFilePath) {\n try {\n css = await dependencies.readTextFile(cssFilePath, CSS_MAX_BYTES, \"text/css\");\n } catch (cause) {\n recordFailure(\"css\", \"CSS validation\", cause);\n }\n }\n\n const htmlValidation = dependencies.validateHtmlContentDetailed\n ? dependencies.validateHtmlContentDetailed(html, htmlMediaType)\n : dependencies.validateHtmlContent(html, htmlMediaType).then((messages) => {\n const counts = { error: 0, warning: 0, info: 0 };\n for (const message of messages) counts[getW3CMessageSeverity(message)] += 1;\n return { messages, total: messages.length, truncated: false, counts };\n });\n const cssValidation = css === undefined\n ? Promise.resolve({\n messages: [],\n total: 0,\n truncated: false,\n counts: { error: 0, warning: 0, compatibilityLimitation: 0 },\n })\n : dependencies.validateCssContentDetailed\n ? dependencies.validateCssContentDetailed(css)\n : dependencies.validateCssContent(css).then((messages) => {\n const compatibilityLimitation = messages.filter(\n (message) => message.compatibility === \"known-validator-limitation\",\n ).length;\n const warning = messages.filter((message) => message.type.toLowerCase() === \"warning\").length;\n return {\n messages,\n total: messages.length,\n truncated: false,\n counts: {\n error: messages.length - warning - compatibilityLimitation,\n warning,\n compatibilityLimitation,\n },\n };\n });\n const seoValidation = dependencies.auditSeoMetadataDetailed\n ? Promise.resolve().then(() => dependencies.auditSeoMetadataDetailed!(html))\n : Promise.resolve().then(() => {\n const issues = dependencies.auditSeoMetadata(html);\n const counts = { error: 0, warning: 0, info: 0 };\n for (const issue of issues) counts[issue.severity] += 1;\n return { issues, totalIssues: issues.length, truncated: false, counts };\n });\n const schemaValidation = dependencies.validateSchemaMarkupDetailed\n ? Promise.resolve().then(() => dependencies.validateSchemaMarkupDetailed!(html))\n : Promise.resolve().then(() => {\n const issues = dependencies.validateSchemaMarkup(html);\n const counts = { error: 0, warning: 0, info: 0 };\n for (const issue of issues) counts[issue.severity] += 1;\n return { issues, totalIssues: issues.length, truncated: false, counts };\n });\n const [htmlResult, cssResult, seoResult, schemaResult, linksResult] = await Promise.allSettled([\n htmlValidation,\n cssValidation,\n seoValidation,\n schemaValidation,\n dependencies.checkBrokenLinks(html, baseUrl, 25),\n ]);\n\n if (htmlResult.status === \"rejected\") recordFailure(\"html\", \"HTML validation\", htmlResult.reason);\n if (cssResult.status === \"rejected\") recordFailure(\"css\", \"CSS validation\", cssResult.reason);\n if (seoResult.status === \"rejected\") recordFailure(\"seo\", \"SEO analysis\", seoResult.reason);\n if (schemaResult.status === \"rejected\") recordFailure(\"schema\", \"JSON-LD analysis\", schemaResult.reason);\n if (linksResult.status === \"rejected\") recordFailure(\"links\", \"Link checking\", linksResult.reason);\n\n return createValidationReport({\n htmlFilePath,\n cssAudited: css !== undefined,\n htmlMessages: htmlResult.status === \"fulfilled\" ? htmlResult.value.messages : [],\n htmlTotalMessages: htmlResult.status === \"fulfilled\" ? htmlResult.value.total : 0,\n htmlTruncated: htmlResult.status === \"fulfilled\" ? htmlResult.value.truncated : false,\n htmlCounts: htmlResult.status === \"fulfilled\" ? htmlResult.value.counts : undefined,\n cssMessages: cssResult.status === \"fulfilled\" ? cssResult.value.messages : [],\n cssTotalMessages: cssResult.status === \"fulfilled\" ? cssResult.value.total : 0,\n cssTruncated: cssResult.status === \"fulfilled\" ? cssResult.value.truncated : false,\n cssCounts: cssResult.status === \"fulfilled\" ? cssResult.value.counts : undefined,\n seoIssues: seoResult.status === \"fulfilled\" ? seoResult.value.issues : [],\n seoTotalIssues: seoResult.status === \"fulfilled\" ? seoResult.value.totalIssues : 0,\n seoTruncated: seoResult.status === \"fulfilled\" ? seoResult.value.truncated : false,\n seoCounts: seoResult.status === \"fulfilled\" ? seoResult.value.counts : undefined,\n schemaIssues: schemaResult.status === \"fulfilled\" ? schemaResult.value.issues : [],\n schemaTotalIssues: schemaResult.status === \"fulfilled\" ? schemaResult.value.totalIssues : 0,\n schemaTruncated: schemaResult.status === \"fulfilled\" ? schemaResult.value.truncated : false,\n schemaCounts: schemaResult.status === \"fulfilled\" ? schemaResult.value.counts : undefined,\n links: linksResult.status === \"fulfilled\" ? linksResult.value : [],\n failedChecks,\n errors,\n });\n}\n\nexport function createServer(): McpServer {\n const server = new McpServer(\n { name: \"mcp-web-validator\", version: SERVER_VERSION },\n {\n instructions:\n \"Validate only files, markup, and public URLs the user owns or is authorized to inspect. HTML and CSS validation send supplied content to W3C-operated validators. Link checks contact public links without following redirects. Screenshot capture executes page content in a sandboxed local browser and writes PNG files.\",\n },\n );\n\n server.registerTool(\n \"html.local\",\n {\n title: \"Validate local HTML\",\n description:\n \"Reads a bounded local HTML or .xhtml file and sends its markup to the W3C Nu HTML Checker. .xhtml files use application/xhtml+xml parsing semantics. Use only files the user is authorized to share.\",\n inputSchema: {\n filePath: filePathSchema.describe(\"Absolute or workspace-relative path to an HTML or .xhtml file.\"),\n },\n outputSchema: {\n errors: z.array(w3cMessageSchema),\n totalMessages: z.number().int().nonnegative(),\n truncated: z.boolean(),\n error: z.string().optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ filePath }) => {\n try {\n const htmlMediaType = localHtmlValidationMediaType(filePath);\n const html = await readTextFile(filePath, HTML_MAX_BYTES, htmlMediaType);\n const validation = await validateHtmlContentDetailed(\n html,\n htmlMediaType,\n );\n return result(\n { errors: validation.messages, totalMessages: validation.total, truncated: validation.truncated },\n htmlValidationContent(validation.messages, undefined, validation.total, validation.counts),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { errors: [], totalMessages: 0, truncated: false, error },\n failureContent(\n \"HTML validation\",\n error,\n \"Confirm the file exists and is readable, then retry. If the W3C service is unavailable, try again later.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"html.url\",\n {\n title: \"Validate a public URL\",\n description:\n \"Fetches a bounded public HTTP(S) page, then sends its markup to the W3C Nu HTML Checker. Private, reserved, credentialed, and nonstandard-port destinations are rejected.\",\n inputSchema: {\n url: publicUrlSchema.describe(\"Public HTTP(S) URL on port 80 or 443.\"),\n },\n outputSchema: {\n errors: z.array(w3cMessageSchema),\n totalMessages: z.number().int().nonnegative(),\n truncated: z.boolean(),\n fetchedUrl: z.string().optional(),\n error: z.string().optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ url }) => {\n try {\n const fetched = await fetchPublicText(url, {\n maxBytes: HTML_MAX_BYTES,\n timeoutMs: 15_000,\n maxRedirects: 3,\n acceptedContentTypes: [\"text/html\", \"application/xhtml+xml\"],\n headers: {\n accept: \"text/html,application/xhtml+xml;q=0.9\",\n \"user-agent\": `DigestSEO-Web-Validator/${SERVER_VERSION} (+https://digestseo.com/validator-mcp/)`,\n },\n });\n if (fetched.status < 200 || fetched.status >= 300) {\n throw new Error(`Target URL returned HTTP ${fetched.status}.`);\n }\n const validationMediaType = fetched.contentType\n ?.split(\";\", 1)[0]\n .trim()\n .toLowerCase() === \"application/xhtml+xml\"\n ? \"application/xhtml+xml\"\n : \"text/html\";\n const validation = await validateHtmlContentDetailed(fetched.text, validationMediaType);\n return result(\n {\n errors: validation.messages,\n totalMessages: validation.total,\n truncated: validation.truncated,\n fetchedUrl: fetched.url,\n },\n htmlValidationContent(validation.messages, fetched.url, validation.total, validation.counts),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { errors: [], totalMessages: 0, truncated: false, error },\n failureContent(\n \"URL validation\",\n error,\n \"Confirm the URL is public, uses HTTP or HTTPS on a standard port, and returns HTML, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"css.local\",\n {\n title: \"Validate local CSS\",\n description:\n \"Reads a bounded local CSS file and sends it to the W3C Jigsaw CSS Validator. Use only files the user is authorized to share.\",\n inputSchema: {\n filePath: filePathSchema.describe(\"Absolute or workspace-relative path to a CSS file.\"),\n },\n outputSchema: {\n errors: z.array(cssMessageSchema),\n warnings: z.array(cssMessageSchema).optional(),\n totalMessages: z.number().int().nonnegative(),\n truncated: z.boolean(),\n error: z.string().optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ filePath }) => {\n try {\n const css = await readTextFile(filePath, CSS_MAX_BYTES, \"text/css\");\n const validation = await validateCssContentDetailed(css);\n return result(\n {\n errors: validation.messages.filter((message) => message.type.toLowerCase() !== \"warning\"),\n warnings: validation.messages.filter((message) => message.type.toLowerCase() === \"warning\"),\n totalMessages: validation.total,\n truncated: validation.truncated,\n },\n cssValidationContent(validation.messages, validation.total, validation.counts),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { errors: [], warnings: [], totalMessages: 0, truncated: false, error },\n failureContent(\n \"CSS validation\",\n error,\n \"Confirm the file exists, is readable, and is within the size limit, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"seo.metadata\",\n {\n title: \"Audit SEO metadata\",\n description:\n \"Audits supplied HTML offline for on-page SEO metadata, headings, viewport, image alternatives, and Open Graph issues. Use for a quick on-page check; use html.local/html.url for W3C HTML validation, schema.markup for JSON-LD syntax, or report.validation for a combined local-file report.\",\n inputSchema: {\n htmlContent: htmlContentSchema.describe(\"Raw HTML markup to inspect locally.\"),\n },\n outputSchema: {\n issues: z.array(seoIssueSchema),\n totalIssues: z.number().int().nonnegative(),\n truncated: z.boolean(),\n counts: auditCountsSchema,\n error: z.string().optional(),\n },\n annotations: localReadOnlyAnnotations,\n },\n async ({ htmlContent }) => {\n try {\n const { issues, totalIssues, truncated, counts } = auditSeoMetadataDetailed(htmlContent);\n return result(\n { issues, totalIssues, truncated, counts },\n seoAuditContent(issues, totalIssues, truncated, counts),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { issues: [], totalIssues: 0, truncated: false, counts: { error: 0, warning: 0, info: 0 }, error },\n failureContent(\n \"SEO audit\",\n error,\n \"Confirm the supplied HTML is complete and within the size limit, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"links.broken\",\n {\n title: \"Check public links\",\n description:\n \"Resolves and checks up to 25 public HTTP(S) links in supplied HTML. Redirects are reported but not followed, and response bodies are discarded.\",\n inputSchema: {\n htmlContent: htmlContentSchema.describe(\"Raw HTML markup containing links to check.\"),\n baseUrl: publicUrlSchema\n .optional()\n .describe(\"Optional public HTTP(S) base URL used to resolve relative links.\"),\n maxLinks: z\n .number()\n .int()\n .min(1)\n .max(25)\n .default(25)\n .describe(\"Maximum number of public HTTP(S) links to check, from 1 to 25.\"),\n },\n outputSchema: {\n links: z.array(linkStatusSchema),\n error: z.string().optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ htmlContent, baseUrl, maxLinks }) => {\n try {\n const links = await checkBrokenLinks(htmlContent, baseUrl, maxLinks);\n return result({ links }, linkCheckContent(links, baseUrl));\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { links: [], error },\n failureContent(\n \"Link check\",\n error,\n \"Confirm the base URL is public and the supplied HTML is within the size limit, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"schema.markup\",\n {\n title: \"Validate JSON-LD syntax\",\n description:\n \"Parses JSON-LD blocks in supplied HTML locally and reports empty blocks or JSON syntax errors. It does not validate vocabulary semantics.\",\n inputSchema: {\n htmlContent: htmlContentSchema.describe(\"Raw HTML containing JSON-LD script blocks.\"),\n },\n outputSchema: {\n issues: z.array(seoIssueSchema),\n totalIssues: z.number().int().nonnegative(),\n truncated: z.boolean(),\n counts: auditCountsSchema,\n error: z.string().optional(),\n },\n annotations: localReadOnlyAnnotations,\n },\n async ({ htmlContent }) => {\n try {\n const { issues, totalIssues, truncated, counts } = validateSchemaMarkupDetailed(htmlContent);\n return result(\n { issues, totalIssues, truncated, counts },\n schemaValidationContent(issues, totalIssues, truncated, htmlContent),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { issues: [], totalIssues: 0, truncated: false, counts: { error: 0, warning: 0, info: 0 }, error },\n failureContent(\n \"JSON-LD syntax\",\n error,\n \"Confirm the supplied HTML is complete and within the size limit, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"report.validation\",\n {\n title: \"Generate a validation report\",\n description:\n \"Combines W3C HTML/CSS validation, local SEO/accessibility checks, JSON-LD syntax checks, and a bounded public-link check into a Markdown and structured report.\",\n inputSchema: {\n htmlFilePath: filePathSchema.describe(\"Absolute or workspace-relative HTML or .xhtml file path.\"),\n cssFilePath: filePathSchema\n .optional()\n .describe(\"Optional absolute or workspace-relative CSS file path.\"),\n baseUrl: publicUrlSchema\n .optional()\n .describe(\"Optional public HTTP(S) base URL used to resolve relative links.\"),\n },\n outputSchema: {\n report: z.string(),\n summary: reportSummarySchema,\n htmlMessages: z.array(w3cMessageSchema),\n htmlTotalMessages: z.number().int().nonnegative(),\n htmlTruncated: z.boolean(),\n cssMessages: z.array(cssMessageSchema),\n cssTotalMessages: z.number().int().nonnegative(),\n cssTruncated: z.boolean(),\n seoIssues: z.array(seoIssueSchema),\n seoTotalIssues: z.number().int().nonnegative(),\n seoTruncated: z.boolean(),\n schemaIssues: z.array(seoIssueSchema),\n schemaTotalIssues: z.number().int().nonnegative(),\n schemaTruncated: z.boolean(),\n links: z.array(linkStatusSchema),\n failedChecks: z.array(z.enum(validationReportChecks)),\n errors: z.array(z.string()).optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ htmlFilePath, cssFilePath, baseUrl }) => {\n try {\n const reportData = await generateValidationReport({\n htmlFilePath,\n cssFilePath,\n baseUrl,\n });\n return result(reportData, reportContent(reportData));\n } catch (cause) {\n const error = getErrorMessage(cause);\n const reportData = failedReport(htmlFilePath, error);\n return result(\n reportData,\n failureContent(\n \"Validation report\",\n error,\n \"Confirm the input paths are readable and any base URL is public, then regenerate the report.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"screenshot.capture\",\n {\n title: \"Capture responsive screenshots\",\n description:\n \"Renders a local HTML file or HTTP(S) URL in a sandboxed local Chromium browser and writes PNG screenshots to the requested directory. Downloads the pinned headless browser on first use if it is not already cached. Existing matching files may be replaced.\",\n inputSchema: {\n targetPath: z\n .string()\n .trim()\n .min(1)\n .max(PATH_MAX_LENGTH)\n .describe(\"Local HTML path or HTTP(S) URL to render.\"),\n outputDir: filePathSchema\n .optional()\n .default(\".mcp-validator/screenshots\")\n .describe(\"Directory where PNG screenshots will be written.\"),\n viewports: z\n .array(\n z.object({\n name: z\n .string()\n .regex(/^[A-Za-z0-9_-]{1,50}$/)\n .describe(\"Safe filename label for this screenshot viewport.\"),\n width: z\n .number()\n .int()\n .min(200)\n .max(3_840)\n .describe(\"Viewport width in CSS pixels, from 200 to 3840.\"),\n height: z\n .number()\n .int()\n .min(200)\n .max(4_320)\n .describe(\"Viewport height in CSS pixels, from 200 to 4320.\"),\n }),\n )\n .min(1)\n .max(MAX_VIEWPORTS)\n .optional()\n .describe(\"Optional viewport definitions; defaults to desktop, tablet, and mobile sizes.\"),\n },\n outputSchema: {\n screenshots: z.array(screenshotSchema),\n outputDirectory: z.string(),\n error: z.string().optional(),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ targetPath, outputDir, viewports }) => {\n const outputDirectory = path.resolve(outputDir);\n try {\n const screenshots = await captureScreenshots(targetPath, outputDirectory, viewports);\n return result(\n { screenshots, outputDirectory },\n screenshotCaptureContent(screenshots.length, outputDirectory),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { screenshots: [], outputDirectory, error },\n failureContent(\n \"Screenshot capture\",\n error,\n \"Confirm the target is reachable or readable and the output directory is writable, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n return server;\n}\n\nexport async function run(): Promise<void> {\n const server = createServer();\n await server.connect(new StdioServerTransport());\n console.error(`mcp-web-validator ${SERVER_VERSION} started on stdio`);\n}\n\nconst invokedPath = process.argv[1] ? pathToFileURL(path.resolve(process.argv[1])).href : undefined;\nif (invokedPath === import.meta.url) {\n run().catch((cause: unknown) => {\n console.error(\"Fatal error starting mcp-web-validator:\", getErrorMessage(cause));\n process.exitCode = 1;\n });\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,sBAAsB,EAGtB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,wBAAwB,EACxB,+BAA+B,EAC/B,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EACL,qBAAqB,EAErB,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC;AAE9C,MAAM,cAAc,GAAG,SAAS,CAAC;AACjC,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAC/C,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,SAAS,4BAA4B,CAAC,QAAgB;IACpD,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B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;IACjD,OAAO,CAAC,KAAK,CAAC,qBAAqB,cAAc,mBAAmB,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACpG,IAAI,WAAW,KAAK,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;IACpC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC7B,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QACjF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["#!/usr/bin/env node\nimport * as path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport type { CallToolResult } from \"@modelcontextprotocol/sdk/types.js\";\nimport { z } from \"zod\";\nimport { captureScreenshots, PartialScreenshotCaptureError } from \"./screenshot.js\";\nimport {\n auditSeoMetadata,\n auditSeoMetadataDetailed,\n checkBrokenLinks,\n validateSchemaMarkup,\n validateSchemaMarkupDetailed,\n} from \"./seo-auditor.js\";\nimport {\n createValidationReport,\n type ValidationReport,\n type ValidationReportCheck,\n validationReportChecks,\n} from \"./report.js\";\nimport { fetchPublicText, getErrorMessage, readTextFile } from \"./network.js\";\nimport {\n cssValidationContent,\n failureContent,\n htmlValidationContent,\n linkCheckContent,\n reportContent,\n schemaValidationContent,\n screenshotCaptureContent,\n screenshotPartialCaptureContent,\n seoAuditContent,\n} from \"./presentation.js\";\nimport { PACKAGE_VERSION } from \"./version.js\";\nimport {\n getW3CMessageSeverity,\n type HtmlValidationMediaType,\n MAX_CSS_VALIDATION_BYTES,\n validateCssContent,\n validateCssContentDetailed,\n validateHtmlContent,\n validateHtmlContentDetailed,\n} from \"./w3c-validator.js\";\n\nexport const SERVER_VERSION = PACKAGE_VERSION;\n\nconst HTML_MAX_BYTES = 2_000_000;\nconst CSS_MAX_BYTES = MAX_CSS_VALIDATION_BYTES;\nconst PATH_MAX_LENGTH = 4_096;\nconst MAX_VIEWPORTS = 8;\n\nfunction localHtmlValidationMediaType(filePath: string): HtmlValidationMediaType {\n const extension = path.extname(filePath).toLowerCase();\n return extension === \".xhtml\" || extension === \".xht\"\n ? \"application/xhtml+xml\"\n : \"text/html\";\n}\n\nconst filePathSchema = z.string().trim().min(1).max(PATH_MAX_LENGTH);\nconst htmlContentSchema = z.string().min(1).max(HTML_MAX_BYTES).refine(\n (value) => new TextEncoder().encode(value).byteLength <= HTML_MAX_BYTES,\n `HTML input must not exceed ${HTML_MAX_BYTES.toLocaleString(\"en-US\")} UTF-8 bytes.`,\n);\nconst publicUrlSchema = z\n .string()\n .url()\n .refine((value) => {\n const protocol = new URL(value).protocol;\n return protocol === \"http:\" || protocol === \"https:\";\n }, \"URL must use HTTP or HTTPS.\");\n\nconst w3cMessageSchema = z.object({\n type: z.string(),\n subType: z.string().optional(),\n message: z.string(),\n lastLine: z.number().int().optional(),\n lastColumn: z.number().int().optional(),\n firstLine: z.number().int().optional(),\n firstColumn: z.number().int().optional(),\n extract: z.string().optional(),\n});\n\nconst cssMessageSchema = z.object({\n line: z.number().int(),\n type: z.string(),\n message: z.string(),\n context: z.string().optional(),\n compatibility: z.literal(\"known-validator-limitation\").optional(),\n});\n\nconst seoIssueSchema = z.object({\n code: z.string().describe(\"Stable machine-readable audit rule identifier.\"),\n severity: z.enum([\"error\", \"warning\", \"info\"]),\n category: z.enum([\"SEO\", \"Schema\", \"BrokenLinks\", \"Accessibility\"]),\n message: z.string(),\n element: z.string().optional(),\n});\n\nconst auditCountsSchema = z.object({\n error: z.number().int().nonnegative(),\n warning: z.number().int().nonnegative(),\n info: z.number().int().nonnegative(),\n});\n\nconst linkStatusSchema = z.object({\n url: z.string(),\n status: z.union([z.number().int(), z.enum([\"blocked\", \"failed\"])]),\n ok: z.boolean(),\n message: z.string().optional(),\n});\n\nconst screenshotSchema = z.object({\n viewportName: z.string(),\n width: z.number().int(),\n height: z.number().int(),\n outputPath: z.string(),\n incompleteAssetCount: z.number().int().nonnegative().optional(),\n});\n\nconst reportSummarySchema = z.object({\n overallScore: z.number().int().min(0).max(100).nullable(),\n htmlScore: z.number().int().min(0).max(100).nullable(),\n cssScore: z.number().int().min(0).max(100).nullable(),\n seoScore: z.number().int().min(0).max(100).nullable(),\n linkScore: z.number().int().min(0).max(100).nullable(),\n htmlErrors: z.number().int().nonnegative(),\n htmlWarnings: z.number().int().nonnegative(),\n cssErrors: z.number().int().nonnegative(),\n cssWarnings: z.number().int().nonnegative().optional(),\n cssCompatibilityLimitations: z.number().int().nonnegative(),\n seoErrors: z.number().int().nonnegative(),\n seoWarnings: z.number().int().nonnegative(),\n schemaErrors: z.number().int().nonnegative(),\n linksChecked: z.number().int().nonnegative(),\n brokenLinks: z.number().int().nonnegative(),\n unverifiedLinks: z.number().int().nonnegative(),\n});\n\nconst externalReadOnlyAnnotations = {\n // These calls contact external recipients but do not modify external state.\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n} as const;\n\nconst localReadOnlyAnnotations = {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n} as const;\n\nfunction result<T extends object>(\n structuredContent: T,\n content: string,\n isError = false,\n): CallToolResult {\n return {\n structuredContent: structuredContent as Record<string, unknown>,\n content: [\n {\n type: \"text\",\n text: content,\n },\n ],\n ...(isError ? { isError: true } : {}),\n };\n}\n\nfunction failedReport(filePath: string, error: string): ValidationReport {\n return {\n report: `Validation report could not be generated: ${error}`,\n summary: {\n overallScore: null,\n htmlScore: null,\n cssScore: null,\n seoScore: null,\n linkScore: null,\n htmlErrors: 0,\n htmlWarnings: 0,\n cssErrors: 0,\n cssWarnings: 0,\n cssCompatibilityLimitations: 0,\n seoErrors: 0,\n seoWarnings: 0,\n schemaErrors: 0,\n linksChecked: 0,\n brokenLinks: 0,\n unverifiedLinks: 0,\n },\n htmlMessages: [],\n htmlTotalMessages: 0,\n htmlTruncated: false,\n cssMessages: [],\n cssTotalMessages: 0,\n cssTruncated: false,\n seoIssues: [],\n seoTotalIssues: 0,\n seoTruncated: false,\n schemaIssues: [],\n schemaTotalIssues: 0,\n schemaTruncated: false,\n links: [],\n failedChecks: [\"input\"],\n errors: [`${path.basename(filePath || \"document\")}: ${error}`],\n };\n}\n\ninterface ValidationReportDependencies {\n readTextFile: typeof readTextFile;\n validateHtmlContent: typeof validateHtmlContent;\n validateHtmlContentDetailed?: typeof validateHtmlContentDetailed;\n validateCssContent: typeof validateCssContent;\n validateCssContentDetailed?: typeof validateCssContentDetailed;\n auditSeoMetadata: typeof auditSeoMetadata;\n auditSeoMetadataDetailed?: typeof auditSeoMetadataDetailed;\n validateSchemaMarkup: typeof validateSchemaMarkup;\n validateSchemaMarkupDetailed?: typeof validateSchemaMarkupDetailed;\n checkBrokenLinks: typeof checkBrokenLinks;\n}\n\nconst validationReportDependencies: ValidationReportDependencies = {\n readTextFile,\n validateHtmlContent,\n validateHtmlContentDetailed,\n validateCssContent,\n validateCssContentDetailed,\n auditSeoMetadata,\n auditSeoMetadataDetailed,\n validateSchemaMarkup,\n validateSchemaMarkupDetailed,\n checkBrokenLinks,\n};\n\nexport interface GenerateValidationReportOptions {\n htmlFilePath: string;\n cssFilePath?: string;\n baseUrl?: string;\n}\n\n/** Runs independent validation checks without discarding successful results when another check fails. */\nexport async function generateValidationReport(\n { htmlFilePath, cssFilePath, baseUrl }: GenerateValidationReportOptions,\n dependencies: ValidationReportDependencies = validationReportDependencies,\n): Promise<ValidationReport> {\n const htmlMediaType = localHtmlValidationMediaType(htmlFilePath);\n const html = await dependencies.readTextFile(htmlFilePath, HTML_MAX_BYTES, htmlMediaType);\n const failedChecks: ValidationReportCheck[] = [];\n const errors: string[] = [];\n const recordFailure = (check: ValidationReportCheck, label: string, cause: unknown): void => {\n if (!failedChecks.includes(check)) {\n failedChecks.push(check);\n }\n errors.push(`${label} was unavailable: ${getErrorMessage(cause)}`);\n };\n\n let css: string | undefined;\n if (cssFilePath) {\n try {\n css = await dependencies.readTextFile(cssFilePath, CSS_MAX_BYTES, \"text/css\");\n } catch (cause) {\n recordFailure(\"css\", \"CSS validation\", cause);\n }\n }\n\n const htmlValidation = dependencies.validateHtmlContentDetailed\n ? dependencies.validateHtmlContentDetailed(html, htmlMediaType)\n : dependencies.validateHtmlContent(html, htmlMediaType).then((messages) => {\n const counts = { error: 0, warning: 0, info: 0 };\n for (const message of messages) counts[getW3CMessageSeverity(message)] += 1;\n return { messages, total: messages.length, truncated: false, counts };\n });\n const cssValidation = css === undefined\n ? Promise.resolve({\n messages: [],\n total: 0,\n truncated: false,\n counts: { error: 0, warning: 0, compatibilityLimitation: 0 },\n })\n : dependencies.validateCssContentDetailed\n ? dependencies.validateCssContentDetailed(css)\n : dependencies.validateCssContent(css).then((messages) => {\n const compatibilityLimitation = messages.filter(\n (message) => message.compatibility === \"known-validator-limitation\",\n ).length;\n const warning = messages.filter((message) => message.type.toLowerCase() === \"warning\").length;\n return {\n messages,\n total: messages.length,\n truncated: false,\n counts: {\n error: messages.length - warning - compatibilityLimitation,\n warning,\n compatibilityLimitation,\n },\n };\n });\n const seoValidation = dependencies.auditSeoMetadataDetailed\n ? Promise.resolve().then(() => dependencies.auditSeoMetadataDetailed!(html))\n : Promise.resolve().then(() => {\n const issues = dependencies.auditSeoMetadata(html);\n const counts = { error: 0, warning: 0, info: 0 };\n for (const issue of issues) counts[issue.severity] += 1;\n return { issues, totalIssues: issues.length, truncated: false, counts };\n });\n const schemaValidation = dependencies.validateSchemaMarkupDetailed\n ? Promise.resolve().then(() => dependencies.validateSchemaMarkupDetailed!(html))\n : Promise.resolve().then(() => {\n const issues = dependencies.validateSchemaMarkup(html);\n const counts = { error: 0, warning: 0, info: 0 };\n for (const issue of issues) counts[issue.severity] += 1;\n return { issues, totalIssues: issues.length, truncated: false, counts };\n });\n const [htmlResult, cssResult, seoResult, schemaResult, linksResult] = await Promise.allSettled([\n htmlValidation,\n cssValidation,\n seoValidation,\n schemaValidation,\n dependencies.checkBrokenLinks(html, baseUrl, 25),\n ]);\n\n if (htmlResult.status === \"rejected\") recordFailure(\"html\", \"HTML validation\", htmlResult.reason);\n if (cssResult.status === \"rejected\") recordFailure(\"css\", \"CSS validation\", cssResult.reason);\n if (seoResult.status === \"rejected\") recordFailure(\"seo\", \"SEO analysis\", seoResult.reason);\n if (schemaResult.status === \"rejected\") recordFailure(\"schema\", \"JSON-LD analysis\", schemaResult.reason);\n if (linksResult.status === \"rejected\") recordFailure(\"links\", \"Link checking\", linksResult.reason);\n\n return createValidationReport({\n htmlFilePath,\n cssAudited: css !== undefined,\n htmlMessages: htmlResult.status === \"fulfilled\" ? htmlResult.value.messages : [],\n htmlTotalMessages: htmlResult.status === \"fulfilled\" ? htmlResult.value.total : 0,\n htmlTruncated: htmlResult.status === \"fulfilled\" ? htmlResult.value.truncated : false,\n htmlCounts: htmlResult.status === \"fulfilled\" ? htmlResult.value.counts : undefined,\n cssMessages: cssResult.status === \"fulfilled\" ? cssResult.value.messages : [],\n cssTotalMessages: cssResult.status === \"fulfilled\" ? cssResult.value.total : 0,\n cssTruncated: cssResult.status === \"fulfilled\" ? cssResult.value.truncated : false,\n cssCounts: cssResult.status === \"fulfilled\" ? cssResult.value.counts : undefined,\n seoIssues: seoResult.status === \"fulfilled\" ? seoResult.value.issues : [],\n seoTotalIssues: seoResult.status === \"fulfilled\" ? seoResult.value.totalIssues : 0,\n seoTruncated: seoResult.status === \"fulfilled\" ? seoResult.value.truncated : false,\n seoCounts: seoResult.status === \"fulfilled\" ? seoResult.value.counts : undefined,\n schemaIssues: schemaResult.status === \"fulfilled\" ? schemaResult.value.issues : [],\n schemaTotalIssues: schemaResult.status === \"fulfilled\" ? schemaResult.value.totalIssues : 0,\n schemaTruncated: schemaResult.status === \"fulfilled\" ? schemaResult.value.truncated : false,\n schemaCounts: schemaResult.status === \"fulfilled\" ? schemaResult.value.counts : undefined,\n links: linksResult.status === \"fulfilled\" ? linksResult.value : [],\n failedChecks,\n errors,\n });\n}\n\nexport function createServer(): McpServer {\n const server = new McpServer(\n { name: \"mcp-web-validator\", version: SERVER_VERSION },\n {\n instructions:\n \"Validate only files, markup, and public URLs the user owns or is authorized to inspect. HTML and CSS validation send supplied content to W3C-operated validators. Link checks contact public links without following redirects. Screenshot capture executes page content in a sandboxed local browser and writes PNG files.\",\n },\n );\n\n server.registerTool(\n \"html.local\",\n {\n title: \"Validate local HTML\",\n description:\n \"Reads a bounded local HTML or .xhtml file and sends its markup to the W3C Nu HTML Checker. .xhtml files use application/xhtml+xml parsing semantics. Use only files the user is authorized to share.\",\n inputSchema: {\n filePath: filePathSchema.describe(\"Absolute or workspace-relative path to an HTML or .xhtml file.\"),\n },\n outputSchema: {\n errors: z.array(w3cMessageSchema),\n totalMessages: z.number().int().nonnegative(),\n truncated: z.boolean(),\n error: z.string().optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ filePath }) => {\n try {\n const htmlMediaType = localHtmlValidationMediaType(filePath);\n const html = await readTextFile(filePath, HTML_MAX_BYTES, htmlMediaType);\n const validation = await validateHtmlContentDetailed(\n html,\n htmlMediaType,\n );\n return result(\n { errors: validation.messages, totalMessages: validation.total, truncated: validation.truncated },\n htmlValidationContent(validation.messages, undefined, validation.total, validation.counts),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { errors: [], totalMessages: 0, truncated: false, error },\n failureContent(\n \"HTML validation\",\n error,\n \"Confirm the file exists and is readable, then retry. If the W3C service is unavailable, try again later.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"html.url\",\n {\n title: \"Validate a public URL\",\n description:\n \"Fetches a bounded public HTTP(S) page, then sends its markup to the W3C Nu HTML Checker. Private, reserved, credentialed, and nonstandard-port destinations are rejected.\",\n inputSchema: {\n url: publicUrlSchema.describe(\"Public HTTP(S) URL on port 80 or 443.\"),\n },\n outputSchema: {\n errors: z.array(w3cMessageSchema),\n totalMessages: z.number().int().nonnegative(),\n truncated: z.boolean(),\n fetchedUrl: z.string().optional(),\n error: z.string().optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ url }) => {\n try {\n const fetched = await fetchPublicText(url, {\n maxBytes: HTML_MAX_BYTES,\n timeoutMs: 15_000,\n maxRedirects: 3,\n acceptedContentTypes: [\"text/html\", \"application/xhtml+xml\"],\n headers: {\n accept: \"text/html,application/xhtml+xml;q=0.9\",\n \"user-agent\": `DigestSEO-Web-Validator/${SERVER_VERSION} (+https://digestseo.com/validator-mcp/)`,\n },\n });\n if (fetched.status < 200 || fetched.status >= 300) {\n throw new Error(`Target URL returned HTTP ${fetched.status}.`);\n }\n const validationMediaType = fetched.contentType\n ?.split(\";\", 1)[0]\n .trim()\n .toLowerCase() === \"application/xhtml+xml\"\n ? \"application/xhtml+xml\"\n : \"text/html\";\n const validation = await validateHtmlContentDetailed(fetched.text, validationMediaType);\n return result(\n {\n errors: validation.messages,\n totalMessages: validation.total,\n truncated: validation.truncated,\n fetchedUrl: fetched.url,\n },\n htmlValidationContent(validation.messages, fetched.url, validation.total, validation.counts),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { errors: [], totalMessages: 0, truncated: false, error },\n failureContent(\n \"URL validation\",\n error,\n \"Confirm the URL is public, uses HTTP or HTTPS on a standard port, and returns HTML, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"css.local\",\n {\n title: \"Validate local CSS\",\n description:\n \"Reads a bounded local CSS file and sends it to the W3C Jigsaw CSS Validator. Use only files the user is authorized to share.\",\n inputSchema: {\n filePath: filePathSchema.describe(\"Absolute or workspace-relative path to a CSS file.\"),\n },\n outputSchema: {\n errors: z.array(cssMessageSchema),\n warnings: z.array(cssMessageSchema).optional(),\n totalMessages: z.number().int().nonnegative(),\n truncated: z.boolean(),\n error: z.string().optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ filePath }) => {\n try {\n const css = await readTextFile(filePath, CSS_MAX_BYTES, \"text/css\");\n const validation = await validateCssContentDetailed(css);\n return result(\n {\n errors: validation.messages.filter((message) => message.type.toLowerCase() !== \"warning\"),\n warnings: validation.messages.filter((message) => message.type.toLowerCase() === \"warning\"),\n totalMessages: validation.total,\n truncated: validation.truncated,\n },\n cssValidationContent(validation.messages, validation.total, validation.counts),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { errors: [], warnings: [], totalMessages: 0, truncated: false, error },\n failureContent(\n \"CSS validation\",\n error,\n \"Confirm the file exists, is readable, and is within the size limit, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"seo.metadata\",\n {\n title: \"Audit SEO metadata\",\n description:\n \"Audits supplied HTML offline for on-page SEO metadata, headings, viewport, image alternatives, and Open Graph issues. Use for a quick on-page check; use html.local/html.url for W3C HTML validation, schema.markup for JSON-LD syntax, or report.validation for a combined local-file report.\",\n inputSchema: {\n htmlContent: htmlContentSchema.describe(\"Raw HTML markup to inspect locally.\"),\n },\n outputSchema: {\n issues: z.array(seoIssueSchema),\n totalIssues: z.number().int().nonnegative(),\n truncated: z.boolean(),\n counts: auditCountsSchema,\n error: z.string().optional(),\n },\n annotations: localReadOnlyAnnotations,\n },\n async ({ htmlContent }) => {\n try {\n const { issues, totalIssues, truncated, counts } = auditSeoMetadataDetailed(htmlContent);\n return result(\n { issues, totalIssues, truncated, counts },\n seoAuditContent(issues, totalIssues, truncated, counts),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { issues: [], totalIssues: 0, truncated: false, counts: { error: 0, warning: 0, info: 0 }, error },\n failureContent(\n \"SEO audit\",\n error,\n \"Confirm the supplied HTML is complete and within the size limit, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"links.broken\",\n {\n title: \"Check public links\",\n description:\n \"Resolves and checks up to 25 public HTTP(S) links in supplied HTML. Redirects are reported but not followed, and response bodies are discarded.\",\n inputSchema: {\n htmlContent: htmlContentSchema.describe(\"Raw HTML markup containing links to check.\"),\n baseUrl: publicUrlSchema\n .optional()\n .describe(\"Optional public HTTP(S) base URL used to resolve relative links.\"),\n maxLinks: z\n .number()\n .int()\n .min(1)\n .max(25)\n .default(25)\n .describe(\"Maximum number of public HTTP(S) links to check, from 1 to 25.\"),\n },\n outputSchema: {\n links: z.array(linkStatusSchema),\n error: z.string().optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ htmlContent, baseUrl, maxLinks }) => {\n try {\n const links = await checkBrokenLinks(htmlContent, baseUrl, maxLinks);\n return result({ links }, linkCheckContent(links, baseUrl));\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { links: [], error },\n failureContent(\n \"Link check\",\n error,\n \"Confirm the base URL is public and the supplied HTML is within the size limit, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"schema.markup\",\n {\n title: \"Validate JSON-LD syntax\",\n description:\n \"Parses JSON-LD blocks in supplied HTML locally and reports empty blocks or JSON syntax errors. It does not validate vocabulary semantics.\",\n inputSchema: {\n htmlContent: htmlContentSchema.describe(\"Raw HTML containing JSON-LD script blocks.\"),\n },\n outputSchema: {\n issues: z.array(seoIssueSchema),\n totalIssues: z.number().int().nonnegative(),\n truncated: z.boolean(),\n counts: auditCountsSchema,\n error: z.string().optional(),\n },\n annotations: localReadOnlyAnnotations,\n },\n async ({ htmlContent }) => {\n try {\n const { issues, totalIssues, truncated, counts } = validateSchemaMarkupDetailed(htmlContent);\n return result(\n { issues, totalIssues, truncated, counts },\n schemaValidationContent(issues, totalIssues, truncated, htmlContent),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n return result(\n { issues: [], totalIssues: 0, truncated: false, counts: { error: 0, warning: 0, info: 0 }, error },\n failureContent(\n \"JSON-LD syntax\",\n error,\n \"Confirm the supplied HTML is complete and within the size limit, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"report.validation\",\n {\n title: \"Generate a validation report\",\n description:\n \"Combines W3C HTML/CSS validation, local SEO/accessibility checks, JSON-LD syntax checks, and a bounded public-link check into a Markdown and structured report.\",\n inputSchema: {\n htmlFilePath: filePathSchema.describe(\"Absolute or workspace-relative HTML or .xhtml file path.\"),\n cssFilePath: filePathSchema\n .optional()\n .describe(\"Optional absolute or workspace-relative CSS file path.\"),\n baseUrl: publicUrlSchema\n .optional()\n .describe(\"Optional public HTTP(S) base URL used to resolve relative links.\"),\n },\n outputSchema: {\n report: z.string(),\n summary: reportSummarySchema,\n htmlMessages: z.array(w3cMessageSchema),\n htmlTotalMessages: z.number().int().nonnegative(),\n htmlTruncated: z.boolean(),\n cssMessages: z.array(cssMessageSchema),\n cssTotalMessages: z.number().int().nonnegative(),\n cssTruncated: z.boolean(),\n seoIssues: z.array(seoIssueSchema),\n seoTotalIssues: z.number().int().nonnegative(),\n seoTruncated: z.boolean(),\n schemaIssues: z.array(seoIssueSchema),\n schemaTotalIssues: z.number().int().nonnegative(),\n schemaTruncated: z.boolean(),\n links: z.array(linkStatusSchema),\n failedChecks: z.array(z.enum(validationReportChecks)),\n errors: z.array(z.string()).optional(),\n },\n annotations: externalReadOnlyAnnotations,\n },\n async ({ htmlFilePath, cssFilePath, baseUrl }) => {\n try {\n const reportData = await generateValidationReport({\n htmlFilePath,\n cssFilePath,\n baseUrl,\n });\n return result(reportData, reportContent(reportData));\n } catch (cause) {\n const error = getErrorMessage(cause);\n const reportData = failedReport(htmlFilePath, error);\n return result(\n reportData,\n failureContent(\n \"Validation report\",\n error,\n \"Confirm the input paths are readable and any base URL is public, then regenerate the report.\",\n ),\n true,\n );\n }\n },\n );\n\n server.registerTool(\n \"screenshot.capture\",\n {\n title: \"Capture responsive screenshots\",\n description:\n \"Renders a local HTML file or HTTP(S) URL in a sandboxed local Chromium browser and writes PNG screenshots to the requested directory. Downloads the pinned headless browser on first use if it is not already cached. Existing matching files may be replaced. Completed PNG paths are included if a later viewport fails.\",\n inputSchema: {\n targetPath: z\n .string()\n .trim()\n .min(1)\n .max(PATH_MAX_LENGTH)\n .describe(\"Local HTML path or HTTP(S) URL to render.\"),\n outputDir: filePathSchema\n .optional()\n .default(\".mcp-validator/screenshots\")\n .describe(\"Directory where PNG screenshots will be written.\"),\n viewports: z\n .array(\n z.object({\n name: z\n .string()\n .regex(/^[A-Za-z0-9_-]{1,50}$/)\n .describe(\"Safe filename label for this screenshot viewport.\"),\n width: z\n .number()\n .int()\n .min(200)\n .max(3_840)\n .describe(\"Viewport width in CSS pixels, from 200 to 3840.\"),\n height: z\n .number()\n .int()\n .min(200)\n .max(4_320)\n .describe(\"Viewport height in CSS pixels, from 200 to 4320.\"),\n }),\n )\n .min(1)\n .max(MAX_VIEWPORTS)\n .optional()\n .describe(\"Optional viewport definitions; defaults to desktop, tablet, and mobile sizes.\"),\n },\n outputSchema: {\n screenshots: z.array(screenshotSchema),\n outputDirectory: z.string(),\n error: z.string().optional(),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ targetPath, outputDir, viewports }) => {\n const outputDirectory = path.resolve(outputDir);\n try {\n const screenshots = await captureScreenshots(targetPath, outputDirectory, viewports);\n const affected = screenshots.filter((capture) => (capture.incompleteAssetCount ?? 0) > 0);\n if (affected.length > 0) {\n const error = `${affected.length} screenshot viewport(s) have failed or blocked visual assets; files were saved but captures may be incomplete.`;\n return result(\n { screenshots, outputDirectory, error },\n screenshotPartialCaptureContent(screenshots.length, outputDirectory, error),\n true,\n );\n }\n return result(\n { screenshots, outputDirectory },\n screenshotCaptureContent(screenshots.length, outputDirectory),\n );\n } catch (cause) {\n const error = getErrorMessage(cause);\n if (cause instanceof PartialScreenshotCaptureError) {\n return result(\n { screenshots: cause.screenshots, outputDirectory, error },\n screenshotPartialCaptureContent(cause.screenshots.length, outputDirectory, error),\n true,\n );\n }\n return result(\n { screenshots: [], outputDirectory, error },\n failureContent(\n \"Screenshot capture\",\n error,\n \"Confirm the target is reachable or readable and the output directory is writable, then retry.\",\n ),\n true,\n );\n }\n },\n );\n\n return server;\n}\n\nexport async function run(): Promise<void> {\n const server = createServer();\n await server.connect(new StdioServerTransport());\n console.error(`mcp-web-validator ${SERVER_VERSION} started on stdio`);\n}\n\nconst invokedPath = process.argv[1] ? pathToFileURL(path.resolve(process.argv[1])).href : undefined;\nif (invokedPath === import.meta.url) {\n run().catch((cause: unknown) => {\n console.error(\"Fatal error starting mcp-web-validator:\", getErrorMessage(cause));\n process.exitCode = 1;\n });\n}\n"]}
@@ -1,2 +1,4 @@
1
1
  export declare function getPrimaryLanguageSubtag(languageTag: string): string;
2
+ export declare function isWellFormedPrivateUseLanguageTag(languageTag: string): boolean;
3
+ export declare function isRegisteredGrandfatheredILanguageTag(languageTag: string): boolean;
2
4
  export declare function isKnownPrimaryLanguageSubtag(primarySubtag: string): boolean;
@@ -6,6 +6,15 @@ const PRIMARY_LANGUAGE_SUBTAG_BITS = Uint8Array.from(atob(PRIMARY_LANGUAGE_SUBTA
6
6
  export function getPrimaryLanguageSubtag(languageTag) {
7
7
  return languageTag.trim().split("-", 1)[0].toLowerCase();
8
8
  }
9
+ // RFC 5646 permits an entire tag of private-use subtags, without a registered primary.
10
+ export function isWellFormedPrivateUseLanguageTag(languageTag) {
11
+ return /^x(?:-[a-z0-9]{1,8})+$/i.test(languageTag);
12
+ }
13
+ // RFC 5646 section 2.1 registers these fixed irregular tags as whole tags.
14
+ // A bare "i" or unregistered extension of one of these tags is not valid.
15
+ export function isRegisteredGrandfatheredILanguageTag(languageTag) {
16
+ return /^i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)$/i.test(languageTag);
17
+ }
9
18
  export function isKnownPrimaryLanguageSubtag(primarySubtag) {
10
19
  if (!/^[a-z]{2,3}$/.test(primarySubtag))
11
20
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"language-subtags.js","sourceRoot":"","sources":["../src/language-subtags.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,yEAAyE;AACzE,sEAAsE;AACtE,MAAM,mCAAmC,GACvC,s+FAAs+F,CAAC;AAEz+F,MAAM,4BAA4B,GAAG,UAAU,CAAC,IAAI,CAClD,IAAI,CAAC,mCAAmC,CAAC,EACzC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CACvC,CAAC;AAEF,MAAM,UAAU,wBAAwB,CAAC,WAAmB;IAC1D,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,aAAqB;IAChE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC;QAAE,OAAO,KAAK,CAAC;IAEtD,MAAM,KAAK,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAChD,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,KAAK,CAAC;QACtC,CAAC,CAAC,KAAK,GAAG,EAAE,GAAG,MAAM;QACrB,CAAC,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,GAAG,EAAE,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAEzE,OAAO,CAAC,4BAA4B,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["// IANA Language Subtag Registry Type=language snapshot, File-Date 2026-09-17.\n// qaa..qtz is expanded before encoding. The bitset covers every two- and\n// three-letter lowercase primary language subtag without runtime I/O.\nconst PRIMARY_LANGUAGE_SUBTAG_BITS_BASE64 =\n \"MzQmR8cZEAlkUwQAiBBoHIQMCZSAAkNEkMZZZVwEBIAR9GfXUBgOwG0ObaGJRCBhQEACAwAAEADAQdHd90d0m1NABAJCBAEQAAQAIAAAAEEABAJA8N/f7//+/7u9/++vf//Bc/V2OYf///8P9zvw//9cUCiX/t//9///f/f///////8/nv7//9/Eq6Dn+///7/9///////+9Qh8P33X+SXEA8t3++ZMcgv/r/v////////f/////1////3//9/////////77//////7/////+//////9/z//v//3///v//+///9////f//////f9///v/////f//vf//7///////f//321/d+gf0zxk8xIJQEgQARQQAuPsv/0krVGS9SYN4v3d+cVXV58Bx8zf//vnfhVOGAADB+//7////d+NzfPz9HxAIAFsACAACADAABAAgGQL93/fv7e9FACBA1pgR/L0nAgAA8N3mbVKePe//3//8SRHEYAgQDQB/fPZlnel12/4+ACAAAAAAfKd9JdkW4GK9R///9wcAABDAYDUAAABLeRJloQAQAAAAEZEEAAAGAQAAAAEAQEQAAAFYgAEAUAAAiEIAAABV3QJBVkMyVV/9K948AAAIAAQAAAAAQHCRE9B9lRmCeYoAEAAkCAAAQAAAACAQAARABAAA67+aAyAAAABAAAAAAAAAAgBEAAAAIAAAAAAxiFoAAAAAQABCYIpAAIAQCAUAgBBjCAQAAAAABDBQPwCBQAAAAAC+MzsBAAgQAQAAAAAAAAAAAAAA8P///////TwoCvz/ffL+UT4AASJbbFpUsjnwnf89QI0EGeAQOD5JtY0z//fflv///0eAABAQIsHz1f9Q+EQEBEDw3/9vjb5BfzPaAAAAspcncEAIAP//5w+AQRAIAAAACEHJEQAAAAAAAAEEQIBA61/KAAQAEElCwAYABv+//2fPUfD57TYAEAEAAABUUGsriEIAQBAl/t//U5CAUAAEAAAAAAEAwAAAAAAQKsB2jkSBCAJ8BHgAAADADAVEUnhECAQCAQAiAIUYAZDN7g510xGR5pC1PoMAAFIABAEAAABFZJlk3XU6eHS5DwABgAAACABUBBAgABAABAhghIC/fp9D3GkBAMBAEAAC0i0aAAAAIEEEAEAAAd9ZOUEACBAAbQEEAAEPKcYkLRCgBGBEAIAgAAACDABoAIAAAAAAAI/9XiGAAAAQAAAAAAARAAABAADwfz3e////////9//v//////////////2///+/3f///+//////////////3////c/9/////////++//////////+//3////////////v///////////7/X3/39z4tZwPJ/AP///w+AADDc92FgLgf/z/dHJALzuefR/38l///zL+9Ref//fwQYIAAAAlT1qfid7xZxGAW9/38HNFAQjcUFAAQAQSAAAKIAuHfb7+///////////v////f//////////3/////99///9/////7f+/+///////3X/3///3////+////+///////3/f/7fv//////////7/////f/////z//f//f//+n77///d/8nIEjw////f/3+/3//L+55/n//b9Xf/P///////t//3/dwGmVAfAnd9Wr63/8/1rX1////A0IBcBUlXFbfJP7//y1UWFxAIAJAlwaBUBAEEGAAAAAAABAFVkAQAABgEAECgBEgGd9/tm5QaXDVvt/UuTdIIAYEUCEEAABANZj/DeGYbPR9PxEDAAIAAAAJAAAAAKAAARAABAD/3f/b5/v8/ytEQRgG+9+lRyAAkNRCcfLfHv/7/gMAIHAM7sG/+9+/f99////PX99+RP8HERBA/Pd/353/VWD4Xn/X2wMAADAUJwQABAAQMJRBggDw///////////////////////////////////////////////////////////////////////////////////////ee37lPtGVEAwUon8RAAgAAAAA7///CzACAAIAgAAAAFM7DgEAABBBYgEQIAAzOBoABRAwGIEEAAAA//3/L6EK8YctBQAIAgAAAABEISDQAwQhBBH2xRkDAAAQwCUAAgAQACAUAAIA8Pv9//////Pt/d77//r//7cEBBHf/95///+///3/F78X//f/9+9+//77v/3//d/v93v1/xZo98l93////7/v//919fX+BYUh5v//WfFZ8dBn3BcqWX/v9//////f3/3/32//9f8DhCnwP/4/b+///f/9B+1Tscf77/v/f///f//3/+//fX/d//4C+Fv8//////n////f//v9Z/Vx94+/3fXcZ5GrvgfqAQIAI0BAgkQAAABEbUAAAEAAQAAAk2AABYAAAABAAkAAAMGNdd30QPUUb0FWraQAJAAABIAAAADA/b/+gYUURAJKAAAjASQCAAEAAAAAABAAAAAACAHx+zYJEAAAAAAAAAAADNgCAAAAAACgAAAAAGwoLAAQABDwjyEAIAH/n/cDUAIAAKAAAAAAAAAABAAxAJACAgAQAAAwCAAAABAAAAAAAAAAAAAAAADw////7OcbAQEAIBlg1BzvBRAAAENBUAURQGD/o1dAAAALCFJVd9n3HceMVz1Uf3VGEQAAAAAAwHK//UEFNohWALGIoxsAAAADQEIEAAAxECMQAAAAX/9/fc0LZ42nVwFVQEqYHgQAALCWI0UHhA4DqSYJACDw//7/VzhF//7/L999zFQvxP///wEACGzFbPG5f9P3/t9L+hpAhBHQ5aSEAIUCAw4IAUIC8P///+YfYICoAmQREFCx4hMAAAABmVYkIBAQ/vs7AAAAwX0aTeVJ9N3/6DZbBUI9jA3TAwgAAMBEH1FM+AYFIAL197t9AAACQShbBGFABAAgIRABAP/f/1cgYJEIAACAAADBMAAAAAAwCCOAQgkwAzxCAgAAsEyuY4RMFf///2cREEAIdcD///8QAAAEgRMQwCEBFG5ngTAAAQAAEAAAAAAAIEKiAAQIAAA=\";\n\nconst PRIMARY_LANGUAGE_SUBTAG_BITS = Uint8Array.from(\n atob(PRIMARY_LANGUAGE_SUBTAG_BITS_BASE64),\n (character) => character.charCodeAt(0),\n);\n\nexport function getPrimaryLanguageSubtag(languageTag: string): string {\n return languageTag.trim().split(\"-\", 1)[0].toLowerCase();\n}\n\nexport function isKnownPrimaryLanguageSubtag(primarySubtag: string): boolean {\n if (!/^[a-z]{2,3}$/.test(primarySubtag)) return false;\n\n const first = primarySubtag.charCodeAt(0) - 97;\n const second = primarySubtag.charCodeAt(1) - 97;\n const index = primarySubtag.length === 2\n ? first * 26 + second\n : 676 + first * 676 + second * 26 + (primarySubtag.charCodeAt(2) - 97);\n\n return (PRIMARY_LANGUAGE_SUBTAG_BITS[index >> 3] & (1 << (index & 7))) !== 0;\n}\n"]}
1
+ {"version":3,"file":"language-subtags.js","sourceRoot":"","sources":["../src/language-subtags.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,yEAAyE;AACzE,sEAAsE;AACtE,MAAM,mCAAmC,GACvC,s+FAAs+F,CAAC;AAEz+F,MAAM,4BAA4B,GAAG,UAAU,CAAC,IAAI,CAClD,IAAI,CAAC,mCAAmC,CAAC,EACzC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CACvC,CAAC;AAEF,MAAM,UAAU,wBAAwB,CAAC,WAAmB;IAC1D,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC3D,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,iCAAiC,CAAC,WAAmB;IACnE,OAAO,yBAAyB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACrD,CAAC;AAED,2EAA2E;AAC3E,0EAA0E;AAC1E,MAAM,UAAU,qCAAqC,CAAC,WAAmB;IACvE,OAAO,gFAAgF,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC5G,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,aAAqB;IAChE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC;QAAE,OAAO,KAAK,CAAC;IAEtD,MAAM,KAAK,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IAChD,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,KAAK,CAAC;QACtC,CAAC,CAAC,KAAK,GAAG,EAAE,GAAG,MAAM;QACrB,CAAC,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,GAAG,EAAE,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAEzE,OAAO,CAAC,4BAA4B,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["// IANA Language Subtag Registry Type=language snapshot, File-Date 2026-09-17.\n// qaa..qtz is expanded before encoding. The bitset covers every two- and\n// three-letter lowercase primary language subtag without runtime I/O.\nconst PRIMARY_LANGUAGE_SUBTAG_BITS_BASE64 =\n \"MzQmR8cZEAlkUwQAiBBoHIQMCZSAAkNEkMZZZVwEBIAR9GfXUBgOwG0ObaGJRCBhQEACAwAAEADAQdHd90d0m1NABAJCBAEQAAQAIAAAAEEABAJA8N/f7//+/7u9/++vf//Bc/V2OYf///8P9zvw//9cUCiX/t//9///f/f///////8/nv7//9/Eq6Dn+///7/9///////+9Qh8P33X+SXEA8t3++ZMcgv/r/v////////f/////1////3//9/////////77//////7/////+//////9/z//v//3///v//+///9////f//////f9///v/////f//vf//7///////f//321/d+gf0zxk8xIJQEgQARQQAuPsv/0krVGS9SYN4v3d+cVXV58Bx8zf//vnfhVOGAADB+//7////d+NzfPz9HxAIAFsACAACADAABAAgGQL93/fv7e9FACBA1pgR/L0nAgAA8N3mbVKePe//3//8SRHEYAgQDQB/fPZlnel12/4+ACAAAAAAfKd9JdkW4GK9R///9wcAABDAYDUAAABLeRJloQAQAAAAEZEEAAAGAQAAAAEAQEQAAAFYgAEAUAAAiEIAAABV3QJBVkMyVV/9K948AAAIAAQAAAAAQHCRE9B9lRmCeYoAEAAkCAAAQAAAACAQAARABAAA67+aAyAAAABAAAAAAAAAAgBEAAAAIAAAAAAxiFoAAAAAQABCYIpAAIAQCAUAgBBjCAQAAAAABDBQPwCBQAAAAAC+MzsBAAgQAQAAAAAAAAAAAAAA8P///////TwoCvz/ffL+UT4AASJbbFpUsjnwnf89QI0EGeAQOD5JtY0z//fflv///0eAABAQIsHz1f9Q+EQEBEDw3/9vjb5BfzPaAAAAspcncEAIAP//5w+AQRAIAAAACEHJEQAAAAAAAAEEQIBA61/KAAQAEElCwAYABv+//2fPUfD57TYAEAEAAABUUGsriEIAQBAl/t//U5CAUAAEAAAAAAEAwAAAAAAQKsB2jkSBCAJ8BHgAAADADAVEUnhECAQCAQAiAIUYAZDN7g510xGR5pC1PoMAAFIABAEAAABFZJlk3XU6eHS5DwABgAAACABUBBAgABAABAhghIC/fp9D3GkBAMBAEAAC0i0aAAAAIEEEAEAAAd9ZOUEACBAAbQEEAAEPKcYkLRCgBGBEAIAgAAACDABoAIAAAAAAAI/9XiGAAAAQAAAAAAARAAABAADwfz3e////////9//v//////////////2///+/3f///+//////////////3////c/9/////////++//////////+//3////////////v///////////7/X3/39z4tZwPJ/AP///w+AADDc92FgLgf/z/dHJALzuefR/38l///zL+9Ref//fwQYIAAAAlT1qfid7xZxGAW9/38HNFAQjcUFAAQAQSAAAKIAuHfb7+///////////v////f//////////3/////99///9/////7f+/+///////3X/3///3////+////+///////3/f/7fv//////////7/////f/////z//f//f//+n77///d/8nIEjw////f/3+/3//L+55/n//b9Xf/P///////t//3/dwGmVAfAnd9Wr63/8/1rX1////A0IBcBUlXFbfJP7//y1UWFxAIAJAlwaBUBAEEGAAAAAAABAFVkAQAABgEAECgBEgGd9/tm5QaXDVvt/UuTdIIAYEUCEEAABANZj/DeGYbPR9PxEDAAIAAAAJAAAAAKAAARAABAD/3f/b5/v8/ytEQRgG+9+lRyAAkNRCcfLfHv/7/gMAIHAM7sG/+9+/f99////PX99+RP8HERBA/Pd/353/VWD4Xn/X2wMAADAUJwQABAAQMJRBggDw///////////////////////////////////////////////////////////////////////////////////////ee37lPtGVEAwUon8RAAgAAAAA7///CzACAAIAgAAAAFM7DgEAABBBYgEQIAAzOBoABRAwGIEEAAAA//3/L6EK8YctBQAIAgAAAABEISDQAwQhBBH2xRkDAAAQwCUAAgAQACAUAAIA8Pv9//////Pt/d77//r//7cEBBHf/95///+///3/F78X//f/9+9+//77v/3//d/v93v1/xZo98l93////7/v//919fX+BYUh5v//WfFZ8dBn3BcqWX/v9//////f3/3/32//9f8DhCnwP/4/b+///f/9B+1Tscf77/v/f///f//3/+//fX/d//4C+Fv8//////n////f//v9Z/Vx94+/3fXcZ5GrvgfqAQIAI0BAgkQAAABEbUAAAEAAQAAAk2AABYAAAABAAkAAAMGNdd30QPUUb0FWraQAJAAABIAAAADA/b/+gYUURAJKAAAjASQCAAEAAAAAABAAAAAACAHx+zYJEAAAAAAAAAAADNgCAAAAAACgAAAAAGwoLAAQABDwjyEAIAH/n/cDUAIAAKAAAAAAAAAABAAxAJACAgAQAAAwCAAAABAAAAAAAAAAAAAAAADw////7OcbAQEAIBlg1BzvBRAAAENBUAURQGD/o1dAAAALCFJVd9n3HceMVz1Uf3VGEQAAAAAAwHK//UEFNohWALGIoxsAAAADQEIEAAAxECMQAAAAX/9/fc0LZ42nVwFVQEqYHgQAALCWI0UHhA4DqSYJACDw//7/VzhF//7/L999zFQvxP///wEACGzFbPG5f9P3/t9L+hpAhBHQ5aSEAIUCAw4IAUIC8P///+YfYICoAmQREFCx4hMAAAABmVYkIBAQ/vs7AAAAwX0aTeVJ9N3/6DZbBUI9jA3TAwgAAMBEH1FM+AYFIAL197t9AAACQShbBGFABAAgIRABAP/f/1cgYJEIAACAAADBMAAAAAAwCCOAQgkwAzxCAgAAsEyuY4RMFf///2cREEAIdcD///8QAAAEgRMQwCEBFG5ngTAAAQAAEAAAAAAAIEKiAAQIAAA=\";\n\nconst PRIMARY_LANGUAGE_SUBTAG_BITS = Uint8Array.from(\n atob(PRIMARY_LANGUAGE_SUBTAG_BITS_BASE64),\n (character) => character.charCodeAt(0),\n);\n\nexport function getPrimaryLanguageSubtag(languageTag: string): string {\n return languageTag.trim().split(\"-\", 1)[0].toLowerCase();\n}\n\n// RFC 5646 permits an entire tag of private-use subtags, without a registered primary.\nexport function isWellFormedPrivateUseLanguageTag(languageTag: string): boolean {\n return /^x(?:-[a-z0-9]{1,8})+$/i.test(languageTag);\n}\n\n// RFC 5646 section 2.1 registers these fixed irregular tags as whole tags.\n// A bare \"i\" or unregistered extension of one of these tags is not valid.\nexport function isRegisteredGrandfatheredILanguageTag(languageTag: string): boolean {\n return /^i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)$/i.test(languageTag);\n}\n\nexport function isKnownPrimaryLanguageSubtag(primarySubtag: string): boolean {\n if (!/^[a-z]{2,3}$/.test(primarySubtag)) return false;\n\n const first = primarySubtag.charCodeAt(0) - 97;\n const second = primarySubtag.charCodeAt(1) - 97;\n const index = primarySubtag.length === 2\n ? first * 26 + second\n : 676 + first * 676 + second * 26 + (primarySubtag.charCodeAt(2) - 97);\n\n return (PRIMARY_LANGUAGE_SUBTAG_BITS[index >> 3] & (1 << (index & 7))) !== 0;\n}\n"]}
package/dist/network.d.ts CHANGED
@@ -36,10 +36,12 @@ export declare function getErrorMessage(error: unknown): string;
36
36
  export declare function resolvePublicHttpUrl(input: string | URL): Promise<ResolvedPublicHttpUrl>;
37
37
  export declare function assertPublicHttpUrl(input: string | URL): Promise<URL>;
38
38
  export declare function cancelResponseBody(response: Response): Promise<void>;
39
- export declare function readResponseText(response: Response, maxBytes: number, encoding?: string, sniffHtmlEncoding?: boolean, sniffXmlEncoding?: boolean, preferXmlBom?: boolean, preferHtmlBom?: boolean): Promise<string>;
39
+ export declare function readResponseText(response: Response, maxBytes: number, encoding?: string, sniffHtmlEncoding?: boolean, sniffXmlEncoding?: boolean, preferXmlBom?: boolean, preferHtmlBom?: boolean, sniffCssEncoding?: boolean, preferCssBom?: boolean): Promise<string>;
40
40
  /** Fetches a public HTTP(S) URL while validating every redirect target. */
41
41
  export declare function fetchPublicHttp(input: string | URL, options?: PublicFetchOptions): Promise<PublicHttpResult>;
42
42
  /** Fetches bounded text from a public URL and rejects non-success responses. */
43
43
  export declare function fetchPublicText(input: string | URL, options?: PublicTextOptions): Promise<PublicTextResult>;
44
+ /** Resolve an opt-in trusted local file scope for all stdio file consumers. */
45
+ export declare function resolveLocalFileWithinWorkspaceRoot(filePath: string): Promise<string>;
44
46
  /** Reads a bounded regular text file, optionally applying HTML/XHTML/CSS byte-decoding rules. */
45
47
  export declare function readTextFile(filePath: string, maxBytes: number, markupMediaType?: "text/html" | "application/xhtml+xml" | "text/css"): Promise<string>;