aeorank 2.3.2 → 3.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
@@ -1,122 +1,3 @@
1
- /**
2
- * AEORank type definitions.
3
- * Inlined from @aeo/shared to keep the package zero-dependency.
4
- */
5
- type Status = 'MISSING' | 'NEARLY EMPTY' | 'POOR' | 'WEAK' | 'PARTIAL' | 'MODERATE' | 'GOOD' | 'STRONG';
6
- type Severity = 'WORKING' | 'GOOD' | 'GOOD PATTERN' | 'PARTIAL' | 'MISSING' | 'ADD' | 'FIX' | 'FIX IMMEDIATELY' | 'REWRITE' | 'CONFUSING' | 'INCONSISTENT' | 'SPARSE' | 'PERFORMANCE' | 'CLUTTER' | 'PLATFORM LIMIT' | 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'BIG OPPORTUNITY' | 'AEO GOLDMINE' | 'AEO CORE' | 'CORE AEO' | 'AEO deliverable' | 'QUICK WIN' | 'MEASUREMENT';
7
- type FindingType = 'Test' | 'Good' | 'Bad' | 'Missing' | 'Critical' | 'Issue' | 'Fix' | 'Exists' | 'Calc' | 'Present' | 'Note' | 'Current' | 'Volume' | 'Bonus' | 'Impact';
8
- type ImpactLevel = 'QUICK WIN' | 'CRITICAL' | 'HIGH' | 'CORE AEO' | 'MEDIUM' | 'LOW' | 'MEASUREMENT' | 'BIG OPPORTUNITY';
9
- interface ScoreCardItem {
10
- id: number;
11
- criterion: string;
12
- score: number;
13
- status: Status;
14
- keyFindings: string;
15
- }
16
- interface DetailedFinding {
17
- type: FindingType;
18
- description: string;
19
- severity: Severity;
20
- }
21
- interface CriterionDetail {
22
- id: number;
23
- name: string;
24
- findings: DetailedFinding[];
25
- }
26
- interface Deliverable {
27
- id: number;
28
- name: string;
29
- description: string;
30
- effort: string;
31
- impact: ImpactLevel;
32
- }
33
- interface PitchMetric {
34
- metric: string;
35
- value: string;
36
- significance: string;
37
- }
38
- type PageCategory$1 = 'homepage' | 'blog' | 'about' | 'pricing' | 'services' | 'contact' | 'team' | 'resources' | 'docs' | 'cases' | 'faq' | 'content';
39
- interface PageCriterionScore$1 {
40
- criterion: string;
41
- criterion_label: string;
42
- score: number;
43
- weight: number;
44
- }
45
- interface PageIssue {
46
- check: string;
47
- label: string;
48
- severity: 'error' | 'warning' | 'info';
49
- }
50
- interface PageReview {
51
- url: string;
52
- title: string;
53
- category: PageCategory$1;
54
- wordCount: number;
55
- issues: PageIssue[];
56
- strengths: PageIssue[];
57
- aeoScore?: number;
58
- criterionScores?: PageCriterionScore$1[];
59
- }
60
- interface AuditData {
61
- site: string;
62
- auditDate: string;
63
- auditor: string;
64
- engine?: string;
65
- overallScore: number;
66
- verdict: string;
67
- scorecard: ScoreCardItem[];
68
- detailedFindings: CriterionDetail[];
69
- opportunities: Deliverable[];
70
- pitchNumbers: PitchMetric[];
71
- bottomLine: string;
72
- pagesReviewed?: PageReview[];
73
- }
74
- type AuditStatus = 'pass' | 'fail' | 'partial' | 'not_found';
75
- type Priority = 'P0' | 'P1' | 'P2' | 'P3';
76
- type FindingSeverity = 'critical' | 'high' | 'medium' | 'low' | 'info';
77
- interface AuditFinding {
78
- severity: FindingSeverity;
79
- detail: string;
80
- fix?: string;
81
- }
82
-
83
- /**
84
- * Programmatic audit API.
85
- * Runs the full 7-phase AEO audit pipeline and returns structured results.
86
- */
87
-
88
- interface AuditOptions {
89
- /** Skip Puppeteer SPA rendering (default: false) */
90
- noHeadless?: boolean;
91
- /** Homepage + blog only, skip extra page discovery (default: false) */
92
- noMultiPage?: boolean;
93
- /** Fetch timeout in ms (default: 15000) */
94
- timeout?: number;
95
- /** Enable full-site BFS crawl (default: false) */
96
- fullCrawl?: boolean;
97
- /** Max pages for full crawl (default: 200) */
98
- maxPages?: number;
99
- /** Parallel fetch concurrency for full crawl (default: 5) */
100
- concurrency?: number;
101
- }
102
- interface AuditResult extends AuditData {
103
- /** True if headless browser was used for SPA rendering */
104
- renderedWithHeadless?: boolean;
105
- /** Wall-clock seconds */
106
- elapsed: number;
107
- }
108
- /**
109
- * Run a complete AEO audit on a domain.
110
- *
111
- * @example
112
- * ```ts
113
- * import { audit } from 'aeorank';
114
- * const result = await audit('example.com');
115
- * console.log(result.overallScore); // 0-100
116
- * ```
117
- */
118
- declare function audit(domain: string, options?: AuditOptions): Promise<AuditResult>;
119
-
120
1
  /**
121
2
  * Link graph analysis for full-site AEO audits.
122
3
  * Builds an internal link graph, detects orphan pages, pillar pages,
@@ -132,7 +13,7 @@ interface PageNode {
132
13
  url: string;
133
14
  title: string;
134
15
  wordCount: number;
135
- category: PageCategory;
16
+ category: PageCategory$1;
136
17
  inDegree: number;
137
18
  outDegree: number;
138
19
  depth: number;
@@ -212,12 +93,12 @@ interface CriterionResult {
212
93
  findings: AuditFinding[];
213
94
  fix_priority: Priority;
214
95
  }
215
- type PageCategory = 'homepage' | 'blog' | 'about' | 'pricing' | 'services' | 'contact' | 'team' | 'resources' | 'docs' | 'cases' | 'faq' | 'content';
96
+ type PageCategory$1 = 'homepage' | 'blog' | 'about' | 'pricing' | 'services' | 'contact' | 'team' | 'resources' | 'docs' | 'cases' | 'faq' | 'content';
216
97
  interface FetchResult {
217
98
  text: string;
218
99
  status: number;
219
100
  finalUrl?: string;
220
- category?: PageCategory;
101
+ category?: PageCategory$1;
221
102
  }
222
103
  interface SiteData {
223
104
  domain: string;
@@ -332,7 +213,7 @@ interface SitemapDateAnalysis {
332
213
  declare function countRecentSitemapDates(sitemapText: string): SitemapDateAnalysis;
333
214
  declare function extractRawDataSummary(data: SiteData): RawDataSummary;
334
215
  /**
335
- * Run all 26 criteria checks using pre-fetched site data.
216
+ * Run all 34 criteria checks using pre-fetched site data.
336
217
  * All functions are synchronous (no HTTP calls) - data was already fetched.
337
218
  */
