hippo-memory 1.52.0 → 1.52.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/store.d.ts CHANGED
@@ -109,6 +109,8 @@ export declare function assertNonEmpty<T>(arr: readonly T[], name: string): void
109
109
  export declare function getHippoRoot(cwd?: string, opts?: ResolveProjectIdentityOpts): string;
110
110
  export declare function isInitialized(hippoRoot: string): boolean;
111
111
  export declare function initStore(hippoRoot: string): void;
112
+ /** One open connection with init done on it, for callers who used to pay for `initStore` + a second `openHippoDb`. */
113
+ export declare function openStore(hippoRoot: string): DatabaseSyncLike;
112
114
  /** `meta` key holding the default half-life base a store's memories are on (src/half-life-migration.ts). */
113
115
  export declare const HALF_LIFE_BASE_META_KEY = "default_half_life_base";
114
116
  /**
@@ -411,7 +413,16 @@ export declare function batchWriteAndDelete(hippoRoot: string, toWrite: MemoryEn
411
413
  export declare function loadAllEntries(hippoRoot: string, tenantId?: string): MemoryEntry[];
412
414
  /** Every memory row on an open connection, so a caller can read inside its own transaction. */
413
415
  export declare function selectAllEntries(db: DatabaseSyncLike, tenantId?: string): MemoryEntry[];
414
- export declare function loadAmbientCandidates(hippoRoot: string, tenantId: string, recentNeeded: number, admit: (e: MemoryEntry) => boolean): MemoryEntry[];
416
+ export declare function loadContentsWithTag(hippoRoot: string, tenantId: string, tag: string): string[];
417
+ export interface AmbientRecallRequest {
418
+ terms: string[];
419
+ limit: number;
420
+ }
421
+ export interface AmbientLoadResult {
422
+ entries: MemoryEntry[];
423
+ recall?: MemoryEntry[];
424
+ }
425
+ export declare function loadAmbientCandidates(hippoRoot: string, tenantId: string, recentNeeded: number, admit: (e: MemoryEntry) => boolean, recall?: AmbientRecallRequest): AmbientLoadResult;
415
426
  /**
416
427
  * Load likely search candidates directly from SQLite.
417
428
  * Uses FTS5 when available, falls back to LIKE matching, then full-store fallback.
@@ -445,6 +456,10 @@ export declare function loadSearchEntries(hippoRoot: string, query: string, limi
445
456
  * undefined as "no tenant filter" for legacy callers.
446
457
  */
447
458
  export declare function loadRecallSearchEntries(hippoRoot: string, query: string, limit?: number, tenantId?: string, requestedScope?: string, explicitScopeMode?: 'exact' | 'additive', includeSuperseded?: boolean): MemoryEntry[];
459
+ export declare function loadRecallSearchEntriesFromDb(db: DatabaseSyncLike, query: string, limit?: number, tenantId?: string, requestedScope?: string, explicitScopeMode?: 'exact' | 'additive', includeSuperseded?: boolean): MemoryEntry[];
460
+ /** Rarest-K prompt terms for this connection's FTS index, as a space-joined query string.
461
+ * Without FTS, returns the first 32 terms, as before rarest-term selection. */
462
+ export declare function pickRarestFtsQuery(db: DatabaseSyncLike, terms: readonly string[], maxTerms?: number): string;
448
463
  /**
449
464
  * Rebuild mirrors from SQLite, importing any legacy markdown files not already present.
450
465
  */