/** * Core shared type definitions for Iranti's knowledge entry model. * * This module is the single source of truth for the data shapes that flow * between the Library, Librarian, Attendant, and API layers. Changing a type * here has downstream consequences in every layer — treat this file as a * public contract surface. */ export type EntityType = 'system' | 'agent' | string; export interface EntryInput { entityType: EntityType; entityId: string; key: string; valueRaw: unknown; valueSummary: string; confidence: number; source: string; validFrom?: Date; validUntil?: Date | null; lastAccessedAt?: Date; stability?: number; createdBy: string; isProtected?: boolean; conflictLog?: ConflictLogEntry[]; requestId?: string; properties?: Record; } export interface ConflictLogEntry { detectedAt: string; incomingSource: string; incomingConfidence: number; existingConfidence: number; resolution: 'overwritten' | 'kept' | 'escalated' | 'human_resolved'; resolvedBy?: string; notes?: string; } export type EscalationStatus = 'PENDING' | 'RESOLVED'; export interface EscalationFile { id: string; status: EscalationStatus; librarianAssessment: { conflict: string; existingConfidence: number; incomingConfidence: number; reasoning: string; }; humanResolution?: string; createdAt: string; resolvedAt?: string; } export interface EntryQuery { entityType: EntityType; entityId: string; key: string; } export interface QueryResult { found: boolean; entry?: { valueRaw: unknown; valueSummary: string; confidence: number; source: string; validFrom: Date; validUntil?: Date | null; }; } export interface HybridSearchInput { query: string; limit?: number; entityType?: EntityType; entityId?: string; lexicalWeight?: number; vectorWeight?: number; minScore?: number; } export interface HybridSearchResult { id: number; entityType: EntityType; entityId: string; key: string; valueRaw: unknown; valueSummary: string; confidence: number; source: string; validUntil?: Date | null; lexicalScore: number; vectorScore: number; score: number; } //# sourceMappingURL=types.d.ts.map