@ainyc/canonry 3.2.1 → 3.2.4
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/assets/assets/index-B8epngdo.js +302 -0
- package/assets/assets/index-CQGbgHZY.css +1 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-TUXS2Y6C.js → chunk-PS7JRDL3.js} +18 -9
- package/dist/{chunk-QJPPK4WW.js → chunk-X5ZTFJ37.js} +107 -26
- package/dist/cli.js +12 -6
- package/dist/index.js +2 -2
- package/dist/mcp.js +1 -1
- package/package.json +10 -10
- package/assets/assets/index-D6R1HCPk.js +0 -302
- package/assets/assets/index-DZm9xxNs.css +0 -1
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
visibilityStateFromAnswerMentioned,
|
|
63
63
|
windowCutoff,
|
|
64
64
|
wordpressEnvSchema
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-PS7JRDL3.js";
|
|
66
66
|
import {
|
|
67
67
|
IntelligenceService,
|
|
68
68
|
agentMemory,
|
|
@@ -8695,6 +8695,7 @@ function gaLog(level, action, ctx) {
|
|
|
8695
8695
|
stream.write(JSON.stringify(entry) + "\n");
|
|
8696
8696
|
}
|
|
8697
8697
|
function formatSharePct(numerator, total) {
|
|
8698
|
+
if (numerator > 0 && total <= 0) return "\u2014";
|
|
8698
8699
|
if (total <= 0 || numerator <= 0) return "0%";
|
|
8699
8700
|
const pct = numerator / total * 100;
|
|
8700
8701
|
const rounded = Math.round(pct);
|
|
@@ -8895,10 +8896,10 @@ async function ga4Routes(app, opts) {
|
|
|
8895
8896
|
if (only !== void 0 && !validOnlyValues.includes(only)) {
|
|
8896
8897
|
throw validationError(`Invalid "only" value "${only}". Must be one of: ${validOnlyValues.join(", ")}`);
|
|
8897
8898
|
}
|
|
8898
|
-
const syncTraffic =
|
|
8899
|
+
const syncTraffic = true;
|
|
8900
|
+
const syncSummary = true;
|
|
8899
8901
|
const syncAi = !only || only === "ai";
|
|
8900
8902
|
const syncSocial = !only || only === "social";
|
|
8901
|
-
const syncSummary = !only;
|
|
8902
8903
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
8903
8904
|
const runId = crypto16.randomUUID();
|
|
8904
8905
|
app.db.insert(runs).values({
|
|
@@ -9021,7 +9022,12 @@ async function ga4Routes(app, opts) {
|
|
|
9021
9022
|
}
|
|
9022
9023
|
});
|
|
9023
9024
|
app.db.update(runs).set({ status: RunStatuses.completed, finishedAt: now }).where(eq20(runs.id, runId)).run();
|
|
9024
|
-
const syncedComponents = only ? [
|
|
9025
|
+
const syncedComponents = only ? [
|
|
9026
|
+
...syncTraffic ? ["traffic"] : [],
|
|
9027
|
+
...syncSummary ? ["summary"] : [],
|
|
9028
|
+
...syncAi ? ["ai"] : [],
|
|
9029
|
+
...syncSocial ? ["social"] : []
|
|
9030
|
+
] : void 0;
|
|
9025
9031
|
gaLog("info", "sync.complete", {
|
|
9026
9032
|
projectId: project.id,
|
|
9027
9033
|
runId,
|
|
@@ -11033,7 +11039,7 @@ async function wordpressRoutes(app, opts) {
|
|
|
11033
11039
|
|
|
11034
11040
|
// ../api-routes/src/backlinks.ts
|
|
11035
11041
|
import crypto18 from "crypto";
|
|
11036
|
-
import { and as
|
|
11042
|
+
import { and as and10, asc as asc2, desc as desc10, eq as eq21, sql as sql6 } from "drizzle-orm";
|
|
11037
11043
|
|
|
11038
11044
|
// ../integration-commoncrawl/src/constants.ts
|
|
11039
11045
|
import os2 from "os";
|
|
@@ -11429,6 +11435,35 @@ function pruneCachedRelease(release, opts = {}) {
|
|
|
11429
11435
|
fs5.rmSync(dir, { recursive: true, force: true });
|
|
11430
11436
|
}
|
|
11431
11437
|
|
|
11438
|
+
// ../api-routes/src/backlinks-filter.ts
|
|
11439
|
+
import { and as and9, ne, notLike } from "drizzle-orm";
|
|
11440
|
+
var BACKLINK_FILTER_PATTERNS = [
|
|
11441
|
+
"*.google.com",
|
|
11442
|
+
"*.googleusercontent.com",
|
|
11443
|
+
"*.translate.goog",
|
|
11444
|
+
"*.bing.com",
|
|
11445
|
+
"*.yandex.com",
|
|
11446
|
+
"*.yandex.ru",
|
|
11447
|
+
"*.baidu.com",
|
|
11448
|
+
"*.duckduckgo.com",
|
|
11449
|
+
"*.archive.org"
|
|
11450
|
+
];
|
|
11451
|
+
function backlinkCrawlerExclusionClause() {
|
|
11452
|
+
const conditions = [];
|
|
11453
|
+
for (const pattern of BACKLINK_FILTER_PATTERNS) {
|
|
11454
|
+
if (pattern.startsWith("*.")) {
|
|
11455
|
+
const suffix = pattern.slice(2);
|
|
11456
|
+
conditions.push(ne(backlinkDomains.linkingDomain, suffix));
|
|
11457
|
+
conditions.push(notLike(backlinkDomains.linkingDomain, `%.${suffix}`));
|
|
11458
|
+
} else {
|
|
11459
|
+
conditions.push(ne(backlinkDomains.linkingDomain, pattern));
|
|
11460
|
+
}
|
|
11461
|
+
}
|
|
11462
|
+
const combined = and9(...conditions);
|
|
11463
|
+
if (!combined) throw new Error("BACKLINK_FILTER_PATTERNS is unexpectedly empty");
|
|
11464
|
+
return combined;
|
|
11465
|
+
}
|
|
11466
|
+
|
|
11432
11467
|
// ../api-routes/src/backlinks.ts
|
|
11433
11468
|
var BACKLINKS_UNSUPPORTED_MESSAGE = "Backlinks sync and install are only available from a local canonry install. Run `canonry backlinks install` locally to use this feature.";
|
|
11434
11469
|
var NON_TERMINAL_SYNC_STATUSES = /* @__PURE__ */ new Set([
|
|
@@ -11485,9 +11520,47 @@ function mapRunRow(row) {
|
|
|
11485
11520
|
};
|
|
11486
11521
|
}
|
|
11487
11522
|
function latestSummaryForProject(db, projectId, release) {
|
|
11488
|
-
const condition = release ?
|
|
11523
|
+
const condition = release ? and10(eq21(backlinkSummaries.projectId, projectId), eq21(backlinkSummaries.release, release)) : eq21(backlinkSummaries.projectId, projectId);
|
|
11489
11524
|
return db.select().from(backlinkSummaries).where(condition).orderBy(desc10(backlinkSummaries.queriedAt)).limit(1).get();
|
|
11490
11525
|
}
|
|
11526
|
+
function parseExcludeCrawlers(value) {
|
|
11527
|
+
if (!value) return false;
|
|
11528
|
+
const lower = value.toLowerCase();
|
|
11529
|
+
return lower === "1" || lower === "true" || lower === "yes";
|
|
11530
|
+
}
|
|
11531
|
+
function computeFilteredSummary(db, base) {
|
|
11532
|
+
const baseDomainCondition = and10(
|
|
11533
|
+
eq21(backlinkDomains.projectId, base.projectId),
|
|
11534
|
+
eq21(backlinkDomains.release, base.release)
|
|
11535
|
+
);
|
|
11536
|
+
const filteredCondition = and10(baseDomainCondition, backlinkCrawlerExclusionClause());
|
|
11537
|
+
const unfilteredAgg = db.select({
|
|
11538
|
+
count: sql6`count(*)`,
|
|
11539
|
+
total: sql6`coalesce(sum(${backlinkDomains.numHosts}), 0)`
|
|
11540
|
+
}).from(backlinkDomains).where(baseDomainCondition).get();
|
|
11541
|
+
const filteredAgg = db.select({
|
|
11542
|
+
count: sql6`count(*)`,
|
|
11543
|
+
total: sql6`coalesce(sum(${backlinkDomains.numHosts}), 0)`
|
|
11544
|
+
}).from(backlinkDomains).where(filteredCondition).get();
|
|
11545
|
+
const top10Rows = db.select({ numHosts: backlinkDomains.numHosts }).from(backlinkDomains).where(filteredCondition).orderBy(desc10(backlinkDomains.numHosts)).limit(10).all();
|
|
11546
|
+
const totalLinkingDomains = Number(filteredAgg?.count ?? 0);
|
|
11547
|
+
const totalHosts = Number(filteredAgg?.total ?? 0);
|
|
11548
|
+
const unfilteredLinkingDomains = Number(unfilteredAgg?.count ?? 0);
|
|
11549
|
+
const unfilteredHosts = Number(unfilteredAgg?.total ?? 0);
|
|
11550
|
+
const top10Sum = top10Rows.reduce((sum, r) => sum + r.numHosts, 0);
|
|
11551
|
+
const top10Share = totalHosts > 0 ? top10Sum / totalHosts : 0;
|
|
11552
|
+
return {
|
|
11553
|
+
projectId: base.projectId,
|
|
11554
|
+
release: base.release,
|
|
11555
|
+
targetDomain: base.targetDomain,
|
|
11556
|
+
totalLinkingDomains,
|
|
11557
|
+
totalHosts,
|
|
11558
|
+
top10HostsShare: top10Share.toFixed(6),
|
|
11559
|
+
queriedAt: base.queriedAt,
|
|
11560
|
+
excludedLinkingDomains: Math.max(0, unfilteredLinkingDomains - totalLinkingDomains),
|
|
11561
|
+
excludedHosts: Math.max(0, unfilteredHosts - totalHosts)
|
|
11562
|
+
};
|
|
11563
|
+
}
|
|
11491
11564
|
async function backlinksRoutes(app, opts) {
|
|
11492
11565
|
app.get("/backlinks/status", async (_request, reply) => {
|
|
11493
11566
|
if (!opts.getBacklinksStatus) {
|
|
@@ -11620,7 +11693,9 @@ async function backlinksRoutes(app, opts) {
|
|
|
11620
11693
|
async (request, reply) => {
|
|
11621
11694
|
const project = resolveProject(app.db, request.params.name);
|
|
11622
11695
|
const row = latestSummaryForProject(app.db, project.id, request.query.release);
|
|
11623
|
-
return reply.send(
|
|
11696
|
+
if (!row) return reply.send(null);
|
|
11697
|
+
const excludeCrawlers = parseExcludeCrawlers(request.query.excludeCrawlers);
|
|
11698
|
+
return reply.send(excludeCrawlers ? computeFilteredSummary(app.db, row) : mapSummaryRow(row));
|
|
11624
11699
|
}
|
|
11625
11700
|
);
|
|
11626
11701
|
app.get("/projects/:name/backlinks/domains", async (request, reply) => {
|
|
@@ -11633,17 +11708,23 @@ async function backlinksRoutes(app, opts) {
|
|
|
11633
11708
|
}
|
|
11634
11709
|
const limit = Math.min(Math.max(parseInt(request.query.limit ?? "50", 10) || 50, 1), 500);
|
|
11635
11710
|
const offset = Math.max(parseInt(request.query.offset ?? "0", 10) || 0, 0);
|
|
11636
|
-
const
|
|
11711
|
+
const excludeCrawlers = parseExcludeCrawlers(request.query.excludeCrawlers);
|
|
11712
|
+
const baseDomainCondition = and10(
|
|
11637
11713
|
eq21(backlinkDomains.projectId, project.id),
|
|
11638
11714
|
eq21(backlinkDomains.release, targetRelease)
|
|
11639
11715
|
);
|
|
11716
|
+
const domainCondition = excludeCrawlers ? and10(baseDomainCondition, backlinkCrawlerExclusionClause()) : baseDomainCondition;
|
|
11640
11717
|
const totalRow = app.db.select({ count: sql6`count(*)` }).from(backlinkDomains).where(domainCondition).get();
|
|
11641
11718
|
const rows = app.db.select({
|
|
11642
11719
|
linkingDomain: backlinkDomains.linkingDomain,
|
|
11643
11720
|
numHosts: backlinkDomains.numHosts
|
|
11644
11721
|
}).from(backlinkDomains).where(domainCondition).orderBy(desc10(backlinkDomains.numHosts)).limit(limit).offset(offset).all();
|
|
11722
|
+
let summary = null;
|
|
11723
|
+
if (summaryRow) {
|
|
11724
|
+
summary = excludeCrawlers ? computeFilteredSummary(app.db, summaryRow) : mapSummaryRow(summaryRow);
|
|
11725
|
+
}
|
|
11645
11726
|
const response = {
|
|
11646
|
-
summary
|
|
11727
|
+
summary,
|
|
11647
11728
|
total: Number(totalRow?.count ?? 0),
|
|
11648
11729
|
rows
|
|
11649
11730
|
};
|
|
@@ -14997,7 +15078,7 @@ import crypto19 from "crypto";
|
|
|
14997
15078
|
import fs7 from "fs";
|
|
14998
15079
|
import path9 from "path";
|
|
14999
15080
|
import os4 from "os";
|
|
15000
|
-
import { and as
|
|
15081
|
+
import { and as and11, eq as eq22, inArray as inArray5, sql as sql7 } from "drizzle-orm";
|
|
15001
15082
|
|
|
15002
15083
|
// src/citation-utils.ts
|
|
15003
15084
|
function domainMatches(domain, canonicalDomain) {
|
|
@@ -15281,7 +15362,7 @@ var JobRunner = class {
|
|
|
15281
15362
|
throw new Error(`Run ${runId} is not executable from status '${existingRun.status}'`);
|
|
15282
15363
|
}
|
|
15283
15364
|
if (existingRun.status === "queued") {
|
|
15284
|
-
this.db.update(runs).set({ status: "running", startedAt: now }).where(
|
|
15365
|
+
this.db.update(runs).set({ status: "running", startedAt: now }).where(and11(eq22(runs.id, runId), eq22(runs.status, "queued"))).run();
|
|
15285
15366
|
}
|
|
15286
15367
|
this.throwIfRunCancelled(runId);
|
|
15287
15368
|
const project = this.db.select().from(projects).where(eq22(projects.id, projectId)).get();
|
|
@@ -15584,7 +15665,7 @@ function getCurrentUsageDay() {
|
|
|
15584
15665
|
|
|
15585
15666
|
// src/gsc-sync.ts
|
|
15586
15667
|
import crypto20 from "crypto";
|
|
15587
|
-
import { eq as eq23, and as
|
|
15668
|
+
import { eq as eq23, and as and12, sql as sql8 } from "drizzle-orm";
|
|
15588
15669
|
var log2 = createLogger("GscSync");
|
|
15589
15670
|
function formatDate2(d) {
|
|
15590
15671
|
return d.toISOString().split("T")[0];
|
|
@@ -15636,7 +15717,7 @@ async function executeGscSync(db, runId, projectId, opts) {
|
|
|
15636
15717
|
});
|
|
15637
15718
|
log2.info("fetch.complete", { runId, projectId, rowCount: rows.length });
|
|
15638
15719
|
db.delete(gscSearchData).where(
|
|
15639
|
-
|
|
15720
|
+
and12(
|
|
15640
15721
|
eq23(gscSearchData.projectId, projectId),
|
|
15641
15722
|
sql8`${gscSearchData.date} >= ${startDate}`,
|
|
15642
15723
|
sql8`${gscSearchData.date} <= ${endDate}`
|
|
@@ -15725,7 +15806,7 @@ async function executeGscSync(db, runId, projectId, opts) {
|
|
|
15725
15806
|
}
|
|
15726
15807
|
}
|
|
15727
15808
|
const snapshotDate = formatDate2(/* @__PURE__ */ new Date());
|
|
15728
|
-
db.delete(gscCoverageSnapshots).where(
|
|
15809
|
+
db.delete(gscCoverageSnapshots).where(and12(eq23(gscCoverageSnapshots.projectId, projectId), eq23(gscCoverageSnapshots.date, snapshotDate))).run();
|
|
15729
15810
|
db.insert(gscCoverageSnapshots).values({
|
|
15730
15811
|
id: crypto20.randomUUID(),
|
|
15731
15812
|
projectId,
|
|
@@ -15748,7 +15829,7 @@ async function executeGscSync(db, runId, projectId, opts) {
|
|
|
15748
15829
|
|
|
15749
15830
|
// src/gsc-inspect-sitemap.ts
|
|
15750
15831
|
import crypto21 from "crypto";
|
|
15751
|
-
import { eq as eq24, and as
|
|
15832
|
+
import { eq as eq24, and as and13 } from "drizzle-orm";
|
|
15752
15833
|
|
|
15753
15834
|
// src/sitemap-parser.ts
|
|
15754
15835
|
var log3 = createLogger("SitemapParser");
|
|
@@ -15964,7 +16045,7 @@ async function executeInspectSitemap(db, runId, projectId, opts) {
|
|
|
15964
16045
|
}
|
|
15965
16046
|
}
|
|
15966
16047
|
const snapshotDate = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
15967
|
-
db.delete(gscCoverageSnapshots).where(
|
|
16048
|
+
db.delete(gscCoverageSnapshots).where(and13(eq24(gscCoverageSnapshots.projectId, projectId), eq24(gscCoverageSnapshots.date, snapshotDate))).run();
|
|
15968
16049
|
db.insert(gscCoverageSnapshots).values({
|
|
15969
16050
|
id: crypto21.randomUUID(),
|
|
15970
16051
|
projectId,
|
|
@@ -16175,7 +16256,7 @@ async function executeBingInspectSitemap(db, runId, projectId, opts) {
|
|
|
16175
16256
|
// src/commoncrawl-sync.ts
|
|
16176
16257
|
import crypto23 from "crypto";
|
|
16177
16258
|
import path10 from "path";
|
|
16178
|
-
import { and as
|
|
16259
|
+
import { and as and14, eq as eq26, sql as sql9 } from "drizzle-orm";
|
|
16179
16260
|
var log6 = createLogger("CommonCrawlSync");
|
|
16180
16261
|
var INSERT_CHUNK_SIZE = 1e4;
|
|
16181
16262
|
function defaultDeps() {
|
|
@@ -16366,7 +16447,7 @@ function computeSummary(rows) {
|
|
|
16366
16447
|
// src/backlink-extract.ts
|
|
16367
16448
|
import crypto24 from "crypto";
|
|
16368
16449
|
import fs8 from "fs";
|
|
16369
|
-
import { and as
|
|
16450
|
+
import { and as and15, desc as desc12, eq as eq27 } from "drizzle-orm";
|
|
16370
16451
|
var log7 = createLogger("BacklinkExtract");
|
|
16371
16452
|
function defaultDeps2() {
|
|
16372
16453
|
return {
|
|
@@ -16412,7 +16493,7 @@ async function executeBacklinkExtract(db, runId, projectId, opts = {}) {
|
|
|
16412
16493
|
const targetDomain = project.canonicalDomain;
|
|
16413
16494
|
db.transaction((tx) => {
|
|
16414
16495
|
tx.delete(backlinkDomains).where(
|
|
16415
|
-
|
|
16496
|
+
and15(eq27(backlinkDomains.projectId, projectId), eq27(backlinkDomains.release, release))
|
|
16416
16497
|
).run();
|
|
16417
16498
|
if (rows.length > 0) {
|
|
16418
16499
|
const values = rows.map((r) => ({
|
|
@@ -16668,7 +16749,7 @@ var Scheduler = class {
|
|
|
16668
16749
|
};
|
|
16669
16750
|
|
|
16670
16751
|
// src/notifier.ts
|
|
16671
|
-
import { eq as eq29, desc as desc13, and as
|
|
16752
|
+
import { eq as eq29, desc as desc13, and as and16, or as or3 } from "drizzle-orm";
|
|
16672
16753
|
import crypto25 from "crypto";
|
|
16673
16754
|
var log9 = createLogger("Notifier");
|
|
16674
16755
|
var Notifier = class {
|
|
@@ -16774,7 +16855,7 @@ var Notifier = class {
|
|
|
16774
16855
|
}
|
|
16775
16856
|
computeTransitions(runId, projectId) {
|
|
16776
16857
|
const recentRuns = this.db.select().from(runs).where(
|
|
16777
|
-
|
|
16858
|
+
and16(
|
|
16778
16859
|
eq29(runs.projectId, projectId),
|
|
16779
16860
|
or3(eq29(runs.status, "completed"), eq29(runs.status, "partial"))
|
|
16780
16861
|
)
|
|
@@ -17260,7 +17341,7 @@ function resolveSessionProviderAndModel(config, opts) {
|
|
|
17260
17341
|
|
|
17261
17342
|
// src/agent/memory-store.ts
|
|
17262
17343
|
import crypto26 from "crypto";
|
|
17263
|
-
import { and as
|
|
17344
|
+
import { and as and17, desc as desc14, eq as eq30, like as like2, sql as sql10 } from "drizzle-orm";
|
|
17264
17345
|
var COMPACTION_KEY_PREFIX = "compaction:";
|
|
17265
17346
|
var COMPACTION_NOTES_PER_SESSION = 3;
|
|
17266
17347
|
function rowToDto(row) {
|
|
@@ -17305,12 +17386,12 @@ function upsertMemoryEntry(db, args) {
|
|
|
17305
17386
|
updatedAt: now
|
|
17306
17387
|
}
|
|
17307
17388
|
}).run();
|
|
17308
|
-
const row = db.select().from(agentMemory).where(
|
|
17389
|
+
const row = db.select().from(agentMemory).where(and17(eq30(agentMemory.projectId, args.projectId), eq30(agentMemory.key, args.key))).get();
|
|
17309
17390
|
if (!row) throw new Error("memory upsert produced no row");
|
|
17310
17391
|
return rowToDto(row);
|
|
17311
17392
|
}
|
|
17312
17393
|
function deleteMemoryEntry(db, projectId, key) {
|
|
17313
|
-
const result = db.delete(agentMemory).where(
|
|
17394
|
+
const result = db.delete(agentMemory).where(and17(eq30(agentMemory.projectId, projectId), eq30(agentMemory.key, key))).run();
|
|
17314
17395
|
const changes = result.changes ?? 0;
|
|
17315
17396
|
return changes > 0;
|
|
17316
17397
|
}
|
|
@@ -17339,7 +17420,7 @@ function writeCompactionNote(db, args) {
|
|
|
17339
17420
|
}).run();
|
|
17340
17421
|
const sessionPrefix = `${COMPACTION_KEY_PREFIX}${args.sessionId}:`;
|
|
17341
17422
|
const existing = tx.select({ id: agentMemory.id, updatedAt: agentMemory.updatedAt }).from(agentMemory).where(
|
|
17342
|
-
|
|
17423
|
+
and17(
|
|
17343
17424
|
eq30(agentMemory.projectId, args.projectId),
|
|
17344
17425
|
like2(agentMemory.key, `${sessionPrefix}%`)
|
|
17345
17426
|
)
|
|
@@ -17348,7 +17429,7 @@ function writeCompactionNote(db, args) {
|
|
|
17348
17429
|
if (stale.length > 0) {
|
|
17349
17430
|
tx.delete(agentMemory).where(sql10`${agentMemory.id} IN (${sql10.join(stale.map((s) => sql10`${s}`), sql10`, `)})`).run();
|
|
17350
17431
|
}
|
|
17351
|
-
const row = tx.select().from(agentMemory).where(
|
|
17432
|
+
const row = tx.select().from(agentMemory).where(and17(eq30(agentMemory.projectId, args.projectId), eq30(agentMemory.key, key))).get();
|
|
17352
17433
|
if (row) inserted = rowToDto(row);
|
|
17353
17434
|
});
|
|
17354
17435
|
if (!inserted) throw new Error("compaction note write produced no row");
|
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
setGoogleAuthConfig,
|
|
18
18
|
showFirstRunNotice,
|
|
19
19
|
trackEvent
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-X5ZTFJ37.js";
|
|
21
21
|
import {
|
|
22
22
|
CcReleaseSyncStatuses,
|
|
23
23
|
CheckScopes,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
saveConfig,
|
|
46
46
|
saveConfigPatch,
|
|
47
47
|
usageError
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-PS7JRDL3.js";
|
|
49
49
|
import {
|
|
50
50
|
apiKeys,
|
|
51
51
|
competitors,
|
|
@@ -728,6 +728,9 @@ function formatSummaryAndDomains(project, response) {
|
|
|
728
728
|
lines.push(`Linking domains: ${s.totalLinkingDomains}`);
|
|
729
729
|
lines.push(`Total hosts: ${s.totalHosts}`);
|
|
730
730
|
lines.push(`Top-10 share: ${s.top10HostsShare}`);
|
|
731
|
+
if (s.excludedLinkingDomains !== void 0 && s.excludedLinkingDomains > 0) {
|
|
732
|
+
lines.push(`Excluded: ${s.excludedLinkingDomains} crawler/proxy domains (${s.excludedHosts ?? 0} hosts)`);
|
|
733
|
+
}
|
|
731
734
|
if (response.rows.length > 0) {
|
|
732
735
|
lines.push("");
|
|
733
736
|
lines.push(`Top ${response.rows.length} linking domains (of ${response.total}):`);
|
|
@@ -861,7 +864,8 @@ async function backlinksList(opts) {
|
|
|
861
864
|
const client = getClient();
|
|
862
865
|
const response = await client.backlinksDomains(opts.project, {
|
|
863
866
|
limit: opts.limit ?? 50,
|
|
864
|
-
release: opts.release
|
|
867
|
+
release: opts.release,
|
|
868
|
+
excludeCrawlers: opts.excludeCrawlers
|
|
865
869
|
});
|
|
866
870
|
if (opts.format === "json") {
|
|
867
871
|
printJson(response);
|
|
@@ -943,16 +947,17 @@ var BACKLINKS_CLI_COMMANDS = [
|
|
|
943
947
|
},
|
|
944
948
|
{
|
|
945
949
|
path: ["backlinks", "list"],
|
|
946
|
-
usage: "canonry backlinks list <project> [--limit <n>] [--release <id>] [--format json]",
|
|
950
|
+
usage: "canonry backlinks list <project> [--limit <n>] [--release <id>] [--exclude-crawlers] [--format json]",
|
|
947
951
|
options: {
|
|
948
952
|
limit: stringOption(),
|
|
949
|
-
release: stringOption()
|
|
953
|
+
release: stringOption(),
|
|
954
|
+
"exclude-crawlers": { type: "boolean" }
|
|
950
955
|
},
|
|
951
956
|
run: async (input) => {
|
|
952
957
|
const project = requireProject(
|
|
953
958
|
input,
|
|
954
959
|
"backlinks list",
|
|
955
|
-
"canonry backlinks list <project> [--limit <n>] [--release <id>]"
|
|
960
|
+
"canonry backlinks list <project> [--limit <n>] [--release <id>] [--exclude-crawlers]"
|
|
956
961
|
);
|
|
957
962
|
const limit = parseIntegerOption(input, "limit", {
|
|
958
963
|
message: "--limit must be an integer",
|
|
@@ -963,6 +968,7 @@ var BACKLINKS_CLI_COMMANDS = [
|
|
|
963
968
|
project,
|
|
964
969
|
limit,
|
|
965
970
|
release: getString(input.values, "release"),
|
|
971
|
+
excludeCrawlers: getBoolean(input.values, "exclude-crawlers"),
|
|
966
972
|
format: input.format
|
|
967
973
|
});
|
|
968
974
|
}
|
package/dist/index.js
CHANGED
package/dist/mcp.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainyc/canonry",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent-first open-source AEO operating platform - track how answer engines cite your domain",
|
|
6
6
|
"license": "FSL-1.1-ALv2",
|
|
@@ -59,21 +59,21 @@
|
|
|
59
59
|
"@types/node-cron": "^3.0.11",
|
|
60
60
|
"tsup": "^8.5.1",
|
|
61
61
|
"tsx": "^4.19.0",
|
|
62
|
-
"@ainyc/canonry-config": "0.0.0",
|
|
63
62
|
"@ainyc/canonry-api-routes": "0.0.0",
|
|
64
|
-
"@ainyc/canonry-
|
|
63
|
+
"@ainyc/canonry-config": "0.0.0",
|
|
64
|
+
"@ainyc/canonry-contracts": "0.0.0",
|
|
65
|
+
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
65
66
|
"@ainyc/canonry-intelligence": "0.0.0",
|
|
67
|
+
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
68
|
+
"@ainyc/canonry-db": "0.0.0",
|
|
66
69
|
"@ainyc/canonry-integration-google": "0.0.0",
|
|
67
70
|
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
68
|
-
"@ainyc/canonry-contracts": "0.0.0",
|
|
69
|
-
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
70
|
-
"@ainyc/canonry-provider-cdp": "0.0.0",
|
|
71
|
-
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
72
|
-
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
73
71
|
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
74
|
-
"@ainyc/canonry-provider-
|
|
72
|
+
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
75
73
|
"@ainyc/canonry-provider-perplexity": "0.0.0",
|
|
76
|
-
"@ainyc/canonry-provider-
|
|
74
|
+
"@ainyc/canonry-provider-local": "0.0.0",
|
|
75
|
+
"@ainyc/canonry-provider-openai": "0.0.0",
|
|
76
|
+
"@ainyc/canonry-provider-cdp": "0.0.0"
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|
|
79
79
|
"build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",
|