export interface EntityQueryOptions {
    userId?: string;
    entityType?: string;
    includeMerged?: boolean;
    includeDeleted?: boolean;
    includeSnapshots?: boolean;
    sortBy?: "entity_id" | "canonical_name" | "observation_count" | "last_observation_at" | "submitted_at";
    sortOrder?: "asc" | "desc";
    published?: boolean;
    publishedAfter?: string;
    publishedBefore?: string;
    limit?: number;
    offset?: number;
    /** When provided, fetch only these entity IDs (e.g. from semantic search) */
    entityIds?: string[];
    /** ISO 8601 timestamp; return entities whose updated_at is >= this value. */
    updatedSince?: string;
    /** ISO 8601 timestamp; return entities whose created_at is >= this value. */
    createdSince?: string;
    /**
     * R3: filter entities whose observations were resolved with a specific
     * `identity_basis` (see {@link IdentityBasis} in entity_resolution.ts). The
     * filter is satisfied when ANY observation for the entity was resolved with
     * the requested basis, so callers can ask "which entities were created via
     * heuristic name matching?" without joining observations themselves.
     *
     * Implemented as a pre-filter: resolve candidate `entity_id`s from the
     * `observations` table and intersect with the main entity query.
     */
    identityBasis?: "schema_rule" | "schema_lookup" | "heuristic_name" | "heuristic_fallback" | "target_id";
}
export interface EntityWithProvenance {
    entity_id: string;
    entity_type: string;
    canonical_name: string;
    schema_version?: string;
    snapshot: Record<string, unknown>;
    raw_fragments?: Record<string, unknown>;
    observation_count: number;
    last_observation_at: string;
    provenance: Record<string, unknown>;
    computed_at?: string;
    merged_to_entity_id?: string | null;
    merged_at?: string | null;
    /**
     * Optional schema-derived display label for `entity_type` (from
     * `SchemaMetadata.label`). Clients may surface this as a human-readable
     * subtitle to avoid re-deriving it per view.
     */
    entity_type_label?: string | null;
    /**
     * Optional ordered list of the most important snapshot fields for overview
     * display. Computed from schema field order when available. Clients are
     * free to ignore this and use their own ordering.
     */
    primary_fields?: string[];
    /**
     * Optional ISO timestamp of when the underlying `entities` row was created.
     * Surfaced here for overview cards; mirrors `entities.created_at`.
     */
    created_at?: string;
}
/**
 * Query entities with merged entity exclusion
 */
export declare function queryEntities(options?: EntityQueryOptions): Promise<EntityWithProvenance[]>;
/**
 * Get entity snapshot with full provenance chain
 *
 * Returns null if entity is deleted (has deletion observation).
 */
export declare function getEntityWithProvenance(entityId: string, includeDeleted?: boolean): Promise<EntityWithProvenance | null>;
/**
 * Get source metadata for provenance chain
 */
export declare function getSourceMetadata(sourceId: string): Promise<any>;
/**
 * Get interpretation run metadata for provenance chain
 */
export declare function getInterpretationMetadata(runId: string): Promise<any>;
/**
 * Get full provenance chain for an observation
 */
export declare function getObservationProvenance(observationId: string): Promise<any>;
//# sourceMappingURL=entity_queries.d.ts.map