/**
 * Observation Storage Service (Domain Layer)
 *
 * Handles observation CRUD operations, providing a clean domain interface
 * so that Presentation (actions.ts) and Application (server.ts) layers
 * do not access the database directly for observation operations.
 */
import type { ObservationSource } from "../shared/action_schemas.js";
/**
 * Default `observation_source` applied by the write path when a caller
 * omits the field. MCP / CLI callers are LLM-driven by construction, so
 * unclassified writes land in the LLM-summary bucket. Sensors, workflow
 * state machines, humans, and ETL pipelines MUST set the field
 * explicitly — the default is deliberately non-sensor so the reducer
 * does not over-weight unclassified writes.
 */
export declare const DEFAULT_OBSERVATION_SOURCE: ObservationSource;
export interface CreateObservationParams {
    entity_id: string;
    entity_type: string;
    schema_version: string;
    source_id: string | null;
    interpretation_id: string | null;
    observed_at: string;
    specificity_score: number;
    source_priority: number;
    /**
     * Kind of write (sensor | llm_summary | workflow_state | human | import).
     * Orthogonal to `source_priority` (numeric ranking) and to
     * `provenance`/AAuth (which agent wrote it). Omit to fall back to
     * {@link DEFAULT_OBSERVATION_SOURCE}. See openapi.yaml
     * `Observation.observation_source` for the semantic contract.
     */
    observation_source?: ObservationSource | null;
    /** Cross-instance sync: Neotoma peer id that originated this replayed write. */
    source_peer_id?: string | null;
    fields: Record<string, unknown>;
    user_id: string;
    idempotency_key?: string | null;
    /**
     * Structured identity classification from the resolver. Persisted per-row
     * so `/stats?by=identity_basis` can aggregate without re-running derivation.
     * See {@link ../services/entity_resolution.ts#IdentityBasis}.
     */
    identity_basis?: string | null;
    /**
     * Human-readable rule label that matched (e.g. `email`,
     * `composite:full_name+employer`, `first_string_field:name`).
     */
    identity_rule?: string | null;
}
export interface ObservationRecord {
    id: string;
    entity_id: string;
    entity_type: string;
    schema_version: string;
    source_id: string | null;
    interpretation_id: string | null;
    observed_at: string;
    specificity_score: number;
    source_priority: number;
    observation_source: ObservationSource | null;
    fields: Record<string, unknown>;
    user_id: string;
    created_at: string;
}
export declare function createObservation(params: CreateObservationParams): Promise<ObservationRecord>;
export declare function listObservationsForEntity(entityId: string, userId: string, options?: {
    limit?: number;
    offset?: number;
}): Promise<{
    data: ObservationRecord[];
    count: number;
}>;
export declare function listObservationsForSource(sourceId: string, userId: string): Promise<ObservationRecord[]>;
export declare function getObservationsByIds(ids: string[], userId: string): Promise<ObservationRecord[]>;
export declare function rewriteObservationEntityId(fromEntityId: string, toEntityId: string, userId: string): Promise<number>;
export declare function hasObservationsForEntity(entityId: string, userId: string): Promise<boolean>;
//# sourceMappingURL=observation_storage.d.ts.map