/** * GraphIds - ID generation and normalization utilities * * Generates stable, URL-safe IDs for graph entities. * Uses deterministic hashing for idempotent upserts. */ import type { EntityId, ObservationId, RelationId } from '../../types/graph.js'; /** * Normalizes a name for consistent lookup * - Trims whitespace * - Converts to lowercase * - Replaces multiple spaces with single space */ export declare function normalizeName(name: string): string; /** * Creates a stable entity ID from name and type * Same name+type always produces the same ID (idempotent) */ export declare function createEntityId(name: string, entityType: string): EntityId; /** * Creates a unique observation ID * Includes entity, full text, and timestamp for uniqueness. * Uses the complete text in the hash — truncation previously * caused collisions for long observations that shared a prefix. */ export declare function createObservationId(entityId: EntityId, text: string, timestamp: string): ObservationId; /** * Creates a stable relation ID from its components * Same from+to+type always produces same ID (idempotent) */ export declare function createRelationId(fromId: EntityId, toId: EntityId, relationType: string): RelationId; /** * Validates an entity ID format */ export declare function isValidEntityId(id: string): id is EntityId; /** * Validates an observation ID format */ export declare function isValidObservationId(id: string): id is ObservationId; /** * Validates a relation ID format */ export declare function isValidRelationId(id: string): id is RelationId; /** * Creates branded ID from raw string (for deserialization) * Use with caution - only when loading from trusted source */ export declare function toEntityId(raw: string): EntityId; export declare function toObservationId(raw: string): ObservationId; export declare function toRelationId(raw: string): RelationId; //# sourceMappingURL=GraphIds.d.ts.map