@lynxflow/seo-engine 1.4.1 → 1.5.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.
Files changed (85) hide show
  1. package/README.md +84 -339
  2. package/TUTORIEL_INTEGRATION_SITE.md +283 -0
  3. package/connectors/wordpress/lynxseo-connector.zip +0 -0
  4. package/dist/ad-intelligence-cro.d.ts +58 -0
  5. package/dist/ai-bots-log-analyzer.d.ts +36 -0
  6. package/dist/analytics-client.d.ts +48 -11
  7. package/dist/auth-key.d.ts +9 -0
  8. package/dist/brand-dna-calendar.d.ts +35 -0
  9. package/dist/copy-frameworks-master.d.ts +56 -0
  10. package/dist/cro-copywriting-engine.d.ts +46 -0
  11. package/dist/crosslink-scorer.d.ts +33 -0
  12. package/dist/embeddable-seo-widget.d.ts +12 -0
  13. package/dist/engine.d.ts +29 -1
  14. package/dist/engine.test.d.ts +1 -0
  15. package/dist/extended-schemas.d.ts +106 -0
  16. package/dist/geo-mesh-linking.d.ts +33 -0
  17. package/dist/index.d.ts +88 -0
  18. package/dist/index.js +4162 -128
  19. package/dist/index.mjs +4090 -98
  20. package/dist/instant-matrix-search.d.ts +19 -0
  21. package/dist/isr-cache-manager.d.ts +35 -0
  22. package/dist/knowledge-graph-linker.d.ts +29 -0
  23. package/dist/legal-disclaimers.d.ts +46 -0
  24. package/dist/llm-content-cleaner.d.ts +16 -0
  25. package/dist/llm-prompt.d.ts +13 -0
  26. package/dist/master-marketing-engine.d.ts +114 -0
  27. package/dist/matrix-engine.d.ts +201 -0
  28. package/dist/mcp-seo-server.d.ts +21 -0
  29. package/dist/ngram-density-analyzer.d.ts +35 -0
  30. package/dist/rank-math-parity.d.ts +58 -0
  31. package/dist/real-reviews-sync.d.ts +73 -0
  32. package/dist/rss-syndication-feed.d.ts +25 -0
  33. package/dist/schema-builder.d.ts +6 -0
  34. package/dist/seo-opportunities-decay.d.ts +54 -0
  35. package/dist/serp-history-alerts.d.ts +27 -0
  36. package/dist/slug-engine.d.ts +32 -0
  37. package/dist/social-ads-seo.d.ts +77 -0
  38. package/dist/social-growth-suite.d.ts +125 -0
  39. package/dist/social-trend-seo.d.ts +38 -0
  40. package/dist/social-video-seo.d.ts +62 -0
  41. package/dist/team-rbac.d.ts +17 -0
  42. package/dist/technical-rules-auditor.d.ts +50 -0
  43. package/dist/types.d.ts +4 -44
  44. package/dist/yoast-parity.d.ts +45 -0
  45. package/package.json +8 -5
  46. package/src/ad-intelligence-cro.ts +140 -0
  47. package/src/ai-bots-log-analyzer.ts +127 -0
  48. package/src/analytics-client.ts +222 -48
  49. package/src/auth-key.ts +59 -0
  50. package/src/brand-dna-calendar.ts +120 -0
  51. package/src/copy-frameworks-master.ts +89 -0
  52. package/src/cro-copywriting-engine.ts +105 -0
  53. package/src/crosslink-scorer.ts +101 -0
  54. package/src/embeddable-seo-widget.ts +57 -0
  55. package/src/engine.test.ts +136 -0
  56. package/src/engine.ts +218 -27
  57. package/src/extended-schemas.ts +279 -0
  58. package/src/geo-mesh-linking.ts +93 -0
  59. package/src/index.ts +89 -0
  60. package/src/instant-matrix-search.ts +48 -0
  61. package/src/isr-cache-manager.ts +78 -0
  62. package/src/knowledge-graph-linker.ts +81 -0
  63. package/src/legal-disclaimers.ts +407 -0
  64. package/src/llm-content-cleaner.ts +64 -0
  65. package/src/llm-prompt.ts +70 -0
  66. package/src/master-marketing-engine.ts +314 -0
  67. package/src/matrix-engine.ts +818 -0
  68. package/src/mcp-seo-server.ts +108 -0
  69. package/src/ngram-density-analyzer.ts +108 -0
  70. package/src/rank-math-parity.ts +235 -0
  71. package/src/real-reviews-sync.ts +207 -0
  72. package/src/rss-syndication-feed.ts +56 -0
  73. package/src/schema-builder.ts +71 -24
  74. package/src/seo-opportunities-decay.ts +154 -0
  75. package/src/serp-history-alerts.ts +75 -0
  76. package/src/slug-engine.ts +183 -0
  77. package/src/social-ads-seo.ts +211 -0
  78. package/src/social-growth-suite.ts +310 -0
  79. package/src/social-trend-seo.ts +103 -0
  80. package/src/social-video-seo.ts +100 -0
  81. package/src/team-rbac.ts +61 -0
  82. package/src/technical-rules-auditor.ts +171 -0
  83. package/src/types.ts +22 -47
  84. package/src/yoast-parity.ts +161 -0
  85. package/tsconfig.json +2 -1
