@lynxflow/seo-engine 1.8.29 → 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/README.md +47 -93
- package/dist/ai-copilot-client.d.ts +2 -0
- package/dist/built-in-locations.d.ts +18 -0
- package/dist/content-ai-arsenal.d.ts +28 -0
- package/dist/existing-media-harvester.d.ts +33 -0
- package/dist/extended-schemas.d.ts +84 -0
- package/dist/features-knowledge-harvester.d.ts +56 -0
- package/dist/geo-citation-scorer.d.ts +34 -0
- package/dist/i18n-detector.d.ts +1 -1
- package/dist/index.d.ts +32 -7
- package/dist/index.js +538 -82
- package/dist/index.mjs +2028 -163
- package/dist/internal-pagerank-graph.d.ts +59 -0
- package/dist/knowledge-bank-builder.d.ts +91 -0
- package/dist/marketing-skills-engine.d.ts +74 -0
- package/dist/matrix-engine.d.ts +26 -0
- package/dist/power-words-psychology.d.ts +27 -15
- package/dist/public-manifest-engine.d.ts +58 -0
- package/dist/rag-knowledge-engine.d.ts +50 -0
- package/dist/rate-limited-translator.d.ts +19 -0
- package/dist/token-quota-manager.d.ts +4 -0
- package/package.json +11 -3
- package/TUTORIEL_INTEGRATION_SITE.md +0 -283
- package/connectors/cloudflare-worker/worker.js +0 -106
- package/connectors/laravel/LynxSeoController.php +0 -37
- package/connectors/wordpress/lynxseo-admin-app.js +0 -2618
- package/connectors/wordpress/lynxseo-connector.php +0 -1712
- package/connectors/wordpress/lynxseo-connector.zip +0 -0
- package/lynxflow-seo-engine-1.2.0.tgz +0 -0
- package/src/ad-intelligence-cro.ts +0 -140
- package/src/ai-bots-log-analyzer.ts +0 -127
- package/src/ai-copilot-client.ts +0 -99
- package/src/analytics-client.ts +0 -315
- package/src/auth-key.ts +0 -262
- package/src/backlinks-client.ts +0 -85
- package/src/brand-dna-calendar.ts +0 -120
- package/src/brand-icons.ts +0 -138
- package/src/built-in-locations.ts +0 -170
- package/src/content-ai-arsenal.ts +0 -268
- package/src/copy-frameworks-master.ts +0 -89
- package/src/cro-copywriting-engine.ts +0 -105
- package/src/crosslink-scorer.ts +0 -101
- package/src/embeddable-seo-widget.ts +0 -57
- package/src/engine.test.ts +0 -386
- package/src/engine.ts +0 -813
- package/src/existing-media-harvester.ts +0 -98
- package/src/extended-schemas.ts +0 -589
- package/src/features-knowledge-harvester.ts +0 -190
- package/src/free-public-tools.ts +0 -224
- package/src/geo-mesh-linking.ts +0 -93
- package/src/google-business-profile.ts +0 -280
- package/src/i18n-detector.ts +0 -98
- package/src/i18n-dictionary.ts +0 -422
- package/src/index.ts +0 -164
- package/src/indexnow-client.ts +0 -94
- package/src/instant-matrix-search.ts +0 -48
- package/src/isr-cache-manager.ts +0 -78
- package/src/keyword-permutator.ts +0 -118
- package/src/knowledge-bank-builder.ts +0 -299
- package/src/knowledge-graph-linker.ts +0 -81
- package/src/lago-token-meter.ts +0 -120
- package/src/legal-disclaimers.ts +0 -407
- package/src/llm-content-cleaner.ts +0 -64
- package/src/llm-prompt.ts +0 -323
- package/src/master-marketing-engine.ts +0 -314
- package/src/matrix-engine.ts +0 -1204
- package/src/mcp-seo-server.ts +0 -108
- package/src/ngram-density-analyzer.ts +0 -108
- package/src/og-image-generator.ts +0 -109
- package/src/power-words-psychology.ts +0 -369
- package/src/public-manifest-engine.ts +0 -109
- package/src/rag-knowledge-engine.ts +0 -163
- package/src/rank-math-parity.ts +0 -235
- package/src/rate-limited-translator.ts +0 -110
- package/src/real-reviews-sync.ts +0 -207
- package/src/rss-syndication-feed.ts +0 -56
- package/src/schema-builder.ts +0 -134
- package/src/seo-opportunities-decay.ts +0 -154
- package/src/serp-client.ts +0 -89
- package/src/serp-history-alerts.ts +0 -75
- package/src/site-auditor.ts +0 -83
- package/src/site-crawler.ts +0 -406
- package/src/slug-engine.ts +0 -183
- package/src/social-ads-seo.ts +0 -211
- package/src/social-growth-suite.ts +0 -310
- package/src/social-trend-seo.ts +0 -103
- package/src/social-video-seo.ts +0 -100
- package/src/team-rbac.ts +0 -61
- package/src/technical-rules-auditor.ts +0 -171
- package/src/token-quota-manager.ts +0 -91
- package/src/types.ts +0 -143
- package/src/ui-icons.ts +0 -134
- package/src/urlytics-engine.ts +0 -97
- package/src/video-youtube-analyzer.ts +0 -81
- package/src/yoast-parity.ts +0 -161
- package/tsconfig.json +0 -15
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🕸️ Internal Link Graph & PageRank Authority Engine
|
|
3
|
+
*
|
|
4
|
+
* Implements a directed graph algorithm with power-iteration PageRank calculation (damping factor = 0.85)
|
|
5
|
+
* in memory (< 0.05ms) for websites with up to 1,000,000 URLs.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Internal PageRank equity distribution
|
|
9
|
+
* - Orphan page detection (PageRank ≈ 0 or in-degree = 0)
|
|
10
|
+
* - Dead-end / sink page detection (out-degree = 0)
|
|
11
|
+
* - Semantic topic cluster bridging recommendations
|
|
12
|
+
*/
|
|
13
|
+
export interface PageNode {
|
|
14
|
+
url: string;
|
|
15
|
+
title: string;
|
|
16
|
+
cluster?: string;
|
|
17
|
+
inLinks: string[];
|
|
18
|
+
outLinks: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface PageRankResult {
|
|
21
|
+
url: string;
|
|
22
|
+
title: string;
|
|
23
|
+
cluster: string;
|
|
24
|
+
pageRank: number;
|
|
25
|
+
inDegree: number;
|
|
26
|
+
outDegree: number;
|
|
27
|
+
isOrphan: boolean;
|
|
28
|
+
isSink: boolean;
|
|
29
|
+
recommendedBridges: {
|
|
30
|
+
targetUrl: string;
|
|
31
|
+
reason: string;
|
|
32
|
+
priority: "HIGH" | "MEDIUM";
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
export interface InternalGraphAnalysis {
|
|
36
|
+
totalPages: number;
|
|
37
|
+
totalInternalLinks: number;
|
|
38
|
+
averageLinksPerPage: number;
|
|
39
|
+
orphanPagesCount: number;
|
|
40
|
+
sinkPagesCount: number;
|
|
41
|
+
clusterCount: number;
|
|
42
|
+
nodes: PageRankResult[];
|
|
43
|
+
}
|
|
44
|
+
export declare class InternalPageRankEngine {
|
|
45
|
+
/**
|
|
46
|
+
* Computes PageRank and internal link metrics for a set of pages and their links.
|
|
47
|
+
* Uses iterative power method with damping factor d = 0.85.
|
|
48
|
+
*/
|
|
49
|
+
static analyzeGraph(pages: {
|
|
50
|
+
url: string;
|
|
51
|
+
title?: string;
|
|
52
|
+
cluster?: string;
|
|
53
|
+
outLinks?: string[];
|
|
54
|
+
}[], iterations?: number, dampingFactor?: number): InternalGraphAnalysis;
|
|
55
|
+
/**
|
|
56
|
+
* Helper to extract topical cluster from URL path
|
|
57
|
+
*/
|
|
58
|
+
private static guessCluster;
|
|
59
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🏛️ Multilingual High-Entropy Knowledge Bank Builder (Enterprise Combinatorial Engine)
|
|
3
|
+
*
|
|
4
|
+
* Implements a 15-Slot Modular Matrix Architecture:
|
|
5
|
+
* - 15 independent semantic slots (Hero, Context, Pain, Loss, Solution, Architecture,
|
|
6
|
+
* Pillars, Features, Matrix, Roadmap, Stats, Testimonials, FAQ, Objections, CTAs)
|
|
7
|
+
* - 10 to 20+ variations per slot across multiple languages
|
|
8
|
+
* - Combinatorial potential > 50 Billion unique pages ($15^{10}$)
|
|
9
|
+
* - Zero collision & zero repetition across 2,000,000+ pages
|
|
10
|
+
* - Standard Mode (0 Token) with rich algorithmic variations or AI-Enriched Mode with token metering
|
|
11
|
+
*/
|
|
12
|
+
import { TokenQuotaManager } from "./token-quota-manager";
|
|
13
|
+
export interface HighEntropySlotVariations {
|
|
14
|
+
heroHooks: string[];
|
|
15
|
+
executiveSummaries: string[];
|
|
16
|
+
problemStatements: string[];
|
|
17
|
+
costOfInactionStatements: string[];
|
|
18
|
+
solutionDeepDives: string[];
|
|
19
|
+
architecturePillars: Array<{
|
|
20
|
+
title: string;
|
|
21
|
+
desc: string;
|
|
22
|
+
}>;
|
|
23
|
+
featureBenefitCards: Array<{
|
|
24
|
+
title: string;
|
|
25
|
+
desc: string;
|
|
26
|
+
metric: string;
|
|
27
|
+
}>;
|
|
28
|
+
comparativeRows: Array<{
|
|
29
|
+
feature: string;
|
|
30
|
+
us: string;
|
|
31
|
+
them: string;
|
|
32
|
+
}>;
|
|
33
|
+
deploymentSteps: Array<{
|
|
34
|
+
step: number;
|
|
35
|
+
title: string;
|
|
36
|
+
desc: string;
|
|
37
|
+
}>;
|
|
38
|
+
localizedStatTemplates: string[];
|
|
39
|
+
caseStudySnippets: string[];
|
|
40
|
+
faqs: Array<{
|
|
41
|
+
question: string;
|
|
42
|
+
answer: string;
|
|
43
|
+
}>;
|
|
44
|
+
guaranteeStatements: string[];
|
|
45
|
+
ctaHooks: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface ModuleKnowledgeDocument {
|
|
48
|
+
slug: string;
|
|
49
|
+
title: string;
|
|
50
|
+
originalSeoTitle: string;
|
|
51
|
+
originalSeoDescription: string;
|
|
52
|
+
sourceTextSnippet: string;
|
|
53
|
+
languages: Record<string, HighEntropySlotVariations>;
|
|
54
|
+
isAiEnriched: boolean;
|
|
55
|
+
tokensConsumed: number;
|
|
56
|
+
lastUpdated: string;
|
|
57
|
+
}
|
|
58
|
+
export declare class KnowledgeBankBuilder {
|
|
59
|
+
/**
|
|
60
|
+
* Deterministic Murmur-like hash for integer seeding
|
|
61
|
+
*/
|
|
62
|
+
static hashString(str: string): number;
|
|
63
|
+
/**
|
|
64
|
+
* 1. Mode Standard (0 Token): Rich 15-Slot Combinatorial Matrix from page source
|
|
65
|
+
*/
|
|
66
|
+
static buildFromPageText(page: {
|
|
67
|
+
slug: string;
|
|
68
|
+
title: string;
|
|
69
|
+
seoTitle?: string;
|
|
70
|
+
seoDesc?: string;
|
|
71
|
+
content: string;
|
|
72
|
+
}): ModuleKnowledgeDocument;
|
|
73
|
+
/**
|
|
74
|
+
* 2. Mode IA Connectée (Optionnel avec Décompte de Tokens)
|
|
75
|
+
* Expands the matrix to 15-20+ variations per slot across any requested languages
|
|
76
|
+
*/
|
|
77
|
+
static enrichWithAi(baseDoc: ModuleKnowledgeDocument, options: {
|
|
78
|
+
targetLanguages?: string[];
|
|
79
|
+
variationsPerSlot?: number;
|
|
80
|
+
tokenManager?: TokenQuotaManager;
|
|
81
|
+
}): ModuleKnowledgeDocument;
|
|
82
|
+
/**
|
|
83
|
+
* 3. Ultra-Fast High-Entropy Deterministic Page Assembler (RAM < 0.05ms)
|
|
84
|
+
*/
|
|
85
|
+
static assembleHighEntropyPage(doc: ModuleKnowledgeDocument, location: string, industry: string, lang?: string): {
|
|
86
|
+
title: string;
|
|
87
|
+
markdown: string;
|
|
88
|
+
wordCount: number;
|
|
89
|
+
entropyCombinationId: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🎯 Marketing Skills & Growth Engine (ASO, NAP Citations, E-E-A-T, Lead Magnets)
|
|
3
|
+
*
|
|
4
|
+
* Implements algorithms inspired by marketingskills, claude-seo, and local business builders:
|
|
5
|
+
* 1. AsoOptimizer: App Store Optimization (iOS / Google Play) & MobileApplication Schema
|
|
6
|
+
* 2. NapConsistencyEngine: Name, Address, Phone concordance auditor across 50+ local directories
|
|
7
|
+
* 3. EeatAuthorEngine: Author Authority & Credibility Scorer with sameAs Knowledge Graph validation
|
|
8
|
+
* 4. LeadMagnetEngine: Interactive Lead Magnet & Programmatic ROI Calculator generator
|
|
9
|
+
*/
|
|
10
|
+
export interface AsoAnalysisResult {
|
|
11
|
+
store: "iOS" | "GooglePlay";
|
|
12
|
+
titleLengthScore: number;
|
|
13
|
+
subtitleScore: number;
|
|
14
|
+
keywordFieldScore: number;
|
|
15
|
+
totalScore: number;
|
|
16
|
+
warnings: string[];
|
|
17
|
+
recommendations: string[];
|
|
18
|
+
schemaJson: object;
|
|
19
|
+
}
|
|
20
|
+
export interface NapAuditResult {
|
|
21
|
+
businessName: string;
|
|
22
|
+
phone: string;
|
|
23
|
+
address: string;
|
|
24
|
+
totalDirectoriesChecked: number;
|
|
25
|
+
matchingScore: number;
|
|
26
|
+
consistentCount: number;
|
|
27
|
+
conflictingCount: number;
|
|
28
|
+
directories: {
|
|
29
|
+
name: string;
|
|
30
|
+
category: "Search & Maps" | "Local Directories" | "Social & Voice";
|
|
31
|
+
status: "SYNCHRONISÉ" | "DIFFÉRENCE_DÉTECTÉE" | "NON_RÉFÉRENCÉ";
|
|
32
|
+
detectedPhone?: string;
|
|
33
|
+
detectedAddress?: string;
|
|
34
|
+
}[];
|
|
35
|
+
}
|
|
36
|
+
export interface EeatAuthorResult {
|
|
37
|
+
authorName: string;
|
|
38
|
+
jobTitle: string;
|
|
39
|
+
overallEeatScore: number;
|
|
40
|
+
grade: "A+" | "A" | "B" | "C";
|
|
41
|
+
dimensions: {
|
|
42
|
+
experienceScore: number;
|
|
43
|
+
expertiseScore: number;
|
|
44
|
+
authoritativenessScore: number;
|
|
45
|
+
trustworthinessScore: number;
|
|
46
|
+
};
|
|
47
|
+
verifiedEntities: string[];
|
|
48
|
+
schemaJson: object;
|
|
49
|
+
}
|
|
50
|
+
export interface LeadMagnetConfig {
|
|
51
|
+
leadMagnetType: "ROI_CALCULATOR" | "SEO_CHECKLIST" | "PRICE_ESTIMATOR" | "AUDIT_WIDGET";
|
|
52
|
+
title: string;
|
|
53
|
+
ctaText: string;
|
|
54
|
+
inputLabels: string[];
|
|
55
|
+
embeddableHtml: string;
|
|
56
|
+
}
|
|
57
|
+
export declare class MarketingSkillsEngine {
|
|
58
|
+
/**
|
|
59
|
+
* 1. 📱 ASO (App Store Optimization) Engine
|
|
60
|
+
*/
|
|
61
|
+
static analyzeAso(store: "iOS" | "GooglePlay", title: string, subtitleOrShortDesc: string, keywordsCsv: string, appUrl?: string): AsoAnalysisResult;
|
|
62
|
+
/**
|
|
63
|
+
* 2. 📍 NAP (Name, Address, Phone) Consistency Auditor
|
|
64
|
+
*/
|
|
65
|
+
static auditNap(businessName: string, phone: string, address: string): NapAuditResult;
|
|
66
|
+
/**
|
|
67
|
+
* 3. 👤 E-E-A-T & Author Profile Authority Validator
|
|
68
|
+
*/
|
|
69
|
+
static validateEeatAuthor(authorName: string, jobTitle: string, bio: string, sameAsUrls?: string[]): EeatAuthorResult;
|
|
70
|
+
/**
|
|
71
|
+
* 4. 🧲 Lead Magnet & Embeddable ROI Calculator Generator
|
|
72
|
+
*/
|
|
73
|
+
static generateLeadMagnet(type: "ROI_CALCULATOR" | "SEO_CHECKLIST" | "PRICE_ESTIMATOR" | "AUDIT_WIDGET", title: string, brandName?: string): LeadMagnetConfig;
|
|
74
|
+
}
|
package/dist/matrix-engine.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* - SeedRank legal compliance disclaimers & staleness checks
|
|
10
10
|
* - Tiered Indexing (crawl budget protection) & Geodesic Mesh Linking
|
|
11
11
|
*/
|
|
12
|
+
import { type TokenUsageRecord } from "./token-quota-manager";
|
|
12
13
|
export type MatrixFamily = "local-geo" | "vs-comparison" | "alternative" | "pricing" | "target" | "industry" | "persona" | "integration" | "use-case" | "template" | "glossary" | "calculator";
|
|
13
14
|
export interface PseoService {
|
|
14
15
|
slug: string;
|
|
@@ -241,6 +242,31 @@ export declare class PseoMatrixEngine {
|
|
|
241
242
|
allowAiBots?: boolean;
|
|
242
243
|
disallowPaths?: string[];
|
|
243
244
|
}): string;
|
|
245
|
+
/**
|
|
246
|
+
* 🏆 RENDER DEEP EDITORIAL MASTER PAGE (1,500+ WORDS ANTI-THIN-CONTENT)
|
|
247
|
+
* Assembles exhaustive, master-level editorial content combining direct answers,
|
|
248
|
+
* market context, architectural breakdowns, comparative matrices, step-by-step guides,
|
|
249
|
+
* localized economic statistics, and objection-handling FAQs.
|
|
250
|
+
*/
|
|
251
|
+
renderDeepEditorialPage(params: {
|
|
252
|
+
serviceName: string;
|
|
253
|
+
locationName: string;
|
|
254
|
+
industryName?: string;
|
|
255
|
+
brandName?: string;
|
|
256
|
+
monthlyPrice?: number;
|
|
257
|
+
currencySymbol?: string;
|
|
258
|
+
sourceParagraphs?: string[];
|
|
259
|
+
enableAiSmartLinking?: boolean;
|
|
260
|
+
tier?: "starter" | "growth" | "enterprise";
|
|
261
|
+
}): {
|
|
262
|
+
title: string;
|
|
263
|
+
metaDescription: string;
|
|
264
|
+
markdown: string;
|
|
265
|
+
wordCount: number;
|
|
266
|
+
linksInjected: number;
|
|
267
|
+
tokensConsumed: number;
|
|
268
|
+
tokenUsage?: TokenUsageRecord;
|
|
269
|
+
};
|
|
244
270
|
/**
|
|
245
271
|
* Computes telemetry & page metering data for syncing with LynxSEO Studio dashboard.
|
|
246
272
|
*/
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 🧠 Multilingual Power Words & Click Psychology Engine
|
|
3
|
-
*
|
|
2
|
+
* 🧠 Universal Open Multilingual Power Words & Click Psychology Engine
|
|
3
|
+
* Supports 50+ World Languages (FR, EN, ES, DE, IT, NL, PT, AR, RU, ZH, JA, HI, PL, SV, TR, KO, etc.)
|
|
4
|
+
* With Dynamic Runtime Dictionary Registration for Infinite Language Extensibility.
|
|
4
5
|
*/
|
|
5
|
-
export type LanguageCode =
|
|
6
|
+
export type LanguageCode = string;
|
|
7
|
+
export interface CategoryWordBank {
|
|
8
|
+
authority: string[];
|
|
9
|
+
urgency: string[];
|
|
10
|
+
value: string[];
|
|
11
|
+
curiosity: string[];
|
|
12
|
+
sentimentPositive: string[];
|
|
13
|
+
sentimentNegative: string[];
|
|
14
|
+
}
|
|
6
15
|
export interface PsychologyAnalysisResult {
|
|
7
16
|
score: number;
|
|
8
17
|
powerWordsDetected: string[];
|
|
@@ -12,24 +21,27 @@ export interface PsychologyAnalysisResult {
|
|
|
12
21
|
hasCuriosityTrigger: boolean;
|
|
13
22
|
hasUrgencyTrigger: boolean;
|
|
14
23
|
hasAuthorityTrigger: boolean;
|
|
24
|
+
hasCurrencyOrDiscount: boolean;
|
|
25
|
+
hasBracketsOrParentheses: boolean;
|
|
15
26
|
recommendations: string[];
|
|
16
27
|
suggestedTitles: string[];
|
|
17
28
|
}
|
|
18
|
-
export declare const MULTILINGUAL_POWER_WORDS: Record<
|
|
19
|
-
authority: string[];
|
|
20
|
-
urgency: string[];
|
|
21
|
-
value: string[];
|
|
22
|
-
curiosity: string[];
|
|
23
|
-
sentimentPositive: string[];
|
|
24
|
-
sentimentNegative: string[];
|
|
25
|
-
}>;
|
|
29
|
+
export declare const MULTILINGUAL_POWER_WORDS: Record<string, CategoryWordBank>;
|
|
26
30
|
export declare class PowerWordsPsychologyEngine {
|
|
27
31
|
/**
|
|
28
|
-
*
|
|
32
|
+
* Register a custom language dictionary at runtime for infinite language extensibility
|
|
33
|
+
*/
|
|
34
|
+
static registerLanguageWords(langCode: string, words: Partial<CategoryWordBank>): void;
|
|
35
|
+
/**
|
|
36
|
+
* Get all registered language codes
|
|
37
|
+
*/
|
|
38
|
+
static getSupportedLanguages(): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Analyze title psychology and CTR potential in ANY language
|
|
29
41
|
*/
|
|
30
|
-
static
|
|
42
|
+
static analyzeTitle(title: string, lang?: LanguageCode): PsychologyAnalysisResult;
|
|
31
43
|
/**
|
|
32
|
-
* Automatically enriches a programmatic title with
|
|
44
|
+
* Automatically enriches a programmatic title in ANY language with optimal psychology triggers
|
|
33
45
|
*/
|
|
34
|
-
static enrichProgrammaticTitle(
|
|
46
|
+
static enrichProgrammaticTitle(baseTitle: string, lang?: LanguageCode): string;
|
|
35
47
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🗺️ Universal Public Routes & Navigation Manifest Engine
|
|
3
|
+
*
|
|
4
|
+
* Allows developers and LLM agents to connect their real public pages (10-50 seed pages)
|
|
5
|
+
* from ANY framework (Next.js, TanStack Router, Astro, Nuxt, WordPress, Laravel, Remix).
|
|
6
|
+
*
|
|
7
|
+
* Instead of scanning millions of generated URLs, it inspects ONLY the root product pages,
|
|
8
|
+
* navigation menus, or route trees to build the knowledge base for all programmatic pages.
|
|
9
|
+
*/
|
|
10
|
+
export interface PublicRouteItem {
|
|
11
|
+
path: string;
|
|
12
|
+
title: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
category?: string;
|
|
15
|
+
paragraphs?: string[];
|
|
16
|
+
keyFeatures?: string[];
|
|
17
|
+
faqs?: {
|
|
18
|
+
question: string;
|
|
19
|
+
answer: string;
|
|
20
|
+
}[];
|
|
21
|
+
}
|
|
22
|
+
export interface FrameworkManifestConfig {
|
|
23
|
+
framework?: "nextjs" | "tanstack" | "astro" | "wordpress" | "nuxt" | "custom";
|
|
24
|
+
routes?: PublicRouteItem[];
|
|
25
|
+
navMenuItems?: Array<{
|
|
26
|
+
label: string;
|
|
27
|
+
url: string;
|
|
28
|
+
category?: string;
|
|
29
|
+
}>;
|
|
30
|
+
contentCollections?: Array<{
|
|
31
|
+
slug: string;
|
|
32
|
+
title: string;
|
|
33
|
+
content: string;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export declare class PublicRoutesManifestEngine {
|
|
37
|
+
private static registeredRoutes;
|
|
38
|
+
/**
|
|
39
|
+
* 1. Register Public Routes & Navigation Menu (Universal Entrypoint)
|
|
40
|
+
*/
|
|
41
|
+
static registerManifest(config: FrameworkManifestConfig): number;
|
|
42
|
+
/**
|
|
43
|
+
* 2. Auto-Adapter for WordPress Menu & Pages
|
|
44
|
+
* In WordPress: pass result of wp_get_nav_menu_items() or get_pages()
|
|
45
|
+
*/
|
|
46
|
+
static registerWordPressMenu(menuItems: Array<{
|
|
47
|
+
title: string;
|
|
48
|
+
url: string;
|
|
49
|
+
}>): number;
|
|
50
|
+
/**
|
|
51
|
+
* 3. Get all discovered seed public pages
|
|
52
|
+
*/
|
|
53
|
+
static getSeedRoutes(): PublicRouteItem[];
|
|
54
|
+
/**
|
|
55
|
+
* 4. Retrieve single route details
|
|
56
|
+
*/
|
|
57
|
+
static getRoute(pathOrSlug: string): PublicRouteItem | undefined;
|
|
58
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🧠 LynxRAG Hybrid Knowledge Engine (Enterprise pgvector & Local In-Memory Semantic Index)
|
|
3
|
+
*
|
|
4
|
+
* Provides unified RAG (Retrieval-Augmented Generation) capabilities:
|
|
5
|
+
* 1. Ingests Company PDFs, Pitch Decks, Product Catalogs, and Brand Kits
|
|
6
|
+
* 2. Chunks & stores semantic embeddings (pgvector compatible / in-memory cosine fallback)
|
|
7
|
+
* 3. Enriches AI Copilot Audit Reports with genuine company facts & certifications
|
|
8
|
+
* 4. Enriches Programmatic Pages with authentic proprietary statistics & guarantees
|
|
9
|
+
*/
|
|
10
|
+
export interface KnowledgeChunk {
|
|
11
|
+
id: string;
|
|
12
|
+
documentName: string;
|
|
13
|
+
category: "pricing" | "technical" | "case_study" | "certification" | "general";
|
|
14
|
+
content: string;
|
|
15
|
+
embedding?: number[];
|
|
16
|
+
keywords: string[];
|
|
17
|
+
tokenCount: number;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RagRetrievalResult {
|
|
21
|
+
chunk: KnowledgeChunk;
|
|
22
|
+
similarityScore: number;
|
|
23
|
+
}
|
|
24
|
+
export declare class LynxRagKnowledgeEngine {
|
|
25
|
+
private static chunkStore;
|
|
26
|
+
/**
|
|
27
|
+
* 1. Ingest Raw Document Text (from PDF, Word doc, or manual upload)
|
|
28
|
+
*/
|
|
29
|
+
static ingestDocument(siteId: string, documentName: string, rawText: string, category?: KnowledgeChunk["category"]): KnowledgeChunk[];
|
|
30
|
+
/**
|
|
31
|
+
* 2. Semantic Search & Top-K Chunks Retrieval (Fast In-Memory Cosine / Keyword Scoring)
|
|
32
|
+
*/
|
|
33
|
+
static retrieveRelevantContext(siteId: string, query: string, topK?: number): RagRetrievalResult[];
|
|
34
|
+
/**
|
|
35
|
+
* 3. AI Audit Report Enhancer (Injects Company Facts into AI Reports)
|
|
36
|
+
*/
|
|
37
|
+
static enrichAiReportPrompt(siteId: string, reportTopic: string, baseAuditMetrics: Record<string, unknown>): {
|
|
38
|
+
enrichedSystemPrompt: string;
|
|
39
|
+
retrievedFacts: string[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* 4. Programmatic Page Generator Enhancer (Injects Company Facts into Programmatic Pages)
|
|
43
|
+
*/
|
|
44
|
+
static getFactsForPageGeneration(siteId: string, service: string, location: string): string[];
|
|
45
|
+
/**
|
|
46
|
+
* 5. Clear or Get All Ingested Chunks for Site
|
|
47
|
+
*/
|
|
48
|
+
static getSiteChunks(siteId: string): KnowledgeChunk[];
|
|
49
|
+
static clearSiteChunks(siteId: string): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🌐 LynxRateLimitedTranslator (Lightweight SDK Client)
|
|
3
|
+
*
|
|
4
|
+
* Provides fast, rate-limited translation for the SDK:
|
|
5
|
+
* 1. Uses local in-memory multilingual dictionary (0ms, 0€)
|
|
6
|
+
* 2. Connects to the LynxSEO Backend API for serverless / high-volume translations
|
|
7
|
+
* 3. Supports optional Google Cloud Translation API Key if configured
|
|
8
|
+
*/
|
|
9
|
+
export interface TranslationClientConfig {
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
backendEndpoint?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class LynxRateLimitedTranslator {
|
|
14
|
+
private static cache;
|
|
15
|
+
/**
|
|
16
|
+
* Translates an array of strings safely
|
|
17
|
+
*/
|
|
18
|
+
static translateBatch(contents: string[], targetLang: string, sourceLang?: string, config?: TranslationClientConfig): Promise<string[]>;
|
|
19
|
+
}
|
|
@@ -30,6 +30,10 @@ export declare class TokenQuotaManager {
|
|
|
30
30
|
* Only charges credits when AI call succeeds (Issue #222 fix).
|
|
31
31
|
*/
|
|
32
32
|
consumeTokens(promptTokens: number, completionTokens: number, model: string, rawProviderCostUsd?: number): TokenUsageRecord;
|
|
33
|
+
/**
|
|
34
|
+
* Simple single token count consumption helper
|
|
35
|
+
*/
|
|
36
|
+
consume(tokens: number, model?: string): TokenUsageRecord;
|
|
33
37
|
/**
|
|
34
38
|
* Gets current credit quota status.
|
|
35
39
|
*/
|
package/package.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynxflow/seo-engine",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "High-Performance
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "High-Performance Universal Programmatic SEO & AI Search Engine SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
8
16
|
"exports": {
|
|
9
17
|
".": {
|
|
10
18
|
"import": "./dist/index.mjs",
|
|
@@ -13,7 +21,7 @@
|
|
|
13
21
|
}
|
|
14
22
|
},
|
|
15
23
|
"scripts": {
|
|
16
|
-
"build": "bun build src/index.ts --outdir dist",
|
|
24
|
+
"build": "bun build src/index.ts --outdir dist --target node && bun build src/index.ts --outfile dist/index.mjs --target node && tsc",
|
|
17
25
|
"typecheck": "tsc --noEmit"
|
|
18
26
|
},
|
|
19
27
|
"keywords": [
|