@rankcli/cli 0.0.27 → 0.0.29
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/{chunk-NF755NKY.mjs → chunk-N4BQT53D.mjs} +3 -2
- package/dist/index.js +56 -95
- package/dist/index.mjs +54 -94
- package/dist/wasm-engine.js +3 -2
- package/dist/wasm-engine.mjs +1 -1
- package/package.json +2 -2
|
@@ -10,6 +10,7 @@ import * as vm from "vm";
|
|
|
10
10
|
import * as path from "path";
|
|
11
11
|
import * as fs from "fs";
|
|
12
12
|
import * as os from "os";
|
|
13
|
+
var SEA_MODULE_SPECIFIER = "node:sea";
|
|
13
14
|
var PREMIUM_CHECK_NAMES = [
|
|
14
15
|
"analyzeFeaturedSnippet",
|
|
15
16
|
"analyzeInternalLinkGraph",
|
|
@@ -37,7 +38,7 @@ var wasmModule = null;
|
|
|
37
38
|
var auditContext = null;
|
|
38
39
|
async function loadWasm() {
|
|
39
40
|
if (wasmModule) return wasmModule;
|
|
40
|
-
const sea = __require(
|
|
41
|
+
const sea = __require(SEA_MODULE_SPECIFIER);
|
|
41
42
|
if (sea.isSea()) {
|
|
42
43
|
const gluePath = extractSeaWasmAssets();
|
|
43
44
|
const dynamicRequire = __require("module").createRequire(gluePath);
|
|
@@ -61,7 +62,7 @@ Searched: ${possiblePaths.join(", ")}`
|
|
|
61
62
|
);
|
|
62
63
|
}
|
|
63
64
|
function extractSeaWasmAssets() {
|
|
64
|
-
const sea = __require(
|
|
65
|
+
const sea = __require(SEA_MODULE_SPECIFIER);
|
|
65
66
|
const dir = path.join(os.tmpdir(), "rankcli-wasm-sea");
|
|
66
67
|
fs.mkdirSync(dir, { recursive: true });
|
|
67
68
|
const glueAsset = sea.getRawAsset("rankcli_audit_engine.js");
|
package/dist/index.js
CHANGED
|
@@ -1221,6 +1221,7 @@ var vm = __toESM(require("vm"));
|
|
|
1221
1221
|
var path2 = __toESM(require("path"));
|
|
1222
1222
|
var fs2 = __toESM(require("fs"));
|
|
1223
1223
|
var os = __toESM(require("os"));
|
|
1224
|
+
var SEA_MODULE_SPECIFIER = "node:sea";
|
|
1224
1225
|
var PREMIUM_CHECK_NAMES = [
|
|
1225
1226
|
"analyzeFeaturedSnippet",
|
|
1226
1227
|
"analyzeInternalLinkGraph",
|
|
@@ -1248,7 +1249,7 @@ var wasmModule = null;
|
|
|
1248
1249
|
var auditContext = null;
|
|
1249
1250
|
async function loadWasm() {
|
|
1250
1251
|
if (wasmModule) return wasmModule;
|
|
1251
|
-
const sea = require(
|
|
1252
|
+
const sea = require(SEA_MODULE_SPECIFIER);
|
|
1252
1253
|
if (sea.isSea()) {
|
|
1253
1254
|
const gluePath = extractSeaWasmAssets();
|
|
1254
1255
|
const dynamicRequire = require("module").createRequire(gluePath);
|
|
@@ -1272,7 +1273,7 @@ Searched: ${possiblePaths.join(", ")}`
|
|
|
1272
1273
|
);
|
|
1273
1274
|
}
|
|
1274
1275
|
function extractSeaWasmAssets() {
|
|
1275
|
-
const sea = require(
|
|
1276
|
+
const sea = require(SEA_MODULE_SPECIFIER);
|
|
1276
1277
|
const dir = path2.join(os.tmpdir(), "rankcli-wasm-sea");
|
|
1277
1278
|
fs2.mkdirSync(dir, { recursive: true });
|
|
1278
1279
|
const glueAsset = sea.getRawAsset("rankcli_audit_engine.js");
|
|
@@ -1381,6 +1382,10 @@ async function getPremiumChecks() {
|
|
|
1381
1382
|
return checks;
|
|
1382
1383
|
}
|
|
1383
1384
|
|
|
1385
|
+
// src/models.ts
|
|
1386
|
+
var OPENAI_FAST = "gpt-5.6-luna";
|
|
1387
|
+
var ANTHROPIC_FAST = "claude-haiku-4-5-20251001";
|
|
1388
|
+
|
|
1384
1389
|
// src/commands/audit.ts
|
|
1385
1390
|
var { detectFramework: detectFramework2, getFrameworkDisplayName } = import_agent_runtime2.frameworks;
|
|
1386
1391
|
async function fetchHtml(url, timeout = 1e4) {
|
|
@@ -1404,7 +1409,7 @@ async function fetchHtml(url, timeout = 1e4) {
|
|
|
1404
1409
|
}
|
|
1405
1410
|
}
|
|
1406
1411
|
var AI_PROVIDER_DEFAULTS = {
|
|
1407
|
-
openai: { baseUrl: "https://api.openai.com/v1", model:
|
|
1412
|
+
openai: { baseUrl: "https://api.openai.com/v1", model: OPENAI_FAST },
|
|
1408
1413
|
openrouter: { baseUrl: "https://openrouter.ai/api/v1", model: "deepseek/deepseek-r1:free" },
|
|
1409
1414
|
groq: { baseUrl: "https://api.groq.com/openai/v1", model: "llama-3.3-70b-versatile" },
|
|
1410
1415
|
gemini: { baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai", model: "gemini-2.0-flash" }
|
|
@@ -1437,7 +1442,7 @@ Return JSON with:
|
|
|
1437
1442
|
headers["x-api-key"] = apiKey;
|
|
1438
1443
|
headers["anthropic-version"] = "2023-06-01";
|
|
1439
1444
|
body = JSON.stringify({
|
|
1440
|
-
model:
|
|
1445
|
+
model: ANTHROPIC_FAST,
|
|
1441
1446
|
max_tokens: 1500,
|
|
1442
1447
|
messages: [{ role: "user", content: prompt }]
|
|
1443
1448
|
});
|
|
@@ -1453,7 +1458,8 @@ Return JSON with:
|
|
|
1453
1458
|
{ role: "system", content: "You are an SEO expert. Respond with valid JSON only." },
|
|
1454
1459
|
{ role: "user", content: prompt }
|
|
1455
1460
|
],
|
|
1456
|
-
max_tokens
|
|
1461
|
+
// OpenAI's GPT-5.6 rejects max_tokens; other OpenAI-compatible servers still expect it.
|
|
1462
|
+
...provider === "openai" ? { max_completion_tokens: 1500 } : { max_tokens: 1500 },
|
|
1457
1463
|
// json_object mode is an OpenAI-specific extension - Groq supports
|
|
1458
1464
|
// it too, but not every OpenAI-compatible server does, so only
|
|
1459
1465
|
// request it for providers confirmed to support it.
|
|
@@ -1492,101 +1498,56 @@ function mergeIssues(issueArrays) {
|
|
|
1492
1498
|
return Array.from(issueMap.values());
|
|
1493
1499
|
}
|
|
1494
1500
|
async function syncToCloud(url, report, mergedIssues, pagesAudited, aiAnalysis, durationMs, checksRun) {
|
|
1495
|
-
|
|
1496
|
-
if (
|
|
1497
|
-
|
|
1498
|
-
|
|
1501
|
+
let authHeader = null;
|
|
1502
|
+
if (isApiKeyAuth()) {
|
|
1503
|
+
const apiKey = getApiKey();
|
|
1504
|
+
if (apiKey) authHeader = { "X-API-Key": apiKey };
|
|
1505
|
+
} else {
|
|
1506
|
+
const session = await getSession();
|
|
1507
|
+
if (session) authHeader = { Authorization: `Bearer ${session.access_token}` };
|
|
1508
|
+
}
|
|
1509
|
+
if (!authHeader) return null;
|
|
1510
|
+
const score = report.healthScore?.overall || 0;
|
|
1511
|
+
const healthScores = {
|
|
1512
|
+
overall: score,
|
|
1513
|
+
crawlability: report.healthScore?.crawlability || 0,
|
|
1514
|
+
onPage: report.healthScore?.onPage || 0,
|
|
1515
|
+
content: report.healthScore?.content || 0,
|
|
1516
|
+
performance: report.healthScore?.performance || 0,
|
|
1517
|
+
security: report.healthScore?.security || 0,
|
|
1518
|
+
localSeo: report.healthScore?.localSeo || 0,
|
|
1519
|
+
aiReadiness: report.healthScore?.aiReadiness || 0
|
|
1520
|
+
};
|
|
1499
1521
|
try {
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
if (existingProject) {
|
|
1505
|
-
projectId = existingProject.id;
|
|
1506
|
-
} else {
|
|
1507
|
-
const { count } = await supabase.from("projects").select("id", { count: "exact", head: true }).eq("user_id", userId).eq("is_active", true);
|
|
1508
|
-
const limit = sitesLimit ?? 1;
|
|
1509
|
-
if (count !== null && count >= limit) {
|
|
1510
|
-
console.log(import_chalk4.default.yellow(`
|
|
1511
|
-
\u26A0\uFE0F Project limit reached (${count}/${limit})`));
|
|
1512
|
-
console.log(import_chalk4.default.dim(` Upgrade at: ${WEB_APP_URL}/account`));
|
|
1513
|
-
return null;
|
|
1514
|
-
}
|
|
1515
|
-
const { data: newProject, error: projectError } = await supabase.from("projects").insert({
|
|
1516
|
-
user_id: userId,
|
|
1517
|
-
name: domain,
|
|
1522
|
+
const res = await fetch(`${getApiUrl()}/functions/v1/sync-audit`, {
|
|
1523
|
+
method: "POST",
|
|
1524
|
+
headers: { "Content-Type": "application/json", ...authHeader },
|
|
1525
|
+
body: JSON.stringify({
|
|
1518
1526
|
url,
|
|
1519
|
-
|
|
1520
|
-
}).select("id").single();
|
|
1521
|
-
if (projectError || !newProject) {
|
|
1522
|
-
console.error(import_chalk4.default.dim("Failed to create project"));
|
|
1523
|
-
return null;
|
|
1524
|
-
}
|
|
1525
|
-
projectId = newProject.id;
|
|
1526
|
-
}
|
|
1527
|
-
const score = report.healthScore?.overall || 0;
|
|
1528
|
-
const healthScores = {
|
|
1529
|
-
overall: score,
|
|
1530
|
-
crawlability: report.healthScore?.crawlability || 0,
|
|
1531
|
-
onPage: report.healthScore?.onPage || 0,
|
|
1532
|
-
content: report.healthScore?.content || 0,
|
|
1533
|
-
performance: report.healthScore?.performance || 0,
|
|
1534
|
-
security: report.healthScore?.security || 0,
|
|
1535
|
-
localSeo: report.healthScore?.localSeo || 0,
|
|
1536
|
-
aiReadiness: report.healthScore?.aiReadiness || 0
|
|
1537
|
-
};
|
|
1538
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
1539
|
-
const { data: audit2, error: auditError } = await supabase.from("audits").insert({
|
|
1540
|
-
project_id: projectId,
|
|
1541
|
-
triggered_by: "cli",
|
|
1542
|
-
triggered_by_user: userId,
|
|
1543
|
-
status: "completed",
|
|
1544
|
-
score,
|
|
1545
|
-
pages_crawled: pagesAudited,
|
|
1546
|
-
issues_found: mergedIssues.length,
|
|
1547
|
-
checks_run: checksRun,
|
|
1548
|
-
health_scores: healthScores,
|
|
1549
|
-
started_at: new Date(Date.now() - durationMs).toISOString(),
|
|
1550
|
-
completed_at: now,
|
|
1551
|
-
duration_ms: durationMs,
|
|
1552
|
-
summary: {
|
|
1553
|
-
errors: mergedIssues.filter((i) => i.severity === "error").length,
|
|
1554
|
-
warnings: mergedIssues.filter((i) => i.severity === "warning").length,
|
|
1555
|
-
notices: mergedIssues.filter((i) => i.severity === "notice").length,
|
|
1527
|
+
issues: mergedIssues,
|
|
1556
1528
|
pagesAudited,
|
|
1557
1529
|
checksRun,
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1530
|
+
durationMs,
|
|
1531
|
+
healthScores,
|
|
1532
|
+
aiAnalysis
|
|
1533
|
+
})
|
|
1534
|
+
});
|
|
1535
|
+
const data = await res.json();
|
|
1536
|
+
if (!res.ok) {
|
|
1537
|
+
if (data.error === "project_limit_reached") {
|
|
1538
|
+
console.log(import_chalk4.default.yellow(`
|
|
1539
|
+
\u26A0\uFE0F Project limit reached (${data.count}/${data.limit})`));
|
|
1540
|
+
console.log(import_chalk4.default.dim(` Upgrade at: ${WEB_APP_URL}/account`));
|
|
1541
|
+
} else {
|
|
1542
|
+
console.error(import_chalk4.default.dim(data.error || "Cloud sync failed"));
|
|
1543
|
+
}
|
|
1564
1544
|
return null;
|
|
1565
1545
|
}
|
|
1566
|
-
if (
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
severity: issue.severity,
|
|
1572
|
-
category: issue.category,
|
|
1573
|
-
title: issue.title,
|
|
1574
|
-
description: issue.description || "",
|
|
1575
|
-
impact: issue.impact || "",
|
|
1576
|
-
how_to_fix: issue.howToFix || "",
|
|
1577
|
-
affected_urls: issue.affectedUrls || [],
|
|
1578
|
-
details: issue.details || {},
|
|
1579
|
-
status: "open"
|
|
1580
|
-
}));
|
|
1581
|
-
await supabase.from("audit_issues").insert(issueRecords);
|
|
1582
|
-
}
|
|
1583
|
-
await supabase.from("projects").update({
|
|
1584
|
-
last_audit_at: now,
|
|
1585
|
-
last_audit_score: score,
|
|
1586
|
-
last_scheduled_audit_at: now,
|
|
1587
|
-
scheduled_audit_source: "cli"
|
|
1588
|
-
}).eq("id", projectId);
|
|
1589
|
-
return { projectId, auditId: audit2.id };
|
|
1546
|
+
if (!data.projectId || !data.auditId) {
|
|
1547
|
+
console.error(import_chalk4.default.dim("Cloud sync returned an unexpected response"));
|
|
1548
|
+
return null;
|
|
1549
|
+
}
|
|
1550
|
+
return { projectId: data.projectId, auditId: data.auditId };
|
|
1590
1551
|
} catch (error) {
|
|
1591
1552
|
console.error(import_chalk4.default.dim("Cloud sync failed"));
|
|
1592
1553
|
return null;
|
|
@@ -3602,7 +3563,7 @@ async function testWebhook(channel, webhookUrl) {
|
|
|
3602
3563
|
}
|
|
3603
3564
|
|
|
3604
3565
|
// src/version.ts
|
|
3605
|
-
var VERSION = "0.0.
|
|
3566
|
+
var VERSION = "0.0.29";
|
|
3606
3567
|
|
|
3607
3568
|
// src/index.ts
|
|
3608
3569
|
var program = new import_commander.Command();
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getPremiumChecks,
|
|
4
4
|
initEngine
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-N4BQT53D.mjs";
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
8
|
import { Command } from "commander";
|
|
@@ -1203,6 +1203,10 @@ function hasFeature(tier, feature) {
|
|
|
1203
1203
|
return limits?.features?.[feature] ?? false;
|
|
1204
1204
|
}
|
|
1205
1205
|
|
|
1206
|
+
// src/models.ts
|
|
1207
|
+
var OPENAI_FAST = "gpt-5.6-luna";
|
|
1208
|
+
var ANTHROPIC_FAST = "claude-haiku-4-5-20251001";
|
|
1209
|
+
|
|
1206
1210
|
// src/commands/audit.ts
|
|
1207
1211
|
var { detectFramework: detectFramework2, getFrameworkDisplayName } = frameworks;
|
|
1208
1212
|
async function fetchHtml(url, timeout = 1e4) {
|
|
@@ -1226,7 +1230,7 @@ async function fetchHtml(url, timeout = 1e4) {
|
|
|
1226
1230
|
}
|
|
1227
1231
|
}
|
|
1228
1232
|
var AI_PROVIDER_DEFAULTS = {
|
|
1229
|
-
openai: { baseUrl: "https://api.openai.com/v1", model:
|
|
1233
|
+
openai: { baseUrl: "https://api.openai.com/v1", model: OPENAI_FAST },
|
|
1230
1234
|
openrouter: { baseUrl: "https://openrouter.ai/api/v1", model: "deepseek/deepseek-r1:free" },
|
|
1231
1235
|
groq: { baseUrl: "https://api.groq.com/openai/v1", model: "llama-3.3-70b-versatile" },
|
|
1232
1236
|
gemini: { baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai", model: "gemini-2.0-flash" }
|
|
@@ -1259,7 +1263,7 @@ Return JSON with:
|
|
|
1259
1263
|
headers["x-api-key"] = apiKey;
|
|
1260
1264
|
headers["anthropic-version"] = "2023-06-01";
|
|
1261
1265
|
body = JSON.stringify({
|
|
1262
|
-
model:
|
|
1266
|
+
model: ANTHROPIC_FAST,
|
|
1263
1267
|
max_tokens: 1500,
|
|
1264
1268
|
messages: [{ role: "user", content: prompt }]
|
|
1265
1269
|
});
|
|
@@ -1275,7 +1279,8 @@ Return JSON with:
|
|
|
1275
1279
|
{ role: "system", content: "You are an SEO expert. Respond with valid JSON only." },
|
|
1276
1280
|
{ role: "user", content: prompt }
|
|
1277
1281
|
],
|
|
1278
|
-
max_tokens
|
|
1282
|
+
// OpenAI's GPT-5.6 rejects max_tokens; other OpenAI-compatible servers still expect it.
|
|
1283
|
+
...provider === "openai" ? { max_completion_tokens: 1500 } : { max_tokens: 1500 },
|
|
1279
1284
|
// json_object mode is an OpenAI-specific extension - Groq supports
|
|
1280
1285
|
// it too, but not every OpenAI-compatible server does, so only
|
|
1281
1286
|
// request it for providers confirmed to support it.
|
|
@@ -1314,101 +1319,56 @@ function mergeIssues(issueArrays) {
|
|
|
1314
1319
|
return Array.from(issueMap.values());
|
|
1315
1320
|
}
|
|
1316
1321
|
async function syncToCloud(url, report, mergedIssues, pagesAudited, aiAnalysis, durationMs, checksRun) {
|
|
1317
|
-
|
|
1318
|
-
if (
|
|
1319
|
-
|
|
1320
|
-
|
|
1322
|
+
let authHeader = null;
|
|
1323
|
+
if (isApiKeyAuth()) {
|
|
1324
|
+
const apiKey = getApiKey();
|
|
1325
|
+
if (apiKey) authHeader = { "X-API-Key": apiKey };
|
|
1326
|
+
} else {
|
|
1327
|
+
const session = await getSession();
|
|
1328
|
+
if (session) authHeader = { Authorization: `Bearer ${session.access_token}` };
|
|
1329
|
+
}
|
|
1330
|
+
if (!authHeader) return null;
|
|
1331
|
+
const score = report.healthScore?.overall || 0;
|
|
1332
|
+
const healthScores = {
|
|
1333
|
+
overall: score,
|
|
1334
|
+
crawlability: report.healthScore?.crawlability || 0,
|
|
1335
|
+
onPage: report.healthScore?.onPage || 0,
|
|
1336
|
+
content: report.healthScore?.content || 0,
|
|
1337
|
+
performance: report.healthScore?.performance || 0,
|
|
1338
|
+
security: report.healthScore?.security || 0,
|
|
1339
|
+
localSeo: report.healthScore?.localSeo || 0,
|
|
1340
|
+
aiReadiness: report.healthScore?.aiReadiness || 0
|
|
1341
|
+
};
|
|
1321
1342
|
try {
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
if (existingProject) {
|
|
1327
|
-
projectId = existingProject.id;
|
|
1328
|
-
} else {
|
|
1329
|
-
const { count } = await supabase.from("projects").select("id", { count: "exact", head: true }).eq("user_id", userId).eq("is_active", true);
|
|
1330
|
-
const limit = sitesLimit ?? 1;
|
|
1331
|
-
if (count !== null && count >= limit) {
|
|
1332
|
-
console.log(chalk4.yellow(`
|
|
1333
|
-
\u26A0\uFE0F Project limit reached (${count}/${limit})`));
|
|
1334
|
-
console.log(chalk4.dim(` Upgrade at: ${WEB_APP_URL}/account`));
|
|
1335
|
-
return null;
|
|
1336
|
-
}
|
|
1337
|
-
const { data: newProject, error: projectError } = await supabase.from("projects").insert({
|
|
1338
|
-
user_id: userId,
|
|
1339
|
-
name: domain,
|
|
1343
|
+
const res = await fetch(`${getApiUrl()}/functions/v1/sync-audit`, {
|
|
1344
|
+
method: "POST",
|
|
1345
|
+
headers: { "Content-Type": "application/json", ...authHeader },
|
|
1346
|
+
body: JSON.stringify({
|
|
1340
1347
|
url,
|
|
1341
|
-
|
|
1342
|
-
}).select("id").single();
|
|
1343
|
-
if (projectError || !newProject) {
|
|
1344
|
-
console.error(chalk4.dim("Failed to create project"));
|
|
1345
|
-
return null;
|
|
1346
|
-
}
|
|
1347
|
-
projectId = newProject.id;
|
|
1348
|
-
}
|
|
1349
|
-
const score = report.healthScore?.overall || 0;
|
|
1350
|
-
const healthScores = {
|
|
1351
|
-
overall: score,
|
|
1352
|
-
crawlability: report.healthScore?.crawlability || 0,
|
|
1353
|
-
onPage: report.healthScore?.onPage || 0,
|
|
1354
|
-
content: report.healthScore?.content || 0,
|
|
1355
|
-
performance: report.healthScore?.performance || 0,
|
|
1356
|
-
security: report.healthScore?.security || 0,
|
|
1357
|
-
localSeo: report.healthScore?.localSeo || 0,
|
|
1358
|
-
aiReadiness: report.healthScore?.aiReadiness || 0
|
|
1359
|
-
};
|
|
1360
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
1361
|
-
const { data: audit2, error: auditError } = await supabase.from("audits").insert({
|
|
1362
|
-
project_id: projectId,
|
|
1363
|
-
triggered_by: "cli",
|
|
1364
|
-
triggered_by_user: userId,
|
|
1365
|
-
status: "completed",
|
|
1366
|
-
score,
|
|
1367
|
-
pages_crawled: pagesAudited,
|
|
1368
|
-
issues_found: mergedIssues.length,
|
|
1369
|
-
checks_run: checksRun,
|
|
1370
|
-
health_scores: healthScores,
|
|
1371
|
-
started_at: new Date(Date.now() - durationMs).toISOString(),
|
|
1372
|
-
completed_at: now,
|
|
1373
|
-
duration_ms: durationMs,
|
|
1374
|
-
summary: {
|
|
1375
|
-
errors: mergedIssues.filter((i) => i.severity === "error").length,
|
|
1376
|
-
warnings: mergedIssues.filter((i) => i.severity === "warning").length,
|
|
1377
|
-
notices: mergedIssues.filter((i) => i.severity === "notice").length,
|
|
1348
|
+
issues: mergedIssues,
|
|
1378
1349
|
pagesAudited,
|
|
1379
1350
|
checksRun,
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1351
|
+
durationMs,
|
|
1352
|
+
healthScores,
|
|
1353
|
+
aiAnalysis
|
|
1354
|
+
})
|
|
1355
|
+
});
|
|
1356
|
+
const data = await res.json();
|
|
1357
|
+
if (!res.ok) {
|
|
1358
|
+
if (data.error === "project_limit_reached") {
|
|
1359
|
+
console.log(chalk4.yellow(`
|
|
1360
|
+
\u26A0\uFE0F Project limit reached (${data.count}/${data.limit})`));
|
|
1361
|
+
console.log(chalk4.dim(` Upgrade at: ${WEB_APP_URL}/account`));
|
|
1362
|
+
} else {
|
|
1363
|
+
console.error(chalk4.dim(data.error || "Cloud sync failed"));
|
|
1364
|
+
}
|
|
1386
1365
|
return null;
|
|
1387
1366
|
}
|
|
1388
|
-
if (
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
severity: issue.severity,
|
|
1394
|
-
category: issue.category,
|
|
1395
|
-
title: issue.title,
|
|
1396
|
-
description: issue.description || "",
|
|
1397
|
-
impact: issue.impact || "",
|
|
1398
|
-
how_to_fix: issue.howToFix || "",
|
|
1399
|
-
affected_urls: issue.affectedUrls || [],
|
|
1400
|
-
details: issue.details || {},
|
|
1401
|
-
status: "open"
|
|
1402
|
-
}));
|
|
1403
|
-
await supabase.from("audit_issues").insert(issueRecords);
|
|
1404
|
-
}
|
|
1405
|
-
await supabase.from("projects").update({
|
|
1406
|
-
last_audit_at: now,
|
|
1407
|
-
last_audit_score: score,
|
|
1408
|
-
last_scheduled_audit_at: now,
|
|
1409
|
-
scheduled_audit_source: "cli"
|
|
1410
|
-
}).eq("id", projectId);
|
|
1411
|
-
return { projectId, auditId: audit2.id };
|
|
1367
|
+
if (!data.projectId || !data.auditId) {
|
|
1368
|
+
console.error(chalk4.dim("Cloud sync returned an unexpected response"));
|
|
1369
|
+
return null;
|
|
1370
|
+
}
|
|
1371
|
+
return { projectId: data.projectId, auditId: data.auditId };
|
|
1412
1372
|
} catch (error) {
|
|
1413
1373
|
console.error(chalk4.dim("Cloud sync failed"));
|
|
1414
1374
|
return null;
|
|
@@ -3459,7 +3419,7 @@ async function testWebhook(channel, webhookUrl) {
|
|
|
3459
3419
|
}
|
|
3460
3420
|
|
|
3461
3421
|
// src/version.ts
|
|
3462
|
-
var VERSION = "0.0.
|
|
3422
|
+
var VERSION = "0.0.29";
|
|
3463
3423
|
|
|
3464
3424
|
// src/index.ts
|
|
3465
3425
|
var program = new Command();
|
package/dist/wasm-engine.js
CHANGED
|
@@ -40,6 +40,7 @@ var vm = __toESM(require("vm"));
|
|
|
40
40
|
var path = __toESM(require("path"));
|
|
41
41
|
var fs = __toESM(require("fs"));
|
|
42
42
|
var os = __toESM(require("os"));
|
|
43
|
+
var SEA_MODULE_SPECIFIER = "node:sea";
|
|
43
44
|
var PREMIUM_CHECK_NAMES = [
|
|
44
45
|
"analyzeFeaturedSnippet",
|
|
45
46
|
"analyzeInternalLinkGraph",
|
|
@@ -67,7 +68,7 @@ var wasmModule = null;
|
|
|
67
68
|
var auditContext = null;
|
|
68
69
|
async function loadWasm() {
|
|
69
70
|
if (wasmModule) return wasmModule;
|
|
70
|
-
const sea = require(
|
|
71
|
+
const sea = require(SEA_MODULE_SPECIFIER);
|
|
71
72
|
if (sea.isSea()) {
|
|
72
73
|
const gluePath = extractSeaWasmAssets();
|
|
73
74
|
const dynamicRequire = require("module").createRequire(gluePath);
|
|
@@ -91,7 +92,7 @@ Searched: ${possiblePaths.join(", ")}`
|
|
|
91
92
|
);
|
|
92
93
|
}
|
|
93
94
|
function extractSeaWasmAssets() {
|
|
94
|
-
const sea = require(
|
|
95
|
+
const sea = require(SEA_MODULE_SPECIFIER);
|
|
95
96
|
const dir = path.join(os.tmpdir(), "rankcli-wasm-sea");
|
|
96
97
|
fs.mkdirSync(dir, { recursive: true });
|
|
97
98
|
const glueAsset = sea.getRawAsset("rankcli_audit_engine.js");
|
package/dist/wasm-engine.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rankcli/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "RankCLI - Ship code, get ranked. SEO meets CI/CD.",
|
|
5
5
|
"homepage": "https://rankcli.dev",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"update-version": "node scripts/update-version.js"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@rankcli/agent-runtime": "^0.0.
|
|
48
|
+
"@rankcli/agent-runtime": "^0.0.20",
|
|
49
49
|
"@supabase/supabase-js": "^2.98.0",
|
|
50
50
|
"chalk": "^5.3.0",
|
|
51
51
|
"commander": "^12.0.0",
|