@@ -0,0 +1,283 @@
1
+ # 📘 Master Integration Tutorial — Programmatic SEO SDK
2
+
3
+ > **Designed for software engineers and autonomous AI coding agents (Claude, Cursor, Copilot, ChatGPT, Antigravity).**
4
+ > Explains how to integrate `@lynxflow/seo-engine` into **ANY WEB APPLICATION** to generate programmatic landing pages, sitemaps, `robots.txt`, and `/llms.txt`.
5
+
6
+ ---
7
+
8
+ ## 🎯 4 Files to Deploy 100% of Your Programmatic SEO
9
+
10
+ ```text
11
+ your-project/
12
+ ├── lib/
13
+ │ └── seo.ts ➔ 1. Declare your product modules, targets, and integrations
14
+ └── app/
15
+ ├── [...slug]/
16
+ │ └── page.tsx ➔ 2. Unified route rendering all 10 matrix families (< 0.05ms)
17
+ ├── sitemap.ts ➔ 3. Partitioned XML Sitemap generator (45k chunks)
18
+ ├── robots.ts ➔ 4. robots.txt with optimal AI bot allowances (GPTBot, ClaudeBot)
19
+ └── llms.txt/
20
+ └── route.ts ➔ 5. Clean Markdown feed for ChatGPT Search & Perplexity
21
+ ```
22
+
23
+ ---
24
+
25
+ ## 🛠️ Step 1: Declare Product Services & Matrices (`lib/seo.ts`)
26
+
27
+ Create `lib/seo.ts` to define your product configuration:
28
+
29
+ ```typescript
30
+ // lib/seo.ts
31
+ import { PseoMatrixEngine } from "@lynxflow/seo-engine";
32
+
33
+ export const matrixEngine = new PseoMatrixEngine({
34
+ companyName: "Acme Cloud",
35
+ correctionsEmail: "compliance@acme.com",
36
+ language: "en", // "en" default, supports "fr", "de", "es", etc.
37
+ });
38
+
39
+ export const SEO_CONFIG = {
40
+ brandName: "Acme",
41
+ language: "en",
42
+ minPopulationToIndex: 15_000,
43
+ organizationSameAs: [
44
+ "https://twitter.com/acme",
45
+ "https://linkedin.com/company/acme",
46
+ "https://wikidata.org/wiki/Q12345",
47
+ ],
48
+ };
49
+
50
+ export const PSEO_DATASET = {
51
+ // 1. Product features / Services
52
+ services: [
53
+ {
54
+ slug: "crm-pipeline",
55
+ name: "Omnichannel CRM & Pipeline",
56
+ category: "Sales",
57
+ description: "Visual pipeline and automated lead scoring.",
58
+ keyFeatures: ["Visual Kanban", "Lead scoring", "Automated follow-ups"],
59
+ priceMonthly: 49,
60
+ },
61
+ ],
62
+
63
+ // 2. Verified Competitor Data (VS, Alternatives, Pricing)
64
+ competitors: [
65
+ {
66
+ slug: "hubspot",
67
+ name: "HubSpot",
68
+ category: "CRM",
69
+ drawbacks: ["High onboarding fee", "Contact tier limits"],
70
+ advantagesOver: ["No seat lock-in", "Native automated workflows"],
71
+ startingPrice: 50,
72
+ lastVerifiedDate: "2026-08-01",
73
+ },
74
+ ],
75
+
76
+ // 3. Unified Industry & Role Targets (Anti-cannibalization)
77
+ targets: [
78
+ {
79
+ slug: "law-firms",
80
+ name: "Law Firms & Attorneys",
81
+ type: "industry" as const,
82
+ painPoints: ["Client confidentiality", "Billing tracking"],
83
+ benefits: ["End-to-end encryption", "Automated retainer invoices"],
84
+ },
85
+ {
86
+ slug: "sales-directors",
87
+ name: "Sales Directors & VP of Sales",
88
+ type: "role" as const,
89
+ painPoints: ["Pipeline visibility", "Team quota tracking"],
90
+ benefits: ["Real-time revenue forecast", "Instant rep activity logs"],
91
+ },
92
+ ],
93
+
94
+ // 4. Integrations & Connectors
95
+ integrations: [
96
+ {
97
+ slug: "shopify",
98
+ name: "Shopify",
99
+ category: "E-Commerce",
100
+ syncFeatures: ["Real-time order sync", "Customer lifetime value"],
101
+ },
102
+ {
103
+ slug: "slack",
104
+ name: "Slack",
105
+ category: "Communication",
106
+ syncFeatures: ["Instant deal alerts", "Pipeline command bot"],
107
+ },
108
+ ],
109
+
110
+ // 5. Actionable Use Cases
111
+ useCases: [
112
+ {
113
+ slug: "automated-quote-followup",
114
+ title: "Automate Quote Follow-ups",
115
+ problem: "45% of sent quotes go cold without systematic follow-ups.",
116
+ solutionWorkflow: [
117
+ "Detect unanswered proposal after 48 hours",
118
+ "Send personalized multi-channel reminder",
119
+ "Notify account executive upon client view",
120
+ ],
121
+ expectedRoi: "+28% close rate",
122
+ },
123
+ ],
124
+
125
+ // 6. Lead Magnet Templates
126
+ templates: [
127
+ {
128
+ slug: "sales-pipeline-excel",
129
+ title: "Sales Pipeline Tracker",
130
+ topic: "Sales Management",
131
+ format: "excel" as const,
132
+ benefits: ["Pre-built formula calculations", "Weighted deal probability"],
133
+ },
134
+ ],
135
+
136
+ // 7. Topic Authority Glossary
137
+ glossaryTerms: [
138
+ {
139
+ slug: "mrr",
140
+ term: "MRR (Monthly Recurring Revenue)",
141
+ shortDefinition: "Predictable monthly revenue generated by active subscriptions.",
142
+ },
143
+ ],
144
+ };
145
+ ```
146
+
147
+ ---
148
+
149
+ ## 🛠️ Step 2: Dynamic Catch-All Route (`app/[...slug]/page.tsx`)
150
+
151
+ ```tsx
152
+ // app/[...slug]/page.tsx
153
+ import { notFound } from "next/navigation";
154
+ import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
155
+
156
+ export async function generateMetadata({ params }: { params: { slug: string[] } }) {
157
+ const path = "/" + params.slug.join("/");
158
+ const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://acme.com";
159
+ const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
160
+ const page = pages.find((p) => p.urlPath === path);
161
+
162
+ if (!page) return {};
163
+
164
+ return {
165
+ title: page.title,
166
+ description: page.description,
167
+ alternates: { canonical: page.canonicalUrl },
168
+ robots: page.robots,
169
+ };
170
+ }
171
+
172
+ export default async function ProgrammaticPage({ params }: { params: { slug: string[] } }) {
173
+ const path = "/" + params.slug.join("/");
174
+ const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://acme.com";
175
+ const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
176
+ const page = pages.find((p) => p.urlPath === path);
177
+
178
+ if (!page) notFound();
179
+
180
+ return (
181
+ <article className="max-w-4xl mx-auto py-12 px-6">
182
+ {/* Schema.org Rich Graph */}
183
+ <script
184
+ type="application/ld+json"
185
+ dangerouslySetInnerHTML={{ __html: JSON.stringify(page.schemaGraph) }}
186
+ />
187
+
188
+ <h1 className="text-4xl font-extrabold tracking-tight text-gray-900">{page.h1}</h1>
189
+ <p className="mt-4 text-xl text-gray-600 leading-relaxed">{page.description}</p>
190
+
191
+ {/* Legal & Editorial Disclaimer */}
192
+ {page.disclaimerText && (
193
+ <aside className="mt-8 p-4 bg-gray-50 border border-gray-200 rounded-lg text-xs text-gray-500">
194
+ {page.disclaimerText}
195
+ </aside>
196
+ )}
197
+ </article>
198
+ );
199
+ }
200
+ ```
201
+
202
+ ---
203
+
204
+ ## 🛠️ Step 3: Partitioned XML Sitemap (`app/sitemap.ts`)
205
+
206
+ ```typescript
207
+ // app/sitemap.ts
208
+ import { MetadataRoute } from "next";
209
+ import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
210
+
211
+ export default function sitemap(): MetadataRoute.Sitemap {
212
+ const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://acme.com";
213
+ const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
214
+
215
+ return pages
216
+ .filter((p) => p.robots.includes("index"))
217
+ .map((p) => ({
218
+ url: p.canonicalUrl,
219
+ lastModified: new Date(),
220
+ changeFrequency: "weekly",
221
+ priority: 0.8,
222
+ }));
223
+ }
224
+ ```
225
+
226
+ ---
227
+
228
+ ## 🛠️ Step 4: AI Bots `robots.txt` (`app/robots.ts`)
229
+
230
+ ```typescript
231
+ // app/robots.ts
232
+ import { MetadataRoute } from "next";
233
+
234
+ export default function robots(): MetadataRoute.Robots {
235
+ const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://acme.com";
236
+
237
+ return {
238
+ rules: [
239
+ {
240
+ userAgent: "*",
241
+ allow: "/",
242
+ },
243
+ {
244
+ userAgent: ["GPTBot", "ChatGPT-User", "ClaudeBot", "PerplexityBot"],
245
+ allow: "/",
246
+ },
247
+ ],
248
+ sitemap: `${domain}/sitemap.xml`,
249
+ };
250
+ }
251
+ ```
252
+
253
+ ---
254
+
255
+ ## 🛠️ Step 5: Clean Markdown for AI Search (`app/llms.txt/route.ts`)
256
+
257
+ ```typescript
258
+ // app/llms.txt/route.ts
259
+ import { NextResponse } from "next/server";
260
+ import { matrixEngine, SEO_CONFIG, PSEO_DATASET } from "@/lib/seo";
261
+
262
+ export async function GET() {
263
+ const domain = process.env.NEXT_PUBLIC_SITE_URL || "https://acme.com";
264
+ const pages = matrixEngine.generateAllMatrices(domain, PSEO_DATASET, SEO_CONFIG);
265
+
266
+ const markdown = [
267
+ `# ${SEO_CONFIG.brandName} Knowledge Base`,
268
+ `> Direct structured index for LLMs and AI Agents.`,
269
+ ``,
270
+ `## Solutions & Use Cases`,
271
+ ...pages.map((p) => `- [${p.h1}](${p.canonicalUrl}): ${p.description}`),
272
+ ].join("\n");
273
+
274
+ return new NextResponse(markdown, {
275
+ headers: { "Content-Type": "text/plain; charset=utf-8" },
276
+ });
277
+ }
278
+ ```
279
+
280
+ ---
281
+
282
+ ## 🚀 That's it!
283
+ Your application now deploys thousands of high-converting, compliant programmatic pages in **under 0.05ms** response time.
@@ -0,0 +1,58 @@
1
+ /**
2
+ * ⚡ Unified Ad Intelligence & Social CRO Optimizer
3
+ *
4
+ * Inspired by top GitHub Ad Scraping architectures:
5
+ * - Meta Ad Library GraphQL Collector
6
+ * - Google Ads Transparency Center MCP
7
+ * - TikTok Creative Center Top Ads Scraper
8
+ *
9
+ * Capabilities:
10
+ * 1. Audits winning competitor ads (running > 90 days = proven profitable).
11
+ * 2. Injects high-converting ad angles into Programmatic SEO landing pages to boost CRO.
12
+ * 3. Generates multi-platform ad campaigns (Meta, Google RSAs, LinkedIn) from any SEO page.
13
+ */
14
+ export interface ProvenAdWinner {
15
+ competitorDomain: string;
16
+ platform: "meta_ad_library" | "google_transparency" | "tiktok_creative_center" | "linkedin_ads";
17
+ adHeadline: string;
18
+ adPrimaryText: string;
19
+ adHookType: "social_proof" | "pain_relief" | "roi_calculator" | "speed_simplicity" | "fear_of_missing_out";
20
+ daysActive: number;
21
+ provenConversionAngle: string;
22
+ extractedCommercialKeywords: string[];
23
+ }
24
+ export interface AdCampaignBrief {
25
+ platform: "meta" | "google_search" | "linkedin";
26
+ targetAudience: string;
27
+ primaryTextOrDescriptions: string[];
28
+ headlines: string[];
29
+ callToAction: string;
30
+ suggestedVisualAngle: string;
31
+ destinationSeoLandingPage: string;
32
+ }
33
+ export interface CroPageOptimization {
34
+ originalHeadline: string;
35
+ optimizedAdInspiredHeadline: string;
36
+ recommendedHeroHook: string;
37
+ recommendedCtaButtonText: string;
38
+ estimatedConversionUpliftPercent: number;
39
+ }
40
+ export declare class AdIntelligenceCroEngine {
41
+ /**
42
+ * 1. Simulates/Queries competitor ad archives across Meta, Google & TikTok.
43
+ */
44
+ static inspectCompetitorAds(competitorDomain: string, serviceName?: string): ProvenAdWinner[];
45
+ /**
46
+ * 2. Uses proven ad angles to upgrade landing page conversion rates (CRO).
47
+ */
48
+ static optimizeLandingPageCroWithAdInsights(originalTitle: string, adWinners: ProvenAdWinner[]): CroPageOptimization;
49
+ /**
50
+ * 3. Generates complete ad creatives (Google Search Ads & Meta Ads) from a Programmatic SEO page.
51
+ */
52
+ static generateAdCampaignFromSeoPage(opts: {
53
+ seoPageUrl: string;
54
+ serviceName: string;
55
+ targetPersona: string;
56
+ pricePerMonthEur?: number;
57
+ }): AdCampaignBrief[];
58
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * 📊 Server Crawl & AI Bots Log Analyzer (Inspiration: advertools/crawlytics.py & logs.py)
3
+ *
4
+ * Analyzes access log lines from Nginx, Apache, or Cloudflare to track real crawl activity
5
+ * from Googlebot, GPTBot, ClaudeBot, PerplexityBot, and identify status anomalies.
6
+ */
7
+ export interface LogLine {
8
+ ip: string;
9
+ timestamp: string;
10
+ method: string;
11
+ urlPath: string;
12
+ statusCode: number;
13
+ bytesSent: number;
14
+ userAgent: string;
15
+ }
16
+ export type BotFamily = "googlebot-mobile" | "googlebot-desktop" | "gptbot" | "claudebot" | "perplexitybot" | "bingbot" | "generic-crawler" | "human-visitor";
17
+ export interface BotCrawlMetrics {
18
+ botFamily: BotFamily;
19
+ totalHits: number;
20
+ uniqueUrlsCount: number;
21
+ status200Count: number;
22
+ status3xxCount: number;
23
+ status4xxCount: number;
24
+ status5xxCount: number;
25
+ avgBytes: number;
26
+ }
27
+ export declare class AiBotsLogAnalyzer {
28
+ /**
29
+ * Classifies a User-Agent string into a recognized Search Engine or AI Crawler family.
30
+ */
31
+ static classifyUserAgent(ua: string): BotFamily;
32
+ /**
33
+ * Aggregates an array of parsed log lines into comprehensive crawl metrics per bot family.
34
+ */
35
+ static aggregateCrawlStats(logs: LogLine[]): Record<BotFamily, BotCrawlMetrics>;
36
+ }
@@ -1,8 +1,8 @@
1
1
  /**
2
- * 📊 LynxFlow Embedded Analytics & Web Traffic Client
2
+ * 📊 LynxFlow Embedded Analytics & 360° Web Traffic Engine
3
3
  *
4
- * Tracks pageviews, visitors, sessions, Core Web Vitals, and AI Crawler Bots
5
- * (ChatGPT-User, PerplexityBot, ClaudeBot, Googlebot) directly from client sites.
4
+ * Tracks granular per-URL statistics, pageviews, unique visitors, conversions,
5
+ * Core Web Vitals (LCP, INP, CLS), and AI Search Crawlers (ChatGPT, Perplexity, Claude, Googlebot).
6
6
  */
7
7
  export interface AnalyticsEventPayload {
8
8
  path: string;
@@ -10,44 +10,81 @@ export interface AnalyticsEventPayload {
10
10
  userAgent?: string;
11
11
  country?: string;
12
12
  durationMs?: number;
13
+ statusCode?: number;
13
14
  isAiBot?: boolean;
14
15
  botName?: string;
16
+ conversionType?: "cta_click" | "whatsapp_chat" | "lead_form" | "purchase";
17
+ coreWebVitals?: {
18
+ lcpMs?: number;
19
+ inpMs?: number;
20
+ cls?: number;
21
+ };
22
+ }
23
+ export interface UrlTrafficStats {
24
+ path: string;
25
+ totalViews: number;
26
+ uniqueVisitors: number;
27
+ humanViews: number;
28
+ aiBotHits: number;
29
+ avgTimeOnPageSec: number;
30
+ bounceRate: number;
31
+ conversionsCount: number;
32
+ conversionRate: number;
33
+ lastAccessedAt: string;
15
34
  }
16
35
  export interface AnalyticsSummaryReport {
36
+ domain: string;
37
+ period: "24h" | "7d" | "30d" | "all";
17
38
  totalPageViews: number;
18
39
  uniqueVisitors: number;
19
40
  bounceRate: number;
20
41
  avgTimeOnPageSec: number;
21
- topPages: {
22
- path: string;
23
- views: number;
24
- }[];
42
+ totalConversions: number;
43
+ globalConversionRate: number;
44
+ topPages: UrlTrafficStats[];
25
45
  aiBotVisits: {
26
46
  bot: string;
27
47
  hits: number;
48
+ percentage: number;
28
49
  }[];
29
50
  trafficByCountry: {
30
51
  country: string;
31
52
  visitors: number;
53
+ percentage: number;
54
+ }[];
55
+ trafficBySource: {
56
+ source: "organic_search" | "ai_search" | "direct" | "referral" | "social";
57
+ count: number;
32
58
  }[];
59
+ statusCodesSummary: {
60
+ "200": number;
61
+ "3xx": number;
62
+ "404": number;
63
+ "5xx": number;
64
+ };
33
65
  }
34
66
  export declare class LynxAnalyticsClient {
35
67
  private apiKey;
36
68
  private endpoint;
69
+ private static localUrlRegistry;
37
70
  constructor(apiKey: string, endpoint?: string);
38
71
  /**
39
- * Identifies if a User-Agent belongs to an AI search crawler.
72
+ * Identifies if a User-Agent belongs to an AI search crawler or traditional search engine.
40
73
  */
41
74
  static detectAiBot(userAgent: string): {
42
75
  isAiBot: boolean;
43
76
  botName?: string;
44
77
  };
45
78
  /**
46
- * Tracks a live pageview or visitor interaction.
79
+ * Tracks a live pageview, visitor event, or conversion on a specific generated URL.
47
80
  */
48
81
  trackPageView(event: AnalyticsEventPayload): Promise<boolean>;
49
82
  /**
50
- * Retrieves analytics summary and AI search traffic report for the site.
83
+ * Returns per-URL statistics for all tracked programmatic links in this session/domain.
84
+ */
85
+ getUrlStats(path?: string): UrlTrafficStats | UrlTrafficStats[];
86
+ /**
87
+ * Retrieves an exhaustive 360° analytics and AI search traffic report for the site.
51
88
  */
52
- getSummary(period?: "24h" | "7d" | "30d" | "all"): Promise<AnalyticsSummaryReport>;
89
+ getSummary(domain?: string, period?: "24h" | "7d" | "30d" | "all"): Promise<AnalyticsSummaryReport>;
53
90
  }
@@ -28,6 +28,15 @@ export declare class ApiKeyGuardian {
28
28
  * Generates an authentic Better Auth API key signed for a tenant & tier.
29
29
  */
30
30
  static generateKey(tenantId: string, tier?: "starter" | "growth" | "enterprise"): string;
31
+ /**
32
+ * 🛡️ Generates an Admin Bypass / Free Trial API key with a hard expiration date (YYYYMMDD).
33
+ * Bypasses Lago/Hyperswitch payment verification until the expiration date.
34
+ */
35
+ static generateAdminTrialBypassKey(opts: {
36
+ tenantId: string;
37
+ expiresAtIso: string;
38
+ tier?: "starter" | "growth" | "enterprise";
39
+ }): string;
31
40
  /**
32
41
  * Fast cryptographic validation of Better Auth API keys.
33
42
  */
@@ -0,0 +1,35 @@
1
+ /**
2
+ * 🧬 Brand DNA Extractor & Content Calendar Engine (Pole 4)
3
+ *
4
+ * Scrapes and analyzes client domain to extract Unique Value Proposition (UVP),
5
+ * target personas, editorial tone, and generates an automated 4-week content calendar.
6
+ */
7
+ export interface BrandDnaProfile {
8
+ domain: string;
9
+ brandName: string;
10
+ tagline: string;
11
+ uniqueValueProposition: string;
12
+ targetPersonas: string[];
13
+ editorialTone: "authoritative" | "direct" | "technical" | "pedagogical" | "empathetic";
14
+ keyDifferentiators: string[];
15
+ primaryIndustry: string;
16
+ }
17
+ export interface ContentCalendarItem {
18
+ id: string;
19
+ weekNumber: number;
20
+ scheduledDay: string;
21
+ matrixFamily: string;
22
+ title: string;
23
+ targetUrl: string;
24
+ primaryKeyword: string;
25
+ status: "draft" | "ready" | "scheduled" | "published";
26
+ }
27
+ export declare class BrandDnaCalendarEngine {
28
+ /**
29
+ * Generates a complete 4-week editorial content calendar based on the Brand DNA and 8 matrices.
30
+ */
31
+ static generate4WeekCalendar(dna: BrandDnaProfile, services: {
32
+ slug: string;
33
+ name: string;
34
+ }[], topCities?: string[]): ContentCalendarItem[];
35
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * ✍️ Master Copywriting & AI-SEO Prompt Frameworks Engine
3
+ *
4
+ * Implements the complete set of formulas from marketingskills:
5
+ * 1. 5 Battle-Tested Headline Formulas (Outcome, Problem, Audience, Differentiation, Proof)
6
+ * 2. The Human Action Model (Discomfort ➔ Vision ➔ Path)
7
+ * 3. 40-60 Word Concise AEO / GEO Definition Answer Block for LLM Citation
8
+ * 4. Google AI Query Fan-Out Generator (5-10 concurrent semantic sub-queries)
9
+ * 5. Value Equation & Grand Slam Offer Stack (Alex Hormozi)
10
+ */
11
+ export interface HeadlineVariants {
12
+ outcomeFocused: string;
13
+ problemFocused: string;
14
+ audienceFocused: string;
15
+ differentiationFocused: string;
16
+ proofFocused: string;
17
+ }
18
+ export interface HumanActionModelCopy {
19
+ discomfortState: string;
20
+ visionState: string;
21
+ actionPath: string;
22
+ }
23
+ export declare class CopywritingFrameworksMaster {
24
+ /**
25
+ * 1. Generates 5 high-converting headline variants based on marketingskills formulas.
26
+ */
27
+ static generateHeadlines(opts: {
28
+ serviceName: string;
29
+ desiredOutcome: string;
30
+ painPoint: string;
31
+ targetAudience: string;
32
+ metricProof: string;
33
+ }): HeadlineVariants;
34
+ /**
35
+ * 2. Human Action Model (Discomfort ➔ Vision ➔ Path).
36
+ */
37
+ static generateHumanActionModel(opts: {
38
+ painPoint: string;
39
+ desiredOutcome: string;
40
+ solutionName: string;
41
+ timeframe: string;
42
+ }): HumanActionModelCopy;
43
+ /**
44
+ * 3. 40-60 Word Direct-Answer GEO Block (Gold standard for ChatGPT, Perplexity & Google AI Overviews).
45
+ */
46
+ static generateAeoAnswerBlock(opts: {
47
+ term: string;
48
+ definition: string;
49
+ keyBenefit: string;
50
+ proofStat: string;
51
+ }): string;
52
+ /**
53
+ * 4. Query Fan-Out Generator: 8 related queries that Google AI Overviews fan out to.
54
+ */
55
+ static generateQueryFanOut(topic: string, serviceSlug: string): string[];
56
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * ✍️ Automated Copywriting & CRO Injection Engine (Inspiration: marketingskills)
3
+ *
4
+ * Automatically generates high-converting sales copy blocks using proven frameworks:
5
+ * 1. PAS (Problem - Agitation - Solution)
6
+ * 2. AIDA (Attention - Interest - Desire - Action)
7
+ * 3. Trust & Social Proof Elements (Risk Reducers, Guarantees, Badges)
8
+ * 4. High-Conversion Sticky CTAs
9
+ */
10
+ export interface CopywritingInput {
11
+ brandName: string;
12
+ solutionName: string;
13
+ targetNicheOrCity: string;
14
+ painPoint: string;
15
+ agitation: string;
16
+ outcome: string;
17
+ priceMonthly?: number;
18
+ currencySymbol?: string;
19
+ }
20
+ export declare class CroCopywritingEngine {
21
+ /**
22
+ * Returns structured PAS (Problem - Agitation - Solution) text data.
23
+ */
24
+ static generatePasCopy(solutionName: string, targetNiche: string): {
25
+ problem: string;
26
+ agitation: string;
27
+ solution: string;
28
+ };
29
+ /**
30
+ * Generates a PAS (Problem - Agitation - Solution) sales block in HTML.
31
+ */
32
+ static generatePasBlock(input: CopywritingInput): string;
33
+ /**
34
+ * Generates a High-Converting Social Proof & Trust Badges block.
35
+ */
36
+ static generateTrustBadgesBlock(input: {
37
+ guaranteeDays?: number;
38
+ rating?: string;
39
+ reviewCount?: number;
40
+ freeTrialDays?: number;
41
+ }): string;
42
+ /**
43
+ * Generates an Instant WhatsApp / Direct Call conversion trigger button (inspired by Jacobo).
44
+ */
45
+ static generateInstantConverterWidget(phoneNumber: string, brandOrMessage: string, serviceName?: string): string;
46
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * 🕸️ Contextual Cross-Linking & Semantic Affinity Engine (Inspiration: seedrank/crosslinks.py)
3
+ *
4
+ * Computes forward and backward internal link affinity scores based on:
5
+ * Score = (TopicOverlap * 2 + KeywordOverlap) + VolumeBonus + ContentTypeBonus + RecencyBonus
6
+ */
7
+ export interface ArticleOrPageNode {
8
+ slug: string;
9
+ title: string;
10
+ url: string;
11
+ targetKeywords: string[];
12
+ topics: string[];
13
+ contentType?: "landing-page" | "blog-post" | "comparison" | "use-case";
14
+ searchVolumeSum?: number;
15
+ publishedAt?: string;
16
+ }
17
+ export interface CrosslinkSuggestion {
18
+ targetNode: ArticleOrPageNode;
19
+ score: number;
20
+ keywordOverlapCount: number;
21
+ topicOverlapCount: number;
22
+ anchorTextSuggestion: string;
23
+ }
24
+ export declare class CrosslinkScorerEngine {
25
+ /**
26
+ * Computes semantic crosslink affinity between a source page and candidate pages.
27
+ */
28
+ static computeCrosslinkScore(source: ArticleOrPageNode, candidate: ArticleOrPageNode): CrosslinkSuggestion | null;
29
+ /**
30
+ * Finds the top N most relevant internal crosslinks for a given page.
31
+ */
32
+ static findBestCrosslinks(source: ArticleOrPageNode, allNodes: ArticleOrPageNode[], maxLinks?: number): CrosslinkSuggestion[];
33
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 🧩 Embeddable Client SEO & Discovery Widget (Inspiration: pages-seo/widget.js.js)
3
+ *
4
+ * Provides a lightweight (< 5KB) vanilla JavaScript snippet generator that allows external
5
+ * client sites to embed interactive directory navigation or related programmatic links.
6
+ */
7
+ export declare class EmbeddableSeoWidgetGenerator {
8
+ /**
9
+ * Generates the client-side JavaScript snippet to inject dynamic links into any DOM container.
10
+ */
11
+ static generateWidgetJs(apiBaseUrl: string): string;
12
+ }