@rankcli/agent-runtime 0.0.15 → 0.0.16

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 (202) hide show
  1. package/dist/index.d.mts +43 -393
  2. package/dist/index.d.ts +43 -393
  3. package/dist/index.js +306 -6526
  4. package/dist/index.mjs +202 -6412
  5. package/package.json +6 -1
  6. package/scripts/build-deno.ts +0 -134
  7. package/src/analyzers/core-web-vitals-analyzer.test.ts +0 -236
  8. package/src/analyzers/core-web-vitals-analyzer.ts +0 -557
  9. package/src/analyzers/geo-analyzer.test.ts +0 -310
  10. package/src/analyzers/geo-analyzer.ts +0 -814
  11. package/src/analyzers/image-optimization-analyzer.test.ts +0 -145
  12. package/src/analyzers/image-optimization-analyzer.ts +0 -348
  13. package/src/analyzers/index.ts +0 -233
  14. package/src/analyzers/internal-linking-analyzer.test.ts +0 -141
  15. package/src/analyzers/internal-linking-analyzer.ts +0 -419
  16. package/src/analyzers/mobile-seo-analyzer.test.ts +0 -140
  17. package/src/analyzers/mobile-seo-analyzer.ts +0 -455
  18. package/src/analyzers/security-headers-analyzer.test.ts +0 -115
  19. package/src/analyzers/security-headers-analyzer.ts +0 -318
  20. package/src/analyzers/structured-data-analyzer.test.ts +0 -210
  21. package/src/analyzers/structured-data-analyzer.ts +0 -590
  22. package/src/audit/ai/analyzer.ts +0 -347
  23. package/src/audit/ai/index.ts +0 -29
  24. package/src/audit/ai/prompts/content-analysis.ts +0 -271
  25. package/src/audit/ai/types.ts +0 -179
  26. package/src/audit/checks/additional-checks.ts +0 -439
  27. package/src/audit/checks/agent-experience.ts +0 -108
  28. package/src/audit/checks/ai-citation-worthiness.ts +0 -399
  29. package/src/audit/checks/ai-content-structure.ts +0 -325
  30. package/src/audit/checks/ai-readiness.ts +0 -406
  31. package/src/audit/checks/anchor-text.ts +0 -179
  32. package/src/audit/checks/answer-conciseness.ts +0 -322
  33. package/src/audit/checks/asset-minification.ts +0 -270
  34. package/src/audit/checks/bing-optimization.ts +0 -206
  35. package/src/audit/checks/brand-mention-optimization.ts +0 -349
  36. package/src/audit/checks/caching-headers.ts +0 -305
  37. package/src/audit/checks/canonical-advanced.ts +0 -150
  38. package/src/audit/checks/canonical-domain.ts +0 -196
  39. package/src/audit/checks/citation-quality.ts +0 -358
  40. package/src/audit/checks/client-rendering.ts +0 -542
  41. package/src/audit/checks/color-contrast.ts +0 -342
  42. package/src/audit/checks/content-freshness.ts +0 -170
  43. package/src/audit/checks/content-science.ts +0 -589
  44. package/src/audit/checks/conversion-elements.ts +0 -526
  45. package/src/audit/checks/crawlability.ts +0 -220
  46. package/src/audit/checks/directory-listing.ts +0 -172
  47. package/src/audit/checks/dom-analysis.ts +0 -191
  48. package/src/audit/checks/dom-size.ts +0 -246
  49. package/src/audit/checks/duplicate-content.ts +0 -194
  50. package/src/audit/checks/eeat-signals.ts +0 -990
  51. package/src/audit/checks/entity-seo.ts +0 -396
  52. package/src/audit/checks/featured-snippet.ts +0 -473
  53. package/src/audit/checks/freshness-signals.ts +0 -443
  54. package/src/audit/checks/funnel-intent.ts +0 -463
  55. package/src/audit/checks/hreflang.ts +0 -174
  56. package/src/audit/checks/html-compliance.ts +0 -302
  57. package/src/audit/checks/image-dimensions.ts +0 -167
  58. package/src/audit/checks/images.ts +0 -160
  59. package/src/audit/checks/indexnow.ts +0 -275
  60. package/src/audit/checks/interactive-tools.ts +0 -475
  61. package/src/audit/checks/internal-link-graph.ts +0 -436
  62. package/src/audit/checks/keyword-analysis.ts +0 -239
  63. package/src/audit/checks/keyword-cannibalization.ts +0 -385
  64. package/src/audit/checks/keyword-placement.ts +0 -471
  65. package/src/audit/checks/links.ts +0 -273
  66. package/src/audit/checks/llms-txt.ts +0 -224
  67. package/src/audit/checks/local-seo.ts +0 -296
  68. package/src/audit/checks/mobile.ts +0 -167
  69. package/src/audit/checks/modern-images.ts +0 -226
  70. package/src/audit/checks/navboost-signals.ts +0 -395
  71. package/src/audit/checks/on-page.ts +0 -209
  72. package/src/audit/checks/page-resources.ts +0 -285
  73. package/src/audit/checks/pagination.ts +0 -180
  74. package/src/audit/checks/performance.ts +0 -153
  75. package/src/audit/checks/platform-presence.ts +0 -580
  76. package/src/audit/checks/rag-chunk-readiness.test.ts +0 -159
  77. package/src/audit/checks/rag-chunk-readiness.ts +0 -163
  78. package/src/audit/checks/redirect-analysis.ts +0 -153
  79. package/src/audit/checks/redirect-chain.ts +0 -389
  80. package/src/audit/checks/resource-hints.ts +0 -420
  81. package/src/audit/checks/responsive-css.ts +0 -247
  82. package/src/audit/checks/responsive-images.ts +0 -396
  83. package/src/audit/checks/review-ecosystem.ts +0 -415
  84. package/src/audit/checks/robots-validation.ts +0 -373
  85. package/src/audit/checks/security-headers.ts +0 -188
  86. package/src/audit/checks/security.ts +0 -144
  87. package/src/audit/checks/serp-preview.ts +0 -251
  88. package/src/audit/checks/site-maturity.ts +0 -453
  89. package/src/audit/checks/social-meta.test.ts +0 -275
  90. package/src/audit/checks/social-meta.ts +0 -134
  91. package/src/audit/checks/soft-404.ts +0 -151
  92. package/src/audit/checks/structured-data.ts +0 -238
  93. package/src/audit/checks/tech-detection.ts +0 -496
  94. package/src/audit/checks/topical-clusters.ts +0 -435
  95. package/src/audit/checks/tracker-bloat.ts +0 -462
  96. package/src/audit/checks/tracking-verification.test.ts +0 -371
  97. package/src/audit/checks/tracking-verification.ts +0 -636
  98. package/src/audit/checks/url-safety.ts +0 -682
  99. package/src/audit/deno-entry.ts +0 -66
  100. package/src/audit/discovery/index.ts +0 -15
  101. package/src/audit/discovery/link-crawler.ts +0 -233
  102. package/src/audit/discovery/repo-routes.ts +0 -347
  103. package/src/audit/engine.ts +0 -633
  104. package/src/audit/fixes/index.ts +0 -209
  105. package/src/audit/fixes/social-meta-fixes.test.ts +0 -329
  106. package/src/audit/fixes/social-meta-fixes.ts +0 -463
  107. package/src/audit/index.ts +0 -74
  108. package/src/audit/runner.test.ts +0 -299
  109. package/src/audit/runner.ts +0 -130
  110. package/src/audit/types.ts +0 -1987
  111. package/src/content/featured-snippet.ts +0 -367
  112. package/src/content/generator.test.ts +0 -534
  113. package/src/content/generator.ts +0 -501
  114. package/src/content/headline.ts +0 -317
  115. package/src/content/index.ts +0 -62
  116. package/src/content/intent.ts +0 -258
  117. package/src/content/keyword-density.ts +0 -349
  118. package/src/content/readability.ts +0 -262
  119. package/src/executor.ts +0 -336
  120. package/src/fixer/framework-fixes.test.ts +0 -489
  121. package/src/fixer/framework-fixes.ts +0 -5287
  122. package/src/fixer/index.ts +0 -6
  123. package/src/fixer/schemas.ts +0 -971
  124. package/src/fixer.ts +0 -642
  125. package/src/frameworks/detector.test.ts +0 -248
  126. package/src/frameworks/detector.ts +0 -899
  127. package/src/frameworks/index.ts +0 -68
  128. package/src/frameworks/recipes/angular.yaml +0 -171
  129. package/src/frameworks/recipes/astro.yaml +0 -206
  130. package/src/frameworks/recipes/django.yaml +0 -180
  131. package/src/frameworks/recipes/laravel.yaml +0 -137
  132. package/src/frameworks/recipes/nextjs.yaml +0 -268
  133. package/src/frameworks/recipes/nuxt.yaml +0 -175
  134. package/src/frameworks/recipes/rails.yaml +0 -188
  135. package/src/frameworks/recipes/react.yaml +0 -202
  136. package/src/frameworks/recipes/sveltekit.yaml +0 -154
  137. package/src/frameworks/recipes/vue.yaml +0 -137
  138. package/src/frameworks/recipes/wordpress.yaml +0 -209
  139. package/src/frameworks/suggestion-engine.ts +0 -357
  140. package/src/geo/geo-content.test.ts +0 -305
  141. package/src/geo/geo-content.ts +0 -266
  142. package/src/geo/geo-history.test.ts +0 -473
  143. package/src/geo/geo-history.ts +0 -433
  144. package/src/geo/geo-tracker.test.ts +0 -359
  145. package/src/geo/geo-tracker.ts +0 -411
  146. package/src/geo/index.ts +0 -11
  147. package/src/geo/llm-citation-checker.ts +0 -188
  148. package/src/git/commit-helper.test.ts +0 -261
  149. package/src/git/commit-helper.ts +0 -329
  150. package/src/git/index.ts +0 -12
  151. package/src/git/pr-helper.test.ts +0 -284
  152. package/src/git/pr-helper.ts +0 -307
  153. package/src/index.ts +0 -76
  154. package/src/keywords/ai-keyword-engine.ts +0 -1062
  155. package/src/keywords/ai-summarizer.ts +0 -387
  156. package/src/keywords/ci-mode.ts +0 -555
  157. package/src/keywords/engine.ts +0 -359
  158. package/src/keywords/index.ts +0 -151
  159. package/src/keywords/llm-judge.ts +0 -357
  160. package/src/keywords/nlp-analysis.ts +0 -706
  161. package/src/keywords/prioritizer.ts +0 -295
  162. package/src/keywords/site-crawler.ts +0 -342
  163. package/src/keywords/sources/autocomplete.ts +0 -139
  164. package/src/keywords/sources/competitive-search.ts +0 -450
  165. package/src/keywords/sources/competitor-analysis.ts +0 -374
  166. package/src/keywords/sources/dataforseo.ts +0 -206
  167. package/src/keywords/sources/free-sources.ts +0 -294
  168. package/src/keywords/sources/gsc.ts +0 -123
  169. package/src/keywords/topic-grouping.ts +0 -327
  170. package/src/keywords/types.ts +0 -144
  171. package/src/keywords/wizard.ts +0 -457
  172. package/src/loader.ts +0 -40
  173. package/src/ranking/index.ts +0 -5
  174. package/src/ranking/serp-client.ts +0 -348
  175. package/src/ranking/tracker.ts +0 -380
  176. package/src/ranking/types.ts +0 -123
  177. package/src/reports/index.ts +0 -7
  178. package/src/reports/report-generator.test.ts +0 -293
  179. package/src/reports/report-generator.ts +0 -713
  180. package/src/scheduler/alerts.test.ts +0 -458
  181. package/src/scheduler/alerts.ts +0 -328
  182. package/src/scheduler/index.ts +0 -8
  183. package/src/scheduler/scheduled-audit.test.ts +0 -377
  184. package/src/scheduler/scheduled-audit.ts +0 -149
  185. package/src/test/integration-test.ts +0 -325
  186. package/src/tools/analyzer.ts +0 -373
  187. package/src/tools/crawl.ts +0 -293
  188. package/src/tools/files.ts +0 -301
  189. package/src/tools/h1-fixer.ts +0 -249
  190. package/src/tools/index.ts +0 -67
  191. package/src/tracking/github-action.ts +0 -326
  192. package/src/tracking/google-analytics.ts +0 -265
  193. package/src/tracking/index.ts +0 -45
  194. package/src/tracking/report-generator.ts +0 -386
  195. package/src/tracking/search-console.ts +0 -335
  196. package/src/types.ts +0 -148
  197. package/src/utils/http.ts +0 -302
  198. package/src/wasm-adapter.ts +0 -297
  199. package/src/wasm-entry.ts +0 -14
  200. package/tsconfig.json +0 -17
  201. package/tsup.wasm.config.ts +0 -26
  202. package/vitest.config.ts +0 -15
@@ -1,496 +0,0 @@
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
- }