/** * Methodology Extractor - Identifies problem-solving approaches from conversations. * * This extractor analyzes conversation history to identify how AI solved problems, * capturing the methodology, steps taken, and tools used. It helps trace: * - Problem statement / initial understanding * - Approach taken (exploration, research, implementation) * - Steps / sequence of actions * - Tools and commands used * - Files explored * - Outcome (success, partial, failed) * * @example * ```typescript * const extractor = new MethodologyExtractor(); * const methodologies = extractor.extractMethodologies(messages, toolUses, toolResults); * methodologies.forEach(m => { * console.log(`Problem: ${m.problem_statement}`); * console.log(`Approach: ${m.approach}`); * console.log(`Steps: ${m.steps_taken.length}`); * }); * ``` */ import type { Message, ToolUse, ToolResult } from "./ConversationParser.js"; /** * Represents a problem-solving methodology extracted from conversation history. */ export interface Methodology { /** Unique methodology identifier */ id: string; /** Conversation where this methodology was used */ conversation_id: string; /** Starting message ID */ start_message_id: string; /** Ending message ID */ end_message_id: string; /** The problem being solved */ problem_statement: string; /** High-level approach category */ approach: "exploration" | "research" | "implementation" | "debugging" | "refactoring" | "testing"; /** Sequence of steps taken */ steps_taken: MethodologyStep[]; /** Tools/commands used */ tools_used: string[]; /** Files explored or modified */ files_involved: string[]; /** Outcome of the approach */ outcome: "success" | "partial" | "failed" | "ongoing"; /** Summary of what worked */ what_worked?: string; /** Summary of what didn't work */ what_didnt_work?: string; /** When the methodology started */ started_at: number; /** When the methodology ended */ ended_at: number; } /** * A single step in the methodology. */ export interface MethodologyStep { /** Step number */ order: number; /** What was done */ action: string; /** Tool used (if any) */ tool?: string; /** Result of the action */ result?: string; /** Whether this step succeeded */ succeeded: boolean; } /** * Extracts problem-solving methodologies from conversation history. */ export declare class MethodologyExtractor { private readonly PROBLEM_START_PATTERNS; private readonly APPROACH_PATTERNS; private readonly OUTCOME_PATTERNS; /** * Extract methodologies 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 Methodology objects */ extractMethodologies(messages: Message[], toolUses: ToolUse[], toolResults: ToolResult[]): Methodology[]; /** * Group messages by conversation ID. */ private groupByConversation; /** * Identify segments of messages that represent problem-solving. */ private identifyProblemSegments; /** * Extract methodology from a problem-solving segment. */ private extractMethodologyFromSegment; /** * Extract the problem statement from the first user message. */ private extractProblemStatement; /** * Identify the primary approach used. */ private identifyApproach; /** * Extract steps taken during problem-solving. */ private extractSteps; /** * Describe what a tool action did. */ private describeToolAction; /** * Summarize a tool result. */ private summarizeToolResult; /** * Extract unique tools used in the segment. */ private extractToolsUsed; /** * Extract files involved in the segment. */ private extractFilesInvolved; /** * Determine the outcome of the problem-solving. */ private determineOutcome; /** * Extract lessons learned from the segment. */ private extractLessonsLearned; } //# sourceMappingURL=MethodologyExtractor.d.ts.map