/**
 * Pattern Extraction module for the CLEO Intelligence dimension.
 *
 * Provides automatic pattern detection from brain_observations and task history,
 * pattern matching against brain_patterns, and pattern storage/stat updates.
 *
 * Uses the existing brain_patterns and brain_learnings tables — no new tables.
 *
 * @task Wave3A
 * @epic T5149
 */
import type { BrainDataAccessor } from '../store/brain-accessor.js';
import type { BrainPatternRow } from '../store/brain-schema.js';
import type { DataAccessor } from '../store/data-accessor.js';
import type { DetectedPattern, PatternExtractionOptions, PatternMatch, PatternStatsUpdate } from './types.js';
/**
 * Analyze brain_observations and task history to find recurring patterns.
 *
 * Detects:
 * - Workflow patterns: common task sequences that succeed/fail
 * - Blocker patterns: what commonly blocks tasks
 * - Success patterns: what correlates with successful task completion
 * - Time patterns: recurring label/type distributions by task status
 *
 * @param taskAccessor - DataAccessor for tasks.db
 * @param brainAccessor - BrainDataAccessor for brain.db
 * @param options - Extraction options (min frequency, confidence, limit)
 * @returns Array of detected patterns sorted by frequency descending
 */
export declare function extractPatternsFromHistory(taskAccessor: DataAccessor, brainAccessor: BrainDataAccessor, options?: PatternExtractionOptions): Promise<DetectedPattern[]>;
/**
 * Find which known patterns from brain_patterns apply to a given task.
 *
 * Compares task attributes (labels, title, description, type, size, status)
 * against stored patterns and returns matches with relevance scores.
 *
 * @param taskId - The task to match patterns against
 * @param taskAccessor - DataAccessor for tasks.db
 * @param brainAccessor - BrainDataAccessor for brain.db
 * @returns Array of pattern matches sorted by relevance descending
 */
export declare function matchPatterns(taskId: string, taskAccessor: DataAccessor, brainAccessor: BrainDataAccessor): Promise<PatternMatch[]>;
/**
 * Save a detected pattern to the brain_patterns table.
 *
 * Uses the existing brain_patterns schema: type, pattern, context, frequency,
 * success_rate, impact, anti_pattern, mitigation, examples_json.
 *
 * @param detected - The pattern to store
 * @param brainAccessor - BrainDataAccessor for brain.db
 * @returns The stored pattern row
 */
export declare function storeDetectedPattern(detected: DetectedPattern, brainAccessor: BrainDataAccessor): Promise<BrainPatternRow>;
/**
 * Update the frequency and success_rate of an existing pattern after an outcome.
 *
 * Increments frequency by 1 and recalculates success_rate using the running
 * average formula: newRate = (oldRate * oldFreq + (success ? 1 : 0)) / newFreq.
 *
 * @param patternId - The brain_patterns ID to update
 * @param outcome - Whether the outcome was successful
 * @param brainAccessor - BrainDataAccessor for brain.db
 * @returns The update result or null if the pattern was not found
 */
export declare function updatePatternStats(patternId: string, outcome: boolean, brainAccessor: BrainDataAccessor): Promise<PatternStatsUpdate | null>;
//# sourceMappingURL=patterns.d.ts.map