@rankcli/agent-runtime 0.0.21 → 0.0.23
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/dist/index.js
CHANGED
|
@@ -71,7 +71,6 @@ async function httpGet(url, config = {}) {
|
|
|
71
71
|
signal: controller.signal,
|
|
72
72
|
redirect: maxRedirects > 0 ? "follow" : "manual"
|
|
73
73
|
});
|
|
74
|
-
clearTimeout(timeoutId);
|
|
75
74
|
const contentType = response.headers.get("content-type") || "";
|
|
76
75
|
let data;
|
|
77
76
|
if (contentType.includes("application/json")) {
|
|
@@ -79,6 +78,7 @@ async function httpGet(url, config = {}) {
|
|
|
79
78
|
} else {
|
|
80
79
|
data = await response.text();
|
|
81
80
|
}
|
|
81
|
+
clearTimeout(timeoutId);
|
|
82
82
|
if (!validateStatus(response.status)) {
|
|
83
83
|
const error = new Error(`Request failed with status ${response.status}`);
|
|
84
84
|
error.response = {
|
|
@@ -170,7 +170,6 @@ async function httpPost(url, data, config = {}) {
|
|
|
170
170
|
body: data ? JSON.stringify(data) : void 0,
|
|
171
171
|
signal: controller.signal
|
|
172
172
|
});
|
|
173
|
-
clearTimeout(timeoutId);
|
|
174
173
|
const contentType = response.headers.get("content-type") || "";
|
|
175
174
|
let responseData;
|
|
176
175
|
if (contentType.includes("application/json")) {
|
|
@@ -178,6 +177,7 @@ async function httpPost(url, data, config = {}) {
|
|
|
178
177
|
} else {
|
|
179
178
|
responseData = await response.text();
|
|
180
179
|
}
|
|
180
|
+
clearTimeout(timeoutId);
|
|
181
181
|
if (!validateStatus(response.status)) {
|
|
182
182
|
const error = new Error(`Request failed with status ${response.status}`);
|
|
183
183
|
error.response = {
|
|
@@ -8443,7 +8443,7 @@ async function checkRobotsTxt(baseUrl) {
|
|
|
8443
8443
|
}
|
|
8444
8444
|
async function checkSitemap(baseUrl, robotsData) {
|
|
8445
8445
|
const issues = [];
|
|
8446
|
-
const sitemapUrls = robotsData.sitemapUrls.length > 0 ? robotsData.sitemapUrls : [
|
|
8446
|
+
const sitemapUrls = robotsData.sitemapUrls.length > 0 ? robotsData.sitemapUrls.slice(0, 3) : [
|
|
8447
8447
|
new URL("/sitemap.xml", baseUrl).href,
|
|
8448
8448
|
new URL("/sitemap_index.xml", baseUrl).href
|
|
8449
8449
|
];
|
|
@@ -17532,9 +17532,22 @@ async function runFullAudit(options) {
|
|
|
17532
17532
|
console.error(`
|
|
17533
17533
|
\u{1F50D} Running comprehensive SEO audit on ${url}...
|
|
17534
17534
|
`);
|
|
17535
|
+
const withTimeout = async (name, promise, timeoutMs) => {
|
|
17536
|
+
let timer;
|
|
17537
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
17538
|
+
timer = setTimeout(() => reject(new Error(`${name} timed out`)), timeoutMs);
|
|
17539
|
+
});
|
|
17540
|
+
try {
|
|
17541
|
+
return await Promise.race([promise, timeoutPromise]);
|
|
17542
|
+
} finally {
|
|
17543
|
+
clearTimeout(timer);
|
|
17544
|
+
}
|
|
17545
|
+
};
|
|
17535
17546
|
console.error("\u{1F4CB} Phase 1: Crawlability checks + page fetch (parallel)...");
|
|
17536
17547
|
const [crawlabilityResult, fetchResult] = await Promise.all([
|
|
17537
|
-
|
|
17548
|
+
// robots.txt, sitemaps and the redirect chain run one after another; a site that is slow
|
|
17549
|
+
// on each could hold the page for minutes, so the whole group gets 45s.
|
|
17550
|
+
withTimeout("Crawlability checks", runCrawlabilityChecks(url), 45e3).catch((err) => {
|
|
17538
17551
|
console.error("Crawlability check failed:", err);
|
|
17539
17552
|
return [];
|
|
17540
17553
|
}),
|
|
@@ -17685,17 +17698,6 @@ async function runFullAudit(options) {
|
|
|
17685
17698
|
}
|
|
17686
17699
|
}
|
|
17687
17700
|
console.error("\u{1F517} Phase 3: Running async checks (parallel)...");
|
|
17688
|
-
const withTimeout = async (name, promise, timeoutMs) => {
|
|
17689
|
-
let timer;
|
|
17690
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
17691
|
-
timer = setTimeout(() => reject(new Error(`${name} timed out`)), timeoutMs);
|
|
17692
|
-
});
|
|
17693
|
-
try {
|
|
17694
|
-
return await Promise.race([promise, timeoutPromise]);
|
|
17695
|
-
} finally {
|
|
17696
|
-
clearTimeout(timer);
|
|
17697
|
-
}
|
|
17698
|
-
};
|
|
17699
17701
|
const safeAsync = async (name, fn, timeoutMs = 1e4) => {
|
|
17700
17702
|
try {
|
|
17701
17703
|
const result = await withTimeout(name, fn(), timeoutMs);
|
|
@@ -18965,7 +18967,7 @@ function formatPRBody(fixes, options) {
|
|
|
18965
18967
|
body += "- [ ] Test social share previews (if OG tags changed)\n";
|
|
18966
18968
|
body += "\n";
|
|
18967
18969
|
body += "---\n";
|
|
18968
|
-
body += "\u{1F916} Generated with [
|
|
18970
|
+
body += "\u{1F916} Generated with [RankCLI](https://rankcli.dev)\n";
|
|
18969
18971
|
return body;
|
|
18970
18972
|
}
|
|
18971
18973
|
function generatePRDescription(fixes, config) {
|
|
@@ -25613,7 +25615,7 @@ function generateMarkdownReport(data) {
|
|
|
25613
25615
|
lines.push("");
|
|
25614
25616
|
lines.push("---");
|
|
25615
25617
|
lines.push("");
|
|
25616
|
-
lines.push("*Generated by [
|
|
25618
|
+
lines.push("*Generated by [RankCLI](https://rankcli.dev) \u{1F916}*");
|
|
25617
25619
|
return lines.join("\n");
|
|
25618
25620
|
}
|
|
25619
25621
|
function generateExecutiveSummary(data) {
|
|
@@ -31990,7 +31992,7 @@ function generateOGFix(context, siteName, url) {
|
|
|
31990
31992
|
skipReason: "OG tags already exist"
|
|
31991
31993
|
};
|
|
31992
31994
|
}
|
|
31993
|
-
const ogTags = `<!--
|
|
31995
|
+
const ogTags = `<!-- RankCLI: Missing OG tags -->
|
|
31994
31996
|
${missingTags.join("\n ")}`;
|
|
31995
31997
|
return {
|
|
31996
31998
|
issue: { code: "MISSING_OG_TAGS", message: "Missing Open Graph tags", severity: "warning" },
|
|
@@ -32828,8 +32830,8 @@ var Schemas = {
|
|
|
32828
32830
|
var import_child_process2 = require("child_process");
|
|
32829
32831
|
var import_util2 = require("util");
|
|
32830
32832
|
var execAsync2 = (0, import_util2.promisify)(import_child_process2.exec);
|
|
32831
|
-
var SYSTEM_NAME = process.env.SEO_SYSTEM_NAME || "
|
|
32832
|
-
var SYSTEM_EMAIL = process.env.SEO_SYSTEM_EMAIL || "bot@
|
|
32833
|
+
var SYSTEM_NAME = process.env.SEO_SYSTEM_NAME || "RankCLI";
|
|
32834
|
+
var SYSTEM_EMAIL = process.env.SEO_SYSTEM_EMAIL || "bot@rankcli.dev";
|
|
32833
32835
|
var CATEGORY_MAPPING2 = {
|
|
32834
32836
|
"crawlability": { type: "fix", scope: "seo" },
|
|
32835
32837
|
"indexability": { type: "fix", scope: "seo" },
|
|
@@ -33251,7 +33253,7 @@ function formatSlackMessage(message) {
|
|
|
33251
33253
|
elements: [
|
|
33252
33254
|
{
|
|
33253
33255
|
type: "mrkdwn",
|
|
33254
|
-
text: `\u{1F916} Sent by
|
|
33256
|
+
text: `\u{1F916} Sent by RankCLI`
|
|
33255
33257
|
}
|
|
33256
33258
|
]
|
|
33257
33259
|
}
|
|
@@ -33287,7 +33289,7 @@ function formatDiscordMessage(message) {
|
|
|
33287
33289
|
color,
|
|
33288
33290
|
url: message.url,
|
|
33289
33291
|
footer: {
|
|
33290
|
-
text: "\u{1F916} Sent by
|
|
33292
|
+
text: "\u{1F916} Sent by RankCLI"
|
|
33291
33293
|
},
|
|
33292
33294
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
33293
33295
|
}
|
|
@@ -33361,7 +33363,7 @@ async function sendAlerts(configs, type, payload) {
|
|
|
33361
33363
|
|
|
33362
33364
|
// src/reports/report-generator.ts
|
|
33363
33365
|
var DEFAULT_BRANDING = {
|
|
33364
|
-
companyName: "
|
|
33366
|
+
companyName: "RankCLI",
|
|
33365
33367
|
primaryColor: "#2563eb",
|
|
33366
33368
|
accentColor: "#10b981"
|
|
33367
33369
|
};
|
|
@@ -33829,7 +33831,7 @@ function generateHTMLReport(data, config = {}) {
|
|
|
33829
33831
|
${branding.contactEmail ? `<p>Contact: <a href="mailto:${branding.contactEmail}">${branding.contactEmail}</a></p>` : ""}
|
|
33830
33832
|
${branding.websiteUrl ? `<p><a href="${branding.websiteUrl}">${branding.websiteUrl}</a></p>` : ""}
|
|
33831
33833
|
</footer>` : `<footer>
|
|
33832
|
-
<p>Generated by <a href="https://
|
|
33834
|
+
<p>Generated by <a href="https://rankcli.dev">RankCLI</a> on ${formatDate(data.timestamp)}</p>
|
|
33833
33835
|
</footer>`;
|
|
33834
33836
|
const categoriesHtml = Object.entries(data.healthScores).filter(([key]) => key !== "overall").map(([key, value]) => `
|
|
33835
33837
|
<div class="category-card">
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
httpGet,
|
|
15
15
|
httpHead,
|
|
16
16
|
httpPost
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NATXE6B3.mjs";
|
|
18
18
|
import {
|
|
19
19
|
AI_CRAWLERS_INFO,
|
|
20
20
|
analyzeCitationReadiness,
|
|
@@ -4924,7 +4924,7 @@ async function checkRobotsTxt(baseUrl) {
|
|
|
4924
4924
|
}
|
|
4925
4925
|
async function checkSitemap2(baseUrl, robotsData) {
|
|
4926
4926
|
const issues = [];
|
|
4927
|
-
const sitemapUrls = robotsData.sitemapUrls.length > 0 ? robotsData.sitemapUrls : [
|
|
4927
|
+
const sitemapUrls = robotsData.sitemapUrls.length > 0 ? robotsData.sitemapUrls.slice(0, 3) : [
|
|
4928
4928
|
new URL("/sitemap.xml", baseUrl).href,
|
|
4929
4929
|
new URL("/sitemap_index.xml", baseUrl).href
|
|
4930
4930
|
];
|
|
@@ -13989,9 +13989,22 @@ async function runFullAudit(options) {
|
|
|
13989
13989
|
console.error(`
|
|
13990
13990
|
\u{1F50D} Running comprehensive SEO audit on ${url}...
|
|
13991
13991
|
`);
|
|
13992
|
+
const withTimeout = async (name, promise, timeoutMs) => {
|
|
13993
|
+
let timer;
|
|
13994
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
13995
|
+
timer = setTimeout(() => reject(new Error(`${name} timed out`)), timeoutMs);
|
|
13996
|
+
});
|
|
13997
|
+
try {
|
|
13998
|
+
return await Promise.race([promise, timeoutPromise]);
|
|
13999
|
+
} finally {
|
|
14000
|
+
clearTimeout(timer);
|
|
14001
|
+
}
|
|
14002
|
+
};
|
|
13992
14003
|
console.error("\u{1F4CB} Phase 1: Crawlability checks + page fetch (parallel)...");
|
|
13993
14004
|
const [crawlabilityResult, fetchResult] = await Promise.all([
|
|
13994
|
-
|
|
14005
|
+
// robots.txt, sitemaps and the redirect chain run one after another; a site that is slow
|
|
14006
|
+
// on each could hold the page for minutes, so the whole group gets 45s.
|
|
14007
|
+
withTimeout("Crawlability checks", runCrawlabilityChecks(url), 45e3).catch((err) => {
|
|
13995
14008
|
console.error("Crawlability check failed:", err);
|
|
13996
14009
|
return [];
|
|
13997
14010
|
}),
|
|
@@ -14142,17 +14155,6 @@ async function runFullAudit(options) {
|
|
|
14142
14155
|
}
|
|
14143
14156
|
}
|
|
14144
14157
|
console.error("\u{1F517} Phase 3: Running async checks (parallel)...");
|
|
14145
|
-
const withTimeout = async (name, promise, timeoutMs) => {
|
|
14146
|
-
let timer;
|
|
14147
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
14148
|
-
timer = setTimeout(() => reject(new Error(`${name} timed out`)), timeoutMs);
|
|
14149
|
-
});
|
|
14150
|
-
try {
|
|
14151
|
-
return await Promise.race([promise, timeoutPromise]);
|
|
14152
|
-
} finally {
|
|
14153
|
-
clearTimeout(timer);
|
|
14154
|
-
}
|
|
14155
|
-
};
|
|
14156
14158
|
const safeAsync = async (name, fn, timeoutMs = 1e4) => {
|
|
14157
14159
|
try {
|
|
14158
14160
|
const result = await withTimeout(name, fn(), timeoutMs);
|
|
@@ -15422,7 +15424,7 @@ function formatPRBody(fixes, options) {
|
|
|
15422
15424
|
body += "- [ ] Test social share previews (if OG tags changed)\n";
|
|
15423
15425
|
body += "\n";
|
|
15424
15426
|
body += "---\n";
|
|
15425
|
-
body += "\u{1F916} Generated with [
|
|
15427
|
+
body += "\u{1F916} Generated with [RankCLI](https://rankcli.dev)\n";
|
|
15426
15428
|
return body;
|
|
15427
15429
|
}
|
|
15428
15430
|
function generatePRDescription(fixes, config) {
|
|
@@ -22064,7 +22066,7 @@ function generateMarkdownReport(data) {
|
|
|
22064
22066
|
lines.push("");
|
|
22065
22067
|
lines.push("---");
|
|
22066
22068
|
lines.push("");
|
|
22067
|
-
lines.push("*Generated by [
|
|
22069
|
+
lines.push("*Generated by [RankCLI](https://rankcli.dev) \u{1F916}*");
|
|
22068
22070
|
return lines.join("\n");
|
|
22069
22071
|
}
|
|
22070
22072
|
function generateExecutiveSummary(data) {
|
|
@@ -23037,7 +23039,7 @@ async function executeAgent(agent, options = {}) {
|
|
|
23037
23039
|
}
|
|
23038
23040
|
}
|
|
23039
23041
|
async function runDirectAnalysis(url) {
|
|
23040
|
-
const { analyzeUrl: analyzeUrl2 } = await import("./analyzer-
|
|
23042
|
+
const { analyzeUrl: analyzeUrl2 } = await import("./analyzer-MCBRQHB7.mjs");
|
|
23041
23043
|
const result = await analyzeUrl2({ url });
|
|
23042
23044
|
if (!result.success || !result.data) {
|
|
23043
23045
|
throw new Error(result.error || "Analysis failed");
|
|
@@ -28435,7 +28437,7 @@ function generateOGFix(context, siteName, url) {
|
|
|
28435
28437
|
skipReason: "OG tags already exist"
|
|
28436
28438
|
};
|
|
28437
28439
|
}
|
|
28438
|
-
const ogTags = `<!--
|
|
28440
|
+
const ogTags = `<!-- RankCLI: Missing OG tags -->
|
|
28439
28441
|
${missingTags.join("\n ")}`;
|
|
28440
28442
|
return {
|
|
28441
28443
|
issue: { code: "MISSING_OG_TAGS", message: "Missing Open Graph tags", severity: "warning" },
|
|
@@ -29273,8 +29275,8 @@ var Schemas = {
|
|
|
29273
29275
|
import { execSync, exec as exec2 } from "child_process";
|
|
29274
29276
|
import { promisify as promisify2 } from "util";
|
|
29275
29277
|
var execAsync2 = promisify2(exec2);
|
|
29276
|
-
var SYSTEM_NAME = process.env.SEO_SYSTEM_NAME || "
|
|
29277
|
-
var SYSTEM_EMAIL = process.env.SEO_SYSTEM_EMAIL || "bot@
|
|
29278
|
+
var SYSTEM_NAME = process.env.SEO_SYSTEM_NAME || "RankCLI";
|
|
29279
|
+
var SYSTEM_EMAIL = process.env.SEO_SYSTEM_EMAIL || "bot@rankcli.dev";
|
|
29278
29280
|
var CATEGORY_MAPPING2 = {
|
|
29279
29281
|
"crawlability": { type: "fix", scope: "seo" },
|
|
29280
29282
|
"indexability": { type: "fix", scope: "seo" },
|
|
@@ -29696,7 +29698,7 @@ function formatSlackMessage(message) {
|
|
|
29696
29698
|
elements: [
|
|
29697
29699
|
{
|
|
29698
29700
|
type: "mrkdwn",
|
|
29699
|
-
text: `\u{1F916} Sent by
|
|
29701
|
+
text: `\u{1F916} Sent by RankCLI`
|
|
29700
29702
|
}
|
|
29701
29703
|
]
|
|
29702
29704
|
}
|
|
@@ -29732,7 +29734,7 @@ function formatDiscordMessage(message) {
|
|
|
29732
29734
|
color,
|
|
29733
29735
|
url: message.url,
|
|
29734
29736
|
footer: {
|
|
29735
|
-
text: "\u{1F916} Sent by
|
|
29737
|
+
text: "\u{1F916} Sent by RankCLI"
|
|
29736
29738
|
},
|
|
29737
29739
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
29738
29740
|
}
|
|
@@ -29806,7 +29808,7 @@ async function sendAlerts(configs, type, payload) {
|
|
|
29806
29808
|
|
|
29807
29809
|
// src/reports/report-generator.ts
|
|
29808
29810
|
var DEFAULT_BRANDING = {
|
|
29809
|
-
companyName: "
|
|
29811
|
+
companyName: "RankCLI",
|
|
29810
29812
|
primaryColor: "#2563eb",
|
|
29811
29813
|
accentColor: "#10b981"
|
|
29812
29814
|
};
|
|
@@ -30274,7 +30276,7 @@ function generateHTMLReport(data, config = {}) {
|
|
|
30274
30276
|
${branding.contactEmail ? `<p>Contact: <a href="mailto:${branding.contactEmail}">${branding.contactEmail}</a></p>` : ""}
|
|
30275
30277
|
${branding.websiteUrl ? `<p><a href="${branding.websiteUrl}">${branding.websiteUrl}</a></p>` : ""}
|
|
30276
30278
|
</footer>` : `<footer>
|
|
30277
|
-
<p>Generated by <a href="https://
|
|
30279
|
+
<p>Generated by <a href="https://rankcli.dev">RankCLI</a> on ${formatDate(data.timestamp)}</p>
|
|
30278
30280
|
</footer>`;
|
|
30279
30281
|
const categoriesHtml = Object.entries(data.healthScores).filter(([key]) => key !== "overall").map(([key, value]) => `
|
|
30280
30282
|
<div class="category-card">
|
package/package.json
CHANGED
|
@@ -41,7 +41,6 @@ async function httpGet(url, config = {}) {
|
|
|
41
41
|
signal: controller.signal,
|
|
42
42
|
redirect: maxRedirects > 0 ? "follow" : "manual"
|
|
43
43
|
});
|
|
44
|
-
clearTimeout(timeoutId);
|
|
45
44
|
const contentType = response.headers.get("content-type") || "";
|
|
46
45
|
let data;
|
|
47
46
|
if (contentType.includes("application/json")) {
|
|
@@ -49,6 +48,7 @@ async function httpGet(url, config = {}) {
|
|
|
49
48
|
} else {
|
|
50
49
|
data = await response.text();
|
|
51
50
|
}
|
|
51
|
+
clearTimeout(timeoutId);
|
|
52
52
|
if (!validateStatus(response.status)) {
|
|
53
53
|
const error = new Error(`Request failed with status ${response.status}`);
|
|
54
54
|
error.response = {
|
|
@@ -140,7 +140,6 @@ async function httpPost(url, data, config = {}) {
|
|
|
140
140
|
body: data ? JSON.stringify(data) : void 0,
|
|
141
141
|
signal: controller.signal
|
|
142
142
|
});
|
|
143
|
-
clearTimeout(timeoutId);
|
|
144
143
|
const contentType = response.headers.get("content-type") || "";
|
|
145
144
|
let responseData;
|
|
146
145
|
if (contentType.includes("application/json")) {
|
|
@@ -148,6 +147,7 @@ async function httpPost(url, data, config = {}) {
|
|
|
148
147
|
} else {
|
|
149
148
|
responseData = await response.text();
|
|
150
149
|
}
|
|
150
|
+
clearTimeout(timeoutId);
|
|
151
151
|
if (!validateStatus(response.status)) {
|
|
152
152
|
const error = new Error(`Request failed with status ${response.status}`);
|
|
153
153
|
error.response = {
|