import type { ISessionCaptureService, ICapturedWork, ILogger } from '../../domain'; import type { ITranscriptEnricher } from '../../domain/interfaces/ITranscriptEnricher'; import type { IWorkSummary } from '../../domain/interfaces/IWorkSummary'; export type { IWorkSummary } from '../../domain/interfaces/IWorkSummary'; /** * Service for capturing session work from Claude Code transcripts. * * Analyzes session transcript and extracts facts worth remembering. * This is the full implementation that replaces the session-stop-worker. */ export declare class SessionCaptureService implements ISessionCaptureService { private readonly logger?; private readonly transcriptEnricher?; constructor(logger?: ILogger, transcriptEnricher?: ITranscriptEnricher); /** * Capture work from the current session. * * 1. Finds the session transcript * 2. Parses transcript for meaningful work * 3. Builds facts from work summary * 4. Returns captured work with complexity rating * * @param sessionId - Optional session ID (used in fact tags) * @param transcriptPath - Optional explicit transcript path */ captureSessionWork(sessionId?: string, transcriptPath?: string): Promise; /** * Find the transcript file using deterministic resolution. * * Resolution algorithm: * 1. If explicit path is provided and exists, use it directly * 2. Otherwise, search standard Claude Code transcript locations * 3. Collect all matching transcript candidates * 4. Select the newest candidate (by modification time) * 5. Log warning if multiple candidates found * * @param providedPath - Optional explicit transcript path (always preferred) * @returns Path to transcript file, or null if not found */ findTranscript(providedPath?: string): string | null; /** * Find all transcript candidates from standard Claude Code locations. * * Claude Code stores session transcripts as UUID-named JSONL files: * ~/.claude/projects//.jsonl * * The project folder is derived from the working directory path with * path separators replaced by dashes (e.g. C:\dev\lisa → C--dev-lisa). * * @returns Array of candidates with path and modification time */ private findTranscriptCandidates; /** * Parse transcript file to extract work summary including heuristic detections. */ parseTranscript(transcriptPath: string): IWorkSummary; /** * Check if there's significant work to capture. */ hasSignificantWork(work: IWorkSummary): boolean; /** * Build facts from work summary including heuristic-detected facts. */ buildFacts(work: IWorkSummary, sessionId?: string): string[]; /** * Rate the complexity of work performed. */ rateComplexity(work: IWorkSummary): ICapturedWork['complexity']; /** * Detect user decisions from confirmation patterns. * * Scans for user messages matching confirmation patterns (yes, ok, sounds good, etc.) * preceded by assistant messages that present options or recommendations. */ private detectDecisions; /** * Detect errors from stack traces, error types, tool failures, and retry patterns. */ private detectErrors; /** * Correlate file changes with preceding user prompts. * * For each changed file, find preceding user prompt (within 3-message window) * whose text mentions the file name or related keywords. */ private correlateFilePrompts; /** * Detect the dominant task type from user prompts using DETECTION_SIGNALS. */ private detectTaskType; /** * Extract text content from a transcript message. */ private extractMessageText; /** * Extract tool name from a transcript message. */ private extractToolName; /** * Check if a tool_result message indicates an error. */ private extractToolError; /** * Extract the first Error: line from text containing a stack trace. */ private extractErrorLine; /** * Extract a decision topic from an assistant's message. * Takes the first sentence or first 120 characters. */ private extractDecisionTopic; /** * Extract a snippet of conversation text from the transcript for LLM analysis. * Concatenates user and assistant text content, truncated to a reasonable length. */ private getTranscriptSnippet; /** * Detect repository name from git. */ detectRepo(): string; /** * Get project name from package.json or directory. */ private getProjectName; } //# sourceMappingURL=SessionCaptureService.d.ts.map