/** * Project Mind MCP - Base Scraper * * Abstract base class with shared scraping logic. * Concrete implementations handle platform-specific details. */ import { Browser, BrowserContext, Page } from 'playwright'; import type { ConversationScraper, ScraperSource, ScraperOptions, ScraperAuth, Cookie, Conversation, ConversationPreview, ConversationArchive, ExtractionProgress, ExtractionCheckpoint } from './types.js'; export declare abstract class BaseScraper implements ConversationScraper { abstract readonly source: ScraperSource; abstract readonly name: string; protected browser: Browser | null; protected context: BrowserContext | null; protected page: Page | null; protected options: ScraperOptions | null; protected abstract getBaseUrl(): string; protected abstract getAuthTestUrl(): string; protected abstract isAuthenticated(page: Page): Promise; protected abstract fetchConversationList(): Promise; protected abstract fetchConversation(id: string): Promise; initialize(options: ScraperOptions): Promise; testAuth(): Promise<{ success: boolean; error?: string; account?: string; }>; protected loadCookies(auth: ScraperAuth): Promise; listConversations(options?: { dateFilter?: ScraperOptions['dateFilter']; projectFilter?: ScraperOptions['projectFilter']; limit?: number; }): Promise; protected filterByDate(conversations: ConversationPreview[], filter: ScraperOptions['dateFilter']): ConversationPreview[]; protected filterByProject(conversations: ConversationPreview[], filter: ScraperOptions['projectFilter']): ConversationPreview[]; extractConversation(conversationId: string): Promise; extractAll(onProgress: (progress: ExtractionProgress) => void, onCheckpoint: (checkpoint: ExtractionCheckpoint) => void): Promise; resumeExtraction(checkpoint: ExtractionCheckpoint, onProgress: (progress: ExtractionProgress) => void, onCheckpoint: (checkpoint: ExtractionCheckpoint) => void): Promise; protected buildArchive(conversations: Conversation[]): ConversationArchive; protected saveArchive(archive: ConversationArchive): Promise; protected saveAsJson(archive: ConversationArchive, basePath: string): Promise; protected saveAsGzip(archive: ConversationArchive, basePath: string): Promise; protected saveSplitByProject(archive: ConversationArchive, basePath: string): Promise; close(): Promise; protected sleep(ms: number): Promise; protected scrollToBottom(page: Page): Promise; } //# sourceMappingURL=base-scraper.d.ts.map