import type { HippoMemoryConfig } from "./config.js"; import type { MemoryService } from "./memory-service.js"; import { Mutex } from "./mutex.js"; import type { AutoShareResult, ConsolidationResult, ContextOptions, ContextResult, DecideInput, ErrorCaptureInput, InitResult, LearnResult, MemoryConflictView, MemoryEntryView, MemoryRoot, MemoryStatus, RecallOptions, RecallResult, RememberInput, ShareResult, WorkingMemoryItem } from "./types.js"; export declare class HippoMemoryService implements MemoryService { protected readonly config: HippoMemoryConfig; protected readonly writeMutex: Mutex; private ready; private projectRoot; private globalRoot; constructor(config: HippoMemoryConfig); init(_cwd: string): Promise; shutdown(): Promise; isReady(): boolean; remember(input: RememberInput): Promise; captureError(input: ErrorCaptureInput): Promise; decide(input: DecideInput): Promise; recall(query: string, opts?: RecallOptions): Promise; context(opts?: ContextOptions): Promise; inspect(id: string): Promise; listConflicts(status?: "open" | "resolved" | "all"): Promise; outcome(id: string, result: "good" | "bad"): Promise; pin(id: string, pinned: boolean): Promise; forget(id: string): Promise; invalidate(pattern: string, reason?: string): Promise; resolveConflict(conflictId: string, keep: "first" | "second"): Promise; sleep(opts?: { dryRun?: boolean; }): Promise; status(): Promise; wmPush(item: WorkingMemoryItem): Promise; wmRead(scope: string): Promise; wmFlush(): Promise; share(idOrAuto: string | "auto", dryRun?: boolean): Promise; autoShare(): Promise; learnFromGit(opts?: { days?: number; repos?: string[]; }): Promise; /** * Read newSinceLastSleep and lastSleepAt from hippo's SQLite tables. * Uses two read-only queries: * - `MAX(timestamp) FROM consolidation_runs` → lastSleepAt * - `COUNT(*) FROM memories WHERE created > lastSleepAt` → newSinceLastSleep * Falls back to {0, null} on any error (e.g., DB not yet initialized). */ private loadSleepMetrics; /** * Load store statistics via SQL COUNT queries. * O(1) regardless of store size — avoids loading all entries into memory. */ private loadStoreStats; /** * Find entries matching a pattern using SQL LIKE. * Returns up to `limit` candidates without loading all entries into memory. */ private findEntriesByPattern; /** * Convert a SQLite row to a MemoryEntry. * Duplicated from hippo-memory's internal rowToMemoryEntry for use in * findEntriesByPattern since hippo-memory doesn't export this helper. */ private rowToMemoryEntry; private parseTagsJson; private parseJsonArray; private findRootContaining; /** * Map a hippo-memory MemoryEntry to our domain-facing MemoryEntryView. * This is the ONLY boundary where hippo's internal shape meets our public * types — every reader downstream uses MemoryEntryView exclusively. * * hippo's `EmotionalValence` and `ConfidenceLevel` are string literal * unions identical to ours, so direct assignment is type-safe. * `Layer` is a string enum, so we map it through `layerToDomain` to get a * checked narrowing into our `MemoryLayer` union. */ private toView; private formatContextBlock; protected requireProjectRoot(): string; protected getGlobalRoot(): string | null; /** Annotation helper so later waves can mark entries as project vs global without duplicating the logic. */ protected rootOf(entryRoot: MemoryRoot): string; protected withWrite(fn: () => Promise): Promise; } //# sourceMappingURL=hippo-memory-service.d.ts.map