/** * Research Extractor - Identifies discoveries and findings from conversations. * * This extractor analyzes conversation history to identify research activities * and their discoveries. It captures: * - What was being researched * - Discovery / finding * - Source of the discovery (code, docs, web, experimentation) * - Relevance to the current problem * - Confidence level * * @example * ```typescript * const extractor = new ResearchExtractor(); * const findings = extractor.extractFindings(messages, toolUses, toolResults); * findings.forEach(f => { * console.log(`Topic: ${f.topic}`); * console.log(`Discovery: ${f.discovery}`); * console.log(`Source: ${f.source_type}`); * }); * ``` */ import type { Message, ToolUse, ToolResult } from "./ConversationParser.js"; /** * Represents a research finding extracted from conversation history. */ export interface ResearchFinding { /** Unique finding identifier */ id: string; /** Conversation where this finding was made */ conversation_id: string; /** Message containing the finding */ message_id: string; /** Topic being researched */ topic: string; /** The actual discovery/finding */ discovery: string; /** Type of source */ source_type: "code" | "documentation" | "web" | "experimentation" | "user_input"; /** Specific source reference (file path, URL, etc.) */ source_reference?: string; /** How relevant this is to the problem */ relevance: "high" | "medium" | "low"; /** Confidence in this finding */ confidence: "verified" | "likely" | "uncertain"; /** Related files or components */ related_to: string[]; /** When the finding was made */ timestamp: number; } /** * Extracts research findings from conversation history. */ export declare class ResearchExtractor { private readonly NOISE_PATTERNS; private readonly DISCOVERY_PATTERNS; private readonly SOURCE_PATTERNS; private readonly TOPIC_PATTERNS; private readonly RELEVANCE_INDICATORS; private readonly CONFIDENCE_INDICATORS; /** * Extract research findings from conversation history. * * @param messages - Array of conversation messages * @param toolUses - Array of tool uses * @param toolResults - Array of tool results * @returns Array of extracted ResearchFinding objects */ extractFindings(messages: Message[], toolUses: ToolUse[], toolResults: ToolResult[]): ResearchFinding[]; /** * Check if content is noise that should be filtered out. */ private isNoiseContent; /** * Group tool uses by message ID. */ private groupToolUsesByMessage; /** * Map tool results by tool use ID. */ private mapToolResultsByUse; /** * Extract findings from a single message. */ private extractFromMessage; /** * Get context around a match position. */ private getContextAround; /** * Identify the topic being researched. */ private identifyTopic; /** * Identify the source type of the finding. */ private identifySourceType; /** * Extract source reference (file path, URL, etc.). */ private extractSourceReference; /** * Determine relevance of the finding. */ private determineRelevance; /** * Determine confidence level of the finding. */ private determineConfidence; /** * Extract related files or components. */ private extractRelatedItems; /** * Deduplicate similar findings. */ private deduplicateFindings; } //# sourceMappingURL=ResearchExtractor.d.ts.map