/** * Knowledge Entry Management * * CRUD operations for knowledge base entries. Handles embedding generation, * tag synchronization, and relationship management. */ import type { KnowledgeEntry, KnowledgeEntryInput, KnowledgeEntryUpdate } from '../types.ts'; /** * Strip embedding vectors from an entry to keep responses compact. * Embeddings are large float arrays not useful in API responses. * * NOTE: Harper database records use non-enumerable properties, so * object spread ({...record}) produces an empty object. We must * explicitly read each field. */ export declare function stripEmbedding(entry: any): Omit; /** * Create a new knowledge entry. * * Generates an embedding from title + content, synchronizes tags, * and stores the entry. A UUID is generated if no id is provided. * * @param data - Entry data to create * @returns The created knowledge entry */ export declare function createEntry(data: KnowledgeEntryInput): Promise; /** * Get a knowledge entry by ID. * * @param id - Entry ID * @returns The entry, or null if not found */ export declare function getEntry(id: string): Promise; /** * Update an existing knowledge entry. * * Merges the update data with the existing entry. If title or content changed, * regenerates the embedding. Synchronizes tag counts if tags changed. * Optionally logs the edit to the history table. * * @param id - ID of the entry to update * @param data - Fields to update * @param options - Optional edit tracking metadata * @returns The updated entry * @throws Error if the entry does not exist */ export declare function updateEntry(id: string, data: KnowledgeEntryUpdate, options?: { editedBy?: string; editSummary?: string; }): Promise; /** * Mark an entry as deprecated. * * @param id - ID of the entry to deprecate * @throws Error if the entry does not exist */ export declare function deprecateEntry(id: string): Promise; /** * Link a new entry as superseding an old entry. * * Sets newEntry.supersedesId = oldId and oldEntry.supersededById = newId. * * @param newId - ID of the new (superseding) entry * @param oldId - ID of the old (superseded) entry * @throws Error if either entry does not exist */ export declare function linkSupersedes(newId: string, oldId: string): Promise; /** * Link multiple entries as siblings. * * For each entry, adds all other entry IDs to its siblingIds array (deduplicated). * * @param ids - IDs of entries to link as siblings * @throws Error if any entry does not exist */ export declare function linkSiblings(ids: string[]): Promise; /** * Reindex embeddings for all entries missing them. * * Iterates every KnowledgeEntry, generates embeddings for any that * don't have one yet, and writes them back. Returns counts of * processed, updated, and failed entries. */ export declare function reindexEmbeddings(kbId: string): Promise<{ total: number; updated: number; failed: number; skipped: number; }>; /** * Link two entries as related. * * Adds relatedId to the entry's relatedIds array (deduplicated). * This is a one-directional link; call twice for bidirectional. * * @param id - ID of the entry to add a related link to * @param relatedId - ID of the related entry * @throws Error if the entry does not exist */ export declare function linkRelated(id: string, relatedId: string): Promise; //# sourceMappingURL=entries.d.ts.map