/** * GraphSchemas - Type guards and validation for graph events and data * * Provides runtime validation for data entering the system. * All validators follow the pattern: (unknown) => value is Type */ import type { Entity, EntityId, GraphEvent, GraphSnapshot, GraphSnapshotMeta, MarkerEvent, Observation, ObservationId, ObservationSource, Relation, RelationId, EntityUpsertEvent, ObservationAddEvent, RelationAddEvent, RelationRemoveEvent, EntityDeleteEvent, ObservationDeleteEvent, SnapshotWrittenEvent, GraphStats, GraphIndex } from '../../types/graph.js'; export declare function isEntityId(value: unknown): value is EntityId; export declare function isObservationId(value: unknown): value is ObservationId; export declare function isRelationId(value: unknown): value is RelationId; export declare function isObservationSource(value: unknown): value is ObservationSource; export declare function isEntity(value: unknown): value is Entity; export declare function isObservation(value: unknown): value is Observation; export declare function isRelation(value: unknown): value is Relation; export declare function isMarkerEvent(value: unknown): value is MarkerEvent; export declare function isEntityUpsertEvent(value: unknown): value is EntityUpsertEvent; export declare function isObservationAddEvent(value: unknown): value is ObservationAddEvent; export declare function isRelationAddEvent(value: unknown): value is RelationAddEvent; export declare function isRelationRemoveEvent(value: unknown): value is RelationRemoveEvent; export declare function isEntityDeleteEvent(value: unknown): value is EntityDeleteEvent; export declare function isObservationDeleteEvent(value: unknown): value is ObservationDeleteEvent; export declare function isSnapshotWrittenEvent(value: unknown): value is SnapshotWrittenEvent; export declare function isGraphEvent(value: unknown): value is GraphEvent; export declare function isGraphStats(value: unknown): value is GraphStats; export declare function isGraphSnapshotMeta(value: unknown): value is GraphSnapshotMeta; export declare function isGraphSnapshot(value: unknown): value is GraphSnapshot; export declare function isGraphIndex(value: unknown): value is GraphIndex; /** * Validates that the first event in a JSONL file is a valid marker */ export declare function validateMarker(firstLine: string): { valid: true; } | { valid: false; error: string; }; /** * Parses a JSONL line into a GraphEvent */ export declare function parseEventLine(line: string, lineNumber: number): { success: true; event: GraphEvent; } | { success: false; error: string; }; /** * Validates entity input for upsert operations */ export declare function validateEntityInput(input: unknown): { valid: true; name: string; entityType: string; attrs?: Record; } | { valid: false; error: string; }; /** * Validates observation input */ export declare function validateObservationInput(input: unknown): { valid: true; entityRef: string; text: string; source?: ObservationSource; timestamp?: string; } | { valid: false; error: string; }; /** * Validates relation input */ export declare function validateRelationInput(input: unknown): { valid: true; from: string; relationType: string; to: string; } | { valid: false; error: string; }; //# sourceMappingURL=GraphSchemas.d.ts.map