338
219
  declare function auditSiteFromData(data: SiteData): CriterionResult[];
@@ -342,6 +223,168 @@ declare function auditSiteFromData(data: SiteData): CriterionResult[];
342
223
  */
343
224
  declare function auditSite(targetUrl: string): Promise<CriterionResult[]>;
344
225
 
226
+ /**
227
+ * V2 Pillar Framework — 5-pillar scoring model.
228
+ * Maps all 34 criteria into pillars, computes sub-scores,
229
+ * provides client-friendly names, and calculates top-3 fixes.
230
+ */
231
+
232
+ interface PillarScores {
233
+ answerReadiness: number;
234
+ contentStructure: number;
235
+ trustAuthority: number;
236
+ technicalFoundation: number;
237
+ aiDiscovery: number;
238
+ }
239
+ interface TopFix {
240
+ criterion: string;
241
+ clientName: string;
242
+ description: string;
243
+ impactPoints: number;
244
+ effort: 'Low' | 'Medium' | 'High';
245
+ }
246
+ type PillarName = 'Answer Readiness' | 'Content Structure' | 'Trust & Authority' | 'Technical Foundation' | 'AI Discovery';
247
+ declare const PILLARS: Record<PillarName, string[]>;
248
+ declare const CLIENT_NAMES: Record<string, string>;
249
+ declare function getCriterionPillar(criterionId: string): string;
250
+ declare function computePillarScores(criteria: CriterionResult[]): PillarScores;
251
+ declare function computeTopFixes(criteria: CriterionResult[], count?: number): TopFix[];
252
+
253
+ /**
254
+ * AEORank type definitions.
255
+ * Inlined from @aeo/shared to keep the package zero-dependency.
256
+ */
257
+ type Status = 'MISSING' | 'NEARLY EMPTY' | 'POOR' | 'WEAK' | 'PARTIAL' | 'MODERATE' | 'GOOD' | 'STRONG';
258
+ type Severity = 'WORKING' | 'GOOD' | 'GOOD PATTERN' | 'PARTIAL' | 'MISSING' | 'ADD' | 'FIX' | 'FIX IMMEDIATELY' | 'REWRITE' | 'CONFUSING' | 'INCONSISTENT' | 'SPARSE' | 'PERFORMANCE' | 'CLUTTER' | 'PLATFORM LIMIT' | 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'BIG OPPORTUNITY' | 'AEO GOLDMINE' | 'AEO CORE' | 'CORE AEO' | 'AEO deliverable' | 'QUICK WIN' | 'MEASUREMENT';
259
+ type FindingType = 'Test' | 'Good' | 'Bad' | 'Missing' | 'Critical' | 'Issue' | 'Fix' | 'Exists' | 'Calc' | 'Present' | 'Note' | 'Current' | 'Volume' | 'Bonus' | 'Impact';
260
+ type ImpactLevel = 'QUICK WIN' | 'CRITICAL' | 'HIGH' | 'CORE AEO' | 'MEDIUM' | 'LOW' | 'MEASUREMENT' | 'BIG OPPORTUNITY';
261
+ interface ScoreCardItem {
262
+ id: number;
263
+ criterion: string;
264
+ score: number;
265
+ status: Status;
266
+ keyFindings: string;
267
+ pillar?: string;
268
+ clientName?: string;
269
+ weight?: number;
270
+ }
271
+ interface DetailedFinding {
272
+ type: FindingType;
273
+ description: string;
274
+ severity: Severity;
275
+ }
276
+ interface CriterionDetail {
277
+ id: number;
278
+ name: string;
279
+ findings: DetailedFinding[];
280
+ }
281
+ interface Deliverable {
282
+ id: number;
283
+ name: string;
284
+ description: string;
285
+ effort: string;
286
+ impact: ImpactLevel;
287
+ }
288
+ interface PitchMetric {
289
+ metric: string;
290
+ value: string;
291
+ significance: string;
292
+ }
293
+ type PageCategory = 'homepage' | 'blog' | 'about' | 'pricing' | 'services' | 'contact' | 'team' | 'resources' | 'docs' | 'cases' | 'faq' | 'content';
294
+ interface PageCriterionScore$1 {
295
+ criterion: string;
296
+ criterion_label: string;
297
+ score: number;
298
+ weight: number;
299
+ }
300
+ interface PageIssue {
301
+ check: string;
302
+ label: string;
303
+ severity: 'error' | 'warning' | 'info';
304
+ }
305
+ interface PageReview {
306
+ url: string;
307
+ title: string;
308
+ category: PageCategory;
309
+ wordCount: number;
310
+ issues: PageIssue[];
311
+ strengths: PageIssue[];
312
+ aeoScore?: number;
313
+ criterionScores?: PageCriterionScore$1[];
314
+ pillarScores?: PillarScores;
315
+ estimatedSiteScore?: number;
316
+ scoreCapped?: boolean;
317
+ topFixes?: string[];
318
+ }
319
+ interface AuditData {
320
+ site: string;
321
+ auditDate: string;
322
+ auditor: string;
323
+ engine?: string;
324
+ overallScore: number;
325
+ verdict: string;
326
+ scorecard: ScoreCardItem[];
327
+ detailedFindings: CriterionDetail[];
328
+ opportunities: Deliverable[];
329
+ pitchNumbers: PitchMetric[];
330
+ bottomLine: string;
331
+ pagesReviewed?: PageReview[];
332
+ pillarScores?: PillarScores;
333
+ coherenceGated?: boolean;
334
+ criteriaScored?: number;
335
+ topFixes?: Array<{
336
+ fix: string;
337
+ impact: string;
338
+ effort: string;
339
+ }>;
340
+ }
341
+ type AuditStatus = 'pass' | 'fail' | 'partial' | 'not_found';
342
+ type Priority = 'P0' | 'P1' | 'P2' | 'P3';
343
+ type FindingSeverity = 'critical' | 'high' | 'medium' | 'low' | 'info';
344
+ interface AuditFinding {
345
+ severity: FindingSeverity;
346
+ detail: string;
347
+ fix?: string;
348
+ }
349
+
350
+ /**
351
+ * Programmatic audit API.
352
+ * Runs the full 7-phase AEO audit pipeline and returns structured results.
353
+ */
354
+
355
+ interface AuditOptions {
356
+ /** Skip Puppeteer SPA rendering (default: false) */
357
+ noHeadless?: boolean;
358
+ /** Homepage + blog only, skip extra page discovery (default: false) */
359
+ noMultiPage?: boolean;
360
+ /** Fetch timeout in ms (default: 15000) */
361
+ timeout?: number;
362
+ /** Enable full-site BFS crawl (default: false) */
363
+ fullCrawl?: boolean;
364
+ /** Max pages for full crawl (default: 200) */
365
+ maxPages?: number;
366
+ /** Parallel fetch concurrency for full crawl (default: 5) */
367
+ concurrency?: number;
368
+ }
369
+ interface AuditResult extends AuditData {
370
+ /** True if headless browser was used for SPA rendering */
371
+ renderedWithHeadless?: boolean;
372
+ /** Wall-clock seconds */
373
+ elapsed: number;
374
+ }
375
+ /**
376
+ * Run a complete AEO audit on a domain.
377
+ *
378
+ * @example
379
+ * ```ts
380
+ * import { audit } from 'aeorank';
381
+ * const result = await audit('example.com');
382
+ * console.log(result.overallScore); // 0-100
383
+ * ```
384
+ */
385
+ declare function audit(domain: string, options?: AuditOptions): Promise<AuditResult>;
386
+
387
+ declare const WEIGHTS: Record<string, number>;
345
388
  declare function calculateOverallScore(criteria: CriterionResult[]): number;
