@lynxflow/seo-engine 1.4.1 โ 1.5.1
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 +84 -339
- package/TUTORIEL_INTEGRATION_SITE.md +283 -0
- package/connectors/wordpress/lynxseo-connector.zip +0 -0
- package/dist/ad-intelligence-cro.d.ts +58 -0
- package/dist/ai-bots-log-analyzer.d.ts +36 -0
- package/dist/analytics-client.d.ts +48 -11
- package/dist/auth-key.d.ts +9 -0
- package/dist/brand-dna-calendar.d.ts +35 -0
- package/dist/copy-frameworks-master.d.ts +56 -0
- package/dist/cro-copywriting-engine.d.ts +46 -0
- package/dist/crosslink-scorer.d.ts +33 -0
- package/dist/embeddable-seo-widget.d.ts +12 -0
- package/dist/engine.d.ts +29 -1
- package/dist/engine.test.d.ts +1 -0
- package/dist/extended-schemas.d.ts +106 -0
- package/dist/geo-mesh-linking.d.ts +33 -0
- package/dist/index.d.ts +88 -0
- package/dist/index.js +4173 -128
- package/dist/index.mjs +4101 -98
- package/dist/instant-matrix-search.d.ts +19 -0
- package/dist/isr-cache-manager.d.ts +35 -0
- package/dist/knowledge-graph-linker.d.ts +29 -0
- package/dist/legal-disclaimers.d.ts +46 -0
- package/dist/llm-content-cleaner.d.ts +16 -0
- package/dist/llm-prompt.d.ts +13 -0
- package/dist/master-marketing-engine.d.ts +114 -0
- package/dist/matrix-engine.d.ts +201 -0
- package/dist/mcp-seo-server.d.ts +21 -0
- package/dist/ngram-density-analyzer.d.ts +35 -0
- package/dist/rank-math-parity.d.ts +58 -0
- package/dist/real-reviews-sync.d.ts +73 -0
- package/dist/rss-syndication-feed.d.ts +25 -0
- package/dist/schema-builder.d.ts +6 -0
- package/dist/seo-opportunities-decay.d.ts +54 -0
- package/dist/serp-history-alerts.d.ts +27 -0
- package/dist/slug-engine.d.ts +32 -0
- package/dist/social-ads-seo.d.ts +77 -0
- package/dist/social-growth-suite.d.ts +125 -0
- package/dist/social-trend-seo.d.ts +38 -0
- package/dist/social-video-seo.d.ts +62 -0
- package/dist/team-rbac.d.ts +17 -0
- package/dist/technical-rules-auditor.d.ts +50 -0
- package/dist/types.d.ts +4 -44
- package/dist/yoast-parity.d.ts +45 -0
- package/package.json +8 -5
- package/src/ad-intelligence-cro.ts +140 -0
- package/src/ai-bots-log-analyzer.ts +127 -0
- package/src/analytics-client.ts +222 -48
- package/src/auth-key.ts +59 -0
- package/src/brand-dna-calendar.ts +120 -0
- package/src/copy-frameworks-master.ts +89 -0
- package/src/cro-copywriting-engine.ts +105 -0
- package/src/crosslink-scorer.ts +101 -0
- package/src/embeddable-seo-widget.ts +57 -0
- package/src/engine.test.ts +136 -0
- package/src/engine.ts +218 -27
- package/src/extended-schemas.ts +279 -0
- package/src/geo-mesh-linking.ts +93 -0
- package/src/index.ts +89 -0
- package/src/instant-matrix-search.ts +48 -0
- package/src/isr-cache-manager.ts +78 -0
- package/src/knowledge-graph-linker.ts +81 -0
- package/src/legal-disclaimers.ts +407 -0
- package/src/llm-content-cleaner.ts +64 -0
- package/src/llm-prompt.ts +81 -0
- package/src/master-marketing-engine.ts +314 -0
- package/src/matrix-engine.ts +818 -0
- package/src/mcp-seo-server.ts +108 -0
- package/src/ngram-density-analyzer.ts +108 -0
- package/src/rank-math-parity.ts +235 -0
- package/src/real-reviews-sync.ts +207 -0
- package/src/rss-syndication-feed.ts +56 -0
- package/src/schema-builder.ts +71 -24
- package/src/seo-opportunities-decay.ts +154 -0
- package/src/serp-history-alerts.ts +75 -0
- package/src/slug-engine.ts +183 -0
- package/src/social-ads-seo.ts +211 -0
- package/src/social-growth-suite.ts +310 -0
- package/src/social-trend-seo.ts +103 -0
- package/src/social-video-seo.ts +100 -0
- package/src/team-rbac.ts +61 -0
- package/src/technical-rules-auditor.ts +171 -0
- package/src/types.ts +22 -47
- package/src/yoast-parity.ts +161 -0
- package/tsconfig.json +2 -1
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global Legal Compliance & Editorial Disclaimer Engine for B2B pSEO
|
|
3
|
+
* Multilingual compliance and anti-disparagement verification across 10+ languages.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type DisclaimerType =
|
|
7
|
+
| "comparison"
|
|
8
|
+
| "pricing"
|
|
9
|
+
| "feature"
|
|
10
|
+
| "exclusivity"
|
|
11
|
+
| "statistics"
|
|
12
|
+
| "alternative"
|
|
13
|
+
| "listicle";
|
|
14
|
+
|
|
15
|
+
export interface DisclaimerTemplate {
|
|
16
|
+
type: DisclaimerType;
|
|
17
|
+
label: string;
|
|
18
|
+
templateText: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Multilingual Disclaimer Templates (English Default + Localized Fallbacks)
|
|
23
|
+
*/
|
|
24
|
+
export const MULTILINGUAL_DISCLAIMERS: Record<string, Record<DisclaimerType, DisclaimerTemplate>> = {
|
|
25
|
+
// ๐ฌ๐ง English (Default)
|
|
26
|
+
en: {
|
|
27
|
+
comparison: {
|
|
28
|
+
type: "comparison",
|
|
29
|
+
label: "Standard Comparison Notice",
|
|
30
|
+
templateText:
|
|
31
|
+
"Editorial note: We research and verify all claims in our comparison articles using publicly available documentation. Pricing and features are subject to change by each provider. Report any inaccuracies to {correctionsEmail}.",
|
|
32
|
+
},
|
|
33
|
+
pricing: {
|
|
34
|
+
type: "pricing",
|
|
35
|
+
label: "Pricing Transparency Disclaimer",
|
|
36
|
+
templateText:
|
|
37
|
+
"Pricing disclaimer: All competitor pricing and plan details were verified on {lastVerifiedDate}. Providers may update their rates at any time without notice. Please verify current rates on the official provider website before making purchasing decisions.",
|
|
38
|
+
},
|
|
39
|
+
feature: {
|
|
40
|
+
type: "feature",
|
|
41
|
+
label: "Feature Capability Note",
|
|
42
|
+
templateText:
|
|
43
|
+
"Feature comparison note: Feature availability and tier limits were verified on {lastVerifiedDate}. Software updates occur continuously; consult each vendor's documentation for live specifications.",
|
|
44
|
+
},
|
|
45
|
+
exclusivity: {
|
|
46
|
+
type: "exclusivity",
|
|
47
|
+
label: "Exclusivity Distinction Claim",
|
|
48
|
+
templateText:
|
|
49
|
+
"Distinction note: To the best of our knowledge as of {lastVerifiedDate}, this architectural capability distinction is accurate based on public benchmarks.",
|
|
50
|
+
},
|
|
51
|
+
statistics: {
|
|
52
|
+
type: "statistics",
|
|
53
|
+
label: "Public Data & Statistics Note",
|
|
54
|
+
templateText:
|
|
55
|
+
"Data note: Statistics and benchmarks cited in this article are derived from public industry reports and official platform metrics as of {lastVerifiedDate}.",
|
|
56
|
+
},
|
|
57
|
+
alternative: {
|
|
58
|
+
type: "alternative",
|
|
59
|
+
label: "Alternative Directory Notice",
|
|
60
|
+
templateText:
|
|
61
|
+
"Editorial note: This page compares software alternatives objectively based on public specifications, user feedback, and architectural differences to help buyers make informed decisions.",
|
|
62
|
+
},
|
|
63
|
+
listicle: {
|
|
64
|
+
type: "listicle",
|
|
65
|
+
label: "Curated Directory & Review Notice",
|
|
66
|
+
templateText:
|
|
67
|
+
"Editorial note: Rankings and software evaluations reflect our objective editorial criteria and testing methodology. Inaccuracies can be flagged to {correctionsEmail}.",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
// ๐ซ๐ท French
|
|
72
|
+
fr: {
|
|
73
|
+
comparison: {
|
|
74
|
+
type: "comparison",
|
|
75
|
+
label: "Note รditoriale de Comparatif",
|
|
76
|
+
templateText:
|
|
77
|
+
"Note รฉditoriale : Nous vรฉrifions scrupuleusement les informations sur la base des documentations publiques. Les fonctionnalitรฉs et tarifs รฉvoluent rรฉguliรจrement. Signalez toute inexactitude ร {correctionsEmail}.",
|
|
78
|
+
},
|
|
79
|
+
pricing: {
|
|
80
|
+
type: "pricing",
|
|
81
|
+
label: "Avertissement sur les Tarifs",
|
|
82
|
+
templateText:
|
|
83
|
+
"Avertissement tarifaire : Les prix et offres ont รฉtรฉ relevรฉs le {lastVerifiedDate}. Les รฉditeurs peuvent modifier leurs conditions sans prรฉavis. Vรฉrifiez les tarifs officiels avant toute souscription.",
|
|
84
|
+
},
|
|
85
|
+
feature: {
|
|
86
|
+
type: "feature",
|
|
87
|
+
label: "Vรฉrification des Fonctionnalitรฉs",
|
|
88
|
+
templateText:
|
|
89
|
+
"Note sur les fonctionnalitรฉs : La disponibilitรฉ des options a รฉtรฉ vรฉrifiรฉe le {lastVerifiedDate}. Consultez les sites รฉditeurs pour les spรฉcifications en direct.",
|
|
90
|
+
},
|
|
91
|
+
exclusivity: {
|
|
92
|
+
type: "exclusivity",
|
|
93
|
+
label: "Revendication d'Exclusivitรฉ",
|
|
94
|
+
templateText:
|
|
95
|
+
"Note d'exclusivitรฉ : Selon nos informations vรฉrifiรฉes au {lastVerifiedDate}, cette capacitรฉ technique est exclusive ร notre plateforme.",
|
|
96
|
+
},
|
|
97
|
+
statistics: {
|
|
98
|
+
type: "statistics",
|
|
99
|
+
label: "Donnรฉes et Statistiques Publiques",
|
|
100
|
+
templateText:
|
|
101
|
+
"Source des donnรฉes : Les mรฉtriques citรฉes proviennent de rapports sectoriels publics au {lastVerifiedDate}.",
|
|
102
|
+
},
|
|
103
|
+
alternative: {
|
|
104
|
+
type: "alternative",
|
|
105
|
+
label: "Annuaire des Alternatives",
|
|
106
|
+
templateText:
|
|
107
|
+
"Note รฉditoriale : Cette sรฉlection compare objectivement les solutions du marchรฉ pour รฉclairer le choix des dรฉcideurs.",
|
|
108
|
+
},
|
|
109
|
+
listicle: {
|
|
110
|
+
type: "listicle",
|
|
111
|
+
label: "Mรฉthodologie de Classement",
|
|
112
|
+
templateText:
|
|
113
|
+
"Note รฉditoriale : Ce classement reflรจte notre analyse technique indรฉpendante. Contact : {correctionsEmail}.",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
// ๐ฉ๐ช German
|
|
118
|
+
de: {
|
|
119
|
+
comparison: {
|
|
120
|
+
type: "comparison",
|
|
121
|
+
label: "Redaktioneller Vergleichshinweis",
|
|
122
|
+
templateText:
|
|
123
|
+
"Redaktioneller Hinweis: Wir recherchieren und prรผfen alle Angaben anhand รถffentlich zugรคnglicher Dokumentationen. Preise und Funktionen kรถnnen sich รคndern. Bitte melden Sie Unstimmigkeiten an {correctionsEmail}.",
|
|
124
|
+
},
|
|
125
|
+
pricing: {
|
|
126
|
+
type: "pricing",
|
|
127
|
+
label: "Preistransparenz-Hinweis",
|
|
128
|
+
templateText:
|
|
129
|
+
"Preishinweis: Alle Preisangaben wurden am {lastVerifiedDate} รผberprรผft. Anbieter kรถnnen ihre Preise jederzeit anpassen. Bitte prรผfen Sie die offiziellen Anbieterseiten.",
|
|
130
|
+
},
|
|
131
|
+
feature: {
|
|
132
|
+
type: "feature",
|
|
133
|
+
label: "Funktionshinweis",
|
|
134
|
+
templateText:
|
|
135
|
+
"Funktionshinweis: Die Verfรผgbarkeit von Funktionen wurde am {lastVerifiedDate} verifiziert.",
|
|
136
|
+
},
|
|
137
|
+
exclusivity: {
|
|
138
|
+
type: "exclusivity",
|
|
139
|
+
label: "Exklusivitรคtsangabe",
|
|
140
|
+
templateText:
|
|
141
|
+
"Hinweis: Nach unserem Kenntnisstand vom {lastVerifiedDate} ist dieses Merkmal eine spezifische Eigenschaft unserer Lรถsung.",
|
|
142
|
+
},
|
|
143
|
+
statistics: {
|
|
144
|
+
type: "statistics",
|
|
145
|
+
label: "Statistikhinweis",
|
|
146
|
+
templateText:
|
|
147
|
+
"Datenhinweis: Die genannten Statistiken basieren auf รถffentlich zugรคnglichen Branchenberichten mit Stand vom {lastVerifiedDate}.",
|
|
148
|
+
},
|
|
149
|
+
alternative: {
|
|
150
|
+
type: "alternative",
|
|
151
|
+
label: "Alternativen-Verzeichnis",
|
|
152
|
+
templateText:
|
|
153
|
+
"Redaktioneller Hinweis: Dieser Vergleich bietet eine objektive Gegenรผberstellung moderner Software-Alternativen.",
|
|
154
|
+
},
|
|
155
|
+
listicle: {
|
|
156
|
+
type: "listicle",
|
|
157
|
+
label: "Bewertungshinweis",
|
|
158
|
+
templateText:
|
|
159
|
+
"Redaktioneller Hinweis: Bewertungen basieren auf unserer unabhรคngigen Testmethodik. Feedback an {correctionsEmail}.",
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
// ๐ช๐ธ Spanish
|
|
164
|
+
es: {
|
|
165
|
+
comparison: {
|
|
166
|
+
type: "comparison",
|
|
167
|
+
label: "Nota Editorial Comparativa",
|
|
168
|
+
templateText:
|
|
169
|
+
"Nota editorial: Investigamos y verificamos la informaciรณn con datos pรบblicos. Los precios y funciones pueden variar. Notifique cualquier error a {correctionsEmail}.",
|
|
170
|
+
},
|
|
171
|
+
pricing: {
|
|
172
|
+
type: "pricing",
|
|
173
|
+
label: "Aviso sobre Precios",
|
|
174
|
+
templateText:
|
|
175
|
+
"Aviso de precios: Toda la informaciรณn de precios fue verificada el {lastVerifiedDate}. Los proveedores pueden cambiar sus tarifas sin previo aviso.",
|
|
176
|
+
},
|
|
177
|
+
feature: {
|
|
178
|
+
type: "feature",
|
|
179
|
+
label: "Nota de Funcionalidades",
|
|
180
|
+
templateText:
|
|
181
|
+
"Nota de funciones: La disponibilidad de funciones fue verificada el {lastVerifiedDate}.",
|
|
182
|
+
},
|
|
183
|
+
exclusivity: {
|
|
184
|
+
type: "exclusivity",
|
|
185
|
+
label: "Distinciรณn Exclusiva",
|
|
186
|
+
templateText:
|
|
187
|
+
"Nota de exclusividad: Segรบn los datos verificados al {lastVerifiedDate}, esta capacidad es รบnica de nuestra plataforma.",
|
|
188
|
+
},
|
|
189
|
+
statistics: {
|
|
190
|
+
type: "statistics",
|
|
191
|
+
label: "Datos Estadรญsticos",
|
|
192
|
+
templateText:
|
|
193
|
+
"Nota de datos: Las estadรญsticas provienen de informes sectoriales pรบblicos al {lastVerifiedDate}.",
|
|
194
|
+
},
|
|
195
|
+
alternative: {
|
|
196
|
+
type: "alternative",
|
|
197
|
+
label: "Directorio de Alternativas",
|
|
198
|
+
templateText:
|
|
199
|
+
"Nota editorial: Esta pรกgina compara alternativas de software de forma objetiva para ayudar en la toma de decisiones.",
|
|
200
|
+
},
|
|
201
|
+
listicle: {
|
|
202
|
+
type: "listicle",
|
|
203
|
+
label: "Metodologรญa del Ranking",
|
|
204
|
+
templateText:
|
|
205
|
+
"Nota editorial: Las recomendaciones se basan en nuestro anรกlisis objetivo. Contacto: {correctionsEmail}.",
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Multilingual Banned & Disparaging Words Dictionary across 10 Languages
|
|
212
|
+
*/
|
|
213
|
+
export const MULTILINGUAL_BANNED_DISPARAGING_WORDS: Record<string, string[]> = {
|
|
214
|
+
// ๐ฌ๐ง English
|
|
215
|
+
en: [
|
|
216
|
+
"is a scam",
|
|
217
|
+
"fraudulent",
|
|
218
|
+
"worst software",
|
|
219
|
+
"useless product",
|
|
220
|
+
"terrible company",
|
|
221
|
+
"don't trust",
|
|
222
|
+
"rip-off",
|
|
223
|
+
"garbage software",
|
|
224
|
+
"incompetent",
|
|
225
|
+
],
|
|
226
|
+
|
|
227
|
+
// ๐ซ๐ท French
|
|
228
|
+
fr: [
|
|
229
|
+
"est une arnaque",
|
|
230
|
+
"frauduleux",
|
|
231
|
+
"pire logiciel",
|
|
232
|
+
"produit inutile",
|
|
233
|
+
"entreprise malhonnรชte",
|
|
234
|
+
"ne faites pas confiance",
|
|
235
|
+
"escroquerie",
|
|
236
|
+
"logiciel poubelle",
|
|
237
|
+
"incompรฉtent",
|
|
238
|
+
],
|
|
239
|
+
|
|
240
|
+
// ๐ฉ๐ช German
|
|
241
|
+
de: [
|
|
242
|
+
"ist ein betrug",
|
|
243
|
+
"betrรผgerisch",
|
|
244
|
+
"schlechteste software",
|
|
245
|
+
"nutzloses produkt",
|
|
246
|
+
"unseriรถse firma",
|
|
247
|
+
"nicht vertrauen",
|
|
248
|
+
"abzocke",
|
|
249
|
+
"mรผll software",
|
|
250
|
+
"inkompetent",
|
|
251
|
+
],
|
|
252
|
+
|
|
253
|
+
// ๐ช๐ธ Spanish
|
|
254
|
+
es: [
|
|
255
|
+
"es una estafa",
|
|
256
|
+
"fraudulento",
|
|
257
|
+
"peor software",
|
|
258
|
+
"producto inutil",
|
|
259
|
+
"empresa deshonesta",
|
|
260
|
+
"no confie",
|
|
261
|
+
"timo",
|
|
262
|
+
"software basura",
|
|
263
|
+
"incompetente",
|
|
264
|
+
],
|
|
265
|
+
|
|
266
|
+
// ๐ฎ๐น Italian
|
|
267
|
+
it: [
|
|
268
|
+
"e una truffa",
|
|
269
|
+
"fraudolento",
|
|
270
|
+
"peggior software",
|
|
271
|
+
"prodotto inutile",
|
|
272
|
+
"azienda disonesta",
|
|
273
|
+
"non fidarti",
|
|
274
|
+
"fregatura",
|
|
275
|
+
"software spazzatura",
|
|
276
|
+
],
|
|
277
|
+
|
|
278
|
+
// ๐ต๐น Portuguese
|
|
279
|
+
pt: [
|
|
280
|
+
"e um golpe",
|
|
281
|
+
"fraudulento",
|
|
282
|
+
"pior software",
|
|
283
|
+
"produto inutil",
|
|
284
|
+
"empresa desonesta",
|
|
285
|
+
"nao confie",
|
|
286
|
+
"engranacao",
|
|
287
|
+
"software lixo",
|
|
288
|
+
],
|
|
289
|
+
|
|
290
|
+
// ๐ณ๐ฑ Dutch
|
|
291
|
+
nl: [
|
|
292
|
+
"is oplichterij",
|
|
293
|
+
"frauduleus",
|
|
294
|
+
"slechtste software",
|
|
295
|
+
"nutteloos product",
|
|
296
|
+
"onbetrouwbaar bedrijf",
|
|
297
|
+
"niet vertrouwen",
|
|
298
|
+
],
|
|
299
|
+
|
|
300
|
+
// ๐ท๐บ Russian (Latinized)
|
|
301
|
+
ru: [
|
|
302
|
+
"eto moshennichestvo",
|
|
303
|
+
"hudshiy soft",
|
|
304
|
+
"bespoleznyy produkt",
|
|
305
|
+
"obman",
|
|
306
|
+
],
|
|
307
|
+
|
|
308
|
+
// ๐ธ๐ช Swedish
|
|
309
|
+
sv: [
|
|
310
|
+
"ar en bluff",
|
|
311
|
+
"bedraglig",
|
|
312
|
+
"samsta mjukvaran",
|
|
313
|
+
"vardelos produkt",
|
|
314
|
+
"lita inte pa",
|
|
315
|
+
],
|
|
316
|
+
|
|
317
|
+
// ๐ต๐ฑ Polish
|
|
318
|
+
pl: [
|
|
319
|
+
"to oszustwo",
|
|
320
|
+
"najgorsze oprogramowanie",
|
|
321
|
+
"bezuzyteczny produkt",
|
|
322
|
+
"nie ufaj",
|
|
323
|
+
],
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
export interface LegalEngineOptions {
|
|
327
|
+
companyName?: string;
|
|
328
|
+
correctionsEmail?: string;
|
|
329
|
+
dataStalenessDays?: number;
|
|
330
|
+
language?: string;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export class LegalDisclaimerEngine {
|
|
334
|
+
private companyName: string;
|
|
335
|
+
private correctionsEmail: string;
|
|
336
|
+
private dataStalenessDays: number;
|
|
337
|
+
private defaultLanguage: string;
|
|
338
|
+
|
|
339
|
+
constructor(options: LegalEngineOptions = {}) {
|
|
340
|
+
this.companyName = options.companyName || "Our Platform";
|
|
341
|
+
this.correctionsEmail = options.correctionsEmail || "compliance@platform.com";
|
|
342
|
+
this.dataStalenessDays = options.dataStalenessDays ?? 90;
|
|
343
|
+
this.defaultLanguage = options.language || "en";
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Generates a fully resolved disclaimer note in the target language (defaults to English).
|
|
348
|
+
*/
|
|
349
|
+
getDisclaimer(type: DisclaimerType, lastVerifiedDate?: string, language?: string): string {
|
|
350
|
+
const lang = language || this.defaultLanguage;
|
|
351
|
+
const langTemplates = MULTILINGUAL_DISCLAIMERS[lang] || MULTILINGUAL_DISCLAIMERS.en;
|
|
352
|
+
const template = langTemplates[type]?.templateText || MULTILINGUAL_DISCLAIMERS.en.comparison.templateText;
|
|
353
|
+
const dateStr = lastVerifiedDate || new Date().toISOString().split("T")[0];
|
|
354
|
+
|
|
355
|
+
return template
|
|
356
|
+
.replace(/{companyName}/g, this.companyName)
|
|
357
|
+
.replace(/{correctionsEmail}/g, this.correctionsEmail)
|
|
358
|
+
.replace(/{lastVerifiedDate}/g, dateStr);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Evaluates if competitor pricing or feature claim data is older than the allowed staleness window (default: 90 days).
|
|
363
|
+
*/
|
|
364
|
+
isDataStale(lastVerifiedDateStr?: string): boolean {
|
|
365
|
+
if (!lastVerifiedDateStr) return true;
|
|
366
|
+
const verified = new Date(lastVerifiedDateStr).getTime();
|
|
367
|
+
if (isNaN(verified)) return true;
|
|
368
|
+
|
|
369
|
+
const diffDays = (Date.now() - verified) / (1000 * 60 * 60 * 24);
|
|
370
|
+
return diffDays > this.dataStalenessDays;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Validates content against disparaging or legally hazardous statements across all supported languages.
|
|
375
|
+
*/
|
|
376
|
+
validateCompliance(content: string, competitorName: string, language: string = "all"): { isCompliant: boolean; warnings: string[] } {
|
|
377
|
+
const warnings: string[] = [];
|
|
378
|
+
const lowerContent = content.toLowerCase();
|
|
379
|
+
const lowerComp = competitorName.toLowerCase();
|
|
380
|
+
|
|
381
|
+
// Check banned phrases in target language or across all languages
|
|
382
|
+
const activeLanguages = language === "all"
|
|
383
|
+
? Object.keys(MULTILINGUAL_BANNED_DISPARAGING_WORDS)
|
|
384
|
+
: [language];
|
|
385
|
+
|
|
386
|
+
for (const lang of activeLanguages) {
|
|
387
|
+
const phrases = MULTILINGUAL_BANNED_DISPARAGING_WORDS[lang] || [];
|
|
388
|
+
for (const phrase of phrases) {
|
|
389
|
+
if (lowerContent.includes(phrase)) {
|
|
390
|
+
warnings.push(`[${lang.toUpperCase()}] Hazardous disparaging claim detected: "${phrase}". Maintain objective technical framing.`);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// Mention frequency check (prevent trademark keyword stuffing)
|
|
396
|
+
const regex = new RegExp(`\\b${lowerComp}\\b`, "gi");
|
|
397
|
+
const count = (lowerContent.match(regex) || []).length;
|
|
398
|
+
if (count > 25) {
|
|
399
|
+
warnings.push(`Excessive competitor trademark mentions (${count} times). Reduce to under 20 to avoid trademark dilution flags.`);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
return {
|
|
403
|
+
isCompliant: warnings.length === 0,
|
|
404
|
+
warnings,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ๐งน Boilerplate Stripper & Clean Markdown Extractor for LLMs (Inspiration: openserp/extract)
|
|
3
|
+
*
|
|
4
|
+
* Strips navigation, headers, footers, cookie banners, and advertisements from raw HTML
|
|
5
|
+
* to produce clean, high-density markdown text for AI search ingestion (/llms.txt & ChatGPT).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export class LlmContentCleaner {
|
|
9
|
+
/**
|
|
10
|
+
* Alias: Cleans text or markdown for LLMs.
|
|
11
|
+
*/
|
|
12
|
+
static cleanForLlm(content: string): string {
|
|
13
|
+
return this.htmlToCleanMarkdown(content);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Cleans raw HTML and returns pure readable markdown content.
|
|
18
|
+
*/
|
|
19
|
+
static htmlToCleanMarkdown(rawHtml: string): string {
|
|
20
|
+
if (!rawHtml) return "";
|
|
21
|
+
|
|
22
|
+
let cleaned = rawHtml
|
|
23
|
+
// Remove scripts, styles, iframes, SVGs
|
|
24
|
+
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, " ")
|
|
25
|
+
.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi, " ")
|
|
26
|
+
.replace(/<svg\b[^<]*(?:(?!<\/svg>)<[^<]*)*<\/svg>/gi, " ")
|
|
27
|
+
.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, " ")
|
|
28
|
+
// Remove navigation, headers, footers, modals, cookie banners
|
|
29
|
+
.replace(/<nav\b[^<]*(?:(?!<\/nav>)<[^<]*)*<\/nav>/gi, " ")
|
|
30
|
+
.replace(/<footer\b[^<]*(?:(?!<\/footer>)<[^<]*)*<\/footer>/gi, " ")
|
|
31
|
+
.replace(/<header\b[^<]*(?:(?!<\/header>)<[^<]*)*<\/header>/gi, " ")
|
|
32
|
+
.replace(/<aside\b[^<]*(?:(?!<\/aside>)<[^<]*)*<\/aside>/gi, " ")
|
|
33
|
+
// Convert headings
|
|
34
|
+
.replace(/<h1[^>]*>([\s\S]*?)<\/h1>/gi, "\n# $1\n")
|
|
35
|
+
.replace(/<h2[^>]*>([\s\S]*?)<\/h2>/gi, "\n## $1\n")
|
|
36
|
+
.replace(/<h3[^>]*>([\s\S]*?)<\/h3>/gi, "\n### $1\n")
|
|
37
|
+
.replace(/<h4[^>]*>([\s\S]*?)<\/h4>/gi, "\n#### $1\n")
|
|
38
|
+
// Convert lists
|
|
39
|
+
.replace(/<li[^>]*>([\s\S]*?)<\/li>/gi, "\n* $1")
|
|
40
|
+
// Convert paragraphs and line breaks
|
|
41
|
+
.replace(/<p[^>]*>([\s\S]*?)<\/p>/gi, "\n$1\n")
|
|
42
|
+
.replace(/<br\s*[\/]?>/gi, "\n")
|
|
43
|
+
// Convert links
|
|
44
|
+
.replace(/<a[^>]*href=["']([^"']*)["'][^>]*>([\s\S]*?)<\/a>/gi, "[$2]($1)")
|
|
45
|
+
// Strip remaining HTML tags
|
|
46
|
+
.replace(/<[^>]+>/g, " ")
|
|
47
|
+
// Decode basic HTML entities
|
|
48
|
+
.replace(/ /g, " ")
|
|
49
|
+
.replace(/&/g, "&")
|
|
50
|
+
.replace(/</g, "<")
|
|
51
|
+
.replace(/>/g, ">")
|
|
52
|
+
.replace(/"/g, '"')
|
|
53
|
+
.replace(/'/g, "'");
|
|
54
|
+
|
|
55
|
+
// Clean whitespace and repeated linebreaks
|
|
56
|
+
cleaned = cleaned
|
|
57
|
+
.split("\n")
|
|
58
|
+
.map((line) => line.trim())
|
|
59
|
+
.filter((line, i, arr) => line !== "" || (i > 0 && arr[i - 1] !== ""))
|
|
60
|
+
.join("\n");
|
|
61
|
+
|
|
62
|
+
return cleaned.trim();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in AI Agent & LLM System Prompt Guide
|
|
3
|
+
* Provides complete operational context for autonomous coding agents (Claude, Cursor, Copilot, ChatGPT, Antigravity)
|
|
4
|
+
* to configure Programmatic SEO correctly without leaking backend providers or hardcoding translations.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const PSEO_AGENT_SYSTEM_PROMPT = `
|
|
8
|
+
You are the Programmatic SEO Implementation Specialist powered by @lynxflow/seo-engine.
|
|
9
|
+
Your role is to configure, resolve, and maintain programmatic SEO pages, XML sitemaps, Schema.org JSON-LD graphs, and compliance rules.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### ๐จ 1. CRITICAL RULE: FEATURE DISCOVERY FROM FRONTEND ONLY (NEVER USE BACKEND / PROVIDERS)
|
|
14
|
+
|
|
15
|
+
When discovering or listing product modules, features, or services to build the SEO matrices:
|
|
16
|
+
- **โ NEVER inspect backend API routes, internal database folders, or third-party providers:**
|
|
17
|
+
- DO NOT create programmatic pages for internal plumbing like: \`/api/stripe\`, \`/api/resend\`, \`/api/auth\`, \`/api/d1\`, \`/api/webhooks\`, \`/api/openai\`.
|
|
18
|
+
- DO NOT expose internal infrastructure, vendors, or suppliers (e.g. Stripe, Resend, Cloudflare D1, Better-Auth, Supabase, PostgreSQL drivers) as public product features. End users never search for or buy your internal backend plumbing.
|
|
19
|
+
- **โ
ALWAYS inspect the FRONTEND user-facing interface & commercial value propositions:**
|
|
20
|
+
- Read marketing navigation menus & dropdowns (\`components/Navbar.tsx\`, \`components/Header.tsx\`, \`components/Navigation.tsx\`).
|
|
21
|
+
- Read marketing feature pages & pricing tiers (\`app/(marketing)/*\`, \`pages/features/*\`, \`app/pricing/*\`).
|
|
22
|
+
- Read dashboard UI workflows & user modules (\`components/dashboard/*\`, \`components/sidebar/*\`).
|
|
23
|
+
- Identify the actual **benefits and tools the end-user buys** (e.g. "Visual Pipeline Kanban", "Automated Invoice Tracking", "Electronic Signature", "Real-Time Client Portal", "Custom Reporting").
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
### ๐ 2. ARCHITECTURAL RULE: THE WEBSITE OWNS ITS LANGUAGES (i18n)
|
|
28
|
+
|
|
29
|
+
- **The Website (Application) is the sole owner of its languages, routes, and translations:**
|
|
30
|
+
- The website provides its own localized routes (e.g. \`app/[locale]/[...slug]/page.tsx\`) and dictionary files (\`next-intl\`, \`i18next\`, Astro i18n).
|
|
31
|
+
- **The SDK is a 100% language-agnostic structural engine:**
|
|
32
|
+
- The SDK receives the \`locale\` and data passed by the application at runtime.
|
|
33
|
+
- The SDK generates Google-compliant Schema.org JSON-LD, resolves routes in-memory (< 0.05ms), normalizes slugs, builds cross-language \`hreflang\` alternate tags, and partitions sitemaps.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
### ๐๏ธ 3. MATRIX ARCHITECTURE: 10 ROOT PILLARS & 50+ SPECIALIZED SUB-MATRICES
|
|
38
|
+
|
|
39
|
+
1. **10 Canonical Root Pillars:**
|
|
40
|
+
- Comparisons: \`/vs/{competitor}\`
|
|
41
|
+
- Alternatives: \`/alternatives/{competitor}\` (Zero keyword stuttering)
|
|
42
|
+
- Pricing: \`/pricing/{competitor}\`
|
|
43
|
+
- Audiences: \`/for/{target}\` (Unified industry/role mapping, anti-cannibalization)
|
|
44
|
+
- Integrations: \`/integrations/{app}\` (Clean slug without stop words)
|
|
45
|
+
- Use Cases: \`/use-cases/{useCase}\` (Actionable workflows with HowTo JSON-LD)
|
|
46
|
+
- Templates: \`/templates/{slug}\` (High-converting spreadsheet/notion lead magnets)
|
|
47
|
+
- Glossary: \`/glossary/{term}\` (Topic authority cluster hub)
|
|
48
|
+
- Tools: \`/tools/{calculator}\` (Interactive ROI & value estimators)
|
|
49
|
+
- Local Geo: \`/solutions/{service}/{country}/{city}\` (Tiered Indexing & Mesh Links)
|
|
50
|
+
|
|
51
|
+
2. **50+ Specialized Sub-Matrix Dimensions:**
|
|
52
|
+
- **Industry & Regulatory (12):** Sector ร Compliance (e.g., GDPR Law Firm), Sector ร Team Size.
|
|
53
|
+
- **Role & Workflow (10):** Role ร Core KPI (e.g., Sales Director Revenue), Role ร Daily Toolchain.
|
|
54
|
+
- **Multi-Format Templates (8):** Subject ร Format (Excel .xlsx, Notion, Google Sheets, Word, PDF).
|
|
55
|
+
- **Ecosystem & Integrations (10):** Module ร App (e.g., CRM ร Shopify), Connector ร Webhook Trigger.
|
|
56
|
+
- **Problem Playbooks (8):** Pain Point ร Step-by-Step Playbook, Bottleneck ร ROI.
|
|
57
|
+
- **Interactive Calculators (6):** Time-Saved Estimator, Revenue Uplift Simulator.
|
|
58
|
+
- **Topic Authority Clusters (6):** Financial Metrics (MRR, LTV), Technical Protocols (OAuth, Webhook).
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### ๐งน 4. URL SLUG INTEGRITY & SCHEMA.ORG
|
|
63
|
+
|
|
64
|
+
- Use \`cleanSeoSlug(text, { language })\` to strip accents, dates, and stop words.
|
|
65
|
+
- Use \`ExtendedSchemaGraphBuilder\` to output valid JSON-LD graphs (\`SoftwareApplication\`, \`LocalBusiness\`, \`HowTo\`, \`FAQPage\`, \`BreadcrumbList\`, \`Organization\`).
|
|
66
|
+
`.trim();
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns the complete LLM guidance prompt for AI agents and developer copilots.
|
|
70
|
+
*/
|
|
71
|
+
export function getSeoAgentPrompt(customContext?: { brandName?: string; domain?: string }): string {
|
|
72
|
+
if (!customContext) return PSEO_AGENT_SYSTEM_PROMPT;
|
|
73
|
+
|
|
74
|
+
return `
|
|
75
|
+
${PSEO_AGENT_SYSTEM_PROMPT}
|
|
76
|
+
|
|
77
|
+
### ๐ข Current Project Context:
|
|
78
|
+
- Brand Name: ${customContext.brandName || "Our Platform"}
|
|
79
|
+
- Domain: ${customContext.domain || "https://example.com"}
|
|
80
|
+
`.trim();
|
|
81
|
+
}
|