@rivi-software/agentic-seo-check 0.1.0 → 0.1.1
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/LICENSE +1 -1
- package/README.md +65 -15
- package/dist/brand.d.ts +11 -0
- package/dist/brand.js +22 -0
- package/dist/brand.js.map +1 -0
- package/dist/cli.js +125 -80
- package/dist/cli.js.map +1 -1
- package/dist/core/audit.d.ts +16 -16
- package/dist/core/audit.js +363 -248
- package/dist/core/audit.js.map +1 -1
- package/dist/core/concurrency.d.ts +4 -4
- package/dist/core/concurrency.js +33 -23
- package/dist/core/concurrency.js.map +1 -1
- package/dist/core/crawl.d.ts +5 -5
- package/dist/core/crawl.js +250 -121
- package/dist/core/crawl.js.map +1 -1
- package/dist/core/fetch.d.ts +5 -5
- package/dist/core/fetch.js +151 -100
- package/dist/core/fetch.js.map +1 -1
- package/dist/core/html/dom.d.ts +13 -0
- package/dist/core/html/dom.js +17 -0
- package/dist/core/html/dom.js.map +1 -0
- package/dist/core/html/extract.d.ts +2 -2
- package/dist/core/html/extract.js +168 -111
- package/dist/core/html/extract.js.map +1 -1
- package/dist/core/html/structured-data.d.ts +16 -6
- package/dist/core/html/structured-data.js +180 -145
- package/dist/core/html/structured-data.js.map +1 -1
- package/dist/core/html/text.d.ts +14 -14
- package/dist/core/html/text.js +110 -107
- package/dist/core/html/text.js.map +1 -1
- package/dist/core/lighthouse.d.ts +26 -25
- package/dist/core/lighthouse.js +181 -105
- package/dist/core/lighthouse.js.map +1 -1
- package/dist/core/performance-rules.d.ts +2 -2
- package/dist/core/performance-rules.js +105 -33
- package/dist/core/performance-rules.js.map +1 -1
- package/dist/core/render-rules.d.ts +5 -4
- package/dist/core/render-rules.js +129 -62
- package/dist/core/render-rules.js.map +1 -1
- package/dist/core/render.d.ts +2 -2
- package/dist/core/render.js +29 -23
- package/dist/core/render.js.map +1 -1
- package/dist/core/report/markdown.d.ts +2 -2
- package/dist/core/report/markdown.js +110 -131
- package/dist/core/report/markdown.js.map +1 -1
- package/dist/core/robots.d.ts +5 -5
- package/dist/core/robots.js +31 -16
- package/dist/core/robots.js.map +1 -1
- package/dist/core/rules/canonical.d.ts +1 -1
- package/dist/core/rules/canonical.js +93 -57
- package/dist/core/rules/canonical.js.map +1 -1
- package/dist/core/rules/content.js +40 -26
- package/dist/core/rules/content.js.map +1 -1
- package/dist/core/rules/document.js +64 -41
- package/dist/core/rules/document.js.map +1 -1
- package/dist/core/rules/headings.js +58 -38
- package/dist/core/rules/headings.js.map +1 -1
- package/dist/core/rules/hreflang.js +70 -38
- package/dist/core/rules/hreflang.js.map +1 -1
- package/dist/core/rules/images.js +44 -26
- package/dist/core/rules/images.js.map +1 -1
- package/dist/core/rules/index.d.ts +6 -6
- package/dist/core/rules/index.js +36 -35
- package/dist/core/rules/index.js.map +1 -1
- package/dist/core/rules/indexing.d.ts +2 -2
- package/dist/core/rules/indexing.js +48 -26
- package/dist/core/rules/indexing.js.map +1 -1
- package/dist/core/rules/keyword.js +84 -47
- package/dist/core/rules/keyword.js.map +1 -1
- package/dist/core/rules/links.js +72 -37
- package/dist/core/rules/links.js.map +1 -1
- package/dist/core/rules/meta.js +55 -34
- package/dist/core/rules/meta.js.map +1 -1
- package/dist/core/rules/response.js +75 -41
- package/dist/core/rules/response.js.map +1 -1
- package/dist/core/rules/rule.d.ts +6 -6
- package/dist/core/rules/rule.js +36 -36
- package/dist/core/rules/rule.js.map +1 -1
- package/dist/core/rules/social.js +86 -45
- package/dist/core/rules/social.js.map +1 -1
- package/dist/core/rules/structured-data.d.ts +6 -4
- package/dist/core/rules/structured-data.js +314 -102
- package/dist/core/rules/structured-data.js.map +1 -1
- package/dist/core/rules/title.js +48 -33
- package/dist/core/rules/title.js.map +1 -1
- package/dist/core/score.d.ts +3 -3
- package/dist/core/score.js +11 -9
- package/dist/core/score.js.map +1 -1
- package/dist/core/site-rules.d.ts +3 -3
- package/dist/core/site-rules.js +409 -198
- package/dist/core/site-rules.js.map +1 -1
- package/dist/core/sitemap.d.ts +5 -5
- package/dist/core/sitemap.js +109 -64
- package/dist/core/sitemap.js.map +1 -1
- package/dist/core/static.d.ts +2 -2
- package/dist/core/static.js +209 -112
- package/dist/core/static.js.map +1 -1
- package/dist/core/summary.d.ts +2 -2
- package/dist/core/summary.js +11 -6
- package/dist/core/summary.js.map +1 -1
- package/dist/core/types.d.ts +14 -14
- package/dist/core/types.js +15 -8
- package/dist/core/types.js.map +1 -1
- package/dist/core/url.d.ts +11 -11
- package/dist/core/url.js +122 -70
- package/dist/core/url.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp-bin.js +7 -4
- package/dist/mcp-bin.js.map +1 -1
- package/dist/mcp.d.ts +3 -3
- package/dist/mcp.js +312 -122
- package/dist/mcp.js.map +1 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +4 -2
- package/dist/version.js.map +1 -1
- package/package.json +27 -9
|
@@ -1,152 +1,131 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { MAKER, MAKER_URL, REPOSITORY_URL } from "../../brand.js";
|
|
2
|
+
import { VERSION } from "../../version.js";
|
|
3
|
+
const cell = (value) => {
|
|
4
|
+
if (!value) {
|
|
5
|
+
return "—";
|
|
6
|
+
}
|
|
7
|
+
return value.replaceAll("|", "\\|").replaceAll("\n", " ").slice(0, 120);
|
|
8
|
+
};
|
|
9
|
+
const ms = (value) => value === null ? "—" : `${Math.round(value)} ms`;
|
|
10
|
+
const countsLine = (c) => `${c.error} error(s), ${c.warning} warning(s), ${c.info} info`;
|
|
11
|
+
const findingLines = (f) => {
|
|
12
|
+
const out = [
|
|
13
|
+
`- **\`${f.rule}\`** ${f.message}`,
|
|
14
|
+
` - Fix: ${f.recommendation}`,
|
|
15
|
+
];
|
|
16
|
+
if (f.selector) {
|
|
17
|
+
out.push(` - Where: \`${f.selector}\``);
|
|
18
|
+
}
|
|
19
|
+
if (f.evidence && Object.keys(f.evidence).length) {
|
|
20
|
+
out.push(` - Evidence: \`${JSON.stringify(f.evidence).slice(0, 400)}\``);
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
};
|
|
24
|
+
const SEVERITY_HEADINGS = {
|
|
25
|
+
error: "Errors",
|
|
26
|
+
warning: "Warnings",
|
|
27
|
+
info: "Info",
|
|
28
|
+
};
|
|
29
|
+
const findingsSection = (findings, heading) => {
|
|
30
|
+
const lines = [`${heading}# Findings`, ""];
|
|
31
|
+
if (!findings.length) {
|
|
32
|
+
lines.push("No issues found.");
|
|
33
|
+
return lines;
|
|
34
|
+
}
|
|
35
|
+
for (const severity of ["error", "warning", "info"]) {
|
|
36
|
+
const group = findings.filter((f) => f.severity === severity);
|
|
37
|
+
if (!group.length) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
lines.push(`${heading}## ${SEVERITY_HEADINGS[severity]} (${group.length})`, "");
|
|
41
|
+
for (const f of group) {
|
|
42
|
+
lines.push(...findingLines(f));
|
|
43
|
+
}
|
|
44
|
+
lines.push("");
|
|
45
|
+
}
|
|
46
|
+
return lines;
|
|
47
|
+
};
|
|
48
|
+
const pageMarkdown = (audit, heading = "#") => {
|
|
49
|
+
const lines = [
|
|
50
|
+
`${heading} SEO audit: ${audit.url}`,
|
|
51
|
+
"",
|
|
52
|
+
`Score **${audit.score}/100** · ${countsLine(audit.counts)}${audit.response?.status ? ` · HTTP ${audit.response.status}` : ""}${audit.response?.timeMs ? ` · ${audit.response.timeMs} ms` : ""}`,
|
|
53
|
+
"",
|
|
54
|
+
];
|
|
10
55
|
const s = audit.summary;
|
|
11
|
-
lines.push(`${heading}# Summary`)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
lines.push(`| Meta description | ${cell(s.metaDescription)} (${s.metaDescriptionLength} chars) |`);
|
|
17
|
-
lines.push(`| Canonical | ${cell(s.canonical)} |`);
|
|
18
|
-
lines.push(`| Indexable | ${s.indexable ? 'yes' : 'no'}${s.robots.length ? ` (${s.robots.join(', ')})` : ''} |`);
|
|
19
|
-
lines.push(`| Language | ${cell(s.lang)} |`);
|
|
20
|
-
lines.push(`| H1 | ${s.h1.length ? s.h1.map(cell).join(' / ') : '—'} |`);
|
|
21
|
-
lines.push(`| Words | ${s.wordCount} |`);
|
|
22
|
-
lines.push(`| Images | ${s.images.total} (${s.images.missingAlt} without alt) |`);
|
|
23
|
-
lines.push(`| Links | ${s.links.internal} internal, ${s.links.external} external |`);
|
|
24
|
-
lines.push(`| Structured data | ${s.structuredDataTypes.length ? s.structuredDataTypes.join(', ') : '—'} |`);
|
|
25
|
-
lines.push(`| Open Graph | ${Object.keys(s.openGraph).length ? Object.keys(s.openGraph).map((k) => `og:${k}`).join(', ') : '—'} |`);
|
|
26
|
-
lines.push('');
|
|
56
|
+
lines.push(`${heading}# Summary`, "", "| Field | Value |", "| --- | --- |", `| Title | ${cell(s.title)} (${s.titleLength} chars) |`, `| Meta description | ${cell(s.metaDescription)} (${s.metaDescriptionLength} chars) |`, `| Canonical | ${cell(s.canonical)} |`, `| Indexable | ${s.indexable ? "yes" : "no"}${s.robots.length ? ` (${s.robots.join(", ")})` : ""} |`, `| Language | ${cell(s.lang)} |`, `| H1 | ${s.h1.length ? s.h1.map(cell).join(" / ") : "—"} |`, `| Words | ${s.wordCount} |`, `| Images | ${s.images.total} (${s.images.missingAlt} without alt) |`, `| Links | ${s.links.internal} internal, ${s.links.external} external |`, `| Structured data | ${s.structuredDataTypes.length ? s.structuredDataTypes.join(", ") : "—"} |`, `| Open Graph | ${Object.keys(s.openGraph).length
|
|
57
|
+
? Object.keys(s.openGraph)
|
|
58
|
+
.map((k) => `og:${k}`)
|
|
59
|
+
.join(", ")
|
|
60
|
+
: "—"} |`, "");
|
|
27
61
|
if (audit.performance) {
|
|
28
62
|
const m = audit.performance.metrics;
|
|
29
|
-
lines.push(`${heading}# Lighthouse (${audit.performance.formFactor})
|
|
30
|
-
lines.push('');
|
|
31
|
-
lines.push('| Metric | Value |');
|
|
32
|
-
lines.push('| --- | --- |');
|
|
33
|
-
lines.push(`| Performance score | ${m.performanceScore ?? '—'} |`);
|
|
34
|
-
lines.push(`| SEO score | ${m.seoScore ?? '—'} |`);
|
|
35
|
-
lines.push(`| LCP | ${ms(m.lcpMs)} |`);
|
|
36
|
-
lines.push(`| CLS | ${m.cls === null ? '—' : m.cls.toFixed(3)} |`);
|
|
37
|
-
lines.push(`| TBT | ${ms(m.tbtMs)} |`);
|
|
38
|
-
lines.push(`| FCP | ${ms(m.fcpMs)} |`);
|
|
39
|
-
lines.push(`| Speed Index | ${ms(m.speedIndexMs)} |`);
|
|
40
|
-
lines.push(`| TTFB | ${ms(m.ttfbMs)} |`);
|
|
41
|
-
lines.push('');
|
|
63
|
+
lines.push(`${heading}# Lighthouse (${audit.performance.formFactor})`, "", "| Metric | Value |", "| --- | --- |", `| Performance score | ${m.performanceScore ?? "—"} |`, `| SEO score | ${m.seoScore ?? "—"} |`, `| LCP | ${ms(m.lcpMs)} |`, `| CLS | ${m.cls === null ? "—" : m.cls.toFixed(3)} |`, `| TBT | ${ms(m.tbtMs)} |`, `| FCP | ${ms(m.fcpMs)} |`, `| Speed Index | ${ms(m.speedIndexMs)} |`, `| TTFB | ${ms(m.ttfbMs)} |`, "");
|
|
42
64
|
}
|
|
43
65
|
if (audit.rendering) {
|
|
44
66
|
const r = audit.rendering;
|
|
45
|
-
lines.push(`${heading}# Rendered vs server HTML
|
|
46
|
-
lines.push('');
|
|
47
|
-
lines.push('| Field | Server HTML | Rendered DOM |');
|
|
48
|
-
lines.push('| --- | --- | --- |');
|
|
49
|
-
lines.push(`| Title | ${cell(r.raw.title)} | ${cell(r.rendered.title)} |`);
|
|
50
|
-
lines.push(`| Meta description | ${cell(r.raw.metaDescription)} | ${cell(r.rendered.metaDescription)} |`);
|
|
51
|
-
lines.push(`| Canonical | ${cell(r.raw.canonical)} | ${cell(r.rendered.canonical)} |`);
|
|
52
|
-
lines.push(`| Robots | ${r.raw.robots.join(', ') || '—'} | ${r.rendered.robots.join(', ') || '—'} |`);
|
|
53
|
-
lines.push(`| H1 count | ${r.raw.h1Count} | ${r.rendered.h1Count} |`);
|
|
54
|
-
lines.push(`| Words | ${r.raw.wordCount} | ${r.rendered.wordCount} |`);
|
|
55
|
-
lines.push(`| Internal links | ${r.raw.internalLinks} | ${r.rendered.internalLinks} |`);
|
|
56
|
-
lines.push(`| Structured data items | ${r.raw.structuredDataCount} | ${r.rendered.structuredDataCount} |`);
|
|
57
|
-
lines.push('');
|
|
67
|
+
lines.push(`${heading}# Rendered vs server HTML`, "", "| Field | Server HTML | Rendered DOM |", "| --- | --- | --- |", `| Title | ${cell(r.raw.title)} | ${cell(r.rendered.title)} |`, `| Meta description | ${cell(r.raw.metaDescription)} | ${cell(r.rendered.metaDescription)} |`, `| Canonical | ${cell(r.raw.canonical)} | ${cell(r.rendered.canonical)} |`, `| Robots | ${r.raw.robots.join(", ") || "—"} | ${r.rendered.robots.join(", ") || "—"} |`, `| H1 count | ${r.raw.h1Count} | ${r.rendered.h1Count} |`, `| Words | ${r.raw.wordCount} | ${r.rendered.wordCount} |`, `| Internal links | ${r.raw.internalLinks} | ${r.rendered.internalLinks} |`, `| Structured data items | ${r.raw.structuredDataCount} | ${r.rendered.structuredDataCount} |`, "");
|
|
58
68
|
}
|
|
59
69
|
lines.push(...findingsSection(audit.findings, heading));
|
|
60
|
-
return lines.join(
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
lines
|
|
70
|
+
return lines.join("\n");
|
|
71
|
+
};
|
|
72
|
+
const robotsTxtResult = (audit) => {
|
|
73
|
+
if (!audit.robotsTxt) {
|
|
74
|
+
return "not checked";
|
|
75
|
+
}
|
|
76
|
+
if (audit.robotsTxt.found) {
|
|
77
|
+
return `found (${audit.robotsTxt.sitemaps.length} sitemap(s) declared)`;
|
|
78
|
+
}
|
|
79
|
+
return `not found (HTTP ${audit.robotsTxt.status ?? "n/a"})`;
|
|
80
|
+
};
|
|
81
|
+
const siteMarkdown = (audit) => {
|
|
82
|
+
const lines = [
|
|
83
|
+
`# SEO site audit: ${audit.target}`,
|
|
84
|
+
"",
|
|
85
|
+
`Score **${audit.score}/100** · ${countsLine(audit.counts)} · ${audit.crawl.pagesCrawled} pages audited, ${audit.crawl.pagesDiscovered} discovered${audit.crawl.hitPageLimit ? ` (page limit ${audit.crawl.maxPages} reached)` : ""} · ${(audit.crawl.durationMs / 1000).toFixed(1)} s`,
|
|
86
|
+
"",
|
|
87
|
+
"| Check | Result |",
|
|
88
|
+
"| --- | --- |",
|
|
89
|
+
`| robots.txt | ${robotsTxtResult(audit)} |`,
|
|
90
|
+
`| Sitemaps | ${audit.sitemaps.sources.length ? `${audit.sitemaps.sources.length} file(s), ${audit.sitemaps.urlCount} URLs` : "none found"}${audit.sitemaps.errors.length ? `, ${audit.sitemaps.errors.length} error(s)` : ""} |`,
|
|
91
|
+
"",
|
|
92
|
+
];
|
|
73
93
|
if (audit.siteFindings.length) {
|
|
74
|
-
lines.push(
|
|
75
|
-
|
|
76
|
-
for (const f of audit.siteFindings)
|
|
94
|
+
lines.push("## Site-wide findings", "");
|
|
95
|
+
for (const f of audit.siteFindings) {
|
|
77
96
|
lines.push(...findingLines(f));
|
|
78
|
-
|
|
97
|
+
}
|
|
98
|
+
lines.push("");
|
|
79
99
|
}
|
|
80
100
|
if (audit.issues.length) {
|
|
81
|
-
lines.push(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
lines.push(`| ${i.severity} | \`${i.rule}\` | ${i.pages} | ${i.examples[0] ?? ''} |`);
|
|
87
|
-
lines.push('');
|
|
101
|
+
lines.push("## Page issues by rule", "", "| Severity | Rule | Pages | Example |", "| --- | --- | --- | --- |");
|
|
102
|
+
for (const i of audit.issues) {
|
|
103
|
+
lines.push(`| ${i.severity} | \`${i.rule}\` | ${i.pages} | ${i.examples[0] ?? ""} |`);
|
|
104
|
+
}
|
|
105
|
+
lines.push("");
|
|
88
106
|
}
|
|
89
|
-
lines.push(
|
|
90
|
-
|
|
91
|
-
lines.push('| Score | E/W/I | URL | Title |');
|
|
92
|
-
lines.push('| --- | --- | --- | --- |');
|
|
93
|
-
for (const p of audit.pages)
|
|
107
|
+
lines.push("## Pages", "", "| Score | E/W/I | URL | Title |", "| --- | --- | --- | --- |");
|
|
108
|
+
for (const p of audit.pages) {
|
|
94
109
|
lines.push(`| ${p.score} | ${p.counts.error}/${p.counts.warning}/${p.counts.info} | ${p.url} | ${cell(p.summary.title)} |`);
|
|
95
|
-
|
|
110
|
+
}
|
|
111
|
+
lines.push("");
|
|
96
112
|
const detailed = audit.pages.filter((p) => p.findings.length > 0);
|
|
97
113
|
if (detailed.length) {
|
|
98
|
-
lines.push(
|
|
99
|
-
lines.push('');
|
|
114
|
+
lines.push("## Page details", "");
|
|
100
115
|
for (const p of detailed) {
|
|
101
|
-
lines.push(`### ${p.url}`);
|
|
102
|
-
|
|
103
|
-
lines.push(`Score ${p.score}/100 · ${countsLine(p.counts)}`);
|
|
104
|
-
lines.push('');
|
|
105
|
-
for (const f of p.findings)
|
|
116
|
+
lines.push(`### ${p.url}`, "", `Score ${p.score}/100 · ${countsLine(p.counts)}`, "");
|
|
117
|
+
for (const f of p.findings) {
|
|
106
118
|
lines.push(...findingLines(f));
|
|
107
|
-
|
|
119
|
+
}
|
|
120
|
+
lines.push("");
|
|
108
121
|
}
|
|
109
122
|
}
|
|
110
|
-
return lines.join(
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return lines;
|
|
119
|
-
}
|
|
120
|
-
for (const severity of ['error', 'warning', 'info']) {
|
|
121
|
-
const group = findings.filter((f) => f.severity === severity);
|
|
122
|
-
if (!group.length)
|
|
123
|
-
continue;
|
|
124
|
-
lines.push(`${heading}## ${severity === 'error' ? 'Errors' : severity === 'warning' ? 'Warnings' : 'Info'} (${group.length})`);
|
|
125
|
-
lines.push('');
|
|
126
|
-
for (const f of group)
|
|
127
|
-
lines.push(...findingLines(f));
|
|
128
|
-
lines.push('');
|
|
129
|
-
}
|
|
130
|
-
return lines;
|
|
131
|
-
}
|
|
132
|
-
function findingLines(f) {
|
|
133
|
-
const out = [`- **\`${f.rule}\`** ${f.message}`];
|
|
134
|
-
out.push(` - Fix: ${f.recommendation}`);
|
|
135
|
-
if (f.selector)
|
|
136
|
-
out.push(` - Where: \`${f.selector}\``);
|
|
137
|
-
if (f.evidence && Object.keys(f.evidence).length)
|
|
138
|
-
out.push(` - Evidence: \`${JSON.stringify(f.evidence).slice(0, 400)}\``);
|
|
139
|
-
return out;
|
|
140
|
-
}
|
|
141
|
-
function countsLine(c) {
|
|
142
|
-
return `${c.error} error(s), ${c.warning} warning(s), ${c.info} info`;
|
|
143
|
-
}
|
|
144
|
-
function cell(value) {
|
|
145
|
-
if (!value)
|
|
146
|
-
return '—';
|
|
147
|
-
return value.replace(/\|/g, '\\|').replace(/\n/g, ' ').slice(0, 120);
|
|
148
|
-
}
|
|
149
|
-
function ms(value) {
|
|
150
|
-
return value === null ? '—' : `${Math.round(value)} ms`;
|
|
151
|
-
}
|
|
123
|
+
return lines.join("\n");
|
|
124
|
+
};
|
|
125
|
+
/** One line under every report: which tool and version wrote it, and who makes it. */
|
|
126
|
+
const footer = `_Audited with [agentic-seo-check](${REPOSITORY_URL}) ${VERSION}, made by [${MAKER}](${MAKER_URL})._`;
|
|
127
|
+
export const renderMarkdown = (audit) => {
|
|
128
|
+
const body = audit.kind === "page" ? pageMarkdown(audit) : siteMarkdown(audit);
|
|
129
|
+
return `${body.trimEnd()}\n\n---\n\n${footer}\n`;
|
|
130
|
+
};
|
|
152
131
|
//# sourceMappingURL=markdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../src/core/report/markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../src/core/report/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,MAAM,IAAI,GAAG,CAAC,KAAgC,EAAU,EAAE;IACxD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,EAAE,GAAG,CAAC,KAAoB,EAAU,EAAE,CAC1C,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;AAEnD,MAAM,UAAU,GAAG,CAAC,CAInB,EAAU,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC,OAAO,gBAAgB,CAAC,CAAC,IAAI,OAAO,CAAC;AAE7E,MAAM,YAAY,GAAG,CAAC,CAAU,EAAY,EAAE;IAC5C,MAAM,GAAG,GAAG;QACV,SAAS,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,OAAO,EAAE;QAClC,YAAY,CAAC,CAAC,cAAc,EAAE;KAC/B,CAAC;IAEF,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QACf,GAAG,CAAC,IAAI,CAA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;QACjB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,GAAG,qCAAqC,cAAc,KAAK,OAAO,cAAc,KAAK,KAAK,SAAS,KAAK,CAAC;AAErH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAU,EAAE;IACrD,MAAM,IAAI,GACR,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAEpE,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,cAAc,MAAM,IAAI,CAAC;AACnD,CAAC,CAAC"}
|
package/dist/core/robots.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { FetchOptions } from "./fetch.js";
|
|
2
|
+
import type { RobotsTxtInfo } from "./types.js";
|
|
3
3
|
export interface RobotsResult {
|
|
4
4
|
info: RobotsTxtInfo;
|
|
5
5
|
/** Returns true when crawling the URL is allowed (unknown/missing robots.txt allows everything). */
|
|
6
6
|
allows: (url: string) => boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
9
|
-
export declare
|
|
8
|
+
export declare const buildRobots: (url: string, status: number | null, error: string | undefined, text: string | null, userAgent: string) => RobotsResult;
|
|
9
|
+
export declare const loadRobotsTxt: (origin: string, userAgent: string, options?: FetchOptions) => Promise<RobotsResult>;
|
|
10
10
|
/** Short bot token used for robots.txt matching, derived from the full UA string. */
|
|
11
|
-
export declare
|
|
11
|
+
export declare const robotsUserAgentToken: (userAgent: string) => string;
|
package/dist/core/robots.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { createRequire } from
|
|
2
|
-
import { fetchPage } from
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { fetchPage } from "./fetch.js";
|
|
3
3
|
// robots-parser is CommonJS; require() avoids ESM default-export interop mismatches.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
// SAFETY: require() returns the package's module.exports, which is the parser function that its
|
|
5
|
+
// index.d.ts declares as the default export.
|
|
6
|
+
const robotsParser = createRequire(import.meta.url)("robots-parser");
|
|
7
|
+
export const buildRobots = (url, status, error, text, userAgent) => {
|
|
8
|
+
const info = {
|
|
9
|
+
url,
|
|
10
|
+
status,
|
|
11
|
+
found: text !== null,
|
|
12
|
+
sitemaps: [],
|
|
13
|
+
text: text ? text.slice(0, 20_000) : null,
|
|
14
|
+
};
|
|
15
|
+
if (error) {
|
|
14
16
|
info.error = error;
|
|
17
|
+
}
|
|
15
18
|
if (text === null) {
|
|
16
19
|
return { info, allows: () => true };
|
|
17
20
|
}
|
|
@@ -24,10 +27,22 @@ export function buildRobots(url, status, error, text, userAgent) {
|
|
|
24
27
|
return allowed === undefined ? true : allowed;
|
|
25
28
|
},
|
|
26
29
|
};
|
|
27
|
-
}
|
|
30
|
+
};
|
|
31
|
+
export const loadRobotsTxt = async (origin, userAgent, options = {}) => {
|
|
32
|
+
const url = new URL("/robots.txt", origin).href;
|
|
33
|
+
const res = await fetchPage(url, {
|
|
34
|
+
...options,
|
|
35
|
+
timeoutMs: Math.min(options.timeoutMs ?? 10_000, 10_000),
|
|
36
|
+
});
|
|
37
|
+
const found = res.status === 200 &&
|
|
38
|
+
res.body !== null &&
|
|
39
|
+
!res.error &&
|
|
40
|
+
!/<html/iu.test(res.body.slice(0, 500));
|
|
41
|
+
return buildRobots(url, res.status, res.error, found ? res.body : null, userAgent);
|
|
42
|
+
};
|
|
28
43
|
/** Short bot token used for robots.txt matching, derived from the full UA string. */
|
|
29
|
-
export
|
|
30
|
-
const match = /agentic-seo-check|Googlebot|bingbot/
|
|
44
|
+
export const robotsUserAgentToken = (userAgent) => {
|
|
45
|
+
const match = /agentic-seo-check|Googlebot|bingbot/iu.exec(userAgent);
|
|
31
46
|
return match ? match[0] : userAgent;
|
|
32
|
-
}
|
|
47
|
+
};
|
|
33
48
|
//# sourceMappingURL=robots.js.map
|
package/dist/core/robots.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"robots.js","sourceRoot":"","sources":["../../src/core/robots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"robots.js","sourceRoot":"","sources":["../../src/core/robots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,qFAAqF;AACrF,gGAAgG;AAChG,6CAA6C;AAC7C,MAAM,YAAY,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CACjD,eAAe,CAC0B,CAAC;AAQ5C,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,GAAW,EACX,MAAqB,EACrB,KAAyB,EACzB,IAAmB,EACnB,SAAiB,EACH,EAAE;IAChB,MAAM,IAAI,GAAkB;QAC1B,GAAG;QACH,MAAM;QACN,KAAK,EAAE,IAAI,KAAK,IAAI;QACpB,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;KAC1C,CAAC;IAEF,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC;IAED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AC,SAAiB,EAAU,EAAE;IAChE,MAAM,KAAK,GAAG,uCAAuC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEtE,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare const isLocalHost: (url: string) => boolean;
|
|
2
2
|
export declare const canonicalRules: import("./rule.js").Rule[];
|