/** * Fragment Evolution Engine * * The core of prose: evolve semantic fragments as new messages * are processed. Each fragment sees its own previous state and produces * an updated version - evolution, not extraction. * * Uses a cheap LLM (Gemini 3 Flash via OpenRouter) for fast, affordable * compression of conversation into structured memory. */ import type { Message } from './session-parser.js'; import type { AllFragments, DecisionFragment, InsightFragment, FocusFragment, NarrativeFragment, VocabularyFragment } from './schemas.js'; export interface EvolutionContext { /** Messages to process in this evolution step */ messages: Message[]; /** All fragments (for cross-pollination) */ allFragments: AllFragments; /** Project name/path for context */ project?: string; /** Session ID for context */ sessionId?: string; } export interface EvolutionResult { success: boolean; data?: T; error?: string; tokensUsed?: number; } export interface EvolutionConfig { apiKey: string; baseUrl?: string; model?: string; temperature?: number; timeoutMs?: number; jinaApiKey?: string; } /** * Evolve the decisions fragment */ export declare function evolveDecisions(currentState: DecisionFragment | null, context: EvolutionContext, config: EvolutionConfig): Promise>; /** * Evolve the insights fragment */ export declare function evolveInsights(currentState: InsightFragment | null, context: EvolutionContext, config: EvolutionConfig): Promise>; /** * Evolve the focus fragment */ export declare function evolveFocus(currentState: FocusFragment | null, context: EvolutionContext, config: EvolutionConfig): Promise>; /** * Evolve the narrative fragment */ export declare function evolveNarrative(currentState: NarrativeFragment | null, context: EvolutionContext, config: EvolutionConfig): Promise>; /** * Evolve the vocabulary fragment (simpler - can be done locally) */ export declare function evolveVocabulary(currentState: VocabularyFragment | null, context: EvolutionContext): EvolutionResult; export interface BatchEvolutionResult { fragments: AllFragments; tokensUsed: number; errors: string[]; } /** * Evolve all fragments in parallel */ export declare function evolveAllFragments(currentFragments: AllFragments, context: EvolutionContext, config: EvolutionConfig): Promise; //# sourceMappingURL=evolve.d.ts.map