mcp-web-validator 1.3.50 → 1.3.53
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 +53 -0
- package/README.md +66 -4
- package/dist/audit-history.d.ts +9 -0
- package/dist/audit-history.js +27 -0
- package/dist/audit-history.js.map +1 -1
- package/dist/index.js +2535 -30
- package/dist/index.js.map +1 -1
- package/dist/mcp-bounds.d.ts +11 -0
- package/dist/mcp-bounds.js +68 -0
- package/dist/mcp-bounds.js.map +1 -0
- package/dist/modules/browser-ux/lighthouse-lab-probe.d.ts +21 -0
- package/dist/modules/browser-ux/lighthouse-lab-probe.js +190 -0
- package/dist/modules/browser-ux/lighthouse-lab-probe.js.map +1 -0
- package/dist/modules/browser-ux/lighthouse-lab.d.ts +61 -0
- package/dist/modules/browser-ux/lighthouse-lab.js +98 -0
- package/dist/modules/browser-ux/lighthouse-lab.js.map +1 -0
- package/dist/modules/browser-ux/media-diagnostics.d.ts +41 -0
- package/dist/modules/browser-ux/media-diagnostics.js +183 -0
- package/dist/modules/browser-ux/media-diagnostics.js.map +1 -0
- package/dist/modules/browser-ux/raw-rendered-diff.d.ts +70 -0
- package/dist/modules/browser-ux/raw-rendered-diff.js +262 -0
- package/dist/modules/browser-ux/raw-rendered-diff.js.map +1 -0
- package/dist/modules/browser-ux/raw-rendered-probe.d.ts +17 -0
- package/dist/modules/browser-ux/raw-rendered-probe.js +163 -0
- package/dist/modules/browser-ux/raw-rendered-probe.js.map +1 -0
- package/dist/modules/browser-ux/resource-failures-probe.d.ts +11 -0
- package/dist/modules/browser-ux/resource-failures-probe.js +231 -0
- package/dist/modules/browser-ux/resource-failures-probe.js.map +1 -0
- package/dist/modules/browser-ux/resource-failures.d.ts +79 -0
- package/dist/modules/browser-ux/resource-failures.js +178 -0
- package/dist/modules/browser-ux/resource-failures.js.map +1 -0
- package/dist/modules/browser-ux/viewport-parity-probe.d.ts +5 -0
- package/dist/modules/browser-ux/viewport-parity-probe.js +307 -0
- package/dist/modules/browser-ux/viewport-parity-probe.js.map +1 -0
- package/dist/modules/browser-ux/viewport-parity.d.ts +112 -0
- package/dist/modules/browser-ux/viewport-parity.js +224 -0
- package/dist/modules/browser-ux/viewport-parity.js.map +1 -0
- package/dist/modules/browser-ux/wcag-interactions.d.ts +95 -0
- package/dist/modules/browser-ux/wcag-interactions.js +360 -0
- package/dist/modules/browser-ux/wcag-interactions.js.map +1 -0
- package/dist/modules/change-regression/availability-history-store.d.ts +18 -0
- package/dist/modules/change-regression/availability-history-store.js +168 -0
- package/dist/modules/change-regression/availability-history-store.js.map +1 -0
- package/dist/modules/change-regression/crawler-log-correlation.d.ts +111 -0
- package/dist/modules/change-regression/crawler-log-correlation.js +374 -0
- package/dist/modules/change-regression/crawler-log-correlation.js.map +1 -0
- package/dist/modules/change-regression/google-common-crawler-ip.d.ts +15 -0
- package/dist/modules/change-regression/google-common-crawler-ip.js +129 -0
- package/dist/modules/change-regression/google-common-crawler-ip.js.map +1 -0
- package/dist/modules/change-regression/historical-comparisons.d.ts +120 -0
- package/dist/modules/change-regression/historical-comparisons.js +330 -0
- package/dist/modules/change-regression/historical-comparisons.js.map +1 -0
- package/dist/modules/change-regression/production-change-comparison.d.ts +68 -0
- package/dist/modules/change-regression/production-change-comparison.js +214 -0
- package/dist/modules/change-regression/production-change-comparison.js.map +1 -0
- package/dist/modules/change-regression/regression-alerts.d.ts +73 -0
- package/dist/modules/change-regression/regression-alerts.js +183 -0
- package/dist/modules/change-regression/regression-alerts.js.map +1 -0
- package/dist/modules/change-regression/strict-observation-time.d.ts +7 -0
- package/dist/modules/change-regression/strict-observation-time.js +31 -0
- package/dist/modules/change-regression/strict-observation-time.js.map +1 -0
- package/dist/modules/content-schema/citation-methodology-consistency.d.ts +108 -0
- package/dist/modules/content-schema/citation-methodology-consistency.js +360 -0
- package/dist/modules/content-schema/citation-methodology-consistency.js.map +1 -0
- package/dist/modules/content-schema/competitor-intent-comparison.d.ts +74 -0
- package/dist/modules/content-schema/competitor-intent-comparison.js +185 -0
- package/dist/modules/content-schema/competitor-intent-comparison.js.map +1 -0
- package/dist/modules/content-schema/empty-boilerplate-content.d.ts +36 -0
- package/dist/modules/content-schema/empty-boilerplate-content.js +225 -0
- package/dist/modules/content-schema/empty-boilerplate-content.js.map +1 -0
- package/dist/modules/content-schema/extract-citation-methodology.d.ts +6 -0
- package/dist/modules/content-schema/extract-citation-methodology.js +201 -0
- package/dist/modules/content-schema/extract-citation-methodology.js.map +1 -0
- package/dist/modules/content-schema/extract-competitor-intent.d.ts +2 -0
- package/dist/modules/content-schema/extract-competitor-intent.js +140 -0
- package/dist/modules/content-schema/extract-competitor-intent.js.map +1 -0
- package/dist/modules/content-schema/extract-main-content.d.ts +6 -0
- package/dist/modules/content-schema/extract-main-content.js +33 -0
- package/dist/modules/content-schema/extract-main-content.js.map +1 -0
- package/dist/modules/content-schema/extract-metadata-consistency.d.ts +3 -0
- package/dist/modules/content-schema/extract-metadata-consistency.js +62 -0
- package/dist/modules/content-schema/extract-metadata-consistency.js.map +1 -0
- package/dist/modules/content-schema/extract-product-claims.d.ts +3 -0
- package/dist/modules/content-schema/extract-product-claims.js +58 -0
- package/dist/modules/content-schema/extract-product-claims.js.map +1 -0
- package/dist/modules/content-schema/extract-structured-data.d.ts +3 -0
- package/dist/modules/content-schema/extract-structured-data.js +25 -0
- package/dist/modules/content-schema/extract-structured-data.js.map +1 -0
- package/dist/modules/content-schema/metadata-consistency.d.ts +66 -0
- package/dist/modules/content-schema/metadata-consistency.js +282 -0
- package/dist/modules/content-schema/metadata-consistency.js.map +1 -0
- package/dist/modules/content-schema/product-claims.d.ts +73 -0
- package/dist/modules/content-schema/product-claims.js +195 -0
- package/dist/modules/content-schema/product-claims.js.map +1 -0
- package/dist/modules/content-schema/same-language-duplicates.d.ts +52 -0
- package/dist/modules/content-schema/same-language-duplicates.js +158 -0
- package/dist/modules/content-schema/same-language-duplicates.js.map +1 -0
- package/dist/modules/content-schema/structured-data-validation.d.ts +37 -0
- package/dist/modules/content-schema/structured-data-validation.js +385 -0
- package/dist/modules/content-schema/structured-data-validation.js.map +1 -0
- package/dist/modules/external-metrics/crux-field-probe.d.ts +10 -0
- package/dist/modules/external-metrics/crux-field-probe.js +113 -0
- package/dist/modules/external-metrics/crux-field-probe.js.map +1 -0
- package/dist/modules/external-metrics/crux-field.d.ts +61 -0
- package/dist/modules/external-metrics/crux-field.js +231 -0
- package/dist/modules/external-metrics/crux-field.js.map +1 -0
- package/dist/modules/http-crawl/availability-observations.d.ts +68 -0
- package/dist/modules/http-crawl/availability-observations.js +206 -0
- package/dist/modules/http-crawl/availability-observations.js.map +1 -0
- package/dist/modules/http-crawl/availability-probe.d.ts +8 -0
- package/dist/modules/http-crawl/availability-probe.js +46 -0
- package/dist/modules/http-crawl/availability-probe.js.map +1 -0
- package/dist/modules/http-crawl/crawler-access-probe.d.ts +6 -0
- package/dist/modules/http-crawl/crawler-access-probe.js +79 -0
- package/dist/modules/http-crawl/crawler-access-probe.js.map +1 -0
- package/dist/modules/http-crawl/crawler-access.d.ts +75 -0
- package/dist/modules/http-crawl/crawler-access.js +404 -0
- package/dist/modules/http-crawl/crawler-access.js.map +1 -0
- package/dist/modules/http-crawl/http-delivery-probe.d.ts +3 -0
- package/dist/modules/http-crawl/http-delivery-probe.js +44 -0
- package/dist/modules/http-crawl/http-delivery-probe.js.map +1 -0
- package/dist/modules/http-crawl/http-delivery.d.ts +64 -0
- package/dist/modules/http-crawl/http-delivery.js +269 -0
- package/dist/modules/http-crawl/http-delivery.js.map +1 -0
- package/dist/modules/http-crawl/https-security.d.ts +84 -0
- package/dist/modules/http-crawl/https-security.js +441 -0
- package/dist/modules/http-crawl/https-security.js.map +1 -0
- package/dist/modules/http-crawl/non-html-directives.d.ts +74 -0
- package/dist/modules/http-crawl/non-html-directives.js +353 -0
- package/dist/modules/http-crawl/non-html-directives.js.map +1 -0
- package/dist/modules/http-crawl/redirect-canonical-chains.d.ts +80 -0
- package/dist/modules/http-crawl/redirect-canonical-chains.js +459 -0
- package/dist/modules/http-crawl/redirect-canonical-chains.js.map +1 -0
- package/dist/modules/http-crawl/redirect-canonical-probe.d.ts +6 -0
- package/dist/modules/http-crawl/redirect-canonical-probe.js +83 -0
- package/dist/modules/http-crawl/redirect-canonical-probe.js.map +1 -0
- package/dist/modules/http-crawl/sitemap-inventory-probe.d.ts +8 -0
- package/dist/modules/http-crawl/sitemap-inventory-probe.js +155 -0
- package/dist/modules/http-crawl/sitemap-inventory-probe.js.map +1 -0
- package/dist/modules/http-crawl/sitemap-inventory.d.ts +107 -0
- package/dist/modules/http-crawl/sitemap-inventory.js +557 -0
- package/dist/modules/http-crawl/sitemap-inventory.js.map +1 -0
- package/dist/modules/http-crawl/url-variants.d.ts +86 -0
- package/dist/modules/http-crawl/url-variants.js +379 -0
- package/dist/modules/http-crawl/url-variants.js.map +1 -0
- package/dist/modules/site-architecture/extract-internal-links.d.ts +3 -0
- package/dist/modules/site-architecture/extract-internal-links.js +88 -0
- package/dist/modules/site-architecture/extract-internal-links.js.map +1 -0
- package/dist/modules/site-architecture/extract-multilingual-page.d.ts +2 -0
- package/dist/modules/site-architecture/extract-multilingual-page.js +29 -0
- package/dist/modules/site-architecture/extract-multilingual-page.js.map +1 -0
- package/dist/modules/site-architecture/internal-link-graph-probe.d.ts +7 -0
- package/dist/modules/site-architecture/internal-link-graph-probe.js +116 -0
- package/dist/modules/site-architecture/internal-link-graph-probe.js.map +1 -0
- package/dist/modules/site-architecture/internal-link-graph.d.ts +113 -0
- package/dist/modules/site-architecture/internal-link-graph.js +414 -0
- package/dist/modules/site-architecture/internal-link-graph.js.map +1 -0
- package/dist/modules/site-architecture/internal-link-quality.d.ts +77 -0
- package/dist/modules/site-architecture/internal-link-quality.js +260 -0
- package/dist/modules/site-architecture/internal-link-quality.js.map +1 -0
- package/dist/modules/site-architecture/multilingual-clusters.d.ts +82 -0
- package/dist/modules/site-architecture/multilingual-clusters.js +363 -0
- package/dist/modules/site-architecture/multilingual-clusters.js.map +1 -0
- package/dist/network.d.ts +4 -0
- package/dist/network.js +18 -2
- package/dist/network.js.map +1 -1
- package/dist/presentation.d.ts +53 -0
- package/dist/presentation.js +526 -0
- package/dist/presentation.js.map +1 -1
- package/dist/screenshot.d.ts +2 -1
- package/dist/screenshot.js +4 -2
- package/dist/screenshot.js.map +1 -1
- package/dist/seo-auditor.js +16 -6
- package/dist/seo-auditor.js.map +1 -1
- package/package.json +7 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-variants.js","sourceRoot":"","sources":["../../../src/modules/http-crawl/url-variants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAC3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACxC,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO;CACjC,CAAC;AAGX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO;CAClD,CAAC;AAEX,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,QAAQ,EAAE,cAAc,EAAE,oBAAoB;IAC9C,sBAAsB,EAAE,UAAU,EAAE,YAAY;CACxC,CAAC;AAEX,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,oBAAoB;IACtD,sBAAsB,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa;CACvD,CAAC;AAEX,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,kBAAkB,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,MAAM,CAAC;IACxC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAC1D,MAAM,CAAC,kBAAkB,GAAG,QAAQ,CAAC,MAAM,GAAG,oBAAoB,CAAC;IACnE,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * P1-14: bounded offline URL-variant comparison from caller-observed HTTP\n * responses. Intentionally no network, HTML parsing, DNS, Google or Node APIs.\n *\n * Scheme, apex/www, one trailing slash, ASCII path case, and query differences\n * are candidate review dimensions—not assertions of content equivalence.\n */\nexport const MAX_VARIANT_OBSERVATIONS = 12;\nexport const MAX_VARIANT_FINDINGS = 12;\nexport const MAX_VARIANT_URL_BYTES = 1_024;\nexport const MAX_VARIANT_CANONICALS = 3;\nexport const MAX_VARIANT_TOTAL_BYTES = 28_000;\n\nexport const VARIANT_DIMENSIONS = [\n \"scheme\", \"www\", \"slash\", \"case\", \"query\",\n] as const;\nexport type VariantDimension = typeof VARIANT_DIMENSIONS[number];\n\nexport const VARIANT_RESPONSE_STATES = [\n \"ok\", \"other_success\", \"redirect\", \"not_modified\", \"other\",\n] as const;\nexport type VariantResponseState = typeof VARIANT_RESPONSE_STATES[number];\nexport const VARIANT_TARGET_STATES = [\n \"absent\", \"to_reference\", \"to_sampled_variant\",\n \"to_unobserved_family\", \"external\", \"unresolved\",\n] as const;\nexport type VariantTargetState = typeof VARIANT_TARGET_STATES[number];\nexport const VARIANT_CANONICAL_STATES = [\n \"absent\", \"self\", \"to_reference\", \"to_sampled_variant\",\n \"to_unobserved_family\", \"external\", \"unresolved\", \"conflicting\",\n] as const;\nexport type VariantCanonicalState = typeof VARIANT_CANONICAL_STATES[number];\nexport const VARIANT_FINDING_CODES = [\n \"reference_not_ok\", \"variant_ok_without_redirect\",\n \"matching_content_at_variant\", \"different_content_at_variant\",\n \"content_unverified\", \"query_semantics_unverified\",\n \"redirect_to_other_variant\", \"redirect_outside_family\",\n \"redirect_unresolved\", \"canonical_conflicting_on_page\",\n \"canonical_outside_family\", \"canonical_unresolved\",\n \"self_canonical_on_matching_variant\", \"canonical_disagrees_with_reference\",\n \"reference_observation_only\", \"partial_or_other_success\",\n \"non_success_variant\",\n] as const;\nexport type VariantFindingCode = typeof VARIANT_FINDING_CODES[number];\n\nexport interface UrlVariantObservation {\n url: string;\n status_code: number;\n method?: \"GET\" | \"HEAD\";\n location?: string;\n canonicals?: string[];\n content_sha256?: string;\n}\nexport interface UrlVariantPageEvidence {\n page: number;\n is_reference: boolean;\n dimensions: VariantDimension[];\n status_code: number;\n method: \"GET\" | \"HEAD\" | \"unspecified\";\n response_state: VariantResponseState;\n redirect_state: VariantTargetState;\n redirect_to_https: boolean;\n canonical_state: VariantCanonicalState;\n canonical_declarations: number;\n fingerprint_supplied: boolean;\n content_matches_reference: boolean | null;\n has_query: boolean;\n}\nexport interface UrlVariantFinding {\n page: number;\n severity: \"warning\" | \"info\";\n code: VariantFindingCode;\n message: string;\n}\nexport interface UrlVariantReview {\n scope: \"caller_supplied_url_variant_evidence_only\";\n pages_sampled: number;\n reference_observed: boolean;\n reference_http_200: boolean;\n scheme_variants: number;\n www_variants: number;\n slash_variants: number;\n case_variants: number;\n query_variants: number;\n http_200_variants: number;\n redirects_to_reference: number;\n redirects_outside_family: number;\n unresolved_redirects: number;\n canonical_to_reference: number;\n conflicting_canonical_pages: number;\n matching_content_variants: number;\n different_content_variants: number;\n content_not_comparable_variants: number;\n coverage_limited: true;\n limitations: string[];\n pages: UrlVariantPageEvidence[];\n total_findings: number;\n findings: UrlVariantFinding[];\n findings_truncated: boolean;\n error?: string;\n}\n\nexport function emptyUrlVariantReview(): UrlVariantReview {\n return {\n scope: \"caller_supplied_url_variant_evidence_only\",\n pages_sampled: 0, reference_observed: false, reference_http_200: false,\n scheme_variants: 0, www_variants: 0, slash_variants: 0,\n case_variants: 0, query_variants: 0, http_200_variants: 0,\n redirects_to_reference: 0, redirects_outside_family: 0,\n unresolved_redirects: 0, canonical_to_reference: 0,\n conflicting_canonical_pages: 0, matching_content_variants: 0,\n different_content_variants: 0, content_not_comparable_variants: 0,\n coverage_limited: true,\n limitations: [\"The supplied URL variant response observations could not be compared within declared limits.\"],\n pages: [], total_findings: 0, findings: [], findings_truncated: false,\n };\n}\n\nconst encoder = new TextEncoder();\nfunction bytes(value: string): number {\n if (typeof value !== \"string\") throw new Error(\"Unsupported string input\");\n return encoder.encode(value).byteLength;\n}\nfunction safeField(value: string): number {\n if (typeof value !== \"string\" || !value || bytes(value) > MAX_VARIANT_URL_BYTES ||\n /[\\u0000-\\u001f\\u007f-\\u009f\\u202a-\\u202e\\u2066-\\u2069]/u.test(value)) {\n throw new Error(\"Invalid or oversized URL variant evidence\");\n }\n return bytes(value);\n}\n\nfunction suspiciousPath(value: string, allowRelativeSegments = false): boolean {\n const beforeQuery = value.split(\"?\")[0];\n const path = beforeQuery.replace(/^https?:\\/\\/[^/]+/iu, \"\");\n return /\\\\/u.test(value) ||\n /%(?:2f|5c|2e)/iu.test(path) ||\n (!allowRelativeSegments && /(?:^|\\/)\\.{1,2}(?=\\/|$)/u.test(path));\n}\n\n/**\n * Safe *label*: never permission to fetch. Optional query is allowed here\n * solely to distinguish query-bearing URLs; original values are never echoed.\n */\nexport function safeVariantLabel(value: string): string | null {\n try {\n if (!/^https?:\\/\\//iu.test(value) || safeField(value) < 1 || value.includes(\"#\") ||\n suspiciousPath(value)) return null;\n const url = new URL(value);\n if (![\"http:\", \"https:\"].includes(url.protocol) || !url.hostname ||\n url.username || url.password || url.port || url.hash) return null;\n return url.href;\n } catch {\n return null;\n }\n}\n\nfunction parseTarget(raw: string, base: string): URL | null {\n try {\n safeField(raw);\n // A *response* Location or canonical may be legitimately relative (../x).\n // Resolve it against that response URL; never apply this flexibility to\n // the sample's own absolute URL labels.\n if (raw.includes(\"#\") || /\\\\/u.test(raw) || suspiciousPath(raw, true)) return null;\n const target = new URL(raw, base);\n if (![\"http:\", \"https:\"].includes(target.protocol) || !target.hostname ||\n target.username || target.password || target.port || target.hash) return null;\n return target;\n } catch {\n return null;\n }\n}\n\nfunction slashless(pathname: string): string {\n return pathname !== \"/\" && pathname.endsWith(\"/\") ? pathname.slice(0, -1) : pathname;\n}\nfunction asciiLower(pathname: string): string {\n return pathname.replace(/[A-Z]/gu, (letter) => letter.toLowerCase());\n}\nfunction pathCandidate(a: URL, b: URL): boolean {\n // Not equality: server paths (including case and slash) may behave differently.\n return asciiLower(slashless(a.pathname)) === asciiLower(slashless(b.pathname));\n}\nfunction equivalentHostFamily(hostA: string, hostB: string): boolean {\n if (hostA === hostB) return true;\n const bareA = hostA.startsWith(\"www.\") ? hostA.slice(4) : hostA;\n const bareB = hostB.startsWith(\"www.\") ? hostB.slice(4) : hostB;\n return bareA === bareB && !bareA.startsWith(\"www.\");\n}\nfunction facets(candidate: URL, reference: URL, hasQuery: boolean): VariantDimension[] {\n const out: VariantDimension[] = [];\n if (candidate.protocol !== reference.protocol) out.push(\"scheme\");\n if (candidate.hostname !== reference.hostname) out.push(\"www\");\n if (candidate.pathname !== reference.pathname &&\n candidate.pathname.endsWith(\"/\") !== reference.pathname.endsWith(\"/\")) out.push(\"slash\");\n if (slashless(candidate.pathname) !== slashless(reference.pathname)) out.push(\"case\");\n if (hasQuery) out.push(\"query\");\n return out;\n}\n\nfunction responseState(status: number): VariantResponseState {\n if (status === 200) return \"ok\";\n if ([301, 302, 303, 307, 308].includes(status)) return \"redirect\";\n if (status === 304) return \"not_modified\";\n if (status >= 200 && status <= 299) return \"other_success\";\n return \"other\";\n}\n\nfunction targetState(\n target: URL | null, reference: URL, sampled: Set<string>, family: (url: URL) => boolean,\n): VariantTargetState {\n if (!target) return \"unresolved\";\n if (target.href === reference.href) return \"to_reference\";\n if (sampled.has(target.href)) return \"to_sampled_variant\";\n if (family(target)) return \"to_unobserved_family\";\n return \"external\";\n}\n\nfunction canonicalState(\n declared: string[] | undefined, current: URL, reference: URL,\n sampled: Set<string>, family: (url: URL) => boolean,\n): { state: VariantCanonicalState; count: number; targetKey?: string } {\n if (!declared?.length) return { state: \"absent\", count: 0 };\n const parsed = declared.map((raw) => parseTarget(raw, current.href));\n if (parsed.some((url) => url === null)) {\n return { state: \"unresolved\", count: declared.length };\n }\n const urls = parsed as URL[];\n const unique = new Set(urls.map((url) => url.href));\n if (unique.size !== 1) return { state: \"conflicting\", count: declared.length };\n const target = urls[0];\n if (target.href === current.href) return { state: \"self\", count: declared.length, targetKey: target.href };\n return {\n state: targetState(target, reference, sampled, family),\n count: declared.length,\n targetKey: target.href,\n };\n}\n\n/** Pure analysis of explicitly supplied observations; does not fetch URLs. */\nexport function analyzeUrlVariants(\n referenceUrl: string, observations: UrlVariantObservation[],\n): UrlVariantReview {\n const referenceLabel = safeVariantLabel(referenceUrl);\n if (!referenceLabel || referenceUrl.includes(\"?\")) {\n throw new Error(\"Reference must be a safe query-free absolute HTTP(S) URL label\");\n }\n if (!Array.isArray(observations) || observations.length < 1 ||\n observations.length > MAX_VARIANT_OBSERVATIONS) {\n throw new Error(\"One to twelve observed URL variants are required\");\n }\n const reference = new URL(referenceLabel);\n const family = (url: URL) => equivalentHostFamily(url.hostname, reference.hostname) &&\n pathCandidate(url, reference);\n let totalBytes = bytes(referenceUrl);\n const seen = new Set<string>();\n const validated: Array<{ observation: UrlVariantObservation; url: URL; hasQuery: boolean }> = [];\n for (const item of observations) {\n if (!item || typeof item !== \"object\") throw new Error(\"Invalid observed variant record\");\n const label = safeVariantLabel(item.url);\n if (!label) throw new Error(\"URL variant label is unsafe\");\n const url = new URL(label);\n if (!family(url) || seen.has(label)) {\n throw new Error(\"Observations must be distinct same-family URL variants of one reference path\");\n }\n if (!Number.isSafeInteger(item.status_code) || item.status_code < 100 || item.status_code > 599 ||\n (item.method !== undefined && ![\"GET\", \"HEAD\"].includes(item.method))) {\n throw new Error(\"Invalid observed HTTP status/method\");\n }\n totalBytes += bytes(item.url);\n if (item.location !== undefined) totalBytes += safeField(item.location);\n if (item.canonicals !== undefined) {\n if (!Array.isArray(item.canonicals) || item.canonicals.length > MAX_VARIANT_CANONICALS) {\n throw new Error(\"Too many canonical declarations\");\n }\n for (const canonical of item.canonicals) totalBytes += safeField(canonical);\n }\n if (item.content_sha256 !== undefined) {\n if (typeof item.content_sha256 !== \"string\" ||\n !/^[0-9a-f]{64}$/iu.test(item.content_sha256) ||\n item.status_code !== 200 || item.method === \"HEAD\") {\n throw new Error(\"A SHA-256 body fingerprint requires an observed 200 response with a body\");\n }\n totalBytes += bytes(item.content_sha256);\n }\n if (totalBytes > MAX_VARIANT_TOTAL_BYTES) {\n throw new Error(\"Supplied URL variant observations exceed the aggregate size cap\");\n }\n seen.add(label);\n validated.push({ observation: item, url, hasQuery: item.url.includes(\"?\") });\n }\n const ref = validated.find((record) => record.url.href === reference.href);\n if (!ref) throw new Error(\"The exact reference URL must be included among observations\");\n const referenceDigest = ref.observation.status_code === 200\n ? ref.observation.content_sha256?.toLowerCase() : undefined;\n\n const result = emptyUrlVariantReview();\n result.pages_sampled = validated.length;\n result.reference_observed = true;\n result.reference_http_200 = ref.observation.status_code === 200;\n result.limitations = [\n \"Only caller-supplied response status, Location and canonical declarations were compared; no HTTP request, redirect chain, rendered HTML, robots/sitemap, server configuration or Google-selected canonical was checked.\",\n \"The reference URL and same-path scheme/www/slash/ASCII-case/query changes are only candidate variants; path case and query parameters can legitimately identify distinct content. Hostnames prefixed with www are not assumed to share a server.\",\n \"Optional SHA-256 fingerprints are unverified caller-provided exact-body digests (HTTP 200 only); a hash match indicates byte identity only, not indexing, canonicalization, SEO duplication or page equivalence beyond the observed sample.\",\n \"At most twelve unique observations and twelve fixed findings are returned. Unobserved variants, cross-origin redirects, actual response bodies and URL query contents are not inferred, fetched or echoed.\",\n ];\n const findings: UrlVariantFinding[] = [];\n const canonicalKeys: Array<{ page: number; target: string; matching: boolean }> = [];\n const add = (page: number, code: VariantFindingCode,\n severity: \"warning\" | \"info\", message: string) => {\n findings.push({ page, code, severity, message });\n };\n\n validated.forEach((record, index) => {\n const page = index + 1;\n const observed = record.observation;\n const isReference = record.url.href === reference.href;\n const dimensions = isReference ? [] : facets(record.url, reference, record.hasQuery);\n const state = responseState(observed.status_code);\n const redirectTarget = state === \"redirect\" && observed.location !== undefined\n ? parseTarget(observed.location, record.url.href) : null;\n const redirectState: VariantTargetState = state !== \"redirect\" ? \"absent\" :\n targetState(redirectTarget, reference, seen, family);\n const canonical = canonicalState(observed.canonicals, record.url, reference, seen, family);\n const fingerprintSupplied = observed.content_sha256 !== undefined;\n const comparable = !isReference && observed.status_code === 200 &&\n referenceDigest !== undefined && fingerprintSupplied;\n const match: boolean | null = comparable\n ? referenceDigest === observed.content_sha256?.toLowerCase() : null;\n const evidence: UrlVariantPageEvidence = {\n page, is_reference: isReference, dimensions, status_code: observed.status_code,\n method: observed.method ?? \"unspecified\", response_state: state,\n redirect_state: redirectState,\n redirect_to_https: Boolean(redirectTarget && redirectTarget.protocol === \"https:\" &&\n record.url.protocol === \"http:\"),\n canonical_state: canonical.state, canonical_declarations: canonical.count,\n fingerprint_supplied: fingerprintSupplied,\n content_matches_reference: match,\n has_query: record.hasQuery,\n };\n result.pages.push(evidence);\n for (const dimension of dimensions) {\n if (dimension === \"scheme\") result.scheme_variants++;\n if (dimension === \"www\") result.www_variants++;\n if (dimension === \"slash\") result.slash_variants++;\n if (dimension === \"case\") result.case_variants++;\n if (dimension === \"query\") result.query_variants++;\n }\n if (isReference && state !== \"ok\") {\n add(page, \"reference_not_ok\", \"warning\",\n \"The supplied reference URL did not return a complete HTTP 200; variant body comparison may be unavailable.\");\n }\n if (dimensions.includes(\"query\")) {\n add(page, \"query_semantics_unverified\", \"info\",\n \"Query parameters may change page content; the sample does not establish that query and query-free URLs are equivalent.\");\n }\n if (!isReference && state === \"ok\") {\n result.http_200_variants++;\n add(page, \"variant_ok_without_redirect\", \"info\",\n \"This candidate URL variant returned a supplied HTTP 200 rather than a redirect; that alone is not an SEO defect.\");\n if (match === true) {\n result.matching_content_variants++;\n add(page, \"matching_content_at_variant\", \"warning\",\n \"The variant and supplied reference have identical caller-reported SHA-256 bodies and both returned HTTP 200; review duplicate URL consolidation.\");\n } else if (match === false) {\n result.different_content_variants++;\n add(page, \"different_content_at_variant\", \"info\",\n \"The variant and reference body digests differ; case-sensitive paths or query variants may intentionally serve different content.\");\n } else {\n result.content_not_comparable_variants++;\n add(page, \"content_unverified\", \"info\",\n \"No comparable pair of HTTP 200 body fingerprints was supplied; duplicate content cannot be inferred.\");\n }\n } else if (!isReference && state === \"other_success\") {\n add(page, \"partial_or_other_success\", \"info\",\n \"The candidate variant returned a non-200 success response; full body equivalence was not established.\");\n } else if (!isReference && state === \"other\") {\n add(page, \"non_success_variant\", \"info\",\n \"The supplied variant response was not a full 200 or recognized redirect; check its status semantics.\");\n }\n if (redirectState === \"to_reference\") result.redirects_to_reference++;\n if (redirectState === \"external\") {\n result.redirects_outside_family++;\n add(page, \"redirect_outside_family\", \"warning\",\n \"The supplied one-step Location redirects outside the reference family; intent and final destination remain unverified.\");\n } else if (redirectState === \"to_sampled_variant\" ||\n redirectState === \"to_unobserved_family\") {\n add(page, \"redirect_to_other_variant\", \"info\",\n \"The one-step Location points to a different family variant, not directly to the chosen reference; redirects were not followed.\");\n } else if (redirectState === \"unresolved\") {\n result.unresolved_redirects++;\n add(page, \"redirect_unresolved\", \"warning\",\n \"The supplied redirect lacks a valid safely resolvable HTTP(S) Location; no destination was verified.\");\n }\n if (canonical.state === \"to_reference\") result.canonical_to_reference++;\n if (canonical.state === \"conflicting\") {\n result.conflicting_canonical_pages++;\n add(page, \"canonical_conflicting_on_page\", \"warning\",\n \"The same sampled response declared multiple distinct canonical targets; a single preferred declaration could not be determined.\");\n } else if (canonical.state === \"external\") {\n add(page, \"canonical_outside_family\", \"info\",\n \"A canonical declaration points outside the reference variant family; this may be intentional but requires review.\");\n } else if (canonical.state === \"unresolved\") {\n add(page, \"canonical_unresolved\", \"info\",\n \"A canonical target was invalid, credential-bearing or otherwise unresolved; the original declaration is not returned.\");\n }\n if (!isReference && match === true && canonical.state === \"self\") {\n add(page, \"self_canonical_on_matching_variant\", \"warning\",\n \"A byte-identical HTTP 200 variant declares itself canonical rather than the supplied reference; review canonical consistency.\");\n }\n if (canonical.targetKey && state === \"ok\") {\n canonicalKeys.push({\n page, target: canonical.targetKey,\n matching: isReference ? Boolean(referenceDigest) : match === true,\n });\n }\n });\n if (referenceDigest) {\n const group = canonicalKeys.filter((item) => item.matching);\n const distinct = new Set(group.map((item) => item.target));\n if (distinct.size > 1) {\n add(group[0].page, \"canonical_disagrees_with_reference\", \"warning\",\n \"Byte-identical sampled HTTP 200 pages declare different canonical targets; consolidate or verify intentional signals.\");\n }\n }\n if (validated.length === 1) {\n add(1, \"reference_observation_only\", \"info\",\n \"Only the reference URL was observed; no HTTP, www, slash, case or query variants were tested.\");\n }\n findings.sort((a, b) => (a.severity === b.severity ? 0 :\n a.severity === \"warning\" ? -1 : 1) || a.page - b.page || a.code.localeCompare(b.code));\n result.total_findings = findings.length;\n result.findings = findings.slice(0, MAX_VARIANT_FINDINGS);\n result.findings_truncated = findings.length > MAX_VARIANT_FINDINGS;\n return result;\n}\n"]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as cheerio from "cheerio";
|
|
2
|
+
import { MAX_LINK_HTML_BYTES, MAX_LINKS_PER_PAGE, safeLinkPageUrl, } from "./internal-link-quality.js";
|
|
3
|
+
/** Inert static DOM observation: never runs scripts or resolves fetched pages. */
|
|
4
|
+
export function observeInternalLinks(html, rawUrl) {
|
|
5
|
+
const url = safeLinkPageUrl(rawUrl) ?? "";
|
|
6
|
+
const empty = {
|
|
7
|
+
url, title: "", h1: "", main_present: false,
|
|
8
|
+
navigation_links_excluded: 0, extraction_limited: false, links: [],
|
|
9
|
+
};
|
|
10
|
+
if (!url || !html || new TextEncoder().encode(html).byteLength > MAX_LINK_HTML_BYTES) {
|
|
11
|
+
return empty;
|
|
12
|
+
}
|
|
13
|
+
const $ = cheerio.load(html);
|
|
14
|
+
const titleText = $("head > title").first().text().replace(/\s+/gu, " ").trim();
|
|
15
|
+
let limited = titleText.length > 300;
|
|
16
|
+
const title = titleText.slice(0, 300);
|
|
17
|
+
const excludedLinks = $("nav a[href],header a[href],footer a[href],aside a[href]").length;
|
|
18
|
+
$("template,script,style,noscript,nav,header,footer,aside,[hidden],[aria-hidden='true']").remove();
|
|
19
|
+
const main = $("main,[role='main']").first();
|
|
20
|
+
const article = $("article").first();
|
|
21
|
+
const root = main.length ? main : article.length ? article : $("body").first();
|
|
22
|
+
if (!root.length) {
|
|
23
|
+
return { ...empty, title, navigation_links_excluded: Math.min(excludedLinks, MAX_LINKS_PER_PAGE),
|
|
24
|
+
extraction_limited: limited || excludedLinks > MAX_LINKS_PER_PAGE };
|
|
25
|
+
}
|
|
26
|
+
const h1Text = root.find("h1").first().text().replace(/\s+/gu, " ").trim();
|
|
27
|
+
const h1 = h1Text.slice(0, 300);
|
|
28
|
+
if (h1Text.length > 300)
|
|
29
|
+
limited = true;
|
|
30
|
+
const anchors = root.find("a[href]").toArray();
|
|
31
|
+
if (anchors.length > MAX_LINKS_PER_PAGE || excludedLinks > MAX_LINKS_PER_PAGE)
|
|
32
|
+
limited = true;
|
|
33
|
+
const links = [];
|
|
34
|
+
const safeTrim = (text) => text.replace(/\s+/gu, " ").trim().slice(0, 180);
|
|
35
|
+
const sampledAnchors = anchors.slice(0, MAX_LINKS_PER_PAGE);
|
|
36
|
+
const referencedIds = new Set();
|
|
37
|
+
for (const anchor of sampledAnchors) {
|
|
38
|
+
for (const id of ($(anchor).attr("aria-labelledby") ?? "").split(/\s+/u).slice(0, 4)) {
|
|
39
|
+
if (id && id.length <= 80)
|
|
40
|
+
referencedIds.add(id);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Pre-index the referenced names once instead of searching the DOM for
|
|
44
|
+
// every anchor and every aria-labelledby token.
|
|
45
|
+
const referencedLabels = new Map();
|
|
46
|
+
if (referencedIds.size) {
|
|
47
|
+
$("[id]").each((_, element) => {
|
|
48
|
+
const id = $(element).attr("id");
|
|
49
|
+
if (id && referencedIds.has(id) && !referencedLabels.has(id)) {
|
|
50
|
+
referencedLabels.set(id, safeTrim($(element).text()));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
for (const element of sampledAnchors) {
|
|
55
|
+
const node = $(element);
|
|
56
|
+
const href = node.attr("href") ?? "";
|
|
57
|
+
// Never leak href into tool results; it exists only in the transient comparison.
|
|
58
|
+
if (href.length > 1024) {
|
|
59
|
+
limited = true;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const aria = safeTrim(node.attr("aria-label") ?? "");
|
|
63
|
+
const labelledbyIds = (node.attr("aria-labelledby") ?? "")
|
|
64
|
+
.split(/\s+/u).slice(0, 4).filter((id) => id.length > 0 && id.length <= 80);
|
|
65
|
+
const labelledby = labelledbyIds
|
|
66
|
+
.map((id) => referencedLabels.get(id) ?? "")
|
|
67
|
+
.filter(Boolean).join(" ").slice(0, 180);
|
|
68
|
+
const visible = safeTrim(node.text());
|
|
69
|
+
const alt = safeTrim(node.find("img[alt]").toArray().slice(0, 4)
|
|
70
|
+
.map((image) => $(image).attr("alt") ?? "").join(" "));
|
|
71
|
+
const titleLabel = safeTrim(node.attr("title") ?? "");
|
|
72
|
+
const label = aria || labelledby || visible || alt || titleLabel;
|
|
73
|
+
const rel = new Set((node.attr("rel") ?? "").toLowerCase().split(/\s+/u));
|
|
74
|
+
links.push({
|
|
75
|
+
href, label,
|
|
76
|
+
accessible: Boolean(label),
|
|
77
|
+
nofollow: rel.has("nofollow"),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
url, title, h1,
|
|
82
|
+
main_present: Boolean(main.length || article.length),
|
|
83
|
+
navigation_links_excluded: Math.min(excludedLinks, MAX_LINKS_PER_PAGE),
|
|
84
|
+
extraction_limited: limited,
|
|
85
|
+
links,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=extract-internal-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-internal-links.js","sourceRoot":"","sources":["../../../src/modules/site-architecture/extract-internal-links.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,GAEzD,MAAM,4BAA4B,CAAC;AAEpC,kFAAkF;AAClF,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,MAAc;IAC/D,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAC1C,MAAM,KAAK,GAA4B;QACrC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK;QAC3C,yBAAyB,EAAE,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;KACnE,CAAC;IACF,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,GAAG,mBAAmB,EAAE,CAAC;QACrF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,MAAM,SAAS,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAChF,IAAI,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,GAAG,CAAC;IACrC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,CAAC,CAAC,yDAAyD,CAAC,CAAC,MAAM,CAAC;IAC1F,CAAC,CAAC,sFAAsF,CA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ACzD,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,KAAK,GAAG,IAAI,IAAI,UAAU,IAAI,OAAO,IAAI,GAAG,IAAI,UAAU,CAAC;QACjE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC1E,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,KAAK;YACX,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC;YAC1B,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC;SAC9B,CAAC,CAAC;IACL,CAAC;IACD,OAAO;QACL,GAAG,EAAE,KAAK,EAAE,EAAE;QACd,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;QACpD,yBAAyB,EAAE,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,kBAAkB,CAAC;QACtE,kBAAkB,EAAE,OAAO;QAC3B,KAAK;KACN,CAAC;AACJ,CAAC","sourcesContent":["import * as cheerio from \"cheerio\";\nimport {\n MAX_LINK_HTML_BYTES, MAX_LINKS_PER_PAGE, safeLinkPageUrl,\n type InternalLinkObservation,\n} from \"./internal-link-quality.js\";\n\n/** Inert static DOM observation: never runs scripts or resolves fetched pages. */\nexport function observeInternalLinks(html: string, rawUrl: string): InternalLinkObservation {\n const url = safeLinkPageUrl(rawUrl) ?? \"\";\n const empty: InternalLinkObservation = {\n url, title: \"\", h1: \"\", main_present: false,\n navigation_links_excluded: 0, extraction_limited: false, links: [],\n };\n if (!url || !html || new TextEncoder().encode(html).byteLength > MAX_LINK_HTML_BYTES) {\n return empty;\n }\n const $ = cheerio.load(html);\n const titleText = $(\"head > title\").first().text().replace(/\\s+/gu, \" \").trim();\n let limited = titleText.length > 300;\n const title = titleText.slice(0, 300);\n const excludedLinks = $(\"nav a[href],header a[href],footer a[href],aside a[href]\").length;\n $(\"template,script,style,noscript,nav,header,footer,aside,[hidden],[aria-hidden='true']\").remove();\n const main = $(\"main,[role='main']\").first();\n const article = $(\"article\").first();\n const root = main.length ? main : article.length ? article : $(\"body\").first();\n if (!root.length) {\n return { ...empty, title, navigation_links_excluded: Math.min(excludedLinks, MAX_LINKS_PER_PAGE),\n extraction_limited: limited || excludedLinks > MAX_LINKS_PER_PAGE };\n }\n const h1Text = root.find(\"h1\").first().text().replace(/\\s+/gu, \" \").trim();\n const h1 = h1Text.slice(0, 300);\n if (h1Text.length > 300) limited = true;\n const anchors = root.find(\"a[href]\").toArray();\n if (anchors.length > MAX_LINKS_PER_PAGE || excludedLinks > MAX_LINKS_PER_PAGE) limited = true;\n const links: InternalLinkObservation[\"links\"] = [];\n const safeTrim = (text: string) => text.replace(/\\s+/gu, \" \").trim().slice(0, 180);\n const sampledAnchors = anchors.slice(0, MAX_LINKS_PER_PAGE);\n const referencedIds = new Set<string>();\n for (const anchor of sampledAnchors) {\n for (const id of ($(anchor).attr(\"aria-labelledby\") ?? \"\").split(/\\s+/u).slice(0, 4)) {\n if (id && id.length <= 80) referencedIds.add(id);\n }\n }\n // Pre-index the referenced names once instead of searching the DOM for\n // every anchor and every aria-labelledby token.\n const referencedLabels = new Map<string, string>();\n if (referencedIds.size) {\n $(\"[id]\").each((_, element) => {\n const id = $(element).attr(\"id\");\n if (id && referencedIds.has(id) && !referencedLabels.has(id)) {\n referencedLabels.set(id, safeTrim($(element).text()));\n }\n });\n }\n\n for (const element of sampledAnchors) {\n const node = $(element);\n const href = node.attr(\"href\") ?? \"\";\n // Never leak href into tool results; it exists only in the transient comparison.\n if (href.length > 1024) {\n limited = true;\n continue;\n }\n const aria = safeTrim(node.attr(\"aria-label\") ?? \"\");\n const labelledbyIds = (node.attr(\"aria-labelledby\") ?? \"\")\n .split(/\\s+/u).slice(0, 4).filter((id) => id.length > 0 && id.length <= 80);\n const labelledby = labelledbyIds\n .map((id) => referencedLabels.get(id) ?? \"\")\n .filter(Boolean).join(\" \").slice(0, 180);\n const visible = safeTrim(node.text());\n const alt = safeTrim(node.find(\"img[alt]\").toArray().slice(0, 4)\n .map((image) => $(image).attr(\"alt\") ?? \"\").join(\" \"));\n const titleLabel = safeTrim(node.attr(\"title\") ?? \"\");\n const label = aria || labelledby || visible || alt || titleLabel;\n const rel = new Set((node.attr(\"rel\") ?? \"\").toLowerCase().split(/\\s+/u));\n links.push({\n href, label,\n accessible: Boolean(label),\n nofollow: rel.has(\"nofollow\"),\n });\n }\n return {\n url, title, h1,\n main_present: Boolean(main.length || article.length),\n navigation_links_excluded: Math.min(excludedLinks, MAX_LINKS_PER_PAGE),\n extraction_limited: limited,\n links,\n };\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local stdio adapter. The shared multilingual analysis module deliberately
|
|
3
|
+
* has no dependency on Cheerio or either runtime's package installation.
|
|
4
|
+
*/
|
|
5
|
+
import * as cheerio from "cheerio";
|
|
6
|
+
import { analyzeMultilingualHtmlSignals, MAX_MULTILINGUAL_HTML_CHARS, safeMultilingualUrl, } from "./multilingual-clusters.js";
|
|
7
|
+
export function observeMultilingualPage(html, url) {
|
|
8
|
+
if (!html || html.length > MAX_MULTILINGUAL_HTML_CHARS || !safeMultilingualUrl(url)) {
|
|
9
|
+
return analyzeMultilingualHtmlSignals({ rawUrl: url, htmlLength: html.length, links: [] });
|
|
10
|
+
}
|
|
11
|
+
const $ = cheerio.load(html);
|
|
12
|
+
return analyzeMultilingualHtmlSignals({
|
|
13
|
+
rawUrl: url,
|
|
14
|
+
htmlLength: html.length,
|
|
15
|
+
rawLanguage: $("html").first().attr("lang"),
|
|
16
|
+
links: $("head > link[rel], head > link[hreflang]").toArray().map((element) => {
|
|
17
|
+
const link = $(element);
|
|
18
|
+
return {
|
|
19
|
+
rel: link.attr("rel"),
|
|
20
|
+
href: link.attr("href"),
|
|
21
|
+
hreflang: link.attr("hreflang"),
|
|
22
|
+
hasMedia: link.attr("media") !== undefined,
|
|
23
|
+
hasType: link.attr("type") !== undefined,
|
|
24
|
+
hasLang: link.attr("lang") !== undefined,
|
|
25
|
+
};
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=extract-multilingual-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-multilingual-page.js","sourceRoot":"","sources":["../../../src/modules/site-architecture/extract-multilingual-page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,mBAAmB,GAEpB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,UAAU,uBAAuB,CAAC,IAAY,EAAE,GAAW;IAC/D,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,2BAA2B,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;QACpF,OAAO,8BAA8B,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7F,CAAC;IACD,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,8BAA8B,CAAC;QACpC,MAAM,EAAE,GAAG;QACX,UAAU,EAAE,IAAI,CAAC,MAAM;QACvB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3C,KAAK,EAAE,CAAC,CAAC,yCAAyC,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5E,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;YACxB,OAAO;gBACL,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;gBACrB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;gBACvB,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;gBAC/B,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,SAAS;gBAC1C,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS;gBACxC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,SAAS;aACzC,CAAC;QACJ,CAAC,CAAC;KACH,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Local stdio adapter. The shared multilingual analysis module deliberately\n * has no dependency on Cheerio or either runtime's package installation.\n */\nimport * as cheerio from \"cheerio\";\nimport {\n analyzeMultilingualHtmlSignals,\n MAX_MULTILINGUAL_HTML_CHARS,\n safeMultilingualUrl,\n type MultilingualPageObservation,\n} from \"./multilingual-clusters.js\";\n\nexport function observeMultilingualPage(html: string, url: string): MultilingualPageObservation {\n if (!html || html.length > MAX_MULTILINGUAL_HTML_CHARS || !safeMultilingualUrl(url)) {\n return analyzeMultilingualHtmlSignals({ rawUrl: url, htmlLength: html.length, links: [] });\n }\n const $ = cheerio.load(html);\n return analyzeMultilingualHtmlSignals({\n rawUrl: url,\n htmlLength: html.length,\n rawLanguage: $(\"html\").first().attr(\"lang\"),\n links: $(\"head > link[rel], head > link[hreflang]\").toArray().map((element) => {\n const link = $(element);\n return {\n rel: link.attr(\"rel\"),\n href: link.attr(\"href\"),\n hreflang: link.attr(\"hreflang\"),\n hasMedia: link.attr(\"media\") !== undefined,\n hasType: link.attr(\"type\") !== undefined,\n hasLang: link.attr(\"lang\") !== undefined,\n };\n }),\n });\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type InternalLinkGraphReview } from "./internal-link-graph.js";
|
|
2
|
+
/**
|
|
3
|
+
* Bounded, guarded V06 live sampling. One robots.txt and at most three pages.
|
|
4
|
+
* Never impersonate Googlebot; never follow redirects, query variants, JS,
|
|
5
|
+
* off-origin links, or disallowed/unverified robots paths.
|
|
6
|
+
*/
|
|
7
|
+
export declare function probeInternalLinkGraph(url: string): Promise<InternalLinkGraphReview>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { fetchPublicHttp, readResponseText, resolvePublicHttpUrl } from "../../network.js";
|
|
2
|
+
import { safeHttpResourceUrl } from "../http-crawl/non-html-directives.js";
|
|
3
|
+
import { isAllowedForFetcher, MAX_CRAWLER_ROBOTS_BYTES, analyzeCrawlerAccess, } from "../http-crawl/crawler-access.js";
|
|
4
|
+
import { analyzeInternalLinkGraph, graphLiveTargets, MAX_GRAPH_HTML_BYTES, MAX_GRAPH_LIVE_PAGES, } from "./internal-link-graph.js";
|
|
5
|
+
async function closeResponse(response) {
|
|
6
|
+
try {
|
|
7
|
+
await response.body?.cancel();
|
|
8
|
+
}
|
|
9
|
+
catch { /* Already consumed or closed. */ }
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Bounded, guarded V06 live sampling. One robots.txt and at most three pages.
|
|
13
|
+
* Never impersonate Googlebot; never follow redirects, query variants, JS,
|
|
14
|
+
* off-origin links, or disallowed/unverified robots paths.
|
|
15
|
+
*/
|
|
16
|
+
export async function probeInternalLinkGraph(url) {
|
|
17
|
+
const safe = safeHttpResourceUrl(url);
|
|
18
|
+
if (!safe)
|
|
19
|
+
throw new Error("Use one authorized, query-free public HTTP(S) entry URL.");
|
|
20
|
+
await resolvePublicHttpUrl(safe);
|
|
21
|
+
const origin = new URL(safe).origin;
|
|
22
|
+
let robotsText;
|
|
23
|
+
let robotsStatus;
|
|
24
|
+
try {
|
|
25
|
+
const { response } = await fetchPublicHttp(origin + "/robots.txt", {
|
|
26
|
+
method: "GET", timeoutMs: 12_000, maxRedirects: 0,
|
|
27
|
+
headers: { accept: "text/plain", "user-agent": "DigestSEO-Web-Validator/1.3" },
|
|
28
|
+
});
|
|
29
|
+
robotsStatus = response.status;
|
|
30
|
+
try {
|
|
31
|
+
const type = response.headers.get("content-type")?.split(";", 1)[0].trim().toLowerCase();
|
|
32
|
+
if (response.status === 200 && (!type || type === "text/plain")) {
|
|
33
|
+
robotsText = await readResponseText(response, MAX_CRAWLER_ROBOTS_BYTES);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
await closeResponse(response);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch { /* Unknown robots permission fails closed for further GETs. */ }
|
|
41
|
+
const queue = [safe];
|
|
42
|
+
const sampled = new Set();
|
|
43
|
+
const pages = [];
|
|
44
|
+
for (let at = 0; at < queue.length && pages.length < MAX_GRAPH_LIVE_PAGES; at++) {
|
|
45
|
+
const next = queue[at];
|
|
46
|
+
if (sampled.has(next))
|
|
47
|
+
continue;
|
|
48
|
+
sampled.add(next);
|
|
49
|
+
const permission = robotsText !== undefined
|
|
50
|
+
? isAllowedForFetcher(robotsText, next)
|
|
51
|
+
: robotsStatus === 404 || robotsStatus === 410 ? true : undefined;
|
|
52
|
+
if (permission !== true) {
|
|
53
|
+
pages.push({ url: next, ...(permission === false ? { robots_allowed: false } : {}) });
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const row = { url: next, robots_allowed: true };
|
|
57
|
+
let html;
|
|
58
|
+
try {
|
|
59
|
+
const { response } = await fetchPublicHttp(next, {
|
|
60
|
+
method: "GET", timeoutMs: 12_000, maxRedirects: 0,
|
|
61
|
+
headers: {
|
|
62
|
+
accept: "text/html,application/xhtml+xml",
|
|
63
|
+
"user-agent": "DigestSEO-Web-Validator/1.3",
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
row.status_code = response.status;
|
|
67
|
+
try {
|
|
68
|
+
const xRobots = response.headers.get("x-robots-tag");
|
|
69
|
+
if (xRobots) {
|
|
70
|
+
const observed = analyzeCrawlerAccess({
|
|
71
|
+
site_url: origin + "/", pages: [{
|
|
72
|
+
url: next, status_code: response.status,
|
|
73
|
+
x_robots_tag: [xRobots],
|
|
74
|
+
}], profiles: ["googlebot-smartphone"],
|
|
75
|
+
});
|
|
76
|
+
if (observed.rows[0]?.indexing_state === "explicit_noindex")
|
|
77
|
+
row.noindex = true;
|
|
78
|
+
}
|
|
79
|
+
const mime = response.headers.get("content-type")?.split(";", 1)[0].trim().toLowerCase();
|
|
80
|
+
if (response.status >= 200 && response.status < 300 &&
|
|
81
|
+
(mime === "text/html" || mime === "application/xhtml+xml")) {
|
|
82
|
+
try {
|
|
83
|
+
const charset = /(?:^|;)\s*charset\s*=\s*"?([^;\s"]+)/iu
|
|
84
|
+
.exec(response.headers.get("content-type") ?? "")?.[1];
|
|
85
|
+
html = await readResponseText(response, MAX_GRAPH_HTML_BYTES, charset);
|
|
86
|
+
row.html = html;
|
|
87
|
+
}
|
|
88
|
+
catch { /* HTML evidence absent instead of a false clean graph. */ }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
await closeResponse(response);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch { /* Preserve unknown request outcome, not a fabricated HTTP error. */ }
|
|
96
|
+
pages.push(row);
|
|
97
|
+
if (html && pages.length < MAX_GRAPH_LIVE_PAGES) {
|
|
98
|
+
for (const target of graphLiveTargets(html, next)) {
|
|
99
|
+
if (queue.length >= MAX_GRAPH_LIVE_PAGES)
|
|
100
|
+
break;
|
|
101
|
+
if (sampled.has(target) || queue.includes(target))
|
|
102
|
+
continue;
|
|
103
|
+
if (safeHttpResourceUrl(target) && new URL(target).origin === origin)
|
|
104
|
+
queue.push(target);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const report = analyzeInternalLinkGraph({
|
|
109
|
+
site_url: origin + "/", entry_urls: [safe], pages,
|
|
110
|
+
}, "live_bounded_public_link_graph");
|
|
111
|
+
if (robotsText === undefined && robotsStatus !== 404 && robotsStatus !== 410) {
|
|
112
|
+
report.error = "Robots.txt permission could not be verified; no page requests were made.";
|
|
113
|
+
}
|
|
114
|
+
return report;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=internal-link-graph-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-link-graph-probe.js","sourceRoot":"","sources":["../../../src/modules/site-architecture/internal-link-graph-probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,mBAAmB,EAAE,wBAAwB,EAAE,oBAAoB,GACpE,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,wBAAwB,EAAE,gBAAgB,EAAE,oBAAoB,EAChE,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAElC,KAAK,UAAU,aAAa,CAAC,QAAkB;IAC7C,IAAI,CAAC;QAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,iCAAiC,CAAC,CAAC;AACpF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,GAAW;IACtD,MAAM,IAAI,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IACvF,MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,UAA8B,CAAC;IACnC,IAAI,YAAgC,CAAC;IACrC,IAAI,CAAC;QACH,MAAM,EAAE,QAAQ,EAAE,GA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KAAK,CAAC,MAAM,IAAI,oBAAoB;oBAAE,MAAM;gBAChD,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;oBAAE,SAAS;gBAC5D,IAAI,mBAAmB,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,MAAM;oBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC3F,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,MAAM,GAAG,wBAAwB,CAAC;QACtC,QAAQ,EAAE,MAAM,GAAG,GAAG,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK;KAClD,EAAE,gCAAgC,CAAC,CAAC;IACrC,IAAI,UAAU,KAAK,SAAS,IAAI,YAAY,KAAK,GAAG,IAAI,YAAY,KAAK,GAAG,EAAE,CAAC;QAC7E,MAAM,CAAC,KAAK,GAAG,0EAA0E,CAAC;IAC5F,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { fetchPublicHttp, readResponseText, resolvePublicHttpUrl } from \"../../network.js\";\nimport { safeHttpResourceUrl } from \"../http-crawl/non-html-directives.js\";\nimport {\n isAllowedForFetcher, MAX_CRAWLER_ROBOTS_BYTES, analyzeCrawlerAccess,\n} from \"../http-crawl/crawler-access.js\";\nimport {\n analyzeInternalLinkGraph, graphLiveTargets, MAX_GRAPH_HTML_BYTES,\n MAX_GRAPH_LIVE_PAGES, type GraphPageInput, type InternalLinkGraphReview,\n} from \"./internal-link-graph.js\";\n\nasync function closeResponse(response: Response): Promise<void> {\n try { await response.body?.cancel(); } catch { /* Already consumed or closed. */ }\n}\n\n/**\n * Bounded, guarded V06 live sampling. One robots.txt and at most three pages.\n * Never impersonate Googlebot; never follow redirects, query variants, JS,\n * off-origin links, or disallowed/unverified robots paths.\n */\nexport async function probeInternalLinkGraph(url: string): Promise<InternalLinkGraphReview> {\n const safe = safeHttpResourceUrl(url);\n if (!safe) throw new Error(\"Use one authorized, query-free public HTTP(S) entry URL.\");\n await resolvePublicHttpUrl(safe);\n const origin = new URL(safe).origin;\n let robotsText: string | undefined;\n let robotsStatus: number | undefined;\n try {\n const { response } = await fetchPublicHttp(origin + \"/robots.txt\", {\n method: \"GET\", timeoutMs: 12_000, maxRedirects: 0,\n headers: { accept: \"text/plain\", \"user-agent\": \"DigestSEO-Web-Validator/1.3\" },\n });\n robotsStatus = response.status;\n try {\n const type = response.headers.get(\"content-type\")?.split(\";\", 1)[0].trim().toLowerCase();\n if (response.status === 200 && (!type || type === \"text/plain\")) {\n robotsText = await readResponseText(response, MAX_CRAWLER_ROBOTS_BYTES);\n }\n } finally { await closeResponse(response); }\n } catch { /* Unknown robots permission fails closed for further GETs. */ }\n\n const queue = [safe];\n const sampled = new Set<string>();\n const pages: GraphPageInput[] = [];\n for (let at = 0; at < queue.length && pages.length < MAX_GRAPH_LIVE_PAGES; at++) {\n const next = queue[at];\n if (sampled.has(next)) continue;\n sampled.add(next);\n const permission = robotsText !== undefined\n ? isAllowedForFetcher(robotsText, next)\n : robotsStatus === 404 || robotsStatus === 410 ? true : undefined;\n if (permission !== true) {\n pages.push({ url: next, ...(permission === false ? { robots_allowed: false } : {}) });\n continue;\n }\n const row: GraphPageInput = { url: next, robots_allowed: true };\n let html: string | undefined;\n try {\n const { response } = await fetchPublicHttp(next, {\n method: \"GET\", timeoutMs: 12_000, maxRedirects: 0,\n headers: {\n accept: \"text/html,application/xhtml+xml\",\n \"user-agent\": \"DigestSEO-Web-Validator/1.3\",\n },\n });\n row.status_code = response.status;\n try {\n const xRobots = response.headers.get(\"x-robots-tag\");\n if (xRobots) {\n const observed = analyzeCrawlerAccess({\n site_url: origin + \"/\", pages: [{\n url: next, status_code: response.status,\n x_robots_tag: [xRobots],\n }], profiles: [\"googlebot-smartphone\"],\n });\n if (observed.rows[0]?.indexing_state === \"explicit_noindex\") row.noindex = true;\n }\n const mime = response.headers.get(\"content-type\")?.split(\";\", 1)[0].trim().toLowerCase();\n if (response.status >= 200 && response.status < 300 &&\n (mime === \"text/html\" || mime === \"application/xhtml+xml\")) {\n try {\n const charset = /(?:^|;)\\s*charset\\s*=\\s*\"?([^;\\s\"]+)/iu\n .exec(response.headers.get(\"content-type\") ?? \"\")?.[1];\n html = await readResponseText(response, MAX_GRAPH_HTML_BYTES, charset);\n row.html = html;\n } catch { /* HTML evidence absent instead of a false clean graph. */ }\n }\n } finally { await closeResponse(response); }\n } catch { /* Preserve unknown request outcome, not a fabricated HTTP error. */ }\n pages.push(row);\n if (html && pages.length < MAX_GRAPH_LIVE_PAGES) {\n for (const target of graphLiveTargets(html, next)) {\n if (queue.length >= MAX_GRAPH_LIVE_PAGES) break;\n if (sampled.has(target) || queue.includes(target)) continue;\n if (safeHttpResourceUrl(target) && new URL(target).origin === origin) queue.push(target);\n }\n }\n }\n const report = analyzeInternalLinkGraph({\n site_url: origin + \"/\", entry_urls: [safe], pages,\n }, \"live_bounded_public_link_graph\");\n if (robotsText === undefined && robotsStatus !== 404 && robotsStatus !== 410) {\n report.error = \"Robots.txt permission could not be verified; no page requests were made.\";\n }\n return report;\n}\n"]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export declare const MAX_GRAPH_PAGES = 8;
|
|
2
|
+
export declare const MAX_GRAPH_HTML_BYTES = 1048576;
|
|
3
|
+
export declare const MAX_GRAPH_TOTAL_HTML_BYTES = 1500000;
|
|
4
|
+
export declare const MAX_GRAPH_LINKS_PER_PAGE = 240;
|
|
5
|
+
export declare const MAX_GRAPH_CATALOG_URLS = 256;
|
|
6
|
+
export declare const MAX_GRAPH_FINDINGS = 24;
|
|
7
|
+
export declare const MAX_GRAPH_LIVE_PAGES = 3;
|
|
8
|
+
export declare const GRAPH_FINDING_CODES: readonly ["entry_not_sampled", "entry_not_crawlable", "sampled_page_unreachable", "possible_orphan_in_sample", "sampled_deep_page", "link_sample_truncated", "linked_to_http_error", "linked_to_robots_blocked", "linked_to_noindex", "linked_to_noncanonical", "nofollow_only_path", "unobserved_link_targets", "sitemap_pages_unobserved", "unsafe_links_excluded", "query_links_excluded", "external_base_ignored", "page_html_unverified", "no_sampled_outgoing_links"];
|
|
9
|
+
export type GraphFindingCode = typeof GRAPH_FINDING_CODES[number];
|
|
10
|
+
type GraphScope = "caller_supplied_link_graph" | "live_bounded_public_link_graph";
|
|
11
|
+
export interface GraphPageInput {
|
|
12
|
+
url: string;
|
|
13
|
+
html?: string;
|
|
14
|
+
status_code?: number;
|
|
15
|
+
robots_allowed?: boolean;
|
|
16
|
+
noindex?: boolean;
|
|
17
|
+
canonical_url?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface InternalLinkGraphInput {
|
|
20
|
+
site_url: string;
|
|
21
|
+
pages: GraphPageInput[];
|
|
22
|
+
entry_urls?: string[];
|
|
23
|
+
sitemap_urls?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface GraphPageReport {
|
|
26
|
+
page: number;
|
|
27
|
+
html_examined: boolean;
|
|
28
|
+
status_code?: number;
|
|
29
|
+
robots_access: "allowed" | "disallowed" | "unknown";
|
|
30
|
+
noindex_state: "declared" | "not_observed" | "unknown";
|
|
31
|
+
canonical_state: "self" | "different" | "ambiguous" | "unknown";
|
|
32
|
+
links_observed: number;
|
|
33
|
+
internal_links: number;
|
|
34
|
+
external_links: number;
|
|
35
|
+
fragment_links: number;
|
|
36
|
+
query_links_excluded: number;
|
|
37
|
+
unsafe_links_excluded: number;
|
|
38
|
+
self_links: number;
|
|
39
|
+
nofollow_internal: number;
|
|
40
|
+
sampled_targets: number;
|
|
41
|
+
unobserved_internal_targets: number;
|
|
42
|
+
incoming_sampled_sources: number;
|
|
43
|
+
depth_from_entry: number | null;
|
|
44
|
+
potential_orphan_in_sample: boolean;
|
|
45
|
+
extraction_limited: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface GraphFinding {
|
|
48
|
+
code: GraphFindingCode;
|
|
49
|
+
severity: "warning" | "info";
|
|
50
|
+
page: number;
|
|
51
|
+
target_page?: number;
|
|
52
|
+
count: number;
|
|
53
|
+
message: string;
|
|
54
|
+
}
|
|
55
|
+
export interface InternalLinkGraphReview {
|
|
56
|
+
scope: GraphScope;
|
|
57
|
+
pages_observed: number;
|
|
58
|
+
html_pages_examined: number;
|
|
59
|
+
entry_pages_observed: number;
|
|
60
|
+
entry_pages_missing: number;
|
|
61
|
+
pages_reachable_within_sample: number;
|
|
62
|
+
pages_unreachable_within_sample: number;
|
|
63
|
+
deepest_observed_sample_depth: number | null;
|
|
64
|
+
deep_pages_at_three_or_more: number;
|
|
65
|
+
potential_orphans_within_sample: number;
|
|
66
|
+
unique_observed_sample_edges: number;
|
|
67
|
+
internal_links_observed: number;
|
|
68
|
+
external_links_observed: number;
|
|
69
|
+
nofollow_internal_links: number;
|
|
70
|
+
distinct_unsampled_link_targets: number;
|
|
71
|
+
unsafe_or_query_links_excluded: number;
|
|
72
|
+
pages_with_truncated_links: number;
|
|
73
|
+
linked_http_error_pages: number;
|
|
74
|
+
linked_robots_blocked_pages: number;
|
|
75
|
+
linked_declared_noindex_pages: number;
|
|
76
|
+
linked_noncanonical_pages: number;
|
|
77
|
+
sitemap_urls_provided: number;
|
|
78
|
+
sitemap_urls_without_page_sample: number;
|
|
79
|
+
sampled_pages_not_in_sitemap: number;
|
|
80
|
+
robots_unknown_pages: number;
|
|
81
|
+
status_unknown_pages: number;
|
|
82
|
+
coverage_limited: true;
|
|
83
|
+
limitations: string[];
|
|
84
|
+
pages: GraphPageReport[];
|
|
85
|
+
total_findings: number;
|
|
86
|
+
findings: GraphFinding[];
|
|
87
|
+
findings_truncated: boolean;
|
|
88
|
+
error?: string;
|
|
89
|
+
}
|
|
90
|
+
type Edge = {
|
|
91
|
+
to: string;
|
|
92
|
+
nofollow: boolean;
|
|
93
|
+
};
|
|
94
|
+
type Extraction = {
|
|
95
|
+
links: number;
|
|
96
|
+
internal: number;
|
|
97
|
+
external: number;
|
|
98
|
+
fragments: number;
|
|
99
|
+
query: number;
|
|
100
|
+
unsafe: number;
|
|
101
|
+
self: number;
|
|
102
|
+
nofollow: number;
|
|
103
|
+
limited: boolean;
|
|
104
|
+
ignoredBase: boolean;
|
|
105
|
+
edges: Edge[];
|
|
106
|
+
};
|
|
107
|
+
/** Reuse this pure extractor to select a tiny subset of safe same-origin live links. */
|
|
108
|
+
export declare function extractGraphLinks(html: string, pageUrl: string): Extraction;
|
|
109
|
+
/** Select next live targets without leaking the target URLs in MCP results. */
|
|
110
|
+
export declare function graphLiveTargets(html: string, pageUrl: string): string[];
|
|
111
|
+
export declare function emptyInternalLinkGraphReview(scope?: GraphScope): InternalLinkGraphReview;
|
|
112
|
+
export declare function analyzeInternalLinkGraph(input: InternalLinkGraphInput, scope?: GraphScope): InternalLinkGraphReview;
|
|
113
|
+
export {};
|