mcp-scraper 0.40.1 → 0.40.2

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 (87) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/api-server.cjs +60220 -0
  3. package/dist/bin/api-server.cjs.map +1 -0
  4. package/dist/bin/api-server.d.cts +1 -0
  5. package/dist/bin/api-server.d.ts +1 -0
  6. package/dist/bin/api-server.js +38 -0
  7. package/dist/bin/api-server.js.map +1 -0
  8. package/dist/bin/mcp-scraper-cli.cjs +2671 -0
  9. package/dist/bin/mcp-scraper-cli.cjs.map +1 -0
  10. package/dist/bin/mcp-scraper-cli.d.cts +1 -0
  11. package/dist/bin/mcp-scraper-cli.d.ts +1 -0
  12. package/dist/bin/mcp-scraper-cli.js +742 -0
  13. package/dist/bin/mcp-scraper-cli.js.map +1 -0
  14. package/dist/bin/mcp-scraper-install.cjs +129 -0
  15. package/dist/bin/mcp-scraper-install.cjs.map +1 -0
  16. package/dist/bin/mcp-scraper-install.d.cts +1 -0
  17. package/dist/bin/mcp-scraper-install.d.ts +1 -0
  18. package/dist/bin/mcp-scraper-install.js +27 -0
  19. package/dist/bin/mcp-scraper-install.js.map +1 -0
  20. package/dist/bin/mcp-stdio-server.cjs +12532 -0
  21. package/dist/bin/mcp-stdio-server.cjs.map +1 -0
  22. package/dist/bin/mcp-stdio-server.d.cts +1 -0
  23. package/dist/bin/mcp-stdio-server.d.ts +1 -0
  24. package/dist/bin/mcp-stdio-server.js +135 -0
  25. package/dist/bin/mcp-stdio-server.js.map +1 -0
  26. package/dist/bin/paa-harvest.cjs +3808 -0
  27. package/dist/bin/paa-harvest.cjs.map +1 -0
  28. package/dist/bin/paa-harvest.d.cts +1 -0
  29. package/dist/bin/paa-harvest.d.ts +1 -0
  30. package/dist/bin/paa-harvest.js +44 -0
  31. package/dist/bin/paa-harvest.js.map +1 -0
  32. package/dist/chunk-345BQXZH.js +712 -0
  33. package/dist/chunk-345BQXZH.js.map +1 -0
  34. package/dist/chunk-3PIWJS6Y.js +276 -0
  35. package/dist/chunk-3PIWJS6Y.js.map +1 -0
  36. package/dist/chunk-44HZLHDV.js +52 -0
  37. package/dist/chunk-44HZLHDV.js.map +1 -0
  38. package/dist/chunk-7XBBFBYY.js +3410 -0
  39. package/dist/chunk-7XBBFBYY.js.map +1 -0
  40. package/dist/chunk-CB5C3BPB.js +135 -0
  41. package/dist/chunk-CB5C3BPB.js.map +1 -0
  42. package/dist/chunk-FQI5PFE7.js +1866 -0
  43. package/dist/chunk-FQI5PFE7.js.map +1 -0
  44. package/dist/chunk-G3P3ZDB4.js +69 -0
  45. package/dist/chunk-G3P3ZDB4.js.map +1 -0
  46. package/dist/chunk-GUVKHCKE.js +3050 -0
  47. package/dist/chunk-GUVKHCKE.js.map +1 -0
  48. package/dist/chunk-K443GQY5.js +24 -0
  49. package/dist/chunk-K443GQY5.js.map +1 -0
  50. package/dist/chunk-LP6E462I.js +11555 -0
  51. package/dist/chunk-LP6E462I.js.map +1 -0
  52. package/dist/chunk-NVXNEOUQ.js +158 -0
  53. package/dist/chunk-NVXNEOUQ.js.map +1 -0
  54. package/dist/chunk-QZXKQB7Y.js +414 -0
  55. package/dist/chunk-QZXKQB7Y.js.map +1 -0
  56. package/dist/chunk-SBLGBZZB.js +647 -0
  57. package/dist/chunk-SBLGBZZB.js.map +1 -0
  58. package/dist/chunk-X2LKCX6H.js +499 -0
  59. package/dist/chunk-X2LKCX6H.js.map +1 -0
  60. package/dist/chunk-XELSA2MS.js +108 -0
  61. package/dist/chunk-XELSA2MS.js.map +1 -0
  62. package/dist/chunk-XORPNO3Z.js +684 -0
  63. package/dist/chunk-XORPNO3Z.js.map +1 -0
  64. package/dist/chunk-ZUJLSICT.js +7 -0
  65. package/dist/chunk-ZUJLSICT.js.map +1 -0
  66. package/dist/db-W3CP562I.js +239 -0
  67. package/dist/db-W3CP562I.js.map +1 -0
  68. package/dist/editorial-reading-room/assets/app.js +335 -0
  69. package/dist/editorial-reading-room/assets/index.html +131 -0
  70. package/dist/editorial-reading-room/assets/styles.css +1052 -0
  71. package/dist/extract-bundle-K4PG3RZJ.js +568 -0
  72. package/dist/extract-bundle-K4PG3RZJ.js.map +1 -0
  73. package/dist/index.cjs +4160 -0
  74. package/dist/index.cjs.map +1 -0
  75. package/dist/index.d.cts +413 -0
  76. package/dist/index.d.ts +413 -0
  77. package/dist/index.js +338 -0
  78. package/dist/index.js.map +1 -0
  79. package/dist/location-data-repository-RLQX6SNM.js +35 -0
  80. package/dist/location-data-repository-RLQX6SNM.js.map +1 -0
  81. package/dist/server-KM3CFWCF.js +34674 -0
  82. package/dist/server-KM3CFWCF.js.map +1 -0
  83. package/dist/site-extract-repository-2SMMFKKL.js +62 -0
  84. package/dist/site-extract-repository-2SMMFKKL.js.map +1 -0
  85. package/dist/worker-FXAGFYOE.js +142 -0
  86. package/dist/worker-FXAGFYOE.js.map +1 -0
  87. package/package.json +4 -2
