/**
 * Session Memory Auto-Capture
 *
 * When a session ends, automatically persists decisions, patterns,
 * and learnings to brain.db as observations with source_type='session-debrief'.
 *
 * Also provides getSessionMemoryContext() for enriching session start/resume
 * with relevant brain memory.
 *
 * @epic T5149
 */
import type { DebriefData } from '../sessions/handoff.js';
import type { BrainCompactHit, BrainObservationType } from './brain-retrieval.js';
/** Result of persisting session memory to brain.db. */
export interface SessionMemoryResult {
    /** Number of observations created */
    observationsCreated: number;
    /** Number of links created */
    linksCreated: number;
    /** IDs of created observations */
    observationIds: string[];
    /** Whether any errors occurred (best-effort -- errors don't fail the operation) */
    errors: string[];
}
/** A memory item to be persisted to brain.db. */
export interface MemoryItem {
    text: string;
    title: string;
    type: BrainObservationType;
    sourceSessionId: string;
    sourceType: 'session-debrief';
    /** Optional task ID to link this observation to */
    linkTaskId?: string;
}
/** Memory context returned for session start/resume enrichment. */
export interface SessionMemoryContext {
    /** Recent decisions relevant to this scope */
    recentDecisions: BrainCompactHit[];
    /** Patterns relevant to this scope */
    relevantPatterns: BrainCompactHit[];
    /** Recent observations from prior sessions */
    recentObservations: BrainCompactHit[];
    /** Recent learnings relevant to this scope */
    recentLearnings: BrainCompactHit[];
    /** Total token estimate for this context */
    tokensEstimated: number;
}
/**
 * Extract memory-worthy items from debrief data.
 * Pure function -- no side effects.
 *
 * Items extracted:
 * - Decisions (from debrief.decisions[]) -> observations with type='decision'
 * - Tasks completed summary -> observation with type='change'
 * - Session-level note (if present) -> observation with type='discovery'
 */
export declare function extractMemoryItems(sessionId: string, debrief: DebriefData | null | undefined): MemoryItem[];
/**
 * Main entry point -- called from session.end handler.
 * Extracts memory-worthy content from debrief data and persists to brain.db.
 *
 * ALL errors are caught and accumulated in result.errors -- never throws.
 *
 * @param projectRoot - Project root directory
 * @param sessionId - The session that just ended
 * @param debrief - Rich debrief data from sessionComputeDebrief()
 * @returns Summary of what was persisted
 */
export declare function persistSessionMemory(projectRoot: string, sessionId: string, debrief: DebriefData | null | undefined): Promise<SessionMemoryResult>;
/**
 * Retrieve session memory for a given scope.
 * Used by briefing/handoff to enrich response with brain context.
 *
 * @param projectRoot - Project root directory
 * @param scope - Session scope for filtering (epic:T### or global)
 * @param options - Retrieval options
 * @returns Relevant brain memory entries
 */
export declare function getSessionMemoryContext(projectRoot: string, scope?: {
    type: string;
    epicId?: string;
    rootTaskId?: string;
}, options?: {
    limit?: number;
    includeDecisions?: boolean;
    includePatterns?: boolean;
}): Promise<SessionMemoryContext>;
//# sourceMappingURL=session-memory.d.ts.map