import type { Observation, Decision, ActionPlan, PlanVerification, PlanExecution, Experience, SkillProfile } from './types.js'; export declare class Reflector { /** * Create an Experience record from a completed agent cycle. * Compares execution results against plan postConditions to * determine the outcome, then derives lessons and metadata. */ reflect(observation: Observation, decision: Decision, plan: ActionPlan, verification: PlanVerification, execution: PlanExecution): Experience; /** * Compare each step's execution status against its postConditions * to classify the overall outcome. */ private determineOutcome; /** * Describe what differed between the plan and actual execution. */ private computeDelta; /** * Extract actionable lessons from the cycle. */ private extractLessons; /** * Infer a domain label from the observation and decision context. */ private inferDomain; /** * Derive searchable tags from the cycle's context. */ private deriveTags; } export interface ExperienceStoreInterface { save(experience: Experience): Promise; getRelevantExperiences(context: string, limit?: number): Promise; getByDomain(domain: string): Promise; getStats(): Promise; } /** * Persists Experience records to a JSON-lines file. * Uses append-only writes to handle growing files without * reading the entire store into memory for each write. * * File format: one JSON object per line (JSON Lines / NDJSON). */ export declare class ExperienceStore implements ExperienceStoreInterface { private readonly filePath; constructor(filePath: string); /** * Append an experience to the store file. * Creates the file and parent directories if they don't exist. */ save(experience: Experience): Promise; /** * Find experiences relevant to a given context string. * Uses simple text matching for now — vector search in Phase 2. */ getRelevantExperiences(context: string, limit?: number): Promise; /** * Get all experiences for a specific domain. */ getByDomain(domain: string): Promise; /** * Generate SkillProfile summaries per domain. */ getStats(): Promise; /** * Read all experiences from the NDJSON file. */ private readAll; /** * Ensure the store file and its parent directories exist. */ private ensureFileExists; }