export interface InterpretationConfig {
    provider: string;
    model_id: string;
    temperature: number;
    prompt_hash: string;
    code_version: string;
    feature_flags?: Record<string, boolean>;
    /** When true (default), create a user-scoped schema from extracted fields when entity type is unknown. */
    create_schema_for_unknown?: boolean;
}
export interface InterpretationOptions {
    userId: string;
    sourceId: string;
    extractedData: Record<string, unknown>[];
    config: InterpretationConfig;
}
export declare const UNKNOWN_FIELDS_HINT: string;
export interface InterpretationResult {
    interpretationId: string;
    observationsCreated: number;
    unknownFieldsCount: number;
    /** The field names that were not recognized by the schema. */
    unknownFieldNames: string[];
    /** Actionable guidance surfaced when unknownFieldsCount > 0. */
    hint?: string;
    observationsDeduplicated?: number;
    fixedPointReached?: boolean;
    convergenceIterations?: number;
    entities: Array<{
        entityId: string;
        entityType: string;
        observationId: string;
    }>;
    /** Debug: per-entity type refinement (extracted keys, type before/after) for store responses */
    refinement_debug?: Array<{
        extracted_keys: string[];
        type_before: string;
        type_after: string;
    }>;
    /**
     * Entity types for which no schema was found or could be auto-registered.
     * Payloads for these types were written as raw_fragments (reason: "no_schema"
     * or "no_schema_registration_failed") and will not appear in the entities array.
     * Callers should register a schema for each listed type.
     */
    noSchemaEntityTypes?: string[];
}
/**
 * Run interpretation on extracted data
 * Creates interpretation run, validates fields, resolves entities, creates observations
 */
export declare function runInterpretation(options: InterpretationOptions): Promise<InterpretationResult>;
/**
 * Run interpretation with fixed-point guarantee
 * Retries interpretation until canonical hash stabilizes
 *
 * Per idempotence directive:
 * - Accept output only when canonical hash stabilizes
 * - hash(n) == hash(n-1) means convergence
 * - Idempotence achieved post-generation
 */
export declare function runInterpretationWithFixedPoint(options: InterpretationOptions, maxIterations?: number): Promise<InterpretationResult>;
/**
 * Check interpretation quota (simple hard-coded limit for v0.2.0).
 * In local mode (user's own OPENAI key), no cap is enforced.
 */
export declare function checkInterpretationQuota(userId: string, limit?: number): Promise<{
    allowed: boolean;
    current: number;
    limit: number;
}>;
/**
 * Create relationship observations from relationship data
 */
export declare function createRelationshipObservations(relationships: Array<{
    relationship_type: string;
    source_entity_id: string;
    target_entity_id: string;
    metadata?: Record<string, unknown>;
}>, sourceId: string, interpretationId: string | null, userId: string, sourcePriority?: number): Promise<number>;
//# sourceMappingURL=interpretation.d.ts.map