346
389
 
347
390
  /**
@@ -367,16 +410,16 @@ declare function generateBottomLine(score: number, opportunities: Deliverable[],
367
410
 
368
411
  /**
369
412
  * Per-page analysis for instant audit.
370
- * Runs 12 deterministic checks on each crawled page (no LLM).
413
+ * Runs 15 deterministic checks on each crawled page (no LLM).
371
414
  */
372
415
 
373
- declare function analyzePage(html: string, url: string, category: PageCategory): PageReview;
416
+ declare function analyzePage(html: string, url: string, category: PageCategory$1): PageReview;
374
417
  declare function analyzeAllPages(siteData: SiteData): PageReview[];
375
418
 
376
419
  /**
377
420
  * Per-page AEO scoring.
378
- * Evaluates 14 of 28 criteria that apply at individual page level.
379
- * Produces a 0-100 AEO score per page.
421
+ * Evaluates 20 of 34 criteria that apply at individual page level.
422
+ * Produces a 0-75 AEO score per page (single-page cap at 75).
380
423
  */
381
424
 
382
425
  interface PageCriterionScore {
@@ -388,10 +431,23 @@ interface PageCriterionScore {
388
431
  interface PageScoreResult {
389
432
  aeoScore: number;
390
433
  criterionScores: PageCriterionScore[];
391
- }
392
- /**
393
- * Score a single page against 14 AEO criteria.
394
- * Returns a 0-100 AEO score and individual criterion scores.
434
+ scoreCapped?: boolean;
435
+ }
436
+ /** 15. Citation-Ready Writing Quality */
437
+ declare function scoreCitationReadyWriting(html: string): number;
438
+ /** 16. Answer-First Placement */
439
+ declare function scoreAnswerFirstPlacement(html: string): number;
440
+ /** 17. Evidence Packaging */
441
+ declare function scoreEvidencePackaging(html: string): number;
442
+ /** 18. Entity Disambiguation */
443
+ declare function scoreEntityDisambiguation(html: string): number;
444
+ /** 19. Extraction Friction Score */
445
+ declare function scoreExtractionFriction(html: string): number;
446
+ /** 20. Image Context for AI */
447
+ declare function scoreImageContextAI(html: string): number;
448
+ /**
449
+ * Score a single page against 20 AEO criteria.
450
+ * Returns a 0-100 AEO score (capped at 75 for single pages) and individual criterion scores.
395
451
  */
396
452
  declare function scorePage(html: string, url?: string): PageScoreResult;
397
453
  /**
@@ -444,6 +500,24 @@ interface CrawlOptions {
444
500
  respectRobots?: boolean;
445
501
  /** Include asset files — skipped by default */
446
502
  includeAssets?: boolean;
503
+ /** Called after each batch with per-URL results */
504
+ onProgress?: (event: CrawlProgressEvent) => void;
505
+ }
506
+ interface CrawlProgressEvent {
507
+ /** URLs attempted in this batch */
508
+ urls: string[];
509
+ /** Whether each URL succeeded */
510
+ results: Array<{
511
+ url: string;
512
+ ok: boolean;
513
+ status?: number;
514
+ }>;
515
+ /** Total fetched so far */
516
+ fetched: number;
517
+ /** Total discovered so far */
518
+ discovered: number;
519
+ /** Max pages limit */
520
+ maxPages: number;
447
521
  }
448
522
  interface CrawlResult {
449
523
  pages: FetchResult[];
@@ -465,7 +539,7 @@ declare function extractInternalLinks(html: string, domain: string): string[];
465
539
  /**
466
540
  * Infer PageCategory from URL path patterns.
467
541
  */
468
- declare function inferCategory(url: string): PageCategory;
542
+ declare function inferCategory(url: string): PageCategory$1;
469
543
  /**
470
544
  * BFS crawl of a site, discovering all internal pages up to maxPages.
471
545
  * Seeds from sitemap URLs + homepage internal links.
@@ -631,4 +705,4 @@ interface ComparisonResult {
631
705
  */
632
706
  declare function compare(domainA: string, domainB: string, options?: AuditOptions): Promise<ComparisonResult>;
633
707
 
634
- 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 SitemapDateAnalysis, type Status, type TopicCluster, analyzeAllPages, analyzePage, audit, auditSite, auditSiteFromData, buildDetailedFindings, buildLinkGraph, buildScorecard, calculateDepths, calculateOverallScore, classifyRendering, compare, countRecentSitemapDates, 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 };
708
+ export { type AuditData, type AuditFinding, type AuditOptions, type AuditResult, type AuditStatus, CLIENT_NAMES, 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, PILLARS, type PageCategory, type PageCriterionScore$1 as PageCriterionScore, type PageIssue, type PageNode, type PageReview, type PageScoreResult, type ParkedDomainResult, type PillarName, type PillarScores, type PitchMetric, type Priority, type RawDataSummary, type RenderingMethod, type ScoreCardItem, type SerializedLinkGraph, type Severity, type SiteData, type SitemapDateAnalysis, type Status, type TopFix, type TopicCluster, WEIGHTS, analyzeAllPages, analyzePage, audit, auditSite, auditSiteFromData, buildDetailedFindings, buildLinkGraph, buildScorecard, calculateDepths, calculateOverallScore, classifyRendering, compare, computePillarScores, computeTopFixes, countRecentSitemapDates, crawlFullSite, detectClusters, detectHubs, detectParkedDomain, detectPillars, extractAllUrlsFromSitemap, extractContentPagesFromSitemap, extractInternalLinks, extractLinksWithAnchors, extractNavLinks, extractRawDataSummary, fetchMultiPageData, fetchWithHeadless, generateBottomLine, generateComparisonHtmlReport, generateFixPlan, generateHtmlReport, generateOpportunities, generatePitchNumbers, generateVerdict, getCriterionPillar, inferCategory, isSpaShell, prefetchSiteData, scoreAllPages, scoreAnswerFirstPlacement, scoreCitationReadyWriting, scoreEntityDisambiguation, scoreEvidencePackaging, scoreExtractionFriction, scoreImageContextAI, scorePage, scoreToStatus, serializeLinkGraph };