@@ -0,0 +1,413 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const HarvestOptionsSchema: z.ZodObject<{
4
+ query: z.ZodString;
5
+ location: z.ZodOptional<z.ZodString>;
6
+ gl: z.ZodDefault<z.ZodString>;
7
+ hl: z.ZodDefault<z.ZodString>;
8
+ device: z.ZodDefault<z.ZodEnum<["desktop", "mobile"]>>;
9
+ proxyMode: z.ZodDefault<z.ZodEnum<["location", "configured", "none"]>>;
10
+ proxyZip: z.ZodOptional<z.ZodString>;
11
+ keepDefaultProxy: z.ZodOptional<z.ZodBoolean>;
12
+ requireUsEgress: z.ZodOptional<z.ZodBoolean>;
13
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
14
+ debug: z.ZodDefault<z.ZodBoolean>;
15
+ depth: z.ZodDefault<z.ZodNumber>;
16
+ maxQuestions: z.ZodDefault<z.ZodNumber>;
17
+ headless: z.ZodDefault<z.ZodBoolean>;
18
+ profileDir: z.ZodOptional<z.ZodString>;
19
+ proxy: z.ZodOptional<z.ZodString>;
20
+ kernelApiKey: z.ZodOptional<z.ZodString>;
21
+ kernelProxyId: z.ZodOptional<z.ZodString>;
22
+ kernelProxyResolution: z.ZodOptional<z.ZodUnknown>;
23
+ outputDir: z.ZodDefault<z.ZodString>;
24
+ format: z.ZodDefault<z.ZodEnum<["json", "csv", "both"]>>;
25
+ serpOnly: z.ZodDefault<z.ZodBoolean>;
26
+ pages: z.ZodDefault<z.ZodNumber>;
27
+ recency: z.ZodOptional<z.ZodEnum<["day", "week", "month", "year"]>>;
28
+ softDeadlineMs: z.ZodOptional<z.ZodNumber>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ query: string;
31
+ gl: string;
32
+ hl: string;
33
+ device: "desktop" | "mobile";
34
+ proxyMode: "none" | "location" | "configured";
35
+ debug: boolean;
36
+ depth: number;
37
+ maxQuestions: number;
38
+ headless: boolean;
39
+ outputDir: string;
40
+ format: "json" | "csv" | "both";
41
+ serpOnly: boolean;
42
+ pages: number;
43
+ location?: string | undefined;
44
+ proxyZip?: string | undefined;
45
+ keepDefaultProxy?: boolean | undefined;
46
+ requireUsEgress?: boolean | undefined;
47
+ maxAttempts?: number | undefined;
48
+ profileDir?: string | undefined;
49
+ proxy?: string | undefined;
50
+ kernelApiKey?: string | undefined;
51
+ kernelProxyId?: string | undefined;
52
+ kernelProxyResolution?: unknown;
53
+ recency?: "day" | "week" | "month" | "year" | undefined;
54
+ softDeadlineMs?: number | undefined;
55
+ }, {
56
+ query: string;
57
+ location?: string | undefined;
58
+ gl?: string | undefined;
59
+ hl?: string | undefined;
60
+ device?: "desktop" | "mobile" | undefined;
61
+ proxyMode?: "none" | "location" | "configured" | undefined;
62
+ proxyZip?: string | undefined;
63
+ keepDefaultProxy?: boolean | undefined;
64
+ requireUsEgress?: boolean | undefined;
65
+ maxAttempts?: number | undefined;
66
+ debug?: boolean | undefined;
67
+ depth?: number | undefined;
68
+ maxQuestions?: number | undefined;
69
+ headless?: boolean | undefined;
70
+ profileDir?: string | undefined;
71
+ proxy?: string | undefined;
72
+ kernelApiKey?: string | undefined;
73
+ kernelProxyId?: string | undefined;
74
+ kernelProxyResolution?: unknown;
75
+ outputDir?: string | undefined;
76
+ format?: "json" | "csv" | "both" | undefined;
77
+ serpOnly?: boolean | undefined;
78
+ pages?: number | undefined;
79
+ recency?: "day" | "week" | "month" | "year" | undefined;
80
+ softDeadlineMs?: number | undefined;
81
+ }>;
82
+
83
+ type CanonicalLocationName = string;
84
+ type SerpDevice = 'desktop' | 'mobile';
85
+ type ProxyMode = 'location' | 'configured' | 'none';
86
+ interface KernelLocationProxyTarget {
87
+ canonicalLocation: CanonicalLocationName;
88
+ level: 'zip' | 'city' | 'state';
89
+ country: 'US';
90
+ state: string;
91
+ city: string;
92
+ zip?: string;
93
+ cityCandidates: string[];
94
+ proxyName: string;
95
+ config: {
96
+ country: 'US';
97
+ state: string;
98
+ city?: string;
99
+ zip?: string;
100
+ };
101
+ }
102
+ type KernelProxyResolutionSource = 'disabled' | 'location_reused' | 'location_created' | 'isp_created' | 'backup_custom' | 'configured_fallback' | 'unavailable';
103
+ interface KernelProxyResolutionDebug {
104
+ source: KernelProxyResolutionSource;
105
+ proxyType: string;
106
+ proxyMode: ProxyMode;
107
+ proxyIdPresent: boolean;
108
+ proxyIdSuffix: string | null;
109
+ target: KernelLocationProxyTarget | null;
110
+ error: string | null;
111
+ disposable?: boolean;
112
+ }
113
+ interface HarvestStats {
114
+ seed: string;
115
+ totalQuestions: number;
116
+ maxDepthReached: number;
117
+ durationMs: number;
118
+ errorCount: number;
119
+ }
120
+ type HarvestCompletionStatus = 'paa_found' | 'no_paa' | 'serp_only';
121
+ /**
122
+ * A completed browser attempt can still be unsuitable for programmatic use.
123
+ * This is deliberately separate from completionStatus so a valid no-PAA
124
+ * response with organic results is not confused with an unreadable SERP.
125
+ */
126
+ type HarvestResultQuality = 'complete' | 'partial' | 'degraded';
127
+ type HarvestDegradationReason = 'empty_primary_serp';
128
+ type HarvestDiagnosticWarningCode = 'short_videos_captcha_skipped';
129
+ type HarvestDiagnosticWarningSurface = 'short_videos';
130
+ interface HarvestDiagnosticWarning {
131
+ code: HarvestDiagnosticWarningCode;
132
+ surface: HarvestDiagnosticWarningSurface;
133
+ message: string;
134
+ retryable: boolean;
135
+ }
136
+ interface HarvestCompleteness {
137
+ paaWithoutAnswer: number;
138
+ paaWithoutSource: number;
139
+ paaAnswersRecovered: number;
140
+ aioShareCaptured: boolean | null;
141
+ }
142
+ interface HarvestDiagnostics {
143
+ completionStatus: HarvestCompletionStatus;
144
+ problem: null;
145
+ resultQuality?: HarvestResultQuality;
146
+ degradedResult?: boolean;
147
+ degradationReasons?: HarvestDegradationReason[];
148
+ retryRecommended?: boolean;
149
+ warnings?: HarvestDiagnosticWarning[];
150
+ completeness?: HarvestCompleteness;
151
+ debug?: HarvestDebugSnapshot;
152
+ }
153
+ interface BrowserNetworkLocationDebug {
154
+ source: 'ipapi.co' | 'ipwho.is' | 'api64.ipify.org';
155
+ ip: string | null;
156
+ city: string | null;
157
+ region: string | null;
158
+ country: string | null;
159
+ org: string | null;
160
+ timezone: string | null;
161
+ error: string | null;
162
+ }
163
+ interface KernelSessionDebug {
164
+ sessionId: string | null;
165
+ proxyMode: ProxyMode;
166
+ requestedProxyIdPresent: boolean;
167
+ requestedProxyIdSuffix: string | null;
168
+ createdProxyIdPresent: boolean | null;
169
+ createdProxyIdSuffix: string | null;
170
+ retrievedProxyIdPresent: boolean | null;
171
+ retrievedProxyIdSuffix: string | null;
172
+ retrievedProxyIdMatchesRequested: boolean | null;
173
+ defaultProxyDisabled: boolean | null;
174
+ defaultProxyDisableError: string | null;
175
+ proxyResolution: KernelProxyResolutionDebug | null;
176
+ timeoutSeconds: number | null;
177
+ stealth: boolean | null;
178
+ profilePresent: boolean | null;
179
+ poolPresent: boolean | null;
180
+ retrieveError: string | null;
181
+ }
182
+ interface BrowserContextDebug {
183
+ viewport: {
184
+ width: number;
185
+ height: number;
186
+ };
187
+ locale: string;
188
+ device: SerpDevice;
189
+ userAgent: string;
190
+ deviceScaleFactor: number | null;
191
+ isMobile: boolean;
192
+ hasTouch: boolean;
193
+ }
194
+ interface SerpNavigationDebug {
195
+ requestedUrl: string;
196
+ finalUrl: string | null;
197
+ title: string | null;
198
+ bodySnippet: string | null;
199
+ hasPaa: boolean | null;
200
+ captchaDetected: boolean | null;
201
+ googleSorryUrl: boolean | null;
202
+ redirected: boolean | null;
203
+ }
204
+ interface BrowserDebugSnapshot {
205
+ kernel: KernelSessionDebug | null;
206
+ context: BrowserContextDebug | null;
207
+ networkLocation: BrowserNetworkLocationDebug | null;
208
+ serpNavigation: SerpNavigationDebug | null;
209
+ }
210
+ interface SerpLocationCandidate {
211
+ city: string;
212
+ regionCode: string;
213
+ count: number;
214
+ examples: string[];
215
+ }
216
+ interface SerpLocationEvidence {
217
+ status: 'not_requested' | 'matched' | 'mismatch' | 'unknown';
218
+ expected: {
219
+ city: string;
220
+ regionCode: string | null;
221
+ canonicalLocation: string;
222
+ } | null;
223
+ candidates: SerpLocationCandidate[];
224
+ }
225
+ interface HarvestDebugSnapshot {
226
+ enabled: true;
227
+ request: {
228
+ query: string;
229
+ locationInput: string | null;
230
+ canonicalLocation: string | null;
231
+ uule: string | null;
232
+ gl: string;
233
+ hl: string;
234
+ device: SerpDevice;
235
+ proxyMode: ProxyMode;
236
+ proxyZip: string | null;
237
+ serpOnly: boolean;
238
+ pages: number;
239
+ };
240
+ browser: BrowserDebugSnapshot;
241
+ locationEvidence?: SerpLocationEvidence;
242
+ }
243
+ interface PAANode {
244
+ question: string;
245
+ answer: string | null;
246
+ sourceTitle: string | null;
247
+ sourceSite: string | null;
248
+ sourceCite: string | null;
249
+ depth: number;
250
+ parentQuestion: string | null;
251
+ children: PAANode[];
252
+ }
253
+ interface FlatRow {
254
+ seed_query: string;
255
+ question: string;
256
+ answer: string;
257
+ source_title: string;
258
+ source_site: string;
259
+ source_cite: string;
260
+ depth: number;
261
+ parent_question: string;
262
+ extracted_at: string;
263
+ }
264
+ interface VideoResult {
265
+ type: 'video' | 'short_video';
266
+ title: string;
267
+ channel: string;
268
+ platform: string;
269
+ duration: string;
270
+ url: string;
271
+ }
272
+ interface ForumResult {
273
+ title: string;
274
+ source: string;
275
+ url: string;
276
+ }
277
+ interface WhatPeopleSayingCard {
278
+ type: 'reddit' | 'facebook' | 'instagram' | 'tiktok' | 'youtube' | 'news' | 'unknown';
279
+ title: string;
280
+ url: string;
281
+ source: string;
282
+ platform: string;
283
+ popularComment: string | null;
284
+ engagement: string;
285
+ date: string;
286
+ duration: string | null;
287
+ authorNote: string | null;
288
+ }
289
+ interface AICitation {
290
+ text: string;
291
+ href: string;
292
+ }
293
+ interface AIOverviewResult {
294
+ detected: boolean;
295
+ text: string | null;
296
+ citations: AICitation[];
297
+ expanded?: boolean;
298
+ fullyExpanded?: boolean;
299
+ sections?: string[];
300
+ shareUrl?: string | null;
301
+ }
302
+ interface AIModeResult {
303
+ detected: boolean;
304
+ text: string | null;
305
+ citations: AICitation[];
306
+ }
307
+ type GoogleSurface = 'web' | 'aim' | 'unknown';
308
+ interface OrganicResult {
309
+ position: number;
310
+ title: string;
311
+ url: string;
312
+ domain: string;
313
+ cite: string | null;
314
+ snippet: string | null;
315
+ isRedditStyle: boolean;
316
+ inlineRating: {
317
+ value: string;
318
+ count: string;
319
+ } | null;
320
+ }
321
+ interface LocalPackBusiness {
322
+ position: number;
323
+ name: string;
324
+ cid: string | null;
325
+ rating: string | null;
326
+ reviewCount: string | null;
327
+ metadata: string[];
328
+ websiteUrl: string | null;
329
+ directionsUrl: string | null;
330
+ }
331
+ interface EntityRecord {
332
+ name: string;
333
+ kgId: string | null;
334
+ cid: string | null;
335
+ gcid: string | null;
336
+ }
337
+ interface EntityIds {
338
+ entities: EntityRecord[];
339
+ kgIds: string[];
340
+ cids: string[];
341
+ gcids: string[];
342
+ }
343
+ interface HarvestResult {
344
+ seed: string;
345
+ location: string | null;
346
+ extractedAt: string;
347
+ diagnostics: HarvestDiagnostics;
348
+ totalQuestions: number;
349
+ surface: GoogleSurface;
350
+ aiOverview: AIOverviewResult;
351
+ aiMode: AIModeResult;
352
+ whatPeopleSaying: WhatPeopleSayingCard[];
353
+ tree: PAANode[];
354
+ flat: FlatRow[];
355
+ videos: VideoResult[];
356
+ forums: ForumResult[];
357
+ organicResults: OrganicResult[];
358
+ localPack: LocalPackBusiness[];
359
+ entityIds: EntityIds;
360
+ stats: HarvestStats;
361
+ }
362
+ type HarvestOptions = z.infer<typeof HarvestOptionsSchema>;
363
+
364
+ declare function harvest(rawOptions: unknown): Promise<HarvestResult>;
365
+
366
+ interface EpisodeBrief {
367
+ episodeNumber: number;
368
+ episodeCount: number;
369
+ slug: string;
370
+ sectionTitle: string;
371
+ storyMoment: string;
372
+ characterName: string;
373
+ clip1: string;
374
+ clip2: string;
375
+ voiceover: string;
376
+ audioMood: string;
377
+ depositionVisualTell: string;
378
+ continuityNote: string;
379
+ }
380
+
381
+ interface ClipPairOptions {
382
+ resolution?: '480p' | '720p' | '1080p';
383
+ aspectRatio?: '16:9' | '9:16' | '1:1';
384
+ clipDurationSeconds?: number;
385
+ generateAudio?: boolean;
386
+ seed?: number;
387
+ outputDir?: string;
388
+ }
389
+ interface ClipPairResult {
390
+ clip1Url: string;
391
+ clip2Url: string;
392
+ finalVideoPath: string;
393
+ seed: number;
394
+ promptClip1: string;
395
+ promptClip2: string;
396
+ voiceover: string;
397
+ audioMood: string;
398
+ }
399
+ declare class VideoGenerator {
400
+ constructor(apiKey?: string);
401
+ generateClipPair(question: string, answer: string, opts?: ClipPairOptions): Promise<ClipPairResult>;
402
+ generateEpisode(brief: EpisodeBrief, opts?: ClipPairOptions): Promise<ClipPairResult>;
403
+ }
404
+
405
+ interface ClipPromptPair {
406
+ clip1: string;
407
+ clip2: string;
408
+ voiceover: string;
409
+ audioMood: string;
410
+ }
411
+ declare function buildClipPrompts(question: string, answer: string): Promise<ClipPromptPair>;
412
+
413
+ export { type AICitation, type AIModeResult, type AIOverviewResult, type ClipPairOptions, type ClipPairResult, type FlatRow, type GoogleSurface, type HarvestCompletionStatus, type HarvestDiagnostics, type HarvestOptions, type HarvestResult, type HarvestStats, type PAANode, VideoGenerator, type WhatPeopleSayingCard, buildClipPrompts, harvest };