@rankcli/agent-runtime 0.0.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.
Files changed (178) hide show
  1. package/README.md +242 -0
  2. package/dist/analyzer-2CSWIQGD.mjs +6 -0
  3. package/dist/chunk-YNZYHEYM.mjs +774 -0
  4. package/dist/index.d.mts +4012 -0
  5. package/dist/index.d.ts +4012 -0
  6. package/dist/index.js +29672 -0
  7. package/dist/index.mjs +28602 -0
  8. package/package.json +53 -0
  9. package/scripts/build-deno.ts +134 -0
  10. package/src/audit/ai/analyzer.ts +347 -0
  11. package/src/audit/ai/index.ts +29 -0
  12. package/src/audit/ai/prompts/content-analysis.ts +271 -0
  13. package/src/audit/ai/types.ts +179 -0
  14. package/src/audit/checks/additional-checks.ts +439 -0
  15. package/src/audit/checks/ai-citation-worthiness.ts +399 -0
  16. package/src/audit/checks/ai-content-structure.ts +325 -0
  17. package/src/audit/checks/ai-readiness.ts +339 -0
  18. package/src/audit/checks/anchor-text.ts +179 -0
  19. package/src/audit/checks/answer-conciseness.ts +322 -0
  20. package/src/audit/checks/asset-minification.ts +270 -0
  21. package/src/audit/checks/bing-optimization.ts +206 -0
  22. package/src/audit/checks/brand-mention-optimization.ts +349 -0
  23. package/src/audit/checks/caching-headers.ts +305 -0
  24. package/src/audit/checks/canonical-advanced.ts +150 -0
  25. package/src/audit/checks/canonical-domain.ts +196 -0
  26. package/src/audit/checks/citation-quality.ts +358 -0
  27. package/src/audit/checks/client-rendering.ts +542 -0
  28. package/src/audit/checks/color-contrast.ts +342 -0
  29. package/src/audit/checks/content-freshness.ts +170 -0
  30. package/src/audit/checks/content-science.ts +589 -0
  31. package/src/audit/checks/conversion-elements.ts +526 -0
  32. package/src/audit/checks/crawlability.ts +220 -0
  33. package/src/audit/checks/directory-listing.ts +172 -0
  34. package/src/audit/checks/dom-analysis.ts +191 -0
  35. package/src/audit/checks/dom-size.ts +246 -0
  36. package/src/audit/checks/duplicate-content.ts +194 -0
  37. package/src/audit/checks/eeat-signals.ts +990 -0
  38. package/src/audit/checks/entity-seo.ts +396 -0
  39. package/src/audit/checks/featured-snippet.ts +473 -0
  40. package/src/audit/checks/freshness-signals.ts +443 -0
  41. package/src/audit/checks/funnel-intent.ts +463 -0
  42. package/src/audit/checks/hreflang.ts +174 -0
  43. package/src/audit/checks/html-compliance.ts +302 -0
  44. package/src/audit/checks/image-dimensions.ts +167 -0
  45. package/src/audit/checks/images.ts +160 -0
  46. package/src/audit/checks/indexnow.ts +275 -0
  47. package/src/audit/checks/interactive-tools.ts +475 -0
  48. package/src/audit/checks/internal-link-graph.ts +436 -0
  49. package/src/audit/checks/keyword-analysis.ts +239 -0
  50. package/src/audit/checks/keyword-cannibalization.ts +385 -0
  51. package/src/audit/checks/keyword-placement.ts +471 -0
  52. package/src/audit/checks/links.ts +203 -0
  53. package/src/audit/checks/llms-txt.ts +224 -0
  54. package/src/audit/checks/local-seo.ts +296 -0
  55. package/src/audit/checks/mobile.ts +167 -0
  56. package/src/audit/checks/modern-images.ts +226 -0
  57. package/src/audit/checks/navboost-signals.ts +395 -0
  58. package/src/audit/checks/on-page.ts +209 -0
  59. package/src/audit/checks/page-resources.ts +285 -0
  60. package/src/audit/checks/pagination.ts +180 -0
  61. package/src/audit/checks/performance.ts +153 -0
  62. package/src/audit/checks/platform-presence.ts +580 -0
  63. package/src/audit/checks/redirect-analysis.ts +153 -0
  64. package/src/audit/checks/redirect-chain.ts +389 -0
  65. package/src/audit/checks/resource-hints.ts +420 -0
  66. package/src/audit/checks/responsive-css.ts +247 -0
  67. package/src/audit/checks/responsive-images.ts +396 -0
  68. package/src/audit/checks/review-ecosystem.ts +415 -0
  69. package/src/audit/checks/robots-validation.ts +373 -0
  70. package/src/audit/checks/security-headers.ts +172 -0
  71. package/src/audit/checks/security.ts +144 -0
  72. package/src/audit/checks/serp-preview.ts +251 -0
  73. package/src/audit/checks/site-maturity.ts +444 -0
  74. package/src/audit/checks/social-meta.test.ts +275 -0
  75. package/src/audit/checks/social-meta.ts +134 -0
  76. package/src/audit/checks/soft-404.ts +151 -0
  77. package/src/audit/checks/structured-data.ts +238 -0
  78. package/src/audit/checks/tech-detection.ts +496 -0
  79. package/src/audit/checks/topical-clusters.ts +435 -0
  80. package/src/audit/checks/tracker-bloat.ts +462 -0
  81. package/src/audit/checks/tracking-verification.test.ts +371 -0
  82. package/src/audit/checks/tracking-verification.ts +636 -0
  83. package/src/audit/checks/url-safety.ts +682 -0
  84. package/src/audit/deno-entry.ts +66 -0
  85. package/src/audit/discovery/index.ts +15 -0
  86. package/src/audit/discovery/link-crawler.ts +232 -0
  87. package/src/audit/discovery/repo-routes.ts +347 -0
  88. package/src/audit/engine.ts +620 -0
  89. package/src/audit/fixes/index.ts +209 -0
  90. package/src/audit/fixes/social-meta-fixes.test.ts +329 -0
  91. package/src/audit/fixes/social-meta-fixes.ts +463 -0
  92. package/src/audit/index.ts +74 -0
  93. package/src/audit/runner.test.ts +299 -0
  94. package/src/audit/runner.ts +130 -0
  95. package/src/audit/types.ts +1953 -0
  96. package/src/content/featured-snippet.ts +367 -0
  97. package/src/content/generator.test.ts +534 -0
  98. package/src/content/generator.ts +501 -0
  99. package/src/content/headline.ts +317 -0
  100. package/src/content/index.ts +62 -0
  101. package/src/content/intent.ts +258 -0
  102. package/src/content/keyword-density.ts +349 -0
  103. package/src/content/readability.ts +262 -0
  104. package/src/executor.ts +336 -0
  105. package/src/fixer.ts +416 -0
  106. package/src/frameworks/detector.test.ts +248 -0
  107. package/src/frameworks/detector.ts +371 -0
  108. package/src/frameworks/index.ts +68 -0
  109. package/src/frameworks/recipes/angular.yaml +171 -0
  110. package/src/frameworks/recipes/astro.yaml +206 -0
  111. package/src/frameworks/recipes/django.yaml +180 -0
  112. package/src/frameworks/recipes/laravel.yaml +137 -0
  113. package/src/frameworks/recipes/nextjs.yaml +268 -0
  114. package/src/frameworks/recipes/nuxt.yaml +175 -0
  115. package/src/frameworks/recipes/rails.yaml +188 -0
  116. package/src/frameworks/recipes/react.yaml +202 -0
  117. package/src/frameworks/recipes/sveltekit.yaml +154 -0
  118. package/src/frameworks/recipes/vue.yaml +137 -0
  119. package/src/frameworks/recipes/wordpress.yaml +209 -0
  120. package/src/frameworks/suggestion-engine.ts +320 -0
  121. package/src/geo/geo-content.test.ts +305 -0
  122. package/src/geo/geo-content.ts +266 -0
  123. package/src/geo/geo-history.test.ts +473 -0
  124. package/src/geo/geo-history.ts +433 -0
  125. package/src/geo/geo-tracker.test.ts +359 -0
  126. package/src/geo/geo-tracker.ts +411 -0
  127. package/src/geo/index.ts +10 -0
  128. package/src/git/commit-helper.test.ts +261 -0
  129. package/src/git/commit-helper.ts +329 -0
  130. package/src/git/index.ts +12 -0
  131. package/src/git/pr-helper.test.ts +284 -0
  132. package/src/git/pr-helper.ts +307 -0
  133. package/src/index.ts +66 -0
  134. package/src/keywords/ai-keyword-engine.ts +1062 -0
  135. package/src/keywords/ai-summarizer.ts +387 -0
  136. package/src/keywords/ci-mode.ts +555 -0
  137. package/src/keywords/engine.ts +359 -0
  138. package/src/keywords/index.ts +151 -0
  139. package/src/keywords/llm-judge.ts +357 -0
  140. package/src/keywords/nlp-analysis.ts +706 -0
  141. package/src/keywords/prioritizer.ts +295 -0
  142. package/src/keywords/site-crawler.ts +342 -0
  143. package/src/keywords/sources/autocomplete.ts +139 -0
  144. package/src/keywords/sources/competitive-search.ts +450 -0
  145. package/src/keywords/sources/competitor-analysis.ts +374 -0
  146. package/src/keywords/sources/dataforseo.ts +206 -0
  147. package/src/keywords/sources/free-sources.ts +294 -0
  148. package/src/keywords/sources/gsc.ts +123 -0
  149. package/src/keywords/topic-grouping.ts +327 -0
  150. package/src/keywords/types.ts +144 -0
  151. package/src/keywords/wizard.ts +457 -0
  152. package/src/loader.ts +40 -0
  153. package/src/reports/index.ts +7 -0
  154. package/src/reports/report-generator.test.ts +293 -0
  155. package/src/reports/report-generator.ts +713 -0
  156. package/src/scheduler/alerts.test.ts +458 -0
  157. package/src/scheduler/alerts.ts +328 -0
  158. package/src/scheduler/index.ts +8 -0
  159. package/src/scheduler/scheduled-audit.test.ts +377 -0
  160. package/src/scheduler/scheduled-audit.ts +149 -0
  161. package/src/test/integration-test.ts +325 -0
  162. package/src/tools/analyzer.ts +373 -0
  163. package/src/tools/crawl.ts +293 -0
  164. package/src/tools/files.ts +301 -0
  165. package/src/tools/h1-fixer.ts +249 -0
  166. package/src/tools/index.ts +67 -0
  167. package/src/tracking/github-action.ts +326 -0
  168. package/src/tracking/google-analytics.ts +265 -0
  169. package/src/tracking/index.ts +45 -0
  170. package/src/tracking/report-generator.ts +386 -0
  171. package/src/tracking/search-console.ts +335 -0
  172. package/src/types.ts +134 -0
  173. package/src/utils/http.ts +302 -0
  174. package/src/wasm-adapter.ts +297 -0
  175. package/src/wasm-entry.ts +14 -0
  176. package/tsconfig.json +17 -0
  177. package/tsup.wasm.config.ts +26 -0
  178. package/vitest.config.ts +15 -0
