aeorank 1.5.0 → 2.0.0

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.d.cts CHANGED
@@ -117,6 +117,93 @@ interface AuditResult extends AuditData {
117
117
  */
118
118
  declare function audit(domain: string, options?: AuditOptions): Promise<AuditResult>;
119
119
 
120
+ /**
121
+ * Link graph analysis for full-site AEO audits.
122
+ * Builds an internal link graph, detects orphan pages, pillar pages,
123
+ * hub pages, and topic clusters from crawled page data.
124
+ */
125
+
126
+ interface LinkEdge {
127
+ source: string;
128
+ target: string;
129
+ anchorText: string;
130
+ }
131
+ interface PageNode {
132
+ url: string;
133
+ title: string;
134
+ wordCount: number;
135
+ category: PageCategory;
136
+ inDegree: number;
137
+ outDegree: number;
138
+ depth: number;
139
+ isPillar: boolean;
140
+ isHub: boolean;
141
+ isOrphan: boolean;
142
+ }
143
+ interface TopicCluster {
144
+ pillarUrl: string;
145
+ pillarTitle: string;
146
+ spokes: string[];
147
+ cohesion: number;
148
+ }
149
+ interface LinkGraphStats {
150
+ totalPages: number;
151
+ totalEdges: number;
152
+ orphanPages: number;
153
+ pillarPages: number;
154
+ hubPages: number;
155
+ avgDepth: number;
156
+ maxDepth: number;
157
+ clusters: number;
158
+ }
159
+ interface LinkGraph {
160
+ nodes: Map<string, PageNode>;
161
+ edges: LinkEdge[];
162
+ stats: LinkGraphStats;
163
+ clusters: TopicCluster[];
164
+ }
165
+ interface SerializedLinkGraph {
166
+ nodes: PageNode[];
167
+ stats: LinkGraphStats;
168
+ clusters: TopicCluster[];
169
+ }
170
+ declare function serializeLinkGraph(graph: LinkGraph): SerializedLinkGraph;
171
+ /**
172
+ * Extract internal links from HTML with their anchor text.
173
+ * Similar to extractInternalLinks in full-site-crawler.ts but returns LinkEdge[].
174
+ */
175
+ declare function extractLinksWithAnchors(html: string, sourceUrl: string, domain: string): LinkEdge[];
176
+ /**
177
+ * BFS from homepage to compute click depth for each node.
178
+ * Unreachable pages get Infinity.
179
+ */
180
+ declare function calculateDepths(nodes: Map<string, PageNode>, adjacency: Map<string, Set<string>>, homepageUrl: string): void;
181
+ /**
182
+ * Detect pillar pages: long content with significant in/out linking.
183
+ * wordCount >= 1500 AND inDegree >= 3 AND outDegree >= 3
184
+ * AND category in blog/content/resources/docs AND not homepage (depth > 0).
185
+ */
186
+ declare function detectPillars(nodes: Map<string, PageNode>): void;
187
+ /**
188
+ * Detect hub pages: high outDegree navigation/index pages.
189
+ * outDegree >= 10 with category homepage/resources/docs, OR outDegree >= 15.
190
+ */
191
+ declare function detectHubs(nodes: Map<string, PageNode>): void;
192
+ /**
193
+ * Detect topic clusters around pillar pages.
194
+ * For each pillar, gather spokes (pages linked to/from pillar).
195
+ * Cohesion = actual edges between cluster members / possible edges.
196
+ * Minimum 2 spokes to form a cluster.
197
+ */
198
+ declare function detectClusters(nodes: Map<string, PageNode>, edges: LinkEdge[]): TopicCluster[];
199
+ /**
200
+ * Build a link graph from crawled pages.
201
+ * @param pages - Array of FetchResult from full-site crawl
202
+ * @param domain - The site domain
203
+ * @param homepageUrl - Full URL of the homepage (e.g. https://example.com)
204
+ */
205
+ declare function buildLinkGraph(pages: FetchResult[], domain: string, homepageUrl: string): LinkGraph;
206
+
120
207
  interface CriterionResult {
121
208
  criterion: string;
122
209
  criterion_label: string;
@@ -146,7 +233,7 @@ interface SiteData {
146
233
  redirectedTo: string | null;
147
234
  /** Set when homepage is a parked/for-sale/lost domain */
148
235
  parkedReason: string | null;
149
- /** Sampled blog/content pages from sitemap (up to 5) */
236
+ /** Sampled blog/content pages from sitemap (up to 50) */
150
237
  blogSample?: FetchResult[];
151
238
  /** Full-crawl statistics (set when --full-crawl is used) */
152
239
  crawlStats?: {
@@ -155,6 +242,8 @@ interface SiteData {
155
242
  skipped: number;
156
243
  elapsed: number;
157
244
  };
245
+ /** Link graph from full-site crawl */
246
+ linkGraph?: LinkGraph;
158
247
  }
159
248
  interface RawDataSummary {
160
249
  domain: string;
@@ -420,6 +509,58 @@ interface ParkedDomainResult {
420
509
  */
421
510
  declare function detectParkedDomain(bodySnippet: string): ParkedDomainResult;
422
511
 
512
+ /**
513
+ * Fix Plan Engine - generates actionable, phased fix plans from audit scores.
514
+ * Runs alongside the existing opportunities system (no breaking changes).
515
+ * Uses criterion scores, optional per-page data, and optional link graph
516
+ * to produce structured fix plans with code examples and dependency ordering.
517
+ */
518
+
519
+ interface FixAction {
520
+ id: string;
521
+ criterion: string;
522
+ criterionId: string;
523
+ title: string;
524
+ description: string;
525
+ impact: 'critical' | 'high' | 'medium' | 'low';
526
+ effort: 'trivial' | 'low' | 'medium' | 'high';
527
+ impactScore: number;
528
+ category: 'content' | 'structure' | 'discovery' | 'trust';
529
+ steps: string[];
530
+ codeExample?: string;
531
+ successCriteria: string;
532
+ dependsOn?: string[];
533
+ affectedPages?: string[];
534
+ pageCount?: number;
535
+ }
536
+ interface FixPhase {
537
+ phase: number;
538
+ title: string;
539
+ description: string;
540
+ fixes: FixAction[];
541
+ estimatedImpact: number;
542
+ }
543
+ interface FixPlanSummary {
544
+ criticalCount: number;
545
+ highCount: number;
546
+ mediumCount: number;
547
+ lowCount: number;
548
+ quickWinCount: number;
549
+ topOpportunity: string;
550
+ estimatedTotalEffort: string;
551
+ }
552
+ interface FixPlan {
553
+ domain: string;
554
+ generatedAt: string;
555
+ overallScore: number;
556
+ projectedScore: number;
557
+ totalFixes: number;
558
+ phases: FixPhase[];
559
+ quickWins: FixAction[];
560
+ summary: FixPlanSummary;
561
+ }
562
+ declare function generateFixPlan(domain: string, overallScore: number, criteria: CriterionResult[], pagesReviewed?: PageReview[], linkGraph?: LinkGraph): FixPlan;
563
+
423
564
  /**
424
565
  * HTML report generator for AEORank audits.
425
566
  * Produces self-contained HTML with inline CSS - zero external dependencies.
@@ -477,4 +618,4 @@ interface ComparisonResult {
477
618
  */
478
619
  declare function compare(domainA: string, domainB: string, options?: AuditOptions): Promise<ComparisonResult>;
479
620
 
480
- export { type AuditData, type AuditFinding, type AuditOptions, type AuditResult, type AuditStatus, CRITERION_LABELS, type ComparisonResult, type CrawlOptions, type CrawlResult, type CriterionComparison, type CriterionDetail, type CriterionResult, type Deliverable, type DetailedFinding, type FetchResult, type FindingSeverity, type FindingType, type HeadlessOptions, type ImpactLevel, type PageCategory$1 as PageCategory, type PageCriterionScore$1 as PageCriterionScore, type PageIssue, type PageReview, type PageScoreResult, type ParkedDomainResult, type PitchMetric, type Priority, type RawDataSummary, type RenderingMethod, type ScoreCardItem, type Severity, type SiteData, type Status, analyzeAllPages, analyzePage, audit, auditSiteFromData, buildDetailedFindings, buildScorecard, calculateOverallScore, classifyRendering, compare, crawlFullSite, detectParkedDomain, extractAllUrlsFromSitemap, extractContentPagesFromSitemap, extractInternalLinks, extractNavLinks, extractRawDataSummary, fetchMultiPageData, fetchWithHeadless, generateBottomLine, generateComparisonHtmlReport, generateHtmlReport, generateOpportunities, generatePitchNumbers, generateVerdict, inferCategory, isSpaShell, prefetchSiteData, scoreAllPages, scorePage, scoreToStatus };
621
+ export { type AuditData, type AuditFinding, type AuditOptions, type AuditResult, type AuditStatus, CRITERION_LABELS, type ComparisonResult, type CrawlOptions, type CrawlResult, type CriterionComparison, type CriterionDetail, type CriterionResult, type Deliverable, type DetailedFinding, type FetchResult, type FindingSeverity, type FindingType, type FixAction, type FixPhase, type FixPlan, type FixPlanSummary, type HeadlessOptions, type ImpactLevel, type LinkEdge, type LinkGraph, type LinkGraphStats, type PageCategory$1 as PageCategory, type PageCriterionScore$1 as PageCriterionScore, type PageIssue, type PageNode, type PageReview, type PageScoreResult, type ParkedDomainResult, type PitchMetric, type Priority, type RawDataSummary, type RenderingMethod, type ScoreCardItem, type SerializedLinkGraph, type Severity, type SiteData, type Status, type TopicCluster, analyzeAllPages, analyzePage, audit, auditSiteFromData, buildDetailedFindings, buildLinkGraph, buildScorecard, calculateDepths, calculateOverallScore, classifyRendering, compare, crawlFullSite, detectClusters, detectHubs, detectParkedDomain, detectPillars, extractAllUrlsFromSitemap, extractContentPagesFromSitemap, extractInternalLinks, extractLinksWithAnchors, extractNavLinks, extractRawDataSummary, fetchMultiPageData, fetchWithHeadless, generateBottomLine, generateComparisonHtmlReport, generateFixPlan, generateHtmlReport, generateOpportunities, generatePitchNumbers, generateVerdict, inferCategory, isSpaShell, prefetchSiteData, scoreAllPages, scorePage, scoreToStatus, serializeLinkGraph };
package/dist/index.d.ts CHANGED
@@ -117,6 +117,93 @@ interface AuditResult extends AuditData {
117
117
  */
118
118
  declare function audit(domain: string, options?: AuditOptions): Promise<AuditResult>;
119
119
 
120
+ /**
121
+ * Link graph analysis for full-site AEO audits.
122
+ * Builds an internal link graph, detects orphan pages, pillar pages,
123
+ * hub pages, and topic clusters from crawled page data.
124
+ */
125
+
126
+ interface LinkEdge {
127
+ source: string;
128
+ target: string;
129
+ anchorText: string;
130
+ }
131
+ interface PageNode {
132
+ url: string;
133
+ title: string;
134
+ wordCount: number;
135
+ category: PageCategory;
136
+ inDegree: number;
137
+ outDegree: number;
138
+ depth: number;
139
+ isPillar: boolean;
140
+ isHub: boolean;
141
+ isOrphan: boolean;
142
+ }
143
+ interface TopicCluster {
144
+ pillarUrl: string;
145
+ pillarTitle: string;
146
+ spokes: string[];
147
+ cohesion: number;
148
+ }
149
+ interface LinkGraphStats {
150
+ totalPages: number;
151
+ totalEdges: number;
152
+ orphanPages: number;
153
+ pillarPages: number;
154
+ hubPages: number;
155
+ avgDepth: number;
156
+ maxDepth: number;
157
+ clusters: number;
158
+ }
159
+ interface LinkGraph {
160
+ nodes: Map<string, PageNode>;
161
+ edges: LinkEdge[];
162
+ stats: LinkGraphStats;
163
+ clusters: TopicCluster[];
164
+ }
165
+ interface SerializedLinkGraph {
166
+ nodes: PageNode[];
167
+ stats: LinkGraphStats;
168
+ clusters: TopicCluster[];
169
+ }
170
+ declare function serializeLinkGraph(graph: LinkGraph): SerializedLinkGraph;
171
+ /**
172
+ * Extract internal links from HTML with their anchor text.
173
+ * Similar to extractInternalLinks in full-site-crawler.ts but returns LinkEdge[].
174
+ */
175
+ declare function extractLinksWithAnchors(html: string, sourceUrl: string, domain: string): LinkEdge[];
176
+ /**
177
+ * BFS from homepage to compute click depth for each node.
178
+ * Unreachable pages get Infinity.
179
+ */
180
+ declare function calculateDepths(nodes: Map<string, PageNode>, adjacency: Map<string, Set<string>>, homepageUrl: string): void;
181
+ /**
182
+ * Detect pillar pages: long content with significant in/out linking.
183
+ * wordCount >= 1500 AND inDegree >= 3 AND outDegree >= 3
184
+ * AND category in blog/content/resources/docs AND not homepage (depth > 0).
185
+ */
186
+ declare function detectPillars(nodes: Map<string, PageNode>): void;
187
+ /**
188
+ * Detect hub pages: high outDegree navigation/index pages.
189
+ * outDegree >= 10 with category homepage/resources/docs, OR outDegree >= 15.
190
+ */
191
+ declare function detectHubs(nodes: Map<string, PageNode>): void;
192
+ /**
193
+ * Detect topic clusters around pillar pages.
194
+ * For each pillar, gather spokes (pages linked to/from pillar).
195
+ * Cohesion = actual edges between cluster members / possible edges.
196
+ * Minimum 2 spokes to form a cluster.
197
+ */
198
+ declare function detectClusters(nodes: Map<string, PageNode>, edges: LinkEdge[]): TopicCluster[];
199
+ /**
200
+ * Build a link graph from crawled pages.
201
+ * @param pages - Array of FetchResult from full-site crawl
202
+ * @param domain - The site domain
203
+ * @param homepageUrl - Full URL of the homepage (e.g. https://example.com)
204
+ */
205
+ declare function buildLinkGraph(pages: FetchResult[], domain: string, homepageUrl: string): LinkGraph;
206
+
120
207
  interface CriterionResult {
121
208
  criterion: string;
122
209
  criterion_label: string;
@@ -146,7 +233,7 @@ interface SiteData {
146
233
  redirectedTo: string | null;
147
234
  /** Set when homepage is a parked/for-sale/lost domain */
148
235
  parkedReason: string | null;
149
- /** Sampled blog/content pages from sitemap (up to 5) */
236
+ /** Sampled blog/content pages from sitemap (up to 50) */
150
237
  blogSample?: FetchResult[];
151
238
  /** Full-crawl statistics (set when --full-crawl is used) */
152
239
  crawlStats?: {
@@ -155,6 +242,8 @@ interface SiteData {
155
242
  skipped: number;
156
243
  elapsed: number;
157
244
  };
245
+ /** Link graph from full-site crawl */
246
+ linkGraph?: LinkGraph;
158
247
  }
159
248
  interface RawDataSummary {
160
249
  domain: string;
@@ -420,6 +509,58 @@ interface ParkedDomainResult {
420
509
  */
421
510
  declare function detectParkedDomain(bodySnippet: string): ParkedDomainResult;
422
511
 
512
+ /**
513
+ * Fix Plan Engine - generates actionable, phased fix plans from audit scores.
514
+ * Runs alongside the existing opportunities system (no breaking changes).
515
+ * Uses criterion scores, optional per-page data, and optional link graph
516
+ * to produce structured fix plans with code examples and dependency ordering.
517
+ */
518
+
519
+ interface FixAction {
520
+ id: string;
521
+ criterion: string;
522
+ criterionId: string;
523
+ title: string;
524
+ description: string;
525
+ impact: 'critical' | 'high' | 'medium' | 'low';
526
+ effort: 'trivial' | 'low' | 'medium' | 'high';
527
+ impactScore: number;
528
+ category: 'content' | 'structure' | 'discovery' | 'trust';
529
+ steps: string[];
530
+ codeExample?: string;
531
+ successCriteria: string;
532
+ dependsOn?: string[];
533
+ affectedPages?: string[];
534
+ pageCount?: number;
535
+ }
536
+ interface FixPhase {
537
+ phase: number;
538
+ title: string;
539
+ description: string;
540
+ fixes: FixAction[];
541
+ estimatedImpact: number;
542
+ }
543
+ interface FixPlanSummary {
544
+ criticalCount: number;
545
+ highCount: number;
546
+ mediumCount: number;
547
+ lowCount: number;
548
+ quickWinCount: number;
549
+ topOpportunity: string;
550
+ estimatedTotalEffort: string;
551
+ }
552
+ interface FixPlan {
553
+ domain: string;
554
+ generatedAt: string;
555
+ overallScore: number;
556
+ projectedScore: number;
557
+ totalFixes: number;
558
+ phases: FixPhase[];
559
+ quickWins: FixAction[];
560
+ summary: FixPlanSummary;
561
+ }
562
+ declare function generateFixPlan(domain: string, overallScore: number, criteria: CriterionResult[], pagesReviewed?: PageReview[], linkGraph?: LinkGraph): FixPlan;
563
+
423
564
  /**
424
565
  * HTML report generator for AEORank audits.
425
566
  * Produces self-contained HTML with inline CSS - zero external dependencies.
@@ -477,4 +618,4 @@ interface ComparisonResult {
477
618
  */
478
619
  declare function compare(domainA: string, domainB: string, options?: AuditOptions): Promise<ComparisonResult>;
479
620
 
480
- export { type AuditData, type AuditFinding, type AuditOptions, type AuditResult, type AuditStatus, CRITERION_LABELS, type ComparisonResult, type CrawlOptions, type CrawlResult, type CriterionComparison, type CriterionDetail, type CriterionResult, type Deliverable, type DetailedFinding, type FetchResult, type FindingSeverity, type FindingType, type HeadlessOptions, type ImpactLevel, type PageCategory$1 as PageCategory, type PageCriterionScore$1 as PageCriterionScore, type PageIssue, type PageReview, type PageScoreResult, type ParkedDomainResult, type PitchMetric, type Priority, type RawDataSummary, type RenderingMethod, type ScoreCardItem, type Severity, type SiteData, type Status, analyzeAllPages, analyzePage, audit, auditSiteFromData, buildDetailedFindings, buildScorecard, calculateOverallScore, classifyRendering, compare, crawlFullSite, detectParkedDomain, extractAllUrlsFromSitemap, extractContentPagesFromSitemap, extractInternalLinks, extractNavLinks, extractRawDataSummary, fetchMultiPageData, fetchWithHeadless, generateBottomLine, generateComparisonHtmlReport, generateHtmlReport, generateOpportunities, generatePitchNumbers, generateVerdict, inferCategory, isSpaShell, prefetchSiteData, scoreAllPages, scorePage, scoreToStatus };
621
+ export { type AuditData, type AuditFinding, type AuditOptions, type AuditResult, type AuditStatus, CRITERION_LABELS, type ComparisonResult, type CrawlOptions, type CrawlResult, type CriterionComparison, type CriterionDetail, type CriterionResult, type Deliverable, type DetailedFinding, type FetchResult, type FindingSeverity, type FindingType, type FixAction, type FixPhase, type FixPlan, type FixPlanSummary, type HeadlessOptions, type ImpactLevel, type LinkEdge, type LinkGraph, type LinkGraphStats, type PageCategory$1 as PageCategory, type PageCriterionScore$1 as PageCriterionScore, type PageIssue, type PageNode, type PageReview, type PageScoreResult, type ParkedDomainResult, type PitchMetric, type Priority, type RawDataSummary, type RenderingMethod, type ScoreCardItem, type SerializedLinkGraph, type Severity, type SiteData, type Status, type TopicCluster, analyzeAllPages, analyzePage, audit, auditSiteFromData, buildDetailedFindings, buildLinkGraph, buildScorecard, calculateDepths, calculateOverallScore, classifyRendering, compare, crawlFullSite, detectClusters, detectHubs, detectParkedDomain, detectPillars, extractAllUrlsFromSitemap, extractContentPagesFromSitemap, extractInternalLinks, extractLinksWithAnchors, extractNavLinks, extractRawDataSummary, fetchMultiPageData, fetchWithHeadless, generateBottomLine, generateComparisonHtmlReport, generateFixPlan, generateHtmlReport, generateOpportunities, generatePitchNumbers, generateVerdict, inferCategory, isSpaShell, prefetchSiteData, scoreAllPages, scorePage, scoreToStatus, serializeLinkGraph };