@@ -0,0 +1,496 @@
1
+ // Technology Detection
2
+ // Detects CMS, frameworks, and JavaScript libraries
3
+
4
+ import * as cheerio from 'cheerio';
5
+ import type { AuditIssue } from '../types.js';
6
+ import { ISSUE_DEFINITIONS } from '../types.js';
7
+
8
+ // Known vulnerable jQuery versions (simplified)
9
+ const VULNERABLE_JQUERY = ['1.', '2.0', '2.1', '2.2', '3.0', '3.1', '3.2', '3.3', '3.4'];
10
+
11
+ export interface TechnologyInfo {
12
+ name: string;
13
+ version?: string;
14
+ category: 'cms' | 'framework' | 'library' | 'server' | 'analytics' | 'cdn' | 'other';
15
+ confidence: 'high' | 'medium' | 'low';
16
+ }
17
+
18
+ export interface TechDetectionData {
19
+ technologies: TechnologyInfo[];
20
+ cms: string | null;
21
+ framework: string | null;
22
+ jsLibraries: string[];
23
+ analytics: string[];
24
+ cdn: string | null;
25
+ serverHeaders: Record<string, string>;
26
+ }
27
+
28
+ /**
29
+ * Detect technologies from HTML and headers
30
+ */
31
+ export function detectTechnologies(
32
+ html: string,
33
+ url: string,
34
+ headers?: Record<string, string>
35
+ ): { issues: AuditIssue[]; data: TechDetectionData } {
36
+ const issues: AuditIssue[] = [];
37
+ const $ = cheerio.load(html);
38
+ const technologies: TechnologyInfo[] = [];
39
+
40
+ // Detect CMS
41
+ detectCMS($, technologies);
42
+
43
+ // Detect JavaScript frameworks
44
+ detectFrameworks($, html, technologies);
45
+
46
+ // Detect JavaScript libraries
47
+ detectLibraries($, html, technologies, issues, url);
48
+
49
+ // Detect analytics
50
+ detectAnalytics($, html, technologies);
51
+
52
+ // Detect CDN from headers
53
+ if (headers) {
54
+ detectCDN(headers, technologies);
55
+ }
56
+
57
+ // Build summary
58
+ const cms = technologies.find((t) => t.category === 'cms')?.name || null;
59
+ const framework = technologies.find((t) => t.category === 'framework')?.name || null;
60
+ const jsLibraries = technologies.filter((t) => t.category === 'library').map((t) => t.name);
61
+ const analytics = technologies.filter((t) => t.category === 'analytics').map((t) => t.name);
62
+ const cdn = technologies.find((t) => t.category === 'cdn')?.name || null;
63
+
64
+ return {
65
+ issues,
66
+ data: {
67
+ technologies,
68
+ cms,
69
+ framework,
70
+ jsLibraries,
71
+ analytics,
72
+ cdn,
73
+ serverHeaders: headers || {},
74
+ },
75
+ };
76
+ }
77
+
78
+ /**
79
+ * Detect CMS
80
+ */
81
+ function detectCMS($: cheerio.CheerioAPI, technologies: TechnologyInfo[]): void {
82
+ // WordPress
83
+ if (
84
+ $('meta[name="generator"][content*="WordPress"]').length > 0 ||
85
+ $('link[href*="wp-content"]').length > 0 ||
86
+ $('script[src*="wp-content"]').length > 0
87
+ ) {
88
+ const version = $('meta[name="generator"]').attr('content')?.match(/WordPress\s+([\d.]+)/)?.[1];
89
+ technologies.push({
90
+ name: 'WordPress',
91
+ version,
92
+ category: 'cms',
93
+ confidence: 'high',
94
+ });
95
+ }
96
+
97
+ // Drupal
98
+ if (
99
+ $('meta[name="generator"][content*="Drupal"]').length > 0 ||
100
+ $('script[src*="/drupal"]').length > 0 ||
101
+ $('[data-drupal-selector]').length > 0
102
+ ) {
103
+ technologies.push({
104
+ name: 'Drupal',
105
+ category: 'cms',
106
+ confidence: 'high',
107
+ });
108
+ }
109
+
110
+ // Joomla
111
+ if ($('meta[name="generator"][content*="Joomla"]').length > 0 || $('script[src*="/joomla"]').length > 0) {
112
+ technologies.push({
113
+ name: 'Joomla',
114
+ category: 'cms',
115
+ confidence: 'high',
116
+ });
117
+ }
118
+
119
+ // Shopify
120
+ if ($('meta[name="shopify-digital-wallet"]').length > 0 || $('link[href*="cdn.shopify.com"]').length > 0) {
121
+ technologies.push({
122
+ name: 'Shopify',
123
+ category: 'cms',
124
+ confidence: 'high',
125
+ });
126
+ }
127
+
128
+ // Squarespace
129
+ if ($('script[src*="squarespace"]').length > 0 || $('meta[content*="Squarespace"]').length > 0) {
130
+ technologies.push({
131
+ name: 'Squarespace',
132
+ category: 'cms',
133
+ confidence: 'high',
134
+ });
135
+ }
136
+
137
+ // Wix
138
+ if ($('meta[name="generator"][content*="Wix"]').length > 0 || $('script[src*="wix.com"]').length > 0) {
139
+ technologies.push({
140
+ name: 'Wix',
141
+ category: 'cms',
142
+ confidence: 'high',
143
+ });
144
+ }
145
+
146
+ // Ghost
147
+ if ($('meta[name="generator"][content*="Ghost"]').length > 0) {
148
+ const version = $('meta[name="generator"]').attr('content')?.match(/Ghost\s+([\d.]+)/)?.[1];
149
+ technologies.push({
150
+ name: 'Ghost',
151
+ version,
152
+ category: 'cms',
153
+ confidence: 'high',
154
+ });
155
+ }
156
+
157
+ // Hugo
158
+ if ($('meta[name="generator"][content*="Hugo"]').length > 0) {
159
+ technologies.push({
160
+ name: 'Hugo',
161
+ category: 'cms',
162
+ confidence: 'high',
163
+ });
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Detect JavaScript frameworks
169
+ */
170
+ function detectFrameworks($: cheerio.CheerioAPI, html: string, technologies: TechnologyInfo[]): void {
171
+ // React
172
+ if ($('[data-reactroot]').length > 0 || $('[data-react-helmet]').length > 0 || html.includes('__REACT_DEVTOOLS')) {
173
+ technologies.push({
174
+ name: 'React',
175
+ category: 'framework',
176
+ confidence: 'high',
177
+ });
178
+ }
179
+
180
+ // Next.js
181
+ if ($('#__next').length > 0 || $('script[src*="/_next/"]').length > 0) {
182
+ technologies.push({
183
+ name: 'Next.js',
184
+ category: 'framework',
185
+ confidence: 'high',
186
+ });
187
+ }
188
+
189
+ // Vue.js
190
+ if ($('[data-v-]').length > 0 || html.includes('Vue.js') || $('script[src*="vue"]').length > 0) {
191
+ technologies.push({
192
+ name: 'Vue.js',
193
+ category: 'framework',
194
+ confidence: 'medium',
195
+ });
196
+ }
197
+
198
+ // Nuxt.js
199
+ if ($('#__nuxt').length > 0 || $('script[src*="/_nuxt/"]').length > 0) {
200
+ technologies.push({
201
+ name: 'Nuxt.js',
202
+ category: 'framework',
203
+ confidence: 'high',
204
+ });
205
+ }
206
+
207
+ // Angular
208
+ if ($('[ng-app]').length > 0 || $('[data-ng-app]').length > 0 || $('app-root').length > 0) {
209
+ technologies.push({
210
+ name: 'Angular',
211
+ category: 'framework',
212
+ confidence: 'high',
213
+ });
214
+ }
215
+
216
+ // Svelte
217
+ if ($('script[src*="svelte"]').length > 0 || html.includes('__svelte')) {
218
+ technologies.push({
219
+ name: 'Svelte',
220
+ category: 'framework',
221
+ confidence: 'medium',
222
+ });
223
+ }
224
+
225
+ // Astro
226
+ if ($('[data-astro-source-file]').length > 0 || $('script[src*="/_astro/"]').length > 0) {
227
+ technologies.push({
228
+ name: 'Astro',
229
+ category: 'framework',
230
+ confidence: 'high',
231
+ });
232
+ }
233
+
234
+ // Gatsby
235
+ if ($('#___gatsby').length > 0 || $('script[src*="/gatsby"]').length > 0) {
236
+ technologies.push({
237
+ name: 'Gatsby',
238
+ category: 'framework',
239
+ confidence: 'high',
240
+ });
241
+ }
242
+
243
+ // Remix
244
+ if (html.includes('__remixContext') || $('script[src*="remix"]').length > 0) {
245
+ technologies.push({
246
+ name: 'Remix',
247
+ category: 'framework',
248
+ confidence: 'medium',
249
+ });
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Detect JavaScript libraries
255
+ */
256
+ function detectLibraries(
257
+ $: cheerio.CheerioAPI,
258
+ html: string,
259
+ technologies: TechnologyInfo[],
260
+ issues: AuditIssue[],
261
+ url: string
262
+ ): void {
263
+ // jQuery
264
+ const jqueryScript = $('script[src*="jquery"]').attr('src') || '';
265
+ const jqueryVersionMatch = jqueryScript.match(/jquery[.-]?([\d.]+)/i) || html.match(/jQuery\s+v?([\d.]+)/);
266
+
267
+ if (jqueryScript || html.includes('jQuery')) {
268
+ const version = jqueryVersionMatch?.[1];
269
+ technologies.push({
270
+ name: 'jQuery',
271
+ version,
272
+ category: 'library',
273
+ confidence: 'high',
274
+ });
275
+
276
+ // Check for vulnerable version
277
+ if (version && VULNERABLE_JQUERY.some((v) => version.startsWith(v))) {
278
+ issues.push({
279
+ ...ISSUE_DEFINITIONS.OUTDATED_JQUERY,
280
+ affectedUrls: [url],
281
+ details: { version, recommendation: 'Update to jQuery 3.5.0 or later' },
282
+ });
283
+ }
284
+ }
285
+
286
+ // Bootstrap
287
+ if ($('link[href*="bootstrap"]').length > 0 || $('script[src*="bootstrap"]').length > 0) {
288
+ const version = ($('link[href*="bootstrap"]').attr('href') || '').match(/bootstrap[.-]?([\d.]+)/)?.[1];
289
+ technologies.push({
290
+ name: 'Bootstrap',
291
+ version,
292
+ category: 'library',
293
+ confidence: 'high',
294
+ });
295
+ }
296
+
297
+ // Tailwind CSS
298
+ if (html.includes('tailwind') || $('[class*="tw-"]').length > 0 || $('style').text().includes('--tw-')) {
299
+ technologies.push({
300
+ name: 'Tailwind CSS',
301
+ category: 'library',
302
+ confidence: 'medium',
303
+ });
304
+ }
305
+
306
+ // Lodash
307
+ if ($('script[src*="lodash"]').length > 0 || html.includes('_.VERSION')) {
308
+ technologies.push({
309
+ name: 'Lodash',
310
+ category: 'library',
311
+ confidence: 'medium',
312
+ });
313
+ }
314
+
315
+ // GSAP
316
+ if ($('script[src*="gsap"]').length > 0 || html.includes('gsap')) {
317
+ technologies.push({
318
+ name: 'GSAP',
319
+ category: 'library',
320
+ confidence: 'medium',
321
+ });
322
+ }
323
+
324
+ // Three.js
325
+ if ($('script[src*="three"]').length > 0 || html.includes('THREE.')) {
326
+ technologies.push({
327
+ name: 'Three.js',
328
+ category: 'library',
329
+ confidence: 'medium',
330
+ });
331
+ }
332
+ }
333
+
334
+ /**
335
+ * Detect analytics
336
+ */
337
+ function detectAnalytics($: cheerio.CheerioAPI, html: string, technologies: TechnologyInfo[]): void {
338
+ // Google Analytics (GA4 and UA)
339
+ if (
340
+ html.includes('gtag') ||
341
+ html.includes('googletagmanager') ||
342
+ $('script[src*="google-analytics"]').length > 0 ||
343
+ $('script[src*="gtag"]').length > 0
344
+ ) {
345
+ technologies.push({
346
+ name: 'Google Analytics',
347
+ category: 'analytics',
348
+ confidence: 'high',
349
+ });
350
+ }
351
+
352
+ // Google Tag Manager
353
+ if (html.includes('GTM-') || $('script[src*="googletagmanager.com/gtm"]').length > 0) {
354
+ technologies.push({
355
+ name: 'Google Tag Manager',
356
+ category: 'analytics',
357
+ confidence: 'high',
358
+ });
359
+ }
360
+
361
+ // Facebook Pixel
362
+ if (html.includes('fbq(') || $('script[src*="connect.facebook"]').length > 0) {
363
+ technologies.push({
364
+ name: 'Facebook Pixel',
365
+ category: 'analytics',
366
+ confidence: 'high',
367
+ });
368
+ }
369
+
370
+ // Hotjar
371
+ if (html.includes('hotjar') || $('script[src*="hotjar"]').length > 0) {
372
+ technologies.push({
373
+ name: 'Hotjar',
374
+ category: 'analytics',
375
+ confidence: 'high',
376
+ });
377
+ }
378
+
379
+ // Mixpanel
380
+ if (html.includes('mixpanel') || $('script[src*="mixpanel"]').length > 0) {
381
+ technologies.push({
382
+ name: 'Mixpanel',
383
+ category: 'analytics',
384
+ confidence: 'high',
385
+ });
386
+ }
387
+
388
+ // Segment
389
+ if (html.includes('analytics.js') || $('script[src*="segment"]').length > 0) {
390
+ technologies.push({
391
+ name: 'Segment',
392
+ category: 'analytics',
393
+ confidence: 'medium',
394
+ });
395
+ }
396
+
397
+ // Plausible
398
+ if ($('script[src*="plausible"]').length > 0) {
399
+ technologies.push({
400
+ name: 'Plausible',
401
+ category: 'analytics',
402
+ confidence: 'high',
403
+ });
404
+ }
405
+
406
+ // Fathom
407
+ if ($('script[src*="usefathom"]').length > 0) {
408
+ technologies.push({
409
+ name: 'Fathom Analytics',
410
+ category: 'analytics',
411
+ confidence: 'high',
412
+ });
413
+ }
414
+ }
415
+
416
+ /**
417
+ * Detect CDN from headers
418
+ */
419
+ function detectCDN(headers: Record<string, string>, technologies: TechnologyInfo[]): void {
420
+ const serverHeader = headers['server']?.toLowerCase() || '';
421
+ const viaHeader = headers['via']?.toLowerCase() || '';
422
+ const cdnHeaders = [
423
+ headers['x-cdn'],
424
+ headers['x-cache'],
425
+ headers['cf-ray'],
426
+ headers['x-amz-cf-id'],
427
+ headers['x-vercel-cache'],
428
+ headers['x-served-by'],
429
+ ]
430
+ .filter(Boolean)
431
+ .join(' ')
432
+ .toLowerCase();
433
+
434
+ // Cloudflare
435
+ if (headers['cf-ray'] || serverHeader.includes('cloudflare')) {
436
+ technologies.push({
437
+ name: 'Cloudflare',
438
+ category: 'cdn',
439
+ confidence: 'high',
440
+ });
441
+ }
442
+
443
+ // AWS CloudFront
444
+ if (headers['x-amz-cf-id'] || viaHeader.includes('cloudfront')) {
445
+ technologies.push({
446
+ name: 'AWS CloudFront',
447
+ category: 'cdn',
448
+ confidence: 'high',
449
+ });
450
+ }
451
+
452
+ // Vercel
453
+ if (headers['x-vercel-cache'] || serverHeader.includes('vercel')) {
454
+ technologies.push({
455
+ name: 'Vercel',
456
+ category: 'cdn',
457
+ confidence: 'high',
458
+ });
459
+ }
460
+
461
+ // Fastly
462
+ if (cdnHeaders.includes('fastly') || viaHeader.includes('fastly')) {
463
+ technologies.push({
464
+ name: 'Fastly',
465
+ category: 'cdn',
466
+ confidence: 'high',
467
+ });
468
+ }
469
+
470
+ // Akamai
471
+ if (serverHeader.includes('akamai') || headers['x-akamai-request-id']) {
472
+ technologies.push({
473
+ name: 'Akamai',
474
+ category: 'cdn',
475
+ confidence: 'high',
476
+ });
477
+ }
478
+
479
+ // Netlify
480
+ if (serverHeader.includes('netlify') || headers['x-nf-request-id']) {
481
+ technologies.push({
482
+ name: 'Netlify',
483
+ category: 'cdn',
484
+ confidence: 'high',
485
+ });
486
+ }
487
+
488
+ // GitHub Pages
489
+ if (serverHeader.includes('github')) {
490
+ technologies.push({
491
+ name: 'GitHub Pages',
492
+ category: 'cdn',
493
+ confidence: 'high',
494
+ });
495
+ }
496
+ }